Importing rustc-1.45.2
Change-Id: Idd187dd729f3089d9529753a17db5fbb40bacdeb
diff --git a/src/llvm-project/clang/test/AST/Inputs/json-dump-include.h b/src/llvm-project/clang/test/AST/Inputs/json-dump-include.h
new file mode 100644
index 0000000..9a51275
--- /dev/null
+++ b/src/llvm-project/clang/test/AST/Inputs/json-dump-include.h
@@ -0,0 +1 @@
+typedef int TestTypedefFromInclude;
diff --git a/src/llvm-project/clang/test/AST/Interp/cond.cpp b/src/llvm-project/clang/test/AST/Interp/cond.cpp
new file mode 100644
index 0000000..1fc69ed
--- /dev/null
+++ b/src/llvm-project/clang/test/AST/Interp/cond.cpp
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -std=c++17 -fsyntax-only -fexperimental-new-constant-interpreter %s -verify
+// RUN: %clang_cc1 -std=c++17 -fsyntax-only %s -verify
+// expected-no-diagnostics
+
+constexpr int cond_then_else(int a, int b) {
+ if (a < b) {
+ return b - a;
+ } else {
+ return a - b;
+ }
+}
diff --git a/src/llvm-project/clang/test/AST/ast-dump-aarch64-sve-types.c b/src/llvm-project/clang/test/AST/ast-dump-aarch64-sve-types.c
new file mode 100644
index 0000000..fdad9b4
--- /dev/null
+++ b/src/llvm-project/clang/test/AST/ast-dump-aarch64-sve-types.c
@@ -0,0 +1,38 @@
+// RUN: %clang_cc1 -triple aarch64-linux-gnu -ast-dump \
+// RUN: -ast-dump-filter __SV %s | FileCheck %s
+
+// CHECK: TypedefDecl {{.*}} implicit __SVInt8_t '__SVInt8_t'
+// CHECK-NEXT: -BuiltinType {{.*}} '__SVInt8_t'
+
+// CHECK: TypedefDecl {{.*}} implicit __SVInt16_t '__SVInt16_t'
+// CHECK-NEXT: -BuiltinType {{.*}} '__SVInt16_t'
+
+// CHECK: TypedefDecl {{.*}} implicit __SVInt32_t '__SVInt32_t'
+// CHECK-NEXT: -BuiltinType {{.*}} '__SVInt32_t'
+
+// CHECK: TypedefDecl {{.*}} implicit __SVInt64_t '__SVInt64_t'
+// CHECK-NEXT: -BuiltinType {{.*}} '__SVInt64_t'
+
+// CHECK: TypedefDecl {{.*}} implicit __SVUint8_t '__SVUint8_t'
+// CHECK-NEXT: -BuiltinType {{.*}} '__SVUint8_t'
+
+// CHECK: TypedefDecl {{.*}} implicit __SVUint16_t '__SVUint16_t'
+// CHECK-NEXT: -BuiltinType {{.*}} '__SVUint16_t'
+
+// CHECK: TypedefDecl {{.*}} implicit __SVUint32_t '__SVUint32_t'
+// CHECK-NEXT: -BuiltinType {{.*}} '__SVUint32_t'
+
+// CHECK: TypedefDecl {{.*}} implicit __SVUint64_t '__SVUint64_t'
+// CHECK-NEXT: -BuiltinType {{.*}} '__SVUint64_t'
+
+// CHECK: TypedefDecl {{.*}} implicit __SVFloat16_t '__SVFloat16_t'
+// CHECK-NEXT: -BuiltinType {{.*}} '__SVFloat16_t'
+
+// CHECK: TypedefDecl {{.*}} implicit __SVFloat32_t '__SVFloat32_t'
+// CHECK-NEXT: -BuiltinType {{.*}} '__SVFloat32_t'
+
+// CHECK: TypedefDecl {{.*}} implicit __SVFloat64_t '__SVFloat64_t'
+// CHECK-NEXT: -BuiltinType {{.*}} '__SVFloat64_t'
+
+// CHECK: TypedefDecl {{.*}} implicit __SVBool_t '__SVBool_t'
+// CHECK-NEXT: -BuiltinType {{.*}} '__SVBool_t'
diff --git a/src/llvm-project/clang/test/AST/ast-dump-attr.cpp b/src/llvm-project/clang/test/AST/ast-dump-attr.cpp
index 8f67b99..83c4a63 100644
--- a/src/llvm-project/clang/test/AST/ast-dump-attr.cpp
+++ b/src/llvm-project/clang/test/AST/ast-dump-attr.cpp
@@ -211,6 +211,23 @@
}
}
+namespace TestLifetimeCategories {
+class [[gsl::Owner(int)]] AOwner{};
+// CHECK: CXXRecordDecl{{.*}} class AOwner
+// CHECK: OwnerAttr {{.*}} int
+class [[gsl::Pointer(int)]] APointer{};
+// CHECK: CXXRecordDecl{{.*}} class APointer
+// CHECK: PointerAttr {{.*}} int
+
+class [[gsl::Pointer]] PointerWithoutArgument{};
+// CHECK: CXXRecordDecl{{.*}} class PointerWithoutArgument
+// CHECK: PointerAttr
+
+class [[gsl::Owner]] OwnerWithoutArgument{};
+// CHECK: CXXRecordDecl{{.*}} class OwnerWithoutArgument
+// CHECK: OwnerAttr
+} // namespace TestLifetimeCategories
+
// Verify the order of attributes in the Ast. It must reflect the order
// in the parsed source.
int mergeAttrTest() __attribute__((deprecated)) __attribute__((warn_unused_result));
diff --git a/src/llvm-project/clang/test/AST/ast-dump-color.cpp b/src/llvm-project/clang/test/AST/ast-dump-color.cpp
index f4bfdaa..6651ef2 100644
--- a/src/llvm-project/clang/test/AST/ast-dump-color.cpp
+++ b/src/llvm-project/clang/test/AST/ast-dump-color.cpp
@@ -49,13 +49,13 @@
//CHECK: {{^}}[[Blue]]| | |-[[RESET]][[MAGENTA]]IntegerLiteral[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:10:11[[RESET]]> [[Green]]'int'[[RESET]][[Cyan:.\[0;36m]][[RESET]][[Cyan]][[RESET]][[CYAN]] 1[[RESET]]{{$}}
//CHECK: {{^}}[[Blue]]| | `-[[RESET]][[MAGENTA]]CompoundStmt[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:14[[RESET]], [[Yellow]]line:15:3[[RESET]]>{{$}}
//CHECK: {{^}}[[Blue]]| | |-[[RESET]][[MAGENTA]]CaseStmt[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:11:3[[RESET]], [[Yellow]]line:12:27[[RESET]]>{{$}}
-//CHECK: {{^}}[[Blue]]| | | |-[[RESET]][[MAGENTA]]ConstantExpr[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:11:8[[RESET]]> [[Green]]'int'[[RESET]][[Cyan]][[RESET]][[Cyan]][[RESET]][[CYAN]] 1[[RESET]]{{$}}
+//CHECK: {{^}}[[Blue]]| | | |-[[RESET]][[MAGENTA]]ConstantExpr[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:11:8[[RESET]]> [[Green]]'int'[[RESET]][[Cyan]][[RESET]][[Cyan]][[RESET]][[CYAN]] Int: 1[[RESET]]{{$}}
//CHECK: {{^}}[[Blue]]| | | | `-[[RESET]][[MAGENTA]]IntegerLiteral[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:8[[RESET]]> [[Green]]'int'[[RESET]][[Cyan]][[RESET]][[Cyan]][[RESET]][[CYAN]] 1[[RESET]]{{$}}
//CHECK: {{^}}[[Blue]]| | | `-[[RESET]][[MAGENTA]]AttributedStmt[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:12:5[[RESET]], [[Yellow]]col:27[[RESET]]>{{$}}
//CHECK: {{^}}[[Blue]]| | | |-[[RESET]][[BLUE]]FallThroughAttr[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:7[[RESET]], [[Yellow]]col:14[[RESET]]>{{$}}
//CHECK: {{^}}[[Blue]]| | | `-[[RESET]][[MAGENTA]]NullStmt[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:27[[RESET]]>{{$}}
//CHECK: {{^}}[[Blue]]| | `-[[RESET]][[MAGENTA]]CaseStmt[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:13:3[[RESET]], [[Yellow]]line:14:5[[RESET]]>{{$}}
-//CHECK: {{^}}[[Blue]]| | |-[[RESET]][[MAGENTA]]ConstantExpr[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:13:8[[RESET]]> [[Green]]'int'[[RESET]][[Cyan]][[RESET]][[Cyan]][[RESET]][[CYAN]] 2[[RESET]]{{$}}
+//CHECK: {{^}}[[Blue]]| | |-[[RESET]][[MAGENTA]]ConstantExpr[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:13:8[[RESET]]> [[Green]]'int'[[RESET]][[Cyan]][[RESET]][[Cyan]][[RESET]][[CYAN]] Int: 2[[RESET]]{{$}}
//CHECK: {{^}}[[Blue]]| | | `-[[RESET]][[MAGENTA]]IntegerLiteral[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:8[[RESET]]> [[Green]]'int'[[RESET]][[Cyan]][[RESET]][[Cyan]][[RESET]][[CYAN]] 2[[RESET]]{{$}}
//CHECK: {{^}}[[Blue]]| | `-[[RESET]][[MAGENTA]]NullStmt[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:14:5[[RESET]]>{{$}}
//CHECK: {{^}}[[Blue]]| `-[[RESET]][[Blue]]FullComment[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:8:4[[RESET]], [[Yellow]]col:11[[RESET]]>{{$}}
diff --git a/src/llvm-project/clang/test/AST/ast-dump-comment-json.cpp b/src/llvm-project/clang/test/AST/ast-dump-comment-json.cpp
index ee4eec8..2263ed8 100644
--- a/src/llvm-project/clang/test/AST/ast-dump-comment-json.cpp
+++ b/src/llvm-project/clang/test/AST/ast-dump-comment-json.cpp
@@ -41,16 +41,19 @@
// CHECK: "kind": "FullComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 72,
// CHECK-NEXT: "line": 3,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 72,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 75,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -60,15 +63,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParagraphComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 72,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 72,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 75,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -78,15 +84,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TextComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 72,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 72,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 75,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -110,16 +119,19 @@
// CHECK: "kind": "FullComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 120,
// CHECK-NEXT: "line": 9,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 120,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 123,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -129,15 +141,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParagraphComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 120,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 120,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 123,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -147,15 +162,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TextComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 120,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 120,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 123,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -170,16 +188,19 @@
// CHECK: "kind": "FullComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 151,
// CHECK-NEXT: "line": 12,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 151,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 161,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -189,15 +210,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParagraphComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 151,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 151,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 151,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: }
@@ -207,15 +231,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TextComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 151,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 151,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 151,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: }
@@ -228,15 +255,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "BlockCommandComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 153,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 152,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 161,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -247,15 +277,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParagraphComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 158,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 158,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 161,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -265,15 +298,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TextComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 158,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 158,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 161,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -290,16 +326,19 @@
// CHECK: "kind": "FullComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 197,
// CHECK-NEXT: "line": 15,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 197,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 239,
// CHECK-NEXT: "line": 16,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 1
@@ -310,16 +349,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParagraphComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 197,
// CHECK-NEXT: "line": 15,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 197,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 197,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: }
@@ -329,15 +371,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TextComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 197,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 197,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 197,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: }
@@ -350,15 +395,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParamCommandComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 199,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 198,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 216,
// CHECK-NEXT: "line": 16,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
@@ -372,16 +420,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParagraphComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 208,
// CHECK-NEXT: "line": 15,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 208,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 216,
// CHECK-NEXT: "line": 16,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
@@ -392,16 +443,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TextComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 208,
// CHECK-NEXT: "line": 15,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 208,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 211,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -412,16 +466,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TextComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 216,
// CHECK-NEXT: "line": 16,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 216,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 216,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: }
@@ -436,15 +493,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParamCommandComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 218,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 217,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 239,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -458,15 +518,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParagraphComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 236,
// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 236,
// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 239,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -476,15 +539,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TextComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 236,
// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 236,
// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 239,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -501,16 +567,19 @@
// CHECK: "kind": "FullComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 294,
// CHECK-NEXT: "line": 19,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 294,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 309,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -520,15 +589,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParagraphComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 294,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 294,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 294,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: }
@@ -538,15 +610,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TextComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 294,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 294,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 294,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: }
@@ -559,15 +634,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TParamCommandComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 296,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 295,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 309,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -578,15 +656,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParagraphComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 306,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 306,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 309,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -596,15 +677,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TextComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 306,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 306,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 309,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -621,15 +705,18 @@
// CHECK: "kind": "FullComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 294,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 294,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 309,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -639,15 +726,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParagraphComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 294,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 294,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 294,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: }
@@ -657,15 +747,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TextComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 294,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 294,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 294,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: }
@@ -678,15 +771,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TParamCommandComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 296,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 295,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 309,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -700,15 +796,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParagraphComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 306,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 306,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 309,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -718,15 +817,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TextComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 306,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 306,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 309,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -743,16 +845,19 @@
// CHECK: "kind": "FullComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 372,
// CHECK-NEXT: "line": 22,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 372,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 374,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -762,15 +867,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParagraphComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 372,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 372,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 374,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -780,15 +888,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TextComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 372,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 372,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 372,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: }
@@ -799,15 +910,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "InlineCommandComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 373,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 373,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 374,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -826,16 +940,19 @@
// CHECK: "kind": "FullComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 415,
// CHECK-NEXT: "line": 25,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 415,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 434,
// CHECK-NEXT: "line": 26,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
@@ -846,16 +963,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParagraphComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 415,
// CHECK-NEXT: "line": 25,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 415,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 434,
// CHECK-NEXT: "line": 26,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
@@ -866,16 +986,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TextComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 415,
// CHECK-NEXT: "line": 25,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 415,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 415,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: }
@@ -886,15 +1009,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "HTMLStartTagComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 417,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 416,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 418,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -905,15 +1031,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TextComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 419,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 419,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 421,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -924,15 +1053,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "HTMLEndTagComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 424,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 422,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 425,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -943,16 +1075,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TextComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 430,
// CHECK-NEXT: "line": 26,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 430,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 430,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: }
@@ -963,15 +1098,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "HTMLStartTagComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 432,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 431,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 434,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -987,16 +1125,19 @@
// CHECK: "kind": "FullComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 466,
// CHECK-NEXT: "line": 29,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 466,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 476,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: }
@@ -1006,15 +1147,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParagraphComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 466,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 466,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 466,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: }
@@ -1024,15 +1168,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TextComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 466,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 466,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 466,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: }
@@ -1045,15 +1192,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VerbatimBlockComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 468,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 467,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 476,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: }
@@ -1065,16 +1215,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VerbatimBlockLineComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 480,
// CHECK-NEXT: "line": 30,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 480,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 484,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: }
@@ -1089,16 +1242,19 @@
// CHECK: "kind": "FullComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 537,
// CHECK-NEXT: "line": 34,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 537,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 562,
// CHECK-NEXT: "col": 29,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1108,15 +1264,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParagraphComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 537,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 537,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 537,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: }
@@ -1126,15 +1285,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TextComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 537,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 537,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 537,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: }
@@ -1147,15 +1309,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParamCommandComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 539,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 538,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 562,
// CHECK-NEXT: "col": 29,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1167,15 +1332,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParagraphComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 548,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 548,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 562,
// CHECK-NEXT: "col": 29,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1185,15 +1353,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TextComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 548,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 548,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 562,
// CHECK-NEXT: "col": 29,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1210,15 +1381,18 @@
// CHECK: "kind": "FullComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 537,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 537,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 562,
// CHECK-NEXT: "col": 29,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1228,15 +1402,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParagraphComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 537,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 537,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 537,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: }
@@ -1246,15 +1423,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TextComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 537,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 537,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 537,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: }
@@ -1267,15 +1447,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParamCommandComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 539,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 538,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 562,
// CHECK-NEXT: "col": 29,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1287,15 +1470,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParagraphComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 548,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 548,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 562,
// CHECK-NEXT: "col": 29,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1305,15 +1491,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TextComment",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 548,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 548,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 0
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 562,
// CHECK-NEXT: "col": 29,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
diff --git a/src/llvm-project/clang/test/AST/ast-dump-comment.cpp b/src/llvm-project/clang/test/AST/ast-dump-comment.cpp
index 5bd6934..da73483 100644
--- a/src/llvm-project/clang/test/AST/ast-dump-comment.cpp
+++ b/src/llvm-project/clang/test/AST/ast-dump-comment.cpp
@@ -47,6 +47,11 @@
// CHECK: VarDecl{{.*}}Test_InlineCommandComment
// CHECK: InlineCommandComment{{.*}} Name="c" RenderMonospaced Arg[0]="Aaa"
+/// \anchor Aaa
+int Test_InlineCommandCommentAnchor;
+// CHECK: VarDecl{{.*}}Test_InlineCommandComment
+// CHECK: InlineCommandComment{{.*}} Name="anchor" RenderAnchor Arg[0]="Aaa"
+
/// <a>Aaa</a>
/// <br/>
int Test_HTMLTagComment;
diff --git a/src/llvm-project/clang/test/AST/ast-dump-decl-context-json.cpp b/src/llvm-project/clang/test/AST/ast-dump-decl-context-json.cpp
new file mode 100644
index 0000000..8c67952
--- /dev/null
+++ b/src/llvm-project/clang/test/AST/ast-dump-decl-context-json.cpp
@@ -0,0 +1,321 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -ast-dump=json -ast-dump-filter Test %s | FileCheck %s
+
+namespace Test {
+
+namespace NS {
+void Function();
+}
+void NS::Function() {}
+
+struct S {
+ void Method();
+};
+void S::Method() {}
+
+} // namespace Test
+
+// NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py
+
+
+// CHECK: "kind": "NamespaceDecl",
+// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 116,
+// CHECK-NEXT: "file": "{{.*}}",
+// CHECK-NEXT: "line": 3,
+// CHECK-NEXT: "col": 11,
+// CHECK-NEXT: "tokLen": 4
+// CHECK-NEXT: },
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 106,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 9
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 234,
+// CHECK-NEXT: "line": 15,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "Test",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "NamespaceDecl",
+// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 134,
+// CHECK-NEXT: "line": 5,
+// CHECK-NEXT: "col": 11,
+// CHECK-NEXT: "tokLen": 2
+// CHECK-NEXT: },
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 124,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 9
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 156,
+// CHECK-NEXT: "line": 7,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "NS",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "FunctionDecl",
+// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 144,
+// CHECK-NEXT: "line": 6,
+// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "tokLen": 8
+// CHECK-NEXT: },
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 139,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 4
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 153,
+// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "Function",
+// CHECK-NEXT: "mangledName": "_ZN4Test2NS8FunctionEv",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "void ()"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "FunctionDecl",
+// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 167,
+// CHECK-NEXT: "line": 8,
+// CHECK-NEXT: "col": 10,
+// CHECK-NEXT: "tokLen": 8
+// CHECK-NEXT: },
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 158,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 4
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 179,
+// CHECK-NEXT: "col": 22,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "parentDeclContextId": "0x{{.*}}",
+// CHECK-NEXT: "previousDecl": "0x{{.*}}",
+// CHECK-NEXT: "name": "Function",
+// CHECK-NEXT: "mangledName": "_ZN4Test2NS8FunctionEv",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "void ()"
+// CHECK-NEXT: },
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CompoundStmt",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 178,
+// CHECK-NEXT: "col": 21,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 179,
+// CHECK-NEXT: "col": 22,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CXXRecordDecl",
+// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 189,
+// CHECK-NEXT: "line": 10,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 182,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 6
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 210,
+// CHECK-NEXT: "line": 12,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "S",
+// CHECK-NEXT: "tagUsed": "struct",
+// CHECK-NEXT: "completeDefinition": true,
+// CHECK-NEXT: "definitionData": {
+// CHECK-NEXT: "canConstDefaultInit": true,
+// CHECK-NEXT: "canPassInRegisters": true,
+// CHECK-NEXT: "copyAssign": {
+// CHECK-NEXT: "hasConstParam": true,
+// CHECK-NEXT: "implicitHasConstParam": true,
+// CHECK-NEXT: "needsImplicit": true,
+// CHECK-NEXT: "trivial": true
+// CHECK-NEXT: },
+// CHECK-NEXT: "copyCtor": {
+// CHECK-NEXT: "hasConstParam": true,
+// CHECK-NEXT: "implicitHasConstParam": true,
+// CHECK-NEXT: "needsImplicit": true,
+// CHECK-NEXT: "simple": true,
+// CHECK-NEXT: "trivial": true
+// CHECK-NEXT: },
+// CHECK-NEXT: "defaultCtor": {
+// CHECK-NEXT: "defaultedIsConstexpr": true,
+// CHECK-NEXT: "exists": true,
+// CHECK-NEXT: "isConstexpr": true,
+// CHECK-NEXT: "needsImplicit": true,
+// CHECK-NEXT: "trivial": true
+// CHECK-NEXT: },
+// CHECK-NEXT: "dtor": {
+// CHECK-NEXT: "irrelevant": true,
+// CHECK-NEXT: "needsImplicit": true,
+// CHECK-NEXT: "simple": true,
+// CHECK-NEXT: "trivial": true
+// CHECK-NEXT: },
+// CHECK-NEXT: "hasConstexprNonCopyMoveConstructor": true,
+// CHECK-NEXT: "isAggregate": true,
+// CHECK-NEXT: "isEmpty": true,
+// CHECK-NEXT: "isLiteral": true,
+// CHECK-NEXT: "isPOD": true,
+// CHECK-NEXT: "isStandardLayout": true,
+// CHECK-NEXT: "isTrivial": true,
+// CHECK-NEXT: "isTriviallyCopyable": true,
+// CHECK-NEXT: "moveAssign": {
+// CHECK-NEXT: "exists": true,
+// CHECK-NEXT: "needsImplicit": true,
+// CHECK-NEXT: "simple": true,
+// CHECK-NEXT: "trivial": true
+// CHECK-NEXT: },
+// CHECK-NEXT: "moveCtor": {
+// CHECK-NEXT: "exists": true,
+// CHECK-NEXT: "needsImplicit": true,
+// CHECK-NEXT: "simple": true,
+// CHECK-NEXT: "trivial": true
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CXXRecordDecl",
+// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 189,
+// CHECK-NEXT: "line": 10,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 182,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 6
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 189,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "isImplicit": true,
+// CHECK-NEXT: "name": "S",
+// CHECK-NEXT: "tagUsed": "struct"
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CXXMethodDecl",
+// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 200,
+// CHECK-NEXT: "line": 11,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 6
+// CHECK-NEXT: },
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 195,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 4
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 207,
+// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "Method",
+// CHECK-NEXT: "mangledName": "_ZN4Test1S6MethodEv",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "void ()"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CXXMethodDecl",
+// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 221,
+// CHECK-NEXT: "line": 13,
+// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "tokLen": 6
+// CHECK-NEXT: },
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 213,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 4
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 231,
+// CHECK-NEXT: "col": 19,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "parentDeclContextId": "0x{{.*}}",
+// CHECK-NEXT: "previousDecl": "0x{{.*}}",
+// CHECK-NEXT: "name": "Method",
+// CHECK-NEXT: "mangledName": "_ZN4Test1S6MethodEv",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "void ()"
+// CHECK-NEXT: },
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CompoundStmt",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 230,
+// CHECK-NEXT: "col": 18,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 231,
+// CHECK-NEXT: "col": 19,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
diff --git a/src/llvm-project/clang/test/AST/ast-dump-decl-json.c b/src/llvm-project/clang/test/AST/ast-dump-decl-json.c
index 0321a66..8d8f814 100644
--- a/src/llvm-project/clang/test/AST/ast-dump-decl-json.c
+++ b/src/llvm-project/clang/test/AST/ast-dump-decl-json.c
@@ -1,6 +1,9 @@
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -ast-dump=json -ast-dump-filter Test %s | FileCheck %s
+#include "Inputs/json-dump-include.h"
+
int TestLocation;
+TestTypedefFromInclude TestLocationFromInclude;
struct TestIndent {
int x;
@@ -89,44 +92,127 @@
// NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py
+// CHECK: "kind": "TypedefDecl",
+// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 12,
+// CHECK-NEXT: "file": "{{.*}}",
+// CHECK-NEXT: "line": 1,
+// CHECK-NEXT: "col": 13,
+// CHECK-NEXT: "tokLen": 22,
+// CHECK-NEXT: "includedFrom": {
+// CHECK-NEXT: "file": "{{.*}}"
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 0,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 7,
+// CHECK-NEXT: "includedFrom": {
+// CHECK-NEXT: "file": "{{.*}}"
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 12,
+// CHECK-NEXT: "col": 13,
+// CHECK-NEXT: "tokLen": 22,
+// CHECK-NEXT: "includedFrom": {
+// CHECK-NEXT: "file": "{{.*}}"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "isReferenced": true,
+// CHECK-NEXT: "name": "TestTypedefFromInclude",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "BuiltinType",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+
+
// CHECK: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 149,
// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 3,
+// CHECK-NEXT: "line": 5,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 12
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 145,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 149,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 12
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "TestLocation",
+// CHECK-NEXT: "mangledName": "TestLocation",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: }
// CHECK-NEXT: }
+// CHECK: "kind": "VarDecl",
+// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 186,
+// CHECK-NEXT: "file": "{{.*}}",
+// CHECK-NEXT: "line": 6,
+// CHECK-NEXT: "col": 24,
+// CHECK-NEXT: "tokLen": 23
+// CHECK-NEXT: },
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 163,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 22
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 186,
+// CHECK-NEXT: "col": 24,
+// CHECK-NEXT: "tokLen": 23
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "TestLocationFromInclude",
+// CHECK-NEXT: "mangledName": "TestLocationFromInclude",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "int",
+// CHECK-NEXT: "qualType": "TestTypedefFromInclude",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+
+
// CHECK: "kind": "RecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 219,
// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 5,
+// CHECK-NEXT: "line": 8,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 10
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 212,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 7,
+// CHECK-NEXT: "offset": 241,
+// CHECK-NEXT: "line": 10,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -139,16 +225,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 6,
+// CHECK-NEXT: "offset": 238,
+// CHECK-NEXT: "line": 9,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 234,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 238,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -164,18 +253,21 @@
// CHECK: "kind": "RecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 252,
// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 9,
+// CHECK-NEXT: "line": 12,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 12
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 245,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 14,
+// CHECK-NEXT: "offset": 305,
+// CHECK-NEXT: "line": 17,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -188,16 +280,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 10,
+// CHECK-NEXT: "offset": 273,
+// CHECK-NEXT: "line": 13,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 269,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 273,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -211,22 +306,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "RecordDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 11,
+// CHECK-NEXT: "offset": 285,
+// CHECK-NEXT: "line": 14,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 278,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 13,
+// CHECK-NEXT: "offset": 302,
+// CHECK-NEXT: "line": 16,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
-// CHECK-NEXT: "parentDeclContext": "0x{{.*}}",
+// CHECK-NEXT: "parentDeclContextId": "0x{{.*}}",
// CHECK-NEXT: "name": "y",
// CHECK-NEXT: "tagUsed": "struct",
// CHECK-NEXT: "completeDefinition": true,
@@ -235,16 +333,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 12,
+// CHECK-NEXT: "offset": 297,
+// CHECK-NEXT: "line": 15,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 293,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 297,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -262,17 +363,20 @@
// CHECK: "kind": "LabelDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 344,
// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 17,
+// CHECK-NEXT: "line": 20,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 334,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 9
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 344,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: }
@@ -284,17 +388,20 @@
// CHECK: "kind": "TypedefDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 411,
// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 21,
+// CHECK-NEXT: "line": 24,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 15
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 399,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 7
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 411,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 15
// CHECK-NEXT: }
@@ -317,18 +424,21 @@
// CHECK: "kind": "EnumDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 434,
// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 23,
+// CHECK-NEXT: "line": 26,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 12
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 429,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 25,
+// CHECK-NEXT: "offset": 464,
+// CHECK-NEXT: "line": 28,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -339,16 +449,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "EnumConstantDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 24,
+// CHECK-NEXT: "offset": 451,
+// CHECK-NEXT: "line": 27,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 12
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 451,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 12
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 451,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 12
// CHECK-NEXT: }
@@ -364,18 +477,21 @@
// CHECK: "kind": "RecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 475,
// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 27,
+// CHECK-NEXT: "line": 30,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 16
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 468,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 31,
+// CHECK-NEXT: "offset": 531,
+// CHECK-NEXT: "line": 34,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -388,17 +504,20 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "EnumDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 28,
+// CHECK-NEXT: "offset": 496,
+// CHECK-NEXT: "line": 31,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 496,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 30,
+// CHECK-NEXT: "offset": 526,
+// CHECK-NEXT: "line": 33,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -408,16 +527,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "EnumConstantDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 29,
+// CHECK-NEXT: "offset": 507,
+// CHECK-NEXT: "line": 32,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 16
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 507,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 16
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 507,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 16
// CHECK-NEXT: }
@@ -433,26 +555,29 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 30,
+// CHECK-NEXT: "offset": 528,
+// CHECK-NEXT: "line": 33,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 28,
+// CHECK-NEXT: "offset": 496,
+// CHECK-NEXT: "line": 31,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 30,
+// CHECK-NEXT: "offset": 528,
+// CHECK-NEXT: "line": 33,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "e",
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "enum TestEnumDeclAnon::(anonymous at {{.*}}:28:3)",
-// CHECK-NEXT: "qualType": "enum (anonymous enum at {{.*}}:28:3)"
+// CHECK-NEXT: "desugaredQualType": "enum TestEnumDeclAnon::(anonymous at {{.*}}:31:3)",
+// CHECK-NEXT: "qualType": "enum (anonymous enum at {{.*}}:31:3)"
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: ]
@@ -461,17 +586,20 @@
// CHECK: "kind": "EnumDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 540,
// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 33,
+// CHECK-NEXT: "line": 36,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 19
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 535,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 540,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 19
// CHECK-NEXT: }
@@ -482,18 +610,21 @@
// CHECK: "kind": "RecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 569,
// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 35,
+// CHECK-NEXT: "line": 38,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 14
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 562,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 37,
+// CHECK-NEXT: "offset": 595,
+// CHECK-NEXT: "line": 40,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -506,16 +637,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 36,
+// CHECK-NEXT: "offset": 592,
+// CHECK-NEXT: "line": 39,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 588,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 592,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -531,18 +665,21 @@
// CHECK: "kind": "RecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 606,
// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 39,
+// CHECK-NEXT: "line": 42,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 19
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 599,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 40,
+// CHECK-NEXT: "offset": 628,
+// CHECK-NEXT: "line": 43,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -555,18 +692,21 @@
// CHECK: "kind": "RecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 639,
// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 42,
+// CHECK-NEXT: "line": 45,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 19
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 632,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 45,
+// CHECK-NEXT: "offset": 697,
+// CHECK-NEXT: "line": 48,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -579,17 +719,20 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "RecordDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 43,
+// CHECK-NEXT: "offset": 663,
+// CHECK-NEXT: "line": 46,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 663,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 44,
+// CHECK-NEXT: "offset": 674,
+// CHECK-NEXT: "line": 47,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -601,25 +744,28 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 676,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 19
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 43,
+// CHECK-NEXT: "offset": 663,
+// CHECK-NEXT: "line": 46,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 44,
+// CHECK-NEXT: "offset": 676,
+// CHECK-NEXT: "line": 47,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 19
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "testRecordDeclAnon1",
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "struct TestRecordDeclAnon1::(anonymous at {{.*}}:43:3)",
-// CHECK-NEXT: "qualType": "struct (anonymous struct at {{.*}}:43:3)"
+// CHECK-NEXT: "desugaredQualType": "struct TestRecordDeclAnon1::(anonymous at {{.*}}:46:3)",
+// CHECK-NEXT: "qualType": "struct (anonymous struct at {{.*}}:46:3)"
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: ]
@@ -628,18 +774,21 @@
// CHECK: "kind": "RecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 708,
// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 47,
+// CHECK-NEXT: "line": 50,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 19
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 701,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 50,
+// CHECK-NEXT: "offset": 746,
+// CHECK-NEXT: "line": 53,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -652,17 +801,20 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "RecordDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 48,
+// CHECK-NEXT: "offset": 732,
+// CHECK-NEXT: "line": 51,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 732,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 49,
+// CHECK-NEXT: "offset": 743,
+// CHECK-NEXT: "line": 52,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -674,23 +826,26 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 48,
+// CHECK-NEXT: "offset": 732,
+// CHECK-NEXT: "line": 51,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 732,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 732,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "struct TestRecordDeclAnon2::(anonymous at {{.*}}:48:3)"
+// CHECK-NEXT: "qualType": "struct TestRecordDeclAnon2::(anonymous at {{.*}}:51:3)"
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: ]
@@ -699,17 +854,20 @@
// CHECK: "kind": "RecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 757,
// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 52,
+// CHECK-NEXT: "line": 55,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 21
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 750,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 757,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 21
// CHECK-NEXT: }
@@ -721,17 +879,20 @@
// CHECK: "kind": "EnumConstantDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 811,
// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 55,
+// CHECK-NEXT: "line": 58,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 20
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 811,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 20
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 811,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 20
// CHECK-NEXT: }
@@ -745,17 +906,20 @@
// CHECK: "kind": "EnumConstantDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 835,
// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 56,
+// CHECK-NEXT: "line": 59,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 24
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 835,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 24
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 862,
// CHECK-NEXT: "col": 30,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -770,10 +934,12 @@
// CHECK-NEXT: "kind": "ConstantExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 862,
// CHECK-NEXT: "col": 30,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 862,
// CHECK-NEXT: "col": 30,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -788,10 +954,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 862,
// CHECK-NEXT: "col": 30,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 862,
// CHECK-NEXT: "col": 30,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -810,18 +978,21 @@
// CHECK: "kind": "RecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 875,
// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 59,
+// CHECK-NEXT: "line": 62,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 21
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 868,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 63,
+// CHECK-NEXT: "offset": 930,
+// CHECK-NEXT: "line": 66,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -834,17 +1005,20 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "RecordDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 60,
+// CHECK-NEXT: "offset": 901,
+// CHECK-NEXT: "line": 63,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 901,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 62,
+// CHECK-NEXT: "offset": 927,
+// CHECK-NEXT: "line": 65,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -856,16 +1030,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 61,
+// CHECK-NEXT: "offset": 918,
+// CHECK-NEXT: "line": 64,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 914,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 918,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
@@ -881,39 +1058,45 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 60,
+// CHECK-NEXT: "offset": 901,
+// CHECK-NEXT: "line": 63,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 901,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 901,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "struct TestIndirectFieldDecl::(anonymous at {{.*}}:60:3)"
+// CHECK-NEXT: "qualType": "struct TestIndirectFieldDecl::(anonymous at {{.*}}:63:3)"
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: {
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "IndirectFieldDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 61,
+// CHECK-NEXT: "offset": 918,
+// CHECK-NEXT: "line": 64,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 918,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 918,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
@@ -927,47 +1110,55 @@
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1003,
// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 66,
+// CHECK-NEXT: "line": 69,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 16
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 999,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 68,
+// CHECK-NEXT: "offset": 1055,
+// CHECK-NEXT: "line": 71,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "TestFunctionDecl",
+// CHECK-NEXT: "mangledName": "TestFunctionDecl",
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int (int, enum (anonymous enum at {{.*}}:66:29))"
+// CHECK-NEXT: "qualType": "int (int, enum (anonymous enum at {{.*}}:69:29))"
// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 66,
+// CHECK-NEXT: "offset": 1024,
+// CHECK-NEXT: "line": 69,
// CHECK-NEXT: "col": 26,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1020,
// CHECK-NEXT: "col": 22,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1024,
// CHECK-NEXT: "col": 26,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "x",
+// CHECK-NEXT: "mangledName": "x",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: }
@@ -976,23 +1167,27 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1038,
// CHECK-NEXT: "col": 40,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1027,
// CHECK-NEXT: "col": 29,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1038,
// CHECK-NEXT: "col": 40,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "y",
+// CHECK-NEXT: "mangledName": "y",
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "enum (anonymous at {{.*}}:66:29)",
-// CHECK-NEXT: "qualType": "enum (anonymous enum at {{.*}}:66:29)"
+// CHECK-NEXT: "desugaredQualType": "enum (anonymous at {{.*}}:69:29)",
+// CHECK-NEXT: "qualType": "enum (anonymous enum at {{.*}}:69:29)"
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: {
@@ -1000,11 +1195,13 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1041,
// CHECK-NEXT: "col": 43,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 68,
+// CHECK-NEXT: "offset": 1055,
+// CHECK-NEXT: "line": 71,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1015,11 +1212,13 @@
// CHECK-NEXT: "kind": "ReturnStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 67,
+// CHECK-NEXT: "offset": 1045,
+// CHECK-NEXT: "line": 70,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1052,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1030,10 +1229,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1052,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1052,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1049,10 +1250,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1052,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1052,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1082,22 +1285,26 @@
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1113,
// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 71,
+// CHECK-NEXT: "line": 74,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 17
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1109,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1162,
// CHECK-NEXT: "col": 54,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "TestFunctionDecl2",
+// CHECK-NEXT: "mangledName": "TestFunctionDecl2",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int (enum Enum)"
// CHECK-NEXT: },
@@ -1106,21 +1313,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1147,
// CHECK-NEXT: "col": 39,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1131,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1147,
// CHECK-NEXT: "col": 39,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "x",
+// CHECK-NEXT: "mangledName": "x",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "desugaredQualType": "enum Enum",
// CHECK-NEXT: "qualType": "enum Enum"
@@ -1131,10 +1342,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1150,
// CHECK-NEXT: "col": 42,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1162,
// CHECK-NEXT: "col": 54,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1145,10 +1358,12 @@
// CHECK-NEXT: "kind": "ReturnStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1152,
// CHECK-NEXT: "col": 44,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1159,
// CHECK-NEXT: "col": 51,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1159,10 +1374,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1159,
// CHECK-NEXT: "col": 51,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1159,
// CHECK-NEXT: "col": 51,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1178,10 +1395,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1159,
// CHECK-NEXT: "col": 51,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1159,
// CHECK-NEXT: "col": 51,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1198,10 +1417,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1159,
// CHECK-NEXT: "col": 51,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1159,
// CHECK-NEXT: "col": 51,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1235,22 +1456,26 @@
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1168,
// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 72,
+// CHECK-NEXT: "line": 75,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 21
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1164,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1195,
// CHECK-NEXT: "col": 32,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "TestFunctionDeclProto",
+// CHECK-NEXT: "mangledName": "TestFunctionDeclProto",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int (int)"
// CHECK-NEXT: },
@@ -1259,20 +1484,24 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1194,
// CHECK-NEXT: "col": 31,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1190,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1194,
// CHECK-NEXT: "col": 31,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "x",
+// CHECK-NEXT: "mangledName": "x",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: }
@@ -1283,22 +1512,26 @@
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1203,
// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 73,
+// CHECK-NEXT: "line": 76,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 23
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1198,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1227,
// CHECK-NEXT: "col": 30,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "TestFunctionDeclNoProto",
+// CHECK-NEXT: "mangledName": "TestFunctionDeclNoProto",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: }
@@ -1307,22 +1540,26 @@
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1241,
// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 74,
+// CHECK-NEXT: "line": 77,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 18
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1230,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1260,
// CHECK-NEXT: "col": 31,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "TestFunctionDeclSC",
+// CHECK-NEXT: "mangledName": "TestFunctionDeclSC",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int ()"
// CHECK-NEXT: },
@@ -1332,22 +1569,26 @@
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1274,
// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 75,
+// CHECK-NEXT: "line": 78,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 22
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1263,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1297,
// CHECK-NEXT: "col": 35,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "TestFunctionDeclInline",
+// CHECK-NEXT: "mangledName": "TestFunctionDeclInline",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int ()"
// CHECK-NEXT: },
@@ -1357,17 +1598,20 @@
// CHECK: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1330,
// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 78,
+// CHECK-NEXT: "line": 81,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1326,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1330,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: }
@@ -1381,17 +1625,20 @@
// CHECK: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1351,
// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 79,
+// CHECK-NEXT: "line": 82,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 18
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1347,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1372,
// CHECK-NEXT: "col": 28,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1407,10 +1654,12 @@
// CHECK-NEXT: "kind": "ConstantExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1372,
// CHECK-NEXT: "col": 28,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1372,
// CHECK-NEXT: "col": 28,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1425,10 +1674,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1372,
// CHECK-NEXT: "col": 28,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1372,
// CHECK-NEXT: "col": 28,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1447,22 +1698,26 @@
// CHECK: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1383,
// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 82,
+// CHECK-NEXT: "line": 85,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 11
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1379,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1383,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 11
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "TestVarDecl",
+// CHECK-NEXT: "mangledName": "TestVarDecl",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: }
@@ -1471,22 +1726,26 @@
// CHECK: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1407,
// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 83,
+// CHECK-NEXT: "line": 86,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1396,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1407,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "TestVarDeclSC",
+// CHECK-NEXT: "mangledName": "TestVarDeclSC",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
@@ -1496,22 +1755,26 @@
// CHECK: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1435,
// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 84,
+// CHECK-NEXT: "line": 87,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 17
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1422,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1435,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 17
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "TestVarDeclThread",
+// CHECK-NEXT: "mangledName": "TestVarDeclThread",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
@@ -1521,22 +1784,26 @@
// CHECK: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1458,
// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 85,
+// CHECK-NEXT: "line": 88,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 15
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1454,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1476,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "TestVarDeclInit",
+// CHECK-NEXT: "mangledName": "TestVarDeclInit",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
@@ -1547,10 +1814,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1476,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1476,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1567,22 +1836,26 @@
// CHECK: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1505,
// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 87,
+// CHECK-NEXT: "line": 90,
// CHECK-NEXT: "col": 26,
// CHECK-NEXT: "tokLen": 15
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1501,
// CHECK-NEXT: "col": 22,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1505,
// CHECK-NEXT: "col": 26,
// CHECK-NEXT: "tokLen": 15
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "TestParmVarDecl",
+// CHECK-NEXT: "mangledName": "TestParmVarDecl",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: }
diff --git a/src/llvm-project/clang/test/AST/ast-dump-decl-json.m b/src/llvm-project/clang/test/AST/ast-dump-decl-json.m
index 5184106..d100811 100644
--- a/src/llvm-project/clang/test/AST/ast-dump-decl-json.m
+++ b/src/llvm-project/clang/test/AST/ast-dump-decl-json.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -Wno-unused -fblocks -ast-dump=json -ast-dump-filter Test %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -Wno-unused -fblocks -ast-dump=json -ast-dump-filter Test %s | FileCheck %s
@protocol P
@end
@@ -86,232 +86,262 @@
// NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py
-// CHECK: "kind": "ObjCInterfaceDecl",
+// CHECK: "kind": "ObjCInterfaceDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 9,
-// CHECK-NEXT: "col": 12,
+// CHECK-NEXT: "offset": 172,
+// CHECK-NEXT: "file": "{{.*}}",
+// CHECK-NEXT: "line": 9,
+// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 16
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 161,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 10,
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 194,
+// CHECK-NEXT: "line": 10,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "TestObjCIvarDecl",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "TestObjCIvarDecl",
+// CHECK-NEXT: "mangledName": "_OBJC_CLASS_$_TestObjCIvarDecl",
// CHECK-NEXT: "super": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCInterfaceDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCInterfaceDecl",
// CHECK-NEXT: "name": "A"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "implementation": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCImplementationDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCImplementationDecl",
// CHECK-NEXT: "name": "TestObjCIvarDecl"
// CHECK-NEXT: }
// CHECK-NEXT: }
-// CHECK: "kind": "ObjCImplementationDecl",
+// CHECK: "kind": "ObjCImplementationDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 12,
-// CHECK-NEXT: "col": 17,
+// CHECK-NEXT: "offset": 215,
+// CHECK-NEXT: "file": "{{.*}}",
+// CHECK-NEXT: "line": 12,
+// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 16
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 199,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 19,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 364,
+// CHECK-NEXT: "line": 19,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "TestObjCIvarDecl",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "TestObjCIvarDecl",
// CHECK-NEXT: "super": {
-// CHECK-NEXT: "id": "0x{{.*}}"
-// CHECK-NEXT: },
+// CHECK-NEXT: "id": "0x0"
+// CHECK-NEXT: },
// CHECK-NEXT: "interface": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCInterfaceDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCInterfaceDecl",
// CHECK-NEXT: "name": "TestObjCIvarDecl"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCIvarDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCIvarDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 13,
-// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "offset": 240,
+// CHECK-NEXT: "line": 13,
+// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 10
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 236,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "offset": 240,
+// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 10
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "varDefault",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "varDefault",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "access": "private"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCIvarDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCIvarDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 14,
-// CHECK-NEXT: "col": 16,
+// CHECK-NEXT: "offset": 267,
+// CHECK-NEXT: "line": 14,
+// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 10
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 12,
+// CHECK-NEXT: "offset": 263,
+// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 16,
+// CHECK-NEXT: "offset": 267,
+// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 10
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "varPrivate",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "varPrivate",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "access": "private"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCIvarDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCIvarDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 15,
-// CHECK-NEXT: "col": 18,
+// CHECK-NEXT: "offset": 296,
+// CHECK-NEXT: "line": 15,
+// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 12
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 14,
+// CHECK-NEXT: "offset": 292,
+// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 18,
+// CHECK-NEXT: "offset": 296,
+// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 12
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "varProtected",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "varProtected",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "access": "protected"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCIvarDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCIvarDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 16,
-// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "offset": 324,
+// CHECK-NEXT: "line": 16,
+// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 9
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 11,
+// CHECK-NEXT: "offset": 320,
+// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "offset": 324,
+// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 9
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "varPublic",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "varPublic",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "access": "public"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCIvarDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCIvarDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 17,
-// CHECK-NEXT: "col": 16,
+// CHECK-NEXT: "offset": 350,
+// CHECK-NEXT: "line": 17,
+// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 10
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 12,
+// CHECK-NEXT: "offset": 346,
+// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 16,
+// CHECK-NEXT: "offset": 350,
+// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 10
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "varPackage",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "varPackage",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "access": "package"
// CHECK-NEXT: }
// CHECK-NEXT: ]
// CHECK-NEXT: }
-// CHECK: "kind": "ObjCMethodDecl",
+// CHECK: "kind": "ObjCMethodDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 23,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 408,
+// CHECK-NEXT: "file": "{{.*}}",
+// CHECK-NEXT: "line": 23,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 408,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 40,
+// CHECK-NEXT: "offset": 447,
+// CHECK-NEXT: "col": 40,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "TestObjCMethodDecl:",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "TestObjCMethodDecl:",
+// CHECK-NEXT: "mangledName": "-[testObjCMethodDecl TestObjCMethodDecl:]",
// CHECK-NEXT: "returnType": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "instance": true,
-// CHECK-NEXT: "variadic": true,
+// CHECK-NEXT: },
+// CHECK-NEXT: "instance": true,
+// CHECK-NEXT: "variadic": true,
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "col": 34,
+// CHECK-NEXT: "offset": 441,
+// CHECK-NEXT: "col": 34,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 30,
+// CHECK-NEXT: "offset": 437,
+// CHECK-NEXT: "col": 30,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 34,
+// CHECK-NEXT: "offset": 441,
+// CHECK-NEXT: "col": 34,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "i",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "i",
+// CHECK-NEXT: "mangledName": "_i",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: }
@@ -320,130 +350,147 @@
// CHECK-NEXT: }
-// CHECK: "kind": "ObjCMethodDecl",
+// CHECK: "kind": "ObjCMethodDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 27,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 490,
+// CHECK-NEXT: "file": "{{.*}}",
+// CHECK-NEXT: "line": 27,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 490,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 29,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 544,
+// CHECK-NEXT: "line": 29,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "TestObjCMethodDecl:",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "TestObjCMethodDecl:",
+// CHECK-NEXT: "mangledName": "-[testObjCMethodDecl TestObjCMethodDecl:]",
// CHECK-NEXT: "returnType": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "instance": true,
-// CHECK-NEXT: "variadic": true,
+// CHECK-NEXT: },
+// CHECK-NEXT: "instance": true,
+// CHECK-NEXT: "variadic": true,
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitParamDecl",
-// CHECK-NEXT: "loc": {},
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitParamDecl",
+// CHECK-NEXT: "loc": {},
// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {},
+// CHECK-NEXT: "begin": {},
// CHECK-NEXT: "end": {}
-// CHECK-NEXT: },
-// CHECK-NEXT: "isImplicit": true,
-// CHECK-NEXT: "name": "self",
+// CHECK-NEXT: },
+// CHECK-NEXT: "isImplicit": true,
+// CHECK-NEXT: "name": "self",
+// CHECK-NEXT: "mangledName": "_self",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "testObjCMethodDecl *"
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitParamDecl",
-// CHECK-NEXT: "loc": {},
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitParamDecl",
+// CHECK-NEXT: "loc": {},
// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {},
+// CHECK-NEXT: "begin": {},
// CHECK-NEXT: "end": {}
-// CHECK-NEXT: },
-// CHECK-NEXT: "isImplicit": true,
-// CHECK-NEXT: "name": "_cmd",
+// CHECK-NEXT: },
+// CHECK-NEXT: "isImplicit": true,
+// CHECK-NEXT: "name": "_cmd",
+// CHECK-NEXT: "mangledName": "__cmd",
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "SEL *",
-// CHECK-NEXT: "qualType": "SEL"
+// CHECK-NEXT: "desugaredQualType": "SEL *",
+// CHECK-NEXT: "qualType": "SEL",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 27,
-// CHECK-NEXT: "col": 34,
+// CHECK-NEXT: "offset": 523,
+// CHECK-NEXT: "line": 27,
+// CHECK-NEXT: "col": 34,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 30,
+// CHECK-NEXT: "offset": 519,
+// CHECK-NEXT: "col": 30,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 34,
+// CHECK-NEXT: "offset": 523,
+// CHECK-NEXT: "col": 34,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "i",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "i",
+// CHECK-NEXT: "mangledName": "_i",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CompoundStmt",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 41,
+// CHECK-NEXT: "offset": 530,
+// CHECK-NEXT: "col": 41,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 29,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 544,
+// CHECK-NEXT: "line": 29,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ReturnStmt",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ReturnStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 28,
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 534,
+// CHECK-NEXT: "line": 28,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 10,
+// CHECK-NEXT: "offset": 541,
+// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "IntegerLiteral",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 10,
+// CHECK-NEXT: "offset": 541,
+// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 10,
+// CHECK-NEXT: "offset": 541,
+// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "value": "0"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@@ -454,239 +501,269 @@
// CHECK-NEXT: }
-// CHECK: "kind": "ObjCProtocolDecl",
+// CHECK: "kind": "ObjCProtocolDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 32,
-// CHECK-NEXT: "col": 11,
+// CHECK-NEXT: "offset": 562,
+// CHECK-NEXT: "file": "{{.*}}",
+// CHECK-NEXT: "line": 32,
+// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 20
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 552,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 34,
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 598,
+// CHECK-NEXT: "line": 34,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "TestObjCProtocolDecl",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "TestObjCProtocolDecl",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCMethodDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCMethodDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 33,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 583,
+// CHECK-NEXT: "line": 33,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 583,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 13,
+// CHECK-NEXT: "offset": 595,
+// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "foo",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "foo",
+// CHECK-NEXT: "mangledName": "-[TestObjCProtocolDecl foo]",
// CHECK-NEXT: "returnType": {
// CHECK-NEXT: "qualType": "void"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "instance": true
// CHECK-NEXT: }
// CHECK-NEXT: ]
// CHECK-NEXT: }
-// CHECK: "kind": "ObjCInterfaceDecl",
+// CHECK: "kind": "ObjCInterfaceDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 36,
-// CHECK-NEXT: "col": 12,
+// CHECK-NEXT: "offset": 614,
+// CHECK-NEXT: "file": "{{.*}}",
+// CHECK-NEXT: "line": 36,
+// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 13
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 603,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 38,
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 651,
+// CHECK-NEXT: "line": 38,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "TestObjCClass",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "TestObjCClass",
+// CHECK-NEXT: "mangledName": "_OBJC_CLASS_$_TestObjCClass",
// CHECK-NEXT: "super": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCInterfaceDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCInterfaceDecl",
// CHECK-NEXT: "name": "A"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "implementation": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCImplementationDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCImplementationDecl",
// CHECK-NEXT: "name": "TestObjCClass"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "protocols": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCProtocolDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCProtocolDecl",
// CHECK-NEXT: "name": "P"
// CHECK-NEXT: }
-// CHECK-NEXT: ],
+// CHECK-NEXT: ],
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCMethodDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCMethodDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 37,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 636,
+// CHECK-NEXT: "line": 37,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 636,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 13,
+// CHECK-NEXT: "offset": 648,
+// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "foo",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "foo",
+// CHECK-NEXT: "mangledName": "-[TestObjCClass foo]",
// CHECK-NEXT: "returnType": {
// CHECK-NEXT: "qualType": "void"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "instance": true
// CHECK-NEXT: }
// CHECK-NEXT: ]
// CHECK-NEXT: }
-// CHECK: "kind": "ObjCImplementationDecl",
+// CHECK: "kind": "ObjCImplementationDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 40,
-// CHECK-NEXT: "col": 17,
+// CHECK-NEXT: "offset": 672,
+// CHECK-NEXT: "file": "{{.*}}",
+// CHECK-NEXT: "line": 40,
+// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 13
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 656,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 45,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 720,
+// CHECK-NEXT: "line": 45,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "TestObjCClass",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "TestObjCClass",
// CHECK-NEXT: "super": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCInterfaceDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCInterfaceDecl",
// CHECK-NEXT: "name": "A"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "interface": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCInterfaceDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCInterfaceDecl",
// CHECK-NEXT: "name": "TestObjCClass"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCIvarDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCIvarDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 41,
-// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "offset": 698,
+// CHECK-NEXT: "line": 41,
+// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 694,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "offset": 698,
+// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "i",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "i",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "access": "private"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCMethodDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCMethodDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 43,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 703,
+// CHECK-NEXT: "line": 43,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 703,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 44,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 718,
+// CHECK-NEXT: "line": 44,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "foo",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "foo",
+// CHECK-NEXT: "mangledName": "-[TestObjCClass foo]",
// CHECK-NEXT: "returnType": {
// CHECK-NEXT: "qualType": "void"
-// CHECK-NEXT: },
-// CHECK-NEXT: "instance": true,
+// CHECK-NEXT: },
+// CHECK-NEXT: "instance": true,
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitParamDecl",
-// CHECK-NEXT: "loc": {},
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitParamDecl",
+// CHECK-NEXT: "loc": {},
// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {},
+// CHECK-NEXT: "begin": {},
// CHECK-NEXT: "end": {}
-// CHECK-NEXT: },
-// CHECK-NEXT: "isImplicit": true,
-// CHECK-NEXT: "name": "self",
+// CHECK-NEXT: },
+// CHECK-NEXT: "isImplicit": true,
+// CHECK-NEXT: "name": "self",
+// CHECK-NEXT: "mangledName": "_self",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "TestObjCClass *"
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitParamDecl",
-// CHECK-NEXT: "loc": {},
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitParamDecl",
+// CHECK-NEXT: "loc": {},
// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {},
+// CHECK-NEXT: "begin": {},
// CHECK-NEXT: "end": {}
-// CHECK-NEXT: },
-// CHECK-NEXT: "isImplicit": true,
-// CHECK-NEXT: "name": "_cmd",
+// CHECK-NEXT: },
+// CHECK-NEXT: "isImplicit": true,
+// CHECK-NEXT: "name": "_cmd",
+// CHECK-NEXT: "mangledName": "__cmd",
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "SEL *",
-// CHECK-NEXT: "qualType": "SEL"
+// CHECK-NEXT: "desugaredQualType": "SEL *",
+// CHECK-NEXT: "qualType": "SEL",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CompoundStmt",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 43,
-// CHECK-NEXT: "col": 14,
+// CHECK-NEXT: "offset": 716,
+// CHECK-NEXT: "line": 43,
+// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 44,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 718,
+// CHECK-NEXT: "line": 44,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: }
@@ -697,230 +774,257 @@
// CHECK-NEXT: }
-// CHECK: "kind": "ObjCCategoryDecl",
+// CHECK: "kind": "ObjCCategoryDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 47,
-// CHECK-NEXT: "col": 12,
+// CHECK-NEXT: "offset": 737,
+// CHECK-NEXT: "file": "{{.*}}",
+// CHECK-NEXT: "line": 47,
+// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 13
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 726,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 49,
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 793,
+// CHECK-NEXT: "line": 49,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "TestObjCCategoryDecl",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "TestObjCCategoryDecl",
// CHECK-NEXT: "interface": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCInterfaceDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCInterfaceDecl",
// CHECK-NEXT: "name": "TestObjCClass"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "implementation": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCCategoryImplDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCCategoryImplDecl",
// CHECK-NEXT: "name": "TestObjCCategoryDecl"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "protocols": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCProtocolDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCProtocolDecl",
// CHECK-NEXT: "name": "P"
// CHECK-NEXT: }
-// CHECK-NEXT: ],
+// CHECK-NEXT: ],
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCMethodDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCMethodDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 48,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 778,
+// CHECK-NEXT: "line": 48,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 778,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 13,
+// CHECK-NEXT: "offset": 790,
+// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "bar",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "bar",
+// CHECK-NEXT: "mangledName": "-[TestObjCCategoryDecl bar]",
// CHECK-NEXT: "returnType": {
// CHECK-NEXT: "qualType": "void"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "instance": true
// CHECK-NEXT: }
// CHECK-NEXT: ]
// CHECK-NEXT: }
-// CHECK: "kind": "ObjCInterfaceDecl",
+// CHECK: "kind": "ObjCInterfaceDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 51,
-// CHECK-NEXT: "col": 12,
+// CHECK-NEXT: "offset": 809,
+// CHECK-NEXT: "file": "{{.*}}",
+// CHECK-NEXT: "line": 51,
+// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 20
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 798,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 53,
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 845,
+// CHECK-NEXT: "line": 53,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "TestGenericInterface",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "TestGenericInterface",
+// CHECK-NEXT: "mangledName": "_OBJC_CLASS_$_TestGenericInterface",
// CHECK-NEXT: "super": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCInterfaceDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCInterfaceDecl",
// CHECK-NEXT: "name": "A"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "implementation": {
-// CHECK-NEXT: "id": "0x{{.*}}"
-// CHECK-NEXT: },
+// CHECK-NEXT: "id": "0x0"
+// CHECK-NEXT: },
// CHECK-NEXT: "protocols": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCProtocolDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCProtocolDecl",
// CHECK-NEXT: "name": "P"
// CHECK-NEXT: }
-// CHECK-NEXT: ],
+// CHECK-NEXT: ],
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCTypeParamDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCTypeParamDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 51,
-// CHECK-NEXT: "col": 33,
+// CHECK-NEXT: "offset": 830,
+// CHECK-NEXT: "line": 51,
+// CHECK-NEXT: "col": 33,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 33,
+// CHECK-NEXT: "offset": 830,
+// CHECK-NEXT: "col": 33,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 33,
+// CHECK-NEXT: "offset": 830,
+// CHECK-NEXT: "col": 33,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "T",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "T",
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "id",
-// CHECK-NEXT: "qualType": "id"
+// CHECK-NEXT: "desugaredQualType": "id",
+// CHECK-NEXT: "qualType": "id",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: ]
// CHECK-NEXT: }
-// CHECK: "kind": "ObjCCategoryImplDecl",
+// CHECK: "kind": "ObjCCategoryImplDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 55,
-// CHECK-NEXT: "col": 17,
+// CHECK-NEXT: "offset": 866,
+// CHECK-NEXT: "file": "{{.*}}",
+// CHECK-NEXT: "line": 55,
+// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 13
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 850,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 58,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 920,
+// CHECK-NEXT: "line": 58,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "TestObjCCategoryDecl",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "TestObjCCategoryDecl",
// CHECK-NEXT: "interface": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCInterfaceDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCInterfaceDecl",
// CHECK-NEXT: "name": "TestObjCClass"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "categoryDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCCategoryDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCCategoryDecl",
// CHECK-NEXT: "name": "TestObjCCategoryDecl"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCMethodDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCMethodDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 56,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 903,
+// CHECK-NEXT: "line": 56,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 903,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 57,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 918,
+// CHECK-NEXT: "line": 57,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "bar",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "bar",
+// CHECK-NEXT: "mangledName": "-[TestObjCClass(TestObjCCategoryDecl) bar]",
// CHECK-NEXT: "returnType": {
// CHECK-NEXT: "qualType": "void"
-// CHECK-NEXT: },
-// CHECK-NEXT: "instance": true,
+// CHECK-NEXT: },
+// CHECK-NEXT: "instance": true,
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitParamDecl",
-// CHECK-NEXT: "loc": {},
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitParamDecl",
+// CHECK-NEXT: "loc": {},
// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {},
+// CHECK-NEXT: "begin": {},
// CHECK-NEXT: "end": {}
-// CHECK-NEXT: },
-// CHECK-NEXT: "isImplicit": true,
-// CHECK-NEXT: "name": "self",
+// CHECK-NEXT: },
+// CHECK-NEXT: "isImplicit": true,
+// CHECK-NEXT: "name": "self",
+// CHECK-NEXT: "mangledName": "_self",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "TestObjCClass *"
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitParamDecl",
-// CHECK-NEXT: "loc": {},
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitParamDecl",
+// CHECK-NEXT: "loc": {},
// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {},
+// CHECK-NEXT: "begin": {},
// CHECK-NEXT: "end": {}
-// CHECK-NEXT: },
-// CHECK-NEXT: "isImplicit": true,
-// CHECK-NEXT: "name": "_cmd",
+// CHECK-NEXT: },
+// CHECK-NEXT: "isImplicit": true,
+// CHECK-NEXT: "name": "_cmd",
+// CHECK-NEXT: "mangledName": "__cmd",
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "SEL *",
-// CHECK-NEXT: "qualType": "SEL"
+// CHECK-NEXT: "desugaredQualType": "SEL *",
+// CHECK-NEXT: "qualType": "SEL",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CompoundStmt",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 56,
-// CHECK-NEXT: "col": 14,
+// CHECK-NEXT: "offset": 916,
+// CHECK-NEXT: "line": 56,
+// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 57,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 918,
+// CHECK-NEXT: "line": 57,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: }
@@ -931,266 +1035,303 @@
// CHECK-NEXT: }
-// CHECK: "kind": "ObjCCompatibleAliasDecl",
+// CHECK: "kind": "ObjCCompatibleAliasDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 60,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 926,
+// CHECK-NEXT: "file": "{{.*}}",
+// CHECK-NEXT: "line": 60,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 926,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 926,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "TestObjCCompatibleAliasDecl",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "TestObjCCompatibleAliasDecl",
// CHECK-NEXT: "interface": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCInterfaceDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCInterfaceDecl",
// CHECK-NEXT: "name": "A"
// CHECK-NEXT: }
// CHECK-NEXT: }
-// CHECK: "kind": "ObjCInterfaceDecl",
+// CHECK: "kind": "ObjCInterfaceDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 62,
-// CHECK-NEXT: "col": 12,
+// CHECK-NEXT: "offset": 990,
+// CHECK-NEXT: "file": "{{.*}}",
+// CHECK-NEXT: "line": 62,
+// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 16
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 979,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 65,
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 1086,
+// CHECK-NEXT: "line": 65,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "TestObjCProperty",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "TestObjCProperty",
+// CHECK-NEXT: "mangledName": "_OBJC_CLASS_$_TestObjCProperty",
// CHECK-NEXT: "super": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCInterfaceDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCInterfaceDecl",
// CHECK-NEXT: "name": "A"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "implementation": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCImplementationDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCImplementationDecl",
// CHECK-NEXT: "name": "TestObjCProperty"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCPropertyDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCPropertyDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 63,
-// CHECK-NEXT: "col": 52,
+// CHECK-NEXT: "offset": 1061,
+// CHECK-NEXT: "line": 63,
+// CHECK-NEXT: "col": 52,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 1010,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 52,
+// CHECK-NEXT: "offset": 1061,
+// CHECK-NEXT: "col": 52,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "foo",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "foo",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "getter": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCMethodDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCMethodDecl",
// CHECK-NEXT: "name": "getterFoo"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "setter": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCMethodDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCMethodDecl",
// CHECK-NEXT: "name": "setterFoo:"
-// CHECK-NEXT: },
-// CHECK-NEXT: "assign": true,
-// CHECK-NEXT: "readwrite": true,
-// CHECK-NEXT: "atomic": true,
+// CHECK-NEXT: },
+// CHECK-NEXT: "assign": true,
+// CHECK-NEXT: "readwrite": true,
+// CHECK-NEXT: "atomic": true,
// CHECK-NEXT: "unsafe_unretained": true
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCPropertyDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCPropertyDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 64,
-// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "offset": 1080,
+// CHECK-NEXT: "line": 64,
+// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 1066,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "offset": 1080,
+// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "bar",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "bar",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "assign": true,
-// CHECK-NEXT: "readwrite": true,
-// CHECK-NEXT: "atomic": true,
+// CHECK-NEXT: },
+// CHECK-NEXT: "assign": true,
+// CHECK-NEXT: "readwrite": true,
+// CHECK-NEXT: "atomic": true,
// CHECK-NEXT: "unsafe_unretained": true
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCMethodDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCMethodDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 63,
-// CHECK-NEXT: "col": 52,
+// CHECK-NEXT: "offset": 1061,
+// CHECK-NEXT: "line": 63,
+// CHECK-NEXT: "col": 52,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 52,
+// CHECK-NEXT: "offset": 1061,
+// CHECK-NEXT: "col": 52,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 52,
+// CHECK-NEXT: "offset": 1061,
+// CHECK-NEXT: "col": 52,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "isImplicit": true,
-// CHECK-NEXT: "name": "getterFoo",
+// CHECK-NEXT: },
+// CHECK-NEXT: "isImplicit": true,
+// CHECK-NEXT: "name": "getterFoo",
+// CHECK-NEXT: "mangledName": "-[TestObjCProperty getterFoo]",
// CHECK-NEXT: "returnType": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "instance": true
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCMethodDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCMethodDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "col": 52,
+// CHECK-NEXT: "offset": 1061,
+// CHECK-NEXT: "col": 52,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 52,
+// CHECK-NEXT: "offset": 1061,
+// CHECK-NEXT: "col": 52,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 52,
+// CHECK-NEXT: "offset": 1061,
+// CHECK-NEXT: "col": 52,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "isImplicit": true,
-// CHECK-NEXT: "name": "setterFoo:",
+// CHECK-NEXT: },
+// CHECK-NEXT: "isImplicit": true,
+// CHECK-NEXT: "name": "setterFoo:",
+// CHECK-NEXT: "mangledName": "-[TestObjCProperty setterFoo:]",
// CHECK-NEXT: "returnType": {
// CHECK-NEXT: "qualType": "void"
-// CHECK-NEXT: },
-// CHECK-NEXT: "instance": true,
+// CHECK-NEXT: },
+// CHECK-NEXT: "instance": true,
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "col": 52,
+// CHECK-NEXT: "offset": 1061,
+// CHECK-NEXT: "col": 52,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 52,
+// CHECK-NEXT: "offset": 1061,
+// CHECK-NEXT: "col": 52,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 52,
+// CHECK-NEXT: "offset": 1061,
+// CHECK-NEXT: "col": 52,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "foo",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "foo",
+// CHECK-NEXT: "mangledName": "_foo",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCMethodDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCMethodDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 64,
-// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "offset": 1080,
+// CHECK-NEXT: "line": 64,
+// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "offset": 1080,
+// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "offset": 1080,
+// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "isImplicit": true,
-// CHECK-NEXT: "name": "bar",
+// CHECK-NEXT: },
+// CHECK-NEXT: "isImplicit": true,
+// CHECK-NEXT: "name": "bar",
+// CHECK-NEXT: "mangledName": "-[TestObjCProperty bar]",
// CHECK-NEXT: "returnType": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "instance": true
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCMethodDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCMethodDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "offset": 1080,
+// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "offset": 1080,
+// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "offset": 1080,
+// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "isImplicit": true,
-// CHECK-NEXT: "name": "setBar:",
+// CHECK-NEXT: },
+// CHECK-NEXT: "isImplicit": true,
+// CHECK-NEXT: "name": "setBar:",
+// CHECK-NEXT: "mangledName": "-[TestObjCProperty setBar:]",
// CHECK-NEXT: "returnType": {
// CHECK-NEXT: "qualType": "void"
-// CHECK-NEXT: },
-// CHECK-NEXT: "instance": true,
+// CHECK-NEXT: },
+// CHECK-NEXT: "instance": true,
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "offset": 1080,
+// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "offset": 1080,
+// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "offset": 1080,
+// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "bar",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "bar",
+// CHECK-NEXT: "mangledName": "_bar",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: }
@@ -1201,366 +1342,580 @@
// CHECK-NEXT: }
-// CHECK: "kind": "ObjCImplementationDecl",
+// CHECK: "kind": "ObjCImplementationDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 67,
-// CHECK-NEXT: "col": 17,
+// CHECK-NEXT: "offset": 1107,
+// CHECK-NEXT: "file": "{{.*}}",
+// CHECK-NEXT: "line": 67,
+// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 16
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 1091,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 72,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 1173,
+// CHECK-NEXT: "line": 72,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "TestObjCProperty",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "TestObjCProperty",
// CHECK-NEXT: "super": {
-// CHECK-NEXT: "id": "0x{{.*}}"
-// CHECK-NEXT: },
+// CHECK-NEXT: "id": "0x0"
+// CHECK-NEXT: },
// CHECK-NEXT: "interface": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCInterfaceDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCInterfaceDecl",
// CHECK-NEXT: "name": "TestObjCProperty"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCIvarDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCIvarDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 68,
-// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "offset": 1132,
+// CHECK-NEXT: "line": 68,
+// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 1128,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "offset": 1132,
+// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "i",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "i",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "access": "private"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCPropertyImplDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCPropertyImplDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 70,
-// CHECK-NEXT: "col": 13,
+// CHECK-NEXT: "offset": 1149,
+// CHECK-NEXT: "line": 70,
+// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 1137,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 17,
+// CHECK-NEXT: "offset": 1153,
+// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "foo",
-// CHECK-NEXT: "implKind": "synthesize",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "foo",
+// CHECK-NEXT: "implKind": "synthesize",
// CHECK-NEXT: "propertyDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCPropertyDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCPropertyDecl",
// CHECK-NEXT: "name": "foo"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "ivarDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCIvarDecl",
-// CHECK-NEXT: "name": "i",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCIvarDecl",
+// CHECK-NEXT: "name": "i",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: }
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCIvarDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCIvarDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 71,
-// CHECK-NEXT: "col": 13,
+// CHECK-NEXT: "offset": 1168,
+// CHECK-NEXT: "line": 71,
+// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 13,
+// CHECK-NEXT: "offset": 1168,
+// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 13,
+// CHECK-NEXT: "offset": 1168,
+// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "bar",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "bar",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "synthesized": true,
+// CHECK-NEXT: },
+// CHECK-NEXT: "synthesized": true,
// CHECK-NEXT: "access": "private"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCPropertyImplDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCPropertyImplDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "col": 13,
+// CHECK-NEXT: "offset": 1168,
+// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 1156,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 13,
+// CHECK-NEXT: "offset": 1168,
+// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "bar",
-// CHECK-NEXT: "implKind": "synthesize",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "bar",
+// CHECK-NEXT: "implKind": "synthesize",
// CHECK-NEXT: "propertyDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCPropertyDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCPropertyDecl",
// CHECK-NEXT: "name": "bar"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "ivarDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCIvarDecl",
-// CHECK-NEXT: "name": "bar",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCIvarDecl",
+// CHECK-NEXT: "name": "bar",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: }
// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCMethodDecl",
+// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1137,
+// CHECK-NEXT: "line": 70,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1137,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1149,
+// CHECK-NEXT: "col": 13,
+// CHECK-NEXT: "tokLen": 3
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "isImplicit": true,
+// CHECK-NEXT: "name": "getterFoo",
+// CHECK-NEXT: "mangledName": "-[TestObjCProperty getterFoo]",
+// CHECK-NEXT: "returnType": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "instance": true
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCMethodDecl",
+// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1137,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1137,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1149,
+// CHECK-NEXT: "col": 13,
+// CHECK-NEXT: "tokLen": 3
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "isImplicit": true,
+// CHECK-NEXT: "name": "setterFoo:",
+// CHECK-NEXT: "mangledName": "-[TestObjCProperty setterFoo:]",
+// CHECK-NEXT: "returnType": {
+// CHECK-NEXT: "qualType": "void"
+// CHECK-NEXT: },
+// CHECK-NEXT: "instance": true,
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1061,
+// CHECK-NEXT: "line": 63,
+// CHECK-NEXT: "col": 52,
+// CHECK-NEXT: "tokLen": 3
+// CHECK-NEXT: },
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1061,
+// CHECK-NEXT: "col": 52,
+// CHECK-NEXT: "tokLen": 3
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1061,
+// CHECK-NEXT: "col": 52,
+// CHECK-NEXT: "tokLen": 3
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "foo",
+// CHECK-NEXT: "mangledName": "_foo",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCMethodDecl",
+// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1156,
+// CHECK-NEXT: "line": 71,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1156,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1168,
+// CHECK-NEXT: "col": 13,
+// CHECK-NEXT: "tokLen": 3
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "isImplicit": true,
+// CHECK-NEXT: "name": "bar",
+// CHECK-NEXT: "mangledName": "-[TestObjCProperty bar]",
+// CHECK-NEXT: "returnType": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "instance": true
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCMethodDecl",
+// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1156,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1156,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1168,
+// CHECK-NEXT: "col": 13,
+// CHECK-NEXT: "tokLen": 3
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "isImplicit": true,
+// CHECK-NEXT: "name": "setBar:",
+// CHECK-NEXT: "mangledName": "-[TestObjCProperty setBar:]",
+// CHECK-NEXT: "returnType": {
+// CHECK-NEXT: "qualType": "void"
+// CHECK-NEXT: },
+// CHECK-NEXT: "instance": true,
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1080,
+// CHECK-NEXT: "line": 64,
+// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "tokLen": 3
+// CHECK-NEXT: },
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1080,
+// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "tokLen": 3
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1080,
+// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "tokLen": 3
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "bar",
+// CHECK-NEXT: "mangledName": "_bar",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT: ]
// CHECK-NEXT: }
-// CHECK: "kind": "FunctionDecl",
+// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 74,
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 1184,
+// CHECK-NEXT: "file": "{{.*}}",
+// CHECK-NEXT: "line": 74,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 13
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 1179,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 76,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 1230,
+// CHECK-NEXT: "line": 76,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "TestBlockDecl",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "TestBlockDecl",
+// CHECK-NEXT: "mangledName": "_TestBlockDecl",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (int)"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 74,
-// CHECK-NEXT: "col": 24,
+// CHECK-NEXT: "offset": 1202,
+// CHECK-NEXT: "line": 74,
+// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 20,
+// CHECK-NEXT: "offset": 1198,
+// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 24,
+// CHECK-NEXT: "offset": 1202,
+// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "isUsed": true,
-// CHECK-NEXT: "name": "x",
+// CHECK-NEXT: },
+// CHECK-NEXT: "isUsed": true,
+// CHECK-NEXT: "name": "x",
+// CHECK-NEXT: "mangledName": "_x",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CompoundStmt",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 27,
+// CHECK-NEXT: "offset": 1205,
+// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 76,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 1230,
+// CHECK-NEXT: "line": 76,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ExprWithCleanups",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ExprWithCleanups",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 75,
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 1209,
+// CHECK-NEXT: "line": 75,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 21,
+// CHECK-NEXT: "offset": 1227,
+// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (^)(int, ...)"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "cleanupsHaveSideEffects": true,
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "cleanupsHaveSideEffects": true,
// CHECK-NEXT: "cleanups": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "BlockDecl"
// CHECK-NEXT: }
-// CHECK-NEXT: ],
+// CHECK-NEXT: ],
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "BlockExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "BlockExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 1209,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 21,
+// CHECK-NEXT: "offset": 1227,
+// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (^)(int, ...)"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "BlockDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "BlockDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 1209,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 1209,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 21,
+// CHECK-NEXT: "offset": 1227,
+// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "variadic": true,
+// CHECK-NEXT: },
+// CHECK-NEXT: "variadic": true,
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "offset": 1215,
+// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 5,
+// CHECK-NEXT: "offset": 1211,
+// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "offset": 1215,
+// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "y",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "y",
+// CHECK-NEXT: "mangledName": "_y",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "kind": "Capture",
+// CHECK-NEXT: "kind": "Capture",
// CHECK-NEXT: "var": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "x",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "x",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: }
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CompoundStmt",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 16,
+// CHECK-NEXT: "offset": 1222,
+// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 21,
+// CHECK-NEXT: "offset": 1227,
+// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 18,
+// CHECK-NEXT: "offset": 1224,
+// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 18,
+// CHECK-NEXT: "offset": 1224,
+// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 18,
+// CHECK-NEXT: "offset": 1224,
+// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 18,
+// CHECK-NEXT: "offset": 1224,
+// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "const int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "x",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "x",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: }
@@ -1569,25 +1924,29 @@
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "offset": 1215,
+// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 5,
+// CHECK-NEXT: "offset": 1211,
+// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "offset": 1215,
+// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "y",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "y",
+// CHECK-NEXT: "mangledName": "_y",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: }
@@ -1604,26 +1963,30 @@
// CHECK-NEXT: }
-// CHECK: "kind": "VarDecl",
+// CHECK: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 83,
-// CHECK-NEXT: "col": 21,
+// CHECK-NEXT: "offset": 1296,
+// CHECK-NEXT: "file": "{{.*}}",
+// CHECK-NEXT: "line": 83,
+// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 1278,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 10
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 21,
+// CHECK-NEXT: "offset": 1296,
+// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "Test",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "Test",
+// CHECK-NEXT: "mangledName": "_Test",
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "int",
+// CHECK-NEXT: "desugaredQualType": "int",
// CHECK-NEXT: "qualType": "typeof (B.foo)"
// CHECK-NEXT: }
// CHECK-NEXT: }
diff --git a/src/llvm-project/clang/test/AST/ast-dump-decl.cpp b/src/llvm-project/clang/test/AST/ast-dump-decl.cpp
index 0d8fadc..5297334 100644
--- a/src/llvm-project/clang/test/AST/ast-dump-decl.cpp
+++ b/src/llvm-project/clang/test/AST/ast-dump-decl.cpp
@@ -413,13 +413,13 @@
// CHECK: ClassTemplateDecl 0x{{.+}} <{{.+}}:275:3, col:68> col:68 TestTemplateTemplateDefaultType
// CHECK-NEXT: |-TemplateTemplateParmDecl 0x{{.+}} <col:12, col:42> col:37 depth 0 index 0 TT
-// CHECK-NEXT: | |-TemplateTypeParmDecl 0x{{.+}} <col:21> col:21 typename depth 1 index 0
+// CHECK-NEXT: | |-TemplateTypeParmDecl 0x{{.+}} <col:21> col:29 typename depth 1 index 0
// CHECK-NEXT: | `-TemplateArgument <col:42> template TestClassTemplate
// CHECK-NEXT: `-CXXRecordDecl 0x{{.+}} <col:61, col:68> col:68 struct TestTemplateTemplateDefaultType
// CHECK: ClassTemplateDecl 0x{{.+}} prev 0x{{.+}} <{{.+}}:276:3, col:82> col:48 TestTemplateTemplateDefaultType
// CHECK-NEXT: |-TemplateTemplateParmDecl 0x{{.+}} <col:12, col:37> col:37 depth 0 index 0 TT
-// CHECK-NEXT: | |-TemplateTypeParmDecl 0x{{.+}} <col:21> col:21 typename depth 1 index 0
+// CHECK-NEXT: | |-TemplateTypeParmDecl 0x{{.+}} <col:21> col:29 typename depth 1 index 0
// CHECK-NEXT: | `-TemplateArgument <line:275:42> template TestClassTemplate
// CHECK-NEXT: | `-inherited from TemplateTemplateParm 0x{{.+}} 'TT'
// CHECK-NEXT: `-CXXRecordDecl 0x{{.+}} prev 0x{{.+}} <line:276:41, col:82> col:48 struct TestTemplateTemplateDefaultType definition
diff --git a/src/llvm-project/clang/test/AST/ast-dump-enum-json.cpp b/src/llvm-project/clang/test/AST/ast-dump-enum-json.cpp
index 7173daa..4ee7a41 100644
--- a/src/llvm-project/clang/test/AST/ast-dump-enum-json.cpp
+++ b/src/llvm-project/clang/test/AST/ast-dump-enum-json.cpp
@@ -36,6 +36,7 @@
// CHECK: "kind": "EnumDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 88,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 3,
// CHECK-NEXT: "col": 1,
@@ -43,10 +44,12 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 88,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 108,
// CHECK-NEXT: "line": 6,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -57,16 +60,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "EnumConstantDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 97,
// CHECK-NEXT: "line": 4,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 97,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 97,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -80,16 +86,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "EnumConstantDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 104,
// CHECK-NEXT: "line": 5,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 104,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 104,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -105,16 +114,19 @@
// CHECK: "kind": "EnumDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 117,
// CHECK-NEXT: "line": 8,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 112,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 137,
// CHECK-NEXT: "line": 11,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -126,16 +138,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "EnumConstantDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 123,
// CHECK-NEXT: "line": 9,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 123,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 123,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
@@ -149,16 +164,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "EnumConstantDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 132,
// CHECK-NEXT: "line": 10,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 132,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 132,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -174,16 +192,19 @@
// CHECK: "kind": "EnumDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 146,
// CHECK-NEXT: "line": 13,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 141,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 172,
// CHECK-NEXT: "line": 16,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -198,16 +219,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "EnumConstantDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 160,
// CHECK-NEXT: "line": 14,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 160,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 160,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -221,16 +245,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "EnumConstantDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 168,
// CHECK-NEXT: "line": 15,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 168,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 168,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -246,16 +273,19 @@
// CHECK: "kind": "EnumDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 188,
// CHECK-NEXT: "line": 18,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 176,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 209,
// CHECK-NEXT: "line": 21,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -271,16 +301,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "EnumConstantDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 194,
// CHECK-NEXT: "line": 19,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 194,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 194,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
@@ -294,16 +327,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "EnumConstantDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 203,
// CHECK-NEXT: "line": 20,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 203,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 203,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
@@ -319,16 +355,19 @@
// CHECK: "kind": "EnumDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 224,
// CHECK-NEXT: "line": 23,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 213,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 242,
// CHECK-NEXT: "line": 26,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -344,16 +383,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "EnumConstantDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 230,
// CHECK-NEXT: "line": 24,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 230,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 230,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -367,16 +409,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "EnumConstantDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 238,
// CHECK-NEXT: "line": 25,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 238,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 238,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -392,16 +437,19 @@
// CHECK: "kind": "EnumDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 257,
// CHECK-NEXT: "line": 28,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 246,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 286,
// CHECK-NEXT: "line": 31,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -417,16 +465,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "EnumConstantDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 269,
// CHECK-NEXT: "line": 29,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 269,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 269,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: }
@@ -440,16 +491,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "EnumConstantDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 279,
// CHECK-NEXT: "line": 30,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 279,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 279,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: }
diff --git a/src/llvm-project/clang/test/AST/ast-dump-expr-json.c b/src/llvm-project/clang/test/AST/ast-dump-expr-json.c
index b988c52..2c7bdf0 100644
--- a/src/llvm-project/clang/test/AST/ast-dump-expr-json.c
+++ b/src/llvm-project/clang/test/AST/ast-dump-expr-json.c
@@ -106,4977 +106,5451 @@
(a);
}
-// NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py
-// using --filters=FunctionDecl
-
-
-// CHECK: "kind": "FunctionDecl",
-// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 3,
-// CHECK-NEXT: "col": 6,
-// CHECK-NEXT: "tokLen": 5
-// CHECK-NEXT: },
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 1,
-// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 5,
-// CHECK-NEXT: "col": 1,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "Comma",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "void (void)"
-// CHECK-NEXT: },
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CompoundStmt",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 3,
-// CHECK-NEXT: "col": 18,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 5,
-// CHECK-NEXT: "col": 1,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "BinaryOperator",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 4,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 9,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "opcode": ",",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "BinaryOperator",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 6,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "opcode": ",",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "IntegerLiteral",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "value": "1"
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "IntegerLiteral",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 6,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 6,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "value": "2"
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "IntegerLiteral",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 9,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 9,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "value": "3"
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-
-
-// CHECK: "kind": "FunctionDecl",
-// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 7,
-// CHECK-NEXT: "col": 6,
-// CHECK-NEXT: "tokLen": 10
-// CHECK-NEXT: },
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 1,
-// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 10,
-// CHECK-NEXT: "col": 1,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "Assignment",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "void (int)"
-// CHECK-NEXT: },
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 7,
-// CHECK-NEXT: "col": 21,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 17,
-// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 21,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "isUsed": true,
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CompoundStmt",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 24,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 10,
-// CHECK-NEXT: "col": 1,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "BinaryOperator",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 8,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 2
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "opcode": "=",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "IntegerLiteral",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 2
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 2
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "value": "12"
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CompoundAssignOperator",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 9,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "opcode": "+=",
-// CHECK-NEXT: "computeLHSType": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "computeResultType": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-
-
-// CHECK: "kind": "FunctionDecl",
-// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 12,
-// CHECK-NEXT: "col": 6,
-// CHECK-NEXT: "tokLen": 12
-// CHECK-NEXT: },
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 1,
-// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 15,
-// CHECK-NEXT: "col": 1,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "Conditionals",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "void (int)"
-// CHECK-NEXT: },
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 12,
-// CHECK-NEXT: "col": 23,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 19,
-// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 23,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "isUsed": true,
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CompoundStmt",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 26,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 15,
-// CHECK-NEXT: "col": 1,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ConditionalOperator",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 13,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 11,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "IntegerLiteral",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "value": "0"
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "IntegerLiteral",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 11,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 11,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "value": "1"
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "BinaryConditionalOperator",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 14,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "IntegerLiteral",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "value": "0"
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-
-
-// CHECK: "kind": "FunctionDecl",
-// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 17,
-// CHECK-NEXT: "col": 6,
-// CHECK-NEXT: "tokLen": 15
-// CHECK-NEXT: },
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 1,
-// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 49,
-// CHECK-NEXT: "col": 1,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "BinaryOperators",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "void (int, int)"
-// CHECK-NEXT: },
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 17,
-// CHECK-NEXT: "col": 26,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 22,
-// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 26,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "isUsed": true,
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "col": 33,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 29,
-// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 33,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "isUsed": true,
-// CHECK-NEXT: "name": "b",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CompoundStmt",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 36,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 49,
-// CHECK-NEXT: "col": 1,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "BinaryOperator",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 19,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "opcode": "||",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "b",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "BinaryOperator",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 20,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "opcode": "&&",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "b",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "BinaryOperator",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 23,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "opcode": "|",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "b",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "BinaryOperator",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 24,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "opcode": "^",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "b",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "BinaryOperator",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 25,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "opcode": "&",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "b",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "BinaryOperator",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 28,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "opcode": "==",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "b",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "BinaryOperator",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 29,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "opcode": "!=",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "b",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "BinaryOperator",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 32,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "opcode": "<",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "b",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "BinaryOperator",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 33,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "opcode": ">",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "b",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "BinaryOperator",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 34,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "opcode": "<=",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "b",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "BinaryOperator",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 35,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "opcode": ">=",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "b",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "BinaryOperator",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 38,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "opcode": "<<",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "b",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "BinaryOperator",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 39,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "opcode": ">>",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "b",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "BinaryOperator",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 42,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "opcode": "+",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "b",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "BinaryOperator",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 43,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "opcode": "-",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "b",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "BinaryOperator",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 46,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "opcode": "*",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "b",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "BinaryOperator",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 47,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "opcode": "/",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "b",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "BinaryOperator",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 48,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "opcode": "%",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 7,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "b",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-
-
-// CHECK: "kind": "FunctionDecl",
-// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 51,
-// CHECK-NEXT: "col": 6,
-// CHECK-NEXT: "tokLen": 14
-// CHECK-NEXT: },
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 1,
-// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 66,
-// CHECK-NEXT: "col": 1,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "isUsed": true,
-// CHECK-NEXT: "name": "UnaryOperators",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "void (int, int *)"
-// CHECK-NEXT: },
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 51,
-// CHECK-NEXT: "col": 25,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 21,
-// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 25,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "isUsed": true,
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "col": 33,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 28,
-// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 33,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "isUsed": true,
-// CHECK-NEXT: "name": "b",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int *"
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CompoundStmt",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 36,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 66,
-// CHECK-NEXT: "col": 1,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CStyleCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 53,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 10,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "float"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "IntegralToFloating",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 10,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 10,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "isPartOfExplicitCast": true,
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 10,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 10,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "UnaryOperator",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 57,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 4,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "isPostfix": false,
-// CHECK-NEXT: "opcode": "-",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 4,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 4,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 4,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 4,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "UnaryOperator",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 58,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 4,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "isPostfix": false,
-// CHECK-NEXT: "opcode": "+",
-// CHECK-NEXT: "canOverflow": false,
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 4,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 4,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 4,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 4,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "UnaryOperator",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 59,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 4,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "isPostfix": false,
-// CHECK-NEXT: "opcode": "&",
-// CHECK-NEXT: "canOverflow": false,
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 4,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 4,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 60,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 4,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "UnaryOperator",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 4,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "isPostfix": false,
-// CHECK-NEXT: "opcode": "*",
-// CHECK-NEXT: "canOverflow": false,
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 4,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 4,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 4,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 4,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "b",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int *"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "UnaryOperator",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 61,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 4,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "isPostfix": false,
-// CHECK-NEXT: "opcode": "!",
-// CHECK-NEXT: "canOverflow": false,
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 4,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 4,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 4,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 4,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "UnaryExprOrTypeTraitExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 63,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 6
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 10,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "unsigned long"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "name": "sizeof",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 10,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 10,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "nonOdrUseReason": "unevaluated"
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "UnaryExprOrTypeTraitExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 64,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 6
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 13,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "unsigned long"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "name": "sizeof",
-// CHECK-NEXT: "argType": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "UnaryExprOrTypeTraitExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 65,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 8
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 15,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "unsigned long"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "name": "alignof",
-// CHECK-NEXT: "argType": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-
-
-// CHECK: "kind": "FunctionDecl",
-// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 72,
-// CHECK-NEXT: "col": 6,
-// CHECK-NEXT: "tokLen": 16
-// CHECK-NEXT: },
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 1,
-// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 83,
-// CHECK-NEXT: "col": 1,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "PostfixOperators",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "void (int *, struct S, struct S *)"
-// CHECK-NEXT: },
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 72,
-// CHECK-NEXT: "col": 28,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 23,
-// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 28,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "isUsed": true,
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int *"
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "col": 40,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 31,
-// CHECK-NEXT: "tokLen": 6
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 40,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "isUsed": true,
-// CHECK-NEXT: "name": "b",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "struct S",
-// CHECK-NEXT: "qualType": "struct S"
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "col": 53,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 43,
-// CHECK-NEXT: "tokLen": 6
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 53,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "isUsed": true,
-// CHECK-NEXT: "name": "c",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "struct S *"
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CompoundStmt",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 56,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 83,
-// CHECK-NEXT: "col": 1,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 73,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 6,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ArraySubscriptExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 6,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int *"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "IntegerLiteral",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 5,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 5,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "value": "0"
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CallExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 74,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 14
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 23,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "void"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 14
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 14
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "void (*)(int, int *)"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "FunctionToPointerDecay",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 14
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 14
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "void (int, int *)"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "FunctionDecl",
-// CHECK-NEXT: "name": "UnaryOperators",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "void (int, int *)"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 18,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 19,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "UnaryOperator",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 18,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 19,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "isPostfix": false,
-// CHECK-NEXT: "opcode": "*",
-// CHECK-NEXT: "canOverflow": false,
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 19,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 19,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 19,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 19,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int *"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 22,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 22,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 22,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 22,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int *"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 76,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 5,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "MemberExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 5,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "isArrow": false,
-// CHECK-NEXT: "referencedMemberDecl": "0x{{.*}}",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "struct S",
-// CHECK-NEXT: "qualType": "struct S"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "b",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "struct S",
-// CHECK-NEXT: "qualType": "struct S"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 77,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 6,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "MemberExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 6,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "isArrow": true,
-// CHECK-NEXT: "referencedMemberDecl": "0x{{.*}}",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "struct S *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "struct S *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "c",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "struct S *"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 81,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 25,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "ArrayToPointerDecay",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CompoundLiteralExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 25,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int [4]"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "InitListExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 12,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 25,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int [4]"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "IntegerLiteral",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 13,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 13,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "value": "1"
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "IntegerLiteral",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 16,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 16,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "value": "2"
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "IntegerLiteral",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 19,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 19,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "value": "3"
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "IntegerLiteral",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 22,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 22,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "value": "4"
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 82,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 15,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "struct S",
-// CHECK-NEXT: "qualType": "struct S"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CompoundLiteralExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 15,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "struct S",
-// CHECK-NEXT: "qualType": "struct S"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "InitListExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 13,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 15,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "struct S",
-// CHECK-NEXT: "qualType": "struct S"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "IntegerLiteral",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 14,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 14,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "value": "1"
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-
-
-// CHECK: "kind": "FunctionDecl",
-// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 87,
-// CHECK-NEXT: "col": 6,
-// CHECK-NEXT: "tokLen": 18
-// CHECK-NEXT: },
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 1,
-// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 107,
-// CHECK-NEXT: "col": 1,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "PrimaryExpressions",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "void (int)"
-// CHECK-NEXT: },
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 87,
-// CHECK-NEXT: "col": 29,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 25,
-// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 29,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "isUsed": true,
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CompoundStmt",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 32,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 107,
-// CHECK-NEXT: "col": 1,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 88,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CharacterLiteral",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 89,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "value": 97
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CharacterLiteral",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 90,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "value": 97
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 91,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "char *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "ArrayToPointerDecay",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "StringLiteral",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "char [2]"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "value": "\"a\""
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 92,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "ArrayToPointerDecay",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "StringLiteral",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int [2]"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "value": "L\"a\""
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 93,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 5
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 5
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "char *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "ArrayToPointerDecay",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "StringLiteral",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 5
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 5
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "char [2]"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "value": "u8\"a\""
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 94,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "unsigned int *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "ArrayToPointerDecay",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "StringLiteral",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "unsigned int [2]"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "value": "U\"a\""
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 95,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "unsigned short *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "ArrayToPointerDecay",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "StringLiteral",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "unsigned short [2]"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "value": "u\"a\""
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "IntegerLiteral",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 97,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "value": "1"
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "IntegerLiteral",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 98,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 2
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 2
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "unsigned int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "value": "1"
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "IntegerLiteral",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 99,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "long long"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "value": "1"
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "FloatingLiteral",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 100,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "double"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "value": "1"
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "FloatingLiteral",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 101,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "float"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "value": "1"
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "FloatingLiteral",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 102,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 26
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 26
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "float"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "value": "+Inf"
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "FloatingLiteral",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 103,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "long double"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "value": "1"
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 104,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "EnumConstantDecl",
-// CHECK-NEXT: "name": "One",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 106,
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 5,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParenExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 5,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "inner": [
-// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
-// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 4,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 4,
-// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "a",
-// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-// CHECK-NEXT: }
+// NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py
+// using --filters=FunctionDecl
+
+
+// CHECK: "kind": "FunctionDecl",
+// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 120,
+// CHECK-NEXT: "file": "{{.*}}",
+// CHECK-NEXT: "line": 3,
+// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "tokLen": 5
+// CHECK-NEXT: },
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 115,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 4
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 147,
+// CHECK-NEXT: "line": 5,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "Comma",
+// CHECK-NEXT: "mangledName": "Comma",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "void (void)"
+// CHECK-NEXT: },
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CompoundStmt",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 132,
+// CHECK-NEXT: "line": 3,
+// CHECK-NEXT: "col": 18,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 147,
+// CHECK-NEXT: "line": 5,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "BinaryOperator",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 137,
+// CHECK-NEXT: "line": 4,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 143,
+// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "opcode": ",",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "BinaryOperator",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 137,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 140,
+// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "opcode": ",",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "IntegerLiteral",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 137,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 137,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "value": "1"
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "IntegerLiteral",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 140,
+// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 140,
+// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "value": "2"
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "IntegerLiteral",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 143,
+// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 143,
+// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "value": "3"
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+
+
+// CHECK: "kind": "FunctionDecl",
+// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 157,
+// CHECK-NEXT: "line": 7,
+// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "tokLen": 10
+// CHECK-NEXT: },
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 152,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 4
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 200,
+// CHECK-NEXT: "line": 10,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "Assignment",
+// CHECK-NEXT: "mangledName": "Assignment",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "void (int)"
+// CHECK-NEXT: },
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 172,
+// CHECK-NEXT: "line": 7,
+// CHECK-NEXT: "col": 21,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 168,
+// CHECK-NEXT: "col": 17,
+// CHECK-NEXT: "tokLen": 3
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 172,
+// CHECK-NEXT: "col": 21,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "isUsed": true,
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "mangledName": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CompoundStmt",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 175,
+// CHECK-NEXT: "col": 24,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 200,
+// CHECK-NEXT: "line": 10,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "BinaryOperator",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 180,
+// CHECK-NEXT: "line": 8,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 184,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 2
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "opcode": "=",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 180,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 180,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "IntegerLiteral",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 184,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 2
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 184,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 2
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "value": "12"
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CompoundAssignOperator",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 191,
+// CHECK-NEXT: "line": 9,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 196,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "opcode": "+=",
+// CHECK-NEXT: "computeLHSType": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "computeResultType": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 191,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 191,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 196,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 196,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 196,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 196,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+
+
+// CHECK: "kind": "FunctionDecl",
+// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 210,
+// CHECK-NEXT: "line": 12,
+// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "tokLen": 12
+// CHECK-NEXT: },
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 205,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 4
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 258,
+// CHECK-NEXT: "line": 15,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "Conditionals",
+// CHECK-NEXT: "mangledName": "Conditionals",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "void (int)"
+// CHECK-NEXT: },
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 227,
+// CHECK-NEXT: "line": 12,
+// CHECK-NEXT: "col": 23,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 223,
+// CHECK-NEXT: "col": 19,
+// CHECK-NEXT: "tokLen": 3
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 227,
+// CHECK-NEXT: "col": 23,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "isUsed": true,
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "mangledName": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CompoundStmt",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 230,
+// CHECK-NEXT: "col": 26,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 258,
+// CHECK-NEXT: "line": 15,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ConditionalOperator",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 235,
+// CHECK-NEXT: "line": 13,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 243,
+// CHECK-NEXT: "col": 11,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 235,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 235,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 235,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 235,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "IntegerLiteral",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 239,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 239,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "value": "0"
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "IntegerLiteral",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 243,
+// CHECK-NEXT: "col": 11,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 243,
+// CHECK-NEXT: "col": 11,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "value": "1"
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "BinaryConditionalOperator",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 249,
+// CHECK-NEXT: "line": 14,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 254,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 249,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 249,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 249,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 249,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 249,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 249,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 249,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 249,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 249,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 249,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 249,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 249,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 249,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 249,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 249,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 249,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "IntegerLiteral",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 254,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 254,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "value": "0"
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+
+
+// CHECK: "kind": "FunctionDecl",
+// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 268,
+// CHECK-NEXT: "line": 17,
+// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "tokLen": 15
+// CHECK-NEXT: },
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 263,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 4
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 686,
+// CHECK-NEXT: "line": 49,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "BinaryOperators",
+// CHECK-NEXT: "mangledName": "BinaryOperators",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "void (int, int)"
+// CHECK-NEXT: },
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 288,
+// CHECK-NEXT: "line": 17,
+// CHECK-NEXT: "col": 26,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 284,
+// CHECK-NEXT: "col": 22,
+// CHECK-NEXT: "tokLen": 3
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 288,
+// CHECK-NEXT: "col": 26,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "isUsed": true,
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "mangledName": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 295,
+// CHECK-NEXT: "col": 33,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 291,
+// CHECK-NEXT: "col": 29,
+// CHECK-NEXT: "tokLen": 3
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 295,
+// CHECK-NEXT: "col": 33,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "isUsed": true,
+// CHECK-NEXT: "name": "b",
+// CHECK-NEXT: "mangledName": "b",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CompoundStmt",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 298,
+// CHECK-NEXT: "col": 36,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 686,
+// CHECK-NEXT: "line": 49,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "BinaryOperator",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 327,
+// CHECK-NEXT: "line": 19,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 332,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "opcode": "||",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 327,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 327,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 327,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 327,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 332,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 332,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 332,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 332,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "b",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "BinaryOperator",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 338,
+// CHECK-NEXT: "line": 20,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 343,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "opcode": "&&",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 338,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 338,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 338,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 338,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 343,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 343,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 343,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 343,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "b",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "BinaryOperator",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 375,
+// CHECK-NEXT: "line": 23,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 379,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "opcode": "|",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 375,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 375,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 375,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 375,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 379,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 379,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 379,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 379,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "b",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "BinaryOperator",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 385,
+// CHECK-NEXT: "line": 24,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 389,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "opcode": "^",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 385,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 385,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 385,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 385,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 389,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 389,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 389,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 389,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "b",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "BinaryOperator",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 395,
+// CHECK-NEXT: "line": 25,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 399,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "opcode": "&",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 395,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 395,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 395,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 395,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 399,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 399,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 399,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 399,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "b",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "BinaryOperator",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 432,
+// CHECK-NEXT: "line": 28,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 437,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "opcode": "==",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 432,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 432,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 432,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 432,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 437,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 437,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 437,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 437,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "b",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "BinaryOperator",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 443,
+// CHECK-NEXT: "line": 29,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 448,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "opcode": "!=",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 443,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 443,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 443,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 443,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 448,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 448,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 448,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 448,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "b",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "BinaryOperator",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 483,
+// CHECK-NEXT: "line": 32,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 487,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "opcode": "<",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 483,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 483,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 483,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 483,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 487,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 487,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 487,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 487,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "b",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "BinaryOperator",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 493,
+// CHECK-NEXT: "line": 33,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 497,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "opcode": ">",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 493,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 493,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 493,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 493,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 497,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 497,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 497,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 497,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "b",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "BinaryOperator",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 503,
+// CHECK-NEXT: "line": 34,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 508,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "opcode": "<=",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 503,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 503,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 503,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 503,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 508,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 508,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 508,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 508,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "b",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "BinaryOperator",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 514,
+// CHECK-NEXT: "line": 35,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 519,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "opcode": ">=",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 514,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 514,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 514,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 514,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 519,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 519,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 519,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 519,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "b",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "BinaryOperator",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 556,
+// CHECK-NEXT: "line": 38,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 561,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "opcode": "<<",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 556,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 556,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 556,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 556,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 561,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 561,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 561,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 561,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "b",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "BinaryOperator",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 567,
+// CHECK-NEXT: "line": 39,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 572,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "opcode": ">>",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 567,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 567,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 567,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 567,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 572,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 572,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 572,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 572,
+// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "b",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "BinaryOperator",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 605,
+// CHECK-NEXT: "line": 42,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 609,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "opcode": "+",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 605,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 605,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 605,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 605,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 609,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 609,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 609,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 609,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "b",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "BinaryOperator",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 615,
+// CHECK-NEXT: "line": 43,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 619,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "opcode": "-",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 615,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 615,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 615,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 615,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 619,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 619,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 619,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 619,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "b",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "BinaryOperator",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 658,
+// CHECK-NEXT: "line": 46,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 662,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "opcode": "*",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 658,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 658,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 658,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 658,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 662,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 662,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 662,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 662,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "b",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "BinaryOperator",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 668,
+// CHECK-NEXT: "line": 47,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 672,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "opcode": "/",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 668,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 668,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 668,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 668,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 672,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 672,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 672,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 672,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "b",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "BinaryOperator",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 678,
+// CHECK-NEXT: "line": 48,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 682,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "opcode": "%",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 678,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 678,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 678,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 678,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 682,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 682,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 682,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 682,
+// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "b",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+
+
+// CHECK: "kind": "FunctionDecl",
+// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 696,
+// CHECK-NEXT: "line": 51,
+// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "tokLen": 14
+// CHECK-NEXT: },
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 691,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 4
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 894,
+// CHECK-NEXT: "line": 66,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "isUsed": true,
+// CHECK-NEXT: "name": "UnaryOperators",
+// CHECK-NEXT: "mangledName": "UnaryOperators",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "void (int, int *)"
+// CHECK-NEXT: },
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 715,
+// CHECK-NEXT: "line": 51,
+// CHECK-NEXT: "col": 25,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 711,
+// CHECK-NEXT: "col": 21,
+// CHECK-NEXT: "tokLen": 3
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 715,
+// CHECK-NEXT: "col": 25,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "isUsed": true,
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "mangledName": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 723,
+// CHECK-NEXT: "col": 33,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 718,
+// CHECK-NEXT: "col": 28,
+// CHECK-NEXT: "tokLen": 3
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 723,
+// CHECK-NEXT: "col": 33,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "isUsed": true,
+// CHECK-NEXT: "name": "b",
+// CHECK-NEXT: "mangledName": "b",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int *"
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CompoundStmt",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 726,
+// CHECK-NEXT: "col": 36,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 894,
+// CHECK-NEXT: "line": 66,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CStyleCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 752,
+// CHECK-NEXT: "line": 53,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 759,
+// CHECK-NEXT: "col": 10,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "float"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "IntegralToFloating",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 759,
+// CHECK-NEXT: "col": 10,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 759,
+// CHECK-NEXT: "col": 10,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "isPartOfExplicitCast": true,
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 759,
+// CHECK-NEXT: "col": 10,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 759,
+// CHECK-NEXT: "col": 10,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "UnaryOperator",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 812,
+// CHECK-NEXT: "line": 57,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 813,
+// CHECK-NEXT: "col": 4,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "isPostfix": false,
+// CHECK-NEXT: "opcode": "-",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 813,
+// CHECK-NEXT: "col": 4,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 813,
+// CHECK-NEXT: "col": 4,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 813,
+// CHECK-NEXT: "col": 4,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 813,
+// CHECK-NEXT: "col": 4,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "UnaryOperator",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 819,
+// CHECK-NEXT: "line": 58,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 820,
+// CHECK-NEXT: "col": 4,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "isPostfix": false,
+// CHECK-NEXT: "opcode": "+",
+// CHECK-NEXT: "canOverflow": false,
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 820,
+// CHECK-NEXT: "col": 4,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 820,
+// CHECK-NEXT: "col": 4,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 820,
+// CHECK-NEXT: "col": 4,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 820,
+// CHECK-NEXT: "col": 4,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "UnaryOperator",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 826,
+// CHECK-NEXT: "line": 59,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 827,
+// CHECK-NEXT: "col": 4,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int *"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "isPostfix": false,
+// CHECK-NEXT: "opcode": "&",
+// CHECK-NEXT: "canOverflow": false,
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 827,
+// CHECK-NEXT: "col": 4,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 827,
+// CHECK-NEXT: "col": 4,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 833,
+// CHECK-NEXT: "line": 60,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 834,
+// CHECK-NEXT: "col": 4,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "UnaryOperator",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 833,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 834,
+// CHECK-NEXT: "col": 4,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "isPostfix": false,
+// CHECK-NEXT: "opcode": "*",
+// CHECK-NEXT: "canOverflow": false,
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 834,
+// CHECK-NEXT: "col": 4,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 834,
+// CHECK-NEXT: "col": 4,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int *"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 834,
+// CHECK-NEXT: "col": 4,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 834,
+// CHECK-NEXT: "col": 4,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int *"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "b",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int *"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "UnaryOperator",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 840,
+// CHECK-NEXT: "line": 61,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 841,
+// CHECK-NEXT: "col": 4,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "isPostfix": false,
+// CHECK-NEXT: "opcode": "!",
+// CHECK-NEXT: "canOverflow": false,
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 841,
+// CHECK-NEXT: "col": 4,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 841,
+// CHECK-NEXT: "col": 4,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 841,
+// CHECK-NEXT: "col": 4,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 841,
+// CHECK-NEXT: "col": 4,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "UnaryExprOrTypeTraitExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 849,
+// CHECK-NEXT: "line": 63,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 6
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 856,
+// CHECK-NEXT: "col": 10,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "unsigned long"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "name": "sizeof",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 856,
+// CHECK-NEXT: "col": 10,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 856,
+// CHECK-NEXT: "col": 10,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "nonOdrUseReason": "unevaluated"
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "UnaryExprOrTypeTraitExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 862,
+// CHECK-NEXT: "line": 64,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 6
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 872,
+// CHECK-NEXT: "col": 13,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "unsigned long"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "name": "sizeof",
+// CHECK-NEXT: "argType": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "UnaryExprOrTypeTraitExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 878,
+// CHECK-NEXT: "line": 65,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 8
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 890,
+// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "unsigned long"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "name": "alignof",
+// CHECK-NEXT: "argType": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+
+
+// CHECK: "kind": "FunctionDecl",
+// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 932,
+// CHECK-NEXT: "line": 72,
+// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "tokLen": 16
+// CHECK-NEXT: },
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 927,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 4
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1136,
+// CHECK-NEXT: "line": 83,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "PostfixOperators",
+// CHECK-NEXT: "mangledName": "PostfixOperators",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "void (int *, struct S, struct S *)"
+// CHECK-NEXT: },
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 954,
+// CHECK-NEXT: "line": 72,
+// CHECK-NEXT: "col": 28,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 949,
+// CHECK-NEXT: "col": 23,
+// CHECK-NEXT: "tokLen": 3
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 954,
+// CHECK-NEXT: "col": 28,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "isUsed": true,
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "mangledName": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int *"
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 966,
+// CHECK-NEXT: "col": 40,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 957,
+// CHECK-NEXT: "col": 31,
+// CHECK-NEXT: "tokLen": 6
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 966,
+// CHECK-NEXT: "col": 40,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "isUsed": true,
+// CHECK-NEXT: "name": "b",
+// CHECK-NEXT: "mangledName": "b",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "struct S",
+// CHECK-NEXT: "qualType": "struct S"
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 979,
+// CHECK-NEXT: "col": 53,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 969,
+// CHECK-NEXT: "col": 43,
+// CHECK-NEXT: "tokLen": 6
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 979,
+// CHECK-NEXT: "col": 53,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "isUsed": true,
+// CHECK-NEXT: "name": "c",
+// CHECK-NEXT: "mangledName": "c",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "struct S *"
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CompoundStmt",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 982,
+// CHECK-NEXT: "col": 56,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1136,
+// CHECK-NEXT: "line": 83,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 987,
+// CHECK-NEXT: "line": 73,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 990,
+// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ArraySubscriptExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 987,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 990,
+// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 987,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 987,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int *"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 987,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 987,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int *"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int *"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "IntegerLiteral",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 989,
+// CHECK-NEXT: "col": 5,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 989,
+// CHECK-NEXT: "col": 5,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "value": "0"
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CallExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 996,
+// CHECK-NEXT: "line": 74,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 14
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1016,
+// CHECK-NEXT: "col": 23,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "void"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 996,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 14
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 996,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 14
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "void (*)(int, int *)"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "FunctionToPointerDecay",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 996,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 14
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 996,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 14
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "void (int, int *)"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "FunctionDecl",
+// CHECK-NEXT: "name": "UnaryOperators",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "void (int, int *)"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1011,
+// CHECK-NEXT: "col": 18,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1012,
+// CHECK-NEXT: "col": 19,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "UnaryOperator",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1011,
+// CHECK-NEXT: "col": 18,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1012,
+// CHECK-NEXT: "col": 19,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "isPostfix": false,
+// CHECK-NEXT: "opcode": "*",
+// CHECK-NEXT: "canOverflow": false,
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1012,
+// CHECK-NEXT: "col": 19,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1012,
+// CHECK-NEXT: "col": 19,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int *"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1012,
+// CHECK-NEXT: "col": 19,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1012,
+// CHECK-NEXT: "col": 19,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int *"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int *"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1015,
+// CHECK-NEXT: "col": 22,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1015,
+// CHECK-NEXT: "col": 22,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int *"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1015,
+// CHECK-NEXT: "col": 22,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1015,
+// CHECK-NEXT: "col": 22,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int *"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int *"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1024,
+// CHECK-NEXT: "line": 76,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1026,
+// CHECK-NEXT: "col": 5,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "MemberExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1024,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1026,
+// CHECK-NEXT: "col": 5,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "isArrow": false,
+// CHECK-NEXT: "referencedMemberDecl": "0x{{.*}}",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1024,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1024,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "struct S",
+// CHECK-NEXT: "qualType": "struct S"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "b",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "struct S",
+// CHECK-NEXT: "qualType": "struct S"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1032,
+// CHECK-NEXT: "line": 77,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1035,
+// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "MemberExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1032,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1035,
+// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "isArrow": true,
+// CHECK-NEXT: "referencedMemberDecl": "0x{{.*}}",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1032,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1032,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "struct S *"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1032,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1032,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "struct S *"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "c",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "struct S *"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1092,
+// CHECK-NEXT: "line": 81,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1114,
+// CHECK-NEXT: "col": 25,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int *"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "ArrayToPointerDecay",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CompoundLiteralExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1092,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1114,
+// CHECK-NEXT: "col": 25,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int [4]"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "InitListExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1101,
+// CHECK-NEXT: "col": 12,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1114,
+// CHECK-NEXT: "col": 25,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int [4]"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "IntegerLiteral",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1102,
+// CHECK-NEXT: "col": 13,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1102,
+// CHECK-NEXT: "col": 13,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "value": "1"
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "IntegerLiteral",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1105,
+// CHECK-NEXT: "col": 16,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1105,
+// CHECK-NEXT: "col": 16,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "value": "2"
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "IntegerLiteral",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1108,
+// CHECK-NEXT: "col": 19,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1108,
+// CHECK-NEXT: "col": 19,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "value": "3"
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "IntegerLiteral",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1111,
+// CHECK-NEXT: "col": 22,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1111,
+// CHECK-NEXT: "col": 22,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "value": "4"
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1120,
+// CHECK-NEXT: "line": 82,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1132,
+// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "struct S",
+// CHECK-NEXT: "qualType": "struct S"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CompoundLiteralExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1120,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1132,
+// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "struct S",
+// CHECK-NEXT: "qualType": "struct S"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "InitListExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1130,
+// CHECK-NEXT: "col": 13,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1132,
+// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "desugaredQualType": "struct S",
+// CHECK-NEXT: "qualType": "struct S"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "IntegerLiteral",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1131,
+// CHECK-NEXT: "col": 14,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1131,
+// CHECK-NEXT: "col": 14,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "value": "1"
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+
+
+// CHECK: "kind": "FunctionDecl",
+// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1165,
+// CHECK-NEXT: "line": 87,
+// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "tokLen": 18
+// CHECK-NEXT: },
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1160,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 4
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1360,
+// CHECK-NEXT: "line": 107,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "PrimaryExpressions",
+// CHECK-NEXT: "mangledName": "PrimaryExpressions",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "void (int)"
+// CHECK-NEXT: },
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1188,
+// CHECK-NEXT: "line": 87,
+// CHECK-NEXT: "col": 29,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1184,
+// CHECK-NEXT: "col": 25,
+// CHECK-NEXT: "tokLen": 3
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1188,
+// CHECK-NEXT: "col": 29,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "isUsed": true,
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "mangledName": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CompoundStmt",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1191,
+// CHECK-NEXT: "col": 32,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1360,
+// CHECK-NEXT: "line": 107,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1196,
+// CHECK-NEXT: "line": 88,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1196,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1196,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1196,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CharacterLiteral",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1202,
+// CHECK-NEXT: "line": 89,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 3
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1202,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 3
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "value": 97
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CharacterLiteral",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1210,
+// CHECK-NEXT: "line": 90,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 4
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1210,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 4
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "value": 97
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1219,
+// CHECK-NEXT: "line": 91,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 3
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1219,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 3
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "char *"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "ArrayToPointerDecay",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "StringLiteral",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1219,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 3
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1219,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 3
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "char [2]"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "value": "\"a\""
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1227,
+// CHECK-NEXT: "line": 92,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 4
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1227,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 4
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int *"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "ArrayToPointerDecay",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "StringLiteral",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1227,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 4
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1227,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 4
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int [2]"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "value": "L\"a\""
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1236,
+// CHECK-NEXT: "line": 93,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 5
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1236,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 5
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "char *"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "ArrayToPointerDecay",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "StringLiteral",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1236,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 5
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1236,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 5
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "char [2]"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "value": "u8\"a\""
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1246,
+// CHECK-NEXT: "line": 94,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 4
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1246,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 4
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "unsigned int *"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "ArrayToPointerDecay",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "StringLiteral",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1246,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 4
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1246,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 4
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "unsigned int [2]"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "value": "U\"a\""
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1255,
+// CHECK-NEXT: "line": 95,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 4
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1255,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 4
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "unsigned short *"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "ArrayToPointerDecay",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "StringLiteral",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1255,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 4
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1255,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 4
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "unsigned short [2]"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "value": "u\"a\""
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "IntegerLiteral",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1266,
+// CHECK-NEXT: "line": 97,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1266,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "value": "1"
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "IntegerLiteral",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1272,
+// CHECK-NEXT: "line": 98,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 2
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1272,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 2
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "unsigned int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "value": "1"
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "IntegerLiteral",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1279,
+// CHECK-NEXT: "line": 99,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 3
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1279,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 3
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "long long"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "value": "1"
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "FloatingLiteral",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1287,
+// CHECK-NEXT: "line": 100,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 3
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1287,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 3
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "double"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "value": "1"
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "FloatingLiteral",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1295,
+// CHECK-NEXT: "line": 101,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 4
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1295,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 4
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "float"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "value": "1"
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "FloatingLiteral",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1304,
+// CHECK-NEXT: "line": 102,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 26
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1304,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 26
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "float"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "value": "+Inf"
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "FloatingLiteral",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1335,
+// CHECK-NEXT: "line": 103,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 4
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1335,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 4
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "long double"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "value": "1"
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1344,
+// CHECK-NEXT: "line": 104,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 3
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1344,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 3
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "EnumConstantDecl",
+// CHECK-NEXT: "name": "One",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1354,
+// CHECK-NEXT: "line": 106,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1356,
+// CHECK-NEXT: "col": 5,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParenExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1354,
+// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1356,
+// CHECK-NEXT: "col": 5,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1355,
+// CHECK-NEXT: "col": 4,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1355,
+// CHECK-NEXT: "col": 4,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "referencedDecl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
diff --git a/src/llvm-project/clang/test/AST/ast-dump-expr-json.cpp b/src/llvm-project/clang/test/AST/ast-dump-expr-json.cpp
index e629120..09e775e 100644
--- a/src/llvm-project/clang/test/AST/ast-dump-expr-json.cpp
+++ b/src/llvm-project/clang/test/AST/ast-dump-expr-json.cpp
@@ -158,6 +158,7 @@
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 952,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 41,
// CHECK-NEXT: "col": 6,
@@ -165,16 +166,19 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 947,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 987,
// CHECK-NEXT: "line": 44,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "TestThrow",
+// CHECK-NEXT: "mangledName": "_Z9TestThrowv",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: },
@@ -184,11 +188,13 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 964,
// CHECK-NEXT: "line": 41,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 987,
// CHECK-NEXT: "line": 44,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -200,11 +206,13 @@
// CHECK-NEXT: "kind": "CXXThrowExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 968,
// CHECK-NEXT: "line": 42,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 974,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -219,10 +227,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 974,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 974,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -240,11 +250,13 @@
// CHECK-NEXT: "kind": "CXXThrowExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 980,
// CHECK-NEXT: "line": 43,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 980,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
@@ -262,6 +274,7 @@
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 995,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 46,
// CHECK-NEXT: "col": 6,
@@ -269,16 +282,19 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 990,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1141,
// CHECK-NEXT: "line": 51,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "TestPointerToMember",
+// CHECK-NEXT: "mangledName": "_Z19TestPointerToMember1SPS_MS_iMS_FviE",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (S, S *, int S::*, void (S::*)(int))"
// CHECK-NEXT: },
@@ -287,22 +303,26 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1017,
// CHECK-NEXT: "line": 46,
// CHECK-NEXT: "col": 28,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1015,
// CHECK-NEXT: "col": 26,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1017,
// CHECK-NEXT: "col": 28,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "obj1",
+// CHECK-NEXT: "mangledName": "_ZZ19TestPointerToMember1SPS_MS_iMS_FviEE4obj1",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "S"
// CHECK-NEXT: }
@@ -311,21 +331,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1026,
// CHECK-NEXT: "col": 37,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1023,
// CHECK-NEXT: "col": 34,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1026,
// CHECK-NEXT: "col": 37,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "obj2",
+// CHECK-NEXT: "mangledName": "_ZZ19TestPointerToMember1SPS_MS_iMS_FviEE4obj2",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "S *"
// CHECK-NEXT: }
@@ -334,21 +358,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1041,
// CHECK-NEXT: "col": 52,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1032,
// CHECK-NEXT: "col": 43,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1041,
// CHECK-NEXT: "col": 52,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "data",
+// CHECK-NEXT: "mangledName": "_ZZ19TestPointerToMember1SPS_MS_iMS_FviEE4data",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int S::*"
// CHECK-NEXT: }
@@ -357,21 +385,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1057,
// CHECK-NEXT: "col": 68,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1047,
// CHECK-NEXT: "col": 58,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1066,
// CHECK-NEXT: "col": 77,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "call",
+// CHECK-NEXT: "mangledName": "_ZZ19TestPointerToMember1SPS_MS_iMS_FviEE4call",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (S::*)(int)"
// CHECK-NEXT: }
@@ -381,10 +413,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1069,
// CHECK-NEXT: "col": 80,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1141,
// CHECK-NEXT: "line": 51,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -396,11 +430,13 @@
// CHECK-NEXT: "kind": "BinaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1073,
// CHECK-NEXT: "line": 47,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1079,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -416,10 +452,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1073,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1073,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -442,10 +480,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1079,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1079,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -461,10 +501,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1079,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1079,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -491,11 +533,13 @@
// CHECK-NEXT: "kind": "BinaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1087,
// CHECK-NEXT: "line": 48,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1094,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -511,10 +555,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1087,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1087,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -530,10 +576,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1087,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1087,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -558,10 +606,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1094,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1094,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -577,10 +627,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1094,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1094,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -607,11 +659,13 @@
// CHECK-NEXT: "kind": "CXXMemberCallExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1102,
// CHECK-NEXT: "line": 49,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1117,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -626,10 +680,12 @@
// CHECK-NEXT: "kind": "ParenExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1102,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1113,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -644,10 +700,12 @@
// CHECK-NEXT: "kind": "BinaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1103,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1109,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -663,10 +721,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1103,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1103,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -689,10 +749,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1109,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1109,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -708,10 +770,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1109,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1109,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -740,10 +804,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1115,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1115,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -761,11 +827,13 @@
// CHECK-NEXT: "kind": "CXXMemberCallExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1122,
// CHECK-NEXT: "line": 50,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1138,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -780,10 +848,12 @@
// CHECK-NEXT: "kind": "ParenExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1122,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1134,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -798,10 +868,12 @@
// CHECK-NEXT: "kind": "BinaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1123,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1130,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -817,10 +889,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1123,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1123,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -836,10 +910,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1123,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1123,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -864,10 +940,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1130,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1130,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -883,10 +961,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1130,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1130,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -915,10 +995,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1136,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1136,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -939,6 +1021,7 @@
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1149,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 53,
// CHECK-NEXT: "col": 6,
@@ -946,16 +1029,19 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1144,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1292,
// CHECK-NEXT: "line": 58,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "TestCasting",
+// CHECK-NEXT: "mangledName": "_Z11TestCastingPK1S",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (const S *)"
// CHECK-NEXT: },
@@ -964,22 +1050,26 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1170,
// CHECK-NEXT: "line": 53,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1161,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1170,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "s",
+// CHECK-NEXT: "mangledName": "_ZZ11TestCastingPK1SE1s",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "const S *"
// CHECK-NEXT: }
@@ -989,10 +1079,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1173,
// CHECK-NEXT: "col": 30,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1292,
// CHECK-NEXT: "line": 58,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -1004,11 +1096,13 @@
// CHECK-NEXT: "kind": "CXXConstCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1177,
// CHECK-NEXT: "line": 54,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 10
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1194,
// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1024,10 +1118,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1193,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1193,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1044,10 +1140,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1193,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1193,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1074,11 +1172,13 @@
// CHECK-NEXT: "kind": "CXXStaticCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1199,
// CHECK-NEXT: "line": 55,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 11
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1223,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1099,10 +1199,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1222,
// CHECK-NEXT: "col": 26,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1222,
// CHECK-NEXT: "col": 26,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1119,10 +1221,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1222,
// CHECK-NEXT: "col": 26,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1222,
// CHECK-NEXT: "col": 26,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1149,11 +1253,13 @@
// CHECK-NEXT: "kind": "CXXDynamicCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1228,
// CHECK-NEXT: "line": 56,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 12
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1253,
// CHECK-NEXT: "col": 28,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1169,10 +1275,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1252,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1252,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1189,10 +1297,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1252,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1252,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1219,11 +1329,13 @@
// CHECK-NEXT: "kind": "CXXReinterpretCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1258,
// CHECK-NEXT: "line": 57,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 16
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1289,
// CHECK-NEXT: "col": 34,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1239,10 +1351,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1288,
// CHECK-NEXT: "col": 33,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1288,
// CHECK-NEXT: "col": 33,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1259,10 +1373,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1288,
// CHECK-NEXT: "col": 33,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1288,
// CHECK-NEXT: "col": 33,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1292,6 +1408,7 @@
// CHECK: "kind": "FunctionTemplateDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1326,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 61,
// CHECK-NEXT: "col": 6,
@@ -1299,11 +1416,13 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1295,
// CHECK-NEXT: "line": 60,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1533,
// CHECK-NEXT: "line": 75,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -1315,16 +1434,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TemplateTypeParmDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1317,
// CHECK-NEXT: "line": 60,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1305,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1317,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -1340,16 +1462,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1326,
// CHECK-NEXT: "line": 61,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 20
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1321,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1533,
// CHECK-NEXT: "line": 75,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -1364,22 +1489,26 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1352,
// CHECK-NEXT: "line": 61,
// CHECK-NEXT: "col": 32,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1347,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1352,
// CHECK-NEXT: "col": 32,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isReferenced": true,
// CHECK-NEXT: "name": "p",
+// CHECK-NEXT: "mangledName": "_ZZ20TestUnaryExpressionsPiE1p",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int *"
// CHECK-NEXT: }
@@ -1389,10 +1518,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1355,
// CHECK-NEXT: "col": 35,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1533,
// CHECK-NEXT: "line": 75,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -1404,11 +1535,13 @@
// CHECK-NEXT: "kind": "SizeOfPackExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1359,
// CHECK-NEXT: "line": 62,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1371,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1424,11 +1557,13 @@
// CHECK-NEXT: "kind": "CXXNoexceptExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1376,
// CHECK-NEXT: "line": 63,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1390,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1443,10 +1578,12 @@
// CHECK-NEXT: "kind": "BinaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1385,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1389,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1462,10 +1599,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1385,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1385,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1481,10 +1620,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1385,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1385,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1510,10 +1651,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1389,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1389,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1529,10 +1672,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1389,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1389,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1562,11 +1707,13 @@
// CHECK-NEXT: "kind": "CXXNewExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1396,
// CHECK-NEXT: "line": 65,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1402,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -1590,11 +1737,13 @@
// CHECK-NEXT: "kind": "CXXNewExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1409,
// CHECK-NEXT: "line": 66,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1417,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1617,11 +1766,13 @@
// CHECK-NEXT: "kind": "CXXNewExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1422,
// CHECK-NEXT: "line": 67,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1432,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1645,10 +1796,12 @@
// CHECK-NEXT: "kind": "InitListExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1429,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1432,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1663,10 +1816,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1430,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1430,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -1686,11 +1841,13 @@
// CHECK-NEXT: "kind": "CXXNewExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1437,
// CHECK-NEXT: "line": 68,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1446,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1714,10 +1871,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1445,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1445,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1733,10 +1892,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1445,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1445,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1756,11 +1917,13 @@
// CHECK-NEXT: "kind": "CXXNewExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1451,
// CHECK-NEXT: "line": 69,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1466,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1785,10 +1948,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1459,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1459,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1804,10 +1969,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1459,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1459,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1825,10 +1992,12 @@
// CHECK-NEXT: "kind": "InitListExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1461,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1466,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1843,10 +2012,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1462,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1462,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1862,10 +2033,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1465,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1465,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1885,11 +2058,13 @@
// CHECK-NEXT: "kind": "CXXNewExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1471,
// CHECK-NEXT: "line": 70,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1479,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -1913,10 +2088,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1476,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1476,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1932,10 +2109,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1476,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1476,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1951,10 +2130,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1476,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1476,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1983,11 +2164,13 @@
// CHECK-NEXT: "kind": "CXXNewExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1486,
// CHECK-NEXT: "line": 71,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1500,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2012,10 +2195,12 @@
// CHECK-NEXT: "kind": "InitListExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1497,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1500,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2030,10 +2215,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1498,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1498,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -2051,10 +2238,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1491,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1491,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2070,10 +2259,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1491,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1491,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2089,10 +2280,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1491,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1491,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2121,11 +2314,13 @@
// CHECK-NEXT: "kind": "CXXDeleteExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1506,
// CHECK-NEXT: "line": 73,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1515,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2149,10 +2344,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1515,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1515,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2168,10 +2365,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1515,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1515,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2198,11 +2397,13 @@
// CHECK-NEXT: "kind": "CXXDeleteExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1520,
// CHECK-NEXT: "line": 74,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1530,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2227,10 +2428,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1530,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1530,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2246,10 +2449,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1530,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1530,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2281,6 +2486,7 @@
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1541,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 77,
// CHECK-NEXT: "col": 6,
@@ -2288,16 +2494,19 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1536,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1807,
// CHECK-NEXT: "line": 90,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "TestPostfixExpressions",
+// CHECK-NEXT: "mangledName": "_Z22TestPostfixExpressions1SPS_P1UIiE",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (S, S *, U<int> *)"
// CHECK-NEXT: },
@@ -2306,22 +2515,26 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1566,
// CHECK-NEXT: "line": 77,
// CHECK-NEXT: "col": 31,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1564,
// CHECK-NEXT: "col": 29,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1566,
// CHECK-NEXT: "col": 31,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "mangledName": "_ZZ22TestPostfixExpressions1SPS_P1UIiEE1a",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "S"
// CHECK-NEXT: }
@@ -2330,21 +2543,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1572,
// CHECK-NEXT: "col": 37,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1569,
// CHECK-NEXT: "col": 34,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1572,
// CHECK-NEXT: "col": 37,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "p",
+// CHECK-NEXT: "mangledName": "_ZZ22TestPostfixExpressions1SPS_P1UIiEE1p",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "S *"
// CHECK-NEXT: }
@@ -2353,21 +2570,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1583,
// CHECK-NEXT: "col": 48,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1575,
// CHECK-NEXT: "col": 40,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1583,
// CHECK-NEXT: "col": 48,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "r",
+// CHECK-NEXT: "mangledName": "_ZZ22TestPostfixExpressions1SPS_P1UIiEE1r",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "U<int> *"
// CHECK-NEXT: }
@@ -2377,10 +2598,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1586,
// CHECK-NEXT: "col": 51,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1807,
// CHECK-NEXT: "line": 90,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -2392,11 +2615,13 @@
// CHECK-NEXT: "kind": "CXXMemberCallExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1590,
// CHECK-NEXT: "line": 78,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1598,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2411,10 +2636,12 @@
// CHECK-NEXT: "kind": "MemberExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1590,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1592,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -2432,10 +2659,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1590,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1590,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2460,10 +2689,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1597,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1597,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2481,11 +2712,13 @@
// CHECK-NEXT: "kind": "CXXMemberCallExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1603,
// CHECK-NEXT: "line": 79,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1612,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2500,10 +2733,12 @@
// CHECK-NEXT: "kind": "MemberExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1603,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1606,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -2521,10 +2756,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1603,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1603,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2540,10 +2777,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1603,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1603,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2570,10 +2809,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1611,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1611,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2591,11 +2832,13 @@
// CHECK-NEXT: "kind": "CXXMemberCallExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "line": 80,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1638,
// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2611,10 +2854,12 @@
// CHECK-NEXT: "kind": "MemberExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1636,
// CHECK-NEXT: "col": 22,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2632,10 +2877,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2651,10 +2898,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2683,11 +2932,13 @@
// CHECK-NEXT: "kind": "CXXMemberCallExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1643,
// CHECK-NEXT: "line": 81,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1665,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2703,10 +2954,12 @@
// CHECK-NEXT: "kind": "MemberExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1643,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1663,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2724,10 +2977,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1643,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1643,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2754,11 +3009,13 @@
// CHECK-NEXT: "kind": "CXXMemberCallExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1670,
// CHECK-NEXT: "line": 82,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1676,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2773,10 +3030,12 @@
// CHECK-NEXT: "kind": "MemberExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1670,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1674,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2794,10 +3053,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1670,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1670,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2813,10 +3074,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1670,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1670,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2845,11 +3108,13 @@
// CHECK-NEXT: "kind": "CXXMemberCallExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1681,
// CHECK-NEXT: "line": 83,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1686,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2864,10 +3129,12 @@
// CHECK-NEXT: "kind": "MemberExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1681,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1684,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2885,10 +3152,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1681,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1681,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2915,11 +3184,13 @@
// CHECK-NEXT: "kind": "CXXMemberCallExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1691,
// CHECK-NEXT: "line": 84,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1706,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2934,10 +3205,12 @@
// CHECK-NEXT: "kind": "MemberExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1691,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1693,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2955,10 +3228,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1691,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1691,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2985,11 +3260,13 @@
// CHECK-NEXT: "kind": "CXXMemberCallExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1711,
// CHECK-NEXT: "line": 85,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1722,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3004,10 +3281,12 @@
// CHECK-NEXT: "kind": "MemberExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1711,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1720,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3025,10 +3304,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1711,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1711,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3044,10 +3325,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1711,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1711,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3076,11 +3359,13 @@
// CHECK-NEXT: "kind": "CXXMemberCallExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1727,
// CHECK-NEXT: "line": 86,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1750,
// CHECK-NEXT: "col": 26,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3095,10 +3380,12 @@
// CHECK-NEXT: "kind": "MemberExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1727,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1748,
// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3116,10 +3403,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1727,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1727,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3135,10 +3424,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1727,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1727,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3167,11 +3458,13 @@
// CHECK-NEXT: "kind": "CXXTypeidExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1755,
// CHECK-NEXT: "line": 87,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1763,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3186,10 +3479,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1762,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1762,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3214,11 +3509,13 @@
// CHECK-NEXT: "kind": "CXXTypeidExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1768,
// CHECK-NEXT: "line": 88,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1776,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3236,11 +3533,13 @@
// CHECK-NEXT: "kind": "CXXTypeidExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1781,
// CHECK-NEXT: "line": 89,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1804,
// CHECK-NEXT: "col": 26,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3264,6 +3563,7 @@
// CHECK: "kind": "FunctionTemplateDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1841,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 93,
// CHECK-NEXT: "col": 6,
@@ -3271,11 +3571,13 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1810,
// CHECK-NEXT: "line": 92,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2257,
// CHECK-NEXT: "line": 122,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -3287,16 +3589,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TemplateTypeParmDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1832,
// CHECK-NEXT: "line": 92,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1820,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1832,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -3312,16 +3617,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1841,
// CHECK-NEXT: "line": 93,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 22
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1836,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2257,
// CHECK-NEXT: "line": 122,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -3336,22 +3644,26 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1870,
// CHECK-NEXT: "line": 93,
// CHECK-NEXT: "col": 35,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1864,
// CHECK-NEXT: "col": 29,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1870,
// CHECK-NEXT: "col": 35,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isReferenced": true,
// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "mangledName": "_ZZ22TestPrimaryExpressionsDpT_E1a",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "Ts..."
// CHECK-NEXT: },
@@ -3362,10 +3674,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1873,
// CHECK-NEXT: "col": 38,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2257,
// CHECK-NEXT: "line": 122,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -3377,11 +3691,13 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1877,
// CHECK-NEXT: "line": 94,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1958,
// CHECK-NEXT: "line": 101,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 1
@@ -3392,16 +3708,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1884,
// CHECK-NEXT: "line": 94,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1877,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1957,
// CHECK-NEXT: "line": 101,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
@@ -3464,16 +3783,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1884,
// CHECK-NEXT: "line": 94,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1877,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1884,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3486,16 +3808,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1897,
// CHECK-NEXT: "line": 95,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1892,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1953,
// CHECK-NEXT: "line": 100,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
@@ -3511,11 +3836,13 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1901,
// CHECK-NEXT: "line": 95,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1953,
// CHECK-NEXT: "line": 100,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
@@ -3527,11 +3854,13 @@
// CHECK-NEXT: "kind": "CXXThisExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1909,
// CHECK-NEXT: "line": 96,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1909,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -3546,11 +3875,13 @@
// CHECK-NEXT: "kind": "LambdaExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1922,
// CHECK-NEXT: "line": 98,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1929,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3564,15 +3895,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1922,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1922,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1922,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3618,15 +3952,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1922,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1927,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1929,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3642,10 +3979,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1928,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1929,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3657,15 +3996,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1923,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1923,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1923,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -3682,10 +4024,12 @@
// CHECK-NEXT: "kind": "ParenListExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1923,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1923,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -3700,10 +4044,12 @@
// CHECK-NEXT: "kind": "CXXThisExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1923,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1923,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -3720,10 +4066,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1928,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1929,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3736,11 +4084,13 @@
// CHECK-NEXT: "kind": "LambdaExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1938,
// CHECK-NEXT: "line": 99,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1946,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3754,15 +4104,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1938,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1938,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1938,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3810,15 +4163,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1938,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1944,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1946,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3834,10 +4190,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1945,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1946,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3849,15 +4207,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1939,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1939,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1939,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3874,10 +4235,12 @@
// CHECK-NEXT: "kind": "ParenListExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1939,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1939,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3892,10 +4255,12 @@
// CHECK-NEXT: "kind": "UnaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1939,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1939,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3913,10 +4278,12 @@
// CHECK-NEXT: "kind": "CXXThisExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1939,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1939,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3935,10 +4302,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1945,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1946,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3959,11 +4328,13 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1963,
// CHECK-NEXT: "line": 103,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1971,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3973,21 +4344,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1967,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1963,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1967,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isReferenced": true,
// CHECK-NEXT: "name": "b",
+// CHECK-NEXT: "mangledName": "_ZZ22TestPrimaryExpressionsDpT_E1b",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: }
@@ -3996,21 +4371,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1970,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1963,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1970,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isReferenced": true,
// CHECK-NEXT: "name": "c",
+// CHECK-NEXT: "mangledName": "_ZZ22TestPrimaryExpressionsDpT_E1c",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: }
@@ -4022,11 +4401,13 @@
// CHECK-NEXT: "kind": "LambdaExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1976,
// CHECK-NEXT: "line": 105,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1981,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4040,15 +4421,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1976,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1976,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1976,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4098,15 +4482,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1976,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1979,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1981,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4122,10 +4509,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1980,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1981,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4137,15 +4526,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXConversionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1976,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1976,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1981,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4162,15 +4554,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1976,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1976,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1981,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4190,10 +4585,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1980,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1981,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4206,11 +4603,13 @@
// CHECK-NEXT: "kind": "LambdaExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1986,
// CHECK-NEXT: "line": 106,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2001,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4224,15 +4623,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1986,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1986,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1986,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4282,15 +4684,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1986,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1999,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2001,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4306,20 +4711,24 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1993,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1989,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1993,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "mangledName": "_ZZZ22TestPrimaryExpressionsDpT_ENKUlizE_clEizE1a",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: }
@@ -4329,10 +4738,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2000,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2001,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4344,15 +4755,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXConversionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1986,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1986,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2001,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4369,15 +4783,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1986,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1986,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2001,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4395,20 +4812,24 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1993,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1989,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1993,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "mangledName": "_ZZZ22TestPrimaryExpressionsDpT_ENUlizE_8__invokeEizE1a",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: }
@@ -4422,10 +4843,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2000,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2001,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4438,11 +4861,13 @@
// CHECK-NEXT: "kind": "LambdaExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2006,
// CHECK-NEXT: "line": 107,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2013,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4456,15 +4881,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2006,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2006,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2006,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4510,15 +4938,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2006,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2011,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2013,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4534,10 +4965,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2012,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2013,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4549,15 +4982,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2007,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2007,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2007,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4574,10 +5010,12 @@
// CHECK-NEXT: "kind": "ParenListExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2007,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2007,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4592,10 +5030,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2007,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2007,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4620,10 +5060,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2012,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2013,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4636,11 +5078,13 @@
// CHECK-NEXT: "kind": "LambdaExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2018,
// CHECK-NEXT: "line": 108,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2022,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4654,15 +5098,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2018,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2018,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2018,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4712,15 +5159,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2018,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2020,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2022,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4736,10 +5186,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2021,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2022,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4754,10 +5206,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2021,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2022,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4770,11 +5224,13 @@
// CHECK-NEXT: "kind": "LambdaExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2027,
// CHECK-NEXT: "line": 109,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2043,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4788,15 +5244,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2027,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2027,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2027,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4846,15 +5305,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2027,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2029,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2043,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4870,10 +5332,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2031,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2043,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4884,10 +5348,12 @@
// CHECK-NEXT: "kind": "ReturnStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2033,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2040,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4898,10 +5364,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2040,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2040,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4932,10 +5400,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2031,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2043,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4946,10 +5416,12 @@
// CHECK-NEXT: "kind": "ReturnStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2033,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2040,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4960,10 +5432,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2040,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2040,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4992,11 +5466,13 @@
// CHECK-NEXT: "kind": "LambdaExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2048,
// CHECK-NEXT: "line": 110,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2052,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5010,15 +5486,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2048,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2048,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2048,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5068,15 +5547,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2048,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2050,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2052,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5092,10 +5574,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2051,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2052,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5110,10 +5594,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2051,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2052,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5126,11 +5612,13 @@
// CHECK-NEXT: "kind": "LambdaExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2057,
// CHECK-NEXT: "line": 111,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2073,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5144,15 +5632,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2057,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2057,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2057,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5202,15 +5693,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2057,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2059,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2073,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5226,10 +5720,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2061,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2073,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5240,10 +5736,12 @@
// CHECK-NEXT: "kind": "ReturnStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2063,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2070,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5254,10 +5752,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2070,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2070,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5288,10 +5788,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2061,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2073,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5302,10 +5804,12 @@
// CHECK-NEXT: "kind": "ReturnStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2063,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2070,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5316,10 +5820,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2070,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2070,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5348,11 +5854,13 @@
// CHECK-NEXT: "kind": "LambdaExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2078,
// CHECK-NEXT: "line": 112,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2101,
// CHECK-NEXT: "col": 26,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5366,15 +5874,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2078,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2078,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2078,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5420,15 +5931,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2078,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2084,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2101,
// CHECK-NEXT: "col": 26,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5444,10 +5958,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2085,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2101,
// CHECK-NEXT: "col": 26,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5458,10 +5974,12 @@
// CHECK-NEXT: "kind": "ReturnStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2087,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2098,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5472,10 +5990,12 @@
// CHECK-NEXT: "kind": "BinaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2094,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2098,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5491,10 +6011,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2094,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2094,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5510,10 +6032,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2094,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2094,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5538,10 +6062,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2098,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2098,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5557,10 +6083,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2098,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2098,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5592,15 +6120,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2079,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2079,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2079,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5614,15 +6145,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2083,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2083,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2083,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5639,10 +6173,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2079,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2079,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5658,10 +6194,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2079,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2079,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5686,10 +6224,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2083,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2083,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5712,10 +6252,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2085,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2101,
// CHECK-NEXT: "col": 26,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5726,10 +6268,12 @@
// CHECK-NEXT: "kind": "ReturnStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2087,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2098,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5740,10 +6284,12 @@
// CHECK-NEXT: "kind": "BinaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2094,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2098,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5759,10 +6305,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2094,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2094,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5778,10 +6326,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2094,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2094,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5806,10 +6356,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2098,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2098,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5825,10 +6377,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2098,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2098,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5861,11 +6415,13 @@
// CHECK-NEXT: "kind": "LambdaExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2106,
// CHECK-NEXT: "line": 113,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2121,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5879,15 +6435,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2106,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2106,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2106,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5933,15 +6492,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2106,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2119,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2121,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5957,10 +6519,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2120,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2121,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5972,15 +6536,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2107,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2107,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2107,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5994,15 +6561,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2113,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2113,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2113,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6020,10 +6590,12 @@
// CHECK-NEXT: "kind": "ParenListExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2107,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2107,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6038,10 +6610,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2107,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2107,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6066,10 +6640,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2117,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2117,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -6085,10 +6661,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2120,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2121,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6101,11 +6679,13 @@
// CHECK-NEXT: "kind": "LambdaExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2126,
// CHECK-NEXT: "line": 114,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2142,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6119,15 +6699,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2126,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2126,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2126,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6177,15 +6760,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2126,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2131,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 9
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2142,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6202,10 +6788,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2141,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2142,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6217,15 +6805,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXConversionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2126,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2126,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2142,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6242,15 +6833,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2126,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2126,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2142,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6270,10 +6864,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2141,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2142,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6286,11 +6882,13 @@
// CHECK-NEXT: "kind": "LambdaExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2147,
// CHECK-NEXT: "line": 115,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2161,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6304,15 +6902,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2147,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2147,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2147,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6362,15 +6963,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2147,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2152,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 7
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2161,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6386,10 +6990,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2160,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2161,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6401,15 +7007,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXConversionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2147,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2147,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2161,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6426,15 +7035,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2147,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2147,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2161,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6454,10 +7066,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2160,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2161,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6470,11 +7084,13 @@
// CHECK-NEXT: "kind": "LambdaExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2166,
// CHECK-NEXT: "line": 116,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2181,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6488,15 +7104,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2166,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2166,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2166,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6546,15 +7165,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2166,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2171,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2181,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6570,10 +7192,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2180,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2181,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6585,15 +7209,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXConversionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2166,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2166,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2181,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6610,15 +7237,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2166,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2166,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2181,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6638,10 +7268,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2180,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2181,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6654,11 +7286,13 @@
// CHECK-NEXT: "kind": "LambdaExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2186,
// CHECK-NEXT: "line": 117,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2210,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6672,15 +7306,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2186,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2186,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2186,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6730,15 +7367,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2186,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2194,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2210,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6754,10 +7394,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2198,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2210,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6768,10 +7410,12 @@
// CHECK-NEXT: "kind": "ReturnStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2200,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2207,
// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6782,10 +7426,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2207,
// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2207,
// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6806,15 +7452,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXConversionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2186,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2186,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2210,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6831,15 +7480,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2186,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2186,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2210,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6859,10 +7511,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2198,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2210,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6873,10 +7527,12 @@
// CHECK-NEXT: "kind": "ReturnStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2200,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2207,
// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6887,10 +7543,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2207,
// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2207,
// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6912,11 +7570,13 @@
// CHECK-NEXT: "kind": "CXXFoldExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2216,
// CHECK-NEXT: "line": 119,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2224,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6931,10 +7591,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2217,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2217,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6960,11 +7622,13 @@
// CHECK-NEXT: "kind": "CXXFoldExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2229,
// CHECK-NEXT: "line": 120,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2237,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6980,10 +7644,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2236,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2236,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -7008,11 +7674,13 @@
// CHECK-NEXT: "kind": "CXXFoldExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2242,
// CHECK-NEXT: "line": 121,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2254,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -7027,10 +7695,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2243,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2243,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -7053,10 +7723,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2253,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2253,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -7086,6 +7758,7 @@
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2336,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 130,
// CHECK-NEXT: "col": 6,
@@ -7093,16 +7766,19 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2331,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2379,
// CHECK-NEXT: "line": 134,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "TestADLCall",
+// CHECK-NEXT: "mangledName": "_Z11TestADLCallv",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: },
@@ -7112,11 +7788,13 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2350,
// CHECK-NEXT: "line": 130,
// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2379,
// CHECK-NEXT: "line": 134,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -7128,11 +7806,13 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2354,
// CHECK-NEXT: "line": 131,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2361,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -7142,21 +7822,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2360,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2354,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2360,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "x",
+// CHECK-NEXT: "mangledName": "_ZZ11TestADLCallvE1x",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "desugaredQualType": "NS::X",
// CHECK-NEXT: "qualType": "NS::X"
@@ -7168,10 +7852,12 @@
// CHECK-NEXT: "kind": "CXXConstructExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2360,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2360,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -7196,11 +7882,13 @@
// CHECK-NEXT: "kind": "CallExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2365,
// CHECK-NEXT: "line": 132,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2368,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -7216,10 +7904,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2365,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2365,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -7235,10 +7925,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2365,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2365,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -7263,10 +7955,12 @@
// CHECK-NEXT: "kind": "CXXConstructExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2367,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2367,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -7286,16 +7980,17 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2367,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2367,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "const NS::X",
// CHECK-NEXT: "qualType": "const NS::X"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "lvalue",
@@ -7306,10 +8001,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2367,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2367,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -7340,11 +8037,13 @@
// CHECK-NEXT: "kind": "CallExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2373,
// CHECK-NEXT: "line": 133,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2376,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -7360,10 +8059,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2373,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2373,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -7379,10 +8080,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2373,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2373,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -7407,10 +8110,12 @@
// CHECK-NEXT: "kind": "CXXConstructExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2375,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2375,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -7431,16 +8136,17 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2375,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2375,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "const NS::X",
// CHECK-NEXT: "qualType": "const NS::X"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "lvalue",
@@ -7451,10 +8157,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2375,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2375,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -7488,6 +8196,7 @@
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2387,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 136,
// CHECK-NEXT: "col": 6,
@@ -7495,16 +8204,19 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2382,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2429,
// CHECK-NEXT: "line": 139,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "TestNonADLCall",
+// CHECK-NEXT: "mangledName": "_Z14TestNonADLCallv",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: },
@@ -7514,11 +8226,13 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2404,
// CHECK-NEXT: "line": 136,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2429,
// CHECK-NEXT: "line": 139,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -7530,11 +8244,13 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2408,
// CHECK-NEXT: "line": 137,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2415,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -7544,21 +8260,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2414,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2408,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2414,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "x",
+// CHECK-NEXT: "mangledName": "_ZZ14TestNonADLCallvE1x",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "desugaredQualType": "NS::X",
// CHECK-NEXT: "qualType": "NS::X"
@@ -7570,10 +8290,12 @@
// CHECK-NEXT: "kind": "CXXConstructExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2414,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2414,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -7598,11 +8320,13 @@
// CHECK-NEXT: "kind": "CallExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2419,
// CHECK-NEXT: "line": 138,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2426,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -7617,10 +8341,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2419,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2423,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -7636,10 +8362,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2419,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2423,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -7664,10 +8392,12 @@
// CHECK-NEXT: "kind": "CXXConstructExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2425,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2425,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -7687,16 +8417,17 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2425,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2425,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "const NS::X",
// CHECK-NEXT: "qualType": "const NS::X"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "lvalue",
@@ -7707,10 +8438,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2425,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2425,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -7744,6 +8477,7 @@
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2437,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 141,
// CHECK-NEXT: "col": 6,
@@ -7751,16 +8485,19 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2432,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2499,
// CHECK-NEXT: "line": 146,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "TestNonADLCall2",
+// CHECK-NEXT: "mangledName": "_Z15TestNonADLCall2v",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: },
@@ -7770,11 +8507,13 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2455,
// CHECK-NEXT: "line": 141,
// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2499,
// CHECK-NEXT: "line": 146,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -7786,11 +8525,13 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2459,
// CHECK-NEXT: "line": 142,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2466,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -7800,21 +8541,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2465,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2459,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2465,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "x",
+// CHECK-NEXT: "mangledName": "_ZZ15TestNonADLCall2vE1x",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "desugaredQualType": "NS::X",
// CHECK-NEXT: "qualType": "NS::X"
@@ -7826,10 +8571,12 @@
// CHECK-NEXT: "kind": "CXXConstructExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2465,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2465,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -7854,11 +8601,13 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2470,
// CHECK-NEXT: "line": 143,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2481,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -7868,15 +8617,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "UsingDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2480,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2470,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2480,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -7890,11 +8642,13 @@
// CHECK-NEXT: "kind": "CallExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2485,
// CHECK-NEXT: "line": 144,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2488,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -7909,10 +8663,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2485,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2485,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -7928,10 +8684,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2485,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2485,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -7961,10 +8719,12 @@
// CHECK-NEXT: "kind": "CXXConstructExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2487,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2487,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -7984,16 +8744,17 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2487,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2487,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "const NS::X",
// CHECK-NEXT: "qualType": "const NS::X"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "lvalue",
@@ -8004,10 +8765,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2487,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2487,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -8038,11 +8801,13 @@
// CHECK-NEXT: "kind": "CallExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2493,
// CHECK-NEXT: "line": 145,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2496,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -8058,10 +8823,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2493,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2493,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -8077,10 +8844,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2493,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2493,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -8105,10 +8874,12 @@
// CHECK-NEXT: "kind": "CXXConstructExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2495,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2495,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -8129,16 +8900,17 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2495,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2495,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "const NS::X",
// CHECK-NEXT: "qualType": "const NS::X"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "lvalue",
@@ -8149,10 +8921,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2495,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2495,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -8186,6 +8960,7 @@
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2559,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 150,
// CHECK-NEXT: "col": 6,
@@ -8193,16 +8968,19 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2554,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2594,
// CHECK-NEXT: "line": 153,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "TestNonADLCall3",
+// CHECK-NEXT: "mangledName": "_ZN19test_adl_call_three15TestNonADLCall3Ev",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: },
@@ -8212,11 +8990,13 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2577,
// CHECK-NEXT: "line": 150,
// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2594,
// CHECK-NEXT: "line": 153,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -8228,11 +9008,13 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2581,
// CHECK-NEXT: "line": 151,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2584,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -8242,21 +9024,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 2583,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2581,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2583,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "x",
+// CHECK-NEXT: "mangledName": "_ZZN19test_adl_call_three15TestNonADLCall3EvE1x",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NS::X"
// CHECK-NEXT: },
@@ -8267,10 +9053,12 @@
// CHECK-NEXT: "kind": "CXXConstructExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2583,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2583,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -8294,11 +9082,13 @@
// CHECK-NEXT: "kind": "CallExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2588,
// CHECK-NEXT: "line": 152,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2591,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -8313,10 +9103,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2588,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2588,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -8332,10 +9124,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2588,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2588,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -8360,10 +9154,12 @@
// CHECK-NEXT: "kind": "CXXConstructExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2590,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2590,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -8383,10 +9179,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2590,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2590,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -8402,10 +9200,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 2590,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 2590,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
diff --git a/src/llvm-project/clang/test/AST/ast-dump-expr-json.m b/src/llvm-project/clang/test/AST/ast-dump-expr-json.m
index 91a98f5..6b6e51f 100644
--- a/src/llvm-project/clang/test/AST/ast-dump-expr-json.m
+++ b/src/llvm-project/clang/test/AST/ast-dump-expr-json.m
@@ -98,127 +98,141 @@
// NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py
-// CHECK: "kind": "FunctionDecl",
+// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 54,
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 1506,
+// CHECK-NEXT: "file": "{{.*}}",
+// CHECK-NEXT: "line": 54,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 14
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 1501,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 57,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 1566,
+// CHECK-NEXT: "line": 57,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "TestObjCEncode",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "TestObjCEncode",
+// CHECK-NEXT: "mangledName": "TestObjCEncode",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CompoundStmt",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 54,
-// CHECK-NEXT: "col": 23,
+// CHECK-NEXT: "offset": 1523,
+// CHECK-NEXT: "line": 54,
+// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 57,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 1566,
+// CHECK-NEXT: "line": 57,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 55,
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 1527,
+// CHECK-NEXT: "line": 55,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 14,
+// CHECK-NEXT: "offset": 1538,
+// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "char *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "ArrayToPointerDecay",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "ArrayToPointerDecay",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCEncodeExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCEncodeExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 1527,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 14,
+// CHECK-NEXT: "offset": 1538,
+// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "char [2]"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "encodedType": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 56,
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 1543,
+// CHECK-NEXT: "line": 56,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 23,
+// CHECK-NEXT: "offset": 1563,
+// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "char *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "ArrayToPointerDecay",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "ArrayToPointerDecay",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCEncodeExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCEncodeExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 1543,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 23,
+// CHECK-NEXT: "offset": 1563,
+// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "char [3]"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "encodedType": {
-// CHECK-NEXT: "desugaredQualType": "void (^)(void)",
+// CHECK-NEXT: "desugaredQualType": "void (^)(void)",
// CHECK-NEXT: "qualType": "typeof (^{ })"
// CHECK-NEXT: }
// CHECK-NEXT: }
@@ -230,129 +244,145 @@
// CHECK-NEXT: }
-// CHECK: "kind": "FunctionDecl",
+// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 59,
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 1574,
+// CHECK-NEXT: "file": "{{.*}}",
+// CHECK-NEXT: "line": 59,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 15
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 1569,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 62,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 1632,
+// CHECK-NEXT: "line": 62,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "TestObjCMessage",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "TestObjCMessage",
+// CHECK-NEXT: "mangledName": "TestObjCMessage",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (I *)"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 59,
-// CHECK-NEXT: "col": 25,
+// CHECK-NEXT: "offset": 1593,
+// CHECK-NEXT: "line": 59,
+// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 22,
+// CHECK-NEXT: "offset": 1590,
+// CHECK-NEXT: "col": 22,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 25,
+// CHECK-NEXT: "offset": 1593,
+// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "isUsed": true,
-// CHECK-NEXT: "name": "Obj",
+// CHECK-NEXT: },
+// CHECK-NEXT: "isUsed": true,
+// CHECK-NEXT: "name": "Obj",
+// CHECK-NEXT: "mangledName": "Obj",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "I *"
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CompoundStmt",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 30,
+// CHECK-NEXT: "offset": 1598,
+// CHECK-NEXT: "col": 30,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 62,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 1632,
+// CHECK-NEXT: "line": 62,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCMessageExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCMessageExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 60,
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 1602,
+// CHECK-NEXT: "line": 60,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "offset": 1614,
+// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "selector": "method1",
-// CHECK-NEXT: "receiverKind": "instance",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "selector": "method1",
+// CHECK-NEXT: "receiverKind": "instance",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 4,
+// CHECK-NEXT: "offset": 1603,
+// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 4,
+// CHECK-NEXT: "offset": 1603,
+// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "I *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 4,
+// CHECK-NEXT: "offset": 1603,
+// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 4,
+// CHECK-NEXT: "offset": 1603,
+// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "I *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "Obj",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "Obj",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "I *"
// CHECK-NEXT: }
@@ -361,27 +391,29 @@
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCMessageExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCMessageExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 61,
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 1619,
+// CHECK-NEXT: "line": 61,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 13,
+// CHECK-NEXT: "offset": 1629,
+// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "selector": "method2",
-// CHECK-NEXT: "receiverKind": "class",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "selector": "method2",
+// CHECK-NEXT: "receiverKind": "class",
// CHECK-NEXT: "classType": {
// CHECK-NEXT: "qualType": "I"
// CHECK-NEXT: }
@@ -392,138 +424,154 @@
// CHECK-NEXT: }
-// CHECK: "kind": "FunctionDecl",
+// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 64,
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 1640,
+// CHECK-NEXT: "file": "{{.*}}",
+// CHECK-NEXT: "line": 64,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 13
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 1635,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 66,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 1670,
+// CHECK-NEXT: "line": 66,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "TestObjCBoxed",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "TestObjCBoxed",
+// CHECK-NEXT: "mangledName": "TestObjCBoxed",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CompoundStmt",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 64,
-// CHECK-NEXT: "col": 22,
+// CHECK-NEXT: "offset": 1656,
+// CHECK-NEXT: "line": 64,
+// CHECK-NEXT: "col": 22,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 66,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 1670,
+// CHECK-NEXT: "line": 66,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCBoxedExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCBoxedExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 65,
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 1660,
+// CHECK-NEXT: "line": 65,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 10,
+// CHECK-NEXT: "offset": 1667,
+// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSNumber *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "selector": "numberWithInt:",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "selector": "numberWithInt:",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParenExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParenExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 4,
+// CHECK-NEXT: "offset": 1661,
+// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 10,
+// CHECK-NEXT: "offset": 1667,
+// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "BinaryOperator",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "BinaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 5,
+// CHECK-NEXT: "offset": 1662,
+// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "offset": 1666,
+// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "opcode": "+",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "opcode": "+",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "IntegerLiteral",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 5,
+// CHECK-NEXT: "offset": 1662,
+// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 5,
+// CHECK-NEXT: "offset": 1662,
+// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "value": "1"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "IntegerLiteral",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "offset": 1666,
+// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "offset": 1666,
+// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "value": "1"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@@ -538,102 +586,118 @@
// CHECK-NEXT: }
-// CHECK: "kind": "FunctionDecl",
+// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 68,
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 1678,
+// CHECK-NEXT: "file": "{{.*}}",
+// CHECK-NEXT: "line": 68,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 16
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 1673,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 70,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 1729,
+// CHECK-NEXT: "line": 70,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "TestObjCSelector",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "TestObjCSelector",
+// CHECK-NEXT: "mangledName": "TestObjCSelector",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CompoundStmt",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 68,
-// CHECK-NEXT: "col": 25,
+// CHECK-NEXT: "offset": 1697,
+// CHECK-NEXT: "line": 68,
+// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 70,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 1729,
+// CHECK-NEXT: "line": 70,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclStmt",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 69,
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 1701,
+// CHECK-NEXT: "line": 69,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 29,
+// CHECK-NEXT: "offset": 1727,
+// CHECK-NEXT: "col": 29,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "VarDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "offset": 1705,
+// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 1701,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 28,
+// CHECK-NEXT: "offset": 1726,
+// CHECK-NEXT: "col": 28,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "s",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "s",
+// CHECK-NEXT: "mangledName": "s",
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "SEL *",
-// CHECK-NEXT: "qualType": "SEL"
-// CHECK-NEXT: },
-// CHECK-NEXT: "init": "c",
+// CHECK-NEXT: "desugaredQualType": "SEL *",
+// CHECK-NEXT: "qualType": "SEL",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
+// CHECK-NEXT: },
+// CHECK-NEXT: "init": "c",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCSelectorExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCSelectorExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 11,
+// CHECK-NEXT: "offset": 1709,
+// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 28,
+// CHECK-NEXT: "offset": 1726,
+// CHECK-NEXT: "col": 28,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "SEL *",
-// CHECK-NEXT: "qualType": "SEL"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "desugaredQualType": "SEL *",
+// CHECK-NEXT: "qualType": "SEL",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "selector": "dealloc"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@@ -646,160 +710,182 @@
// CHECK-NEXT: }
-// CHECK: "kind": "FunctionDecl",
+// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 72,
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 1737,
+// CHECK-NEXT: "file": "{{.*}}",
+// CHECK-NEXT: "line": 72,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 16
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 1732,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 74,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 1809,
+// CHECK-NEXT: "line": 74,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "TestObjCProtocol",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "TestObjCProtocol",
+// CHECK-NEXT: "mangledName": "TestObjCProtocol",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (id)"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 72,
-// CHECK-NEXT: "col": 26,
+// CHECK-NEXT: "offset": 1757,
+// CHECK-NEXT: "line": 72,
+// CHECK-NEXT: "col": 26,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 23,
+// CHECK-NEXT: "offset": 1754,
+// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 2
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 26,
+// CHECK-NEXT: "offset": 1757,
+// CHECK-NEXT: "col": 26,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "isUsed": true,
-// CHECK-NEXT: "name": "Obj",
+// CHECK-NEXT: },
+// CHECK-NEXT: "isUsed": true,
+// CHECK-NEXT: "name": "Obj",
+// CHECK-NEXT: "mangledName": "Obj",
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "id",
-// CHECK-NEXT: "qualType": "id"
+// CHECK-NEXT: "desugaredQualType": "id",
+// CHECK-NEXT: "qualType": "id",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CompoundStmt",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 31,
+// CHECK-NEXT: "offset": 1762,
+// CHECK-NEXT: "col": 31,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 74,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 1809,
+// CHECK-NEXT: "line": 74,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCMessageExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCMessageExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 73,
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 1766,
+// CHECK-NEXT: "line": 73,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 43,
+// CHECK-NEXT: "offset": 1806,
+// CHECK-NEXT: "col": 43,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "selector": "conformsToProtocol:",
-// CHECK-NEXT: "receiverKind": "instance",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "selector": "conformsToProtocol:",
+// CHECK-NEXT: "receiverKind": "instance",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 4,
+// CHECK-NEXT: "offset": 1767,
+// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 4,
+// CHECK-NEXT: "offset": 1767,
+// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "id",
-// CHECK-NEXT: "qualType": "id"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: "desugaredQualType": "id",
+// CHECK-NEXT: "qualType": "id",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 4,
+// CHECK-NEXT: "offset": 1767,
+// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 4,
+// CHECK-NEXT: "offset": 1767,
+// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "id",
-// CHECK-NEXT: "qualType": "id"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "desugaredQualType": "id",
+// CHECK-NEXT: "qualType": "id",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "Obj",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "Obj",
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "id",
-// CHECK-NEXT: "qualType": "id"
+// CHECK-NEXT: "desugaredQualType": "id",
+// CHECK-NEXT: "qualType": "id",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCProtocolExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCProtocolExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 27,
+// CHECK-NEXT: "offset": 1790,
+// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 42,
+// CHECK-NEXT: "offset": 1805,
+// CHECK-NEXT: "col": 42,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "Protocol *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "protocol": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCProtocolDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCProtocolDecl",
// CHECK-NEXT: "name": "Proto"
// CHECK-NEXT: }
// CHECK-NEXT: }
@@ -811,189 +897,211 @@
// CHECK-NEXT: }
-// CHECK: "kind": "FunctionDecl",
+// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 76,
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 1817,
+// CHECK-NEXT: "file": "{{.*}}",
+// CHECK-NEXT: "line": 76,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 19
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 1812,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 79,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 1884,
+// CHECK-NEXT: "line": 79,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "TestObjCPropertyRef",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "TestObjCPropertyRef",
+// CHECK-NEXT: "mangledName": "TestObjCPropertyRef",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (J *)"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 76,
-// CHECK-NEXT: "col": 29,
+// CHECK-NEXT: "offset": 1840,
+// CHECK-NEXT: "line": 76,
+// CHECK-NEXT: "col": 29,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 26,
+// CHECK-NEXT: "offset": 1837,
+// CHECK-NEXT: "col": 26,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 29,
+// CHECK-NEXT: "offset": 1840,
+// CHECK-NEXT: "col": 29,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "isUsed": true,
-// CHECK-NEXT: "name": "Obj",
+// CHECK-NEXT: },
+// CHECK-NEXT: "isUsed": true,
+// CHECK-NEXT: "name": "Obj",
+// CHECK-NEXT: "mangledName": "Obj",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "J *"
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CompoundStmt",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 34,
+// CHECK-NEXT: "offset": 1845,
+// CHECK-NEXT: "col": 34,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 79,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 1884,
+// CHECK-NEXT: "line": 79,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "PseudoObjectExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "PseudoObjectExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 77,
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 1849,
+// CHECK-NEXT: "line": 77,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 14,
+// CHECK-NEXT: "offset": 1860,
+// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "unsigned int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "BinaryOperator",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "BinaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 1849,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 14,
+// CHECK-NEXT: "offset": 1860,
+// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "opcode": "=",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "opcode": "=",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCPropertyRefExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCPropertyRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 1849,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "offset": 1853,
+// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "<pseudo-object type>"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "propertyKind": "explicit",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "propertyKind": "explicit",
// CHECK-NEXT: "property": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCPropertyDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCPropertyDecl",
// CHECK-NEXT: "name": "prop"
-// CHECK-NEXT: },
-// CHECK-NEXT: "isMessagingSetter": true,
+// CHECK-NEXT: },
+// CHECK-NEXT: "isMessagingSetter": true,
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 1849,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 1849,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "J *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 1849,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 1849,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "J *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 1849,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 1849,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "J *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "Obj",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "Obj",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "J *"
// CHECK-NEXT: }
@@ -1004,106 +1112,116 @@
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 14,
+// CHECK-NEXT: "offset": 1860,
+// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 2
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 14,
+// CHECK-NEXT: "offset": 1860,
+// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "IntegerLiteral",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 14,
+// CHECK-NEXT: "offset": 1860,
+// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 2
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 14,
+// CHECK-NEXT: "offset": 1860,
+// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "value": "12"
// CHECK-NEXT: }
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 1849,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 1849,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "J *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 1849,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 1849,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "J *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 1849,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 1849,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "J *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "Obj",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "Obj",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "J *"
// CHECK-NEXT: }
@@ -1112,118 +1230,130 @@
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 14,
+// CHECK-NEXT: "offset": 1860,
+// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 2
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 14,
+// CHECK-NEXT: "offset": 1860,
+// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "IntegerLiteral",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 14,
+// CHECK-NEXT: "offset": 1860,
+// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 2
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 14,
+// CHECK-NEXT: "offset": 1860,
+// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "value": "12"
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 14,
+// CHECK-NEXT: "offset": 1860,
+// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 2
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 14,
+// CHECK-NEXT: "offset": 1860,
+// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "unsigned int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 14,
+// CHECK-NEXT: "offset": 1860,
+// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 2
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 14,
+// CHECK-NEXT: "offset": 1860,
+// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "unsigned int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "IntegralCast",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "IntegralCast",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 14,
+// CHECK-NEXT: "offset": 1860,
+// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 2
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 14,
+// CHECK-NEXT: "offset": 1860,
+// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "IntegerLiteral",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 14,
+// CHECK-NEXT: "offset": 1860,
+// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 2
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 14,
+// CHECK-NEXT: "offset": 1860,
+// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "value": "12"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@@ -1231,85 +1361,93 @@
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCMessageExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCMessageExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "offset": 1853,
+// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "offset": 1853,
+// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "selector": "setProp:",
-// CHECK-NEXT: "receiverKind": "instance",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "selector": "setProp:",
+// CHECK-NEXT: "receiverKind": "instance",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 1849,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 1849,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "J *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 1849,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 1849,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "J *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 1849,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 1849,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "J *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "Obj",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "Obj",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "J *"
// CHECK-NEXT: }
@@ -1318,79 +1456,87 @@
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 14,
+// CHECK-NEXT: "offset": 1860,
+// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 2
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 14,
+// CHECK-NEXT: "offset": 1860,
+// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "unsigned int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 14,
+// CHECK-NEXT: "offset": 1860,
+// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 2
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 14,
+// CHECK-NEXT: "offset": 1860,
+// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "unsigned int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "IntegralCast",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "IntegralCast",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 14,
+// CHECK-NEXT: "offset": 1860,
+// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 2
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 14,
+// CHECK-NEXT: "offset": 1860,
+// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "IntegerLiteral",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 14,
+// CHECK-NEXT: "offset": 1860,
+// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 2
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 14,
+// CHECK-NEXT: "offset": 1860,
+// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "value": "12"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@@ -1402,165 +1548,183 @@
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclStmt",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 78,
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 1866,
+// CHECK-NEXT: "line": 78,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 19,
+// CHECK-NEXT: "offset": 1882,
+// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "VarDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "offset": 1870,
+// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 1866,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "offset": 1878,
+// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "i",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "i",
+// CHECK-NEXT: "mangledName": "i",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "init": "c",
+// CHECK-NEXT: },
+// CHECK-NEXT: "init": "c",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 11,
+// CHECK-NEXT: "offset": 1874,
+// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "offset": 1878,
+// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "IntegralCast",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "IntegralCast",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "PseudoObjectExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "PseudoObjectExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 11,
+// CHECK-NEXT: "offset": 1874,
+// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "offset": 1878,
+// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "unsigned int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCPropertyRefExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCPropertyRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 11,
+// CHECK-NEXT: "offset": 1874,
+// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "offset": 1878,
+// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "<pseudo-object type>"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "propertyKind": "explicit",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "propertyKind": "explicit",
// CHECK-NEXT: "property": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCPropertyDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCPropertyDecl",
// CHECK-NEXT: "name": "prop"
-// CHECK-NEXT: },
-// CHECK-NEXT: "isMessagingGetter": true,
+// CHECK-NEXT: },
+// CHECK-NEXT: "isMessagingGetter": true,
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 11,
+// CHECK-NEXT: "offset": 1874,
+// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 11,
+// CHECK-NEXT: "offset": 1874,
+// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "J *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 11,
+// CHECK-NEXT: "offset": 1874,
+// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 11,
+// CHECK-NEXT: "offset": 1874,
+// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "J *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 11,
+// CHECK-NEXT: "offset": 1874,
+// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 11,
+// CHECK-NEXT: "offset": 1874,
+// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "J *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "Obj",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "Obj",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "J *"
// CHECK-NEXT: }
@@ -1571,65 +1735,71 @@
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 11,
+// CHECK-NEXT: "offset": 1874,
+// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 11,
+// CHECK-NEXT: "offset": 1874,
+// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "J *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 11,
+// CHECK-NEXT: "offset": 1874,
+// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 11,
+// CHECK-NEXT: "offset": 1874,
+// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "J *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 11,
+// CHECK-NEXT: "offset": 1874,
+// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 11,
+// CHECK-NEXT: "offset": 1874,
+// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "J *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "Obj",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "Obj",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "J *"
// CHECK-NEXT: }
@@ -1638,85 +1808,93 @@
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCMessageExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCMessageExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "offset": 1878,
+// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "offset": 1878,
+// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "unsigned int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "selector": "prop",
-// CHECK-NEXT: "receiverKind": "instance",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "selector": "prop",
+// CHECK-NEXT: "receiverKind": "instance",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 11,
+// CHECK-NEXT: "offset": 1874,
+// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 11,
+// CHECK-NEXT: "offset": 1874,
+// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "J *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 11,
+// CHECK-NEXT: "offset": 1874,
+// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 11,
+// CHECK-NEXT: "offset": 1874,
+// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "J *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 11,
+// CHECK-NEXT: "offset": 1874,
+// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 11,
+// CHECK-NEXT: "offset": 1874,
+// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "J *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "Obj",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "Obj",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "J *"
// CHECK-NEXT: }
@@ -1742,207 +1920,234 @@
// CHECK-NEXT: }
-// CHECK: "kind": "FunctionDecl",
+// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 81,
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 1892,
+// CHECK-NEXT: "file": "{{.*}}",
+// CHECK-NEXT: "line": 81,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 20
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 1887,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 87,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 2052,
+// CHECK-NEXT: "line": 87,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "TestObjCSubscriptRef",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "TestObjCSubscriptRef",
+// CHECK-NEXT: "mangledName": "TestObjCSubscriptRef",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (NSMutableArray *, NSMutableDictionary *)"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 81,
-// CHECK-NEXT: "col": 43,
+// CHECK-NEXT: "offset": 1929,
+// CHECK-NEXT: "line": 81,
+// CHECK-NEXT: "col": 43,
// CHECK-NEXT: "tokLen": 5
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 27,
+// CHECK-NEXT: "offset": 1913,
+// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 14
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 43,
+// CHECK-NEXT: "offset": 1929,
+// CHECK-NEXT: "col": 43,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "isUsed": true,
-// CHECK-NEXT: "name": "Array",
+// CHECK-NEXT: },
+// CHECK-NEXT: "isUsed": true,
+// CHECK-NEXT: "name": "Array",
+// CHECK-NEXT: "mangledName": "Array",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableArray *"
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "col": 71,
+// CHECK-NEXT: "offset": 1957,
+// CHECK-NEXT: "col": 71,
// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 50,
+// CHECK-NEXT: "offset": 1936,
+// CHECK-NEXT: "col": 50,
// CHECK-NEXT: "tokLen": 19
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 71,
+// CHECK-NEXT: "offset": 1957,
+// CHECK-NEXT: "col": 71,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "isUsed": true,
-// CHECK-NEXT: "name": "Dict",
+// CHECK-NEXT: },
+// CHECK-NEXT: "isUsed": true,
+// CHECK-NEXT: "name": "Dict",
+// CHECK-NEXT: "mangledName": "Dict",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableDictionary *"
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CompoundStmt",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 77,
+// CHECK-NEXT: "offset": 1963,
+// CHECK-NEXT: "col": 77,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 87,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 2052,
+// CHECK-NEXT: "line": 87,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "PseudoObjectExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "PseudoObjectExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 82,
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 1966,
+// CHECK-NEXT: "line": 82,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 5
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 20,
+// CHECK-NEXT: "offset": 1984,
+// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "id",
-// CHECK-NEXT: "qualType": "id"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "desugaredQualType": "id",
+// CHECK-NEXT: "qualType": "id",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "BinaryOperator",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "BinaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 1966,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 5
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 20,
+// CHECK-NEXT: "offset": 1984,
+// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "opcode": "=",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "opcode": "=",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCSubscriptRefExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCSubscriptRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 1966,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 5
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "offset": 1973,
+// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "<pseudo-object type>"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "subscriptKind": "array",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "subscriptKind": "array",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 1966,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 5
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 1966,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableArray *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 1966,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 5
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 1966,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableArray *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 1966,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 5
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 1966,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableArray *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "Array",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "Array",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableArray *"
// CHECK-NEXT: }
@@ -1951,102 +2156,112 @@
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "offset": 1972,
+// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "offset": 1972,
+// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "IntegerLiteral",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "offset": 1972,
+// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "offset": 1972,
+// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "value": "0"
// CHECK-NEXT: }
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 13,
+// CHECK-NEXT: "offset": 1977,
+// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 20,
+// CHECK-NEXT: "offset": 1984,
+// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CStyleCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CStyleCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 13,
+// CHECK-NEXT: "offset": 1977,
+// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 20,
+// CHECK-NEXT: "offset": 1984,
+// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "NullToPointer",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "NullToPointer",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "IntegerLiteral",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 20,
+// CHECK-NEXT: "offset": 1984,
+// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 20,
+// CHECK-NEXT: "offset": 1984,
+// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "value": "0"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@@ -2054,65 +2269,71 @@
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 1966,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 5
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 1966,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableArray *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 1966,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 5
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 1966,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableArray *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 1966,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 5
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 1966,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableArray *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "Array",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "Array",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableArray *"
// CHECK-NEXT: }
@@ -2121,199 +2342,221 @@
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "offset": 1972,
+// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "offset": 1972,
+// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "IntegerLiteral",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "offset": 1972,
+// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "offset": 1972,
+// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "value": "0"
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 13,
+// CHECK-NEXT: "offset": 1977,
+// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 20,
+// CHECK-NEXT: "offset": 1984,
+// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CStyleCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CStyleCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 13,
+// CHECK-NEXT: "offset": 1977,
+// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 20,
+// CHECK-NEXT: "offset": 1984,
+// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "NullToPointer",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "NullToPointer",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "IntegerLiteral",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 20,
+// CHECK-NEXT: "offset": 1984,
+// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 20,
+// CHECK-NEXT: "offset": 1984,
+// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "value": "0"
// CHECK-NEXT: }
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 13,
+// CHECK-NEXT: "offset": 1977,
+// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 20,
+// CHECK-NEXT: "offset": 1984,
+// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "id",
-// CHECK-NEXT: "qualType": "id"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "desugaredQualType": "id",
+// CHECK-NEXT: "qualType": "id",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 13,
+// CHECK-NEXT: "offset": 1977,
+// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 20,
+// CHECK-NEXT: "offset": 1984,
+// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "id",
-// CHECK-NEXT: "qualType": "id"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "NullToPointer",
+// CHECK-NEXT: "desugaredQualType": "id",
+// CHECK-NEXT: "qualType": "id",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "NullToPointer",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 13,
+// CHECK-NEXT: "offset": 1977,
+// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 20,
+// CHECK-NEXT: "offset": 1984,
+// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CStyleCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CStyleCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 13,
+// CHECK-NEXT: "offset": 1977,
+// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 20,
+// CHECK-NEXT: "offset": 1984,
+// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "NullToPointer",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "NullToPointer",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "IntegerLiteral",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 20,
+// CHECK-NEXT: "offset": 1984,
+// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 20,
+// CHECK-NEXT: "offset": 1984,
+// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "value": "0"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@@ -2323,85 +2566,93 @@
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCMessageExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCMessageExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 1966,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 5
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 1966,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "selector": "setObject:atIndexedSubscript:",
-// CHECK-NEXT: "receiverKind": "instance",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "selector": "setObject:atIndexedSubscript:",
+// CHECK-NEXT: "receiverKind": "instance",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 1966,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 5
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 1966,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableArray *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 1966,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 5
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 1966,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableArray *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 1966,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 5
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 1966,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableArray *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "Array",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "Array",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableArray *"
// CHECK-NEXT: }
@@ -2410,100 +2661,112 @@
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 13,
+// CHECK-NEXT: "offset": 1977,
+// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 20,
+// CHECK-NEXT: "offset": 1984,
+// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "id",
-// CHECK-NEXT: "qualType": "id"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "desugaredQualType": "id",
+// CHECK-NEXT: "qualType": "id",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 13,
+// CHECK-NEXT: "offset": 1977,
+// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 20,
+// CHECK-NEXT: "offset": 1984,
+// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "id",
-// CHECK-NEXT: "qualType": "id"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "NullToPointer",
+// CHECK-NEXT: "desugaredQualType": "id",
+// CHECK-NEXT: "qualType": "id",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "NullToPointer",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 13,
+// CHECK-NEXT: "offset": 1977,
+// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 20,
+// CHECK-NEXT: "offset": 1984,
+// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CStyleCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CStyleCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 13,
+// CHECK-NEXT: "offset": 1977,
+// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 20,
+// CHECK-NEXT: "offset": 1984,
+// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "NullToPointer",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "NullToPointer",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "IntegerLiteral",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 20,
+// CHECK-NEXT: "offset": 1984,
+// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 20,
+// CHECK-NEXT: "offset": 1984,
+// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "value": "0"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@@ -2513,42 +2776,46 @@
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "offset": 1972,
+// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "offset": 1972,
+// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "IntegerLiteral",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "offset": 1972,
+// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "offset": 1972,
+// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "value": "0"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@@ -2556,143 +2823,161 @@
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclStmt",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 83,
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 1988,
+// CHECK-NEXT: "line": 83,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 2
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 17,
+// CHECK-NEXT: "offset": 2003,
+// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "VarDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "col": 5,
+// CHECK-NEXT: "offset": 1991,
+// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 1988,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 2
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 16,
+// CHECK-NEXT: "offset": 2002,
+// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "isUsed": true,
-// CHECK-NEXT: "name": "i",
+// CHECK-NEXT: },
+// CHECK-NEXT: "isUsed": true,
+// CHECK-NEXT: "name": "i",
+// CHECK-NEXT: "mangledName": "i",
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "id",
-// CHECK-NEXT: "qualType": "id"
-// CHECK-NEXT: },
-// CHECK-NEXT: "init": "c",
+// CHECK-NEXT: "desugaredQualType": "id",
+// CHECK-NEXT: "qualType": "id",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
+// CHECK-NEXT: },
+// CHECK-NEXT: "init": "c",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "PseudoObjectExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "PseudoObjectExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "offset": 1995,
+// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 5
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 16,
+// CHECK-NEXT: "offset": 2002,
+// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "id",
-// CHECK-NEXT: "qualType": "id"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "desugaredQualType": "id",
+// CHECK-NEXT: "qualType": "id",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCSubscriptRefExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCSubscriptRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "offset": 1995,
+// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 5
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 16,
+// CHECK-NEXT: "offset": 2002,
+// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "<pseudo-object type>"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "subscriptKind": "array",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "subscriptKind": "array",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "offset": 1995,
+// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 5
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "offset": 1995,
+// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableArray *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "offset": 1995,
+// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 5
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "offset": 1995,
+// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableArray *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "offset": 1995,
+// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 5
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "offset": 1995,
+// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableArray *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "Array",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "Array",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableArray *"
// CHECK-NEXT: }
@@ -2701,106 +2986,116 @@
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "offset": 2001,
+// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "offset": 2001,
+// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "IntegerLiteral",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "offset": 2001,
+// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "offset": 2001,
+// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "value": "0"
// CHECK-NEXT: }
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "offset": 1995,
+// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 5
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "offset": 1995,
+// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableArray *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "offset": 1995,
+// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 5
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "offset": 1995,
+// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableArray *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "offset": 1995,
+// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 5
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "offset": 1995,
+// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableArray *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "Array",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "Array",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableArray *"
// CHECK-NEXT: }
@@ -2809,125 +3104,138 @@
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "offset": 2001,
+// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "offset": 2001,
+// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "IntegerLiteral",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "offset": 2001,
+// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "offset": 2001,
+// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "value": "0"
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCMessageExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCMessageExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "offset": 1995,
+// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 5
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "offset": 1995,
+// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "id",
-// CHECK-NEXT: "qualType": "id"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "selector": "objectAtIndexedSubscript:",
-// CHECK-NEXT: "receiverKind": "instance",
+// CHECK-NEXT: "desugaredQualType": "id",
+// CHECK-NEXT: "qualType": "id",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "selector": "objectAtIndexedSubscript:",
+// CHECK-NEXT: "receiverKind": "instance",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "offset": 1995,
+// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 5
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "offset": 1995,
+// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableArray *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "offset": 1995,
+// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 5
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "offset": 1995,
+// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableArray *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "offset": 1995,
+// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 5
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "offset": 1995,
+// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableArray *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "Array",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "Array",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableArray *"
// CHECK-NEXT: }
@@ -2936,42 +3244,46 @@
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "offset": 2001,
+// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "offset": 2001,
+// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "IntegerLiteral",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "offset": 2001,
+// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "offset": 2001,
+// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "value": "0"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@@ -2983,123 +3295,136 @@
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "PseudoObjectExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "PseudoObjectExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 85,
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 2008,
+// CHECK-NEXT: "line": 85,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 24,
+// CHECK-NEXT: "offset": 2030,
+// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "id",
-// CHECK-NEXT: "qualType": "id"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "desugaredQualType": "id",
+// CHECK-NEXT: "qualType": "id",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "BinaryOperator",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "BinaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 2008,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 24,
+// CHECK-NEXT: "offset": 2030,
+// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "opcode": "=",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "opcode": "=",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCSubscriptRefExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCSubscriptRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 2008,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 13,
+// CHECK-NEXT: "offset": 2019,
+// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "<pseudo-object type>"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "subscriptKind": "dictionary",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "subscriptKind": "dictionary",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 2008,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 2008,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableDictionary *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 2008,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 2008,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableDictionary *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 2008,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 2008,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableDictionary *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "Dict",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "Dict",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableDictionary *"
// CHECK-NEXT: }
@@ -3108,60 +3433,66 @@
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "offset": 2013,
+// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "offset": 2014,
+// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSString *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCStringLiteral",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCStringLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "offset": 2013,
+// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "offset": 2014,
+// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSString *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "StringLiteral",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "StringLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "offset": 2014,
+// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "offset": 2014,
+// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "char [4]"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "value": "\"key\""
// CHECK-NEXT: }
// CHECK-NEXT: ]
@@ -3169,61 +3500,67 @@
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 17,
+// CHECK-NEXT: "offset": 2023,
+// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 24,
+// CHECK-NEXT: "offset": 2030,
+// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CStyleCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CStyleCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 17,
+// CHECK-NEXT: "offset": 2023,
+// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 24,
+// CHECK-NEXT: "offset": 2030,
+// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "NullToPointer",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "NullToPointer",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "IntegerLiteral",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 24,
+// CHECK-NEXT: "offset": 2030,
+// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 24,
+// CHECK-NEXT: "offset": 2030,
+// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "value": "0"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@@ -3231,65 +3568,71 @@
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 2008,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 2008,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableDictionary *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 2008,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 2008,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableDictionary *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 2008,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 2008,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableDictionary *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "Dict",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "Dict",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableDictionary *"
// CHECK-NEXT: }
@@ -3298,219 +3641,243 @@
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "offset": 2013,
+// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "offset": 2014,
+// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSString *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCStringLiteral",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCStringLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "offset": 2013,
+// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "offset": 2014,
+// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSString *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "StringLiteral",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "StringLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "offset": 2014,
+// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "offset": 2014,
+// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "char [4]"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "value": "\"key\""
// CHECK-NEXT: }
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 17,
+// CHECK-NEXT: "offset": 2023,
+// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 24,
+// CHECK-NEXT: "offset": 2030,
+// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CStyleCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CStyleCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 17,
+// CHECK-NEXT: "offset": 2023,
+// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 24,
+// CHECK-NEXT: "offset": 2030,
+// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "NullToPointer",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "NullToPointer",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "IntegerLiteral",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 24,
+// CHECK-NEXT: "offset": 2030,
+// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 24,
+// CHECK-NEXT: "offset": 2030,
+// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "value": "0"
// CHECK-NEXT: }
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 17,
+// CHECK-NEXT: "offset": 2023,
+// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 24,
+// CHECK-NEXT: "offset": 2030,
+// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "id",
-// CHECK-NEXT: "qualType": "id"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "desugaredQualType": "id",
+// CHECK-NEXT: "qualType": "id",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 17,
+// CHECK-NEXT: "offset": 2023,
+// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 24,
+// CHECK-NEXT: "offset": 2030,
+// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "id",
-// CHECK-NEXT: "qualType": "id"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "NullToPointer",
+// CHECK-NEXT: "desugaredQualType": "id",
+// CHECK-NEXT: "qualType": "id",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "NullToPointer",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 17,
+// CHECK-NEXT: "offset": 2023,
+// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 24,
+// CHECK-NEXT: "offset": 2030,
+// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CStyleCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CStyleCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 17,
+// CHECK-NEXT: "offset": 2023,
+// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 24,
+// CHECK-NEXT: "offset": 2030,
+// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "NullToPointer",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "NullToPointer",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "IntegerLiteral",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 24,
+// CHECK-NEXT: "offset": 2030,
+// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 24,
+// CHECK-NEXT: "offset": 2030,
+// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "value": "0"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@@ -3520,85 +3887,93 @@
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCMessageExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCMessageExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 2008,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 2008,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "selector": "setObject:forKeyedSubscript:",
-// CHECK-NEXT: "receiverKind": "instance",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "selector": "setObject:forKeyedSubscript:",
+// CHECK-NEXT: "receiverKind": "instance",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 2008,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 2008,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableDictionary *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 2008,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 2008,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableDictionary *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 2008,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 2008,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableDictionary *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "Dict",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "Dict",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableDictionary *"
// CHECK-NEXT: }
@@ -3607,100 +3982,112 @@
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 17,
+// CHECK-NEXT: "offset": 2023,
+// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 24,
+// CHECK-NEXT: "offset": 2030,
+// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "id",
-// CHECK-NEXT: "qualType": "id"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "desugaredQualType": "id",
+// CHECK-NEXT: "qualType": "id",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 17,
+// CHECK-NEXT: "offset": 2023,
+// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 24,
+// CHECK-NEXT: "offset": 2030,
+// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "id",
-// CHECK-NEXT: "qualType": "id"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "NullToPointer",
+// CHECK-NEXT: "desugaredQualType": "id",
+// CHECK-NEXT: "qualType": "id",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "NullToPointer",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 17,
+// CHECK-NEXT: "offset": 2023,
+// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 24,
+// CHECK-NEXT: "offset": 2030,
+// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CStyleCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CStyleCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 17,
+// CHECK-NEXT: "offset": 2023,
+// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 24,
+// CHECK-NEXT: "offset": 2030,
+// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "NullToPointer",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "NullToPointer",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "IntegerLiteral",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 24,
+// CHECK-NEXT: "offset": 2030,
+// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 24,
+// CHECK-NEXT: "offset": 2030,
+// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "value": "0"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@@ -3710,80 +4097,89 @@
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "offset": 2013,
+// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "offset": 2014,
+// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "id",
-// CHECK-NEXT: "qualType": "id"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "BitCast",
+// CHECK-NEXT: "desugaredQualType": "id",
+// CHECK-NEXT: "qualType": "id",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "BitCast",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "offset": 2013,
+// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "offset": 2014,
+// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSString *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCStringLiteral",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCStringLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 7,
+// CHECK-NEXT: "offset": 2013,
+// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "offset": 2014,
+// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSString *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "StringLiteral",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "StringLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "offset": 2014,
+// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "offset": 2014,
+// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "char [4]"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "value": "\"key\""
// CHECK-NEXT: }
// CHECK-NEXT: ]
@@ -3795,152 +4191,170 @@
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "BinaryOperator",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "BinaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 86,
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 2034,
+// CHECK-NEXT: "line": 86,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 17,
+// CHECK-NEXT: "offset": 2049,
+// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "id",
-// CHECK-NEXT: "qualType": "id"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "opcode": "=",
+// CHECK-NEXT: "desugaredQualType": "id",
+// CHECK-NEXT: "qualType": "id",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "opcode": "=",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 2034,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 2,
+// CHECK-NEXT: "offset": 2034,
+// CHECK-NEXT: "col": 2,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "id",
-// CHECK-NEXT: "qualType": "id"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "desugaredQualType": "id",
+// CHECK-NEXT: "qualType": "id",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "VarDecl",
-// CHECK-NEXT: "name": "i",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "VarDecl",
+// CHECK-NEXT: "name": "i",
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "id",
-// CHECK-NEXT: "qualType": "id"
+// CHECK-NEXT: "desugaredQualType": "id",
+// CHECK-NEXT: "qualType": "id",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
// CHECK-NEXT: }
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "PseudoObjectExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "PseudoObjectExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 2038,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 17,
+// CHECK-NEXT: "offset": 2049,
+// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "id",
-// CHECK-NEXT: "qualType": "id"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "desugaredQualType": "id",
+// CHECK-NEXT: "qualType": "id",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCSubscriptRefExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCSubscriptRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 2038,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 17,
+// CHECK-NEXT: "offset": 2049,
+// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "<pseudo-object type>"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
-// CHECK-NEXT: "subscriptKind": "dictionary",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: "subscriptKind": "dictionary",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 2038,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 2038,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableDictionary *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 2038,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 2038,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableDictionary *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 2038,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 2038,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableDictionary *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "Dict",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "Dict",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableDictionary *"
// CHECK-NEXT: }
@@ -3949,60 +4363,66 @@
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 11,
+// CHECK-NEXT: "offset": 2043,
+// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 12,
+// CHECK-NEXT: "offset": 2044,
+// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSString *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCStringLiteral",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCStringLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 11,
+// CHECK-NEXT: "offset": 2043,
+// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 12,
+// CHECK-NEXT: "offset": 2044,
+// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSString *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "StringLiteral",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "StringLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 12,
+// CHECK-NEXT: "offset": 2044,
+// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 5
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 12,
+// CHECK-NEXT: "offset": 2044,
+// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "char [4]"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "value": "\"key\""
// CHECK-NEXT: }
// CHECK-NEXT: ]
@@ -4010,65 +4430,71 @@
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 2038,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 2038,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableDictionary *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 2038,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 2038,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableDictionary *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 2038,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 2038,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableDictionary *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "Dict",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "Dict",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableDictionary *"
// CHECK-NEXT: }
@@ -4077,145 +4503,160 @@
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 11,
+// CHECK-NEXT: "offset": 2043,
+// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 12,
+// CHECK-NEXT: "offset": 2044,
+// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSString *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCStringLiteral",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCStringLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 11,
+// CHECK-NEXT: "offset": 2043,
+// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 12,
+// CHECK-NEXT: "offset": 2044,
+// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSString *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "StringLiteral",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "StringLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 12,
+// CHECK-NEXT: "offset": 2044,
+// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 5
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 12,
+// CHECK-NEXT: "offset": 2044,
+// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "char [4]"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "value": "\"key\""
// CHECK-NEXT: }
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCMessageExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCMessageExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 2038,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 2038,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "id",
-// CHECK-NEXT: "qualType": "id"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "selector": "objectForKeyedSubscript:",
-// CHECK-NEXT: "receiverKind": "instance",
+// CHECK-NEXT: "desugaredQualType": "id",
+// CHECK-NEXT: "qualType": "id",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "selector": "objectForKeyedSubscript:",
+// CHECK-NEXT: "receiverKind": "instance",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 2038,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 2038,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableDictionary *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 2038,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 2038,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableDictionary *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 2038,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 2038,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableDictionary *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "Dict",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "Dict",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSMutableDictionary *"
// CHECK-NEXT: }
@@ -4224,80 +4665,89 @@
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 11,
+// CHECK-NEXT: "offset": 2043,
+// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 12,
+// CHECK-NEXT: "offset": 2044,
+// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "id",
-// CHECK-NEXT: "qualType": "id"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "BitCast",
+// CHECK-NEXT: "desugaredQualType": "id",
+// CHECK-NEXT: "qualType": "id",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "BitCast",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "OpaqueValueExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 11,
+// CHECK-NEXT: "offset": 2043,
+// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 12,
+// CHECK-NEXT: "offset": 2044,
+// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSString *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCStringLiteral",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCStringLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 11,
+// CHECK-NEXT: "offset": 2043,
+// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 12,
+// CHECK-NEXT: "offset": 2044,
+// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "NSString *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "StringLiteral",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "StringLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 12,
+// CHECK-NEXT: "offset": 2044,
+// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 5
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 12,
+// CHECK-NEXT: "offset": 2044,
+// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "char [4]"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "value": "\"key\""
// CHECK-NEXT: }
// CHECK-NEXT: ]
@@ -4318,155 +4768,173 @@
// CHECK-NEXT: }
-// CHECK: "kind": "FunctionDecl",
+// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 89,
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 2060,
+// CHECK-NEXT: "file": "{{.*}}",
+// CHECK-NEXT: "line": 89,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 15
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 2055,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 91,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 2105,
+// CHECK-NEXT: "line": 91,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "TestObjCIVarRef",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "TestObjCIVarRef",
+// CHECK-NEXT: "mangledName": "TestObjCIVarRef",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (I *)"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 89,
-// CHECK-NEXT: "col": 25,
+// CHECK-NEXT: "offset": 2079,
+// CHECK-NEXT: "line": 89,
+// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 22,
+// CHECK-NEXT: "offset": 2076,
+// CHECK-NEXT: "col": 22,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 25,
+// CHECK-NEXT: "offset": 2079,
+// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "isUsed": true,
-// CHECK-NEXT: "name": "Ptr",
+// CHECK-NEXT: },
+// CHECK-NEXT: "isUsed": true,
+// CHECK-NEXT: "name": "Ptr",
+// CHECK-NEXT: "mangledName": "Ptr",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "I *"
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CompoundStmt",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 30,
+// CHECK-NEXT: "offset": 2084,
+// CHECK-NEXT: "col": 30,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 91,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 2105,
+// CHECK-NEXT: "line": 91,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "BinaryOperator",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "BinaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 90,
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 2088,
+// CHECK-NEXT: "line": 90,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 17,
+// CHECK-NEXT: "offset": 2102,
+// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "opcode": "=",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "opcode": "=",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCIvarRefExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCIvarRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 2088,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "offset": 2093,
+// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "decl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCIvarDecl",
-// CHECK-NEXT: "name": "public",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCIvarDecl",
+// CHECK-NEXT: "name": "public",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "isArrow": true,
+// CHECK-NEXT: },
+// CHECK-NEXT: "isArrow": true,
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 2088,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 2088,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "I *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 2088,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 2088,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "I *"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "Ptr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "Ptr",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "I *"
// CHECK-NEXT: }
@@ -4475,24 +4943,26 @@
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "IntegerLiteral",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 17,
+// CHECK-NEXT: "offset": 2102,
+// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 17,
+// CHECK-NEXT: "offset": 2102,
+// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "value": "0"
// CHECK-NEXT: }
// CHECK-NEXT: ]
@@ -4503,85 +4973,97 @@
// CHECK-NEXT: }
-// CHECK: "kind": "FunctionDecl",
+// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 93,
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 2113,
+// CHECK-NEXT: "file": "{{.*}}",
+// CHECK-NEXT: "line": 93,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 19
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 2108,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 96,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 2164,
+// CHECK-NEXT: "line": 96,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "TestObjCBoolLiteral",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "TestObjCBoolLiteral",
+// CHECK-NEXT: "mangledName": "TestObjCBoolLiteral",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CompoundStmt",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 93,
-// CHECK-NEXT: "col": 28,
+// CHECK-NEXT: "offset": 2135,
+// CHECK-NEXT: "line": 93,
+// CHECK-NEXT: "col": 28,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 96,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 2164,
+// CHECK-NEXT: "line": 96,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCBoolLiteralExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCBoolLiteralExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 94,
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 2139,
+// CHECK-NEXT: "line": 94,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 10
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 2139,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 10
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "signed char",
-// CHECK-NEXT: "qualType": "BOOL"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "desugaredQualType": "signed char",
+// CHECK-NEXT: "qualType": "BOOL",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "value": "__objc_yes"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCBoolLiteralExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCBoolLiteralExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 95,
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 2153,
+// CHECK-NEXT: "line": 95,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 9
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 2153,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 9
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "desugaredQualType": "signed char",
-// CHECK-NEXT: "qualType": "BOOL"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "desugaredQualType": "signed char",
+// CHECK-NEXT: "qualType": "BOOL",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "value": "__objc_no"
// CHECK-NEXT: }
// CHECK-NEXT: ]
diff --git a/src/llvm-project/clang/test/AST/ast-dump-file-line-json.c b/src/llvm-project/clang/test/AST/ast-dump-file-line-json.c
new file mode 100644
index 0000000..89807cb
--- /dev/null
+++ b/src/llvm-project/clang/test/AST/ast-dump-file-line-json.c
@@ -0,0 +1,309 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -ast-dump=json %s | FileCheck %s
+
+#line 4 "test.c"
+int a;
+
+#line 32 "bar.h"
+int b;
+int c;
+
+#line 11 "test.c"
+int d;
+int e;
+// NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py
+
+
+// CHECK: "kind": "TranslationUnitDecl",
+// CHECK-NEXT: "loc": {},
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {},
+// CHECK-NEXT: "end": {}
+// CHECK-NEXT: },
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "TypedefDecl",
+// CHECK-NEXT: "loc": {},
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {},
+// CHECK-NEXT: "end": {}
+// CHECK-NEXT: },
+// CHECK-NEXT: "isImplicit": true,
+// CHECK-NEXT: "name": "__int128_t",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "__int128"
+// CHECK-NEXT: },
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "BuiltinType",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "__int128"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "TypedefDecl",
+// CHECK-NEXT: "loc": {},
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {},
+// CHECK-NEXT: "end": {}
+// CHECK-NEXT: },
+// CHECK-NEXT: "isImplicit": true,
+// CHECK-NEXT: "name": "__uint128_t",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "unsigned __int128"
+// CHECK-NEXT: },
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "BuiltinType",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "unsigned __int128"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "TypedefDecl",
+// CHECK-NEXT: "loc": {},
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {},
+// CHECK-NEXT: "end": {}
+// CHECK-NEXT: },
+// CHECK-NEXT: "isImplicit": true,
+// CHECK-NEXT: "name": "__NSConstantString",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "struct __NSConstantString_tag"
+// CHECK-NEXT: },
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "RecordType",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "struct __NSConstantString_tag"
+// CHECK-NEXT: },
+// CHECK-NEXT: "decl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "RecordDecl",
+// CHECK-NEXT: "name": "__NSConstantString_tag"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "TypedefDecl",
+// CHECK-NEXT: "loc": {},
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {},
+// CHECK-NEXT: "end": {}
+// CHECK-NEXT: },
+// CHECK-NEXT: "isImplicit": true,
+// CHECK-NEXT: "name": "__builtin_ms_va_list",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "char *"
+// CHECK-NEXT: },
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "PointerType",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "char *"
+// CHECK-NEXT: },
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "BuiltinType",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "char"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "TypedefDecl",
+// CHECK-NEXT: "loc": {},
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {},
+// CHECK-NEXT: "end": {}
+// CHECK-NEXT: },
+// CHECK-NEXT: "isImplicit": true,
+// CHECK-NEXT: "name": "__builtin_va_list",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "struct __va_list_tag [1]"
+// CHECK-NEXT: },
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ConstantArrayType",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "struct __va_list_tag [1]"
+// CHECK-NEXT: },
+// CHECK-NEXT: "size": 1,
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "RecordType",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "struct __va_list_tag"
+// CHECK-NEXT: },
+// CHECK-NEXT: "decl": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "RecordDecl",
+// CHECK-NEXT: "name": "__va_list_tag"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "VarDecl",
+// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 105,
+// CHECK-NEXT: "file": "{{.*}}",
+// CHECK-NEXT: "line": 4,
+// CHECK-NEXT: "presumedFile": "test.c",
+// CHECK-NEXT: "col": 5,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 101,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 3
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 105,
+// CHECK-NEXT: "col": 5,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "mangledName": "a",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "VarDecl",
+// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 130,
+// CHECK-NEXT: "line": 7,
+// CHECK-NEXT: "presumedFile": "bar.h",
+// CHECK-NEXT: "presumedLine": 32,
+// CHECK-NEXT: "col": 5,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 126,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 3
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 130,
+// CHECK-NEXT: "col": 5,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "b",
+// CHECK-NEXT: "mangledName": "b",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "VarDecl",
+// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 137,
+// CHECK-NEXT: "line": 8,
+// CHECK-NEXT: "presumedLine": 33,
+// CHECK-NEXT: "col": 5,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 133,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 3
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 137,
+// CHECK-NEXT: "col": 5,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "c",
+// CHECK-NEXT: "mangledName": "c",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "VarDecl",
+// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 163,
+// CHECK-NEXT: "line": 11,
+// CHECK-NEXT: "presumedFile": "test.c",
+// CHECK-NEXT: "col": 5,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 159,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 3
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 163,
+// CHECK-NEXT: "col": 5,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "d",
+// CHECK-NEXT: "mangledName": "d",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "VarDecl",
+// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 170,
+// CHECK-NEXT: "line": 12,
+// CHECK-NEXT: "col": 5,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: },
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 166,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 3
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 170,
+// CHECK-NEXT: "col": 5,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "e",
+// CHECK-NEXT: "mangledName": "e",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
diff --git a/src/llvm-project/clang/test/AST/ast-dump-funcs-json.cpp b/src/llvm-project/clang/test/AST/ast-dump-funcs-json.cpp
index b42be3b..cb67892 100644
--- a/src/llvm-project/clang/test/AST/ast-dump-funcs-json.cpp
+++ b/src/llvm-project/clang/test/AST/ast-dump-funcs-json.cpp
@@ -46,6 +46,7 @@
// CHECK: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 124,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 4,
// CHECK-NEXT: "col": 8,
@@ -53,15 +54,18 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 119,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 130,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "Test1",
+// CHECK-NEXT: "mangledName": "_ZN1S5Test1Ev",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: }
@@ -70,6 +74,7 @@
// CHECK: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 140,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 5,
// CHECK-NEXT: "col": 8,
@@ -77,15 +82,18 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 135,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 148,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "Test2",
+// CHECK-NEXT: "mangledName": "_ZNK1S5Test2Ev",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void () const"
// CHECK-NEXT: }
@@ -94,6 +102,7 @@
// CHECK: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 162,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 6,
// CHECK-NEXT: "col": 8,
@@ -101,15 +110,18 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 157,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 170,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "Test3",
+// CHECK-NEXT: "mangledName": "_ZNV1S5Test3Ev",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void () volatile"
// CHECK-NEXT: }
@@ -118,6 +130,7 @@
// CHECK: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 187,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 7,
// CHECK-NEXT: "col": 8,
@@ -125,15 +138,18 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 182,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 195,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "Test4",
+// CHECK-NEXT: "mangledName": "_ZNR1S5Test4Ev",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void () &"
// CHECK-NEXT: }
@@ -142,6 +158,7 @@
// CHECK: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 205,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 8,
// CHECK-NEXT: "col": 8,
@@ -149,15 +166,18 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 200,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 213,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "Test5",
+// CHECK-NEXT: "mangledName": "_ZNO1S5Test5Ev",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void () &&"
// CHECK-NEXT: }
@@ -166,6 +186,7 @@
// CHECK: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 232,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 9,
// CHECK-NEXT: "col": 16,
@@ -173,15 +194,18 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 219,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 7
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 253,
// CHECK-NEXT: "col": 37,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "Test6",
+// CHECK-NEXT: "mangledName": "_ZN1S5Test6Efi",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (float, int)"
// CHECK-NEXT: },
@@ -191,15 +215,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 243,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 238,
// CHECK-NEXT: "col": 22,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 238,
// CHECK-NEXT: "col": 22,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
@@ -212,15 +239,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 249,
// CHECK-NEXT: "col": 33,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 245,
// CHECK-NEXT: "col": 29,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 251,
// CHECK-NEXT: "col": 35,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -235,10 +265,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 251,
// CHECK-NEXT: "col": 35,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 251,
// CHECK-NEXT: "col": 35,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -257,6 +289,7 @@
// CHECK: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 271,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 10,
// CHECK-NEXT: "col": 16,
@@ -264,15 +297,18 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 258,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 7
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 281,
// CHECK-NEXT: "col": 26,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "Test7",
+// CHECK-NEXT: "mangledName": "_ZN1S5Test7Ev",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: },
@@ -283,6 +319,7 @@
// CHECK: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 343,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 14,
// CHECK-NEXT: "col": 8,
@@ -290,15 +327,18 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 338,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 367,
// CHECK-NEXT: "col": 32,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "Test6",
+// CHECK-NEXT: "mangledName": "_ZN1T5Test6Efi",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (float, int)"
// CHECK-NEXT: },
@@ -307,15 +347,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 354,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 349,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 349,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
@@ -328,15 +371,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 360,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 356,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 362,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -351,10 +397,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 362,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 362,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -372,10 +420,12 @@
// CHECK-NEXT: "kind": "OverrideAttr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 367,
// CHECK-NEXT: "col": 32,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 367,
// CHECK-NEXT: "col": 32,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: }
@@ -387,6 +437,7 @@
// CHECK: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 399,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 18,
// CHECK-NEXT: "col": 8,
@@ -394,15 +445,18 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 394,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 405,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "Test1",
+// CHECK-NEXT: "mangledName": "_ZN1U5Test1Ev",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: }
@@ -411,6 +465,7 @@
// CHECK: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 419,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 20,
// CHECK-NEXT: "col": 9,
@@ -418,17 +473,20 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 411,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 428,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
-// CHECK-NEXT: "parentDeclContext": "0x{{.*}}",
+// CHECK-NEXT: "parentDeclContextId": "0x{{.*}}",
// CHECK-NEXT: "previousDecl": "0x{{.*}}",
// CHECK-NEXT: "name": "Test1",
+// CHECK-NEXT: "mangledName": "_ZN1U5Test1Ev",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: },
@@ -438,10 +496,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 427,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 428,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -453,6 +513,7 @@
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 446,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 22,
// CHECK-NEXT: "col": 6,
@@ -460,16 +521,19 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 441,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 452,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "Test1",
+// CHECK-NEXT: "mangledName": "_Z5Test1v",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: }
@@ -478,6 +542,7 @@
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 460,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 23,
// CHECK-NEXT: "col": 6,
@@ -485,15 +550,18 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 455,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 470,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "Test2",
+// CHECK-NEXT: "mangledName": "_Z5Test2v",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: }
@@ -502,6 +570,7 @@
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 478,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 24,
// CHECK-NEXT: "col": 6,
@@ -509,15 +578,18 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 473,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 496,
// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "Test3",
+// CHECK-NEXT: "mangledName": "_Z5Test3ii",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (int, int)"
// CHECK-NEXT: },
@@ -526,20 +598,24 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 488,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 484,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 488,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "mangledName": "_ZZ5Test3iiE1a",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: }
@@ -548,20 +624,24 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 495,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 491,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 495,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "b",
+// CHECK-NEXT: "mangledName": "_ZZ5Test3iiE1b",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: }
@@ -572,6 +652,7 @@
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 504,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 25,
// CHECK-NEXT: "col": 6,
@@ -579,15 +660,18 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 499,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 527,
// CHECK-NEXT: "col": 29,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "Test4",
+// CHECK-NEXT: "mangledName": "_Z5Test4ii",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (int, int)"
// CHECK-NEXT: },
@@ -596,20 +680,24 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 514,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 510,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 514,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "mangledName": "_ZZ5Test4iiE1a",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: }
@@ -618,20 +706,24 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 521,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 517,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 525,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "b",
+// CHECK-NEXT: "mangledName": "_ZZ5Test4iiE1b",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
@@ -642,10 +734,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 525,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 525,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -664,6 +758,7 @@
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 545,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 26,
// CHECK-NEXT: "col": 16,
@@ -671,15 +766,18 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 530,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 9
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 555,
// CHECK-NEXT: "col": 26,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "Test5",
+// CHECK-NEXT: "mangledName": "_Z5Test5v",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: },
@@ -689,6 +787,7 @@
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 570,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 27,
// CHECK-NEXT: "col": 13,
@@ -696,15 +795,18 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 558,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 580,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "Test6",
+// CHECK-NEXT: "mangledName": "_ZL5Test6v",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: },
@@ -714,6 +816,7 @@
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 595,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 28,
// CHECK-NEXT: "col": 13,
@@ -721,15 +824,18 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 583,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 605,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "Test7",
+// CHECK-NEXT: "mangledName": "_Z5Test7v",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: },
@@ -739,6 +845,7 @@
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 620,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 29,
// CHECK-NEXT: "col": 13,
@@ -746,15 +853,18 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 608,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 630,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "Test8",
+// CHECK-NEXT: "mangledName": "_Z5Test8v",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: },
@@ -764,6 +874,7 @@
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 638,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 30,
// CHECK-NEXT: "col": 6,
@@ -771,15 +882,18 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 633,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 650,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "Test9",
+// CHECK-NEXT: "mangledName": "_Z5Test9v",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void () noexcept"
// CHECK-NEXT: }
@@ -788,6 +902,7 @@
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 665,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 31,
// CHECK-NEXT: "col": 6,
@@ -795,15 +910,18 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 660,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 692,
// CHECK-NEXT: "col": 33,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "Test10",
+// CHECK-NEXT: "mangledName": "_Z6Test10v",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void () noexcept(false)"
// CHECK-NEXT: }
@@ -812,6 +930,7 @@
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 700,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 32,
// CHECK-NEXT: "col": 6,
@@ -819,15 +938,18 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 695,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 723,
// CHECK-NEXT: "col": 29,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "Test11",
+// CHECK-NEXT: "mangledName": "_Z6Test11v",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void () noexcept(1)"
// CHECK-NEXT: }
@@ -836,6 +958,7 @@
// CHECK: "kind": "FunctionTemplateDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 751,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 35,
// CHECK-NEXT: "col": 3,
@@ -843,11 +966,13 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 727,
// CHECK-NEXT: "line": 34,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 760,
// CHECK-NEXT: "line": 35,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
@@ -859,16 +984,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TemplateTypeParmDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 746,
// CHECK-NEXT: "line": 34,
// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 737,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 746,
// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -883,16 +1011,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 751,
// CHECK-NEXT: "line": 35,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 749,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 760,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -906,15 +1037,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 760,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 758,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 759,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -931,6 +1065,7 @@
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 769,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 37,
// CHECK-NEXT: "col": 6,
@@ -938,15 +1073,18 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 764,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 782,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "Test13",
+// CHECK-NEXT: "mangledName": "_Z6Test13i",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (int)"
// CHECK-NEXT: },
@@ -955,15 +1093,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 779,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 776,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 776,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -977,10 +1118,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 781,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 782,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -992,6 +1135,7 @@
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 789,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 38,
// CHECK-NEXT: "col": 6,
@@ -999,15 +1143,18 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 784,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 807,
// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "Test14",
+// CHECK-NEXT: "mangledName": "_Z6Test14iz",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (int, ...)"
// CHECK-NEXT: },
@@ -1017,15 +1164,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 799,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 796,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 796,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -1039,10 +1189,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 806,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 807,
// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
diff --git a/src/llvm-project/clang/test/AST/ast-dump-if-json.cpp b/src/llvm-project/clang/test/AST/ast-dump-if-json.cpp
index 5cd0d60..3d1bff7 100644
--- a/src/llvm-project/clang/test/AST/ast-dump-if-json.cpp
+++ b/src/llvm-project/clang/test/AST/ast-dump-if-json.cpp
@@ -33,11 +33,13 @@
// CHECK: "kind": "IfStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 111,
// CHECK-NEXT: "line": 4,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 124,
// CHECK-NEXT: "line": 5,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
@@ -49,11 +51,13 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 115,
// CHECK-NEXT: "line": 4,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 115,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -69,10 +73,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 115,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 115,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -88,10 +94,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 115,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 115,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -118,11 +126,13 @@
// CHECK-NEXT: "kind": "NullStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 124,
// CHECK-NEXT: "line": 5,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 124,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -135,11 +145,13 @@
// CHECK: "kind": "IfStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 129,
// CHECK-NEXT: "line": 7,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 155,
// CHECK-NEXT: "line": 10,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
@@ -152,11 +164,13 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 133,
// CHECK-NEXT: "line": 7,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 133,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -172,10 +186,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 133,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 133,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -191,10 +207,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 133,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 133,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -221,11 +239,13 @@
// CHECK-NEXT: "kind": "NullStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 142,
// CHECK-NEXT: "line": 8,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 142,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -236,11 +256,13 @@
// CHECK-NEXT: "kind": "NullStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 155,
// CHECK-NEXT: "line": 10,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 155,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -253,11 +275,13 @@
// CHECK: "kind": "IfStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 160,
// CHECK-NEXT: "line": 12,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 208,
// CHECK-NEXT: "line": 17,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
@@ -270,11 +294,13 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 164,
// CHECK-NEXT: "line": 12,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 164,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -290,10 +316,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 164,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 164,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -309,10 +337,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 164,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 164,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -339,11 +369,13 @@
// CHECK-NEXT: "kind": "NullStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 173,
// CHECK-NEXT: "line": 13,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 173,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -354,11 +386,13 @@
// CHECK-NEXT: "kind": "IfStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 182,
// CHECK-NEXT: "line": 14,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 208,
// CHECK-NEXT: "line": 17,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
@@ -371,11 +405,13 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 186,
// CHECK-NEXT: "line": 14,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 186,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -391,10 +427,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 186,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 186,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -410,10 +448,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 186,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 186,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -440,11 +480,13 @@
// CHECK-NEXT: "kind": "NullStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 195,
// CHECK-NEXT: "line": 15,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 195,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -455,11 +497,13 @@
// CHECK-NEXT: "kind": "NullStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 208,
// CHECK-NEXT: "line": 17,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 208,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -474,11 +518,13 @@
// CHECK: "kind": "IfStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 213,
// CHECK-NEXT: "line": 19,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 240,
// CHECK-NEXT: "line": 20,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
@@ -491,11 +537,13 @@
// CHECK-NEXT: "kind": "ConstantExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 226,
// CHECK-NEXT: "line": 19,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 232,
// CHECK-NEXT: "col": 22,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -511,10 +559,12 @@
// CHECK-NEXT: "kind": "BinaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 226,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 232,
// CHECK-NEXT: "col": 22,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -530,10 +580,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 226,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 226,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -549,10 +601,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 232,
// CHECK-NEXT: "col": 22,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 232,
// CHECK-NEXT: "col": 22,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -572,11 +626,13 @@
// CHECK-NEXT: "kind": "NullStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 240,
// CHECK-NEXT: "line": 20,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 240,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -589,11 +645,13 @@
// CHECK: "kind": "IfStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 245,
// CHECK-NEXT: "line": 22,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 265,
// CHECK-NEXT: "line": 23,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
@@ -606,11 +664,13 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 249,
// CHECK-NEXT: "line": 22,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 257,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -620,21 +680,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 253,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 249,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 257,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "i",
+// CHECK-NEXT: "mangledName": "_ZZ4funciE1i",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
@@ -645,10 +709,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 257,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 257,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -668,10 +734,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 253,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 253,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -687,10 +755,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 253,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 253,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -706,10 +776,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 253,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 253,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -736,11 +808,13 @@
// CHECK-NEXT: "kind": "NullStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 265,
// CHECK-NEXT: "line": 23,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 265,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -753,11 +827,13 @@
// CHECK: "kind": "IfStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 270,
// CHECK-NEXT: "line": 25,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 293,
// CHECK-NEXT: "line": 26,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
@@ -770,11 +846,13 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 274,
// CHECK-NEXT: "line": 25,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 284,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -784,21 +862,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 278,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 274,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 282,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "i",
+// CHECK-NEXT: "mangledName": "_ZZ4funciE1i_0",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
@@ -809,10 +891,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 282,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 282,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -832,10 +916,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 286,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 286,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -851,10 +937,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 286,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 286,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -870,10 +958,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 286,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 286,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -900,11 +990,13 @@
// CHECK-NEXT: "kind": "NullStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 293,
// CHECK-NEXT: "line": 26,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 293,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
diff --git a/src/llvm-project/clang/test/AST/ast-dump-macro-json.c b/src/llvm-project/clang/test/AST/ast-dump-macro-json.c
index e1746ab..340140a 100644
--- a/src/llvm-project/clang/test/AST/ast-dump-macro-json.c
+++ b/src/llvm-project/clang/test/AST/ast-dump-macro-json.c
@@ -23,12 +23,14 @@
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "spellingLoc": {
+// CHECK-NEXT: "offset": 96,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 3,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 7
// CHECK-NEXT: },
// CHECK-NEXT: "expansionLoc": {
+// CHECK-NEXT: "offset": 126,
// CHECK-NEXT: "line": 6,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 3
@@ -36,15 +38,18 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 121,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 134,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "frobble",
+// CHECK-NEXT: "mangledName": "frobble",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (void)"
// CHECK-NEXT: }
@@ -54,11 +59,13 @@
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "spellingLoc": {
+// CHECK-NEXT: "offset": 96,
// CHECK-NEXT: "line": 3,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 7
// CHECK-NEXT: },
// CHECK-NEXT: "expansionLoc": {
+// CHECK-NEXT: "offset": 142,
// CHECK-NEXT: "line": 7,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 3
@@ -66,16 +73,19 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 137,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 150,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "previousDecl": "0x{{.*}}",
// CHECK-NEXT: "name": "frobble",
+// CHECK-NEXT: "mangledName": "frobble",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (void)"
// CHECK-NEXT: }
@@ -85,11 +95,13 @@
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "spellingLoc": {
+// CHECK-NEXT: "offset": 183,
// CHECK-NEXT: "line": 11,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "expansionLoc": {
+// CHECK-NEXT: "offset": 178,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 4,
// CHECK-NEXT: "isMacroArgExpansion": true
@@ -97,15 +109,18 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 173,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 193,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "quux",
+// CHECK-NEXT: "mangledName": "quux",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (void)"
// CHECK-NEXT: }
@@ -115,12 +130,14 @@
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "spellingLoc": {
+// CHECK-NEXT: "offset": 4,
// CHECK-NEXT: "file": "<scratch space>",
// CHECK-NEXT: "line": 3,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "expansionLoc": {
+// CHECK-NEXT: "offset": 259,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 16,
// CHECK-NEXT: "col": 6,
@@ -129,15 +146,18 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 254,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 286,
// CHECK-NEXT: "col": 33,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "foo0",
+// CHECK-NEXT: "mangledName": "foo0",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (void)"
// CHECK-NEXT: }
@@ -147,12 +167,14 @@
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
// CHECK-NEXT: "spellingLoc": {
+// CHECK-NEXT: "offset": 13,
// CHECK-NEXT: "file": "<scratch space>",
// CHECK-NEXT: "line": 5,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "expansionLoc": {
+// CHECK-NEXT: "offset": 294,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 17,
// CHECK-NEXT: "col": 6,
@@ -161,15 +183,18 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 289,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 321,
// CHECK-NEXT: "col": 33,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "foo1",
+// CHECK-NEXT: "mangledName": "foo1",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (void)"
// CHECK-NEXT: }
diff --git a/src/llvm-project/clang/test/AST/ast-dump-namespace-json.cpp b/src/llvm-project/clang/test/AST/ast-dump-namespace-json.cpp
index c97beeb..9680195 100644
--- a/src/llvm-project/clang/test/AST/ast-dump-namespace-json.cpp
+++ b/src/llvm-project/clang/test/AST/ast-dump-namespace-json.cpp
@@ -23,6 +23,7 @@
// CHECK: "kind": "NamespaceDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 98,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 3,
// CHECK-NEXT: "col": 11,
@@ -30,10 +31,12 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 88,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 9
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 104,
// CHECK-NEXT: "line": 4,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -45,16 +48,19 @@
// CHECK: "kind": "NamespaceDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 117,
// CHECK-NEXT: "line": 6,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 107,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 9
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 119,
// CHECK-NEXT: "line": 7,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -70,16 +76,19 @@
// CHECK: "kind": "NamespaceDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 132,
// CHECK-NEXT: "line": 9,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 122,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 9
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 163,
// CHECK-NEXT: "line": 12,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -91,16 +100,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "NamespaceDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 155,
// CHECK-NEXT: "line": 10,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 138,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 161,
// CHECK-NEXT: "line": 11,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -115,16 +127,19 @@
// CHECK: "kind": "NamespaceDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 176,
// CHECK-NEXT: "line": 14,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 166,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 9
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 188,
// CHECK-NEXT: "line": 15,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -136,16 +151,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "NamespaceDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 181,
// CHECK-NEXT: "line": 14,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 179,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 188,
// CHECK-NEXT: "line": 15,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -159,16 +177,19 @@
// CHECK: "kind": "NamespaceDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 201,
// CHECK-NEXT: "line": 17,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 191,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 9
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 224,
// CHECK-NEXT: "line": 18,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -180,16 +201,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "NamespaceDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 214,
// CHECK-NEXT: "line": 17,
// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 7
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 207,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 224,
// CHECK-NEXT: "line": 18,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
diff --git a/src/llvm-project/clang/test/AST/ast-dump-record-definition-data-json.cpp b/src/llvm-project/clang/test/AST/ast-dump-record-definition-data-json.cpp
index 4ad9386..44ec2a2 100644
--- a/src/llvm-project/clang/test/AST/ast-dump-record-definition-data-json.cpp
+++ b/src/llvm-project/clang/test/AST/ast-dump-record-definition-data-json.cpp
@@ -140,15 +140,18 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 157,
// CHECK-NEXT: "col": 29,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 157,
// CHECK-NEXT: "col": 29,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 157,
// CHECK-NEXT: "col": 29,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -198,20 +201,24 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 157,
// CHECK-NEXT: "col": 29,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 160,
// CHECK-NEXT: "col": 32,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 162,
// CHECK-NEXT: "col": 34,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "operator()",
+// CHECK-NEXT: "mangledName": "_ZZ1fvENK3$_0clEv",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void () const"
// CHECK-NEXT: },
@@ -223,10 +230,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 161,
// CHECK-NEXT: "col": 33,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 162,
// CHECK-NEXT: "col": 34,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -238,21 +247,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXConversionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 157,
// CHECK-NEXT: "col": 29,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 157,
// CHECK-NEXT: "col": 29,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 162,
// CHECK-NEXT: "col": 34,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "name": "operator void (*)()",
+// CHECK-NEXT: "mangledName": "_ZZ1fvENK3$_0cvPFvvEEv",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (*() const noexcept)()"
// CHECK-NEXT: },
@@ -263,21 +276,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 157,
// CHECK-NEXT: "col": 29,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 157,
// CHECK-NEXT: "col": 29,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 162,
// CHECK-NEXT: "col": 34,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "name": "__invoke",
+// CHECK-NEXT: "mangledName": "_ZZ1fvEN3$_08__invokeEv",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: },
@@ -288,15 +305,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXDestructorDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 157,
// CHECK-NEXT: "col": 29,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 157,
// CHECK-NEXT: "col": 29,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 157,
// CHECK-NEXT: "col": 29,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -304,6 +324,7 @@
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "isReferenced": true,
// CHECK-NEXT: "name": "~",
+// CHECK-NEXT: "mangledName": "_ZZ1fvEN3$_0D1Ev",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void () noexcept"
// CHECK-NEXT: },
@@ -316,15 +337,18 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 190,
// CHECK-NEXT: "col": 26,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 190,
// CHECK-NEXT: "col": 26,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 190,
// CHECK-NEXT: "col": 26,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -375,12 +399,14 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FunctionTemplateDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 190,
// CHECK-NEXT: "col": 26,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {},
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 199,
// CHECK-NEXT: "col": 35,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -391,20 +417,24 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TemplateTypeParmDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "col": 29,
-// CHECK-NEXT: "tokLen": 4
+// CHECK-NEXT: "offset": 197,
+// CHECK-NEXT: "col": 33,
+// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 29,
-// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 29,
-// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: }
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 193,
+// CHECK-NEXT: "col": 29,
+// CHECK-NEXT: "tokLen": 4
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 197,
+// CHECK-NEXT: "col": 33,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
+// CHECK-NEXT: "name": "auto:1",
// CHECK-NEXT: "tagUsed": "class",
// CHECK-NEXT: "depth": 0,
// CHECK-NEXT: "index": 0
@@ -413,15 +443,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 190,
// CHECK-NEXT: "col": 26,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 197,
// CHECK-NEXT: "col": 33,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 199,
// CHECK-NEXT: "col": 35,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -437,15 +470,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 197,
// CHECK-NEXT: "col": 33,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 193,
// CHECK-NEXT: "col": 29,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 193,
// CHECK-NEXT: "col": 29,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -459,10 +495,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 198,
// CHECK-NEXT: "col": 34,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 199,
// CHECK-NEXT: "col": 35,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -476,12 +514,14 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FunctionTemplateDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 190,
// CHECK-NEXT: "col": 26,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {},
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 199,
// CHECK-NEXT: "col": 35,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -493,20 +533,24 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TemplateTypeParmDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "col": 29,
-// CHECK-NEXT: "tokLen": 4
+// CHECK-NEXT: "offset": 197,
+// CHECK-NEXT: "col": 33,
+// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 29,
-// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 29,
-// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: }
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 193,
+// CHECK-NEXT: "col": 29,
+// CHECK-NEXT: "tokLen": 4
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 197,
+// CHECK-NEXT: "col": 33,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
+// CHECK-NEXT: "name": "auto:1",
// CHECK-NEXT: "tagUsed": "class",
// CHECK-NEXT: "depth": 0,
// CHECK-NEXT: "index": 0
@@ -515,15 +559,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXConversionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 190,
// CHECK-NEXT: "col": 26,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 190,
// CHECK-NEXT: "col": 26,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 199,
// CHECK-NEXT: "col": 35,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -542,12 +589,14 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FunctionTemplateDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 190,
// CHECK-NEXT: "col": 26,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {},
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 199,
// CHECK-NEXT: "col": 35,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -559,20 +608,24 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TemplateTypeParmDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "col": 29,
-// CHECK-NEXT: "tokLen": 4
+// CHECK-NEXT: "offset": 197,
+// CHECK-NEXT: "col": 33,
+// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 29,
-// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
-// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 29,
-// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: }
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 193,
+// CHECK-NEXT: "col": 29,
+// CHECK-NEXT: "tokLen": 4
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 197,
+// CHECK-NEXT: "col": 33,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
+// CHECK-NEXT: "name": "auto:1",
// CHECK-NEXT: "tagUsed": "class",
// CHECK-NEXT: "depth": 0,
// CHECK-NEXT: "index": 0
@@ -581,15 +634,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 190,
// CHECK-NEXT: "col": 26,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 190,
// CHECK-NEXT: "col": 26,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 199,
// CHECK-NEXT: "col": 35,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -606,15 +662,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 197,
// CHECK-NEXT: "col": 33,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 193,
// CHECK-NEXT: "col": 29,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 193,
// CHECK-NEXT: "col": 29,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -631,15 +690,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXDestructorDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 190,
// CHECK-NEXT: "col": 26,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 190,
// CHECK-NEXT: "col": 26,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 190,
// CHECK-NEXT: "col": 26,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -647,6 +709,7 @@
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "isReferenced": true,
// CHECK-NEXT: "name": "~",
+// CHECK-NEXT: "mangledName": "_ZZ1fvEN3$_1D1Ev",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void () noexcept"
// CHECK-NEXT: },
@@ -659,16 +722,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 212,
// CHECK-NEXT: "line": 8,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 18
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 205,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 292,
// CHECK-NEXT: "line": 10,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -715,16 +781,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 212,
// CHECK-NEXT: "line": 8,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 18
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 205,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 212,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 18
// CHECK-NEXT: }
@@ -738,21 +807,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXConstructorDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 235,
// CHECK-NEXT: "line": 9,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 18
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 235,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 18
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 289,
// CHECK-NEXT: "col": 57,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "CanPassInRegisters",
+// CHECK-NEXT: "mangledName": "_ZN18CanPassInRegistersC1ERKS_",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (const CanPassInRegisters &)"
// CHECK-NEXT: },
@@ -763,15 +836,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 279,
// CHECK-NEXT: "col": 47,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 254,
// CHECK-NEXT: "col": 22,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 278,
// CHECK-NEXT: "col": 46,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -788,16 +864,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 303,
// CHECK-NEXT: "line": 12,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 19
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 296,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 385,
// CHECK-NEXT: "line": 14,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -843,16 +922,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 303,
// CHECK-NEXT: "line": 12,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 19
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 296,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 303,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 19
// CHECK-NEXT: }
@@ -866,21 +948,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXConstructorDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 327,
// CHECK-NEXT: "line": 13,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 19
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 327,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 19
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 382,
// CHECK-NEXT: "col": 58,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "CantPassInRegisters",
+// CHECK-NEXT: "mangledName": "_ZN19CantPassInRegistersC1ERKS_",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (const CantPassInRegisters &)"
// CHECK-NEXT: },
@@ -890,15 +976,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 373,
// CHECK-NEXT: "col": 49,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 347,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 372,
// CHECK-NEXT: "col": 48,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -915,16 +1004,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 396,
// CHECK-NEXT: "line": 16,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 7
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 389,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 406,
// CHECK-NEXT: "line": 17,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -988,16 +1080,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 396,
// CHECK-NEXT: "line": 16,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 7
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 389,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 396,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 7
// CHECK-NEXT: }
@@ -1012,16 +1107,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 417,
// CHECK-NEXT: "line": 19,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 10
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 410,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 439,
// CHECK-NEXT: "line": 21,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -1080,16 +1178,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 417,
// CHECK-NEXT: "line": 19,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 10
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 410,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 417,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 10
// CHECK-NEXT: }
@@ -1102,16 +1203,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 436,
// CHECK-NEXT: "line": 20,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 432,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 436,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1127,16 +1231,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 450,
// CHECK-NEXT: "line": 23,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 11
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 443,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 473,
// CHECK-NEXT: "line": 25,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -1195,16 +1302,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 450,
// CHECK-NEXT: "line": 23,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 11
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 443,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 450,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 11
// CHECK-NEXT: }
@@ -1217,16 +1327,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 470,
// CHECK-NEXT: "line": 24,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 466,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 470,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1242,16 +1355,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 484,
// CHECK-NEXT: "line": 27,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 14
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 477,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 519,
// CHECK-NEXT: "line": 30,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -1308,16 +1424,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 484,
// CHECK-NEXT: "line": 27,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 14
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 477,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 484,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 14
// CHECK-NEXT: }
@@ -1330,16 +1449,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "AccessSpecDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 501,
// CHECK-NEXT: "line": 28,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 7
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 501,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 7
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 508,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1350,16 +1472,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 516,
// CHECK-NEXT: "line": 29,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 512,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 516,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1375,16 +1500,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 530,
// CHECK-NEXT: "line": 32,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 16
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 523,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 561,
// CHECK-NEXT: "line": 34,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -1448,16 +1576,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 530,
// CHECK-NEXT: "line": 32,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 16
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 523,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 530,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 16
// CHECK-NEXT: }
@@ -1470,21 +1601,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 556,
// CHECK-NEXT: "line": 33,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 551,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 558,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "f",
+// CHECK-NEXT: "mangledName": "_ZN16IsStandardLayout1fEv",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: }
@@ -1495,16 +1630,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 572,
// CHECK-NEXT: "line": 36,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 19
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 565,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 614,
// CHECK-NEXT: "line": 38,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -1559,16 +1697,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 572,
// CHECK-NEXT: "line": 36,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 19
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 565,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 572,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 19
// CHECK-NEXT: }
@@ -1581,21 +1722,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 609,
// CHECK-NEXT: "line": 37,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 596,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 7
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 611,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "f",
+// CHECK-NEXT: "mangledName": "_ZN19IsNotStandardLayout1fEv",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: },
@@ -1605,22 +1750,26 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 572,
// CHECK-NEXT: "line": 36,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 19
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 572,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 19
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 572,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 19
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "name": "operator=",
+// CHECK-NEXT: "mangledName": "_ZN19IsNotStandardLayoutaSERKS_",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "IsNotStandardLayout &(const IsNotStandardLayout &)"
// CHECK-NEXT: },
@@ -1632,15 +1781,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 572,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 19
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 572,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 19
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 572,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 19
// CHECK-NEXT: }
@@ -1655,21 +1807,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 572,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 19
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 572,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 19
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 572,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 19
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "name": "operator=",
+// CHECK-NEXT: "mangledName": "_ZN19IsNotStandardLayoutaSEOS_",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "IsNotStandardLayout &(IsNotStandardLayout &&)"
// CHECK-NEXT: },
@@ -1681,15 +1837,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 572,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 19
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 572,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 19
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 572,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 19
// CHECK-NEXT: }
@@ -1704,21 +1863,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXDestructorDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 572,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 19
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 572,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 19
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 572,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 19
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "name": "~IsNotStandardLayout",
+// CHECK-NEXT: "mangledName": "_ZN19IsNotStandardLayoutD1Ev",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: },
@@ -1731,16 +1894,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 625,
// CHECK-NEXT: "line": 40,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 19
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 618,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 647,
// CHECK-NEXT: "line": 41,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -1804,16 +1970,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 625,
// CHECK-NEXT: "line": 40,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 19
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 618,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 625,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 19
// CHECK-NEXT: }
@@ -1828,16 +1997,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 658,
// CHECK-NEXT: "line": 43,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 22
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 651,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 742,
// CHECK-NEXT: "line": 45,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -1880,16 +2052,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 658,
// CHECK-NEXT: "line": 43,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 22
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 651,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 658,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 22
// CHECK-NEXT: }
@@ -1903,21 +2078,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXConstructorDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 685,
// CHECK-NEXT: "line": 44,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 22
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 685,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 22
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 740,
// CHECK-NEXT: "col": 58,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "IsNotTriviallyCopyable",
+// CHECK-NEXT: "mangledName": "_ZN22IsNotTriviallyCopyableC1ERKS_",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (const IsNotTriviallyCopyable &)"
// CHECK-NEXT: },
@@ -1926,15 +2105,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 737,
// CHECK-NEXT: "col": 55,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 708,
// CHECK-NEXT: "col": 26,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 736,
// CHECK-NEXT: "col": 54,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1948,10 +2130,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 739,
// CHECK-NEXT: "col": 57,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 740,
// CHECK-NEXT: "col": 58,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1965,16 +2149,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 753,
// CHECK-NEXT: "line": 47,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 746,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 770,
// CHECK-NEXT: "line": 49,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -2033,16 +2220,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 753,
// CHECK-NEXT: "line": 47,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 746,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 753,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
@@ -2055,16 +2245,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 767,
// CHECK-NEXT: "line": 48,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 763,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 767,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2080,16 +2273,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 781,
// CHECK-NEXT: "line": 51,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 774,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 802,
// CHECK-NEXT: "line": 53,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -2145,16 +2341,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 781,
// CHECK-NEXT: "line": 51,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 774,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 781,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: }
@@ -2167,16 +2366,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 799,
// CHECK-NEXT: "line": 52,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 794,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 799,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2192,16 +2394,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 813,
// CHECK-NEXT: "line": 55,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 9
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 806,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 850,
// CHECK-NEXT: "line": 57,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -2264,16 +2469,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 813,
// CHECK-NEXT: "line": 55,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 9
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 806,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 813,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 9
// CHECK-NEXT: }
@@ -2287,21 +2495,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXConstructorDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 827,
// CHECK-NEXT: "line": 56,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 9
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 827,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 9
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 847,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "IsTrivial",
+// CHECK-NEXT: "mangledName": "_ZN9IsTrivialC1Ev",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: },
@@ -2314,16 +2526,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 861,
// CHECK-NEXT: "line": 59,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 12
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 854,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 896,
// CHECK-NEXT: "line": 61,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -2382,16 +2597,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 861,
// CHECK-NEXT: "line": 59,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 12
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 854,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 861,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 12
// CHECK-NEXT: }
@@ -2405,21 +2623,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXConstructorDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 878,
// CHECK-NEXT: "line": 60,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 12
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 878,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 12
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 894,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "IsNotTrivial",
+// CHECK-NEXT: "mangledName": "_ZN12IsNotTrivialC1Ev",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: },
@@ -2429,10 +2651,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 893,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 894,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2446,16 +2670,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 907,
// CHECK-NEXT: "line": 63,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 900,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 943,
// CHECK-NEXT: "line": 65,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -2510,16 +2737,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 907,
// CHECK-NEXT: "line": 63,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 900,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 907,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: }
@@ -2532,21 +2762,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 938,
// CHECK-NEXT: "line": 64,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 925,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 7
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 940,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "f",
+// CHECK-NEXT: "mangledName": "_ZN13IsPolymorphic1fEv",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: },
@@ -2556,22 +2790,26 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 907,
// CHECK-NEXT: "line": 63,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 907,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 907,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "name": "operator=",
+// CHECK-NEXT: "mangledName": "_ZN13IsPolymorphicaSERKS_",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "IsPolymorphic &(const IsPolymorphic &)"
// CHECK-NEXT: },
@@ -2583,15 +2821,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 907,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 907,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 907,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: }
@@ -2606,21 +2847,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 907,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 907,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 907,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "name": "operator=",
+// CHECK-NEXT: "mangledName": "_ZN13IsPolymorphicaSEOS_",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "IsPolymorphic &(IsPolymorphic &&)"
// CHECK-NEXT: },
@@ -2632,15 +2877,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 907,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 907,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 907,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: }
@@ -2655,21 +2903,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXDestructorDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 907,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 907,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 907,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "name": "~IsPolymorphic",
+// CHECK-NEXT: "mangledName": "_ZN13IsPolymorphicD1Ev",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: },
@@ -2682,16 +2934,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 954,
// CHECK-NEXT: "line": 67,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 16
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 947,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 985,
// CHECK-NEXT: "line": 69,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -2755,16 +3010,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 954,
// CHECK-NEXT: "line": 67,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 16
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 947,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 954,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 16
// CHECK-NEXT: }
@@ -2777,21 +3035,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 980,
// CHECK-NEXT: "line": 68,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 975,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 982,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "f",
+// CHECK-NEXT: "mangledName": "_ZN16IsNotPolymorphic1fEv",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: }
@@ -2802,16 +3064,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 996,
// CHECK-NEXT: "line": 71,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 10
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 989,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1033,
// CHECK-NEXT: "line": 73,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -2867,16 +3132,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 996,
// CHECK-NEXT: "line": 71,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 10
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 989,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 996,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 10
// CHECK-NEXT: }
@@ -2889,21 +3157,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1024,
// CHECK-NEXT: "line": 72,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1011,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 7
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1030,
// CHECK-NEXT: "col": 22,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "f",
+// CHECK-NEXT: "mangledName": "_ZN10IsAbstract1fEv",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: },
@@ -2914,22 +3186,26 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 996,
// CHECK-NEXT: "line": 71,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 10
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 996,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 10
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 996,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 10
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "name": "operator=",
+// CHECK-NEXT: "mangledName": "_ZN10IsAbstractaSERKS_",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "IsAbstract &(const IsAbstract &)"
// CHECK-NEXT: },
@@ -2941,15 +3217,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 996,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 10
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 996,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 10
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 996,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 10
// CHECK-NEXT: }
@@ -2964,21 +3243,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 996,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 10
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 996,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 10
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 996,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 10
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "name": "operator=",
+// CHECK-NEXT: "mangledName": "_ZN10IsAbstractaSEOS_",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "IsAbstract &(IsAbstract &&)"
// CHECK-NEXT: },
@@ -2990,15 +3273,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 996,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 10
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 996,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 10
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 996,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 10
// CHECK-NEXT: }
@@ -3013,21 +3299,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXDestructorDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 996,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 10
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 996,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 10
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 996,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 10
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "name": "~IsAbstract",
+// CHECK-NEXT: "mangledName": "_ZN10IsAbstractD1Ev",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: },
@@ -3040,16 +3330,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1044,
// CHECK-NEXT: "line": 75,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1037,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1080,
// CHECK-NEXT: "line": 77,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -3104,16 +3397,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1044,
// CHECK-NEXT: "line": 75,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1037,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1044,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: }
@@ -3126,21 +3422,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1075,
// CHECK-NEXT: "line": 76,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1062,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 7
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1077,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "f",
+// CHECK-NEXT: "mangledName": "_ZN13IsNotAbstract1fEv",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: },
@@ -3150,22 +3450,26 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1044,
// CHECK-NEXT: "line": 75,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1044,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1044,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "name": "operator=",
+// CHECK-NEXT: "mangledName": "_ZN13IsNotAbstractaSERKS_",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "IsNotAbstract &(const IsNotAbstract &)"
// CHECK-NEXT: },
@@ -3177,15 +3481,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1044,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1044,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1044,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: }
@@ -3200,21 +3507,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1044,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1044,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1044,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "name": "operator=",
+// CHECK-NEXT: "mangledName": "_ZN13IsNotAbstractaSEOS_",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "IsNotAbstract &(IsNotAbstract &&)"
// CHECK-NEXT: },
@@ -3226,15 +3537,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1044,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1044,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1044,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: }
@@ -3249,21 +3563,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXDestructorDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1044,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1044,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1044,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "name": "~IsNotAbstract",
+// CHECK-NEXT: "mangledName": "_ZN13IsNotAbstractD1Ev",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: },
@@ -3276,16 +3594,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1091,
// CHECK-NEXT: "line": 79,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 9
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1084,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1129,
// CHECK-NEXT: "line": 81,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -3337,16 +3658,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1091,
// CHECK-NEXT: "line": 79,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 9
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1084,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1091,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 9
// CHECK-NEXT: }
@@ -3360,21 +3684,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXDestructorDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1105,
// CHECK-NEXT: "line": 80,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1105,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1126,
// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "~IsLiteral",
+// CHECK-NEXT: "mangledName": "_ZN9IsLiteralD1Ev",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: },
@@ -3386,16 +3714,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1140,
// CHECK-NEXT: "line": 83,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 12
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1133,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1176,
// CHECK-NEXT: "line": 85,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -3442,16 +3773,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1140,
// CHECK-NEXT: "line": 83,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 12
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1133,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1140,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 12
// CHECK-NEXT: }
@@ -3465,21 +3799,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXDestructorDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1157,
// CHECK-NEXT: "line": 84,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1157,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1174,
// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "~IsNotLiteral",
+// CHECK-NEXT: "mangledName": "_ZN12IsNotLiteralD1Ev",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void () noexcept"
// CHECK-NEXT: },
@@ -3489,10 +3827,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1173,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1174,
// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3506,16 +3846,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1187,
// CHECK-NEXT: "line": 87,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 26
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1180,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1250,
// CHECK-NEXT: "line": 89,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -3574,16 +3917,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1187,
// CHECK-NEXT: "line": 87,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 26
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1180,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1187,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 26
// CHECK-NEXT: }
@@ -3597,21 +3943,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXConstructorDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1218,
// CHECK-NEXT: "line": 88,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 26
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1218,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 26
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1248,
// CHECK-NEXT: "col": 33,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "HasUserDeclaredConstructor",
+// CHECK-NEXT: "mangledName": "_ZN26HasUserDeclaredConstructorC1Ev",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: },
@@ -3621,10 +3971,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1247,
// CHECK-NEXT: "col": 32,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1248,
// CHECK-NEXT: "col": 33,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3638,16 +3990,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1261,
// CHECK-NEXT: "line": 91,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 28
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1254,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1292,
// CHECK-NEXT: "line": 92,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -3711,16 +4066,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1261,
// CHECK-NEXT: "line": 91,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 28
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1254,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1261,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 28
// CHECK-NEXT: }
@@ -3735,16 +4093,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1303,
// CHECK-NEXT: "line": 94,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 34
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1296,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1392,
// CHECK-NEXT: "line": 96,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -3806,16 +4167,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1303,
// CHECK-NEXT: "line": 94,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 34
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1296,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1303,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 34
// CHECK-NEXT: }
@@ -3829,21 +4193,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXConstructorDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1352,
// CHECK-NEXT: "line": 95,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 34
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1342,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 9
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1390,
// CHECK-NEXT: "col": 51,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "HasConstexprNonCopyMoveConstructor",
+// CHECK-NEXT: "mangledName": "_ZN34HasConstexprNonCopyMoveConstructorC1Ev",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: },
@@ -3854,10 +4222,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1389,
// CHECK-NEXT: "col": 50,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1390,
// CHECK-NEXT: "col": 51,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3871,16 +4241,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1403,
// CHECK-NEXT: "line": 98,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 36
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1396,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1486,
// CHECK-NEXT: "line": 100,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -3939,16 +4312,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1403,
// CHECK-NEXT: "line": 98,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 36
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1396,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1403,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 36
// CHECK-NEXT: }
@@ -3962,21 +4338,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXConstructorDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1444,
// CHECK-NEXT: "line": 99,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 36
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1444,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 36
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1484,
// CHECK-NEXT: "col": 43,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "HasNoConstexprNonCopyMoveConstructor",
+// CHECK-NEXT: "mangledName": "_ZN36HasNoConstexprNonCopyMoveConstructorC1Ev",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: },
@@ -3986,10 +4366,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1483,
// CHECK-NEXT: "col": 42,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1484,
// CHECK-NEXT: "col": 43,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4003,16 +4385,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1497,
// CHECK-NEXT: "line": 102,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 16
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1490,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1533,
// CHECK-NEXT: "line": 104,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -4073,16 +4458,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1497,
// CHECK-NEXT: "line": 102,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 16
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1490,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1497,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 16
// CHECK-NEXT: }
@@ -4095,16 +4483,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1530,
// CHECK-NEXT: "line": 103,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1518,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 7
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1530,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4119,22 +4510,26 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXConstructorDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1497,
// CHECK-NEXT: "line": 102,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 16
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1497,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 16
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1497,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 16
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "name": "HasMutableFields",
+// CHECK-NEXT: "mangledName": "_ZN16HasMutableFieldsC1ERKS_",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (const HasMutableFields &)"
// CHECK-NEXT: },
@@ -4146,15 +4541,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1497,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 16
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1497,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 16
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1497,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 16
// CHECK-NEXT: }
@@ -4169,21 +4567,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1497,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 16
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1497,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 16
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1497,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 16
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "name": "operator=",
+// CHECK-NEXT: "mangledName": "_ZN16HasMutableFieldsaSERKS_",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "HasMutableFields &(const HasMutableFields &)"
// CHECK-NEXT: },
@@ -4195,15 +4597,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1497,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 16
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1497,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 16
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1497,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 16
// CHECK-NEXT: }
@@ -4220,16 +4625,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1544,
// CHECK-NEXT: "line": 106,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 18
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1537,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1574,
// CHECK-NEXT: "line": 108,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -4288,16 +4696,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1544,
// CHECK-NEXT: "line": 106,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 18
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1537,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1544,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 18
// CHECK-NEXT: }
@@ -4310,16 +4721,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1571,
// CHECK-NEXT: "line": 107,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1567,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1571,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4335,16 +4749,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1585,
// CHECK-NEXT: "line": 110,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 17
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1578,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1631,
// CHECK-NEXT: "line": 114,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -4404,16 +4821,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1585,
// CHECK-NEXT: "line": 110,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 17
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1578,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1585,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 17
// CHECK-NEXT: }
@@ -4426,16 +4846,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1607,
// CHECK-NEXT: "line": 111,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1607,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1628,
// CHECK-NEXT: "line": 113,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
@@ -4494,16 +4917,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1623,
// CHECK-NEXT: "line": 112,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1619,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1623,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4519,16 +4945,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1607,
// CHECK-NEXT: "line": 111,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1607,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1607,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
@@ -4542,16 +4971,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "IndirectFieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1623,
// CHECK-NEXT: "line": 112,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1623,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1623,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4565,16 +4997,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1642,
// CHECK-NEXT: "line": 116,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 19
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1635,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1664,
// CHECK-NEXT: "line": 117,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -4638,16 +5073,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1642,
// CHECK-NEXT: "line": 116,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 19
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1635,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1642,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 19
// CHECK-NEXT: }
@@ -4662,16 +5100,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1675,
// CHECK-NEXT: "line": 119,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 22
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1668,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1714,
// CHECK-NEXT: "line": 121,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -4732,16 +5173,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1675,
// CHECK-NEXT: "line": 119,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 22
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1668,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1675,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 22
// CHECK-NEXT: }
@@ -4754,16 +5198,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1706,
// CHECK-NEXT: "line": 120,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1702,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1710,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -4779,10 +5226,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1710,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1710,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -4801,16 +5250,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1725,
// CHECK-NEXT: "line": 123,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 28
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1718,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1765,
// CHECK-NEXT: "line": 125,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -4869,16 +5321,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1725,
// CHECK-NEXT: "line": 123,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 28
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1718,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1725,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 28
// CHECK-NEXT: }
@@ -4891,16 +5346,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1762,
// CHECK-NEXT: "line": 124,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1758,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1762,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
diff --git a/src/llvm-project/clang/test/AST/ast-dump-records-json.cpp b/src/llvm-project/clang/test/AST/ast-dump-records-json.cpp
index 7a4912b..b8395d8 100644
--- a/src/llvm-project/clang/test/AST/ast-dump-records-json.cpp
+++ b/src/llvm-project/clang/test/AST/ast-dump-records-json.cpp
@@ -100,6 +100,7 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 102,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 3,
// CHECK-NEXT: "col": 8,
@@ -107,10 +108,12 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 95,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 102,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -122,16 +125,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 112,
// CHECK-NEXT: "line": 4,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 105,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 112,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -144,16 +150,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 123,
// CHECK-NEXT: "line": 6,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 116,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 195,
// CHECK-NEXT: "line": 13,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -213,16 +222,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 123,
// CHECK-NEXT: "line": 6,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 116,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 123,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -235,16 +247,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 133,
// CHECK-NEXT: "line": 7,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 129,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 133,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -258,16 +273,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 142,
// CHECK-NEXT: "line": 8,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 138,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 142,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -281,15 +299,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 145,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 138,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 145,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -303,16 +324,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 154,
// CHECK-NEXT: "line": 9,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 150,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 158,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -328,10 +352,12 @@
// CHECK-NEXT: "kind": "ConstantExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 158,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 158,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -347,10 +373,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 158,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 158,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -369,16 +397,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 168,
// CHECK-NEXT: "line": 10,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 164,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 170,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -393,10 +424,12 @@
// CHECK-NEXT: "kind": "ConstantExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 170,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 170,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -412,10 +445,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 170,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 170,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -434,16 +469,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 179,
// CHECK-NEXT: "line": 11,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 175,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 183,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -459,10 +497,12 @@
// CHECK-NEXT: "kind": "ConstantExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 183,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 183,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -478,10 +518,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 183,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 183,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -500,16 +542,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 192,
// CHECK-NEXT: "line": 12,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 189,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 192,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -525,16 +570,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 206,
// CHECK-NEXT: "line": 15,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 199,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 310,
// CHECK-NEXT: "line": 28,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -594,16 +642,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 206,
// CHECK-NEXT: "line": 15,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 199,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 206,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -616,16 +667,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 212,
// CHECK-NEXT: "line": 16,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 212,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 234,
// CHECK-NEXT: "line": 18,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
@@ -683,16 +737,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 229,
// CHECK-NEXT: "line": 17,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 225,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 229,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -708,17 +765,20 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 236,
// CHECK-NEXT: "line": 18,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 212,
// CHECK-NEXT: "line": 16,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 236,
// CHECK-NEXT: "line": 18,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
@@ -734,16 +794,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 242,
// CHECK-NEXT: "line": 20,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 242,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 276,
// CHECK-NEXT: "line": 23,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
@@ -802,16 +865,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 258,
// CHECK-NEXT: "line": 21,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 254,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 258,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -825,16 +891,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 271,
// CHECK-NEXT: "line": 22,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 265,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 271,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -850,16 +919,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 242,
// CHECK-NEXT: "line": 20,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 242,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 242,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
@@ -873,16 +945,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "IndirectFieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 258,
// CHECK-NEXT: "line": 21,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 258,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 258,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -894,16 +969,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "IndirectFieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 271,
// CHECK-NEXT: "line": 22,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 271,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 271,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -915,16 +993,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 282,
// CHECK-NEXT: "line": 25,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 282,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 307,
// CHECK-NEXT: "line": 27,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
@@ -982,16 +1063,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 299,
// CHECK-NEXT: "line": 26,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 295,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 299,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1005,15 +1089,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 302,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 295,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 302,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1029,16 +1116,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 282,
// CHECK-NEXT: "line": 25,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 282,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 282,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: }
@@ -1052,16 +1142,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "IndirectFieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 299,
// CHECK-NEXT: "line": 26,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 299,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 299,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1073,15 +1166,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "IndirectFieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 302,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 302,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 302,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1095,16 +1191,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 321,
// CHECK-NEXT: "line": 30,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 314,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 358,
// CHECK-NEXT: "line": 34,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -1163,16 +1262,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 321,
// CHECK-NEXT: "line": 30,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 314,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 321,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1185,16 +1287,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 331,
// CHECK-NEXT: "line": 31,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 327,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 331,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1208,16 +1313,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 340,
// CHECK-NEXT: "line": 32,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 336,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 344,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1231,16 +1339,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 353,
// CHECK-NEXT: "line": 33,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 349,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 355,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1256,16 +1367,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 368,
// CHECK-NEXT: "line": 36,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 362,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 368,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1277,16 +1391,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 378,
// CHECK-NEXT: "line": 38,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 372,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 378,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1298,16 +1415,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 388,
// CHECK-NEXT: "line": 40,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 382,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 460,
// CHECK-NEXT: "line": 47,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -1368,16 +1488,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 388,
// CHECK-NEXT: "line": 40,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 382,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 388,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1390,16 +1513,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 398,
// CHECK-NEXT: "line": 41,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 394,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 398,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1413,16 +1539,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 407,
// CHECK-NEXT: "line": 42,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 403,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 407,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1436,15 +1565,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 410,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 403,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 410,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1458,16 +1590,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 419,
// CHECK-NEXT: "line": 43,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 415,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 423,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -1483,10 +1618,12 @@
// CHECK-NEXT: "kind": "ConstantExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 423,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 423,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -1502,10 +1639,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 423,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 423,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -1524,16 +1663,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 433,
// CHECK-NEXT: "line": 44,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 429,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 435,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1548,10 +1690,12 @@
// CHECK-NEXT: "kind": "ConstantExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 435,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 435,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1567,10 +1711,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 435,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 435,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1589,16 +1735,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 444,
// CHECK-NEXT: "line": 45,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 440,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 448,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -1614,10 +1763,12 @@
// CHECK-NEXT: "kind": "ConstantExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 448,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 448,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -1633,10 +1784,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 448,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 448,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -1655,16 +1808,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 457,
// CHECK-NEXT: "line": 46,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 454,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 457,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1680,16 +1836,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 470,
// CHECK-NEXT: "line": 49,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 464,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 574,
// CHECK-NEXT: "line": 62,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -1749,16 +1908,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 470,
// CHECK-NEXT: "line": 49,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 464,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 470,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1771,16 +1933,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 476,
// CHECK-NEXT: "line": 50,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 476,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 498,
// CHECK-NEXT: "line": 52,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
@@ -1838,16 +2003,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 493,
// CHECK-NEXT: "line": 51,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 489,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 493,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1863,17 +2031,20 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 500,
// CHECK-NEXT: "line": 52,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 476,
// CHECK-NEXT: "line": 50,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 500,
// CHECK-NEXT: "line": 52,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
@@ -1889,16 +2060,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 506,
// CHECK-NEXT: "line": 54,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 506,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 540,
// CHECK-NEXT: "line": 57,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
@@ -1957,16 +2131,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 522,
// CHECK-NEXT: "line": 55,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 518,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 522,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1980,16 +2157,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 535,
// CHECK-NEXT: "line": 56,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 529,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 535,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2005,16 +2185,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 506,
// CHECK-NEXT: "line": 54,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 506,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 506,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
@@ -2028,16 +2211,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "IndirectFieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 522,
// CHECK-NEXT: "line": 55,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 522,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 522,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2049,16 +2235,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "IndirectFieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 535,
// CHECK-NEXT: "line": 56,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 535,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 535,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2070,16 +2259,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 546,
// CHECK-NEXT: "line": 59,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 546,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 571,
// CHECK-NEXT: "line": 61,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
@@ -2137,16 +2329,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 563,
// CHECK-NEXT: "line": 60,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 559,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 563,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2160,15 +2355,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 566,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 559,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 566,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2184,16 +2382,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 546,
// CHECK-NEXT: "line": 59,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 546,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 546,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: }
@@ -2207,16 +2408,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "IndirectFieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 563,
// CHECK-NEXT: "line": 60,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 563,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 563,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2228,15 +2432,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "IndirectFieldDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 566,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 566,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 566,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2250,16 +2457,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 585,
// CHECK-NEXT: "line": 64,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 578,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 592,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2320,15 +2530,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 585,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 578,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 585,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
@@ -2341,21 +2554,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 585,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 585,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 585,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "name": "operator=",
+// CHECK-NEXT: "mangledName": "_ZN5Base1aSERKS_",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "Base1 &(const Base1 &)"
// CHECK-NEXT: },
@@ -2367,15 +2584,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 585,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 585,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 585,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
@@ -2390,21 +2610,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 585,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 585,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 585,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "name": "operator=",
+// CHECK-NEXT: "mangledName": "_ZN5Base1aSEOS_",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "Base1 &(Base1 &&)"
// CHECK-NEXT: },
@@ -2416,15 +2640,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 585,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 585,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 585,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
@@ -2439,21 +2666,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXDestructorDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 585,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 585,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 585,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "name": "~Base1",
+// CHECK-NEXT: "mangledName": "_ZN5Base1D1Ev",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: },
@@ -2466,16 +2697,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 602,
// CHECK-NEXT: "line": 65,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 595,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 609,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2536,15 +2770,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 602,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 595,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 602,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
@@ -2557,21 +2794,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 602,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 602,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 602,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "name": "operator=",
+// CHECK-NEXT: "mangledName": "_ZN5Base2aSERKS_",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "Base2 &(const Base2 &)"
// CHECK-NEXT: },
@@ -2583,15 +2824,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 602,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 602,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 602,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
@@ -2606,21 +2850,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 602,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 602,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 602,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "name": "operator=",
+// CHECK-NEXT: "mangledName": "_ZN5Base2aSEOS_",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "Base2 &(Base2 &&)"
// CHECK-NEXT: },
@@ -2632,15 +2880,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 602,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 602,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 602,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
@@ -2655,21 +2906,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXDestructorDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 602,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 602,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 602,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "name": "~Base2",
+// CHECK-NEXT: "mangledName": "_ZN5Base2D1Ev",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: },
@@ -2682,16 +2937,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 619,
// CHECK-NEXT: "line": 66,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 612,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 626,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2752,15 +3010,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 619,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 612,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 619,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
@@ -2773,21 +3034,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 619,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 619,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 619,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "name": "operator=",
+// CHECK-NEXT: "mangledName": "_ZN5Base3aSERKS_",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "Base3 &(const Base3 &)"
// CHECK-NEXT: },
@@ -2799,15 +3064,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 619,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 619,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 619,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
@@ -2822,21 +3090,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 619,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 619,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 619,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "name": "operator=",
+// CHECK-NEXT: "mangledName": "_ZN5Base3aSEOS_",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "Base3 &(Base3 &&)"
// CHECK-NEXT: },
@@ -2848,15 +3120,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 619,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 619,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 619,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
@@ -2871,21 +3146,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXDestructorDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 619,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 619,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 619,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "name": "~Base3",
+// CHECK-NEXT: "mangledName": "_ZN5Base3D1Ev",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: },
@@ -2898,16 +3177,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 637,
// CHECK-NEXT: "line": 68,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 630,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 656,
// CHECK-NEXT: "line": 69,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -2979,16 +3261,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 637,
// CHECK-NEXT: "line": 68,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 630,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 637,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: }
@@ -3003,16 +3288,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 667,
// CHECK-NEXT: "line": 71,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 660,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 694,
// CHECK-NEXT: "line": 72,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -3083,16 +3371,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 667,
// CHECK-NEXT: "line": 71,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 660,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 667,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: }
@@ -3107,16 +3398,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 705,
// CHECK-NEXT: "line": 74,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 698,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 732,
// CHECK-NEXT: "line": 75,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -3176,16 +3470,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 705,
// CHECK-NEXT: "line": 74,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 698,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 705,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: }
@@ -3198,21 +3495,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 705,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 705,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 705,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "name": "operator=",
+// CHECK-NEXT: "mangledName": "_ZN8Derived3aSERKS_",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "Derived3 &(const Derived3 &)"
// CHECK-NEXT: },
@@ -3223,15 +3524,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 705,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 705,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 705,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: }
@@ -3246,21 +3550,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 705,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 705,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 705,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "name": "operator=",
+// CHECK-NEXT: "mangledName": "_ZN8Derived3aSEOS_",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "Derived3 &(Derived3 &&)"
// CHECK-NEXT: },
@@ -3271,15 +3579,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 705,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 705,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 705,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: }
@@ -3294,21 +3605,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXDestructorDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 705,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 705,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 705,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "name": "~Derived3",
+// CHECK-NEXT: "mangledName": "_ZN8Derived3D1Ev",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: },
@@ -3321,16 +3636,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 743,
// CHECK-NEXT: "line": 77,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 736,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 794,
// CHECK-NEXT: "line": 78,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -3404,16 +3722,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 743,
// CHECK-NEXT: "line": 77,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 736,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 743,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: }
@@ -3426,21 +3747,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 743,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 743,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 743,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "name": "operator=",
+// CHECK-NEXT: "mangledName": "_ZN8Derived4aSERKS_",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "Derived4 &(const Derived4 &)"
// CHECK-NEXT: },
@@ -3451,15 +3776,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 743,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 743,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 743,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: }
@@ -3474,21 +3802,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 743,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 743,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 743,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "name": "operator=",
+// CHECK-NEXT: "mangledName": "_ZN8Derived4aSEOS_",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "Derived4 &(Derived4 &&)"
// CHECK-NEXT: },
@@ -3499,15 +3831,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 743,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 743,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 743,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: }
@@ -3522,21 +3857,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXDestructorDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 743,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 743,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 743,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "name": "~Derived4",
+// CHECK-NEXT: "mangledName": "_ZN8Derived4D1Ev",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: },
@@ -3549,16 +3888,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 805,
// CHECK-NEXT: "line": 80,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 798,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 842,
// CHECK-NEXT: "line": 81,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -3618,16 +3960,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 805,
// CHECK-NEXT: "line": 80,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 798,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 805,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: }
@@ -3640,21 +3985,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 805,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 805,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 805,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "name": "operator=",
+// CHECK-NEXT: "mangledName": "_ZN8Derived5aSERKS_",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "Derived5 &(const Derived5 &)"
// CHECK-NEXT: },
@@ -3665,15 +4014,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 805,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 805,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 805,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: }
@@ -3688,21 +4040,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 805,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 805,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 805,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "name": "operator=",
+// CHECK-NEXT: "mangledName": "_ZN8Derived5aSEOS_",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "Derived5 &(Derived5 &&)"
// CHECK-NEXT: },
@@ -3713,15 +4069,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 805,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 805,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 805,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: }
@@ -3736,21 +4095,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXDestructorDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 805,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 805,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 805,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "name": "~Derived5",
+// CHECK-NEXT: "mangledName": "_ZN8Derived5D1Ev",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: },
@@ -3763,16 +4126,19 @@
// CHECK: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 882,
// CHECK-NEXT: "line": 84,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 875,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 919,
// CHECK-NEXT: "line": 85,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -3845,16 +4211,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 882,
// CHECK-NEXT: "line": 84,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 875,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 882,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: }
diff --git a/src/llvm-project/clang/test/AST/ast-dump-records.cpp b/src/llvm-project/clang/test/AST/ast-dump-records.cpp
index e48d406..3682e1a 100644
--- a/src/llvm-project/clang/test/AST/ast-dump-records.cpp
+++ b/src/llvm-project/clang/test/AST/ast-dump-records.cpp
@@ -65,7 +65,7 @@
union {
// CHECK-NEXT: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:3, line:[[@LINE+12]]:3> line:[[@LINE-1]]:3 union definition
- // CHECK-NEXT: DefinitionData pass_in_registers aggregate standard_layout trivially_copyable pod trivial literal
+ // CHECK-NEXT: DefinitionData is_anonymous pass_in_registers aggregate standard_layout trivially_copyable pod trivial literal
// CHECK-NEXT: DefaultConstructor exists trivial needs_implicit
// CHECK-NEXT: CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param
// CHECK-NEXT: MoveConstructor exists simple trivial needs_implicit
@@ -87,7 +87,7 @@
struct {
// CHECK-NEXT: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:3, line:[[@LINE+11]]:3> line:[[@LINE-1]]:3 struct definition
- // CHECK-NEXT: DefinitionData pass_in_registers aggregate standard_layout trivially_copyable pod trivial literal
+ // CHECK-NEXT: DefinitionData is_anonymous pass_in_registers aggregate standard_layout trivially_copyable pod trivial literal
// CHECK-NEXT: DefaultConstructor exists trivial needs_implicit
// CHECK-NEXT: CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param
// CHECK-NEXT: MoveConstructor exists simple trivial needs_implicit
@@ -194,7 +194,7 @@
union {
// CHECK-NEXT: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:3, line:[[@LINE+13]]:3> line:[[@LINE-1]]:3 union definition
- // CHECK-NEXT: DefinitionData pass_in_registers aggregate standard_layout trivially_copyable pod trivial literal
+ // CHECK-NEXT: DefinitionData is_anonymous pass_in_registers aggregate standard_layout trivially_copyable pod trivial literal
// CHECK-NEXT: DefaultConstructor exists trivial needs_implicit
// CHECK-NEXT: CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param
// CHECK-NEXT: MoveConstructor exists simple trivial needs_implicit
@@ -217,7 +217,7 @@
struct {
// CHECK-NEXT: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:3, line:[[@LINE+12]]:3> line:[[@LINE-1]]:3 struct definition
- // CHECK-NEXT: DefinitionData pass_in_registers aggregate standard_layout trivially_copyable pod trivial literal
+ // CHECK-NEXT: DefinitionData is_anonymous pass_in_registers aggregate standard_layout trivially_copyable pod trivial literal
// CHECK-NEXT: DefaultConstructor exists trivial needs_implicit
// CHECK-NEXT: CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param
// CHECK-NEXT: MoveConstructor exists simple trivial needs_implicit
diff --git a/src/llvm-project/clang/test/AST/ast-dump-stmt-json.c b/src/llvm-project/clang/test/AST/ast-dump-stmt-json.c
index 03552a3..8afb9b1 100644
--- a/src/llvm-project/clang/test/AST/ast-dump-stmt-json.c
+++ b/src/llvm-project/clang/test/AST/ast-dump-stmt-json.c
@@ -153,6 +153,7 @@
// CHECK: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 99,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 3,
// CHECK-NEXT: "col": 5,
@@ -160,15 +161,18 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 95,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 114,
// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "TestLocation",
+// CHECK-NEXT: "mangledName": "TestLocation",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
@@ -179,10 +183,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 114,
// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 114,
// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -199,21 +205,25 @@
// CHECK: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 121,
// CHECK-NEXT: "line": 4,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 10
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 117,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 140,
// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "TestIndent",
+// CHECK-NEXT: "mangledName": "TestIndent",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
@@ -224,10 +234,12 @@
// CHECK-NEXT: "kind": "BinaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 134,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 140,
// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -243,10 +255,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 134,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 134,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -262,10 +276,12 @@
// CHECK-NEXT: "kind": "ParenExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 138,
// CHECK-NEXT: "col": 22,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 140,
// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -280,10 +296,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 139,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 139,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -305,11 +323,13 @@
// CHECK: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 164,
// CHECK-NEXT: "line": 6,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 191,
// CHECK-NEXT: "line": 9,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -321,11 +341,13 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 168,
// CHECK-NEXT: "line": 7,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 177,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -335,20 +357,24 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 172,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 168,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 176,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "x",
+// CHECK-NEXT: "mangledName": "x",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
@@ -359,10 +385,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 176,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 176,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -382,11 +410,13 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 181,
// CHECK-NEXT: "line": 8,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 189,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -396,20 +426,24 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 185,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 181,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 185,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "y",
+// CHECK-NEXT: "mangledName": "y",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: }
@@ -418,20 +452,24 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 188,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 181,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 188,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "z",
+// CHECK-NEXT: "mangledName": "z",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: }
@@ -444,21 +482,25 @@
// CHECK: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 198,
// CHECK-NEXT: "line": 11,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 19
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 194,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 225,
// CHECK-NEXT: "col": 32,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "TestOpaqueValueExpr",
+// CHECK-NEXT: "mangledName": "TestOpaqueValueExpr",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
@@ -469,10 +511,12 @@
// CHECK-NEXT: "kind": "BinaryConditionalOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 220,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 225,
// CHECK-NEXT: "col": 32,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -487,10 +531,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 220,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 220,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -506,10 +552,12 @@
// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 220,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 220,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -524,10 +572,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 220,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 220,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -545,10 +595,12 @@
// CHECK-NEXT: "kind": "OpaqueValueExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 220,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 220,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -563,10 +615,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 220,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 220,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -584,10 +638,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 225,
// CHECK-NEXT: "col": 32,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 225,
// CHECK-NEXT: "col": 32,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -607,11 +663,13 @@
// CHECK: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 262,
// CHECK-NEXT: "line": 13,
// CHECK-NEXT: "col": 34,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 340,
// CHECK-NEXT: "line": 25,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -623,11 +681,13 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 266,
// CHECK-NEXT: "line": 14,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 277,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -637,21 +697,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 271,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 266,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 276,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "T1",
+// CHECK-NEXT: "mangledName": "T1",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "char"
// CHECK-NEXT: },
@@ -662,10 +726,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 276,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 276,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -681,10 +747,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 276,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 276,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -706,11 +774,13 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 281,
// CHECK-NEXT: "line": 15,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 291,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -720,21 +790,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 285,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 281,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 290,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "T2",
+// CHECK-NEXT: "mangledName": "T2",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
@@ -745,10 +819,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 290,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 290,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -768,11 +844,13 @@
// CHECK-NEXT: "kind": "UnaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 296,
// CHECK-NEXT: "line": 17,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 298,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -790,10 +868,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 296,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 296,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -818,11 +898,13 @@
// CHECK-NEXT: "kind": "UnaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 304,
// CHECK-NEXT: "line": 18,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 306,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -839,10 +921,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 304,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 304,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -867,11 +951,13 @@
// CHECK-NEXT: "kind": "UnaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 313,
// CHECK-NEXT: "line": 20,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 314,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -889,10 +975,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 314,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 314,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -908,10 +996,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 314,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 314,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -927,10 +1017,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 314,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 314,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -959,11 +1051,13 @@
// CHECK-NEXT: "kind": "UnaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 320,
// CHECK-NEXT: "line": 21,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 321,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -980,10 +1074,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 321,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 321,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -999,10 +1095,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 321,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 321,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -1029,11 +1127,13 @@
// CHECK-NEXT: "kind": "UnaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 328,
// CHECK-NEXT: "line": 23,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 329,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -1051,10 +1151,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 329,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 329,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -1070,10 +1172,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 329,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 329,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -1089,10 +1193,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 329,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 329,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -1121,11 +1227,13 @@
// CHECK-NEXT: "kind": "UnaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 335,
// CHECK-NEXT: "line": 24,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 336,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -1143,10 +1251,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 336,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 336,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -1162,10 +1272,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 336,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 336,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -1194,10 +1306,12 @@
// CHECK: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 387,
// CHECK-NEXT: "col": 45,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 576,
// CHECK-NEXT: "line": 34,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -1209,11 +1323,13 @@
// CHECK-NEXT: "kind": "GenericSelectionExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 391,
// CHECK-NEXT: "line": 28,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 411,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1228,10 +1344,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 400,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 400,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1247,10 +1365,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 400,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 400,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1294,10 +1414,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 409,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 409,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -1317,11 +1439,13 @@
// CHECK-NEXT: "kind": "GenericSelectionExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 416,
// CHECK-NEXT: "line": 29,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 449,
// CHECK-NEXT: "col": 36,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1336,10 +1460,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 425,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 425,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1355,10 +1481,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 425,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 425,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1402,10 +1530,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 434,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 434,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -1426,10 +1556,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 448,
// CHECK-NEXT: "col": 35,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 448,
// CHECK-NEXT: "col": 35,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1449,11 +1581,13 @@
// CHECK-NEXT: "kind": "GenericSelectionExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 454,
// CHECK-NEXT: "line": 30,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 487,
// CHECK-NEXT: "col": 36,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1468,10 +1602,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 463,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 463,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1487,10 +1623,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 463,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 463,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1526,10 +1664,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 476,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 476,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1558,10 +1698,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 485,
// CHECK-NEXT: "col": 34,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 485,
// CHECK-NEXT: "col": 34,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -1581,11 +1723,13 @@
// CHECK-NEXT: "kind": "GenericSelectionExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 492,
// CHECK-NEXT: "line": 31,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 539,
// CHECK-NEXT: "col": 50,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1600,10 +1744,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 501,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 501,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1619,10 +1765,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 501,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 501,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1666,10 +1814,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 510,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 510,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -1697,10 +1847,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 522,
// CHECK-NEXT: "col": 33,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 522,
// CHECK-NEXT: "col": 33,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -1721,10 +1873,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 536,
// CHECK-NEXT: "col": 47,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 536,
// CHECK-NEXT: "col": 47,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -1744,11 +1898,13 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 545,
// CHECK-NEXT: "line": 33,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 574,
// CHECK-NEXT: "col": 32,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1758,20 +1914,24 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 549,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 545,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 573,
// CHECK-NEXT: "col": 31,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "j",
+// CHECK-NEXT: "mangledName": "j",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
@@ -1782,10 +1942,12 @@
// CHECK-NEXT: "kind": "GenericSelectionExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 553,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 573,
// CHECK-NEXT: "col": 31,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1800,10 +1962,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 562,
// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 562,
// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1819,10 +1983,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 562,
// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 562,
// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1866,10 +2032,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 571,
// CHECK-NEXT: "col": 29,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 571,
// CHECK-NEXT: "col": 29,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -1895,11 +2063,13 @@
// CHECK: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 608,
// CHECK-NEXT: "line": 36,
// CHECK-NEXT: "col": 30,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 756,
// CHECK-NEXT: "line": 50,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -1911,11 +2081,13 @@
// CHECK-NEXT: "kind": "LabelStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 675,
// CHECK-NEXT: "line": 39,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 685,
// CHECK-NEXT: "line": 40,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
@@ -1929,10 +2101,12 @@
// CHECK-NEXT: "kind": "NullStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 685,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 685,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1945,11 +2119,13 @@
// CHECK-NEXT: "kind": "GotoStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 690,
// CHECK-NEXT: "line": 42,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 695,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: }
@@ -1961,11 +2137,13 @@
// CHECK-NEXT: "kind": "LabelStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 704,
// CHECK-NEXT: "line": 44,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 714,
// CHECK-NEXT: "line": 45,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
@@ -1979,10 +2157,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 714,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 714,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2000,11 +2180,13 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 720,
// CHECK-NEXT: "line": 47,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 740,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2014,21 +2196,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 726,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 720,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 734,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "ptr",
+// CHECK-NEXT: "mangledName": "ptr",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void *"
// CHECK-NEXT: },
@@ -2039,10 +2225,12 @@
// CHECK-NEXT: "kind": "AddrLabelExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 732,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 734,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: }
@@ -2063,11 +2251,13 @@
// CHECK-NEXT: "kind": "IndirectGotoStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 745,
// CHECK-NEXT: "line": 49,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 751,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -2078,10 +2268,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 751,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 751,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -2097,10 +2289,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 751,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 751,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -2116,10 +2310,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 751,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 751,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -2150,10 +2346,12 @@
// CHECK: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 782,
// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 904,
// CHECK-NEXT: "line": 64,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -2165,11 +2363,13 @@
// CHECK-NEXT: "kind": "SwitchStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 786,
// CHECK-NEXT: "line": 53,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 902,
// CHECK-NEXT: "line": 63,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
@@ -2181,11 +2381,13 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 794,
// CHECK-NEXT: "line": 53,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 794,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2201,10 +2403,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 794,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 794,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2229,10 +2433,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 797,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 902,
// CHECK-NEXT: "line": 63,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
@@ -2244,11 +2450,13 @@
// CHECK-NEXT: "kind": "CaseStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 801,
// CHECK-NEXT: "line": 54,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 813,
// CHECK-NEXT: "line": 55,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 5
@@ -2260,11 +2468,13 @@
// CHECK-NEXT: "kind": "ConstantExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 806,
// CHECK-NEXT: "line": 54,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 806,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2279,10 +2489,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 806,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 806,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2300,11 +2512,13 @@
// CHECK-NEXT: "kind": "BreakStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 813,
// CHECK-NEXT: "line": 55,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 813,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
@@ -2317,11 +2531,13 @@
// CHECK-NEXT: "kind": "CaseStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 822,
// CHECK-NEXT: "line": 56,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 844,
// CHECK-NEXT: "line": 58,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 5
@@ -2333,11 +2549,13 @@
// CHECK-NEXT: "kind": "ConstantExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 827,
// CHECK-NEXT: "line": 56,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 827,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2352,10 +2570,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 827,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 827,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2373,11 +2593,13 @@
// CHECK-NEXT: "kind": "CaseStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 832,
// CHECK-NEXT: "line": 57,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 844,
// CHECK-NEXT: "line": 58,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 5
@@ -2389,11 +2611,13 @@
// CHECK-NEXT: "kind": "ConstantExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 837,
// CHECK-NEXT: "line": 57,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 837,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2408,10 +2632,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 837,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 837,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2429,11 +2655,13 @@
// CHECK-NEXT: "kind": "BreakStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 844,
// CHECK-NEXT: "line": 58,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 844,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
@@ -2448,11 +2676,13 @@
// CHECK-NEXT: "kind": "DefaultStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 853,
// CHECK-NEXT: "line": 59,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 7
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 866,
// CHECK-NEXT: "line": 60,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 5
@@ -2464,10 +2694,12 @@
// CHECK-NEXT: "kind": "BreakStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 866,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 866,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
@@ -2480,11 +2712,13 @@
// CHECK-NEXT: "kind": "CaseStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 875,
// CHECK-NEXT: "line": 61,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 893,
// CHECK-NEXT: "line": 62,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 5
@@ -2497,11 +2731,13 @@
// CHECK-NEXT: "kind": "ConstantExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 880,
// CHECK-NEXT: "line": 61,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 880,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2516,10 +2752,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 880,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 880,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2537,10 +2775,12 @@
// CHECK-NEXT: "kind": "ConstantExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 886,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 886,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2555,10 +2795,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 886,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 886,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2576,11 +2818,13 @@
// CHECK-NEXT: "kind": "BreakStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 893,
// CHECK-NEXT: "line": 62,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 893,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
@@ -2599,10 +2843,12 @@
// CHECK: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 928,
// CHECK-NEXT: "col": 22,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1095,
// CHECK-NEXT: "line": 91,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -2614,11 +2860,13 @@
// CHECK-NEXT: "kind": "IfStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 932,
// CHECK-NEXT: "line": 67,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 943,
// CHECK-NEXT: "line": 68,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
@@ -2630,11 +2878,13 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 936,
// CHECK-NEXT: "line": 67,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 936,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2650,10 +2900,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 936,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 936,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2678,11 +2930,13 @@
// CHECK-NEXT: "kind": "NullStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 943,
// CHECK-NEXT: "line": 68,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 943,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2695,11 +2949,13 @@
// CHECK-NEXT: "kind": "IfStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 948,
// CHECK-NEXT: "line": 70,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 956,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2710,10 +2966,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 952,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 952,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2729,10 +2987,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 952,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 952,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2757,10 +3017,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 955,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 956,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2773,11 +3035,13 @@
// CHECK-NEXT: "kind": "IfStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 961,
// CHECK-NEXT: "line": 72,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 985,
// CHECK-NEXT: "line": 75,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
@@ -2790,11 +3054,13 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 965,
// CHECK-NEXT: "line": 72,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 965,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2810,10 +3076,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 965,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 965,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2838,11 +3106,13 @@
// CHECK-NEXT: "kind": "NullStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 972,
// CHECK-NEXT: "line": 73,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 972,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2853,11 +3123,13 @@
// CHECK-NEXT: "kind": "NullStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 985,
// CHECK-NEXT: "line": 75,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 985,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2870,11 +3142,13 @@
// CHECK-NEXT: "kind": "IfStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 990,
// CHECK-NEXT: "line": 77,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1008,
// CHECK-NEXT: "line": 78,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
@@ -2887,11 +3161,13 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 994,
// CHECK-NEXT: "line": 77,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 994,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2907,10 +3183,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 994,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 994,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2935,10 +3213,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 997,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 998,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2949,11 +3229,13 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1007,
// CHECK-NEXT: "line": 78,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1008,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2966,11 +3248,13 @@
// CHECK-NEXT: "kind": "IfStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1013,
// CHECK-NEXT: "line": 80,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1044,
// CHECK-NEXT: "line": 83,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
@@ -2983,11 +3267,13 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1017,
// CHECK-NEXT: "line": 80,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1017,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3003,10 +3289,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1017,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1017,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3031,11 +3319,13 @@
// CHECK-NEXT: "kind": "NullStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1024,
// CHECK-NEXT: "line": 81,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1024,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3046,11 +3336,13 @@
// CHECK-NEXT: "kind": "IfStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1033,
// CHECK-NEXT: "line": 82,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1044,
// CHECK-NEXT: "line": 83,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
@@ -3062,11 +3354,13 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1037,
// CHECK-NEXT: "line": 82,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1037,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3082,10 +3376,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1037,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1037,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3110,11 +3406,13 @@
// CHECK-NEXT: "kind": "NullStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1044,
// CHECK-NEXT: "line": 83,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1044,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3129,11 +3427,13 @@
// CHECK-NEXT: "kind": "IfStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1049,
// CHECK-NEXT: "line": 85,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1093,
// CHECK-NEXT: "line": 90,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
@@ -3146,11 +3446,13 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1053,
// CHECK-NEXT: "line": 85,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1053,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3166,10 +3468,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1053,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1053,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3194,11 +3498,13 @@
// CHECK-NEXT: "kind": "NullStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1060,
// CHECK-NEXT: "line": 86,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1060,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3209,11 +3515,13 @@
// CHECK-NEXT: "kind": "IfStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1069,
// CHECK-NEXT: "line": 87,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1093,
// CHECK-NEXT: "line": 90,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
@@ -3226,11 +3534,13 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1073,
// CHECK-NEXT: "line": 87,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1073,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3246,10 +3556,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1073,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1073,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3274,11 +3586,13 @@
// CHECK-NEXT: "kind": "NullStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1080,
// CHECK-NEXT: "line": 88,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1080,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3289,11 +3603,13 @@
// CHECK-NEXT: "kind": "NullStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1093,
// CHECK-NEXT: "line": 90,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1093,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3310,10 +3626,12 @@
// CHECK: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1126,
// CHECK-NEXT: "col": 29,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1322,
// CHECK-NEXT: "line": 118,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -3325,11 +3643,13 @@
// CHECK-NEXT: "kind": "WhileStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1130,
// CHECK-NEXT: "line": 94,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1144,
// CHECK-NEXT: "line": 95,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
@@ -3341,11 +3661,13 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1137,
// CHECK-NEXT: "line": 94,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1137,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3361,10 +3683,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1137,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1137,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3389,11 +3713,13 @@
// CHECK-NEXT: "kind": "NullStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1144,
// CHECK-NEXT: "line": 95,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1144,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3406,11 +3732,13 @@
// CHECK-NEXT: "kind": "DoStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1149,
// CHECK-NEXT: "line": 97,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1168,
// CHECK-NEXT: "line": 99,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
@@ -3422,11 +3750,13 @@
// CHECK-NEXT: "kind": "NullStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1156,
// CHECK-NEXT: "line": 98,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1156,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3437,11 +3767,13 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1167,
// CHECK-NEXT: "line": 99,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1167,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3457,10 +3789,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1167,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1167,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3487,11 +3821,13 @@
// CHECK-NEXT: "kind": "ForStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1174,
// CHECK-NEXT: "line": 101,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1207,
// CHECK-NEXT: "line": 102,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
@@ -3503,11 +3839,13 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1179,
// CHECK-NEXT: "line": 101,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1188,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3517,21 +3855,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1183,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1179,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1187,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "i",
+// CHECK-NEXT: "mangledName": "i",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
@@ -3542,10 +3884,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1187,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1187,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3566,10 +3910,12 @@
// CHECK-NEXT: "kind": "BinaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1190,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1194,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -3585,10 +3931,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1190,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1190,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3604,10 +3952,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1190,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1190,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3632,10 +3982,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1194,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1194,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -3653,10 +4005,12 @@
// CHECK-NEXT: "kind": "UnaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1198,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1200,
// CHECK-NEXT: "col": 29,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3673,10 +4027,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1200,
// CHECK-NEXT: "col": 29,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1200,
// CHECK-NEXT: "col": 29,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3701,11 +4057,13 @@
// CHECK-NEXT: "kind": "NullStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1207,
// CHECK-NEXT: "line": 102,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1207,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3718,11 +4076,13 @@
// CHECK-NEXT: "kind": "ForStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1212,
// CHECK-NEXT: "line": 104,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1230,
// CHECK-NEXT: "line": 105,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
@@ -3734,11 +4094,13 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1217,
// CHECK-NEXT: "line": 104,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1217,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3754,10 +4116,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1217,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1217,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3783,10 +4147,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1220,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1220,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3802,10 +4168,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1220,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1220,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3830,10 +4198,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1223,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1223,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3849,10 +4219,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1223,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1223,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3877,11 +4249,13 @@
// CHECK-NEXT: "kind": "NullStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1230,
// CHECK-NEXT: "line": 105,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1230,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3894,11 +4268,13 @@
// CHECK-NEXT: "kind": "ForStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1235,
// CHECK-NEXT: "line": 107,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1257,
// CHECK-NEXT: "line": 108,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
@@ -3912,11 +4288,13 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1242,
// CHECK-NEXT: "line": 107,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1242,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3932,10 +4310,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1242,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1242,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3960,10 +4340,12 @@
// CHECK-NEXT: "kind": "BinaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1245,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1250,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3979,10 +4361,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1245,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1245,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4005,10 +4389,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1249,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1250,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4024,10 +4410,12 @@
// CHECK-NEXT: "kind": "UnaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1249,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1250,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4045,10 +4433,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1250,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1250,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4064,10 +4454,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1250,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1250,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4098,11 +4490,13 @@
// CHECK-NEXT: "kind": "NullStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1257,
// CHECK-NEXT: "line": 108,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1257,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4115,11 +4509,13 @@
// CHECK-NEXT: "kind": "ForStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1262,
// CHECK-NEXT: "line": 110,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1277,
// CHECK-NEXT: "line": 111,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
@@ -4133,11 +4529,13 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1269,
// CHECK-NEXT: "line": 110,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1269,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4153,10 +4551,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1269,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1269,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4182,11 +4582,13 @@
// CHECK-NEXT: "kind": "NullStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1277,
// CHECK-NEXT: "line": 111,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1277,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4199,11 +4601,13 @@
// CHECK-NEXT: "kind": "ForStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1282,
// CHECK-NEXT: "line": 113,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1302,
// CHECK-NEXT: "line": 114,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
@@ -4218,11 +4622,13 @@
// CHECK-NEXT: "kind": "BinaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1290,
// CHECK-NEXT: "line": 113,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1295,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4238,10 +4644,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1290,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1290,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4264,10 +4672,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1294,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1295,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4283,10 +4693,12 @@
// CHECK-NEXT: "kind": "UnaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1294,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1295,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4304,10 +4716,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1295,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1295,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4323,10 +4737,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1295,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1295,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4357,11 +4773,13 @@
// CHECK-NEXT: "kind": "NullStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1302,
// CHECK-NEXT: "line": 114,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1302,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4374,11 +4792,13 @@
// CHECK-NEXT: "kind": "ForStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1307,
// CHECK-NEXT: "line": 116,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1320,
// CHECK-NEXT: "line": 117,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
@@ -4394,10 +4814,12 @@
// CHECK-NEXT: "kind": "NullStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1320,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1320,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4412,11 +4834,13 @@
// CHECK: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1346,
// CHECK-NEXT: "line": 120,
// CHECK-NEXT: "col": 22,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1490,
// CHECK-NEXT: "line": 130,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -4428,11 +4852,13 @@
// CHECK-NEXT: "kind": "WhileStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1414,
// CHECK-NEXT: "line": 123,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1453,
// CHECK-NEXT: "line": 126,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
@@ -4444,11 +4870,13 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1421,
// CHECK-NEXT: "line": 123,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1421,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4464,10 +4892,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1424,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1453,
// CHECK-NEXT: "line": 126,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
@@ -4479,11 +4909,13 @@
// CHECK-NEXT: "kind": "ContinueStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1430,
// CHECK-NEXT: "line": 124,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1430,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: }
@@ -4494,11 +4926,13 @@
// CHECK-NEXT: "kind": "BreakStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1444,
// CHECK-NEXT: "line": 125,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1444,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
@@ -4513,11 +4947,13 @@
// CHECK-NEXT: "kind": "ReturnStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1457,
// CHECK-NEXT: "line": 127,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1457,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: }
@@ -4528,11 +4964,13 @@
// CHECK-NEXT: "kind": "ReturnStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1468,
// CHECK-NEXT: "line": 129,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1487,
// CHECK-NEXT: "col": 22,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4543,10 +4981,12 @@
// CHECK-NEXT: "kind": "CallExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1475,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 10
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1487,
// CHECK-NEXT: "col": 22,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4561,10 +5001,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1475,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 10
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1475,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 10
// CHECK-NEXT: }
@@ -4580,10 +5022,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1475,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 10
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1475,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 10
// CHECK-NEXT: }
@@ -4608,10 +5052,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1486,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1486,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4633,11 +5079,13 @@
// CHECK: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1518,
// CHECK-NEXT: "line": 132,
// CHECK-NEXT: "col": 26,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1542,
// CHECK-NEXT: "line": 134,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -4649,11 +5097,13 @@
// CHECK-NEXT: "kind": "StmtExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1522,
// CHECK-NEXT: "line": 133,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1539,
// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4668,10 +5118,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1523,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1538,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4682,10 +5134,12 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1524,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1534,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4695,21 +5149,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1528,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1524,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1532,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "mangledName": "a",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
@@ -4720,10 +5178,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1532,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1532,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -4743,10 +5203,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1536,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1536,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4762,10 +5224,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1536,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1536,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4796,11 +5260,13 @@
// CHECK: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1572,
// CHECK-NEXT: "line": 136,
// CHECK-NEXT: "col": 28,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "line": 148,
// CHECK-NEXT: "presumedLine": 200003,
// CHECK-NEXT: "col": 1,
@@ -4813,11 +5279,13 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1576,
// CHECK-NEXT: "line": 137,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1581,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4827,20 +5295,24 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1580,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1576,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1580,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "mangledName": "a",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: }
@@ -4852,12 +5324,14 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "line": 142,
// CHECK-NEXT: "presumedLine": 100000,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1622,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4867,20 +5341,24 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1621,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1621,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "b",
+// CHECK-NEXT: "mangledName": "b",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: }
@@ -4893,12 +5371,14 @@
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
// CHECK-NEXT: "spellingLoc": {
+// CHECK-NEXT: "offset": 1644,
// CHECK-NEXT: "line": 145,
// CHECK-NEXT: "presumedLine": 200000,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "expansionLoc": {
+// CHECK-NEXT: "offset": 1640,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3,
// CHECK-NEXT: "isMacroArgExpansion": true
@@ -4906,10 +5386,12 @@
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
// CHECK-NEXT: "spellingLoc": {
+// CHECK-NEXT: "offset": 1644,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "expansionLoc": {
+// CHECK-NEXT: "offset": 1640,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3,
// CHECK-NEXT: "isMacroArgExpansion": true
diff --git a/src/llvm-project/clang/test/AST/ast-dump-stmt-json.cpp b/src/llvm-project/clang/test/AST/ast-dump-stmt-json.cpp
index 4b0959a..85a3a66 100644
--- a/src/llvm-project/clang/test/AST/ast-dump-stmt-json.cpp
+++ b/src/llvm-project/clang/test/AST/ast-dump-stmt-json.cpp
@@ -128,22 +128,26 @@
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 125,
// CHECK-NEXT: "line": 4,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 120,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 137,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "function",
+// CHECK-NEXT: "mangledName": "_ZN1n8functionEv",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: },
@@ -153,10 +157,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 136,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 137,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -168,16 +174,19 @@
// CHECK: "kind": "UsingDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 164,
// CHECK-NEXT: "line": 7,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 155,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 164,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: }
@@ -188,15 +197,18 @@
// CHECK: "kind": "UsingShadowDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 164,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 164,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 164,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: }
@@ -215,16 +227,19 @@
// CHECK: "kind": "UsingDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 183,
// CHECK-NEXT: "line": 8,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 174,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 183,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: }
@@ -235,15 +250,18 @@
// CHECK: "kind": "UsingShadowDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 183,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 183,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 183,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: }
@@ -262,22 +280,26 @@
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 198,
// CHECK-NEXT: "line": 9,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 12
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 193,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 258,
// CHECK-NEXT: "line": 12,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "TestFunction",
+// CHECK-NEXT: "mangledName": "_Z12TestFunctionv",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: },
@@ -287,11 +309,13 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 213,
// CHECK-NEXT: "line": 9,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 258,
// CHECK-NEXT: "line": 12,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -303,11 +327,13 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 217,
// CHECK-NEXT: "line": 10,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 240,
// CHECK-NEXT: "col": 26,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -317,20 +343,24 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 224,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 217,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 232,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "f",
+// CHECK-NEXT: "mangledName": "_ZZ12TestFunctionvE1f",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (*)()"
// CHECK-NEXT: },
@@ -341,10 +371,12 @@
// CHECK-NEXT: "kind": "UnaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 231,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 232,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: }
@@ -362,10 +394,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 232,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 232,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: }
@@ -399,11 +433,13 @@
// CHECK-NEXT: "kind": "BinaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 244,
// CHECK-NEXT: "line": 11,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 255,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -419,10 +455,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 244,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 244,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: }
@@ -450,10 +488,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 255,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 255,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -474,22 +514,26 @@
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 266,
// CHECK-NEXT: "line": 14,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 10
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 261,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 315,
// CHECK-NEXT: "line": 19,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "TestCatch1",
+// CHECK-NEXT: "mangledName": "_Z10TestCatch1v",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: },
@@ -499,11 +543,13 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 279,
// CHECK-NEXT: "line": 14,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 315,
// CHECK-NEXT: "line": 19,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -515,11 +561,13 @@
// CHECK-NEXT: "kind": "CXXTryStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 283,
// CHECK-NEXT: "line": 15,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 313,
// CHECK-NEXT: "line": 18,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
@@ -531,11 +579,13 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 287,
// CHECK-NEXT: "line": 15,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 291,
// CHECK-NEXT: "line": 16,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
@@ -547,11 +597,13 @@
// CHECK-NEXT: "kind": "CXXCatchStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 295,
// CHECK-NEXT: "line": 17,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 313,
// CHECK-NEXT: "line": 18,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
@@ -562,21 +614,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 306,
// CHECK-NEXT: "line": 17,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 302,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 306,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "x",
+// CHECK-NEXT: "mangledName": "_ZZ10TestCatch1vE1x",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: }
@@ -586,10 +642,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 309,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 313,
// CHECK-NEXT: "line": 18,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
@@ -608,22 +666,26 @@
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 323,
// CHECK-NEXT: "line": 21,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 10
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 318,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 370,
// CHECK-NEXT: "line": 26,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "TestCatch2",
+// CHECK-NEXT: "mangledName": "_Z10TestCatch2v",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: },
@@ -633,11 +695,13 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 336,
// CHECK-NEXT: "line": 21,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 370,
// CHECK-NEXT: "line": 26,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -649,11 +713,13 @@
// CHECK-NEXT: "kind": "CXXTryStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 340,
// CHECK-NEXT: "line": 22,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 368,
// CHECK-NEXT: "line": 25,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
@@ -665,11 +731,13 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 344,
// CHECK-NEXT: "line": 22,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 348,
// CHECK-NEXT: "line": 23,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
@@ -681,11 +749,13 @@
// CHECK-NEXT: "kind": "CXXCatchStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 352,
// CHECK-NEXT: "line": 24,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 368,
// CHECK-NEXT: "line": 25,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
@@ -693,18 +763,20 @@
// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}"
+// CHECK-NEXT: "id": "0x0"
// CHECK-NEXT: },
// CHECK-NEXT: {
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 364,
// CHECK-NEXT: "line": 24,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 368,
// CHECK-NEXT: "line": 25,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
@@ -723,22 +795,26 @@
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 378,
// CHECK-NEXT: "line": 28,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 19
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 373,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 502,
// CHECK-NEXT: "line": 36,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "TestAllocationExprs",
+// CHECK-NEXT: "mangledName": "_Z19TestAllocationExprsv",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: },
@@ -748,11 +824,13 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 400,
// CHECK-NEXT: "line": 28,
// CHECK-NEXT: "col": 28,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 502,
// CHECK-NEXT: "line": 36,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -764,11 +842,13 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 404,
// CHECK-NEXT: "line": 29,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 410,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -778,21 +858,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 409,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 404,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 409,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "p",
+// CHECK-NEXT: "mangledName": "_ZZ19TestAllocationExprsvE1p",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int *"
// CHECK-NEXT: }
@@ -804,11 +888,13 @@
// CHECK-NEXT: "kind": "BinaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 414,
// CHECK-NEXT: "line": 30,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 422,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -824,10 +910,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 414,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 414,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -850,10 +938,12 @@
// CHECK-NEXT: "kind": "CXXNewExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 418,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 422,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -878,11 +968,13 @@
// CHECK-NEXT: "kind": "CXXDeleteExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 429,
// CHECK-NEXT: "line": 31,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 436,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -905,10 +997,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 436,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 436,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -924,10 +1018,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 436,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 436,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -954,11 +1050,13 @@
// CHECK-NEXT: "kind": "BinaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 441,
// CHECK-NEXT: "line": 32,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 454,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -974,10 +1072,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 441,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 441,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1000,10 +1100,12 @@
// CHECK-NEXT: "kind": "CXXNewExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 445,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 454,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1027,10 +1129,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 453,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 453,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1046,10 +1150,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 453,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 453,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1071,11 +1177,13 @@
// CHECK-NEXT: "kind": "CXXDeleteExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 459,
// CHECK-NEXT: "line": 33,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 468,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1100,10 +1208,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 468,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 468,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1119,10 +1229,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 468,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 468,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1149,11 +1261,13 @@
// CHECK-NEXT: "kind": "BinaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 473,
// CHECK-NEXT: "line": 34,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 483,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -1169,10 +1283,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 473,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 473,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1195,10 +1311,12 @@
// CHECK-NEXT: "kind": "CXXNewExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 477,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 483,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -1224,11 +1342,13 @@
// CHECK-NEXT: "kind": "CXXDeleteExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 490,
// CHECK-NEXT: "line": 35,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 499,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1252,10 +1372,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 499,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 499,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1271,10 +1393,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 499,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 499,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1311,6 +1435,7 @@
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "operator new",
+// CHECK-NEXT: "mangledName": "_Znwm",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void *(unsigned long)"
// CHECK-NEXT: },
@@ -1349,6 +1474,7 @@
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "name": "operator new",
+// CHECK-NEXT: "mangledName": "_ZnwmSt11align_val_t",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void *(unsigned long, std::align_val_t)"
// CHECK-NEXT: },
@@ -1401,6 +1527,7 @@
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "operator new[]",
+// CHECK-NEXT: "mangledName": "_Znam",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void *(unsigned long)"
// CHECK-NEXT: },
@@ -1439,6 +1566,7 @@
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "name": "operator new[]",
+// CHECK-NEXT: "mangledName": "_ZnamSt11align_val_t",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void *(unsigned long, std::align_val_t)"
// CHECK-NEXT: },
@@ -1491,6 +1619,7 @@
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "operator delete",
+// CHECK-NEXT: "mangledName": "_ZdlPv",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (void *) noexcept"
// CHECK-NEXT: },
@@ -1529,6 +1658,7 @@
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "name": "operator delete",
+// CHECK-NEXT: "mangledName": "_ZdlPvSt11align_val_t",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (void *, std::align_val_t) noexcept"
// CHECK-NEXT: },
@@ -1581,6 +1711,7 @@
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "operator delete[]",
+// CHECK-NEXT: "mangledName": "_ZdaPv",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (void *) noexcept"
// CHECK-NEXT: },
@@ -1619,6 +1750,7 @@
// CHECK-NEXT: },
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "name": "operator delete[]",
+// CHECK-NEXT: "mangledName": "_ZdaPvSt11align_val_t",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (void *, std::align_val_t) noexcept"
// CHECK-NEXT: },
@@ -1664,17 +1796,20 @@
// CHECK: "kind": "FunctionTemplateDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 598,
// CHECK-NEXT: "line": 40,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 27
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 571,
// CHECK-NEXT: "line": 39,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 658,
// CHECK-NEXT: "line": 43,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -1686,16 +1821,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TemplateTypeParmDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 590,
// CHECK-NEXT: "line": 39,
// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 581,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 590,
// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1710,16 +1848,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 598,
// CHECK-NEXT: "line": 40,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 27
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 593,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 658,
// CHECK-NEXT: "line": 43,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -1735,11 +1876,13 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 628,
// CHECK-NEXT: "line": 40,
// CHECK-NEXT: "col": 36,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 658,
// CHECK-NEXT: "line": 43,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -1751,11 +1894,13 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 632,
// CHECK-NEXT: "line": 41,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 644,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1765,21 +1910,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 635,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 632,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 643,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isReferenced": true,
// CHECK-NEXT: "name": "p",
+// CHECK-NEXT: "mangledName": "_ZZ27TestDependentAllocationExprvE1p",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "T *"
// CHECK-NEXT: },
@@ -1790,10 +1939,12 @@
// CHECK-NEXT: "kind": "CXXNewExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 639,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 643,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1812,11 +1963,13 @@
// CHECK-NEXT: "kind": "CXXDeleteExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 648,
// CHECK-NEXT: "line": 42,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 655,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1831,10 +1984,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 655,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 655,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1864,17 +2019,20 @@
// CHECK: "kind": "FunctionTemplateDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 766,
// CHECK-NEXT: "line": 51,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 28
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 739,
// CHECK-NEXT: "line": 50,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 905,
// CHECK-NEXT: "line": 56,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -1886,16 +2044,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TemplateTypeParmDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 758,
// CHECK-NEXT: "line": 50,
// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 749,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 758,
// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1910,16 +2071,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 766,
// CHECK-NEXT: "line": 51,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 28
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 761,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 905,
// CHECK-NEXT: "line": 56,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -1935,11 +2099,13 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 797,
// CHECK-NEXT: "line": 51,
// CHECK-NEXT: "col": 37,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 905,
// CHECK-NEXT: "line": 56,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -1951,11 +2117,13 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 801,
// CHECK-NEXT: "line": 52,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 31
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 839,
// CHECK-NEXT: "col": 41,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1965,21 +2133,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 836,
// CHECK-NEXT: "col": 38,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 801,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 31
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 836,
// CHECK-NEXT: "col": 38,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isReferenced": true,
// CHECK-NEXT: "name": "obj",
+// CHECK-NEXT: "mangledName": "_ZZ28TestDependentScopeMemberExprvE3obj",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "DependentScopeMemberExprWrapper<T>"
// CHECK-NEXT: }
@@ -1991,11 +2163,13 @@
// CHECK-NEXT: "kind": "BinaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 843,
// CHECK-NEXT: "line": 53,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 858,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2011,10 +2185,12 @@
// CHECK-NEXT: "kind": "CXXDependentScopeMemberExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 843,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 847,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: }
@@ -2031,10 +2207,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 843,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 843,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -2059,10 +2237,12 @@
// CHECK-NEXT: "kind": "CXXUnresolvedConstructExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 856,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 858,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2079,11 +2259,13 @@
// CHECK-NEXT: "kind": "BinaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 863,
// CHECK-NEXT: "line": 54,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 878,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2099,10 +2281,12 @@
// CHECK-NEXT: "kind": "CXXDependentScopeMemberExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 863,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 867,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: }
@@ -2119,10 +2303,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 863,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 863,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -2147,10 +2333,12 @@
// CHECK-NEXT: "kind": "CXXUnresolvedConstructExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 876,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 878,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2166,10 +2354,12 @@
// CHECK-NEXT: "kind": "InitListExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 877,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 878,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2188,11 +2378,13 @@
// CHECK-NEXT: "kind": "BinaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 883,
// CHECK-NEXT: "line": 55,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 902,
// CHECK-NEXT: "col": 22,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2208,10 +2400,12 @@
// CHECK-NEXT: "kind": "CXXDependentScopeMemberExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 883,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 891,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: }
@@ -2228,10 +2422,12 @@
// CHECK-NEXT: "kind": "ParenExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 883,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 888,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2246,10 +2442,12 @@
// CHECK-NEXT: "kind": "UnaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 884,
// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 885,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -2267,10 +2465,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 885,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 885,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -2299,10 +2499,12 @@
// CHECK-NEXT: "kind": "CXXUnresolvedConstructExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 900,
// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 902,
// CHECK-NEXT: "col": 22,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2324,17 +2526,20 @@
// CHECK: "kind": "FunctionTemplateDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1049,
// CHECK-NEXT: "line": 65,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 36
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1022,
// CHECK-NEXT: "line": 64,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1173,
// CHECK-NEXT: "line": 68,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -2346,16 +2551,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TemplateTypeParmDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1041,
// CHECK-NEXT: "line": 64,
// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1032,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1041,
// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2370,16 +2578,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1049,
// CHECK-NEXT: "line": 65,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 36
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1044,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1173,
// CHECK-NEXT: "line": 68,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -2395,11 +2606,13 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1088,
// CHECK-NEXT: "line": 65,
// CHECK-NEXT: "col": 45,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1173,
// CHECK-NEXT: "line": 68,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -2411,11 +2624,13 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1092,
// CHECK-NEXT: "line": 66,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 36
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1135,
// CHECK-NEXT: "col": 46,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2425,21 +2640,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1132,
// CHECK-NEXT: "col": 43,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1092,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 36
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1132,
// CHECK-NEXT: "col": 43,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isReferenced": true,
// CHECK-NEXT: "name": "obj",
+// CHECK-NEXT: "mangledName": "_ZZ36TestDependentScopeTemplateMemberExprvE3obj",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "OtherDependentScopeMemberExprWrapper<T>"
// CHECK-NEXT: }
@@ -2451,11 +2670,13 @@
// CHECK-NEXT: "kind": "BinaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1139,
// CHECK-NEXT: "line": 67,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1170,
// CHECK-NEXT: "col": 34,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2471,10 +2692,12 @@
// CHECK-NEXT: "kind": "CXXDependentScopeMemberExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1139,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1162,
// CHECK-NEXT: "col": 26,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2492,10 +2715,12 @@
// CHECK-NEXT: "kind": "TemplateArgument",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1159,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1159,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -2511,10 +2736,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1139,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1139,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -2539,10 +2766,12 @@
// CHECK-NEXT: "kind": "CXXScalarValueInitExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1166,
// CHECK-NEXT: "col": 30,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1170,
// CHECK-NEXT: "col": 34,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2564,22 +2793,26 @@
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1214,
// CHECK-NEXT: "line": 75,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 17
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1209,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1253,
// CHECK-NEXT: "line": 78,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "TestUnionInitList",
+// CHECK-NEXT: "mangledName": "_Z17TestUnionInitListv",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: },
@@ -2589,11 +2822,13 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1234,
// CHECK-NEXT: "line": 76,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1253,
// CHECK-NEXT: "line": 78,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -2605,11 +2840,13 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1238,
// CHECK-NEXT: "line": 77,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1251,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2619,20 +2856,24 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1240,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1238,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1250,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "us",
+// CHECK-NEXT: "mangledName": "_ZZ17TestUnionInitListvE2us",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "U [3]"
// CHECK-NEXT: },
@@ -2643,10 +2884,12 @@
// CHECK-NEXT: "kind": "InitListExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1248,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1250,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2661,10 +2904,12 @@
// CHECK-NEXT: "kind": "InitListExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1250,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1250,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2687,10 +2932,12 @@
// CHECK-NEXT: "kind": "InitListExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1249,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1249,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2713,10 +2960,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1249,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1249,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2743,22 +2992,26 @@
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1261,
// CHECK-NEXT: "line": 80,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 10
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1256,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1307,
// CHECK-NEXT: "line": 83,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "TestSwitch",
+// CHECK-NEXT: "mangledName": "_Z10TestSwitchi",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (int)"
// CHECK-NEXT: },
@@ -2767,22 +3020,26 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1276,
// CHECK-NEXT: "line": 80,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1272,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1276,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "i",
+// CHECK-NEXT: "mangledName": "_ZZ10TestSwitchiE1i",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: }
@@ -2792,10 +3049,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1279,
// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1307,
// CHECK-NEXT: "line": 83,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -2807,11 +3066,13 @@
// CHECK-NEXT: "kind": "SwitchStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1283,
// CHECK-NEXT: "line": 81,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1305,
// CHECK-NEXT: "line": 82,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
@@ -2824,11 +3085,13 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1291,
// CHECK-NEXT: "line": 81,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1296,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2838,20 +3101,24 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1295,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1291,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1295,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "mangledName": "_ZZ10TestSwitchiE1a",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: }
@@ -2863,10 +3130,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1298,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1298,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2882,10 +3151,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1298,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1298,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2910,11 +3181,13 @@
// CHECK-NEXT: "kind": "NullStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1305,
// CHECK-NEXT: "line": 82,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1305,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2930,22 +3203,26 @@
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1315,
// CHECK-NEXT: "line": 85,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1310,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1456,
// CHECK-NEXT: "line": 96,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "TestIf",
+// CHECK-NEXT: "mangledName": "_Z6TestIfb",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (bool)"
// CHECK-NEXT: },
@@ -2954,22 +3231,26 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1327,
// CHECK-NEXT: "line": 85,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1322,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1327,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isReferenced": true,
// CHECK-NEXT: "name": "b",
+// CHECK-NEXT: "mangledName": "_ZZ6TestIfbE1b",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "bool"
// CHECK-NEXT: }
@@ -2979,10 +3260,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1330,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1456,
// CHECK-NEXT: "line": 96,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -2994,11 +3277,13 @@
// CHECK-NEXT: "kind": "IfStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1334,
// CHECK-NEXT: "line": 86,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1363,
// CHECK-NEXT: "line": 87,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
@@ -3011,11 +3296,13 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1338,
// CHECK-NEXT: "line": 86,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1354,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3025,21 +3312,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1348,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1338,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1352,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isReferenced": true,
// CHECK-NEXT: "name": "i",
+// CHECK-NEXT: "mangledName": "_ZZ6TestIfbE1i",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "const int"
// CHECK-NEXT: },
@@ -3050,10 +3341,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1352,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1352,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -3073,10 +3366,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1356,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1356,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3092,10 +3387,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1356,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1356,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3111,10 +3408,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1356,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1356,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3142,11 +3441,13 @@
// CHECK-NEXT: "kind": "NullStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1363,
// CHECK-NEXT: "line": 87,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1363,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3159,11 +3460,13 @@
// CHECK-NEXT: "kind": "IfStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1368,
// CHECK-NEXT: "line": 89,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1402,
// CHECK-NEXT: "line": 90,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
@@ -3176,11 +3479,13 @@
// CHECK-NEXT: "kind": "ConstantExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1382,
// CHECK-NEXT: "line": 89,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1395,
// CHECK-NEXT: "col": 30,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3196,10 +3501,12 @@
// CHECK-NEXT: "kind": "BinaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1382,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1395,
// CHECK-NEXT: "col": 30,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3215,10 +3522,12 @@
// CHECK-NEXT: "kind": "UnaryExprOrTypeTraitExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1382,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1390,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3234,10 +3543,12 @@
// CHECK-NEXT: "kind": "ParenExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1388,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1390,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3252,10 +3563,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1389,
// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1389,
// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3283,10 +3596,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1395,
// CHECK-NEXT: "col": 30,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1395,
// CHECK-NEXT: "col": 30,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3302,10 +3617,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1395,
// CHECK-NEXT: "col": 30,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1395,
// CHECK-NEXT: "col": 30,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3327,11 +3644,13 @@
// CHECK-NEXT: "kind": "NullStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1402,
// CHECK-NEXT: "line": 90,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1402,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3344,11 +3663,13 @@
// CHECK-NEXT: "kind": "IfStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1407,
// CHECK-NEXT: "line": 92,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1454,
// CHECK-NEXT: "line": 95,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
@@ -3362,11 +3683,13 @@
// CHECK-NEXT: "kind": "ConstantExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1421,
// CHECK-NEXT: "line": 92,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1434,
// CHECK-NEXT: "col": 30,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3382,10 +3705,12 @@
// CHECK-NEXT: "kind": "BinaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1421,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1434,
// CHECK-NEXT: "col": 30,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3401,10 +3726,12 @@
// CHECK-NEXT: "kind": "UnaryExprOrTypeTraitExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1421,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1429,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3420,10 +3747,12 @@
// CHECK-NEXT: "kind": "ParenExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1427,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1429,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3438,10 +3767,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1428,
// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1428,
// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3469,10 +3800,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1434,
// CHECK-NEXT: "col": 30,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1434,
// CHECK-NEXT: "col": 30,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3488,10 +3821,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1434,
// CHECK-NEXT: "col": 30,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1434,
// CHECK-NEXT: "col": 30,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3513,11 +3848,13 @@
// CHECK-NEXT: "kind": "NullStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1441,
// CHECK-NEXT: "line": 93,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1441,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3528,11 +3865,13 @@
// CHECK-NEXT: "kind": "NullStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1454,
// CHECK-NEXT: "line": 95,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1454,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3548,22 +3887,26 @@
// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1529,
// CHECK-NEXT: "line": 103,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 13
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1524,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1706,
// CHECK-NEXT: "line": 117,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "TestIteration",
+// CHECK-NEXT: "mangledName": "_Z13TestIterationv",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
// CHECK-NEXT: },
@@ -3573,11 +3916,13 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1545,
// CHECK-NEXT: "line": 103,
// CHECK-NEXT: "col": 22,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1706,
// CHECK-NEXT: "line": 117,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -3589,11 +3934,13 @@
// CHECK-NEXT: "kind": "ForStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1549,
// CHECK-NEXT: "line": 104,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1585,
// CHECK-NEXT: "line": 105,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
@@ -3605,11 +3952,13 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1554,
// CHECK-NEXT: "line": 104,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1563,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3619,21 +3968,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1558,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1554,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1562,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "i",
+// CHECK-NEXT: "mangledName": "_ZZ13TestIterationvE1i",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
@@ -3644,10 +3997,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1562,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1562,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3667,10 +4022,12 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1565,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1573,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3680,21 +4037,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1569,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1565,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1573,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "j",
+// CHECK-NEXT: "mangledName": "_ZZ13TestIterationvE1j",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
@@ -3705,10 +4066,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1573,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1573,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3724,10 +4087,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1573,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1573,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3756,10 +4121,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1569,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1569,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3775,10 +4142,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1569,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1569,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3794,10 +4163,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1569,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1569,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3824,10 +4195,12 @@
// CHECK-NEXT: "kind": "UnaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1576,
// CHECK-NEXT: "col": 30,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1578,
// CHECK-NEXT: "col": 32,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3844,10 +4217,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1578,
// CHECK-NEXT: "col": 32,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1578,
// CHECK-NEXT: "col": 32,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3872,11 +4247,13 @@
// CHECK-NEXT: "kind": "NullStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1585,
// CHECK-NEXT: "line": 105,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1585,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3889,11 +4266,13 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1590,
// CHECK-NEXT: "line": 107,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1602,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -3903,21 +4282,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1594,
// CHECK-NEXT: "col": 7,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1590,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1601,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "vals",
+// CHECK-NEXT: "mangledName": "_ZZ13TestIterationvE4vals",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int [10]"
// CHECK-NEXT: }
@@ -3929,11 +4312,13 @@
// CHECK-NEXT: "kind": "CXXForRangeStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1606,
// CHECK-NEXT: "line": 108,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1629,
// CHECK-NEXT: "line": 109,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
@@ -3946,11 +4331,13 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1619,
// CHECK-NEXT: "line": 108,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1619,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -3960,15 +4347,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1619,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1619,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1619,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -3976,6 +4366,7 @@
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "__range1",
+// CHECK-NEXT: "mangledName": "_ZZ13TestIterationvE8__range1",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int (&)[10]"
// CHECK-NEXT: },
@@ -3986,10 +4377,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1619,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1619,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -4016,10 +4409,12 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4029,15 +4424,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4045,6 +4443,7 @@
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "__begin1",
+// CHECK-NEXT: "mangledName": "_ZZ13TestIterationvE8__begin1",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "desugaredQualType": "int *",
// CHECK-NEXT: "qualType": "int *"
@@ -4056,10 +4455,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4075,10 +4476,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4107,10 +4510,12 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4120,15 +4525,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1619,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -4136,6 +4544,7 @@
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "__end1",
+// CHECK-NEXT: "mangledName": "_ZZ13TestIterationvE6__end1",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "desugaredQualType": "int *",
// CHECK-NEXT: "qualType": "int *"
@@ -4147,10 +4556,12 @@
// CHECK-NEXT: "kind": "BinaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1619,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -4166,10 +4577,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4185,10 +4598,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4213,10 +4628,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1619,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1619,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -4238,10 +4655,12 @@
// CHECK-NEXT: "kind": "BinaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4257,10 +4676,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4277,10 +4698,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4307,10 +4730,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4327,10 +4752,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4359,10 +4786,12 @@
// CHECK-NEXT: "kind": "UnaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4380,10 +4809,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4410,10 +4841,12 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1611,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1623,
// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4423,20 +4856,24 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1615,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1611,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "v",
+// CHECK-NEXT: "mangledName": "_ZZ13TestIterationvE1v",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
@@ -4447,10 +4884,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4466,10 +4905,12 @@
// CHECK-NEXT: "kind": "UnaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4487,10 +4928,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4507,10 +4950,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1617,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4545,11 +4990,13 @@
// CHECK-NEXT: "kind": "NullStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1629,
// CHECK-NEXT: "line": 109,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1629,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4562,11 +5009,13 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1634,
// CHECK-NEXT: "line": 111,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 9
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1645,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4576,21 +5025,25 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1644,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1634,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 9
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1644,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "C",
+// CHECK-NEXT: "mangledName": "_ZZ13TestIterationvE1C",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "Container"
// CHECK-NEXT: },
@@ -4601,10 +5054,12 @@
// CHECK-NEXT: "kind": "CXXConstructExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1644,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1644,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4628,11 +5083,13 @@
// CHECK-NEXT: "kind": "CXXForRangeStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1649,
// CHECK-NEXT: "line": 112,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1669,
// CHECK-NEXT: "line": 113,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
@@ -4645,11 +5102,13 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1662,
// CHECK-NEXT: "line": 112,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1662,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4659,15 +5118,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1662,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1662,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1662,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4675,6 +5137,7 @@
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "__range1",
+// CHECK-NEXT: "mangledName": "_ZZ13TestIterationvE8__range1_0",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "Container &"
// CHECK-NEXT: },
@@ -4685,10 +5148,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1662,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1662,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4715,10 +5180,12 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4728,15 +5195,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4744,6 +5214,7 @@
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "__begin1",
+// CHECK-NEXT: "mangledName": "_ZZ13TestIterationvE8__begin1_0",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "desugaredQualType": "int *",
// CHECK-NEXT: "qualType": "int *"
@@ -4755,10 +5226,12 @@
// CHECK-NEXT: "kind": "CXXMemberCallExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4773,10 +5246,12 @@
// CHECK-NEXT: "kind": "MemberExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4794,10 +5269,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4813,10 +5290,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4849,10 +5328,12 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4862,15 +5343,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4878,6 +5362,7 @@
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "__end1",
+// CHECK-NEXT: "mangledName": "_ZZ13TestIterationvE6__end1_0",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "desugaredQualType": "int *",
// CHECK-NEXT: "qualType": "int *"
@@ -4889,10 +5374,12 @@
// CHECK-NEXT: "kind": "CXXMemberCallExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4907,10 +5394,12 @@
// CHECK-NEXT: "kind": "MemberExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4928,10 +5417,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4947,10 +5438,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -4983,10 +5476,12 @@
// CHECK-NEXT: "kind": "BinaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5002,10 +5497,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5022,10 +5519,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5052,10 +5551,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5072,10 +5573,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5104,10 +5607,12 @@
// CHECK-NEXT: "kind": "UnaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5125,10 +5630,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5155,10 +5662,12 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1654,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1663,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5168,20 +5677,24 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1658,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1654,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "v",
+// CHECK-NEXT: "mangledName": "_ZZ13TestIterationvE1v_0",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
@@ -5192,10 +5705,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5211,10 +5726,12 @@
// CHECK-NEXT: "kind": "UnaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5232,10 +5749,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5252,10 +5771,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1660,
// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5290,11 +5811,13 @@
// CHECK-NEXT: "kind": "NullStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1669,
// CHECK-NEXT: "line": 113,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1669,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5307,11 +5830,13 @@
// CHECK-NEXT: "kind": "CXXForRangeStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1674,
// CHECK-NEXT: "line": 115,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1704,
// CHECK-NEXT: "line": 116,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
@@ -5323,11 +5848,13 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1679,
// CHECK-NEXT: "line": 115,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1684,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5337,20 +5864,24 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1683,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1679,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1683,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "mangledName": "_ZZ13TestIterationvE1a",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: }
@@ -5362,10 +5893,12 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1694,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1694,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -5375,15 +5908,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1694,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1694,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1694,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -5391,6 +5927,7 @@
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "__range1",
+// CHECK-NEXT: "mangledName": "_ZZ13TestIterationvE8__range1_1",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int (&)[10]"
// CHECK-NEXT: },
@@ -5401,10 +5938,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1694,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1694,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -5431,10 +5970,12 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1692,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1692,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5444,15 +5985,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1692,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1692,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1692,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5460,6 +6004,7 @@
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "__begin1",
+// CHECK-NEXT: "mangledName": "_ZZ13TestIterationvE8__begin1_1",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "desugaredQualType": "int *",
// CHECK-NEXT: "qualType": "int *"
@@ -5471,10 +6016,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1692,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1692,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5490,10 +6037,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1692,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1692,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5522,10 +6071,12 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1692,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1692,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5535,15 +6086,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1692,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1692,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1694,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -5551,6 +6105,7 @@
// CHECK-NEXT: "isImplicit": true,
// CHECK-NEXT: "isUsed": true,
// CHECK-NEXT: "name": "__end1",
+// CHECK-NEXT: "mangledName": "_ZZ13TestIterationvE6__end1_1",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "desugaredQualType": "int *",
// CHECK-NEXT: "qualType": "int *"
@@ -5562,10 +6117,12 @@
// CHECK-NEXT: "kind": "BinaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1692,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1694,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -5581,10 +6138,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1692,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1692,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5600,10 +6159,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1692,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1692,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5628,10 +6189,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1694,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1694,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -5653,10 +6216,12 @@
// CHECK-NEXT: "kind": "BinaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1692,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1692,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5672,10 +6237,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1692,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1692,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5692,10 +6259,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1692,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1692,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5722,10 +6291,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1692,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1692,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5742,10 +6313,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1692,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1692,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5774,10 +6347,12 @@
// CHECK-NEXT: "kind": "UnaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1692,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1692,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5795,10 +6370,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1692,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1692,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5825,10 +6402,12 @@
// CHECK-NEXT: "kind": "DeclStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1686,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1698,
// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5838,20 +6417,24 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1690,
// CHECK-NEXT: "col": 19,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1686,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1692,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "v",
+// CHECK-NEXT: "mangledName": "_ZZ13TestIterationvE1v_1",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
@@ -5862,10 +6445,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1692,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1692,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5881,10 +6466,12 @@
// CHECK-NEXT: "kind": "UnaryOperator",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1692,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1692,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5902,10 +6489,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1692,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1692,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5922,10 +6511,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1692,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1692,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5960,11 +6551,13 @@
// CHECK-NEXT: "kind": "NullStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1704,
// CHECK-NEXT: "line": 116,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1704,
// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -5980,17 +6573,20 @@
// CHECK: "kind": "FunctionTemplateDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1737,
// CHECK-NEXT: "line": 120,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 33
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1709,
// CHECK-NEXT: "line": 119,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1844,
// CHECK-NEXT: "line": 123,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -6002,16 +6598,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TemplateTypeParmDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1728,
// CHECK-NEXT: "line": 119,
// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1719,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1728,
// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -6026,16 +6625,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1737,
// CHECK-NEXT: "line": 120,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 33
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1732,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1844,
// CHECK-NEXT: "line": 123,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -6050,22 +6652,26 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 1774,
// CHECK-NEXT: "line": 120,
// CHECK-NEXT: "col": 43,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1771,
// CHECK-NEXT: "col": 40,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1774,
// CHECK-NEXT: "col": 43,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "isReferenced": true,
// CHECK-NEXT: "name": "T",
+// CHECK-NEXT: "mangledName": "_ZZ33TestDependentGenericSelectionExprT_E1T",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "Ty"
// CHECK-NEXT: }
@@ -6075,10 +6681,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1777,
// CHECK-NEXT: "col": 46,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1844,
// CHECK-NEXT: "line": 123,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -6090,11 +6698,13 @@
// CHECK-NEXT: "kind": "GenericSelectionExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1781,
// CHECK-NEXT: "line": 121,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1813,
// CHECK-NEXT: "col": 35,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6110,10 +6720,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1790,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1790,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6163,10 +6775,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1799,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1799,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6187,10 +6801,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1812,
// CHECK-NEXT: "col": 34,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1812,
// CHECK-NEXT: "col": 34,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6210,11 +6826,13 @@
// CHECK-NEXT: "kind": "GenericSelectionExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1818,
// CHECK-NEXT: "line": 122,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1841,
// CHECK-NEXT: "col": 26,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6230,10 +6848,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1827,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1827,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -6276,10 +6896,12 @@
// CHECK-NEXT: "kind": "IntegerLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1840,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1840,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
diff --git a/src/llvm-project/clang/test/AST/ast-dump-stmt-json.m b/src/llvm-project/clang/test/AST/ast-dump-stmt-json.m
index c419708..fc04067 100644
--- a/src/llvm-project/clang/test/AST/ast-dump-stmt-json.m
+++ b/src/llvm-project/clang/test/AST/ast-dump-stmt-json.m
@@ -22,195 +22,218 @@
// NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py
-// CHECK: "kind": "FunctionDecl",
+// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 3,
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 143,
+// CHECK-NEXT: "file": "{{.*}}",
+// CHECK-NEXT: "line": 3,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 13
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 138,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 5,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 177,
+// CHECK-NEXT: "line": 5,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "TestBlockExpr",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "TestBlockExpr",
+// CHECK-NEXT: "mangledName": "TestBlockExpr",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (int)"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 3,
-// CHECK-NEXT: "col": 24,
+// CHECK-NEXT: "offset": 161,
+// CHECK-NEXT: "line": 3,
+// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 20,
+// CHECK-NEXT: "offset": 157,
+// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 24,
+// CHECK-NEXT: "offset": 161,
+// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "isUsed": true,
-// CHECK-NEXT: "name": "x",
+// CHECK-NEXT: },
+// CHECK-NEXT: "isUsed": true,
+// CHECK-NEXT: "name": "x",
+// CHECK-NEXT: "mangledName": "x",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CompoundStmt",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 27,
+// CHECK-NEXT: "offset": 164,
+// CHECK-NEXT: "col": 27,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 5,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 177,
+// CHECK-NEXT: "line": 5,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ExprWithCleanups",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ExprWithCleanups",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 4,
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 168,
+// CHECK-NEXT: "line": 4,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "offset": 174,
+// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (^)(void)"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "cleanupsHaveSideEffects": true,
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "cleanupsHaveSideEffects": true,
// CHECK-NEXT: "cleanups": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "BlockDecl"
// CHECK-NEXT: }
-// CHECK-NEXT: ],
+// CHECK-NEXT: ],
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "BlockExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "BlockExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 168,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "offset": 174,
+// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (^)(void)"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "BlockDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "BlockDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 168,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 168,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "offset": 174,
+// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "kind": "Capture",
+// CHECK-NEXT: "kind": "Capture",
// CHECK-NEXT: "var": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "x",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "x",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: }
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CompoundStmt",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 4,
+// CHECK-NEXT: "offset": 169,
+// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "offset": 174,
+// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 171,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 171,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 171,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 171,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "const int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "x",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "x",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: }
@@ -232,195 +255,218 @@
// CHECK-NEXT: }
-// CHECK: "kind": "FunctionDecl",
+// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 7,
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 185,
+// CHECK-NEXT: "file": "{{.*}}",
+// CHECK-NEXT: "line": 7,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 19
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 180,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 9,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 225,
+// CHECK-NEXT: "line": 9,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "TestExprWithCleanup",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "TestExprWithCleanup",
+// CHECK-NEXT: "mangledName": "TestExprWithCleanup",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (int)"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 7,
-// CHECK-NEXT: "col": 30,
+// CHECK-NEXT: "offset": 209,
+// CHECK-NEXT: "line": 7,
+// CHECK-NEXT: "col": 30,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 26,
+// CHECK-NEXT: "offset": 205,
+// CHECK-NEXT: "col": 26,
// CHECK-NEXT: "tokLen": 3
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 30,
+// CHECK-NEXT: "offset": 209,
+// CHECK-NEXT: "col": 30,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "isUsed": true,
-// CHECK-NEXT: "name": "x",
+// CHECK-NEXT: },
+// CHECK-NEXT: "isUsed": true,
+// CHECK-NEXT: "name": "x",
+// CHECK-NEXT: "mangledName": "x",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CompoundStmt",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 33,
+// CHECK-NEXT: "offset": 212,
+// CHECK-NEXT: "col": 33,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 9,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 225,
+// CHECK-NEXT: "line": 9,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ExprWithCleanups",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ExprWithCleanups",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 8,
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 216,
+// CHECK-NEXT: "line": 8,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "offset": 222,
+// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (^)(void)"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "cleanupsHaveSideEffects": true,
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "cleanupsHaveSideEffects": true,
// CHECK-NEXT: "cleanups": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "BlockDecl"
// CHECK-NEXT: }
-// CHECK-NEXT: ],
+// CHECK-NEXT: ],
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "BlockExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "BlockExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 216,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "offset": 222,
+// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (^)(void)"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "BlockDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "BlockDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 216,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 216,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "offset": 222,
+// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "kind": "Capture",
+// CHECK-NEXT: "kind": "Capture",
// CHECK-NEXT: "var": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "x",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "x",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: }
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CompoundStmt",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 4,
+// CHECK-NEXT: "offset": 217,
+// CHECK-NEXT: "col": 4,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "offset": 222,
+// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitCastExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 219,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 219,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "rvalue",
-// CHECK-NEXT: "castKind": "LValueToRValue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "rvalue",
+// CHECK-NEXT: "castKind": "LValueToRValue",
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "DeclRefExpr",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 219,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 219,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "const int"
-// CHECK-NEXT: },
-// CHECK-NEXT: "valueCategory": "lvalue",
+// CHECK-NEXT: },
+// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "referencedDecl": {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ParmVarDecl",
-// CHECK-NEXT: "name": "x",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ParmVarDecl",
+// CHECK-NEXT: "name": "x",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: }
@@ -442,242 +488,274 @@
// CHECK-NEXT: }
-// CHECK: "kind": "FunctionDecl",
+// CHECK: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "file": "{{.*}}",
-// CHECK-NEXT: "line": 14,
-// CHECK-NEXT: "col": 6,
+// CHECK-NEXT: "offset": 252,
+// CHECK-NEXT: "file": "{{.*}}",
+// CHECK-NEXT: "line": 14,
+// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 19
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 247,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 20,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 341,
+// CHECK-NEXT: "line": 20,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "TestObjCAtCatchStmt",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "TestObjCAtCatchStmt",
+// CHECK-NEXT: "mangledName": "TestObjCAtCatchStmt",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void ()"
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CompoundStmt",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 14,
-// CHECK-NEXT: "col": 28,
+// CHECK-NEXT: "offset": 274,
+// CHECK-NEXT: "line": 14,
+// CHECK-NEXT: "col": 28,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 20,
-// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "offset": 341,
+// CHECK-NEXT: "line": 20,
+// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCAtTryStmt",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCAtTryStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 15,
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 278,
+// CHECK-NEXT: "line": 15,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 19,
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 339,
+// CHECK-NEXT: "line": 19,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CompoundStmt",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 15,
-// CHECK-NEXT: "col": 8,
+// CHECK-NEXT: "offset": 283,
+// CHECK-NEXT: "line": 15,
+// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 16,
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 287,
+// CHECK-NEXT: "line": 16,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCAtCatchStmt",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCAtCatchStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 5,
+// CHECK-NEXT: "offset": 289,
+// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 17,
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 306,
+// CHECK-NEXT: "line": 17,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "VarDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "VarDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 16,
-// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "offset": 299,
+// CHECK-NEXT: "line": 16,
+// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 12,
+// CHECK-NEXT: "offset": 296,
+// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 15,
+// CHECK-NEXT: "offset": 299,
+// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "a",
+// CHECK-NEXT: "mangledName": "a",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "A *"
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CompoundStmt",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 18,
+// CHECK-NEXT: "offset": 302,
+// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 17,
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 306,
+// CHECK-NEXT: "line": 17,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCAtCatchStmt",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCAtCatchStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 5,
+// CHECK-NEXT: "offset": 308,
+// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 18,
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 324,
+// CHECK-NEXT: "line": 18,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "isCatchAll": true,
+// CHECK-NEXT: },
+// CHECK-NEXT: "isCatchAll": true,
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CompoundStmt",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 17,
-// CHECK-NEXT: "col": 17,
+// CHECK-NEXT: "offset": 320,
+// CHECK-NEXT: "line": 17,
+// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 18,
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 324,
+// CHECK-NEXT: "line": 18,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ObjCAtFinallyStmt",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ObjCAtFinallyStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 5,
+// CHECK-NEXT: "offset": 326,
+// CHECK-NEXT: "col": 5,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 19,
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 339,
+// CHECK-NEXT: "line": 19,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CapturedStmt",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CapturedStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 18,
-// CHECK-NEXT: "col": 14,
+// CHECK-NEXT: "offset": 335,
+// CHECK-NEXT: "line": 18,
+// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 19,
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 339,
+// CHECK-NEXT: "line": 19,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CapturedDecl",
-// CHECK-NEXT: "loc": {},
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CapturedDecl",
+// CHECK-NEXT: "loc": {},
// CHECK-NEXT: "range": {
-// CHECK-NEXT: "begin": {},
+// CHECK-NEXT: "begin": {},
// CHECK-NEXT: "end": {}
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "inner": [
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "CompoundStmt",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "line": 18,
-// CHECK-NEXT: "col": 14,
+// CHECK-NEXT: "offset": 335,
+// CHECK-NEXT: "line": 18,
+// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "line": 19,
-// CHECK-NEXT: "col": 3,
+// CHECK-NEXT: "offset": 339,
+// CHECK-NEXT: "line": 19,
+// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: }
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: {
-// CHECK-NEXT: "id": "0x{{.*}}",
-// CHECK-NEXT: "kind": "ImplicitParamDecl",
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "ImplicitParamDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "line": 18,
-// CHECK-NEXT: "col": 14,
+// CHECK-NEXT: "offset": 335,
+// CHECK-NEXT: "line": 18,
+// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
-// CHECK-NEXT: "col": 14,
+// CHECK-NEXT: "offset": 335,
+// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
-// CHECK-NEXT: },
+// CHECK-NEXT: },
// CHECK-NEXT: "end": {
-// CHECK-NEXT: "col": 14,
+// CHECK-NEXT: "offset": 335,
+// CHECK-NEXT: "col": 14,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
-// CHECK-NEXT: },
-// CHECK-NEXT: "isImplicit": true,
-// CHECK-NEXT: "name": "__context",
+// CHECK-NEXT: },
+// CHECK-NEXT: "isImplicit": true,
+// CHECK-NEXT: "name": "__context",
+// CHECK-NEXT: "mangledName": "__context",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "struct (anonymous at {{.*}}:18:14) *"
// CHECK-NEXT: }
diff --git a/src/llvm-project/clang/test/AST/ast-dump-template-decls-json.cpp b/src/llvm-project/clang/test/AST/ast-dump-template-decls-json.cpp
index a6825c0..5290d48 100644
--- a/src/llvm-project/clang/test/AST/ast-dump-template-decls-json.cpp
+++ b/src/llvm-project/clang/test/AST/ast-dump-template-decls-json.cpp
@@ -213,6 +213,7 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FunctionTemplateDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 142,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 4,
// CHECK-NEXT: "col": 6,
@@ -220,11 +221,13 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 114,
// CHECK-NEXT: "line": 3,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 146,
// CHECK-NEXT: "line": 4,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
@@ -236,16 +239,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TemplateTypeParmDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 133,
// CHECK-NEXT: "line": 3,
// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 124,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 133,
// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -260,16 +266,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 142,
// CHECK-NEXT: "line": 4,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 137,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 146,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -283,15 +292,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 146,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 144,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 144,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -308,17 +320,20 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FunctionTemplateDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 181,
// CHECK-NEXT: "line": 7,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 150,
// CHECK-NEXT: "line": 6,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 188,
// CHECK-NEXT: "line": 7,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
@@ -330,16 +345,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TemplateTypeParmDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 172,
// CHECK-NEXT: "line": 6,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 160,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 172,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -355,16 +373,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 181,
// CHECK-NEXT: "line": 7,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 176,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 188,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -378,15 +399,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 188,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 183,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 185,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -404,17 +428,20 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FunctionTemplateDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 230,
// CHECK-NEXT: "line": 10,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 192,
// CHECK-NEXT: "line": 9,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 234,
// CHECK-NEXT: "line": 10,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
@@ -426,16 +453,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TemplateTypeParmDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 208,
// CHECK-NEXT: "line": 9,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 202,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 208,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -450,15 +480,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TemplateTypeParmDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 221,
// CHECK-NEXT: "col": 30,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 212,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 221,
// CHECK-NEXT: "col": 30,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -472,16 +505,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 230,
// CHECK-NEXT: "line": 10,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 225,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 234,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -495,15 +531,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 234,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 232,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 232,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -528,17 +567,20 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 255,
// CHECK-NEXT: "line": 13,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 238,
// CHECK-NEXT: "line": 12,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 274,
// CHECK-NEXT: "line": 13,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
@@ -546,6 +588,7 @@
// CHECK-NEXT: },
// CHECK-NEXT: "previousDecl": "0x{{.*}}",
// CHECK-NEXT: "name": "c",
+// CHECK-NEXT: "mangledName": "_Z1cIfiEvT_",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "void (float)"
// CHECK-NEXT: },
@@ -566,15 +609,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 274,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 269,
// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 269,
// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: }
@@ -589,17 +635,20 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FunctionTemplateDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 338,
// CHECK-NEXT: "line": 16,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 278,
// CHECK-NEXT: "line": 15,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 350,
// CHECK-NEXT: "line": 16,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
@@ -611,16 +660,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TemplateTypeParmDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 297,
// CHECK-NEXT: "line": 15,
// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 288,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 297,
// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -635,15 +687,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TemplateTemplateParmDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 329,
// CHECK-NEXT: "col": 52,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 301,
// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 329,
// CHECK-NEXT: "col": 52,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -656,15 +711,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TemplateTypeParmDecl",
// CHECK-NEXT: "loc": {
-// CHECK-NEXT: "col": 33,
-// CHECK-NEXT: "tokLen": 8
+// CHECK-NEXT: "offset": 318,
+// CHECK-NEXT: "col": 41,
+// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 310,
// CHECK-NEXT: "col": 33,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 310,
// CHECK-NEXT: "col": 33,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: }
@@ -679,16 +737,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 338,
// CHECK-NEXT: "line": 16,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 333,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 350,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -702,15 +763,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 342,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 340,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 340,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -723,15 +787,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 350,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 344,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 349,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -748,17 +815,20 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FunctionTemplateDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 379,
// CHECK-NEXT: "line": 19,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 354,
// CHECK-NEXT: "line": 18,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 383,
// CHECK-NEXT: "line": 19,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
@@ -770,16 +840,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TemplateTypeParmDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 370,
// CHECK-NEXT: "line": 18,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 364,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 370,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -794,16 +867,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 379,
// CHECK-NEXT: "line": 19,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 374,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 383,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -817,15 +893,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 383,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 381,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 381,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -842,17 +921,20 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FunctionTemplateDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 409,
// CHECK-NEXT: "line": 22,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 387,
// CHECK-NEXT: "line": 21,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 420,
// CHECK-NEXT: "line": 22,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
@@ -864,16 +946,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "NonTypeTemplateParmDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 401,
// CHECK-NEXT: "line": 21,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 397,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 401,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -890,16 +975,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 409,
// CHECK-NEXT: "line": 22,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 404,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 420,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -913,20 +1001,24 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 415,
// CHECK-NEXT: "col": 12,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 411,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 419,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "i",
+// CHECK-NEXT: "mangledName": "_ZZ1fiE1i",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "qualType": "int"
// CHECK-NEXT: },
@@ -937,10 +1029,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 419,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 419,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -968,17 +1062,20 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FunctionTemplateDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 458,
// CHECK-NEXT: "line": 25,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 424,
// CHECK-NEXT: "line": 24,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 462,
// CHECK-NEXT: "line": 25,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
@@ -990,16 +1087,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TemplateTypeParmDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 443,
// CHECK-NEXT: "line": 24,
// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 434,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 448,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -1028,16 +1128,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 458,
// CHECK-NEXT: "line": 25,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 453,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 462,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1051,15 +1154,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ParmVarDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 462,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 460,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 460,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -1076,17 +1182,20 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FunctionTemplateDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 498,
// CHECK-NEXT: "line": 28,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 466,
// CHECK-NEXT: "line": 27,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 500,
// CHECK-NEXT: "line": 28,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
@@ -1098,16 +1207,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TemplateTypeParmDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 485,
// CHECK-NEXT: "line": 27,
-// CHECK-NEXT: "col": 11,
-// CHECK-NEXT: "tokLen": 8
+// CHECK-NEXT: "col": 20,
+// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 476,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 487,
// CHECK-NEXT: "col": 22,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -1134,16 +1246,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FunctionDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 498,
// CHECK-NEXT: "line": 28,
// CHECK-NEXT: "col": 6,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 493,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 500,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1159,17 +1274,20 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ClassTemplateDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 534,
// CHECK-NEXT: "line": 31,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 504,
// CHECK-NEXT: "line": 30,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 537,
// CHECK-NEXT: "line": 31,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
@@ -1181,16 +1299,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TemplateTypeParmDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 523,
// CHECK-NEXT: "line": 30,
// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 514,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 523,
// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -1204,16 +1325,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 534,
// CHECK-NEXT: "line": 31,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 527,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 537,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1275,15 +1399,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 534,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 527,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 534,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1305,17 +1432,20 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ClassTemplateSpecializationDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 560,
// CHECK-NEXT: "line": 34,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 541,
// CHECK-NEXT: "line": 33,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 568,
// CHECK-NEXT: "line": 34,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
@@ -1385,15 +1515,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 560,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 553,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 560,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1408,17 +1541,20 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ClassTemplateDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 612,
// CHECK-NEXT: "line": 37,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 572,
// CHECK-NEXT: "line": 36,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 615,
// CHECK-NEXT: "line": 37,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
@@ -1430,16 +1566,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TemplateTypeParmDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 591,
// CHECK-NEXT: "line": 36,
// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 582,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 591,
// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -1453,15 +1592,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TemplateTypeParmDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 601,
// CHECK-NEXT: "col": 30,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 595,
// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 5
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 601,
// CHECK-NEXT: "col": 30,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -1475,16 +1617,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 612,
// CHECK-NEXT: "line": 37,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 605,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 615,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1546,15 +1691,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 612,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 605,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 612,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1571,17 +1719,20 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ClassTemplatePartialSpecializationDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 649,
// CHECK-NEXT: "line": 40,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 619,
// CHECK-NEXT: "line": 39,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 661,
// CHECK-NEXT: "line": 40,
// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 1
@@ -1656,16 +1807,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TemplateTypeParmDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 638,
// CHECK-NEXT: "line": 39,
// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 629,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 638,
// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -1680,16 +1834,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 649,
// CHECK-NEXT: "line": 40,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 642,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 649,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1704,17 +1861,20 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ClassTemplateDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 688,
// CHECK-NEXT: "line": 43,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 665,
// CHECK-NEXT: "line": 42,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 691,
// CHECK-NEXT: "line": 43,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
@@ -1726,16 +1886,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "NonTypeTemplateParmDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 679,
// CHECK-NEXT: "line": 42,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 675,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 675,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -1750,16 +1913,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 688,
// CHECK-NEXT: "line": 43,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 681,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 691,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1821,15 +1987,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 688,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 681,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 688,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1846,17 +2015,20 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ClassTemplateDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 728,
// CHECK-NEXT: "line": 46,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 695,
// CHECK-NEXT: "line": 45,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 731,
// CHECK-NEXT: "line": 46,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
@@ -1868,16 +2040,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "NonTypeTemplateParmDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 719,
// CHECK-NEXT: "line": 45,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 705,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 705,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: }
@@ -1892,16 +2067,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 728,
// CHECK-NEXT: "line": 46,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 721,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 731,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1963,15 +2141,18 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 728,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 721,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 728,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1988,17 +2169,20 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "ClassTemplateDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 765,
// CHECK-NEXT: "line": 49,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 735,
// CHECK-NEXT: "line": 48,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 806,
// CHECK-NEXT: "line": 52,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -2010,16 +2194,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TemplateTypeParmDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 754,
// CHECK-NEXT: "line": 48,
// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 745,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 754,
// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -2033,16 +2220,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 765,
// CHECK-NEXT: "line": 49,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 758,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 806,
// CHECK-NEXT: "line": 52,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 1
@@ -2105,16 +2295,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXRecordDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 765,
// CHECK-NEXT: "line": 49,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 758,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 6
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 765,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2127,17 +2320,20 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FunctionTemplateDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 801,
// CHECK-NEXT: "line": 51,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 771,
// CHECK-NEXT: "line": 50,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 803,
// CHECK-NEXT: "line": 51,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
@@ -2149,16 +2345,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TemplateTypeParmDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 790,
// CHECK-NEXT: "line": 50,
// CHECK-NEXT: "col": 22,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 781,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 790,
// CHECK-NEXT: "col": 22,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -2172,16 +2371,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 801,
// CHECK-NEXT: "line": 51,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 796,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 803,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -2201,23 +2403,26 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "FunctionTemplateDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 868,
// CHECK-NEXT: "line": 56,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 833,
// CHECK-NEXT: "line": 55,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 873,
// CHECK-NEXT: "line": 56,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
-// CHECK-NEXT: "parentDeclContext": "0x{{.*}}",
+// CHECK-NEXT: "parentDeclContextId": "0x{{.*}}",
// CHECK-NEXT: "previousDecl": "0x{{.*}}",
// CHECK-NEXT: "name": "f",
// CHECK-NEXT: "inner": [
@@ -2225,16 +2430,19 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "TemplateTypeParmDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 852,
// CHECK-NEXT: "line": 55,
// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 843,
// CHECK-NEXT: "col": 11,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 852,
// CHECK-NEXT: "col": 20,
// CHECK-NEXT: "tokLen": 2
// CHECK-NEXT: }
@@ -2248,23 +2456,26 @@
// CHECK-NEXT: "id": "0x{{.*}}",
// CHECK-NEXT: "kind": "CXXMethodDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 868,
// CHECK-NEXT: "line": 56,
// CHECK-NEXT: "col": 13,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 810,
// CHECK-NEXT: "line": 54,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 8
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 873,
// CHECK-NEXT: "line": 56,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
-// CHECK-NEXT: "parentDeclContext": "0x{{.*}}",
+// CHECK-NEXT: "parentDeclContextId": "0x{{.*}}",
// CHECK-NEXT: "previousDecl": "0x{{.*}}",
// CHECK-NEXT: "name": "f",
// CHECK-NEXT: "type": {
@@ -2276,10 +2487,12 @@
// CHECK-NEXT: "kind": "CompoundStmt",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 872,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 873,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
diff --git a/src/llvm-project/clang/test/AST/ast-dump-template-decls.cpp b/src/llvm-project/clang/test/AST/ast-dump-template-decls.cpp
index a1f355b..2fa50d8 100644
--- a/src/llvm-project/clang/test/AST/ast-dump-template-decls.cpp
+++ b/src/llvm-project/clang/test/AST/ast-dump-template-decls.cpp
@@ -26,7 +26,7 @@
// CHECK: FunctionTemplateDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+4]]:18> col:6 d
// CHECK-NEXT: TemplateTypeParmDecl 0x{{[^ ]*}} <line:[[@LINE-2]]:11, col:20> col:20 referenced typename depth 0 index 0 Ty
// CHECK-NEXT: TemplateTemplateParmDecl 0x{{[^ ]*}} <col:24, col:52> col:52 depth 0 index 1 Uy
-// CHECK-NEXT: TemplateTypeParmDecl 0x{{[^ ]*}} <col:33> col:33 typename depth 1 index 0
+// CHECK-NEXT: TemplateTypeParmDecl 0x{{[^ ]*}} <col:33> col:41 typename depth 1 index 0
void d(Ty, Uy<Ty>);
template <class Ty>
@@ -47,7 +47,7 @@
template <typename = void>
// CHECK: FunctionTemplateDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:8> col:6 h
-// CHECK-NEXT: TemplateTypeParmDecl 0x{{[^ ]*}} <line:[[@LINE-2]]:11, col:22> col:11 typename depth 0 index 0
+// CHECK-NEXT: TemplateTypeParmDecl 0x{{[^ ]*}} <line:[[@LINE-2]]:11, col:22> col:20 typename depth 0 index 0
// CHECK-NEXT: TemplateArgument type 'void'
void h();
diff --git a/src/llvm-project/clang/test/AST/ast-dump-temporaries-json.cpp b/src/llvm-project/clang/test/AST/ast-dump-temporaries-json.cpp
index 3f1459b..520d6f9 100644
--- a/src/llvm-project/clang/test/AST/ast-dump-temporaries-json.cpp
+++ b/src/llvm-project/clang/test/AST/ast-dump-temporaries-json.cpp
@@ -25,10 +25,12 @@
// CHECK: "kind": "ExprWithCleanups",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 184,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 186,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -44,10 +46,12 @@
// CHECK-NEXT: "kind": "MaterializeTemporaryExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 184,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 186,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -72,10 +76,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 184,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 186,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -91,10 +97,12 @@
// CHECK-NEXT: "kind": "CXXBindTemporaryExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 184,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 186,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -118,10 +126,12 @@
// CHECK-NEXT: "kind": "CXXTemporaryObjectExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 184,
// CHECK-NEXT: "col": 16,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 186,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -149,10 +159,12 @@
// CHECK: "kind": "ExprWithCleanups",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 234,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 234,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -167,10 +179,12 @@
// CHECK-NEXT: "kind": "MaterializeTemporaryExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 234,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 234,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -195,10 +209,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 234,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 234,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -214,10 +230,12 @@
// CHECK-NEXT: "kind": "FloatingLiteral",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 234,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 234,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 3
// CHECK-NEXT: }
@@ -239,11 +257,13 @@
// CHECK: "kind": "ExprWithCleanups",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 260,
// CHECK-NEXT: "line": 18,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 266,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -258,10 +278,12 @@
// CHECK-NEXT: "kind": "CallExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 260,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 266,
// CHECK-NEXT: "col": 9,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -276,10 +298,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 260,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 260,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -295,10 +319,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 260,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 260,
// CHECK-NEXT: "col": 3,
// CHECK-NEXT: "tokLen": 4
// CHECK-NEXT: }
@@ -323,10 +349,12 @@
// CHECK-NEXT: "kind": "MaterializeTemporaryExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 265,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 265,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -343,10 +371,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 265,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 265,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -362,10 +392,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 265,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 265,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -381,10 +413,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 265,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 265,
// CHECK-NEXT: "col": 8,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
diff --git a/src/llvm-project/clang/test/AST/ast-dump-types-json.cpp b/src/llvm-project/clang/test/AST/ast-dump-types-json.cpp
index 8b9bdd5..36cbb92 100644
--- a/src/llvm-project/clang/test/AST/ast-dump-types-json.cpp
+++ b/src/llvm-project/clang/test/AST/ast-dump-types-json.cpp
@@ -20,11 +20,17 @@
typedef int TestQualTypePrinting(const char* c);
+typedef int TestUsingShadowDeclType;
+namespace TestNamespaceWithUsingShadowType {
+using ::TestUsingShadowDeclType;
+}
+
// NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py
// CHECK: "kind": "TypedefDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 204,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 12,
// CHECK-NEXT: "col": 18,
@@ -32,10 +38,12 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 187,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 7
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 204,
// CHECK-NEXT: "col": 18,
// CHECK-NEXT: "tokLen": 19
// CHECK-NEXT: }
@@ -73,6 +81,7 @@
// CHECK: "kind": "TypedefDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 239,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 13,
// CHECK-NEXT: "col": 15,
@@ -80,10 +89,12 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 225,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 7
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 239,
// CHECK-NEXT: "col": 15,
// CHECK-NEXT: "tokLen": 19
// CHECK-NEXT: }
@@ -122,6 +133,7 @@
// CHECK: "kind": "TypedefDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 319,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 16,
// CHECK-NEXT: "col": 22,
@@ -129,10 +141,12 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 298,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 7
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 319,
// CHECK-NEXT: "col": 22,
// CHECK-NEXT: "tokLen": 22
// CHECK-NEXT: }
@@ -228,6 +242,7 @@
// CHECK: "kind": "TypedefDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 366,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 18,
// CHECK-NEXT: "col": 20,
@@ -235,10 +250,12 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 347,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 7
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 397,
// CHECK-NEXT: "col": 51,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -302,6 +319,7 @@
// CHECK: "kind": "TypedefDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 416,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 19,
// CHECK-NEXT: "col": 17,
@@ -309,10 +327,12 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 400,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 7
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 416,
// CHECK-NEXT: "col": 17,
// CHECK-NEXT: "tokLen": 25
// CHECK-NEXT: }
@@ -357,6 +377,7 @@
// CHECK: "kind": "TypedefDecl",
// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 456,
// CHECK-NEXT: "file": "{{.*}}",
// CHECK-NEXT: "line": 21,
// CHECK-NEXT: "col": 13,
@@ -364,10 +385,12 @@
// CHECK-NEXT: },
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 444,
// CHECK-NEXT: "col": 1,
// CHECK-NEXT: "tokLen": 7
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 490,
// CHECK-NEXT: "col": 47,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -422,3 +445,121 @@
// CHECK-NEXT: }
// CHECK-NEXT: ]
// CHECK-NEXT: }
+
+
+// CHECK: "kind": "TypedefDecl",
+// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 506,
+// CHECK-NEXT: "file": "{{.*}}",
+// CHECK-NEXT: "line": 23,
+// CHECK-NEXT: "col": 13,
+// CHECK-NEXT: "tokLen": 23
+// CHECK-NEXT: },
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 494,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 7
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 506,
+// CHECK-NEXT: "col": 13,
+// CHECK-NEXT: "tokLen": 23
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "TestUsingShadowDeclType",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: },
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "BuiltinType",
+// CHECK-NEXT: "type": {
+// CHECK-NEXT: "qualType": "int"
+// CHECK-NEXT: }
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+
+
+// CHECK: "kind": "NamespaceDecl",
+// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 541,
+// CHECK-NEXT: "file": "{{.*}}",
+// CHECK-NEXT: "line": 24,
+// CHECK-NEXT: "col": 11,
+// CHECK-NEXT: "tokLen": 32
+// CHECK-NEXT: },
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 531,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 9
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 609,
+// CHECK-NEXT: "line": 26,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 1
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "TestNamespaceWithUsingShadowType",
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "UsingDecl",
+// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 584,
+// CHECK-NEXT: "line": 25,
+// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "tokLen": 23
+// CHECK-NEXT: },
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 576,
+// CHECK-NEXT: "col": 1,
+// CHECK-NEXT: "tokLen": 5
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 584,
+// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "tokLen": 23
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "name": "::TestUsingShadowDeclType"
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "UsingShadowDecl",
+// CHECK-NEXT: "loc": {
+// CHECK-NEXT: "offset": 584,
+// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "tokLen": 23
+// CHECK-NEXT: },
+// CHECK-NEXT: "range": {
+// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 584,
+// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "tokLen": 23
+// CHECK-NEXT: },
+// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 584,
+// CHECK-NEXT: "col": 9,
+// CHECK-NEXT: "tokLen": 23
+// CHECK-NEXT: }
+// CHECK-NEXT: },
+// CHECK-NEXT: "isImplicit": true,
+// CHECK-NEXT: "target": {
+// CHECK-NEXT: "id": "0x{{.*}}",
+// CHECK-NEXT: "kind": "TypedefDecl",
+// CHECK-NEXT: "name": "TestUsingShadowDeclType"
+// CHECK-NEXT: },
+// CHECK-NEXT: "inner": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "id": "0x0"
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
diff --git a/src/llvm-project/clang/test/AST/ast-print-attr.c b/src/llvm-project/clang/test/AST/ast-print-attr.c
index 223e27b..d223d60 100644
--- a/src/llvm-project/clang/test/AST/ast-print-attr.c
+++ b/src/llvm-project/clang/test/AST/ast-print-attr.c
@@ -10,3 +10,8 @@
// FIXME: Too many parens here!
// CHECK: using C = int ((*))() __attribute__((cdecl));
using C = int (*)() [[gnu::cdecl]];
+
+// CHECK: int fun_asm() asm("test");
+int fun_asm() asm("test");
+// CHECK: int var_asm asm("test");
+int var_asm asm("test");
diff --git a/src/llvm-project/clang/test/AST/ast-print-pragmas.cpp b/src/llvm-project/clang/test/AST/ast-print-pragmas.cpp
index a87be2a..7bd0b48 100644
--- a/src/llvm-project/clang/test/AST/ast-print-pragmas.cpp
+++ b/src/llvm-project/clang/test/AST/ast-print-pragmas.cpp
@@ -17,10 +17,12 @@
// CHECK: #pragma clang loop distribute(disable)
// CHECK-NEXT: #pragma clang loop vectorize(enable)
// CHECK-NEXT: #pragma clang loop interleave(disable)
+// CHECK-NEXT: #pragma clang loop vectorize_predicate(disable)
#pragma clang loop distribute(disable)
#pragma clang loop vectorize(enable)
#pragma clang loop interleave(disable)
+#pragma clang loop vectorize_predicate(disable)
// CHECK-NEXT: while (i - 1 < Length)
while (i - 1 < Length) {
List[i] = i * 2;
@@ -30,10 +32,12 @@
// CHECK: #pragma clang loop distribute(enable)
// CHECK-NEXT: #pragma clang loop vectorize(disable)
// CHECK-NEXT: #pragma clang loop interleave(enable)
+// CHECK-NEXT: #pragma clang loop vectorize_predicate(enable)
#pragma clang loop distribute(enable)
#pragma clang loop vectorize(disable)
#pragma clang loop interleave(enable)
+#pragma clang loop vectorize_predicate(enable)
// CHECK-NEXT: while (i - 2 < Length)
while (i - 2 < Length) {
List[i] = i * 2;
diff --git a/src/llvm-project/clang/test/AST/atomic-expr.cpp b/src/llvm-project/clang/test/AST/atomic-expr.cpp
new file mode 100644
index 0000000..e7fb6ba
--- /dev/null
+++ b/src/llvm-project/clang/test/AST/atomic-expr.cpp
@@ -0,0 +1,60 @@
+// RUN: %clang_cc1 -ast-dump %s | FileCheck %s
+
+template<int N = 0>
+void pr43370() {
+ int arr[2];
+ __atomic_store_n(arr, 0, 5);
+}
+
+template<int N = 0>
+void foo() {
+ int arr[2];
+ (void)__atomic_compare_exchange_n(arr, arr, 1, 0, 3, 4);
+}
+
+void useage(){
+ pr43370();
+ foo();
+}
+
+// CHECK:FunctionTemplateDecl 0x{{[0-9a-f]+}} <{{[^,]+}}, line:7:1> line:4:6 pr43370
+// CHECK: AtomicExpr
+// CHECK-NEXT: ImplicitCastExpr
+// CHECK-SAME: <ArrayToPointerDecay>
+// CHECK-NEXT: DeclRefExpr 0x{{[0-9a-f]+}} <{{[^:]+}}:20> 'int [2]' lvalue Var 0x{{[0-9a-f]+}} 'arr' 'int [2]'
+// CHECK-NEXT: IntegerLiteral 0x{{[0-9a-f]+}} <{{[^:]+}}:28> 'int' 5
+// CHECK-NEXT: IntegerLiteral 0x{{[0-9a-f]+}} <{{[^:]+}}:25> 'int' 0
+// CHECK:FunctionDecl 0x{{[0-9a-f]+}} <line:4:1, line:7:1> line:4:6 used pr43370
+// CHECK: AtomicExpr
+// CHECK-NEXT: ImplicitCastExpr
+// CHECK-SAME: <ArrayToPointerDecay>
+// CHECK-NEXT: DeclRefExpr 0x{{[0-9a-f]+}} <{{[^:]+}}:20> 'int [2]' lvalue Var 0x{{[0-9a-f]+}} 'arr' 'int [2]'
+// CHECK-NEXT: IntegerLiteral 0x{{[0-9a-f]+}} <{{[^:]+}}:28> 'int' 5
+// CHECK-NEXT: IntegerLiteral 0x{{[0-9a-f]+}} <{{[^:]+}}:25> 'int' 0
+
+// CHECK:FunctionTemplateDecl 0x{{[0-9a-f]+}} <line:9:1, line:13:1> line:10:6 foo
+// CHECK: AtomicExpr
+// CHECK-NEXT: ImplicitCastExpr
+// CHECK-SAME: <ArrayToPointerDecay>
+// CHECK-NEXT: DeclRefExpr 0x{{[0-9a-f]+}} <{{[^:]+}}:37> 'int [2]' lvalue Var 0x{{[0-9a-f]+}} 'arr' 'int [2]'
+// CHECK-NEXT: IntegerLiteral 0x{{[0-9a-f]+}} <{{[^:]+}}:53> 'int' 3
+// CHECK-NEXT: ImplicitCastExpr
+// CHECK-SAME: <ArrayToPointerDecay>
+// CHECK-NEXT: DeclRefExpr 0x{{[0-9a-f]+}} <{{[^:]+}}:42> 'int [2]' lvalue Var 0x{{[0-9a-f]+}} 'arr' 'int [2]'
+// CHECK-NEXT: IntegerLiteral 0x{{[0-9a-f]+}} <{{[^:]+}}:56> 'int' 4
+// CHECK-NEXT: IntegerLiteral 0x{{[0-9a-f]+}} <{{[^:]+}}:47> 'int' 1
+// CHECK-NEXT: ImplicitCastExpr
+// CHECK-NEXT: IntegerLiteral 0x{{[0-9a-f]+}} <{{[^:]+}}:50> 'int' 0
+// CHECK:FunctionDecl 0x{{[0-9a-f]+}} <line:10:1, line:13:1> line:10:6 used foo
+// CHECK: AtomicExpr
+// CHECK-NEXT: ImplicitCastExpr
+// CHECK-SAME: <ArrayToPointerDecay>
+// CHECK-NEXT: DeclRefExpr 0x{{[0-9a-f]+}} <{{[^:]+}}:37> 'int [2]' lvalue Var 0x{{[0-9a-f]+}} 'arr' 'int [2]'
+// CHECK-NEXT: IntegerLiteral 0x{{[0-9a-f]+}} <{{[^:]+}}:53> 'int' 3
+// CHECK-NEXT: ImplicitCastExpr
+// CHECK-SAME: <ArrayToPointerDecay>
+// CHECK-NEXT: DeclRefExpr 0x{{[0-9a-f]+}} <{{[^:]+}}:42> 'int [2]' lvalue Var 0x{{[0-9a-f]+}} 'arr' 'int [2]'
+// CHECK-NEXT: IntegerLiteral 0x{{[0-9a-f]+}} <{{[^:]+}}:56> 'int' 4
+// CHECK-NEXT: IntegerLiteral 0x{{[0-9a-f]+}} <{{[^:]+}}:47> 'int' 1
+// CHECK-NEXT: ImplicitCastExpr
+// CHECK-NEXT: IntegerLiteral 0x{{[0-9a-f]+}} <{{[^:]+}}:50> 'int' 0
diff --git a/src/llvm-project/clang/test/AST/dump.cpp b/src/llvm-project/clang/test/AST/dump.cpp
index 641abc5..4d27151 100644
--- a/src/llvm-project/clang/test/AST/dump.cpp
+++ b/src/llvm-project/clang/test/AST/dump.cpp
@@ -33,13 +33,11 @@
// CHECK-NEXT: | | |-DeclRefExpr {{.+}} <col:45> 'float' lvalue Var {{.+}} 'omp_out' 'float'
// CHECK-NEXT: | | `-ImplicitCastExpr {{.+}} <col:56> 'float' <LValueToRValue>
// CHECK-NEXT: | | `-DeclRefExpr {{.+}} <col:56> 'float' lvalue Var {{.+}} 'omp_in' 'float'
-// CHECK-NEXT: | |-BinaryOperator {{.+}} <col:76, col:98> 'float' lvalue '='
-// CHECK-NEXT: | | |-DeclRefExpr {{.+}} <col:76> 'float' lvalue Var {{.+}} 'omp_priv' 'float'
-// CHECK-NEXT: | | `-BinaryOperator {{.+}} <col:87, col:98> 'float' '+'
-// CHECK-NEXT: | | |-ImplicitCastExpr {{.+}} <col:87> 'float' <LValueToRValue>
-// CHECK-NEXT: | | | `-DeclRefExpr {{.+}} <col:87> 'float' lvalue Var {{.+}} 'omp_orig' 'float'
-// CHECK-NEXT: | | `-ImplicitCastExpr {{.+}} <col:98> 'float' <IntegralToFloating>
-// CHECK-NEXT: | | `-IntegerLiteral {{.+}} <col:98> 'int' 15
+// CHECK-NEXT: | |-BinaryOperator {{.+}} <col:87, col:98> 'float' '+'
+// CHECK-NEXT: | | |-ImplicitCastExpr {{.+}} <col:87> 'float' <LValueToRValue>
+// CHECK-NEXT: | | | `-DeclRefExpr {{.+}} <col:87> 'float' lvalue Var {{.+}} 'omp_orig' 'float'
+// CHECK-NEXT: | | `-ImplicitCastExpr {{.+}} <col:98> 'float' <IntegralToFloating>
+// CHECK-NEXT: | | `-IntegerLiteral {{.+}} <col:98> 'int' 15
struct S {
int a, b;
diff --git a/src/llvm-project/clang/test/AST/gen_ast_dump_json_test.py b/src/llvm-project/clang/test/AST/gen_ast_dump_json_test.py
index 975039e..f783c79 100644
--- a/src/llvm-project/clang/test/AST/gen_ast_dump_json_test.py
+++ b/src/llvm-project/clang/test/AST/gen_ast_dump_json_test.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
+from __future__ import print_function
from collections import OrderedDict
-from sets import Set
from shutil import copyfile
import argparse
import json
@@ -9,7 +9,10 @@
import pprint
import re
import subprocess
-
+import sys
+import tempfile
+
+
def normalize(dict_var):
for k, v in dict_var.items():
if isinstance(v, OrderedDict):
@@ -20,7 +23,7 @@
normalize(e)
elif type(v) is unicode:
st = v.encode('utf-8')
- if re.match(r"0x[0-9A-Fa-f]+", v):
+ if v != "0x0" and re.match(r"0x[0-9A-Fa-f]+", v):
dict_var[k] = u'0x{{.*}}'
elif os.path.isfile(v):
dict_var[k] = u'{{.*}}'
@@ -52,44 +55,103 @@
for e in v:
if isinstance(e, OrderedDict):
filter_json(e, filters, out)
-
+
+
+def default_clang_path():
+ guessed_clang = os.path.join(os.path.dirname(__file__), "clang")
+ if os.path.isfile(guessed_clang):
+ return guessed_clang
+ return None
+
+
def main():
parser = argparse.ArgumentParser()
parser.add_argument("--clang", help="The clang binary (could be a relative or absolute path)",
- action="store", required=True)
- parser.add_argument("--opts", help="other options",
- action="store", default='', type=str)
- parser.add_argument("--source", help="the source file. Command used to generate the json will be of the format <clang> -cc1 -ast-dump=json <opts> <source>",
- action="store", required=True)
+ action="store", default=default_clang_path())
+ parser.add_argument("--source", help="the source file(s). Without --update, the command used to generate the JSON "
+ "will be of the format <clang> -cc1 -ast-dump=json <opts> <source>",
+ action="store", nargs=argparse.ONE_OR_MORE, required=True)
parser.add_argument("--filters", help="comma separated list of AST filters. Ex: --filters=TypedefDecl,BuiltinType",
action="store", default='')
-
+ update_or_generate_group = parser.add_mutually_exclusive_group()
+ update_or_generate_group.add_argument("--update", help="Update the file in-place", action="store_true")
+ update_or_generate_group.add_argument("--opts", help="other options",
+ action="store", default='', type=str)
+ parser.add_argument("--update-manual", help="When using --update, also update files that do not have the "
+ "autogenerated disclaimer", action="store_true")
args = parser.parse_args()
if not args.source:
- print("Specify the source file to give to clang.")
- return -1
+ sys.exit("Specify the source file to give to clang.")
clang_binary = os.path.abspath(args.clang)
if not os.path.isfile(clang_binary):
- print("clang binary specified not present.")
- return -1
+ sys.exit("clang binary specified not present.")
- options = args.opts.split(' ')
- filters = Set(args.filters.split(',')) if args.filters else Set([])
-
- note = "// NOTE: CHECK lines have been autogenerated by " \
- "gen_ast_dump_json_test.py"
-
- if (args.filters):
- note += "\n// using --filters=" + args.filters
-
+ for src in args.source:
+ process_file(src, clang_binary, cmdline_filters=args.filters,
+ cmdline_opts=args.opts, do_update=args.update,
+ force_update=args.update_manual)
+
+
+def process_file(source_file, clang_binary, cmdline_filters, cmdline_opts,
+ do_update, force_update):
+ note_firstline = "// NOTE: CHECK lines have been autogenerated by " \
+ "gen_ast_dump_json_test.py"
+ filters_line_prefix = "// using --filters="
+ note = note_firstline
+
cmd = [clang_binary, "-cc1"]
- cmd.extend(options)
+ if do_update:
+ # When updating the first line of the test must be a RUN: line
+ with open(source_file, "r") as srcf:
+ first_line = srcf.readline()
+ found_autogenerated_line = False
+ filters_line = None
+ for i, line in enumerate(srcf.readlines()):
+ if found_autogenerated_line:
+ # print("Filters line: '", line.rstrip(), "'", sep="")
+ if line.startswith(filters_line_prefix):
+ filters_line = line[len(filters_line_prefix):].rstrip()
+ break
+ if line.startswith(note_firstline):
+ found_autogenerated_line = True
+ # print("Found autogenerated disclaimer at line", i + 1)
+ if not found_autogenerated_line and not force_update:
+ print("Not updating", source_file, "since it is not autogenerated.",
+ file=sys.stderr)
+ return
+ if not cmdline_filters and filters_line:
+ cmdline_filters = filters_line
+ print("Inferred filters as '" + cmdline_filters + "'")
- using_ast_dump_filter = 'ast-dump-filter' in args.opts
-
- cmd.extend(["-ast-dump=json", args.source])
+ if "RUN: %clang_cc1 " not in first_line:
+ sys.exit("When using --update the first line of the input file must contain RUN: %clang_cc1")
+ clang_start = first_line.find("%clang_cc1") + len("%clang_cc1")
+ file_check_idx = first_line.rfind("| FileCheck")
+ if file_check_idx:
+ dump_cmd = first_line[clang_start:file_check_idx]
+ else:
+ dump_cmd = first_line[clang_start:]
+ print("Inferred run arguments as '", dump_cmd, "'", sep="")
+ options = dump_cmd.split()
+ if "-ast-dump=json" not in options:
+ sys.exit("ERROR: RUN: line does not contain -ast-dump=json")
+ if "%s" not in options:
+ sys.exit("ERROR: RUN: line does not contain %s")
+ options.remove("%s")
+ else:
+ options = cmdline_opts.split()
+ options.append("-ast-dump=json")
+ cmd.extend(options)
+ using_ast_dump_filter = any('ast-dump-filter' in arg for arg in cmd)
+ cmd.append(source_file)
+ print("Will run", cmd)
+ filters = set()
+ if cmdline_filters:
+ note += "\n" + filters_line_prefix + cmdline_filters
+ filters = set(cmdline_filters.split(','))
+ print("Will use the following filters:", filters)
try:
json_str = subprocess.check_output(cmd)
@@ -118,27 +180,39 @@
filter_json(j, filters, out_asts)
- partition = args.source.rpartition('.')
- dest_path = '%s-json%s%s' % (partition[0], partition[1], partition[2])
-
- print("Writing json appended source file to %s." %(dest_path))
- copyfile(args.source, dest_path)
- with open(dest_path, "a") as f:
- f.write("\n" + note + "\n")
+ with tempfile.NamedTemporaryFile("wb", delete=False) as f:
+ with open(source_file, "r") as srcf:
+ for line in srcf.readlines():
+ # copy up to the note:
+ if line.rstrip() == note_firstline:
+ break
+ f.write(line)
+ f.write(note + "\n")
for out_ast in out_asts:
append_str = json.dumps(out_ast, indent=1, ensure_ascii=False)
out_str = '\n\n'
index = 0
for append_line in append_str.splitlines()[2:]:
if index == 0:
- out_str += '// CHECK: %s\n' %(append_line)
+ out_str += '// CHECK: %s\n' %(append_line.rstrip())
index += 1
else:
- out_str += '// CHECK-NEXT: %s\n' %(append_line)
+ out_str += '// CHECK-NEXT: %s\n' %(append_line.rstrip())
f.write(out_str)
-
+ f.flush()
+ f.close()
+ if do_update:
+ print("Updating json appended source file to %s." % source_file)
+ copyfile(f.name, source_file)
+ else:
+ partition = source_file.rpartition('.')
+ dest_path = '%s-json%s%s' % (partition[0], partition[1], partition[2])
+ print("Writing json appended source file to %s." % dest_path)
+ copyfile(f.name, dest_path)
+ os.remove(f.name)
return 0
-
+
+
if __name__ == '__main__':
main()
diff --git a/src/llvm-project/clang/test/AST/language_address_space_attribute.cpp b/src/llvm-project/clang/test/AST/language_address_space_attribute.cpp
new file mode 100644
index 0000000..f9ab461
--- /dev/null
+++ b/src/llvm-project/clang/test/AST/language_address_space_attribute.cpp
@@ -0,0 +1,36 @@
+// RUN: %clang_cc1 %s -ast-dump | FileCheck %s
+
+// Verify that the language address space attribute is
+// understood correctly by clang.
+
+void langas() {
+ // CHECK: VarDecl {{.*}} x_global '__global int *'
+ __attribute__((opencl_global)) int *x_global;
+
+ // CHECK: VarDecl {{.*}} z_global '__global int *'
+ [[clang::opencl_global]] int *z_global;
+
+ // CHECK: VarDecl {{.*}} x_local '__local int *'
+ __attribute__((opencl_local)) int *x_local;
+
+ // CHECK: VarDecl {{.*}} z_local '__local int *'
+ [[clang::opencl_local]] int *z_local;
+
+ // CHECK: VarDecl {{.*}} x_constant '__constant int *'
+ __attribute__((opencl_constant)) int *x_constant;
+
+ // CHECK: VarDecl {{.*}} z_constant '__constant int *'
+ [[clang::opencl_constant]] int *z_constant;
+
+ // CHECK: VarDecl {{.*}} x_private '__private int *'
+ __attribute__((opencl_private)) int *x_private;
+
+ // CHECK: VarDecl {{.*}} z_private '__private int *'
+ [[clang::opencl_private]] int *z_private;
+
+ // CHECK: VarDecl {{.*}} x_generic '__generic int *'
+ __attribute__((opencl_generic)) int *x_generic;
+
+ // CHECK: VarDecl {{.*}} z_generic '__generic int *'
+ [[clang::opencl_generic]] int *z_generic;
+}
diff --git a/src/llvm-project/clang/test/AST/multistep-explicit-cast-json.c b/src/llvm-project/clang/test/AST/multistep-explicit-cast-json.c
index bfdcf24..8059e74 100644
--- a/src/llvm-project/clang/test/AST/multistep-explicit-cast-json.c
+++ b/src/llvm-project/clang/test/AST/multistep-explicit-cast-json.c
@@ -41,10 +41,12 @@
// CHECK: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 148,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 148,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -60,10 +62,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 148,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 148,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -79,10 +83,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 148,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 148,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -109,10 +115,12 @@
// CHECK: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 208,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 208,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -128,10 +136,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 208,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 208,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -147,10 +157,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 208,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 208,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -177,10 +189,12 @@
// CHECK: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 268,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 268,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -196,10 +210,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 268,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 268,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -215,10 +231,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 268,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 268,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -245,10 +263,12 @@
// CHECK: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 326,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 326,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -264,10 +284,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 326,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 326,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -283,10 +305,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 326,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 326,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -313,10 +337,12 @@
// CHECK: "kind": "CStyleCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 468,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 483,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -332,10 +358,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 483,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 483,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -352,10 +380,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 483,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 483,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -382,10 +412,12 @@
// CHECK: "kind": "CStyleCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 541,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 554,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -401,10 +433,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 554,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 554,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -421,10 +455,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 554,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 554,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -451,10 +487,12 @@
// CHECK: "kind": "CStyleCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 612,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 627,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -470,10 +508,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 627,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 627,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -490,10 +530,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 627,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 627,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -520,10 +562,12 @@
// CHECK: "kind": "CStyleCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 683,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 696,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -539,10 +583,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 696,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 696,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -559,10 +605,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 696,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 696,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
diff --git a/src/llvm-project/clang/test/AST/multistep-explicit-cast-json.cpp b/src/llvm-project/clang/test/AST/multistep-explicit-cast-json.cpp
index 76123c2..47cc8df 100644
--- a/src/llvm-project/clang/test/AST/multistep-explicit-cast-json.cpp
+++ b/src/llvm-project/clang/test/AST/multistep-explicit-cast-json.cpp
@@ -82,10 +82,12 @@
// CHECK: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 148,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 148,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -101,10 +103,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 148,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 148,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -120,10 +124,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 148,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 148,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -150,10 +156,12 @@
// CHECK: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 208,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 208,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -169,10 +177,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 208,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 208,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -188,10 +198,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 208,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 208,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -218,10 +230,12 @@
// CHECK: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 268,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 268,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -237,10 +251,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 268,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 268,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -256,10 +272,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 268,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 268,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -286,10 +304,12 @@
// CHECK: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 326,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 326,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -305,10 +325,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 326,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 326,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -324,10 +346,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 326,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 326,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -354,10 +378,12 @@
// CHECK: "kind": "CStyleCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 468,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 483,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -373,10 +399,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 483,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 483,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -393,10 +421,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 483,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 483,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -413,10 +443,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 483,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 483,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -445,10 +477,12 @@
// CHECK: "kind": "CStyleCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 541,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 554,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -464,10 +498,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 554,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 554,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -484,10 +520,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 554,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 554,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -504,10 +542,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 554,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 554,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -536,10 +576,12 @@
// CHECK: "kind": "CStyleCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 612,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 627,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -555,10 +597,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 627,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 627,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -575,10 +619,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 627,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 627,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -595,10 +641,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 627,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 627,
// CHECK-NEXT: "col": 25,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -627,10 +675,12 @@
// CHECK: "kind": "CStyleCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 683,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 696,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -646,10 +696,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 696,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 696,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -666,10 +718,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 696,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 696,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -686,10 +740,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 696,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 696,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -718,10 +774,12 @@
// CHECK: "kind": "CXXStaticCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 841,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 11
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 869,
// CHECK-NEXT: "col": 38,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -737,10 +795,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 868,
// CHECK-NEXT: "col": 37,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 868,
// CHECK-NEXT: "col": 37,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -757,10 +817,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 868,
// CHECK-NEXT: "col": 37,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 868,
// CHECK-NEXT: "col": 37,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -777,10 +839,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 868,
// CHECK-NEXT: "col": 37,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 868,
// CHECK-NEXT: "col": 37,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -809,10 +873,12 @@
// CHECK: "kind": "CXXStaticCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 930,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 11
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 956,
// CHECK-NEXT: "col": 36,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -828,10 +894,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 955,
// CHECK-NEXT: "col": 35,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 955,
// CHECK-NEXT: "col": 35,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -848,10 +916,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 955,
// CHECK-NEXT: "col": 35,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 955,
// CHECK-NEXT: "col": 35,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -868,10 +938,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 955,
// CHECK-NEXT: "col": 35,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 955,
// CHECK-NEXT: "col": 35,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -900,10 +972,12 @@
// CHECK: "kind": "CXXStaticCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1017,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 11
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1045,
// CHECK-NEXT: "col": 38,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -919,10 +993,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1044,
// CHECK-NEXT: "col": 37,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1044,
// CHECK-NEXT: "col": 37,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -939,10 +1015,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1044,
// CHECK-NEXT: "col": 37,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1044,
// CHECK-NEXT: "col": 37,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -959,10 +1037,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1044,
// CHECK-NEXT: "col": 37,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1044,
// CHECK-NEXT: "col": 37,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -991,10 +1071,12 @@
// CHECK: "kind": "CXXStaticCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1104,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 11
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1130,
// CHECK-NEXT: "col": 36,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1010,10 +1092,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1129,
// CHECK-NEXT: "col": 35,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1129,
// CHECK-NEXT: "col": 35,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1030,10 +1114,12 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1129,
// CHECK-NEXT: "col": 35,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1129,
// CHECK-NEXT: "col": 35,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1050,10 +1136,12 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1129,
// CHECK-NEXT: "col": 35,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1129,
// CHECK-NEXT: "col": 35,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
@@ -1082,17 +1170,20 @@
// CHECK: "kind": "CXXFunctionalCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1410,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 12
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1424,
// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "desugaredQualType": "unsigned char",
-// CHECK-NEXT: "qualType": "UnsignedChar"
+// CHECK-NEXT: "qualType": "UnsignedChar",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "castKind": "NoOp",
@@ -1102,17 +1193,20 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1423,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1423,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "desugaredQualType": "unsigned char",
-// CHECK-NEXT: "qualType": "UnsignedChar"
+// CHECK-NEXT: "qualType": "UnsignedChar",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "castKind": "IntegralCast",
@@ -1123,17 +1217,20 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1423,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1423,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "desugaredQualType": "unsigned int",
-// CHECK-NEXT: "qualType": "UnsignedInt"
+// CHECK-NEXT: "qualType": "UnsignedInt",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
@@ -1144,17 +1241,20 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1423,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1423,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "desugaredQualType": "unsigned int",
-// CHECK-NEXT: "qualType": "UnsignedInt"
+// CHECK-NEXT: "qualType": "UnsignedInt",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "referencedDecl": {
@@ -1163,7 +1263,8 @@
// CHECK-NEXT: "name": "x",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "desugaredQualType": "unsigned int",
-// CHECK-NEXT: "qualType": "UnsignedInt"
+// CHECK-NEXT: "qualType": "UnsignedInt",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: }
@@ -1178,17 +1279,20 @@
// CHECK: "kind": "CXXFunctionalCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1487,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 10
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1499,
// CHECK-NEXT: "col": 22,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "desugaredQualType": "signed char",
-// CHECK-NEXT: "qualType": "SignedChar"
+// CHECK-NEXT: "qualType": "SignedChar",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "castKind": "NoOp",
@@ -1198,17 +1302,20 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1498,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1498,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "desugaredQualType": "signed char",
-// CHECK-NEXT: "qualType": "SignedChar"
+// CHECK-NEXT: "qualType": "SignedChar",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "castKind": "IntegralCast",
@@ -1219,17 +1326,20 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1498,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1498,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "desugaredQualType": "unsigned int",
-// CHECK-NEXT: "qualType": "UnsignedInt"
+// CHECK-NEXT: "qualType": "UnsignedInt",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
@@ -1240,17 +1350,20 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1498,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1498,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "desugaredQualType": "unsigned int",
-// CHECK-NEXT: "qualType": "UnsignedInt"
+// CHECK-NEXT: "qualType": "UnsignedInt",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "referencedDecl": {
@@ -1259,7 +1372,8 @@
// CHECK-NEXT: "name": "x",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "desugaredQualType": "unsigned int",
-// CHECK-NEXT: "qualType": "UnsignedInt"
+// CHECK-NEXT: "qualType": "UnsignedInt",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: }
@@ -1274,17 +1388,20 @@
// CHECK: "kind": "CXXFunctionalCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1562,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 12
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1576,
// CHECK-NEXT: "col": 24,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "desugaredQualType": "unsigned char",
-// CHECK-NEXT: "qualType": "UnsignedChar"
+// CHECK-NEXT: "qualType": "UnsignedChar",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "castKind": "NoOp",
@@ -1294,17 +1411,20 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1575,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1575,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "desugaredQualType": "unsigned char",
-// CHECK-NEXT: "qualType": "UnsignedChar"
+// CHECK-NEXT: "qualType": "UnsignedChar",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "castKind": "IntegralCast",
@@ -1315,17 +1435,20 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1575,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1575,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "desugaredQualType": "int",
-// CHECK-NEXT: "qualType": "SignedInt"
+// CHECK-NEXT: "qualType": "SignedInt",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
@@ -1336,17 +1459,20 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1575,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1575,
// CHECK-NEXT: "col": 23,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "desugaredQualType": "int",
-// CHECK-NEXT: "qualType": "SignedInt"
+// CHECK-NEXT: "qualType": "SignedInt",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "referencedDecl": {
@@ -1355,7 +1481,8 @@
// CHECK-NEXT: "name": "x",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "desugaredQualType": "int",
-// CHECK-NEXT: "qualType": "SignedInt"
+// CHECK-NEXT: "qualType": "SignedInt",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: }
@@ -1370,17 +1497,20 @@
// CHECK: "kind": "CXXFunctionalCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1637,
// CHECK-NEXT: "col": 10,
// CHECK-NEXT: "tokLen": 10
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1649,
// CHECK-NEXT: "col": 22,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "desugaredQualType": "signed char",
-// CHECK-NEXT: "qualType": "SignedChar"
+// CHECK-NEXT: "qualType": "SignedChar",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "castKind": "NoOp",
@@ -1390,17 +1520,20 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1648,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1648,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "desugaredQualType": "signed char",
-// CHECK-NEXT: "qualType": "SignedChar"
+// CHECK-NEXT: "qualType": "SignedChar",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "castKind": "IntegralCast",
@@ -1411,17 +1544,20 @@
// CHECK-NEXT: "kind": "ImplicitCastExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1648,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1648,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "desugaredQualType": "int",
-// CHECK-NEXT: "qualType": "SignedInt"
+// CHECK-NEXT: "qualType": "SignedInt",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "rvalue",
// CHECK-NEXT: "castKind": "LValueToRValue",
@@ -1432,17 +1568,20 @@
// CHECK-NEXT: "kind": "DeclRefExpr",
// CHECK-NEXT: "range": {
// CHECK-NEXT: "begin": {
+// CHECK-NEXT: "offset": 1648,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
+// CHECK-NEXT: "offset": 1648,
// CHECK-NEXT: "col": 21,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
// CHECK-NEXT: "desugaredQualType": "int",
-// CHECK-NEXT: "qualType": "SignedInt"
+// CHECK-NEXT: "qualType": "SignedInt",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "referencedDecl": {
@@ -1451,7 +1590,8 @@
// CHECK-NEXT: "name": "x",
// CHECK-NEXT: "type": {
// CHECK-NEXT: "desugaredQualType": "int",
-// CHECK-NEXT: "qualType": "SignedInt"
+// CHECK-NEXT: "qualType": "SignedInt",
+// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: }
diff --git a/src/llvm-project/clang/test/AST/pr43983.cpp b/src/llvm-project/clang/test/AST/pr43983.cpp
new file mode 100644
index 0000000..0f4f596
--- /dev/null
+++ b/src/llvm-project/clang/test/AST/pr43983.cpp
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 -fsyntax-only %s -ast-dump | FileCheck %s
+
+struct B { _Alignas(64) struct { int b; }; };
+
+// CHECK: AlignedAttr {{.*}} _Alignas
+// CHECK: ConstantExpr {{.*}} 64
+// CHECK: IntegerLiteral {{.*}} 64
diff --git a/src/llvm-project/clang/test/AST/sourceranges.cpp b/src/llvm-project/clang/test/AST/sourceranges.cpp
index 53f2f57..3c023c8 100644
--- a/src/llvm-project/clang/test/AST/sourceranges.cpp
+++ b/src/llvm-project/clang/test/AST/sourceranges.cpp
@@ -92,6 +92,22 @@
}; // namespace std
+// CHECK: NamespaceDecl {{.*}} attributed_decl
+namespace attributed_decl {
+ void f() {
+ // CHECK: DeclStmt {{.*}} <line:[[@LINE+1]]:5, col:28>
+ [[maybe_unused]] int i1;
+ // CHECK: DeclStmt {{.*}} <line:[[@LINE+1]]:5, col:35>
+ __attribute__((unused)) int i2;
+ // CHECK: DeclStmt {{.*}} <line:[[@LINE+1]]:5, col:35>
+ int __attribute__((unused)) i3;
+ // CHECK: DeclStmt {{.*}} <<built-in>:{{.*}}, {{.*}}:[[@LINE+1]]:40>
+ __declspec(dllexport) extern int i4;
+ // CHECK: DeclStmt {{.*}} <line:[[@LINE+1]]:5, col:40>
+ extern int __declspec(dllexport) i5;
+ }
+}
+
#if __cplusplus >= 201703L
// CHECK-1Z: FunctionDecl {{.*}} construct_with_init_list
std::map<int, int> construct_with_init_list() {
diff --git a/src/llvm-project/clang/test/ASTMerge/class-template/test.cpp b/src/llvm-project/clang/test/ASTMerge/class-template/test.cpp
index 27761f6..6710647 100644
--- a/src/llvm-project/clang/test/ASTMerge/class-template/test.cpp
+++ b/src/llvm-project/clang/test/ASTMerge/class-template/test.cpp
@@ -9,13 +9,13 @@
// CHECK: class-template2.cpp:9:15: note: declared here with type 'long'
// CHECK: class-template1.cpp:12:14: warning: template parameter has different kinds in different translation units
-// CHECK: class-template2.cpp:12:10: note: template parameter declared here
+// CHECK: class-template2.cpp:12:18: note: template parameter declared here
// CHECK: class-template1.cpp:18:23: warning: non-type template parameter declared with incompatible types in different translation units ('long' vs. 'int')
// CHECK: class-template2.cpp:18:23: note: declared here with type 'int'
-// CHECK: class-template1.cpp:21:10: warning: template parameter has different kinds in different translation units
-// CHECK: class-template2.cpp:21:10: note: template parameter declared here
+// CHECK: class-template1.cpp:21:18: warning: template parameter has different kinds in different translation units
+// CHECK: class-template2.cpp:21:31: note: template parameter declared here
// CHECK: class-template2.cpp:27:20: warning: external variable 'x0r' declared with incompatible types in different translation units ('X0<double> *' vs. 'X0<float> *')
// CHECK: class-template1.cpp:26:19: note: declared here with type 'X0<float> *'
diff --git a/src/llvm-project/clang/test/ASTMerge/exprs-cpp/test.cpp b/src/llvm-project/clang/test/ASTMerge/exprs-cpp/test.cpp
index c0b282e..7bb6d17 100644
--- a/src/llvm-project/clang/test/ASTMerge/exprs-cpp/test.cpp
+++ b/src/llvm-project/clang/test/ASTMerge/exprs-cpp/test.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++1z -fcxx-exceptions -emit-pch -o %t.1.ast %S/Inputs/exprs3.cpp
-// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++1z -fcxx-exceptions -ast-merge %t.1.ast -fsyntax-only -verify %s
+// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++1z -fcxx-exceptions -Wno-signed-unsigned-wchar -emit-pch -o %t.1.ast %S/Inputs/exprs3.cpp
+// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++1z -fcxx-exceptions -Wno-signed-unsigned-wchar -ast-merge %t.1.ast -fsyntax-only -verify %s
// expected-no-diagnostics
static_assert(Ch1 == 'a');
diff --git a/src/llvm-project/clang/test/Analysis/Inputs/ctu-other.c b/src/llvm-project/clang/test/Analysis/Inputs/ctu-other.c
index 9a95206..82d29c6 100644
--- a/src/llvm-project/clang/test/Analysis/Inputs/ctu-other.c
+++ b/src/llvm-project/clang/test/Analysis/Inputs/ctu-other.c
@@ -12,11 +12,11 @@
}
// Test enums.
-enum B { x = 42,
- l,
- s };
+enum B { x2 = 42,
+ y2,
+ z2 };
int enumCheck(void) {
- return x;
+ return x2;
}
// Test reporting an error in macro definition
diff --git a/src/llvm-project/clang/test/Analysis/Inputs/ctu-other.cpp b/src/llvm-project/clang/test/Analysis/Inputs/ctu-other.cpp
index a9ff6b5..ff37947 100644
--- a/src/llvm-project/clang/test/Analysis/Inputs/ctu-other.cpp
+++ b/src/llvm-project/clang/test/Analysis/Inputs/ctu-other.cpp
@@ -131,3 +131,47 @@
const unsigned int b;
};
U extU = {.a = 4};
+
+class TestAnonUnionUSR {
+public:
+ inline float f(int value) {
+ union {
+ float f;
+ int i;
+ };
+ i = value;
+ return f;
+ }
+ static const int Test;
+};
+const int TestAnonUnionUSR::Test = 5;
+
+struct DefaultParmContext {
+ static const int I;
+ int f();
+};
+
+int fDefaultParm(int I = DefaultParmContext::I) {
+ return I;
+}
+
+int testImportOfIncompleteDefaultParmDuringImport(int I) {
+ return fDefaultParm(I);
+}
+
+const int DefaultParmContext::I = 0;
+
+int DefaultParmContext::f() {
+ return fDefaultParm();
+}
+
+class TestDelegateConstructor {
+public:
+ TestDelegateConstructor() : TestDelegateConstructor(2) {}
+ TestDelegateConstructor(int) {}
+};
+
+int testImportOfDelegateConstructor(int i) {
+ TestDelegateConstructor TDC;
+ return i;
+}
diff --git a/src/llvm-project/clang/test/Analysis/Inputs/ctu-other.cpp.externalDefMap.txt b/src/llvm-project/clang/test/Analysis/Inputs/ctu-other.cpp.externalDefMap.txt
index 3df181b..e5fca5d 100644
--- a/src/llvm-project/clang/test/Analysis/Inputs/ctu-other.cpp.externalDefMap.txt
+++ b/src/llvm-project/clang/test/Analysis/Inputs/ctu-other.cpp.externalDefMap.txt
@@ -25,3 +25,6 @@
c:@extSubSCN ctu-other.cpp.ast
c:@extSCC ctu-other.cpp.ast
c:@extU ctu-other.cpp.ast
+c:@S@TestAnonUnionUSR@Test ctu-other.cpp.ast
+c:@F@testImportOfIncompleteDefaultParmDuringImport#I# ctu-other.cpp.ast
+c:@F@testImportOfDelegateConstructor#I# ctu-other.cpp.ast
\ No newline at end of file
diff --git a/src/llvm-project/clang/test/Analysis/Inputs/expected-plists/cxx-for-range.cpp.plist b/src/llvm-project/clang/test/Analysis/Inputs/expected-plists/cxx-for-range.cpp.plist
index e7f6dba..edcaaf2 100644
--- a/src/llvm-project/clang/test/Analysis/Inputs/expected-plists/cxx-for-range.cpp.plist
+++ b/src/llvm-project/clang/test/Analysis/Inputs/expected-plists/cxx-for-range.cpp.plist
@@ -191,7 +191,7 @@
</dict>
<dict>
<key>line</key><integer>11</integer>
- <key>col</key><integer>14</integer>
+ <key>col</key><integer>9</integer>
<key>file</key><integer>0</integer>
</dict>
</array>
@@ -515,7 +515,7 @@
</dict>
<dict>
<key>line</key><integer>11</integer>
- <key>col</key><integer>14</integer>
+ <key>col</key><integer>9</integer>
<key>file</key><integer>0</integer>
</dict>
</array>
diff --git a/src/llvm-project/clang/test/Analysis/Inputs/expected-plists/edges-new.mm.plist b/src/llvm-project/clang/test/Analysis/Inputs/expected-plists/edges-new.mm.plist
index b4c7901..b949e20 100644
--- a/src/llvm-project/clang/test/Analysis/Inputs/expected-plists/edges-new.mm.plist
+++ b/src/llvm-project/clang/test/Analysis/Inputs/expected-plists/edges-new.mm.plist
@@ -2727,7 +2727,7 @@
</dict>
<dict>
<key>line</key><integer>146</integer>
- <key>col</key><integer>13</integer>
+ <key>col</key><integer>8</integer>
<key>file</key><integer>0</integer>
</dict>
</array>
@@ -2949,7 +2949,7 @@
</dict>
<dict>
<key>line</key><integer>146</integer>
- <key>col</key><integer>13</integer>
+ <key>col</key><integer>8</integer>
<key>file</key><integer>0</integer>
</dict>
</array>
@@ -3929,7 +3929,7 @@
</dict>
<dict>
<key>line</key><integer>178</integer>
- <key>col</key><integer>14</integer>
+ <key>col</key><integer>9</integer>
<key>file</key><integer>0</integer>
</dict>
</array>
@@ -4185,7 +4185,7 @@
</dict>
<dict>
<key>line</key><integer>178</integer>
- <key>col</key><integer>14</integer>
+ <key>col</key><integer>9</integer>
<key>file</key><integer>0</integer>
</dict>
</array>
@@ -4281,7 +4281,7 @@
</dict>
<dict>
<key>line</key><integer>181</integer>
- <key>col</key><integer>14</integer>
+ <key>col</key><integer>9</integer>
<key>file</key><integer>0</integer>
</dict>
</array>
@@ -8087,7 +8087,7 @@
<key>location</key>
<dict>
<key>line</key><integer>267</integer>
- <key>col</key><integer>18</integer>
+ <key>col</key><integer>19</integer>
<key>file</key><integer>0</integer>
</dict>
<key>ranges</key>
@@ -8095,7 +8095,7 @@
<array>
<dict>
<key>line</key><integer>267</integer>
- <key>col</key><integer>18</integer>
+ <key>col</key><integer>19</integer>
<key>file</key><integer>0</integer>
</dict>
<dict>
@@ -8119,12 +8119,12 @@
<array>
<dict>
<key>line</key><integer>267</integer>
- <key>col</key><integer>18</integer>
+ <key>col</key><integer>19</integer>
<key>file</key><integer>0</integer>
</dict>
<dict>
<key>line</key><integer>267</integer>
- <key>col</key><integer>18</integer>
+ <key>col</key><integer>22</integer>
<key>file</key><integer>0</integer>
</dict>
</array>
@@ -10853,12 +10853,12 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Null pointer passed as an argument to a 'nonnull' parameter</string>
+ <string>Null pointer passed to 1st parameter expecting 'nonnull'</string>
<key>message</key>
- <string>Null pointer passed as an argument to a 'nonnull' parameter</string>
+ <string>Null pointer passed to 1st parameter expecting 'nonnull'</string>
</dict>
</array>
- <key>description</key><string>Null pointer passed as an argument to a 'nonnull' parameter</string>
+ <key>description</key><string>Null pointer passed to 1st parameter expecting 'nonnull'</string>
<key>category</key><string>API</string>
<key>type</key><string>Argument with 'nonnull' attribute passed null</string>
<key>check_name</key><string>core.NonNullParamChecker</string>
@@ -11983,12 +11983,12 @@
<array>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>10</integer>
<key>file</key><integer>0</integer>
</dict>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>14</integer>
<key>file</key><integer>0</integer>
</dict>
</array>
@@ -12000,7 +12000,7 @@
<key>location</key>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>10</integer>
<key>file</key><integer>0</integer>
</dict>
<key>ranges</key>
@@ -12008,7 +12008,7 @@
<array>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>10</integer>
<key>file</key><integer>0</integer>
</dict>
<dict>
@@ -12032,12 +12032,12 @@
<array>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>10</integer>
<key>file</key><integer>0</integer>
</dict>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>14</integer>
<key>file</key><integer>0</integer>
</dict>
</array>
@@ -12244,12 +12244,12 @@
<array>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>10</integer>
<key>file</key><integer>0</integer>
</dict>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>14</integer>
<key>file</key><integer>0</integer>
</dict>
</array>
@@ -12261,7 +12261,7 @@
<key>location</key>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>10</integer>
<key>file</key><integer>0</integer>
</dict>
<key>ranges</key>
@@ -12269,7 +12269,7 @@
<array>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>10</integer>
<key>file</key><integer>0</integer>
</dict>
<dict>
@@ -12293,12 +12293,12 @@
<array>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>10</integer>
<key>file</key><integer>0</integer>
</dict>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>14</integer>
<key>file</key><integer>0</integer>
</dict>
</array>
@@ -12571,12 +12571,12 @@
<array>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>10</integer>
<key>file</key><integer>0</integer>
</dict>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>14</integer>
<key>file</key><integer>0</integer>
</dict>
</array>
@@ -12588,7 +12588,7 @@
<key>location</key>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>10</integer>
<key>file</key><integer>0</integer>
</dict>
<key>ranges</key>
@@ -12596,7 +12596,7 @@
<array>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>10</integer>
<key>file</key><integer>0</integer>
</dict>
<dict>
@@ -12620,12 +12620,12 @@
<array>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>10</integer>
<key>file</key><integer>0</integer>
</dict>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>14</integer>
<key>file</key><integer>0</integer>
</dict>
</array>
@@ -13128,12 +13128,12 @@
<array>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>10</integer>
<key>file</key><integer>0</integer>
</dict>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>14</integer>
<key>file</key><integer>0</integer>
</dict>
</array>
@@ -13145,7 +13145,7 @@
<key>location</key>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>10</integer>
<key>file</key><integer>0</integer>
</dict>
<key>ranges</key>
@@ -13153,7 +13153,7 @@
<array>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>10</integer>
<key>file</key><integer>0</integer>
</dict>
<dict>
@@ -13177,12 +13177,12 @@
<array>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>10</integer>
<key>file</key><integer>0</integer>
</dict>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>14</integer>
<key>file</key><integer>0</integer>
</dict>
</array>
@@ -13752,12 +13752,12 @@
<array>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>10</integer>
<key>file</key><integer>0</integer>
</dict>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>14</integer>
<key>file</key><integer>0</integer>
</dict>
</array>
@@ -13769,7 +13769,7 @@
<key>location</key>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>10</integer>
<key>file</key><integer>0</integer>
</dict>
<key>ranges</key>
@@ -13777,7 +13777,7 @@
<array>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>10</integer>
<key>file</key><integer>0</integer>
</dict>
<dict>
@@ -13801,12 +13801,12 @@
<array>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>10</integer>
<key>file</key><integer>0</integer>
</dict>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>14</integer>
<key>file</key><integer>0</integer>
</dict>
</array>
@@ -15295,12 +15295,12 @@
<array>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>10</integer>
<key>file</key><integer>0</integer>
</dict>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>14</integer>
<key>file</key><integer>0</integer>
</dict>
</array>
@@ -15312,7 +15312,7 @@
<key>location</key>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>10</integer>
<key>file</key><integer>0</integer>
</dict>
<key>ranges</key>
@@ -15320,7 +15320,7 @@
<array>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>10</integer>
<key>file</key><integer>0</integer>
</dict>
<dict>
@@ -15344,12 +15344,12 @@
<array>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>10</integer>
<key>file</key><integer>0</integer>
</dict>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>14</integer>
<key>file</key><integer>0</integer>
</dict>
</array>
@@ -16965,12 +16965,12 @@
<array>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>10</integer>
<key>file</key><integer>0</integer>
</dict>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>14</integer>
<key>file</key><integer>0</integer>
</dict>
</array>
@@ -16982,7 +16982,7 @@
<key>location</key>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>10</integer>
<key>file</key><integer>0</integer>
</dict>
<key>ranges</key>
@@ -16990,7 +16990,7 @@
<array>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>10</integer>
<key>file</key><integer>0</integer>
</dict>
<dict>
@@ -17014,12 +17014,12 @@
<array>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>10</integer>
<key>file</key><integer>0</integer>
</dict>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>14</integer>
<key>file</key><integer>0</integer>
</dict>
</array>
@@ -18860,12 +18860,12 @@
<array>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>10</integer>
<key>file</key><integer>0</integer>
</dict>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>14</integer>
<key>file</key><integer>0</integer>
</dict>
</array>
@@ -18877,7 +18877,7 @@
<key>location</key>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>10</integer>
<key>file</key><integer>0</integer>
</dict>
<key>ranges</key>
@@ -18885,7 +18885,7 @@
<array>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>10</integer>
<key>file</key><integer>0</integer>
</dict>
<dict>
@@ -18909,12 +18909,12 @@
<array>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>10</integer>
<key>file</key><integer>0</integer>
</dict>
<dict>
<key>line</key><integer>457</integer>
- <key>col</key><integer>9</integer>
+ <key>col</key><integer>14</integer>
<key>file</key><integer>0</integer>
</dict>
</array>
@@ -22244,6 +22244,40 @@
</array>
</dict>
<dict>
+ <key>kind</key><string>control</string>
+ <key>edges</key>
+ <array>
+ <dict>
+ <key>start</key>
+ <array>
+ <dict>
+ <key>line</key><integer>587</integer>
+ <key>col</key><integer>11</integer>
+ <key>file</key><integer>0</integer>
+ </dict>
+ <dict>
+ <key>line</key><integer>587</integer>
+ <key>col</key><integer>11</integer>
+ <key>file</key><integer>0</integer>
+ </dict>
+ </array>
+ <key>end</key>
+ <array>
+ <dict>
+ <key>line</key><integer>587</integer>
+ <key>col</key><integer>11</integer>
+ <key>file</key><integer>0</integer>
+ </dict>
+ <dict>
+ <key>line</key><integer>587</integer>
+ <key>col</key><integer>11</integer>
+ <key>file</key><integer>0</integer>
+ </dict>
+ </array>
+ </dict>
+ </array>
+ </dict>
+ <dict>
<key>kind</key><string>pop-up</string>
<key>location</key>
<dict>
@@ -22251,21 +22285,6 @@
<key>col</key><integer>11</integer>
<key>file</key><integer>0</integer>
</dict>
- <key>ranges</key>
- <array>
- <array>
- <dict>
- <key>line</key><integer>587</integer>
- <key>col</key><integer>11</integer>
- <key>file</key><integer>0</integer>
- </dict>
- <dict>
- <key>line</key><integer>587</integer>
- <key>col</key><integer>16</integer>
- <key>file</key><integer>0</integer>
- </dict>
- </array>
- </array>
<key>extended_message</key>
<string>Field 'b' is equal to 2</string>
<key>message</key>
diff --git a/src/llvm-project/clang/test/Analysis/Inputs/expected-plists/inline-plist.c.plist b/src/llvm-project/clang/test/Analysis/Inputs/expected-plists/inline-plist.c.plist
index db6b5af..1ee17de 100644
--- a/src/llvm-project/clang/test/Analysis/Inputs/expected-plists/inline-plist.c.plist
+++ b/src/llvm-project/clang/test/Analysis/Inputs/expected-plists/inline-plist.c.plist
@@ -548,7 +548,7 @@
</dict>
<dict>
<key>line</key><integer>45</integer>
- <key>col</key><integer>12</integer>
+ <key>col</key><integer>7</integer>
<key>file</key><integer>0</integer>
</dict>
</array>
diff --git a/src/llvm-project/clang/test/Analysis/Inputs/expected-plists/nullability-notes.m.plist b/src/llvm-project/clang/test/Analysis/Inputs/expected-plists/nullability-notes.m.plist
index 314af1e..88cf2fa 100644
--- a/src/llvm-project/clang/test/Analysis/Inputs/expected-plists/nullability-notes.m.plist
+++ b/src/llvm-project/clang/test/Analysis/Inputs/expected-plists/nullability-notes.m.plist
@@ -16,12 +16,46 @@
<key>start</key>
<array>
<dict>
- <key>line</key><integer>16</integer>
+ <key>line</key><integer>31</integer>
<key>col</key><integer>3</integer>
<key>file</key><integer>0</integer>
</dict>
<dict>
- <key>line</key><integer>16</integer>
+ <key>line</key><integer>31</integer>
+ <key>col</key><integer>33</integer>
+ <key>file</key><integer>0</integer>
+ </dict>
+ </array>
+ <key>end</key>
+ <array>
+ <dict>
+ <key>line</key><integer>33</integer>
+ <key>col</key><integer>3</integer>
+ <key>file</key><integer>0</integer>
+ </dict>
+ <dict>
+ <key>line</key><integer>33</integer>
+ <key>col</key><integer>10</integer>
+ <key>file</key><integer>0</integer>
+ </dict>
+ </array>
+ </dict>
+ </array>
+ </dict>
+ <dict>
+ <key>kind</key><string>control</string>
+ <key>edges</key>
+ <array>
+ <dict>
+ <key>start</key>
+ <array>
+ <dict>
+ <key>line</key><integer>33</integer>
+ <key>col</key><integer>3</integer>
+ <key>file</key><integer>0</integer>
+ </dict>
+ <dict>
+ <key>line</key><integer>33</integer>
<key>col</key><integer>10</integer>
<key>file</key><integer>0</integer>
</dict>
@@ -29,12 +63,12 @@
<key>end</key>
<array>
<dict>
- <key>line</key><integer>16</integer>
+ <key>line</key><integer>33</integer>
<key>col</key><integer>22</integer>
<key>file</key><integer>0</integer>
</dict>
<dict>
- <key>line</key><integer>16</integer>
+ <key>line</key><integer>33</integer>
<key>col</key><integer>22</integer>
<key>file</key><integer>0</integer>
</dict>
@@ -46,7 +80,7 @@
<key>kind</key><string>event</string>
<key>location</key>
<dict>
- <key>line</key><integer>16</integer>
+ <key>line</key><integer>33</integer>
<key>col</key><integer>22</integer>
<key>file</key><integer>0</integer>
</dict>
@@ -54,12 +88,12 @@
<array>
<array>
<dict>
- <key>line</key><integer>16</integer>
+ <key>line</key><integer>33</integer>
<key>col</key><integer>22</integer>
<key>file</key><integer>0</integer>
</dict>
<dict>
- <key>line</key><integer>16</integer>
+ <key>line</key><integer>33</integer>
<key>col</key><integer>22</integer>
<key>file</key><integer>0</integer>
</dict>
@@ -79,12 +113,12 @@
<key>start</key>
<array>
<dict>
- <key>line</key><integer>16</integer>
+ <key>line</key><integer>33</integer>
<key>col</key><integer>22</integer>
<key>file</key><integer>0</integer>
</dict>
<dict>
- <key>line</key><integer>16</integer>
+ <key>line</key><integer>33</integer>
<key>col</key><integer>22</integer>
<key>file</key><integer>0</integer>
</dict>
@@ -92,12 +126,12 @@
<key>end</key>
<array>
<dict>
- <key>line</key><integer>16</integer>
+ <key>line</key><integer>33</integer>
<key>col</key><integer>3</integer>
<key>file</key><integer>0</integer>
</dict>
<dict>
- <key>line</key><integer>16</integer>
+ <key>line</key><integer>33</integer>
<key>col</key><integer>10</integer>
<key>file</key><integer>0</integer>
</dict>
@@ -113,12 +147,12 @@
<key>start</key>
<array>
<dict>
- <key>line</key><integer>16</integer>
+ <key>line</key><integer>33</integer>
<key>col</key><integer>3</integer>
<key>file</key><integer>0</integer>
</dict>
<dict>
- <key>line</key><integer>16</integer>
+ <key>line</key><integer>33</integer>
<key>col</key><integer>10</integer>
<key>file</key><integer>0</integer>
</dict>
@@ -126,12 +160,12 @@
<key>end</key>
<array>
<dict>
- <key>line</key><integer>17</integer>
+ <key>line</key><integer>36</integer>
<key>col</key><integer>3</integer>
<key>file</key><integer>0</integer>
</dict>
<dict>
- <key>line</key><integer>17</integer>
+ <key>line</key><integer>36</integer>
<key>col</key><integer>14</integer>
<key>file</key><integer>0</integer>
</dict>
@@ -143,7 +177,7 @@
<key>kind</key><string>event</string>
<key>location</key>
<dict>
- <key>line</key><integer>17</integer>
+ <key>line</key><integer>36</integer>
<key>col</key><integer>3</integer>
<key>file</key><integer>0</integer>
</dict>
@@ -151,12 +185,12 @@
<array>
<array>
<dict>
- <key>line</key><integer>17</integer>
+ <key>line</key><integer>36</integer>
<key>col</key><integer>16</integer>
<key>file</key><integer>0</integer>
</dict>
<dict>
- <key>line</key><integer>17</integer>
+ <key>line</key><integer>36</integer>
<key>col</key><integer>16</integer>
<key>file</key><integer>0</integer>
</dict>
@@ -177,10 +211,10 @@
<key>issue_hash_content_of_line_in_context</key><string>ff735bea0eb12d4d172b139143c32365</string>
<key>issue_context_kind</key><string>Objective-C method</string>
<key>issue_context</key><string>method</string>
- <key>issue_hash_function_offset</key><string>3</string>
+ <key>issue_hash_function_offset</key><string>6</string>
<key>location</key>
<dict>
- <key>line</key><integer>17</integer>
+ <key>line</key><integer>36</integer>
<key>col</key><integer>3</integer>
<key>file</key><integer>0</integer>
</dict>
@@ -188,10 +222,11 @@
<dict>
<key>0</key>
<array>
- <integer>10</integer>
- <integer>14</integer>
- <integer>16</integer>
- <integer>17</integer>
+ <integer>26</integer>
+ <integer>30</integer>
+ <integer>31</integer>
+ <integer>33</integer>
+ <integer>36</integer>
</array>
</dict>
</dict>
diff --git a/src/llvm-project/clang/test/Analysis/Inputs/expected-plists/objc-radar17039661.m.plist b/src/llvm-project/clang/test/Analysis/Inputs/expected-plists/objc-radar17039661.m.plist
index 926f827..3c87e39 100644
--- a/src/llvm-project/clang/test/Analysis/Inputs/expected-plists/objc-radar17039661.m.plist
+++ b/src/llvm-project/clang/test/Analysis/Inputs/expected-plists/objc-radar17039661.m.plist
@@ -836,7 +836,7 @@
</dict>
<dict>
<key>line</key><integer>38</integer>
- <key>col</key><integer>37</integer>
+ <key>col</key><integer>20</integer>
<key>file</key><integer>0</integer>
</dict>
</array>
diff --git a/src/llvm-project/clang/test/Analysis/Inputs/expected-plists/plist-output.m.plist b/src/llvm-project/clang/test/Analysis/Inputs/expected-plists/plist-output.m.plist
index 5b1de91..9203e48 100644
--- a/src/llvm-project/clang/test/Analysis/Inputs/expected-plists/plist-output.m.plist
+++ b/src/llvm-project/clang/test/Analysis/Inputs/expected-plists/plist-output.m.plist
@@ -2513,7 +2513,7 @@
</dict>
<dict>
<key>line</key><integer>96</integer>
- <key>col</key><integer>13</integer>
+ <key>col</key><integer>8</integer>
<key>file</key><integer>0</integer>
</dict>
</array>
@@ -2735,7 +2735,7 @@
</dict>
<dict>
<key>line</key><integer>96</integer>
- <key>col</key><integer>13</integer>
+ <key>col</key><integer>8</integer>
<key>file</key><integer>0</integer>
</dict>
</array>
@@ -3554,7 +3554,7 @@
</dict>
<dict>
<key>line</key><integer>127</integer>
- <key>col</key><integer>14</integer>
+ <key>col</key><integer>9</integer>
<key>file</key><integer>0</integer>
</dict>
</array>
@@ -3776,7 +3776,7 @@
</dict>
<dict>
<key>line</key><integer>127</integer>
- <key>col</key><integer>14</integer>
+ <key>col</key><integer>9</integer>
<key>file</key><integer>0</integer>
</dict>
</array>
@@ -6141,12 +6141,12 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>Null pointer passed as an argument to a 'nonnull' parameter</string>
+ <string>Null pointer passed to 1st parameter expecting 'nonnull'</string>
<key>message</key>
- <string>Null pointer passed as an argument to a 'nonnull' parameter</string>
+ <string>Null pointer passed to 1st parameter expecting 'nonnull'</string>
</dict>
</array>
- <key>description</key><string>Null pointer passed as an argument to a 'nonnull' parameter</string>
+ <key>description</key><string>Null pointer passed to 1st parameter expecting 'nonnull'</string>
<key>category</key><string>API</string>
<key>type</key><string>Argument with 'nonnull' attribute passed null</string>
<key>check_name</key><string>core.NonNullParamChecker</string>
diff --git a/src/llvm-project/clang/test/Analysis/Inputs/llvm.h b/src/llvm-project/clang/test/Analysis/Inputs/llvm.h
new file mode 100644
index 0000000..c9d66ba
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/Inputs/llvm.h
@@ -0,0 +1,30 @@
+#pragma clang system_header
+
+#include "system-header-simulator-cxx.h"
+
+namespace llvm {
+template <class X, class Y>
+const X *cast(Y Value);
+
+template <class X, class Y>
+const X *dyn_cast(Y *Value);
+template <class X, class Y>
+const X &dyn_cast(Y &Value);
+
+template <class X, class Y>
+const X *cast_or_null(Y Value);
+
+template <class X, class Y>
+const X *dyn_cast_or_null(Y *Value);
+template <class X, class Y>
+const X *dyn_cast_or_null(Y &Value);
+
+template <class X, class Y>
+bool isa(Y Value);
+
+template <class X, class Y>
+bool isa_and_nonnull(Y Value);
+
+template <typename X, typename Y>
+std::unique_ptr<X> cast(std::unique_ptr<Y> &&Value);
+} // namespace llvm
diff --git a/src/llvm-project/clang/test/Analysis/Inputs/plist-macros-ctu.c b/src/llvm-project/clang/test/Analysis/Inputs/plist-macros-ctu.c
new file mode 100644
index 0000000..f3e374c
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/Inputs/plist-macros-ctu.c
@@ -0,0 +1,21 @@
+
+#include "plist-macros-ctu.h"
+
+#define M *X = (int *)0
+
+void F1(int **X) {
+ M;
+}
+
+#undef M
+#define M *Y = (int *)0
+
+void F2(int **Y) {
+ M;
+}
+
+#define M1 *Z = (int *)0
+
+void F3(int **Z) {
+ M1;
+}
diff --git a/src/llvm-project/clang/test/Analysis/Inputs/plist-macros-ctu.h b/src/llvm-project/clang/test/Analysis/Inputs/plist-macros-ctu.h
new file mode 100644
index 0000000..0b1b9d7
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/Inputs/plist-macros-ctu.h
@@ -0,0 +1,4 @@
+#define M_H *A = (int *)0
+void F_H(int **A) {
+ M_H;
+}
diff --git a/src/llvm-project/clang/test/Analysis/Inputs/plist-macros-with-expansion-ctu.c.externalDefMap.txt b/src/llvm-project/clang/test/Analysis/Inputs/plist-macros-with-expansion-ctu.c.externalDefMap.txt
new file mode 100644
index 0000000..52214a4
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/Inputs/plist-macros-with-expansion-ctu.c.externalDefMap.txt
@@ -0,0 +1,4 @@
+c:@F@F1 plist-macros-ctu.c.ast
+c:@F@F2 plist-macros-ctu.c.ast
+c:@F@F3 plist-macros-ctu.c.ast
+c:@F@F_H plist-macros-ctu.c.ast
diff --git a/src/llvm-project/clang/test/Analysis/Inputs/system-header-simulator-cxx.h b/src/llvm-project/clang/test/Analysis/Inputs/system-header-simulator-cxx.h
index 30b25b8..77b8762 100644
--- a/src/llvm-project/clang/test/Analysis/Inputs/system-header-simulator-cxx.h
+++ b/src/llvm-project/clang/test/Analysis/Inputs/system-header-simulator-cxx.h
@@ -74,8 +74,12 @@
difference_type operator-(const __vector_iterator<U, Ptr2, Ref2> &rhs);
Ref operator*() const { return *ptr; }
- Ptr operator->() const { return *ptr; }
+ Ptr operator->() const { return ptr; }
+ Ref operator[](difference_type n) {
+ return *(ptr+n);
+ }
+
bool operator==(const iterator &rhs) const { return ptr == rhs.ptr; }
bool operator==(const const_iterator &rhs) const { return ptr == rhs.ptr; }
@@ -125,8 +129,12 @@
}
Ref operator*() const { return *ptr; }
- Ptr operator->() const { return *ptr; }
+ Ptr operator->() const { return ptr; }
+ Ref operator[](difference_type n) {
+ return *(ptr+n);
+ }
+
bool operator==(const iterator &rhs) const { return ptr == rhs.ptr; }
bool operator==(const const_iterator &rhs) const { return ptr == rhs.ptr; }
@@ -150,7 +158,7 @@
typedef std::bidirectional_iterator_tag iterator_category;
__list_iterator(T* it = 0) : item(it) {}
- __list_iterator(const iterator &rhs): item(rhs.base()) {}
+ __list_iterator(const iterator &rhs): item(rhs.item) {}
__list_iterator<T, Ptr, Ref> operator++() { item = item->next; return *this; }
__list_iterator<T, Ptr, Ref> operator++(int) {
auto tmp = *this;
@@ -165,7 +173,7 @@
}
Ref operator*() const { return item->data; }
- Ptr operator->() const { return item->data; }
+ Ptr operator->() const { return &item->data; }
bool operator==(const iterator &rhs) const { return item == rhs->item; }
bool operator==(const const_iterator &rhs) const { return item == rhs->item; }
@@ -175,6 +183,9 @@
const T* &base() const { return item; }
+ template <typename UT, typename UPtr, typename URef>
+ friend struct __list_iterator;
+
private:
T* item;
};
@@ -190,7 +201,7 @@
typedef std::forward_iterator_tag iterator_category;
__fwdl_iterator(T* it = 0) : item(it) {}
- __fwdl_iterator(const iterator &rhs): item(rhs.base()) {}
+ __fwdl_iterator(const iterator &rhs): item(rhs.item) {}
__fwdl_iterator<T, Ptr, Ref> operator++() { item = item->next; return *this; }
__fwdl_iterator<T, Ptr, Ref> operator++(int) {
auto tmp = *this;
@@ -198,7 +209,7 @@
return tmp;
}
Ref operator*() const { return item->data; }
- Ptr operator->() const { return item->data; }
+ Ptr operator->() const { return &item->data; }
bool operator==(const iterator &rhs) const { return item == rhs->item; }
bool operator==(const const_iterator &rhs) const { return item == rhs->item; }
@@ -208,6 +219,9 @@
const T* &base() const { return item; }
+ template <typename UT, typename UPtr, typename URef>
+ friend struct __fwdl_iterator;
+
private:
T* item;
};
@@ -249,15 +263,16 @@
template<typename T>
class vector {
+ T *_start;
+ T *_finish;
+ T *_end_of_storage;
+
+ public:
typedef T value_type;
typedef size_t size_type;
typedef __vector_iterator<T, T *, T &> iterator;
typedef __vector_iterator<T, const T *, const T &> const_iterator;
- T *_start;
- T *_finish;
- T *_end_of_storage;
- public:
vector() : _start(0), _finish(0), _end_of_storage(0) {}
template <typename InputIterator>
vector(InputIterator first, InputIterator last);
@@ -327,6 +342,7 @@
T data;
__item *prev, *next;
} *_start, *_finish;
+
public:
typedef T value_type;
typedef size_t size_type;
@@ -393,15 +409,16 @@
template<typename T>
class deque {
+ T *_start;
+ T *_finish;
+ T *_end_of_storage;
+
+ public:
typedef T value_type;
typedef size_t size_type;
typedef __deque_iterator<T, T *, T &> iterator;
typedef __deque_iterator<T, const T *, const T &> const_iterator;
- T *_start;
- T *_finish;
- T *_end_of_storage;
- public:
deque() : _start(0), _finish(0), _end_of_storage(0) {}
template <typename InputIterator>
deque(InputIterator first, InputIterator last);
@@ -477,6 +494,7 @@
T data;
__item *next;
} *_start;
+
public:
typedef T value_type;
typedef size_t size_type;
diff --git a/src/llvm-project/clang/test/Analysis/Inputs/system-header-simulator-objc.h b/src/llvm-project/clang/test/Analysis/Inputs/system-header-simulator-objc.h
index df751d0..0dc6b36 100644
--- a/src/llvm-project/clang/test/Analysis/Inputs/system-header-simulator-objc.h
+++ b/src/llvm-project/clang/test/Analysis/Inputs/system-header-simulator-objc.h
@@ -117,7 +117,10 @@
+ (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;
+- (id)initWithBytesNoCopy:(void *)bytes
+ length:(NSUInteger)length
+ deallocator:(void (^)(void *bytes, NSUInteger length))deallocator;
+- (id)initWithBytes:(void *)bytes length:(NSUInteger)length;
@end
typedef struct {
diff --git a/src/llvm-project/clang/test/Analysis/Inputs/taint-generic-config-ill-formed.yaml b/src/llvm-project/clang/test/Analysis/Inputs/taint-generic-config-ill-formed.yaml
new file mode 100755
index 0000000..9b79b32
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/Inputs/taint-generic-config-ill-formed.yaml
@@ -0,0 +1,4 @@
+Propagations:
+ - Name: mySource1
+ DstArgs: [-1]
+ NotExist: 1
diff --git a/src/llvm-project/clang/test/Analysis/Inputs/taint-generic-config-invalid-arg.yaml b/src/llvm-project/clang/test/Analysis/Inputs/taint-generic-config-invalid-arg.yaml
new file mode 100755
index 0000000..c06aef8
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/Inputs/taint-generic-config-invalid-arg.yaml
@@ -0,0 +1,3 @@
+Propagations:
+ - Name: mySource1
+ DstArgs: [-2]
diff --git a/src/llvm-project/clang/test/Analysis/Inputs/taint-generic-config.yaml b/src/llvm-project/clang/test/Analysis/Inputs/taint-generic-config.yaml
new file mode 100755
index 0000000..39b52cc
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/Inputs/taint-generic-config.yaml
@@ -0,0 +1,91 @@
+# A list of source/propagation function
+Propagations:
+ # int x = mySource1(); // x is tainted
+ - Name: mySource1
+ DstArgs: [-1] # Index for return value
+
+ # int x;
+ # mySource2(&x); // x is tainted
+ - Name: mySource2
+ DstArgs: [0]
+
+ # int x = myNamespace::mySource3(); // x is tainted
+ - Name: mySource3
+ Scope: "myNamespace::"
+ DstArgs: [-1]
+
+ # int x = myAnotherNamespace::mySource3(); // x is tainted
+ - Name: mySource3
+ Scope: "myAnotherNamespace::"
+ DstArgs: [-1]
+
+ # int x, y;
+ # myScanf("%d %d", &x, &y); // x and y are tainted
+ - Name: myScanf
+ VariadicType: Dst
+ VariadicIndex: 1
+
+ # int x, y;
+ # Foo::myScanf("%d %d", &x, &y); // x and y are tainted
+ - Name: myMemberScanf
+ Scope: "Foo::"
+ VariadicType: Dst
+ VariadicIndex: 1
+
+ # int x; // x is tainted
+ # int y;
+ # myPropagator(x, &y); // y is tainted
+ - Name: myPropagator
+ SrcArgs: [0]
+ DstArgs: [1]
+
+ # constexpr unsigned size = 100;
+ # char buf[size];
+ # int x, y;
+ # int n = mySprintf(buf, size, "%d %d", x, y); // If size, x or y is tainted
+ # // the return value and the buf will be tainted
+ - Name: mySnprintf
+ SrcArgs: [1]
+ DstArgs: [0, -1]
+ VariadicType: Src
+ VariadicIndex: 3
+
+# A list of filter functions
+Filters:
+ # int x; // x is tainted
+ # isOutOfRange(&x); // x is not tainted anymore
+ - Name: isOutOfRange
+ Args: [0]
+
+ # int x; // x is tainted
+ # myNamespace::isOutOfRange(&x); // x is not tainted anymore
+ - Name: isOutOfRange2
+ Scope: "myNamespace::"
+ Args: [0]
+
+ # int x; // x is tainted
+ # myAnotherNamespace::isOutOfRange(&x); // x is not tainted anymore
+ - Name: isOutOfRange2
+ Scope: "myAnotherNamespace::"
+ Args: [0]
+
+# A list of sink functions
+Sinks:
+ # int x, y; // x and y are tainted
+ # mySink(x, 0, 1); // It will warn
+ # mySink(0, 1, y); // It will warn
+ # mySink(0, x, 1); // It won't warn
+ - Name: mySink
+ Args: [0, 2]
+
+ # int x; // x is tainted
+ # myNamespace::mySink(x); // It will warn
+ - Name: mySink2
+ Scope: "myNamespace::"
+ Args: [0]
+
+ # int x; // x is tainted
+ # myAnotherNamespace::mySink(x); // It will warn
+ - Name: mySink2
+ Scope: "myAnotherNamespace::"
+ Args: [0]
diff --git a/src/llvm-project/clang/test/Analysis/NSContainers.m b/src/llvm-project/clang/test/Analysis/NSContainers.m
index ac33efc..74db771 100644
--- a/src/llvm-project/clang/test/Analysis/NSContainers.m
+++ b/src/llvm-project/clang/test/Analysis/NSContainers.m
@@ -2,6 +2,8 @@
void clang_analyzer_eval(int);
+#define nil ((id)0)
+
typedef unsigned long NSUInteger;
typedef signed char BOOL;
typedef struct _NSZone NSZone;
@@ -310,3 +312,14 @@
// here either.
[subviews addObject:view]; // no-warning
}
+
+NSString *getStringFromString(NSString *string) {
+ if (!string)
+ return nil;
+ return @"New String";
+}
+void testInlinedDefensiveCheck(NSMutableDictionary *dict, id obj) {
+ // The check in getStringFromString() is not a good indication
+ // that 'obj' can be nil in this context.
+ dict[obj] = getStringFromString(obj); // no-warning
+}
diff --git a/src/llvm-project/clang/test/Analysis/a_flaky_crash.cpp b/src/llvm-project/clang/test/Analysis/a_flaky_crash.cpp
new file mode 100644
index 0000000..04bd578
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/a_flaky_crash.cpp
@@ -0,0 +1,277 @@
+// This code used to crash but unpredictably and rarely.
+// Even with the current set of run-lines, if a buildbot tells you that
+// you broke this test there's a chance that someone else broke it
+// a few commits ago.
+
+struct S {
+ S();
+ ~S();
+};
+
+bool bar(S);
+
+// no-crash during diagnostic construction.
+void foo() {
+ int x;
+ if (true && bar(S()))
+ ++x; // expected-warning{{The expression is an uninitialized value. The computed value will also be garbage}}
+}
+
+// 256 copies of the same run-line to make it crash more often when it breaks.
+
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
diff --git a/src/llvm-project/clang/test/Analysis/aggrinit-cfg-output.cpp b/src/llvm-project/clang/test/Analysis/aggrinit-cfg-output.cpp
new file mode 100644
index 0000000..2e95a7f
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/aggrinit-cfg-output.cpp
@@ -0,0 +1,28 @@
+// RUN: %clang_cc1 -analyze -analyzer-checker=debug.DumpCFG -analyzer-config cfg-expand-default-aggr-inits=true %s > %t 2>&1
+// RUN: FileCheck --input-file=%t %s
+
+static char a[] = "foobar";
+
+struct StringRef {
+ const char *member = nullptr;
+ int len = 3;
+};
+
+int main() {
+ StringRef s{a};
+ (void)s;
+}
+
+// CHECK: [B1]
+// CHECK-NEXT: 1: a
+// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, ArrayToPointerDecay, char *)
+// CHECK-NEXT: 3: [B1.2] (ImplicitCastExpr, NoOp, const char *)
+// CHECK-NEXT: 4: 3
+// CHECK-NEXT: 5:
+// CHECK-NEXT: 6: {[B1.1]}
+// CHECK-NEXT: 7: StringRef s{a};
+// CHECK-NEXT: 8: s
+// CHECK-NEXT: 9: (void)[B1.8] (CStyleCastExpr, ToVoid, void)
+// CHECK-NEXT: Preds (1): B2
+// CHECK-NEXT: Succs (1): B0
+
diff --git a/src/llvm-project/clang/test/Analysis/analyzer-config.c b/src/llvm-project/clang/test/Analysis/analyzer-config.c
index 26fa5d2..4707da3 100644
--- a/src/llvm-project/clang/test/Analysis/analyzer-config.c
+++ b/src/llvm-project/clang/test/Analysis/analyzer-config.c
@@ -9,6 +9,7 @@
// CHECK-NEXT: alpha.clone.CloneChecker:ReportNormalClones = true
// CHECK-NEXT: alpha.security.MmapWriteExec:MmapProtExec = 0x04
// CHECK-NEXT: alpha.security.MmapWriteExec:MmapProtRead = 0x01
+// CHECK-NEXT: alpha.security.taint.TaintPropagation:Config = ""
// CHECK-NEXT: avoid-suppressing-null-argument-paths = false
// CHECK-NEXT: c++-allocator-inlining = true
// CHECK-NEXT: c++-container-inlining = false
@@ -18,6 +19,7 @@
// CHECK-NEXT: c++-temp-dtor-inlining = true
// CHECK-NEXT: c++-template-inlining = true
// CHECK-NEXT: cfg-conditional-static-initializers = true
+// CHECK-NEXT: cfg-expand-default-aggr-inits = false
// CHECK-NEXT: cfg-implicit-dtors = true
// CHECK-NEXT: cfg-lifetime = false
// CHECK-NEXT: cfg-loopexit = false
@@ -29,11 +31,14 @@
// CHECK-NEXT: ctu-dir = ""
// CHECK-NEXT: ctu-import-threshold = 100
// CHECK-NEXT: ctu-index-name = externalDefMap.txt
+// CHECK-NEXT: deadcode.DeadStores:ShowFixIts = false
+// CHECK-NEXT: deadcode.DeadStores:WarnForDeadNestedAssignments = true
// CHECK-NEXT: debug.AnalysisOrder:* = false
// CHECK-NEXT: debug.AnalysisOrder:Bind = false
// CHECK-NEXT: debug.AnalysisOrder:EndFunction = false
// CHECK-NEXT: debug.AnalysisOrder:LiveSymbols = false
// CHECK-NEXT: debug.AnalysisOrder:NewAllocator = false
+// CHECK-NEXT: debug.AnalysisOrder:PointerEscape = false
// CHECK-NEXT: debug.AnalysisOrder:PostCall = false
// CHECK-NEXT: debug.AnalysisOrder:PostStmtArraySubscriptExpr = false
// CHECK-NEXT: debug.AnalysisOrder:PostStmtCXXNewExpr = false
@@ -52,6 +57,7 @@
// CHECK-NEXT: experimental-enable-naive-ctu-analysis = false
// CHECK-NEXT: exploration_strategy = unexplored_first_queue
// CHECK-NEXT: faux-bodies = true
+// CHECK-NEXT: fixits-as-remarks = false
// CHECK-NEXT: graph-trim-interval = 1000
// CHECK-NEXT: inline-lambdas = true
// CHECK-NEXT: ipa = dynamic-bifurcate
@@ -72,6 +78,7 @@
// CHECK-NEXT: optin.cplusplus.UninitializedObject:NotesAsWarnings = false
// CHECK-NEXT: optin.cplusplus.UninitializedObject:Pedantic = false
// CHECK-NEXT: optin.cplusplus.VirtualCall:PureOnly = false
+// CHECK-NEXT: optin.cplusplus.VirtualCall:ShowFixIts = false
// CHECK-NEXT: optin.osx.cocoa.localizability.NonLocalizedStringChecker:AggressiveReport = false
// CHECK-NEXT: optin.performance.Padding:AllowedPad = 24
// CHECK-NEXT: osx.NumberObjectConversion:Pedantic = false
@@ -81,14 +88,15 @@
// CHECK-NEXT: region-store-small-struct-limit = 2
// CHECK-NEXT: report-in-main-source-file = false
// CHECK-NEXT: serialize-stats = false
+// CHECK-NEXT: silence-checkers = ""
// CHECK-NEXT: stable-report-filename = false
// CHECK-NEXT: suppress-c++-stdlib = true
// CHECK-NEXT: suppress-inlined-defensive-checks = true
// CHECK-NEXT: suppress-null-return-paths = true
-// CHECK-NEXT: track-conditions = false
+// CHECK-NEXT: track-conditions = true
// CHECK-NEXT: track-conditions-debug = false
// CHECK-NEXT: unix.DynamicMemoryModeling:Optimistic = false
// CHECK-NEXT: unroll-loops = false
// CHECK-NEXT: widen-loops = false
// CHECK-NEXT: [stats]
-// CHECK-NEXT: num-entries = 88
+// CHECK-NEXT: num-entries = 96
diff --git a/src/llvm-project/clang/test/Analysis/analyzer-enabled-checkers.c b/src/llvm-project/clang/test/Analysis/analyzer-enabled-checkers.c
index 0ea01a0..ba850ec 100644
--- a/src/llvm-project/clang/test/Analysis/analyzer-enabled-checkers.c
+++ b/src/llvm-project/clang/test/Analysis/analyzer-enabled-checkers.c
@@ -1,20 +1,54 @@
-// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 %s -o /dev/null -analyzer-checker=core -analyzer-list-enabled-checkers > %t 2>&1
-// RUN: FileCheck --input-file=%t %s
+// RUN: %clang --analyze %s --target=x86_64-pc-linux-gnu \
+// RUN: -Xclang -analyzer-list-enabled-checkers \
+// RUN: -Xclang -analyzer-display-progress \
+// RUN: 2>&1 | FileCheck %s --implicit-check-not=ANALYZE \
+// RUN: --implicit-check-not=\.
-// CHECK: OVERVIEW: Clang Static Analyzer Enabled Checkers List
-// CHECK: core.CallAndMessage
-// CHECK: core.DivideZero
-// CHECK: core.DynamicTypePropagation
-// CHECK: core.NonNullParamChecker
-// CHECK: core.NullDereference
-// CHECK: core.StackAddressEscape
-// CHECK: core.UndefinedBinaryOperatorResult
-// CHECK: core.VLASize
-// CHECK: core.builtin.BuiltinFunctions
-// CHECK: core.builtin.NoReturnFunctions
-// CHECK: core.uninitialized.ArraySubscript
-// CHECK: core.uninitialized.Assign
-// CHECK: core.uninitialized.Branch
-// CHECK: core.uninitialized.CapturedBlockVariable
-// CHECK: core.uninitialized.UndefReturn
+// CHECK: OVERVIEW: Clang Static Analyzer Enabled Checkers List
+// CHECK-EMPTY:
+// CHECK-NEXT: apiModeling.StdCLibraryFunctions
+// CHECK-NEXT: apiModeling.TrustNonnull
+// CHECK-NEXT: apiModeling.llvm.CastValue
+// CHECK-NEXT: apiModeling.llvm.ReturnValue
+// CHECK-NEXT: core.CallAndMessage
+// CHECK-NEXT: core.DivideZero
+// CHECK-NEXT: core.DynamicTypePropagation
+// CHECK-NEXT: core.NonNullParamChecker
+// CHECK-NEXT: core.NonnilStringConstants
+// CHECK-NEXT: core.NullDereference
+// CHECK-NEXT: core.StackAddrEscapeBase
+// CHECK-NEXT: core.StackAddressEscape
+// CHECK-NEXT: core.UndefinedBinaryOperatorResult
+// CHECK-NEXT: core.VLASize
+// CHECK-NEXT: core.builtin.BuiltinFunctions
+// CHECK-NEXT: core.builtin.NoReturnFunctions
+// CHECK-NEXT: core.uninitialized.ArraySubscript
+// CHECK-NEXT: core.uninitialized.Assign
+// CHECK-NEXT: core.uninitialized.Branch
+// CHECK-NEXT: core.uninitialized.CapturedBlockVariable
+// CHECK-NEXT: core.uninitialized.UndefReturn
+// CHECK-NEXT: deadcode.DeadStores
+// CHECK-NEXT: nullability.NullabilityBase
+// CHECK-NEXT: nullability.NullPassedToNonnull
+// CHECK-NEXT: nullability.NullReturnedFromNonnull
+// CHECK-NEXT: security.insecureAPI.SecuritySyntaxChecker
+// CHECK-NEXT: security.insecureAPI.UncheckedReturn
+// CHECK-NEXT: security.insecureAPI.getpw
+// CHECK-NEXT: security.insecureAPI.gets
+// CHECK-NEXT: security.insecureAPI.mkstemp
+// CHECK-NEXT: security.insecureAPI.mktemp
+// CHECK-NEXT: security.insecureAPI.vfork
+// CHECK-NEXT: unix.API
+// CHECK-NEXT: unix.cstring.CStringModeling
+// CHECK-NEXT: unix.DynamicMemoryModeling
+// CHECK-NEXT: unix.Malloc
+// CHECK-NEXT: unix.MallocSizeof
+// CHECK-NEXT: unix.MismatchedDeallocator
+// CHECK-NEXT: unix.Vfork
+// CHECK-NEXT: unix.cstring.BadSizeArg
+// CHECK-NEXT: unix.cstring.NullArg
+int main() {
+ int i;
+ (void)(10 / i);
+}
diff --git a/src/llvm-project/clang/test/Analysis/array-struct-region.cpp b/src/llvm-project/clang/test/Analysis/array-struct-region.cpp
index cfb57d3..1b9fa3e 100644
--- a/src/llvm-project/clang/test/Analysis/array-struct-region.cpp
+++ b/src/llvm-project/clang/test/Analysis/array-struct-region.cpp
@@ -1,20 +1,26 @@
// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core\
// RUN: -analyzer-checker=debug.ExprInspection -verify\
+// RUN: -Wno-tautological-compare\
// RUN: -x c %s
// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core\
// RUN: -analyzer-checker=debug.ExprInspection -verify\
+// RUN: -Wno-tautological-compare\
// RUN: -x c++ -std=c++14 %s
// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core\
// RUN: -analyzer-checker=debug.ExprInspection -verify\
+// RUN: -Wno-tautological-compare\
// RUN: -x c++ -std=c++17 %s
// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core\
// RUN: -analyzer-checker=debug.ExprInspection -verify\
+// RUN: -Wno-tautological-compare\
// RUN: -DINLINE -x c %s
// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core\
// RUN: -analyzer-checker=debug.ExprInspection -verify\
+// RUN: -Wno-tautological-compare\
// RUN: -DINLINE -x c++ -std=c++14 %s
// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core\
// RUN: -analyzer-checker=debug.ExprInspection -verify\
+// RUN: -Wno-tautological-compare\
// RUN: -DINLINE -x c++ -std=c++17 %s
void clang_analyzer_eval(int);
diff --git a/src/llvm-project/clang/test/Analysis/auto-obj-dtors-cfg-output.cpp b/src/llvm-project/clang/test/Analysis/auto-obj-dtors-cfg-output.cpp
index 7e678a1..716eaf3 100644
--- a/src/llvm-project/clang/test/Analysis/auto-obj-dtors-cfg-output.cpp
+++ b/src/llvm-project/clang/test/Analysis/auto-obj-dtors-cfg-output.cpp
@@ -334,7 +334,7 @@
// CHECK-NEXT: 61: ~A() (Temporary object destructor)
// CHECK-NEXT: 62: ~A() (Temporary object destructor)
// CHECK-NEXT: 63: ~A() (Temporary object destructor)
-// CHECK-NEXT: 64: [B1.57].~D() (Implicit destructor)
+// CHECK-NEXT: 64: [B1.57].~D [2]() (Implicit destructor)
// CHECK-NEXT: 65: [B1.18].~D() (Implicit destructor)
// CHECK-NEXT: Preds (1): B2
// CHECK-NEXT: Succs (1): B0
@@ -363,7 +363,7 @@
// WARNINGS-NEXT: 3: (CXXConstructExpr, class A [0])
// ANALYZER-NEXT: 3: (CXXConstructExpr, [B1.4], class A [0])
// CHECK-NEXT: 4: A b[0];
-// CHECK-NEXT: 5: [B1.2].~A() (Implicit destructor)
+// CHECK-NEXT: 5: [B1.2].~A [2]() (Implicit destructor)
// CHECK-NEXT: Preds (1): B2
// CHECK-NEXT: Succs (1): B0
// CHECK: [B0 (EXIT)]
diff --git a/src/llvm-project/clang/test/Analysis/blocks.m b/src/llvm-project/clang/test/Analysis/blocks.m
index 98d0f8a..a21a605 100644
--- a/src/llvm-project/clang/test/Analysis/blocks.m
+++ b/src/llvm-project/clang/test/Analysis/blocks.m
@@ -47,6 +47,10 @@
aslclient asl_open(const char *ident, const char *facility, uint32_t opts);
int asl_log(aslclient asl, aslmsg msg, int level, const char *format, ...) __attribute__((__format__ (__printf__, 4, 5)));
+struct Block_layout {
+ int flags;
+};
+
//===----------------------------------------------------------------------===//
// Begin actual test cases.
//===----------------------------------------------------------------------===//
@@ -241,3 +245,8 @@
b(); // expected-warning {{Block taking 1 argument is called with fewer (0)}}
}
#endif
+
+int getBlockFlags() {
+ int x = 0;
+ return ((struct Block_layout *)^{ (void)x; })->flags; // no-warning
+}
diff --git a/src/llvm-project/clang/test/Analysis/bsd-string.c b/src/llvm-project/clang/test/Analysis/bsd-string.c
index 6e04a62..adb8721 100644
--- a/src/llvm-project/clang/test/Analysis/bsd-string.c
+++ b/src/llvm-project/clang/test/Analysis/bsd-string.c
@@ -1,4 +1,4 @@
-// RUN: %clang_analyze_cc1 -verify %s \
+// RUN: %clang_analyze_cc1 -w -verify %s \
// RUN: -analyzer-checker=core \
// RUN: -analyzer-checker=unix.cstring.NullArg \
// RUN: -analyzer-checker=alpha.unix.cstring \
@@ -9,6 +9,7 @@
typedef __typeof(sizeof(int)) size_t;
size_t strlcpy(char *dst, const char *src, size_t n);
size_t strlcat(char *dst, const char *src, size_t n);
+size_t strlen(const char *s);
void clang_analyzer_eval(int);
void f1() {
@@ -18,9 +19,11 @@
void f2() {
char buf[5];
- strlcpy(buf, "abcd", sizeof(buf)); // expected-no-warning
- // FIXME: This should not warn. The string is safely truncated.
- strlcat(buf, "efgh", sizeof(buf)); // expected-warning{{Size argument is greater than the free space in the destination buffer}}
+ size_t len;
+ len = strlcpy(buf, "abcd", sizeof(buf)); // expected-no-warning
+ clang_analyzer_eval(len == 4); // expected-warning{{TRUE}}
+ len = strlcat(buf, "efgh", sizeof(buf)); // expected-no-warning
+ clang_analyzer_eval(len == 8); // expected-warning{{TRUE}}
}
void f3() {
@@ -30,11 +33,11 @@
}
void f4() {
- strlcpy(NULL, "abcdef", 6); // expected-warning{{Null pointer argument in call to string copy function}}
+ strlcpy(NULL, "abcdef", 6); // expected-warning{{Null pointer passed as 1st argument to string copy function}}
}
void f5() {
- strlcat(NULL, "abcdef", 6); // expected-warning{{Null pointer argument in call to string copy function}}
+ strlcat(NULL, "abcdef", 6); // expected-warning{{Null pointer passed as 1st argument to string concatenation function}}
}
void f6() {
@@ -48,3 +51,89 @@
char buf[8];
return strlcpy(buf, "1234567", 0); // no-crash
}
+
+void f8(){
+ char buf[5];
+ size_t len;
+
+ // basic strlcpy
+ len = strlcpy(buf,"123", sizeof(buf));
+ clang_analyzer_eval(len==3);// expected-warning{{TRUE}}
+ len = strlen(buf);
+ clang_analyzer_eval(len==3);// expected-warning{{TRUE}}
+
+ // testing bounded strlcat
+ len = strlcat(buf,"456", sizeof(buf));
+ clang_analyzer_eval(len==6);// expected-warning{{TRUE}}
+ len = strlen(buf);
+ clang_analyzer_eval(len==4);// expected-warning{{TRUE}}
+
+ // testing strlcat with size==0
+ len = strlcat(buf,"789", 0);
+ clang_analyzer_eval(len==7);// expected-warning{{TRUE}}
+ len = strlen(buf);
+ clang_analyzer_eval(len==4);// expected-warning{{TRUE}}
+
+ // testing strlcpy with size==0
+ len = strlcpy(buf,"123",0);
+ clang_analyzer_eval(len==3);// expected-warning{{TRUE}}
+ len = strlen(buf);
+ clang_analyzer_eval(len==4);// expected-warning{{TRUE}}
+
+}
+
+void f9(int unknown_size, char* unknown_src, char* unknown_dst){
+ char buf[8];
+ size_t len;
+
+ len = strlcpy(buf,"abba",sizeof(buf));
+
+ clang_analyzer_eval(len==4);// expected-warning{{TRUE}}
+ clang_analyzer_eval(strlen(buf)==4);// expected-warning{{TRUE}}
+
+ //size is unknown
+ len = strlcat(buf,"cd", unknown_size);
+ clang_analyzer_eval(len==6);// expected-warning{{TRUE}}
+ clang_analyzer_eval(strlen(buf)>=4);// expected-warning{{TRUE}}
+
+ //dst is unknown
+ len = strlcpy(unknown_dst,"abbc",unknown_size);
+ clang_analyzer_eval(len==4);// expected-warning{{TRUE}}
+ clang_analyzer_eval(strlen(unknown_dst));// expected-warning{{UNKNOWN}}
+
+ //src is unknown
+ len = strlcpy(buf,unknown_src, sizeof(buf));
+ clang_analyzer_eval(len);// expected-warning{{UNKNOWN}}
+ clang_analyzer_eval(strlen(buf));// expected-warning{{UNKNOWN}}
+
+ //src, dst is unknown
+ len = strlcpy(unknown_dst, unknown_src, unknown_size);
+ clang_analyzer_eval(len);// expected-warning{{UNKNOWN}}
+ clang_analyzer_eval(strlen(unknown_dst));// expected-warning{{UNKNOWN}}
+
+ //size is unknown
+ len = strlcat(buf+2,unknown_src+1, sizeof(buf));// expected-warning{{Size argument is greater than the length of the destination buffer}};
+}
+
+void f10(){
+ char buf[8];
+ size_t len;
+
+ len = strlcpy(buf,"abba",sizeof(buf));
+ clang_analyzer_eval(len==4);// expected-warning{{TRUE}}
+ strlcat(buf, "efghi",9);// expected-warning{{Size argument is greater than the length of the destination buffer}}
+}
+
+void f11() {
+ //test for Bug 41729
+ char a[256], b[256];
+ strlcpy(a, "world", sizeof(a));
+ strlcpy(b, "hello ", sizeof(b));
+ strlcat(b, a, sizeof(b)); // no-warning
+}
+
+int a, b;
+void unknown_val_crash() {
+ // We're unable to evaluate the integer-to-pointer cast.
+ strlcat(&b, a, 0); // no-crash
+}
diff --git a/src/llvm-project/clang/test/Analysis/bstring.c b/src/llvm-project/clang/test/Analysis/bstring.c
index beabb0f..214f653 100644
--- a/src/llvm-project/clang/test/Analysis/bstring.c
+++ b/src/llvm-project/clang/test/Analysis/bstring.c
@@ -148,12 +148,12 @@
void memcpy10() {
char a[4] = {0};
- memcpy(0, a, 4); // expected-warning{{Null pointer argument in call to memory copy function}}
+ memcpy(0, a, 4); // expected-warning{{Null pointer passed as 1st argument to memory copy function}}
}
void memcpy11() {
char a[4] = {0};
- memcpy(a, 0, 4); // expected-warning{{Null pointer argument in call to memory copy function}}
+ memcpy(a, 0, 4); // expected-warning{{Null pointer passed as 2nd argument to memory copy function}}
}
void memcpy12() {
@@ -173,7 +173,7 @@
void memcpy_unknown_size_warn (size_t n) {
char a[4];
- void *result = memcpy(a, 0, n); // expected-warning{{Null pointer argument in call to memory copy function}}
+ void *result = memcpy(a, 0, n); // expected-warning{{Null pointer passed as 2nd argument to memory copy function}}
clang_analyzer_eval(result == a); // no-warning (above is fatal)
}
@@ -222,6 +222,9 @@
char dst[1];
mempcpy(dst, src, 4); // expected-warning{{Memory copy function overflows destination buffer}}
+#ifndef VARIANT
+// expected-warning@-2{{'mempcpy' will always overflow; destination buffer has size 1, but size argument is 4}}
+#endif
}
void mempcpy3 () {
@@ -243,6 +246,9 @@
char dst[3];
mempcpy(dst+2, src+2, 2); // expected-warning{{Memory copy function overflows destination buffer}}
+#ifndef VARIANT
+// expected-warning@-2{{'mempcpy' will always overflow; destination buffer has size 1, but size argument is 2}}
+#endif
}
void mempcpy6() {
@@ -268,12 +274,12 @@
void mempcpy10() {
char a[4] = {0};
- mempcpy(0, a, 4); // expected-warning{{Null pointer argument in call to memory copy function}}
+ mempcpy(0, a, 4); // expected-warning{{Null pointer passed as 1st argument to memory copy function}}
}
void mempcpy11() {
char a[4] = {0};
- mempcpy(a, 0, 4); // expected-warning{{Null pointer argument in call to memory copy function}}
+ mempcpy(a, 0, 4); // expected-warning{{Null pointer passed as 2nd argument to memory copy function}}
}
void mempcpy12() {
@@ -327,7 +333,7 @@
void mempcpy_unknown_size_warn (size_t n) {
char a[4];
- void *result = mempcpy(a, 0, n); // expected-warning{{Null pointer argument in call to memory copy function}}
+ void *result = mempcpy(a, 0, n); // expected-warning{{Null pointer passed as 2nd argument to memory copy function}}
clang_analyzer_eval(result == a); // no-warning (above is fatal)
}
@@ -462,6 +468,12 @@
memcmp(&a[x*y], a, n);
}
+int memcmp8(char *a, size_t n) {
+ char *b = 0;
+ // Do not warn about the first argument!
+ return memcmp(a, b, n); // expected-warning{{Null pointer passed as 2nd argument to memory comparison function}}
+}
+
//===----------------------------------------------------------------------===
// bcopy()
//===----------------------------------------------------------------------===
diff --git a/src/llvm-project/clang/test/Analysis/cast-value-logic.cpp b/src/llvm-project/clang/test/Analysis/cast-value-logic.cpp
new file mode 100644
index 0000000..1411ede
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/cast-value-logic.cpp
@@ -0,0 +1,162 @@
+// RUN: %clang_analyze_cc1 -std=c++14 \
+// RUN: -analyzer-checker=core,apiModeling.llvm.CastValue,debug.ExprInspection\
+// RUN: -verify %s
+
+#include "Inputs/llvm.h"
+
+void clang_analyzer_numTimesReached();
+void clang_analyzer_warnIfReached();
+void clang_analyzer_eval(bool);
+
+namespace clang {
+struct Shape {
+ template <typename T>
+ const T *castAs() const;
+
+ template <typename T>
+ const T *getAs() const;
+
+ virtual double area();
+};
+class Triangle : public Shape {};
+class Circle : public Shape {
+public:
+ ~Circle();
+};
+class SuspiciouslySpecificCircle : public Circle {};
+} // namespace clang
+
+using namespace llvm;
+using namespace clang;
+
+void test_regions_dyn_cast(const Shape *A, const Shape *B) {
+ if (dyn_cast<Circle>(A) && !dyn_cast<Circle>(B))
+ clang_analyzer_warnIfReached(); // expected-warning {{REACHABLE}}
+}
+
+void test_regions_isa(const Shape *A, const Shape *B) {
+ if (isa<Circle>(A) && !isa<Circle>(B))
+ clang_analyzer_warnIfReached(); // expected-warning {{REACHABLE}}
+}
+
+namespace test_cast {
+void evalLogic(const Shape *S) {
+ const Circle *C = cast<Circle>(S);
+ clang_analyzer_numTimesReached(); // expected-warning {{1}}
+
+ if (S && C)
+ clang_analyzer_eval(C == S); // expected-warning {{TRUE}}
+
+ if (S && !C)
+ clang_analyzer_warnIfReached(); // no-warning
+
+ if (!S)
+ clang_analyzer_warnIfReached(); // no-warning
+}
+} // namespace test_cast
+
+namespace test_dyn_cast {
+void evalLogic(const Shape *S) {
+ const Circle *C = dyn_cast<Circle>(S);
+ clang_analyzer_numTimesReached(); // expected-warning {{2}}
+
+ if (S && C)
+ clang_analyzer_eval(C == S); // expected-warning {{TRUE}}
+
+ if (S && !C)
+ clang_analyzer_warnIfReached(); // expected-warning {{REACHABLE}}
+
+ if (!S)
+ clang_analyzer_warnIfReached(); // no-warning
+}
+} // namespace test_dyn_cast
+
+namespace test_cast_or_null {
+void evalLogic(const Shape *S) {
+ const Circle *C = cast_or_null<Circle>(S);
+ clang_analyzer_numTimesReached(); // expected-warning {{2}}
+
+ if (S && C)
+ clang_analyzer_eval(C == S); // expected-warning {{TRUE}}
+
+ if (S && !C)
+ clang_analyzer_warnIfReached(); // no-warning
+
+ if (!S)
+ clang_analyzer_eval(!C); // expected-warning {{TRUE}}
+}
+} // namespace test_cast_or_null
+
+namespace test_dyn_cast_or_null {
+void evalLogic(const Shape *S) {
+ const Circle *C = dyn_cast_or_null<Circle>(S);
+ clang_analyzer_numTimesReached(); // expected-warning {{3}}
+
+ if (S && C)
+ clang_analyzer_eval(C == S); // expected-warning {{TRUE}}
+
+ if (S && !C)
+ clang_analyzer_warnIfReached(); // expected-warning {{REACHABLE}}
+
+ if (!S)
+ clang_analyzer_eval(!C); // expected-warning {{TRUE}}
+}
+} // namespace test_dyn_cast_or_null
+
+namespace test_cast_as {
+void evalLogic(const Shape *S) {
+ const Circle *C = S->castAs<Circle>();
+ clang_analyzer_numTimesReached(); // expected-warning {{1}}
+
+ if (S && C)
+ clang_analyzer_eval(C == S);
+ // expected-warning@-1 {{TRUE}}
+
+ if (S && !C)
+ clang_analyzer_warnIfReached(); // no-warning
+
+ if (!S)
+ clang_analyzer_warnIfReached(); // no-warning
+}
+} // namespace test_cast_as
+
+namespace test_get_as {
+void evalLogic(const Shape *S) {
+ const Circle *C = S->getAs<Circle>();
+ clang_analyzer_numTimesReached(); // expected-warning {{2}}
+
+ if (S && C)
+ clang_analyzer_eval(C == S);
+ // expected-warning@-1 {{TRUE}}
+
+ if (S && !C)
+ clang_analyzer_warnIfReached(); // expected-warning {{REACHABLE}}
+
+ if (!S)
+ clang_analyzer_warnIfReached(); // no-warning
+}
+} // namespace test_get_as
+
+namespace crashes {
+void test_non_reference_null_region_crash(Shape s) {
+ cast<Circle>(s); // no-crash
+}
+
+void test_non_reference_temporary_crash() {
+ extern std::unique_ptr<Shape> foo();
+ auto P = foo();
+ auto Q = cast<Circle>(std::move(P)); // no-crash
+}
+
+double test_virtual_method_after_call(Shape *S) {
+ if (isa<Circle>(S))
+ return S->area();
+ return S->area() / 2;
+}
+
+void test_delete_crash() {
+ extern Circle *makeCircle();
+ Shape *S = makeCircle();
+ delete cast<SuspiciouslySpecificCircle>(S);
+}
+} // namespace crashes
diff --git a/src/llvm-project/clang/test/Analysis/cast-value-notes.cpp b/src/llvm-project/clang/test/Analysis/cast-value-notes.cpp
new file mode 100644
index 0000000..eb5d1b3
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/cast-value-notes.cpp
@@ -0,0 +1,155 @@
+// RUN: %clang_analyze_cc1 -std=c++14 \
+// RUN: -analyzer-checker=core,apiModeling.llvm.CastValue,debug.ExprInspection\
+// RUN: -analyzer-output=text -verify %s
+
+#include "Inputs/llvm.h"
+
+namespace clang {
+struct Shape {
+ template <typename T>
+ const T *castAs() const;
+
+ template <typename T>
+ const T *getAs() const;
+};
+class Triangle : public Shape {};
+class Circle : public Shape {};
+} // namespace clang
+
+using namespace llvm;
+using namespace clang;
+
+void evalReferences(const Shape &S) {
+ const auto &C = dyn_cast<Circle>(S);
+ // expected-note@-1 {{Assuming 'S' is not a 'Circle'}}
+ // expected-note@-2 {{Dereference of null pointer}}
+ // expected-warning@-3 {{Dereference of null pointer}}
+}
+
+void evalNonNullParamNonNullReturnReference(const Shape &S) {
+ // Unmodeled cast from reference to pointer.
+ const auto *C = dyn_cast_or_null<Circle>(S);
+ // expected-note@-1 {{'C' initialized here}}
+
+ if (!dyn_cast_or_null<Circle>(C)) {
+ // expected-note@-1 {{'C' is a 'Circle'}}
+ // expected-note@-2 {{Taking false branch}}
+ return;
+ }
+
+ if (dyn_cast_or_null<Triangle>(C)) {
+ // expected-note@-1 {{Assuming 'C' is not a 'Triangle'}}
+ // expected-note@-2 {{Taking false branch}}
+ return;
+ }
+
+ if (isa<Triangle>(C)) {
+ // expected-note@-1 {{'C' is not a 'Triangle'}}
+ // expected-note@-2 {{Taking false branch}}
+ return;
+ }
+
+ if (isa<Circle>(C)) {
+ // expected-note@-1 {{'C' is a 'Circle'}}
+ // expected-note@-2 {{Taking true branch}}
+
+ (void)(1 / !C);
+ // expected-note@-1 {{'C' is non-null}}
+ // expected-note@-2 {{Division by zero}}
+ // expected-warning@-3 {{Division by zero}}
+ }
+}
+
+void evalNonNullParamNonNullReturn(const Shape *S) {
+ const auto *C = cast<Circle>(S);
+ // expected-note@-1 {{'S' is a 'Circle'}}
+ // expected-note@-2 {{'C' initialized here}}
+
+ if (!isa<Triangle>(C)) {
+ // expected-note@-1 {{Assuming 'C' is a 'Triangle'}}
+ // expected-note@-2 {{Taking false branch}}
+ return;
+ }
+
+ if (!isa<Triangle>(C)) {
+ // expected-note@-1 {{'C' is a 'Triangle'}}
+ // expected-note@-2 {{Taking false branch}}
+ return;
+ }
+
+ (void)(1 / !C);
+ // expected-note@-1 {{'C' is non-null}}
+ // expected-note@-2 {{Division by zero}}
+ // expected-warning@-3 {{Division by zero}}
+}
+
+void evalNonNullParamNullReturn(const Shape *S) {
+ const auto *C = dyn_cast_or_null<Circle>(S);
+ // expected-note@-1 {{Assuming 'S' is not a 'Circle'}}
+
+ if (const auto *T = dyn_cast_or_null<Triangle>(S)) {
+ // expected-note@-1 {{Assuming 'S' is a 'Triangle'}}
+ // expected-note@-2 {{'T' initialized here}}
+ // expected-note@-3 {{'T' is non-null}}
+ // expected-note@-4 {{Taking true branch}}
+
+ (void)(1 / !T);
+ // expected-note@-1 {{'T' is non-null}}
+ // expected-note@-2 {{Division by zero}}
+ // expected-warning@-3 {{Division by zero}}
+ }
+}
+
+void evalNullParamNullReturn(const Shape *S) {
+ const auto *C = dyn_cast_or_null<Circle>(S);
+ // expected-note@-1 {{Assuming null pointer is passed into cast}}
+ // expected-note@-2 {{'C' initialized to a null pointer value}}
+
+ (void)(1 / (bool)C);
+ // expected-note@-1 {{Division by zero}}
+ // expected-warning@-2 {{Division by zero}}
+}
+
+void evalZeroParamNonNullReturnPointer(const Shape *S) {
+ const auto *C = S->castAs<Circle>();
+ // expected-note@-1 {{'S' is a 'Circle'}}
+ // expected-note@-2 {{'C' initialized here}}
+
+ (void)(1 / !C);
+ // expected-note@-1 {{'C' is non-null}}
+ // expected-note@-2 {{Division by zero}}
+ // expected-warning@-3 {{Division by zero}}
+}
+
+void evalZeroParamNonNullReturn(const Shape &S) {
+ const auto *C = S.castAs<Circle>();
+ // expected-note@-1 {{'C' initialized here}}
+
+ (void)(1 / !C);
+ // expected-note@-1 {{'C' is non-null}}
+ // expected-note@-2 {{Division by zero}}
+ // expected-warning@-3 {{Division by zero}}
+}
+
+void evalZeroParamNullReturn(const Shape *S) {
+ const auto &C = S->getAs<Circle>();
+ // expected-note@-1 {{Assuming 'S' is not a 'Circle'}}
+ // expected-note@-2 {{Storing null pointer value}}
+ // expected-note@-3 {{'C' initialized here}}
+
+ if (!dyn_cast_or_null<Triangle>(S)) {
+ // expected-note@-1 {{Assuming 'S' is a 'Triangle'}}
+ // expected-note@-2 {{Taking false branch}}
+ return;
+ }
+
+ if (!dyn_cast_or_null<Triangle>(S)) {
+ // expected-note@-1 {{'S' is a 'Triangle'}}
+ // expected-note@-2 {{Taking false branch}}
+ return;
+ }
+
+ (void)(1 / (bool)C);
+ // expected-note@-1 {{Division by zero}}
+ // expected-warning@-2 {{Division by zero}}
+}
diff --git a/src/llvm-project/clang/test/Analysis/cast-value-state-dump.cpp b/src/llvm-project/clang/test/Analysis/cast-value-state-dump.cpp
new file mode 100644
index 0000000..9abdaae
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/cast-value-state-dump.cpp
@@ -0,0 +1,47 @@
+// RUN: %clang_analyze_cc1 -std=c++14 \
+// RUN: -analyzer-checker=core,apiModeling.llvm.CastValue,debug.ExprInspection\
+// RUN: -analyzer-output=text -verify %s 2>&1 | FileCheck %s
+
+#include "Inputs/llvm.h"
+
+void clang_analyzer_printState();
+
+namespace clang {
+struct Shape {};
+class Triangle : public Shape {};
+class Circle : public Shape {};
+class Square : public Shape {};
+} // namespace clang
+
+using namespace llvm;
+using namespace clang;
+
+void evalNonNullParamNonNullReturn(const Shape *S) {
+ const auto *C = dyn_cast_or_null<Circle>(S);
+ // expected-note@-1 {{Assuming 'S' is a 'Circle'}}
+ // expected-note@-2 {{'C' initialized here}}
+
+ // FIXME: We assumed that 'S' is a 'Circle' therefore it is not a 'Square'.
+ if (dyn_cast_or_null<Square>(S)) {
+ // expected-note@-1 {{Assuming 'S' is not a 'Square'}}
+ // expected-note@-2 {{Taking false branch}}
+ return;
+ }
+
+ clang_analyzer_printState();
+
+ // CHECK: "dynamic_types": [
+ // CHECK-NEXT: { "region": "SymRegion{reg_$0<const struct clang::Shape * S>}", "dyn_type": "const class clang::Circle", "sub_classable": true }
+ // CHECK-NEXT: ],
+ // CHECK-NEXT: "dynamic_casts": [
+ // CHECK: { "region": "SymRegion{reg_$0<const struct clang::Shape * S>}", "casts": [
+ // CHECK-NEXT: { "from": "const struct clang::Shape *", "to": "const class clang::Circle *", "kind": "success" },
+ // CHECK-NEXT: { "from": "const struct clang::Shape *", "to": "const class clang::Square *", "kind": "fail" }
+ // CHECK-NEXT: ]}
+
+ (void)(1 / !C);
+ // expected-note@-1 {{'C' is non-null}}
+ // expected-note@-2 {{Division by zero}}
+ // expected-warning@-3 {{Division by zero}}
+}
+
diff --git a/src/llvm-project/clang/test/Analysis/cast-value-weird.cpp b/src/llvm-project/clang/test/Analysis/cast-value-weird.cpp
new file mode 100644
index 0000000..f15cc19
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/cast-value-weird.cpp
@@ -0,0 +1,9 @@
+// RUN: %clang_analyze_cc1 -analyzer-checker=core,apiModeling -verify %s
+
+// expected-no-diagnostics
+
+namespace llvm {
+template <typename>
+void cast(...);
+void a() { cast<int>(int()); } // no-crash
+} // namespace llvm
diff --git a/src/llvm-project/clang/test/Analysis/cast-value.cpp b/src/llvm-project/clang/test/Analysis/cast-value.cpp
deleted file mode 100644
index 609ee23..0000000
--- a/src/llvm-project/clang/test/Analysis/cast-value.cpp
+++ /dev/null
@@ -1,137 +0,0 @@
-// RUN: %clang_analyze_cc1 \
-// RUN: -analyzer-checker=core,apiModeling.llvm.CastValue,debug.ExprInspection\
-// RUN: -verify=logic %s
-// RUN: %clang_analyze_cc1 \
-// RUN: -analyzer-checker=core,apiModeling.llvm.CastValue \
-// RUN: -analyzer-output=text -verify %s
-
-void clang_analyzer_numTimesReached();
-void clang_analyzer_warnIfReached();
-void clang_analyzer_eval(bool);
-
-namespace llvm {
-template <class X, class Y>
-const X *cast(Y Value);
-
-template <class X, class Y>
-const X *dyn_cast(Y Value);
-
-template <class X, class Y>
-const X *cast_or_null(Y Value);
-
-template <class X, class Y>
-const X *dyn_cast_or_null(Y Value);
-} // namespace llvm
-
-using namespace llvm;
-
-class Shape {};
-class Triangle : public Shape {};
-class Circle : public Shape {};
-
-namespace test_cast {
-void evalLogic(const Shape *S) {
- const Circle *C = cast<Circle>(S);
- clang_analyzer_numTimesReached(); // logic-warning {{1}}
-
- if (S && C)
- clang_analyzer_eval(C == S); // logic-warning {{TRUE}}
-
- if (S && !C)
- clang_analyzer_warnIfReached(); // no-warning
-
- if (!S)
- clang_analyzer_warnIfReached(); // no-warning
-}
-} // namespace test_cast
-
-namespace test_dyn_cast {
-void evalLogic(const Shape *S) {
- const Circle *C = dyn_cast<Circle>(S);
- clang_analyzer_numTimesReached(); // logic-warning {{2}}
-
- if (S && C)
- clang_analyzer_eval(C == S); // logic-warning {{TRUE}}
-
- if (S && !C)
- clang_analyzer_warnIfReached(); // logic-warning {{REACHABLE}}
-
- if (!S)
- clang_analyzer_warnIfReached(); // no-warning
-}
-} // namespace test_dyn_cast
-
-namespace test_cast_or_null {
-void evalLogic(const Shape *S) {
- const Circle *C = cast_or_null<Circle>(S);
- clang_analyzer_numTimesReached(); // logic-warning {{2}}
-
- if (S && C)
- clang_analyzer_eval(C == S); // logic-warning {{TRUE}}
-
- if (S && !C)
- clang_analyzer_warnIfReached(); // no-warning
-
- if (!S)
- clang_analyzer_eval(!C); // logic-warning {{TRUE}}
-}
-} // namespace test_cast_or_null
-
-namespace test_dyn_cast_or_null {
-void evalLogic(const Shape *S) {
- const Circle *C = dyn_cast_or_null<Circle>(S);
- clang_analyzer_numTimesReached(); // logic-warning {{3}}
-
- if (S && C)
- clang_analyzer_eval(C == S); // logic-warning {{TRUE}}
-
- if (S && !C)
- clang_analyzer_warnIfReached(); // logic-warning {{REACHABLE}}
-
- if (!S)
- clang_analyzer_eval(!C); // logic-warning {{TRUE}}
-}
-
-void evalNonNullParamNonNullReturn(const Shape *S) {
- const auto *C = dyn_cast_or_null<Circle>(S);
- // expected-note@-1 {{Assuming dynamic cast from 'Shape' to 'Circle' succeeds}}
- // expected-note@-2 {{Assuming pointer value is null}}
- // expected-note@-3 {{'C' initialized here}}
-
- (void)(1 / !(bool)C);
- // expected-note@-1 {{'C' is non-null}}
- // expected-note@-2 {{Division by zero}}
- // expected-warning@-3 {{Division by zero}}
- // logic-warning@-4 {{Division by zero}}
-}
-
-void evalNonNullParamNullReturn(const Shape *S) {
- const auto *C = dyn_cast_or_null<Circle>(S);
- // expected-note@-1 {{Assuming dynamic cast from 'Shape' to 'Circle' fails}}
- // expected-note@-2 {{Assuming pointer value is null}}
-
- if (const auto *T = dyn_cast_or_null<Triangle>(S)) {
- // expected-note@-1 {{Assuming dynamic cast from 'Shape' to 'Triangle' succeeds}}
- // expected-note@-2 {{'T' initialized here}}
- // expected-note@-3 {{'T' is non-null}}
- // expected-note@-4 {{Taking true branch}}
-
- (void)(1 / !T);
- // expected-note@-1 {{'T' is non-null}}
- // expected-note@-2 {{Division by zero}}
- // expected-warning@-3 {{Division by zero}}
- // logic-warning@-4 {{Division by zero}}
- }
-}
-
-void evalNullParamNullReturn(const Shape *S) {
- const auto *C = dyn_cast_or_null<Circle>(S);
- // expected-note@-1 {{Assuming null pointer is passed into cast}}
- // expected-note@-2 {{'C' initialized to a null pointer value}}
-
- (void)(1 / (bool)C);
- // expected-note@-1 {{Division by zero}}
- // expected-warning@-2 {{Division by zero}}
- // logic-warning@-3 {{Division by zero}}
-}
-} // namespace test_dyn_cast_or_null
diff --git a/src/llvm-project/clang/test/Analysis/cfg-openmp.cpp b/src/llvm-project/clang/test/Analysis/cfg-openmp.cpp
index dd417bf..51107e5 100644
--- a/src/llvm-project/clang/test/Analysis/cfg-openmp.cpp
+++ b/src/llvm-project/clang/test/Analysis/cfg-openmp.cpp
@@ -5,7 +5,12 @@
// CHECK: [B1]
// CHECK-NEXT: 1: int x;
// CHECK-NEXT: 2: int cond;
- int x, cond;
+// CHECK-NEXT: 3: int fp;
+// CHECK-NEXT: 4: int rd;
+// CHECK-NEXT: 5: int lin;
+// CHECK-NEXT: 6: int step;
+// CHECK-NEXT: 7: int map;
+ int x, cond, fp, rd, lin, step, map;
// CHECK-NEXT: [[#ATOM:]]: x
// CHECK-NEXT: [[#ATOM+1]]: [B1.[[#ATOM]]] (ImplicitCastExpr, LValueToRValue, int)
// CHECK-NEXT: [[#ATOM+2]]: argc
@@ -22,62 +27,6 @@
// CHECK-NEXT: [B1.[[#CRIT+3]]];
#pragma omp critical
argc = x;
-// CHECK-NEXT: [[#DPF:]]: x
-// CHECK-NEXT: [[#DPF+1]]: [B1.[[#DPF]]] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: [[#DPF+2]]: argc
-// CHECK-NEXT: [[#DPF+3]]: [B1.[[#DPF+2]]] = [B1.[[#DPF+1]]]
-// CHECK-NEXT: [[#DPF+4]]: cond
-// CHECK-NEXT: [[#DPF+5]]: [B1.[[#DPF+4]]] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: [[#DPF+6]]: [B1.[[#DPF+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
-// CHECK-NEXT: [[#DPF+7]]: #pragma omp distribute parallel for if(parallel: cond)
-// CHECK-NEXT: for (int i = 0; i < 10; ++i)
-// CHECK-NEXT: [B1.[[#DPF+3]]];
-#pragma omp distribute parallel for if(parallel:cond)
- for (int i = 0; i < 10; ++i)
- argc = x;
-// CHECK-NEXT: [[#DPFS:]]: x
-// CHECK-NEXT: [[#DPFS+1]]: [B1.[[#DPFS]]] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: [[#DPFS+2]]: argc
-// CHECK-NEXT: [[#DPFS+3]]: [B1.[[#DPFS+2]]] = [B1.[[#DPFS+1]]]
-// CHECK-NEXT: [[#DPFS+4]]: cond
-// CHECK-NEXT: [[#DPFS+5]]: [B1.[[#DPFS+4]]] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: [[#DPFS+6]]: [B1.[[#DPFS+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
-// CHECK-NEXT: [[#DPFS+7]]: #pragma omp distribute parallel for simd if(cond)
-// CHECK-NEXT: for (int i = 0; i < 10; ++i)
-// CHECK-NEXT: [B1.[[#DPFS+3]]];
-#pragma omp distribute parallel for simd if(cond)
- for (int i = 0; i < 10; ++i)
- argc = x;
-// CHECK-NEXT: [[#DS:]]: x
-// CHECK-NEXT: [[#DS+1]]: [B1.[[#DS]]] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: [[#DS+2]]: argc
-// CHECK-NEXT: [[#DS+3]]: [B1.[[#DS+2]]] = [B1.[[#DS+1]]]
-// CHECK-NEXT: [[#DS+4]]: #pragma omp distribute simd
-// CHECK-NEXT: for (int i = 0; i < 10; ++i)
-// CHECK-NEXT: [B1.[[#DS+3]]];
-#pragma omp distribute simd
- for (int i = 0; i < 10; ++i)
- argc = x;
-// CHECK-NEXT: [[#FOR:]]: x
-// CHECK-NEXT: [[#FOR+1]]: [B1.[[#FOR]]] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: [[#FOR+2]]: argc
-// CHECK-NEXT: [[#FOR+3]]: [B1.[[#FOR+2]]] = [B1.[[#FOR+1]]]
-// CHECK-NEXT: [[#FOR+4]]: #pragma omp for
-// CHECK-NEXT: for (int i = 0; i < 10; ++i)
-// CHECK-NEXT: [B1.[[#FOR+3]]];
-#pragma omp for
- for (int i = 0; i < 10; ++i)
- argc = x;
-// CHECK-NEXT: [[#FS:]]: x
-// CHECK-NEXT: [[#FS+1]]: [B1.[[#FS]]] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: [[#FS+2]]: argc
-// CHECK-NEXT: [[#FS+3]]: [B1.[[#FS+2]]] = [B1.[[#FS+1]]]
-// CHECK-NEXT: [[#FS+4]]: #pragma omp for simd
-// CHECK-NEXT: for (int i = 0; i < 10; ++i)
-// CHECK-NEXT: [B1.[[#FS+3]]];
-#pragma omp for simd
- for (int i = 0; i < 10; ++i)
- argc = x;
// CHECK-NEXT: [[#MASTER:]]: x
// CHECK-NEXT: [[#MASTER+1]]: [B1.[[#MASTER]]] (ImplicitCastExpr, LValueToRValue, int)
// CHECK-NEXT: [[#MASTER+2]]: argc
@@ -86,46 +35,6 @@
// CHECK-NEXT: [B1.[[#MASTER+3]]];
#pragma omp master
argc = x;
-// CHECK-NEXT: [[#ORD:]]: x
-// CHECK-NEXT: [[#ORD+1]]: [B1.[[#ORD]]] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: [[#ORD+2]]: argc
-// CHECK-NEXT: [[#ORD+3]]: [B1.[[#ORD+2]]] = [B1.[[#ORD+1]]]
-// CHECK-NEXT: [[#ORD+4]]: #pragma omp ordered
-// CHECK-NEXT: [B1.[[#ORD+3]]];
-// CHECK-NEXT: [[#ORD+5]]: #pragma omp for ordered
-// CHECK-NEXT: for (int i = 0; i < 10; ++i) {
-// CHECK-NEXT:[B1.[[#ORD+4]]] }
-#pragma omp for ordered
- for (int i = 0; i < 10; ++i) {
-#pragma omp ordered
- argc = x;
- }
-// CHECK-NEXT: [[#PF:]]: x
-// CHECK-NEXT: [[#PF+1]]: [B1.[[#PF]]] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: [[#PF+2]]: argc
-// CHECK-NEXT: [[#PF+3]]: [B1.[[#PF+2]]] = [B1.[[#PF+1]]]
-// CHECK-NEXT: [[#PF+4]]: cond
-// CHECK-NEXT: [[#PF+5]]: [B1.[[#PF+4]]] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: [[#PF+6]]: [B1.[[#PF+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
-// CHECK-NEXT: [[#PF+7]]: #pragma omp parallel for if(cond)
-// CHECK-NEXT: for (int i = 0; i < 10; ++i)
-// CHECK-NEXT: [B1.[[#PF+3]]];
-#pragma omp parallel for if(cond)
- for (int i = 0; i < 10; ++i)
- argc = x;
-// CHECK-NEXT: [[#PFS:]]: x
-// CHECK-NEXT: [[#PFS+1]]: [B1.[[#PFS]]] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: [[#PFS+2]]: argc
-// CHECK-NEXT: [[#PFS+3]]: [B1.[[#PFS+2]]] = [B1.[[#PFS+1]]]
-// CHECK-NEXT: [[#PFS+4]]: cond
-// CHECK-NEXT: [[#PFS+5]]: [B1.[[#PFS+4]]] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: [[#PFS+6]]: [B1.[[#PFS+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
-// CHECK-NEXT: [[#PFS+7]]: #pragma omp parallel for simd if(cond)
-// CHECK-NEXT: for (int i = 0; i < 10; ++i)
-// CHECK-NEXT: [B1.[[#PFS+3]]];
-#pragma omp parallel for simd if(cond)
- for (int i = 0; i < 10; ++i)
- argc = x;
// CHECK-NEXT: [[#PAR:]]: x
// CHECK-NEXT: [[#PAR+1]]: [B1.[[#PAR]]] (ImplicitCastExpr, LValueToRValue, int)
// CHECK-NEXT: [[#PAR+2]]: argc
@@ -133,9 +42,11 @@
// CHECK-NEXT: [[#PAR+4]]: cond
// CHECK-NEXT: [[#PAR+5]]: [B1.[[#PAR+4]]] (ImplicitCastExpr, LValueToRValue, int)
// CHECK-NEXT: [[#PAR+6]]: [B1.[[#PAR+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
-// CHECK-NEXT: [[#PAR+7]]: #pragma omp parallel if(cond)
+// CHECK-NEXT: [[#PAR+7]]: fp
+// CHECK-NEXT: [[#PAR+8]]: rd
+// CHECK-NEXT: [[#PAR+9]]: #pragma omp parallel if(cond) firstprivate(fp) reduction(min: rd)
// CHECK-NEXT: [B1.[[#PAR+3]]];
-#pragma omp parallel if(cond)
+#pragma omp parallel if(cond) firstprivate(fp) reduction(min:rd)
argc = x;
// CHECK-NEXT: [[#PSECT:]]: x
// CHECK-NEXT: [[#PSECT+1]]: [B1.[[#PSECT]]] (ImplicitCastExpr, LValueToRValue, int)
@@ -144,24 +55,16 @@
// CHECK-NEXT: [[#PSECT+4]]: cond
// CHECK-NEXT: [[#PSECT+5]]: [B1.[[#PSECT+4]]] (ImplicitCastExpr, LValueToRValue, int)
// CHECK-NEXT: [[#PSECT+6]]: [B1.[[#PSECT+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
-// CHECK-NEXT: [[#PSECT+7]]: #pragma omp parallel sections if(cond)
+// CHECK-NEXT: [[#PSECT+7]]: fp
+// CHECK-NEXT: [[#PSECT+8]]: rd
+// CHECK-NEXT: [[#PSECT+9]]: #pragma omp parallel sections if(cond) firstprivate(fp) reduction(&&: rd)
// CHECK-NEXT: {
// CHECK-NEXT: [B1.[[#PSECT+3]]];
// CHECK-NEXT: }
-#pragma omp parallel sections if(cond)
+#pragma omp parallel sections if(cond) firstprivate(fp) reduction(&&:rd)
{
argc = x;
}
-// CHECK-NEXT: [[#SIMD:]]: x
-// CHECK-NEXT: [[#SIMD+1]]: [B1.[[#SIMD]]] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: [[#SIMD+2]]: argc
-// CHECK-NEXT: [[#SIMD+3]]: [B1.[[#SIMD+2]]] = [B1.[[#SIMD+1]]]
-// CHECK-NEXT: [[#SIMD+4]]: #pragma omp simd
-// CHECK-NEXT: for (int i = 0; i < 10; ++i)
-// CHECK-NEXT: [B1.[[#SIMD+3]]];
-#pragma omp simd
- for (int i = 0; i < 10; ++i)
- argc = x;
// CHECK-NEXT: [[#SINGLE:]]: x
// CHECK-NEXT: [[#SINGLE+1]]: [B1.[[#SINGLE]]] (ImplicitCastExpr, LValueToRValue, int)
// CHECK-NEXT: [[#SINGLE+2]]: argc
@@ -170,146 +73,76 @@
// CHECK-NEXT: [B1.[[#SINGLE+3]]];
#pragma omp single
argc = x;
-// CHECK-NEXT: [[#TARGET:]]: x
-// CHECK-NEXT: [[#TARGET+1]]: [B1.[[#TARGET]]] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: [[#TARGET+2]]: argc
-// CHECK-NEXT: [[#TARGET+3]]: [B1.[[#TARGET+2]]] = [B1.[[#TARGET+1]]]
+// CHECK-NEXT: [[#TARGET:]]:
+// CHECK-SAME: [B1.[[#TARGET+10]]]
+// CHECK-NEXT: [[#TARGET+1]]: [B1.[[#TARGET+10]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT: [[#TARGET+2]]: [B1.[[#TARGET+9]]]
+// CHECK-NEXT: [[#TARGET+3]]: [B1.[[#TARGET+9]]] = [B1.[[#TARGET+1]]]
// CHECK-NEXT: [[#TARGET+4]]: cond
// CHECK-NEXT: [[#TARGET+5]]: [B1.[[#TARGET+4]]] (ImplicitCastExpr, LValueToRValue, int)
// CHECK-NEXT: [[#TARGET+6]]: [B1.[[#TARGET+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
-// CHECK-NEXT: [[#TARGET+7]]: #pragma omp target depend(in : argc) if(cond)
+// CHECK-NEXT: [[#TARGET+7]]: fp
+// CHECK-NEXT: [[#TARGET+8]]: rd
+// CHECK-NEXT: [[#TARGET+9]]: argc
+// CHECK-NEXT: [[#TARGET+10]]: x
+// CHECK-NEXT: [[#TARGET+11]]: #pragma omp target depend(in : argc) if(cond) firstprivate(fp) reduction(-: rd)
// CHECK-NEXT: [B1.[[#TARGET+3]]];
#pragma omp target depend(in \
- : argc) if(cond)
+ : argc) if(cond) firstprivate(fp) reduction(-:rd)
argc = x;
-// CHECK-NEXT: [[#TPF:]]: x
-// CHECK-NEXT: [[#TPF+1]]: [B1.[[#TPF]]] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: [[#TPF+2]]: argc
-// CHECK-NEXT: [[#TPF+3]]: [B1.[[#TPF+2]]] = [B1.[[#TPF+1]]]
-// CHECK-NEXT: [[#TPF+4]]: cond
-// CHECK-NEXT: [[#TPF+5]]: [B1.[[#TPF+4]]] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: [[#TPF+6]]: [B1.[[#TPF+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
-// CHECK-NEXT: [[#TPF+7]]: #pragma omp target parallel for if(parallel: cond)
-// CHECK-NEXT: for (int i = 0; i < 10; ++i)
-// CHECK-NEXT: [B1.[[#TPF+3]]];
-#pragma omp target parallel for if(parallel:cond)
- for (int i = 0; i < 10; ++i)
- argc = x;
-// CHECK-NEXT: [[#TPFS:]]: x
-// CHECK-NEXT: [[#TPFS+1]]: [B1.[[#TPFS]]] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: [[#TPFS+2]]: argc
-// CHECK-NEXT: [[#TPFS+3]]: [B1.[[#TPFS+2]]] = [B1.[[#TPFS+1]]]
-// CHECK-NEXT: [[#TPFS+4]]: cond
-// CHECK-NEXT: [[#TPFS+5]]: [B1.[[#TPFS+4]]] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: [[#TPFS+6]]: [B1.[[#TPFS+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
-// CHECK-NEXT: [[#TPFS+7]]: #pragma omp target parallel for simd if(target: cond)
-// CHECK-NEXT: for (int i = 0; i < 10; ++i)
-// CHECK-NEXT: [B1.[[#TPFS+3]]];
-#pragma omp target parallel for simd if(target:cond)
- for (int i = 0; i < 10; ++i)
- argc = x;
-// CHECK-NEXT: [[#TP:]]: x
-// CHECK-NEXT: [[#TP+1]]: [B1.[[#TP]]] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: [[#TP+2]]: argc
-// CHECK-NEXT: [[#TP+3]]: [B1.[[#TP+2]]] = [B1.[[#TP+1]]]
+// CHECK-NEXT: [[#TP:]]:
+// CHECK-SAME: [B1.[[#TP+11]]]
+// CHECK-NEXT: [[#TP+1]]: [B1.[[#TP+11]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT: [[#TP+2]]: [B1.[[#TP+10]]]
+// CHECK-NEXT: [[#TP+3]]: [B1.[[#TP+10]]] = [B1.[[#TP+1]]]
// CHECK-NEXT: [[#TP+4]]: cond
// CHECK-NEXT: [[#TP+5]]: [B1.[[#TP+4]]] (ImplicitCastExpr, LValueToRValue, int)
// CHECK-NEXT: [[#TP+6]]: [B1.[[#TP+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
-// CHECK-NEXT: [[#TP+7]]: #pragma omp target parallel if(cond)
+// CHECK-NEXT: [[#TP+7]]: fp
+// CHECK-NEXT: [[#TP+8]]: rd
+// CHECK-NEXT: [[#TP+9]]: map
+// CHECK-NEXT: [[#TP+10]]: argc
+// CHECK-NEXT: [[#TP+11]]: x
+// CHECK-NEXT: [[#TP+12]]: #pragma omp target parallel if(cond) firstprivate(fp) reduction(+: rd) map(to: map)
// CHECK-NEXT: [B1.[[#TP+3]]];
-#pragma omp target parallel if(cond)
+#pragma omp target parallel if(cond) firstprivate(fp) reduction(+:rd) map(to:map)
argc = x;
-// CHECK-NEXT: [[#TSIMD:]]: x
-// CHECK-NEXT: [[#TSIMD+1]]: [B1.[[#TSIMD]]] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: [[#TSIMD+2]]: argc
-// CHECK-NEXT: [[#TSIMD+3]]: [B1.[[#TSIMD+2]]] = [B1.[[#TSIMD+1]]]
-// CHECK-NEXT: [[#TSIMD+4]]: cond
-// CHECK-NEXT: [[#TSIMD+5]]: [B1.[[#TSIMD+4]]] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: [[#TSIMD+6]]: [B1.[[#TSIMD+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
-// CHECK-NEXT: [[#TSIMD+7]]: #pragma omp target simd if(cond)
-// CHECK-NEXT: for (int i = 0; i < 10; ++i)
-// CHECK-NEXT: [B1.[[#TSIMD+3]]];
-#pragma omp target simd if(cond)
- for (int i = 0; i < 10; ++i)
- argc = x;
-// CHECK-NEXT: [[#TTD:]]: x
-// CHECK-NEXT: [[#TTD+1]]: [B1.[[#TTD]]] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: [[#TTD+2]]: argc
-// CHECK-NEXT: [[#TTD+3]]: [B1.[[#TTD+2]]] = [B1.[[#TTD+1]]]
-// CHECK-NEXT: [[#TTD+4]]: cond
-// CHECK-NEXT: [[#TTD+5]]: [B1.[[#TTD+4]]] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: [[#TTD+6]]: [B1.[[#TTD+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
-// CHECK-NEXT: [[#TTD+7]]: #pragma omp target teams distribute if(cond)
-// CHECK-NEXT: for (int i = 0; i < 10; ++i)
-// CHECK-NEXT: [B1.[[#TTD+3]]];
-#pragma omp target teams distribute if(cond)
- for (int i = 0; i < 10; ++i)
- argc = x;
-// CHECK-NEXT: [[#TTDPF:]]: x
-// CHECK-NEXT: [[#TTDPF+1]]: [B1.[[#TTDPF]]] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: [[#TTDPF+2]]: argc
-// CHECK-NEXT: [[#TTDPF+3]]: [B1.[[#TTDPF+2]]] = [B1.[[#TTDPF+1]]]
-// CHECK-NEXT: [[#TTDPF+4]]: cond
-// CHECK-NEXT: [[#TTDPF+5]]: [B1.[[#TTDPF+4]]] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: [[#TTDPF+6]]: [B1.[[#TTDPF+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
-// CHECK-NEXT: [[#TTDPF+7]]: #pragma omp target teams distribute parallel for if(cond)
-// CHECK-NEXT: for (int i = 0; i < 10; ++i)
-// CHECK-NEXT: [B1.[[#TTDPF+3]]];
-#pragma omp target teams distribute parallel for if(cond)
- for (int i = 0; i < 10; ++i)
- argc = x;
-// CHECK-NEXT: [[#TTDPFS:]]: x
-// CHECK-NEXT: [[#TTDPFS+1]]: [B1.[[#TTDPFS]]] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: [[#TTDPFS+2]]: argc
-// CHECK-NEXT: [[#TTDPFS+3]]: [B1.[[#TTDPFS+2]]] = [B1.[[#TTDPFS+1]]]
-// CHECK-NEXT: [[#TTDPFS+4]]: cond
-// CHECK-NEXT: [[#TTDPFS+5]]: [B1.[[#TTDPFS+4]]] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: [[#TTDPFS+6]]: [B1.[[#TTDPFS+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
-// CHECK-NEXT: [[#TTDPFS+7]]: #pragma omp target teams distribute parallel for simd if(parallel: cond)
-// CHECK-NEXT: for (int i = 0; i < 10; ++i)
-// CHECK-NEXT: [B1.[[#TTDPFS+3]]];
-#pragma omp target teams distribute parallel for simd if(parallel:cond)
- for (int i = 0; i < 10; ++i)
- argc = x;
-// CHECK-NEXT: [[#TTDS:]]: x
-// CHECK-NEXT: [[#TTDS+1]]: [B1.[[#TTDS]]] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: [[#TTDS+2]]: argc
-// CHECK-NEXT: [[#TTDS+3]]: [B1.[[#TTDS+2]]] = [B1.[[#TTDS+1]]]
-// CHECK-NEXT: [[#TTDS+4]]: cond
-// CHECK-NEXT: [[#TTDS+5]]: [B1.[[#TTDS+4]]] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: [[#TTDS+6]]: [B1.[[#TTDS+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
-// CHECK-NEXT: [[#TTDS+7]]: #pragma omp target teams distribute simd if(cond)
-// CHECK-NEXT: for (int i = 0; i < 10; ++i)
-// CHECK-NEXT: [B1.[[#TTDS+3]]];
-#pragma omp target teams distribute simd if(cond)
- for (int i = 0; i < 10; ++i)
- argc = x;
-// CHECK-NEXT: [[#TT:]]: x
-// CHECK-NEXT: [[#TT+1]]: [B1.[[#TT]]] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: [[#TT+2]]: argc
-// CHECK-NEXT: [[#TT+3]]: [B1.[[#TT+2]]] = [B1.[[#TT+1]]]
+// CHECK-NEXT: [[#TT:]]:
+// CHECK-SAME: [B1.[[#TT+11]]]
+// CHECK-NEXT: [[#TT+1]]: [B1.[[#TT+11]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT: [[#TT+2]]: [B1.[[#TT+10]]]
+// CHECK-NEXT: [[#TT+3]]: [B1.[[#TT+10]]] = [B1.[[#TT+1]]]
// CHECK-NEXT: [[#TT+4]]: cond
// CHECK-NEXT: [[#TT+5]]: [B1.[[#TT+4]]] (ImplicitCastExpr, LValueToRValue, int)
// CHECK-NEXT: [[#TT+6]]: [B1.[[#TT+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
-// CHECK-NEXT: [[#TT+7]]: #pragma omp target teams if(cond)
+// CHECK-NEXT: [[#TT+7]]: fp
+// CHECK-NEXT: [[#TT+8]]: rd
+// CHECK-NEXT: [[#TT+9]]: map
+// CHECK-NEXT: [[#TT+10]]: argc
+// CHECK-NEXT: [[#TT+11]]: x
+// CHECK-NEXT: [[#TT+12]]: #pragma omp target teams if(cond) firstprivate(fp) reduction(+: rd) map(tofrom: map)
// CHECK-NEXT: [B1.[[#TT+3]]];
-#pragma omp target teams if(cond)
+#pragma omp target teams if(cond) firstprivate(fp) reduction(+:rd) map(tofrom:map)
argc = x;
// CHECK-NEXT: [[#TU:]]: cond
// CHECK-NEXT: [[#TU+1]]: [B1.[[#TU]]] (ImplicitCastExpr, LValueToRValue, int)
// CHECK-NEXT: [[#TU+2]]: [B1.[[#TU+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
// CHECK-NEXT: [[#TU+3]]: #pragma omp target update to(x) if(target update: cond)
#pragma omp target update to(x) if(target update:cond)
-// CHECK-NEXT: [[#TASK:]]: x
-// CHECK-NEXT: [[#TASK+1]]: [B1.[[#TASK]]] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: [[#TASK+2]]: argc
-// CHECK-NEXT: [[#TASK+3]]: [B1.[[#TASK+2]]] = [B1.[[#TASK+1]]]
+// CHECK-NEXT: [[#TASK:]]:
+// CHECK-SAME: [B1.[[#TASK+9]]]
+// CHECK-NEXT: [[#TASK+1]]: [B1.[[#TASK+9]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT: [[#TASK+2]]: [B1.[[#TASK+8]]]
+// CHECK-NEXT: [[#TASK+3]]: [B1.[[#TASK+8]]] = [B1.[[#TASK+1]]]
// CHECK-NEXT: [[#TASK+4]]: cond
// CHECK-NEXT: [[#TASK+5]]: [B1.[[#TASK+4]]] (ImplicitCastExpr, LValueToRValue, int)
// CHECK-NEXT: [[#TASK+6]]: [B1.[[#TASK+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
-// CHECK-NEXT: [[#TASK+7]]: #pragma omp task if(cond)
+// CHECK-NEXT: [[#TASK+7]]: fp
+// CHECK-NEXT: [[#TASK+8]]: argc
+// CHECK-NEXT: [[#TASK+9]]: x
+// CHECK-NEXT: [[#TASK+10]]: #pragma omp task if(cond) firstprivate(fp)
// CHECK-NEXT: [B1.[[#TASK+3]]];
-#pragma omp task if(cond)
+#pragma omp task if(cond) firstprivate(fp)
argc = x;
// CHECK-NEXT: [[#TG:]]: x
// CHECK-NEXT: [[#TG+1]]: [B1.[[#TG]]] (ImplicitCastExpr, LValueToRValue, int)
@@ -319,84 +152,527 @@
// CHECK-NEXT: [B1.[[#TG+3]]];
#pragma omp taskgroup
argc = x;
-// CHECK-NEXT: [[#TL:]]: x
-// CHECK-NEXT: [[#TL+1]]: [B1.[[#TL]]] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: [[#TL+2]]: argc
-// CHECK-NEXT: [[#TL+3]]: [B1.[[#TL+2]]] = [B1.[[#TL+1]]]
-// CHECK-NEXT: [[#TL+4]]: cond
-// CHECK-NEXT: [[#TL+5]]: [B1.[[#TL+4]]] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: [[#TL+6]]: [B1.[[#TL+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
-// CHECK-NEXT: [[#TL+7]]: #pragma omp taskloop if(cond)
-// CHECK-NEXT: for (int i = 0; i < 10; ++i)
-// CHECK-NEXT: [B1.[[#TL+3]]];
-#pragma omp taskloop if(cond)
- for (int i = 0; i < 10; ++i)
- argc = x;
-// CHECK-NEXT: [[#TLS:]]: x
-// CHECK-NEXT: [[#TLS+1]]: [B1.[[#TLS]]] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: [[#TLS+2]]: argc
-// CHECK-NEXT: [[#TLS+3]]: [B1.[[#TLS+2]]] = [B1.[[#TLS+1]]]
-// CHECK-NEXT: [[#TLS+4]]: cond
-// CHECK-NEXT: [[#TLS+5]]: [B1.[[#TLS+4]]] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: [[#TLS+6]]: [B1.[[#TLS+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
-// CHECK-NEXT: [[#TLS+7]]: #pragma omp taskloop simd if(cond)
-// CHECK-NEXT: for (int i = 0; i < 10; ++i)
-// CHECK-NEXT: [B1.[[#TLS+3]]];
-#pragma omp taskloop simd if(cond)
- for (int i = 0; i < 10; ++i)
- argc = x;
-// CHECK-NEXT: [[#TDPF:]]: x
-// CHECK-NEXT: [[#TDPF+1]]: [B1.[[#TDPF]]] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: [[#TDPF+2]]: argc
-// CHECK-NEXT: [[#TDPF+3]]: [B1.[[#TDPF+2]]] = [B1.[[#TDPF+1]]]
-// CHECK-NEXT: [[#TDPF+4]]: cond
-// CHECK-NEXT: [[#TDPF+5]]: [B1.[[#TDPF+4]]] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: [[#TDPF+6]]: [B1.[[#TDPF+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
-// CHECK-NEXT: [[#TDPF+7]]: #pragma omp teams distribute parallel for if(cond)
-// CHECK-NEXT: for (int i = 0; i < 10; ++i)
-// CHECK-NEXT: [B1.[[#TDPF+3]]];
-// CHECK-NEXT: [[#TDPF+8]]: #pragma omp target
-#pragma omp target
-#pragma omp teams distribute parallel for if(cond)
- for (int i = 0; i < 10; ++i)
- argc = x;
-// CHECK-NEXT: [B1.[[#TDPF+7]]] [[#TDPFS:]]: x
-// CHECK-NEXT: [[#TDPFS+1]]: [B1.[[#TDPFS]]] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: [[#TDPFS+2]]: argc
-// CHECK-NEXT: [[#TDPFS+3]]: [B1.[[#TDPFS+2]]] = [B1.[[#TDPFS+1]]]
-// CHECK-NEXT: [[#TDPFS+4]]: cond
-// CHECK-NEXT: [[#TDPFS+5]]: [B1.[[#TDPFS+4]]] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: [[#TDPFS+6]]: [B1.[[#TDPFS+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
-// CHECK-NEXT: [[#TDPFS+7]]: #pragma omp teams distribute parallel for simd if(cond)
-// CHECK-NEXT: for (int i = 0; i < 10; ++i)
-// CHECK-NEXT: [B1.[[#TDPFS+3]]];
-// CHECK-NEXT: [[#TDPFS+8]]: #pragma omp target
-#pragma omp target
-#pragma omp teams distribute parallel for simd if(cond)
- for (int i = 0; i < 10; ++i)
- argc = x;
-// CHECK-NEXT: [B1.[[#TDPFS+7]]] [[#TDS:]]: x
-// CHECK-NEXT: [[#TDS+1]]: [B1.[[#TDS]]] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: [[#TDS+2]]: argc
-// CHECK-NEXT: [[#TDS+3]]: [B1.[[#TDS+2]]] = [B1.[[#TDS+1]]]
-// CHECK-NEXT: [[#TDS+4]]: #pragma omp teams distribute simd
-// CHECK-NEXT: for (int i = 0; i < 10; ++i)
-// CHECK-NEXT: [B1.[[#TDS+3]]];
-// CHECK-NEXT: [[#TDS+5]]: #pragma omp target
-#pragma omp target
-#pragma omp teams distribute simd
- for (int i = 0; i < 10; ++i)
- argc = x;
-// CHECK-NEXT: [B1.[[#TDS+4]]] [[#TEAMS:]]: x
+// CHECK-NEXT: [[#TEAMS:]]: x
// CHECK-NEXT: [[#TEAMS+1]]: [B1.[[#TEAMS]]] (ImplicitCastExpr, LValueToRValue, int)
// CHECK-NEXT: [[#TEAMS+2]]: argc
// CHECK-NEXT: [[#TEAMS+3]]: [B1.[[#TEAMS+2]]] = [B1.[[#TEAMS+1]]]
-// CHECK-NEXT: [[#TEAMS+4]]: #pragma omp teams
+// CHECK-NEXT: [[#TEAMS+4]]: [B1.[[#TEAMS+7]]]
+// CHECK-NEXT: [[#TEAMS+5]]: [B1.[[#TEAMS+8]]]
+// CHECK-NEXT: [[#TEAMS+6]]: #pragma omp teams firstprivate(fp) reduction(+: rd)
// CHECK-NEXT: [B1.[[#TEAMS+3]]];
-// CHECK-NEXT: [[#TEAMS+5]]: #pragma omp target
+// CHECK-NEXT: [[#TEAMS+7]]: fp
+// CHECK-NEXT: [[#TEAMS+8]]: rd
+// CHECK-NEXT: [[#TEAMS+9]]: argc
+// CHECK-NEXT: [[#TEAMS+10]]: x
+// CHECK-NEXT: [[#TEAMS+11]]: #pragma omp target
#pragma omp target
-#pragma omp teams
+#pragma omp teams firstprivate(fp) reduction(+:rd)
argc = x;
-// CHECK-NEXT: [B1.[[#TEAMS+4]]] Preds
+// CHECK-NEXT: [B1.[[#TEAMS+6]]] Preds
}
+// CHECK-LABEL: void dpf(int argc)
+void dpf(int argc) {
+ int x, cond, fp, rd, lin, step, map;
+// CHECK-DAG: [B3]
+// CHECK-DAG: [[#DPFB:]]: x
+// CHECK-DAG: [[#DPFB+1]]: [B3.[[#DPFB]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#DPFB+2]]: argc
+// CHECK-DAG: [[#DPFB+3]]: [B3.[[#DPFB+2]]] = [B3.[[#DPFB+1]]]
+// CHECK-DAG: [B1]
+// CHECK-DAG: [[#DPF:]]: cond
+// CHECK-DAG: [[#DPF+1]]: [B1.[[#DPF]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#DPF+2]]: [B1.[[#DPF+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-DAG: [[#DPF+3]]: fp
+// CHECK-DAG: [[#DPF+4]]: rd
+// CHECK-DAG: [[#DPF+5]]: #pragma omp distribute parallel for if(parallel: cond) firstprivate(fp) reduction(+: rd)
+// CHECK-DAG: for (int i = 0;
+// CHECK-DAG: [B3.[[#DPFB+3]]];
+#pragma omp distribute parallel for if(parallel:cond) firstprivate(fp) reduction(+:rd)
+ for (int i = 0; i < 10; ++i)
+ argc = x;
+}
+
+// CHECK-LABEL: void dpfs(int argc)
+void dpfs(int argc) {
+ int x, cond, fp, rd, lin, step, map;
+// CHECK-DAG: [B3]
+// CHECK-DAG: [[#DPFSB:]]: x
+// CHECK-DAG: [[#DPFSB+1]]: [B3.[[#DPFSB]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#DPFSB+2]]: argc
+// CHECK-DAG: [[#DPFSB+3]]: [B3.[[#DPFSB+2]]] = [B3.[[#DPFSB+1]]]
+// CHECK-DAG: [B1]
+// CHECK-DAG: [[#DPFS:]]: cond
+// CHECK-DAG: [[#DPFS+1]]: [B1.[[#DPFS]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#DPFS+2]]: [B1.[[#DPFS+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-DAG: [[#DPFS+3]]: fp
+// CHECK-DAG: [[#DPFS+4]]: rd
+// CHECK-DAG: [[#DPFS+5]]: #pragma omp distribute parallel for simd if(cond) firstprivate(fp) reduction(-: rd)
+// CHECK-DAG: for (int i = 0;
+// CHECK-DAG: [B3.[[#DPFSB+3]]];
+#pragma omp distribute parallel for simd if(cond) firstprivate(fp) reduction(-:rd)
+ for (int i = 0; i < 10; ++i)
+ argc = x;
+}
+
+// CHECK-LABEL: void ds(int argc)
+void ds(int argc) {
+ int x, cond, fp, rd, lin, step, map;
+// CHECK-DAG: [B3]
+// CHECK-DAG: [[#DSB:]]: x
+// CHECK-DAG: [[#DSB+1]]: [B3.[[#DSB]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#DSB+2]]: argc
+// CHECK-DAG: [[#DSB+3]]: [B3.[[#DSB+2]]] = [B3.[[#DSB+1]]]
+// CHECK-DAG: [B1]
+// CHECK-DAG: [[#DS:]]: #pragma omp distribute simd
+// CHECK-DAG: for (int i = 0;
+// CHECK-DAG: [B3.[[#DSB+3]]];
+#pragma omp distribute simd
+ for (int i = 0; i < 10; ++i)
+ argc = x;
+}
+
+// CHECK-LABEL: void for_fn(int argc)
+void for_fn(int argc) {
+ int x, cond, fp, rd, lin, step, map;
+// CHECK-DAG: [B3]
+// CHECK-DAG: [[#FORB:]]: x
+// CHECK-DAG: [[#FORB+1]]: [B3.[[#FORB]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#FORB+2]]: argc
+// CHECK-DAG: [[#FORB+3]]: [B3.[[#FORB+2]]] = [B3.[[#FORB+1]]]
+// CHECK-DAG: [B1]
+// CHECK-DAG: [[#FOR:]]: lin
+// CHECK-DAG: [[#FOR+1]]: step
+// CHECK-DAG: [[#FOR+2]]: [B1.[[#FOR+1]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#FOR+3]]: #pragma omp for linear(lin: step)
+// CHECK-DAG: for (int i = 0;
+// CHECK-DAG: [B3.[[#FORB+3]]];
+#pragma omp for linear(lin : step)
+ for (int i = 0; i < 10; ++i)
+ argc = x;
+}
+
+// CHECK-LABEL: void fs(int argc)
+void fs(int argc) {
+ int x, cond, fp, rd, lin, step, map;
+// CHECK-DAG: [B3]
+// CHECK-DAG: [[#FSB:]]: x
+// CHECK-DAG: [[#FSB+1]]: [B3.[[#FSB]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#FSB+2]]: argc
+// CHECK-DAG: [[#FSB+3]]: [B3.[[#FSB+2]]] = [B3.[[#FSB+1]]]
+// CHECK-DAG: [B1]
+// CHECK-DAG: [[#FS:]]: lin
+// CHECK-DAG: [[#FS+1]]: step
+// CHECK-DAG: [[#FS+2]]: [B1.[[#FS+1]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#FS+3]]: #pragma omp for simd linear(lin: step)
+// CHECK-DAG: for (int i = 0;
+// CHECK-DAG: [B3.[[#FSB+3]]];
+#pragma omp for simd linear(lin: step)
+ for (int i = 0; i < 10; ++i)
+ argc = x;
+}
+
+// CHECK-LABEL: void ord(int argc)
+void ord(int argc) {
+ int x, cond, fp, rd, lin, step, map;
+// CHECK-DAG: [B3]
+// CHECK-DAG: [[#ORDB:]]: x
+// CHECK-DAG: [[#ORDB+1]]: [B3.[[#ORDB]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#ORDB+2]]: argc
+// CHECK-DAG: [[#ORDB+3]]: [B3.[[#ORDB+2]]] = [B3.[[#ORDB+1]]]
+// CHECK-DAG: [[#ORDB+4]]: #pragma omp ordered
+// CHECK-DAG: [B3.[[#ORDB+3]]];
+// CHECK-DAG: [B1]
+// CHECK-DAG: [[#ORD:]]: #pragma omp for ordered
+// CHECK-DAG: for (int i = 0
+// CHECK-DAG:[B3.[[#ORDB+4]]] }
+#pragma omp for ordered
+ for (int i = 0; i < 10; ++i) {
+#pragma omp ordered
+ argc = x;
+ }
+}
+
+// CHECK-LABEL: void pf(int argc)
+void pf(int argc) {
+ int x, cond, fp, rd, lin, step, map;
+// CHECK-DAG: [B3]
+// CHECK-DAG: [[#PFB:]]: x
+// CHECK-DAG: [[#PFB+1]]: [B3.[[#PFB]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#PFB+2]]: argc
+// CHECK-DAG: [[#PFB+3]]: [B3.[[#PFB+2]]] = [B3.[[#PFB+1]]]
+// CHECK-DAG: [B1]
+// CHECK-DAG: [[#PF:]]: cond
+// CHECK-DAG: [[#PF+1]]: [B1.[[#PF]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#PF+2]]: [B1.[[#PF+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-DAG: [[#PF+3]]: fp
+// CHECK-DAG: [[#PF+4]]: rd
+// CHECK-DAG: [[#PF+5]]: lin
+// CHECK-DAG: [[#PF+6]]: step
+// CHECK-DAG: [[#PF+7]]: [B1.[[#PF+6]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#PF+8]]: #pragma omp parallel for if(cond) firstprivate(fp) reduction(&: rd) linear(lin: step)
+// CHECK-DAG: for (int i = 0;
+// CHECK-DAG: [B3.[[#PFB+3]]];
+#pragma omp parallel for if(cond) firstprivate(fp) reduction(&:rd) linear(lin: step)
+ for (int i = 0; i < 10; ++i)
+ argc = x;
+}
+
+// CHECK-LABEL: void pfs(int argc)
+void pfs(int argc) {
+ int x, cond, fp, rd, lin, step, map;
+// CHECK-DAG: [B3]
+// CHECK-DAG: [[#PFSB:]]: x
+// CHECK-DAG: [[#PFSB+1]]: [B3.[[#PFSB]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#PFSB+2]]: argc
+// CHECK-DAG: [[#PFSB+3]]: [B3.[[#PFSB+2]]] = [B3.[[#PFSB+1]]]
+// CHECK-DAG: [B1]
+// CHECK-DAG: [[#PFS:]]: cond
+// CHECK-DAG: [[#PFS+1]]: [B1.[[#PFS]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#PFS+2]]: [B1.[[#PFS+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-DAG: [[#PFS+3]]: fp
+// CHECK-DAG: [[#PFS+4]]: rd
+// CHECK-DAG: [[#PFS+5]]: lin
+// CHECK-DAG: [[#PFS+6]]: step
+// CHECK-DAG: [[#PFS+7]]: [B1.[[#PFS+6]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#PFS+8]]: #pragma omp parallel for simd if(cond) firstprivate(fp) reduction(|: rd) linear(lin: step)
+// CHECK-DAG: for (int i = 0;
+// CHECK-DAG: [B3.[[#PFSB+3]]];
+#pragma omp parallel for simd if(cond) firstprivate(fp) reduction(|:rd) linear(lin: step)
+ for (int i = 0; i < 10; ++i)
+ argc = x;
+}
+
+// CHECK-LABEL: void simd(int argc)
+void simd(int argc) {
+ int x, cond, fp, rd, lin, step, map;
+// CHECK-DAG: [B3]
+// CHECK-DAG: [[#SIMDB:]]: x
+// CHECK-DAG: [[#SIMDB+1]]: [B3.[[#SIMDB]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#SIMDB+2]]: argc
+// CHECK-DAG: [[#SIMDB+3]]: [B3.[[#SIMDB+2]]] = [B3.[[#SIMDB+1]]]
+// CHECK-DAG: [B1]
+// CHECK-DAG: [[#SIMD:]]: lin
+// CHECK-DAG: [[#SIMD+1]]: step
+// CHECK-DAG: [[#SIMD+2]]: [B1.[[#SIMD+1]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#SIMD+3]]: #pragma omp simd linear(lin: step)
+// CHECK-DAG: for (int i = 0;
+// CHECK-DAG: [B3.[[#SIMDB+3]]];
+#pragma omp simd linear(lin: step)
+ for (int i = 0; i < 10; ++i)
+ argc = x;
+}
+
+// CHECK-LABEL: void tpf(int argc)
+void tpf(int argc) {
+ int x, cond, fp, rd, lin, step, map;
+// CHECK-DAG: [B3]
+// CHECK-DAG: [[#TPFB:]]: x
+// CHECK-DAG: [[#TPFB+1]]: [B3.[[#TPFB]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#TPFB+2]]: argc
+// CHECK-DAG: [[#TPFB+3]]: [B3.[[#TPFB+2]]] = [B3.[[#TPFB+1]]]
+// CHECK-DAG: [B1]
+// CHECK-DAG: [[#TPF:]]: cond
+// CHECK-DAG: [[#TPF+1]]: [B1.[[#TPF]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#TPF+2]]: [B1.[[#TPF+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-DAG: [[#TPF+3]]: fp
+// CHECK-DAG: [[#TPF+4]]: rd
+// CHECK-DAG: [[#TPF+5]]: lin
+// CHECK-DAG: [[#TPF+6]]: step
+// CHECK-DAG: [[#TPF+7]]: [B1.[[#TPF+6]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#TPF+8]]: map
+// CHECK-DAG: [[#TPF+9]]: [B3.[[#TPFB+2]]]
+// CHECK-DAG: [[#TPF+10]]: [B3.[[#TPFB]]]
+// CHECK-DAG: [[#TPF+11]]: #pragma omp target parallel for if(parallel: cond) firstprivate(fp) reduction(max: rd) linear(lin: step) map(tofrom: map)
+// CHECK-DAG: for (int i = 0;
+// CHECK-DAG: [B3.[[#TPFB+3]]];
+#pragma omp target parallel for if(parallel:cond) firstprivate(fp) reduction(max:rd) linear(lin: step) map(map)
+ for (int i = 0; i < 10; ++i)
+ argc = x;
+}
+
+// CHECK-LABEL: void tpfs(int argc)
+void tpfs(int argc) {
+ int x, cond, fp, rd, lin, step, map;
+// CHECK-DAG: [B3]
+// CHECK-DAG: [[#TPFSB:]]: x
+// CHECK-DAG: [[#TPFSB+1]]: [B3.[[#TPFSB]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#TPFSB+2]]: argc
+// CHECK-DAG: [[#TPFSB+3]]: [B3.[[#TPFSB+2]]] = [B3.[[#TPFSB+1]]]
+// CHECK-DAG: [B1]
+// CHECK-DAG: [[#TPFS:]]: cond
+// CHECK-DAG: [[#TPFS+1]]: [B1.[[#TPFS]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#TPFS+2]]: [B1.[[#TPFS+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-DAG: [[#TPFS+3]]: fp
+// CHECK-DAG: [[#TPFS+4]]: rd
+// CHECK-DAG: [[#TPFS+5]]: lin
+// CHECK-DAG: [[#TPFS+6]]: step
+// CHECK-DAG: [[#TPFS+7]]: [B1.[[#TPFS+6]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#TPFS+8]]: map
+// CHECK-DAG: [[#TPFS+9]]: [B3.[[#TPFSB+2]]]
+// CHECK-DAG: [[#TPFS+10]]: [B3.[[#TPFSB]]]
+// CHECK-DAG: [[#TPFS+11]]: #pragma omp target parallel for simd if(target: cond) firstprivate(fp) reduction(*: rd) linear(lin: step) map(tofrom: map)
+// CHECK-DAG: for (int i = 0;
+// CHECK-DAG: [B3.[[#TPFSB+3]]];
+#pragma omp target parallel for simd if(target:cond) firstprivate(fp) reduction(*:rd) linear(lin: step) map(tofrom:map)
+ for (int i = 0; i < 10; ++i)
+ argc = x;
+}
+
+// CHECK-LABEL: void ts(int argc)
+void ts(int argc) {
+ int x, cond, fp, rd, lin, step, map;
+// CHECK-DAG: [B3]
+// CHECK-DAG: [[#TSB:]]: x
+// CHECK-DAG: [[#TSB+1]]: [B3.[[#TSB]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#TSB+2]]: argc
+// CHECK-DAG: [[#TSB+3]]: [B3.[[#TSB+2]]] = [B3.[[#TSB+1]]]
+// CHECK-DAG: [B1]
+// CHECK-DAG: [[#TS:]]: cond
+// CHECK-DAG: [[#TS+1]]: [B1.[[#TS]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#TS+2]]: [B1.[[#TS+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-DAG: [[#TS+3]]: fp
+// CHECK-DAG: [[#TS+4]]: rd
+// CHECK-DAG: [[#TS+5]]: lin
+// CHECK-DAG: [[#TS+6]]: step
+// CHECK-DAG: [[#TS+7]]: [B1.[[#TS+6]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#TS+8]]: [B3.[[#TSB+2]]]
+// CHECK-DAG: [[#TS+9]]: [B3.[[#TSB]]]
+// CHECK-DAG: [[#TS+10]]: #pragma omp target simd if(cond) firstprivate(fp) reduction(+: rd) linear(lin: step) map(alloc: map)
+// CHECK-DAG: for (int i = 0;
+// CHECK-DAG: [B3.[[#TSB+3]]];
+#pragma omp target simd if(cond) firstprivate(fp) reduction(+:rd) linear(lin: step) map(alloc:map)
+ for (int i = 0; i < 10; ++i)
+ argc = x;
+}
+
+// CHECK-LABEL: void ttd(int argc)
+void ttd(int argc) {
+ int x, cond, fp, rd, lin, step, map;
+// CHECK-DAG: [B3]
+// CHECK-DAG: [[#TTDB:]]: x
+// CHECK-DAG: [[#TTDB+1]]: [B3.[[#TTDB]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#TTDB+2]]: argc
+// CHECK-DAG: [[#TTDB+3]]: [B3.[[#TTDB+2]]] = [B3.[[#TTDB+1]]]
+// CHECK-DAG: [B1]
+// CHECK-DAG: [[#TTD:]]: cond
+// CHECK-DAG: [[#TTD+1]]: [B1.[[#TTD]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#TTD+2]]: [B1.[[#TTD+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-DAG: [[#TTD+3]]: fp
+// CHECK-DAG: [[#TTD+4]]: rd
+// CHECK-DAG: [[#TTD+5]]: [B3.[[#TTDB+2]]]
+// CHECK-DAG: [[#TTD+6]]: [B3.[[#TTDB]]]
+// CHECK-DAG: [[#TTD+7]]: #pragma omp target teams distribute if(cond) firstprivate(fp) reduction(+: rd) map(release: map)
+// CHECK-DAG: for (int i = 0;
+// CHECK-DAG: [B3.[[#TTDB+3]]];
+#pragma omp target teams distribute if(cond) firstprivate(fp) reduction(+:rd) map(release:map)
+ for (int i = 0; i < 10; ++i)
+ argc = x;
+}
+
+// CHECK-LABEL: void ttdpf(int argc)
+void ttdpf(int argc) {
+ int x, cond, fp, rd, lin, step, map;
+// CHECK-DAG: [B3]
+// CHECK-DAG: [[#TTDPFB:]]: x
+// CHECK-DAG: [[#TTDPFB+1]]: [B3.[[#TTDPFB]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#TTDPFB+2]]: argc
+// CHECK-DAG: [[#TTDPFB+3]]: [B3.[[#TTDPFB+2]]] = [B3.[[#TTDPFB+1]]]
+// CHECK-DAG: [B1]
+// CHECK-DAG: [[#TTDPF:]]: cond
+// CHECK-DAG: [[#TTDPF+1]]: [B1.[[#TTDPF]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#TTDPF+2]]: [B1.[[#TTDPF+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-DAG: [[#TTDPF+3]]: fp
+// CHECK-DAG: [[#TTDPF+4]]: rd
+// CHECK-DAG: [[#TTDPF+5]]: [B3.[[#TTDPFB+2]]]
+// CHECK-DAG: [[#TTDPF+6]]: [B3.[[#TTDPFB]]]
+// CHECK-DAG: [[#TTDPF+7]]: #pragma omp target teams distribute parallel for if(cond) firstprivate(fp) reduction(+: rd) map(delete: map)
+// CHECK-DAG: for (int i = 0;
+// CHECK-DAG: [B3.[[#TTDPFB+3]]];
+#pragma omp target teams distribute parallel for if(cond) firstprivate(fp) reduction(+:rd) map(delete:map)
+ for (int i = 0; i < 10; ++i)
+ argc = x;
+}
+
+// CHECK-LABEL: void ttdpfs(int argc)
+void ttdpfs(int argc) {
+ int x, cond, fp, rd, lin, step, map;
+// CHECK-DAG: [B3]
+// CHECK-DAG: [[#TTDPFSB:]]: x
+// CHECK-DAG: [[#TTDPFSB+1]]: [B3.[[#TTDPFSB]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#TTDPFSB+2]]: argc
+// CHECK-DAG: [[#TTDPFSB+3]]: [B3.[[#TTDPFSB+2]]] = [B3.[[#TTDPFSB+1]]]
+// CHECK-DAG: [B1]
+// CHECK-DAG: [[#TTDPFS:]]: cond
+// CHECK-DAG: [[#TTDPFS+1]]: [B1.[[#TTDPFS]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#TTDPFS+2]]: [B1.[[#TTDPFS+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-DAG: [[#TTDPFS+3]]: fp
+// CHECK-DAG: [[#TTDPFS+4]]: rd
+// CHECK-DAG: [[#TTDPFS+5]]: [B3.[[#TTDPFSB+2]]]
+// CHECK-DAG: [[#TTDPFS+6]]: [B3.[[#TTDPFSB]]]
+// CHECK-DAG: [[#TTDPFS+7]]: #pragma omp target teams distribute parallel for simd if(parallel: cond) firstprivate(fp) reduction(+: rd) map(from: map)
+// CHECK-DAG: for (int i = 0;
+// CHECK-DAG: [B3.[[#TTDPFSB+3]]];
+#pragma omp target teams distribute parallel for simd if(parallel:cond) firstprivate(fp) reduction(+:rd) map(from:map)
+ for (int i = 0; i < 10; ++i)
+ argc = x;
+}
+
+// CHECK-LABEL: void ttds(int argc)
+void ttds(int argc) {
+ int x, cond, fp, rd, lin, step, map;
+// CHECK-DAG: [B3]
+// CHECK-DAG: [[#TTDSB:]]: x
+// CHECK-DAG: [[#TTDSB+1]]: [B3.[[#TTDSB]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#TTDSB+2]]: argc
+// CHECK-DAG: [[#TTDSB+3]]: [B3.[[#TTDSB+2]]] = [B3.[[#TTDSB+1]]]
+// CHECK-DAG: [B1]
+// CHECK-DAG: [[#TTDS:]]: cond
+// CHECK-DAG: [[#TTDS+1]]: [B1.[[#TTDS]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#TTDS+2]]: [B1.[[#TTDS+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-DAG: [[#TTDS+3]]: fp
+// CHECK-DAG: [[#TTDS+4]]: rd
+// CHECK-DAG: [[#TTDS+5]]: map
+// CHECK-DAG: [[#TTDS+6]]: [B3.[[#TTDSB+2]]]
+// CHECK-DAG: [[#TTDS+7]]: [B3.[[#TTDSB]]]
+// CHECK-DAG: [[#TTDS+8]]: #pragma omp target teams distribute simd if(cond) firstprivate(fp) reduction(+: rd) map(tofrom: map)
+// CHECK-DAG: for (int i = 0;
+// CHECK-DAG: [B3.[[#TTDPFSB+3]]];
+#pragma omp target teams distribute simd if(cond) firstprivate(fp) reduction(+:rd) map(map)
+ for (int i = 0; i < 10; ++i)
+ argc = x;
+}
+
+// CHECK-LABEL: void tl(int argc)
+void tl(int argc) {
+ int x, cond, fp, rd, lin, step, map;
+// CHECK-DAG: [B3]
+// CHECK-DAG: [[#TLB:]]: x
+// CHECK-DAG: [[#TLB+1]]: [B3.[[#TLB]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#TLB+2]]: argc
+// CHECK-DAG: [[#TLB+3]]: [B3.[[#TLB+2]]] = [B3.[[#TLB+1]]]
+// CHECK-DAG: [B1]
+// CHECK-DAG: [[#TL:]]: cond
+// CHECK-DAG: [[#TL+1]]: [B1.[[#TL]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#TL+2]]: [B1.[[#TL+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-DAG: [[#TL+3]]: fp
+// CHECK-DAG: [[#TL+4]]: rd
+// CHECK-DAG: [[#TL+5]]: [B3.[[#TLB+2]]]
+// CHECK-DAG: [[#TL+6]]: [B3.[[#TLB]]]
+// CHECK-DAG: [[#TL+7]]: #pragma omp taskloop if(cond) firstprivate(fp) reduction(+: rd)
+// CHECK-DAG: for (int i = 0;
+// CHECK-DAG: [B3.[[#TLB+3]]];
+#pragma omp taskloop if(cond) firstprivate(fp) reduction(+:rd)
+ for (int i = 0; i < 10; ++i)
+ argc = x;
+}
+
+// CHECK-LABEL: void tls(int argc)
+void tls(int argc) {
+ int x, cond, fp, rd, lin, step, map;
+// CHECK-DAG: [B3]
+// CHECK-DAG: [[#TLSB:]]: x
+// CHECK-DAG: [[#TLSB+1]]: [B3.[[#TLSB]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#TLSB+2]]: argc
+// CHECK-DAG: [[#TLSB+3]]: [B3.[[#TLSB+2]]] = [B3.[[#TLSB+1]]]
+// CHECK-DAG: [B1]
+// CHECK-DAG: [[#TLS:]]: cond
+// CHECK-DAG: [[#TLS+1]]: [B1.[[#TLS]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#TLS+2]]: [B1.[[#TLS+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-DAG: [[#TLS+3]]: fp
+// CHECK-DAG: [[#TLS+4]]: rd
+// CHECK-DAG: [[#TLS+5]]: lin
+// CHECK-DAG: [[#TLS+6]]: step
+// CHECK-DAG: [[#TLS+7]]: [B1.[[#TLS+6]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#TLS+8]]: [B3.[[#TLSB+2]]]
+// CHECK-DAG: [[#TLS+9]]: [B3.[[#TLSB]]]
+// CHECK-DAG: [[#TLS+10]]: #pragma omp taskloop simd if(cond) firstprivate(fp) reduction(+: rd) linear(lin: step)
+// CHECK-DAG: for (int i = 0;
+// CHECK-DAG: [B3.[[#TLSB+3]]];
+#pragma omp taskloop simd if(cond) firstprivate(fp) reduction(+:rd) linear(lin: step)
+ for (int i = 0; i < 10; ++i)
+ argc = x;
+}
+
+// CHECK-LABEL: void tdpf(int argc)
+void tdpf(int argc) {
+ int x, cond, fp, rd, lin, step, map;
+// CHECK-DAG: [B1]
+// CHECK-DAG: [[#TDPF:]]: cond
+// CHECK-DAG: [[#TDPF+1]]: [B1.[[#TDPF]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#TDPF+2]]: [B1.[[#TDPF+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-DAG: [[#TDPF+3]]: [B1.[[#TDPF+6]]]
+// CHECK-DAG: [[#TDPF+4]]: [B1.[[#TDPF+7]]]
+// CHECK-DAG: [[#TDPF+5]]: #pragma omp teams distribute parallel for if(cond) firstprivate(fp) reduction(+: rd)
+// CHECK-DAG: for (int i = 0;
+// CHECK-DAG: [B3.[[#TDPFB:]]];
+// CHECK-DAG: [[#TDPF+6]]: fp
+// CHECK-DAG: [[#TDPF+7]]: rd
+// CHECK-DAG: [[#TDPF+8]]: argc
+// CHECK-DAG: [[#TDPF+9]]: x
+// CHECK-DAG: [[#TDPF+10]]: cond
+// CHECK-DAG: [[#TDPF+11]]: #pragma omp target
+// CHECK-DAG: [B3]
+// CHECK-DAG: [[#TDPFB-3]]: x
+// CHECK-DAG: [[#TDPFB-2]]: [B3.[[#TDPFB-3]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#TDPFB-1]]: argc
+// CHECK-DAG: [[#TDPFB]]: [B3.[[#TDPFB-1]]] = [B3.[[#TDPFB-2]]]
+#pragma omp target
+#pragma omp teams distribute parallel for if(cond) firstprivate(fp) reduction(+:rd)
+ for (int i = 0; i < 10; ++i)
+ argc = x;
+}
+
+// CHECK-LABEL: void tdpfs(int argc)
+void tdpfs(int argc) {
+ int x, cond, fp, rd, lin, step, map;
+// CHECK-DAG: [B1]
+// CHECK-DAG: [[#TDPFS:]]: cond
+// CHECK-DAG: [[#TDPFS+1]]: [B1.[[#TDPFS]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#TDPFS+2]]: [B1.[[#TDPFS+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-DAG: [[#TDPFS+3]]: [B1.[[#TDPFS+6]]]
+// CHECK-DAG: [[#TDPFS+4]]: [B1.[[#TDPFS+7]]]
+// CHECK-DAG: [[#TDPFS+5]]: #pragma omp teams distribute parallel for simd if(cond) firstprivate(fp) reduction(+: rd)
+// CHECK-DAG: for (int i = 0;
+// CHECK-DAG: [B3.[[#TDPFSB:]]];
+// CHECK-DAG: [[#TDPFS+6]]: fp
+// CHECK-DAG: [[#TDPFS+7]]: rd
+// CHECK-DAG: [[#TDPFS+8]]: argc
+// CHECK-DAG: [[#TDPFS+9]]: x
+// CHECK-DAG: [[#TDPFS+10]]: cond
+// CHECK-DAG: [[#TDPFS+11]]: #pragma omp target
+// CHECK-DAG: [B3]
+// CHECK-DAG: [[#TDPFSB-3]]: x
+// CHECK-DAG: [[#TDPFSB-2]]: [B3.[[#TDPFSB-3]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#TDPFSB-1]]: argc
+// CHECK-DAG: [[#TDPFSB]]: [B3.[[#TDPFSB-1]]] = [B3.[[#TDPFSB-2]]]
+#pragma omp target
+#pragma omp teams distribute parallel for simd if(cond) firstprivate(fp) reduction(+:rd)
+ for (int i = 0; i < 10; ++i)
+ argc = x;
+}
+
+// CHECK-LABEL: void tds(int argc)
+void tds(int argc) {
+ int x, cond, fp, rd, lin, step, map;
+// CHECK-DAG: [B1]
+// CHECK-DAG: [[#TDS:]]: #pragma omp teams distribute simd firstprivate(fp) reduction(+: rd)
+// CHECK-DAG: [[#TDS-2]]: [B1.[[#TDS+1]]]
+// CHECK-DAG: [[#TDS-1]]: [B1.[[#TDS+2]]]
+// CHECK-DAG: for (int i = 0;
+// CHECK-DAG: [B3.[[#TDSB:]]];
+// CHECK-DAG: [[#TDS+1]]: fp
+// CHECK-DAG: [[#TDS+2]]: rd
+// CHECK-DAG: [[#TDS+3]]: argc
+// CHECK-DAG: [[#TDS+4]]: x
+// CHECK-DAG: [[#TDS+5]]: #pragma omp target
+// CHECK-DAG: [B3]
+// CHECK-DAG: [[#TDSB-3]]: x
+// CHECK-DAG: [[#TDSB-2]]: [B3.[[#TDSB-3]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-DAG: [[#TDSB-1]]: argc
+// CHECK-DAG: [[#TDSB]]: [B3.[[#TDSB-1]]] = [B3.[[#TDSB-2]]]
+#pragma omp target
+#pragma omp teams distribute simd firstprivate(fp) reduction(+:rd)
+ for (int i = 0; i < 10; ++i)
+ argc = x;
+}
diff --git a/src/llvm-project/clang/test/Analysis/cfg-rich-constructors.cpp b/src/llvm-project/clang/test/Analysis/cfg-rich-constructors.cpp
index cb1ed8e..e33e575 100644
--- a/src/llvm-project/clang/test/Analysis/cfg-rich-constructors.cpp
+++ b/src/llvm-project/clang/test/Analysis/cfg-rich-constructors.cpp
@@ -412,7 +412,6 @@
~D();
};
-// FIXME: There should be no temporary destructor in C++17.
// CHECK: return_stmt_with_dtor::D returnTemporary()
// CXX11-ELIDE: 1: return_stmt_with_dtor::D() (CXXConstructExpr, [B1.2], [B1.4], [B1.5], class return_stmt_with_dtor::D)
// CXX11-NOELIDE: 1: return_stmt_with_dtor::D() (CXXConstructExpr, [B1.2], [B1.4], class return_stmt_with_dtor::D)
@@ -422,15 +421,13 @@
// CXX11-NEXT: 5: [B1.4] (CXXConstructExpr, [B1.7], class return_stmt_with_dtor::D)
// CXX11-NEXT: 6: ~return_stmt_with_dtor::D() (Temporary object destructor)
// CXX11-NEXT: 7: return [B1.5];
-// CXX17: 1: return_stmt_with_dtor::D() (CXXConstructExpr, [B1.4], [B1.2], class return_stmt_w
+// CXX17: 1: return_stmt_with_dtor::D() (CXXConstructExpr, [B1.3], [B1.2], class return_stmt_w
// CXX17-NEXT: 2: [B1.1] (BindTemporary)
-// CXX17-NEXT: 3: ~return_stmt_with_dtor::D() (Temporary object destructor)
-// CXX17-NEXT: 4: return [B1.2];
+// CXX17-NEXT: 3: return [B1.2];
D returnTemporary() {
return D();
}
-// FIXME: There should be no temporary destructor in C++17.
// CHECK: void returnByValueIntoVariable()
// CHECK: 1: returnTemporary
// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, FunctionToPointerDecay, class return_stmt_with_dtor::D (*)(void))
@@ -442,12 +439,10 @@
// CXX11-NEXT: 7: [B1.6] (CXXConstructExpr, [B1.8], class return_stmt_with_dtor::D)
// CXX11-NEXT: 8: return_stmt_with_dtor::D d = returnTemporary();
// CXX11-NEXT: 9: ~return_stmt_with_dtor::D() (Temporary object destructor)
-// CXX11-NEXT: 10: [B1.8].~D() (Implicit destructor)
+// CXX11-NEXT: 10: [B1.8].~return_stmt_with_dtor::D() (Implicit destructor)
// CXX17-NEXT: 3: [B1.2]() (CXXRecordTypedCall, [B1.5], [B1.4])
// CXX17-NEXT: 4: [B1.3] (BindTemporary)
// CXX17-NEXT: 5: return_stmt_with_dtor::D d = returnTemporary();
-// CXX17-NEXT: 6: ~return_stmt_with_dtor::D() (Temporary object destructor)
-// CXX17-NEXT: 7: [B1.5].~D() (Implicit destructor)
void returnByValueIntoVariable() {
D d = returnTemporary();
}
@@ -602,7 +597,7 @@
// CHECK-NEXT: 3: [B1.2] (BindTemporary)
// CHECK-NEXT: 4: [B1.3]
// CHECK-NEXT: 5: const temporary_object_expr_with_dtors::D &d(0);
-// CHECK-NEXT: 6: [B1.5].~D() (Implicit destructor)
+// CHECK-NEXT: 6: [B1.5].~temporary_object_expr_with_dtors::D() (Implicit destructor)
void referenceVariableWithConstructor() {
const D &d(0);
}
@@ -613,14 +608,14 @@
// CHECK-NEXT: 3: [B1.2] (ImplicitCastExpr, NoOp, const class temporary_object_expr_with_dtors::D)
// CHECK-NEXT: 4: [B1.3]
// CHECK-NEXT: 5: const temporary_object_expr_with_dtors::D &d = temporary_object_expr_with_dtors::D();
-// CHECK-NEXT: 6: [B1.5].~D() (Implicit destructor)
+// CHECK-NEXT: 6: [B1.5].~temporary_object_expr_with_dtors::D() (Implicit destructor)
void referenceVariableWithInitializer() {
const D &d = D();
}
// CHECK: void referenceVariableWithTernaryOperator(bool coin)
// CXX11: [B1]
-// CXX11-NEXT: 1: [B4.4].~D() (Implicit destructor)
+// CXX11-NEXT: 1: [B4.4].~temporary_object_expr_with_dtors::D() (Implicit destructor)
// CXX11: [B2]
// CXX11-NEXT: 1: ~temporary_object_expr_with_dtors::D() (Temporary object destructor)
// CXX11: [B3]
@@ -660,7 +655,7 @@
// CXX17-NEXT: 2: [B1.1] (ImplicitCastExpr, NoOp, const class temporary_object_expr_with_dtors::D)
// CXX17-NEXT: 3: [B1.2]
// CXX17-NEXT: 4: const temporary_object_expr_with_dtors::D &d = coin ? D::get() : temporary_object_expr_with_dtors::D(0);
-// CXX17-NEXT: 5: [B1.4].~D() (Implicit destructor)
+// CXX17-NEXT: 5: [B1.4].~temporary_object_expr_with_dtors::D() (Implicit destructor)
// CXX17: [B2]
// CXX17-NEXT: 1: D::get
// CXX17-NEXT: 2: [B2.1] (ImplicitCastExpr, FunctionToPointerDecay, class temporary_object_expr_with_dtors::D (*)(void))
@@ -686,7 +681,7 @@
// CHECK-NEXT: 4: temporary_object_expr_with_dtors::D([B1.3]) (CXXFunctionalCastExpr, ConstructorCon
// CHECK-NEXT: 5: [B1.4]
// CHECK-NEXT: 6: temporary_object_expr_with_dtors::D &&d = temporary_object_expr_with_dtors::D(1);
-// CHECK-NEXT: 7: [B1.6].~D() (Implicit destructor)
+// CHECK-NEXT: 7: [B1.6].~temporary_object_expr_with_dtors::D() (Implicit destructor)
void referenceWithFunctionalCast() {
D &&d = D(1);
}
@@ -743,13 +738,13 @@
// CXX11-NEXT: 9: [B1.8] (CXXConstructExpr, [B1.10], class implicit_constructor_conversion::B)
// CXX11-NEXT: 10: implicit_constructor_conversion::B b = implicit_constructor_conversion::A();
// CXX11-NEXT: 11: ~implicit_constructor_conversion::B() (Temporary object destructor)
-// CXX11-NEXT: 12: [B1.10].~B() (Implicit destructor)
+// CXX11-NEXT: 12: [B1.10].~implicit_constructor_conversion::B() (Implicit destructor)
// CXX17-NEXT: 2: [B1.1] (ImplicitCastExpr, NoOp, const class implicit_constructor_conversion::A)
// CXX17-NEXT: 3: [B1.2]
// CXX17-NEXT: 4: [B1.3] (CXXConstructExpr, [B1.6], class implicit_constructor_conversion::B)
// CXX17-NEXT: 5: [B1.4] (ImplicitCastExpr, ConstructorConversion, class implicit_constructor_conversion::B)
// CXX17-NEXT: 6: implicit_constructor_conversion::B b = implicit_constructor_conversion::A();
-// CXX17-NEXT: 7: [B1.6].~B() (Implicit destructor)
+// CXX17-NEXT: 7: [B1.6].~implicit_constructor_conversion::B() (Implicit destructor)
void implicitConstructionConversionFromTemporary() {
B b = A();
}
@@ -769,11 +764,11 @@
// CXX11-NEXT: 11: [B1.10] (CXXConstructExpr, [B1.12], class implicit_constructor_conversion::B)
// CXX11-NEXT: 12: implicit_constructor_conversion::B b = get();
// CXX11-NEXT: 13: ~implicit_constructor_conversion::B() (Temporary object destructor)
-// CXX11-NEXT: 14: [B1.12].~B() (Implicit destructor)
+// CXX11-NEXT: 14: [B1.12].~implicit_constructor_conversion::B() (Implicit destructor)
// CXX17-NEXT: 6: [B1.5] (CXXConstructExpr, [B1.8], class implicit_constructor_conversion::B)
// CXX17-NEXT: 7: [B1.6] (ImplicitCastExpr, ConstructorConversion, class implicit_constructor_conversion::B)
// CXX17-NEXT: 8: implicit_constructor_conversion::B b = get();
-// CXX17-NEXT: 9: [B1.8].~B() (Implicit destructor)
+// CXX17-NEXT: 9: [B1.8].~implicit_constructor_conversion::B() (Implicit destructor)
void implicitConstructionConversionFromFunctionValue() {
B b = get();
}
@@ -787,7 +782,7 @@
// CHECK-NEXT: 6: [B1.5] (ImplicitCastExpr, NoOp, const class implicit_constructor_conversion::B)
// CHECK-NEXT: 7: [B1.6]
// CHECK-NEXT: 8: const implicit_constructor_conversion::B &b = implicit_constructor_conversion::A();
-// CHECK-NEXT: 9: [B1.8].~B() (Implicit destructor)
+// CHECK-NEXT: 9: [B1.8].~implicit_constructor_conversion::B() (Implicit destructor)
void implicitConstructionConversionFromTemporaryWithLifetimeExtension() {
const B &b = A();
}
@@ -803,7 +798,7 @@
// CHECK-NEXT: 8: [B1.7] (ImplicitCastExpr, NoOp, const class implicit_constructor_conversion::B)
// CHECK-NEXT: 9: [B1.8]
// CHECK-NEXT: 10: const implicit_constructor_conversion::B &b = get();
-// CHECK-NEXT: 11: [B1.10].~B() (Implicit destructor)
+// CHECK-NEXT: 11: [B1.10].~implicit_constructor_conversion::B() (Implicit destructor)
void implicitConstructionConversionFromFunctionValueWithLifetimeExtension() {
const B &b = get(); // no-crash
}
diff --git a/src/llvm-project/clang/test/Analysis/cfg-rich-constructors.mm b/src/llvm-project/clang/test/Analysis/cfg-rich-constructors.mm
index 2890942..e55928d 100644
--- a/src/llvm-project/clang/test/Analysis/cfg-rich-constructors.mm
+++ b/src/llvm-project/clang/test/Analysis/cfg-rich-constructors.mm
@@ -59,8 +59,7 @@
// CXX17-NEXT: 3: {{\[}}[B1.2] bar] (CXXRecordTypedCall, [B1.5], [B1.4])
// CXX17-NEXT: 4: [B1.3] (BindTemporary)
// CXX17-NEXT: 5: D d = [e bar];
-// CXX17-NEXT: 6: ~D() (Temporary object destructor)
-// CXX17-NEXT: 7: [B1.5].~D() (Implicit destructor)
+// CXX17-NEXT: 6: [B1.5].~D() (Implicit destructor)
void returnObjectFromMessage(E *e) {
D d = [e bar];
}
diff --git a/src/llvm-project/clang/test/Analysis/cfg.cpp b/src/llvm-project/clang/test/Analysis/cfg.cpp
index ea028e0..a7d707e 100644
--- a/src/llvm-project/clang/test/Analysis/cfg.cpp
+++ b/src/llvm-project/clang/test/Analysis/cfg.cpp
@@ -203,7 +203,7 @@
// CHECK-LABEL: int test1(int *x)
// CHECK: 1: 1
// CHECK-NEXT: 2: return
-// CHECK-NEXT: ~B() (Implicit destructor)
+// CHECK-NEXT: ~NoReturnSingleSuccessor::B() (Implicit destructor)
// CHECK-NEXT: Preds (1)
// CHECK-NEXT: Succs (1): B0
int test1(int *x) {
@@ -477,7 +477,7 @@
// WARNINGS-NEXT: 1: (CXXConstructExpr, struct pr37688_deleted_union_destructor::A)
// ANALYZER-NEXT: 1: (CXXConstructExpr, [B1.2], struct pr37688_deleted_union_destructor::A)
// CHECK-NEXT: 2: pr37688_deleted_union_destructor::A a;
-// CHECK-NEXT: 3: [B1.2].~A() (Implicit destructor)
+// CHECK-NEXT: 3: [B1.2].~pr37688_deleted_union_destructor::A() (Implicit destructor)
// CHECK-NEXT: Preds (1): B2
// CHECK-NEXT: Succs (1): B0
// CHECK: [B0 (EXIT)]
@@ -499,6 +499,75 @@
} // end namespace pr37688_deleted_union_destructor
+namespace return_statement_expression {
+int unknown();
+
+// CHECK-LABEL: int foo()
+// CHECK: [B6 (ENTRY)]
+// CHECK-NEXT: Succs (1): B5
+// CHECK: [B1]
+// CHECK-NEXT: 1: 0
+// CHECK-NEXT: 2: return [B1.1];
+// CHECK-NEXT: Preds (1): B5
+// CHECK-NEXT: Succs (1): B0
+// CHECK: [B2]
+// CHECK-NEXT: 1: 0
+// CHECK-NEXT: 2: ({ ... ; [B2.1] })
+// CHECK-NEXT: 3: return [B2.2];
+// CHECK-NEXT: Preds (1): B4
+// CHECK-NEXT: Succs (1): B0
+// FIXME: Why do we have [B3] at all?
+// CHECK: [B3]
+// CHECK-NEXT: Succs (1): B4
+// CHECK: [B4]
+// CHECK-NEXT: 1: 0
+// CHECK-NEXT: 2: [B4.1] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-NEXT: T: while [B4.2]
+// CHECK-NEXT: Preds (2): B3 B5
+// CHECK-NEXT: Succs (2): NULL B2
+// CHECK: [B5]
+// CHECK-NEXT: 1: unknown
+// CHECK-NEXT: 2: [B5.1] (ImplicitCastExpr, FunctionToPointerDecay, int (*)(void))
+// CHECK-NEXT: 3: [B5.2]()
+// CHECK-NEXT: 4: [B5.3] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-NEXT: T: if [B5.4]
+// CHECK-NEXT: Preds (1): B6
+// CHECK-NEXT: Succs (2): B4 B1
+// CHECK: [B0 (EXIT)]
+// CHECK-NEXT: Preds (2): B1 B2
+int foo() {
+ if (unknown())
+ return ({
+ while (0)
+ ;
+ 0;
+ });
+ else
+ return 0;
+}
+} // namespace statement_expression_in_return
+
+// CHECK-LABEL: int overlap_compare(int x)
+// CHECK: [B2]
+// CHECK-NEXT: 1: 1
+// CHECK-NEXT: 2: return [B2.1];
+// CHECK-NEXT: Preds (1): B3(Unreachable)
+// CHECK-NEXT: Succs (1): B0
+// CHECK: [B3]
+// CHECK-NEXT: 1: x
+// CHECK-NEXT: 2: [B3.1] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT: 3: 5
+// CHECK-NEXT: 4: [B3.2] > [B3.3]
+// CHECK-NEXT: T: if [B4.5] && [B3.4]
+// CHECK-NEXT: Preds (1): B4
+// CHECK-NEXT: Succs (2): B2(Unreachable) B1
+int overlap_compare(int x) {
+ if (x == -1 && x > 5)
+ return 1;
+
+ return 2;
+}
+
// CHECK-LABEL: template<> int *PR18472<int>()
// CHECK: [B2 (ENTRY)]
// CHECK-NEXT: Succs (1): B1
@@ -522,4 +591,3 @@
void PR18472_helper() {
PR18472<int>();
}
-
diff --git a/src/llvm-project/clang/test/Analysis/checker-plugins.c b/src/llvm-project/clang/test/Analysis/checker-plugins.c
index b5444fa..fbc9c9b 100644
--- a/src/llvm-project/clang/test/Analysis/checker-plugins.c
+++ b/src/llvm-project/clang/test/Analysis/checker-plugins.c
@@ -1,5 +1,9 @@
// REQUIRES: plugins
+// FIXME: This test fails on clang-stage2-cmake-RgSan,
+// see also https://reviews.llvm.org/D62445#1613268
+// UNSUPPORTED: darwin
+
// RUN: %clang_analyze_cc1 -verify %s \
// RUN: -load %llvmshlibdir/SampleAnalyzerPlugin%pluginext \
// RUN: -analyzer-checker='example.MainCallChecker'
diff --git a/src/llvm-project/clang/test/Analysis/const-method-call.cpp b/src/llvm-project/clang/test/Analysis/const-method-call.cpp
index 902bdee..8e1fd3b 100644
--- a/src/llvm-project/clang/test/Analysis/const-method-call.cpp
+++ b/src/llvm-project/clang/test/Analysis/const-method-call.cpp
@@ -235,7 +235,7 @@
void constMemberFunction() const;
};
-HasConstMemberFunction hasNoReturn() { } // expected-warning {{control reaches end of non-void function}}
+HasConstMemberFunction hasNoReturn() { } // expected-warning {{non-void function does not return a value}}
void testUnknownWithConstMemberFunction() {
hasNoReturn().constMemberFunction();
diff --git a/src/llvm-project/clang/test/Analysis/crash-trace.c b/src/llvm-project/clang/test/Analysis/crash-trace.c
index ef1763e..0c8c8cc 100644
--- a/src/llvm-project/clang/test/Analysis/crash-trace.c
+++ b/src/llvm-project/clang/test/Analysis/crash-trace.c
@@ -1,9 +1,8 @@
// RUN: not --crash %clang_analyze_cc1 -analyzer-checker=debug.ExprInspection %s 2>&1 | FileCheck %s
// REQUIRES: crash-recovery
-// FIXME: CHECKs might be incompatible to win32.
-// Stack traces also require back traces.
-// REQUIRES: shell, backtrace
+// Stack traces require back traces.
+// REQUIRES: backtrace
void clang_analyzer_crash(void);
@@ -18,6 +17,6 @@
// CHECK: 0. Program arguments: {{.*}}clang
// CHECK-NEXT: 1. <eof> parser at end of file
// CHECK-NEXT: 2. While analyzing stack:
-// CHECK-NEXT: #0 Calling inlined at line 15
+// CHECK-NEXT: #0 Calling inlined at line 14
// CHECK-NEXT: #1 Calling test
// CHECK-NEXT: 3. {{.*}}crash-trace.c:{{[0-9]+}}:3: Error evaluating statement
diff --git a/src/llvm-project/clang/test/Analysis/cstring-ranges.c b/src/llvm-project/clang/test/Analysis/cstring-ranges.c
index 4fcd7ea..dc6bb67 100644
--- a/src/llvm-project/clang/test/Analysis/cstring-ranges.c
+++ b/src/llvm-project/clang/test/Analysis/cstring-ranges.c
@@ -2,6 +2,8 @@
// This test verifies argument source range highlighting.
// Otherwise we've no idea which of the arguments is null.
+// These days we actually also have it in the message,
+// but the range is still great to have.
char *strcpy(char *, const char *);
@@ -10,6 +12,6 @@
strcpy(a, b);
}
-// CHECK: warning: Null pointer argument in call to string copy function
+// CHECK: warning: Null pointer passed as 1st argument to string copy function
// CHECK-NEXT: strcpy(a, b);
// CHECK-NEXT: ^ ~
diff --git a/src/llvm-project/clang/test/Analysis/cstring-syntax-weird.c b/src/llvm-project/clang/test/Analysis/cstring-syntax-weird.c
new file mode 100644
index 0000000..9a58f16
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/cstring-syntax-weird.c
@@ -0,0 +1,19 @@
+// RUN: %clang_analyze_cc1 -w -analyzer-checker=unix.cstring.BadSizeArg \
+// RUN: -verify %s
+
+// expected-no-diagnostics
+
+typedef __SIZE_TYPE__ size_t;
+// The last parameter is normally size_t but the test is about the abnormal
+// situation when it's not a size_t.
+size_t strlcpy(char *, const char *, int);
+
+enum WeirdDecl {
+ AStrangeWayToSpecifyStringLengthCorrectly = 10UL,
+ AStrangeWayToSpecifyStringLengthIncorrectly = 5UL
+};
+void testWeirdDecls(const char *src) {
+ char dst[10];
+ strlcpy(dst, src, AStrangeWayToSpecifyStringLengthCorrectly); // no-crash
+ strlcpy(dst, src, AStrangeWayToSpecifyStringLengthIncorrectly); // no-crash // no-warning
+}
diff --git a/src/llvm-project/clang/test/Analysis/cstring-syntax-weird2.c b/src/llvm-project/clang/test/Analysis/cstring-syntax-weird2.c
new file mode 100644
index 0000000..a0f2853
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/cstring-syntax-weird2.c
@@ -0,0 +1,17 @@
+// RUN: %clang_analyze_cc1 -w -analyzer-checker=unix.cstring.BadSizeArg \
+// RUN: -verify %s
+
+// expected-no-diagnostics
+
+typedef __SIZE_TYPE__ size_t;
+// The last parameter is normally size_t but the test is about the abnormal
+// situation when it's not a size_t.
+size_t strlcpy(char *, const char *, void (*)());
+
+void foo();
+
+void testWeirdDecls(const char *src) {
+ char dst[10];
+ strlcpy(dst, src, foo); // no-crash
+ strlcpy(dst, src, &foo); // no-crash
+}
diff --git a/src/llvm-project/clang/test/Analysis/cstring-syntax.c b/src/llvm-project/clang/test/Analysis/cstring-syntax.c
index f01de36..8ac971f 100644
--- a/src/llvm-project/clang/test/Analysis/cstring-syntax.c
+++ b/src/llvm-project/clang/test/Analysis/cstring-syntax.c
@@ -1,7 +1,18 @@
-// RUN: %clang_analyze_cc1 -analyzer-checker=unix.cstring.BadSizeArg -analyzer-store=region -Wno-strncat-size -Wno-strlcpy-strlcat-size -Wno-sizeof-array-argument -Wno-sizeof-pointer-memaccess -verify %s
-// RUN: %clang_analyze_cc1 -triple armv7-a15-linux -analyzer-checker=unix.cstring.BadSizeArg -analyzer-store=region -Wno-strncat-size -Wno-strlcpy-strlcat-size -Wno-sizeof-array-argument -Wno-sizeof-pointer-memaccess -verify %s
-// RUN: %clang_analyze_cc1 -triple aarch64_be-none-linux-gnu -analyzer-checker=unix.cstring.BadSizeArg -analyzer-store=region -Wno-strncat-size -Wno-strlcpy-strlcat-size -Wno-sizeof-array-argument -Wno-sizeof-pointer-memaccess -verify %s
-// RUN: %clang_analyze_cc1 -triple i386-apple-darwin10 -analyzer-checker=unix.cstring.BadSizeArg -analyzer-store=region -Wno-strncat-size -Wno-strlcpy-strlcat-size -Wno-sizeof-array-argument -Wno-sizeof-pointer-memaccess -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=unix.cstring.BadSizeArg -verify %s\
+// RUN: -Wno-strncat-size -Wno-sizeof-pointer-memaccess \
+// RUN: -Wno-strlcpy-strlcat-size -Wno-sizeof-array-argument
+// RUN: %clang_analyze_cc1 -analyzer-checker=unix.cstring.BadSizeArg -verify %s\
+// RUN: -Wno-strncat-size -Wno-sizeof-pointer-memaccess \
+// RUN: -Wno-strlcpy-strlcat-size -Wno-sizeof-array-argument\
+// RUN: -triple armv7-a15-linux
+// RUN: %clang_analyze_cc1 -analyzer-checker=unix.cstring.BadSizeArg -verify %s\
+// RUN: -Wno-strncat-size -Wno-sizeof-pointer-memaccess \
+// RUN: -Wno-strlcpy-strlcat-size -Wno-sizeof-array-argument\
+// RUN: -triple aarch64_be-none-linux-gnu
+// RUN: %clang_analyze_cc1 -analyzer-checker=unix.cstring.BadSizeArg -verify %s\
+// RUN: -Wno-strncat-size -Wno-sizeof-pointer-memaccess \
+// RUN: -Wno-strlcpy-strlcat-size -Wno-sizeof-array-argument\
+// RUN: -triple i386-apple-darwin10
typedef __SIZE_TYPE__ size_t;
char *strncat(char *, const char *, size_t);
diff --git a/src/llvm-project/clang/test/Analysis/ctu-different-triples.cpp b/src/llvm-project/clang/test/Analysis/ctu-different-triples.cpp
index dbfa82f..20acc31 100644
--- a/src/llvm-project/clang/test/Analysis/ctu-different-triples.cpp
+++ b/src/llvm-project/clang/test/Analysis/ctu-different-triples.cpp
@@ -1,9 +1,9 @@
// RUN: rm -rf %t && mkdir %t
// RUN: mkdir -p %t/ctudir
-// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu \
+// RUN: %clang_cc1 -std=c++14 -triple x86_64-pc-linux-gnu \
// RUN: -emit-pch -o %t/ctudir/ctu-other.cpp.ast %S/Inputs/ctu-other.cpp
// RUN: cp %S/Inputs/ctu-other.cpp.externalDefMap.txt %t/ctudir/externalDefMap.txt
-// RUN: %clang_analyze_cc1 -triple powerpc64-montavista-linux-gnu \
+// RUN: %clang_analyze_cc1 -std=c++14 -triple powerpc64-montavista-linux-gnu \
// RUN: -analyzer-checker=core,debug.ExprInspection \
// RUN: -analyzer-config experimental-enable-naive-ctu-analysis=true \
// RUN: -analyzer-config ctu-dir=%t/ctudir \
diff --git a/src/llvm-project/clang/test/Analysis/ctu-main.cpp b/src/llvm-project/clang/test/Analysis/ctu-main.cpp
index 1cb0d4a..3f095a0 100644
--- a/src/llvm-project/clang/test/Analysis/ctu-main.cpp
+++ b/src/llvm-project/clang/test/Analysis/ctu-main.cpp
@@ -1,16 +1,16 @@
// RUN: rm -rf %t && mkdir %t
// RUN: mkdir -p %t/ctudir
-// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu \
+// RUN: %clang_cc1 -std=c++14 -triple x86_64-pc-linux-gnu \
// RUN: -emit-pch -o %t/ctudir/ctu-other.cpp.ast %S/Inputs/ctu-other.cpp
-// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu \
+// RUN: %clang_cc1 -std=c++14 -triple x86_64-pc-linux-gnu \
// RUN: -emit-pch -o %t/ctudir/ctu-chain.cpp.ast %S/Inputs/ctu-chain.cpp
// RUN: cp %S/Inputs/ctu-other.cpp.externalDefMap.txt %t/ctudir/externalDefMap.txt
-// RUN: %clang_analyze_cc1 -triple x86_64-pc-linux-gnu \
+// RUN: %clang_analyze_cc1 -std=c++14 -triple x86_64-pc-linux-gnu \
// RUN: -analyzer-checker=core,debug.ExprInspection \
// RUN: -analyzer-config experimental-enable-naive-ctu-analysis=true \
// RUN: -analyzer-config ctu-dir=%t/ctudir \
// RUN: -verify %s
-// RUN: %clang_analyze_cc1 -triple x86_64-pc-linux-gnu \
+// RUN: %clang_analyze_cc1 -std=c++14 -triple x86_64-pc-linux-gnu \
// RUN: -analyzer-checker=core,debug.ExprInspection \
// RUN: -analyzer-config experimental-enable-naive-ctu-analysis=true \
// RUN: -analyzer-config ctu-dir=%t/ctudir \
@@ -112,6 +112,23 @@
clang_analyzer_eval(obj->fvcl(1) == 8); // expected-warning{{FALSE}} expected-warning{{TRUE}}
}
+class TestAnonUnionUSR {
+public:
+ inline float f(int value) {
+ union {
+ float f;
+ int i;
+ };
+ i = value;
+ return f;
+ }
+ static const int Test;
+};
+
+extern int testImportOfIncompleteDefaultParmDuringImport(int);
+
+extern int testImportOfDelegateConstructor(int);
+
int main() {
clang_analyzer_eval(f(3) == 2); // expected-warning{{TRUE}}
clang_analyzer_eval(f(4) == 3); // expected-warning{{TRUE}}
@@ -144,4 +161,10 @@
clang_analyzer_eval(extSubSCN.a == 1); // expected-warning{{TRUE}}
// clang_analyzer_eval(extSCC.a == 7); // TODO
clang_analyzer_eval(extU.a == 4); // expected-warning{{TRUE}}
+
+ clang_analyzer_eval(TestAnonUnionUSR::Test == 5); // expected-warning{{TRUE}}
+
+ clang_analyzer_eval(testImportOfIncompleteDefaultParmDuringImport(9) == 9); // expected-warning{{TRUE}}
+
+ clang_analyzer_eval(testImportOfDelegateConstructor(10) == 10); // expected-warning{{TRUE}}
}
diff --git a/src/llvm-project/clang/test/Analysis/ctu-unknown-parts-in-triples.cpp b/src/llvm-project/clang/test/Analysis/ctu-unknown-parts-in-triples.cpp
index 5e643c1..6bcbd709 100644
--- a/src/llvm-project/clang/test/Analysis/ctu-unknown-parts-in-triples.cpp
+++ b/src/llvm-project/clang/test/Analysis/ctu-unknown-parts-in-triples.cpp
@@ -3,10 +3,10 @@
// RUN: rm -rf %t && mkdir %t
// RUN: mkdir -p %t/ctudir
-// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu \
+// RUN: %clang_cc1 -std=c++14 -triple x86_64-pc-linux-gnu \
// RUN: -emit-pch -o %t/ctudir/ctu-other.cpp.ast %S/Inputs/ctu-other.cpp
// RUN: cp %S/Inputs/ctu-other.cpp.externalDefMap.txt %t/ctudir/externalDefMap.txt
-// RUN: %clang_analyze_cc1 -triple x86_64-unknown-linux-gnu \
+// RUN: %clang_analyze_cc1 -std=c++14 -triple x86_64-unknown-linux-gnu \
// RUN: -analyzer-checker=core,debug.ExprInspection \
// RUN: -analyzer-config experimental-enable-naive-ctu-analysis=true \
// RUN: -analyzer-config ctu-dir=%t/ctudir \
diff --git a/src/llvm-project/clang/test/Analysis/cxx-callgraph.cpp b/src/llvm-project/clang/test/Analysis/cxx-callgraph.cpp
new file mode 100644
index 0000000..4a48e42
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/cxx-callgraph.cpp
@@ -0,0 +1,29 @@
+// RUN: %clang_analyze_cc1 -analyzer-checker=debug.DumpCallGraph %s 2>&1 | FileCheck %s
+
+static int aaa() {
+ return 0;
+}
+
+static int bbb(int param=aaa()) {
+ return 1;
+}
+
+int ddd();
+
+struct c {
+ c(int param=2) : val(bbb(param)) {}
+ int val;
+ int val2 = ddd();
+};
+
+int ddd() {
+ c c;
+ return bbb();
+}
+
+// CHECK:--- Call graph Dump ---
+// CHECK-NEXT: {{Function: < root > calls: aaa bbb c::c ddd}}
+// CHECK-NEXT: {{Function: c::c calls: bbb ddd $}}
+// CHECK-NEXT: {{Function: ddd calls: c::c bbb aaa $}}
+// CHECK-NEXT: {{Function: bbb calls: $}}
+// CHECK-NEXT: {{Function: aaa calls: $}}
diff --git a/src/llvm-project/clang/test/Analysis/dead-stores.c b/src/llvm-project/clang/test/Analysis/dead-stores.c
index 84217a2..cbfdabd 100644
--- a/src/llvm-project/clang/test/Analysis/dead-stores.c
+++ b/src/llvm-project/clang/test/Analysis/dead-stores.c
@@ -1,102 +1,112 @@
-// RUN: %clang_analyze_cc1 -Wunused-variable -analyzer-checker=core,deadcode.DeadStores -fblocks -verify -Wno-unreachable-code -analyzer-opt-analyze-nested-blocks %s
-// RUN: %clang_analyze_cc1 -Wunused-variable -analyzer-checker=core,deadcode.DeadStores -analyzer-store=region -fblocks -verify -Wno-unreachable-code -analyzer-opt-analyze-nested-blocks %s
+// RUN: %clang_analyze_cc1 -Wunused-variable -fblocks -Wno-unreachable-code \
+// RUN: -analyzer-checker=core,deadcode.DeadStores \
+// RUN: -analyzer-config deadcode.DeadStores:ShowFixIts=true \
+// RUN: -analyzer-config fixits-as-remarks=true \
+// RUN: -analyzer-config \
+// RUN: deadcode.DeadStores:WarnForDeadNestedAssignments=false \
+// RUN: -verify=non-nested %s
+
+// RUN: %clang_analyze_cc1 -Wunused-variable -fblocks -Wno-unreachable-code \
+// RUN: -analyzer-checker=core,deadcode.DeadStores \
+// RUN: -analyzer-config deadcode.DeadStores:ShowFixIts=true \
+// RUN: -analyzer-config fixits-as-remarks=true \
+// RUN: -verify=non-nested,nested %s
void f1() {
- int k, y; // expected-warning{{unused variable 'k'}} expected-warning{{unused variable 'y'}}
- int abc=1;
- long idx=abc+3*5; // expected-warning {{never read}} expected-warning{{unused variable 'idx'}}
+ int k, y; // non-nested-warning {{unused variable 'k'}}
+ // non-nested-warning@-1 {{unused variable 'y'}}
+ int abc = 1;
+ long idx = abc + 3 * 5; // non-nested-warning {{never read}}
+ // non-nested-warning@-1 {{unused variable 'idx'}}
+ // non-nested-remark@-2 {{11-24: ''}}
}
void f2(void *b) {
- char *c = (char*)b; // no-warning
- char *d = b+1; // expected-warning {{never read}} expected-warning{{unused variable 'd'}}
- printf("%s", c); // expected-warning{{implicitly declaring library function 'printf' with type 'int (const char *, ...)'}} \
- // expected-note{{include the header <stdio.h> or explicitly provide a declaration for 'printf'}}
+ char *c = (char *)b; // no-warning
+ char *d = b + 1; // non-nested-warning {{never read}}
+ // non-nested-warning@-1 {{unused variable 'd'}}
+ // non-nested-remark@-2 {{10-17: ''}}
+ printf("%s", c);
+ // non-nested-warning@-1 {{implicitly declaring library function 'printf' with type 'int (const char *, ...)'}}
+ // non-nested-note@-2 {{include the header <stdio.h> or explicitly provide a declaration for 'printf'}}
}
int f();
-
void f3() {
int r;
if ((r = f()) != 0) { // no-warning
- int y = r; // no-warning
+ int y = r; // no-warning
printf("the error is: %d\n", y);
}
}
void f4(int k) {
-
k = 1;
-
if (k)
f1();
-
- k = 2; // expected-warning {{never read}}
+ k = 2; // non-nested-warning {{never read}}
}
-
+
void f5() {
-
- int x = 4; // no-warning
- int *p = &x; // expected-warning{{never read}} expected-warning{{unused variable 'p'}}
-
+ int x = 4; // no-warning
+ int *p = &x; // non-nested-warning {{never read}}
+ // non-nested-warning@-1 {{unused variable 'p'}}
+ // non-nested-remark@-2 {{9-13: ''}}
}
-//
int f6() {
-
int x = 4;
++x; // no-warning
return 1;
}
-int f7(int *p) {
+int f7(int *p) {
// This is allowed for defensive programming.
- p = 0; // no-warning
+ p = 0; // no-warning
return 1;
}
-int f7b(int *p) {
+int f7b(int *p) {
// This is allowed for defensive programming.
- p = (0); // no-warning
+ p = (0); // no-warning
return 1;
}
-int f7c(int *p) {
+int f7c(int *p) {
// This is allowed for defensive programming.
- p = (void*) 0; // no-warning
+ p = (void *)0; // no-warning
return 1;
}
-int f7d(int *p) {
+int f7d(int *p) {
// This is allowed for defensive programming.
- p = (void*) (0); // no-warning
+ p = (void *)(0); // no-warning
return 1;
}
-// Don't warn for dead stores in nested expressions. We have yet
-// to see a real bug in this scenario.
+// Warn for dead stores in nested expressions.
int f8(int *p) {
extern int *baz();
- if ((p = baz())) // no-warning
+ if ((p = baz())) // nested-warning {{Although the value stored}}
return 1;
return 0;
}
int f9() {
int x = 4;
- x = x + 10; // expected-warning{{never read}}
+ x = x + 10; // non-nested-warning {{never read}}
return 1;
}
int f10() {
int x = 4;
- x = 10 + x; // expected-warning{{never read}}
+ x = 10 + x; // non-nested-warning {{never read}}
return 1;
}
int f11() {
int x = 4;
- return x++; // expected-warning{{never read}}
+ return x++; // non-nested-warning {{never read}}
}
int f11b() {
@@ -105,38 +115,38 @@
}
int f12a(int y) {
- int x = y; // expected-warning{{unused variable 'x'}}
+ int x = y; // non-nested-warning {{unused variable 'x'}}
return 1;
}
+
int f12b(int y) {
- int x __attribute__((unused)) = y; // no-warning
+ int x __attribute__((unused)) = y; // no-warning
return 1;
}
+
int f12c(int y) {
// Allow initialiation of scalar variables by parameters as a form of
// defensive programming.
- int x = y; // no-warning
+ int x = y; // no-warning
x = 1;
return x;
}
// Filed with PR 2630. This code should produce no warnings.
-int f13(void)
-{
+int f13(void) {
int a = 1;
int b, c = b = a + a;
if (b > 0)
return (0);
-
return (a + b + c);
}
// Filed with PR 2763.
int f14(int count) {
int index, nextLineIndex;
- for (index = 0; index < count; index = nextLineIndex+1) {
- nextLineIndex = index+1; // no-warning
+ for (index = 0; index < count; index = nextLineIndex + 1) {
+ nextLineIndex = index + 1; // no-warning
continue;
}
return index;
@@ -144,16 +154,15 @@
// Test case for <rdar://problem/6248086>
void f15(unsigned x, unsigned y) {
- int count = x * y; // no-warning
- int z[count]; // expected-warning{{unused variable 'z'}}
+ int count = x * y; // no-warning
+ int z[count]; // non-nested-warning {{unused variable 'z'}}
}
-// Don't warn for dead stores in nested expressions. We have yet
-// to see a real bug in this scenario.
+// Warn for dead stores in nested expressions.
int f16(int x) {
x = x * 2;
- x = sizeof(int [x = (x || x + 1) * 2])
- ? 5 : 8;
+ x = sizeof(int[x = (x || x + 1) * 2]) ? 5 : 8;
+ // nested-warning@-1 {{Although the value stored}}
return x;
}
@@ -168,39 +177,39 @@
// what that value is actually used. In other words, don't say "Although the
// value stored to 'x' is used...".
int f18() {
- int x = 0; // no-warning
- if (1)
- x = 10; // expected-warning{{Value stored to 'x' is never read}}
- while (1)
- x = 10; // expected-warning{{Value stored to 'x' is never read}}
- // unreachable.
- do
- x = 10; // no-warning
- while (1);
- return (x = 10); // no-warning
+ int x = 0; // no-warning
+ if (1)
+ x = 10; // non-nested-warning {{Value stored to 'x' is never read}}
+ while (1)
+ x = 10; // non-nested-warning {{Value stored to 'x' is never read}}
+ // unreachable.
+ do
+ x = 10; // no-warning
+ while (1);
+ return (x = 10); // no-warning
}
int f18_a() {
- int x = 0; // no-warning
- return (x = 10); // no-warning
+ int x = 0; // no-warning
+ return (x = 10); // nested-warning {{Although the value stored}}
}
void f18_b() {
- int x = 0; // no-warning
- if (1)
- x = 10; // expected-warning{{Value stored to 'x' is never read}}
+ int x = 0; // no-warning
+ if (1)
+ x = 10; // non-nested-warning {{Value stored to 'x' is never read}}
}
void f18_c() {
int x = 0;
while (1)
- x = 10; // expected-warning{{Value stored to 'x' is never read}}
+ x = 10; // non-nested-warning {{Value stored to 'x' is never read}}
}
void f18_d() {
int x = 0; // no-warning
do
- x = 10; // expected-warning{{Value stored to 'x' is never read}}
+ x = 10; // non-nested-warning {{Value stored to 'x' is never read}}
while (1);
}
@@ -208,7 +217,7 @@
// http://llvm.org/bugs/show_bug.cgi?id=3514
extern const int MyConstant;
int f19(void) {
- int x = MyConstant; // no-warning
+ int x = MyConstant; // no-warning
x = 1;
return x;
}
@@ -217,7 +226,7 @@
const int MyConstant = 0;
int x = MyConstant; // no-warning
x = 1;
- return x;
+ return x;
}
void f20(void) {
@@ -228,8 +237,7 @@
void halt() __attribute__((noreturn));
int f21() {
int x = 4;
-
- x = x + 1; // expected-warning{{never read}}
+ x = x + 1; // non-nested-warning {{never read}}
if (1) {
halt();
(void)x;
@@ -261,7 +269,7 @@
int y19 = 4;
int y20 = 4;
- x = x + 1; // expected-warning{{never read}}
+ x = x + 1; // non-nested-warning {{never read}}
++y1;
++y2;
++y3;
@@ -309,13 +317,13 @@
} else
(void)x;
(void)x;
- break;
+ break;
case 4:
- 0 ? : ((void)y4, ({ return; }));
+ 0 ?: ((void)y4, ({ return; }));
(void)x;
break;
case 5:
- 1 ? : (void)x;
+ 1 ?: (void)x;
0 ? (void)x : ((void)y5, ({ return; }));
(void)x;
break;
@@ -326,11 +334,13 @@
case 7:
(void)(0 && x);
(void)y7;
- (void)(0 || (y8, ({ return; }), 1)); // expected-warning {{expression result unused}}
+ (void)(0 || (y8, ({ return; }), 1));
+ // non-nested-warning@-1 {{expression result unused}}
(void)x;
break;
case 8:
- (void)(1 && (y9, ({ return; }), 1)); // expected-warning {{expression result unused}}
+ (void)(1 && (y9, ({ return; }), 1));
+ // non-nested-warning@-1 {{expression result unused}}
(void)x;
break;
case 9:
@@ -365,16 +375,16 @@
for (;;) {
(void)y16;
}
- (void)x;
+ (void)x;
break;
case 15:
- for (;1;) {
+ for (; 1;) {
(void)y17;
}
(void)x;
break;
case 16:
- for (;0;) {
+ for (; 0;) {
(void)x;
}
(void)y18;
@@ -390,28 +400,36 @@
}
}
-void f23_aux(const char* s);
+void f23_aux(const char *s);
void f23(int argc, char **argv) {
int shouldLog = (argc > 1); // no-warning
- ^{
- if (shouldLog) f23_aux("I did too use it!\n");
- else f23_aux("I shouldn't log. Wait.. d'oh!\n");
+ ^{
+ if (shouldLog)
+ f23_aux("I did too use it!\n");
+ else
+ f23_aux("I shouldn't log. Wait.. d'oh!\n");
}();
}
void f23_pos(int argc, char **argv) {
- int shouldLog = (argc > 1); // expected-warning{{Value stored to 'shouldLog' during its initialization is never read}} expected-warning{{unused variable 'shouldLog'}}
- ^{
- f23_aux("I did too use it!\n");
- }();
+ int shouldLog = (argc > 1);
+ // non-nested-warning@-1 {{Value stored to 'shouldLog' during its initialization is never read}}
+ // non-nested-warning@-2 {{unused variable 'shouldLog'}}
+ // non-nested-remark@-3 {{16-28: ''}}
+ ^{
+ f23_aux("I did too use it!\n");
+ }();
}
void f24_A(int y) {
// FIXME: One day this should be reported as dead since 'z = x + y' is dead.
int x = (y > 2); // no-warning
- ^ {
- int z = x + y; // expected-warning{{Value stored to 'z' during its initialization is never read}} expected-warning{{unused variable 'z'}}
- }();
+ ^{
+ int z = x + y;
+ // non-nested-warning@-1 {{Value stored to 'z' during its initialization is never read}}
+ // non-nested-warning@-2 {{unused variable 'z'}}
+ // non-nested-remark@-3 {{10-17: ''}}
+ }();
}
void f24_B(int y) {
@@ -426,7 +444,7 @@
int f24_C(int y) {
// FIXME: One day this should be reported as dead since 'x' is just overwritten.
__block int x = (y > 2); // no-warning
- ^{
+ ^{
x = 5; // no-warning
}();
return x;
@@ -434,32 +452,35 @@
int f24_D(int y) {
__block int x = (y > 2); // no-warning
- ^{
+ ^{
if (y > 4)
x = 5; // no-warning
}();
return x;
}
-// This example shows that writing to a variable captured by a block means that it might
-// not be dead.
+// This example shows that writing to a variable captured by a block means that
+// it might not be dead.
int f25(int y) {
__block int x = (y > 2);
__block int z = 0;
- void (^foo)() = ^{ z = x + y; };
+ void (^foo)() = ^{
+ z = x + y;
+ };
x = 4; // no-warning
foo();
- return z;
+ return z;
}
-// This test is mostly the same as 'f25', but shows that the heuristic of pruning out dead
-// stores for variables that are just marked '__block' is overly conservative.
+// This test is mostly the same as 'f25', but shows that the heuristic of
+// pruning out dead stores for variables that are just marked '__block' is
+// overly conservative.
int f25_b(int y) {
// FIXME: we should eventually report a dead store here.
__block int x = (y > 2);
__block int z = 0;
x = 4; // no-warning
- return z;
+ return z;
}
int f26_nestedblocks() {
@@ -468,10 +489,10 @@
__block int y = 0;
^{
int k;
- k = 1; // expected-warning{{Value stored to 'k' is never read}}
+ k = 1; // non-nested-warning {{Value stored to 'k' is never read}}
^{
- y = z + 1;
- }();
+ y = z + 1;
+ }();
}();
return y;
}
@@ -480,11 +501,13 @@
// placed within the increment code of for loops.
void rdar8014335() {
for (int i = 0 ; i != 10 ; ({ break; })) {
- for ( ; ; ({ ++i; break; })) ; // expected-warning {{'break' is bound to current loop, GCC binds it to the enclosing loop}}
+ for (;; ({ ++i; break; }))
+ ;
+ // non-nested-warning@-2 {{'break' is bound to current loop, GCC binds it to the enclosing loop}}
// Note that the next value stored to 'i' is never executed
// because the next statement to be executed is the 'break'
// in the increment code of the first loop.
- i = i * 3; // expected-warning{{Value stored to 'i' is never read}}
+ i = i * 3; // non-nested-warning {{Value stored to 'i' is never read}}
}
}
@@ -517,10 +540,8 @@
void rdar8405222() {
const int show = 0;
int i = 0;
-
if (show)
- i = 5; // no-warning
-
+ i = 5; // no-warning
if (show)
rdar8405222_aux(i);
}
@@ -529,13 +550,13 @@
// silencing heuristics.
int radar11185138_foo() {
int x, y;
- x = y = 0; // expected-warning {{never read}}
+ x = y = 0; // non-nested-warning {{never read}}
return y;
}
int rdar11185138_bar() {
int y;
- int x = y = 0; // no-warning
+ int x = y = 0; // nested-warning {{Although the value stored}}
x = 2;
y = 2;
return x + y;
@@ -550,26 +571,58 @@
int getInt();
int *getPtr();
void testBOComma() {
- int x0 = (getInt(), 0); // expected-warning{{unused variable 'x0'}}
- int x1 = (getInt(), getInt()); // expected-warning {{Value stored to 'x1' during its initialization is never read}} // expected-warning{{unused variable 'x1'}}
- int x2 = (getInt(), getInt(), getInt()); //expected-warning{{Value stored to 'x2' during its initialization is never read}} // expected-warning{{unused variable 'x2'}}
+ int x0 = (getInt(), 0); // non-nested-warning {{unused variable 'x0'}}
+ int x1 = (getInt(), getInt());
+ // non-nested-warning@-1 {{Value stored to 'x1' during its initialization is never read}}
+ // non-nested-warning@-2 {{unused variable 'x1'}}
+
+ int x2 = (getInt(), getInt(), getInt());
+ // non-nested-warning@-1 {{Value stored to 'x2' during its initialization is never read}}
+ // non-nested-warning@-2 {{unused variable 'x2'}}
+
int x3;
- x3 = (getInt(), getInt(), 0); // expected-warning{{Value stored to 'x3' is never read}}
- int x4 = (getInt(), (getInt(), 0)); // expected-warning{{unused variable 'x4'}}
+ x3 = (getInt(), getInt(), 0);
+ // non-nested-warning@-1 {{Value stored to 'x3' is never read}}
+
+ int x4 = (getInt(), (getInt(), 0));
+ // non-nested-warning@-1 {{unused variable 'x4'}}
+
int y;
- int x5 = (getInt(), (y = 0)); // expected-warning{{unused variable 'x5'}}
- int x6 = (getInt(), (y = getInt())); //expected-warning {{Value stored to 'x6' during its initialization is never read}} // expected-warning{{unused variable 'x6'}}
- int x7 = 0, x8 = getInt(); //expected-warning {{Value stored to 'x8' during its initialization is never read}} // expected-warning{{unused variable 'x8'}} // expected-warning{{unused variable 'x7'}}
- int x9 = getInt(), x10 = 0; //expected-warning {{Value stored to 'x9' during its initialization is never read}} // expected-warning{{unused variable 'x9'}} // expected-warning{{unused variable 'x10'}}
- int m = getInt(), mm, mmm; //expected-warning {{Value stored to 'm' during its initialization is never read}} // expected-warning{{unused variable 'm'}} // expected-warning{{unused variable 'mm'}} // expected-warning{{unused variable 'mmm'}}
- int n, nn = getInt(); //expected-warning {{Value stored to 'nn' during its initialization is never read}} // expected-warning{{unused variable 'n'}} // expected-warning{{unused variable 'nn'}}
+ int x5 = (getInt(), (y = 0));
+ // non-nested-warning@-1 {{unused variable 'x5'}}
+ // nested-warning@-2 {{Although the value stored}}
+
+ int x6 = (getInt(), (y = getInt()));
+ // non-nested-warning@-1 {{Value stored to 'x6' during its initialization is never read}}
+ // non-nested-warning@-2 {{unused variable 'x6'}}
+ // nested-warning@-3 {{Although the value stored}}
+
+ int x7 = 0, x8 = getInt();
+ // non-nested-warning@-1 {{Value stored to 'x8' during its initialization is never read}}
+ // non-nested-warning@-2 {{unused variable 'x8'}}
+ // non-nested-warning@-3 {{unused variable 'x7'}}
+
+ int x9 = getInt(), x10 = 0;
+ // non-nested-warning@-1 {{Value stored to 'x9' during its initialization is never read}}
+ // non-nested-warning@-2 {{unused variable 'x9'}}
+ // non-nested-warning@-3 {{unused variable 'x10'}}
+
+ int m = getInt(), mm, mmm;
+ // non-nested-warning@-1 {{Value stored to 'm' during its initialization is never read}}
+ // non-nested-warning@-2 {{unused variable 'm'}}
+ // non-nested-warning@-3 {{unused variable 'mm'}}
+ // non-nested-warning@-4 {{unused variable 'mmm'}}
+
+ int n, nn = getInt();
+ // non-nested-warning@-1 {{Value stored to 'nn' during its initialization is never read}}
+ // non-nested-warning@-2 {{unused variable 'n'}}
+ // non-nested-warning@-3 {{unused variable 'nn'}}
int *p;
p = (getPtr(), (int *)0); // no warning
-
}
void testVolatile() {
- volatile int v;
- v = 0; // no warning
+ volatile int v;
+ v = 0; // no warning
}
diff --git a/src/llvm-project/clang/test/Analysis/dead-stores.cpp b/src/llvm-project/clang/test/Analysis/dead-stores.cpp
index d926ccf..94865b3 100644
--- a/src/llvm-project/clang/test/Analysis/dead-stores.cpp
+++ b/src/llvm-project/clang/test/Analysis/dead-stores.cpp
@@ -1,15 +1,26 @@
-// RUN: %clang_analyze_cc1 -fcxx-exceptions -fexceptions -fblocks -std=c++11 -analyzer-checker=deadcode.DeadStores -verify -Wno-unreachable-code %s
-// RUN: %clang_analyze_cc1 -fcxx-exceptions -fexceptions -fblocks -std=c++11 -analyzer-store=region -analyzer-checker=deadcode.DeadStores -verify -Wno-unreachable-code %s
+// RUN: %clang_analyze_cc1 -fcxx-exceptions -fexceptions -fblocks -std=c++11 \
+// RUN: -analyzer-checker=deadcode.DeadStores -Wno-unreachable-code \
+// RUN: -analyzer-config deadcode.DeadStores:WarnForDeadNestedAssignments=false\
+// RUN: -verify=non-nested %s
+//
+// RUN: %clang_analyze_cc1 -fcxx-exceptions -fexceptions -fblocks -std=c++11 \
+// RUN: -analyzer-store=region -analyzer-checker=deadcode.DeadStores \
+// RUN: -analyzer-config deadcode.DeadStores:WarnForDeadNestedAssignments=false\
+// RUN: -Wno-unreachable-code -verify=non-nested %s
+//
+// RUN: %clang_analyze_cc1 -fcxx-exceptions -fexceptions -fblocks -std=c++11 \
+// RUN: -analyzer-checker=deadcode.DeadStores -Wno-unreachable-code \
+// RUN: -verify=non-nested,nested %s
//===----------------------------------------------------------------------===//
// Basic dead store checking (but in C++ mode).
//===----------------------------------------------------------------------===//
int j;
+int make_int();
void test1() {
int x = 4;
-
- x = x + 1; // expected-warning{{never read}}
+ x = x + 1; // non-nested-warning {{never read}}
switch (j) {
case 1:
@@ -17,6 +28,11 @@
(void)x;
break;
}
+
+ int y;
+ (void)y;
+ if ((y = make_int())) // nested-warning {{Although the value stored}}
+ return;
}
//===----------------------------------------------------------------------===//
@@ -25,6 +41,7 @@
class Test2 {
int &x;
+
public:
Test2(int &y) : x(y) {}
~Test2() { ++x; }
@@ -66,17 +83,17 @@
//===----------------------------------------------------------------------===//
void test3_a(int x) {
- x = x + 1; // expected-warning{{never read}}
+ x = x + 1; // non-nested-warning {{never read}}
}
void test3_b(int &x) {
- x = x + 1; // no-warninge
+ x = x + 1; // no-warning
}
void test3_c(int x) {
int &y = x;
- // Shows the limitation of dead stores tracking. The write is really
- // dead since the value cannot escape the function.
+ // Shows the limitation of dead stores tracking. The write is really dead
+ // since the value cannot escape the function.
++y; // no-warning
}
@@ -94,7 +111,7 @@
//===----------------------------------------------------------------------===//
static void test_new(unsigned n) {
- char **p = new char* [n]; // expected-warning{{never read}}
+ char **p = new char *[n]; // non-nested-warning {{never read}}
}
//===----------------------------------------------------------------------===//
@@ -102,11 +119,11 @@
//===----------------------------------------------------------------------===//
namespace foo {
- int test_4(int x) {
- x = 2; // expected-warning{{Value stored to 'x' is never read}}
- x = 2;
- return x;
- }
+int test_4(int x) {
+ x = 2; // non-nested-warning {{Value stored to 'x' is never read}}
+ x = 2;
+ return x;
+}
}
//===----------------------------------------------------------------------===//
@@ -119,42 +136,39 @@
try {
x = 2; // no-warning
test_5_Aux();
- }
- catch (int z) {
+ } catch (int z) {
return x + z;
}
return 1;
}
-
int test_6_aux(unsigned x);
-
void test_6() {
- unsigned currDestLen = 0; // no-warning
+ unsigned currDestLen = 0; // no-warning
try {
while (test_6_aux(currDestLen)) {
currDestLen += 2; // no-warning
- }
+ }
+ } catch (void *) {
}
- catch (void *) {}
}
void test_6b() {
- unsigned currDestLen = 0; // no-warning
+ unsigned currDestLen = 0; // no-warning
try {
while (test_6_aux(currDestLen)) {
- currDestLen += 2; // expected-warning {{Value stored to 'currDestLen' is never read}}
+ currDestLen += 2;
+ // non-nested-warning@-1 {{Value stored to 'currDestLen' is never read}}
break;
- }
+ }
+ } catch (void *) {
}
- catch (void *) {}
}
-
void testCXX11Using() {
using Int = int;
Int value;
- value = 1; // expected-warning {{never read}}
+ value = 1; // non-nested-warning {{never read}}
}
//===----------------------------------------------------------------------===//
@@ -177,13 +191,14 @@
template <class T>
void test_block_in_dependent_context(typename T::some_t someArray) {
^{
- int i = someArray[0]; // no-warning
+ int i = someArray[0]; // no-warning
}();
}
void test_block_in_non_dependent_context(int *someArray) {
^{
- int i = someArray[0]; // expected-warning {{Value stored to 'i' during its initialization is never read}}
+ int i = someArray[0];
+ // non-nested-warning@-1 {{Value stored to 'i' during its initialization is never read}}
}();
}
diff --git a/src/llvm-project/clang/test/Analysis/dead-stores.m b/src/llvm-project/clang/test/Analysis/dead-stores.m
index 9f91f39..27543ab 100644
--- a/src/llvm-project/clang/test/Analysis/dead-stores.m
+++ b/src/llvm-project/clang/test/Analysis/dead-stores.m
@@ -1,5 +1,4 @@
// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core -analyzer-checker=deadcode.DeadStores,osx.cocoa.RetainCount -fblocks -verify -Wno-objc-root-class %s
-// expected-no-diagnostics
typedef signed char BOOL;
typedef unsigned int NSUInteger;
@@ -72,7 +71,8 @@
@implementation Rdar7947686_B
- (id) init {
- id x = (self = [super init]); // no-warning
+ id x = (self = [super init]);
+ // expected-warning@-1 {{Although the value stored to 'self'}}
return x;
}
@end
diff --git a/src/llvm-project/clang/test/Analysis/deadstores-driverkit.cpp b/src/llvm-project/clang/test/Analysis/deadstores-driverkit.cpp
index 0885367..9c423fc 100644
--- a/src/llvm-project/clang/test/Analysis/deadstores-driverkit.cpp
+++ b/src/llvm-project/clang/test/Analysis/deadstores-driverkit.cpp
@@ -5,7 +5,7 @@
// It needs to be on the top.
// Run-lines can wait.
-// RUN: %clang_analyze_cc1 -w -triple x86_64-apple-driverkit19.0 \
+// RUN: %clang_analyze_cc1 -std=c++17 -w -triple x86_64-apple-driverkit19.0 \
// RUN: -analyzer-checker=deadcode -verify %s
// expected-no-diagnostics
diff --git a/src/llvm-project/clang/test/Analysis/debug-CallGraph.cpp b/src/llvm-project/clang/test/Analysis/debug-CallGraph.cpp
index 1d6844f..0f5a83b 100644
--- a/src/llvm-project/clang/test/Analysis/debug-CallGraph.cpp
+++ b/src/llvm-project/clang/test/Analysis/debug-CallGraph.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_analyze_cc1 -analyzer-checker=debug.DumpCallGraph %s -fblocks 2>&1 | FileCheck %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=debug.DumpCallGraph %s -fblocks -std=c++14 2>&1 | FileCheck %s
int get5() {
return 5;
@@ -68,8 +68,25 @@
}
}
+namespace Lambdas {
+ void Callee(){}
+
+ void f1() {
+ [](int i) {
+ Callee();
+ }(1);
+ [](auto i) {
+ Callee();
+ }(1);
+ }
+}
+
// CHECK:--- Call graph Dump ---
-// CHECK-NEXT: {{Function: < root > calls: get5 add test_add mmm foo aaa < > bbb ddd ccc eee fff do_nothing test_single_call SomeNS::templ SomeNS::templ SomeNS::templUser $}}
+// CHECK-NEXT: {{Function: < root > calls: get5 add test_add mmm foo aaa < > bbb ddd ccc eee fff do_nothing test_single_call SomeNS::templ SomeNS::templ SomeNS::templUser Lambdas::Callee Lambdas::f1 Lambdas::f1\(\)::\(anonymous class\)::operator\(\) Lambdas::f1\(\)::\(anonymous class\)::operator\(\) $}}
+// CHECK-NEXT: {{Function: Lambdas::f1 calls: Lambdas::f1\(\)::\(anonymous class\)::operator\(\) Lambdas::f1\(\)::\(anonymous class\)::operator\(\) $}}
+// CHECK-NEXT: {{Function: Lambdas::f1\(\)::\(anonymous class\)::operator\(\) calls: Lambdas::Callee $}}
+// CHECK-NEXT: {{Function: Lambdas::f1\(\)::\(anonymous class\)::operator\(\) calls: Lambdas::Callee $}}
+// CHECK-NEXT: {{Function: Lambdas::Callee calls: $}}
// CHECK-NEXT: {{Function: SomeNS::templUser calls: SomeNS::templ SomeNS::templ $}}
// CHECK-NEXT: {{Function: SomeNS::templ calls: eee $}}
// CHECK-NEXT: {{Function: SomeNS::templ calls: ccc $}}
diff --git a/src/llvm-project/clang/test/Analysis/debug-iterator-modeling.cpp b/src/llvm-project/clang/test/Analysis/debug-iterator-modeling.cpp
new file mode 100644
index 0000000..00816c8
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/debug-iterator-modeling.cpp
@@ -0,0 +1,61 @@
+// RUN: %clang_analyze_cc1 -std=c++11\
+// RUN: -analyzer-checker=core,cplusplus\
+// RUN: -analyzer-checker=debug.DebugIteratorModeling,debug.ExprInspection\
+// RUN: -analyzer-config aggressive-binary-operation-simplification=true\
+// RUN: -analyzer-config c++-container-inlining=false %s -verify
+
+// RUN: %clang_analyze_cc1 -std=c++11\
+// RUN: -analyzer-checker=core,cplusplus\
+// RUN: -analyzer-checker=debug.DebugIteratorModeling,debug.ExprInspection\
+// RUN: -analyzer-config aggressive-binary-operation-simplification=true\
+// RUN: -analyzer-config c++-container-inlining=true -DINLINE=1 %s -verify
+
+#include "Inputs/system-header-simulator-cxx.h"
+
+template <typename Container>
+long clang_analyzer_container_begin(const Container&);
+template <typename Container>
+long clang_analyzer_container_end(const Container&);
+template <typename Iterator>
+long clang_analyzer_iterator_position(const Iterator&);
+template <typename Iterator>
+void* clang_analyzer_iterator_container(const Iterator&);
+template <typename Iterator>
+bool clang_analyzer_iterator_validity(const Iterator&);
+void clang_analyzer_denote(long, const char*);
+void clang_analyzer_express(long);
+void clang_analyzer_dump(const void*);
+void clang_analyzer_eval(bool);
+
+void iterator_position(const std::vector<int> v0) {
+ auto b0 = v0.begin(), e0 = v0.end();
+
+ clang_analyzer_denote(clang_analyzer_iterator_position(b0), "$b0");
+ clang_analyzer_denote(clang_analyzer_iterator_position(e0), "$e0");
+
+ clang_analyzer_express(clang_analyzer_iterator_position(b0)); // expected-warning{{$b0}}
+ clang_analyzer_express(clang_analyzer_iterator_position(e0)); // expected-warning{{$e0}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(v0)); // expected-warning{{$b0}}
+ clang_analyzer_express(clang_analyzer_container_end(v0)); // expected-warning{{$e0}}
+
+ ++b0;
+
+ clang_analyzer_express(clang_analyzer_iterator_position(b0)); // expected-warning{{$b0 + 1}}
+}
+
+void iterator_container(const std::vector<int> v0) {
+ auto b0 = v0.begin();
+
+ clang_analyzer_dump(&v0); //expected-warning{{&v0}}
+ clang_analyzer_eval(clang_analyzer_iterator_container(b0) == &v0); // expected-warning{{TRUE}}
+}
+
+void iterator_validity(std::vector<int> v0) {
+ auto b0 = v0.begin();
+ clang_analyzer_eval(clang_analyzer_iterator_validity(b0)); //expected-warning{{TRUE}}
+
+ v0.clear();
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(b0)); //expected-warning{{FALSE}}
+}
diff --git a/src/llvm-project/clang/test/Analysis/designated-initializer-values.c b/src/llvm-project/clang/test/Analysis/designated-initializer-values.c
new file mode 100644
index 0000000..1efc10a
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/designated-initializer-values.c
@@ -0,0 +1,38 @@
+// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -std=c99 -verify %s
+
+void clang_analyzer_eval(int);
+
+void array_init() {
+ int a[5] = {[4] = 29, [2] = 15, [0] = 4};
+ clang_analyzer_eval(a[0] == 4); // expected-warning{{TRUE}}
+ clang_analyzer_eval(a[1] == 0); // expected-warning{{TRUE}}
+ clang_analyzer_eval(a[2] == 15); // expected-warning{{TRUE}}
+ clang_analyzer_eval(a[3] == 0); // expected-warning{{TRUE}}
+ clang_analyzer_eval(a[4] == 29); // expected-warning{{TRUE}}
+ int b[5] = {[0 ... 2] = 1, [4] = 5};
+ clang_analyzer_eval(b[0] == 1); // expected-warning{{TRUE}}
+ clang_analyzer_eval(b[1] == 1); // expected-warning{{TRUE}}
+ clang_analyzer_eval(b[2] == 1); // expected-warning{{TRUE}}
+ clang_analyzer_eval(b[3] == 0); // expected-warning{{TRUE}}
+ clang_analyzer_eval(b[4] == 5); // expected-warning{{TRUE}}
+}
+
+struct point {
+ int x, y;
+};
+
+void struct_init() {
+ struct point p = {.y = 5, .x = 3};
+ clang_analyzer_eval(p.x == 3); // expected-warning{{TRUE}}
+ clang_analyzer_eval(p.y == 5); // expected-warning{{TRUE}}
+}
+
+void array_of_struct() {
+ struct point ptarray[3] = { [2].y = 1, [2].x = 2, [0].x = 3 };
+ clang_analyzer_eval(ptarray[0].x == 3); // expected-warning{{TRUE}}
+ clang_analyzer_eval(ptarray[0].y == 0); // expected-warning{{TRUE}}
+ clang_analyzer_eval(ptarray[1].x == 0); // expected-warning{{TRUE}}
+ clang_analyzer_eval(ptarray[1].y == 0); // expected-warning{{TRUE}}
+ clang_analyzer_eval(ptarray[2].x == 2); // expected-warning{{TRUE}}
+ clang_analyzer_eval(ptarray[2].y == 1); // expected-warning{{TRUE}}
+}
diff --git a/src/llvm-project/clang/test/Analysis/designated-initializer.c b/src/llvm-project/clang/test/Analysis/designated-initializer.c
index 920b2f0..adca0ab 100644
--- a/src/llvm-project/clang/test/Analysis/designated-initializer.c
+++ b/src/llvm-project/clang/test/Analysis/designated-initializer.c
@@ -31,11 +31,10 @@
// CHECK: 11: struct LUQ var = {getUQ(), .uq.q.a = 100};
// CHECK: 12: 1
// CHECK: 13: 2
-// CHECK: 14: /*implicit*/(int)0
-// CHECK: 15: {[B1.12], [B1.13]}
+// CHECK: 14: {[B1.12], [B1.13]}
+// CHECK: 17: /*no init*/
// CHECK: 18: /*no init*/
-// CHECK: 19: /*no init*/
-// CHECK: 20: 3
-// CHECK: 21: {[B1.18], [B1.19], [B1.20]}
-// CHECK: 22: {/*base*/[B1.17], /*updater*/[B1.21]}
-// CHECK: 24: struct Q s[] = {[0] = (struct Q){1, 2}, [0].c = 3};
+// CHECK: 19: 3
+// CHECK: 20: {[B1.17], [B1.18], [B1.19]}
+// CHECK: 21: {/*base*/[B1.16], /*updater*/[B1.20]}
+// CHECK: 23: struct Q s[] = {[0] = (struct Q){1, 2}, [0].c = 3};
diff --git a/src/llvm-project/clang/test/Analysis/diagnostics/Inputs/expected-sarif/sarif-diagnostics-taint-test.c.sarif b/src/llvm-project/clang/test/Analysis/diagnostics/Inputs/expected-sarif/sarif-diagnostics-taint-test.c.sarif
index cebc817..2deb1bd 100644
--- a/src/llvm-project/clang/test/Analysis/diagnostics/Inputs/expected-sarif/sarif-diagnostics-taint-test.c.sarif
+++ b/src/llvm-project/clang/test/Analysis/diagnostics/Inputs/expected-sarif/sarif-diagnostics-taint-test.c.sarif
@@ -1,31 +1,19 @@
{
- "$schema": "http://json.schemastore.org/sarif-2.0.0-csd.2.beta.2018-11-28",
+ "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",
"runs": [
{
- "files": [
+ "artifacts": [
{
- "fileLocation": {
- },
"length": 434,
+ "location": {
+ },
"mimeType": "text/plain",
"roles": [
"resultFile"
]
}
],
- "resources": {
- "rules": [
- {
- "fullDescription": {
- "text": "Mark tainted symbols as such."
- },
- "id": "debug.TaintTest",
- "name": {
- "text": "debug.TaintTest"
- }
- }
- ]
- },
+ "columnKind": "unicodeCodePoints",
"results": [
{
"codeFlows": [
@@ -40,11 +28,11 @@
"text": "Calling 'f'"
},
"physicalLocation": {
- "fileLocation": {
- "fileIndex": 0,
+ "artifactLocation": {
+ "index": 0,
},
"region": {
- "endColumn": 5,
+ "endColumn": 6,
"endLine": 13,
"startColumn": 3,
"startLine": 13
@@ -59,11 +47,11 @@
"text": "tainted"
},
"physicalLocation": {
- "fileLocation": {
- "fileIndex": 0,
+ "artifactLocation": {
+ "index": 0,
},
"region": {
- "endColumn": 17,
+ "endColumn": 18,
"endLine": 9,
"startColumn": 11,
"startLine": 9
@@ -79,11 +67,11 @@
"locations": [
{
"physicalLocation": {
- "fileLocation": {
- "fileIndex": 0,
+ "artifactLocation": {
+ "index": 0,
},
"region": {
- "endColumn": 17,
+ "endColumn": 18,
"endLine": 9,
"startColumn": 11,
"startLine": 9
@@ -99,9 +87,20 @@
}
],
"tool": {
- "fullName": "clang static analyzer",
- "language": "en-US",
- "name": "clang",
+ "driver": {
+ "fullName": "clang static analyzer",
+ "language": "en-US",
+ "name": "clang",
+ "rules": [
+ {
+ "fullDescription": {
+ "text": "Mark tainted symbols as such."
+ },
+ "id": "debug.TaintTest",
+ "name": "debug.TaintTest"
+ }
+ ],
+ }
}
}
],
diff --git a/src/llvm-project/clang/test/Analysis/diagnostics/Inputs/expected-sarif/sarif-multi-diagnostic-test.c.sarif b/src/llvm-project/clang/test/Analysis/diagnostics/Inputs/expected-sarif/sarif-multi-diagnostic-test.c.sarif
index f1527d4..a54c453 100644
--- a/src/llvm-project/clang/test/Analysis/diagnostics/Inputs/expected-sarif/sarif-multi-diagnostic-test.c.sarif
+++ b/src/llvm-project/clang/test/Analysis/diagnostics/Inputs/expected-sarif/sarif-multi-diagnostic-test.c.sarif
@@ -1,51 +1,19 @@
{
- "$schema": "http://json.schemastore.org/sarif-2.0.0-csd.2.beta.2018-11-28",
+ "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",
"runs": [
{
- "files": [
+ "artifacts": [
{
- "fileLocation": {
+ "length": 1077,
+ "location": {
},
- "length": 686,
"mimeType": "text/plain",
"roles": [
"resultFile"
]
}
],
- "resources": {
- "rules": [
- {
- "fullDescription": {
- "text": "Mark tainted symbols as such."
- },
- "id": "debug.TaintTest",
- "name": {
- "text": "debug.TaintTest"
- }
- },
- {
- "fullDescription": {
- "text": "Check for logical errors for function calls and Objective-C message expressions (e.g., uninitialized arguments, null function pointers)"
- },
- "helpUri": "https://clang-analyzer.llvm.org/available_checks.html#core.CallAndMessage",
- "id": "core.CallAndMessage",
- "name": {
- "text": "core.CallAndMessage"
- }
- },
- {
- "fullDescription": {
- "text": "Check for division by zero"
- },
- "helpUri": "https://clang-analyzer.llvm.org/available_checks.html#core.DivideZero",
- "id": "core.DivideZero",
- "name": {
- "text": "core.DivideZero"
- }
- }
- ]
- },
+ "columnKind": "unicodeCodePoints",
"results": [
{
"codeFlows": [
@@ -60,14 +28,14 @@
"text": "Calling 'f'"
},
"physicalLocation": {
- "fileLocation": {
- "fileIndex": 0,
+ "artifactLocation": {
+ "index": 0,
},
"region": {
- "endColumn": 5,
- "endLine": 24,
+ "endColumn": 6,
+ "endLine": 39,
"startColumn": 3,
- "startLine": 24
+ "startLine": 39
}
}
}
@@ -79,14 +47,14 @@
"text": "tainted"
},
"physicalLocation": {
- "fileLocation": {
- "fileIndex": 0,
+ "artifactLocation": {
+ "index": 0,
},
"region": {
- "endColumn": 17,
- "endLine": 9,
+ "endColumn": 18,
+ "endLine": 11,
"startColumn": 11,
- "startLine": 9
+ "startLine": 11
}
}
}
@@ -99,14 +67,14 @@
"locations": [
{
"physicalLocation": {
- "fileLocation": {
- "fileIndex": 0,
+ "artifactLocation": {
+ "index": 0,
},
"region": {
- "endColumn": 17,
- "endLine": 9,
+ "endColumn": 18,
+ "endLine": 11,
"startColumn": 11,
- "startLine": 9
+ "startLine": 11
}
}
}
@@ -130,14 +98,14 @@
"text": "Calling 'g'"
},
"physicalLocation": {
- "fileLocation": {
- "fileIndex": 0,
+ "artifactLocation": {
+ "index": 0,
},
"region": {
- "endColumn": 5,
- "endLine": 25,
+ "endColumn": 6,
+ "endLine": 40,
"startColumn": 3,
- "startLine": 25
+ "startLine": 40
}
}
}
@@ -149,14 +117,14 @@
"text": "'fp' declared without an initial value"
},
"physicalLocation": {
- "fileLocation": {
- "fileIndex": 0,
+ "artifactLocation": {
+ "index": 0,
},
"region": {
- "endColumn": 10,
- "endLine": 13,
+ "endColumn": 12,
+ "endLine": 15,
"startColumn": 3,
- "startLine": 13
+ "startLine": 15
}
}
}
@@ -168,14 +136,14 @@
"text": "Called function pointer is an uninitialized pointer value"
},
"physicalLocation": {
- "fileLocation": {
- "fileIndex": 0,
+ "artifactLocation": {
+ "index": 0,
},
"region": {
- "endColumn": 8,
- "endLine": 14,
+ "endColumn": 9,
+ "endLine": 16,
"startColumn": 3,
- "startLine": 14
+ "startLine": 16
}
}
}
@@ -188,14 +156,14 @@
"locations": [
{
"physicalLocation": {
- "fileLocation": {
- "fileIndex": 0,
+ "artifactLocation": {
+ "index": 0,
},
"region": {
- "endColumn": 8,
- "endLine": 14,
+ "endColumn": 9,
+ "endLine": 16,
"startColumn": 3,
- "startLine": 14
+ "startLine": 16
}
}
}
@@ -219,14 +187,14 @@
"text": "Assuming 'i' is equal to 0"
},
"physicalLocation": {
- "fileLocation": {
- "fileIndex": 0,
+ "artifactLocation": {
+ "index": 0,
},
"region": {
- "endColumn": 12,
- "endLine": 18,
+ "endColumn": 13,
+ "endLine": 20,
"startColumn": 7,
- "startLine": 18
+ "startLine": 20
}
}
}
@@ -238,14 +206,13 @@
"text": "Taking true branch"
},
"physicalLocation": {
- "fileLocation": {
- "fileIndex": 0,
+ "artifactLocation": {
+ "index": 0,
},
"region": {
"endColumn": 3,
- "endLine": 18,
"startColumn": 3,
- "startLine": 18
+ "startLine": 20
}
}
}
@@ -257,14 +224,13 @@
"text": "Division by zero"
},
"physicalLocation": {
- "fileLocation": {
- "fileIndex": 0,
+ "artifactLocation": {
+ "index": 0,
},
"region": {
"endColumn": 14,
- "endLine": 19,
"startColumn": 14,
- "startLine": 19
+ "startLine": 21
}
}
}
@@ -277,14 +243,186 @@
"locations": [
{
"physicalLocation": {
- "fileLocation": {
- "fileIndex": 0,
+ "artifactLocation": {
+ "index": 0,
},
"region": {
"endColumn": 14,
- "endLine": 19,
"startColumn": 14,
- "startLine": 19
+ "startLine": 21
+ }
+ }
+ }
+ ],
+ "message": {
+ "text": "Division by zero"
+ },
+ "ruleId": "core.DivideZero",
+ "ruleIndex": 2
+ },
+ {
+ "codeFlows": [
+ {
+ "threadFlows": [
+ {
+ "locations": [
+ {
+ "importance": "essential",
+ "location": {
+ "message": {
+ "text": "Memory is allocated"
+ },
+ "physicalLocation": {
+ "artifactLocation": {
+ "index": 0,
+ },
+ "region": {
+ "endColumn": 24,
+ "endLine": 26,
+ "startColumn": 15,
+ "startLine": 26
+ }
+ }
+ }
+ },
+ {
+ "importance": "important",
+ "location": {
+ "message": {
+ "text": "Assuming 'i' is < 4"
+ },
+ "physicalLocation": {
+ "artifactLocation": {
+ "index": 0,
+ },
+ "region": {
+ "endColumn": 12,
+ "endLine": 27,
+ "startColumn": 7,
+ "startLine": 27
+ }
+ }
+ }
+ },
+ {
+ "importance": "unimportant",
+ "location": {
+ "message": {
+ "text": "Taking true branch"
+ },
+ "physicalLocation": {
+ "artifactLocation": {
+ "index": 0,
+ },
+ "region": {
+ "endColumn": 3,
+ "startColumn": 3,
+ "startLine": 27
+ }
+ }
+ }
+ },
+ {
+ "importance": "essential",
+ "location": {
+ "message": {
+ "text": "Potential leak of memory pointed to by 'mem'"
+ },
+ "physicalLocation": {
+ "artifactLocation": {
+ "index": 0,
+ },
+ "region": {
+ "endColumn": 12,
+ "startColumn": 12,
+ "startLine": 28
+ }
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "locations": [
+ {
+ "physicalLocation": {
+ "artifactLocation": {
+ "index": 0,
+ },
+ "region": {
+ "endColumn": 12,
+ "startColumn": 12,
+ "startLine": 28
+ }
+ }
+ }
+ ],
+ "message": {
+ "text": "Potential leak of memory pointed to by 'mem'"
+ },
+ "ruleId": "unix.Malloc",
+ "ruleIndex": 3
+ },
+ {
+ "codeFlows": [
+ {
+ "threadFlows": [
+ {
+ "locations": [
+ {
+ "importance": "essential",
+ "location": {
+ "message": {
+ "text": "'løçål' initialized to 0"
+ },
+ "physicalLocation": {
+ "artifactLocation": {
+ "index": 0,
+ },
+ "region": {
+ "endColumn": 12,
+ "endLine": 34,
+ "startColumn": 3,
+ "startLine": 34
+ }
+ }
+ }
+ },
+ {
+ "importance": "essential",
+ "location": {
+ "message": {
+ "text": "Division by zero"
+ },
+ "physicalLocation": {
+ "artifactLocation": {
+ "index": 0,
+ },
+ "region": {
+ "endColumn": 20,
+ "startColumn": 20,
+ "startLine": 35
+ }
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "locations": [
+ {
+ "physicalLocation": {
+ "artifactLocation": {
+ "index": 0,
+ },
+ "region": {
+ "endColumn": 20,
+ "startColumn": 20,
+ "startLine": 35
}
}
}
@@ -297,9 +435,44 @@
}
],
"tool": {
- "fullName": "clang static analyzer",
- "language": "en-US",
- "name": "clang",
+ "driver": {
+ "fullName": "clang static analyzer",
+ "language": "en-US",
+ "name": "clang",
+ "rules": [
+ {
+ "fullDescription": {
+ "text": "Mark tainted symbols as such."
+ },
+ "id": "debug.TaintTest",
+ "name": "debug.TaintTest"
+ },
+ {
+ "fullDescription": {
+ "text": "Check for logical errors for function calls and Objective-C message expressions (e.g., uninitialized arguments, null function pointers)"
+ },
+ "helpUri": "https://clang-analyzer.llvm.org/available_checks.html#core.CallAndMessage",
+ "id": "core.CallAndMessage",
+ "name": "core.CallAndMessage"
+ },
+ {
+ "fullDescription": {
+ "text": "Check for division by zero"
+ },
+ "helpUri": "https://clang-analyzer.llvm.org/available_checks.html#core.DivideZero",
+ "id": "core.DivideZero",
+ "name": "core.DivideZero"
+ },
+ {
+ "fullDescription": {
+ "text": "Check for memory leaks, double free, and use-after-free problems. Traces memory managed by malloc()/free()."
+ },
+ "helpUri": "https://clang-analyzer.llvm.org/available_checks.html#unix.Malloc",
+ "id": "unix.Malloc",
+ "name": "unix.Malloc"
+ }
+ ],
+ }
}
}
],
diff --git a/src/llvm-project/clang/test/Analysis/diagnostics/dtors.cpp b/src/llvm-project/clang/test/Analysis/diagnostics/dtors.cpp
index 18bedc6..6a8349d 100644
--- a/src/llvm-project/clang/test/Analysis/diagnostics/dtors.cpp
+++ b/src/llvm-project/clang/test/Analysis/diagnostics/dtors.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_analyze_cc1 -w -analyzer-checker=core,cplusplus -analyzer-output=text -verify %s
+// RUN: %clang_analyze_cc1 -std=c++14 -w -analyzer-checker=core,cplusplus -analyzer-output=text -verify %s
namespace no_crash_on_delete_dtor {
// We were crashing when producing diagnostics for this code, but not for the
diff --git a/src/llvm-project/clang/test/Analysis/diagnostics/explicit-suppression.cpp b/src/llvm-project/clang/test/Analysis/diagnostics/explicit-suppression.cpp
index 6bc0147..f7db7a2 100644
--- a/src/llvm-project/clang/test/Analysis/diagnostics/explicit-suppression.cpp
+++ b/src/llvm-project/clang/test/Analysis/diagnostics/explicit-suppression.cpp
@@ -19,6 +19,6 @@
void testCopyNull(C *I, C *E) {
std::copy(I, E, (C *)0);
#ifndef SUPPRESSED
- // expected-warning@../Inputs/system-header-simulator-cxx.h:680 {{Called C++ object pointer is null}}
+ // expected-warning@../Inputs/system-header-simulator-cxx.h:698 {{Called C++ object pointer is null}}
#endif
}
diff --git a/src/llvm-project/clang/test/Analysis/diagnostics/find_last_store.c b/src/llvm-project/clang/test/Analysis/diagnostics/find_last_store.c
index 9bf601e..486e4ec 100644
--- a/src/llvm-project/clang/test/Analysis/diagnostics/find_last_store.c
+++ b/src/llvm-project/clang/test/Analysis/diagnostics/find_last_store.c
@@ -2,13 +2,11 @@
typedef struct { float b; } c;
void *a();
void *d() {
- return a(); // expected-note{{Returning pointer}}
+ return a();
}
void no_find_last_store() {
- c *e = d(); // expected-note{{Calling 'd'}}
- // expected-note@-1{{Returning from 'd'}}
- // expected-note@-2{{'e' initialized here}}
+ c *e = d(); // expected-note{{'e' initialized here}}
(void)(e || e->b); // expected-note{{Assuming 'e' is null}}
// expected-note@-1{{Left side of '||' is false}}
diff --git a/src/llvm-project/clang/test/Analysis/diagnostics/no-store-func-path-notes.m b/src/llvm-project/clang/test/Analysis/diagnostics/no-store-func-path-notes.m
index 0136389..6ef162e 100644
--- a/src/llvm-project/clang/test/Analysis/diagnostics/no-store-func-path-notes.m
+++ b/src/llvm-project/clang/test/Analysis/diagnostics/no-store-func-path-notes.m
@@ -16,6 +16,7 @@
return 0;
}
return 1; // expected-note{{Returning without writing to '*var'}}
+ // expected-note@-1{{Returning the value 1, which participates in a condition later}}
}
@end
diff --git a/src/llvm-project/clang/test/Analysis/diagnostics/sarif-multi-diagnostic-test.c b/src/llvm-project/clang/test/Analysis/diagnostics/sarif-multi-diagnostic-test.c
index 3402714..542a808 100644
--- a/src/llvm-project/clang/test/Analysis/diagnostics/sarif-multi-diagnostic-test.c
+++ b/src/llvm-project/clang/test/Analysis/diagnostics/sarif-multi-diagnostic-test.c
@@ -1,5 +1,7 @@
-// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.security.taint,debug.TaintTest %s -verify -analyzer-output=sarif -o - | %normalize_sarif | diff -U1 -b %S/Inputs/expected-sarif/sarif-multi-diagnostic-test.c.sarif -
+// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.security.taint,debug.TaintTest,unix.Malloc %s -verify -analyzer-output=sarif -o - | %normalize_sarif | diff -U1 -b %S/Inputs/expected-sarif/sarif-multi-diagnostic-test.c.sarif -
#include "../Inputs/system-header-simulator.h"
+#include "../Inputs/system-header-simulator-for-malloc.h"
+#define ERR -1
int atoi(const char *nptr);
@@ -20,10 +22,25 @@
return 0;
}
+int leak(int i) {
+ void *mem = malloc(8);
+ if (i < 4)
+ return ERR; // expected-warning {{Potential leak of memory pointed to by 'mem'}}
+ free(mem);
+ return 0;
+}
+
+int unicode() {
+ int løçål = 0;
+ /* ☃ */ return 1 / løçål; // expected-warning {{Division by zero}}
+}
+
int main(void) {
f();
g();
h(0);
+ leak(0);
+ unicode();
return 0;
}
diff --git a/src/llvm-project/clang/test/Analysis/domtest.cpp b/src/llvm-project/clang/test/Analysis/domtest.cpp
index 078117e..2a2caed 100644
--- a/src/llvm-project/clang/test/Analysis/domtest.cpp
+++ b/src/llvm-project/clang/test/Analysis/domtest.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_analyze_cc1 %s \
+// RUN: %clang_analyze_cc1 -std=c++14 %s \
// RUN: -analyzer-checker=debug.DumpDominators \
// RUN: -analyzer-checker=debug.DumpPostDominators \
// RUN: -analyzer-checker=debug.DumpControlDependencies \
diff --git a/src/llvm-project/clang/test/Analysis/dtor.cpp b/src/llvm-project/clang/test/Analysis/dtor.cpp
index d843f03..1c62517 100644
--- a/src/llvm-project/clang/test/Analysis/dtor.cpp
+++ b/src/llvm-project/clang/test/Analysis/dtor.cpp
@@ -540,3 +540,33 @@
clang_analyzer_eval(__alignof(NonTrivial) > 0); // expected-warning{{TRUE}}
}
}
+
+namespace dtor_over_loc_concrete_int {
+struct A {
+ ~A() {}
+};
+
+struct B {
+ A a;
+ ~B() {}
+};
+
+struct C : A {
+ ~C() {}
+};
+
+void testB() {
+ B *b = (B *)-1;
+ b->~B(); // no-crash
+}
+
+void testC() {
+ C *c = (C *)-1;
+ c->~C(); // no-crash
+}
+
+void testAutoDtor() {
+ const A &a = *(A *)-1;
+ // no-crash
+}
+} // namespace dtor_over_loc_concrete_int
diff --git a/src/llvm-project/clang/test/Analysis/dump_egraph.c b/src/llvm-project/clang/test/Analysis/dump_egraph.c
index 99463da..d6f252a 100644
--- a/src/llvm-project/clang/test/Analysis/dump_egraph.c
+++ b/src/llvm-project/clang/test/Analysis/dump_egraph.c
@@ -18,13 +18,35 @@
return *x + *y;
}
-// CHECK: \"program_points\": [\l \{ \"kind\": \"Edge\", \"src_id\": 2, \"dst_id\": 1, \"terminator\": null, \"term_kind\": null, \"tag\": null \}\l ],\l \"program_state\": null
-
-// CHECK: \"program_points\": [\l \{ \"kind\": \"BlockEntrance\", \"block_id\": 1
-
+// CHECK: \"program_points\": [\l
+// CHECK-SAME: \{ \"kind\": \"Edge\", \"src_id\": 2, \"dst_id\": 1,
+// CHECK-SAME: \"terminator\": null, \"term_kind\": null, \"tag\": null,
+// CHECK-SAME: \"node_id\": 1, \"is_sink\": 0, \"has_report\": 0
+// CHECK-SAME: \},
+// CHECK-SAME: \{ \"kind\": \"BlockEntrance\", \"block_id\": 1, \"tag\": null,
+// CHECK-SAME: \"node_id\": 2, \"is_sink\": 0, \"has_report\": 0
+// CHECK-SAME: \},
+// CHECK-SAME: \{ \"kind\": \"Statement\", \"stmt_kind\": \"IntegerLiteral\",
+// CHECK-SAME: \"stmt_id\": {{[0-9]*}}, \"pointer\": \"0x{{[0-9a-f]*}}\",
+// CHECK-SAME: \"pretty\": \"0\", \"location\": \{
+// CHECK-SAME: \"line\": 15, \"column\": 12, \"file\":
+// CHECK-SAME: \}, \"stmt_point_kind\": \"PreStmtPurgeDeadSymbols\",
+// CHECK-SAME: \"tag\": \"ExprEngine : Clean Node\", \"node_id\": 3,
+// CHECK-SAME: \"is_sink\": 0, \"has_report\": 0
+// CHECK-SAME: \},
+// CHECK-SAME: \{ \"kind\": \"Statement\", \"stmt_kind\": \"IntegerLiteral\",
+// CHECK-SAME: \"stmt_id\": {{[0-9]*}}, \"pointer\": \"0x{{[0-9a-f]*}}\",
+// CHECK-SAME: \"pretty\": \"0\", \"location\": \{
+// CHECK-SAME: \"line\": 15, \"column\": 12, \"file\":
+// CHECK-SAME: \}, \"stmt_point_kind\": \"PostStmt\", \"tag\": null,
+// CHECK-SAME: \"node_id\": 4, \"is_sink\": 0, \"has_report\": 0
+// CHECK-SAME: \}
+// CHECK-SAME: ]
// CHECK: \"pretty\": \"*x\", \"location\": \{ \"line\": 18, \"column\": 10, \"file\": \"{{(.+)}}dump_egraph.c\" \}
// CHECK: \"pretty\": \"'\\\\x13'\"
-// CHECK: \"has_report\": true
+// CHECK: \"has_report\": 1
+
+// CHECK-NOT: \"program_state\": null
diff --git a/src/llvm-project/clang/test/Analysis/dump_egraph.cpp b/src/llvm-project/clang/test/Analysis/dump_egraph.cpp
index f5db3d1..9b87d1a 100644
--- a/src/llvm-project/clang/test/Analysis/dump_egraph.cpp
+++ b/src/llvm-project/clang/test/Analysis/dump_egraph.cpp
@@ -20,8 +20,9 @@
// CHECK: \"location_context\": \"#0 Call\", \"calling\": \"foo\", \"location\": null, \"items\": [\l \{ \"stmt_id\": {{[0-9]+}}, \"kind\": \"construct into local variable\", \"argument_index\": null, \"pretty\": \"T t;\", \"value\": \"&t\"
-// CHECK: \"location_context\": \"#0 Call\", \"calling\": \"T::T\", \"location\": \{ \"line\": 16, \"column\": 5, \"file\": \"{{.*}}dump_egraph.cpp\" \}, \"items\": [\l \{ \"init_id\": {{[0-9]+}}, \"kind\": \"construct into member variable\", \"argument_index\": null, \"pretty\": \"s\", \"value\": \"&t-\>s\"
+// CHECK: \"location_context\": \"#0 Call\", \"calling\": \"T::T\", \"location\": \{ \"line\": 16, \"column\": 5, \"file\": \"{{.*}}dump_egraph.cpp\" \}, \"items\": [\l \{ \"init_id\": {{[0-9]+}}, \"kind\": \"construct into member variable\", \"argument_index\": null, \"pretty\": \"s\", \"value\": \"&t.s\"
// CHECK: \"cluster\": \"t\", \"pointer\": \"{{0x[0-9a-f]+}}\", \"items\": [\l \{ \"kind\": \"Default\", \"offset\": 0, \"value\": \"conj_$2\{int, LC5, no stmt, #1\}\"
-// CHECK: \"dynamic_types\": [\l\{ \"region\": \"HeapSymRegion\{conj_$1\{struct S *, LC1, S{{[0-9]+}}, #1\}\}\", \"dyn_type\": \"struct S\", \"sub_classable\": false\}\l
+// CHECK: \"dynamic_types\": [\l \{ \"region\": \"HeapSymRegion\{conj_$1\{struct S *, LC1, S{{[0-9]+}}, #1\}\}\", \"dyn_type\": \"struct S\", \"sub_classable\": false \}\l
+
diff --git a/src/llvm-project/clang/test/Analysis/edges-new.mm b/src/llvm-project/clang/test/Analysis/edges-new.mm
index dda1bfb..6bddbef 100644
--- a/src/llvm-project/clang/test/Analysis/edges-new.mm
+++ b/src/llvm-project/clang/test/Analysis/edges-new.mm
@@ -1,4 +1,4 @@
-// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core,deadcode.DeadStores,osx.cocoa.RetainCount,unix.Malloc,unix.MismatchedDeallocator -analyzer-output=plist -o %t -w %s
+// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core,deadcode.DeadStores,osx.cocoa.RetainCount,unix.Malloc,unix.MismatchedDeallocator -analyzer-output=plist -analyzer-config deadcode.DeadStores:ShowFixIts=true -o %t -w %s
// RUN: %normalize_plist <%t | diff -ub %S/Inputs/expected-plists/edges-new.mm.plist -
//===----------------------------------------------------------------------===//
diff --git a/src/llvm-project/clang/test/Analysis/explain-svals.cpp b/src/llvm-project/clang/test/Analysis/explain-svals.cpp
index c1b5200..9c37642 100644
--- a/src/llvm-project/clang/test/Analysis/explain-svals.cpp
+++ b/src/llvm-project/clang/test/Analysis/explain-svals.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_analyze_cc1 -triple i386-apple-darwin10 -analyzer-checker=core.builtin,debug.ExprInspection,unix.cstring -verify %s
+// RUN: %clang_analyze_cc1 -std=c++14 -triple i386-apple-darwin10 -analyzer-checker=core.builtin,debug.ExprInspection,unix.cstring -verify %s
typedef unsigned long size_t;
diff --git a/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/checker_messages.dot b/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/checker_messages.dot
index 84185db..2d054a8 100644
--- a/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/checker_messages.dot
+++ b/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/checker_messages.dot
@@ -14,7 +14,14 @@
"has_report": false,
"is_sink": false,
"state_id": 2,
- "program_points": [],
+ "program_points": [
+ {
+ "kind": "BlockEntrance", "block_id": 1,
+ "terminator": null, "term_kind": null,
+ "tag": null, "node_id": 1,
+ "has_report": 0, "is_sink": 0
+ }
+ ],
"program_state": {
"store": null,
"constraints": null,
diff --git a/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/checker_messages_diff.dot b/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/checker_messages_diff.dot
index 2f0bcbd..898f796 100644
--- a/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/checker_messages_diff.dot
+++ b/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/checker_messages_diff.dot
@@ -5,12 +5,15 @@
Node0x1 [shape=record,label=
"{
- { "node_id": 1,
- "pointer": "0x1",
- "has_report": false,
- "is_sink": false,
- "state_id": 2,
- "program_points": [],
+ { "state_id": 2,
+ "program_points": [
+ {
+ "kind": "BlockEntrance", "block_id": 1,
+ "terminator": null, "term_kind": null,
+ "tag": null, "node_id": 1,
+ "has_report": 0, "is_sink": 0
+ }
+ ],
"program_state": {
"environment": null,
"store": null,
@@ -59,12 +62,16 @@
// CHECK-SAME: </tr>
Node0x4 [shape=record,label=
"{
- { "node_id": 4,
- "pointer": "0x4",
- "has_report": false,
- "is_sink": false,
+ {
"state_id": 5,
- "program_points": [],
+ "program_points": [
+ {
+ "kind": "BlockEntrance", "block_id": 1,
+ "terminator": null, "term_kind": null,
+ "tag": null, "node_id": 1,
+ "has_report": 0, "is_sink": 0
+ }
+ ],
"program_state": {
"environment": null,
"store": null,
@@ -88,12 +95,15 @@
Node0x6 [shape=record,label=
"{
- { "node_id": 6,
- "pointer": "0x6",
- "has_report": false,
- "is_sink": false,
- "state_id": 7,
- "program_points": [],
+ { "state_id": 7,
+ "program_points": [
+ {
+ "kind": "BlockEntrance", "block_id": 1,
+ "terminator": null, "term_kind": null,
+ "tag": null, "node_id": 1,
+ "has_report": 0, "is_sink": 0
+ }
+ ],
"program_state": null
}
\l}"];
diff --git a/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/constraints.dot b/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/constraints.dot
index 075df98..f5ebcf1 100644
--- a/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/constraints.dot
+++ b/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/constraints.dot
@@ -12,12 +12,16 @@
// CHECK-SAME: </table></td></tr>
Node0x1 [shape=record,label=
"{
- { "node_id": 1,
- "pointer": "0x1",
- "has_report": false,
- "is_sink": false,
+ {
"state_id": 2,
- "program_points": [],
+ "program_points": [
+ {
+ "kind": "BlockEntrance", "block_id": 1,
+ "terminator": null, "term_kind": null,
+ "tag": null, "node_id": 1,
+ "has_report": 0, "is_sink": 0
+ }
+ ],
"program_state": {
"store": null,
"environment": null,
diff --git a/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/constraints_diff.dot b/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/constraints_diff.dot
index 00b2f14..53a87aa 100644
--- a/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/constraints_diff.dot
+++ b/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/constraints_diff.dot
@@ -5,12 +5,16 @@
Node0x1 [shape=record,label=
"{
- { "node_id": 1,
- "pointer": "0x1",
- "has_report": false,
- "is_sink": false,
+ {
"state_id": 2,
- "program_points": [],
+ "program_points": [
+ {
+ "kind": "BlockEntrance", "block_id": 1,
+ "terminator": null, "term_kind": null,
+ "tag": null, "node_id": 1,
+ "has_report": 0, "is_sink": 0
+ }
+ ],
"program_state": {
"store": null,
"environment": null,
@@ -39,12 +43,16 @@
// CHECK-SAME: </tr>
Node0x3 [shape=record,label=
"{
- { "node_id": 3,
- "pointer": "0x3",
- "has_report": false,
- "is_sink": false,
+ {
"state_id": 4,
- "program_points": [],
+ "program_points": [
+ {
+ "kind": "BlockEntrance", "block_id": 1,
+ "terminator": null, "term_kind": null,
+ "tag": null, "node_id": 1,
+ "has_report": 0, "is_sink": 0
+ }
+ ],
"program_state": {
"store": null,
"environment": null,
@@ -62,12 +70,16 @@
Node0x5 [shape=record,label=
"{
- { "node_id": 5,
- "pointer": "0x5",
- "has_report": false,
- "is_sink": false,
+ {
"state_id": 6,
- "program_points": [],
+ "program_points": [
+ {
+ "kind": "BlockEntrance", "block_id": 1,
+ "terminator": null, "term_kind": null,
+ "tag": null, "node_id": 1,
+ "has_report": 0, "is_sink": 0
+ }
+ ],
"program_state": {
"store": null,
"environment": null,
diff --git a/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/edge.dot b/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/edge.dot
index 15e5561..43d6e3b 100644
--- a/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/edge.dot
+++ b/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/edge.dot
@@ -5,13 +5,25 @@
// UNSUPPORTED: system-windows
Node0x1 [shape=record,label=
- "{{ "node_id": 1, "pointer": "0x1", "has_report": false, "is_sink": false,
- "program_state": null, "program_points": []}\l}"];
+ "{{ "state_id": 0, "program_state": null, "program_points": [
+ {
+ "kind": "BlockEntrance", "block_id": 1,
+ "terminator": null, "term_kind": null,
+ "tag": null, "node_id": 1,
+ "has_report": 0, "is_sink": 0
+ }
+ ]}\l}"];
// LIGHT: Node0x1 -> Node0x2;
// DARK: Node0x1 -> Node0x2 [color="white"];
Node0x1 -> Node0x2;
Node0x2 [shape=record,label=
- "{{ "node_id": 2, "pointer": "0x2", "has_report": false, "is_sink": false,
- "program_state": null, "program_points": []}\l}"];
+ "{{ "state_id": 0, "program_state": null, "program_points": [
+ {
+ "kind": "BlockEntrance", "block_id": 1,
+ "terminator": null, "term_kind": null,
+ "tag": null, "node_id": 1,
+ "has_report": 0, "is_sink": 0
+ }
+ ]}\l}"];
diff --git a/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/environment.dot b/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/environment.dot
index 399484a..7b8fc05 100644
--- a/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/environment.dot
+++ b/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/environment.dot
@@ -3,7 +3,7 @@
// FIXME: Substitution doesn't seem to work on Windows.
// UNSUPPORTED: system-windows
-// CHECK: <b>Environment: </b>
+// CHECK: <b>Expressions: </b>
// CHECK-SAME: <table border="0">
// CHECK-SAME: <tr>
// CHECK-SAME: <td align="left">
@@ -11,7 +11,7 @@
// CHECK-SAME: </td>
// CHECK-SAME: <td align="left" colspan="2">
// CHECK-SAME: <font color="gray60">foo </font>
-// CHECK-SAME: (environment.cpp:<b>4</b>:<b>6</b>
+// CHECK-SAME: (environment.cpp:<b>4</b>:<b>6</b>
// CHECK-SAME: <font color="royalblue1">
// CHECK-SAME: (<i>spelling at </i> environment.h:<b>7</b>:<b>8</b>)
// CHECK-SAME: </font>)
@@ -36,7 +36,14 @@
"has_report": false,
"is_sink": false,
"state_id": 2,
- "program_points": [],
+ "program_points": [
+ {
+ "kind": "BlockEntrance", "block_id": 1,
+ "terminator": null, "term_kind": null,
+ "tag": null, "node_id": 1,
+ "has_report": 0, "is_sink": 0
+ }
+ ],
"program_state": {
"store": null,
"constraints": null,
diff --git a/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/environment_diff.dot b/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/environment_diff.dot
index 475247b..05e8d4e 100644
--- a/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/environment_diff.dot
+++ b/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/environment_diff.dot
@@ -6,12 +6,16 @@
// No diffs on the first node, nothing to check.
Node0x1 [shape=record,label=
"{
- { "node_id": 1,
- "pointer": "0x1",
- "has_report": false,
- "is_sink": false,
+ {
"state_id": 2,
- "program_points": [],
+ "program_points": [
+ {
+ "kind": "BlockEntrance", "block_id": 1,
+ "terminator": null, "term_kind": null,
+ "tag": null, "node_id": 1,
+ "has_report": 0, "is_sink": 0
+ }
+ ],
"program_state": {
"store": null,
"constraints": null,
@@ -57,12 +61,16 @@
// CHECK-SAME: </tr>
Node0x6 [shape=record,label=
"{
- { "node_id": 6,
- "pointer": "0x6",
- "has_report": false,
- "is_sink": false,
+ {
"state_id": 7,
- "program_points": [],
+ "program_points": [
+ {
+ "kind": "BlockEntrance", "block_id": 1,
+ "terminator": null, "term_kind": null,
+ "tag": null, "node_id": 1,
+ "has_report": 0, "is_sink": 0
+ }
+ ],
"program_state": {
"store": null,
"constraints": null,
@@ -102,12 +110,16 @@
// CHECK-SAME: </tr>
Node0x9 [shape=record,label=
"{
- { "node_id": 9,
- "pointer": "0x9",
- "has_report": false,
- "is_sink": false,
+ {
"state_id": 7,
- "program_points": [],
+ "program_points": [
+ {
+ "kind": "BlockEntrance", "block_id": 1,
+ "terminator": null, "term_kind": null,
+ "tag": null, "node_id": 1,
+ "has_report": 0, "is_sink": 0
+ }
+ ],
"program_state": {
"store": null,
"constraints": null,
diff --git a/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/escapes.c b/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/escapes.c
index 84de679..e0f8c50 100644
--- a/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/escapes.c
+++ b/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/escapes.c
@@ -9,10 +9,10 @@
// UNSUPPORTED: system-windows
void escapes() {
- // CHECK: <td align="left"><b>Store: </b></td>
+ // CHECK: <td align="left"><b>Store: </b> <font color="gray">(0x{{[0-9a-f]*}})</font></td>
// CHECK-SAME: <td align="left">foo</td><td align="left">0</td>
// CHECK-SAME: <td align="left">&Element\{"foo",0 S64b,char\}</td>
- // CHECK: <td align="left"><b>Environment: </b></td>
+ // CHECK: <td align="left"><b>Expressions: </b></td>
// CHECK-SAME: <td align="left">"foo"</td>
// CHECK-SAME: <td align="left">&Element\{"foo",0 S64b,char\}</td>
const char *const foo = "\x66\x6f\x6f";
diff --git a/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/explorers.dot b/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/explorers.dot
deleted file mode 100644
index 226c639..0000000
--- a/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/explorers.dot
+++ /dev/null
@@ -1,37 +0,0 @@
-// RUN: %exploded_graph_rewriter %s \
-// RUN: | FileCheck %s -check-prefixes=CHECK,BASIC
-// RUN: %exploded_graph_rewriter -s %s \
-// RUN: | FileCheck %s -check-prefixes=CHECK,SINGLE
-
-// FIXME: Substitution doesn't seem to work on Windows.
-// UNSUPPORTED: system-windows
-
-Node0x1 [shape=record,label=
- "{{ "node_id": 1, "pointer": "0x1", "has_report": false, "is_sink": false,
- "program_state": null, "program_points": []}\l}"];
-
-Node0x2 [shape=record,label=
- "{{ "node_id": 2, "pointer": "0x2", "has_report": false, "is_sink": false,
- "program_state": null, "program_points": []}\l}"];
-
-Node0x3 [shape=record,label=
- "{{ "node_id": 3, "pointer": "0x3", "has_report": false, "is_sink": false,
- "program_state": null, "program_points": []}\l}"];
-
-Node0x4 [shape=record,label=
- "{{ "node_id": 4, "pointer": "0x4", "has_report": false, "is_sink": false,
- "program_state": null, "program_points": []}\l}"];
-
-// CHECK: Node0x1 -> Node0x2;
-Node0x1 -> Node0x2;
-
-// BASIC: Node0x1 -> Node0x3;
-// SINGLE-NOT: Node0x1 -> Node0x3;
-Node0x1 -> Node0x3;
-
-// CHECK: Node0x2 -> Node0x4;
-Node0x2 -> Node0x4;
-
-// BASIC: Node0x3 -> Node0x4;
-// SINGLE-NOT: Node0x3 -> Node0x4;
-Node0x3 -> Node0x4;
diff --git a/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/initializers_under_construction.cpp b/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/initializers_under_construction.cpp
index 472627e..96df69f 100644
--- a/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/initializers_under_construction.cpp
+++ b/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/initializers_under_construction.cpp
@@ -20,6 +20,6 @@
void test() {
// CHECK: (construct into member variable)
// CHECK-SAME: <td align="left">a</td>
- // CHECK-SAME: <td align="left">&b->a</td>
+ // CHECK-SAME: <td align="left">&b.a</td>
B b;
}
diff --git a/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/lit.local.cfg b/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/lit.local.cfg
index dfeb0a8..87ce52c 100644
--- a/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/lit.local.cfg
+++ b/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/lit.local.cfg
@@ -8,7 +8,7 @@
config.test_format = lit.formats.ShTest(use_lit_shell == "0")
config.substitutions.append(('%exploded_graph_rewriter',
- '\'%s\' %s' % (
+ '\'%s\' %s --dump-dot-only' % (
config.python_executable,
lit.util.which('exploded-graph-rewriter.py',
os.path.join(
diff --git a/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/node_labels.dot b/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/node_labels.dot
index b8f6919..89d5070 100644
--- a/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/node_labels.dot
+++ b/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/node_labels.dot
@@ -13,32 +13,48 @@
// LIGHT: Node0x1 [shape=record,label=<
// DARK: Node0x1 [shape=record,color="white",fontcolor="gray80",label=<
// CHECK-SAME: <tr>
-// LIGHT-SAME: <td bgcolor="gray">
+// LIGHT-SAME: <td bgcolor="gray70">
// DARK-SAME: <td bgcolor="gray20">
-// CHECK-SAME: <b>Node 1 (0x1) - State Unspecified</b>
+// CHECK-SAME: <b>State 0</b>
// CHECK-SAME: </td>
// CHECK-SAME: </tr>
Node0x1 [shape=record,label=
"{
- { "node_id": 1, "pointer": "0x1", "has_report": false, "is_sink": false,
- "program_state": null,
- "program_points": []
+ { "state_id": 0, "program_state": null,
+ "program_points": [
+ {
+ "kind": "BlockEntrance", "block_id": 1,
+ "terminator": null, "term_kind": null,
+ "tag": null, "node_id": 1,
+ "has_report": 0, "is_sink": 0
+ }
+ ]
}
\l}"];
// CHECK: Node0x2 [
-// CHECK-SAME: <tr><td>
-// COLOR-SAME: <font color="red"><b>Bug Report Attached</b></font>
-// GRAY-SAME: <b>Bug Report Attached</b>
-// CHECK-SAME: </td></tr>
-// CHECK-SAME: <tr><td>
-// COLOR-SAME: <font color="cornflowerblue"><b>Sink Node</b></font>
-// GRAY-SAME: <b>Sink Node</b>
-// CHECK-SAME: </td></tr>
+// CHECK-SAME: <tr>
+// CHECK-SAME: <td colspan="3" align="left">
+// COLOR-SAME: <font color="red"><b>Bug Report Attached</b></font>
+// GRAY-SAME: <b>Bug Report Attached</b>
+// CHECK-SAME: </td>
+// CHECK-SAME: </tr>
+// CHECK-SAME: <tr>
+// CHECK-SAME: <td colspan="3" align="left">
+// COLOR-SAME: <font color="cornflowerblue"><b>Sink Node</b></font>
+// GRAY-SAME: <b>Sink Node</b>
+// CHECK-SAME: </td>
+// CHECK-SAME: </tr>
Node0x2 [shape=record,label=
"{
- { "node_id": 2, "pointer": "0x2", "has_report": true, "is_sink": true,
- "program_state": null,
- "program_points": []
+ { "state_id": 0, "program_state": null,
+ "program_points": [
+ {
+ "kind": "BlockEntrance", "block_id": 1,
+ "terminator": null, "term_kind": null,
+ "tag": null, "node_id": 2,
+ "has_report": 1, "is_sink": 1
+ }
+ ]
}
\l}"];
diff --git a/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/objects_under_construction.cpp b/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/objects_under_construction.cpp
index b3d4aef..e4d2562 100644
--- a/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/objects_under_construction.cpp
+++ b/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/objects_under_construction.cpp
@@ -1,5 +1,6 @@
// FIXME: Figure out how to use %clang_analyze_cc1 with our lit.local.cfg.
// RUN: %clang_cc1 -analyze -triple x86_64-unknown-linux-gnu \
+// RUN: -analyze-function "test()" \
// RUN: -analyzer-checker=core \
// RUN: -analyzer-dump-egraph=%t.dot %s
// RUN: %exploded_graph_rewriter %t.dot | FileCheck %s
diff --git a/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/program_points.dot b/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/program_points.dot
index 2f49d7f..bee48d0 100644
--- a/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/program_points.dot
+++ b/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/program_points.dot
@@ -28,22 +28,28 @@
// CHECK-SAME: </table>
Node0x1 [shape=record,label=
"{
- { "node_id": 1, "pointer": "0x1", "has_report": false, "is_sink": false,
- "program_state": null, "program_points": [
+ {
+ "state_id": 0, "program_state": null, "program_points": [
{
"kind": "Edge",
"src_id": 0,
"dst_id": 1,
"terminator": null,
"term_kind": null,
- "tag": null
+ "tag": null,
+ "node_id": 1,
+ "has_report": 0,
+ "is_sink": 0
},
{
"kind": "BlockEntrance",
"block_id": 1,
"terminator": null,
"term_kind": null,
- "tag": null
+ "tag": null,
+ "node_id": 2,
+ "has_report": 0,
+ "is_sink": 0
}
]}
\l}"];
@@ -72,10 +78,9 @@
// CHECK-SAME: </td>
// CHECK-SAME: </tr>
// CHECK-SAME: </table>
-Node0x2 [shape=record,label=
+Node0x3 [shape=record,label=
"{
- { "node_id": 2, "pointer": "0x2", "has_report": false, "is_sink": false,
- "program_state": null, "program_points": [
+ { "state_id": 0, "program_state": null, "program_points": [
{
"kind": "Statement",
"stmt_kind": "DeclRefExpr",
@@ -88,7 +93,11 @@
"line": 4,
"column": 5
},
- "tag": "ExprEngine : Clean Node"
+ "tag": "ExprEngine : Clean Node",
+ "node_id": 3,
+ "pointer": "0x3",
+ "has_report": 0,
+ "is_sink": 0
}
]}
\l}"];
@@ -97,10 +106,10 @@
// CHECK-NEXT: <b>Program point:</b>
// CHECK-SAME: <td align="left">\{ ... \}</td>
-Node0x3 [shape=record,label=
+Node0x4 [shape=record,label=
"{
- { "node_id": 3, "pointer": "0x3", "has_report": false, "is_sink": false,
- "program_state": null, "program_points": [
+ {
+ "state_id": 0, "program_state": null, "program_points": [
{
"kind": "Statement",
"stmt_kind": "CompoundStmt",
@@ -112,7 +121,60 @@
"line": 7,
"column": 8
},
- "tag": "ExprEngine : Clean Node"
+ "tag": "ExprEngine : Clean Node",
+ "node_id": 4,
+ "has_report": 0,
+ "is_sink": 0
+ }
+ ]}
+\l}"];
+
+// CHECK-NEXT: <b>Program point:</b>
+// CHECK-SAME: <table border="0" align="left" width="0">
+// CHECK-SAME: <tr>
+// CHECK-SAME: <td align="left" width="0">
+// CHECK-SAME: main.cpp:<b>8</b>:<b>9</b>:
+// CHECK-SAME: </td>
+// CHECK-SAME: <td align="left" width="0">
+// CHECK-SAME: <font color="cyan4">
+// CHECK-SAME: ImplicitCastExpr (LValueToRValue)
+// CHECK-SAME: </font>
+// CHECK-SAME: </td>
+// CHECK-SAME: <td align="left"><i>S5</i></td>
+// CHECK-SAME: <td align="left">
+// CHECK-SAME: <font color="cyan3">PreStmt</font>
+// CHECK-SAME: </td>
+// CHECK-SAME: <td align="left">y</td>
+// CHECK-SAME: </tr>
+// CHECK-SAME: <tr>
+// CHECK-SAME: <td width="0">
+// CHECK-SAME: </td>
+// CHECK-SAME: <td colspan="3" align="left">
+// CHECK-SAME: <b>Tag: </b>
+// CHECK-SAME: <font color="crimson">ExprEngine : Clean Node</font>
+// CHECK-SAME: </td>
+// CHECK-SAME: </tr>
+// CHECK-SAME: </table>
+Node0x5 [shape=record,label=
+ "{
+ { "state_id": 0, "program_state": null, "program_points": [
+ {
+ "kind": "Statement",
+ "stmt_kind": "ImplicitCastExpr",
+ "cast_kind": "LValueToRValue",
+ "stmt_point_kind": "PreStmt",
+ "stmt_id": 5,
+ "pointer": "0x6",
+ "pretty": "y",
+ "location": {
+ "file": "main.cpp",
+ "line": 8,
+ "column": 9
+ },
+ "tag": "ExprEngine : Clean Node",
+ "node_id": 5,
+ "has_report": 0,
+ "is_sink": 0
}
]}
\l}"];
diff --git a/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/store.dot b/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/store.dot
index d47a022..c92901c 100644
--- a/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/store.dot
+++ b/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/store.dot
@@ -4,6 +4,7 @@
// UNSUPPORTED: system-windows
// CHECK: <b>Store: </b>
+// CHECK-SAME: <font color="gray">(0x2)</font>
// CHECK-SAME: <table border="0">
// CHECK-SAME: <tr>
// CHECK-SAME: <td align="left">
@@ -22,12 +23,15 @@
// CHECK-SAME: </table>
Node0x1 [shape=record,label=
"{
- { "node_id": 1,
- "pointer": "0x1",
- "has_report": false,
- "is_sink": false,
- "state_id": 2,
- "program_points": [],
+ { "state_id": 2,
+ "program_points": [
+ {
+ "kind": "BlockEntrance", "block_id": 1,
+ "terminator": null, "term_kind": null,
+ "tag": null, "node_id": 1,
+ "has_report": 0, "is_sink": 0
+ }
+ ],
"program_state": {
"environment": null,
"constraints": null,
diff --git a/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/store_diff.dot b/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/store_diff.dot
index 94d1d8d..8dd5fb4 100644
--- a/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/store_diff.dot
+++ b/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/store_diff.dot
@@ -10,7 +10,14 @@
"has_report": false,
"is_sink": false,
"state_id": 2,
- "program_points": [],
+ "program_points": [
+ {
+ "kind": "BlockEntrance", "block_id": 1,
+ "terminator": null, "term_kind": null,
+ "tag": null, "node_id": 1,
+ "has_report": 0, "is_sink": 0
+ }
+ ],
"program_state": {
"environment": null,
"constraints": null,
@@ -55,12 +62,16 @@
// CHECK-SAME: </tr>
Node0x4 [shape=record,label=
"{
- { "node_id": 4,
- "pointer": "0x4",
- "has_report": false,
- "is_sink": false,
+ {
"state_id": 5,
- "program_points": [],
+ "program_points": [
+ {
+ "kind": "BlockEntrance", "block_id": 1,
+ "terminator": null, "term_kind": null,
+ "tag": null, "node_id": 1,
+ "has_report": 0, "is_sink": 0
+ }
+ ],
"program_state": {
"environment": null,
"constraints": null,
@@ -91,12 +102,16 @@
Node0x6 [shape=record,label=
"{
- { "node_id": 6,
- "pointer": "0x6",
- "has_report": false,
- "is_sink": false,
+ {
"state_id": 7,
- "program_points": [],
+ "program_points": [
+ {
+ "kind": "BlockEntrance", "block_id": 1,
+ "terminator": null, "term_kind": null,
+ "tag": null, "node_id": 1,
+ "has_report": 0, "is_sink": 0
+ }
+ ],
"program_state": null
}
\l}"];
diff --git a/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/topology.dot b/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/topology.dot
index fa1b10f..b85115e 100644
--- a/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/topology.dot
+++ b/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/topology.dot
@@ -12,12 +12,16 @@
// TOPOLOGY-NOT: Checker State
Node0x1 [shape=record,label=
"{
- { "node_id": 1,
- "pointer": "0x1",
- "has_report": false,
- "is_sink": false,
+ {
"state_id": 2,
- "program_points": [],
+ "program_points": [
+ {
+ "kind": "BlockEntrance", "block_id": 1,
+ "terminator": null, "term_kind": null,
+ "tag": null, "node_id": 1,
+ "has_report": 0, "is_sink": 0
+ }
+ ],
"program_state": {
"environment": null,
"constraints": null,
diff --git a/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/trimmers.dot b/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/trimmers.dot
new file mode 100644
index 0000000..df6270d
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/exploded-graph-rewriter/trimmers.dot
@@ -0,0 +1,71 @@
+// RUN: %exploded_graph_rewriter %s \
+// RUN: | FileCheck %s -check-prefixes=ONE,TWO,THREE,FOUR
+// RUN: %exploded_graph_rewriter -s %s \
+// RUN: | FileCheck %s -check-prefixes=ONE,TWO,NOTHREE,FOUR
+// RUN: %exploded_graph_rewriter --to=0x2 %s \
+// RUN: | FileCheck %s -check-prefixes=ONE,TWO,NOTHREE,NOFOUR
+// RUN: %exploded_graph_rewriter --to 2 %s \
+// RUN: | FileCheck %s -check-prefixes=ONE,TWO,NOTHREE,NOFOUR
+// RUN: %exploded_graph_rewriter --to 2,3 %s \
+// RUN: | FileCheck %s -check-prefixes=ONE,TWO,THREE,NOFOUR
+// RUN: %exploded_graph_rewriter --to 4 %s \
+// RUN: | FileCheck %s -check-prefixes=ONE,TWO,THREE,FOUR
+// RUN: %exploded_graph_rewriter --to 4 -s %s \
+// RUN: | FileCheck %s -check-prefixes=ONE,TWO,NOTHREE,FOUR
+
+// FIXME: Substitution doesn't seem to work on Windows.
+// UNSUPPORTED: system-windows
+
+Node0x1 [shape=record,label=
+ "{{ "state_id": 0, "program_state": null, "program_points": [
+ {
+ "kind": "BlockEntrance", "block_id": 1,
+ "terminator": null, "term_kind": null,
+ "tag": null, "node_id": 1,
+ "has_report": 0, "is_sink": 0
+ }
+ ]}\l}"];
+
+Node0x2 [shape=record,label=
+ "{{ "state_id": 0, "program_state": null, "program_points": [
+ {
+ "kind": "BlockEntrance", "block_id": 1,
+ "terminator": null, "term_kind": null,
+ "tag": null, "node_id": 2,
+ "has_report": 0, "is_sink": 0
+ }
+ ]}\l}"];
+
+Node0x3 [shape=record,label=
+ "{{ "state_id": 0, "program_state": null, "program_points": [
+ {
+ "kind": "BlockEntrance", "block_id": 1,
+ "terminator": null, "term_kind": null,
+ "tag": null, "node_id": 3,
+ "has_report": 0, "is_sink": 0
+ }
+ ]}\l}"];
+
+Node0x4 [shape=record,label=
+ "{{ "state_id": 0, "program_state": null, "program_points": [
+ {
+ "kind": "BlockEntrance", "block_id": 1,
+ "terminator": null, "term_kind": null,
+ "tag": null, "node_id": 4,
+ "has_report": 0, "is_sink": 0
+ }
+ ]}\l}"];
+
+Node0x1 -> Node0x2;
+Node0x1 -> Node0x3;
+Node0x2 -> Node0x4;
+Node0x3 -> Node0x4;
+
+// ONE: Node0x1
+// NOTONE-NOT: Node0x1
+// TWO: Node0x2
+// NOTTWO-NOT: Node0x2
+// THREE: Node0x3
+// NOTTHREE-NOT: Node0x3
+// FOUR: Node0x4
+// NOTFOUR-NOT: Node0x4
diff --git a/src/llvm-project/clang/test/Analysis/expr-inspection.c b/src/llvm-project/clang/test/Analysis/expr-inspection.c
index c2bcafe..283fa9b 100644
--- a/src/llvm-project/clang/test/Analysis/expr-inspection.c
+++ b/src/llvm-project/clang/test/Analysis/expr-inspection.c
@@ -5,6 +5,7 @@
// Self-tests for the debug.ExprInspection checker.
void clang_analyzer_dump(int x);
+void clang_analyzer_dump_pointer(int *p);
void clang_analyzer_printState();
void clang_analyzer_numTimesReached();
@@ -30,7 +31,7 @@
// CHECK-NEXT: ]}
// CHECK-NEXT: ]},
// CHECK-NEXT: "environment": { "pointer": "{{0x[0-9a-f]+}}", "items": [
-// CHECK-NEXT: { "lctx_id": 1, "location_context": "#0 Call", "calling": "foo", "location": null, "items": [
+// CHECK-NEXT: { "lctx_id": {{[0-9]+}}, "location_context": "#0 Call", "calling": "foo", "location": null, "items": [
// CHECK-NEXT: { "stmt_id": {{[0-9]+}}, "pretty": "clang_analyzer_printState", "value": "&code{clang_analyzer_printState}" }
// CHECK-NEXT: ]}
// CHECK-NEXT: ]},
@@ -38,7 +39,16 @@
// CHECK-NEXT: { "symbol": "reg_$0<int x>", "range": "{ [-2147483648, 13] }" }
// CHECK-NEXT: ],
// CHECK-NEXT: "dynamic_types": null,
+// CHECK-NEXT: "dynamic_casts": null,
// CHECK-NEXT: "constructing_objects": null,
// CHECK-NEXT: "checker_messages": null
// CHECK-NEXT: }
+struct S {
+ int x, y;
+};
+
+void test_field_dumps(struct S s, struct S *p) {
+ clang_analyzer_dump_pointer(&s.x); // expected-warning{{&s.x}}
+ clang_analyzer_dump_pointer(&p->x); // expected-warning{{&SymRegion{reg_$1<struct S * p>}.x}}
+}
diff --git a/src/llvm-project/clang/test/Analysis/fuchsia_handle.cpp b/src/llvm-project/clang/test/Analysis/fuchsia_handle.cpp
new file mode 100644
index 0000000..0543eb9
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/fuchsia_handle.cpp
@@ -0,0 +1,329 @@
+// RUN: %clang_analyze_cc1 -analyzer-checker=core,fuchsia.HandleChecker -analyzer-output=text \
+// RUN: -verify %s
+
+typedef __typeof__(sizeof(int)) size_t;
+typedef int zx_status_t;
+typedef __typeof__(sizeof(int)) zx_handle_t;
+typedef unsigned int uint32_t;
+#define NULL ((void *)0)
+#define ZX_HANDLE_INVALID 0
+
+#if defined(__clang__)
+#define ZX_HANDLE_ACQUIRE __attribute__((acquire_handle("Fuchsia")))
+#define ZX_HANDLE_RELEASE __attribute__((release_handle("Fuchsia")))
+#define ZX_HANDLE_USE __attribute__((use_handle("Fuchsia")))
+#else
+#define ZX_HANDLE_ACQUIRE
+#define ZX_HANDLE_RELEASE
+#define ZX_HANDLE_USE
+#endif
+
+zx_status_t zx_channel_create(
+ uint32_t options,
+ zx_handle_t *out0 ZX_HANDLE_ACQUIRE,
+ zx_handle_t *out1 ZX_HANDLE_ACQUIRE);
+
+zx_status_t zx_handle_close(
+ zx_handle_t handle ZX_HANDLE_RELEASE);
+
+void escape1(zx_handle_t *in);
+void escape2(zx_handle_t in);
+void (*escape3)(zx_handle_t) = escape2;
+
+void use1(const zx_handle_t *in ZX_HANDLE_USE);
+void use2(zx_handle_t in ZX_HANDLE_USE);
+
+void moreArgs(zx_handle_t, int, ...);
+void lessArgs(zx_handle_t, int a = 5);
+
+// To test if argument indexes are OK for operator calls.
+struct MyType {
+ ZX_HANDLE_ACQUIRE
+ zx_handle_t operator+(zx_handle_t ZX_HANDLE_RELEASE replace);
+};
+
+void checkInvalidHandle01() {
+ zx_handle_t sa, sb;
+ zx_channel_create(0, &sa, &sb);
+ if (sa == ZX_HANDLE_INVALID)
+ ;
+ // Will we ever see a warning like below?
+ // We eagerly replace the symbol with a constant and lose info...
+ use2(sa); // TODOexpected-warning {{Use of an invalid handle}}
+ zx_handle_close(sb);
+ zx_handle_close(sa);
+}
+
+void checkInvalidHandle2() {
+ zx_handle_t sa, sb;
+ zx_channel_create(0, &sa, &sb);
+ if (sb != ZX_HANDLE_INVALID)
+ zx_handle_close(sb);
+ if (sa != ZX_HANDLE_INVALID)
+ zx_handle_close(sa);
+}
+
+void checkNoCrash01() {
+ zx_handle_t sa, sb;
+ zx_channel_create(0, &sa, &sb);
+ moreArgs(sa, 1, 2, 3, 4, 5);
+ lessArgs(sa);
+ zx_handle_close(sa);
+ zx_handle_close(sb);
+}
+
+void checkNoLeak01() {
+ zx_handle_t sa, sb;
+ zx_channel_create(0, &sa, &sb);
+ zx_handle_close(sa);
+ zx_handle_close(sb);
+}
+
+void checkNoLeak02() {
+ zx_handle_t ay[2];
+ zx_channel_create(0, &ay[0], &ay[1]);
+ zx_handle_close(ay[0]);
+ zx_handle_close(ay[1]);
+}
+
+void checkNoLeak03() {
+ zx_handle_t ay[2];
+ zx_channel_create(0, &ay[0], &ay[1]);
+ for (int i = 0; i < 2; i++)
+ zx_handle_close(ay[i]);
+}
+
+zx_handle_t checkNoLeak04() {
+ zx_handle_t sa, sb;
+ zx_channel_create(0, &sa, &sb);
+ zx_handle_close(sa);
+ return sb; // no warning
+}
+
+zx_handle_t checkNoLeak05(zx_handle_t *out1) {
+ zx_handle_t sa, sb;
+ zx_channel_create(0, &sa, &sb);
+ *out1 = sa;
+ return sb; // no warning
+}
+
+void checkNoLeak06() {
+ zx_handle_t sa, sb;
+ if (zx_channel_create(0, &sa, &sb))
+ return;
+ zx_handle_close(sa);
+ zx_handle_close(sb);
+}
+
+void checkLeak01(int tag) {
+ zx_handle_t sa, sb;
+ if (zx_channel_create(0, &sa, &sb)) // expected-note {{Handle allocated here}}
+ return; // expected-note@-1 {{Assuming the condition is false}}
+ // expected-note@-2 {{Taking false branch}}
+ use1(&sa);
+ if (tag) // expected-note {{Assuming 'tag' is 0}}
+ zx_handle_close(sa);
+ // expected-note@-2 {{Taking false branch}}
+ use2(sb); // expected-warning {{Potential leak of handle}}
+ // expected-note@-1 {{Potential leak of handle}}
+ zx_handle_close(sb);
+}
+
+void checkReportLeakOnOnePath(int tag) {
+ zx_handle_t sa, sb;
+ if (zx_channel_create(0, &sa, &sb)) // expected-note {{Handle allocated here}}
+ return; // expected-note@-1 {{Assuming the condition is false}}
+ // expected-note@-2 {{Taking false branch}}
+ zx_handle_close(sb);
+ switch(tag) { // expected-note {{Control jumps to the 'default' case at line}}
+ case 0:
+ use2(sa);
+ return;
+ case 1:
+ use2(sa);
+ return;
+ case 2:
+ use2(sa);
+ return;
+ case 3:
+ use2(sa);
+ return;
+ case 4:
+ use2(sa);
+ return;
+ default:
+ use2(sa);
+ return; // expected-warning {{Potential leak of handle}}
+ // expected-note@-1 {{Potential leak of handle}}
+ }
+}
+
+void checkDoubleRelease01(int tag) {
+ zx_handle_t sa, sb;
+ zx_channel_create(0, &sa, &sb);
+ // expected-note@-1 {{Handle allocated here}}
+ if (tag) // expected-note {{Assuming 'tag' is not equal to 0}}
+ zx_handle_close(sa); // expected-note {{Handle released here}}
+ // expected-note@-2 {{Taking true branch}}
+ zx_handle_close(sa); // expected-warning {{Releasing a previously released handle}}
+ // expected-note@-1 {{Releasing a previously released handle}}
+ zx_handle_close(sb);
+}
+
+void checkUseAfterFree01(int tag) {
+ zx_handle_t sa, sb;
+ zx_channel_create(0, &sa, &sb);
+ // expected-note@-1 {{Handle allocated here}}
+ // expected-note@-2 {{Handle allocated here}}
+ // expected-note@+2 {{Taking true branch}}
+ // expected-note@+1 {{Taking false branch}}
+ if (tag) {
+ // expected-note@-1 {{Assuming 'tag' is not equal to 0}}
+ zx_handle_close(sa); // expected-note {{Handle released here}}
+ use1(&sa); // expected-warning {{Using a previously released handle}}
+ // expected-note@-1 {{Using a previously released handle}}
+ }
+ // expected-note@-6 {{Assuming 'tag' is 0}}
+ zx_handle_close(sb); // expected-note {{Handle released here}}
+ use2(sb); // expected-warning {{Using a previously released handle}}
+ // expected-note@-1 {{Using a previously released handle}}
+}
+
+void checkMemberOperatorIndices() {
+ zx_handle_t sa, sb, sc;
+ zx_channel_create(0, &sa, &sb);
+ zx_handle_close(sb);
+ MyType t;
+ sc = t + sa;
+ zx_handle_close(sc);
+}
+
+// RAII
+
+template <typename T>
+struct HandleWrapper {
+ ~HandleWrapper() { close(); }
+ void close() {
+ if (handle != ZX_HANDLE_INVALID)
+ zx_handle_close(handle);
+ }
+ T *get_handle_address() { return &handle; }
+private:
+ T handle;
+};
+
+void doNotWarnOnRAII() {
+ HandleWrapper<zx_handle_t> w1;
+ zx_handle_t sb;
+ if (zx_channel_create(0, w1.get_handle_address(), &sb))
+ return;
+ zx_handle_close(sb);
+}
+
+template <typename T>
+struct HandleWrapperUnkonwDtor {
+ ~HandleWrapperUnkonwDtor();
+ void close() {
+ if (handle != ZX_HANDLE_INVALID)
+ zx_handle_close(handle);
+ }
+ T *get_handle_address() { return &handle; }
+private:
+ T handle;
+};
+
+void doNotWarnOnUnkownDtor() {
+ HandleWrapperUnkonwDtor<zx_handle_t> w1;
+ zx_handle_t sb;
+ if (zx_channel_create(0, w1.get_handle_address(), &sb))
+ return;
+ zx_handle_close(sb);
+}
+
+// Various escaping scenarios
+
+zx_handle_t *get_handle_address();
+
+void escape_store_to_escaped_region01() {
+ zx_handle_t sb;
+ if (zx_channel_create(0, get_handle_address(), &sb))
+ return;
+ zx_handle_close(sb);
+}
+
+struct object {
+ zx_handle_t *get_handle_address();
+};
+
+void escape_store_to_escaped_region02(object &o) {
+ zx_handle_t sb;
+ // Same as above.
+ if (zx_channel_create(0, o.get_handle_address(), &sb))
+ return;
+ zx_handle_close(sb);
+}
+
+void escape_store_to_escaped_region03(object o) {
+ zx_handle_t sb;
+ // Should we consider the pointee of get_handle_address escaped?
+ // Maybe we only should it consider escaped if o escapes?
+ if (zx_channel_create(0, o.get_handle_address(), &sb))
+ return;
+ zx_handle_close(sb);
+}
+
+void escape_through_call(int tag) {
+ zx_handle_t sa, sb;
+ if (zx_channel_create(0, &sa, &sb))
+ return;
+ escape1(&sa);
+ if (tag)
+ escape2(sb);
+ else
+ escape3(sb);
+}
+
+struct have_handle {
+ zx_handle_t h;
+ zx_handle_t *hp;
+};
+
+void escape_through_store01(have_handle *handle) {
+ zx_handle_t sa;
+ if (zx_channel_create(0, &sa, handle->hp))
+ return;
+ handle->h = sa;
+}
+
+have_handle global;
+void escape_through_store02() {
+ zx_handle_t sa;
+ if (zx_channel_create(0, &sa, global.hp))
+ return;
+ global.h = sa;
+}
+
+have_handle escape_through_store03() {
+ zx_handle_t sa, sb;
+ if (zx_channel_create(0, &sa, &sb))
+ return {0, nullptr};
+ zx_handle_close(sb);
+ return {sa, nullptr};
+}
+
+void escape_structs(have_handle *);
+void escape_transitively01() {
+ zx_handle_t sa, sb;
+ if (zx_channel_create(0, &sa, &sb))
+ return;
+ have_handle hs[2];
+ hs[1] = {sa, &sb};
+ escape_structs(hs);
+}
+
+void escape_top_level_pointees(zx_handle_t *h) {
+ zx_handle_t h2;
+ if (zx_channel_create(0, h, &h2))
+ return;
+ zx_handle_close(h2);
+} // *h should be escaped here. Right?
diff --git a/src/llvm-project/clang/test/Analysis/func-mapping-test.cpp b/src/llvm-project/clang/test/Analysis/func-mapping-test.cpp
index f6eeb26..5c04d94 100644
--- a/src/llvm-project/clang/test/Analysis/func-mapping-test.cpp
+++ b/src/llvm-project/clang/test/Analysis/func-mapping-test.cpp
@@ -41,3 +41,10 @@
};
U u = {.a = 6};
// CHECK-DAG: c:@u
+
+// No USR can be generated for this.
+// Check for no crash in this case.
+static union {
+ float uf;
+ const int ui;
+};
diff --git a/src/llvm-project/clang/test/Analysis/globals.cpp b/src/llvm-project/clang/test/Analysis/globals.cpp
index d3df6eb..fc74161 100644
--- a/src/llvm-project/clang/test/Analysis/globals.cpp
+++ b/src/llvm-project/clang/test/Analysis/globals.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify -std=c++2a %s
static const unsigned long long scull = 0;
diff --git a/src/llvm-project/clang/test/Analysis/handle_constructors_for_default_arguments.cpp b/src/llvm-project/clang/test/Analysis/handle_constructors_for_default_arguments.cpp
new file mode 100644
index 0000000..c54d865
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/handle_constructors_for_default_arguments.cpp
@@ -0,0 +1,116 @@
+// RUN: %clang_cc1 -fsyntax-only -analyze \
+// RUN: -analyzer-checker=core,debug.ExprInspection %s -verify
+
+// These test cases demonstrate lack of Static Analyzer features.
+// The FIXME: tags indicate where we expect different output.
+
+// Handle constructors for default arguments.
+// Default arguments in C++ are recomputed at every call,
+// and are therefore local, and not static, variables.
+void clang_analyzer_eval(bool);
+void clang_analyzer_warnIfReached();
+
+struct init_with_list {
+ int a;
+ init_with_list() : a(1) {}
+};
+
+struct init_in_body {
+ int a;
+ init_in_body() { a = 1; }
+};
+
+struct init_default_member {
+ int a = 1;
+};
+
+struct basic_struct {
+ int a;
+};
+
+// Top-level analyzed functions.
+void top_f(init_with_list l = init_with_list()) {
+ // We expect that the analyzer doesn't assume anything about the parameter.
+ clang_analyzer_eval(l.a == 1); // expected-warning {{TRUE}} expected-warning {{FALSE}}
+}
+
+void top_g(init_in_body l = init_in_body()) {
+ // We expect that the analyzer doesn't assume anything about the parameter.
+ clang_analyzer_eval(l.a == 1); // expected-warning {{TRUE}} expected-warning {{FALSE}}
+}
+
+void top_h(init_default_member l = init_default_member()) {
+ // We expect that the analyzer doesn't assume anything about the parameter.
+ clang_analyzer_eval(l.a == 1); // expected-warning {{TRUE}} expected-warning {{FALSE}}
+}
+
+// Not-top-level analyzed functions.
+int called_f(init_with_list l = init_with_list()) {
+ // We expect that the analyzer assumes the default value
+ // when called from test2().
+ return l.a;
+}
+
+int called_g(init_in_body l = init_in_body()) {
+ // We expect that the analyzer assumes the default value
+ // when called from test3().
+ return l.a;
+}
+
+int called_h(init_default_member l = init_default_member()) {
+ // We expect that the analyzer assumes the default value
+ // when called from test4().
+ return l.a;
+}
+
+int called_i(const init_with_list &l = init_with_list()){
+ // We expect that the analyzer assumes the default value
+ // when called from test5().
+ return l.a;
+}
+
+int called_j(init_with_list &&l = init_with_list()){
+ // We expect that the analyzer assumes the default value
+ // when called from test6().
+ return l.a;
+}
+
+int plain_parameter_passing(basic_struct l) {
+ return l.a;
+}
+
+void test1() {
+ basic_struct b;
+ b.a = 1;
+ clang_analyzer_eval(plain_parameter_passing(b) == 1); //expected-warning {{TRUE}}
+}
+
+void test2() {
+ // We expect that the analyzer assumes the default value.
+ // FIXME: Should be TRUE.
+ clang_analyzer_eval(called_f() == 1); //expected-warning {{TRUE}} expected-warning {{FALSE}}
+}
+
+void test3() {
+ // We expect that the analyzer assumes the default value.
+ // FIXME: Should be TRUE.
+ clang_analyzer_eval(called_g() == 1); //expected-warning {{TRUE}} expected-warning {{FALSE}}
+}
+
+void test4() {
+ // We expect that the analyzer assumes the default value.
+ // FIXME: Should be TRUE.
+ clang_analyzer_eval(called_h() == 1); //expected-warning {{TRUE}} expected-warning {{FALSE}}
+}
+
+void test5() {
+ //We expect that the analyzer assumes the default value.
+ // FIXME: Should be TRUE.
+ clang_analyzer_eval(called_i() == 1); //expected-warning {{TRUE}} expected-warning {{FALSE}}
+}
+
+void test6() {
+ // We expect that the analyzer assumes the default value.
+ // FIXME: Should be TRUE.
+ clang_analyzer_eval(called_j() == 1); //expected-warning {{TRUE}} expected-warning {{FALSE}}
+}
diff --git a/src/llvm-project/clang/test/Analysis/handle_constructors_with_new_array.cpp b/src/llvm-project/clang/test/Analysis/handle_constructors_with_new_array.cpp
new file mode 100644
index 0000000..61637af
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/handle_constructors_with_new_array.cpp
@@ -0,0 +1,86 @@
+// RUN: %clang_cc1 -fsyntax-only -analyze \
+// RUN: -analyzer-checker=core,debug.ExprInspection %s -verify
+
+// These test cases demonstrate lack of Static Analyzer features.
+// The FIXME: tags indicate where we expect different output.
+
+// Handle constructors within new[].
+
+// When an array of objects is allocated using the operator new[],
+// constructors for all elements of the array are called.
+// We should model (potentially some of) such evaluations,
+// and the same applies for destructors called from operator delete[].
+
+void clang_analyzer_eval(bool);
+
+struct init_with_list {
+ int a;
+ init_with_list() : a(1) {}
+};
+
+struct init_in_body {
+ int a;
+ init_in_body() { a = 1; }
+};
+
+struct init_default_member {
+ int a = 1;
+};
+
+void test_automatic() {
+
+ init_with_list a1;
+ init_in_body a2;
+ init_default_member a3;
+
+ clang_analyzer_eval(a1.a == 1); // expected-warning {{TRUE}}
+ clang_analyzer_eval(a2.a == 1); // expected-warning {{TRUE}}
+ clang_analyzer_eval(a3.a == 1); // expected-warning {{TRUE}}
+}
+
+void test_dynamic() {
+
+ auto *a1 = new init_with_list;
+ auto *a2 = new init_in_body;
+ auto *a3 = new init_default_member;
+
+ clang_analyzer_eval(a1->a == 1); // expected-warning {{TRUE}}
+ clang_analyzer_eval(a2->a == 1); // expected-warning {{TRUE}}
+ clang_analyzer_eval(a3->a == 1); // expected-warning {{TRUE}}
+
+ delete a1;
+ delete a2;
+ delete a3;
+}
+
+void test_automatic_aggregate() {
+
+ init_with_list a1[1];
+ init_in_body a2[1];
+ init_default_member a3[1];
+
+ // FIXME: Should be TRUE, not FALSE.
+ clang_analyzer_eval(a1[0].a == 1); // expected-warning {{TRUE}} expected-warning {{FALSE}}
+ // FIXME: Should be TRUE, not FALSE.
+ clang_analyzer_eval(a2[0].a == 1); // expected-warning {{TRUE}} expected-warning {{FALSE}}
+ // FIXME: Should be TRUE, not FALSE.
+ clang_analyzer_eval(a3[0].a == 1); // expected-warning {{TRUE}} expected-warning {{FALSE}}
+}
+
+void test_dynamic_aggregate() {
+
+ auto *a1 = new init_with_list[1];
+ auto *a2 = new init_in_body[1];
+ auto *a3 = new init_default_member[1];
+
+ // FIXME: Should be TRUE, not FALSE.
+ clang_analyzer_eval(a1[0].a == 1); // expected-warning {{TRUE}} expected-warning {{FALSE}}
+ // FIXME: Should be TRUE, not FALSE.
+ clang_analyzer_eval(a2[0].a == 1); // expected-warning {{TRUE}} expected-warning {{FALSE}}
+ // FIXME: Should be TRUE, not FALSE.
+ clang_analyzer_eval(a3[0].a == 1); // expected-warning {{TRUE}} expected-warning {{FALSE}}
+
+ delete[] a1;
+ delete[] a2;
+ delete[] a3;
+}
diff --git a/src/llvm-project/clang/test/Analysis/html_diagnostics/td-hotfix.c b/src/llvm-project/clang/test/Analysis/html_diagnostics/td-hotfix.c
new file mode 100644
index 0000000..8595642
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/html_diagnostics/td-hotfix.c
@@ -0,0 +1,31 @@
+// RUN: rm -fR %t
+// RUN: mkdir %t
+// RUN: %clang_analyze_cc1 -analyzer-checker=core \
+// RUN: -analyzer-output=html -o %t -verify %s
+// RUN: cat %t/report-*.html | FileCheck %s
+
+void bar(int);
+
+void foo() {
+ int a;
+ bar(a); // expected-warning{{1st function call argument is an uninitialized value}}
+}
+
+// CHECK-LABEL: <div id="EndPath" class="msg msgEvent" style="margin-left:3ex">
+// CHECK-SAME: <table class="msgT">
+// CHECK-SAME: <tr>
+// CHECK-SAME: <td valign="top">
+// CHECK-SAME: <div class="PathIndex PathIndexEvent">2</div>
+// CHECK-SAME: </td>
+// CHECK-SAME: <td>
+// CHECK-SAME: <div class="PathNav">
+// CHECK-SAME: <a href="#Path1" title="Previous event (1)">←</a>
+// CHECK-SAME: </div>
+// CHECK-SAME: </td>
+// CHECK-NOT: </td>
+// CHECK-SAME: <td>
+// CHECK-SAME: 1st function call argument is an uninitialized value
+// CHECK-SAME: </td>
+// CHECK-SAME: </tr>
+// CHECK-SAME: </table>
+// CHECK-SAME: </div>
diff --git a/src/llvm-project/clang/test/Analysis/html_diagnostics/variable-popups-macro.c b/src/llvm-project/clang/test/Analysis/html_diagnostics/variable-popups-macro.c
new file mode 100644
index 0000000..83bda14
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/html_diagnostics/variable-popups-macro.c
@@ -0,0 +1,28 @@
+// RUN: rm -fR %t
+// RUN: mkdir %t
+// RUN: %clang_analyze_cc1 -analyzer-checker=core \
+// RUN: -analyzer-output=html -o %t -verify %s
+// RUN: cat %t/report-*.html | FileCheck %s
+
+void bar(int);
+
+#define MACRO if (b)
+
+void foo2() {
+ int a;
+ int b = 1;
+ MACRO
+ bar(a); // expected-warning{{1st function call argument is an uninitialized value}}
+}
+
+// For now we don't emit popups inside macros due to UI limitations.
+// Once we do, we should test it thoroughly.
+
+// CHECK-LABEL: <tr class="codeline" data-linenumber="14">
+// CHECK-NOT: <span class='variable'>
+// CHECK-SAME: <span class='macro'>
+// CHECK-SAME: MACRO
+// CHECK-SAME: <span class='macro_popup'>
+// CHECK-SAME: if (b)
+// CHECK-SAME: </span>
+// CHECK-SAME: </span>
diff --git a/src/llvm-project/clang/test/Analysis/html_diagnostics/variable-popups-multiple.c b/src/llvm-project/clang/test/Analysis/html_diagnostics/variable-popups-multiple.c
new file mode 100644
index 0000000..d7a05b5
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/html_diagnostics/variable-popups-multiple.c
@@ -0,0 +1,29 @@
+// RUN: rm -fR %t
+// RUN: mkdir %t
+// RUN: %clang_analyze_cc1 -analyzer-checker=core \
+// RUN: -analyzer-output=html -o %t -verify %s
+// RUN: cat %t/report-*.html | FileCheck %s
+
+void bar(int);
+
+void foo() {
+ int a;
+ for (unsigned i = 0; i < 3; ++i)
+ if (i)
+ bar(a); // expected-warning{{1st function call argument is an uninitialized value}}
+}
+
+// CHECK: <span class='variable'>i
+// CHECK-SAME: <table class='variable_popup'><tbody><tr>
+// CHECK-SAME: <td valign='top'>
+// CHECK-SAME: <div class='PathIndex PathIndexPopUp'>2.1</div>
+// CHECK-SAME: </td>
+// CHECK-SAME: <td>'i' is 0</td>
+// CHECK-SAME: </tr>
+// CHECK-SAME: <tr>
+// CHECK-SAME: <td valign='top'>
+// CHECK-SAME: <div class='PathIndex PathIndexPopUp'>4.1</div>
+// CHECK-SAME: </td>
+// CHECK-SAME: <td>'i' is 1</td>
+// CHECK-SAME: </tr></tbody></table>
+// CHECK-SAME: </span>
diff --git a/src/llvm-project/clang/test/Analysis/html_diagnostics/variable-popups-simple.c b/src/llvm-project/clang/test/Analysis/html_diagnostics/variable-popups-simple.c
new file mode 100644
index 0000000..cb2f3bf
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/html_diagnostics/variable-popups-simple.c
@@ -0,0 +1,23 @@
+// RUN: rm -fR %t
+// RUN: mkdir %t
+// RUN: %clang_analyze_cc1 -analyzer-checker=core \
+// RUN: -analyzer-output=html -o %t -verify %s
+// RUN: cat %t/report-*.html | FileCheck %s
+
+void bar(int);
+
+void foo2() {
+ int a;
+ int b = 1;
+ if (b)
+ bar(a); // expected-warning{{1st function call argument is an uninitialized value}}
+}
+
+// CHECK: <span class='variable'>b
+// CHECK-SAME: <table class='variable_popup'><tbody><tr>
+// CHECK-SAME: <td valign='top'>
+// CHECK-SAME: <div class='PathIndex PathIndexPopUp'>1.1</div>
+// CHECK-SAME: </td>
+// CHECK-SAME: <td>'b' is 1</td>
+// CHECK-SAME: </tr></tbody></table>
+// CHECK-SAME: </span>
diff --git a/src/llvm-project/clang/test/Analysis/initialization.cpp b/src/llvm-project/clang/test/Analysis/initialization.cpp
index db76593..dd622e0 100644
--- a/src/llvm-project/clang/test/Analysis/initialization.cpp
+++ b/src/llvm-project/clang/test/Analysis/initialization.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze -analyzer-checker=core.builtin,debug.ExprInspection -verify %s
+// RUN: %clang_cc1 -std=c++14 -triple i386-apple-darwin10 -analyze -analyzer-checker=core.builtin,debug.ExprInspection -verify %s
void clang_analyzer_eval(int);
diff --git a/src/llvm-project/clang/test/Analysis/initializers-cfg-output.cpp b/src/llvm-project/clang/test/Analysis/initializers-cfg-output.cpp
index f833864..14c1b1e 100644
--- a/src/llvm-project/clang/test/Analysis/initializers-cfg-output.cpp
+++ b/src/llvm-project/clang/test/Analysis/initializers-cfg-output.cpp
@@ -126,14 +126,13 @@
// WARNINGS-NEXT: 5: (CXXConstructExpr, class A)
// ANALYZER-NEXT: 5: (CXXConstructExpr, A() (Base initializer), class A)
// CHECK-NEXT: 6: A([B1.5]) (Base initializer)
-// CHECK-NEXT: 7: /*implicit*/(int)0
-// CHECK-NEXT: 8: i([B1.7]) (Member initializer)
-// CHECK-NEXT: 9: this
-// CHECK-NEXT: 10: [B1.9]->i
-// CHECK-NEXT: 11: r([B1.10]) (Member initializer)
-// WARNINGS-NEXT: 12: (CXXConstructExpr, class A)
-// ANALYZER-NEXT: 12: (CXXConstructExpr, [B1.13], class A)
-// CHECK-NEXT: 13: A a;
+// CHECK-NEXT: 7: i(/*implicit*/(int)0) (Member initializer)
+// CHECK-NEXT: 8: this
+// CHECK-NEXT: 9: [B1.8]->i
+// CHECK-NEXT: 10: r([B1.9]) (Member initializer)
+// WARNINGS-NEXT: 11: (CXXConstructExpr, class A)
+// ANALYZER-NEXT: 11: (CXXConstructExpr, [B1.12], class A)
+// CHECK-NEXT: 12: A a;
// CHECK-NEXT: Preds (2): B2 B3
// CHECK-NEXT: Succs (1): B0
// CHECK: [B2]
diff --git a/src/llvm-project/clang/test/Analysis/inlining/placement-new-fp-suppression.cpp b/src/llvm-project/clang/test/Analysis/inlining/placement-new-fp-suppression.cpp
index 5f75411..5a99ad1 100644
--- a/src/llvm-project/clang/test/Analysis/inlining/placement-new-fp-suppression.cpp
+++ b/src/llvm-project/clang/test/Analysis/inlining/placement-new-fp-suppression.cpp
@@ -1,8 +1,8 @@
-// RUN: %clang_analyze_cc1 \
+// RUN: %clang_analyze_cc1 -std=c++14 \
// RUN: -analyzer-checker=core.CallAndMessage \
// RUN: -analyzer-config suppress-null-return-paths=false \
// RUN: -verify %s
-// RUN: %clang_analyze_cc1 \
+// RUN: %clang_analyze_cc1 -std=c++14 \
// RUN: -analyzer-checker=core.CallAndMessage \
// RUN: -DSUPPRESSED \
// RUN: -verify %s
diff --git a/src/llvm-project/clang/test/Analysis/inner-pointer.cpp b/src/llvm-project/clang/test/Analysis/inner-pointer.cpp
index f4646c2..d8b011a 100644
--- a/src/llvm-project/clang/test/Analysis/inner-pointer.cpp
+++ b/src/llvm-project/clang/test/Analysis/inner-pointer.cpp
@@ -1,4 +1,5 @@
-// RUN: %clang_analyze_cc1 -analyzer-checker=cplusplus.InnerPointer \
+// RUN: %clang_analyze_cc1 -std=c++14 -analyzer-checker=cplusplus.InnerPointer \
+// RUN: -Wno-dangling -Wno-dangling-field -Wno-return-stack-address \
// RUN: %s -analyzer-output=text -verify
#include "Inputs/system-header-simulator-cxx.h"
diff --git a/src/llvm-project/clang/test/Analysis/invalidated-iterator.cpp b/src/llvm-project/clang/test/Analysis/invalidated-iterator.cpp
index 1151838..a9ccc3b 100644
--- a/src/llvm-project/clang/test/Analysis/invalidated-iterator.cpp
+++ b/src/llvm-project/clang/test/Analysis/invalidated-iterator.cpp
@@ -3,397 +3,120 @@
#include "Inputs/system-header-simulator-cxx.h"
-void bad_copy_assign_operator_list1(std::list<int> &L1,
- const std::list<int> &L2) {
- auto i0 = L1.cbegin();
- L1 = L2;
- *i0; // expected-warning{{Invalidated iterator accessed}}
+void clang_analyzer_warnIfReached();
+
+void normal_dereference(std::vector<int> &V) {
+ auto i = V.cbegin();
+ *i; // no-warning
}
-void bad_copy_assign_operator_vector1(std::vector<int> &V1,
- const std::vector<int> &V2) {
- auto i0 = V1.cbegin();
- V1 = V2;
- *i0; // expected-warning{{Invalidated iterator accessed}}
+void invalidated_dereference(std::vector<int> &V) {
+ auto i = V.cbegin();
+ V.erase(i);
+ *i; // expected-warning{{Invalidated iterator accessed}}
}
-void bad_copy_assign_operator_deque1(std::deque<int> &D1,
- const std::deque<int> &D2) {
- auto i0 = D1.cbegin();
- D1 = D2;
- *i0; // expected-warning{{Invalidated iterator accessed}}
+void normal_prefix_increment(std::vector<int> &V) {
+ auto i = V.cbegin();
+ ++i; // no-warning
}
-void bad_copy_assign_operator_forward_list1(std::forward_list<int> &FL1,
- const std::forward_list<int> &FL2) {
- auto i0 = FL1.cbegin();
- FL1 = FL2;
- *i0; // expected-warning{{Invalidated iterator accessed}}
+void invalidated_prefix_increment(std::vector<int> &V) {
+ auto i = V.cbegin();
+ V.erase(i);
+ ++i; // expected-warning{{Invalidated iterator accessed}}
}
-void bad_assign_list1(std::list<int> &L, int n) {
- auto i0 = L.cbegin();
- L.assign(10, n);
- *i0; // expected-warning{{Invalidated iterator accessed}}
+void normal_prefix_decrement(std::vector<int> &V) {
+ auto i = ++V.cbegin();
+ --i; // no-warning
}
-void bad_assign_vector1(std::vector<int> &V, int n) {
- auto i0 = V.cbegin();
- V.assign(10, n);
- *i0; // expected-warning{{Invalidated iterator accessed}}
+void invalidated_prefix_decrement(std::vector<int> &V) {
+ auto i = ++V.cbegin();
+ V.erase(i);
+ --i; // expected-warning{{Invalidated iterator accessed}}
}
-void bad_assign_deque1(std::deque<int> &D, int n) {
- auto i0 = D.cbegin();
- D.assign(10, n);
- *i0; // expected-warning{{Invalidated iterator accessed}}
+void normal_postfix_increment(std::vector<int> &V) {
+ auto i = V.cbegin();
+ i++; // no-warning
}
-void bad_assign_forward_list1(std::forward_list<int> &FL, int n) {
- auto i0 = FL.cbegin();
- FL.assign(10, n);
- *i0; // expected-warning{{Invalidated iterator accessed}}
+void invalidated_postfix_increment(std::vector<int> &V) {
+ auto i = V.cbegin();
+ V.erase(i);
+ i++; // expected-warning{{Invalidated iterator accessed}}
}
-void good_clear_list1(std::list<int> &L) {
- auto i0 = L.cend();
- L.clear();
- --i0; // no-warning
+void normal_postfix_decrement(std::vector<int> &V) {
+ auto i = ++V.cbegin();
+ i--; // no-warning
}
-void bad_clear_list1(std::list<int> &L) {
- auto i0 = L.cbegin(), i1 = L.cend();
- L.clear();
- *i0; // expected-warning{{Invalidated iterator accessed}}
+void invalidated_postfix_decrement(std::vector<int> &V) {
+ auto i = ++V.cbegin();
+ V.erase(i);
+ i--; // expected-warning{{Invalidated iterator accessed}}
}
-void bad_clear_vector1(std::vector<int> &V) {
- auto i0 = V.cbegin(), i1 = V.cend();
- V.clear();
- *i0; // expected-warning{{Invalidated iterator accessed}}
- --i1; // expected-warning{{Invalidated iterator accessed}}
+void normal_increment_by_2(std::vector<int> &V) {
+ auto i = V.cbegin();
+ i += 2; // no-warning
}
-void bad_clear_deque1(std::deque<int> &D) {
- auto i0 = D.cbegin(), i1 = D.cend();
- D.clear();
- *i0; // expected-warning{{Invalidated iterator accessed}}
- --i1; // expected-warning{{Invalidated iterator accessed}}
+void invalidated_increment_by_2(std::vector<int> &V) {
+ auto i = V.cbegin();
+ V.erase(i);
+ i += 2; // expected-warning{{Invalidated iterator accessed}}
}
-void good_push_back_list1(std::list<int> &L, int n) {
- auto i0 = L.cbegin(), i1 = L.cend();
- L.push_back(n);
- *i0; // no-warning
- --i1; // no-warning
+void normal_increment_by_2_copy(std::vector<int> &V) {
+ auto i = V.cbegin();
+ auto j = i + 2; // no-warning
}
-void good_push_back_vector1(std::vector<int> &V, int n) {
- auto i0 = V.cbegin(), i1 = V.cend();
- V.push_back(n);
- *i0; // no-warning
+void invalidated_increment_by_2_copy(std::vector<int> &V) {
+ auto i = V.cbegin();
+ V.erase(i);
+ auto j = i + 2; // expected-warning{{Invalidated iterator accessed}}
}
-void bad_push_back_vector1(std::vector<int> &V, int n) {
- auto i0 = V.cbegin(), i1 = V.cend();
- V.push_back(n);
- --i1; // expected-warning{{Invalidated iterator accessed}}
+void normal_decrement_by_2(std::vector<int> &V) {
+ auto i = V.cbegin();
+ i -= 2; // no-warning
}
-void bad_push_back_deque1(std::deque<int> &D, int n) {
- auto i0 = D.cbegin(), i1 = D.cend();
- D.push_back(n);
- *i0; // expected-warning{{Invalidated iterator accessed}}
- --i1; // expected-warning{{Invalidated iterator accessed}}
+void invalidated_decrement_by_2(std::vector<int> &V) {
+ auto i = V.cbegin();
+ V.erase(i);
+ i -= 2; // expected-warning{{Invalidated iterator accessed}}
}
-void good_emplace_back_list1(std::list<int> &L, int n) {
- auto i0 = L.cbegin(), i1 = L.cend();
- L.emplace_back(n);
- *i0; // no-warning
- --i1; // no-warning
+void normal_decrement_by_2_copy(std::vector<int> &V) {
+ auto i = V.cbegin();
+ auto j = i - 2; // no-warning
}
-void good_emplace_back_vector1(std::vector<int> &V, int n) {
- auto i0 = V.cbegin(), i1 = V.cend();
- V.emplace_back(n);
- *i0; // no-warning
+void invalidated_decrement_by_2_copy(std::vector<int> &V) {
+ auto i = V.cbegin();
+ V.erase(i);
+ auto j = i - 2; // expected-warning{{Invalidated iterator accessed}}
}
-void bad_emplace_back_vector1(std::vector<int> &V, int n) {
- auto i0 = V.cbegin(), i1 = V.cend();
- V.emplace_back(n);
- --i1; // expected-warning{{Invalidated iterator accessed}}
+void normal_subscript(std::vector<int> &V) {
+ auto i = V.cbegin();
+ i[1]; // no-warning
}
-void bad_emplace_back_deque1(std::deque<int> &D, int n) {
- auto i0 = D.cbegin(), i1 = D.cend();
- D.emplace_back(n);
- *i0; // expected-warning{{Invalidated iterator accessed}}
- --i1; // expected-warning{{Invalidated iterator accessed}}
+void invalidated_subscript(std::vector<int> &V) {
+ auto i = V.cbegin();
+ V.erase(i);
+ i[1]; // expected-warning{{Invalidated iterator accessed}}
}
-void good_pop_back_list1(std::list<int> &L, int n) {
- auto i0 = L.cbegin(), i1 = L.cend(), i2 = i1--;
- L.pop_back();
- *i0; // no-warning
- *i2; // no-warning
-}
-
-void bad_pop_back_list1(std::list<int> &L, int n) {
- auto i0 = L.cbegin(), i1 = L.cend(), i2 = i1--;
- L.pop_back();
- *i1; // expected-warning{{Invalidated iterator accessed}}
-}
-
-void good_pop_back_vector1(std::vector<int> &V, int n) {
- auto i0 = V.cbegin(), i1 = V.cend(), i2 = i1--;
- V.pop_back();
- *i0; // no-warning
-}
-
-void bad_pop_back_vector1(std::vector<int> &V, int n) {
- auto i0 = V.cbegin(), i1 = V.cend(), i2 = i1--;
- V.pop_back();
- *i1; // expected-warning{{Invalidated iterator accessed}}
- --i2; // expected-warning{{Invalidated iterator accessed}}
-}
-
-void good_pop_back_deque1(std::deque<int> &D, int n) {
- auto i0 = D.cbegin(), i1 = D.cend(), i2 = i1--;
- D.pop_back();
- *i0; // no-warning
-}
-
-void bad_pop_back_deque1(std::deque<int> &D, int n) {
- auto i0 = D.cbegin(), i1 = D.cend(), i2 = i1--;
- D.pop_back();
- *i1; // expected-warning{{Invalidated iterator accessed}}
- --i2; // expected-warning{{Invalidated iterator accessed}}
-}
-
-void good_push_front_list1(std::list<int> &L, int n) {
- auto i0 = L.cbegin(), i1 = L.cend();
- L.push_front(n);
- *i0; // no-warning
- --i1; // no-warning
-}
-
-void bad_push_front_deque1(std::deque<int> &D, int n) {
- auto i0 = D.cbegin(), i1 = D.cend();
- D.push_front(n);
- *i0; // expected-warning{{Invalidated iterator accessed}}
- --i1; // expected-warning{{Invalidated iterator accessed}}
-}
-
-void good_push_front_forward_list1(std::forward_list<int> &FL, int n) {
- auto i0 = FL.cbegin(), i1 = FL.cend();
- FL.push_front(n);
- *i0; // no-warning
-}
-
-void good_emplace_front_list1(std::list<int> &L, int n) {
- auto i0 = L.cbegin(), i1 = L.cend();
- L.emplace_front(n);
- *i0; // no-warning
- --i1; // no-warning
-}
-
-void bad_emplace_front_deque1(std::deque<int> &D, int n) {
- auto i0 = D.cbegin(), i1 = D.cend();
- D.emplace_front(n);
- *i0; // expected-warning{{Invalidated iterator accessed}}
- --i1; // expected-warning{{Invalidated iterator accessed}}
-}
-
-void good_emplace_front_forward_list1(std::forward_list<int> &FL, int n) {
- auto i0 = FL.cbegin(), i1 = FL.cend();
- FL.emplace_front(n);
- *i0; // no-warning
-}
-
-void good_pop_front_list1(std::list<int> &L, int n) {
- auto i1 = L.cbegin(), i0 = i1++;
- L.pop_front();
- *i1; // no-warning
-}
-
-void bad_pop_front_list1(std::list<int> &L, int n) {
- auto i1 = L.cbegin(), i0 = i1++;
- L.pop_front();
- *i0; // expected-warning{{Invalidated iterator accessed}}
-}
-
-void good_pop_front_deque1(std::deque<int> &D, int n) {
- auto i1 = D.cbegin(), i0 = i1++;
- D.pop_front();
- *i1; // no-warning
-}
-
-void bad_pop_front_deque1(std::deque<int> &D, int n) {
- auto i1 = D.cbegin(), i0 = i1++;
- D.pop_front();
- *i0; // expected-warning{{Invalidated iterator accessed}}
-}
-
-void good_pop_front_forward_list1(std::forward_list<int> &FL, int n) {
- auto i1 = FL.cbegin(), i0 = i1++;
- FL.pop_front();
- *i1; // no-warning
-}
-
-void bad_pop_front_forward_list1(std::forward_list<int> &FL, int n) {
- auto i1 = FL.cbegin(), i0 = i1++;
- FL.pop_front();
- *i0; // expected-warning{{Invalidated iterator accessed}}
-}
-
-void good_insert_list1(std::list<int> &L, int n) {
- auto i1 = L.cbegin(), i0 = i1++;
- L.insert(i1, n);
- *i0; // no-warning
- *i1; // no-warning
-}
-
-void good_insert_vector1(std::vector<int> &V, int n) {
- auto i1 = V.cbegin(), i0 = i1++;
- V.insert(i1, n);
- *i0; // no-warning
-}
-
-void bad_insert_vector1(std::vector<int> &V, int n) {
- auto i1 = V.cbegin(), i0 = i1++;
- V.insert(i1, n);
- *i1; // expected-warning{{Invalidated iterator accessed}}
-}
-
-void bad_insert_deque1(std::deque<int> &D, int n) {
- auto i1 = D.cbegin(), i0 = i1++;
- D.insert(i1, n);
- *i0; // expected-warning{{Invalidated iterator accessed}}
- *i1; // expected-warning{{Invalidated iterator accessed}}
-}
-
-void good_emplace_list1(std::list<int> &L, int n) {
- auto i1 = L.cbegin(), i0 = i1++;
- L.emplace(i1, n);
- *i0; // no-warning
- *i1; // no-warning
-}
-
-void good_emplace_vector1(std::vector<int> &V, int n) {
- auto i1 = V.cbegin(), i0 = i1++;
- V.emplace(i1, n);
- *i0; // no-warning
-}
-
-void bad_emplace_vector1(std::vector<int> &V, int n) {
- auto i1 = V.cbegin(), i0 = i1++;
- V.emplace(i1, n);
- *i1; // expected-warning{{Invalidated iterator accessed}}
-}
-
-void bad_emplace_deque1(std::deque<int> &D, int n) {
- auto i1 = D.cbegin(), i0 = i1++;
- D.emplace(i1, n);
- *i0; // expected-warning{{Invalidated iterator accessed}}
- *i1; // expected-warning{{Invalidated iterator accessed}}
-}
-
-void good_erase_list1(std::list<int> &L) {
- auto i2 = L.cbegin(), i0 = i2++, i1 = i2++;
- L.erase(i1);
- *i0; // no-warning
- *i2; // no-warning
-}
-
-void bad_erase_list1(std::list<int> &L) {
- auto i0 = L.cbegin();
- L.erase(i0);
- *i0; // expected-warning{{Invalidated iterator accessed}}
-}
-
-void good_erase_vector1(std::vector<int> &V) {
- auto i2 = V.cbegin(), i0 = i2++, i1 = i2++;
- V.erase(i1);
- *i0; // no-warning
-}
-
-void bad_erase_vector1(std::vector<int> &V) {
- auto i1 = V.cbegin(), i0 = i1++;
- V.erase(i0);
- *i0; // expected-warning{{Invalidated iterator accessed}}
- *i1; // expected-warning{{Invalidated iterator accessed}}
-}
-
-void bad_erase_deque1(std::deque<int> &D) {
- auto i2 = D.cbegin(), i0 = i2++, i1 = i2++;
- D.erase(i1);
- *i0; // expected-warning{{Invalidated iterator accessed}}
- *i1; // expected-warning{{Invalidated iterator accessed}}
- *i2; // expected-warning{{Invalidated iterator accessed}}
-}
-
-void good_erase_list2(std::list<int> &L) {
- auto i3 = L.cbegin(), i0 = i3++, i1 = i3++, i2 = i3++;
- L.erase(i1, i3);
- *i0; // no-warning
- *i3; // no-warning
-}
-
-void bad_erase_list2(std::list<int> &L) {
- auto i2 = L.cbegin(), i0 = i2++, i1 = i2++;
- L.erase(i0, i2);
- *i0; // expected-warning{{Invalidated iterator accessed}}
- *i1; // expected-warning{{Invalidated iterator accessed}}
-}
-
-void good_erase_vector2(std::vector<int> &V) {
- auto i3 = V.cbegin(), i0 = i3++, i1 = i3++, i2 = i3++;;
- V.erase(i1, i3);
- *i0; // no-warning
-}
-
-void bad_erase_vector2(std::vector<int> &V) {
- auto i2 = V.cbegin(), i0 = i2++, i1 = i2++;
- V.erase(i0, i2);
- *i0; // expected-warning{{Invalidated iterator accessed}}
- *i1; // expected-warning{{Invalidated iterator accessed}}
- *i2; // expected-warning{{Invalidated iterator accessed}}
-}
-
-void bad_erase_deque2(std::deque<int> &D) {
- auto i3 = D.cbegin(), i0 = i3++, i1 = i3++, i2 = i3++;
- D.erase(i1, i3);
- *i0; // expected-warning{{Invalidated iterator accessed}}
- *i1; // expected-warning{{Invalidated iterator accessed}}
- *i2; // expected-warning{{Invalidated iterator accessed}}
- *i3; // expected-warning{{Invalidated iterator accessed}}
-}
-
-void good_erase_after_forward_list1(std::forward_list<int> &FL) {
- auto i2 = FL.cbegin(), i0 = i2++, i1 = i2++;
- FL.erase_after(i0);
- *i0; // no-warning
- *i2; // no-warning
-}
-
-void bad_erase_after_forward_list1(std::forward_list<int> &FL) {
- auto i1 = FL.cbegin(), i0 = i1++;
- FL.erase_after(i0);
- *i1; // expected-warning{{Invalidated iterator accessed}}
-}
-
-void good_erase_after_forward_list2(std::forward_list<int> &FL) {
- auto i3 = FL.cbegin(), i0 = i3++, i1 = i3++, i2 = i3++;
- FL.erase_after(i0, i3);
- *i0; // no-warning
- *i3; // no-warning
-}
-
-void bad_erase_after_forward_list2(std::forward_list<int> &FL) {
- auto i3 = FL.cbegin(), i0 = i3++, i1 = i3++, i2 = i3++;
- FL.erase_after(i0, i3);
- *i1; // expected-warning{{Invalidated iterator accessed}}
- *i2; // expected-warning{{Invalidated iterator accessed}}
+void assignment(std::vector<int> &V) {
+ auto i = V.cbegin();
+ V.erase(i);
+ auto j = V.cbegin(); // no-warning
}
diff --git a/src/llvm-project/clang/test/Analysis/iterator-modelling.cpp b/src/llvm-project/clang/test/Analysis/iterator-modelling.cpp
new file mode 100644
index 0000000..3c981b2
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/iterator-modelling.cpp
@@ -0,0 +1,2001 @@
+// RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=core,cplusplus,debug.DebugIteratorModeling,debug.ExprInspection -analyzer-config aggressive-binary-operation-simplification=true -analyzer-config c++-container-inlining=false %s -verify
+
+// RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=core,cplusplus,debug.DebugIteratorModeling,debug.ExprInspection -analyzer-config aggressive-binary-operation-simplification=true -analyzer-config c++-container-inlining=true -DINLINE=1 %s -verify
+
+// RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=core,cplusplus,alpha.cplusplus.IteratorModeling,debug.ExprInspection -analyzer-config aggressive-binary-operation-simplification=true %s 2>&1 | FileCheck %s
+
+#include "Inputs/system-header-simulator-cxx.h"
+
+template <typename Container>
+long clang_analyzer_container_begin(const Container&);
+template <typename Container>
+long clang_analyzer_container_end(const Container&);
+template <typename Iterator>
+long clang_analyzer_iterator_position(const Iterator&);
+template <typename Iterator>
+void* clang_analyzer_iterator_container(const Iterator&);
+template <typename Iterator>
+bool clang_analyzer_iterator_validity(const Iterator&);
+
+void clang_analyzer_denote(long, const char*);
+void clang_analyzer_express(long);
+void clang_analyzer_eval(bool);
+void clang_analyzer_warnIfReached();
+
+void begin(const std::vector<int> &v) {
+ auto i = v.begin();
+
+ clang_analyzer_eval(clang_analyzer_iterator_container(i) == &v); // expected-warning{{TRUE}}
+ clang_analyzer_denote(clang_analyzer_container_begin(v), "$v.begin()");
+ clang_analyzer_express(clang_analyzer_iterator_position(i)); //expected-warning{{$v.begin()}}
+
+ if (i != v.begin()) {
+ clang_analyzer_warnIfReached();
+ }
+}
+
+void end(const std::vector<int> &v) {
+ auto i = v.end();
+
+ clang_analyzer_eval(clang_analyzer_iterator_container(i) == &v); // expected-warning{{TRUE}}
+ clang_analyzer_denote(clang_analyzer_container_end(v), "$v.end()");
+ clang_analyzer_express(clang_analyzer_iterator_position(i)); //expected-warning{{$v.end()}}
+
+ if (i != v.end()) {
+ clang_analyzer_warnIfReached();
+ }
+}
+
+void prefix_increment(const std::vector<int> &v) {
+ auto i = v.begin();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(v), "$v.begin()");
+
+ auto j = ++i;
+
+ clang_analyzer_express(clang_analyzer_iterator_position(i)); //expected-warning{{$v.begin() + 1}}
+ clang_analyzer_express(clang_analyzer_iterator_position(j)); //expected-warning{{$v.begin() + 1}}
+}
+
+void prefix_decrement(const std::vector<int> &v) {
+ auto i = v.end();
+
+ clang_analyzer_denote(clang_analyzer_container_end(v), "$v.end()");
+
+ auto j = --i;
+
+ clang_analyzer_express(clang_analyzer_iterator_position(i)); //expected-warning{{$v.end() - 1}}
+ clang_analyzer_express(clang_analyzer_iterator_position(j)); //expected-warning{{$v.end() - 1}}
+}
+
+void postfix_increment(const std::vector<int> &v) {
+ auto i = v.begin();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(v), "$v.begin()");
+
+ auto j = i++;
+
+ clang_analyzer_express(clang_analyzer_iterator_position(i)); //expected-warning{{$v.begin() + 1}}
+ clang_analyzer_express(clang_analyzer_iterator_position(j)); //expected-warning{{$v.begin()}}
+}
+
+void postfix_decrement(const std::vector<int> &v) {
+ auto i = v.end();
+
+ clang_analyzer_denote(clang_analyzer_container_end(v), "$v.end()");
+
+ auto j = i--;
+
+ clang_analyzer_express(clang_analyzer_iterator_position(i)); //expected-warning{{$v.end() - 1}}
+ clang_analyzer_express(clang_analyzer_iterator_position(j)); //expected-warning{{$v.end()}}
+}
+
+void plus_equal(const std::vector<int> &v) {
+ auto i = v.begin();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(v), "$v.begin()");
+
+ i += 2;
+
+ clang_analyzer_express(clang_analyzer_iterator_position(i)); //expected-warning{{$v.begin() + 2}}
+}
+
+void minus_equal(const std::vector<int> &v) {
+ auto i = v.end();
+
+ clang_analyzer_denote(clang_analyzer_container_end(v), "$v.end()");
+
+ i -= 2;
+
+ clang_analyzer_express(clang_analyzer_iterator_position(i)); //expected-warning{{$v.end() - 2}}
+}
+
+void copy(const std::vector<int> &v) {
+ auto i1 = v.end();
+
+ clang_analyzer_denote(clang_analyzer_container_end(v), "$v.end()");
+
+ auto i2 = i1;
+
+ clang_analyzer_eval(clang_analyzer_iterator_container(i2) == &v); // expected-warning{{TRUE}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i2)); //expected-warning{{$v.end()}}
+}
+
+void plus(const std::vector<int> &v) {
+ auto i1 = v.begin();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(v), "$v.begin()");
+
+ auto i2 = i1 + 2;
+
+ clang_analyzer_eval(clang_analyzer_iterator_container(i2) == &v); // expected-warning{{TRUE}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i2)); //expected-warning{{$v.begin() + 2}}
+}
+
+void minus(const std::vector<int> &v) {
+ auto i1 = v.end();
+
+ clang_analyzer_denote(clang_analyzer_container_end(v), "$v.end()");
+
+ auto i2 = i1 - 2;
+
+ clang_analyzer_eval(clang_analyzer_iterator_container(i2) == &v); // expected-warning{{TRUE}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i2)); //expected-warning{{$v.end() - 2}}
+}
+
+void copy_and_increment1(const std::vector<int> &v) {
+ auto i1 = v.begin();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(v), "$v.begin()");
+
+ auto i2 = i1;
+ ++i1;
+
+ clang_analyzer_express(clang_analyzer_iterator_position(i1)); //expected-warning{{$v.begin() + 1}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i2)); //expected-warning{{$v.begin()}}
+}
+
+void copy_and_increment2(const std::vector<int> &v) {
+ auto i1 = v.begin();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(v), "$v.begin()");
+
+ auto i2 = i1;
+ ++i2;
+
+ clang_analyzer_express(clang_analyzer_iterator_position(i1)); //expected-warning{{$v.begin()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i2)); //expected-warning{{$v.begin() + 1}}
+}
+
+void copy_and_decrement1(const std::vector<int> &v) {
+ auto i1 = v.end();
+
+ clang_analyzer_denote(clang_analyzer_container_end(v), "$v.end()");
+
+ auto i2 = i1;
+ --i1;
+
+ clang_analyzer_express(clang_analyzer_iterator_position(i1)); //expected-warning{{$v.end() - 1}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i2)); //expected-warning{{$v.end()}}
+}
+
+void copy_and_decrement2(const std::vector<int> &v) {
+ auto i1 = v.end();
+
+ clang_analyzer_denote(clang_analyzer_container_end(v), "$v.end()");
+
+ auto i2 = i1;
+ --i2;
+
+ clang_analyzer_express(clang_analyzer_iterator_position(i1)); //expected-warning{{$v.end()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i2)); //expected-warning{{$v.end() - 1}}
+}
+
+////////////////////////////////////////////////////////////////////////////////
+///
+/// C O N T A I N E R A S S I G N M E N T S
+///
+////////////////////////////////////////////////////////////////////////////////
+
+// Copy
+
+void list_copy_assignment(std::list<int> &L1, const std::list<int> &L2) {
+ auto i0 = L1.cbegin();
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ L1 = L2;
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{FALSE}}
+}
+
+void vector_copy_assignment(std::vector<int> &V1, const std::vector<int> &V2) {
+ auto i0 = V1.cbegin();
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ V1 = V2;
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{FALSE}}
+}
+
+void deque_copy_assignment(std::deque<int> &D1, const std::deque<int> &D2) {
+ auto i0 = D1.cbegin();
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ D1 = D2;
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{FALSE}}
+}
+
+void forward_list_copy_assignment(std::forward_list<int> &FL1,
+ const std::forward_list<int> &FL2) {
+ auto i0 = FL1.cbegin();
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ FL1 = FL2;
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{FALSE}}
+}
+
+// Move
+
+void list_move_assignment(std::list<int> &L1, std::list<int> &L2) {
+ auto i0 = L1.cbegin(), i1 = L2.cbegin(), i2 = --L2.cend(), i3 = L2.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(L2), "$L2.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(L2), "$L2.end()");
+
+ L1 = std::move(L2);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i3)); //expected-warning{{TRUE}} FIXME: Should be FALSE.
+
+ clang_analyzer_eval(clang_analyzer_iterator_container(i1) == &L1); // expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_container(i2) == &L1); // expected-warning{{TRUE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(L1)); // expected-warning{{$L2.begin()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i1)); // expected-warning{{$L2.begin()}}
+}
+
+void vector_move_assignment(std::vector<int> &V1, std::vector<int> &V2) {
+ auto i0 = V1.cbegin(), i1 = V2.cbegin(), i2 = --V2.cend(), i3 = V2.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(V2), "$V2.begin()");
+
+ V1 = std::move(V2);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i3)); //expected-warning{{TRUE}} FIXME: Should be FALSE.
+
+ clang_analyzer_eval(clang_analyzer_iterator_container(i1) == &V1); // expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_container(i2) == &V1); // expected-warning{{TRUE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(V1)); // expected-warning{{$V2.begin()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i1)); // expected-warning{{$V2.begin()}}
+}
+
+void deque_move_assignment(std::deque<int> &D1, std::deque<int> &D2) {
+ auto i0 = D1.cbegin(), i1 = D2.cbegin(), i2 = --D2.cend(), i3 = D2.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(D2), "$D2.begin()");
+
+ D1 = std::move(D2);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i3)); //expected-warning{{TRUE}} FIXME: Should be FALSE.
+
+ clang_analyzer_eval(clang_analyzer_iterator_container(i1) == &D1); // expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_container(i2) == &D1); // expected-warning{{TRUE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(D1)); // expected-warning{{$D2.begin()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i1)); // expected-warning{{$D2.begin()}}
+}
+
+void forward_list_move_assignment(std::forward_list<int> &FL1,
+ std::forward_list<int> &FL2) {
+ auto i0 = FL1.cbegin(), i1 = FL2.cbegin(), i2 = FL2.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(FL2), "$FL2.begin()");
+
+ FL1 = std::move(FL2);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{TRUE}} FIXME: Should be FALSE.
+
+ clang_analyzer_eval(clang_analyzer_iterator_container(i1) == &FL1); // expected-warning{{TRUE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(FL1)); // expected-warning{{$FL2.begin()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i1)); // expected-warning{{$FL2.begin()}}
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+///
+/// C O N T A I N E R M O D I F I E R S
+///
+////////////////////////////////////////////////////////////////////////////////
+
+/// assign()
+///
+/// - Invalidates all iterators, including the past-the-end iterator for all
+/// container types.
+
+void list_assign(std::list<int> &L, int n) {
+ auto i0 = L.cbegin(), i1 = L.cend();
+ L.assign(10, n);
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{FALSE}}
+}
+
+void vector_assign(std::vector<int> &V, int n) {
+ auto i0 = V.cbegin(), i1 = V.cend();
+ V.assign(10, n);
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{FALSE}}
+}
+
+void deque_assign(std::deque<int> &D, int n) {
+ auto i0 = D.cbegin(), i1 = D.cend();
+ D.assign(10, n);
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{FALSE}}
+}
+
+void forward_list_assign(std::forward_list<int> &FL, int n) {
+ auto i0 = FL.cbegin(), i1 = FL.cend();
+ FL.assign(10, n);
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{FALSE}}
+}
+
+/// clear()
+///
+/// - Invalidates all iterators, including the past-the-end iterator for all
+/// container types.
+
+void list_clear(std::list<int> &L) {
+ auto i0 = L.cbegin(), i1 = L.cend();
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ L.clear();
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{FALSE}}
+}
+
+void vector_clear(std::vector<int> &V) {
+ auto i0 = V.cbegin(), i1 = V.cend();
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ V.clear();
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{FALSE}}
+}
+
+void deque_clear(std::deque<int> &D) {
+ auto i0 = D.cbegin(), i1 = D.cend();
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ D.clear();
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{FALSE}}
+}
+
+void forward_list_clear(std::forward_list<int> &FL) {
+ auto i0 = FL.cbegin(), i1 = FL.cend();
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ FL.clear();
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{FALSE}}
+}
+
+/// push_back()
+///
+/// - Design decision: extends containers to the ->RIGHT-> (i.e. the
+/// past-the-end position of the container is incremented).
+///
+/// - Iterator invalidation rules depend the container type.
+
+/// std::list-like containers: No iterators are invalidated.
+
+void list_push_back(std::list<int> &L, int n) {
+ auto i0 = L.cbegin(), i1 = --L.cend(), i2 = L.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(L), "$L.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(L), "$L.end()");
+
+ L.push_back(n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{TRUE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(L)); // expected-warning{{$L.begin()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$L.begin()}}
+
+ clang_analyzer_express(clang_analyzer_container_end(L)); // expected-warning{{$L.end() + 1}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i1)); // expected-warning{{$L.end() - 1}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i2)); // expected-warning{{$L.end()}} FIXME: Should be $L.end() + 1
+}
+
+/// std::vector-like containers: The past-the-end iterator is invalidated.
+
+void vector_push_back(std::vector<int> &V, int n) {
+ auto i0 = V.cbegin(), i1 = --V.cend(), i2 = V.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(V), "$V.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(V), "$V.end()");
+
+ V.push_back(n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{FALSE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(V)); // expected-warning{{$V.begin()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$V.begin()}}
+
+ clang_analyzer_express(clang_analyzer_container_end(V)); // expected-warning{{$V.end() + 1}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i1)); // expected-warning{{$V.end() - 1}}
+}
+
+/// std::deque-like containers: All iterators, including the past-the-end
+/// iterator, are invalidated.
+
+void deque_push_back(std::deque<int> &D, int n) {
+ auto i0 = D.cbegin(), i1 = --D.cend(), i2 = D.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(D), "$D.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(D), "$D.end()");
+
+ D.push_back(n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{FALSE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(D)); // expected-warning{{$D.begin()}}
+ clang_analyzer_express(clang_analyzer_container_end(D)); // expected-warning{{$D.end()}} FIXME: Should be $D.end() + 1 (to correctly track the container's size)
+}
+
+/// emplace_back()
+///
+/// - Design decision: extends containers to the ->RIGHT-> (i.e. the
+/// past-the-end position of the container is incremented).
+///
+/// - Iterator invalidation rules depend the container type.
+
+/// std::list-like containers: No iterators are invalidated.
+
+void list_emplace_back(std::list<int> &L, int n) {
+ auto i0 = L.cbegin(), i1 = --L.cend(), i2 = L.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(L), "$L.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(L), "$L.end()");
+
+ L.emplace_back(n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{TRUE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(L)); // expected-warning{{$L.begin()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$L.begin()}}
+
+ clang_analyzer_express(clang_analyzer_container_end(L)); // expected-warning{{$L.end() + 1}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i1)); // expected-warning{{$L.end()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i2)); // expected-warning{{$L.end()}} FIXME: Should be $L.end() + 1
+}
+
+/// std::vector-like containers: The past-the-end iterator is invalidated.
+
+void vector_emplace_back(std::vector<int> &V, int n) {
+ auto i0 = V.cbegin(), i1 = --V.cend(), i2 = V.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(V), "$V.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(V), "$V.end()");
+
+ V.emplace_back(n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{FALSE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(V)); // expected-warning{{$V.begin()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$V.begin()}}
+
+ clang_analyzer_express(clang_analyzer_container_end(V)); // expected-warning{{$V.end() + 1}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i1)); // expected-warning{{$V.end() - 1}}
+}
+
+/// std::deque-like containers: All iterators, including the past-the-end
+/// iterator, are invalidated.
+
+void deque_emplace_back(std::deque<int> &D, int n) {
+ auto i0 = D.cbegin(), i1 = --D.cend(), i2 = D.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(D), "$D.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(D), "$D.end()");
+
+ D.emplace_back(n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{FALSE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(D)); // expected-warning{{$D.begin()}}
+ clang_analyzer_express(clang_analyzer_container_end(D)); // expected-warning{{$D.end()}} FIXME: Should be $D.end() + 1 (to correctly track the container's size)
+}
+
+/// pop_back()
+///
+/// - Design decision: shrinks containers to the <-LEFT<- (i.e. the
+/// past-the-end position of the container is decremented).
+///
+/// - Iterator invalidation rules depend the container type.
+
+/// std::list-like containers: Iterators to the last element are invalidated.
+
+void list_pop_back(std::list<int> &L, int n) {
+ auto i0 = L.cbegin(), i1 = --L.cend(), i2 = L.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(L), "$L.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(L), "$L.end()");
+
+ L.pop_back();
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{TRUE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(L)); // expected-warning{{$L.begin()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$L.begin()}}
+
+ clang_analyzer_express(clang_analyzer_container_end(L)); // expected-warning{{$L.end() - 1}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i2)); // expected-warning{{$L.end()}} FIXME: Should be $L.end() - 1
+}
+
+/// std::vector-like containers: Iterators to the last element, as well as the
+/// past-the-end iterator, are invalidated.
+
+void vector_pop_back(std::vector<int> &V, int n) {
+ auto i0 = V.cbegin(), i1 = --V.cend(), i2 = V.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(V), "$V.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(V), "$V.end()");
+
+ V.pop_back();
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{FALSE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(V)); // expected-warning{{$V.begin()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$V.begin()}}
+
+ clang_analyzer_express(clang_analyzer_container_end(V)); // expected-warning{{$V.end() - 1}}
+}
+
+/// std::deque-like containers: Iterators to the last element are invalidated.
+/// The past-the-end iterator is also invalidated.
+/// Other iterators are not affected.
+
+void deque_pop_back(std::deque<int> &D, int n) {
+ auto i0 = D.cbegin(), i1 = --D.cend(), i2 = D.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(D), "$D.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(D), "$D.end()");
+
+ D.pop_back();
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{FALSE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(D)); // expected-warning{{$D.begin()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$D.begin()}}
+
+ clang_analyzer_express(clang_analyzer_container_end(D)); // expected-warning{{$D.end() - 1}}
+}
+
+/// push_front()
+///
+/// - Design decision: extends containers to the <-LEFT<- (i.e. the first
+/// position of the container is decremented).
+///
+/// - Iterator invalidation rules depend the container type.
+
+/// std::list-like containers: No iterators are invalidated.
+
+void list_push_front(std::list<int> &L, int n) {
+ auto i0 = L.cbegin(), i1 = L.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(L), "$L.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(L), "$L.end()");
+
+ L.push_front(n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{TRUE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(L)); // expected-warning{{$L.begin() - 1}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$L.begin()}}
+
+ clang_analyzer_express(clang_analyzer_container_end(L)); // expected-warning{{$L.end()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i1)); // expected-warning{{$L.end()}}
+}
+
+/// std::deque-like containers: All iterators, including the past-the-end
+/// iterator, are invalidated.
+
+void deque_push_front(std::deque<int> &D, int n) {
+ auto i0 = D.cbegin(), i1 = --D.cend(), i2 = D.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(D), "$D.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(D), "$D.end()");
+
+ D.push_front(n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{FALSE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(D)); // expected-warning{{$D.begin()}} FIXME: Should be $D.begin() - 1 (to correctly track the container's size)
+
+ clang_analyzer_express(clang_analyzer_container_end(D)); // expected-warning{{$D.end()}}
+}
+
+/// std::forward_list-like containers: No iterators are invalidated.
+
+void forward_list_push_front(std::forward_list<int> &FL, int n) {
+ auto i0 = FL.cbegin(), i1 = FL.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(FL), "$FL.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(FL), "$FL.end()");
+
+ FL.push_front(n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{TRUE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(FL)); // expected-warning{{$FL.begin() - 1}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$FL.begin()}}
+
+ clang_analyzer_express(clang_analyzer_container_end(FL)); // expected-warning{{$FL.end()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i1)); // expected-warning{{$FL.end()}}
+}
+
+/// emplace_front()
+///
+/// - Design decision: extends containers to the <-LEFT<- (i.e. the first
+/// position of the container is decremented).
+///
+/// - Iterator invalidation rules depend the container type.
+
+/// std::list-like containers: No iterators are invalidated.
+
+void list_emplace_front(std::list<int> &L, int n) {
+ auto i0 = L.cbegin(), i1 = L.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(L), "$L.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(L), "$L.end()");
+
+ L.emplace_front(n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{TRUE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(L)); // expected-warning{{$L.begin() - 1}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$L.begin()}}
+
+ clang_analyzer_express(clang_analyzer_container_end(L)); // expected-warning{{$L.end()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i1)); // expected-warning{{$L.end()}}
+}
+
+/// std::deque-like containers: All iterators, including the past-the-end
+/// iterator, are invalidated.
+
+void deque_emplace_front(std::deque<int> &D, int n) {
+ auto i0 = D.cbegin(), i1 = --D.cend(), i2 = D.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(D), "$D.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(D), "$D.end()");
+
+ D.emplace_front(n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{FALSE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(D)); // expected-warning{{$D.begin()}} FIXME: Should be $D.begin - 1 (to correctly track the container's size)
+
+ clang_analyzer_express(clang_analyzer_container_end(D)); // expected-warning{{$D.end()}}
+}
+
+/// std::forward_list-like containers: No iterators are invalidated.
+
+void forward_list_emplace_front(std::forward_list<int> &FL, int n) {
+ auto i0 = FL.cbegin(), i1 = FL.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(FL), "$FL.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(FL), "$FL.end()");
+
+ FL.emplace_front(n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{TRUE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(FL)); // expected-warning{{$FL.begin() - 1}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$FL.begin()}}
+
+ clang_analyzer_express(clang_analyzer_container_end(FL)); // expected-warning{{$FL.end()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i1)); // expected-warning{{$FL.end()}}
+}
+
+/// pop_front()
+///
+/// - Design decision: shrinks containers to the ->RIGHT-> (i.e. the first
+/// position of the container is incremented).
+///
+/// - Iterator invalidation rules depend the container type.
+
+/// std::list-like containers: Iterators to the first element are invalidated.
+
+void list_pop_front(std::list<int> &L, int n) {
+ auto i0 = L.cbegin(), i1 = ++L.cbegin(), i2 = L.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(L), "$L.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(L), "$L.end()");
+
+ L.pop_front();
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{TRUE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(L)); // expected-warning{{$L.begin() + 1}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i1)); // expected-warning{{$L.begin() + 1}}
+
+ clang_analyzer_express(clang_analyzer_container_end(L)); // expected-warning{{$L.end()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i2)); // expected-warning{{$L.end()}}
+}
+
+/// std::deque-like containers: Iterators to the first element are invalidated.
+/// Other iterators are not affected.
+
+void deque_pop_front(std::deque<int> &D, int n) {
+ auto i0 = D.cbegin(), i1 = ++D.cbegin(), i2 = D.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(D), "$D.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(D), "$D.end()");
+
+ D.pop_front();
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{TRUE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(D)); // expected-warning{{$D.begin() + 1}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i1)); // expected-warning{{$D.begin() + 1}}
+
+ clang_analyzer_express(clang_analyzer_container_end(D)); // expected-warning{{$D.end()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i2)); // expected-warning{{$D.end()}}
+}
+
+/// std::forward_list-like containers: Iterators to the first element are
+/// invalidated.
+
+void forward_list_pop_front(std::list<int> &FL, int n) {
+ auto i0 = FL.cbegin(), i1 = ++FL.cbegin(), i2 = FL.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(FL), "$FL.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(FL), "$FL.end()");
+
+ FL.pop_front();
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{TRUE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(FL)); // expected-warning{{$FL.begin() + 1}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i1)); // expected-warning{{$FL.begin() + 1}}
+
+ clang_analyzer_express(clang_analyzer_container_end(FL)); // expected-warning{{$FL.end()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i2)); // expected-warning{{$FL.end()}}
+}
+
+/// insert()
+///
+/// - Design decision: shifts positions to the <-LEFT<- (i.e. all iterator
+/// ahead of the insertion point are decremented; if the
+/// relation between the insertion point and the first
+/// position of the container is known, the first position
+/// of the container is also decremented).
+///
+/// - Iterator invalidation rules depend the container type.
+
+/// std::list-like containers: No iterators are invalidated.
+
+void list_insert_begin(std::list<int> &L, int n) {
+ auto i0 = L.cbegin(), i1 = L.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(L), "$L.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(L), "$L.end()");
+
+ auto i2 = L.insert(i0, n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{TRUE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(L)); // expected-warning{{$L.begin()}} FIXME: Should be $L.begin() - 1
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$L.begin()}}
+ // clang_analyzer_express(clang_analyzer_iterator_position(i2)); FIXME: expect warning $L.begin() - 1
+
+ clang_analyzer_express(clang_analyzer_container_end(L)); // expected-warning{{$L.end()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i1)); // expected-warning{{$L.end()}}
+}
+
+void list_insert_behind_begin(std::list<int> &L, int n) {
+ auto i0 = L.cbegin(), i1 = ++L.cbegin(), i2 = L.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(L), "$L.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(L), "$L.end()");
+
+ auto i3 = L.insert(i1, n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{TRUE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(L)); // expected-warning{{$L.begin()}} FIXME: Should be $L.begin() - 1
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$L.begin()}} FIXME: Should be $L.begin() - 1
+ clang_analyzer_express(clang_analyzer_iterator_position(i1)); // expected-warning{{$L.begin() + 1}}
+ // clang_analyzer_express(clang_analyzer_iterator_position(i3)); FIXME: expect warning $L.begin()
+
+ clang_analyzer_express(clang_analyzer_container_end(L)); // expected-warning{{$L.end()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i2)); // expected-warning{{$L.end()}}
+}
+
+template <typename Iter> Iter return_any_iterator(const Iter &It);
+
+void list_insert_unknown(std::list<int> &L, int n) {
+ auto i0 = L.cbegin(), i1 = return_any_iterator(L.cbegin()), i2 = L.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(L), "$L.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(L), "$L.end()");
+ clang_analyzer_denote(clang_analyzer_iterator_position(i1), "$i1");
+
+ auto i3 = L.insert(i1, n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{TRUE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(L)); // expected-warning{{$L.begin()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$L.begin()}}
+
+ clang_analyzer_express(clang_analyzer_iterator_position(i1)); // expected-warning{{$i1}}
+ // clang_analyzer_express(clang_analyzer_iterator_position(i3)); FIXME: expect warning $i - 1
+
+ clang_analyzer_express(clang_analyzer_container_end(L)); // expected-warning{{$L.end()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i2)); // expected-warning{{$L.end()}}
+}
+
+void list_insert_ahead_of_end(std::list<int> &L, int n) {
+ auto i0 = L.cbegin(), i1 = --L.cend(), i2 = L.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(L), "$L.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(L), "$L.end()");
+
+ auto i3 = L.insert(i1, n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{TRUE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(L)); // expected-warning{{$L.begin()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$L.begin()}}
+
+ clang_analyzer_express(clang_analyzer_container_end(L)); // expected-warning{{$L.end()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i1)); // expected-warning{{$L.end() - 1}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i2)); // expected-warning{{$L.end()}}
+ // clang_analyzer_express(clang_analyzer_iterator_position(i3)); FIXME: expect warning $L.end() - 2
+}
+
+void list_insert_end(std::list<int> &L, int n) {
+ auto i0 = L.cbegin(), i1 = --L.cend(), i2 = L.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(L), "$L.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(L), "$L.end()");
+
+ auto i3 = L.insert(i2, n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{TRUE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(L)); // expected-warning{{$L.begin()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$L.begin()}}
+
+ clang_analyzer_express(clang_analyzer_container_end(L)); // expected-warning{{$L.end()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i1)); // expected-warning{{$L.end() - 1}} FIXME: should be $L.end() - 2
+ clang_analyzer_express(clang_analyzer_iterator_position(i2)); // expected-warning{{$L.end()}}
+ // clang_analyzer_express(clang_analyzer_iterator_position(i3)); FIXME: expect warning $L.end() - 1
+}
+
+/// std::vector-like containers: Only the iterators before the insertion point
+/// remain valid. The past-the-end iterator is also
+/// invalidated.
+
+void vector_insert_begin(std::vector<int> &V, int n) {
+ auto i0 = V.cbegin(), i1 = V.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(V), "$V.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(V), "$V.end()");
+
+ auto i2 = V.insert(i0, n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{FALSE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(V)); // expected-warning{{$V.begin()}} FIXME: Should be $V.begin() - 1
+ // clang_analyzer_express(clang_analyzer_iterator_position(i2)); FIXME: expect warning $V.begin() - 1
+
+ // clang_analyzer_express(clang_analyzer_container_end(V)); // FIXME: expect warning $V.end()
+}
+
+void vector_insert_behind_begin(std::vector<int> &V, int n) {
+ auto i0 = V.cbegin(), i1 = ++V.cbegin(), i2 = V.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(V), "$V.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(V), "$V.end()");
+
+ auto i3 = V.insert(i1, n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{FALSE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(V)); // expected-warning{{$V.begin()}} FIXME: Should be $V.begin() - 1
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$V.begin()}} FIXME: Should be $V.begin() - 1
+ // clang_analyzer_express(clang_analyzer_iterator_position(i3)); // FIXME: expect -warning $V.begin()
+
+ // clang_analyzer_express(clang_analyzer_container_end(V)); // FIXME: expect warning $V.end()
+}
+
+void vector_insert_unknown(std::vector<int> &V, int n) {
+ auto i0 = V.cbegin(), i1 = return_any_iterator(V.cbegin()), i2 = V.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(V), "$V.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(V), "$V.end()");
+ clang_analyzer_denote(clang_analyzer_iterator_position(i1), "$i1");
+
+ auto i3 = V.insert(i1, n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{FALSE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(V)); // expected-warning{{$V.begin()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$V.begin()}}
+
+ // clang_analyzer_express(clang_analyzer_iterator_position(i3)); FIXME: expecte warning $i1 - 1
+
+ // clang_analyzer_express(clang_analyzer_container_end(V)); FIXME expect warning $V.end()
+}
+
+void vector_insert_ahead_of_end(std::vector<int> &V, int n) {
+ auto i0 = V.cbegin(), i1 = --V.cend(), i2 = V.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(V), "$V.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(V), "$V.end()");
+
+ auto i3 = V.insert(i1, n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{FALSE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(V)); // expected-warning{{$V.begin()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$V.begin()}}
+
+ // clang_analyzer_express(clang_analyzer_container_end(V)); FIXME: expect warning $V.end() + 1
+ // clang_analyzer_express(clang_analyzer_iterator_position(i3)); FIXME: expect warning $V.end() - 2
+}
+
+void vector_insert_end(std::vector<int> &V, int n) {
+ auto i0 = V.cbegin(), i1 = --V.cend(), i2 = V.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(V), "$V.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(V), "$V.end()");
+
+ auto i3 = V.insert(i2, n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{FALSE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(V)); // expected-warning{{$V.begin()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$V.begin()}}
+
+ // clang_analyzer_express(clang_analyzer_container_end(V)); FIXME: expect warning $V.end()
+ clang_analyzer_express(clang_analyzer_iterator_position(i1)); // expected-warning{{$V.end() - 1}} FIXME: Should be $V.end() - 2
+ // clang_analyzer_express(clang_analyzer_iterator_position(i3)); FIXME: expect warning $V.end() - 1
+}
+
+/// std::deque-like containers: All iterators, including the past-the-end
+/// iterator, are invalidated.
+
+void deque_insert_begin(std::deque<int> &D, int n) {
+ auto i0 = D.cbegin(), i1 = D.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(D), "$D.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(D), "$D.end()");
+
+ auto i2 = D.insert(i0, n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{FALSE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(D)); // expected-warning{{$D.begin()}} FIXME: Should be $D.begin() - 1
+ // clang_analyzer_express(clang_analyzer_iterator_position(i2)); FIXME: expect warning $D.begin() - 1
+
+ // clang_analyzer_express(clang_analyzer_container_end(D)); FIXME: expect warning $D.end()
+}
+
+void deque_insert_behind_begin(std::deque<int> &D, int n) {
+ auto i0 = D.cbegin(), i1 = ++D.cbegin(), i2 = D.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(D), "$D.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(D), "$D.end()");
+
+ auto i3 = D.insert(i1, n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{FALSE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(D)); // expected-warning{{$D.begin()}} FIXME: Should be $D.begin - 1
+ // clang_analyzer_express(clang_analyzer_iterator_position(i3)); FIXME: expect warning $D.begin() - 1
+
+ // clang_analyzer_express(clang_analyzer_container_end(D)); FIXME: expect warning $D.end()
+}
+
+void deque_insert_unknown(std::deque<int> &D, int n) {
+ auto i0 = D.cbegin(), i1 = return_any_iterator(D.cbegin()), i2 = D.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(D), "$D.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(D), "$D.end()");
+ clang_analyzer_denote(clang_analyzer_iterator_position(i1), "$i1");
+
+ auto i3 = D.insert(i1, n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{FALSE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(D)); // expected-warning{{$D.begin()}}
+
+ // clang_analyzer_express(clang_analyzer_iterator_position(i3)); FIXME: expect warning $i1 - 1
+
+ // clang_analyzer_express(clang_analyzer_container_end(D)); FIXME: expect warning $D.end()
+}
+
+void deque_insert_ahead_of_end(std::deque<int> &D, int n) {
+ auto i0 = D.cbegin(), i1 = --D.cend(), i2 = D.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(D), "$D.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(D), "$D.end()");
+
+ auto i3 = D.insert(i1, n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{FALSE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(D)); // expected-warning{{$D.begin()}}
+
+ // clang_analyzer_express(clang_analyzer_container_end(D)); FIXME: expect warning $D.end() + 1
+ // clang_analyzer_express(clang_analyzer_iterator_position(i3)); FIXME: expect warning $D.end() - 2
+}
+
+void deque_insert_end(std::deque<int> &D, int n) {
+ auto i0 = D.cbegin(), i1 = --D.cend(), i2 = D.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(D), "$D.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(D), "$D.end()");
+
+ auto i3 = D.insert(i2, n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{FALSE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(D)); // expected-warning{{$D.begin()}}
+
+ // clang_analyzer_express(clang_analyzer_container_end(D)); FIXME: expect warning $D.end()
+ // clang_analyzer_express(clang_analyzer_iterator_position(i3)); FIXME: expect warning $D.end() - 1
+}
+
+/// insert_after() [std::forward_list-like containers]
+///
+/// - Design decision: shifts positions to the ->RIGHT-> (i.e. all iterator
+/// ahead of the insertion point are incremented; if the
+/// relation between the insertion point and the past-the-end
+/// position of the container is known, the first position of
+/// the container is also incremented).
+///
+/// - No iterators are invalidated.
+
+void forward_list_insert_after_begin(std::forward_list<int> &FL, int n) {
+ auto i0 = FL.cbegin(), i1 = FL.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(FL), "$FL.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(FL), "$FL.end()");
+
+ auto i2 = FL.insert_after(i0, n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{TRUE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(FL)); // expected-warning{{$FL.begin()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$FL.begin()}}
+ // clang_analyzer_express(clang_analyzer_iterator_position(i2)); FIXME: expect warning $FL.begin() + 1
+
+ clang_analyzer_express(clang_analyzer_container_end(FL)); // expected-warning{{$FL.end()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i1)); // expected-warning{{$FL.end()}}
+}
+
+void forward_list_insert_after_behind_begin(std::forward_list<int> &FL, int n) {
+ auto i0 = FL.cbegin(), i1 = ++FL.cbegin(), i2 = FL.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(FL), "$FL.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(FL), "$FL.end()");
+
+ auto i3 = FL.insert_after(i1, n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{TRUE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(FL)); // expected-warning{{$FL.begin()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$FL.begin()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i1)); // expected-warning{{$FL.begin() + 1}}
+ // clang_analyzer_express(clang_analyzer_iterator_position(i3)); FIXME: expect warning $FL.begin() + 2
+
+ clang_analyzer_express(clang_analyzer_container_end(FL)); // expected-warning{{$FL.end()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i2)); // expected-warning{{$FL.end()}}
+}
+
+void forward_list_insert_after_unknown(std::forward_list<int> &FL, int n) {
+ auto i0 = FL.cbegin(), i1 = return_any_iterator(FL.cbegin()), i2 = FL.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(FL), "$FL.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(FL), "$FL.end()");
+ clang_analyzer_denote(clang_analyzer_iterator_position(i1), "$i1");
+
+ auto i3 = FL.insert_after(i1, n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{TRUE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(FL)); // expected-warning{{$FL.begin()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$FL.begin()}}
+
+ clang_analyzer_express(clang_analyzer_iterator_position(i1)); // expected-warning{{$i1}}
+ // clang_analyzer_express(clang_analyzer_iterator_position(i3)); FIXME: expect warning $i1 + 1
+
+ clang_analyzer_express(clang_analyzer_container_end(FL)); // expected-warning{{$FL.end()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i2)); // expected-warning{{$FL.end()}}
+}
+
+/// emplace()
+///
+/// - Design decision: shifts positions to the <-LEFT<- (i.e. all iterator
+/// ahead of the emplacement point are decremented; if the
+/// relation between the emplacement point and the first
+/// position of the container is known, the first position
+/// of the container is also decremented).
+///
+/// - Iterator invalidation rules depend the container type.
+
+/// std::list-like containers: No iterators are invalidated.
+
+void list_emplace_begin(std::list<int> &L, int n) {
+ auto i0 = L.cbegin(), i1 = L.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(L), "$L.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(L), "$L.end()");
+
+ auto i2 = L.emplace(i0, n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{TRUE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(L)); // expected-warning{{$L.begin()}} FIXME: Should be $L.begin() - 1
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$L.begin()}}
+ // clang_analyzer_express(clang_analyzer_iterator_position(i2)); FIXME: expect warning $L.begin() - 1
+
+ clang_analyzer_express(clang_analyzer_container_end(L)); // expected-warning{{$L.end()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i1)); // expected-warning{{$L.end()}}
+}
+
+void list_emplace_behind_begin(std::list<int> &L, int n) {
+ auto i0 = L.cbegin(), i1 = ++L.cbegin(), i2 = L.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(L), "$L.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(L), "$L.end()");
+
+ auto i3 = L.emplace(i1, n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{TRUE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(L)); // expected-warning{{$L.begin()}} FIXME: Should be $L.begin() - 1
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$L.begin()}} FIXME: Should be $L.begin() - 1
+ clang_analyzer_express(clang_analyzer_iterator_position(i1)); // expected-warning{{$L.begin() + 1}}
+ // clang_analyzer_express(clang_analyzer_iterator_position(i3)); FIXME: expect warning $L.begin()
+
+ clang_analyzer_express(clang_analyzer_container_end(L)); // expected-warning{{$L.end()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i2)); // expected-warning{{$L.end()}}
+}
+
+template <typename Iter> Iter return_any_iterator(const Iter &It);
+
+void list_emplace_unknown(std::list<int> &L, int n) {
+ auto i0 = L.cbegin(), i1 = return_any_iterator(L.cbegin()), i2 = L.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(L), "$L.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(L), "$L.end()");
+ clang_analyzer_denote(clang_analyzer_iterator_position(i1), "$i1");
+
+ auto i3 = L.emplace(i1, n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{TRUE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(L)); // expected-warning{{$L.begin()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$L.begin()}}
+
+ clang_analyzer_express(clang_analyzer_iterator_position(i1)); // expected-warning{{$i1}}
+ // clang_analyzer_express(clang_analyzer_iterator_position(i3)); FIXME: expect warning $i - 1
+
+ clang_analyzer_express(clang_analyzer_container_end(L)); // expected-warning{{$L.end()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i2)); // expected-warning{{$L.end()}}
+}
+
+void list_emplace_ahead_of_end(std::list<int> &L, int n) {
+ auto i0 = L.cbegin(), i1 = --L.cend(), i2 = L.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(L), "$L.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(L), "$L.end()");
+
+ auto i3 = L.emplace(i1, n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{TRUE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(L)); // expected-warning{{$L.begin()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$L.begin()}}
+
+ clang_analyzer_express(clang_analyzer_container_end(L)); // expected-warning{{$L.end()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i1)); // expected-warning{{$L.end() - 1}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i2)); // expected-warning{{$L.end()}}
+ // clang_analyzer_express(clang_analyzer_iterator_position(i3)); FIXME: expect warning $L.end() - 2
+}
+
+void list_emplace_end(std::list<int> &L, int n) {
+ auto i0 = L.cbegin(), i1 = --L.cend(), i2 = L.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(L), "$L.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(L), "$L.end()");
+
+ auto i3 = L.emplace(i2, n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{TRUE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(L)); // expected-warning{{$L.begin()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$L.begin()}}
+
+ clang_analyzer_express(clang_analyzer_container_end(L)); // expected-warning{{$L.end()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i1)); // expected-warning{{$L.end() - 1}} FIXME: should be $L.end() - 2
+ clang_analyzer_express(clang_analyzer_iterator_position(i2)); // expected-warning{{$L.end()}}
+ // clang_analyzer_express(clang_analyzer_iterator_position(i3)); FIXME: expect warning $L.end() - 1
+}
+
+/// std::vector-like containers: Only the iterators before the emplacement point
+/// remain valid. The past-the-end iterator is also
+/// invalidated.
+
+void vector_emplace_begin(std::vector<int> &V, int n) {
+ auto i0 = V.cbegin(), i1 = V.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(V), "$V.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(V), "$V.end()");
+
+ auto i2 = V.emplace(i0, n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{FALSE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(V)); // expected-warning{{$V.begin()}} FIXME: Should be $V.begin() - 1
+ // clang_analyzer_express(clang_analyzer_iterator_position(i2)); FIXME: expect warning $V.begin() - 1
+
+ // clang_analyzer_express(clang_analyzer_container_end(V)); // FIXME: expect warning $V.end()
+}
+
+void vector_emplace_behind_begin(std::vector<int> &V, int n) {
+ auto i0 = V.cbegin(), i1 = ++V.cbegin(), i2 = V.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(V), "$V.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(V), "$V.end()");
+
+ auto i3 = V.emplace(i1, n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{FALSE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(V)); // expected-warning{{$V.begin()}} FIXME: Should be $V.begin() - 1
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$V.begin()}} FIXME: Should be $V.begin() - 1
+ // clang_analyzer_express(clang_analyzer_iterator_position(i3)); // FIXME: expect -warning $V.begin()
+
+ // clang_analyzer_express(clang_analyzer_container_end(V)); // FIXME: expect warning $V.end()
+}
+
+void vector_emplace_unknown(std::vector<int> &V, int n) {
+ auto i0 = V.cbegin(), i1 = return_any_iterator(V.cbegin()), i2 = V.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(V), "$V.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(V), "$V.end()");
+ clang_analyzer_denote(clang_analyzer_iterator_position(i1), "$i1");
+
+ auto i3 = V.emplace(i1, n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{FALSE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(V)); // expected-warning{{$V.begin()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$V.begin()}}
+
+ // clang_analyzer_express(clang_analyzer_iterator_position(i3)); FIXME: expecte warning $i1 - 1
+
+ // clang_analyzer_express(clang_analyzer_container_end(V)); FIXME expect warning $V.end()
+}
+
+void vector_emplace_ahead_of_end(std::vector<int> &V, int n) {
+ auto i0 = V.cbegin(), i1 = --V.cend(), i2 = V.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(V), "$V.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(V), "$V.end()");
+
+ auto i3 = V.emplace(i1, n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{FALSE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(V)); // expected-warning{{$V.begin()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$V.begin()}}
+
+ // clang_analyzer_express(clang_analyzer_container_end(V)); FIXME: expect warning $V.end() + 1
+ // clang_analyzer_express(clang_analyzer_iterator_position(i3)); FIXME: expect warning $V.end() - 2
+}
+
+void vector_emplace_end(std::vector<int> &V, int n) {
+ auto i0 = V.cbegin(), i1 = --V.cend(), i2 = V.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(V), "$V.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(V), "$V.end()");
+
+ auto i3 = V.emplace(i2, n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{FALSE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(V)); // expected-warning{{$V.begin()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$V.begin()}}
+
+ // clang_analyzer_express(clang_analyzer_container_end(V)); FIXME: expect warning $V.end()
+ clang_analyzer_express(clang_analyzer_iterator_position(i1)); // expected-warning{{$V.end() - 1}} FIXME: Should be $V.end() - 2
+ // clang_analyzer_express(clang_analyzer_iterator_position(i3)); FIXME: expect warning $V.end() - 1
+}
+
+/// std::deque-like containers: All iterators, including the past-the-end
+/// iterator, are invalidated.
+
+void deque_emplace_begin(std::deque<int> &D, int n) {
+ auto i0 = D.cbegin(), i1 = D.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(D), "$D.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(D), "$D.end()");
+
+ auto i2 = D.emplace(i0, n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{FALSE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(D)); // expected-warning{{$D.begin()}} FIXME: Should be $D.begin() - 1
+ // clang_analyzer_express(clang_analyzer_iterator_position(i2)); FIXME: expect warning $D.begin() - 1
+
+ // clang_analyzer_express(clang_analyzer_container_end(D)); FIXME: expect warning $D.end()
+}
+
+void deque_emplace_behind_begin(std::deque<int> &D, int n) {
+ auto i0 = D.cbegin(), i1 = ++D.cbegin(), i2 = D.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(D), "$D.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(D), "$D.end()");
+
+ auto i3 = D.emplace(i1, n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{FALSE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(D)); // expected-warning{{$D.begin()}} FIXME: Should be $D.begin - 1
+ // clang_analyzer_express(clang_analyzer_iterator_position(i3)); FIXME: expect warning $D.begin() - 1
+
+ // clang_analyzer_express(clang_analyzer_container_end(D)); FIXME: expect warning $D.end()
+}
+
+void deque_emplace_unknown(std::deque<int> &D, int n) {
+ auto i0 = D.cbegin(), i1 = return_any_iterator(D.cbegin()), i2 = D.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(D), "$D.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(D), "$D.end()");
+ clang_analyzer_denote(clang_analyzer_iterator_position(i1), "$i1");
+
+ auto i3 = D.emplace(i1, n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{FALSE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(D)); // expected-warning{{$D.begin()}}
+
+ // clang_analyzer_express(clang_analyzer_iterator_position(i3)); FIXME: expect warning $i1 - 1
+
+ // clang_analyzer_express(clang_analyzer_container_end(D)); FIXME: expect warning $D.end()
+}
+
+void deque_emplace_ahead_of_end(std::deque<int> &D, int n) {
+ auto i0 = D.cbegin(), i1 = --D.cend(), i2 = D.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(D), "$D.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(D), "$D.end()");
+
+ auto i3 = D.emplace(i1, n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{FALSE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(D)); // expected-warning{{$D.begin()}}
+
+ // clang_analyzer_express(clang_analyzer_container_end(D)); FIXME: expect warning $D.end() + 1
+ // clang_analyzer_express(clang_analyzer_iterator_position(i3)); FIXME: expect warning $D.end() - 2
+}
+
+void deque_emplace_end(std::deque<int> &D, int n) {
+ auto i0 = D.cbegin(), i1 = --D.cend(), i2 = D.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(D), "$D.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(D), "$D.end()");
+
+ auto i3 = D.emplace(i2, n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{FALSE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(D)); // expected-warning{{$D.begin()}}
+
+ // clang_analyzer_express(clang_analyzer_container_end(D)); FIXME: expect warning $D.end()
+ // clang_analyzer_express(clang_analyzer_iterator_position(i3)); FIXME: expect warning $D.end() - 1
+}
+
+/// emplace_after() [std::forward_list-like containers]
+///
+/// - Design decision: shifts positions to the ->RIGHT-> (i.e. all iterator
+/// ahead of the emplacement point are incremented; if the
+/// relation between the emplacement point and the
+/// past-the-end position of the container is known, the
+/// first position of the container is also incremented).
+///
+/// - No iterators are invalidated.
+
+void forward_list_emplace_after_begin(std::forward_list<int> &FL, int n) {
+ auto i0 = FL.cbegin(), i1 = FL.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(FL), "$FL.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(FL), "$FL.end()");
+
+ auto i2 = FL.emplace_after(i0, n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{TRUE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(FL)); // expected-warning{{$FL.begin()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$FL.begin()}}
+ // clang_analyzer_express(clang_analyzer_iterator_position(i2)); FIXME: expect warning $FL.begin() + 1
+
+ clang_analyzer_express(clang_analyzer_container_end(FL)); // expected-warning{{$FL.end()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i1)); // expected-warning{{$FL.end()}}
+}
+
+void forward_list_emplace_after_behind_begin(std::forward_list<int> &FL,
+ int n) {
+ auto i0 = FL.cbegin(), i1 = ++FL.cbegin(), i2 = FL.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(FL), "$FL.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(FL), "$FL.end()");
+
+ auto i3 = FL.emplace_after(i1, n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{TRUE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(FL)); // expected-warning{{$FL.begin()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$FL.begin()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i1)); // expected-warning{{$FL.begin() + 1}}
+ // clang_analyzer_express(clang_analyzer_iterator_position(i3)); FIXME: expect warning $FL.begin() + 2
+
+ clang_analyzer_express(clang_analyzer_container_end(FL)); // expected-warning{{$FL.end()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i2)); // expected-warning{{$FL.end()}}
+}
+
+void forward_list_emplace_after_unknown(std::forward_list<int> &FL, int n) {
+ auto i0 = FL.cbegin(), i1 = return_any_iterator(FL.cbegin()), i2 = FL.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(FL), "$FL.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(FL), "$FL.end()");
+ clang_analyzer_denote(clang_analyzer_iterator_position(i1), "$i1");
+
+ auto i3 = FL.emplace_after(i1, n);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{TRUE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(FL)); // expected-warning{{$FL.begin()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$FL.begin()}}
+
+ clang_analyzer_express(clang_analyzer_iterator_position(i1)); // expected-warning{{$i1}}
+ // clang_analyzer_express(clang_analyzer_iterator_position(i3)); FIXME: expect warning $i1 + 1
+
+ clang_analyzer_express(clang_analyzer_container_end(FL)); // expected-warning{{$FL.end()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i2)); // expected-warning{{$FL.end()}}
+}
+
+/// erase()
+///
+/// - Design decision: shifts positions to the ->RIGHT-> (i.e. all iterator
+/// ahead of the ereased element are incremented; if the
+/// relation between the position of the erased element
+/// and the first position of the container is known, the
+/// first position of the container is also incremented).
+///
+/// - Iterator invalidation rules depend the container type.
+
+/// std::list-like containers: Iterators to the erased element are invalidated.
+/// Other iterators are not affected.
+
+void list_erase_begin(std::list<int> &L) {
+ auto i0 = L.cbegin(), i1 = ++L.cbegin(), i2 = L.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(L), "$L.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(L), "$L.end()");
+
+ auto i3 = L.erase(i0);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{TRUE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(L)); // expected-warning{{$L.begin()}} FIXME: Should be$L.begin() + 1
+ clang_analyzer_express(clang_analyzer_iterator_position(i1)); // expected-warning{{$L.begin() + 1}}
+ // clang_analyzer_express(clang_analyzer_iterator_position(i3)); FIXME: expect warning $L.begin() + 1
+
+ clang_analyzer_express(clang_analyzer_container_end(L)); // expected-warning{{$L.end()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i2)); // expected-warning{{$L.end()}}
+}
+
+void list_erase_behind_begin(std::list<int> &L, int n) {
+ auto i0 = L.cbegin(), i1 = ++L.cbegin(), i2 = L.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(L), "$L.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(L), "$L.end()");
+
+ auto i3 = L.erase(i1);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{TRUE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(L)); // expected-warning{{$L.begin()}} FIXME: Should be $L.begin() + 1
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$L.begin()}} FIXME: Should be $L.begin() + 1
+ // clang_analyzer_express(clang_analyzer_iterator_position(i3)); FIXME: expect warning $L.begin() + 2
+
+ clang_analyzer_express(clang_analyzer_container_end(L)); // expected-warning{{$L.end()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i2)); // expected-warning{{$L.end()}}
+}
+
+void list_erase_unknown(std::list<int> &L) {
+ auto i0 = L.cbegin(), i1 = return_any_iterator(L.cbegin()), i2 = L.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(L), "$L.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(L), "$L.end()");
+ clang_analyzer_denote(clang_analyzer_iterator_position(i1), "$i1");
+
+ auto i3 = L.erase(i1);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{TRUE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(L)); // expected-warning{{$L.begin()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$L.begin()}}
+
+ // clang_analyzer_express(clang_analyzer_iterator_position(i3)); FIXME: expect warning $i1 + 1
+
+ clang_analyzer_express(clang_analyzer_container_end(L)); // expected-warning{{$L.end()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i2)); // expected-warning{{$L.end()}}
+}
+
+void list_erase_ahead_of_end(std::list<int> &L) {
+ auto i0 = L.cbegin(), i1 = --L.cend(), i2 = L.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(L), "$L.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(L), "$L.end()");
+
+ auto i3 = L.erase(i1);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{TRUE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(L)); // expected-warning{{$L.begin()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$L.begin()}}
+
+ clang_analyzer_express(clang_analyzer_container_end(L)); // expected-warning{{$L.end()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i2)); // expected-warning{{$L.end()}}
+ // clang_analyzer_express(clang_analyzer_iterator_position(i3)); FIXME: expect warning $L.end()
+}
+
+/// std::vector-like containers: Invalidates iterators at or after the point of
+/// the erase, including the past-the-end iterator.
+
+void vector_erase_begin(std::vector<int> &V) {
+ auto i0 = V.cbegin(), i1 = ++V.cbegin(), i2 = V.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(V), "$V.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(V), "$V.end()");
+
+ auto i3 = V.erase(i0);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{FALSE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(V)); // expected-warning{{$V.begin()}} FIXME: Should be $V.begin() + 1
+ // clang_analyzer_express(clang_analyzer_iterator_position(i3)); FIXME: expect warning $V.begin() + 1
+
+ // clang_analyzer_express(clang_analyzer_container_end(V)); FIXME: expect warning $V.end()
+}
+
+void vector_erase_behind_begin(std::vector<int> &V, int n) {
+ auto i0 = V.cbegin(), i1 = ++V.cbegin(), i2 = V.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(V), "$V.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(V), "$V.end()");
+
+ auto i3 = V.erase(i1);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{FALSE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(V)); // expected-warning{{$V.begin()}} FIXME: Should be $V.begin() + 1
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$V.begin()}} FIXME: Should be $V.begin() + 1
+ // clang_analyzer_express(clang_analyzer_iterator_position(i3)); FIXME: expect warning $V.begin() + 2
+
+ // clang_analyzer_express(clang_analyzer_container_end(V)); FIXME: expect warning $V.end()
+}
+
+void vector_erase_unknown(std::vector<int> &V) {
+ auto i0 = V.cbegin(), i1 = return_any_iterator(V.cbegin()), i2 = V.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(V), "$V.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(V), "$V.end()");
+ clang_analyzer_denote(clang_analyzer_iterator_position(i1), "$i1");
+
+ auto i3 = V.erase(i1);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{FALSE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(V)); // expected-warning{{$V.begin()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$V.begin()}}
+
+ // clang_analyzer_express(clang_analyzer_iterator_position(i3)); FIXME: expect warning $i1 + 1
+
+ // clang_analyzer_express(clang_analyzer_container_end(V)); FIXME: expect warning $V.end()
+}
+
+void vector_erase_ahead_of_end(std::vector<int> &V) {
+ auto i0 = V.cbegin(), i1 = --V.cend(), i2 = V.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(V), "$V.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(V), "$V.end()");
+
+ auto i3 = V.erase(i1);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{FALSE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(V)); // expected-warning{{$V.begin()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$V.begin()}}
+
+ // clang_analyzer_express(clang_analyzer_container_end(V)); FIXME: expect warning $V.end()
+ // clang_analyzer_express(clang_analyzer_iterator_position(i3)); FIXME: expect warning $V.end()
+}
+
+/// std::deque-like containers: All iterators are invalidated, unless the erased
+/// element is at the end or the beginning of the
+/// container, in which case only the iterators to
+/// the erased element are invalidated. The
+/// past-the-end iterator is also invalidated unless
+/// the erased element is at the beginning of the
+/// container and the last element is not erased.
+
+void deque_erase_begin(std::deque<int> &D) {
+ auto i0 = D.cbegin(), i1 = ++D.cbegin(), i2 = D.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(D), "$D.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(D), "$D.end()");
+
+ auto i3 = D.erase(i0);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{FALSE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(D)); // expected-warning{{$D.begin()}} FIXME: Should be $D.begin() + 1
+ // clang_analyzer_express(clang_analyzer_iterator_position(i3)); FIXME: expect warning $D.begin() + 1
+
+ // clang_analyzer_express(clang_analyzer_container_end(D)); FIXME: expect warning{{$D.end()
+}
+
+void deque_erase_behind_begin(std::deque<int> &D, int n) {
+ auto i0 = D.cbegin(), i1 = ++D.cbegin(), i2 = D.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(D), "$D.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(D), "$D.end()");
+
+ auto i3 = D.erase(i1);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{FALSE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(D)); // expected-warning{{$D.begin()}} FIXME: Should be $D.begin() + 1
+ // clang_analyzer_express(clang_analyzer_iterator_position(i3)); FIXME: expect warning $D.begin() + 2
+
+ // clang_analyzer_express(clang_analyzer_container_end(D)); FIXME: expect warning $D.end()
+}
+
+void deque_erase_unknown(std::deque<int> &D) {
+ auto i0 = D.cbegin(), i1 = return_any_iterator(D.cbegin()), i2 = D.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(D), "$D.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(D), "$D.end()");
+ clang_analyzer_denote(clang_analyzer_iterator_position(i1), "$i1");
+
+ auto i3 = D.erase(i1);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{FALSE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(D)); // expected-warning{{$D.begin()}}
+
+ // clang_analyzer_express(clang_analyzer_iterator_position(i3)); FIXME: expect warning $i1 + 1
+
+ // clang_analyzer_express(clang_analyzer_container_end(D)); FIXME: expect warning $D.end()
+}
+
+void deque_erase_ahead_of_end(std::deque<int> &D) {
+ auto i0 = D.cbegin(), i1 = --D.cend(), i2 = D.cend();
+
+ clang_analyzer_denote(clang_analyzer_container_begin(D), "$D.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(D), "$D.end()");
+
+ auto i3 = D.erase(i1);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{FALSE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(D)); // expected-warning{{$D.begin()}}
+
+ // clang_analyzer_express(clang_analyzer_container_end(D)); FIXME: expect warning $D.end()
+ // clang_analyzer_express(clang_analyzer_iterator_position(i3)); FIXME: expect warning $D.end()
+}
+
+/// erase_after() [std::forward_list-like containers]
+///
+/// - Design decision: shifts positions to the <-LEFT<- (i.e. all iterator
+/// begind of the ereased element are decremented; if the
+/// relation between the position of the erased element
+/// and the past-the-end position of the container is known,
+/// the past-the-end position of the container is also
+/// decremented).
+///
+/// - Iterators to the erased element are invalidated. Other iterators are not
+/// affected.
+
+
+void forward_list_erase_after_begin(std::forward_list<int> &FL) {
+ auto i0 = FL.cbegin(), i1 = ++FL.cbegin(), i2 = i1, i3 = FL.cend();
+ ++i2;
+
+ clang_analyzer_denote(clang_analyzer_container_begin(FL), "$FL.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(FL), "$FL.end()");
+
+ auto i4 = FL.erase_after(i0);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i3)); //expected-warning{{TRUE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(FL)); // expected-warning{{$FL.begin()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$FL.begin()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i2)); // expected-warning{{$FL.begin() + 2}} FIXME: Should be $FL.begin() + 1
+ // clang_analyzer_express(clang_analyzer_iterator_position(i4)); FIXME: expect warning $FL.begin() + 1
+
+ clang_analyzer_express(clang_analyzer_container_end(FL)); // expected-warning{{$FL.end()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i3)); // expected-warning{{$FL.end()}}
+}
+
+void forward_list_erase_after_unknown(std::forward_list<int> &FL) {
+ auto i0 = FL.cbegin(), i1 = return_any_iterator(FL.cbegin()), i2 = i1,
+ i3 = i1, i4 = FL.cend();
+ ++i2;
+ ++i3;
+ ++i3;
+
+ clang_analyzer_denote(clang_analyzer_container_begin(FL), "$FL.begin()");
+ clang_analyzer_denote(clang_analyzer_container_end(FL), "$FL.end()");
+ clang_analyzer_denote(clang_analyzer_iterator_position(i1), "$i1");
+
+ auto i5 = FL.erase_after(i1);
+
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{FALSE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i3)); //expected-warning{{TRUE}}
+ clang_analyzer_eval(clang_analyzer_iterator_validity(i4)); //expected-warning{{TRUE}}
+
+ clang_analyzer_express(clang_analyzer_container_begin(FL)); // expected-warning{{$FL.begin()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$FL.begin()}}
+
+ clang_analyzer_express(clang_analyzer_iterator_position(i1)); // expected-warning{{$i1}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i3)); // expected-warning{{$i1 + 2}} FIXME: Should be $i1 + 1
+ // clang_analyzer_express(clang_analyzer_iterator_position(i5)); FIXME: expect warning $i1 + 1
+
+ clang_analyzer_express(clang_analyzer_container_end(FL)); // expected-warning{{$FL.end()}}
+ clang_analyzer_express(clang_analyzer_iterator_position(i4)); // expected-warning{{$FL.end()}}
+}
+
+struct simple_iterator_base {
+ simple_iterator_base();
+ simple_iterator_base(const simple_iterator_base& rhs);
+ simple_iterator_base &operator=(const simple_iterator_base& rhs);
+ virtual ~simple_iterator_base();
+ bool friend operator==(const simple_iterator_base &lhs,
+ const simple_iterator_base &rhs);
+ bool friend operator!=(const simple_iterator_base &lhs,
+ const simple_iterator_base &rhs);
+private:
+ int *ptr;
+};
+
+struct simple_derived_iterator: public simple_iterator_base {
+ int& operator*();
+ int* operator->();
+ simple_iterator_base &operator++();
+ simple_iterator_base operator++(int);
+ simple_iterator_base &operator--();
+ simple_iterator_base operator--(int);
+};
+
+struct simple_container {
+ typedef simple_derived_iterator iterator;
+
+ iterator begin();
+ iterator end();
+};
+
+void good_derived(simple_container c) {
+ auto i0 = c.end();
+
+ if (i0 != c.end()) {
+ clang_analyzer_warnIfReached();
+ }
+}
+
+void iter_diff(std::vector<int> &V) {
+ auto i0 = V.begin(), i1 = V.end();
+ ptrdiff_t len = i1 - i0; // no-crash
+}
+
+void deferred_assumption(std::vector<int> &V, int e) {
+ const auto first = V.begin();
+ const auto comp1 = (first != V.end()), comp2 = (first == V.end());
+ if (comp1) {
+ clang_analyzer_eval(clang_analyzer_container_end(V) ==
+ clang_analyzer_iterator_position(first)); // expected-warning@-1{{FALSE}}
+ }
+}
+
+void loop(std::vector<int> &V, int e) {
+ auto start = V.begin();
+ while (true) {
+ auto item = std::find(start, V.end(), e);
+ if (item == V.end())
+ break;
+
+ clang_analyzer_eval(clang_analyzer_container_end(V) ==
+ clang_analyzer_iterator_position(item)); // expected-warning@-1{{FALSE}}
+ }
+}
+
+template <typename InputIterator, typename T>
+InputIterator nonStdFind(InputIterator first, InputIterator last,
+ const T &val) {
+ for (auto i = first; i != last; ++i) {
+ if (*i == val) {
+ return i;
+ }
+ }
+ return last;
+}
+
+void non_std_find(std::vector<int> &V, int e) {
+ auto first = nonStdFind(V.begin(), V.end(), e);
+ clang_analyzer_eval(clang_analyzer_container_end(V) ==
+ clang_analyzer_iterator_position(first)); // expected-warning@-1{{FALSE}} expected-warning@-1{{TRUE}}
+ if (V.end() != first) {
+ clang_analyzer_eval(clang_analyzer_container_end(V) ==
+ clang_analyzer_iterator_position(first)); // expected-warning@-1{{FALSE}}
+ }
+}
+
+void clang_analyzer_printState();
+
+void print_state(std::vector<int> &V) {
+ const auto i0 = V.cbegin();
+ clang_analyzer_printState();
+
+// CHECK: "checker_messages": [
+// CHECK-NEXT: { "checker": "alpha.cplusplus.IteratorModeling", "messages": [
+// CHECK-NEXT: "Container Data :",
+// CHECK-NEXT: "SymRegion{reg_$[[#]]<std::vector<int> & V>} : [ conj_$[[#]]{long, LC[[#]], S[[#]], #[[#]]} .. <Unknown> ]",
+// CHECK-NEXT: "Iterator Positions :",
+// CHECK-NEXT: "i0 : Valid ; Container == SymRegion{reg_$[[#]]<std::vector<int> & V>} ; Offset == conj_$[[#]]{long, LC[[#]], S[[#]], #[[#]]}"
+// CHECK-NEXT: ]}
+
+ const auto i1 = V.cend();
+ clang_analyzer_printState();
+
+// CHECK: "checker_messages": [
+// CHECK-NEXT: { "checker": "alpha.cplusplus.IteratorModeling", "messages": [
+// CHECK-NEXT: "Container Data :",
+// CHECK-NEXT: "SymRegion{reg_$[[#]]<std::vector<int> & V>} : [ conj_$[[#]]{long, LC[[#]], S[[#]], #[[#]]} .. conj_$[[#]]{long, LC[[#]], S[[#]], #[[#]]} ]",
+// CHECK-NEXT: "Iterator Positions :",
+// CHECK-NEXT: "i1 : Valid ; Container == SymRegion{reg_$[[#]]<std::vector<int> & V>} ; Offset == conj_$[[#]]{long, LC[[#]], S[[#]], #[[#]]}"
+// CHECK-NEXT: ]}
+}
diff --git a/src/llvm-project/clang/test/Analysis/iterator-range.cpp b/src/llvm-project/clang/test/Analysis/iterator-range.cpp
index bc7e082..71af17a 100644
--- a/src/llvm-project/clang/test/Analysis/iterator-range.cpp
+++ b/src/llvm-project/clang/test/Analysis/iterator-range.cpp
@@ -5,239 +5,376 @@
void clang_analyzer_warnIfReached();
-void simple_good_end(const std::vector<int> &v) {
- auto i = v.end();
- if (i != v.end()) {
- clang_analyzer_warnIfReached();
- *i; // no-warning
- }
-}
+// Dereference - operator*()
-void simple_good_end_negated(const std::vector<int> &v) {
- auto i = v.end();
- if (!(i == v.end())) {
- clang_analyzer_warnIfReached();
- *i; // no-warning
- }
-}
-
-void simple_bad_end(const std::vector<int> &v) {
- auto i = v.end();
- *i; // expected-warning{{Past-the-end iterator dereferenced}}
-}
-
-void copy(const std::vector<int> &v) {
- auto i1 = v.end();
- auto i2 = i1;
- *i2; // expected-warning{{Past-the-end iterator dereferenced}}
-}
-
-void decrease(const std::vector<int> &v) {
- auto i = v.end();
- --i;
+void deref_begin(const std::vector<int> &V) {
+ auto i = V.begin();
*i; // no-warning
}
-void copy_and_decrease1(const std::vector<int> &v) {
- auto i1 = v.end();
- auto i2 = i1;
- --i1;
- *i1; // no-warning
+void deref_begind_begin(const std::vector<int> &V) {
+ auto i = ++V.begin();
+ *i; // no-warning
}
-void copy_and_decrease2(const std::vector<int> &v) {
- auto i1 = v.end();
- auto i2 = i1;
- --i1;
- *i2; // expected-warning{{Past-the-end iterator dereferenced}}
+template <typename Iter> Iter return_any_iterator(const Iter &It);
+
+void deref_unknown(const std::vector<int> &V) {
+ auto i = return_any_iterator(V.begin());
+ *i; // no-warning
}
-void copy_and_increase1(const std::vector<int> &v) {
- auto i1 = v.begin();
- auto i2 = i1;
- ++i1;
- if (i1 == v.end())
- *i2; // no-warning
+void deref_ahead_of_end(const std::vector<int> &V) {
+ auto i = --V.end();
+ *i; // no-warning
}
-void copy_and_increase2(const std::vector<int> &v) {
- auto i1 = v.begin();
- auto i2 = i1;
- ++i1;
- if (i2 == v.end())
- *i2; // expected-warning{{Past-the-end iterator dereferenced}}
+void deref_end(const std::vector<int> &V) {
+ auto i = V.end();
+ *i; // expected-warning{{Past-the-end iterator dereferenced}}
}
-void copy_and_increase3(const std::vector<int> &v) {
- auto i1 = v.begin();
- auto i2 = i1;
- ++i1;
- if (v.end() == i2)
- *i2; // expected-warning{{Past-the-end iterator dereferenced}}
+// Prefix increment - operator++()
+
+void incr_begin(const std::vector<int> &V) {
+ auto i = V.begin();
+ ++i; // no-warning
}
-template <class InputIterator, class T>
-InputIterator nonStdFind(InputIterator first, InputIterator last,
- const T &val) {
- for (auto i = first; i != last; ++i) {
- if (*i == val) {
- return i;
- }
- }
- return last;
+void incr_behind_begin(const std::vector<int> &V) {
+ auto i = ++V.begin();
+ ++i; // no-warning
}
-void good_non_std_find(std::vector<int> &V, int e) {
- auto first = nonStdFind(V.begin(), V.end(), e);
- if (V.end() != first)
- *first; // no-warning
+void incr_unknown(const std::vector<int> &V) {
+ auto i = return_any_iterator(V.begin());
+ ++i; // no-warning
}
-void bad_non_std_find(std::vector<int> &V, int e) {
- auto first = nonStdFind(V.begin(), V.end(), e);
- *first; // expected-warning{{Past-the-end iterator dereferenced}}
+void incr_ahead_of_end(const std::vector<int> &V) {
+ auto i = --V.end();
+ ++i; // no-warning
}
-void tricky(std::vector<int> &V, int e) {
- const auto first = V.begin();
- const auto comp1 = (first != V.end()), comp2 = (first == V.end());
- if (comp1)
- *first; // no-warning
+void incr_end(const std::vector<int> &V) {
+ auto i = V.end();
+ ++i; // expected-warning{{Iterator incremented behind the past-the-end iterator}}
}
-void loop(std::vector<int> &V, int e) {
- auto start = V.begin();
- while (true) {
- auto item = std::find(start, V.end(), e);
- if (item == V.end())
- break;
- *item; // no-warning
- start = ++item; // no-warning
- }
+// Postfix increment - operator++(int)
+
+void begin_incr(const std::vector<int> &V) {
+ auto i = V.begin();
+ i++; // no-warning
}
-void good_push_back(std::list<int> &L, int n) {
- auto i0 = --L.cend();
- L.push_back(n);
- *++i0; // no-warning
+void behind_begin_incr(const std::vector<int> &V) {
+ auto i = ++V.begin();
+ i++; // no-warning
}
-void bad_push_back(std::list<int> &L, int n) {
- auto i0 = --L.cend();
- L.push_back(n);
- ++i0;
- *++i0; // expected-warning{{Past-the-end iterator dereferenced}}
+void unknown_incr(const std::vector<int> &V) {
+ auto i = return_any_iterator(V.begin());
+ i++; // no-warning
}
-void good_pop_back(std::list<int> &L, int n) {
- auto i0 = --L.cend(); --i0;
- L.pop_back();
- *i0; // no-warning
+void ahead_of_end_incr(const std::vector<int> &V) {
+ auto i = --V.end();
+ i++; // no-warning
}
-void bad_pop_back(std::list<int> &L, int n) {
- auto i0 = --L.cend(); --i0;
- L.pop_back();
- *++i0; // expected-warning{{Past-the-end iterator dereferenced}}
+void end_incr(const std::vector<int> &V) {
+ auto i = V.end();
+ i++; // expected-warning{{Iterator incremented behind the past-the-end iterator}}
}
-void good_push_front(std::list<int> &L, int n) {
- auto i0 = L.cbegin();
- L.push_front(n);
- *--i0; // no-warning
+// Prefix decrement - operator--()
+
+void decr_begin(const std::vector<int> &V) {
+ auto i = V.begin();
+ --i; // expected-warning{{Iterator decremented ahead of its valid range}}
}
-void bad_push_front(std::list<int> &L, int n) {
- auto i0 = L.cbegin();
- L.push_front(n);
- --i0;
- --i0; // expected-warning{{Iterator decremented ahead of its valid range}}
+void decr_behind_begin(const std::vector<int> &V) {
+ auto i = ++V.begin();
+ --i; // no-warning
}
-void good_pop_front(std::list<int> &L, int n) {
- auto i0 = ++L.cbegin();
- L.pop_front();
- *i0; // no-warning
+void decr_unknown(const std::vector<int> &V) {
+ auto i = return_any_iterator(V.begin());
+ --i; // no-warning
}
-void bad_pop_front(std::list<int> &L, int n) {
- auto i0 = ++L.cbegin();
- L.pop_front();
- --i0; // expected-warning{{Iterator decremented ahead of its valid range}}
+void decr_ahead_of_end(const std::vector<int> &V) {
+ auto i = --V.end();
+ --i; // no-warning
}
-void bad_move(std::list<int> &L1, std::list<int> &L2) {
- auto i0 = --L2.cend();
- L1 = std::move(L2);
- *++i0; // expected-warning{{Past-the-end iterator dereferenced}}
+void decr_end(const std::vector<int> &V) {
+ auto i = V.end();
+ --i; // no-warning
}
-void bad_move_push_back(std::list<int> &L1, std::list<int> &L2, int n) {
- auto i0 = --L2.cend();
- L2.push_back(n);
- L1 = std::move(L2);
- ++i0;
- *++i0; // expected-warning{{Past-the-end iterator dereferenced}}
+// Postfix decrement - operator--(int)
+
+void begin_decr(const std::vector<int> &V) {
+ auto i = V.begin();
+ i--; // expected-warning{{Iterator decremented ahead of its valid range}}
}
-void good_incr_begin(const std::list<int> &L) {
- auto i0 = L.begin();
- ++i0; // no-warning
+void behind_begin_decr(const std::vector<int> &V) {
+ auto i = ++V.begin();
+ i--; // no-warning
}
-void bad_decr_begin(const std::list<int> &L) {
- auto i0 = L.begin();
- --i0; // expected-warning{{Iterator decremented ahead of its valid range}}
+void unknown_decr(const std::vector<int> &V) {
+ auto i = return_any_iterator(V.begin());
+ i--; // no-warning
}
-void good_decr_end(const std::list<int> &L) {
- auto i0 = L.end();
- --i0; // no-warning
+void ahead_of_end_decr(const std::vector<int> &V) {
+ auto i = --V.end();
+ i--; // no-warning
}
-void bad_incr_end(const std::list<int> &L) {
- auto i0 = L.end();
- ++i0; // expected-warning{{Iterator incremented behind the past-the-end iterator}}
+void end_decr(const std::vector<int> &V) {
+ auto i = V.end();
+ i--; // no-warning
}
-struct simple_iterator_base {
- simple_iterator_base();
- simple_iterator_base(const simple_iterator_base& rhs);
- simple_iterator_base &operator=(const simple_iterator_base& rhs);
- virtual ~simple_iterator_base();
- bool friend operator==(const simple_iterator_base &lhs,
- const simple_iterator_base &rhs);
- bool friend operator!=(const simple_iterator_base &lhs,
- const simple_iterator_base &rhs);
-private:
- int *ptr;
+// Addition assignment - operator+=(int)
+
+void incr_by_2_begin(const std::vector<int> &V) {
+ auto i = V.begin();
+ i += 2; // no-warning
+}
+
+void incr_by_2_behind_begin(const std::vector<int> &V) {
+ auto i = ++V.begin();
+ i += 2; // no-warning
+}
+
+void incr_by_2_unknown(const std::vector<int> &V) {
+ auto i = return_any_iterator(V.begin());
+ i += 2; // no-warning
+}
+
+void incr_by_2_ahead_by_2_of_end(const std::vector<int> &V) {
+ auto i = --V.end();
+ --i;
+ i += 2; // no-warning
+}
+
+void incr_by_2_ahead_of_end(const std::vector<int> &V) {
+ auto i = --V.end();
+ i += 2; // expected-warning{{Iterator incremented behind the past-the-end iterator}}
+}
+
+void incr_by_2_end(const std::vector<int> &V) {
+ auto i = V.end();
+ i += 2; // expected-warning{{Iterator incremented behind the past-the-end iterator}}
+}
+
+// Addition - operator+(int)
+
+void incr_by_2_copy_begin(const std::vector<int> &V) {
+ auto i = V.begin();
+ auto j = i + 2; // no-warning
+}
+
+void incr_by_2_copy_behind_begin(const std::vector<int> &V) {
+ auto i = ++V.begin();
+ auto j = i + 2; // no-warning
+}
+
+void incr_by_2_copy_unknown(const std::vector<int> &V) {
+ auto i = return_any_iterator(V.begin());
+ auto j = i + 2; // no-warning
+}
+
+void incr_by_2_copy_ahead_by_2_of_end(const std::vector<int> &V) {
+ auto i = --V.end();
+ --i;
+ auto j = i + 2; // no-warning
+}
+
+void incr_by_2_copy_ahead_of_end(const std::vector<int> &V) {
+ auto i = --V.end();
+ auto j = i + 2; // expected-warning{{Iterator incremented behind the past-the-end iterator}}
+}
+
+void incr_by_2_copy_end(const std::vector<int> &V) {
+ auto i = V.end();
+ auto j = i + 2; // expected-warning{{Iterator incremented behind the past-the-end iterator}}
+}
+
+// Subtraction assignment - operator-=(int)
+
+void decr_by_2_begin(const std::vector<int> &V) {
+ auto i = V.begin();
+ i -= 2; // expected-warning{{Iterator decremented ahead of its valid range}}
+}
+
+void decr_by_2_behind_begin(const std::vector<int> &V) {
+ auto i = ++V.begin();
+ i -= 2; // expected-warning{{Iterator decremented ahead of its valid range}}
+}
+
+void decr_by_2_behind_begin_by_2(const std::vector<int> &V) {
+ auto i = ++V.begin();
+ ++i;
+ i -= 2; // no-warning
+}
+
+void decr_by_2_unknown(const std::vector<int> &V) {
+ auto i = return_any_iterator(V.begin());
+ i -= 2; // no-warning
+}
+
+void decr_by_2_ahead_of_end(const std::vector<int> &V) {
+ auto i = --V.end();
+ i -= 2; // no-warning
+}
+
+void decr_by_2_end(const std::vector<int> &V) {
+ auto i = V.end();
+ i -= 2; // no-warning
+}
+
+// Subtraction - operator-(int)
+
+void decr_by_2_copy_begin(const std::vector<int> &V) {
+ auto i = V.begin();
+ auto j = i - 2; // expected-warning{{Iterator decremented ahead of its valid range}}
+}
+
+void decr_by_2_copy_behind_begin(const std::vector<int> &V) {
+ auto i = ++V.begin();
+ auto j = i - 2; // expected-warning{{Iterator decremented ahead of its valid range}}
+}
+
+void decr_by_2_copy_behind_begin_by_2(const std::vector<int> &V) {
+ auto i = ++V.begin();
+ ++i;
+ auto j = i - 2; // no-warning
+}
+
+void decr_by_2_copy_unknown(const std::vector<int> &V) {
+ auto i = return_any_iterator(V.begin());
+ auto j = i - 2; // no-warning
+}
+
+void decr_by_2_copy_ahead_of_end(const std::vector<int> &V) {
+ auto i = --V.end();
+ auto j = i - 2; // no-warning
+}
+
+void decr_by_2_copy_end(const std::vector<int> &V) {
+ auto i = V.end();
+ auto j = i - 2; // no-warning
+}
+
+//
+// Subscript - operator[](int)
+//
+
+// By zero
+
+void subscript_zero_begin(const std::vector<int> &V) {
+ auto i = V.begin();
+ auto j = i[0]; // no-warning
+}
+
+void subscript_zero_behind_begin(const std::vector<int> &V) {
+ auto i = ++V.begin();
+ auto j = i[0]; // no-warning
+}
+
+void subscript_zero_unknown(const std::vector<int> &V) {
+ auto i = return_any_iterator(V.begin());
+ auto j = i[0]; // no-warning
+}
+
+void subscript_zero_ahead_of_end(const std::vector<int> &V) {
+ auto i = --V.end();
+ auto j = i[0]; // no-warning
+}
+
+void subscript_zero_end(const std::vector<int> &V) {
+ auto i = V.end();
+ auto j = i[0]; // expected-warning{{Past-the-end iterator dereferenced}}
+}
+
+// By negative number
+
+void subscript_negative_begin(const std::vector<int> &V) {
+ auto i = V.begin();
+ auto j = i[-1]; // no-warning FIXME: expect warning Iterator decremented ahead of its valid range
+}
+
+void subscript_negative_behind_begin(const std::vector<int> &V) {
+ auto i = ++V.begin();
+ auto j = i[-1]; // no-warning
+}
+
+void subscript_negative_unknown(const std::vector<int> &V) {
+ auto i = return_any_iterator(V.begin());
+ auto j = i[-1]; // no-warning
+}
+
+void subscript_negative_ahead_of_end(const std::vector<int> &V) {
+ auto i = --V.end();
+ auto j = i[-1]; // no-warning
+}
+
+void subscript_negative_end(const std::vector<int> &V) {
+ auto i = V.end();
+ auto j = i[-1]; // // expected-warning{{Past-the-end iterator dereferenced}} FIXME: expect no warning
+}
+
+// By positive number
+
+void subscript_positive_begin(const std::vector<int> &V) {
+ auto i = V.begin();
+ auto j = i[1]; // no-warning
+}
+
+void subscript_positive_behind_begin(const std::vector<int> &V) {
+ auto i = ++V.begin();
+ auto j = i[1]; // no-warning
+}
+
+void subscript_positive_unknown(const std::vector<int> &V) {
+ auto i = return_any_iterator(V.begin());
+ auto j = i[1]; // no-warning
+}
+
+void subscript_positive_ahead_of_end(const std::vector<int> &V) {
+ auto i = --V.end();
+ auto j = i[1]; // no-warning FIXME: expected warning Past-the-end iterator dereferenced
+}
+
+void subscript_positive_end(const std::vector<int> &V) {
+ auto i = V.end();
+ auto j = i[1]; // expected-warning{{Past-the-end iterator dereferenced}} FIXME: expect warning Iterator incremented behind the past-the-end iterator
+}
+
+//
+// Structure member dereference operators
+//
+
+struct S {
+ int n;
};
-struct simple_derived_iterator: public simple_iterator_base {
- int& operator*();
- int* operator->();
- simple_iterator_base &operator++();
- simple_iterator_base operator++(int);
- simple_iterator_base &operator--();
- simple_iterator_base operator--(int);
-};
+// Member dereference - operator->()
-struct simple_container {
- typedef simple_derived_iterator iterator;
-
- iterator begin();
- iterator end();
-};
-
-void good_derived(simple_container c) {
- auto i0 = c.end();
- if (i0 != c.end()) {
- clang_analyzer_warnIfReached();
- *i0; // no-warning
- }
+void arrow_deref_begin(const std::vector<S> &V) {
+ auto i = V.begin();
+ int n = i->n; // no-warning
}
-void iter_diff(std::vector<int> &V) {
- auto i0 = V.begin(), i1 = V.end();
- ptrdiff_t len = i1 - i0; // no-crash
+void arrow_deref_end(const std::vector<S> &V) {
+ auto i = V.end();
+ int n = i->n; // expected-warning{{Past-the-end iterator dereferenced}}
}
diff --git a/src/llvm-project/clang/test/Analysis/lit.local.cfg b/src/llvm-project/clang/test/Analysis/lit.local.cfg
index d6c0a37..c384544 100644
--- a/src/llvm-project/clang/test/Analysis/lit.local.cfg
+++ b/src/llvm-project/clang/test/Analysis/lit.local.cfg
@@ -22,7 +22,7 @@
"grep -Ev '^[[:space:]]*(%s|%s|%s)[[:space:]]*$'" %
('"uri": "file:.*%basename_t"',
'"version": ".* version .*"',
- '"version": "2\.0\.0-csd\.[0-9]*\.beta\.[0-9-]{10}"')))
+ '"version": "2.1.0"')))
if not config.root.clang_staticanalyzer:
config.unsupported = True
diff --git a/src/llvm-project/clang/test/Analysis/localization-aggressive.m b/src/llvm-project/clang/test/Analysis/localization-aggressive.m
index 2e273e0..145d5e1 100644
--- a/src/llvm-project/clang/test/Analysis/localization-aggressive.m
+++ b/src/llvm-project/clang/test/Analysis/localization-aggressive.m
@@ -293,3 +293,11 @@
takesLocalizedString(@"not localized"); // expected-warning {{User-facing text should use localized string macro}}
}
@end
+
+@interface SynthesizedAccessors : NSObject
+@property (assign) NSObject *obj;
+@end
+
+@implementation SynthesizedAccessors
+// no-crash
+@end
diff --git a/src/llvm-project/clang/test/Analysis/loop-block-counts.c b/src/llvm-project/clang/test/Analysis/loop-block-counts.c
index 04a3f74..66bb850 100644
--- a/src/llvm-project/clang/test/Analysis/loop-block-counts.c
+++ b/src/llvm-project/clang/test/Analysis/loop-block-counts.c
@@ -12,7 +12,7 @@
for (int i = 0; i < 2; ++i)
callee(&arr[i]);
// FIXME: Should be UNKNOWN.
- clang_analyzer_eval(arr[0] == arr[1]); // expected-warning{{TRUE}}
+ clang_analyzer_eval(arr[0] == arr[1]); // expected-warning{{FALSE}}
}
void loopWithCall() {
diff --git a/src/llvm-project/clang/test/Analysis/loop-unrolling.cpp b/src/llvm-project/clang/test/Analysis/loop-unrolling.cpp
index b7375df..761bf5a 100644
--- a/src/llvm-project/clang/test/Analysis/loop-unrolling.cpp
+++ b/src/llvm-project/clang/test/Analysis/loop-unrolling.cpp
@@ -347,9 +347,9 @@
int simple_unknown_bound_loop() {
for (int i = 2; i < getNum(); i++) {
#ifdef DFS
- clang_analyzer_numTimesReached(); // expected-warning {{10}}
+ clang_analyzer_numTimesReached(); // expected-warning {{16}}
#else
- clang_analyzer_numTimesReached(); // expected-warning {{13}}
+ clang_analyzer_numTimesReached(); // expected-warning {{8}}
#endif
}
return 0;
@@ -368,10 +368,10 @@
int nested_inlined_no_unroll1() {
int k;
for (int i = 0; i < 9; i++) {
-#ifdef ANALYZER_CM_Z3
- clang_analyzer_numTimesReached(); // expected-warning {{13}}
+#ifdef DFS
+ clang_analyzer_numTimesReached(); // expected-warning {{18}}
#else
- clang_analyzer_numTimesReached(); // expected-warning {{15}}
+ clang_analyzer_numTimesReached(); // expected-warning {{14}}
#endif
k = simple_unknown_bound_loop(); // reevaluation without inlining, splits the state as well
}
diff --git a/src/llvm-project/clang/test/Analysis/loop-widening.cpp b/src/llvm-project/clang/test/Analysis/loop-widening.cpp
new file mode 100644
index 0000000..fbcb72d
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/loop-widening.cpp
@@ -0,0 +1,27 @@
+// RUN: %clang_analyze_cc1 -verify %s \
+// RUN: -analyzer-checker=core \
+// RUN: -analyzer-config widen-loops=true \
+// RUN: -analyzer-config track-conditions=false \
+// RUN: -analyzer-max-loop 2 -analyzer-output=text
+
+namespace pr43102 {
+class A {
+public:
+ void m_fn1();
+};
+bool g;
+void fn1() {
+ A a;
+ A *b = &a;
+
+ for (;;) { // expected-note{{Loop condition is true. Entering loop body}}
+ // expected-note@-1{{Loop condition is true. Entering loop body}}
+ // expected-note@-2{{Value assigned to 'b'}}
+ // no crash during bug report construction
+
+ g = !b; // expected-note{{Assuming 'b' is null}}
+ b->m_fn1(); // expected-warning{{Called C++ object pointer is null}}
+ // expected-note@-1{{Called C++ object pointer is null}}
+ }
+}
+} // end of namespace pr43102
diff --git a/src/llvm-project/clang/test/Analysis/main.c b/src/llvm-project/clang/test/Analysis/main.c
new file mode 100644
index 0000000..aa4c506
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/main.c
@@ -0,0 +1,32 @@
+// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -verify %s
+
+int x = 1;
+
+struct {
+ int a, b;
+} s = {2, 3};
+
+int arr[] = {4, 5, 6};
+
+void clang_analyzer_eval(int);
+
+int main() {
+ // In main() we know that the initial values are still valid.
+ clang_analyzer_eval(x == 1); // expected-warning{{TRUE}}
+ clang_analyzer_eval(s.a == 2); // expected-warning{{TRUE}}
+ clang_analyzer_eval(s.b == 3); // expected-warning{{TRUE}}
+ clang_analyzer_eval(arr[0] == 4); // expected-warning{{TRUE}}
+ clang_analyzer_eval(arr[1] == 5); // expected-warning{{TRUE}}
+ clang_analyzer_eval(arr[2] == 6); // expected-warning{{TRUE}}
+ return 0;
+}
+
+void foo() {
+ // In other functions these values may already be overwritten.
+ clang_analyzer_eval(x == 1); // expected-warning{{TRUE}} // expected-warning{{FALSE}}
+ clang_analyzer_eval(s.a == 2); // expected-warning{{TRUE}} // expected-warning{{FALSE}}
+ clang_analyzer_eval(s.b == 3); // expected-warning{{TRUE}} // expected-warning{{FALSE}}
+ clang_analyzer_eval(arr[0] == 4); // expected-warning{{TRUE}} // expected-warning{{FALSE}}
+ clang_analyzer_eval(arr[1] == 5); // expected-warning{{TRUE}} // expected-warning{{FALSE}}
+ clang_analyzer_eval(arr[2] == 6); // expected-warning{{TRUE}} // expected-warning{{FALSE}}
+}
diff --git a/src/llvm-project/clang/test/Analysis/main.cpp b/src/llvm-project/clang/test/Analysis/main.cpp
new file mode 100644
index 0000000..c230c38
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/main.cpp
@@ -0,0 +1,22 @@
+// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -verify %s
+
+int x = 1;
+
+struct {
+ int a, b;
+} s = {2, 3};
+
+int arr[] = {4, 5, 6};
+
+void clang_analyzer_eval(int);
+
+int main() {
+ // Do not trust global initializers in C++.
+ clang_analyzer_eval(x == 1); // expected-warning{{TRUE}} // expected-warning{{FALSE}}
+ clang_analyzer_eval(s.a == 2); // expected-warning{{TRUE}} // expected-warning{{FALSE}}
+ clang_analyzer_eval(s.b == 3); // expected-warning{{TRUE}} // expected-warning{{FALSE}}
+ clang_analyzer_eval(arr[0] == 4); // expected-warning{{TRUE}} // expected-warning{{FALSE}}
+ clang_analyzer_eval(arr[1] == 5); // expected-warning{{TRUE}} // expected-warning{{FALSE}}
+ clang_analyzer_eval(arr[2] == 6); // expected-warning{{TRUE}} // expected-warning{{FALSE}}
+ return 0;
+}
diff --git a/src/llvm-project/clang/test/Analysis/malloc.mm b/src/llvm-project/clang/test/Analysis/malloc.mm
index d7bfbf3..1b7dd27 100644
--- a/src/llvm-project/clang/test/Analysis/malloc.mm
+++ b/src/llvm-project/clang/test/Analysis/malloc.mm
@@ -1,4 +1,8 @@
-// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix.Malloc -analyzer-store=region -verify -fblocks %s
+// RUN: %clang_analyze_cc1 -std=c++14 \
+// RUN: -analyzer-checker=core,unix.Malloc,cplusplus.NewDelete \
+// RUN: -analyzer-checker=unix.MismatchedDeallocator \
+// RUN: -verify -fblocks %s
+
#import "Inputs/system-header-simulator-objc.h"
#import "Inputs/system-header-simulator-for-malloc.h"
@@ -61,6 +65,23 @@
NSString *nsstr = [[NSString alloc] initWithBytesNoCopy:data length:dataLength encoding:NSUTF8StringEncoding freeWhenDone:0]; // expected-warning{{leak}}
}
+void testNSStringFreeWhenDoneNewDelete(NSUInteger dataLength) {
+ unsigned char *data = new unsigned char(42);
+ NSData *nsdata = [[NSData alloc] initWithBytesNoCopy:data
+ length:dataLength freeWhenDone:1];
+ // expected-warning@-2{{-initWithBytesNoCopy:length:freeWhenDone: cannot take ownership of memory allocated by 'new'}}
+}
+
+void testNSStringFreeWhenDoneNewDelete2(NSUInteger dataLength) {
+ unsigned char *data = new unsigned char(42);
+ NSData *nsdata = [[NSData alloc] initWithBytesNoCopy:data
+ length:dataLength
+ deallocator:^(void *bytes,
+ NSUInteger length) {
+ delete (unsigned char *)bytes;
+ }]; // no-warning
+}
+
void testNSStringFreeWhenDoneNO2(NSUInteger dataLength) {
unichar *data = (unichar*)malloc(42);
NSString *nsstr = [[NSString alloc] initWithCharactersNoCopy:data length:dataLength freeWhenDone:0]; // expected-warning{{leak}}
diff --git a/src/llvm-project/clang/test/Analysis/mig.mm b/src/llvm-project/clang/test/Analysis/mig.mm
index 0c7d729..e8d08f3 100644
--- a/src/llvm-project/clang/test/Analysis/mig.mm
+++ b/src/llvm-project/clang/test/Analysis/mig.mm
@@ -1,4 +1,4 @@
-// RUN: %clang_analyze_cc1 -w -analyzer-checker=core,osx.MIG\
+// RUN: %clang_analyze_cc1 -w -analyzer-checker=core,osx.MIG -std=c++14 \
// RUN: -analyzer-output=text -fblocks -verify %s
typedef unsigned uint32_t;
diff --git a/src/llvm-project/clang/test/Analysis/misc-ps-region-store.m b/src/llvm-project/clang/test/Analysis/misc-ps-region-store.m
index 1ef1005..d1011bd 100644
--- a/src/llvm-project/clang/test/Analysis/misc-ps-region-store.m
+++ b/src/llvm-project/clang/test/Analysis/misc-ps-region-store.m
@@ -1205,7 +1205,7 @@
void rdar_8642434_funcB(struct rdar_8642434_typeA *x, struct rdar_8642434_typeA *y) {
rdar_8642434_funcA(x);
if (!y)
- rdar_8642434_funcA(y); // expected-warning{{Null pointer passed as an argument to a 'nonnull' parameter}}
+ rdar_8642434_funcA(y); // expected-warning{{Null pointer passed to 1st parameter expecting 'nonnull'}}
}
// <rdar://problem/8848957> - Handle loads and stores from a symbolic index
diff --git a/src/llvm-project/clang/test/Analysis/mismatched-iterator.cpp b/src/llvm-project/clang/test/Analysis/mismatched-iterator.cpp
index 26a71c3..c58d14d 100644
--- a/src/llvm-project/clang/test/Analysis/mismatched-iterator.cpp
+++ b/src/llvm-project/clang/test/Analysis/mismatched-iterator.cpp
@@ -3,203 +3,118 @@
#include "Inputs/system-header-simulator-cxx.h"
-void good_insert1(std::vector<int> &v, int n) {
- v.insert(v.cbegin(), n); // no-warning
+void good_insert1(std::vector<int> &V, int n) {
+ V.insert(V.cbegin(), n); // no-warning
}
-
-void good_insert2(std::vector<int> &v, int len, int n) {
- v.insert(v.cbegin(), len, n); // no-warning
+void good_insert2(std::vector<int> &V, int len, int n) {
+ V.insert(V.cbegin(), len, n); // no-warning
}
-void good_insert3(std::vector<int> &v1, std::vector<int> &v2) {
- v1.insert(v1.cbegin(), v2.cbegin(), v2.cend()); // no-warning
+void good_insert3(std::vector<int> &V1, std::vector<int> &V2) {
+ V1.insert(V1.cbegin(), V2.cbegin(), V2.cend()); // no-warning
}
-void good_insert4(std::vector<int> &v, int len, int n) {
- v.insert(v.cbegin(), {n-1, n, n+1}); // no-warning
+void good_insert4(std::vector<int> &V, int len, int n) {
+ V.insert(V.cbegin(), {n-1, n, n+1}); // no-warning
}
-void good_insert_find(std::vector<int> &v, int n, int m) {
- auto i = std::find(v.cbegin(), v.cend(), n);
- v.insert(i, m); // no-warning
+void good_insert_find(std::vector<int> &V, int n, int m) {
+ auto i = std::find(V.cbegin(), V.cend(), n);
+ V.insert(i, m); // no-warning
}
-void good_erase1(std::vector<int> &v) {
- v.erase(v.cbegin()); // no-warning
+void good_erase1(std::vector<int> &V) {
+ V.erase(V.cbegin()); // no-warning
}
-void good_erase2(std::vector<int> &v) {
- v.erase(v.cbegin(), v.cend()); // no-warning
+void good_erase2(std::vector<int> &V) {
+ V.erase(V.cbegin(), V.cend()); // no-warning
}
-void good_emplace(std::vector<int> &v, int n) {
- v.emplace(v.cbegin(), n); // no-warning
+void good_emplace(std::vector<int> &V, int n) {
+ V.emplace(V.cbegin(), n); // no-warning
}
-void good_ctor(std::vector<int> &v) {
- std::vector<int> new_v(v.cbegin(), v.cend()); // no-warning
+void good_ctor(std::vector<int> &V) {
+ std::vector<int> new_v(V.cbegin(), V.cend()); // no-warning
}
-void good_find(std::vector<int> &v, int n) {
- std::find(v.cbegin(), v.cend(), n); // no-warning
+void good_find(std::vector<int> &V, int n) {
+ std::find(V.cbegin(), V.cend(), n); // no-warning
}
-void good_find_first_of(std::vector<int> &v1, std::vector<int> &v2) {
- std::find_first_of(v1.cbegin(), v1.cend(), v2.cbegin(), v2.cend()); // no-warning
+void good_find_first_of(std::vector<int> &V1, std::vector<int> &V2) {
+ std::find_first_of(V1.cbegin(), V1.cend(), V2.cbegin(), V2.cend()); // no-warning
}
-void good_copy(std::vector<int> &v1, std::vector<int> &v2, int n) {
- std::copy(v1.cbegin(), v1.cend(), v2.begin()); // no-warning
+void good_copy(std::vector<int> &V1, std::vector<int> &V2, int n) {
+ std::copy(V1.cbegin(), V1.cend(), V2.begin()); // no-warning
}
-void good_move_find1(std::vector<int> &v1, std::vector<int> &v2, int n) {
- auto i0 = v2.cbegin();
- v1 = std::move(v2);
- std::find(i0, v1.cend(), n); // no-warning
+void bad_insert1(std::vector<int> &V1, std::vector<int> &V2, int n) {
+ V2.insert(V1.cbegin(), n); // expected-warning{{Container accessed using foreign iterator argument}}
}
-void bad_insert1(std::vector<int> &v1, std::vector<int> &v2, int n) {
- v2.insert(v1.cbegin(), n); // expected-warning{{Container accessed using foreign iterator argument}}
+void bad_insert2(std::vector<int> &V1, std::vector<int> &V2, int len, int n) {
+ V2.insert(V1.cbegin(), len, n); // expected-warning{{Container accessed using foreign iterator argument}}
}
-void bad_insert2(std::vector<int> &v1, std::vector<int> &v2, int len, int n) {
- v2.insert(v1.cbegin(), len, n); // expected-warning{{Container accessed using foreign iterator argument}}
+void bad_insert3(std::vector<int> &V1, std::vector<int> &V2) {
+ V2.insert(V1.cbegin(), V2.cbegin(), V2.cend()); // expected-warning{{Container accessed using foreign iterator argument}}
+ V1.insert(V1.cbegin(), V1.cbegin(), V2.cend()); // expected-warning{{Iterators of different containers used where the same container is expected}}
+ V1.insert(V1.cbegin(), V2.cbegin(), V1.cend()); // expected-warning{{Iterators of different containers used where the same container is expected}}
}
-void bad_insert3(std::vector<int> &v1, std::vector<int> &v2) {
- v2.insert(v1.cbegin(), v2.cbegin(), v2.cend()); // expected-warning{{Container accessed using foreign iterator argument}}
- v1.insert(v1.cbegin(), v1.cbegin(), v2.cend()); // expected-warning{{Iterators of different containers used where the same container is expected}}
- v1.insert(v1.cbegin(), v2.cbegin(), v1.cend()); // expected-warning{{Iterators of different containers used where the same container is expected}}
+void bad_insert4(std::vector<int> &V1, std::vector<int> &V2, int len, int n) {
+ V2.insert(V1.cbegin(), {n-1, n, n+1}); // expected-warning{{Container accessed using foreign iterator argument}}
}
-void bad_insert4(std::vector<int> &v1, std::vector<int> &v2, int len, int n) {
- v2.insert(v1.cbegin(), {n-1, n, n+1}); // expected-warning{{Container accessed using foreign iterator argument}}
+void bad_erase1(std::vector<int> &V1, std::vector<int> &V2) {
+ V2.erase(V1.cbegin()); // expected-warning{{Container accessed using foreign iterator argument}}
}
-void bad_erase1(std::vector<int> &v1, std::vector<int> &v2) {
- v2.erase(v1.cbegin()); // expected-warning{{Container accessed using foreign iterator argument}}
+void bad_erase2(std::vector<int> &V1, std::vector<int> &V2) {
+ V2.erase(V2.cbegin(), V1.cend()); // expected-warning{{Container accessed using foreign iterator argument}}
+ V2.erase(V1.cbegin(), V2.cend()); // expected-warning{{Container accessed using foreign iterator argument}}
+ V2.erase(V1.cbegin(), V1.cend()); // expected-warning{{Container accessed using foreign iterator argument}}
}
-void bad_erase2(std::vector<int> &v1, std::vector<int> &v2) {
- v2.erase(v2.cbegin(), v1.cend()); // expected-warning{{Container accessed using foreign iterator argument}}
- v2.erase(v1.cbegin(), v2.cend()); // expected-warning{{Container accessed using foreign iterator argument}}
- v2.erase(v1.cbegin(), v1.cend()); // expected-warning{{Container accessed using foreign iterator argument}}
+void bad_emplace(std::vector<int> &V1, std::vector<int> &V2, int n) {
+ V2.emplace(V1.cbegin(), n); // expected-warning{{Container accessed using foreign iterator argument}}
}
-void bad_emplace(std::vector<int> &v1, std::vector<int> &v2, int n) {
- v2.emplace(v1.cbegin(), n); // expected-warning{{Container accessed using foreign iterator argument}}
+void good_comparison(std::vector<int> &V) {
+ if (V.cbegin() == V.cend()) {} // no-warning
}
-void good_move_find2(std::vector<int> &v1, std::vector<int> &v2, int n) {
- auto i0 = --v2.cend();
- v1 = std::move(v2);
- std::find(i0, v1.cend(), n); // no-warning
+void bad_comparison(std::vector<int> &V1, std::vector<int> &V2) {
+ if (V1.cbegin() != V2.cend()) {} // expected-warning{{Iterators of different containers used where the same container is expected}}
}
-void good_move_find3(std::vector<int> &v1, std::vector<int> &v2, int n) {
- auto i0 = v2.cend();
- v1 = std::move(v2);
- v2.push_back(n); // expected-warning{{Method called on moved-from object of type 'std::vector'}}
- std::find(v2.cbegin(), i0, n); // no-warning
+void bad_ctor(std::vector<int> &V1, std::vector<int> &V2) {
+ std::vector<int> new_v(V1.cbegin(), V2.cend()); // expected-warning{{Iterators of different containers used where the same container is expected}}
}
-void good_comparison(std::vector<int> &v) {
- if (v.cbegin() == v.cend()) {} // no-warning
+void bad_find(std::vector<int> &V1, std::vector<int> &V2, int n) {
+ std::find(V1.cbegin(), V2.cend(), n); // expected-warning{{Iterators of different containers used where the same container is expected}}
}
-void bad_ctor(std::vector<int> &v1, std::vector<int> &v2) {
- std::vector<int> new_v(v1.cbegin(), v2.cend()); // expected-warning{{Iterators of different containers used where the same container is expected}}
-}
-
-void bad_find(std::vector<int> &v1, std::vector<int> &v2, int n) {
- std::find(v1.cbegin(), v2.cend(), n); // expected-warning{{Iterators of different containers used where the same container is expected}}
-}
-
-void bad_find_first_of(std::vector<int> &v1, std::vector<int> &v2) {
- std::find_first_of(v1.cbegin(), v2.cend(), v2.cbegin(), v2.cend()); // expected-warning{{Iterators of different containers used where the same container is expected}}
- std::find_first_of(v1.cbegin(), v1.cend(), v2.cbegin(), v1.cend()); // expected-warning{{Iterators of different containers used where the same container is expected}}
-}
-
-void bad_move_find1(std::vector<int> &v1, std::vector<int> &v2, int n) {
- auto i0 = v2.cbegin();
- v1 = std::move(v2);
- std::find(i0, v2.cend(), n); // expected-warning{{Iterators of different containers used where the same container is expected}}
- // expected-warning@-1{{Method called on moved-from object of type 'std::vector'}}
-}
-
-void bad_insert_find(std::vector<int> &v1, std::vector<int> &v2, int n, int m) {
- auto i = std::find(v1.cbegin(), v1.cend(), n);
- v2.insert(i, m); // expected-warning{{Container accessed using foreign iterator argument}}
-}
-
-void good_overwrite(std::vector<int> &v1, std::vector<int> &v2, int n) {
- auto i = v1.cbegin();
- i = v2.cbegin();
- v2.insert(i, n); // no-warning
-}
-
-void bad_overwrite(std::vector<int> &v1, std::vector<int> &v2, int n) {
- auto i = v1.cbegin();
- i = v2.cbegin();
- v1.insert(i, n); // expected-warning{{Container accessed using foreign iterator argument}}
-}
-
-template<typename Container, typename Iterator>
-bool is_cend(Container cont, Iterator it) {
- return it == cont.cend();
-}
-
-void good_empty(std::vector<int> &v) {
- is_cend(v, v.cbegin()); // no-warning
-}
-
-void bad_empty(std::vector<int> &v1, std::vector<int> &v2) {
- is_cend(v1, v2.cbegin()); // expected-warning@-8{{Iterators of different containers used where the same container is expected}}
-}
-
-void good_move(std::vector<int> &v1, std::vector<int> &v2) {
- const auto i0 = ++v2.cbegin();
- v1 = std::move(v2);
- v1.erase(i0); // no-warning
-}
-
-void bad_move(std::vector<int> &v1, std::vector<int> &v2) {
- const auto i0 = ++v2.cbegin();
- v1 = std::move(v2);
- v2.erase(i0); // expected-warning{{Container accessed using foreign iterator argument}}
- // expected-warning@-1{{Method called on moved-from object of type 'std::vector'}}
-}
-
-void bad_move_find2(std::vector<int> &v1, std::vector<int> &v2, int n) {
- auto i0 = --v2.cend();
- v1 = std::move(v2);
- std::find(i0, v2.cend(), n); // expected-warning{{Iterators of different containers used where the same container is expected}}
- // expected-warning@-1{{Method called on moved-from object of type 'std::vector'}}
-}
-
-void bad_move_find3(std::vector<int> &v1, std::vector<int> &v2, int n) {
- auto i0 = v2.cend();
- v1 = std::move(v2);
- std::find(v1.cbegin(), i0, n); // expected-warning{{Iterators of different containers used where the same container is expected}}
-}
-
-void bad_comparison(std::vector<int> &v1, std::vector<int> &v2) {
- if (v1.cbegin() != v2.cend()) { // expected-warning{{Iterators of different containers used where the same container is expected}}
- *v1.cbegin();
- }
+void bad_find_first_of(std::vector<int> &V1, std::vector<int> &V2) {
+ std::find_first_of(V1.cbegin(), V2.cend(), V2.cbegin(), V2.cend()); // expected-warning{{Iterators of different containers used where the same container is expected}}
+ std::find_first_of(V1.cbegin(), V1.cend(), V2.cbegin(), V1.cend()); // expected-warning{{Iterators of different containers used where the same container is expected}}
}
std::vector<int> &return_vector_ref();
void ignore_conjured1() {
- std::vector<int> &v1 = return_vector_ref(), &v2 = return_vector_ref();
+ std::vector<int> &V1 = return_vector_ref(), &V2 = return_vector_ref();
- v2.erase(v1.cbegin()); // no-warning
+ V2.erase(V1.cbegin()); // no-warning
}
void ignore_conjured2() {
- std::vector<int> &v1 = return_vector_ref(), &v2 = return_vector_ref();
+ std::vector<int> &V1 = return_vector_ref(), &V2 = return_vector_ref();
- if (v1.cbegin() == v2.cbegin()) {} //no-warning
+ if (V1.cbegin() == V2.cbegin()) {} //no-warning
}
diff --git a/src/llvm-project/clang/test/Analysis/missing-bind-temporary.cpp b/src/llvm-project/clang/test/Analysis/missing-bind-temporary.cpp
index 7be4e2d..1820492 100644
--- a/src/llvm-project/clang/test/Analysis/missing-bind-temporary.cpp
+++ b/src/llvm-project/clang/test/Analysis/missing-bind-temporary.cpp
@@ -31,7 +31,7 @@
// CHECK-NEXT: 8: [B1.7]
// CHECK-NEXT: 9: [B1.5] = [B1.8] (OperatorCall)
// CHECK-NEXT: 10: ~variant_0::B() (Temporary object destructor)
-// CHECK-NEXT: 11: [B1.2].~B() (Implicit destructor)
+// CHECK-NEXT: 11: [B1.2].~variant_0::B() (Implicit destructor)
void foo(int) {
B i;
i = {};
@@ -71,7 +71,7 @@
// CHECK-NEXT: 6: {} (CXXConstructExpr, class variant_1::B)
// CHECK-NEXT: 7: [B1.6]
// CHECK-NEXT: 8: [B1.5] = [B1.7] (OperatorCall)
-// CHECK-NEXT: 9: [B1.2].~B() (Implicit destructor)
+// CHECK-NEXT: 9: [B1.2].~variant_1::B() (Implicit destructor)
template <typename T> void foo(T) {
B i;
i = {};
@@ -114,7 +114,7 @@
// CHECK-NEXT: 9: [B1.8]
// CHECK-NEXT: 10: [B1.5] = [B1.9] (OperatorCall)
// CHECK-NEXT: 11: ~variant_2::B() (Temporary object destructor)
-// CHECK-NEXT: 12: [B1.2].~B() (Implicit destructor)
+// CHECK-NEXT: 12: [B1.2].~variant_2::B() (Implicit destructor)
template <typename T> void foo(T) {
B i;
i = {};
diff --git a/src/llvm-project/clang/test/Analysis/more-dtors-cfg-output.cpp b/src/llvm-project/clang/test/Analysis/more-dtors-cfg-output.cpp
new file mode 100644
index 0000000..c0df595
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/more-dtors-cfg-output.cpp
@@ -0,0 +1,317 @@
+// RUN: rm -f %t.14 %t.2a
+// RUN: %clang_analyze_cc1 -analyzer-checker=debug.DumpCFG -std=c++14 -DCXX2A=0 -fblocks -Wall -Wno-unused -Werror %s > %t.14 2>&1
+// RUN: %clang_analyze_cc1 -analyzer-checker=debug.DumpCFG -std=c++2a -DCXX2A=1 -fblocks -Wall -Wno-unused -Werror %s > %t.2a 2>&1
+// RUN: FileCheck --input-file=%t.14 -check-prefixes=CHECK,CXX14 -implicit-check-not=destructor %s
+// RUN: FileCheck --input-file=%t.2a -check-prefixes=CHECK,CXX2A -implicit-check-not=destructor %s
+
+int puts(const char *);
+
+struct Foo {
+ Foo() = delete;
+#if CXX2A
+ // Guarantee that the elided examples are actually elided by deleting the
+ // copy constructor.
+ Foo(const Foo &) = delete;
+#else
+ // No elision support, so we need a copy constructor.
+ Foo(const Foo &);
+#endif
+ ~Foo();
+};
+
+struct TwoFoos {
+ Foo foo1, foo2;
+ ~TwoFoos();
+};
+
+Foo get_foo();
+
+struct Bar {
+ Bar();
+ Bar(const Bar &);
+ ~Bar();
+ Bar &operator=(const Bar &);
+};
+
+Bar get_bar();
+
+struct TwoBars {
+ Bar foo1, foo2;
+ ~TwoBars();
+};
+
+// Start of tests:
+
+void elided_assign() {
+ Foo x = get_foo();
+}
+// CHECK: void elided_assign()
+// CXX14: (CXXConstructExpr{{.*}}, struct Foo)
+// CXX14: ~Foo() (Temporary object destructor)
+// CHECK: ~Foo() (Implicit destructor)
+
+void nonelided_assign() {
+ Bar x = (const Bar &)get_bar();
+}
+// CHECK: void nonelided_assign()
+// CHECK: (CXXConstructExpr{{.*}}, struct Bar)
+// CHECK: ~Bar() (Temporary object destructor)
+// CHECK: ~Bar() (Implicit destructor)
+
+void elided_paren_init() {
+ Foo x(get_foo());
+}
+// CHECK: void elided_paren_init()
+// CXX14: (CXXConstructExpr{{.*}}, struct Foo)
+// CXX14: ~Foo() (Temporary object destructor)
+// CHECK: ~Foo() (Implicit destructor)
+
+void nonelided_paren_init() {
+ Bar x((const Bar &)get_bar());
+}
+// CHECK: void nonelided_paren_init()
+// CHECK: (CXXConstructExpr{{.*}}, struct Bar)
+// CHECK: ~Bar() (Temporary object destructor)
+// CHECK: ~Bar() (Implicit destructor)
+
+void elided_brace_init() {
+ Foo x{get_foo()};
+}
+// CHECK: void elided_brace_init()
+// CXX14: (CXXConstructExpr{{.*}}, struct Foo)
+// CXX14: ~Foo() (Temporary object destructor)
+// CHECK: ~Foo() (Implicit destructor)
+
+void nonelided_brace_init() {
+ Bar x{(const Bar &)get_bar()};
+}
+// CHECK: void nonelided_brace_init()
+// CHECK: (CXXConstructExpr{{.*}}, struct Bar)
+// CHECK: ~Bar() (Temporary object destructor)
+// CHECK: ~Bar() (Implicit destructor)
+
+void elided_lambda_capture_init() {
+ // The copy from get_foo() into the lambda should be elided. Should call
+ // the lambda's destructor, but not ~Foo() separately.
+ // (This syntax is C++14 'generalized lambda captures'.)
+ auto z = [x=get_foo()]() {};
+}
+// CHECK: void elided_lambda_capture_init()
+// CXX14: (CXXConstructExpr{{.*}}, struct Foo)
+// CXX14: ~(lambda at {{.*}})() (Temporary object destructor)
+// CXX14: ~Foo() (Temporary object destructor)
+// CHECK: ~(lambda at {{.*}})() (Implicit destructor)
+
+void nonelided_lambda_capture_init() {
+ // Should call the lambda's destructor as well as ~Bar() for the temporary.
+ auto z = [x((const Bar &)get_bar())]() {};
+}
+// CHECK: void nonelided_lambda_capture_init()
+// CHECK: (CXXConstructExpr{{.*}}, struct Bar)
+// CXX14: ~(lambda at {{.*}})() (Temporary object destructor)
+// CHECK: ~Bar() (Temporary object destructor)
+// CHECK: ~(lambda at {{.*}})() (Implicit destructor)
+
+Foo elided_return_stmt_expr() {
+ // Two copies, both elided in C++17.
+ return ({ get_foo(); });
+}
+// CHECK: Foo elided_return_stmt_expr()
+// CXX14: (CXXConstructExpr{{.*}}, struct Foo)
+// CXX14: ~Foo() (Temporary object destructor)
+// CXX14: (CXXConstructExpr{{.*}}, struct Foo)
+// CXX14: ~Foo() (Temporary object destructor)
+
+void elided_stmt_expr() {
+ // One copy, elided in C++17.
+ ({ get_foo(); });
+}
+// CHECK: void elided_stmt_expr()
+// CXX14: (CXXConstructExpr{{.*}}, struct Foo)
+// CXX14: ~Foo() (Temporary object destructor)
+// CHECK: ~Foo() (Temporary object destructor)
+
+
+void elided_stmt_expr_multiple_stmts() {
+ // Make sure that only the value returned out of a statement expression is
+ // elided.
+ ({ get_bar(); get_foo(); });
+}
+// CHECK: void elided_stmt_expr_multiple_stmts()
+// CHECK: ~Bar() (Temporary object destructor)
+// CXX14: (CXXConstructExpr{{.*}}, struct Foo)
+// CXX14: ~Foo() (Temporary object destructor)
+// CHECK: ~Foo() (Temporary object destructor)
+
+
+void unelided_stmt_expr() {
+ ({ (const Bar &)get_bar(); });
+}
+// CHECK: void unelided_stmt_expr()
+// CHECK: (CXXConstructExpr{{.*}}, struct Bar)
+// CHECK: ~Bar() (Temporary object destructor)
+// CHECK: ~Bar() (Temporary object destructor)
+
+void elided_aggregate_init() {
+ TwoFoos x{get_foo(), get_foo()};
+}
+// CHECK: void elided_aggregate_init()
+// CXX14: (CXXConstructExpr{{.*}}, struct Foo)
+// CXX14: (CXXConstructExpr{{.*}}, struct Foo)
+// CXX14: ~Foo() (Temporary object destructor)
+// CXX14: ~Foo() (Temporary object destructor)
+// CHECK: ~TwoFoos() (Implicit destructor)
+
+void nonelided_aggregate_init() {
+ TwoBars x{(const Bar &)get_bar(), (const Bar &)get_bar()};
+}
+// CHECK: void nonelided_aggregate_init()
+// CHECK: (CXXConstructExpr{{.*}}, struct Bar)
+// CHECK: (CXXConstructExpr{{.*}}, struct Bar)
+// CHECK: ~Bar() (Temporary object destructor)
+// CHECK: ~Bar() (Temporary object destructor)
+// CHECK: ~TwoBars() (Implicit destructor)
+
+TwoFoos return_aggregate_init() {
+ return TwoFoos{get_foo(), get_foo()};
+}
+// CHECK: TwoFoos return_aggregate_init()
+// CXX14: (CXXConstructExpr{{.*}}, struct Foo)
+// CXX14: (CXXConstructExpr{{.*}}, struct Foo)
+// CXX14: ~TwoFoos() (Temporary object destructor)
+// CXX14: ~Foo() (Temporary object destructor)
+// CXX14: ~Foo() (Temporary object destructor)
+
+void lifetime_extended() {
+ const Foo &x = (get_foo(), get_foo());
+ puts("one destroyed before, one destroyed after");
+}
+// CHECK: void lifetime_extended()
+// CHECK: ~Foo() (Temporary object destructor)
+// CHECK: one destroyed before, one destroyed after
+// CHECK: ~Foo() (Implicit destructor)
+
+void not_lifetime_extended() {
+ Foo x = (get_foo(), get_foo());
+ puts("one destroyed before, one destroyed after");
+}
+// CHECK: void not_lifetime_extended()
+// CXX14: (CXXConstructExpr{{.*}}, struct Foo)
+// CHECK: ~Foo() (Temporary object destructor)
+// CXX14: ~Foo() (Temporary object destructor)
+// CHECK: one destroyed before, one destroyed after
+// CHECK: ~Foo() (Implicit destructor)
+
+void compound_literal() {
+ (void)(Bar[]){{}, {}};
+}
+// CHECK: void compound_literal()
+// CHECK: (CXXConstructExpr, struct Bar)
+// CHECK: (CXXConstructExpr, struct Bar)
+// CHECK: ~Bar [2]() (Temporary object destructor)
+
+Foo elided_return() {
+ return get_foo();
+}
+// CHECK: Foo elided_return()
+// CXX14: (CXXConstructExpr{{.*}}, struct Foo)
+// CXX14: ~Foo() (Temporary object destructor)
+
+auto elided_return_lambda() {
+ return [x=get_foo()]() {};
+}
+// CHECK: (lambda at {{.*}}) elided_return_lambda()
+// CXX14: (CXXConstructExpr{{.*}}, class (lambda at {{.*}}))
+// CXX14: ~(lambda at {{.*}})() (Temporary object destructor)
+// CXX14: ~Foo() (Temporary object destructor)
+
+void const_auto_obj() {
+ const Bar bar;
+}
+// CHECK: void const_auto_obj()
+// CHECK: .~Bar() (Implicit destructor)
+
+void has_default_arg(Foo foo = get_foo());
+void test_default_arg() {
+ // FIXME: This emits a destructor but no constructor. Search CFG.cpp for
+ // 'PR13385' for details.
+ has_default_arg();
+}
+// CHECK: void test_default_arg()
+// CXX14: ~Foo() (Temporary object destructor)
+// CHECK: ~Foo() (Temporary object destructor)
+
+struct DefaultArgInCtor {
+ DefaultArgInCtor(Foo foo = get_foo());
+ ~DefaultArgInCtor();
+};
+
+void default_ctor_with_default_arg() {
+ // FIXME: Default arguments are mishandled in two ways:
+ // - The constructor is not emitted at all (not specific to arrays; see fixme
+ // in CFG.cpp that mentions PR13385).
+ // - The destructor is emitted once, even though the default argument will be
+ // constructed and destructed once per array element.
+ // Ideally, the CFG would expand array constructions into a loop that
+ // constructs each array element, allowing default argument
+ // constructor/destructor calls to be correctly placed inside the loop.
+ DefaultArgInCtor qux[3];
+}
+// CHECK: void default_ctor_with_default_arg()
+// CHECK: CXXConstructExpr, {{.*}}, struct DefaultArgInCtor [3]
+// CXX14: ~Foo() (Temporary object destructor)
+// CHECK: ~Foo() (Temporary object destructor)
+// CHECK: .~DefaultArgInCtor [3]() (Implicit destructor)
+
+void new_default_ctor_with_default_arg(long count) {
+ // Same problems as above.
+ new DefaultArgInCtor[count];
+}
+// CHECK: void new_default_ctor_with_default_arg(long count)
+// CHECK: CXXConstructExpr, {{.*}}, struct DefaultArgInCtor []
+// CXX14: ~Foo() (Temporary object destructor)
+// CHECK: ~Foo() (Temporary object destructor)
+
+#if CXX2A
+// Boilerplate needed to test co_return:
+
+namespace std::experimental {
+ template <typename Promise>
+ struct coroutine_handle {
+ static coroutine_handle from_address(void *);
+ };
+}
+
+struct TestPromise {
+ TestPromise initial_suspend();
+ TestPromise final_suspend();
+ bool await_ready();
+ void await_suspend(const std::experimental::coroutine_handle<TestPromise> &);
+ void await_resume();
+ Foo return_value(const Bar &);
+ Bar get_return_object();
+ void unhandled_exception();
+};
+
+namespace std::experimental {
+ template <typename Ret, typename... Args>
+ struct coroutine_traits;
+ template <>
+ struct coroutine_traits<Bar> {
+ using promise_type = TestPromise;
+ };
+}
+
+Bar coreturn() {
+ co_return get_bar();
+ // This expands to something like:
+ // promise.return_value(get_bar());
+ // get_bar() is passed by reference to return_value() and is then destroyed;
+ // there is no equivalent of RVO. TestPromise::return_value also returns a
+ // Foo, which should be immediately destroyed.
+ // FIXME: The generated CFG completely ignores get_return_object().
+}
+// CXX2A: Bar coreturn()
+// CXX2A: ~Foo() (Temporary object destructor)
+// CXX2A: ~Bar() (Temporary object destructor)
+#endif
diff --git a/src/llvm-project/clang/test/Analysis/new-ctor-null-throw.cpp b/src/llvm-project/clang/test/Analysis/new-ctor-null-throw.cpp
index dfa7cba..28922c0 100644
--- a/src/llvm-project/clang/test/Analysis/new-ctor-null-throw.cpp
+++ b/src/llvm-project/clang/test/Analysis/new-ctor-null-throw.cpp
@@ -1,7 +1,7 @@
-// RUN: %clang_analyze_cc1 -analyzer-checker=core \
+// RUN: %clang_analyze_cc1 -std=c++14 -analyzer-checker=core \
// RUN: -analyzer-config suppress-null-return-paths=false \
// RUN: -verify %s
-// RUN: %clang_analyze_cc1 -analyzer-checker=core \
+// RUN: %clang_analyze_cc1 -std=c++14 -analyzer-checker=core \
// RUN: -DSUPPRESSED \
// RUN: -verify %s
diff --git a/src/llvm-project/clang/test/Analysis/new-ctor-null.cpp b/src/llvm-project/clang/test/Analysis/new-ctor-null.cpp
index 32f2f95..f3c07e2 100644
--- a/src/llvm-project/clang/test/Analysis/new-ctor-null.cpp
+++ b/src/llvm-project/clang/test/Analysis/new-ctor-null.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_analyze_cc1 \
+// RUN: %clang_analyze_cc1 -std=c++14 \
// RUN: -analyzer-checker=core,debug.ExprInspection \
// RUN: -verify %s
diff --git a/src/llvm-project/clang/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m b/src/llvm-project/clang/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m
index d4a478d..9685fa0 100644
--- a/src/llvm-project/clang/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m
+++ b/src/llvm-project/clang/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m
@@ -80,7 +80,7 @@
return [obj voidM], 0;
}
-int marker(void) { // control reaches end of non-void function
+int marker(void) { // non-void function does not return a value
}
// CHECK-darwin8: warning: The receiver of message 'longDoubleM' is nil and returns a value of type 'long double' that will be garbage
diff --git a/src/llvm-project/clang/test/Analysis/nonnull-global-constants.mm b/src/llvm-project/clang/test/Analysis/nonnull-global-constants.mm
index 9e1a588..8c174c4 100644
--- a/src/llvm-project/clang/test/Analysis/nonnull-global-constants.mm
+++ b/src/llvm-project/clang/test/Analysis/nonnull-global-constants.mm
@@ -7,7 +7,11 @@
@class NSString;
typedef const struct __CFString *CFStringRef;
-typedef const struct __CFBoolean * CFBooleanRef;
+typedef const struct __CFBoolean *CFBooleanRef;
+
+#define CF_BRIDGED_TYPE(T) __attribute__((objc_bridge(T)))
+typedef const struct CF_BRIDGED_TYPE(NSNull) __CFNull *CFNullRef;
+extern const CFNullRef kCFNull;
// Global NSString* is non-null.
extern NSString *const StringConstGlobal;
@@ -113,3 +117,7 @@
void testNonnullNonnullCFString() {
clang_analyzer_eval(str4); // expected-warning{{TRUE}}
}
+
+void test_kCFNull() {
+ clang_analyzer_eval(kCFNull); // expected-warning{{TRUE}}
+}
diff --git a/src/llvm-project/clang/test/Analysis/novoidtypecrash.c b/src/llvm-project/clang/test/Analysis/novoidtypecrash.c
index c04cfca..b19990a 100644
--- a/src/llvm-project/clang/test/Analysis/novoidtypecrash.c
+++ b/src/llvm-project/clang/test/Analysis/novoidtypecrash.c
@@ -1,8 +1,27 @@
// RUN: %clang_analyze_cc1 -analyzer-checker=core %s
+x;
+y(void **z) { // no-crash
+ *z = x;
+ int *w;
+ y(&w);
+ *w;
+}
+
a;
-b(void **c) { // no-crash
- *c = a;
- int *d;
- b(&d);
- *d;
+b(*c) {}
+e(*c) {
+ void *d = f();
+ b(d);
+ *c = d;
+}
+void *g() {
+ e(&a);
+ return a;
+}
+j() {
+ int h;
+ char i = g();
+ if (i)
+ for (; h;)
+ ;
}
diff --git a/src/llvm-project/clang/test/Analysis/null-deref-path-notes.c b/src/llvm-project/clang/test/Analysis/null-deref-path-notes.c
index c73f640..b1bef63 100644
--- a/src/llvm-project/clang/test/Analysis/null-deref-path-notes.c
+++ b/src/llvm-project/clang/test/Analysis/null-deref-path-notes.c
@@ -13,40 +13,40 @@
void f1(char *source) {
char *destination = 0; // expected-note{{'destination' initialized to a null pointer value}}
- memcpy(destination + 0, source, 10); // expected-warning{{Null pointer argument in call to memory copy function}}
- // expected-note@-1{{Null pointer argument in call to memory copy function}}
+ memcpy(destination + 0, source, 10); // expected-warning{{Null pointer passed as 1st argument to memory copy function}}
+ // expected-note@-1{{Null pointer passed as 1st argument to memory copy function}}
}
void f2(char *source) {
char *destination = 0; // expected-note{{'destination' initialized to a null pointer value}}
- memcpy(destination - 0, source, 10); // expected-warning{{Null pointer argument in call to memory copy function}}
- // expected-note@-1{{Null pointer argument in call to memory copy function}}
+ memcpy(destination - 0, source, 10); // expected-warning{{Null pointer passed as 1st argument to memory copy function}}
+ // expected-note@-1{{Null pointer passed as 1st argument to memory copy function}}
}
void f3(char *source) {
char *destination = 0; // expected-note{{'destination' initialized to a null pointer value}}
destination = destination + 0; // expected-note{{Null pointer value stored to 'destination'}}
- memcpy(destination, source, 10); // expected-warning{{Null pointer argument in call to memory copy function}}
- // expected-note@-1{{Null pointer argument in call to memory copy function}}
+ memcpy(destination, source, 10); // expected-warning{{Null pointer passed as 1st argument to memory copy function}}
+ // expected-note@-1{{Null pointer passed as 1st argument to memory copy function}}
}
void f4(char *source) {
char *destination = 0; // expected-note{{'destination' initialized to a null pointer value}}
destination = destination - 0; // expected-note{{Null pointer value stored to 'destination'}}
- memcpy(destination, source, 10); // expected-warning{{Null pointer argument in call to memory copy function}}
- // expected-note@-1{{Null pointer argument in call to memory copy function}}
+ memcpy(destination, source, 10); // expected-warning{{Null pointer passed as 1st argument to memory copy function}}
+ // expected-note@-1{{Null pointer passed as 1st argument to memory copy function}}
}
void f5(char *source) {
char *destination1 = 0; // expected-note{{'destination1' initialized to a null pointer value}}
char *destination2 = destination1 + 0; // expected-note{{'destination2' initialized to a null pointer value}}
- memcpy(destination2, source, 10); // expected-warning{{Null pointer argument in call to memory copy function}}
- // expected-note@-1{{Null pointer argument in call to memory copy function}}
+ memcpy(destination2, source, 10); // expected-warning{{Null pointer passed as 1st argument to memory copy function}}
+ // expected-note@-1{{Null pointer passed as 1st argument to memory copy function}}
}
void f6(char *source) {
char *destination1 = 0; // expected-note{{'destination1' initialized to a null pointer value}}
char *destination2 = destination1 - 0; // expected-note{{'destination2' initialized to a null pointer value}}
- memcpy(destination2, source, 10); // expected-warning{{Null pointer argument in call to memory copy function}}
- // expected-note@-1{{Null pointer argument in call to memory copy function}}
+ memcpy(destination2, source, 10); // expected-warning{{Null pointer passed as 1st argument to memory copy function}}
+ // expected-note@-1{{Null pointer passed as 1st argument to memory copy function}}
}
diff --git a/src/llvm-project/clang/test/Analysis/null-deref-ps-region.c b/src/llvm-project/clang/test/Analysis/null-deref-ps-region.c
index 71b7a1d..58fcbb6 100644
--- a/src/llvm-project/clang/test/Analysis/null-deref-ps-region.c
+++ b/src/llvm-project/clang/test/Analysis/null-deref-ps-region.c
@@ -39,7 +39,7 @@
void testConcreteNull() {
int *x = 0;
- memset(x, 0, 1); // expected-warning {{Null pointer argument in call to memory set function}}
+ memset(x, 0, 1); // expected-warning {{Null pointer passed as 1st argument to memory set function}}
}
void testStackArray() {
diff --git a/src/llvm-project/clang/test/Analysis/null-deref-ps.c b/src/llvm-project/clang/test/Analysis/null-deref-ps.c
index d0e1f9f..d1c19e5 100644
--- a/src/llvm-project/clang/test/Analysis/null-deref-ps.c
+++ b/src/llvm-project/clang/test/Analysis/null-deref-ps.c
@@ -88,21 +88,21 @@
int bar(int* p, int q) __attribute__((nonnull));
int f6(int *p) {
- return !p ? bar(p, 1) // expected-warning {{Null pointer passed as an argument to a 'nonnull' parameter}}
+ return !p ? bar(p, 1) // expected-warning {{Null pointer passed to 1st parameter expecting 'nonnull'}}
: bar(p, 0); // no-warning
}
int bar2(int* p, int q) __attribute__((nonnull(1)));
int f6b(int *p) {
- return !p ? bar2(p, 1) // expected-warning {{Null pointer passed as an argument to a 'nonnull' parameter}}
+ return !p ? bar2(p, 1) // expected-warning {{Null pointer passed to 1st parameter expecting 'nonnull'}}
: bar2(p, 0); // no-warning
}
int bar3(int*p, int q, int *r) __attribute__((nonnull(1,3)));
int f6c(int *p, int *q) {
- return !p ? bar3(q, 2, p) // expected-warning {{Null pointer passed as an argument to a 'nonnull' parameter}}
+ return !p ? bar3(q, 2, p) // expected-warning {{Null pointer passed to 3rd parameter expecting 'nonnull'}}
: bar3(p, 2, q); // no-warning
}
diff --git a/src/llvm-project/clang/test/Analysis/nullability-notes.m b/src/llvm-project/clang/test/Analysis/nullability-notes.m
index 39dbb8f..e1b4e8f 100644
--- a/src/llvm-project/clang/test/Analysis/nullability-notes.m
+++ b/src/llvm-project/clang/test/Analysis/nullability-notes.m
@@ -1,6 +1,22 @@
-// RUN: %clang_analyze_cc1 -fblocks -analyzer-checker=core,nullability.NullPassedToNonnull,nullability.NullReturnedFromNonnull,nullability.NullablePassedToNonnull,nullability.NullableReturnedFromNonnull,nullability.NullableDereferenced -analyzer-output=text -verify %s
-// RUN: %clang_analyze_cc1 -fblocks -analyzer-checker=core,nullability.NullPassedToNonnull,nullability.NullReturnedFromNonnull,nullability.NullablePassedToNonnull,nullability.NullableReturnedFromNonnull,nullability.NullableDereferenced -analyzer-output=plist -o %t.plist %s
-// RUN: %normalize_plist <%t.plist | diff -ub %S/Inputs/expected-plists/nullability-notes.m.plist -
+// RUN: %clang_analyze_cc1 -fblocks -analyzer-checker=core \
+// RUN: -analyzer-checker=nullability.NullPassedToNonnull \
+// RUN: -analyzer-checker=nullability.NullReturnedFromNonnull \
+// RUN: -analyzer-checker=nullability.NullablePassedToNonnull \
+// RUN: -analyzer-checker=nullability.NullableReturnedFromNonnull \
+// RUN: -analyzer-checker=nullability.NullableDereferenced \
+// RUN: -analyzer-checker=debug.ExprInspection \
+// RUN: -analyzer-output=text -verify %s
+// RUN: %clang_analyze_cc1 -fblocks -analyzer-checker=core \
+// RUN: -analyzer-checker=nullability.NullPassedToNonnull \
+// RUN: -analyzer-checker=nullability.NullReturnedFromNonnull \
+// RUN: -analyzer-checker=nullability.NullablePassedToNonnull \
+// RUN: -analyzer-checker=nullability.NullableReturnedFromNonnull \
+// RUN: -analyzer-checker=nullability.NullableDereferenced \
+// RUN: -analyzer-output=plist -o %t.plist %s
+// RUN: %normalize_plist <%t.plist \
+// RUN: | diff -ub %S/Inputs/expected-plists/nullability-notes.m.plist -
+
+void clang_analyzer_warnOnDeadSymbol(id);
#include "Inputs/system-header-simulator-for-nullability.h"
@@ -12,8 +28,11 @@
@end;
@implementation ClassWithProperties
-(void) method {
+ clang_analyzer_warnOnDeadSymbol(self);
// no-crash
NSObject *x = self.x; // expected-note{{Nullability 'nullable' is inferred}}
+ // expected-warning@-1{{SYMBOL DEAD}}
+ // expected-note@-2 {{SYMBOL DEAD}}
takesNonnull(x); // expected-warning{{Nullable pointer is passed to a callee that requires a non-null 1st parameter}}
// expected-note@-1{{Nullable pointer is passed to a callee that requires a non-null 1st parameter}}
}
diff --git a/src/llvm-project/clang/test/Analysis/nullability.m b/src/llvm-project/clang/test/Analysis/nullability.m
new file mode 100644
index 0000000..f777900
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/nullability.m
@@ -0,0 +1,12 @@
+// RUN: %clang_analyze_cc1 -analyzer-checker core,nullability -w -verify %s
+
+// expected-no-diagnostics
+
+id _Nonnull conjure_nonnull();
+void use_nullable(_Nullable id x);
+
+id _Nonnull foo() {
+ void *j = conjure_nonnull();
+ use_nullable(j);
+ return j; // no-warning
+}
diff --git a/src/llvm-project/clang/test/Analysis/objc-arc.m b/src/llvm-project/clang/test/Analysis/objc-arc.m
index cab6618..7127232 100644
--- a/src/llvm-project/clang/test/Analysis/objc-arc.m
+++ b/src/llvm-project/clang/test/Analysis/objc-arc.m
@@ -1,4 +1,4 @@
-// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core,osx.cocoa.RetainCount,deadcode -verify -fblocks -analyzer-opt-analyze-nested-blocks -fobjc-arc -analyzer-output=plist-multi-file -o %t.plist %s
+// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core,osx.cocoa.RetainCount,deadcode -verify -fblocks -analyzer-opt-analyze-nested-blocks -fobjc-arc -analyzer-output=plist-multi-file -analyzer-config deadcode.DeadStores:ShowFixIts=true -o %t.plist %s
// RUN: %normalize_plist <%t.plist | diff -ub %S/Inputs/expected-plists/objc-arc.m.plist -
typedef signed char BOOL;
diff --git a/src/llvm-project/clang/test/Analysis/osobject-retain-release.cpp b/src/llvm-project/clang/test/Analysis/osobject-retain-release.cpp
index afcc242..42675fc 100644
--- a/src/llvm-project/clang/test/Analysis/osobject-retain-release.cpp
+++ b/src/llvm-project/clang/test/Analysis/osobject-retain-release.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_analyze_cc1 -fblocks -analyze -analyzer-output=text\
+// RUN: %clang_analyze_cc1 -std=c++14 -fblocks -analyze -analyzer-output=text\
// RUN: -analyzer-checker=core,osx,debug.ExprInspection -verify %s
#include "os_object_base.h"
diff --git a/src/llvm-project/clang/test/Analysis/osobjectcstylecastchecker_test.cpp b/src/llvm-project/clang/test/Analysis/osobjectcstylecastchecker_test.cpp
index 07f878c..fabed7e 100644
--- a/src/llvm-project/clang/test/Analysis/osobjectcstylecastchecker_test.cpp
+++ b/src/llvm-project/clang/test/Analysis/osobjectcstylecastchecker_test.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_analyze_cc1 -analyzer-checker=optin.osx.OSObjectCStyleCast %s -verify
+// RUN: %clang_analyze_cc1 -std=c++14 -analyzer-checker=optin.osx.OSObjectCStyleCast %s -verify
#include "os_object_base.h"
struct OSArray : public OSObject {
diff --git a/src/llvm-project/clang/test/Analysis/placement-new-user-defined.cpp b/src/llvm-project/clang/test/Analysis/placement-new-user-defined.cpp
new file mode 100644
index 0000000..47f0b45
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/placement-new-user-defined.cpp
@@ -0,0 +1,22 @@
+// RUN: %clang_analyze_cc1 -std=c++11 %s \
+// RUN: -analyzer-checker=core \
+// RUN: -analyzer-checker=cplusplus.NewDelete \
+// RUN: -analyzer-checker=alpha.cplusplus.PlacementNew \
+// RUN: -analyzer-output=text -verify \
+// RUN: -triple x86_64-unknown-linux-gnu
+
+// expected-no-diagnostics
+
+#include "Inputs/system-header-simulator-cxx.h"
+
+struct X {
+ static void *operator new(std::size_t sz, void *b) {
+ return ::operator new(sz, b);
+ }
+ long l;
+};
+void f() {
+ short buf;
+ X *p1 = new (&buf) X;
+ (void)p1;
+}
diff --git a/src/llvm-project/clang/test/Analysis/placement-new.cpp b/src/llvm-project/clang/test/Analysis/placement-new.cpp
new file mode 100644
index 0000000..0f52484
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/placement-new.cpp
@@ -0,0 +1,141 @@
+// RUN: %clang_analyze_cc1 -std=c++11 %s \
+// RUN: -analyzer-checker=core \
+// RUN: -analyzer-checker=cplusplus.NewDelete \
+// RUN: -analyzer-checker=alpha.cplusplus.PlacementNew \
+// RUN: -analyzer-output=text -verify \
+// RUN: -triple x86_64-unknown-linux-gnu
+
+#include "Inputs/system-header-simulator-cxx.h"
+
+void f() {
+ short s; // expected-note {{'s' declared without an initial value}}
+ long *lp = ::new (&s) long; // expected-warning{{Storage provided to placement new is only 2 bytes, whereas the allocated type requires 8 bytes}} expected-note 3 {{}}
+ (void)lp;
+}
+
+namespace testArrayNew {
+void f() {
+ short s; // expected-note {{'s' declared without an initial value}}
+ char *buf = ::new (&s) char[8]; // expected-warning{{Storage provided to placement new is only 2 bytes, whereas the allocated type requires 8 bytes}} expected-note 3 {{}}
+ (void)buf;
+}
+} // namespace testArrayNew
+
+namespace testBufferInOtherFun {
+void f(void *place) {
+ long *lp = ::new (place) long; // expected-warning{{Storage provided to placement new is only 2 bytes, whereas the allocated type requires 8 bytes}} expected-note 1 {{}}
+ (void)lp;
+}
+void g() {
+ short buf; // expected-note {{'buf' declared without an initial value}}
+ f(&buf); // expected-note 2 {{}}
+}
+} // namespace testBufferInOtherFun
+
+namespace testArrayBuffer {
+void f(void *place) {
+ long *lp = ::new (place) long; // expected-warning{{Storage provided to placement new is only 2 bytes, whereas the allocated type requires 8 bytes}} expected-note 1 {{}}
+ (void)lp;
+}
+void g() {
+ char buf[2]; // expected-note {{'buf' initialized here}}
+ f(&buf); // expected-note 2 {{}}
+}
+} // namespace testArrayBuffer
+
+namespace testGlobalPtrAsPlace {
+void *gptr = nullptr;
+short gs;
+void f() {
+ gptr = &gs; // expected-note {{Value assigned to 'gptr'}}
+}
+void g() {
+ f(); // expected-note 2 {{}}
+ long *lp = ::new (gptr) long; // expected-warning{{Storage provided to placement new is only 2 bytes, whereas the allocated type requires 8 bytes}} expected-note 1 {{}}
+ (void)lp;
+}
+} // namespace testGlobalPtrAsPlace
+
+namespace testRvalue {
+short gs;
+void *f() {
+ return &gs;
+}
+void g() {
+ long *lp = ::new (f()) long; // expected-warning{{Storage provided to placement new is only 2 bytes, whereas the allocated type requires 8 bytes}} expected-note 1 {{}}
+ (void)lp;
+}
+} // namespace testRvalue
+
+namespace testNoWarning {
+void *f();
+void g() {
+ long *lp = ::new (f()) long;
+ (void)lp;
+}
+} // namespace testNoWarning
+
+namespace testPtrToArrayAsPlace {
+void f() {
+ //char *st = new char [8];
+ char buf[3]; // expected-note {{'buf' initialized here}}
+ void *st = buf; // expected-note {{'st' initialized here}}
+ long *lp = ::new (st) long; // expected-warning{{Storage provided to placement new is only 3 bytes, whereas the allocated type requires 8 bytes}} expected-note 1 {{}}
+ (void)lp;
+}
+} // namespace testPtrToArrayAsPlace
+
+namespace testPtrToArrayWithOffsetAsPlace {
+void f() {
+ int buf[3]; // expected-note {{'buf' initialized here}}
+ long *lp = ::new (buf + 2) long; // expected-warning{{Storage provided to placement new is only 4 bytes, whereas the allocated type requires 8 bytes}} expected-note 1 {{}}
+ (void)lp;
+}
+} // namespace testPtrToArrayWithOffsetAsPlace
+
+namespace testHeapAllocatedBuffer {
+void g2() {
+ char *buf = new char[2]; // expected-note {{'buf' initialized here}}
+ long *lp = ::new (buf) long; // expected-warning{{Storage provided to placement new is only 2 bytes, whereas the allocated type requires 8 bytes}} expected-note 1 {{}}
+ (void)lp;
+}
+} // namespace testHeapAllocatedBuffer
+
+namespace testMultiDimensionalArray {
+void f() {
+ char buf[2][3]; // expected-note {{'buf' initialized here}}
+ long *lp = ::new (buf) long; // expected-warning{{Storage provided to placement new is only 6 bytes, whereas the allocated type requires 8 bytes}} expected-note 1 {{}}
+ (void)lp;
+}
+} // namespace testMultiDimensionalArray
+
+namespace testMultiDimensionalArray2 {
+void f() {
+ char buf[2][3]; // expected-note {{'buf' initialized here}}
+ long *lp = ::new (buf + 1) long; // expected-warning{{Storage provided to placement new is only 3 bytes, whereas the allocated type requires 8 bytes}} expected-note 1 {{}}
+ (void)lp;
+}
+} // namespace testMultiDimensionalArray2
+
+namespace testMultiDimensionalArray3 {
+void f() {
+ char buf[2][3]; // expected-note {{'buf' initialized here}}
+ long *lp = ::new (&buf[1][1]) long; // expected-warning{{Storage provided to placement new is only 2 bytes, whereas the allocated type requires 8 bytes}} expected-note 1 {{}}
+ (void)lp;
+}
+} // namespace testMultiDimensionalArray3
+
+namespace testHierarchy {
+struct Base {
+ char a[2];
+};
+struct Derived : Base {
+ char x[2];
+ int y;
+};
+void f() {
+ Base b; // expected-note {{'b' initialized here}}
+ Derived *dp = ::new (&b) Derived; // expected-warning{{Storage provided to placement new is only 2 bytes, whereas the allocated type requires 8 bytes}} expected-note 1 {{}}
+ (void)dp;
+}
+} // namespace testHierarchy
diff --git a/src/llvm-project/clang/test/Analysis/plist-macros-with-expansion-ctu.c b/src/llvm-project/clang/test/Analysis/plist-macros-with-expansion-ctu.c
new file mode 100644
index 0000000..193b8f3
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/plist-macros-with-expansion-ctu.c
@@ -0,0 +1,79 @@
+// RUN: rm -rf %t && mkdir %t
+// RUN: mkdir -p %t/ctudir
+// RUN: %clang_cc1 -emit-pch -o %t/ctudir/plist-macros-ctu.c.ast %S/Inputs/plist-macros-ctu.c
+// RUN: cp %S/Inputs/plist-macros-with-expansion-ctu.c.externalDefMap.txt %t/ctudir/externalDefMap.txt
+
+// RUN: %clang_analyze_cc1 -analyzer-checker=core \
+// RUN: -analyzer-config experimental-enable-naive-ctu-analysis=true \
+// RUN: -analyzer-config ctu-dir=%t/ctudir \
+// RUN: -analyzer-config expand-macros=true \
+// RUN: -analyzer-output=plist-multi-file -o %t.plist -verify %s
+
+// Check the macro expansions from the plist output here, to make the test more
+// understandable.
+// RUN: FileCheck --input-file=%t.plist %s
+
+extern void F1(int **);
+extern void F2(int **);
+extern void F3(int **);
+extern void F_H(int **);
+
+void test0() {
+ int *X;
+ F3(&X);
+ *X = 1; // expected-warning{{Dereference of null pointer}}
+}
+// CHECK: <key>name</key><string>M1</string>
+// CHECK-NEXT: <key>expansion</key><string>*Z = (int *)0</string>
+
+
+void test1() {
+ int *X;
+ F1(&X);
+ *X = 1; // expected-warning{{Dereference of null pointer}}
+}
+// CHECK: <key>name</key><string>M</string>
+// CHECK-NEXT: <key>expansion</key><string>*X = (int *)0</string>
+
+void test2() {
+ int *X;
+ F2(&X);
+ *X = 1; // expected-warning{{Dereference of null pointer}}
+}
+// CHECK: <key>name</key><string>M</string>
+// CHECK-NEXT: <key>expansion</key><string>*Y = (int *)0</string>
+
+#define M F1(&X)
+
+void test3() {
+ int *X;
+ M;
+ *X = 1; // expected-warning{{Dereference of null pointer}}
+}
+// CHECK: <key>name</key><string>M</string>
+// CHECK-NEXT: <key>expansion</key><string>F1(&X)</string>
+// CHECK: <key>name</key><string>M</string>
+// CHECK-NEXT: <key>expansion</key><string>*X = (int *)0</string>
+
+#undef M
+#define M F2(&X)
+
+void test4() {
+ int *X;
+ M;
+ *X = 1; // expected-warning{{Dereference of null pointer}}
+}
+
+// CHECK: <key>name</key><string>M</string>
+// CHECK-NEXT: <key>expansion</key><string>F2(&X)</string>
+// CHECK: <key>name</key><string>M</string>
+// CHECK-NEXT: <key>expansion</key><string>*Y = (int *)0</string>
+
+void test_h() {
+ int *X;
+ F_H(&X);
+ *X = 1; // expected-warning{{Dereference of null pointer}}
+}
+
+// CHECK: <key>name</key><string>M_H</string>
+// CHECK-NEXT: <key>expansion</key><string>*A = (int *)0</string>
diff --git a/src/llvm-project/clang/test/Analysis/plist-macros-with-expansion.cpp b/src/llvm-project/clang/test/Analysis/plist-macros-with-expansion.cpp
index e836c78..e07747e 100644
--- a/src/llvm-project/clang/test/Analysis/plist-macros-with-expansion.cpp
+++ b/src/llvm-project/clang/test/Analysis/plist-macros-with-expansion.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+// RUN: %clang_analyze_cc1 -std=c++14 -analyzer-checker=core -verify %s
//
-// RUN: %clang_analyze_cc1 -analyzer-checker=core %s \
+// RUN: %clang_analyze_cc1 -std=c++14 -analyzer-checker=core %s \
// RUN: -analyzer-output=plist -o %t.plist \
// RUN: -analyzer-config expand-macros=true
//
diff --git a/src/llvm-project/clang/test/Analysis/plist-output.m b/src/llvm-project/clang/test/Analysis/plist-output.m
index 3291633..553982b 100644
--- a/src/llvm-project/clang/test/Analysis/plist-output.m
+++ b/src/llvm-project/clang/test/Analysis/plist-output.m
@@ -1,4 +1,4 @@
-// RUN: %clang_analyze_cc1 -analyzer-config eagerly-assume=false %s -analyzer-checker=osx.cocoa.RetainCount,deadcode.DeadStores,core -analyzer-output=plist -o %t.plist
+// RUN: %clang_analyze_cc1 -analyzer-config eagerly-assume=false %s -analyzer-checker=osx.cocoa.RetainCount,deadcode.DeadStores,core -analyzer-output=plist -analyzer-config deadcode.DeadStores:ShowFixIts=true -o %t.plist
// RUN: %normalize_plist <%t.plist | diff -ub %S/Inputs/expected-plists/plist-output.m.plist -
void test_null_init(void) {
diff --git a/src/llvm-project/clang/test/Analysis/pointer-escape-on-conservative-calls.c b/src/llvm-project/clang/test/Analysis/pointer-escape-on-conservative-calls.c
new file mode 100644
index 0000000..7ddd7a1
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/pointer-escape-on-conservative-calls.c
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 -analyze -analyzer-checker=debug.AnalysisOrder -analyzer-config debug.AnalysisOrder:PointerEscape=true -analyzer-config debug.AnalysisOrder:PostCall=true %s 2>&1 | FileCheck %s
+
+
+void f(int *);
+int *getMem();
+
+int main() {
+ f(getMem());
+ return 0;
+}
+
+// CHECK: PostCall (f)
+// CHECK-NEXT: PointerEscape
diff --git a/src/llvm-project/clang/test/Analysis/preprocessor-setup.c b/src/llvm-project/clang/test/Analysis/preprocessor-setup.c
new file mode 100644
index 0000000..57f13e6
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/preprocessor-setup.c
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 -E -setup-static-analyzer %s
+
+#ifndef __clang_analyzer__
+#error __clang_analyzer__ not defined
+#endif
diff --git a/src/llvm-project/clang/test/Analysis/properties.m b/src/llvm-project/clang/test/Analysis/properties.m
index 17b1560..d83b8ed 100644
--- a/src/llvm-project/clang/test/Analysis/properties.m
+++ b/src/llvm-project/clang/test/Analysis/properties.m
@@ -3,6 +3,8 @@
void clang_analyzer_eval(int);
+#define nil ((id)0)
+
typedef const void * CFTypeRef;
extern CFTypeRef CFRetain(CFTypeRef cf);
void CFRelease(CFTypeRef cf);
@@ -1040,3 +1042,56 @@
clang_analyzer_eval(self.still_no_custom_accessor == self.still_no_custom_accessor); // expected-warning{{TRUE}}
}
@end
+
+@interface Shadowed
+@property (assign) NSObject *o;
+- (NSObject *)getShadowedIvar;
+- (void)clearShadowedIvar;
+- (NSObject *)getShadowedProp;
+- (void)clearShadowedProp;
+
+@property (assign) NSObject *o2;
+@end
+
+@implementation Shadowed
+- (NSObject *)getShadowedIvar {
+ return self->_o;
+}
+- (void)clearShadowedIvar {
+ self->_o = nil;
+}
+- (NSObject *)getShadowedProp {
+ return self.o;
+}
+- (void)clearShadowedProp {
+ self.o = nil;
+}
+@end
+
+@interface Shadowing : Shadowed
+@end
+
+@implementation Shadowing
+// Property 'o' is declared in the superclass but synthesized here.
+// This creates a separate ivar that shadows the superclass's ivar,
+// but the old ivar is still accessible from the methods of the superclass.
+// The old property, however, is not accessible with the property syntax
+// even from the superclass methods.
+@synthesize o;
+
+-(void)testPropertyShadowing {
+ NSObject *oo = self.o; // no-crash
+ clang_analyzer_eval(self.o == oo); // expected-warning{{TRUE}}
+ clang_analyzer_eval([self getShadowedIvar] == oo); // expected-warning{{UNKNOWN}}
+ [self clearShadowedIvar];
+ clang_analyzer_eval(self.o == oo); // expected-warning{{TRUE}}
+ clang_analyzer_eval([self getShadowedIvar] == oo); // expected-warning{{UNKNOWN}}
+ clang_analyzer_eval([self getShadowedIvar] == nil); // expected-warning{{TRUE}}
+}
+
+@synthesize o2 = ooo2;
+
+-(void)testPropertyShadowingWithExplicitIvar {
+ NSObject *oo2 = self.o2; // no-crash
+}
+@end
diff --git a/src/llvm-project/clang/test/Analysis/ptr-iter.cpp b/src/llvm-project/clang/test/Analysis/ptr-iter.cpp
index a35fae4..a94288c 100644
--- a/src/llvm-project/clang/test/Analysis/ptr-iter.cpp
+++ b/src/llvm-project/clang/test/Analysis/ptr-iter.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_analyze_cc1 %s -analyzer-output=text -verify \
+// RUN: %clang_analyze_cc1 %s -std=c++14 -analyzer-output=text -verify \
// RUN: -analyzer-checker=core,alpha.nondeterminism.PointerIteration
#include "Inputs/system-header-simulator-cxx.h"
diff --git a/src/llvm-project/clang/test/Analysis/ptr-sort.cpp b/src/llvm-project/clang/test/Analysis/ptr-sort.cpp
index a4f9481..d238b39 100644
--- a/src/llvm-project/clang/test/Analysis/ptr-sort.cpp
+++ b/src/llvm-project/clang/test/Analysis/ptr-sort.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_analyze_cc1 %s -analyzer-output=text -verify \
+// RUN: %clang_analyze_cc1 %s -std=c++14 -analyzer-output=text -verify \
// RUN: -analyzer-checker=core,alpha.nondeterminism.PointerSorting
#include "Inputs/system-header-simulator-cxx.h"
diff --git a/src/llvm-project/clang/test/Analysis/return-value-guaranteed.cpp b/src/llvm-project/clang/test/Analysis/return-value-guaranteed.cpp
index 367a8e5..2d04a26 100644
--- a/src/llvm-project/clang/test/Analysis/return-value-guaranteed.cpp
+++ b/src/llvm-project/clang/test/Analysis/return-value-guaranteed.cpp
@@ -24,6 +24,7 @@
// class-note@-1 {{The value 0 is assigned to 'F.Field'}}
return !MCAsmParser::Error();
// class-note@-1 {{'MCAsmParser::Error' returns true}}
+ // class-note@-2 {{Returning zero, which participates in a condition later}}
}
bool parseFile() {
@@ -57,6 +58,7 @@
struct MCAsmParser {
static bool Error() {
return false; // class-note {{'MCAsmParser::Error' returns false}}
+ // class-note@-1 {{Returning zero, which participates in a condition later}}
}
};
@@ -72,6 +74,7 @@
return MCAsmParser::Error();
// class-note@-1 {{Calling 'MCAsmParser::Error'}}
// class-note@-2 {{Returning from 'MCAsmParser::Error'}}
+ // class-note@-3 {{Returning zero, which participates in a condition later}}
}
bool parseFile() {
diff --git a/src/llvm-project/clang/test/Analysis/rvo.cpp b/src/llvm-project/clang/test/Analysis/rvo.cpp
index cf06a95..7215fbb 100644
--- a/src/llvm-project/clang/test/Analysis/rvo.cpp
+++ b/src/llvm-project/clang/test/Analysis/rvo.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_analyze_cc1 -analyzer-checker core,cplusplus \
+// RUN: %clang_analyze_cc1 -analyzer-checker core,cplusplus -std=c++14 \
// RUN: -analyzer-checker debug.ExprInspection -verify %s
void clang_analyzer_eval(bool);
diff --git a/src/llvm-project/clang/test/Analysis/scopes-cfg-output.cpp b/src/llvm-project/clang/test/Analysis/scopes-cfg-output.cpp
index f8d84b6..4b6e2a9 100644
--- a/src/llvm-project/clang/test/Analysis/scopes-cfg-output.cpp
+++ b/src/llvm-project/clang/test/Analysis/scopes-cfg-output.cpp
@@ -38,7 +38,7 @@
// CHECK-NEXT: 3: A a[2];
// CHECK-NEXT: 4: (CXXConstructExpr, [B1.5], class A [0])
// CHECK-NEXT: 5: A b[0];
-// CHECK-NEXT: 6: [B1.3].~A() (Implicit destructor)
+// CHECK-NEXT: 6: [B1.3].~A [2]() (Implicit destructor)
// CHECK-NEXT: 7: CFGScopeEnd(a)
// CHECK-NEXT: Preds (1): B2
// CHECK-NEXT: Succs (1): B0
@@ -810,7 +810,7 @@
// CHECK-NEXT: 1: CFGScopeEnd(__end1)
// CHECK-NEXT: 2: CFGScopeEnd(__begin1)
// CHECK-NEXT: 3: CFGScopeEnd(__range1)
-// CHECK-NEXT: 4: [B5.3].~A() (Implicit destructor)
+// CHECK-NEXT: 4: [B5.3].~A [10]() (Implicit destructor)
// CHECK-NEXT: 5: CFGScopeEnd(a)
// CHECK-NEXT: Preds (1): B2
// CHECK-NEXT: Succs (1): B0
diff --git a/src/llvm-project/clang/test/Analysis/security-syntax-checks-nscoder.m b/src/llvm-project/clang/test/Analysis/security-syntax-checks-nscoder.m
new file mode 100644
index 0000000..23aa95b
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/security-syntax-checks-nscoder.m
@@ -0,0 +1,36 @@
+// RUN: %clang_analyze_cc1 -triple thumbv7-apple-ios11.0 -verify=available \
+// RUN: -analyzer-checker=security.insecureAPI.decodeValueOfObjCType %s
+// RUN: %clang_analyze_cc1 -triple thumbv7-apple-ios10.0 -verify=notavailable \
+// RUN: -analyzer-checker=security.insecureAPI.decodeValueOfObjCType %s
+// RUN: %clang_analyze_cc1 -triple x86_64-apple-macos10.13 -verify=available \
+// RUN: -analyzer-checker=security.insecureAPI.decodeValueOfObjCType %s
+// RUN: %clang_analyze_cc1 -triple x86_64-apple-macos10.12 -verify=notavailable \
+// RUN: -analyzer-checker=security.insecureAPI.decodeValueOfObjCType %s
+// RUN: %clang_analyze_cc1 -triple thumbv7-apple-watchos4.0 -verify=available \
+// RUN: -analyzer-checker=security.insecureAPI.decodeValueOfObjCType %s
+// RUN: %clang_analyze_cc1 -triple thumbv7-apple-watchos3.0 -verify=notavailable \
+// RUN: -analyzer-checker=security.insecureAPI.decodeValueOfObjCType %s
+// RUN: %clang_analyze_cc1 -triple thumbv7-apple-tvos11.0 -verify=available \
+// RUN: -analyzer-checker=security.insecureAPI.decodeValueOfObjCType %s
+// RUN: %clang_analyze_cc1 -triple thumbv7-apple-tvos10.0 -verify=notavailable \
+// RUN: -analyzer-checker=security.insecureAPI.decodeValueOfObjCType %s
+
+// notavailable-no-diagnostics
+
+typedef unsigned long NSUInteger;
+
+@interface NSCoder
+- (void)decodeValueOfObjCType:(const char *)type
+ at:(void *)data;
+- (void)decodeValueOfObjCType:(const char *)type
+ at:(void *)data
+ size:(NSUInteger)size;
+@end
+
+void test(NSCoder *decoder) {
+ // This would be a vulnerability on 64-bit platforms
+ // but not on 32-bit platforms.
+ NSUInteger x;
+ [decoder decodeValueOfObjCType:"I" at:&x]; // available-warning{{Deprecated method '-decodeValueOfObjCType:at:' is insecure as it can lead to potential buffer overflows. Use the safer '-decodeValueOfObjCType:at:size:' method}}
+ [decoder decodeValueOfObjCType:"I" at:&x size:sizeof(x)]; // no-warning
+}
diff --git a/src/llvm-project/clang/test/Analysis/silence-checkers-and-packages-core-all.cpp b/src/llvm-project/clang/test/Analysis/silence-checkers-and-packages-core-all.cpp
new file mode 100644
index 0000000..0805cfc
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/silence-checkers-and-packages-core-all.cpp
@@ -0,0 +1,39 @@
+// RUN: %clang_analyze_cc1 \
+// RUN: -analyzer-checker=core -analyzer-config \
+// RUN: silence-checkers=core \
+// RUN: -verify %s
+
+// RUN: %clang_analyze_cc1 \
+// RUN: -analyzer-checker=core -analyzer-config \
+// RUN: silence-checkers="core.DivideZero;core.NullDereference" \
+// RUN: -verify %s
+
+// RUN: not %clang_analyze_cc1 -verify %s \
+// RUN: -analyzer-checker=core -analyzer-config \
+// RUN: silence-checkers=core.NullDeref \
+// RUN: 2>&1 | FileCheck %s -check-prefix=CHECK-CHECKER-ERROR
+
+// CHECK-CHECKER-ERROR: (frontend): no analyzer checkers or packages
+// CHECK-CHECKER-ERROR-SAME: are associated with 'core.NullDeref'
+
+// RUN: not %clang_analyze_cc1 -verify %s \
+// RUN: -analyzer-checker=core -analyzer-config \
+// RUN: silence-checkers=coreModeling \
+// RUN: 2>&1 | FileCheck %s -check-prefix=CHECK-PACKAGE-ERROR
+
+// CHECK-PACKAGE-ERROR: (frontend): no analyzer checkers or packages
+// CHECK-PACKAGE-ERROR-SAME: are associated with 'coreModeling'
+
+void test_disable_core_div_by_zero() {
+ (void)(1 / 0);
+ // expected-warning@-1 {{division by zero is undefined}}
+ // no-warning: 'Division by zero'
+}
+
+void test_disable_null_deref(int *p) {
+ if (p)
+ return;
+
+ int x = p[0];
+ // no-warning: Array access (from variable 'p') results in a null pointer dereference
+}
diff --git a/src/llvm-project/clang/test/Analysis/silence-checkers-and-packages-core-div-by-zero.cpp b/src/llvm-project/clang/test/Analysis/silence-checkers-and-packages-core-div-by-zero.cpp
new file mode 100644
index 0000000..3930f5a
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/silence-checkers-and-packages-core-div-by-zero.cpp
@@ -0,0 +1,18 @@
+// RUN: %clang_analyze_cc1 \
+// RUN: -analyzer-checker=core -analyzer-config \
+// RUN: silence-checkers=core.DivideZero \
+// RUN: -verify %s
+
+void test_disable_core_div_by_zero() {
+ (void)(1 / 0);
+ // expected-warning@-1 {{division by zero is undefined}}
+ // no-warning: 'Division by zero'
+}
+
+void test_disable_null_deref(int *p) {
+ if (p)
+ return;
+
+ int x = p[0];
+ // expected-warning@-1 {{Array access (from variable 'p') results in a null pointer dereference}}
+}
diff --git a/src/llvm-project/clang/test/Analysis/sizeofpack.cpp b/src/llvm-project/clang/test/Analysis/sizeofpack.cpp
new file mode 100644
index 0000000..8c0ca02
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/sizeofpack.cpp
@@ -0,0 +1,15 @@
+// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection \
+// RUN: -std=c++14 -verify %s
+
+typedef __typeof(sizeof(int)) size_t;
+
+void clang_analyzer_eval(bool);
+
+template <int... N> size_t foo() {
+ return sizeof...(N);
+}
+
+void bar() {
+ clang_analyzer_eval(foo<>() == 0); // expected-warning{{TRUE}}
+ clang_analyzer_eval(foo<1, 2, 3>() == 3); // expected-warning{{TRUE}}
+}
diff --git a/src/llvm-project/clang/test/Analysis/stack-frame-context-revision.cpp b/src/llvm-project/clang/test/Analysis/stack-frame-context-revision.cpp
new file mode 100644
index 0000000..51f86de
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/stack-frame-context-revision.cpp
@@ -0,0 +1,37 @@
+// RUN: %clang_analyze_cc1 -std=c++14 -analyzer-checker=core,cplusplus.NewDelete -verify %s
+
+// expected-no-diagnostics:
+// From now the profile of the 'StackFrameContext' also contains the
+// 'NodeBuilderContext::blockCount()'. With this addition we can distinguish
+// between the 'StackArgumentsSpaceRegion' of the 'P' arguments being different
+// on every iteration.
+
+typedef __INTPTR_TYPE__ intptr_t;
+
+template <typename PointerTy>
+struct SmarterPointer {
+ PointerTy getFromVoidPointer(void *P) const {
+ return static_cast<PointerTy>(P);
+ }
+
+ PointerTy getPointer() const {
+ return getFromVoidPointer(reinterpret_cast<void *>(Value));
+ }
+
+ intptr_t Value = 13;
+};
+
+struct Node {
+ SmarterPointer<Node *> Pred;
+};
+
+void test(Node *N) {
+ while (N) {
+ SmarterPointer<Node *> Next = N->Pred;
+ delete N;
+
+ N = Next.getPointer();
+ // no-warning: 'Use of memory after it is freed' was here as the same
+ // 'StackArgumentsSpaceRegion' purged out twice as 'P'.
+ }
+}
diff --git a/src/llvm-project/clang/test/Analysis/stream.c b/src/llvm-project/clang/test/Analysis/stream.c
index 7adf14b..e1db678 100644
--- a/src/llvm-project/clang/test/Analysis/stream.c
+++ b/src/llvm-project/clang/test/Analysis/stream.c
@@ -1,6 +1,7 @@
// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.unix.Stream -analyzer-store region -verify %s
typedef __typeof__(sizeof(int)) size_t;
+typedef __typeof__(sizeof(int)) fpos_t;
typedef struct _IO_FILE FILE;
#define SEEK_SET 0 /* Seek from beginning of file. */
#define SEEK_CUR 1 /* Seek from current position. */
@@ -9,36 +10,94 @@
extern FILE *tmpfile(void);
extern int fclose(FILE *fp);
extern size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream);
+extern size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream);
extern int fseek (FILE *__stream, long int __off, int __whence);
extern long int ftell (FILE *__stream);
extern void rewind (FILE *__stream);
+extern int fgetpos(FILE *stream, fpos_t *pos);
+extern int fsetpos(FILE *stream, const fpos_t *pos);
+extern void clearerr(FILE *stream);
+extern int feof(FILE *stream);
+extern int ferror(FILE *stream);
+extern int fileno(FILE *stream);
+extern FILE *freopen(const char *pathname, const char *mode, FILE *stream);
-void f1(void) {
+void check_fread() {
+ FILE *fp = tmpfile();
+ fread(0, 0, 0, fp); // expected-warning {{Stream pointer might be NULL}}
+ fclose(fp);
+}
+
+void check_fwrite() {
+ FILE *fp = tmpfile();
+ fwrite(0, 0, 0, fp); // expected-warning {{Stream pointer might be NULL}}
+ fclose(fp);
+}
+
+void check_fseek() {
+ FILE *fp = tmpfile();
+ fseek(fp, 0, 0); // expected-warning {{Stream pointer might be NULL}}
+ fclose(fp);
+}
+
+void check_ftell() {
+ FILE *fp = tmpfile();
+ ftell(fp); // expected-warning {{Stream pointer might be NULL}}
+ fclose(fp);
+}
+
+void check_rewind() {
+ FILE *fp = tmpfile();
+ rewind(fp); // expected-warning {{Stream pointer might be NULL}}
+ fclose(fp);
+}
+
+void check_fgetpos() {
+ FILE *fp = tmpfile();
+ fpos_t pos;
+ fgetpos(fp, &pos); // expected-warning {{Stream pointer might be NULL}}
+ fclose(fp);
+}
+
+void check_fsetpos() {
+ FILE *fp = tmpfile();
+ fpos_t pos;
+ fsetpos(fp, &pos); // expected-warning {{Stream pointer might be NULL}}
+ fclose(fp);
+}
+
+void check_clearerr() {
+ FILE *fp = tmpfile();
+ clearerr(fp); // expected-warning {{Stream pointer might be NULL}}
+ fclose(fp);
+}
+
+void check_feof() {
+ FILE *fp = tmpfile();
+ feof(fp); // expected-warning {{Stream pointer might be NULL}}
+ fclose(fp);
+}
+
+void check_ferror() {
+ FILE *fp = tmpfile();
+ ferror(fp); // expected-warning {{Stream pointer might be NULL}}
+ fclose(fp);
+}
+
+void check_fileno() {
+ FILE *fp = tmpfile();
+ fileno(fp); // expected-warning {{Stream pointer might be NULL}}
+ fclose(fp);
+}
+
+void f_open(void) {
FILE *p = fopen("foo", "r");
char buf[1024];
fread(buf, 1, 1, p); // expected-warning {{Stream pointer might be NULL}}
fclose(p);
}
-void f2(void) {
- FILE *p = fopen("foo", "r");
- fseek(p, 1, SEEK_SET); // expected-warning {{Stream pointer might be NULL}}
- fclose(p);
-}
-
-void f3(void) {
- FILE *p = fopen("foo", "r");
- ftell(p); // expected-warning {{Stream pointer might be NULL}}
- fclose(p);
-}
-
-void f4(void) {
- FILE *p = fopen("foo", "r");
- rewind(p); // expected-warning {{Stream pointer might be NULL}}
- fclose(p);
-}
-
-void f5(void) {
+void f_seek(void) {
FILE *p = fopen("foo", "r");
if (!p)
return;
@@ -47,26 +106,27 @@
fclose(p);
}
-void f6(void) {
+void f_double_close(void) {
FILE *p = fopen("foo", "r");
fclose(p);
fclose(p); // expected-warning {{Try to close a file Descriptor already closed. Cause undefined behaviour}}
}
-void f7(void) {
- FILE *p = tmpfile();
- ftell(p); // expected-warning {{Stream pointer might be NULL}}
- fclose(p);
+void f_double_close_alias(void) {
+ FILE *p1 = fopen("foo", "r");
+ FILE *p2 = p1;
+ fclose(p1);
+ fclose(p2); // expected-warning {{Try to close a file Descriptor already closed. Cause undefined behaviour}}
}
-void f8(int c) {
+void f_leak(int c) {
FILE *p = fopen("foo.c", "r");
if(c)
return; // expected-warning {{Opened File never closed. Potential Resource leak}}
fclose(p);
}
-FILE *f9(void) {
+FILE *f_null_checked(void) {
FILE *p = fopen("foo.c", "r");
if (p)
return p; // no-warning
@@ -83,3 +143,36 @@
fseek(stream, offset, whence);
}
+void check_freopen_1() {
+ FILE *f1 = freopen("foo.c", "r", (FILE *)0); // expected-warning {{Stream pointer might be NULL}}
+ f1 = freopen(0, "w", (FILE *)0x123456); // Do not report this as error.
+}
+
+void check_freopen_2() {
+ FILE *f1 = fopen("foo.c", "r");
+ if (f1) {
+ FILE *f2 = freopen(0, "w", f1);
+ if (f2) {
+ // Check if f1 and f2 point to the same stream.
+ fclose(f1);
+ fclose(f2); // expected-warning {{Try to close a file Descriptor already closed. Cause undefined behaviour}}
+ } else {
+ // Reopen failed.
+ // f1 points now to a possibly invalid stream but this condition is currently not checked.
+ // f2 is NULL.
+ rewind(f1);
+ rewind(f2); // expected-warning {{Stream pointer might be NULL}}
+ }
+ }
+}
+
+void check_freopen_3() {
+ FILE *f1 = fopen("foo.c", "r");
+ if (f1) {
+ // Unchecked result of freopen.
+ // The f1 may be invalid after this call (not checked by the checker).
+ freopen(0, "w", f1);
+ rewind(f1);
+ fclose(f1);
+ }
+}
diff --git a/src/llvm-project/clang/test/Analysis/stream.cpp b/src/llvm-project/clang/test/Analysis/stream.cpp
new file mode 100644
index 0000000..c76b9d7
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/stream.cpp
@@ -0,0 +1,22 @@
+// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.unix.Stream -analyzer-store region -verify %s
+
+typedef struct _IO_FILE FILE;
+extern FILE *fopen(const char *path, const char *mode);
+
+struct X {
+ int A;
+ int B;
+};
+
+void *fopen(X x, const char *mode) {
+ return new char[4];
+}
+
+void f1() {
+ X X1;
+ void *p = fopen(X1, "oo");
+} // no-warning
+
+void f2() {
+ FILE *f = fopen("file", "r");
+} // expected-warning {{Opened File never closed. Potential Resource leak}}
diff --git a/src/llvm-project/clang/test/Analysis/string.c b/src/llvm-project/clang/test/Analysis/string.c
index 841bc15..7612614 100644
--- a/src/llvm-project/clang/test/Analysis/string.c
+++ b/src/llvm-project/clang/test/Analysis/string.c
@@ -97,7 +97,7 @@
}
size_t strlen_null() {
- return strlen(0); // expected-warning{{Null pointer argument in call to string length function}}
+ return strlen(0); // expected-warning{{Null pointer passed as 1st argument to string length function}}
}
size_t strlen_fn() {
@@ -251,7 +251,7 @@
}
size_t strnlen_null() {
- return strnlen(0, 3); // expected-warning{{Null pointer argument in call to string length function}}
+ return strnlen(0, 3); // expected-warning{{Null pointer passed as 1st argument to string length function}}
}
size_t strnlen_fn() {
@@ -322,11 +322,11 @@
void strcpy_null_dst(char *x) {
- strcpy(NULL, x); // expected-warning{{Null pointer argument in call to string copy function}}
+ strcpy(NULL, x); // expected-warning{{Null pointer passed as 1st argument to string copy function}}
}
void strcpy_null_src(char *x) {
- strcpy(x, NULL); // expected-warning{{Null pointer argument in call to string copy function}}
+ strcpy(x, NULL); // expected-warning{{Null pointer passed as 2nd argument to string copy function}}
}
void strcpy_fn(char *x) {
@@ -424,15 +424,15 @@
void strcat_null_dst(char *x) {
- strcat(NULL, x); // expected-warning{{Null pointer argument in call to string copy function}}
+ strcat(NULL, x); // expected-warning{{Null pointer passed as 1st argument to string concatenation function}}
}
void strcat_null_src(char *x) {
- strcat(x, NULL); // expected-warning{{Null pointer argument in call to string copy function}}
+ strcat(x, NULL); // expected-warning{{Null pointer passed as 2nd argument to string concatenation function}}
}
void strcat_fn(char *x) {
- strcat(x, (char*)&strcat_fn); // expected-warning{{Argument to string copy function is the address of the function 'strcat_fn', which is not a null-terminated string}}
+ strcat(x, (char*)&strcat_fn); // expected-warning{{Argument to string concatenation function is the address of the function 'strcat_fn', which is not a null-terminated string}}
}
void strcat_effects(char *y) {
@@ -523,11 +523,11 @@
void strncpy_null_dst(char *x) {
- strncpy(NULL, x, 5); // expected-warning{{Null pointer argument in call to string copy function}}
+ strncpy(NULL, x, 5); // expected-warning{{Null pointer passed as 1st argument to string copy function}}
}
void strncpy_null_src(char *x) {
- strncpy(x, NULL, 5); // expected-warning{{Null pointer argument in call to string copy function}}
+ strncpy(x, NULL, 5); // expected-warning{{Null pointer passed as 2nd argument to string copy function}}
}
void strncpy_fn(char *x) {
@@ -631,15 +631,15 @@
void strncat_null_dst(char *x) {
- strncat(NULL, x, 4); // expected-warning{{Null pointer argument in call to string copy function}}
+ strncat(NULL, x, 4); // expected-warning{{Null pointer passed as 1st argument to string concatenation function}}
}
void strncat_null_src(char *x) {
- strncat(x, NULL, 4); // expected-warning{{Null pointer argument in call to string copy function}}
+ strncat(x, NULL, 4); // expected-warning{{Null pointer passed as 2nd argument to string concatenation function}}
}
void strncat_fn(char *x) {
- strncat(x, (char*)&strncat_fn, 4); // expected-warning{{Argument to string copy function is the address of the function 'strncat_fn', which is not a null-terminated string}}
+ strncat(x, (char*)&strncat_fn, 4); // expected-warning{{Argument to string concatenation function is the address of the function 'strncat_fn', which is not a null-terminated string}}
}
void strncat_effects(char *y) {
@@ -812,13 +812,13 @@
void strcmp_null_0() {
char *x = NULL;
char *y = "123";
- strcmp(x, y); // expected-warning{{Null pointer argument in call to string comparison function}}
+ strcmp(x, y); // expected-warning{{Null pointer passed as 1st argument to string comparison function}}
}
void strcmp_null_1() {
char *x = "123";
char *y = NULL;
- strcmp(x, y); // expected-warning{{Null pointer argument in call to string comparison function}}
+ strcmp(x, y); // expected-warning{{Null pointer passed as 2nd argument to string comparison function}}
}
void strcmp_diff_length_0() {
@@ -867,6 +867,12 @@
fPtr(&a);
}
+int strcmp_null_argument(char *a) {
+ char *b = 0;
+ // Do not warn about the first argument!
+ return strcmp(a, b); // expected-warning{{Null pointer passed as 2nd argument to string comparison function}}
+}
+
//===----------------------------------------------------------------------===
// strncmp()
//===----------------------------------------------------------------------===
@@ -921,13 +927,13 @@
void strncmp_null_0() {
char *x = NULL;
char *y = "123";
- strncmp(x, y, 3); // expected-warning{{Null pointer argument in call to string comparison function}}
+ strncmp(x, y, 3); // expected-warning{{Null pointer passed as 1st argument to string comparison function}}
}
void strncmp_null_1() {
char *x = "123";
char *y = NULL;
- strncmp(x, y, 3); // expected-warning{{Null pointer argument in call to string comparison function}}
+ strncmp(x, y, 3); // expected-warning{{Null pointer passed as 2nd argument to string comparison function}}
}
void strncmp_diff_length_0() {
@@ -976,6 +982,12 @@
clang_analyzer_eval(strncmp("ab\0zz", "ab\0yy", 4) == 0); // expected-warning{{TRUE}}
}
+int strncmp_null_argument(char *a, size_t n) {
+ char *b = 0;
+ // Do not warn about the first argument!
+ return strncmp(a, b, n); // expected-warning{{Null pointer passed as 2nd argument to string comparison function}}
+}
+
//===----------------------------------------------------------------------===
// strcasecmp()
//===----------------------------------------------------------------------===
@@ -1030,13 +1042,13 @@
void strcasecmp_null_0() {
char *x = NULL;
char *y = "123";
- strcasecmp(x, y); // expected-warning{{Null pointer argument in call to string comparison function}}
+ strcasecmp(x, y); // expected-warning{{Null pointer passed as 1st argument to string comparison function}}
}
void strcasecmp_null_1() {
char *x = "123";
char *y = NULL;
- strcasecmp(x, y); // expected-warning{{Null pointer argument in call to string comparison function}}
+ strcasecmp(x, y); // expected-warning{{Null pointer passed as 2nd argument to string comparison function}}
}
void strcasecmp_diff_length_0() {
@@ -1067,6 +1079,12 @@
clang_analyzer_eval(strcasecmp("ab\0zz", "ab\0yy") == 0); // expected-warning{{TRUE}}
}
+int strcasecmp_null_argument(char *a) {
+ char *b = 0;
+ // Do not warn about the first argument!
+ return strcasecmp(a, b); // expected-warning{{Null pointer passed as 2nd argument to string comparison function}}
+}
+
//===----------------------------------------------------------------------===
// strncasecmp()
//===----------------------------------------------------------------------===
@@ -1121,13 +1139,13 @@
void strncasecmp_null_0() {
char *x = NULL;
char *y = "123";
- strncasecmp(x, y, 3); // expected-warning{{Null pointer argument in call to string comparison function}}
+ strncasecmp(x, y, 3); // expected-warning{{Null pointer passed as 1st argument to string comparison function}}
}
void strncasecmp_null_1() {
char *x = "123";
char *y = NULL;
- strncasecmp(x, y, 3); // expected-warning{{Null pointer argument in call to string comparison function}}
+ strncasecmp(x, y, 3); // expected-warning{{Null pointer passed as 2nd argument to string comparison function}}
}
void strncasecmp_diff_length_0() {
@@ -1176,6 +1194,12 @@
clang_analyzer_eval(strncasecmp("ab\0zz", "ab\0yy", 4) == 0); // expected-warning{{TRUE}}
}
+int strncasecmp_null_argument(char *a, size_t n) {
+ char *b = 0;
+ // Do not warn about the first argument!
+ return strncasecmp(a, b, n); // expected-warning{{Null pointer passed as 2nd argument to string comparison function}}
+}
+
//===----------------------------------------------------------------------===
// strsep()
//===----------------------------------------------------------------------===
@@ -1183,11 +1207,11 @@
char *strsep(char **stringp, const char *delim);
void strsep_null_delim(char *s) {
- strsep(&s, NULL); // expected-warning{{Null pointer argument in call to strsep()}}
+ strsep(&s, NULL); // expected-warning{{Null pointer passed as 2nd argument to strsep()}}
}
void strsep_null_search() {
- strsep(NULL, ""); // expected-warning{{Null pointer argument in call to strsep()}}
+ strsep(NULL, ""); // expected-warning{{Null pointer passed as 1st argument to strsep()}}
}
void strsep_return_original_pointer(char *s) {
@@ -1433,7 +1457,7 @@
void bzero1_null() {
char *a = NULL;
- bzero(a, 10); // expected-warning{{Null pointer argument in call to memory clearance function}}
+ bzero(a, 10); // expected-warning{{Null pointer passed as 1st argument to memory clearance function}}
}
void bzero2_char_array_null() {
@@ -1453,7 +1477,7 @@
void explicit_bzero1_null() {
char *a = NULL;
- explicit_bzero(a, 10); // expected-warning{{Null pointer argument in call to memory clearance function}}
+ explicit_bzero(a, 10); // expected-warning{{Null pointer passed as 1st argument to memory clearance function}}
}
void explicit_bzero2_clear_mypassword() {
diff --git a/src/llvm-project/clang/test/Analysis/structured_bindings.cc b/src/llvm-project/clang/test/Analysis/structured_bindings.cc
deleted file mode 100644
index 1e23246..0000000
--- a/src/llvm-project/clang/test/Analysis/structured_bindings.cc
+++ /dev/null
@@ -1,10 +0,0 @@
-// RUN: %clang_analyze_cc1 -std=c++17 -analyzer-checker=core -verify %s
-
-// expected-no-diagnostics
-struct s { int a; };
-int foo() {
- auto[a] = s{1}; // FIXME: proper modelling
- if (a) {
- }
-}
-
diff --git a/src/llvm-project/clang/test/Analysis/structured_bindings.cpp b/src/llvm-project/clang/test/Analysis/structured_bindings.cpp
new file mode 100644
index 0000000..3e8ff1c
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/structured_bindings.cpp
@@ -0,0 +1,9 @@
+// RUN: %clang_analyze_cc1 -std=c++17 -analyzer-checker=core -verify %s
+
+struct s { int a; };
+int foo() {
+ auto[a] = s{1}; // FIXME: proper modelling
+ if (a) {
+ }
+} // expected-warning{{non-void function does not return a value}}
+
diff --git a/src/llvm-project/clang/test/Analysis/taint-generic.c b/src/llvm-project/clang/test/Analysis/taint-generic.c
index cdac02b..60a27c5 100644
--- a/src/llvm-project/clang/test/Analysis/taint-generic.c
+++ b/src/llvm-project/clang/test/Analysis/taint-generic.c
@@ -1,5 +1,49 @@
-// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.security.taint,core,alpha.security.ArrayBoundV2 -Wno-format-security -verify %s
-// RUN: %clang_analyze_cc1 -DFILE_IS_STRUCT -analyzer-checker=alpha.security.taint,core,alpha.security.ArrayBoundV2 -Wno-format-security -verify %s
+// RUN: %clang_analyze_cc1 -Wno-format-security -verify %s \
+// RUN: -analyzer-checker=alpha.security.taint \
+// RUN: -analyzer-checker=core \
+// RUN: -analyzer-checker=alpha.security.ArrayBoundV2 \
+// RUN: -analyzer-config \
+// RUN: alpha.security.taint.TaintPropagation:Config=%S/Inputs/taint-generic-config.yaml
+
+// RUN: %clang_analyze_cc1 -Wno-format-security -verify %s \
+// RUN: -DFILE_IS_STRUCT \
+// RUN: -analyzer-checker=alpha.security.taint \
+// RUN: -analyzer-checker=core \
+// RUN: -analyzer-checker=alpha.security.ArrayBoundV2 \
+// RUN: -analyzer-config \
+// RUN: alpha.security.taint.TaintPropagation:Config=%S/Inputs/taint-generic-config.yaml
+
+// RUN: not %clang_analyze_cc1 -verify %s \
+// RUN: -analyzer-checker=alpha.security.taint \
+// RUN: -analyzer-config \
+// RUN: alpha.security.taint.TaintPropagation:Config=justguessit \
+// RUN: 2>&1 | FileCheck %s -check-prefix=CHECK-INVALID-FILE
+
+// CHECK-INVALID-FILE: (frontend): invalid input for checker option
+// CHECK-INVALID-FILE-SAME: 'alpha.security.taint.TaintPropagation:Config',
+// CHECK-INVALID-FILE-SAME: that expects a valid filename instead of
+// CHECK-INVALID-FILE-SAME: 'justguessit'
+
+// RUN: not %clang_analyze_cc1 -verify %s \
+// RUN: -analyzer-checker=alpha.security.taint \
+// RUN: -analyzer-config \
+// RUN: alpha.security.taint.TaintPropagation:Config=%S/Inputs/taint-generic-config-ill-formed.yaml \
+// RUN: 2>&1 | FileCheck %s -check-prefix=CHECK-ILL-FORMED
+
+// CHECK-ILL-FORMED: (frontend): invalid input for checker option
+// CHECK-ILL-FORMED-SAME: 'alpha.security.taint.TaintPropagation:Config',
+// CHECK-ILL-FORMED-SAME: that expects a valid yaml file: {{[Ii]}}nvalid argument
+
+// RUN: not %clang_analyze_cc1 -verify %s \
+// RUN: -analyzer-checker=alpha.security.taint \
+// RUN: -analyzer-config \
+// RUN: alpha.security.taint.TaintPropagation:Config=%S/Inputs/taint-generic-config-invalid-arg.yaml \
+// RUN: 2>&1 | FileCheck %s -check-prefix=CHECK-INVALID-ARG
+
+// CHECK-INVALID-ARG: (frontend): invalid input for checker option
+// CHECK-INVALID-ARG-SAME: 'alpha.security.taint.TaintPropagation:Config',
+// CHECK-INVALID-ARG-SAME: that expects an argument number for propagation
+// CHECK-INVALID-ARG-SAME: rules greater or equal to -1
int scanf(const char *restrict format, ...);
char *gets(char *str);
@@ -12,6 +56,8 @@
extern FILE *stdin;
#endif
+#define bool _Bool
+
int fscanf(FILE *restrict stream, const char *restrict format, ...);
int sprintf(char *str, const char *format, ...);
void setproctitle(const char *fmt, ...);
@@ -294,3 +340,53 @@
if (i < rhs)
*(volatile int *) 0; // no-warning
}
+
+
+// Test configuration
+int mySource1();
+void mySource2(int*);
+void myScanf(const char*, ...);
+int myPropagator(int, int*);
+int mySnprintf(char*, size_t, const char*, ...);
+bool isOutOfRange(const int*);
+void mySink(int, int, int);
+
+void testConfigurationSources1() {
+ int x = mySource1();
+ Buffer[x] = 1; // expected-warning {{Out of bound memory access }}
+}
+
+void testConfigurationSources2() {
+ int x;
+ mySource2(&x);
+ Buffer[x] = 1; // expected-warning {{Out of bound memory access }}
+}
+
+void testConfigurationSources3() {
+ int x, y;
+ myScanf("%d %d", &x, &y);
+ Buffer[y] = 1; // expected-warning {{Out of bound memory access }}
+}
+
+void testConfigurationPropagation() {
+ int x = mySource1();
+ int y;
+ myPropagator(x, &y);
+ Buffer[y] = 1; // expected-warning {{Out of bound memory access }}
+}
+
+void testConfigurationFilter() {
+ int x = mySource1();
+ if (isOutOfRange(&x)) // the filter function
+ return;
+ Buffer[x] = 1; // no-warning
+}
+
+void testConfigurationSinks() {
+ int x = mySource1();
+ mySink(x, 1, 2);
+ // expected-warning@-1 {{Untrusted data is passed to a user-defined sink}}
+ mySink(1, x, 2); // no-warning
+ mySink(1, 2, x);
+ // expected-warning@-1 {{Untrusted data is passed to a user-defined sink}}
+}
diff --git a/src/llvm-project/clang/test/Analysis/taint-generic.cpp b/src/llvm-project/clang/test/Analysis/taint-generic.cpp
new file mode 100644
index 0000000..09cd544
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/taint-generic.cpp
@@ -0,0 +1,126 @@
+// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.security.taint,core,alpha.security.ArrayBoundV2 -analyzer-config alpha.security.taint.TaintPropagation:Config=%S/Inputs/taint-generic-config.yaml -Wno-format-security -verify -std=c++11 %s
+
+#define BUFSIZE 10
+int Buffer[BUFSIZE];
+
+int scanf(const char*, ...);
+int mySource1();
+int mySource3();
+
+bool isOutOfRange2(const int*);
+
+void mySink2(int);
+
+// Test configuration
+namespace myNamespace {
+ void scanf(const char*, ...);
+ void myScanf(const char*, ...);
+ int mySource3();
+
+ bool isOutOfRange(const int*);
+ bool isOutOfRange2(const int*);
+
+ void mySink(int, int, int);
+ void mySink2(int);
+}
+
+namespace myAnotherNamespace {
+ int mySource3();
+
+ bool isOutOfRange2(const int*);
+
+ void mySink2(int);
+}
+
+void testConfigurationNamespacePropagation1() {
+ int x;
+ // The built-in functions should be matched only for functions in
+ // the global namespace
+ myNamespace::scanf("%d", &x);
+ Buffer[x] = 1; // no-warning
+
+ scanf("%d", &x);
+ Buffer[x] = 1; // expected-warning {{Out of bound memory access }}
+}
+
+void testConfigurationNamespacePropagation2() {
+ int x = mySource3();
+ Buffer[x] = 1; // no-warning
+
+ int y = myNamespace::mySource3();
+ Buffer[y] = 1; // expected-warning {{Out of bound memory access }}
+}
+
+void testConfigurationNamespacePropagation3() {
+ int x = myAnotherNamespace::mySource3();
+ Buffer[x] = 1; // expected-warning {{Out of bound memory access }}
+}
+
+void testConfigurationNamespacePropagation4() {
+ int x;
+ // Configured functions without scope should match for all function.
+ myNamespace::myScanf("%d", &x);
+ Buffer[x] = 1; // expected-warning {{Out of bound memory access }}
+}
+
+void testConfigurationNamespaceFilter1() {
+ int x = mySource1();
+ if (myNamespace::isOutOfRange2(&x))
+ return;
+ Buffer[x] = 1; // no-warning
+
+ int y = mySource1();
+ if (isOutOfRange2(&y))
+ return;
+ Buffer[y] = 1; // expected-warning {{Out of bound memory access }}
+}
+
+void testConfigurationNamespaceFilter2() {
+ int x = mySource1();
+ if (myAnotherNamespace::isOutOfRange2(&x))
+ return;
+ Buffer[x] = 1; // no-warning
+}
+
+void testConfigurationNamespaceFilter3() {
+ int x = mySource1();
+ if (myNamespace::isOutOfRange(&x))
+ return;
+ Buffer[x] = 1; // no-warning
+}
+
+void testConfigurationNamespaceSink1() {
+ int x = mySource1();
+ mySink2(x); // no-warning
+
+ int y = mySource1();
+ myNamespace::mySink2(y);
+ // expected-warning@-1 {{Untrusted data is passed to a user-defined sink}}
+}
+
+void testConfigurationNamespaceSink2() {
+ int x = mySource1();
+ myAnotherNamespace::mySink2(x);
+ // expected-warning@-1 {{Untrusted data is passed to a user-defined sink}}
+}
+
+void testConfigurationNamespaceSink3() {
+ int x = mySource1();
+ myNamespace::mySink(x, 0, 1);
+ // expected-warning@-1 {{Untrusted data is passed to a user-defined sink}}
+}
+
+struct Foo {
+ void scanf(const char*, int*);
+ void myMemberScanf(const char*, int*);
+};
+
+void testConfigurationMemberFunc() {
+ int x;
+ Foo foo;
+ foo.scanf("%d", &x);
+ Buffer[x] = 1; // no-warning
+
+ foo.myMemberScanf("%d", &x);
+ Buffer[x] = 1; // expected-warning {{Out of bound memory access }}
+}
diff --git a/src/llvm-project/clang/test/Analysis/temp-obj-dtors-cfg-output.cpp b/src/llvm-project/clang/test/Analysis/temp-obj-dtors-cfg-output.cpp
index d08b01c..5b16915 100644
--- a/src/llvm-project/clang/test/Analysis/temp-obj-dtors-cfg-output.cpp
+++ b/src/llvm-project/clang/test/Analysis/temp-obj-dtors-cfg-output.cpp
@@ -1224,8 +1224,7 @@
// CHECK: 16: a([B1.15]) (Member initializer)
// CHECK: 17: ~B() (Temporary object destructor)
// CHECK: 18: ~A() (Temporary object destructor)
-// CHECK: 19: /*implicit*/(int)0
-// CHECK: 20: b([B1.19]) (Member initializer)
+// CHECK: 19: b(/*implicit*/(int)0) (Member initializer)
// CHECK: Preds (1): B2
// CHECK: Succs (1): B0
// CHECK: [B0 (EXIT)]
diff --git a/src/llvm-project/clang/test/Analysis/temporaries.cpp b/src/llvm-project/clang/test/Analysis/temporaries.cpp
index 6191abf..325b689 100644
--- a/src/llvm-project/clang/test/Analysis/temporaries.cpp
+++ b/src/llvm-project/clang/test/Analysis/temporaries.cpp
@@ -830,12 +830,7 @@
// On each branch the variable is constructed directly.
if (coin) {
clang_analyzer_eval(x == 1); // expected-warning{{TRUE}}
-#if __cplusplus < 201703L
clang_analyzer_eval(y == 1); // expected-warning{{TRUE}}
-#else
- // FIXME: Destructor called twice in C++17?
- clang_analyzer_eval(y == 2); // expected-warning{{TRUE}}
-#endif
clang_analyzer_eval(z == 0); // expected-warning{{TRUE}}
clang_analyzer_eval(w == 0); // expected-warning{{TRUE}}
@@ -843,12 +838,7 @@
clang_analyzer_eval(x == 0); // expected-warning{{TRUE}}
clang_analyzer_eval(y == 0); // expected-warning{{TRUE}}
clang_analyzer_eval(z == 1); // expected-warning{{TRUE}}
-#if __cplusplus < 201703L
clang_analyzer_eval(w == 1); // expected-warning{{TRUE}}
-#else
- // FIXME: Destructor called twice in C++17?
- clang_analyzer_eval(w == 2); // expected-warning{{TRUE}}
-#endif
}
}
} // namespace test_match_constructors_and_destructors
@@ -1055,16 +1045,11 @@
#endif
bar2(S(2));
- // FIXME: Why are we losing information in C++17?
clang_analyzer_eval(glob == 2);
#ifdef TEMPORARY_DTORS
-#if __cplusplus < 201703L
- // expected-warning@-3{{TRUE}}
+ // expected-warning@-2{{TRUE}}
#else
- // expected-warning@-5{{UNKNOWN}}
-#endif
-#else
- // expected-warning@-8{{UNKNOWN}}
+ // expected-warning@-4{{UNKNOWN}}
#endif
C *c = new D();
@@ -1246,3 +1231,19 @@
return coin ? S() : foo(); // no-warning
}
} // namespace return_from_top_frame
+
+#if __cplusplus >= 201103L
+namespace arguments_of_operators {
+struct S {
+ S() {}
+ S(const S &) {}
+};
+
+void test() {
+ int x = 0;
+ auto foo = [](S s, int &y) { y = 1; };
+ foo(S(), x);
+ clang_analyzer_eval(x == 1); // expected-warning{{TRUE}}
+}
+} // namespace arguments_of_operators
+#endif // __cplusplus >= 201103L
diff --git a/src/llvm-project/clang/test/Analysis/temporaries.mm b/src/llvm-project/clang/test/Analysis/temporaries.mm
index 43546ae..44d30d5 100644
--- a/src/llvm-project/clang/test/Analysis/temporaries.mm
+++ b/src/llvm-project/clang/test/Analysis/temporaries.mm
@@ -1,4 +1,4 @@
-// RUN: %clang_analyze_cc1 -analyzer-checker core,cplusplus -verify %s
+// RUN: %clang_analyze_cc1 -std=c++14 -analyzer-checker core,cplusplus -verify %s
// expected-no-diagnostics
diff --git a/src/llvm-project/clang/test/Analysis/test-separate-retaincount.cpp b/src/llvm-project/clang/test/Analysis/test-separate-retaincount.cpp
index 5fda2b2..621e1d1 100644
--- a/src/llvm-project/clang/test/Analysis/test-separate-retaincount.cpp
+++ b/src/llvm-project/clang/test/Analysis/test-separate-retaincount.cpp
@@ -1,12 +1,12 @@
-// RUN: %clang_analyze_cc1 -DNO_CF_OBJECT -verify %s \
+// RUN: %clang_analyze_cc1 -std=c++14 -DNO_CF_OBJECT -verify %s \
// RUN: -analyzer-checker=core,osx \
// RUN: -analyzer-disable-checker osx.cocoa.RetainCount
//
-// RUN: %clang_analyze_cc1 -DNO_OS_OBJECT -verify %s \
+// RUN: %clang_analyze_cc1 -std=c++14 -DNO_OS_OBJECT -verify %s \
// RUN: -analyzer-checker=core,osx \
// RUN: -analyzer-disable-checker osx.OSObjectRetainCount
//
-// RUN: %clang_analyze_cc1 -DNO_OS_OBJECT -verify %s \
+// RUN: %clang_analyze_cc1 -std=c++14 -DNO_OS_OBJECT -verify %s \
// RUN: -analyzer-checker=core,osx \
// RUN: -analyzer-config "osx.cocoa.RetainCount:CheckOSObject=false"
diff --git a/src/llvm-project/clang/test/Analysis/track-control-dependency-conditions.cpp b/src/llvm-project/clang/test/Analysis/track-control-dependency-conditions.cpp
index d4e59a7..11eb1c5 100644
--- a/src/llvm-project/clang/test/Analysis/track-control-dependency-conditions.cpp
+++ b/src/llvm-project/clang/test/Analysis/track-control-dependency-conditions.cpp
@@ -1,11 +1,12 @@
-// RUN: %clang_analyze_cc1 %s \
+// RUN: %clang_analyze_cc1 %s -std=c++14 \
// RUN: -verify=expected,tracking \
// RUN: -analyzer-config track-conditions=true \
// RUN: -analyzer-output=text \
// RUN: -analyzer-checker=core
-// RUN: not %clang_analyze_cc1 -verify %s \
+// RUN: not %clang_analyze_cc1 -std=c++14 -verify %s \
// RUN: -analyzer-checker=core \
+// RUN: -analyzer-config track-conditions=false \
// RUN: -analyzer-config track-conditions-debug=true \
// RUN: 2>&1 | FileCheck %s -check-prefix=CHECK-INVALID-DEBUG
@@ -13,15 +14,16 @@
// CHECK-INVALID-DEBUG-SAME: 'track-conditions-debug', that expects
// CHECK-INVALID-DEBUG-SAME: 'track-conditions' to also be enabled
//
-// RUN: %clang_analyze_cc1 %s \
+// RUN: %clang_analyze_cc1 %s -std=c++14 \
// RUN: -verify=expected,tracking,debug \
// RUN: -analyzer-config track-conditions=true \
// RUN: -analyzer-config track-conditions-debug=true \
// RUN: -analyzer-output=text \
// RUN: -analyzer-checker=core
-// RUN: %clang_analyze_cc1 %s -verify \
+// RUN: %clang_analyze_cc1 %s -std=c++14 -verify \
// RUN: -analyzer-output=text \
+// RUN: -analyzer-config track-conditions=false \
// RUN: -analyzer-checker=core
namespace example_1 {
@@ -29,24 +31,24 @@
bool coin();
void foo() {
- flag = coin(); // tracking-note{{Value assigned to 'flag'}}
+ flag = coin(); // tracking-note-re{{{{^}}Value assigned to 'flag', which participates in a condition later{{$}}}}
}
void test() {
- int *x = 0; // expected-note{{'x' initialized to a null pointer value}}
+ int *x = 0; // expected-note-re{{{{^}}'x' initialized to a null pointer value{{$}}}}
flag = 1;
foo(); // TODO: Add nodes here about flag's value being invalidated.
- if (flag) // expected-note {{Assuming 'flag' is 0}}
- // expected-note@-1{{Taking false branch}}
+ if (flag) // expected-note-re {{{{^}}Assuming 'flag' is 0{{$}}}}
+ // expected-note-re@-1{{{{^}}Taking false branch{{$}}}}
x = new int;
- foo(); // tracking-note{{Calling 'foo'}}
- // tracking-note@-1{{Returning from 'foo'}}
+ foo(); // tracking-note-re{{{{^}}Calling 'foo'{{$}}}}
+ // tracking-note-re@-1{{{{^}}Returning from 'foo'{{$}}}}
- if (flag) // expected-note {{Assuming 'flag' is not equal to 0}}
- // expected-note@-1{{Taking true branch}}
- // debug-note@-2{{Tracking condition 'flag'}}
+ if (flag) // expected-note-re {{{{^}}Assuming 'flag' is not equal to 0{{$}}}}
+ // expected-note-re@-1{{{{^}}Taking true branch{{$}}}}
+ // debug-note-re@-2{{{{^}}Tracking condition 'flag'{{$}}}}
*x = 5; // expected-warning{{Dereference of null pointer}}
// expected-note@-1{{Dereference of null pointer}}
@@ -58,7 +60,7 @@
bool coin();
void foo() {
- flag = coin(); // tracking-note{{Value assigned to 'flag'}}
+ flag = coin(); // tracking-note-re{{{{^}}Value assigned to 'flag', which participates in a condition later{{$}}}}
}
void test() {
@@ -66,18 +68,18 @@
flag = 1;
foo();
- if (flag) // expected-note {{Assuming 'flag' is 0}}
- // expected-note@-1{{Taking false branch}}
+ if (flag) // expected-note-re {{{{^}}Assuming 'flag' is 0{{$}}}}
+ // expected-note-re@-1{{{{^}}Taking false branch{{$}}}}
x = new int;
- x = 0; // expected-note{{Null pointer value stored to 'x'}}
+ x = 0; // expected-note-re{{{{^}}Null pointer value stored to 'x'{{$}}}}
- foo(); // tracking-note{{Calling 'foo'}}
- // tracking-note@-1{{Returning from 'foo'}}
+ foo(); // tracking-note-re{{{{^}}Calling 'foo'{{$}}}}
+ // tracking-note-re@-1{{{{^}}Returning from 'foo'{{$}}}}
- if (flag) // expected-note {{Assuming 'flag' is not equal to 0}}
- // expected-note@-1{{Taking true branch}}
- // debug-note@-2{{Tracking condition 'flag'}}
+ if (flag) // expected-note-re {{{{^}}Assuming 'flag' is not equal to 0{{$}}}}
+ // expected-note-re@-1{{{{^}}Taking true branch{{$}}}}
+ // debug-note-re@-2{{{{^}}Tracking condition 'flag'{{$}}}}
*x = 5; // expected-warning{{Dereference of null pointer}}
// expected-note@-1{{Dereference of null pointer}}
@@ -90,25 +92,25 @@
void foo() {
// coin() could write bar, do it's invalidated.
- flag = coin(); // tracking-note{{Value assigned to 'flag'}}
- // tracking-note@-1{{Value assigned to 'bar'}}
+ flag = coin(); // tracking-note-re{{{{^}}Value assigned to 'flag', which participates in a condition later{{$}}}}
+ // tracking-note-re@-1{{{{^}}Value assigned to 'bar', which participates in a condition later{{$}}}}
}
int bar;
void test() {
- int *x = 0; // expected-note{{'x' initialized to a null pointer value}}
+ int *x = 0; // expected-note-re{{{{^}}'x' initialized to a null pointer value{{$}}}}
flag = 1;
- foo(); // tracking-note{{Calling 'foo'}}
- // tracking-note@-1{{Returning from 'foo'}}
+ foo(); // tracking-note-re{{{{^}}Calling 'foo'{{$}}}}
+ // tracking-note-re@-1{{{{^}}Returning from 'foo'{{$}}}}
- if (bar) // expected-note {{Assuming 'bar' is not equal to 0}}
- // expected-note@-1{{Taking true branch}}
- // debug-note@-2{{Tracking condition 'bar'}}
- if (flag) // expected-note {{Assuming 'flag' is not equal to 0}}
- // expected-note@-1{{Taking true branch}}
- // debug-note@-2{{Tracking condition 'flag'}}
+ if (bar) // expected-note-re {{{{^}}Assuming 'bar' is not equal to 0{{$}}}}
+ // expected-note-re@-1{{{{^}}Taking true branch{{$}}}}
+ // debug-note-re@-2{{{{^}}Tracking condition 'bar'{{$}}}}
+ if (flag) // expected-note-re {{{{^}}Assuming 'flag' is not equal to 0{{$}}}}
+ // expected-note-re@-1{{{{^}}Taking true branch{{$}}}}
+ // debug-note-re@-2{{{{^}}Tracking condition 'flag'{{$}}}}
*x = 5; // expected-warning{{Dereference of null pointer}}
// expected-note@-1{{Dereference of null pointer}}
@@ -119,20 +121,17 @@
bool coin();
bool foo() {
- return coin(); // tracking-note{{Returning value}}
+ return coin();
}
int bar;
void test() {
- int *x = 0; // expected-note{{'x' initialized to a null pointer value}}
+ int *x = 0; // expected-note-re{{{{^}}'x' initialized to a null pointer value{{$}}}}
- if (int flag = foo()) // tracking-note{{Calling 'foo'}}
- // tracking-note@-1{{Returning from 'foo'}}
- // tracking-note@-2{{'flag' initialized here}}
- // debug-note@-3{{Tracking condition 'flag'}}
- // expected-note@-4{{Assuming 'flag' is not equal to 0}}
- // expected-note@-5{{Taking true branch}}
+ if (int flag = foo()) // debug-note-re{{{{^}}Tracking condition 'flag'{{$}}}}
+ // expected-note-re@-1{{{{^}}Assuming 'flag' is not equal to 0{{$}}}}
+ // expected-note-re@-2{{{{^}}Taking true branch{{$}}}}
*x = 5; // expected-warning{{Dereference of null pointer}}
// expected-note@-1{{Dereference of null pointer}}
@@ -143,39 +142,133 @@
bool coin();
struct ConvertsToBool {
- operator bool() const { return coin(); } // tracking-note{{Returning value}}
+ operator bool() const { return coin(); }
};
void test() {
- int *x = 0; // expected-note{{'x' initialized to a null pointer value}}
+ int *x = 0; // expected-note-re{{{{^}}'x' initialized to a null pointer value{{$}}}}
if (ConvertsToBool())
- // tracking-note@-1 {{Calling 'ConvertsToBool::operator bool'}}
- // tracking-note@-2{{Returning from 'ConvertsToBool::operator bool'}}
- // debug-note@-3{{Tracking condition 'ConvertsToBool()'}}
- // expected-note@-4{{Assuming the condition is true}}
- // expected-note@-5{{Taking true branch}}
+ // debug-note-re@-1{{{{^}}Tracking condition 'ConvertsToBool()'{{$}}}}
+ // expected-note-re@-2{{{{^}}Assuming the condition is true{{$}}}}
+ // expected-note-re@-3{{{{^}}Taking true branch{{$}}}}
*x = 5; // expected-warning{{Dereference of null pointer}}
// expected-note@-1{{Dereference of null pointer}}
}
} // end of namespace variable_declaration_in_condition
+namespace note_from_different_but_not_nested_stackframe {
+
+void nullptrDeref(int *ptr, bool True) {
+ if (True) // expected-note-re{{{{^}}'True' is true{{$}}}}
+ // expected-note-re@-1{{{{^}}Taking true branch{{$}}}}
+ // debug-note-re@-2{{{{^}}Tracking condition 'True'{{$}}}}
+ *ptr = 5;
+ // expected-note@-1{{Dereference of null pointer (loaded from variable 'ptr')}}
+ // expected-warning@-2{{Dereference of null pointer (loaded from variable 'ptr')}}
+}
+
+void f() {
+ int *ptr = nullptr;
+ // expected-note-re@-1{{{{^}}'ptr' initialized to a null pointer value{{$}}}}
+ bool True = true;
+ nullptrDeref(ptr, True);
+ // expected-note-re@-1{{{{^}}Passing null pointer value via 1st parameter 'ptr'{{$}}}}
+ // expected-note-re@-2{{{{^}}Calling 'nullptrDeref'{{$}}}}
+}
+
+} // end of namespace note_from_different_but_not_nested_stackframe
+
+namespace important_returning_pointer_loaded_from {
+bool coin();
+
+int *getIntPtr();
+
+void storeValue(int **i) {
+ *i = getIntPtr(); // tracking-note-re{{{{^}}Value assigned to 'i', which participates in a condition later{{$}}}}
+}
+
+int *conjurePointer() {
+ int *i;
+ storeValue(&i); // tracking-note-re{{{{^}}Calling 'storeValue'{{$}}}}
+ // tracking-note-re@-1{{{{^}}Returning from 'storeValue'{{$}}}}
+ return i; // tracking-note-re{{{{^}}Returning pointer (loaded from 'i'), which participates in a condition later{{$}}}}
+}
+
+void f(int *ptr) {
+ if (ptr) // expected-note-re{{{{^}}Assuming 'ptr' is null{{$}}}}
+ // expected-note-re@-1{{{{^}}Taking false branch{{$}}}}
+ ;
+ if (!conjurePointer())
+ // tracking-note-re@-1{{{{^}}Calling 'conjurePointer'{{$}}}}
+ // tracking-note-re@-2{{{{^}}Returning from 'conjurePointer'{{$}}}}
+ // debug-note-re@-3{{{{^}}Tracking condition '!conjurePointer()'{{$}}}}
+ // expected-note-re@-4{{{{^}}Assuming the condition is true{{$}}}}
+ // expected-note-re@-5{{{{^}}Taking true branch{{$}}}}
+ *ptr = 5; // expected-warning{{Dereference of null pointer}}
+ // expected-note@-1{{Dereference of null pointer}}
+}
+} // end of namespace important_returning_pointer_loaded_from
+
+namespace unimportant_returning_pointer_loaded_from {
+bool coin();
+
+int *getIntPtr();
+
+int *conjurePointer() {
+ int *i = getIntPtr();
+ return i;
+}
+
+void f(int *ptr) {
+ if (ptr) // expected-note-re{{{{^}}Assuming 'ptr' is null{{$}}}}
+ // expected-note-re@-1{{{{^}}Taking false branch{{$}}}}
+ ;
+ if (!conjurePointer())
+ // debug-note-re@-1{{{{^}}Tracking condition '!conjurePointer()'{{$}}}}
+ // expected-note-re@-2{{{{^}}Assuming the condition is true{{$}}}}
+ // expected-note-re@-3{{{{^}}Taking true branch{{$}}}}
+ *ptr = 5; // expected-warning{{Dereference of null pointer}}
+ // expected-note@-1{{Dereference of null pointer}}
+}
+} // end of namespace unimportant_returning_pointer_loaded_from
+
+namespace unimportant_returning_pointer_loaded_from_through_cast {
+
+void *conjure();
+
+int *cast(void *P) {
+ return static_cast<int *>(P);
+}
+
+void f() {
+ int *x = 0; // expected-note-re{{{{^}}'x' initialized to a null pointer value{{$}}}}
+
+ if (cast(conjure()))
+ // debug-note-re@-1{{{{^}}Tracking condition 'cast(conjure())'{{$}}}}
+ // expected-note-re@-2{{{{^}}Assuming the condition is false{{$}}}}
+ // expected-note-re@-3{{{{^}}Taking false branch{{$}}}}
+ return;
+ *x = 5; // expected-warning{{Dereference of null pointer}}
+ // expected-note@-1{{Dereference of null pointer}}
+}
+
+} // end of namespace unimportant_returning_pointer_loaded_from_through_cast
+
namespace unimportant_returning_value_note {
bool coin();
-bool flipCoin() { return coin(); } // tracking-note{{Returning value}}
+bool flipCoin() { return coin(); }
void i(int *ptr) {
- if (ptr) // expected-note{{Assuming 'ptr' is null}}
- // expected-note@-1{{Taking false branch}}
+ if (ptr) // expected-note-re{{{{^}}Assuming 'ptr' is null{{$}}}}
+ // expected-note-re@-1{{{{^}}Taking false branch{{$}}}}
;
if (!flipCoin())
- // tracking-note@-1{{Calling 'flipCoin'}}
- // tracking-note@-2{{Returning from 'flipCoin'}}
- // debug-note@-3{{Tracking condition '!flipCoin()'}}
- // expected-note@-4{{Assuming the condition is true}}
- // expected-note@-5{{Taking true branch}}
+ // debug-note-re@-1{{{{^}}Tracking condition '!flipCoin()'{{$}}}}
+ // expected-note-re@-2{{{{^}}Assuming the condition is true{{$}}}}
+ // expected-note-re@-3{{{{^}}Taking true branch{{$}}}}
*ptr = 5; // expected-warning{{Dereference of null pointer}}
// expected-note@-1{{Dereference of null pointer}}
}
@@ -185,37 +278,67 @@
bool coin();
bool flipCoin() {
- if (coin()) // tracking-note{{Assuming the condition is false}}
- // tracking-note@-1{{Taking false branch}}
- // debug-note@-2{{Tracking condition 'coin()'}}
+ if (coin()) // tracking-note-re{{{{^}}Assuming the condition is false{{$}}}}
+ // tracking-note-re@-1{{{{^}}Taking false branch{{$}}}}
+ // debug-note-re@-2{{{{^}}Tracking condition 'coin()'{{$}}}}
return true;
- return coin(); // tracking-note{{Returning value}}
+ return coin(); // tracking-note-re{{{{^}}Returning value, which participates in a condition later{{$}}}}
}
void i(int *ptr) {
- if (ptr) // expected-note{{Assuming 'ptr' is null}}
- // expected-note@-1{{Taking false branch}}
+ if (ptr) // expected-note-re{{{{^}}Assuming 'ptr' is null{{$}}}}
+ // expected-note-re@-1{{{{^}}Taking false branch{{$}}}}
;
if (!flipCoin())
- // tracking-note@-1{{Calling 'flipCoin'}}
- // tracking-note@-2{{Returning from 'flipCoin'}}
- // debug-note@-3{{Tracking condition '!flipCoin()'}}
- // expected-note@-4{{Assuming the condition is true}}
- // expected-note@-5{{Taking true branch}}
+ // tracking-note-re@-1{{{{^}}Calling 'flipCoin'{{$}}}}
+ // tracking-note-re@-2{{{{^}}Returning from 'flipCoin'{{$}}}}
+ // debug-note-re@-3{{{{^}}Tracking condition '!flipCoin()'{{$}}}}
+ // expected-note-re@-4{{{{^}}Assuming the condition is true{{$}}}}
+ // expected-note-re@-5{{{{^}}Taking true branch{{$}}}}
*ptr = 5; // expected-warning{{Dereference of null pointer}}
// expected-note@-1{{Dereference of null pointer}}
}
} // end of namespace important_returning_value_note
+namespace important_returning_value_note_in_linear_function {
+bool coin();
+
+struct super_complicated_template_hackery {
+ static constexpr bool value = false;
+};
+
+bool flipCoin() {
+ if (super_complicated_template_hackery::value)
+ // tracking-note-re@-1{{{{^}}'value' is false{{$}}}}
+ // tracking-note-re@-2{{{{^}}Taking false branch{{$}}}}
+ return true;
+ return coin(); // tracking-note-re{{{{^}}Returning value, which participates in a condition later{{$}}}}
+}
+
+void i(int *ptr) {
+ if (ptr) // expected-note-re{{{{^}}Assuming 'ptr' is null{{$}}}}
+ // expected-note-re@-1{{{{^}}Taking false branch{{$}}}}
+ ;
+ if (!flipCoin())
+ // tracking-note-re@-1{{{{^}}Calling 'flipCoin'{{$}}}}
+ // tracking-note-re@-2{{{{^}}Returning from 'flipCoin'{{$}}}}
+ // debug-note-re@-3{{{{^}}Tracking condition '!flipCoin()'{{$}}}}
+ // expected-note-re@-4{{{{^}}Assuming the condition is true{{$}}}}
+ // expected-note-re@-5{{{{^}}Taking true branch{{$}}}}
+ *ptr = 5; // expected-warning{{Dereference of null pointer}}
+ // expected-note@-1{{Dereference of null pointer}}
+}
+} // end of namespace important_returning_value_note_in_linear_function
+
namespace tracked_condition_is_only_initialized {
int getInt();
void f() {
- int flag = getInt(); // tracking-note{{'flag' initialized here}}
- int *x = 0; // expected-note{{'x' initialized to a null pointer value}}
- if (flag) // expected-note{{Assuming 'flag' is not equal to 0}}
- // expected-note@-1{{Taking true branch}}
- // debug-note@-2{{Tracking condition 'flag'}}
+ int flag = getInt();
+ int *x = 0; // expected-note-re{{{{^}}'x' initialized to a null pointer value{{$}}}}
+ if (flag) // expected-note-re{{{{^}}Assuming 'flag' is not equal to 0{{$}}}}
+ // expected-note-re@-1{{{{^}}Taking true branch{{$}}}}
+ // debug-note-re@-2{{{{^}}Tracking condition 'flag'{{$}}}}
*x = 5; // expected-warning{{Dereference of null pointer}}
// expected-note@-1{{Dereference of null pointer}}
}
@@ -226,13 +349,13 @@
int getInt();
void f(int y) {
- y = 1; // tracking-note{{The value 1 is assigned to 'y'}}
- flag = y; // tracking-note{{The value 1 is assigned to 'flag'}}
+ y = 1;
+ flag = y;
- int *x = 0; // expected-note{{'x' initialized to a null pointer value}}
- if (flag) // expected-note{{'flag' is 1}}
- // expected-note@-1{{Taking true branch}}
- // debug-note@-2{{Tracking condition 'flag'}}
+ int *x = 0; // expected-note-re{{{{^}}'x' initialized to a null pointer value{{$}}}}
+ if (flag) // expected-note-re{{{{^}}'flag' is 1{{$}}}}
+ // expected-note-re@-1{{{{^}}Taking true branch{{$}}}}
+ // debug-note-re@-2{{{{^}}Tracking condition 'flag'{{$}}}}
*x = 5; // expected-warning{{Dereference of null pointer}}
// expected-note@-1{{Dereference of null pointer}}
}
@@ -244,44 +367,209 @@
void foo() {
int y;
- y = 1; // tracking-note{{The value 1 is assigned to 'y'}}
- flag = y; // tracking-note{{The value 1 is assigned to 'flag'}}
-
+ y = 1;
+ flag = y; // tracking-note-re{{{{^}}The value 1 is assigned to 'flag', which participates in a condition later{{$}}}}
}
void f(int y) {
- int *x = 0; // expected-note{{'x' initialized to a null pointer value}}
+ int *x = 0; // expected-note-re{{{{^}}'x' initialized to a null pointer value{{$}}}}
- foo(); // tracking-note{{Calling 'foo'}}
- // tracking-note@-1{{Returning from 'foo'}}
+ foo(); // tracking-note-re{{{{^}}Calling 'foo'{{$}}}}
+ // tracking-note-re@-1{{{{^}}Returning from 'foo'{{$}}}}
- if (flag) // expected-note{{'flag' is 1}}
- // expected-note@-1{{Taking true branch}}
- // debug-note@-2{{Tracking condition 'flag'}}
+ if (flag) // expected-note-re{{{{^}}'flag' is 1{{$}}}}
+ // expected-note-re@-1{{{{^}}Taking true branch{{$}}}}
+ // debug-note-re@-2{{{{^}}Tracking condition 'flag'{{$}}}}
*x = 5; // expected-warning{{Dereference of null pointer}}
// expected-note@-1{{Dereference of null pointer}}
}
} // end of namespace tracked_condition_written_in_nested_stackframe
+namespace condition_written_in_nested_stackframe_before_assignment {
+int flag = 0;
+int getInt();
+
+void foo() {
+ flag = getInt(); // tracking-note-re{{{{^}}Value assigned to 'flag', which participates in a condition later{{$}}}}
+}
+
+void f() {
+ int *x = 0; // expected-note-re{{{{^}}'x' initialized to a null pointer value{{$}}}}
+ int y = 0;
+
+ foo(); // tracking-note-re{{{{^}}Calling 'foo'{{$}}}}
+ // tracking-note-re@-1{{{{^}}Returning from 'foo'{{$}}}}
+ y = flag;
+
+ if (y) // expected-note-re{{{{^}}Assuming 'y' is not equal to 0{{$}}}}
+ // expected-note-re@-1{{{{^}}Taking true branch{{$}}}}
+ // debug-note-re@-2{{{{^}}Tracking condition 'y'{{$}}}}
+ *x = 5; // expected-warning{{Dereference of null pointer}}
+ // expected-note@-1{{Dereference of null pointer}}
+}
+} // end of namespace condition_written_in_nested_stackframe_before_assignment
+
+namespace dont_explain_foreach_loops {
+
+struct Iterator {
+ int *pos;
+ bool operator!=(Iterator other) const {
+ return pos && other.pos && pos != other.pos;
+ }
+ int operator*();
+ Iterator operator++();
+};
+
+struct Container {
+ Iterator begin();
+ Iterator end();
+};
+
+void f(Container Cont) {
+ int flag = 0;
+ int *x = 0; // expected-note-re{{{{^}}'x' initialized to a null pointer value{{$}}}}
+ for (int i : Cont)
+ if (i) // expected-note-re {{{{^}}Assuming 'i' is not equal to 0{{$}}}}
+ // expected-note-re@-1{{{{^}}Taking true branch{{$}}}}
+ // debug-note-re@-2{{{{^}}Tracking condition 'i'{{$}}}}
+ flag = i;
+
+ if (flag) // expected-note-re{{{{^}}'flag' is not equal to 0{{$}}}}
+ // expected-note-re@-1{{{{^}}Taking true branch{{$}}}}
+ // debug-note-re@-2{{{{^}}Tracking condition 'flag'{{$}}}}
+ *x = 5; // expected-warning{{Dereference of null pointer}}
+ // expected-note@-1{{Dereference of null pointer}}
+}
+} // end of namespace dont_explain_foreach_loops
+
+namespace condition_lambda_capture_by_reference_last_write {
+int getInt();
+
+[[noreturn]] void halt();
+
+void f(int flag) {
+ int *x = 0; // expected-note-re{{{{^}}'x' initialized to a null pointer value{{$}}}}
+
+ auto lambda = [&flag]() {
+ flag = getInt(); // tracking-note-re{{{{^}}Value assigned to 'flag', which participates in a condition later{{$}}}}
+ };
+
+ lambda(); // tracking-note-re{{{{^}}Calling 'operator()'{{$}}}}
+ // tracking-note-re@-1{{{{^}}Returning from 'operator()'{{$}}}}
+
+ if (flag) // expected-note-re{{{{^}}Assuming 'flag' is not equal to 0{{$}}}}
+ // expected-note-re@-1{{{{^}}Taking true branch{{$}}}}
+ // debug-note-re@-2{{{{^}}Tracking condition 'flag'{{$}}}}
+ *x = 5; // expected-warning{{Dereference of null pointer}}
+ // expected-note@-1{{Dereference of null pointer}}
+}
+} // end of namespace condition_lambda_capture_by_reference_last_write
+
+namespace condition_lambda_capture_by_value_assumption {
+int getInt();
+
+[[noreturn]] void halt();
+
+void bar(int &flag) {
+ flag = getInt(); // tracking-note-re{{{{^}}Value assigned to 'flag', which participates in a condition later{{$}}}}
+}
+
+void f(int flag) {
+ int *x = 0; // expected-note-re{{{{^}}'x' initialized to a null pointer value{{$}}}}
+
+ auto lambda = [flag]() {
+ if (!flag) // tracking-note-re{{{{^}}Assuming 'flag' is not equal to 0, which participates in a condition later{{$}}}}
+ // tracking-note-re@-1{{{{^}}Taking false branch{{$}}}}
+ halt();
+ };
+
+ bar(flag); // tracking-note-re{{{{^}}Calling 'bar'{{$}}}}
+ // tracking-note-re@-1{{{{^}}Returning from 'bar'{{$}}}}
+ lambda(); // tracking-note-re{{{{^}}Calling 'operator()'{{$}}}}
+ // tracking-note-re@-1{{{{^}}Returning from 'operator()'{{$}}}}
+
+ if (flag) // expected-note-re{{{{^}}Assuming 'flag' is not equal to 0{{$}}}}
+ // expected-note-re@-1{{{{^}}Taking true branch{{$}}}}
+ // debug-note-re@-2{{{{^}}Tracking condition 'flag'{{$}}}}
+ *x = 5; // expected-warning{{Dereference of null pointer}}
+ // expected-note@-1{{Dereference of null pointer}}
+}
+} // end of namespace condition_lambda_capture_by_value_assumption
+
+namespace condition_lambda_capture_by_reference_assumption {
+int getInt();
+
+[[noreturn]] void halt();
+
+void bar(int &flag) {
+ flag = getInt(); // tracking-note-re{{{{^}}Value assigned to 'flag', which participates in a condition later{{$}}}}
+}
+
+void f(int flag) {
+ int *x = 0; // expected-note-re{{{{^}}'x' initialized to a null pointer value{{$}}}}
+
+ auto lambda = [&flag]() {
+ if (!flag) // tracking-note-re{{{{^}}Assuming 'flag' is not equal to 0, which participates in a condition later{{$}}}}
+ // tracking-note-re@-1{{{{^}}Taking false branch{{$}}}}
+ halt();
+ };
+
+ bar(flag); // tracking-note-re{{{{^}}Calling 'bar'{{$}}}}
+ // tracking-note-re@-1{{{{^}}Returning from 'bar'{{$}}}}
+ lambda(); // tracking-note-re{{{{^}}Calling 'operator()'{{$}}}}
+ // tracking-note-re@-1{{{{^}}Returning from 'operator()'{{$}}}}
+
+ if (flag) // expected-note-re{{{{^}}'flag' is not equal to 0{{$}}}}
+ // expected-note-re@-1{{{{^}}Taking true branch{{$}}}}
+ // debug-note-re@-2{{{{^}}Tracking condition 'flag'{{$}}}}
+ *x = 5; // expected-warning{{Dereference of null pointer}}
+ // expected-note@-1{{Dereference of null pointer}}
+}
+} // end of namespace condition_lambda_capture_by_reference_assumption
+
+namespace collapse_point_not_in_condition_bool {
+
+[[noreturn]] void halt();
+
+void check(bool b) {
+ if (!b) // tracking-note-re{{{{^}}Assuming 'b' is true, which participates in a condition later{{$}}}}
+ // tracking-note-re@-1{{{{^}}Taking false branch{{$}}}}
+ halt();
+}
+
+void f(bool flag) {
+ int *x = 0; // expected-note-re{{{{^}}'x' initialized to a null pointer value{{$}}}}
+
+ check(flag); // tracking-note-re{{{{^}}Calling 'check'{{$}}}}
+ // tracking-note-re@-1{{{{^}}Returning from 'check'{{$}}}}
+
+ if (flag) // expected-note-re{{{{^}}'flag' is true{{$}}}}
+ // expected-note-re@-1{{{{^}}Taking true branch{{$}}}}
+ // debug-note-re@-2{{{{^}}Tracking condition 'flag'{{$}}}}
+ *x = 5; // expected-warning{{Dereference of null pointer}}
+ // expected-note@-1{{Dereference of null pointer}}
+}
+} // end of namespace collapse_point_not_in_condition_bool
+
namespace collapse_point_not_in_condition {
[[noreturn]] void halt();
void assert(int b) {
- if (!b) // tracking-note{{Assuming 'b' is not equal to 0}}
- // tracking-note@-1{{Taking false branch}}
+ if (!b) // tracking-note-re{{{{^}}Assuming 'b' is not equal to 0, which participates in a condition later{{$}}}}
+ // tracking-note-re@-1{{{{^}}Taking false branch{{$}}}}
halt();
}
void f(int flag) {
- int *x = 0; // expected-note{{'x' initialized to a null pointer value}}
+ int *x = 0; // expected-note-re{{{{^}}'x' initialized to a null pointer value{{$}}}}
- assert(flag); // tracking-note{{Calling 'assert'}}
- // tracking-note@-1{{Returning from 'assert'}}
+ assert(flag); // tracking-note-re{{{{^}}Calling 'assert'{{$}}}}
+ // tracking-note-re@-1{{{{^}}Returning from 'assert'{{$}}}}
- if (flag) // expected-note{{'flag' is not equal to 0}}
- // expected-note@-1{{Taking true branch}}
- // debug-note@-2{{Tracking condition 'flag'}}
+ if (flag) // expected-note-re{{{{^}}'flag' is not equal to 0{{$}}}}
+ // expected-note-re@-1{{{{^}}Taking true branch{{$}}}}
+ // debug-note-re@-2{{{{^}}Tracking condition 'flag'{{$}}}}
*x = 5; // expected-warning{{Dereference of null pointer}}
// expected-note@-1{{Dereference of null pointer}}
}
@@ -293,24 +581,422 @@
[[noreturn]] void halt();
void assert(int b) {
- if (!b) // tracking-note{{Assuming 'b' is not equal to 0}}
- // tracking-note@-1{{Taking false branch}}
+ if (!b) // tracking-note-re{{{{^}}Assuming 'b' is not equal to 0, which participates in a condition later{{$}}}}
+ // tracking-note-re@-1{{{{^}}Taking false branch{{$}}}}
halt();
}
int getInt();
void f(int flag) {
- int *x = 0; // expected-note{{'x' initialized to a null pointer value}}
+ int *x = 0; // expected-note-re{{{{^}}'x' initialized to a null pointer value{{$}}}}
- flag = getInt(); // tracking-note{{Value assigned to 'flag'}}
- assert(flag); // tracking-note{{Calling 'assert'}}
- // tracking-note@-1{{Returning from 'assert'}}
+ flag = getInt();
+ assert(flag); // tracking-note-re{{{{^}}Calling 'assert'{{$}}}}
+ // tracking-note-re@-1{{{{^}}Returning from 'assert'{{$}}}}
- if (flag) // expected-note{{'flag' is not equal to 0}}
- // expected-note@-1{{Taking true branch}}
- // debug-note@-2{{Tracking condition 'flag'}}
+ if (flag) // expected-note-re{{{{^}}'flag' is not equal to 0{{$}}}}
+ // expected-note-re@-1{{{{^}}Taking true branch{{$}}}}
+ // debug-note-re@-2{{{{^}}Tracking condition 'flag'{{$}}}}
*x = 5; // expected-warning{{Dereference of null pointer}}
// expected-note@-1{{Dereference of null pointer}}
}
} // end of namespace unimportant_write_before_collapse_point
+
+namespace dont_crash_on_nonlogical_binary_operator {
+
+void f6(int x) {
+ int a[20];
+ if (x == 25) {} // expected-note{{Assuming 'x' is equal to 25}}
+ // expected-note@-1{{Taking true branch}}
+ if (a[x] == 123) {} // expected-warning{{The left operand of '==' is a garbage value due to array index out of bounds}}
+ // expected-note@-1{{The left operand of '==' is a garbage value due to array index out of bounds}}
+}
+
+} // end of namespace dont_crash_on_nonlogical_binary_operator
+
+namespace collapse_point_not_in_condition_binary_op {
+
+[[noreturn]] void halt();
+
+void check(int b) {
+ if (b == 1) // tracking-note-re{{{{^}}Assuming 'b' is not equal to 1, which participates in a condition later{{$}}}}
+ // tracking-note-re@-1{{{{^}}Taking false branch{{$}}}}
+ halt();
+}
+
+void f(int flag) {
+ int *x = 0; // expected-note-re{{{{^}}'x' initialized to a null pointer value{{$}}}}
+
+ check(flag); // tracking-note-re{{{{^}}Calling 'check'{{$}}}}
+ // tracking-note-re@-1{{{{^}}Returning from 'check'{{$}}}}
+
+ if (flag) // expected-note-re{{{{^}}Assuming 'flag' is not equal to 0{{$}}}}
+ // expected-note-re@-1{{{{^}}Taking true branch{{$}}}}
+ // debug-note-re@-2{{{{^}}Tracking condition 'flag'{{$}}}}
+ *x = 5; // expected-warning{{Dereference of null pointer}}
+ // expected-note@-1{{Dereference of null pointer}}
+}
+
+} // end of namespace collapse_point_not_in_condition_binary_op
+
+namespace collapse_point_not_in_condition_as_field {
+
+[[noreturn]] void halt();
+struct IntWrapper {
+ int b;
+ IntWrapper();
+
+ void check() {
+ if (!b) // tracking-note-re{{{{^}}Assuming field 'b' is not equal to 0, which participates in a condition later{{$}}}}
+ // tracking-note-re@-1{{{{^}}Taking false branch{{$}}}}
+ halt();
+ return;
+ }
+};
+
+void f(IntWrapper i) {
+ int *x = 0; // expected-note-re{{{{^}}'x' initialized to a null pointer value{{$}}}}
+
+ i.check(); // tracking-note-re{{{{^}}Calling 'IntWrapper::check'{{$}}}}
+ // tracking-note-re@-1{{{{^}}Returning from 'IntWrapper::check'{{$}}}}
+ if (i.b) // expected-note-re{{{{^}}Field 'b' is not equal to 0{{$}}}}
+ // expected-note-re@-1{{{{^}}Taking true branch{{$}}}}
+ // debug-note-re@-2{{{{^}}Tracking condition 'i.b'{{$}}}}
+ *x = 5; // expected-warning{{Dereference of null pointer}}
+ // expected-note@-1{{Dereference of null pointer}}
+}
+
+} // end of namespace collapse_point_not_in_condition_as_field
+
+namespace assignemnt_in_condition_in_nested_stackframe {
+int flag;
+
+bool coin();
+
+[[noreturn]] void halt();
+
+void foo() {
+ if ((flag = coin()))
+ // tracking-note-re@-1{{{{^}}Value assigned to 'flag', which participates in a condition later{{$}}}}
+ // tracking-note-re@-2{{{{^}}Assuming 'flag' is not equal to 0, which participates in a condition later{{$}}}}
+ // tracking-note-re@-3{{{{^}}Taking true branch{{$}}}}
+ return;
+ halt();
+ return;
+}
+
+void f() {
+ int *x = 0; // expected-note-re{{{{^}}'x' initialized to a null pointer value{{$}}}}
+
+ foo(); // tracking-note-re{{{{^}}Calling 'foo'{{$}}}}
+ // tracking-note-re@-1{{{{^}}Returning from 'foo'{{$}}}}
+ if (flag) // expected-note-re{{{{^}}'flag' is not equal to 0{{$}}}}
+ // expected-note-re@-1{{{{^}}Taking true branch{{$}}}}
+ // debug-note-re@-2{{{{^}}Tracking condition 'flag'{{$}}}}
+ *x = 5; // expected-warning{{Dereference of null pointer}}
+ // expected-note@-1{{Dereference of null pointer}}
+}
+} // end of namespace assignemnt_in_condition_in_nested_stackframe
+
+namespace condition_variable_less {
+int flag;
+
+bool coin();
+
+[[noreturn]] void halt();
+
+void foo() {
+ if (flag > 0)
+ // tracking-note-re@-1{{{{^}}Assuming 'flag' is > 0, which participates in a condition later{{$}}}}
+ // tracking-note-re@-2{{{{^}}Taking true branch{{$}}}}
+ return;
+ halt();
+ return;
+}
+
+void f() {
+ int *x = 0; // expected-note-re{{{{^}}'x' initialized to a null pointer value{{$}}}}
+
+ foo(); // tracking-note-re{{{{^}}Calling 'foo'{{$}}}}
+ // tracking-note-re@-1{{{{^}}Returning from 'foo'{{$}}}}
+ if (flag) // expected-note-re{{{{^}}'flag' is not equal to 0{{$}}}}
+ // expected-note-re@-1{{{{^}}Taking true branch{{$}}}}
+ // debug-note-re@-2{{{{^}}Tracking condition 'flag'{{$}}}}
+ *x = 5; // expected-warning{{Dereference of null pointer}}
+ // expected-note@-1{{Dereference of null pointer}}
+}
+} // end of namespace condition_variable_less
+
+namespace dont_track_assertlike_conditions {
+
+extern void __assert_fail(__const char *__assertion, __const char *__file,
+ unsigned int __line, __const char *__function)
+ __attribute__((__noreturn__));
+#define assert(expr) \
+ ((expr) ? (void)(0) : __assert_fail(#expr, __FILE__, __LINE__, __func__))
+
+int getInt();
+
+int cond1;
+
+void bar() {
+ cond1 = getInt();
+}
+
+void f(int flag) {
+ int *x = 0; // expected-note-re{{{{^}}'x' initialized to a null pointer value{{$}}}}
+
+ flag = getInt();
+
+ bar();
+ assert(cond1); // expected-note-re{{{{^}}Assuming 'cond1' is not equal to 0{{$}}}}
+ // expected-note-re@-1{{{{^}}'?' condition is true{{$}}}}
+
+ if (flag) // expected-note-re{{{{^}}Assuming 'flag' is not equal to 0{{$}}}}
+ // expected-note-re@-1{{{{^}}Taking true branch{{$}}}}
+ // debug-note-re@-2{{{{^}}Tracking condition 'flag'{{$}}}}
+ *x = 5; // expected-warning{{Dereference of null pointer}}
+ // expected-note@-1{{Dereference of null pointer}}
+}
+
+#undef assert
+} // end of namespace dont_track_assertlike_conditions
+
+namespace dont_track_assertlike_and_conditions {
+
+extern void __assert_fail(__const char *__assertion, __const char *__file,
+ unsigned int __line, __const char *__function)
+ __attribute__((__noreturn__));
+#define assert(expr) \
+ ((expr) ? (void)(0) : __assert_fail(#expr, __FILE__, __LINE__, __func__))
+
+int getInt();
+
+int cond1;
+int cond2;
+
+void bar() {
+ cond1 = getInt();
+ cond2 = getInt();
+}
+
+void f(int flag) {
+ int *x = 0; // expected-note-re{{{{^}}'x' initialized to a null pointer value{{$}}}}
+
+ flag = getInt();
+
+ bar();
+ assert(cond1 && cond2);
+ // expected-note-re@-1{{{{^}}Assuming 'cond1' is not equal to 0{{$}}}}
+ // expected-note-re@-2{{{{^}}Assuming 'cond2' is not equal to 0{{$}}}}
+ // expected-note-re@-3{{{{^}}'?' condition is true{{$}}}}
+ // expected-note-re@-4{{{{^}}Left side of '&&' is true{{$}}}}
+
+ if (flag) // expected-note-re{{{{^}}Assuming 'flag' is not equal to 0{{$}}}}
+ // expected-note-re@-1{{{{^}}Taking true branch{{$}}}}
+ // debug-note-re@-2{{{{^}}Tracking condition 'flag'{{$}}}}
+ *x = 5; // expected-warning{{Dereference of null pointer}}
+ // expected-note@-1{{Dereference of null pointer}}
+}
+
+#undef assert
+} // end of namespace dont_track_assertlike_and_conditions
+
+namespace dont_track_assertlike_or_conditions {
+
+extern void __assert_fail(__const char *__assertion, __const char *__file,
+ unsigned int __line, __const char *__function)
+ __attribute__((__noreturn__));
+#define assert(expr) \
+ ((expr) ? (void)(0) : __assert_fail(#expr, __FILE__, __LINE__, __func__))
+
+int getInt();
+
+int cond1;
+int cond2;
+
+void bar() {
+ cond1 = getInt();
+ cond2 = getInt();
+}
+
+void f(int flag) {
+ int *x = 0; // expected-note-re{{{{^}}'x' initialized to a null pointer value{{$}}}}
+
+ flag = getInt();
+
+ bar();
+ assert(cond1 || cond2);
+ // expected-note-re@-1{{{{^}}Assuming 'cond1' is not equal to 0{{$}}}}
+ // expected-note-re@-2{{{{^}}Left side of '||' is true{{$}}}}
+
+ if (flag) // expected-note-re{{{{^}}Assuming 'flag' is not equal to 0{{$}}}}
+ // expected-note-re@-1{{{{^}}Taking true branch{{$}}}}
+ // debug-note-re@-2{{{{^}}Tracking condition 'flag'{{$}}}}
+ *x = 5; // expected-warning{{Dereference of null pointer}}
+ // expected-note@-1{{Dereference of null pointer}}
+}
+
+#undef assert
+} // end of namespace dont_track_assertlike_or_conditions
+
+namespace dont_track_assert2like_conditions {
+
+extern void __assert_fail(__const char *__assertion, __const char *__file,
+ unsigned int __line, __const char *__function)
+ __attribute__((__noreturn__));
+#define assert(expr) \
+ do { \
+ if (!(expr)) \
+ __assert_fail(#expr, __FILE__, __LINE__, __func__); \
+ } while (0)
+
+int getInt();
+
+int cond1;
+
+void bar() {
+ cond1 = getInt();
+}
+
+void f(int flag) {
+ int *x = 0; // expected-note-re{{{{^}}'x' initialized to a null pointer value{{$}}}}
+
+ flag = getInt();
+
+ bar();
+ assert(cond1); // expected-note-re{{{{^}}Assuming 'cond1' is not equal to 0{{$}}}}
+ // expected-note-re@-1{{{{^}}Taking false branch{{$}}}}
+ // expected-note-re@-2{{{{^}}Loop condition is false. Exiting loop{{$}}}}
+
+ if (flag) // expected-note-re{{{{^}}Assuming 'flag' is not equal to 0{{$}}}}
+ // expected-note-re@-1{{{{^}}Taking true branch{{$}}}}
+ // debug-note-re@-2{{{{^}}Tracking condition 'flag'{{$}}}}
+ *x = 5; // expected-warning{{Dereference of null pointer}}
+ // expected-note@-1{{Dereference of null pointer}}
+}
+
+#undef assert
+} // end of namespace dont_track_assert2like_conditions
+
+namespace dont_track_assert2like_and_conditions {
+
+extern void __assert_fail(__const char *__assertion, __const char *__file,
+ unsigned int __line, __const char *__function)
+ __attribute__((__noreturn__));
+#define assert(expr) \
+ do { \
+ if (!(expr)) \
+ __assert_fail(#expr, __FILE__, __LINE__, __func__); \
+ } while (0)
+
+int getInt();
+
+int cond1;
+int cond2;
+
+void bar() {
+ cond1 = getInt();
+ cond2 = getInt();
+}
+
+void f(int flag) {
+ int *x = 0; // expected-note-re{{{{^}}'x' initialized to a null pointer value{{$}}}}
+
+ flag = getInt();
+
+ bar();
+ assert(cond1 && cond2);
+ // expected-note-re@-1{{{{^}}Assuming 'cond1' is not equal to 0{{$}}}}
+ // expected-note-re@-2{{{{^}}Left side of '&&' is true{{$}}}}
+ // expected-note-re@-3{{{{^}}Assuming the condition is false{{$}}}}
+ // expected-note-re@-4{{{{^}}Taking false branch{{$}}}}
+ // expected-note-re@-5{{{{^}}Loop condition is false. Exiting loop{{$}}}}
+
+ if (flag) // expected-note-re{{{{^}}Assuming 'flag' is not equal to 0{{$}}}}
+ // expected-note-re@-1{{{{^}}Taking true branch{{$}}}}
+ // debug-note-re@-2{{{{^}}Tracking condition 'flag'{{$}}}}
+ *x = 5; // expected-warning{{Dereference of null pointer}}
+ // expected-note@-1{{Dereference of null pointer}}
+}
+
+#undef assert
+} // end of namespace dont_track_assert2like_and_conditions
+
+namespace dont_track_assert2like_or_conditions {
+
+extern void __assert_fail(__const char *__assertion, __const char *__file,
+ unsigned int __line, __const char *__function)
+ __attribute__((__noreturn__));
+#define assert(expr) \
+ do { \
+ if (!(expr)) \
+ __assert_fail(#expr, __FILE__, __LINE__, __func__); \
+ } while (0)
+
+int getInt();
+
+int cond1;
+int cond2;
+
+void bar() {
+ cond1 = getInt();
+ cond2 = getInt();
+}
+
+void f(int flag) {
+ int *x = 0; // expected-note-re{{{{^}}'x' initialized to a null pointer value{{$}}}}
+
+ flag = getInt();
+
+ bar();
+ assert(cond1 || cond2);
+ // expected-note-re@-1{{{{^}}Assuming 'cond1' is not equal to 0{{$}}}}
+ // expected-note-re@-2{{{{^}}Left side of '||' is true{{$}}}}
+ // expected-note-re@-3{{{{^}}Taking false branch{{$}}}}
+ // expected-note-re@-4{{{{^}}Loop condition is false. Exiting loop{{$}}}}
+
+ if (flag) // expected-note-re{{{{^}}Assuming 'flag' is not equal to 0{{$}}}}
+ // expected-note-re@-1{{{{^}}Taking true branch{{$}}}}
+ // debug-note-re@-2{{{{^}}Tracking condition 'flag'{{$}}}}
+ *x = 5; // expected-warning{{Dereference of null pointer}}
+ // expected-note@-1{{Dereference of null pointer}}
+}
+
+#undef assert
+} // end of namespace dont_track_assert2like_or_conditions
+
+namespace only_track_the_evaluated_condition {
+
+bool coin();
+
+void bar(int &flag) {
+ flag = coin(); // tracking-note-re{{{{^}}Value assigned to 'flag', which participates in a condition later{{$}}}}
+}
+
+void bar2(int &flag2) {
+ flag2 = coin();
+}
+
+void f(int *x) {
+ if (x) // expected-note-re{{{{^}}Assuming 'x' is null{{$}}}}
+ // debug-note-re@-1{{{{^}}Tracking condition 'x'{{$}}}}
+ // expected-note-re@-2{{{{^}}Taking false branch{{$}}}}
+ return;
+
+ int flag, flag2;
+ bar(flag); // tracking-note-re{{{{^}}Calling 'bar'{{$}}}}
+ // tracking-note-re@-1{{{{^}}Returning from 'bar'{{$}}}}
+ bar2(flag2);
+
+ if (flag && flag2) // expected-note-re {{{{^}}Assuming 'flag' is 0{{$}}}}
+ // expected-note-re@-1{{{{^}}Left side of '&&' is false{{$}}}}
+ // debug-note-re@-2{{{{^}}Tracking condition 'flag'{{$}}}}
+ return;
+
+ *x = 5; // expected-warning{{Dereference of null pointer}}
+ // expected-note@-1{{Dereference of null pointer}}
+}
+
+} // end of namespace only_track_the_evaluated_condition
diff --git a/src/llvm-project/clang/test/Analysis/track-control-dependency-conditions.m b/src/llvm-project/clang/test/Analysis/track-control-dependency-conditions.m
new file mode 100644
index 0000000..05b0638
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/track-control-dependency-conditions.m
@@ -0,0 +1,32 @@
+// RUN: %clang_analyze_cc1 -w -analyzer-checker=core,nullability -verify %s
+
+// expected-no-diagnostics
+
+@class C;
+
+#pragma clang assume_nonnull begin
+@interface I
+- foo:(C *)c;
+@end
+#pragma clang assume_nonnull end
+
+@interface J
+@property C *c;
+@end
+
+J *conjure_J();
+
+@implementation I
+- (void)bar {
+ if (self) { // no-crash
+ J *j = conjure_J();
+ if (j.c)
+ [self bar];
+ // FIXME: Should warn.
+ [self foo:j.c]; // no-warning
+ }
+}
+@end
+
+@implementation J
+@end
diff --git a/src/llvm-project/clang/test/Analysis/uninit-const.c b/src/llvm-project/clang/test/Analysis/uninit-const.c
index 407c28a..ec29c23 100644
--- a/src/llvm-project/clang/test/Analysis/uninit-const.c
+++ b/src/llvm-project/clang/test/Analysis/uninit-const.c
@@ -24,15 +24,15 @@
void doStuff_variadic(const int *u, ...){};
void f_1(void) {
- int t;
+ int t; // expected-note {{'t' declared without an initial value}}
int* tp = &t; // expected-note {{'tp' initialized here}}
doStuff_pointerToConstInt(tp); // expected-warning {{1st function call argument is a pointer to uninitialized value}}
// expected-note@-1 {{1st function call argument is a pointer to uninitialized value}}
}
void f_1_1(void) {
- int t;
- int* tp1 = &t;
+ int t; // expected-note {{'t' declared without an initial value}}
+ int *tp1 = &t; // expected-note {{'tp1' initialized here}}
int* tp2 = tp1; // expected-note {{'tp2' initialized here}}
doStuff_pointerToConstInt(tp2); // expected-warning {{1st function call argument is a pointer to uninitialized value}}
// expected-note@-1 {{1st function call argument is a pointer to uninitialized value}}
@@ -40,12 +40,15 @@
int *f_2_sub(int *p) {
- return p;
+ return p; // expected-note {{Returning pointer (loaded from 'p')}}
}
void f_2(void) {
- int t;
- int* p = f_2_sub(&t);
+ int t; // expected-note {{'t' declared without an initial value}}
+ int *p = f_2_sub(&t); // expected-note {{Passing value via 1st parameter 'p'}}
+ // expected-note@-1{{Calling 'f_2_sub'}}
+ // expected-note@-2{{Returning from 'f_2_sub'}}
+ // expected-note@-3{{'p' initialized here}}
int* tp = p; // expected-note {{'tp' initialized here}}
doStuff_pointerToConstInt(tp); // expected-warning {{1st function call argument is a pointer to uninitialized value}}
// expected-note@-1 {{1st function call argument is a pointer to uninitialized value}}
@@ -62,7 +65,7 @@
}
void f_5(void) {
- int ta[5];
+ int ta[5]; // expected-note {{'ta' initialized here}}
int* tp = ta; // expected-note {{'tp' initialized here}}
doStuff_pointerToConstInt(tp); // expected-warning {{1st function call argument is a pointer to uninitialized value}}
// expected-note@-1 {{1st function call argument is a pointer to uninitialized value}}
@@ -99,7 +102,7 @@
}
void f_9(void) {
- int a[6];
+ int a[6]; // expected-note {{'a' initialized here}}
int const *ptau = a; // expected-note {{'ptau' initialized here}}
doStuff_arrayOfConstInt(ptau); // expected-warning {{1st function call argument is a pointer to uninitialized value}}
// expected-note@-1 {{1st function call argument is a pointer to uninitialized value}}
@@ -173,7 +176,7 @@
// uninit pointer, uninit val
void f_variadic_unp_unv(void) {
- int t;
+ int t; // expected-note {{'t' declared without an initial value}}
int v;
int* tp = &t; // expected-note {{'tp' initialized here}}
doStuff_variadic(tp,v); // expected-warning {{1st function call argument is a pointer to uninitialized value}}
@@ -181,7 +184,7 @@
}
// uninit pointer, init val
void f_variadic_unp_inv(void) {
- int t;
+ int t; // expected-note {{'t' declared without an initial value}}
int v = 3;
int* tp = &t; // expected-note {{'tp' initialized here}}
doStuff_variadic(tp,v); // expected-warning {{1st function call argument is a pointer to uninitialized value}}
@@ -216,7 +219,7 @@
//uninit pointer, init pointer
void f_variadic_unp_inp(void) {
- int t;
+ int t; // expected-note {{'t' declared without an initial value}}
int u=3;
int *vp = &u ;
int *tp = &t; // expected-note {{'tp' initialized here}}
@@ -235,7 +238,7 @@
//uninit pointer, uninit pointer
void f_variadic_unp_unp(void) {
- int t;
+ int t; // expected-note {{'t' declared without an initial value}}
int u;
int *vp = &u ;
int *tp = &t; // expected-note {{'tp' initialized here}}
diff --git a/src/llvm-project/clang/test/Analysis/uninit-const.cpp b/src/llvm-project/clang/test/Analysis/uninit-const.cpp
index b643030..3b7089c 100644
--- a/src/llvm-project/clang/test/Analysis/uninit-const.cpp
+++ b/src/llvm-project/clang/test/Analysis/uninit-const.cpp
@@ -66,8 +66,8 @@
void f6_2(void) {
int t; //expected-note {{'t' declared without an initial value}}
- int &p = t;
- int &s = p;
+ int &p = t; //expected-note {{'p' initialized here}}
+ int &s = p; //expected-note {{'s' initialized here}}
int &q = s; //expected-note {{'q' initialized here}}
doStuff6(q); //expected-warning {{1st function call argument is an uninitialized value}}
//expected-note@-1 {{1st function call argument is an uninitialized value}}
@@ -96,7 +96,7 @@
void f5(void) {
- int t;
+ int t; // expected-note {{'t' declared without an initial value}}
int* tp = &t; // expected-note {{'tp' initialized here}}
doStuff_uninit(tp); // expected-warning {{1st function call argument is a pointer to uninitialized value}}
// expected-note@-1 {{1st function call argument is a pointer to uninitialized value}}
diff --git a/src/llvm-project/clang/test/Analysis/uninit-val-const-likeness.c b/src/llvm-project/clang/test/Analysis/uninit-val-const-likeness.c
new file mode 100644
index 0000000..013ab78
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/uninit-val-const-likeness.c
@@ -0,0 +1,74 @@
+// RUN: %clang_analyze_cc1 -analyzer-checker=core %s -verify
+// expected-no-diagnostics
+
+#define SIZE 2
+
+typedef struct {
+ int noOfSymbols;
+} Params;
+
+static void create(const Params * const params, int fooList[]) {
+ int tmpList[SIZE] = {0};
+ for (int i = 0; i < params->noOfSymbols; i++)
+ fooList[i] = tmpList[i];
+}
+
+int work(Params * const params) {
+ int fooList[SIZE];
+ create(params, fooList);
+ int sum = 0;
+ for (int i = 0; i < params->noOfSymbols; i++)
+ sum += fooList[i]; // no-warning
+ return sum;
+}
+
+static void create2(const Params * const * pparams, int fooList[]) {
+ const Params * params = *pparams;
+ int tmpList[SIZE] = {0};
+ for (int i = 0; i < params->noOfSymbols; i++)
+ fooList[i] = tmpList[i];
+}
+
+int work2(const Params * const params) {
+ int fooList[SIZE];
+ create2(¶ms, fooList);
+ int sum = 0;
+ for (int i = 0; i < params->noOfSymbols; i++)
+ sum += fooList[i]; // no-warning
+ return sum;
+}
+
+static void create3(Params * const * pparams, int fooList[]) {
+ const Params * params = *pparams;
+ int tmpList[SIZE] = {0};
+ for (int i = 0; i < params->noOfSymbols; i++)
+ fooList[i] = tmpList[i];
+}
+
+int work3(const Params * const params) {
+ int fooList[SIZE];
+ Params *const *ptr = (Params *const*)¶ms;
+ create3(ptr, fooList);
+ int sum = 0;
+ for (int i = 0; i < params->noOfSymbols; i++)
+ sum += fooList[i]; // no-warning
+ return sum;
+}
+
+typedef Params ParamsTypedef;
+typedef const ParamsTypedef *ConstParamsTypedef;
+
+static void create4(ConstParamsTypedef const params, int fooList[]) {
+ int tmpList[SIZE] = {0};
+ for (int i = 0; i < params->noOfSymbols; i++)
+ fooList[i] = tmpList[i];
+}
+
+int work4(Params * const params) {
+ int fooList[SIZE];
+ create4(params, fooList);
+ int sum = 0;
+ for (int i = 0; i < params->noOfSymbols; i++)
+ sum += fooList[i]; // no-warning
+ return sum;
+}
diff --git a/src/llvm-project/clang/test/Analysis/uninit-vals.c b/src/llvm-project/clang/test/Analysis/uninit-vals.c
index d24b458..c0c6034 100644
--- a/src/llvm-project/clang/test/Analysis/uninit-vals.c
+++ b/src/llvm-project/clang/test/Analysis/uninit-vals.c
@@ -149,8 +149,6 @@
RetVoidFuncType f = foo_radar12278788_fp;
return ((RetIntFuncType)f)(); //expected-warning {{Undefined or garbage value returned to caller}}
//expected-note@-1 {{Undefined or garbage value returned to caller}}
- //expected-note@-2 {{Calling 'foo_radar12278788_fp'}}
- //expected-note@-3 {{Returning from 'foo_radar12278788_fp'}}
}
void rdar13665798() {
@@ -164,8 +162,6 @@
RetVoidFuncType f = foo_radar12278788_fp;
return ((RetIntFuncType)f)(); //expected-warning {{Undefined or garbage value returned to caller}}
//expected-note@-1 {{Undefined or garbage value returned to caller}}
- //expected-note@-2 {{Calling 'foo_radar12278788_fp'}}
- //expected-note@-3 {{Returning from 'foo_radar12278788_fp'}}
}();
}
@@ -182,18 +178,14 @@
void use(struct Point p);
void testUseHalfPoint() {
- struct Point p = getHalfPoint(); // expected-note{{Calling 'getHalfPoint'}}
- // expected-note@-1{{Returning from 'getHalfPoint'}}
- // expected-note@-2{{'p' initialized here}}
+ struct Point p = getHalfPoint(); // expected-note{{'p' initialized here}}
use(p); // expected-warning{{uninitialized}}
// expected-note@-1{{uninitialized}}
}
void testUseHalfPoint2() {
struct Point p;
- p = getHalfPoint(); // expected-note{{Calling 'getHalfPoint'}}
- // expected-note@-1{{Returning from 'getHalfPoint'}}
- // expected-note@-2{{Value assigned to 'p'}}
+ p = getHalfPoint(); // expected-note{{Value assigned to 'p'}}
use(p); // expected-warning{{uninitialized}}
// expected-note@-1{{uninitialized}}
}
diff --git a/src/llvm-project/clang/test/Analysis/unions.cpp b/src/llvm-project/clang/test/Analysis/unions.cpp
index 6fd35d1..76eb205 100644
--- a/src/llvm-project/clang/test/Analysis/unions.cpp
+++ b/src/llvm-project/clang/test/Analysis/unions.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix.Malloc,debug.ExprInspection %s -analyzer-config eagerly-assume=false -verify
+// RUN: %clang_analyze_cc1 -std=c++14 -analyzer-checker=core,unix.Malloc,debug.ExprInspection %s -analyzer-config eagerly-assume=false -verify
extern void clang_analyzer_eval(bool);
extern void clang_analyzer_warnIfReached();
diff --git a/src/llvm-project/clang/test/Analysis/virtualcall-fixits.cpp b/src/llvm-project/clang/test/Analysis/virtualcall-fixits.cpp
new file mode 100644
index 0000000..ea149d5
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/virtualcall-fixits.cpp
@@ -0,0 +1,45 @@
+// RUN: %clang_analyze_cc1 -analyzer-checker=core,optin.cplusplus.VirtualCall \
+// RUN: -analyzer-config optin.cplusplus.VirtualCall:ShowFixIts=true \
+// RUN: %s 2>&1 | FileCheck -check-prefix=TEXT %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core,optin.cplusplus.VirtualCall \
+// RUN: -analyzer-config optin.cplusplus.VirtualCall:ShowFixIts=true \
+// RUN: -analyzer-config fixits-as-remarks=true \
+// RUN: -analyzer-output=plist -o %t.plist -verify %s
+// RUN: cat %t.plist | FileCheck -check-prefix=PLIST %s
+
+struct S {
+ virtual void foo();
+ S() {
+ foo();
+ // expected-warning@-1{{Call to virtual method 'S::foo' during construction bypasses virtual dispatch}}
+ // expected-remark@-2{{5-5: 'S::'}}
+ }
+ ~S();
+};
+
+// TEXT: warning: Call to virtual method 'S::foo' during construction
+// TEXT-SAME: bypasses virtual dispatch
+// TEXT-NEXT: foo();
+// TEXT-NEXT: ^~~~~
+// TEXT-NEXT: S::
+// TEXT-NEXT: 1 warning generated.
+
+// PLIST: <key>fixits</key>
+// PLIST-NEXT: <array>
+// PLIST-NEXT: <dict>
+// PLIST-NEXT: <key>remove_range</key>
+// PLIST-NEXT: <array>
+// PLIST-NEXT: <dict>
+// PLIST-NEXT: <key>line</key><integer>13</integer>
+// PLIST-NEXT: <key>col</key><integer>5</integer>
+// PLIST-NEXT: <key>file</key><integer>0</integer>
+// PLIST-NEXT: </dict>
+// PLIST-NEXT: <dict>
+// PLIST-NEXT: <key>line</key><integer>13</integer>
+// PLIST-NEXT: <key>col</key><integer>4</integer>
+// PLIST-NEXT: <key>file</key><integer>0</integer>
+// PLIST-NEXT: </dict>
+// PLIST-NEXT: </array>
+// PLIST-NEXT: <key>insert_string</key><string>S::</string>
+// PLIST-NEXT: </dict>
+// PLIST-NEXT: </array>
diff --git a/src/llvm-project/clang/test/Analysis/virtualcall-plist.cpp b/src/llvm-project/clang/test/Analysis/virtualcall-plist.cpp
new file mode 100644
index 0000000..a85dc4b
--- /dev/null
+++ b/src/llvm-project/clang/test/Analysis/virtualcall-plist.cpp
@@ -0,0 +1,23 @@
+// RUN: %clang_analyze_cc1 -analyzer-checker=core,cplusplus \
+// RUN: -analyzer-output=plist -o %t.plist -w -verify=pure %s
+// RUN: cat %t.plist | FileCheck --check-prefixes=PURE %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core,optin.cplusplus \
+// RUN: -analyzer-output=plist -o %t.plist -w -verify=impure %s
+// RUN: cat %t.plist | FileCheck --check-prefixes=IMPURE %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core,cplusplus,optin.cplusplus \
+// RUN: -analyzer-output=plist -o %t.plist -w -verify=pure,impure %s
+// RUN: cat %t.plist | FileCheck --check-prefixes=PURE,IMPURE %s
+
+struct S {
+ virtual void foo();
+ virtual void bar() = 0;
+
+ S() {
+ // IMPURE: Call to virtual method 'S::foo' during construction bypasses virtual dispatch
+ // IMPURE: optin.cplusplus.VirtualCall
+ foo(); // impure-warning{{Call to virtual method 'S::foo' during construction bypasses virtual dispatch}}
+ // PURE: Call to pure virtual method 'S::bar' during construction has undefined behavior
+ // PURE: cplusplus.PureVirtualCall
+ bar(); // pure-warning{{Call to pure virtual method 'S::bar' during construction has undefined behavior}}
+ }
+};
diff --git a/src/llvm-project/clang/test/Analysis/virtualcall.cpp b/src/llvm-project/clang/test/Analysis/virtualcall.cpp
index 5847110..80f89d1 100644
--- a/src/llvm-project/clang/test/Analysis/virtualcall.cpp
+++ b/src/llvm-project/clang/test/Analysis/virtualcall.cpp
@@ -1,9 +1,38 @@
-// RUN: %clang_analyze_cc1 -analyzer-checker=optin.cplusplus.VirtualCall -analyzer-store region -analyzer-output=text -verify -std=c++11 %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core,optin.cplusplus.VirtualCall \
+// RUN: -analyzer-checker=debug.ExprInspection \
+// RUN: -std=c++11 -verify=impure %s
-// RUN: %clang_analyze_cc1 -analyzer-checker=optin.cplusplus.VirtualCall -analyzer-store region -analyzer-config optin.cplusplus.VirtualCall:PureOnly=true -DPUREONLY=1 -analyzer-output=text -verify -std=c++11 %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core,cplusplus.PureVirtualCall \
+// RUN: -analyzer-checker=debug.ExprInspection \
+// RUN: -std=c++11 -verify=pure -std=c++11 %s
+
+// RUN: %clang_analyze_cc1 -analyzer-checker=core,optin.cplusplus.VirtualCall \
+// RUN: -analyzer-config \
+// RUN: optin.cplusplus.VirtualCall:PureOnly=true \
+// RUN: -analyzer-checker=debug.ExprInspection \
+// RUN: -std=c++11 -verify=none %s
+
+// RUN: %clang_analyze_cc1 -analyzer-checker=core,cplusplus.PureVirtualCall \
+// RUN: -analyzer-checker=optin.cplusplus.VirtualCall \
+// RUN: -analyzer-checker=debug.ExprInspection \
+// RUN: -std=c++11 -verify=pure,impure -std=c++11 %s
+
+// RUN: %clang_analyze_cc1 -analyzer-checker=core,cplusplus.PureVirtualCall \
+// RUN: -analyzer-checker=optin.cplusplus.VirtualCall \
+// RUN: -analyzer-config \
+// RUN: optin.cplusplus.VirtualCall:PureOnly=true \
+// RUN: -analyzer-checker=debug.ExprInspection \
+// RUN: -std=c++11 -verify=pure %s
+
+
+// We expect no diagnostics when all checks are disabled.
+// none-no-diagnostics
+
#include "virtualcall.h"
+void clang_analyzer_warnIfReached();
+
class A {
public:
A();
@@ -13,54 +42,32 @@
virtual int foo() = 0;
virtual void bar() = 0;
void f() {
- foo();
- // expected-warning-re@-1 {{{{^}}Call to pure virtual function during construction}}
- // expected-note-re@-2 {{{{^}}Call to pure virtual function during construction}}
+ foo(); // pure-warning{{Call to pure virtual method 'A::foo' during construction has undefined behavior}}
+ clang_analyzer_warnIfReached(); // no-warning
}
};
-class B : public A {
+A::A() {
+ f();
+}
+
+class B {
public:
- B() { // expected-note {{Calling default constructor for 'A'}}
- foo();
-#if !PUREONLY
- // expected-warning-re@-2 {{{{^}}Call to virtual function during construction}}
- // expected-note-re@-3 {{{{^}}This constructor of an object of type 'B' has not returned when the virtual method was called}}
- // expected-note-re@-4 {{{{^}}Call to virtual function during construction}}
-#endif
+ B() {
+ foo(); // impure-warning {{Call to virtual method 'B::foo' during construction bypasses virtual dispatch}}
}
~B();
virtual int foo();
virtual void bar() {
- foo();
-#if !PUREONLY
- // expected-warning-re@-2 {{{{^}}Call to virtual function during destruction}}
- // expected-note-re@-3 {{{{^}}Call to virtual function during destruction}}
-#endif
- }
+ foo(); // impure-warning {{Call to virtual method 'B::foo' during destruction bypasses virtual dispatch}}
+ }
};
-A::A() {
- f();
-// expected-note-re@-1 {{{{^}}This constructor of an object of type 'A' has not returned when the virtual method was called}}
-// expected-note-re@-2 {{{{^}}Calling 'A::f'}}
-}
-
B::~B() {
this->B::foo(); // no-warning
this->B::bar();
-#if !PUREONLY
- // expected-note-re@-2 {{{{^}}This destructor of an object of type '~B' has not returned when the virtual method was called}}
- // expected-note-re@-3 {{{{^}}Calling 'B::bar'}}
-#endif
- this->foo();
-#if !PUREONLY
- // expected-warning-re@-2 {{{{^}}Call to virtual function during destruction}}
- // expected-note-re@-3 {{{{^}}This destructor of an object of type '~B' has not returned when the virtual method was called}}
- // expected-note-re@-4 {{{{^}}Call to virtual function during destruction}}
-#endif
-
+ this->foo(); // impure-warning {{Call to virtual method 'B::foo' during destruction bypasses virtual dispatch}}
}
class C : public B {
@@ -73,12 +80,7 @@
};
C::C() {
- f(foo());
-#if !PUREONLY
- // expected-warning-re@-2 {{{{^}}Call to virtual function during construction}}
- // expected-note-re@-3 {{{{^}}This constructor of an object of type 'C' has not returned when the virtual method was called}}
- // expected-note-re@-4 {{{{^}}Call to virtual function during construction}}
-#endif
+ f(foo()); // impure-warning {{Call to virtual method 'C::foo' during construction bypasses virtual dispatch}}
}
class D : public B {
@@ -97,9 +99,6 @@
foo(); // no-warning
}
~E() { bar(); }
-#if !PUREONLY
- // expected-note-re@-2 2{{{{^}}Calling '~B'}}
-#endif
int foo() override;
};
@@ -135,52 +134,23 @@
G g;
g.foo();
g.bar(); // no warning
- f();
-#if !PUREONLY
- // expected-warning-re@-2 {{{{^}}Call to virtual function during construction}}
- // expected-note-re@-3 {{{{^}}This constructor of an object of type 'H' has not returned when the virtual method was called}}
- // expected-note-re@-4 {{{{^}}Call to virtual function during construction}}
-#endif
+ f(); // impure-warning {{Call to virtual method 'H::f' during construction bypasses virtual dispatch}}
H &h = *this;
- h.f();
-#if !PUREONLY
- // expected-warning-re@-2 {{{{^}}Call to virtual function during construction}}
- // expected-note-re@-3 {{{{^}}This constructor of an object of type 'H' has not returned when the virtual method was called}}
- // expected-note-re@-4 {{{{^}}Call to virtual function during construction}}
-#endif
+ h.f(); // impure-warning {{Call to virtual method 'H::f' during construction bypasses virtual dispatch}}
}
};
class X {
public:
X() {
- g();
-#if !PUREONLY
- // expected-warning-re@-2 {{{{^}}Call to virtual function during construction}}
- // expected-note-re@-3 {{{{^}}This constructor of an object of type 'X' has not returned when the virtual method was called}}
- // expected-note-re@-4 {{{{^}}Call to virtual function during construction}}
-#endif
+ g(); // impure-warning {{Call to virtual method 'X::g' during construction bypasses virtual dispatch}}
}
X(int i) {
if (i > 0) {
-#if !PUREONLY
- // expected-note-re@-2 {{{{^}}'i' is > 0}}
- // expected-note-re@-3 {{{{^}}Taking true branch}}
- // expected-note-re@-4 {{{{^}}'i' is <= 0}}
- // expected-note-re@-5 {{{{^}}Taking false branch}}
-#endif
X x(i - 1);
-#if !PUREONLY
- // expected-note-re@-2 {{{{^}}Calling constructor for 'X'}}
-#endif
x.g(); // no warning
}
- g();
-#if !PUREONLY
- // expected-warning-re@-2 {{{{^}}Call to virtual function during construction}}
- // expected-note-re@-3 {{{{^}}This constructor of an object of type 'X' has not returned when the virtual method was called}}
- // expected-note-re@-4 {{{{^}}Call to virtual function during construction}}
-#endif
+ g(); // impure-warning {{Call to virtual method 'X::g' during construction bypasses virtual dispatch}}
}
virtual void g();
};
@@ -197,19 +167,11 @@
N n;
n.virtualMethod(); // no warning
n.callFooOfM(this);
-#if !PUREONLY
- // expected-note-re@-2 {{{{^}}This constructor of an object of type 'M' has not returned when the virtual method was called}}
- // expected-note-re@-3 {{{{^}}Calling 'N::callFooOfM'}}
-#endif
}
virtual void foo();
};
void N::callFooOfM(M *m) {
- m->foo();
-#if !PUREONLY
- // expected-warning-re@-2 {{{{^}}Call to virtual function during construction}}
- // expected-note-re@-3 {{{{^}}Call to virtual function during construction}}
-#endif
+ m->foo(); // impure-warning {{Call to virtual method 'M::foo' during construction bypasses virtual dispatch}}
}
class Y {
@@ -217,65 +179,27 @@
virtual void foobar();
void fooY() {
F f1;
- foobar();
-#if !PUREONLY
- // expected-warning-re@-2 {{{{^}}Call to virtual function during construction}}
- // expected-note-re@-3 {{{{^}}Call to virtual function during construction}}
-#endif
+ foobar(); // impure-warning {{Call to virtual method 'Y::foobar' during construction bypasses virtual dispatch}}
}
Y() { fooY(); }
-#if !PUREONLY
- // expected-note-re@-2 {{{{^}}This constructor of an object of type 'Y' has not returned when the virtual method was called}}
- // expected-note-re@-3 {{{{^}}Calling 'Y::fooY'}}
-#endif
};
int main() {
B b;
-#if PUREONLY
- //expected-note-re@-2 {{{{^}}Calling default constructor for 'B'}}
-#else
- //expected-note-re@-4 2{{{{^}}Calling default constructor for 'B'}}
-#endif
C c;
-#if !PUREONLY
- //expected-note-re@-2 {{{{^}}Calling default constructor for 'C'}}
-#endif
D d;
E e;
F f;
G g;
H h;
H h1(1);
-#if !PUREONLY
- //expected-note-re@-2 {{{{^}}Calling constructor for 'H'}}
- //expected-note-re@-3 {{{{^}}Calling constructor for 'H'}}
-#endif
X x;
-#if !PUREONLY
- //expected-note-re@-2 {{{{^}}Calling default constructor for 'X'}}
-#endif
X x1(1);
-#if !PUREONLY
- //expected-note-re@-2 {{{{^}}Calling constructor for 'X'}}
-#endif
M m;
-#if !PUREONLY
- //expected-note-re@-2 {{{{^}}Calling default constructor for 'M'}}
-#endif
Y *y = new Y;
-#if !PUREONLY
- //expected-note-re@-2 {{{{^}}Calling default constructor for 'Y'}}
-#endif
delete y;
header::Z z;
-#if !PUREONLY
- // expected-note-re@-2 {{{{^}}Calling default constructor for 'Z'}}
-#endif
}
-#if !PUREONLY
- //expected-note-re@-2 2{{{{^}}Calling '~E'}}
-#endif
namespace PR34451 {
struct a {
diff --git a/src/llvm-project/clang/test/Analysis/virtualcall.h b/src/llvm-project/clang/test/Analysis/virtualcall.h
index e2fde24..f591aab 100644
--- a/src/llvm-project/clang/test/Analysis/virtualcall.h
+++ b/src/llvm-project/clang/test/Analysis/virtualcall.h
@@ -2,12 +2,7 @@
class Z {
public:
Z() {
- foo();
-#if !PUREONLY
- // expected-warning-re@-2 {{{{^}}Call to virtual function during construction}}
- // expected-note-re@-3 {{{{^}}This constructor of an object of type 'Z' has not returned when the virtual method was called}}
- // expected-note-re@-4 {{{{^}}Call to virtual function during construction}}
-#endif
+ foo(); // impure-warning {{Call to virtual method 'Z::foo' during construction bypasses virtual dispatch}}
}
virtual int foo();
};
diff --git a/src/llvm-project/clang/test/CMakeLists.txt b/src/llvm-project/clang/test/CMakeLists.txt
index f159160..7fdc7d0 100644
--- a/src/llvm-project/clang/test/CMakeLists.txt
+++ b/src/llvm-project/clang/test/CMakeLists.txt
@@ -22,11 +22,13 @@
CLANG_BUILD_EXAMPLES
CLANG_ENABLE_ARCMT
CLANG_ENABLE_STATIC_ANALYZER
+ CLANG_SPAWN_CC1
ENABLE_BACKTRACES
ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER
HAVE_LIBZ
LLVM_ENABLE_PER_TARGET_RUNTIME_DIR
- LLVM_ENABLE_PLUGINS)
+ LLVM_ENABLE_PLUGINS
+ LLVM_ENABLE_THREADS)
configure_lit_site_cfg(
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
@@ -107,9 +109,11 @@
llvm-cxxfilt
llvm-dis
llvm-dwarfdump
+ llvm-ifs
llvm-lto2
llvm-modextract
llvm-nm
+ llvm-objcopy
llvm-objdump
llvm-profdata
llvm-readelf
@@ -133,6 +137,11 @@
endif()
endif()
+# Copy gen_ast_dump_json_test.py to the clang build dir. This allows invoking
+# it without having to pass the --clang= argument
+configure_file(AST/gen_ast_dump_json_test.py
+ ${CLANG_BINARY_DIR}/bin/gen_ast_dump_json_test.py COPYONLY)
+
add_custom_target(clang-test-depends DEPENDS ${CLANG_TEST_DEPS})
set_target_properties(clang-test-depends PROPERTIES FOLDER "Clang tests")
diff --git a/src/llvm-project/clang/test/CXX/basic/basic.lookup/basic.lookup.qual/namespace.qual/p2.cpp b/src/llvm-project/clang/test/CXX/basic/basic.lookup/basic.lookup.qual/namespace.qual/p2.cpp
index ed6c6c0..f4e8521 100644
--- a/src/llvm-project/clang/test/CXX/basic/basic.lookup/basic.lookup.qual/namespace.qual/p2.cpp
+++ b/src/llvm-project/clang/test/CXX/basic/basic.lookup/basic.lookup.qual/namespace.qual/p2.cpp
@@ -38,7 +38,7 @@
// expected-note@-2 2 {{candidate constructor (the implicit move constructor) not viable}}
#endif
- explicit Number(double d) : d(d) {}
+ explicit Number(double d) : d(d) {} // expected-note 2{{explicit constructor is not a candidate}}
double d;
};
Number zero(0.0f);
diff --git a/src/llvm-project/clang/test/CXX/basic/basic.lookup/basic.lookup.unqual/p3.cpp b/src/llvm-project/clang/test/CXX/basic/basic.lookup/basic.lookup.unqual/p3.cpp
index 0138b88..ef3b127 100644
--- a/src/llvm-project/clang/test/CXX/basic/basic.lookup/basic.lookup.unqual/p3.cpp
+++ b/src/llvm-project/clang/test/CXX/basic/basic.lookup/basic.lookup.unqual/p3.cpp
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
// RUN: %clang_cc1 -std=c++17 -fsyntax-only -verify %s
-// RUN: %clang_cc1 -std=c++2a -fsyntax-only -verify %s
+// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %s
typedef int fn;
@@ -43,7 +43,7 @@
int x = f<N::A>(N::A());
#if __cplusplus <= 201703L
- // expected-warning@-2 {{C++2a extension}}
+ // expected-warning@-2 {{C++20 extension}}
#endif
int y = g<N::A>(N::A());
#if __cplusplus <= 201703L
diff --git a/src/llvm-project/clang/test/CXX/class.derived/class.virtual/p6.cpp b/src/llvm-project/clang/test/CXX/class.derived/class.virtual/p6.cpp
new file mode 100644
index 0000000..f0243a7
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/class.derived/class.virtual/p6.cpp
@@ -0,0 +1,21 @@
+// RUN: %clang_cc1 -std=c++2a -verify %s
+
+template<typename T>
+class A {
+ virtual void f1() requires (sizeof(T) == 0);
+ // expected-error@-1{{virtual function cannot have a requires clause}}
+ virtual void f2() requires (sizeof(T) == 1);
+ // expected-error@-1{{virtual function cannot have a requires clause}}
+};
+
+template<typename T>
+class B : A<T> {
+ virtual void f1() requires (sizeof(T) == 0) override {}
+ // expected-error@-1{{virtual function cannot have a requires clause}}
+};
+
+template<typename T> struct C : T {void f() requires true; };
+// expected-error@-1{{virtual function cannot have a requires clause}}
+struct D { virtual void f(); };
+template struct C<D>;
+// expected-note@-1{{in instantiation of template class 'C<D>' requested here}}
\ No newline at end of file
diff --git a/src/llvm-project/clang/test/CXX/class/class.compare/class.compare.default/p1.cpp b/src/llvm-project/clang/test/CXX/class/class.compare/class.compare.default/p1.cpp
new file mode 100644
index 0000000..1a0ccc9
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/class/class.compare/class.compare.default/p1.cpp
@@ -0,0 +1,134 @@
+// RUN: %clang_cc1 -std=c++2a -verify %s
+
+struct B {};
+bool operator==(const B&, const B&) = default; // expected-error {{equality comparison operator can only be defaulted in a class definition}} expected-note {{candidate}}
+bool operator<=>(const B&, const B&) = default; // expected-error {{three-way comparison operator can only be defaulted in a class definition}}
+
+template<typename T = void>
+ bool operator<(const B&, const B&) = default; // expected-error {{comparison operator template cannot be defaulted}}
+
+struct A {
+ friend bool operator==(const A&, const A&) = default;
+ friend bool operator!=(const A&, const B&) = default; // expected-error {{invalid parameter type for defaulted equality comparison operator; found 'const B &', expected 'A' or 'const A &'}}
+ friend bool operator!=(const B&, const B&) = default; // expected-error {{invalid parameter type for defaulted equality comparison}}
+ friend bool operator<(const A&, const A&);
+ friend bool operator<(const B&, const B&) = default; // expected-error {{invalid parameter type for defaulted relational comparison}}
+ friend bool operator>(A, A) = default; // expected-warning {{implicitly deleted}}
+
+ bool operator<(const A&) const;
+ bool operator<=(const A&) const = default;
+ bool operator==(const A&) const volatile && = default; // surprisingly, OK
+ bool operator<=>(const A&) = default; // expected-error {{defaulted member three-way comparison operator must be const-qualified}}
+ bool operator>=(const B&) const = default; // expected-error-re {{invalid parameter type for defaulted relational comparison operator; found 'const B &', expected 'const A &'{{$}}}}
+ static bool operator>(const B&) = default; // expected-error {{overloaded 'operator>' cannot be a static member function}}
+ friend bool operator>(A, const A&) = default; // expected-error {{must have the same type}} expected-note {{would be the best match}}
+
+ template<typename T = void>
+ friend bool operator==(const A&, const A&) = default; // expected-error {{comparison operator template cannot be defaulted}}
+ template<typename T = void>
+ bool operator==(const A&) const = default; // expected-error {{comparison operator template cannot be defaulted}}
+};
+
+// FIXME: The wording is not clear as to whether these are valid, but the
+// intention is that they are not.
+bool operator<(const A&, const A&) = default; // expected-error {{relational comparison operator can only be defaulted in a class definition}}
+bool A::operator<(const A&) const = default; // expected-error {{can only be defaulted in a class definition}}
+
+template<typename T> struct Dependent {
+ using U = typename T::type;
+ bool operator==(U) const = default; // expected-error {{found 'Dependent<Bad>::U'}}
+ friend bool operator==(U, U) = default; // expected-error {{found 'Dependent<Bad>::U'}}
+};
+
+struct Good { using type = const Dependent<Good>&; };
+template struct Dependent<Good>;
+
+struct Bad { using type = Dependent<Bad>&; };
+template struct Dependent<Bad>; // expected-note {{in instantiation of}}
+
+
+namespace std {
+ struct strong_ordering {
+ int n;
+ constexpr operator int() const { return n; }
+ static const strong_ordering equal, greater, less;
+ };
+ constexpr strong_ordering strong_ordering::equal = {0};
+ constexpr strong_ordering strong_ordering::greater = {1};
+ constexpr strong_ordering strong_ordering::less = {-1};
+}
+
+namespace LookupContext {
+ struct A {};
+
+ namespace N {
+ template <typename T> auto f() {
+ bool operator==(const T &, const T &);
+ bool operator<(const T &, const T &);
+ struct B {
+ T a;
+ std::strong_ordering operator<=>(const B &) const = default;
+ };
+ return B();
+ }
+
+ auto g() {
+ struct Cmp { Cmp(std::strong_ordering); };
+ Cmp operator<=>(const A&, const A&);
+ bool operator!=(const Cmp&, int);
+ struct B {
+ A a;
+ Cmp operator<=>(const B &) const = default;
+ };
+ return B();
+ }
+
+ auto h() {
+ struct B;
+ bool operator==(const B&, const B&);
+ bool operator!=(const B&, const B&); // expected-note 2{{best match}}
+ std::strong_ordering operator<=>(const B&, const B&);
+ bool operator<(const B&, const B&); // expected-note 2{{best match}}
+ bool operator<=(const B&, const B&); // expected-note 2{{best match}}
+ bool operator>(const B&, const B&); // expected-note 2{{best match}}
+ bool operator>=(const B&, const B&); // expected-note 2{{best match}}
+
+ struct B {
+ bool operator!=(const B&) const = default; // expected-warning {{implicitly deleted}} expected-note {{deleted here}}
+ bool operator<(const B&) const = default; // expected-warning {{implicitly deleted}} expected-note {{deleted here}}
+ bool operator<=(const B&) const = default; // expected-warning {{implicitly deleted}} expected-note {{deleted here}}
+ bool operator>(const B&) const = default; // expected-warning {{implicitly deleted}} expected-note {{deleted here}}
+ bool operator>=(const B&) const = default; // expected-warning {{implicitly deleted}} expected-note {{deleted here}}
+ };
+ return B();
+ }
+ }
+
+ namespace M {
+ bool operator==(const A &, const A &) = delete;
+ bool operator<(const A &, const A &) = delete;
+ bool cmp = N::f<A>() < N::f<A>();
+
+ void operator<=>(const A &, const A &) = delete;
+ auto cmp2 = N::g() <=> N::g();
+
+ void use_h() {
+ N::h() != N::h(); // expected-error {{implicitly deleted}}
+ N::h() < N::h(); // expected-error {{implicitly deleted}}
+ N::h() <= N::h(); // expected-error {{implicitly deleted}}
+ N::h() > N::h(); // expected-error {{implicitly deleted}}
+ N::h() >= N::h(); // expected-error {{implicitly deleted}}
+ }
+ }
+}
+
+namespace P1946 {
+ struct A {
+ friend bool operator==(A &, A &); // expected-note {{would lose const qualifier}}
+ };
+ struct B {
+ A a; // expected-note {{no viable comparison}}
+ friend bool operator==(B, B) = default; // ok
+ friend bool operator==(const B&, const B&) = default; // expected-warning {{deleted}}
+ };
+}
diff --git a/src/llvm-project/clang/test/CXX/class/class.compare/class.compare.default/p2.cpp b/src/llvm-project/clang/test/CXX/class/class.compare/class.compare.default/p2.cpp
new file mode 100644
index 0000000..cdffd44
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/class/class.compare/class.compare.default/p2.cpp
@@ -0,0 +1,143 @@
+// RUN: %clang_cc1 -std=c++2a -verify %s
+
+struct A1 {
+ int x;
+ int &y; // expected-note 9{{because class 'A1' has a reference member}}
+
+ bool operator==(const A1&) const = default; // expected-warning {{implicitly deleted}} expected-note 2{{deleted here}}
+ bool operator<=>(const A1&) const = default; // expected-warning {{implicitly deleted}} expected-note 5{{deleted here}}
+};
+struct A2 {
+ int x;
+ int &y;
+
+ bool operator==(const A2&) const;
+ bool operator!=(const A2&) const = default;
+
+ int operator<=>(const A2&) const;
+ bool operator<(const A2&) const = default;
+ bool operator<=(const A2&) const = default;
+ bool operator>(const A2&) const = default;
+ bool operator>=(const A2&) const = default;
+};
+void f(A1 a) {
+ void(a == a); // expected-error {{deleted}}
+ void(a != a); // expected-error {{deleted}}
+ void(a <=> a); // expected-error {{deleted}}
+ void(a < a); // expected-error {{deleted}}
+ void(a <= a); // expected-error {{deleted}}
+ void(a > a); // expected-error {{deleted}}
+ void(a >= a); // expected-error {{deleted}}
+}
+void f(A2 a) {
+ void(a == a);
+ void(a != a);
+ void(a <=> a);
+ void(a < a);
+ void(a <= a);
+ void(a > a);
+ void(a >= a);
+}
+
+struct B1 {
+ struct {
+ int x;
+ int &y; // expected-note 2{{because class 'B1' has a reference member}}
+ };
+
+ bool operator==(const B1&) const = default; // expected-warning {{implicitly deleted}}
+ bool operator<=>(const B1&) const = default; // expected-warning {{implicitly deleted}}
+};
+
+struct B2 {
+ struct {
+ int x;
+ int &y;
+ };
+
+ bool operator==(const B2&) const;
+ bool operator!=(const B2&) const = default;
+
+ bool operator<=>(const B2&) const;
+ bool operator<(const B2&) const = default;
+ bool operator<=(const B2&) const = default;
+ bool operator>(const B2&) const = default;
+ bool operator>=(const B2&) const = default;
+};
+
+union C1 {
+ int a;
+
+ bool operator==(const C1&) const = default; // expected-warning {{implicitly deleted}} expected-note {{because 'C1' is a union }}
+ bool operator<=>(const C1&) const = default; // expected-warning {{implicitly deleted}} expected-note {{because 'C1' is a union }}
+};
+
+union C2 {
+ int a;
+
+ bool operator==(const C2&) const;
+ bool operator!=(const C2&) const = default;
+
+ bool operator<=>(const C2&) const;
+ bool operator<(const C2&) const = default;
+ bool operator<=(const C2&) const = default;
+ bool operator>(const C2&) const = default;
+ bool operator>=(const C2&) const = default;
+};
+
+struct D1 {
+ union {
+ int a;
+ };
+
+ bool operator==(const D1&) const = default; // expected-warning {{implicitly deleted}} expected-note {{because 'D1' is a union-like class}}
+ bool operator<=>(const D1&) const = default; // expected-warning {{implicitly deleted}} expected-note {{because 'D1' is a union-like class}}
+};
+struct D2 {
+ union {
+ int a;
+ };
+
+ bool operator==(const D2&) const;
+ bool operator!=(const D2&) const = default;
+
+ bool operator<=>(const D2&) const;
+ bool operator<(const D2&) const = default;
+ bool operator<=(const D2&) const = default;
+ bool operator>(const D2&) const = default;
+ bool operator>=(const D2&) const = default;
+};
+
+union E1 {
+ bool operator==(const E1&) const = default;
+ bool operator!=(const E1&) const = default;
+
+ bool operator<=>(const E1&) const = default;
+ bool operator<(const E1&) const = default;
+ bool operator<=(const E1&) const = default;
+ bool operator>(const E1&) const = default;
+ bool operator>=(const E1&) const = default;
+};
+union E2 {
+ bool operator==(const E2&) const = default;
+ bool operator!=(const E2&) const = default;
+
+ bool operator<=>(const E2&) const = default;
+ bool operator<(const E2&) const = default;
+ bool operator<=(const E2&) const = default;
+ bool operator>(const E2&) const = default;
+ bool operator>=(const E2&) const = default;
+};
+
+struct F;
+bool operator==(const F&, const F&);
+bool operator!=(const F&, const F&);
+bool operator<=>(const F&, const F&);
+bool operator<(const F&, const F&);
+struct F {
+ union { int a; };
+ friend bool operator==(const F&, const F&) = default; // expected-error {{defaulting this equality comparison operator would delete it after its first declaration}} expected-note {{implicitly deleted because 'F' is a union-like class}}
+ friend bool operator!=(const F&, const F&) = default;
+ friend bool operator<=>(const F&, const F&) = default; // expected-error {{defaulting this three-way comparison operator would delete it after its first declaration}} expected-note {{implicitly deleted because 'F' is a union-like class}}
+ friend bool operator<(const F&, const F&) = default;
+};
diff --git a/src/llvm-project/clang/test/CXX/class/class.compare/class.compare.default/p3.cpp b/src/llvm-project/clang/test/CXX/class/class.compare/class.compare.default/p3.cpp
new file mode 100644
index 0000000..81a48a3
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/class/class.compare/class.compare.default/p3.cpp
@@ -0,0 +1,204 @@
+// This test is for the [class.compare.default]p3 added by P2002R0
+
+// RUN: %clang_cc1 -std=c++2a -verify %s
+
+namespace std {
+ struct strong_ordering {
+ int n;
+ constexpr operator int() const { return n; }
+ static const strong_ordering less, equal, greater;
+ };
+ constexpr strong_ordering strong_ordering::less = {-1};
+ constexpr strong_ordering strong_ordering::equal = {0};
+ constexpr strong_ordering strong_ordering::greater = {1};
+}
+
+struct A {
+ friend bool operator==(const A&, const A&) = default;
+ friend bool operator!=(const A&, const A&) = default;
+
+ friend std::strong_ordering operator<=>(const A&, const A&) = default;
+ friend bool operator<(const A&, const A&) = default;
+ friend bool operator<=(const A&, const A&) = default;
+ friend bool operator>(const A&, const A&) = default;
+ friend bool operator>=(const A&, const A&) = default;
+};
+struct TestA {
+ friend constexpr bool operator==(const A&, const A&) noexcept;
+ friend constexpr bool operator!=(const A&, const A&) noexcept;
+
+ friend constexpr std::strong_ordering operator<=>(const A&, const A&) noexcept;
+ friend constexpr bool operator<(const A&, const A&);
+ friend constexpr bool operator<=(const A&, const A&);
+ friend constexpr bool operator>(const A&, const A&);
+ friend constexpr bool operator>=(const A&, const A&);
+};
+
+// Declaration order doesn't matter, even though the secondary operators need
+// to know whether the primary ones are constexpr.
+struct ReversedA {
+ friend bool operator>=(const ReversedA&, const ReversedA&) = default;
+ friend bool operator>(const ReversedA&, const ReversedA&) = default;
+ friend bool operator<=(const ReversedA&, const ReversedA&) = default;
+ friend bool operator<(const ReversedA&, const ReversedA&) = default;
+ friend std::strong_ordering operator<=>(const ReversedA&, const ReversedA&) = default;
+
+ friend bool operator!=(const ReversedA&, const ReversedA&) = default;
+ friend bool operator==(const ReversedA&, const ReversedA&) = default;
+};
+struct TestReversedA {
+ friend constexpr bool operator>=(const ReversedA&, const ReversedA&);
+ friend constexpr bool operator>(const ReversedA&, const ReversedA&);
+ friend constexpr bool operator<=(const ReversedA&, const ReversedA&);
+ friend constexpr bool operator<(const ReversedA&, const ReversedA&);
+ friend constexpr std::strong_ordering operator<=>(const ReversedA&, const ReversedA&) noexcept;
+
+ friend constexpr bool operator!=(const ReversedA&, const ReversedA&) noexcept;
+ friend constexpr bool operator==(const ReversedA&, const ReversedA&) noexcept;
+};
+
+struct B {
+ A a;
+ friend bool operator==(const B&, const B&) = default;
+ friend bool operator!=(const B&, const B&) = default;
+
+ friend std::strong_ordering operator<=>(const B&, const B&) = default;
+ friend bool operator<(const B&, const B&) = default;
+ friend bool operator<=(const B&, const B&) = default;
+ friend bool operator>(const B&, const B&) = default;
+ friend bool operator>=(const B&, const B&) = default;
+};
+struct TestB {
+ friend constexpr bool operator==(const B&, const B&) noexcept;
+ friend constexpr bool operator!=(const B&, const B&) noexcept;
+
+ friend constexpr std::strong_ordering operator<=>(const B&, const B&);
+ friend constexpr bool operator<(const B&, const B&);
+ friend constexpr bool operator<=(const B&, const B&);
+ friend constexpr bool operator>(const B&, const B&);
+ friend constexpr bool operator>=(const B&, const B&);
+};
+
+struct C {
+ friend bool operator==(const C&, const C&); // expected-note {{previous}} expected-note 2{{here}}
+ friend bool operator!=(const C&, const C&) = default; // expected-note {{previous}}
+
+ friend std::strong_ordering operator<=>(const C&, const C&); // expected-note {{previous}} expected-note 2{{here}}
+ friend bool operator<(const C&, const C&) = default; // expected-note {{previous}}
+ friend bool operator<=(const C&, const C&) = default; // expected-note {{previous}}
+ friend bool operator>(const C&, const C&) = default; // expected-note {{previous}}
+ friend bool operator>=(const C&, const C&) = default; // expected-note {{previous}}
+};
+struct TestC {
+ friend constexpr bool operator==(const C&, const C&); // expected-error {{non-constexpr}}
+ friend constexpr bool operator!=(const C&, const C&); // expected-error {{non-constexpr}}
+
+ friend constexpr std::strong_ordering operator<=>(const C&, const C&); // expected-error {{non-constexpr}}
+ friend constexpr bool operator<(const C&, const C&); // expected-error {{non-constexpr}}
+ friend constexpr bool operator<=(const C&, const C&); // expected-error {{non-constexpr}}
+ friend constexpr bool operator>(const C&, const C&); // expected-error {{non-constexpr}}
+ friend constexpr bool operator>=(const C&, const C&); // expected-error {{non-constexpr}}
+};
+
+struct D {
+ A a;
+ C c;
+ A b;
+ friend bool operator==(const D&, const D&) = default; // expected-note {{previous}}
+ friend bool operator!=(const D&, const D&) = default; // expected-note {{previous}}
+
+ friend std::strong_ordering operator<=>(const D&, const D&) = default; // expected-note {{previous}}
+ friend bool operator<(const D&, const D&) = default; // expected-note {{previous}}
+ friend bool operator<=(const D&, const D&) = default; // expected-note {{previous}}
+ friend bool operator>(const D&, const D&) = default; // expected-note {{previous}}
+ friend bool operator>=(const D&, const D&) = default; // expected-note {{previous}}
+};
+struct TestD {
+ friend constexpr bool operator==(const D&, const D&); // expected-error {{non-constexpr}}
+ friend constexpr bool operator!=(const D&, const D&); // expected-error {{non-constexpr}}
+
+ friend constexpr std::strong_ordering operator<=>(const D&, const D&); // expected-error {{non-constexpr}}
+ friend constexpr bool operator<(const D&, const D&); // expected-error {{non-constexpr}}
+ friend constexpr bool operator<=(const D&, const D&); // expected-error {{non-constexpr}}
+ friend constexpr bool operator>(const D&, const D&); // expected-error {{non-constexpr}}
+ friend constexpr bool operator>=(const D&, const D&); // expected-error {{non-constexpr}}
+};
+
+
+struct E {
+ A a;
+ C c; // expected-note 2{{non-constexpr comparison function would be used to compare member 'c'}}
+ A b;
+ friend constexpr bool operator==(const E&, const E&) = default; // expected-error {{cannot be declared constexpr because it invokes a non-constexpr comparison function}}
+ friend constexpr bool operator!=(const E&, const E&) = default;
+
+ friend constexpr std::strong_ordering operator<=>(const E&, const E&) = default; // expected-error {{cannot be declared constexpr because it invokes a non-constexpr comparison function}}
+ friend constexpr bool operator<(const E&, const E&) = default;
+ friend constexpr bool operator<=(const E&, const E&) = default;
+ friend constexpr bool operator>(const E&, const E&) = default;
+ friend constexpr bool operator>=(const E&, const E&) = default;
+};
+
+struct E2 : A, C { // expected-note 2{{non-constexpr comparison function would be used to compare base class 'C'}}
+ friend constexpr bool operator==(const E2&, const E2&) = default; // expected-error {{cannot be declared constexpr because it invokes a non-constexpr comparison function}}
+ friend constexpr bool operator!=(const E2&, const E2&) = default;
+
+ friend constexpr std::strong_ordering operator<=>(const E2&, const E2&) = default; // expected-error {{cannot be declared constexpr because it invokes a non-constexpr comparison function}}
+ friend constexpr bool operator<(const E2&, const E2&) = default;
+ friend constexpr bool operator<=(const E2&, const E2&) = default;
+ friend constexpr bool operator>(const E2&, const E2&) = default;
+ friend constexpr bool operator>=(const E2&, const E2&) = default;
+};
+
+struct F {
+ friend bool operator==(const F&, const F&); // expected-note {{here}}
+ friend constexpr bool operator!=(const F&, const F&) = default; // expected-error {{cannot be declared constexpr because it invokes a non-constexpr comparison function}}
+
+ friend std::strong_ordering operator<=>(const F&, const F&); // expected-note 4{{here}}
+ friend constexpr bool operator<(const F&, const F&) = default; // expected-error {{cannot be declared constexpr because it invokes a non-constexpr comparison function}}
+ friend constexpr bool operator<=(const F&, const F&) = default; // expected-error {{cannot be declared constexpr because it invokes a non-constexpr comparison function}}
+ friend constexpr bool operator>(const F&, const F&) = default; // expected-error {{cannot be declared constexpr because it invokes a non-constexpr comparison function}}
+ friend constexpr bool operator>=(const F&, const F&) = default; // expected-error {{cannot be declared constexpr because it invokes a non-constexpr comparison function}}
+};
+
+// No implicit 'constexpr' if it's not the first declaration.
+// FIXME: This rule creates problems for reordering of declarations; is this
+// really the right model?
+struct G;
+bool operator==(const G&, const G&);
+bool operator!=(const G&, const G&);
+std::strong_ordering operator<=>(const G&, const G&);
+bool operator<(const G&, const G&);
+bool operator<=(const G&, const G&);
+bool operator>(const G&, const G&);
+bool operator>=(const G&, const G&);
+struct G {
+ friend bool operator==(const G&, const G&) = default;
+ friend bool operator!=(const G&, const G&) = default;
+
+ friend std::strong_ordering operator<=>(const G&, const G&) = default;
+ friend bool operator<(const G&, const G&) = default;
+ friend bool operator<=(const G&, const G&) = default;
+ friend bool operator>(const G&, const G&) = default;
+ friend bool operator>=(const G&, const G&) = default;
+};
+bool operator==(const G&, const G&);
+bool operator!=(const G&, const G&);
+
+std::strong_ordering operator<=>(const G&, const G&);
+bool operator<(const G&, const G&);
+bool operator<=(const G&, const G&);
+bool operator>(const G&, const G&);
+bool operator>=(const G&, const G&);
+
+namespace PR44721 {
+ template <typename T> bool operator==(T const &, T const &) { return true; }
+ template <typename T, typename U> bool operator!=(T const &, U const &) { return true; }
+ template <typename T> int operator<=>(T const &, T const &) { return 0; }
+
+ struct S {
+ friend bool operator==(const S &, const S &) = default;
+ friend bool operator<=>(const S &, const S &) = default;
+ int x;
+ };
+}
diff --git a/src/llvm-project/clang/test/CXX/class/class.compare/class.compare.default/p4.cpp b/src/llvm-project/clang/test/CXX/class/class.compare/class.compare.default/p4.cpp
new file mode 100644
index 0000000..8c303c6
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/class/class.compare/class.compare.default/p4.cpp
@@ -0,0 +1,146 @@
+// RUN: %clang_cc1 -std=c++2a -verify %s
+
+// This test is for [class.compare.default]p3 as modified and renumbered to p4
+// by P2002R0.
+
+namespace std {
+ struct strong_ordering {
+ int n;
+ constexpr operator int() const { return n; }
+ static const strong_ordering less, equal, greater;
+ };
+ constexpr strong_ordering strong_ordering::less = {-1};
+ constexpr strong_ordering strong_ordering::equal = {0};
+ constexpr strong_ordering strong_ordering::greater = {1};
+}
+
+namespace N {
+ struct A {
+ friend constexpr std::strong_ordering operator<=>(const A&, const A&) = default;
+ };
+
+ constexpr bool (*test_a_not_found)(const A&, const A&) = &operator==; // expected-error {{undeclared}}
+
+ constexpr bool operator==(const A&, const A&) noexcept;
+ constexpr bool (*test_a)(const A&, const A&) noexcept = &operator==;
+ static_assert((*test_a)(A(), A()));
+}
+
+struct B1 {
+ virtual std::strong_ordering operator<=>(const B1&) const = default;
+};
+bool (B1::*test_b)(const B1&) const = &B1::operator==;
+
+struct C1 : B1 {
+ // OK, B1::operator== is virtual.
+ bool operator==(const B1&) const override;
+};
+
+struct B2 {
+ std::strong_ordering operator<=>(const B2&) const = default;
+};
+
+struct C2 : B2 {
+ bool operator==(const B2&) const override; // expected-error {{only virtual member functions}}
+};
+
+struct D {
+ std::strong_ordering operator<=>(const D&) const;
+ virtual std::strong_ordering operator<=>(const struct E&) const = 0;
+};
+struct E : D {
+ // expected-error@+2 {{only virtual member functions}}
+ // expected-note@+1 {{while declaring the corresponding implicit 'operator==' for this defaulted 'operator<=>'}}
+ std::strong_ordering operator<=>(const E&) const override = default;
+};
+
+struct F {
+ [[deprecated("oh no")]] std::strong_ordering operator<=>(const F&) const = default; // expected-note 4{{deprecated}}
+};
+void use_f(F f) {
+ void(f <=> f); // expected-warning {{oh no}}
+ void(f < f); // expected-warning {{oh no}}
+ void(f == f); // expected-warning {{oh no}}
+ void(f != f); // expected-warning {{oh no}}
+}
+
+class G {
+ // expected-note@+2 {{implicitly declared private here}}
+ // expected-note-re@+1 {{{{^}}declared private here}}
+ std::strong_ordering operator<=>(const G&) const = default;
+public:
+};
+void use_g(G g) {
+ void(g <=> g); // expected-error {{private}}
+ void(g == g); // expected-error {{private}}
+}
+
+struct H {
+ bool operator==(const H&) const; // expected-note {{here}}
+ constexpr std::strong_ordering operator<=>(const H&) const { return std::strong_ordering::equal; }
+};
+
+struct I {
+ H h; // expected-note {{used to compare}}
+ // expected-error@+1 {{defaulted definition of three-way comparison operator cannot be declared constexpr because the corresponding implicit 'operator==' invokes a non-constexpr comparison function}}
+ constexpr std::strong_ordering operator<=>(const I&) const = default;
+};
+
+struct J {
+ std::strong_ordering operator<=>(const J&) const & = default; // expected-note {{candidate function (the implicit 'operator==' for this 'operator<=>)'}}
+ friend std::strong_ordering operator<=>(const J&, const J&) = default; // expected-note {{candidate function (the implicit 'operator==' for this 'operator<=>)'}}
+};
+void use_j(J j) {
+ void(j == j); // expected-error {{ambiguous}}
+}
+
+namespace DeleteAfterFirstDecl {
+ bool operator==(const struct Q&, const struct Q&);
+ struct Q {
+ struct X {
+ friend std::strong_ordering operator<=>(const X&, const X&);
+ } x; // expected-note {{no viable comparison}}
+ // expected-error@+1 {{defaulting the corresponding implicit 'operator==' for this defaulted 'operator<=>' would delete it after its first declaration}}
+ friend std::strong_ordering operator<=>(const Q&, const Q&) = default;
+ };
+}
+
+// Note, substitution here results in the second parameter of 'operator=='
+// referring to the first parameter of 'operator==', not to the first parameter
+// of 'operator<=>'.
+// FIXME: Find a case where this matters (attribute enable_if?).
+struct K {
+ friend std::strong_ordering operator<=>(const K &k, decltype(k)) = default;
+};
+bool test_k = K() == K();
+
+namespace NoInjectionIfOperatorEqualsDeclared {
+ struct A {
+ void operator==(int); // expected-note 2{{not viable}}
+ std::strong_ordering operator<=>(const A&) const = default;
+ };
+ bool test_a = A() == A(); // expected-error {{invalid operands}}
+
+ struct B {
+ friend void operator==(int, struct Q); // expected-note 2{{not viable}}
+ std::strong_ordering operator<=>(const B&) const = default;
+ };
+ bool test_b = B() == B(); // expected-error {{invalid operands}}
+
+ struct C {
+ void operator==(int); // expected-note 2{{not viable}}
+ friend std::strong_ordering operator<=>(const C&, const C&) = default;
+ };
+ bool test_c = C() == C(); // expected-error {{invalid operands}}
+
+ struct D {
+ void f() {
+ void operator==(const D&, int);
+ }
+ struct X {
+ friend void operator==(const D&, int);
+ };
+ friend std::strong_ordering operator<=>(const D&, const D&) = default;
+ };
+ bool test_d = D() == D();
+}
diff --git a/src/llvm-project/clang/test/CXX/class/class.compare/class.compare.default/p5.cpp b/src/llvm-project/clang/test/CXX/class/class.compare/class.compare.default/p5.cpp
new file mode 100644
index 0000000..5489051
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/class/class.compare/class.compare.default/p5.cpp
@@ -0,0 +1,60 @@
+// RUN: %clang_cc1 -std=c++2a -verify %s
+
+// expected-no-diagnostics
+namespace std {
+ struct strong_ordering {
+ int n;
+ constexpr operator int() const { return n; }
+ static const strong_ordering less, equal, greater;
+ };
+ constexpr strong_ordering strong_ordering::less{-1}, strong_ordering::equal{0}, strong_ordering::greater{1};
+}
+
+// Check that we compare subobjects in the right order.
+struct Log {
+ char buff[10] = {};
+ int n = 0;
+ constexpr void add(char c) { buff[n++] = c; }
+ constexpr bool operator==(const char *p) const { return __builtin_strcmp(p, buff) == 0; }
+};
+
+template<char C> struct B {
+ Log *log;
+ constexpr bool operator==(const B&) const { log->add(C); return true; }
+ constexpr std::strong_ordering operator<=>(const B&) const { log->add(C); return {0}; }
+};
+
+template<typename T> constexpr bool check(bool which, const char *str) {
+ Log log;
+ T c(&log);
+ (void)(which ? c == c : c <=> c);
+ return log == str;
+}
+
+struct C : B<'a'>, B<'b'> {
+ B<'r'> r[3];
+ B<'c'> c;
+ B<'s'> s[2];
+ B<'d'> d;
+
+ constexpr C(Log *p) : B<'a'>{p}, B<'b'>{p}, r{p, p, p}, c{p}, s{p, p}, d{p} {}
+
+ bool operator==(const C&) const = default;
+ std::strong_ordering operator<=>(const C&) const = default;
+};
+
+static_assert(check<C>(false, "abrrrcssd"));
+static_assert(check<C>(true, "abrrrcssd"));
+
+struct D {
+ B<'x'> x;
+ B<'y'> y[2];
+
+ constexpr D(Log *p) : x{p}, y{p, p} {}
+
+ bool operator==(const D&) const = default;
+ std::strong_ordering operator<=>(const D&) const = default;
+};
+
+static_assert(check<D>(false, "xyy"));
+static_assert(check<D>(true, "xyy"));
diff --git a/src/llvm-project/clang/test/CXX/class/class.compare/class.eq/p1.cpp b/src/llvm-project/clang/test/CXX/class/class.compare/class.eq/p1.cpp
new file mode 100644
index 0000000..72f6ad5
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/class/class.compare/class.eq/p1.cpp
@@ -0,0 +1,27 @@
+// RUN: %clang_cc1 -std=c++2a -verify %s
+
+struct Good1 {
+ bool operator==(const Good1&) const = default;
+ bool operator!=(const Good1&) const = default;
+};
+struct Good2 {
+ friend bool operator==(const Good2&, const Good2&) = default;
+ friend bool operator!=(const Good2&, const Good2&) = default;
+};
+
+enum Bool : bool {};
+struct Bad {
+ bool &operator==(const Bad&) const = default; // expected-error {{return type for defaulted equality comparison operator must be 'bool', not 'bool &'}}
+ const bool operator!=(const Bad&) const = default; // expected-error {{return type for defaulted equality comparison operator must be 'bool', not 'const bool'}}
+ friend Bool operator==(const Bad&, const Bad&) = default; // expected-error {{return type for defaulted equality comparison operator must be 'bool', not 'Bool'}}
+ friend int operator!=(const Bad&, const Bad&) = default; // expected-error {{return type for defaulted equality comparison operator must be 'bool', not 'int'}}
+};
+
+template<typename T> struct Ugly {
+ T operator==(const Ugly&) const = default; // expected-error {{return type}}
+ T operator!=(const Ugly&) const = default; // expected-error {{return type}}
+ friend T operator==(const Ugly&, const Ugly&) = default; // expected-error {{return type}}
+ friend T operator!=(const Ugly&, const Ugly&) = default; // expected-error {{return type}}
+};
+template struct Ugly<bool>;
+template struct Ugly<int>; // expected-note {{in instantiation of}}
diff --git a/src/llvm-project/clang/test/CXX/class/class.compare/class.eq/p2.cpp b/src/llvm-project/clang/test/CXX/class/class.compare/class.eq/p2.cpp
new file mode 100644
index 0000000..e5f4a02
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/class/class.compare/class.eq/p2.cpp
@@ -0,0 +1,114 @@
+// RUN: %clang_cc1 -std=c++2a -verify %s
+
+struct A {};
+struct B { bool operator==(B) const; };
+struct C { int operator==(C) const; };
+struct D {
+ // expected-note@+2 {{candidate function not viable: 'this' argument has type 'const}}
+ // expected-note@+1 {{candidate function (with reversed parameter order) not viable: 1st argument ('const}}
+ bool operator==(D);
+};
+struct E {
+ E(const E &) = delete; // expected-note {{deleted}}
+ int operator==(E) const; // expected-note {{passing}}
+};
+struct F { void operator==(F) const; };
+struct G { bool operator==(G) const = delete; }; // expected-note {{deleted here}}
+
+template<typename T> struct X {
+ X();
+ bool operator==(const X&) const = default; // #x expected-note 4{{deleted here}}
+ T t; // expected-note 3{{because there is no viable comparison function for member 't'}}
+ // expected-note@-1 {{because it would invoke a deleted comparison function for member 't'}}
+};
+
+struct Mutable {
+ bool operator==(const Mutable&) const = default;
+ mutable D d;
+};
+
+void test() {
+ void(X<A>() == X<A>()); // expected-error {{cannot be compared because its 'operator==' is implicitly deleted}}
+ void(X<B>() == X<B>());
+ void(X<C>() == X<C>());
+ void(X<D>() == X<D>()); // expected-error {{cannot be compared because its 'operator==' is implicitly deleted}}
+ void(Mutable() == Mutable());
+
+ // FIXME: We would benefit from a note identifying the member of 'X' we were comparing here and below.
+ // expected-error@#x {{call to deleted constructor of 'E'}}
+ void(X<E>() == X<E>()); // expected-note {{in defaulted equality comparison operator for 'X<E>' first required here}}
+
+ // FIXME: We would benefit from a note pointing at the selected 'operator==' here.
+ // expected-error@#x {{value of type 'void' is not contextually convertible to 'bool'}}
+ void(X<F>() == X<F>()); // expected-note {{in defaulted equality comparison operator for 'X<F>' first required here}}
+
+ void(X<G>() == X<G>()); // expected-error {{cannot be compared because its 'operator==' is implicitly deleted}}
+
+ void(X<A[3]>() == X<A[3]>()); // expected-error {{cannot be compared because its 'operator==' is implicitly deleted}}
+ void(X<B[3]>() == X<B[3]>());
+}
+
+namespace Access {
+ class A {
+ bool operator==(const A &) const; // expected-note 2{{implicitly declared private here}}
+ };
+ struct B : A { // expected-note 2{{because it would invoke a private 'operator==' to compare base class 'A'}}
+ bool operator==(const B &) const = default; // expected-warning {{deleted}}
+ friend bool operator==(const B &, const B &) = default; // expected-warning {{deleted}}
+ };
+
+ class C {
+ protected:
+ bool operator==(const C &) const; // expected-note 2{{declared protected here}}
+ };
+ struct D : C {
+ bool operator==(const D &) const = default;
+ friend bool operator==(const D &, const D&) = default;
+ };
+ struct E {
+ C c; // expected-note 2{{because it would invoke a protected 'operator==' member of 'Access::C' to compare member 'c'}}
+ bool operator==(const E &) const = default; // expected-warning {{deleted}}
+ friend bool operator==(const E &, const E &) = default; // expected-warning {{deleted}}
+ };
+
+ struct F : C {
+ using C::operator==;
+ };
+ struct G : F {
+ bool operator==(const G&) const = default;
+ friend bool operator==(const G&, const G&) = default;
+ };
+
+ struct H : C {
+ private:
+ using C::operator==; // expected-note 2{{declared private here}}
+ };
+ struct I : H { // expected-note 2{{private 'operator==' to compare base class 'H'}}
+ bool operator==(const I&) const = default; // expected-warning {{deleted}}
+ friend bool operator==(const I&, const I&) = default; // expected-warning {{deleted}}
+ };
+
+ class J {
+ bool operator==(const J&) const;
+ friend class K;
+ };
+ class K {
+ J j;
+ bool operator==(const K&) const = default;
+ friend bool operator==(const K&, const K&) = default;
+ };
+
+ struct X {
+ bool operator==(const X&) const; // expected-note {{ambiguity is between a regular call to this operator and a call with the argument order reversed}}
+ };
+ struct Y : private X { // expected-note {{private}}
+ using X::operator==;
+ };
+ struct Z : Y {
+ // Note: this function is not deleted. The selected operator== is
+ // accessible. But the derived-to-base conversion involves an inaccessible
+ // base class, which we don't check for until we define the function.
+ bool operator==(const Z&) const = default; // expected-error {{cannot cast 'const Access::Y' to its private base class 'const Access::X'}} expected-warning {{ambiguous}}
+ };
+ bool z = Z() == Z(); // expected-note {{first required here}}
+}
diff --git a/src/llvm-project/clang/test/CXX/class/class.compare/class.eq/p3.cpp b/src/llvm-project/clang/test/CXX/class/class.compare/class.eq/p3.cpp
new file mode 100644
index 0000000..04db022
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/class/class.compare/class.eq/p3.cpp
@@ -0,0 +1,25 @@
+// RUN: %clang_cc1 -std=c++2a -verify %s
+
+struct A {
+ int a, b[3], c;
+ bool operator==(const A&) const = default;
+};
+
+static_assert(A{1, 2, 3, 4, 5} == A{1, 2, 3, 4, 5});
+static_assert(A{1, 2, 3, 4, 5} == A{0, 2, 3, 4, 5}); // expected-error {{failed}}
+static_assert(A{1, 2, 3, 4, 5} == A{1, 0, 3, 4, 5}); // expected-error {{failed}}
+static_assert(A{1, 2, 3, 4, 5} == A{1, 2, 0, 4, 5}); // expected-error {{failed}}
+static_assert(A{1, 2, 3, 4, 5} == A{1, 2, 3, 0, 5}); // expected-error {{failed}}
+static_assert(A{1, 2, 3, 4, 5} == A{1, 2, 3, 4, 0}); // expected-error {{failed}}
+
+struct B {
+ int a, b[3], c;
+ friend bool operator==(B, B) = default;
+};
+
+static_assert(B{1, 2, 3, 4, 5} == B{1, 2, 3, 4, 5});
+static_assert(B{1, 2, 3, 4, 5} == B{0, 2, 3, 4, 5}); // expected-error {{failed}}
+static_assert(B{1, 2, 3, 4, 5} == B{1, 0, 3, 4, 5}); // expected-error {{failed}}
+static_assert(B{1, 2, 3, 4, 5} == B{1, 2, 0, 4, 5}); // expected-error {{failed}}
+static_assert(B{1, 2, 3, 4, 5} == B{1, 2, 3, 0, 5}); // expected-error {{failed}}
+static_assert(B{1, 2, 3, 4, 5} == B{1, 2, 3, 4, 0}); // expected-error {{failed}}
diff --git a/src/llvm-project/clang/test/CXX/class/class.compare/class.rel/p1.cpp b/src/llvm-project/clang/test/CXX/class/class.compare/class.rel/p1.cpp
new file mode 100644
index 0000000..f61dd4a
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/class/class.compare/class.rel/p1.cpp
@@ -0,0 +1,27 @@
+// RUN: %clang_cc1 -std=c++2a -verify %s
+
+struct Good {
+ int operator<=>(const Good&) const;
+
+ bool operator<(const Good&) const = default;
+ bool operator>(const Good&) const = default;
+ friend bool operator<=(const Good&, const Good&) = default;
+ friend bool operator>=(const Good&, const Good&) = default;
+};
+
+enum Bool : bool {};
+struct Bad {
+ bool &operator<(const Bad&) const = default; // expected-error {{return type for defaulted relational comparison operator must be 'bool', not 'bool &'}}
+ const bool operator>(const Bad&) const = default; // expected-error {{return type for defaulted relational comparison operator must be 'bool', not 'const bool'}}
+ friend Bool operator<=(const Bad&, const Bad&) = default; // expected-error {{return type for defaulted relational comparison operator must be 'bool', not 'Bool'}}
+ friend int operator>=(const Bad&, const Bad&) = default; // expected-error {{return type for defaulted relational comparison operator must be 'bool', not 'int'}}
+};
+
+template<typename T> struct Ugly {
+ T operator<(const Ugly&) const = default; // expected-error {{return type}}
+ T operator>(const Ugly&) const = default; // expected-error {{return type}}
+ friend T operator<=(const Ugly&, const Ugly&) = default; // expected-error {{return type}}
+ friend T operator>=(const Ugly&, const Ugly&) = default; // expected-error {{return type}}
+};
+template struct Ugly<bool>;
+template struct Ugly<int>; // expected-note {{in instantiation of}}
diff --git a/src/llvm-project/clang/test/CXX/class/class.compare/class.rel/p2.cpp b/src/llvm-project/clang/test/CXX/class/class.compare/class.rel/p2.cpp
new file mode 100644
index 0000000..21a68f9
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/class/class.compare/class.rel/p2.cpp
@@ -0,0 +1,84 @@
+// RUN: %clang_cc1 -std=c++2a -verify %s
+
+namespace Rel {
+ struct A {
+ int n;
+ constexpr int operator<=>(A a) const { return n - a.n; }
+ friend bool operator<(const A&, const A&) = default;
+ friend bool operator<=(const A&, const A&) = default;
+ friend bool operator>(const A&, const A&) = default;
+ friend bool operator>=(const A&, const A&) = default;
+ };
+ static_assert(A{0} < A{1});
+ static_assert(A{1} < A{1}); // expected-error {{failed}}
+ static_assert(A{0} <= A{1});
+ static_assert(A{1} <= A{1});
+ static_assert(A{2} <= A{1}); // expected-error {{failed}}
+ static_assert(A{1} > A{0});
+ static_assert(A{1} > A{1}); // expected-error {{failed}}
+ static_assert(A{1} >= A{0});
+ static_assert(A{1} >= A{1});
+ static_assert(A{1} >= A{2}); // expected-error {{failed}}
+
+ struct B {
+ bool operator<=>(B) const = delete; // expected-note 4{{deleted here}} expected-note-re 8{{candidate {{.*}} deleted}}
+ friend bool operator<(const B&, const B&) = default; // expected-warning {{implicitly deleted}} expected-note {{because it would invoke a deleted comparison}} expected-note-re {{candidate {{.*}} deleted}}
+ friend bool operator<=(const B&, const B&) = default; // expected-warning {{implicitly deleted}} expected-note {{because it would invoke a deleted comparison}} expected-note-re {{candidate {{.*}} deleted}}
+ friend bool operator>(const B&, const B&) = default; // expected-warning {{implicitly deleted}} expected-note {{because it would invoke a deleted comparison}} expected-note-re {{candidate {{.*}} deleted}}
+ friend bool operator>=(const B&, const B&) = default; // expected-warning {{implicitly deleted}} expected-note {{because it would invoke a deleted comparison}} expected-note-re {{candidate {{.*}} deleted}}
+ };
+ bool b1 = B() < B(); // expected-error {{deleted}}
+ bool b2 = B() <= B(); // expected-error {{deleted}}
+ bool b3 = B() > B(); // expected-error {{deleted}}
+ bool b4 = B() >= B(); // expected-error {{deleted}}
+
+ struct C {
+ friend bool operator<=>(const C&, const C&);
+ friend bool operator<(const C&, const C&); // expected-note {{because this non-rewritten comparison function would be the best match}}
+
+ bool operator<(const C&) const = default; // expected-warning {{implicitly deleted}}
+ bool operator>(const C&) const = default; // OK
+ };
+}
+
+// Under P2002R0, operator!= follows these rules too.
+namespace NotEqual {
+ struct A {
+ int n;
+ constexpr bool operator==(A a) const { return n == a.n; }
+ friend bool operator!=(const A&, const A&) = default;
+ };
+ static_assert(A{1} != A{2});
+ static_assert(A{1} != A{1}); // expected-error {{failed}}
+
+ struct B {
+ bool operator==(B) const = delete; // expected-note {{deleted here}} expected-note-re 2{{candidate {{.*}} deleted}}
+ friend bool operator!=(const B&, const B&) = default; // expected-warning {{implicitly deleted}} expected-note {{because it would invoke a deleted comparison}} expected-note-re {{candidate {{.*}} deleted}}
+ };
+ bool b = B() != B(); // expected-error {{deleted}}
+
+ struct C {
+ friend bool operator==(const C&, const C&);
+ friend bool operator!=(const C&, const C&); // expected-note {{because this non-rewritten comparison function would be the best match}}
+
+ bool operator!=(const C&) const = default; // expected-warning {{implicitly deleted}}
+ };
+
+ // Ensure we don't go into an infinite loop diagnosing this: the first function
+ // is deleted because it calls the second function, which is deleted because it
+ // calls the first.
+ struct Evil {
+ friend bool operator!=(const Evil&, const Evil&) = default; // expected-warning {{implicitly deleted}} expected-note {{would be the best match}}
+ bool operator!=(const Evil&) const = default; // expected-warning {{implicitly deleted}} expected-note {{would be the best match}}
+ };
+}
+
+namespace Access {
+ class A {
+ int operator<=>(A) const; // expected-note {{private}}
+ };
+ struct B : A {
+ friend bool operator<(const B&, const B&) = default; // expected-warning {{implicitly deleted}}
+ // expected-note@-1 {{defaulted 'operator<' is implicitly deleted because it would invoke a private 'operator<=>' member of 'Access::A'}}
+ };
+}
diff --git a/src/llvm-project/clang/test/CXX/class/class.compare/class.spaceship/p1.cpp b/src/llvm-project/clang/test/CXX/class/class.compare/class.spaceship/p1.cpp
new file mode 100644
index 0000000..7768e84
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/class/class.compare/class.spaceship/p1.cpp
@@ -0,0 +1,231 @@
+// RUN: %clang_cc1 -std=c++2a -verify %s -fcxx-exceptions
+
+namespace std {
+ struct strong_ordering { // expected-note 6{{candidate}}
+ int n;
+ constexpr operator int() const { return n; }
+ static const strong_ordering less, equal, greater;
+ };
+ constexpr strong_ordering strong_ordering::less{-1},
+ strong_ordering::equal{0}, strong_ordering::greater{1};
+
+ struct weak_ordering {
+ int n;
+ constexpr weak_ordering(int n) : n(n) {}
+ constexpr weak_ordering(strong_ordering o) : n(o.n) {}
+ constexpr operator int() const { return n; }
+ static const weak_ordering less, equivalent, greater;
+ };
+ constexpr weak_ordering weak_ordering::less{-1},
+ weak_ordering::equivalent{0}, weak_ordering::greater{1};
+
+ struct partial_ordering {
+ double d;
+ constexpr partial_ordering(double d) : d(d) {}
+ constexpr partial_ordering(strong_ordering o) : d(o.n) {}
+ constexpr partial_ordering(weak_ordering o) : d(o.n) {}
+ constexpr operator double() const { return d; }
+ static const partial_ordering less, equivalent, greater, unordered;
+ };
+ constexpr partial_ordering partial_ordering::less{-1},
+ partial_ordering::equivalent{0}, partial_ordering::greater{1},
+ partial_ordering::unordered{__builtin_nan("")};
+
+ static_assert(!(partial_ordering::unordered < 0));
+ static_assert(!(partial_ordering::unordered == 0));
+ static_assert(!(partial_ordering::unordered > 0));
+}
+
+namespace Deletedness {
+ struct A {
+ std::strong_ordering operator<=>(const A&) const;
+ };
+ struct B {
+ bool operator==(const B&) const;
+ bool operator<(const B&) const;
+ };
+ struct C {
+ std::strong_ordering operator<=>(const C&) const = delete; // expected-note 2{{deleted}}
+ };
+ struct D1 {
+ bool operator==(const D1&) const;
+ std::strong_ordering operator<=>(int) const; // expected-note 2{{function not viable}} expected-note 2{{function (with reversed parameter order) not viable}}
+ bool operator<(int) const; // expected-note 2{{function not viable}}
+ };
+ struct D2 {
+ bool operator<(const D2&) const;
+ std::strong_ordering operator<=>(int) const; // expected-note 2{{function not viable}} expected-note 2{{function (with reversed parameter order) not viable}}
+ bool operator==(int) const; // expected-note 2{{function not viable}}
+ };
+ struct E {
+ bool operator==(const E&) const;
+ bool operator<(const E&) const = delete; // expected-note 2{{deleted}}
+ };
+ struct F {
+ std::strong_ordering operator<=>(const F&) const; // expected-note 2{{candidate}}
+ std::strong_ordering operator<=>(F) const; // expected-note 2{{candidate}}
+ };
+ struct G1 {
+ bool operator==(const G1&) const;
+ void operator<(const G1&) const;
+ };
+ struct G2 {
+ void operator==(const G2&) const;
+ bool operator<(const G2&) const;
+ };
+ struct H {
+ void operator<=>(const H&) const;
+ };
+
+ // expected-note@#base {{deleted comparison function for base class 'C'}}
+ // expected-note@#base {{no viable comparison function for base class 'D1'}}
+ // expected-note@#base {{three-way comparison cannot be synthesized because there is no viable function for '<' comparison}}
+ // expected-note@#base {{no viable comparison function for base class 'D2'}}
+ // expected-note@#base {{three-way comparison cannot be synthesized because there is no viable function for '==' comparison}}
+ // expected-note@#base {{deleted comparison function for base class 'E'}}
+ // expected-note@#base {{implied comparison for base class 'F' is ambiguous}}
+ template<typename T> struct Cmp : T { // #base
+ std::strong_ordering operator<=>(const Cmp&) const = default; // #cmp expected-note 5{{here}}
+ };
+
+ void use(...);
+ void f() {
+ use(
+ Cmp<A>() <=> Cmp<A>(),
+ Cmp<B>() <=> Cmp<B>(),
+ Cmp<C>() <=> Cmp<C>(), // expected-error {{deleted}}
+ Cmp<D1>() <=> Cmp<D1>(), // expected-error {{deleted}}
+ Cmp<D2>() <=> Cmp<D2>(), // expected-error {{deleted}}
+ Cmp<E>() <=> Cmp<E>(), // expected-error {{deleted}}
+ Cmp<F>() <=> Cmp<F>(), // expected-error {{deleted}}
+ // FIXME: The following three errors are not very good.
+ // expected-error@#cmp {{value of type 'void' is not contextually convertible to 'bool'}}
+ Cmp<G1>() <=> Cmp<G1>(), // expected-note-re {{in defaulted three-way comparison operator for '{{.*}}Cmp<{{.*}}G1>' first required here}}j
+ // expected-error@#cmp {{value of type 'void' is not contextually convertible to 'bool'}}
+ Cmp<G2>() <=> Cmp<G2>(), // expected-note-re {{in defaulted three-way comparison operator for '{{.*}}Cmp<{{.*}}G2>' first required here}}j
+ // expected-error@#cmp {{no matching conversion for static_cast from 'void' to 'std::strong_ordering'}}
+ Cmp<H>() <=> Cmp<H>(), // expected-note-re {{in defaulted three-way comparison operator for '{{.*}}Cmp<{{.*}}H>' first required here}}j
+ 0
+ );
+ }
+
+ // expected-note@#arr {{deleted comparison function for member 'arr'}}
+ // expected-note@#arr {{no viable comparison function for member 'arr'}}
+ // expected-note@#arr {{three-way comparison cannot be synthesized because there is no viable function for '<' comparison}}
+ // expected-note@#arr {{no viable comparison function for member 'arr'}}
+ // expected-note@#arr {{three-way comparison cannot be synthesized because there is no viable function for '==' comparison}}
+ // expected-note@#arr {{deleted comparison function for member 'arr'}}
+ // expected-note@#arr {{implied comparison for member 'arr' is ambiguous}}
+ template<typename T> struct CmpArray {
+ T arr[3]; // #arr
+ std::strong_ordering operator<=>(const CmpArray&) const = default; // #cmparray expected-note 5{{here}}
+ };
+ void g() {
+ use(
+ CmpArray<A>() <=> CmpArray<A>(),
+ CmpArray<B>() <=> CmpArray<B>(),
+ CmpArray<C>() <=> CmpArray<C>(), // expected-error {{deleted}}
+ CmpArray<D1>() <=> CmpArray<D1>(), // expected-error {{deleted}}
+ CmpArray<D2>() <=> CmpArray<D2>(), // expected-error {{deleted}}
+ CmpArray<E>() <=> CmpArray<E>(), // expected-error {{deleted}}
+ CmpArray<F>() <=> CmpArray<F>(), // expected-error {{deleted}}
+ // FIXME: The following three errors are not very good.
+ // expected-error@#cmparray {{value of type 'void' is not contextually convertible to 'bool'}}
+ CmpArray<G1>() <=> CmpArray<G1>(), // expected-note-re {{in defaulted three-way comparison operator for '{{.*}}CmpArray<{{.*}}G1>' first required here}}j
+ // expected-error@#cmparray {{value of type 'void' is not contextually convertible to 'bool'}}
+ CmpArray<G2>() <=> CmpArray<G2>(), // expected-note-re {{in defaulted three-way comparison operator for '{{.*}}CmpArray<{{.*}}G2>' first required here}}j
+ // expected-error@#cmparray {{no matching conversion for static_cast from 'void' to 'std::strong_ordering'}}
+ CmpArray<H>() <=> CmpArray<H>(), // expected-note-re {{in defaulted three-way comparison operator for '{{.*}}CmpArray<{{.*}}H>' first required here}}j
+ 0
+ );
+ }
+}
+
+namespace Access {
+ class A {
+ std::strong_ordering operator<=>(const A &) const; // expected-note {{here}}
+ public:
+ bool operator==(const A &) const;
+ bool operator<(const A &) const;
+ };
+ struct B {
+ A a; // expected-note {{would invoke a private 'operator<=>'}}
+ friend std::strong_ordering operator<=>(const B &, const B &) = default; // expected-warning {{deleted}}
+ };
+
+ class C {
+ std::strong_ordering operator<=>(const C &); // not viable (not const)
+ bool operator==(const C &) const; // expected-note {{here}}
+ bool operator<(const C &) const;
+ };
+ struct D {
+ C c; // expected-note {{would invoke a private 'operator=='}}
+ friend std::strong_ordering operator<=>(const D &, const D &) = default; // expected-warning {{deleted}}
+ };
+}
+
+namespace Synthesis {
+ enum Result { False, True, Mu };
+
+ constexpr bool toBool(Result R) {
+ if (R == Mu) throw "should not ask this question";
+ return R == True;
+ }
+
+ struct Val {
+ Result equal, less;
+ constexpr bool operator==(const Val&) const { return toBool(equal); }
+ constexpr bool operator<(const Val&) const { return toBool(less); }
+ };
+
+ template<typename T> struct Cmp {
+ Val val;
+ friend T operator<=>(const Cmp&, const Cmp&) = default; // expected-note {{deleted}}
+ };
+
+ template<typename T> constexpr auto cmp(Result equal, Result less = Mu, Result reverse_less = Mu) {
+ return Cmp<T>{equal, less} <=> Cmp<T>{Mu, reverse_less};
+ }
+
+ static_assert(cmp<std::strong_ordering>(True) == 0);
+ static_assert(cmp<std::strong_ordering>(False, True) < 0);
+ static_assert(cmp<std::strong_ordering>(False, False) > 0);
+
+ static_assert(cmp<std::weak_ordering>(True) == 0);
+ static_assert(cmp<std::weak_ordering>(False, True) < 0);
+ static_assert(cmp<std::weak_ordering>(False, False) > 0);
+
+ static_assert(cmp<std::partial_ordering>(True) == 0);
+ static_assert(cmp<std::partial_ordering>(False, True) < 0);
+ static_assert(cmp<std::partial_ordering>(False, False, True) > 0);
+ static_assert(!(cmp<std::partial_ordering>(False, False, False) > 0));
+ static_assert(!(cmp<std::partial_ordering>(False, False, False) == 0));
+ static_assert(!(cmp<std::partial_ordering>(False, False, False) < 0));
+
+ // No synthesis is performed for a custom return type, even if it can be
+ // converted from a standard ordering.
+ struct custom_ordering {
+ custom_ordering(std::strong_ordering o);
+ };
+ void f(Cmp<custom_ordering> c) {
+ c <=> c; // expected-error {{deleted}}
+ }
+}
+
+namespace Preference {
+ struct A {
+ A(const A&) = delete; // expected-note {{deleted}}
+ // "usable" candidate that can't actually be called
+ friend void operator<=>(A, A); // expected-note {{passing}}
+ // Callable candidates for synthesis not considered.
+ friend bool operator==(A, A);
+ friend bool operator<(A, A);
+ };
+
+ struct B {
+ B();
+ A a;
+ std::strong_ordering operator<=>(const B&) const = default; // expected-error {{call to deleted constructor of 'Preference::A'}}
+ };
+ bool x = B() < B(); // expected-note {{in defaulted three-way comparison operator for 'Preference::B' first required here}}
+}
diff --git a/src/llvm-project/clang/test/CXX/class/class.compare/class.spaceship/p2.cpp b/src/llvm-project/clang/test/CXX/class/class.compare/class.spaceship/p2.cpp
new file mode 100644
index 0000000..dae31e9
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/class/class.compare/class.spaceship/p2.cpp
@@ -0,0 +1,157 @@
+// RUN: %clang_cc1 -std=c++2a -verify %s
+
+namespace std {
+ class strong_ordering {
+ int n;
+ constexpr strong_ordering(int n) : n(n) {}
+ public:
+ static const strong_ordering less, equal, greater;
+ bool operator!=(int) { return n != 0; }
+ };
+ constexpr strong_ordering strong_ordering::less{-1},
+ strong_ordering::equal{0}, strong_ordering::greater{1};
+
+ class weak_ordering {
+ int n;
+ constexpr weak_ordering(int n) : n(n) {}
+ public:
+ constexpr weak_ordering(strong_ordering o);
+ static const weak_ordering less, equivalent, greater;
+ bool operator!=(int) { return n != 0; }
+ };
+ constexpr weak_ordering weak_ordering::less{-1},
+ weak_ordering::equivalent{0}, weak_ordering::greater{1};
+
+ class partial_ordering {
+ int n;
+ constexpr partial_ordering(int n) : n(n) {}
+ public:
+ constexpr partial_ordering(strong_ordering o);
+ constexpr partial_ordering(weak_ordering o);
+ static const partial_ordering less, equivalent, greater, unordered;
+ bool operator!=(int) { return n != 0; }
+ };
+ constexpr partial_ordering partial_ordering::less{-1},
+ partial_ordering::equivalent{0}, partial_ordering::greater{1},
+ partial_ordering::unordered{2};
+}
+
+namespace DeducedNotCat {
+ struct A {
+ A operator<=>(const A&) const; // expected-note {{selected 'operator<=>' for member 'a' declared here}}
+ };
+ struct B {
+ A a; // expected-note {{return type 'DeducedNotCat::A' of three-way comparison for member 'a' is not a standard comparison category type}}
+ auto operator<=>(const B&) const = default; // expected-warning {{implicitly deleted}}
+ };
+}
+
+namespace DeducedVsSynthesized {
+ struct A {
+ bool operator==(const A&) const;
+ bool operator<(const A&) const;
+ };
+ struct B {
+ A a; // expected-note {{no viable comparison function for member 'a'}}
+ auto operator<=>(const B&) const = default; // expected-warning {{implicitly deleted}}
+ };
+}
+
+namespace Deduction {
+ template<typename T> struct wrap {
+ T t;
+ friend auto operator<=>(const wrap&, const wrap&) = default;
+ };
+
+ using strong = wrap<int>;
+ using strong2 = wrap<int*>;
+ struct weak {
+ friend std::weak_ordering operator<=>(weak, weak);
+ };
+ using partial = wrap<float>;
+
+ template<typename ...T> struct A : T... {
+ friend auto operator<=>(const A&, const A&) = default;
+ };
+
+ template<typename Expected, typename ...Ts> void f() {
+ using T = Expected; // expected-note {{previous}}
+ using T = decltype(A<Ts...>() <=> A<Ts...>()); // expected-error {{different type}}
+ void(A<Ts...>() <=> A<Ts...>()); // trigger synthesis of body
+ }
+
+ template void f<std::strong_ordering>();
+ template void f<std::strong_ordering, strong>();
+ template void f<std::strong_ordering, strong, strong2>();
+
+ template void f<std::weak_ordering, weak>();
+ template void f<std::weak_ordering, weak, strong>();
+ template void f<std::weak_ordering, strong, weak>();
+
+ template void f<std::partial_ordering, partial>();
+ template void f<std::partial_ordering, weak, partial>();
+ template void f<std::partial_ordering, strong, partial>();
+ template void f<std::partial_ordering, partial, weak>();
+ template void f<std::partial_ordering, partial, strong>();
+ template void f<std::partial_ordering, weak, partial, strong>();
+
+ // Check that the above mechanism works.
+ template void f<std::strong_ordering, weak>(); // expected-note {{instantiation of}}
+
+ std::strong_ordering x = A<strong>() <=> A<strong>();
+}
+
+namespace PR44723 {
+ // Make sure we trigger return type deduction for a callee 'operator<=>'
+ // before inspecting its return type.
+ template<int> struct a {
+ friend constexpr auto operator<=>(a const &lhs, a const &rhs) {
+ return std::strong_ordering::equal;
+ }
+ };
+ struct b {
+ friend constexpr auto operator<=>(b const &, b const &) = default;
+ a<0> m_value;
+ };
+ std::strong_ordering cmp_b = b() <=> b();
+
+ struct c {
+ auto operator<=>(const c&) const&; // expected-note {{selected 'operator<=>' for base class 'c' declared here}}
+ };
+ struct d : c { // expected-note {{base class 'c' declared here}}
+ friend auto operator<=>(const d&, const d&) = default; // #d
+ // expected-error@#d {{return type of defaulted 'operator<=>' cannot be deduced because three-way comparison for base class 'c' has a deduced return type and is not yet defined}}
+ // expected-warning@#d {{implicitly deleted}}
+ };
+ auto c::operator<=>(const c&) const& { // #c
+ return std::strong_ordering::equal;
+ }
+ // expected-error@+1 {{overload resolution selected deleted operator '<=>'}}
+ std::strong_ordering cmp_d = d() <=> d();
+ // expected-note@#c 2{{candidate}}
+ // expected-note@#d {{candidate function has been implicitly deleted}}
+}
+
+namespace BadDeducedType {
+ struct A {
+ // expected-error@+1 {{deduced return type for defaulted three-way comparison operator must be 'auto', not 'auto &'}}
+ friend auto &operator<=>(const A&, const A&) = default;
+ };
+
+ struct B {
+ // expected-error@+1 {{deduced return type for defaulted three-way comparison operator must be 'auto', not 'const auto'}}
+ friend const auto operator<=>(const B&, const B&) = default;
+ };
+
+ template<typename T> struct X {}; // expected-note {{here}}
+ struct C {
+ // expected-error@+1 {{deduction not allowed in function return type}}
+ friend X operator<=>(const C&, const C&) = default;
+ };
+
+ template<typename T> concept CmpCat = true;
+ struct D {
+ // expected-error@+1 {{deduced return type for defaulted three-way comparison operator must be 'auto', not 'CmpCat auto'}}
+ friend CmpCat auto operator<=>(const D&, const D&) = default;
+ };
+}
diff --git a/src/llvm-project/clang/test/CXX/class/class.compare/class.spaceship/p3.cpp b/src/llvm-project/clang/test/CXX/class/class.compare/class.spaceship/p3.cpp
new file mode 100644
index 0000000..79fce25
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/class/class.compare/class.spaceship/p3.cpp
@@ -0,0 +1,39 @@
+// RUN: %clang_cc1 -std=c++2a -verify %s
+
+namespace std {
+ struct strong_ordering {
+ int n;
+ constexpr operator int() const { return n; }
+ static const strong_ordering less, equal, greater;
+ };
+ constexpr strong_ordering strong_ordering::less{-1}, strong_ordering::equal{0}, strong_ordering::greater{1};
+}
+
+struct A {
+ int a, b[3], c;
+ std::strong_ordering operator<=>(const A&) const = default;
+};
+
+static_assert(A{1, 2, 3, 4, 5} <= A{1, 2, 3, 4, 5});
+static_assert(A{1, 2, 3, 4, 5} <= A{0, 20, 3, 4, 5}); // expected-error {{failed}}
+static_assert(A{1, 2, 3, 4, 5} <= A{1, 0, 30, 4, 5}); // expected-error {{failed}}
+static_assert(A{1, 2, 3, 4, 5} <= A{1, 2, 0, 40, 5}); // expected-error {{failed}}
+static_assert(A{1, 2, 3, 4, 5} <= A{1, 2, 3, 0, 50}); // expected-error {{failed}}
+static_assert(A{1, 2, 3, 4, 5} <= A{1, 2, 3, 4, 0}); // expected-error {{failed}}
+
+struct reverse_compare {
+ int n;
+ constexpr explicit reverse_compare(std::strong_ordering o) : n(-o.n) {}
+ constexpr operator int() const { return n; }
+};
+
+struct B {
+ int a, b[3], c;
+ friend reverse_compare operator<=>(const B&, const B&) = default;
+};
+static_assert(B{1, 2, 3, 4, 5} >= B{1, 2, 3, 4, 5});
+static_assert(B{1, 2, 3, 4, 5} >= B{0, 20, 3, 4, 5}); // expected-error {{failed}}
+static_assert(B{1, 2, 3, 4, 5} >= B{1, 0, 30, 4, 5}); // expected-error {{failed}}
+static_assert(B{1, 2, 3, 4, 5} >= B{1, 2, 0, 40, 5}); // expected-error {{failed}}
+static_assert(B{1, 2, 3, 4, 5} >= B{1, 2, 3, 0, 50}); // expected-error {{failed}}
+static_assert(B{1, 2, 3, 4, 5} >= B{1, 2, 3, 4, 0}); // expected-error {{failed}}
diff --git a/src/llvm-project/clang/test/CXX/concepts-ts/dcl.dcl/dcl.spec/dcl.spec.concept/p1.cpp b/src/llvm-project/clang/test/CXX/concepts-ts/dcl.dcl/dcl.spec/dcl.spec.concept/p1.cpp
deleted file mode 100644
index 863b608..0000000
--- a/src/llvm-project/clang/test/CXX/concepts-ts/dcl.dcl/dcl.spec/dcl.spec.concept/p1.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-// RUN: %clang_cc1 -std=c++14 -fconcepts-ts -fcxx-exceptions -x c++ -verify %s
-
-namespace A {
- template<typename T> concept bool C1() { return true; }
-
- template<typename T> concept bool C2 = true;
-}
-
-template<typename T> concept bool C3() { return (throw 0, true); }
-static_assert(noexcept(C3<int>()), "function concept should be treated as if noexcept(true) specified");
-
-template<typename T> concept bool D1(); // expected-error {{function concept declaration must be a definition}}
-
-struct B {
- template<typename T> concept bool D2() { return true; } // expected-error {{concept declarations may only appear in namespace scope}}
-};
-
-struct C {
- template<typename T> static concept bool D3 = true; // expected-error {{concept declarations may only appear in namespace scope}}
-};
-
-concept bool D4() { return true; } // expected-error {{'concept' can only appear on the definition of a function template or variable template}}
-
-concept bool D5 = true; // expected-error {{'concept' can only appear on the definition of a function template or variable template}}
-
-template<typename T>
-concept bool D6; // expected-error {{variable concept declaration must be initialized}}
-
-template<typename T>
-concept bool D7() throw(int) { return true; } // expected-error {{function concept cannot have exception specification}}
-
-// Tag
-
-concept class CC1 {}; // expected-error {{'concept' can only appear on the definition of a function template or variable template}}
-concept struct CS1 {}; // expected-error {{'concept' can only appear on the definition of a function template or variable template}}
-concept union CU1 {}; // expected-error {{'concept' can only appear on the definition of a function template or variable template}}
-concept enum CE1 {}; // expected-error {{'concept' can only appear on the definition of a function template or variable template}}
-template <typename T> concept class TCC1 {}; // expected-error {{'concept' can only appear on the definition of a function template or variable template}}
-template <typename T> concept struct TCS1 {}; // expected-error {{'concept' can only appear on the definition of a function template or variable template}}
-template <typename T> concept union TCU1 {}; // expected-error {{'concept' can only appear on the definition of a function template or variable template}}
-typedef concept int CI; // expected-error {{'concept' can only appear on the definition of a function template or variable template}}
-void fpc(concept int i) {} // expected-error {{'concept' can only appear on the definition of a function template or variable template}}
-
-concept bool; // expected-error {{'concept' can only appear on the definition of a function template or variable template}}
-
-template <typename T> concept bool VCEI{ true };
-template concept bool VCEI<int>; // expected-error {{'concept' cannot be applied on an explicit instantiation}}
-extern template concept bool VCEI<int>; // expected-error {{'concept' cannot be applied on an explicit instantiation}}
-
-template <typename T> concept bool VCPS{ true };
-template <typename T> concept bool VCPS<T *>{ true }; // expected-error {{'concept' cannot be applied on an partial specialization}}
-
-template <typename T> concept bool VCES{ true };
-template <> concept bool VCES<int>{ true }; // expected-error {{'concept' cannot be applied on an explicit specialization}}
-
-template <typename T> concept bool FCEI() { return true; }
-template concept bool FCEI<int>(); // expected-error {{'concept' cannot be applied on an explicit instantiation}}
-extern template concept bool FCEI<int>(); // expected-error {{'concept' cannot be applied on an explicit instantiation}}
-
-template <typename T> concept bool FCES() { return true; }
-template <> concept bool FCES<bool>() { return true; } // expected-error {{'concept' cannot be applied on an explicit specialization}}
diff --git a/src/llvm-project/clang/test/CXX/concepts-ts/dcl.dcl/dcl.spec/dcl.spec.concept/p2.cpp b/src/llvm-project/clang/test/CXX/concepts-ts/dcl.dcl/dcl.spec/dcl.spec.concept/p2.cpp
deleted file mode 100644
index 4779109..0000000
--- a/src/llvm-project/clang/test/CXX/concepts-ts/dcl.dcl/dcl.spec/dcl.spec.concept/p2.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-// RUN: %clang_cc1 -std=c++14 -fconcepts-ts -x c++ -verify %s
-
-template<typename T> concept thread_local bool VCTL = true; // expected-error {{variable concept cannot be declared 'thread_local'}}
-
-template<typename T> concept constexpr bool VCC = true; // expected-error {{variable concept cannot be declared 'constexpr'}}
-
-template<typename T> concept inline bool FCI() { return true; } // expected-error {{function concept cannot be declared 'inline'}}
-
-struct X {
- template<typename T> concept friend bool FCF() { return true; } // expected-error {{function concept cannot be declared 'friend'}}
-};
-
-template<typename T> concept constexpr bool FCC() { return true; } // expected-error {{function concept cannot be declared 'constexpr'}}
diff --git a/src/llvm-project/clang/test/CXX/concepts-ts/dcl.dcl/dcl.spec/dcl.spec.concept/p5.cpp b/src/llvm-project/clang/test/CXX/concepts-ts/dcl.dcl/dcl.spec/dcl.spec.concept/p5.cpp
deleted file mode 100644
index 69672ca..0000000
--- a/src/llvm-project/clang/test/CXX/concepts-ts/dcl.dcl/dcl.spec/dcl.spec.concept/p5.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-// RUN: %clang_cc1 -std=c++14 -fconcepts-ts -x c++ -verify %s
-
-template<typename T>
-concept bool fcpv(void) { return true; }
-
-template<typename T>
-concept bool fcpi(int i = 0) { return true; } // expected-error {{function concept cannot have any parameters}}
-
-template<typename... Ts>
-concept bool fcpp(Ts... ts) { return true; } // expected-error {{function concept cannot have any parameters}}
-
-template<typename T>
-concept bool fcpva(...) { return true; } // expected-error {{function concept cannot have any parameters}}
-
-template<typename T>
-concept const bool fcrtc() { return true; } // expected-error {{declared return type of function concept must be 'bool'}}
-
-template<typename T>
-concept int fcrti() { return 5; } // expected-error {{declared return type of function concept must be 'bool'}}
-
-template<typename T>
-concept float fcrtf() { return 5.5; } // expected-error {{declared return type of function concept must be 'bool'}}
-
-template<typename T>
-concept decltype(auto) fcrtd(void) { return true; } // expected-error {{declared return type of function concept must be 'bool'}}
diff --git a/src/llvm-project/clang/test/CXX/concepts-ts/dcl.dcl/dcl.spec/dcl.spec.concept/p6.cpp b/src/llvm-project/clang/test/CXX/concepts-ts/dcl.dcl/dcl.spec/dcl.spec.concept/p6.cpp
deleted file mode 100644
index f8a1bb7..0000000
--- a/src/llvm-project/clang/test/CXX/concepts-ts/dcl.dcl/dcl.spec/dcl.spec.concept/p6.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-// RUN: %clang_cc1 -std=c++14 -fconcepts-ts -x c++ -verify %s
-
-template<typename T>
-concept bool vc { true };
-
-template<typename T>
-struct B { typedef bool Boolean; };
-
-template<int N>
-B<void>::Boolean concept vctb(!0);
-
-template<typename T>
-concept const bool vctc { true }; // expected-error {{declared type of variable concept must be 'bool'}}
-
-template<typename T>
-concept int vcti { 5 }; // expected-error {{declared type of variable concept must be 'bool'}}
-
-template<typename T>
-concept float vctf { 5.5 }; // expected-error {{declared type of variable concept must be 'bool'}}
-
-template<typename T>
-concept auto vcta { true }; // expected-error {{declared type of variable concept must be 'bool'}}
-
-template<typename T>
-concept decltype(auto) vctd { true }; // expected-error {{declared type of variable concept must be 'bool'}}
diff --git a/src/llvm-project/clang/test/CXX/concepts-ts/dcl.dcl/dcl.spec/dcl.spec.concept/p7.cpp b/src/llvm-project/clang/test/CXX/concepts-ts/dcl.dcl/dcl.spec/dcl.spec.concept/p7.cpp
deleted file mode 100644
index 1bad6bb..0000000
--- a/src/llvm-project/clang/test/CXX/concepts-ts/dcl.dcl/dcl.spec/dcl.spec.concept/p7.cpp
+++ /dev/null
@@ -1,18 +0,0 @@
-// RUN: %clang_cc1 -std=c++14 -fconcepts-ts -x c++ -verify %s
-
-template <typename T> concept bool FCEI() { return true; } // expected-note {{previous declaration is here}} expected-note {{previous declaration is here}}
-template bool FCEI<int>(); // expected-error {{function concept cannot be explicitly instantiated}}
-extern template bool FCEI<double>(); // expected-error {{function concept cannot be explicitly instantiated}}
-
-template <typename T> concept bool FCES() { return true; } // expected-note {{previous declaration is here}}
-template <> bool FCES<int>() { return true; } // expected-error {{function concept cannot be explicitly specialized}}
-
-template <typename T> concept bool VC { true }; // expected-note {{previous declaration is here}} expected-note {{previous declaration is here}}
-template bool VC<int>; // expected-error {{variable concept cannot be explicitly instantiated}}
-extern template bool VC<double>; // expected-error {{variable concept cannot be explicitly instantiated}}
-
-template <typename T> concept bool VCES { true }; // expected-note {{previous declaration is here}}
-template <> bool VCES<int> { true }; // expected-error {{variable concept cannot be explicitly specialized}}
-
-template <typename T> concept bool VCPS { true }; // expected-note {{previous declaration is here}}
-template <typename T> bool VCPS<T *> { true }; // expected-error {{variable concept cannot be partially specialized}}
diff --git a/src/llvm-project/clang/test/CXX/concepts-ts/dcl.dcl/lit.cfg.py b/src/llvm-project/clang/test/CXX/concepts-ts/dcl.dcl/lit.cfg.py
deleted file mode 100644
index c705e3c..0000000
--- a/src/llvm-project/clang/test/CXX/concepts-ts/dcl.dcl/lit.cfg.py
+++ /dev/null
@@ -1,26 +0,0 @@
-# -*- Python -*-
-
-import os
-import lit.formats
-
-from lit.llvm import llvm_config
-
-# Configuration file for the 'lit' test runner.
-
-# name: The name of this test suite.
-config.name = 'Clang-Concepts-TS-Unsupported'
-
-# testFormat: The test format to use to interpret tests.
-#
-# For now we require '&&' between commands, until they get globally killed and
-# the test runner updated.
-config.test_format = lit.formats.ShTest(not llvm_config.use_lit_shell)
-
-# suffixes: A list of file extensions to treat as test files.
-config.suffixes = ['.c', '.cpp', '.cppm', '.m', '.mm', '.cu',
- '.ll', '.cl', '.s', '.S', '.modulemap', '.test', '.rs']
-
-config.unsupported = True
-
-# test_source_root: The root path where tests are located.
-config.test_source_root = os.path.dirname(__file__)
diff --git a/src/llvm-project/clang/test/CXX/concepts-ts/expr/expr.prim/expr.prim.id/p3.cpp b/src/llvm-project/clang/test/CXX/concepts-ts/expr/expr.prim/expr.prim.id/p3.cpp
deleted file mode 100644
index 16da146..0000000
--- a/src/llvm-project/clang/test/CXX/concepts-ts/expr/expr.prim/expr.prim.id/p3.cpp
+++ /dev/null
@@ -1,4 +0,0 @@
-// RUN: %clang_cc1 -std=c++2a -fconcepts-ts -verify %s
-
-template<typename T> concept C = true;
-static_assert(C<int>); // expected-error{{sorry, unimplemented concepts feature concept specialization used}}
diff --git a/src/llvm-project/clang/test/CXX/concepts-ts/temp/temp.constr/temp.constr.decl/class-template-decl.cpp b/src/llvm-project/clang/test/CXX/concepts-ts/temp/temp.constr/temp.constr.decl/class-template-decl.cpp
deleted file mode 100644
index d1ad040..0000000
--- a/src/llvm-project/clang/test/CXX/concepts-ts/temp/temp.constr/temp.constr.decl/class-template-decl.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-// RUN: %clang_cc1 -std=c++14 -fconcepts-ts -x c++ -verify %s
-
-namespace nodiag {
-
-template <typename T> requires bool(T())
-struct A;
-template <typename U> requires bool(U())
-struct A;
-
-} // end namespace nodiag
-
-namespace diag {
-
-template <typename T> requires true // expected-note{{previous template declaration is here}}
-struct A;
-template <typename T> struct A; // expected-error{{associated constraints differ in template redeclaration}}
-
-template <typename T> struct B; // expected-note{{previous template declaration is here}}
-template <typename T> requires true // expected-error{{associated constraints differ in template redeclaration}}
-struct B;
-
-template <typename T> requires true // expected-note{{previous template declaration is here}}
-struct C;
-template <typename T> requires !0 // expected-error{{associated constraints differ in template redeclaration}}
-struct C;
-
-} // end namespace diag
-
-namespace nodiag {
-
-struct AA {
- template <typename T> requires someFunc(T())
- struct A;
-};
-
-template <typename T> requires someFunc(T())
-struct AA::A { };
-
-struct AAF {
- template <typename T> requires someFunc(T())
- friend struct AA::A;
-};
-
-} // end namespace nodiag
-
-namespace diag {
-
-template <unsigned N>
-struct TA {
- template <template <unsigned> class TT> requires TT<N>::happy // expected-note 2{{previous template declaration is here}}
- struct A;
-
- struct AF;
-};
-
-template <unsigned N>
-template <template <unsigned> class TT> struct TA<N>::A { }; // expected-error{{associated constraints differ in template redeclaration}}
-
-template <unsigned N>
-struct TA<N>::AF {
- template <template <unsigned> class TT> requires TT<N + 0>::happy // expected-error{{associated constraints differ in template redeclaration}}
- friend struct TA::A;
-};
-
-} // end namespace diag
diff --git a/src/llvm-project/clang/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p15.cpp b/src/llvm-project/clang/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p15.cpp
index 0c58da0..d64807e 100644
--- a/src/llvm-project/clang/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p15.cpp
+++ b/src/llvm-project/clang/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p15.cpp
@@ -8,7 +8,7 @@
B2(int); // expected-note {{candidate}}
};
-struct D1 : B1, B2 { // expected-note 2{{candidate}}
+struct D1 : B1, B2 {
using B1::B1; // expected-note {{inherited here}}
using B2::B2; // expected-note {{inherited here}}
};
@@ -35,11 +35,11 @@
operator D&&();
};
- struct A { // expected-note 2{{candidate}}
+ struct A {
A(); // expected-note {{candidate}}
- A(C &&); // expected-note {{candidate}}
- C &operator=(C&&); // expected-note {{candidate}}
+ A(C &&);
+ C &operator=(C&&);
A(D &&);
D &operator=(D&&); // expected-note {{candidate}}
@@ -47,11 +47,11 @@
A(convert_to_D2); // expected-note {{candidate}}
};
- struct B { // expected-note 2{{candidate}}
+ struct B {
B(); // expected-note {{candidate}}
- B(C &&); // expected-note {{candidate}}
- C &operator=(C&&); // expected-note {{candidate}}
+ B(C &&);
+ C &operator=(C&&);
B(D &&);
D &operator=(D&&); // expected-note {{candidate}}
@@ -66,14 +66,14 @@
using B::operator=;
};
struct D : A, B {
- using A::A; // expected-note 3{{inherited here}}
+ using A::A; // expected-note 2{{inherited here}}
using A::operator=;
- using B::B; // expected-note 3{{inherited here}}
+ using B::B; // expected-note 2{{inherited here}}
using B::operator=;
D(int);
- D(const D&); // expected-note {{candidate}}
- D &operator=(const D&); // expected-note {{candidate}}
+ D(const D&);
+ D &operator=(const D&);
};
C c;
diff --git a/src/llvm-project/clang/test/CXX/dcl.dcl/dcl.attr/dcl.attr.nodiscard/p1.cpp b/src/llvm-project/clang/test/CXX/dcl.dcl/dcl.attr/dcl.attr.nodiscard/p1.cpp
index 4425416..4591195 100644
--- a/src/llvm-project/clang/test/CXX/dcl.dcl/dcl.attr/dcl.attr.nodiscard/p1.cpp
+++ b/src/llvm-project/clang/test/CXX/dcl.dcl/dcl.attr/dcl.attr.nodiscard/p1.cpp
@@ -1,8 +1,8 @@
-// RUN: %clang_cc1 -fsyntax-only -std=c++1z -verify %s
+// RUN: %clang_cc1 -fsyntax-only -std=c++2a -verify %s
struct [[nodiscard]] S1 {}; // ok
struct [[nodiscard nodiscard]] S2 {}; // expected-error {{attribute 'nodiscard' cannot appear multiple times in an attribute specifier}}
-struct [[nodiscard("Wrong")]] S3 {}; // expected-error {{'nodiscard' cannot have an argument list}}
+struct [[nodiscard("Wrong")]] S3 {};
[[nodiscard]] int f();
enum [[nodiscard]] E {};
diff --git a/src/llvm-project/clang/test/CXX/dcl.dcl/dcl.attr/dcl.attr.nodiscard/p2.cpp b/src/llvm-project/clang/test/CXX/dcl.dcl/dcl.attr/dcl.attr.nodiscard/p2.cpp
index 43de934..3d3223c 100644
--- a/src/llvm-project/clang/test/CXX/dcl.dcl/dcl.attr/dcl.attr.nodiscard/p2.cpp
+++ b/src/llvm-project/clang/test/CXX/dcl.dcl/dcl.attr/dcl.attr.nodiscard/p2.cpp
@@ -1,5 +1,6 @@
+// RUN: %clang_cc1 -fsyntax-only -std=c++20 -verify -Wc++20-extensions %s
// RUN: %clang_cc1 -fsyntax-only -std=c++17 -verify -Wc++17-extensions %s
-// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify -DEXT -Wc++17-extensions %s
+// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify -DEXT -Wc++17-extensions -Wc++20-extensions %s
struct [[nodiscard]] S {};
S get_s();
@@ -61,10 +62,83 @@
}
} // namespace PR31526
+struct [[nodiscard("reason")]] ReasonStruct {};
+struct LaterReason;
+struct [[nodiscard("later reason")]] LaterReason {};
+
+ReasonStruct get_reason();
+LaterReason get_later_reason();
+[[nodiscard("another reason")]] int another_reason();
+
+[[nodiscard("conflicting reason")]] int conflicting_reason();
+[[nodiscard("special reason")]] int conflicting_reason();
+
+void cxx20_use() {
+ get_reason(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute: reason}}
+ get_later_reason(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute: later reason}}
+ another_reason(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute: another reason}}
+ conflicting_reason(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute: special reason}}
+}
+
+namespace p1771 {
+struct[[nodiscard("Don't throw me away!")]] ConvertTo{};
+struct S {
+ [[nodiscard]] S();
+ [[nodiscard("Don't let that S-Char go!")]] S(char);
+ S(int);
+ [[gnu::warn_unused_result]] S(double);
+ operator ConvertTo();
+ [[nodiscard]] operator int();
+ [[nodiscard("Don't throw away as a double")]] operator double();
+};
+
+struct[[nodiscard("Don't throw me away either!")]] Y{};
+
+void usage() {
+ S(); // expected-warning {{ignoring temporary created by a constructor declared with 'nodiscard' attribute}}
+ S('A'); // expected-warning {{ignoring temporary created by a constructor declared with 'nodiscard' attribute: Don't let that S-Char go!}}
+ S(1);
+ S(2.2);
+ Y(); // expected-warning {{ignoring temporary created by a constructor declared with 'nodiscard' attribute: Don't throw me away either!}}
+ S s;
+ ConvertTo{}; // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute: Don't throw me away!}}
+
+// AST is different in C++20 mode, pre-2017 a move ctor for ConvertTo is there
+// as well, hense the constructor warning.
+#if __cplusplus >= 201703L
+// expected-warning@+4 {{ignoring return value of function declared with 'nodiscard' attribute: Don't throw me away!}}
+#else
+// expected-warning@+2 {{ignoring temporary created by a constructor declared with 'nodiscard' attribute: Don't throw me away!}}
+#endif
+ (ConvertTo) s;
+ (int)s; // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ (S)'c'; // expected-warning {{ignoring temporary created by a constructor declared with 'nodiscard' attribute: Don't let that S-Char go!}}
+#if __cplusplus >= 201703L
+// expected-warning@+4 {{ignoring return value of function declared with 'nodiscard' attribute: Don't throw me away!}}
+#else
+// expected-warning@+2 {{ignoring temporary created by a constructor declared with 'nodiscard' attribute: Don't throw me away!}}
+#endif
+ static_cast<ConvertTo>(s);
+ static_cast<int>(s); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ static_cast<double>(s); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute: Don't throw away as a double}}
+}
+}; // namespace p1771
+
#ifdef EXT
-// expected-warning@4 {{use of the 'nodiscard' attribute is a C++17 extension}}
-// expected-warning@8 {{use of the 'nodiscard' attribute is a C++17 extension}}
-// expected-warning@11 {{use of the 'nodiscard' attribute is a C++17 extension}}
+// expected-warning@5 {{use of the 'nodiscard' attribute is a C++17 extension}}
+// expected-warning@9 {{use of the 'nodiscard' attribute is a C++17 extension}}
// expected-warning@12 {{use of the 'nodiscard' attribute is a C++17 extension}}
-// expected-warning@28 {{use of the 'nodiscard' attribute is a C++17 extension}}
+// expected-warning@13 {{use of the 'nodiscard' attribute is a C++17 extension}}
+// expected-warning@29 {{use of the 'nodiscard' attribute is a C++17 extension}}
+// expected-warning@65 {{use of the 'nodiscard' attribute is a C++20 extension}}
+// expected-warning@67 {{use of the 'nodiscard' attribute is a C++20 extension}}
+// expected-warning@71 {{use of the 'nodiscard' attribute is a C++20 extension}}
+// expected-warning@73 {{use of the 'nodiscard' attribute is a C++20 extension}}
+// expected-warning@74 {{use of the 'nodiscard' attribute is a C++20 extension}}
+// expected-warning@84 {{use of the 'nodiscard' attribute is a C++20 extension}}
+// expected-warning@86 {{use of the 'nodiscard' attribute is a C++17 extension}}
+// expected-warning@87 {{use of the 'nodiscard' attribute is a C++20 extension}}
+// expected-warning@91 {{use of the 'nodiscard' attribute is a C++17 extension}}
+// expected-warning@92 {{use of the 'nodiscard' attribute is a C++20 extension}}
+// expected-warning@95 {{use of the 'nodiscard' attribute is a C++20 extension}}
#endif
diff --git a/src/llvm-project/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/dtor.cpp b/src/llvm-project/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/dtor.cpp
new file mode 100644
index 0000000..3d45949
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/dtor.cpp
@@ -0,0 +1,68 @@
+// RUN: %clang_cc1 -std=c++2a -verify %s
+
+// p3: if the function is a constructor or destructor, its class shall not have
+// any virtual base classes;
+namespace vbase {
+ struct A {};
+ struct B : virtual A { // expected-note {{virtual}}
+ constexpr ~B() {} // expected-error {{constexpr member function not allowed in struct with virtual base class}}
+ };
+}
+
+// p3: its function-body shall not enclose
+// -- a goto statement
+// -- an identifier label
+// -- a variable of non-literal type or of static or thread storage duration
+namespace contents {
+ struct A {
+ constexpr ~A() {
+ goto x; // expected-error {{statement not allowed in constexpr function}}
+ x: ;
+ }
+ };
+ struct B {
+ constexpr ~B() {
+ x: ; // expected-error {{statement not allowed in constexpr function}}
+ }
+ };
+ struct Nonlit { Nonlit(); }; // expected-note {{not literal}}
+ struct C {
+ constexpr ~C() {
+ Nonlit nl; // expected-error {{non-literal}}
+ }
+ };
+ struct D {
+ constexpr ~D() {
+ static int a; // expected-error {{static variable}}
+ }
+ };
+ struct E {
+ constexpr ~E() {
+ thread_local int e; // expected-error {{thread_local variable}}
+ }
+ };
+ struct F {
+ constexpr ~F() {
+ extern int f;
+ }
+ };
+}
+
+// p5: for every subobject of class type or (possibly multi-dimensional) array
+// thereof, that class type shall have a constexpr destructor
+namespace subobject {
+ struct A {
+ ~A();
+ };
+ struct B : A { // expected-note {{here}}
+ constexpr ~B() {} // expected-error {{destructor cannot be declared constexpr because base class 'subobject::A' does not have a constexpr destructor}}
+ };
+ struct C {
+ A a; // expected-note {{here}}
+ constexpr ~C() {} // expected-error {{destructor cannot be declared constexpr because data member 'a' does not have a constexpr destructor}}
+ };
+ struct D : A {
+ A a;
+ constexpr ~D() = delete;
+ };
+}
diff --git a/src/llvm-project/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p1.cpp b/src/llvm-project/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p1.cpp
index 5a4c5c9..59e3dcf 100644
--- a/src/llvm-project/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p1.cpp
+++ b/src/llvm-project/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p1.cpp
@@ -1,6 +1,11 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
-// RUN: %clang_cc1 -fsyntax-only -verify -std=c++14 %s
-// RUN: %clang_cc1 -fsyntax-only -verify -std=c++1z %s
+// RUN: %clang_cc1 -triple %itanium_abi_triple -fsyntax-only -verify -std=c++11 %s
+// RUN: %clang_cc1 -triple %itanium_abi_triple -fsyntax-only -verify -std=c++14 %s
+// RUN: %clang_cc1 -triple %itanium_abi_triple -fsyntax-only -verify -std=c++17 %s
+// RUN: %clang_cc1 -triple %itanium_abi_triple -fsyntax-only -verify -std=c++2a %s
+
+// MSVC always adopted the C++17 rule that implies that constexpr variables are
+// implicitly inline, so do the test again.
+// RUN: %clang_cc1 -triple x86_64-windows-msvc -DMS_ABI -fsyntax-only -verify -std=c++11 %s
struct notlit { // expected-note {{not literal because}}
notlit() {}
@@ -29,7 +34,7 @@
struct s2 {
constexpr int mi1; // expected-error {{non-static data member cannot be constexpr; did you intend to make it const?}}
static constexpr int mi2;
-#if __cplusplus <= 201402L
+#if __cplusplus <= 201402L && !defined(MS_ABI)
// expected-error@-2 {{requires an initializer}}
#else
// expected-error@-4 {{default initialization of an object of const}}
@@ -71,7 +76,10 @@
template<typename T> constexpr T f6(T); // expected-error {{constexpr declaration of 'f6' follows non-constexpr declaration}}
// destructor
struct ConstexprDtor {
- constexpr ~ConstexprDtor() = default; // expected-error {{destructor cannot be marked constexpr}}
+ constexpr ~ConstexprDtor() = default;
+#if __cplusplus <= 201703L
+ // expected-error@-2 {{destructor cannot be declared constexpr}}
+#endif
};
// template stuff
diff --git a/src/llvm-project/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p3.cpp b/src/llvm-project/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p3.cpp
index cc39170..9b0e7cc 100644
--- a/src/llvm-project/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p3.cpp
+++ b/src/llvm-project/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p3.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -verify -fcxx-exceptions -triple=x86_64-linux-gnu -std=c++11 -Werror=c++1y-extensions -Werror=c++2a-extensions %s
-// RUN: %clang_cc1 -verify -fcxx-exceptions -triple=x86_64-linux-gnu -std=c++1y -DCXX1Y -Werror=c++2a-extensions %s
-// RUN: %clang_cc1 -verify -fcxx-exceptions -triple=x86_64-linux-gnu -std=c++2a -DCXX1Y -DCXX2A %s
+// RUN: %clang_cc1 -verify -fcxx-exceptions -triple=x86_64-linux-gnu -std=c++11 -Werror=c++14-extensions -Werror=c++20-extensions %s
+// RUN: %clang_cc1 -verify -fcxx-exceptions -triple=x86_64-linux-gnu -std=c++14 -DCXX14 -Werror=c++20-extensions %s
+// RUN: %clang_cc1 -verify -fcxx-exceptions -triple=x86_64-linux-gnu -std=c++20 -DCXX14 -DCXX20 %s
namespace N {
typedef char C;
@@ -54,10 +54,13 @@
// - its return type shall be a literal type;
constexpr NonLiteral NonLiteralReturn() const { return {}; } // expected-error {{constexpr function's return type 'NonLiteral' is not a literal type}}
constexpr void VoidReturn() const { return; }
-#ifndef CXX1Y
+#ifndef CXX14
// expected-error@-2 {{constexpr function's return type 'void' is not a literal type}}
#endif
- constexpr ~T(); // expected-error {{destructor cannot be marked constexpr}}
+ constexpr ~T();
+#ifndef CXX20
+ // expected-error@-2 {{destructor cannot be declared constexpr}}
+#endif
typedef NonLiteral F() const;
constexpr F NonLiteralReturn2; // ok until definition
@@ -75,7 +78,7 @@
// don't have a literal return type. Defaulted assignment operators can't be
// constexpr since they can't be const.
constexpr T &operator=(const T&) = default;
-#ifndef CXX1Y
+#ifndef CXX14
// expected-error@-2 {{an explicitly-defaulted copy assignment operator may not have 'const', 'constexpr' or 'volatile' qualifiers}}
// expected-warning@-3 {{C++14}}
#else
@@ -84,14 +87,14 @@
};
constexpr int T::OutOfLineVirtual() const { return 0; }
-#ifdef CXX1Y
+#ifdef CXX14
struct T2 {
int n = 0;
constexpr T2 &operator=(const T2&) = default; // ok
};
struct T3 {
constexpr T3 &operator=(const T3&) const = default;
-#ifndef CXX2A
+#ifndef CXX20
// expected-error@-2 {{an explicitly-defaulted copy assignment operator may not have 'const' or 'volatile' qualifiers}}
#else
// expected-warning@-4 {{explicitly defaulted copy assignment operator is implicitly deleted}}
@@ -135,81 +138,85 @@
return sizeof(K) + sizeof(C) + sizeof(K);
}
-// or a compound-statement that does not contain [CXX1Y]
-constexpr int DisallowedStmtsCXX1Y_1() {
+// or a compound-statement that does not contain [C++14]
+constexpr int DisallowedStmtsCXX14_1(bool b) {
// - an asm-definition
- asm("int3"); // expected-error {{statement not allowed in constexpr function}}
+ if (b)
+ asm("int3");
+#if !defined(CXX20)
+ // expected-error@-2 {{use of this statement in a constexpr function is a C++20 extension}}
+#endif
return 0;
}
-constexpr int DisallowedStmtsCXX1Y_2() {
+constexpr int DisallowedStmtsCXX14_2() {
// - a goto statement
goto x; // expected-error {{statement not allowed in constexpr function}}
x:
return 0;
}
-constexpr int DisallowedStmtsCXX1Y_2_1() {
+constexpr int DisallowedStmtsCXX14_2_1() {
try {
return 0;
} catch (...) {
merp: goto merp; // expected-error {{statement not allowed in constexpr function}}
}
}
-constexpr int DisallowedStmtsCXX1Y_3() {
+constexpr int DisallowedStmtsCXX14_3() {
// - a try-block,
try {} catch (...) {}
-#ifndef CXX2A
- // expected-error@-2 {{use of this statement in a constexpr function is a C++2a extension}}
-#ifndef CXX1Y
- // expected-error@-4 {{use of this statement in a constexpr function is a C++14 extension}}
-#endif
+#if !defined(CXX20)
+ // expected-error@-2 {{use of this statement in a constexpr function is a C++20 extension}}
#endif
return 0;
}
-constexpr int DisallowedStmtsCXX1Y_4() {
+constexpr int DisallowedStmtsCXX14_4() {
// - a definition of a variable of non-literal type
NonLiteral nl; // expected-error {{variable of non-literal type 'NonLiteral' cannot be defined in a constexpr function}}
return 0;
}
-constexpr int DisallowedStmtsCXX1Y_5() {
+constexpr int DisallowedStmtsCXX14_5() {
// - a definition of a variable of static storage duration
static constexpr int n = 123; // expected-error {{static variable not permitted in a constexpr function}}
return n;
}
-constexpr int DisallowedStmtsCXX1Y_6() {
+constexpr int DisallowedStmtsCXX14_6() {
// - a definition of a variable of thread storage duration
thread_local constexpr int n = 123; // expected-error {{thread_local variable not permitted in a constexpr function}}
return n;
}
-constexpr int DisallowedStmtsCXX1Y_7() {
+constexpr int DisallowedStmtsCXX14_7() {
// - a definition of a variable for which no initialization is performed
- int n; // expected-error {{variables defined in a constexpr function must be initialized}}
+ int n;
+#ifndef CXX20
+ // expected-error@-2 {{uninitialized variable in a constexpr function}}
+#endif
return 0;
}
constexpr int ForStmt() {
for (int n = 0; n < 10; ++n)
-#ifndef CXX1Y
+#ifndef CXX14
// expected-error@-2 {{statement not allowed in constexpr function}}
#endif
return 0;
}
constexpr int VarDecl() {
int a = 0;
-#ifndef CXX1Y
+#ifndef CXX14
// expected-error@-2 {{variable declaration in a constexpr function is a C++14 extension}}
#endif
return 0;
}
constexpr int ConstexprVarDecl() {
constexpr int a = 0;
-#ifndef CXX1Y
+#ifndef CXX14
// expected-error@-2 {{variable declaration in a constexpr function is a C++14 extension}}
#endif
return 0;
}
constexpr int VarWithCtorDecl() {
Literal a;
-#ifndef CXX1Y
+#ifndef CXX14
// expected-error@-2 {{variable declaration in a constexpr function is a C++14 extension}}
#endif
return 0;
@@ -217,7 +224,7 @@
NonLiteral nl;
constexpr NonLiteral &ExternNonLiteralVarDecl() {
extern NonLiteral nl;
-#ifndef CXX1Y
+#ifndef CXX14
// expected-error@-2 {{variable declaration in a constexpr function is a C++14 extension}}
#endif
return nl;
@@ -225,28 +232,28 @@
static_assert(&ExternNonLiteralVarDecl() == &nl, "");
constexpr int FuncDecl() {
constexpr int ForwardDecl(int);
-#ifndef CXX1Y
+#ifndef CXX14
// expected-error@-2 {{use of this statement in a constexpr function is a C++14 extension}}
#endif
return ForwardDecl(42);
}
constexpr int ClassDecl1() {
typedef struct { } S1;
-#ifndef CXX1Y
+#ifndef CXX14
// expected-error@-2 {{type definition in a constexpr function is a C++14 extension}}
#endif
return 0;
}
constexpr int ClassDecl2() {
using S2 = struct { };
-#ifndef CXX1Y
+#ifndef CXX14
// expected-error@-2 {{type definition in a constexpr function is a C++14 extension}}
#endif
return 0;
}
constexpr int ClassDecl3() {
struct S3 { };
-#ifndef CXX1Y
+#ifndef CXX14
// expected-error@-2 {{type definition in a constexpr function is a C++14 extension}}
#endif
return 0;
@@ -255,7 +262,7 @@
constexpr int MultiReturn() {
return 0;
return 0;
-#ifndef CXX1Y
+#ifndef CXX14
// expected-error@-2 {{multiple return statements in constexpr function}}
// expected-note@-4 {{return statement}}
#endif
@@ -303,7 +310,7 @@
}
constexpr int abs(int x) {
if (x < 0)
-#ifndef CXX1Y
+#ifndef CXX14
// expected-error@-2 {{C++14}}
#endif
x = -x;
@@ -314,13 +321,16 @@
return value;
}
constexpr int uninit() {
- int a; // expected-error {{must be initialized}}
+ int a;
+#ifndef CXX20
+ // expected-error@-2 {{uninitialized}}
+#endif
return a;
}
constexpr int prev(int x) {
return --x;
}
-#ifndef CXX1Y
+#ifndef CXX14
// expected-error@-4 {{never produces a constant expression}}
// expected-note@-4 {{subexpression}}
#endif
@@ -329,7 +339,7 @@
while (--n > 0) r *= x;
return r;
}
-#ifndef CXX1Y
+#ifndef CXX14
// expected-error@-5 {{C++14}}
// expected-error@-5 {{statement not allowed}}
#endif
diff --git a/src/llvm-project/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p4.cpp b/src/llvm-project/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p4.cpp
index 1775360..aed2f29 100644
--- a/src/llvm-project/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p4.cpp
+++ b/src/llvm-project/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p4.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -verify -std=c++11 -fcxx-exceptions -Werror=c++1y-extensions -Werror=c++2a-extensions %s
-// RUN: %clang_cc1 -verify -std=c++1y -fcxx-exceptions -DCXX1Y -Werror=c++2a-extensions %s
-// RUN: %clang_cc1 -verify -std=c++2a -fcxx-exceptions -DCXX1Y -DCXX2A %s
+// RUN: %clang_cc1 -verify -std=c++11 -fcxx-exceptions -Werror=c++14-extensions -Werror=c++20-extensions %s
+// RUN: %clang_cc1 -verify -std=c++14 -fcxx-exceptions -DCXX14 -Werror=c++20-extensions %s
+// RUN: %clang_cc1 -verify -std=c++20 -fcxx-exceptions -DCXX14 -DCXX2A %s
namespace N {
typedef char C;
@@ -52,10 +52,10 @@
constexpr U()
try
#ifndef CXX2A
- // expected-error@-2 {{function try block in constexpr constructor is a C++2a extension}}
+ // expected-error@-2 {{function try block in constexpr constructor is a C++20 extension}}
#endif
: u() {
-#ifndef CXX1Y
+#ifndef CXX14
// expected-error@-2 {{use of this statement in a constexpr constructor is a C++14 extension}}
#endif
} catch (...) {
@@ -92,43 +92,43 @@
constexpr V(int(&)[1]) {
for (int n = 0; n < 10; ++n)
/**/;
-#ifndef CXX1Y
+#ifndef CXX14
// expected-error@-3 {{statement not allowed in constexpr constructor}}
#endif
}
constexpr V(int(&)[2]) {
constexpr int a = 0;
-#ifndef CXX1Y
+#ifndef CXX14
// expected-error@-2 {{variable declaration in a constexpr constructor is a C++14 extension}}
#endif
}
constexpr V(int(&)[3]) {
constexpr int ForwardDecl(int);
-#ifndef CXX1Y
+#ifndef CXX14
// expected-error@-2 {{use of this statement in a constexpr constructor is a C++14 extension}}
#endif
}
constexpr V(int(&)[4]) {
typedef struct { } S1;
-#ifndef CXX1Y
+#ifndef CXX14
// expected-error@-2 {{type definition in a constexpr constructor is a C++14 extension}}
#endif
}
constexpr V(int(&)[5]) {
using S2 = struct { };
-#ifndef CXX1Y
+#ifndef CXX14
// expected-error@-2 {{type definition in a constexpr constructor is a C++14 extension}}
#endif
}
constexpr V(int(&)[6]) {
struct S3 { };
-#ifndef CXX1Y
+#ifndef CXX14
// expected-error@-2 {{type definition in a constexpr constructor is a C++14 extension}}
#endif
}
constexpr V(int(&)[7]) {
return;
-#ifndef CXX1Y
+#ifndef CXX14
// expected-error@-2 {{use of this statement in a constexpr constructor is a C++14 extension}}
#endif
}
@@ -136,29 +136,33 @@
// - every non-static data member and base class sub-object shall be initialized
struct W {
- int n; // expected-note {{member not initialized by constructor}}
- constexpr W() {} // expected-error {{constexpr constructor must initialize all members}}
+ int n;
+ constexpr W() {}
+#ifndef CXX2A
+ // expected-error@-2 {{constexpr constructor that does not initialize all members}}
+ // expected-note@-4 {{member not initialized by constructor}}
+#endif
};
struct AnonMembers {
- int a; // expected-note {{member not initialized by constructor}}
- union { // expected-note 2{{member not initialized by constructor}}
+ int a; // expected-note 0-1{{member not initialized by constructor}}
+ union { // expected-note 0-2{{member not initialized by constructor}}
char b;
struct {
double c;
- long d; // expected-note {{member not initialized by constructor}}
+ long d; // expected-note 0-1{{member not initialized by constructor}}
};
union {
char e;
void *f;
};
};
- struct { // expected-note {{member not initialized by constructor}}
+ struct { // expected-note 0-1{{member not initialized by constructor}}
long long g;
struct {
- int h; // expected-note {{member not initialized by constructor}}
- double i; // expected-note {{member not initialized by constructor}}
+ int h; // expected-note 0-1{{member not initialized by constructor}}
+ double i; // expected-note 0-1{{member not initialized by constructor}}
};
- union { // expected-note 2{{member not initialized by constructor}}
+ union { // expected-note 0-2{{member not initialized by constructor}}
char *j;
AnonMembers *k;
};
@@ -166,14 +170,26 @@
constexpr AnonMembers(int(&)[1]) : a(), b(), g(), h(), i(), j() {} // ok
// missing d, i, j/k union
- constexpr AnonMembers(int(&)[2]) : a(), c(), g(), h() {} // expected-error {{constexpr constructor must initialize all members}}
+ constexpr AnonMembers(int(&)[2]) : a(), c(), g(), h() {}
+#ifndef CXX2A
+ // expected-error@-2 {{constexpr constructor that does not initialize all members}}
+#endif
constexpr AnonMembers(int(&)[3]) : a(), e(), g(), h(), i(), k() {} // ok
// missing h, j/k union
- constexpr AnonMembers(int(&)[4]) : a(), c(), d(), g(), i() {} // expected-error {{constexpr constructor must initialize all members}}
+ constexpr AnonMembers(int(&)[4]) : a(), c(), d(), g(), i() {}
+#ifndef CXX2A
+ // expected-error@-2 {{constexpr constructor that does not initialize all members}}
+#endif
// missing b/c/d/e/f union
- constexpr AnonMembers(int(&)[5]) : a(), g(), h(), i(), k() {} // expected-error {{constexpr constructor must initialize all members}}
+ constexpr AnonMembers(int(&)[5]) : a(), g(), h(), i(), k() {}
+#ifndef CXX2A
+ // expected-error@-2 {{constexpr constructor that does not initialize all members}}
+#endif
// missing a, b/c/d/e/f union, g/h/i/j/k struct
- constexpr AnonMembers(int(&)[6]) {} // expected-error {{constexpr constructor must initialize all members}}
+ constexpr AnonMembers(int(&)[6]) {}
+#ifndef CXX2A
+ // expected-error@-2 {{constexpr constructor that does not initialize all members}}
+#endif
};
union Empty {
@@ -253,14 +269,20 @@
constexpr X(int c) : a(c) {} // ok, b initialized by 2 * c + 1
};
-union XU1 { int a; constexpr XU1() = default; }; // expected-error{{not constexpr}}
+union XU1 { int a; constexpr XU1() = default; };
+#ifndef CXX2A
+// expected-error@-2{{not constexpr}}
+#endif
union XU2 { int a = 1; constexpr XU2() = default; };
struct XU3 {
union {
int a;
};
- constexpr XU3() = default; // expected-error{{not constexpr}}
+ constexpr XU3() = default;
+#ifndef CXX2A
+ // expected-error@-2{{not constexpr}}
+#endif
};
struct XU4 {
union {
diff --git a/src/llvm-project/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p9.cpp b/src/llvm-project/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p9.cpp
index 0aaedcc..8d51dbd 100644
--- a/src/llvm-project/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p9.cpp
+++ b/src/llvm-project/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p9.cpp
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++2a %s
// A constexpr specifier used in an object declaration declares the object as
// const.
@@ -35,3 +36,19 @@
};
constexpr pixel ur = { 1294, 1024 }; // ok
constexpr pixel origin; // expected-error {{default initialization of an object of const type 'const pixel' without a user-provided default constructor}}
+
+#if __cplusplus > 201702L
+// A constexpr variable shall have constant destruction.
+struct A {
+ bool ok;
+ constexpr A(bool ok) : ok(ok) {}
+ constexpr ~A() noexcept(false) {
+ void oops(); // expected-note 2{{declared here}}
+ if (!ok) oops(); // expected-note 2{{non-constexpr function}}
+ }
+};
+
+constexpr A const_dtor(true);
+constexpr A non_const_dtor(false); // expected-error {{must have constant destruction}} expected-note {{in call}}
+constexpr A arr_dtor[5] = {true, true, true, false, true}; // expected-error {{must have constant destruction}} expected-note {{in call to '&arr_dtor[3]->~A()'}}
+#endif
diff --git a/src/llvm-project/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constinit/p1.cpp b/src/llvm-project/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constinit/p1.cpp
new file mode 100644
index 0000000..170c8c7
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constinit/p1.cpp
@@ -0,0 +1,55 @@
+// RUN: %clang_cc1 -std=c++2a -verify %s
+
+constinit int a;
+constinit thread_local int b;
+constinit static int c;
+
+void f() {
+ constinit static int a;
+ constinit thread_local int b;
+ constinit int c; // expected-error {{local variable cannot be declared 'constinit'}}
+}
+
+namespace missing {
+ int a; // expected-note {{add the 'constinit' specifier}}
+ extern constinit int a; // expected-error {{added after initialization}}
+
+ // We allow inheriting 'constinit' from a forward declaration as an extension.
+ extern constinit int b; // expected-note {{here}}
+ int b; // expected-warning {{'constinit' specifier missing}}
+}
+
+struct S {
+ static constinit int a; // expected-note {{here}}
+ static constinit constexpr int b; // expected-error {{cannot combine with previous}} expected-note {{here}}
+ static constinit const int c = 1;
+ static constinit const int d = 1;
+};
+int S::a; // expected-warning {{'constinit' specifier missing}}
+int S::b; // expected-warning {{'constinit' specifier missing}}
+const int S::c;
+inline const int S::d;
+
+struct T {
+ static int a;
+ static constexpr int b = 1; // expected-note {{add the 'constinit' specifier}}
+ static const int c = 1; // expected-note {{add the 'constinit' specifier}}
+ static const int d = 1; // expected-note {{add the 'constinit' specifier}}
+};
+constinit int T::a;
+constinit const int T::b; // expected-error {{'constinit' specifier added after initialization}}
+constinit const int T::c; // expected-error {{'constinit' specifier added after initialization}}
+constinit inline const int T::d; // expected-error {{'constinit' specifier added after initialization}}
+
+constinit void g() {} // expected-error {{constinit can only be used in variable declarations}}
+
+// (These used to trigger crashes.)
+void h();
+constinit void h(); // expected-error {{constinit can only be used in variable declarations}}
+constexpr void i(); // expected-note {{here}}
+constinit void i(); // expected-error {{non-constexpr declaration of 'i' follows constexpr declaration}}
+// expected-error@-1 {{constinit can only be used in variable declarations}}
+
+typedef constinit int type; // expected-error {{typedef cannot be constinit}}
+using type = constinit int; // expected-error {{type name does not allow constinit specifier}}
+auto q() -> int constinit; // expected-error {{type name does not allow constinit specifier}}
diff --git a/src/llvm-project/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constinit/p2.cpp b/src/llvm-project/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constinit/p2.cpp
new file mode 100644
index 0000000..22ac7a1
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constinit/p2.cpp
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -std=c++2a -verify %s
+
+int f(); // expected-note 2{{declared here}}
+
+constinit int a;
+constinit int b = f(); // expected-error {{does not have a constant initializer}} expected-note {{required by}} expected-note {{non-constexpr function 'f'}}
+extern constinit int c; // expected-note {{here}} expected-note {{required by}}
+int c = f(); // expected-warning {{missing}} expected-error {{does not have a constant initializer}} expected-note {{non-constexpr function 'f'}}
diff --git a/src/llvm-project/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constinit/p3.cpp b/src/llvm-project/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constinit/p3.cpp
new file mode 100644
index 0000000..0baea03
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constinit/p3.cpp
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -std=c++2a -verify %s
+
+const char *g() { return "dynamic initialization"; } // expected-note {{declared here}}
+constexpr const char *f(bool b) { return b ? "constant initialization" : g(); } // expected-note {{non-constexpr function 'g'}}
+constinit const char *c = f(true);
+constinit const char *d = f(false); // expected-error {{does not have a constant initializer}} expected-note 2{{}}
diff --git a/src/llvm-project/clang/test/CXX/dcl.decl/dcl.fct.def/dcl.fct.def.default/p1.cpp b/src/llvm-project/clang/test/CXX/dcl.decl/dcl.fct.def/dcl.fct.def.default/p1.cpp
index 3f2bc56..9614a17 100644
--- a/src/llvm-project/clang/test/CXX/dcl.decl/dcl.fct.def/dcl.fct.def.default/p1.cpp
+++ b/src/llvm-project/clang/test/CXX/dcl.decl/dcl.fct.def/dcl.fct.def.default/p1.cpp
@@ -1,12 +1,28 @@
-// RUN: %clang_cc1 -verify %s -std=c++11
-// RUN: %clang_cc1 -verify %s -std=c++17
-// RUN: %clang_cc1 -verify %s -std=c++2a
+// RUN: %clang_cc1 -verify=expected,pre20 %s -std=c++11
+// RUN: %clang_cc1 -verify=expected,pre20 %s -std=c++17
+// RUN: %clang_cc1 -verify=expected %s -std=c++20
// A function that is explicitly defaulted shall
struct A {
- // -- be a special member function,
- A(int) = default; // expected-error {{only special member functions may be defaulted}}
+ // -- be a special member function [C++20: or a comparison operator function],
+ A(int) = default;
+#if __cplusplus <= 201703L
+ // expected-error@-2 {{only special member functions may be defaulted}}
+#else
+ // expected-error@-4 {{only special member functions and comparison operators may be defaulted}}
+#endif
A(A) = default; // expected-error {{must pass its first argument by reference}}
+ void f(A) = default; // expected-error-re {{only special member functions{{( and comparison operators)?}} may be defaulted}}
+
+ bool operator==(const A&) const = default; // pre20-warning {{defaulted comparison operators are a C++20 extension}}
+ bool operator!=(const A&) const = default; // pre20-warning {{defaulted comparison operators are a C++20 extension}}
+ bool operator<(const A&) const = default; // pre20-error {{only special member functions may be defaulted}}
+ bool operator>(const A&) const = default; // pre20-error {{only special member functions may be defaulted}}
+ bool operator<=(const A&) const = default; // pre20-error {{only special member functions may be defaulted}}
+ bool operator>=(const A&) const = default; // pre20-error {{only special member functions may be defaulted}}
+ bool operator<=>(const A&) const = default; // pre20-error 1+{{}} pre20-warning {{'<=>' is a single token in C++20}}
+
+ A operator+(const A&) const = default; // expected-error-re {{only special member functions{{( and comparison operators)?}} may be defaulted}}
// -- have the same declared function type as if it had been implicitly
// declared
diff --git a/src/llvm-project/clang/test/CXX/dcl.decl/dcl.fct.def/dcl.fct.def.default/p2.cpp b/src/llvm-project/clang/test/CXX/dcl.decl/dcl.fct.def/dcl.fct.def.default/p2.cpp
index 2b7886d..7274ee9 100644
--- a/src/llvm-project/clang/test/CXX/dcl.decl/dcl.fct.def/dcl.fct.def.default/p2.cpp
+++ b/src/llvm-project/clang/test/CXX/dcl.decl/dcl.fct.def/dcl.fct.def.default/p2.cpp
@@ -8,7 +8,7 @@
constexpr S1(S1&&) = default;
constexpr S1 &operator=(const S1&) const = default; // expected-error {{explicitly-defaulted copy assignment operator may not have}}
constexpr S1 &operator=(S1&&) const = default; // expected-error {{explicitly-defaulted move assignment operator may not have}}
- constexpr ~S1() = default; // expected-error {{destructor cannot be marked constexpr}}
+ constexpr ~S1() = default; // expected-error {{destructor cannot be declared constexpr}}
int n;
};
struct NoCopyMove {
diff --git a/src/llvm-project/clang/test/CXX/dcl.decl/dcl.init/dcl.init.list/p3.cpp b/src/llvm-project/clang/test/CXX/dcl.decl/dcl.init/dcl.init.list/p3.cpp
index ade3274..e185e8f 100644
--- a/src/llvm-project/clang/test/CXX/dcl.decl/dcl.init/dcl.init.list/p3.cpp
+++ b/src/llvm-project/clang/test/CXX/dcl.decl/dcl.init/dcl.init.list/p3.cpp
@@ -86,6 +86,20 @@
const int& i1 = { 1 };
const int& i2 = { 1.1 }; // expected-error {{type 'double' cannot be narrowed to 'int' in initializer list}} expected-note {{silence}} expected-warning {{implicit conversion}}
const int (&iar)[2] = { 1, 2 };
+
+ // We interpret "class type with a default constructor" as including the case
+ // where a default constructor is inherited.
+ struct X {
+ X();
+ X(std::initializer_list<int>) = delete;
+ };
+ struct Y : X {
+ using X::X;
+ Y(int);
+ };
+ Y y1{};
+ void use() { Y y; }
+ Y y2{};
}
namespace bullet7 {
diff --git a/src/llvm-project/clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5.cpp b/src/llvm-project/clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5.cpp
index 869fc4f..3e8f18c 100644
--- a/src/llvm-project/clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5.cpp
+++ b/src/llvm-project/clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5.cpp
@@ -65,7 +65,7 @@
namespace explicit_ctor {
struct A {};
struct B { // expected-note 2{{candidate}}
- explicit B(const A&);
+ explicit B(const A&); // expected-note {{explicit constructor is not a candidate}}
};
A a;
const B &b(a); // expected-error {{no viable conversion}}
diff --git a/src/llvm-project/clang/test/CXX/dcl.decl/dcl.init/p14-0x.cpp b/src/llvm-project/clang/test/CXX/dcl.decl/dcl.init/p14-0x.cpp
index 419f2bf..e7f5013 100644
--- a/src/llvm-project/clang/test/CXX/dcl.decl/dcl.init/p14-0x.cpp
+++ b/src/llvm-project/clang/test/CXX/dcl.decl/dcl.init/p14-0x.cpp
@@ -5,7 +5,7 @@
NoDefault(int);
};
struct Explicit { // expected-note 2 {{candidate}} expected-note {{here}}
- explicit Explicit(int);
+ explicit Explicit(int); // expected-note {{not a candidate}}
};
struct NoCopy {
NoCopy();
diff --git a/src/llvm-project/clang/test/CXX/dcl/dcl.decl/p3.cpp b/src/llvm-project/clang/test/CXX/dcl/dcl.decl/p3.cpp
new file mode 100644
index 0000000..5bfec8a
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/dcl/dcl.decl/p3.cpp
@@ -0,0 +1,35 @@
+// RUN: %clang_cc1 -std=c++2a -verify %s
+
+template<typename T, typename U>
+constexpr bool is_same_v = false;
+
+template<typename T>
+constexpr bool is_same_v<T, T> = true;
+
+void f1(int a) requires true; // OK
+auto f2(int a) -> bool requires true; // OK
+auto f3(int a) -> bool (*)(int b) requires true; // OK
+auto f4(int a) requires true -> bool; // expected-error{{trailing return type must appear before trailing requires clause}}
+int f5(int a) requires; // expected-error{{expected expression}}
+int f6(int a) requires {} // expected-error{{expected expression}}
+void (f7()) requires true;
+void (f8() requires true); // expected-error{{trailing requires clause should be placed outside parentheses}}
+void (*(f9 requires (true)))(); // expected-error{{trailing requires clause should be placed outside parentheses}}
+static_assert(is_same_v<decltype(f9), void (*)()>);
+void (*pf)() requires true; // expected-error{{trailing requires clause can only be used when declaring a function}}
+void g1(int (*dsdads)() requires false); // expected-error{{trailing requires clause can only be used when declaring a function}}
+void g2(int (*(*dsdads)())() requires true); // expected-error{{trailing requires clause can only be used when declaring a function}}
+void g3(int (*(*dsdads)(int) requires true)() ); // expected-error{{trailing requires clause should be placed outside parentheses}}
+using T = void ();
+T x requires true;
+struct S {
+ T m1 requires true, m2 requires true;
+};
+
+template<typename T>
+struct R {
+ R(T t);
+};
+
+template<typename T>
+R(T) -> R<T> requires true; // expected-error{{deduction guide cannot have a requires clause}}
diff --git a/src/llvm-project/clang/test/CXX/dcl/dcl.fct/p17.cpp b/src/llvm-project/clang/test/CXX/dcl/dcl.fct/p17.cpp
new file mode 100644
index 0000000..10e5257
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/dcl/dcl.fct/p17.cpp
@@ -0,0 +1,260 @@
+// RUN: %clang_cc1 -std=c++2a -verify %s
+template<typename T, typename U> constexpr bool is_same_v = false;
+template<typename T> constexpr bool is_same_v<T, T> = true;
+
+template<typename... T>
+struct type_list;
+
+namespace unconstrained {
+ decltype(auto) f1(auto x) { return x; }
+ static_assert(is_same_v<decltype(f1(1)), int>);
+ static_assert(is_same_v<decltype(f1('c')), char>);
+
+ decltype(auto) f2(auto &x) { return x; }
+ // expected-note@-1{{candidate function [with x:auto = int] not viable: expects an l-value for 1st argument}}
+ // expected-note@-2{{candidate function [with x:auto = char] not viable: expects an l-value for 1st argument}}
+ static_assert(is_same_v<decltype(f2(1)), int &>); // expected-error{{no matching}}
+ static_assert(is_same_v<decltype(f2('c')), char &>); // expected-error{{no matching}}
+
+ decltype(auto) f3(const auto &x) { return x; }
+ static_assert(is_same_v<decltype(f3(1)), const int &>);
+ static_assert(is_same_v<decltype(f3('c')), const char &>);
+
+ decltype(auto) f4(auto (*x)(auto y)) { return x; } // expected-error{{'auto' not allowed in function prototype}}
+
+ decltype(auto) f5(void (*x)(decltype(auto) y)) { return x; } // expected-error{{'decltype(auto)' not allowed in function prototype}}
+
+ int return_int(); void return_void(); int foo(int);
+
+ decltype(auto) f6(auto (*x)()) { return x; }
+ // expected-note@-1{{candidate template ignored: failed template argument deduction}}
+ static_assert(is_same_v<decltype(f6(return_int)), int (*)()>);
+ static_assert(is_same_v<decltype(f6(return_void)), void (*)()>);
+ using f6c1 = decltype(f6(foo)); // expected-error{{no matching}}
+
+ decltype(auto) f7(auto (*x)() -> int) { return x; }
+ // expected-note@-1{{candidate function not viable: no known conversion from 'void ()' to 'auto (*)() -> int' for 1st argument}}
+ // expected-note@-2{{candidate function not viable: no known conversion from 'int (int)' to 'auto (*)() -> int' for 1st argument}}
+ static_assert(is_same_v<decltype(f7(return_int)), int (*)()>);
+ using f7c1 = decltype(f7(return_void)); // expected-error{{no matching}}
+ using f7c2 = decltype(f7(foo)); // expected-error{{no matching}}
+ static_assert(is_same_v<decltype(&f7), int (*(*)(int (*x)()))()>);
+
+ decltype(auto) f8(auto... x) { return (x + ...); }
+ static_assert(is_same_v<decltype(f8(1, 2, 3)), int>);
+ static_assert(is_same_v<decltype(f8('c', 'd')), int>);
+ static_assert(is_same_v<decltype(f8('c', 1)), int>);
+
+ decltype(auto) f9(auto &... x) { return (x, ...); }
+ // expected-note@-1{{candidate function [with x:auto = <int (), int>] not viable: expects an l-value for 2nd argument}}
+ using f9c1 = decltype(f9(return_int, 1)); // expected-error{{no matching}}
+
+ decltype(auto) f11(decltype(auto) x) { return x; } // expected-error{{'decltype(auto)' not allowed in function prototype}}
+
+ template<typename T>
+ auto f12(auto x, T y) -> type_list<T, decltype(x)>;
+ static_assert(is_same_v<decltype(f12(1, 'c')), type_list<char, int>>);
+ static_assert(is_same_v<decltype(f12<char>(1, 'c')), type_list<char, int>>);
+
+ template<typename T>
+ auto f13(T x, auto y) -> type_list<T, decltype(y)>;
+ static_assert(is_same_v<decltype(f13(1, 'c')), type_list<int, char>>);
+ static_assert(is_same_v<decltype(f13<char>(1, 'c')), type_list<char, char>>);
+
+ template<typename T>
+ auto f14(auto y) -> type_list<T, decltype(y)>;
+ static_assert(is_same_v<decltype(f14<int>('c')), type_list<int, char>>);
+ static_assert(is_same_v<decltype(f14<int, char>('c')), type_list<int, char>>);
+
+ template<typename T, typename U>
+ auto f15(auto y, U u) -> type_list<T, U, decltype(y)>;
+ static_assert(is_same_v<decltype(f15<int>('c', nullptr)), type_list<int, decltype(nullptr), char>>);
+ static_assert(is_same_v<decltype(f15<int, decltype(nullptr)>('c', nullptr)), type_list<int, decltype(nullptr), char>>);
+
+ auto f16(auto x, auto y) -> type_list<decltype(x), decltype(y)>;
+ static_assert(is_same_v<decltype(f16('c', 1)), type_list<char, int>>);
+ static_assert(is_same_v<decltype(f16<int>('c', 1)), type_list<int, int>>);
+ static_assert(is_same_v<decltype(f16<int, char>('c', 1)), type_list<int, char>>);
+
+ void f17(auto x, auto y) requires (sizeof(x) > 1);
+ // expected-note@-1{{candidate template ignored: constraints not satisfied [with x:auto = char, y:auto = int]}}
+ // expected-note@-2{{because 'sizeof (x) > 1' (1 > 1) evaluated to false}}
+ static_assert(is_same_v<decltype(f17('c', 1)), void>);
+ // expected-error@-1{{no matching}}
+ static_assert(is_same_v<decltype(f17<int>('c', 1)), void>);
+ static_assert(is_same_v<decltype(f17<int, char>('c', 1)), void>);
+
+ void f18(auto... x) requires (sizeof...(x) == 2);
+ // expected-note@-1{{candidate template ignored: constraints not satisfied [with x:auto = <char, int, int>]}}
+ // expected-note@-2{{candidate template ignored: constraints not satisfied [with x:auto = <char>]}}
+ // expected-note@-3{{because 'sizeof...(x) == 2' (1 == 2) evaluated to false}}
+ // expected-note@-4{{because 'sizeof...(x) == 2' (3 == 2) evaluated to false}}
+ static_assert(is_same_v<decltype(f18('c')), void>);
+ // expected-error@-1{{no matching}}
+ static_assert(is_same_v<decltype(f18('c', 1)), void>);
+ static_assert(is_same_v<decltype(f18('c', 1, 2)), void>);
+ // expected-error@-1{{no matching}}
+
+ template<typename T>
+ struct S {
+ constexpr auto f1(auto x, T t) -> decltype(x + t);
+
+ template<typename U>
+ constexpr auto f2(U u, auto x, T t) -> decltype(x + u + t);
+ };
+
+ template<typename T>
+ constexpr auto S<T>::f1(auto x, T t) -> decltype(x + t) { return x + t; }
+
+ template<typename T>
+ template<typename U>
+ constexpr auto S<T>::f2(auto x, U u, T t) -> decltype(x + u + t) { return x + u + t; }
+ // expected-error@-1 {{out-of-line definition of 'f2' does not match any declaration in 'S<T>'}}
+
+ template<typename T>
+ template<typename U>
+ constexpr auto S<T>::f2(U u, auto x, T t) -> decltype(x + u + t) { return x + u + t; }
+
+ template<>
+ template<>
+ constexpr auto S<int>::f2<double>(double u, char x, int t) -> double { return 42; }
+
+ static_assert(S<char>{}.f1(1, 2) == 3);
+ static_assert(S<char>{}.f2(1, 2, '\x00') == 3);
+ static_assert(S<char>{}.f2<double>(1, 2, '\x00') == 3.);
+ static_assert(S<int>{}.f2<double>(1, '2', '\x00') == 42);
+}
+
+namespace constrained {
+ template<typename T>
+ concept C = is_same_v<T, int>;
+ // expected-note@-1 12{{because}}
+ template<typename T, typename U>
+ concept C2 = is_same_v<T, U>;
+ // expected-note@-1 12{{because}}
+
+ int i;
+ const int ci = 1;
+ char c;
+ const char cc = 'a';
+ int g(int);
+ char h(int);
+
+ void f1(C auto x);
+ // expected-note@-1 {{candidate template ignored: constraints not satisfied [with x:auto = }}
+ // expected-note@-2{{because}}
+ static_assert(is_same_v<decltype(f1(1)), void>);
+ static_assert(is_same_v<decltype(f1('a')), void>);
+ // expected-error@-1{{no matching}}
+ void f2(C auto &x);
+ // expected-note@-1 2{{candidate template ignored}} expected-note@-1 2{{because}}
+ static_assert(is_same_v<decltype(f2(i)), void>);
+ static_assert(is_same_v<decltype(f2(ci)), void>);
+ // expected-error@-1{{no matching}}
+ static_assert(is_same_v<decltype(f2(c)), void>);
+ // expected-error@-1{{no matching}}
+ void f3(const C auto &x);
+ // expected-note@-1{{candidate template ignored}} expected-note@-1{{because}}
+ static_assert(is_same_v<decltype(f3(i)), void>);
+ static_assert(is_same_v<decltype(f3(ci)), void>);
+ static_assert(is_same_v<decltype(f3(c)), void>);
+ // expected-error@-1{{no matching}}
+ void f4(C auto (*x)(C auto y)); // expected-error{{'auto' not allowed}}
+ void f5(C auto (*x)(int y));
+ // expected-note@-1{{candidate template ignored}} expected-note@-1{{because}}
+ static_assert(is_same_v<decltype(f5(g)), void>);
+ static_assert(is_same_v<decltype(f5(h)), void>);
+ // expected-error@-1{{no matching}}
+ void f6(C auto (*x)() -> int); // expected-error{{function with trailing return type must specify return type 'auto', not 'C auto'}}
+ void f7(C auto... x);
+ // expected-note@-1 2{{candidate template ignored}} expected-note@-1 2{{because}}
+ static_assert(is_same_v<decltype(f7(1, 2)), void>);
+ static_assert(is_same_v<decltype(f7(1, 'a')), void>);
+ // expected-error@-1{{no matching}}
+ static_assert(is_same_v<decltype(f7('a', 2)), void>);
+ // expected-error@-1{{no matching}}
+ void f8(C auto &... x);
+ // expected-note@-1 2{{candidate template ignored}} expected-note@-1 2{{because}}
+ static_assert(is_same_v<decltype(f8(i, i)), void>);
+ static_assert(is_same_v<decltype(f8(i, c)), void>);
+ // expected-error@-1{{no matching}}
+ static_assert(is_same_v<decltype(f8(i, i, ci)), void>);
+ // expected-error@-1{{no matching}}
+ void f9(const C auto &... x);
+ // expected-note@-1{{candidate template ignored}} expected-note@-1{{because}}
+ static_assert(is_same_v<decltype(f9(i, i)), void>);
+ static_assert(is_same_v<decltype(f9(i, c)), void>);
+ // expected-error@-1{{no matching}}
+ static_assert(is_same_v<decltype(f9(i, i, ci)), void>);
+ void f10(C decltype(auto) x);
+ auto f11 = [] (C auto x) { };
+ // expected-note@-1{{candidate template ignored}} expected-note@-1{{because}}
+ static_assert(is_same_v<decltype(f11(1)), void>);
+ static_assert(is_same_v<decltype(f11('a')), void>);
+ // expected-error@-1{{no matching}}
+
+ void f12(C2<char> auto x);
+ // expected-note@-1{{candidate template ignored}} expected-note@-1{{because}}
+ static_assert(is_same_v<decltype(f12(1)), void>);
+ // expected-error@-1{{no matching}}
+ static_assert(is_same_v<decltype(f12('a')), void>);
+ void f13(C2<char> auto &x);
+ // expected-note@-1 2{{candidate template ignored}} expected-note@-1 2{{because}}
+ static_assert(is_same_v<decltype(f13(i)), void>);
+ // expected-error@-1{{no matching}}
+ static_assert(is_same_v<decltype(f13(cc)), void>);
+ // expected-error@-1{{no matching}}
+ static_assert(is_same_v<decltype(f13(c)), void>);
+ void f14(const C2<char> auto &x);
+ // expected-note@-1{{candidate template ignored}} expected-note@-1{{because}}
+ static_assert(is_same_v<decltype(f14(i)), void>);
+ // expected-error@-1{{no matching}}
+ static_assert(is_same_v<decltype(f14(cc)), void>);
+ static_assert(is_same_v<decltype(f14(c)), void>);
+ void f15(C2<char> auto (*x)(C2<int> auto y)); // expected-error{{'auto' not allowed}}
+ void f16(C2<char> auto (*x)(int y));
+ // expected-note@-1{{candidate template ignored}} expected-note@-1{{because}}
+ static_assert(is_same_v<decltype(f16(g)), void>);
+ // expected-error@-1{{no matching}}
+ static_assert(is_same_v<decltype(f16(h)), void>);
+ void f17(C2<char> auto (*x)() -> int); // expected-error{{function with trailing return type must specify return type 'auto', not 'C2<char> auto'}}
+ void f18(C2<char> auto... x);
+ // expected-note@-1 2{{candidate template ignored}} expected-note@-1 2{{because}}
+ static_assert(is_same_v<decltype(f18('a', 'b')), void>);
+ static_assert(is_same_v<decltype(f18('a', 1)), void>);
+ // expected-error@-1{{no matching}}
+ static_assert(is_same_v<decltype(f18(2, 'a')), void>);
+ // expected-error@-1{{no matching}}
+ void f19(C2<char> auto &... x);
+ // expected-note@-1 2{{candidate template ignored}} expected-note@-1 2{{because}}
+ static_assert(is_same_v<decltype(f19(c, c)), void>);
+ static_assert(is_same_v<decltype(f19(i, c)), void>);
+ // expected-error@-1{{no matching}}
+ static_assert(is_same_v<decltype(f19(c, c, cc)), void>);
+ // expected-error@-1{{no matching}}
+ void f20(const C2<char> auto &... x);
+ // expected-note@-1{{candidate template ignored}} expected-note@-1{{because}}
+ static_assert(is_same_v<decltype(f20(c, c)), void>);
+ static_assert(is_same_v<decltype(f20(i, c)), void>);
+ // expected-error@-1{{no matching}}
+ static_assert(is_same_v<decltype(f20(c, c, cc)), void>);
+ void f21(C2<char> decltype(auto) x);
+ auto f22 = [] (C2<char> auto x) { };
+ // expected-note@-1{{candidate template ignored}} expected-note@-1{{because}}
+ static_assert(is_same_v<decltype(f22(1)), void>);
+ // expected-error@-1{{no matching}}
+ static_assert(is_same_v<decltype(f22('a')), void>);
+
+ struct S1 { S1(C auto); };
+ // expected-note@-1{{candidate template ignored}} expected-note@-1{{because}}
+ // expected-note@-2 2{{candidate constructor}}
+ static_assert(is_same_v<decltype(S1(1)), S1>);
+ static_assert(is_same_v<decltype(S1('a')), S1>);
+ // expected-error@-1{{no matching}}
+ struct S2 { S2(C2<char> auto); };
+ // expected-note@-1{{candidate template ignored}} expected-note@-1{{because}}
+ // expected-note@-2 2{{candidate constructor}}
+ static_assert(is_same_v<decltype(S2(1)), S2>);
+ // expected-error@-1{{no matching}}
+ static_assert(is_same_v<decltype(S2('a')), S2>);
+}
diff --git a/src/llvm-project/clang/test/CXX/dcl/dcl.spec/dcl.type/dcl.spec.auto/p6.cpp b/src/llvm-project/clang/test/CXX/dcl/dcl.spec/dcl.type/dcl.spec.auto/p6.cpp
new file mode 100644
index 0000000..ae19467
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/dcl/dcl.spec/dcl.type/dcl.spec.auto/p6.cpp
@@ -0,0 +1,44 @@
+// RUN: %clang_cc1 -std=c++2a -verify %s
+
+template<typename T, unsigned size>
+concept LargerThan = sizeof(T) > size;
+// expected-note@-1 2{{because 'sizeof(char) > 1U' (1 > 1) evaluated to false}}
+// expected-note@-2 {{because 'sizeof(int) > 10U' (4 > 10) evaluated to false}}
+// expected-note@-3 {{because 'sizeof(int) > 4U' (4 > 4) evaluated to false}}
+
+template<typename T>
+concept Large = LargerThan<T, 1>;
+// expected-note@-1 2{{because 'LargerThan<char, 1>' evaluated to false}}
+
+namespace X {
+ template<typename T, unsigned size>
+ concept SmallerThan = sizeof(T) < size;
+ template<typename T>
+ concept Small = SmallerThan<T, 2>;
+}
+
+Large auto test1() { // expected-error{{deduced type 'char' does not satisfy 'Large'}}
+ Large auto i = 'a';
+ // expected-error@-1{{deduced type 'char' does not satisfy 'Large'}}
+ Large auto j = 10;
+ ::Large auto k = 10;
+ LargerThan<1> auto l = 10;
+ ::LargerThan<1> auto m = 10;
+ LargerThan<10> auto n = 10;
+ // expected-error@-1{{deduced type 'int' does not satisfy 'LargerThan<10>'}}
+ X::Small auto o = 'x';
+ X::SmallerThan<5> auto p = 1;
+ return 'a';
+}
+
+::Large auto test2() { return 10; }
+LargerThan<4> auto test3() { return 10; }
+// expected-error@-1{{deduced type 'int' does not satisfy 'LargerThan<4>'}}
+::LargerThan<2> auto test4() { return 10; }
+
+Large auto test5() -> void;
+// expected-error@-1{{function with trailing return type must specify return type 'auto', not 'Large auto'}}
+auto test6() -> Large auto { return 1; }
+
+X::Small auto test7() { return 'a'; }
+X::SmallerThan<5> auto test8() { return 10; }
\ No newline at end of file
diff --git a/src/llvm-project/clang/test/CXX/drs/dr13xx.cpp b/src/llvm-project/clang/test/CXX/drs/dr13xx.cpp
index 3a0b7d7..2373a39 100644
--- a/src/llvm-project/clang/test/CXX/drs/dr13xx.cpp
+++ b/src/llvm-project/clang/test/CXX/drs/dr13xx.cpp
@@ -348,9 +348,9 @@
// we know exactly how many arguments correspond to it.
template<typename T, typename U> struct pair {};
template<typename ...T> struct tuple { typedef char type; }; // expected-error 0-2{{C++11}}
- template<typename ...T, typename ...U> void f_pair_1(pair<T, U>..., int); // expected-error 0-2{{C++11}} expected-note {{different lengths (2 vs. 0)}}
+ template<typename ...T, typename ...U> void f_pair_1(pair<T, U>..., int); // expected-error 0-2{{C++11}} expected-note {{[with T = <int, long>]: deduced incomplete pack <(no value), (no value)> for template parameter 'U'}}
template<typename ...T, typename U> void f_pair_2(pair<T, char>..., U); // expected-error 0-2{{C++11}}
- template<typename ...T, typename ...U> void f_pair_3(pair<T, U>..., tuple<U...>); // expected-error 0-2{{C++11}} expected-note {{different lengths (2 vs. 1)}}
+ template<typename ...T, typename ...U> void f_pair_3(pair<T, U>..., tuple<U...>); // expected-error 0-2{{C++11}} expected-note {{deduced packs of different lengths for parameter 'U' (<(no value), (no value)> vs. <char>)}}
template<typename ...T> void f_pair_4(pair<T, char>..., T...); // expected-error 0-2{{C++11}} expected-note {{<int, long> vs. <int, long, const char *>}}
void g(pair<int, char> a, pair<long, char> b, tuple<char, char> c) {
f_pair_1<int, long>(a, b, 0); // expected-error {{no match}}
diff --git a/src/llvm-project/clang/test/CXX/drs/dr14xx.cpp b/src/llvm-project/clang/test/CXX/drs/dr14xx.cpp
index eb08617..5212984 100644
--- a/src/llvm-project/clang/test/CXX/drs/dr14xx.cpp
+++ b/src/llvm-project/clang/test/CXX/drs/dr14xx.cpp
@@ -1,7 +1,8 @@
// 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++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
-// RUN: %clang_cc1 -std=c++1z %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++2a %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
#if __cplusplus < 201103L
// expected-no-diagnostics
@@ -38,18 +39,24 @@
}
union A {};
- union B { int n; }; // expected-note +{{here}}
+ union B { int n; }; // expected-note 0+{{here}}
union C { int n = 0; };
struct D { union {}; }; // expected-error {{does not declare anything}}
- struct E { union { int n; }; }; // expected-note +{{here}}
+ struct E { union { int n; }; }; // expected-note 0+{{here}}
struct F { union { int n = 0; }; };
struct X {
friend constexpr A::A() noexcept;
- friend constexpr B::B() noexcept; // expected-error {{follows non-constexpr declaration}}
+ friend constexpr B::B() noexcept;
+#if __cplusplus <= 201703L
+ // expected-error@-2 {{follows non-constexpr declaration}}
+#endif
friend constexpr C::C() noexcept;
friend constexpr D::D() noexcept;
- friend constexpr E::E() noexcept; // expected-error {{follows non-constexpr declaration}}
+ friend constexpr E::E() noexcept;
+#if __cplusplus <= 201703L
+ // expected-error@-2 {{follows non-constexpr declaration}}
+#endif
friend constexpr F::F() noexcept;
};
@@ -64,37 +71,61 @@
namespace Defaulted {
union A { constexpr A() = default; };
- union B { int n; constexpr B() = default; }; // expected-error {{not constexpr}}
+ union B { int n; constexpr B() = default; };
+#if __cplusplus <= 201703L
+ // expected-error@-2 {{not constexpr}}
+#endif
union C { int n = 0; constexpr C() = default; };
struct D { union {}; constexpr D() = default; }; // expected-error {{does not declare anything}}
- struct E { union { int n; }; constexpr E() = default; }; // expected-error {{not constexpr}}
+ struct E { union { int n; }; constexpr E() = default; };
+#if __cplusplus <= 201703L
+ // expected-error@-2 {{not constexpr}}
+#endif
struct F { union { int n = 0; }; constexpr F() = default; };
- struct G { union { int n = 0; }; union { int m; }; constexpr G() = default; }; // expected-error {{not constexpr}}
+ struct G { union { int n = 0; }; union { int m; }; constexpr G() = default; };
+#if __cplusplus <= 201703L
+ // expected-error@-2 {{not constexpr}}
+#endif
struct H {
union {
int n = 0;
};
- union { // expected-note 2{{member not initialized}}
+ union { // expected-note 0-2{{member not initialized}}
int m;
};
- constexpr H() {} // expected-error {{must initialize all members}}
+ constexpr H() {}
+#if __cplusplus <= 201703L
+ // expected-error@-2 {{initialize all members}}
+#endif
constexpr H(bool) : m(1) {}
- constexpr H(char) : n(1) {} // expected-error {{must initialize all members}}
+ constexpr H(char) : n(1) {}
+#if __cplusplus <= 201703L
+ // expected-error@-2 {{initialize all members}}
+#endif
constexpr H(double) : m(1), n(1) {}
};
}
#if __cplusplus > 201103L
template<typename T> constexpr bool check() {
- T t; // expected-note-re 2{{non-constexpr constructor '{{[BE]}}'}}
+ T t;
+#if __cplusplus <= 201703L
+ // expected-note-re@-2 2{{non-constexpr constructor '{{[BE]}}'}}
+#endif
return true;
}
static_assert(check<A>(), "");
- static_assert(check<B>(), ""); // expected-error {{constant}} expected-note {{in call}}
+ static_assert(check<B>(), "");
+#if __cplusplus <= 201703L
+ // expected-error@-2 {{constant}} expected-note@-2 {{in call}}
+#endif
static_assert(check<C>(), "");
static_assert(check<D>(), "");
- static_assert(check<E>(), ""); // expected-error {{constant}} expected-note {{in call}}
+ static_assert(check<E>(), "");
+#if __cplusplus <= 201703L
+ // expected-error@-2 {{constant}} expected-note@-2 {{in call}}
+#endif
static_assert(check<F>(), "");
#endif
diff --git a/src/llvm-project/clang/test/CXX/drs/dr15xx.cpp b/src/llvm-project/clang/test/CXX/drs/dr15xx.cpp
index bd71486..55d838e 100644
--- a/src/llvm-project/clang/test/CXX/drs/dr15xx.cpp
+++ b/src/llvm-project/clang/test/CXX/drs/dr15xx.cpp
@@ -142,7 +142,7 @@
};
struct Z { // expected-note 0+ {{candidate}}
explicit Z(); // expected-note 0+ {{here}}
- explicit Z(int);
+ explicit Z(int); // expected-note {{not a candidate}}
explicit Z(int, int); // expected-note 0+ {{here}}
};
template <class T> int Eat(T); // expected-note 0+ {{candidate}}
@@ -399,23 +399,20 @@
void g2() { f2({"foo","bar"}); } // chooses #4
namespace with_error {
- void f0(long); // #0 expected-note {{candidate function}}
- void f0(std::initializer_list<int>); // #00 expected-note {{candidate function}}
- void f0(std::initializer_list<int>, int = 0); // Makes selection of #00 ambiguous \
- // expected-note {{candidate function}}
- void g0() { f0({1L}); } // chooses #00 expected-error{{call to 'f0' is ambiguous}}
+ void f0(long); // #0
+ void f0(std::initializer_list<int>); // #00 expected-note {{candidate function}}
+ void f0(std::initializer_list<int>, int = 0); // expected-note {{candidate function}}
+ void g0() { f0({1L}); } // expected-error{{call to 'f0' is ambiguous}}
- void f1(int); // #1 expected-note {{candidate function}}
- void f1(std::initializer_list<long>); // #2 expected-note {{candidate function}}
- void f1(std::initializer_list<long>, int = 0); // Makes selection of #00 ambiguous \
- // expected-note {{candidate function}}
- void g1() { f1({42}); } // chooses #2 expected-error{{call to 'f1' is ambiguous}}
+ void f1(int); // #1
+ void f1(std::initializer_list<long>); // #2 expected-note {{candidate function}}
+ void f1(std::initializer_list<long>, int = 0); // expected-note {{candidate function}}
+ void g1() { f1({42}); } // expected-error{{call to 'f1' is ambiguous}}
- void f2(std::pair<const char*, const char*>); // #3 TODO: expected- note {{candidate function}}
- void f2(std::initializer_list<std::string>); // #4 expected-note {{candidate function}}
- void f2(std::initializer_list<std::string>, int = 0); // Makes selection of #00 ambiguous \
- // expected-note {{candidate function}}
- void g2() { f2({"foo","bar"}); } // chooses #4 expected-error{{call to 'f2' is ambiguous}}
+ void f2(std::pair<const char*, const char*>); // #3
+ void f2(std::initializer_list<std::string>); // #4 expected-note {{candidate function}}
+ void f2(std::initializer_list<std::string>, int = 0); // expected-note {{candidate function}}
+ void g2() { f2({"foo","bar"}); } // expected-error{{call to 'f2' is ambiguous}}
}
} // dr1589
diff --git a/src/llvm-project/clang/test/CXX/drs/dr16xx.cpp b/src/llvm-project/clang/test/CXX/drs/dr16xx.cpp
index b5047e8..3bbb197 100644
--- a/src/llvm-project/clang/test/CXX/drs/dr16xx.cpp
+++ b/src/llvm-project/clang/test/CXX/drs/dr16xx.cpp
@@ -23,6 +23,18 @@
} // std
#endif
+namespace dr1601 { // dr1601: 10
+enum E : char { e };
+#if __cplusplus < 201103L
+ // expected-error@-2 {{enumeration types with a fixed underlying type are a C++11 extension}}
+#endif
+void f(char);
+void f(int);
+void g() {
+ f(e);
+}
+} // namespace dr1601
+
namespace dr1611 { // dr1611: dup 1658
struct A { A(int); };
struct B : virtual A { virtual void f() = 0; };
@@ -99,13 +111,13 @@
namespace dr1645 { // dr1645: 3.9
#if __cplusplus >= 201103L
struct A {
- constexpr A(int, float = 0); // expected-note 2{{candidate}}
+ constexpr A(int, float = 0); // expected-note {{candidate}}
explicit A(int, int = 0); // expected-note 2{{candidate}}
A(int, int, int = 0) = delete; // expected-note {{candidate}}
};
- struct B : A { // expected-note 2{{candidate}}
- using A::A; // expected-note 5{{inherited here}}
+ struct B : A {
+ using A::A; // expected-note 4{{inherited here}}
};
constexpr B a(0); // expected-error {{ambiguous}}
diff --git a/src/llvm-project/clang/test/CXX/drs/dr1xx.cpp b/src/llvm-project/clang/test/CXX/drs/dr1xx.cpp
index 26ab67d..1e78c03 100644
--- a/src/llvm-project/clang/test/CXX/drs/dr1xx.cpp
+++ b/src/llvm-project/clang/test/CXX/drs/dr1xx.cpp
@@ -600,7 +600,7 @@
namespace dr152 { // dr152: yes
struct A {
A(); // expected-note 0-2{{not viable}}
- explicit A(const A&);
+ explicit A(const A&); // expected-note 1-2{{not a candidate}}
};
A a1 = A();
#if __cplusplus <= 201402L
diff --git a/src/llvm-project/clang/test/CXX/drs/dr23xx.cpp b/src/llvm-project/clang/test/CXX/drs/dr23xx.cpp
index 763abd5..85f5920 100644
--- a/src/llvm-project/clang/test/CXX/drs/dr23xx.cpp
+++ b/src/llvm-project/clang/test/CXX/drs/dr23xx.cpp
@@ -1,12 +1,41 @@
-// RUN: %clang_cc1 -std=c++98 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors 2>&1 | FileCheck %s
+// RUN: %clang_cc1 -std=c++98 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors 2>&1
// RUN: %clang_cc1 -std=c++11 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors 2>&1 | FileCheck %s
// RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors 2>&1 | FileCheck %s
// RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors 2>&1 | FileCheck %s
// RUN: %clang_cc1 -std=c++2a %s -verify -fexceptions -fcxx-exceptions -pedantic-errors 2>&1 | FileCheck %s
-#if __cplusplus <= 201103L
-// expected-no-diagnostics
+namespace dr2352 { // dr2352: 10
+ int **p;
+ const int *const *const &f1() { return p; }
+ int *const *const &f2() { return p; }
+ int **const &f3() { return p; }
+
+ const int **const &f4() { return p; } // expected-error {{reference to type 'const int **const' could not bind to an lvalue of type 'int **'}}
+ const int *const *&f5() { return p; } // expected-error {{binding reference of type 'const int *const *' to value of type 'int **' not permitted due to incompatible qualifiers}}
+
+ // FIXME: We permit this as a speculative defect resolution, allowing
+ // qualification conversions when forming a glvalue conditional expression.
+ const int * const * const q = 0;
+ __typeof(&(true ? p : q)) x = &(true ? p : q);
+
+ // FIXME: Should we compute the composite pointer type here and produce an
+ // lvalue of type 'const int *const * const'?
+ const int * const * r;
+ void *y = &(true ? p : r); // expected-error {{rvalue of type 'const int *const *'}}
+
+ // FIXME: We order these as a speculative defect resolution.
+ void f(const int * const * const &r);
+#if __cplusplus >= 201103L
+ constexpr
#endif
+ int *const *const &f(int * const * const &r) { return r; }
+
+ // No temporary is created here.
+ int *const *const &check_f = f(p);
+#if __cplusplus >= 201103L
+ static_assert(&p == &check_f, "");
+#endif
+}
namespace dr2353 { // dr2353: 9
struct X {
diff --git a/src/llvm-project/clang/test/CXX/drs/dr2xx.cpp b/src/llvm-project/clang/test/CXX/drs/dr2xx.cpp
index c7ffa77..eb32511 100644
--- a/src/llvm-project/clang/test/CXX/drs/dr2xx.cpp
+++ b/src/llvm-project/clang/test/CXX/drs/dr2xx.cpp
@@ -2,7 +2,7 @@
// RUN: %clang_cc1 -std=c++11 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
-// RUN: %clang_cc1 -std=c++2a %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
// PR13819 -- __SIZE_TYPE__ is incompatible.
typedef __SIZE_TYPE__ size_t; // expected-error 0-1 {{extension}}
@@ -225,11 +225,17 @@
void((a += b) += c);
void((a += b) + (a += c)); // expected-warning {{multiple unsequenced modifications to 'a'}}
- x[a++] = a; // expected-warning {{unsequenced modification and access to 'a'}}
+ x[a++] = a;
+#if __cplusplus < 201703L
+ // expected-warning@-2 {{unsequenced modification and access to 'a'}}
+#endif
a = b = 0; // ok, read and write of 'b' are sequenced
- a = (b = a++); // expected-warning {{multiple unsequenced modifications to 'a'}}
+ a = (b = a++);
+#if __cplusplus < 201703L
+ // expected-warning@-2 {{multiple unsequenced modifications to 'a'}}
+#endif
a = (b = ++a);
#pragma clang diagnostic pop
}
@@ -443,8 +449,8 @@
template <class T> void g(T t); // expected-note {{candidate}}
}
void h(A::B b) {
- f<3>(b); // expected-error 0-1{{C++2a extension}} expected-error {{no matching}}
- g<3>(b); // expected-error 0-1{{C++2a extension}}
+ f<3>(b); // expected-error 0-1{{C++20 extension}} expected-error {{no matching}}
+ g<3>(b); // expected-error 0-1{{C++20 extension}}
A::f<3>(b); // expected-error {{no matching}}
A::g<3>(b);
C::f<3>(b); // expected-error {{no matching}}
@@ -751,9 +757,12 @@
#if __cplusplus < 201103L
friend X::X() throw();
friend X::~X() throw();
-#else
+#elif __cplusplus <= 201703L
friend constexpr X::X() noexcept;
friend X::~X();
+#else
+ friend constexpr X::X() noexcept;
+ friend constexpr X::~X();
#endif
Y::Y(); // expected-error {{extra qualification}}
Y::~Y(); // expected-error {{extra qualification}}
diff --git a/src/llvm-project/clang/test/CXX/drs/dr4xx.cpp b/src/llvm-project/clang/test/CXX/drs/dr4xx.cpp
index 8eeb771..d37ece6 100644
--- a/src/llvm-project/clang/test/CXX/drs/dr4xx.cpp
+++ b/src/llvm-project/clang/test/CXX/drs/dr4xx.cpp
@@ -486,14 +486,21 @@
S<int> s;
}
-namespace dr434 { // dr434: yes
+namespace dr434 { // dr434: sup 2352
void f() {
const int ci = 0;
int *pi = 0;
- const int *&rpci = pi; // expected-error {{cannot bind}}
+ const int *&rpci = pi; // expected-error {{incompatible qualifiers}}
+ const int * const &rcpci = pi; // OK
rpci = &ci;
*pi = 1;
}
+
+#if __cplusplus >= 201103L
+ int *pi = 0;
+ const int * const &rcpci = pi;
+ static_assert(&rcpci == &pi, "");
+#endif
}
// dr435: na
diff --git a/src/llvm-project/clang/test/CXX/drs/dr6xx.cpp b/src/llvm-project/clang/test/CXX/drs/dr6xx.cpp
index 530c88f..03842f2 100644
--- a/src/llvm-project/clang/test/CXX/drs/dr6xx.cpp
+++ b/src/llvm-project/clang/test/CXX/drs/dr6xx.cpp
@@ -2,7 +2,7 @@
// RUN: %clang_cc1 -std=c++11 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -fno-spell-checking
// RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -fno-spell-checking
// RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -fno-spell-checking
-// RUN: %clang_cc1 -std=c++2a %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -fno-spell-checking
+// RUN: %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -fno-spell-checking
namespace std {
struct type_info {};
@@ -317,7 +317,10 @@
namespace dr637 { // dr637: yes
void f(int i) {
i = ++i + 1;
- i = i++ + 1; // expected-warning {{unsequenced}}
+ i = i++ + 1;
+#if __cplusplus < 201703L
+ // expected-warning@-2 {{unsequenced}}
+#endif
}
}
@@ -503,7 +506,7 @@
constexpr C(NonLiteral, int) {} // expected-error {{not a literal type}}
constexpr C() try {} catch (...) {}
#if __cplusplus <= 201703L
- // expected-error@-2 {{function try block in constexpr constructor is a C++2a extension}}
+ // expected-error@-2 {{function try block in constexpr constructor is a C++20 extension}}
#endif
#if __cplusplus < 201402L
// expected-error@-5 {{use of this statement in a constexpr constructor is a C++14 extension}}
@@ -987,14 +990,19 @@
}
#endif
-#if __cplusplus >= 201103L
namespace dr685 { // dr685: yes
enum E : long { e };
+#if __cplusplus < 201103L
+ // expected-error@-2 {{enumeration types with a fixed underlying type are a C++11 extension}}
+#endif
void f(int);
int f(long);
int a = f(e);
enum G : short { g };
+#if __cplusplus < 201103L
+ // expected-error@-2 {{enumeration types with a fixed underlying type are a C++11 extension}}
+#endif
int h(short);
void h(long);
int b = h(g);
@@ -1007,11 +1015,11 @@
void j(long); // expected-note {{candidate}}
int d = j(g); // expected-error {{ambiguous}}
- int k(short); // expected-note {{candidate}}
- void k(int); // expected-note {{candidate}}
- int x = k(g); // expected-error {{ambiguous}}
+ // Valid per dr1601
+ int k(short);
+ void k(int);
+ int x = k(g);
}
-#endif
namespace dr686 { // dr686: yes
void f() {
@@ -1062,7 +1070,7 @@
// This is valid in C++20.
g<int>(a);
#if __cplusplus <= 201703L
- // expected-error@-2 {{C++2a extension}}
+ // expected-error@-2 {{C++20 extension}}
#endif
// This is not.
diff --git a/src/llvm-project/clang/test/CXX/drs/dr7xx.cpp b/src/llvm-project/clang/test/CXX/drs/dr7xx.cpp
index 30cc4b9..147560d 100644
--- a/src/llvm-project/clang/test/CXX/drs/dr7xx.cpp
+++ b/src/llvm-project/clang/test/CXX/drs/dr7xx.cpp
@@ -1,8 +1,8 @@
-// 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++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
-// RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
-// RUN: %clang_cc1 -std=c++2a %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++98 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++11 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++2a %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
namespace dr705 { // dr705: yes
namespace N {
diff --git a/src/llvm-project/clang/test/CXX/except/except.spec/p11-2a.cpp b/src/llvm-project/clang/test/CXX/except/except.spec/p11-2a.cpp
new file mode 100644
index 0000000..5950bce
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/except/except.spec/p11-2a.cpp
@@ -0,0 +1,226 @@
+// RUN: %clang_cc1 -std=c++2a -verify %s
+// RUN: %clang_cc1 -std=c++2a -verify %s -DDEFINE_FIRST
+
+// As modified by P2002R0:
+// The exception specification for a comparison operator function (12.6.2)
+// without a noexcept-specifier that is defaulted on its first declaration is
+// potentially-throwing if and only if any expression in the implicit
+// definition is potentially-throwing.
+
+#define CAT2(a, b) a ## b
+#define CAT(a, b) CAT2(a, b)
+
+#ifdef DEFINE_FIRST
+#define DEF(x) auto CAT(a, __LINE__) = x
+#else
+#define DEF(x)
+#endif
+
+namespace std {
+ struct strong_ordering {
+ int n;
+ static const strong_ordering equal, less, greater;
+ };
+ constexpr strong_ordering strong_ordering::equal{0},
+ strong_ordering::less{-1}, strong_ordering::greater{1};
+ bool operator!=(std::strong_ordering o, int n) noexcept;
+}
+
+namespace Eq {
+ struct A {
+ bool operator==(const A&) const = default;
+ };
+ DEF(A() == A());
+ static_assert(noexcept(A() == A()));
+
+ struct B {
+ bool operator==(const B&) const;
+ };
+ struct C {
+ B b;
+ bool operator==(const C&) const = default;
+ };
+ DEF(C() == C());
+ static_assert(!noexcept(C() == C()));
+
+ // Ensure we do not trigger odr-use from exception specification computation.
+ template<typename T> struct D {
+ bool operator==(const D &) const {
+ typename T::error error; // expected-error {{no type}}
+ }
+ };
+ struct E {
+ D<E> d;
+ bool operator==(const E&) const = default;
+ };
+ static_assert(!noexcept(E() == E()));
+
+ // (but we do when defining the function).
+ struct F {
+ D<F> d;
+ bool operator==(const F&) const = default; // expected-note {{in instantiation}}
+ };
+ bool equal = F() == F();
+ static_assert(!noexcept(F() == F()));
+}
+
+namespace Spaceship {
+ struct X {
+ friend std::strong_ordering operator<=>(X, X);
+ };
+ struct Y : X {
+ friend std::strong_ordering operator<=>(Y, Y) = default;
+ };
+ DEF(Y() <=> Y());
+ static_assert(!noexcept(Y() <=> Y()));
+
+ struct ThrowingCmpCat {
+ ThrowingCmpCat(std::strong_ordering);
+ operator std::strong_ordering();
+ };
+ bool operator!=(ThrowingCmpCat o, int n) noexcept;
+
+ struct A {
+ friend ThrowingCmpCat operator<=>(A, A) noexcept;
+ };
+
+ struct B {
+ A a;
+ std::strong_ordering operator<=>(const B&) const = default;
+ };
+ DEF(B() <=> B());
+ static_assert(!noexcept(B() <=> B()));
+
+ struct C {
+ int n;
+ ThrowingCmpCat operator<=>(const C&) const = default;
+ };
+ DEF(C() <=> C());
+ static_assert(!noexcept(C() <=> C()));
+
+ struct D {
+ int n;
+ std::strong_ordering operator<=>(const D&) const = default;
+ };
+ DEF(D() <=> D());
+ static_assert(noexcept(D() <=> D()));
+
+
+ struct ThrowingCmpCat2 {
+ ThrowingCmpCat2(std::strong_ordering) noexcept;
+ operator std::strong_ordering() noexcept;
+ };
+ bool operator!=(ThrowingCmpCat2 o, int n);
+
+ struct E {
+ friend ThrowingCmpCat2 operator<=>(E, E) noexcept;
+ };
+
+ struct F {
+ E e;
+ std::strong_ordering operator<=>(const F&) const = default;
+ };
+ DEF(F() <=> F());
+ static_assert(noexcept(F() <=> F()));
+
+ struct G {
+ int n;
+ ThrowingCmpCat2 operator<=>(const G&) const = default;
+ };
+ DEF(G() <=> G());
+ static_assert(!noexcept(G() <=> G()));
+}
+
+namespace Synth {
+ struct A {
+ friend bool operator==(A, A) noexcept;
+ friend bool operator<(A, A) noexcept;
+ };
+ struct B {
+ A a;
+ friend std::strong_ordering operator<=>(B, B) = default;
+ };
+ std::strong_ordering operator<=>(B, B) noexcept;
+
+ struct C {
+ friend bool operator==(C, C);
+ friend bool operator<(C, C) noexcept;
+ };
+ struct D {
+ C c;
+ friend std::strong_ordering operator<=>(D, D) = default; // expected-note {{previous}}
+ };
+ std::strong_ordering operator<=>(D, D) noexcept; // expected-error {{does not match}}
+
+ struct E {
+ friend bool operator==(E, E) noexcept;
+ friend bool operator<(E, E);
+ };
+ struct F {
+ E e;
+ friend std::strong_ordering operator<=>(F, F) = default; // expected-note {{previous}}
+ };
+ std::strong_ordering operator<=>(F, F) noexcept; // expected-error {{does not match}}
+}
+
+namespace Secondary {
+ struct A {
+ friend bool operator==(A, A);
+ friend bool operator!=(A, A) = default; // expected-note {{previous}}
+
+ friend int operator<=>(A, A);
+ friend bool operator<(A, A) = default; // expected-note {{previous}}
+ friend bool operator<=(A, A) = default; // expected-note {{previous}}
+ friend bool operator>(A, A) = default; // expected-note {{previous}}
+ friend bool operator>=(A, A) = default; // expected-note {{previous}}
+ };
+ bool operator!=(A, A) noexcept; // expected-error {{does not match}}
+ bool operator<(A, A) noexcept; // expected-error {{does not match}}
+ bool operator<=(A, A) noexcept; // expected-error {{does not match}}
+ bool operator>(A, A) noexcept; // expected-error {{does not match}}
+ bool operator>=(A, A) noexcept; // expected-error {{does not match}}
+
+ struct B {
+ friend bool operator==(B, B) noexcept;
+ friend bool operator!=(B, B) = default;
+
+ friend int operator<=>(B, B) noexcept;
+ friend bool operator<(B, B) = default;
+ friend bool operator<=(B, B) = default;
+ friend bool operator>(B, B) = default;
+ friend bool operator>=(B, B) = default;
+ };
+ bool operator!=(B, B) noexcept;
+ bool operator<(B, B) noexcept;
+ bool operator<=(B, B) noexcept;
+ bool operator>(B, B) noexcept;
+ bool operator>=(B, B) noexcept;
+}
+
+// Check that we attempt to define a defaulted comparison before trying to
+// compute its exception specification.
+namespace DefineBeforeComputingExceptionSpec {
+ template<int> struct A {
+ A();
+ A(const A&) = delete; // expected-note 3{{here}}
+ friend bool operator==(A, A); // expected-note 3{{passing}}
+ friend bool operator!=(const A&, const A&) = default; // expected-error 3{{call to deleted constructor}}
+ };
+
+ bool a0 = A<0>() != A<0>(); // expected-note {{in defaulted equality comparison operator}}
+ bool a1 = operator!=(A<1>(), A<1>()); // expected-note {{in defaulted equality comparison operator}}
+
+ template struct A<2>;
+ bool operator!=(const A<2>&, const A<2>&) noexcept; // expected-note {{in evaluation of exception specification}}
+
+ template<int> struct B {
+ B();
+ B(const B&) = delete; // expected-note 3{{here}}
+ friend bool operator==(B, B); // expected-note 3{{passing}}
+ bool operator!=(const B&) const = default; // expected-error 3{{call to deleted constructor}}
+ };
+
+ bool b0 = B<0>() != B<0>(); // expected-note {{in defaulted equality comparison operator}}
+ bool b1 = B<1>().operator!=(B<1>()); // expected-note {{in defaulted equality comparison operator}}
+ int b2 = sizeof(&B<2>::operator!=); // expected-note {{in evaluation of exception specification}}
+}
diff --git a/src/llvm-project/clang/test/CXX/except/except.spec/p14-ir.cpp b/src/llvm-project/clang/test/CXX/except/except.spec/p14-ir.cpp
index af1d9a4..25f20c8 100644
--- a/src/llvm-project/clang/test/CXX/except/except.spec/p14-ir.cpp
+++ b/src/llvm-project/clang/test/CXX/except/except.spec/p14-ir.cpp
@@ -26,12 +26,12 @@
struct X5 : X0, X4 { };
void test(X2 x2, X3 x3, X5 x5) {
- // CHECK: define linkonce_odr void @_ZN2X2C1ERKS_(%struct.X2* %this, %struct.X2* dereferenceable({{[0-9]+}})) unnamed_addr
+ // CHECK: define linkonce_odr void @_ZN2X2C1ERKS_(%struct.X2* %this, %struct.X2* dereferenceable({{[0-9]+}}) %0) unnamed_addr
// CHECK: call void @_ZN2X2C2ERKS_({{.*}}) [[NUW:#[0-9]+]]
// CHECK-NEXT: ret void
// CHECK-NEXT: }
X2 x2a(x2);
- // CHECK: define linkonce_odr void @_ZN2X3C1ERKS_(%struct.X3* %this, %struct.X3* dereferenceable({{[0-9]+}})) unnamed_addr
+ // CHECK: define linkonce_odr void @_ZN2X3C1ERKS_(%struct.X3* %this, %struct.X3* dereferenceable({{[0-9]+}}) %0) unnamed_addr
// CHECK: call void @_ZN2X3C2ERKS_({{.*}}) [[NUW]]
// CHECK-NEXT: ret void
// CHECK-NEXT: }
diff --git a/src/llvm-project/clang/test/CXX/expr/expr.arith.conv/p2.cpp b/src/llvm-project/clang/test/CXX/expr/expr.arith.conv/p2.cpp
new file mode 100644
index 0000000..0df3e30
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/expr/expr.arith.conv/p2.cpp
@@ -0,0 +1,52 @@
+// RUN: %clang_cc1 -verify %s -std=c++17 -Weverything -Wno-deprecated -Wno-float-equal
+// RUN: %clang_cc1 -verify %s -std=c++2a -Wdeprecated
+
+static enum E1 {} e1, e1b;
+static enum E2 {} e2;
+static double d;
+extern void f();
+extern bool b;
+
+void f() {
+ void(e1 * e1);
+ void(e1 * e2); // expected-warning {{arithmetic between different enumeration types}}
+ void(e1 * d); // expected-warning {{arithmetic between enumeration type 'enum E1' and floating-point type 'double'}}
+ void(d * e1); // expected-warning {{arithmetic between floating-point type 'double' and enumeration type 'enum E1'}}
+
+ void(e1 + e1);
+ void(e1 + e2); // expected-warning {{arithmetic between different enumeration types}}
+ void(e1 + d); // expected-warning {{arithmetic between enumeration type 'enum E1' and floating-point type 'double'}}
+ void(d + e1); // expected-warning {{arithmetic between floating-point type 'double' and enumeration type 'enum E1'}}
+
+#if __cplusplus > 201703L
+ void(e1 <=> e1b); // expected-error {{include <compare>}}
+ void(e1 <=> e2); // expected-error {{invalid operands}}
+ void(e1 <=> d); // expected-error {{invalid operands}}
+ void(d <=> e1); // expected-error {{invalid operands}}
+#endif
+
+ void(e1 < e1b);
+ void(e1 < e2); // expected-warning {{comparison of different enumeration types}}
+ void(e1 < d); // expected-warning {{comparison of enumeration type 'enum E1' with floating-point type 'double'}}
+ void(d < e1); // expected-warning {{comparison of floating-point type 'double' with enumeration type 'enum E1'}}
+
+ void(e1 == e1b);
+ void(e1 == e2); // expected-warning {{comparison of different enumeration types}}
+ void(e1 == d); // expected-warning {{comparison of enumeration type 'enum E1' with floating-point type 'double'}}
+ void(d == e1); // expected-warning {{comparison of floating-point type 'double' with enumeration type 'enum E1'}}
+
+ void(b ? e1 : e1b);
+ void(b ? e1 : e2); // expected-warning {{conditional expression between different enumeration types}}
+ void(b ? e1 : d); // expected-warning {{conditional expression between enumeration type 'enum E1' and floating-point type 'double'}}
+ void(b ? d : e1); // expected-warning {{conditional expression between floating-point type 'double' and enumeration type 'enum E1'}}
+
+ void(e1 = e1b);
+ void(e1 = e2); // expected-error {{incompatible}}
+ void(e1 = d); // expected-error {{incompatible}}
+ void(d = e1); // FIXME: Should we warn on this?
+
+ void(e1 += e1b); // expected-error {{incompatible}}
+ void(e1 += e2); // expected-error {{incompatible}}
+ void(e1 += d); // expected-error {{incompatible}}
+ void(d += e1); // expected-warning {{compound assignment of floating-point type 'double' from enumeration type 'enum E1'}}
+}
diff --git a/src/llvm-project/clang/test/CXX/expr/expr.const/p2-0x.cpp b/src/llvm-project/clang/test/CXX/expr/expr.const/p2-0x.cpp
index f8db93b..cc6380e 100644
--- a/src/llvm-project/clang/test/CXX/expr/expr.const/p2-0x.cpp
+++ b/src/llvm-project/clang/test/CXX/expr/expr.const/p2-0x.cpp
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 -fsyntax-only -std=c++11 -pedantic -verify -fcxx-exceptions %s -fconstexpr-depth 128 -triple i686-pc-linux-gnu
+// RUN: %clang_cc1 -fsyntax-only -std=c++11 -pedantic -verify=expected,cxx11 -fcxx-exceptions %s -fconstexpr-depth 128 -triple i686-pc-linux-gnu
+// RUN: %clang_cc1 -fsyntax-only -std=c++2a -pedantic -verify=expected,cxx20 -fcxx-exceptions %s -fconstexpr-depth 128 -triple i686-pc-linux-gnu
// A conditional-expression is a core constant expression unless it involves one
// of the following as a potentially evaluated subexpression [...]:
@@ -157,13 +158,13 @@
constexpr int shl_unsigned_negative = unsigned(-3) << 1; // ok
constexpr int shl_unsigned_into_sign = 1u << 31; // ok
constexpr int shl_unsigned_overflow = 1024u << 31; // ok
- constexpr int shl_signed_negative = (-3) << 1; // expected-error {{constant expression}} expected-note {{left shift of negative value -3}}
+ constexpr int shl_signed_negative = (-3) << 1; // cxx11-error {{constant expression}} cxx11-note {{left shift of negative value -3}}
constexpr int shl_signed_ok = 1 << 30; // ok
constexpr int shl_signed_into_sign = 1 << 31; // ok (DR1457)
constexpr int shl_signed_into_sign_2 = 0x7fffffff << 1; // ok (DR1457)
- constexpr int shl_signed_off_end = 2 << 31; // expected-error {{constant expression}} expected-note {{signed left shift discards bits}} expected-warning {{signed shift result (0x100000000) requires 34 bits to represent, but 'int' only has 32 bits}}
- constexpr int shl_signed_off_end_2 = 0x7fffffff << 2; // expected-error {{constant expression}} expected-note {{signed left shift discards bits}} expected-warning {{signed shift result (0x1FFFFFFFC) requires 34 bits to represent, but 'int' only has 32 bits}}
- constexpr int shl_signed_overflow = 1024 << 31; // expected-error {{constant expression}} expected-note {{signed left shift discards bits}} expected-warning {{requires 43 bits to represent}}
+ constexpr int shl_signed_off_end = 2 << 31; // cxx11-error {{constant expression}} cxx11-note {{signed left shift discards bits}} expected-warning {{signed shift result (0x100000000) requires 34 bits to represent, but 'int' only has 32 bits}}
+ constexpr int shl_signed_off_end_2 = 0x7fffffff << 2; // cxx11-error {{constant expression}} cxx11-note {{signed left shift discards bits}} expected-warning {{signed shift result (0x1FFFFFFFC) requires 34 bits to represent, but 'int' only has 32 bits}}
+ constexpr int shl_signed_overflow = 1024 << 31; // cxx11-error {{constant expression}} cxx11-note {{signed left shift discards bits}} expected-warning {{requires 43 bits to represent}}
constexpr int shl_signed_ok2 = 1024 << 20; // ok
constexpr int shr_m1 = 0 >> -1; // expected-error {{constant expression}} expected-note {{negative shift count -1}}
@@ -291,7 +292,7 @@
// - a lambda-expression (5.1.2);
struct Lambda {
- int n : []{ return 1; }(); // expected-error {{constant expression}} expected-error {{integral constant expression}} expected-note {{non-literal type}}
+ int n : []{ return 1; }(); // cxx11-error {{constant expression}} cxx11-error {{integral constant expression}} cxx11-note {{non-literal type}}
};
// - an lvalue-to-rvalue conversion (4.1) unless it is applied to
@@ -360,7 +361,7 @@
extern const U pu;
constexpr const int *pua = &pu.a;
constexpr const int *pub = &pu.b;
- constexpr U pu = { .b = 1 }; // expected-warning {{C99 feature}}
+ constexpr U pu = { .b = 1 }; // cxx11-warning {{C++20 extension}}
constexpr const int a2 = *pua; // expected-error {{constant expression}} expected-note {{read of member 'a' of union with active member 'b'}}
constexpr const int b2 = *pub; // ok
}
@@ -402,7 +403,7 @@
struct S { int n; };
constexpr S s { 16 };
struct T {
- int n : dynamic_cast<const S*>(&s)->n; // expected-warning {{constant expression}} expected-note {{dynamic_cast}}
+ int n : dynamic_cast<const S*>(&s)->n; // cxx11-warning {{constant expression}} cxx11-note {{dynamic_cast}}
};
}
@@ -423,7 +424,7 @@
int k;
typedef int I;
struct T {
- int n : (k.~I(), 0); // expected-error {{constant expression}}
+ int n : (k.~I(), 1); // cxx11-warning {{constant expression}} cxx11-note {{pseudo-destructor}}
};
}
@@ -431,8 +432,8 @@
namespace IncDec {
int k = 2;
struct T {
- int n : ++k; // expected-error {{constant expression}}
- int m : --k; // expected-error {{constant expression}}
+ int n : ++k; // expected-error {{constant expression}} cxx20-note {{visible outside}}
+ int m : --k; // expected-error {{constant expression}} cxx20-note {{visible outside}}
};
}
@@ -446,7 +447,7 @@
namespace TypeId {
struct S { virtual void f(); };
constexpr S *p = 0;
- constexpr const std::type_info &ti1 = typeid(*p); // expected-error {{must be initialized by a constant expression}} expected-note {{typeid applied to expression of polymorphic type 'TypeId::S'}}
+ constexpr const std::type_info &ti1 = typeid(*p); // expected-error {{must be initialized by a constant expression}} cxx11-note {{typeid applied to expression of polymorphic type 'TypeId::S'}} cxx20-note {{dereferenced null pointer}}
struct T {} t;
constexpr const std::type_info &ti2 = typeid(t);
@@ -455,10 +456,10 @@
// - a new-expression (5.3.4);
// - a delete-expression (5.3.5);
namespace NewDelete {
- int *p = 0;
+ constexpr int *p = 0;
struct T {
- int n : *new int(4); // expected-error {{constant expression}}
- int m : (delete p, 2); // expected-error {{constant expression}}
+ int n : *new int(4); // expected-warning {{constant expression}} cxx11-note {{until C++20}} cxx20-note {{was not deallocated}}
+ int m : (delete p, 2); // cxx11-warning {{constant expression}} cxx11-note {{until C++20}}
};
}
@@ -471,22 +472,22 @@
// different objects that are not members of the same array or to different
// functions, or if only one of them is null, the results of p<q, p>q, p<=q,
// and p>=q are unspecified.
- constexpr bool u1 = p < q; // expected-error {{constant expression}}
- constexpr bool u2 = p > q; // expected-error {{constant expression}}
- constexpr bool u3 = p <= q; // expected-error {{constant expression}}
- constexpr bool u4 = p >= q; // expected-error {{constant expression}}
- constexpr bool u5 = p < (int*)0; // expected-error {{constant expression}}
- constexpr bool u6 = p <= (int*)0; // expected-error {{constant expression}}
- constexpr bool u7 = p > (int*)0; // expected-error {{constant expression}}
- constexpr bool u8 = p >= (int*)0; // expected-error {{constant expression}}
- constexpr bool u9 = (int*)0 < q; // expected-error {{constant expression}}
- constexpr bool u10 = (int*)0 <= q; // expected-error {{constant expression}}
- constexpr bool u11 = (int*)0 > q; // expected-error {{constant expression}}
- constexpr bool u12 = (int*)0 >= q; // expected-error {{constant expression}}
+ constexpr bool u1 = p < q; // expected-error {{constant expression}} expected-note {{comparison has unspecified value}}
+ constexpr bool u2 = p > q; // expected-error {{constant expression}} expected-note {{comparison has unspecified value}}
+ constexpr bool u3 = p <= q; // expected-error {{constant expression}} expected-note {{comparison has unspecified value}}
+ constexpr bool u4 = p >= q; // expected-error {{constant expression}} expected-note {{comparison has unspecified value}}
+ constexpr bool u5 = p < (int*)0; // expected-error {{constant expression}} expected-note {{comparison has unspecified value}}
+ constexpr bool u6 = p <= (int*)0; // expected-error {{constant expression}} expected-note {{comparison has unspecified value}}
+ constexpr bool u7 = p > (int*)0; // expected-error {{constant expression}} expected-note {{comparison has unspecified value}}
+ constexpr bool u8 = p >= (int*)0; // expected-error {{constant expression}} expected-note {{comparison has unspecified value}}
+ constexpr bool u9 = (int*)0 < q; // expected-error {{constant expression}} expected-note {{comparison has unspecified value}}
+ constexpr bool u10 = (int*)0 <= q; // expected-error {{constant expression}} expected-note {{comparison has unspecified value}}
+ constexpr bool u11 = (int*)0 > q; // expected-error {{constant expression}} expected-note {{comparison has unspecified value}}
+ constexpr bool u12 = (int*)0 >= q; // expected-error {{constant expression}} expected-note {{comparison has unspecified value}}
void f(), g();
constexpr void (*pf)() = &f, (*pg)() = &g;
- constexpr bool u13 = pf < pg; // expected-error {{constant expression}}
+ constexpr bool u13 = pf < pg; // expected-error {{constant expression}} expected-note {{comparison has unspecified value}}
constexpr bool u14 = pf == pg;
// If two pointers point to non-static data members of the same object with
@@ -537,11 +538,11 @@
constexpr void *pv = (void*)&s.a;
constexpr void *qv = (void*)&s.b;
constexpr bool v1 = null < (int*)0;
- constexpr bool v2 = null < pv; // expected-error {{constant expression}}
+ constexpr bool v2 = null < pv; // expected-error {{constant expression}} expected-note {{comparison has unspecified value}}
constexpr bool v3 = null == pv; // ok
constexpr bool v4 = qv == pv; // ok
constexpr bool v5 = qv >= pv; // expected-error {{constant expression}} expected-note {{unequal pointers to void}}
- constexpr bool v6 = qv > null; // expected-error {{constant expression}}
+ constexpr bool v6 = qv > null; // expected-error {{constant expression}} expected-note {{comparison has unspecified value}}
constexpr bool v7 = qv <= (void*)&s.b; // ok
constexpr bool v8 = qv > (void*)&s.a; // expected-error {{constant expression}} expected-note {{unequal pointers to void}}
}
@@ -550,8 +551,8 @@
namespace Assignment {
int k;
struct T {
- int n : (k = 9); // expected-error {{constant expression}}
- int m : (k *= 2); // expected-error {{constant expression}}
+ int n : (k = 9); // expected-error {{constant expression}} cxx20-note {{visible outside}}
+ int m : (k *= 2); // expected-error {{constant expression}} cxx20-note {{visible outside}}
};
struct Literal {
diff --git a/src/llvm-project/clang/test/CXX/expr/expr.const/p6-2a.cpp b/src/llvm-project/clang/test/CXX/expr/expr.const/p6-2a.cpp
new file mode 100644
index 0000000..312c283
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/expr/expr.const/p6-2a.cpp
@@ -0,0 +1,43 @@
+// RUN: %clang_cc1 -std=c++2a -verify %s
+
+constexpr int non_class = 42;
+constexpr int arr_non_class[5] = {1, 2, 3};
+
+struct A {
+ int member = 1;
+ constexpr ~A() { member = member + 1; }
+};
+constexpr A class_ = {};
+constexpr A arr_class[5] = {{}, {}};
+
+struct Mutable {
+ mutable int member = 1; // expected-note {{declared here}}
+ constexpr ~Mutable() { member = member + 1; } // expected-note {{read of mutable member}}
+};
+constexpr Mutable mut_member; // expected-error {{must have constant destruction}} expected-note {{in call}}
+
+struct MutableStore {
+ mutable int member = 1; // expected-note {{declared here}}
+ constexpr ~MutableStore() { member = 2; } // expected-note {{assignment to mutable member}}
+};
+constexpr MutableStore mut_store; // expected-error {{must have constant destruction}} expected-note {{in call}}
+
+// Note: the constant destruction rules disallow this example even though hcm.n is a const object.
+struct MutableConst {
+ struct HasConstMember {
+ const int n = 4;
+ };
+ mutable HasConstMember hcm; // expected-note {{here}}
+ constexpr ~MutableConst() {
+ int q = hcm.n; // expected-note {{read of mutable}}
+ }
+};
+constexpr MutableConst mc; // expected-error {{must have constant destruction}} expected-note {{in call}}
+
+struct Temporary {
+ int &&temp;
+ constexpr ~Temporary() {
+ int n = temp; // expected-note {{outside the expression that created the temporary}}
+ }
+};
+constexpr Temporary t = {3}; // expected-error {{must have constant destruction}} expected-note {{created here}} expected-note {{in call}}
diff --git a/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.id/mixed-constraints.cpp b/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.id/mixed-constraints.cpp
new file mode 100644
index 0000000..6add2c5
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.id/mixed-constraints.cpp
@@ -0,0 +1,18 @@
+// RUN: %clang_cc1 -std=c++2a -verify %s
+
+template<typename T> requires (sizeof(T) >= 4 && sizeof(T) <= 10)
+// expected-note@-1{{because 'sizeof(char [20]) <= 10' (20 <= 10) evaluated to false}}
+// expected-note@-2{{because 'sizeof(char) >= 4' (1 >= 4) evaluated to false}}
+void foo() requires (sizeof(T) <= 8) {}
+// expected-note@-1{{candidate template ignored: constraints not satisfied [with T = char]}}
+// expected-note@-2{{candidate template ignored: constraints not satisfied [with T = char [9]]}}
+// expected-note@-3{{candidate template ignored: constraints not satisfied [with T = char [20]]}}
+// expected-note@-4{{because 'sizeof(char [9]) <= 8' (9 <= 8) evaluated to false}}
+
+void bar() {
+ foo<char>(); // expected-error{{no matching function for call to 'foo'}}
+ foo<int>();
+ foo<unsigned long long int>();
+ foo<char[9]>(); // expected-error{{no matching function for call to 'foo'}}
+ foo<char[20]>(); // expected-error{{no matching function for call to 'foo'}}
+}
\ No newline at end of file
diff --git a/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.id/p3.cpp b/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.id/p3.cpp
new file mode 100644
index 0000000..30ec2a3
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.id/p3.cpp
@@ -0,0 +1,200 @@
+// RUN: %clang_cc1 -std=c++2a -verify -triple x86_64-linux-gnu %s
+
+template<typename T> concept C1 = true; // expected-note{{template is declared here}}
+static_assert(C1<int>);
+static_assert(C1);
+// expected-error@-1{{use of concept 'C1' requires template arguments}}
+
+template<typename T> concept C2 = sizeof(T) == 4;
+static_assert(C2<int>);
+static_assert(!C2<long long int>);
+static_assert(C2<char[4]>);
+static_assert(!C2<char[5]>);
+
+template<typename T> concept C3 = sizeof(*T{}) == 4;
+static_assert(C3<int*>);
+static_assert(!C3<long long int>);
+
+struct A {
+ static constexpr int add(int a, int b) {
+ return a + b;
+ }
+};
+struct B {
+ static int add(int a, int b) { // expected-note{{declared here}}
+ return a + b;
+ }
+};
+template<typename U>
+concept C4 = U::add(1, 2) == 3;
+// expected-error@-1{{substitution into constraint expression resulted in a non-constant expression}}
+// expected-note@-2{{non-constexpr function 'add' cannot be used in a constant expression}}
+static_assert(C4<A>);
+static_assert(!C4<B>); // expected-note {{while checking the satisfaction of concept 'C4<B>' requested here}}
+
+template<typename T, typename U>
+constexpr bool is_same_v = false;
+
+template<typename T>
+constexpr bool is_same_v<T, T> = true;
+
+template<typename T, typename U>
+concept Same = is_same_v<T, U>;
+
+static_assert(Same<int, int>);
+static_assert(Same<int, decltype(1)>);
+static_assert(!Same<int, unsigned int>);
+static_assert(!Same<A, B>);
+static_assert(Same<A, A>);
+
+static_assert(Same<bool, decltype(C1<int>)>);
+static_assert(Same<bool, decltype(C2<int>)>);
+static_assert(Same<bool, decltype(C3<int*>)>);
+static_assert(Same<bool, decltype(C4<A>)>);
+
+template<typename T> concept C5 = T{}; // expected-error {{atomic constraint must be of type 'bool' (found 'int')}}
+constexpr bool x = C5<int>; // expected-note {{while checking the satisfaction of concept 'C5<int>' requested here}}
+
+template<int x>
+concept IsEven = (x % 2) == 0;
+
+static_assert(IsEven<20>);
+static_assert(!IsEven<11>);
+
+template<template<typename T> typename P>
+concept IsTypePredicate = is_same_v<decltype(P<bool>::value), const bool>
+ && is_same_v<decltype(P<int>::value), const bool>
+ && is_same_v<decltype(P<long long>::value), const bool>;
+
+template<typename T> struct T1 {};
+template<typename T> struct T2 { static constexpr bool value = sizeof(T) == 2; };
+
+static_assert(IsTypePredicate<T2>);
+static_assert(!IsTypePredicate<T1>);
+
+template<typename T, typename U, typename... Ts>
+concept OneOf = (Same<T, Ts> || ...);
+
+static_assert(OneOf<int, long, int>);
+static_assert(!OneOf<long, int, char, char>);
+
+namespace piecewise_substitution {
+ template <typename T>
+ concept True = true;
+
+ template <typename T>
+ concept A = True<T> || T::value;
+
+ template <typename T>
+ concept B = (True<T> || T::value);
+
+ template <typename T>
+ concept C = !True<T> && T::value || true;
+
+ template <typename T>
+ concept D = (!True<T> && T::value) || true;
+
+ template <typename T>
+ concept E = T::value || True<T>;
+
+ template <typename T>
+ concept F = (T::value || True<T>);
+
+ template <typename T>
+ concept G = T::value && !True<T> || true;
+
+ template <typename T>
+ concept H = (T::value && !True<T>) || true;
+
+ template <typename T>
+ concept I = T::value;
+
+ static_assert(A<int>);
+ static_assert(B<int>);
+ static_assert(C<int>);
+ static_assert(D<int>);
+ static_assert(E<int>);
+ static_assert(F<int>);
+ static_assert(G<int>);
+ static_assert(H<int>);
+ static_assert(!I<int>);
+}
+
+// Short ciruiting
+
+template<typename T> struct T3 { using type = typename T::type; };
+// expected-error@-1{{type 'char' cannot be used prior to '::' because it has no members}}
+// expected-error@-2{{type 'short' cannot be used prior to '::' because it has no members}}
+
+template<typename T>
+concept C6 = sizeof(T) == 1 && sizeof(typename T3<T>::type) == 1;
+// expected-note@-1{{while substituting template arguments into constraint expression here}}
+// expected-note@-2{{in instantiation of template class 'T3<char>' requested here}}
+
+template<typename T>
+concept C7 = sizeof(T) == 1 || sizeof(
+// expected-note@-1{{while substituting template arguments into constraint expression here}}
+ typename
+ T3<T>
+// expected-note@-1{{in instantiation of template class 'T3<short>' requested here}}
+ ::type) == 1;
+
+static_assert(!C6<short>);
+static_assert(!C6<char>); // expected-note{{while checking the satisfaction of concept 'C6<char>' requested here}}
+static_assert(C7<char>);
+static_assert(!C7<short>); // expected-note{{while checking the satisfaction of concept 'C7<short>' requested here}}
+
+// Make sure argument list is converted when instantiating a CSE.
+
+template<typename T, typename U = int>
+concept SameSize = sizeof(T) == sizeof(U);
+
+template<typename T>
+struct X { static constexpr bool a = SameSize<T>; };
+
+static_assert(X<unsigned>::a);
+
+// static_assert concept diagnostics
+template<typename T>
+concept Large = sizeof(T) > 100;
+// expected-note@-1 2{{because 'sizeof(small) > 100' (1 > 100) evaluated to false}}
+
+struct small { };
+static_assert(Large<small>);
+// expected-error@-1 {{static_assert failed}}
+// expected-note@-2 {{because 'small' does not satisfy 'Large'}}
+static_assert(Large<small>, "small isn't large");
+// expected-error@-1 {{static_assert failed "small isn't large"}}
+// expected-note@-2 {{because 'small' does not satisfy 'Large'}}
+
+// Make sure access-checking can fail a concept specialization
+
+class T4 { static constexpr bool f = true; };
+template<typename T> concept AccessPrivate = T{}.f;
+// expected-note@-1{{because substituted constraint expression is ill-formed: 'f' is a private member of 'T4'}}
+static_assert(AccessPrivate<T4>);
+// expected-error@-1{{static_assert failed}}
+// expected-note@-2{{because 'T4' does not satisfy 'AccessPrivate'}}
+
+template<typename T, typename U>
+// expected-note@-1{{template parameter is declared here}}
+concept C8 = sizeof(T) > sizeof(U);
+
+template<typename... T>
+constexpr bool B8 = C8<T...>;
+// expected-error@-1{{pack expansion used as argument for non-pack parameter of concept}}
+
+
+// Make sure we correctly check for containsUnexpandedParameterPack
+
+template<typename T>
+concept C9 = true;
+
+template <typename Fn, typename... Args>
+using invoke = typename Fn::template invoke<Args...>;
+
+template <typename C, typename... L>
+// The converted argument here will not containsUnexpandedParameterPack, but the
+// as-written one will.
+requires (C9<invoke<C, L>> &&...)
+struct S { };
diff --git a/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.id/p4.cpp b/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.id/p4.cpp
new file mode 100644
index 0000000..d3dde10
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.id/p4.cpp
@@ -0,0 +1,61 @@
+// RUN: %clang_cc1 -std=c++2a -verify %s
+
+namespace functions
+{
+ void foo(int) requires false {}
+ // expected-note@-1 3{{because 'false' evaluated to false}}
+ // expected-note@-2 {{candidate function not viable: constraints not satisfied}}
+ void bar(int) requires true {}
+
+ void a(int);
+ void a(double);
+
+ void baz() {
+ foo(1); // expected-error{{no matching function for call to 'foo'}}
+ bar(1);
+ void (*p1)(int) = foo; // expected-error{{invalid reference to function 'foo': constraints not satisfied}}
+ void (*p3)(int) = bar;
+ decltype(foo)* a1 = nullptr; // expected-error{{invalid reference to function 'foo': constraints not satisfied}}
+ decltype(bar)* a2 = nullptr;
+ }
+}
+
+namespace methods
+{
+ template<typename T>
+ struct A {
+ static void foo(int) requires (sizeof(T) == 1) {} // expected-note 3{{because 'sizeof(char [2]) == 1' (2 == 1) evaluated to false}}
+ static void bar(int) requires (sizeof(T) == 2) {} // expected-note 3{{because 'sizeof(char) == 2' (1 == 2) evaluated to false}}
+ // Make sure the function body is not instantiated before constraints are checked.
+ static auto baz(int) requires (sizeof(T) == 2) { return T::foo(); } // expected-note{{because 'sizeof(char) == 2' (1 == 2) evaluated to false}}
+ };
+
+ void baz() {
+ A<char>::foo(1);
+ A<char>::bar(1); // expected-error{{invalid reference to function 'bar': constraints not satisfied}}
+ A<char>::baz(1); // expected-error{{invalid reference to function 'baz': constraints not satisfied}}
+ A<char[2]>::foo(1); // expected-error{{invalid reference to function 'foo': constraints not satisfied}}
+ A<char[2]>::bar(1);
+ void (*p1)(int) = A<char>::foo;
+ void (*p2)(int) = A<char>::bar; // expected-error{{invalid reference to function 'bar': constraints not satisfied}}
+ void (*p3)(int) = A<char[2]>::foo; // expected-error{{invalid reference to function 'foo': constraints not satisfied}}
+ void (*p4)(int) = A<char[2]>::bar;
+ decltype(A<char>::foo)* a1 = nullptr;
+ decltype(A<char>::bar)* a2 = nullptr; // expected-error{{invalid reference to function 'bar': constraints not satisfied}}
+ decltype(A<char[2]>::foo)* a3 = nullptr; // expected-error{{invalid reference to function 'foo': constraints not satisfied}}
+ decltype(A<char[2]>::bar)* a4 = nullptr;
+ }
+}
+
+namespace operators
+{
+ template<typename T>
+ struct A {
+ A<T> operator-(A<T> b) requires (sizeof(T) == 1) { return b; } // expected-note{{because 'sizeof(int) == 1' (4 == 1) evaluated to false}}
+ };
+
+ void baz() {
+ auto* x = &A<int>::operator-; // expected-error{{invalid reference to function 'operator-': constraints not satisfied}}
+ auto y = &A<char>::operator-;
+ }
+}
\ No newline at end of file
diff --git a/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.lambda/expr.prim.lambda.closure/p3.cpp b/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.lambda/expr.prim.lambda.closure/p3.cpp
new file mode 100644
index 0000000..9c5765b
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.lambda/expr.prim.lambda.closure/p3.cpp
@@ -0,0 +1,20 @@
+// RUN: %clang_cc1 -std=c++2a -verify %s
+
+auto l1 = [] (auto x) requires (sizeof(decltype(x)) == 1) { return x; };
+// expected-note@-1{{candidate template ignored: constraints not satisfied [with x:auto = int]}}
+// expected-note@-2{{because 'sizeof(decltype(x)) == 1' (4 == 1) evaluated to false}}
+
+auto l1t1 = l1('a');
+auto l1t2 = l1(1);
+// expected-error@-1{{no matching function for call to object of type '(lambda at}}
+
+auto l2 = [] (auto... x) requires ((sizeof(decltype(x)) >= 2) && ...) { return (x + ...); };
+// expected-note@-1{{candidate template ignored: constraints not satisfied [with x:auto = <char>]}}
+// expected-note@-2{{candidate template ignored: constraints not satisfied [with x:auto = <int, char>]}}
+// expected-note@-3 2{{because 'sizeof(decltype(x)) >= 2' (1 >= 2) evaluated to false}}
+
+auto l2t1 = l2('a');
+// expected-error@-1{{no matching function for call to object of type '(lambda at}}
+auto l2t2 = l2(1, 'a');
+// expected-error@-1{{no matching function for call to object of type '(lambda at}}
+auto l2t3 = l2((short)1, (short)1);
\ No newline at end of file
diff --git a/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p11-1y.cpp b/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p11-1y.cpp
index 63e51a7..7fd94b6 100644
--- a/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p11-1y.cpp
+++ b/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p11-1y.cpp
@@ -27,7 +27,7 @@
struct ExplicitCopy {
ExplicitCopy(); // expected-note 2{{not viable}}
- explicit ExplicitCopy(const ExplicitCopy&);
+ explicit ExplicitCopy(const ExplicitCopy&); // expected-note 2{{not a candidate}}
};
auto init_kind_1 = [ec(ExplicitCopy())] {};
auto init_kind_2 = [ec = ExplicitCopy()] {}; // expected-error {{no matching constructor}}
diff --git a/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p5.cpp b/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p5.cpp
index b8504d4..2a99ff0ea 100644
--- a/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p5.cpp
+++ b/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p5.cpp
@@ -3,7 +3,7 @@
// An attribute-specifier-seq in a lambda-declarator appertains to the
// type of the corresponding function call operator.
void test_attributes() {
- auto nrl = [](int x) -> int { if (x > 0) return x; }; // expected-warning{{control may reach end of non-void lambda}}
+ auto nrl = [](int x) -> int { if (x > 0) return x; }; // expected-warning{{on-void lambda does not return a value in all control paths}}
// FIXME: GCC accepts the [[gnu::noreturn]] attribute here.
auto nrl2 = []() [[gnu::noreturn]] { return; }; // expected-warning{{attribute 'noreturn' ignored}}
diff --git a/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p7.cpp b/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p7.cpp
index 9dbe2e1..73714f1 100644
--- a/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p7.cpp
+++ b/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p7.cpp
@@ -2,7 +2,7 @@
// Check that analysis-based warnings work in lambda bodies.
void analysis_based_warnings() {
- (void)[]() -> int { }; // expected-warning{{control reaches end of non-void lambda}}
+ (void)[]() -> int { }; // expected-warning{{non-void lambda does not return a value}}
}
// Check that we get the right types of captured variables (the
diff --git a/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p8.cpp b/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p8.cpp
index 1cc1fd9..7c95245 100644
--- a/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p8.cpp
+++ b/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p8.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++11 %s -verify -Wno-c++1y-extensions
+// RUN: %clang_cc1 -std=c++11 %s -verify -Wno-c++14-extensions
class X0 {
void explicit_capture() {
@@ -8,7 +8,7 @@
(void)[this, this] () {}; // expected-error {{'this' can appear only once}}
(void)[=, foo] () {}; // expected-error {{'&' must precede a capture when}}
(void)[=, &foo] () {};
- (void)[=, this] () {}; // expected-warning {{C++2a extension}}
+ (void)[=, this] () {}; // expected-warning {{C++20 extension}}
(void)[&, foo] () {};
(void)[&, &foo] () {}; // expected-error {{'&' cannot precede a capture when}}
(void)[&, this] () {};
@@ -23,7 +23,7 @@
void S2::f(int i) {
(void)[&, i]{ };
(void)[&, &i]{ }; // expected-error{{'&' cannot precede a capture when the capture default is '&'}}
- (void)[=, this]{ }; // expected-warning{{C++2a extension}}
+ (void)[=, this]{ }; // expected-warning{{C++20 extension}}
(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}}
diff --git a/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.req/compound-requirement.cpp b/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.req/compound-requirement.cpp
new file mode 100644
index 0000000..19b794b
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.req/compound-requirement.cpp
@@ -0,0 +1,175 @@
+// RUN: %clang_cc1 -std=c++2a -x c++ %s -verify
+
+static_assert(requires { { 0 }; });
+static_assert(requires { { "aaaa" }; });
+static_assert(requires { { (0).da }; }); // expected-error{{member reference base type 'int' is not a structure or union}}
+
+void foo() {}
+static_assert(requires { { foo() }; });
+
+// Substitution failure in expression
+
+struct A {};
+struct B {
+ B operator+(const B &other) const { return other; }
+};
+struct C {
+ C operator+(C &other) const { return other; }
+};
+
+template<typename T> requires requires (T a, const T& b) { { a + b }; } // expected-note{{because 'a + b' would be invalid: invalid operands to binary expression ('A' and 'const A')}} expected-note{{because 'a + b' would be invalid: invalid operands to binary expression ('C' and 'const C')}}
+struct r1 {};
+
+using r1i1 = r1<int>;
+using r1i2 = r1<A>; // expected-error{{constraints not satisfied for class template 'r1' [with T = A]}}
+using r1i3 = r1<B>;
+using r1i4 = r1<C>; // expected-error{{constraints not satisfied for class template 'r1' [with T = C]}}
+
+struct D { void foo() {} };
+
+template<typename T> requires requires (T a) { { a.foo() }; } // expected-note{{because 'a.foo()' would be invalid: no member named 'foo' in 'A'}} expected-note{{because 'a.foo()' would be invalid: member reference base type 'int' is not a structure or union}} expected-note{{because 'a.foo()' would be invalid: 'this' argument to member function 'foo' has type 'const D', but function is not marked const}}
+struct r2 {};
+
+using r2i1 = r2<int>; // expected-error{{constraints not satisfied for class template 'r2' [with T = int]}}
+using r2i2 = r2<A>; // expected-error{{constraints not satisfied for class template 'r2' [with T = A]}}
+using r2i3 = r2<D>;
+using r2i4 = r2<const D>; // expected-error{{constraints not satisfied for class template 'r2' [with T = const D]}}
+
+template<typename T> requires requires { { sizeof(T) }; } // expected-note{{because 'sizeof(T)' would be invalid: invalid application of 'sizeof' to an incomplete type 'void'}} expected-note{{because 'sizeof(T)' would be invalid: invalid application of 'sizeof' to an incomplete type 'nonexistent'}}
+struct r3 {};
+
+using r3i1 = r3<int>;
+using r3i2 = r3<A>;
+using r3i3 = r3<A &>;
+using r3i4 = r3<void>; // expected-error{{constraints not satisfied for class template 'r3' [with T = void]}}
+using r3i4 = r3<class nonexistent>; // expected-error{{constraints not satisfied for class template 'r3' [with T = nonexistent]}}
+
+// Non-dependent expressions
+
+template<typename T> requires requires (T t) { { 0 }; { "a" }; { (void)'a' }; }
+struct r4 {};
+
+using r4i1 = r4<int>;
+using r4i2 = r4<int[10]>;
+using r4i3 = r4<int(int)>;
+
+// Noexcept requirement
+void maythrow() { }
+static_assert(!requires { { maythrow() } noexcept; });
+static_assert(requires { { 1 } noexcept; });
+
+struct E { void operator++(int) noexcept; };
+struct F { void operator++(int); };
+
+template<typename T> requires requires (T t) { { t++ } noexcept; } // expected-note{{because 't ++' may throw an exception}}
+struct r5 {};
+
+using r5i1 = r5<int>;
+using r5i2 = r5<E>;
+using r5i2 = r5<F>; // expected-error{{constraints not satisfied for class template 'r5' [with T = F]}}
+
+template<typename T> requires requires (T t) { { t.foo() } noexcept; } // expected-note{{because 't.foo()' would be invalid: no member named 'foo' in 'E'}}
+struct r6 {};
+
+using r6i = r6<E>; // expected-error{{constraints not satisfied for class template 'r6' [with T = E]}}
+
+template<typename T, typename U>
+constexpr bool is_same_v = false;
+
+template<typename T>
+constexpr bool is_same_v<T, T> = true;
+
+template<typename T, typename U>
+concept Same = is_same_v<T, U>;
+
+template<typename T>
+concept Large = sizeof(T) >= 4; // expected-note{{because 'sizeof(short) >= 4' (2 >= 4) evaluated to false}}
+
+template<typename T> requires requires (T t) { { t } -> Large; } // expected-note{{because 'decltype(t)' (aka 'short') does not satisfy 'Large':}}
+struct r7 {};
+
+using r7i1 = r7<int>;
+using r7i2 = r7<short>; // expected-error{{constraints not satisfied for class template 'r7' [with T = short]}}
+
+template<typename T> requires requires (T t) { { t } -> Same<T>; }
+struct r8 {};
+
+using r8i1 = r8<int>;
+using r8i2 = r8<short*>;
+
+// Substitution failure in type constraint
+
+template<typename T> requires requires (T t) { { t } -> Same<typename T::type>; } // expected-note{{because 'Same<expr-type, typename T::type>' would be invalid: type 'int' cannot be used prior to '::' because it has no members}}
+struct r9 {};
+
+struct M { using type = M; };
+
+using r9i1 = r9<M>;
+using r9i2 = r9<int>; // expected-error{{constraints not satisfied for class template 'r9' [with T = int]}}
+
+// Substitution failure in both expression and return type requirement
+
+template<typename T> requires requires (T t) { { t.foo() } -> Same<typename T::type>; } // expected-note{{because 't.foo()' would be invalid: member reference base type 'int' is not a structure or union}}
+struct r10 {};
+
+using r10i = r10<int>; // expected-error{{constraints not satisfied for class template 'r10' [with T = int]}}
+
+// Non-type concept in type constraint
+
+template<int T>
+concept IsEven = (T % 2) == 0;
+
+template<typename T> requires requires (T t) { { t } -> IsEven; } // expected-error{{concept named in type constraint is not a type concept}}
+struct r11 {};
+
+// C++ [expr.prim.req.compound] Example
+namespace std_example {
+ template<typename T> concept C1 =
+ requires(T x) {
+ {x++};
+ };
+
+ template<typename T, typename U> constexpr bool is_same_v = false;
+ template<typename T> constexpr bool is_same_v<T, T> = true;
+
+ template<typename T, typename U> concept same_as = is_same_v<T, U>;
+ // expected-note@-1 {{because 'is_same_v<int, int *>' evaluated to false}}
+
+ static_assert(C1<int>);
+ static_assert(C1<int*>);
+ template<C1 T> struct C1_check {};
+ using c1c1 = C1_check<int>;
+ using c1c2 = C1_check<int[10]>;
+
+ template<typename T> concept C2 =
+ requires(T x) {
+ {*x} -> same_as<typename T::inner>;
+ // expected-note@-1{{because type constraint 'same_as<int, typename T2::inner>' was not satisfied:}}
+ // expected-note@-2{{because '*x' would be invalid: indirection requires pointer operand ('int' invalid)}}
+ };
+
+ struct T1 {
+ using inner = int;
+ inner operator *() { return 0; }
+ };
+ struct T2 {
+ using inner = int *;
+ int operator *() { return 0; }
+ };
+ static_assert(C2<T1>);
+ template<C2 T> struct C2_check {}; // expected-note{{because 'int' does not satisfy 'C2'}} expected-note{{because 'std_example::T2' does not satisfy 'C2'}}
+ using c2c1 = C2_check<int>; // expected-error{{constraints not satisfied for class template 'C2_check' [with T = int]}}
+ using c2c2 = C2_check<T2>; // expected-error{{constraints not satisfied for class template 'C2_check' [with T = std_example::T2]}}
+
+ template<typename T>
+ void g(T t) noexcept(sizeof(T) == 1) {}
+
+ template<typename T> concept C5 =
+ requires(T x) {
+ {g(x)} noexcept; // expected-note{{because 'g(x)' may throw an exception}}
+ };
+
+ static_assert(C5<char>);
+ template<C5 T> struct C5_check {}; // expected-note{{because 'short' does not satisfy 'C5'}}
+ using c5 = C5_check<short>; // expected-error{{constraints not satisfied for class template 'C5_check' [with T = short]}}
+}
\ No newline at end of file
diff --git a/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.req/equivalence.cpp b/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.req/equivalence.cpp
new file mode 100644
index 0000000..8a36d7a
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.req/equivalence.cpp
@@ -0,0 +1,125 @@
+// RUN: %clang_cc1 -std=c++2a -x c++ %s -verify
+
+template<typename T, typename U> constexpr bool is_same_v = false;
+template<typename T> constexpr bool is_same_v<T, T> = true;
+
+template<typename T> struct identity { using type = T; };
+template<typename T> using identity_t = T;
+
+// Type requirements
+template<typename T> requires requires { typename identity_t<T>; }
+struct r1;
+template<typename U> requires requires { typename identity_t<U>; } // expected-note{{previous template declaration is here}}
+struct r1;
+template<typename T> requires requires { typename identity_t<T*>; } // expected-error{{requires clause differs in template redeclaration}}
+struct r1;
+template<typename T> requires requires { typename ::identity_t<T>; }
+struct r1;
+
+template<typename Y> requires requires { typename identity<Y>::type; }
+struct r2;
+template<typename U> requires requires { typename identity<U>::type; }
+struct r2;
+template<typename T> requires requires { typename ::identity<T>::type; } // expected-note 2{{previous template declaration is here}}
+struct r2;
+template<typename T> requires requires { typename identity<T>::typr; } // expected-error{{requires clause differs in template redeclaration}}
+struct r2;
+namespace ns {
+ template<typename T> struct identity { using type = T; };
+}
+template<typename T> requires requires { typename ns::identity<T>::type; } // expected-error{{requires clause differs in template redeclaration}}
+struct r2;
+
+template<typename T> requires requires { typename T::template identity<T>::type; }
+struct r3;
+template<typename U> requires requires { typename U::template identity<U>::type; } // expected-note{{previous template declaration is here}}
+struct r3;
+template<typename T> requires requires { typename T::template identitr<T>::type; } // expected-error{{requires clause differs in template redeclaration}}
+struct r3;
+
+template<typename T> requires requires { typename T::template temp<>; }
+struct r4;
+template<typename U> requires requires { typename U::template temp<>; }
+struct r4;
+
+// Expr requirements
+template<typename T> requires requires { 0; } // expected-note{{previous template declaration is here}}
+struct r5;
+template<typename T> requires requires { 1; } // expected-error{{requires clause differs in template redeclaration}}
+struct r5;
+
+template<typename T>
+concept C1 = true;
+
+template<typename T> requires requires { sizeof(T); }
+struct r6;
+template<typename U> requires requires { sizeof(U); } // expected-note{{previous template declaration is here}}
+struct r6;
+template<typename U> requires requires { sizeof(U) - 1; } // expected-error{{requires clause differs in template redeclaration}}
+struct r6;
+template<typename T> requires requires { { sizeof(T) }; } // expected-note 2{{previous template declaration is here}}
+struct r6;
+template<typename T> requires requires { { sizeof(T) } noexcept; } // expected-error{{requires clause differs in template redeclaration}}
+struct r6;
+template<typename T> requires requires { { sizeof(T) } -> C1; } // expected-error{{requires clause differs in template redeclaration}}
+struct r6;
+
+template<typename T> requires requires { { sizeof(T) } -> C1; }
+struct r7;
+template<typename U> requires requires { { sizeof(U) } -> C1; }
+struct r7;
+template<typename T> requires requires { { sizeof(T) } -> C1<>; } // expected-note {{previous template declaration is here}}
+struct r7;
+template<typename U> requires requires { { sizeof(U) }; } // expected-error{{requires clause differs in template redeclaration}}
+struct r7;
+
+template<typename T, typename U>
+concept C2 = true;
+
+template<typename T> requires requires { { sizeof(T) } -> C2<T>; }
+struct r8;
+template<typename U> requires requires { { sizeof(U) } -> C2<U>; } // expected-note{{previous template declaration is here}}
+struct r8;
+template<typename T> requires requires { { sizeof(T) } -> C2<T*>; } // expected-error{{requires clause differs in template redeclaration}}
+struct r8;
+
+// Nested requirements
+template<typename T> requires requires { requires sizeof(T) == 0; }
+struct r9;
+template<typename U> requires requires { requires sizeof(U) == 0; } // expected-note{{previous template declaration is here}}
+struct r9;
+template<typename T> requires requires { requires sizeof(T) == 1; } // expected-error{{requires clause differs in template redeclaration}}
+struct r9;
+
+// Parameter list
+template<typename T> requires requires { requires true; }
+struct r10;
+template<typename T> requires requires() { requires true; } // expected-note{{previous template declaration is here}}
+struct r10;
+template<typename T> requires requires(T i) { requires true; } // expected-error{{requires clause differs in template redeclaration}}
+struct r10;
+
+template<typename T> requires requires(T i, T *j) { requires true; } // expected-note 2{{previous template declaration is here}}
+struct r11;
+template<typename T> requires requires(T i) { requires true; } // expected-error{{requires clause differs in template redeclaration}}
+struct r11;
+template<typename T> requires requires(T i, T *j, T &k) { requires true; } // expected-error{{requires clause differs in template redeclaration}}
+struct r11;
+
+// Parameter names
+template<typename T> requires requires(int i) { requires sizeof(i) == 1; }
+struct r12;
+template<typename T> requires requires(int j) { requires sizeof(j) == 1; } // expected-note 2{{previous template declaration is here}}
+struct r12;
+template<typename T> requires requires(int k) { requires sizeof(k) == 2; } // expected-error{{requires clause differs in template redeclaration}}
+struct r12;
+template<typename T> requires requires(const int k) { requires sizeof(k) == 1; } // expected-error{{requires clause differs in template redeclaration}}
+struct r12;
+
+// Order of requirements
+template<typename T> requires requires { requires true; 0; }
+struct r13;
+template<typename T> requires requires { requires true; 0; } // expected-note{{previous template declaration is here}}
+struct r13;
+template<typename T> requires requires { 0; requires true; } // expected-error{{requires clause differs in template redeclaration}}
+struct r13;
diff --git a/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.req/nested-requirement.cpp b/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.req/nested-requirement.cpp
new file mode 100644
index 0000000..b45b57f
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.req/nested-requirement.cpp
@@ -0,0 +1,47 @@
+// RUN: %clang_cc1 -std=c++2a -x c++ %s -verify
+
+static_assert(requires { requires true; });
+
+template<typename T> requires requires { requires false; } // expected-note{{because 'false' evaluated to false}}
+struct r1 {};
+
+using r1i = r1<int>; // expected-error{{constraints not satisfied for class template 'r1' [with T = int]}}
+
+template<typename T> requires requires { requires sizeof(T) == 0; } // expected-note{{because 'sizeof(int) == 0' (4 == 0) evaluated to false}}
+struct r2 {};
+
+using r2i = r2<int>; // expected-error{{constraints not satisfied for class template 'r2' [with T = int]}}
+
+template<typename T> requires requires (T t) { requires sizeof(t) == 0; } // expected-note{{because 'sizeof (t) == 0' (4 == 0) evaluated to false}}
+struct r3 {};
+
+using r3i = r3<int>; // expected-error{{constraints not satisfied for class template 'r3' [with T = int]}}
+
+template<typename T>
+struct X {
+ template<typename U> requires requires (U u) { requires sizeof(u) == sizeof(T); } // expected-note{{because 'sizeof (u) == sizeof(T)' would be invalid: invalid application of 'sizeof' to an incomplete type 'void'}}
+ struct r4 {};
+};
+
+using r4i = X<void>::r4<int>; // expected-error{{constraints not satisfied for class template 'r4' [with U = int]}}
+
+// C++ [expr.prim.req.nested] Examples
+namespace std_example {
+ template<typename U> concept C1 = sizeof(U) == 1; // expected-note{{because 'sizeof(int) == 1' (4 == 1) evaluated to false}}
+ template<typename T> concept D =
+ requires (T t) {
+ requires C1<decltype (+t)>; // expected-note{{because 'decltype(+t)' (aka 'int') does not satisfy 'C1'}}
+ };
+
+ struct T1 { char operator+() { return 'a'; } };
+ static_assert(D<T1>);
+ template<D T> struct D_check {}; // expected-note{{because 'short' does not satisfy 'D'}}
+ using dc1 = D_check<short>; // expected-error{{constraints not satisfied for class template 'D_check' [with T = short]}}
+
+ template<typename T>
+ concept C2 = requires (T a) {
+ requires sizeof(a) == 4; // OK
+ requires a == 0; // expected-note{{because 'a == 0' would be invalid: constraint variable 'a' cannot be used in an evaluated context}}
+ };
+ static_assert(C2<int>); // expected-note{{because 'int' does not satisfy 'C2'}} expected-error{{static_assert failed}}
+}
\ No newline at end of file
diff --git a/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.req/p3.cpp b/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.req/p3.cpp
new file mode 100644
index 0000000..d2c8cd4
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.req/p3.cpp
@@ -0,0 +1,37 @@
+// RUN: %clang_cc1 -std=c++2a -x c++ %s -verify
+
+// Examples from standard
+
+template<typename T, typename U>
+concept convertible_to = requires(T t) { U(t); };
+
+template<typename T>
+concept R = requires (T i) {
+ typename T::type;
+ {*i} -> convertible_to<const typename T::type&>;
+};
+
+template<typename T> requires R<T> struct S {};
+
+struct T {
+ using type = int;
+ type i;
+ const type &operator*() { return i; }
+};
+
+using si = S<T>;
+
+template<typename T>
+requires requires (T x) { x + x; } // expected-note{{because 'x + x' would be invalid: invalid operands to binary expression ('T' and 'T')}}
+T add(T a, T b) { return a + b; } // expected-note{{candidate template ignored: constraints not satisfied [with T = T]}}
+
+int x = add(1, 2);
+int y = add(T{}, T{}); // expected-error{{no matching function for call to 'add'}}
+
+template<typename T>
+concept C = requires (T x) { x + x; }; // expected-note{{because 'x + x' would be invalid: invalid operands to binary expression ('T' and 'T')}}
+template<typename T> requires C<T> // expected-note{{because 'T' does not satisfy 'C'}}
+T add2(T a, T b) { return a + b; } // expected-note{{candidate template ignored: constraints not satisfied [with T = T]}}
+
+int z = add2(1, 2);
+int w = add2(T{}, T{}); // expected-error{{no matching function for call to 'add2'}}
\ No newline at end of file
diff --git a/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.req/requires-expr.cpp b/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.req/requires-expr.cpp
new file mode 100644
index 0000000..90a3829
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.req/requires-expr.cpp
@@ -0,0 +1,68 @@
+// RUN: %clang_cc1 -std=c++2a -x c++ %s -verify
+
+using A = int;
+
+template<typename T, typename U>
+constexpr bool is_same_v = false;
+
+template<typename T>
+constexpr bool is_same_v<T, T> = true;
+
+template<typename T, typename U>
+concept same_as = is_same_v<T, U>;
+
+static_assert(requires { requires true; 0; typename A;
+ { 0 } -> same_as<int>; });
+static_assert(is_same_v<bool, decltype(requires { requires false; })>);
+
+// Check that requires expr is an unevaluated context.
+struct Y {
+ int i;
+ static constexpr bool r = requires { i; };
+};
+
+template<typename T> requires requires (T t) {
+ requires false; // expected-note{{because 'false' evaluated to false}}
+ requires false;
+ requires requires {
+ requires false;
+ };
+}
+struct r1 { };
+
+using r1i = r1<int>;
+// expected-error@-1 {{constraints not satisfied for class template 'r1' [with T = int]}}
+
+template<typename T> requires requires (T t) {
+ requires requires {
+ requires false; // expected-note{{because 'false' evaluated to false}}
+ };
+}
+struct r2 { };
+
+using r2i = r2<int>;
+// expected-error@-1 {{constraints not satisfied for class template 'r2' [with T = int]}}
+
+template<typename T> requires requires (T t) {
+ requires requires {
+ requires true;
+ };
+ requires true;
+ requires requires {
+ requires false; // expected-note{{because 'false' evaluated to false}}
+ };
+}
+struct r3 { };
+
+using r3i = r3<int>;
+// expected-error@-1 {{constraints not satisfied for class template 'r3' [with T = int]}}
+
+template<typename T>
+struct S { static const int s = T::value; };
+
+template<typename T> requires requires { T::value; S<T>::s; }
+// expected-note@-1 {{because 'T::value' would be invalid: type 'int' cannot be used prior to '::' because it has no members}}
+struct r4 { };
+
+using r4i = r4<int>;
+// expected-error@-1 {{constraints not satisfied for class template 'r4' [with T = int]}}
\ No newline at end of file
diff --git a/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.req/simple-requirement.cpp b/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.req/simple-requirement.cpp
new file mode 100644
index 0000000..39e882b
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.req/simple-requirement.cpp
@@ -0,0 +1,106 @@
+// RUN: %clang_cc1 %s -I%S -std=c++2a -verify
+
+namespace std { struct type_info; }
+
+static_assert(requires { 0; });
+static_assert(requires { "aaaa"; });
+static_assert(requires { (0).da; }); // expected-error{{member reference base type 'int' is not a structure or union}}
+
+struct A {};
+struct B {
+ B operator+(const B &other) const { return other; }
+};
+struct C {
+ C operator+(C &other) const { return other; }
+};
+
+template<typename T> requires requires (T a, const T& b) { a + b; }
+// expected-note@-1{{because 'a + b' would be invalid: invalid operands to binary expression ('A' and 'const A')}}
+// expected-note@-2{{because 'a + b' would be invalid: invalid operands to binary expression ('C' and 'const C')}}
+struct r1 {};
+
+using r1i1 = r1<int>;
+using r1i2 = r1<A>; // expected-error{{constraints not satisfied for class template 'r1' [with T = A]}}
+using r1i3 = r1<B>;
+using r1i4 = r1<C>; // expected-error{{constraints not satisfied for class template 'r1' [with T = C]}}
+
+struct D { void foo() {} };
+
+template<typename T> requires requires (T a) { a.foo(); }
+// expected-note@-1{{because 'a.foo()' would be invalid: no member named 'foo' in 'A'}}
+// expected-note@-2{{because 'a.foo()' would be invalid: member reference base type 'int' is not a structure or union}}
+// expected-note@-3{{because 'a.foo()' would be invalid: 'this' argument to member function 'foo' has type 'const D', but function is not marked const}}
+struct r2 {};
+
+using r2i1 = r2<int>; // expected-error{{constraints not satisfied for class template 'r2' [with T = int]}}
+using r2i2 = r2<A>; // expected-error{{constraints not satisfied for class template 'r2' [with T = A]}}
+using r2i3 = r2<D>;
+using r2i4 = r2<const D>; // expected-error{{constraints not satisfied for class template 'r2' [with T = const D]}}
+
+template<typename T> requires requires { sizeof(T); }
+// expected-note@-1{{because 'sizeof(T)' would be invalid: invalid application of 'sizeof' to an incomplete type 'void'}}
+// expected-note@-2{{because 'sizeof(T)' would be invalid: invalid application of 'sizeof' to an incomplete type 'nonexistent'}}
+struct r3 {};
+
+using r3i1 = r3<int>;
+using r3i2 = r3<A>;
+using r3i3 = r3<A &>;
+using r3i4 = r3<void>; // expected-error{{constraints not satisfied for class template 'r3' [with T = void]}}
+using r3i4 = r3<class nonexistent>; // expected-error{{constraints not satisfied for class template 'r3' [with T = nonexistent]}}
+
+template<typename T> requires requires (T t) { 0; "a"; (void)'a'; }
+struct r4 {};
+
+using r4i1 = r4<int>;
+using r4i2 = r4<int[10]>;
+using r4i3 = r4<int(int)>;
+
+template<class T> void f(T) = delete;
+template<class T> requires (sizeof(T) == 1) void f(T) { }
+
+template<typename T> requires requires(T t) { f(t); }
+// expected-note@-1{{because 'f(t)' would be invalid: call to deleted function 'f'}}
+struct r5 {};
+
+using r5i1 = r5<int>;
+// expected-error@-1 {{constraints not satisfied for class template 'r5' [with T = int]}}
+using r5i2 = r5<char>;
+
+template<typename T>
+struct E {
+ struct non_default_constructible { non_default_constructible(T t) { } };
+};
+
+template<typename T> requires requires(T t) { typename E<T>::non_default_constructible{}; }
+// expected-note@-1 {{because 'typename E<T>::non_default_constructible({})' would be invalid: no matching constructor for initialization of 'typename E<int>::non_default_constructible'}}
+struct r6 {};
+
+using r6i1 = r6<int>;
+// expected-error@-1 {{constraints not satisfied for class template 'r6' [with T = int]}}
+
+template<typename T> requires requires(T t) { typename E<T>::non_default_constructible(); }
+// expected-note@-1 {{because 'typename E<T>::non_default_constructible()' would be invalid: no matching constructor for initialization of 'typename E<int>::non_default_constructible'}}
+struct r7 {};
+
+using r7i1 = r7<int>;
+// expected-error@-1 {{constraints not satisfied for class template 'r7' [with T = int]}}
+
+// C++ [expr.prim.req.simple] Example
+namespace std_example {
+ template<typename T> concept C =
+ requires (T a, T b) { // expected-note{{because substituted constraint expression is ill-formed: argument may not have 'void' type}}
+ a + b; // expected-note{{because 'a + b' would be invalid: invalid operands to binary expression ('int *' and 'int *')}}
+ };
+
+ static_assert(C<int>);
+ template<C T> struct C_check {}; // expected-note{{because 'void' does not satisfy 'C'}} expected-note{{because 'int *' does not satisfy 'C'}}
+ using c1c1 = C_check<void>; // expected-error{{constraints not satisfied for class template 'C_check' [with T = void]}}
+ using c1c2 = C_check<int *>; // expected-error{{constraints not satisfied for class template 'C_check' [with T = int *]}}
+}
+
+// typeid() of an expression becomes potentially evaluated if the expression is
+// of a polymorphic type.
+class X { virtual ~X(); };
+constexpr bool b = requires (X &x) { static_cast<int(*)[(typeid(x), 0)]>(nullptr); };
+// expected-error@-1{{constraint variable 'x' cannot be used in an evaluated context}}
+// expected-note@-2{{'x' declared here}}
diff --git a/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.req/type-requirement.cpp b/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.req/type-requirement.cpp
new file mode 100644
index 0000000..71c87ff
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.req/type-requirement.cpp
@@ -0,0 +1,194 @@
+// RUN: %clang_cc1 -std=c++2a -x c++ %s -verify
+
+using A = int;
+
+template<typename T> using identity_t = T; // expected-note 4{{template is declared here}}}
+
+template<typename T> struct identity { using type = T; };
+// expected-note@-1 2{{template is declared here}}
+
+struct C {};
+
+struct D { static int type; }; // expected-note{{referenced member 'type' is declared here}}
+
+// Basic unqualified and global-qualified lookups
+
+static_assert(requires { typename A; typename ::A; });
+static_assert(requires { typename identity_t<A>; typename ::identity_t<A>; });
+static_assert(!requires { typename identity_t<A, A>; }); // expected-error{{too many template arguments for alias template 'identity_t'}}
+static_assert(!requires { typename ::identity_t<A, A>; }); // expected-error{{too many template arguments for alias template 'identity_t'}}
+static_assert(requires { typename identity<A>; });
+static_assert(!requires { typename identity; });
+// expected-error@-1 {{typename specifier refers to class template; argument deduction not allowed here}}
+static_assert(!requires { typename ::identity; });
+// expected-error@-1 {{typename specifier refers to class template; argument deduction not allowed here}}
+static_assert(!requires { typename identity_t; });
+// expected-error@-1 {{typename specifier refers to alias template; argument deduction not allowed here}}
+static_assert(!requires { typename ::identity_t; });
+// expected-error@-1 {{typename specifier refers to alias template; argument deduction not allowed here}}
+
+namespace ns {
+ using B = int;
+ int C = 0;
+ // expected-note@-1 {{referenced 'C' is declared here}}
+ static_assert(requires { typename A; typename B; typename ::A; });
+ static_assert(!requires { typename ns::A; }); // expected-error{{no type named 'A' in namespace 'ns'}}
+ static_assert(!requires { typename ::B; }); // expected-error{{no type named 'B' in the global namespace}}
+ static_assert(requires { typename C; });
+ // expected-error@-1 {{typename specifier refers to non-type 'C'}}
+}
+
+// member type lookups
+
+static_assert(requires { typename identity<int>::type; typename ::identity<int>::type; });
+static_assert(!requires { typename identity<int>::typr; }); // expected-error{{no type named 'typr' in 'identity<int>'}}
+static_assert(!requires { typename ::identity<int>::typr; }); // expected-error{{no type named 'typr' in 'identity<int>'}}
+
+template<typename T> requires requires { typename T::type; }
+// expected-note@-1 {{because 'typename T::type' would be invalid: type 'int' cannot be used prior to '::' because it has no members}}
+// expected-note@-2 {{because 'typename T::type' would be invalid: no type named 'type' in 'C'}}
+// expected-note@-3 {{because 'typename T::type' would be invalid: typename specifier refers to non-type member 'type' in 'D'}}
+// expected-note@-4 {{in instantiation of template class 'invalid<D>' requested here}}
+// expected-note@-5 {{in instantiation of requirement here}}
+// expected-note@-6 {{while substituting template arguments into constraint expression here}}
+// expected-note@-7 {{because 'typename T::type' would be invalid}}
+struct r1 {};
+
+using r1i1 = r1<identity<int>>;
+using r1i2 = r1<int>; // expected-error{{constraints not satisfied for class template 'r1' [with T = int]}}
+using r1i3 = r1<C>; // expected-error{{constraints not satisfied for class template 'r1' [with T = C]}}
+using r1i4 = r1<D>; // expected-error{{constraints not satisfied for class template 'r1' [with T = D]}}
+
+template<typename T> struct invalid { typename T::type x; };
+// expected-error@-1 {{typename specifier refers to non-type member 'type' in 'D'}}
+using r1i5 = r1<invalid<D>>;
+// expected-error@-1 {{constraints not satisfied for class template 'r1' [with T = invalid<D>]}}
+// expected-note@-2 {{while checking constraint satisfaction for template 'r1<invalid<D> >' required here}}
+
+// mismatching template arguments
+
+template<typename... Ts> requires requires { typename identity<Ts...>; } // expected-note{{because 'typename identity<Ts...>' would be invalid: too many template arguments for class template 'identity'}}
+struct r2 {};
+
+using r2i1 = r2<int>;
+using r2i2 = r2<void>;
+using r2i3 = r2<int, int>; // expected-error{{constraints not satisfied for class template 'r2' [with Ts = <int, int>]}}
+
+namespace ns2 {
+ template<typename T, typename U> struct identity {};
+
+ template<typename... Ts> requires requires { typename identity<Ts...>; } // expected-note 2{{because 'typename identity<Ts...>' would be invalid: too few template arguments for class template 'identity'}}
+ struct r4 {};
+
+ using r4i1 = r4<int>; // expected-error{{constraints not satisfied for class template 'r4' [with Ts = <int>]}}
+}
+
+using r4i2 = ns2::r4<int>; // expected-error{{constraints not satisfied for class template 'r4' [with Ts = <int>]}}
+
+using E = int;
+template<typename T> requires requires { typename E<T>; } // expected-error{{expected ';' at end of requirement}}
+struct r5v1 {};
+template<typename T> requires requires { typename ::E<T>; } // expected-error{{expected ';' at end of requirement}}
+struct r5v2 {};
+
+template<typename T> requires (sizeof(T) == 1)
+struct chars_only {};
+
+template<typename T> requires requires { typename chars_only<T>; } // expected-note{{because 'typename chars_only<T>' would be invalid: constraints not satisfied for class template 'chars_only' [with T = int]}}
+struct r6 {};
+
+using r6i = r6<int>; // expected-error{{constraints not satisfied for class template 'r6' [with T = int]}}
+
+template<typename T> int F = 0; // expected-note 2{{variable template 'F' declared here}}
+
+static_assert(!requires { typename F<int>; });
+// expected-error@-1{{template name refers to non-type template 'F'}}
+static_assert(!requires { typename ::F<int>; });
+// expected-error@-1{{template name refers to non-type template '::F'}}
+
+struct G { template<typename T> static T temp; };
+
+template<typename T> requires requires { typename T::template temp<int>; }
+// expected-note@-1{{because 'typename T::temp<int>' would be invalid: type 'int' cannot be used prior to '::' because it has no members}}
+// expected-note@-2{{because 'typename T::temp<int>' would be invalid: no member named 'temp' in 'D'}}
+// expected-note@-3{{because 'typename T::temp<int>' would be invalid: template name refers to non-type template 'G::template temp'}}
+struct r7 {};
+
+using r7i1 = r7<int>; // expected-error{{constraints not satisfied for class template 'r7' [with T = int]}}
+using r7i2 = r7<D>; // expected-error{{constraints not satisfied for class template 'r7' [with T = D]}}
+using r7i3 = r7<G>; // expected-error{{constraints not satisfied for class template 'r7' [with T = G]}}
+
+template<typename T> struct H;
+
+template<typename T> requires requires { typename H<T>; }
+struct r8 {};
+
+using r8i = r8<int>;
+
+template<typename T> struct I { struct incomplete; }; // expected-note{{member is declared here}}
+
+static_assert(!requires { I<int>::incomplete::inner; }); // expected-error{{implicit instantiation of undefined member 'I<int>::incomplete'}}
+
+template<typename T> requires requires { typename I<T>::incomplete::inner; } // expected-note{{because 'typename I<T>::incomplete::inner' would be invalid: implicit instantiation of undefined member 'I<int>::incomplete'}}
+struct r9 {};
+
+using r9i = r9<int>; // expected-error{{constraints not satisfied for class template 'r9' [with T = int]}}
+
+namespace ns3 {
+ struct X { }; // expected-note 2{{candidate found by name lookup is 'ns3::X'}}
+}
+
+struct X { using inner = int; }; // expected-note 2{{candidate found by name lookup is 'X'}}
+
+using namespace ns3;
+static_assert(requires { typename X; }); // expected-error{{reference to 'X' is ambiguous}}
+static_assert(requires { typename X::inner; }); // expected-error{{reference to 'X' is ambiguous}}
+// expected-error@-1{{unknown type name 'inner'}}
+
+// naming a type template specialization in a type requirement does not require
+// it to be complete and should not care about partial specializations.
+
+template<typename T>
+struct Z;
+
+template<typename T> requires (sizeof(T) >= 1)
+struct Z<T> {}; // expected-note{{partial specialization matches [with T = int]}}
+
+template<typename T> requires (sizeof(T) <= 4)
+struct Z<T> {}; // expected-note{{partial specialization matches [with T = int]}}
+
+Z<int> x; // expected-error{{ambiguous partial specializations of 'Z<int>'}}
+
+static_assert(requires { typename Z<int>; });
+
+// C++ [expr.prim.req.type] Example
+namespace std_example {
+ template<typename T, typename T::type = 0> struct S;
+ // expected-note@-1 {{because 'typename S<T>' would be invalid: no type named 'type' in 'std_example::has_inner}}
+ template<typename T> using Ref = T&; // expected-note{{because 'typename Ref<T>' would be invalid: cannot form a reference to 'void'}}
+ template<typename T> concept C1 =
+ requires {
+ typename T::inner;
+ // expected-note@-1 {{because 'typename T::inner' would be invalid: type 'int' cannot be used prior to '::' because it has no members}}
+ // expected-note@-2 {{because 'typename T::inner' would be invalid: no type named 'inner' in 'std_example::has_type'}}
+ };
+ template<typename T> concept C2 = requires { typename S<T>; };
+ template<typename T> concept C3 = requires { typename Ref<T>; };
+
+ struct has_inner { using inner = int;};
+ struct has_type { using type = int; };
+ struct has_inner_and_type { using inner = int; using type = int; };
+
+ static_assert(C1<has_inner_and_type> && C2<has_inner_and_type> && C3<has_inner_and_type>);
+ template<C1 T> struct C1_check {};
+ // expected-note@-1 {{because 'int' does not satisfy 'C1'}}
+ // expected-note@-2 {{because 'std_example::has_type' does not satisfy 'C1'}}
+ template<C2 T> struct C2_check {};
+ // expected-note@-1 {{because 'std_example::has_inner' does not satisfy 'C2'}}
+ template<C3 T> struct C3_check {};
+ // expected-note@-1 {{because 'void' does not satisfy 'C3'}}
+ using c1 = C1_check<int>; // expected-error{{constraints not satisfied for class template 'C1_check' [with T = int]}}
+ using c2 = C1_check<has_type>; // expected-error{{constraints not satisfied for class template 'C1_check' [with T = std_example::has_type]}}
+ using c3 = C2_check<has_inner>; // expected-error{{constraints not satisfied for class template 'C2_check' [with T = std_example::has_inner]}}
+ using c4 = C3_check<void>; // expected-error{{constraints not satisfied for class template 'C3_check' [with T = void]}}
+}
\ No newline at end of file
diff --git a/src/llvm-project/clang/test/CXX/over/over.match/over.match.best/p1-2a.cpp b/src/llvm-project/clang/test/CXX/over/over.match/over.match.best/p1-2a.cpp
new file mode 100644
index 0000000..dff0630
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/over/over.match/over.match.best/p1-2a.cpp
@@ -0,0 +1,113 @@
+// RUN: %clang_cc1 -std=c++2a -verify %s
+
+template<typename T, typename U>
+constexpr static bool is_same_v = false;
+
+template<typename T>
+constexpr static bool is_same_v<T, T> = true;
+
+namespace templates
+{
+ template<typename T>
+ concept AtLeast1 = sizeof(T) >= 1;
+
+ template<typename T>
+ int foo(T t) requires (sizeof(T) == 4) { // expected-note {{candidate function}}
+ return 0;
+ }
+
+ template<typename T>
+ char foo(T t) requires AtLeast1<T> { // expected-note {{candidate function}}
+ return 'a';
+ }
+
+ template<typename T>
+ double foo(T t) requires (AtLeast1<T> && sizeof(T) <= 2) {
+ return 'a';
+ }
+
+ static_assert(is_same_v<decltype(foo(10)), int>); // expected-error {{call to 'foo' is ambiguous}}
+ static_assert(is_same_v<decltype(foo(short(10))), double>);
+
+ template<typename T>
+ void bar() requires (sizeof(T) == 1) { }
+ // expected-note@-1{{similar constraint expressions not considered equivalent}}
+ // expected-note@-2{{candidate function [with T = char]}}
+
+ template<typename T>
+ void bar() requires (sizeof(T) == 1 && sizeof(T) >= 0) { }
+ // expected-note@-1{{candidate function [with T = char]}}
+ // expected-note@-2{{similar constraint expression here}}
+
+ static_assert(is_same_v<decltype(bar<char>()), void>);
+ // expected-error@-1{{call to 'bar' is ambiguous}}
+
+ template<typename T>
+ constexpr int baz() requires AtLeast1<T> { // expected-note {{candidate function}}
+ return 1;
+ }
+
+ template<typename T> requires AtLeast1<T>
+ constexpr int baz() { // expected-note {{candidate function [with T = int]}}
+ return 2;
+ }
+
+ static_assert(baz<int>() == 1); // expected-error {{call to 'baz' is ambiguous}}
+}
+
+namespace non_template
+{
+ template<typename T>
+ concept AtLeast2 = sizeof(T) >= 2;
+
+ template<typename T>
+ concept AtMost8 = sizeof(T) <= 8;
+
+ int foo() requires AtLeast2<long> && AtMost8<long> {
+ return 0;
+ }
+
+ double foo() requires AtLeast2<long> {
+ return 0.0;
+ }
+
+ double baz() requires AtLeast2<long> && AtMost8<long> { // expected-note {{candidate function}}
+ return 0.0;
+ }
+
+ int baz() requires AtMost8<long> && AtLeast2<long> { // expected-note {{candidate function}}
+ return 0.0;
+ }
+
+ void bar() requires (sizeof(char[8]) >= 8) { }
+ // expected-note@-1 {{candidate function}}
+ // expected-note@-2 {{similar constraint expressions not considered equivalent}}
+
+ void bar() requires (sizeof(char[8]) >= 8 && sizeof(int) <= 30) { }
+ // expected-note@-1 {{candidate function}}
+ // expected-note@-2 {{similar constraint expression here}}
+
+ static_assert(is_same_v<decltype(foo()), int>);
+ static_assert(is_same_v<decltype(baz()), int>); // expected-error {{call to 'baz' is ambiguous}}
+ static_assert(is_same_v<decltype(bar()), void>); // expected-error {{call to 'bar' is ambiguous}}
+
+ constexpr int goo(int a) requires AtLeast2<int> && true {
+ return 1;
+ }
+
+ constexpr int goo(const int b) requires AtLeast2<int> {
+ return 2;
+ }
+
+ // Only trailing requires clauses of redeclarations are compared for overload resolution.
+ constexpr int doo(int a, ...) requires AtLeast2<int> && true { // expected-note {{candidate function}}
+ return 1;
+ }
+
+ constexpr int doo(int b) requires AtLeast2<int> { // expected-note {{candidate function}}
+ return 2;
+ }
+
+ static_assert(goo(1) == 1);
+ static_assert(doo(2) == 1); // expected-error {{call to 'doo' is ambiguous}}
+}
diff --git a/src/llvm-project/clang/test/CXX/over/over.match/over.match.best/p2.cpp b/src/llvm-project/clang/test/CXX/over/over.match/over.match.best/p2.cpp
new file mode 100644
index 0000000..3a44436
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/over/over.match/over.match.best/p2.cpp
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 -std=c++2a -verify %s
+
+namespace PR44761 {
+ template<typename T> concept X = (sizeof(T) == sizeof(T));
+
+ template<typename T> struct A {
+ bool operator<(const A&) const & requires X<T>; // #1
+ int operator<=>(const A&) const & requires X<T> && X<int> = delete; // #2
+ };
+ bool k1 = A<int>() < A<int>(); // not ordered by constraints: prefer non-rewritten form
+ bool k2 = A<float>() < A<float>(); // prefer more-constrained 'operator<=>'
+ // expected-error@-1 {{deleted}}
+ // expected-note@#1 {{candidate}}
+ // expected-note@#2 {{candidate function has been explicitly deleted}}
+ // expected-note@#2 {{candidate function (with reversed parameter order) has been explicitly deleted}}
+}
diff --git a/src/llvm-project/clang/test/CXX/over/over.match/over.match.funcs/over.match.class.deduct/p3.cpp b/src/llvm-project/clang/test/CXX/over/over.match/over.match.funcs/over.match.class.deduct/p3.cpp
index 4ed1d30..2f89598 100644
--- a/src/llvm-project/clang/test/CXX/over/over.match/over.match.funcs/over.match.class.deduct/p3.cpp
+++ b/src/llvm-project/clang/test/CXX/over/over.match/over.match.funcs/over.match.class.deduct/p3.cpp
@@ -2,7 +2,7 @@
namespace std_example {
template <class T> struct A {
- explicit A(const T &, ...) noexcept; // expected-note {{explicit}} expected-note 2{{candidate}}
+ explicit A(const T &, ...) noexcept; // expected-note {{explicit}}
A(T &&, ...); // expected-note 2{{candidate}}
};
diff --git a/src/llvm-project/clang/test/CXX/over/over.match/over.match.funcs/over.match.copy/p1.cpp b/src/llvm-project/clang/test/CXX/over/over.match/over.match.funcs/over.match.copy/p1.cpp
index 31a679f..c63f309 100644
--- a/src/llvm-project/clang/test/CXX/over/over.match/over.match.funcs/over.match.copy/p1.cpp
+++ b/src/llvm-project/clang/test/CXX/over/over.match/over.match.funcs/over.match.copy/p1.cpp
@@ -4,7 +4,7 @@
struct X { }; // expected-note 2{{candidate constructor}}
struct Y {
- explicit operator X() const;
+ explicit operator X() const; // expected-note {{not a candidate}}
};
void test(const Y& y) {
@@ -18,8 +18,8 @@
struct C { }; // expected-note 2 {{candidate constructor}}
struct A {
- explicit operator int() const;
- explicit operator C() const;
+ explicit operator int() const; // expected-note {{not a candidate}}
+ explicit operator C() const; // expected-note {{not a candidate}}
};
struct B {
diff --git a/src/llvm-project/clang/test/CXX/over/over.match/over.match.funcs/over.match.oper/p3-2a.cpp b/src/llvm-project/clang/test/CXX/over/over.match/over.match.funcs/over.match.oper/p3-2a.cpp
new file mode 100644
index 0000000..023e076
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/over/over.match/over.match.funcs/over.match.oper/p3-2a.cpp
@@ -0,0 +1,184 @@
+// RUN: %clang_cc1 -std=c++2a -verify %s
+// RUN: %clang_cc1 -std=c++2a -verify -Wall -DNO_ERRORS %s
+
+#ifndef NO_ERRORS
+namespace bullet3 {
+ // the built-in candidates include all of the candidate operator fnuctions
+ // [...] that, compared to the given operator
+
+ // - do not have the same parameter-type-list as any non-member candidate
+
+ enum E { e };
+
+ // Suppress both builtin operator<=>(E, E) and operator<(E, E).
+ void operator<=>(E, E); // expected-note {{while rewriting}}
+ bool cmp = e < e; // expected-error {{invalid operands to binary expression ('void' and 'int')}}
+
+ // None of the other bullets have anything to test here. In principle we
+ // need to suppress both builtin operator@(A, B) and operator@(B, A) when we
+ // see a user-declared reversible operator@(A, B), and we do, but that's
+ // untestable because the only built-in reversible candidates are
+ // operator<=>(E, E) and operator==(E, E) for E an enumeration type, and
+ // those are both symmetric anyway.
+}
+
+namespace bullet4 {
+ // The rewritten candidate set is determined as follows:
+
+ template<int> struct X {};
+ X<1> x1;
+ X<2> x2;
+
+ struct Y {
+ int operator<=>(X<2>) = delete; // #1member
+ bool operator==(X<2>) = delete; // #2member
+ };
+ Y y;
+
+ // - For the relational operators, the rewritten candidates include all
+ // non-rewritten candidates for the expression x <=> y.
+ int operator<=>(X<1>, X<2>) = delete; // #1
+
+ // expected-note@#1 5{{candidate function has been explicitly deleted}}
+ // expected-note@#1 5{{candidate function (with reversed parameter order) not viable: no known conversion from 'X<1>' to 'X<2>' for 1st argument}}
+ bool lt = x1 < x2; // expected-error {{selected deleted operator '<=>'}}
+ bool le = x1 <= x2; // expected-error {{selected deleted operator '<=>'}}
+ bool gt = x1 > x2; // expected-error {{selected deleted operator '<=>'}}
+ bool ge = x1 >= x2; // expected-error {{selected deleted operator '<=>'}}
+ bool cmp = x1 <=> x2; // expected-error {{selected deleted operator '<=>'}}
+
+ // expected-note@#1member 5{{candidate function has been explicitly deleted}}
+ // expected-note@#1 5{{candidate function not viable: no known conversion from 'bullet4::Y' to 'X<1>' for 1st argument}}
+ // expected-note@#1 5{{candidate function (with reversed parameter order) not viable: no known conversion from 'bullet4::Y' to 'X<2>' for 1st argument}}
+ bool mem_lt = y < x2; // expected-error {{selected deleted operator '<=>'}}
+ bool mem_le = y <= x2; // expected-error {{selected deleted operator '<=>'}}
+ bool mem_gt = y > x2; // expected-error {{selected deleted operator '<=>'}}
+ bool mem_ge = y >= x2; // expected-error {{selected deleted operator '<=>'}}
+ bool mem_cmp = y <=> x2; // expected-error {{selected deleted operator '<=>'}}
+
+ // - For the relational and three-way comparison operators, the rewritten
+ // candidates also include a synthesized candidate, with the order of the
+ // two parameters reversed, for each non-rewritten candidate for the
+ // expression y <=> x.
+
+ // expected-note@#1 5{{candidate function (with reversed parameter order) has been explicitly deleted}}
+ // expected-note@#1 5{{candidate function not viable: no known conversion from 'X<2>' to 'X<1>' for 1st argument}}
+ bool rlt = x2 < x1; // expected-error {{selected deleted operator '<=>'}}
+ bool rle = x2 <= x1; // expected-error {{selected deleted operator '<=>'}}
+ bool rgt = x2 > x1; // expected-error {{selected deleted operator '<=>'}}
+ bool rge = x2 >= x1; // expected-error {{selected deleted operator '<=>'}}
+ bool rcmp = x2 <=> x1; // expected-error {{selected deleted operator '<=>'}}
+
+ // expected-note@#1member 5{{candidate function (with reversed parameter order) has been explicitly deleted}}
+ // expected-note@#1 5{{candidate function not viable: no known conversion from 'X<2>' to 'X<1>' for 1st argument}}
+ // expected-note@#1 5{{candidate function (with reversed parameter order) not viable: no known conversion from 'bullet4::Y' to 'X<1>' for 2nd argument}}
+ bool mem_rlt = x2 < y; // expected-error {{selected deleted operator '<=>'}}
+ bool mem_rle = x2 <= y; // expected-error {{selected deleted operator '<=>'}}
+ bool mem_rgt = x2 > y; // expected-error {{selected deleted operator '<=>'}}
+ bool mem_rge = x2 >= y; // expected-error {{selected deleted operator '<=>'}}
+ bool mem_rcmp = x2 <=> y; // expected-error {{selected deleted operator '<=>'}}
+
+ // For the != operator, the rewritten candidates include all non-rewritten
+ // candidates for the expression x == y
+ int operator==(X<1>, X<2>) = delete; // #2
+
+ // expected-note@#2 2{{candidate function has been explicitly deleted}}
+ // expected-note@#2 2{{candidate function (with reversed parameter order) not viable: no known conversion from 'X<1>' to 'X<2>' for 1st argument}}
+ bool eq = x1 == x2; // expected-error {{selected deleted operator '=='}}
+ bool ne = x1 != x2; // expected-error {{selected deleted operator '=='}}
+
+ // expected-note@#2member 2{{candidate function has been explicitly deleted}}
+ // expected-note@#2 2{{candidate function not viable: no known conversion from 'bullet4::Y' to 'X<1>' for 1st argument}}
+ // expected-note@#2 2{{candidate function (with reversed parameter order) not viable: no known conversion from 'bullet4::Y' to 'X<2>' for 1st argument}}
+ bool mem_eq = y == x2; // expected-error {{selected deleted operator '=='}}
+ bool mem_ne = y != x2; // expected-error {{selected deleted operator '=='}}
+
+ // For the equality operators, the rewritten candidates also include a
+ // synthesized candidate, with the order of the two parameters reversed, for
+ // each non-rewritten candidate for the expression y == x
+
+ // expected-note@#2 2{{candidate function (with reversed parameter order) has been explicitly deleted}}
+ // expected-note@#2 2{{candidate function not viable: no known conversion from 'X<2>' to 'X<1>' for 1st argument}}
+ bool req = x2 == x1; // expected-error {{selected deleted operator '=='}}
+ bool rne = x2 != x1; // expected-error {{selected deleted operator '=='}}
+
+ // expected-note@#2member 2{{candidate function (with reversed parameter order) has been explicitly deleted}}
+ // expected-note@#2 2{{candidate function not viable: no known conversion from 'X<2>' to 'X<1>' for 1st argument}}
+ // expected-note@#2 2{{candidate function (with reversed parameter order) not viable: no known conversion from 'bullet4::Y' to 'X<1>' for 2nd argument}}
+ bool mem_req = x2 == y; // expected-error {{selected deleted operator '=='}}
+ bool mem_rne = x2 != y; // expected-error {{selected deleted operator '=='}}
+
+ // For all other operators, the rewritten candidate set is empty.
+ X<3> operator+(X<1>, X<2>) = delete; // expected-note {{no known conversion from 'X<2>' to 'X<1>'}}
+ X<3> reversed_add = x2 + x1; // expected-error {{invalid operands}}
+}
+
+namespace PR44627 {
+ namespace ADL {
+ struct type {};
+ bool operator==(type lhs, int rhs) {
+ return true;
+ }
+ }
+
+ bool b1 = ADL::type() == 0;
+ bool b2 = 0 == ADL::type();
+}
+
+// Various C++17 cases that are known to be broken by the C++20 rules.
+namespace problem_cases {
+ // We can have an ambiguity between an operator and its reversed form. This
+ // wasn't intended by the original "consistent comparison" proposal, and we
+ // allow it as extension, picking the non-reversed form.
+ struct A {
+ bool operator==(const A&); // expected-note {{ambiguity is between a regular call to this operator and a call with the argument order reversed}}
+ };
+ bool cmp_non_const = A() == A(); // expected-warning {{ambiguous}}
+
+ struct B {
+ virtual bool operator==(const B&) const;
+ };
+ struct D : B {
+ bool operator==(const B&) const override; // expected-note {{operator}}
+ };
+ bool cmp_base_derived = D() == D(); // expected-warning {{ambiguous}}
+
+ template<typename T> struct CRTPBase {
+ bool operator==(const T&) const; // expected-note {{operator}}
+ };
+ struct CRTP : CRTPBase<CRTP> {};
+ bool cmp_crtp = CRTP() == CRTP(); // expected-warning {{ambiguous}}
+
+ // We can select a non-rewriteable operator== for a != comparison, when there
+ // was a viable operator!= candidate we could have used instead.
+ //
+ // Rejecting this seems OK on balance.
+ using UBool = signed char; // ICU uses this.
+ struct ICUBase {
+ virtual UBool operator==(const ICUBase&) const;
+ UBool operator!=(const ICUBase &arg) const { return !operator==(arg); }
+ };
+ struct ICUDerived : ICUBase {
+ UBool operator==(const ICUBase&) const override; // expected-note {{declared here}}
+ };
+ bool cmp_icu = ICUDerived() != ICUDerived(); // expected-error {{not 'bool'}}
+}
+
+#else // NO_ERRORS
+
+namespace problem_cases {
+ // We can select a reversed candidate where we used to select a non-reversed
+ // one, and in the worst case this can dramatically change the meaning of the
+ // program. Make sure we at least warn on the worst cases under -Wall.
+ struct iterator;
+ struct const_iterator {
+ const_iterator(iterator);
+ bool operator==(const const_iterator&) const;
+ };
+ struct iterator {
+ bool operator==(const const_iterator &o) const { // expected-warning {{all paths through this function will call itself}}
+ return o == *this;
+ }
+ };
+}
+#endif // NO_ERRORS
diff --git a/src/llvm-project/clang/test/CXX/over/over.match/over.match.funcs/over.match.oper/p8-2a.cpp b/src/llvm-project/clang/test/CXX/over/over.match/over.match.funcs/over.match.oper/p8-2a.cpp
new file mode 100644
index 0000000..da0f576
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/over/over.match/over.match.funcs/over.match.oper/p8-2a.cpp
@@ -0,0 +1,70 @@
+// RUN: %clang_cc1 -std=c++2a -verify %s
+
+template<typename L, typename R> struct Op { L l; const char *op; R r; };
+// FIXME: Remove once we implement P1816R0.
+template<typename L, typename R> Op(L, R) -> Op<L, R>;
+
+struct A {};
+struct B {};
+constexpr Op<A, B> operator<=>(A a, B b) { return {a, "<=>", b}; }
+
+template<typename T, typename U, typename V> constexpr Op<Op<T, U>, V> operator< (Op<T, U> a, V b) { return {a, "<", b}; }
+template<typename T, typename U, typename V> constexpr Op<Op<T, U>, V> operator<= (Op<T, U> a, V b) { return {a, "<=", b}; }
+template<typename T, typename U, typename V> constexpr Op<Op<T, U>, V> operator> (Op<T, U> a, V b) { return {a, ">", b}; }
+template<typename T, typename U, typename V> constexpr Op<Op<T, U>, V> operator>= (Op<T, U> a, V b) { return {a, ">=", b}; }
+template<typename T, typename U, typename V> constexpr Op<Op<T, U>, V> operator<=>(Op<T, U> a, V b) { return {a, "<=>", b}; }
+
+template<typename T, typename U, typename V> constexpr Op<T, Op<U, V>> operator< (T a, Op<U, V> b) { return {a, "<", b}; }
+template<typename T, typename U, typename V> constexpr Op<T, Op<U, V>> operator<= (T a, Op<U, V> b) { return {a, "<=", b}; }
+template<typename T, typename U, typename V> constexpr Op<T, Op<U, V>> operator> (T a, Op<U, V> b) { return {a, ">", b}; }
+template<typename T, typename U, typename V> constexpr Op<T, Op<U, V>> operator>= (T a, Op<U, V> b) { return {a, ">=", b}; }
+template<typename T, typename U, typename V> constexpr Op<T, Op<U, V>> operator<=>(T a, Op<U, V> b) { return {a, "<=>", b}; }
+
+constexpr bool same(A, A) { return true; }
+constexpr bool same(B, B) { return true; }
+constexpr bool same(int a, int b) { return a == b; }
+template<typename T, typename U>
+constexpr bool same(Op<T, U> x, Op<T, U> y) {
+ return same(x.l, y.l) && __builtin_strcmp(x.op, y.op) == 0 && same(x.r, y.r);
+}
+
+// x @ y is interpreted as:
+void f(A x, B y) {
+ // -- (x <=> y) @ 0 if not reversed
+ static_assert(same(x < y, (x <=> y) < 0));
+ static_assert(same(x <= y, (x <=> y) <= 0));
+ static_assert(same(x > y, (x <=> y) > 0));
+ static_assert(same(x >= y, (x <=> y) >= 0));
+ static_assert(same(x <=> y, x <=> y)); // (not rewritten)
+}
+
+void g(B x, A y) {
+ // -- 0 @ (y <=> x) if reversed
+ static_assert(same(x < y, 0 < (y <=> x)));
+ static_assert(same(x <= y, 0 <= (y <=> x)));
+ static_assert(same(x > y, 0 > (y <=> x)));
+ static_assert(same(x >= y, 0 >= (y <=> x)));
+ static_assert(same(x <=> y, 0 <=> (y <=> x)));
+}
+
+
+// We can rewrite into a call involving a builtin operator.
+struct X { int result; };
+struct Y {};
+constexpr int operator<=>(X x, Y) { return x.result; }
+static_assert(X{-1} < Y{});
+static_assert(X{0} < Y{}); // expected-error {{failed}}
+static_assert(X{0} <= Y{});
+static_assert(X{1} <= Y{}); // expected-error {{failed}}
+static_assert(X{1} > Y{});
+static_assert(X{0} > Y{}); // expected-error {{failed}}
+static_assert(X{0} >= Y{});
+static_assert(X{-1} >= Y{}); // expected-error {{failed}}
+static_assert(Y{} < X{1});
+static_assert(Y{} < X{0}); // expected-error {{failed}}
+static_assert(Y{} <= X{0});
+static_assert(Y{} <= X{-1}); // expected-error {{failed}}
+static_assert(Y{} > X{-1});
+static_assert(Y{} > X{0}); // expected-error {{failed}}
+static_assert(Y{} >= X{0});
+static_assert(Y{} >= X{1}); // expected-error {{failed}}
diff --git a/src/llvm-project/clang/test/CXX/over/over.match/over.match.funcs/over.match.oper/p9-2a.cpp b/src/llvm-project/clang/test/CXX/over/over.match/over.match.funcs/over.match.oper/p9-2a.cpp
new file mode 100644
index 0000000..fce4681
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/over/over.match/over.match.funcs/over.match.oper/p9-2a.cpp
@@ -0,0 +1,38 @@
+// RUN: %clang_cc1 -std=c++2a -verify %s
+
+// ... return type shall be cv bool ...
+namespace not_bool {
+ struct X {} x;
+ struct Y {} y;
+ int operator==(X, Y); // expected-note 4{{here}}
+ bool a = x == y; // ok
+ bool b = y == x; // expected-error {{return type 'int' of selected 'operator==' function for rewritten '==' comparison is not 'bool'}}
+ bool c = x != y; // expected-error {{return type 'int' of selected 'operator==' function for rewritten '!=' comparison is not 'bool'}}
+ bool d = y != x; // expected-error {{return type 'int' of selected 'operator==' function for rewritten '!=' comparison is not 'bool'}}
+
+ // cv-qualifiers are OK
+ const bool operator==(Y, X);
+ bool e = y != x; // ok
+
+ // We don't prefer a function with bool return type over one witn non-bool return type.
+ bool f = x != y; // expected-error {{return type 'int' of selected 'operator==' function for rewritten '!=' comparison is not 'bool'}}
+}
+
+struct X { bool equal; };
+struct Y {};
+constexpr bool operator==(X x, Y) { return x.equal; }
+
+static_assert(X{true} == Y{});
+static_assert(X{false} == Y{}); // expected-error {{failed}}
+
+// x == y -> y == x
+static_assert(Y{} == X{true});
+static_assert(Y{} == X{false}); // expected-error {{failed}}
+
+// x != y -> !(x == y)
+static_assert(X{true} != Y{}); // expected-error {{failed}}
+static_assert(X{false} != Y{});
+
+// x != y -> !(y == x)
+static_assert(Y{} != X{true}); // expected-error {{failed}}
+static_assert(Y{} != X{false});
diff --git a/src/llvm-project/clang/test/CXX/over/over.match/over.match.viable/p3.cpp b/src/llvm-project/clang/test/CXX/over/over.match/over.match.viable/p3.cpp
new file mode 100644
index 0000000..c6f9922
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/over/over.match/over.match.viable/p3.cpp
@@ -0,0 +1,63 @@
+// RUN: %clang_cc1 -std=c++2a -verify %s
+
+struct S2 {};
+// expected-note@-1 {{candidate constructor (the implicit copy constructor) not viable: no known conversion from 'S1' to 'const S2' for 1st argument}}
+// expected-note@-2 {{candidate constructor (the implicit move constructor) not viable: no known conversion from 'S1' to 'S2' for 1st argument}}
+// expected-note@-3 {{candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided}}
+
+struct S1 {
+ void foo() const requires true {}
+ void foo() const requires false {}
+ void bar() const requires false {}
+ // expected-note@-1 {{because 'false' evaluated to false}}
+ operator bool() const requires true { return true; }
+ explicit operator bool() const requires false;
+ explicit operator S2() const requires false;
+ // expected-note@-1 {{candidate function not viable: constraints not satisfied}}
+ // expected-note@-2 {{because 'false' evaluated to false}}
+};
+
+void foo() {
+ S1().foo();
+ S1().bar();
+ // expected-error@-1 {{invalid reference to function 'bar': constraints not satisfied}}
+ (void) static_cast<bool>(S1());
+ (void) static_cast<S2>(S1());
+ // expected-error@-1 {{no matching conversion for static_cast from 'S1' to 'S2'}}
+}
+
+// Test that constraints are checked before implicit conversions are formed.
+
+template<typename T>
+struct invalid_template { using X = typename T::non_existant; };
+struct A {
+ template<typename T, bool=invalid_template<T>::aadasas>
+ operator T() {}
+};
+
+void foo(int) requires false;
+void foo(A) requires true;
+
+struct S {
+ void foo(int) requires false;
+ void foo(A) requires true;
+ S(A) requires false;
+ S(double) requires true;
+ ~S() requires false;
+ // expected-note@-1 2{{because 'false' evaluated to false}}
+ ~S() requires true;
+ operator int() requires true;
+ operator int() requires false;
+};
+
+void bar() {
+ foo(A{});
+ S{1.}.foo(A{});
+ // expected-error@-1{{invalid reference to function '~S': constraints not satisfied}}
+ // Note - this behavior w.r.t. constrained dtors is a consequence of current
+ // wording, which does not invoke overload resolution when a dtor is called.
+ // P0848 is set to address this issue.
+ S s = 1;
+ // expected-error@-1{{invalid reference to function '~S': constraints not satisfied}}
+ int a = s;
+}
\ No newline at end of file
diff --git a/src/llvm-project/clang/test/CXX/over/over.over/p4-2a.cpp b/src/llvm-project/clang/test/CXX/over/over.over/p4-2a.cpp
new file mode 100644
index 0000000..6696203
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/over/over.over/p4-2a.cpp
@@ -0,0 +1,61 @@
+// RUN: %clang_cc1 -std=c++2a -verify %s
+
+template<typename T, typename U>
+constexpr static bool is_same_v = false;
+
+template<typename T>
+constexpr static bool is_same_v<T, T> = true;
+
+template<typename T>
+concept AtLeast2 = sizeof(T) >= 2;
+
+template<typename T>
+concept AtMost8 = sizeof(T) <= 8;
+
+int foo() requires AtLeast2<long> && AtMost8<long> {
+ return 0;
+}
+
+double foo() requires AtLeast2<char> {
+ return 0.0;
+}
+
+char bar() requires AtLeast2<char> { // expected-note {{possible target for call}}
+ return 1.0;
+}
+
+short bar() requires AtLeast2<long> && AtMost8<long> {
+// expected-note@-1{{possible target for call}}
+// expected-note@-2{{candidate function}}
+ return 0.0;
+}
+
+int bar() requires AtMost8<long> && AtLeast2<long> {
+// expected-note@-1{{possible target for call}}
+// expected-note@-2{{candidate function}}
+ return 0.0;
+}
+
+char baz() requires AtLeast2<char> {
+ return 1.0;
+}
+
+short baz() requires AtLeast2<long> && AtMost8<long> {
+ return 0.0;
+}
+
+int baz() requires AtMost8<long> && AtLeast2<long> {
+ return 0.0;
+}
+
+long baz() requires AtMost8<long> && AtLeast2<long> && AtLeast2<short> {
+ return 3.0;
+}
+
+void a() {
+ static_assert(is_same_v<decltype(&foo), int(*)()>);
+ static_assert(is_same_v<decltype(&bar), long(*)()>);
+ // expected-error@-1{{reference to overloaded function could not be resolved; did you mean to call it with no arguments?}}
+ // expected-error@-2{{call to 'bar' is ambiguous}}
+ static_assert(is_same_v<decltype(&baz), long(*)()>);
+}
\ No newline at end of file
diff --git a/src/llvm-project/clang/test/CXX/special/class.inhctor/elsewhere.cpp b/src/llvm-project/clang/test/CXX/special/class.inhctor/elsewhere.cpp
index c042834..f86f4b8 100644
--- a/src/llvm-project/clang/test/CXX/special/class.inhctor/elsewhere.cpp
+++ b/src/llvm-project/clang/test/CXX/special/class.inhctor/elsewhere.cpp
@@ -62,3 +62,4 @@
G(int &) : G(0) {}
};
G<B1> g(123);
+G<const B1> g2(123);
diff --git a/src/llvm-project/clang/test/CXX/special/class.inhctor/p1.cpp b/src/llvm-project/clang/test/CXX/special/class.inhctor/p1.cpp
index 842b725..389f365 100644
--- a/src/llvm-project/clang/test/CXX/special/class.inhctor/p1.cpp
+++ b/src/llvm-project/clang/test/CXX/special/class.inhctor/p1.cpp
@@ -3,19 +3,19 @@
// Note: [class.inhctor] was removed by P0136R1. This tests the new behavior
// for the wording that used to be there.
-struct A { // expected-note 4{{candidate constructor (the implicit}}
- A(...); // expected-note 4{{candidate constructor}} expected-note 4{{candidate inherited constructor}}
+struct A {
+ A(...); // expected-note {{candidate constructor}} expected-note {{candidate inherited constructor}}
A(int = 0, int = 0, int = 0, int = 0, ...); // expected-note 3{{candidate constructor}} expected-note 3{{candidate inherited constructor}}
A(int = 0, int = 0, ...); // expected-note 3{{candidate constructor}} expected-note 3{{candidate inherited constructor}}
- template<typename T> A(T, int = 0, ...); // expected-note 3{{candidate constructor}} expected-note 3{{candidate inherited constructor}}
+ template<typename T> A(T, int = 0, ...);
template<typename T, int N> A(const T (&)[N]); // expected-note {{candidate constructor}} expected-note {{candidate inherited constructor}}
template<typename T, int N> A(const T (&)[N], int = 0); // expected-note {{candidate constructor}} expected-note {{candidate inherited constructor}}
};
-struct B : A { // expected-note 4{{candidate constructor (the implicit}}
- using A::A; // expected-note 15{{inherited here}}
+struct B : A {
+ using A::A; // expected-note 9{{inherited here}}
B(void*);
};
diff --git a/src/llvm-project/clang/test/CXX/special/class.inhctor/p3.cpp b/src/llvm-project/clang/test/CXX/special/class.inhctor/p3.cpp
index 19f15eb..9d50e0c 100644
--- a/src/llvm-project/clang/test/CXX/special/class.inhctor/p3.cpp
+++ b/src/llvm-project/clang/test/CXX/special/class.inhctor/p3.cpp
@@ -15,7 +15,7 @@
D1 fd1() { return 1; }
struct B2 {
- explicit B2(int, int = 0, int = 0);
+ explicit B2(int, int = 0, int = 0); // expected-note {{not a candidate}}
};
struct D2 : B2 { // expected-note 2{{candidate constructor}}
using B2::B2;
diff --git a/src/llvm-project/clang/test/CXX/special/class.inhctor/p4.cpp b/src/llvm-project/clang/test/CXX/special/class.inhctor/p4.cpp
index 69fbea3..a5d2cd7 100644
--- a/src/llvm-project/clang/test/CXX/special/class.inhctor/p4.cpp
+++ b/src/llvm-project/clang/test/CXX/special/class.inhctor/p4.cpp
@@ -60,13 +60,13 @@
// same signature.
namespace DRnnnn {
struct A {
- constexpr A(int, float = 0) {} // expected-note {{candidate}}
+ constexpr A(int, float = 0) {}
explicit A(int, int = 0) {} // expected-note {{candidate}}
A(int, int, int = 0) = delete; // expected-note {{deleted}}
};
struct B : A {
- using A::A; // expected-note 3{{inherited here}}
+ using A::A; // expected-note 2{{inherited here}}
};
constexpr B b0(0, 0.0f); // ok, constexpr
diff --git a/src/llvm-project/clang/test/CXX/special/class.inhctor/p7.cpp b/src/llvm-project/clang/test/CXX/special/class.inhctor/p7.cpp
index 2d7acdc..4bbc2fc 100644
--- a/src/llvm-project/clang/test/CXX/special/class.inhctor/p7.cpp
+++ b/src/llvm-project/clang/test/CXX/special/class.inhctor/p7.cpp
@@ -9,7 +9,7 @@
struct B2 {
B2(int); // expected-note {{candidate}}
};
-struct D1 : B1, B2 { // expected-note 2{{candidate}}
+struct D1 : B1, B2 {
using B1::B1; // expected-note {{inherited here}}
using B2::B2; // expected-note {{inherited here}}
};
diff --git a/src/llvm-project/clang/test/CXX/temp/concept/p4.cpp b/src/llvm-project/clang/test/CXX/temp/concept/p4.cpp
new file mode 100644
index 0000000..2e02267
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/temp/concept/p4.cpp
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -std=c++2a -verify %s
+
+template<typename T> requires true
+concept C = true; // expected-error{{concept cannot have associated constraints}}
+
+// TODO: Add test for other kinds of associated constraints once we have them.
diff --git a/src/llvm-project/clang/test/CXX/temp/temp.arg/temp.arg.template/p3-2a.cpp b/src/llvm-project/clang/test/CXX/temp/temp.arg/temp.arg.template/p3-2a.cpp
new file mode 100644
index 0000000..8e69f13
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/temp/temp.arg/temp.arg.template/p3-2a.cpp
@@ -0,0 +1,34 @@
+// RUN: %clang_cc1 -std=c++2a -frelaxed-template-template-args -verify %s
+
+template<typename T> concept C = T::f();
+// expected-note@-1{{similar constraint}}
+template<typename T> concept D = C<T> && T::g();
+template<typename T> concept F = T::f();
+// expected-note@-1{{similar constraint expressions not considered equivalent}}
+template<template<C> class P> struct S1 { }; // expected-note 2{{'P' declared here}}
+
+template<C> struct X { };
+
+template<D> struct Y { }; // expected-note{{'Y' declared here}}
+template<typename T> struct Z { };
+template<F> struct W { }; // expected-note{{'W' declared here}}
+
+S1<X> s11;
+S1<Y> s12; // expected-error{{template template argument 'Y' is more constrained than template template parameter 'P'}}
+S1<Z> s13;
+S1<W> s14; // expected-error{{template template argument 'W' is more constrained than template template parameter 'P'}}
+
+template<template<typename> class P> struct S2 { };
+
+S2<X> s21;
+S2<Y> s22;
+S2<Z> s23;
+
+template <template <typename...> class C>
+struct S3;
+
+template <C T>
+using N = typename T::type;
+
+using s31 = S3<N>;
+using s32 = S3<Z>;
diff --git a/src/llvm-project/clang/test/CXX/temp/temp.constr/temp.constr.constr/function-templates.cpp b/src/llvm-project/clang/test/CXX/temp/temp.constr/temp.constr.constr/function-templates.cpp
new file mode 100644
index 0000000..ea761b2
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/temp/temp.constr/temp.constr.constr/function-templates.cpp
@@ -0,0 +1,42 @@
+// RUN: %clang_cc1 -std=c++2a -x c++ -verify %s
+
+template<typename T>
+constexpr bool is_ptr_v = false;
+
+template<typename T>
+constexpr bool is_ptr_v<T*> = true;
+
+template<typename T, typename U>
+constexpr bool is_same_v = false;
+
+template<typename T>
+constexpr bool is_same_v<T, T> = true;
+
+template<typename T> requires is_ptr_v<T> // expected-note {{because 'is_ptr_v<int>' evaluated to false}}
+ // expected-note@-1{{because 'is_ptr_v<char>' evaluated to false}}
+auto dereference(T t) { // expected-note {{candidate template ignored: constraints not satisfied [with T = int]}}
+ // expected-note@-1{{candidate template ignored: constraints not satisfied [with T = char]}}
+ return *t;
+}
+
+static_assert(is_same_v<decltype(dereference<int*>(nullptr)), int>);
+static_assert(is_same_v<decltype(dereference(2)), int>); // expected-error {{no matching function for call to 'dereference'}}
+static_assert(is_same_v<decltype(dereference<char>('a')), char>); // expected-error {{no matching function for call to 'dereference'}}
+
+template<typename T> requires (T{} + T{}) // expected-note {{because substituted constraint expression is ill-formed: invalid operands to binary expression ('A' and 'A')}}
+auto foo(T t) { // expected-note {{candidate template ignored: constraints not satisfied [with T = A]}}
+ return t + t;
+}
+
+
+template<typename T> requires (!((T{} - T{}) && (T{} + T{})) || false)
+// expected-note@-1{{because substituted constraint expression is ill-formed: invalid operands to binary expression ('A' and 'A')}}
+// expected-note@-2{{and 'false' evaluated to false}}
+auto bar(T t) { // expected-note {{candidate template ignored: constraints not satisfied [with T = A]}}
+ return t + t;
+}
+
+struct A { };
+
+static_assert(foo(A{})); // expected-error {{no matching function for call to 'foo'}}
+static_assert(bar(A{})); // expected-error {{no matching function for call to 'bar'}}
\ No newline at end of file
diff --git a/src/llvm-project/clang/test/CXX/temp/temp.constr/temp.constr.constr/non-function-templates.cpp b/src/llvm-project/clang/test/CXX/temp/temp.constr/temp.constr.constr/non-function-templates.cpp
new file mode 100644
index 0000000..7d4d858
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/temp/temp.constr/temp.constr.constr/non-function-templates.cpp
@@ -0,0 +1,92 @@
+// RUN: %clang_cc1 -std=c++2a -x c++ -verify %s
+
+template<typename T> requires (sizeof(T) >= 2) // expected-note{{because 'sizeof(char) >= 2' (1 >= 2) evaluated to false}}
+struct A {
+ static constexpr int value = sizeof(T);
+};
+
+static_assert(A<int>::value == 4);
+static_assert(A<char>::value == 1); // expected-error{{constraints not satisfied for class template 'A' [with T = char]}}
+
+template<typename T, typename U>
+ requires (sizeof(T) != sizeof(U) // expected-note{{because 'sizeof(int) != sizeof(char [4])' (4 != 4) evaluated to false}}
+ && sizeof(T) >= 4) // expected-note{{because 'sizeof(char) >= 4' (1 >= 4) evaluated to false}}
+constexpr int SizeDiff = sizeof(T) > sizeof(U) ? sizeof(T) - sizeof(U) : sizeof(U) - sizeof(T);
+
+static_assert(SizeDiff<int, char> == 3);
+static_assert(SizeDiff<int, char[4]> == 0); // expected-error{{constraints not satisfied for variable template 'SizeDiff' [with T = int, U = char [4]]}}
+static_assert(SizeDiff<char, int> == 3); // expected-error{{constraints not satisfied for variable template 'SizeDiff' [with T = char, U = int]}}
+
+template<typename... Ts>
+ requires ((sizeof(Ts) == 4) || ...) // expected-note{{because 'sizeof(char) == 4' (1 == 4) evaluated to false}} expected-note{{'sizeof(long long) == 4' (8 == 4) evaluated to false}} expected-note{{'sizeof(int [20]) == 4' (80 == 4) evaluated to false}}
+constexpr auto SumSizes = (sizeof(Ts) + ...);
+
+static_assert(SumSizes<char, long long, int> == 13);
+static_assert(SumSizes<char, long long, int[20]> == 89); // expected-error{{constraints not satisfied for variable template 'SumSizes' [with Ts = <char, long long, int [20]>]}}
+
+template<typename T>
+concept IsBig = sizeof(T) > 100; // expected-note{{because 'sizeof(int) > 100' (4 > 100) evaluated to false}}
+
+template<typename T>
+ requires IsBig<T> // expected-note{{'int' does not satisfy 'IsBig'}}
+using BigPtr = T*;
+
+static_assert(sizeof(BigPtr<int>)); // expected-error{{constraints not satisfied for alias template 'BigPtr' [with T = int]}}}}
+
+template<typename T> requires T::value // expected-note{{because substituted constraint expression is ill-formed: type 'int' cannot be used prior to '::' because it has no members}}
+struct S { static constexpr bool value = true; };
+
+struct S2 { static constexpr bool value = true; };
+
+static_assert(S<int>::value); // expected-error{{constraints not satisfied for class template 'S' [with T = int]}}
+static_assert(S<S2>::value);
+
+template<typename T>
+struct AA
+{
+ template<typename U> requires (sizeof(U) == sizeof(T)) // expected-note{{because 'sizeof(int [2]) == sizeof(int)' (8 == 4) evaluated to false}}
+ struct B
+ {
+ static constexpr int a = 0;
+ };
+
+ template<typename U> requires (sizeof(U) == sizeof(T)) // expected-note{{because 'sizeof(int [2]) == sizeof(int)' (8 == 4) evaluated to false}}
+ static constexpr int b = 1;
+
+ template<typename U> requires (sizeof(U) == sizeof(T)) // expected-note{{because 'sizeof(int [2]) == sizeof(int)' (8 == 4) evaluated to false}}
+ static constexpr int getB() { // expected-note{{candidate template ignored: constraints not satisfied [with U = int [2]]}}
+ return 2;
+ }
+
+ static auto foo()
+ {
+ return B<T[2]>::a; // expected-error{{constraints not satisfied for class template 'B' [with U = int [2]]}}
+ }
+
+ static auto foo1()
+ {
+ return b<T[2]>; // expected-error{{constraints not satisfied for variable template 'b' [with U = int [2]]}}
+ }
+
+ static auto foo2()
+ {
+ return AA<T>::getB<T[2]>(); // expected-error{{no matching function for call to 'getB'}}
+ }
+};
+
+constexpr auto x = AA<int>::foo(); // expected-note{{in instantiation of member function 'AA<int>::foo' requested here}}
+constexpr auto x1 = AA<int>::foo1(); // expected-note{{in instantiation of member function 'AA<int>::foo1' requested here}}
+constexpr auto x2 = AA<int>::foo2(); // expected-note{{in instantiation of member function 'AA<int>::foo2' requested here}}
+
+template<typename T>
+struct B { using type = typename T::type; }; // expected-error{{type 'int' cannot be used prior to '::' because it has no members}}
+
+template<typename T> requires B<T>::type // expected-note{{in instantiation of template class 'B<int>' requested here}}
+ // expected-note@-1{{while substituting template arguments into constraint expression here}}
+struct C { };
+
+template<typename T> requires (T{}) // expected-error{{atomic constraint must be of type 'bool' (found 'int')}}
+struct D { };
+
+static_assert(C<int>{}); // expected-note{{while checking constraint satisfaction for template 'C<int>' required here}}
+static_assert(D<int>{}); // expected-note{{while checking constraint satisfaction for template 'D<int>' required here}}
diff --git a/src/llvm-project/clang/test/CXX/temp/temp.constr/temp.constr.constr/partial-specializations.cpp b/src/llvm-project/clang/test/CXX/temp/temp.constr/temp.constr.constr/partial-specializations.cpp
new file mode 100644
index 0000000..4372aab
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/temp/temp.constr/temp.constr.constr/partial-specializations.cpp
@@ -0,0 +1,84 @@
+// RUN: %clang_cc1 -std=c++2a -x c++ -verify %s
+
+namespace class_templates
+{
+ template<typename T, typename U> requires (sizeof(T) >= 4) // expected-note {{because 'sizeof(char) >= 4' (1 >= 4) evaluated to false}}
+ struct is_same { static constexpr bool value = false; };
+
+ template<typename T> requires (sizeof(T*) >= 4 && sizeof(T) >= 4)
+ struct is_same<T*, T*> { static constexpr bool value = true; };
+
+ static_assert(!is_same<char*, char*>::value);
+ static_assert(!is_same<short*, short*>::value);
+ static_assert(is_same<int*, int*>::value);
+ static_assert(is_same<char, char>::value); // expected-error {{constraints not satisfied for class template 'is_same' [with T = char, U = char]}}
+
+ template<typename T>
+ struct A { using type = typename T::type; }; // expected-error{{type 'int *' cannot be used prior to '::' because it has no members}}
+
+ template<typename T>
+ struct B {};
+
+ template<typename T> requires A<T>::type // expected-note{{in instantiation of template class 'class_templates::A<int *>' requested here}}
+ // expected-note@-1{{while substituting template arguments into constraint expression here}}
+ struct B<T*> {};
+
+ template<typename T> requires (T{}) // expected-error{{atomic constraint must be of type 'bool' (found 'int')}}
+ struct B<T**> {};
+
+ static_assert((B<int**>{}, true)); // expected-note{{while checking constraint satisfaction for class template partial specialization 'B<int *>' required here}}
+ // expected-note@-1{{while checking constraint satisfaction for class template partial specialization 'B<int>' required here}}
+ // expected-note@-2{{during template argument deduction for class template partial specialization 'B<T *>' [with T = int *]}}
+ // expected-note@-3{{during template argument deduction for class template partial specialization 'B<T **>' [with T = int]}}
+ // expected-note@-4 2{{in instantiation of template class 'class_templates::B<int **>' requested here}}
+
+ template<typename T, typename U = double>
+ concept same_as = is_same<T, U>::value;
+
+ template<same_as<bool> T> requires A<T>::type
+ struct B<T*> {};
+ // expected-note@-1{{previous}}
+
+ template<same_as<bool> T> requires A<T>::type
+ struct B<T*> {};
+ // expected-error@-1{{redefinition}}
+
+ template<same_as T> requires A<T>::type
+ struct B<T*> {};
+
+ template<same_as<int> T> requires A<T>::type
+ struct B<T*> {};
+}
+
+namespace variable_templates
+{
+ template<typename T, typename U> requires (sizeof(T) >= 4)
+ constexpr bool is_same_v = false;
+
+ template<typename T> requires (sizeof(T*) >= 4 && sizeof(T) >= 4)
+ constexpr bool is_same_v<T*, T*> = true;
+
+ static_assert(!is_same_v<char*, char*>);
+ static_assert(!is_same_v<short*, short*>);
+ static_assert(is_same_v<int*, int*>);
+
+ template<typename T>
+ struct A { using type = typename T::type; }; // expected-error{{type 'int *' cannot be used prior to '::' because it has no members}}
+
+ template<typename T>
+ constexpr bool v1 = false;
+
+ template<typename T> requires A<T>::type // expected-note{{in instantiation of template class 'variable_templates::A<int *>' requested here}}
+ // expected-note@-1{{while substituting template arguments into constraint expression here}}
+ constexpr bool v1<T*> = true;
+
+ template<typename T> requires (T{}) // expected-error{{atomic constraint must be of type 'bool' (found 'int')}}
+ constexpr bool v1<T**> = true;
+
+ static_assert(v1<int**>); // expected-note{{while checking constraint satisfaction for variable template partial specialization 'v1<int *>' required here}}
+ // expected-note@-1{{while checking constraint satisfaction for variable template partial specialization 'v1<int>' required here}}
+ // expected-note@-2{{during template argument deduction for variable template partial specialization 'v1<T *>' [with T = int *]}}
+ // expected-note@-3{{during template argument deduction for variable template partial specialization 'v1<T **>' [with T = int]}}
+ // expected-error@-4{{static_assert failed due to requirement 'v1<int **>'}}
+
+}
\ No newline at end of file
diff --git a/src/llvm-project/clang/test/CXX/temp/temp.constr/temp.constr.decl/class-template-decl.cpp b/src/llvm-project/clang/test/CXX/temp/temp.constr/temp.constr.decl/class-template-decl.cpp
new file mode 100644
index 0000000..abda869
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/temp/temp.constr/temp.constr.decl/class-template-decl.cpp
@@ -0,0 +1,89 @@
+// RUN: %clang_cc1 -std=c++2a -x c++ -verify %s
+
+namespace nodiag {
+
+template <typename T> requires (bool(T()))
+struct A;
+template <typename U> requires (bool(U()))
+struct A;
+
+template<typename T>
+concept C1 = true;
+
+template <C1 T> requires (bool(T()))
+struct B;
+template <C1 U> requires (bool(U()))
+struct B;
+
+} // end namespace nodiag
+
+namespace diag {
+
+template <typename T> requires true // expected-note{{previous template declaration is here}}
+struct A;
+template <typename T> struct A; // expected-error{{requires clause differs in template redeclaration}}
+
+template <typename T> struct B; // expected-note{{previous template declaration is here}}
+template <typename T> requires true // expected-error{{requires clause differs in template redeclaration}}
+struct B;
+
+template <typename T> requires true // expected-note{{previous template declaration is here}}
+struct C;
+template <typename T> requires (!0) // expected-error{{requires clause differs in template redeclaration}}
+struct C;
+
+template<typename T>
+concept C1 = true;
+
+template <C1 T> // expected-note{{previous template declaration is here}}
+struct D;
+template <typename T> requires C1<T> // expected-error{{type constraint differs in template redeclaration}}
+struct D;
+
+} // end namespace diag
+
+namespace nodiag {
+
+struct AA {
+ template <typename T> requires (someFunc(T()))
+ struct A;
+};
+
+template <typename U> requires (someFunc(U()))
+struct AA::A { };
+
+struct AAF {
+ template <typename T> requires (someFunc(T()))
+ friend struct AA::A;
+};
+
+} // end namespace nodiag
+
+namespace diag {
+
+template <unsigned N>
+struct TA {
+ template <template <unsigned> class TT> requires TT<N>::happy // expected-note {{previous template declaration is here}}
+ struct A;
+
+ template <template <unsigned> class TT> requires TT<N>::happy // expected-note {{previous template declaration is here}}
+ struct B;
+
+ struct AF;
+};
+
+template <unsigned N>
+template <template <unsigned> class TT> struct TA<N>::A { }; // expected-error{{requires clause differs in template redeclaration}}
+
+
+template <unsigned N>
+template <template <unsigned> class TT> requires TT<N + 1>::happy struct TA<N>::B { }; // expected-error{{requires clause differs in template redeclaration}}
+
+template <unsigned N>
+struct TA<N>::AF {
+ // we do not expect a diagnostic here because the template parameter list is dependent.
+ template <template <unsigned> class TT> requires TT<N + 0>::happy
+ friend struct TA::A;
+};
+
+} // end namespace diag
diff --git a/src/llvm-project/clang/test/CXX/temp/temp.constr/temp.constr.decl/func-template-decl.cpp b/src/llvm-project/clang/test/CXX/temp/temp.constr/temp.constr.decl/func-template-decl.cpp
new file mode 100644
index 0000000..30fbec6
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/temp/temp.constr/temp.constr.decl/func-template-decl.cpp
@@ -0,0 +1,59 @@
+// RUN: %clang_cc1 -std=c++2a -x c++ -verify %s
+
+namespace nodiag {
+
+template <typename T> requires (bool(T()))
+int A();
+template <typename U> requires (bool(U()))
+int A();
+
+} // end namespace nodiag
+
+namespace diag {
+
+namespace orig {
+ template <typename T> requires true
+ int A();
+ template <typename T>
+ int B();
+ template <typename T> requires true
+ int C();
+}
+
+template <typename T>
+int orig::A();
+// expected-error@-1{{out-of-line declaration of 'A' does not match any declaration in namespace 'diag::orig'}}
+template <typename T> requires true
+int orig::B();
+// expected-error@-1{{out-of-line declaration of 'B' does not match any declaration in namespace 'diag::orig'}}
+template <typename T> requires (!0)
+int orig::C();
+// expected-error@-1{{out-of-line declaration of 'C' does not match any declaration in namespace 'diag::orig'}}
+
+} // end namespace diag
+
+namespace nodiag {
+
+struct AA {
+ template <typename T> requires (someFunc(T()))
+ int A();
+};
+
+template <typename T> requires (someFunc(T()))
+int AA::A() { return sizeof(T); }
+
+} // end namespace nodiag
+
+namespace diag {
+
+template <unsigned N>
+struct TA {
+ template <template <unsigned> class TT> requires TT<N>::happy
+ int A();
+};
+
+template <unsigned N>
+template <template <unsigned> class TT> int TA<N>::A() { return sizeof(TT<N>); }
+// expected-error@-1{{out-of-line definition of 'A' does not match any declaration in 'TA<N>'}}
+
+} // end namespace diag
diff --git a/src/llvm-project/clang/test/CXX/temp/temp.constr/temp.constr.decl/p3.cpp b/src/llvm-project/clang/test/CXX/temp/temp.constr/temp.constr.decl/p3.cpp
new file mode 100644
index 0000000..749ec1c
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/temp/temp.constr/temp.constr.decl/p3.cpp
@@ -0,0 +1,30 @@
+// RUN: %clang_cc1 -std=c++2a -x c++ -verify %s
+
+template<typename T>
+struct X {
+ using Y = typename T::invalid;
+};
+
+template<typename T>
+concept Invalid = X<T>{};
+
+template<typename T>
+concept False = false; // expected-note{{because 'false' evaluated to false}}
+
+template<typename T>
+concept True = true;
+
+// TODO: Concepts: Uncomment trailing requires clauses here when we have correct substitution.
+//template<True T>
+// requires False<T>
+//void g1() requires Invalid<T>;
+//
+//using g1i = decltype(g1<int>());
+
+template<False T> // expected-note{{because 'int' does not satisfy 'False'}}
+ requires Invalid<T>
+void g2(); // requires Invalid<T>;
+// expected-note@-1{{candidate template ignored: constraints not satisfied [with T = int]}}
+
+using g2i = decltype(g2<int>());
+// expected-error@-1{{no matching function for call to 'g2'}}
\ No newline at end of file
diff --git a/src/llvm-project/clang/test/CXX/temp/temp.constr/temp.constr.decl/var-template-decl.cpp b/src/llvm-project/clang/test/CXX/temp/temp.constr/temp.constr.decl/var-template-decl.cpp
new file mode 100644
index 0000000..eabb636
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/temp/temp.constr/temp.constr.decl/var-template-decl.cpp
@@ -0,0 +1,25 @@
+// RUN: %clang_cc1 -std=c++2a -x c++ -verify %s
+
+namespace nodiag {
+
+struct B {
+ template <typename T> requires (bool(T()))
+ static int A;
+};
+
+template <typename U> requires (bool(U()))
+int B::A = int(U());
+
+} // end namespace nodiag
+
+namespace diag {
+
+struct B {
+ template <typename T> requires (bool(T())) // expected-note{{previous template declaration is here}}
+ static int A;
+};
+
+template <typename U> requires (!bool(U())) // expected-error{{requires clause differs in template redeclaration}}
+int B::A = int(U());
+
+} // end namespace diag
\ No newline at end of file
diff --git a/src/llvm-project/clang/test/CXX/temp/temp.constr/temp.constr.normal/p1.cpp b/src/llvm-project/clang/test/CXX/temp/temp.constr/temp.constr.normal/p1.cpp
new file mode 100644
index 0000000..153d4a5
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/temp/temp.constr/temp.constr.normal/p1.cpp
@@ -0,0 +1,69 @@
+// RUN: %clang_cc1 -std=c++2a -x c++ -verify %s
+
+template<typename T> concept True = true;
+template<typename T> concept Foo = True<T*>;
+template<typename T> concept Bar = Foo<T&>;
+template<typename T> requires Bar<T> struct S { };
+template<typename T> requires Bar<T> && true struct S<T> { };
+
+template<typename T> concept True2 = sizeof(T) >= 0;
+template<typename T> concept Foo2 = True2<T*>;
+// expected-error@-1{{'type name' declared as a pointer to a reference of type 'type-parameter-0-0 &'}}
+template<typename T> concept Bar2 = Foo2<T&>;
+// expected-note@-1{{while substituting into concept arguments here; substitution failures not allowed in concept arguments}}
+template<typename T> requires Bar2<T> struct S2 { };
+// expected-note@-1{{template is declared here}}
+template<typename T> requires Bar2<T> && true struct S2<T> { };
+// expected-error@-1{{class template partial specialization is not more specialized than the primary template}}
+// expected-note@-2{{while calculating associated constraint of template 'S2' here}}
+
+namespace type_pack {
+ template<typename... Args>
+ concept C1 = ((sizeof(Args) >= 0) && ...);
+
+ template<typename A, typename... B>
+ concept C2 = C1<A, B...>;
+
+ template<typename T>
+ constexpr void foo() requires C2<T, char, T> { }
+
+ template<typename T>
+ constexpr void foo() requires C1<T, char, T> && true { }
+
+ static_assert((foo<int>(), true));
+}
+
+namespace template_pack {
+ template<typename T> struct S1 {};
+ template<typename T> struct S2 {};
+
+ template<template<typename> typename... Args>
+ concept C1 = ((sizeof(Args<int>) >= 0) && ...);
+
+ template<template<typename> typename A, template<typename> typename... B>
+ concept C2 = C1<A, B...>;
+
+ template<template<typename> typename T>
+ constexpr void foo() requires C2<T, S1, T> { }
+
+ template<template<typename> typename T>
+ constexpr void foo() requires C1<T, S1, T> && true { }
+
+ static_assert((foo<S2>(), true));
+}
+
+namespace non_type_pack {
+ template<int... Args>
+ concept C1 = ((Args >= 0) && ...);
+
+ template<int A, int... B>
+ concept C2 = C1<A, B...>;
+
+ template<int T>
+ constexpr void foo() requires C2<T, 2, T> { }
+
+ template<int T>
+ constexpr void foo() requires C1<T, 2, T> && true { }
+
+ static_assert((foo<1>(), true));
+}
diff --git a/src/llvm-project/clang/test/CXX/temp/temp.constr/temp.constr.order/class-template-partial-specializations.cpp b/src/llvm-project/clang/test/CXX/temp/temp.constr/temp.constr.order/class-template-partial-specializations.cpp
new file mode 100644
index 0000000..ceb5af8
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/temp/temp.constr/temp.constr.order/class-template-partial-specializations.cpp
@@ -0,0 +1,65 @@
+// RUN: %clang_cc1 -std=c++2a -x c++ -verify %s
+
+template<typename T> requires (sizeof(T) >= 4)
+// expected-note@-1{{similar constraint expressions not considered equivalen}}
+class A{}; // expected-note{{template is declared here}}
+
+template<typename T> requires (sizeof(T) >= 4 && sizeof(T) <= 10)
+// expected-note@-1{{similar constraint expression here}}
+
+class A<T>{}; // expected-error{{class template partial specialization is not more specialized than the primary template}}
+
+template<typename T>
+concept C1 = sizeof(T) >= 4;
+
+template<typename T> requires C1<T>
+class B{};
+
+template<typename T> requires (C1<T> && sizeof(T) <= 10)
+class B<T>{};
+
+template<typename T>
+concept C2 = sizeof(T) > 1 && sizeof(T) <= 8;
+
+template<typename T>
+class C{};
+
+template<typename T> requires C1<T>
+class C<T>{};
+
+template<typename T>
+class D{}; // expected-note{{previous definition is here}}
+
+template<typename T>
+class D<T>{}; // expected-error{{class template partial specialization does not specialize any template argument; to define the primary template, remove the template argument list}} expected-error{{redefinition of 'D'}}
+
+template<typename T> requires C1<T> // expected-note{{previous template declaration is here}}
+class E{};
+
+template<typename T> // expected-error{{requires clause differs in template redeclaration}}
+class E<T>{}; // expected-error{{class template partial specialization does not specialize any template argument; to define the primary template, remove the template argument list}}
+
+template<typename T>
+struct F{ enum{ value = 1 }; };
+
+template<typename T> requires C1<T> && C2<T>
+struct F<T>{ enum{ value = 2 }; };
+
+template<typename T> requires C1<T> || C2<T>
+struct F<T>{ enum{ value = 3 }; };
+
+static_assert(F<unsigned>::value == 2);
+static_assert(F<char[10]>::value == 3);
+static_assert(F<char>::value == 1);
+
+// Make sure atomic constraints subsume each other only if their parameter
+// mappings are identical.
+
+template<typename T, typename U> requires C2<T>
+struct I { }; // expected-note {{template is declared here}}
+
+template<typename T, typename U> requires C2<U>
+struct I<T, U> { }; // expected-error {{class template partial specialization is not more specialized than the primary template}}
+
+template<typename T, typename U> requires C2<T> && C2<U>
+struct I<T, U> { };
diff --git a/src/llvm-project/clang/test/CXX/temp/temp.constr/temp.constr.order/function-templates.cpp b/src/llvm-project/clang/test/CXX/temp/temp.constr/temp.constr.order/function-templates.cpp
new file mode 100644
index 0000000..8ae6308
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/temp/temp.constr/temp.constr.order/function-templates.cpp
@@ -0,0 +1,91 @@
+// RUN: %clang_cc1 -std=c++2a -x c++ -verify %s
+
+template<typename T> requires (sizeof(T) >= 4)
+// expected-note@-1{{similar constraint expressions not considered equivalent}}
+bool a() { return false; } // expected-note {{candidate function [with T = unsigned int]}}
+
+template<typename T> requires (sizeof(T) >= 4 && sizeof(T) <= 10)
+// expected-note@-1{{similar constraint expression here}}
+bool a() { return true; } // expected-note {{candidate function [with T = unsigned int]}}
+
+bool av = a<unsigned>(); // expected-error {{call to 'a' is ambiguous}}
+
+template<typename T>
+concept C1 = sizeof(T) >= 4;
+
+template<typename T> requires C1<T>
+constexpr bool b() { return false; }
+
+template<typename T> requires (C1<T> && sizeof(T) <= 10)
+constexpr bool b() { return true; }
+
+static_assert(b<int>());
+static_assert(!b<int[10]>());
+
+template<typename T>
+concept C2 = sizeof(T) > 1 && sizeof(T) <= 8;
+
+template<typename T>
+bool c() { return false; }
+
+template<typename T> requires C1<T>
+bool c() { return true; }
+
+template<typename T> requires C1<T>
+constexpr bool d() { return false; }
+
+template<typename T>
+constexpr bool d() { return true; }
+
+static_assert(!d<int>());
+
+template<typename T>
+constexpr int e() { return 1; }
+
+template<typename T> requires C1<T> && C2<T>
+constexpr int e() { return 2; }
+
+template<typename T> requires C1<T> || C2<T>
+constexpr int e() { return 3; }
+
+static_assert(e<unsigned>() == 2);
+static_assert(e<char[10]>() == 3);
+static_assert(e<char>() == 1);
+
+template<class T, class U>
+concept BiggerThan = sizeof(T) > sizeof(U);
+
+template<class T>
+concept BiggerThanInt = BiggerThan<T, int>;
+
+template<class T, class U> requires BiggerThan<T, U>
+void f() { }
+// expected-note@-1 {{candidate function [with T = long long, U = int]}}
+
+template<class T, class U> requires BiggerThanInt<T>
+void f() { }
+// expected-note@-1 {{candidate function [with T = long long, U = int]}}
+
+static_assert(sizeof(f<long long, int>()));
+// expected-error@-1 {{call to 'f' is ambiguous}}
+
+template<typename T>
+concept C3 = true;
+
+template<typename T>
+concept C4 = true && C3<T>;
+
+template<typename T> requires C3<void>
+int g() { }
+
+template<typename T> requires C4<void>
+int g() { }
+
+static_assert(sizeof(g<int>()));
+
+// Regression - used template parameter detection when only first out of
+// multiple parameters are used
+template <unsigned> struct X {};
+template <class...> int h(X<0>);
+template <unsigned b, class...> int h(X<b>);
+static_assert(sizeof(h(X<0>{})));
diff --git a/src/llvm-project/clang/test/CXX/temp/temp.constr/temp.constr.order/var-template-partial-specializations.cpp b/src/llvm-project/clang/test/CXX/temp/temp.constr/temp.constr.order/var-template-partial-specializations.cpp
new file mode 100644
index 0000000..98bfaea
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/temp/temp.constr/temp.constr.order/var-template-partial-specializations.cpp
@@ -0,0 +1,55 @@
+// RUN: %clang_cc1 -std=c++2a -x c++ -verify %s
+
+template<typename T> requires (sizeof(T) >= 4)
+// expected-note@-1{{similar constraint expressions not considered equivalent}}
+bool a = false; // expected-note{{template is declared here}}
+
+template<typename T> requires (sizeof(T) >= 4 && sizeof(T) <= 10)
+// expected-note@-1{{similar constraint expression here}}
+bool a<T> = true; // expected-error{{variable template partial specialization is not more specialized than the primary template}}
+
+template<typename T>
+concept C1 = sizeof(T) >= 4;
+
+template<typename T> requires C1<T>
+bool b = false;
+
+template<typename T> requires (C1<T> && sizeof(T) <= 10)
+bool b<T> = true;
+
+template<typename T>
+concept C2 = sizeof(T) > 1 && sizeof(T) <= 8;
+
+template<typename T>
+bool c = false;
+
+template<typename T> requires C1<T>
+bool c<T> = true;
+
+template<typename T>
+bool d = false;
+
+template<typename T>
+bool d<T> = true; // expected-error{{variable template partial specialization does not specialize any template argument; to define the primary template, remove the template argument list}}
+
+template<typename T> requires C1<T>
+bool e = false;
+
+template<typename T>
+bool e<T> = true; // expected-error{{variable template partial specialization does not specialize any template argument; to define the primary template, remove the template argument list}}
+
+template<typename T>
+constexpr int f = 1;
+
+template<typename T> requires C1<T> && C2<T>
+constexpr int f<T> = 2;
+
+template<typename T> requires C1<T> || C2<T>
+constexpr int f<T> = 3;
+
+static_assert(f<unsigned> == 2);
+static_assert(f<char[10]> == 3);
+static_assert(f<char> == 1);
+
+
+
diff --git a/src/llvm-project/clang/test/CXX/temp/temp.decls/temp.variadic/init-capture.cpp b/src/llvm-project/clang/test/CXX/temp/temp.decls/temp.variadic/init-capture.cpp
index 4d5b6b4..ce2fccc 100644
--- a/src/llvm-project/clang/test/CXX/temp/temp.decls/temp.variadic/init-capture.cpp
+++ b/src/llvm-project/clang/test/CXX/temp/temp.decls/temp.variadic/init-capture.cpp
@@ -37,3 +37,11 @@
}... // expected-error {{does not contain any unexpanded}}
);
}
+
+template<int ...a> constexpr auto x = [...z = a] (auto F) { return F(z...); };
+static_assert(x<1,2,3>([](int a, int b, int c) { return 100 * a + 10 * b + c; }) == 123);
+static_assert(x<1,2,3>([](int a, int b, int c) { return 100 * a + 10 * b + c; }) == 124); // expected-error {{failed}}
+
+template<int ...a> constexpr auto y = [z = a...] (auto F) { return F(z...); }; // expected-error {{must appear before the name of the capture}}
+static_assert(y<1,2,3>([](int a, int b, int c) { return 100 * a + 10 * b + c; }) == 123);
+static_assert(y<1,2,3>([](int a, int b, int c) { return 100 * a + 10 * b + c; }) == 124); // expected-error {{failed}}
diff --git a/src/llvm-project/clang/test/CXX/temp/temp.deduct/p5.cpp b/src/llvm-project/clang/test/CXX/temp/temp.deduct/p5.cpp
new file mode 100644
index 0000000..0c998b1
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/temp/temp.deduct/p5.cpp
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -std=c++2a -verify %s -code-completion-at=%s:6:16
+// expected-no-diagnostics
+
+template <typename T> concept C = true;
+void bar(C auto foo);
+int y = bar(
\ No newline at end of file
diff --git a/src/llvm-project/clang/test/CXX/temp/temp.explicit/p8.cpp b/src/llvm-project/clang/test/CXX/temp/temp.explicit/p8.cpp
new file mode 100644
index 0000000..1f09be0
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/temp/temp.explicit/p8.cpp
@@ -0,0 +1,22 @@
+// RUN: %clang_cc1 -std=c++2a -x c++ -verify %s
+
+template<typename T, typename S = char> requires (sizeof(T) + sizeof(S) < 10)
+// expected-note@-1{{because 'sizeof(char [100]) + sizeof(char) < 10' (101 < 10) evaluated to false}}
+void f(T t, S s) requires (sizeof(t) == 1 && sizeof(s) == 1) { };
+// expected-note@-1{{candidate template ignored: constraints not satisfied [with T = int, S = char]}}
+// expected-note@-2{{because 'sizeof (t) == 1' (4 == 1) evaluated to false}}
+// expected-note@-3{{candidate template ignored: constraints not satisfied [with T = char, S = short]}}
+// expected-note@-4{{because 'sizeof (s) == 1' (2 == 1) evaluated to false}}
+// expected-note@-5{{candidate template ignored: constraints not satisfied [with T = char [100], S = char]}}
+
+template<>
+void f<int>(int t, char s) { };
+// expected-error@-1{{no function template matches function template specialization 'f'}}
+
+template<>
+void f<char, short>(char t, short s) { };
+// expected-error@-1{{no function template matches function template specialization 'f'}}
+
+template<>
+void f<char[100]>(char t[100], char s) { };
+// expected-error@-1{{no function template matches function template specialization 'f'}}
\ No newline at end of file
diff --git a/src/llvm-project/clang/test/CXX/temp/temp.fct.spec/temp.deduct/p7.cpp b/src/llvm-project/clang/test/CXX/temp/temp.fct.spec/temp.deduct/p7.cpp
index bc074ba..f0ab7b8e 100644
--- a/src/llvm-project/clang/test/CXX/temp/temp.fct.spec/temp.deduct/p7.cpp
+++ b/src/llvm-project/clang/test/CXX/temp/temp.fct.spec/temp.deduct/p7.cpp
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -std=c++11 -verify %s
+// RUN: %clang_cc1 -std=c++2a -verify %s
struct Q { typedef int type; };
@@ -20,3 +21,36 @@
int &c(...);
int &c_disabled = c(0);
int &c_enabled = c(Q()); // expected-error {{cannot bind to a temporary of type 'void'}}
+
+// The substitution proceeds in lexical order and stops when a condition that
+// causes deduction to fail is encountered.
+#if __cplusplus > 201702L
+namespace reversed_operator_substitution_order {
+ struct X { X(int); };
+ struct Y { Y(int); };
+ struct Cat {};
+ namespace no_adl {
+ Cat operator<=>(Y, X);
+ bool operator<(int, Cat);
+
+ template<typename T> struct indirect_sizeof {
+ static_assert(sizeof(T) != 0);
+ static const auto value = sizeof(T);
+ };
+
+ // We should substitute into the construction of the X object before the
+ // construction of the Y object, so this is a SFINAE case rather than a
+ // hard error. This requires substitution to proceed in lexical order
+ // despite the prior rewrite to
+ // 0 < (Y(...) <=> X(...))
+ template<typename T> float &f(
+ decltype(
+ X(sizeof(T)) < Y(indirect_sizeof<T>::value)
+ )
+ );
+ template<typename T> int &f(...);
+ }
+ int &r = no_adl::f<void>(true);
+ float &s = no_adl::f<int>(true);
+}
+#endif
diff --git a/src/llvm-project/clang/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.type/p5-0x.cpp b/src/llvm-project/clang/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.type/p5-0x.cpp
index 6974129..2d9896b 100644
--- a/src/llvm-project/clang/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.type/p5-0x.cpp
+++ b/src/llvm-project/clang/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.type/p5-0x.cpp
@@ -35,3 +35,34 @@
template<typename ...T, typename U> void has_non_trailing_pack_and_more(T ..., U); // expected-note {{failed}}
void (*ptr_has_non_trailing_pack_and_more_1)(float, double, int) = &has_non_trailing_pack_and_more<float, double>;
void (*ptr_has_non_trailing_pack_and_more_2)(float, double, int) = &has_non_trailing_pack_and_more<float>; // expected-error {{does not match}}
+
+// - A function parameter for which the associated argument is an initializer
+// list but the parameter does not have a type for which deduction from an
+// initializer list is specified.
+
+// We interpret these "non-deduced context"s as actually deducing the arity --
+// but not the contents -- of a function parameter pack appropriately for the
+// number of arguments.
+namespace VariadicVsInitList {
+ template<typename T, typename ...> struct X { using type = typename T::error; };
+ template<typename ...T, typename X<int, T...>::type = 0> void f(T ...) = delete;
+ void f(long);
+ void f(long, long);
+ void f(long, long, long);
+
+ // FIXME: We shouldn't say "substitution failure: " here.
+ template<typename ...T> void g(T ...) = delete; // expected-note {{substitution failure: deduced incomplete pack <(no value)> for template parameter 'T'}}
+
+ void h() {
+ // These all call the non-template overloads of 'f', because of a deduction
+ // failure due to incomplete deduction of the pack 'T'. If deduction
+ // succeeds and deduces an empty pack instead, we would get a hard error
+ // instantiating 'X'.
+ f({0}); // expected-warning {{braces around scalar}}
+ f({0}, {0}); // expected-warning 2{{braces around scalar}}
+ f(1, {0}); // expected-warning {{braces around scalar}}
+ f(1, {0}, 2); // expected-warning {{braces around scalar}}
+
+ g({0}); // expected-error {{no matching function}}
+ }
+}
diff --git a/src/llvm-project/clang/test/CXX/temp/temp.param/p10-2a.cpp b/src/llvm-project/clang/test/CXX/temp/temp.param/p10-2a.cpp
new file mode 100644
index 0000000..f9398de
--- /dev/null
+++ b/src/llvm-project/clang/test/CXX/temp/temp.param/p10-2a.cpp
@@ -0,0 +1,140 @@
+// RUN: %clang_cc1 -std=c++2a -x c++ -verify %s
+
+template<typename T>
+concept C1 = sizeof(T) == 1;
+// expected-note@-1 2{{because 'sizeof(short) == 1' (2 == 1) evaluated to false}}
+// expected-note@-2 {{because 'sizeof(int) == 1' (4 == 1) evaluated to false}}
+
+template<C1 T> // expected-note {{because 'int' does not satisfy 'C1'}}
+using A = T;
+
+using a1 = A<int>; // expected-error {{constraints not satisfied for alias template 'A' [with T = int]}}
+using a2 = A<char>;
+
+template<typename T>
+concept C2 = sizeof(T) == 2;
+// expected-note@-1 {{because 'sizeof(char) == 2' (1 == 2) evaluated to false}}
+
+template<C1 T1, C2 T2>
+// expected-note@-1 2{{because 'short' does not satisfy 'C1'}}
+// expected-note@-2 {{because 'char' does not satisfy 'C2'}}
+using B = T1;
+
+using b1 = B<char, short>;
+using b2 = B<char, char>; // expected-error {{constraints not satisfied for alias template 'B' [with T1 = char, T2 = char]}}
+using b3 = B<short, short>; // expected-error {{constraints not satisfied for alias template 'B' [with T1 = short, T2 = short]}}
+using b4 = B<short, char>; // expected-error {{constraints not satisfied for alias template 'B' [with T1 = short, T2 = char]}}
+
+template<typename... T>
+concept C3 = (sizeof(T) + ...) == 12;
+// expected-note@-1 {{because 'sizeof(char [11]) == 12' (11 == 12) evaluated to false}}
+// expected-note@-2 {{because 'sizeof(char [10]) == 12' (10 == 12) evaluated to false}}
+// expected-note@-3 3{{because 'sizeof(int) == 12' (4 == 12) evaluated to false}}
+// expected-note@-4 6{{because 'sizeof(short) == 12' (2 == 12) evaluated to false}}
+
+template<C3 T1, C3 T2, C3 T3>
+// expected-note@-1 {{because 'char [11]' does not satisfy 'C3'}}
+// expected-note@-2 {{because 'char [10]' does not satisfy 'C3'}}
+using C = T2;
+
+using c1 = C<char[12], int[3], short[6]>;
+using c2 = C<char[12], char[11], char[10]>;
+// expected-error@-1 {{constraints not satisfied for alias template 'C' [with T1 = char [12], T2 = char [11], T3 = char [10]]}}
+using c3 = C<char[12], char[12], char[10]>;
+// expected-error@-1 {{constraints not satisfied for alias template 'C' [with T1 = char [12], T2 = char [12], T3 = char [10]]}}
+
+template<C3... Ts>
+// expected-note@-1 {{because 'int' does not satisfy 'C3'}}
+// expected-note@-2 2{{and 'int' does not satisfy 'C3'}}
+// expected-note@-3 {{because 'short' does not satisfy 'C3'}}
+// expected-note@-4 5{{and 'short' does not satisfy 'C3'}}
+using D = int;
+
+using d1 = D<char[12], int[3], short[6]>;
+using d2 = D<int, int, int>;
+// expected-error@-1 {{constraints not satisfied for alias template 'D' [with Ts = <int, int, int>}}
+using d3 = D<short, short, short, short, short, short>;
+// expected-error@-1 {{constraints not satisfied for alias template 'D' [with Ts = <short, short, short, short, short, short>}}
+
+template<typename T>
+concept C4 = sizeof(T) == 4;
+// expected-note@-1 3{{because 'sizeof(char) == 4' (1 == 4) evaluated to false}}
+
+template<C4... Ts>
+// expected-note@-1 2{{because 'char' does not satisfy 'C4'}}
+// expected-note@-2 {{and 'char' does not satisfy 'C4'}}
+using E = int;
+
+using e1 = E<int>;
+using e2 = E<char, int>; // expected-error {{constraints not satisfied for alias template 'E' [with Ts = <char, int>]}}
+using e3 = E<char, char>; // expected-error {{constraints not satisfied for alias template 'E' [with Ts = <char, char>]}}
+using e4 = E<>;
+
+template<typename T, typename U>
+constexpr bool is_same_v = false;
+
+template<typename T>
+constexpr bool is_same_v<T, T> = true;
+
+template<typename T, typename U>
+concept Same = is_same_v<T, U>; // expected-note {{because 'is_same_v<long, int>' evaluated to false}}
+
+template<Same<int> T> // expected-note {{because 'Same<long, int>' evaluated to false}}
+using F = T;
+
+using f1 = F<int>;
+using f2 = F<long>; // expected-error {{constraints not satisfied for alias template 'F' [with T = long]}}
+
+template<typename T, typename... Ts>
+concept OneOf = (is_same_v<T, Ts> || ...);
+// expected-note@-1 2{{because 'is_same_v<char, char [1]>' evaluated to false}}
+// expected-note@-2 2{{and 'is_same_v<char, char [2]>' evaluated to false}}
+// expected-note@-3 {{because 'is_same_v<short, int>' evaluated to false}}
+// expected-note@-4 {{and 'is_same_v<short, long>' evaluated to false}}
+// expected-note@-5 {{and 'is_same_v<short, char>' evaluated to false}}
+// expected-note@-6 3{{because 'is_same_v<int, char [1]>' evaluated to false}}
+// expected-note@-7 3{{and 'is_same_v<int, char [2]>' evaluated to false}}
+// expected-note@-8 2{{because 'is_same_v<nullptr_t, char>' evaluated to false}}
+// expected-note@-9 2{{and 'is_same_v<nullptr_t, int>' evaluated to false}}
+
+template<OneOf<char[1], char[2]> T, OneOf<int, long, char> U>
+// expected-note@-1 2{{because 'OneOf<char, char [1], char [2]>' evaluated to false}}
+// expected-note@-2 {{because 'OneOf<short, int, long, char>' evaluated to false}}
+using G = T;
+
+using g1 = G<char[1], int>;
+using g2 = G<char, int>; // expected-error{{constraints not satisfied for alias template 'G' [with T = char, U = int]}}
+using g3 = G<char[1], short>; // expected-error{{constraints not satisfied for alias template 'G' [with T = char [1], U = short]}}
+using g4 = G<char, short>; // expected-error{{constraints not satisfied for alias template 'G' [with T = char, U = short]}}
+
+template<OneOf<char[1], char[2]>... Ts>
+// expected-note@-1 2{{because 'OneOf<int, char [1], char [2]>' evaluated to false}}
+// expected-note@-2 {{and 'OneOf<int, char [1], char [2]>' evaluated to false}}
+using H = int;
+
+using h1 = H<char[1], int>;
+// expected-error@-1 {{constraints not satisfied for alias template 'H' [with Ts = <char [1], int>]}}
+using h2 = H<int, int>;
+// expected-error@-1 {{constraints not satisfied for alias template 'H' [with Ts = <int, int>]}}
+using h3 = H<char[1], char[2]>;
+
+template<OneOf<char, int> auto x>
+// expected-note@-1 {{because 'OneOf<decltype(nullptr), char, int>' evaluated to false}}
+using I = int;
+
+using i1 = I<1>;
+using i2 = I<'a'>;
+using i3 = I<nullptr>;
+// expected-error@-1 {{constraints not satisfied for alias template 'I' [with x = nullptr]}}
+
+template<OneOf<char, int> auto... x>
+// expected-note@-1 {{because 'OneOf<decltype(nullptr), char, int>' evaluated to false}}
+using J = int;
+
+using j1 = J<1, 'b'>;
+using j2 = J<'a', nullptr>;
+// expected-error@-1 {{constraints not satisfied for alias template 'J' [with x = <'a', nullptr>]}}
+
+template<OneOf<char, int> auto &x>
+// expected-error@-1 {{constrained placeholder types other than simple 'auto' on non-type template parameters not supported yet}}
+using K = int;
diff --git a/src/llvm-project/clang/test/CXX/temp/temp.res/temp.dep/temp.dep.constexpr/p2.cpp b/src/llvm-project/clang/test/CXX/temp/temp.res/temp.dep/temp.dep.constexpr/p2.cpp
index 68a41c7..6c0df1a 100644
--- a/src/llvm-project/clang/test/CXX/temp/temp.res/temp.dep/temp.dep.constexpr/p2.cpp
+++ b/src/llvm-project/clang/test/CXX/temp/temp.res/temp.dep/temp.dep.constexpr/p2.cpp
@@ -16,6 +16,6 @@
typename S<k>::T check3; // ok, u is value-dependent
const int &i = k;
- typename S<i>::T check4; // expected-error {{not an integral constant expression}} expected-error {{qualified name}}
+ typename S<i>::T check4; // expected-error {{not an integral constant expression}}
}
};
diff --git a/src/llvm-project/clang/test/CXX/temp/temp.spec/temp.expl.spec/p20.cpp b/src/llvm-project/clang/test/CXX/temp/temp.spec/temp.expl.spec/p20.cpp
index 86cdcf8..0283dba 100644
--- a/src/llvm-project/clang/test/CXX/temp/temp.spec/temp.expl.spec/p20.cpp
+++ b/src/llvm-project/clang/test/CXX/temp/temp.spec/temp.expl.spec/p20.cpp
@@ -3,7 +3,7 @@
void f(T);
template<typename T>
-struct A { };
+struct A { }; // expected-note{{template is declared here}}
struct X {
template<> friend void f<int>(int); // expected-error{{in a friend}}
@@ -12,3 +12,12 @@
friend void f<float>(float); // okay
friend class A<float>; // okay
};
+
+struct PR41792 {
+ // expected-error@+1{{cannot declare an explicit specialization in a friend}}
+ template <> friend void f<>(int);
+
+ // expected-error@+2{{template specialization declaration cannot be a friend}}
+ // expected-error@+1{{too few template arguments for class template 'A'}}
+ template <> friend class A<>;
+};
diff --git a/src/llvm-project/clang/test/ClangScanDeps/Inputs/foodir b/src/llvm-project/clang/test/ClangScanDeps/Inputs/foodir
new file mode 100644
index 0000000..c2e511e
--- /dev/null
+++ b/src/llvm-project/clang/test/ClangScanDeps/Inputs/foodir
@@ -0,0 +1 @@
+// A C++ header with same name as that of a directory in the include path.
diff --git a/src/llvm-project/clang/test/ClangScanDeps/Inputs/frameworks/Framework.framework/Headers/Framework.h b/src/llvm-project/clang/test/ClangScanDeps/Inputs/frameworks/Framework.framework/Headers/Framework.h
new file mode 100644
index 0000000..a2ea255
--- /dev/null
+++ b/src/llvm-project/clang/test/ClangScanDeps/Inputs/frameworks/Framework.framework/Headers/Framework.h
@@ -0,0 +1,2 @@
+// This comment is stripped, so size is changed when file is opened
+#define FRAMEWORK 0
diff --git a/src/llvm-project/clang/test/ClangScanDeps/Inputs/frameworks/Framework.framework/PrivateHeaders/PrivateHeader.h b/src/llvm-project/clang/test/ClangScanDeps/Inputs/frameworks/Framework.framework/PrivateHeaders/PrivateHeader.h
new file mode 100644
index 0000000..83a0bf9
--- /dev/null
+++ b/src/llvm-project/clang/test/ClangScanDeps/Inputs/frameworks/Framework.framework/PrivateHeaders/PrivateHeader.h
@@ -0,0 +1,2 @@
+// This comment is stripped when file is opened, so size will change
+#define PRIV 0
diff --git a/src/llvm-project/clang/test/ClangScanDeps/Inputs/has_include_if_elif.json b/src/llvm-project/clang/test/ClangScanDeps/Inputs/has_include_if_elif.json
new file mode 100644
index 0000000..36ca006
--- /dev/null
+++ b/src/llvm-project/clang/test/ClangScanDeps/Inputs/has_include_if_elif.json
@@ -0,0 +1,7 @@
+[
+{
+ "directory": "DIR",
+ "command": "clang -E DIR/has_include_if_elif2.cpp -IInputs",
+ "file": "DIR/has_include_if_elif2.cpp"
+}
+]
diff --git a/src/llvm-project/clang/test/ClangScanDeps/Inputs/header_stat_before_open_cdb.json b/src/llvm-project/clang/test/ClangScanDeps/Inputs/header_stat_before_open_cdb.json
new file mode 100644
index 0000000..c5f027e
--- /dev/null
+++ b/src/llvm-project/clang/test/ClangScanDeps/Inputs/header_stat_before_open_cdb.json
@@ -0,0 +1,7 @@
+[
+{
+ "directory": "DIR",
+ "command": "clang -E DIR/header_stat_before_open_input.m -iframework Inputs/frameworks",
+ "file": "DIR/header_stat_before_open_input.m"
+}
+]
diff --git a/src/llvm-project/clang/test/ClangScanDeps/Inputs/headerwithdirname.json b/src/llvm-project/clang/test/ClangScanDeps/Inputs/headerwithdirname.json
new file mode 100644
index 0000000..2ae5619
--- /dev/null
+++ b/src/llvm-project/clang/test/ClangScanDeps/Inputs/headerwithdirname.json
@@ -0,0 +1,7 @@
+[
+ {
+ "directory": "DIR",
+ "command": "clang -c -IDIR -IDIR/foodir -IInputs DIR/headerwithdirname_input.cpp",
+ "file": "DIR/headerwithdirname_input.cpp"
+ }
+]
diff --git a/src/llvm-project/clang/test/ClangScanDeps/Inputs/headerwithdirnamefollowedbyinclude.json b/src/llvm-project/clang/test/ClangScanDeps/Inputs/headerwithdirnamefollowedbyinclude.json
new file mode 100644
index 0000000..de7759d
--- /dev/null
+++ b/src/llvm-project/clang/test/ClangScanDeps/Inputs/headerwithdirnamefollowedbyinclude.json
@@ -0,0 +1,7 @@
+[
+ {
+ "directory": "DIR",
+ "command": "clang -c -IDIR -IInputs DIR/headerwithdirname_input.cpp",
+ "file": "DIR/headerwithdirname_input.cpp"
+ }
+]
diff --git a/src/llvm-project/clang/test/ClangScanDeps/Inputs/module.modulemap b/src/llvm-project/clang/test/ClangScanDeps/Inputs/module.modulemap
new file mode 100644
index 0000000..13171f2
--- /dev/null
+++ b/src/llvm-project/clang/test/ClangScanDeps/Inputs/module.modulemap
@@ -0,0 +1,7 @@
+module header1 {
+ header "header.h"
+}
+
+module header2 {
+ header "header2.h"
+}
diff --git a/src/llvm-project/clang/test/ClangScanDeps/Inputs/modules_cdb.json b/src/llvm-project/clang/test/ClangScanDeps/Inputs/modules_cdb.json
new file mode 100644
index 0000000..da5f9bc
--- /dev/null
+++ b/src/llvm-project/clang/test/ClangScanDeps/Inputs/modules_cdb.json
@@ -0,0 +1,13 @@
+[
+{
+ "directory": "DIR",
+ "command": "clang -E -fsyntax-only DIR/modules_cdb_input2.cpp -IInputs -D INCLUDE_HEADER2 -MD -MF DIR/modules_cdb2.d -fmodules -fcxx-modules -fmodules-cache-path=DIR/module-cache -fimplicit-modules -fimplicit-module-maps",
+ "file": "DIR/modules_cdb_input2.cpp"
+},
+{
+ "directory": "DIR",
+ "command": "clang -E DIR/modules_cdb_input.cpp -IInputs -fmodules -fcxx-modules -fmodules-cache-path=DIR/module-cache -fimplicit-modules -fimplicit-module-maps",
+ "file": "DIR/modules_cdb_input.cpp"
+}
+]
+
diff --git a/src/llvm-project/clang/test/ClangScanDeps/Inputs/no-werror.json b/src/llvm-project/clang/test/ClangScanDeps/Inputs/no-werror.json
index c9590f8..2d1f46c 100644
--- a/src/llvm-project/clang/test/ClangScanDeps/Inputs/no-werror.json
+++ b/src/llvm-project/clang/test/ClangScanDeps/Inputs/no-werror.json
@@ -1,7 +1,7 @@
[
{
"directory": "DIR",
- "command": "clang -E DIR/no-werror.cpp -IInputs -std=c++17 -Weverything -Werror",
+ "command": "clang -E DIR/no-werror_input.cpp -IInputs -std=c++17 -Weverything -Werror",
"file": "DIR/no-werror.cpp"
}
]
diff --git a/src/llvm-project/clang/test/ClangScanDeps/Inputs/regular_cdb.json b/src/llvm-project/clang/test/ClangScanDeps/Inputs/regular_cdb.json
index 25e4300..902c0b7 100644
--- a/src/llvm-project/clang/test/ClangScanDeps/Inputs/regular_cdb.json
+++ b/src/llvm-project/clang/test/ClangScanDeps/Inputs/regular_cdb.json
@@ -1,12 +1,17 @@
[
{
"directory": "DIR",
- "command": "clang -E -fsyntax-only DIR/regular_cdb2.cpp -IInputs -D INCLUDE_HEADER2 -MD -MF DIR/regular_cdb2.d",
- "file": "DIR/regular_cdb2.cpp"
+ "command": "clang -E -fsyntax-only DIR/regular_cdb_input2.cpp -IInputs -D INCLUDE_HEADER2 -MD -MF DIR/regular_cdb2.d",
+ "file": "DIR/regular_cdb_input2.cpp"
},
{
"directory": "DIR",
- "command": "clang -E DIR/regular_cdb.cpp -IInputs",
- "file": "DIR/regular_cdb.cpp"
+ "command": "clang -E DIR/regular_cdb_input.cpp -IInputs",
+ "file": "DIR/regular_cdb_input.cpp"
+},
+{
+ "directory": "DIR",
+ "command": "clang -E DIR/regular_cdb_input.cpp -IInputs -o adena.o",
+ "file": "DIR/regular_cdb_input.cpp"
}
]
diff --git a/src/llvm-project/clang/test/ClangScanDeps/Inputs/static-analyzer-cdb.json b/src/llvm-project/clang/test/ClangScanDeps/Inputs/static-analyzer-cdb.json
new file mode 100644
index 0000000..a466d87
--- /dev/null
+++ b/src/llvm-project/clang/test/ClangScanDeps/Inputs/static-analyzer-cdb.json
@@ -0,0 +1,7 @@
+[
+{
+ "directory": "DIR",
+ "command": "clang --analyze DIR/static-analyzer.c",
+ "file": "DIR/static-analyzer.c"
+}
+]
diff --git a/src/llvm-project/clang/test/ClangScanDeps/Inputs/strip_diag_serialize.json b/src/llvm-project/clang/test/ClangScanDeps/Inputs/strip_diag_serialize.json
new file mode 100644
index 0000000..a774d95
--- /dev/null
+++ b/src/llvm-project/clang/test/ClangScanDeps/Inputs/strip_diag_serialize.json
@@ -0,0 +1,7 @@
+[
+{
+ "directory": "DIR",
+ "command": "clang -E -fsyntax-only DIR/strip_diag_serialize_input.cpp --serialize-diagnostics /does/not/exist",
+ "file": "DIR/strip_diag_serialize_input.cpp"
+}
+]
diff --git a/src/llvm-project/clang/test/ClangScanDeps/Inputs/subframework_header_dir_symlink_cdb.json b/src/llvm-project/clang/test/ClangScanDeps/Inputs/subframework_header_dir_symlink_cdb.json
new file mode 100644
index 0000000..82c6b7c
--- /dev/null
+++ b/src/llvm-project/clang/test/ClangScanDeps/Inputs/subframework_header_dir_symlink_cdb.json
@@ -0,0 +1,12 @@
+[
+{
+ "directory": "DIR",
+ "command": "clang -E DIR/subframework_header_dir_symlink_input.m -D EMPTY -iframework Inputs/frameworks",
+ "file": "DIR/subframework_header_dir_symlink_input.m"
+},
+{
+ "directory": "DIR",
+ "command": "clang -E DIR/subframework_header_dir_symlink_input2.m -FInputs/frameworks -iframework Inputs/frameworks_symlink/../frameworks_symlink",
+ "file": "DIR/subframework_header_dir_symlink_input2.m"
+}
+]
diff --git a/src/llvm-project/clang/test/ClangScanDeps/Inputs/symlink_cdb.json b/src/llvm-project/clang/test/ClangScanDeps/Inputs/symlink_cdb.json
new file mode 100644
index 0000000..6c8b720
--- /dev/null
+++ b/src/llvm-project/clang/test/ClangScanDeps/Inputs/symlink_cdb.json
@@ -0,0 +1,12 @@
+[
+{
+ "directory": "DIR",
+ "command": "clang -E DIR/symlink_input.cpp -IInputs",
+ "file": "DIR/symlink_input.cpp"
+},
+{
+ "directory": "DIR",
+ "command": "clang -E DIR/symlink_input2.cpp -IInputs",
+ "file": "DIR/symlink_input2.cpp"
+}
+]
diff --git a/src/llvm-project/clang/test/ClangScanDeps/Inputs/vfsoverlay.yaml b/src/llvm-project/clang/test/ClangScanDeps/Inputs/vfsoverlay.yaml
new file mode 100644
index 0000000..7e6d559
--- /dev/null
+++ b/src/llvm-project/clang/test/ClangScanDeps/Inputs/vfsoverlay.yaml
@@ -0,0 +1,12 @@
+{
+ 'version': 0,
+ 'roots': [
+ { 'name': 'DIR', 'type': 'directory',
+ 'contents': [
+ { 'name': 'not_real.h', 'type': 'file',
+ 'external-contents': 'DIR/Inputs/header.h'
+ }
+ ]
+ }
+ ]
+}
diff --git a/src/llvm-project/clang/test/ClangScanDeps/Inputs/vfsoverlay_cdb.json b/src/llvm-project/clang/test/ClangScanDeps/Inputs/vfsoverlay_cdb.json
new file mode 100644
index 0000000..779203b
--- /dev/null
+++ b/src/llvm-project/clang/test/ClangScanDeps/Inputs/vfsoverlay_cdb.json
@@ -0,0 +1,7 @@
+[
+{
+ "directory": "DIR",
+ "command": "clang -E DIR/vfsoverlay_input.cpp -IInputs -ivfsoverlay DIR/vfsoverlay.yaml",
+ "file": "DIR/vfsoverlay_input.cpp"
+}
+]
diff --git a/src/llvm-project/clang/test/ClangScanDeps/error.cpp b/src/llvm-project/clang/test/ClangScanDeps/error.cpp
index 9eca87b..e4e0525 100644
--- a/src/llvm-project/clang/test/ClangScanDeps/error.cpp
+++ b/src/llvm-project/clang/test/ClangScanDeps/error.cpp
@@ -1,7 +1,7 @@
// RUN: rm -rf %t.dir
// RUN: rm -rf %t.cdb
// RUN: mkdir -p %t.dir
-// RUN: cp %s %t.dir/regular_cdb.cpp
+// RUN: cp %s %t.dir/regular_cdb_input.cpp
// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/regular_cdb.json > %t.cdb
//
// RUN: not clang-scan-deps -compilation-database %t.cdb -j 1 2>%t.dir/errs
@@ -18,4 +18,8 @@
// CHECK-NEXT: fatal error: 'missing.h' file not found
// CHECK-NEXT: "missing.h"
// CHECK-NEXT: ^
+// CHECK-NEXT: Error while scanning dependencies
+// CHECK-NEXT: fatal error: 'missing.h' file not found
+// CHECK-NEXT: "missing.h"
+// CHECK-NEXT: ^
// CHECK-NEXT: EOF
diff --git a/src/llvm-project/clang/test/ClangScanDeps/has_include_if_elif.cpp b/src/llvm-project/clang/test/ClangScanDeps/has_include_if_elif.cpp
new file mode 100644
index 0000000..dd56eca
--- /dev/null
+++ b/src/llvm-project/clang/test/ClangScanDeps/has_include_if_elif.cpp
@@ -0,0 +1,38 @@
+// RUN: rm -rf %t.dir
+// RUN: rm -rf %t.cdb
+// RUN: mkdir -p %t.dir
+// RUN: cp %s %t.dir/has_include_if_elif2.cpp
+// RUN: mkdir %t.dir/Inputs
+// RUN: cp %S/Inputs/header.h %t.dir/Inputs/header.h
+// RUN: cp %S/Inputs/header.h %t.dir/Inputs/header2.h
+// RUN: cp %S/Inputs/header.h %t.dir/Inputs/header3.h
+// RUN: cp %S/Inputs/header.h %t.dir/Inputs/header4.h
+// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/has_include_if_elif.json > %t.cdb
+//
+// RUN: clang-scan-deps -compilation-database %t.cdb -j 1 -mode preprocess-minimized-sources | \
+// RUN: FileCheck %s
+// RUN: clang-scan-deps -compilation-database %t.cdb -j 1 -mode preprocess | \
+// RUN: FileCheck %s
+
+#if __has_include("header.h")
+#endif
+
+#if 0
+#elif __has_include("header2.h")
+#endif
+
+#define H3 __has_include("header3.h")
+#if H3
+#endif
+
+#define H4 __has_include("header4.h")
+
+#if 0
+#elif H4
+#endif
+
+// CHECK: has_include_if_elif2.cpp
+// CHECK-NEXT: Inputs{{/|\\}}header.h
+// CHECK-NEXT: Inputs{{/|\\}}header2.h
+// CHECK-NEXT: Inputs{{/|\\}}header3.h
+// CHECK-NEXT: Inputs{{/|\\}}header4.h
diff --git a/src/llvm-project/clang/test/ClangScanDeps/header_stat_before_open.m b/src/llvm-project/clang/test/ClangScanDeps/header_stat_before_open.m
new file mode 100644
index 0000000..f9f7d24
--- /dev/null
+++ b/src/llvm-project/clang/test/ClangScanDeps/header_stat_before_open.m
@@ -0,0 +1,18 @@
+// RUN: rm -rf %t.dir
+// RUN: rm -rf %t.cdb
+// RUN: mkdir -p %t.dir
+// RUN: cp %s %t.dir/header_stat_before_open_input.m
+// RUN: mkdir %t.dir/Inputs
+// RUN: cp -R %S/Inputs/frameworks %t.dir/Inputs/frameworks
+// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/header_stat_before_open_cdb.json > %t.cdb
+//
+// RUN: clang-scan-deps -compilation-database %t.cdb -j 1 | \
+// RUN: FileCheck %s
+
+#include "Framework/Framework.h"
+#include "Framework/PrivateHeader.h"
+
+// CHECK: header_stat_before_open_input.o
+// CHECK-NEXT: header_stat_before_open_input.m
+// CHECK-NEXT: Inputs{{/|\\}}frameworks{{/|\\}}Framework.framework{{/|\\}}Headers{{/|\\}}Framework.h
+// CHECK-NEXT: Inputs{{/|\\}}frameworks{{/|\\}}Framework.framework{{/|\\}}PrivateHeaders{{/|\\}}PrivateHeader.h
diff --git a/src/llvm-project/clang/test/ClangScanDeps/headerwithdirname.cpp b/src/llvm-project/clang/test/ClangScanDeps/headerwithdirname.cpp
new file mode 100644
index 0000000..b0f6033
--- /dev/null
+++ b/src/llvm-project/clang/test/ClangScanDeps/headerwithdirname.cpp
@@ -0,0 +1,17 @@
+// RUN: rm -rf %t.dir
+// RUN: rm -rf %t.dir/foodir
+// RUN: rm -rf %t.cdb
+// RUN: mkdir -p %t.dir
+// RUN: mkdir -p %t.dir/foodir
+// RUN: cp %s %t.dir/headerwithdirname_input.cpp
+// RUN: mkdir %t.dir/Inputs
+// RUN: cp %S/Inputs/foodir %t.dir/Inputs/foodir
+// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/headerwithdirname.json > %t.cdb
+//
+// RUN: clang-scan-deps -compilation-database %t.cdb -j 1 | FileCheck %s
+
+#include <foodir>
+
+// CHECK: headerwithdirname_input.o
+// CHECK-NEXT: headerwithdirname_input.cpp
+// CHECK-NEXT: Inputs{{/|\\}}foodir
diff --git a/src/llvm-project/clang/test/ClangScanDeps/headerwithdirnamefollowedbyinclude.cpp b/src/llvm-project/clang/test/ClangScanDeps/headerwithdirnamefollowedbyinclude.cpp
new file mode 100644
index 0000000..e8e8a69
--- /dev/null
+++ b/src/llvm-project/clang/test/ClangScanDeps/headerwithdirnamefollowedbyinclude.cpp
@@ -0,0 +1,21 @@
+// RUN: rm -rf %t.dir
+// RUN: rm -rf %t.dir/foodir
+// RUN: rm -rf %t.cdb
+
+// RUN: mkdir -p %t.dir
+// RUN: mkdir -p %t.dir/foodir
+
+// RUN: cp %S/Inputs/header.h %t.dir/foodir/foodirheader.h
+// RUN: cp %s %t.dir/headerwithdirname_input.cpp
+// RUN: mkdir %t.dir/Inputs
+// RUN: cp %S/Inputs/foodir %t.dir/Inputs/foodir
+// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/headerwithdirnamefollowedbyinclude.json > %t.cdb
+//
+// RUN: clang-scan-deps -compilation-database %t.cdb -j 1 | FileCheck %s
+
+#include <foodir>
+#include "foodir/foodirheader.h"
+
+// CHECK: headerwithdirname_input.o
+// CHECK-NEXT: headerwithdirname_input.cpp
+// CHECK-NEXT: Inputs{{/|\\}}foodir
diff --git a/src/llvm-project/clang/test/ClangScanDeps/modules-full.cpp b/src/llvm-project/clang/test/ClangScanDeps/modules-full.cpp
new file mode 100644
index 0000000..693dffe
--- /dev/null
+++ b/src/llvm-project/clang/test/ClangScanDeps/modules-full.cpp
@@ -0,0 +1,77 @@
+// RUN: rm -rf %t.dir
+// RUN: rm -rf %t.cdb
+// RUN: rm -rf %t.module-cache
+// RUN: mkdir -p %t.dir
+// RUN: cp %s %t.dir/modules_cdb_input.cpp
+// RUN: cp %s %t.dir/modules_cdb_input2.cpp
+// RUN: mkdir %t.dir/Inputs
+// RUN: cp %S/Inputs/header.h %t.dir/Inputs/header.h
+// RUN: cp %S/Inputs/header2.h %t.dir/Inputs/header2.h
+// RUN: cp %S/Inputs/module.modulemap %t.dir/Inputs/module.modulemap
+// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/modules_cdb.json > %t.cdb
+//
+// RUN: echo %t.dir > %t.result
+// RUN: clang-scan-deps -compilation-database %t.cdb -j 1 \
+// RUN: -mode preprocess-minimized-sources -format experimental-full >> %t.result
+// RUN: cat %t.result | FileCheck --check-prefixes=CHECK %s
+
+// FIXME: Backslash issues.
+// XFAIL: system-windows
+
+#include "header.h"
+
+// CHECK: [[PREFIX:(.*[/\\])+[a-zA-Z0-9.-]+]]
+// CHECK-NEXT: {
+// CHECK-NEXT: "clang-context-hash": "[[CONTEXT_HASH:[A-Z0-9]+]]",
+// CHECK-NEXT: "clang-module-deps": [
+// CHECK-NEXT: "header1"
+// CHECK-NEXT: ],
+// CHECK-NEXT: "clang-modules": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "clang-module-deps": [
+// CHECK-NEXT: "header2"
+// CHECK-NEXT: ],
+// CHECK-NEXT: "clang-modulemap-file": "[[PREFIX]]{{[/\\]}}Inputs{{[/\\]}}module.modulemap",
+// CHECK-NEXT: "file-deps": [
+// CHECK-NEXT: "[[PREFIX]]{{[/\\]}}Inputs{{[/\\]}}header.h",
+// CHECK-NEXT: "[[PREFIX]]{{[/\\]}}Inputs{{[/\\]}}module.modulemap"
+// CHECK-NEXT: ],
+// CHECK-NEXT: "name": "header1"
+// CHECK-NEXT: },
+// CHECK-NEXT: {
+// CHECK-NEXT: "clang-module-deps": [],
+// CHECK-NEXT: "clang-modulemap-file": "[[PREFIX]]{{[/\\]}}Inputs{{[/\\]}}module.modulemap",
+// CHECK-NEXT: "file-deps": [
+// CHECK-NEXT: "[[PREFIX]]{{[/\\]}}Inputs{{[/\\]}}header2.h",
+// CHECK-NEXT: "[[PREFIX]]{{[/\\]}}Inputs{{[/\\]}}module.modulemap"
+// CHECK-NEXT: ],
+// CHECK-NEXT: "name": "header2"
+// CHECK-NEXT: }
+// CHECK-NEXT: ],
+// CHECK-NEXT: "file-deps": [
+// CHECK-NEXT: "[[PREFIX]]{{[/\\]}}modules_cdb_input2.cpp"
+// CHECK-NEXT: ],
+// CHECK-NEXT: "input-file": "[[PREFIX]]{{[/\\]}}modules_cdb_input2.cpp"
+// CHECK-NEXT:},
+// CHECK-NEXT:{
+// CHECK-NOT: "clang-context-hash": "[[CONTEXT_HASH]]",
+// CHECK-NEXT: "clang-context-hash": "{{[A-Z0-9]+}}",
+// CHECK-NEXT: "clang-module-deps": [
+// CHECK-NEXT: "header1"
+// CHECK-NEXT: ],
+// CHECK-NEXT: "clang-modules": [
+// CHECK-NEXT: {
+// CHECK-NEXT: "clang-module-deps": [],
+// CHECK-NEXT: "clang-modulemap-file": "[[PREFIX]]{{[/\\]}}Inputs{{[/\\]}}module.modulemap",
+// CHECK-NEXT: "file-deps": [
+// CHECK-NEXT: "[[PREFIX]]{{[/\\]}}Inputs{{[/\\]}}header.h",
+// CHECK-NEXT: "[[PREFIX]]{{[/\\]}}Inputs{{[/\\]}}module.modulemap"
+// CHECK-NEXT: ],
+// CHECK-NEXT: "name": "header1"
+// CHECK-NEXT: }
+// CHECK-NEXT: ],
+// CHECK-NEXT: "file-deps": [
+// CHECK-NEXT: "[[PREFIX]]{{[/\\]}}modules_cdb_input.cpp"
+// CHECK-NEXT: ],
+// CHECK-NEXT: "input-file": "[[PREFIX]]{{[/\\]}}modules_cdb_input.cpp"
+// CHECK-NEXT:},
diff --git a/src/llvm-project/clang/test/ClangScanDeps/modules.cpp b/src/llvm-project/clang/test/ClangScanDeps/modules.cpp
new file mode 100644
index 0000000..599fcd1
--- /dev/null
+++ b/src/llvm-project/clang/test/ClangScanDeps/modules.cpp
@@ -0,0 +1,41 @@
+// RUN: rm -rf %t.dir
+// RUN: rm -rf %t.cdb
+// RUN: rm -rf %t.module-cache
+// RUN: mkdir -p %t.dir
+// RUN: cp %s %t.dir/modules_cdb_input.cpp
+// RUN: cp %s %t.dir/modules_cdb_input2.cpp
+// RUN: mkdir %t.dir/Inputs
+// RUN: cp %S/Inputs/header.h %t.dir/Inputs/header.h
+// RUN: cp %S/Inputs/header2.h %t.dir/Inputs/header2.h
+// RUN: cp %S/Inputs/module.modulemap %t.dir/Inputs/module.modulemap
+// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/modules_cdb.json > %t.cdb
+//
+// RUN: clang-scan-deps -compilation-database %t.cdb -j 1 -mode preprocess-minimized-sources | \
+// RUN: FileCheck --check-prefixes=CHECK1,CHECK2,CHECK2NO %s
+//
+// The output order is non-deterministic when using more than one thread,
+// so check the output using two runs. Note that the 'NOT' check is not used
+// as it might fail if the results for `modules_cdb_input.cpp` are reported before
+// `modules_cdb_input2.cpp`.
+//
+// RUN: clang-scan-deps -compilation-database %t.cdb -j 2 -mode preprocess-minimized-sources | \
+// RUN: FileCheck --check-prefix=CHECK1 %s
+// RUN: clang-scan-deps -compilation-database %t.cdb -j 2 -mode preprocess | \
+// RUN: FileCheck --check-prefix=CHECK1 %s
+// RUN: clang-scan-deps -compilation-database %t.cdb -j 2 -mode preprocess-minimized-sources | \
+// RUN: FileCheck --check-prefix=CHECK2 %s
+// RUN: clang-scan-deps -compilation-database %t.cdb -j 2 -mode preprocess | \
+// RUN: FileCheck --check-prefix=CHECK2 %s
+
+#include "header.h"
+
+// CHECK1: modules_cdb_input2.cpp
+// CHECK1-NEXT: modules_cdb_input2.cpp
+// CHECK1-NEXT: Inputs{{/|\\}}module.modulemap
+// CHECK1-NEXT: Inputs{{/|\\}}header2.h
+// CHECK1: Inputs{{/|\\}}header.h
+
+// CHECK2: modules_cdb_input.cpp
+// CHECK2-NEXT: Inputs{{/|\\}}module.modulemap
+// CHECK2-NEXT: Inputs{{/|\\}}header.h
+// CHECK2NO-NOT: header2
diff --git a/src/llvm-project/clang/test/ClangScanDeps/no-werror.cpp b/src/llvm-project/clang/test/ClangScanDeps/no-werror.cpp
index 4a5eff2..95407c5 100644
--- a/src/llvm-project/clang/test/ClangScanDeps/no-werror.cpp
+++ b/src/llvm-project/clang/test/ClangScanDeps/no-werror.cpp
@@ -1,7 +1,7 @@
// RUN: rm -rf %t.dir
// RUN: rm -rf %t.cdb
// RUN: mkdir -p %t.dir
-// RUN: cp %s %t.dir/no-werror.cpp
+// RUN: cp %s %t.dir/no-werror_input.cpp
// RUN: mkdir %t.dir/Inputs
// RUN: cp %S/Inputs/sys-header.h %t.dir/Inputs/sys-header.h
// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/no-werror.json > %t.cdb
@@ -12,5 +12,5 @@
#include "sys-header.h"
-// CHECK: no-werror.cpp
+// CHECK: no-werror_input.cpp
// CHECK-NEXT: Inputs{{/|\\}}sys-header.h
diff --git a/src/llvm-project/clang/test/ClangScanDeps/regular_cdb.cpp b/src/llvm-project/clang/test/ClangScanDeps/regular_cdb.cpp
index f32cde1..8fb9435 100644
--- a/src/llvm-project/clang/test/ClangScanDeps/regular_cdb.cpp
+++ b/src/llvm-project/clang/test/ClangScanDeps/regular_cdb.cpp
@@ -1,15 +1,19 @@
// RUN: rm -rf %t.dir
// RUN: rm -rf %t.cdb
// RUN: mkdir -p %t.dir
-// RUN: cp %s %t.dir/regular_cdb.cpp
-// RUN: cp %s %t.dir/regular_cdb2.cpp
+// RUN: cp %s %t.dir/regular_cdb_input.cpp
+// RUN: cp %s %t.dir/regular_cdb_input2.cpp
// RUN: mkdir %t.dir/Inputs
// RUN: cp %S/Inputs/header.h %t.dir/Inputs/header.h
// RUN: cp %S/Inputs/header2.h %t.dir/Inputs/header2.h
// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/regular_cdb.json > %t.cdb
//
-// RUN: clang-scan-deps -compilation-database %t.cdb -j 1 | \
-// RUN: FileCheck --check-prefixes=CHECK1,CHECK2,CHECK2NO %s
+// RUN: clang-scan-deps -compilation-database %t.cdb -j 1 -mode preprocess-minimized-sources | \
+// RUN: FileCheck --check-prefixes=CHECK1,CHECK2,CHECK2NO,CHECK3 %s
+// RUN: clang-scan-deps -compilation-database %t.cdb -j 1 -mode preprocess | \
+// RUN: FileCheck --check-prefixes=CHECK1,CHECK2,CHECK2NO,CHECK3 %s
+// RUN: clang-scan-deps -compilation-database %t.cdb -j 1 -mode preprocess-minimized-sources \
+// RUN: -skip-excluded-pp-ranges=0 | FileCheck --check-prefixes=CHECK1,CHECK2,CHECK2NO,CHECK3 %s
//
// Make sure we didn't produce any dependency files!
// RUN: not cat %t.dir/regular_cdb.d
@@ -17,20 +21,28 @@
//
// The output order is non-deterministic when using more than one thread,
// so check the output using two runs. Note that the 'NOT' check is not used
-// as it might fail if the results for `regular_cdb.cpp` are reported before
-// `regular_cdb2.cpp`.
+// as it might fail if the results for `regular_cdb_input.cpp` are reported before
+// `regular_cdb_input2.cpp`.
//
-// RUN: clang-scan-deps -compilation-database %t.cdb -j 2 | \
+// RUN: clang-scan-deps -compilation-database %t.cdb -j 2 -mode preprocess-minimized-sources | \
// RUN: FileCheck --check-prefix=CHECK1 %s
-// RUN: clang-scan-deps -compilation-database %t.cdb -j 2 | \
+// RUN: clang-scan-deps -compilation-database %t.cdb -j 2 -mode preprocess | \
+// RUN: FileCheck --check-prefix=CHECK1 %s
+// RUN: clang-scan-deps -compilation-database %t.cdb -j 2 -mode preprocess-minimized-sources | \
+// RUN: FileCheck --check-prefix=CHECK2 %s
+// RUN: clang-scan-deps -compilation-database %t.cdb -j 2 -mode preprocess | \
// RUN: FileCheck --check-prefix=CHECK2 %s
#include "header.h"
-// CHECK1: regular_cdb2.cpp
+// CHECK1: regular_cdb_input2.cpp
+// CHECK1-NEXT: regular_cdb_input2.cpp
// CHECK1-NEXT: Inputs{{/|\\}}header.h
// CHECK1-NEXT: Inputs{{/|\\}}header2.h
-// CHECK2: regular_cdb.cpp
+// CHECK3: regular_cdb_input.o
+// CHECK2: regular_cdb_input.cpp
// CHECK2-NEXT: Inputs{{/|\\}}header.h
// CHECK2NO-NOT: header2
+
+// CHECK3: adena.o
diff --git a/src/llvm-project/clang/test/ClangScanDeps/static-analyzer.c b/src/llvm-project/clang/test/ClangScanDeps/static-analyzer.c
new file mode 100644
index 0000000..c4af9b0
--- /dev/null
+++ b/src/llvm-project/clang/test/ClangScanDeps/static-analyzer.c
@@ -0,0 +1,16 @@
+// RUN: rm -rf %t.dir
+// RUN: rm -rf %t-cdb.json
+// RUN: mkdir -p %t.dir
+// RUN: cp %s %t.dir/static-analyzer.c
+// RUN: mkdir %t.dir/Inputs
+// RUN: cp %S/Inputs/header.h %t.dir/Inputs/analyze_header_input.h
+// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/static-analyzer-cdb.json > %t-cdb.json
+//
+// RUN: clang-scan-deps -compilation-database %t-cdb.json -j 1 | FileCheck %s
+
+#ifdef __clang_analyzer__
+#include "Inputs/analyze_header_input.h"
+#endif
+
+// CHECK: analyze_header_input.h
+
diff --git a/src/llvm-project/clang/test/ClangScanDeps/strip_diag_serialize.cpp b/src/llvm-project/clang/test/ClangScanDeps/strip_diag_serialize.cpp
new file mode 100644
index 0000000..ec62e75
--- /dev/null
+++ b/src/llvm-project/clang/test/ClangScanDeps/strip_diag_serialize.cpp
@@ -0,0 +1,11 @@
+// RUN: rm -rf %t.dir
+// RUN: rm -rf %t.cdb
+// RUN: mkdir -p %t.dir
+// RUN: cp %s %t.dir/strip_diag_serialize_input.cpp
+// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/strip_diag_serialize.json > %t.cdb
+//
+// RUN: clang-scan-deps -compilation-database %t.cdb 2>&1 | FileCheck %s
+// CHECK-NOT: unable to open file
+// CHECK: strip_diag_serialize_input.cpp
+
+#warning "diagnostic"
diff --git a/src/llvm-project/clang/test/ClangScanDeps/subframework_header_dir_symlink.m b/src/llvm-project/clang/test/ClangScanDeps/subframework_header_dir_symlink.m
new file mode 100644
index 0000000..46f8f5b
--- /dev/null
+++ b/src/llvm-project/clang/test/ClangScanDeps/subframework_header_dir_symlink.m
@@ -0,0 +1,24 @@
+// REQUIRES: shell
+// RUN: rm -rf %t.dir
+// RUN: rm -rf %t.cdb
+// RUN: mkdir -p %t.dir
+// RUN: cp %s %t.dir/subframework_header_dir_symlink_input.m
+// RUN: cp %s %t.dir/subframework_header_dir_symlink_input2.m
+// RUN: mkdir %t.dir/Inputs
+// RUN: cp -R %S/Inputs/frameworks %t.dir/Inputs/frameworks
+// RUN: ln -s %t.dir/Inputs/frameworks %t.dir/Inputs/frameworks_symlink
+// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/subframework_header_dir_symlink_cdb.json > %t.cdb
+// RUN: clang-scan-deps -compilation-database %t.cdb -j 1 -reuse-filemanager=0 | \
+// RUN: FileCheck %s
+// RUN: clang-scan-deps -compilation-database %t.cdb -j 1 -reuse-filemanager=1 | \
+// RUN: FileCheck %s
+
+#ifndef EMPTY
+#include "Framework/Framework.h"
+#endif
+
+// CHECK: subframework_header_dir_symlink_input.o
+// CHECK-NEXT: subframework_header_dir_symlink_input.m
+// CHECK: subframework_header_dir_symlink_input2.o
+// CHECK-NEXT: subframework_header_dir_symlink_input2.m
+// CHECK-NEXT: Inputs{{/|\\}}frameworks_symlink{{/|\\}}Framework.framework{{/|\\}}Headers{{/|\\}}Framework.h
diff --git a/src/llvm-project/clang/test/ClangScanDeps/symlink.cpp b/src/llvm-project/clang/test/ClangScanDeps/symlink.cpp
new file mode 100644
index 0000000..a4394c0
--- /dev/null
+++ b/src/llvm-project/clang/test/ClangScanDeps/symlink.cpp
@@ -0,0 +1,23 @@
+// REQUIRES: shell
+// RUN: rm -rf %t.dir
+// RUN: rm -rf %t.cdb
+// RUN: mkdir -p %t.dir
+// RUN: cp %s %t.dir/symlink_input.cpp
+// RUN: cp %s %t.dir/symlink_input2.cpp
+// RUN: mkdir %t.dir/Inputs
+// RUN: cp %S/Inputs/header.h %t.dir/Inputs/header.h
+// RUN: ln -s %t.dir/Inputs/header.h %t.dir/Inputs/symlink.h
+// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/symlink_cdb.json > %t.cdb
+// RUN: clang-scan-deps -compilation-database %t.cdb -j 1 -reuse-filemanager=0 | FileCheck %s
+// RUN: clang-scan-deps -compilation-database %t.cdb -j 1 -reuse-filemanager=1 | FileCheck %s
+
+#include "symlink.h"
+#include "header.h"
+
+// CHECK: symlink_input.cpp
+// CHECK-NEXT: Inputs{{/|\\}}symlink.h
+// CHECK-NEXT: Inputs{{/|\\}}header.h
+
+// CHECK: symlink_input2.cpp
+// CHECK-NEXT: Inputs{{/|\\}}symlink.h
+// CHECK-NEXT: Inputs{{/|\\}}header.h
diff --git a/src/llvm-project/clang/test/ClangScanDeps/vfsoverlay.cpp b/src/llvm-project/clang/test/ClangScanDeps/vfsoverlay.cpp
new file mode 100644
index 0000000..5177389
--- /dev/null
+++ b/src/llvm-project/clang/test/ClangScanDeps/vfsoverlay.cpp
@@ -0,0 +1,17 @@
+// RUN: rm -rf %t.dir
+// RUN: rm -rf %t.cdb
+// RUN: mkdir -p %t.dir
+// RUN: cp %s %t.dir/vfsoverlay_input.cpp
+// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/vfsoverlay.yaml > %t.dir/vfsoverlay.yaml
+// RUN: mkdir %t.dir/Inputs
+// RUN: cp %S/Inputs/header.h %t.dir/Inputs/header.h
+// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/vfsoverlay_cdb.json > %t.cdb
+//
+// RUN: clang-scan-deps -compilation-database %t.cdb -j 1 | \
+// RUN: FileCheck %s
+
+#include "not_real.h"
+
+// CHECK: vfsoverlay_input.o
+// CHECK-NEXT: vfsoverlay_input.cpp
+// CHECK-NEXT: Inputs{{/|\\}}header.h
diff --git a/src/llvm-project/clang/test/CodeCompletion/function-templates.cpp b/src/llvm-project/clang/test/CodeCompletion/function-templates.cpp
index cdbbf75..e7123a3 100644
--- a/src/llvm-project/clang/test/CodeCompletion/function-templates.cpp
+++ b/src/llvm-project/clang/test/CodeCompletion/function-templates.cpp
@@ -1,7 +1,7 @@
namespace std {
template<typename RandomAccessIterator>
void sort(RandomAccessIterator first, RandomAccessIterator last);
-
+
template<class X, class Y>
X* dyn_cast(Y *Val);
}
@@ -11,13 +11,17 @@
template<typename T> T &getAs();
};
+template <typename T, typename U, typename V>
+V doSomething(T t, const U &u, V *v) { return V(); }
+
void f() {
std::sort(1, 2);
Foo().getAs<int>();
- // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:15:8 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s
+ // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:18:8 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s
// CHECK-CC1: dyn_cast<<#class X#>>(<#Y *Val#>)
// CHECK-CC1: sort(<#RandomAccessIterator first#>, <#RandomAccessIterator last#>
- // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:16:9 %s -o - | FileCheck -check-prefix=CHECK-CC2 %s
+ // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:19:9 %s -o - | FileCheck -check-prefix=CHECK-CC2 %s
// CHECK-CC2: getAs<<#typename T#>>()
-)
-
+ // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:19:22 %s -o - | FileCheck -check-prefix=CHECK-CC3 %s
+ // CHECK-CC3: [#V#]doSomething(<#T t#>, <#const U &u#>, <#V *v#>)
+}
diff --git a/src/llvm-project/clang/test/CodeCompletion/lambdas.cpp b/src/llvm-project/clang/test/CodeCompletion/lambdas.cpp
index 05c47b8..3e431a3 100644
--- a/src/llvm-project/clang/test/CodeCompletion/lambdas.cpp
+++ b/src/llvm-project/clang/test/CodeCompletion/lambdas.cpp
@@ -60,3 +60,15 @@
// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:57:24 %s -o - | FileCheck -check-prefix=CHECK-8 %s
// CHECK-8-NOT: COMPLETION: Pattern : [<#=
}
+
+void test6() {
+ auto my_lambda = [&](int a, double &b) { return 1.f; };
+ // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:65:58 %s -o - | FileCheck -check-prefix=CHECK-9 %s
+ // CHECK-9: [#float#]my_lambda(<#int a#>, <#double &b#>)[# const#]
+}
+
+void test7() {
+ auto generic_lambda = [&](auto a, const auto &b) { return a + b; };
+ // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:71:70 %s -o - | FileCheck -check-prefix=CHECK-10 %s
+ // CHECK-10: [#auto#]generic_lambda(<#auto a#>, <#const auto &b#>)[# const#]
+}
diff --git a/src/llvm-project/clang/test/CodeCompletion/member-access-qualifiers.cpp b/src/llvm-project/clang/test/CodeCompletion/member-access-qualifiers.cpp
new file mode 100644
index 0000000..93af02c
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeCompletion/member-access-qualifiers.cpp
@@ -0,0 +1,13 @@
+struct deque_base {
+ int &size();
+ const int &size() const;
+};
+
+struct deque : private deque_base {
+ int size() const;
+};
+
+auto x = deque().
+// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:10:18 %s -o - | FileCheck %s
+// CHECK: COMPLETION: size : [#int#]size()[# const#]
+// CHECK: COMPLETION: size (Hidden,InBase,Inaccessible) : [#int &#]deque_base::size()
diff --git a/src/llvm-project/clang/test/CodeCompletion/patterns.cpp b/src/llvm-project/clang/test/CodeCompletion/patterns.cpp
index 596fe82..5189e3e 100644
--- a/src/llvm-project/clang/test/CodeCompletion/patterns.cpp
+++ b/src/llvm-project/clang/test/CodeCompletion/patterns.cpp
@@ -33,20 +33,44 @@
bool bool_return() {
// line 34
}
+int *ptr_return() {
+ // line 37
+}
+struct Cls {};
+int Cls::*memptr_return() {
+ // line 41
+}
// RUN: %clang_cc1 -fsyntax-only -code-completion-patterns -code-completion-at=%s:28:1 %s -o - | FileCheck -check-prefix=RETURN-VAL %s
// RETURN-VAL-NOT: COMPLETION: Pattern : return;
// RETURN-VAL-NOT: COMPLETION: Pattern : return false;
// RETURN-VAL-NOT: COMPLETION: Pattern : return true;
+// RETURN-VAL-NOT: COMPLETION: Pattern : return nullptr;
// RETURN-VAL: COMPLETION: Pattern : return <#expression#>;{{$}}
// RUN: %clang_cc1 -fsyntax-only -code-completion-patterns -code-completion-at=%s:31:1 %s -o - | FileCheck -check-prefix=RETURN-VOID %s
// RETURN-VOID-NOT: COMPLETION: Pattern : return false;
// RETURN-VOID-NOT: COMPLETION: Pattern : return true;
// RETURN-VOID-NOT: COMPLETION: Pattern : return <#expression#>;
+// RETURN-VOID-NOT: COMPLETION: Pattern : return nullptr;
// RETURN-VOID: COMPLETION: Pattern : return;{{$}}
// RUN: %clang_cc1 -fsyntax-only -code-completion-patterns -code-completion-at=%s:34:1 %s -o - | FileCheck -check-prefix=RETURN-BOOL %s
// RETURN-BOOL-NOT: COMPLETION: Pattern : return;
+// RETURN-BOOL-NOT: COMPLETION: Pattern : return nullptr;
// RETURN-BOOL: COMPLETION: Pattern : return <#expression#>;{{$}}
// RETURN-BOOL: COMPLETION: Pattern : return false;{{$}}
// RETURN-BOOL: COMPLETION: Pattern : return true;{{$}}
+
+// Check both pointer and member pointer return types.
+// RUN: %clang_cc1 -fsyntax-only -std=c++11 -code-completion-patterns -code-completion-at=%s:37:1 %s -o - | FileCheck -check-prefix=RETURN-PTR %s
+// RUN: %clang_cc1 -fsyntax-only -std=c++11 -code-completion-patterns -code-completion-at=%s:41:1 %s -o - | FileCheck -check-prefix=RETURN-PTR %s
+// RETURN-PTR-NOT: COMPLETION: Pattern : return false;{{$}}
+// RETURN-PTR-NOT: COMPLETION: Pattern : return true;{{$}}
+// RETURN-PTR-NOT: COMPLETION: Pattern : return;
+// RETURN-PTR: COMPLETION: Pattern : return <#expression#>;{{$}}
+// RETURN-PTR: COMPLETION: Pattern : return nullptr;
+
+// 'return nullptr' is not available before C++11.
+// RUN: %clang_cc1 -fsyntax-only -std=c++03 -code-completion-patterns -code-completion-at=%s:37:1 %s -o - | FileCheck -check-prefix=RETURN-PTR-STD03 %s
+// RUN: %clang_cc1 -fsyntax-only -std=c++03 -code-completion-patterns -code-completion-at=%s:41:1 %s -o - | FileCheck -check-prefix=RETURN-PTR-STD03 %s
+// RETURN-PTR-STD03-NOT: COMPLETION: Pattern : return nullptr;
diff --git a/src/llvm-project/clang/test/CodeCompletion/templates.cpp b/src/llvm-project/clang/test/CodeCompletion/templates.cpp
index 32a7b21..f9811f4 100644
--- a/src/llvm-project/clang/test/CodeCompletion/templates.cpp
+++ b/src/llvm-project/clang/test/CodeCompletion/templates.cpp
@@ -24,5 +24,12 @@
// CHECK-CC2: foo
// CHECK-CC2: in_base
// CHECK-CC2: stop
-
+}
+
+template <typename> struct X;
+template <typename T> struct X<T*> { X(double); };
+X<int*> x(42);
+// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:32:11 %s -o - | FileCheck -check-prefix=CHECK-CONSTRUCTOR %s
+// CHECK-CONSTRUCTOR: OVERLOAD: X(<#double#>)
+// (rather than X<type-parameter-0-0 *>(<#double#>)
diff --git a/src/llvm-project/clang/test/CodeGen/2008-07-30-implicit-initialization.c b/src/llvm-project/clang/test/CodeGen/2008-07-30-implicit-initialization.c
index e77c70a..f2621f4 100644
--- a/src/llvm-project/clang/test/CodeGen/2008-07-30-implicit-initialization.c
+++ b/src/llvm-project/clang/test/CodeGen/2008-07-30-implicit-initialization.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple i386-unknown-unknown -O1 -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple i386-unknown-unknown -O2 -emit-llvm -o - %s | FileCheck %s
// CHECK-LABEL: define i32 @f0()
// CHECK: ret i32 0
// CHECK-LABEL: define i32 @f1()
diff --git a/src/llvm-project/clang/test/CodeGen/64bit-swiftcall.c b/src/llvm-project/clang/test/CodeGen/64bit-swiftcall.c
index 6175553..51fb854 100644
--- a/src/llvm-project/clang/test/CodeGen/64bit-swiftcall.c
+++ b/src/llvm-project/clang/test/CodeGen/64bit-swiftcall.c
@@ -34,7 +34,7 @@
// CHECK-LABEL: define {{.*}} void @context_2(i8*{{.*}}, i8* swiftself
SWIFTCALL void context_error_1(CONTEXT int *self, ERROR float **error) {}
-// CHECK-LABEL: define {{.*}} void @context_error_1(i32* swiftself{{.*}}, float** swifterror)
+// CHECK-LABEL: define {{.*}} void @context_error_1(i32* swiftself{{.*}}, float** swifterror %0)
// CHECK: [[TEMP:%.*]] = alloca float*, align 8
// CHECK: [[T0:%.*]] = load float*, float** [[ERRORARG:%.*]], align 8
// CHECK: store float* [[T0]], float** [[TEMP]], align 8
@@ -56,7 +56,7 @@
// CHECK: store float* [[T0]], float** [[ERROR]], align 8
SWIFTCALL void context_error_2(short s, CONTEXT int *self, ERROR float **error) {}
-// CHECK-LABEL: define {{.*}} void @context_error_2(i16{{.*}}, i32* swiftself{{.*}}, float** swifterror)
+// CHECK-LABEL: define {{.*}} void @context_error_2(i16{{.*}}, i32* swiftself{{.*}}, float** swifterror %0)
/*****************************************************************************/
/********************************** LOWERING *********************************/
@@ -118,7 +118,7 @@
// CHECK: [[R1:%.*]] = insertvalue { i64, i64 } [[R0]], i64 [[T1]], 1
// CHECK: ret { i64, i64 } [[R1]]
// CHECK: }
-// CHECK-LABEL: define swiftcc void @take_struct_1(i64, i64) {{.*}}{
+// CHECK-LABEL: define swiftcc void @take_struct_1(i64 %0, i64 %1) {{.*}}{
// CHECK: [[V:%.*]] = alloca [[STRUCT1:%.*]], align 4
// CHECK: [[CAST:%.*]] = bitcast [[STRUCT1]]* [[V]] to { i64, i64 }*
// CHECK: [[GEP0:%.*]] = getelementptr inbounds { i64, i64 }, { i64, i64 }* [[CAST]], i32 0, i32 0
@@ -167,7 +167,7 @@
// CHECK: [[R1:%.*]] = insertvalue { i64, i64 } [[R0]], i64 [[T1]], 1
// CHECK: ret { i64, i64 } [[R1]]
// CHECK: }
-// CHECK-LABEL: define swiftcc void @take_struct_2(i64, i64) {{.*}}{
+// CHECK-LABEL: define swiftcc void @take_struct_2(i64 %0, i64 %1) {{.*}}{
// CHECK: [[V:%.*]] = alloca [[STRUCT:%.*]], align 4
// CHECK: [[CAST:%.*]] = bitcast [[STRUCT]]* [[V]] to { i64, i64 }*
// CHECK: [[GEP0:%.*]] = getelementptr inbounds { i64, i64 }, { i64, i64 }* [[CAST]], i32 0, i32 0
@@ -215,7 +215,7 @@
// CHECK: [[R0:%.*]] = load i64, i64* [[GEP]], align 1
// CHECK: ret i64 [[R0]]
// CHECK:}
-// CHECK-LABEL: define swiftcc void @take_struct_misaligned_1(i64) {{.*}}{
+// CHECK-LABEL: define swiftcc void @take_struct_misaligned_1(i64 %0) {{.*}}{
// CHECK: [[V:%.*]] = alloca [[STRUCT:%.*]], align 1
// CHECK: [[CAST:%.*]] = bitcast [[STRUCT]]* [[V]] to { i64 }*
// CHECK: [[GEP:%.*]] = getelementptr inbounds { i64 }, { i64 }* [[CAST]], i32 0, i32 0
@@ -263,7 +263,7 @@
// CHECK: [[GEP:%.*]] = getelementptr inbounds { i64 }, { i64 }* [[CAST]], i32 0, i32 0
// CHECK: [[R0:%.*]] = load i64, i64* [[GEP]], align 8
// CHECK: ret i64 [[R0]]
-// CHECK-LABEL: define swiftcc void @take_union_het_fp(i64) {{.*}}{
+// CHECK-LABEL: define swiftcc void @take_union_het_fp(i64 %0) {{.*}}{
// CHECK: [[V:%.*]] = alloca [[UNION:%.*]], align 8
// CHECK: [[CAST:%.*]] = bitcast [[UNION]]* [[V]] to { i64 }*
// CHECK: [[GEP:%.*]] = getelementptr inbounds { i64 }, { i64 }* [[CAST]], i32 0, i32 0
@@ -387,7 +387,7 @@
// CHECK: [[T0:%.*]] = insertvalue [[UAGG:{ <4 x i32>, <4 x i32> }]] undef, <4 x i32> [[FIRST]], 0
// CHECK: [[T1:%.*]] = insertvalue [[UAGG]] [[T0]], <4 x i32> [[SECOND]], 1
// CHECK: ret [[UAGG]] [[T1]]
-// CHECK-LABEL: define {{.*}} @take_int8(<4 x i32>, <4 x i32>)
+// CHECK-LABEL: define {{.*}} @take_int8(<4 x i32> %0, <4 x i32> %1)
// CHECK: [[V:%.*]] = alloca [[REC]], align
// CHECK: [[CAST_TMP:%.*]] = bitcast [[REC]]* [[V]] to [[AGG]]*
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 0
@@ -431,7 +431,7 @@
// CHECK: [[T0:%.*]] = insertvalue [[UAGG:{ <4 x i32>, i32 }]] undef, <4 x i32> [[FIRST]], 0
// CHECK: [[T1:%.*]] = insertvalue [[UAGG]] [[T0]], i32 [[SECOND]], 1
// CHECK: ret [[UAGG]] [[T1]]
-// CHECK-LABEL: define {{.*}} @take_int5(<4 x i32>, i32)
+// CHECK-LABEL: define {{.*}} @take_int5(<4 x i32> %0, i32 %1)
// CHECK: [[V:%.*]] = alloca [[REC]], align
// CHECK: [[CAST_TMP:%.*]] = bitcast [[REC]]* [[V]] to [[AGG]]*
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 0
@@ -465,14 +465,14 @@
int3 v __attribute__((packed));
} misaligned_int3;
TEST(misaligned_int3)
-// CHECK-LABEL: define swiftcc void @take_misaligned_int3(i64, i64)
+// CHECK-LABEL: define swiftcc void @take_misaligned_int3(i64 %0, i64 %1)
typedef struct {
float f0;
} struct_f1;
TEST(struct_f1)
// CHECK-LABEL: define swiftcc float @return_struct_f1()
-// CHECK-LABEL: define swiftcc void @take_struct_f1(float)
+// CHECK-LABEL: define swiftcc void @take_struct_f1(float %0)
typedef struct {
float f0;
@@ -480,7 +480,7 @@
} struct_f2;
TEST(struct_f2)
// CHECK-LABEL: define swiftcc { float, float } @return_struct_f2()
-// CHECK-LABEL: define swiftcc void @take_struct_f2(float, float)
+// CHECK-LABEL: define swiftcc void @take_struct_f2(float %0, float %1)
typedef struct {
float f0;
@@ -489,7 +489,7 @@
} struct_f3;
TEST(struct_f3)
// CHECK-LABEL: define swiftcc { float, float, float } @return_struct_f3()
-// CHECK-LABEL: define swiftcc void @take_struct_f3(float, float, float)
+// CHECK-LABEL: define swiftcc void @take_struct_f3(float %0, float %1, float %2)
typedef struct {
float f0;
@@ -499,7 +499,7 @@
} struct_f4;
TEST(struct_f4)
// CHECK-LABEL: define swiftcc { float, float, float, float } @return_struct_f4()
-// CHECK-LABEL: define swiftcc void @take_struct_f4(float, float, float, float)
+// CHECK-LABEL: define swiftcc void @take_struct_f4(float %0, float %1, float %2, float %3)
typedef struct {
@@ -507,7 +507,7 @@
} struct_d1;
TEST(struct_d1)
// CHECK-LABEL: define swiftcc double @return_struct_d1()
-// CHECK-LABEL: define swiftcc void @take_struct_d1(double)
+// CHECK-LABEL: define swiftcc void @take_struct_d1(double %0)
typedef struct {
double d0;
@@ -516,7 +516,7 @@
TEST(struct_d2)
// CHECK-LABEL: define swiftcc { double, double } @return_struct_d2()
-// CHECK-LABEL: define swiftcc void @take_struct_d2(double, double)
+// CHECK-LABEL: define swiftcc void @take_struct_d2(double %0, double %1)
typedef struct {
double d0;
double d1;
@@ -524,7 +524,7 @@
} struct_d3;
TEST(struct_d3)
// CHECK-LABEL: define swiftcc { double, double, double } @return_struct_d3()
-// CHECK-LABEL: define swiftcc void @take_struct_d3(double, double, double)
+// CHECK-LABEL: define swiftcc void @take_struct_d3(double %0, double %1, double %2)
typedef struct {
double d0;
@@ -534,7 +534,7 @@
} struct_d4;
TEST(struct_d4)
// CHECK-LABEL: define swiftcc { double, double, double, double } @return_struct_d4()
-// CHECK-LABEL: define swiftcc void @take_struct_d4(double, double, double, double)
+// CHECK-LABEL: define swiftcc void @take_struct_d4(double %0, double %1, double %2, double %3)
typedef struct {
double d0;
@@ -552,7 +552,7 @@
} struct_c1;
TEST(struct_c1)
// CHECK-LABEL: define swiftcc i8 @return_struct_c1()
-// CHECK-LABEL: define swiftcc void @take_struct_c1(i8)
+// CHECK-LABEL: define swiftcc void @take_struct_c1(i8 %0)
typedef struct {
char c0;
@@ -560,7 +560,7 @@
} struct_c2;
TEST(struct_c2)
// CHECK-LABEL: define swiftcc i16 @return_struct_c2()
-// CHECK-LABEL: define swiftcc void @take_struct_c2(i16)
+// CHECK-LABEL: define swiftcc void @take_struct_c2(i16 %0)
//
typedef struct {
@@ -570,7 +570,7 @@
} struct_c3;
TEST(struct_c3)
// CHECK-LABEL: define swiftcc i32 @return_struct_c3()
-// CHECK-LABEL: define swiftcc void @take_struct_c3(i32)
+// CHECK-LABEL: define swiftcc void @take_struct_c3(i32 %0)
typedef struct {
char c0;
@@ -580,7 +580,7 @@
} struct_c4;
TEST(struct_c4)
// CHECK-LABEL: define swiftcc i32 @return_struct_c4()
-// CHECK-LABEL: define swiftcc void @take_struct_c4(i32)
+// CHECK-LABEL: define swiftcc void @take_struct_c4(i32 %0)
typedef struct {
char c0;
@@ -591,7 +591,7 @@
} struct_c5;
TEST(struct_c5)
// CHECK-LABEL: define swiftcc i64 @return_struct_c5()
-// CHECK-LABEL: define swiftcc void @take_struct_c5(i64)
+// CHECK-LABEL: define swiftcc void @take_struct_c5(i64 %0)
//
typedef struct {
char c0;
@@ -606,14 +606,14 @@
} struct_c9;
TEST(struct_c9)
// CHECK-LABEL: define swiftcc { i64, i8 } @return_struct_c9()
-// CHECK-LABEL: define swiftcc void @take_struct_c9(i64, i8)
+// CHECK-LABEL: define swiftcc void @take_struct_c9(i64 %0, i8 %1)
typedef struct {
short s0;
} struct_s1;
TEST(struct_s1)
// CHECK-LABEL: define swiftcc i16 @return_struct_s1()
-// CHECK-LABEL: define swiftcc void @take_struct_s1(i16)
+// CHECK-LABEL: define swiftcc void @take_struct_s1(i16 %0)
typedef struct {
short s0;
@@ -621,7 +621,7 @@
} struct_s2;
TEST(struct_s2)
// CHECK-LABEL: define swiftcc i32 @return_struct_s2()
-// CHECK-LABEL: define swiftcc void @take_struct_s2(i32)
+// CHECK-LABEL: define swiftcc void @take_struct_s2(i32 %0)
//
typedef struct {
@@ -631,7 +631,7 @@
} struct_s3;
TEST(struct_s3)
// CHECK-LABEL: define swiftcc i64 @return_struct_s3()
-// CHECK-LABEL: define swiftcc void @take_struct_s3(i64)
+// CHECK-LABEL: define swiftcc void @take_struct_s3(i64 %0)
typedef struct {
short s0;
@@ -641,7 +641,7 @@
} struct_s4;
TEST(struct_s4)
// CHECK-LABEL: define swiftcc i64 @return_struct_s4()
-// CHECK-LABEL: define swiftcc void @take_struct_s4(i64)
+// CHECK-LABEL: define swiftcc void @take_struct_s4(i64 %0)
typedef struct {
short s0;
@@ -652,7 +652,7 @@
} struct_s5;
TEST(struct_s5)
// CHECK-LABEL: define swiftcc { i64, i16 } @return_struct_s5()
-// CHECK-LABEL: define swiftcc void @take_struct_s5(i64, i16)
+// CHECK-LABEL: define swiftcc void @take_struct_s5(i64 %0, i16 %1)
typedef struct {
@@ -660,7 +660,7 @@
} struct_i1;
TEST(struct_i1)
// CHECK-LABEL: define swiftcc i32 @return_struct_i1()
-// CHECK-LABEL: define swiftcc void @take_struct_i1(i32)
+// CHECK-LABEL: define swiftcc void @take_struct_i1(i32 %0)
typedef struct {
int i0;
@@ -668,7 +668,7 @@
} struct_i2;
TEST(struct_i2)
// CHECK-LABEL: define swiftcc i64 @return_struct_i2()
-// CHECK-LABEL: define swiftcc void @take_struct_i2(i64)
+// CHECK-LABEL: define swiftcc void @take_struct_i2(i64 %0)
typedef struct {
int i0;
@@ -677,7 +677,7 @@
} struct_i3;
TEST(struct_i3)
// CHECK-LABEL: define swiftcc { i64, i32 } @return_struct_i3()
-// CHECK-LABEL: define swiftcc void @take_struct_i3(i64, i32)
+// CHECK-LABEL: define swiftcc void @take_struct_i3(i64 %0, i32 %1)
typedef struct {
int i0;
@@ -687,14 +687,14 @@
} struct_i4;
TEST(struct_i4)
// CHECK-LABEL: define swiftcc { i64, i64 } @return_struct_i4()
-// CHECK-LABEL: define swiftcc void @take_struct_i4(i64, i64)
+// CHECK-LABEL: define swiftcc void @take_struct_i4(i64 %0, i64 %1)
typedef struct {
long long l0;
} struct_l1;
TEST(struct_l1)
// CHECK-LABEL: define swiftcc i64 @return_struct_l1()
-// CHECK-LABEL: define swiftcc void @take_struct_l1(i64)
+// CHECK-LABEL: define swiftcc void @take_struct_l1(i64 %0)
typedef struct {
long long l0;
@@ -702,7 +702,7 @@
} struct_l2;
TEST(struct_l2)
// CHECK-LABEL: define swiftcc { i64, i64 } @return_struct_l2()
-// CHECK-LABEL: define swiftcc void @take_struct_l2(i64, i64)
+// CHECK-LABEL: define swiftcc void @take_struct_l2(i64 %0, i64 %1)
typedef struct {
long long l0;
@@ -711,7 +711,7 @@
} struct_l3;
TEST(struct_l3)
// CHECK-LABEL: define swiftcc { i64, i64, i64 } @return_struct_l3()
-// CHECK-LABEL: define swiftcc void @take_struct_l3(i64, i64, i64)
+// CHECK-LABEL: define swiftcc void @take_struct_l3(i64 %0, i64 %1, i64 %2)
typedef struct {
long long l0;
@@ -721,7 +721,7 @@
} struct_l4;
TEST(struct_l4)
// CHECK-LABEL: define swiftcc { i64, i64, i64, i64 } @return_struct_l4()
-// CHECK-LABEL: define swiftcc void @take_struct_l4(i64, i64, i64, i64)
+// CHECK-LABEL: define swiftcc void @take_struct_l4(i64 %0, i64 %1, i64 %2, i64 %3)
typedef struct {
long long l0;
@@ -739,7 +739,7 @@
} struct_vc1;
TEST(struct_vc1)
// CHECK-LABEL: define swiftcc <16 x i8> @return_struct_vc1()
-// CHECK-LABEL: define swiftcc void @take_struct_vc1(<16 x i8>)
+// CHECK-LABEL: define swiftcc void @take_struct_vc1(<16 x i8> %0)
typedef struct {
char16 c0;
@@ -747,7 +747,7 @@
} struct_vc2;
TEST(struct_vc2)
// CHECK-LABEL: define swiftcc { <16 x i8>, <16 x i8> } @return_struct_vc2()
-// CHECK-LABEL: define swiftcc void @take_struct_vc2(<16 x i8>, <16 x i8>)
+// CHECK-LABEL: define swiftcc void @take_struct_vc2(<16 x i8> %0, <16 x i8> %1)
typedef struct {
char16 c0;
@@ -756,7 +756,7 @@
} struct_vc3;
TEST(struct_vc3)
// CHECK-LABEL: define swiftcc { <16 x i8>, <16 x i8>, <16 x i8> } @return_struct_vc3()
-// CHECK-LABEL: define swiftcc void @take_struct_vc3(<16 x i8>, <16 x i8>, <16 x i8>)
+// CHECK-LABEL: define swiftcc void @take_struct_vc3(<16 x i8> %0, <16 x i8> %1, <16 x i8> %2)
typedef struct {
char16 c0;
@@ -766,7 +766,7 @@
} struct_vc4;
TEST(struct_vc4)
// CHECK-LABEL: define swiftcc { <16 x i8>, <16 x i8>, <16 x i8>, <16 x i8> } @return_struct_vc4()
-// CHECK-LABEL: define swiftcc void @take_struct_vc4(<16 x i8>, <16 x i8>, <16 x i8>, <16 x i8>)
+// CHECK-LABEL: define swiftcc void @take_struct_vc4(<16 x i8> %0, <16 x i8> %1, <16 x i8> %2, <16 x i8> %3)
typedef struct {
char16 c0;
@@ -784,7 +784,7 @@
} struct_vs1;
TEST(struct_vs1)
// CHECK-LABEL: define swiftcc <8 x i16> @return_struct_vs1()
-// CHECK-LABEL: define swiftcc void @take_struct_vs1(<8 x i16>)
+// CHECK-LABEL: define swiftcc void @take_struct_vs1(<8 x i16> %0)
typedef struct {
short8 c0;
@@ -792,7 +792,7 @@
} struct_vs2;
TEST(struct_vs2)
// CHECK-LABEL: define swiftcc { <8 x i16>, <8 x i16> } @return_struct_vs2()
-// CHECK-LABEL: define swiftcc void @take_struct_vs2(<8 x i16>, <8 x i16>)
+// CHECK-LABEL: define swiftcc void @take_struct_vs2(<8 x i16> %0, <8 x i16> %1)
typedef struct {
short8 c0;
@@ -801,7 +801,7 @@
} struct_vs3;
TEST(struct_vs3)
// CHECK-LABEL: define swiftcc { <8 x i16>, <8 x i16>, <8 x i16> } @return_struct_vs3()
-// CHECK-LABEL: define swiftcc void @take_struct_vs3(<8 x i16>, <8 x i16>, <8 x i16>)
+// CHECK-LABEL: define swiftcc void @take_struct_vs3(<8 x i16> %0, <8 x i16> %1, <8 x i16> %2)
typedef struct {
short8 c0;
@@ -811,7 +811,7 @@
} struct_vs4;
TEST(struct_vs4)
// CHECK-LABEL: define swiftcc { <8 x i16>, <8 x i16>, <8 x i16>, <8 x i16> } @return_struct_vs4()
-// CHECK-LABEL: define swiftcc void @take_struct_vs4(<8 x i16>, <8 x i16>, <8 x i16>, <8 x i16>)
+// CHECK-LABEL: define swiftcc void @take_struct_vs4(<8 x i16> %0, <8 x i16> %1, <8 x i16> %2, <8 x i16> %3)
typedef struct {
short8 c0;
@@ -829,7 +829,7 @@
} struct_vi1;
TEST(struct_vi1)
// CHECK-LABEL: define swiftcc <4 x i32> @return_struct_vi1()
-// CHECK-LABEL: define swiftcc void @take_struct_vi1(<4 x i32>)
+// CHECK-LABEL: define swiftcc void @take_struct_vi1(<4 x i32> %0)
typedef struct {
int4 c0;
@@ -837,7 +837,7 @@
} struct_vi2;
TEST(struct_vi2)
// CHECK-LABEL: define swiftcc { <4 x i32>, <4 x i32> } @return_struct_vi2()
-// CHECK-LABEL: define swiftcc void @take_struct_vi2(<4 x i32>, <4 x i32>)
+// CHECK-LABEL: define swiftcc void @take_struct_vi2(<4 x i32> %0, <4 x i32> %1)
typedef struct {
int4 c0;
@@ -846,7 +846,7 @@
} struct_vi3;
TEST(struct_vi3)
// CHECK-LABEL: define swiftcc { <4 x i32>, <4 x i32>, <4 x i32> } @return_struct_vi3()
-// CHECK-LABEL: define swiftcc void @take_struct_vi3(<4 x i32>, <4 x i32>, <4 x i32>)
+// CHECK-LABEL: define swiftcc void @take_struct_vi3(<4 x i32> %0, <4 x i32> %1, <4 x i32> %2)
typedef struct {
int4 c0;
@@ -856,7 +856,7 @@
} struct_vi4;
TEST(struct_vi4)
// CHECK-LABEL: define swiftcc { <4 x i32>, <4 x i32>, <4 x i32>, <4 x i32> } @return_struct_vi4()
-// CHECK-LABEL: define swiftcc void @take_struct_vi4(<4 x i32>, <4 x i32>, <4 x i32>, <4 x i32>)
+// CHECK-LABEL: define swiftcc void @take_struct_vi4(<4 x i32> %0, <4 x i32> %1, <4 x i32> %2, <4 x i32> %3)
typedef struct {
int4 c0;
@@ -874,7 +874,7 @@
} struct_vl1;
TEST(struct_vl1)
// CHECK-LABEL: define swiftcc <2 x i64> @return_struct_vl1()
-// CHECK-LABEL: define swiftcc void @take_struct_vl1(<2 x i64>)
+// CHECK-LABEL: define swiftcc void @take_struct_vl1(<2 x i64> %0)
typedef struct {
long2 c0;
@@ -884,7 +884,7 @@
} struct_vl4;
TEST(struct_vl4)
// CHECK-LABEL: define swiftcc { <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } @return_struct_vl4()
-// CHECK-LABEL: define swiftcc void @take_struct_vl4(<2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>)
+// CHECK-LABEL: define swiftcc void @take_struct_vl4(<2 x i64> %0, <2 x i64> %1, <2 x i64> %2, <2 x i64> %3)
typedef struct {
long2 c0;
@@ -902,7 +902,7 @@
} struct_vd1;
TEST(struct_vd1)
// CHECK-LABEL: define swiftcc <2 x double> @return_struct_vd1()
-// CHECK-LABEL: define swiftcc void @take_struct_vd1(<2 x double>)
+// CHECK-LABEL: define swiftcc void @take_struct_vd1(<2 x double> %0)
typedef struct {
double2 c0;
@@ -912,7 +912,7 @@
} struct_vd4;
TEST(struct_vd4)
// CHECK-LABEL: define swiftcc { <2 x double>, <2 x double>, <2 x double>, <2 x double> } @return_struct_vd4()
-// CHECK-LABEL: define swiftcc void @take_struct_vd4(<2 x double>, <2 x double>, <2 x double>, <2 x double>)
+// CHECK-LABEL: define swiftcc void @take_struct_vd4(<2 x double> %0, <2 x double> %1, <2 x double> %2, <2 x double> %3)
typedef struct {
double2 c0;
@@ -930,7 +930,7 @@
} struct_vd41;
TEST(struct_vd41)
// CHECK-LABEL: define swiftcc { <2 x double>, <2 x double> } @return_struct_vd41()
-// CHECK-LABEL: define swiftcc void @take_struct_vd41(<2 x double>, <2 x double>)
+// CHECK-LABEL: define swiftcc void @take_struct_vd41(<2 x double> %0, <2 x double> %1)
typedef struct {
double4 c0;
@@ -938,7 +938,7 @@
} struct_vd42;
TEST(struct_vd42)
// CHECK-LABEL: define swiftcc { <2 x double>, <2 x double>, <2 x double>, <2 x double> } @return_struct_vd42()
-// CHECK-LABEL: define swiftcc void @take_struct_vd42(<2 x double>, <2 x double>, <2 x double>, <2 x double>)
+// CHECK-LABEL: define swiftcc void @take_struct_vd42(<2 x double> %0, <2 x double> %1, <2 x double> %2, <2 x double> %3)
typedef struct {
double4 c0;
@@ -954,7 +954,7 @@
} struct_vf1;
TEST(struct_vf1)
// CHECK-LABEL: define swiftcc <4 x float> @return_struct_vf1()
-// CHECK-LABEL: define swiftcc void @take_struct_vf1(<4 x float>)
+// CHECK-LABEL: define swiftcc void @take_struct_vf1(<4 x float> %0)
typedef struct {
float4 c0;
@@ -962,7 +962,7 @@
} struct_vf2;
TEST(struct_vf2)
// CHECK-LABEL: define swiftcc { <4 x float>, <4 x float> } @return_struct_vf2()
-// CHECK-LABEL: define swiftcc void @take_struct_vf2(<4 x float>, <4 x float>)
+// CHECK-LABEL: define swiftcc void @take_struct_vf2(<4 x float> %0, <4 x float> %1)
typedef struct {
float4 c0;
@@ -972,7 +972,7 @@
} struct_vf4;
TEST(struct_vf4)
// CHECK-LABEL: define swiftcc { <4 x float>, <4 x float>, <4 x float>, <4 x float> } @return_struct_vf4()
-// CHECK-LABEL: define swiftcc void @take_struct_vf4(<4 x float>, <4 x float>, <4 x float>, <4 x float>)
+// CHECK-LABEL: define swiftcc void @take_struct_vf4(<4 x float> %0, <4 x float> %1, <4 x float> %2, <4 x float> %3)
typedef struct {
float4 c0;
@@ -990,7 +990,7 @@
} struct_vf81;
TEST(struct_vf81)
// CHECK-LABEL: define swiftcc { <4 x float>, <4 x float> } @return_struct_vf81()
-// CHECK-LABEL: define swiftcc void @take_struct_vf81(<4 x float>, <4 x float>)
+// CHECK-LABEL: define swiftcc void @take_struct_vf81(<4 x float> %0, <4 x float> %1)
// Don't crash.
typedef union {
@@ -1015,14 +1015,14 @@
} struct_v1f3;
TEST(struct_v1f3)
// ARM64-LABEL: define swiftcc { <2 x float>, float } @return_struct_v1f3()
-// ARM64-LABEL: define swiftcc void @take_struct_v1f3(<2 x float>, float)
+// ARM64-LABEL: define swiftcc void @take_struct_v1f3(<2 x float> %0, float %1)
typedef struct {
int3 vect;
unsigned long long val;
} __attribute__((packed)) padded_alloc_size_vector;
TEST(padded_alloc_size_vector)
-// X86-64-LABEL: take_padded_alloc_size_vector(<3 x i32>, i64)
+// X86-64-LABEL: take_padded_alloc_size_vector(<3 x i32> %0, i64 %1)
// X86-64-NOT: [4 x i8]
// x86-64: ret void
@@ -1031,8 +1031,8 @@
float3 fv2;
} union_hom_fp_partial2;
TEST(union_hom_fp_partial2)
-// X86-64-LABEL: take_union_hom_fp_partial2(float, float, float)
-// ARM64-LABEL: take_union_hom_fp_partial2(float, float, float)
+// X86-64-LABEL: take_union_hom_fp_partial2(float %0, float %1, float %2)
+// ARM64-LABEL: take_union_hom_fp_partial2(float %0, float %1, float %2)
// At one point, we emitted lifetime.ends without a matching lifetime.start for
// CoerceAndExpanded args. Since we're not performing optimizations, neither
diff --git a/src/llvm-project/clang/test/CodeGen/Inputs/sanitizer-blacklist-vfsoverlay.yaml b/src/llvm-project/clang/test/CodeGen/Inputs/sanitizer-blacklist-vfsoverlay.yaml
new file mode 100644
index 0000000..df2b221
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/Inputs/sanitizer-blacklist-vfsoverlay.yaml
@@ -0,0 +1,15 @@
+{
+ 'version': 0,
+ 'roots': [
+ { 'name': '@DIR@', 'type': 'directory',
+ 'contents': [
+ { 'name': 'only-virtual-file.blacklist', 'type': 'file',
+ 'external-contents': '@REAL_FILE@'
+ },
+ { 'name': 'invalid-virtual-file.blacklist', 'type': 'file',
+ 'external-contents': '@NONEXISTENT_FILE@'
+ }
+ ]
+ }
+ ]
+}
diff --git a/src/llvm-project/clang/test/CodeGen/Inputs/thinlto-multi-module.ll b/src/llvm-project/clang/test/CodeGen/Inputs/thinlto-multi-module.ll
index e8dc16a..e6fe920 100644
--- a/src/llvm-project/clang/test/CodeGen/Inputs/thinlto-multi-module.ll
+++ b/src/llvm-project/clang/test/CodeGen/Inputs/thinlto-multi-module.ll
@@ -1,4 +1,4 @@
-target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define void @f2() {
diff --git a/src/llvm-project/clang/test/CodeGen/Inputs/thinlto_backend.ll b/src/llvm-project/clang/test/CodeGen/Inputs/thinlto_backend.ll
index 78678c0..86c410e 100644
--- a/src/llvm-project/clang/test/CodeGen/Inputs/thinlto_backend.ll
+++ b/src/llvm-project/clang/test/CodeGen/Inputs/thinlto_backend.ll
@@ -1,4 +1,4 @@
-target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define void @f2() {
diff --git a/src/llvm-project/clang/test/CodeGen/Inputs/thinlto_backend_local_name_conflict1.ll b/src/llvm-project/clang/test/CodeGen/Inputs/thinlto_backend_local_name_conflict1.ll
index fb5306f..bec5f67 100644
--- a/src/llvm-project/clang/test/CodeGen/Inputs/thinlto_backend_local_name_conflict1.ll
+++ b/src/llvm-project/clang/test/CodeGen/Inputs/thinlto_backend_local_name_conflict1.ll
@@ -1,6 +1,6 @@
; ModuleID = 'local_name_conflict_var.o'
source_filename = "local_name_conflict_var.c"
-target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
@baz = internal global i32 10, align 4
diff --git a/src/llvm-project/clang/test/CodeGen/Inputs/thinlto_backend_local_name_conflict2.ll b/src/llvm-project/clang/test/CodeGen/Inputs/thinlto_backend_local_name_conflict2.ll
index bf3c262..51cd0be 100644
--- a/src/llvm-project/clang/test/CodeGen/Inputs/thinlto_backend_local_name_conflict2.ll
+++ b/src/llvm-project/clang/test/CodeGen/Inputs/thinlto_backend_local_name_conflict2.ll
@@ -1,6 +1,6 @@
; ModuleID = 'local_name_conflict_var.o'
source_filename = "local_name_conflict_var.c"
-target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
@baz = internal global i32 10, align 4
diff --git a/src/llvm-project/clang/test/CodeGen/Inputs/thinlto_expect1.proftext b/src/llvm-project/clang/test/CodeGen/Inputs/thinlto_expect1.proftext
new file mode 100644
index 0000000..e7ce3a4
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/Inputs/thinlto_expect1.proftext
@@ -0,0 +1,11 @@
+# IR level Instrumentation Flag
+:ir
+foo
+# Func Hash:
+25571299074
+# Num Counters:
+2
+# Counter Values:
+12
+24
+
diff --git a/src/llvm-project/clang/test/CodeGen/Inputs/thinlto_expect2.proftext b/src/llvm-project/clang/test/CodeGen/Inputs/thinlto_expect2.proftext
new file mode 100644
index 0000000..f9de785
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/Inputs/thinlto_expect2.proftext
@@ -0,0 +1,20 @@
+# CSIR level Instrumentation Flag
+:csir
+foo
+# Func Hash:
+25571299074
+# Num Counters:
+2
+# Counter Values:
+12
+24
+
+foo
+# Func Hash:
+1152921530178146050
+# Num Counters:
+2
+# Counter Values:
+24
+12
+
diff --git a/src/llvm-project/clang/test/CodeGen/PR44896.ll b/src/llvm-project/clang/test/CodeGen/PR44896.ll
new file mode 100644
index 0000000..a4d3445
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/PR44896.ll
@@ -0,0 +1,15 @@
+; RUN: %clang -fdiscard-value-names -S %s -o /dev/null 2>&1 | FileCheck --check-prefix=WARNING %s
+; RUN: %clang -S %s -o /dev/null 2>&1 | FileCheck --check-prefix=NOWARNING %s
+; RUN: %clang_cc1 -S -emit-llvm %s -discard-value-names -o /dev/null
+; PR 44896
+
+; WARNING: ignoring -fdiscard-value-names for LLVM Bitcode
+; NOWARNING-NOT: ignoring -fdiscard-value-names for LLVM Bitcode
+
+target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64--linux-gnu"
+
+define linkonce i8* @b(i8* %a) {
+ ret i8* %a
+}
+
diff --git a/src/llvm-project/clang/test/CodeGen/aapcs-bitfield.c b/src/llvm-project/clang/test/CodeGen/aapcs-bitfield.c
new file mode 100644
index 0000000..8d62f10
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/aapcs-bitfield.c
@@ -0,0 +1,824 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple armv8-none-linux-eabi %s -emit-llvm -o - -O3 | FileCheck %s -check-prefix=LE
+// RUN: %clang_cc1 -triple armebv8-none-linux-eabi %s -emit-llvm -o - -O3 | FileCheck %s -check-prefix=BE
+
+struct st0 {
+ short c : 7;
+};
+
+// LE-LABEL: @st0_check_load(
+// LE-NEXT: entry:
+// LE-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_ST0:%.*]], %struct.st0* [[M:%.*]], i32 0, i32 0
+// LE-NEXT: [[BF_LOAD:%.*]] = load i8, i8* [[TMP0]], align 2
+// LE-NEXT: [[BF_SHL:%.*]] = shl i8 [[BF_LOAD]], 1
+// LE-NEXT: [[BF_ASHR:%.*]] = ashr exact i8 [[BF_SHL]], 1
+// LE-NEXT: [[CONV:%.*]] = sext i8 [[BF_ASHR]] to i32
+// LE-NEXT: ret i32 [[CONV]]
+//
+// BE-LABEL: @st0_check_load(
+// BE-NEXT: entry:
+// BE-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_ST0:%.*]], %struct.st0* [[M:%.*]], i32 0, i32 0
+// BE-NEXT: [[BF_LOAD:%.*]] = load i8, i8* [[TMP0]], align 2
+// BE-NEXT: [[BF_ASHR:%.*]] = ashr i8 [[BF_LOAD]], 1
+// BE-NEXT: [[CONV:%.*]] = sext i8 [[BF_ASHR]] to i32
+// BE-NEXT: ret i32 [[CONV]]
+//
+int st0_check_load(struct st0 *m) {
+ return m->c;
+}
+
+// LE-LABEL: @st0_check_store(
+// LE-NEXT: entry:
+// LE-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_ST0:%.*]], %struct.st0* [[M:%.*]], i32 0, i32 0
+// LE-NEXT: [[BF_LOAD:%.*]] = load i8, i8* [[TMP0]], align 2
+// LE-NEXT: [[BF_CLEAR:%.*]] = and i8 [[BF_LOAD]], -128
+// LE-NEXT: [[BF_SET:%.*]] = or i8 [[BF_CLEAR]], 1
+// LE-NEXT: store i8 [[BF_SET]], i8* [[TMP0]], align 2
+// LE-NEXT: ret void
+//
+// BE-LABEL: @st0_check_store(
+// BE-NEXT: entry:
+// BE-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_ST0:%.*]], %struct.st0* [[M:%.*]], i32 0, i32 0
+// BE-NEXT: [[BF_LOAD:%.*]] = load i8, i8* [[TMP0]], align 2
+// BE-NEXT: [[BF_CLEAR:%.*]] = and i8 [[BF_LOAD]], 1
+// BE-NEXT: [[BF_SET:%.*]] = or i8 [[BF_CLEAR]], 2
+// BE-NEXT: store i8 [[BF_SET]], i8* [[TMP0]], align 2
+// BE-NEXT: ret void
+//
+void st0_check_store(struct st0 *m) {
+ m->c = 1;
+}
+
+struct st1 {
+ int a : 10;
+ short c : 6;
+};
+
+// LE-LABEL: @st1_check_load(
+// LE-NEXT: entry:
+// LE-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_ST1:%.*]], %struct.st1* [[M:%.*]], i32 0, i32 0
+// LE-NEXT: [[BF_LOAD:%.*]] = load i16, i16* [[TMP0]], align 4
+// LE-NEXT: [[BF_ASHR:%.*]] = ashr i16 [[BF_LOAD]], 10
+// LE-NEXT: [[CONV:%.*]] = sext i16 [[BF_ASHR]] to i32
+// LE-NEXT: ret i32 [[CONV]]
+//
+// BE-LABEL: @st1_check_load(
+// BE-NEXT: entry:
+// BE-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_ST1:%.*]], %struct.st1* [[M:%.*]], i32 0, i32 0
+// BE-NEXT: [[BF_LOAD:%.*]] = load i16, i16* [[TMP0]], align 4
+// BE-NEXT: [[BF_SHL:%.*]] = shl i16 [[BF_LOAD]], 10
+// BE-NEXT: [[BF_ASHR:%.*]] = ashr exact i16 [[BF_SHL]], 10
+// BE-NEXT: [[CONV:%.*]] = sext i16 [[BF_ASHR]] to i32
+// BE-NEXT: ret i32 [[CONV]]
+//
+int st1_check_load(struct st1 *m) {
+ return m->c;
+}
+
+// LE-LABEL: @st1_check_store(
+// LE-NEXT: entry:
+// LE-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_ST1:%.*]], %struct.st1* [[M:%.*]], i32 0, i32 0
+// LE-NEXT: [[BF_LOAD:%.*]] = load i16, i16* [[TMP0]], align 4
+// LE-NEXT: [[BF_CLEAR:%.*]] = and i16 [[BF_LOAD]], 1023
+// LE-NEXT: [[BF_SET:%.*]] = or i16 [[BF_CLEAR]], 1024
+// LE-NEXT: store i16 [[BF_SET]], i16* [[TMP0]], align 4
+// LE-NEXT: ret void
+//
+// BE-LABEL: @st1_check_store(
+// BE-NEXT: entry:
+// BE-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_ST1:%.*]], %struct.st1* [[M:%.*]], i32 0, i32 0
+// BE-NEXT: [[BF_LOAD:%.*]] = load i16, i16* [[TMP0]], align 4
+// BE-NEXT: [[BF_CLEAR:%.*]] = and i16 [[BF_LOAD]], -64
+// BE-NEXT: [[BF_SET:%.*]] = or i16 [[BF_CLEAR]], 1
+// BE-NEXT: store i16 [[BF_SET]], i16* [[TMP0]], align 4
+// BE-NEXT: ret void
+//
+void st1_check_store(struct st1 *m) {
+ m->c = 1;
+}
+
+struct st2 {
+ int a : 10;
+ short c : 7;
+};
+
+// LE-LABEL: @st2_check_load(
+// LE-NEXT: entry:
+// LE-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT_ST2:%.*]], %struct.st2* [[M:%.*]], i32 0, i32 1
+// LE-NEXT: [[BF_LOAD:%.*]] = load i8, i8* [[C]], align 2
+// LE-NEXT: [[BF_SHL:%.*]] = shl i8 [[BF_LOAD]], 1
+// LE-NEXT: [[BF_ASHR:%.*]] = ashr exact i8 [[BF_SHL]], 1
+// LE-NEXT: [[CONV:%.*]] = sext i8 [[BF_ASHR]] to i32
+// LE-NEXT: ret i32 [[CONV]]
+//
+// BE-LABEL: @st2_check_load(
+// BE-NEXT: entry:
+// BE-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT_ST2:%.*]], %struct.st2* [[M:%.*]], i32 0, i32 1
+// BE-NEXT: [[BF_LOAD:%.*]] = load i8, i8* [[C]], align 2
+// BE-NEXT: [[BF_ASHR:%.*]] = ashr i8 [[BF_LOAD]], 1
+// BE-NEXT: [[CONV:%.*]] = sext i8 [[BF_ASHR]] to i32
+// BE-NEXT: ret i32 [[CONV]]
+//
+int st2_check_load(struct st2 *m) {
+ return m->c;
+}
+
+// LE-LABEL: @st2_check_store(
+// LE-NEXT: entry:
+// LE-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT_ST2:%.*]], %struct.st2* [[M:%.*]], i32 0, i32 1
+// LE-NEXT: [[BF_LOAD:%.*]] = load i8, i8* [[C]], align 2
+// LE-NEXT: [[BF_CLEAR:%.*]] = and i8 [[BF_LOAD]], -128
+// LE-NEXT: [[BF_SET:%.*]] = or i8 [[BF_CLEAR]], 1
+// LE-NEXT: store i8 [[BF_SET]], i8* [[C]], align 2
+// LE-NEXT: ret void
+//
+// BE-LABEL: @st2_check_store(
+// BE-NEXT: entry:
+// BE-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT_ST2:%.*]], %struct.st2* [[M:%.*]], i32 0, i32 1
+// BE-NEXT: [[BF_LOAD:%.*]] = load i8, i8* [[C]], align 2
+// BE-NEXT: [[BF_CLEAR:%.*]] = and i8 [[BF_LOAD]], 1
+// BE-NEXT: [[BF_SET:%.*]] = or i8 [[BF_CLEAR]], 2
+// BE-NEXT: store i8 [[BF_SET]], i8* [[C]], align 2
+// BE-NEXT: ret void
+//
+void st2_check_store(struct st2 *m) {
+ m->c = 1;
+}
+
+struct st3 {
+ volatile short c : 7;
+};
+
+// LE-LABEL: @st3_check_load(
+// LE-NEXT: entry:
+// LE-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_ST3:%.*]], %struct.st3* [[M:%.*]], i32 0, i32 0
+// LE-NEXT: [[BF_LOAD:%.*]] = load volatile i8, i8* [[TMP0]], align 2
+// LE-NEXT: [[BF_SHL:%.*]] = shl i8 [[BF_LOAD]], 1
+// LE-NEXT: [[BF_ASHR:%.*]] = ashr exact i8 [[BF_SHL]], 1
+// LE-NEXT: [[CONV:%.*]] = sext i8 [[BF_ASHR]] to i32
+// LE-NEXT: ret i32 [[CONV]]
+//
+// BE-LABEL: @st3_check_load(
+// BE-NEXT: entry:
+// BE-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_ST3:%.*]], %struct.st3* [[M:%.*]], i32 0, i32 0
+// BE-NEXT: [[BF_LOAD:%.*]] = load volatile i8, i8* [[TMP0]], align 2
+// BE-NEXT: [[BF_ASHR:%.*]] = ashr i8 [[BF_LOAD]], 1
+// BE-NEXT: [[CONV:%.*]] = sext i8 [[BF_ASHR]] to i32
+// BE-NEXT: ret i32 [[CONV]]
+//
+int st3_check_load(struct st3 *m) {
+ return m->c;
+}
+
+// LE-LABEL: @st3_check_store(
+// LE-NEXT: entry:
+// LE-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_ST3:%.*]], %struct.st3* [[M:%.*]], i32 0, i32 0
+// LE-NEXT: [[BF_LOAD:%.*]] = load volatile i8, i8* [[TMP0]], align 2
+// LE-NEXT: [[BF_CLEAR:%.*]] = and i8 [[BF_LOAD]], -128
+// LE-NEXT: [[BF_SET:%.*]] = or i8 [[BF_CLEAR]], 1
+// LE-NEXT: store volatile i8 [[BF_SET]], i8* [[TMP0]], align 2
+// LE-NEXT: ret void
+//
+// BE-LABEL: @st3_check_store(
+// BE-NEXT: entry:
+// BE-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_ST3:%.*]], %struct.st3* [[M:%.*]], i32 0, i32 0
+// BE-NEXT: [[BF_LOAD:%.*]] = load volatile i8, i8* [[TMP0]], align 2
+// BE-NEXT: [[BF_CLEAR:%.*]] = and i8 [[BF_LOAD]], 1
+// BE-NEXT: [[BF_SET:%.*]] = or i8 [[BF_CLEAR]], 2
+// BE-NEXT: store volatile i8 [[BF_SET]], i8* [[TMP0]], align 2
+// BE-NEXT: ret void
+//
+void st3_check_store(struct st3 *m) {
+ m->c = 1;
+}
+
+struct st4 {
+ int b : 9;
+ volatile char c : 5;
+};
+
+// LE-LABEL: @st4_check_load(
+// LE-NEXT: entry:
+// LE-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_ST4:%.*]], %struct.st4* [[M:%.*]], i32 0, i32 0
+// LE-NEXT: [[BF_LOAD:%.*]] = load volatile i16, i16* [[TMP0]], align 4
+// LE-NEXT: [[BF_SHL:%.*]] = shl i16 [[BF_LOAD]], 2
+// LE-NEXT: [[BF_ASHR:%.*]] = ashr i16 [[BF_SHL]], 11
+// LE-NEXT: [[BF_CAST:%.*]] = zext i16 [[BF_ASHR]] to i32
+// LE-NEXT: [[SEXT:%.*]] = shl i32 [[BF_CAST]], 24
+// LE-NEXT: [[CONV:%.*]] = ashr exact i32 [[SEXT]], 24
+// LE-NEXT: ret i32 [[CONV]]
+//
+// BE-LABEL: @st4_check_load(
+// BE-NEXT: entry:
+// BE-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_ST4:%.*]], %struct.st4* [[M:%.*]], i32 0, i32 0
+// BE-NEXT: [[BF_LOAD:%.*]] = load volatile i16, i16* [[TMP0]], align 4
+// BE-NEXT: [[BF_SHL:%.*]] = shl i16 [[BF_LOAD]], 9
+// BE-NEXT: [[BF_ASHR:%.*]] = ashr i16 [[BF_SHL]], 11
+// BE-NEXT: [[BF_CAST:%.*]] = zext i16 [[BF_ASHR]] to i32
+// BE-NEXT: [[SEXT:%.*]] = shl i32 [[BF_CAST]], 24
+// BE-NEXT: [[CONV:%.*]] = ashr exact i32 [[SEXT]], 24
+// BE-NEXT: ret i32 [[CONV]]
+//
+int st4_check_load(struct st4 *m) {
+ return m->c;
+}
+
+// LE-LABEL: @st4_check_store(
+// LE-NEXT: entry:
+// LE-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_ST4:%.*]], %struct.st4* [[M:%.*]], i32 0, i32 0
+// LE-NEXT: [[BF_LOAD:%.*]] = load volatile i16, i16* [[TMP0]], align 4
+// LE-NEXT: [[BF_CLEAR:%.*]] = and i16 [[BF_LOAD]], -15873
+// LE-NEXT: [[BF_SET:%.*]] = or i16 [[BF_CLEAR]], 512
+// LE-NEXT: store volatile i16 [[BF_SET]], i16* [[TMP0]], align 4
+// LE-NEXT: ret void
+//
+// BE-LABEL: @st4_check_store(
+// BE-NEXT: entry:
+// BE-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_ST4:%.*]], %struct.st4* [[M:%.*]], i32 0, i32 0
+// BE-NEXT: [[BF_LOAD:%.*]] = load volatile i16, i16* [[TMP0]], align 4
+// BE-NEXT: [[BF_CLEAR:%.*]] = and i16 [[BF_LOAD]], -125
+// BE-NEXT: [[BF_SET:%.*]] = or i16 [[BF_CLEAR]], 4
+// BE-NEXT: store volatile i16 [[BF_SET]], i16* [[TMP0]], align 4
+// BE-NEXT: ret void
+//
+void st4_check_store(struct st4 *m) {
+ m->c = 1;
+}
+
+// LE-LABEL: @st4_check_nonv_store(
+// LE-NEXT: entry:
+// LE-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_ST4:%.*]], %struct.st4* [[M:%.*]], i32 0, i32 0
+// LE-NEXT: [[BF_LOAD:%.*]] = load i16, i16* [[TMP0]], align 4
+// LE-NEXT: [[BF_CLEAR:%.*]] = and i16 [[BF_LOAD]], -512
+// LE-NEXT: [[BF_SET:%.*]] = or i16 [[BF_CLEAR]], 1
+// LE-NEXT: store i16 [[BF_SET]], i16* [[TMP0]], align 4
+// LE-NEXT: ret void
+//
+// BE-LABEL: @st4_check_nonv_store(
+// BE-NEXT: entry:
+// BE-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_ST4:%.*]], %struct.st4* [[M:%.*]], i32 0, i32 0
+// BE-NEXT: [[BF_LOAD:%.*]] = load i16, i16* [[TMP0]], align 4
+// BE-NEXT: [[BF_CLEAR:%.*]] = and i16 [[BF_LOAD]], 127
+// BE-NEXT: [[BF_SET:%.*]] = or i16 [[BF_CLEAR]], 128
+// BE-NEXT: store i16 [[BF_SET]], i16* [[TMP0]], align 4
+// BE-NEXT: ret void
+//
+void st4_check_nonv_store(struct st4 *m) {
+ m->b = 1;
+}
+
+struct st5 {
+ int a : 12;
+ volatile char c : 5;
+};
+
+// LE-LABEL: @st5_check_load(
+// LE-NEXT: entry:
+// LE-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT_ST5:%.*]], %struct.st5* [[M:%.*]], i32 0, i32 1
+// LE-NEXT: [[BF_LOAD:%.*]] = load volatile i8, i8* [[C]], align 2
+// LE-NEXT: [[BF_SHL:%.*]] = shl i8 [[BF_LOAD]], 3
+// LE-NEXT: [[BF_ASHR:%.*]] = ashr exact i8 [[BF_SHL]], 3
+// LE-NEXT: [[CONV:%.*]] = sext i8 [[BF_ASHR]] to i32
+// LE-NEXT: ret i32 [[CONV]]
+//
+// BE-LABEL: @st5_check_load(
+// BE-NEXT: entry:
+// BE-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT_ST5:%.*]], %struct.st5* [[M:%.*]], i32 0, i32 1
+// BE-NEXT: [[BF_LOAD:%.*]] = load volatile i8, i8* [[C]], align 2
+// BE-NEXT: [[BF_ASHR:%.*]] = ashr i8 [[BF_LOAD]], 3
+// BE-NEXT: [[CONV:%.*]] = sext i8 [[BF_ASHR]] to i32
+// BE-NEXT: ret i32 [[CONV]]
+//
+int st5_check_load(struct st5 *m) {
+ return m->c;
+}
+
+// LE-LABEL: @st5_check_store(
+// LE-NEXT: entry:
+// LE-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT_ST5:%.*]], %struct.st5* [[M:%.*]], i32 0, i32 1
+// LE-NEXT: [[BF_LOAD:%.*]] = load volatile i8, i8* [[C]], align 2
+// LE-NEXT: [[BF_CLEAR:%.*]] = and i8 [[BF_LOAD]], -32
+// LE-NEXT: [[BF_SET:%.*]] = or i8 [[BF_CLEAR]], 1
+// LE-NEXT: store volatile i8 [[BF_SET]], i8* [[C]], align 2
+// LE-NEXT: ret void
+//
+// BE-LABEL: @st5_check_store(
+// BE-NEXT: entry:
+// BE-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT_ST5:%.*]], %struct.st5* [[M:%.*]], i32 0, i32 1
+// BE-NEXT: [[BF_LOAD:%.*]] = load volatile i8, i8* [[C]], align 2
+// BE-NEXT: [[BF_CLEAR:%.*]] = and i8 [[BF_LOAD]], 7
+// BE-NEXT: [[BF_SET:%.*]] = or i8 [[BF_CLEAR]], 8
+// BE-NEXT: store volatile i8 [[BF_SET]], i8* [[C]], align 2
+// BE-NEXT: ret void
+//
+void st5_check_store(struct st5 *m) {
+ m->c = 1;
+}
+
+struct st6 {
+ int a : 12;
+ char b;
+ int c : 5;
+};
+
+// LE-LABEL: @st6_check_load(
+// LE-NEXT: entry:
+// LE-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_ST6:%.*]], %struct.st6* [[M:%.*]], i32 0, i32 0
+// LE-NEXT: [[BF_LOAD:%.*]] = load i16, i16* [[TMP0]], align 4
+// LE-NEXT: [[BF_SHL:%.*]] = shl i16 [[BF_LOAD]], 4
+// LE-NEXT: [[BF_ASHR:%.*]] = ashr exact i16 [[BF_SHL]], 4
+// LE-NEXT: [[BF_CAST:%.*]] = sext i16 [[BF_ASHR]] to i32
+// LE-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT_ST6]], %struct.st6* [[M]], i32 0, i32 1
+// LE-NEXT: [[TMP1:%.*]] = load i8, i8* [[B]], align 2, !tbaa !3
+// LE-NEXT: [[CONV:%.*]] = sext i8 [[TMP1]] to i32
+// LE-NEXT: [[ADD:%.*]] = add nsw i32 [[BF_CAST]], [[CONV]]
+// LE-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT_ST6]], %struct.st6* [[M]], i32 0, i32 2
+// LE-NEXT: [[BF_LOAD1:%.*]] = load i8, i8* [[C]], align 1
+// LE-NEXT: [[BF_SHL2:%.*]] = shl i8 [[BF_LOAD1]], 3
+// LE-NEXT: [[BF_ASHR3:%.*]] = ashr exact i8 [[BF_SHL2]], 3
+// LE-NEXT: [[BF_CAST4:%.*]] = sext i8 [[BF_ASHR3]] to i32
+// LE-NEXT: [[ADD5:%.*]] = add nsw i32 [[ADD]], [[BF_CAST4]]
+// LE-NEXT: ret i32 [[ADD5]]
+//
+// BE-LABEL: @st6_check_load(
+// BE-NEXT: entry:
+// BE-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_ST6:%.*]], %struct.st6* [[M:%.*]], i32 0, i32 0
+// BE-NEXT: [[BF_LOAD:%.*]] = load i16, i16* [[TMP0]], align 4
+// BE-NEXT: [[BF_ASHR:%.*]] = ashr i16 [[BF_LOAD]], 4
+// BE-NEXT: [[BF_CAST:%.*]] = sext i16 [[BF_ASHR]] to i32
+// BE-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT_ST6]], %struct.st6* [[M]], i32 0, i32 1
+// BE-NEXT: [[TMP1:%.*]] = load i8, i8* [[B]], align 2, !tbaa !3
+// BE-NEXT: [[CONV:%.*]] = sext i8 [[TMP1]] to i32
+// BE-NEXT: [[ADD:%.*]] = add nsw i32 [[BF_CAST]], [[CONV]]
+// BE-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT_ST6]], %struct.st6* [[M]], i32 0, i32 2
+// BE-NEXT: [[BF_LOAD1:%.*]] = load i8, i8* [[C]], align 1
+// BE-NEXT: [[BF_ASHR2:%.*]] = ashr i8 [[BF_LOAD1]], 3
+// BE-NEXT: [[BF_CAST3:%.*]] = sext i8 [[BF_ASHR2]] to i32
+// BE-NEXT: [[ADD4:%.*]] = add nsw i32 [[ADD]], [[BF_CAST3]]
+// BE-NEXT: ret i32 [[ADD4]]
+//
+int st6_check_load(struct st6 *m) {
+ int x = m->a;
+ x += m->b;
+ x += m->c;
+ return x;
+}
+
+// LE-LABEL: @st6_check_store(
+// LE-NEXT: entry:
+// LE-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_ST6:%.*]], %struct.st6* [[M:%.*]], i32 0, i32 0
+// LE-NEXT: [[BF_LOAD:%.*]] = load i16, i16* [[TMP0]], align 4
+// LE-NEXT: [[BF_CLEAR:%.*]] = and i16 [[BF_LOAD]], -4096
+// LE-NEXT: [[BF_SET:%.*]] = or i16 [[BF_CLEAR]], 1
+// LE-NEXT: store i16 [[BF_SET]], i16* [[TMP0]], align 4
+// LE-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT_ST6]], %struct.st6* [[M]], i32 0, i32 1
+// LE-NEXT: store i8 2, i8* [[B]], align 2, !tbaa !3
+// LE-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT_ST6]], %struct.st6* [[M]], i32 0, i32 2
+// LE-NEXT: [[BF_LOAD1:%.*]] = load i8, i8* [[C]], align 1
+// LE-NEXT: [[BF_CLEAR2:%.*]] = and i8 [[BF_LOAD1]], -32
+// LE-NEXT: [[BF_SET3:%.*]] = or i8 [[BF_CLEAR2]], 3
+// LE-NEXT: store i8 [[BF_SET3]], i8* [[C]], align 1
+// LE-NEXT: ret void
+//
+// BE-LABEL: @st6_check_store(
+// BE-NEXT: entry:
+// BE-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_ST6:%.*]], %struct.st6* [[M:%.*]], i32 0, i32 0
+// BE-NEXT: [[BF_LOAD:%.*]] = load i16, i16* [[TMP0]], align 4
+// BE-NEXT: [[BF_CLEAR:%.*]] = and i16 [[BF_LOAD]], 15
+// BE-NEXT: [[BF_SET:%.*]] = or i16 [[BF_CLEAR]], 16
+// BE-NEXT: store i16 [[BF_SET]], i16* [[TMP0]], align 4
+// BE-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT_ST6]], %struct.st6* [[M]], i32 0, i32 1
+// BE-NEXT: store i8 2, i8* [[B]], align 2, !tbaa !3
+// BE-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT_ST6]], %struct.st6* [[M]], i32 0, i32 2
+// BE-NEXT: [[BF_LOAD1:%.*]] = load i8, i8* [[C]], align 1
+// BE-NEXT: [[BF_CLEAR2:%.*]] = and i8 [[BF_LOAD1]], 7
+// BE-NEXT: [[BF_SET3:%.*]] = or i8 [[BF_CLEAR2]], 24
+// BE-NEXT: store i8 [[BF_SET3]], i8* [[C]], align 1
+// BE-NEXT: ret void
+//
+void st6_check_store(struct st6 *m) {
+ m->a = 1;
+ m->b = 2;
+ m->c = 3;
+}
+
+// Nested structs and bitfields.
+struct st7a {
+ char a;
+ int b : 5;
+};
+
+struct st7b {
+ char x;
+ struct st7a y;
+};
+
+// LE-LABEL: @st7_check_load(
+// LE-NEXT: entry:
+// LE-NEXT: [[X:%.*]] = getelementptr inbounds [[STRUCT_ST7B:%.*]], %struct.st7b* [[M:%.*]], i32 0, i32 0
+// LE-NEXT: [[TMP0:%.*]] = load i8, i8* [[X]], align 4, !tbaa !8
+// LE-NEXT: [[CONV:%.*]] = sext i8 [[TMP0]] to i32
+// LE-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_ST7B]], %struct.st7b* [[M]], i32 0, i32 2, i32 0
+// LE-NEXT: [[TMP1:%.*]] = load i8, i8* [[A]], align 4, !tbaa !11
+// LE-NEXT: [[CONV1:%.*]] = sext i8 [[TMP1]] to i32
+// LE-NEXT: [[ADD:%.*]] = add nsw i32 [[CONV1]], [[CONV]]
+// LE-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT_ST7B]], %struct.st7b* [[M]], i32 0, i32 2, i32 1
+// LE-NEXT: [[BF_LOAD:%.*]] = load i8, i8* [[B]], align 1
+// LE-NEXT: [[BF_SHL:%.*]] = shl i8 [[BF_LOAD]], 3
+// LE-NEXT: [[BF_ASHR:%.*]] = ashr exact i8 [[BF_SHL]], 3
+// LE-NEXT: [[BF_CAST:%.*]] = sext i8 [[BF_ASHR]] to i32
+// LE-NEXT: [[ADD3:%.*]] = add nsw i32 [[ADD]], [[BF_CAST]]
+// LE-NEXT: ret i32 [[ADD3]]
+//
+// BE-LABEL: @st7_check_load(
+// BE-NEXT: entry:
+// BE-NEXT: [[X:%.*]] = getelementptr inbounds [[STRUCT_ST7B:%.*]], %struct.st7b* [[M:%.*]], i32 0, i32 0
+// BE-NEXT: [[TMP0:%.*]] = load i8, i8* [[X]], align 4, !tbaa !8
+// BE-NEXT: [[CONV:%.*]] = sext i8 [[TMP0]] to i32
+// BE-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_ST7B]], %struct.st7b* [[M]], i32 0, i32 2, i32 0
+// BE-NEXT: [[TMP1:%.*]] = load i8, i8* [[A]], align 4, !tbaa !11
+// BE-NEXT: [[CONV1:%.*]] = sext i8 [[TMP1]] to i32
+// BE-NEXT: [[ADD:%.*]] = add nsw i32 [[CONV1]], [[CONV]]
+// BE-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT_ST7B]], %struct.st7b* [[M]], i32 0, i32 2, i32 1
+// BE-NEXT: [[BF_LOAD:%.*]] = load i8, i8* [[B]], align 1
+// BE-NEXT: [[BF_ASHR:%.*]] = ashr i8 [[BF_LOAD]], 3
+// BE-NEXT: [[BF_CAST:%.*]] = sext i8 [[BF_ASHR]] to i32
+// BE-NEXT: [[ADD3:%.*]] = add nsw i32 [[ADD]], [[BF_CAST]]
+// BE-NEXT: ret i32 [[ADD3]]
+//
+int st7_check_load(struct st7b *m) {
+ int r = m->x;
+ r += m->y.a;
+ r += m->y.b;
+ return r;
+}
+
+// LE-LABEL: @st7_check_store(
+// LE-NEXT: entry:
+// LE-NEXT: [[X:%.*]] = getelementptr inbounds [[STRUCT_ST7B:%.*]], %struct.st7b* [[M:%.*]], i32 0, i32 0
+// LE-NEXT: store i8 1, i8* [[X]], align 4, !tbaa !8
+// LE-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_ST7B]], %struct.st7b* [[M]], i32 0, i32 2, i32 0
+// LE-NEXT: store i8 2, i8* [[A]], align 4, !tbaa !11
+// LE-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT_ST7B]], %struct.st7b* [[M]], i32 0, i32 2, i32 1
+// LE-NEXT: [[BF_LOAD:%.*]] = load i8, i8* [[B]], align 1
+// LE-NEXT: [[BF_CLEAR:%.*]] = and i8 [[BF_LOAD]], -32
+// LE-NEXT: [[BF_SET:%.*]] = or i8 [[BF_CLEAR]], 3
+// LE-NEXT: store i8 [[BF_SET]], i8* [[B]], align 1
+// LE-NEXT: ret void
+//
+// BE-LABEL: @st7_check_store(
+// BE-NEXT: entry:
+// BE-NEXT: [[X:%.*]] = getelementptr inbounds [[STRUCT_ST7B:%.*]], %struct.st7b* [[M:%.*]], i32 0, i32 0
+// BE-NEXT: store i8 1, i8* [[X]], align 4, !tbaa !8
+// BE-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_ST7B]], %struct.st7b* [[M]], i32 0, i32 2, i32 0
+// BE-NEXT: store i8 2, i8* [[A]], align 4, !tbaa !11
+// BE-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT_ST7B]], %struct.st7b* [[M]], i32 0, i32 2, i32 1
+// BE-NEXT: [[BF_LOAD:%.*]] = load i8, i8* [[B]], align 1
+// BE-NEXT: [[BF_CLEAR:%.*]] = and i8 [[BF_LOAD]], 7
+// BE-NEXT: [[BF_SET:%.*]] = or i8 [[BF_CLEAR]], 24
+// BE-NEXT: store i8 [[BF_SET]], i8* [[B]], align 1
+// BE-NEXT: ret void
+//
+void st7_check_store(struct st7b *m) {
+ m->x = 1;
+ m->y.a = 2;
+ m->y.b = 3;
+}
+
+// Check overflowing assignments to bitfields.
+struct st8 {
+ unsigned f : 16;
+};
+
+// LE-LABEL: @st8_check_assignment(
+// LE-NEXT: entry:
+// LE-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_ST8:%.*]], %struct.st8* [[M:%.*]], i32 0, i32 0
+// LE-NEXT: store i16 -1, i16* [[TMP0]], align 4
+// LE-NEXT: ret i32 65535
+//
+// BE-LABEL: @st8_check_assignment(
+// BE-NEXT: entry:
+// BE-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_ST8:%.*]], %struct.st8* [[M:%.*]], i32 0, i32 0
+// BE-NEXT: store i16 -1, i16* [[TMP0]], align 4
+// BE-NEXT: ret i32 65535
+//
+int st8_check_assignment(struct st8 *m) {
+ return m->f = 0xffff;
+}
+
+struct st9{
+ int f : 8;
+};
+
+// LE-LABEL: @read_st9(
+// LE-NEXT: entry:
+// LE-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_ST9:%.*]], %struct.st9* [[M:%.*]], i32 0, i32 0
+// LE-NEXT: [[BF_LOAD:%.*]] = load volatile i8, i8* [[TMP0]], align 4
+// LE-NEXT: [[BF_CAST:%.*]] = sext i8 [[BF_LOAD]] to i32
+// LE-NEXT: ret i32 [[BF_CAST]]
+//
+// BE-LABEL: @read_st9(
+// BE-NEXT: entry:
+// BE-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_ST9:%.*]], %struct.st9* [[M:%.*]], i32 0, i32 0
+// BE-NEXT: [[BF_LOAD:%.*]] = load volatile i8, i8* [[TMP0]], align 4
+// BE-NEXT: [[BF_CAST:%.*]] = sext i8 [[BF_LOAD]] to i32
+// BE-NEXT: ret i32 [[BF_CAST]]
+//
+int read_st9(volatile struct st9 *m) {
+ return m->f;
+}
+
+// LE-LABEL: @store_st9(
+// LE-NEXT: entry:
+// LE-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_ST9:%.*]], %struct.st9* [[M:%.*]], i32 0, i32 0
+// LE-NEXT: store volatile i8 1, i8* [[TMP0]], align 4
+// LE-NEXT: ret void
+//
+// BE-LABEL: @store_st9(
+// BE-NEXT: entry:
+// BE-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_ST9:%.*]], %struct.st9* [[M:%.*]], i32 0, i32 0
+// BE-NEXT: store volatile i8 1, i8* [[TMP0]], align 4
+// BE-NEXT: ret void
+//
+void store_st9(volatile struct st9 *m) {
+ m->f = 1;
+}
+
+// LE-LABEL: @increment_st9(
+// LE-NEXT: entry:
+// LE-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_ST9:%.*]], %struct.st9* [[M:%.*]], i32 0, i32 0
+// LE-NEXT: [[BF_LOAD:%.*]] = load volatile i8, i8* [[TMP0]], align 4
+// LE-NEXT: [[INC:%.*]] = add i8 [[BF_LOAD]], 1
+// LE-NEXT: store volatile i8 [[INC]], i8* [[TMP0]], align 4
+// LE-NEXT: ret void
+//
+// BE-LABEL: @increment_st9(
+// BE-NEXT: entry:
+// BE-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_ST9:%.*]], %struct.st9* [[M:%.*]], i32 0, i32 0
+// BE-NEXT: [[BF_LOAD:%.*]] = load volatile i8, i8* [[TMP0]], align 4
+// BE-NEXT: [[INC:%.*]] = add i8 [[BF_LOAD]], 1
+// BE-NEXT: store volatile i8 [[INC]], i8* [[TMP0]], align 4
+// BE-NEXT: ret void
+//
+void increment_st9(volatile struct st9 *m) {
+ ++m->f;
+}
+
+struct st10{
+ int e : 1;
+ int f : 8;
+};
+
+// LE-LABEL: @read_st10(
+// LE-NEXT: entry:
+// LE-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_ST10:%.*]], %struct.st10* [[M:%.*]], i32 0, i32 0
+// LE-NEXT: [[BF_LOAD:%.*]] = load volatile i16, i16* [[TMP0]], align 4
+// LE-NEXT: [[BF_SHL:%.*]] = shl i16 [[BF_LOAD]], 7
+// LE-NEXT: [[BF_ASHR:%.*]] = ashr i16 [[BF_SHL]], 8
+// LE-NEXT: [[BF_CAST:%.*]] = sext i16 [[BF_ASHR]] to i32
+// LE-NEXT: ret i32 [[BF_CAST]]
+//
+// BE-LABEL: @read_st10(
+// BE-NEXT: entry:
+// BE-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_ST10:%.*]], %struct.st10* [[M:%.*]], i32 0, i32 0
+// BE-NEXT: [[BF_LOAD:%.*]] = load volatile i16, i16* [[TMP0]], align 4
+// BE-NEXT: [[BF_SHL:%.*]] = shl i16 [[BF_LOAD]], 1
+// BE-NEXT: [[BF_ASHR:%.*]] = ashr i16 [[BF_SHL]], 8
+// BE-NEXT: [[BF_CAST:%.*]] = sext i16 [[BF_ASHR]] to i32
+// BE-NEXT: ret i32 [[BF_CAST]]
+//
+int read_st10(volatile struct st10 *m) {
+ return m->f;
+}
+
+// LE-LABEL: @store_st10(
+// LE-NEXT: entry:
+// LE-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_ST10:%.*]], %struct.st10* [[M:%.*]], i32 0, i32 0
+// LE-NEXT: [[BF_LOAD:%.*]] = load volatile i16, i16* [[TMP0]], align 4
+// LE-NEXT: [[BF_CLEAR:%.*]] = and i16 [[BF_LOAD]], -511
+// LE-NEXT: [[BF_SET:%.*]] = or i16 [[BF_CLEAR]], 2
+// LE-NEXT: store volatile i16 [[BF_SET]], i16* [[TMP0]], align 4
+// LE-NEXT: ret void
+//
+// BE-LABEL: @store_st10(
+// BE-NEXT: entry:
+// BE-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_ST10:%.*]], %struct.st10* [[M:%.*]], i32 0, i32 0
+// BE-NEXT: [[BF_LOAD:%.*]] = load volatile i16, i16* [[TMP0]], align 4
+// BE-NEXT: [[BF_CLEAR:%.*]] = and i16 [[BF_LOAD]], -32641
+// BE-NEXT: [[BF_SET:%.*]] = or i16 [[BF_CLEAR]], 128
+// BE-NEXT: store volatile i16 [[BF_SET]], i16* [[TMP0]], align 4
+// BE-NEXT: ret void
+//
+void store_st10(volatile struct st10 *m) {
+ m->f = 1;
+}
+
+// LE-LABEL: @increment_st10(
+// LE-NEXT: entry:
+// LE-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_ST10:%.*]], %struct.st10* [[M:%.*]], i32 0, i32 0
+// LE-NEXT: [[BF_LOAD:%.*]] = load volatile i16, i16* [[TMP0]], align 4
+// LE-NEXT: [[BF_LOAD1:%.*]] = load volatile i16, i16* [[TMP0]], align 4
+// LE-NEXT: [[TMP1:%.*]] = add i16 [[BF_LOAD]], 2
+// LE-NEXT: [[BF_SHL2:%.*]] = and i16 [[TMP1]], 510
+// LE-NEXT: [[BF_CLEAR:%.*]] = and i16 [[BF_LOAD1]], -511
+// LE-NEXT: [[BF_SET:%.*]] = or i16 [[BF_CLEAR]], [[BF_SHL2]]
+// LE-NEXT: store volatile i16 [[BF_SET]], i16* [[TMP0]], align 4
+// LE-NEXT: ret void
+//
+// BE-LABEL: @increment_st10(
+// BE-NEXT: entry:
+// BE-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_ST10:%.*]], %struct.st10* [[M:%.*]], i32 0, i32 0
+// BE-NEXT: [[BF_LOAD:%.*]] = load volatile i16, i16* [[TMP0]], align 4
+// BE-NEXT: [[BF_LOAD1:%.*]] = load volatile i16, i16* [[TMP0]], align 4
+// BE-NEXT: [[TMP1:%.*]] = add i16 [[BF_LOAD]], 128
+// BE-NEXT: [[BF_SHL2:%.*]] = and i16 [[TMP1]], 32640
+// BE-NEXT: [[BF_CLEAR:%.*]] = and i16 [[BF_LOAD1]], -32641
+// BE-NEXT: [[BF_SET:%.*]] = or i16 [[BF_CLEAR]], [[BF_SHL2]]
+// BE-NEXT: store volatile i16 [[BF_SET]], i16* [[TMP0]], align 4
+// BE-NEXT: ret void
+//
+void increment_st10(volatile struct st10 *m) {
+ ++m->f;
+}
+
+struct st11{
+ char e;
+ int f : 16;
+};
+
+// LE-LABEL: @read_st11(
+// LE-NEXT: entry:
+// LE-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_ST11:%.*]], %struct.st11* [[M:%.*]], i32 0, i32 1
+// LE-NEXT: [[BF_LOAD:%.*]] = load volatile i16, i16* [[F]], align 1
+// LE-NEXT: [[BF_CAST:%.*]] = sext i16 [[BF_LOAD]] to i32
+// LE-NEXT: ret i32 [[BF_CAST]]
+//
+// BE-LABEL: @read_st11(
+// BE-NEXT: entry:
+// BE-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_ST11:%.*]], %struct.st11* [[M:%.*]], i32 0, i32 1
+// BE-NEXT: [[BF_LOAD:%.*]] = load volatile i16, i16* [[F]], align 1
+// BE-NEXT: [[BF_CAST:%.*]] = sext i16 [[BF_LOAD]] to i32
+// BE-NEXT: ret i32 [[BF_CAST]]
+//
+int read_st11(volatile struct st11 *m) {
+ return m->f;
+}
+
+// LE-LABEL: @store_st11(
+// LE-NEXT: entry:
+// LE-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_ST11:%.*]], %struct.st11* [[M:%.*]], i32 0, i32 1
+// LE-NEXT: store volatile i16 1, i16* [[F]], align 1
+// LE-NEXT: ret void
+//
+// BE-LABEL: @store_st11(
+// BE-NEXT: entry:
+// BE-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_ST11:%.*]], %struct.st11* [[M:%.*]], i32 0, i32 1
+// BE-NEXT: store volatile i16 1, i16* [[F]], align 1
+// BE-NEXT: ret void
+//
+void store_st11(volatile struct st11 *m) {
+ m->f = 1;
+}
+
+// LE-LABEL: @increment_st11(
+// LE-NEXT: entry:
+// LE-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_ST11:%.*]], %struct.st11* [[M:%.*]], i32 0, i32 1
+// LE-NEXT: [[BF_LOAD:%.*]] = load volatile i16, i16* [[F]], align 1
+// LE-NEXT: [[INC:%.*]] = add i16 [[BF_LOAD]], 1
+// LE-NEXT: store volatile i16 [[INC]], i16* [[F]], align 1
+// LE-NEXT: ret void
+//
+// BE-LABEL: @increment_st11(
+// BE-NEXT: entry:
+// BE-NEXT: [[F:%.*]] = getelementptr inbounds [[STRUCT_ST11:%.*]], %struct.st11* [[M:%.*]], i32 0, i32 1
+// BE-NEXT: [[BF_LOAD:%.*]] = load volatile i16, i16* [[F]], align 1
+// BE-NEXT: [[INC:%.*]] = add i16 [[BF_LOAD]], 1
+// BE-NEXT: store volatile i16 [[INC]], i16* [[F]], align 1
+// BE-NEXT: ret void
+//
+void increment_st11(volatile struct st11 *m) {
+ ++m->f;
+}
+
+// LE-LABEL: @increment_e_st11(
+// LE-NEXT: entry:
+// LE-NEXT: [[E:%.*]] = getelementptr inbounds [[STRUCT_ST11:%.*]], %struct.st11* [[M:%.*]], i32 0, i32 0
+// LE-NEXT: [[TMP0:%.*]] = load volatile i8, i8* [[E]], align 4, !tbaa !12
+// LE-NEXT: [[INC:%.*]] = add i8 [[TMP0]], 1
+// LE-NEXT: store volatile i8 [[INC]], i8* [[E]], align 4, !tbaa !12
+// LE-NEXT: ret void
+//
+// BE-LABEL: @increment_e_st11(
+// BE-NEXT: entry:
+// BE-NEXT: [[E:%.*]] = getelementptr inbounds [[STRUCT_ST11:%.*]], %struct.st11* [[M:%.*]], i32 0, i32 0
+// BE-NEXT: [[TMP0:%.*]] = load volatile i8, i8* [[E]], align 4, !tbaa !12
+// BE-NEXT: [[INC:%.*]] = add i8 [[TMP0]], 1
+// BE-NEXT: store volatile i8 [[INC]], i8* [[E]], align 4, !tbaa !12
+// BE-NEXT: ret void
+//
+void increment_e_st11(volatile struct st11 *m) {
+ ++m->e;
+}
+
+struct st12{
+ int e : 8;
+ int f : 16;
+};
+
+// LE-LABEL: @read_st12(
+// LE-NEXT: entry:
+// LE-NEXT: [[TMP0:%.*]] = bitcast %struct.st12* [[M:%.*]] to i32*
+// LE-NEXT: [[BF_LOAD:%.*]] = load volatile i32, i32* [[TMP0]], align 4
+// LE-NEXT: [[BF_SHL:%.*]] = shl i32 [[BF_LOAD]], 8
+// LE-NEXT: [[BF_ASHR:%.*]] = ashr i32 [[BF_SHL]], 16
+// LE-NEXT: ret i32 [[BF_ASHR]]
+//
+// BE-LABEL: @read_st12(
+// BE-NEXT: entry:
+// BE-NEXT: [[TMP0:%.*]] = bitcast %struct.st12* [[M:%.*]] to i32*
+// BE-NEXT: [[BF_LOAD:%.*]] = load volatile i32, i32* [[TMP0]], align 4
+// BE-NEXT: [[BF_SHL:%.*]] = shl i32 [[BF_LOAD]], 8
+// BE-NEXT: [[BF_ASHR:%.*]] = ashr i32 [[BF_SHL]], 16
+// BE-NEXT: ret i32 [[BF_ASHR]]
+//
+int read_st12(volatile struct st12 *m) {
+ return m->f;
+}
+
+// LE-LABEL: @store_st12(
+// LE-NEXT: entry:
+// LE-NEXT: [[TMP0:%.*]] = bitcast %struct.st12* [[M:%.*]] to i32*
+// LE-NEXT: [[BF_LOAD:%.*]] = load volatile i32, i32* [[TMP0]], align 4
+// LE-NEXT: [[BF_CLEAR:%.*]] = and i32 [[BF_LOAD]], -16776961
+// LE-NEXT: [[BF_SET:%.*]] = or i32 [[BF_CLEAR]], 256
+// LE-NEXT: store volatile i32 [[BF_SET]], i32* [[TMP0]], align 4
+// LE-NEXT: ret void
+//
+// BE-LABEL: @store_st12(
+// BE-NEXT: entry:
+// BE-NEXT: [[TMP0:%.*]] = bitcast %struct.st12* [[M:%.*]] to i32*
+// BE-NEXT: [[BF_LOAD:%.*]] = load volatile i32, i32* [[TMP0]], align 4
+// BE-NEXT: [[BF_CLEAR:%.*]] = and i32 [[BF_LOAD]], -16776961
+// BE-NEXT: [[BF_SET:%.*]] = or i32 [[BF_CLEAR]], 256
+// BE-NEXT: store volatile i32 [[BF_SET]], i32* [[TMP0]], align 4
+// BE-NEXT: ret void
+//
+void store_st12(volatile struct st12 *m) {
+ m->f = 1;
+}
+
+// LE-LABEL: @increment_st12(
+// LE-NEXT: entry:
+// LE-NEXT: [[TMP0:%.*]] = bitcast %struct.st12* [[M:%.*]] to i32*
+// LE-NEXT: [[BF_LOAD:%.*]] = load volatile i32, i32* [[TMP0]], align 4
+// LE-NEXT: [[BF_LOAD1:%.*]] = load volatile i32, i32* [[TMP0]], align 4
+// LE-NEXT: [[INC3:%.*]] = add i32 [[BF_LOAD]], 256
+// LE-NEXT: [[BF_SHL2:%.*]] = and i32 [[INC3]], 16776960
+// LE-NEXT: [[BF_CLEAR:%.*]] = and i32 [[BF_LOAD1]], -16776961
+// LE-NEXT: [[BF_SET:%.*]] = or i32 [[BF_CLEAR]], [[BF_SHL2]]
+// LE-NEXT: store volatile i32 [[BF_SET]], i32* [[TMP0]], align 4
+// LE-NEXT: ret void
+//
+// BE-LABEL: @increment_st12(
+// BE-NEXT: entry:
+// BE-NEXT: [[TMP0:%.*]] = bitcast %struct.st12* [[M:%.*]] to i32*
+// BE-NEXT: [[BF_LOAD:%.*]] = load volatile i32, i32* [[TMP0]], align 4
+// BE-NEXT: [[BF_LOAD1:%.*]] = load volatile i32, i32* [[TMP0]], align 4
+// BE-NEXT: [[INC3:%.*]] = add i32 [[BF_LOAD]], 256
+// BE-NEXT: [[BF_SHL2:%.*]] = and i32 [[INC3]], 16776960
+// BE-NEXT: [[BF_CLEAR:%.*]] = and i32 [[BF_LOAD1]], -16776961
+// BE-NEXT: [[BF_SET:%.*]] = or i32 [[BF_CLEAR]], [[BF_SHL2]]
+// BE-NEXT: store volatile i32 [[BF_SET]], i32* [[TMP0]], align 4
+// BE-NEXT: ret void
+//
+void increment_st12(volatile struct st12 *m) {
+ ++m->f;
+}
+
+// LE-LABEL: @increment_e_st12(
+// LE-NEXT: entry:
+// LE-NEXT: [[TMP0:%.*]] = bitcast %struct.st12* [[M:%.*]] to i32*
+// LE-NEXT: [[BF_LOAD:%.*]] = load volatile i32, i32* [[TMP0]], align 4
+// LE-NEXT: [[INC:%.*]] = add i32 [[BF_LOAD]], 1
+// LE-NEXT: [[BF_LOAD1:%.*]] = load volatile i32, i32* [[TMP0]], align 4
+// LE-NEXT: [[BF_VALUE:%.*]] = and i32 [[INC]], 255
+// LE-NEXT: [[BF_CLEAR:%.*]] = and i32 [[BF_LOAD1]], -256
+// LE-NEXT: [[BF_SET:%.*]] = or i32 [[BF_CLEAR]], [[BF_VALUE]]
+// LE-NEXT: store volatile i32 [[BF_SET]], i32* [[TMP0]], align 4
+// LE-NEXT: ret void
+//
+// BE-LABEL: @increment_e_st12(
+// BE-NEXT: entry:
+// BE-NEXT: [[TMP0:%.*]] = bitcast %struct.st12* [[M:%.*]] to i32*
+// BE-NEXT: [[BF_LOAD:%.*]] = load volatile i32, i32* [[TMP0]], align 4
+// BE-NEXT: [[BF_LOAD1:%.*]] = load volatile i32, i32* [[TMP0]], align 4
+// BE-NEXT: [[TMP1:%.*]] = add i32 [[BF_LOAD]], 16777216
+// BE-NEXT: [[BF_SHL:%.*]] = and i32 [[TMP1]], -16777216
+// BE-NEXT: [[BF_CLEAR:%.*]] = and i32 [[BF_LOAD1]], 16777215
+// BE-NEXT: [[BF_SET:%.*]] = or i32 [[BF_CLEAR]], [[BF_SHL]]
+// BE-NEXT: store volatile i32 [[BF_SET]], i32* [[TMP0]], align 4
+// BE-NEXT: ret void
+//
+void increment_e_st12(volatile struct st12 *m) {
+ ++m->e;
+}
diff --git a/src/llvm-project/clang/test/CodeGen/aarch64-branch-protection-attr.c b/src/llvm-project/clang/test/CodeGen/aarch64-branch-protection-attr.c
new file mode 100644
index 0000000..ee761d6
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/aarch64-branch-protection-attr.c
@@ -0,0 +1,81 @@
+// REQUIRES: aarch64-registered-target
+// RUN: %clang_cc1 -triple aarch64-unknown-unknown-eabi -emit-llvm -target-cpu generic -target-feature +v8.5a %s -o - \
+// RUN: | FileCheck %s --check-prefix=CHECK --check-prefix=NO-OVERRIDE
+// RUN: %clang_cc1 -triple aarch64-unknown-unknown-eabi -emit-llvm -target-cpu generic -target-feature +v8.5a %s -o - \
+// RUN: -msign-return-address=non-leaf -msign-return-address-key=a_key -mbranch-target-enforce \
+// RUN: | FileCheck %s --check-prefix=CHECK --check-prefix=OVERRIDE
+
+void missing() {}
+// NO-OVERRIDE: define void @missing() #[[#NONE:]]
+// OVERRIDE: define void @missing() #[[#STD:]]
+
+__attribute__ ((target("branch-protection=none")))
+void none() {}
+// NO-OVERRIDE: define void @none() #[[#NONE]]
+// OVERRIDE: define void @none() #[[#NONE:]]
+
+ __attribute__ ((target("branch-protection=standard")))
+void std() {}
+// NO-OVERRIDE: define void @std() #[[#STD:]]
+// OVERRIDE: define void @std() #[[#STD]]
+
+__attribute__ ((target("branch-protection=bti")))
+void btionly() {}
+// NO-OVERRIDE: define void @btionly() #[[#BTI:]]
+// OVERRIDE: define void @btionly() #[[#BTI:]]
+
+__attribute__ ((target("branch-protection=pac-ret")))
+void paconly() {}
+// NO-OVERRIDE: define void @paconly() #[[#PAC:]]
+// OVERRIDE: define void @paconly() #[[#PAC:]]
+
+__attribute__ ((target("branch-protection=pac-ret+bti")))
+void pacbti0() {}
+// NO-OVERRIDE: define void @pacbti0() #[[#PACBTI:]]
+// OVERRIDE: define void @pacbti0() #[[#PACBTI:]]
+
+__attribute__ ((target("branch-protection=bti+pac-ret")))
+void pacbti1() {}
+// NO-OVERRIDE: define void @pacbti1() #[[#PACBTI]]
+// OVERRIDE: define void @pacbti1() #[[#PACBTI]]
+
+__attribute__ ((target("branch-protection=pac-ret+leaf")))
+void leaf() {}
+// NO-OVERRIDE: define void @leaf() #[[#PACLEAF:]]
+// OVERRIDE: define void @leaf() #[[#PACLEAF:]]
+
+__attribute__ ((target("branch-protection=pac-ret+b-key")))
+void bkey() {}
+// NO-OVERRIDE: define void @bkey() #[[#PACBKEY:]]
+// OVERRIDE: define void @bkey() #[[#PACBKEY:]]
+
+__attribute__ ((target("branch-protection=pac-ret+b-key+leaf")))
+void bkeyleaf0() {}
+// NO-OVERRIDE: define void @bkeyleaf0() #[[#PACBKEYLEAF:]]
+// OVERRIDE: define void @bkeyleaf0() #[[#PACBKEYLEAF:]]
+
+__attribute__ ((target("branch-protection=pac-ret+leaf+b-key")))
+void bkeyleaf1() {}
+// NO-OVERRIDE: define void @bkeyleaf1() #[[#PACBKEYLEAF]]
+// OVERRIDE: define void @bkeyleaf1() #[[#PACBKEYLEAF]]
+
+__attribute__ ((target("branch-protection=pac-ret+leaf+bti")))
+void btileaf() {}
+// NO-OVERRIDE: define void @btileaf() #[[#BTIPACLEAF:]]
+// OVERRIDE: define void @btileaf() #[[#BTIPACLEAF:]]
+
+// CHECK-DAG: attributes #[[#NONE]]
+
+// CHECK-DAG: attributes #[[#STD]] = { {{.*}} "branch-target-enforcement" {{.*}} "sign-return-address"="non-leaf" "sign-return-address-key"="a_key"
+
+// CHECK-DAG: attributes #[[#BTI]] = { {{.*}}"branch-target-enforcement"
+
+// CHECK-DAG: attributes #[[#PAC]] = { {{.*}} "sign-return-address"="non-leaf" "sign-return-address-key"="a_key"
+
+// CHECK-DAG: attributes #[[#PACLEAF]] = { {{.*}} "sign-return-address"="all" "sign-return-address-key"="a_key"
+
+// CHECK-DAG: attributes #[[#PACBKEY]] = { {{.*}} "sign-return-address"="non-leaf" "sign-return-address-key"="b_key"
+
+// CHECK-DAG: attributes #[[#PACBKEYLEAF]] = { {{.*}} "sign-return-address"="all" "sign-return-address-key"="b_key"
+
+// CHECK-DAG: attributes #[[#BTIPACLEAF]] = { {{.*}}"branch-target-enforcement" {{.*}} "sign-return-address"="all" "sign-return-address-key"="a_key"
diff --git a/src/llvm-project/clang/test/CodeGen/aarch64-byval-temp.c b/src/llvm-project/clang/test/CodeGen/aarch64-byval-temp.c
new file mode 100644
index 0000000..f70f605
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/aarch64-byval-temp.c
@@ -0,0 +1,89 @@
+// RUN: %clang_cc1 -emit-llvm -triple arm64-- -o - %s -O0 | FileCheck %s --check-prefix=CHECK-O0
+// RUN: %clang_cc1 -emit-llvm -disable-llvm-optzns -triple arm64-- -o - %s -O3 | FileCheck %s --check-prefix=CHECK-O3
+
+struct large {
+ void* pointers[8];
+};
+
+void pass_large(struct large);
+
+// For arm64, we don't use byval to pass structs but instead we create
+// temporary allocas.
+//
+// Make sure we generate the appropriate lifetime markers for the temporary
+// allocas so that the optimizer can re-use stack slots if possible.
+void example() {
+ struct large l = {0};
+ pass_large(l);
+ pass_large(l);
+}
+// CHECK-O0-LABEL: define void @example(
+// The alloca for the struct on the stack.
+// CHECK-O0: %[[l:[0-9A-Za-z-]+]] = alloca %struct.large, align 8
+// The alloca for the temporary stack space that we use to pass the argument.
+// CHECK-O0-NEXT: %[[byvaltemp:[0-9A-Za-z-]+]] = alloca %struct.large, align 8
+// Another one to pass the argument to the second function call.
+// CHECK-O0-NEXT: %[[byvaltemp1:[0-9A-Za-z-]+]] = alloca %struct.large, align 8
+// First, memset `l` to 0.
+// CHECK-O0-NEXT: %[[bitcastl:[0-9A-Za-z-]+]] = bitcast %struct.large* %[[l]] to i8*
+// CHECK-O0-NEXT: call void @llvm.memset.p0i8.i64(i8* align 8 %[[bitcastl]], i8 0, i64 64, i1 false)
+// Then, memcpy `l` to the temporary stack space.
+// CHECK-O0-NEXT: %[[src:[0-9A-Za-z-]+]] = bitcast %struct.large* %[[byvaltemp]] to i8*
+// CHECK-O0-NEXT: %[[dst:[0-9A-Za-z-]+]] = bitcast %struct.large* %[[l]] to i8*
+// CHECK-O0-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %[[src]], i8* align 8 %[[dst]], i64 64, i1 false)
+// Finally, call using a pointer to the temporary stack space.
+// CHECK-O0-NEXT: call void @pass_large(%struct.large* %[[byvaltemp]])
+// Now, do the same for the second call, using the second temporary alloca.
+// CHECK-O0-NEXT: %[[src:[0-9A-Za-z-]+]] = bitcast %struct.large* %[[byvaltemp1]] to i8*
+// CHECK-O0-NEXT: %[[dst:[0-9A-Za-z-]+]] = bitcast %struct.large* %[[l]] to i8*
+// CHECK-O0-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %[[src]], i8* align 8 %[[dst]], i64 64, i1 false)
+// CHECK-O0-NEXT: call void @pass_large(%struct.large* %[[byvaltemp1]])
+// CHECK-O0-NEXT: ret void
+//
+// At O3, we should have lifetime markers to help the optimizer re-use the temporary allocas.
+//
+// CHECK-O3-LABEL: define void @example(
+// The alloca for the struct on the stack.
+// CHECK-O3: %[[l:[0-9A-Za-z-]+]] = alloca %struct.large, align 8
+// The alloca for the temporary stack space that we use to pass the argument.
+// CHECK-O3-NEXT: %[[byvaltemp:[0-9A-Za-z-]+]] = alloca %struct.large, align 8
+// Another one to pass the argument to the second function call.
+// CHECK-O3-NEXT: %[[byvaltemp1:[0-9A-Za-z-]+]] = alloca %struct.large, align 8
+//
+// Mark the start of the lifetime for `l`
+// CHECK-O3-NEXT: %[[bitcastl:[0-9A-Za-z-]+]] = bitcast %struct.large* %[[l]] to i8*
+// CHECK-O3-NEXT: call void @llvm.lifetime.start.p0i8(i64 64, i8* %[[bitcastl]])
+//
+// First, memset `l` to 0.
+// CHECK-O3-NEXT: %[[bitcastl:[0-9A-Za-z-]+]] = bitcast %struct.large* %[[l]] to i8*
+// CHECK-O3-NEXT: call void @llvm.memset.p0i8.i64(i8* align 8 %[[bitcastl]], i8 0, i64 64, i1 false)
+//
+// Lifetime of the first temporary starts here and ends right after the call.
+// CHECK-O3-NEXT: %[[bitcastbyvaltemp:[0-9A-Za-z-]+]] = bitcast %struct.large* %[[byvaltemp]] to i8*
+// CHECK-O3-NEXT: call void @llvm.lifetime.start.p0i8(i64 64, i8* %[[bitcastbyvaltemp]])
+//
+// Then, memcpy `l` to the temporary stack space.
+// CHECK-O3-NEXT: %[[src:[0-9A-Za-z-]+]] = bitcast %struct.large* %[[byvaltemp]] to i8*
+// CHECK-O3-NEXT: %[[dst:[0-9A-Za-z-]+]] = bitcast %struct.large* %[[l]] to i8*
+// CHECK-O3-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %[[src]], i8* align 8 %[[dst]], i64 64, i1 false)
+// Finally, call using a pointer to the temporary stack space.
+// CHECK-O3-NEXT: call void @pass_large(%struct.large* %[[byvaltemp]])
+//
+// The lifetime of the temporary used to pass a pointer to the struct ends here.
+// CHECK-O3-NEXT: %[[bitcastbyvaltemp:[0-9A-Za-z-]+]] = bitcast %struct.large* %[[byvaltemp]] to i8*
+// CHECK-O3-NEXT: call void @llvm.lifetime.end.p0i8(i64 64, i8* %[[bitcastbyvaltemp]])
+//
+// Now, do the same for the second call, using the second temporary alloca.
+// CHECK-O3-NEXT: %[[bitcastbyvaltemp:[0-9A-Za-z-]+]] = bitcast %struct.large* %[[byvaltemp1]] to i8*
+// CHECK-O3-NEXT: call void @llvm.lifetime.start.p0i8(i64 64, i8* %[[bitcastbyvaltemp]])
+// CHECK-O3-NEXT: %[[src:[0-9A-Za-z-]+]] = bitcast %struct.large* %[[byvaltemp1]] to i8*
+// CHECK-O3-NEXT: %[[dst:[0-9A-Za-z-]+]] = bitcast %struct.large* %[[l]] to i8*
+// CHECK-O3-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %[[src]], i8* align 8 %[[dst]], i64 64, i1 false)
+// CHECK-O3-NEXT: call void @pass_large(%struct.large* %[[byvaltemp1]])
+// CHECK-O3-NEXT: %[[bitcastbyvaltemp:[0-9A-Za-z-]+]] = bitcast %struct.large* %[[byvaltemp1]] to i8*
+// CHECK-O3-NEXT: call void @llvm.lifetime.end.p0i8(i64 64, i8* %[[bitcastbyvaltemp]])
+//
+// Mark the end of the lifetime of `l`.
+// CHECK-O3-NEXT: %[[bitcastl:[0-9A-Za-z-]+]] = bitcast %struct.large* %l to i8*
+// CHECK-O3-NEXT: call void @llvm.lifetime.end.p0i8(i64 64, i8* %[[bitcastl]])
+// CHECK-O3-NEXT: ret void
diff --git a/src/llvm-project/clang/test/CodeGen/aarch64-neon-2velem.c b/src/llvm-project/clang/test/CodeGen/aarch64-neon-2velem.c
index 320ce02..915c38c 100644
--- a/src/llvm-project/clang/test/CodeGen/aarch64-neon-2velem.c
+++ b/src/llvm-project/clang/test/CodeGen/aarch64-neon-2velem.c
@@ -333,7 +333,7 @@
}
// CHECK-LABEL: @test_vfms_lane_f32(
-// CHECK: [[SUB:%.*]] = fsub <2 x float> <float -0.000000e+00, float -0.000000e+00>, %b
+// CHECK: [[SUB:%.*]] = fneg <2 x float> %b
// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <2 x float> [[SUB]] to <8 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <2 x float> %v to <8 x i8>
@@ -348,7 +348,7 @@
}
// CHECK-LABEL: @test_vfmsq_lane_f32(
-// CHECK: [[SUB:%.*]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %b
+// CHECK: [[SUB:%.*]] = fneg <4 x float> %b
// CHECK: [[TMP0:%.*]] = bitcast <4 x float> %a to <16 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <4 x float> [[SUB]] to <16 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <2 x float> %v to <8 x i8>
@@ -363,7 +363,7 @@
}
// CHECK-LABEL: @test_vfms_laneq_f32(
-// CHECK: [[SUB:%.*]] = fsub <2 x float> <float -0.000000e+00, float -0.000000e+00>, %b
+// CHECK: [[SUB:%.*]] = fneg <2 x float> %b
// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <2 x float> [[SUB]] to <8 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <4 x float> %v to <16 x i8>
@@ -378,7 +378,7 @@
}
// CHECK-LABEL: @test_vfmsq_laneq_f32(
-// CHECK: [[SUB:%.*]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %b
+// CHECK: [[SUB:%.*]] = fneg <4 x float> %b
// CHECK: [[TMP0:%.*]] = bitcast <4 x float> %a to <16 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <4 x float> [[SUB]] to <16 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <4 x float> %v to <16 x i8>
@@ -421,7 +421,7 @@
}
// CHECK-LABEL: @test_vfmsq_lane_f64(
-// CHECK: [[SUB:%.*]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %b
+// CHECK: [[SUB:%.*]] = fneg <2 x double> %b
// CHECK: [[TMP0:%.*]] = bitcast <2 x double> %a to <16 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <2 x double> [[SUB]] to <16 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <1 x double> %v to <8 x i8>
@@ -436,7 +436,7 @@
}
// CHECK-LABEL: @test_vfmsq_laneq_f64(
-// CHECK: [[SUB:%.*]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %b
+// CHECK: [[SUB:%.*]] = fneg <2 x double> %b
// CHECK: [[TMP0:%.*]] = bitcast <2 x double> %a to <16 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <2 x double> [[SUB]] to <16 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <2 x double> %v to <16 x i8>
@@ -451,9 +451,7 @@
}
// CHECK-LABEL: @test_vfmas_laneq_f32(
-// CHECK: [[TMP0:%.*]] = bitcast <4 x float> %v to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x float>
-// CHECK: [[EXTRACT:%.*]] = extractelement <4 x float> [[TMP1]], i32 3
+// CHECK: [[EXTRACT:%.*]] = extractelement <4 x float> %v, i32 3
// CHECK: [[TMP2:%.*]] = call float @llvm.fma.f32(float %b, float [[EXTRACT]], float %a)
// CHECK: ret float [[TMP2]]
float32_t test_vfmas_laneq_f32(float32_t a, float32_t b, float32x4_t v) {
@@ -461,10 +459,8 @@
}
// CHECK-LABEL: @test_vfmsd_lane_f64(
-// CHECK: [[SUB:%.*]] = fsub double -0.000000e+00, %b
-// CHECK: [[TMP0:%.*]] = bitcast <1 x double> %v to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x double>
-// CHECK: [[EXTRACT:%.*]] = extractelement <1 x double> [[TMP1]], i32 0
+// CHECK: [[SUB:%.*]] = fneg double %b
+// CHECK: [[EXTRACT:%.*]] = extractelement <1 x double> %v, i32 0
// CHECK: [[TMP2:%.*]] = call double @llvm.fma.f64(double [[SUB]], double [[EXTRACT]], double %a)
// CHECK: ret double [[TMP2]]
float64_t test_vfmsd_lane_f64(float64_t a, float64_t b, float64x1_t v) {
@@ -472,10 +468,8 @@
}
// CHECK-LABEL: @test_vfmss_laneq_f32(
-// CHECK: [[SUB:%.*]] = fsub float -0.000000e+00, %b
-// CHECK: [[TMP0:%.*]] = bitcast <4 x float> %v to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x float>
-// CHECK: [[EXTRACT:%.*]] = extractelement <4 x float> [[TMP1]], i32 3
+// CHECK: [[SUB:%.*]] = fneg float %b
+// CHECK: [[EXTRACT:%.*]] = extractelement <4 x float> %v, i32 3
// CHECK: [[TMP2:%.*]] = call float @llvm.fma.f32(float [[SUB]], float [[EXTRACT]], float %a)
// CHECK: ret float [[TMP2]]
float32_t test_vfmss_laneq_f32(float32_t a, float32_t b, float32x4_t v) {
@@ -483,10 +477,8 @@
}
// CHECK-LABEL: @test_vfmsd_laneq_f64(
-// CHECK: [[SUB:%.*]] = fsub double -0.000000e+00, %b
-// CHECK: [[TMP0:%.*]] = bitcast <2 x double> %v to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x double>
-// CHECK: [[EXTRACT:%.*]] = extractelement <2 x double> [[TMP1]], i32 1
+// CHECK: [[SUB:%.*]] = fneg double %b
+// CHECK: [[EXTRACT:%.*]] = extractelement <2 x double> %v, i32 1
// CHECK: [[TMP2:%.*]] = call double @llvm.fma.f64(double [[SUB]], double [[EXTRACT]], double %a)
// CHECK: ret double [[TMP2]]
float64_t test_vfmsd_laneq_f64(float64_t a, float64_t b, float64x2_t v) {
@@ -1775,7 +1767,7 @@
}
// CHECK-LABEL: @test_vfms_lane_f32_0(
-// CHECK: [[SUB:%.*]] = fsub <2 x float> <float -0.000000e+00, float -0.000000e+00>, %b
+// CHECK: [[SUB:%.*]] = fneg <2 x float> %b
// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <2 x float> [[SUB]] to <8 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <2 x float> %v to <8 x i8>
@@ -1790,7 +1782,7 @@
}
// CHECK-LABEL: @test_vfmsq_lane_f32_0(
-// CHECK: [[SUB:%.*]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %b
+// CHECK: [[SUB:%.*]] = fneg <4 x float> %b
// CHECK: [[TMP0:%.*]] = bitcast <4 x float> %a to <16 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <4 x float> [[SUB]] to <16 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <2 x float> %v to <8 x i8>
@@ -1805,7 +1797,7 @@
}
// CHECK-LABEL: @test_vfms_laneq_f32_0(
-// CHECK: [[SUB:%.*]] = fsub <2 x float> <float -0.000000e+00, float -0.000000e+00>, %b
+// CHECK: [[SUB:%.*]] = fneg <2 x float> %b
// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <2 x float> [[SUB]] to <8 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <4 x float> %v to <16 x i8>
@@ -1820,7 +1812,7 @@
}
// CHECK-LABEL: @test_vfmsq_laneq_f32_0(
-// CHECK: [[SUB:%.*]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %b
+// CHECK: [[SUB:%.*]] = fneg <4 x float> %b
// CHECK: [[TMP0:%.*]] = bitcast <4 x float> %a to <16 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <4 x float> [[SUB]] to <16 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <4 x float> %v to <16 x i8>
@@ -1849,7 +1841,7 @@
}
// CHECK-LABEL: @test_vfmsq_laneq_f64_0(
-// CHECK: [[SUB:%.*]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %b
+// CHECK: [[SUB:%.*]] = fneg <2 x double> %b
// CHECK: [[TMP0:%.*]] = bitcast <2 x double> %a to <16 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <2 x double> [[SUB]] to <16 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <2 x double> %v to <16 x i8>
@@ -2792,11 +2784,11 @@
// CHECK-LABEL: @test_vmull_high_n_s16(
// CHECK: [[SHUFFLE_I_I:%.*]] = shufflevector <8 x i16> %a, <8 x i16> %a, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> [[SHUFFLE_I_I]] to <8 x i8>
// CHECK: [[VECINIT_I_I:%.*]] = insertelement <4 x i16> undef, i16 %b, i32 0
// CHECK: [[VECINIT1_I_I:%.*]] = insertelement <4 x i16> [[VECINIT_I_I]], i16 %b, i32 1
// CHECK: [[VECINIT2_I_I:%.*]] = insertelement <4 x i16> [[VECINIT1_I_I]], i16 %b, i32 2
// CHECK: [[VECINIT3_I_I:%.*]] = insertelement <4 x i16> [[VECINIT2_I_I]], i16 %b, i32 3
+// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> [[SHUFFLE_I_I]] to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <4 x i16> [[VECINIT3_I_I]] to <8 x i8>
// CHECK: [[VMULL5_I_I:%.*]] = call <4 x i32> @llvm.aarch64.neon.smull.v4i32(<4 x i16> [[SHUFFLE_I_I]], <4 x i16> [[VECINIT3_I_I]])
// CHECK: ret <4 x i32> [[VMULL5_I_I]]
@@ -2806,9 +2798,9 @@
// CHECK-LABEL: @test_vmull_high_n_s32(
// CHECK: [[SHUFFLE_I_I:%.*]] = shufflevector <4 x i32> %a, <4 x i32> %a, <2 x i32> <i32 2, i32 3>
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> [[SHUFFLE_I_I]] to <8 x i8>
// CHECK: [[VECINIT_I_I:%.*]] = insertelement <2 x i32> undef, i32 %b, i32 0
// CHECK: [[VECINIT1_I_I:%.*]] = insertelement <2 x i32> [[VECINIT_I_I]], i32 %b, i32 1
+// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> [[SHUFFLE_I_I]] to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <2 x i32> [[VECINIT1_I_I]] to <8 x i8>
// CHECK: [[VMULL3_I_I:%.*]] = call <2 x i64> @llvm.aarch64.neon.smull.v2i64(<2 x i32> [[SHUFFLE_I_I]], <2 x i32> [[VECINIT1_I_I]])
// CHECK: ret <2 x i64> [[VMULL3_I_I]]
@@ -2818,11 +2810,11 @@
// CHECK-LABEL: @test_vmull_high_n_u16(
// CHECK: [[SHUFFLE_I_I:%.*]] = shufflevector <8 x i16> %a, <8 x i16> %a, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> [[SHUFFLE_I_I]] to <8 x i8>
// CHECK: [[VECINIT_I_I:%.*]] = insertelement <4 x i16> undef, i16 %b, i32 0
// CHECK: [[VECINIT1_I_I:%.*]] = insertelement <4 x i16> [[VECINIT_I_I]], i16 %b, i32 1
// CHECK: [[VECINIT2_I_I:%.*]] = insertelement <4 x i16> [[VECINIT1_I_I]], i16 %b, i32 2
// CHECK: [[VECINIT3_I_I:%.*]] = insertelement <4 x i16> [[VECINIT2_I_I]], i16 %b, i32 3
+// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> [[SHUFFLE_I_I]] to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <4 x i16> [[VECINIT3_I_I]] to <8 x i8>
// CHECK: [[VMULL5_I_I:%.*]] = call <4 x i32> @llvm.aarch64.neon.umull.v4i32(<4 x i16> [[SHUFFLE_I_I]], <4 x i16> [[VECINIT3_I_I]])
// CHECK: ret <4 x i32> [[VMULL5_I_I]]
@@ -2832,9 +2824,9 @@
// CHECK-LABEL: @test_vmull_high_n_u32(
// CHECK: [[SHUFFLE_I_I:%.*]] = shufflevector <4 x i32> %a, <4 x i32> %a, <2 x i32> <i32 2, i32 3>
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> [[SHUFFLE_I_I]] to <8 x i8>
// CHECK: [[VECINIT_I_I:%.*]] = insertelement <2 x i32> undef, i32 %b, i32 0
// CHECK: [[VECINIT1_I_I:%.*]] = insertelement <2 x i32> [[VECINIT_I_I]], i32 %b, i32 1
+// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> [[SHUFFLE_I_I]] to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <2 x i32> [[VECINIT1_I_I]] to <8 x i8>
// CHECK: [[VMULL3_I_I:%.*]] = call <2 x i64> @llvm.aarch64.neon.umull.v2i64(<2 x i32> [[SHUFFLE_I_I]], <2 x i32> [[VECINIT1_I_I]])
// CHECK: ret <2 x i64> [[VMULL3_I_I]]
@@ -2844,11 +2836,11 @@
// CHECK-LABEL: @test_vqdmull_high_n_s16(
// CHECK: [[SHUFFLE_I_I:%.*]] = shufflevector <8 x i16> %a, <8 x i16> %a, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> [[SHUFFLE_I_I]] to <8 x i8>
// CHECK: [[VECINIT_I_I:%.*]] = insertelement <4 x i16> undef, i16 %b, i32 0
// CHECK: [[VECINIT1_I_I:%.*]] = insertelement <4 x i16> [[VECINIT_I_I]], i16 %b, i32 1
// CHECK: [[VECINIT2_I_I:%.*]] = insertelement <4 x i16> [[VECINIT1_I_I]], i16 %b, i32 2
// CHECK: [[VECINIT3_I_I:%.*]] = insertelement <4 x i16> [[VECINIT2_I_I]], i16 %b, i32 3
+// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> [[SHUFFLE_I_I]] to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <4 x i16> [[VECINIT3_I_I]] to <8 x i8>
// CHECK: [[VQDMULL_V5_I_I:%.*]] = call <4 x i32> @llvm.aarch64.neon.sqdmull.v4i32(<4 x i16> [[SHUFFLE_I_I]], <4 x i16> [[VECINIT3_I_I]])
// CHECK: [[VQDMULL_V6_I_I:%.*]] = bitcast <4 x i32> [[VQDMULL_V5_I_I]] to <16 x i8>
@@ -2859,9 +2851,9 @@
// CHECK-LABEL: @test_vqdmull_high_n_s32(
// CHECK: [[SHUFFLE_I_I:%.*]] = shufflevector <4 x i32> %a, <4 x i32> %a, <2 x i32> <i32 2, i32 3>
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> [[SHUFFLE_I_I]] to <8 x i8>
// CHECK: [[VECINIT_I_I:%.*]] = insertelement <2 x i32> undef, i32 %b, i32 0
// CHECK: [[VECINIT1_I_I:%.*]] = insertelement <2 x i32> [[VECINIT_I_I]], i32 %b, i32 1
+// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> [[SHUFFLE_I_I]] to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <2 x i32> [[VECINIT1_I_I]] to <8 x i8>
// CHECK: [[VQDMULL_V3_I_I:%.*]] = call <2 x i64> @llvm.aarch64.neon.sqdmull.v2i64(<2 x i32> [[SHUFFLE_I_I]], <2 x i32> [[VECINIT1_I_I]])
// CHECK: [[VQDMULL_V4_I_I:%.*]] = bitcast <2 x i64> [[VQDMULL_V3_I_I]] to <16 x i8>
@@ -2928,12 +2920,12 @@
// CHECK-LABEL: @test_vqdmlal_high_n_s16(
// CHECK: [[SHUFFLE_I_I:%.*]] = shufflevector <8 x i16> %b, <8 x i16> %b, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %a to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <4 x i16> [[SHUFFLE_I_I]] to <8 x i8>
// CHECK: [[VECINIT_I_I:%.*]] = insertelement <4 x i16> undef, i16 %c, i32 0
// CHECK: [[VECINIT1_I_I:%.*]] = insertelement <4 x i16> [[VECINIT_I_I]], i16 %c, i32 1
// CHECK: [[VECINIT2_I_I:%.*]] = insertelement <4 x i16> [[VECINIT1_I_I]], i16 %c, i32 2
// CHECK: [[VECINIT3_I_I:%.*]] = insertelement <4 x i16> [[VECINIT2_I_I]], i16 %c, i32 3
+// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %a to <16 x i8>
+// CHECK: [[TMP1:%.*]] = bitcast <4 x i16> [[SHUFFLE_I_I]] to <8 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <4 x i16> [[VECINIT3_I_I]] to <8 x i8>
// CHECK: [[VQDMLAL5_I_I:%.*]] = call <4 x i32> @llvm.aarch64.neon.sqdmull.v4i32(<4 x i16> [[SHUFFLE_I_I]], <4 x i16> [[VECINIT3_I_I]])
// CHECK: [[VQDMLAL_V6_I_I:%.*]] = call <4 x i32> @llvm.aarch64.neon.sqadd.v4i32(<4 x i32> %a, <4 x i32> [[VQDMLAL5_I_I]])
@@ -2944,10 +2936,10 @@
// CHECK-LABEL: @test_vqdmlal_high_n_s32(
// CHECK: [[SHUFFLE_I_I:%.*]] = shufflevector <4 x i32> %b, <4 x i32> %b, <2 x i32> <i32 2, i32 3>
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %a to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <2 x i32> [[SHUFFLE_I_I]] to <8 x i8>
// CHECK: [[VECINIT_I_I:%.*]] = insertelement <2 x i32> undef, i32 %c, i32 0
// CHECK: [[VECINIT1_I_I:%.*]] = insertelement <2 x i32> [[VECINIT_I_I]], i32 %c, i32 1
+// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %a to <16 x i8>
+// CHECK: [[TMP1:%.*]] = bitcast <2 x i32> [[SHUFFLE_I_I]] to <8 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <2 x i32> [[VECINIT1_I_I]] to <8 x i8>
// CHECK: [[VQDMLAL3_I_I:%.*]] = call <2 x i64> @llvm.aarch64.neon.sqdmull.v2i64(<2 x i32> [[SHUFFLE_I_I]], <2 x i32> [[VECINIT1_I_I]])
// CHECK: [[VQDMLAL_V4_I_I:%.*]] = call <2 x i64> @llvm.aarch64.neon.sqadd.v2i64(<2 x i64> %a, <2 x i64> [[VQDMLAL3_I_I]])
@@ -3014,12 +3006,12 @@
// CHECK-LABEL: @test_vqdmlsl_high_n_s16(
// CHECK: [[SHUFFLE_I_I:%.*]] = shufflevector <8 x i16> %b, <8 x i16> %b, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %a to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <4 x i16> [[SHUFFLE_I_I]] to <8 x i8>
// CHECK: [[VECINIT_I_I:%.*]] = insertelement <4 x i16> undef, i16 %c, i32 0
// CHECK: [[VECINIT1_I_I:%.*]] = insertelement <4 x i16> [[VECINIT_I_I]], i16 %c, i32 1
// CHECK: [[VECINIT2_I_I:%.*]] = insertelement <4 x i16> [[VECINIT1_I_I]], i16 %c, i32 2
// CHECK: [[VECINIT3_I_I:%.*]] = insertelement <4 x i16> [[VECINIT2_I_I]], i16 %c, i32 3
+// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %a to <16 x i8>
+// CHECK: [[TMP1:%.*]] = bitcast <4 x i16> [[SHUFFLE_I_I]] to <8 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <4 x i16> [[VECINIT3_I_I]] to <8 x i8>
// CHECK: [[VQDMLAL5_I_I:%.*]] = call <4 x i32> @llvm.aarch64.neon.sqdmull.v4i32(<4 x i16> [[SHUFFLE_I_I]], <4 x i16> [[VECINIT3_I_I]])
// CHECK: [[VQDMLSL_V6_I_I:%.*]] = call <4 x i32> @llvm.aarch64.neon.sqsub.v4i32(<4 x i32> %a, <4 x i32> [[VQDMLAL5_I_I]])
@@ -3030,10 +3022,10 @@
// CHECK-LABEL: @test_vqdmlsl_high_n_s32(
// CHECK: [[SHUFFLE_I_I:%.*]] = shufflevector <4 x i32> %b, <4 x i32> %b, <2 x i32> <i32 2, i32 3>
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %a to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <2 x i32> [[SHUFFLE_I_I]] to <8 x i8>
// CHECK: [[VECINIT_I_I:%.*]] = insertelement <2 x i32> undef, i32 %c, i32 0
// CHECK: [[VECINIT1_I_I:%.*]] = insertelement <2 x i32> [[VECINIT_I_I]], i32 %c, i32 1
+// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %a to <16 x i8>
+// CHECK: [[TMP1:%.*]] = bitcast <2 x i32> [[SHUFFLE_I_I]] to <8 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <2 x i32> [[VECINIT1_I_I]] to <8 x i8>
// CHECK: [[VQDMLAL3_I_I:%.*]] = call <2 x i64> @llvm.aarch64.neon.sqdmull.v2i64(<2 x i32> [[SHUFFLE_I_I]], <2 x i32> [[VECINIT1_I_I]])
// CHECK: [[VQDMLSL_V4_I_I:%.*]] = call <2 x i64> @llvm.aarch64.neon.sqsub.v2i64(<2 x i64> %a, <2 x i64> [[VQDMLAL3_I_I]])
@@ -3109,7 +3101,7 @@
}
// CHECK-LABEL: @test_vfms_n_f32(
-// CHECK: [[SUB_I:%.*]] = fsub <2 x float> <float -0.000000e+00, float -0.000000e+00>, %b
+// CHECK: [[SUB_I:%.*]] = fneg <2 x float> %b
// CHECK: [[VECINIT_I:%.*]] = insertelement <2 x float> undef, float %n, i32 0
// CHECK: [[VECINIT1_I:%.*]] = insertelement <2 x float> [[VECINIT_I]], float %n, i32 1
// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %a to <8 x i8>
@@ -3122,7 +3114,7 @@
}
// CHECK-LABEL: @test_vfms_n_f64(
-// CHECK: [[SUB_I:%.*]] = fsub <1 x double> <double -0.000000e+00>, %b
+// CHECK: [[SUB_I:%.*]] = fneg <1 x double> %b
// CHECK: [[VECINIT_I:%.*]] = insertelement <1 x double> undef, double %n, i32 0
// CHECK: [[TMP0:%.*]] = bitcast <1 x double> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <1 x double> [[SUB_I]] to <8 x i8>
@@ -3134,7 +3126,7 @@
}
// CHECK-LABEL: @test_vfmsq_n_f32(
-// CHECK: [[SUB_I:%.*]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %b
+// CHECK: [[SUB_I:%.*]] = fneg <4 x float> %b
// CHECK: [[VECINIT_I:%.*]] = insertelement <4 x float> undef, float %n, i32 0
// CHECK: [[VECINIT1_I:%.*]] = insertelement <4 x float> [[VECINIT_I]], float %n, i32 1
// CHECK: [[VECINIT2_I:%.*]] = insertelement <4 x float> [[VECINIT1_I]], float %n, i32 2
@@ -3241,11 +3233,11 @@
}
// CHECK-LABEL: @test_vmull_n_s16(
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %a to <8 x i8>
// CHECK: [[VECINIT_I:%.*]] = insertelement <4 x i16> undef, i16 %b, i32 0
// CHECK: [[VECINIT1_I:%.*]] = insertelement <4 x i16> [[VECINIT_I]], i16 %b, i32 1
// CHECK: [[VECINIT2_I:%.*]] = insertelement <4 x i16> [[VECINIT1_I]], i16 %b, i32 2
// CHECK: [[VECINIT3_I:%.*]] = insertelement <4 x i16> [[VECINIT2_I]], i16 %b, i32 3
+// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <4 x i16> [[VECINIT3_I]] to <8 x i8>
// CHECK: [[VMULL5_I:%.*]] = call <4 x i32> @llvm.aarch64.neon.smull.v4i32(<4 x i16> %a, <4 x i16> [[VECINIT3_I]])
// CHECK: ret <4 x i32> [[VMULL5_I]]
@@ -3254,9 +3246,9 @@
}
// CHECK-LABEL: @test_vmull_n_s32(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8>
// CHECK: [[VECINIT_I:%.*]] = insertelement <2 x i32> undef, i32 %b, i32 0
// CHECK: [[VECINIT1_I:%.*]] = insertelement <2 x i32> [[VECINIT_I]], i32 %b, i32 1
+// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <2 x i32> [[VECINIT1_I]] to <8 x i8>
// CHECK: [[VMULL3_I:%.*]] = call <2 x i64> @llvm.aarch64.neon.smull.v2i64(<2 x i32> %a, <2 x i32> [[VECINIT1_I]])
// CHECK: ret <2 x i64> [[VMULL3_I]]
@@ -3265,11 +3257,11 @@
}
// CHECK-LABEL: @test_vmull_n_u16(
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %a to <8 x i8>
// CHECK: [[VECINIT_I:%.*]] = insertelement <4 x i16> undef, i16 %b, i32 0
// CHECK: [[VECINIT1_I:%.*]] = insertelement <4 x i16> [[VECINIT_I]], i16 %b, i32 1
// CHECK: [[VECINIT2_I:%.*]] = insertelement <4 x i16> [[VECINIT1_I]], i16 %b, i32 2
// CHECK: [[VECINIT3_I:%.*]] = insertelement <4 x i16> [[VECINIT2_I]], i16 %b, i32 3
+// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <4 x i16> [[VECINIT3_I]] to <8 x i8>
// CHECK: [[VMULL5_I:%.*]] = call <4 x i32> @llvm.aarch64.neon.umull.v4i32(<4 x i16> %a, <4 x i16> [[VECINIT3_I]])
// CHECK: ret <4 x i32> [[VMULL5_I]]
@@ -3278,9 +3270,9 @@
}
// CHECK-LABEL: @test_vmull_n_u32(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8>
// CHECK: [[VECINIT_I:%.*]] = insertelement <2 x i32> undef, i32 %b, i32 0
// CHECK: [[VECINIT1_I:%.*]] = insertelement <2 x i32> [[VECINIT_I]], i32 %b, i32 1
+// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <2 x i32> [[VECINIT1_I]] to <8 x i8>
// CHECK: [[VMULL3_I:%.*]] = call <2 x i64> @llvm.aarch64.neon.umull.v2i64(<2 x i32> %a, <2 x i32> [[VECINIT1_I]])
// CHECK: ret <2 x i64> [[VMULL3_I]]
@@ -3289,11 +3281,11 @@
}
// CHECK-LABEL: @test_vqdmull_n_s16(
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %a to <8 x i8>
// CHECK: [[VECINIT_I:%.*]] = insertelement <4 x i16> undef, i16 %b, i32 0
// CHECK: [[VECINIT1_I:%.*]] = insertelement <4 x i16> [[VECINIT_I]], i16 %b, i32 1
// CHECK: [[VECINIT2_I:%.*]] = insertelement <4 x i16> [[VECINIT1_I]], i16 %b, i32 2
// CHECK: [[VECINIT3_I:%.*]] = insertelement <4 x i16> [[VECINIT2_I]], i16 %b, i32 3
+// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <4 x i16> [[VECINIT3_I]] to <8 x i8>
// CHECK: [[VQDMULL_V5_I:%.*]] = call <4 x i32> @llvm.aarch64.neon.sqdmull.v4i32(<4 x i16> %a, <4 x i16> [[VECINIT3_I]])
// CHECK: [[VQDMULL_V6_I:%.*]] = bitcast <4 x i32> [[VQDMULL_V5_I]] to <16 x i8>
@@ -3303,9 +3295,9 @@
}
// CHECK-LABEL: @test_vqdmull_n_s32(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8>
// CHECK: [[VECINIT_I:%.*]] = insertelement <2 x i32> undef, i32 %b, i32 0
// CHECK: [[VECINIT1_I:%.*]] = insertelement <2 x i32> [[VECINIT_I]], i32 %b, i32 1
+// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <2 x i32> [[VECINIT1_I]] to <8 x i8>
// CHECK: [[VQDMULL_V3_I:%.*]] = call <2 x i64> @llvm.aarch64.neon.sqdmull.v2i64(<2 x i32> %a, <2 x i32> [[VECINIT1_I]])
// CHECK: [[VQDMULL_V4_I:%.*]] = bitcast <2 x i64> [[VQDMULL_V3_I]] to <16 x i8>
@@ -3315,11 +3307,11 @@
}
// CHECK-LABEL: @test_vqdmulh_n_s16(
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %a to <8 x i8>
// CHECK: [[VECINIT_I:%.*]] = insertelement <4 x i16> undef, i16 %b, i32 0
// CHECK: [[VECINIT1_I:%.*]] = insertelement <4 x i16> [[VECINIT_I]], i16 %b, i32 1
// CHECK: [[VECINIT2_I:%.*]] = insertelement <4 x i16> [[VECINIT1_I]], i16 %b, i32 2
// CHECK: [[VECINIT3_I:%.*]] = insertelement <4 x i16> [[VECINIT2_I]], i16 %b, i32 3
+// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <4 x i16> [[VECINIT3_I]] to <8 x i8>
// CHECK: [[VQDMULH_V5_I:%.*]] = call <4 x i16> @llvm.aarch64.neon.sqdmulh.v4i16(<4 x i16> %a, <4 x i16> [[VECINIT3_I]])
// CHECK: [[VQDMULH_V6_I:%.*]] = bitcast <4 x i16> [[VQDMULH_V5_I]] to <8 x i8>
@@ -3329,7 +3321,6 @@
}
// CHECK-LABEL: @test_vqdmulhq_n_s16(
-// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %a to <16 x i8>
// CHECK: [[VECINIT_I:%.*]] = insertelement <8 x i16> undef, i16 %b, i32 0
// CHECK: [[VECINIT1_I:%.*]] = insertelement <8 x i16> [[VECINIT_I]], i16 %b, i32 1
// CHECK: [[VECINIT2_I:%.*]] = insertelement <8 x i16> [[VECINIT1_I]], i16 %b, i32 2
@@ -3338,6 +3329,7 @@
// CHECK: [[VECINIT5_I:%.*]] = insertelement <8 x i16> [[VECINIT4_I]], i16 %b, i32 5
// CHECK: [[VECINIT6_I:%.*]] = insertelement <8 x i16> [[VECINIT5_I]], i16 %b, i32 6
// CHECK: [[VECINIT7_I:%.*]] = insertelement <8 x i16> [[VECINIT6_I]], i16 %b, i32 7
+// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %a to <16 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <8 x i16> [[VECINIT7_I]] to <16 x i8>
// CHECK: [[VQDMULHQ_V9_I:%.*]] = call <8 x i16> @llvm.aarch64.neon.sqdmulh.v8i16(<8 x i16> %a, <8 x i16> [[VECINIT7_I]])
// CHECK: [[VQDMULHQ_V10_I:%.*]] = bitcast <8 x i16> [[VQDMULHQ_V9_I]] to <16 x i8>
@@ -3347,9 +3339,9 @@
}
// CHECK-LABEL: @test_vqdmulh_n_s32(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8>
// CHECK: [[VECINIT_I:%.*]] = insertelement <2 x i32> undef, i32 %b, i32 0
// CHECK: [[VECINIT1_I:%.*]] = insertelement <2 x i32> [[VECINIT_I]], i32 %b, i32 1
+// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <2 x i32> [[VECINIT1_I]] to <8 x i8>
// CHECK: [[VQDMULH_V3_I:%.*]] = call <2 x i32> @llvm.aarch64.neon.sqdmulh.v2i32(<2 x i32> %a, <2 x i32> [[VECINIT1_I]])
// CHECK: [[VQDMULH_V4_I:%.*]] = bitcast <2 x i32> [[VQDMULH_V3_I]] to <8 x i8>
@@ -3359,11 +3351,11 @@
}
// CHECK-LABEL: @test_vqdmulhq_n_s32(
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %a to <16 x i8>
// CHECK: [[VECINIT_I:%.*]] = insertelement <4 x i32> undef, i32 %b, i32 0
// CHECK: [[VECINIT1_I:%.*]] = insertelement <4 x i32> [[VECINIT_I]], i32 %b, i32 1
// CHECK: [[VECINIT2_I:%.*]] = insertelement <4 x i32> [[VECINIT1_I]], i32 %b, i32 2
// CHECK: [[VECINIT3_I:%.*]] = insertelement <4 x i32> [[VECINIT2_I]], i32 %b, i32 3
+// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %a to <16 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <4 x i32> [[VECINIT3_I]] to <16 x i8>
// CHECK: [[VQDMULHQ_V5_I:%.*]] = call <4 x i32> @llvm.aarch64.neon.sqdmulh.v4i32(<4 x i32> %a, <4 x i32> [[VECINIT3_I]])
// CHECK: [[VQDMULHQ_V6_I:%.*]] = bitcast <4 x i32> [[VQDMULHQ_V5_I]] to <16 x i8>
@@ -3373,11 +3365,11 @@
}
// CHECK-LABEL: @test_vqrdmulh_n_s16(
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %a to <8 x i8>
// CHECK: [[VECINIT_I:%.*]] = insertelement <4 x i16> undef, i16 %b, i32 0
// CHECK: [[VECINIT1_I:%.*]] = insertelement <4 x i16> [[VECINIT_I]], i16 %b, i32 1
// CHECK: [[VECINIT2_I:%.*]] = insertelement <4 x i16> [[VECINIT1_I]], i16 %b, i32 2
// CHECK: [[VECINIT3_I:%.*]] = insertelement <4 x i16> [[VECINIT2_I]], i16 %b, i32 3
+// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <4 x i16> [[VECINIT3_I]] to <8 x i8>
// CHECK: [[VQRDMULH_V5_I:%.*]] = call <4 x i16> @llvm.aarch64.neon.sqrdmulh.v4i16(<4 x i16> %a, <4 x i16> [[VECINIT3_I]])
// CHECK: [[VQRDMULH_V6_I:%.*]] = bitcast <4 x i16> [[VQRDMULH_V5_I]] to <8 x i8>
@@ -3387,7 +3379,6 @@
}
// CHECK-LABEL: @test_vqrdmulhq_n_s16(
-// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %a to <16 x i8>
// CHECK: [[VECINIT_I:%.*]] = insertelement <8 x i16> undef, i16 %b, i32 0
// CHECK: [[VECINIT1_I:%.*]] = insertelement <8 x i16> [[VECINIT_I]], i16 %b, i32 1
// CHECK: [[VECINIT2_I:%.*]] = insertelement <8 x i16> [[VECINIT1_I]], i16 %b, i32 2
@@ -3396,6 +3387,7 @@
// CHECK: [[VECINIT5_I:%.*]] = insertelement <8 x i16> [[VECINIT4_I]], i16 %b, i32 5
// CHECK: [[VECINIT6_I:%.*]] = insertelement <8 x i16> [[VECINIT5_I]], i16 %b, i32 6
// CHECK: [[VECINIT7_I:%.*]] = insertelement <8 x i16> [[VECINIT6_I]], i16 %b, i32 7
+// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %a to <16 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <8 x i16> [[VECINIT7_I]] to <16 x i8>
// CHECK: [[VQRDMULHQ_V9_I:%.*]] = call <8 x i16> @llvm.aarch64.neon.sqrdmulh.v8i16(<8 x i16> %a, <8 x i16> [[VECINIT7_I]])
// CHECK: [[VQRDMULHQ_V10_I:%.*]] = bitcast <8 x i16> [[VQRDMULHQ_V9_I]] to <16 x i8>
@@ -3405,9 +3397,9 @@
}
// CHECK-LABEL: @test_vqrdmulh_n_s32(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8>
// CHECK: [[VECINIT_I:%.*]] = insertelement <2 x i32> undef, i32 %b, i32 0
// CHECK: [[VECINIT1_I:%.*]] = insertelement <2 x i32> [[VECINIT_I]], i32 %b, i32 1
+// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <2 x i32> [[VECINIT1_I]] to <8 x i8>
// CHECK: [[VQRDMULH_V3_I:%.*]] = call <2 x i32> @llvm.aarch64.neon.sqrdmulh.v2i32(<2 x i32> %a, <2 x i32> [[VECINIT1_I]])
// CHECK: [[VQRDMULH_V4_I:%.*]] = bitcast <2 x i32> [[VQRDMULH_V3_I]] to <8 x i8>
@@ -3417,11 +3409,11 @@
}
// CHECK-LABEL: @test_vqrdmulhq_n_s32(
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %a to <16 x i8>
// CHECK: [[VECINIT_I:%.*]] = insertelement <4 x i32> undef, i32 %b, i32 0
// CHECK: [[VECINIT1_I:%.*]] = insertelement <4 x i32> [[VECINIT_I]], i32 %b, i32 1
// CHECK: [[VECINIT2_I:%.*]] = insertelement <4 x i32> [[VECINIT1_I]], i32 %b, i32 2
// CHECK: [[VECINIT3_I:%.*]] = insertelement <4 x i32> [[VECINIT2_I]], i32 %b, i32 3
+// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %a to <16 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <4 x i32> [[VECINIT3_I]] to <16 x i8>
// CHECK: [[VQRDMULHQ_V5_I:%.*]] = call <4 x i32> @llvm.aarch64.neon.sqrdmulh.v4i32(<4 x i32> %a, <4 x i32> [[VECINIT3_I]])
// CHECK: [[VQRDMULHQ_V6_I:%.*]] = bitcast <4 x i32> [[VQRDMULHQ_V5_I]] to <16 x i8>
@@ -3583,12 +3575,12 @@
}
// CHECK-LABEL: @test_vqdmlal_n_s16(
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %a to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <4 x i16> %b to <8 x i8>
// CHECK: [[VECINIT_I:%.*]] = insertelement <4 x i16> undef, i16 %c, i32 0
// CHECK: [[VECINIT1_I:%.*]] = insertelement <4 x i16> [[VECINIT_I]], i16 %c, i32 1
// CHECK: [[VECINIT2_I:%.*]] = insertelement <4 x i16> [[VECINIT1_I]], i16 %c, i32 2
// CHECK: [[VECINIT3_I:%.*]] = insertelement <4 x i16> [[VECINIT2_I]], i16 %c, i32 3
+// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %a to <16 x i8>
+// CHECK: [[TMP1:%.*]] = bitcast <4 x i16> %b to <8 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <4 x i16> [[VECINIT3_I]] to <8 x i8>
// CHECK: [[VQDMLAL5_I:%.*]] = call <4 x i32> @llvm.aarch64.neon.sqdmull.v4i32(<4 x i16> %b, <4 x i16> [[VECINIT3_I]])
// CHECK: [[VQDMLAL_V6_I:%.*]] = call <4 x i32> @llvm.aarch64.neon.sqadd.v4i32(<4 x i32> %a, <4 x i32> [[VQDMLAL5_I]])
@@ -3598,10 +3590,10 @@
}
// CHECK-LABEL: @test_vqdmlal_n_s32(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %a to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <2 x i32> %b to <8 x i8>
// CHECK: [[VECINIT_I:%.*]] = insertelement <2 x i32> undef, i32 %c, i32 0
// CHECK: [[VECINIT1_I:%.*]] = insertelement <2 x i32> [[VECINIT_I]], i32 %c, i32 1
+// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %a to <16 x i8>
+// CHECK: [[TMP1:%.*]] = bitcast <2 x i32> %b to <8 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <2 x i32> [[VECINIT1_I]] to <8 x i8>
// CHECK: [[VQDMLAL3_I:%.*]] = call <2 x i64> @llvm.aarch64.neon.sqdmull.v2i64(<2 x i32> %b, <2 x i32> [[VECINIT1_I]])
// CHECK: [[VQDMLAL_V4_I:%.*]] = call <2 x i64> @llvm.aarch64.neon.sqadd.v2i64(<2 x i64> %a, <2 x i64> [[VQDMLAL3_I]])
@@ -3763,12 +3755,12 @@
}
// CHECK-LABEL: @test_vqdmlsl_n_s16(
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %a to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <4 x i16> %b to <8 x i8>
// CHECK: [[VECINIT_I:%.*]] = insertelement <4 x i16> undef, i16 %c, i32 0
// CHECK: [[VECINIT1_I:%.*]] = insertelement <4 x i16> [[VECINIT_I]], i16 %c, i32 1
// CHECK: [[VECINIT2_I:%.*]] = insertelement <4 x i16> [[VECINIT1_I]], i16 %c, i32 2
// CHECK: [[VECINIT3_I:%.*]] = insertelement <4 x i16> [[VECINIT2_I]], i16 %c, i32 3
+// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %a to <16 x i8>
+// CHECK: [[TMP1:%.*]] = bitcast <4 x i16> %b to <8 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <4 x i16> [[VECINIT3_I]] to <8 x i8>
// CHECK: [[VQDMLAL5_I:%.*]] = call <4 x i32> @llvm.aarch64.neon.sqdmull.v4i32(<4 x i16> %b, <4 x i16> [[VECINIT3_I]])
// CHECK: [[VQDMLSL_V6_I:%.*]] = call <4 x i32> @llvm.aarch64.neon.sqsub.v4i32(<4 x i32> %a, <4 x i32> [[VQDMLAL5_I]])
@@ -3778,10 +3770,10 @@
}
// CHECK-LABEL: @test_vqdmlsl_n_s32(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %a to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <2 x i32> %b to <8 x i8>
// CHECK: [[VECINIT_I:%.*]] = insertelement <2 x i32> undef, i32 %c, i32 0
// CHECK: [[VECINIT1_I:%.*]] = insertelement <2 x i32> [[VECINIT_I]], i32 %c, i32 1
+// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %a to <16 x i8>
+// CHECK: [[TMP1:%.*]] = bitcast <2 x i32> %b to <8 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <2 x i32> [[VECINIT1_I]] to <8 x i8>
// CHECK: [[VQDMLAL3_I:%.*]] = call <2 x i64> @llvm.aarch64.neon.sqdmull.v2i64(<2 x i32> %b, <2 x i32> [[VECINIT1_I]])
// CHECK: [[VQDMLSL_V4_I:%.*]] = call <2 x i64> @llvm.aarch64.neon.sqsub.v2i64(<2 x i64> %a, <2 x i64> [[VQDMLAL3_I]])
diff --git a/src/llvm-project/clang/test/CodeGen/aarch64-neon-fma.c b/src/llvm-project/clang/test/CodeGen/aarch64-neon-fma.c
index 564bd37..ae02bfb 100644
--- a/src/llvm-project/clang/test/CodeGen/aarch64-neon-fma.c
+++ b/src/llvm-project/clang/test/CodeGen/aarch64-neon-fma.c
@@ -221,7 +221,7 @@
}
// CHECK-LABEL: define <2 x double> @test_vfmsq_n_f64(<2 x double> %a, <2 x double> %b, double %c) #1 {
-// CHECK: [[SUB_I:%.*]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %b
+// CHECK: [[SUB_I:%.*]] = fneg <2 x double> %b
// CHECK: [[VECINIT_I:%.*]] = insertelement <2 x double> undef, double %c, i32 0
// CHECK: [[VECINIT1_I:%.*]] = insertelement <2 x double> [[VECINIT_I]], double %c, i32 1
// CHECK: [[TMP6:%.*]] = call <2 x double> @llvm.fma.v2f64(<2 x double> [[SUB_I]], <2 x double> [[VECINIT1_I]], <2 x double> %a) #3
diff --git a/src/llvm-project/clang/test/CodeGen/aarch64-neon-intrinsics.c b/src/llvm-project/clang/test/CodeGen/aarch64-neon-intrinsics.c
index 37f2a1c..7744b4f 100644
--- a/src/llvm-project/clang/test/CodeGen/aarch64-neon-intrinsics.c
+++ b/src/llvm-project/clang/test/CodeGen/aarch64-neon-intrinsics.c
@@ -1,5 +1,6 @@
// RUN: %clang_cc1 -triple arm64-none-linux-gnu -target-feature +neon \
-// RUN: -fallow-half-arguments-and-returns -S -disable-O0-optnone -emit-llvm -o - %s \
+// RUN: -fallow-half-arguments-and-returns -S -disable-O0-optnone \
+// RUN: -flax-vector-conversions=none -emit-llvm -o - %s \
// RUN: | opt -S -mem2reg \
// RUN: | FileCheck %s
@@ -406,7 +407,7 @@
// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> [[ADD_I]] to <8 x i8>
// CHECK: ret <8 x i8> [[TMP0]]
int8x8_t test_vmla_s16(int16x4_t v1, int16x4_t v2, int16x4_t v3) {
- return vmla_s16(v1, v2, v3);
+ return (int8x8_t)vmla_s16(v1, v2, v3);
}
// CHECK-LABEL: @test_vmla_s32(
@@ -527,7 +528,7 @@
// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> [[SUB_I]] to <8 x i8>
// CHECK: ret <8 x i8> [[TMP0]]
int8x8_t test_vmls_s16(int16x4_t v1, int16x4_t v2, int16x4_t v3) {
- return vmls_s16(v1, v2, v3);
+ return (int8x8_t)vmls_s16(v1, v2, v3);
}
// CHECK-LABEL: @test_vmls_s32(
@@ -665,7 +666,7 @@
}
// CHECK-LABEL: @test_vfms_f32(
-// CHECK: [[SUB_I:%.*]] = fsub <2 x float> <float -0.000000e+00, float -0.000000e+00>, %v2
+// CHECK: [[SUB_I:%.*]] = fneg <2 x float> %v2
// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %v1 to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <2 x float> [[SUB_I]] to <8 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <2 x float> %v3 to <8 x i8>
@@ -676,7 +677,7 @@
}
// CHECK-LABEL: @test_vfmsq_f32(
-// CHECK: [[SUB_I:%.*]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %v2
+// CHECK: [[SUB_I:%.*]] = fneg <4 x float> %v2
// CHECK: [[TMP0:%.*]] = bitcast <4 x float> %v1 to <16 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <4 x float> [[SUB_I]] to <16 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <4 x float> %v3 to <16 x i8>
@@ -687,7 +688,7 @@
}
// CHECK-LABEL: @test_vfmsq_f64(
-// CHECK: [[SUB_I:%.*]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %v2
+// CHECK: [[SUB_I:%.*]] = fneg <2 x double> %v2
// CHECK: [[TMP0:%.*]] = bitcast <2 x double> %v1 to <16 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <2 x double> [[SUB_I]] to <16 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <2 x double> %v3 to <16 x i8>
@@ -978,7 +979,7 @@
// CHECK: [[TMP4:%.*]] = bitcast <4 x i16> [[VBSL5_I]] to <8 x i8>
// CHECK: ret <8 x i8> [[TMP4]]
int8x8_t test_vbsl_s16(uint16x4_t v1, int16x4_t v2, int16x4_t v3) {
- return vbsl_s16(v1, v2, v3);
+ return (int8x8_t)vbsl_s16(v1, v2, v3);
}
// CHECK-LABEL: @test_vbsl_s32(
@@ -1003,7 +1004,7 @@
// CHECK: [[VBSL4_I:%.*]] = and <1 x i64> [[TMP3]], %v3
// CHECK: [[VBSL5_I:%.*]] = or <1 x i64> [[VBSL3_I]], [[VBSL4_I]]
// CHECK: ret <1 x i64> [[VBSL5_I]]
-uint64x1_t test_vbsl_s64(uint64x1_t v1, uint64x1_t v2, uint64x1_t v3) {
+int64x1_t test_vbsl_s64(uint64x1_t v1, int64x1_t v2, int64x1_t v3) {
return vbsl_s64(v1, v2, v3);
}
@@ -1057,19 +1058,18 @@
}
// CHECK-LABEL: @test_vbsl_f32(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %v1 to <2 x i32>
-// CHECK: [[TMP1:%.*]] = bitcast <2 x i32> [[TMP0]] to <8 x i8>
+// CHECK: [[TMP1:%.*]] = bitcast <2 x i32> %v1 to <8 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <2 x float> %v2 to <8 x i8>
// CHECK: [[TMP3:%.*]] = bitcast <2 x float> %v3 to <8 x i8>
// CHECK: [[VBSL1_I:%.*]] = bitcast <8 x i8> [[TMP2]] to <2 x i32>
// CHECK: [[VBSL2_I:%.*]] = bitcast <8 x i8> [[TMP3]] to <2 x i32>
-// CHECK: [[VBSL3_I:%.*]] = and <2 x i32> [[TMP0]], [[VBSL1_I]]
-// CHECK: [[TMP4:%.*]] = xor <2 x i32> [[TMP0]], <i32 -1, i32 -1>
+// CHECK: [[VBSL3_I:%.*]] = and <2 x i32> %v1, [[VBSL1_I]]
+// CHECK: [[TMP4:%.*]] = xor <2 x i32> %v1, <i32 -1, i32 -1>
// CHECK: [[VBSL4_I:%.*]] = and <2 x i32> [[TMP4]], [[VBSL2_I]]
// CHECK: [[VBSL5_I:%.*]] = or <2 x i32> [[VBSL3_I]], [[VBSL4_I]]
// CHECK: [[TMP5:%.*]] = bitcast <2 x i32> [[VBSL5_I]] to <2 x float>
// CHECK: ret <2 x float> [[TMP5]]
-float32x2_t test_vbsl_f32(float32x2_t v1, float32x2_t v2, float32x2_t v3) {
+float32x2_t test_vbsl_f32(uint32x2_t v1, float32x2_t v2, float32x2_t v3) {
return vbsl_f32(v1, v2, v3);
}
@@ -4661,7 +4661,7 @@
// CHECK-LABEL: @test_vshl_n_u8(
// CHECK: [[VSHL_N:%.*]] = shl <8 x i8> %a, <i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3>
// CHECK: ret <8 x i8> [[VSHL_N]]
-int8x8_t test_vshl_n_u8(int8x8_t a) {
+uint8x8_t test_vshl_n_u8(uint8x8_t a) {
return vshl_n_u8(a, 3);
}
@@ -4670,7 +4670,7 @@
// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16>
// CHECK: [[VSHL_N:%.*]] = shl <4 x i16> [[TMP1]], <i16 3, i16 3, i16 3, i16 3>
// CHECK: ret <4 x i16> [[VSHL_N]]
-int16x4_t test_vshl_n_u16(int16x4_t a) {
+uint16x4_t test_vshl_n_u16(uint16x4_t a) {
return vshl_n_u16(a, 3);
}
@@ -4679,14 +4679,14 @@
// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x i32>
// CHECK: [[VSHL_N:%.*]] = shl <2 x i32> [[TMP1]], <i32 3, i32 3>
// CHECK: ret <2 x i32> [[VSHL_N]]
-int32x2_t test_vshl_n_u32(int32x2_t a) {
+uint32x2_t test_vshl_n_u32(uint32x2_t a) {
return vshl_n_u32(a, 3);
}
// CHECK-LABEL: @test_vshlq_n_u8(
// CHECK: [[VSHL_N:%.*]] = shl <16 x i8> %a, <i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3>
// CHECK: ret <16 x i8> [[VSHL_N]]
-int8x16_t test_vshlq_n_u8(int8x16_t a) {
+uint8x16_t test_vshlq_n_u8(uint8x16_t a) {
return vshlq_n_u8(a, 3);
}
@@ -4695,7 +4695,7 @@
// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16>
// CHECK: [[VSHL_N:%.*]] = shl <8 x i16> [[TMP1]], <i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3>
// CHECK: ret <8 x i16> [[VSHL_N]]
-int16x8_t test_vshlq_n_u16(int16x8_t a) {
+uint16x8_t test_vshlq_n_u16(uint16x8_t a) {
return vshlq_n_u16(a, 3);
}
@@ -4704,7 +4704,7 @@
// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32>
// CHECK: [[VSHL_N:%.*]] = shl <4 x i32> [[TMP1]], <i32 3, i32 3, i32 3, i32 3>
// CHECK: ret <4 x i32> [[VSHL_N]]
-int32x4_t test_vshlq_n_u32(int32x4_t a) {
+uint32x4_t test_vshlq_n_u32(uint32x4_t a) {
return vshlq_n_u32(a, 3);
}
@@ -4713,7 +4713,7 @@
// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x i64>
// CHECK: [[VSHL_N:%.*]] = shl <2 x i64> [[TMP1]], <i64 3, i64 3>
// CHECK: ret <2 x i64> [[VSHL_N]]
-int64x2_t test_vshlq_n_u64(int64x2_t a) {
+uint64x2_t test_vshlq_n_u64(uint64x2_t a) {
return vshlq_n_u64(a, 3);
}
@@ -4779,7 +4779,7 @@
// CHECK-LABEL: @test_vshr_n_u8(
// CHECK: [[VSHR_N:%.*]] = lshr <8 x i8> %a, <i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3>
// CHECK: ret <8 x i8> [[VSHR_N]]
-int8x8_t test_vshr_n_u8(int8x8_t a) {
+uint8x8_t test_vshr_n_u8(uint8x8_t a) {
return vshr_n_u8(a, 3);
}
@@ -4788,7 +4788,7 @@
// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16>
// CHECK: [[VSHR_N:%.*]] = lshr <4 x i16> [[TMP1]], <i16 3, i16 3, i16 3, i16 3>
// CHECK: ret <4 x i16> [[VSHR_N]]
-int16x4_t test_vshr_n_u16(int16x4_t a) {
+uint16x4_t test_vshr_n_u16(uint16x4_t a) {
return vshr_n_u16(a, 3);
}
@@ -4797,14 +4797,14 @@
// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x i32>
// CHECK: [[VSHR_N:%.*]] = lshr <2 x i32> [[TMP1]], <i32 3, i32 3>
// CHECK: ret <2 x i32> [[VSHR_N]]
-int32x2_t test_vshr_n_u32(int32x2_t a) {
+uint32x2_t test_vshr_n_u32(uint32x2_t a) {
return vshr_n_u32(a, 3);
}
// CHECK-LABEL: @test_vshrq_n_u8(
// CHECK: [[VSHR_N:%.*]] = lshr <16 x i8> %a, <i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3>
// CHECK: ret <16 x i8> [[VSHR_N]]
-int8x16_t test_vshrq_n_u8(int8x16_t a) {
+uint8x16_t test_vshrq_n_u8(uint8x16_t a) {
return vshrq_n_u8(a, 3);
}
@@ -4813,7 +4813,7 @@
// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16>
// CHECK: [[VSHR_N:%.*]] = lshr <8 x i16> [[TMP1]], <i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3>
// CHECK: ret <8 x i16> [[VSHR_N]]
-int16x8_t test_vshrq_n_u16(int16x8_t a) {
+uint16x8_t test_vshrq_n_u16(uint16x8_t a) {
return vshrq_n_u16(a, 3);
}
@@ -4822,7 +4822,7 @@
// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32>
// CHECK: [[VSHR_N:%.*]] = lshr <4 x i32> [[TMP1]], <i32 3, i32 3, i32 3, i32 3>
// CHECK: ret <4 x i32> [[VSHR_N]]
-int32x4_t test_vshrq_n_u32(int32x4_t a) {
+uint32x4_t test_vshrq_n_u32(uint32x4_t a) {
return vshrq_n_u32(a, 3);
}
@@ -4831,7 +4831,7 @@
// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x i64>
// CHECK: [[VSHR_N:%.*]] = lshr <2 x i64> [[TMP1]], <i64 3, i64 3>
// CHECK: ret <2 x i64> [[VSHR_N]]
-int64x2_t test_vshrq_n_u64(int64x2_t a) {
+uint64x2_t test_vshrq_n_u64(uint64x2_t a) {
return vshrq_n_u64(a, 3);
}
@@ -4915,7 +4915,7 @@
// CHECK: [[VSRA_N:%.*]] = lshr <8 x i8> %b, <i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3>
// CHECK: [[TMP0:%.*]] = add <8 x i8> %a, [[VSRA_N]]
// CHECK: ret <8 x i8> [[TMP0]]
-int8x8_t test_vsra_n_u8(int8x8_t a, int8x8_t b) {
+uint8x8_t test_vsra_n_u8(uint8x8_t a, uint8x8_t b) {
return vsra_n_u8(a, b, 3);
}
@@ -4927,7 +4927,7 @@
// CHECK: [[VSRA_N:%.*]] = lshr <4 x i16> [[TMP3]], <i16 3, i16 3, i16 3, i16 3>
// CHECK: [[TMP4:%.*]] = add <4 x i16> [[TMP2]], [[VSRA_N]]
// CHECK: ret <4 x i16> [[TMP4]]
-int16x4_t test_vsra_n_u16(int16x4_t a, int16x4_t b) {
+uint16x4_t test_vsra_n_u16(uint16x4_t a, uint16x4_t b) {
return vsra_n_u16(a, b, 3);
}
@@ -4939,7 +4939,7 @@
// CHECK: [[VSRA_N:%.*]] = lshr <2 x i32> [[TMP3]], <i32 3, i32 3>
// CHECK: [[TMP4:%.*]] = add <2 x i32> [[TMP2]], [[VSRA_N]]
// CHECK: ret <2 x i32> [[TMP4]]
-int32x2_t test_vsra_n_u32(int32x2_t a, int32x2_t b) {
+uint32x2_t test_vsra_n_u32(uint32x2_t a, uint32x2_t b) {
return vsra_n_u32(a, b, 3);
}
@@ -4947,7 +4947,7 @@
// CHECK: [[VSRA_N:%.*]] = lshr <16 x i8> %b, <i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3>
// CHECK: [[TMP0:%.*]] = add <16 x i8> %a, [[VSRA_N]]
// CHECK: ret <16 x i8> [[TMP0]]
-int8x16_t test_vsraq_n_u8(int8x16_t a, int8x16_t b) {
+uint8x16_t test_vsraq_n_u8(uint8x16_t a, uint8x16_t b) {
return vsraq_n_u8(a, b, 3);
}
@@ -4959,7 +4959,7 @@
// CHECK: [[VSRA_N:%.*]] = lshr <8 x i16> [[TMP3]], <i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3>
// CHECK: [[TMP4:%.*]] = add <8 x i16> [[TMP2]], [[VSRA_N]]
// CHECK: ret <8 x i16> [[TMP4]]
-int16x8_t test_vsraq_n_u16(int16x8_t a, int16x8_t b) {
+uint16x8_t test_vsraq_n_u16(uint16x8_t a, uint16x8_t b) {
return vsraq_n_u16(a, b, 3);
}
@@ -4971,7 +4971,7 @@
// CHECK: [[VSRA_N:%.*]] = lshr <4 x i32> [[TMP3]], <i32 3, i32 3, i32 3, i32 3>
// CHECK: [[TMP4:%.*]] = add <4 x i32> [[TMP2]], [[VSRA_N]]
// CHECK: ret <4 x i32> [[TMP4]]
-int32x4_t test_vsraq_n_u32(int32x4_t a, int32x4_t b) {
+uint32x4_t test_vsraq_n_u32(uint32x4_t a, uint32x4_t b) {
return vsraq_n_u32(a, b, 3);
}
@@ -4983,7 +4983,7 @@
// CHECK: [[VSRA_N:%.*]] = lshr <2 x i64> [[TMP3]], <i64 3, i64 3>
// CHECK: [[TMP4:%.*]] = add <2 x i64> [[TMP2]], [[VSRA_N]]
// CHECK: ret <2 x i64> [[TMP4]]
-int64x2_t test_vsraq_n_u64(int64x2_t a, int64x2_t b) {
+uint64x2_t test_vsraq_n_u64(uint64x2_t a, uint64x2_t b) {
return vsraq_n_u64(a, b, 3);
}
@@ -5049,7 +5049,7 @@
// CHECK-LABEL: @test_vrshr_n_u8(
// CHECK: [[VRSHR_N:%.*]] = call <8 x i8> @llvm.aarch64.neon.urshl.v8i8(<8 x i8> %a, <8 x i8> <i8 -3, i8 -3, i8 -3, i8 -3, i8 -3, i8 -3, i8 -3, i8 -3>)
// CHECK: ret <8 x i8> [[VRSHR_N]]
-int8x8_t test_vrshr_n_u8(int8x8_t a) {
+uint8x8_t test_vrshr_n_u8(uint8x8_t a) {
return vrshr_n_u8(a, 3);
}
@@ -5058,7 +5058,7 @@
// CHECK: [[VRSHR_N:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16>
// CHECK: [[VRSHR_N1:%.*]] = call <4 x i16> @llvm.aarch64.neon.urshl.v4i16(<4 x i16> [[VRSHR_N]], <4 x i16> <i16 -3, i16 -3, i16 -3, i16 -3>)
// CHECK: ret <4 x i16> [[VRSHR_N1]]
-int16x4_t test_vrshr_n_u16(int16x4_t a) {
+uint16x4_t test_vrshr_n_u16(uint16x4_t a) {
return vrshr_n_u16(a, 3);
}
@@ -5067,14 +5067,14 @@
// CHECK: [[VRSHR_N:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x i32>
// CHECK: [[VRSHR_N1:%.*]] = call <2 x i32> @llvm.aarch64.neon.urshl.v2i32(<2 x i32> [[VRSHR_N]], <2 x i32> <i32 -3, i32 -3>)
// CHECK: ret <2 x i32> [[VRSHR_N1]]
-int32x2_t test_vrshr_n_u32(int32x2_t a) {
+uint32x2_t test_vrshr_n_u32(uint32x2_t a) {
return vrshr_n_u32(a, 3);
}
// CHECK-LABEL: @test_vrshrq_n_u8(
// CHECK: [[VRSHR_N:%.*]] = call <16 x i8> @llvm.aarch64.neon.urshl.v16i8(<16 x i8> %a, <16 x i8> <i8 -3, i8 -3, i8 -3, i8 -3, i8 -3, i8 -3, i8 -3, i8 -3, i8 -3, i8 -3, i8 -3, i8 -3, i8 -3, i8 -3, i8 -3, i8 -3>)
// CHECK: ret <16 x i8> [[VRSHR_N]]
-int8x16_t test_vrshrq_n_u8(int8x16_t a) {
+uint8x16_t test_vrshrq_n_u8(uint8x16_t a) {
return vrshrq_n_u8(a, 3);
}
@@ -5083,7 +5083,7 @@
// CHECK: [[VRSHR_N:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16>
// CHECK: [[VRSHR_N1:%.*]] = call <8 x i16> @llvm.aarch64.neon.urshl.v8i16(<8 x i16> [[VRSHR_N]], <8 x i16> <i16 -3, i16 -3, i16 -3, i16 -3, i16 -3, i16 -3, i16 -3, i16 -3>)
// CHECK: ret <8 x i16> [[VRSHR_N1]]
-int16x8_t test_vrshrq_n_u16(int16x8_t a) {
+uint16x8_t test_vrshrq_n_u16(uint16x8_t a) {
return vrshrq_n_u16(a, 3);
}
@@ -5092,7 +5092,7 @@
// CHECK: [[VRSHR_N:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32>
// CHECK: [[VRSHR_N1:%.*]] = call <4 x i32> @llvm.aarch64.neon.urshl.v4i32(<4 x i32> [[VRSHR_N]], <4 x i32> <i32 -3, i32 -3, i32 -3, i32 -3>)
// CHECK: ret <4 x i32> [[VRSHR_N1]]
-int32x4_t test_vrshrq_n_u32(int32x4_t a) {
+uint32x4_t test_vrshrq_n_u32(uint32x4_t a) {
return vrshrq_n_u32(a, 3);
}
@@ -5101,7 +5101,7 @@
// CHECK: [[VRSHR_N:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x i64>
// CHECK: [[VRSHR_N1:%.*]] = call <2 x i64> @llvm.aarch64.neon.urshl.v2i64(<2 x i64> [[VRSHR_N]], <2 x i64> <i64 -3, i64 -3>)
// CHECK: ret <2 x i64> [[VRSHR_N1]]
-int64x2_t test_vrshrq_n_u64(int64x2_t a) {
+uint64x2_t test_vrshrq_n_u64(uint64x2_t a) {
return vrshrq_n_u64(a, 3);
}
@@ -5185,7 +5185,7 @@
// CHECK: [[VRSHR_N:%.*]] = call <8 x i8> @llvm.aarch64.neon.urshl.v8i8(<8 x i8> %b, <8 x i8> <i8 -3, i8 -3, i8 -3, i8 -3, i8 -3, i8 -3, i8 -3, i8 -3>)
// CHECK: [[TMP0:%.*]] = add <8 x i8> %a, [[VRSHR_N]]
// CHECK: ret <8 x i8> [[TMP0]]
-int8x8_t test_vrsra_n_u8(int8x8_t a, int8x8_t b) {
+uint8x8_t test_vrsra_n_u8(uint8x8_t a, uint8x8_t b) {
return vrsra_n_u8(a, b, 3);
}
@@ -5197,7 +5197,7 @@
// CHECK: [[TMP2:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16>
// CHECK: [[TMP3:%.*]] = add <4 x i16> [[TMP2]], [[VRSHR_N1]]
// CHECK: ret <4 x i16> [[TMP3]]
-int16x4_t test_vrsra_n_u16(int16x4_t a, int16x4_t b) {
+uint16x4_t test_vrsra_n_u16(uint16x4_t a, uint16x4_t b) {
return vrsra_n_u16(a, b, 3);
}
@@ -5209,7 +5209,7 @@
// CHECK: [[TMP2:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x i32>
// CHECK: [[TMP3:%.*]] = add <2 x i32> [[TMP2]], [[VRSHR_N1]]
// CHECK: ret <2 x i32> [[TMP3]]
-int32x2_t test_vrsra_n_u32(int32x2_t a, int32x2_t b) {
+uint32x2_t test_vrsra_n_u32(uint32x2_t a, uint32x2_t b) {
return vrsra_n_u32(a, b, 3);
}
@@ -5217,7 +5217,7 @@
// CHECK: [[VRSHR_N:%.*]] = call <16 x i8> @llvm.aarch64.neon.urshl.v16i8(<16 x i8> %b, <16 x i8> <i8 -3, i8 -3, i8 -3, i8 -3, i8 -3, i8 -3, i8 -3, i8 -3, i8 -3, i8 -3, i8 -3, i8 -3, i8 -3, i8 -3, i8 -3, i8 -3>)
// CHECK: [[TMP0:%.*]] = add <16 x i8> %a, [[VRSHR_N]]
// CHECK: ret <16 x i8> [[TMP0]]
-int8x16_t test_vrsraq_n_u8(int8x16_t a, int8x16_t b) {
+uint8x16_t test_vrsraq_n_u8(uint8x16_t a, uint8x16_t b) {
return vrsraq_n_u8(a, b, 3);
}
@@ -5229,7 +5229,7 @@
// CHECK: [[TMP2:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16>
// CHECK: [[TMP3:%.*]] = add <8 x i16> [[TMP2]], [[VRSHR_N1]]
// CHECK: ret <8 x i16> [[TMP3]]
-int16x8_t test_vrsraq_n_u16(int16x8_t a, int16x8_t b) {
+uint16x8_t test_vrsraq_n_u16(uint16x8_t a, uint16x8_t b) {
return vrsraq_n_u16(a, b, 3);
}
@@ -5241,7 +5241,7 @@
// CHECK: [[TMP2:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32>
// CHECK: [[TMP3:%.*]] = add <4 x i32> [[TMP2]], [[VRSHR_N1]]
// CHECK: ret <4 x i32> [[TMP3]]
-int32x4_t test_vrsraq_n_u32(int32x4_t a, int32x4_t b) {
+uint32x4_t test_vrsraq_n_u32(uint32x4_t a, uint32x4_t b) {
return vrsraq_n_u32(a, b, 3);
}
@@ -5253,7 +5253,7 @@
// CHECK: [[TMP2:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x i64>
// CHECK: [[TMP3:%.*]] = add <2 x i64> [[TMP2]], [[VRSHR_N1]]
// CHECK: ret <2 x i64> [[TMP3]]
-int64x2_t test_vrsraq_n_u64(int64x2_t a, int64x2_t b) {
+uint64x2_t test_vrsraq_n_u64(uint64x2_t a, uint64x2_t b) {
return vrsraq_n_u64(a, b, 3);
}
@@ -5329,7 +5329,7 @@
// CHECK-LABEL: @test_vsri_n_u8(
// CHECK: [[VSRI_N:%.*]] = call <8 x i8> @llvm.aarch64.neon.vsri.v8i8(<8 x i8> %a, <8 x i8> %b, i32 3)
// CHECK: ret <8 x i8> [[VSRI_N]]
-int8x8_t test_vsri_n_u8(int8x8_t a, int8x8_t b) {
+uint8x8_t test_vsri_n_u8(uint8x8_t a, uint8x8_t b) {
return vsri_n_u8(a, b, 3);
}
@@ -5340,7 +5340,7 @@
// CHECK: [[VSRI_N1:%.*]] = bitcast <8 x i8> [[TMP1]] to <4 x i16>
// CHECK: [[VSRI_N2:%.*]] = call <4 x i16> @llvm.aarch64.neon.vsri.v4i16(<4 x i16> [[VSRI_N]], <4 x i16> [[VSRI_N1]], i32 3)
// CHECK: ret <4 x i16> [[VSRI_N2]]
-int16x4_t test_vsri_n_u16(int16x4_t a, int16x4_t b) {
+uint16x4_t test_vsri_n_u16(uint16x4_t a, uint16x4_t b) {
return vsri_n_u16(a, b, 3);
}
@@ -5351,14 +5351,14 @@
// CHECK: [[VSRI_N1:%.*]] = bitcast <8 x i8> [[TMP1]] to <2 x i32>
// CHECK: [[VSRI_N2:%.*]] = call <2 x i32> @llvm.aarch64.neon.vsri.v2i32(<2 x i32> [[VSRI_N]], <2 x i32> [[VSRI_N1]], i32 3)
// CHECK: ret <2 x i32> [[VSRI_N2]]
-int32x2_t test_vsri_n_u32(int32x2_t a, int32x2_t b) {
+uint32x2_t test_vsri_n_u32(uint32x2_t a, uint32x2_t b) {
return vsri_n_u32(a, b, 3);
}
// CHECK-LABEL: @test_vsriq_n_u8(
// CHECK: [[VSRI_N:%.*]] = call <16 x i8> @llvm.aarch64.neon.vsri.v16i8(<16 x i8> %a, <16 x i8> %b, i32 3)
// CHECK: ret <16 x i8> [[VSRI_N]]
-int8x16_t test_vsriq_n_u8(int8x16_t a, int8x16_t b) {
+uint8x16_t test_vsriq_n_u8(uint8x16_t a, uint8x16_t b) {
return vsriq_n_u8(a, b, 3);
}
@@ -5369,7 +5369,7 @@
// CHECK: [[VSRI_N1:%.*]] = bitcast <16 x i8> [[TMP1]] to <8 x i16>
// CHECK: [[VSRI_N2:%.*]] = call <8 x i16> @llvm.aarch64.neon.vsri.v8i16(<8 x i16> [[VSRI_N]], <8 x i16> [[VSRI_N1]], i32 3)
// CHECK: ret <8 x i16> [[VSRI_N2]]
-int16x8_t test_vsriq_n_u16(int16x8_t a, int16x8_t b) {
+uint16x8_t test_vsriq_n_u16(uint16x8_t a, uint16x8_t b) {
return vsriq_n_u16(a, b, 3);
}
@@ -5380,7 +5380,7 @@
// CHECK: [[VSRI_N1:%.*]] = bitcast <16 x i8> [[TMP1]] to <4 x i32>
// CHECK: [[VSRI_N2:%.*]] = call <4 x i32> @llvm.aarch64.neon.vsri.v4i32(<4 x i32> [[VSRI_N]], <4 x i32> [[VSRI_N1]], i32 3)
// CHECK: ret <4 x i32> [[VSRI_N2]]
-int32x4_t test_vsriq_n_u32(int32x4_t a, int32x4_t b) {
+uint32x4_t test_vsriq_n_u32(uint32x4_t a, uint32x4_t b) {
return vsriq_n_u32(a, b, 3);
}
@@ -5391,7 +5391,7 @@
// CHECK: [[VSRI_N1:%.*]] = bitcast <16 x i8> [[TMP1]] to <2 x i64>
// CHECK: [[VSRI_N2:%.*]] = call <2 x i64> @llvm.aarch64.neon.vsri.v2i64(<2 x i64> [[VSRI_N]], <2 x i64> [[VSRI_N1]], i32 3)
// CHECK: ret <2 x i64> [[VSRI_N2]]
-int64x2_t test_vsriq_n_u64(int64x2_t a, int64x2_t b) {
+uint64x2_t test_vsriq_n_u64(uint64x2_t a, uint64x2_t b) {
return vsriq_n_u64(a, b, 3);
}
@@ -5608,7 +5608,7 @@
// CHECK-LABEL: @test_vqshlu_n_s8(
// CHECK: [[VQSHLU_N:%.*]] = call <8 x i8> @llvm.aarch64.neon.sqshlu.v8i8(<8 x i8> %a, <8 x i8> <i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3>)
// CHECK: ret <8 x i8> [[VQSHLU_N]]
-int8x8_t test_vqshlu_n_s8(int8x8_t a) {
+uint8x8_t test_vqshlu_n_s8(int8x8_t a) {
return vqshlu_n_s8(a, 3);
}
@@ -5617,7 +5617,7 @@
// CHECK: [[VQSHLU_N:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16>
// CHECK: [[VQSHLU_N1:%.*]] = call <4 x i16> @llvm.aarch64.neon.sqshlu.v4i16(<4 x i16> [[VQSHLU_N]], <4 x i16> <i16 3, i16 3, i16 3, i16 3>)
// CHECK: ret <4 x i16> [[VQSHLU_N1]]
-int16x4_t test_vqshlu_n_s16(int16x4_t a) {
+uint16x4_t test_vqshlu_n_s16(int16x4_t a) {
return vqshlu_n_s16(a, 3);
}
@@ -5626,14 +5626,14 @@
// CHECK: [[VQSHLU_N:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x i32>
// CHECK: [[VQSHLU_N1:%.*]] = call <2 x i32> @llvm.aarch64.neon.sqshlu.v2i32(<2 x i32> [[VQSHLU_N]], <2 x i32> <i32 3, i32 3>)
// CHECK: ret <2 x i32> [[VQSHLU_N1]]
-int32x2_t test_vqshlu_n_s32(int32x2_t a) {
+uint32x2_t test_vqshlu_n_s32(int32x2_t a) {
return vqshlu_n_s32(a, 3);
}
// CHECK-LABEL: @test_vqshluq_n_s8(
// CHECK: [[VQSHLU_N:%.*]] = call <16 x i8> @llvm.aarch64.neon.sqshlu.v16i8(<16 x i8> %a, <16 x i8> <i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3>)
// CHECK: ret <16 x i8> [[VQSHLU_N]]
-int8x16_t test_vqshluq_n_s8(int8x16_t a) {
+uint8x16_t test_vqshluq_n_s8(int8x16_t a) {
return vqshluq_n_s8(a, 3);
}
@@ -5642,7 +5642,7 @@
// CHECK: [[VQSHLU_N:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16>
// CHECK: [[VQSHLU_N1:%.*]] = call <8 x i16> @llvm.aarch64.neon.sqshlu.v8i16(<8 x i16> [[VQSHLU_N]], <8 x i16> <i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3>)
// CHECK: ret <8 x i16> [[VQSHLU_N1]]
-int16x8_t test_vqshluq_n_s16(int16x8_t a) {
+uint16x8_t test_vqshluq_n_s16(int16x8_t a) {
return vqshluq_n_s16(a, 3);
}
@@ -5651,7 +5651,7 @@
// CHECK: [[VQSHLU_N:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32>
// CHECK: [[VQSHLU_N1:%.*]] = call <4 x i32> @llvm.aarch64.neon.sqshlu.v4i32(<4 x i32> [[VQSHLU_N]], <4 x i32> <i32 3, i32 3, i32 3, i32 3>)
// CHECK: ret <4 x i32> [[VQSHLU_N1]]
-int32x4_t test_vqshluq_n_s32(int32x4_t a) {
+uint32x4_t test_vqshluq_n_s32(int32x4_t a) {
return vqshluq_n_s32(a, 3);
}
@@ -5660,7 +5660,7 @@
// CHECK: [[VQSHLU_N:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x i64>
// CHECK: [[VQSHLU_N1:%.*]] = call <2 x i64> @llvm.aarch64.neon.sqshlu.v2i64(<2 x i64> [[VQSHLU_N]], <2 x i64> <i64 3, i64 3>)
// CHECK: ret <2 x i64> [[VQSHLU_N1]]
-int64x2_t test_vqshluq_n_s64(int64x2_t a) {
+uint64x2_t test_vqshluq_n_s64(int64x2_t a) {
return vqshluq_n_s64(a, 3);
}
@@ -5795,7 +5795,7 @@
// CHECK: [[VQSHRUN_N:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16>
// CHECK: [[VQSHRUN_N1:%.*]] = call <8 x i8> @llvm.aarch64.neon.sqshrun.v8i8(<8 x i16> [[VQSHRUN_N]], i32 3)
// CHECK: ret <8 x i8> [[VQSHRUN_N1]]
-int8x8_t test_vqshrun_n_s16(int16x8_t a) {
+uint8x8_t test_vqshrun_n_s16(int16x8_t a) {
return vqshrun_n_s16(a, 3);
}
@@ -5804,7 +5804,7 @@
// CHECK: [[VQSHRUN_N:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32>
// CHECK: [[VQSHRUN_N1:%.*]] = call <4 x i16> @llvm.aarch64.neon.sqshrun.v4i16(<4 x i32> [[VQSHRUN_N]], i32 9)
// CHECK: ret <4 x i16> [[VQSHRUN_N1]]
-int16x4_t test_vqshrun_n_s32(int32x4_t a) {
+uint16x4_t test_vqshrun_n_s32(int32x4_t a) {
return vqshrun_n_s32(a, 9);
}
@@ -5813,7 +5813,7 @@
// CHECK: [[VQSHRUN_N:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x i64>
// CHECK: [[VQSHRUN_N1:%.*]] = call <2 x i32> @llvm.aarch64.neon.sqshrun.v2i32(<2 x i64> [[VQSHRUN_N]], i32 19)
// CHECK: ret <2 x i32> [[VQSHRUN_N1]]
-int32x2_t test_vqshrun_n_s64(int64x2_t a) {
+uint32x2_t test_vqshrun_n_s64(int64x2_t a) {
return vqshrun_n_s64(a, 19);
}
@@ -5966,7 +5966,7 @@
// CHECK: [[VQRSHRUN_N:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16>
// CHECK: [[VQRSHRUN_N1:%.*]] = call <8 x i8> @llvm.aarch64.neon.sqrshrun.v8i8(<8 x i16> [[VQRSHRUN_N]], i32 3)
// CHECK: ret <8 x i8> [[VQRSHRUN_N1]]
-int8x8_t test_vqrshrun_n_s16(int16x8_t a) {
+uint8x8_t test_vqrshrun_n_s16(int16x8_t a) {
return vqrshrun_n_s16(a, 3);
}
@@ -5975,7 +5975,7 @@
// CHECK: [[VQRSHRUN_N:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32>
// CHECK: [[VQRSHRUN_N1:%.*]] = call <4 x i16> @llvm.aarch64.neon.sqrshrun.v4i16(<4 x i32> [[VQRSHRUN_N]], i32 9)
// CHECK: ret <4 x i16> [[VQRSHRUN_N1]]
-int16x4_t test_vqrshrun_n_s32(int32x4_t a) {
+uint16x4_t test_vqrshrun_n_s32(int32x4_t a) {
return vqrshrun_n_s32(a, 9);
}
@@ -5984,7 +5984,7 @@
// CHECK: [[VQRSHRUN_N:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x i64>
// CHECK: [[VQRSHRUN_N1:%.*]] = call <2 x i32> @llvm.aarch64.neon.sqrshrun.v2i32(<2 x i64> [[VQRSHRUN_N]], i32 19)
// CHECK: ret <2 x i32> [[VQRSHRUN_N1]]
-int32x2_t test_vqrshrun_n_s64(int64x2_t a) {
+uint32x2_t test_vqrshrun_n_s64(int64x2_t a) {
return vqrshrun_n_s64(a, 19);
}
@@ -8703,7 +8703,6 @@
}
// CHECK-LABEL: @test_vpaddd_s64(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %a to <16 x i8>
// CHECK: [[VPADDD_S64_I:%.*]] = call i64 @llvm.aarch64.neon.uaddv.i64.v2i64(<2 x i64> %a)
// CHECK: ret i64 [[VPADDD_S64_I]]
int64_t test_vpaddd_s64(int64x2_t a) {
@@ -8711,7 +8710,6 @@
}
// CHECK-LABEL: @test_vpadds_f32(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %a to <8 x i8>
// CHECK: [[LANE0_I:%.*]] = extractelement <2 x float> %a, i64 0
// CHECK: [[LANE1_I:%.*]] = extractelement <2 x float> %a, i64 1
// CHECK: [[VPADDD_I:%.*]] = fadd float [[LANE0_I]], [[LANE1_I]]
@@ -8721,7 +8719,6 @@
}
// CHECK-LABEL: @test_vpaddd_f64(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x double> %a to <16 x i8>
// CHECK: [[LANE0_I:%.*]] = extractelement <2 x double> %a, i64 0
// CHECK: [[LANE1_I:%.*]] = extractelement <2 x double> %a, i64 1
// CHECK: [[VPADDD_I:%.*]] = fadd double [[LANE0_I]], [[LANE1_I]]
@@ -8731,7 +8728,6 @@
}
// CHECK-LABEL: @test_vpmaxnms_f32(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %a to <8 x i8>
// CHECK: [[VPMAXNMS_F32_I:%.*]] = call float @llvm.aarch64.neon.fmaxnmv.f32.v2f32(<2 x float> %a)
// CHECK: ret float [[VPMAXNMS_F32_I]]
float32_t test_vpmaxnms_f32(float32x2_t a) {
@@ -8739,7 +8735,6 @@
}
// CHECK-LABEL: @test_vpmaxnmqd_f64(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x double> %a to <16 x i8>
// CHECK: [[VPMAXNMQD_F64_I:%.*]] = call double @llvm.aarch64.neon.fmaxnmv.f64.v2f64(<2 x double> %a)
// CHECK: ret double [[VPMAXNMQD_F64_I]]
float64_t test_vpmaxnmqd_f64(float64x2_t a) {
@@ -8747,7 +8742,6 @@
}
// CHECK-LABEL: @test_vpmaxs_f32(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %a to <8 x i8>
// CHECK: [[VPMAXS_F32_I:%.*]] = call float @llvm.aarch64.neon.fmaxv.f32.v2f32(<2 x float> %a)
// CHECK: ret float [[VPMAXS_F32_I]]
float32_t test_vpmaxs_f32(float32x2_t a) {
@@ -8755,7 +8749,6 @@
}
// CHECK-LABEL: @test_vpmaxqd_f64(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x double> %a to <16 x i8>
// CHECK: [[VPMAXQD_F64_I:%.*]] = call double @llvm.aarch64.neon.fmaxv.f64.v2f64(<2 x double> %a)
// CHECK: ret double [[VPMAXQD_F64_I]]
float64_t test_vpmaxqd_f64(float64x2_t a) {
@@ -8763,7 +8756,6 @@
}
// CHECK-LABEL: @test_vpminnms_f32(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %a to <8 x i8>
// CHECK: [[VPMINNMS_F32_I:%.*]] = call float @llvm.aarch64.neon.fminnmv.f32.v2f32(<2 x float> %a)
// CHECK: ret float [[VPMINNMS_F32_I]]
float32_t test_vpminnms_f32(float32x2_t a) {
@@ -8771,7 +8763,6 @@
}
// CHECK-LABEL: @test_vpminnmqd_f64(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x double> %a to <16 x i8>
// CHECK: [[VPMINNMQD_F64_I:%.*]] = call double @llvm.aarch64.neon.fminnmv.f64.v2f64(<2 x double> %a)
// CHECK: ret double [[VPMINNMQD_F64_I]]
float64_t test_vpminnmqd_f64(float64x2_t a) {
@@ -8779,7 +8770,6 @@
}
// CHECK-LABEL: @test_vpmins_f32(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %a to <8 x i8>
// CHECK: [[VPMINS_F32_I:%.*]] = call float @llvm.aarch64.neon.fminv.f32.v2f32(<2 x float> %a)
// CHECK: ret float [[VPMINS_F32_I]]
float32_t test_vpmins_f32(float32x2_t a) {
@@ -8787,7 +8777,6 @@
}
// CHECK-LABEL: @test_vpminqd_f64(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x double> %a to <16 x i8>
// CHECK: [[VPMINQD_F64_I:%.*]] = call double @llvm.aarch64.neon.fminv.f64.v2f64(<2 x double> %a)
// CHECK: ret double [[VPMINQD_F64_I]]
float64_t test_vpminqd_f64(float64x2_t a) {
@@ -17690,7 +17679,6 @@
}
// CHECK-LABEL: @test_vaddv_f32(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %a to <8 x i8>
// CHECK: [[VADDV_F32_I:%.*]] = call float @llvm.aarch64.neon.faddv.f32.v2f32(<2 x float> %a)
// CHECK: ret float [[VADDV_F32_I]]
float32_t test_vaddv_f32(float32x2_t a) {
@@ -17698,7 +17686,6 @@
}
// CHECK-LABEL: @test_vaddvq_f32(
-// CHECK: [[TMP0:%.*]] = bitcast <4 x float> %a to <16 x i8>
// CHECK: [[VADDVQ_F32_I:%.*]] = call float @llvm.aarch64.neon.faddv.f32.v4f32(<4 x float> %a)
// CHECK: ret float [[VADDVQ_F32_I]]
float32_t test_vaddvq_f32(float32x4_t a) {
@@ -17706,7 +17693,6 @@
}
// CHECK-LABEL: @test_vaddvq_f64(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x double> %a to <16 x i8>
// CHECK: [[VADDVQ_F64_I:%.*]] = call double @llvm.aarch64.neon.faddv.f64.v2f64(<2 x double> %a)
// CHECK: ret double [[VADDVQ_F64_I]]
float64_t test_vaddvq_f64(float64x2_t a) {
@@ -17714,7 +17700,6 @@
}
// CHECK-LABEL: @test_vmaxv_f32(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %a to <8 x i8>
// CHECK: [[VMAXV_F32_I:%.*]] = call float @llvm.aarch64.neon.fmaxv.f32.v2f32(<2 x float> %a)
// CHECK: ret float [[VMAXV_F32_I]]
float32_t test_vmaxv_f32(float32x2_t a) {
@@ -17722,7 +17707,6 @@
}
// CHECK-LABEL: @test_vmaxvq_f64(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x double> %a to <16 x i8>
// CHECK: [[VMAXVQ_F64_I:%.*]] = call double @llvm.aarch64.neon.fmaxv.f64.v2f64(<2 x double> %a)
// CHECK: ret double [[VMAXVQ_F64_I]]
float64_t test_vmaxvq_f64(float64x2_t a) {
@@ -17730,7 +17714,6 @@
}
// CHECK-LABEL: @test_vminv_f32(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %a to <8 x i8>
// CHECK: [[VMINV_F32_I:%.*]] = call float @llvm.aarch64.neon.fminv.f32.v2f32(<2 x float> %a)
// CHECK: ret float [[VMINV_F32_I]]
float32_t test_vminv_f32(float32x2_t a) {
@@ -17738,7 +17721,6 @@
}
// CHECK-LABEL: @test_vminvq_f64(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x double> %a to <16 x i8>
// CHECK: [[VMINVQ_F64_I:%.*]] = call double @llvm.aarch64.neon.fminv.f64.v2f64(<2 x double> %a)
// CHECK: ret double [[VMINVQ_F64_I]]
float64_t test_vminvq_f64(float64x2_t a) {
@@ -17746,7 +17728,6 @@
}
// CHECK-LABEL: @test_vmaxnmvq_f64(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x double> %a to <16 x i8>
// CHECK: [[VMAXNMVQ_F64_I:%.*]] = call double @llvm.aarch64.neon.fmaxnmv.f64.v2f64(<2 x double> %a)
// CHECK: ret double [[VMAXNMVQ_F64_I]]
float64_t test_vmaxnmvq_f64(float64x2_t a) {
@@ -17754,7 +17735,6 @@
}
// CHECK-LABEL: @test_vmaxnmv_f32(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %a to <8 x i8>
// CHECK: [[VMAXNMV_F32_I:%.*]] = call float @llvm.aarch64.neon.fmaxnmv.f32.v2f32(<2 x float> %a)
// CHECK: ret float [[VMAXNMV_F32_I]]
float32_t test_vmaxnmv_f32(float32x2_t a) {
@@ -17762,7 +17742,6 @@
}
// CHECK-LABEL: @test_vminnmvq_f64(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x double> %a to <16 x i8>
// CHECK: [[VMINNMVQ_F64_I:%.*]] = call double @llvm.aarch64.neon.fminnmv.f64.v2f64(<2 x double> %a)
// CHECK: ret double [[VMINNMVQ_F64_I]]
float64_t test_vminnmvq_f64(float64x2_t a) {
@@ -17770,7 +17749,6 @@
}
// CHECK-LABEL: @test_vminnmv_f32(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %a to <8 x i8>
// CHECK: [[VMINNMV_F32_I:%.*]] = call float @llvm.aarch64.neon.fminnmv.f32.v2f32(<2 x float> %a)
// CHECK: ret float [[VMINNMV_F32_I]]
float32_t test_vminnmv_f32(float32x2_t a) {
@@ -17778,8 +17756,6 @@
}
// CHECK-LABEL: @test_vpaddq_s64(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %a to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <2 x i64> %b to <16 x i8>
// CHECK: [[VPADDQ_V2_I:%.*]] = call <2 x i64> @llvm.aarch64.neon.addp.v2i64(<2 x i64> %a, <2 x i64> %b)
// CHECK: [[VPADDQ_V3_I:%.*]] = bitcast <2 x i64> [[VPADDQ_V2_I]] to <16 x i8>
// CHECK: ret <2 x i64> [[VPADDQ_V2_I]]
@@ -17788,8 +17764,6 @@
}
// CHECK-LABEL: @test_vpaddq_u64(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %a to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <2 x i64> %b to <16 x i8>
// CHECK: [[VPADDQ_V2_I:%.*]] = call <2 x i64> @llvm.aarch64.neon.addp.v2i64(<2 x i64> %a, <2 x i64> %b)
// CHECK: [[VPADDQ_V3_I:%.*]] = bitcast <2 x i64> [[VPADDQ_V2_I]] to <16 x i8>
// CHECK: ret <2 x i64> [[VPADDQ_V2_I]]
@@ -17798,7 +17772,6 @@
}
// CHECK-LABEL: @test_vpaddd_u64(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %a to <16 x i8>
// CHECK: [[VPADDD_U64_I:%.*]] = call i64 @llvm.aarch64.neon.uaddv.i64.v2i64(<2 x i64> %a)
// CHECK: ret i64 [[VPADDD_U64_I]]
uint64_t test_vpaddd_u64(uint64x2_t a) {
@@ -17806,7 +17779,6 @@
}
// CHECK-LABEL: @test_vaddvq_s64(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %a to <16 x i8>
// CHECK: [[VADDVQ_S64_I:%.*]] = call i64 @llvm.aarch64.neon.saddv.i64.v2i64(<2 x i64> %a)
// CHECK: ret i64 [[VADDVQ_S64_I]]
int64_t test_vaddvq_s64(int64x2_t a) {
@@ -17814,7 +17786,6 @@
}
// CHECK-LABEL: @test_vaddvq_u64(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %a to <16 x i8>
// CHECK: [[VADDVQ_U64_I:%.*]] = call i64 @llvm.aarch64.neon.uaddv.i64.v2i64(<2 x i64> %a)
// CHECK: ret i64 [[VADDVQ_U64_I]]
uint64_t test_vaddvq_u64(uint64x2_t a) {
@@ -17869,7 +17840,7 @@
}
// CHECK-LABEL: @test_vfms_f64(
-// CHECK: [[SUB_I:%.*]] = fsub <1 x double> <double -0.000000e+00>, %b
+// CHECK: [[SUB_I:%.*]] = fneg <1 x double> %b
// CHECK: [[TMP0:%.*]] = bitcast <1 x double> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <1 x double> [[SUB_I]] to <8 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <1 x double> %c to <8 x i8>
@@ -17940,7 +17911,7 @@
}
// CHECK-LABEL: @test_vneg_f64(
-// CHECK: [[SUB_I:%.*]] = fsub <1 x double> <double -0.000000e+00>, %a
+// CHECK: [[SUB_I:%.*]] = fneg <1 x double> %a
// CHECK: ret <1 x double> [[SUB_I]]
float64x1_t test_vneg_f64(float64x1_t a) {
return vneg_f64(a);
@@ -18178,7 +18149,6 @@
}
// CHECK-LABEL: @test_vminv_s32(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8>
// CHECK: [[VMINV_S32_I:%.*]] = call i32 @llvm.aarch64.neon.sminv.i32.v2i32(<2 x i32> %a)
// CHECK: ret i32 [[VMINV_S32_I]]
int32_t test_vminv_s32(int32x2_t a) {
@@ -18186,7 +18156,6 @@
}
// CHECK-LABEL: @test_vminv_u32(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8>
// CHECK: [[VMINV_U32_I:%.*]] = call i32 @llvm.aarch64.neon.uminv.i32.v2i32(<2 x i32> %a)
// CHECK: ret i32 [[VMINV_U32_I]]
uint32_t test_vminv_u32(uint32x2_t a) {
@@ -18194,7 +18163,6 @@
}
// CHECK-LABEL: @test_vmaxv_s32(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8>
// CHECK: [[VMAXV_S32_I:%.*]] = call i32 @llvm.aarch64.neon.smaxv.i32.v2i32(<2 x i32> %a)
// CHECK: ret i32 [[VMAXV_S32_I]]
int32_t test_vmaxv_s32(int32x2_t a) {
@@ -18202,7 +18170,6 @@
}
// CHECK-LABEL: @test_vmaxv_u32(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8>
// CHECK: [[VMAXV_U32_I:%.*]] = call i32 @llvm.aarch64.neon.umaxv.i32.v2i32(<2 x i32> %a)
// CHECK: ret i32 [[VMAXV_U32_I]]
uint32_t test_vmaxv_u32(uint32x2_t a) {
@@ -18210,7 +18177,6 @@
}
// CHECK-LABEL: @test_vaddv_s32(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8>
// CHECK: [[VADDV_S32_I:%.*]] = call i32 @llvm.aarch64.neon.saddv.i32.v2i32(<2 x i32> %a)
// CHECK: ret i32 [[VADDV_S32_I]]
int32_t test_vaddv_s32(int32x2_t a) {
@@ -18218,7 +18184,6 @@
}
// CHECK-LABEL: @test_vaddv_u32(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8>
// CHECK: [[VADDV_U32_I:%.*]] = call i32 @llvm.aarch64.neon.uaddv.i32.v2i32(<2 x i32> %a)
// CHECK: ret i32 [[VADDV_U32_I]]
uint32_t test_vaddv_u32(uint32x2_t a) {
@@ -18226,7 +18191,6 @@
}
// CHECK-LABEL: @test_vaddlv_s32(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8>
// CHECK: [[VADDLV_S32_I:%.*]] = call i64 @llvm.aarch64.neon.saddlv.i64.v2i32(<2 x i32> %a)
// CHECK: ret i64 [[VADDLV_S32_I]]
int64_t test_vaddlv_s32(int32x2_t a) {
@@ -18234,7 +18198,6 @@
}
// CHECK-LABEL: @test_vaddlv_u32(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8>
// CHECK: [[VADDLV_U32_I:%.*]] = call i64 @llvm.aarch64.neon.uaddlv.i64.v2i32(<2 x i32> %a)
// CHECK: ret i64 [[VADDLV_U32_I]]
uint64_t test_vaddlv_u32(uint32x2_t a) {
diff --git a/src/llvm-project/clang/test/CodeGen/aarch64-neon-misc.c b/src/llvm-project/clang/test/CodeGen/aarch64-neon-misc.c
index f8ba7ee..acc3c0b 100644
--- a/src/llvm-project/clang/test/CodeGen/aarch64-neon-misc.c
+++ b/src/llvm-project/clang/test/CodeGen/aarch64-neon-misc.c
@@ -1286,21 +1286,21 @@
}
// CHECK-LABEL: @test_vneg_f32(
-// CHECK: [[SUB_I:%.*]] = fsub <2 x float> <float -0.000000e+00, float -0.000000e+00>, %a
+// CHECK: [[SUB_I:%.*]] = fneg <2 x float> %a
// CHECK: ret <2 x float> [[SUB_I]]
float32x2_t test_vneg_f32(float32x2_t a) {
return vneg_f32(a);
}
// CHECK-LABEL: @test_vnegq_f32(
-// CHECK: [[SUB_I:%.*]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %a
+// CHECK: [[SUB_I:%.*]] = fneg <4 x float> %a
// CHECK: ret <4 x float> [[SUB_I]]
float32x4_t test_vnegq_f32(float32x4_t a) {
return vnegq_f32(a);
}
// CHECK-LABEL: @test_vnegq_f64(
-// CHECK: [[SUB_I:%.*]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %a
+// CHECK: [[SUB_I:%.*]] = fneg <2 x double> %a
// CHECK: ret <2 x double> [[SUB_I]]
float64x2_t test_vnegq_f64(float64x2_t a) {
return vnegq_f64(a);
diff --git a/src/llvm-project/clang/test/CodeGen/aarch64-neon-scalar-copy.c b/src/llvm-project/clang/test/CodeGen/aarch64-neon-scalar-copy.c
index d7daf82..ef7ce9c 100644
--- a/src/llvm-project/clang/test/CodeGen/aarch64-neon-scalar-copy.c
+++ b/src/llvm-project/clang/test/CodeGen/aarch64-neon-scalar-copy.c
@@ -4,9 +4,7 @@
#include <arm_neon.h>
// CHECK-LABEL: define float @test_vdups_lane_f32(<2 x float> %a) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %a to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x float>
-// CHECK: [[VDUPS_LANE:%.*]] = extractelement <2 x float> [[TMP1]], i32 1
+// CHECK: [[VDUPS_LANE:%.*]] = extractelement <2 x float> %a, i32 1
// CHECK: ret float [[VDUPS_LANE]]
float32_t test_vdups_lane_f32(float32x2_t a) {
return vdups_lane_f32(a, 1);
@@ -14,9 +12,7 @@
// CHECK-LABEL: define double @test_vdupd_lane_f64(<1 x double> %a) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <1 x double> %a to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x double>
-// CHECK: [[VDUPD_LANE:%.*]] = extractelement <1 x double> [[TMP1]], i32 0
+// CHECK: [[VDUPD_LANE:%.*]] = extractelement <1 x double> %a, i32 0
// CHECK: ret double [[VDUPD_LANE]]
float64_t test_vdupd_lane_f64(float64x1_t a) {
return vdupd_lane_f64(a, 0);
@@ -24,9 +20,7 @@
// CHECK-LABEL: define float @test_vdups_laneq_f32(<4 x float> %a) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <4 x float> %a to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x float>
-// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x float> [[TMP1]], i32 3
+// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x float> %a, i32 3
// CHECK: ret float [[VGETQ_LANE]]
float32_t test_vdups_laneq_f32(float32x4_t a) {
return vdups_laneq_f32(a, 3);
@@ -34,9 +28,7 @@
// CHECK-LABEL: define double @test_vdupd_laneq_f64(<2 x double> %a) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <2 x double> %a to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x double>
-// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x double> [[TMP1]], i32 1
+// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x double> %a, i32 1
// CHECK: ret double [[VGETQ_LANE]]
float64_t test_vdupd_laneq_f64(float64x2_t a) {
return vdupd_laneq_f64(a, 1);
@@ -52,9 +44,7 @@
// CHECK-LABEL: define i16 @test_vduph_lane_s16(<4 x i16> %a) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %a to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> [[TMP1]], i32 3
+// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> %a, i32 3
// CHECK: ret i16 [[VGET_LANE]]
int16_t test_vduph_lane_s16(int16x4_t a) {
return vduph_lane_s16(a, 3);
@@ -62,9 +52,7 @@
// CHECK-LABEL: define i32 @test_vdups_lane_s32(<2 x i32> %a) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x i32>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i32> [[TMP1]], i32 1
+// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i32> %a, i32 1
// CHECK: ret i32 [[VGET_LANE]]
int32_t test_vdups_lane_s32(int32x2_t a) {
return vdups_lane_s32(a, 1);
@@ -72,9 +60,7 @@
// CHECK-LABEL: define i64 @test_vdupd_lane_s64(<1 x i64> %a) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <1 x i64> %a to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x i64>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x i64> [[TMP1]], i32 0
+// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x i64> %a, i32 0
// CHECK: ret i64 [[VGET_LANE]]
int64_t test_vdupd_lane_s64(int64x1_t a) {
return vdupd_lane_s64(a, 0);
@@ -90,9 +76,7 @@
// CHECK-LABEL: define i16 @test_vduph_lane_u16(<4 x i16> %a) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %a to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> [[TMP1]], i32 3
+// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> %a, i32 3
// CHECK: ret i16 [[VGET_LANE]]
uint16_t test_vduph_lane_u16(uint16x4_t a) {
return vduph_lane_u16(a, 3);
@@ -100,9 +84,7 @@
// CHECK-LABEL: define i32 @test_vdups_lane_u32(<2 x i32> %a) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x i32>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i32> [[TMP1]], i32 1
+// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i32> %a, i32 1
// CHECK: ret i32 [[VGET_LANE]]
uint32_t test_vdups_lane_u32(uint32x2_t a) {
return vdups_lane_u32(a, 1);
@@ -110,9 +92,7 @@
// CHECK-LABEL: define i64 @test_vdupd_lane_u64(<1 x i64> %a) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <1 x i64> %a to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x i64>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x i64> [[TMP1]], i32 0
+// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x i64> %a, i32 0
// CHECK: ret i64 [[VGET_LANE]]
uint64_t test_vdupd_lane_u64(uint64x1_t a) {
return vdupd_lane_u64(a, 0);
@@ -127,9 +107,7 @@
// CHECK-LABEL: define i16 @test_vduph_laneq_s16(<8 x i16> %a) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %a to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16>
-// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> [[TMP1]], i32 7
+// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> %a, i32 7
// CHECK: ret i16 [[VGETQ_LANE]]
int16_t test_vduph_laneq_s16(int16x8_t a) {
return vduph_laneq_s16(a, 7);
@@ -137,9 +115,7 @@
// CHECK-LABEL: define i32 @test_vdups_laneq_s32(<4 x i32> %a) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %a to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32>
-// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x i32> [[TMP1]], i32 3
+// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x i32> %a, i32 3
// CHECK: ret i32 [[VGETQ_LANE]]
int32_t test_vdups_laneq_s32(int32x4_t a) {
return vdups_laneq_s32(a, 3);
@@ -147,9 +123,7 @@
// CHECK-LABEL: define i64 @test_vdupd_laneq_s64(<2 x i64> %a) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %a to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x i64>
-// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x i64> [[TMP1]], i32 1
+// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x i64> %a, i32 1
// CHECK: ret i64 [[VGETQ_LANE]]
int64_t test_vdupd_laneq_s64(int64x2_t a) {
return vdupd_laneq_s64(a, 1);
@@ -165,9 +139,7 @@
// CHECK-LABEL: define i16 @test_vduph_laneq_u16(<8 x i16> %a) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %a to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16>
-// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> [[TMP1]], i32 7
+// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> %a, i32 7
// CHECK: ret i16 [[VGETQ_LANE]]
uint16_t test_vduph_laneq_u16(uint16x8_t a) {
return vduph_laneq_u16(a, 7);
@@ -175,9 +147,7 @@
// CHECK-LABEL: define i32 @test_vdups_laneq_u32(<4 x i32> %a) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %a to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32>
-// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x i32> [[TMP1]], i32 3
+// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x i32> %a, i32 3
// CHECK: ret i32 [[VGETQ_LANE]]
uint32_t test_vdups_laneq_u32(uint32x4_t a) {
return vdups_laneq_u32(a, 3);
@@ -185,9 +155,7 @@
// CHECK-LABEL: define i64 @test_vdupd_laneq_u64(<2 x i64> %a) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %a to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x i64>
-// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x i64> [[TMP1]], i32 1
+// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x i64> %a, i32 1
// CHECK: ret i64 [[VGETQ_LANE]]
uint64_t test_vdupd_laneq_u64(uint64x2_t a) {
return vdupd_laneq_u64(a, 1);
@@ -201,9 +169,7 @@
}
// CHECK-LABEL: define i16 @test_vduph_lane_p16(<4 x i16> %a) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %a to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> [[TMP1]], i32 3
+// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> %a, i32 3
// CHECK: ret i16 [[VGET_LANE]]
poly16_t test_vduph_lane_p16(poly16x4_t a) {
return vduph_lane_p16(a, 3);
@@ -217,9 +183,7 @@
}
// CHECK-LABEL: define i16 @test_vduph_laneq_p16(<8 x i16> %a) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %a to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16>
-// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> [[TMP1]], i32 7
+// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> %a, i32 7
// CHECK: ret i16 [[VGETQ_LANE]]
poly16_t test_vduph_laneq_p16(poly16x8_t a) {
return vduph_laneq_p16(a, 7);
diff --git a/src/llvm-project/clang/test/CodeGen/aarch64-neon-scalar-x-indexed-elem.c b/src/llvm-project/clang/test/CodeGen/aarch64-neon-scalar-x-indexed-elem.c
index 88ab0c5..836e4db 100644
--- a/src/llvm-project/clang/test/CodeGen/aarch64-neon-scalar-x-indexed-elem.c
+++ b/src/llvm-project/clang/test/CodeGen/aarch64-neon-scalar-x-indexed-elem.c
@@ -7,9 +7,7 @@
// CHECK-LABEL: define float @test_vmuls_lane_f32(float %a, <2 x float> %b) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %b to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x float>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x float> [[TMP1]], i32 1
+// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x float> %b, i32 1
// CHECK: [[MUL:%.*]] = fmul float %a, [[VGET_LANE]]
// CHECK: ret float [[MUL]]
float32_t test_vmuls_lane_f32(float32_t a, float32x2_t b) {
@@ -17,9 +15,7 @@
}
// CHECK-LABEL: define double @test_vmuld_lane_f64(double %a, <1 x double> %b) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <1 x double> %b to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x double>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x double> [[TMP1]], i32 0
+// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x double> %b, i32 0
// CHECK: [[MUL:%.*]] = fmul double %a, [[VGET_LANE]]
// CHECK: ret double [[MUL]]
float64_t test_vmuld_lane_f64(float64_t a, float64x1_t b) {
@@ -27,9 +23,7 @@
}
// CHECK-LABEL: define float @test_vmuls_laneq_f32(float %a, <4 x float> %b) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <4 x float> %b to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x float>
-// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x float> [[TMP1]], i32 3
+// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x float> %b, i32 3
// CHECK: [[MUL:%.*]] = fmul float %a, [[VGETQ_LANE]]
// CHECK: ret float [[MUL]]
float32_t test_vmuls_laneq_f32(float32_t a, float32x4_t b) {
@@ -37,9 +31,7 @@
}
// CHECK-LABEL: define double @test_vmuld_laneq_f64(double %a, <2 x double> %b) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <2 x double> %b to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x double>
-// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x double> [[TMP1]], i32 1
+// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x double> %b, i32 1
// CHECK: [[MUL:%.*]] = fmul double %a, [[VGETQ_LANE]]
// CHECK: ret double [[MUL]]
float64_t test_vmuld_laneq_f64(float64_t a, float64x2_t b) {
@@ -56,9 +48,7 @@
}
// CHECK-LABEL: define float @test_vmulxs_lane_f32(float %a, <2 x float> %b) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %b to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x float>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x float> [[TMP1]], i32 1
+// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x float> %b, i32 1
// CHECK: [[VMULXS_F32_I:%.*]] = call float @llvm.aarch64.neon.fmulx.f32(float %a, float [[VGET_LANE]])
// CHECK: ret float [[VMULXS_F32_I]]
float32_t test_vmulxs_lane_f32(float32_t a, float32x2_t b) {
@@ -66,9 +56,7 @@
}
// CHECK-LABEL: define float @test_vmulxs_laneq_f32(float %a, <4 x float> %b) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <4 x float> %b to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x float>
-// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x float> [[TMP1]], i32 3
+// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x float> %b, i32 3
// CHECK: [[VMULXS_F32_I:%.*]] = call float @llvm.aarch64.neon.fmulx.f32(float %a, float [[VGETQ_LANE]])
// CHECK: ret float [[VMULXS_F32_I]]
float32_t test_vmulxs_laneq_f32(float32_t a, float32x4_t b) {
@@ -76,9 +64,7 @@
}
// CHECK-LABEL: define double @test_vmulxd_lane_f64(double %a, <1 x double> %b) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <1 x double> %b to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x double>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x double> [[TMP1]], i32 0
+// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x double> %b, i32 0
// CHECK: [[VMULXD_F64_I:%.*]] = call double @llvm.aarch64.neon.fmulx.f64(double %a, double [[VGET_LANE]])
// CHECK: ret double [[VMULXD_F64_I]]
float64_t test_vmulxd_lane_f64(float64_t a, float64x1_t b) {
@@ -86,9 +72,7 @@
}
// CHECK-LABEL: define double @test_vmulxd_laneq_f64(double %a, <2 x double> %b) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <2 x double> %b to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x double>
-// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x double> [[TMP1]], i32 1
+// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x double> %b, i32 1
// CHECK: [[VMULXD_F64_I:%.*]] = call double @llvm.aarch64.neon.fmulx.f64(double %a, double [[VGETQ_LANE]])
// CHECK: ret double [[VMULXD_F64_I]]
float64_t test_vmulxd_laneq_f64(float64_t a, float64x2_t b) {
@@ -96,16 +80,10 @@
}
// CHECK-LABEL: define <1 x double> @test_vmulx_lane_f64(<1 x double> %a, <1 x double> %b) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <1 x double> %a to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x double>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x double> [[TMP1]], i32 0
-// CHECK: [[TMP2:%.*]] = bitcast <1 x double> %b to <8 x i8>
-// CHECK: [[TMP3:%.*]] = bitcast <8 x i8> [[TMP2]] to <1 x double>
-// CHECK: [[VGET_LANE6:%.*]] = extractelement <1 x double> [[TMP3]], i32 0
+// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x double> %a, i32 0
+// CHECK: [[VGET_LANE6:%.*]] = extractelement <1 x double> %b, i32 0
// CHECK: [[VMULXD_F64_I:%.*]] = call double @llvm.aarch64.neon.fmulx.f64(double [[VGET_LANE]], double [[VGET_LANE6]])
-// CHECK: [[TMP4:%.*]] = bitcast <1 x double> %a to <8 x i8>
-// CHECK: [[TMP5:%.*]] = bitcast <8 x i8> [[TMP4]] to <1 x double>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x double> [[TMP5]], double [[VMULXD_F64_I]], i32 0
+// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x double> %a, double [[VMULXD_F64_I]], i32 0
// CHECK: ret <1 x double> [[VSET_LANE]]
float64x1_t test_vmulx_lane_f64(float64x1_t a, float64x1_t b) {
return vmulx_lane_f64(a, b, 0);
@@ -113,32 +91,20 @@
// CHECK-LABEL: define <1 x double> @test_vmulx_laneq_f64_0(<1 x double> %a, <2 x double> %b) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <1 x double> %a to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x double>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x double> [[TMP1]], i32 0
-// CHECK: [[TMP2:%.*]] = bitcast <2 x double> %b to <16 x i8>
-// CHECK: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <2 x double>
-// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x double> [[TMP3]], i32 0
+// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x double> %a, i32 0
+// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x double> %b, i32 0
// CHECK: [[VMULXD_F64_I:%.*]] = call double @llvm.aarch64.neon.fmulx.f64(double [[VGET_LANE]], double [[VGETQ_LANE]])
-// CHECK: [[TMP4:%.*]] = bitcast <1 x double> %a to <8 x i8>
-// CHECK: [[TMP5:%.*]] = bitcast <8 x i8> [[TMP4]] to <1 x double>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x double> [[TMP5]], double [[VMULXD_F64_I]], i32 0
+// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x double> %a, double [[VMULXD_F64_I]], i32 0
// CHECK: ret <1 x double> [[VSET_LANE]]
float64x1_t test_vmulx_laneq_f64_0(float64x1_t a, float64x2_t b) {
return vmulx_laneq_f64(a, b, 0);
}
// CHECK-LABEL: define <1 x double> @test_vmulx_laneq_f64_1(<1 x double> %a, <2 x double> %b) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <1 x double> %a to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x double>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x double> [[TMP1]], i32 0
-// CHECK: [[TMP2:%.*]] = bitcast <2 x double> %b to <16 x i8>
-// CHECK: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <2 x double>
-// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x double> [[TMP3]], i32 1
+// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x double> %a, i32 0
+// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x double> %b, i32 1
// CHECK: [[VMULXD_F64_I:%.*]] = call double @llvm.aarch64.neon.fmulx.f64(double [[VGET_LANE]], double [[VGETQ_LANE]])
-// CHECK: [[TMP4:%.*]] = bitcast <1 x double> %a to <8 x i8>
-// CHECK: [[TMP5:%.*]] = bitcast <8 x i8> [[TMP4]] to <1 x double>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x double> [[TMP5]], double [[VMULXD_F64_I]], i32 0
+// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x double> %a, double [[VMULXD_F64_I]], i32 0
// CHECK: ret <1 x double> [[VSET_LANE]]
float64x1_t test_vmulx_laneq_f64_1(float64x1_t a, float64x2_t b) {
return vmulx_laneq_f64(a, b, 1);
@@ -146,9 +112,7 @@
// CHECK-LABEL: define float @test_vfmas_lane_f32(float %a, float %b, <2 x float> %c) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %c to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x float>
-// CHECK: [[EXTRACT:%.*]] = extractelement <2 x float> [[TMP1]], i32 1
+// CHECK: [[EXTRACT:%.*]] = extractelement <2 x float> %c, i32 1
// CHECK: [[TMP2:%.*]] = call float @llvm.fma.f32(float %b, float [[EXTRACT]], float %a)
// CHECK: ret float [[TMP2]]
float32_t test_vfmas_lane_f32(float32_t a, float32_t b, float32x2_t c) {
@@ -156,9 +120,7 @@
}
// CHECK-LABEL: define double @test_vfmad_lane_f64(double %a, double %b, <1 x double> %c) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <1 x double> %c to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x double>
-// CHECK: [[EXTRACT:%.*]] = extractelement <1 x double> [[TMP1]], i32 0
+// CHECK: [[EXTRACT:%.*]] = extractelement <1 x double> %c, i32 0
// CHECK: [[TMP2:%.*]] = call double @llvm.fma.f64(double %b, double [[EXTRACT]], double %a)
// CHECK: ret double [[TMP2]]
float64_t test_vfmad_lane_f64(float64_t a, float64_t b, float64x1_t c) {
@@ -166,9 +128,7 @@
}
// CHECK-LABEL: define double @test_vfmad_laneq_f64(double %a, double %b, <2 x double> %c) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <2 x double> %c to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x double>
-// CHECK: [[EXTRACT:%.*]] = extractelement <2 x double> [[TMP1]], i32 1
+// CHECK: [[EXTRACT:%.*]] = extractelement <2 x double> %c, i32 1
// CHECK: [[TMP2:%.*]] = call double @llvm.fma.f64(double %b, double [[EXTRACT]], double %a)
// CHECK: ret double [[TMP2]]
float64_t test_vfmad_laneq_f64(float64_t a, float64_t b, float64x2_t c) {
@@ -176,10 +136,8 @@
}
// CHECK-LABEL: define float @test_vfmss_lane_f32(float %a, float %b, <2 x float> %c) #0 {
-// CHECK: [[SUB:%.*]] = fsub float -0.000000e+00, %b
-// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %c to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x float>
-// CHECK: [[EXTRACT:%.*]] = extractelement <2 x float> [[TMP1]], i32 1
+// CHECK: [[SUB:%.*]] = fneg float %b
+// CHECK: [[EXTRACT:%.*]] = extractelement <2 x float> %c, i32 1
// CHECK: [[TMP2:%.*]] = call float @llvm.fma.f32(float [[SUB]], float [[EXTRACT]], float %a)
// CHECK: ret float [[TMP2]]
float32_t test_vfmss_lane_f32(float32_t a, float32_t b, float32x2_t c) {
@@ -201,7 +159,7 @@
}
// CHECK-LABEL: define <1 x double> @test_vfms_lane_f64(<1 x double> %a, <1 x double> %b, <1 x double> %v) #0 {
-// CHECK: [[SUB:%.*]] = fsub <1 x double> <double -0.000000e+00>, %b
+// CHECK: [[SUB:%.*]] = fneg <1 x double> %b
// CHECK: [[TMP0:%.*]] = bitcast <1 x double> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <1 x double> [[SUB]] to <8 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <1 x double> %v to <8 x i8>
@@ -231,7 +189,7 @@
}
// CHECK-LABEL: define <1 x double> @test_vfms_laneq_f64(<1 x double> %a, <1 x double> %b, <2 x double> %v) #1 {
-// CHECK: [[SUB:%.*]] = fsub <1 x double> <double -0.000000e+00>, %b
+// CHECK: [[SUB:%.*]] = fneg <1 x double> %b
// CHECK: [[TMP0:%.*]] = bitcast <1 x double> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <1 x double> [[SUB]] to <8 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <2 x double> %v to <16 x i8>
@@ -247,9 +205,7 @@
}
// CHECK-LABEL: define i32 @test_vqdmullh_lane_s16(i16 %a, <4 x i16> %b) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %b to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> [[TMP1]], i32 3
+// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> %b, i32 3
// CHECK: [[TMP2:%.*]] = insertelement <4 x i16> undef, i16 %a, i64 0
// CHECK: [[TMP3:%.*]] = insertelement <4 x i16> undef, i16 [[VGET_LANE]], i64 0
// CHECK: [[VQDMULLH_S16_I:%.*]] = call <4 x i32> @llvm.aarch64.neon.sqdmull.v4i32(<4 x i16> [[TMP2]], <4 x i16> [[TMP3]])
@@ -260,9 +216,7 @@
}
// CHECK-LABEL: define i64 @test_vqdmulls_lane_s32(i32 %a, <2 x i32> %b) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %b to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x i32>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i32> [[TMP1]], i32 1
+// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i32> %b, i32 1
// CHECK: [[VQDMULLS_S32_I:%.*]] = call i64 @llvm.aarch64.neon.sqdmulls.scalar(i32 %a, i32 [[VGET_LANE]])
// CHECK: ret i64 [[VQDMULLS_S32_I]]
int64_t test_vqdmulls_lane_s32(int32_t a, int32x2_t b) {
@@ -270,9 +224,7 @@
}
// CHECK-LABEL: define i32 @test_vqdmullh_laneq_s16(i16 %a, <8 x i16> %b) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %b to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16>
-// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> [[TMP1]], i32 7
+// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> %b, i32 7
// CHECK: [[TMP2:%.*]] = insertelement <4 x i16> undef, i16 %a, i64 0
// CHECK: [[TMP3:%.*]] = insertelement <4 x i16> undef, i16 [[VGETQ_LANE]], i64 0
// CHECK: [[VQDMULLH_S16_I:%.*]] = call <4 x i32> @llvm.aarch64.neon.sqdmull.v4i32(<4 x i16> [[TMP2]], <4 x i16> [[TMP3]])
@@ -283,9 +235,7 @@
}
// CHECK-LABEL: define i64 @test_vqdmulls_laneq_s32(i32 %a, <4 x i32> %b) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %b to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32>
-// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x i32> [[TMP1]], i32 3
+// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x i32> %b, i32 3
// CHECK: [[VQDMULLS_S32_I:%.*]] = call i64 @llvm.aarch64.neon.sqdmulls.scalar(i32 %a, i32 [[VGETQ_LANE]])
// CHECK: ret i64 [[VQDMULLS_S32_I]]
int64_t test_vqdmulls_laneq_s32(int32_t a, int32x4_t b) {
@@ -293,9 +243,7 @@
}
// CHECK-LABEL: define i16 @test_vqdmulhh_lane_s16(i16 %a, <4 x i16> %b) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %b to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> [[TMP1]], i32 3
+// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> %b, i32 3
// CHECK: [[TMP2:%.*]] = insertelement <4 x i16> undef, i16 %a, i64 0
// CHECK: [[TMP3:%.*]] = insertelement <4 x i16> undef, i16 [[VGET_LANE]], i64 0
// CHECK: [[VQDMULHH_S16_I:%.*]] = call <4 x i16> @llvm.aarch64.neon.sqdmulh.v4i16(<4 x i16> [[TMP2]], <4 x i16> [[TMP3]])
@@ -306,9 +254,7 @@
}
// CHECK-LABEL: define i32 @test_vqdmulhs_lane_s32(i32 %a, <2 x i32> %b) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %b to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x i32>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i32> [[TMP1]], i32 1
+// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i32> %b, i32 1
// CHECK: [[VQDMULHS_S32_I:%.*]] = call i32 @llvm.aarch64.neon.sqdmulh.i32(i32 %a, i32 [[VGET_LANE]])
// CHECK: ret i32 [[VQDMULHS_S32_I]]
int32_t test_vqdmulhs_lane_s32(int32_t a, int32x2_t b) {
@@ -317,9 +263,7 @@
// CHECK-LABEL: define i16 @test_vqdmulhh_laneq_s16(i16 %a, <8 x i16> %b) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %b to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16>
-// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> [[TMP1]], i32 7
+// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> %b, i32 7
// CHECK: [[TMP2:%.*]] = insertelement <4 x i16> undef, i16 %a, i64 0
// CHECK: [[TMP3:%.*]] = insertelement <4 x i16> undef, i16 [[VGETQ_LANE]], i64 0
// CHECK: [[VQDMULHH_S16_I:%.*]] = call <4 x i16> @llvm.aarch64.neon.sqdmulh.v4i16(<4 x i16> [[TMP2]], <4 x i16> [[TMP3]])
@@ -331,9 +275,7 @@
// CHECK-LABEL: define i32 @test_vqdmulhs_laneq_s32(i32 %a, <4 x i32> %b) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %b to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32>
-// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x i32> [[TMP1]], i32 3
+// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x i32> %b, i32 3
// CHECK: [[VQDMULHS_S32_I:%.*]] = call i32 @llvm.aarch64.neon.sqdmulh.i32(i32 %a, i32 [[VGETQ_LANE]])
// CHECK: ret i32 [[VQDMULHS_S32_I]]
int32_t test_vqdmulhs_laneq_s32(int32_t a, int32x4_t b) {
@@ -341,9 +283,7 @@
}
// CHECK-LABEL: define i16 @test_vqrdmulhh_lane_s16(i16 %a, <4 x i16> %b) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %b to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> [[TMP1]], i32 3
+// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> %b, i32 3
// CHECK: [[TMP2:%.*]] = insertelement <4 x i16> undef, i16 %a, i64 0
// CHECK: [[TMP3:%.*]] = insertelement <4 x i16> undef, i16 [[VGET_LANE]], i64 0
// CHECK: [[VQRDMULHH_S16_I:%.*]] = call <4 x i16> @llvm.aarch64.neon.sqrdmulh.v4i16(<4 x i16> [[TMP2]], <4 x i16> [[TMP3]])
@@ -354,9 +294,7 @@
}
// CHECK-LABEL: define i32 @test_vqrdmulhs_lane_s32(i32 %a, <2 x i32> %b) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %b to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x i32>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i32> [[TMP1]], i32 1
+// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i32> %b, i32 1
// CHECK: [[VQRDMULHS_S32_I:%.*]] = call i32 @llvm.aarch64.neon.sqrdmulh.i32(i32 %a, i32 [[VGET_LANE]])
// CHECK: ret i32 [[VQRDMULHS_S32_I]]
int32_t test_vqrdmulhs_lane_s32(int32_t a, int32x2_t b) {
@@ -365,9 +303,7 @@
// CHECK-LABEL: define i16 @test_vqrdmulhh_laneq_s16(i16 %a, <8 x i16> %b) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %b to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16>
-// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> [[TMP1]], i32 7
+// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> %b, i32 7
// CHECK: [[TMP2:%.*]] = insertelement <4 x i16> undef, i16 %a, i64 0
// CHECK: [[TMP3:%.*]] = insertelement <4 x i16> undef, i16 [[VGETQ_LANE]], i64 0
// CHECK: [[VQRDMULHH_S16_I:%.*]] = call <4 x i16> @llvm.aarch64.neon.sqrdmulh.v4i16(<4 x i16> [[TMP2]], <4 x i16> [[TMP3]])
@@ -379,9 +315,7 @@
// CHECK-LABEL: define i32 @test_vqrdmulhs_laneq_s32(i32 %a, <4 x i32> %b) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %b to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32>
-// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x i32> [[TMP1]], i32 3
+// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x i32> %b, i32 3
// CHECK: [[VQRDMULHS_S32_I:%.*]] = call i32 @llvm.aarch64.neon.sqrdmulh.i32(i32 %a, i32 [[VGETQ_LANE]])
// CHECK: ret i32 [[VQRDMULHS_S32_I]]
int32_t test_vqrdmulhs_laneq_s32(int32_t a, int32x4_t b) {
@@ -389,9 +323,7 @@
}
// CHECK-LABEL: define i32 @test_vqdmlalh_lane_s16(i32 %a, i16 %b, <4 x i16> %c) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %c to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16>
-// CHECK: [[LANE:%.*]] = extractelement <4 x i16> [[TMP1]], i32 3
+// CHECK: [[LANE:%.*]] = extractelement <4 x i16> %c, i32 3
// CHECK: [[TMP2:%.*]] = insertelement <4 x i16> undef, i16 %b, i64 0
// CHECK: [[TMP3:%.*]] = insertelement <4 x i16> undef, i16 [[LANE]], i64 0
// CHECK: [[VQDMLXL:%.*]] = call <4 x i32> @llvm.aarch64.neon.sqdmull.v4i32(<4 x i16> [[TMP2]], <4 x i16> [[TMP3]])
@@ -403,9 +335,7 @@
}
// CHECK-LABEL: define i64 @test_vqdmlals_lane_s32(i64 %a, i32 %b, <2 x i32> %c) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %c to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x i32>
-// CHECK: [[LANE:%.*]] = extractelement <2 x i32> [[TMP1]], i32 1
+// CHECK: [[LANE:%.*]] = extractelement <2 x i32> %c, i32 1
// CHECK: [[VQDMLXL:%.*]] = call i64 @llvm.aarch64.neon.sqdmulls.scalar(i32 %b, i32 [[LANE]])
// CHECK: [[VQDMLXL1:%.*]] = call i64 @llvm.aarch64.neon.sqadd.i64(i64 %a, i64 [[VQDMLXL]])
// CHECK: ret i64 [[VQDMLXL1]]
@@ -414,9 +344,7 @@
}
// CHECK-LABEL: define i32 @test_vqdmlalh_laneq_s16(i32 %a, i16 %b, <8 x i16> %c) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %c to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16>
-// CHECK: [[LANE:%.*]] = extractelement <8 x i16> [[TMP1]], i32 7
+// CHECK: [[LANE:%.*]] = extractelement <8 x i16> %c, i32 7
// CHECK: [[TMP2:%.*]] = insertelement <4 x i16> undef, i16 %b, i64 0
// CHECK: [[TMP3:%.*]] = insertelement <4 x i16> undef, i16 [[LANE]], i64 0
// CHECK: [[VQDMLXL:%.*]] = call <4 x i32> @llvm.aarch64.neon.sqdmull.v4i32(<4 x i16> [[TMP2]], <4 x i16> [[TMP3]])
@@ -428,9 +356,7 @@
}
// CHECK-LABEL: define i64 @test_vqdmlals_laneq_s32(i64 %a, i32 %b, <4 x i32> %c) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %c to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32>
-// CHECK: [[LANE:%.*]] = extractelement <4 x i32> [[TMP1]], i32 3
+// CHECK: [[LANE:%.*]] = extractelement <4 x i32> %c, i32 3
// CHECK: [[VQDMLXL:%.*]] = call i64 @llvm.aarch64.neon.sqdmulls.scalar(i32 %b, i32 [[LANE]])
// CHECK: [[VQDMLXL1:%.*]] = call i64 @llvm.aarch64.neon.sqadd.i64(i64 %a, i64 [[VQDMLXL]])
// CHECK: ret i64 [[VQDMLXL1]]
@@ -439,9 +365,7 @@
}
// CHECK-LABEL: define i32 @test_vqdmlslh_lane_s16(i32 %a, i16 %b, <4 x i16> %c) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %c to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16>
-// CHECK: [[LANE:%.*]] = extractelement <4 x i16> [[TMP1]], i32 3
+// CHECK: [[LANE:%.*]] = extractelement <4 x i16> %c, i32 3
// CHECK: [[TMP2:%.*]] = insertelement <4 x i16> undef, i16 %b, i64 0
// CHECK: [[TMP3:%.*]] = insertelement <4 x i16> undef, i16 [[LANE]], i64 0
// CHECK: [[VQDMLXL:%.*]] = call <4 x i32> @llvm.aarch64.neon.sqdmull.v4i32(<4 x i16> [[TMP2]], <4 x i16> [[TMP3]])
@@ -453,9 +377,7 @@
}
// CHECK-LABEL: define i64 @test_vqdmlsls_lane_s32(i64 %a, i32 %b, <2 x i32> %c) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %c to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x i32>
-// CHECK: [[LANE:%.*]] = extractelement <2 x i32> [[TMP1]], i32 1
+// CHECK: [[LANE:%.*]] = extractelement <2 x i32> %c, i32 1
// CHECK: [[VQDMLXL:%.*]] = call i64 @llvm.aarch64.neon.sqdmulls.scalar(i32 %b, i32 [[LANE]])
// CHECK: [[VQDMLXL1:%.*]] = call i64 @llvm.aarch64.neon.sqsub.i64(i64 %a, i64 [[VQDMLXL]])
// CHECK: ret i64 [[VQDMLXL1]]
@@ -464,9 +386,7 @@
}
// CHECK-LABEL: define i32 @test_vqdmlslh_laneq_s16(i32 %a, i16 %b, <8 x i16> %c) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %c to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16>
-// CHECK: [[LANE:%.*]] = extractelement <8 x i16> [[TMP1]], i32 7
+// CHECK: [[LANE:%.*]] = extractelement <8 x i16> %c, i32 7
// CHECK: [[TMP2:%.*]] = insertelement <4 x i16> undef, i16 %b, i64 0
// CHECK: [[TMP3:%.*]] = insertelement <4 x i16> undef, i16 [[LANE]], i64 0
// CHECK: [[VQDMLXL:%.*]] = call <4 x i32> @llvm.aarch64.neon.sqdmull.v4i32(<4 x i16> [[TMP2]], <4 x i16> [[TMP3]])
@@ -478,9 +398,7 @@
}
// CHECK-LABEL: define i64 @test_vqdmlsls_laneq_s32(i64 %a, i32 %b, <4 x i32> %c) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %c to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32>
-// CHECK: [[LANE:%.*]] = extractelement <4 x i32> [[TMP1]], i32 3
+// CHECK: [[LANE:%.*]] = extractelement <4 x i32> %c, i32 3
// CHECK: [[VQDMLXL:%.*]] = call i64 @llvm.aarch64.neon.sqdmulls.scalar(i32 %b, i32 [[LANE]])
// CHECK: [[VQDMLXL1:%.*]] = call i64 @llvm.aarch64.neon.sqsub.i64(i64 %a, i64 [[VQDMLXL]])
// CHECK: ret i64 [[VQDMLXL1]]
@@ -491,16 +409,10 @@
// CHECK-LABEL: define <1 x double> @test_vmulx_lane_f64_0() #0 {
// CHECK: [[TMP0:%.*]] = bitcast i64 4599917171378402754 to <1 x double>
// CHECK: [[TMP1:%.*]] = bitcast i64 4606655882138939123 to <1 x double>
-// CHECK: [[TMP2:%.*]] = bitcast <1 x double> [[TMP0]] to <8 x i8>
-// CHECK: [[TMP3:%.*]] = bitcast <8 x i8> [[TMP2]] to <1 x double>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x double> [[TMP3]], i32 0
-// CHECK: [[TMP4:%.*]] = bitcast <1 x double> [[TMP1]] to <8 x i8>
-// CHECK: [[TMP5:%.*]] = bitcast <8 x i8> [[TMP4]] to <1 x double>
-// CHECK: [[VGET_LANE7:%.*]] = extractelement <1 x double> [[TMP5]], i32 0
+// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x double> [[TMP0]], i32 0
+// CHECK: [[VGET_LANE7:%.*]] = extractelement <1 x double> [[TMP1]], i32 0
// CHECK: [[VMULXD_F64_I:%.*]] = call double @llvm.aarch64.neon.fmulx.f64(double [[VGET_LANE]], double [[VGET_LANE7]])
-// CHECK: [[TMP6:%.*]] = bitcast <1 x double> [[TMP0]] to <8 x i8>
-// CHECK: [[TMP7:%.*]] = bitcast <8 x i8> [[TMP6]] to <1 x double>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x double> [[TMP7]], double [[VMULXD_F64_I]], i32 0
+// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x double> [[TMP0]], double [[VMULXD_F64_I]], i32 0
// CHECK: ret <1 x double> [[VSET_LANE]]
float64x1_t test_vmulx_lane_f64_0() {
float64x1_t arg1;
@@ -517,16 +429,10 @@
// CHECK: [[TMP0:%.*]] = bitcast i64 4599917171378402754 to <1 x double>
// CHECK: [[TMP1:%.*]] = bitcast i64 4606655882138939123 to <1 x double>
// CHECK: [[SHUFFLE_I:%.*]] = shufflevector <1 x double> [[TMP0]], <1 x double> [[TMP1]], <2 x i32> <i32 0, i32 1>
-// CHECK: [[TMP2:%.*]] = bitcast <1 x double> [[TMP0]] to <8 x i8>
-// CHECK: [[TMP3:%.*]] = bitcast <8 x i8> [[TMP2]] to <1 x double>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x double> [[TMP3]], i32 0
-// CHECK: [[TMP4:%.*]] = bitcast <2 x double> [[SHUFFLE_I]] to <16 x i8>
-// CHECK: [[TMP5:%.*]] = bitcast <16 x i8> [[TMP4]] to <2 x double>
-// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x double> [[TMP5]], i32 1
+// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x double> [[TMP0]], i32 0
+// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x double> [[SHUFFLE_I]], i32 1
// CHECK: [[VMULXD_F64_I:%.*]] = call double @llvm.aarch64.neon.fmulx.f64(double [[VGET_LANE]], double [[VGETQ_LANE]])
-// CHECK: [[TMP6:%.*]] = bitcast <1 x double> [[TMP0]] to <8 x i8>
-// CHECK: [[TMP7:%.*]] = bitcast <8 x i8> [[TMP6]] to <1 x double>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x double> [[TMP7]], double [[VMULXD_F64_I]], i32 0
+// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x double> [[TMP0]], double [[VMULXD_F64_I]], i32 0
// CHECK: ret <1 x double> [[VSET_LANE]]
float64x1_t test_vmulx_laneq_f64_2() {
float64x1_t arg1;
diff --git a/src/llvm-project/clang/test/CodeGen/aarch64-neon-vcadd.c b/src/llvm-project/clang/test/CodeGen/aarch64-neon-vcadd.c
new file mode 100644
index 0000000..2d721f1
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/aarch64-neon-vcadd.c
@@ -0,0 +1,65 @@
+// RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +neon \
+// RUN: -target-feature +v8.3a -target-feature +fullfp16 -S -emit-llvm -o - %s \
+// RUN: | FileCheck %s
+
+#include <arm_neon.h>
+
+void foo16x4_rot90(float16x4_t a, float16x4_t b)
+{
+// CHECK: call <4 x half> @llvm.aarch64.neon.vcadd.rot90.v4f16
+ float16x4_t result = vcadd_rot90_f16(a, b);
+}
+
+void foo32x2_rot90(float32x2_t a, float32x2_t b)
+{
+// CHECK: call <2 x float> @llvm.aarch64.neon.vcadd.rot90.v2f32
+ float32x2_t result = vcadd_rot90_f32(a, b);
+}
+
+void foo16x8_rot90(float16x8_t a, float16x8_t b)
+{
+// CHECK: call <8 x half> @llvm.aarch64.neon.vcadd.rot90.v8f16
+ float16x8_t result = vcaddq_rot90_f16(a, b);
+}
+
+void foo32x4_rot90(float32x4_t a, float32x4_t b)
+{
+// CHECK: call <4 x float> @llvm.aarch64.neon.vcadd.rot90.v4f32
+ float32x4_t result = vcaddq_rot90_f32(a, b);
+}
+
+void foo64x2_rot90(float64x2_t a, float64x2_t b)
+{
+// CHECK: call <2 x double> @llvm.aarch64.neon.vcadd.rot90.v2f64
+ float64x2_t result = vcaddq_rot90_f64(a, b);
+}
+
+void foo16x4_rot270(float16x4_t a, float16x4_t b)
+{
+// CHECK: call <4 x half> @llvm.aarch64.neon.vcadd.rot270.v4f16
+ float16x4_t result = vcadd_rot270_f16(a, b);
+}
+
+void foo32x2_rot270(float32x2_t a, float32x2_t b)
+{
+// CHECK: call <2 x float> @llvm.aarch64.neon.vcadd.rot270.v2f32
+ float32x2_t result = vcadd_rot270_f32(a, b);
+}
+
+void foo16x8_rot270(float16x8_t a, float16x8_t b)
+{
+// CHECK: call <8 x half> @llvm.aarch64.neon.vcadd.rot270.v8f16
+ float16x8_t result = vcaddq_rot270_f16(a, b);
+}
+
+void foo32x4_rot270(float32x4_t a, float32x4_t b)
+{
+// CHECK: call <4 x float> @llvm.aarch64.neon.vcadd.rot270.v4f32
+ float32x4_t result = vcaddq_rot270_f32(a, b);
+}
+
+void foo64x2_rot270(float64x2_t a, float64x2_t b)
+{
+// CHECK: call <2 x double> @llvm.aarch64.neon.vcadd.rot270.v2f64
+ float64x2_t result = vcaddq_rot270_f64(a, b);
+}
diff --git a/src/llvm-project/clang/test/CodeGen/aarch64-neon-vget.c b/src/llvm-project/clang/test/CodeGen/aarch64-neon-vget.c
index cd25ec3..cd918c7 100644
--- a/src/llvm-project/clang/test/CodeGen/aarch64-neon-vget.c
+++ b/src/llvm-project/clang/test/CodeGen/aarch64-neon-vget.c
@@ -12,18 +12,14 @@
}
// CHECK-LABEL: define i16 @test_vget_lane_u16(<4 x i16> %a) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %a to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> [[TMP1]], i32 3
+// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> %a, i32 3
// CHECK: ret i16 [[VGET_LANE]]
uint16_t test_vget_lane_u16(uint16x4_t a) {
return vget_lane_u16(a, 3);
}
// CHECK-LABEL: define i32 @test_vget_lane_u32(<2 x i32> %a) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x i32>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i32> [[TMP1]], i32 1
+// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i32> %a, i32 1
// CHECK: ret i32 [[VGET_LANE]]
uint32_t test_vget_lane_u32(uint32x2_t a) {
return vget_lane_u32(a, 1);
@@ -37,18 +33,14 @@
}
// CHECK-LABEL: define i16 @test_vget_lane_s16(<4 x i16> %a) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %a to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> [[TMP1]], i32 3
+// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> %a, i32 3
// CHECK: ret i16 [[VGET_LANE]]
int16_t test_vget_lane_s16(int16x4_t a) {
return vget_lane_s16(a, 3);
}
// CHECK-LABEL: define i32 @test_vget_lane_s32(<2 x i32> %a) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x i32>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i32> [[TMP1]], i32 1
+// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i32> %a, i32 1
// CHECK: ret i32 [[VGET_LANE]]
int32_t test_vget_lane_s32(int32x2_t a) {
return vget_lane_s32(a, 1);
@@ -62,18 +54,14 @@
}
// CHECK-LABEL: define i16 @test_vget_lane_p16(<4 x i16> %a) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %a to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> [[TMP1]], i32 3
+// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> %a, i32 3
// CHECK: ret i16 [[VGET_LANE]]
poly16_t test_vget_lane_p16(poly16x4_t a) {
return vget_lane_p16(a, 3);
}
// CHECK-LABEL: define float @test_vget_lane_f32(<2 x float> %a) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %a to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x float>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x float> [[TMP1]], i32 1
+// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x float> %a, i32 1
// CHECK: ret float [[VGET_LANE]]
float32_t test_vget_lane_f32(float32x2_t a) {
return vget_lane_f32(a, 1);
@@ -85,9 +73,7 @@
// CHECK: store <4 x half> %a, <4 x half>* [[__REINT_242]], align 8
// CHECK: [[TMP0:%.*]] = bitcast <4 x half>* [[__REINT_242]] to <4 x i16>*
// CHECK: [[TMP1:%.*]] = load <4 x i16>, <4 x i16>* [[TMP0]], align 8
-// CHECK: [[TMP2:%.*]] = bitcast <4 x i16> [[TMP1]] to <8 x i8>
-// CHECK: [[TMP3:%.*]] = bitcast <8 x i8> [[TMP2]] to <4 x i16>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> [[TMP3]], i32 1
+// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> [[TMP1]], i32 1
// CHECK: store i16 [[VGET_LANE]], i16* [[__REINT1_242]], align 2
// CHECK: [[TMP4:%.*]] = bitcast i16* [[__REINT1_242]] to half*
// CHECK: [[TMP5:%.*]] = load half, half* [[TMP4]], align 2
@@ -105,18 +91,14 @@
}
// CHECK-LABEL: define i16 @test_vgetq_lane_u16(<8 x i16> %a) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %a to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16>
-// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> [[TMP1]], i32 7
+// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> %a, i32 7
// CHECK: ret i16 [[VGETQ_LANE]]
uint16_t test_vgetq_lane_u16(uint16x8_t a) {
return vgetq_lane_u16(a, 7);
}
// CHECK-LABEL: define i32 @test_vgetq_lane_u32(<4 x i32> %a) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %a to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32>
-// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x i32> [[TMP1]], i32 3
+// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x i32> %a, i32 3
// CHECK: ret i32 [[VGETQ_LANE]]
uint32_t test_vgetq_lane_u32(uint32x4_t a) {
return vgetq_lane_u32(a, 3);
@@ -130,18 +112,14 @@
}
// CHECK-LABEL: define i16 @test_vgetq_lane_s16(<8 x i16> %a) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %a to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16>
-// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> [[TMP1]], i32 7
+// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> %a, i32 7
// CHECK: ret i16 [[VGETQ_LANE]]
int16_t test_vgetq_lane_s16(int16x8_t a) {
return vgetq_lane_s16(a, 7);
}
// CHECK-LABEL: define i32 @test_vgetq_lane_s32(<4 x i32> %a) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %a to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32>
-// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x i32> [[TMP1]], i32 3
+// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x i32> %a, i32 3
// CHECK: ret i32 [[VGETQ_LANE]]
int32_t test_vgetq_lane_s32(int32x4_t a) {
return vgetq_lane_s32(a, 3);
@@ -155,18 +133,14 @@
}
// CHECK-LABEL: define i16 @test_vgetq_lane_p16(<8 x i16> %a) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %a to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16>
-// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> [[TMP1]], i32 7
+// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> %a, i32 7
// CHECK: ret i16 [[VGETQ_LANE]]
poly16_t test_vgetq_lane_p16(poly16x8_t a) {
return vgetq_lane_p16(a, 7);
}
// CHECK-LABEL: define float @test_vgetq_lane_f32(<4 x float> %a) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <4 x float> %a to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x float>
-// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x float> [[TMP1]], i32 3
+// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x float> %a, i32 3
// CHECK: ret float [[VGETQ_LANE]]
float32_t test_vgetq_lane_f32(float32x4_t a) {
return vgetq_lane_f32(a, 3);
@@ -178,9 +152,7 @@
// CHECK: store <8 x half> %a, <8 x half>* [[__REINT_244]], align 16
// CHECK: [[TMP0:%.*]] = bitcast <8 x half>* [[__REINT_244]] to <8 x i16>*
// CHECK: [[TMP1:%.*]] = load <8 x i16>, <8 x i16>* [[TMP0]], align 16
-// CHECK: [[TMP2:%.*]] = bitcast <8 x i16> [[TMP1]] to <16 x i8>
-// CHECK: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <8 x i16>
-// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> [[TMP3]], i32 3
+// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> [[TMP1]], i32 3
// CHECK: store i16 [[VGETQ_LANE]], i16* [[__REINT1_244]], align 2
// CHECK: [[TMP4:%.*]] = bitcast i16* [[__REINT1_244]] to half*
// CHECK: [[TMP5:%.*]] = load half, half* [[TMP4]], align 2
@@ -191,36 +163,28 @@
}
// CHECK-LABEL: define i64 @test_vget_lane_s64(<1 x i64> %a) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <1 x i64> %a to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x i64>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x i64> [[TMP1]], i32 0
+// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x i64> %a, i32 0
// CHECK: ret i64 [[VGET_LANE]]
int64_t test_vget_lane_s64(int64x1_t a) {
return vget_lane_s64(a, 0);
}
// CHECK-LABEL: define i64 @test_vget_lane_u64(<1 x i64> %a) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <1 x i64> %a to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x i64>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x i64> [[TMP1]], i32 0
+// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x i64> %a, i32 0
// CHECK: ret i64 [[VGET_LANE]]
uint64_t test_vget_lane_u64(uint64x1_t a) {
return vget_lane_u64(a, 0);
}
// CHECK-LABEL: define i64 @test_vgetq_lane_s64(<2 x i64> %a) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %a to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x i64>
-// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x i64> [[TMP1]], i32 1
+// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x i64> %a, i32 1
// CHECK: ret i64 [[VGETQ_LANE]]
int64_t test_vgetq_lane_s64(int64x2_t a) {
return vgetq_lane_s64(a, 1);
}
// CHECK-LABEL: define i64 @test_vgetq_lane_u64(<2 x i64> %a) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %a to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x i64>
-// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x i64> [[TMP1]], i32 1
+// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x i64> %a, i32 1
// CHECK: ret i64 [[VGETQ_LANE]]
uint64_t test_vgetq_lane_u64(uint64x2_t a) {
return vgetq_lane_u64(a, 1);
@@ -235,18 +199,14 @@
}
// CHECK-LABEL: define <4 x i16> @test_vset_lane_u16(i16 %a, <4 x i16> %b) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %b to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i16> [[TMP1]], i16 %a, i32 3
+// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i16> %b, i16 %a, i32 3
// CHECK: ret <4 x i16> [[VSET_LANE]]
uint16x4_t test_vset_lane_u16(uint16_t a, uint16x4_t b) {
return vset_lane_u16(a, b, 3);
}
// CHECK-LABEL: define <2 x i32> @test_vset_lane_u32(i32 %a, <2 x i32> %b) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %b to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x i32>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i32> [[TMP1]], i32 %a, i32 1
+// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i32> %b, i32 %a, i32 1
// CHECK: ret <2 x i32> [[VSET_LANE]]
uint32x2_t test_vset_lane_u32(uint32_t a, uint32x2_t b) {
return vset_lane_u32(a, b, 1);
@@ -260,18 +220,14 @@
}
// CHECK-LABEL: define <4 x i16> @test_vset_lane_s16(i16 %a, <4 x i16> %b) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %b to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i16> [[TMP1]], i16 %a, i32 3
+// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i16> %b, i16 %a, i32 3
// CHECK: ret <4 x i16> [[VSET_LANE]]
int16x4_t test_vset_lane_s16(int16_t a, int16x4_t b) {
return vset_lane_s16(a, b, 3);
}
// CHECK-LABEL: define <2 x i32> @test_vset_lane_s32(i32 %a, <2 x i32> %b) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %b to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x i32>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i32> [[TMP1]], i32 %a, i32 1
+// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i32> %b, i32 %a, i32 1
// CHECK: ret <2 x i32> [[VSET_LANE]]
int32x2_t test_vset_lane_s32(int32_t a, int32x2_t b) {
return vset_lane_s32(a, b, 1);
@@ -285,18 +241,14 @@
}
// CHECK-LABEL: define <4 x i16> @test_vset_lane_p16(i16 %a, <4 x i16> %b) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %b to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i16> [[TMP1]], i16 %a, i32 3
+// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i16> %b, i16 %a, i32 3
// CHECK: ret <4 x i16> [[VSET_LANE]]
poly16x4_t test_vset_lane_p16(poly16_t a, poly16x4_t b) {
return vset_lane_p16(a, b, 3);
}
// CHECK-LABEL: define <2 x float> @test_vset_lane_f32(float %a, <2 x float> %b) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %b to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x float>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x float> [[TMP1]], float %a, i32 1
+// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x float> %b, float %a, i32 1
// CHECK: ret <2 x float> [[VSET_LANE]]
float32x2_t test_vset_lane_f32(float32_t a, float32x2_t b) {
return vset_lane_f32(a, b, 1);
@@ -313,9 +265,7 @@
// CHECK: [[TMP2:%.*]] = load i16, i16* [[TMP1]], align 2
// CHECK: [[TMP3:%.*]] = bitcast <4 x half>* [[__REINT1_246]] to <4 x i16>*
// CHECK: [[TMP4:%.*]] = load <4 x i16>, <4 x i16>* [[TMP3]], align 8
-// CHECK: [[TMP5:%.*]] = bitcast <4 x i16> [[TMP4]] to <8 x i8>
-// CHECK: [[TMP6:%.*]] = bitcast <8 x i8> [[TMP5]] to <4 x i16>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i16> [[TMP6]], i16 [[TMP2]], i32 3
+// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i16> [[TMP4]], i16 [[TMP2]], i32 3
// CHECK: store <4 x i16> [[VSET_LANE]], <4 x i16>* [[__REINT2_246]], align 8
// CHECK: [[TMP7:%.*]] = bitcast <4 x i16>* [[__REINT2_246]] to <4 x half>*
// CHECK: [[TMP8:%.*]] = load <4 x half>, <4 x half>* [[TMP7]], align 8
@@ -332,18 +282,14 @@
}
// CHECK-LABEL: define <8 x i16> @test_vsetq_lane_u16(i16 %a, <8 x i16> %b) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %b to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <8 x i16> [[TMP1]], i16 %a, i32 7
+// CHECK: [[VSET_LANE:%.*]] = insertelement <8 x i16> %b, i16 %a, i32 7
// CHECK: ret <8 x i16> [[VSET_LANE]]
uint16x8_t test_vsetq_lane_u16(uint16_t a, uint16x8_t b) {
return vsetq_lane_u16(a, b, 7);
}
// CHECK-LABEL: define <4 x i32> @test_vsetq_lane_u32(i32 %a, <4 x i32> %b) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %b to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i32> [[TMP1]], i32 %a, i32 3
+// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i32> %b, i32 %a, i32 3
// CHECK: ret <4 x i32> [[VSET_LANE]]
uint32x4_t test_vsetq_lane_u32(uint32_t a, uint32x4_t b) {
return vsetq_lane_u32(a, b, 3);
@@ -357,18 +303,14 @@
}
// CHECK-LABEL: define <8 x i16> @test_vsetq_lane_s16(i16 %a, <8 x i16> %b) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %b to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <8 x i16> [[TMP1]], i16 %a, i32 7
+// CHECK: [[VSET_LANE:%.*]] = insertelement <8 x i16> %b, i16 %a, i32 7
// CHECK: ret <8 x i16> [[VSET_LANE]]
int16x8_t test_vsetq_lane_s16(int16_t a, int16x8_t b) {
return vsetq_lane_s16(a, b, 7);
}
// CHECK-LABEL: define <4 x i32> @test_vsetq_lane_s32(i32 %a, <4 x i32> %b) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %b to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i32> [[TMP1]], i32 %a, i32 3
+// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i32> %b, i32 %a, i32 3
// CHECK: ret <4 x i32> [[VSET_LANE]]
int32x4_t test_vsetq_lane_s32(int32_t a, int32x4_t b) {
return vsetq_lane_s32(a, b, 3);
@@ -382,18 +324,14 @@
}
// CHECK-LABEL: define <8 x i16> @test_vsetq_lane_p16(i16 %a, <8 x i16> %b) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %b to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <8 x i16> [[TMP1]], i16 %a, i32 7
+// CHECK: [[VSET_LANE:%.*]] = insertelement <8 x i16> %b, i16 %a, i32 7
// CHECK: ret <8 x i16> [[VSET_LANE]]
poly16x8_t test_vsetq_lane_p16(poly16_t a, poly16x8_t b) {
return vsetq_lane_p16(a, b, 7);
}
// CHECK-LABEL: define <4 x float> @test_vsetq_lane_f32(float %a, <4 x float> %b) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <4 x float> %b to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x float>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x float> [[TMP1]], float %a, i32 3
+// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x float> %b, float %a, i32 3
// CHECK: ret <4 x float> [[VSET_LANE]]
float32x4_t test_vsetq_lane_f32(float32_t a, float32x4_t b) {
return vsetq_lane_f32(a, b, 3);
@@ -410,9 +348,7 @@
// CHECK: [[TMP2:%.*]] = load i16, i16* [[TMP1]], align 2
// CHECK: [[TMP3:%.*]] = bitcast <8 x half>* [[__REINT1_248]] to <8 x i16>*
// CHECK: [[TMP4:%.*]] = load <8 x i16>, <8 x i16>* [[TMP3]], align 16
-// CHECK: [[TMP5:%.*]] = bitcast <8 x i16> [[TMP4]] to <16 x i8>
-// CHECK: [[TMP6:%.*]] = bitcast <16 x i8> [[TMP5]] to <8 x i16>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <8 x i16> [[TMP6]], i16 [[TMP2]], i32 7
+// CHECK: [[VSET_LANE:%.*]] = insertelement <8 x i16> [[TMP4]], i16 [[TMP2]], i32 7
// CHECK: store <8 x i16> [[VSET_LANE]], <8 x i16>* [[__REINT2_248]], align 16
// CHECK: [[TMP7:%.*]] = bitcast <8 x i16>* [[__REINT2_248]] to <8 x half>*
// CHECK: [[TMP8:%.*]] = load <8 x half>, <8 x half>* [[TMP7]], align 16
@@ -422,36 +358,28 @@
}
// CHECK-LABEL: define <1 x i64> @test_vset_lane_s64(i64 %a, <1 x i64> %b) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <1 x i64> %b to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x i64>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x i64> [[TMP1]], i64 %a, i32 0
+// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x i64> %b, i64 %a, i32 0
// CHECK: ret <1 x i64> [[VSET_LANE]]
int64x1_t test_vset_lane_s64(int64_t a, int64x1_t b) {
return vset_lane_s64(a, b, 0);
}
// CHECK-LABEL: define <1 x i64> @test_vset_lane_u64(i64 %a, <1 x i64> %b) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <1 x i64> %b to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x i64>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x i64> [[TMP1]], i64 %a, i32 0
+// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x i64> %b, i64 %a, i32 0
// CHECK: ret <1 x i64> [[VSET_LANE]]
uint64x1_t test_vset_lane_u64(uint64_t a, uint64x1_t b) {
return vset_lane_u64(a, b, 0);
}
// CHECK-LABEL: define <2 x i64> @test_vsetq_lane_s64(i64 %a, <2 x i64> %b) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %b to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x i64>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i64> [[TMP1]], i64 %a, i32 1
+// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i64> %b, i64 %a, i32 1
// CHECK: ret <2 x i64> [[VSET_LANE]]
int64x2_t test_vsetq_lane_s64(int64_t a, int64x2_t b) {
return vsetq_lane_s64(a, b, 1);
}
// CHECK-LABEL: define <2 x i64> @test_vsetq_lane_u64(i64 %a, <2 x i64> %b) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %b to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x i64>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i64> [[TMP1]], i64 %a, i32 1
+// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i64> %b, i64 %a, i32 1
// CHECK: ret <2 x i64> [[VSET_LANE]]
uint64x2_t test_vsetq_lane_u64(uint64_t a, uint64x2_t b) {
return vsetq_lane_u64(a, b, 1);
diff --git a/src/llvm-project/clang/test/CodeGen/aarch64-poly64.c b/src/llvm-project/clang/test/CodeGen/aarch64-poly64.c
index cdf9169..8c4ef23 100644
--- a/src/llvm-project/clang/test/CodeGen/aarch64-poly64.c
+++ b/src/llvm-project/clang/test/CodeGen/aarch64-poly64.c
@@ -61,48 +61,36 @@
}
// CHECK-LABEL: define i64 @test_vget_lane_p64(<1 x i64> %v) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <1 x i64> %v to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x i64>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x i64> [[TMP1]], i32 0
+// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x i64> %v, i32 0
// CHECK: ret i64 [[VGET_LANE]]
poly64_t test_vget_lane_p64(poly64x1_t v) {
return vget_lane_p64(v, 0);
}
// CHECK-LABEL: define i64 @test_vgetq_lane_p64(<2 x i64> %v) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %v to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x i64>
-// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x i64> [[TMP1]], i32 1
+// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x i64> %v, i32 1
// CHECK: ret i64 [[VGETQ_LANE]]
poly64_t test_vgetq_lane_p64(poly64x2_t v) {
return vgetq_lane_p64(v, 1);
}
// CHECK-LABEL: define <1 x i64> @test_vset_lane_p64(i64 %a, <1 x i64> %v) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <1 x i64> %v to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x i64>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x i64> [[TMP1]], i64 %a, i32 0
+// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x i64> %v, i64 %a, i32 0
// CHECK: ret <1 x i64> [[VSET_LANE]]
poly64x1_t test_vset_lane_p64(poly64_t a, poly64x1_t v) {
return vset_lane_p64(a, v, 0);
}
// CHECK-LABEL: define <2 x i64> @test_vsetq_lane_p64(i64 %a, <2 x i64> %v) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %v to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x i64>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i64> [[TMP1]], i64 %a, i32 1
+// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i64> %v, i64 %a, i32 1
// CHECK: ret <2 x i64> [[VSET_LANE]]
poly64x2_t test_vsetq_lane_p64(poly64_t a, poly64x2_t v) {
return vsetq_lane_p64(a, v, 1);
}
// CHECK-LABEL: define <1 x i64> @test_vcopy_lane_p64(<1 x i64> %a, <1 x i64> %b) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <1 x i64> %b to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x i64>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x i64> [[TMP1]], i32 0
-// CHECK: [[TMP2:%.*]] = bitcast <1 x i64> %a to <8 x i8>
-// CHECK: [[TMP3:%.*]] = bitcast <8 x i8> [[TMP2]] to <1 x i64>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x i64> [[TMP3]], i64 [[VGET_LANE]], i32 0
+// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x i64> %b, i32 0
+// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x i64> %a, i64 [[VGET_LANE]], i32 0
// CHECK: ret <1 x i64> [[VSET_LANE]]
poly64x1_t test_vcopy_lane_p64(poly64x1_t a, poly64x1_t b) {
return vcopy_lane_p64(a, 0, b, 0);
@@ -110,24 +98,16 @@
}
// CHECK-LABEL: define <2 x i64> @test_vcopyq_lane_p64(<2 x i64> %a, <1 x i64> %b) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <1 x i64> %b to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x i64>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x i64> [[TMP1]], i32 0
-// CHECK: [[TMP2:%.*]] = bitcast <2 x i64> %a to <16 x i8>
-// CHECK: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <2 x i64>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i64> [[TMP3]], i64 [[VGET_LANE]], i32 1
+// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x i64> %b, i32 0
+// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i64> %a, i64 [[VGET_LANE]], i32 1
// CHECK: ret <2 x i64> [[VSET_LANE]]
poly64x2_t test_vcopyq_lane_p64(poly64x2_t a, poly64x1_t b) {
return vcopyq_lane_p64(a, 1, b, 0);
}
// CHECK-LABEL: define <2 x i64> @test_vcopyq_laneq_p64(<2 x i64> %a, <2 x i64> %b) #1 {
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %b to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x i64>
-// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x i64> [[TMP1]], i32 1
-// CHECK: [[TMP2:%.*]] = bitcast <2 x i64> %a to <16 x i8>
-// CHECK: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <2 x i64>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i64> [[TMP3]], i64 [[VGETQ_LANE]], i32 1
+// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x i64> %b, i32 1
+// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i64> %a, i64 [[VGETQ_LANE]], i32 1
// CHECK: ret <2 x i64> [[VSET_LANE]]
poly64x2_t test_vcopyq_laneq_p64(poly64x2_t a, poly64x2_t b) {
return vcopyq_laneq_p64(a, 1, b, 1);
diff --git a/src/llvm-project/clang/test/CodeGen/aarch64-sve.c b/src/llvm-project/clang/test/CodeGen/aarch64-sve.c
new file mode 100644
index 0000000..b596fbb
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/aarch64-sve.c
@@ -0,0 +1,9 @@
+// RUN: not %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve \
+// RUN: -emit-llvm -o - %s -debug-info-kind=limited 2>&1 | FileCheck %s
+
+// Placeholder test for SVE types
+
+// CHECK: cannot yet generate code for SVE type '__SVInt8_t'
+// CHECK: cannot yet generate debug info for SVE type '__SVInt8_t'
+
+__SVInt8_t *ptr;
diff --git a/src/llvm-project/clang/test/CodeGen/aarch64-tme.cpp b/src/llvm-project/clang/test/CodeGen/aarch64-tme.cpp
new file mode 100644
index 0000000..0462631
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/aarch64-tme.cpp
@@ -0,0 +1,42 @@
+// RUN: %clang_cc1 -triple aarch64-eabi -target-feature +tme -S -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -DUSE_ACLE -triple aarch64-eabi -target-feature +tme -S -emit-llvm %s -o - | FileCheck %s
+
+#define A -1
+constexpr int f() { return 65536; }
+
+#ifdef USE_ACLE
+#include "arm_acle.h"
+void test_tme_funcs() {
+ __tstart();
+ (void)__ttest();
+ __tcommit();
+ __tcancel(0x789a);
+ __tcancel(f() + A);
+}
+#else
+void test_tme_funcs() {
+ __builtin_arm_tstart();
+ (void)__builtin_arm_ttest();
+ __builtin_arm_tcommit();
+ __builtin_arm_tcancel(0x789a);
+ __builtin_arm_tcancel(f() + A);
+}
+#endif
+// CHECK: call i64 @llvm.aarch64.tstart()
+// CHECK: call i64 @llvm.aarch64.ttest()
+// CHECK: call void @llvm.aarch64.tcommit()
+// CHECK: call void @llvm.aarch64.tcancel(i64 30874)
+// CHECK: call void @llvm.aarch64.tcancel(i64 65535)
+
+// CHECK: declare i64 @llvm.aarch64.tstart() #1
+// CHECK: declare i64 @llvm.aarch64.ttest() #1
+// CHECK: declare void @llvm.aarch64.tcommit() #1
+// CHECK: declare void @llvm.aarch64.tcancel(i64 immarg) #1
+
+#ifdef __ARM_FEATURE_TME
+extern "C" void arm_feature_tme_defined() {}
+#endif
+// CHECK: define void @arm_feature_tme_defined()
+
+// CHECK: attributes #1 = { nounwind }
+
diff --git a/src/llvm-project/clang/test/CodeGen/aarch64-v8.2a-fp16-intrinsics.c b/src/llvm-project/clang/test/CodeGen/aarch64-v8.2a-fp16-intrinsics.c
index b8e1f92..45b1845 100644
--- a/src/llvm-project/clang/test/CodeGen/aarch64-v8.2a-fp16-intrinsics.c
+++ b/src/llvm-project/clang/test/CodeGen/aarch64-v8.2a-fp16-intrinsics.c
@@ -315,7 +315,7 @@
}
// CHECK-LABEL: test_vnegh_f16
-// CHECK: [[NEG:%.*]] = fsub half 0xH8000, %a
+// CHECK: [[NEG:%.*]] = fneg half %a
// CHECK: ret half [[NEG]]
float16_t test_vnegh_f16(float16_t a) {
return vnegh_f16(a);
diff --git a/src/llvm-project/clang/test/CodeGen/aarch64-v8.2a-neon-intrinsics.c b/src/llvm-project/clang/test/CodeGen/aarch64-v8.2a-neon-intrinsics.c
index a84445b..fc339fa 100644
--- a/src/llvm-project/clang/test/CodeGen/aarch64-v8.2a-neon-intrinsics.c
+++ b/src/llvm-project/clang/test/CodeGen/aarch64-v8.2a-neon-intrinsics.c
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -triple arm64-none-linux-gnu -target-feature +neon -target-feature +fullfp16 -target-feature +v8.2a\
-// RUN: -fallow-half-arguments-and-returns -S -disable-O0-optnone -emit-llvm -o - %s \
+// RUN: -fallow-half-arguments-and-returns -flax-vector-conversions=none -S -disable-O0-optnone -emit-llvm -o - %s \
// RUN: | opt -S -mem2reg \
// RUN: | FileCheck %s
@@ -146,14 +146,14 @@
// CHECK-LABEL: test_vcvt_u16_f16
// CHECK: [[VCVT:%.*]] = fptoui <4 x half> %a to <4 x i16>
// CHECK: ret <4 x i16> [[VCVT]]
-int16x4_t test_vcvt_u16_f16 (float16x4_t a) {
+uint16x4_t test_vcvt_u16_f16 (float16x4_t a) {
return vcvt_u16_f16(a);
}
// CHECK-LABEL: test_vcvtq_u16_f16
// CHECK: [[VCVT:%.*]] = fptoui <8 x half> %a to <8 x i16>
// CHECK: ret <8 x i16> [[VCVT]]
-int16x8_t test_vcvtq_u16_f16 (float16x8_t a) {
+uint16x8_t test_vcvtq_u16_f16 (float16x8_t a) {
return vcvtq_u16_f16(a);
}
@@ -167,7 +167,7 @@
// CHECK-LABEL: test_vcvta_u16_f16
// CHECK: [[VCVT:%.*]] = call <4 x i16> @llvm.aarch64.neon.fcvtau.v4i16.v4f16(<4 x half> %a)
// CHECK: ret <4 x i16> [[VCVT]]
-int16x4_t test_vcvta_u16_f16 (float16x4_t a) {
+uint16x4_t test_vcvta_u16_f16 (float16x4_t a) {
return vcvta_u16_f16(a);
}
@@ -264,14 +264,14 @@
// FIXME: Fix the zero constant when fp16 non-storage-only type becomes available.
// CHECK-LABEL: test_vneg_f16
-// CHECK: [[NEG:%.*]] = fsub <4 x half> <half 0xH8000, half 0xH8000, half 0xH8000, half 0xH8000>, %a
+// CHECK: [[NEG:%.*]] = fneg <4 x half> %a
// CHECK: ret <4 x half> [[NEG]]
float16x4_t test_vneg_f16(float16x4_t a) {
return vneg_f16(a);
}
// CHECK-LABEL: test_vnegq_f16
-// CHECK: [[NEG:%.*]] = fsub <8 x half> <half 0xH8000, half 0xH8000, half 0xH8000, half 0xH8000, half 0xH8000, half 0xH8000, half 0xH8000, half 0xH8000>, %a
+// CHECK: [[NEG:%.*]] = fneg <8 x half> %a
// CHECK: ret <8 x half> [[NEG]]
float16x8_t test_vnegq_f16(float16x8_t a) {
return vnegq_f16(a);
@@ -862,7 +862,7 @@
}
// CHECK-LABEL: test_vfms_f16
-// CHECK: [[SUB:%.*]] = fsub <4 x half> <half 0xH8000, half 0xH8000, half 0xH8000, half 0xH8000>, %b
+// CHECK: [[SUB:%.*]] = fneg <4 x half> %b
// CHECK: [[ADD:%.*]] = call <4 x half> @llvm.fma.v4f16(<4 x half> [[SUB]], <4 x half> %c, <4 x half> %a)
// CHECK: ret <4 x half> [[ADD]]
float16x4_t test_vfms_f16(float16x4_t a, float16x4_t b, float16x4_t c) {
@@ -870,7 +870,7 @@
}
// CHECK-LABEL: test_vfmsq_f16
-// CHECK: [[SUB:%.*]] = fsub <8 x half> <half 0xH8000, half 0xH8000, half 0xH8000, half 0xH8000, half 0xH8000, half 0xH8000, half 0xH8000, half 0xH8000>, %b
+// CHECK: [[SUB:%.*]] = fneg <8 x half> %b
// CHECK: [[ADD:%.*]] = call <8 x half> @llvm.fma.v8f16(<8 x half> [[SUB]], <8 x half> %c, <8 x half> %a)
// CHECK: ret <8 x half> [[ADD]]
float16x8_t test_vfmsq_f16(float16x8_t a, float16x8_t b, float16x8_t c) {
@@ -960,9 +960,7 @@
}
// CHECK-LABEL: test_vfmah_lane_f16
-// CHECK: [[TMP0:%.*]] = bitcast <4 x half> %c to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x half>
-// CHECK: [[EXTR:%.*]] = extractelement <4 x half> [[TMP1]], i32 3
+// CHECK: [[EXTR:%.*]] = extractelement <4 x half> %c, i32 3
// CHECK: [[FMA:%.*]] = call half @llvm.fma.f16(half %b, half [[EXTR]], half %a)
// CHECK: ret half [[FMA]]
float16_t test_vfmah_lane_f16(float16_t a, float16_t b, float16x4_t c) {
@@ -970,9 +968,7 @@
}
// CHECK-LABEL: test_vfmah_laneq_f16
-// CHECK: [[TMP0:%.*]] = bitcast <8 x half> %c to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x half>
-// CHECK: [[EXTR:%.*]] = extractelement <8 x half> [[TMP1]], i32 7
+// CHECK: [[EXTR:%.*]] = extractelement <8 x half> %c, i32 7
// CHECK: [[FMA:%.*]] = call half @llvm.fma.f16(half %b, half [[EXTR]], half %a)
// CHECK: ret half [[FMA]]
float16_t test_vfmah_laneq_f16(float16_t a, float16_t b, float16x8_t c) {
@@ -980,7 +976,7 @@
}
// CHECK-LABEL: test_vfms_lane_f16
-// CHECK: [[SUB:%.*]] = fsub <4 x half> <half 0xH8000, half 0xH8000, half 0xH8000, half 0xH8000>, %b
+// CHECK: [[SUB:%.*]] = fneg <4 x half> %b
// CHECK: [[TMP0:%.*]] = bitcast <4 x half> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <4 x half> [[SUB]] to <8 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <4 x half> %c to <8 x i8>
@@ -995,7 +991,7 @@
}
// CHECK-LABEL: test_vfmsq_lane_f16
-// CHECK: [[SUB:%.*]] = fsub <8 x half> <half 0xH8000, half 0xH8000, half 0xH8000, half 0xH8000, half 0xH8000, half 0xH8000, half 0xH8000, half 0xH8000>, %b
+// CHECK: [[SUB:%.*]] = fneg <8 x half> %b
// CHECK: [[TMP0:%.*]] = bitcast <8 x half> %a to <16 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <8 x half> [[SUB]] to <16 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <4 x half> %c to <8 x i8>
@@ -1010,7 +1006,7 @@
}
// CHECK-LABEL: test_vfms_laneq_f16
-// CHECK: [[SUB:%.*]] = fsub <4 x half> <half 0xH8000, half 0xH8000, half 0xH8000, half 0xH8000>, %b
+// CHECK: [[SUB:%.*]] = fneg <4 x half> %b
// CHECK: [[TMP0:%.*]] = bitcast <4 x half> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <4 x half> [[SUB]] to <8 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <8 x half> %c to <16 x i8>
@@ -1025,7 +1021,7 @@
}
// CHECK-LABEL: test_vfmsq_laneq_f16
-// CHECK: [[SUB:%.*]] = fsub <8 x half> <half 0xH8000, half 0xH8000, half 0xH8000, half 0xH8000, half 0xH8000, half 0xH8000, half 0xH8000, half 0xH8000>, %b
+// CHECK: [[SUB:%.*]] = fneg <8 x half> %b
// CHECK: [[TMP0:%.*]] = bitcast <8 x half> %a to <16 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <8 x half> [[SUB]] to <16 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <8 x half> %c to <16 x i8>
@@ -1040,7 +1036,7 @@
}
// CHECK-LABEL: test_vfms_n_f16
-// CHECK: [[SUB:%.*]] = fsub <4 x half> <half 0xH8000, half 0xH8000, half 0xH8000, half 0xH8000>, %b
+// CHECK: [[SUB:%.*]] = fneg <4 x half> %b
// CHECK: [[TMP0:%.*]] = insertelement <4 x half> undef, half %c, i32 0
// CHECK: [[TMP1:%.*]] = insertelement <4 x half> [[TMP0]], half %c, i32 1
// CHECK: [[TMP2:%.*]] = insertelement <4 x half> [[TMP1]], half %c, i32 2
@@ -1052,7 +1048,7 @@
}
// CHECK-LABEL: test_vfmsq_n_f16
-// CHECK: [[SUB:%.*]] = fsub <8 x half> <half 0xH8000, half 0xH8000, half 0xH8000, half 0xH8000, half 0xH8000, half 0xH8000, half 0xH8000, half 0xH8000>, %b
+// CHECK: [[SUB:%.*]] = fneg <8 x half> %b
// CHECK: [[TMP0:%.*]] = insertelement <8 x half> undef, half %c, i32 0
// CHECK: [[TMP1:%.*]] = insertelement <8 x half> [[TMP0]], half %c, i32 1
// CHECK: [[TMP2:%.*]] = insertelement <8 x half> [[TMP1]], half %c, i32 2
@@ -1069,11 +1065,9 @@
// CHECK-LABEL: test_vfmsh_lane_f16
// CHECK: [[TMP0:%.*]] = fpext half %b to float
-// CHECK: [[TMP1:%.*]] = fsub float -0.000000e+00, [[TMP0]]
+// CHECK: [[TMP1:%.*]] = fneg float [[TMP0]]
// CHECK: [[SUB:%.*]] = fptrunc float [[TMP1]] to half
-// CHECK: [[TMP2:%.*]] = bitcast <4 x half> %c to <8 x i8>
-// CHECK: [[TMP3:%.*]] = bitcast <8 x i8> [[TMP2]] to <4 x half>
-// CHECK: [[EXTR:%.*]] = extractelement <4 x half> [[TMP3]], i32 3
+// CHECK: [[EXTR:%.*]] = extractelement <4 x half> %c, i32 3
// CHECK: [[FMA:%.*]] = call half @llvm.fma.f16(half [[SUB]], half [[EXTR]], half %a)
// CHECK: ret half [[FMA]]
float16_t test_vfmsh_lane_f16(float16_t a, float16_t b, float16x4_t c) {
@@ -1082,11 +1076,9 @@
// CHECK-LABEL: test_vfmsh_laneq_f16
// CHECK: [[TMP0:%.*]] = fpext half %b to float
-// CHECK: [[TMP1:%.*]] = fsub float -0.000000e+00, [[TMP0]]
+// CHECK: [[TMP1:%.*]] = fneg float [[TMP0]]
// CHECK: [[SUB:%.*]] = fptrunc float [[TMP1]] to half
-// CHECK: [[TMP2:%.*]] = bitcast <8 x half> %c to <16 x i8>
-// CHECK: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <8 x half>
-// CHECK: [[EXTR:%.*]] = extractelement <8 x half> [[TMP3]], i32 7
+// CHECK: [[EXTR:%.*]] = extractelement <8 x half> %c, i32 7
// CHECK: [[FMA:%.*]] = call half @llvm.fma.f16(half [[SUB]], half [[EXTR]], half %a)
// CHECK: ret half [[FMA]]
float16_t test_vfmsh_laneq_f16(float16_t a, float16_t b, float16x8_t c) {
@@ -1231,9 +1223,7 @@
}
// CHECK-LABEL: test_vmulxh_lane_f16
-// CHECK: [[TMP0:%.*]] = bitcast <4 x half> %b to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x half>
-// CHECK: [[EXTR:%.*]] = extractelement <4 x half> [[TMP1]], i32 3
+// CHECK: [[EXTR:%.*]] = extractelement <4 x half> %b, i32 3
// CHECK: [[MULX:%.*]] = call half @llvm.aarch64.neon.fmulx.f16(half %a, half [[EXTR]]
// CHECK: ret half [[MULX]]
float16_t test_vmulxh_lane_f16(float16_t a, float16x4_t b) {
@@ -1241,9 +1231,7 @@
}
// CHECK-LABEL: test_vmulxh_laneq_f16
-// CHECK: [[TMP0:%.*]] = bitcast <8 x half> %b to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x half>
-// CHECK: [[EXTR:%.*]] = extractelement <8 x half> [[TMP1]], i32 7
+// CHECK: [[EXTR:%.*]] = extractelement <8 x half> %b, i32 7
// CHECK: [[MULX:%.*]] = call half @llvm.aarch64.neon.fmulx.f16(half %a, half [[EXTR]])
// CHECK: ret half [[MULX]]
float16_t test_vmulxh_laneq_f16(float16_t a, float16x8_t b) {
diff --git a/src/llvm-project/clang/test/CodeGen/address-space.c b/src/llvm-project/clang/test/CodeGen/address-space.c
index d6a40f3..a76d2e7 100644
--- a/src/llvm-project/clang/test/CodeGen/address-space.c
+++ b/src/llvm-project/clang/test/CodeGen/address-space.c
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm < %s | FileCheck -check-prefixes=CHECK,X86 %s
-// RUN: %clang_cc1 -triple amdgcn -emit-llvm < %s | FileCheck -check-prefixes=CHECK,AMDGCN %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm < %s | FileCheck -enable-var-scope -check-prefixes=CHECK,X86 %s
+// RUN: %clang_cc1 -triple amdgcn -emit-llvm < %s | FileCheck -enable-var-scope -check-prefixes=CHECK,AMDGCN %s
// CHECK: @foo = common addrspace(1) global
int foo __attribute__((address_space(1)));
@@ -10,11 +10,11 @@
// CHECK: @a = common global
int a __attribute__((address_space(0)));
-// CHECK-LABEL: define i32 @test1()
+// CHECK-LABEL: define i32 @test1()
// CHECK: load i32, i32 addrspace(1)* @foo
int test1() { return foo; }
-// CHECK-LABEL: define i32 @test2(i32 %i)
+// CHECK-LABEL: define i32 @test2(i32 %i)
// CHECK: load i32, i32 addrspace(1)*
// CHECK-NEXT: ret i32
int test2(int i) { return ban[i]; }
@@ -45,3 +45,17 @@
MyStruct s = pPtr[0];
pPtr[0] = s;
}
+
+// Make sure the right address space is used when doing arithmetic on a void
+// pointer. Make sure no invalid bitcast is introduced.
+
+// CHECK-LABEL: @void_ptr_arithmetic_test(
+// X86: [[ALLOCA:%.*]] = alloca i8 addrspace(1)*
+// X86-NEXT: store i8 addrspace(1)* %arg, i8 addrspace(1)** [[ALLOCA]]
+// X86-NEXT: load i8 addrspace(1)*, i8 addrspace(1)** [[ALLOCA]]
+// X86-NEXT: getelementptr i8, i8 addrspace(1)*
+// X86-NEXT: ret i8 addrspace(1)*
+void __attribute__((address_space(1)))*
+void_ptr_arithmetic_test(void __attribute__((address_space(1))) *arg) {
+ return arg + 4;
+}
diff --git a/src/llvm-project/clang/test/CodeGen/align-global-large.c b/src/llvm-project/clang/test/CodeGen/align-global-large.c
index 14f5d8d..e53323f 100644
--- a/src/llvm-project/clang/test/CodeGen/align-global-large.c
+++ b/src/llvm-project/clang/test/CodeGen/align-global-large.c
@@ -1,5 +1,5 @@
// PR13606 - Clang crashes with large alignment attribute
-// RUN: %clang -cc1 -S -emit-llvm %s -o - -triple i686-pc-gnu | FileCheck %s
+// RUN: %clang_cc1 -S -emit-llvm %s -o - -triple i686-pc-gnu | FileCheck %s
// CHECK: x
// CHECK: align
diff --git a/src/llvm-project/clang/test/CodeGen/altivec-ct.c b/src/llvm-project/clang/test/CodeGen/altivec-ct.c
index 1a3e14d..e36f556 100644
--- a/src/llvm-project/clang/test/CodeGen/altivec-ct.c
+++ b/src/llvm-project/clang/test/CodeGen/altivec-ct.c
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -triple powerpc64le-linux-gnu -S -O0 -o - %s -target-feature +altivec -target-feature +vsx | FileCheck %s -check-prefix=CHECK -check-prefix=VSX
-// RUN: %clang_cc1 -triple powerpc-linux-gnu -S -O0 -o - %s -target-feature +altivec -target-feature -vsx | FileCheck %s
+// RUN: %clang_cc1 -flax-vector-conversions=none -triple powerpc64le-linux-gnu -S -O0 -o - %s -target-feature +altivec -target-feature +vsx | FileCheck %s -check-prefix=CHECK -check-prefix=VSX
+// RUN: %clang_cc1 -flax-vector-conversions=none -triple powerpc-linux-gnu -S -O0 -o - %s -target-feature +altivec -target-feature -vsx | FileCheck %s
// REQUIRES: powerpc-registered-target
diff --git a/src/llvm-project/clang/test/CodeGen/altivec-dss.c b/src/llvm-project/clang/test/CodeGen/altivec-dss.c
new file mode 100644
index 0000000..e1b2777
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/altivec-dss.c
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -triple powerpc-linux-gnu -S -O0 -o - %s -target-feature +altivec | FileCheck %s
+
+// REQUIRES: powerpc-registered-target
+
+#include <altivec.h>
+
+// CHECK-LABEL: test1
+// CHECK: dss
+void test1() {
+ vec_dss(1);
+}
diff --git a/src/llvm-project/clang/test/CodeGen/annotations-global.c b/src/llvm-project/clang/test/CodeGen/annotations-global.c
index 2782525e..117469d 100644
--- a/src/llvm-project/clang/test/CodeGen/annotations-global.c
+++ b/src/llvm-project/clang/test/CodeGen/annotations-global.c
@@ -3,6 +3,7 @@
// RUN: FileCheck --check-prefix=A %s < %t1
// RUN: FileCheck --check-prefix=BAR %s < %t1
// RUN: FileCheck --check-prefix=FOOS %s < %t1
+// RUN: FileCheck --check-prefix=ADDRSPACE %s < %t1
// END.
static __attribute((annotate("sfoo_0"))) __attribute((annotate("sfoo_1"))) char sfoo;
@@ -14,17 +15,19 @@
sfoo = 0;
}
+__attribute((address_space(1))) __attribute__((annotate("addrspace1_ann"))) char addrspace1_var;
+
// FOOS: target triple
// FOOS: private unnamed_addr constant [7 x i8] c"sfoo_{{.}}\00", section "llvm.metadata"
// FOOS: private unnamed_addr constant [7 x i8] c"sfoo_{{.}}\00", section "llvm.metadata"
// FOOS-NOT: sfoo_
-// FOOS: @llvm.global.annotations = appending global [10 x { i8*, i8*, i8*, i32 }] {{.*}}i8* @sfoo{{.*}}i8* @sfoo{{.*}}, section "llvm.metadata"
+// FOOS: @llvm.global.annotations = appending global [11 x { i8*, i8*, i8*, i32 }] {{.*}}i8* @sfoo{{.*}}i8* @sfoo{{.*}}, section "llvm.metadata"
// FOO: target triple
// FOO: private unnamed_addr constant [6 x i8] c"foo_{{.}}\00", section "llvm.metadata"
// FOO: private unnamed_addr constant [6 x i8] c"foo_{{.}}\00", section "llvm.metadata"
// FOO-NOT: foo_
-// FOO: @llvm.global.annotations = appending global [10 x { i8*, i8*, i8*, i32 }] {{.*}}i8* @foo{{.*}}i8* @foo{{.*}}, section "llvm.metadata"
+// FOO: @llvm.global.annotations = appending global [11 x { i8*, i8*, i8*, i32 }] {{.*}}i8* @foo{{.*}}i8* @foo{{.*}}, section "llvm.metadata"
// A: target triple
// A: private unnamed_addr constant [8 x i8] c"ann_a_{{.}}\00", section "llvm.metadata"
@@ -32,10 +35,13 @@
// A: private unnamed_addr constant [8 x i8] c"ann_a_{{.}}\00", section "llvm.metadata"
// A: private unnamed_addr constant [8 x i8] c"ann_a_{{.}}\00", section "llvm.metadata"
// A-NOT: ann_a_
-// A: @llvm.global.annotations = appending global [10 x { i8*, i8*, i8*, i32 }] {{.*}}i8* bitcast (void (i8*)* @a to i8*){{.*}}i8* bitcast (void (i8*)* @a to i8*){{.*}}i8* bitcast (void (i8*)* @a to i8*){{.*}}i8* bitcast (void (i8*)* @a to i8*){{.*}}, section "llvm.metadata"
+// A: @llvm.global.annotations = appending global [11 x { i8*, i8*, i8*, i32 }] {{.*}}i8* bitcast (void (i8*)* @a to i8*){{.*}}i8* bitcast (void (i8*)* @a to i8*){{.*}}i8* bitcast (void (i8*)* @a to i8*){{.*}}i8* bitcast (void (i8*)* @a to i8*){{.*}}, section "llvm.metadata"
// BAR: target triple
// BAR: private unnamed_addr constant [6 x i8] c"bar_{{.}}\00", section "llvm.metadata"
// BAR: private unnamed_addr constant [6 x i8] c"bar_{{.}}\00", section "llvm.metadata"
// BAR-NOT: bar_
-// BAR: @llvm.global.annotations = appending global [10 x { i8*, i8*, i8*, i32 }] {{.*}}i8* @a.bar{{.*}}i8* @a.bar{{.*}}, section "llvm.metadata"
+// BAR: @llvm.global.annotations = appending global [11 x { i8*, i8*, i8*, i32 }] {{.*}}i8* @a.bar{{.*}}i8* @a.bar{{.*}}, section "llvm.metadata"
+
+// ADDRSPACE: target triple
+// ADDRSPACE: @llvm.global.annotations = appending global {{.*}} addrspacecast (i8 addrspace(1)* @addrspace1_var to i8*), {{.*}}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-arguments.c b/src/llvm-project/clang/test/CodeGen/arm-arguments.c
index 6ae7ed8..b848837 100644
--- a/src/llvm-project/clang/test/CodeGen/arm-arguments.c
+++ b/src/llvm-project/clang/test/CodeGen/arm-arguments.c
@@ -204,7 +204,7 @@
*(float32x4_t *)&s2);
return v;
}
-// APCS-GNU-LABEL: define <4 x float> @f35(i32 %i, %struct.s35* byval(%struct.s35) align 4, %struct.s35* byval(%struct.s35) align 4)
+// APCS-GNU-LABEL: define <4 x float> @f35(i32 %i, %struct.s35* byval(%struct.s35) align 4 %0, %struct.s35* byval(%struct.s35) align 4 %1)
// 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*
diff --git a/src/llvm-project/clang/test/CodeGen/arm-cmse-nonsecure.c b/src/llvm-project/clang/test/CodeGen/arm-cmse-nonsecure.c
new file mode 100644
index 0000000..2a483a7
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-cmse-nonsecure.c
@@ -0,0 +1,52 @@
+// RUN: %clang -mlittle-endian -target thumbv8m.base-eabi -emit-llvm -S -o - %s | FileCheck %s
+// RUN: %clang -mbig-endian -target thumbv8m.base-eabi -emit-llvm -S -o - %s | FileCheck %s
+
+#include <arm_cmse.h>
+
+unsigned test_cmse_primitives(void *p) {
+// CHECK: define {{.*}} i32 @test_cmse_primitives
+ cmse_address_info_t tt_val, ttt_val;
+ unsigned sum;
+
+ tt_val = cmse_TT(p);
+ ttt_val = cmse_TTT(p);
+// CHECK: call i32 @llvm.arm.cmse.tt
+// CHECK: call i32 @llvm.arm.cmse.ttt
+// CHECK-NOT: llvm.arm.cmse.tta
+// CHECK-NOT: llvm.arm.cmse.ttat
+
+ sum = tt_val.value;
+ sum += ttt_val.value;
+
+ sum += tt_val.flags.mpu_region;
+ sum += tt_val.flags.mpu_region_valid;
+ sum += tt_val.flags.read_ok;
+ sum += tt_val.flags.readwrite_ok;
+
+ return sum;
+}
+
+void *test_address_range(void *p) {
+// CHECK: define {{.*}} i8* @test_address_range
+ return cmse_check_address_range(p, 128, CMSE_MPU_UNPRIV
+ | CMSE_MPU_READWRITE
+ | CMSE_MPU_READ);
+// CHECK: call i32 @llvm.arm.cmse.tt
+// CHECK: call i32 @llvm.arm.cmse.ttt
+// CHECK-NOT: llvm.arm.cmse.tta
+// CHECK-NOT: llvm.arm.cmse.ttat
+}
+
+typedef struct {
+ int x, y, z;
+} Point;
+
+void *test_pointed_object(void *p) {
+// CHECK: define {{.*}} i8* @test_pointed_object
+ Point *pt = (Point *)p;
+ cmse_check_pointed_object(pt, CMSE_MPU_READ);
+// CHECK: call i32 @llvm.arm.cmse.tt
+// CHECK: call i32 @llvm.arm.cmse.ttt
+// CHECK-NOT: call i32 @llvm.arm.cmse.tta
+// CHECK-NOT: call i32 @llvm.arm.cmse.ttat
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-cmse-secure.c b/src/llvm-project/clang/test/CodeGen/arm-cmse-secure.c
new file mode 100644
index 0000000..7168872
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-cmse-secure.c
@@ -0,0 +1,66 @@
+// RUN: %clang -mlittle-endian -mcmse -target thumbv8m.base-eabi -emit-llvm -S -o - %s | FileCheck %s
+// RUN: %clang -mbig-endian -mcmse -target thumbv8m.base-eabi -emit-llvm -S -o - %s | FileCheck %s
+
+#include <arm_cmse.h>
+
+unsigned test_cmse_primitives(void *p) {
+// CHECK: define {{.*}} i32 @test_cmse_primitives
+ cmse_address_info_t tt_val, ttt_val;
+ cmse_address_info_t tta_val, ttat_val;
+ unsigned sum;
+
+ tt_val = cmse_TT(p);
+ ttt_val = cmse_TTT(p);
+ tta_val = cmse_TTA(p);
+ ttat_val = cmse_TTAT(p);
+// CHECK: call i32 @llvm.arm.cmse.tt
+// CHECK: call i32 @llvm.arm.cmse.ttt
+// CHECK: call i32 @llvm.arm.cmse.tta
+// CHECK: call i32 @llvm.arm.cmse.ttat
+
+ sum = tt_val.value;
+ sum += ttt_val.value;
+ sum += tta_val.value;
+ sum += ttat_val.value;
+
+ sum += tt_val.flags.mpu_region;
+ sum += tt_val.flags.sau_region;
+ sum += tt_val.flags.mpu_region_valid;
+ sum += tt_val.flags.sau_region_valid;
+ sum += tt_val.flags.read_ok;
+ sum += tt_val.flags.readwrite_ok;
+ sum += tt_val.flags.nonsecure_read_ok;
+ sum += tt_val.flags.nonsecure_readwrite_ok;
+ sum += tt_val.flags.secure;
+ sum += tt_val.flags.idau_region_valid;
+ sum += tt_val.flags.idau_region;
+
+ return sum;
+}
+
+void *test_address_range(void *p) {
+// CHECK: define {{.*}} i8* @test_address_range
+ return cmse_check_address_range(p, 128, CMSE_MPU_UNPRIV
+ | CMSE_MPU_NONSECURE
+ | CMSE_MPU_READWRITE);
+// CHECK: call i32 @llvm.arm.cmse.tt
+// CHECK: call i32 @llvm.arm.cmse.ttt
+// CHECK: call i32 @llvm.arm.cmse.tta
+// CHECK: call i32 @llvm.arm.cmse.ttat
+}
+
+typedef struct {
+ int x, y, z;
+} Point;
+
+void *test_pointed_object(void *p) {
+// CHECK: define {{.*}} i8* @test_pointed_object
+ Point *pt = (Point *)p;
+ cmse_check_pointed_object(pt, CMSE_NONSECURE
+ | CMSE_MPU_READ
+ | CMSE_AU_NONSECURE);
+// CHECK: call i32 @llvm.arm.cmse.tt
+// CHECK: call i32 @llvm.arm.cmse.ttt
+// CHECK: call i32 @llvm.arm.cmse.tta
+// CHECK: call i32 @llvm.arm.cmse.ttat
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-cmse.c b/src/llvm-project/clang/test/CodeGen/arm-cmse.c
new file mode 100644
index 0000000..0f82477
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-cmse.c
@@ -0,0 +1,20 @@
+// RUN: %clang_cc1 -triple thumbv8m.base-none-eabi -O1 -emit-llvm %s -o - | FileCheck %s
+int test_cmse_TT(void *p){
+ return __builtin_arm_cmse_TT(p);
+ // CHECK: call i32 @llvm.arm.cmse.tt(i8* %{{.*}})
+}
+
+int test_cmse_TTT(void *p){
+ return __builtin_arm_cmse_TTT(p);
+ // CHECK: call i32 @llvm.arm.cmse.ttt(i8* %{{.*}})
+}
+
+int test_cmse_TTA(void *p){
+ return __builtin_arm_cmse_TTA(p);
+ // CHECK: call i32 @llvm.arm.cmse.tta(i8* %{{.*}})
+}
+
+int test_cmse_TTAT(void *p){
+ return __builtin_arm_cmse_TTAT(p);
+ // CHECK: call i32 @llvm.arm.cmse.ttat(i8* %{{.*}})
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-float-helpers.c b/src/llvm-project/clang/test/CodeGen/arm-float-helpers.c
index 3036330..b2e6580 100644
--- a/src/llvm-project/clang/test/CodeGen/arm-float-helpers.c
+++ b/src/llvm-project/clang/test/CodeGen/arm-float-helpers.c
@@ -79,7 +79,7 @@
int fcmpun(float a, float b) { return __builtin_isunordered(a, b); }
// CHECK-LABEL: define i32 @fcmpun(float %a, float %b)
// CHECK-NOT: __aeabi_fcmpun
-// CHECK: %cmp = fcmp uno double %conv, %conv1
+// CHECK: %cmp = fcmp uno float {{.*}}, {{.*}}
double dadd(double a, double b) { return a + b; }
// CHECK-LABEL: define double @dadd(double %a, double %b)
diff --git a/src/llvm-project/clang/test/CodeGen/arm-fp16-arguments.c b/src/llvm-project/clang/test/CodeGen/arm-fp16-arguments.c
index d739f4b..34dc1a1 100644
--- a/src/llvm-project/clang/test/CodeGen/arm-fp16-arguments.c
+++ b/src/llvm-project/clang/test/CodeGen/arm-fp16-arguments.c
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -triple armv7a--none-eabi -target-abi aapcs -mfloat-abi soft -fallow-half-arguments-and-returns -emit-llvm -o - -O1 %s | FileCheck %s --check-prefix=CHECK --check-prefix=SOFT
-// RUN: %clang_cc1 -triple armv7a--none-eabi -target-abi aapcs -mfloat-abi hard -fallow-half-arguments-and-returns -emit-llvm -o - -O1 %s | FileCheck %s --check-prefix=CHECK --check-prefix=HARD
-// RUN: %clang_cc1 -triple armv7a--none-eabi -target-abi aapcs -mfloat-abi soft -fnative-half-arguments-and-returns -emit-llvm -o - -O1 %s | FileCheck %s --check-prefix=NATIVE
+// RUN: %clang_cc1 -triple armv7a--none-eabi -target-abi aapcs -mfloat-abi soft -fallow-half-arguments-and-returns -emit-llvm -o - -O2 %s | FileCheck %s --check-prefix=CHECK --check-prefix=SOFT
+// RUN: %clang_cc1 -triple armv7a--none-eabi -target-abi aapcs -mfloat-abi hard -fallow-half-arguments-and-returns -emit-llvm -o - -O2 %s | FileCheck %s --check-prefix=CHECK --check-prefix=HARD
+// RUN: %clang_cc1 -triple armv7a--none-eabi -target-abi aapcs -mfloat-abi soft -fnative-half-arguments-and-returns -emit-llvm -o - -O2 %s | FileCheck %s --check-prefix=NATIVE
__fp16 g;
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mfpu-none.c b/src/llvm-project/clang/test/CodeGen/arm-mfpu-none.c
index ae4b07d..68793c1 100644
--- a/src/llvm-project/clang/test/CodeGen/arm-mfpu-none.c
+++ b/src/llvm-project/clang/test/CodeGen/arm-mfpu-none.c
@@ -3,6 +3,7 @@
// CHECK-LABEL: compute
// CHECK-NOT: {{s[0-9]}}
+// CHECK: .fnend
float compute(float a, float b) {
return (a+b) * (a-b);
}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/admin.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/admin.c
new file mode 100644
index 0000000..56740cb
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/admin.c
@@ -0,0 +1,1556 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg -sroa -early-cse | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg -sroa -early-cse | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vcreateq_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = insertelement <2 x i64> undef, i64 [[A:%.*]], i64 0
+// CHECK-NEXT: [[TMP1:%.*]] = insertelement <2 x i64> [[TMP0]], i64 [[B:%.*]], i64 1
+// CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[TMP1]] to <8 x half>
+// CHECK-NEXT: ret <8 x half> [[TMP2]]
+//
+float16x8_t test_vcreateq_f16(uint64_t a, uint64_t b)
+{
+ return vcreateq_f16(a, b);
+}
+
+// CHECK-LABEL: @test_vcreateq_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = insertelement <2 x i64> undef, i64 [[A:%.*]], i64 0
+// CHECK-NEXT: [[TMP1:%.*]] = insertelement <2 x i64> [[TMP0]], i64 [[B:%.*]], i64 1
+// CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[TMP1]] to <4 x float>
+// CHECK-NEXT: ret <4 x float> [[TMP2]]
+//
+float32x4_t test_vcreateq_f32(uint64_t a, uint64_t b)
+{
+ return vcreateq_f32(a, b);
+}
+
+// CHECK-LABEL: @test_vcreateq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = insertelement <2 x i64> undef, i64 [[A:%.*]], i64 0
+// CHECK-NEXT: [[TMP1:%.*]] = insertelement <2 x i64> [[TMP0]], i64 [[B:%.*]], i64 1
+// CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[TMP1]] to <8 x i16>
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vcreateq_s16(uint64_t a, uint64_t b)
+{
+ return vcreateq_s16(a, b);
+}
+
+// CHECK-LABEL: @test_vcreateq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = insertelement <2 x i64> undef, i64 [[A:%.*]], i64 0
+// CHECK-NEXT: [[TMP1:%.*]] = insertelement <2 x i64> [[TMP0]], i64 [[B:%.*]], i64 1
+// CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[TMP1]] to <4 x i32>
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vcreateq_s32(uint64_t a, uint64_t b)
+{
+ return vcreateq_s32(a, b);
+}
+
+// CHECK-LABEL: @test_vcreateq_s64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = insertelement <2 x i64> undef, i64 [[A:%.*]], i64 0
+// CHECK-NEXT: [[TMP1:%.*]] = insertelement <2 x i64> [[TMP0]], i64 [[B:%.*]], i64 1
+// CHECK-NEXT: ret <2 x i64> [[TMP1]]
+//
+int64x2_t test_vcreateq_s64(uint64_t a, uint64_t b)
+{
+ return vcreateq_s64(a, b);
+}
+
+// CHECK-LABEL: @test_vcreateq_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = insertelement <2 x i64> undef, i64 [[A:%.*]], i64 0
+// CHECK-NEXT: [[TMP1:%.*]] = insertelement <2 x i64> [[TMP0]], i64 [[B:%.*]], i64 1
+// CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[TMP1]] to <16 x i8>
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vcreateq_s8(uint64_t a, uint64_t b)
+{
+ return vcreateq_s8(a, b);
+}
+
+// CHECK-LABEL: @test_vcreateq_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = insertelement <2 x i64> undef, i64 [[A:%.*]], i64 0
+// CHECK-NEXT: [[TMP1:%.*]] = insertelement <2 x i64> [[TMP0]], i64 [[B:%.*]], i64 1
+// CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[TMP1]] to <8 x i16>
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vcreateq_u16(uint64_t a, uint64_t b)
+{
+ return vcreateq_u16(a, b);
+}
+
+// CHECK-LABEL: @test_vcreateq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = insertelement <2 x i64> undef, i64 [[A:%.*]], i64 0
+// CHECK-NEXT: [[TMP1:%.*]] = insertelement <2 x i64> [[TMP0]], i64 [[B:%.*]], i64 1
+// CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[TMP1]] to <4 x i32>
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vcreateq_u32(uint64_t a, uint64_t b)
+{
+ return vcreateq_u32(a, b);
+}
+
+// CHECK-LABEL: @test_vcreateq_u64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = insertelement <2 x i64> undef, i64 [[A:%.*]], i64 0
+// CHECK-NEXT: [[TMP1:%.*]] = insertelement <2 x i64> [[TMP0]], i64 [[B:%.*]], i64 1
+// CHECK-NEXT: ret <2 x i64> [[TMP1]]
+//
+uint64x2_t test_vcreateq_u64(uint64_t a, uint64_t b)
+{
+ return vcreateq_u64(a, b);
+}
+
+// CHECK-LABEL: @test_vcreateq_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = insertelement <2 x i64> undef, i64 [[A:%.*]], i64 0
+// CHECK-NEXT: [[TMP1:%.*]] = insertelement <2 x i64> [[TMP0]], i64 [[B:%.*]], i64 1
+// CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[TMP1]] to <16 x i8>
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vcreateq_u8(uint64_t a, uint64_t b)
+{
+ return vcreateq_u8(a, b);
+}
+
+// CHECK-LABEL: @test_vreinterpretq_f16_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[A:%.*]] to <8 x half>
+// CHECK-NEXT: ret <8 x half> [[TMP0]]
+//
+float16x8_t test_vreinterpretq_f16_f32(float32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_f16(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_f16_f32(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_f16_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x i16> [[A:%.*]] to <8 x half>
+// CHECK-NEXT: ret <8 x half> [[TMP0]]
+//
+float16x8_t test_vreinterpretq_f16_s16(int16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_f16(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_f16_s16(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_f16_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x half>
+// CHECK-NEXT: ret <8 x half> [[TMP0]]
+//
+float16x8_t test_vreinterpretq_f16_s32(int32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_f16(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_f16_s32(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_f16_s64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[A:%.*]] to <8 x half>
+// CHECK-NEXT: ret <8 x half> [[TMP0]]
+//
+float16x8_t test_vreinterpretq_f16_s64(int64x2_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_f16(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_f16_s64(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_f16_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <16 x i8> [[A:%.*]] to <8 x half>
+// CHECK-NEXT: ret <8 x half> [[TMP0]]
+//
+float16x8_t test_vreinterpretq_f16_s8(int8x16_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_f16(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_f16_s8(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_f16_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x i16> [[A:%.*]] to <8 x half>
+// CHECK-NEXT: ret <8 x half> [[TMP0]]
+//
+float16x8_t test_vreinterpretq_f16_u16(uint16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_f16(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_f16_u16(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_f16_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x half>
+// CHECK-NEXT: ret <8 x half> [[TMP0]]
+//
+float16x8_t test_vreinterpretq_f16_u32(uint32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_f16(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_f16_u32(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_f16_u64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[A:%.*]] to <8 x half>
+// CHECK-NEXT: ret <8 x half> [[TMP0]]
+//
+float16x8_t test_vreinterpretq_f16_u64(uint64x2_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_f16(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_f16_u64(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_f16_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <16 x i8> [[A:%.*]] to <8 x half>
+// CHECK-NEXT: ret <8 x half> [[TMP0]]
+//
+float16x8_t test_vreinterpretq_f16_u8(uint8x16_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_f16(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_f16_u8(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_f32_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x half> [[A:%.*]] to <4 x float>
+// CHECK-NEXT: ret <4 x float> [[TMP0]]
+//
+float32x4_t test_vreinterpretq_f32_f16(float16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_f32(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_f32_f16(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_f32_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x i16> [[A:%.*]] to <4 x float>
+// CHECK-NEXT: ret <4 x float> [[TMP0]]
+//
+float32x4_t test_vreinterpretq_f32_s16(int16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_f32(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_f32_s16(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_f32_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <4 x float>
+// CHECK-NEXT: ret <4 x float> [[TMP0]]
+//
+float32x4_t test_vreinterpretq_f32_s32(int32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_f32(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_f32_s32(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_f32_s64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[A:%.*]] to <4 x float>
+// CHECK-NEXT: ret <4 x float> [[TMP0]]
+//
+float32x4_t test_vreinterpretq_f32_s64(int64x2_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_f32(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_f32_s64(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_f32_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <16 x i8> [[A:%.*]] to <4 x float>
+// CHECK-NEXT: ret <4 x float> [[TMP0]]
+//
+float32x4_t test_vreinterpretq_f32_s8(int8x16_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_f32(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_f32_s8(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_f32_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x i16> [[A:%.*]] to <4 x float>
+// CHECK-NEXT: ret <4 x float> [[TMP0]]
+//
+float32x4_t test_vreinterpretq_f32_u16(uint16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_f32(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_f32_u16(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_f32_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <4 x float>
+// CHECK-NEXT: ret <4 x float> [[TMP0]]
+//
+float32x4_t test_vreinterpretq_f32_u32(uint32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_f32(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_f32_u32(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_f32_u64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[A:%.*]] to <4 x float>
+// CHECK-NEXT: ret <4 x float> [[TMP0]]
+//
+float32x4_t test_vreinterpretq_f32_u64(uint64x2_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_f32(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_f32_u64(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_f32_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <16 x i8> [[A:%.*]] to <4 x float>
+// CHECK-NEXT: ret <4 x float> [[TMP0]]
+//
+float32x4_t test_vreinterpretq_f32_u8(uint8x16_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_f32(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_f32_u8(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_s16_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x half> [[A:%.*]] to <8 x i16>
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vreinterpretq_s16_f16(float16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_s16(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_s16_f16(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_s16_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[A:%.*]] to <8 x i16>
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vreinterpretq_s16_f32(float32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_s16(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_s16_f32(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_s16_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16>
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vreinterpretq_s16_s32(int32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_s16(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_s16_s32(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_s16_s64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[A:%.*]] to <8 x i16>
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vreinterpretq_s16_s64(int64x2_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_s16(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_s16_s64(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_s16_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <16 x i8> [[A:%.*]] to <8 x i16>
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vreinterpretq_s16_s8(int8x16_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_s16(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_s16_s8(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_s16_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: ret <8 x i16> [[A:%.*]]
+//
+int16x8_t test_vreinterpretq_s16_u16(uint16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_s16(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_s16_u16(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_s16_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16>
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vreinterpretq_s16_u32(uint32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_s16(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_s16_u32(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_s16_u64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[A:%.*]] to <8 x i16>
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vreinterpretq_s16_u64(uint64x2_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_s16(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_s16_u64(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_s16_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <16 x i8> [[A:%.*]] to <8 x i16>
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vreinterpretq_s16_u8(uint8x16_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_s16(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_s16_u8(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_s32_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x half> [[A:%.*]] to <4 x i32>
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+int32x4_t test_vreinterpretq_s32_f16(float16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_s32(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_s32_f16(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_s32_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[A:%.*]] to <4 x i32>
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+int32x4_t test_vreinterpretq_s32_f32(float32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_s32(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_s32_f32(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_s32_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x i16> [[A:%.*]] to <4 x i32>
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+int32x4_t test_vreinterpretq_s32_s16(int16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_s32(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_s32_s16(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_s32_s64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[A:%.*]] to <4 x i32>
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+int32x4_t test_vreinterpretq_s32_s64(int64x2_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_s32(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_s32_s64(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_s32_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <16 x i8> [[A:%.*]] to <4 x i32>
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+int32x4_t test_vreinterpretq_s32_s8(int8x16_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_s32(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_s32_s8(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_s32_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x i16> [[A:%.*]] to <4 x i32>
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+int32x4_t test_vreinterpretq_s32_u16(uint16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_s32(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_s32_u16(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_s32_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: ret <4 x i32> [[A:%.*]]
+//
+int32x4_t test_vreinterpretq_s32_u32(uint32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_s32(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_s32_u32(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_s32_u64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[A:%.*]] to <4 x i32>
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+int32x4_t test_vreinterpretq_s32_u64(uint64x2_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_s32(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_s32_u64(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_s32_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <16 x i8> [[A:%.*]] to <4 x i32>
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+int32x4_t test_vreinterpretq_s32_u8(uint8x16_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_s32(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_s32_u8(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_s64_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x half> [[A:%.*]] to <2 x i64>
+// CHECK-NEXT: ret <2 x i64> [[TMP0]]
+//
+int64x2_t test_vreinterpretq_s64_f16(float16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_s64(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_s64_f16(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_s64_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[A:%.*]] to <2 x i64>
+// CHECK-NEXT: ret <2 x i64> [[TMP0]]
+//
+int64x2_t test_vreinterpretq_s64_f32(float32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_s64(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_s64_f32(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_s64_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x i16> [[A:%.*]] to <2 x i64>
+// CHECK-NEXT: ret <2 x i64> [[TMP0]]
+//
+int64x2_t test_vreinterpretq_s64_s16(int16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_s64(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_s64_s16(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_s64_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x i64>
+// CHECK-NEXT: ret <2 x i64> [[TMP0]]
+//
+int64x2_t test_vreinterpretq_s64_s32(int32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_s64(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_s64_s32(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_s64_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <16 x i8> [[A:%.*]] to <2 x i64>
+// CHECK-NEXT: ret <2 x i64> [[TMP0]]
+//
+int64x2_t test_vreinterpretq_s64_s8(int8x16_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_s64(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_s64_s8(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_s64_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x i16> [[A:%.*]] to <2 x i64>
+// CHECK-NEXT: ret <2 x i64> [[TMP0]]
+//
+int64x2_t test_vreinterpretq_s64_u16(uint16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_s64(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_s64_u16(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_s64_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x i64>
+// CHECK-NEXT: ret <2 x i64> [[TMP0]]
+//
+int64x2_t test_vreinterpretq_s64_u32(uint32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_s64(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_s64_u32(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_s64_u64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: ret <2 x i64> [[A:%.*]]
+//
+int64x2_t test_vreinterpretq_s64_u64(uint64x2_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_s64(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_s64_u64(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_s64_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <16 x i8> [[A:%.*]] to <2 x i64>
+// CHECK-NEXT: ret <2 x i64> [[TMP0]]
+//
+int64x2_t test_vreinterpretq_s64_u8(uint8x16_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_s64(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_s64_u8(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_s8_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x half> [[A:%.*]] to <16 x i8>
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+int8x16_t test_vreinterpretq_s8_f16(float16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_s8(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_s8_f16(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_s8_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[A:%.*]] to <16 x i8>
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+int8x16_t test_vreinterpretq_s8_f32(float32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_s8(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_s8_f32(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_s8_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x i16> [[A:%.*]] to <16 x i8>
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+int8x16_t test_vreinterpretq_s8_s16(int16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_s8(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_s8_s16(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_s8_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8>
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+int8x16_t test_vreinterpretq_s8_s32(int32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_s8(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_s8_s32(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_s8_s64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[A:%.*]] to <16 x i8>
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+int8x16_t test_vreinterpretq_s8_s64(int64x2_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_s8(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_s8_s64(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_s8_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x i16> [[A:%.*]] to <16 x i8>
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+int8x16_t test_vreinterpretq_s8_u16(uint16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_s8(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_s8_u16(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_s8_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8>
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+int8x16_t test_vreinterpretq_s8_u32(uint32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_s8(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_s8_u32(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_s8_u64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[A:%.*]] to <16 x i8>
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+int8x16_t test_vreinterpretq_s8_u64(uint64x2_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_s8(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_s8_u64(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_s8_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: ret <16 x i8> [[A:%.*]]
+//
+int8x16_t test_vreinterpretq_s8_u8(uint8x16_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_s8(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_s8_u8(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_u16_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x half> [[A:%.*]] to <8 x i16>
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vreinterpretq_u16_f16(float16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_u16(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_u16_f16(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_u16_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[A:%.*]] to <8 x i16>
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vreinterpretq_u16_f32(float32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_u16(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_u16_f32(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_u16_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: ret <8 x i16> [[A:%.*]]
+//
+uint16x8_t test_vreinterpretq_u16_s16(int16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_u16(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_u16_s16(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_u16_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16>
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vreinterpretq_u16_s32(int32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_u16(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_u16_s32(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_u16_s64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[A:%.*]] to <8 x i16>
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vreinterpretq_u16_s64(int64x2_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_u16(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_u16_s64(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_u16_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <16 x i8> [[A:%.*]] to <8 x i16>
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vreinterpretq_u16_s8(int8x16_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_u16(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_u16_s8(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_u16_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16>
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vreinterpretq_u16_u32(uint32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_u16(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_u16_u32(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_u16_u64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[A:%.*]] to <8 x i16>
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vreinterpretq_u16_u64(uint64x2_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_u16(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_u16_u64(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_u16_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <16 x i8> [[A:%.*]] to <8 x i16>
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vreinterpretq_u16_u8(uint8x16_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_u16(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_u16_u8(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_u32_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x half> [[A:%.*]] to <4 x i32>
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vreinterpretq_u32_f16(float16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_u32(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_u32_f16(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_u32_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[A:%.*]] to <4 x i32>
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vreinterpretq_u32_f32(float32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_u32(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_u32_f32(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_u32_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x i16> [[A:%.*]] to <4 x i32>
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vreinterpretq_u32_s16(int16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_u32(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_u32_s16(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_u32_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: ret <4 x i32> [[A:%.*]]
+//
+uint32x4_t test_vreinterpretq_u32_s32(int32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_u32(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_u32_s32(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_u32_s64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[A:%.*]] to <4 x i32>
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vreinterpretq_u32_s64(int64x2_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_u32(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_u32_s64(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_u32_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <16 x i8> [[A:%.*]] to <4 x i32>
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vreinterpretq_u32_s8(int8x16_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_u32(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_u32_s8(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_u32_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x i16> [[A:%.*]] to <4 x i32>
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vreinterpretq_u32_u16(uint16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_u32(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_u32_u16(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_u32_u64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[A:%.*]] to <4 x i32>
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vreinterpretq_u32_u64(uint64x2_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_u32(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_u32_u64(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_u32_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <16 x i8> [[A:%.*]] to <4 x i32>
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vreinterpretq_u32_u8(uint8x16_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_u32(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_u32_u8(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_u64_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x half> [[A:%.*]] to <2 x i64>
+// CHECK-NEXT: ret <2 x i64> [[TMP0]]
+//
+uint64x2_t test_vreinterpretq_u64_f16(float16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_u64(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_u64_f16(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_u64_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[A:%.*]] to <2 x i64>
+// CHECK-NEXT: ret <2 x i64> [[TMP0]]
+//
+uint64x2_t test_vreinterpretq_u64_f32(float32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_u64(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_u64_f32(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_u64_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x i16> [[A:%.*]] to <2 x i64>
+// CHECK-NEXT: ret <2 x i64> [[TMP0]]
+//
+uint64x2_t test_vreinterpretq_u64_s16(int16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_u64(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_u64_s16(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_u64_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x i64>
+// CHECK-NEXT: ret <2 x i64> [[TMP0]]
+//
+uint64x2_t test_vreinterpretq_u64_s32(int32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_u64(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_u64_s32(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_u64_s64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: ret <2 x i64> [[A:%.*]]
+//
+uint64x2_t test_vreinterpretq_u64_s64(int64x2_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_u64(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_u64_s64(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_u64_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <16 x i8> [[A:%.*]] to <2 x i64>
+// CHECK-NEXT: ret <2 x i64> [[TMP0]]
+//
+uint64x2_t test_vreinterpretq_u64_s8(int8x16_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_u64(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_u64_s8(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_u64_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x i16> [[A:%.*]] to <2 x i64>
+// CHECK-NEXT: ret <2 x i64> [[TMP0]]
+//
+uint64x2_t test_vreinterpretq_u64_u16(uint16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_u64(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_u64_u16(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_u64_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x i64>
+// CHECK-NEXT: ret <2 x i64> [[TMP0]]
+//
+uint64x2_t test_vreinterpretq_u64_u32(uint32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_u64(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_u64_u32(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_u64_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <16 x i8> [[A:%.*]] to <2 x i64>
+// CHECK-NEXT: ret <2 x i64> [[TMP0]]
+//
+uint64x2_t test_vreinterpretq_u64_u8(uint8x16_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_u64(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_u64_u8(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_u8_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x half> [[A:%.*]] to <16 x i8>
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vreinterpretq_u8_f16(float16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_u8(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_u8_f16(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_u8_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[A:%.*]] to <16 x i8>
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vreinterpretq_u8_f32(float32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_u8(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_u8_f32(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_u8_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x i16> [[A:%.*]] to <16 x i8>
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vreinterpretq_u8_s16(int16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_u8(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_u8_s16(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_u8_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8>
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vreinterpretq_u8_s32(int32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_u8(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_u8_s32(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_u8_s64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[A:%.*]] to <16 x i8>
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vreinterpretq_u8_s64(int64x2_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_u8(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_u8_s64(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_u8_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: ret <16 x i8> [[A:%.*]]
+//
+uint8x16_t test_vreinterpretq_u8_s8(int8x16_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_u8(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_u8_s8(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_u8_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x i16> [[A:%.*]] to <16 x i8>
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vreinterpretq_u8_u16(uint16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_u8(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_u8_u16(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_u8_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8>
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vreinterpretq_u8_u32(uint32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_u8(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_u8_u32(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vreinterpretq_u8_u64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[A:%.*]] to <16 x i8>
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vreinterpretq_u8_u64(uint64x2_t a)
+{
+#ifdef POLYMORPHIC
+ return vreinterpretq_u8(a);
+#else /* POLYMORPHIC */
+ return vreinterpretq_u8_u64(a);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vuninitializedq_polymorphic_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: ret <8 x half> undef
+//
+float16x8_t test_vuninitializedq_polymorphic_f16(float16x8_t (*funcptr)(void))
+{
+ return vuninitializedq(funcptr());
+}
+
+// CHECK-LABEL: @test_vuninitializedq_polymorphic_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: ret <4 x float> undef
+//
+float32x4_t test_vuninitializedq_polymorphic_f32(float32x4_t (*funcptr)(void))
+{
+ return vuninitializedq(funcptr());
+}
+
+// CHECK-LABEL: @test_vuninitializedq_polymorphic_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: ret <16 x i8> undef
+//
+int8x16_t test_vuninitializedq_polymorphic_s8(int8x16_t (*funcptr)(void))
+{
+ return vuninitializedq(funcptr());
+}
+
+// CHECK-LABEL: @test_vuninitializedq_polymorphic_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: ret <8 x i16> undef
+//
+int16x8_t test_vuninitializedq_polymorphic_s16(int16x8_t (*funcptr)(void))
+{
+ return vuninitializedq(funcptr());
+}
+
+// CHECK-LABEL: @test_vuninitializedq_polymorphic_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: ret <4 x i32> undef
+//
+int32x4_t test_vuninitializedq_polymorphic_s32(int32x4_t (*funcptr)(void))
+{
+ return vuninitializedq(funcptr());
+}
+
+// CHECK-LABEL: @test_vuninitializedq_polymorphic_s64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: ret <2 x i64> undef
+//
+int64x2_t test_vuninitializedq_polymorphic_s64(int64x2_t (*funcptr)(void))
+{
+ return vuninitializedq(funcptr());
+}
+
+// CHECK-LABEL: @test_vuninitializedq_polymorphic_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: ret <16 x i8> undef
+//
+uint8x16_t test_vuninitializedq_polymorphic_u8(uint8x16_t (*funcptr)(void))
+{
+ return vuninitializedq(funcptr());
+}
+
+// CHECK-LABEL: @test_vuninitializedq_polymorphic_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: ret <8 x i16> undef
+//
+uint16x8_t test_vuninitializedq_polymorphic_u16(uint16x8_t (*funcptr)(void))
+{
+ return vuninitializedq(funcptr());
+}
+
+// CHECK-LABEL: @test_vuninitializedq_polymorphic_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: ret <4 x i32> undef
+//
+uint32x4_t test_vuninitializedq_polymorphic_u32(uint32x4_t (*funcptr)(void))
+{
+ return vuninitializedq(funcptr());
+}
+
+// CHECK-LABEL: @test_vuninitializedq_polymorphic_u64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: ret <2 x i64> undef
+//
+uint64x2_t test_vuninitializedq_polymorphic_u64(uint64x2_t (*funcptr)(void))
+{
+ return vuninitializedq(funcptr());
+}
+
+// CHECK-LABEL: @test_vuninitializedq_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: ret <8 x half> undef
+//
+float16x8_t test_vuninitializedq_f16(void)
+{
+ return vuninitializedq_f16();
+}
+
+// CHECK-LABEL: @test_vuninitializedq_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: ret <4 x float> undef
+//
+float32x4_t test_vuninitializedq_f32(void)
+{
+ return vuninitializedq_f32();
+}
+
+// CHECK-LABEL: @test_vuninitializedq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: ret <8 x i16> undef
+//
+int16x8_t test_vuninitializedq_s16(void)
+{
+ return vuninitializedq_s16();
+}
+
+// CHECK-LABEL: @test_vuninitializedq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: ret <4 x i32> undef
+//
+int32x4_t test_vuninitializedq_s32(void)
+{
+ return vuninitializedq_s32();
+}
+
+// CHECK-LABEL: @test_vuninitializedq_s64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: ret <2 x i64> undef
+//
+int64x2_t test_vuninitializedq_s64(void)
+{
+ return vuninitializedq_s64();
+}
+
+// CHECK-LABEL: @test_vuninitializedq_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: ret <16 x i8> undef
+//
+int8x16_t test_vuninitializedq_s8(void)
+{
+ return vuninitializedq_s8();
+}
+
+// CHECK-LABEL: @test_vuninitializedq_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: ret <8 x i16> undef
+//
+uint16x8_t test_vuninitializedq_u16(void)
+{
+ return vuninitializedq_u16();
+}
+
+// CHECK-LABEL: @test_vuninitializedq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: ret <4 x i32> undef
+//
+uint32x4_t test_vuninitializedq_u32(void)
+{
+ return vuninitializedq_u32();
+}
+
+// CHECK-LABEL: @test_vuninitializedq_u64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: ret <2 x i64> undef
+//
+uint64x2_t test_vuninitializedq_u64(void)
+{
+ return vuninitializedq_u64();
+}
+
+// CHECK-LABEL: @test_vuninitializedq_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: ret <16 x i8> undef
+//
+uint8x16_t test_vuninitializedq_u8(void)
+{
+ return vuninitializedq_u8();
+}
+
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/compare.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/compare.c
new file mode 100644
index 0000000..c580037
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/compare.c
@@ -0,0 +1,3150 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg -sroa | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg -sroa | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vcmpeqq_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = fcmp oeq <8 x half> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpeqq_f16(float16x8_t a, float16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpeqq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpeqq_f16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpeqq_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = fcmp oeq <4 x float> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpeqq_f32(float32x4_t a, float32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpeqq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpeqq_f32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpeqq_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = icmp eq <16 x i8> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v16i1(<16 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpeqq_s8(int8x16_t a, int8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpeqq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpeqq_s8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpeqq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = icmp eq <8 x i16> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpeqq_s16(int16x8_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpeqq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpeqq_s16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpeqq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = icmp eq <4 x i32> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpeqq_s32(int32x4_t a, int32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpeqq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpeqq_s32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpeqq_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = icmp eq <16 x i8> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v16i1(<16 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpeqq_u8(uint8x16_t a, uint8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpeqq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpeqq_u8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpeqq_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = icmp eq <8 x i16> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpeqq_u16(uint16x8_t a, uint16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpeqq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpeqq_u16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpeqq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = icmp eq <4 x i32> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpeqq_u32(uint32x4_t a, uint32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpeqq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpeqq_u32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpeqq_n_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast float [[B_COERCE:%.*]] to i32
+// CHECK-NEXT: [[TMP_0_EXTRACT_TRUNC:%.*]] = trunc i32 [[TMP0]] to i16
+// CHECK-NEXT: [[TMP1:%.*]] = bitcast i16 [[TMP_0_EXTRACT_TRUNC]] to half
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <8 x half> undef, half [[TMP1]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <8 x half> [[DOTSPLATINSERT]], <8 x half> undef, <8 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP2:%.*]] = fcmp oeq <8 x half> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP3:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP2]])
+// CHECK-NEXT: [[TMP4:%.*]] = trunc i32 [[TMP3]] to i16
+// CHECK-NEXT: ret i16 [[TMP4]]
+//
+mve_pred16_t test_vcmpeqq_n_f16(float16x8_t a, float16_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpeqq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpeqq_n_f16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpeqq_n_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <4 x float> undef, float [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <4 x float> [[DOTSPLATINSERT]], <4 x float> undef, <4 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP0:%.*]] = fcmp oeq <4 x float> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpeqq_n_f32(float32x4_t a, float32_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpeqq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpeqq_n_f32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpeqq_n_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <16 x i8> undef, i8 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <16 x i8> [[DOTSPLATINSERT]], <16 x i8> undef, <16 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP0:%.*]] = icmp eq <16 x i8> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v16i1(<16 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpeqq_n_s8(int8x16_t a, int8_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpeqq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpeqq_n_s8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpeqq_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <8 x i16> undef, i16 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <8 x i16> [[DOTSPLATINSERT]], <8 x i16> undef, <8 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP0:%.*]] = icmp eq <8 x i16> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpeqq_n_s16(int16x8_t a, int16_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpeqq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpeqq_n_s16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpeqq_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <4 x i32> undef, i32 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <4 x i32> [[DOTSPLATINSERT]], <4 x i32> undef, <4 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP0:%.*]] = icmp eq <4 x i32> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpeqq_n_s32(int32x4_t a, int32_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpeqq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpeqq_n_s32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpeqq_n_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <16 x i8> undef, i8 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <16 x i8> [[DOTSPLATINSERT]], <16 x i8> undef, <16 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP0:%.*]] = icmp eq <16 x i8> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v16i1(<16 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpeqq_n_u8(uint8x16_t a, uint8_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpeqq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpeqq_n_u8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpeqq_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <8 x i16> undef, i16 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <8 x i16> [[DOTSPLATINSERT]], <8 x i16> undef, <8 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP0:%.*]] = icmp eq <8 x i16> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpeqq_n_u16(uint16x8_t a, uint16_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpeqq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpeqq_n_u16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpeqq_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <4 x i32> undef, i32 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <4 x i32> [[DOTSPLATINSERT]], <4 x i32> undef, <4 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP0:%.*]] = icmp eq <4 x i32> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpeqq_n_u32(uint32x4_t a, uint32_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpeqq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpeqq_n_u32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpeqq_m_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = fcmp oeq <8 x half> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <8 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpeqq_m_f16(float16x8_t a, float16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpeqq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpeqq_m_f16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpeqq_m_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = fcmp oeq <4 x float> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <4 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpeqq_m_f32(float32x4_t a, float32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpeqq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpeqq_m_f32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpeqq_m_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = icmp eq <16 x i8> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <16 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v16i1(<16 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpeqq_m_s8(int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpeqq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpeqq_m_s8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpeqq_m_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = icmp eq <8 x i16> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <8 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpeqq_m_s16(int16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpeqq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpeqq_m_s16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpeqq_m_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = icmp eq <4 x i32> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <4 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpeqq_m_s32(int32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpeqq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpeqq_m_s32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpeqq_m_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = icmp eq <16 x i8> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <16 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v16i1(<16 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpeqq_m_u8(uint8x16_t a, uint8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpeqq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpeqq_m_u8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpeqq_m_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = icmp eq <8 x i16> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <8 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpeqq_m_u16(uint16x8_t a, uint16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpeqq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpeqq_m_u16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpeqq_m_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = icmp eq <4 x i32> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <4 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpeqq_m_u32(uint32x4_t a, uint32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpeqq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpeqq_m_u32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpeqq_m_n_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast float [[B_COERCE:%.*]] to i32
+// CHECK-NEXT: [[TMP_0_EXTRACT_TRUNC:%.*]] = trunc i32 [[TMP0]] to i16
+// CHECK-NEXT: [[TMP1:%.*]] = bitcast i16 [[TMP_0_EXTRACT_TRUNC]] to half
+// CHECK-NEXT: [[TMP2:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP2]])
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <8 x half> undef, half [[TMP1]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <8 x half> [[DOTSPLATINSERT]], <8 x half> undef, <8 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP4:%.*]] = fcmp oeq <8 x half> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP5:%.*]] = and <8 x i1> [[TMP3]], [[TMP4]]
+// CHECK-NEXT: [[TMP6:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP5]])
+// CHECK-NEXT: [[TMP7:%.*]] = trunc i32 [[TMP6]] to i16
+// CHECK-NEXT: ret i16 [[TMP7]]
+//
+mve_pred16_t test_vcmpeqq_m_n_f16(float16x8_t a, float16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpeqq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpeqq_m_n_f16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpeqq_m_n_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <4 x float> undef, float [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <4 x float> [[DOTSPLATINSERT]], <4 x float> undef, <4 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP2:%.*]] = fcmp oeq <4 x float> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <4 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpeqq_m_n_f32(float32x4_t a, float32_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpeqq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpeqq_m_n_f32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpeqq_m_n_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <16 x i8> undef, i8 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <16 x i8> [[DOTSPLATINSERT]], <16 x i8> undef, <16 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP2:%.*]] = icmp eq <16 x i8> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <16 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v16i1(<16 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpeqq_m_n_s8(int8x16_t a, int8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpeqq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpeqq_m_n_s8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpeqq_m_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <8 x i16> undef, i16 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <8 x i16> [[DOTSPLATINSERT]], <8 x i16> undef, <8 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP2:%.*]] = icmp eq <8 x i16> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <8 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpeqq_m_n_s16(int16x8_t a, int16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpeqq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpeqq_m_n_s16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpeqq_m_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <4 x i32> undef, i32 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <4 x i32> [[DOTSPLATINSERT]], <4 x i32> undef, <4 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP2:%.*]] = icmp eq <4 x i32> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <4 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpeqq_m_n_s32(int32x4_t a, int32_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpeqq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpeqq_m_n_s32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpeqq_m_n_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <16 x i8> undef, i8 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <16 x i8> [[DOTSPLATINSERT]], <16 x i8> undef, <16 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP2:%.*]] = icmp eq <16 x i8> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <16 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v16i1(<16 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpeqq_m_n_u8(uint8x16_t a, uint8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpeqq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpeqq_m_n_u8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpeqq_m_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <8 x i16> undef, i16 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <8 x i16> [[DOTSPLATINSERT]], <8 x i16> undef, <8 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP2:%.*]] = icmp eq <8 x i16> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <8 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpeqq_m_n_u16(uint16x8_t a, uint16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpeqq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpeqq_m_n_u16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpeqq_m_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <4 x i32> undef, i32 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <4 x i32> [[DOTSPLATINSERT]], <4 x i32> undef, <4 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP2:%.*]] = icmp eq <4 x i32> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <4 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpeqq_m_n_u32(uint32x4_t a, uint32_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpeqq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpeqq_m_n_u32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpneq_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = fcmp une <8 x half> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpneq_f16(float16x8_t a, float16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpneq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpneq_f16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpneq_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = fcmp une <4 x float> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpneq_f32(float32x4_t a, float32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpneq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpneq_f32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpneq_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = icmp ne <16 x i8> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v16i1(<16 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpneq_s8(int8x16_t a, int8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpneq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpneq_s8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpneq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = icmp ne <8 x i16> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpneq_s16(int16x8_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpneq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpneq_s16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpneq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = icmp ne <4 x i32> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpneq_s32(int32x4_t a, int32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpneq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpneq_s32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpneq_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = icmp ne <16 x i8> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v16i1(<16 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpneq_u8(uint8x16_t a, uint8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpneq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpneq_u8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpneq_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = icmp ne <8 x i16> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpneq_u16(uint16x8_t a, uint16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpneq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpneq_u16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpneq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = icmp ne <4 x i32> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpneq_u32(uint32x4_t a, uint32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpneq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpneq_u32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpneq_n_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast float [[B_COERCE:%.*]] to i32
+// CHECK-NEXT: [[TMP_0_EXTRACT_TRUNC:%.*]] = trunc i32 [[TMP0]] to i16
+// CHECK-NEXT: [[TMP1:%.*]] = bitcast i16 [[TMP_0_EXTRACT_TRUNC]] to half
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <8 x half> undef, half [[TMP1]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <8 x half> [[DOTSPLATINSERT]], <8 x half> undef, <8 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP2:%.*]] = fcmp une <8 x half> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP3:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP2]])
+// CHECK-NEXT: [[TMP4:%.*]] = trunc i32 [[TMP3]] to i16
+// CHECK-NEXT: ret i16 [[TMP4]]
+//
+mve_pred16_t test_vcmpneq_n_f16(float16x8_t a, float16_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpneq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpneq_n_f16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpneq_n_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <4 x float> undef, float [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <4 x float> [[DOTSPLATINSERT]], <4 x float> undef, <4 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP0:%.*]] = fcmp une <4 x float> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpneq_n_f32(float32x4_t a, float32_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpneq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpneq_n_f32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpneq_n_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <16 x i8> undef, i8 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <16 x i8> [[DOTSPLATINSERT]], <16 x i8> undef, <16 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP0:%.*]] = icmp ne <16 x i8> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v16i1(<16 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpneq_n_s8(int8x16_t a, int8_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpneq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpneq_n_s8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpneq_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <8 x i16> undef, i16 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <8 x i16> [[DOTSPLATINSERT]], <8 x i16> undef, <8 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP0:%.*]] = icmp ne <8 x i16> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpneq_n_s16(int16x8_t a, int16_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpneq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpneq_n_s16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpneq_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <4 x i32> undef, i32 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <4 x i32> [[DOTSPLATINSERT]], <4 x i32> undef, <4 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP0:%.*]] = icmp ne <4 x i32> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpneq_n_s32(int32x4_t a, int32_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpneq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpneq_n_s32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpneq_n_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <16 x i8> undef, i8 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <16 x i8> [[DOTSPLATINSERT]], <16 x i8> undef, <16 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP0:%.*]] = icmp ne <16 x i8> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v16i1(<16 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpneq_n_u8(uint8x16_t a, uint8_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpneq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpneq_n_u8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpneq_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <8 x i16> undef, i16 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <8 x i16> [[DOTSPLATINSERT]], <8 x i16> undef, <8 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP0:%.*]] = icmp ne <8 x i16> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpneq_n_u16(uint16x8_t a, uint16_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpneq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpneq_n_u16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpneq_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <4 x i32> undef, i32 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <4 x i32> [[DOTSPLATINSERT]], <4 x i32> undef, <4 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP0:%.*]] = icmp ne <4 x i32> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpneq_n_u32(uint32x4_t a, uint32_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpneq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpneq_n_u32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpneq_m_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = fcmp une <8 x half> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <8 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpneq_m_f16(float16x8_t a, float16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpneq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpneq_m_f16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpneq_m_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = fcmp une <4 x float> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <4 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpneq_m_f32(float32x4_t a, float32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpneq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpneq_m_f32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpneq_m_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = icmp ne <16 x i8> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <16 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v16i1(<16 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpneq_m_s8(int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpneq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpneq_m_s8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpneq_m_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = icmp ne <8 x i16> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <8 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpneq_m_s16(int16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpneq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpneq_m_s16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpneq_m_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = icmp ne <4 x i32> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <4 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpneq_m_s32(int32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpneq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpneq_m_s32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpneq_m_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = icmp ne <16 x i8> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <16 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v16i1(<16 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpneq_m_u8(uint8x16_t a, uint8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpneq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpneq_m_u8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpneq_m_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = icmp ne <8 x i16> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <8 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpneq_m_u16(uint16x8_t a, uint16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpneq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpneq_m_u16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpneq_m_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = icmp ne <4 x i32> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <4 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpneq_m_u32(uint32x4_t a, uint32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpneq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpneq_m_u32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpneq_m_n_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast float [[B_COERCE:%.*]] to i32
+// CHECK-NEXT: [[TMP_0_EXTRACT_TRUNC:%.*]] = trunc i32 [[TMP0]] to i16
+// CHECK-NEXT: [[TMP1:%.*]] = bitcast i16 [[TMP_0_EXTRACT_TRUNC]] to half
+// CHECK-NEXT: [[TMP2:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP2]])
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <8 x half> undef, half [[TMP1]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <8 x half> [[DOTSPLATINSERT]], <8 x half> undef, <8 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP4:%.*]] = fcmp une <8 x half> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP5:%.*]] = and <8 x i1> [[TMP3]], [[TMP4]]
+// CHECK-NEXT: [[TMP6:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP5]])
+// CHECK-NEXT: [[TMP7:%.*]] = trunc i32 [[TMP6]] to i16
+// CHECK-NEXT: ret i16 [[TMP7]]
+//
+mve_pred16_t test_vcmpneq_m_n_f16(float16x8_t a, float16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpneq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpneq_m_n_f16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpneq_m_n_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <4 x float> undef, float [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <4 x float> [[DOTSPLATINSERT]], <4 x float> undef, <4 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP2:%.*]] = fcmp une <4 x float> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <4 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpneq_m_n_f32(float32x4_t a, float32_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpneq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpneq_m_n_f32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpneq_m_n_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <16 x i8> undef, i8 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <16 x i8> [[DOTSPLATINSERT]], <16 x i8> undef, <16 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP2:%.*]] = icmp ne <16 x i8> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <16 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v16i1(<16 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpneq_m_n_s8(int8x16_t a, int8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpneq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpneq_m_n_s8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpneq_m_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <8 x i16> undef, i16 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <8 x i16> [[DOTSPLATINSERT]], <8 x i16> undef, <8 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP2:%.*]] = icmp ne <8 x i16> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <8 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpneq_m_n_s16(int16x8_t a, int16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpneq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpneq_m_n_s16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpneq_m_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <4 x i32> undef, i32 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <4 x i32> [[DOTSPLATINSERT]], <4 x i32> undef, <4 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP2:%.*]] = icmp ne <4 x i32> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <4 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpneq_m_n_s32(int32x4_t a, int32_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpneq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpneq_m_n_s32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpneq_m_n_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <16 x i8> undef, i8 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <16 x i8> [[DOTSPLATINSERT]], <16 x i8> undef, <16 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP2:%.*]] = icmp ne <16 x i8> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <16 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v16i1(<16 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpneq_m_n_u8(uint8x16_t a, uint8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpneq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpneq_m_n_u8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpneq_m_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <8 x i16> undef, i16 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <8 x i16> [[DOTSPLATINSERT]], <8 x i16> undef, <8 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP2:%.*]] = icmp ne <8 x i16> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <8 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpneq_m_n_u16(uint16x8_t a, uint16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpneq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpneq_m_n_u16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpneq_m_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <4 x i32> undef, i32 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <4 x i32> [[DOTSPLATINSERT]], <4 x i32> undef, <4 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP2:%.*]] = icmp ne <4 x i32> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <4 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpneq_m_n_u32(uint32x4_t a, uint32_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpneq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpneq_m_n_u32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpgeq_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = fcmp oge <8 x half> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpgeq_f16(float16x8_t a, float16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpgeq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpgeq_f16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpgeq_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = fcmp oge <4 x float> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpgeq_f32(float32x4_t a, float32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpgeq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpgeq_f32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpgeq_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = icmp sge <16 x i8> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v16i1(<16 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpgeq_s8(int8x16_t a, int8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpgeq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpgeq_s8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpgeq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = icmp sge <8 x i16> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpgeq_s16(int16x8_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpgeq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpgeq_s16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpgeq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = icmp sge <4 x i32> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpgeq_s32(int32x4_t a, int32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpgeq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpgeq_s32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpcsq_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = icmp uge <16 x i8> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v16i1(<16 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpcsq_u8(uint8x16_t a, uint8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpcsq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpcsq_u8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpcsq_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = icmp uge <8 x i16> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpcsq_u16(uint16x8_t a, uint16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpcsq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpcsq_u16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpcsq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = icmp uge <4 x i32> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpcsq_u32(uint32x4_t a, uint32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpcsq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpcsq_u32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpgeq_n_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast float [[B_COERCE:%.*]] to i32
+// CHECK-NEXT: [[TMP_0_EXTRACT_TRUNC:%.*]] = trunc i32 [[TMP0]] to i16
+// CHECK-NEXT: [[TMP1:%.*]] = bitcast i16 [[TMP_0_EXTRACT_TRUNC]] to half
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <8 x half> undef, half [[TMP1]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <8 x half> [[DOTSPLATINSERT]], <8 x half> undef, <8 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP2:%.*]] = fcmp oge <8 x half> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP3:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP2]])
+// CHECK-NEXT: [[TMP4:%.*]] = trunc i32 [[TMP3]] to i16
+// CHECK-NEXT: ret i16 [[TMP4]]
+//
+mve_pred16_t test_vcmpgeq_n_f16(float16x8_t a, float16_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpgeq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpgeq_n_f16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpgeq_n_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <4 x float> undef, float [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <4 x float> [[DOTSPLATINSERT]], <4 x float> undef, <4 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP0:%.*]] = fcmp oge <4 x float> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpgeq_n_f32(float32x4_t a, float32_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpgeq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpgeq_n_f32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpgeq_n_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <16 x i8> undef, i8 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <16 x i8> [[DOTSPLATINSERT]], <16 x i8> undef, <16 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP0:%.*]] = icmp sge <16 x i8> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v16i1(<16 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpgeq_n_s8(int8x16_t a, int8_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpgeq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpgeq_n_s8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpgeq_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <8 x i16> undef, i16 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <8 x i16> [[DOTSPLATINSERT]], <8 x i16> undef, <8 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP0:%.*]] = icmp sge <8 x i16> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpgeq_n_s16(int16x8_t a, int16_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpgeq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpgeq_n_s16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpgeq_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <4 x i32> undef, i32 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <4 x i32> [[DOTSPLATINSERT]], <4 x i32> undef, <4 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP0:%.*]] = icmp sge <4 x i32> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpgeq_n_s32(int32x4_t a, int32_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpgeq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpgeq_n_s32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpcsq_n_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <16 x i8> undef, i8 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <16 x i8> [[DOTSPLATINSERT]], <16 x i8> undef, <16 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP0:%.*]] = icmp uge <16 x i8> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v16i1(<16 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpcsq_n_u8(uint8x16_t a, uint8_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpcsq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpcsq_n_u8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpcsq_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <8 x i16> undef, i16 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <8 x i16> [[DOTSPLATINSERT]], <8 x i16> undef, <8 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP0:%.*]] = icmp uge <8 x i16> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpcsq_n_u16(uint16x8_t a, uint16_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpcsq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpcsq_n_u16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpcsq_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <4 x i32> undef, i32 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <4 x i32> [[DOTSPLATINSERT]], <4 x i32> undef, <4 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP0:%.*]] = icmp uge <4 x i32> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpcsq_n_u32(uint32x4_t a, uint32_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpcsq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpcsq_n_u32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpgeq_m_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = fcmp oge <8 x half> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <8 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpgeq_m_f16(float16x8_t a, float16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpgeq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpgeq_m_f16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpgeq_m_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = fcmp oge <4 x float> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <4 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpgeq_m_f32(float32x4_t a, float32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpgeq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpgeq_m_f32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpgeq_m_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = icmp sge <16 x i8> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <16 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v16i1(<16 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpgeq_m_s8(int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpgeq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpgeq_m_s8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpgeq_m_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = icmp sge <8 x i16> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <8 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpgeq_m_s16(int16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpgeq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpgeq_m_s16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpgeq_m_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = icmp sge <4 x i32> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <4 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpgeq_m_s32(int32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpgeq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpgeq_m_s32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpcsq_m_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = icmp uge <16 x i8> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <16 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v16i1(<16 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpcsq_m_u8(uint8x16_t a, uint8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpcsq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpcsq_m_u8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpcsq_m_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = icmp uge <8 x i16> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <8 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpcsq_m_u16(uint16x8_t a, uint16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpcsq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpcsq_m_u16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpcsq_m_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = icmp uge <4 x i32> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <4 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpcsq_m_u32(uint32x4_t a, uint32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpcsq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpcsq_m_u32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpgeq_m_n_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast float [[B_COERCE:%.*]] to i32
+// CHECK-NEXT: [[TMP_0_EXTRACT_TRUNC:%.*]] = trunc i32 [[TMP0]] to i16
+// CHECK-NEXT: [[TMP1:%.*]] = bitcast i16 [[TMP_0_EXTRACT_TRUNC]] to half
+// CHECK-NEXT: [[TMP2:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP2]])
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <8 x half> undef, half [[TMP1]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <8 x half> [[DOTSPLATINSERT]], <8 x half> undef, <8 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP4:%.*]] = fcmp oge <8 x half> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP5:%.*]] = and <8 x i1> [[TMP3]], [[TMP4]]
+// CHECK-NEXT: [[TMP6:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP5]])
+// CHECK-NEXT: [[TMP7:%.*]] = trunc i32 [[TMP6]] to i16
+// CHECK-NEXT: ret i16 [[TMP7]]
+//
+mve_pred16_t test_vcmpgeq_m_n_f16(float16x8_t a, float16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpgeq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpgeq_m_n_f16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpgeq_m_n_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <4 x float> undef, float [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <4 x float> [[DOTSPLATINSERT]], <4 x float> undef, <4 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP2:%.*]] = fcmp oge <4 x float> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <4 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpgeq_m_n_f32(float32x4_t a, float32_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpgeq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpgeq_m_n_f32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpgeq_m_n_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <16 x i8> undef, i8 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <16 x i8> [[DOTSPLATINSERT]], <16 x i8> undef, <16 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP2:%.*]] = icmp sge <16 x i8> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <16 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v16i1(<16 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpgeq_m_n_s8(int8x16_t a, int8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpgeq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpgeq_m_n_s8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpgeq_m_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <8 x i16> undef, i16 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <8 x i16> [[DOTSPLATINSERT]], <8 x i16> undef, <8 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP2:%.*]] = icmp sge <8 x i16> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <8 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpgeq_m_n_s16(int16x8_t a, int16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpgeq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpgeq_m_n_s16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpgeq_m_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <4 x i32> undef, i32 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <4 x i32> [[DOTSPLATINSERT]], <4 x i32> undef, <4 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP2:%.*]] = icmp sge <4 x i32> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <4 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpgeq_m_n_s32(int32x4_t a, int32_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpgeq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpgeq_m_n_s32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpcsq_m_n_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <16 x i8> undef, i8 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <16 x i8> [[DOTSPLATINSERT]], <16 x i8> undef, <16 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP2:%.*]] = icmp uge <16 x i8> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <16 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v16i1(<16 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpcsq_m_n_u8(uint8x16_t a, uint8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpcsq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpcsq_m_n_u8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpcsq_m_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <8 x i16> undef, i16 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <8 x i16> [[DOTSPLATINSERT]], <8 x i16> undef, <8 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP2:%.*]] = icmp uge <8 x i16> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <8 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpcsq_m_n_u16(uint16x8_t a, uint16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpcsq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpcsq_m_n_u16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpcsq_m_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <4 x i32> undef, i32 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <4 x i32> [[DOTSPLATINSERT]], <4 x i32> undef, <4 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP2:%.*]] = icmp uge <4 x i32> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <4 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpcsq_m_n_u32(uint32x4_t a, uint32_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpcsq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpcsq_m_n_u32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpgtq_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = fcmp ogt <8 x half> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpgtq_f16(float16x8_t a, float16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpgtq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpgtq_f16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpgtq_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = fcmp ogt <4 x float> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpgtq_f32(float32x4_t a, float32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpgtq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpgtq_f32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpgtq_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = icmp sgt <16 x i8> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v16i1(<16 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpgtq_s8(int8x16_t a, int8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpgtq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpgtq_s8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpgtq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = icmp sgt <8 x i16> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpgtq_s16(int16x8_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpgtq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpgtq_s16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpgtq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = icmp sgt <4 x i32> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpgtq_s32(int32x4_t a, int32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpgtq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpgtq_s32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmphiq_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = icmp ugt <16 x i8> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v16i1(<16 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmphiq_u8(uint8x16_t a, uint8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmphiq(a, b);
+#else /* POLYMORPHIC */
+ return vcmphiq_u8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmphiq_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = icmp ugt <8 x i16> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmphiq_u16(uint16x8_t a, uint16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmphiq(a, b);
+#else /* POLYMORPHIC */
+ return vcmphiq_u16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmphiq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = icmp ugt <4 x i32> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmphiq_u32(uint32x4_t a, uint32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmphiq(a, b);
+#else /* POLYMORPHIC */
+ return vcmphiq_u32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpgtq_n_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast float [[B_COERCE:%.*]] to i32
+// CHECK-NEXT: [[TMP_0_EXTRACT_TRUNC:%.*]] = trunc i32 [[TMP0]] to i16
+// CHECK-NEXT: [[TMP1:%.*]] = bitcast i16 [[TMP_0_EXTRACT_TRUNC]] to half
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <8 x half> undef, half [[TMP1]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <8 x half> [[DOTSPLATINSERT]], <8 x half> undef, <8 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP2:%.*]] = fcmp ogt <8 x half> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP3:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP2]])
+// CHECK-NEXT: [[TMP4:%.*]] = trunc i32 [[TMP3]] to i16
+// CHECK-NEXT: ret i16 [[TMP4]]
+//
+mve_pred16_t test_vcmpgtq_n_f16(float16x8_t a, float16_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpgtq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpgtq_n_f16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpgtq_n_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <4 x float> undef, float [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <4 x float> [[DOTSPLATINSERT]], <4 x float> undef, <4 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP0:%.*]] = fcmp ogt <4 x float> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpgtq_n_f32(float32x4_t a, float32_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpgtq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpgtq_n_f32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpgtq_n_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <16 x i8> undef, i8 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <16 x i8> [[DOTSPLATINSERT]], <16 x i8> undef, <16 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP0:%.*]] = icmp sgt <16 x i8> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v16i1(<16 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpgtq_n_s8(int8x16_t a, int8_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpgtq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpgtq_n_s8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpgtq_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <8 x i16> undef, i16 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <8 x i16> [[DOTSPLATINSERT]], <8 x i16> undef, <8 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP0:%.*]] = icmp sgt <8 x i16> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpgtq_n_s16(int16x8_t a, int16_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpgtq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpgtq_n_s16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpgtq_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <4 x i32> undef, i32 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <4 x i32> [[DOTSPLATINSERT]], <4 x i32> undef, <4 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP0:%.*]] = icmp sgt <4 x i32> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpgtq_n_s32(int32x4_t a, int32_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpgtq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpgtq_n_s32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmphiq_n_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <16 x i8> undef, i8 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <16 x i8> [[DOTSPLATINSERT]], <16 x i8> undef, <16 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP0:%.*]] = icmp ugt <16 x i8> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v16i1(<16 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmphiq_n_u8(uint8x16_t a, uint8_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmphiq(a, b);
+#else /* POLYMORPHIC */
+ return vcmphiq_n_u8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmphiq_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <8 x i16> undef, i16 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <8 x i16> [[DOTSPLATINSERT]], <8 x i16> undef, <8 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP0:%.*]] = icmp ugt <8 x i16> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmphiq_n_u16(uint16x8_t a, uint16_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmphiq(a, b);
+#else /* POLYMORPHIC */
+ return vcmphiq_n_u16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmphiq_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <4 x i32> undef, i32 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <4 x i32> [[DOTSPLATINSERT]], <4 x i32> undef, <4 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP0:%.*]] = icmp ugt <4 x i32> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmphiq_n_u32(uint32x4_t a, uint32_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmphiq(a, b);
+#else /* POLYMORPHIC */
+ return vcmphiq_n_u32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpgtq_m_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = fcmp ogt <8 x half> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <8 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpgtq_m_f16(float16x8_t a, float16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpgtq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpgtq_m_f16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpgtq_m_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = fcmp ogt <4 x float> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <4 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpgtq_m_f32(float32x4_t a, float32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpgtq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpgtq_m_f32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpgtq_m_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = icmp sgt <16 x i8> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <16 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v16i1(<16 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpgtq_m_s8(int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpgtq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpgtq_m_s8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpgtq_m_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = icmp sgt <8 x i16> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <8 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpgtq_m_s16(int16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpgtq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpgtq_m_s16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpgtq_m_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = icmp sgt <4 x i32> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <4 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpgtq_m_s32(int32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpgtq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpgtq_m_s32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmphiq_m_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = icmp ugt <16 x i8> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <16 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v16i1(<16 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmphiq_m_u8(uint8x16_t a, uint8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmphiq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmphiq_m_u8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmphiq_m_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = icmp ugt <8 x i16> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <8 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmphiq_m_u16(uint16x8_t a, uint16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmphiq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmphiq_m_u16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmphiq_m_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = icmp ugt <4 x i32> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <4 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmphiq_m_u32(uint32x4_t a, uint32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmphiq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmphiq_m_u32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpgtq_m_n_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast float [[B_COERCE:%.*]] to i32
+// CHECK-NEXT: [[TMP_0_EXTRACT_TRUNC:%.*]] = trunc i32 [[TMP0]] to i16
+// CHECK-NEXT: [[TMP1:%.*]] = bitcast i16 [[TMP_0_EXTRACT_TRUNC]] to half
+// CHECK-NEXT: [[TMP2:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP2]])
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <8 x half> undef, half [[TMP1]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <8 x half> [[DOTSPLATINSERT]], <8 x half> undef, <8 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP4:%.*]] = fcmp ogt <8 x half> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP5:%.*]] = and <8 x i1> [[TMP3]], [[TMP4]]
+// CHECK-NEXT: [[TMP6:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP5]])
+// CHECK-NEXT: [[TMP7:%.*]] = trunc i32 [[TMP6]] to i16
+// CHECK-NEXT: ret i16 [[TMP7]]
+//
+mve_pred16_t test_vcmpgtq_m_n_f16(float16x8_t a, float16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpgtq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpgtq_m_n_f16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpgtq_m_n_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <4 x float> undef, float [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <4 x float> [[DOTSPLATINSERT]], <4 x float> undef, <4 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP2:%.*]] = fcmp ogt <4 x float> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <4 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpgtq_m_n_f32(float32x4_t a, float32_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpgtq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpgtq_m_n_f32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpgtq_m_n_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <16 x i8> undef, i8 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <16 x i8> [[DOTSPLATINSERT]], <16 x i8> undef, <16 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP2:%.*]] = icmp sgt <16 x i8> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <16 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v16i1(<16 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpgtq_m_n_s8(int8x16_t a, int8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpgtq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpgtq_m_n_s8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpgtq_m_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <8 x i16> undef, i16 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <8 x i16> [[DOTSPLATINSERT]], <8 x i16> undef, <8 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP2:%.*]] = icmp sgt <8 x i16> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <8 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpgtq_m_n_s16(int16x8_t a, int16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpgtq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpgtq_m_n_s16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpgtq_m_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <4 x i32> undef, i32 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <4 x i32> [[DOTSPLATINSERT]], <4 x i32> undef, <4 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP2:%.*]] = icmp sgt <4 x i32> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <4 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpgtq_m_n_s32(int32x4_t a, int32_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpgtq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpgtq_m_n_s32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmphiq_m_n_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <16 x i8> undef, i8 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <16 x i8> [[DOTSPLATINSERT]], <16 x i8> undef, <16 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP2:%.*]] = icmp ugt <16 x i8> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <16 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v16i1(<16 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmphiq_m_n_u8(uint8x16_t a, uint8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmphiq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmphiq_m_n_u8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmphiq_m_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <8 x i16> undef, i16 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <8 x i16> [[DOTSPLATINSERT]], <8 x i16> undef, <8 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP2:%.*]] = icmp ugt <8 x i16> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <8 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmphiq_m_n_u16(uint16x8_t a, uint16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmphiq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmphiq_m_n_u16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmphiq_m_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <4 x i32> undef, i32 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <4 x i32> [[DOTSPLATINSERT]], <4 x i32> undef, <4 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP2:%.*]] = icmp ugt <4 x i32> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <4 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmphiq_m_n_u32(uint32x4_t a, uint32_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmphiq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmphiq_m_n_u32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpleq_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = fcmp ole <8 x half> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpleq_f16(float16x8_t a, float16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpleq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpleq_f16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpleq_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = fcmp ole <4 x float> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpleq_f32(float32x4_t a, float32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpleq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpleq_f32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpleq_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = icmp sle <16 x i8> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v16i1(<16 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpleq_s8(int8x16_t a, int8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpleq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpleq_s8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpleq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = icmp sle <8 x i16> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpleq_s16(int16x8_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpleq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpleq_s16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpleq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = icmp sle <4 x i32> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpleq_s32(int32x4_t a, int32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpleq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpleq_s32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpleq_n_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast float [[B_COERCE:%.*]] to i32
+// CHECK-NEXT: [[TMP_0_EXTRACT_TRUNC:%.*]] = trunc i32 [[TMP0]] to i16
+// CHECK-NEXT: [[TMP1:%.*]] = bitcast i16 [[TMP_0_EXTRACT_TRUNC]] to half
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <8 x half> undef, half [[TMP1]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <8 x half> [[DOTSPLATINSERT]], <8 x half> undef, <8 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP2:%.*]] = fcmp ole <8 x half> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP3:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP2]])
+// CHECK-NEXT: [[TMP4:%.*]] = trunc i32 [[TMP3]] to i16
+// CHECK-NEXT: ret i16 [[TMP4]]
+//
+mve_pred16_t test_vcmpleq_n_f16(float16x8_t a, float16_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpleq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpleq_n_f16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpleq_n_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <4 x float> undef, float [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <4 x float> [[DOTSPLATINSERT]], <4 x float> undef, <4 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP0:%.*]] = fcmp ole <4 x float> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpleq_n_f32(float32x4_t a, float32_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpleq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpleq_n_f32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpleq_n_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <16 x i8> undef, i8 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <16 x i8> [[DOTSPLATINSERT]], <16 x i8> undef, <16 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP0:%.*]] = icmp sle <16 x i8> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v16i1(<16 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpleq_n_s8(int8x16_t a, int8_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpleq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpleq_n_s8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpleq_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <8 x i16> undef, i16 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <8 x i16> [[DOTSPLATINSERT]], <8 x i16> undef, <8 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP0:%.*]] = icmp sle <8 x i16> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpleq_n_s16(int16x8_t a, int16_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpleq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpleq_n_s16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpleq_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <4 x i32> undef, i32 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <4 x i32> [[DOTSPLATINSERT]], <4 x i32> undef, <4 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP0:%.*]] = icmp sle <4 x i32> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpleq_n_s32(int32x4_t a, int32_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpleq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpleq_n_s32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpleq_m_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = fcmp ole <8 x half> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <8 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpleq_m_f16(float16x8_t a, float16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpleq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpleq_m_f16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpleq_m_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = fcmp ole <4 x float> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <4 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpleq_m_f32(float32x4_t a, float32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpleq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpleq_m_f32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpleq_m_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = icmp sle <16 x i8> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <16 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v16i1(<16 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpleq_m_s8(int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpleq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpleq_m_s8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpleq_m_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = icmp sle <8 x i16> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <8 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpleq_m_s16(int16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpleq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpleq_m_s16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpleq_m_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = icmp sle <4 x i32> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <4 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpleq_m_s32(int32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpleq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpleq_m_s32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpleq_m_n_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast float [[B_COERCE:%.*]] to i32
+// CHECK-NEXT: [[TMP_0_EXTRACT_TRUNC:%.*]] = trunc i32 [[TMP0]] to i16
+// CHECK-NEXT: [[TMP1:%.*]] = bitcast i16 [[TMP_0_EXTRACT_TRUNC]] to half
+// CHECK-NEXT: [[TMP2:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP2]])
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <8 x half> undef, half [[TMP1]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <8 x half> [[DOTSPLATINSERT]], <8 x half> undef, <8 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP4:%.*]] = fcmp ole <8 x half> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP5:%.*]] = and <8 x i1> [[TMP3]], [[TMP4]]
+// CHECK-NEXT: [[TMP6:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP5]])
+// CHECK-NEXT: [[TMP7:%.*]] = trunc i32 [[TMP6]] to i16
+// CHECK-NEXT: ret i16 [[TMP7]]
+//
+mve_pred16_t test_vcmpleq_m_n_f16(float16x8_t a, float16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpleq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpleq_m_n_f16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpleq_m_n_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <4 x float> undef, float [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <4 x float> [[DOTSPLATINSERT]], <4 x float> undef, <4 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP2:%.*]] = fcmp ole <4 x float> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <4 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpleq_m_n_f32(float32x4_t a, float32_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpleq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpleq_m_n_f32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpleq_m_n_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <16 x i8> undef, i8 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <16 x i8> [[DOTSPLATINSERT]], <16 x i8> undef, <16 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP2:%.*]] = icmp sle <16 x i8> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <16 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v16i1(<16 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpleq_m_n_s8(int8x16_t a, int8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpleq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpleq_m_n_s8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpleq_m_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <8 x i16> undef, i16 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <8 x i16> [[DOTSPLATINSERT]], <8 x i16> undef, <8 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP2:%.*]] = icmp sle <8 x i16> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <8 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpleq_m_n_s16(int16x8_t a, int16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpleq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpleq_m_n_s16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpleq_m_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <4 x i32> undef, i32 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <4 x i32> [[DOTSPLATINSERT]], <4 x i32> undef, <4 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP2:%.*]] = icmp sle <4 x i32> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <4 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpleq_m_n_s32(int32x4_t a, int32_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpleq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpleq_m_n_s32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpltq_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = fcmp olt <8 x half> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpltq_f16(float16x8_t a, float16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpltq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpltq_f16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpltq_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = fcmp olt <4 x float> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpltq_f32(float32x4_t a, float32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpltq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpltq_f32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpltq_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = icmp slt <16 x i8> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v16i1(<16 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpltq_s8(int8x16_t a, int8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpltq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpltq_s8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpltq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = icmp slt <8 x i16> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpltq_s16(int16x8_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpltq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpltq_s16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpltq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = icmp slt <4 x i32> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpltq_s32(int32x4_t a, int32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpltq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpltq_s32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpltq_n_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast float [[B_COERCE:%.*]] to i32
+// CHECK-NEXT: [[TMP_0_EXTRACT_TRUNC:%.*]] = trunc i32 [[TMP0]] to i16
+// CHECK-NEXT: [[TMP1:%.*]] = bitcast i16 [[TMP_0_EXTRACT_TRUNC]] to half
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <8 x half> undef, half [[TMP1]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <8 x half> [[DOTSPLATINSERT]], <8 x half> undef, <8 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP2:%.*]] = fcmp olt <8 x half> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP3:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP2]])
+// CHECK-NEXT: [[TMP4:%.*]] = trunc i32 [[TMP3]] to i16
+// CHECK-NEXT: ret i16 [[TMP4]]
+//
+mve_pred16_t test_vcmpltq_n_f16(float16x8_t a, float16_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpltq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpltq_n_f16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpltq_n_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <4 x float> undef, float [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <4 x float> [[DOTSPLATINSERT]], <4 x float> undef, <4 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP0:%.*]] = fcmp olt <4 x float> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpltq_n_f32(float32x4_t a, float32_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpltq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpltq_n_f32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpltq_n_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <16 x i8> undef, i8 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <16 x i8> [[DOTSPLATINSERT]], <16 x i8> undef, <16 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP0:%.*]] = icmp slt <16 x i8> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v16i1(<16 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpltq_n_s8(int8x16_t a, int8_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpltq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpltq_n_s8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpltq_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <8 x i16> undef, i16 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <8 x i16> [[DOTSPLATINSERT]], <8 x i16> undef, <8 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP0:%.*]] = icmp slt <8 x i16> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpltq_n_s16(int16x8_t a, int16_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpltq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpltq_n_s16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpltq_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <4 x i32> undef, i32 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <4 x i32> [[DOTSPLATINSERT]], <4 x i32> undef, <4 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP0:%.*]] = icmp slt <4 x i32> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vcmpltq_n_s32(int32x4_t a, int32_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmpltq(a, b);
+#else /* POLYMORPHIC */
+ return vcmpltq_n_s32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpltq_m_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = fcmp olt <8 x half> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <8 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpltq_m_f16(float16x8_t a, float16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpltq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpltq_m_f16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpltq_m_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = fcmp olt <4 x float> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <4 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpltq_m_f32(float32x4_t a, float32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpltq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpltq_m_f32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpltq_m_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = icmp slt <16 x i8> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <16 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v16i1(<16 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpltq_m_s8(int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpltq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpltq_m_s8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpltq_m_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = icmp slt <8 x i16> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <8 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpltq_m_s16(int16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpltq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpltq_m_s16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpltq_m_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = icmp slt <4 x i32> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <4 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpltq_m_s32(int32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpltq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpltq_m_s32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpltq_m_n_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast float [[B_COERCE:%.*]] to i32
+// CHECK-NEXT: [[TMP_0_EXTRACT_TRUNC:%.*]] = trunc i32 [[TMP0]] to i16
+// CHECK-NEXT: [[TMP1:%.*]] = bitcast i16 [[TMP_0_EXTRACT_TRUNC]] to half
+// CHECK-NEXT: [[TMP2:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP2]])
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <8 x half> undef, half [[TMP1]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <8 x half> [[DOTSPLATINSERT]], <8 x half> undef, <8 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP4:%.*]] = fcmp olt <8 x half> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP5:%.*]] = and <8 x i1> [[TMP3]], [[TMP4]]
+// CHECK-NEXT: [[TMP6:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP5]])
+// CHECK-NEXT: [[TMP7:%.*]] = trunc i32 [[TMP6]] to i16
+// CHECK-NEXT: ret i16 [[TMP7]]
+//
+mve_pred16_t test_vcmpltq_m_n_f16(float16x8_t a, float16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpltq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpltq_m_n_f16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpltq_m_n_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <4 x float> undef, float [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <4 x float> [[DOTSPLATINSERT]], <4 x float> undef, <4 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP2:%.*]] = fcmp olt <4 x float> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <4 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpltq_m_n_f32(float32x4_t a, float32_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpltq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpltq_m_n_f32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpltq_m_n_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <16 x i8> undef, i8 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <16 x i8> [[DOTSPLATINSERT]], <16 x i8> undef, <16 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP2:%.*]] = icmp slt <16 x i8> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <16 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v16i1(<16 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpltq_m_n_s8(int8x16_t a, int8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpltq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpltq_m_n_s8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpltq_m_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <8 x i16> undef, i16 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <8 x i16> [[DOTSPLATINSERT]], <8 x i16> undef, <8 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP2:%.*]] = icmp slt <8 x i16> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <8 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpltq_m_n_s16(int16x8_t a, int16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpltq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpltq_m_n_s16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vcmpltq_m_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <4 x i32> undef, i32 [[B:%.*]], i32 0
+// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <4 x i32> [[DOTSPLATINSERT]], <4 x i32> undef, <4 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP2:%.*]] = icmp slt <4 x i32> [[A:%.*]], [[DOTSPLAT]]
+// CHECK-NEXT: [[TMP3:%.*]] = and <4 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vcmpltq_m_n_s32(int32x4_t a, int32_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmpltq_m(a, b, p);
+#else /* POLYMORPHIC */
+ return vcmpltq_m_n_s32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/get-set-lane.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/get-set-lane.c
new file mode 100644
index 0000000..6eaf0f8a
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/get-set-lane.c
@@ -0,0 +1,291 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg -sroa -early-cse | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg -sroa -early-cse | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vgetq_lane_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = extractelement <8 x half> [[A:%.*]], i32 2
+// CHECK-NEXT: [[TMP1:%.*]] = bitcast half [[TMP0]] to i16
+// CHECK-NEXT: [[TMP_0_INSERT_EXT:%.*]] = zext i16 [[TMP1]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = bitcast i32 [[TMP_0_INSERT_EXT]] to float
+// CHECK-NEXT: ret float [[TMP2]]
+//
+float16_t test_vgetq_lane_f16(float16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vgetq_lane(a, 2);
+#else /* POLYMORPHIC */
+ return vgetq_lane_f16(a, 2);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vgetq_lane_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = extractelement <4 x float> [[A:%.*]], i32 3
+// CHECK-NEXT: ret float [[TMP0]]
+//
+float32_t test_vgetq_lane_f32(float32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vgetq_lane(a, 3);
+#else /* POLYMORPHIC */
+ return vgetq_lane_f32(a, 3);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vgetq_lane_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = extractelement <8 x i16> [[A:%.*]], i32 4
+// CHECK-NEXT: ret i16 [[TMP0]]
+//
+int16_t test_vgetq_lane_s16(int16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vgetq_lane(a, 4);
+#else /* POLYMORPHIC */
+ return vgetq_lane_s16(a, 4);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vgetq_lane_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = extractelement <4 x i32> [[A:%.*]], i32 0
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+int32_t test_vgetq_lane_s32(int32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vgetq_lane(a, 0);
+#else /* POLYMORPHIC */
+ return vgetq_lane_s32(a, 0);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vgetq_lane_s64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = extractelement <2 x i64> [[A:%.*]], i32 0
+// CHECK-NEXT: ret i64 [[TMP0]]
+//
+int64_t test_vgetq_lane_s64(int64x2_t a)
+{
+#ifdef POLYMORPHIC
+ return vgetq_lane(a, 0);
+#else /* POLYMORPHIC */
+ return vgetq_lane_s64(a, 0);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vgetq_lane_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = extractelement <16 x i8> [[A:%.*]], i32 10
+// CHECK-NEXT: ret i8 [[TMP0]]
+//
+int8_t test_vgetq_lane_s8(int8x16_t a)
+{
+#ifdef POLYMORPHIC
+ return vgetq_lane(a, 10);
+#else /* POLYMORPHIC */
+ return vgetq_lane_s8(a, 10);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vgetq_lane_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = extractelement <8 x i16> [[A:%.*]], i32 3
+// CHECK-NEXT: ret i16 [[TMP0]]
+//
+uint16_t test_vgetq_lane_u16(uint16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vgetq_lane(a, 3);
+#else /* POLYMORPHIC */
+ return vgetq_lane_u16(a, 3);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vgetq_lane_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = extractelement <4 x i32> [[A:%.*]], i32 3
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+uint32_t test_vgetq_lane_u32(uint32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vgetq_lane(a, 3);
+#else /* POLYMORPHIC */
+ return vgetq_lane_u32(a, 3);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vgetq_lane_u64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = extractelement <2 x i64> [[A:%.*]], i32 1
+// CHECK-NEXT: ret i64 [[TMP0]]
+//
+uint64_t test_vgetq_lane_u64(uint64x2_t a)
+{
+#ifdef POLYMORPHIC
+ return vgetq_lane(a, 1);
+#else /* POLYMORPHIC */
+ return vgetq_lane_u64(a, 1);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vgetq_lane_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = extractelement <16 x i8> [[A:%.*]], i32 1
+// CHECK-NEXT: ret i8 [[TMP0]]
+//
+uint8_t test_vgetq_lane_u8(uint8x16_t a)
+{
+#ifdef POLYMORPHIC
+ return vgetq_lane(a, 1);
+#else /* POLYMORPHIC */
+ return vgetq_lane_u8(a, 1);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vsetq_lane_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast float [[A_COERCE:%.*]] to i32
+// CHECK-NEXT: [[TMP_0_EXTRACT_TRUNC:%.*]] = trunc i32 [[TMP0]] to i16
+// CHECK-NEXT: [[TMP1:%.*]] = bitcast i16 [[TMP_0_EXTRACT_TRUNC]] to half
+// CHECK-NEXT: [[TMP2:%.*]] = insertelement <8 x half> [[B:%.*]], half [[TMP1]], i32 4
+// CHECK-NEXT: ret <8 x half> [[TMP2]]
+//
+float16x8_t test_vsetq_lane_f16(float16_t a, float16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vsetq_lane(a, b, 4);
+#else /* POLYMORPHIC */
+ return vsetq_lane_f16(a, b, 4);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vsetq_lane_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = insertelement <4 x float> [[B:%.*]], float [[A:%.*]], i32 2
+// CHECK-NEXT: ret <4 x float> [[TMP0]]
+//
+float32x4_t test_vsetq_lane_f32(float32_t a, float32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vsetq_lane(a, b, 2);
+#else /* POLYMORPHIC */
+ return vsetq_lane_f32(a, b, 2);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vsetq_lane_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = insertelement <16 x i8> [[B:%.*]], i8 [[A:%.*]], i32 12
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+int8x16_t test_vsetq_lane_s8(int8_t a, int8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vsetq_lane(a, b, 12);
+#else /* POLYMORPHIC */
+ return vsetq_lane_s8(a, b, 12);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vsetq_lane_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = insertelement <8 x i16> [[B:%.*]], i16 [[A:%.*]], i32 6
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vsetq_lane_s16(int16_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vsetq_lane(a, b, 6);
+#else /* POLYMORPHIC */
+ return vsetq_lane_s16(a, b, 6);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vsetq_lane_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = insertelement <4 x i32> [[B:%.*]], i32 [[A:%.*]], i32 2
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+int32x4_t test_vsetq_lane_s32(int32_t a, int32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vsetq_lane(a, b, 2);
+#else /* POLYMORPHIC */
+ return vsetq_lane_s32(a, b, 2);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vsetq_lane_s64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = insertelement <2 x i64> [[B:%.*]], i64 [[A:%.*]], i32 0
+// CHECK-NEXT: ret <2 x i64> [[TMP0]]
+//
+int64x2_t test_vsetq_lane_s64(int64_t a, int64x2_t b)
+{
+#ifdef POLYMORPHIC
+ return vsetq_lane(a, b, 0);
+#else /* POLYMORPHIC */
+ return vsetq_lane_s64(a, b, 0);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vsetq_lane_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = insertelement <16 x i8> [[B:%.*]], i8 [[A:%.*]], i32 2
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vsetq_lane_u8(uint8_t a, uint8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vsetq_lane(a, b, 2);
+#else /* POLYMORPHIC */
+ return vsetq_lane_u8(a, b, 2);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vsetq_lane_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = insertelement <8 x i16> [[B:%.*]], i16 [[A:%.*]], i32 7
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vsetq_lane_u16(uint16_t a, uint16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vsetq_lane(a, b, 7);
+#else /* POLYMORPHIC */
+ return vsetq_lane_u16(a, b, 7);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vsetq_lane_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = insertelement <4 x i32> [[B:%.*]], i32 [[A:%.*]], i32 0
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vsetq_lane_u32(uint32_t a, uint32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vsetq_lane(a, b, 0);
+#else /* POLYMORPHIC */
+ return vsetq_lane_u32(a, b, 0);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vsetq_lane_u64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = insertelement <2 x i64> [[B:%.*]], i64 [[A:%.*]], i32 1
+// CHECK-NEXT: ret <2 x i64> [[TMP0]]
+//
+uint64x2_t test_vsetq_lane_u64(uint64_t a, uint64x2_t b)
+{
+#ifdef POLYMORPHIC
+ return vsetq_lane(a, b, 1);
+#else /* POLYMORPHIC */
+ return vsetq_lane_u64(a, b, 1);
+#endif /* POLYMORPHIC */
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/load-store.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/load-store.c
new file mode 100644
index 0000000..e7a92bc
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/load-store.c
@@ -0,0 +1,1325 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vld1q_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast half* [[BASE:%.*]] to <8 x half>*
+// CHECK-NEXT: [[TMP1:%.*]] = load <8 x half>, <8 x half>* [[TMP0]], align 2
+// CHECK-NEXT: ret <8 x half> [[TMP1]]
+//
+float16x8_t test_vld1q_f16(const float16_t *base)
+{
+#ifdef POLYMORPHIC
+ return vld1q(base);
+#else /* POLYMORPHIC */
+ return vld1q_f16(base);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vld1q_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast float* [[BASE:%.*]] to <4 x float>*
+// CHECK-NEXT: [[TMP1:%.*]] = load <4 x float>, <4 x float>* [[TMP0]], align 4
+// CHECK-NEXT: ret <4 x float> [[TMP1]]
+//
+float32x4_t test_vld1q_f32(const float32_t *base)
+{
+#ifdef POLYMORPHIC
+ return vld1q(base);
+#else /* POLYMORPHIC */
+ return vld1q_f32(base);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vld1q_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i8* [[BASE:%.*]] to <16 x i8>*
+// CHECK-NEXT: [[TMP1:%.*]] = load <16 x i8>, <16 x i8>* [[TMP0]], align 1
+// CHECK-NEXT: ret <16 x i8> [[TMP1]]
+//
+int8x16_t test_vld1q_s8(const int8_t *base)
+{
+#ifdef POLYMORPHIC
+ return vld1q(base);
+#else /* POLYMORPHIC */
+ return vld1q_s8(base);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vld1q_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i16* [[BASE:%.*]] to <8 x i16>*
+// CHECK-NEXT: [[TMP1:%.*]] = load <8 x i16>, <8 x i16>* [[TMP0]], align 2
+// CHECK-NEXT: ret <8 x i16> [[TMP1]]
+//
+int16x8_t test_vld1q_s16(const int16_t *base)
+{
+#ifdef POLYMORPHIC
+ return vld1q(base);
+#else /* POLYMORPHIC */
+ return vld1q_s16(base);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vld1q_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i32* [[BASE:%.*]] to <4 x i32>*
+// CHECK-NEXT: [[TMP1:%.*]] = load <4 x i32>, <4 x i32>* [[TMP0]], align 4
+// CHECK-NEXT: ret <4 x i32> [[TMP1]]
+//
+int32x4_t test_vld1q_s32(const int32_t *base)
+{
+#ifdef POLYMORPHIC
+ return vld1q(base);
+#else /* POLYMORPHIC */
+ return vld1q_s32(base);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vld1q_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i8* [[BASE:%.*]] to <16 x i8>*
+// CHECK-NEXT: [[TMP1:%.*]] = load <16 x i8>, <16 x i8>* [[TMP0]], align 1
+// CHECK-NEXT: ret <16 x i8> [[TMP1]]
+//
+uint8x16_t test_vld1q_u8(const uint8_t *base)
+{
+#ifdef POLYMORPHIC
+ return vld1q(base);
+#else /* POLYMORPHIC */
+ return vld1q_u8(base);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vld1q_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i16* [[BASE:%.*]] to <8 x i16>*
+// CHECK-NEXT: [[TMP1:%.*]] = load <8 x i16>, <8 x i16>* [[TMP0]], align 2
+// CHECK-NEXT: ret <8 x i16> [[TMP1]]
+//
+uint16x8_t test_vld1q_u16(const uint16_t *base)
+{
+#ifdef POLYMORPHIC
+ return vld1q(base);
+#else /* POLYMORPHIC */
+ return vld1q_u16(base);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vld1q_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i32* [[BASE:%.*]] to <4 x i32>*
+// CHECK-NEXT: [[TMP1:%.*]] = load <4 x i32>, <4 x i32>* [[TMP0]], align 4
+// CHECK-NEXT: ret <4 x i32> [[TMP1]]
+//
+uint32x4_t test_vld1q_u32(const uint32_t *base)
+{
+#ifdef POLYMORPHIC
+ return vld1q(base);
+#else /* POLYMORPHIC */
+ return vld1q_u32(base);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vld1q_z_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast half* [[BASE:%.*]] to <8 x half>*
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = call <8 x half> @llvm.masked.load.v8f16.p0v8f16(<8 x half>* [[TMP0]], i32 2, <8 x i1> [[TMP2]], <8 x half> zeroinitializer)
+// CHECK-NEXT: ret <8 x half> [[TMP3]]
+//
+float16x8_t test_vld1q_z_f16(const float16_t *base, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vld1q_z(base, p);
+#else /* POLYMORPHIC */
+ return vld1q_z_f16(base, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vld1q_z_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast float* [[BASE:%.*]] to <4 x float>*
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = call <4 x float> @llvm.masked.load.v4f32.p0v4f32(<4 x float>* [[TMP0]], i32 4, <4 x i1> [[TMP2]], <4 x float> zeroinitializer)
+// CHECK-NEXT: ret <4 x float> [[TMP3]]
+//
+float32x4_t test_vld1q_z_f32(const float32_t *base, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vld1q_z(base, p);
+#else /* POLYMORPHIC */
+ return vld1q_z_f32(base, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vld1q_z_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i8* [[BASE:%.*]] to <16 x i8>*
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = call <16 x i8> @llvm.masked.load.v16i8.p0v16i8(<16 x i8>* [[TMP0]], i32 1, <16 x i1> [[TMP2]], <16 x i8> zeroinitializer)
+// CHECK-NEXT: ret <16 x i8> [[TMP3]]
+//
+int8x16_t test_vld1q_z_s8(const int8_t *base, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vld1q_z(base, p);
+#else /* POLYMORPHIC */
+ return vld1q_z_s8(base, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vld1q_z_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i16* [[BASE:%.*]] to <8 x i16>*
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = call <8 x i16> @llvm.masked.load.v8i16.p0v8i16(<8 x i16>* [[TMP0]], i32 2, <8 x i1> [[TMP2]], <8 x i16> zeroinitializer)
+// CHECK-NEXT: ret <8 x i16> [[TMP3]]
+//
+int16x8_t test_vld1q_z_s16(const int16_t *base, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vld1q_z(base, p);
+#else /* POLYMORPHIC */
+ return vld1q_z_s16(base, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vld1q_z_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i32* [[BASE:%.*]] to <4 x i32>*
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = call <4 x i32> @llvm.masked.load.v4i32.p0v4i32(<4 x i32>* [[TMP0]], i32 4, <4 x i1> [[TMP2]], <4 x i32> zeroinitializer)
+// CHECK-NEXT: ret <4 x i32> [[TMP3]]
+//
+int32x4_t test_vld1q_z_s32(const int32_t *base, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vld1q_z(base, p);
+#else /* POLYMORPHIC */
+ return vld1q_z_s32(base, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vld1q_z_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i8* [[BASE:%.*]] to <16 x i8>*
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = call <16 x i8> @llvm.masked.load.v16i8.p0v16i8(<16 x i8>* [[TMP0]], i32 1, <16 x i1> [[TMP2]], <16 x i8> zeroinitializer)
+// CHECK-NEXT: ret <16 x i8> [[TMP3]]
+//
+uint8x16_t test_vld1q_z_u8(const uint8_t *base, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vld1q_z(base, p);
+#else /* POLYMORPHIC */
+ return vld1q_z_u8(base, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vld1q_z_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i16* [[BASE:%.*]] to <8 x i16>*
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = call <8 x i16> @llvm.masked.load.v8i16.p0v8i16(<8 x i16>* [[TMP0]], i32 2, <8 x i1> [[TMP2]], <8 x i16> zeroinitializer)
+// CHECK-NEXT: ret <8 x i16> [[TMP3]]
+//
+uint16x8_t test_vld1q_z_u16(const uint16_t *base, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vld1q_z(base, p);
+#else /* POLYMORPHIC */
+ return vld1q_z_u16(base, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vld1q_z_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i32* [[BASE:%.*]] to <4 x i32>*
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = call <4 x i32> @llvm.masked.load.v4i32.p0v4i32(<4 x i32>* [[TMP0]], i32 4, <4 x i1> [[TMP2]], <4 x i32> zeroinitializer)
+// CHECK-NEXT: ret <4 x i32> [[TMP3]]
+//
+uint32x4_t test_vld1q_z_u32(const uint32_t *base, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vld1q_z(base, p);
+#else /* POLYMORPHIC */
+ return vld1q_z_u32(base, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrbq_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i8* [[BASE:%.*]] to <16 x i8>*
+// CHECK-NEXT: [[TMP1:%.*]] = load <16 x i8>, <16 x i8>* [[TMP0]], align 1
+// CHECK-NEXT: ret <16 x i8> [[TMP1]]
+//
+int8x16_t test_vldrbq_s8(const int8_t *base)
+{
+ return vldrbq_s8(base);
+}
+
+// CHECK-LABEL: @test_vldrbq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i8* [[BASE:%.*]] to <8 x i8>*
+// CHECK-NEXT: [[TMP1:%.*]] = load <8 x i8>, <8 x i8>* [[TMP0]], align 1
+// CHECK-NEXT: [[TMP2:%.*]] = sext <8 x i8> [[TMP1]] to <8 x i16>
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vldrbq_s16(const int8_t *base)
+{
+ return vldrbq_s16(base);
+}
+
+// CHECK-LABEL: @test_vldrbq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i8* [[BASE:%.*]] to <4 x i8>*
+// CHECK-NEXT: [[TMP1:%.*]] = load <4 x i8>, <4 x i8>* [[TMP0]], align 1
+// CHECK-NEXT: [[TMP2:%.*]] = sext <4 x i8> [[TMP1]] to <4 x i32>
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vldrbq_s32(const int8_t *base)
+{
+ return vldrbq_s32(base);
+}
+
+// CHECK-LABEL: @test_vldrbq_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i8* [[BASE:%.*]] to <16 x i8>*
+// CHECK-NEXT: [[TMP1:%.*]] = load <16 x i8>, <16 x i8>* [[TMP0]], align 1
+// CHECK-NEXT: ret <16 x i8> [[TMP1]]
+//
+uint8x16_t test_vldrbq_u8(const uint8_t *base)
+{
+ return vldrbq_u8(base);
+}
+
+// CHECK-LABEL: @test_vldrbq_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i8* [[BASE:%.*]] to <8 x i8>*
+// CHECK-NEXT: [[TMP1:%.*]] = load <8 x i8>, <8 x i8>* [[TMP0]], align 1
+// CHECK-NEXT: [[TMP2:%.*]] = zext <8 x i8> [[TMP1]] to <8 x i16>
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vldrbq_u16(const uint8_t *base)
+{
+ return vldrbq_u16(base);
+}
+
+// CHECK-LABEL: @test_vldrbq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i8* [[BASE:%.*]] to <4 x i8>*
+// CHECK-NEXT: [[TMP1:%.*]] = load <4 x i8>, <4 x i8>* [[TMP0]], align 1
+// CHECK-NEXT: [[TMP2:%.*]] = zext <4 x i8> [[TMP1]] to <4 x i32>
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vldrbq_u32(const uint8_t *base)
+{
+ return vldrbq_u32(base);
+}
+
+// CHECK-LABEL: @test_vldrbq_z_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i8* [[BASE:%.*]] to <16 x i8>*
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = call <16 x i8> @llvm.masked.load.v16i8.p0v16i8(<16 x i8>* [[TMP0]], i32 1, <16 x i1> [[TMP2]], <16 x i8> zeroinitializer)
+// CHECK-NEXT: ret <16 x i8> [[TMP3]]
+//
+int8x16_t test_vldrbq_z_s8(const int8_t *base, mve_pred16_t p)
+{
+ return vldrbq_z_s8(base, p);
+}
+
+// CHECK-LABEL: @test_vldrbq_z_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i8* [[BASE:%.*]] to <8 x i8>*
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = call <8 x i8> @llvm.masked.load.v8i8.p0v8i8(<8 x i8>* [[TMP0]], i32 1, <8 x i1> [[TMP2]], <8 x i8> zeroinitializer)
+// CHECK-NEXT: [[TMP4:%.*]] = sext <8 x i8> [[TMP3]] to <8 x i16>
+// CHECK-NEXT: ret <8 x i16> [[TMP4]]
+//
+int16x8_t test_vldrbq_z_s16(const int8_t *base, mve_pred16_t p)
+{
+ return vldrbq_z_s16(base, p);
+}
+
+// CHECK-LABEL: @test_vldrbq_z_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i8* [[BASE:%.*]] to <4 x i8>*
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = call <4 x i8> @llvm.masked.load.v4i8.p0v4i8(<4 x i8>* [[TMP0]], i32 1, <4 x i1> [[TMP2]], <4 x i8> zeroinitializer)
+// CHECK-NEXT: [[TMP4:%.*]] = sext <4 x i8> [[TMP3]] to <4 x i32>
+// CHECK-NEXT: ret <4 x i32> [[TMP4]]
+//
+int32x4_t test_vldrbq_z_s32(const int8_t *base, mve_pred16_t p)
+{
+ return vldrbq_z_s32(base, p);
+}
+
+// CHECK-LABEL: @test_vldrbq_z_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i8* [[BASE:%.*]] to <16 x i8>*
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = call <16 x i8> @llvm.masked.load.v16i8.p0v16i8(<16 x i8>* [[TMP0]], i32 1, <16 x i1> [[TMP2]], <16 x i8> zeroinitializer)
+// CHECK-NEXT: ret <16 x i8> [[TMP3]]
+//
+uint8x16_t test_vldrbq_z_u8(const uint8_t *base, mve_pred16_t p)
+{
+ return vldrbq_z_u8(base, p);
+}
+
+// CHECK-LABEL: @test_vldrbq_z_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i8* [[BASE:%.*]] to <8 x i8>*
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = call <8 x i8> @llvm.masked.load.v8i8.p0v8i8(<8 x i8>* [[TMP0]], i32 1, <8 x i1> [[TMP2]], <8 x i8> zeroinitializer)
+// CHECK-NEXT: [[TMP4:%.*]] = zext <8 x i8> [[TMP3]] to <8 x i16>
+// CHECK-NEXT: ret <8 x i16> [[TMP4]]
+//
+uint16x8_t test_vldrbq_z_u16(const uint8_t *base, mve_pred16_t p)
+{
+ return vldrbq_z_u16(base, p);
+}
+
+// CHECK-LABEL: @test_vldrbq_z_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i8* [[BASE:%.*]] to <4 x i8>*
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = call <4 x i8> @llvm.masked.load.v4i8.p0v4i8(<4 x i8>* [[TMP0]], i32 1, <4 x i1> [[TMP2]], <4 x i8> zeroinitializer)
+// CHECK-NEXT: [[TMP4:%.*]] = zext <4 x i8> [[TMP3]] to <4 x i32>
+// CHECK-NEXT: ret <4 x i32> [[TMP4]]
+//
+uint32x4_t test_vldrbq_z_u32(const uint8_t *base, mve_pred16_t p)
+{
+ return vldrbq_z_u32(base, p);
+}
+
+// CHECK-LABEL: @test_vldrhq_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast half* [[BASE:%.*]] to <8 x half>*
+// CHECK-NEXT: [[TMP1:%.*]] = load <8 x half>, <8 x half>* [[TMP0]], align 2
+// CHECK-NEXT: ret <8 x half> [[TMP1]]
+//
+float16x8_t test_vldrhq_f16(const float16_t *base)
+{
+ return vldrhq_f16(base);
+}
+
+// CHECK-LABEL: @test_vldrhq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i16* [[BASE:%.*]] to <8 x i16>*
+// CHECK-NEXT: [[TMP1:%.*]] = load <8 x i16>, <8 x i16>* [[TMP0]], align 2
+// CHECK-NEXT: ret <8 x i16> [[TMP1]]
+//
+int16x8_t test_vldrhq_s16(const int16_t *base)
+{
+ return vldrhq_s16(base);
+}
+
+// CHECK-LABEL: @test_vldrhq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i16* [[BASE:%.*]] to <4 x i16>*
+// CHECK-NEXT: [[TMP1:%.*]] = load <4 x i16>, <4 x i16>* [[TMP0]], align 2
+// CHECK-NEXT: [[TMP2:%.*]] = sext <4 x i16> [[TMP1]] to <4 x i32>
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vldrhq_s32(const int16_t *base)
+{
+ return vldrhq_s32(base);
+}
+
+// CHECK-LABEL: @test_vldrhq_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i16* [[BASE:%.*]] to <8 x i16>*
+// CHECK-NEXT: [[TMP1:%.*]] = load <8 x i16>, <8 x i16>* [[TMP0]], align 2
+// CHECK-NEXT: ret <8 x i16> [[TMP1]]
+//
+uint16x8_t test_vldrhq_u16(const uint16_t *base)
+{
+ return vldrhq_u16(base);
+}
+
+// CHECK-LABEL: @test_vldrhq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i16* [[BASE:%.*]] to <4 x i16>*
+// CHECK-NEXT: [[TMP1:%.*]] = load <4 x i16>, <4 x i16>* [[TMP0]], align 2
+// CHECK-NEXT: [[TMP2:%.*]] = zext <4 x i16> [[TMP1]] to <4 x i32>
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vldrhq_u32(const uint16_t *base)
+{
+ return vldrhq_u32(base);
+}
+
+// CHECK-LABEL: @test_vldrhq_z_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast half* [[BASE:%.*]] to <8 x half>*
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = call <8 x half> @llvm.masked.load.v8f16.p0v8f16(<8 x half>* [[TMP0]], i32 2, <8 x i1> [[TMP2]], <8 x half> zeroinitializer)
+// CHECK-NEXT: ret <8 x half> [[TMP3]]
+//
+float16x8_t test_vldrhq_z_f16(const float16_t *base, mve_pred16_t p)
+{
+ return vldrhq_z_f16(base, p);
+}
+
+// CHECK-LABEL: @test_vldrhq_z_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i16* [[BASE:%.*]] to <8 x i16>*
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = call <8 x i16> @llvm.masked.load.v8i16.p0v8i16(<8 x i16>* [[TMP0]], i32 2, <8 x i1> [[TMP2]], <8 x i16> zeroinitializer)
+// CHECK-NEXT: ret <8 x i16> [[TMP3]]
+//
+int16x8_t test_vldrhq_z_s16(const int16_t *base, mve_pred16_t p)
+{
+ return vldrhq_z_s16(base, p);
+}
+
+// CHECK-LABEL: @test_vldrhq_z_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i16* [[BASE:%.*]] to <4 x i16>*
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = call <4 x i16> @llvm.masked.load.v4i16.p0v4i16(<4 x i16>* [[TMP0]], i32 2, <4 x i1> [[TMP2]], <4 x i16> zeroinitializer)
+// CHECK-NEXT: [[TMP4:%.*]] = sext <4 x i16> [[TMP3]] to <4 x i32>
+// CHECK-NEXT: ret <4 x i32> [[TMP4]]
+//
+int32x4_t test_vldrhq_z_s32(const int16_t *base, mve_pred16_t p)
+{
+ return vldrhq_z_s32(base, p);
+}
+
+// CHECK-LABEL: @test_vldrhq_z_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i16* [[BASE:%.*]] to <8 x i16>*
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = call <8 x i16> @llvm.masked.load.v8i16.p0v8i16(<8 x i16>* [[TMP0]], i32 2, <8 x i1> [[TMP2]], <8 x i16> zeroinitializer)
+// CHECK-NEXT: ret <8 x i16> [[TMP3]]
+//
+uint16x8_t test_vldrhq_z_u16(const uint16_t *base, mve_pred16_t p)
+{
+ return vldrhq_z_u16(base, p);
+}
+
+// CHECK-LABEL: @test_vldrhq_z_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i16* [[BASE:%.*]] to <4 x i16>*
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = call <4 x i16> @llvm.masked.load.v4i16.p0v4i16(<4 x i16>* [[TMP0]], i32 2, <4 x i1> [[TMP2]], <4 x i16> zeroinitializer)
+// CHECK-NEXT: [[TMP4:%.*]] = zext <4 x i16> [[TMP3]] to <4 x i32>
+// CHECK-NEXT: ret <4 x i32> [[TMP4]]
+//
+uint32x4_t test_vldrhq_z_u32(const uint16_t *base, mve_pred16_t p)
+{
+ return vldrhq_z_u32(base, p);
+}
+
+// CHECK-LABEL: @test_vldrwq_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast float* [[BASE:%.*]] to <4 x float>*
+// CHECK-NEXT: [[TMP1:%.*]] = load <4 x float>, <4 x float>* [[TMP0]], align 4
+// CHECK-NEXT: ret <4 x float> [[TMP1]]
+//
+float32x4_t test_vldrwq_f32(const float32_t *base)
+{
+ return vldrwq_f32(base);
+}
+
+// CHECK-LABEL: @test_vldrwq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i32* [[BASE:%.*]] to <4 x i32>*
+// CHECK-NEXT: [[TMP1:%.*]] = load <4 x i32>, <4 x i32>* [[TMP0]], align 4
+// CHECK-NEXT: ret <4 x i32> [[TMP1]]
+//
+int32x4_t test_vldrwq_s32(const int32_t *base)
+{
+ return vldrwq_s32(base);
+}
+
+// CHECK-LABEL: @test_vldrwq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i32* [[BASE:%.*]] to <4 x i32>*
+// CHECK-NEXT: [[TMP1:%.*]] = load <4 x i32>, <4 x i32>* [[TMP0]], align 4
+// CHECK-NEXT: ret <4 x i32> [[TMP1]]
+//
+uint32x4_t test_vldrwq_u32(const uint32_t *base)
+{
+ return vldrwq_u32(base);
+}
+
+// CHECK-LABEL: @test_vldrwq_z_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast float* [[BASE:%.*]] to <4 x float>*
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = call <4 x float> @llvm.masked.load.v4f32.p0v4f32(<4 x float>* [[TMP0]], i32 4, <4 x i1> [[TMP2]], <4 x float> zeroinitializer)
+// CHECK-NEXT: ret <4 x float> [[TMP3]]
+//
+float32x4_t test_vldrwq_z_f32(const float32_t *base, mve_pred16_t p)
+{
+ return vldrwq_z_f32(base, p);
+}
+
+// CHECK-LABEL: @test_vldrwq_z_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i32* [[BASE:%.*]] to <4 x i32>*
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = call <4 x i32> @llvm.masked.load.v4i32.p0v4i32(<4 x i32>* [[TMP0]], i32 4, <4 x i1> [[TMP2]], <4 x i32> zeroinitializer)
+// CHECK-NEXT: ret <4 x i32> [[TMP3]]
+//
+int32x4_t test_vldrwq_z_s32(const int32_t *base, mve_pred16_t p)
+{
+ return vldrwq_z_s32(base, p);
+}
+
+// CHECK-LABEL: @test_vldrwq_z_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i32* [[BASE:%.*]] to <4 x i32>*
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = call <4 x i32> @llvm.masked.load.v4i32.p0v4i32(<4 x i32>* [[TMP0]], i32 4, <4 x i1> [[TMP2]], <4 x i32> zeroinitializer)
+// CHECK-NEXT: ret <4 x i32> [[TMP3]]
+//
+uint32x4_t test_vldrwq_z_u32(const uint32_t *base, mve_pred16_t p)
+{
+ return vldrwq_z_u32(base, p);
+}
+
+// CHECK-LABEL: @test_vst1q_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast half* [[BASE:%.*]] to <8 x half>*
+// CHECK-NEXT: store <8 x half> [[VALUE:%.*]], <8 x half>* [[TMP0]], align 2
+// CHECK-NEXT: ret void
+//
+void test_vst1q_f16(float16_t *base, float16x8_t value)
+{
+#ifdef POLYMORPHIC
+ vst1q(base, value);
+#else /* POLYMORPHIC */
+ vst1q_f16(base, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vst1q_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast float* [[BASE:%.*]] to <4 x float>*
+// CHECK-NEXT: store <4 x float> [[VALUE:%.*]], <4 x float>* [[TMP0]], align 4
+// CHECK-NEXT: ret void
+//
+void test_vst1q_f32(float32_t *base, float32x4_t value)
+{
+#ifdef POLYMORPHIC
+ vst1q(base, value);
+#else /* POLYMORPHIC */
+ vst1q_f32(base, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vst1q_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i8* [[BASE:%.*]] to <16 x i8>*
+// CHECK-NEXT: store <16 x i8> [[VALUE:%.*]], <16 x i8>* [[TMP0]], align 1
+// CHECK-NEXT: ret void
+//
+void test_vst1q_s8(int8_t *base, int8x16_t value)
+{
+#ifdef POLYMORPHIC
+ vst1q(base, value);
+#else /* POLYMORPHIC */
+ vst1q_s8(base, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vst1q_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i16* [[BASE:%.*]] to <8 x i16>*
+// CHECK-NEXT: store <8 x i16> [[VALUE:%.*]], <8 x i16>* [[TMP0]], align 2
+// CHECK-NEXT: ret void
+//
+void test_vst1q_s16(int16_t *base, int16x8_t value)
+{
+#ifdef POLYMORPHIC
+ vst1q(base, value);
+#else /* POLYMORPHIC */
+ vst1q_s16(base, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vst1q_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i32* [[BASE:%.*]] to <4 x i32>*
+// CHECK-NEXT: store <4 x i32> [[VALUE:%.*]], <4 x i32>* [[TMP0]], align 4
+// CHECK-NEXT: ret void
+//
+void test_vst1q_s32(int32_t *base, int32x4_t value)
+{
+#ifdef POLYMORPHIC
+ vst1q(base, value);
+#else /* POLYMORPHIC */
+ vst1q_s32(base, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vst1q_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i8* [[BASE:%.*]] to <16 x i8>*
+// CHECK-NEXT: store <16 x i8> [[VALUE:%.*]], <16 x i8>* [[TMP0]], align 1
+// CHECK-NEXT: ret void
+//
+void test_vst1q_u8(uint8_t *base, uint8x16_t value)
+{
+#ifdef POLYMORPHIC
+ vst1q(base, value);
+#else /* POLYMORPHIC */
+ vst1q_u8(base, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vst1q_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i16* [[BASE:%.*]] to <8 x i16>*
+// CHECK-NEXT: store <8 x i16> [[VALUE:%.*]], <8 x i16>* [[TMP0]], align 2
+// CHECK-NEXT: ret void
+//
+void test_vst1q_u16(uint16_t *base, uint16x8_t value)
+{
+#ifdef POLYMORPHIC
+ vst1q(base, value);
+#else /* POLYMORPHIC */
+ vst1q_u16(base, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vst1q_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i32* [[BASE:%.*]] to <4 x i32>*
+// CHECK-NEXT: store <4 x i32> [[VALUE:%.*]], <4 x i32>* [[TMP0]], align 4
+// CHECK-NEXT: ret void
+//
+void test_vst1q_u32(uint32_t *base, uint32x4_t value)
+{
+#ifdef POLYMORPHIC
+ vst1q(base, value);
+#else /* POLYMORPHIC */
+ vst1q_u32(base, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vst1q_p_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast half* [[BASE:%.*]] to <8 x half>*
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP1]])
+// CHECK-NEXT: call void @llvm.masked.store.v8f16.p0v8f16(<8 x half> [[VALUE:%.*]], <8 x half>* [[TMP0]], i32 2, <8 x i1> [[TMP2]])
+// CHECK-NEXT: ret void
+//
+void test_vst1q_p_f16(float16_t *base, float16x8_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vst1q_p(base, value, p);
+#else /* POLYMORPHIC */
+ vst1q_p_f16(base, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vst1q_p_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast float* [[BASE:%.*]] to <4 x float>*
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP1]])
+// CHECK-NEXT: call void @llvm.masked.store.v4f32.p0v4f32(<4 x float> [[VALUE:%.*]], <4 x float>* [[TMP0]], i32 4, <4 x i1> [[TMP2]])
+// CHECK-NEXT: ret void
+//
+void test_vst1q_p_f32(float32_t *base, float32x4_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vst1q_p(base, value, p);
+#else /* POLYMORPHIC */
+ vst1q_p_f32(base, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vst1q_p_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i8* [[BASE:%.*]] to <16 x i8>*
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP1]])
+// CHECK-NEXT: call void @llvm.masked.store.v16i8.p0v16i8(<16 x i8> [[VALUE:%.*]], <16 x i8>* [[TMP0]], i32 1, <16 x i1> [[TMP2]])
+// CHECK-NEXT: ret void
+//
+void test_vst1q_p_s8(int8_t *base, int8x16_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vst1q_p(base, value, p);
+#else /* POLYMORPHIC */
+ vst1q_p_s8(base, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vst1q_p_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i16* [[BASE:%.*]] to <8 x i16>*
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP1]])
+// CHECK-NEXT: call void @llvm.masked.store.v8i16.p0v8i16(<8 x i16> [[VALUE:%.*]], <8 x i16>* [[TMP0]], i32 2, <8 x i1> [[TMP2]])
+// CHECK-NEXT: ret void
+//
+void test_vst1q_p_s16(int16_t *base, int16x8_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vst1q_p(base, value, p);
+#else /* POLYMORPHIC */
+ vst1q_p_s16(base, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vst1q_p_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i32* [[BASE:%.*]] to <4 x i32>*
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP1]])
+// CHECK-NEXT: call void @llvm.masked.store.v4i32.p0v4i32(<4 x i32> [[VALUE:%.*]], <4 x i32>* [[TMP0]], i32 4, <4 x i1> [[TMP2]])
+// CHECK-NEXT: ret void
+//
+void test_vst1q_p_s32(int32_t *base, int32x4_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vst1q_p(base, value, p);
+#else /* POLYMORPHIC */
+ vst1q_p_s32(base, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vst1q_p_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i8* [[BASE:%.*]] to <16 x i8>*
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP1]])
+// CHECK-NEXT: call void @llvm.masked.store.v16i8.p0v16i8(<16 x i8> [[VALUE:%.*]], <16 x i8>* [[TMP0]], i32 1, <16 x i1> [[TMP2]])
+// CHECK-NEXT: ret void
+//
+void test_vst1q_p_u8(uint8_t *base, uint8x16_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vst1q_p(base, value, p);
+#else /* POLYMORPHIC */
+ vst1q_p_u8(base, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vst1q_p_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i16* [[BASE:%.*]] to <8 x i16>*
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP1]])
+// CHECK-NEXT: call void @llvm.masked.store.v8i16.p0v8i16(<8 x i16> [[VALUE:%.*]], <8 x i16>* [[TMP0]], i32 2, <8 x i1> [[TMP2]])
+// CHECK-NEXT: ret void
+//
+void test_vst1q_p_u16(uint16_t *base, uint16x8_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vst1q_p(base, value, p);
+#else /* POLYMORPHIC */
+ vst1q_p_u16(base, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vst1q_p_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i32* [[BASE:%.*]] to <4 x i32>*
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP1]])
+// CHECK-NEXT: call void @llvm.masked.store.v4i32.p0v4i32(<4 x i32> [[VALUE:%.*]], <4 x i32>* [[TMP0]], i32 4, <4 x i1> [[TMP2]])
+// CHECK-NEXT: ret void
+//
+void test_vst1q_p_u32(uint32_t *base, uint32x4_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vst1q_p(base, value, p);
+#else /* POLYMORPHIC */
+ vst1q_p_u32(base, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrbq_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i8* [[BASE:%.*]] to <16 x i8>*
+// CHECK-NEXT: store <16 x i8> [[VALUE:%.*]], <16 x i8>* [[TMP0]], align 1
+// CHECK-NEXT: ret void
+//
+void test_vstrbq_s8(int8_t *base, int8x16_t value)
+{
+#ifdef POLYMORPHIC
+ vstrbq(base, value);
+#else /* POLYMORPHIC */
+ vstrbq_s8(base, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrbq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = trunc <8 x i16> [[VALUE:%.*]] to <8 x i8>
+// CHECK-NEXT: [[TMP1:%.*]] = bitcast i8* [[BASE:%.*]] to <8 x i8>*
+// CHECK-NEXT: store <8 x i8> [[TMP0]], <8 x i8>* [[TMP1]], align 1
+// CHECK-NEXT: ret void
+//
+void test_vstrbq_s16(int8_t *base, int16x8_t value)
+{
+#ifdef POLYMORPHIC
+ vstrbq(base, value);
+#else /* POLYMORPHIC */
+ vstrbq_s16(base, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrbq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = trunc <4 x i32> [[VALUE:%.*]] to <4 x i8>
+// CHECK-NEXT: [[TMP1:%.*]] = bitcast i8* [[BASE:%.*]] to <4 x i8>*
+// CHECK-NEXT: store <4 x i8> [[TMP0]], <4 x i8>* [[TMP1]], align 1
+// CHECK-NEXT: ret void
+//
+void test_vstrbq_s32(int8_t *base, int32x4_t value)
+{
+#ifdef POLYMORPHIC
+ vstrbq(base, value);
+#else /* POLYMORPHIC */
+ vstrbq_s32(base, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrbq_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i8* [[BASE:%.*]] to <16 x i8>*
+// CHECK-NEXT: store <16 x i8> [[VALUE:%.*]], <16 x i8>* [[TMP0]], align 1
+// CHECK-NEXT: ret void
+//
+void test_vstrbq_u8(uint8_t *base, uint8x16_t value)
+{
+#ifdef POLYMORPHIC
+ vstrbq(base, value);
+#else /* POLYMORPHIC */
+ vstrbq_u8(base, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrbq_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = trunc <8 x i16> [[VALUE:%.*]] to <8 x i8>
+// CHECK-NEXT: [[TMP1:%.*]] = bitcast i8* [[BASE:%.*]] to <8 x i8>*
+// CHECK-NEXT: store <8 x i8> [[TMP0]], <8 x i8>* [[TMP1]], align 1
+// CHECK-NEXT: ret void
+//
+void test_vstrbq_u16(uint8_t *base, uint16x8_t value)
+{
+#ifdef POLYMORPHIC
+ vstrbq(base, value);
+#else /* POLYMORPHIC */
+ vstrbq_u16(base, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrbq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = trunc <4 x i32> [[VALUE:%.*]] to <4 x i8>
+// CHECK-NEXT: [[TMP1:%.*]] = bitcast i8* [[BASE:%.*]] to <4 x i8>*
+// CHECK-NEXT: store <4 x i8> [[TMP0]], <4 x i8>* [[TMP1]], align 1
+// CHECK-NEXT: ret void
+//
+void test_vstrbq_u32(uint8_t *base, uint32x4_t value)
+{
+#ifdef POLYMORPHIC
+ vstrbq(base, value);
+#else /* POLYMORPHIC */
+ vstrbq_u32(base, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrbq_p_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i8* [[BASE:%.*]] to <16 x i8>*
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP1]])
+// CHECK-NEXT: call void @llvm.masked.store.v16i8.p0v16i8(<16 x i8> [[VALUE:%.*]], <16 x i8>* [[TMP0]], i32 1, <16 x i1> [[TMP2]])
+// CHECK-NEXT: ret void
+//
+void test_vstrbq_p_s8(int8_t *base, int8x16_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrbq_p(base, value, p);
+#else /* POLYMORPHIC */
+ vstrbq_p_s8(base, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrbq_p_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = trunc <8 x i16> [[VALUE:%.*]] to <8 x i8>
+// CHECK-NEXT: [[TMP1:%.*]] = bitcast i8* [[BASE:%.*]] to <8 x i8>*
+// CHECK-NEXT: [[TMP2:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP2]])
+// CHECK-NEXT: call void @llvm.masked.store.v8i8.p0v8i8(<8 x i8> [[TMP0]], <8 x i8>* [[TMP1]], i32 1, <8 x i1> [[TMP3]])
+// CHECK-NEXT: ret void
+//
+void test_vstrbq_p_s16(int8_t *base, int16x8_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrbq_p(base, value, p);
+#else /* POLYMORPHIC */
+ vstrbq_p_s16(base, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrbq_p_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = trunc <4 x i32> [[VALUE:%.*]] to <4 x i8>
+// CHECK-NEXT: [[TMP1:%.*]] = bitcast i8* [[BASE:%.*]] to <4 x i8>*
+// CHECK-NEXT: [[TMP2:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP2]])
+// CHECK-NEXT: call void @llvm.masked.store.v4i8.p0v4i8(<4 x i8> [[TMP0]], <4 x i8>* [[TMP1]], i32 1, <4 x i1> [[TMP3]])
+// CHECK-NEXT: ret void
+//
+void test_vstrbq_p_s32(int8_t *base, int32x4_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrbq_p(base, value, p);
+#else /* POLYMORPHIC */
+ vstrbq_p_s32(base, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrbq_p_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i8* [[BASE:%.*]] to <16 x i8>*
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP1]])
+// CHECK-NEXT: call void @llvm.masked.store.v16i8.p0v16i8(<16 x i8> [[VALUE:%.*]], <16 x i8>* [[TMP0]], i32 1, <16 x i1> [[TMP2]])
+// CHECK-NEXT: ret void
+//
+void test_vstrbq_p_u8(uint8_t *base, uint8x16_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrbq_p(base, value, p);
+#else /* POLYMORPHIC */
+ vstrbq_p_u8(base, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrbq_p_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = trunc <8 x i16> [[VALUE:%.*]] to <8 x i8>
+// CHECK-NEXT: [[TMP1:%.*]] = bitcast i8* [[BASE:%.*]] to <8 x i8>*
+// CHECK-NEXT: [[TMP2:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP2]])
+// CHECK-NEXT: call void @llvm.masked.store.v8i8.p0v8i8(<8 x i8> [[TMP0]], <8 x i8>* [[TMP1]], i32 1, <8 x i1> [[TMP3]])
+// CHECK-NEXT: ret void
+//
+void test_vstrbq_p_u16(uint8_t *base, uint16x8_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrbq_p(base, value, p);
+#else /* POLYMORPHIC */
+ vstrbq_p_u16(base, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrbq_p_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = trunc <4 x i32> [[VALUE:%.*]] to <4 x i8>
+// CHECK-NEXT: [[TMP1:%.*]] = bitcast i8* [[BASE:%.*]] to <4 x i8>*
+// CHECK-NEXT: [[TMP2:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP2]])
+// CHECK-NEXT: call void @llvm.masked.store.v4i8.p0v4i8(<4 x i8> [[TMP0]], <4 x i8>* [[TMP1]], i32 1, <4 x i1> [[TMP3]])
+// CHECK-NEXT: ret void
+//
+void test_vstrbq_p_u32(uint8_t *base, uint32x4_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrbq_p(base, value, p);
+#else /* POLYMORPHIC */
+ vstrbq_p_u32(base, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrhq_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast half* [[BASE:%.*]] to <8 x half>*
+// CHECK-NEXT: store <8 x half> [[VALUE:%.*]], <8 x half>* [[TMP0]], align 2
+// CHECK-NEXT: ret void
+//
+void test_vstrhq_f16(float16_t *base, float16x8_t value)
+{
+#ifdef POLYMORPHIC
+ vstrhq(base, value);
+#else /* POLYMORPHIC */
+ vstrhq_f16(base, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrhq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i16* [[BASE:%.*]] to <8 x i16>*
+// CHECK-NEXT: store <8 x i16> [[VALUE:%.*]], <8 x i16>* [[TMP0]], align 2
+// CHECK-NEXT: ret void
+//
+void test_vstrhq_s16(int16_t *base, int16x8_t value)
+{
+#ifdef POLYMORPHIC
+ vstrhq(base, value);
+#else /* POLYMORPHIC */
+ vstrhq_s16(base, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrhq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = trunc <4 x i32> [[VALUE:%.*]] to <4 x i16>
+// CHECK-NEXT: [[TMP1:%.*]] = bitcast i16* [[BASE:%.*]] to <4 x i16>*
+// CHECK-NEXT: store <4 x i16> [[TMP0]], <4 x i16>* [[TMP1]], align 2
+// CHECK-NEXT: ret void
+//
+void test_vstrhq_s32(int16_t *base, int32x4_t value)
+{
+#ifdef POLYMORPHIC
+ vstrhq(base, value);
+#else /* POLYMORPHIC */
+ vstrhq_s32(base, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrhq_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i16* [[BASE:%.*]] to <8 x i16>*
+// CHECK-NEXT: store <8 x i16> [[VALUE:%.*]], <8 x i16>* [[TMP0]], align 2
+// CHECK-NEXT: ret void
+//
+void test_vstrhq_u16(uint16_t *base, uint16x8_t value)
+{
+#ifdef POLYMORPHIC
+ vstrhq(base, value);
+#else /* POLYMORPHIC */
+ vstrhq_u16(base, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrhq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = trunc <4 x i32> [[VALUE:%.*]] to <4 x i16>
+// CHECK-NEXT: [[TMP1:%.*]] = bitcast i16* [[BASE:%.*]] to <4 x i16>*
+// CHECK-NEXT: store <4 x i16> [[TMP0]], <4 x i16>* [[TMP1]], align 2
+// CHECK-NEXT: ret void
+//
+void test_vstrhq_u32(uint16_t *base, uint32x4_t value)
+{
+#ifdef POLYMORPHIC
+ vstrhq(base, value);
+#else /* POLYMORPHIC */
+ vstrhq_u32(base, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrhq_p_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast half* [[BASE:%.*]] to <8 x half>*
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP1]])
+// CHECK-NEXT: call void @llvm.masked.store.v8f16.p0v8f16(<8 x half> [[VALUE:%.*]], <8 x half>* [[TMP0]], i32 2, <8 x i1> [[TMP2]])
+// CHECK-NEXT: ret void
+//
+void test_vstrhq_p_f16(float16_t *base, float16x8_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrhq_p(base, value, p);
+#else /* POLYMORPHIC */
+ vstrhq_p_f16(base, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrhq_p_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i16* [[BASE:%.*]] to <8 x i16>*
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP1]])
+// CHECK-NEXT: call void @llvm.masked.store.v8i16.p0v8i16(<8 x i16> [[VALUE:%.*]], <8 x i16>* [[TMP0]], i32 2, <8 x i1> [[TMP2]])
+// CHECK-NEXT: ret void
+//
+void test_vstrhq_p_s16(int16_t *base, int16x8_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrhq_p(base, value, p);
+#else /* POLYMORPHIC */
+ vstrhq_p_s16(base, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrhq_p_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = trunc <4 x i32> [[VALUE:%.*]] to <4 x i16>
+// CHECK-NEXT: [[TMP1:%.*]] = bitcast i16* [[BASE:%.*]] to <4 x i16>*
+// CHECK-NEXT: [[TMP2:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP2]])
+// CHECK-NEXT: call void @llvm.masked.store.v4i16.p0v4i16(<4 x i16> [[TMP0]], <4 x i16>* [[TMP1]], i32 2, <4 x i1> [[TMP3]])
+// CHECK-NEXT: ret void
+//
+void test_vstrhq_p_s32(int16_t *base, int32x4_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrhq_p(base, value, p);
+#else /* POLYMORPHIC */
+ vstrhq_p_s32(base, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrhq_p_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i16* [[BASE:%.*]] to <8 x i16>*
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP1]])
+// CHECK-NEXT: call void @llvm.masked.store.v8i16.p0v8i16(<8 x i16> [[VALUE:%.*]], <8 x i16>* [[TMP0]], i32 2, <8 x i1> [[TMP2]])
+// CHECK-NEXT: ret void
+//
+void test_vstrhq_p_u16(uint16_t *base, uint16x8_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrhq_p(base, value, p);
+#else /* POLYMORPHIC */
+ vstrhq_p_u16(base, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrhq_p_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = trunc <4 x i32> [[VALUE:%.*]] to <4 x i16>
+// CHECK-NEXT: [[TMP1:%.*]] = bitcast i16* [[BASE:%.*]] to <4 x i16>*
+// CHECK-NEXT: [[TMP2:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP2]])
+// CHECK-NEXT: call void @llvm.masked.store.v4i16.p0v4i16(<4 x i16> [[TMP0]], <4 x i16>* [[TMP1]], i32 2, <4 x i1> [[TMP3]])
+// CHECK-NEXT: ret void
+//
+void test_vstrhq_p_u32(uint16_t *base, uint32x4_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrhq_p(base, value, p);
+#else /* POLYMORPHIC */
+ vstrhq_p_u32(base, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrwq_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast float* [[BASE:%.*]] to <4 x float>*
+// CHECK-NEXT: store <4 x float> [[VALUE:%.*]], <4 x float>* [[TMP0]], align 4
+// CHECK-NEXT: ret void
+//
+void test_vstrwq_f32(float32_t *base, float32x4_t value)
+{
+#ifdef POLYMORPHIC
+ vstrwq(base, value);
+#else /* POLYMORPHIC */
+ vstrwq_f32(base, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrwq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i32* [[BASE:%.*]] to <4 x i32>*
+// CHECK-NEXT: store <4 x i32> [[VALUE:%.*]], <4 x i32>* [[TMP0]], align 4
+// CHECK-NEXT: ret void
+//
+void test_vstrwq_s32(int32_t *base, int32x4_t value)
+{
+#ifdef POLYMORPHIC
+ vstrwq(base, value);
+#else /* POLYMORPHIC */
+ vstrwq_s32(base, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrwq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i32* [[BASE:%.*]] to <4 x i32>*
+// CHECK-NEXT: store <4 x i32> [[VALUE:%.*]], <4 x i32>* [[TMP0]], align 4
+// CHECK-NEXT: ret void
+//
+void test_vstrwq_u32(uint32_t *base, uint32x4_t value)
+{
+#ifdef POLYMORPHIC
+ vstrwq(base, value);
+#else /* POLYMORPHIC */
+ vstrwq_u32(base, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrwq_p_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast float* [[BASE:%.*]] to <4 x float>*
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP1]])
+// CHECK-NEXT: call void @llvm.masked.store.v4f32.p0v4f32(<4 x float> [[VALUE:%.*]], <4 x float>* [[TMP0]], i32 4, <4 x i1> [[TMP2]])
+// CHECK-NEXT: ret void
+//
+void test_vstrwq_p_f32(float32_t *base, float32x4_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrwq_p(base, value, p);
+#else /* POLYMORPHIC */
+ vstrwq_p_f32(base, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrwq_p_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i32* [[BASE:%.*]] to <4 x i32>*
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP1]])
+// CHECK-NEXT: call void @llvm.masked.store.v4i32.p0v4i32(<4 x i32> [[VALUE:%.*]], <4 x i32>* [[TMP0]], i32 4, <4 x i1> [[TMP2]])
+// CHECK-NEXT: ret void
+//
+void test_vstrwq_p_s32(int32_t *base, int32x4_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrwq_p(base, value, p);
+#else /* POLYMORPHIC */
+ vstrwq_p_s32(base, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrwq_p_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast i32* [[BASE:%.*]] to <4 x i32>*
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP1]])
+// CHECK-NEXT: call void @llvm.masked.store.v4i32.p0v4i32(<4 x i32> [[VALUE:%.*]], <4 x i32>* [[TMP0]], i32 4, <4 x i1> [[TMP2]])
+// CHECK-NEXT: ret void
+//
+void test_vstrwq_p_u32(uint32_t *base, uint32x4_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrwq_p(base, value, p);
+#else /* POLYMORPHIC */
+ vstrwq_p_u32(base, value, p);
+#endif /* POLYMORPHIC */
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/predicates.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/predicates.c
new file mode 100644
index 0000000..5761849
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/predicates.c
@@ -0,0 +1,290 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg -sroa -early-cse | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg -sroa -early-cse | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vctp16q(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i1> @llvm.arm.mve.vctp16(i32 [[A:%.*]])
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vctp16q(uint32_t a)
+{
+ return vctp16q(a);
+}
+
+// CHECK-LABEL: @test_vctp16q_m(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i1> @llvm.arm.mve.vctp16(i32 [[A:%.*]])
+// CHECK-NEXT: [[TMP3:%.*]] = and <8 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v8i1(<8 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vctp16q_m(uint32_t a, mve_pred16_t p)
+{
+ return vctp16q_m(a, p);
+}
+
+// CHECK-LABEL: @test_vctp32q(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i1> @llvm.arm.mve.vctp32(i32 [[A:%.*]])
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vctp32q(uint32_t a)
+{
+ return vctp32q(a);
+}
+
+// CHECK-LABEL: @test_vctp32q_m(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i1> @llvm.arm.mve.vctp32(i32 [[A:%.*]])
+// CHECK-NEXT: [[TMP3:%.*]] = and <4 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vctp32q_m(uint32_t a, mve_pred16_t p)
+{
+ return vctp32q_m(a, p);
+}
+
+// CHECK-LABEL: @test_vctp64q(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i1> @llvm.arm.mve.vctp64(i32 [[A:%.*]])
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vctp64q(uint32_t a)
+{
+ return vctp64q(a);
+}
+
+// CHECK-LABEL: @test_vctp64q_m(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i1> @llvm.arm.mve.vctp64(i32 [[A:%.*]])
+// CHECK-NEXT: [[TMP3:%.*]] = and <4 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v4i1(<4 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vctp64q_m(uint32_t a, mve_pred16_t p)
+{
+ return vctp64q_m(a, p);
+}
+
+// CHECK-LABEL: @test_vctp8q(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i1> @llvm.arm.mve.vctp8(i32 [[A:%.*]])
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v16i1(<16 x i1> [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+mve_pred16_t test_vctp8q(uint32_t a)
+{
+ return vctp8q(a);
+}
+
+// CHECK-LABEL: @test_vctp8q_m(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i1> @llvm.arm.mve.vctp8(i32 [[A:%.*]])
+// CHECK-NEXT: [[TMP3:%.*]] = and <16 x i1> [[TMP1]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.mve.pred.v2i.v16i1(<16 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
+// CHECK-NEXT: ret i16 [[TMP5]]
+//
+mve_pred16_t test_vctp8q_m(uint32_t a, mve_pred16_t p)
+{
+ return vctp8q_m(a, p);
+}
+
+// CHECK-LABEL: @test_vpnot(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = xor i16 [[A:%.*]], -1
+// CHECK-NEXT: ret i16 [[TMP0]]
+//
+mve_pred16_t test_vpnot(mve_pred16_t a)
+{
+ return vpnot(a);
+}
+
+// CHECK-LABEL: @test_vpselq_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = select <8 x i1> [[TMP1]], <8 x half> [[A:%.*]], <8 x half> [[B:%.*]]
+// CHECK-NEXT: ret <8 x half> [[TMP2]]
+//
+float16x8_t test_vpselq_f16(float16x8_t a, float16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vpselq(a, b, p);
+#else /* POLYMORPHIC */
+ return vpselq_f16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vpselq_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = select <4 x i1> [[TMP1]], <4 x float> [[A:%.*]], <4 x float> [[B:%.*]]
+// CHECK-NEXT: ret <4 x float> [[TMP2]]
+//
+float32x4_t test_vpselq_f32(float32x4_t a, float32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vpselq(a, b, p);
+#else /* POLYMORPHIC */
+ return vpselq_f32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vpselq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = select <8 x i1> [[TMP1]], <8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]]
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vpselq_s16(int16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vpselq(a, b, p);
+#else /* POLYMORPHIC */
+ return vpselq_s16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vpselq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = select <4 x i1> [[TMP1]], <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]]
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vpselq_s32(int32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vpselq(a, b, p);
+#else /* POLYMORPHIC */
+ return vpselq_s32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vpselq_s64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[A:%.*]] to <4 x i32>
+// CHECK-NEXT: [[TMP3:%.*]] = bitcast <2 x i64> [[B:%.*]] to <4 x i32>
+// CHECK-NEXT: [[TMP4:%.*]] = select <4 x i1> [[TMP1]], <4 x i32> [[TMP2]], <4 x i32> [[TMP3]]
+// CHECK-NEXT: [[TMP5:%.*]] = bitcast <4 x i32> [[TMP4]] to <2 x i64>
+// CHECK-NEXT: ret <2 x i64> [[TMP5]]
+//
+int64x2_t test_vpselq_s64(int64x2_t a, int64x2_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vpselq(a, b, p);
+#else /* POLYMORPHIC */
+ return vpselq_s64(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vpselq_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = select <16 x i1> [[TMP1]], <16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]]
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vpselq_s8(int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vpselq(a, b, p);
+#else /* POLYMORPHIC */
+ return vpselq_s8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vpselq_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = select <8 x i1> [[TMP1]], <8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]]
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vpselq_u16(uint16x8_t a, uint16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vpselq(a, b, p);
+#else /* POLYMORPHIC */
+ return vpselq_u16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vpselq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = select <4 x i1> [[TMP1]], <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]]
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vpselq_u32(uint32x4_t a, uint32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vpselq(a, b, p);
+#else /* POLYMORPHIC */
+ return vpselq_u32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vpselq_u64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[A:%.*]] to <4 x i32>
+// CHECK-NEXT: [[TMP3:%.*]] = bitcast <2 x i64> [[B:%.*]] to <4 x i32>
+// CHECK-NEXT: [[TMP4:%.*]] = select <4 x i1> [[TMP1]], <4 x i32> [[TMP2]], <4 x i32> [[TMP3]]
+// CHECK-NEXT: [[TMP5:%.*]] = bitcast <4 x i32> [[TMP4]] to <2 x i64>
+// CHECK-NEXT: ret <2 x i64> [[TMP5]]
+//
+uint64x2_t test_vpselq_u64(uint64x2_t a, uint64x2_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vpselq(a, b, p);
+#else /* POLYMORPHIC */
+ return vpselq_u64(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vpselq_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = select <16 x i1> [[TMP1]], <16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]]
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vpselq_u8(uint8x16_t a, uint8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vpselq(a, b, p);
+#else /* POLYMORPHIC */
+ return vpselq_u8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/scalar-shifts.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/scalar-shifts.c
new file mode 100644
index 0000000..a6425e7
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/scalar-shifts.c
@@ -0,0 +1,254 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_asrl(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[VALUE:%.*]], 32
+// CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[VALUE]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call { i32, i32 } @llvm.arm.mve.asrl(i32 [[TMP2]], i32 [[TMP1]], i32 [[SHIFT:%.*]])
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { i32, i32 } [[TMP3]], 1
+// CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP4]] to i64
+// CHECK-NEXT: [[TMP6:%.*]] = shl i64 [[TMP5]], 32
+// CHECK-NEXT: [[TMP7:%.*]] = extractvalue { i32, i32 } [[TMP3]], 0
+// CHECK-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
+// CHECK-NEXT: [[TMP9:%.*]] = or i64 [[TMP6]], [[TMP8]]
+// CHECK-NEXT: ret i64 [[TMP9]]
+//
+int64_t test_asrl(int64_t value, int32_t shift)
+{
+ return asrl(value, shift);
+}
+
+// CHECK-LABEL: @test_lsll(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[VALUE:%.*]], 32
+// CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[VALUE]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call { i32, i32 } @llvm.arm.mve.lsll(i32 [[TMP2]], i32 [[TMP1]], i32 [[SHIFT:%.*]])
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { i32, i32 } [[TMP3]], 1
+// CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP4]] to i64
+// CHECK-NEXT: [[TMP6:%.*]] = shl i64 [[TMP5]], 32
+// CHECK-NEXT: [[TMP7:%.*]] = extractvalue { i32, i32 } [[TMP3]], 0
+// CHECK-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
+// CHECK-NEXT: [[TMP9:%.*]] = or i64 [[TMP6]], [[TMP8]]
+// CHECK-NEXT: ret i64 [[TMP9]]
+//
+uint64_t test_lsll(uint64_t value, int32_t shift)
+{
+ return lsll(value, shift);
+}
+
+// CHECK-LABEL: @test_sqrshr(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.sqrshr(i32 [[VALUE:%.*]], i32 [[SHIFT:%.*]])
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+int32_t test_sqrshr(int32_t value, int32_t shift)
+{
+ return sqrshr(value, shift);
+}
+
+// CHECK-LABEL: @test_sqrshrl(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[VALUE:%.*]], 32
+// CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[VALUE]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call { i32, i32 } @llvm.arm.mve.sqrshrl(i32 [[TMP2]], i32 [[TMP1]], i32 [[SHIFT:%.*]], i32 64)
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { i32, i32 } [[TMP3]], 1
+// CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP4]] to i64
+// CHECK-NEXT: [[TMP6:%.*]] = shl i64 [[TMP5]], 32
+// CHECK-NEXT: [[TMP7:%.*]] = extractvalue { i32, i32 } [[TMP3]], 0
+// CHECK-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
+// CHECK-NEXT: [[TMP9:%.*]] = or i64 [[TMP6]], [[TMP8]]
+// CHECK-NEXT: ret i64 [[TMP9]]
+//
+int64_t test_sqrshrl(int64_t value, int32_t shift)
+{
+ return sqrshrl(value, shift);
+}
+
+// CHECK-LABEL: @test_sqrshrl_sat48(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[VALUE:%.*]], 32
+// CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[VALUE]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call { i32, i32 } @llvm.arm.mve.sqrshrl(i32 [[TMP2]], i32 [[TMP1]], i32 [[SHIFT:%.*]], i32 48)
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { i32, i32 } [[TMP3]], 1
+// CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP4]] to i64
+// CHECK-NEXT: [[TMP6:%.*]] = shl i64 [[TMP5]], 32
+// CHECK-NEXT: [[TMP7:%.*]] = extractvalue { i32, i32 } [[TMP3]], 0
+// CHECK-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
+// CHECK-NEXT: [[TMP9:%.*]] = or i64 [[TMP6]], [[TMP8]]
+// CHECK-NEXT: ret i64 [[TMP9]]
+//
+int64_t test_sqrshrl_sat48(int64_t value, int32_t shift)
+{
+ return sqrshrl_sat48(value, shift);
+}
+
+// CHECK-LABEL: @test_sqshl(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.sqshl(i32 [[VALUE:%.*]], i32 2)
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+int32_t test_sqshl(int32_t value)
+{
+ return sqshl(value, 2);
+}
+
+// CHECK-LABEL: @test_sqshll(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[VALUE:%.*]], 32
+// CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[VALUE]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call { i32, i32 } @llvm.arm.mve.sqshll(i32 [[TMP2]], i32 [[TMP1]], i32 17)
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { i32, i32 } [[TMP3]], 1
+// CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP4]] to i64
+// CHECK-NEXT: [[TMP6:%.*]] = shl i64 [[TMP5]], 32
+// CHECK-NEXT: [[TMP7:%.*]] = extractvalue { i32, i32 } [[TMP3]], 0
+// CHECK-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
+// CHECK-NEXT: [[TMP9:%.*]] = or i64 [[TMP6]], [[TMP8]]
+// CHECK-NEXT: ret i64 [[TMP9]]
+//
+int64_t test_sqshll(int64_t value)
+{
+ return sqshll(value, 17);
+}
+
+// CHECK-LABEL: @test_srshr(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.srshr(i32 [[VALUE:%.*]], i32 6)
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+int32_t test_srshr(int32_t value)
+{
+ return srshr(value, 6);
+}
+
+// CHECK-LABEL: @test_srshrl(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[VALUE:%.*]], 32
+// CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[VALUE]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call { i32, i32 } @llvm.arm.mve.srshrl(i32 [[TMP2]], i32 [[TMP1]], i32 26)
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { i32, i32 } [[TMP3]], 1
+// CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP4]] to i64
+// CHECK-NEXT: [[TMP6:%.*]] = shl i64 [[TMP5]], 32
+// CHECK-NEXT: [[TMP7:%.*]] = extractvalue { i32, i32 } [[TMP3]], 0
+// CHECK-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
+// CHECK-NEXT: [[TMP9:%.*]] = or i64 [[TMP6]], [[TMP8]]
+// CHECK-NEXT: ret i64 [[TMP9]]
+//
+int64_t test_srshrl(int64_t value)
+{
+ return srshrl(value, 26);
+}
+
+// CHECK-LABEL: @test_uqrshl(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.uqrshl(i32 [[VALUE:%.*]], i32 [[SHIFT:%.*]])
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+uint32_t test_uqrshl(uint32_t value, int32_t shift)
+{
+ return uqrshl(value, shift);
+}
+
+// CHECK-LABEL: @test_uqrshll(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[VALUE:%.*]], 32
+// CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[VALUE]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call { i32, i32 } @llvm.arm.mve.uqrshll(i32 [[TMP2]], i32 [[TMP1]], i32 [[SHIFT:%.*]], i32 64)
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { i32, i32 } [[TMP3]], 1
+// CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP4]] to i64
+// CHECK-NEXT: [[TMP6:%.*]] = shl i64 [[TMP5]], 32
+// CHECK-NEXT: [[TMP7:%.*]] = extractvalue { i32, i32 } [[TMP3]], 0
+// CHECK-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
+// CHECK-NEXT: [[TMP9:%.*]] = or i64 [[TMP6]], [[TMP8]]
+// CHECK-NEXT: ret i64 [[TMP9]]
+//
+uint64_t test_uqrshll(uint64_t value, int32_t shift)
+{
+ return uqrshll(value, shift);
+}
+
+// CHECK-LABEL: @test_uqrshll_sat48(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[VALUE:%.*]], 32
+// CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[VALUE]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call { i32, i32 } @llvm.arm.mve.uqrshll(i32 [[TMP2]], i32 [[TMP1]], i32 [[SHIFT:%.*]], i32 48)
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { i32, i32 } [[TMP3]], 1
+// CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP4]] to i64
+// CHECK-NEXT: [[TMP6:%.*]] = shl i64 [[TMP5]], 32
+// CHECK-NEXT: [[TMP7:%.*]] = extractvalue { i32, i32 } [[TMP3]], 0
+// CHECK-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
+// CHECK-NEXT: [[TMP9:%.*]] = or i64 [[TMP6]], [[TMP8]]
+// CHECK-NEXT: ret i64 [[TMP9]]
+//
+uint64_t test_uqrshll_sat48(uint64_t value, int32_t shift)
+{
+ return uqrshll_sat48(value, shift);
+}
+
+// CHECK-LABEL: @test_uqshl(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.uqshl(i32 [[VALUE:%.*]], i32 21)
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+uint32_t test_uqshl(uint32_t value)
+{
+ return uqshl(value, 21);
+}
+
+// CHECK-LABEL: @test_uqshll(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[VALUE:%.*]], 32
+// CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[VALUE]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call { i32, i32 } @llvm.arm.mve.uqshll(i32 [[TMP2]], i32 [[TMP1]], i32 16)
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { i32, i32 } [[TMP3]], 1
+// CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP4]] to i64
+// CHECK-NEXT: [[TMP6:%.*]] = shl i64 [[TMP5]], 32
+// CHECK-NEXT: [[TMP7:%.*]] = extractvalue { i32, i32 } [[TMP3]], 0
+// CHECK-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
+// CHECK-NEXT: [[TMP9:%.*]] = or i64 [[TMP6]], [[TMP8]]
+// CHECK-NEXT: ret i64 [[TMP9]]
+//
+uint64_t test_uqshll(uint64_t value)
+{
+ return uqshll(value, 16);
+}
+
+// CHECK-LABEL: @test_urshr(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.urshr(i32 [[VALUE:%.*]], i32 22)
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+uint32_t test_urshr(uint32_t value)
+{
+ return urshr(value, 22);
+}
+
+// CHECK-LABEL: @test_urshrl(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[VALUE:%.*]], 32
+// CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[VALUE]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call { i32, i32 } @llvm.arm.mve.urshrl(i32 [[TMP2]], i32 [[TMP1]], i32 6)
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { i32, i32 } [[TMP3]], 1
+// CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP4]] to i64
+// CHECK-NEXT: [[TMP6:%.*]] = shl i64 [[TMP5]], 32
+// CHECK-NEXT: [[TMP7:%.*]] = extractvalue { i32, i32 } [[TMP3]], 0
+// CHECK-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
+// CHECK-NEXT: [[TMP9:%.*]] = or i64 [[TMP6]], [[TMP8]]
+// CHECK-NEXT: ret i64 [[TMP9]]
+//
+uint64_t test_urshrl(uint64_t value)
+{
+ return urshrl(value, 6);
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/scatter-gather.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/scatter-gather.c
new file mode 100644
index 0000000..564965a
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/scatter-gather.c
@@ -0,0 +1,2146 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vldrbq_gather_offset_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vldr.gather.offset.v8i16.p0i8.v8i16(i8* [[BASE:%.*]], <8 x i16> [[OFFSET:%.*]], i32 8, i32 0, i32 0)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vldrbq_gather_offset_s16(const int8_t *base, uint16x8_t offset)
+{
+#ifdef POLYMORPHIC
+ return vldrbq_gather_offset(base, offset);
+#else /* POLYMORPHIC */
+ return vldrbq_gather_offset_s16(base, offset);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrbq_gather_offset_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vldr.gather.offset.v4i32.p0i8.v4i32(i8* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], i32 8, i32 0, i32 0)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+int32x4_t test_vldrbq_gather_offset_s32(const int8_t *base, uint32x4_t offset)
+{
+#ifdef POLYMORPHIC
+ return vldrbq_gather_offset(base, offset);
+#else /* POLYMORPHIC */
+ return vldrbq_gather_offset_s32(base, offset);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrbq_gather_offset_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vldr.gather.offset.v16i8.p0i8.v16i8(i8* [[BASE:%.*]], <16 x i8> [[OFFSET:%.*]], i32 8, i32 0, i32 0)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+int8x16_t test_vldrbq_gather_offset_s8(const int8_t *base, uint8x16_t offset)
+{
+#ifdef POLYMORPHIC
+ return vldrbq_gather_offset(base, offset);
+#else /* POLYMORPHIC */
+ return vldrbq_gather_offset_s8(base, offset);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrbq_gather_offset_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vldr.gather.offset.v8i16.p0i8.v8i16(i8* [[BASE:%.*]], <8 x i16> [[OFFSET:%.*]], i32 8, i32 0, i32 1)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vldrbq_gather_offset_u16(const uint8_t *base, uint16x8_t offset)
+{
+#ifdef POLYMORPHIC
+ return vldrbq_gather_offset(base, offset);
+#else /* POLYMORPHIC */
+ return vldrbq_gather_offset_u16(base, offset);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrbq_gather_offset_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vldr.gather.offset.v4i32.p0i8.v4i32(i8* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], i32 8, i32 0, i32 1)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vldrbq_gather_offset_u32(const uint8_t *base, uint32x4_t offset)
+{
+#ifdef POLYMORPHIC
+ return vldrbq_gather_offset(base, offset);
+#else /* POLYMORPHIC */
+ return vldrbq_gather_offset_u32(base, offset);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrbq_gather_offset_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vldr.gather.offset.v16i8.p0i8.v16i8(i8* [[BASE:%.*]], <16 x i8> [[OFFSET:%.*]], i32 8, i32 0, i32 1)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vldrbq_gather_offset_u8(const uint8_t *base, uint8x16_t offset)
+{
+#ifdef POLYMORPHIC
+ return vldrbq_gather_offset(base, offset);
+#else /* POLYMORPHIC */
+ return vldrbq_gather_offset_u8(base, offset);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrbq_gather_offset_z_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vldr.gather.offset.predicated.v8i16.p0i8.v8i16.v8i1(i8* [[BASE:%.*]], <8 x i16> [[OFFSET:%.*]], i32 8, i32 0, i32 0, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vldrbq_gather_offset_z_s16(const int8_t *base, uint16x8_t offset, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vldrbq_gather_offset_z(base, offset, p);
+#else /* POLYMORPHIC */
+ return vldrbq_gather_offset_z_s16(base, offset, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrbq_gather_offset_z_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vldr.gather.offset.predicated.v4i32.p0i8.v4i32.v4i1(i8* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], i32 8, i32 0, i32 0, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vldrbq_gather_offset_z_s32(const int8_t *base, uint32x4_t offset, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vldrbq_gather_offset_z(base, offset, p);
+#else /* POLYMORPHIC */
+ return vldrbq_gather_offset_z_s32(base, offset, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrbq_gather_offset_z_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vldr.gather.offset.predicated.v16i8.p0i8.v16i8.v16i1(i8* [[BASE:%.*]], <16 x i8> [[OFFSET:%.*]], i32 8, i32 0, i32 0, <16 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vldrbq_gather_offset_z_s8(const int8_t *base, uint8x16_t offset, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vldrbq_gather_offset_z(base, offset, p);
+#else /* POLYMORPHIC */
+ return vldrbq_gather_offset_z_s8(base, offset, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrbq_gather_offset_z_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vldr.gather.offset.predicated.v8i16.p0i8.v8i16.v8i1(i8* [[BASE:%.*]], <8 x i16> [[OFFSET:%.*]], i32 8, i32 0, i32 1, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vldrbq_gather_offset_z_u16(const uint8_t *base, uint16x8_t offset, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vldrbq_gather_offset_z(base, offset, p);
+#else /* POLYMORPHIC */
+ return vldrbq_gather_offset_z_u16(base, offset, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrbq_gather_offset_z_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vldr.gather.offset.predicated.v4i32.p0i8.v4i32.v4i1(i8* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], i32 8, i32 0, i32 1, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vldrbq_gather_offset_z_u32(const uint8_t *base, uint32x4_t offset, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vldrbq_gather_offset_z(base, offset, p);
+#else /* POLYMORPHIC */
+ return vldrbq_gather_offset_z_u32(base, offset, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrbq_gather_offset_z_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vldr.gather.offset.predicated.v16i8.p0i8.v16i8.v16i1(i8* [[BASE:%.*]], <16 x i8> [[OFFSET:%.*]], i32 8, i32 0, i32 1, <16 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vldrbq_gather_offset_z_u8(const uint8_t *base, uint8x16_t offset, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vldrbq_gather_offset_z(base, offset, p);
+#else /* POLYMORPHIC */
+ return vldrbq_gather_offset_z_u8(base, offset, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrdq_gather_base_s64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <2 x i64> @llvm.arm.mve.vldr.gather.base.v2i64.v2i64(<2 x i64> [[ADDR:%.*]], i32 616)
+// CHECK-NEXT: ret <2 x i64> [[TMP0]]
+//
+int64x2_t test_vldrdq_gather_base_s64(uint64x2_t addr)
+{
+ return vldrdq_gather_base_s64(addr, 0x268);
+}
+
+// CHECK-LABEL: @test_vldrdq_gather_base_u64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <2 x i64> @llvm.arm.mve.vldr.gather.base.v2i64.v2i64(<2 x i64> [[ADDR:%.*]], i32 -336)
+// CHECK-NEXT: ret <2 x i64> [[TMP0]]
+//
+uint64x2_t test_vldrdq_gather_base_u64(uint64x2_t addr)
+{
+ return vldrdq_gather_base_u64(addr, -0x150);
+}
+
+// CHECK-LABEL: @test_vldrdq_gather_base_wb_s64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = load <2 x i64>, <2 x i64>* [[ADDR:%.*]], align 8
+// CHECK-NEXT: [[TMP1:%.*]] = call { <2 x i64>, <2 x i64> } @llvm.arm.mve.vldr.gather.base.wb.v2i64.v2i64(<2 x i64> [[TMP0]], i32 576)
+// CHECK-NEXT: [[TMP2:%.*]] = extractvalue { <2 x i64>, <2 x i64> } [[TMP1]], 1
+// CHECK-NEXT: store <2 x i64> [[TMP2]], <2 x i64>* [[ADDR]], align 8
+// CHECK-NEXT: [[TMP3:%.*]] = extractvalue { <2 x i64>, <2 x i64> } [[TMP1]], 0
+// CHECK-NEXT: ret <2 x i64> [[TMP3]]
+//
+int64x2_t test_vldrdq_gather_base_wb_s64(uint64x2_t *addr)
+{
+ return vldrdq_gather_base_wb_s64(addr, 0x240);
+}
+
+// CHECK-LABEL: @test_vldrdq_gather_base_wb_u64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = load <2 x i64>, <2 x i64>* [[ADDR:%.*]], align 8
+// CHECK-NEXT: [[TMP1:%.*]] = call { <2 x i64>, <2 x i64> } @llvm.arm.mve.vldr.gather.base.wb.v2i64.v2i64(<2 x i64> [[TMP0]], i32 -328)
+// CHECK-NEXT: [[TMP2:%.*]] = extractvalue { <2 x i64>, <2 x i64> } [[TMP1]], 1
+// CHECK-NEXT: store <2 x i64> [[TMP2]], <2 x i64>* [[ADDR]], align 8
+// CHECK-NEXT: [[TMP3:%.*]] = extractvalue { <2 x i64>, <2 x i64> } [[TMP1]], 0
+// CHECK-NEXT: ret <2 x i64> [[TMP3]]
+//
+uint64x2_t test_vldrdq_gather_base_wb_u64(uint64x2_t *addr)
+{
+ return vldrdq_gather_base_wb_u64(addr, -0x148);
+}
+
+// CHECK-LABEL: @test_vldrdq_gather_base_wb_z_s64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = load <2 x i64>, <2 x i64>* [[ADDR:%.*]], align 8
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = call { <2 x i64>, <2 x i64> } @llvm.arm.mve.vldr.gather.base.wb.predicated.v2i64.v2i64.v4i1(<2 x i64> [[TMP0]], i32 664, <4 x i1> [[TMP2]])
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { <2 x i64>, <2 x i64> } [[TMP3]], 1
+// CHECK-NEXT: store <2 x i64> [[TMP4]], <2 x i64>* [[ADDR]], align 8
+// CHECK-NEXT: [[TMP5:%.*]] = extractvalue { <2 x i64>, <2 x i64> } [[TMP3]], 0
+// CHECK-NEXT: ret <2 x i64> [[TMP5]]
+//
+int64x2_t test_vldrdq_gather_base_wb_z_s64(uint64x2_t *addr, mve_pred16_t p)
+{
+ return vldrdq_gather_base_wb_z_s64(addr, 0x298, p);
+}
+
+// CHECK-LABEL: @test_vldrdq_gather_base_wb_z_u64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = load <2 x i64>, <2 x i64>* [[ADDR:%.*]], align 8
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = call { <2 x i64>, <2 x i64> } @llvm.arm.mve.vldr.gather.base.wb.predicated.v2i64.v2i64.v4i1(<2 x i64> [[TMP0]], i32 656, <4 x i1> [[TMP2]])
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { <2 x i64>, <2 x i64> } [[TMP3]], 1
+// CHECK-NEXT: store <2 x i64> [[TMP4]], <2 x i64>* [[ADDR]], align 8
+// CHECK-NEXT: [[TMP5:%.*]] = extractvalue { <2 x i64>, <2 x i64> } [[TMP3]], 0
+// CHECK-NEXT: ret <2 x i64> [[TMP5]]
+//
+uint64x2_t test_vldrdq_gather_base_wb_z_u64(uint64x2_t *addr, mve_pred16_t p)
+{
+ return vldrdq_gather_base_wb_z_u64(addr, 0x290, p);
+}
+
+// CHECK-LABEL: @test_vldrdq_gather_base_z_s64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <2 x i64> @llvm.arm.mve.vldr.gather.base.predicated.v2i64.v2i64.v4i1(<2 x i64> [[ADDR:%.*]], i32 888, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <2 x i64> [[TMP2]]
+//
+int64x2_t test_vldrdq_gather_base_z_s64(uint64x2_t addr, mve_pred16_t p)
+{
+ return vldrdq_gather_base_z_s64(addr, 0x378, p);
+}
+
+// CHECK-LABEL: @test_vldrdq_gather_base_z_u64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <2 x i64> @llvm.arm.mve.vldr.gather.base.predicated.v2i64.v2i64.v4i1(<2 x i64> [[ADDR:%.*]], i32 -1000, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <2 x i64> [[TMP2]]
+//
+uint64x2_t test_vldrdq_gather_base_z_u64(uint64x2_t addr, mve_pred16_t p)
+{
+ return vldrdq_gather_base_z_u64(addr, -0x3e8, p);
+}
+
+// CHECK-LABEL: @test_vldrdq_gather_offset_s64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <2 x i64> @llvm.arm.mve.vldr.gather.offset.v2i64.p0i64.v2i64(i64* [[BASE:%.*]], <2 x i64> [[OFFSET:%.*]], i32 64, i32 0, i32 0)
+// CHECK-NEXT: ret <2 x i64> [[TMP0]]
+//
+int64x2_t test_vldrdq_gather_offset_s64(const int64_t *base, uint64x2_t offset)
+{
+#ifdef POLYMORPHIC
+ return vldrdq_gather_offset(base, offset);
+#else /* POLYMORPHIC */
+ return vldrdq_gather_offset_s64(base, offset);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrdq_gather_offset_u64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <2 x i64> @llvm.arm.mve.vldr.gather.offset.v2i64.p0i64.v2i64(i64* [[BASE:%.*]], <2 x i64> [[OFFSET:%.*]], i32 64, i32 0, i32 1)
+// CHECK-NEXT: ret <2 x i64> [[TMP0]]
+//
+uint64x2_t test_vldrdq_gather_offset_u64(const uint64_t *base, uint64x2_t offset)
+{
+#ifdef POLYMORPHIC
+ return vldrdq_gather_offset(base, offset);
+#else /* POLYMORPHIC */
+ return vldrdq_gather_offset_u64(base, offset);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrdq_gather_offset_z_s64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <2 x i64> @llvm.arm.mve.vldr.gather.offset.predicated.v2i64.p0i64.v2i64.v4i1(i64* [[BASE:%.*]], <2 x i64> [[OFFSET:%.*]], i32 64, i32 0, i32 0, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <2 x i64> [[TMP2]]
+//
+int64x2_t test_vldrdq_gather_offset_z_s64(const int64_t *base, uint64x2_t offset, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vldrdq_gather_offset_z(base, offset, p);
+#else /* POLYMORPHIC */
+ return vldrdq_gather_offset_z_s64(base, offset, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrdq_gather_offset_z_u64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <2 x i64> @llvm.arm.mve.vldr.gather.offset.predicated.v2i64.p0i64.v2i64.v4i1(i64* [[BASE:%.*]], <2 x i64> [[OFFSET:%.*]], i32 64, i32 0, i32 1, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <2 x i64> [[TMP2]]
+//
+uint64x2_t test_vldrdq_gather_offset_z_u64(const uint64_t *base, uint64x2_t offset, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vldrdq_gather_offset_z(base, offset, p);
+#else /* POLYMORPHIC */
+ return vldrdq_gather_offset_z_u64(base, offset, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrdq_gather_shifted_offset_s64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <2 x i64> @llvm.arm.mve.vldr.gather.offset.v2i64.p0i64.v2i64(i64* [[BASE:%.*]], <2 x i64> [[OFFSET:%.*]], i32 64, i32 3, i32 0)
+// CHECK-NEXT: ret <2 x i64> [[TMP0]]
+//
+int64x2_t test_vldrdq_gather_shifted_offset_s64(const int64_t *base, uint64x2_t offset)
+{
+#ifdef POLYMORPHIC
+ return vldrdq_gather_shifted_offset(base, offset);
+#else /* POLYMORPHIC */
+ return vldrdq_gather_shifted_offset_s64(base, offset);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrdq_gather_shifted_offset_u64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <2 x i64> @llvm.arm.mve.vldr.gather.offset.v2i64.p0i64.v2i64(i64* [[BASE:%.*]], <2 x i64> [[OFFSET:%.*]], i32 64, i32 3, i32 1)
+// CHECK-NEXT: ret <2 x i64> [[TMP0]]
+//
+uint64x2_t test_vldrdq_gather_shifted_offset_u64(const uint64_t *base, uint64x2_t offset)
+{
+#ifdef POLYMORPHIC
+ return vldrdq_gather_shifted_offset(base, offset);
+#else /* POLYMORPHIC */
+ return vldrdq_gather_shifted_offset_u64(base, offset);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrdq_gather_shifted_offset_z_s64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <2 x i64> @llvm.arm.mve.vldr.gather.offset.predicated.v2i64.p0i64.v2i64.v4i1(i64* [[BASE:%.*]], <2 x i64> [[OFFSET:%.*]], i32 64, i32 3, i32 0, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <2 x i64> [[TMP2]]
+//
+int64x2_t test_vldrdq_gather_shifted_offset_z_s64(const int64_t *base, uint64x2_t offset, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vldrdq_gather_shifted_offset_z(base, offset, p);
+#else /* POLYMORPHIC */
+ return vldrdq_gather_shifted_offset_z_s64(base, offset, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrdq_gather_shifted_offset_z_u64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <2 x i64> @llvm.arm.mve.vldr.gather.offset.predicated.v2i64.p0i64.v2i64.v4i1(i64* [[BASE:%.*]], <2 x i64> [[OFFSET:%.*]], i32 64, i32 3, i32 1, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <2 x i64> [[TMP2]]
+//
+uint64x2_t test_vldrdq_gather_shifted_offset_z_u64(const uint64_t *base, uint64x2_t offset, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vldrdq_gather_shifted_offset_z(base, offset, p);
+#else /* POLYMORPHIC */
+ return vldrdq_gather_shifted_offset_z_u64(base, offset, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrhq_gather_offset_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x half> @llvm.arm.mve.vldr.gather.offset.v8f16.p0f16.v8i16(half* [[BASE:%.*]], <8 x i16> [[OFFSET:%.*]], i32 16, i32 0, i32 0)
+// CHECK-NEXT: ret <8 x half> [[TMP0]]
+//
+float16x8_t test_vldrhq_gather_offset_f16(const float16_t *base, uint16x8_t offset)
+{
+#ifdef POLYMORPHIC
+ return vldrhq_gather_offset(base, offset);
+#else /* POLYMORPHIC */
+ return vldrhq_gather_offset_f16(base, offset);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrhq_gather_offset_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vldr.gather.offset.v8i16.p0i16.v8i16(i16* [[BASE:%.*]], <8 x i16> [[OFFSET:%.*]], i32 16, i32 0, i32 0)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vldrhq_gather_offset_s16(const int16_t *base, uint16x8_t offset)
+{
+#ifdef POLYMORPHIC
+ return vldrhq_gather_offset(base, offset);
+#else /* POLYMORPHIC */
+ return vldrhq_gather_offset_s16(base, offset);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrhq_gather_offset_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vldr.gather.offset.v4i32.p0i16.v4i32(i16* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], i32 16, i32 0, i32 0)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+int32x4_t test_vldrhq_gather_offset_s32(const int16_t *base, uint32x4_t offset)
+{
+#ifdef POLYMORPHIC
+ return vldrhq_gather_offset(base, offset);
+#else /* POLYMORPHIC */
+ return vldrhq_gather_offset_s32(base, offset);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrhq_gather_offset_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vldr.gather.offset.v8i16.p0i16.v8i16(i16* [[BASE:%.*]], <8 x i16> [[OFFSET:%.*]], i32 16, i32 0, i32 1)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vldrhq_gather_offset_u16(const uint16_t *base, uint16x8_t offset)
+{
+#ifdef POLYMORPHIC
+ return vldrhq_gather_offset(base, offset);
+#else /* POLYMORPHIC */
+ return vldrhq_gather_offset_u16(base, offset);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrhq_gather_offset_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vldr.gather.offset.v4i32.p0i16.v4i32(i16* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], i32 16, i32 0, i32 1)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vldrhq_gather_offset_u32(const uint16_t *base, uint32x4_t offset)
+{
+#ifdef POLYMORPHIC
+ return vldrhq_gather_offset(base, offset);
+#else /* POLYMORPHIC */
+ return vldrhq_gather_offset_u32(base, offset);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrhq_gather_offset_z_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vldr.gather.offset.predicated.v8f16.p0f16.v8i16.v8i1(half* [[BASE:%.*]], <8 x i16> [[OFFSET:%.*]], i32 16, i32 0, i32 0, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x half> [[TMP2]]
+//
+float16x8_t test_vldrhq_gather_offset_z_f16(const float16_t *base, uint16x8_t offset, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vldrhq_gather_offset_z(base, offset, p);
+#else /* POLYMORPHIC */
+ return vldrhq_gather_offset_z_f16(base, offset, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrhq_gather_offset_z_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vldr.gather.offset.predicated.v8i16.p0i16.v8i16.v8i1(i16* [[BASE:%.*]], <8 x i16> [[OFFSET:%.*]], i32 16, i32 0, i32 0, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vldrhq_gather_offset_z_s16(const int16_t *base, uint16x8_t offset, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vldrhq_gather_offset_z(base, offset, p);
+#else /* POLYMORPHIC */
+ return vldrhq_gather_offset_z_s16(base, offset, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrhq_gather_offset_z_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vldr.gather.offset.predicated.v4i32.p0i16.v4i32.v4i1(i16* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], i32 16, i32 0, i32 0, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vldrhq_gather_offset_z_s32(const int16_t *base, uint32x4_t offset, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vldrhq_gather_offset_z(base, offset, p);
+#else /* POLYMORPHIC */
+ return vldrhq_gather_offset_z_s32(base, offset, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrhq_gather_offset_z_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vldr.gather.offset.predicated.v8i16.p0i16.v8i16.v8i1(i16* [[BASE:%.*]], <8 x i16> [[OFFSET:%.*]], i32 16, i32 0, i32 1, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vldrhq_gather_offset_z_u16(const uint16_t *base, uint16x8_t offset, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vldrhq_gather_offset_z(base, offset, p);
+#else /* POLYMORPHIC */
+ return vldrhq_gather_offset_z_u16(base, offset, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrhq_gather_offset_z_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vldr.gather.offset.predicated.v4i32.p0i16.v4i32.v4i1(i16* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], i32 16, i32 0, i32 1, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vldrhq_gather_offset_z_u32(const uint16_t *base, uint32x4_t offset, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vldrhq_gather_offset_z(base, offset, p);
+#else /* POLYMORPHIC */
+ return vldrhq_gather_offset_z_u32(base, offset, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrhq_gather_shifted_offset_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x half> @llvm.arm.mve.vldr.gather.offset.v8f16.p0f16.v8i16(half* [[BASE:%.*]], <8 x i16> [[OFFSET:%.*]], i32 16, i32 1, i32 0)
+// CHECK-NEXT: ret <8 x half> [[TMP0]]
+//
+float16x8_t test_vldrhq_gather_shifted_offset_f16(const float16_t *base, uint16x8_t offset)
+{
+#ifdef POLYMORPHIC
+ return vldrhq_gather_shifted_offset(base, offset);
+#else /* POLYMORPHIC */
+ return vldrhq_gather_shifted_offset_f16(base, offset);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrhq_gather_shifted_offset_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vldr.gather.offset.v8i16.p0i16.v8i16(i16* [[BASE:%.*]], <8 x i16> [[OFFSET:%.*]], i32 16, i32 1, i32 0)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vldrhq_gather_shifted_offset_s16(const int16_t *base, uint16x8_t offset)
+{
+#ifdef POLYMORPHIC
+ return vldrhq_gather_shifted_offset(base, offset);
+#else /* POLYMORPHIC */
+ return vldrhq_gather_shifted_offset_s16(base, offset);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrhq_gather_shifted_offset_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vldr.gather.offset.v4i32.p0i16.v4i32(i16* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], i32 16, i32 1, i32 0)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+int32x4_t test_vldrhq_gather_shifted_offset_s32(const int16_t *base, uint32x4_t offset)
+{
+#ifdef POLYMORPHIC
+ return vldrhq_gather_shifted_offset(base, offset);
+#else /* POLYMORPHIC */
+ return vldrhq_gather_shifted_offset_s32(base, offset);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrhq_gather_shifted_offset_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vldr.gather.offset.v8i16.p0i16.v8i16(i16* [[BASE:%.*]], <8 x i16> [[OFFSET:%.*]], i32 16, i32 1, i32 1)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vldrhq_gather_shifted_offset_u16(const uint16_t *base, uint16x8_t offset)
+{
+#ifdef POLYMORPHIC
+ return vldrhq_gather_shifted_offset(base, offset);
+#else /* POLYMORPHIC */
+ return vldrhq_gather_shifted_offset_u16(base, offset);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrhq_gather_shifted_offset_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vldr.gather.offset.v4i32.p0i16.v4i32(i16* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], i32 16, i32 1, i32 1)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vldrhq_gather_shifted_offset_u32(const uint16_t *base, uint32x4_t offset)
+{
+#ifdef POLYMORPHIC
+ return vldrhq_gather_shifted_offset(base, offset);
+#else /* POLYMORPHIC */
+ return vldrhq_gather_shifted_offset_u32(base, offset);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrhq_gather_shifted_offset_z_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vldr.gather.offset.predicated.v8f16.p0f16.v8i16.v8i1(half* [[BASE:%.*]], <8 x i16> [[OFFSET:%.*]], i32 16, i32 1, i32 0, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x half> [[TMP2]]
+//
+float16x8_t test_vldrhq_gather_shifted_offset_z_f16(const float16_t *base, uint16x8_t offset, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vldrhq_gather_shifted_offset_z(base, offset, p);
+#else /* POLYMORPHIC */
+ return vldrhq_gather_shifted_offset_z_f16(base, offset, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrhq_gather_shifted_offset_z_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vldr.gather.offset.predicated.v8i16.p0i16.v8i16.v8i1(i16* [[BASE:%.*]], <8 x i16> [[OFFSET:%.*]], i32 16, i32 1, i32 0, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vldrhq_gather_shifted_offset_z_s16(const int16_t *base, uint16x8_t offset, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vldrhq_gather_shifted_offset_z(base, offset, p);
+#else /* POLYMORPHIC */
+ return vldrhq_gather_shifted_offset_z_s16(base, offset, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrhq_gather_shifted_offset_z_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vldr.gather.offset.predicated.v4i32.p0i16.v4i32.v4i1(i16* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], i32 16, i32 1, i32 0, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vldrhq_gather_shifted_offset_z_s32(const int16_t *base, uint32x4_t offset, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vldrhq_gather_shifted_offset_z(base, offset, p);
+#else /* POLYMORPHIC */
+ return vldrhq_gather_shifted_offset_z_s32(base, offset, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrhq_gather_shifted_offset_z_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vldr.gather.offset.predicated.v8i16.p0i16.v8i16.v8i1(i16* [[BASE:%.*]], <8 x i16> [[OFFSET:%.*]], i32 16, i32 1, i32 1, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vldrhq_gather_shifted_offset_z_u16(const uint16_t *base, uint16x8_t offset, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vldrhq_gather_shifted_offset_z(base, offset, p);
+#else /* POLYMORPHIC */
+ return vldrhq_gather_shifted_offset_z_u16(base, offset, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrhq_gather_shifted_offset_z_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vldr.gather.offset.predicated.v4i32.p0i16.v4i32.v4i1(i16* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], i32 16, i32 1, i32 1, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vldrhq_gather_shifted_offset_z_u32(const uint16_t *base, uint32x4_t offset, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vldrhq_gather_shifted_offset_z(base, offset, p);
+#else /* POLYMORPHIC */
+ return vldrhq_gather_shifted_offset_z_u32(base, offset, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrwq_gather_base_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x float> @llvm.arm.mve.vldr.gather.base.v4f32.v4i32(<4 x i32> [[ADDR:%.*]], i32 12)
+// CHECK-NEXT: ret <4 x float> [[TMP0]]
+//
+float32x4_t test_vldrwq_gather_base_f32(uint32x4_t addr)
+{
+ return vldrwq_gather_base_f32(addr, 0xc);
+}
+
+// CHECK-LABEL: @test_vldrwq_gather_base_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vldr.gather.base.v4i32.v4i32(<4 x i32> [[ADDR:%.*]], i32 400)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+int32x4_t test_vldrwq_gather_base_s32(uint32x4_t addr)
+{
+ return vldrwq_gather_base_s32(addr, 0x190);
+}
+
+// CHECK-LABEL: @test_vldrwq_gather_base_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vldr.gather.base.v4i32.v4i32(<4 x i32> [[ADDR:%.*]], i32 284)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vldrwq_gather_base_u32(uint32x4_t addr)
+{
+ return vldrwq_gather_base_u32(addr, 0x11c);
+}
+
+// CHECK-LABEL: @test_vldrwq_gather_base_wb_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = load <4 x i32>, <4 x i32>* [[ADDR:%.*]], align 8
+// CHECK-NEXT: [[TMP1:%.*]] = call { <4 x float>, <4 x i32> } @llvm.arm.mve.vldr.gather.base.wb.v4f32.v4i32(<4 x i32> [[TMP0]], i32 -64)
+// CHECK-NEXT: [[TMP2:%.*]] = extractvalue { <4 x float>, <4 x i32> } [[TMP1]], 1
+// CHECK-NEXT: store <4 x i32> [[TMP2]], <4 x i32>* [[ADDR]], align 8
+// CHECK-NEXT: [[TMP3:%.*]] = extractvalue { <4 x float>, <4 x i32> } [[TMP1]], 0
+// CHECK-NEXT: ret <4 x float> [[TMP3]]
+//
+float32x4_t test_vldrwq_gather_base_wb_f32(uint32x4_t *addr)
+{
+ return vldrwq_gather_base_wb_f32(addr, -0x40);
+}
+
+// CHECK-LABEL: @test_vldrwq_gather_base_wb_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = load <4 x i32>, <4 x i32>* [[ADDR:%.*]], align 8
+// CHECK-NEXT: [[TMP1:%.*]] = call { <4 x i32>, <4 x i32> } @llvm.arm.mve.vldr.gather.base.wb.v4i32.v4i32(<4 x i32> [[TMP0]], i32 80)
+// CHECK-NEXT: [[TMP2:%.*]] = extractvalue { <4 x i32>, <4 x i32> } [[TMP1]], 1
+// CHECK-NEXT: store <4 x i32> [[TMP2]], <4 x i32>* [[ADDR]], align 8
+// CHECK-NEXT: [[TMP3:%.*]] = extractvalue { <4 x i32>, <4 x i32> } [[TMP1]], 0
+// CHECK-NEXT: ret <4 x i32> [[TMP3]]
+//
+int32x4_t test_vldrwq_gather_base_wb_s32(uint32x4_t *addr)
+{
+ return vldrwq_gather_base_wb_s32(addr, 0x50);
+}
+
+// CHECK-LABEL: @test_vldrwq_gather_base_wb_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = load <4 x i32>, <4 x i32>* [[ADDR:%.*]], align 8
+// CHECK-NEXT: [[TMP1:%.*]] = call { <4 x i32>, <4 x i32> } @llvm.arm.mve.vldr.gather.base.wb.v4i32.v4i32(<4 x i32> [[TMP0]], i32 480)
+// CHECK-NEXT: [[TMP2:%.*]] = extractvalue { <4 x i32>, <4 x i32> } [[TMP1]], 1
+// CHECK-NEXT: store <4 x i32> [[TMP2]], <4 x i32>* [[ADDR]], align 8
+// CHECK-NEXT: [[TMP3:%.*]] = extractvalue { <4 x i32>, <4 x i32> } [[TMP1]], 0
+// CHECK-NEXT: ret <4 x i32> [[TMP3]]
+//
+uint32x4_t test_vldrwq_gather_base_wb_u32(uint32x4_t *addr)
+{
+ return vldrwq_gather_base_wb_u32(addr, 0x1e0);
+}
+
+// CHECK-LABEL: @test_vldrwq_gather_base_wb_z_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = load <4 x i32>, <4 x i32>* [[ADDR:%.*]], align 8
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = call { <4 x float>, <4 x i32> } @llvm.arm.mve.vldr.gather.base.wb.predicated.v4f32.v4i32.v4i1(<4 x i32> [[TMP0]], i32 -352, <4 x i1> [[TMP2]])
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { <4 x float>, <4 x i32> } [[TMP3]], 1
+// CHECK-NEXT: store <4 x i32> [[TMP4]], <4 x i32>* [[ADDR]], align 8
+// CHECK-NEXT: [[TMP5:%.*]] = extractvalue { <4 x float>, <4 x i32> } [[TMP3]], 0
+// CHECK-NEXT: ret <4 x float> [[TMP5]]
+//
+float32x4_t test_vldrwq_gather_base_wb_z_f32(uint32x4_t *addr, mve_pred16_t p)
+{
+ return vldrwq_gather_base_wb_z_f32(addr, -0x160, p);
+}
+
+// CHECK-LABEL: @test_vldrwq_gather_base_wb_z_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = load <4 x i32>, <4 x i32>* [[ADDR:%.*]], align 8
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = call { <4 x i32>, <4 x i32> } @llvm.arm.mve.vldr.gather.base.wb.predicated.v4i32.v4i32.v4i1(<4 x i32> [[TMP0]], i32 276, <4 x i1> [[TMP2]])
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { <4 x i32>, <4 x i32> } [[TMP3]], 1
+// CHECK-NEXT: store <4 x i32> [[TMP4]], <4 x i32>* [[ADDR]], align 8
+// CHECK-NEXT: [[TMP5:%.*]] = extractvalue { <4 x i32>, <4 x i32> } [[TMP3]], 0
+// CHECK-NEXT: ret <4 x i32> [[TMP5]]
+//
+int32x4_t test_vldrwq_gather_base_wb_z_s32(uint32x4_t *addr, mve_pred16_t p)
+{
+ return vldrwq_gather_base_wb_z_s32(addr, 0x114, p);
+}
+
+// CHECK-LABEL: @test_vldrwq_gather_base_wb_z_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = load <4 x i32>, <4 x i32>* [[ADDR:%.*]], align 8
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = call { <4 x i32>, <4 x i32> } @llvm.arm.mve.vldr.gather.base.wb.predicated.v4i32.v4i32.v4i1(<4 x i32> [[TMP0]], i32 88, <4 x i1> [[TMP2]])
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { <4 x i32>, <4 x i32> } [[TMP3]], 1
+// CHECK-NEXT: store <4 x i32> [[TMP4]], <4 x i32>* [[ADDR]], align 8
+// CHECK-NEXT: [[TMP5:%.*]] = extractvalue { <4 x i32>, <4 x i32> } [[TMP3]], 0
+// CHECK-NEXT: ret <4 x i32> [[TMP5]]
+//
+uint32x4_t test_vldrwq_gather_base_wb_z_u32(uint32x4_t *addr, mve_pred16_t p)
+{
+ return vldrwq_gather_base_wb_z_u32(addr, 0x58, p);
+}
+
+// CHECK-LABEL: @test_vldrwq_gather_base_z_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vldr.gather.base.predicated.v4f32.v4i32.v4i1(<4 x i32> [[ADDR:%.*]], i32 300, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x float> [[TMP2]]
+//
+float32x4_t test_vldrwq_gather_base_z_f32(uint32x4_t addr, mve_pred16_t p)
+{
+ return vldrwq_gather_base_z_f32(addr, 0x12c, p);
+}
+
+// CHECK-LABEL: @test_vldrwq_gather_base_z_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vldr.gather.base.predicated.v4i32.v4i32.v4i1(<4 x i32> [[ADDR:%.*]], i32 440, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vldrwq_gather_base_z_s32(uint32x4_t addr, mve_pred16_t p)
+{
+ return vldrwq_gather_base_z_s32(addr, 0x1b8, p);
+}
+
+// CHECK-LABEL: @test_vldrwq_gather_base_z_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vldr.gather.base.predicated.v4i32.v4i32.v4i1(<4 x i32> [[ADDR:%.*]], i32 -300, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vldrwq_gather_base_z_u32(uint32x4_t addr, mve_pred16_t p)
+{
+ return vldrwq_gather_base_z_u32(addr, -0x12c, p);
+}
+
+// CHECK-LABEL: @test_vldrwq_gather_offset_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x float> @llvm.arm.mve.vldr.gather.offset.v4f32.p0f32.v4i32(float* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], i32 32, i32 0, i32 0)
+// CHECK-NEXT: ret <4 x float> [[TMP0]]
+//
+float32x4_t test_vldrwq_gather_offset_f32(const float32_t *base, uint32x4_t offset)
+{
+#ifdef POLYMORPHIC
+ return vldrwq_gather_offset(base, offset);
+#else /* POLYMORPHIC */
+ return vldrwq_gather_offset_f32(base, offset);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrwq_gather_offset_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vldr.gather.offset.v4i32.p0i32.v4i32(i32* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], i32 32, i32 0, i32 0)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+int32x4_t test_vldrwq_gather_offset_s32(const int32_t *base, uint32x4_t offset)
+{
+#ifdef POLYMORPHIC
+ return vldrwq_gather_offset(base, offset);
+#else /* POLYMORPHIC */
+ return vldrwq_gather_offset_s32(base, offset);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrwq_gather_offset_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vldr.gather.offset.v4i32.p0i32.v4i32(i32* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], i32 32, i32 0, i32 1)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vldrwq_gather_offset_u32(const uint32_t *base, uint32x4_t offset)
+{
+#ifdef POLYMORPHIC
+ return vldrwq_gather_offset(base, offset);
+#else /* POLYMORPHIC */
+ return vldrwq_gather_offset_u32(base, offset);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrwq_gather_offset_z_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vldr.gather.offset.predicated.v4f32.p0f32.v4i32.v4i1(float* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], i32 32, i32 0, i32 0, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x float> [[TMP2]]
+//
+float32x4_t test_vldrwq_gather_offset_z_f32(const float32_t *base, uint32x4_t offset, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vldrwq_gather_offset_z(base, offset, p);
+#else /* POLYMORPHIC */
+ return vldrwq_gather_offset_z_f32(base, offset, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrwq_gather_offset_z_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vldr.gather.offset.predicated.v4i32.p0i32.v4i32.v4i1(i32* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], i32 32, i32 0, i32 0, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vldrwq_gather_offset_z_s32(const int32_t *base, uint32x4_t offset, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vldrwq_gather_offset_z(base, offset, p);
+#else /* POLYMORPHIC */
+ return vldrwq_gather_offset_z_s32(base, offset, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrwq_gather_offset_z_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vldr.gather.offset.predicated.v4i32.p0i32.v4i32.v4i1(i32* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], i32 32, i32 0, i32 1, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vldrwq_gather_offset_z_u32(const uint32_t *base, uint32x4_t offset, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vldrwq_gather_offset_z(base, offset, p);
+#else /* POLYMORPHIC */
+ return vldrwq_gather_offset_z_u32(base, offset, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrwq_gather_shifted_offset_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x float> @llvm.arm.mve.vldr.gather.offset.v4f32.p0f32.v4i32(float* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], i32 32, i32 2, i32 0)
+// CHECK-NEXT: ret <4 x float> [[TMP0]]
+//
+float32x4_t test_vldrwq_gather_shifted_offset_f32(const float32_t *base, uint32x4_t offset)
+{
+#ifdef POLYMORPHIC
+ return vldrwq_gather_shifted_offset(base, offset);
+#else /* POLYMORPHIC */
+ return vldrwq_gather_shifted_offset_f32(base, offset);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrwq_gather_shifted_offset_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vldr.gather.offset.v4i32.p0i32.v4i32(i32* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], i32 32, i32 2, i32 0)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+int32x4_t test_vldrwq_gather_shifted_offset_s32(const int32_t *base, uint32x4_t offset)
+{
+#ifdef POLYMORPHIC
+ return vldrwq_gather_shifted_offset(base, offset);
+#else /* POLYMORPHIC */
+ return vldrwq_gather_shifted_offset_s32(base, offset);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrwq_gather_shifted_offset_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vldr.gather.offset.v4i32.p0i32.v4i32(i32* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], i32 32, i32 2, i32 1)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vldrwq_gather_shifted_offset_u32(const uint32_t *base, uint32x4_t offset)
+{
+#ifdef POLYMORPHIC
+ return vldrwq_gather_shifted_offset(base, offset);
+#else /* POLYMORPHIC */
+ return vldrwq_gather_shifted_offset_u32(base, offset);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrwq_gather_shifted_offset_z_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vldr.gather.offset.predicated.v4f32.p0f32.v4i32.v4i1(float* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], i32 32, i32 2, i32 0, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x float> [[TMP2]]
+//
+float32x4_t test_vldrwq_gather_shifted_offset_z_f32(const float32_t *base, uint32x4_t offset, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vldrwq_gather_shifted_offset_z(base, offset, p);
+#else /* POLYMORPHIC */
+ return vldrwq_gather_shifted_offset_z_f32(base, offset, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrwq_gather_shifted_offset_z_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vldr.gather.offset.predicated.v4i32.p0i32.v4i32.v4i1(i32* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], i32 32, i32 2, i32 0, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vldrwq_gather_shifted_offset_z_s32(const int32_t *base, uint32x4_t offset, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vldrwq_gather_shifted_offset_z(base, offset, p);
+#else /* POLYMORPHIC */
+ return vldrwq_gather_shifted_offset_z_s32(base, offset, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vldrwq_gather_shifted_offset_z_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vldr.gather.offset.predicated.v4i32.p0i32.v4i32.v4i1(i32* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], i32 32, i32 2, i32 1, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vldrwq_gather_shifted_offset_z_u32(const uint32_t *base, uint32x4_t offset, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vldrwq_gather_shifted_offset_z(base, offset, p);
+#else /* POLYMORPHIC */
+ return vldrwq_gather_shifted_offset_z_u32(base, offset, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrbq_scatter_offset_p_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.predicated.p0i8.v8i16.v8i16.v8i1(i8* [[BASE:%.*]], <8 x i16> [[OFFSET:%.*]], <8 x i16> [[VALUE:%.*]], i32 8, i32 0, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret void
+//
+void test_vstrbq_scatter_offset_p_s16(int8_t *base, uint16x8_t offset, int16x8_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrbq_scatter_offset_p(base, offset, value, p);
+#else /* POLYMORPHIC */
+ vstrbq_scatter_offset_p_s16(base, offset, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrbq_scatter_offset_p_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.predicated.p0i8.v4i32.v4i32.v4i1(i8* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], <4 x i32> [[VALUE:%.*]], i32 8, i32 0, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret void
+//
+void test_vstrbq_scatter_offset_p_s32(int8_t *base, uint32x4_t offset, int32x4_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrbq_scatter_offset_p(base, offset, value, p);
+#else /* POLYMORPHIC */
+ vstrbq_scatter_offset_p_s32(base, offset, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrbq_scatter_offset_p_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.predicated.p0i8.v16i8.v16i8.v16i1(i8* [[BASE:%.*]], <16 x i8> [[OFFSET:%.*]], <16 x i8> [[VALUE:%.*]], i32 8, i32 0, <16 x i1> [[TMP1]])
+// CHECK-NEXT: ret void
+//
+void test_vstrbq_scatter_offset_p_s8(int8_t *base, uint8x16_t offset, int8x16_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrbq_scatter_offset_p(base, offset, value, p);
+#else /* POLYMORPHIC */
+ vstrbq_scatter_offset_p_s8(base, offset, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrbq_scatter_offset_p_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.predicated.p0i8.v8i16.v8i16.v8i1(i8* [[BASE:%.*]], <8 x i16> [[OFFSET:%.*]], <8 x i16> [[VALUE:%.*]], i32 8, i32 0, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret void
+//
+void test_vstrbq_scatter_offset_p_u16(uint8_t *base, uint16x8_t offset, uint16x8_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrbq_scatter_offset_p(base, offset, value, p);
+#else /* POLYMORPHIC */
+ vstrbq_scatter_offset_p_u16(base, offset, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrbq_scatter_offset_p_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.predicated.p0i8.v4i32.v4i32.v4i1(i8* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], <4 x i32> [[VALUE:%.*]], i32 8, i32 0, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret void
+//
+void test_vstrbq_scatter_offset_p_u32(uint8_t *base, uint32x4_t offset, uint32x4_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrbq_scatter_offset_p(base, offset, value, p);
+#else /* POLYMORPHIC */
+ vstrbq_scatter_offset_p_u32(base, offset, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrbq_scatter_offset_p_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.predicated.p0i8.v16i8.v16i8.v16i1(i8* [[BASE:%.*]], <16 x i8> [[OFFSET:%.*]], <16 x i8> [[VALUE:%.*]], i32 8, i32 0, <16 x i1> [[TMP1]])
+// CHECK-NEXT: ret void
+//
+void test_vstrbq_scatter_offset_p_u8(uint8_t *base, uint8x16_t offset, uint8x16_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrbq_scatter_offset_p(base, offset, value, p);
+#else /* POLYMORPHIC */
+ vstrbq_scatter_offset_p_u8(base, offset, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrbq_scatter_offset_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.p0i8.v8i16.v8i16(i8* [[BASE:%.*]], <8 x i16> [[OFFSET:%.*]], <8 x i16> [[VALUE:%.*]], i32 8, i32 0)
+// CHECK-NEXT: ret void
+//
+void test_vstrbq_scatter_offset_s16(int8_t *base, uint16x8_t offset, int16x8_t value)
+{
+#ifdef POLYMORPHIC
+ vstrbq_scatter_offset(base, offset, value);
+#else /* POLYMORPHIC */
+ vstrbq_scatter_offset_s16(base, offset, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrbq_scatter_offset_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.p0i8.v4i32.v4i32(i8* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], <4 x i32> [[VALUE:%.*]], i32 8, i32 0)
+// CHECK-NEXT: ret void
+//
+void test_vstrbq_scatter_offset_s32(int8_t *base, uint32x4_t offset, int32x4_t value)
+{
+#ifdef POLYMORPHIC
+ vstrbq_scatter_offset(base, offset, value);
+#else /* POLYMORPHIC */
+ vstrbq_scatter_offset_s32(base, offset, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrbq_scatter_offset_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.p0i8.v16i8.v16i8(i8* [[BASE:%.*]], <16 x i8> [[OFFSET:%.*]], <16 x i8> [[VALUE:%.*]], i32 8, i32 0)
+// CHECK-NEXT: ret void
+//
+void test_vstrbq_scatter_offset_s8(int8_t *base, uint8x16_t offset, int8x16_t value)
+{
+#ifdef POLYMORPHIC
+ vstrbq_scatter_offset(base, offset, value);
+#else /* POLYMORPHIC */
+ vstrbq_scatter_offset_s8(base, offset, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrbq_scatter_offset_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.p0i8.v8i16.v8i16(i8* [[BASE:%.*]], <8 x i16> [[OFFSET:%.*]], <8 x i16> [[VALUE:%.*]], i32 8, i32 0)
+// CHECK-NEXT: ret void
+//
+void test_vstrbq_scatter_offset_u16(uint8_t *base, uint16x8_t offset, uint16x8_t value)
+{
+#ifdef POLYMORPHIC
+ vstrbq_scatter_offset(base, offset, value);
+#else /* POLYMORPHIC */
+ vstrbq_scatter_offset_u16(base, offset, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrbq_scatter_offset_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.p0i8.v4i32.v4i32(i8* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], <4 x i32> [[VALUE:%.*]], i32 8, i32 0)
+// CHECK-NEXT: ret void
+//
+void test_vstrbq_scatter_offset_u32(uint8_t *base, uint32x4_t offset, uint32x4_t value)
+{
+#ifdef POLYMORPHIC
+ vstrbq_scatter_offset(base, offset, value);
+#else /* POLYMORPHIC */
+ vstrbq_scatter_offset_u32(base, offset, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrbq_scatter_offset_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.p0i8.v16i8.v16i8(i8* [[BASE:%.*]], <16 x i8> [[OFFSET:%.*]], <16 x i8> [[VALUE:%.*]], i32 8, i32 0)
+// CHECK-NEXT: ret void
+//
+void test_vstrbq_scatter_offset_u8(uint8_t *base, uint8x16_t offset, uint8x16_t value)
+{
+#ifdef POLYMORPHIC
+ vstrbq_scatter_offset(base, offset, value);
+#else /* POLYMORPHIC */
+ vstrbq_scatter_offset_u8(base, offset, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrdq_scatter_base_p_s64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.base.predicated.v2i64.v2i64.v4i1(<2 x i64> [[ADDR:%.*]], i32 888, <2 x i64> [[VALUE:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret void
+//
+void test_vstrdq_scatter_base_p_s64(uint64x2_t addr, int64x2_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrdq_scatter_base_p(addr, 0x378, value, p);
+#else /* POLYMORPHIC */
+ vstrdq_scatter_base_p_s64(addr, 0x378, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrdq_scatter_base_p_u64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.base.predicated.v2i64.v2i64.v4i1(<2 x i64> [[ADDR:%.*]], i32 264, <2 x i64> [[VALUE:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret void
+//
+void test_vstrdq_scatter_base_p_u64(uint64x2_t addr, uint64x2_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrdq_scatter_base_p(addr, 0x108, value, p);
+#else /* POLYMORPHIC */
+ vstrdq_scatter_base_p_u64(addr, 0x108, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrdq_scatter_base_s64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.base.v2i64.v2i64(<2 x i64> [[ADDR:%.*]], i32 408, <2 x i64> [[VALUE:%.*]])
+// CHECK-NEXT: ret void
+//
+void test_vstrdq_scatter_base_s64(uint64x2_t addr, int64x2_t value)
+{
+#ifdef POLYMORPHIC
+ vstrdq_scatter_base(addr, 0x198, value);
+#else /* POLYMORPHIC */
+ vstrdq_scatter_base_s64(addr, 0x198, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrdq_scatter_base_u64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.base.v2i64.v2i64(<2 x i64> [[ADDR:%.*]], i32 -472, <2 x i64> [[VALUE:%.*]])
+// CHECK-NEXT: ret void
+//
+void test_vstrdq_scatter_base_u64(uint64x2_t addr, uint64x2_t value)
+{
+#ifdef POLYMORPHIC
+ vstrdq_scatter_base(addr, -0x1d8, value);
+#else /* POLYMORPHIC */
+ vstrdq_scatter_base_u64(addr, -0x1d8, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrdq_scatter_base_wb_p_s64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = load <2 x i64>, <2 x i64>* [[ADDR:%.*]], align 8
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = call <2 x i64> @llvm.arm.mve.vstr.scatter.base.wb.predicated.v2i64.v2i64.v4i1(<2 x i64> [[TMP0]], i32 248, <2 x i64> [[VALUE:%.*]], <4 x i1> [[TMP2]])
+// CHECK-NEXT: store <2 x i64> [[TMP3]], <2 x i64>* [[ADDR]], align 8
+// CHECK-NEXT: ret void
+//
+void test_vstrdq_scatter_base_wb_p_s64(uint64x2_t *addr, int64x2_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrdq_scatter_base_wb_p(addr, 0xf8, value, p);
+#else /* POLYMORPHIC */
+ vstrdq_scatter_base_wb_p_s64(addr, 0xf8, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrdq_scatter_base_wb_p_u64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = load <2 x i64>, <2 x i64>* [[ADDR:%.*]], align 8
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = call <2 x i64> @llvm.arm.mve.vstr.scatter.base.wb.predicated.v2i64.v2i64.v4i1(<2 x i64> [[TMP0]], i32 136, <2 x i64> [[VALUE:%.*]], <4 x i1> [[TMP2]])
+// CHECK-NEXT: store <2 x i64> [[TMP3]], <2 x i64>* [[ADDR]], align 8
+// CHECK-NEXT: ret void
+//
+void test_vstrdq_scatter_base_wb_p_u64(uint64x2_t *addr, uint64x2_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrdq_scatter_base_wb_p(addr, 0x88, value, p);
+#else /* POLYMORPHIC */
+ vstrdq_scatter_base_wb_p_u64(addr, 0x88, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrdq_scatter_base_wb_s64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = load <2 x i64>, <2 x i64>* [[ADDR:%.*]], align 8
+// CHECK-NEXT: [[TMP1:%.*]] = call <2 x i64> @llvm.arm.mve.vstr.scatter.base.wb.v2i64.v2i64(<2 x i64> [[TMP0]], i32 208, <2 x i64> [[VALUE:%.*]])
+// CHECK-NEXT: store <2 x i64> [[TMP1]], <2 x i64>* [[ADDR]], align 8
+// CHECK-NEXT: ret void
+//
+void test_vstrdq_scatter_base_wb_s64(uint64x2_t *addr, int64x2_t value)
+{
+#ifdef POLYMORPHIC
+ vstrdq_scatter_base_wb(addr, 0xd0, value);
+#else /* POLYMORPHIC */
+ vstrdq_scatter_base_wb_s64(addr, 0xd0, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrdq_scatter_base_wb_u64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = load <2 x i64>, <2 x i64>* [[ADDR:%.*]], align 8
+// CHECK-NEXT: [[TMP1:%.*]] = call <2 x i64> @llvm.arm.mve.vstr.scatter.base.wb.v2i64.v2i64(<2 x i64> [[TMP0]], i32 -168, <2 x i64> [[VALUE:%.*]])
+// CHECK-NEXT: store <2 x i64> [[TMP1]], <2 x i64>* [[ADDR]], align 8
+// CHECK-NEXT: ret void
+//
+void test_vstrdq_scatter_base_wb_u64(uint64x2_t *addr, uint64x2_t value)
+{
+#ifdef POLYMORPHIC
+ vstrdq_scatter_base_wb(addr, -0xa8, value);
+#else /* POLYMORPHIC */
+ vstrdq_scatter_base_wb_u64(addr, -0xa8, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrdq_scatter_offset_p_s64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.predicated.p0i64.v2i64.v2i64.v4i1(i64* [[BASE:%.*]], <2 x i64> [[OFFSET:%.*]], <2 x i64> [[VALUE:%.*]], i32 64, i32 0, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret void
+//
+void test_vstrdq_scatter_offset_p_s64(int64_t *base, uint64x2_t offset, int64x2_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrdq_scatter_offset_p(base, offset, value, p);
+#else /* POLYMORPHIC */
+ vstrdq_scatter_offset_p_s64(base, offset, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrdq_scatter_offset_p_u64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.predicated.p0i64.v2i64.v2i64.v4i1(i64* [[BASE:%.*]], <2 x i64> [[OFFSET:%.*]], <2 x i64> [[VALUE:%.*]], i32 64, i32 0, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret void
+//
+void test_vstrdq_scatter_offset_p_u64(uint64_t *base, uint64x2_t offset, uint64x2_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrdq_scatter_offset_p(base, offset, value, p);
+#else /* POLYMORPHIC */
+ vstrdq_scatter_offset_p_u64(base, offset, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrdq_scatter_offset_s64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.p0i64.v2i64.v2i64(i64* [[BASE:%.*]], <2 x i64> [[OFFSET:%.*]], <2 x i64> [[VALUE:%.*]], i32 64, i32 0)
+// CHECK-NEXT: ret void
+//
+void test_vstrdq_scatter_offset_s64(int64_t *base, uint64x2_t offset, int64x2_t value)
+{
+#ifdef POLYMORPHIC
+ vstrdq_scatter_offset(base, offset, value);
+#else /* POLYMORPHIC */
+ vstrdq_scatter_offset_s64(base, offset, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrdq_scatter_offset_u64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.p0i64.v2i64.v2i64(i64* [[BASE:%.*]], <2 x i64> [[OFFSET:%.*]], <2 x i64> [[VALUE:%.*]], i32 64, i32 0)
+// CHECK-NEXT: ret void
+//
+void test_vstrdq_scatter_offset_u64(uint64_t *base, uint64x2_t offset, uint64x2_t value)
+{
+#ifdef POLYMORPHIC
+ vstrdq_scatter_offset(base, offset, value);
+#else /* POLYMORPHIC */
+ vstrdq_scatter_offset_u64(base, offset, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrdq_scatter_shifted_offset_p_s64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.predicated.p0i64.v2i64.v2i64.v4i1(i64* [[BASE:%.*]], <2 x i64> [[OFFSET:%.*]], <2 x i64> [[VALUE:%.*]], i32 64, i32 3, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret void
+//
+void test_vstrdq_scatter_shifted_offset_p_s64(int64_t *base, uint64x2_t offset, int64x2_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrdq_scatter_shifted_offset_p(base, offset, value, p);
+#else /* POLYMORPHIC */
+ vstrdq_scatter_shifted_offset_p_s64(base, offset, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrdq_scatter_shifted_offset_p_u64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.predicated.p0i64.v2i64.v2i64.v4i1(i64* [[BASE:%.*]], <2 x i64> [[OFFSET:%.*]], <2 x i64> [[VALUE:%.*]], i32 64, i32 3, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret void
+//
+void test_vstrdq_scatter_shifted_offset_p_u64(uint64_t *base, uint64x2_t offset, uint64x2_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrdq_scatter_shifted_offset_p(base, offset, value, p);
+#else /* POLYMORPHIC */
+ vstrdq_scatter_shifted_offset_p_u64(base, offset, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrdq_scatter_shifted_offset_s64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.p0i64.v2i64.v2i64(i64* [[BASE:%.*]], <2 x i64> [[OFFSET:%.*]], <2 x i64> [[VALUE:%.*]], i32 64, i32 3)
+// CHECK-NEXT: ret void
+//
+void test_vstrdq_scatter_shifted_offset_s64(int64_t *base, uint64x2_t offset, int64x2_t value)
+{
+#ifdef POLYMORPHIC
+ vstrdq_scatter_shifted_offset(base, offset, value);
+#else /* POLYMORPHIC */
+ vstrdq_scatter_shifted_offset_s64(base, offset, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrdq_scatter_shifted_offset_u64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.p0i64.v2i64.v2i64(i64* [[BASE:%.*]], <2 x i64> [[OFFSET:%.*]], <2 x i64> [[VALUE:%.*]], i32 64, i32 3)
+// CHECK-NEXT: ret void
+//
+void test_vstrdq_scatter_shifted_offset_u64(uint64_t *base, uint64x2_t offset, uint64x2_t value)
+{
+#ifdef POLYMORPHIC
+ vstrdq_scatter_shifted_offset(base, offset, value);
+#else /* POLYMORPHIC */
+ vstrdq_scatter_shifted_offset_u64(base, offset, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrhq_scatter_offset_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.p0f16.v8i16.v8f16(half* [[BASE:%.*]], <8 x i16> [[OFFSET:%.*]], <8 x half> [[VALUE:%.*]], i32 16, i32 0)
+// CHECK-NEXT: ret void
+//
+void test_vstrhq_scatter_offset_f16(float16_t *base, uint16x8_t offset, float16x8_t value)
+{
+#ifdef POLYMORPHIC
+ vstrhq_scatter_offset(base, offset, value);
+#else /* POLYMORPHIC */
+ vstrhq_scatter_offset_f16(base, offset, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrhq_scatter_offset_p_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.predicated.p0f16.v8i16.v8f16.v8i1(half* [[BASE:%.*]], <8 x i16> [[OFFSET:%.*]], <8 x half> [[VALUE:%.*]], i32 16, i32 0, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret void
+//
+void test_vstrhq_scatter_offset_p_f16(float16_t *base, uint16x8_t offset, float16x8_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrhq_scatter_offset_p(base, offset, value, p);
+#else /* POLYMORPHIC */
+ vstrhq_scatter_offset_p_f16(base, offset, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrhq_scatter_offset_p_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.predicated.p0i16.v8i16.v8i16.v8i1(i16* [[BASE:%.*]], <8 x i16> [[OFFSET:%.*]], <8 x i16> [[VALUE:%.*]], i32 16, i32 0, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret void
+//
+void test_vstrhq_scatter_offset_p_s16(int16_t *base, uint16x8_t offset, int16x8_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrhq_scatter_offset_p(base, offset, value, p);
+#else /* POLYMORPHIC */
+ vstrhq_scatter_offset_p_s16(base, offset, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrhq_scatter_offset_p_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.predicated.p0i16.v4i32.v4i32.v4i1(i16* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], <4 x i32> [[VALUE:%.*]], i32 16, i32 0, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret void
+//
+void test_vstrhq_scatter_offset_p_s32(int16_t *base, uint32x4_t offset, int32x4_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrhq_scatter_offset_p(base, offset, value, p);
+#else /* POLYMORPHIC */
+ vstrhq_scatter_offset_p_s32(base, offset, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrhq_scatter_offset_p_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.predicated.p0i16.v8i16.v8i16.v8i1(i16* [[BASE:%.*]], <8 x i16> [[OFFSET:%.*]], <8 x i16> [[VALUE:%.*]], i32 16, i32 0, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret void
+//
+void test_vstrhq_scatter_offset_p_u16(uint16_t *base, uint16x8_t offset, uint16x8_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrhq_scatter_offset_p(base, offset, value, p);
+#else /* POLYMORPHIC */
+ vstrhq_scatter_offset_p_u16(base, offset, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrhq_scatter_offset_p_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.predicated.p0i16.v4i32.v4i32.v4i1(i16* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], <4 x i32> [[VALUE:%.*]], i32 16, i32 0, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret void
+//
+void test_vstrhq_scatter_offset_p_u32(uint16_t *base, uint32x4_t offset, uint32x4_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrhq_scatter_offset_p(base, offset, value, p);
+#else /* POLYMORPHIC */
+ vstrhq_scatter_offset_p_u32(base, offset, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrhq_scatter_offset_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.p0i16.v8i16.v8i16(i16* [[BASE:%.*]], <8 x i16> [[OFFSET:%.*]], <8 x i16> [[VALUE:%.*]], i32 16, i32 0)
+// CHECK-NEXT: ret void
+//
+void test_vstrhq_scatter_offset_s16(int16_t *base, uint16x8_t offset, int16x8_t value)
+{
+#ifdef POLYMORPHIC
+ vstrhq_scatter_offset(base, offset, value);
+#else /* POLYMORPHIC */
+ vstrhq_scatter_offset_s16(base, offset, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrhq_scatter_offset_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.p0i16.v4i32.v4i32(i16* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], <4 x i32> [[VALUE:%.*]], i32 16, i32 0)
+// CHECK-NEXT: ret void
+//
+void test_vstrhq_scatter_offset_s32(int16_t *base, uint32x4_t offset, int32x4_t value)
+{
+#ifdef POLYMORPHIC
+ vstrhq_scatter_offset(base, offset, value);
+#else /* POLYMORPHIC */
+ vstrhq_scatter_offset_s32(base, offset, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrhq_scatter_offset_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.p0i16.v8i16.v8i16(i16* [[BASE:%.*]], <8 x i16> [[OFFSET:%.*]], <8 x i16> [[VALUE:%.*]], i32 16, i32 0)
+// CHECK-NEXT: ret void
+//
+void test_vstrhq_scatter_offset_u16(uint16_t *base, uint16x8_t offset, uint16x8_t value)
+{
+#ifdef POLYMORPHIC
+ vstrhq_scatter_offset(base, offset, value);
+#else /* POLYMORPHIC */
+ vstrhq_scatter_offset_u16(base, offset, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrhq_scatter_offset_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.p0i16.v4i32.v4i32(i16* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], <4 x i32> [[VALUE:%.*]], i32 16, i32 0)
+// CHECK-NEXT: ret void
+//
+void test_vstrhq_scatter_offset_u32(uint16_t *base, uint32x4_t offset, uint32x4_t value)
+{
+#ifdef POLYMORPHIC
+ vstrhq_scatter_offset(base, offset, value);
+#else /* POLYMORPHIC */
+ vstrhq_scatter_offset_u32(base, offset, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrhq_scatter_shifted_offset_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.p0f16.v8i16.v8f16(half* [[BASE:%.*]], <8 x i16> [[OFFSET:%.*]], <8 x half> [[VALUE:%.*]], i32 16, i32 1)
+// CHECK-NEXT: ret void
+//
+void test_vstrhq_scatter_shifted_offset_f16(float16_t *base, uint16x8_t offset, float16x8_t value)
+{
+#ifdef POLYMORPHIC
+ vstrhq_scatter_shifted_offset(base, offset, value);
+#else /* POLYMORPHIC */
+ vstrhq_scatter_shifted_offset_f16(base, offset, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrhq_scatter_shifted_offset_p_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.predicated.p0f16.v8i16.v8f16.v8i1(half* [[BASE:%.*]], <8 x i16> [[OFFSET:%.*]], <8 x half> [[VALUE:%.*]], i32 16, i32 1, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret void
+//
+void test_vstrhq_scatter_shifted_offset_p_f16(float16_t *base, uint16x8_t offset, float16x8_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrhq_scatter_shifted_offset_p(base, offset, value, p);
+#else /* POLYMORPHIC */
+ vstrhq_scatter_shifted_offset_p_f16(base, offset, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrhq_scatter_shifted_offset_p_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.predicated.p0i16.v8i16.v8i16.v8i1(i16* [[BASE:%.*]], <8 x i16> [[OFFSET:%.*]], <8 x i16> [[VALUE:%.*]], i32 16, i32 1, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret void
+//
+void test_vstrhq_scatter_shifted_offset_p_s16(int16_t *base, uint16x8_t offset, int16x8_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrhq_scatter_shifted_offset_p(base, offset, value, p);
+#else /* POLYMORPHIC */
+ vstrhq_scatter_shifted_offset_p_s16(base, offset, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrhq_scatter_shifted_offset_p_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.predicated.p0i16.v4i32.v4i32.v4i1(i16* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], <4 x i32> [[VALUE:%.*]], i32 16, i32 1, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret void
+//
+void test_vstrhq_scatter_shifted_offset_p_s32(int16_t *base, uint32x4_t offset, int32x4_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrhq_scatter_shifted_offset_p(base, offset, value, p);
+#else /* POLYMORPHIC */
+ vstrhq_scatter_shifted_offset_p_s32(base, offset, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrhq_scatter_shifted_offset_p_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.predicated.p0i16.v8i16.v8i16.v8i1(i16* [[BASE:%.*]], <8 x i16> [[OFFSET:%.*]], <8 x i16> [[VALUE:%.*]], i32 16, i32 1, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret void
+//
+void test_vstrhq_scatter_shifted_offset_p_u16(uint16_t *base, uint16x8_t offset, uint16x8_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrhq_scatter_shifted_offset_p(base, offset, value, p);
+#else /* POLYMORPHIC */
+ vstrhq_scatter_shifted_offset_p_u16(base, offset, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrhq_scatter_shifted_offset_p_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.predicated.p0i16.v4i32.v4i32.v4i1(i16* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], <4 x i32> [[VALUE:%.*]], i32 16, i32 1, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret void
+//
+void test_vstrhq_scatter_shifted_offset_p_u32(uint16_t *base, uint32x4_t offset, uint32x4_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrhq_scatter_shifted_offset_p(base, offset, value, p);
+#else /* POLYMORPHIC */
+ vstrhq_scatter_shifted_offset_p_u32(base, offset, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrhq_scatter_shifted_offset_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.p0i16.v8i16.v8i16(i16* [[BASE:%.*]], <8 x i16> [[OFFSET:%.*]], <8 x i16> [[VALUE:%.*]], i32 16, i32 1)
+// CHECK-NEXT: ret void
+//
+void test_vstrhq_scatter_shifted_offset_s16(int16_t *base, uint16x8_t offset, int16x8_t value)
+{
+#ifdef POLYMORPHIC
+ vstrhq_scatter_shifted_offset(base, offset, value);
+#else /* POLYMORPHIC */
+ vstrhq_scatter_shifted_offset_s16(base, offset, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrhq_scatter_shifted_offset_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.p0i16.v4i32.v4i32(i16* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], <4 x i32> [[VALUE:%.*]], i32 16, i32 1)
+// CHECK-NEXT: ret void
+//
+void test_vstrhq_scatter_shifted_offset_s32(int16_t *base, uint32x4_t offset, int32x4_t value)
+{
+#ifdef POLYMORPHIC
+ vstrhq_scatter_shifted_offset(base, offset, value);
+#else /* POLYMORPHIC */
+ vstrhq_scatter_shifted_offset_s32(base, offset, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrhq_scatter_shifted_offset_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.p0i16.v8i16.v8i16(i16* [[BASE:%.*]], <8 x i16> [[OFFSET:%.*]], <8 x i16> [[VALUE:%.*]], i32 16, i32 1)
+// CHECK-NEXT: ret void
+//
+void test_vstrhq_scatter_shifted_offset_u16(uint16_t *base, uint16x8_t offset, uint16x8_t value)
+{
+#ifdef POLYMORPHIC
+ vstrhq_scatter_shifted_offset(base, offset, value);
+#else /* POLYMORPHIC */
+ vstrhq_scatter_shifted_offset_u16(base, offset, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrhq_scatter_shifted_offset_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.p0i16.v4i32.v4i32(i16* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], <4 x i32> [[VALUE:%.*]], i32 16, i32 1)
+// CHECK-NEXT: ret void
+//
+void test_vstrhq_scatter_shifted_offset_u32(uint16_t *base, uint32x4_t offset, uint32x4_t value)
+{
+#ifdef POLYMORPHIC
+ vstrhq_scatter_shifted_offset(base, offset, value);
+#else /* POLYMORPHIC */
+ vstrhq_scatter_shifted_offset_u32(base, offset, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrwq_scatter_base_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.base.v4i32.v4f32(<4 x i32> [[ADDR:%.*]], i32 380, <4 x float> [[VALUE:%.*]])
+// CHECK-NEXT: ret void
+//
+void test_vstrwq_scatter_base_f32(uint32x4_t addr, float32x4_t value)
+{
+#ifdef POLYMORPHIC
+ vstrwq_scatter_base(addr, 0x17c, value);
+#else /* POLYMORPHIC */
+ vstrwq_scatter_base_f32(addr, 0x17c, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrwq_scatter_base_p_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.base.predicated.v4i32.v4f32.v4i1(<4 x i32> [[ADDR:%.*]], i32 -400, <4 x float> [[VALUE:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret void
+//
+void test_vstrwq_scatter_base_p_f32(uint32x4_t addr, float32x4_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrwq_scatter_base_p(addr, -0x190, value, p);
+#else /* POLYMORPHIC */
+ vstrwq_scatter_base_p_f32(addr, -0x190, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrwq_scatter_base_p_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.base.predicated.v4i32.v4i32.v4i1(<4 x i32> [[ADDR:%.*]], i32 48, <4 x i32> [[VALUE:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret void
+//
+void test_vstrwq_scatter_base_p_s32(uint32x4_t addr, int32x4_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrwq_scatter_base_p(addr, 0x30, value, p);
+#else /* POLYMORPHIC */
+ vstrwq_scatter_base_p_s32(addr, 0x30, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrwq_scatter_base_p_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.base.predicated.v4i32.v4i32.v4i1(<4 x i32> [[ADDR:%.*]], i32 -376, <4 x i32> [[VALUE:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret void
+//
+void test_vstrwq_scatter_base_p_u32(uint32x4_t addr, uint32x4_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrwq_scatter_base_p(addr, -0x178, value, p);
+#else /* POLYMORPHIC */
+ vstrwq_scatter_base_p_u32(addr, -0x178, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrwq_scatter_base_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.base.v4i32.v4i32(<4 x i32> [[ADDR:%.*]], i32 156, <4 x i32> [[VALUE:%.*]])
+// CHECK-NEXT: ret void
+//
+void test_vstrwq_scatter_base_s32(uint32x4_t addr, int32x4_t value)
+{
+#ifdef POLYMORPHIC
+ vstrwq_scatter_base(addr, 0x9c, value);
+#else /* POLYMORPHIC */
+ vstrwq_scatter_base_s32(addr, 0x9c, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrwq_scatter_base_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.base.v4i32.v4i32(<4 x i32> [[ADDR:%.*]], i32 212, <4 x i32> [[VALUE:%.*]])
+// CHECK-NEXT: ret void
+//
+void test_vstrwq_scatter_base_u32(uint32x4_t addr, uint32x4_t value)
+{
+#ifdef POLYMORPHIC
+ vstrwq_scatter_base(addr, 0xd4, value);
+#else /* POLYMORPHIC */
+ vstrwq_scatter_base_u32(addr, 0xd4, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrwq_scatter_base_wb_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = load <4 x i32>, <4 x i32>* [[ADDR:%.*]], align 8
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i32> @llvm.arm.mve.vstr.scatter.base.wb.v4i32.v4f32(<4 x i32> [[TMP0]], i32 -412, <4 x float> [[VALUE:%.*]])
+// CHECK-NEXT: store <4 x i32> [[TMP1]], <4 x i32>* [[ADDR]], align 8
+// CHECK-NEXT: ret void
+//
+void test_vstrwq_scatter_base_wb_f32(uint32x4_t *addr, float32x4_t value)
+{
+#ifdef POLYMORPHIC
+ vstrwq_scatter_base_wb(addr, -0x19c, value);
+#else /* POLYMORPHIC */
+ vstrwq_scatter_base_wb_f32(addr, -0x19c, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrwq_scatter_base_wb_p_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = load <4 x i32>, <4 x i32>* [[ADDR:%.*]], align 8
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = call <4 x i32> @llvm.arm.mve.vstr.scatter.base.wb.predicated.v4i32.v4f32.v4i1(<4 x i32> [[TMP0]], i32 236, <4 x float> [[VALUE:%.*]], <4 x i1> [[TMP2]])
+// CHECK-NEXT: store <4 x i32> [[TMP3]], <4 x i32>* [[ADDR]], align 8
+// CHECK-NEXT: ret void
+//
+void test_vstrwq_scatter_base_wb_p_f32(uint32x4_t *addr, float32x4_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrwq_scatter_base_wb_p(addr, 0xec, value, p);
+#else /* POLYMORPHIC */
+ vstrwq_scatter_base_wb_p_f32(addr, 0xec, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrwq_scatter_base_wb_p_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = load <4 x i32>, <4 x i32>* [[ADDR:%.*]], align 8
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = call <4 x i32> @llvm.arm.mve.vstr.scatter.base.wb.predicated.v4i32.v4i32.v4i1(<4 x i32> [[TMP0]], i32 328, <4 x i32> [[VALUE:%.*]], <4 x i1> [[TMP2]])
+// CHECK-NEXT: store <4 x i32> [[TMP3]], <4 x i32>* [[ADDR]], align 8
+// CHECK-NEXT: ret void
+//
+void test_vstrwq_scatter_base_wb_p_s32(uint32x4_t *addr, int32x4_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrwq_scatter_base_wb_p(addr, 0x148, value, p);
+#else /* POLYMORPHIC */
+ vstrwq_scatter_base_wb_p_s32(addr, 0x148, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrwq_scatter_base_wb_p_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = load <4 x i32>, <4 x i32>* [[ADDR:%.*]], align 8
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = call <4 x i32> @llvm.arm.mve.vstr.scatter.base.wb.predicated.v4i32.v4i32.v4i1(<4 x i32> [[TMP0]], i32 412, <4 x i32> [[VALUE:%.*]], <4 x i1> [[TMP2]])
+// CHECK-NEXT: store <4 x i32> [[TMP3]], <4 x i32>* [[ADDR]], align 8
+// CHECK-NEXT: ret void
+//
+void test_vstrwq_scatter_base_wb_p_u32(uint32x4_t *addr, uint32x4_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrwq_scatter_base_wb_p(addr, 0x19c, value, p);
+#else /* POLYMORPHIC */
+ vstrwq_scatter_base_wb_p_u32(addr, 0x19c, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrwq_scatter_base_wb_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = load <4 x i32>, <4 x i32>* [[ADDR:%.*]], align 8
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i32> @llvm.arm.mve.vstr.scatter.base.wb.v4i32.v4i32(<4 x i32> [[TMP0]], i32 -152, <4 x i32> [[VALUE:%.*]])
+// CHECK-NEXT: store <4 x i32> [[TMP1]], <4 x i32>* [[ADDR]], align 8
+// CHECK-NEXT: ret void
+//
+void test_vstrwq_scatter_base_wb_s32(uint32x4_t *addr, int32x4_t value)
+{
+#ifdef POLYMORPHIC
+ vstrwq_scatter_base_wb(addr, -0x98, value);
+#else /* POLYMORPHIC */
+ vstrwq_scatter_base_wb_s32(addr, -0x98, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrwq_scatter_base_wb_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = load <4 x i32>, <4 x i32>* [[ADDR:%.*]], align 8
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i32> @llvm.arm.mve.vstr.scatter.base.wb.v4i32.v4i32(<4 x i32> [[TMP0]], i32 64, <4 x i32> [[VALUE:%.*]])
+// CHECK-NEXT: store <4 x i32> [[TMP1]], <4 x i32>* [[ADDR]], align 8
+// CHECK-NEXT: ret void
+//
+void test_vstrwq_scatter_base_wb_u32(uint32x4_t *addr, uint32x4_t value)
+{
+#ifdef POLYMORPHIC
+ vstrwq_scatter_base_wb(addr, 0x40, value);
+#else /* POLYMORPHIC */
+ vstrwq_scatter_base_wb_u32(addr, 0x40, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrwq_scatter_offset_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.p0f32.v4i32.v4f32(float* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], <4 x float> [[VALUE:%.*]], i32 32, i32 0)
+// CHECK-NEXT: ret void
+//
+void test_vstrwq_scatter_offset_f32(float32_t *base, uint32x4_t offset, float32x4_t value)
+{
+#ifdef POLYMORPHIC
+ vstrwq_scatter_offset(base, offset, value);
+#else /* POLYMORPHIC */
+ vstrwq_scatter_offset_f32(base, offset, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrwq_scatter_offset_p_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.predicated.p0f32.v4i32.v4f32.v4i1(float* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], <4 x float> [[VALUE:%.*]], i32 32, i32 0, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret void
+//
+void test_vstrwq_scatter_offset_p_f32(float32_t *base, uint32x4_t offset, float32x4_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrwq_scatter_offset_p(base, offset, value, p);
+#else /* POLYMORPHIC */
+ vstrwq_scatter_offset_p_f32(base, offset, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrwq_scatter_offset_p_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.predicated.p0i32.v4i32.v4i32.v4i1(i32* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], <4 x i32> [[VALUE:%.*]], i32 32, i32 0, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret void
+//
+void test_vstrwq_scatter_offset_p_s32(int32_t *base, uint32x4_t offset, int32x4_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrwq_scatter_offset_p(base, offset, value, p);
+#else /* POLYMORPHIC */
+ vstrwq_scatter_offset_p_s32(base, offset, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrwq_scatter_offset_p_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.predicated.p0i32.v4i32.v4i32.v4i1(i32* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], <4 x i32> [[VALUE:%.*]], i32 32, i32 0, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret void
+//
+void test_vstrwq_scatter_offset_p_u32(uint32_t *base, uint32x4_t offset, uint32x4_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrwq_scatter_offset_p(base, offset, value, p);
+#else /* POLYMORPHIC */
+ vstrwq_scatter_offset_p_u32(base, offset, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrwq_scatter_offset_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.p0i32.v4i32.v4i32(i32* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], <4 x i32> [[VALUE:%.*]], i32 32, i32 0)
+// CHECK-NEXT: ret void
+//
+void test_vstrwq_scatter_offset_s32(int32_t *base, uint32x4_t offset, int32x4_t value)
+{
+#ifdef POLYMORPHIC
+ vstrwq_scatter_offset(base, offset, value);
+#else /* POLYMORPHIC */
+ vstrwq_scatter_offset_s32(base, offset, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrwq_scatter_offset_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.p0i32.v4i32.v4i32(i32* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], <4 x i32> [[VALUE:%.*]], i32 32, i32 0)
+// CHECK-NEXT: ret void
+//
+void test_vstrwq_scatter_offset_u32(uint32_t *base, uint32x4_t offset, uint32x4_t value)
+{
+#ifdef POLYMORPHIC
+ vstrwq_scatter_offset(base, offset, value);
+#else /* POLYMORPHIC */
+ vstrwq_scatter_offset_u32(base, offset, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrwq_scatter_shifted_offset_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.p0f32.v4i32.v4f32(float* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], <4 x float> [[VALUE:%.*]], i32 32, i32 2)
+// CHECK-NEXT: ret void
+//
+void test_vstrwq_scatter_shifted_offset_f32(float32_t *base, uint32x4_t offset, float32x4_t value)
+{
+#ifdef POLYMORPHIC
+ vstrwq_scatter_shifted_offset(base, offset, value);
+#else /* POLYMORPHIC */
+ vstrwq_scatter_shifted_offset_f32(base, offset, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrwq_scatter_shifted_offset_p_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.predicated.p0f32.v4i32.v4f32.v4i1(float* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], <4 x float> [[VALUE:%.*]], i32 32, i32 2, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret void
+//
+void test_vstrwq_scatter_shifted_offset_p_f32(float32_t *base, uint32x4_t offset, float32x4_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrwq_scatter_shifted_offset_p(base, offset, value, p);
+#else /* POLYMORPHIC */
+ vstrwq_scatter_shifted_offset_p_f32(base, offset, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrwq_scatter_shifted_offset_p_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.predicated.p0i32.v4i32.v4i32.v4i1(i32* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], <4 x i32> [[VALUE:%.*]], i32 32, i32 2, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret void
+//
+void test_vstrwq_scatter_shifted_offset_p_s32(int32_t *base, uint32x4_t offset, int32x4_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrwq_scatter_shifted_offset_p(base, offset, value, p);
+#else /* POLYMORPHIC */
+ vstrwq_scatter_shifted_offset_p_s32(base, offset, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrwq_scatter_shifted_offset_p_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.predicated.p0i32.v4i32.v4i32.v4i1(i32* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], <4 x i32> [[VALUE:%.*]], i32 32, i32 2, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret void
+//
+void test_vstrwq_scatter_shifted_offset_p_u32(uint32_t *base, uint32x4_t offset, uint32x4_t value, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ vstrwq_scatter_shifted_offset_p(base, offset, value, p);
+#else /* POLYMORPHIC */
+ vstrwq_scatter_shifted_offset_p_u32(base, offset, value, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrwq_scatter_shifted_offset_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.p0i32.v4i32.v4i32(i32* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], <4 x i32> [[VALUE:%.*]], i32 32, i32 2)
+// CHECK-NEXT: ret void
+//
+void test_vstrwq_scatter_shifted_offset_s32(int32_t *base, uint32x4_t offset, int32x4_t value)
+{
+#ifdef POLYMORPHIC
+ vstrwq_scatter_shifted_offset(base, offset, value);
+#else /* POLYMORPHIC */
+ vstrwq_scatter_shifted_offset_s32(base, offset, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vstrwq_scatter_shifted_offset_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: call void @llvm.arm.mve.vstr.scatter.offset.p0i32.v4i32.v4i32(i32* [[BASE:%.*]], <4 x i32> [[OFFSET:%.*]], <4 x i32> [[VALUE:%.*]], i32 32, i32 2)
+// CHECK-NEXT: ret void
+//
+void test_vstrwq_scatter_shifted_offset_u32(uint32_t *base, uint32x4_t offset, uint32x4_t value)
+{
+#ifdef POLYMORPHIC
+ vstrwq_scatter_shifted_offset(base, offset, value);
+#else /* POLYMORPHIC */
+ vstrwq_scatter_shifted_offset_u32(base, offset, value);
+#endif /* POLYMORPHIC */
+}
+
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vabavq.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vabavq.c
new file mode 100644
index 0000000..e136276
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vabavq.c
@@ -0,0 +1,173 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg -sroa | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg -sroa | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vabavq_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.vabav.v16i8(i32 0, i32 [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i8> [[C:%.*]])
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+uint32_t test_vabavq_s8(uint32_t a, int8x16_t b, int8x16_t c) {
+#ifdef POLYMORPHIC
+ return vabavq(a, b, c);
+#else
+ return vabavq_s8(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vabavq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.vabav.v8i16(i32 0, i32 [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i16> [[C:%.*]])
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+uint32_t test_vabavq_s16(uint32_t a, int16x8_t b, int16x8_t c) {
+#ifdef POLYMORPHIC
+ return vabavq(a, b, c);
+#else
+ return vabavq_s16(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vabavq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.vabav.v4i32(i32 0, i32 [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i32> [[C:%.*]])
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+uint32_t test_vabavq_s32(uint32_t a, int32x4_t b, int32x4_t c) {
+#ifdef POLYMORPHIC
+ return vabavq(a, b, c);
+#else
+ return vabavq_s32(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vabavq_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.vabav.v16i8(i32 1, i32 [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i8> [[C:%.*]])
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+uint32_t test_vabavq_u8(uint32_t a, uint8x16_t b, uint8x16_t c) {
+#ifdef POLYMORPHIC
+ return vabavq(a, b, c);
+#else
+ return vabavq_u8(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vabavq_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.vabav.v8i16(i32 1, i32 [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i16> [[C:%.*]])
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+uint32_t test_vabavq_u16(uint32_t a, uint16x8_t b, uint16x8_t c) {
+#ifdef POLYMORPHIC
+ return vabavq(a, b, c);
+#else
+ return vabavq_u16(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vabavq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.vabav.v4i32(i32 1, i32 [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i32> [[C:%.*]])
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+uint32_t test_vabavq_u32(uint32_t a, uint32x4_t b, uint32x4_t c) {
+#ifdef POLYMORPHIC
+ return vabavq(a, b, c);
+#else
+ return vabavq_u32(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vabavq_p_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.arm.mve.vabav.predicated.v16i8.v16i1(i32 0, i32 [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i8> [[C:%.*]], <16 x i1> [[TMP1]])
+// CHECK-NEXT: ret i32 [[TMP2]]
+//
+uint32_t test_vabavq_p_s8(uint32_t a, int8x16_t b, int8x16_t c, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vabavq_p(a, b, c, p);
+#else
+ return vabavq_p_s8(a, b, c, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vabavq_p_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.arm.mve.vabav.predicated.v8i16.v8i1(i32 0, i32 [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i16> [[C:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret i32 [[TMP2]]
+//
+uint32_t test_vabavq_p_s16(uint32_t a, int16x8_t b, int16x8_t c, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vabavq_p(a, b, c, p);
+#else
+ return vabavq_p_s16(a, b, c, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vabavq_p_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.arm.mve.vabav.predicated.v4i32.v4i1(i32 0, i32 [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i32> [[C:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret i32 [[TMP2]]
+//
+uint32_t test_vabavq_p_s32(uint32_t a, int32x4_t b, int32x4_t c, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vabavq_p(a, b, c, p);
+#else
+ return vabavq_p_s32(a, b, c, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vabavq_p_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.arm.mve.vabav.predicated.v16i8.v16i1(i32 1, i32 [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i8> [[C:%.*]], <16 x i1> [[TMP1]])
+// CHECK-NEXT: ret i32 [[TMP2]]
+//
+uint32_t test_vabavq_p_u8(uint32_t a, uint8x16_t b, uint8x16_t c, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vabavq_p(a, b, c, p);
+#else
+ return vabavq_p_u8(a, b, c, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vabavq_p_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.arm.mve.vabav.predicated.v8i16.v8i1(i32 1, i32 [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i16> [[C:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret i32 [[TMP2]]
+//
+uint32_t test_vabavq_p_u16(uint32_t a, uint16x8_t b, uint16x8_t c, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vabavq_p(a, b, c, p);
+#else
+ return vabavq_p_u16(a, b, c, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vabavq_p_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.arm.mve.vabav.predicated.v4i32.v4i1(i32 1, i32 [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i32> [[C:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret i32 [[TMP2]]
+//
+uint32_t test_vabavq_p_u32(uint32_t a, uint32x4_t b, uint32x4_t c, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vabavq_p(a, b, c, p);
+#else
+ return vabavq_p_u32(a, b, c, p);
+#endif
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vabdq.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vabdq.c
new file mode 100644
index 0000000..d972fb7
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vabdq.c
@@ -0,0 +1,143 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vabdq_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vabd.v16i8(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 0)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+int8x16_t test_vabdq_s8(int8x16_t a, int8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vabdq(a, b);
+#else /* POLYMORPHIC */
+ return vabdq_s8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vabdq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vabd.v4i32(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vabdq_u32(uint32x4_t a, uint32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vabdq(a, b);
+#else /* POLYMORPHIC */
+ return vabdq_u32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vabdq_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x half> @llvm.arm.mve.vabd.v8f16(<8 x half> [[A:%.*]], <8 x half> [[B:%.*]], i32 0)
+// CHECK-NEXT: ret <8 x half> [[TMP0]]
+//
+float16x8_t test_vabdq_f32(float16x8_t a, float16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vabdq(a, b);
+#else /* POLYMORPHIC */
+ return vabdq_f16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vabdq_m_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.abd.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vabdq_m_u16(uint16x8_t inactive, uint16x8_t a, uint16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vabdq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vabdq_m_u16(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vabdq_m_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.abd.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 0, <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vabdq_m_s8(int8x16_t inactive, int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vabdq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vabdq_m_s8(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vabdq_m_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.abd.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x float> [[B:%.*]], i32 0, <4 x i1> [[TMP1]], <4 x float> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x float> [[TMP2]]
+//
+float32x4_t test_vabdq_m_f32(float32x4_t inactive, float32x4_t a, float32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vabdq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vabdq_m_f32(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vabdq_x_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.abd.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, <8 x i1> [[TMP1]], <8 x i16> undef)
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vabdq_x_u16(uint16x8_t a, uint16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vabdq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vabdq_x_u16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vabdq_x_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.abd.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, <4 x i1> [[TMP1]], <4 x i32> undef)
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vabdq_x_u32(uint32x4_t a, uint32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vabdq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vabdq_x_u32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vabdq_x_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.abd.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x half> [[B:%.*]], i32 0, <8 x i1> [[TMP1]], <8 x half> undef)
+// CHECK-NEXT: ret <8 x half> [[TMP2]]
+//
+float16x8_t test_vabdq_x_f16(float16x8_t a, float16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vabdq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vabdq_x_f16(a, b, p);
+#endif /* POLYMORPHIC */
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vadc.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vadc.c
new file mode 100644
index 0000000..94fa1d1
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vadc.c
@@ -0,0 +1,89 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vadciq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call { <4 x i32>, i32 } @llvm.arm.mve.vadc.v4i32(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 0)
+// CHECK-NEXT: [[TMP1:%.*]] = extractvalue { <4 x i32>, i32 } [[TMP0]], 1
+// CHECK-NEXT: [[TMP2:%.*]] = lshr i32 [[TMP1]], 29
+// CHECK-NEXT: [[TMP3:%.*]] = and i32 1, [[TMP2]]
+// CHECK-NEXT: store i32 [[TMP3]], i32* [[CARRY_OUT:%.*]], align 4
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { <4 x i32>, i32 } [[TMP0]], 0
+// CHECK-NEXT: ret <4 x i32> [[TMP4]]
+//
+int32x4_t test_vadciq_s32(int32x4_t a, int32x4_t b, unsigned *carry_out)
+{
+#ifdef POLYMORPHIC
+ return vadciq(a, b, carry_out);
+#else /* POLYMORPHIC */
+ return vadciq_s32(a, b, carry_out);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vadcq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[CARRY:%.*]], align 4
+// CHECK-NEXT: [[TMP1:%.*]] = shl i32 [[TMP0]], 29
+// CHECK-NEXT: [[TMP2:%.*]] = call { <4 x i32>, i32 } @llvm.arm.mve.vadc.v4i32(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = extractvalue { <4 x i32>, i32 } [[TMP2]], 1
+// CHECK-NEXT: [[TMP4:%.*]] = lshr i32 [[TMP3]], 29
+// CHECK-NEXT: [[TMP5:%.*]] = and i32 1, [[TMP4]]
+// CHECK-NEXT: store i32 [[TMP5]], i32* [[CARRY]], align 4
+// CHECK-NEXT: [[TMP6:%.*]] = extractvalue { <4 x i32>, i32 } [[TMP2]], 0
+// CHECK-NEXT: ret <4 x i32> [[TMP6]]
+//
+uint32x4_t test_vadcq_u32(uint32x4_t a, uint32x4_t b, unsigned *carry)
+{
+#ifdef POLYMORPHIC
+ return vadcq(a, b, carry);
+#else /* POLYMORPHIC */
+ return vadcq_u32(a, b, carry);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vadciq_m_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call { <4 x i32>, i32 } @llvm.arm.mve.vadc.predicated.v4i32.v4i1(<4 x i32> [[INACTIVE:%.*]], <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 0, <4 x i1> [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = extractvalue { <4 x i32>, i32 } [[TMP2]], 1
+// CHECK-NEXT: [[TMP4:%.*]] = lshr i32 [[TMP3]], 29
+// CHECK-NEXT: [[TMP5:%.*]] = and i32 1, [[TMP4]]
+// CHECK-NEXT: store i32 [[TMP5]], i32* [[CARRY_OUT:%.*]], align 4
+// CHECK-NEXT: [[TMP6:%.*]] = extractvalue { <4 x i32>, i32 } [[TMP2]], 0
+// CHECK-NEXT: ret <4 x i32> [[TMP6]]
+//
+uint32x4_t test_vadciq_m_u32(uint32x4_t inactive, uint32x4_t a, uint32x4_t b, unsigned *carry_out, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vadciq_m(inactive, a, b, carry_out, p);
+#else /* POLYMORPHIC */
+ return vadciq_m_u32(inactive, a, b, carry_out, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vadcq_m_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[CARRY:%.*]], align 4
+// CHECK-NEXT: [[TMP1:%.*]] = shl i32 [[TMP0]], 29
+// CHECK-NEXT: [[TMP2:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP2]])
+// CHECK-NEXT: [[TMP4:%.*]] = call { <4 x i32>, i32 } @llvm.arm.mve.vadc.predicated.v4i32.v4i1(<4 x i32> [[INACTIVE:%.*]], <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 [[TMP1]], <4 x i1> [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = extractvalue { <4 x i32>, i32 } [[TMP4]], 1
+// CHECK-NEXT: [[TMP6:%.*]] = lshr i32 [[TMP5]], 29
+// CHECK-NEXT: [[TMP7:%.*]] = and i32 1, [[TMP6]]
+// CHECK-NEXT: store i32 [[TMP7]], i32* [[CARRY]], align 4
+// CHECK-NEXT: [[TMP8:%.*]] = extractvalue { <4 x i32>, i32 } [[TMP4]], 0
+// CHECK-NEXT: ret <4 x i32> [[TMP8]]
+//
+int32x4_t test_vadcq_m_s32(int32x4_t inactive, int32x4_t a, int32x4_t b, unsigned *carry, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vadcq_m(inactive, a, b, carry, p);
+#else /* POLYMORPHIC */
+ return vadcq_m_s32(inactive, a, b, carry, p);
+#endif /* POLYMORPHIC */
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vaddq.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vaddq.c
new file mode 100644
index 0000000..1810c7e
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vaddq.c
@@ -0,0 +1,97 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vaddq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = add <4 x i32> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vaddq_u32(uint32x4_t a, uint32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vaddq(a, b);
+#else /* POLYMORPHIC */
+ return vaddq_u32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vaddq_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = fadd <8 x half> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <8 x half> [[TMP0]]
+//
+float16x8_t test_vaddq_f16(float16x8_t a, float16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vaddq(a, b);
+#else /* POLYMORPHIC */
+ return vaddq_f16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vaddq_m_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.add.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vaddq_m_s8(int8x16_t inactive, int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vaddq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vaddq_m_s8(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vaddq_m_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.add.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x float> [[B:%.*]], <4 x i1> [[TMP1]], <4 x float> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x float> [[TMP2]]
+//
+float32x4_t test_vaddq_m_f32(float32x4_t inactive, float32x4_t a, float32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vaddq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vaddq_m_f32(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vaddq_x_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.add.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i1> [[TMP1]], <8 x i16> undef)
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vaddq_x_u16(uint16x8_t a, uint16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vaddq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vaddq_x_u16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vaddq_x_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.add.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x half> [[B:%.*]], <8 x i1> [[TMP1]], <8 x half> undef)
+// CHECK-NEXT: ret <8 x half> [[TMP2]]
+//
+float16x8_t test_vaddq_x_f16(float16x8_t a, float16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vaddq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vaddq_x_f16(a, b, p);
+#endif /* POLYMORPHIC */
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vandq.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vandq.c
new file mode 100644
index 0000000..9c88b67
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vandq.c
@@ -0,0 +1,199 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vandq_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = and <16 x i8> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vandq_u8(uint8x16_t a, uint8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vandq(a, b);
+#else /* POLYMORPHIC */
+ return vandq_u8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vandq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = and <8 x i16> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vandq_s16(int16x8_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vandq(a, b);
+#else /* POLYMORPHIC */
+ return vandq_s16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vandq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = and <4 x i32> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vandq_u32(uint32x4_t a, uint32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vandq(a, b);
+#else /* POLYMORPHIC */
+ return vandq_u32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vandq_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[A:%.*]] to <4 x i32>
+// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x float> [[B:%.*]] to <4 x i32>
+// CHECK-NEXT: [[TMP2:%.*]] = and <4 x i32> [[TMP0]], [[TMP1]]
+// CHECK-NEXT: [[TMP3:%.*]] = bitcast <4 x i32> [[TMP2]] to <4 x float>
+// CHECK-NEXT: ret <4 x float> [[TMP3]]
+//
+float32x4_t test_vandq_f32(float32x4_t a, float32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vandq(a, b);
+#else /* POLYMORPHIC */
+ return vandq_f32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vandq_m_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.and.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vandq_m_s8(int8x16_t inactive, int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vandq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vandq_m_s8(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vandq_m_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.and.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vandq_m_u16(uint16x8_t inactive, uint16x8_t a, uint16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vandq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vandq_m_u16(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vandq_m_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.and.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vandq_m_s32(int32x4_t inactive, int32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vandq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vandq_m_s32(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vandq_m_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x half> [[A:%.*]] to <8 x i16>
+// CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x half> [[B:%.*]] to <8 x i16>
+// CHECK-NEXT: [[TMP2:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP2]])
+// CHECK-NEXT: [[TMP4:%.*]] = bitcast <8 x half> [[INACTIVE:%.*]] to <8 x i16>
+// CHECK-NEXT: [[TMP5:%.*]] = call <8 x i16> @llvm.arm.mve.and.predicated.v8i16.v8i1(<8 x i16> [[TMP0]], <8 x i16> [[TMP1]], <8 x i1> [[TMP3]], <8 x i16> [[TMP4]])
+// CHECK-NEXT: [[TMP6:%.*]] = bitcast <8 x i16> [[TMP5]] to <8 x half>
+// CHECK-NEXT: ret <8 x half> [[TMP6]]
+//
+float16x8_t test_vandq_m_f16(float16x8_t inactive, float16x8_t a, float16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vandq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vandq_m_f16(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vandq_x_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.and.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i1> [[TMP1]], <16 x i8> undef)
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vandq_x_u8(uint8x16_t a, uint8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vandq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vandq_x_u8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vandq_x_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.and.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i1> [[TMP1]], <8 x i16> undef)
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vandq_x_s16(int16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vandq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vandq_x_s16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vandq_x_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.and.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]], <4 x i32> undef)
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vandq_x_u32(uint32x4_t a, uint32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vandq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vandq_x_u32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vandq_m_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[A:%.*]] to <4 x i32>
+// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x float> [[B:%.*]] to <4 x i32>
+// CHECK-NEXT: [[TMP2:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP2]])
+// CHECK-NEXT: [[TMP4:%.*]] = call <4 x i32> @llvm.arm.mve.and.predicated.v4i32.v4i1(<4 x i32> [[TMP0]], <4 x i32> [[TMP1]], <4 x i1> [[TMP3]], <4 x i32> undef)
+// CHECK-NEXT: [[TMP5:%.*]] = bitcast <4 x i32> [[TMP4]] to <4 x float>
+// CHECK-NEXT: ret <4 x float> [[TMP5]]
+//
+float32x4_t test_vandq_m_f32(float32x4_t a, float32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vandq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vandq_x_f32(a, b, p);
+#endif /* POLYMORPHIC */
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vbicq.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vbicq.c
new file mode 100644
index 0000000..22ff5d5
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vbicq.c
@@ -0,0 +1,203 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vbicq_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = xor <16 x i8> [[B:%.*]], <i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1>
+// CHECK-NEXT: [[TMP1:%.*]] = and <16 x i8> [[A:%.*]], [[TMP0]]
+// CHECK-NEXT: ret <16 x i8> [[TMP1]]
+//
+uint8x16_t test_vbicq_u8(uint8x16_t a, uint8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vbicq(a, b);
+#else /* POLYMORPHIC */
+ return vbicq_u8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vbicq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = xor <8 x i16> [[B:%.*]], <i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1>
+// CHECK-NEXT: [[TMP1:%.*]] = and <8 x i16> [[A:%.*]], [[TMP0]]
+// CHECK-NEXT: ret <8 x i16> [[TMP1]]
+//
+int16x8_t test_vbicq_s16(int16x8_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vbicq(a, b);
+#else /* POLYMORPHIC */
+ return vbicq_s16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vbicq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = xor <4 x i32> [[B:%.*]], <i32 -1, i32 -1, i32 -1, i32 -1>
+// CHECK-NEXT: [[TMP1:%.*]] = and <4 x i32> [[A:%.*]], [[TMP0]]
+// CHECK-NEXT: ret <4 x i32> [[TMP1]]
+//
+uint32x4_t test_vbicq_u32(uint32x4_t a, uint32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vbicq(a, b);
+#else /* POLYMORPHIC */
+ return vbicq_u32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vbicq_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[A:%.*]] to <4 x i32>
+// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x float> [[B:%.*]] to <4 x i32>
+// CHECK-NEXT: [[TMP2:%.*]] = xor <4 x i32> [[TMP1]], <i32 -1, i32 -1, i32 -1, i32 -1>
+// CHECK-NEXT: [[TMP3:%.*]] = and <4 x i32> [[TMP0]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = bitcast <4 x i32> [[TMP3]] to <4 x float>
+// CHECK-NEXT: ret <4 x float> [[TMP4]]
+//
+float32x4_t test_vbicq_f32(float32x4_t a, float32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vbicq(a, b);
+#else /* POLYMORPHIC */
+ return vbicq_f32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vbicq_m_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.bic.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vbicq_m_s8(int8x16_t inactive, int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vbicq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vbicq_m_s8(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vbicq_m_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.bic.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vbicq_m_u16(uint16x8_t inactive, uint16x8_t a, uint16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vbicq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vbicq_m_u16(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vbicq_m_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.bic.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vbicq_m_s32(int32x4_t inactive, int32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vbicq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vbicq_m_s32(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vbicq_m_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x half> [[A:%.*]] to <8 x i16>
+// CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x half> [[B:%.*]] to <8 x i16>
+// CHECK-NEXT: [[TMP2:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP2]])
+// CHECK-NEXT: [[TMP4:%.*]] = bitcast <8 x half> [[INACTIVE:%.*]] to <8 x i16>
+// CHECK-NEXT: [[TMP5:%.*]] = call <8 x i16> @llvm.arm.mve.bic.predicated.v8i16.v8i1(<8 x i16> [[TMP0]], <8 x i16> [[TMP1]], <8 x i1> [[TMP3]], <8 x i16> [[TMP4]])
+// CHECK-NEXT: [[TMP6:%.*]] = bitcast <8 x i16> [[TMP5]] to <8 x half>
+// CHECK-NEXT: ret <8 x half> [[TMP6]]
+//
+float16x8_t test_vbicq_m_f16(float16x8_t inactive, float16x8_t a, float16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vbicq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vbicq_m_f16(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vbicq_x_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.bic.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i1> [[TMP1]], <16 x i8> undef)
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vbicq_x_u8(uint8x16_t a, uint8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vbicq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vbicq_x_u8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vbicq_x_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.bic.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i1> [[TMP1]], <8 x i16> undef)
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vbicq_x_s16(int16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vbicq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vbicq_x_s16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vbicq_x_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.bic.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]], <4 x i32> undef)
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vbicq_x_u32(uint32x4_t a, uint32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vbicq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vbicq_x_u32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vbicq_m_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[A:%.*]] to <4 x i32>
+// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x float> [[B:%.*]] to <4 x i32>
+// CHECK-NEXT: [[TMP2:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP2]])
+// CHECK-NEXT: [[TMP4:%.*]] = call <4 x i32> @llvm.arm.mve.bic.predicated.v4i32.v4i1(<4 x i32> [[TMP0]], <4 x i32> [[TMP1]], <4 x i1> [[TMP3]], <4 x i32> undef)
+// CHECK-NEXT: [[TMP5:%.*]] = bitcast <4 x i32> [[TMP4]] to <4 x float>
+// CHECK-NEXT: ret <4 x float> [[TMP5]]
+//
+float32x4_t test_vbicq_m_f32(float32x4_t a, float32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vbicq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vbicq_x_f32(a, b, p);
+#endif /* POLYMORPHIC */
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vcaddq.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vcaddq.c
new file mode 100644
index 0000000..f23751a
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vcaddq.c
@@ -0,0 +1,742 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vcaddq_rot90_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vcaddq.v16i8(i32 1, i32 0, <16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vcaddq_rot90_u8(uint8x16_t a, uint8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot90(a, b);
+#else
+ return vcaddq_rot90_u8(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot90_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vcaddq.v8i16(i32 1, i32 0, <8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vcaddq_rot90_u16(uint16x8_t a, uint16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot90(a, b);
+#else
+ return vcaddq_rot90_u16(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot90_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vcaddq.v4i32(i32 1, i32 0, <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vcaddq_rot90_u32(uint32x4_t a, uint32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot90(a, b);
+#else
+ return vcaddq_rot90_u32(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot90_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vcaddq.v16i8(i32 1, i32 0, <16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+int8x16_t test_vcaddq_rot90_s8(int8x16_t a, int8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot90(a, b);
+#else
+ return vcaddq_rot90_s8(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot90_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vcaddq.v8i16(i32 1, i32 0, <8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vcaddq_rot90_s16(int16x8_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot90(a, b);
+#else
+ return vcaddq_rot90_s16(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot90_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vcaddq.v4i32(i32 1, i32 0, <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+int32x4_t test_vcaddq_rot90_s32(int32x4_t a, int32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot90(a, b);
+#else
+ return vcaddq_rot90_s32(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot90_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x half> @llvm.arm.mve.vcaddq.v8f16(i32 1, i32 0, <8 x half> [[A:%.*]], <8 x half> [[B:%.*]])
+// CHECK-NEXT: ret <8 x half> [[TMP0]]
+//
+float16x8_t test_vcaddq_rot90_f16(float16x8_t a, float16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot90(a, b);
+#else
+ return vcaddq_rot90_f16(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot90_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x float> @llvm.arm.mve.vcaddq.v4f32(i32 1, i32 0, <4 x float> [[A:%.*]], <4 x float> [[B:%.*]])
+// CHECK-NEXT: ret <4 x float> [[TMP0]]
+//
+float32x4_t test_vcaddq_rot90_f32(float32x4_t a, float32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot90(a, b);
+#else
+ return vcaddq_rot90_f32(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot270_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vcaddq.v16i8(i32 1, i32 1, <16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vcaddq_rot270_u8(uint8x16_t a, uint8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot270(a, b);
+#else
+ return vcaddq_rot270_u8(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot270_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vcaddq.v8i16(i32 1, i32 1, <8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vcaddq_rot270_u16(uint16x8_t a, uint16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot270(a, b);
+#else
+ return vcaddq_rot270_u16(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot270_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vcaddq.v4i32(i32 1, i32 1, <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vcaddq_rot270_u32(uint32x4_t a, uint32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot270(a, b);
+#else
+ return vcaddq_rot270_u32(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot270_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vcaddq.v16i8(i32 1, i32 1, <16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+int8x16_t test_vcaddq_rot270_s8(int8x16_t a, int8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot270(a, b);
+#else
+ return vcaddq_rot270_s8(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot270_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vcaddq.v8i16(i32 1, i32 1, <8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vcaddq_rot270_s16(int16x8_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot270(a, b);
+#else
+ return vcaddq_rot270_s16(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot270_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vcaddq.v4i32(i32 1, i32 1, <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+int32x4_t test_vcaddq_rot270_s32(int32x4_t a, int32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot270(a, b);
+#else
+ return vcaddq_rot270_s32(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot270_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x half> @llvm.arm.mve.vcaddq.v8f16(i32 1, i32 1, <8 x half> [[A:%.*]], <8 x half> [[B:%.*]])
+// CHECK-NEXT: ret <8 x half> [[TMP0]]
+//
+float16x8_t test_vcaddq_rot270_f16(float16x8_t a, float16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot270(a, b);
+#else
+ return vcaddq_rot270_f16(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot270_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x float> @llvm.arm.mve.vcaddq.v4f32(i32 1, i32 1, <4 x float> [[A:%.*]], <4 x float> [[B:%.*]])
+// CHECK-NEXT: ret <4 x float> [[TMP0]]
+//
+float32x4_t test_vcaddq_rot270_f32(float32x4_t a, float32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot270(a, b);
+#else
+ return vcaddq_rot270_f32(a, b);
+#endif
+}
+
+
+// CHECK-LABEL: @test_vcaddq_rot90_m_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vcaddq.predicated.v16i8.v16i1(i32 1, i32 0, <16 x i8> [[INACTIVE:%.*]], <16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vcaddq_rot90_m_u8(uint8x16_t inactive, uint8x16_t a, uint8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot90_m(inactive, a, b, p);
+#else
+ return vcaddq_rot90_m_u8(inactive, a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot90_m_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vcaddq.predicated.v8i16.v8i1(i32 1, i32 0, <8 x i16> [[INACTIVE:%.*]], <8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vcaddq_rot90_m_u16(uint16x8_t inactive, uint16x8_t a, uint16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot90_m(inactive, a, b, p);
+#else
+ return vcaddq_rot90_m_u16(inactive, a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot90_m_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vcaddq.predicated.v4i32.v4i1(i32 1, i32 0, <4 x i32> [[INACTIVE:%.*]], <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vcaddq_rot90_m_u32(uint32x4_t inactive, uint32x4_t a, uint32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot90_m(inactive, a, b, p);
+#else
+ return vcaddq_rot90_m_u32(inactive, a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot90_m_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vcaddq.predicated.v16i8.v16i1(i32 1, i32 0, <16 x i8> [[INACTIVE:%.*]], <16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vcaddq_rot90_m_s8(int8x16_t inactive, int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot90_m(inactive, a, b, p);
+#else
+ return vcaddq_rot90_m_s8(inactive, a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot90_m_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vcaddq.predicated.v8i16.v8i1(i32 1, i32 0, <8 x i16> [[INACTIVE:%.*]], <8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vcaddq_rot90_m_s16(int16x8_t inactive, int16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot90_m(inactive, a, b, p);
+#else
+ return vcaddq_rot90_m_s16(inactive, a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot90_m_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vcaddq.predicated.v4i32.v4i1(i32 1, i32 0, <4 x i32> [[INACTIVE:%.*]], <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vcaddq_rot90_m_s32(int32x4_t inactive, int32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot90_m(inactive, a, b, p);
+#else
+ return vcaddq_rot90_m_s32(inactive, a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot90_m_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vcaddq.predicated.v8f16.v8i1(i32 1, i32 0, <8 x half> [[INACTIVE:%.*]], <8 x half> [[A:%.*]], <8 x half> [[B:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x half> [[TMP2]]
+//
+float16x8_t test_vcaddq_rot90_m_f16(float16x8_t inactive, float16x8_t a, float16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot90_m(inactive, a, b, p);
+#else
+ return vcaddq_rot90_m_f16(inactive, a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot90_m_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vcaddq.predicated.v4f32.v4i1(i32 1, i32 0, <4 x float> [[INACTIVE:%.*]], <4 x float> [[A:%.*]], <4 x float> [[B:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x float> [[TMP2]]
+//
+float32x4_t test_vcaddq_rot90_m_f32(float32x4_t inactive, float32x4_t a, float32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot90_m(inactive, a, b, p);
+#else
+ return vcaddq_rot90_m_f32(inactive, a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot270_m_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vcaddq.predicated.v16i8.v16i1(i32 1, i32 1, <16 x i8> [[INACTIVE:%.*]], <16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vcaddq_rot270_m_u8(uint8x16_t inactive, uint8x16_t a, uint8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot270_m(inactive, a, b, p);
+#else
+ return vcaddq_rot270_m_u8(inactive, a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot270_m_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vcaddq.predicated.v8i16.v8i1(i32 1, i32 1, <8 x i16> [[INACTIVE:%.*]], <8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vcaddq_rot270_m_u16(uint16x8_t inactive, uint16x8_t a, uint16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot270_m(inactive, a, b, p);
+#else
+ return vcaddq_rot270_m_u16(inactive, a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot270_m_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vcaddq.predicated.v4i32.v4i1(i32 1, i32 1, <4 x i32> [[INACTIVE:%.*]], <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vcaddq_rot270_m_u32(uint32x4_t inactive, uint32x4_t a, uint32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot270_m(inactive, a, b, p);
+#else
+ return vcaddq_rot270_m_u32(inactive, a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot270_m_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vcaddq.predicated.v16i8.v16i1(i32 1, i32 1, <16 x i8> [[INACTIVE:%.*]], <16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vcaddq_rot270_m_s8(int8x16_t inactive, int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot270_m(inactive, a, b, p);
+#else
+ return vcaddq_rot270_m_s8(inactive, a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot270_m_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vcaddq.predicated.v8i16.v8i1(i32 1, i32 1, <8 x i16> [[INACTIVE:%.*]], <8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vcaddq_rot270_m_s16(int16x8_t inactive, int16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot270_m(inactive, a, b, p);
+#else
+ return vcaddq_rot270_m_s16(inactive, a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot270_m_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vcaddq.predicated.v4i32.v4i1(i32 1, i32 1, <4 x i32> [[INACTIVE:%.*]], <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vcaddq_rot270_m_s32(int32x4_t inactive, int32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot270_m(inactive, a, b, p);
+#else
+ return vcaddq_rot270_m_s32(inactive, a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot270_m_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vcaddq.predicated.v8f16.v8i1(i32 1, i32 1, <8 x half> [[INACTIVE:%.*]], <8 x half> [[A:%.*]], <8 x half> [[B:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x half> [[TMP2]]
+//
+float16x8_t test_vcaddq_rot270_m_f16(float16x8_t inactive, float16x8_t a, float16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot270_m(inactive, a, b, p);
+#else
+ return vcaddq_rot270_m_f16(inactive, a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot270_m_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vcaddq.predicated.v4f32.v4i1(i32 1, i32 1, <4 x float> [[INACTIVE:%.*]], <4 x float> [[A:%.*]], <4 x float> [[B:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x float> [[TMP2]]
+//
+float32x4_t test_vcaddq_rot270_m_f32(float32x4_t inactive, float32x4_t a, float32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot270_m(inactive, a, b, p);
+#else
+ return vcaddq_rot270_m_f32(inactive, a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot90_x_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vcaddq.predicated.v16i8.v16i1(i32 1, i32 0, <16 x i8> undef, <16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vcaddq_rot90_x_u8(uint8x16_t a, uint8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot90_x(a, b, p);
+#else
+ return vcaddq_rot90_x_u8(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot90_x_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vcaddq.predicated.v8i16.v8i1(i32 1, i32 0, <8 x i16> undef, <8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vcaddq_rot90_x_u16(uint16x8_t a, uint16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot90_x(a, b, p);
+#else
+ return vcaddq_rot90_x_u16(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot90_x_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vcaddq.predicated.v4i32.v4i1(i32 1, i32 0, <4 x i32> undef, <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vcaddq_rot90_x_u32(uint32x4_t a, uint32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot90_x(a, b, p);
+#else
+ return vcaddq_rot90_x_u32(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot90_x_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vcaddq.predicated.v16i8.v16i1(i32 1, i32 0, <16 x i8> undef, <16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vcaddq_rot90_x_s8(int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot90_x(a, b, p);
+#else
+ return vcaddq_rot90_x_s8(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot90_x_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vcaddq.predicated.v8i16.v8i1(i32 1, i32 0, <8 x i16> undef, <8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vcaddq_rot90_x_s16(int16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot90_x(a, b, p);
+#else
+ return vcaddq_rot90_x_s16(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot90_x_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vcaddq.predicated.v4i32.v4i1(i32 1, i32 0, <4 x i32> undef, <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vcaddq_rot90_x_s32(int32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot90_x(a, b, p);
+#else
+ return vcaddq_rot90_x_s32(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot90_x_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vcaddq.predicated.v8f16.v8i1(i32 1, i32 0, <8 x half> undef, <8 x half> [[A:%.*]], <8 x half> [[B:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x half> [[TMP2]]
+//
+float16x8_t test_vcaddq_rot90_x_f16(float16x8_t a, float16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot90_x(a, b, p);
+#else
+ return vcaddq_rot90_x_f16(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot90_x_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vcaddq.predicated.v4f32.v4i1(i32 1, i32 0, <4 x float> undef, <4 x float> [[A:%.*]], <4 x float> [[B:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x float> [[TMP2]]
+//
+float32x4_t test_vcaddq_rot90_x_f32(float32x4_t a, float32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot90_x(a, b, p);
+#else
+ return vcaddq_rot90_x_f32(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot270_x_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vcaddq.predicated.v16i8.v16i1(i32 1, i32 1, <16 x i8> undef, <16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vcaddq_rot270_x_u8(uint8x16_t a, uint8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot270_x(a, b, p);
+#else
+ return vcaddq_rot270_x_u8(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot270_x_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vcaddq.predicated.v8i16.v8i1(i32 1, i32 1, <8 x i16> undef, <8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vcaddq_rot270_x_u16(uint16x8_t a, uint16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot270_x(a, b, p);
+#else
+ return vcaddq_rot270_x_u16(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot270_x_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vcaddq.predicated.v4i32.v4i1(i32 1, i32 1, <4 x i32> undef, <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vcaddq_rot270_x_u32(uint32x4_t a, uint32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot270_x(a, b, p);
+#else
+ return vcaddq_rot270_x_u32(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot270_x_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vcaddq.predicated.v16i8.v16i1(i32 1, i32 1, <16 x i8> undef, <16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vcaddq_rot270_x_s8(int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot270_x(a, b, p);
+#else
+ return vcaddq_rot270_x_s8(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot270_x_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vcaddq.predicated.v8i16.v8i1(i32 1, i32 1, <8 x i16> undef, <8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vcaddq_rot270_x_s16(int16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot270_x(a, b, p);
+#else
+ return vcaddq_rot270_x_s16(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot270_x_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vcaddq.predicated.v4i32.v4i1(i32 1, i32 1, <4 x i32> undef, <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vcaddq_rot270_x_s32(int32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot270_x(a, b, p);
+#else
+ return vcaddq_rot270_x_s32(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot270_x_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vcaddq.predicated.v8f16.v8i1(i32 1, i32 1, <8 x half> undef, <8 x half> [[A:%.*]], <8 x half> [[B:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x half> [[TMP2]]
+//
+float16x8_t test_vcaddq_rot270_x_f16(float16x8_t a, float16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot270_x(a, b, p);
+#else
+ return vcaddq_rot270_x_f16(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcaddq_rot270_x_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vcaddq.predicated.v4f32.v4i1(i32 1, i32 1, <4 x float> undef, <4 x float> [[A:%.*]], <4 x float> [[B:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x float> [[TMP2]]
+//
+float32x4_t test_vcaddq_rot270_x_f32(float32x4_t a, float32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcaddq_rot270_x(a, b, p);
+#else
+ return vcaddq_rot270_x_f32(a, b, p);
+#endif
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vcmlaq.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vcmlaq.c
new file mode 100644
index 0000000..f470a3b
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vcmlaq.c
@@ -0,0 +1,246 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vcmlaq_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x half> @llvm.arm.mve.vcmlaq.v8f16(i32 0, <8 x half> [[A:%.*]], <8 x half> [[B:%.*]], <8 x half> [[C:%.*]])
+// CHECK-NEXT: ret <8 x half> [[TMP0]]
+//
+float16x8_t test_vcmlaq_f16(float16x8_t a, float16x8_t b, float16x8_t c)
+{
+#ifdef POLYMORPHIC
+ return vcmlaq(a, b, c);
+#else
+ return vcmlaq_f16(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vcmlaq_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x float> @llvm.arm.mve.vcmlaq.v4f32(i32 0, <4 x float> [[A:%.*]], <4 x float> [[B:%.*]], <4 x float> [[C:%.*]])
+// CHECK-NEXT: ret <4 x float> [[TMP0]]
+//
+float32x4_t test_vcmlaq_f32(float32x4_t a, float32x4_t b, float32x4_t c)
+{
+#ifdef POLYMORPHIC
+ return vcmlaq(a, b, c);
+#else
+ return vcmlaq_f32(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vcmlaq_rot90_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x half> @llvm.arm.mve.vcmlaq.v8f16(i32 1, <8 x half> [[A:%.*]], <8 x half> [[B:%.*]], <8 x half> [[C:%.*]])
+// CHECK-NEXT: ret <8 x half> [[TMP0]]
+//
+float16x8_t test_vcmlaq_rot90_f16(float16x8_t a, float16x8_t b, float16x8_t c)
+{
+#ifdef POLYMORPHIC
+ return vcmlaq_rot90(a, b, c);
+#else
+ return vcmlaq_rot90_f16(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vcmlaq_rot90_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x float> @llvm.arm.mve.vcmlaq.v4f32(i32 1, <4 x float> [[A:%.*]], <4 x float> [[B:%.*]], <4 x float> [[C:%.*]])
+// CHECK-NEXT: ret <4 x float> [[TMP0]]
+//
+float32x4_t test_vcmlaq_rot90_f32(float32x4_t a, float32x4_t b, float32x4_t c)
+{
+#ifdef POLYMORPHIC
+ return vcmlaq_rot90(a, b, c);
+#else
+ return vcmlaq_rot90_f32(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vcmlaq_rot180_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x half> @llvm.arm.mve.vcmlaq.v8f16(i32 2, <8 x half> [[A:%.*]], <8 x half> [[B:%.*]], <8 x half> [[C:%.*]])
+// CHECK-NEXT: ret <8 x half> [[TMP0]]
+//
+float16x8_t test_vcmlaq_rot180_f16(float16x8_t a, float16x8_t b, float16x8_t c)
+{
+#ifdef POLYMORPHIC
+ return vcmlaq_rot180(a, b, c);
+#else
+ return vcmlaq_rot180_f16(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vcmlaq_rot180_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x float> @llvm.arm.mve.vcmlaq.v4f32(i32 2, <4 x float> [[A:%.*]], <4 x float> [[B:%.*]], <4 x float> [[C:%.*]])
+// CHECK-NEXT: ret <4 x float> [[TMP0]]
+//
+float32x4_t test_vcmlaq_rot180_f32(float32x4_t a, float32x4_t b, float32x4_t c)
+{
+#ifdef POLYMORPHIC
+ return vcmlaq_rot180(a, b, c);
+#else
+ return vcmlaq_rot180_f32(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vcmlaq_rot270_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x half> @llvm.arm.mve.vcmlaq.v8f16(i32 3, <8 x half> [[A:%.*]], <8 x half> [[B:%.*]], <8 x half> [[C:%.*]])
+// CHECK-NEXT: ret <8 x half> [[TMP0]]
+//
+float16x8_t test_vcmlaq_rot270_f16(float16x8_t a, float16x8_t b, float16x8_t c)
+{
+#ifdef POLYMORPHIC
+ return vcmlaq_rot270(a, b, c);
+#else
+ return vcmlaq_rot270_f16(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vcmlaq_rot270_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x float> @llvm.arm.mve.vcmlaq.v4f32(i32 3, <4 x float> [[A:%.*]], <4 x float> [[B:%.*]], <4 x float> [[C:%.*]])
+// CHECK-NEXT: ret <4 x float> [[TMP0]]
+//
+float32x4_t test_vcmlaq_rot270_f32(float32x4_t a, float32x4_t b, float32x4_t c)
+{
+#ifdef POLYMORPHIC
+ return vcmlaq_rot270(a, b, c);
+#else
+ return vcmlaq_rot270_f32(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vcmlaq_m_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vcmlaq.predicated.v8f16.v8i1(i32 0, <8 x half> [[A:%.*]], <8 x half> [[B:%.*]], <8 x half> [[C:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x half> [[TMP2]]
+//
+float16x8_t test_vcmlaq_m_f16(float16x8_t a, float16x8_t b, float16x8_t c, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmlaq_m(a, b, c, p);
+#else
+ return vcmlaq_m_f16(a, b, c, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcmlaq_m_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vcmlaq.predicated.v4f32.v4i1(i32 0, <4 x float> [[A:%.*]], <4 x float> [[B:%.*]], <4 x float> [[C:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x float> [[TMP2]]
+//
+float32x4_t test_vcmlaq_m_f32(float32x4_t a, float32x4_t b, float32x4_t c, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmlaq_m(a, b, c, p);
+#else
+ return vcmlaq_m_f32(a, b, c, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcmlaq_rot90_m_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vcmlaq.predicated.v8f16.v8i1(i32 1, <8 x half> [[A:%.*]], <8 x half> [[B:%.*]], <8 x half> [[C:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x half> [[TMP2]]
+//
+float16x8_t test_vcmlaq_rot90_m_f16(float16x8_t a, float16x8_t b, float16x8_t c, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmlaq_rot90_m(a, b, c, p);
+#else
+ return vcmlaq_rot90_m_f16(a, b, c, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcmlaq_rot90_m_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vcmlaq.predicated.v4f32.v4i1(i32 1, <4 x float> [[A:%.*]], <4 x float> [[B:%.*]], <4 x float> [[C:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x float> [[TMP2]]
+//
+float32x4_t test_vcmlaq_rot90_m_f32(float32x4_t a, float32x4_t b, float32x4_t c, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmlaq_rot90_m(a, b, c, p);
+#else
+ return vcmlaq_rot90_m_f32(a, b, c, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcmlaq_rot180_m_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vcmlaq.predicated.v8f16.v8i1(i32 2, <8 x half> [[A:%.*]], <8 x half> [[B:%.*]], <8 x half> [[C:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x half> [[TMP2]]
+//
+float16x8_t test_vcmlaq_rot180_m_f16(float16x8_t a, float16x8_t b, float16x8_t c, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmlaq_rot180_m(a, b, c, p);
+#else
+ return vcmlaq_rot180_m_f16(a, b, c, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcmlaq_rot180_m_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vcmlaq.predicated.v4f32.v4i1(i32 2, <4 x float> [[A:%.*]], <4 x float> [[B:%.*]], <4 x float> [[C:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x float> [[TMP2]]
+//
+float32x4_t test_vcmlaq_rot180_m_f32(float32x4_t a, float32x4_t b, float32x4_t c, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmlaq_rot180_m(a, b, c, p);
+#else
+ return vcmlaq_rot180_m_f32(a, b, c, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcmlaq_rot270_m_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vcmlaq.predicated.v8f16.v8i1(i32 3, <8 x half> [[A:%.*]], <8 x half> [[B:%.*]], <8 x half> [[C:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x half> [[TMP2]]
+//
+float16x8_t test_vcmlaq_rot270_m_f16(float16x8_t a, float16x8_t b, float16x8_t c, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmlaq_rot270_m(a, b, c, p);
+#else
+ return vcmlaq_rot270_m_f16(a, b, c, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcmlaq_rot270_m_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vcmlaq.predicated.v4f32.v4i1(i32 3, <4 x float> [[A:%.*]], <4 x float> [[B:%.*]], <4 x float> [[C:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x float> [[TMP2]]
+//
+float32x4_t test_vcmlaq_rot270_m_f32(float32x4_t a, float32x4_t b, float32x4_t c, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmlaq_rot270_m(a, b, c, p);
+#else
+ return vcmlaq_rot270_m_f32(a, b, c, p);
+#endif
+}
+
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vcmulq.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vcmulq.c
new file mode 100644
index 0000000..08d6a60
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vcmulq.c
@@ -0,0 +1,373 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vcmulq_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x half> @llvm.arm.mve.vcmulq.v8f16(i32 0, <8 x half> [[A:%.*]], <8 x half> [[B:%.*]])
+// CHECK-NEXT: ret <8 x half> [[TMP0]]
+//
+float16x8_t test_vcmulq_f16(float16x8_t a, float16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmulq(a, b);
+#else
+ return vcmulq_f16(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vcmulq_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x float> @llvm.arm.mve.vcmulq.v4f32(i32 0, <4 x float> [[A:%.*]], <4 x float> [[B:%.*]])
+// CHECK-NEXT: ret <4 x float> [[TMP0]]
+//
+float32x4_t test_vcmulq_f32(float32x4_t a, float32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmulq(a, b);
+#else
+ return vcmulq_f32(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vcmulq_rot90_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x half> @llvm.arm.mve.vcmulq.v8f16(i32 1, <8 x half> [[A:%.*]], <8 x half> [[B:%.*]])
+// CHECK-NEXT: ret <8 x half> [[TMP0]]
+//
+float16x8_t test_vcmulq_rot90_f16(float16x8_t a, float16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmulq_rot90(a, b);
+#else
+ return vcmulq_rot90_f16(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vcmulq_rot90_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x float> @llvm.arm.mve.vcmulq.v4f32(i32 1, <4 x float> [[A:%.*]], <4 x float> [[B:%.*]])
+// CHECK-NEXT: ret <4 x float> [[TMP0]]
+//
+float32x4_t test_vcmulq_rot90_f32(float32x4_t a, float32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmulq_rot90(a, b);
+#else
+ return vcmulq_rot90_f32(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vcmulq_rot180_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x half> @llvm.arm.mve.vcmulq.v8f16(i32 2, <8 x half> [[A:%.*]], <8 x half> [[B:%.*]])
+// CHECK-NEXT: ret <8 x half> [[TMP0]]
+//
+float16x8_t test_vcmulq_rot180_f16(float16x8_t a, float16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmulq_rot180(a, b);
+#else
+ return vcmulq_rot180_f16(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vcmulq_rot180_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x float> @llvm.arm.mve.vcmulq.v4f32(i32 2, <4 x float> [[A:%.*]], <4 x float> [[B:%.*]])
+// CHECK-NEXT: ret <4 x float> [[TMP0]]
+//
+float32x4_t test_vcmulq_rot180_f32(float32x4_t a, float32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmulq_rot180(a, b);
+#else
+ return vcmulq_rot180_f32(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vcmulq_rot270_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x half> @llvm.arm.mve.vcmulq.v8f16(i32 3, <8 x half> [[A:%.*]], <8 x half> [[B:%.*]])
+// CHECK-NEXT: ret <8 x half> [[TMP0]]
+//
+float16x8_t test_vcmulq_rot270_f16(float16x8_t a, float16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmulq_rot270(a, b);
+#else
+ return vcmulq_rot270_f16(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vcmulq_rot270_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x float> @llvm.arm.mve.vcmulq.v4f32(i32 3, <4 x float> [[A:%.*]], <4 x float> [[B:%.*]])
+// CHECK-NEXT: ret <4 x float> [[TMP0]]
+//
+float32x4_t test_vcmulq_rot270_f32(float32x4_t a, float32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vcmulq_rot270(a, b);
+#else
+ return vcmulq_rot270_f32(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vcmulq_m_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vcmulq.predicated.v8f16.v8i1(i32 0, <8 x half> [[INACTIVE:%.*]], <8 x half> [[A:%.*]], <8 x half> [[B:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x half> [[TMP2]]
+//
+float16x8_t test_vcmulq_m_f16(float16x8_t inactive, float16x8_t a, float16x8_t b, mve_pred16_t p)
+{
+#ifdef polymorphic
+ return vcmulq_m(inactive, a, b, p);
+#else
+ return vcmulq_m_f16(inactive, a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcmulq_m_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vcmulq.predicated.v4f32.v4i1(i32 0, <4 x float> [[INACTIVE:%.*]], <4 x float> [[A:%.*]], <4 x float> [[B:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x float> [[TMP2]]
+//
+float32x4_t test_vcmulq_m_f32(float32x4_t inactive, float32x4_t a, float32x4_t b, mve_pred16_t p)
+{
+#ifdef polymorphic
+ return vcmulq_m(inactive, a, b, p);
+#else
+ return vcmulq_m_f32(inactive, a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcmulq_rot90_m_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vcmulq.predicated.v8f16.v8i1(i32 1, <8 x half> [[INACTIVE:%.*]], <8 x half> [[A:%.*]], <8 x half> [[B:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x half> [[TMP2]]
+//
+float16x8_t test_vcmulq_rot90_m_f16(float16x8_t inactive, float16x8_t a, float16x8_t b, mve_pred16_t p)
+{
+#ifdef polymorphic
+ return vcmulq_rot90_m(inactive, a, b, p);
+#else
+ return vcmulq_rot90_m_f16(inactive, a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcmulq_rot90_m_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vcmulq.predicated.v4f32.v4i1(i32 1, <4 x float> [[INACTIVE:%.*]], <4 x float> [[A:%.*]], <4 x float> [[B:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x float> [[TMP2]]
+//
+float32x4_t test_vcmulq_rot90_m_f32(float32x4_t inactive, float32x4_t a, float32x4_t b, mve_pred16_t p)
+{
+#ifdef polymorphic
+ return vcmulq_rot90_m(inactive, a, b, p);
+#else
+ return vcmulq_rot90_m_f32(inactive, a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcmulq_rot180_m_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vcmulq.predicated.v8f16.v8i1(i32 2, <8 x half> [[INACTIVE:%.*]], <8 x half> [[A:%.*]], <8 x half> [[B:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x half> [[TMP2]]
+//
+float16x8_t test_vcmulq_rot180_m_f16(float16x8_t inactive, float16x8_t a, float16x8_t b, mve_pred16_t p)
+{
+#ifdef polymorphic
+ return vcmulq_rot180_m(inactive, a, b, p);
+#else
+ return vcmulq_rot180_m_f16(inactive, a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcmulq_rot180_m_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vcmulq.predicated.v4f32.v4i1(i32 2, <4 x float> [[INACTIVE:%.*]], <4 x float> [[A:%.*]], <4 x float> [[B:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x float> [[TMP2]]
+//
+float32x4_t test_vcmulq_rot180_m_f32(float32x4_t inactive, float32x4_t a, float32x4_t b, mve_pred16_t p)
+{
+#ifdef polymorphic
+ return vcmulq_rot180_m(inactive, a, b, p);
+#else
+ return vcmulq_rot180_m_f32(inactive, a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcmulq_rot270_m_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vcmulq.predicated.v8f16.v8i1(i32 3, <8 x half> [[INACTIVE:%.*]], <8 x half> [[A:%.*]], <8 x half> [[B:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x half> [[TMP2]]
+//
+float16x8_t test_vcmulq_rot270_m_f16(float16x8_t inactive, float16x8_t a, float16x8_t b, mve_pred16_t p)
+{
+#ifdef polymorphic
+ return vcmulq_rot270_m(inactive, a, b, p);
+#else
+ return vcmulq_rot270_m_f16(inactive, a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcmulq_rot270_m_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vcmulq.predicated.v4f32.v4i1(i32 3, <4 x float> [[INACTIVE:%.*]], <4 x float> [[A:%.*]], <4 x float> [[B:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x float> [[TMP2]]
+//
+float32x4_t test_vcmulq_rot270_m_f32(float32x4_t inactive, float32x4_t a, float32x4_t b, mve_pred16_t p)
+{
+#ifdef polymorphic
+ return vcmulq_rot270_m(inactive, a, b, p);
+#else
+ return vcmulq_rot270_m_f32(inactive, a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcmulq_x_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vcmulq.predicated.v8f16.v8i1(i32 0, <8 x half> undef, <8 x half> [[A:%.*]], <8 x half> [[B:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x half> [[TMP2]]
+//
+float16x8_t test_vcmulq_x_f16(float16x8_t a, float16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmulq_x(a, b, p);
+#else
+ return vcmulq_x_f16(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcmulq_x_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vcmulq.predicated.v4f32.v4i1(i32 0, <4 x float> undef, <4 x float> [[A:%.*]], <4 x float> [[B:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x float> [[TMP2]]
+//
+float32x4_t test_vcmulq_x_f32(float32x4_t a, float32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmulq_x(a, b, p);
+#else
+ return vcmulq_x_f32(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcmulq_rot90_x_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vcmulq.predicated.v8f16.v8i1(i32 1, <8 x half> undef, <8 x half> [[A:%.*]], <8 x half> [[B:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x half> [[TMP2]]
+//
+float16x8_t test_vcmulq_rot90_x_f16(float16x8_t a, float16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmulq_rot90_x(a, b, p);
+#else
+ return vcmulq_rot90_x_f16(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcmulq_rot90_x_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vcmulq.predicated.v4f32.v4i1(i32 1, <4 x float> undef, <4 x float> [[A:%.*]], <4 x float> [[B:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x float> [[TMP2]]
+//
+float32x4_t test_vcmulq_rot90_x_f32(float32x4_t a, float32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmulq_rot90_x(a, b, p);
+#else
+ return vcmulq_rot90_x_f32(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcmulq_rot180_x_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vcmulq.predicated.v8f16.v8i1(i32 2, <8 x half> undef, <8 x half> [[A:%.*]], <8 x half> [[B:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x half> [[TMP2]]
+//
+float16x8_t test_vcmulq_rot180_x_f16(float16x8_t a, float16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmulq_rot180_x(a, b, p);
+#else
+ return vcmulq_rot180_x_f16(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcmulq_rot180_x_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vcmulq.predicated.v4f32.v4i1(i32 2, <4 x float> undef, <4 x float> [[A:%.*]], <4 x float> [[B:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x float> [[TMP2]]
+//
+float32x4_t test_vcmulq_rot180_x_f32(float32x4_t a, float32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmulq_rot180_x(a, b, p);
+#else
+ return vcmulq_rot180_x_f32(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcmulq_rot270_x_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vcmulq.predicated.v8f16.v8i1(i32 3, <8 x half> undef, <8 x half> [[A:%.*]], <8 x half> [[B:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x half> [[TMP2]]
+//
+float16x8_t test_vcmulq_rot270_x_f16(float16x8_t a, float16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmulq_rot270_x(a, b, p);
+#else
+ return vcmulq_rot270_x_f16(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vcmulq_rot270_x_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vcmulq.predicated.v4f32.v4i1(i32 3, <4 x float> undef, <4 x float> [[A:%.*]], <4 x float> [[B:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x float> [[TMP2]]
+//
+float32x4_t test_vcmulq_rot270_x_f32(float32x4_t a, float32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vcmulq_rot270_x(a, b, p);
+#else
+ return vcmulq_rot270_x_f32(a, b, p);
+#endif
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vcvt.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vcvt.c
new file mode 100644
index 0000000..ccee9fd
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vcvt.c
@@ -0,0 +1,26 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vcvttq_f16_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x half> @llvm.arm.mve.vcvt.narrow(<8 x half> [[A:%.*]], <4 x float> [[B:%.*]], i32 1)
+// CHECK-NEXT: ret <8 x half> [[TMP0]]
+//
+float16x8_t test_vcvttq_f16_f32(float16x8_t a, float32x4_t b)
+{
+ return vcvttq_f16_f32(a, b);
+}
+
+// CHECK-LABEL: @test_vcvttq_m_f16_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vcvt.narrow.predicated(<8 x half> [[A:%.*]], <4 x float> [[B:%.*]], i32 1, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x half> [[TMP2]]
+//
+float16x8_t test_vcvttq_m_f16_f32(float16x8_t a, float32x4_t b, mve_pred16_t p)
+{
+ return vcvttq_m_f16_f32(a, b, p);
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vector-shift-imm-dyadic.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vector-shift-imm-dyadic.c
new file mode 100644
index 0000000..c559139
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vector-shift-imm-dyadic.c
@@ -0,0 +1,1565 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vshrnbq_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 3, i32 0, i32 0, i32 0, i32 0, i32 0)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+int8x16_t test_vshrnbq_n_s16(int8x16_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vshrnbq(a, b, 3);
+#else /* POLYMORPHIC */
+ return vshrnbq_n_s16(a, b, 3);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshrnbq_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 9, i32 0, i32 0, i32 0, i32 0, i32 0)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vshrnbq_n_s32(int16x8_t a, int32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vshrnbq(a, b, 9);
+#else /* POLYMORPHIC */
+ return vshrnbq_n_s32(a, b, 9);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshrnbq_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 0, i32 0, i32 1, i32 1, i32 0)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vshrnbq_n_u16(uint8x16_t a, uint16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vshrnbq(a, b, 1);
+#else /* POLYMORPHIC */
+ return vshrnbq_n_u16(a, b, 1);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshrnbq_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 3, i32 0, i32 0, i32 1, i32 1, i32 0)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vshrnbq_n_u32(uint16x8_t a, uint32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vshrnbq(a, b, 3);
+#else /* POLYMORPHIC */
+ return vshrnbq_n_u32(a, b, 3);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshrntq_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 0, i32 0, i32 0, i32 0, i32 1)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+int8x16_t test_vshrntq_n_s16(int8x16_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vshrntq(a, b, 1);
+#else /* POLYMORPHIC */
+ return vshrntq_n_s16(a, b, 1);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshrntq_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 10, i32 0, i32 0, i32 0, i32 0, i32 1)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vshrntq_n_s32(int16x8_t a, int32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vshrntq(a, b, 10);
+#else /* POLYMORPHIC */
+ return vshrntq_n_s32(a, b, 10);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshrntq_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 6, i32 0, i32 0, i32 1, i32 1, i32 1)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vshrntq_n_u16(uint8x16_t a, uint16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vshrntq(a, b, 6);
+#else /* POLYMORPHIC */
+ return vshrntq_n_u16(a, b, 6);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshrntq_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 10, i32 0, i32 0, i32 1, i32 1, i32 1)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vshrntq_n_u32(uint16x8_t a, uint32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vshrntq(a, b, 10);
+#else /* POLYMORPHIC */
+ return vshrntq_n_u32(a, b, 10);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshrnbq_m_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 4, i32 0, i32 0, i32 0, i32 0, i32 0, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vshrnbq_m_n_s16(int8x16_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshrnbq_m(a, b, 4, p);
+#else /* POLYMORPHIC */
+ return vshrnbq_m_n_s16(a, b, 4, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshrnbq_m_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 13, i32 0, i32 0, i32 0, i32 0, i32 0, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vshrnbq_m_n_s32(int16x8_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshrnbq_m(a, b, 13, p);
+#else /* POLYMORPHIC */
+ return vshrnbq_m_n_s32(a, b, 13, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshrnbq_m_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 7, i32 0, i32 0, i32 1, i32 1, i32 0, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vshrnbq_m_n_u16(uint8x16_t a, uint16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshrnbq_m(a, b, 7, p);
+#else /* POLYMORPHIC */
+ return vshrnbq_m_n_u16(a, b, 7, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshrnbq_m_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 15, i32 0, i32 0, i32 1, i32 1, i32 0, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vshrnbq_m_n_u32(uint16x8_t a, uint32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshrnbq_m(a, b, 15, p);
+#else /* POLYMORPHIC */
+ return vshrnbq_m_n_u32(a, b, 15, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshrntq_m_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 6, i32 0, i32 0, i32 0, i32 0, i32 1, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vshrntq_m_n_s16(int8x16_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshrntq_m(a, b, 6, p);
+#else /* POLYMORPHIC */
+ return vshrntq_m_n_s16(a, b, 6, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshrntq_m_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 13, i32 0, i32 0, i32 0, i32 0, i32 1, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vshrntq_m_n_s32(int16x8_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshrntq_m(a, b, 13, p);
+#else /* POLYMORPHIC */
+ return vshrntq_m_n_s32(a, b, 13, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshrntq_m_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 0, i32 0, i32 1, i32 1, i32 1, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vshrntq_m_n_u16(uint8x16_t a, uint16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshrntq_m(a, b, 1, p);
+#else /* POLYMORPHIC */
+ return vshrntq_m_n_u16(a, b, 1, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshrntq_m_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 10, i32 0, i32 0, i32 1, i32 1, i32 1, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vshrntq_m_n_u32(uint16x8_t a, uint32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshrntq_m(a, b, 10, p);
+#else /* POLYMORPHIC */
+ return vshrntq_m_n_u32(a, b, 10, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshrnbq_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 5, i32 0, i32 1, i32 0, i32 0, i32 0)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+int8x16_t test_vrshrnbq_n_s16(int8x16_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vrshrnbq(a, b, 5);
+#else /* POLYMORPHIC */
+ return vrshrnbq_n_s16(a, b, 5);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshrnbq_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 10, i32 0, i32 1, i32 0, i32 0, i32 0)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vrshrnbq_n_s32(int16x8_t a, int32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vrshrnbq(a, b, 10);
+#else /* POLYMORPHIC */
+ return vrshrnbq_n_s32(a, b, 10);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshrnbq_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 2, i32 0, i32 1, i32 1, i32 1, i32 0)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vrshrnbq_n_u16(uint8x16_t a, uint16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vrshrnbq(a, b, 2);
+#else /* POLYMORPHIC */
+ return vrshrnbq_n_u16(a, b, 2);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshrnbq_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 12, i32 0, i32 1, i32 1, i32 1, i32 0)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vrshrnbq_n_u32(uint16x8_t a, uint32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vrshrnbq(a, b, 12);
+#else /* POLYMORPHIC */
+ return vrshrnbq_n_u32(a, b, 12);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshrntq_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 4, i32 0, i32 1, i32 0, i32 0, i32 1)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+int8x16_t test_vrshrntq_n_s16(int8x16_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vrshrntq(a, b, 4);
+#else /* POLYMORPHIC */
+ return vrshrntq_n_s16(a, b, 4);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshrntq_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 11, i32 0, i32 1, i32 0, i32 0, i32 1)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vrshrntq_n_s32(int16x8_t a, int32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vrshrntq(a, b, 11);
+#else /* POLYMORPHIC */
+ return vrshrntq_n_s32(a, b, 11);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshrntq_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 0, i32 1, i32 1, i32 1, i32 1)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vrshrntq_n_u16(uint8x16_t a, uint16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vrshrntq(a, b, 1);
+#else /* POLYMORPHIC */
+ return vrshrntq_n_u16(a, b, 1);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshrntq_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 6, i32 0, i32 1, i32 1, i32 1, i32 1)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vrshrntq_n_u32(uint16x8_t a, uint32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vrshrntq(a, b, 6);
+#else /* POLYMORPHIC */
+ return vrshrntq_n_u32(a, b, 6);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshrnbq_m_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 0, i32 1, i32 0, i32 0, i32 0, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vrshrnbq_m_n_s16(int8x16_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrshrnbq_m(a, b, 1, p);
+#else /* POLYMORPHIC */
+ return vrshrnbq_m_n_s16(a, b, 1, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshrnbq_m_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 14, i32 0, i32 1, i32 0, i32 0, i32 0, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vrshrnbq_m_n_s32(int16x8_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrshrnbq_m(a, b, 14, p);
+#else /* POLYMORPHIC */
+ return vrshrnbq_m_n_s32(a, b, 14, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshrnbq_m_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 2, i32 0, i32 1, i32 1, i32 1, i32 0, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vrshrnbq_m_n_u16(uint8x16_t a, uint16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrshrnbq_m(a, b, 2, p);
+#else /* POLYMORPHIC */
+ return vrshrnbq_m_n_u16(a, b, 2, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshrnbq_m_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 12, i32 0, i32 1, i32 1, i32 1, i32 0, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vrshrnbq_m_n_u32(uint16x8_t a, uint32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrshrnbq_m(a, b, 12, p);
+#else /* POLYMORPHIC */
+ return vrshrnbq_m_n_u32(a, b, 12, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshrntq_m_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 4, i32 0, i32 1, i32 0, i32 0, i32 1, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vrshrntq_m_n_s16(int8x16_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrshrntq_m(a, b, 4, p);
+#else /* POLYMORPHIC */
+ return vrshrntq_m_n_s16(a, b, 4, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshrntq_m_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 6, i32 0, i32 1, i32 0, i32 0, i32 1, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vrshrntq_m_n_s32(int16x8_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrshrntq_m(a, b, 6, p);
+#else /* POLYMORPHIC */
+ return vrshrntq_m_n_s32(a, b, 6, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshrntq_m_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 6, i32 0, i32 1, i32 1, i32 1, i32 1, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vrshrntq_m_n_u16(uint8x16_t a, uint16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrshrntq_m(a, b, 6, p);
+#else /* POLYMORPHIC */
+ return vrshrntq_m_n_u16(a, b, 6, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshrntq_m_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 10, i32 0, i32 1, i32 1, i32 1, i32 1, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vrshrntq_m_n_u32(uint16x8_t a, uint32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrshrntq_m(a, b, 10, p);
+#else /* POLYMORPHIC */
+ return vrshrntq_m_n_u32(a, b, 10, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshrnbq_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 7, i32 1, i32 0, i32 0, i32 0, i32 0)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+int8x16_t test_vqshrnbq_n_s16(int8x16_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vqshrnbq(a, b, 7);
+#else /* POLYMORPHIC */
+ return vqshrnbq_n_s16(a, b, 7);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshrnbq_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 15, i32 1, i32 0, i32 0, i32 0, i32 0)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vqshrnbq_n_s32(int16x8_t a, int32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vqshrnbq(a, b, 15);
+#else /* POLYMORPHIC */
+ return vqshrnbq_n_s32(a, b, 15);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshrnbq_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 3, i32 1, i32 0, i32 1, i32 1, i32 0)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vqshrnbq_n_u16(uint8x16_t a, uint16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vqshrnbq(a, b, 3);
+#else /* POLYMORPHIC */
+ return vqshrnbq_n_u16(a, b, 3);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshrnbq_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 3, i32 1, i32 0, i32 1, i32 1, i32 0)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vqshrnbq_n_u32(uint16x8_t a, uint32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vqshrnbq(a, b, 3);
+#else /* POLYMORPHIC */
+ return vqshrnbq_n_u32(a, b, 3);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshrntq_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 5, i32 1, i32 0, i32 0, i32 0, i32 1)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+int8x16_t test_vqshrntq_n_s16(int8x16_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vqshrntq(a, b, 5);
+#else /* POLYMORPHIC */
+ return vqshrntq_n_s16(a, b, 5);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshrntq_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 6, i32 1, i32 0, i32 0, i32 0, i32 1)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vqshrntq_n_s32(int16x8_t a, int32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vqshrntq(a, b, 6);
+#else /* POLYMORPHIC */
+ return vqshrntq_n_s32(a, b, 6);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshrntq_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 1, i32 0, i32 1, i32 1, i32 1)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vqshrntq_n_u16(uint8x16_t a, uint16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vqshrntq(a, b, 1);
+#else /* POLYMORPHIC */
+ return vqshrntq_n_u16(a, b, 1);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshrntq_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 15, i32 1, i32 0, i32 1, i32 1, i32 1)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vqshrntq_n_u32(uint16x8_t a, uint32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vqshrntq(a, b, 15);
+#else /* POLYMORPHIC */
+ return vqshrntq_n_u32(a, b, 15);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshrnbq_m_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 7, i32 1, i32 0, i32 0, i32 0, i32 0, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vqshrnbq_m_n_s16(int8x16_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqshrnbq_m(a, b, 7, p);
+#else /* POLYMORPHIC */
+ return vqshrnbq_m_n_s16(a, b, 7, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshrnbq_m_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, i32 1, i32 0, i32 0, i32 0, i32 0, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vqshrnbq_m_n_s32(int16x8_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqshrnbq_m(a, b, 1, p);
+#else /* POLYMORPHIC */
+ return vqshrnbq_m_n_s32(a, b, 1, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshrnbq_m_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 1, i32 0, i32 1, i32 1, i32 0, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vqshrnbq_m_n_u16(uint8x16_t a, uint16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqshrnbq_m(a, b, 1, p);
+#else /* POLYMORPHIC */
+ return vqshrnbq_m_n_u16(a, b, 1, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshrnbq_m_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 8, i32 1, i32 0, i32 1, i32 1, i32 0, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vqshrnbq_m_n_u32(uint16x8_t a, uint32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqshrnbq_m(a, b, 8, p);
+#else /* POLYMORPHIC */
+ return vqshrnbq_m_n_u32(a, b, 8, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshrntq_m_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 1, i32 0, i32 0, i32 0, i32 1, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vqshrntq_m_n_s16(int8x16_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqshrntq_m(a, b, 1, p);
+#else /* POLYMORPHIC */
+ return vqshrntq_m_n_s16(a, b, 1, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshrntq_m_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 11, i32 1, i32 0, i32 0, i32 0, i32 1, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vqshrntq_m_n_s32(int16x8_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqshrntq_m(a, b, 11, p);
+#else /* POLYMORPHIC */
+ return vqshrntq_m_n_s32(a, b, 11, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshrntq_m_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 3, i32 1, i32 0, i32 1, i32 1, i32 1, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vqshrntq_m_n_u16(uint8x16_t a, uint16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqshrntq_m(a, b, 3, p);
+#else /* POLYMORPHIC */
+ return vqshrntq_m_n_u16(a, b, 3, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshrntq_m_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, i32 1, i32 0, i32 1, i32 1, i32 1, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vqshrntq_m_n_u32(uint16x8_t a, uint32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqshrntq_m(a, b, 1, p);
+#else /* POLYMORPHIC */
+ return vqshrntq_m_n_u32(a, b, 1, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshrunbq_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 5, i32 1, i32 0, i32 1, i32 0, i32 0)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vqshrunbq_n_s16(uint8x16_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vqshrunbq(a, b, 5);
+#else /* POLYMORPHIC */
+ return vqshrunbq_n_s16(a, b, 5);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshrunbq_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 13, i32 1, i32 0, i32 1, i32 0, i32 0)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vqshrunbq_n_s32(uint16x8_t a, int32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vqshrunbq(a, b, 13);
+#else /* POLYMORPHIC */
+ return vqshrunbq_n_s32(a, b, 13);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshruntq_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 2, i32 1, i32 0, i32 1, i32 0, i32 1)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vqshruntq_n_s16(uint8x16_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vqshruntq(a, b, 2);
+#else /* POLYMORPHIC */
+ return vqshruntq_n_s16(a, b, 2);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshruntq_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 7, i32 1, i32 0, i32 1, i32 0, i32 1)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vqshruntq_n_s32(uint16x8_t a, int32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vqshruntq(a, b, 7);
+#else /* POLYMORPHIC */
+ return vqshruntq_n_s32(a, b, 7);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshrunbq_m_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 7, i32 1, i32 0, i32 1, i32 0, i32 0, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vqshrunbq_m_n_s16(uint8x16_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqshrunbq_m(a, b, 7, p);
+#else /* POLYMORPHIC */
+ return vqshrunbq_m_n_s16(a, b, 7, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshrunbq_m_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 7, i32 1, i32 0, i32 1, i32 0, i32 0, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vqshrunbq_m_n_s32(uint16x8_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqshrunbq_m(a, b, 7, p);
+#else /* POLYMORPHIC */
+ return vqshrunbq_m_n_s32(a, b, 7, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshruntq_m_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 7, i32 1, i32 0, i32 1, i32 0, i32 1, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vqshruntq_m_n_s16(uint8x16_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqshruntq_m(a, b, 7, p);
+#else /* POLYMORPHIC */
+ return vqshruntq_m_n_s16(a, b, 7, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshruntq_m_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 7, i32 1, i32 0, i32 1, i32 0, i32 1, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vqshruntq_m_n_s32(uint16x8_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqshruntq_m(a, b, 7, p);
+#else /* POLYMORPHIC */
+ return vqshruntq_m_n_s32(a, b, 7, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshrnbq_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 5, i32 1, i32 1, i32 0, i32 0, i32 0)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+int8x16_t test_vqrshrnbq_n_s16(int8x16_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vqrshrnbq(a, b, 5);
+#else /* POLYMORPHIC */
+ return vqrshrnbq_n_s16(a, b, 5);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshrnbq_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 13, i32 1, i32 1, i32 0, i32 0, i32 0)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vqrshrnbq_n_s32(int16x8_t a, int32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vqrshrnbq(a, b, 13);
+#else /* POLYMORPHIC */
+ return vqrshrnbq_n_s32(a, b, 13);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshrnbq_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 7, i32 1, i32 1, i32 1, i32 1, i32 0)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vqrshrnbq_n_u16(uint8x16_t a, uint16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vqrshrnbq(a, b, 7);
+#else /* POLYMORPHIC */
+ return vqrshrnbq_n_u16(a, b, 7);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshrnbq_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 8, i32 1, i32 1, i32 1, i32 1, i32 0)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vqrshrnbq_n_u32(uint16x8_t a, uint32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vqrshrnbq(a, b, 8);
+#else /* POLYMORPHIC */
+ return vqrshrnbq_n_u32(a, b, 8);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshrntq_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 7, i32 1, i32 1, i32 0, i32 0, i32 1)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+int8x16_t test_vqrshrntq_n_s16(int8x16_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vqrshrntq(a, b, 7);
+#else /* POLYMORPHIC */
+ return vqrshrntq_n_s16(a, b, 7);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshrntq_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 2, i32 1, i32 1, i32 0, i32 0, i32 1)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vqrshrntq_n_s32(int16x8_t a, int32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vqrshrntq(a, b, 2);
+#else /* POLYMORPHIC */
+ return vqrshrntq_n_s32(a, b, 2);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshrntq_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 1, i32 1, i32 1, i32 1, i32 1)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vqrshrntq_n_u16(uint8x16_t a, uint16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vqrshrntq(a, b, 1);
+#else /* POLYMORPHIC */
+ return vqrshrntq_n_u16(a, b, 1);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshrntq_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 11, i32 1, i32 1, i32 1, i32 1, i32 1)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vqrshrntq_n_u32(uint16x8_t a, uint32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vqrshrntq(a, b, 11);
+#else /* POLYMORPHIC */
+ return vqrshrntq_n_u32(a, b, 11);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshrnbq_m_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 2, i32 1, i32 1, i32 0, i32 0, i32 0, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vqrshrnbq_m_n_s16(int8x16_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqrshrnbq_m(a, b, 2, p);
+#else /* POLYMORPHIC */
+ return vqrshrnbq_m_n_s16(a, b, 2, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshrnbq_m_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 12, i32 1, i32 1, i32 0, i32 0, i32 0, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vqrshrnbq_m_n_s32(int16x8_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqrshrnbq_m(a, b, 12, p);
+#else /* POLYMORPHIC */
+ return vqrshrnbq_m_n_s32(a, b, 12, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshrnbq_m_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 5, i32 1, i32 1, i32 1, i32 1, i32 0, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vqrshrnbq_m_n_u16(uint8x16_t a, uint16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqrshrnbq_m(a, b, 5, p);
+#else /* POLYMORPHIC */
+ return vqrshrnbq_m_n_u16(a, b, 5, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshrnbq_m_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 11, i32 1, i32 1, i32 1, i32 1, i32 0, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vqrshrnbq_m_n_u32(uint16x8_t a, uint32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqrshrnbq_m(a, b, 11, p);
+#else /* POLYMORPHIC */
+ return vqrshrnbq_m_n_u32(a, b, 11, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshrntq_m_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 4, i32 1, i32 1, i32 0, i32 0, i32 1, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vqrshrntq_m_n_s16(int8x16_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqrshrntq_m(a, b, 4, p);
+#else /* POLYMORPHIC */
+ return vqrshrntq_m_n_s16(a, b, 4, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshrntq_m_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 6, i32 1, i32 1, i32 0, i32 0, i32 1, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vqrshrntq_m_n_s32(int16x8_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqrshrntq_m(a, b, 6, p);
+#else /* POLYMORPHIC */
+ return vqrshrntq_m_n_s32(a, b, 6, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshrntq_m_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 7, i32 1, i32 1, i32 1, i32 1, i32 1, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vqrshrntq_m_n_u16(uint8x16_t a, uint16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqrshrntq_m(a, b, 7, p);
+#else /* POLYMORPHIC */
+ return vqrshrntq_m_n_u16(a, b, 7, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshrntq_m_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 15, i32 1, i32 1, i32 1, i32 1, i32 1, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vqrshrntq_m_n_u32(uint16x8_t a, uint32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqrshrntq_m(a, b, 15, p);
+#else /* POLYMORPHIC */
+ return vqrshrntq_m_n_u32(a, b, 15, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshrunbq_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 7, i32 1, i32 1, i32 1, i32 0, i32 0)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vqrshrunbq_n_s16(uint8x16_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vqrshrunbq(a, b, 7);
+#else /* POLYMORPHIC */
+ return vqrshrunbq_n_s16(a, b, 7);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshrunbq_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, i32 1, i32 1, i32 1, i32 0, i32 0)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vqrshrunbq_n_s32(uint16x8_t a, int32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vqrshrunbq(a, b, 1);
+#else /* POLYMORPHIC */
+ return vqrshrunbq_n_s32(a, b, 1);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshruntq_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 1, i32 1, i32 1, i32 0, i32 1)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vqrshruntq_n_s16(uint8x16_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vqrshruntq(a, b, 1);
+#else /* POLYMORPHIC */
+ return vqrshruntq_n_s16(a, b, 1);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshruntq_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 3, i32 1, i32 1, i32 1, i32 0, i32 1)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vqrshruntq_n_s32(uint16x8_t a, int32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vqrshruntq(a, b, 3);
+#else /* POLYMORPHIC */
+ return vqrshruntq_n_s32(a, b, 3);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshrunbq_m_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 4, i32 1, i32 1, i32 1, i32 0, i32 0, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vqrshrunbq_m_n_s16(uint8x16_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqrshrunbq_m(a, b, 4, p);
+#else /* POLYMORPHIC */
+ return vqrshrunbq_m_n_s16(a, b, 4, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshrunbq_m_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 10, i32 1, i32 1, i32 1, i32 0, i32 0, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vqrshrunbq_m_n_s32(uint16x8_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqrshrunbq_m(a, b, 10, p);
+#else /* POLYMORPHIC */
+ return vqrshrunbq_m_n_s32(a, b, 10, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshruntq_m_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 3, i32 1, i32 1, i32 1, i32 0, i32 1, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vqrshruntq_m_n_s16(uint8x16_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqrshruntq_m(a, b, 3, p);
+#else /* POLYMORPHIC */
+ return vqrshruntq_m_n_s16(a, b, 3, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshruntq_m_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 13, i32 1, i32 1, i32 1, i32 0, i32 1, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vqrshruntq_m_n_s32(uint16x8_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqrshruntq_m(a, b, 13, p);
+#else /* POLYMORPHIC */
+ return vqrshruntq_m_n_s32(a, b, 13, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vsliq_n_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vsli.v16i8(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 2)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+int8x16_t test_vsliq_n_s8(int8x16_t a, int8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vsliq(a, b, 2);
+#else /* POLYMORPHIC */
+ return vsliq_n_s8(a, b, 2);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vsliq_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vsli.v8i16(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 10)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vsliq_n_s16(int16x8_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vsliq(a, b, 10);
+#else /* POLYMORPHIC */
+ return vsliq_n_s16(a, b, 10);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vsliq_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vsli.v4i32(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+int32x4_t test_vsliq_n_s32(int32x4_t a, int32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vsliq(a, b, 1);
+#else /* POLYMORPHIC */
+ return vsliq_n_s32(a, b, 1);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vsliq_n_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vsli.v16i8(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 1)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vsliq_n_u8(uint8x16_t a, uint8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vsliq(a, b, 1);
+#else /* POLYMORPHIC */
+ return vsliq_n_u8(a, b, 1);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vsliq_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vsli.v8i16(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vsliq_n_u16(uint16x8_t a, uint16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vsliq(a, b, 1);
+#else /* POLYMORPHIC */
+ return vsliq_n_u16(a, b, 1);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vsliq_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vsli.v4i32(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 28)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vsliq_n_u32(uint32x4_t a, uint32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vsliq(a, b, 28);
+#else /* POLYMORPHIC */
+ return vsliq_n_u32(a, b, 28);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vsliq_m_n_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vsli.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 4, <16 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vsliq_m_n_s8(int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vsliq_m(a, b, 4, p);
+#else /* POLYMORPHIC */
+ return vsliq_m_n_s8(a, b, 4, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vsliq_m_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vsli.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vsliq_m_n_s16(int16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vsliq_m(a, b, 1, p);
+#else /* POLYMORPHIC */
+ return vsliq_m_n_s16(a, b, 1, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vsliq_m_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vsli.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vsliq_m_n_s32(int32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vsliq_m(a, b, 1, p);
+#else /* POLYMORPHIC */
+ return vsliq_m_n_s32(a, b, 1, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vsliq_m_n_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vsli.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 5, <16 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vsliq_m_n_u8(uint8x16_t a, uint8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vsliq_m(a, b, 5, p);
+#else /* POLYMORPHIC */
+ return vsliq_m_n_u8(a, b, 5, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vsliq_m_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vsli.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 3, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vsliq_m_n_u16(uint16x8_t a, uint16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vsliq_m(a, b, 3, p);
+#else /* POLYMORPHIC */
+ return vsliq_m_n_u16(a, b, 3, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vsliq_m_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vsli.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 9, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vsliq_m_n_u32(uint32x4_t a, uint32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vsliq_m(a, b, 9, p);
+#else /* POLYMORPHIC */
+ return vsliq_m_n_u32(a, b, 9, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vsriq_n_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vsri.v16i8(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 3)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+int8x16_t test_vsriq_n_s8(int8x16_t a, int8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vsriq(a, b, 3);
+#else /* POLYMORPHIC */
+ return vsriq_n_s8(a, b, 3);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vsriq_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vsri.v8i16(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 2)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vsriq_n_s16(int16x8_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vsriq(a, b, 2);
+#else /* POLYMORPHIC */
+ return vsriq_n_s16(a, b, 2);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vsriq_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vsri.v4i32(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 28)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+int32x4_t test_vsriq_n_s32(int32x4_t a, int32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vsriq(a, b, 28);
+#else /* POLYMORPHIC */
+ return vsriq_n_s32(a, b, 28);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vsriq_n_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vsri.v16i8(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 3)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vsriq_n_u8(uint8x16_t a, uint8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vsriq(a, b, 3);
+#else /* POLYMORPHIC */
+ return vsriq_n_u8(a, b, 3);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vsriq_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vsri.v8i16(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 3)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vsriq_n_u16(uint16x8_t a, uint16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vsriq(a, b, 3);
+#else /* POLYMORPHIC */
+ return vsriq_n_u16(a, b, 3);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vsriq_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vsri.v4i32(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 26)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vsriq_n_u32(uint32x4_t a, uint32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vsriq(a, b, 26);
+#else /* POLYMORPHIC */
+ return vsriq_n_u32(a, b, 26);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vsriq_m_n_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vsri.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 4, <16 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vsriq_m_n_s8(int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vsriq_m(a, b, 4, p);
+#else /* POLYMORPHIC */
+ return vsriq_m_n_s8(a, b, 4, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vsriq_m_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vsri.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vsriq_m_n_s16(int16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vsriq_m(a, b, 1, p);
+#else /* POLYMORPHIC */
+ return vsriq_m_n_s16(a, b, 1, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vsriq_m_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vsri.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 27, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vsriq_m_n_s32(int32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vsriq_m(a, b, 27, p);
+#else /* POLYMORPHIC */
+ return vsriq_m_n_s32(a, b, 27, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vsriq_m_n_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vsri.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 7, <16 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vsriq_m_n_u8(uint8x16_t a, uint8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vsriq_m(a, b, 7, p);
+#else /* POLYMORPHIC */
+ return vsriq_m_n_u8(a, b, 7, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vsriq_m_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vsri.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 9, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vsriq_m_n_u16(uint16x8_t a, uint16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vsriq_m(a, b, 9, p);
+#else /* POLYMORPHIC */
+ return vsriq_m_n_u16(a, b, 9, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vsriq_m_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vsri.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 13, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vsriq_m_n_u32(uint32x4_t a, uint32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vsriq_m(a, b, 13, p);
+#else /* POLYMORPHIC */
+ return vsriq_m_n_u32(a, b, 13, p);
+#endif /* POLYMORPHIC */
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vector-shift-imm.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vector-shift-imm.c
new file mode 100644
index 0000000..2128d08
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vector-shift-imm.c
@@ -0,0 +1,1637 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vshlq_n_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = shl <16 x i8> [[A:%.*]], <i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5>
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+int8x16_t test_vshlq_n_s8(int8x16_t a)
+{
+#ifdef POLYMORPHIC
+ return vshlq_n(a, 5);
+#else /* POLYMORPHIC */
+ return vshlq_n_s8(a, 5);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = shl <8 x i16> [[A:%.*]], <i16 5, i16 5, i16 5, i16 5, i16 5, i16 5, i16 5, i16 5>
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vshlq_n_s16(int16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vshlq_n(a, 5);
+#else /* POLYMORPHIC */
+ return vshlq_n_s16(a, 5);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = shl <4 x i32> [[A:%.*]], <i32 18, i32 18, i32 18, i32 18>
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+int32x4_t test_vshlq_n_s32(int32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vshlq_n(a, 18);
+#else /* POLYMORPHIC */
+ return vshlq_n_s32(a, 18);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_n_s8_trivial(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = shl <16 x i8> [[A:%.*]], zeroinitializer
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+int8x16_t test_vshlq_n_s8_trivial(int8x16_t a)
+{
+#ifdef POLYMORPHIC
+ return vshlq_n(a, 0);
+#else /* POLYMORPHIC */
+ return vshlq_n_s8(a, 0);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_n_s16_trivial(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = shl <8 x i16> [[A:%.*]], zeroinitializer
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vshlq_n_s16_trivial(int16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vshlq_n(a, 0);
+#else /* POLYMORPHIC */
+ return vshlq_n_s16(a, 0);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_n_s32_trivial(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = shl <4 x i32> [[A:%.*]], zeroinitializer
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+int32x4_t test_vshlq_n_s32_trivial(int32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vshlq_n(a, 0);
+#else /* POLYMORPHIC */
+ return vshlq_n_s32(a, 0);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_n_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = shl <16 x i8> [[A:%.*]], <i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3>
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vshlq_n_u8(uint8x16_t a)
+{
+#ifdef POLYMORPHIC
+ return vshlq_n(a, 3);
+#else /* POLYMORPHIC */
+ return vshlq_n_u8(a, 3);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = shl <8 x i16> [[A:%.*]], <i16 11, i16 11, i16 11, i16 11, i16 11, i16 11, i16 11, i16 11>
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vshlq_n_u16(uint16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vshlq_n(a, 11);
+#else /* POLYMORPHIC */
+ return vshlq_n_u16(a, 11);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = shl <4 x i32> [[A:%.*]], <i32 7, i32 7, i32 7, i32 7>
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vshlq_n_u32(uint32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vshlq_n(a, 7);
+#else /* POLYMORPHIC */
+ return vshlq_n_u32(a, 7);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_n_u8_trivial(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = shl <16 x i8> [[A:%.*]], zeroinitializer
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vshlq_n_u8_trivial(uint8x16_t a)
+{
+#ifdef POLYMORPHIC
+ return vshlq_n(a, 0);
+#else /* POLYMORPHIC */
+ return vshlq_n_u8(a, 0);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_n_u16_trivial(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = shl <8 x i16> [[A:%.*]], zeroinitializer
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vshlq_n_u16_trivial(uint16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vshlq_n(a, 0);
+#else /* POLYMORPHIC */
+ return vshlq_n_u16(a, 0);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_n_u32_trivial(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = shl <4 x i32> [[A:%.*]], zeroinitializer
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vshlq_n_u32_trivial(uint32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vshlq_n(a, 0);
+#else /* POLYMORPHIC */
+ return vshlq_n_u32(a, 0);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshrq_n_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = ashr <16 x i8> [[A:%.*]], <i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4>
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+int8x16_t test_vshrq_n_s8(int8x16_t a)
+{
+#ifdef POLYMORPHIC
+ return vshrq(a, 4);
+#else /* POLYMORPHIC */
+ return vshrq_n_s8(a, 4);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshrq_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = ashr <8 x i16> [[A:%.*]], <i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10>
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vshrq_n_s16(int16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vshrq(a, 10);
+#else /* POLYMORPHIC */
+ return vshrq_n_s16(a, 10);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshrq_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = ashr <4 x i32> [[A:%.*]], <i32 19, i32 19, i32 19, i32 19>
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+int32x4_t test_vshrq_n_s32(int32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vshrq(a, 19);
+#else /* POLYMORPHIC */
+ return vshrq_n_s32(a, 19);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshrq_n_s8_trivial(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = ashr <16 x i8> [[A:%.*]], <i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7>
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+int8x16_t test_vshrq_n_s8_trivial(int8x16_t a)
+{
+#ifdef POLYMORPHIC
+ return vshrq(a, 8);
+#else /* POLYMORPHIC */
+ return vshrq_n_s8(a, 8);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshrq_n_s16_trivial(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = ashr <8 x i16> [[A:%.*]], <i16 15, i16 15, i16 15, i16 15, i16 15, i16 15, i16 15, i16 15>
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vshrq_n_s16_trivial(int16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vshrq(a, 16);
+#else /* POLYMORPHIC */
+ return vshrq_n_s16(a, 16);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshrq_n_s32_trivial(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = ashr <4 x i32> [[A:%.*]], <i32 31, i32 31, i32 31, i32 31>
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+int32x4_t test_vshrq_n_s32_trivial(int32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vshrq(a, 32);
+#else /* POLYMORPHIC */
+ return vshrq_n_s32(a, 32);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshrq_n_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr <16 x i8> [[A:%.*]], <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vshrq_n_u8(uint8x16_t a)
+{
+#ifdef POLYMORPHIC
+ return vshrq(a, 1);
+#else /* POLYMORPHIC */
+ return vshrq_n_u8(a, 1);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshrq_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr <8 x i16> [[A:%.*]], <i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10>
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vshrq_n_u16(uint16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vshrq(a, 10);
+#else /* POLYMORPHIC */
+ return vshrq_n_u16(a, 10);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshrq_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr <4 x i32> [[A:%.*]], <i32 10, i32 10, i32 10, i32 10>
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vshrq_n_u32(uint32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vshrq(a, 10);
+#else /* POLYMORPHIC */
+ return vshrq_n_u32(a, 10);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshrq_n_u8_trivial(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: ret <16 x i8> zeroinitializer
+//
+uint8x16_t test_vshrq_n_u8_trivial(uint8x16_t a)
+{
+#ifdef POLYMORPHIC
+ return vshrq(a, 8);
+#else /* POLYMORPHIC */
+ return vshrq_n_u8(a, 8);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshrq_n_u16_trivial(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: ret <8 x i16> zeroinitializer
+//
+uint16x8_t test_vshrq_n_u16_trivial(uint16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vshrq(a, 16);
+#else /* POLYMORPHIC */
+ return vshrq_n_u16(a, 16);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshrq_n_u32_trivial(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: ret <4 x i32> zeroinitializer
+//
+uint32x4_t test_vshrq_n_u32_trivial(uint32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vshrq(a, 32);
+#else /* POLYMORPHIC */
+ return vshrq_n_u32(a, 32);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_m_n_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.shl.imm.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 6, <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vshlq_m_n_s8(int8x16_t inactive, int8x16_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshlq_m_n(inactive, a, 6, p);
+#else /* POLYMORPHIC */
+ return vshlq_m_n_s8(inactive, a, 6, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_m_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.shl.imm.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], i32 13, <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vshlq_m_n_s16(int16x8_t inactive, int16x8_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshlq_m_n(inactive, a, 13, p);
+#else /* POLYMORPHIC */
+ return vshlq_m_n_s16(inactive, a, 13, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_m_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.shl.imm.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], i32 0, <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vshlq_m_n_s32(int32x4_t inactive, int32x4_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshlq_m_n(inactive, a, 0, p);
+#else /* POLYMORPHIC */
+ return vshlq_m_n_s32(inactive, a, 0, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_m_n_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.shl.imm.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 3, <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vshlq_m_n_u8(uint8x16_t inactive, uint8x16_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshlq_m_n(inactive, a, 3, p);
+#else /* POLYMORPHIC */
+ return vshlq_m_n_u8(inactive, a, 3, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_m_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.shl.imm.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], i32 1, <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vshlq_m_n_u16(uint16x8_t inactive, uint16x8_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshlq_m_n(inactive, a, 1, p);
+#else /* POLYMORPHIC */
+ return vshlq_m_n_u16(inactive, a, 1, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_m_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.shl.imm.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], i32 24, <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vshlq_m_n_u32(uint32x4_t inactive, uint32x4_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshlq_m_n(inactive, a, 24, p);
+#else /* POLYMORPHIC */
+ return vshlq_m_n_u32(inactive, a, 24, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshrq_m_n_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.shr.imm.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 2, i32 0, <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vshrq_m_n_s8(int8x16_t inactive, int8x16_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshrq_m(inactive, a, 2, p);
+#else /* POLYMORPHIC */
+ return vshrq_m_n_s8(inactive, a, 2, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshrq_m_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.shr.imm.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], i32 3, i32 0, <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vshrq_m_n_s16(int16x8_t inactive, int16x8_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshrq_m(inactive, a, 3, p);
+#else /* POLYMORPHIC */
+ return vshrq_m_n_s16(inactive, a, 3, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshrq_m_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.shr.imm.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], i32 13, i32 0, <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vshrq_m_n_s32(int32x4_t inactive, int32x4_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshrq_m(inactive, a, 13, p);
+#else /* POLYMORPHIC */
+ return vshrq_m_n_s32(inactive, a, 13, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshrq_m_n_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.shr.imm.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 4, i32 1, <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vshrq_m_n_u8(uint8x16_t inactive, uint8x16_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshrq_m(inactive, a, 4, p);
+#else /* POLYMORPHIC */
+ return vshrq_m_n_u8(inactive, a, 4, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshrq_m_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.shr.imm.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], i32 14, i32 1, <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vshrq_m_n_u16(uint16x8_t inactive, uint16x8_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshrq_m(inactive, a, 14, p);
+#else /* POLYMORPHIC */
+ return vshrq_m_n_u16(inactive, a, 14, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshrq_m_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.shr.imm.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], i32 21, i32 1, <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vshrq_m_n_u32(uint32x4_t inactive, uint32x4_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshrq_m(inactive, a, 21, p);
+#else /* POLYMORPHIC */
+ return vshrq_m_n_u32(inactive, a, 21, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_x_n_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.shl.imm.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 1, <16 x i1> [[TMP1]], <16 x i8> undef)
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vshlq_x_n_s8(int8x16_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshlq_x_n(a, 1, p);
+#else /* POLYMORPHIC */
+ return vshlq_x_n_s8(a, 1, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_x_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.shl.imm.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], i32 15, <8 x i1> [[TMP1]], <8 x i16> undef)
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vshlq_x_n_s16(int16x8_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshlq_x_n(a, 15, p);
+#else /* POLYMORPHIC */
+ return vshlq_x_n_s16(a, 15, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_x_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.shl.imm.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], i32 13, <4 x i1> [[TMP1]], <4 x i32> undef)
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vshlq_x_n_s32(int32x4_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshlq_x_n(a, 13, p);
+#else /* POLYMORPHIC */
+ return vshlq_x_n_s32(a, 13, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_x_n_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.shl.imm.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 4, <16 x i1> [[TMP1]], <16 x i8> undef)
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vshlq_x_n_u8(uint8x16_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshlq_x_n(a, 4, p);
+#else /* POLYMORPHIC */
+ return vshlq_x_n_u8(a, 4, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_x_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.shl.imm.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], i32 10, <8 x i1> [[TMP1]], <8 x i16> undef)
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vshlq_x_n_u16(uint16x8_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshlq_x_n(a, 10, p);
+#else /* POLYMORPHIC */
+ return vshlq_x_n_u16(a, 10, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_x_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.shl.imm.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], i32 30, <4 x i1> [[TMP1]], <4 x i32> undef)
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vshlq_x_n_u32(uint32x4_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshlq_x_n(a, 30, p);
+#else /* POLYMORPHIC */
+ return vshlq_x_n_u32(a, 30, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshrq_x_n_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.shr.imm.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 4, i32 0, <16 x i1> [[TMP1]], <16 x i8> undef)
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vshrq_x_n_s8(int8x16_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshrq_x(a, 4, p);
+#else /* POLYMORPHIC */
+ return vshrq_x_n_s8(a, 4, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshrq_x_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.shr.imm.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], i32 10, i32 0, <8 x i1> [[TMP1]], <8 x i16> undef)
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vshrq_x_n_s16(int16x8_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshrq_x(a, 10, p);
+#else /* POLYMORPHIC */
+ return vshrq_x_n_s16(a, 10, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshrq_x_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.shr.imm.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], i32 7, i32 0, <4 x i1> [[TMP1]], <4 x i32> undef)
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vshrq_x_n_s32(int32x4_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshrq_x(a, 7, p);
+#else /* POLYMORPHIC */
+ return vshrq_x_n_s32(a, 7, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshrq_x_n_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.shr.imm.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 7, i32 1, <16 x i1> [[TMP1]], <16 x i8> undef)
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vshrq_x_n_u8(uint8x16_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshrq_x(a, 7, p);
+#else /* POLYMORPHIC */
+ return vshrq_x_n_u8(a, 7, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshrq_x_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.shr.imm.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], i32 7, i32 1, <8 x i1> [[TMP1]], <8 x i16> undef)
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vshrq_x_n_u16(uint16x8_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshrq_x(a, 7, p);
+#else /* POLYMORPHIC */
+ return vshrq_x_n_u16(a, 7, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshrq_x_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.shr.imm.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], i32 6, i32 1, <4 x i1> [[TMP1]], <4 x i32> undef)
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vshrq_x_n_u32(uint32x4_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshrq_x(a, 6, p);
+#else /* POLYMORPHIC */
+ return vshrq_x_n_u32(a, 6, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshlq_n_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vqshl.imm.v16i8(<16 x i8> [[A:%.*]], i32 3, i32 0)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+int8x16_t test_vqshlq_n_s8(int8x16_t a)
+{
+#ifdef POLYMORPHIC
+ return vqshlq_n(a, 3);
+#else /* POLYMORPHIC */
+ return vqshlq_n_s8(a, 3);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshlq_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vqshl.imm.v8i16(<8 x i16> [[A:%.*]], i32 4, i32 0)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vqshlq_n_s16(int16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vqshlq_n(a, 4);
+#else /* POLYMORPHIC */
+ return vqshlq_n_s16(a, 4);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshlq_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vqshl.imm.v4i32(<4 x i32> [[A:%.*]], i32 4, i32 0)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+int32x4_t test_vqshlq_n_s32(int32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vqshlq_n(a, 4);
+#else /* POLYMORPHIC */
+ return vqshlq_n_s32(a, 4);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshlq_n_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vqshl.imm.v16i8(<16 x i8> [[A:%.*]], i32 0, i32 1)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vqshlq_n_u8(uint8x16_t a)
+{
+#ifdef POLYMORPHIC
+ return vqshlq_n(a, 0);
+#else /* POLYMORPHIC */
+ return vqshlq_n_u8(a, 0);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshlq_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vqshl.imm.v8i16(<8 x i16> [[A:%.*]], i32 13, i32 1)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vqshlq_n_u16(uint16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vqshlq_n(a, 13);
+#else /* POLYMORPHIC */
+ return vqshlq_n_u16(a, 13);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshlq_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vqshl.imm.v4i32(<4 x i32> [[A:%.*]], i32 6, i32 1)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vqshlq_n_u32(uint32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vqshlq_n(a, 6);
+#else /* POLYMORPHIC */
+ return vqshlq_n_u32(a, 6);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshluq_n_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vqshlu.imm.v16i8(<16 x i8> [[A:%.*]], i32 5)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vqshluq_n_s8(int8x16_t a)
+{
+#ifdef POLYMORPHIC
+ return vqshluq(a, 5);
+#else /* POLYMORPHIC */
+ return vqshluq_n_s8(a, 5);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshluq_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vqshlu.imm.v8i16(<8 x i16> [[A:%.*]], i32 5)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vqshluq_n_s16(int16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vqshluq(a, 5);
+#else /* POLYMORPHIC */
+ return vqshluq_n_s16(a, 5);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshluq_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vqshlu.imm.v4i32(<4 x i32> [[A:%.*]], i32 4)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vqshluq_n_s32(int32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vqshluq(a, 4);
+#else /* POLYMORPHIC */
+ return vqshluq_n_s32(a, 4);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshrq_n_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vrshr.imm.v16i8(<16 x i8> [[A:%.*]], i32 4, i32 0)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+int8x16_t test_vrshrq_n_s8(int8x16_t a)
+{
+#ifdef POLYMORPHIC
+ return vrshrq(a, 4);
+#else /* POLYMORPHIC */
+ return vrshrq_n_s8(a, 4);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshrq_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vrshr.imm.v8i16(<8 x i16> [[A:%.*]], i32 12, i32 0)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vrshrq_n_s16(int16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vrshrq(a, 12);
+#else /* POLYMORPHIC */
+ return vrshrq_n_s16(a, 12);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshrq_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vrshr.imm.v4i32(<4 x i32> [[A:%.*]], i32 30, i32 0)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+int32x4_t test_vrshrq_n_s32(int32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vrshrq(a, 30);
+#else /* POLYMORPHIC */
+ return vrshrq_n_s32(a, 30);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshrq_n_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vrshr.imm.v16i8(<16 x i8> [[A:%.*]], i32 1, i32 1)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vrshrq_n_u8(uint8x16_t a)
+{
+#ifdef POLYMORPHIC
+ return vrshrq(a, 1);
+#else /* POLYMORPHIC */
+ return vrshrq_n_u8(a, 1);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshrq_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vrshr.imm.v8i16(<8 x i16> [[A:%.*]], i32 15, i32 1)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vrshrq_n_u16(uint16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vrshrq(a, 15);
+#else /* POLYMORPHIC */
+ return vrshrq_n_u16(a, 15);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshrq_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vrshr.imm.v4i32(<4 x i32> [[A:%.*]], i32 20, i32 1)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vrshrq_n_u32(uint32x4_t a)
+{
+#ifdef POLYMORPHIC
+ return vrshrq(a, 20);
+#else /* POLYMORPHIC */
+ return vrshrq_n_u32(a, 20);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshlq_m_n_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vqshl.imm.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 6, i32 0, <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vqshlq_m_n_s8(int8x16_t inactive, int8x16_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqshlq_m_n(inactive, a, 6, p);
+#else /* POLYMORPHIC */
+ return vqshlq_m_n_s8(inactive, a, 6, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshlq_m_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vqshl.imm.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], i32 13, i32 0, <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vqshlq_m_n_s16(int16x8_t inactive, int16x8_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqshlq_m_n(inactive, a, 13, p);
+#else /* POLYMORPHIC */
+ return vqshlq_m_n_s16(inactive, a, 13, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshlq_m_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vqshl.imm.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], i32 14, i32 0, <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vqshlq_m_n_s32(int32x4_t inactive, int32x4_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqshlq_m_n(inactive, a, 14, p);
+#else /* POLYMORPHIC */
+ return vqshlq_m_n_s32(inactive, a, 14, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshlq_m_n_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vqshl.imm.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 4, i32 1, <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vqshlq_m_n_u8(uint8x16_t inactive, uint8x16_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqshlq_m_n(inactive, a, 4, p);
+#else /* POLYMORPHIC */
+ return vqshlq_m_n_u8(inactive, a, 4, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshlq_m_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vqshl.imm.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], i32 9, i32 1, <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vqshlq_m_n_u16(uint16x8_t inactive, uint16x8_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqshlq_m_n(inactive, a, 9, p);
+#else /* POLYMORPHIC */
+ return vqshlq_m_n_u16(inactive, a, 9, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshlq_m_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vqshl.imm.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], i32 25, i32 1, <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vqshlq_m_n_u32(uint32x4_t inactive, uint32x4_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqshlq_m_n(inactive, a, 25, p);
+#else /* POLYMORPHIC */
+ return vqshlq_m_n_u32(inactive, a, 25, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshluq_m_n_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vqshlu.imm.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 2, <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vqshluq_m_n_s8(uint8x16_t inactive, int8x16_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqshluq_m(inactive, a, 2, p);
+#else /* POLYMORPHIC */
+ return vqshluq_m_n_s8(inactive, a, 2, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshluq_m_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vqshlu.imm.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], i32 12, <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vqshluq_m_n_s16(uint16x8_t inactive, int16x8_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqshluq_m(inactive, a, 12, p);
+#else /* POLYMORPHIC */
+ return vqshluq_m_n_s16(inactive, a, 12, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshluq_m_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vqshlu.imm.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], i32 24, <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vqshluq_m_n_s32(uint32x4_t inactive, int32x4_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqshluq_m(inactive, a, 24, p);
+#else /* POLYMORPHIC */
+ return vqshluq_m_n_s32(inactive, a, 24, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshrq_m_n_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vrshr.imm.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 2, i32 0, <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vrshrq_m_n_s8(int8x16_t inactive, int8x16_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrshrq_m(inactive, a, 2, p);
+#else /* POLYMORPHIC */
+ return vrshrq_m_n_s8(inactive, a, 2, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshrq_m_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vrshr.imm.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], i32 11, i32 0, <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vrshrq_m_n_s16(int16x8_t inactive, int16x8_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrshrq_m(inactive, a, 11, p);
+#else /* POLYMORPHIC */
+ return vrshrq_m_n_s16(inactive, a, 11, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshrq_m_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vrshr.imm.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], i32 24, i32 0, <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vrshrq_m_n_s32(int32x4_t inactive, int32x4_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrshrq_m(inactive, a, 24, p);
+#else /* POLYMORPHIC */
+ return vrshrq_m_n_s32(inactive, a, 24, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshrq_m_n_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vrshr.imm.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 7, i32 1, <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vrshrq_m_n_u8(uint8x16_t inactive, uint8x16_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrshrq_m(inactive, a, 7, p);
+#else /* POLYMORPHIC */
+ return vrshrq_m_n_u8(inactive, a, 7, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshrq_m_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vrshr.imm.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], i32 4, i32 1, <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vrshrq_m_n_u16(uint16x8_t inactive, uint16x8_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrshrq_m(inactive, a, 4, p);
+#else /* POLYMORPHIC */
+ return vrshrq_m_n_u16(inactive, a, 4, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshrq_m_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vrshr.imm.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], i32 27, i32 1, <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vrshrq_m_n_u32(uint32x4_t inactive, uint32x4_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrshrq_m(inactive, a, 27, p);
+#else /* POLYMORPHIC */
+ return vrshrq_m_n_u32(inactive, a, 27, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshrq_x_n_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vrshr.imm.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 3, i32 0, <16 x i1> [[TMP1]], <16 x i8> undef)
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vrshrq_x_n_s8(int8x16_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrshrq_x(a, 3, p);
+#else /* POLYMORPHIC */
+ return vrshrq_x_n_s8(a, 3, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshrq_x_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vrshr.imm.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], i32 12, i32 0, <8 x i1> [[TMP1]], <8 x i16> undef)
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vrshrq_x_n_s16(int16x8_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrshrq_x(a, 12, p);
+#else /* POLYMORPHIC */
+ return vrshrq_x_n_s16(a, 12, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshrq_x_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vrshr.imm.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], i32 20, i32 0, <4 x i1> [[TMP1]], <4 x i32> undef)
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vrshrq_x_n_s32(int32x4_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrshrq_x(a, 20, p);
+#else /* POLYMORPHIC */
+ return vrshrq_x_n_s32(a, 20, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshrq_x_n_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vrshr.imm.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 1, i32 1, <16 x i1> [[TMP1]], <16 x i8> undef)
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vrshrq_x_n_u8(uint8x16_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrshrq_x(a, 1, p);
+#else /* POLYMORPHIC */
+ return vrshrq_x_n_u8(a, 1, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshrq_x_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vrshr.imm.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], i32 13, i32 1, <8 x i1> [[TMP1]], <8 x i16> undef)
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vrshrq_x_n_u16(uint16x8_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrshrq_x(a, 13, p);
+#else /* POLYMORPHIC */
+ return vrshrq_x_n_u16(a, 13, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshrq_x_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vrshr.imm.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], i32 6, i32 1, <4 x i1> [[TMP1]], <4 x i32> undef)
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vrshrq_x_n_u32(uint32x4_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrshrq_x(a, 6, p);
+#else /* POLYMORPHIC */
+ return vrshrq_x_n_u32(a, 6, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshllbq_n_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshll.imm.v8i16.v16i8(<16 x i8> [[A:%.*]], i32 2, i32 0, i32 0)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vshllbq_n_s8(int8x16_t a)
+{
+#ifdef POLYMORPHIC
+ return vshllbq(a, 2);
+#else /* POLYMORPHIC */
+ return vshllbq_n_s8(a, 2);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshllbq_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vshll.imm.v4i32.v8i16(<8 x i16> [[A:%.*]], i32 13, i32 0, i32 0)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+int32x4_t test_vshllbq_n_s16(int16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vshllbq(a, 13);
+#else /* POLYMORPHIC */
+ return vshllbq_n_s16(a, 13);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshllbq_n_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshll.imm.v8i16.v16i8(<16 x i8> [[A:%.*]], i32 5, i32 1, i32 0)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vshllbq_n_u8(uint8x16_t a)
+{
+#ifdef POLYMORPHIC
+ return vshllbq(a, 5);
+#else /* POLYMORPHIC */
+ return vshllbq_n_u8(a, 5);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshllbq_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vshll.imm.v4i32.v8i16(<8 x i16> [[A:%.*]], i32 6, i32 1, i32 0)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vshllbq_n_u16(uint16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vshllbq(a, 6);
+#else /* POLYMORPHIC */
+ return vshllbq_n_u16(a, 6);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlltq_n_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshll.imm.v8i16.v16i8(<16 x i8> [[A:%.*]], i32 7, i32 0, i32 1)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vshlltq_n_s8(int8x16_t a)
+{
+#ifdef POLYMORPHIC
+ return vshlltq(a, 7);
+#else /* POLYMORPHIC */
+ return vshlltq_n_s8(a, 7);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlltq_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vshll.imm.v4i32.v8i16(<8 x i16> [[A:%.*]], i32 2, i32 0, i32 1)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+int32x4_t test_vshlltq_n_s16(int16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vshlltq(a, 2);
+#else /* POLYMORPHIC */
+ return vshlltq_n_s16(a, 2);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlltq_n_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshll.imm.v8i16.v16i8(<16 x i8> [[A:%.*]], i32 7, i32 1, i32 1)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vshlltq_n_u8(uint8x16_t a)
+{
+#ifdef POLYMORPHIC
+ return vshlltq(a, 7);
+#else /* POLYMORPHIC */
+ return vshlltq_n_u8(a, 7);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlltq_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vshll.imm.v4i32.v8i16(<8 x i16> [[A:%.*]], i32 14, i32 1, i32 1)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vshlltq_n_u16(uint16x8_t a)
+{
+#ifdef POLYMORPHIC
+ return vshlltq(a, 14);
+#else /* POLYMORPHIC */
+ return vshlltq_n_u16(a, 14);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshllbq_m_n_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshll.imm.predicated.v8i16.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 6, i32 0, i32 0, <16 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vshllbq_m_n_s8(int16x8_t inactive, int8x16_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshllbq_m(inactive, a, 6, p);
+#else /* POLYMORPHIC */
+ return vshllbq_m_n_s8(inactive, a, 6, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshllbq_m_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vshll.imm.predicated.v4i32.v8i16.v8i1(<8 x i16> [[A:%.*]], i32 10, i32 0, i32 0, <8 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vshllbq_m_n_s16(int32x4_t inactive, int16x8_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshllbq_m(inactive, a, 10, p);
+#else /* POLYMORPHIC */
+ return vshllbq_m_n_s16(inactive, a, 10, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshllbq_m_n_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshll.imm.predicated.v8i16.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 3, i32 1, i32 0, <16 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vshllbq_m_n_u8(uint16x8_t inactive, uint8x16_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshllbq_m(inactive, a, 3, p);
+#else /* POLYMORPHIC */
+ return vshllbq_m_n_u8(inactive, a, 3, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshllbq_m_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vshll.imm.predicated.v4i32.v8i16.v8i1(<8 x i16> [[A:%.*]], i32 14, i32 1, i32 0, <8 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vshllbq_m_n_u16(uint32x4_t inactive, uint16x8_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshllbq_m(inactive, a, 14, p);
+#else /* POLYMORPHIC */
+ return vshllbq_m_n_u16(inactive, a, 14, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlltq_m_n_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshll.imm.predicated.v8i16.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 4, i32 0, i32 1, <16 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vshlltq_m_n_s8(int16x8_t inactive, int8x16_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshlltq_m(inactive, a, 4, p);
+#else /* POLYMORPHIC */
+ return vshlltq_m_n_s8(inactive, a, 4, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlltq_m_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vshll.imm.predicated.v4i32.v8i16.v8i1(<8 x i16> [[A:%.*]], i32 12, i32 0, i32 1, <8 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vshlltq_m_n_s16(int32x4_t inactive, int16x8_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshlltq_m(inactive, a, 12, p);
+#else /* POLYMORPHIC */
+ return vshlltq_m_n_s16(inactive, a, 12, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlltq_m_n_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshll.imm.predicated.v8i16.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 2, i32 1, i32 1, <16 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vshlltq_m_n_u8(uint16x8_t inactive, uint8x16_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshlltq_m(inactive, a, 2, p);
+#else /* POLYMORPHIC */
+ return vshlltq_m_n_u8(inactive, a, 2, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlltq_m_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vshll.imm.predicated.v4i32.v8i16.v8i1(<8 x i16> [[A:%.*]], i32 9, i32 1, i32 1, <8 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vshlltq_m_n_u16(uint32x4_t inactive, uint16x8_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshlltq_m(inactive, a, 9, p);
+#else /* POLYMORPHIC */
+ return vshlltq_m_n_u16(inactive, a, 9, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshllbq_x_n_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshll.imm.predicated.v8i16.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 1, i32 0, i32 0, <16 x i1> [[TMP1]], <8 x i16> undef)
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vshllbq_x_n_s8(int8x16_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshllbq_x(a, 1, p);
+#else /* POLYMORPHIC */
+ return vshllbq_x_n_s8(a, 1, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshllbq_x_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vshll.imm.predicated.v4i32.v8i16.v8i1(<8 x i16> [[A:%.*]], i32 10, i32 0, i32 0, <8 x i1> [[TMP1]], <4 x i32> undef)
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vshllbq_x_n_s16(int16x8_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshllbq_x(a, 10, p);
+#else /* POLYMORPHIC */
+ return vshllbq_x_n_s16(a, 10, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshllbq_x_n_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshll.imm.predicated.v8i16.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 6, i32 1, i32 0, <16 x i1> [[TMP1]], <8 x i16> undef)
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vshllbq_x_n_u8(uint8x16_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshllbq_x(a, 6, p);
+#else /* POLYMORPHIC */
+ return vshllbq_x_n_u8(a, 6, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshllbq_x_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vshll.imm.predicated.v4i32.v8i16.v8i1(<8 x i16> [[A:%.*]], i32 10, i32 1, i32 0, <8 x i1> [[TMP1]], <4 x i32> undef)
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vshllbq_x_n_u16(uint16x8_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshllbq_x(a, 10, p);
+#else /* POLYMORPHIC */
+ return vshllbq_x_n_u16(a, 10, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlltq_x_n_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshll.imm.predicated.v8i16.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 2, i32 0, i32 1, <16 x i1> [[TMP1]], <8 x i16> undef)
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vshlltq_x_n_s8(int8x16_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshlltq_x(a, 2, p);
+#else /* POLYMORPHIC */
+ return vshlltq_x_n_s8(a, 2, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlltq_x_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vshll.imm.predicated.v4i32.v8i16.v8i1(<8 x i16> [[A:%.*]], i32 6, i32 0, i32 1, <8 x i1> [[TMP1]], <4 x i32> undef)
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vshlltq_x_n_s16(int16x8_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshlltq_x(a, 6, p);
+#else /* POLYMORPHIC */
+ return vshlltq_x_n_s16(a, 6, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlltq_x_n_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshll.imm.predicated.v8i16.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 5, i32 1, i32 1, <16 x i1> [[TMP1]], <8 x i16> undef)
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vshlltq_x_n_u8(uint8x16_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshlltq_x(a, 5, p);
+#else /* POLYMORPHIC */
+ return vshlltq_x_n_u8(a, 5, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlltq_x_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vshll.imm.predicated.v4i32.v8i16.v8i1(<8 x i16> [[A:%.*]], i32 3, i32 1, i32 1, <8 x i1> [[TMP1]], <4 x i32> undef)
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vshlltq_x_n_u16(uint16x8_t a, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshlltq_x(a, 3, p);
+#else /* POLYMORPHIC */
+ return vshlltq_x_n_u16(a, 3, p);
+#endif /* POLYMORPHIC */
+}
+
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vector-shift-var.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vector-shift-var.c
new file mode 100644
index 0000000..680c2e4
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vector-shift-var.c
@@ -0,0 +1,1638 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vshlq_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshl.vector.v16i8.v16i8(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 0, i32 0, i32 0)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+int8x16_t test_vshlq_s8(int8x16_t a, int8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vshlq(a, b);
+#else /* POLYMORPHIC */
+ return vshlq_s8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshl.vector.v8i16.v8i16(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 0, i32 0, i32 0)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vshlq_s16(int16x8_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vshlq(a, b);
+#else /* POLYMORPHIC */
+ return vshlq_s16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vshl.vector.v4i32.v4i32(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 0, i32 0, i32 0)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+int32x4_t test_vshlq_s32(int32x4_t a, int32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vshlq(a, b);
+#else /* POLYMORPHIC */
+ return vshlq_s32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshl.vector.v16i8.v16i8(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 0, i32 0, i32 1)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vshlq_u8(uint8x16_t a, int8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vshlq(a, b);
+#else /* POLYMORPHIC */
+ return vshlq_u8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshl.vector.v8i16.v8i16(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 0, i32 0, i32 1)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vshlq_u16(uint16x8_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vshlq(a, b);
+#else /* POLYMORPHIC */
+ return vshlq_u16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vshl.vector.v4i32.v4i32(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 0, i32 0, i32 1)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vshlq_u32(uint32x4_t a, int32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vshlq(a, b);
+#else /* POLYMORPHIC */
+ return vshlq_u32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_r_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshl.scalar.v16i8(<16 x i8> [[A:%.*]], i32 [[B:%.*]], i32 0, i32 0, i32 0)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+int8x16_t test_vshlq_r_s8(int8x16_t a, int32_t b)
+{
+#ifdef POLYMORPHIC
+ return vshlq_r(a, b);
+#else /* POLYMORPHIC */
+ return vshlq_r_s8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_r_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshl.scalar.v8i16(<8 x i16> [[A:%.*]], i32 [[B:%.*]], i32 0, i32 0, i32 0)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vshlq_r_s16(int16x8_t a, int32_t b)
+{
+#ifdef POLYMORPHIC
+ return vshlq_r(a, b);
+#else /* POLYMORPHIC */
+ return vshlq_r_s16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_r_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vshl.scalar.v4i32(<4 x i32> [[A:%.*]], i32 [[B:%.*]], i32 0, i32 0, i32 0)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+int32x4_t test_vshlq_r_s32(int32x4_t a, int32_t b)
+{
+#ifdef POLYMORPHIC
+ return vshlq_r(a, b);
+#else /* POLYMORPHIC */
+ return vshlq_r_s32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_r_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshl.scalar.v16i8(<16 x i8> [[A:%.*]], i32 [[B:%.*]], i32 0, i32 0, i32 1)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vshlq_r_u8(uint8x16_t a, int32_t b)
+{
+#ifdef POLYMORPHIC
+ return vshlq_r(a, b);
+#else /* POLYMORPHIC */
+ return vshlq_r_u8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_r_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshl.scalar.v8i16(<8 x i16> [[A:%.*]], i32 [[B:%.*]], i32 0, i32 0, i32 1)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vshlq_r_u16(uint16x8_t a, int32_t b)
+{
+#ifdef POLYMORPHIC
+ return vshlq_r(a, b);
+#else /* POLYMORPHIC */
+ return vshlq_r_u16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_r_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vshl.scalar.v4i32(<4 x i32> [[A:%.*]], i32 [[B:%.*]], i32 0, i32 0, i32 1)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vshlq_r_u32(uint32x4_t a, int32_t b)
+{
+#ifdef POLYMORPHIC
+ return vshlq_r(a, b);
+#else /* POLYMORPHIC */
+ return vshlq_r_u32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshlq_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshl.vector.v16i8.v16i8(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 1, i32 0, i32 0)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+int8x16_t test_vqshlq_s8(int8x16_t a, int8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vqshlq(a, b);
+#else /* POLYMORPHIC */
+ return vqshlq_s8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshlq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshl.vector.v8i16.v8i16(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 0, i32 0)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vqshlq_s16(int16x8_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vqshlq(a, b);
+#else /* POLYMORPHIC */
+ return vqshlq_s16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshlq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vshl.vector.v4i32.v4i32(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, i32 0, i32 0)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+int32x4_t test_vqshlq_s32(int32x4_t a, int32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vqshlq(a, b);
+#else /* POLYMORPHIC */
+ return vqshlq_s32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshlq_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshl.vector.v16i8.v16i8(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 1, i32 0, i32 1)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vqshlq_u8(uint8x16_t a, int8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vqshlq(a, b);
+#else /* POLYMORPHIC */
+ return vqshlq_u8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshlq_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshl.vector.v8i16.v8i16(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 0, i32 1)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vqshlq_u16(uint16x8_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vqshlq(a, b);
+#else /* POLYMORPHIC */
+ return vqshlq_u16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshlq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vshl.vector.v4i32.v4i32(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, i32 0, i32 1)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vqshlq_u32(uint32x4_t a, int32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vqshlq(a, b);
+#else /* POLYMORPHIC */
+ return vqshlq_u32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshlq_r_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshl.scalar.v16i8(<16 x i8> [[A:%.*]], i32 [[B:%.*]], i32 1, i32 0, i32 0)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+int8x16_t test_vqshlq_r_s8(int8x16_t a, int32_t b)
+{
+#ifdef POLYMORPHIC
+ return vqshlq_r(a, b);
+#else /* POLYMORPHIC */
+ return vqshlq_r_s8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshlq_r_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshl.scalar.v8i16(<8 x i16> [[A:%.*]], i32 [[B:%.*]], i32 1, i32 0, i32 0)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vqshlq_r_s16(int16x8_t a, int32_t b)
+{
+#ifdef POLYMORPHIC
+ return vqshlq_r(a, b);
+#else /* POLYMORPHIC */
+ return vqshlq_r_s16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshlq_r_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vshl.scalar.v4i32(<4 x i32> [[A:%.*]], i32 [[B:%.*]], i32 1, i32 0, i32 0)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+int32x4_t test_vqshlq_r_s32(int32x4_t a, int32_t b)
+{
+#ifdef POLYMORPHIC
+ return vqshlq_r(a, b);
+#else /* POLYMORPHIC */
+ return vqshlq_r_s32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshlq_r_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshl.scalar.v16i8(<16 x i8> [[A:%.*]], i32 [[B:%.*]], i32 1, i32 0, i32 1)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vqshlq_r_u8(uint8x16_t a, int32_t b)
+{
+#ifdef POLYMORPHIC
+ return vqshlq_r(a, b);
+#else /* POLYMORPHIC */
+ return vqshlq_r_u8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshlq_r_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshl.scalar.v8i16(<8 x i16> [[A:%.*]], i32 [[B:%.*]], i32 1, i32 0, i32 1)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vqshlq_r_u16(uint16x8_t a, int32_t b)
+{
+#ifdef POLYMORPHIC
+ return vqshlq_r(a, b);
+#else /* POLYMORPHIC */
+ return vqshlq_r_u16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshlq_r_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vshl.scalar.v4i32(<4 x i32> [[A:%.*]], i32 [[B:%.*]], i32 1, i32 0, i32 1)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vqshlq_r_u32(uint32x4_t a, int32_t b)
+{
+#ifdef POLYMORPHIC
+ return vqshlq_r(a, b);
+#else /* POLYMORPHIC */
+ return vqshlq_r_u32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshlq_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshl.vector.v16i8.v16i8(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 0, i32 1, i32 0)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+int8x16_t test_vrshlq_s8(int8x16_t a, int8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vrshlq(a, b);
+#else /* POLYMORPHIC */
+ return vrshlq_s8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshlq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshl.vector.v8i16.v8i16(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 0, i32 1, i32 0)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vrshlq_s16(int16x8_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vrshlq(a, b);
+#else /* POLYMORPHIC */
+ return vrshlq_s16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshlq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vshl.vector.v4i32.v4i32(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 0, i32 1, i32 0)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+int32x4_t test_vrshlq_s32(int32x4_t a, int32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vrshlq(a, b);
+#else /* POLYMORPHIC */
+ return vrshlq_s32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshlq_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshl.vector.v16i8.v16i8(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 0, i32 1, i32 1)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vrshlq_u8(uint8x16_t a, int8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vrshlq(a, b);
+#else /* POLYMORPHIC */
+ return vrshlq_u8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshlq_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshl.vector.v8i16.v8i16(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 0, i32 1, i32 1)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vrshlq_u16(uint16x8_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vrshlq(a, b);
+#else /* POLYMORPHIC */
+ return vrshlq_u16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshlq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vshl.vector.v4i32.v4i32(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 0, i32 1, i32 1)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vrshlq_u32(uint32x4_t a, int32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vrshlq(a, b);
+#else /* POLYMORPHIC */
+ return vrshlq_u32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshlq_n_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshl.scalar.v16i8(<16 x i8> [[A:%.*]], i32 [[B:%.*]], i32 0, i32 1, i32 0)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+int8x16_t test_vrshlq_n_s8(int8x16_t a, int32_t b)
+{
+#ifdef POLYMORPHIC
+ return vrshlq(a, b);
+#else /* POLYMORPHIC */
+ return vrshlq_n_s8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshlq_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshl.scalar.v8i16(<8 x i16> [[A:%.*]], i32 [[B:%.*]], i32 0, i32 1, i32 0)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vrshlq_n_s16(int16x8_t a, int32_t b)
+{
+#ifdef POLYMORPHIC
+ return vrshlq(a, b);
+#else /* POLYMORPHIC */
+ return vrshlq_n_s16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshlq_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vshl.scalar.v4i32(<4 x i32> [[A:%.*]], i32 [[B:%.*]], i32 0, i32 1, i32 0)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+int32x4_t test_vrshlq_n_s32(int32x4_t a, int32_t b)
+{
+#ifdef POLYMORPHIC
+ return vrshlq(a, b);
+#else /* POLYMORPHIC */
+ return vrshlq_n_s32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshlq_n_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshl.scalar.v16i8(<16 x i8> [[A:%.*]], i32 [[B:%.*]], i32 0, i32 1, i32 1)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vrshlq_n_u8(uint8x16_t a, int32_t b)
+{
+#ifdef POLYMORPHIC
+ return vrshlq(a, b);
+#else /* POLYMORPHIC */
+ return vrshlq_n_u8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshlq_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshl.scalar.v8i16(<8 x i16> [[A:%.*]], i32 [[B:%.*]], i32 0, i32 1, i32 1)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vrshlq_n_u16(uint16x8_t a, int32_t b)
+{
+#ifdef POLYMORPHIC
+ return vrshlq(a, b);
+#else /* POLYMORPHIC */
+ return vrshlq_n_u16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshlq_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vshl.scalar.v4i32(<4 x i32> [[A:%.*]], i32 [[B:%.*]], i32 0, i32 1, i32 1)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vrshlq_n_u32(uint32x4_t a, int32_t b)
+{
+#ifdef POLYMORPHIC
+ return vrshlq(a, b);
+#else /* POLYMORPHIC */
+ return vrshlq_n_u32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshlq_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshl.vector.v16i8.v16i8(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 1, i32 1, i32 0)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+int8x16_t test_vqrshlq_s8(int8x16_t a, int8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vqrshlq(a, b);
+#else /* POLYMORPHIC */
+ return vqrshlq_s8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshlq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshl.vector.v8i16.v8i16(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 1, i32 0)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vqrshlq_s16(int16x8_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vqrshlq(a, b);
+#else /* POLYMORPHIC */
+ return vqrshlq_s16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshlq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vshl.vector.v4i32.v4i32(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, i32 1, i32 0)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+int32x4_t test_vqrshlq_s32(int32x4_t a, int32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vqrshlq(a, b);
+#else /* POLYMORPHIC */
+ return vqrshlq_s32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshlq_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshl.vector.v16i8.v16i8(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 1, i32 1, i32 1)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vqrshlq_u8(uint8x16_t a, int8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vqrshlq(a, b);
+#else /* POLYMORPHIC */
+ return vqrshlq_u8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshlq_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshl.vector.v8i16.v8i16(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 1, i32 1)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vqrshlq_u16(uint16x8_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vqrshlq(a, b);
+#else /* POLYMORPHIC */
+ return vqrshlq_u16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshlq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vshl.vector.v4i32.v4i32(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, i32 1, i32 1)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vqrshlq_u32(uint32x4_t a, int32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vqrshlq(a, b);
+#else /* POLYMORPHIC */
+ return vqrshlq_u32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshlq_n_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshl.scalar.v16i8(<16 x i8> [[A:%.*]], i32 [[B:%.*]], i32 1, i32 1, i32 0)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+int8x16_t test_vqrshlq_n_s8(int8x16_t a, int32_t b)
+{
+#ifdef POLYMORPHIC
+ return vqrshlq(a, b);
+#else /* POLYMORPHIC */
+ return vqrshlq_n_s8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshlq_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshl.scalar.v8i16(<8 x i16> [[A:%.*]], i32 [[B:%.*]], i32 1, i32 1, i32 0)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vqrshlq_n_s16(int16x8_t a, int32_t b)
+{
+#ifdef POLYMORPHIC
+ return vqrshlq(a, b);
+#else /* POLYMORPHIC */
+ return vqrshlq_n_s16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshlq_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vshl.scalar.v4i32(<4 x i32> [[A:%.*]], i32 [[B:%.*]], i32 1, i32 1, i32 0)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+int32x4_t test_vqrshlq_n_s32(int32x4_t a, int32_t b)
+{
+#ifdef POLYMORPHIC
+ return vqrshlq(a, b);
+#else /* POLYMORPHIC */
+ return vqrshlq_n_s32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshlq_n_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshl.scalar.v16i8(<16 x i8> [[A:%.*]], i32 [[B:%.*]], i32 1, i32 1, i32 1)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vqrshlq_n_u8(uint8x16_t a, int32_t b)
+{
+#ifdef POLYMORPHIC
+ return vqrshlq(a, b);
+#else /* POLYMORPHIC */
+ return vqrshlq_n_u8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshlq_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshl.scalar.v8i16(<8 x i16> [[A:%.*]], i32 [[B:%.*]], i32 1, i32 1, i32 1)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+uint16x8_t test_vqrshlq_n_u16(uint16x8_t a, int32_t b)
+{
+#ifdef POLYMORPHIC
+ return vqrshlq(a, b);
+#else /* POLYMORPHIC */
+ return vqrshlq_n_u16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshlq_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vshl.scalar.v4i32(<4 x i32> [[A:%.*]], i32 [[B:%.*]], i32 1, i32 1, i32 1)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vqrshlq_n_u32(uint32x4_t a, int32_t b)
+{
+#ifdef POLYMORPHIC
+ return vqrshlq(a, b);
+#else /* POLYMORPHIC */
+ return vqrshlq_n_u32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_m_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshl.vector.predicated.v16i8.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 0, i32 0, i32 0, <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vshlq_m_s8(int8x16_t inactive, int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshlq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vshlq_m_s8(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_m_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshl.vector.predicated.v8i16.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 0, i32 0, i32 0, <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vshlq_m_s16(int16x8_t inactive, int16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshlq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vshlq_m_s16(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_m_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vshl.vector.predicated.v4i32.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 0, i32 0, i32 0, <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vshlq_m_s32(int32x4_t inactive, int32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshlq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vshlq_m_s32(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_m_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshl.vector.predicated.v16i8.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 0, i32 0, i32 1, <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vshlq_m_u8(uint8x16_t inactive, uint8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshlq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vshlq_m_u8(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_m_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshl.vector.predicated.v8i16.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 0, i32 0, i32 1, <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vshlq_m_u16(uint16x8_t inactive, uint16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshlq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vshlq_m_u16(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_m_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vshl.vector.predicated.v4i32.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 0, i32 0, i32 1, <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vshlq_m_u32(uint32x4_t inactive, uint32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshlq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vshlq_m_u32(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_x_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshl.vector.predicated.v16i8.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 0, i32 0, i32 0, <16 x i1> [[TMP1]], <16 x i8> undef)
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vshlq_x_s8(int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshlq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vshlq_x_s8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_x_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshl.vector.predicated.v8i16.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 0, i32 0, i32 0, <8 x i1> [[TMP1]], <8 x i16> undef)
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vshlq_x_s16(int16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshlq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vshlq_x_s16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_x_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vshl.vector.predicated.v4i32.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 0, i32 0, i32 0, <4 x i1> [[TMP1]], <4 x i32> undef)
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vshlq_x_s32(int32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshlq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vshlq_x_s32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_x_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshl.vector.predicated.v16i8.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 0, i32 0, i32 1, <16 x i1> [[TMP1]], <16 x i8> undef)
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vshlq_x_u8(uint8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshlq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vshlq_x_u8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_x_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshl.vector.predicated.v8i16.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 0, i32 0, i32 1, <8 x i1> [[TMP1]], <8 x i16> undef)
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vshlq_x_u16(uint16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshlq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vshlq_x_u16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_x_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vshl.vector.predicated.v4i32.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 0, i32 0, i32 1, <4 x i1> [[TMP1]], <4 x i32> undef)
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vshlq_x_u32(uint32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshlq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vshlq_x_u32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_m_r_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshl.scalar.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 [[B:%.*]], i32 0, i32 0, i32 0, <16 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vshlq_m_r_s8(int8x16_t a, int32_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshlq_m_r(a, b, p);
+#else /* POLYMORPHIC */
+ return vshlq_m_r_s8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_m_r_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshl.scalar.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], i32 [[B:%.*]], i32 0, i32 0, i32 0, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vshlq_m_r_s16(int16x8_t a, int32_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshlq_m_r(a, b, p);
+#else /* POLYMORPHIC */
+ return vshlq_m_r_s16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_m_r_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vshl.scalar.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], i32 [[B:%.*]], i32 0, i32 0, i32 0, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vshlq_m_r_s32(int32x4_t a, int32_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshlq_m_r(a, b, p);
+#else /* POLYMORPHIC */
+ return vshlq_m_r_s32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_m_r_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshl.scalar.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 [[B:%.*]], i32 0, i32 0, i32 1, <16 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vshlq_m_r_u8(uint8x16_t a, int32_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshlq_m_r(a, b, p);
+#else /* POLYMORPHIC */
+ return vshlq_m_r_u8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_m_r_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshl.scalar.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], i32 [[B:%.*]], i32 0, i32 0, i32 1, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vshlq_m_r_u16(uint16x8_t a, int32_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshlq_m_r(a, b, p);
+#else /* POLYMORPHIC */
+ return vshlq_m_r_u16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vshlq_m_r_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vshl.scalar.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], i32 [[B:%.*]], i32 0, i32 0, i32 1, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vshlq_m_r_u32(uint32x4_t a, int32_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vshlq_m_r(a, b, p);
+#else /* POLYMORPHIC */
+ return vshlq_m_r_u32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshlq_m_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshl.vector.predicated.v16i8.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 1, i32 0, i32 0, <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vqshlq_m_s8(int8x16_t inactive, int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqshlq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vqshlq_m_s8(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshlq_m_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshl.vector.predicated.v8i16.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 0, i32 0, <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vqshlq_m_s16(int16x8_t inactive, int16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqshlq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vqshlq_m_s16(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshlq_m_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vshl.vector.predicated.v4i32.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, i32 0, i32 0, <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vqshlq_m_s32(int32x4_t inactive, int32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqshlq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vqshlq_m_s32(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshlq_m_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshl.vector.predicated.v16i8.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 1, i32 0, i32 1, <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vqshlq_m_u8(uint8x16_t inactive, uint8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqshlq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vqshlq_m_u8(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshlq_m_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshl.vector.predicated.v8i16.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 0, i32 1, <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vqshlq_m_u16(uint16x8_t inactive, uint16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqshlq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vqshlq_m_u16(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshlq_m_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vshl.vector.predicated.v4i32.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, i32 0, i32 1, <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vqshlq_m_u32(uint32x4_t inactive, uint32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqshlq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vqshlq_m_u32(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshlq_m_r_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshl.scalar.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 [[B:%.*]], i32 1, i32 0, i32 0, <16 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vqshlq_m_r_s8(int8x16_t a, int32_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqshlq_m_r(a, b, p);
+#else /* POLYMORPHIC */
+ return vqshlq_m_r_s8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshlq_m_r_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshl.scalar.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], i32 [[B:%.*]], i32 1, i32 0, i32 0, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vqshlq_m_r_s16(int16x8_t a, int32_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqshlq_m_r(a, b, p);
+#else /* POLYMORPHIC */
+ return vqshlq_m_r_s16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshlq_m_r_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vshl.scalar.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], i32 [[B:%.*]], i32 1, i32 0, i32 0, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vqshlq_m_r_s32(int32x4_t a, int32_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqshlq_m_r(a, b, p);
+#else /* POLYMORPHIC */
+ return vqshlq_m_r_s32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshlq_m_r_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshl.scalar.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 [[B:%.*]], i32 1, i32 0, i32 1, <16 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vqshlq_m_r_u8(uint8x16_t a, int32_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqshlq_m_r(a, b, p);
+#else /* POLYMORPHIC */
+ return vqshlq_m_r_u8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshlq_m_r_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshl.scalar.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], i32 [[B:%.*]], i32 1, i32 0, i32 1, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vqshlq_m_r_u16(uint16x8_t a, int32_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqshlq_m_r(a, b, p);
+#else /* POLYMORPHIC */
+ return vqshlq_m_r_u16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqshlq_m_r_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vshl.scalar.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], i32 [[B:%.*]], i32 1, i32 0, i32 1, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vqshlq_m_r_u32(uint32x4_t a, int32_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqshlq_m_r(a, b, p);
+#else /* POLYMORPHIC */
+ return vqshlq_m_r_u32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshlq_m_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshl.vector.predicated.v16i8.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 0, i32 1, i32 0, <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vrshlq_m_s8(int8x16_t inactive, int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrshlq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vrshlq_m_s8(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshlq_m_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshl.vector.predicated.v8i16.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 0, i32 1, i32 0, <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vrshlq_m_s16(int16x8_t inactive, int16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrshlq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vrshlq_m_s16(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshlq_m_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vshl.vector.predicated.v4i32.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 0, i32 1, i32 0, <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vrshlq_m_s32(int32x4_t inactive, int32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrshlq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vrshlq_m_s32(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshlq_m_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshl.vector.predicated.v16i8.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 0, i32 1, i32 1, <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vrshlq_m_u8(uint8x16_t inactive, uint8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrshlq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vrshlq_m_u8(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshlq_m_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshl.vector.predicated.v8i16.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 0, i32 1, i32 1, <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vrshlq_m_u16(uint16x8_t inactive, uint16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrshlq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vrshlq_m_u16(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshlq_m_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vshl.vector.predicated.v4i32.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 0, i32 1, i32 1, <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vrshlq_m_u32(uint32x4_t inactive, uint32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrshlq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vrshlq_m_u32(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshlq_x_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshl.vector.predicated.v16i8.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 0, i32 1, i32 0, <16 x i1> [[TMP1]], <16 x i8> undef)
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vrshlq_x_s8(int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrshlq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vrshlq_x_s8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshlq_x_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshl.vector.predicated.v8i16.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 0, i32 1, i32 0, <8 x i1> [[TMP1]], <8 x i16> undef)
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vrshlq_x_s16(int16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrshlq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vrshlq_x_s16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshlq_x_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vshl.vector.predicated.v4i32.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 0, i32 1, i32 0, <4 x i1> [[TMP1]], <4 x i32> undef)
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vrshlq_x_s32(int32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrshlq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vrshlq_x_s32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshlq_x_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshl.vector.predicated.v16i8.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 0, i32 1, i32 1, <16 x i1> [[TMP1]], <16 x i8> undef)
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vrshlq_x_u8(uint8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrshlq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vrshlq_x_u8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshlq_x_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshl.vector.predicated.v8i16.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 0, i32 1, i32 1, <8 x i1> [[TMP1]], <8 x i16> undef)
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vrshlq_x_u16(uint16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrshlq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vrshlq_x_u16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshlq_x_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vshl.vector.predicated.v4i32.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 0, i32 1, i32 1, <4 x i1> [[TMP1]], <4 x i32> undef)
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vrshlq_x_u32(uint32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrshlq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vrshlq_x_u32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshlq_m_n_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshl.scalar.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 [[B:%.*]], i32 0, i32 1, i32 0, <16 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vrshlq_m_n_s8(int8x16_t a, int32_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrshlq_m_n(a, b, p);
+#else /* POLYMORPHIC */
+ return vrshlq_m_n_s8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshlq_m_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshl.scalar.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], i32 [[B:%.*]], i32 0, i32 1, i32 0, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vrshlq_m_n_s16(int16x8_t a, int32_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrshlq_m_n(a, b, p);
+#else /* POLYMORPHIC */
+ return vrshlq_m_n_s16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshlq_m_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vshl.scalar.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], i32 [[B:%.*]], i32 0, i32 1, i32 0, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vrshlq_m_n_s32(int32x4_t a, int32_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrshlq_m_n(a, b, p);
+#else /* POLYMORPHIC */
+ return vrshlq_m_n_s32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshlq_m_n_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshl.scalar.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 [[B:%.*]], i32 0, i32 1, i32 1, <16 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vrshlq_m_n_u8(uint8x16_t a, int32_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrshlq_m_n(a, b, p);
+#else /* POLYMORPHIC */
+ return vrshlq_m_n_u8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshlq_m_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshl.scalar.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], i32 [[B:%.*]], i32 0, i32 1, i32 1, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vrshlq_m_n_u16(uint16x8_t a, int32_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrshlq_m_n(a, b, p);
+#else /* POLYMORPHIC */
+ return vrshlq_m_n_u16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrshlq_m_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vshl.scalar.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], i32 [[B:%.*]], i32 0, i32 1, i32 1, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vrshlq_m_n_u32(uint32x4_t a, int32_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrshlq_m_n(a, b, p);
+#else /* POLYMORPHIC */
+ return vrshlq_m_n_u32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshlq_m_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshl.vector.predicated.v16i8.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 1, i32 1, i32 0, <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vqrshlq_m_s8(int8x16_t inactive, int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqrshlq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vqrshlq_m_s8(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshlq_m_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshl.vector.predicated.v8i16.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 1, i32 0, <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vqrshlq_m_s16(int16x8_t inactive, int16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqrshlq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vqrshlq_m_s16(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshlq_m_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vshl.vector.predicated.v4i32.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, i32 1, i32 0, <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vqrshlq_m_s32(int32x4_t inactive, int32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqrshlq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vqrshlq_m_s32(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshlq_m_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshl.vector.predicated.v16i8.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 1, i32 1, i32 1, <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vqrshlq_m_u8(uint8x16_t inactive, uint8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqrshlq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vqrshlq_m_u8(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshlq_m_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshl.vector.predicated.v8i16.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 1, i32 1, <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vqrshlq_m_u16(uint16x8_t inactive, uint16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqrshlq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vqrshlq_m_u16(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshlq_m_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vshl.vector.predicated.v4i32.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, i32 1, i32 1, <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vqrshlq_m_u32(uint32x4_t inactive, uint32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqrshlq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vqrshlq_m_u32(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshlq_m_n_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshl.scalar.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 [[B:%.*]], i32 1, i32 1, i32 0, <16 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vqrshlq_m_n_s8(int8x16_t a, int32_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqrshlq_m_n(a, b, p);
+#else /* POLYMORPHIC */
+ return vqrshlq_m_n_s8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshlq_m_n_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshl.scalar.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], i32 [[B:%.*]], i32 1, i32 1, i32 0, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vqrshlq_m_n_s16(int16x8_t a, int32_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqrshlq_m_n(a, b, p);
+#else /* POLYMORPHIC */
+ return vqrshlq_m_n_s16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshlq_m_n_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vshl.scalar.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], i32 [[B:%.*]], i32 1, i32 1, i32 0, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vqrshlq_m_n_s32(int32x4_t a, int32_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqrshlq_m_n(a, b, p);
+#else /* POLYMORPHIC */
+ return vqrshlq_m_n_s32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshlq_m_n_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshl.scalar.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 [[B:%.*]], i32 1, i32 1, i32 1, <16 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vqrshlq_m_n_u8(uint8x16_t a, int32_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqrshlq_m_n(a, b, p);
+#else /* POLYMORPHIC */
+ return vqrshlq_m_n_u8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshlq_m_n_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshl.scalar.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], i32 [[B:%.*]], i32 1, i32 1, i32 1, <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vqrshlq_m_n_u16(uint16x8_t a, int32_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqrshlq_m_n(a, b, p);
+#else /* POLYMORPHIC */
+ return vqrshlq_m_n_u16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrshlq_m_n_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vshl.scalar.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], i32 [[B:%.*]], i32 1, i32 1, i32 1, <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vqrshlq_m_n_u32(uint32x4_t a, int32_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqrshlq_m_n(a, b, p);
+#else /* POLYMORPHIC */
+ return vqrshlq_m_n_u32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/veorq.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/veorq.c
new file mode 100644
index 0000000..9025da9
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/veorq.c
@@ -0,0 +1,199 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_veorq_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = xor <16 x i8> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_veorq_u8(uint8x16_t a, uint8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return veorq(a, b);
+#else /* POLYMORPHIC */
+ return veorq_u8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_veorq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = xor <8 x i16> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_veorq_s16(int16x8_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return veorq(a, b);
+#else /* POLYMORPHIC */
+ return veorq_s16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_veorq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = xor <4 x i32> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_veorq_u32(uint32x4_t a, uint32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return veorq(a, b);
+#else /* POLYMORPHIC */
+ return veorq_u32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_veorq_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[A:%.*]] to <4 x i32>
+// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x float> [[B:%.*]] to <4 x i32>
+// CHECK-NEXT: [[TMP2:%.*]] = xor <4 x i32> [[TMP0]], [[TMP1]]
+// CHECK-NEXT: [[TMP3:%.*]] = bitcast <4 x i32> [[TMP2]] to <4 x float>
+// CHECK-NEXT: ret <4 x float> [[TMP3]]
+//
+float32x4_t test_veorq_f32(float32x4_t a, float32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return veorq(a, b);
+#else /* POLYMORPHIC */
+ return veorq_f32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_veorq_m_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.eor.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_veorq_m_s8(int8x16_t inactive, int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return veorq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return veorq_m_s8(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_veorq_m_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.eor.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_veorq_m_u16(uint16x8_t inactive, uint16x8_t a, uint16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return veorq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return veorq_m_u16(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_veorq_m_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.eor.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_veorq_m_s32(int32x4_t inactive, int32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return veorq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return veorq_m_s32(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_veorq_m_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x half> [[A:%.*]] to <8 x i16>
+// CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x half> [[B:%.*]] to <8 x i16>
+// CHECK-NEXT: [[TMP2:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP2]])
+// CHECK-NEXT: [[TMP4:%.*]] = bitcast <8 x half> [[INACTIVE:%.*]] to <8 x i16>
+// CHECK-NEXT: [[TMP5:%.*]] = call <8 x i16> @llvm.arm.mve.eor.predicated.v8i16.v8i1(<8 x i16> [[TMP0]], <8 x i16> [[TMP1]], <8 x i1> [[TMP3]], <8 x i16> [[TMP4]])
+// CHECK-NEXT: [[TMP6:%.*]] = bitcast <8 x i16> [[TMP5]] to <8 x half>
+// CHECK-NEXT: ret <8 x half> [[TMP6]]
+//
+float16x8_t test_veorq_m_f16(float16x8_t inactive, float16x8_t a, float16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return veorq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return veorq_m_f16(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_veorq_x_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.eor.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i1> [[TMP1]], <16 x i8> undef)
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_veorq_x_u8(uint8x16_t a, uint8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return veorq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return veorq_x_u8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_veorq_x_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.eor.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i1> [[TMP1]], <8 x i16> undef)
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_veorq_x_s16(int16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return veorq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return veorq_x_s16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_veorq_x_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.eor.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]], <4 x i32> undef)
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_veorq_x_u32(uint32x4_t a, uint32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return veorq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return veorq_x_u32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_veorq_m_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[A:%.*]] to <4 x i32>
+// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x float> [[B:%.*]] to <4 x i32>
+// CHECK-NEXT: [[TMP2:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP2]])
+// CHECK-NEXT: [[TMP4:%.*]] = call <4 x i32> @llvm.arm.mve.eor.predicated.v4i32.v4i1(<4 x i32> [[TMP0]], <4 x i32> [[TMP1]], <4 x i1> [[TMP3]], <4 x i32> undef)
+// CHECK-NEXT: [[TMP5:%.*]] = bitcast <4 x i32> [[TMP4]] to <4 x float>
+// CHECK-NEXT: ret <4 x float> [[TMP5]]
+//
+float32x4_t test_veorq_m_f32(float32x4_t a, float32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return veorq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return veorq_x_f32(a, b, p);
+#endif /* POLYMORPHIC */
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vhaddq.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vhaddq.c
new file mode 100644
index 0000000..1d97ea8
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vhaddq.c
@@ -0,0 +1,143 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vhaddq_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vhadd.v16i8(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 1)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vhaddq_u8(uint8x16_t a, uint8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vhaddq(a, b);
+#else /* POLYMORPHIC */
+ return vhaddq_u8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vhaddq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vhadd.v8i16(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 0)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vhaddq_s16(int16x8_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vhaddq(a, b);
+#else /* POLYMORPHIC */
+ return vhaddq_s16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vhaddq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vhadd.v4i32(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vhaddq_u32(uint32x4_t a, uint32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vhaddq(a, b);
+#else /* POLYMORPHIC */
+ return vhaddq_u32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vhaddq_m_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.hadd.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 0, <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vhaddq_m_s8(int8x16_t inactive, int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vhaddq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vhaddq_m_s8(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vhaddq_m_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.hadd.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vhaddq_m_u16(uint16x8_t inactive, uint16x8_t a, uint16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vhaddq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vhaddq_m_u16(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vhaddq_m_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.hadd.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 0, <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vhaddq_m_s32(int32x4_t inactive, int32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vhaddq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vhaddq_m_s32(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vhaddq_x_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.hadd.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 1, <16 x i1> [[TMP1]], <16 x i8> undef)
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vhaddq_x_u8(uint8x16_t a, uint8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vhaddq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vhaddq_x_u8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vhaddq_x_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.hadd.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 0, <8 x i1> [[TMP1]], <8 x i16> undef)
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vhaddq_x_s16(int16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vhaddq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vhaddq_x_s16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vhaddq_x_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.hadd.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, <4 x i1> [[TMP1]], <4 x i32> undef)
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vhaddq_x_u32(uint32x4_t a, uint32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vhaddq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vhaddq_x_u32(a, b, p);
+#endif /* POLYMORPHIC */
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vhcaddq.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vhcaddq.c
new file mode 100644
index 0000000..62335bf
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vhcaddq.c
@@ -0,0 +1,281 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vhcaddq_rot90_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vcaddq.v16i8(i32 0, i32 0, <16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+int8x16_t test_vhcaddq_rot90_s8(int8x16_t a, int8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vhcaddq_rot90(a, b);
+#else
+ return vhcaddq_rot90_s8(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vhcaddq_rot90_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vcaddq.v8i16(i32 0, i32 0, <8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vhcaddq_rot90_s16(int16x8_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vhcaddq_rot90(a, b);
+#else
+ return vhcaddq_rot90_s16(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vhcaddq_rot90_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vcaddq.v4i32(i32 0, i32 0, <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+int32x4_t test_vhcaddq_rot90_s32(int32x4_t a, int32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vhcaddq_rot90(a, b);
+#else
+ return vhcaddq_rot90_s32(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vhcaddq_rot270_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vcaddq.v16i8(i32 0, i32 1, <16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+int8x16_t test_vhcaddq_rot270_s8(int8x16_t a, int8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vhcaddq_rot270(a, b);
+#else
+ return vhcaddq_rot270_s8(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vhcaddq_rot270_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vcaddq.v8i16(i32 0, i32 1, <8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vhcaddq_rot270_s16(int16x8_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vhcaddq_rot270(a, b);
+#else
+ return vhcaddq_rot270_s16(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vhcaddq_rot270_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vcaddq.v4i32(i32 0, i32 1, <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+int32x4_t test_vhcaddq_rot270_s32(int32x4_t a, int32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vhcaddq_rot270(a, b);
+#else
+ return vhcaddq_rot270_s32(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vhcaddq_rot90_x_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vcaddq.predicated.v16i8.v16i1(i32 0, i32 0, <16 x i8> undef, <16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vhcaddq_rot90_x_s8(int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vhcaddq_rot90_x(a, b, p);
+#else
+ return vhcaddq_rot90_x_s8(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vhcaddq_rot90_x_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vcaddq.predicated.v8i16.v8i1(i32 0, i32 0, <8 x i16> undef, <8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vhcaddq_rot90_x_s16(int16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vhcaddq_rot90_x(a, b, p);
+#else
+ return vhcaddq_rot90_x_s16(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vhcaddq_rot90_x_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vcaddq.predicated.v4i32.v4i1(i32 0, i32 0, <4 x i32> undef, <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vhcaddq_rot90_x_s32(int32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vhcaddq_rot90_x(a, b, p);
+#else
+ return vhcaddq_rot90_x_s32(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vhcaddq_rot270_x_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vcaddq.predicated.v16i8.v16i1(i32 0, i32 1, <16 x i8> undef, <16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vhcaddq_rot270_x_s8(int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vhcaddq_rot270_x(a, b, p);
+#else
+ return vhcaddq_rot270_x_s8(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vhcaddq_rot270_x_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vcaddq.predicated.v8i16.v8i1(i32 0, i32 1, <8 x i16> undef, <8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vhcaddq_rot270_x_s16(int16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vhcaddq_rot270_x(a, b, p);
+#else
+ return vhcaddq_rot270_x_s16(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vhcaddq_rot270_x_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vcaddq.predicated.v4i32.v4i1(i32 0, i32 1, <4 x i32> undef, <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vhcaddq_rot270_x_s32(int32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vhcaddq_rot270_x(a, b, p);
+#else
+ return vhcaddq_rot270_x_s32(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vhcaddq_rot90_m_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vcaddq.predicated.v16i8.v16i1(i32 0, i32 0, <16 x i8> [[INACTIVE:%.*]], <16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vhcaddq_rot90_m_s8(int8x16_t inactive, int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vhcaddq_rot90_m(inactive, a, b, p);
+#else
+ return vhcaddq_rot90_m_s8(inactive, a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vhcaddq_rot90_m_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vcaddq.predicated.v8i16.v8i1(i32 0, i32 0, <8 x i16> [[INACTIVE:%.*]], <8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vhcaddq_rot90_m_s16(int16x8_t inactive, int16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vhcaddq_rot90_m(inactive, a, b, p);
+#else
+ return vhcaddq_rot90_m_s16(inactive, a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vhcaddq_rot90_m_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vcaddq.predicated.v4i32.v4i1(i32 0, i32 0, <4 x i32> [[INACTIVE:%.*]], <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vhcaddq_rot90_m_s32(int32x4_t inactive, int32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vhcaddq_rot90_m(inactive, a, b, p);
+#else
+ return vhcaddq_rot90_m_s32(inactive, a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vhcaddq_rot270_m_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vcaddq.predicated.v16i8.v16i1(i32 0, i32 1, <16 x i8> [[INACTIVE:%.*]], <16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i1> [[TMP1]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vhcaddq_rot270_m_s8(int8x16_t inactive, int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vhcaddq_rot270_m(inactive, a, b, p);
+#else
+ return vhcaddq_rot270_m_s8(inactive, a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vhcaddq_rot270_m_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vcaddq.predicated.v8i16.v8i1(i32 0, i32 1, <8 x i16> [[INACTIVE:%.*]], <8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vhcaddq_rot270_m_s16(int16x8_t inactive, int16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vhcaddq_rot270_m(inactive, a, b, p);
+#else
+ return vhcaddq_rot270_m_s16(inactive, a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vhcaddq_rot270_m_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vcaddq.predicated.v4i32.v4i1(i32 0, i32 1, <4 x i32> [[INACTIVE:%.*]], <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vhcaddq_rot270_m_s32(int32x4_t inactive, int32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vhcaddq_rot270_m(inactive, a, b, p);
+#else
+ return vhcaddq_rot270_m_s32(inactive, a, b, p);
+#endif
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vhsubq.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vhsubq.c
new file mode 100644
index 0000000..633fd32
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vhsubq.c
@@ -0,0 +1,95 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vhsubq_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vhsub.v16i8(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 1)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vhsubq_u8(uint8x16_t a, uint8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vhsubq(a, b);
+#else /* POLYMORPHIC */
+ return vhsubq_u8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vhsubq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vhsub.v8i16(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 0)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vhsubq_s16(int16x8_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vhsubq(a, b);
+#else /* POLYMORPHIC */
+ return vhsubq_s16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vhsubq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vhsub.v4i32(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vhsubq_u32(uint32x4_t a, uint32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vhsubq(a, b);
+#else /* POLYMORPHIC */
+ return vhsubq_u32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vhsubq_m_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.hsub.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 0, <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vhsubq_m_s8(int8x16_t inactive, int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vhsubq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vhsubq_m_s8(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vhsubq_m_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.hsub.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vhsubq_m_u16(uint16x8_t inactive, uint16x8_t a, uint16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vhsubq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vhsubq_m_u16(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vhsubq_m_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.hsub.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 0, <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vhsubq_m_s32(int32x4_t inactive, int32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vhsubq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vhsubq_m_s32(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vld24.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vld24.c
new file mode 100644
index 0000000..a0f37fe
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vld24.c
@@ -0,0 +1,142 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg -sroa -early-cse | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg -sroa -early-cse | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vld2q_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call { <8 x half>, <8 x half> } @llvm.arm.mve.vld2q.v8f16.p0f16(half* [[ADDR:%.*]])
+// CHECK-NEXT: [[TMP1:%.*]] = extractvalue { <8 x half>, <8 x half> } [[TMP0]], 0
+// CHECK-NEXT: [[TMP2:%.*]] = insertvalue [[STRUCT_FLOAT16X8X2_T:%.*]] undef, <8 x half> [[TMP1]], 0, 0
+// CHECK-NEXT: [[TMP3:%.*]] = extractvalue { <8 x half>, <8 x half> } [[TMP0]], 1
+// CHECK-NEXT: [[TMP4:%.*]] = insertvalue [[STRUCT_FLOAT16X8X2_T]] %2, <8 x half> [[TMP3]], 0, 1
+// CHECK-NEXT: ret [[STRUCT_FLOAT16X8X2_T]] %4
+//
+float16x8x2_t test_vld2q_f16(const float16_t *addr)
+{
+#ifdef POLYMORPHIC
+ return vld2q(addr);
+#else /* POLYMORPHIC */
+ return vld2q_f16(addr);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vld4q_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call { <16 x i8>, <16 x i8>, <16 x i8>, <16 x i8> } @llvm.arm.mve.vld4q.v16i8.p0i8(i8* [[ADDR:%.*]])
+// CHECK-NEXT: [[TMP1:%.*]] = extractvalue { <16 x i8>, <16 x i8>, <16 x i8>, <16 x i8> } [[TMP0]], 0
+// CHECK-NEXT: [[TMP2:%.*]] = insertvalue [[STRUCT_UINT8X16X4_T:%.*]] undef, <16 x i8> [[TMP1]], 0, 0
+// CHECK-NEXT: [[TMP3:%.*]] = extractvalue { <16 x i8>, <16 x i8>, <16 x i8>, <16 x i8> } [[TMP0]], 1
+// CHECK-NEXT: [[TMP4:%.*]] = insertvalue [[STRUCT_UINT8X16X4_T]] %2, <16 x i8> [[TMP3]], 0, 1
+// CHECK-NEXT: [[TMP5:%.*]] = extractvalue { <16 x i8>, <16 x i8>, <16 x i8>, <16 x i8> } [[TMP0]], 2
+// CHECK-NEXT: [[TMP6:%.*]] = insertvalue [[STRUCT_UINT8X16X4_T]] %4, <16 x i8> [[TMP5]], 0, 2
+// CHECK-NEXT: [[TMP7:%.*]] = extractvalue { <16 x i8>, <16 x i8>, <16 x i8>, <16 x i8> } [[TMP0]], 3
+// CHECK-NEXT: [[TMP8:%.*]] = insertvalue [[STRUCT_UINT8X16X4_T]] %6, <16 x i8> [[TMP7]], 0, 3
+// CHECK-NEXT: ret [[STRUCT_UINT8X16X4_T]] %8
+//
+uint8x16x4_t test_vld4q_u8(const uint8_t *addr)
+{
+#ifdef POLYMORPHIC
+ return vld4q(addr);
+#else /* POLYMORPHIC */
+ return vld4q_u8(addr);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vst2q_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[VALUE_COERCE_FCA_0_0_EXTRACT:%.*]] = extractvalue [[STRUCT_UINT32X4X2_T:%.*]] %value.coerce, 0, 0
+// CHECK-NEXT: [[VALUE_COERCE_FCA_0_1_EXTRACT:%.*]] = extractvalue [[STRUCT_UINT32X4X2_T]] %value.coerce, 0, 1
+// CHECK-NEXT: call void @llvm.arm.mve.vst2q.p0i32.v4i32(i32* [[ADDR:%.*]], <4 x i32> [[VALUE_COERCE_FCA_0_0_EXTRACT]], <4 x i32> [[VALUE_COERCE_FCA_0_1_EXTRACT]], i32 0)
+// CHECK-NEXT: call void @llvm.arm.mve.vst2q.p0i32.v4i32(i32* [[ADDR]], <4 x i32> [[VALUE_COERCE_FCA_0_0_EXTRACT]], <4 x i32> [[VALUE_COERCE_FCA_0_1_EXTRACT]], i32 1)
+// CHECK-NEXT: ret void
+//
+void test_vst2q_u32(uint32_t *addr, uint32x4x2_t value)
+{
+#ifdef POLYMORPHIC
+ vst2q(addr, value);
+#else /* POLYMORPHIC */
+ vst2q_u32(addr, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vst4q_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[VALUE_COERCE_FCA_0_0_EXTRACT:%.*]] = extractvalue [[STRUCT_INT8X16X4_T:%.*]] %value.coerce, 0, 0
+// CHECK-NEXT: [[VALUE_COERCE_FCA_0_1_EXTRACT:%.*]] = extractvalue [[STRUCT_INT8X16X4_T]] %value.coerce, 0, 1
+// CHECK-NEXT: [[VALUE_COERCE_FCA_0_2_EXTRACT:%.*]] = extractvalue [[STRUCT_INT8X16X4_T]] %value.coerce, 0, 2
+// CHECK-NEXT: [[VALUE_COERCE_FCA_0_3_EXTRACT:%.*]] = extractvalue [[STRUCT_INT8X16X4_T]] %value.coerce, 0, 3
+// CHECK-NEXT: call void @llvm.arm.mve.vst4q.p0i8.v16i8(i8* [[ADDR:%.*]], <16 x i8> [[VALUE_COERCE_FCA_0_0_EXTRACT]], <16 x i8> [[VALUE_COERCE_FCA_0_1_EXTRACT]], <16 x i8> [[VALUE_COERCE_FCA_0_2_EXTRACT]], <16 x i8> [[VALUE_COERCE_FCA_0_3_EXTRACT]], i32 0)
+// CHECK-NEXT: call void @llvm.arm.mve.vst4q.p0i8.v16i8(i8* [[ADDR]], <16 x i8> [[VALUE_COERCE_FCA_0_0_EXTRACT]], <16 x i8> [[VALUE_COERCE_FCA_0_1_EXTRACT]], <16 x i8> [[VALUE_COERCE_FCA_0_2_EXTRACT]], <16 x i8> [[VALUE_COERCE_FCA_0_3_EXTRACT]], i32 1)
+// CHECK-NEXT: call void @llvm.arm.mve.vst4q.p0i8.v16i8(i8* [[ADDR]], <16 x i8> [[VALUE_COERCE_FCA_0_0_EXTRACT]], <16 x i8> [[VALUE_COERCE_FCA_0_1_EXTRACT]], <16 x i8> [[VALUE_COERCE_FCA_0_2_EXTRACT]], <16 x i8> [[VALUE_COERCE_FCA_0_3_EXTRACT]], i32 2)
+// CHECK-NEXT: call void @llvm.arm.mve.vst4q.p0i8.v16i8(i8* [[ADDR]], <16 x i8> [[VALUE_COERCE_FCA_0_0_EXTRACT]], <16 x i8> [[VALUE_COERCE_FCA_0_1_EXTRACT]], <16 x i8> [[VALUE_COERCE_FCA_0_2_EXTRACT]], <16 x i8> [[VALUE_COERCE_FCA_0_3_EXTRACT]], i32 3)
+// CHECK-NEXT: ret void
+//
+void test_vst4q_s8(int8_t *addr, int8x16x4_t value)
+{
+#ifdef POLYMORPHIC
+ vst4q(addr, value);
+#else /* POLYMORPHIC */
+ vst4q_s8(addr, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vst2q_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[VALUE_COERCE_FCA_0_0_EXTRACT:%.*]] = extractvalue [[STRUCT_FLOAT16X8X2_T:%.*]] %value.coerce, 0, 0
+// CHECK-NEXT: [[VALUE_COERCE_FCA_0_1_EXTRACT:%.*]] = extractvalue [[STRUCT_FLOAT16X8X2_T]] %value.coerce, 0, 1
+// CHECK-NEXT: call void @llvm.arm.mve.vst2q.p0f16.v8f16(half* [[ADDR:%.*]], <8 x half> [[VALUE_COERCE_FCA_0_0_EXTRACT]], <8 x half> [[VALUE_COERCE_FCA_0_1_EXTRACT]], i32 0)
+// CHECK-NEXT: call void @llvm.arm.mve.vst2q.p0f16.v8f16(half* [[ADDR]], <8 x half> [[VALUE_COERCE_FCA_0_0_EXTRACT]], <8 x half> [[VALUE_COERCE_FCA_0_1_EXTRACT]], i32 1)
+// CHECK-NEXT: ret void
+//
+void test_vst2q_f16(float16_t *addr, float16x8x2_t value)
+{
+#ifdef POLYMORPHIC
+ vst2q(addr, value);
+#else /* POLYMORPHIC */
+ vst2q_f16(addr, value);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @load_into_variable(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call { <8 x i16>, <8 x i16> } @llvm.arm.mve.vld2q.v8i16.p0i16(i16* [[ADDR:%.*]])
+// CHECK-NEXT: [[TMP1:%.*]] = extractvalue { <8 x i16>, <8 x i16> } [[TMP0]], 0
+// CHECK-NEXT: [[TMP2:%.*]] = insertvalue [[STRUCT_UINT16X8X2_T:%.*]] undef, <8 x i16> [[TMP1]], 0, 0
+// CHECK-NEXT: [[TMP3:%.*]] = extractvalue { <8 x i16>, <8 x i16> } [[TMP0]], 1
+// CHECK-NEXT: [[TMP4:%.*]] = insertvalue [[STRUCT_UINT16X8X2_T]] [[TMP2]], <8 x i16> [[TMP3]], 0, 1
+// CHECK-NEXT: store <8 x i16> [[TMP1]], <8 x i16>* [[VALUES:%.*]], align 8
+// CHECK-NEXT: [[ARRAYIDX4:%.*]] = getelementptr inbounds <8 x i16>, <8 x i16>* [[VALUES]], i32 1
+// CHECK-NEXT: store <8 x i16> [[TMP3]], <8 x i16>* [[ARRAYIDX4]], align 8
+// CHECK-NEXT: ret void
+//
+void load_into_variable(const uint16_t *addr, uint16x8_t *values)
+{
+ uint16x8x2_t v;
+#ifdef POLYMORPHIC
+ v = vld2q(addr);
+#else /* POLYMORPHIC */
+ v = vld2q_u16(addr);
+#endif /* POLYMORPHIC */
+ values[0] = v.val[0];
+ values[1] = v.val[1];
+}
+
+// CHECK-LABEL: @extract_one_vector(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call { <4 x i32>, <4 x i32> } @llvm.arm.mve.vld2q.v4i32.p0i32(i32* [[ADDR:%.*]])
+// CHECK-NEXT: [[TMP1:%.*]] = extractvalue { <4 x i32>, <4 x i32> } [[TMP0]], 0
+// CHECK-NEXT: [[TMP2:%.*]] = insertvalue [[STRUCT_INT32X4X2_T:%.*]] undef, <4 x i32> [[TMP1]], 0, 0
+// CHECK-NEXT: [[TMP3:%.*]] = extractvalue { <4 x i32>, <4 x i32> } [[TMP0]], 1
+// CHECK-NEXT: [[TMP4:%.*]] = insertvalue [[STRUCT_INT32X4X2_T]] [[TMP2]], <4 x i32> [[TMP3]], 0, 1
+// CHECK-NEXT: ret <4 x i32> [[TMP1]]
+//
+int32x4_t extract_one_vector(const int32_t *addr)
+{
+#ifdef POLYMORPHIC
+ return vld2q(addr).val[0];
+#else /* POLYMORPHIC */
+ return vld2q_s32(addr).val[0];
+#endif /* POLYMORPHIC */
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vldr.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vldr.c
new file mode 100644
index 0000000..e394ed1
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vldr.c
@@ -0,0 +1,48 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vldrwq_gather_base_wb_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = load <4 x i32>, <4 x i32>* [[ADDR:%.*]], align 8
+// CHECK-NEXT: [[TMP1:%.*]] = call { <4 x i32>, <4 x i32> } @llvm.arm.mve.vldr.gather.base.wb.v4i32.v4i32(<4 x i32> [[TMP0]], i32 80)
+// CHECK-NEXT: [[TMP2:%.*]] = extractvalue { <4 x i32>, <4 x i32> } [[TMP1]], 1
+// CHECK-NEXT: store <4 x i32> [[TMP2]], <4 x i32>* [[ADDR]], align 8
+// CHECK-NEXT: [[TMP3:%.*]] = extractvalue { <4 x i32>, <4 x i32> } [[TMP1]], 0
+// CHECK-NEXT: ret <4 x i32> [[TMP3]]
+//
+int32x4_t test_vldrwq_gather_base_wb_s32(uint32x4_t *addr)
+{
+ return vldrwq_gather_base_wb_s32(addr, 0x50);
+}
+
+// CHECK-LABEL: @test_vldrwq_gather_base_wb_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = load <4 x i32>, <4 x i32>* [[ADDR:%.*]], align 8
+// CHECK-NEXT: [[TMP1:%.*]] = call { <4 x float>, <4 x i32> } @llvm.arm.mve.vldr.gather.base.wb.v4f32.v4i32(<4 x i32> [[TMP0]], i32 64)
+// CHECK-NEXT: [[TMP2:%.*]] = extractvalue { <4 x float>, <4 x i32> } [[TMP1]], 1
+// CHECK-NEXT: store <4 x i32> [[TMP2]], <4 x i32>* [[ADDR]], align 8
+// CHECK-NEXT: [[TMP3:%.*]] = extractvalue { <4 x float>, <4 x i32> } [[TMP1]], 0
+// CHECK-NEXT: ret <4 x float> [[TMP3]]
+//
+float32x4_t test_vldrwq_gather_base_wb_f32(uint32x4_t *addr)
+{
+ return vldrwq_gather_base_wb_f32(addr, 0x40);
+}
+
+// CHECK-LABEL: @test_vldrdq_gather_base_wb_z_u64(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = load <2 x i64>, <2 x i64>* [[ADDR:%.*]], align 8
+// CHECK-NEXT: [[TMP1:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = call { <2 x i64>, <2 x i64> } @llvm.arm.mve.vldr.gather.base.wb.predicated.v2i64.v2i64.v4i1(<2 x i64> [[TMP0]], i32 656, <4 x i1> [[TMP2]])
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { <2 x i64>, <2 x i64> } [[TMP3]], 1
+// CHECK-NEXT: store <2 x i64> [[TMP4]], <2 x i64>* [[ADDR]], align 8
+// CHECK-NEXT: [[TMP5:%.*]] = extractvalue { <2 x i64>, <2 x i64> } [[TMP3]], 0
+// CHECK-NEXT: ret <2 x i64> [[TMP5]]
+//
+uint64x2_t test_vldrdq_gather_base_wb_z_u64(uint64x2_t *addr, mve_pred16_t p)
+{
+ return vldrdq_gather_base_wb_z_u64(addr, 0x290, p);
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vmaxnmq.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vmaxnmq.c
new file mode 100644
index 0000000..5395081
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vmaxnmq.c
@@ -0,0 +1,97 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O3 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O3 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vmaxnmq_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = tail call <8 x half> @llvm.maxnum.v8f16(<8 x half> [[A:%.*]], <8 x half> [[B:%.*]])
+// CHECK-NEXT: ret <8 x half> [[TMP0]]
+//
+float16x8_t test_vmaxnmq_f16(float16x8_t a, float16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vmaxnmq(a, b);
+#else /* POLYMORPHIC */
+ return vmaxnmq_f16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmaxnmq_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = tail call <4 x float> @llvm.maxnum.v4f32(<4 x float> [[A:%.*]], <4 x float> [[B:%.*]])
+// CHECK-NEXT: ret <4 x float> [[TMP0]]
+//
+float32x4_t test_vmaxnmq_f32(float32x4_t a, float32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vmaxnmq(a, b);
+#else /* POLYMORPHIC */
+ return vmaxnmq_f32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmaxnmq_m_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = tail call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = tail call <8 x half> @llvm.arm.mve.max.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x half> [[B:%.*]], i32 0, <8 x i1> [[TMP1]], <8 x half> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x half> [[TMP2]]
+//
+float16x8_t test_vmaxnmq_m_f16(float16x8_t inactive, float16x8_t a, float16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vmaxnmq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vmaxnmq_m_f16(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmaxnmq_m_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = tail call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = tail call <4 x float> @llvm.arm.mve.max.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x float> [[B:%.*]], i32 0, <4 x i1> [[TMP1]], <4 x float> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x float> [[TMP2]]
+//
+float32x4_t test_vmaxnmq_m_f32(float32x4_t inactive, float32x4_t a, float32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vmaxnmq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vmaxnmq_m_f32(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmaxnmq_x_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = tail call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = tail call <8 x half> @llvm.arm.mve.max.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x half> [[B:%.*]], i32 0, <8 x i1> [[TMP1]], <8 x half> undef)
+// CHECK-NEXT: ret <8 x half> [[TMP2]]
+//
+float16x8_t test_vmaxnmq_x_f16(float16x8_t a, float16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vmaxnmq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vmaxnmq_x_f16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmaxnmq_x_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = tail call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = tail call <4 x float> @llvm.arm.mve.max.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x float> [[B:%.*]], i32 0, <4 x i1> [[TMP1]], <4 x float> undef)
+// CHECK-NEXT: ret <4 x float> [[TMP2]]
+//
+float32x4_t test_vmaxnmq_x_f32(float32x4_t a, float32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vmaxnmq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vmaxnmq_x_f32(a, b, p);
+#endif /* POLYMORPHIC */
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vmaxq.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vmaxq.c
new file mode 100644
index 0000000..93fb24d
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vmaxq.c
@@ -0,0 +1,146 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O3 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O3 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vmaxq_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = icmp slt <16 x i8> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = select <16 x i1> [[TMP0]], <16 x i8> [[B]], <16 x i8> [[A]]
+// CHECK-NEXT: ret <16 x i8> [[TMP1]]
+//
+int8x16_t test_vmaxq_s8(int8x16_t a, int8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vmaxq(a, b);
+#else /* POLYMORPHIC */
+ return vmaxq_s8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmaxq_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = icmp ult <8 x i16> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = select <8 x i1> [[TMP0]], <8 x i16> [[B]], <8 x i16> [[A]]
+// CHECK-NEXT: ret <8 x i16> [[TMP1]]
+//
+uint16x8_t test_vmaxq_u16(uint16x8_t a, uint16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vmaxq(a, b);
+#else /* POLYMORPHIC */
+ return vmaxq_u16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmaxq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = icmp slt <4 x i32> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = select <4 x i1> [[TMP0]], <4 x i32> [[B]], <4 x i32> [[A]]
+// CHECK-NEXT: ret <4 x i32> [[TMP1]]
+//
+int32x4_t test_vmaxq_s32(int32x4_t a, int32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vmaxq(a, b);
+#else /* POLYMORPHIC */
+ return vmaxq_s32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmaxq_m_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = tail call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = tail call <16 x i8> @llvm.arm.mve.max.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 1, <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vmaxq_m_u8(uint8x16_t inactive, uint8x16_t a, uint8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vmaxq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vmaxq_m_u8(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmaxq_m_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = tail call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = tail call <8 x i16> @llvm.arm.mve.max.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 0, <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vmaxq_m_s16(int16x8_t inactive, int16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vmaxq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vmaxq_m_s16(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmaxq_m_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = tail call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = tail call <4 x i32> @llvm.arm.mve.max.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vmaxq_m_u32(uint32x4_t inactive, uint32x4_t a, uint32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vmaxq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vmaxq_m_u32(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmaxq_x_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = tail call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = tail call <16 x i8> @llvm.arm.mve.max.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 1, <16 x i1> [[TMP1]], <16 x i8> undef)
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vmaxq_x_u8(uint8x16_t a, uint8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vmaxq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vmaxq_x_u8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmaxq_x_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = tail call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = tail call <8 x i16> @llvm.arm.mve.max.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, <8 x i1> [[TMP1]], <8 x i16> undef)
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vmaxq_x_u16(uint16x8_t a, uint16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vmaxq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vmaxq_x_u16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmaxq_x_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = tail call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = tail call <4 x i32> @llvm.arm.mve.max.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 0, <4 x i1> [[TMP1]], <4 x i32> undef)
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vmaxq_x_s32(int32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vmaxq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vmaxq_x_s32(a, b, p);
+#endif /* POLYMORPHIC */
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vminnmq.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vminnmq.c
new file mode 100644
index 0000000..f951afe
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vminnmq.c
@@ -0,0 +1,97 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O3 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O3 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vminnmq_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = tail call <8 x half> @llvm.minnum.v8f16(<8 x half> [[A:%.*]], <8 x half> [[B:%.*]])
+// CHECK-NEXT: ret <8 x half> [[TMP0]]
+//
+float16x8_t test_vminnmq_f16(float16x8_t a, float16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vminnmq(a, b);
+#else /* POLYMORPHIC */
+ return vminnmq_f16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vminnmq_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = tail call <4 x float> @llvm.minnum.v4f32(<4 x float> [[A:%.*]], <4 x float> [[B:%.*]])
+// CHECK-NEXT: ret <4 x float> [[TMP0]]
+//
+float32x4_t test_vminnmq_f32(float32x4_t a, float32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vminnmq(a, b);
+#else /* POLYMORPHIC */
+ return vminnmq_f32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vminnmq_m_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = tail call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = tail call <8 x half> @llvm.arm.mve.min.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x half> [[B:%.*]], i32 0, <8 x i1> [[TMP1]], <8 x half> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x half> [[TMP2]]
+//
+float16x8_t test_vminnmq_m_f16(float16x8_t inactive, float16x8_t a, float16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vminnmq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vminnmq_m_f16(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vminnmq_m_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = tail call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = tail call <4 x float> @llvm.arm.mve.min.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x float> [[B:%.*]], i32 0, <4 x i1> [[TMP1]], <4 x float> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x float> [[TMP2]]
+//
+float32x4_t test_vminnmq_m_f32(float32x4_t inactive, float32x4_t a, float32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vminnmq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vminnmq_m_f32(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vminnmq_x_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = tail call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = tail call <8 x half> @llvm.arm.mve.min.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x half> [[B:%.*]], i32 0, <8 x i1> [[TMP1]], <8 x half> undef)
+// CHECK-NEXT: ret <8 x half> [[TMP2]]
+//
+float16x8_t test_vminnmq_x_f16(float16x8_t a, float16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vminnmq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vminnmq_x_f16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vminnmq_x_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = tail call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = tail call <4 x float> @llvm.arm.mve.min.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x float> [[B:%.*]], i32 0, <4 x i1> [[TMP1]], <4 x float> undef)
+// CHECK-NEXT: ret <4 x float> [[TMP2]]
+//
+float32x4_t test_vminnmq_x_f32(float32x4_t a, float32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vminnmq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vminnmq_x_f32(a, b, p);
+#endif /* POLYMORPHIC */
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vminq.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vminq.c
new file mode 100644
index 0000000..105c5d6
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vminq.c
@@ -0,0 +1,146 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O3 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O3 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vminq_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = icmp ugt <16 x i8> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = select <16 x i1> [[TMP0]], <16 x i8> [[B]], <16 x i8> [[A]]
+// CHECK-NEXT: ret <16 x i8> [[TMP1]]
+//
+uint8x16_t test_vminq_u8(uint8x16_t a, uint8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vminq(a, b);
+#else /* POLYMORPHIC */
+ return vminq_u8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vminq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = icmp sgt <8 x i16> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = select <8 x i1> [[TMP0]], <8 x i16> [[B]], <8 x i16> [[A]]
+// CHECK-NEXT: ret <8 x i16> [[TMP1]]
+//
+int16x8_t test_vminq_s16(int16x8_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vminq(a, b);
+#else /* POLYMORPHIC */
+ return vminq_s16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vminq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = icmp ugt <4 x i32> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: [[TMP1:%.*]] = select <4 x i1> [[TMP0]], <4 x i32> [[B]], <4 x i32> [[A]]
+// CHECK-NEXT: ret <4 x i32> [[TMP1]]
+//
+uint32x4_t test_vminq_u32(uint32x4_t a, uint32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vminq(a, b);
+#else /* POLYMORPHIC */
+ return vminq_u32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vminq_m_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = tail call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = tail call <16 x i8> @llvm.arm.mve.min.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 0, <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vminq_m_s8(int8x16_t inactive, int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vminq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vminq_m_s8(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vminq_m_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = tail call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = tail call <8 x i16> @llvm.arm.mve.min.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vminq_m_u16(uint16x8_t inactive, uint16x8_t a, uint16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vminq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vminq_m_u16(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vminq_m_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = tail call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = tail call <4 x i32> @llvm.arm.mve.min.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 0, <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vminq_m_s32(int32x4_t inactive, int32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vminq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vminq_m_s32(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vminq_x_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = tail call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = tail call <16 x i8> @llvm.arm.mve.min.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 1, <16 x i1> [[TMP1]], <16 x i8> undef)
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vminq_x_u8(uint8x16_t a, uint8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vminq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vminq_x_u8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vminq_x_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = tail call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = tail call <8 x i16> @llvm.arm.mve.min.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 0, <8 x i1> [[TMP1]], <8 x i16> undef)
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vminq_x_s16(int16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vminq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vminq_x_s16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vminq_x_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = tail call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = tail call <4 x i32> @llvm.arm.mve.min.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, <4 x i1> [[TMP1]], <4 x i32> undef)
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vminq_x_s32(uint32x4_t a, uint32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vminq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vminq_x_u32(a, b, p);
+#endif /* POLYMORPHIC */
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vminvq.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vminvq.c
new file mode 100644
index 0000000..1cf4d0e
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vminvq.c
@@ -0,0 +1,97 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vminvq_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i8 [[A:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.minv.s.v16i8(i32 [[TMP0]], <16 x i8> [[B:%.*]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i8
+// CHECK-NEXT: ret i8 [[TMP2]]
+//
+int8_t test_vminvq_s8(int8_t a, int8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vminvq(a, b);
+#else /* POLYMORPHIC */
+ return vminvq_s8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vminvq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[A:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.minv.s.v8i16(i32 [[TMP0]], <8 x i16> [[B:%.*]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+int16_t test_vminvq_s16(int16_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vminvq(a, b);
+#else /* POLYMORPHIC */
+ return vminvq_s16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vminvq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.minv.s.v4i32(i32 [[A:%.*]], <4 x i32> [[B:%.*]])
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+int32_t test_vminvq_s32(int32_t a, int32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vminvq(a, b);
+#else /* POLYMORPHIC */
+ return vminvq_s32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vminvq_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i8 [[A:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.minv.u.v16i8(i32 [[TMP0]], <16 x i8> [[B:%.*]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i8
+// CHECK-NEXT: ret i8 [[TMP2]]
+//
+uint8_t test_vminvq_u8(uint8_t a, uint8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vminvq(a, b);
+#else /* POLYMORPHIC */
+ return vminvq_u8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vminvq_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[A:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.mve.minv.u.v8i16(i32 [[TMP0]], <8 x i16> [[B:%.*]])
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
+// CHECK-NEXT: ret i16 [[TMP2]]
+//
+uint16_t test_vminvq_u16(uint16_t a, uint16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vminvq(a, b);
+#else /* POLYMORPHIC */
+ return vminvq_u16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vminvq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.minv.u.v4i32(i32 [[A:%.*]], <4 x i32> [[B:%.*]])
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+uint32_t test_vminvq_u32(uint32_t a, uint32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vminvq(a, b);
+#else /* POLYMORPHIC */
+ return vminvq_u32(a, b);
+#endif /* POLYMORPHIC */
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vmldav.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vmldav.c
new file mode 100644
index 0000000..60339ff
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vmldav.c
@@ -0,0 +1,845 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg -sroa | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg -sroa | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vmladavaq_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.vmldava.v16i8(i32 0, i32 0, i32 0, i32 [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i8> [[C:%.*]])
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+int32_t test_vmladavaq_s8(int32_t a, int8x16_t b, int8x16_t c) {
+#ifdef POLYMORPHIC
+ return vmladavaq(a, b, c);
+#else
+ return vmladavaq_s8(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vmladavaq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.vmldava.v8i16(i32 0, i32 0, i32 0, i32 [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i16> [[C:%.*]])
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+int32_t test_vmladavaq_s16(int32_t a, int16x8_t b, int16x8_t c) {
+#ifdef POLYMORPHIC
+ return vmladavaq(a, b, c);
+#else
+ return vmladavaq_s16(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vmladavaq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.vmldava.v4i32(i32 0, i32 0, i32 0, i32 [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i32> [[C:%.*]])
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+int32_t test_vmladavaq_s32(int32_t a, int32x4_t b, int32x4_t c) {
+#ifdef POLYMORPHIC
+ return vmladavaq(a, b, c);
+#else
+ return vmladavaq_s32(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vmladavaq_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.vmldava.v16i8(i32 1, i32 0, i32 0, i32 [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i8> [[C:%.*]])
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+uint32_t test_vmladavaq_u8(uint32_t a, uint8x16_t b, uint8x16_t c) {
+#ifdef POLYMORPHIC
+ return vmladavaq(a, b, c);
+#else
+ return vmladavaq_u8(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vmladavaq_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.vmldava.v8i16(i32 1, i32 0, i32 0, i32 [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i16> [[C:%.*]])
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+uint32_t test_vmladavaq_u16(uint32_t a, uint16x8_t b, uint16x8_t c) {
+#ifdef POLYMORPHIC
+ return vmladavaq(a, b, c);
+#else
+ return vmladavaq_u16(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vmladavaq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.vmldava.v4i32(i32 1, i32 0, i32 0, i32 [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i32> [[C:%.*]])
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+uint32_t test_vmladavaq_u32(uint32_t a, uint32x4_t b, uint32x4_t c) {
+#ifdef POLYMORPHIC
+ return vmladavaq(a, b, c);
+#else
+ return vmladavaq_u32(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vmladavaxq_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.vmldava.v16i8(i32 0, i32 0, i32 1, i32 [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i8> [[C:%.*]])
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+int32_t test_vmladavaxq_s8(int32_t a, int8x16_t b, int8x16_t c) {
+#ifdef POLYMORPHIC
+ return vmladavaxq(a, b, c);
+#else
+ return vmladavaxq_s8(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vmladavaxq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.vmldava.v8i16(i32 0, i32 0, i32 1, i32 [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i16> [[C:%.*]])
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+int32_t test_vmladavaxq_s16(int32_t a, int16x8_t b, int16x8_t c) {
+#ifdef POLYMORPHIC
+ return vmladavaxq(a, b, c);
+#else
+ return vmladavaxq_s16(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vmladavaxq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.vmldava.v4i32(i32 0, i32 0, i32 1, i32 [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i32> [[C:%.*]])
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+int32_t test_vmladavaxq_s32(int32_t a, int32x4_t b, int32x4_t c) {
+#ifdef POLYMORPHIC
+ return vmladavaxq(a, b, c);
+#else
+ return vmladavaxq_s32(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlsdavaq_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.vmldava.v16i8(i32 0, i32 1, i32 0, i32 [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i8> [[C:%.*]])
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+int32_t test_vmlsdavaq_s8(int32_t a, int8x16_t b, int8x16_t c) {
+#ifdef POLYMORPHIC
+ return vmlsdavaq(a, b, c);
+#else
+ return vmlsdavaq_s8(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlsdavaq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.vmldava.v8i16(i32 0, i32 1, i32 0, i32 [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i16> [[C:%.*]])
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+int32_t test_vmlsdavaq_s16(int32_t a, int16x8_t b, int16x8_t c) {
+#ifdef POLYMORPHIC
+ return vmlsdavaq(a, b, c);
+#else
+ return vmlsdavaq_s16(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlsdavaq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.vmldava.v4i32(i32 0, i32 1, i32 0, i32 [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i32> [[C:%.*]])
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+int32_t test_vmlsdavaq_s32(int32_t a, int32x4_t b, int32x4_t c) {
+#ifdef POLYMORPHIC
+ return vmlsdavaq(a, b, c);
+#else
+ return vmlsdavaq_s32(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlsdavaxq_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.vmldava.v16i8(i32 0, i32 1, i32 1, i32 [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i8> [[C:%.*]])
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+int32_t test_vmlsdavaxq_s8(int32_t a, int8x16_t b, int8x16_t c) {
+#ifdef POLYMORPHIC
+ return vmlsdavaxq(a, b, c);
+#else
+ return vmlsdavaxq_s8(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlsdavaxq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.vmldava.v8i16(i32 0, i32 1, i32 1, i32 [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i16> [[C:%.*]])
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+int32_t test_vmlsdavaxq_s16(int32_t a, int16x8_t b, int16x8_t c) {
+#ifdef POLYMORPHIC
+ return vmlsdavaxq(a, b, c);
+#else
+ return vmlsdavaxq_s16(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlsdavaxq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.vmldava.v4i32(i32 0, i32 1, i32 1, i32 [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i32> [[C:%.*]])
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+int32_t test_vmlsdavaxq_s32(int32_t a, int32x4_t b, int32x4_t c) {
+#ifdef POLYMORPHIC
+ return vmlsdavaxq(a, b, c);
+#else
+ return vmlsdavaxq_s32(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vmladavaq_p_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.arm.mve.vmldava.predicated.v16i8.v16i1(i32 0, i32 0, i32 0, i32 [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i8> [[C:%.*]], <16 x i1> [[TMP1]])
+// CHECK-NEXT: ret i32 [[TMP2]]
+//
+int32_t test_vmladavaq_p_s8(int32_t a, int8x16_t b, int8x16_t c, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmladavaq_p(a, b, c, p);
+#else
+ return vmladavaq_p_s8(a, b, c, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmladavaq_p_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.arm.mve.vmldava.predicated.v8i16.v8i1(i32 0, i32 0, i32 0, i32 [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i16> [[C:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret i32 [[TMP2]]
+//
+int32_t test_vmladavaq_p_s16(int32_t a, int16x8_t b, int16x8_t c, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmladavaq_p(a, b, c, p);
+#else
+ return vmladavaq_p_s16(a, b, c, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmladavaq_p_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.arm.mve.vmldava.predicated.v4i32.v4i1(i32 0, i32 0, i32 0, i32 [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i32> [[C:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret i32 [[TMP2]]
+//
+int32_t test_vmladavaq_p_s32(int32_t a, int32x4_t b, int32x4_t c, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmladavaq_p(a, b, c, p);
+#else
+ return vmladavaq_p_s32(a, b, c, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmladavaq_p_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.arm.mve.vmldava.predicated.v16i8.v16i1(i32 1, i32 0, i32 0, i32 [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i8> [[C:%.*]], <16 x i1> [[TMP1]])
+// CHECK-NEXT: ret i32 [[TMP2]]
+//
+uint32_t test_vmladavaq_p_u8(uint32_t a, uint8x16_t b, uint8x16_t c, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmladavaq_p(a, b, c, p);
+#else
+ return vmladavaq_p_u8(a, b, c, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmladavaq_p_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.arm.mve.vmldava.predicated.v8i16.v8i1(i32 1, i32 0, i32 0, i32 [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i16> [[C:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret i32 [[TMP2]]
+//
+uint32_t test_vmladavaq_p_u16(uint32_t a, uint16x8_t b, uint16x8_t c, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmladavaq_p(a, b, c, p);
+#else
+ return vmladavaq_p_u16(a, b, c, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmladavaq_p_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.arm.mve.vmldava.predicated.v4i32.v4i1(i32 1, i32 0, i32 0, i32 [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i32> [[C:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret i32 [[TMP2]]
+//
+uint32_t test_vmladavaq_p_u32(uint32_t a, uint32x4_t b, uint32x4_t c, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmladavaq_p(a, b, c, p);
+#else
+ return vmladavaq_p_u32(a, b, c, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmladavaxq_p_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.arm.mve.vmldava.predicated.v16i8.v16i1(i32 0, i32 0, i32 1, i32 [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i8> [[C:%.*]], <16 x i1> [[TMP1]])
+// CHECK-NEXT: ret i32 [[TMP2]]
+//
+int32_t test_vmladavaxq_p_s8(int32_t a, int8x16_t b, int8x16_t c, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmladavaxq_p(a, b, c, p);
+#else
+ return vmladavaxq_p_s8(a, b, c, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmladavaxq_p_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.arm.mve.vmldava.predicated.v8i16.v8i1(i32 0, i32 0, i32 1, i32 [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i16> [[C:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret i32 [[TMP2]]
+//
+int32_t test_vmladavaxq_p_s16(int32_t a, int16x8_t b, int16x8_t c, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmladavaxq_p(a, b, c, p);
+#else
+ return vmladavaxq_p_s16(a, b, c, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmladavaxq_p_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.arm.mve.vmldava.predicated.v4i32.v4i1(i32 0, i32 0, i32 1, i32 [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i32> [[C:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret i32 [[TMP2]]
+//
+int32_t test_vmladavaxq_p_s32(int32_t a, int32x4_t b, int32x4_t c, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmladavaxq_p(a, b, c, p);
+#else
+ return vmladavaxq_p_s32(a, b, c, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlsdavaq_p_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.arm.mve.vmldava.predicated.v16i8.v16i1(i32 0, i32 1, i32 0, i32 [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i8> [[C:%.*]], <16 x i1> [[TMP1]])
+// CHECK-NEXT: ret i32 [[TMP2]]
+//
+int32_t test_vmlsdavaq_p_s8(int32_t a, int8x16_t b, int8x16_t c, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmlsdavaq_p(a, b, c, p);
+#else
+ return vmlsdavaq_p_s8(a, b, c, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlsdavaq_p_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.arm.mve.vmldava.predicated.v8i16.v8i1(i32 0, i32 1, i32 0, i32 [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i16> [[C:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret i32 [[TMP2]]
+//
+int32_t test_vmlsdavaq_p_s16(int32_t a, int16x8_t b, int16x8_t c, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmlsdavaq_p(a, b, c, p);
+#else
+ return vmlsdavaq_p_s16(a, b, c, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlsdavaq_p_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.arm.mve.vmldava.predicated.v4i32.v4i1(i32 0, i32 1, i32 0, i32 [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i32> [[C:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret i32 [[TMP2]]
+//
+int32_t test_vmlsdavaq_p_s32(int32_t a, int32x4_t b, int32x4_t c, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmlsdavaq_p(a, b, c, p);
+#else
+ return vmlsdavaq_p_s32(a, b, c, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlsdavaxq_p_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.arm.mve.vmldava.predicated.v16i8.v16i1(i32 0, i32 1, i32 1, i32 [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i8> [[C:%.*]], <16 x i1> [[TMP1]])
+// CHECK-NEXT: ret i32 [[TMP2]]
+//
+int32_t test_vmlsdavaxq_p_s8(int32_t a, int8x16_t b, int8x16_t c, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmlsdavaxq_p(a, b, c, p);
+#else
+ return vmlsdavaxq_p_s8(a, b, c, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlsdavaxq_p_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.arm.mve.vmldava.predicated.v8i16.v8i1(i32 0, i32 1, i32 1, i32 [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i16> [[C:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret i32 [[TMP2]]
+//
+int32_t test_vmlsdavaxq_p_s16(int32_t a, int16x8_t b, int16x8_t c, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmlsdavaxq_p(a, b, c, p);
+#else
+ return vmlsdavaxq_p_s16(a, b, c, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlsdavaxq_p_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.arm.mve.vmldava.predicated.v4i32.v4i1(i32 0, i32 1, i32 1, i32 [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i32> [[C:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret i32 [[TMP2]]
+//
+int32_t test_vmlsdavaxq_p_s32(int32_t a, int32x4_t b, int32x4_t c, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmlsdavaxq_p(a, b, c, p);
+#else
+ return vmlsdavaxq_p_s32(a, b, c, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmladavq_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.vmldava.v16i8(i32 0, i32 0, i32 0, i32 0, <16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]])
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+int32_t test_vmladavq_s8(int8x16_t a, int8x16_t b) {
+#ifdef POLYMORPHIC
+ return vmladavq(a, b);
+#else
+ return vmladavq_s8(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vmladavq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.vmldava.v8i16(i32 0, i32 0, i32 0, i32 0, <8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]])
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+int32_t test_vmladavq_s16(int16x8_t a, int16x8_t b) {
+#ifdef POLYMORPHIC
+ return vmladavq(a, b);
+#else
+ return vmladavq_s16(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vmladavq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.vmldava.v4i32(i32 0, i32 0, i32 0, i32 0, <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]])
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+int32_t test_vmladavq_s32(int32x4_t a, int32x4_t b) {
+#ifdef POLYMORPHIC
+ return vmladavq(a, b);
+#else
+ return vmladavq_s32(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vmladavq_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.vmldava.v16i8(i32 1, i32 0, i32 0, i32 0, <16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]])
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+uint32_t test_vmladavq_u8(uint8x16_t a, uint8x16_t b) {
+#ifdef POLYMORPHIC
+ return vmladavq(a, b);
+#else
+ return vmladavq_u8(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vmladavq_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.vmldava.v8i16(i32 1, i32 0, i32 0, i32 0, <8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]])
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+uint32_t test_vmladavq_u16(uint16x8_t a, uint16x8_t b) {
+#ifdef POLYMORPHIC
+ return vmladavq(a, b);
+#else
+ return vmladavq_u16(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vmladavq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.vmldava.v4i32(i32 1, i32 0, i32 0, i32 0, <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]])
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+uint32_t test_vmladavq_u32(uint32x4_t a, uint32x4_t b) {
+#ifdef POLYMORPHIC
+ return vmladavq(a, b);
+#else
+ return vmladavq_u32(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vmladavxq_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.vmldava.v16i8(i32 0, i32 0, i32 1, i32 0, <16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]])
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+int32_t test_vmladavxq_s8(int8x16_t a, int8x16_t b) {
+#ifdef POLYMORPHIC
+ return vmladavxq(a, b);
+#else
+ return vmladavxq_s8(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vmladavxq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.vmldava.v8i16(i32 0, i32 0, i32 1, i32 0, <8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]])
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+int32_t test_vmladavxq_s16(int16x8_t a, int16x8_t b) {
+#ifdef POLYMORPHIC
+ return vmladavxq(a, b);
+#else
+ return vmladavxq_s16(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vmladavxq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.vmldava.v4i32(i32 0, i32 0, i32 1, i32 0, <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]])
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+int32_t test_vmladavxq_s32(int32x4_t a, int32x4_t b) {
+#ifdef POLYMORPHIC
+ return vmladavxq(a, b);
+#else
+ return vmladavxq_s32(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlsdavq_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.vmldava.v16i8(i32 0, i32 1, i32 0, i32 0, <16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]])
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+int32_t test_vmlsdavq_s8(int8x16_t a, int8x16_t b) {
+#ifdef POLYMORPHIC
+ return vmlsdavq(a, b);
+#else
+ return vmlsdavq_s8(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlsdavq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.vmldava.v8i16(i32 0, i32 1, i32 0, i32 0, <8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]])
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+int32_t test_vmlsdavq_s16(int16x8_t a, int16x8_t b) {
+#ifdef POLYMORPHIC
+ return vmlsdavq(a, b);
+#else
+ return vmlsdavq_s16(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlsdavq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.vmldava.v4i32(i32 0, i32 1, i32 0, i32 0, <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]])
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+int32_t test_vmlsdavq_s32(int32x4_t a, int32x4_t b) {
+#ifdef POLYMORPHIC
+ return vmlsdavq(a, b);
+#else
+ return vmlsdavq_s32(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlsdavxq_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.vmldava.v16i8(i32 0, i32 1, i32 1, i32 0, <16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]])
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+int32_t test_vmlsdavxq_s8(int8x16_t a, int8x16_t b) {
+#ifdef POLYMORPHIC
+ return vmlsdavxq(a, b);
+#else
+ return vmlsdavxq_s8(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlsdavxq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.vmldava.v8i16(i32 0, i32 1, i32 1, i32 0, <8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]])
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+int32_t test_vmlsdavxq_s16(int16x8_t a, int16x8_t b) {
+#ifdef POLYMORPHIC
+ return vmlsdavxq(a, b);
+#else
+ return vmlsdavxq_s16(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlsdavxq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.mve.vmldava.v4i32(i32 0, i32 1, i32 1, i32 0, <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]])
+// CHECK-NEXT: ret i32 [[TMP0]]
+//
+int32_t test_vmlsdavxq_s32(int32x4_t a, int32x4_t b) {
+#ifdef POLYMORPHIC
+ return vmlsdavxq(a, b);
+#else
+ return vmlsdavxq_s32(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vmladavq_p_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.arm.mve.vmldava.predicated.v16i8.v16i1(i32 0, i32 0, i32 0, i32 0, <16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i1> [[TMP1]])
+// CHECK-NEXT: ret i32 [[TMP2]]
+//
+int32_t test_vmladavq_p_s8(int8x16_t a, int8x16_t b, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmladavq_p(a, b, p);
+#else
+ return vmladavq_p_s8(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmladavq_p_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.arm.mve.vmldava.predicated.v8i16.v8i1(i32 0, i32 0, i32 0, i32 0, <8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret i32 [[TMP2]]
+//
+int32_t test_vmladavq_p_s16(int16x8_t a, int16x8_t b, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmladavq_p(a, b, p);
+#else
+ return vmladavq_p_s16(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmladavq_p_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.arm.mve.vmldava.predicated.v4i32.v4i1(i32 0, i32 0, i32 0, i32 0, <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret i32 [[TMP2]]
+//
+int32_t test_vmladavq_p_s32(int32x4_t a, int32x4_t b, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmladavq_p(a, b, p);
+#else
+ return vmladavq_p_s32(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmladavq_p_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.arm.mve.vmldava.predicated.v16i8.v16i1(i32 1, i32 0, i32 0, i32 0, <16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i1> [[TMP1]])
+// CHECK-NEXT: ret i32 [[TMP2]]
+//
+uint32_t test_vmladavq_p_u8(uint8x16_t a, uint8x16_t b, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmladavq_p(a, b, p);
+#else
+ return vmladavq_p_u8(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmladavq_p_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.arm.mve.vmldava.predicated.v8i16.v8i1(i32 1, i32 0, i32 0, i32 0, <8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret i32 [[TMP2]]
+//
+uint32_t test_vmladavq_p_u16(uint16x8_t a, uint16x8_t b, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmladavq_p(a, b, p);
+#else
+ return vmladavq_p_u16(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmladavq_p_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.arm.mve.vmldava.predicated.v4i32.v4i1(i32 1, i32 0, i32 0, i32 0, <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret i32 [[TMP2]]
+//
+uint32_t test_vmladavq_p_u32(uint32x4_t a, uint32x4_t b, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmladavq_p(a, b, p);
+#else
+ return vmladavq_p_u32(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmladavxq_p_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.arm.mve.vmldava.predicated.v16i8.v16i1(i32 0, i32 0, i32 1, i32 0, <16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i1> [[TMP1]])
+// CHECK-NEXT: ret i32 [[TMP2]]
+//
+int32_t test_vmladavxq_p_s8(int8x16_t a, int8x16_t b, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmladavxq_p(a, b, p);
+#else
+ return vmladavxq_p_s8(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmladavxq_p_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.arm.mve.vmldava.predicated.v8i16.v8i1(i32 0, i32 0, i32 1, i32 0, <8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret i32 [[TMP2]]
+//
+int32_t test_vmladavxq_p_s16(int16x8_t a, int16x8_t b, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmladavxq_p(a, b, p);
+#else
+ return vmladavxq_p_s16(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmladavxq_p_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.arm.mve.vmldava.predicated.v4i32.v4i1(i32 0, i32 0, i32 1, i32 0, <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret i32 [[TMP2]]
+//
+int32_t test_vmladavxq_p_s32(int32x4_t a, int32x4_t b, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmladavxq_p(a, b, p);
+#else
+ return vmladavxq_p_s32(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlsdavq_p_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.arm.mve.vmldava.predicated.v16i8.v16i1(i32 0, i32 1, i32 0, i32 0, <16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i1> [[TMP1]])
+// CHECK-NEXT: ret i32 [[TMP2]]
+//
+int32_t test_vmlsdavq_p_s8(int8x16_t a, int8x16_t b, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmlsdavq_p(a, b, p);
+#else
+ return vmlsdavq_p_s8(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlsdavq_p_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.arm.mve.vmldava.predicated.v8i16.v8i1(i32 0, i32 1, i32 0, i32 0, <8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret i32 [[TMP2]]
+//
+int32_t test_vmlsdavq_p_s16(int16x8_t a, int16x8_t b, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmlsdavq_p(a, b, p);
+#else
+ return vmlsdavq_p_s16(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlsdavq_p_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.arm.mve.vmldava.predicated.v4i32.v4i1(i32 0, i32 1, i32 0, i32 0, <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret i32 [[TMP2]]
+//
+int32_t test_vmlsdavq_p_s32(int32x4_t a, int32x4_t b, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmlsdavq_p(a, b, p);
+#else
+ return vmlsdavq_p_s32(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlsdavxq_p_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.arm.mve.vmldava.predicated.v16i8.v16i1(i32 0, i32 1, i32 1, i32 0, <16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i1> [[TMP1]])
+// CHECK-NEXT: ret i32 [[TMP2]]
+//
+int32_t test_vmlsdavxq_p_s8(int8x16_t a, int8x16_t b, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmlsdavxq_p(a, b, p);
+#else
+ return vmlsdavxq_p_s8(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlsdavxq_p_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.arm.mve.vmldava.predicated.v8i16.v8i1(i32 0, i32 1, i32 1, i32 0, <8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: ret i32 [[TMP2]]
+//
+int32_t test_vmlsdavxq_p_s16(int16x8_t a, int16x8_t b, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmlsdavxq_p(a, b, p);
+#else
+ return vmlsdavxq_p_s16(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlsdavxq_p_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.arm.mve.vmldava.predicated.v4i32.v4i1(i32 0, i32 1, i32 1, i32 0, <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: ret i32 [[TMP2]]
+//
+int32_t test_vmlsdavxq_p_s32(int32x4_t a, int32x4_t b, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmlsdavxq_p(a, b, p);
+#else
+ return vmlsdavxq_p_s32(a, b, p);
+#endif
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vmlldav.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vmlldav.c
new file mode 100644
index 0000000..8bc1e25
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vmlldav.c
@@ -0,0 +1,1295 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg -sroa | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg -sroa | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vmlaldavaq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[A:%.*]], 32
+// CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[A]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call { i32, i32 } @llvm.arm.mve.vmlldava.v8i16(i32 0, i32 0, i32 0, i32 [[TMP2]], i32 [[TMP1]], <8 x i16> [[B:%.*]], <8 x i16> [[C:%.*]])
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { i32, i32 } [[TMP3]], 1
+// CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP4]] to i64
+// CHECK-NEXT: [[TMP6:%.*]] = shl i64 [[TMP5]], 32
+// CHECK-NEXT: [[TMP7:%.*]] = extractvalue { i32, i32 } [[TMP3]], 0
+// CHECK-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
+// CHECK-NEXT: [[TMP9:%.*]] = or i64 [[TMP6]], [[TMP8]]
+// CHECK-NEXT: ret i64 [[TMP9]]
+//
+int64_t test_vmlaldavaq_s16(int64_t a, int16x8_t b, int16x8_t c) {
+#ifdef POLYMORPHIC
+ return vmlaldavaq(a, b, c);
+#else
+ return vmlaldavaq_s16(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlaldavaq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[A:%.*]], 32
+// CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[A]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call { i32, i32 } @llvm.arm.mve.vmlldava.v4i32(i32 0, i32 0, i32 0, i32 [[TMP2]], i32 [[TMP1]], <4 x i32> [[B:%.*]], <4 x i32> [[C:%.*]])
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { i32, i32 } [[TMP3]], 1
+// CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP4]] to i64
+// CHECK-NEXT: [[TMP6:%.*]] = shl i64 [[TMP5]], 32
+// CHECK-NEXT: [[TMP7:%.*]] = extractvalue { i32, i32 } [[TMP3]], 0
+// CHECK-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
+// CHECK-NEXT: [[TMP9:%.*]] = or i64 [[TMP6]], [[TMP8]]
+// CHECK-NEXT: ret i64 [[TMP9]]
+//
+int64_t test_vmlaldavaq_s32(int64_t a, int32x4_t b, int32x4_t c) {
+#ifdef POLYMORPHIC
+ return vmlaldavaq(a, b, c);
+#else
+ return vmlaldavaq_s32(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlaldavaq_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[A:%.*]], 32
+// CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[A]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call { i32, i32 } @llvm.arm.mve.vmlldava.v8i16(i32 1, i32 0, i32 0, i32 [[TMP2]], i32 [[TMP1]], <8 x i16> [[B:%.*]], <8 x i16> [[C:%.*]])
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { i32, i32 } [[TMP3]], 1
+// CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP4]] to i64
+// CHECK-NEXT: [[TMP6:%.*]] = shl i64 [[TMP5]], 32
+// CHECK-NEXT: [[TMP7:%.*]] = extractvalue { i32, i32 } [[TMP3]], 0
+// CHECK-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
+// CHECK-NEXT: [[TMP9:%.*]] = or i64 [[TMP6]], [[TMP8]]
+// CHECK-NEXT: ret i64 [[TMP9]]
+//
+uint64_t test_vmlaldavaq_u16(uint64_t a, uint16x8_t b, uint16x8_t c) {
+#ifdef POLYMORPHIC
+ return vmlaldavaq(a, b, c);
+#else
+ return vmlaldavaq_u16(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlaldavaq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[A:%.*]], 32
+// CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[A]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call { i32, i32 } @llvm.arm.mve.vmlldava.v4i32(i32 1, i32 0, i32 0, i32 [[TMP2]], i32 [[TMP1]], <4 x i32> [[B:%.*]], <4 x i32> [[C:%.*]])
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { i32, i32 } [[TMP3]], 1
+// CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP4]] to i64
+// CHECK-NEXT: [[TMP6:%.*]] = shl i64 [[TMP5]], 32
+// CHECK-NEXT: [[TMP7:%.*]] = extractvalue { i32, i32 } [[TMP3]], 0
+// CHECK-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
+// CHECK-NEXT: [[TMP9:%.*]] = or i64 [[TMP6]], [[TMP8]]
+// CHECK-NEXT: ret i64 [[TMP9]]
+//
+uint64_t test_vmlaldavaq_u32(uint64_t a, uint32x4_t b, uint32x4_t c) {
+#ifdef POLYMORPHIC
+ return vmlaldavaq(a, b, c);
+#else
+ return vmlaldavaq_u32(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlaldavaxq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[A:%.*]], 32
+// CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[A]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call { i32, i32 } @llvm.arm.mve.vmlldava.v8i16(i32 0, i32 0, i32 1, i32 [[TMP2]], i32 [[TMP1]], <8 x i16> [[B:%.*]], <8 x i16> [[C:%.*]])
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { i32, i32 } [[TMP3]], 1
+// CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP4]] to i64
+// CHECK-NEXT: [[TMP6:%.*]] = shl i64 [[TMP5]], 32
+// CHECK-NEXT: [[TMP7:%.*]] = extractvalue { i32, i32 } [[TMP3]], 0
+// CHECK-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
+// CHECK-NEXT: [[TMP9:%.*]] = or i64 [[TMP6]], [[TMP8]]
+// CHECK-NEXT: ret i64 [[TMP9]]
+//
+int64_t test_vmlaldavaxq_s16(int64_t a, int16x8_t b, int16x8_t c) {
+#ifdef POLYMORPHIC
+ return vmlaldavaxq(a, b, c);
+#else
+ return vmlaldavaxq_s16(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlaldavaxq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[A:%.*]], 32
+// CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[A]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call { i32, i32 } @llvm.arm.mve.vmlldava.v4i32(i32 0, i32 0, i32 1, i32 [[TMP2]], i32 [[TMP1]], <4 x i32> [[B:%.*]], <4 x i32> [[C:%.*]])
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { i32, i32 } [[TMP3]], 1
+// CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP4]] to i64
+// CHECK-NEXT: [[TMP6:%.*]] = shl i64 [[TMP5]], 32
+// CHECK-NEXT: [[TMP7:%.*]] = extractvalue { i32, i32 } [[TMP3]], 0
+// CHECK-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
+// CHECK-NEXT: [[TMP9:%.*]] = or i64 [[TMP6]], [[TMP8]]
+// CHECK-NEXT: ret i64 [[TMP9]]
+//
+int64_t test_vmlaldavaxq_s32(int64_t a, int32x4_t b, int32x4_t c) {
+#ifdef POLYMORPHIC
+ return vmlaldavaxq(a, b, c);
+#else
+ return vmlaldavaxq_s32(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlsldavaq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[A:%.*]], 32
+// CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[A]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call { i32, i32 } @llvm.arm.mve.vmlldava.v8i16(i32 0, i32 1, i32 0, i32 [[TMP2]], i32 [[TMP1]], <8 x i16> [[B:%.*]], <8 x i16> [[C:%.*]])
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { i32, i32 } [[TMP3]], 1
+// CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP4]] to i64
+// CHECK-NEXT: [[TMP6:%.*]] = shl i64 [[TMP5]], 32
+// CHECK-NEXT: [[TMP7:%.*]] = extractvalue { i32, i32 } [[TMP3]], 0
+// CHECK-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
+// CHECK-NEXT: [[TMP9:%.*]] = or i64 [[TMP6]], [[TMP8]]
+// CHECK-NEXT: ret i64 [[TMP9]]
+//
+int64_t test_vmlsldavaq_s16(int64_t a, int16x8_t b, int16x8_t c) {
+#ifdef POLYMORPHIC
+ return vmlsldavaq(a, b, c);
+#else
+ return vmlsldavaq_s16(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlsldavaq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[A:%.*]], 32
+// CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[A]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call { i32, i32 } @llvm.arm.mve.vmlldava.v4i32(i32 0, i32 1, i32 0, i32 [[TMP2]], i32 [[TMP1]], <4 x i32> [[B:%.*]], <4 x i32> [[C:%.*]])
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { i32, i32 } [[TMP3]], 1
+// CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP4]] to i64
+// CHECK-NEXT: [[TMP6:%.*]] = shl i64 [[TMP5]], 32
+// CHECK-NEXT: [[TMP7:%.*]] = extractvalue { i32, i32 } [[TMP3]], 0
+// CHECK-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
+// CHECK-NEXT: [[TMP9:%.*]] = or i64 [[TMP6]], [[TMP8]]
+// CHECK-NEXT: ret i64 [[TMP9]]
+//
+int64_t test_vmlsldavaq_s32(int64_t a, int32x4_t b, int32x4_t c) {
+#ifdef POLYMORPHIC
+ return vmlsldavaq(a, b, c);
+#else
+ return vmlsldavaq_s32(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlsldaxvaq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[A:%.*]], 32
+// CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[A]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call { i32, i32 } @llvm.arm.mve.vmlldava.v8i16(i32 0, i32 1, i32 1, i32 [[TMP2]], i32 [[TMP1]], <8 x i16> [[B:%.*]], <8 x i16> [[C:%.*]])
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { i32, i32 } [[TMP3]], 1
+// CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP4]] to i64
+// CHECK-NEXT: [[TMP6:%.*]] = shl i64 [[TMP5]], 32
+// CHECK-NEXT: [[TMP7:%.*]] = extractvalue { i32, i32 } [[TMP3]], 0
+// CHECK-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
+// CHECK-NEXT: [[TMP9:%.*]] = or i64 [[TMP6]], [[TMP8]]
+// CHECK-NEXT: ret i64 [[TMP9]]
+//
+int64_t test_vmlsldaxvaq_s16(int64_t a, int16x8_t b, int16x8_t c) {
+#ifdef POLYMORPHIC
+ return vmlsldavaxq(a, b, c);
+#else
+ return vmlsldavaxq_s16(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlsldavaxq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[A:%.*]], 32
+// CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[A]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call { i32, i32 } @llvm.arm.mve.vmlldava.v4i32(i32 0, i32 1, i32 1, i32 [[TMP2]], i32 [[TMP1]], <4 x i32> [[B:%.*]], <4 x i32> [[C:%.*]])
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { i32, i32 } [[TMP3]], 1
+// CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP4]] to i64
+// CHECK-NEXT: [[TMP6:%.*]] = shl i64 [[TMP5]], 32
+// CHECK-NEXT: [[TMP7:%.*]] = extractvalue { i32, i32 } [[TMP3]], 0
+// CHECK-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
+// CHECK-NEXT: [[TMP9:%.*]] = or i64 [[TMP6]], [[TMP8]]
+// CHECK-NEXT: ret i64 [[TMP9]]
+//
+int64_t test_vmlsldavaxq_s32(int64_t a, int32x4_t b, int32x4_t c) {
+#ifdef POLYMORPHIC
+ return vmlsldavaxq(a, b, c);
+#else
+ return vmlsldavaxq_s32(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vrmlaldavhaq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[A:%.*]], 32
+// CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[A]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call { i32, i32 } @llvm.arm.mve.vrmlldavha.v4i32(i32 0, i32 0, i32 0, i32 [[TMP2]], i32 [[TMP1]], <4 x i32> [[B:%.*]], <4 x i32> [[C:%.*]])
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { i32, i32 } [[TMP3]], 1
+// CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP4]] to i64
+// CHECK-NEXT: [[TMP6:%.*]] = shl i64 [[TMP5]], 32
+// CHECK-NEXT: [[TMP7:%.*]] = extractvalue { i32, i32 } [[TMP3]], 0
+// CHECK-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
+// CHECK-NEXT: [[TMP9:%.*]] = or i64 [[TMP6]], [[TMP8]]
+// CHECK-NEXT: ret i64 [[TMP9]]
+//
+int64_t test_vrmlaldavhaq_s32(int64_t a, int32x4_t b, int32x4_t c) {
+#ifdef POLYMORPHIC
+ return vrmlaldavhaq(a, b, c);
+#else
+ return vrmlaldavhaq_s32(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vrmlaldavhaq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[A:%.*]], 32
+// CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[A]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call { i32, i32 } @llvm.arm.mve.vrmlldavha.v4i32(i32 1, i32 0, i32 0, i32 [[TMP2]], i32 [[TMP1]], <4 x i32> [[B:%.*]], <4 x i32> [[C:%.*]])
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { i32, i32 } [[TMP3]], 1
+// CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP4]] to i64
+// CHECK-NEXT: [[TMP6:%.*]] = shl i64 [[TMP5]], 32
+// CHECK-NEXT: [[TMP7:%.*]] = extractvalue { i32, i32 } [[TMP3]], 0
+// CHECK-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
+// CHECK-NEXT: [[TMP9:%.*]] = or i64 [[TMP6]], [[TMP8]]
+// CHECK-NEXT: ret i64 [[TMP9]]
+//
+uint64_t test_vrmlaldavhaq_u32(uint64_t a, uint32x4_t b, uint32x4_t c) {
+#ifdef POLYMORPHIC
+ return vrmlaldavhaq(a, b, c);
+#else
+ return vrmlaldavhaq_u32(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vrmlaldavhaxq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[A:%.*]], 32
+// CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[A]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call { i32, i32 } @llvm.arm.mve.vrmlldavha.v4i32(i32 0, i32 0, i32 1, i32 [[TMP2]], i32 [[TMP1]], <4 x i32> [[B:%.*]], <4 x i32> [[C:%.*]])
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { i32, i32 } [[TMP3]], 1
+// CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP4]] to i64
+// CHECK-NEXT: [[TMP6:%.*]] = shl i64 [[TMP5]], 32
+// CHECK-NEXT: [[TMP7:%.*]] = extractvalue { i32, i32 } [[TMP3]], 0
+// CHECK-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
+// CHECK-NEXT: [[TMP9:%.*]] = or i64 [[TMP6]], [[TMP8]]
+// CHECK-NEXT: ret i64 [[TMP9]]
+//
+int64_t test_vrmlaldavhaxq_s32(int64_t a, int32x4_t b, int32x4_t c) {
+#ifdef POLYMORPHIC
+ return vrmlaldavhaxq(a, b, c);
+#else
+ return vrmlaldavhaxq_s32(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vrmlsldavhaq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[A:%.*]], 32
+// CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[A]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call { i32, i32 } @llvm.arm.mve.vrmlldavha.v4i32(i32 0, i32 1, i32 0, i32 [[TMP2]], i32 [[TMP1]], <4 x i32> [[B:%.*]], <4 x i32> [[C:%.*]])
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { i32, i32 } [[TMP3]], 1
+// CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP4]] to i64
+// CHECK-NEXT: [[TMP6:%.*]] = shl i64 [[TMP5]], 32
+// CHECK-NEXT: [[TMP7:%.*]] = extractvalue { i32, i32 } [[TMP3]], 0
+// CHECK-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
+// CHECK-NEXT: [[TMP9:%.*]] = or i64 [[TMP6]], [[TMP8]]
+// CHECK-NEXT: ret i64 [[TMP9]]
+//
+int64_t test_vrmlsldavhaq_s32(int64_t a, int32x4_t b, int32x4_t c) {
+#ifdef POLYMORPHIC
+ return vrmlsldavhaq(a, b, c);
+#else
+ return vrmlsldavhaq_s32(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vrmlsldavhaxq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[A:%.*]], 32
+// CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[A]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call { i32, i32 } @llvm.arm.mve.vrmlldavha.v4i32(i32 0, i32 1, i32 1, i32 [[TMP2]], i32 [[TMP1]], <4 x i32> [[B:%.*]], <4 x i32> [[C:%.*]])
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { i32, i32 } [[TMP3]], 1
+// CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP4]] to i64
+// CHECK-NEXT: [[TMP6:%.*]] = shl i64 [[TMP5]], 32
+// CHECK-NEXT: [[TMP7:%.*]] = extractvalue { i32, i32 } [[TMP3]], 0
+// CHECK-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
+// CHECK-NEXT: [[TMP9:%.*]] = or i64 [[TMP6]], [[TMP8]]
+// CHECK-NEXT: ret i64 [[TMP9]]
+//
+int64_t test_vrmlsldavhaxq_s32(int64_t a, int32x4_t b, int32x4_t c) {
+#ifdef POLYMORPHIC
+ return vrmlsldavhaxq(a, b, c);
+#else
+ return vrmlsldavhaxq_s32(a, b, c);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlaldavaq_p_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[A:%.*]], 32
+// CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[A]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP4:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = call { i32, i32 } @llvm.arm.mve.vmlldava.predicated.v8i16.v8i1(i32 0, i32 0, i32 0, i32 [[TMP2]], i32 [[TMP1]], <8 x i16> [[B:%.*]], <8 x i16> [[C:%.*]], <8 x i1> [[TMP4]])
+// CHECK-NEXT: [[TMP6:%.*]] = extractvalue { i32, i32 } [[TMP5]], 1
+// CHECK-NEXT: [[TMP7:%.*]] = zext i32 [[TMP6]] to i64
+// CHECK-NEXT: [[TMP8:%.*]] = shl i64 [[TMP7]], 32
+// CHECK-NEXT: [[TMP9:%.*]] = extractvalue { i32, i32 } [[TMP5]], 0
+// CHECK-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
+// CHECK-NEXT: [[TMP11:%.*]] = or i64 [[TMP8]], [[TMP10]]
+// CHECK-NEXT: ret i64 [[TMP11]]
+//
+int64_t test_vmlaldavaq_p_s16(int64_t a, int16x8_t b, int16x8_t c, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmlaldavaq_p(a, b, c, p);
+#else
+ return vmlaldavaq_p_s16(a, b, c, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlaldavaq_p_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[A:%.*]], 32
+// CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[A]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP4:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = call { i32, i32 } @llvm.arm.mve.vmlldava.predicated.v4i32.v4i1(i32 0, i32 0, i32 0, i32 [[TMP2]], i32 [[TMP1]], <4 x i32> [[B:%.*]], <4 x i32> [[C:%.*]], <4 x i1> [[TMP4]])
+// CHECK-NEXT: [[TMP6:%.*]] = extractvalue { i32, i32 } [[TMP5]], 1
+// CHECK-NEXT: [[TMP7:%.*]] = zext i32 [[TMP6]] to i64
+// CHECK-NEXT: [[TMP8:%.*]] = shl i64 [[TMP7]], 32
+// CHECK-NEXT: [[TMP9:%.*]] = extractvalue { i32, i32 } [[TMP5]], 0
+// CHECK-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
+// CHECK-NEXT: [[TMP11:%.*]] = or i64 [[TMP8]], [[TMP10]]
+// CHECK-NEXT: ret i64 [[TMP11]]
+//
+int64_t test_vmlaldavaq_p_s32(int64_t a, int32x4_t b, int32x4_t c, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmlaldavaq_p(a, b, c, p);
+#else
+ return vmlaldavaq_p_s32(a, b, c, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlaldavaq_p_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[A:%.*]], 32
+// CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[A]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP4:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = call { i32, i32 } @llvm.arm.mve.vmlldava.predicated.v8i16.v8i1(i32 1, i32 0, i32 0, i32 [[TMP2]], i32 [[TMP1]], <8 x i16> [[B:%.*]], <8 x i16> [[C:%.*]], <8 x i1> [[TMP4]])
+// CHECK-NEXT: [[TMP6:%.*]] = extractvalue { i32, i32 } [[TMP5]], 1
+// CHECK-NEXT: [[TMP7:%.*]] = zext i32 [[TMP6]] to i64
+// CHECK-NEXT: [[TMP8:%.*]] = shl i64 [[TMP7]], 32
+// CHECK-NEXT: [[TMP9:%.*]] = extractvalue { i32, i32 } [[TMP5]], 0
+// CHECK-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
+// CHECK-NEXT: [[TMP11:%.*]] = or i64 [[TMP8]], [[TMP10]]
+// CHECK-NEXT: ret i64 [[TMP11]]
+//
+uint64_t test_vmlaldavaq_p_u16(uint64_t a, uint16x8_t b, uint16x8_t c, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmlaldavaq_p(a, b, c, p);
+#else
+ return vmlaldavaq_p_u16(a, b, c, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlaldavaq_p_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[A:%.*]], 32
+// CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[A]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP4:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = call { i32, i32 } @llvm.arm.mve.vmlldava.predicated.v4i32.v4i1(i32 1, i32 0, i32 0, i32 [[TMP2]], i32 [[TMP1]], <4 x i32> [[B:%.*]], <4 x i32> [[C:%.*]], <4 x i1> [[TMP4]])
+// CHECK-NEXT: [[TMP6:%.*]] = extractvalue { i32, i32 } [[TMP5]], 1
+// CHECK-NEXT: [[TMP7:%.*]] = zext i32 [[TMP6]] to i64
+// CHECK-NEXT: [[TMP8:%.*]] = shl i64 [[TMP7]], 32
+// CHECK-NEXT: [[TMP9:%.*]] = extractvalue { i32, i32 } [[TMP5]], 0
+// CHECK-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
+// CHECK-NEXT: [[TMP11:%.*]] = or i64 [[TMP8]], [[TMP10]]
+// CHECK-NEXT: ret i64 [[TMP11]]
+//
+uint64_t test_vmlaldavaq_p_u32(uint64_t a, uint32x4_t b, uint32x4_t c, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmlaldavaq_p(a, b, c, p);
+#else
+ return vmlaldavaq_p_u32(a, b, c, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlaldavaxq_p_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[A:%.*]], 32
+// CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[A]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP4:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = call { i32, i32 } @llvm.arm.mve.vmlldava.predicated.v8i16.v8i1(i32 0, i32 0, i32 1, i32 [[TMP2]], i32 [[TMP1]], <8 x i16> [[B:%.*]], <8 x i16> [[C:%.*]], <8 x i1> [[TMP4]])
+// CHECK-NEXT: [[TMP6:%.*]] = extractvalue { i32, i32 } [[TMP5]], 1
+// CHECK-NEXT: [[TMP7:%.*]] = zext i32 [[TMP6]] to i64
+// CHECK-NEXT: [[TMP8:%.*]] = shl i64 [[TMP7]], 32
+// CHECK-NEXT: [[TMP9:%.*]] = extractvalue { i32, i32 } [[TMP5]], 0
+// CHECK-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
+// CHECK-NEXT: [[TMP11:%.*]] = or i64 [[TMP8]], [[TMP10]]
+// CHECK-NEXT: ret i64 [[TMP11]]
+//
+int64_t test_vmlaldavaxq_p_s16(int64_t a, int16x8_t b, int16x8_t c, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmlaldavaxq_p(a, b, c, p);
+#else
+ return vmlaldavaxq_p_s16(a, b, c, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlaldavaxq_p_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[A:%.*]], 32
+// CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[A]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP4:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = call { i32, i32 } @llvm.arm.mve.vmlldava.predicated.v4i32.v4i1(i32 0, i32 0, i32 1, i32 [[TMP2]], i32 [[TMP1]], <4 x i32> [[B:%.*]], <4 x i32> [[C:%.*]], <4 x i1> [[TMP4]])
+// CHECK-NEXT: [[TMP6:%.*]] = extractvalue { i32, i32 } [[TMP5]], 1
+// CHECK-NEXT: [[TMP7:%.*]] = zext i32 [[TMP6]] to i64
+// CHECK-NEXT: [[TMP8:%.*]] = shl i64 [[TMP7]], 32
+// CHECK-NEXT: [[TMP9:%.*]] = extractvalue { i32, i32 } [[TMP5]], 0
+// CHECK-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
+// CHECK-NEXT: [[TMP11:%.*]] = or i64 [[TMP8]], [[TMP10]]
+// CHECK-NEXT: ret i64 [[TMP11]]
+//
+int64_t test_vmlaldavaxq_p_s32(int64_t a, int32x4_t b, int32x4_t c, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmlaldavaxq_p(a, b, c, p);
+#else
+ return vmlaldavaxq_p_s32(a, b, c, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlsldavaq_p_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[A:%.*]], 32
+// CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[A]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP4:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = call { i32, i32 } @llvm.arm.mve.vmlldava.predicated.v8i16.v8i1(i32 0, i32 1, i32 0, i32 [[TMP2]], i32 [[TMP1]], <8 x i16> [[B:%.*]], <8 x i16> [[C:%.*]], <8 x i1> [[TMP4]])
+// CHECK-NEXT: [[TMP6:%.*]] = extractvalue { i32, i32 } [[TMP5]], 1
+// CHECK-NEXT: [[TMP7:%.*]] = zext i32 [[TMP6]] to i64
+// CHECK-NEXT: [[TMP8:%.*]] = shl i64 [[TMP7]], 32
+// CHECK-NEXT: [[TMP9:%.*]] = extractvalue { i32, i32 } [[TMP5]], 0
+// CHECK-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
+// CHECK-NEXT: [[TMP11:%.*]] = or i64 [[TMP8]], [[TMP10]]
+// CHECK-NEXT: ret i64 [[TMP11]]
+//
+int64_t test_vmlsldavaq_p_s16(int64_t a, int16x8_t b, int16x8_t c, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmlsldavaq_p(a, b, c, p);
+#else
+ return vmlsldavaq_p_s16(a, b, c, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlsldavaq_p_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[A:%.*]], 32
+// CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[A]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP4:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = call { i32, i32 } @llvm.arm.mve.vmlldava.predicated.v4i32.v4i1(i32 0, i32 1, i32 0, i32 [[TMP2]], i32 [[TMP1]], <4 x i32> [[B:%.*]], <4 x i32> [[C:%.*]], <4 x i1> [[TMP4]])
+// CHECK-NEXT: [[TMP6:%.*]] = extractvalue { i32, i32 } [[TMP5]], 1
+// CHECK-NEXT: [[TMP7:%.*]] = zext i32 [[TMP6]] to i64
+// CHECK-NEXT: [[TMP8:%.*]] = shl i64 [[TMP7]], 32
+// CHECK-NEXT: [[TMP9:%.*]] = extractvalue { i32, i32 } [[TMP5]], 0
+// CHECK-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
+// CHECK-NEXT: [[TMP11:%.*]] = or i64 [[TMP8]], [[TMP10]]
+// CHECK-NEXT: ret i64 [[TMP11]]
+//
+int64_t test_vmlsldavaq_p_s32(int64_t a, int32x4_t b, int32x4_t c, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmlsldavaq_p(a, b, c, p);
+#else
+ return vmlsldavaq_p_s32(a, b, c, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlsldaxvaq_p_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[A:%.*]], 32
+// CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[A]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP4:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = call { i32, i32 } @llvm.arm.mve.vmlldava.predicated.v8i16.v8i1(i32 0, i32 1, i32 1, i32 [[TMP2]], i32 [[TMP1]], <8 x i16> [[B:%.*]], <8 x i16> [[C:%.*]], <8 x i1> [[TMP4]])
+// CHECK-NEXT: [[TMP6:%.*]] = extractvalue { i32, i32 } [[TMP5]], 1
+// CHECK-NEXT: [[TMP7:%.*]] = zext i32 [[TMP6]] to i64
+// CHECK-NEXT: [[TMP8:%.*]] = shl i64 [[TMP7]], 32
+// CHECK-NEXT: [[TMP9:%.*]] = extractvalue { i32, i32 } [[TMP5]], 0
+// CHECK-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
+// CHECK-NEXT: [[TMP11:%.*]] = or i64 [[TMP8]], [[TMP10]]
+// CHECK-NEXT: ret i64 [[TMP11]]
+//
+int64_t test_vmlsldaxvaq_p_s16(int64_t a, int16x8_t b, int16x8_t c, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmlsldavaxq_p(a, b, c, p);
+#else
+ return vmlsldavaxq_p_s16(a, b, c, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlsldavaxq_p_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[A:%.*]], 32
+// CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[A]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP4:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = call { i32, i32 } @llvm.arm.mve.vmlldava.predicated.v4i32.v4i1(i32 0, i32 1, i32 1, i32 [[TMP2]], i32 [[TMP1]], <4 x i32> [[B:%.*]], <4 x i32> [[C:%.*]], <4 x i1> [[TMP4]])
+// CHECK-NEXT: [[TMP6:%.*]] = extractvalue { i32, i32 } [[TMP5]], 1
+// CHECK-NEXT: [[TMP7:%.*]] = zext i32 [[TMP6]] to i64
+// CHECK-NEXT: [[TMP8:%.*]] = shl i64 [[TMP7]], 32
+// CHECK-NEXT: [[TMP9:%.*]] = extractvalue { i32, i32 } [[TMP5]], 0
+// CHECK-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
+// CHECK-NEXT: [[TMP11:%.*]] = or i64 [[TMP8]], [[TMP10]]
+// CHECK-NEXT: ret i64 [[TMP11]]
+//
+int64_t test_vmlsldavaxq_p_s32(int64_t a, int32x4_t b, int32x4_t c, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmlsldavaxq_p(a, b, c, p);
+#else
+ return vmlsldavaxq_p_s32(a, b, c, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vrmlaldavhaq_p_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[A:%.*]], 32
+// CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[A]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP4:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = call { i32, i32 } @llvm.arm.mve.vrmlldavha.predicated.v4i32.v4i1(i32 0, i32 0, i32 0, i32 [[TMP2]], i32 [[TMP1]], <4 x i32> [[B:%.*]], <4 x i32> [[C:%.*]], <4 x i1> [[TMP4]])
+// CHECK-NEXT: [[TMP6:%.*]] = extractvalue { i32, i32 } [[TMP5]], 1
+// CHECK-NEXT: [[TMP7:%.*]] = zext i32 [[TMP6]] to i64
+// CHECK-NEXT: [[TMP8:%.*]] = shl i64 [[TMP7]], 32
+// CHECK-NEXT: [[TMP9:%.*]] = extractvalue { i32, i32 } [[TMP5]], 0
+// CHECK-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
+// CHECK-NEXT: [[TMP11:%.*]] = or i64 [[TMP8]], [[TMP10]]
+// CHECK-NEXT: ret i64 [[TMP11]]
+//
+int64_t test_vrmlaldavhaq_p_s32(int64_t a, int32x4_t b, int32x4_t c, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vrmlaldavhaq_p(a, b, c, p);
+#else
+ return vrmlaldavhaq_p_s32(a, b, c, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vrmlaldavhaq_p_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[A:%.*]], 32
+// CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[A]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP4:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = call { i32, i32 } @llvm.arm.mve.vrmlldavha.predicated.v4i32.v4i1(i32 1, i32 0, i32 0, i32 [[TMP2]], i32 [[TMP1]], <4 x i32> [[B:%.*]], <4 x i32> [[C:%.*]], <4 x i1> [[TMP4]])
+// CHECK-NEXT: [[TMP6:%.*]] = extractvalue { i32, i32 } [[TMP5]], 1
+// CHECK-NEXT: [[TMP7:%.*]] = zext i32 [[TMP6]] to i64
+// CHECK-NEXT: [[TMP8:%.*]] = shl i64 [[TMP7]], 32
+// CHECK-NEXT: [[TMP9:%.*]] = extractvalue { i32, i32 } [[TMP5]], 0
+// CHECK-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
+// CHECK-NEXT: [[TMP11:%.*]] = or i64 [[TMP8]], [[TMP10]]
+// CHECK-NEXT: ret i64 [[TMP11]]
+//
+uint64_t test_vrmlaldavhaq_p_u32(uint64_t a, uint32x4_t b, uint32x4_t c, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vrmlaldavhaq_p(a, b, c, p);
+#else
+ return vrmlaldavhaq_p_u32(a, b, c, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vrmlaldavhaxq_p_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[A:%.*]], 32
+// CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[A]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP4:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = call { i32, i32 } @llvm.arm.mve.vrmlldavha.predicated.v4i32.v4i1(i32 0, i32 0, i32 1, i32 [[TMP2]], i32 [[TMP1]], <4 x i32> [[B:%.*]], <4 x i32> [[C:%.*]], <4 x i1> [[TMP4]])
+// CHECK-NEXT: [[TMP6:%.*]] = extractvalue { i32, i32 } [[TMP5]], 1
+// CHECK-NEXT: [[TMP7:%.*]] = zext i32 [[TMP6]] to i64
+// CHECK-NEXT: [[TMP8:%.*]] = shl i64 [[TMP7]], 32
+// CHECK-NEXT: [[TMP9:%.*]] = extractvalue { i32, i32 } [[TMP5]], 0
+// CHECK-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
+// CHECK-NEXT: [[TMP11:%.*]] = or i64 [[TMP8]], [[TMP10]]
+// CHECK-NEXT: ret i64 [[TMP11]]
+//
+int64_t test_vrmlaldavhaxq_p_s32(int64_t a, int32x4_t b, int32x4_t c, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vrmlaldavhaxq_p(a, b, c, p);
+#else
+ return vrmlaldavhaxq_p_s32(a, b, c, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vrmlsldavhaq_p_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[A:%.*]], 32
+// CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[A]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP4:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = call { i32, i32 } @llvm.arm.mve.vrmlldavha.predicated.v4i32.v4i1(i32 0, i32 1, i32 0, i32 [[TMP2]], i32 [[TMP1]], <4 x i32> [[B:%.*]], <4 x i32> [[C:%.*]], <4 x i1> [[TMP4]])
+// CHECK-NEXT: [[TMP6:%.*]] = extractvalue { i32, i32 } [[TMP5]], 1
+// CHECK-NEXT: [[TMP7:%.*]] = zext i32 [[TMP6]] to i64
+// CHECK-NEXT: [[TMP8:%.*]] = shl i64 [[TMP7]], 32
+// CHECK-NEXT: [[TMP9:%.*]] = extractvalue { i32, i32 } [[TMP5]], 0
+// CHECK-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
+// CHECK-NEXT: [[TMP11:%.*]] = or i64 [[TMP8]], [[TMP10]]
+// CHECK-NEXT: ret i64 [[TMP11]]
+//
+int64_t test_vrmlsldavhaq_p_s32(int64_t a, int32x4_t b, int32x4_t c, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vrmlsldavhaq_p(a, b, c, p);
+#else
+ return vrmlsldavhaq_p_s32(a, b, c, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vrmlsldavhaxq_p_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[A:%.*]], 32
+// CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
+// CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[A]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP4:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP3]])
+// CHECK-NEXT: [[TMP5:%.*]] = call { i32, i32 } @llvm.arm.mve.vrmlldavha.predicated.v4i32.v4i1(i32 0, i32 1, i32 1, i32 [[TMP2]], i32 [[TMP1]], <4 x i32> [[B:%.*]], <4 x i32> [[C:%.*]], <4 x i1> [[TMP4]])
+// CHECK-NEXT: [[TMP6:%.*]] = extractvalue { i32, i32 } [[TMP5]], 1
+// CHECK-NEXT: [[TMP7:%.*]] = zext i32 [[TMP6]] to i64
+// CHECK-NEXT: [[TMP8:%.*]] = shl i64 [[TMP7]], 32
+// CHECK-NEXT: [[TMP9:%.*]] = extractvalue { i32, i32 } [[TMP5]], 0
+// CHECK-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
+// CHECK-NEXT: [[TMP11:%.*]] = or i64 [[TMP8]], [[TMP10]]
+// CHECK-NEXT: ret i64 [[TMP11]]
+//
+int64_t test_vrmlsldavhaxq_p_s32(int64_t a, int32x4_t b, int32x4_t c, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vrmlsldavhaxq_p(a, b, c, p);
+#else
+ return vrmlsldavhaxq_p_s32(a, b, c, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlaldavq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call { i32, i32 } @llvm.arm.mve.vmlldava.v8i16(i32 0, i32 0, i32 0, i32 0, i32 0, <8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]])
+// CHECK-NEXT: [[TMP1:%.*]] = extractvalue { i32, i32 } [[TMP0]], 1
+// CHECK-NEXT: [[TMP2:%.*]] = zext i32 [[TMP1]] to i64
+// CHECK-NEXT: [[TMP3:%.*]] = shl i64 [[TMP2]], 32
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { i32, i32 } [[TMP0]], 0
+// CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP4]] to i64
+// CHECK-NEXT: [[TMP6:%.*]] = or i64 [[TMP3]], [[TMP5]]
+// CHECK-NEXT: ret i64 [[TMP6]]
+//
+int64_t test_vmlaldavq_s16(int16x8_t a, int16x8_t b) {
+#ifdef POLYMORPHIC
+ return vmlaldavq(a, b);
+#else
+ return vmlaldavq_s16(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlaldavq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call { i32, i32 } @llvm.arm.mve.vmlldava.v4i32(i32 0, i32 0, i32 0, i32 0, i32 0, <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]])
+// CHECK-NEXT: [[TMP1:%.*]] = extractvalue { i32, i32 } [[TMP0]], 1
+// CHECK-NEXT: [[TMP2:%.*]] = zext i32 [[TMP1]] to i64
+// CHECK-NEXT: [[TMP3:%.*]] = shl i64 [[TMP2]], 32
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { i32, i32 } [[TMP0]], 0
+// CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP4]] to i64
+// CHECK-NEXT: [[TMP6:%.*]] = or i64 [[TMP3]], [[TMP5]]
+// CHECK-NEXT: ret i64 [[TMP6]]
+//
+int64_t test_vmlaldavq_s32(int32x4_t a, int32x4_t b) {
+#ifdef POLYMORPHIC
+ return vmlaldavq(a, b);
+#else
+ return vmlaldavq_s32(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlaldavq_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call { i32, i32 } @llvm.arm.mve.vmlldava.v8i16(i32 1, i32 0, i32 0, i32 0, i32 0, <8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]])
+// CHECK-NEXT: [[TMP1:%.*]] = extractvalue { i32, i32 } [[TMP0]], 1
+// CHECK-NEXT: [[TMP2:%.*]] = zext i32 [[TMP1]] to i64
+// CHECK-NEXT: [[TMP3:%.*]] = shl i64 [[TMP2]], 32
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { i32, i32 } [[TMP0]], 0
+// CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP4]] to i64
+// CHECK-NEXT: [[TMP6:%.*]] = or i64 [[TMP3]], [[TMP5]]
+// CHECK-NEXT: ret i64 [[TMP6]]
+//
+uint64_t test_vmlaldavq_u16(uint16x8_t a, uint16x8_t b) {
+#ifdef POLYMORPHIC
+ return vmlaldavq(a, b);
+#else
+ return vmlaldavq_u16(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlaldavq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call { i32, i32 } @llvm.arm.mve.vmlldava.v4i32(i32 1, i32 0, i32 0, i32 0, i32 0, <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]])
+// CHECK-NEXT: [[TMP1:%.*]] = extractvalue { i32, i32 } [[TMP0]], 1
+// CHECK-NEXT: [[TMP2:%.*]] = zext i32 [[TMP1]] to i64
+// CHECK-NEXT: [[TMP3:%.*]] = shl i64 [[TMP2]], 32
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { i32, i32 } [[TMP0]], 0
+// CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP4]] to i64
+// CHECK-NEXT: [[TMP6:%.*]] = or i64 [[TMP3]], [[TMP5]]
+// CHECK-NEXT: ret i64 [[TMP6]]
+//
+uint64_t test_vmlaldavq_u32(uint32x4_t a, uint32x4_t b) {
+#ifdef POLYMORPHIC
+ return vmlaldavq(a, b);
+#else
+ return vmlaldavq_u32(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlaldavxq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call { i32, i32 } @llvm.arm.mve.vmlldava.v8i16(i32 0, i32 0, i32 1, i32 0, i32 0, <8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]])
+// CHECK-NEXT: [[TMP1:%.*]] = extractvalue { i32, i32 } [[TMP0]], 1
+// CHECK-NEXT: [[TMP2:%.*]] = zext i32 [[TMP1]] to i64
+// CHECK-NEXT: [[TMP3:%.*]] = shl i64 [[TMP2]], 32
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { i32, i32 } [[TMP0]], 0
+// CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP4]] to i64
+// CHECK-NEXT: [[TMP6:%.*]] = or i64 [[TMP3]], [[TMP5]]
+// CHECK-NEXT: ret i64 [[TMP6]]
+//
+int64_t test_vmlaldavxq_s16(int16x8_t a, int16x8_t b) {
+#ifdef POLYMORPHIC
+ return vmlaldavxq(a, b);
+#else
+ return vmlaldavxq_s16(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlaldavxq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call { i32, i32 } @llvm.arm.mve.vmlldava.v4i32(i32 0, i32 0, i32 1, i32 0, i32 0, <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]])
+// CHECK-NEXT: [[TMP1:%.*]] = extractvalue { i32, i32 } [[TMP0]], 1
+// CHECK-NEXT: [[TMP2:%.*]] = zext i32 [[TMP1]] to i64
+// CHECK-NEXT: [[TMP3:%.*]] = shl i64 [[TMP2]], 32
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { i32, i32 } [[TMP0]], 0
+// CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP4]] to i64
+// CHECK-NEXT: [[TMP6:%.*]] = or i64 [[TMP3]], [[TMP5]]
+// CHECK-NEXT: ret i64 [[TMP6]]
+//
+int64_t test_vmlaldavxq_s32(int32x4_t a, int32x4_t b) {
+#ifdef POLYMORPHIC
+ return vmlaldavxq(a, b);
+#else
+ return vmlaldavxq_s32(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlsldavq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call { i32, i32 } @llvm.arm.mve.vmlldava.v8i16(i32 0, i32 1, i32 0, i32 0, i32 0, <8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]])
+// CHECK-NEXT: [[TMP1:%.*]] = extractvalue { i32, i32 } [[TMP0]], 1
+// CHECK-NEXT: [[TMP2:%.*]] = zext i32 [[TMP1]] to i64
+// CHECK-NEXT: [[TMP3:%.*]] = shl i64 [[TMP2]], 32
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { i32, i32 } [[TMP0]], 0
+// CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP4]] to i64
+// CHECK-NEXT: [[TMP6:%.*]] = or i64 [[TMP3]], [[TMP5]]
+// CHECK-NEXT: ret i64 [[TMP6]]
+//
+int64_t test_vmlsldavq_s16(int16x8_t a, int16x8_t b) {
+#ifdef POLYMORPHIC
+ return vmlsldavq(a, b);
+#else
+ return vmlsldavq_s16(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlsldavq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call { i32, i32 } @llvm.arm.mve.vmlldava.v4i32(i32 0, i32 1, i32 0, i32 0, i32 0, <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]])
+// CHECK-NEXT: [[TMP1:%.*]] = extractvalue { i32, i32 } [[TMP0]], 1
+// CHECK-NEXT: [[TMP2:%.*]] = zext i32 [[TMP1]] to i64
+// CHECK-NEXT: [[TMP3:%.*]] = shl i64 [[TMP2]], 32
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { i32, i32 } [[TMP0]], 0
+// CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP4]] to i64
+// CHECK-NEXT: [[TMP6:%.*]] = or i64 [[TMP3]], [[TMP5]]
+// CHECK-NEXT: ret i64 [[TMP6]]
+//
+int64_t test_vmlsldavq_s32(int32x4_t a, int32x4_t b) {
+#ifdef POLYMORPHIC
+ return vmlsldavq(a, b);
+#else
+ return vmlsldavq_s32(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlsldavxvq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call { i32, i32 } @llvm.arm.mve.vmlldava.v8i16(i32 0, i32 1, i32 1, i32 0, i32 0, <8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]])
+// CHECK-NEXT: [[TMP1:%.*]] = extractvalue { i32, i32 } [[TMP0]], 1
+// CHECK-NEXT: [[TMP2:%.*]] = zext i32 [[TMP1]] to i64
+// CHECK-NEXT: [[TMP3:%.*]] = shl i64 [[TMP2]], 32
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { i32, i32 } [[TMP0]], 0
+// CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP4]] to i64
+// CHECK-NEXT: [[TMP6:%.*]] = or i64 [[TMP3]], [[TMP5]]
+// CHECK-NEXT: ret i64 [[TMP6]]
+//
+int64_t test_vmlsldavxvq_s16(int16x8_t a, int16x8_t b) {
+#ifdef POLYMORPHIC
+ return vmlsldavxq(a, b);
+#else
+ return vmlsldavxq_s16(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlsldavxq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call { i32, i32 } @llvm.arm.mve.vmlldava.v4i32(i32 0, i32 1, i32 1, i32 0, i32 0, <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]])
+// CHECK-NEXT: [[TMP1:%.*]] = extractvalue { i32, i32 } [[TMP0]], 1
+// CHECK-NEXT: [[TMP2:%.*]] = zext i32 [[TMP1]] to i64
+// CHECK-NEXT: [[TMP3:%.*]] = shl i64 [[TMP2]], 32
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { i32, i32 } [[TMP0]], 0
+// CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP4]] to i64
+// CHECK-NEXT: [[TMP6:%.*]] = or i64 [[TMP3]], [[TMP5]]
+// CHECK-NEXT: ret i64 [[TMP6]]
+//
+int64_t test_vmlsldavxq_s32(int32x4_t a, int32x4_t b) {
+#ifdef POLYMORPHIC
+ return vmlsldavxq(a, b);
+#else
+ return vmlsldavxq_s32(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vrmlaldavhq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call { i32, i32 } @llvm.arm.mve.vrmlldavha.v4i32(i32 0, i32 0, i32 0, i32 0, i32 0, <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]])
+// CHECK-NEXT: [[TMP1:%.*]] = extractvalue { i32, i32 } [[TMP0]], 1
+// CHECK-NEXT: [[TMP2:%.*]] = zext i32 [[TMP1]] to i64
+// CHECK-NEXT: [[TMP3:%.*]] = shl i64 [[TMP2]], 32
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { i32, i32 } [[TMP0]], 0
+// CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP4]] to i64
+// CHECK-NEXT: [[TMP6:%.*]] = or i64 [[TMP3]], [[TMP5]]
+// CHECK-NEXT: ret i64 [[TMP6]]
+//
+int64_t test_vrmlaldavhq_s32(int32x4_t a, int32x4_t b) {
+#ifdef POLYMORPHIC
+ return vrmlaldavhq(a, b);
+#else
+ return vrmlaldavhq_s32(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vrmlaldavhq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call { i32, i32 } @llvm.arm.mve.vrmlldavha.v4i32(i32 1, i32 0, i32 0, i32 0, i32 0, <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]])
+// CHECK-NEXT: [[TMP1:%.*]] = extractvalue { i32, i32 } [[TMP0]], 1
+// CHECK-NEXT: [[TMP2:%.*]] = zext i32 [[TMP1]] to i64
+// CHECK-NEXT: [[TMP3:%.*]] = shl i64 [[TMP2]], 32
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { i32, i32 } [[TMP0]], 0
+// CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP4]] to i64
+// CHECK-NEXT: [[TMP6:%.*]] = or i64 [[TMP3]], [[TMP5]]
+// CHECK-NEXT: ret i64 [[TMP6]]
+//
+uint64_t test_vrmlaldavhq_u32(uint32x4_t a, uint32x4_t b) {
+#ifdef POLYMORPHIC
+ return vrmlaldavhq(a, b);
+#else
+ return vrmlaldavhq_u32(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vrmlaldavhxq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call { i32, i32 } @llvm.arm.mve.vrmlldavha.v4i32(i32 0, i32 0, i32 1, i32 0, i32 0, <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]])
+// CHECK-NEXT: [[TMP1:%.*]] = extractvalue { i32, i32 } [[TMP0]], 1
+// CHECK-NEXT: [[TMP2:%.*]] = zext i32 [[TMP1]] to i64
+// CHECK-NEXT: [[TMP3:%.*]] = shl i64 [[TMP2]], 32
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { i32, i32 } [[TMP0]], 0
+// CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP4]] to i64
+// CHECK-NEXT: [[TMP6:%.*]] = or i64 [[TMP3]], [[TMP5]]
+// CHECK-NEXT: ret i64 [[TMP6]]
+//
+int64_t test_vrmlaldavhxq_s32(int32x4_t a, int32x4_t b) {
+#ifdef POLYMORPHIC
+ return vrmlaldavhxq(a, b);
+#else
+ return vrmlaldavhxq_s32(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vrmlsldavhq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call { i32, i32 } @llvm.arm.mve.vrmlldavha.v4i32(i32 0, i32 1, i32 0, i32 0, i32 0, <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]])
+// CHECK-NEXT: [[TMP1:%.*]] = extractvalue { i32, i32 } [[TMP0]], 1
+// CHECK-NEXT: [[TMP2:%.*]] = zext i32 [[TMP1]] to i64
+// CHECK-NEXT: [[TMP3:%.*]] = shl i64 [[TMP2]], 32
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { i32, i32 } [[TMP0]], 0
+// CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP4]] to i64
+// CHECK-NEXT: [[TMP6:%.*]] = or i64 [[TMP3]], [[TMP5]]
+// CHECK-NEXT: ret i64 [[TMP6]]
+//
+int64_t test_vrmlsldavhq_s32(int32x4_t a, int32x4_t b) {
+#ifdef POLYMORPHIC
+ return vrmlsldavhq(a, b);
+#else
+ return vrmlsldavhq_s32(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vrmlsldavhxq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call { i32, i32 } @llvm.arm.mve.vrmlldavha.v4i32(i32 0, i32 1, i32 1, i32 0, i32 0, <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]])
+// CHECK-NEXT: [[TMP1:%.*]] = extractvalue { i32, i32 } [[TMP0]], 1
+// CHECK-NEXT: [[TMP2:%.*]] = zext i32 [[TMP1]] to i64
+// CHECK-NEXT: [[TMP3:%.*]] = shl i64 [[TMP2]], 32
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { i32, i32 } [[TMP0]], 0
+// CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP4]] to i64
+// CHECK-NEXT: [[TMP6:%.*]] = or i64 [[TMP3]], [[TMP5]]
+// CHECK-NEXT: ret i64 [[TMP6]]
+//
+int64_t test_vrmlsldavhxq_s32(int32x4_t a, int32x4_t b) {
+#ifdef POLYMORPHIC
+ return vrmlsldavhxq(a, b);
+#else
+ return vrmlsldavhxq_s32(a, b);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlaldavq_p_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call { i32, i32 } @llvm.arm.mve.vmlldava.predicated.v8i16.v8i1(i32 0, i32 0, i32 0, i32 0, i32 0, <8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = extractvalue { i32, i32 } [[TMP2]], 1
+// CHECK-NEXT: [[TMP4:%.*]] = zext i32 [[TMP3]] to i64
+// CHECK-NEXT: [[TMP5:%.*]] = shl i64 [[TMP4]], 32
+// CHECK-NEXT: [[TMP6:%.*]] = extractvalue { i32, i32 } [[TMP2]], 0
+// CHECK-NEXT: [[TMP7:%.*]] = zext i32 [[TMP6]] to i64
+// CHECK-NEXT: [[TMP8:%.*]] = or i64 [[TMP5]], [[TMP7]]
+// CHECK-NEXT: ret i64 [[TMP8]]
+//
+int64_t test_vmlaldavq_p_s16(int16x8_t a, int16x8_t b, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmlaldavq_p(a, b, p);
+#else
+ return vmlaldavq_p_s16(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlaldavq_p_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call { i32, i32 } @llvm.arm.mve.vmlldava.predicated.v4i32.v4i1(i32 0, i32 0, i32 0, i32 0, i32 0, <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = extractvalue { i32, i32 } [[TMP2]], 1
+// CHECK-NEXT: [[TMP4:%.*]] = zext i32 [[TMP3]] to i64
+// CHECK-NEXT: [[TMP5:%.*]] = shl i64 [[TMP4]], 32
+// CHECK-NEXT: [[TMP6:%.*]] = extractvalue { i32, i32 } [[TMP2]], 0
+// CHECK-NEXT: [[TMP7:%.*]] = zext i32 [[TMP6]] to i64
+// CHECK-NEXT: [[TMP8:%.*]] = or i64 [[TMP5]], [[TMP7]]
+// CHECK-NEXT: ret i64 [[TMP8]]
+//
+int64_t test_vmlaldavq_p_s32(int32x4_t a, int32x4_t b, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmlaldavq_p(a, b, p);
+#else
+ return vmlaldavq_p_s32(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlaldavq_p_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call { i32, i32 } @llvm.arm.mve.vmlldava.predicated.v8i16.v8i1(i32 1, i32 0, i32 0, i32 0, i32 0, <8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = extractvalue { i32, i32 } [[TMP2]], 1
+// CHECK-NEXT: [[TMP4:%.*]] = zext i32 [[TMP3]] to i64
+// CHECK-NEXT: [[TMP5:%.*]] = shl i64 [[TMP4]], 32
+// CHECK-NEXT: [[TMP6:%.*]] = extractvalue { i32, i32 } [[TMP2]], 0
+// CHECK-NEXT: [[TMP7:%.*]] = zext i32 [[TMP6]] to i64
+// CHECK-NEXT: [[TMP8:%.*]] = or i64 [[TMP5]], [[TMP7]]
+// CHECK-NEXT: ret i64 [[TMP8]]
+//
+uint64_t test_vmlaldavq_p_u16(uint16x8_t a, uint16x8_t b, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmlaldavq_p(a, b, p);
+#else
+ return vmlaldavq_p_u16(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlaldavq_p_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call { i32, i32 } @llvm.arm.mve.vmlldava.predicated.v4i32.v4i1(i32 1, i32 0, i32 0, i32 0, i32 0, <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = extractvalue { i32, i32 } [[TMP2]], 1
+// CHECK-NEXT: [[TMP4:%.*]] = zext i32 [[TMP3]] to i64
+// CHECK-NEXT: [[TMP5:%.*]] = shl i64 [[TMP4]], 32
+// CHECK-NEXT: [[TMP6:%.*]] = extractvalue { i32, i32 } [[TMP2]], 0
+// CHECK-NEXT: [[TMP7:%.*]] = zext i32 [[TMP6]] to i64
+// CHECK-NEXT: [[TMP8:%.*]] = or i64 [[TMP5]], [[TMP7]]
+// CHECK-NEXT: ret i64 [[TMP8]]
+//
+uint64_t test_vmlaldavq_p_u32(uint32x4_t a, uint32x4_t b, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmlaldavq_p(a, b, p);
+#else
+ return vmlaldavq_p_u32(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlaldavxq_p_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call { i32, i32 } @llvm.arm.mve.vmlldava.predicated.v8i16.v8i1(i32 0, i32 0, i32 1, i32 0, i32 0, <8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = extractvalue { i32, i32 } [[TMP2]], 1
+// CHECK-NEXT: [[TMP4:%.*]] = zext i32 [[TMP3]] to i64
+// CHECK-NEXT: [[TMP5:%.*]] = shl i64 [[TMP4]], 32
+// CHECK-NEXT: [[TMP6:%.*]] = extractvalue { i32, i32 } [[TMP2]], 0
+// CHECK-NEXT: [[TMP7:%.*]] = zext i32 [[TMP6]] to i64
+// CHECK-NEXT: [[TMP8:%.*]] = or i64 [[TMP5]], [[TMP7]]
+// CHECK-NEXT: ret i64 [[TMP8]]
+//
+int64_t test_vmlaldavxq_p_s16(int16x8_t a, int16x8_t b, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmlaldavxq_p(a, b, p);
+#else
+ return vmlaldavxq_p_s16(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlaldavxq_p_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call { i32, i32 } @llvm.arm.mve.vmlldava.predicated.v4i32.v4i1(i32 0, i32 0, i32 1, i32 0, i32 0, <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = extractvalue { i32, i32 } [[TMP2]], 1
+// CHECK-NEXT: [[TMP4:%.*]] = zext i32 [[TMP3]] to i64
+// CHECK-NEXT: [[TMP5:%.*]] = shl i64 [[TMP4]], 32
+// CHECK-NEXT: [[TMP6:%.*]] = extractvalue { i32, i32 } [[TMP2]], 0
+// CHECK-NEXT: [[TMP7:%.*]] = zext i32 [[TMP6]] to i64
+// CHECK-NEXT: [[TMP8:%.*]] = or i64 [[TMP5]], [[TMP7]]
+// CHECK-NEXT: ret i64 [[TMP8]]
+//
+int64_t test_vmlaldavxq_p_s32(int32x4_t a, int32x4_t b, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmlaldavxq_p(a, b, p);
+#else
+ return vmlaldavxq_p_s32(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlsldavq_p_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call { i32, i32 } @llvm.arm.mve.vmlldava.predicated.v8i16.v8i1(i32 0, i32 1, i32 0, i32 0, i32 0, <8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = extractvalue { i32, i32 } [[TMP2]], 1
+// CHECK-NEXT: [[TMP4:%.*]] = zext i32 [[TMP3]] to i64
+// CHECK-NEXT: [[TMP5:%.*]] = shl i64 [[TMP4]], 32
+// CHECK-NEXT: [[TMP6:%.*]] = extractvalue { i32, i32 } [[TMP2]], 0
+// CHECK-NEXT: [[TMP7:%.*]] = zext i32 [[TMP6]] to i64
+// CHECK-NEXT: [[TMP8:%.*]] = or i64 [[TMP5]], [[TMP7]]
+// CHECK-NEXT: ret i64 [[TMP8]]
+//
+int64_t test_vmlsldavq_p_s16(int16x8_t a, int16x8_t b, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmlsldavq_p(a, b, p);
+#else
+ return vmlsldavq_p_s16(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlsldavq_p_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call { i32, i32 } @llvm.arm.mve.vmlldava.predicated.v4i32.v4i1(i32 0, i32 1, i32 0, i32 0, i32 0, <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = extractvalue { i32, i32 } [[TMP2]], 1
+// CHECK-NEXT: [[TMP4:%.*]] = zext i32 [[TMP3]] to i64
+// CHECK-NEXT: [[TMP5:%.*]] = shl i64 [[TMP4]], 32
+// CHECK-NEXT: [[TMP6:%.*]] = extractvalue { i32, i32 } [[TMP2]], 0
+// CHECK-NEXT: [[TMP7:%.*]] = zext i32 [[TMP6]] to i64
+// CHECK-NEXT: [[TMP8:%.*]] = or i64 [[TMP5]], [[TMP7]]
+// CHECK-NEXT: ret i64 [[TMP8]]
+//
+int64_t test_vmlsldavq_p_s32(int32x4_t a, int32x4_t b, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmlsldavq_p(a, b, p);
+#else
+ return vmlsldavq_p_s32(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlsldaxvq_p_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call { i32, i32 } @llvm.arm.mve.vmlldava.predicated.v8i16.v8i1(i32 0, i32 1, i32 1, i32 0, i32 0, <8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i1> [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = extractvalue { i32, i32 } [[TMP2]], 1
+// CHECK-NEXT: [[TMP4:%.*]] = zext i32 [[TMP3]] to i64
+// CHECK-NEXT: [[TMP5:%.*]] = shl i64 [[TMP4]], 32
+// CHECK-NEXT: [[TMP6:%.*]] = extractvalue { i32, i32 } [[TMP2]], 0
+// CHECK-NEXT: [[TMP7:%.*]] = zext i32 [[TMP6]] to i64
+// CHECK-NEXT: [[TMP8:%.*]] = or i64 [[TMP5]], [[TMP7]]
+// CHECK-NEXT: ret i64 [[TMP8]]
+//
+int64_t test_vmlsldaxvq_p_s16(int16x8_t a, int16x8_t b, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmlsldavxq_p(a, b, p);
+#else
+ return vmlsldavxq_p_s16(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vmlsldavxq_p_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call { i32, i32 } @llvm.arm.mve.vmlldava.predicated.v4i32.v4i1(i32 0, i32 1, i32 1, i32 0, i32 0, <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = extractvalue { i32, i32 } [[TMP2]], 1
+// CHECK-NEXT: [[TMP4:%.*]] = zext i32 [[TMP3]] to i64
+// CHECK-NEXT: [[TMP5:%.*]] = shl i64 [[TMP4]], 32
+// CHECK-NEXT: [[TMP6:%.*]] = extractvalue { i32, i32 } [[TMP2]], 0
+// CHECK-NEXT: [[TMP7:%.*]] = zext i32 [[TMP6]] to i64
+// CHECK-NEXT: [[TMP8:%.*]] = or i64 [[TMP5]], [[TMP7]]
+// CHECK-NEXT: ret i64 [[TMP8]]
+//
+int64_t test_vmlsldavxq_p_s32(int32x4_t a, int32x4_t b, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vmlsldavxq_p(a, b, p);
+#else
+ return vmlsldavxq_p_s32(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vrmlaldavhq_p_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call { i32, i32 } @llvm.arm.mve.vrmlldavha.predicated.v4i32.v4i1(i32 0, i32 0, i32 0, i32 0, i32 0, <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = extractvalue { i32, i32 } [[TMP2]], 1
+// CHECK-NEXT: [[TMP4:%.*]] = zext i32 [[TMP3]] to i64
+// CHECK-NEXT: [[TMP5:%.*]] = shl i64 [[TMP4]], 32
+// CHECK-NEXT: [[TMP6:%.*]] = extractvalue { i32, i32 } [[TMP2]], 0
+// CHECK-NEXT: [[TMP7:%.*]] = zext i32 [[TMP6]] to i64
+// CHECK-NEXT: [[TMP8:%.*]] = or i64 [[TMP5]], [[TMP7]]
+// CHECK-NEXT: ret i64 [[TMP8]]
+//
+int64_t test_vrmlaldavhq_p_s32(int32x4_t a, int32x4_t b, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vrmlaldavhq_p(a, b, p);
+#else
+ return vrmlaldavhq_p_s32(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vrmlaldavhq_p_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call { i32, i32 } @llvm.arm.mve.vrmlldavha.predicated.v4i32.v4i1(i32 1, i32 0, i32 0, i32 0, i32 0, <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = extractvalue { i32, i32 } [[TMP2]], 1
+// CHECK-NEXT: [[TMP4:%.*]] = zext i32 [[TMP3]] to i64
+// CHECK-NEXT: [[TMP5:%.*]] = shl i64 [[TMP4]], 32
+// CHECK-NEXT: [[TMP6:%.*]] = extractvalue { i32, i32 } [[TMP2]], 0
+// CHECK-NEXT: [[TMP7:%.*]] = zext i32 [[TMP6]] to i64
+// CHECK-NEXT: [[TMP8:%.*]] = or i64 [[TMP5]], [[TMP7]]
+// CHECK-NEXT: ret i64 [[TMP8]]
+//
+uint64_t test_vrmlaldavhq_p_u32(uint32x4_t a, uint32x4_t b, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vrmlaldavhq_p(a, b, p);
+#else
+ return vrmlaldavhq_p_u32(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vrmlaldavhxq_p_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call { i32, i32 } @llvm.arm.mve.vrmlldavha.predicated.v4i32.v4i1(i32 0, i32 0, i32 1, i32 0, i32 0, <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = extractvalue { i32, i32 } [[TMP2]], 1
+// CHECK-NEXT: [[TMP4:%.*]] = zext i32 [[TMP3]] to i64
+// CHECK-NEXT: [[TMP5:%.*]] = shl i64 [[TMP4]], 32
+// CHECK-NEXT: [[TMP6:%.*]] = extractvalue { i32, i32 } [[TMP2]], 0
+// CHECK-NEXT: [[TMP7:%.*]] = zext i32 [[TMP6]] to i64
+// CHECK-NEXT: [[TMP8:%.*]] = or i64 [[TMP5]], [[TMP7]]
+// CHECK-NEXT: ret i64 [[TMP8]]
+//
+int64_t test_vrmlaldavhxq_p_s32(int32x4_t a, int32x4_t b, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vrmlaldavhxq_p(a, b, p);
+#else
+ return vrmlaldavhxq_p_s32(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vrmlsldavhq_p_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call { i32, i32 } @llvm.arm.mve.vrmlldavha.predicated.v4i32.v4i1(i32 0, i32 1, i32 0, i32 0, i32 0, <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = extractvalue { i32, i32 } [[TMP2]], 1
+// CHECK-NEXT: [[TMP4:%.*]] = zext i32 [[TMP3]] to i64
+// CHECK-NEXT: [[TMP5:%.*]] = shl i64 [[TMP4]], 32
+// CHECK-NEXT: [[TMP6:%.*]] = extractvalue { i32, i32 } [[TMP2]], 0
+// CHECK-NEXT: [[TMP7:%.*]] = zext i32 [[TMP6]] to i64
+// CHECK-NEXT: [[TMP8:%.*]] = or i64 [[TMP5]], [[TMP7]]
+// CHECK-NEXT: ret i64 [[TMP8]]
+//
+int64_t test_vrmlsldavhq_p_s32(int32x4_t a, int32x4_t b, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vrmlsldavhq_p(a, b, p);
+#else
+ return vrmlsldavhq_p_s32(a, b, p);
+#endif
+}
+
+// CHECK-LABEL: @test_vrmlsldavhxq_p_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call { i32, i32 } @llvm.arm.mve.vrmlldavha.predicated.v4i32.v4i1(i32 0, i32 1, i32 1, i32 0, i32 0, <4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]])
+// CHECK-NEXT: [[TMP3:%.*]] = extractvalue { i32, i32 } [[TMP2]], 1
+// CHECK-NEXT: [[TMP4:%.*]] = zext i32 [[TMP3]] to i64
+// CHECK-NEXT: [[TMP5:%.*]] = shl i64 [[TMP4]], 32
+// CHECK-NEXT: [[TMP6:%.*]] = extractvalue { i32, i32 } [[TMP2]], 0
+// CHECK-NEXT: [[TMP7:%.*]] = zext i32 [[TMP6]] to i64
+// CHECK-NEXT: [[TMP8:%.*]] = or i64 [[TMP5]], [[TMP7]]
+// CHECK-NEXT: ret i64 [[TMP8]]
+//
+int64_t test_vrmlsldavhxq_p_s32(int32x4_t a, int32x4_t b, mve_pred16_t p) {
+#ifdef POLYMORPHIC
+ return vrmlsldavhxq_p(a, b, p);
+#else
+ return vrmlsldavhxq_p_s32(a, b, p);
+#endif
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vmulhq.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vmulhq.c
new file mode 100644
index 0000000..816a0df
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vmulhq.c
@@ -0,0 +1,143 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vmulhq_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vmulh.v16i8(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 1)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vmulhq_u8(uint8x16_t a, uint8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vmulhq(a, b);
+#else /* POLYMORPHIC */
+ return vmulhq_u8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmulhq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vmulh.v8i16(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 0)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vmulhq_s16(int16x8_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vmulhq(a, b);
+#else /* POLYMORPHIC */
+ return vmulhq_s16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmulhq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vmulh.v4i32(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vmulhq_u32(uint32x4_t a, uint32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vmulhq(a, b);
+#else /* POLYMORPHIC */
+ return vmulhq_u32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmulhq_m_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.mulh.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 0, <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vmulhq_m_s8(int8x16_t inactive, int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vmulhq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vmulhq_m_s8(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmulhq_m_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.mulh.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vmulhq_m_u16(uint16x8_t inactive, uint16x8_t a, uint16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vmulhq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vmulhq_m_u16(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmulhq_m_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.mulh.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 0, <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vmulhq_m_s32(int32x4_t inactive, int32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vmulhq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vmulhq_m_s32(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmulhq_x_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.mulh.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 1, <16 x i1> [[TMP1]], <16 x i8> undef)
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vmulhq_x_u8(uint8x16_t a, uint8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vmulhq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vmulhq_x_u8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmulhq_x_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.mulh.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 0, <8 x i1> [[TMP1]], <8 x i16> undef)
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vmulhq_x_s16(int16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vmulhq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vmulhq_x_s16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmulhq_x_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.mulh.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, <4 x i1> [[TMP1]], <4 x i32> undef)
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vmulhq_x_u32(uint32x4_t a, uint32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vmulhq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vmulhq_x_u32(a, b, p);
+#endif /* POLYMORPHIC */
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vmullbq.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vmullbq.c
new file mode 100644
index 0000000..757fb03
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vmullbq.c
@@ -0,0 +1,189 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vmullbq_int_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vmull.v8i16.v16i8(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 1, i32 0)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vmullbq_int_u8(uint8x16_t a, uint8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vmullbq_int(a, b);
+#else /* POLYMORPHIC */
+ return vmullbq_int_u8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmullbq_int_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vmull.v4i32.v8i16(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 0, i32 0)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+int32x4_t test_vmullbq_int_s16(int16x8_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vmullbq_int(a, b);
+#else /* POLYMORPHIC */
+ return vmullbq_int_s16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmullbq_int_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <2 x i64> @llvm.arm.mve.vmull.v2i64.v4i32(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, i32 0)
+// CHECK-NEXT: ret <2 x i64> [[TMP0]]
+//
+uint64x2_t test_vmullbq_int_u32(uint32x4_t a, uint32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vmullbq_int(a, b);
+#else /* POLYMORPHIC */
+ return vmullbq_int_u32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmullbq_poly_p16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vmull.poly.v4i32.v8i16(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 0)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vmullbq_poly_p16(uint16x8_t a, uint16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vmullbq_poly(a, b);
+#else /* POLYMORPHIC */
+ return vmullbq_poly_p16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmullbq_int_m_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.mull.int.predicated.v8i16.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 0, i32 0, <16 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vmullbq_int_m_s8(int16x8_t inactive, int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vmullbq_int_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vmullbq_int_m_s8(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmullbq_int_m_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.mull.int.predicated.v4i32.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 0, <8 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vmullbq_int_m_u16(uint32x4_t inactive, uint16x8_t a, uint16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vmullbq_int_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vmullbq_int_m_u16(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmullbq_int_m_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <2 x i64> @llvm.arm.mve.mull.int.predicated.v2i64.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 0, i32 0, <4 x i1> [[TMP1]], <2 x i64> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <2 x i64> [[TMP2]]
+//
+int64x2_t test_vmullbq_int_m_s32(int64x2_t inactive, int32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vmullbq_int_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vmullbq_int_m_s32(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmullbq_poly_m_p8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.mull.poly.predicated.v8i16.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 0, <16 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vmullbq_poly_m_p8(uint16x8_t inactive, uint8x16_t a, uint8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vmullbq_poly_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vmullbq_poly_m_p8(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmullbq_int_x_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.mull.int.predicated.v8i16.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 1, i32 0, <16 x i1> [[TMP1]], <8 x i16> undef)
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vmullbq_int_x_u8(uint8x16_t a, uint8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vmullbq_int_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vmullbq_int_x_u8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmullbq_int_x_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.mull.int.predicated.v4i32.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 0, i32 0, <8 x i1> [[TMP1]], <4 x i32> undef)
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vmullbq_int_x_s16(int16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vmullbq_int_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vmullbq_int_x_s16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmullbq_int_x_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <2 x i64> @llvm.arm.mve.mull.int.predicated.v2i64.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, i32 0, <4 x i1> [[TMP1]], <2 x i64> undef)
+// CHECK-NEXT: ret <2 x i64> [[TMP2]]
+//
+uint64x2_t test_vmullbq_int_x_u32(uint32x4_t a, uint32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vmullbq_int_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vmullbq_int_x_u32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmullbq_poly_x_p16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.mull.poly.predicated.v4i32.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 0, <8 x i1> [[TMP1]], <4 x i32> undef)
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vmullbq_poly_x_p16(uint16x8_t a, uint16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vmullbq_poly_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vmullbq_poly_x_p16(a, b, p);
+#endif /* POLYMORPHIC */
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vmulltq.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vmulltq.c
new file mode 100644
index 0000000..1cd982e
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vmulltq.c
@@ -0,0 +1,189 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vmulltq_int_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vmull.v8i16.v16i8(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 1, i32 1)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vmulltq_int_u8(uint8x16_t a, uint8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vmulltq_int(a, b);
+#else /* POLYMORPHIC */
+ return vmulltq_int_u8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmulltq_int_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vmull.v4i32.v8i16(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 0, i32 1)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+int32x4_t test_vmulltq_int_s16(int16x8_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vmulltq_int(a, b);
+#else /* POLYMORPHIC */
+ return vmulltq_int_s16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmulltq_int_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <2 x i64> @llvm.arm.mve.vmull.v2i64.v4i32(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, i32 1)
+// CHECK-NEXT: ret <2 x i64> [[TMP0]]
+//
+uint64x2_t test_vmulltq_int_u32(uint32x4_t a, uint32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vmulltq_int(a, b);
+#else /* POLYMORPHIC */
+ return vmulltq_int_u32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmulltq_poly_p16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vmull.poly.v4i32.v8i16(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vmulltq_poly_p16(uint16x8_t a, uint16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vmulltq_poly(a, b);
+#else /* POLYMORPHIC */
+ return vmulltq_poly_p16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmulltq_int_m_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.mull.int.predicated.v8i16.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 0, i32 1, <16 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vmulltq_int_m_s8(int16x8_t inactive, int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vmulltq_int_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vmulltq_int_m_s8(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmulltq_int_m_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.mull.int.predicated.v4i32.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 1, <8 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vmulltq_int_m_u16(uint32x4_t inactive, uint16x8_t a, uint16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vmulltq_int_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vmulltq_int_m_u16(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmulltq_int_m_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <2 x i64> @llvm.arm.mve.mull.int.predicated.v2i64.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 0, i32 1, <4 x i1> [[TMP1]], <2 x i64> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <2 x i64> [[TMP2]]
+//
+int64x2_t test_vmulltq_int_m_s32(int64x2_t inactive, int32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vmulltq_int_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vmulltq_int_m_s32(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmulltq_poly_m_p8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.mull.poly.predicated.v8i16.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 1, <16 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vmulltq_poly_m_p8(uint16x8_t inactive, uint8x16_t a, uint8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vmulltq_poly_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vmulltq_poly_m_p8(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmulltq_int_x_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.mull.int.predicated.v8i16.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 1, i32 1, <16 x i1> [[TMP1]], <8 x i16> undef)
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vmulltq_int_x_u8(uint8x16_t a, uint8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vmulltq_int_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vmulltq_int_x_u8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmulltq_int_x_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.mull.int.predicated.v4i32.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 0, i32 1, <8 x i1> [[TMP1]], <4 x i32> undef)
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vmulltq_int_x_s16(int16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vmulltq_int_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vmulltq_int_x_s16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmulltq_int_x_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <2 x i64> @llvm.arm.mve.mull.int.predicated.v2i64.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, i32 1, <4 x i1> [[TMP1]], <2 x i64> undef)
+// CHECK-NEXT: ret <2 x i64> [[TMP2]]
+//
+uint64x2_t test_vmulltq_int_x_u32(uint32x4_t a, uint32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vmulltq_int_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vmulltq_int_x_u32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmulltq_poly_x_p8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.mull.poly.predicated.v8i16.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 1, <16 x i1> [[TMP1]], <8 x i16> undef)
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vmulltq_poly_x_p8(uint8x16_t a, uint8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vmulltq_poly_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vmulltq_poly_x_p8(a, b, p);
+#endif /* POLYMORPHIC */
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vmulq.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vmulq.c
new file mode 100644
index 0000000..536bc73
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vmulq.c
@@ -0,0 +1,189 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vmulq_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = mul <16 x i8> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vmulq_u8(uint8x16_t a, uint8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vmulq(a, b);
+#else /* POLYMORPHIC */
+ return vmulq_u8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmulq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = mul <8 x i16> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vmulq_s16(int16x8_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vmulq(a, b);
+#else /* POLYMORPHIC */
+ return vmulq_s16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmulq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = mul <4 x i32> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vmulq_u32(uint32x4_t a, uint32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vmulq(a, b);
+#else /* POLYMORPHIC */
+ return vmulq_u32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmulq_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = fmul <4 x float> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <4 x float> [[TMP0]]
+//
+float32x4_t test_vmulq_f32(float32x4_t a, float32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vmulq(a, b);
+#else /* POLYMORPHIC */
+ return vmulq_f32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmulq_m_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.mul.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vmulq_m_s8(int8x16_t inactive, int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vmulq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vmulq_m_s8(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmulq_m_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.mul.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vmulq_m_u16(uint16x8_t inactive, uint16x8_t a, uint16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vmulq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vmulq_m_u16(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmulq_m_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.mul.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vmulq_m_s32(int32x4_t inactive, int32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vmulq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vmulq_m_s32(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmulq_m_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.mul.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x half> [[B:%.*]], <8 x i1> [[TMP1]], <8 x half> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x half> [[TMP2]]
+//
+float16x8_t test_vmulq_m_f16(float16x8_t inactive, float16x8_t a, float16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vmulq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vmulq_m_f16(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmulq_x_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.mul.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i1> [[TMP1]], <16 x i8> undef)
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vmulq_x_u8(uint8x16_t a, uint8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vmulq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vmulq_x_u8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmulq_x_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.mul.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i1> [[TMP1]], <8 x i16> undef)
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vmulq_x_s16(int16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vmulq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vmulq_x_s16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmulq_x_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.mul.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]], <4 x i32> undef)
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vmulq_x_u32(uint32x4_t a, uint32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vmulq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vmulq_x_u32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vmulq_m_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.mul.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x float> [[B:%.*]], <4 x i1> [[TMP1]], <4 x float> undef)
+// CHECK-NEXT: ret <4 x float> [[TMP2]]
+//
+float32x4_t test_vmulq_m_f32(float32x4_t a, float32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vmulq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vmulq_x_f32(a, b, p);
+#endif /* POLYMORPHIC */
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vornq.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vornq.c
new file mode 100644
index 0000000..8505bfe
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vornq.c
@@ -0,0 +1,203 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vornq_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = xor <16 x i8> [[B:%.*]], <i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1>
+// CHECK-NEXT: [[TMP1:%.*]] = or <16 x i8> [[A:%.*]], [[TMP0]]
+// CHECK-NEXT: ret <16 x i8> [[TMP1]]
+//
+uint8x16_t test_vornq_u8(uint8x16_t a, uint8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vornq(a, b);
+#else /* POLYMORPHIC */
+ return vornq_u8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vornq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = xor <8 x i16> [[B:%.*]], <i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1>
+// CHECK-NEXT: [[TMP1:%.*]] = or <8 x i16> [[A:%.*]], [[TMP0]]
+// CHECK-NEXT: ret <8 x i16> [[TMP1]]
+//
+int16x8_t test_vornq_s16(int16x8_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vornq(a, b);
+#else /* POLYMORPHIC */
+ return vornq_s16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vornq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = xor <4 x i32> [[B:%.*]], <i32 -1, i32 -1, i32 -1, i32 -1>
+// CHECK-NEXT: [[TMP1:%.*]] = or <4 x i32> [[A:%.*]], [[TMP0]]
+// CHECK-NEXT: ret <4 x i32> [[TMP1]]
+//
+uint32x4_t test_vornq_u32(uint32x4_t a, uint32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vornq(a, b);
+#else /* POLYMORPHIC */
+ return vornq_u32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vornq_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[A:%.*]] to <4 x i32>
+// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x float> [[B:%.*]] to <4 x i32>
+// CHECK-NEXT: [[TMP2:%.*]] = xor <4 x i32> [[TMP1]], <i32 -1, i32 -1, i32 -1, i32 -1>
+// CHECK-NEXT: [[TMP3:%.*]] = or <4 x i32> [[TMP0]], [[TMP2]]
+// CHECK-NEXT: [[TMP4:%.*]] = bitcast <4 x i32> [[TMP3]] to <4 x float>
+// CHECK-NEXT: ret <4 x float> [[TMP4]]
+//
+float32x4_t test_vornq_f32(float32x4_t a, float32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vornq(a, b);
+#else /* POLYMORPHIC */
+ return vornq_f32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vornq_m_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.orn.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vornq_m_s8(int8x16_t inactive, int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vornq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vornq_m_s8(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vornq_m_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.orn.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vornq_m_u16(uint16x8_t inactive, uint16x8_t a, uint16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vornq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vornq_m_u16(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vornq_m_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.orn.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vornq_m_s32(int32x4_t inactive, int32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vornq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vornq_m_s32(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vornq_m_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x half> [[A:%.*]] to <8 x i16>
+// CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x half> [[B:%.*]] to <8 x i16>
+// CHECK-NEXT: [[TMP2:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP2]])
+// CHECK-NEXT: [[TMP4:%.*]] = bitcast <8 x half> [[INACTIVE:%.*]] to <8 x i16>
+// CHECK-NEXT: [[TMP5:%.*]] = call <8 x i16> @llvm.arm.mve.orn.predicated.v8i16.v8i1(<8 x i16> [[TMP0]], <8 x i16> [[TMP1]], <8 x i1> [[TMP3]], <8 x i16> [[TMP4]])
+// CHECK-NEXT: [[TMP6:%.*]] = bitcast <8 x i16> [[TMP5]] to <8 x half>
+// CHECK-NEXT: ret <8 x half> [[TMP6]]
+//
+float16x8_t test_vornq_m_f16(float16x8_t inactive, float16x8_t a, float16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vornq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vornq_m_f16(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vornq_x_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.orn.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i1> [[TMP1]], <16 x i8> undef)
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vornq_x_u8(uint8x16_t a, uint8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vornq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vornq_x_u8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vornq_x_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.orn.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i1> [[TMP1]], <8 x i16> undef)
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vornq_x_s16(int16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vornq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vornq_x_s16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vornq_x_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.orn.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]], <4 x i32> undef)
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vornq_x_u32(uint32x4_t a, uint32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vornq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vornq_x_u32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vornq_m_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[A:%.*]] to <4 x i32>
+// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x float> [[B:%.*]] to <4 x i32>
+// CHECK-NEXT: [[TMP2:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP2]])
+// CHECK-NEXT: [[TMP4:%.*]] = call <4 x i32> @llvm.arm.mve.orn.predicated.v4i32.v4i1(<4 x i32> [[TMP0]], <4 x i32> [[TMP1]], <4 x i1> [[TMP3]], <4 x i32> undef)
+// CHECK-NEXT: [[TMP5:%.*]] = bitcast <4 x i32> [[TMP4]] to <4 x float>
+// CHECK-NEXT: ret <4 x float> [[TMP5]]
+//
+float32x4_t test_vornq_m_f32(float32x4_t a, float32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vornq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vornq_x_f32(a, b, p);
+#endif /* POLYMORPHIC */
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vorrq.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vorrq.c
new file mode 100644
index 0000000..3ddc862
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vorrq.c
@@ -0,0 +1,199 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vorrq_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = or <16 x i8> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vorrq_u8(uint8x16_t a, uint8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vorrq(a, b);
+#else /* POLYMORPHIC */
+ return vorrq_u8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vorrq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = or <8 x i16> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vorrq_s16(int16x8_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vorrq(a, b);
+#else /* POLYMORPHIC */
+ return vorrq_s16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vorrq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = or <4 x i32> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vorrq_u32(uint32x4_t a, uint32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vorrq(a, b);
+#else /* POLYMORPHIC */
+ return vorrq_u32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vorrq_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[A:%.*]] to <4 x i32>
+// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x float> [[B:%.*]] to <4 x i32>
+// CHECK-NEXT: [[TMP2:%.*]] = or <4 x i32> [[TMP0]], [[TMP1]]
+// CHECK-NEXT: [[TMP3:%.*]] = bitcast <4 x i32> [[TMP2]] to <4 x float>
+// CHECK-NEXT: ret <4 x float> [[TMP3]]
+//
+float32x4_t test_vorrq_f32(float32x4_t a, float32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vorrq(a, b);
+#else /* POLYMORPHIC */
+ return vorrq_f32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vorrq_m_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.orr.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vorrq_m_s8(int8x16_t inactive, int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vorrq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vorrq_m_s8(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vorrq_m_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.orr.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vorrq_m_u16(uint16x8_t inactive, uint16x8_t a, uint16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vorrq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vorrq_m_u16(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vorrq_m_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.orr.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vorrq_m_s32(int32x4_t inactive, int32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vorrq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vorrq_m_s32(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vorrq_m_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x half> [[A:%.*]] to <8 x i16>
+// CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x half> [[B:%.*]] to <8 x i16>
+// CHECK-NEXT: [[TMP2:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP2]])
+// CHECK-NEXT: [[TMP4:%.*]] = bitcast <8 x half> [[INACTIVE:%.*]] to <8 x i16>
+// CHECK-NEXT: [[TMP5:%.*]] = call <8 x i16> @llvm.arm.mve.orr.predicated.v8i16.v8i1(<8 x i16> [[TMP0]], <8 x i16> [[TMP1]], <8 x i1> [[TMP3]], <8 x i16> [[TMP4]])
+// CHECK-NEXT: [[TMP6:%.*]] = bitcast <8 x i16> [[TMP5]] to <8 x half>
+// CHECK-NEXT: ret <8 x half> [[TMP6]]
+//
+float16x8_t test_vorrq_m_f16(float16x8_t inactive, float16x8_t a, float16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vorrq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vorrq_m_f16(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vorrq_x_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.orr.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i1> [[TMP1]], <16 x i8> undef)
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vorrq_x_u8(uint8x16_t a, uint8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vorrq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vorrq_x_u8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vorrq_x_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.orr.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i1> [[TMP1]], <8 x i16> undef)
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vorrq_x_s16(int16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vorrq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vorrq_x_s16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vorrq_x_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.orr.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]], <4 x i32> undef)
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vorrq_x_u32(uint32x4_t a, uint32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vorrq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vorrq_x_u32(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vorrq_m_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[A:%.*]] to <4 x i32>
+// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x float> [[B:%.*]] to <4 x i32>
+// CHECK-NEXT: [[TMP2:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP3:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP2]])
+// CHECK-NEXT: [[TMP4:%.*]] = call <4 x i32> @llvm.arm.mve.orr.predicated.v4i32.v4i1(<4 x i32> [[TMP0]], <4 x i32> [[TMP1]], <4 x i1> [[TMP3]], <4 x i32> undef)
+// CHECK-NEXT: [[TMP5:%.*]] = bitcast <4 x i32> [[TMP4]] to <4 x float>
+// CHECK-NEXT: ret <4 x float> [[TMP5]]
+//
+float32x4_t test_vorrq_m_f32(float32x4_t a, float32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vorrq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vorrq_x_f32(a, b, p);
+#endif /* POLYMORPHIC */
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vqaddq.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vqaddq.c
new file mode 100644
index 0000000..8361ab3
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vqaddq.c
@@ -0,0 +1,95 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vqaddq_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.uadd.sat.v16i8(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vqaddq_u8(uint8x16_t a, uint8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vqaddq(a, b);
+#else /* POLYMORPHIC */
+ return vqaddq_u8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqaddq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.sadd.sat.v8i16(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vqaddq_s16(int16x8_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vqaddq(a, b);
+#else /* POLYMORPHIC */
+ return vqaddq_s16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqaddq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.uadd.sat.v4i32(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vqaddq_u32(uint32x4_t a, uint32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vqaddq(a, b);
+#else /* POLYMORPHIC */
+ return vqaddq_u32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqaddq_m_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.qadd.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 0, <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vqaddq_m_s8(int8x16_t inactive, int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqaddq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vqaddq_m_s8(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqaddq_m_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.qadd.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vqaddq_m_u16(uint16x8_t inactive, uint16x8_t a, uint16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqaddq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vqaddq_m_u16(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqaddq_m_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.qadd.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 0, <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vqaddq_m_s32(int32x4_t inactive, int32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqaddq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vqaddq_m_s32(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vqdmulhq.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vqdmulhq.c
new file mode 100644
index 0000000..eb7e0a0
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vqdmulhq.c
@@ -0,0 +1,95 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vqdmulhq_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vqdmulh.v16i8(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+int8x16_t test_vqdmulhq_s8(int8x16_t a, int8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vqdmulhq(a, b);
+#else /* POLYMORPHIC */
+ return vqdmulhq_s8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqdmulhq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vqdmulh.v8i16(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vqdmulhq_s16(int16x8_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vqdmulhq(a, b);
+#else /* POLYMORPHIC */
+ return vqdmulhq_s16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqdmulhq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vqdmulh.v4i32(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+int32x4_t test_vqdmulhq_s32(int32x4_t a, int32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vqdmulhq(a, b);
+#else /* POLYMORPHIC */
+ return vqdmulhq_s32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqdmulhq_m_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.qdmulh.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vqdmulhq_m_s8(int8x16_t inactive, int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqdmulhq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vqdmulhq_m_s8(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqdmulhq_m_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.qdmulh.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vqdmulhq_m_s16(int16x8_t inactive, int16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqdmulhq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vqdmulhq_m_s16(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqdmulhq_m_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.qdmulh.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vqdmulhq_m_s32(int32x4_t inactive, int32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqdmulhq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vqdmulhq_m_s32(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vqrdmulhq.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vqrdmulhq.c
new file mode 100644
index 0000000..27b7efd
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vqrdmulhq.c
@@ -0,0 +1,95 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vqrdmulhq_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vqrdmulh.v16i8(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+int8x16_t test_vqrdmulhq_s8(int8x16_t a, int8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vqrdmulhq(a, b);
+#else /* POLYMORPHIC */
+ return vqrdmulhq_s8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrdmulhq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vqrdmulh.v8i16(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vqrdmulhq_s16(int16x8_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vqrdmulhq(a, b);
+#else /* POLYMORPHIC */
+ return vqrdmulhq_s16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrdmulhq_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vqrdmulh.v4i32(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+int32x4_t test_vqrdmulhq_s32(int32x4_t a, int32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vqrdmulhq(a, b);
+#else /* POLYMORPHIC */
+ return vqrdmulhq_s32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrdmulhq_m_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.qrdmulh.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vqrdmulhq_m_s8(int8x16_t inactive, int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqrdmulhq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vqrdmulhq_m_s8(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrdmulhq_m_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.qrdmulh.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vqrdmulhq_m_s16(int16x8_t inactive, int16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqrdmulhq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vqrdmulhq_m_s16(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqrdmulhq_m_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.qrdmulh.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vqrdmulhq_m_s32(int32x4_t inactive, int32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqrdmulhq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vqrdmulhq_m_s32(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vqsubq.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vqsubq.c
new file mode 100644
index 0000000..c8924bf
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vqsubq.c
@@ -0,0 +1,95 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vqsubq_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.usub.sat.v16i8(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vqsubq_u8(uint8x16_t a, uint8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vqsubq(a, b);
+#else /* POLYMORPHIC */
+ return vqsubq_u8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqsubq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.ssub.sat.v8i16(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vqsubq_s16(int16x8_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vqsubq(a, b);
+#else /* POLYMORPHIC */
+ return vqsubq_s16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqsubq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.usub.sat.v4i32(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vqsubq_u32(uint32x4_t a, uint32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vqsubq(a, b);
+#else /* POLYMORPHIC */
+ return vqsubq_u32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqsubq_m_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.qsub.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 0, <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vqsubq_m_s8(int8x16_t inactive, int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqsubq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vqsubq_m_s8(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqsubq_m_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.qsub.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vqsubq_m_u16(uint16x8_t inactive, uint16x8_t a, uint16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqsubq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vqsubq_m_u16(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vqsubq_m_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.qsub.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 0, <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vqsubq_m_s32(int32x4_t inactive, int32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vqsubq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vqsubq_m_s32(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vrhaddq.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vrhaddq.c
new file mode 100644
index 0000000..eb28d23
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vrhaddq.c
@@ -0,0 +1,143 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vrhaddq_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vrhadd.v16i8(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 1)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vrhaddq_u8(uint8x16_t a, uint8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vrhaddq(a, b);
+#else /* POLYMORPHIC */
+ return vrhaddq_u8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrhaddq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vrhadd.v8i16(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 0)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vrhaddq_s16(int16x8_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vrhaddq(a, b);
+#else /* POLYMORPHIC */
+ return vrhaddq_s16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrhaddq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vrhadd.v4i32(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vrhaddq_u32(uint32x4_t a, uint32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vrhaddq(a, b);
+#else /* POLYMORPHIC */
+ return vrhaddq_u32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrhaddq_m_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.rhadd.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 0, <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vrhaddq_m_s8(int8x16_t inactive, int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrhaddq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vrhaddq_m_s8(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrhaddq_m_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.rhadd.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vrhaddq_m_u16(uint16x8_t inactive, uint16x8_t a, uint16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrhaddq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vrhaddq_m_u16(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrhaddq_m_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.rhadd.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 0, <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vrhaddq_m_s32(int32x4_t inactive, int32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrhaddq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vrhaddq_m_s32(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrhaddq_x_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.rhadd.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 1, <16 x i1> [[TMP1]], <16 x i8> undef)
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vrhaddq_x_u8(uint8x16_t a, uint8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrhaddq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vrhaddq_x_u8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrhaddq_x_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.rhadd.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, <8 x i1> [[TMP1]], <8 x i16> undef)
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vrhaddq_x_u16(uint16x8_t a, uint16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrhaddq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vrhaddq_x_u16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrhaddq_x_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.rhadd.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, <4 x i1> [[TMP1]], <4 x i32> undef)
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vrhaddq_x_u32(uint32x4_t a, uint32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrhaddq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vrhaddq_x_u32(a, b, p);
+#endif /* POLYMORPHIC */
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vrmulhq.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vrmulhq.c
new file mode 100644
index 0000000..4f65f00
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vrmulhq.c
@@ -0,0 +1,143 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vrmulhq_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vrmulh.v16i8(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 1)
+// CHECK-NEXT: ret <16 x i8> [[TMP0]]
+//
+uint8x16_t test_vrmulhq_u8(uint8x16_t a, uint8x16_t b)
+{
+#ifdef POLYMORPHIC
+ return vrmulhq(a, b);
+#else /* POLYMORPHIC */
+ return vrmulhq_u8(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrmulhq_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vrmulh.v8i16(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 0)
+// CHECK-NEXT: ret <8 x i16> [[TMP0]]
+//
+int16x8_t test_vrmulhq_s16(int16x8_t a, int16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vrmulhq(a, b);
+#else /* POLYMORPHIC */
+ return vrmulhq_s16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrmulhq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vrmulh.v4i32(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1)
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vrmulhq_u32(uint32x4_t a, uint32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vrmulhq(a, b);
+#else /* POLYMORPHIC */
+ return vrmulhq_u32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrmulhq_m_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.rmulh.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 0, <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vrmulhq_m_s8(int8x16_t inactive, int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrmulhq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vrmulhq_m_s8(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrmulhq_m_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.rmulh.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vrmulhq_m_u16(uint16x8_t inactive, uint16x8_t a, uint16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrmulhq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vrmulhq_m_u16(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrmulhq_m_s32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.rmulh.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 0, <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+int32x4_t test_vrmulhq_m_s32(int32x4_t inactive, int32x4_t a, int32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrmulhq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vrmulhq_m_s32(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrmulhq_x_u8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.rmulh.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 1, <16 x i1> [[TMP1]], <16 x i8> undef)
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+uint8x16_t test_vrmulhq_x_u8(uint8x16_t a, uint8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrmulhq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vrmulhq_x_u8(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrmulhq_x_s16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.rmulh.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 0, <8 x i1> [[TMP1]], <8 x i16> undef)
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+int16x8_t test_vrmulhq_x_s16(int16x8_t a, int16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrmulhq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vrmulhq_x_s16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vrmulhq_m_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.rmulh.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, <4 x i1> [[TMP1]], <4 x i32> undef)
+// CHECK-NEXT: ret <4 x i32> [[TMP2]]
+//
+uint32x4_t test_vrmulhq_m_u32(uint32x4_t a, uint32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vrmulhq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vrmulhq_x_u32(a, b, p);
+#endif /* POLYMORPHIC */
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vsubq.c b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vsubq.c
new file mode 100644
index 0000000..dd11aa8
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-mve-intrinsics/vsubq.c
@@ -0,0 +1,97 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
+
+#include <arm_mve.h>
+
+// CHECK-LABEL: @test_vsubq_u32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = sub <4 x i32> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <4 x i32> [[TMP0]]
+//
+uint32x4_t test_vsubq_u32(uint32x4_t a, uint32x4_t b)
+{
+#ifdef POLYMORPHIC
+ return vsubq(a, b);
+#else /* POLYMORPHIC */
+ return vsubq_u32(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vsubq_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = fsub <8 x half> [[A:%.*]], [[B:%.*]]
+// CHECK-NEXT: ret <8 x half> [[TMP0]]
+//
+float16x8_t test_vsubq_f16(float16x8_t a, float16x8_t b)
+{
+#ifdef POLYMORPHIC
+ return vsubq(a, b);
+#else /* POLYMORPHIC */
+ return vsubq_f16(a, b);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vsubq_m_s8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.sub.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <16 x i8> [[TMP2]]
+//
+int8x16_t test_vsubq_m_s8(int8x16_t inactive, int8x16_t a, int8x16_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vsubq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vsubq_m_s8(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vsubq_m_f32(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.sub.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x float> [[B:%.*]], <4 x i1> [[TMP1]], <4 x float> [[INACTIVE:%.*]])
+// CHECK-NEXT: ret <4 x float> [[TMP2]]
+//
+float32x4_t test_vsubq_m_f32(float32x4_t inactive, float32x4_t a, float32x4_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vsubq_m(inactive, a, b, p);
+#else /* POLYMORPHIC */
+ return vsubq_m_f32(inactive, a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vsubq_x_u16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.sub.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], <8 x i1> [[TMP1]], <8 x i16> undef)
+// CHECK-NEXT: ret <8 x i16> [[TMP2]]
+//
+uint16x8_t test_vsubq_x_u16(uint16x8_t a, uint16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vsubq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vsubq_x_u16(a, b, p);
+#endif /* POLYMORPHIC */
+}
+
+// CHECK-LABEL: @test_vsubq_x_f16(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
+// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
+// CHECK-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.sub.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x half> [[B:%.*]], <8 x i1> [[TMP1]], <8 x half> undef)
+// CHECK-NEXT: ret <8 x half> [[TMP2]]
+//
+float16x8_t test_vsubq_x_f16(float16x8_t a, float16x8_t b, mve_pred16_t p)
+{
+#ifdef POLYMORPHIC
+ return vsubq_x(a, b, p);
+#else /* POLYMORPHIC */
+ return vsubq_x_f16(a, b, p);
+#endif /* POLYMORPHIC */
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-neon-vcadd.c b/src/llvm-project/clang/test/CodeGen/arm-neon-vcadd.c
new file mode 100644
index 0000000..00b4641
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm-neon-vcadd.c
@@ -0,0 +1,54 @@
+// REQUIRES: arm-registered-target
+// RUN: %clang_cc1 -triple armv8.3a-arm-none-eabi -target-cpu generic \
+// RUN: -target-feature +fullfp16 -mfloat-abi soft -S -emit-llvm -o - %s | \
+// RUN: opt -S -sroa -o - | FileCheck %s
+
+#include <arm_neon.h>
+
+void foo16x4_rot90(float16x4_t a, float16x4_t b)
+{
+// CHECK: call <4 x half> @llvm.arm.neon.vcadd.rot90.v4f16
+ float16x4_t result = vcadd_rot90_f16(a, b);
+}
+
+void foo32x2_rot90(float32x2_t a, float32x2_t b)
+{
+// CHECK: call <2 x float> @llvm.arm.neon.vcadd.rot90.v2f32
+ float32x2_t result = vcadd_rot90_f32(a, b);
+}
+
+void foo16x8_rot90(float16x8_t a, float16x8_t b)
+{
+// CHECK: call <8 x half> @llvm.arm.neon.vcadd.rot90.v8f16
+ float16x8_t result = vcaddq_rot90_f16(a, b);
+}
+
+void foo32x4_rot90(float32x4_t a, float32x4_t b)
+{
+// CHECK: call <4 x float> @llvm.arm.neon.vcadd.rot90.v4f32
+ float32x4_t result = vcaddq_rot90_f32(a, b);
+}
+
+void foo16x4_rot270(float16x4_t a, float16x4_t b)
+{
+// CHECK: call <4 x half> @llvm.arm.neon.vcadd.rot270.v4f16
+ float16x4_t result = vcadd_rot270_f16(a, b);
+}
+
+void foo32x2_rot270(float32x2_t a, float32x2_t b)
+{
+// CHECK: call <2 x float> @llvm.arm.neon.vcadd.rot270.v2f32
+ float32x2_t result = vcadd_rot270_f32(a, b);
+}
+
+void foo16x8_rot270(float16x8_t a, float16x8_t b)
+{
+// CHECK: call <8 x half> @llvm.arm.neon.vcadd.rot270.v8f16
+ float16x8_t result = vcaddq_rot270_f16(a, b);
+}
+
+void foo32x4_rot270(float32x4_t a, float32x4_t b)
+{
+// CHECK: call <4 x float> @llvm.arm.neon.vcadd.rot270.v4f32
+ float32x4_t result = vcaddq_rot270_f32(a, b);
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-swiftcall.c b/src/llvm-project/clang/test/CodeGen/arm-swiftcall.c
index 53109a3..45f313d 100644
--- a/src/llvm-project/clang/test/CodeGen/arm-swiftcall.c
+++ b/src/llvm-project/clang/test/CodeGen/arm-swiftcall.c
@@ -29,7 +29,7 @@
// CHECK-LABEL: define {{.*}} void @context_2(i8*{{.*}}, i8* swiftself
SWIFTCALL void context_error_1(CONTEXT int *self, ERROR float **error) {}
-// CHECK-LABEL: define {{.*}} void @context_error_1(i32* swiftself{{.*}}, float** swifterror)
+// CHECK-LABEL: define {{.*}} void @context_error_1(i32* swiftself{{.*}}, float** swifterror %0)
// CHECK: [[TEMP:%.*]] = alloca float*, align 4
// CHECK: [[T0:%.*]] = load float*, float** [[ERRORARG:%.*]], align 4
// CHECK: store float* [[T0]], float** [[TEMP]], align 4
@@ -51,7 +51,7 @@
// CHECK: store float* [[T0]], float** [[ERROR]], align 4
SWIFTCALL void context_error_2(short s, CONTEXT int *self, ERROR float **error) {}
-// CHECK-LABEL: define {{.*}} void @context_error_2(i16{{.*}}, i32* swiftself{{.*}}, float** swifterror)
+// CHECK-LABEL: define {{.*}} void @context_error_2(i16{{.*}}, i32* swiftself{{.*}}, float** swifterror %0)
/*****************************************************************************/
/********************************** LOWERING *********************************/
@@ -118,7 +118,7 @@
// CHECK: [[T2:%.*]] = insertvalue [[UAGG]] [[T1]], float [[THIRD]], 2
// CHECK: [[T3:%.*]] = insertvalue [[UAGG]] [[T2]], float [[FOURTH]], 3
// CHECK: ret [[UAGG]] [[T3]]
-// CHECK-LABEL: define {{.*}} @take_struct_1(i32, i16, float, float)
+// CHECK-LABEL: define {{.*}} @take_struct_1(i32 %0, i16 %1, float %2, float %3)
// CHECK: [[V:%.*]] = alloca [[REC]], align 4
// CHECK: [[CAST_TMP:%.*]] = bitcast [[REC]]* [[V]] to [[AGG]]*
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 0
@@ -183,7 +183,7 @@
// CHECK: [[T2:%.*]] = insertvalue [[UAGG]] [[T1]], float [[THIRD]], 2
// CHECK: [[T3:%.*]] = insertvalue [[UAGG]] [[T2]], float [[FOURTH]], 3
// CHECK: ret [[UAGG]] [[T3]]
-// CHECK-LABEL: define {{.*}} @take_struct_2(i32, i32, float, float)
+// CHECK-LABEL: define {{.*}} @take_struct_2(i32 %0, i32 %1, float %2, float %3)
// CHECK: [[V:%.*]] = alloca [[REC]], align 4
// CHECK: [[CAST_TMP:%.*]] = bitcast [[REC]]* [[V]] to [[AGG]]*
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 0
@@ -245,7 +245,7 @@
// CHECK: [[T0:%.*]] = insertvalue [[UAGG:{ i32, i8 }]] undef, i32 [[FIRST]], 0
// CHECK: [[T1:%.*]] = insertvalue [[UAGG]] [[T0]], i8 [[SECOND]], 1
// CHECK: ret [[UAGG]] [[T1]]
-// CHECK-LABEL: define {{.*}} @take_struct_misaligned_1(i32, i8)
+// CHECK-LABEL: define {{.*}} @take_struct_misaligned_1(i32 %0, i8 %1)
// CHECK: [[V:%.*]] = alloca [[REC]], align
// CHECK: [[CAST_TMP:%.*]] = bitcast [[REC]]* [[V]] to [[AGG]]*
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 0
@@ -285,7 +285,7 @@
// CHECK: [[T0:%.*]] = insertvalue [[UAGG:{ i32, i32 }]] undef, i32 [[FIRST]], 0
// CHECK: [[T1:%.*]] = insertvalue [[UAGG]] [[T0]], i32 [[SECOND]], 1
// CHECK: ret [[UAGG]] [[T1]]
-// CHECK-LABEL: define {{.*}} @take_union_het_fp(i32, i32)
+// CHECK-LABEL: define {{.*}} @take_union_het_fp(i32 %0, i32 %1)
// CHECK: [[V:%.*]] = alloca [[REC]], align {{(4|8)}}
// CHECK: [[CAST_TMP:%.*]] = bitcast [[REC]]* [[V]] to [[AGG]]*
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 0
@@ -417,7 +417,7 @@
// CHECK: [[T0:%.*]] = insertvalue [[UAGG:{ <4 x i32>, <4 x i32> }]] undef, <4 x i32> [[FIRST]], 0
// CHECK: [[T1:%.*]] = insertvalue [[UAGG]] [[T0]], <4 x i32> [[SECOND]], 1
// CHECK: ret [[UAGG]] [[T1]]
-// CHECK-LABEL: define {{.*}} @take_int8(<4 x i32>, <4 x i32>)
+// CHECK-LABEL: define {{.*}} @take_int8(<4 x i32> %0, <4 x i32> %1)
// CHECK: [[V:%.*]] = alloca [[REC]], align
// CHECK: [[CAST_TMP:%.*]] = bitcast [[REC]]* [[V]] to [[AGG]]*
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 0
@@ -460,7 +460,7 @@
// CHECK: [[T0:%.*]] = insertvalue [[UAGG:{ <4 x i32>, i32 }]] undef, <4 x i32> [[FIRST]], 0
// CHECK: [[T1:%.*]] = insertvalue [[UAGG]] [[T0]], i32 [[SECOND]], 1
// CHECK: ret [[UAGG]] [[T1]]
-// CHECK-LABEL: define {{.*}} @take_int5(<4 x i32>, i32)
+// CHECK-LABEL: define {{.*}} @take_int5(<4 x i32> %0, i32 %1)
// CHECK: [[V:%.*]] = alloca [[REC]], align
// CHECK: [[CAST_TMP:%.*]] = bitcast [[REC]]* [[V]] to [[AGG]]*
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 0
@@ -494,14 +494,14 @@
int3 v __attribute__((packed));
} misaligned_int3;
TEST(misaligned_int3)
-// CHECK-LABEL: define {{.*}} @take_misaligned_int3(i32, i32, i32, i32)
+// CHECK-LABEL: define {{.*}} @take_misaligned_int3(i32 %0, i32 %1, i32 %2, i32 %3)
typedef struct {
float f0;
} struct_f1;
TEST(struct_f1)
// CHECK-LABEL: define swiftcc float @return_struct_f1()
-// CHECK-LABEL: define swiftcc void @take_struct_f1(float)
+// CHECK-LABEL: define swiftcc void @take_struct_f1(float %0)
typedef struct {
float f0;
@@ -509,7 +509,7 @@
} struct_f2;
TEST(struct_f2)
// CHECK-LABEL: define swiftcc { float, float } @return_struct_f2()
-// CHECK-LABEL: define swiftcc void @take_struct_f2(float, float)
+// CHECK-LABEL: define swiftcc void @take_struct_f2(float %0, float %1)
typedef struct {
float f0;
@@ -518,7 +518,7 @@
} struct_f3;
TEST(struct_f3)
// CHECK-LABEL: define swiftcc { float, float, float } @return_struct_f3()
-// CHECK-LABEL: define swiftcc void @take_struct_f3(float, float, float)
+// CHECK-LABEL: define swiftcc void @take_struct_f3(float %0, float %1, float %2)
typedef struct {
float f0;
@@ -528,7 +528,7 @@
} struct_f4;
TEST(struct_f4)
// CHECK-LABEL: define swiftcc { float, float, float, float } @return_struct_f4()
-// CHECK-LABEL: define swiftcc void @take_struct_f4(float, float, float, float)
+// CHECK-LABEL: define swiftcc void @take_struct_f4(float %0, float %1, float %2, float %3)
typedef struct {
@@ -536,7 +536,7 @@
} struct_d1;
TEST(struct_d1)
// CHECK-LABEL: define swiftcc double @return_struct_d1()
-// CHECK-LABEL: define swiftcc void @take_struct_d1(double)
+// CHECK-LABEL: define swiftcc void @take_struct_d1(double %0)
typedef struct {
double d0;
@@ -544,7 +544,7 @@
} struct_d2;
TEST(struct_d2)
// CHECK-LABEL: define swiftcc { double, double } @return_struct_d2()
-// CHECK-LABEL: define swiftcc void @take_struct_d2(double, double)
+// CHECK-LABEL: define swiftcc void @take_struct_d2(double %0, double %1)
typedef struct {
double d0;
@@ -553,7 +553,7 @@
} struct_d3;
TEST(struct_d3)
// CHECK-LABEL: define swiftcc { double, double, double } @return_struct_d3()
-// CHECK-LABEL: define swiftcc void @take_struct_d3(double, double, double)
+// CHECK-LABEL: define swiftcc void @take_struct_d3(double %0, double %1, double %2)
typedef struct {
double d0;
@@ -563,7 +563,7 @@
} struct_d4;
TEST(struct_d4)
// CHECK-LABEL: define swiftcc { double, double, double, double } @return_struct_d4()
-// CHECK-LABEL: define swiftcc void @take_struct_d4(double, double, double, double)
+// CHECK-LABEL: define swiftcc void @take_struct_d4(double %0, double %1, double %2, double %3)
typedef struct {
double d0;
@@ -581,7 +581,7 @@
} struct_c1;
TEST(struct_c1)
// CHECK-LABEL: define swiftcc i8 @return_struct_c1()
-// CHECK-LABEL: define swiftcc void @take_struct_c1(i8)
+// CHECK-LABEL: define swiftcc void @take_struct_c1(i8 %0)
typedef struct {
char c0;
@@ -589,7 +589,7 @@
} struct_c2;
TEST(struct_c2)
// CHECK-LABEL: define swiftcc i16 @return_struct_c2()
-// CHECK-LABEL: define swiftcc void @take_struct_c2(i16)
+// CHECK-LABEL: define swiftcc void @take_struct_c2(i16 %0)
//
typedef struct {
@@ -599,7 +599,7 @@
} struct_c3;
TEST(struct_c3)
// CHECK-LABEL: define swiftcc i32 @return_struct_c3()
-// CHECK-LABEL: define swiftcc void @take_struct_c3(i32)
+// CHECK-LABEL: define swiftcc void @take_struct_c3(i32 %0)
typedef struct {
char c0;
@@ -609,7 +609,7 @@
} struct_c4;
TEST(struct_c4)
// CHECK-LABEL: define swiftcc i32 @return_struct_c4()
-// CHECK-LABEL: define swiftcc void @take_struct_c4(i32)
+// CHECK-LABEL: define swiftcc void @take_struct_c4(i32 %0)
typedef struct {
char c0;
@@ -620,14 +620,14 @@
} struct_c5;
TEST(struct_c5)
// CHECK-LABEL: define swiftcc { i32, i8 } @return_struct_c5()
-// CHECK-LABEL: define swiftcc void @take_struct_c5(i32, i8)
+// CHECK-LABEL: define swiftcc void @take_struct_c5(i32 %0, i8 %1)
typedef struct {
short s0;
} struct_s1;
TEST(struct_s1)
// CHECK-LABEL: define swiftcc i16 @return_struct_s1()
-// CHECK-LABEL: define swiftcc void @take_struct_s1(i16)
+// CHECK-LABEL: define swiftcc void @take_struct_s1(i16 %0)
typedef struct {
short s0;
@@ -635,7 +635,7 @@
} struct_s2;
TEST(struct_s2)
// CHECK-LABEL: define swiftcc i32 @return_struct_s2()
-// CHECK-LABEL: define swiftcc void @take_struct_s2(i32)
+// CHECK-LABEL: define swiftcc void @take_struct_s2(i32 %0)
typedef struct {
short s0;
@@ -644,7 +644,7 @@
} struct_s3;
TEST(struct_s3)
// CHECK-LABEL: define swiftcc { i32, i16 } @return_struct_s3()
-// CHECK-LABEL: define swiftcc void @take_struct_s3(i32, i16)
+// CHECK-LABEL: define swiftcc void @take_struct_s3(i32 %0, i16 %1)
typedef struct {
short s0;
@@ -654,7 +654,7 @@
} struct_s4;
TEST(struct_s4)
// CHECK-LABEL: define swiftcc { i32, i32 } @return_struct_s4()
-// CHECK-LABEL: define swiftcc void @take_struct_s4(i32, i32)
+// CHECK-LABEL: define swiftcc void @take_struct_s4(i32 %0, i32 %1)
typedef struct {
short s0;
@@ -665,7 +665,7 @@
} struct_s5;
TEST(struct_s5)
// CHECK-LABEL: define swiftcc { i32, i32, i16 } @return_struct_s5()
-// CHECK-LABEL: define swiftcc void @take_struct_s5(i32, i32, i16)
+// CHECK-LABEL: define swiftcc void @take_struct_s5(i32 %0, i32 %1, i16 %2)
typedef struct {
@@ -673,7 +673,7 @@
} struct_i1;
TEST(struct_i1)
// CHECK-LABEL: define swiftcc i32 @return_struct_i1()
-// CHECK-LABEL: define swiftcc void @take_struct_i1(i32)
+// CHECK-LABEL: define swiftcc void @take_struct_i1(i32 %0)
typedef struct {
int i0;
@@ -681,7 +681,7 @@
} struct_i2;
TEST(struct_i2)
// CHECK-LABEL: define swiftcc { i32, i32 } @return_struct_i2()
-// CHECK-LABEL: define swiftcc void @take_struct_i2(i32, i32)
+// CHECK-LABEL: define swiftcc void @take_struct_i2(i32 %0, i32 %1)
typedef struct {
int i0;
@@ -690,7 +690,7 @@
} struct_i3;
TEST(struct_i3)
// CHECK-LABEL: define swiftcc { i32, i32, i32 } @return_struct_i3()
-// CHECK-LABEL: define swiftcc void @take_struct_i3(i32, i32, i32)
+// CHECK-LABEL: define swiftcc void @take_struct_i3(i32 %0, i32 %1, i32 %2)
typedef struct {
int i0;
@@ -700,14 +700,14 @@
} struct_i4;
TEST(struct_i4)
// CHECK-LABEL: define swiftcc { i32, i32, i32, i32 } @return_struct_i4()
-// CHECK-LABEL: define swiftcc void @take_struct_i4(i32, i32, i32, i32)
+// CHECK-LABEL: define swiftcc void @take_struct_i4(i32 %0, i32 %1, i32 %2, i32 %3)
typedef struct {
long long l0;
} struct_l1;
TEST(struct_l1)
// CHECK-LABEL: define swiftcc i64 @return_struct_l1()
-// CHECK-LABEL: define swiftcc void @take_struct_l1(i64)
+// CHECK-LABEL: define swiftcc void @take_struct_l1(i64 %0)
typedef struct {
long long l0;
@@ -715,7 +715,7 @@
} struct_l2;
TEST(struct_l2)
// CHECK-LABEL: define swiftcc { i64, i64 } @return_struct_l2()
-// CHECK-LABEL: define swiftcc void @take_struct_l2(i64, i64)
+// CHECK-LABEL: define swiftcc void @take_struct_l2(i64 %0, i64 %1)
typedef struct {
long long l0;
@@ -752,7 +752,7 @@
} struct_vc1;
TEST(struct_vc1)
// CHECK-LABEL: define swiftcc <16 x i8> @return_struct_vc1()
-// CHECK-LABEL: define swiftcc void @take_struct_vc1(<16 x i8>)
+// CHECK-LABEL: define swiftcc void @take_struct_vc1(<16 x i8> %0)
typedef struct {
char16 c0;
@@ -760,7 +760,7 @@
} struct_vc2;
TEST(struct_vc2)
// CHECK-LABEL: define swiftcc { <16 x i8>, <16 x i8> } @return_struct_vc2()
-// CHECK-LABEL: define swiftcc void @take_struct_vc2(<16 x i8>, <16 x i8>)
+// CHECK-LABEL: define swiftcc void @take_struct_vc2(<16 x i8> %0, <16 x i8> %1)
typedef struct {
char16 c0;
@@ -769,7 +769,7 @@
} struct_vc3;
TEST(struct_vc3)
// CHECK-LABEL: define swiftcc { <16 x i8>, <16 x i8>, <16 x i8> } @return_struct_vc3()
-// CHECK-LABEL: define swiftcc void @take_struct_vc3(<16 x i8>, <16 x i8>, <16 x i8>)
+// CHECK-LABEL: define swiftcc void @take_struct_vc3(<16 x i8> %0, <16 x i8> %1, <16 x i8> %2)
typedef struct {
char16 c0;
@@ -779,7 +779,7 @@
} struct_vc4;
TEST(struct_vc4)
// CHECK-LABEL: define swiftcc { <16 x i8>, <16 x i8>, <16 x i8>, <16 x i8> } @return_struct_vc4()
-// CHECK-LABEL: define swiftcc void @take_struct_vc4(<16 x i8>, <16 x i8>, <16 x i8>, <16 x i8>)
+// CHECK-LABEL: define swiftcc void @take_struct_vc4(<16 x i8> %0, <16 x i8> %1, <16 x i8> %2, <16 x i8> %3)
typedef struct {
char16 c0;
@@ -797,7 +797,7 @@
} struct_vs1;
TEST(struct_vs1)
// CHECK-LABEL: define swiftcc <8 x i16> @return_struct_vs1()
-// CHECK-LABEL: define swiftcc void @take_struct_vs1(<8 x i16>)
+// CHECK-LABEL: define swiftcc void @take_struct_vs1(<8 x i16> %0)
typedef struct {
short8 c0;
@@ -805,7 +805,7 @@
} struct_vs2;
TEST(struct_vs2)
// CHECK-LABEL: define swiftcc { <8 x i16>, <8 x i16> } @return_struct_vs2()
-// CHECK-LABEL: define swiftcc void @take_struct_vs2(<8 x i16>, <8 x i16>)
+// CHECK-LABEL: define swiftcc void @take_struct_vs2(<8 x i16> %0, <8 x i16> %1)
typedef struct {
short8 c0;
@@ -814,7 +814,7 @@
} struct_vs3;
TEST(struct_vs3)
// CHECK-LABEL: define swiftcc { <8 x i16>, <8 x i16>, <8 x i16> } @return_struct_vs3()
-// CHECK-LABEL: define swiftcc void @take_struct_vs3(<8 x i16>, <8 x i16>, <8 x i16>)
+// CHECK-LABEL: define swiftcc void @take_struct_vs3(<8 x i16> %0, <8 x i16> %1, <8 x i16> %2)
typedef struct {
short8 c0;
@@ -824,7 +824,7 @@
} struct_vs4;
TEST(struct_vs4)
// CHECK-LABEL: define swiftcc { <8 x i16>, <8 x i16>, <8 x i16>, <8 x i16> } @return_struct_vs4()
-// CHECK-LABEL: define swiftcc void @take_struct_vs4(<8 x i16>, <8 x i16>, <8 x i16>, <8 x i16>)
+// CHECK-LABEL: define swiftcc void @take_struct_vs4(<8 x i16> %0, <8 x i16> %1, <8 x i16> %2, <8 x i16> %3)
typedef struct {
short8 c0;
@@ -842,7 +842,7 @@
} struct_vi1;
TEST(struct_vi1)
// CHECK-LABEL: define swiftcc <4 x i32> @return_struct_vi1()
-// CHECK-LABEL: define swiftcc void @take_struct_vi1(<4 x i32>)
+// CHECK-LABEL: define swiftcc void @take_struct_vi1(<4 x i32> %0)
typedef struct {
int4 c0;
@@ -850,7 +850,7 @@
} struct_vi2;
TEST(struct_vi2)
// CHECK-LABEL: define swiftcc { <4 x i32>, <4 x i32> } @return_struct_vi2()
-// CHECK-LABEL: define swiftcc void @take_struct_vi2(<4 x i32>, <4 x i32>)
+// CHECK-LABEL: define swiftcc void @take_struct_vi2(<4 x i32> %0, <4 x i32> %1)
typedef struct {
int4 c0;
@@ -859,7 +859,7 @@
} struct_vi3;
TEST(struct_vi3)
// CHECK-LABEL: define swiftcc { <4 x i32>, <4 x i32>, <4 x i32> } @return_struct_vi3()
-// CHECK-LABEL: define swiftcc void @take_struct_vi3(<4 x i32>, <4 x i32>, <4 x i32>)
+// CHECK-LABEL: define swiftcc void @take_struct_vi3(<4 x i32> %0, <4 x i32> %1, <4 x i32> %2)
typedef struct {
int4 c0;
@@ -869,7 +869,7 @@
} struct_vi4;
TEST(struct_vi4)
// CHECK-LABEL: define swiftcc { <4 x i32>, <4 x i32>, <4 x i32>, <4 x i32> } @return_struct_vi4()
-// CHECK-LABEL: define swiftcc void @take_struct_vi4(<4 x i32>, <4 x i32>, <4 x i32>, <4 x i32>)
+// CHECK-LABEL: define swiftcc void @take_struct_vi4(<4 x i32> %0, <4 x i32> %1, <4 x i32> %2, <4 x i32> %3)
typedef struct {
int4 c0;
@@ -887,7 +887,7 @@
} struct_vl1;
TEST(struct_vl1)
// CHECK-LABEL: define swiftcc <2 x i64> @return_struct_vl1()
-// CHECK-LABEL: define swiftcc void @take_struct_vl1(<2 x i64>)
+// CHECK-LABEL: define swiftcc void @take_struct_vl1(<2 x i64> %0)
typedef struct {
long2 c0;
@@ -897,7 +897,7 @@
} struct_vl4;
TEST(struct_vl4)
// CHECK-LABEL: define swiftcc { <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64> } @return_struct_vl4()
-// CHECK-LABEL: define swiftcc void @take_struct_vl4(<2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>)
+// CHECK-LABEL: define swiftcc void @take_struct_vl4(<2 x i64> %0, <2 x i64> %1, <2 x i64> %2, <2 x i64> %3)
typedef struct {
long2 c0;
@@ -915,7 +915,7 @@
} struct_vd1;
TEST(struct_vd1)
// CHECK-LABEL: define swiftcc <2 x double> @return_struct_vd1()
-// CHECK-LABEL: define swiftcc void @take_struct_vd1(<2 x double>)
+// CHECK-LABEL: define swiftcc void @take_struct_vd1(<2 x double> %0)
typedef struct {
double2 c0;
@@ -925,7 +925,7 @@
} struct_vd4;
TEST(struct_vd4)
// CHECK-LABEL: define swiftcc { <2 x double>, <2 x double>, <2 x double>, <2 x double> } @return_struct_vd4()
-// CHECK-LABEL: define swiftcc void @take_struct_vd4(<2 x double>, <2 x double>, <2 x double>, <2 x double>)
+// CHECK-LABEL: define swiftcc void @take_struct_vd4(<2 x double> %0, <2 x double> %1, <2 x double> %2, <2 x double> %3)
typedef struct {
double2 c0;
@@ -943,7 +943,7 @@
} struct_vd41;
TEST(struct_vd41)
// CHECK-LABEL: define swiftcc { <2 x double>, <2 x double> } @return_struct_vd41()
-// CHECK-LABEL: define swiftcc void @take_struct_vd41(<2 x double>, <2 x double>)
+// CHECK-LABEL: define swiftcc void @take_struct_vd41(<2 x double> %0, <2 x double> %1)
typedef struct {
double4 c0;
@@ -951,7 +951,7 @@
} struct_vd42;
TEST(struct_vd42)
// CHECK-LABEL: define swiftcc { <2 x double>, <2 x double>, <2 x double>, <2 x double> } @return_struct_vd42()
-// CHECK-LABEL: define swiftcc void @take_struct_vd42(<2 x double>, <2 x double>, <2 x double>, <2 x double>)
+// CHECK-LABEL: define swiftcc void @take_struct_vd42(<2 x double> %0, <2 x double> %1, <2 x double> %2, <2 x double> %3)
typedef struct {
double4 c0;
@@ -967,7 +967,7 @@
} struct_vf1;
TEST(struct_vf1)
// CHECK-LABEL: define swiftcc <4 x float> @return_struct_vf1()
-// CHECK-LABEL: define swiftcc void @take_struct_vf1(<4 x float>)
+// CHECK-LABEL: define swiftcc void @take_struct_vf1(<4 x float> %0)
typedef struct {
float4 c0;
@@ -975,7 +975,7 @@
} struct_vf2;
TEST(struct_vf2)
// CHECK-LABEL: define swiftcc { <4 x float>, <4 x float> } @return_struct_vf2()
-// CHECK-LABEL: define swiftcc void @take_struct_vf2(<4 x float>, <4 x float>)
+// CHECK-LABEL: define swiftcc void @take_struct_vf2(<4 x float> %0, <4 x float> %1)
typedef struct {
float4 c0;
@@ -985,7 +985,7 @@
} struct_vf4;
TEST(struct_vf4)
// CHECK-LABEL: define swiftcc { <4 x float>, <4 x float>, <4 x float>, <4 x float> } @return_struct_vf4()
-// CHECK-LABEL: define swiftcc void @take_struct_vf4(<4 x float>, <4 x float>, <4 x float>, <4 x float>)
+// CHECK-LABEL: define swiftcc void @take_struct_vf4(<4 x float> %0, <4 x float> %1, <4 x float> %2, <4 x float> %3)
typedef struct {
float4 c0;
@@ -1003,11 +1003,11 @@
} struct_vf81;
TEST(struct_vf81)
// CHECK-LABEL: define swiftcc { <4 x float>, <4 x float> } @return_struct_vf81()
-// CHECK-LABEL: define swiftcc void @take_struct_vf81(<4 x float>, <4 x float>)
+// CHECK-LABEL: define swiftcc void @take_struct_vf81(<4 x float> %0, <4 x float> %1)
typedef struct {
float3 f3;
} struct_v1f3;
TEST(struct_v1f3)
// CHECK-LABEL: define swiftcc { <2 x float>, float } @return_struct_v1f3()
-// CHECK-LABEL: define swiftcc void @take_struct_v1f3(<2 x float>, float)
+// CHECK-LABEL: define swiftcc void @take_struct_v1f3(<2 x float> %0, float %1)
diff --git a/src/llvm-project/clang/test/CodeGen/arm-target-features.c b/src/llvm-project/clang/test/CodeGen/arm-target-features.c
index 695bc43..11fe4e5 100644
--- a/src/llvm-project/clang/test/CodeGen/arm-target-features.c
+++ b/src/llvm-project/clang/test/CodeGen/arm-target-features.c
@@ -1,23 +1,23 @@
// REQUIRES: arm-registered-target
// RUN: %clang_cc1 -triple thumbv7-linux-gnueabihf -target-cpu cortex-a8 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP3
-// CHECK-VFP3: "target-features"="+armv7-a,+d32,+dsp,+fp64,+fpregs,+neon,+thumb-mode,+vfp2,+vfp2d16,+vfp2d16sp,+vfp2sp,+vfp3,+vfp3d16,+vfp3d16sp,+vfp3sp"
+// CHECK-VFP3: "target-features"="+armv7-a,+d32,+dsp,+fp64,+neon,+thumb-mode,+vfp2,+vfp2sp,+vfp3,+vfp3d16,+vfp3d16sp,+vfp3sp"
// RUN: %clang_cc1 -triple thumbv7-linux-gnueabihf -target-cpu cortex-a5 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP4
-// CHECK-VFP4: "target-features"="+armv7-a,+d32,+dsp,+fp16,+fp64,+fpregs,+neon,+thumb-mode,+vfp2,+vfp2d16,+vfp2d16sp,+vfp2sp,+vfp3,+vfp3d16,+vfp3d16sp,+vfp3sp,+vfp4,+vfp4d16,+vfp4d16sp,+vfp4sp"
+// CHECK-VFP4: "target-features"="+armv7-a,+d32,+dsp,+fp16,+fp64,+neon,+thumb-mode,+vfp2,+vfp2sp,+vfp3,+vfp3d16,+vfp3d16sp,+vfp3sp,+vfp4,+vfp4d16,+vfp4d16sp,+vfp4sp"
// RUN: %clang_cc1 -triple thumbv7-linux-gnueabihf -target-cpu cortex-a7 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP4-DIV
// RUN: %clang_cc1 -triple thumbv7-linux-gnueabi -target-cpu cortex-a12 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP4-DIV
// RUN: %clang_cc1 -triple thumbv7s-linux-gnueabi -target-cpu swift -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP4-DIV-2
// RUN: %clang_cc1 -triple thumbv7-linux-gnueabihf -target-cpu krait -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP4-DIV
-// CHECK-VFP4-DIV: "target-features"="+armv7-a,+d32,+dsp,+fp16,+fp64,+fpregs,+hwdiv,+hwdiv-arm,+neon,+thumb-mode,+vfp2,+vfp2d16,+vfp2d16sp,+vfp2sp,+vfp3,+vfp3d16,+vfp3d16sp,+vfp3sp,+vfp4,+vfp4d16,+vfp4d16sp,+vfp4sp"
-// CHECK-VFP4-DIV-2: "target-features"="+armv7s,+d32,+dsp,+fp16,+fp64,+fpregs,+hwdiv,+hwdiv-arm,+neon,+thumb-mode,+vfp2,+vfp2d16,+vfp2d16sp,+vfp2sp,+vfp3,+vfp3d16,+vfp3d16sp,+vfp3sp,+vfp4,+vfp4d16,+vfp4d16sp,+vfp4sp"
+// CHECK-VFP4-DIV: "target-features"="+armv7-a,+d32,+dsp,+fp16,+fp64,+hwdiv,+hwdiv-arm,+neon,+thumb-mode,+vfp2,+vfp2sp,+vfp3,+vfp3d16,+vfp3d16sp,+vfp3sp,+vfp4,+vfp4d16,+vfp4d16sp,+vfp4sp"
+// CHECK-VFP4-DIV-2: "target-features"="+armv7s,+d32,+dsp,+fp16,+fp64,+hwdiv,+hwdiv-arm,+neon,+thumb-mode,+vfp2,+vfp2sp,+vfp3,+vfp3d16,+vfp3d16sp,+vfp3sp,+vfp4,+vfp4d16,+vfp4d16sp,+vfp4sp"
// RUN: %clang_cc1 -triple armv7-linux-gnueabihf -target-cpu cortex-a15 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP4-DIV-ARM
// RUN: %clang_cc1 -triple armv7-linux-gnueabihf -target-cpu cortex-a17 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP4-DIV-ARM
-// CHECK-VFP4-DIV-ARM: "target-features"="+armv7-a,+d32,+dsp,+fp16,+fp64,+fpregs,+hwdiv,+hwdiv-arm,+neon,+vfp2,+vfp2d16,+vfp2d16sp,+vfp2sp,+vfp3,+vfp3d16,+vfp3d16sp,+vfp3sp,+vfp4,+vfp4d16,+vfp4d16sp,+vfp4sp,-thumb-mode"
+// CHECK-VFP4-DIV-ARM: "target-features"="+armv7-a,+d32,+dsp,+fp16,+fp64,+hwdiv,+hwdiv-arm,+neon,+vfp2,+vfp2sp,+vfp3,+vfp3d16,+vfp3d16sp,+vfp3sp,+vfp4,+vfp4d16,+vfp4d16sp,+vfp4sp,-thumb-mode"
// RUN: %clang_cc1 -triple thumbv7s-apple-ios7.0 -target-cpu cyclone -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-BASIC-V8
// RUN: %clang_cc1 -triple thumbv8-linux-gnueabihf -target-cpu cortex-a32 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-BASIC-V8
@@ -25,37 +25,35 @@
// RUN: %clang_cc1 -triple thumbv8-linux-gnueabihf -target-cpu cortex-a57 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-BASIC-V8
// RUN: %clang_cc1 -triple thumbv8-linux-gnueabihf -target-cpu cortex-a72 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-BASIC-V8
// RUN: %clang_cc1 -triple thumbv8-linux-gnueabihf -target-cpu cortex-a73 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-BASIC-V8
-// RUN: %clang_cc1 -triple thumbv8-linux-gnueabihf -target-cpu exynos-m1 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-BASIC-V8
-// RUN: %clang_cc1 -triple thumbv8-linux-gnueabihf -target-cpu exynos-m2 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-BASIC-V8
// RUN: %clang_cc1 -triple thumbv8-linux-gnueabihf -target-cpu exynos-m3 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-BASIC-V8
-// CHECK-BASIC-V8: "target-features"="+armv8-a,+crc,+crypto,+d32,+dsp,+fp-armv8,+fp-armv8d16,+fp-armv8d16sp,+fp-armv8sp,+fp16,+fp64,+fpregs,+hwdiv,+hwdiv-arm,+neon,+thumb-mode,+vfp2,+vfp2d16,+vfp2d16sp,+vfp2sp,+vfp3,+vfp3d16,+vfp3d16sp,+vfp3sp,+vfp4,+vfp4d16,+vfp4d16sp,+vfp4sp"
+// CHECK-BASIC-V8: "target-features"="+armv8-a,+crc,+crypto,+d32,+dsp,+fp-armv8,+fp-armv8d16,+fp-armv8d16sp,+fp-armv8sp,+fp16,+fp64,+hwdiv,+hwdiv-arm,+neon,+thumb-mode,+vfp2,+vfp2sp,+vfp3,+vfp3d16,+vfp3d16sp,+vfp3sp,+vfp4,+vfp4d16,+vfp4d16sp,+vfp4sp"
// RUN: %clang_cc1 -triple thumbv8-linux-gnueabihf -target-cpu exynos-m4 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-BASIC-V82
// RUN: %clang_cc1 -triple thumbv8-linux-gnueabihf -target-cpu exynos-m5 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-BASIC-V82
-// CHECK-BASIC-V82: "target-features"="+armv8.2-a,+crc,+crypto,+d32,+dotprod,+dsp,+fp-armv8,+fp-armv8d16,+fp-armv8d16sp,+fp-armv8sp,+fp16,+fp64,+fpregs,+fullfp16,+hwdiv,+hwdiv-arm,+neon,+ras,+thumb-mode,+vfp2,+vfp2d16,+vfp2d16sp,+vfp2sp,+vfp3,+vfp3d16,+vfp3d16sp,+vfp3sp,+vfp4,+vfp4d16,+vfp4d16sp,+vfp4sp"
+// CHECK-BASIC-V82: "target-features"="+armv8.2-a,+crc,+crypto,+d32,+dotprod,+dsp,+fp-armv8,+fp-armv8d16,+fp-armv8d16sp,+fp-armv8sp,+fp16,+fp64,+fullfp16,+hwdiv,+hwdiv-arm,+neon,+ras,+thumb-mode,+vfp2,+vfp2sp,+vfp3,+vfp3d16,+vfp3d16sp,+vfp3sp,+vfp4,+vfp4d16,+vfp4d16sp,+vfp4sp"
// RUN: %clang_cc1 -triple armv8-linux-gnueabi -target-cpu cortex-a53 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-BASIC-V8-ARM
-// CHECK-BASIC-V8-ARM: "target-features"="+armv8-a,+crc,+crypto,+d32,+dsp,+fp-armv8,+fp-armv8d16,+fp-armv8d16sp,+fp-armv8sp,+fp16,+fp64,+fpregs,+hwdiv,+hwdiv-arm,+neon,+vfp2,+vfp2d16,+vfp2d16sp,+vfp2sp,+vfp3,+vfp3d16,+vfp3d16sp,+vfp3sp,+vfp4,+vfp4d16,+vfp4d16sp,+vfp4sp,-thumb-mode"
+// CHECK-BASIC-V8-ARM: "target-features"="+armv8-a,+crc,+crypto,+d32,+dsp,+fp-armv8,+fp-armv8d16,+fp-armv8d16sp,+fp-armv8sp,+fp16,+fp64,+hwdiv,+hwdiv-arm,+neon,+vfp2,+vfp2sp,+vfp3,+vfp3d16,+vfp3d16sp,+vfp3sp,+vfp4,+vfp4d16,+vfp4d16sp,+vfp4sp,-thumb-mode"
// RUN: %clang_cc1 -triple thumbv7-linux-gnueabi -target-cpu cortex-r5 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP3-D16-DIV
-// CHECK-VFP3-D16-DIV: "target-features"="+armv7-r,+dsp,+fp64,+fpregs,+hwdiv,+hwdiv-arm,+thumb-mode,+vfp2,+vfp2d16,+vfp2d16sp,+vfp2sp,+vfp3d16,+vfp3d16sp"
+// CHECK-VFP3-D16-DIV: "target-features"="+armv7-r,+dsp,+fp64,+hwdiv,+hwdiv-arm,+thumb-mode,+vfp2,+vfp2sp,+vfp3d16,+vfp3d16sp"
// RUN: %clang_cc1 -triple armv7-linux-gnueabi -target-cpu cortex-r4f -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP3-D16-THUMB-DIV
-// CHECK-VFP3-D16-THUMB-DIV: "target-features"="+armv7-r,+dsp,+fp64,+fpregs,+hwdiv,+vfp2,+vfp2d16,+vfp2d16sp,+vfp2sp,+vfp3d16,+vfp3d16sp,-thumb-mode"
+// CHECK-VFP3-D16-THUMB-DIV: "target-features"="+armv7-r,+dsp,+fp64,+hwdiv,+vfp2,+vfp2sp,+vfp3d16,+vfp3d16sp,-thumb-mode"
// RUN: %clang_cc1 -triple thumbv7-linux-gnueabi -target-cpu cortex-r7 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP3-D16-FP16-DIV
// RUN: %clang_cc1 -triple thumbv7-linux-gnueabi -target-cpu cortex-r8 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP3-D16-FP16-DIV
-// CHECK-VFP3-D16-FP16-DIV: "target-features"="+armv7-r,+dsp,+fp16,+fp64,+fpregs,+hwdiv,+hwdiv-arm,+thumb-mode,+vfp2,+vfp2d16,+vfp2d16sp,+vfp2sp,+vfp3d16,+vfp3d16sp"
+// CHECK-VFP3-D16-FP16-DIV: "target-features"="+armv7-r,+dsp,+fp16,+fp64,+hwdiv,+hwdiv-arm,+thumb-mode,+vfp2,+vfp2sp,+vfp3d16,+vfp3d16sp"
// RUN: %clang_cc1 -triple thumbv7-linux-gnueabi -target-cpu cortex-m4 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP4-D16-SP-THUMB-DIV
-// CHECK-VFP4-D16-SP-THUMB-DIV: "target-features"="+armv7e-m,+dsp,+fp16,+fpregs,+hwdiv,+thumb-mode,+vfp2d16sp,+vfp2sp,+vfp3d16sp,+vfp4d16sp"
+// CHECK-VFP4-D16-SP-THUMB-DIV: "target-features"="+armv7e-m,+dsp,+fp16,+hwdiv,+thumb-mode,+vfp2sp,+vfp3d16sp,+vfp4d16sp"
// RUN: %clang_cc1 -triple thumbv7-linux-gnueabi -target-cpu cortex-m7 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP5-D16-THUMB-DIV
-// CHECK-VFP5-D16-THUMB-DIV: "target-features"="+armv7e-m,+dsp,+fp-armv8d16,+fp-armv8d16sp,+fp16,+fp64,+fpregs,+hwdiv,+thumb-mode,+vfp2,+vfp2d16,+vfp2d16sp,+vfp2sp,+vfp3d16,+vfp3d16sp,+vfp4d16,+vfp4d16sp"
+// CHECK-VFP5-D16-THUMB-DIV: "target-features"="+armv7e-m,+dsp,+fp-armv8d16,+fp-armv8d16sp,+fp16,+fp64,+hwdiv,+thumb-mode,+vfp2,+vfp2sp,+vfp3d16,+vfp3d16sp,+vfp4d16,+vfp4d16sp"
// RUN: %clang_cc1 -triple armv7-linux-gnueabi -target-cpu cortex-r4 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-THUMB-DIV
@@ -107,6 +105,6 @@
// CHECK-ARMV8M-M23-LINUX: "target-features"="+armv8-m.base,+hwdiv,+thumb-mode"
// RUN: %clang_cc1 -triple thumb-linux-gnueabi -target-cpu cortex-m33 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-ARMV8M-MAIN-LINUX
-// CHECK-ARMV8M-MAIN-LINUX: "target-features"="+armv8-m.main,+dsp,+fp-armv8d16sp,+fp16,+fpregs,+hwdiv,+thumb-mode,+vfp2d16sp,+vfp2sp,+vfp3d16sp,+vfp4d16sp"
+// CHECK-ARMV8M-MAIN-LINUX: "target-features"="+armv8-m.main,+dsp,+fp-armv8d16sp,+fp16,+hwdiv,+thumb-mode,+vfp2sp,+vfp3d16sp,+vfp4d16sp"
void foo() {}
diff --git a/src/llvm-project/clang/test/CodeGen/arm-v8.1a-neon-intrinsics.c b/src/llvm-project/clang/test/CodeGen/arm-v8.1a-neon-intrinsics.c
index 6f5867b..5462c17a 100644
--- a/src/llvm-project/clang/test/CodeGen/arm-v8.1a-neon-intrinsics.c
+++ b/src/llvm-project/clang/test/CodeGen/arm-v8.1a-neon-intrinsics.c
@@ -13,7 +13,7 @@
// CHECK-LABEL: test_vqrdmlah_s16
int16x4_t test_vqrdmlah_s16(int16x4_t a, int16x4_t b, int16x4_t c) {
// CHECK-ARM: call <4 x i16> @llvm.arm.neon.vqrdmulh.v4i16(<4 x i16> {{%.*}}, <4 x i16> {{%.*}})
-// CHECK-ARM: call <4 x i16> @llvm.arm.neon.vqadds.v4i16(<4 x i16> {{%.*}}, <4 x i16> {{%.*}})
+// CHECK-ARM: call <4 x i16> @llvm.sadd.sat.v4i16(<4 x i16> {{%.*}}, <4 x i16> {{%.*}})
// CHECK-AARCH64: call <4 x i16> @llvm.aarch64.neon.sqrdmulh.v4i16(<4 x i16> {{%.*}}, <4 x i16> {{%.*}})
// CHECK-AARCH64: call <4 x i16> @llvm.aarch64.neon.sqadd.v4i16(<4 x i16> {{%.*}}, <4 x i16> {{%.*}})
@@ -23,7 +23,7 @@
// CHECK-LABEL: test_vqrdmlah_s32
int32x2_t test_vqrdmlah_s32(int32x2_t a, int32x2_t b, int32x2_t c) {
// CHECK-ARM: call <2 x i32> @llvm.arm.neon.vqrdmulh.v2i32(<2 x i32> {{%.*}}, <2 x i32> {{%.*}})
-// CHECK-ARM: call <2 x i32> @llvm.arm.neon.vqadds.v2i32(<2 x i32> {{%.*}}, <2 x i32> {{%.*}})
+// CHECK-ARM: call <2 x i32> @llvm.sadd.sat.v2i32(<2 x i32> {{%.*}}, <2 x i32> {{%.*}})
// CHECK-AARCH64: call <2 x i32> @llvm.aarch64.neon.sqrdmulh.v2i32(<2 x i32> {{%.*}}, <2 x i32> {{%.*}})
// CHECK-AARCH64: call <2 x i32> @llvm.aarch64.neon.sqadd.v2i32(<2 x i32> {{%.*}}, <2 x i32> {{%.*}})
@@ -33,7 +33,7 @@
// CHECK-LABEL: test_vqrdmlahq_s16
int16x8_t test_vqrdmlahq_s16(int16x8_t a, int16x8_t b, int16x8_t c) {
// CHECK-ARM: call <8 x i16> @llvm.arm.neon.vqrdmulh.v8i16(<8 x i16> {{%.*}}, <8 x i16> {{%.*}})
-// CHECK-ARM: call <8 x i16> @llvm.arm.neon.vqadds.v8i16(<8 x i16> {{%.*}}, <8 x i16> {{%.*}})
+// CHECK-ARM: call <8 x i16> @llvm.sadd.sat.v8i16(<8 x i16> {{%.*}}, <8 x i16> {{%.*}})
// CHECK-AARCH64: call <8 x i16> @llvm.aarch64.neon.sqrdmulh.v8i16(<8 x i16> {{%.*}}, <8 x i16> {{%.*}})
// CHECK-AARCH64: call <8 x i16> @llvm.aarch64.neon.sqadd.v8i16(<8 x i16> {{%.*}}, <8 x i16> {{%.*}})
@@ -43,7 +43,7 @@
// CHECK-LABEL: test_vqrdmlahq_s32
int32x4_t test_vqrdmlahq_s32(int32x4_t a, int32x4_t b, int32x4_t c) {
// CHECK-ARM: call <4 x i32> @llvm.arm.neon.vqrdmulh.v4i32(<4 x i32> {{%.*}}, <4 x i32> {{%.*}})
-// CHECK-ARM: call <4 x i32> @llvm.arm.neon.vqadds.v4i32(<4 x i32> {{%.*}}, <4 x i32> {{%.*}})
+// CHECK-ARM: call <4 x i32> @llvm.sadd.sat.v4i32(<4 x i32> {{%.*}}, <4 x i32> {{%.*}})
// CHECK-AARCH64: call <4 x i32> @llvm.aarch64.neon.sqrdmulh.v4i32(<4 x i32> {{%.*}}, <4 x i32> {{%.*}})
// CHECK-AARCH64: call <4 x i32> @llvm.aarch64.neon.sqadd.v4i32(<4 x i32> {{%.*}}, <4 x i32> {{%.*}})
@@ -54,7 +54,7 @@
int16x4_t test_vqrdmlah_lane_s16(int16x4_t a, int16x4_t b, int16x4_t c) {
// CHECK-ARM: shufflevector <4 x i16> {{%.*}}, <4 x i16> {{%.*}}, <4 x i32> <i32 3, i32 3, i32 3, i32 3>
// CHECK-ARM: call <4 x i16> @llvm.arm.neon.vqrdmulh.v4i16(<4 x i16> {{%.*}}, <4 x i16> {{%.*}})
-// CHECK-ARM: call <4 x i16> @llvm.arm.neon.vqadds.v4i16(<4 x i16> {{%.*}}, <4 x i16> {{%.*}})
+// CHECK-ARM: call <4 x i16> @llvm.sadd.sat.v4i16(<4 x i16> {{%.*}}, <4 x i16> {{%.*}})
// CHECK-AARCH64: shufflevector <4 x i16> {{%.*}}, <4 x i16> {{%.*}}, <4 x i32> <i32 3, i32 3, i32 3, i32 3>
// CHECK-AARCH64: call <4 x i16> @llvm.aarch64.neon.sqrdmulh.v4i16(<4 x i16> {{%.*}}, <4 x i16> {{%.*}})
@@ -66,7 +66,7 @@
int32x2_t test_vqrdmlah_lane_s32(int32x2_t a, int32x2_t b, int32x2_t c) {
// CHECK-ARM: shufflevector <2 x i32> {{%.*}}, <2 x i32> {{%.*}}, <2 x i32> <i32 1, i32 1>
// CHECK-ARM: call <2 x i32> @llvm.arm.neon.vqrdmulh.v2i32(<2 x i32> {{%.*}}, <2 x i32> {{%.*}})
-// CHECK-ARM: call <2 x i32> @llvm.arm.neon.vqadds.v2i32(<2 x i32> {{%.*}}, <2 x i32> {{%.*}})
+// CHECK-ARM: call <2 x i32> @llvm.sadd.sat.v2i32(<2 x i32> {{%.*}}, <2 x i32> {{%.*}})
// CHECK-AARCH64: shufflevector <2 x i32> {{%.*}}, <2 x i32> {{%.*}}, <2 x i32> <i32 1, i32 1>
// CHECK-AARCH64: call <2 x i32> @llvm.aarch64.neon.sqrdmulh.v2i32(<2 x i32> {{%.*}}, <2 x i32> {{%.*}})
@@ -78,7 +78,7 @@
int16x8_t test_vqrdmlahq_lane_s16(int16x8_t a, int16x8_t b, int16x4_t c) {
// CHECK-ARM: shufflevector <4 x i16> {{%.*}}, <4 x i16> {{%.*}}, <8 x i32> <i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3>
// CHECK-ARM: call <8 x i16> @llvm.arm.neon.vqrdmulh.v8i16(<8 x i16> {{%.*}}, <8 x i16> {{%.*}})
-// CHECK-ARM: call <8 x i16> @llvm.arm.neon.vqadds.v8i16(<8 x i16> {{%.*}}, <8 x i16> {{%.*}})
+// CHECK-ARM: call <8 x i16> @llvm.sadd.sat.v8i16(<8 x i16> {{%.*}}, <8 x i16> {{%.*}})
// CHECK-AARCH64: shufflevector <4 x i16> {{%.*}}, <4 x i16> {{%.*}}, <8 x i32> <i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3>
// CHECK-AARCH64: call <8 x i16> @llvm.aarch64.neon.sqrdmulh.v8i16(<8 x i16> {{%.*}}, <8 x i16> {{%.*}})
@@ -90,7 +90,7 @@
int32x4_t test_vqrdmlahq_lane_s32(int32x4_t a, int32x4_t b, int32x2_t c) {
// CHECK-ARM: shufflevector <2 x i32> {{%.*}}, <2 x i32> {{%.*}}, <4 x i32> <i32 1, i32 1, i32 1, i32 1>
// CHECK-ARM: call <4 x i32> @llvm.arm.neon.vqrdmulh.v4i32(<4 x i32> {{%.*}}, <4 x i32> {{%.*}})
-// CHECK-ARM: call <4 x i32> @llvm.arm.neon.vqadds.v4i32(<4 x i32> {{%.*}}, <4 x i32> {{%.*}})
+// CHECK-ARM: call <4 x i32> @llvm.sadd.sat.v4i32(<4 x i32> {{%.*}}, <4 x i32> {{%.*}})
// CHECK-AARCH64: shufflevector <2 x i32> {{%.*}}, <2 x i32> {{%.*}}, <4 x i32> <i32 1, i32 1, i32 1, i32 1>
// CHECK-AARCH64: call <4 x i32> @llvm.aarch64.neon.sqrdmulh.v4i32(<4 x i32> {{%.*}}, <4 x i32> {{%.*}})
@@ -101,7 +101,7 @@
// CHECK-LABEL: test_vqrdmlsh_s16
int16x4_t test_vqrdmlsh_s16(int16x4_t a, int16x4_t b, int16x4_t c) {
// CHECK-ARM: call <4 x i16> @llvm.arm.neon.vqrdmulh.v4i16(<4 x i16> {{%.*}}, <4 x i16> {{%.*}})
-// CHECK-ARM: call <4 x i16> @llvm.arm.neon.vqsubs.v4i16(<4 x i16> {{%.*}}, <4 x i16> {{%.*}})
+// CHECK-ARM: call <4 x i16> @llvm.ssub.sat.v4i16(<4 x i16> {{%.*}}, <4 x i16> {{%.*}})
// CHECK-AARCH64: call <4 x i16> @llvm.aarch64.neon.sqrdmulh.v4i16(<4 x i16> {{%.*}}, <4 x i16> {{%.*}})
// CHECK-AARCH64: call <4 x i16> @llvm.aarch64.neon.sqsub.v4i16(<4 x i16> {{%.*}}, <4 x i16> {{%.*}})
@@ -111,7 +111,7 @@
// CHECK-LABEL: test_vqrdmlsh_s32
int32x2_t test_vqrdmlsh_s32(int32x2_t a, int32x2_t b, int32x2_t c) {
// CHECK-ARM: call <2 x i32> @llvm.arm.neon.vqrdmulh.v2i32(<2 x i32> {{%.*}}, <2 x i32> {{%.*}})
-// CHECK-ARM: call <2 x i32> @llvm.arm.neon.vqsubs.v2i32(<2 x i32> {{%.*}}, <2 x i32> {{%.*}})
+// CHECK-ARM: call <2 x i32> @llvm.ssub.sat.v2i32(<2 x i32> {{%.*}}, <2 x i32> {{%.*}})
// CHECK-AARCH64: call <2 x i32> @llvm.aarch64.neon.sqrdmulh.v2i32(<2 x i32> {{%.*}}, <2 x i32> {{%.*}})
// CHECK-AARCH64: call <2 x i32> @llvm.aarch64.neon.sqsub.v2i32(<2 x i32> {{%.*}}, <2 x i32> {{%.*}})
@@ -121,7 +121,7 @@
// CHECK-LABEL: test_vqrdmlshq_s16
int16x8_t test_vqrdmlshq_s16(int16x8_t a, int16x8_t b, int16x8_t c) {
// CHECK-ARM: call <8 x i16> @llvm.arm.neon.vqrdmulh.v8i16(<8 x i16> {{%.*}}, <8 x i16> {{%.*}})
-// CHECK-ARM: call <8 x i16> @llvm.arm.neon.vqsubs.v8i16(<8 x i16> {{%.*}}, <8 x i16> {{%.*}})
+// CHECK-ARM: call <8 x i16> @llvm.ssub.sat.v8i16(<8 x i16> {{%.*}}, <8 x i16> {{%.*}})
// CHECK-AARCH64: call <8 x i16> @llvm.aarch64.neon.sqrdmulh.v8i16(<8 x i16> {{%.*}}, <8 x i16> {{%.*}})
// CHECK-AARCH64: call <8 x i16> @llvm.aarch64.neon.sqsub.v8i16(<8 x i16> {{%.*}}, <8 x i16> {{%.*}})
@@ -131,7 +131,7 @@
// CHECK-LABEL: test_vqrdmlshq_s32
int32x4_t test_vqrdmlshq_s32(int32x4_t a, int32x4_t b, int32x4_t c) {
// CHECK-ARM: call <4 x i32> @llvm.arm.neon.vqrdmulh.v4i32(<4 x i32> {{%.*}}, <4 x i32> {{%.*}})
-// CHECK-ARM: call <4 x i32> @llvm.arm.neon.vqsubs.v4i32(<4 x i32> {{%.*}}, <4 x i32> {{%.*}})
+// CHECK-ARM: call <4 x i32> @llvm.ssub.sat.v4i32(<4 x i32> {{%.*}}, <4 x i32> {{%.*}})
// CHECK-AARCH64: call <4 x i32> @llvm.aarch64.neon.sqrdmulh.v4i32(<4 x i32> {{%.*}}, <4 x i32> {{%.*}})
// CHECK-AARCH64: call <4 x i32> @llvm.aarch64.neon.sqsub.v4i32(<4 x i32> {{%.*}}, <4 x i32> {{%.*}})
@@ -142,7 +142,7 @@
int16x4_t test_vqrdmlsh_lane_s16(int16x4_t a, int16x4_t b, int16x4_t c) {
// CHECK-ARM: shufflevector <4 x i16> {{%.*}}, <4 x i16> {{%.*}}, <4 x i32> <i32 3, i32 3, i32 3, i32 3>
// CHECK-ARM: call <4 x i16> @llvm.arm.neon.vqrdmulh.v4i16(<4 x i16> {{%.*}}, <4 x i16> {{%.*}})
-// CHECK-ARM: call <4 x i16> @llvm.arm.neon.vqsubs.v4i16(<4 x i16> {{%.*}}, <4 x i16> {{%.*}})
+// CHECK-ARM: call <4 x i16> @llvm.ssub.sat.v4i16(<4 x i16> {{%.*}}, <4 x i16> {{%.*}})
// CHECK-AARCH64: shufflevector <4 x i16> {{%.*}}, <4 x i16> {{%.*}}, <4 x i32> <i32 3, i32 3, i32 3, i32 3>
// CHECK-AARCH64: call <4 x i16> @llvm.aarch64.neon.sqrdmulh.v4i16(<4 x i16> {{%.*}}, <4 x i16> {{%.*}})
@@ -154,7 +154,7 @@
int32x2_t test_vqrdmlsh_lane_s32(int32x2_t a, int32x2_t b, int32x2_t c) {
// CHECK-ARM: shufflevector <2 x i32> {{%.*}}, <2 x i32> {{%.*}}, <2 x i32> <i32 1, i32 1>
// CHECK-ARM: call <2 x i32> @llvm.arm.neon.vqrdmulh.v2i32(<2 x i32> {{%.*}}, <2 x i32> {{%.*}})
-// CHECK-ARM: call <2 x i32> @llvm.arm.neon.vqsubs.v2i32(<2 x i32> {{%.*}}, <2 x i32> {{%.*}})
+// CHECK-ARM: call <2 x i32> @llvm.ssub.sat.v2i32(<2 x i32> {{%.*}}, <2 x i32> {{%.*}})
// CHECK-AARCH64: shufflevector <2 x i32> {{%.*}}, <2 x i32> {{%.*}}, <2 x i32> <i32 1, i32 1>
// CHECK-AARCH64: call <2 x i32> @llvm.aarch64.neon.sqrdmulh.v2i32(<2 x i32> {{%.*}}, <2 x i32> {{%.*}})
@@ -166,7 +166,7 @@
int16x8_t test_vqrdmlshq_lane_s16(int16x8_t a, int16x8_t b, int16x4_t c) {
// CHECK-ARM: shufflevector <4 x i16> {{%.*}}, <4 x i16> {{%.*}}, <8 x i32> <i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3>
// CHECK-ARM: call <8 x i16> @llvm.arm.neon.vqrdmulh.v8i16(<8 x i16> {{%.*}}, <8 x i16> {{%.*}})
-// CHECK-ARM: call <8 x i16> @llvm.arm.neon.vqsubs.v8i16(<8 x i16> {{%.*}}, <8 x i16> {{%.*}})
+// CHECK-ARM: call <8 x i16> @llvm.ssub.sat.v8i16(<8 x i16> {{%.*}}, <8 x i16> {{%.*}})
// CHECK-AARCH64: shufflevector <4 x i16> {{%.*}}, <4 x i16> {{%.*}}, <8 x i32> <i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3>
// CHECK-AARCH64: call <8 x i16> @llvm.aarch64.neon.sqrdmulh.v8i16(<8 x i16> {{%.*}}, <8 x i16> {{%.*}})
@@ -178,7 +178,7 @@
int32x4_t test_vqrdmlshq_lane_s32(int32x4_t a, int32x4_t b, int32x2_t c) {
// CHECK-ARM: shufflevector <2 x i32> {{%.*}}, <2 x i32> {{%.*}}, <4 x i32> <i32 1, i32 1, i32 1, i32 1>
// CHECK-ARM: call <4 x i32> @llvm.arm.neon.vqrdmulh.v4i32(<4 x i32> {{%.*}}, <4 x i32> {{%.*}})
-// CHECK-ARM: call <4 x i32> @llvm.arm.neon.vqsubs.v4i32(<4 x i32> {{%.*}}, <4 x i32> {{%.*}})
+// CHECK-ARM: call <4 x i32> @llvm.ssub.sat.v4i32(<4 x i32> {{%.*}}, <4 x i32> {{%.*}})
// CHECK-AARCH64: shufflevector <2 x i32> {{%.*}}, <2 x i32> {{%.*}}, <4 x i32> <i32 1, i32 1, i32 1, i32 1>
// CHECK-AARCH64: call <4 x i32> @llvm.aarch64.neon.sqrdmulh.v4i32(<4 x i32> {{%.*}}, <4 x i32> {{%.*}})
diff --git a/src/llvm-project/clang/test/CodeGen/arm-v8.2a-neon-intrinsics.c b/src/llvm-project/clang/test/CodeGen/arm-v8.2a-neon-intrinsics.c
index 58d911d3..4b48ba0 100644
--- a/src/llvm-project/clang/test/CodeGen/arm-v8.2a-neon-intrinsics.c
+++ b/src/llvm-project/clang/test/CodeGen/arm-v8.2a-neon-intrinsics.c
@@ -264,14 +264,14 @@
// FIXME: Fix the zero constant when fp16 non-storage-only type becomes available.
// CHECK-LABEL: test_vneg_f16
-// CHECK: [[NEG:%.*]] = fsub <4 x half> <half 0xH8000, half 0xH8000, half 0xH8000, half 0xH8000>, %a
+// CHECK: [[NEG:%.*]] = fneg <4 x half> %a
// CHECK: ret <4 x half> [[NEG]]
float16x4_t test_vneg_f16(float16x4_t a) {
return vneg_f16(a);
}
// CHECK-LABEL: test_vnegq_f16
-// CHECK: [[NEG:%.*]] = fsub <8 x half> <half 0xH8000, half 0xH8000, half 0xH8000, half 0xH8000, half 0xH8000, half 0xH8000, half 0xH8000, half 0xH8000>, %a
+// CHECK: [[NEG:%.*]] = fneg <8 x half> %a
// CHECK: ret <8 x half> [[NEG]]
float16x8_t test_vnegq_f16(float16x8_t a) {
return vnegq_f16(a);
@@ -757,7 +757,7 @@
}
// CHECK-LABEL: test_vfms_f16
-// CHECK: [[SUB:%.*]] = fsub <4 x half> <half 0xH8000, half 0xH8000, half 0xH8000, half 0xH8000>, %b
+// CHECK: [[SUB:%.*]] = fneg <4 x half> %b
// CHECK: [[ADD:%.*]] = call <4 x half> @llvm.fma.v4f16(<4 x half> [[SUB]], <4 x half> %c, <4 x half> %a)
// CHECK: ret <4 x half> [[ADD]]
float16x4_t test_vfms_f16(float16x4_t a, float16x4_t b, float16x4_t c) {
@@ -765,7 +765,7 @@
}
// CHECK-LABEL: test_vfmsq_f16
-// CHECK: [[SUB:%.*]] = fsub <8 x half> <half 0xH8000, half 0xH8000, half 0xH8000, half 0xH8000, half 0xH8000, half 0xH8000, half 0xH8000, half 0xH8000>, %b
+// CHECK: [[SUB:%.*]] = fneg <8 x half> %b
// CHECK: [[ADD:%.*]] = call <8 x half> @llvm.fma.v8f16(<8 x half> [[SUB]], <8 x half> %c, <8 x half> %a)
// CHECK: ret <8 x half> [[ADD]]
float16x8_t test_vfmsq_f16(float16x8_t a, float16x8_t b, float16x8_t c) {
diff --git a/src/llvm-project/clang/test/CodeGen/arm-vfp16-arguments2.cpp b/src/llvm-project/clang/test/CodeGen/arm-vfp16-arguments2.cpp
index 4f75971..e436a5e 100644
--- a/src/llvm-project/clang/test/CodeGen/arm-vfp16-arguments2.cpp
+++ b/src/llvm-project/clang/test/CodeGen/arm-vfp16-arguments2.cpp
@@ -1,12 +1,12 @@
// RUN: %clang_cc1 -triple armv7a--none-eabi -target-abi aapcs \
-// RUN: -mfloat-abi soft -target-feature +neon -emit-llvm -o - -O1 %s \
+// RUN: -mfloat-abi soft -target-feature +neon -emit-llvm -o - -O2 %s \
// RUN: | FileCheck %s --check-prefix=CHECK-SOFT
// RUN: %clang_cc1 -triple armv7a--none-eabi -target-abi aapcs \
-// RUN: -mfloat-abi hard -target-feature +neon -emit-llvm -o - -O1 %s \
+// RUN: -mfloat-abi hard -target-feature +neon -emit-llvm -o - -O2 %s \
// RUN: | FileCheck %s --check-prefix=CHECK-HARD
// RUN: %clang_cc1 -triple armv7a--none-eabi -target-abi aapcs \
// RUN: -mfloat-abi hard -target-feature +neon -target-feature +fullfp16 \
-// RUN: -emit-llvm -o - -O1 %s \
+// RUN: -emit-llvm -o - -O2 %s \
// RUN: | FileCheck %s --check-prefix=CHECK-FULL
typedef float float32_t;
diff --git a/src/llvm-project/clang/test/CodeGen/arm64-arguments.c b/src/llvm-project/clang/test/CodeGen/arm64-arguments.c
index f90b8e3..5c8474c 100644
--- a/src/llvm-project/clang/test/CodeGen/arm64-arguments.c
+++ b/src/llvm-project/clang/test/CodeGen/arm64-arguments.c
@@ -181,9 +181,9 @@
// CHECK: define <4 x float> @f1_1(<4 x float> %{{.*}})
T_float32x4 f1_1(T_float32x4 a0) { return a0; }
// Vector with length bigger than 16-byte is illegal and is passed indirectly.
-// CHECK: define void @f1_2(<8 x float>* noalias sret %{{.*}}, <8 x float>*)
+// CHECK: define void @f1_2(<8 x float>* noalias sret %{{.*}}, <8 x float>* %0)
T_float32x8 f1_2(T_float32x8 a0) { return a0; }
-// CHECK: define void @f1_3(<16 x float>* noalias sret %{{.*}}, <16 x float>*)
+// CHECK: define void @f1_3(<16 x float>* noalias sret %{{.*}}, <16 x float>* %0)
T_float32x16 f1_3(T_float32x16 a0) { return a0; }
// Testing alignment with aggregates: HFA, aggregates with size <= 16 bytes and
diff --git a/src/llvm-project/clang/test/CodeGen/arm64-lanes.c b/src/llvm-project/clang/test/CodeGen/arm64-lanes.c
index fde5f84..3d765bf 100644
--- a/src/llvm-project/clang/test/CodeGen/arm64-lanes.c
+++ b/src/llvm-project/clang/test/CodeGen/arm64-lanes.c
@@ -9,7 +9,7 @@
// CHECK: extractelement <8 x i8> %src, i32 2
// CHECK-BE-LABEL: @test_vdupb_lane_s8
- // CHECK-BE: [[REV:%.*]] = shufflevector <8 x i8> {{.*}}, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
+ // CHECK-BE: [[REV:%.*]] = shufflevector <8 x i8> %src, <8 x i8> %src, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
// CHECK-BE: extractelement <8 x i8> [[REV]], i32 2
}
@@ -19,109 +19,83 @@
// CHECK: extractelement <8 x i8> %src, i32 2
// CHECK-BE-LABEL: @test_vdupb_lane_u8
- // CHECK-BE: [[REV:%.*]] = shufflevector <8 x i8> {{.*}}, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
+ // CHECK-BE: [[REV:%.*]] = shufflevector <8 x i8> %src, <8 x i8> %src, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
// CHECK-BE: extractelement <8 x i8> [[REV]], i32 2
}
int16_t test_vduph_lane_s16(int16x4_t src) {
return vduph_lane_s16(src, 2);
// CHECK-LABEL: @test_vduph_lane_s16
- // CHECK: [[TMP1:%.*]] = bitcast <4 x i16> %src to [[TYPE:.*]]
- // CHECK: [[TMP2:%.*]] = bitcast [[TYPE]] [[TMP1]] to <4 x i16>
- // CHECK: extractelement <4 x i16> [[TMP2]], i32 2
+ // CHECK: extractelement <4 x i16> %src, i32 2
// CHECK-BE-LABEL: @test_vduph_lane_s16
- // CHECK-BE: [[REV:%.*]] = shufflevector <4 x i16> {{.*}}, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
- // CHECK-BE: [[TMP1:%.*]] = bitcast <4 x i16> [[REV]] to [[TYPE:.*]]
- // CHECK-BE: [[TMP2:%.*]] = bitcast [[TYPE]] [[TMP1]] to <4 x i16>
- // CHECK-BE: extractelement <4 x i16> [[TMP2]], i32 2
+ // CHECK-BE: [[REV:%.*]] = shufflevector <4 x i16> %src, <4 x i16> %src, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
+ // CHECK-BE: extractelement <4 x i16> [[REV]], i32 2
}
uint16_t test_vduph_lane_u16(uint16x4_t src) {
return vduph_lane_u16(src, 2);
// CHECK-LABEL: @test_vduph_lane_u16
- // CHECK: [[TMP1:%.*]] = bitcast <4 x i16> %src to [[TYPE:.*]]
- // CHECK: [[TMP2:%.*]] = bitcast [[TYPE]] [[TMP1]] to <4 x i16>
- // CHECK: extractelement <4 x i16> [[TMP2]], i32 2
+ // CHECK: extractelement <4 x i16> %src, i32 2
// CHECK-BE-LABEL: @test_vduph_lane_u16
- // CHECK-BE: [[REV:%.*]] = shufflevector <4 x i16> {{.*}}, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
- // CHECK-BE: [[TMP1:%.*]] = bitcast <4 x i16> [[REV]] to [[TYPE:.*]]
- // CHECK-BE: [[TMP2:%.*]] = bitcast [[TYPE]] [[TMP1]] to <4 x i16>
- // CHECK-BE: extractelement <4 x i16> [[TMP2]], i32 2
+ // CHECK-BE: [[REV:%.*]] = shufflevector <4 x i16> %src, <4 x i16> %src, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
+ // CHECK-BE: extractelement <4 x i16> [[REV]], i32 2
}
int32_t test_vdups_lane_s32(int32x2_t src) {
return vdups_lane_s32(src, 0);
// CHECK-LABEL: @test_vdups_lane_s32
- // CHECK: [[TMP1:%.*]] = bitcast <2 x i32> %src to [[TYPE:.*]]
- // CHECK: [[TMP2:%.*]] = bitcast [[TYPE]] [[TMP1]] to <2 x i32>
- // CHECK: extractelement <2 x i32> [[TMP2]], i32 0
+ // CHECK: extractelement <2 x i32> %src, i32 0
// CHECK-BE-LABEL: @test_vdups_lane_s32
- // CHECK-BE: [[REV:%.*]] = shufflevector <2 x i32> {{.*}}, <2 x i32> <i32 1, i32 0>
- // CHECK-BE: [[TMP1:%.*]] = bitcast <2 x i32> [[REV]] to [[TYPE:.*]]
- // CHECK-BE: [[TMP2:%.*]] = bitcast [[TYPE]] [[TMP1]] to <2 x i32>
- // CHECK-BE: extractelement <2 x i32> [[TMP2]], i32 0
+ // CHECK-BE: [[REV:%.*]] = shufflevector <2 x i32> %src, <2 x i32> %src, <2 x i32> <i32 1, i32 0>
+ // CHECK-BE: extractelement <2 x i32> [[REV]], i32 0
}
uint32_t test_vdups_lane_u32(uint32x2_t src) {
return vdups_lane_u32(src, 0);
// CHECK-LABEL: @test_vdups_lane_u32
- // CHECK: [[TMP1:%.*]] = bitcast <2 x i32> %src to [[TYPE:.*]]
- // CHECK: [[TMP2:%.*]] = bitcast [[TYPE]] [[TMP1]] to <2 x i32>
- // CHECK: extractelement <2 x i32> [[TMP2]], i32 0
+ // CHECK: extractelement <2 x i32> %src, i32 0
// CHECK-BE-LABEL: @test_vdups_lane_u32
- // CHECK-BE: [[REV:%.*]] = shufflevector <2 x i32> {{.*}}, <2 x i32> <i32 1, i32 0>
- // CHECK-BE: [[TMP1:%.*]] = bitcast <2 x i32> [[REV]] to [[TYPE:.*]]
- // CHECK-BE: [[TMP2:%.*]] = bitcast [[TYPE]] [[TMP1]] to <2 x i32>
- // CHECK-BE: extractelement <2 x i32> [[TMP2]], i32 0
+ // CHECK-BE: [[REV:%.*]] = shufflevector <2 x i32> %src, <2 x i32> %src, <2 x i32> <i32 1, i32 0>
+ // CHECK-BE: extractelement <2 x i32> [[REV]], i32 0
}
float32_t test_vdups_lane_f32(float32x2_t src) {
return vdups_lane_f32(src, 0);
// CHECK-LABEL: @test_vdups_lane_f32
- // CHECK: [[TMP1:%.*]] = bitcast <2 x float> %src to [[TYPE:.*]]
- // CHECK: [[TMP2:%.*]] = bitcast [[TYPE]] [[TMP1]] to <2 x float>
- // CHECK: extractelement <2 x float> [[TMP2]], i32 0
+ // CHECK: extractelement <2 x float> %src, i32 0
// CHECK-BE-LABEL: @test_vdups_lane_f32
- // CHECK-BE: [[REV:%.*]] = shufflevector <2 x float> {{.*}}, <2 x i32> <i32 1, i32 0>
- // CHECK-BE: [[TMP1:%.*]] = bitcast <2 x float> [[REV]] to [[TYPE:.*]]
- // CHECK-BE: [[TMP2:%.*]] = bitcast [[TYPE]] [[TMP1]] to <2 x float>
- // CHECK-BE: extractelement <2 x float> [[TMP2]], i32 0
+ // CHECK-BE: [[REV:%.*]] = shufflevector <2 x float> %src, <2 x float> %src, <2 x i32> <i32 1, i32 0>
+ // CHECK-BE: extractelement <2 x float> [[REV]], i32 0
}
int64_t test_vdupd_lane_s64(int64x1_t src) {
return vdupd_lane_s64(src, 0);
// CHECK-LABEL: @test_vdupd_lane_s64
- // CHECK: [[TMP1:%.*]] = bitcast <1 x i64> %src to [[TYPE:.*]]
- // CHECK: [[TMP2:%.*]] = bitcast [[TYPE]] [[TMP1]] to <1 x i64>
- // CHECK: extractelement <1 x i64> [[TMP2]], i32 0
+ // CHECK: extractelement <1 x i64> %src, i32 0
// CHECK-BE-LABEL: @test_vdupd_lane_s64
- // CHECK-BE: extractelement <1 x i64> {{.*}}, i32 0
+ // CHECK-BE: extractelement <1 x i64> %src, i32 0
}
uint64_t test_vdupd_lane_u64(uint64x1_t src) {
return vdupd_lane_u64(src, 0);
// CHECK-LABEL: @test_vdupd_lane_u64
- // CHECK: [[TMP1:%.*]] = bitcast <1 x i64> %src to [[TYPE:.*]]
- // CHECK: [[TMP2:%.*]] = bitcast [[TYPE]] [[TMP1]] to <1 x i64>
- // CHECK: extractelement <1 x i64> [[TMP2]], i32 0
+ // CHECK: extractelement <1 x i64> %src, i32 0
// CHECK-BE-LABEL: @test_vdupd_lane_u64
- // CHECK-BE: extractelement <1 x i64> {{.*}}, i32 0
+ // CHECK-BE: extractelement <1 x i64> %src, i32 0
}
float64_t test_vdupd_lane_f64(float64x1_t src) {
return vdupd_lane_f64(src, 0);
// CHECK-LABEL: @test_vdupd_lane_f64
- // CHECK: [[TMP1:%.*]] = bitcast <1 x double> %src to [[TYPE:.*]]
- // CHECK: [[TMP2:%.*]] = bitcast [[TYPE]] [[TMP1]] to <1 x double>
- // CHECK: extractelement <1 x double> [[TMP2]], i32 0
+ // CHECK: extractelement <1 x double> %src, i32 0
// CHECK-BE-LABEL: @test_vdupd_lane_f64
- // CHECK-BE: extractelement <1 x double> {{.*}}, i32 0
+ // CHECK-BE: extractelement <1 x double> %src, i32 0
}
diff --git a/src/llvm-project/clang/test/CodeGen/arm64-microsoft-status-reg.cpp b/src/llvm-project/clang/test/CodeGen/arm64-microsoft-status-reg.cpp
index ee8439c..f63265e 100644
--- a/src/llvm-project/clang/test/CodeGen/arm64-microsoft-status-reg.cpp
+++ b/src/llvm-project/clang/test/CodeGen/arm64-microsoft-status-reg.cpp
@@ -3,9 +3,15 @@
// RUN: %clang_cc1 -triple arm64-windows -fms-compatibility -emit-llvm -S \
// RUN: -o - %s | FileCheck %s -check-prefix CHECK-ASM
+// RUN: %clang_cc1 -triple arm64-darwin -fms-compatibility -emit-llvm -S \
+// RUN: -o - %s | FileCheck %s -check-prefix CHECK-ASM
+
// RUN: %clang_cc1 -triple arm64-windows -fms-compatibility -emit-llvm \
// RUN: -o - %s | FileCheck %s -check-prefix CHECK-IR
+// RUN: %clang_cc1 -triple arm64-darwin -fms-compatibility -emit-llvm \
+// RUN: -o - %s | FileCheck %s -check-prefix CHECK-IR
+
// From winnt.h
#define ARM64_SYSREG(op0, op1, crn, crm, op2) \
( ((op0 & 1) << 14) | \
diff --git a/src/llvm-project/clang/test/CodeGen/arm64-vrnd.c b/src/llvm-project/clang/test/CodeGen/arm64-vrnd.c
index 7729c09..c710cae 100644
--- a/src/llvm-project/clang/test/CodeGen/arm64-vrnd.c
+++ b/src/llvm-project/clang/test/CodeGen/arm64-vrnd.c
@@ -1,22 +1,22 @@
-// RUN: %clang_cc1 -triple arm64-apple-ios7 -target-feature +neon -ffreestanding -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple arm64-apple-ios7 -target-feature +neon -ffreestanding -flax-vector-conversions=none -emit-llvm -o - %s | FileCheck %s
#include <arm_neon.h>
-int64x2_t rnd5(float64x2_t a) { return vrndq_f64(a); }
+float64x2_t rnd5(float64x2_t a) { return vrndq_f64(a); }
// CHECK: call <2 x double> @llvm.trunc.v2f64(<2 x double>
-int64x2_t rnd9(float64x2_t a) { return vrndnq_f64(a); }
+float64x2_t rnd9(float64x2_t a) { return vrndnq_f64(a); }
// CHECK: call <2 x double> @llvm.aarch64.neon.frintn.v2f64(<2 x double>
-int64x2_t rnd13(float64x2_t a) { return vrndmq_f64(a); }
+float64x2_t rnd13(float64x2_t a) { return vrndmq_f64(a); }
// CHECK: call <2 x double> @llvm.floor.v2f64(<2 x double>
-int64x2_t rnd18(float64x2_t a) { return vrndpq_f64(a); }
+float64x2_t rnd18(float64x2_t a) { return vrndpq_f64(a); }
// CHECK: call <2 x double> @llvm.ceil.v2f64(<2 x double>
-int64x2_t rnd22(float64x2_t a) { return vrndaq_f64(a); }
+float64x2_t rnd22(float64x2_t a) { return vrndaq_f64(a); }
// CHECK: call <2 x double> @llvm.round.v2f64(<2 x double>
-int64x2_t rnd25(float64x2_t a) { return vrndxq_f64(a); }
+float64x2_t rnd25(float64x2_t a) { return vrndxq_f64(a); }
// CHECK: call <2 x double> @llvm.rint.v2f64(<2 x double>
diff --git a/src/llvm-project/clang/test/CodeGen/arm64_32-vaarg.c b/src/llvm-project/clang/test/CodeGen/arm64_32-vaarg.c
new file mode 100644
index 0000000..7ee0277
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm64_32-vaarg.c
@@ -0,0 +1,117 @@
+// RUN: %clang_cc1 -triple arm64_32-apple-ios7.0 -target-abi darwinpcs -emit-llvm -o - -O1 -ffreestanding %s | FileCheck %s
+
+#include <stdarg.h>
+
+typedef struct {
+ int a;
+} OneInt;
+
+// No realignment should be needed here: slot size is 4 bytes.
+int test_int(OneInt input, va_list *mylist) {
+// CHECK-LABEL: define i32 @test_int(i32 %input
+// CHECK: [[START:%.*]] = load i8*, i8** %mylist
+// CHECK: [[NEXT:%.*]] = getelementptr inbounds i8, i8* [[START]], i32 4
+// CHECK: store i8* [[NEXT]], i8** %mylist
+
+// CHECK: [[ADDR_I32:%.*]] = bitcast i8* [[START]] to i32*
+// CHECK: [[RES:%.*]] = load i32, i32* [[ADDR_I32]]
+// CHECK: ret i32 [[RES]]
+
+ return va_arg(*mylist, OneInt).a;
+}
+
+
+typedef struct {
+ long long a;
+} OneLongLong;
+
+// Minimum slot size is 4 bytes, so address needs rounding up to multiple of 8.
+long long test_longlong(OneLongLong input, va_list *mylist) {
+// CHECK-LABEL: define i64 @test_longlong(i64 %input
+// CHECK: [[STARTPTR:%.*]] = bitcast i8** %mylist to i32*
+// CHECK: [[START:%.*]] = load i32, i32* [[STARTPTR]]
+
+// CHECK: [[ALIGN_TMP:%.*]] = add i32 [[START]], 7
+// CHECK: [[ALIGNED:%.*]] = and i32 [[ALIGN_TMP]], -8
+// CHECK: [[ALIGNED_ADDR:%.*]] = inttoptr i32 [[ALIGNED]] to i8*
+// CHECK: [[NEXT:%.*]] = getelementptr inbounds i8, i8* [[ALIGNED_ADDR]], i32 8
+// CHECK: store i8* [[NEXT]], i8** %mylist
+
+// CHECK: [[ADDR_STRUCT:%.*]] = inttoptr i32 [[ALIGNED]] to %struct.OneLongLong*
+// CHECK: [[ADDR_I64:%.*]] = getelementptr inbounds %struct.OneLongLong, %struct.OneLongLong* [[ADDR_STRUCT]], i32 0, i32 0
+// CHECK: [[RES:%.*]] = load i64, i64* [[ADDR_I64]]
+// CHECK: ret i64 [[RES]]
+
+ return va_arg(*mylist, OneLongLong).a;
+}
+
+
+typedef struct {
+ float arr[4];
+} HFA;
+
+// HFAs take priority over passing large structs indirectly.
+float test_hfa(va_list *mylist) {
+// CHECK-LABEL: define float @test_hfa
+// CHECK: [[START:%.*]] = load i8*, i8** %mylist
+
+// CHECK: [[NEXT:%.*]] = getelementptr inbounds i8, i8* [[START]], i32 16
+// CHECK: store i8* [[NEXT]], i8** %mylist
+
+// CHECK: [[ADDR_FLOAT:%.*]] = bitcast i8* [[START]] to float*
+// CHECK: [[RES:%.*]] = load float, float* [[ADDR_FLOAT]]
+// CHECK: ret float [[RES]]
+
+ return va_arg(*mylist, HFA).arr[0];
+}
+
+// armv7k does not return HFAs normally for variadic functions, so we must match
+// that.
+HFA test_hfa_return(int n, ...) {
+// CHECK-LABEL: define [2 x i64] @test_hfa_return
+ HFA h = {0};
+ return h;
+}
+
+typedef struct {
+ long long a, b;
+ char c;
+} BigStruct;
+
+// Structs bigger than 16 bytes are passed indirectly: a pointer is placed on
+// the stack.
+long long test_bigstruct(BigStruct input, va_list *mylist) {
+// CHECK-LABEL: define i64 @test_bigstruct(%struct.BigStruct*
+// CHECK: [[START:%.*]] = load i8*, i8** %mylist
+// CHECK: [[NEXT:%.*]] = getelementptr inbounds i8, i8* [[START]], i32 4
+// CHECK: store i8* [[NEXT]], i8** %mylist
+
+// CHECK: [[INT_PTR:%.*]] = bitcast i8* [[START]] to %struct.BigStruct**
+// CHECK: [[ADDR:%.*]] = load %struct.BigStruct*, %struct.BigStruct** [[INT_PTR]]
+// CHECK: [[ADDR_I64:%.*]] = getelementptr inbounds %struct.BigStruct, %struct.BigStruct* [[ADDR]], i32 0, i32 0
+// CHECK: [[RES:%.*]] = load i64, i64* [[ADDR_I64]]
+// CHECK: ret i64 [[RES]]
+
+ return va_arg(*mylist, BigStruct).a;
+}
+
+typedef struct {
+ short arr[3];
+} ThreeShorts;
+
+// Slot sizes are 4-bytes on arm64_32, so structs with less than 32-bit
+// alignment must be passed via "[N x i32]" to be correctly allocated in the
+// backend.
+short test_threeshorts(ThreeShorts input, va_list *mylist) {
+// CHECK-LABEL: define signext i16 @test_threeshorts([2 x i32] %input
+
+// CHECK: [[START:%.*]] = load i8*, i8** %mylist
+// CHECK: [[NEXT:%.*]] = getelementptr inbounds i8, i8* [[START]], i32 8
+// CHECK: store i8* [[NEXT]], i8** %mylist
+
+// CHECK: [[ADDR_I32:%.*]] = bitcast i8* [[START]] to i16*
+// CHECK: [[RES:%.*]] = load i16, i16* [[ADDR_I32]]
+// CHECK: ret i16 [[RES]]
+
+ return va_arg(*mylist, ThreeShorts).arr[0];
+}
diff --git a/src/llvm-project/clang/test/CodeGen/arm64_32.c b/src/llvm-project/clang/test/CodeGen/arm64_32.c
new file mode 100644
index 0000000..245dfef
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/arm64_32.c
@@ -0,0 +1,30 @@
+// RUN: %clang_cc1 -triple arm64_32-apple-ios7.0 -emit-llvm -o - %s | FileCheck %s
+
+struct Foo {
+ char a;
+ int b : 1;
+};
+
+int BitfieldOffset = sizeof(struct Foo);
+// CHECK: @BitfieldOffset = global i32 2
+
+int PointerSize = sizeof(void *);
+// CHECK: @PointerSize = global i32 4
+
+int PointerAlign = __alignof(void *);
+// CHECK: @PointerAlign = global i32 4
+
+int LongSize = sizeof(long);
+// CHECK: @LongSize = global i32 4
+
+int LongAlign = __alignof(long);
+// CHECK: @LongAlign = global i32 4
+
+// Not expected to change, but it's a difference between AAPCS and DarwinPCS
+// that we need to be preserved for compatibility with ARMv7k.
+long double LongDoubleVar = 0.0;
+// CHECK: @LongDoubleVar = global double
+
+typedef float __attribute__((ext_vector_type(16))) v16f32;
+v16f32 func(v16f32 in) { return in; }
+// CHECK: define void @func(<16 x float>* noalias sret {{%.*}}, <16 x float> {{%.*}})
diff --git a/src/llvm-project/clang/test/CodeGen/arm64_vcopy.c b/src/llvm-project/clang/test/CodeGen/arm64_vcopy.c
index fc2ad37..ecf1386 100644
--- a/src/llvm-project/clang/test/CodeGen/arm64_vcopy.c
+++ b/src/llvm-project/clang/test/CodeGen/arm64_vcopy.c
@@ -22,12 +22,8 @@
}
// CHECK-LABEL: define <8 x i16> @test_vcopyq_laneq_s16(<8 x i16> %a1, <8 x i16> %a2) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %a2 to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16>
-// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> [[TMP1]], i32 7
-// CHECK: [[TMP2:%.*]] = bitcast <8 x i16> %a1 to <16 x i8>
-// CHECK: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <8 x i16>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <8 x i16> [[TMP3]], i16 [[VGETQ_LANE]], i32 3
+// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> %a2, i32 7
+// CHECK: [[VSET_LANE:%.*]] = insertelement <8 x i16> %a1, i16 [[VGETQ_LANE]], i32 3
// CHECK: ret <8 x i16> [[VSET_LANE]]
int16x8_t test_vcopyq_laneq_s16(int16x8_t a1, int16x8_t a2) {
return vcopyq_laneq_s16(a1, (int64_t) 3, a2, (int64_t) 7);
@@ -35,12 +31,8 @@
}
// CHECK-LABEL: define <8 x i16> @test_vcopyq_laneq_u16(<8 x i16> %a1, <8 x i16> %a2) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %a2 to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16>
-// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> [[TMP1]], i32 7
-// CHECK: [[TMP2:%.*]] = bitcast <8 x i16> %a1 to <16 x i8>
-// CHECK: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <8 x i16>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <8 x i16> [[TMP3]], i16 [[VGETQ_LANE]], i32 3
+// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> %a2, i32 7
+// CHECK: [[VSET_LANE:%.*]] = insertelement <8 x i16> %a1, i16 [[VGETQ_LANE]], i32 3
// CHECK: ret <8 x i16> [[VSET_LANE]]
uint16x8_t test_vcopyq_laneq_u16(uint16x8_t a1, uint16x8_t a2) {
return vcopyq_laneq_u16(a1, (int64_t) 3, a2, (int64_t) 7);
@@ -48,72 +40,48 @@
}
// CHECK-LABEL: define <4 x i32> @test_vcopyq_laneq_s32(<4 x i32> %a1, <4 x i32> %a2) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %a2 to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32>
-// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x i32> [[TMP1]], i32 3
-// CHECK: [[TMP2:%.*]] = bitcast <4 x i32> %a1 to <16 x i8>
-// CHECK: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <4 x i32>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i32> [[TMP3]], i32 [[VGETQ_LANE]], i32 3
+// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x i32> %a2, i32 3
+// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i32> %a1, i32 [[VGETQ_LANE]], i32 3
// CHECK: ret <4 x i32> [[VSET_LANE]]
int32x4_t test_vcopyq_laneq_s32(int32x4_t a1, int32x4_t a2) {
return vcopyq_laneq_s32(a1, (int64_t) 3, a2, (int64_t) 3);
}
// CHECK-LABEL: define <4 x i32> @test_vcopyq_laneq_u32(<4 x i32> %a1, <4 x i32> %a2) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %a2 to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32>
-// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x i32> [[TMP1]], i32 3
-// CHECK: [[TMP2:%.*]] = bitcast <4 x i32> %a1 to <16 x i8>
-// CHECK: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <4 x i32>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i32> [[TMP3]], i32 [[VGETQ_LANE]], i32 3
+// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x i32> %a2, i32 3
+// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i32> %a1, i32 [[VGETQ_LANE]], i32 3
// CHECK: ret <4 x i32> [[VSET_LANE]]
uint32x4_t test_vcopyq_laneq_u32(uint32x4_t a1, uint32x4_t a2) {
return vcopyq_laneq_u32(a1, (int64_t) 3, a2, (int64_t) 3);
}
// CHECK-LABEL: define <2 x i64> @test_vcopyq_laneq_s64(<2 x i64> %a1, <2 x i64> %a2) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %a2 to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x i64>
-// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x i64> [[TMP1]], i32 1
-// CHECK: [[TMP2:%.*]] = bitcast <2 x i64> %a1 to <16 x i8>
-// CHECK: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <2 x i64>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i64> [[TMP3]], i64 [[VGETQ_LANE]], i32 0
+// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x i64> %a2, i32 1
+// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i64> %a1, i64 [[VGETQ_LANE]], i32 0
// CHECK: ret <2 x i64> [[VSET_LANE]]
int64x2_t test_vcopyq_laneq_s64(int64x2_t a1, int64x2_t a2) {
return vcopyq_laneq_s64(a1, (int64_t) 0, a2, (int64_t) 1);
}
// CHECK-LABEL: define <2 x i64> @test_vcopyq_laneq_u64(<2 x i64> %a1, <2 x i64> %a2) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %a2 to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x i64>
-// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x i64> [[TMP1]], i32 1
-// CHECK: [[TMP2:%.*]] = bitcast <2 x i64> %a1 to <16 x i8>
-// CHECK: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <2 x i64>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i64> [[TMP3]], i64 [[VGETQ_LANE]], i32 0
+// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x i64> %a2, i32 1
+// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i64> %a1, i64 [[VGETQ_LANE]], i32 0
// CHECK: ret <2 x i64> [[VSET_LANE]]
uint64x2_t test_vcopyq_laneq_u64(uint64x2_t a1, uint64x2_t a2) {
return vcopyq_laneq_u64(a1, (int64_t) 0, a2, (int64_t) 1);
}
// CHECK-LABEL: define <4 x float> @test_vcopyq_laneq_f32(<4 x float> %a1, <4 x float> %a2) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <4 x float> %a2 to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x float>
-// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x float> [[TMP1]], i32 3
-// CHECK: [[TMP2:%.*]] = bitcast <4 x float> %a1 to <16 x i8>
-// CHECK: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <4 x float>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x float> [[TMP3]], float [[VGETQ_LANE]], i32 0
+// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x float> %a2, i32 3
+// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x float> %a1, float [[VGETQ_LANE]], i32 0
// CHECK: ret <4 x float> [[VSET_LANE]]
float32x4_t test_vcopyq_laneq_f32(float32x4_t a1, float32x4_t a2) {
return vcopyq_laneq_f32(a1, 0, a2, 3);
}
// CHECK-LABEL: define <2 x double> @test_vcopyq_laneq_f64(<2 x double> %a1, <2 x double> %a2) #0 {
-// CHECK: [[TMP0:%.*]] = bitcast <2 x double> %a2 to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x double>
-// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x double> [[TMP1]], i32 1
-// CHECK: [[TMP2:%.*]] = bitcast <2 x double> %a1 to <16 x i8>
-// CHECK: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <2 x double>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x double> [[TMP3]], double [[VGETQ_LANE]], i32 0
+// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x double> %a2, i32 1
+// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x double> %a1, double [[VGETQ_LANE]], i32 0
// CHECK: ret <2 x double> [[VSET_LANE]]
float64x2_t test_vcopyq_laneq_f64(float64x2_t a1, float64x2_t a2) {
return vcopyq_laneq_f64(a1, 0, a2, 1);
diff --git a/src/llvm-project/clang/test/CodeGen/arm_acle.c b/src/llvm-project/clang/test/CodeGen/arm_acle.c
index beca937..9f0ad22 100644
--- a/src/llvm-project/clang/test/CodeGen/arm_acle.c
+++ b/src/llvm-project/clang/test/CodeGen/arm_acle.c
@@ -6,6 +6,8 @@
// RUN: %clang_cc1 -ffreestanding -triple aarch64-eabi -target-cpu cortex-a57 -target-feature +v8.4a -O2 -fexperimental-new-pass-manager -S -emit-llvm -o - %s | FileCheck %s -check-prefix=AArch64-v8_3
// RUN: %clang_cc1 -ffreestanding -triple aarch64-eabi -target-cpu cortex-a57 -target-feature +v8.5a -O2 -fexperimental-new-pass-manager -S -emit-llvm -o - %s | FileCheck %s -check-prefix=AArch64-v8_3
+// REQUIRES: rewrite
+
#include <arm_acle.h>
/* 8 SYNCHRONIZATION, BARRIER AND HINT INTRINSICS */
@@ -88,28 +90,28 @@
/* 8.6 Memory prefetch intrinsics */
/* 8.6.1 Data prefetch */
// ARM-LABEL: test_pld
-// ARM: call void @llvm.prefetch(i8* null, i32 0, i32 3, i32 1)
+// ARM: call void @llvm.prefetch.p0i8(i8* null, i32 0, i32 3, i32 1)
void test_pld() {
__pld(0);
}
// ARM-LABEL: test_pldx
-// AArch32: call void @llvm.prefetch(i8* null, i32 1, i32 3, i32 1)
-// AArch64: call void @llvm.prefetch(i8* null, i32 1, i32 1, i32 1)
+// AArch32: call void @llvm.prefetch.p0i8(i8* null, i32 1, i32 3, i32 1)
+// AArch64: call void @llvm.prefetch.p0i8(i8* null, i32 1, i32 1, i32 1)
void test_pldx() {
__pldx(1, 2, 0, 0);
}
/* 8.6.2 Instruction prefetch */
// ARM-LABEL: test_pli
-// ARM: call void @llvm.prefetch(i8* null, i32 0, i32 3, i32 0)
+// ARM: call void @llvm.prefetch.p0i8(i8* null, i32 0, i32 3, i32 0)
void test_pli() {
__pli(0);
}
// ARM-LABEL: test_plix
-// AArch32: call void @llvm.prefetch(i8* null, i32 0, i32 3, i32 0)
-// AArch64: call void @llvm.prefetch(i8* null, i32 0, i32 1, i32 0)
+// AArch32: call void @llvm.prefetch.p0i8(i8* null, i32 0, i32 3, i32 0)
+// AArch64: call void @llvm.prefetch.p0i8(i8* null, i32 0, i32 1, i32 0)
void test_plix() {
__plix(2, 0, 0);
}
@@ -173,6 +175,24 @@
return __clzll(t);
}
+// ARM-LABEL: test_cls
+// ARM: call i32 @llvm.arm.cls(i32 %t)
+unsigned test_cls(uint32_t t) {
+ return __cls(t);
+}
+
+// ARM-LABEL: test_clsl
+// AArch32: call i32 @llvm.arm.cls(i32 %t)
+// AArch64: call i32 @llvm.arm.cls64(i64 %t)
+unsigned test_clsl(unsigned long t) {
+ return __clsl(t);
+}
+// ARM-LABEL: test_clsll
+// ARM: call i32 @llvm.arm.cls64(i64 %t)
+unsigned test_clsll(uint64_t t) {
+ return __clsll(t);
+}
+
// ARM-LABEL: test_rev
// ARM: call i32 @llvm.bswap.i32(i32 %t)
uint32_t test_rev(uint32_t t) {
@@ -820,6 +840,55 @@
__arm_wsrp("sysreg", v);
}
+// ARM-LABEL: test_rsrf
+// AArch64: call i64 @llvm.read_register.i64(metadata ![[M0:[0-9]]])
+// AArch32: call i32 @llvm.read_register.i32(metadata ![[M2:[0-9]]])
+// ARM-NOT: uitofp
+// ARM: bitcast
+float test_rsrf() {
+#ifdef __ARM_32BIT_STATE
+ return __arm_rsrf("cp1:2:c3:c4:5");
+#else
+ return __arm_rsrf("1:2:3:4:5");
+#endif
+}
+// ARM-LABEL: test_rsrf64
+// AArch64: call i64 @llvm.read_register.i64(metadata ![[M0:[0-9]]])
+// AArch32: call i64 @llvm.read_register.i64(metadata ![[M3:[0-9]]])
+// ARM-NOT: uitofp
+// ARM: bitcast
+double test_rsrf64() {
+#ifdef __ARM_32BIT_STATE
+ return __arm_rsrf64("cp1:2:c3");
+#else
+ return __arm_rsrf64("1:2:3:4:5");
+#endif
+}
+// ARM-LABEL: test_wsrf
+// ARM-NOT: fptoui
+// ARM: bitcast
+// AArch64: call void @llvm.write_register.i64(metadata ![[M0:[0-9]]], i64 %{{.*}})
+// AArch32: call void @llvm.write_register.i32(metadata ![[M2:[0-9]]], i32 %{{.*}})
+void test_wsrf(float v) {
+#ifdef __ARM_32BIT_STATE
+ __arm_wsrf("cp1:2:c3:c4:5", v);
+#else
+ __arm_wsrf("1:2:3:4:5", v);
+#endif
+}
+// ARM-LABEL: test_wsrf64
+// ARM-NOT: fptoui
+// ARM: bitcast
+// AArch64: call void @llvm.write_register.i64(metadata ![[M0:[0-9]]], i64 %{{.*}})
+// AArch32: call void @llvm.write_register.i64(metadata ![[M3:[0-9]]], i64 %{{.*}})
+void test_wsrf64(double v) {
+#ifdef __ARM_32BIT_STATE
+ __arm_wsrf64("cp1:2:c3", v);
+#else
+ __arm_wsrf64("1:2:3:4:5", v);
+#endif
+}
+
// AArch32: ![[M2]] = !{!"cp1:2:c3:c4:5"}
// AArch32: ![[M3]] = !{!"cp1:2:c3"}
// AArch32: ![[M4]] = !{!"sysreg"}
diff --git a/src/llvm-project/clang/test/CodeGen/arm_neon_intrinsics.c b/src/llvm-project/clang/test/CodeGen/arm_neon_intrinsics.c
index c0e0dee..9f1a6455 100644
--- a/src/llvm-project/clang/test/CodeGen/arm_neon_intrinsics.c
+++ b/src/llvm-project/clang/test/CodeGen/arm_neon_intrinsics.c
@@ -1,6 +1,7 @@
// RUN: %clang_cc1 -triple thumbv7s-apple-darwin -target-abi apcs-gnu\
// RUN: -target-cpu swift -fallow-half-arguments-and-returns \
// RUN: -target-feature +fullfp16 -ffreestanding \
+// RUN: -flax-vector-conversions=none \
// RUN: -disable-O0-optnone -emit-llvm -o - %s \
// RUN: | opt -S -mem2reg | FileCheck %s
@@ -2146,6 +2147,13 @@
return vclz_s8(vcreate_s8(a));
}
+// CHECK-LABEL: @test_vcreate_imm
+// CHECK: [[RES:%.*]] = bitcast i64 0 to <4 x i16>
+// CHECK: ret <4 x i16> [[RES]]
+int16x4_t test_vcreate_imm(void) {
+ return vcreate_s16(0);
+}
+
// CHECK-LABEL: @test_vcreate_s16(
// CHECK: [[TMP0:%.*]] = bitcast i64 %a to <4 x i16>
// CHECK: [[TMP1:%.*]] = bitcast <4 x i16> [[TMP0]] to <8 x i8>
@@ -2184,8 +2192,8 @@
// CHECK: [[TMP0:%.*]] = bitcast i64 %a to <8 x i8>
// CHECK: [[VCLZ_V_I:%.*]] = call <8 x i8> @llvm.ctlz.v8i8(<8 x i8> [[TMP0]], i1 false)
// CHECK: ret <8 x i8> [[VCLZ_V_I]]
-uint8x8_t test_vcreate_u8(uint64_t a) {
- return vclz_s8(vcreate_u8(a));
+int8x8_t test_vcreate_u8(uint64_t a) {
+ return vclz_s8((int8x8_t)vcreate_u8(a));
}
// CHECK-LABEL: @test_vcreate_u16(
@@ -2194,8 +2202,8 @@
// CHECK: [[VCLZ_V1_I:%.*]] = call <4 x i16> @llvm.ctlz.v4i16(<4 x i16> [[TMP0]], i1 false)
// CHECK: [[VCLZ_V2_I:%.*]] = bitcast <4 x i16> [[VCLZ_V1_I]] to <8 x i8>
// CHECK: ret <4 x i16> [[VCLZ_V1_I]]
-uint16x4_t test_vcreate_u16(uint64_t a) {
- return vclz_s16(vcreate_u16(a));
+int16x4_t test_vcreate_u16(uint64_t a) {
+ return vclz_s16((int16x4_t)vcreate_u16(a));
}
// CHECK-LABEL: @test_vcreate_u32(
@@ -2204,8 +2212,8 @@
// CHECK: [[VCLZ_V1_I:%.*]] = call <2 x i32> @llvm.ctlz.v2i32(<2 x i32> [[TMP0]], i1 false)
// CHECK: [[VCLZ_V2_I:%.*]] = bitcast <2 x i32> [[VCLZ_V1_I]] to <8 x i8>
// CHECK: ret <2 x i32> [[VCLZ_V1_I]]
-uint32x2_t test_vcreate_u32(uint64_t a) {
- return vclz_s32(vcreate_u32(a));
+int32x2_t test_vcreate_u32(uint64_t a) {
+ return vclz_s32((int32x2_t)vcreate_u32(a));
}
// CHECK-LABEL: @test_vcreate_u64(
@@ -2235,7 +2243,7 @@
// CHECK: ret <4 x i16> [[TMP4]]
poly16x4_t test_vcreate_p16(uint64_t a) {
poly16x4_t tmp = vcreate_p16(a);
- return vbsl_p16(tmp, tmp, tmp);
+ return vbsl_p16((uint16x4_t)tmp, tmp, tmp);
}
// CHECK-LABEL: @test_vcreate_s64(
@@ -2830,8 +2838,8 @@
// CHECK: [[VECINIT_I:%.*]] = insertelement <1 x i64> undef, i64 %a, i32 0
// CHECK: [[ADD_I:%.*]] = add <1 x i64> [[VECINIT_I]], [[VECINIT_I]]
// CHECK: ret <1 x i64> [[ADD_I]]
-uint64x1_t test_vdup_n_u64(uint64_t a) {
- int64x1_t tmp = vdup_n_u64(a);
+int64x1_t test_vdup_n_u64(uint64_t a) {
+ int64x1_t tmp = (int64x1_t)vdup_n_u64(a);
return vadd_s64(tmp, tmp);
}
@@ -2851,7 +2859,7 @@
// CHECK: [[ADD_I:%.*]] = add <2 x i64> [[VECINIT1_I]], [[VECINIT1_I]]
// CHECK: ret <2 x i64> [[ADD_I]]
uint64x2_t test_vdupq_n_u64(uint64_t a) {
- int64x2_t tmp = vdupq_n_u64(a);
+ uint64x2_t tmp = vdupq_n_u64(a);
return vaddq_u64(tmp, tmp);
}
@@ -3206,7 +3214,7 @@
}
// CHECK-LABEL: @test_vfms_f32(
-// CHECK: [[SUB_I:%.*]] = fsub <2 x float> <float -0.000000e+00, float -0.000000e+00>, %b
+// CHECK: [[SUB_I:%.*]] = fneg <2 x float> %b
// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <2 x float> [[SUB_I]] to <8 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <2 x float> %c to <8 x i8>
@@ -3217,7 +3225,7 @@
}
// CHECK-LABEL: @test_vfmsq_f32(
-// CHECK: [[SUB_I:%.*]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %b
+// CHECK: [[SUB_I:%.*]] = fneg <4 x float> %b
// CHECK: [[TMP0:%.*]] = bitcast <4 x float> %a to <16 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <4 x float> [[SUB_I]] to <16 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <4 x float> %c to <16 x i8>
@@ -3319,18 +3327,14 @@
}
// CHECK-LABEL: @test_vget_lane_u16(
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %a to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> [[TMP1]], i32 3
+// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> %a, i32 3
// CHECK: ret i16 [[VGET_LANE]]
uint16_t test_vget_lane_u16(uint16x4_t a) {
return vget_lane_u16(a, 3);
}
// CHECK-LABEL: @test_vget_lane_u32(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x i32>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i32> [[TMP1]], i32 1
+// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i32> %a, i32 1
// CHECK: ret i32 [[VGET_LANE]]
uint32_t test_vget_lane_u32(uint32x2_t a) {
return vget_lane_u32(a, 1);
@@ -3344,18 +3348,14 @@
}
// CHECK-LABEL: @test_vget_lane_s16(
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %a to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> [[TMP1]], i32 3
+// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> %a, i32 3
// CHECK: ret i16 [[VGET_LANE]]
int16_t test_vget_lane_s16(int16x4_t a) {
return vget_lane_s16(a, 3);
}
// CHECK-LABEL: @test_vget_lane_s32(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x i32>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i32> [[TMP1]], i32 1
+// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i32> %a, i32 1
// CHECK: ret i32 [[VGET_LANE]]
int32_t test_vget_lane_s32(int32x2_t a) {
return vget_lane_s32(a, 1);
@@ -3369,18 +3369,14 @@
}
// CHECK-LABEL: @test_vget_lane_p16(
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %a to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> [[TMP1]], i32 3
+// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> %a, i32 3
// CHECK: ret i16 [[VGET_LANE]]
poly16_t test_vget_lane_p16(poly16x4_t a) {
return vget_lane_p16(a, 3);
}
// CHECK-LABEL: @test_vget_lane_f32(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %a to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x float>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x float> [[TMP1]], i32 1
+// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x float> %a, i32 1
// CHECK: ret float [[VGET_LANE]]
float32_t test_vget_lane_f32(float32x2_t a) {
return vget_lane_f32(a, 1);
@@ -3392,9 +3388,7 @@
// CHECK: store <4 x half> %a, <4 x half>* [[__REINT_242]], align 8
// CHECK: [[TMP0:%.*]] = bitcast <4 x half>* [[__REINT_242]] to <4 x i16>*
// CHECK: [[TMP1:%.*]] = load <4 x i16>, <4 x i16>* [[TMP0]], align 8
-// CHECK: [[TMP2:%.*]] = bitcast <4 x i16> [[TMP1]] to <8 x i8>
-// CHECK: [[TMP3:%.*]] = bitcast <8 x i8> [[TMP2]] to <4 x i16>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> [[TMP3]], i32 1
+// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> [[TMP1]], i32 1
// CHECK: store i16 [[VGET_LANE]], i16* [[__REINT1_242]], align 2
// CHECK: [[TMP4:%.*]] = bitcast i16* [[__REINT1_242]] to half*
// CHECK: [[TMP5:%.*]] = load half, half* [[TMP4]], align 2
@@ -3412,18 +3406,14 @@
}
// CHECK-LABEL: @test_vgetq_lane_u16(
-// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %a to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <8 x i16> [[TMP1]], i32 7
+// CHECK: [[VGET_LANE:%.*]] = extractelement <8 x i16> %a, i32 7
// CHECK: ret i16 [[VGET_LANE]]
uint16_t test_vgetq_lane_u16(uint16x8_t a) {
return vgetq_lane_u16(a, 7);
}
// CHECK-LABEL: @test_vgetq_lane_u32(
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %a to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i32> [[TMP1]], i32 3
+// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i32> %a, i32 3
// CHECK: ret i32 [[VGET_LANE]]
uint32_t test_vgetq_lane_u32(uint32x4_t a) {
return vgetq_lane_u32(a, 3);
@@ -3437,18 +3427,14 @@
}
// CHECK-LABEL: @test_vgetq_lane_s16(
-// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %a to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <8 x i16> [[TMP1]], i32 7
+// CHECK: [[VGET_LANE:%.*]] = extractelement <8 x i16> %a, i32 7
// CHECK: ret i16 [[VGET_LANE]]
int16_t test_vgetq_lane_s16(int16x8_t a) {
return vgetq_lane_s16(a, 7);
}
// CHECK-LABEL: @test_vgetq_lane_s32(
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %a to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i32> [[TMP1]], i32 3
+// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i32> %a, i32 3
// CHECK: ret i32 [[VGET_LANE]]
int32_t test_vgetq_lane_s32(int32x4_t a) {
return vgetq_lane_s32(a, 3);
@@ -3462,18 +3448,14 @@
}
// CHECK-LABEL: @test_vgetq_lane_p16(
-// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %a to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <8 x i16> [[TMP1]], i32 7
+// CHECK: [[VGET_LANE:%.*]] = extractelement <8 x i16> %a, i32 7
// CHECK: ret i16 [[VGET_LANE]]
poly16_t test_vgetq_lane_p16(poly16x8_t a) {
return vgetq_lane_p16(a, 7);
}
// CHECK-LABEL: @test_vgetq_lane_f32(
-// CHECK: [[TMP0:%.*]] = bitcast <4 x float> %a to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x float>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x float> [[TMP1]], i32 3
+// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x float> %a, i32 3
// CHECK: ret float [[VGET_LANE]]
float32_t test_vgetq_lane_f32(float32x4_t a) {
return vgetq_lane_f32(a, 3);
@@ -3485,9 +3467,7 @@
// CHECK: store <8 x half> %a, <8 x half>* [[__REINT_244]], align 16
// CHECK: [[TMP0:%.*]] = bitcast <8 x half>* [[__REINT_244]] to <8 x i16>*
// CHECK: [[TMP1:%.*]] = load <8 x i16>, <8 x i16>* [[TMP0]], align 16
-// CHECK: [[TMP2:%.*]] = bitcast <8 x i16> [[TMP1]] to <16 x i8>
-// CHECK: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <8 x i16>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <8 x i16> [[TMP3]], i32 3
+// CHECK: [[VGET_LANE:%.*]] = extractelement <8 x i16> [[TMP1]], i32 3
// CHECK: store i16 [[VGET_LANE]], i16* [[__REINT1_244]], align 2
// CHECK: [[TMP4:%.*]] = bitcast i16* [[__REINT1_244]] to half*
// CHECK: [[TMP5:%.*]] = load half, half* [[TMP4]], align 2
@@ -3498,36 +3478,28 @@
}
// CHECK-LABEL: @test_vget_lane_s64(
-// CHECK: [[TMP0:%.*]] = bitcast <1 x i64> %a to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x i64>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x i64> [[TMP1]], i32 0
+// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x i64> %a, i32 0
// CHECK: ret i64 [[VGET_LANE]]
int64_t test_vget_lane_s64(int64x1_t a) {
return vget_lane_s64(a, 0);
}
// CHECK-LABEL: @test_vget_lane_u64(
-// CHECK: [[TMP0:%.*]] = bitcast <1 x i64> %a to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x i64>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x i64> [[TMP1]], i32 0
+// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x i64> %a, i32 0
// CHECK: ret i64 [[VGET_LANE]]
uint64_t test_vget_lane_u64(uint64x1_t a) {
return vget_lane_u64(a, 0);
}
// CHECK-LABEL: @test_vgetq_lane_s64(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %a to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x i64>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i64> [[TMP1]], i32 1
+// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i64> %a, i32 1
// CHECK: ret i64 [[VGET_LANE]]
int64_t test_vgetq_lane_s64(int64x2_t a) {
return vgetq_lane_s64(a, 1);
}
// CHECK-LABEL: @test_vgetq_lane_u64(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %a to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x i64>
-// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i64> [[TMP1]], i32 1
+// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i64> %a, i32 1
// CHECK: ret i64 [[VGET_LANE]]
uint64_t test_vgetq_lane_u64(uint64x2_t a) {
return vgetq_lane_u64(a, 1);
@@ -8472,11 +8444,11 @@
}
// CHECK-LABEL: @test_vmull_n_s16(
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %a to <8 x i8>
// CHECK: [[VECINIT_I:%.*]] = insertelement <4 x i16> undef, i16 %b, i32 0
// CHECK: [[VECINIT1_I:%.*]] = insertelement <4 x i16> [[VECINIT_I]], i16 %b, i32 1
// CHECK: [[VECINIT2_I:%.*]] = insertelement <4 x i16> [[VECINIT1_I]], i16 %b, i32 2
// CHECK: [[VECINIT3_I:%.*]] = insertelement <4 x i16> [[VECINIT2_I]], i16 %b, i32 3
+// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <4 x i16> [[VECINIT3_I]] to <8 x i8>
// CHECK: [[VMULL5_I:%.*]] = call <4 x i32> @llvm.arm.neon.vmulls.v4i32(<4 x i16> %a, <4 x i16> [[VECINIT3_I]])
// CHECK: ret <4 x i32> [[VMULL5_I]]
@@ -8485,9 +8457,9 @@
}
// CHECK-LABEL: @test_vmull_n_s32(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8>
// CHECK: [[VECINIT_I:%.*]] = insertelement <2 x i32> undef, i32 %b, i32 0
// CHECK: [[VECINIT1_I:%.*]] = insertelement <2 x i32> [[VECINIT_I]], i32 %b, i32 1
+// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <2 x i32> [[VECINIT1_I]] to <8 x i8>
// CHECK: [[VMULL3_I:%.*]] = call <2 x i64> @llvm.arm.neon.vmulls.v2i64(<2 x i32> %a, <2 x i32> [[VECINIT1_I]])
// CHECK: ret <2 x i64> [[VMULL3_I]]
@@ -8496,11 +8468,11 @@
}
// CHECK-LABEL: @test_vmull_n_u16(
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %a to <8 x i8>
// CHECK: [[VECINIT_I:%.*]] = insertelement <4 x i16> undef, i16 %b, i32 0
// CHECK: [[VECINIT1_I:%.*]] = insertelement <4 x i16> [[VECINIT_I]], i16 %b, i32 1
// CHECK: [[VECINIT2_I:%.*]] = insertelement <4 x i16> [[VECINIT1_I]], i16 %b, i32 2
// CHECK: [[VECINIT3_I:%.*]] = insertelement <4 x i16> [[VECINIT2_I]], i16 %b, i32 3
+// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <4 x i16> [[VECINIT3_I]] to <8 x i8>
// CHECK: [[VMULL5_I:%.*]] = call <4 x i32> @llvm.arm.neon.vmullu.v4i32(<4 x i16> %a, <4 x i16> [[VECINIT3_I]])
// CHECK: ret <4 x i32> [[VMULL5_I]]
@@ -8509,9 +8481,9 @@
}
// CHECK-LABEL: @test_vmull_n_u32(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8>
// CHECK: [[VECINIT_I:%.*]] = insertelement <2 x i32> undef, i32 %b, i32 0
// CHECK: [[VECINIT1_I:%.*]] = insertelement <2 x i32> [[VECINIT_I]], i32 %b, i32 1
+// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <2 x i32> [[VECINIT1_I]] to <8 x i8>
// CHECK: [[VMULL3_I:%.*]] = call <2 x i64> @llvm.arm.neon.vmullu.v2i64(<2 x i32> %a, <2 x i32> [[VECINIT1_I]])
// CHECK: ret <2 x i64> [[VMULL3_I]]
@@ -8845,7 +8817,7 @@
}
// CHECK-LABEL: @test_vneg_f32(
-// CHECK: [[SUB_I:%.*]] = fsub <2 x float> <float -0.000000e+00, float -0.000000e+00>, %a
+// CHECK: [[SUB_I:%.*]] = fneg <2 x float> %a
// CHECK: ret <2 x float> [[SUB_I]]
float32x2_t test_vneg_f32(float32x2_t a) {
return vneg_f32(a);
@@ -8873,7 +8845,7 @@
}
// CHECK-LABEL: @test_vnegq_f32(
-// CHECK: [[SUB_I:%.*]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %a
+// CHECK: [[SUB_I:%.*]] = fneg <4 x float> %a
// CHECK: ret <4 x float> [[SUB_I]]
float32x4_t test_vnegq_f32(float32x4_t a) {
return vnegq_f32(a);
@@ -9558,7 +9530,7 @@
}
// CHECK-LABEL: @test_vqadd_s8(
-// CHECK: [[VQADD_V_I:%.*]] = call <8 x i8> @llvm.arm.neon.vqadds.v8i8(<8 x i8> %a, <8 x i8> %b)
+// CHECK: [[VQADD_V_I:%.*]] = call <8 x i8> @llvm.sadd.sat.v8i8(<8 x i8> %a, <8 x i8> %b)
// CHECK: ret <8 x i8> [[VQADD_V_I]]
int8x8_t test_vqadd_s8(int8x8_t a, int8x8_t b) {
return vqadd_s8(a, b);
@@ -9567,7 +9539,7 @@
// CHECK-LABEL: @test_vqadd_s16(
// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <4 x i16> %b to <8 x i8>
-// CHECK: [[VQADD_V2_I:%.*]] = call <4 x i16> @llvm.arm.neon.vqadds.v4i16(<4 x i16> %a, <4 x i16> %b)
+// CHECK: [[VQADD_V2_I:%.*]] = call <4 x i16> @llvm.sadd.sat.v4i16(<4 x i16> %a, <4 x i16> %b)
// CHECK: [[VQADD_V3_I:%.*]] = bitcast <4 x i16> [[VQADD_V2_I]] to <8 x i8>
// CHECK: ret <4 x i16> [[VQADD_V2_I]]
int16x4_t test_vqadd_s16(int16x4_t a, int16x4_t b) {
@@ -9577,7 +9549,7 @@
// CHECK-LABEL: @test_vqadd_s32(
// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <2 x i32> %b to <8 x i8>
-// CHECK: [[VQADD_V2_I:%.*]] = call <2 x i32> @llvm.arm.neon.vqadds.v2i32(<2 x i32> %a, <2 x i32> %b)
+// CHECK: [[VQADD_V2_I:%.*]] = call <2 x i32> @llvm.sadd.sat.v2i32(<2 x i32> %a, <2 x i32> %b)
// CHECK: [[VQADD_V3_I:%.*]] = bitcast <2 x i32> [[VQADD_V2_I]] to <8 x i8>
// CHECK: ret <2 x i32> [[VQADD_V2_I]]
int32x2_t test_vqadd_s32(int32x2_t a, int32x2_t b) {
@@ -9587,7 +9559,7 @@
// CHECK-LABEL: @test_vqadd_s64(
// CHECK: [[TMP0:%.*]] = bitcast <1 x i64> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <1 x i64> %b to <8 x i8>
-// CHECK: [[VQADD_V2_I:%.*]] = call <1 x i64> @llvm.arm.neon.vqadds.v1i64(<1 x i64> %a, <1 x i64> %b)
+// CHECK: [[VQADD_V2_I:%.*]] = call <1 x i64> @llvm.sadd.sat.v1i64(<1 x i64> %a, <1 x i64> %b)
// CHECK: [[VQADD_V3_I:%.*]] = bitcast <1 x i64> [[VQADD_V2_I]] to <8 x i8>
// CHECK: ret <1 x i64> [[VQADD_V2_I]]
int64x1_t test_vqadd_s64(int64x1_t a, int64x1_t b) {
@@ -9595,7 +9567,7 @@
}
// CHECK-LABEL: @test_vqadd_u8(
-// CHECK: [[VQADD_V_I:%.*]] = call <8 x i8> @llvm.arm.neon.vqaddu.v8i8(<8 x i8> %a, <8 x i8> %b)
+// CHECK: [[VQADD_V_I:%.*]] = call <8 x i8> @llvm.uadd.sat.v8i8(<8 x i8> %a, <8 x i8> %b)
// CHECK: ret <8 x i8> [[VQADD_V_I]]
uint8x8_t test_vqadd_u8(uint8x8_t a, uint8x8_t b) {
return vqadd_u8(a, b);
@@ -9604,7 +9576,7 @@
// CHECK-LABEL: @test_vqadd_u16(
// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <4 x i16> %b to <8 x i8>
-// CHECK: [[VQADD_V2_I:%.*]] = call <4 x i16> @llvm.arm.neon.vqaddu.v4i16(<4 x i16> %a, <4 x i16> %b)
+// CHECK: [[VQADD_V2_I:%.*]] = call <4 x i16> @llvm.uadd.sat.v4i16(<4 x i16> %a, <4 x i16> %b)
// CHECK: [[VQADD_V3_I:%.*]] = bitcast <4 x i16> [[VQADD_V2_I]] to <8 x i8>
// CHECK: ret <4 x i16> [[VQADD_V2_I]]
uint16x4_t test_vqadd_u16(uint16x4_t a, uint16x4_t b) {
@@ -9614,7 +9586,7 @@
// CHECK-LABEL: @test_vqadd_u32(
// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <2 x i32> %b to <8 x i8>
-// CHECK: [[VQADD_V2_I:%.*]] = call <2 x i32> @llvm.arm.neon.vqaddu.v2i32(<2 x i32> %a, <2 x i32> %b)
+// CHECK: [[VQADD_V2_I:%.*]] = call <2 x i32> @llvm.uadd.sat.v2i32(<2 x i32> %a, <2 x i32> %b)
// CHECK: [[VQADD_V3_I:%.*]] = bitcast <2 x i32> [[VQADD_V2_I]] to <8 x i8>
// CHECK: ret <2 x i32> [[VQADD_V2_I]]
uint32x2_t test_vqadd_u32(uint32x2_t a, uint32x2_t b) {
@@ -9624,7 +9596,7 @@
// CHECK-LABEL: @test_vqadd_u64(
// CHECK: [[TMP0:%.*]] = bitcast <1 x i64> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <1 x i64> %b to <8 x i8>
-// CHECK: [[VQADD_V2_I:%.*]] = call <1 x i64> @llvm.arm.neon.vqaddu.v1i64(<1 x i64> %a, <1 x i64> %b)
+// CHECK: [[VQADD_V2_I:%.*]] = call <1 x i64> @llvm.uadd.sat.v1i64(<1 x i64> %a, <1 x i64> %b)
// CHECK: [[VQADD_V3_I:%.*]] = bitcast <1 x i64> [[VQADD_V2_I]] to <8 x i8>
// CHECK: ret <1 x i64> [[VQADD_V2_I]]
uint64x1_t test_vqadd_u64(uint64x1_t a, uint64x1_t b) {
@@ -9632,7 +9604,7 @@
}
// CHECK-LABEL: @test_vqaddq_s8(
-// CHECK: [[VQADDQ_V_I:%.*]] = call <16 x i8> @llvm.arm.neon.vqadds.v16i8(<16 x i8> %a, <16 x i8> %b)
+// CHECK: [[VQADDQ_V_I:%.*]] = call <16 x i8> @llvm.sadd.sat.v16i8(<16 x i8> %a, <16 x i8> %b)
// CHECK: ret <16 x i8> [[VQADDQ_V_I]]
int8x16_t test_vqaddq_s8(int8x16_t a, int8x16_t b) {
return vqaddq_s8(a, b);
@@ -9641,7 +9613,7 @@
// CHECK-LABEL: @test_vqaddq_s16(
// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %a to <16 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <8 x i16> %b to <16 x i8>
-// CHECK: [[VQADDQ_V2_I:%.*]] = call <8 x i16> @llvm.arm.neon.vqadds.v8i16(<8 x i16> %a, <8 x i16> %b)
+// CHECK: [[VQADDQ_V2_I:%.*]] = call <8 x i16> @llvm.sadd.sat.v8i16(<8 x i16> %a, <8 x i16> %b)
// CHECK: [[VQADDQ_V3_I:%.*]] = bitcast <8 x i16> [[VQADDQ_V2_I]] to <16 x i8>
// CHECK: ret <8 x i16> [[VQADDQ_V2_I]]
int16x8_t test_vqaddq_s16(int16x8_t a, int16x8_t b) {
@@ -9651,7 +9623,7 @@
// CHECK-LABEL: @test_vqaddq_s32(
// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %a to <16 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <4 x i32> %b to <16 x i8>
-// CHECK: [[VQADDQ_V2_I:%.*]] = call <4 x i32> @llvm.arm.neon.vqadds.v4i32(<4 x i32> %a, <4 x i32> %b)
+// CHECK: [[VQADDQ_V2_I:%.*]] = call <4 x i32> @llvm.sadd.sat.v4i32(<4 x i32> %a, <4 x i32> %b)
// CHECK: [[VQADDQ_V3_I:%.*]] = bitcast <4 x i32> [[VQADDQ_V2_I]] to <16 x i8>
// CHECK: ret <4 x i32> [[VQADDQ_V2_I]]
int32x4_t test_vqaddq_s32(int32x4_t a, int32x4_t b) {
@@ -9661,7 +9633,7 @@
// CHECK-LABEL: @test_vqaddq_s64(
// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %a to <16 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <2 x i64> %b to <16 x i8>
-// CHECK: [[VQADDQ_V2_I:%.*]] = call <2 x i64> @llvm.arm.neon.vqadds.v2i64(<2 x i64> %a, <2 x i64> %b)
+// CHECK: [[VQADDQ_V2_I:%.*]] = call <2 x i64> @llvm.sadd.sat.v2i64(<2 x i64> %a, <2 x i64> %b)
// CHECK: [[VQADDQ_V3_I:%.*]] = bitcast <2 x i64> [[VQADDQ_V2_I]] to <16 x i8>
// CHECK: ret <2 x i64> [[VQADDQ_V2_I]]
int64x2_t test_vqaddq_s64(int64x2_t a, int64x2_t b) {
@@ -9669,7 +9641,7 @@
}
// CHECK-LABEL: @test_vqaddq_u8(
-// CHECK: [[VQADDQ_V_I:%.*]] = call <16 x i8> @llvm.arm.neon.vqaddu.v16i8(<16 x i8> %a, <16 x i8> %b)
+// CHECK: [[VQADDQ_V_I:%.*]] = call <16 x i8> @llvm.uadd.sat.v16i8(<16 x i8> %a, <16 x i8> %b)
// CHECK: ret <16 x i8> [[VQADDQ_V_I]]
uint8x16_t test_vqaddq_u8(uint8x16_t a, uint8x16_t b) {
return vqaddq_u8(a, b);
@@ -9678,7 +9650,7 @@
// CHECK-LABEL: @test_vqaddq_u16(
// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %a to <16 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <8 x i16> %b to <16 x i8>
-// CHECK: [[VQADDQ_V2_I:%.*]] = call <8 x i16> @llvm.arm.neon.vqaddu.v8i16(<8 x i16> %a, <8 x i16> %b)
+// CHECK: [[VQADDQ_V2_I:%.*]] = call <8 x i16> @llvm.uadd.sat.v8i16(<8 x i16> %a, <8 x i16> %b)
// CHECK: [[VQADDQ_V3_I:%.*]] = bitcast <8 x i16> [[VQADDQ_V2_I]] to <16 x i8>
// CHECK: ret <8 x i16> [[VQADDQ_V2_I]]
uint16x8_t test_vqaddq_u16(uint16x8_t a, uint16x8_t b) {
@@ -9688,7 +9660,7 @@
// CHECK-LABEL: @test_vqaddq_u32(
// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %a to <16 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <4 x i32> %b to <16 x i8>
-// CHECK: [[VQADDQ_V2_I:%.*]] = call <4 x i32> @llvm.arm.neon.vqaddu.v4i32(<4 x i32> %a, <4 x i32> %b)
+// CHECK: [[VQADDQ_V2_I:%.*]] = call <4 x i32> @llvm.uadd.sat.v4i32(<4 x i32> %a, <4 x i32> %b)
// CHECK: [[VQADDQ_V3_I:%.*]] = bitcast <4 x i32> [[VQADDQ_V2_I]] to <16 x i8>
// CHECK: ret <4 x i32> [[VQADDQ_V2_I]]
uint32x4_t test_vqaddq_u32(uint32x4_t a, uint32x4_t b) {
@@ -9698,7 +9670,7 @@
// CHECK-LABEL: @test_vqaddq_u64(
// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %a to <16 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <2 x i64> %b to <16 x i8>
-// CHECK: [[VQADDQ_V2_I:%.*]] = call <2 x i64> @llvm.arm.neon.vqaddu.v2i64(<2 x i64> %a, <2 x i64> %b)
+// CHECK: [[VQADDQ_V2_I:%.*]] = call <2 x i64> @llvm.uadd.sat.v2i64(<2 x i64> %a, <2 x i64> %b)
// CHECK: [[VQADDQ_V3_I:%.*]] = bitcast <2 x i64> [[VQADDQ_V2_I]] to <16 x i8>
// CHECK: ret <2 x i64> [[VQADDQ_V2_I]]
uint64x2_t test_vqaddq_u64(uint64x2_t a, uint64x2_t b) {
@@ -9710,7 +9682,7 @@
// CHECK: [[TMP1:%.*]] = bitcast <4 x i16> %b to <8 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <4 x i16> %c to <8 x i8>
// CHECK: [[VQDMLAL2_I:%.*]] = call <4 x i32> @llvm.arm.neon.vqdmull.v4i32(<4 x i16> %b, <4 x i16> %c)
-// CHECK: [[VQDMLAL_V3_I:%.*]] = call <4 x i32> @llvm.arm.neon.vqadds.v4i32(<4 x i32> %a, <4 x i32> [[VQDMLAL2_I]])
+// CHECK: [[VQDMLAL_V3_I:%.*]] = call <4 x i32> @llvm.sadd.sat.v4i32(<4 x i32> %a, <4 x i32> [[VQDMLAL2_I]])
// CHECK: ret <4 x i32> [[VQDMLAL_V3_I]]
int32x4_t test_vqdmlal_s16(int32x4_t a, int16x4_t b, int16x4_t c) {
return vqdmlal_s16(a, b, c);
@@ -9721,7 +9693,7 @@
// CHECK: [[TMP1:%.*]] = bitcast <2 x i32> %b to <8 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <2 x i32> %c to <8 x i8>
// CHECK: [[VQDMLAL2_I:%.*]] = call <2 x i64> @llvm.arm.neon.vqdmull.v2i64(<2 x i32> %b, <2 x i32> %c)
-// CHECK: [[VQDMLAL_V3_I:%.*]] = call <2 x i64> @llvm.arm.neon.vqadds.v2i64(<2 x i64> %a, <2 x i64> [[VQDMLAL2_I]])
+// CHECK: [[VQDMLAL_V3_I:%.*]] = call <2 x i64> @llvm.sadd.sat.v2i64(<2 x i64> %a, <2 x i64> [[VQDMLAL2_I]])
// CHECK: ret <2 x i64> [[VQDMLAL_V3_I]]
int64x2_t test_vqdmlal_s32(int64x2_t a, int32x2_t b, int32x2_t c) {
return vqdmlal_s32(a, b, c);
@@ -9733,7 +9705,7 @@
// CHECK: [[TMP1:%.*]] = bitcast <4 x i16> %b to <8 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <4 x i16> [[SHUFFLE]] to <8 x i8>
// CHECK: [[VQDMLAL2_I:%.*]] = call <4 x i32> @llvm.arm.neon.vqdmull.v4i32(<4 x i16> %b, <4 x i16> [[SHUFFLE]])
-// CHECK: [[VQDMLAL_V3_I:%.*]] = call <4 x i32> @llvm.arm.neon.vqadds.v4i32(<4 x i32> %a, <4 x i32> [[VQDMLAL2_I]])
+// CHECK: [[VQDMLAL_V3_I:%.*]] = call <4 x i32> @llvm.sadd.sat.v4i32(<4 x i32> %a, <4 x i32> [[VQDMLAL2_I]])
// CHECK: ret <4 x i32> [[VQDMLAL_V3_I]]
int32x4_t test_vqdmlal_lane_s16(int32x4_t a, int16x4_t b, int16x4_t c) {
return vqdmlal_lane_s16(a, b, c, 3);
@@ -9745,35 +9717,35 @@
// CHECK: [[TMP1:%.*]] = bitcast <2 x i32> %b to <8 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <2 x i32> [[SHUFFLE]] to <8 x i8>
// CHECK: [[VQDMLAL2_I:%.*]] = call <2 x i64> @llvm.arm.neon.vqdmull.v2i64(<2 x i32> %b, <2 x i32> [[SHUFFLE]])
-// CHECK: [[VQDMLAL_V3_I:%.*]] = call <2 x i64> @llvm.arm.neon.vqadds.v2i64(<2 x i64> %a, <2 x i64> [[VQDMLAL2_I]])
+// CHECK: [[VQDMLAL_V3_I:%.*]] = call <2 x i64> @llvm.sadd.sat.v2i64(<2 x i64> %a, <2 x i64> [[VQDMLAL2_I]])
// CHECK: ret <2 x i64> [[VQDMLAL_V3_I]]
int64x2_t test_vqdmlal_lane_s32(int64x2_t a, int32x2_t b, int32x2_t c) {
return vqdmlal_lane_s32(a, b, c, 1);
}
// CHECK-LABEL: @test_vqdmlal_n_s16(
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %a to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <4 x i16> %b to <8 x i8>
// CHECK: [[VECINIT_I:%.*]] = insertelement <4 x i16> undef, i16 %c, i32 0
// CHECK: [[VECINIT1_I:%.*]] = insertelement <4 x i16> [[VECINIT_I]], i16 %c, i32 1
// CHECK: [[VECINIT2_I:%.*]] = insertelement <4 x i16> [[VECINIT1_I]], i16 %c, i32 2
// CHECK: [[VECINIT3_I:%.*]] = insertelement <4 x i16> [[VECINIT2_I]], i16 %c, i32 3
+// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %a to <16 x i8>
+// CHECK: [[TMP1:%.*]] = bitcast <4 x i16> %b to <8 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <4 x i16> [[VECINIT3_I]] to <8 x i8>
// CHECK: [[VQDMLAL5_I:%.*]] = call <4 x i32> @llvm.arm.neon.vqdmull.v4i32(<4 x i16> %b, <4 x i16> [[VECINIT3_I]])
-// CHECK: [[VQDMLAL_V6_I:%.*]] = call <4 x i32> @llvm.arm.neon.vqadds.v4i32(<4 x i32> %a, <4 x i32> [[VQDMLAL5_I]])
+// CHECK: [[VQDMLAL_V6_I:%.*]] = call <4 x i32> @llvm.sadd.sat.v4i32(<4 x i32> %a, <4 x i32> [[VQDMLAL5_I]])
// CHECK: ret <4 x i32> [[VQDMLAL_V6_I]]
int32x4_t test_vqdmlal_n_s16(int32x4_t a, int16x4_t b, int16_t c) {
return vqdmlal_n_s16(a, b, c);
}
// CHECK-LABEL: @test_vqdmlal_n_s32(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %a to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <2 x i32> %b to <8 x i8>
// CHECK: [[VECINIT_I:%.*]] = insertelement <2 x i32> undef, i32 %c, i32 0
// CHECK: [[VECINIT1_I:%.*]] = insertelement <2 x i32> [[VECINIT_I]], i32 %c, i32 1
+// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %a to <16 x i8>
+// CHECK: [[TMP1:%.*]] = bitcast <2 x i32> %b to <8 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <2 x i32> [[VECINIT1_I]] to <8 x i8>
// CHECK: [[VQDMLAL3_I:%.*]] = call <2 x i64> @llvm.arm.neon.vqdmull.v2i64(<2 x i32> %b, <2 x i32> [[VECINIT1_I]])
-// CHECK: [[VQDMLAL_V4_I:%.*]] = call <2 x i64> @llvm.arm.neon.vqadds.v2i64(<2 x i64> %a, <2 x i64> [[VQDMLAL3_I]])
+// CHECK: [[VQDMLAL_V4_I:%.*]] = call <2 x i64> @llvm.sadd.sat.v2i64(<2 x i64> %a, <2 x i64> [[VQDMLAL3_I]])
// CHECK: ret <2 x i64> [[VQDMLAL_V4_I]]
int64x2_t test_vqdmlal_n_s32(int64x2_t a, int32x2_t b, int32_t c) {
return vqdmlal_n_s32(a, b, c);
@@ -9784,7 +9756,7 @@
// CHECK: [[TMP1:%.*]] = bitcast <4 x i16> %b to <8 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <4 x i16> %c to <8 x i8>
// CHECK: [[VQDMLAL2_I:%.*]] = call <4 x i32> @llvm.arm.neon.vqdmull.v4i32(<4 x i16> %b, <4 x i16> %c)
-// CHECK: [[VQDMLSL_V3_I:%.*]] = call <4 x i32> @llvm.arm.neon.vqsubs.v4i32(<4 x i32> %a, <4 x i32> [[VQDMLAL2_I]])
+// CHECK: [[VQDMLSL_V3_I:%.*]] = call <4 x i32> @llvm.ssub.sat.v4i32(<4 x i32> %a, <4 x i32> [[VQDMLAL2_I]])
// CHECK: ret <4 x i32> [[VQDMLSL_V3_I]]
int32x4_t test_vqdmlsl_s16(int32x4_t a, int16x4_t b, int16x4_t c) {
return vqdmlsl_s16(a, b, c);
@@ -9795,7 +9767,7 @@
// CHECK: [[TMP1:%.*]] = bitcast <2 x i32> %b to <8 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <2 x i32> %c to <8 x i8>
// CHECK: [[VQDMLAL2_I:%.*]] = call <2 x i64> @llvm.arm.neon.vqdmull.v2i64(<2 x i32> %b, <2 x i32> %c)
-// CHECK: [[VQDMLSL_V3_I:%.*]] = call <2 x i64> @llvm.arm.neon.vqsubs.v2i64(<2 x i64> %a, <2 x i64> [[VQDMLAL2_I]])
+// CHECK: [[VQDMLSL_V3_I:%.*]] = call <2 x i64> @llvm.ssub.sat.v2i64(<2 x i64> %a, <2 x i64> [[VQDMLAL2_I]])
// CHECK: ret <2 x i64> [[VQDMLSL_V3_I]]
int64x2_t test_vqdmlsl_s32(int64x2_t a, int32x2_t b, int32x2_t c) {
return vqdmlsl_s32(a, b, c);
@@ -9807,7 +9779,7 @@
// CHECK: [[TMP1:%.*]] = bitcast <4 x i16> %b to <8 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <4 x i16> [[SHUFFLE]] to <8 x i8>
// CHECK: [[VQDMLAL2_I:%.*]] = call <4 x i32> @llvm.arm.neon.vqdmull.v4i32(<4 x i16> %b, <4 x i16> [[SHUFFLE]])
-// CHECK: [[VQDMLSL_V3_I:%.*]] = call <4 x i32> @llvm.arm.neon.vqsubs.v4i32(<4 x i32> %a, <4 x i32> [[VQDMLAL2_I]])
+// CHECK: [[VQDMLSL_V3_I:%.*]] = call <4 x i32> @llvm.ssub.sat.v4i32(<4 x i32> %a, <4 x i32> [[VQDMLAL2_I]])
// CHECK: ret <4 x i32> [[VQDMLSL_V3_I]]
int32x4_t test_vqdmlsl_lane_s16(int32x4_t a, int16x4_t b, int16x4_t c) {
return vqdmlsl_lane_s16(a, b, c, 3);
@@ -9819,35 +9791,35 @@
// CHECK: [[TMP1:%.*]] = bitcast <2 x i32> %b to <8 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <2 x i32> [[SHUFFLE]] to <8 x i8>
// CHECK: [[VQDMLAL2_I:%.*]] = call <2 x i64> @llvm.arm.neon.vqdmull.v2i64(<2 x i32> %b, <2 x i32> [[SHUFFLE]])
-// CHECK: [[VQDMLSL_V3_I:%.*]] = call <2 x i64> @llvm.arm.neon.vqsubs.v2i64(<2 x i64> %a, <2 x i64> [[VQDMLAL2_I]])
+// CHECK: [[VQDMLSL_V3_I:%.*]] = call <2 x i64> @llvm.ssub.sat.v2i64(<2 x i64> %a, <2 x i64> [[VQDMLAL2_I]])
// CHECK: ret <2 x i64> [[VQDMLSL_V3_I]]
int64x2_t test_vqdmlsl_lane_s32(int64x2_t a, int32x2_t b, int32x2_t c) {
return vqdmlsl_lane_s32(a, b, c, 1);
}
// CHECK-LABEL: @test_vqdmlsl_n_s16(
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %a to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <4 x i16> %b to <8 x i8>
// CHECK: [[VECINIT_I:%.*]] = insertelement <4 x i16> undef, i16 %c, i32 0
// CHECK: [[VECINIT1_I:%.*]] = insertelement <4 x i16> [[VECINIT_I]], i16 %c, i32 1
// CHECK: [[VECINIT2_I:%.*]] = insertelement <4 x i16> [[VECINIT1_I]], i16 %c, i32 2
// CHECK: [[VECINIT3_I:%.*]] = insertelement <4 x i16> [[VECINIT2_I]], i16 %c, i32 3
+// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %a to <16 x i8>
+// CHECK: [[TMP1:%.*]] = bitcast <4 x i16> %b to <8 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <4 x i16> [[VECINIT3_I]] to <8 x i8>
// CHECK: [[VQDMLAL5_I:%.*]] = call <4 x i32> @llvm.arm.neon.vqdmull.v4i32(<4 x i16> %b, <4 x i16> [[VECINIT3_I]])
-// CHECK: [[VQDMLSL_V6_I:%.*]] = call <4 x i32> @llvm.arm.neon.vqsubs.v4i32(<4 x i32> %a, <4 x i32> [[VQDMLAL5_I]])
+// CHECK: [[VQDMLSL_V6_I:%.*]] = call <4 x i32> @llvm.ssub.sat.v4i32(<4 x i32> %a, <4 x i32> [[VQDMLAL5_I]])
// CHECK: ret <4 x i32> [[VQDMLSL_V6_I]]
int32x4_t test_vqdmlsl_n_s16(int32x4_t a, int16x4_t b, int16_t c) {
return vqdmlsl_n_s16(a, b, c);
}
// CHECK-LABEL: @test_vqdmlsl_n_s32(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %a to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <2 x i32> %b to <8 x i8>
// CHECK: [[VECINIT_I:%.*]] = insertelement <2 x i32> undef, i32 %c, i32 0
// CHECK: [[VECINIT1_I:%.*]] = insertelement <2 x i32> [[VECINIT_I]], i32 %c, i32 1
+// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %a to <16 x i8>
+// CHECK: [[TMP1:%.*]] = bitcast <2 x i32> %b to <8 x i8>
// CHECK: [[TMP2:%.*]] = bitcast <2 x i32> [[VECINIT1_I]] to <8 x i8>
// CHECK: [[VQDMLAL3_I:%.*]] = call <2 x i64> @llvm.arm.neon.vqdmull.v2i64(<2 x i32> %b, <2 x i32> [[VECINIT1_I]])
-// CHECK: [[VQDMLSL_V4_I:%.*]] = call <2 x i64> @llvm.arm.neon.vqsubs.v2i64(<2 x i64> %a, <2 x i64> [[VQDMLAL3_I]])
+// CHECK: [[VQDMLSL_V4_I:%.*]] = call <2 x i64> @llvm.ssub.sat.v2i64(<2 x i64> %a, <2 x i64> [[VQDMLAL3_I]])
// CHECK: ret <2 x i64> [[VQDMLSL_V4_I]]
int64x2_t test_vqdmlsl_n_s32(int64x2_t a, int32x2_t b, int32_t c) {
return vqdmlsl_n_s32(a, b, c);
@@ -9938,11 +9910,11 @@
}
// CHECK-LABEL: @test_vqdmulh_n_s16(
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %a to <8 x i8>
// CHECK: [[VECINIT_I:%.*]] = insertelement <4 x i16> undef, i16 %b, i32 0
// CHECK: [[VECINIT1_I:%.*]] = insertelement <4 x i16> [[VECINIT_I]], i16 %b, i32 1
// CHECK: [[VECINIT2_I:%.*]] = insertelement <4 x i16> [[VECINIT1_I]], i16 %b, i32 2
// CHECK: [[VECINIT3_I:%.*]] = insertelement <4 x i16> [[VECINIT2_I]], i16 %b, i32 3
+// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <4 x i16> [[VECINIT3_I]] to <8 x i8>
// CHECK: [[VQDMULH_V5_I:%.*]] = call <4 x i16> @llvm.arm.neon.vqdmulh.v4i16(<4 x i16> %a, <4 x i16> [[VECINIT3_I]])
// CHECK: [[VQDMULH_V6_I:%.*]] = bitcast <4 x i16> [[VQDMULH_V5_I]] to <8 x i8>
@@ -9952,9 +9924,9 @@
}
// CHECK-LABEL: @test_vqdmulh_n_s32(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8>
// CHECK: [[VECINIT_I:%.*]] = insertelement <2 x i32> undef, i32 %b, i32 0
// CHECK: [[VECINIT1_I:%.*]] = insertelement <2 x i32> [[VECINIT_I]], i32 %b, i32 1
+// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <2 x i32> [[VECINIT1_I]] to <8 x i8>
// CHECK: [[VQDMULH_V3_I:%.*]] = call <2 x i32> @llvm.arm.neon.vqdmulh.v2i32(<2 x i32> %a, <2 x i32> [[VECINIT1_I]])
// CHECK: [[VQDMULH_V4_I:%.*]] = bitcast <2 x i32> [[VQDMULH_V3_I]] to <8 x i8>
@@ -9964,7 +9936,6 @@
}
// CHECK-LABEL: @test_vqdmulhq_n_s16(
-// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %a to <16 x i8>
// CHECK: [[VECINIT_I:%.*]] = insertelement <8 x i16> undef, i16 %b, i32 0
// CHECK: [[VECINIT1_I:%.*]] = insertelement <8 x i16> [[VECINIT_I]], i16 %b, i32 1
// CHECK: [[VECINIT2_I:%.*]] = insertelement <8 x i16> [[VECINIT1_I]], i16 %b, i32 2
@@ -9973,6 +9944,7 @@
// CHECK: [[VECINIT5_I:%.*]] = insertelement <8 x i16> [[VECINIT4_I]], i16 %b, i32 5
// CHECK: [[VECINIT6_I:%.*]] = insertelement <8 x i16> [[VECINIT5_I]], i16 %b, i32 6
// CHECK: [[VECINIT7_I:%.*]] = insertelement <8 x i16> [[VECINIT6_I]], i16 %b, i32 7
+// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %a to <16 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <8 x i16> [[VECINIT7_I]] to <16 x i8>
// CHECK: [[VQDMULHQ_V9_I:%.*]] = call <8 x i16> @llvm.arm.neon.vqdmulh.v8i16(<8 x i16> %a, <8 x i16> [[VECINIT7_I]])
// CHECK: [[VQDMULHQ_V10_I:%.*]] = bitcast <8 x i16> [[VQDMULHQ_V9_I]] to <16 x i8>
@@ -9982,11 +9954,11 @@
}
// CHECK-LABEL: @test_vqdmulhq_n_s32(
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %a to <16 x i8>
// CHECK: [[VECINIT_I:%.*]] = insertelement <4 x i32> undef, i32 %b, i32 0
// CHECK: [[VECINIT1_I:%.*]] = insertelement <4 x i32> [[VECINIT_I]], i32 %b, i32 1
// CHECK: [[VECINIT2_I:%.*]] = insertelement <4 x i32> [[VECINIT1_I]], i32 %b, i32 2
// CHECK: [[VECINIT3_I:%.*]] = insertelement <4 x i32> [[VECINIT2_I]], i32 %b, i32 3
+// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %a to <16 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <4 x i32> [[VECINIT3_I]] to <16 x i8>
// CHECK: [[VQDMULHQ_V5_I:%.*]] = call <4 x i32> @llvm.arm.neon.vqdmulh.v4i32(<4 x i32> %a, <4 x i32> [[VECINIT3_I]])
// CHECK: [[VQDMULHQ_V6_I:%.*]] = bitcast <4 x i32> [[VQDMULHQ_V5_I]] to <16 x i8>
@@ -10038,11 +10010,11 @@
}
// CHECK-LABEL: @test_vqdmull_n_s16(
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %a to <8 x i8>
// CHECK: [[VECINIT_I:%.*]] = insertelement <4 x i16> undef, i16 %b, i32 0
// CHECK: [[VECINIT1_I:%.*]] = insertelement <4 x i16> [[VECINIT_I]], i16 %b, i32 1
// CHECK: [[VECINIT2_I:%.*]] = insertelement <4 x i16> [[VECINIT1_I]], i16 %b, i32 2
// CHECK: [[VECINIT3_I:%.*]] = insertelement <4 x i16> [[VECINIT2_I]], i16 %b, i32 3
+// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <4 x i16> [[VECINIT3_I]] to <8 x i8>
// CHECK: [[VQDMULL_V5_I:%.*]] = call <4 x i32> @llvm.arm.neon.vqdmull.v4i32(<4 x i16> %a, <4 x i16> [[VECINIT3_I]])
// CHECK: [[VQDMULL_V6_I:%.*]] = bitcast <4 x i32> [[VQDMULL_V5_I]] to <16 x i8>
@@ -10052,9 +10024,9 @@
}
// CHECK-LABEL: @test_vqdmull_n_s32(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8>
// CHECK: [[VECINIT_I:%.*]] = insertelement <2 x i32> undef, i32 %b, i32 0
// CHECK: [[VECINIT1_I:%.*]] = insertelement <2 x i32> [[VECINIT_I]], i32 %b, i32 1
+// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <2 x i32> [[VECINIT1_I]] to <8 x i8>
// CHECK: [[VQDMULL_V3_I:%.*]] = call <2 x i64> @llvm.arm.neon.vqdmull.v2i64(<2 x i32> %a, <2 x i32> [[VECINIT1_I]])
// CHECK: [[VQDMULL_V4_I:%.*]] = bitcast <2 x i64> [[VQDMULL_V3_I]] to <16 x i8>
@@ -10276,11 +10248,11 @@
}
// CHECK-LABEL: @test_vqrdmulh_n_s16(
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %a to <8 x i8>
// CHECK: [[VECINIT_I:%.*]] = insertelement <4 x i16> undef, i16 %b, i32 0
// CHECK: [[VECINIT1_I:%.*]] = insertelement <4 x i16> [[VECINIT_I]], i16 %b, i32 1
// CHECK: [[VECINIT2_I:%.*]] = insertelement <4 x i16> [[VECINIT1_I]], i16 %b, i32 2
// CHECK: [[VECINIT3_I:%.*]] = insertelement <4 x i16> [[VECINIT2_I]], i16 %b, i32 3
+// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <4 x i16> [[VECINIT3_I]] to <8 x i8>
// CHECK: [[VQRDMULH_V5_I:%.*]] = call <4 x i16> @llvm.arm.neon.vqrdmulh.v4i16(<4 x i16> %a, <4 x i16> [[VECINIT3_I]])
// CHECK: [[VQRDMULH_V6_I:%.*]] = bitcast <4 x i16> [[VQRDMULH_V5_I]] to <8 x i8>
@@ -10290,9 +10262,9 @@
}
// CHECK-LABEL: @test_vqrdmulh_n_s32(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8>
// CHECK: [[VECINIT_I:%.*]] = insertelement <2 x i32> undef, i32 %b, i32 0
// CHECK: [[VECINIT1_I:%.*]] = insertelement <2 x i32> [[VECINIT_I]], i32 %b, i32 1
+// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <2 x i32> [[VECINIT1_I]] to <8 x i8>
// CHECK: [[VQRDMULH_V3_I:%.*]] = call <2 x i32> @llvm.arm.neon.vqrdmulh.v2i32(<2 x i32> %a, <2 x i32> [[VECINIT1_I]])
// CHECK: [[VQRDMULH_V4_I:%.*]] = bitcast <2 x i32> [[VQRDMULH_V3_I]] to <8 x i8>
@@ -10302,7 +10274,6 @@
}
// CHECK-LABEL: @test_vqrdmulhq_n_s16(
-// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %a to <16 x i8>
// CHECK: [[VECINIT_I:%.*]] = insertelement <8 x i16> undef, i16 %b, i32 0
// CHECK: [[VECINIT1_I:%.*]] = insertelement <8 x i16> [[VECINIT_I]], i16 %b, i32 1
// CHECK: [[VECINIT2_I:%.*]] = insertelement <8 x i16> [[VECINIT1_I]], i16 %b, i32 2
@@ -10311,6 +10282,7 @@
// CHECK: [[VECINIT5_I:%.*]] = insertelement <8 x i16> [[VECINIT4_I]], i16 %b, i32 5
// CHECK: [[VECINIT6_I:%.*]] = insertelement <8 x i16> [[VECINIT5_I]], i16 %b, i32 6
// CHECK: [[VECINIT7_I:%.*]] = insertelement <8 x i16> [[VECINIT6_I]], i16 %b, i32 7
+// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %a to <16 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <8 x i16> [[VECINIT7_I]] to <16 x i8>
// CHECK: [[VQRDMULHQ_V9_I:%.*]] = call <8 x i16> @llvm.arm.neon.vqrdmulh.v8i16(<8 x i16> %a, <8 x i16> [[VECINIT7_I]])
// CHECK: [[VQRDMULHQ_V10_I:%.*]] = bitcast <8 x i16> [[VQRDMULHQ_V9_I]] to <16 x i8>
@@ -10320,11 +10292,11 @@
}
// CHECK-LABEL: @test_vqrdmulhq_n_s32(
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %a to <16 x i8>
// CHECK: [[VECINIT_I:%.*]] = insertelement <4 x i32> undef, i32 %b, i32 0
// CHECK: [[VECINIT1_I:%.*]] = insertelement <4 x i32> [[VECINIT_I]], i32 %b, i32 1
// CHECK: [[VECINIT2_I:%.*]] = insertelement <4 x i32> [[VECINIT1_I]], i32 %b, i32 2
// CHECK: [[VECINIT3_I:%.*]] = insertelement <4 x i32> [[VECINIT2_I]], i32 %b, i32 3
+// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %a to <16 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <4 x i32> [[VECINIT3_I]] to <16 x i8>
// CHECK: [[VQRDMULHQ_V5_I:%.*]] = call <4 x i32> @llvm.arm.neon.vqrdmulh.v4i32(<4 x i32> %a, <4 x i32> [[VECINIT3_I]])
// CHECK: [[VQRDMULHQ_V6_I:%.*]] = bitcast <4 x i32> [[VQRDMULHQ_V5_I]] to <16 x i8>
@@ -10996,7 +10968,7 @@
}
// CHECK-LABEL: @test_vqsub_s8(
-// CHECK: [[VQSUB_V_I:%.*]] = call <8 x i8> @llvm.arm.neon.vqsubs.v8i8(<8 x i8> %a, <8 x i8> %b)
+// CHECK: [[VQSUB_V_I:%.*]] = call <8 x i8> @llvm.ssub.sat.v8i8(<8 x i8> %a, <8 x i8> %b)
// CHECK: ret <8 x i8> [[VQSUB_V_I]]
int8x8_t test_vqsub_s8(int8x8_t a, int8x8_t b) {
return vqsub_s8(a, b);
@@ -11005,7 +10977,7 @@
// CHECK-LABEL: @test_vqsub_s16(
// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <4 x i16> %b to <8 x i8>
-// CHECK: [[VQSUB_V2_I:%.*]] = call <4 x i16> @llvm.arm.neon.vqsubs.v4i16(<4 x i16> %a, <4 x i16> %b)
+// CHECK: [[VQSUB_V2_I:%.*]] = call <4 x i16> @llvm.ssub.sat.v4i16(<4 x i16> %a, <4 x i16> %b)
// CHECK: [[VQSUB_V3_I:%.*]] = bitcast <4 x i16> [[VQSUB_V2_I]] to <8 x i8>
// CHECK: ret <4 x i16> [[VQSUB_V2_I]]
int16x4_t test_vqsub_s16(int16x4_t a, int16x4_t b) {
@@ -11015,7 +10987,7 @@
// CHECK-LABEL: @test_vqsub_s32(
// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <2 x i32> %b to <8 x i8>
-// CHECK: [[VQSUB_V2_I:%.*]] = call <2 x i32> @llvm.arm.neon.vqsubs.v2i32(<2 x i32> %a, <2 x i32> %b)
+// CHECK: [[VQSUB_V2_I:%.*]] = call <2 x i32> @llvm.ssub.sat.v2i32(<2 x i32> %a, <2 x i32> %b)
// CHECK: [[VQSUB_V3_I:%.*]] = bitcast <2 x i32> [[VQSUB_V2_I]] to <8 x i8>
// CHECK: ret <2 x i32> [[VQSUB_V2_I]]
int32x2_t test_vqsub_s32(int32x2_t a, int32x2_t b) {
@@ -11025,7 +10997,7 @@
// CHECK-LABEL: @test_vqsub_s64(
// CHECK: [[TMP0:%.*]] = bitcast <1 x i64> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <1 x i64> %b to <8 x i8>
-// CHECK: [[VQSUB_V2_I:%.*]] = call <1 x i64> @llvm.arm.neon.vqsubs.v1i64(<1 x i64> %a, <1 x i64> %b)
+// CHECK: [[VQSUB_V2_I:%.*]] = call <1 x i64> @llvm.ssub.sat.v1i64(<1 x i64> %a, <1 x i64> %b)
// CHECK: [[VQSUB_V3_I:%.*]] = bitcast <1 x i64> [[VQSUB_V2_I]] to <8 x i8>
// CHECK: ret <1 x i64> [[VQSUB_V2_I]]
int64x1_t test_vqsub_s64(int64x1_t a, int64x1_t b) {
@@ -11033,7 +11005,7 @@
}
// CHECK-LABEL: @test_vqsub_u8(
-// CHECK: [[VQSUB_V_I:%.*]] = call <8 x i8> @llvm.arm.neon.vqsubu.v8i8(<8 x i8> %a, <8 x i8> %b)
+// CHECK: [[VQSUB_V_I:%.*]] = call <8 x i8> @llvm.usub.sat.v8i8(<8 x i8> %a, <8 x i8> %b)
// CHECK: ret <8 x i8> [[VQSUB_V_I]]
uint8x8_t test_vqsub_u8(uint8x8_t a, uint8x8_t b) {
return vqsub_u8(a, b);
@@ -11042,7 +11014,7 @@
// CHECK-LABEL: @test_vqsub_u16(
// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <4 x i16> %b to <8 x i8>
-// CHECK: [[VQSUB_V2_I:%.*]] = call <4 x i16> @llvm.arm.neon.vqsubu.v4i16(<4 x i16> %a, <4 x i16> %b)
+// CHECK: [[VQSUB_V2_I:%.*]] = call <4 x i16> @llvm.usub.sat.v4i16(<4 x i16> %a, <4 x i16> %b)
// CHECK: [[VQSUB_V3_I:%.*]] = bitcast <4 x i16> [[VQSUB_V2_I]] to <8 x i8>
// CHECK: ret <4 x i16> [[VQSUB_V2_I]]
uint16x4_t test_vqsub_u16(uint16x4_t a, uint16x4_t b) {
@@ -11052,7 +11024,7 @@
// CHECK-LABEL: @test_vqsub_u32(
// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <2 x i32> %b to <8 x i8>
-// CHECK: [[VQSUB_V2_I:%.*]] = call <2 x i32> @llvm.arm.neon.vqsubu.v2i32(<2 x i32> %a, <2 x i32> %b)
+// CHECK: [[VQSUB_V2_I:%.*]] = call <2 x i32> @llvm.usub.sat.v2i32(<2 x i32> %a, <2 x i32> %b)
// CHECK: [[VQSUB_V3_I:%.*]] = bitcast <2 x i32> [[VQSUB_V2_I]] to <8 x i8>
// CHECK: ret <2 x i32> [[VQSUB_V2_I]]
uint32x2_t test_vqsub_u32(uint32x2_t a, uint32x2_t b) {
@@ -11062,7 +11034,7 @@
// CHECK-LABEL: @test_vqsub_u64(
// CHECK: [[TMP0:%.*]] = bitcast <1 x i64> %a to <8 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <1 x i64> %b to <8 x i8>
-// CHECK: [[VQSUB_V2_I:%.*]] = call <1 x i64> @llvm.arm.neon.vqsubu.v1i64(<1 x i64> %a, <1 x i64> %b)
+// CHECK: [[VQSUB_V2_I:%.*]] = call <1 x i64> @llvm.usub.sat.v1i64(<1 x i64> %a, <1 x i64> %b)
// CHECK: [[VQSUB_V3_I:%.*]] = bitcast <1 x i64> [[VQSUB_V2_I]] to <8 x i8>
// CHECK: ret <1 x i64> [[VQSUB_V2_I]]
uint64x1_t test_vqsub_u64(uint64x1_t a, uint64x1_t b) {
@@ -11070,7 +11042,7 @@
}
// CHECK-LABEL: @test_vqsubq_s8(
-// CHECK: [[VQSUBQ_V_I:%.*]] = call <16 x i8> @llvm.arm.neon.vqsubs.v16i8(<16 x i8> %a, <16 x i8> %b)
+// CHECK: [[VQSUBQ_V_I:%.*]] = call <16 x i8> @llvm.ssub.sat.v16i8(<16 x i8> %a, <16 x i8> %b)
// CHECK: ret <16 x i8> [[VQSUBQ_V_I]]
int8x16_t test_vqsubq_s8(int8x16_t a, int8x16_t b) {
return vqsubq_s8(a, b);
@@ -11079,7 +11051,7 @@
// CHECK-LABEL: @test_vqsubq_s16(
// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %a to <16 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <8 x i16> %b to <16 x i8>
-// CHECK: [[VQSUBQ_V2_I:%.*]] = call <8 x i16> @llvm.arm.neon.vqsubs.v8i16(<8 x i16> %a, <8 x i16> %b)
+// CHECK: [[VQSUBQ_V2_I:%.*]] = call <8 x i16> @llvm.ssub.sat.v8i16(<8 x i16> %a, <8 x i16> %b)
// CHECK: [[VQSUBQ_V3_I:%.*]] = bitcast <8 x i16> [[VQSUBQ_V2_I]] to <16 x i8>
// CHECK: ret <8 x i16> [[VQSUBQ_V2_I]]
int16x8_t test_vqsubq_s16(int16x8_t a, int16x8_t b) {
@@ -11089,7 +11061,7 @@
// CHECK-LABEL: @test_vqsubq_s32(
// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %a to <16 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <4 x i32> %b to <16 x i8>
-// CHECK: [[VQSUBQ_V2_I:%.*]] = call <4 x i32> @llvm.arm.neon.vqsubs.v4i32(<4 x i32> %a, <4 x i32> %b)
+// CHECK: [[VQSUBQ_V2_I:%.*]] = call <4 x i32> @llvm.ssub.sat.v4i32(<4 x i32> %a, <4 x i32> %b)
// CHECK: [[VQSUBQ_V3_I:%.*]] = bitcast <4 x i32> [[VQSUBQ_V2_I]] to <16 x i8>
// CHECK: ret <4 x i32> [[VQSUBQ_V2_I]]
int32x4_t test_vqsubq_s32(int32x4_t a, int32x4_t b) {
@@ -11099,7 +11071,7 @@
// CHECK-LABEL: @test_vqsubq_s64(
// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %a to <16 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <2 x i64> %b to <16 x i8>
-// CHECK: [[VQSUBQ_V2_I:%.*]] = call <2 x i64> @llvm.arm.neon.vqsubs.v2i64(<2 x i64> %a, <2 x i64> %b)
+// CHECK: [[VQSUBQ_V2_I:%.*]] = call <2 x i64> @llvm.ssub.sat.v2i64(<2 x i64> %a, <2 x i64> %b)
// CHECK: [[VQSUBQ_V3_I:%.*]] = bitcast <2 x i64> [[VQSUBQ_V2_I]] to <16 x i8>
// CHECK: ret <2 x i64> [[VQSUBQ_V2_I]]
int64x2_t test_vqsubq_s64(int64x2_t a, int64x2_t b) {
@@ -11107,7 +11079,7 @@
}
// CHECK-LABEL: @test_vqsubq_u8(
-// CHECK: [[VQSUBQ_V_I:%.*]] = call <16 x i8> @llvm.arm.neon.vqsubu.v16i8(<16 x i8> %a, <16 x i8> %b)
+// CHECK: [[VQSUBQ_V_I:%.*]] = call <16 x i8> @llvm.usub.sat.v16i8(<16 x i8> %a, <16 x i8> %b)
// CHECK: ret <16 x i8> [[VQSUBQ_V_I]]
uint8x16_t test_vqsubq_u8(uint8x16_t a, uint8x16_t b) {
return vqsubq_u8(a, b);
@@ -11116,7 +11088,7 @@
// CHECK-LABEL: @test_vqsubq_u16(
// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %a to <16 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <8 x i16> %b to <16 x i8>
-// CHECK: [[VQSUBQ_V2_I:%.*]] = call <8 x i16> @llvm.arm.neon.vqsubu.v8i16(<8 x i16> %a, <8 x i16> %b)
+// CHECK: [[VQSUBQ_V2_I:%.*]] = call <8 x i16> @llvm.usub.sat.v8i16(<8 x i16> %a, <8 x i16> %b)
// CHECK: [[VQSUBQ_V3_I:%.*]] = bitcast <8 x i16> [[VQSUBQ_V2_I]] to <16 x i8>
// CHECK: ret <8 x i16> [[VQSUBQ_V2_I]]
uint16x8_t test_vqsubq_u16(uint16x8_t a, uint16x8_t b) {
@@ -11126,7 +11098,7 @@
// CHECK-LABEL: @test_vqsubq_u32(
// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %a to <16 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <4 x i32> %b to <16 x i8>
-// CHECK: [[VQSUBQ_V2_I:%.*]] = call <4 x i32> @llvm.arm.neon.vqsubu.v4i32(<4 x i32> %a, <4 x i32> %b)
+// CHECK: [[VQSUBQ_V2_I:%.*]] = call <4 x i32> @llvm.usub.sat.v4i32(<4 x i32> %a, <4 x i32> %b)
// CHECK: [[VQSUBQ_V3_I:%.*]] = bitcast <4 x i32> [[VQSUBQ_V2_I]] to <16 x i8>
// CHECK: ret <4 x i32> [[VQSUBQ_V2_I]]
uint32x4_t test_vqsubq_u32(uint32x4_t a, uint32x4_t b) {
@@ -11136,7 +11108,7 @@
// CHECK-LABEL: @test_vqsubq_u64(
// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %a to <16 x i8>
// CHECK: [[TMP1:%.*]] = bitcast <2 x i64> %b to <16 x i8>
-// CHECK: [[VQSUBQ_V2_I:%.*]] = call <2 x i64> @llvm.arm.neon.vqsubu.v2i64(<2 x i64> %a, <2 x i64> %b)
+// CHECK: [[VQSUBQ_V2_I:%.*]] = call <2 x i64> @llvm.usub.sat.v2i64(<2 x i64> %a, <2 x i64> %b)
// CHECK: [[VQSUBQ_V3_I:%.*]] = bitcast <2 x i64> [[VQSUBQ_V2_I]] to <16 x i8>
// CHECK: ret <2 x i64> [[VQSUBQ_V2_I]]
uint64x2_t test_vqsubq_u64(uint64x2_t a, uint64x2_t b) {
@@ -14061,18 +14033,14 @@
}
// CHECK-LABEL: @test_vset_lane_u16(
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %b to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i16> [[TMP1]], i16 %a, i32 3
+// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i16> %b, i16 %a, i32 3
// CHECK: ret <4 x i16> [[VSET_LANE]]
uint16x4_t test_vset_lane_u16(uint16_t a, uint16x4_t b) {
return vset_lane_u16(a, b, 3);
}
// CHECK-LABEL: @test_vset_lane_u32(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %b to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x i32>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i32> [[TMP1]], i32 %a, i32 1
+// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i32> %b, i32 %a, i32 1
// CHECK: ret <2 x i32> [[VSET_LANE]]
uint32x2_t test_vset_lane_u32(uint32_t a, uint32x2_t b) {
return vset_lane_u32(a, b, 1);
@@ -14086,18 +14054,14 @@
}
// CHECK-LABEL: @test_vset_lane_s16(
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %b to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i16> [[TMP1]], i16 %a, i32 3
+// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i16> %b, i16 %a, i32 3
// CHECK: ret <4 x i16> [[VSET_LANE]]
int16x4_t test_vset_lane_s16(int16_t a, int16x4_t b) {
return vset_lane_s16(a, b, 3);
}
// CHECK-LABEL: @test_vset_lane_s32(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %b to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x i32>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i32> [[TMP1]], i32 %a, i32 1
+// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i32> %b, i32 %a, i32 1
// CHECK: ret <2 x i32> [[VSET_LANE]]
int32x2_t test_vset_lane_s32(int32_t a, int32x2_t b) {
return vset_lane_s32(a, b, 1);
@@ -14111,18 +14075,14 @@
}
// CHECK-LABEL: @test_vset_lane_p16(
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %b to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i16> [[TMP1]], i16 %a, i32 3
+// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i16> %b, i16 %a, i32 3
// CHECK: ret <4 x i16> [[VSET_LANE]]
poly16x4_t test_vset_lane_p16(poly16_t a, poly16x4_t b) {
return vset_lane_p16(a, b, 3);
}
// CHECK-LABEL: @test_vset_lane_f32(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %b to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x float>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x float> [[TMP1]], float %a, i32 1
+// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x float> %b, float %a, i32 1
// CHECK: ret <2 x float> [[VSET_LANE]]
float32x2_t test_vset_lane_f32(float32_t a, float32x2_t b) {
return vset_lane_f32(a, b, 1);
@@ -14139,9 +14099,7 @@
// CHECK: [[TMP2:%.*]] = load i16, i16* [[TMP1]], align 2
// CHECK: [[TMP3:%.*]] = bitcast <4 x half>* [[__REINT1_246]] to <4 x i16>*
// CHECK: [[TMP4:%.*]] = load <4 x i16>, <4 x i16>* [[TMP3]], align 8
-// CHECK: [[TMP5:%.*]] = bitcast <4 x i16> [[TMP4]] to <8 x i8>
-// CHECK: [[TMP6:%.*]] = bitcast <8 x i8> [[TMP5]] to <4 x i16>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i16> [[TMP6]], i16 [[TMP2]], i32 1
+// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i16> [[TMP4]], i16 [[TMP2]], i32 1
// CHECK: store <4 x i16> [[VSET_LANE]], <4 x i16>* [[__REINT2_246]], align 8
// CHECK: [[TMP7:%.*]] = bitcast <4 x i16>* [[__REINT2_246]] to <4 x half>*
// CHECK: [[TMP8:%.*]] = load <4 x half>, <4 x half>* [[TMP7]], align 8
@@ -14158,18 +14116,14 @@
}
// CHECK-LABEL: @test_vsetq_lane_u16(
-// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %b to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <8 x i16> [[TMP1]], i16 %a, i32 7
+// CHECK: [[VSET_LANE:%.*]] = insertelement <8 x i16> %b, i16 %a, i32 7
// CHECK: ret <8 x i16> [[VSET_LANE]]
uint16x8_t test_vsetq_lane_u16(uint16_t a, uint16x8_t b) {
return vsetq_lane_u16(a, b, 7);
}
// CHECK-LABEL: @test_vsetq_lane_u32(
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %b to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i32> [[TMP1]], i32 %a, i32 3
+// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i32> %b, i32 %a, i32 3
// CHECK: ret <4 x i32> [[VSET_LANE]]
uint32x4_t test_vsetq_lane_u32(uint32_t a, uint32x4_t b) {
return vsetq_lane_u32(a, b, 3);
@@ -14183,18 +14137,14 @@
}
// CHECK-LABEL: @test_vsetq_lane_s16(
-// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %b to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <8 x i16> [[TMP1]], i16 %a, i32 7
+// CHECK: [[VSET_LANE:%.*]] = insertelement <8 x i16> %b, i16 %a, i32 7
// CHECK: ret <8 x i16> [[VSET_LANE]]
int16x8_t test_vsetq_lane_s16(int16_t a, int16x8_t b) {
return vsetq_lane_s16(a, b, 7);
}
// CHECK-LABEL: @test_vsetq_lane_s32(
-// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %b to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i32> [[TMP1]], i32 %a, i32 3
+// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i32> %b, i32 %a, i32 3
// CHECK: ret <4 x i32> [[VSET_LANE]]
int32x4_t test_vsetq_lane_s32(int32_t a, int32x4_t b) {
return vsetq_lane_s32(a, b, 3);
@@ -14208,18 +14158,14 @@
}
// CHECK-LABEL: @test_vsetq_lane_p16(
-// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %b to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <8 x i16> [[TMP1]], i16 %a, i32 7
+// CHECK: [[VSET_LANE:%.*]] = insertelement <8 x i16> %b, i16 %a, i32 7
// CHECK: ret <8 x i16> [[VSET_LANE]]
poly16x8_t test_vsetq_lane_p16(poly16_t a, poly16x8_t b) {
return vsetq_lane_p16(a, b, 7);
}
// CHECK-LABEL: @test_vsetq_lane_f32(
-// CHECK: [[TMP0:%.*]] = bitcast <4 x float> %b to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x float>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x float> [[TMP1]], float %a, i32 3
+// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x float> %b, float %a, i32 3
// CHECK: ret <4 x float> [[VSET_LANE]]
float32x4_t test_vsetq_lane_f32(float32_t a, float32x4_t b) {
return vsetq_lane_f32(a, b, 3);
@@ -14236,9 +14182,7 @@
// CHECK: [[TMP2:%.*]] = load i16, i16* [[TMP1]], align 2
// CHECK: [[TMP3:%.*]] = bitcast <8 x half>* [[__REINT1_248]] to <8 x i16>*
// CHECK: [[TMP4:%.*]] = load <8 x i16>, <8 x i16>* [[TMP3]], align 16
-// CHECK: [[TMP5:%.*]] = bitcast <8 x i16> [[TMP4]] to <16 x i8>
-// CHECK: [[TMP6:%.*]] = bitcast <16 x i8> [[TMP5]] to <8 x i16>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <8 x i16> [[TMP6]], i16 [[TMP2]], i32 3
+// CHECK: [[VSET_LANE:%.*]] = insertelement <8 x i16> [[TMP4]], i16 [[TMP2]], i32 3
// CHECK: store <8 x i16> [[VSET_LANE]], <8 x i16>* [[__REINT2_248]], align 16
// CHECK: [[TMP7:%.*]] = bitcast <8 x i16>* [[__REINT2_248]] to <8 x half>*
// CHECK: [[TMP8:%.*]] = load <8 x half>, <8 x half>* [[TMP7]], align 16
@@ -14248,36 +14192,28 @@
}
// CHECK-LABEL: @test_vset_lane_s64(
-// CHECK: [[TMP0:%.*]] = bitcast <1 x i64> %b to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x i64>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x i64> [[TMP1]], i64 %a, i32 0
+// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x i64> %b, i64 %a, i32 0
// CHECK: ret <1 x i64> [[VSET_LANE]]
int64x1_t test_vset_lane_s64(int64_t a, int64x1_t b) {
return vset_lane_s64(a, b, 0);
}
// CHECK-LABEL: @test_vset_lane_u64(
-// CHECK: [[TMP0:%.*]] = bitcast <1 x i64> %b to <8 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x i64>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x i64> [[TMP1]], i64 %a, i32 0
+// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x i64> %b, i64 %a, i32 0
// CHECK: ret <1 x i64> [[VSET_LANE]]
uint64x1_t test_vset_lane_u64(uint64_t a, uint64x1_t b) {
return vset_lane_u64(a, b, 0);
}
// CHECK-LABEL: @test_vsetq_lane_s64(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %b to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x i64>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i64> [[TMP1]], i64 %a, i32 1
+// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i64> %b, i64 %a, i32 1
// CHECK: ret <2 x i64> [[VSET_LANE]]
int64x2_t test_vsetq_lane_s64(int64_t a, int64x2_t b) {
return vsetq_lane_s64(a, b, 1);
}
// CHECK-LABEL: @test_vsetq_lane_u64(
-// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %b to <16 x i8>
-// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x i64>
-// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i64> [[TMP1]], i64 %a, i32 1
+// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i64> %b, i64 %a, i32 1
// CHECK: ret <2 x i64> [[VSET_LANE]]
uint64x2_t test_vsetq_lane_u64(uint64_t a, uint64x2_t b) {
return vsetq_lane_u64(a, b, 1);
diff --git a/src/llvm-project/clang/test/CodeGen/asan-constructor.c b/src/llvm-project/clang/test/CodeGen/asan-constructor.c
new file mode 100644
index 0000000..0184bf9
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/asan-constructor.c
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 -fsanitize=address -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple wasm32-unknown-emscripten -fsanitize=address -emit-llvm -o - %s | FileCheck %s --check-prefix=EMSCRIPTEN
+
+// CHECK: @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 1, void ()* @asan.module_ctor, i8* null }]
+// EMSCRIPTEN: @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 50, void ()* @asan.module_ctor, i8* null }]
diff --git a/src/llvm-project/clang/test/CodeGen/asan-new-pm.ll b/src/llvm-project/clang/test/CodeGen/asan-new-pm.ll
index 72bcf05..e107e99 100644
--- a/src/llvm-project/clang/test/CodeGen/asan-new-pm.ll
+++ b/src/llvm-project/clang/test/CodeGen/asan-new-pm.ll
@@ -1,12 +1,10 @@
; Test that ASan runs with the new pass manager
-; RUN: %clang_cc1 -S -emit-llvm -o - -fexperimental-new-pass-manager -fsanitize=address %s | FileCheck %s --check-prefixes=CHECK,LTO,THINLTO
-; RUN: %clang_cc1 -S -emit-llvm -o - -fexperimental-new-pass-manager -fsanitize=address -flto %s | FileCheck %s --check-prefixes=CHECK,LTO
-; RUN: %clang_cc1 -S -emit-llvm -o - -fexperimental-new-pass-manager -fsanitize=address -flto=thin %s | FileCheck %s --check-prefixes=CHECK,THINLTO
-; RUN: %clang_cc1 -S -emit-llvm -o - -O1 -fexperimental-new-pass-manager -fsanitize=address %s | FileCheck %s --check-prefixes=CHECK,LTO,THINLTO
-; RUN: %clang_cc1 -S -emit-llvm -o - -O1 -fexperimental-new-pass-manager -fsanitize=address -flto %s | FileCheck %s --check-prefixes=CHECK,LTO
-; RUN: %clang_cc1 -S -emit-llvm -o - -O1 -fexperimental-new-pass-manager -fsanitize=address -flto=thin %s | FileCheck %s --check-prefixes=CHECK,THINLTO
-
-target triple = "x86_64-unknown-unknown"
+; RUN: %clang_cc1 -triple x86_64-unknown-unknown -S -emit-llvm -o - -fexperimental-new-pass-manager -fsanitize=address %s | FileCheck %s --check-prefixes=CHECK,LTO,THINLTO
+; RUN: %clang_cc1 -triple x86_64-unknown-unknown -S -emit-llvm -o - -fexperimental-new-pass-manager -fsanitize=address -flto %s | FileCheck %s --check-prefixes=CHECK,LTO
+; RUN: %clang_cc1 -triple x86_64-unknown-unknown -S -emit-llvm -o - -fexperimental-new-pass-manager -fsanitize=address -flto=thin %s | FileCheck %s --check-prefixes=CHECK,THINLTO
+; RUN: %clang_cc1 -triple x86_64-unknown-unknown -S -emit-llvm -o - -O1 -fexperimental-new-pass-manager -fsanitize=address %s | FileCheck %s --check-prefixes=CHECK,LTO,THINLTO
+; RUN: %clang_cc1 -triple x86_64-unknown-unknown -S -emit-llvm -o - -O1 -fexperimental-new-pass-manager -fsanitize=address -flto %s | FileCheck %s --check-prefixes=CHECK,LTO
+; RUN: %clang_cc1 -triple x86_64-unknown-unknown -S -emit-llvm -o - -O1 -fexperimental-new-pass-manager -fsanitize=address -flto=thin %s | FileCheck %s --check-prefixes=CHECK,THINLTO
; DAG-CHECK: @llvm.global_ctors = {{.*}}@asan.module_ctor
diff --git a/src/llvm-project/clang/test/CodeGen/asm-attrs.c b/src/llvm-project/clang/test/CodeGen/asm-attrs.c
index ae72879..fa07601 100644
--- a/src/llvm-project/clang/test/CodeGen/asm-attrs.c
+++ b/src/llvm-project/clang/test/CodeGen/asm-attrs.c
@@ -8,7 +8,7 @@
// CHECK: call i32 asm "foo5", {{.*}} [[READONLY]]
// CHECK: call i32 asm "foo6", {{.*}} [[NOATTRS]]
// CHECK: call void asm sideeffect "foo7", {{.*}} [[NOATTRS]]
-// CHECK: call void asm "foo8", {{.*}} [[NOATTRS]]
+// CHECK: call i32 asm "foo8", {{.*}} [[READNONE]]
// CHECK: attributes [[READNONE]] = { nounwind readnone }
// CHECK: attributes [[NOATTRS]] = { nounwind }
diff --git a/src/llvm-project/clang/test/CodeGen/asm-goto.c b/src/llvm-project/clang/test/CodeGen/asm-goto.c
index 97f2158..7692fbc 100644
--- a/src/llvm-project/clang/test/CodeGen/asm-goto.c
+++ b/src/llvm-project/clang/test/CodeGen/asm-goto.c
@@ -1,16 +1,16 @@
// REQUIRES: x86-registered-target
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -O0 -emit-llvm %s -o - | FileCheck %s
-// RUN: %clang_cc1 -triple i386-pc-linux-gnu-O0 -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple i386-pc-linux-gnu -O0 -emit-llvm %s -o - | FileCheck %s
int foo(int cond)
{
// CHECK: callbr void asm sideeffect
- // CHECK: to label %asm.fallthrough [label %label_true, label %loop], !srcloc
+ // CHECK: to label %asm.fallthrough [label %label_true, label %loop]
// CHECK: asm.fallthrough:
asm volatile goto("testl %0, %0; jne %l1;" :: "r"(cond)::label_true, loop);
asm volatile goto("testl %0, %0; jne %l1;" :: "r"(cond)::label_true, loop);
// CHECK: callbr void asm sideeffect
- // CHECK: to label %asm.fallthrough1 [label %label_true, label %loop], !srcloc
+ // CHECK: to label %asm.fallthrough1 [label %label_true, label %loop]
// CHECK: asm.fallthrough1:
return 0;
loop:
diff --git a/src/llvm-project/clang/test/CodeGen/asm-label.c b/src/llvm-project/clang/test/CodeGen/asm-label.c
index f944d36..c06f11f 100644
--- a/src/llvm-project/clang/test/CodeGen/asm-label.c
+++ b/src/llvm-project/clang/test/CodeGen/asm-label.c
@@ -17,15 +17,3 @@
// 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/src/llvm-project/clang/test/CodeGen/atomic-ops-libcall.c b/src/llvm-project/clang/test/CodeGen/atomic-ops-libcall.c
index c673b07..ca79688 100644
--- a/src/llvm-project/clang/test/CodeGen/atomic-ops-libcall.c
+++ b/src/llvm-project/clang/test/CodeGen/atomic-ops-libcall.c
@@ -10,109 +10,109 @@
int *test_c11_atomic_fetch_add_int_ptr(_Atomic(int *) *p) {
// CHECK: test_c11_atomic_fetch_add_int_ptr
- // CHECK: {{%[^ ]*}} = tail call i32 @__atomic_fetch_add_4(i8* {{%[0-9]+}}, i32 12, i32 5)
+ // CHECK: {{%[^ ]*}} = call i32 @__atomic_fetch_add_4(i8* {{%[0-9]+}}, i32 12, i32 5)
return __c11_atomic_fetch_add(p, 3, memory_order_seq_cst);
}
int *test_c11_atomic_fetch_sub_int_ptr(_Atomic(int *) *p) {
// CHECK: test_c11_atomic_fetch_sub_int_ptr
- // CHECK: {{%[^ ]*}} = tail call i32 @__atomic_fetch_sub_4(i8* {{%[0-9]+}}, i32 20, i32 5)
+ // CHECK: {{%[^ ]*}} = call i32 @__atomic_fetch_sub_4(i8* {{%[0-9]+}}, i32 20, i32 5)
return __c11_atomic_fetch_sub(p, 5, memory_order_seq_cst);
}
int test_c11_atomic_fetch_add_int(_Atomic(int) *p) {
// CHECK: test_c11_atomic_fetch_add_int
- // CHECK: {{%[^ ]*}} = tail call i32 @__atomic_fetch_add_4(i8* {{%[0-9]+}}, i32 3, i32 5)
+ // CHECK: {{%[^ ]*}} = call i32 @__atomic_fetch_add_4(i8* {{%[0-9]+}}, i32 3, i32 5)
return __c11_atomic_fetch_add(p, 3, memory_order_seq_cst);
}
int test_c11_atomic_fetch_sub_int(_Atomic(int) *p) {
// CHECK: test_c11_atomic_fetch_sub_int
- // CHECK: {{%[^ ]*}} = tail call i32 @__atomic_fetch_sub_4(i8* {{%[0-9]+}}, i32 5, i32 5)
+ // CHECK: {{%[^ ]*}} = call i32 @__atomic_fetch_sub_4(i8* {{%[0-9]+}}, i32 5, i32 5)
return __c11_atomic_fetch_sub(p, 5, memory_order_seq_cst);
}
int *fp2a(int **p) {
// CHECK: @fp2a
- // CHECK: {{%[^ ]*}} = tail call i32 @__atomic_fetch_sub_4(i8* {{%[0-9]+}}, i32 4, i32 0)
+ // CHECK: {{%[^ ]*}} = call i32 @__atomic_fetch_sub_4(i8* {{%[0-9]+}}, i32 4, i32 0)
// Note, the GNU builtins do not multiply by sizeof(T)!
return __atomic_fetch_sub(p, 4, memory_order_relaxed);
}
int test_atomic_fetch_add(int *p) {
// CHECK: test_atomic_fetch_add
- // CHECK: {{%[^ ]*}} = tail call i32 @__atomic_fetch_add_4(i8* {{%[0-9]+}}, i32 55, i32 5)
+ // CHECK: {{%[^ ]*}} = call i32 @__atomic_fetch_add_4(i8* {{%[0-9]+}}, i32 55, i32 5)
return __atomic_fetch_add(p, 55, memory_order_seq_cst);
}
int test_atomic_fetch_sub(int *p) {
// CHECK: test_atomic_fetch_sub
- // CHECK: {{%[^ ]*}} = tail call i32 @__atomic_fetch_sub_4(i8* {{%[0-9]+}}, i32 55, i32 5)
+ // CHECK: {{%[^ ]*}} = call i32 @__atomic_fetch_sub_4(i8* {{%[0-9]+}}, i32 55, i32 5)
return __atomic_fetch_sub(p, 55, memory_order_seq_cst);
}
int test_atomic_fetch_and(int *p) {
// CHECK: test_atomic_fetch_and
- // CHECK: {{%[^ ]*}} = tail call i32 @__atomic_fetch_and_4(i8* {{%[0-9]+}}, i32 55, i32 5)
+ // CHECK: {{%[^ ]*}} = call i32 @__atomic_fetch_and_4(i8* {{%[0-9]+}}, i32 55, i32 5)
return __atomic_fetch_and(p, 55, memory_order_seq_cst);
}
int test_atomic_fetch_or(int *p) {
// CHECK: test_atomic_fetch_or
- // CHECK: {{%[^ ]*}} = tail call i32 @__atomic_fetch_or_4(i8* {{%[0-9]+}}, i32 55, i32 5)
+ // CHECK: {{%[^ ]*}} = call i32 @__atomic_fetch_or_4(i8* {{%[0-9]+}}, i32 55, i32 5)
return __atomic_fetch_or(p, 55, memory_order_seq_cst);
}
int test_atomic_fetch_xor(int *p) {
// CHECK: test_atomic_fetch_xor
- // CHECK: {{%[^ ]*}} = tail call i32 @__atomic_fetch_xor_4(i8* {{%[0-9]+}}, i32 55, i32 5)
+ // CHECK: {{%[^ ]*}} = call i32 @__atomic_fetch_xor_4(i8* {{%[0-9]+}}, i32 55, i32 5)
return __atomic_fetch_xor(p, 55, memory_order_seq_cst);
}
int test_atomic_fetch_nand(int *p) {
// CHECK: test_atomic_fetch_nand
- // CHECK: {{%[^ ]*}} = tail call i32 @__atomic_fetch_nand_4(i8* {{%[0-9]+}}, i32 55, i32 5)
+ // CHECK: {{%[^ ]*}} = call i32 @__atomic_fetch_nand_4(i8* {{%[0-9]+}}, i32 55, i32 5)
return __atomic_fetch_nand(p, 55, memory_order_seq_cst);
}
int test_atomic_add_fetch(int *p) {
// CHECK: test_atomic_add_fetch
- // CHECK: [[CALL:%[^ ]*]] = tail call i32 @__atomic_fetch_add_4(i8* {{%[0-9]+}}, i32 55, i32 5)
+ // CHECK: [[CALL:%[^ ]*]] = call i32 @__atomic_fetch_add_4(i8* {{%[0-9]+}}, i32 55, i32 5)
// CHECK: {{%[^ ]*}} = add i32 [[CALL]], 55
return __atomic_add_fetch(p, 55, memory_order_seq_cst);
}
int test_atomic_sub_fetch(int *p) {
// CHECK: test_atomic_sub_fetch
- // CHECK: [[CALL:%[^ ]*]] = tail call i32 @__atomic_fetch_sub_4(i8* {{%[0-9]+}}, i32 55, i32 5)
+ // CHECK: [[CALL:%[^ ]*]] = call i32 @__atomic_fetch_sub_4(i8* {{%[0-9]+}}, i32 55, i32 5)
// CHECK: {{%[^ ]*}} = add i32 [[CALL]], -55
return __atomic_sub_fetch(p, 55, memory_order_seq_cst);
}
int test_atomic_and_fetch(int *p) {
// CHECK: test_atomic_and_fetch
- // CHECK: [[CALL:%[^ ]*]] = tail call i32 @__atomic_fetch_and_4(i8* {{%[0-9]+}}, i32 55, i32 5)
+ // CHECK: [[CALL:%[^ ]*]] = call i32 @__atomic_fetch_and_4(i8* {{%[0-9]+}}, i32 55, i32 5)
// CHECK: {{%[^ ]*}} = and i32 [[CALL]], 55
return __atomic_and_fetch(p, 55, memory_order_seq_cst);
}
int test_atomic_or_fetch(int *p) {
// CHECK: test_atomic_or_fetch
- // CHECK: [[CALL:%[^ ]*]] = tail call i32 @__atomic_fetch_or_4(i8* {{%[0-9]+}}, i32 55, i32 5)
+ // CHECK: [[CALL:%[^ ]*]] = call i32 @__atomic_fetch_or_4(i8* {{%[0-9]+}}, i32 55, i32 5)
// CHECK: {{%[^ ]*}} = or i32 [[CALL]], 55
return __atomic_or_fetch(p, 55, memory_order_seq_cst);
}
int test_atomic_xor_fetch(int *p) {
// CHECK: test_atomic_xor_fetch
- // CHECK: [[CALL:%[^ ]*]] = tail call i32 @__atomic_fetch_xor_4(i8* {{%[0-9]+}}, i32 55, i32 5)
+ // CHECK: [[CALL:%[^ ]*]] = call i32 @__atomic_fetch_xor_4(i8* {{%[0-9]+}}, i32 55, i32 5)
// CHECK: {{%[^ ]*}} = xor i32 [[CALL]], 55
return __atomic_xor_fetch(p, 55, memory_order_seq_cst);
}
int test_atomic_nand_fetch(int *p) {
// CHECK: test_atomic_nand_fetch
- // CHECK: [[CALL:%[^ ]*]] = tail call i32 @__atomic_fetch_nand_4(i8* {{%[0-9]+}}, i32 55, i32 5)
+ // CHECK: [[CALL:%[^ ]*]] = call i32 @__atomic_fetch_nand_4(i8* {{%[0-9]+}}, i32 55, i32 5)
// FIXME: We should not be checking optimized IR. It changes independently of clang.
// FIXME-CHECK: [[AND:%[^ ]*]] = and i32 [[CALL]], 55
// FIXME-CHECK: {{%[^ ]*}} = xor i32 [[AND]], -1
diff --git a/src/llvm-project/clang/test/CodeGen/atomic-ops.c b/src/llvm-project/clang/test/CodeGen/atomic-ops.c
index c3a9729..25ecb43 100644
--- a/src/llvm-project/clang/test/CodeGen/atomic-ops.c
+++ b/src/llvm-project/clang/test/CodeGen/atomic-ops.c
@@ -661,4 +661,81 @@
__atomic_compare_exchange(&aligned_a, &aligned_b, &aligned_c, 1, memory_order_seq_cst, memory_order_seq_cst);
}
+void test_c11_minmax(_Atomic(int) * si, _Atomic(unsigned) * ui, _Atomic(short) * ss, _Atomic(unsigned char) * uc, _Atomic(long long) * sll) {
+ // CHECK-LABEL: @test_c11_minmax
+
+ // CHECK: atomicrmw max i32
+ *si = __c11_atomic_fetch_max(si, 42, memory_order_acquire);
+ // CHECK: atomicrmw min i32
+ *si = __c11_atomic_fetch_min(si, 42, memory_order_acquire);
+ // CHECK: atomicrmw umax i32
+ *ui = __c11_atomic_fetch_max(ui, 42, memory_order_acquire);
+ // CHECK: atomicrmw umin i32
+ *ui = __c11_atomic_fetch_min(ui, 42, memory_order_acquire);
+
+ // CHECK: atomicrmw max i16
+ *ss = __c11_atomic_fetch_max(ss, 42, memory_order_acquire);
+ // CHECK: atomicrmw min i16
+ *ss = __c11_atomic_fetch_min(ss, 42, memory_order_acquire);
+
+ // CHECK: atomicrmw umax i8
+ *uc = __c11_atomic_fetch_max(uc, 42, memory_order_acquire);
+ // CHECK: atomicrmw umin i8
+ *uc = __c11_atomic_fetch_min(uc, 42, memory_order_acquire);
+
+ // CHECK: atomicrmw max i64
+ *sll = __c11_atomic_fetch_max(sll, 42, memory_order_acquire);
+ // CHECK: atomicrmw min i64
+ *sll = __c11_atomic_fetch_min(sll, 42, memory_order_acquire);
+
+}
+
+void test_minmax_postop(int *si, unsigned *ui, unsigned short *us, signed char *sc, unsigned long long *ull) {
+ int val = 42;
+ // CHECK-LABEL: @test_minmax_postop
+
+ // CHECK: [[OLD:%.*]] = atomicrmw max i32* [[PTR:%.*]], i32 [[RHS:%.*]] release
+ // CHECK: [[TST:%.*]] = icmp sgt i32 [[OLD]], [[RHS]]
+ // CHECK: [[NEW:%.*]] = select i1 [[TST]], i32 [[OLD]], i32 [[RHS]]
+ // CHECK: store i32 [[NEW]], i32*
+ *si = __atomic_max_fetch(si, 42, memory_order_release);
+
+ // CHECK: [[OLD:%.*]] = atomicrmw min i32* [[PTR:%.*]], i32 [[RHS:%.*]] release
+ // CHECK: [[TST:%.*]] = icmp slt i32 [[OLD]], [[RHS]]
+ // CHECK: [[NEW:%.*]] = select i1 [[TST]], i32 [[OLD]], i32 [[RHS]]
+ // CHECK: store i32 [[NEW]], i32*
+ *si = __atomic_min_fetch(si, 42, memory_order_release);
+
+ // CHECK: [[OLD:%.*]] = atomicrmw umax i32* [[PTR:%.*]], i32 [[RHS:%.*]] release
+ // CHECK: [[TST:%.*]] = icmp ugt i32 [[OLD]], [[RHS]]
+ // CHECK: [[NEW:%.*]] = select i1 [[TST]], i32 [[OLD]], i32 [[RHS]]
+ // CHECK: store i32 [[NEW]], i32*
+ *ui = __atomic_max_fetch(ui, 42, memory_order_release);
+
+ // CHECK: [[OLD:%.*]] = atomicrmw umin i32* [[PTR:%.*]], i32 [[RHS:%.*]] release
+ // CHECK: [[TST:%.*]] = icmp ult i32 [[OLD]], [[RHS]]
+ // CHECK: [[NEW:%.*]] = select i1 [[TST]], i32 [[OLD]], i32 [[RHS]]
+ // CHECK: store i32 [[NEW]], i32*
+ *ui = __atomic_min_fetch(ui, 42, memory_order_release);
+
+ // CHECK: [[OLD:%.*]] = atomicrmw umin i16* [[PTR:%.*]], i16 [[RHS:%.*]] release
+ // CHECK: [[TST:%.*]] = icmp ult i16 [[OLD]], [[RHS]]
+ // CHECK: [[NEW:%.*]] = select i1 [[TST]], i16 [[OLD]], i16 [[RHS]]
+ // CHECK: store i16 [[NEW]], i16*
+ *us = __atomic_min_fetch(us, 42, memory_order_release);
+
+ // CHECK: [[OLD:%.*]] = atomicrmw min i8* [[PTR:%.*]], i8 [[RHS:%.*]] release
+ // CHECK: [[TST:%.*]] = icmp slt i8 [[OLD]], [[RHS]]
+ // CHECK: [[NEW:%.*]] = select i1 [[TST]], i8 [[OLD]], i8 [[RHS]]
+ // CHECK: store i8 [[NEW]], i8*
+ *sc = __atomic_min_fetch(sc, 42, memory_order_release);
+
+ // CHECK: [[OLD:%.*]] = call i64 @__atomic_fetch_umin_8(i8* {{%.*}}, i64 [[RHS:%.*]],
+ // CHECK: [[TST:%.*]] = icmp ult i64 [[OLD]], [[RHS]]
+ // CHECK: [[NEW:%.*]] = select i1 [[TST]], i64 [[OLD]], i64 [[RHS]]
+ // CHECK: store i64 [[NEW]], i64*
+ *ull = __atomic_min_fetch(ull, 42, memory_order_release);
+
+}
+
#endif
diff --git a/src/llvm-project/clang/test/CodeGen/atomic_ops.c b/src/llvm-project/clang/test/CodeGen/atomic_ops.c
index 0af1d38..a853ba9 100644
--- a/src/llvm-project/clang/test/CodeGen/atomic_ops.c
+++ b/src/llvm-project/clang/test/CodeGen/atomic_ops.c
@@ -37,3 +37,56 @@
// CHECK: {{store atomic|call void @__atomic_store}}
x += y;
}
+
+_Atomic(int) compound_add(_Atomic(int) in) {
+// CHECK-LABEL: @compound_add
+// CHECK: [[OLD:%.*]] = atomicrmw add i32* {{.*}}, i32 5 seq_cst
+// CHECK: [[NEW:%.*]] = add i32 [[OLD]], 5
+// CHECK: ret i32 [[NEW]]
+
+ return (in += 5);
+}
+
+_Atomic(int) compound_sub(_Atomic(int) in) {
+// CHECK-LABEL: @compound_sub
+// CHECK: [[OLD:%.*]] = atomicrmw sub i32* {{.*}}, i32 5 seq_cst
+// CHECK: [[NEW:%.*]] = sub i32 [[OLD]], 5
+// CHECK: ret i32 [[NEW]]
+
+ return (in -= 5);
+}
+
+_Atomic(int) compound_xor(_Atomic(int) in) {
+// CHECK-LABEL: @compound_xor
+// CHECK: [[OLD:%.*]] = atomicrmw xor i32* {{.*}}, i32 5 seq_cst
+// CHECK: [[NEW:%.*]] = xor i32 [[OLD]], 5
+// CHECK: ret i32 [[NEW]]
+
+ return (in ^= 5);
+}
+
+_Atomic(int) compound_or(_Atomic(int) in) {
+// CHECK-LABEL: @compound_or
+// CHECK: [[OLD:%.*]] = atomicrmw or i32* {{.*}}, i32 5 seq_cst
+// CHECK: [[NEW:%.*]] = or i32 [[OLD]], 5
+// CHECK: ret i32 [[NEW]]
+
+ return (in |= 5);
+}
+
+_Atomic(int) compound_and(_Atomic(int) in) {
+// CHECK-LABEL: @compound_and
+// CHECK: [[OLD:%.*]] = atomicrmw and i32* {{.*}}, i32 5 seq_cst
+// CHECK: [[NEW:%.*]] = and i32 [[OLD]], 5
+// CHECK: ret i32 [[NEW]]
+
+ return (in &= 5);
+}
+
+_Atomic(int) compound_mul(_Atomic(int) in) {
+// CHECK-LABEL: @compound_mul
+// CHECK: cmpxchg i32* {{%.*}}, i32 {{%.*}}, i32 [[NEW:%.*]] seq_cst seq_cst
+// CHECK: ret i32 [[NEW]]
+
+ return (in *= 5);
+}
diff --git a/src/llvm-project/clang/test/CodeGen/attr-cpuspecific.c b/src/llvm-project/clang/test/CodeGen/attr-cpuspecific.c
index 2c5e411..e249c87 100644
--- a/src/llvm-project/clang/test/CodeGen/attr-cpuspecific.c
+++ b/src/llvm-project/clang/test/CodeGen/attr-cpuspecific.c
@@ -7,11 +7,27 @@
#define ATTR(X) __attribute__((X))
#endif // _MSC_VER
-// Each called version should have an IFunc.
-// LINUX: @SingleVersion.ifunc = ifunc void (), void ()* ()* @SingleVersion.resolver
-// LINUX: @TwoVersions.ifunc = ifunc void (), void ()* ()* @TwoVersions.resolver
-// LINUX: @TwoVersionsSameAttr.ifunc = ifunc void (), void ()* ()* @TwoVersionsSameAttr.resolver
-// LINUX: @ThreeVersionsSameAttr.ifunc = ifunc void (), void ()* ()* @ThreeVersionsSameAttr.resolver
+// Each version should have an IFunc and an alias.
+// LINUX: @TwoVersions = weak_odr alias void (), void ()* @TwoVersions.ifunc
+// LINUX: @TwoVersionsSameAttr = weak_odr alias void (), void ()* @TwoVersionsSameAttr.ifunc
+// LINUX: @ThreeVersionsSameAttr = weak_odr alias void (), void ()* @ThreeVersionsSameAttr.ifunc
+// LINUX: @NoSpecifics = weak_odr alias void (), void ()* @NoSpecifics.ifunc
+// LINUX: @HasGeneric = weak_odr alias void (), void ()* @HasGeneric.ifunc
+// LINUX: @HasParams = weak_odr alias void (i32, double), void (i32, double)* @HasParams.ifunc
+// LINUX: @HasParamsAndReturn = weak_odr alias i32 (i32, double), i32 (i32, double)* @HasParamsAndReturn.ifunc
+// LINUX: @GenericAndPentium = weak_odr alias i32 (i32, double), i32 (i32, double)* @GenericAndPentium.ifunc
+// LINUX: @DispatchFirst = weak_odr alias i32 (), i32 ()* @DispatchFirst.ifunc
+
+// LINUX: @TwoVersions.ifunc = weak_odr ifunc void (), void ()* ()* @TwoVersions.resolver
+// LINUX: @SingleVersion.ifunc = weak_odr ifunc void (), void ()* ()* @SingleVersion.resolver
+// LINUX: @TwoVersionsSameAttr.ifunc = weak_odr ifunc void (), void ()* ()* @TwoVersionsSameAttr.resolver
+// LINUX: @ThreeVersionsSameAttr.ifunc = weak_odr ifunc void (), void ()* ()* @ThreeVersionsSameAttr.resolver
+// LINUX: @NoSpecifics.ifunc = weak_odr ifunc void (), void ()* ()* @NoSpecifics.resolver
+// LINUX: @HasGeneric.ifunc = weak_odr ifunc void (), void ()* ()* @HasGeneric.resolver
+// LINUX: @HasParams.ifunc = weak_odr ifunc void (i32, double), void (i32, double)* ()* @HasParams.resolver
+// LINUX: @HasParamsAndReturn.ifunc = weak_odr ifunc i32 (i32, double), i32 (i32, double)* ()* @HasParamsAndReturn.resolver
+// LINUX: @GenericAndPentium.ifunc = weak_odr ifunc i32 (i32, double), i32 (i32, double)* ()* @GenericAndPentium.resolver
+// LINUX: @DispatchFirst.ifunc = weak_odr ifunc i32 (), i32 ()* ()* @DispatchFirst.resolver
ATTR(cpu_specific(ivybridge))
void SingleVersion(void){}
@@ -29,14 +45,14 @@
ATTR(cpu_dispatch(ivybridge, knl))
void TwoVersions(void);
-// LINUX: define void ()* @TwoVersions.resolver()
+// LINUX: define weak_odr void ()* @TwoVersions.resolver()
// LINUX: call void @__cpu_indicator_init
// LINUX: ret void ()* @TwoVersions.Z
// LINUX: ret void ()* @TwoVersions.S
// LINUX: call void @llvm.trap
// LINUX: unreachable
-// WINDOWS: define dso_local void @TwoVersions()
+// WINDOWS: define weak_odr dso_local void @TwoVersions() comdat
// WINDOWS: call void @__cpu_indicator_init()
// WINDOWS: call void @TwoVersions.Z()
// WINDOWS-NEXT: ret void
@@ -82,14 +98,14 @@
// has an extra config to emit!
ATTR(cpu_dispatch(ivybridge, knl, atom))
void TwoVersionsSameAttr(void);
-// LINUX: define void ()* @TwoVersionsSameAttr.resolver()
+// LINUX: define weak_odr void ()* @TwoVersionsSameAttr.resolver()
// LINUX: ret void ()* @TwoVersionsSameAttr.Z
// LINUX: ret void ()* @TwoVersionsSameAttr.S
// LINUX: ret void ()* @TwoVersionsSameAttr.O
// LINUX: call void @llvm.trap
// LINUX: unreachable
-// WINDOWS: define dso_local void @TwoVersionsSameAttr()
+// WINDOWS: define weak_odr dso_local void @TwoVersionsSameAttr() comdat
// WINDOWS: call void @TwoVersionsSameAttr.Z
// WINDOWS-NEXT: ret void
// WINDOWS: call void @TwoVersionsSameAttr.S
@@ -101,7 +117,7 @@
ATTR(cpu_dispatch(atom, ivybridge, knl))
void ThreeVersionsSameAttr(void){}
-// LINUX: define void ()* @ThreeVersionsSameAttr.resolver()
+// LINUX: define weak_odr void ()* @ThreeVersionsSameAttr.resolver()
// LINUX: call void @__cpu_indicator_init
// LINUX: ret void ()* @ThreeVersionsSameAttr.Z
// LINUX: ret void ()* @ThreeVersionsSameAttr.S
@@ -109,7 +125,7 @@
// LINUX: call void @llvm.trap
// LINUX: unreachable
-// WINDOWS: define dso_local void @ThreeVersionsSameAttr()
+// WINDOWS: define weak_odr dso_local void @ThreeVersionsSameAttr() comdat
// WINDOWS: call void @__cpu_indicator_init
// WINDOWS: call void @ThreeVersionsSameAttr.Z
// WINDOWS-NEXT: ret void
@@ -123,7 +139,7 @@
// No Cpu Specific options.
ATTR(cpu_dispatch(atom, ivybridge, knl))
void NoSpecifics(void);
-// LINUX: define void ()* @NoSpecifics.resolver()
+// LINUX: define weak_odr void ()* @NoSpecifics.resolver()
// LINUX: call void @__cpu_indicator_init
// LINUX: ret void ()* @NoSpecifics.Z
// LINUX: ret void ()* @NoSpecifics.S
@@ -131,7 +147,7 @@
// LINUX: call void @llvm.trap
// LINUX: unreachable
-// WINDOWS: define dso_local void @NoSpecifics()
+// WINDOWS: define weak_odr dso_local void @NoSpecifics() comdat
// WINDOWS: call void @__cpu_indicator_init
// WINDOWS: call void @NoSpecifics.Z
// WINDOWS-NEXT: ret void
@@ -144,7 +160,7 @@
ATTR(cpu_dispatch(atom, generic, ivybridge, knl))
void HasGeneric(void);
-// LINUX: define void ()* @HasGeneric.resolver()
+// LINUX: define weak_odr void ()* @HasGeneric.resolver()
// LINUX: call void @__cpu_indicator_init
// LINUX: ret void ()* @HasGeneric.Z
// LINUX: ret void ()* @HasGeneric.S
@@ -152,7 +168,7 @@
// LINUX: ret void ()* @HasGeneric.A
// LINUX-NOT: call void @llvm.trap
-// WINDOWS: define dso_local void @HasGeneric()
+// WINDOWS: define weak_odr dso_local void @HasGeneric() comdat
// WINDOWS: call void @__cpu_indicator_init
// WINDOWS: call void @HasGeneric.Z
// WINDOWS-NEXT: ret void
@@ -166,7 +182,7 @@
ATTR(cpu_dispatch(atom, generic, ivybridge, knl))
void HasParams(int i, double d);
-// LINUX: define void (i32, double)* @HasParams.resolver()
+// LINUX: define weak_odr void (i32, double)* @HasParams.resolver()
// LINUX: call void @__cpu_indicator_init
// LINUX: ret void (i32, double)* @HasParams.Z
// LINUX: ret void (i32, double)* @HasParams.S
@@ -174,7 +190,7 @@
// LINUX: ret void (i32, double)* @HasParams.A
// LINUX-NOT: call void @llvm.trap
-// WINDOWS: define dso_local void @HasParams(i32, double)
+// WINDOWS: define weak_odr dso_local void @HasParams(i32 %0, double %1) comdat
// WINDOWS: call void @__cpu_indicator_init
// WINDOWS: call void @HasParams.Z(i32 %0, double %1)
// WINDOWS-NEXT: ret void
@@ -188,7 +204,7 @@
ATTR(cpu_dispatch(atom, generic, ivybridge, knl))
int HasParamsAndReturn(int i, double d);
-// LINUX: define i32 (i32, double)* @HasParamsAndReturn.resolver()
+// LINUX: define weak_odr i32 (i32, double)* @HasParamsAndReturn.resolver()
// LINUX: call void @__cpu_indicator_init
// LINUX: ret i32 (i32, double)* @HasParamsAndReturn.Z
// LINUX: ret i32 (i32, double)* @HasParamsAndReturn.S
@@ -196,7 +212,7 @@
// LINUX: ret i32 (i32, double)* @HasParamsAndReturn.A
// LINUX-NOT: call void @llvm.trap
-// WINDOWS: define dso_local i32 @HasParamsAndReturn(i32, double)
+// WINDOWS: define weak_odr dso_local i32 @HasParamsAndReturn(i32 %0, double %1) comdat
// WINDOWS: call void @__cpu_indicator_init
// WINDOWS: %[[RET:.+]] = musttail call i32 @HasParamsAndReturn.Z(i32 %0, double %1)
// WINDOWS-NEXT: ret i32 %[[RET]]
@@ -210,14 +226,14 @@
ATTR(cpu_dispatch(atom, generic, pentium))
int GenericAndPentium(int i, double d);
-// LINUX: define i32 (i32, double)* @GenericAndPentium.resolver()
+// LINUX: define weak_odr i32 (i32, double)* @GenericAndPentium.resolver()
// LINUX: call void @__cpu_indicator_init
// LINUX: ret i32 (i32, double)* @GenericAndPentium.O
// LINUX: ret i32 (i32, double)* @GenericAndPentium.B
// LINUX-NOT: ret i32 (i32, double)* @GenericAndPentium.A
// LINUX-NOT: call void @llvm.trap
-// WINDOWS: define dso_local i32 @GenericAndPentium(i32, double)
+// WINDOWS: define weak_odr dso_local i32 @GenericAndPentium(i32 %0, double %1) comdat
// WINDOWS: call void @__cpu_indicator_init
// WINDOWS: %[[RET:.+]] = musttail call i32 @GenericAndPentium.O(i32 %0, double %1)
// WINDOWS-NEXT: ret i32 %[[RET]]
@@ -228,11 +244,11 @@
ATTR(cpu_dispatch(atom, pentium))
int DispatchFirst(void);
-// LINUX: define i32 ()* @DispatchFirst.resolver
+// LINUX: define weak_odr i32 ()* @DispatchFirst.resolver
// LINUX: ret i32 ()* @DispatchFirst.O
// LINUX: ret i32 ()* @DispatchFirst.B
-// WINDOWS: define dso_local i32 @DispatchFirst()
+// WINDOWS: define weak_odr dso_local i32 @DispatchFirst() comdat
// WINDOWS: %[[RET:.+]] = musttail call i32 @DispatchFirst.O()
// WINDOWS-NEXT: ret i32 %[[RET]]
// WINDOWS: %[[RET:.+]] = musttail call i32 @DispatchFirst.B()
diff --git a/src/llvm-project/clang/test/CodeGen/attr-naked.c b/src/llvm-project/clang/test/CodeGen/attr-naked.c
index 34e745b..dba923f 100644
--- a/src/llvm-project/clang/test/CodeGen/attr-naked.c
+++ b/src/llvm-project/clang/test/CodeGen/attr-naked.c
@@ -17,7 +17,7 @@
// Make sure not to generate prolog or epilog for naked functions.
__attribute((naked)) void t3(int x) {
-// CHECK: define void @t3(i32)
+// CHECK: define void @t3(i32 %0)
// CHECK-NOT: alloca
// CHECK-NOT: store
// CHECK: unreachable
diff --git a/src/llvm-project/clang/test/CodeGen/attr-target-mv-func-ptrs.c b/src/llvm-project/clang/test/CodeGen/attr-target-mv-func-ptrs.c
index d1ff800..4361a7a 100644
--- a/src/llvm-project/clang/test/CodeGen/attr-target-mv-func-ptrs.c
+++ b/src/llvm-project/clang/test/CodeGen/attr-target-mv-func-ptrs.c
@@ -17,7 +17,7 @@
return Free(1) + Free(2);
}
-// LINUX: @foo.ifunc = ifunc i32 (i32), i32 (i32)* ()* @foo.resolver
+// LINUX: @foo.ifunc = weak_odr ifunc i32 (i32), i32 (i32)* ()* @foo.resolver
// LINUX: define i32 @foo.sse4.2(
// LINUX: ret i32 0
// LINUX: define i32 @foo.arch_ivybridge(
diff --git a/src/llvm-project/clang/test/CodeGen/attr-target-mv-va-args.c b/src/llvm-project/clang/test/CodeGen/attr-target-mv-va-args.c
index 356b769..9d51d09 100644
--- a/src/llvm-project/clang/test/CodeGen/attr-target-mv-va-args.c
+++ b/src/llvm-project/clang/test/CodeGen/attr-target-mv-va-args.c
@@ -9,7 +9,7 @@
return foo(1, 'a', 1.1) + foo(2, 2.2, "asdf");
}
-// LINUX: @foo.ifunc = ifunc i32 (i32, ...), i32 (i32, ...)* ()* @foo.resolver
+// LINUX: @foo.ifunc = weak_odr ifunc i32 (i32, ...), i32 (i32, ...)* ()* @foo.resolver
// LINUX: define i32 @foo.sse4.2(i32 %i, ...)
// LINUX: ret i32 0
// LINUX: define i32 @foo.arch_ivybridge(i32 %i, ...)
@@ -20,7 +20,7 @@
// LINUX: call i32 (i32, ...) @foo.ifunc(i32 1, i32 97, double
// LINUX: call i32 (i32, ...) @foo.ifunc(i32 2, double 2.2{{[0-9Ee+]+}}, i8* getelementptr inbounds
-// LINUX: define i32 (i32, ...)* @foo.resolver() comdat
+// LINUX: define weak_odr i32 (i32, ...)* @foo.resolver() comdat
// LINUX: ret i32 (i32, ...)* @foo.arch_sandybridge
// LINUX: ret i32 (i32, ...)* @foo.arch_ivybridge
// LINUX: ret i32 (i32, ...)* @foo.sse4.2
@@ -37,7 +37,7 @@
// WINDOWS: call i32 (i32, ...) @foo.resolver(i32 1, i32 97, double
// WINDOWS: call i32 (i32, ...) @foo.resolver(i32 2, double 2.2{{[0-9Ee+]+}}, i8* getelementptr inbounds
-// WINDOWS: define dso_local i32 @foo.resolver(i32, ...) comdat
+// WINDOWS: define weak_odr dso_local i32 @foo.resolver(i32 %0, ...) comdat
// WINDOWS: musttail call i32 (i32, ...) @foo.arch_sandybridge
// WINDOWS: musttail call i32 (i32, ...) @foo.arch_ivybridge
// WINDOWS: musttail call i32 (i32, ...) @foo.sse4.2
diff --git a/src/llvm-project/clang/test/CodeGen/attr-target-mv.c b/src/llvm-project/clang/test/CodeGen/attr-target-mv.c
index 363dea6..c0c3de5 100644
--- a/src/llvm-project/clang/test/CodeGen/attr-target-mv.c
+++ b/src/llvm-project/clang/test/CodeGen/attr-target-mv.c
@@ -47,12 +47,12 @@
fwd_decl_avx();
}
-// LINUX: @foo.ifunc = ifunc i32 (), i32 ()* ()* @foo.resolver
-// LINUX: @foo_inline.ifunc = ifunc i32 (), i32 ()* ()* @foo_inline.resolver
-// LINUX: @foo_decls.ifunc = ifunc void (), void ()* ()* @foo_decls.resolver
-// LINUX: @foo_multi.ifunc = ifunc void (i32, double), void (i32, double)* ()* @foo_multi.resolver
-// LINUX: @fwd_decl_default.ifunc = ifunc i32 (), i32 ()* ()* @fwd_decl_default.resolver
-// LINUX: @fwd_decl_avx.ifunc = ifunc i32 (), i32 ()* ()* @fwd_decl_avx.resolver
+// LINUX: @foo.ifunc = weak_odr ifunc i32 (), i32 ()* ()* @foo.resolver
+// LINUX: @foo_inline.ifunc = weak_odr ifunc i32 (), i32 ()* ()* @foo_inline.resolver
+// LINUX: @foo_decls.ifunc = weak_odr ifunc void (), void ()* ()* @foo_decls.resolver
+// LINUX: @foo_multi.ifunc = weak_odr ifunc void (i32, double), void (i32, double)* ()* @foo_multi.resolver
+// LINUX: @fwd_decl_default.ifunc = weak_odr ifunc i32 (), i32 ()* ()* @fwd_decl_default.resolver
+// LINUX: @fwd_decl_avx.ifunc = weak_odr ifunc i32 (), i32 ()* ()* @fwd_decl_avx.resolver
// LINUX: define i32 @foo.sse4.2()
// LINUX: ret i32 0
@@ -72,14 +72,14 @@
// WINDOWS: define dso_local i32 @bar()
// WINDOWS: call i32 @foo.resolver()
-// LINUX: define i32 ()* @foo.resolver() comdat
+// LINUX: define weak_odr i32 ()* @foo.resolver() comdat
// LINUX: call void @__cpu_indicator_init()
// LINUX: ret i32 ()* @foo.arch_sandybridge
// LINUX: ret i32 ()* @foo.arch_ivybridge
// LINUX: ret i32 ()* @foo.sse4.2
// LINUX: ret i32 ()* @foo
-// WINDOWS: define dso_local i32 @foo.resolver() comdat
+// WINDOWS: define weak_odr dso_local i32 @foo.resolver() comdat
// WINDOWS: call void @__cpu_indicator_init()
// WINDOWS: call i32 @foo.arch_sandybridge
// WINDOWS: call i32 @foo.arch_ivybridge
@@ -92,14 +92,14 @@
// WINDOWS: define dso_local i32 @bar2()
// WINDOWS: call i32 @foo_inline.resolver()
-// LINUX: define i32 ()* @foo_inline.resolver() comdat
+// LINUX: define weak_odr i32 ()* @foo_inline.resolver() comdat
// LINUX: call void @__cpu_indicator_init()
// LINUX: ret i32 ()* @foo_inline.arch_sandybridge
// LINUX: ret i32 ()* @foo_inline.arch_ivybridge
// LINUX: ret i32 ()* @foo_inline.sse4.2
// LINUX: ret i32 ()* @foo_inline
-// WINDOWS: define dso_local i32 @foo_inline.resolver() comdat
+// WINDOWS: define weak_odr dso_local i32 @foo_inline.resolver() comdat
// WINDOWS: call void @__cpu_indicator_init()
// WINDOWS: call i32 @foo_inline.arch_sandybridge
// WINDOWS: call i32 @foo_inline.arch_ivybridge
@@ -112,11 +112,11 @@
// WINDOWS: define dso_local void @bar3()
// WINDOWS: call void @foo_decls.resolver()
-// LINUX: define void ()* @foo_decls.resolver() comdat
+// LINUX: define weak_odr void ()* @foo_decls.resolver() comdat
// LINUX: ret void ()* @foo_decls.sse4.2
// LINUX: ret void ()* @foo_decls
-// WINDOWS: define dso_local void @foo_decls.resolver() comdat
+// WINDOWS: define weak_odr dso_local void @foo_decls.resolver() comdat
// WINDOWS: call void @foo_decls.sse4.2
// WINDOWS: call void @foo_decls
@@ -126,7 +126,7 @@
// WINDOWS: define dso_local void @bar4()
// WINDOWS: call void @foo_multi.resolver(i32 1, double 5.{{[0+e]*}})
-// LINUX: define void (i32, double)* @foo_multi.resolver() comdat
+// LINUX: define weak_odr void (i32, double)* @foo_multi.resolver() comdat
// LINUX: and i32 %{{.*}}, 4352
// LINUX: icmp eq i32 %{{.*}}, 4352
// LINUX: ret void (i32, double)* @foo_multi.fma4_sse4.2
@@ -139,7 +139,7 @@
// LINUX: ret void (i32, double)* @foo_multi.avx_sse4.2
// LINUX: ret void (i32, double)* @foo_multi
-// WINDOWS: define dso_local void @foo_multi.resolver(i32, double) comdat
+// WINDOWS: define weak_odr dso_local void @foo_multi.resolver(i32 %0, double %1) comdat
// WINDOWS: and i32 %{{.*}}, 4352
// WINDOWS: icmp eq i32 %{{.*}}, 4352
// WINDOWS: call void @foo_multi.fma4_sse4.2(i32 %0, double %1)
@@ -178,18 +178,18 @@
// WINDOWS: call i32 @fwd_decl_default.resolver()
// WINDOWS: call i32 @fwd_decl_avx.resolver()
-// LINUX: define i32 ()* @fwd_decl_default.resolver() comdat
+// LINUX: define weak_odr i32 ()* @fwd_decl_default.resolver() comdat
// LINUX: call void @__cpu_indicator_init()
// LINUX: ret i32 ()* @fwd_decl_default
-// LINUX: define i32 ()* @fwd_decl_avx.resolver() comdat
+// LINUX: define weak_odr i32 ()* @fwd_decl_avx.resolver() comdat
// LINUX: call void @__cpu_indicator_init()
// LINUX: ret i32 ()* @fwd_decl_avx.avx
// LINUX: ret i32 ()* @fwd_decl_avx
-// WINDOWS: define dso_local i32 @fwd_decl_default.resolver() comdat
+// WINDOWS: define weak_odr dso_local i32 @fwd_decl_default.resolver() comdat
// WINDOWS: call void @__cpu_indicator_init()
// WINDOWS: call i32 @fwd_decl_default
-// WINDOWS: define dso_local i32 @fwd_decl_avx.resolver() comdat
+// WINDOWS: define weak_odr dso_local i32 @fwd_decl_avx.resolver() comdat
// WINDOWS: call void @__cpu_indicator_init()
// WINDOWS: call i32 @fwd_decl_avx.avx
// WINDOWS: call i32 @fwd_decl_avx
diff --git a/src/llvm-project/clang/test/CodeGen/available-externally-suppress.c b/src/llvm-project/clang/test/CodeGen/available-externally-suppress.c
index 55f85ad..1e79750 100644
--- a/src/llvm-project/clang/test/CodeGen/available-externally-suppress.c
+++ b/src/llvm-project/clang/test/CodeGen/available-externally-suppress.c
@@ -30,10 +30,8 @@
// CHECK: @test1
// LTO: @test1
int test1(int x) {
- // CHECK: br i1
// CHECK-NOT: call {{.*}} @f1
// CHECK: ret i32
- // LTO: br i1
// LTO-NOT: call {{.*}} @f1
// LTO: ret i32
return f1(x);
diff --git a/src/llvm-project/clang/test/CodeGen/avx-builtins.c b/src/llvm-project/clang/test/CodeGen/avx-builtins.c
index 0a09c53..b31a234 100644
--- a/src/llvm-project/clang/test/CodeGen/avx-builtins.c
+++ b/src/llvm-project/clang/test/CodeGen/avx-builtins.c
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx -emit-llvm -o - -Wall -Werror | FileCheck %s
-// RUN: %clang_cc1 -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx -fno-signed-char -emit-llvm -o - -Wall -Werror | FileCheck %s
-// RUN: %clang_cc1 -fms-extensions -fms-compatibility -ffreestanding %s -triple=x86_64-windows-msvc -target-feature +avx -emit-llvm -o - -Wall -Werror | FileCheck %s
+// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx -emit-llvm -o - -Wall -Werror | FileCheck %s
+// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx -fno-signed-char -emit-llvm -o - -Wall -Werror | FileCheck %s
+// RUN: %clang_cc1 -flax-vector-conversions=none -fms-extensions -fms-compatibility -ffreestanding %s -triple=x86_64-windows-msvc -target-feature +avx -emit-llvm -o - -Wall -Werror | FileCheck %s
#include <immintrin.h>
@@ -105,7 +105,7 @@
return _mm256_broadcast_sd(A);
}
-__m128d test_mm_broadcast_ss(float* A) {
+__m128 test_mm_broadcast_ss(float* A) {
// CHECK-LABEL: test_mm_broadcast_ss
// CHECK: load float, float* %{{.*}}
// CHECK: insertelement <4 x float> undef, float %{{.*}}, i32 0
@@ -115,7 +115,7 @@
return _mm_broadcast_ss(A);
}
-__m256d test_mm256_broadcast_ss(float* A) {
+__m256 test_mm256_broadcast_ss(float* A) {
// CHECK-LABEL: test_mm256_broadcast_ss
// CHECK: load float, float* %{{.*}}
// CHECK: insertelement <8 x float> undef, float %{{.*}}, i32 0
@@ -1278,7 +1278,7 @@
return _mm_maskload_ps(A, B);
}
-__m256d test_mm256_maskload_ps(float* A, __m256i B) {
+__m256 test_mm256_maskload_ps(float* A, __m256i B) {
// CHECK-LABEL: test_mm256_maskload_ps
// CHECK: call <8 x float> @llvm.x86.avx.maskload.ps.256(i8* %{{.*}}, <8 x i32> %{{.*}})
return _mm256_maskload_ps(A, B);
diff --git a/src/llvm-project/clang/test/CodeGen/avx-cmp-builtins.c b/src/llvm-project/clang/test/CodeGen/avx-cmp-builtins.c
index 609f596..adb8a86 100644
--- a/src/llvm-project/clang/test/CodeGen/avx-cmp-builtins.c
+++ b/src/llvm-project/clang/test/CodeGen/avx-cmp-builtins.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -ffreestanding %s -O3 -triple=x86_64-apple-darwin -target-feature +avx -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -O3 -triple=x86_64-apple-darwin -target-feature +avx -emit-llvm -o - | FileCheck %s
// FIXME: The shufflevector instructions in test_cmpgt_sd are relying on O3 here.
@@ -14,7 +14,7 @@
return _mm_cmp_sd(a, b, _CMP_GE_OS);
}
-__m128d test_cmp_ss(__m128 a, __m128 b) {
+__m128 test_cmp_ss(__m128 a, __m128 b) {
// Expects that the third argument in LLVM IR is immediate expression
// CHECK: @llvm.x86.sse.cmp.ss({{.*}}, i8 13)
return _mm_cmp_ss(a, b, _CMP_GE_OS);
diff --git a/src/llvm-project/clang/test/CodeGen/avx512-reduceMinMaxIntrin.c b/src/llvm-project/clang/test/CodeGen/avx512-reduceMinMaxIntrin.c
index fde7c0a..c1eebb6 100644
--- a/src/llvm-project/clang/test/CodeGen/avx512-reduceMinMaxIntrin.c
+++ b/src/llvm-project/clang/test/CodeGen/avx512-reduceMinMaxIntrin.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -ffreestanding %s -O0 -triple=x86_64-apple-darwin -target-cpu skylake-avx512 -emit-llvm -o - -Wall -Werror | FileCheck %s
+// RUN: %clang_cc1 -fexperimental-new-pass-manager -ffreestanding %s -O0 -triple=x86_64-apple-darwin -target-cpu skylake-avx512 -emit-llvm -o - -Wall -Werror | FileCheck %s
#include <immintrin.h>
@@ -27,10 +27,10 @@
// CHECK-NEXT: store <8 x i64> [[SHUFFLE_I]], <8 x i64>* [[__T1_I]], align 64
// CHECK-NEXT: [[TMP3:%.*]] = load <8 x i64>, <8 x i64>* [[__V_ADDR_I]], align 64
// CHECK-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[__T1_I]], align 64
-// CHECK-NEXT: store <8 x i64> [[TMP3]], <8 x i64>* [[__A_ADDR_I_I]], align 64
-// CHECK-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[__B_ADDR_I_I]], align 64
-// CHECK-NEXT: [[TMP5:%.*]] = load <8 x i64>, <8 x i64>* [[__A_ADDR_I_I]], align 64
-// CHECK-NEXT: [[TMP6:%.*]] = load <8 x i64>, <8 x i64>* [[__B_ADDR_I_I]], align 64
+// CHECK-NEXT: store <8 x i64> [[TMP3]], <8 x i64>* [[__A_ADDR_I7_I]], align 64
+// CHECK-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[__B_ADDR_I8_I]], align 64
+// CHECK-NEXT: [[TMP5:%.*]] = load <8 x i64>, <8 x i64>* [[__A_ADDR_I7_I]], align 64
+// CHECK-NEXT: [[TMP6:%.*]] = load <8 x i64>, <8 x i64>* [[__B_ADDR_I8_I]], align 64
// CHECK-NEXT: [[TMP7:%.*]] = icmp sgt <8 x i64> [[TMP5]], [[TMP6]]
// CHECK-NEXT: [[TMP8:%.*]] = select <8 x i1> [[TMP7]], <8 x i64> [[TMP5]], <8 x i64> [[TMP6]]
// CHECK-NEXT: store <8 x i64> [[TMP8]], <8 x i64>* [[__T2_I]], align 64
@@ -40,10 +40,10 @@
// CHECK-NEXT: store <8 x i64> [[SHUFFLE1_I]], <8 x i64>* [[__T3_I]], align 64
// CHECK-NEXT: [[TMP11:%.*]] = load <8 x i64>, <8 x i64>* [[__T2_I]], align 64
// CHECK-NEXT: [[TMP12:%.*]] = load <8 x i64>, <8 x i64>* [[__T3_I]], align 64
-// CHECK-NEXT: store <8 x i64> [[TMP11]], <8 x i64>* [[__A_ADDR_I7_I]], align 64
-// CHECK-NEXT: store <8 x i64> [[TMP12]], <8 x i64>* [[__B_ADDR_I8_I]], align 64
-// CHECK-NEXT: [[TMP13:%.*]] = load <8 x i64>, <8 x i64>* [[__A_ADDR_I7_I]], align 64
-// CHECK-NEXT: [[TMP14:%.*]] = load <8 x i64>, <8 x i64>* [[__B_ADDR_I8_I]], align 64
+// CHECK-NEXT: store <8 x i64> [[TMP11]], <8 x i64>* [[__A_ADDR_I5_I]], align 64
+// CHECK-NEXT: store <8 x i64> [[TMP12]], <8 x i64>* [[__B_ADDR_I6_I]], align 64
+// CHECK-NEXT: [[TMP13:%.*]] = load <8 x i64>, <8 x i64>* [[__A_ADDR_I5_I]], align 64
+// CHECK-NEXT: [[TMP14:%.*]] = load <8 x i64>, <8 x i64>* [[__B_ADDR_I6_I]], align 64
// CHECK-NEXT: [[TMP15:%.*]] = icmp sgt <8 x i64> [[TMP13]], [[TMP14]]
// CHECK-NEXT: [[TMP16:%.*]] = select <8 x i1> [[TMP15]], <8 x i64> [[TMP13]], <8 x i64> [[TMP14]]
// CHECK-NEXT: store <8 x i64> [[TMP16]], <8 x i64>* [[__T4_I]], align 64
@@ -53,10 +53,10 @@
// CHECK-NEXT: store <8 x i64> [[SHUFFLE3_I]], <8 x i64>* [[__T5_I]], align 64
// CHECK-NEXT: [[TMP19:%.*]] = load <8 x i64>, <8 x i64>* [[__T4_I]], align 64
// CHECK-NEXT: [[TMP20:%.*]] = load <8 x i64>, <8 x i64>* [[__T5_I]], align 64
-// CHECK-NEXT: store <8 x i64> [[TMP19]], <8 x i64>* [[__A_ADDR_I5_I]], align 64
-// CHECK-NEXT: store <8 x i64> [[TMP20]], <8 x i64>* [[__B_ADDR_I6_I]], align 64
-// CHECK-NEXT: [[TMP21:%.*]] = load <8 x i64>, <8 x i64>* [[__A_ADDR_I5_I]], align 64
-// CHECK-NEXT: [[TMP22:%.*]] = load <8 x i64>, <8 x i64>* [[__B_ADDR_I6_I]], align 64
+// CHECK-NEXT: store <8 x i64> [[TMP19]], <8 x i64>* [[__A_ADDR_I_I]], align 64
+// CHECK-NEXT: store <8 x i64> [[TMP20]], <8 x i64>* [[__B_ADDR_I_I]], align 64
+// CHECK-NEXT: [[TMP21:%.*]] = load <8 x i64>, <8 x i64>* [[__A_ADDR_I_I]], align 64
+// CHECK-NEXT: [[TMP22:%.*]] = load <8 x i64>, <8 x i64>* [[__B_ADDR_I_I]], align 64
// CHECK-NEXT: [[TMP23:%.*]] = icmp sgt <8 x i64> [[TMP21]], [[TMP22]]
// CHECK-NEXT: [[TMP24:%.*]] = select <8 x i1> [[TMP23]], <8 x i64> [[TMP21]], <8 x i64> [[TMP22]]
// CHECK-NEXT: store <8 x i64> [[TMP24]], <8 x i64>* [[__T6_I]], align 64
@@ -92,10 +92,10 @@
// CHECK-NEXT: store <8 x i64> [[SHUFFLE_I]], <8 x i64>* [[__T1_I]], align 64
// CHECK-NEXT: [[TMP3:%.*]] = load <8 x i64>, <8 x i64>* [[__V_ADDR_I]], align 64
// CHECK-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[__T1_I]], align 64
-// CHECK-NEXT: store <8 x i64> [[TMP3]], <8 x i64>* [[__A_ADDR_I_I]], align 64
-// CHECK-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[__B_ADDR_I_I]], align 64
-// CHECK-NEXT: [[TMP5:%.*]] = load <8 x i64>, <8 x i64>* [[__A_ADDR_I_I]], align 64
-// CHECK-NEXT: [[TMP6:%.*]] = load <8 x i64>, <8 x i64>* [[__B_ADDR_I_I]], align 64
+// CHECK-NEXT: store <8 x i64> [[TMP3]], <8 x i64>* [[__A_ADDR_I7_I]], align 64
+// CHECK-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[__B_ADDR_I8_I]], align 64
+// CHECK-NEXT: [[TMP5:%.*]] = load <8 x i64>, <8 x i64>* [[__A_ADDR_I7_I]], align 64
+// CHECK-NEXT: [[TMP6:%.*]] = load <8 x i64>, <8 x i64>* [[__B_ADDR_I8_I]], align 64
// CHECK-NEXT: [[TMP7:%.*]] = icmp ugt <8 x i64> [[TMP5]], [[TMP6]]
// CHECK-NEXT: [[TMP8:%.*]] = select <8 x i1> [[TMP7]], <8 x i64> [[TMP5]], <8 x i64> [[TMP6]]
// CHECK-NEXT: store <8 x i64> [[TMP8]], <8 x i64>* [[__T2_I]], align 64
@@ -105,10 +105,10 @@
// CHECK-NEXT: store <8 x i64> [[SHUFFLE1_I]], <8 x i64>* [[__T3_I]], align 64
// CHECK-NEXT: [[TMP11:%.*]] = load <8 x i64>, <8 x i64>* [[__T2_I]], align 64
// CHECK-NEXT: [[TMP12:%.*]] = load <8 x i64>, <8 x i64>* [[__T3_I]], align 64
-// CHECK-NEXT: store <8 x i64> [[TMP11]], <8 x i64>* [[__A_ADDR_I7_I]], align 64
-// CHECK-NEXT: store <8 x i64> [[TMP12]], <8 x i64>* [[__B_ADDR_I8_I]], align 64
-// CHECK-NEXT: [[TMP13:%.*]] = load <8 x i64>, <8 x i64>* [[__A_ADDR_I7_I]], align 64
-// CHECK-NEXT: [[TMP14:%.*]] = load <8 x i64>, <8 x i64>* [[__B_ADDR_I8_I]], align 64
+// CHECK-NEXT: store <8 x i64> [[TMP11]], <8 x i64>* [[__A_ADDR_I5_I]], align 64
+// CHECK-NEXT: store <8 x i64> [[TMP12]], <8 x i64>* [[__B_ADDR_I6_I]], align 64
+// CHECK-NEXT: [[TMP13:%.*]] = load <8 x i64>, <8 x i64>* [[__A_ADDR_I5_I]], align 64
+// CHECK-NEXT: [[TMP14:%.*]] = load <8 x i64>, <8 x i64>* [[__B_ADDR_I6_I]], align 64
// CHECK-NEXT: [[TMP15:%.*]] = icmp ugt <8 x i64> [[TMP13]], [[TMP14]]
// CHECK-NEXT: [[TMP16:%.*]] = select <8 x i1> [[TMP15]], <8 x i64> [[TMP13]], <8 x i64> [[TMP14]]
// CHECK-NEXT: store <8 x i64> [[TMP16]], <8 x i64>* [[__T4_I]], align 64
@@ -118,10 +118,10 @@
// CHECK-NEXT: store <8 x i64> [[SHUFFLE3_I]], <8 x i64>* [[__T5_I]], align 64
// CHECK-NEXT: [[TMP19:%.*]] = load <8 x i64>, <8 x i64>* [[__T4_I]], align 64
// CHECK-NEXT: [[TMP20:%.*]] = load <8 x i64>, <8 x i64>* [[__T5_I]], align 64
-// CHECK-NEXT: store <8 x i64> [[TMP19]], <8 x i64>* [[__A_ADDR_I5_I]], align 64
-// CHECK-NEXT: store <8 x i64> [[TMP20]], <8 x i64>* [[__B_ADDR_I6_I]], align 64
-// CHECK-NEXT: [[TMP21:%.*]] = load <8 x i64>, <8 x i64>* [[__A_ADDR_I5_I]], align 64
-// CHECK-NEXT: [[TMP22:%.*]] = load <8 x i64>, <8 x i64>* [[__B_ADDR_I6_I]], align 64
+// CHECK-NEXT: store <8 x i64> [[TMP19]], <8 x i64>* [[__A_ADDR_I_I]], align 64
+// CHECK-NEXT: store <8 x i64> [[TMP20]], <8 x i64>* [[__B_ADDR_I_I]], align 64
+// CHECK-NEXT: [[TMP21:%.*]] = load <8 x i64>, <8 x i64>* [[__A_ADDR_I_I]], align 64
+// CHECK-NEXT: [[TMP22:%.*]] = load <8 x i64>, <8 x i64>* [[__B_ADDR_I_I]], align 64
// CHECK-NEXT: [[TMP23:%.*]] = icmp ugt <8 x i64> [[TMP21]], [[TMP22]]
// CHECK-NEXT: [[TMP24:%.*]] = select <8 x i1> [[TMP23]], <8 x i64> [[TMP21]], <8 x i64> [[TMP22]]
// CHECK-NEXT: store <8 x i64> [[TMP24]], <8 x i64>* [[__T6_I]], align 64
@@ -134,12 +134,12 @@
// CHECK-LABEL: define double @test_mm512_reduce_max_pd(<8 x double> %__W) #0 {
// CHECK-NEXT: entry:
-// CHECK-NEXT: [[__A_ADDR_I10_I:%.*]] = alloca <4 x double>, align 32
-// CHECK-NEXT: [[__B_ADDR_I11_I:%.*]] = alloca <4 x double>, align 32
// CHECK-NEXT: [[__A_ADDR_I8_I:%.*]] = alloca <2 x double>, align 16
// CHECK-NEXT: [[__B_ADDR_I9_I:%.*]] = alloca <2 x double>, align 16
// CHECK-NEXT: [[__A_ADDR_I_I:%.*]] = alloca <2 x double>, align 16
// CHECK-NEXT: [[__B_ADDR_I_I:%.*]] = alloca <2 x double>, align 16
+// CHECK-NEXT: [[__A_ADDR_I10_I:%.*]] = alloca <4 x double>, align 32
+// CHECK-NEXT: [[__B_ADDR_I11_I:%.*]] = alloca <4 x double>, align 32
// CHECK-NEXT: [[__V_ADDR_I:%.*]] = alloca <8 x double>, align 64
// CHECK-NEXT: [[__T1_I:%.*]] = alloca <4 x double>, align 32
// CHECK-NEXT: [[__T2_I:%.*]] = alloca <4 x double>, align 32
@@ -225,10 +225,10 @@
// CHECK-NEXT: store <8 x i64> [[SHUFFLE_I]], <8 x i64>* [[__T1_I]], align 64
// CHECK-NEXT: [[TMP3:%.*]] = load <8 x i64>, <8 x i64>* [[__V_ADDR_I]], align 64
// CHECK-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[__T1_I]], align 64
-// CHECK-NEXT: store <8 x i64> [[TMP3]], <8 x i64>* [[__A_ADDR_I_I]], align 64
-// CHECK-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[__B_ADDR_I_I]], align 64
-// CHECK-NEXT: [[TMP5:%.*]] = load <8 x i64>, <8 x i64>* [[__A_ADDR_I_I]], align 64
-// CHECK-NEXT: [[TMP6:%.*]] = load <8 x i64>, <8 x i64>* [[__B_ADDR_I_I]], align 64
+// CHECK-NEXT: store <8 x i64> [[TMP3]], <8 x i64>* [[__A_ADDR_I7_I]], align 64
+// CHECK-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[__B_ADDR_I8_I]], align 64
+// CHECK-NEXT: [[TMP5:%.*]] = load <8 x i64>, <8 x i64>* [[__A_ADDR_I7_I]], align 64
+// CHECK-NEXT: [[TMP6:%.*]] = load <8 x i64>, <8 x i64>* [[__B_ADDR_I8_I]], align 64
// CHECK-NEXT: [[TMP7:%.*]] = icmp slt <8 x i64> [[TMP5]], [[TMP6]]
// CHECK-NEXT: [[TMP8:%.*]] = select <8 x i1> [[TMP7]], <8 x i64> [[TMP5]], <8 x i64> [[TMP6]]
// CHECK-NEXT: store <8 x i64> [[TMP8]], <8 x i64>* [[__T2_I]], align 64
@@ -238,10 +238,10 @@
// CHECK-NEXT: store <8 x i64> [[SHUFFLE1_I]], <8 x i64>* [[__T3_I]], align 64
// CHECK-NEXT: [[TMP11:%.*]] = load <8 x i64>, <8 x i64>* [[__T2_I]], align 64
// CHECK-NEXT: [[TMP12:%.*]] = load <8 x i64>, <8 x i64>* [[__T3_I]], align 64
-// CHECK-NEXT: store <8 x i64> [[TMP11]], <8 x i64>* [[__A_ADDR_I7_I]], align 64
-// CHECK-NEXT: store <8 x i64> [[TMP12]], <8 x i64>* [[__B_ADDR_I8_I]], align 64
-// CHECK-NEXT: [[TMP13:%.*]] = load <8 x i64>, <8 x i64>* [[__A_ADDR_I7_I]], align 64
-// CHECK-NEXT: [[TMP14:%.*]] = load <8 x i64>, <8 x i64>* [[__B_ADDR_I8_I]], align 64
+// CHECK-NEXT: store <8 x i64> [[TMP11]], <8 x i64>* [[__A_ADDR_I5_I]], align 64
+// CHECK-NEXT: store <8 x i64> [[TMP12]], <8 x i64>* [[__B_ADDR_I6_I]], align 64
+// CHECK-NEXT: [[TMP13:%.*]] = load <8 x i64>, <8 x i64>* [[__A_ADDR_I5_I]], align 64
+// CHECK-NEXT: [[TMP14:%.*]] = load <8 x i64>, <8 x i64>* [[__B_ADDR_I6_I]], align 64
// CHECK-NEXT: [[TMP15:%.*]] = icmp slt <8 x i64> [[TMP13]], [[TMP14]]
// CHECK-NEXT: [[TMP16:%.*]] = select <8 x i1> [[TMP15]], <8 x i64> [[TMP13]], <8 x i64> [[TMP14]]
// CHECK-NEXT: store <8 x i64> [[TMP16]], <8 x i64>* [[__T4_I]], align 64
@@ -251,10 +251,10 @@
// CHECK-NEXT: store <8 x i64> [[SHUFFLE3_I]], <8 x i64>* [[__T5_I]], align 64
// CHECK-NEXT: [[TMP19:%.*]] = load <8 x i64>, <8 x i64>* [[__T4_I]], align 64
// CHECK-NEXT: [[TMP20:%.*]] = load <8 x i64>, <8 x i64>* [[__T5_I]], align 64
-// CHECK-NEXT: store <8 x i64> [[TMP19]], <8 x i64>* [[__A_ADDR_I5_I]], align 64
-// CHECK-NEXT: store <8 x i64> [[TMP20]], <8 x i64>* [[__B_ADDR_I6_I]], align 64
-// CHECK-NEXT: [[TMP21:%.*]] = load <8 x i64>, <8 x i64>* [[__A_ADDR_I5_I]], align 64
-// CHECK-NEXT: [[TMP22:%.*]] = load <8 x i64>, <8 x i64>* [[__B_ADDR_I6_I]], align 64
+// CHECK-NEXT: store <8 x i64> [[TMP19]], <8 x i64>* [[__A_ADDR_I_I]], align 64
+// CHECK-NEXT: store <8 x i64> [[TMP20]], <8 x i64>* [[__B_ADDR_I_I]], align 64
+// CHECK-NEXT: [[TMP21:%.*]] = load <8 x i64>, <8 x i64>* [[__A_ADDR_I_I]], align 64
+// CHECK-NEXT: [[TMP22:%.*]] = load <8 x i64>, <8 x i64>* [[__B_ADDR_I_I]], align 64
// CHECK-NEXT: [[TMP23:%.*]] = icmp slt <8 x i64> [[TMP21]], [[TMP22]]
// CHECK-NEXT: [[TMP24:%.*]] = select <8 x i1> [[TMP23]], <8 x i64> [[TMP21]], <8 x i64> [[TMP22]]
// CHECK-NEXT: store <8 x i64> [[TMP24]], <8 x i64>* [[__T6_I]], align 64
@@ -290,10 +290,10 @@
// CHECK-NEXT: store <8 x i64> [[SHUFFLE_I]], <8 x i64>* [[__T1_I]], align 64
// CHECK-NEXT: [[TMP3:%.*]] = load <8 x i64>, <8 x i64>* [[__V_ADDR_I]], align 64
// CHECK-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[__T1_I]], align 64
-// CHECK-NEXT: store <8 x i64> [[TMP3]], <8 x i64>* [[__A_ADDR_I_I]], align 64
-// CHECK-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[__B_ADDR_I_I]], align 64
-// CHECK-NEXT: [[TMP5:%.*]] = load <8 x i64>, <8 x i64>* [[__A_ADDR_I_I]], align 64
-// CHECK-NEXT: [[TMP6:%.*]] = load <8 x i64>, <8 x i64>* [[__B_ADDR_I_I]], align 64
+// CHECK-NEXT: store <8 x i64> [[TMP3]], <8 x i64>* [[__A_ADDR_I7_I]], align 64
+// CHECK-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[__B_ADDR_I8_I]], align 64
+// CHECK-NEXT: [[TMP5:%.*]] = load <8 x i64>, <8 x i64>* [[__A_ADDR_I7_I]], align 64
+// CHECK-NEXT: [[TMP6:%.*]] = load <8 x i64>, <8 x i64>* [[__B_ADDR_I8_I]], align 64
// CHECK-NEXT: [[TMP7:%.*]] = icmp ult <8 x i64> [[TMP5]], [[TMP6]]
// CHECK-NEXT: [[TMP8:%.*]] = select <8 x i1> [[TMP7]], <8 x i64> [[TMP5]], <8 x i64> [[TMP6]]
// CHECK-NEXT: store <8 x i64> [[TMP8]], <8 x i64>* [[__T2_I]], align 64
@@ -303,10 +303,10 @@
// CHECK-NEXT: store <8 x i64> [[SHUFFLE1_I]], <8 x i64>* [[__T3_I]], align 64
// CHECK-NEXT: [[TMP11:%.*]] = load <8 x i64>, <8 x i64>* [[__T2_I]], align 64
// CHECK-NEXT: [[TMP12:%.*]] = load <8 x i64>, <8 x i64>* [[__T3_I]], align 64
-// CHECK-NEXT: store <8 x i64> [[TMP11]], <8 x i64>* [[__A_ADDR_I7_I]], align 64
-// CHECK-NEXT: store <8 x i64> [[TMP12]], <8 x i64>* [[__B_ADDR_I8_I]], align 64
-// CHECK-NEXT: [[TMP13:%.*]] = load <8 x i64>, <8 x i64>* [[__A_ADDR_I7_I]], align 64
-// CHECK-NEXT: [[TMP14:%.*]] = load <8 x i64>, <8 x i64>* [[__B_ADDR_I8_I]], align 64
+// CHECK-NEXT: store <8 x i64> [[TMP11]], <8 x i64>* [[__A_ADDR_I5_I]], align 64
+// CHECK-NEXT: store <8 x i64> [[TMP12]], <8 x i64>* [[__B_ADDR_I6_I]], align 64
+// CHECK-NEXT: [[TMP13:%.*]] = load <8 x i64>, <8 x i64>* [[__A_ADDR_I5_I]], align 64
+// CHECK-NEXT: [[TMP14:%.*]] = load <8 x i64>, <8 x i64>* [[__B_ADDR_I6_I]], align 64
// CHECK-NEXT: [[TMP15:%.*]] = icmp ult <8 x i64> [[TMP13]], [[TMP14]]
// CHECK-NEXT: [[TMP16:%.*]] = select <8 x i1> [[TMP15]], <8 x i64> [[TMP13]], <8 x i64> [[TMP14]]
// CHECK-NEXT: store <8 x i64> [[TMP16]], <8 x i64>* [[__T4_I]], align 64
@@ -316,10 +316,10 @@
// CHECK-NEXT: store <8 x i64> [[SHUFFLE3_I]], <8 x i64>* [[__T5_I]], align 64
// CHECK-NEXT: [[TMP19:%.*]] = load <8 x i64>, <8 x i64>* [[__T4_I]], align 64
// CHECK-NEXT: [[TMP20:%.*]] = load <8 x i64>, <8 x i64>* [[__T5_I]], align 64
-// CHECK-NEXT: store <8 x i64> [[TMP19]], <8 x i64>* [[__A_ADDR_I5_I]], align 64
-// CHECK-NEXT: store <8 x i64> [[TMP20]], <8 x i64>* [[__B_ADDR_I6_I]], align 64
-// CHECK-NEXT: [[TMP21:%.*]] = load <8 x i64>, <8 x i64>* [[__A_ADDR_I5_I]], align 64
-// CHECK-NEXT: [[TMP22:%.*]] = load <8 x i64>, <8 x i64>* [[__B_ADDR_I6_I]], align 64
+// CHECK-NEXT: store <8 x i64> [[TMP19]], <8 x i64>* [[__A_ADDR_I_I]], align 64
+// CHECK-NEXT: store <8 x i64> [[TMP20]], <8 x i64>* [[__B_ADDR_I_I]], align 64
+// CHECK-NEXT: [[TMP21:%.*]] = load <8 x i64>, <8 x i64>* [[__A_ADDR_I_I]], align 64
+// CHECK-NEXT: [[TMP22:%.*]] = load <8 x i64>, <8 x i64>* [[__B_ADDR_I_I]], align 64
// CHECK-NEXT: [[TMP23:%.*]] = icmp ult <8 x i64> [[TMP21]], [[TMP22]]
// CHECK-NEXT: [[TMP24:%.*]] = select <8 x i1> [[TMP23]], <8 x i64> [[TMP21]], <8 x i64> [[TMP22]]
// CHECK-NEXT: store <8 x i64> [[TMP24]], <8 x i64>* [[__T6_I]], align 64
@@ -332,12 +332,12 @@
// CHECK-LABEL: define double @test_mm512_reduce_min_pd(<8 x double> %__W) #0 {
// CHECK-NEXT: entry:
-// CHECK-NEXT: [[__A_ADDR_I10_I:%.*]] = alloca <4 x double>, align 32
-// CHECK-NEXT: [[__B_ADDR_I11_I:%.*]] = alloca <4 x double>, align 32
// CHECK-NEXT: [[__A_ADDR_I8_I:%.*]] = alloca <2 x double>, align 16
// CHECK-NEXT: [[__B_ADDR_I9_I:%.*]] = alloca <2 x double>, align 16
// CHECK-NEXT: [[__A_ADDR_I_I:%.*]] = alloca <2 x double>, align 16
// CHECK-NEXT: [[__B_ADDR_I_I:%.*]] = alloca <2 x double>, align 16
+// CHECK-NEXT: [[__A_ADDR_I10_I:%.*]] = alloca <4 x double>, align 32
+// CHECK-NEXT: [[__B_ADDR_I11_I:%.*]] = alloca <4 x double>, align 32
// CHECK-NEXT: [[__V_ADDR_I:%.*]] = alloca <8 x double>, align 64
// CHECK-NEXT: [[__T1_I:%.*]] = alloca <4 x double>, align 32
// CHECK-NEXT: [[__T2_I:%.*]] = alloca <4 x double>, align 32
@@ -400,6 +400,8 @@
// CHECK-LABEL: define i64 @test_mm512_mask_reduce_max_epi64(i8 zeroext %__M, <8 x i64> %__W) #0 {
// CHECK-NEXT: entry:
+// CHECK-NEXT: [[__D_ADDR_I_I:%.*]] = alloca i64, align 8
+// CHECK-NEXT: [[DOTCOMPOUNDLITERAL_I_I:%.*]] = alloca <8 x i64>, align 64
// CHECK-NEXT: [[__W_ADDR_I_I:%.*]] = alloca <8 x i64>, align 64
// CHECK-NEXT: [[__U_ADDR_I_I:%.*]] = alloca i8, align 1
// CHECK-NEXT: [[__A_ADDR_I11_I:%.*]] = alloca <8 x i64>, align 64
@@ -409,8 +411,6 @@
// CHECK-NEXT: [[__B_ADDR_I8_I:%.*]] = alloca <8 x i64>, align 64
// CHECK-NEXT: [[__A_ADDR_I_I:%.*]] = alloca <8 x i64>, align 64
// CHECK-NEXT: [[__B_ADDR_I_I:%.*]] = alloca <8 x i64>, align 64
-// CHECK-NEXT: [[__D_ADDR_I_I:%.*]] = alloca i64, align 8
-// CHECK-NEXT: [[DOTCOMPOUNDLITERAL_I_I:%.*]] = alloca <8 x i64>, align 64
// CHECK-NEXT: [[__M_ADDR_I:%.*]] = alloca i8, align 1
// CHECK-NEXT: [[__V_ADDR_I:%.*]] = alloca <8 x i64>, align 64
// CHECK-NEXT: [[__T1_I:%.*]] = alloca <8 x i64>, align 64
@@ -505,15 +505,15 @@
// CHECK-LABEL: define i64 @test_mm512_mask_reduce_max_epu64(i8 zeroext %__M, <8 x i64> %__W) #0 {
// CHECK-NEXT: entry:
-// CHECK-NEXT: [[__A_ADDR_I9_I:%.*]] = alloca <8 x i64>, align 64
-// CHECK-NEXT: [[__B_ADDR_I10_I:%.*]] = alloca <8 x i64>, align 64
-// CHECK-NEXT: [[__A_ADDR_I7_I:%.*]] = alloca <8 x i64>, align 64
-// CHECK-NEXT: [[__B_ADDR_I8_I:%.*]] = alloca <8 x i64>, align 64
-// CHECK-NEXT: [[__A_ADDR_I6_I:%.*]] = alloca <8 x i64>, align 64
-// CHECK-NEXT: [[__B_ADDR_I_I:%.*]] = alloca <8 x i64>, align 64
// CHECK-NEXT: [[DOTCOMPOUNDLITERAL_I_I_I:%.*]] = alloca <8 x i64>, align 64
// CHECK-NEXT: [[__U_ADDR_I_I:%.*]] = alloca i8, align 1
+// CHECK-NEXT: [[__A_ADDR_I9_I:%.*]] = alloca <8 x i64>, align 64
+// CHECK-NEXT: [[__A_ADDR_I7_I:%.*]] = alloca <8 x i64>, align 64
+// CHECK-NEXT: [[__B_ADDR_I10_I:%.*]] = alloca <8 x i64>, align 64
+// CHECK-NEXT: [[__A_ADDR_I6_I:%.*]] = alloca <8 x i64>, align 64
+// CHECK-NEXT: [[__B_ADDR_I8_I:%.*]] = alloca <8 x i64>, align 64
// CHECK-NEXT: [[__A_ADDR_I_I:%.*]] = alloca <8 x i64>, align 64
+// CHECK-NEXT: [[__B_ADDR_I_I:%.*]] = alloca <8 x i64>, align 64
// CHECK-NEXT: [[__M_ADDR_I:%.*]] = alloca i8, align 1
// CHECK-NEXT: [[__V_ADDR_I:%.*]] = alloca <8 x i64>, align 64
// CHECK-NEXT: [[__T1_I:%.*]] = alloca <8 x i64>, align 64
@@ -533,9 +533,9 @@
// CHECK-NEXT: [[TMP2:%.*]] = load i8, i8* [[__M_ADDR_I]], align 1
// CHECK-NEXT: [[TMP3:%.*]] = load <8 x i64>, <8 x i64>* [[__V_ADDR_I]], align 64
// CHECK-NEXT: store i8 [[TMP2]], i8* [[__U_ADDR_I_I]], align 1
-// CHECK-NEXT: store <8 x i64> [[TMP3]], <8 x i64>* [[__A_ADDR_I_I]], align 64
+// CHECK-NEXT: store <8 x i64> [[TMP3]], <8 x i64>* [[__A_ADDR_I9_I]], align 64
// CHECK-NEXT: [[TMP4:%.*]] = load i8, i8* [[__U_ADDR_I_I]], align 1
-// CHECK-NEXT: [[TMP5:%.*]] = load <8 x i64>, <8 x i64>* [[__A_ADDR_I_I]], align 64
+// CHECK-NEXT: [[TMP5:%.*]] = load <8 x i64>, <8 x i64>* [[__A_ADDR_I9_I]], align 64
// CHECK-NEXT: store <8 x i64> zeroinitializer, <8 x i64>* [[DOTCOMPOUNDLITERAL_I_I_I]], align 64
// CHECK-NEXT: [[TMP6:%.*]] = load <8 x i64>, <8 x i64>* [[DOTCOMPOUNDLITERAL_I_I_I]], align 64
// CHECK-NEXT: [[TMP7:%.*]] = bitcast i8 [[TMP4]] to <8 x i1>
@@ -547,9 +547,9 @@
// CHECK-NEXT: store <8 x i64> [[SHUFFLE_I]], <8 x i64>* [[__T1_I]], align 64
// CHECK-NEXT: [[TMP11:%.*]] = load <8 x i64>, <8 x i64>* [[__V_ADDR_I]], align 64
// CHECK-NEXT: [[TMP12:%.*]] = load <8 x i64>, <8 x i64>* [[__T1_I]], align 64
-// CHECK-NEXT: store <8 x i64> [[TMP11]], <8 x i64>* [[__A_ADDR_I9_I]], align 64
+// CHECK-NEXT: store <8 x i64> [[TMP11]], <8 x i64>* [[__A_ADDR_I7_I]], align 64
// CHECK-NEXT: store <8 x i64> [[TMP12]], <8 x i64>* [[__B_ADDR_I10_I]], align 64
-// CHECK-NEXT: [[TMP13:%.*]] = load <8 x i64>, <8 x i64>* [[__A_ADDR_I9_I]], align 64
+// CHECK-NEXT: [[TMP13:%.*]] = load <8 x i64>, <8 x i64>* [[__A_ADDR_I7_I]], align 64
// CHECK-NEXT: [[TMP14:%.*]] = load <8 x i64>, <8 x i64>* [[__B_ADDR_I10_I]], align 64
// CHECK-NEXT: [[TMP15:%.*]] = icmp ugt <8 x i64> [[TMP13]], [[TMP14]]
// CHECK-NEXT: [[TMP16:%.*]] = select <8 x i1> [[TMP15]], <8 x i64> [[TMP13]], <8 x i64> [[TMP14]]
@@ -560,9 +560,9 @@
// CHECK-NEXT: store <8 x i64> [[SHUFFLE2_I]], <8 x i64>* [[__T3_I]], align 64
// CHECK-NEXT: [[TMP19:%.*]] = load <8 x i64>, <8 x i64>* [[__T2_I]], align 64
// CHECK-NEXT: [[TMP20:%.*]] = load <8 x i64>, <8 x i64>* [[__T3_I]], align 64
-// CHECK-NEXT: store <8 x i64> [[TMP19]], <8 x i64>* [[__A_ADDR_I7_I]], align 64
+// CHECK-NEXT: store <8 x i64> [[TMP19]], <8 x i64>* [[__A_ADDR_I6_I]], align 64
// CHECK-NEXT: store <8 x i64> [[TMP20]], <8 x i64>* [[__B_ADDR_I8_I]], align 64
-// CHECK-NEXT: [[TMP21:%.*]] = load <8 x i64>, <8 x i64>* [[__A_ADDR_I7_I]], align 64
+// CHECK-NEXT: [[TMP21:%.*]] = load <8 x i64>, <8 x i64>* [[__A_ADDR_I6_I]], align 64
// CHECK-NEXT: [[TMP22:%.*]] = load <8 x i64>, <8 x i64>* [[__B_ADDR_I8_I]], align 64
// CHECK-NEXT: [[TMP23:%.*]] = icmp ugt <8 x i64> [[TMP21]], [[TMP22]]
// CHECK-NEXT: [[TMP24:%.*]] = select <8 x i1> [[TMP23]], <8 x i64> [[TMP21]], <8 x i64> [[TMP22]]
@@ -573,9 +573,9 @@
// CHECK-NEXT: store <8 x i64> [[SHUFFLE4_I]], <8 x i64>* [[__T5_I]], align 64
// CHECK-NEXT: [[TMP27:%.*]] = load <8 x i64>, <8 x i64>* [[__T4_I]], align 64
// CHECK-NEXT: [[TMP28:%.*]] = load <8 x i64>, <8 x i64>* [[__T5_I]], align 64
-// CHECK-NEXT: store <8 x i64> [[TMP27]], <8 x i64>* [[__A_ADDR_I6_I]], align 64
+// CHECK-NEXT: store <8 x i64> [[TMP27]], <8 x i64>* [[__A_ADDR_I_I]], align 64
// CHECK-NEXT: store <8 x i64> [[TMP28]], <8 x i64>* [[__B_ADDR_I_I]], align 64
-// CHECK-NEXT: [[TMP29:%.*]] = load <8 x i64>, <8 x i64>* [[__A_ADDR_I6_I]], align 64
+// CHECK-NEXT: [[TMP29:%.*]] = load <8 x i64>, <8 x i64>* [[__A_ADDR_I_I]], align 64
// CHECK-NEXT: [[TMP30:%.*]] = load <8 x i64>, <8 x i64>* [[__B_ADDR_I_I]], align 64
// CHECK-NEXT: [[TMP31:%.*]] = icmp ugt <8 x i64> [[TMP29]], [[TMP30]]
// CHECK-NEXT: [[TMP32:%.*]] = select <8 x i1> [[TMP31]], <8 x i64> [[TMP29]], <8 x i64> [[TMP30]]
@@ -589,17 +589,17 @@
// CHECK-LABEL: define double @test_mm512_mask_reduce_max_pd(i8 zeroext %__M, <8 x double> %__W) #0 {
// CHECK-NEXT: entry:
+// CHECK-NEXT: [[__W_ADDR_I_I:%.*]] = alloca double, align 8
+// CHECK-NEXT: [[DOTCOMPOUNDLITERAL_I_I:%.*]] = alloca <8 x double>, align 64
// CHECK-NEXT: [[__W2_ADDR_I_I:%.*]] = alloca <8 x double>, align 64
// CHECK-NEXT: [[__U_ADDR_I_I:%.*]] = alloca i8, align 1
// CHECK-NEXT: [[__A_ADDR_I_I:%.*]] = alloca <8 x double>, align 64
-// CHECK-NEXT: [[__A_ADDR_I12_I:%.*]] = alloca <4 x double>, align 32
-// CHECK-NEXT: [[__B_ADDR_I13_I:%.*]] = alloca <4 x double>, align 32
// CHECK-NEXT: [[__A_ADDR_I10_I:%.*]] = alloca <2 x double>, align 16
// CHECK-NEXT: [[__B_ADDR_I11_I:%.*]] = alloca <2 x double>, align 16
// CHECK-NEXT: [[__A2_ADDR_I_I:%.*]] = alloca <2 x double>, align 16
// CHECK-NEXT: [[__B_ADDR_I_I:%.*]] = alloca <2 x double>, align 16
-// CHECK-NEXT: [[__W_ADDR_I_I:%.*]] = alloca double, align 8
-// CHECK-NEXT: [[DOTCOMPOUNDLITERAL_I_I:%.*]] = alloca <8 x double>, align 64
+// CHECK-NEXT: [[__A_ADDR_I12_I:%.*]] = alloca <4 x double>, align 32
+// CHECK-NEXT: [[__B_ADDR_I13_I:%.*]] = alloca <4 x double>, align 32
// CHECK-NEXT: [[__M_ADDR_I:%.*]] = alloca i8, align 1
// CHECK-NEXT: [[__V_ADDR_I:%.*]] = alloca <8 x double>, align 64
// CHECK-NEXT: [[__T1_I:%.*]] = alloca <4 x double>, align 32
@@ -697,6 +697,8 @@
// CHECK-LABEL: define i64 @test_mm512_mask_reduce_min_epi64(i8 zeroext %__M, <8 x i64> %__W) #0 {
// CHECK-NEXT: entry:
+// CHECK-NEXT: [[__D_ADDR_I_I:%.*]] = alloca i64, align 8
+// CHECK-NEXT: [[DOTCOMPOUNDLITERAL_I_I:%.*]] = alloca <8 x i64>, align 64
// CHECK-NEXT: [[__W_ADDR_I_I:%.*]] = alloca <8 x i64>, align 64
// CHECK-NEXT: [[__U_ADDR_I_I:%.*]] = alloca i8, align 1
// CHECK-NEXT: [[__A_ADDR_I11_I:%.*]] = alloca <8 x i64>, align 64
@@ -706,8 +708,6 @@
// CHECK-NEXT: [[__B_ADDR_I8_I:%.*]] = alloca <8 x i64>, align 64
// CHECK-NEXT: [[__A_ADDR_I_I:%.*]] = alloca <8 x i64>, align 64
// CHECK-NEXT: [[__B_ADDR_I_I:%.*]] = alloca <8 x i64>, align 64
-// CHECK-NEXT: [[__D_ADDR_I_I:%.*]] = alloca i64, align 8
-// CHECK-NEXT: [[DOTCOMPOUNDLITERAL_I_I:%.*]] = alloca <8 x i64>, align 64
// CHECK-NEXT: [[__M_ADDR_I:%.*]] = alloca i8, align 1
// CHECK-NEXT: [[__V_ADDR_I:%.*]] = alloca <8 x i64>, align 64
// CHECK-NEXT: [[__T1_I:%.*]] = alloca <8 x i64>, align 64
@@ -802,6 +802,8 @@
// CHECK-LABEL: define i64 @test_mm512_mask_reduce_min_epu64(i8 zeroext %__M, <8 x i64> %__W) #0 {
// CHECK-NEXT: entry:
+// CHECK-NEXT: [[__D_ADDR_I_I:%.*]] = alloca i64, align 8
+// CHECK-NEXT: [[DOTCOMPOUNDLITERAL_I_I:%.*]] = alloca <8 x i64>, align 64
// CHECK-NEXT: [[__W_ADDR_I_I:%.*]] = alloca <8 x i64>, align 64
// CHECK-NEXT: [[__U_ADDR_I_I:%.*]] = alloca i8, align 1
// CHECK-NEXT: [[__A_ADDR_I11_I:%.*]] = alloca <8 x i64>, align 64
@@ -811,8 +813,6 @@
// CHECK-NEXT: [[__B_ADDR_I8_I:%.*]] = alloca <8 x i64>, align 64
// CHECK-NEXT: [[__A_ADDR_I_I:%.*]] = alloca <8 x i64>, align 64
// CHECK-NEXT: [[__B_ADDR_I_I:%.*]] = alloca <8 x i64>, align 64
-// CHECK-NEXT: [[__D_ADDR_I_I:%.*]] = alloca i64, align 8
-// CHECK-NEXT: [[DOTCOMPOUNDLITERAL_I_I:%.*]] = alloca <8 x i64>, align 64
// CHECK-NEXT: [[__M_ADDR_I:%.*]] = alloca i8, align 1
// CHECK-NEXT: [[__V_ADDR_I:%.*]] = alloca <8 x i64>, align 64
// CHECK-NEXT: [[__T1_I:%.*]] = alloca <8 x i64>, align 64
@@ -907,17 +907,17 @@
// CHECK-LABEL: define double @test_mm512_mask_reduce_min_pd(i8 zeroext %__M, <8 x double> %__W) #0 {
// CHECK-NEXT: entry:
+// CHECK-NEXT: [[__W_ADDR_I_I:%.*]] = alloca double, align 8
+// CHECK-NEXT: [[DOTCOMPOUNDLITERAL_I_I:%.*]] = alloca <8 x double>, align 64
// CHECK-NEXT: [[__W2_ADDR_I_I:%.*]] = alloca <8 x double>, align 64
// CHECK-NEXT: [[__U_ADDR_I_I:%.*]] = alloca i8, align 1
// CHECK-NEXT: [[__A_ADDR_I_I:%.*]] = alloca <8 x double>, align 64
-// CHECK-NEXT: [[__A_ADDR_I12_I:%.*]] = alloca <4 x double>, align 32
-// CHECK-NEXT: [[__B_ADDR_I13_I:%.*]] = alloca <4 x double>, align 32
// CHECK-NEXT: [[__A_ADDR_I10_I:%.*]] = alloca <2 x double>, align 16
// CHECK-NEXT: [[__B_ADDR_I11_I:%.*]] = alloca <2 x double>, align 16
// CHECK-NEXT: [[__A2_ADDR_I_I:%.*]] = alloca <2 x double>, align 16
// CHECK-NEXT: [[__B_ADDR_I_I:%.*]] = alloca <2 x double>, align 16
-// CHECK-NEXT: [[__W_ADDR_I_I:%.*]] = alloca double, align 8
-// CHECK-NEXT: [[DOTCOMPOUNDLITERAL_I_I:%.*]] = alloca <8 x double>, align 64
+// CHECK-NEXT: [[__A_ADDR_I12_I:%.*]] = alloca <4 x double>, align 32
+// CHECK-NEXT: [[__B_ADDR_I13_I:%.*]] = alloca <4 x double>, align 32
// CHECK-NEXT: [[__M_ADDR_I:%.*]] = alloca i8, align 1
// CHECK-NEXT: [[__V_ADDR_I:%.*]] = alloca <8 x double>, align 64
// CHECK-NEXT: [[__T1_I:%.*]] = alloca <4 x double>, align 32
@@ -1015,14 +1015,14 @@
// CHECK-LABEL: define i32 @test_mm512_reduce_max_epi32(<8 x i64> %__W) #0 {
// CHECK-NEXT: entry:
-// CHECK-NEXT: [[__A_ADDR_I_I:%.*]] = alloca <4 x i64>, align 32
-// CHECK-NEXT: [[__B_ADDR_I_I:%.*]] = alloca <4 x i64>, align 32
// CHECK-NEXT: [[__V1_ADDR_I12_I:%.*]] = alloca <2 x i64>, align 16
// CHECK-NEXT: [[__V2_ADDR_I13_I:%.*]] = alloca <2 x i64>, align 16
// CHECK-NEXT: [[__V1_ADDR_I10_I:%.*]] = alloca <2 x i64>, align 16
// CHECK-NEXT: [[__V2_ADDR_I11_I:%.*]] = alloca <2 x i64>, align 16
// CHECK-NEXT: [[__V1_ADDR_I_I:%.*]] = alloca <2 x i64>, align 16
// CHECK-NEXT: [[__V2_ADDR_I_I:%.*]] = alloca <2 x i64>, align 16
+// CHECK-NEXT: [[__A_ADDR_I_I:%.*]] = alloca <4 x i64>, align 32
+// CHECK-NEXT: [[__B_ADDR_I_I:%.*]] = alloca <4 x i64>, align 32
// CHECK-NEXT: [[__V_ADDR_I:%.*]] = alloca <8 x i64>, align 64
// CHECK-NEXT: [[__T1_I:%.*]] = alloca <4 x i64>, align 32
// CHECK-NEXT: [[__T2_I:%.*]] = alloca <4 x i64>, align 32
@@ -1111,9 +1111,10 @@
// CHECK-NEXT: [[TMP48:%.*]] = icmp sgt <4 x i32> [[TMP45]], [[TMP47]]
// CHECK-NEXT: [[TMP49:%.*]] = select <4 x i1> [[TMP48]], <4 x i32> [[TMP45]], <4 x i32> [[TMP47]]
// CHECK-NEXT: [[TMP50:%.*]] = bitcast <4 x i32> [[TMP49]] to <2 x i64>
-// CHECK-NEXT: store <4 x i32> [[TMP49]], <4 x i32>* [[__T10_I]], align 16
-// CHECK-NEXT: [[TMP51:%.*]] = load <4 x i32>, <4 x i32>* [[__T10_I]], align 16
-// CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <4 x i32> [[TMP51]], i32 0
+// CHECK-NEXT: [[TMP51:%.*]] = bitcast <2 x i64> [[TMP50]] to <4 x i32>
+// CHECK-NEXT: store <4 x i32> [[TMP51]], <4 x i32>* [[__T10_I]], align 16
+// CHECK-NEXT: [[TMP52:%.*]] = load <4 x i32>, <4 x i32>* [[__T10_I]], align 16
+// CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <4 x i32> [[TMP52]], i32 0
// CHECK-NEXT: ret i32 [[VECEXT_I]]
int test_mm512_reduce_max_epi32(__m512i __W){
return _mm512_reduce_max_epi32(__W);
@@ -1121,14 +1122,14 @@
// CHECK-LABEL: define i32 @test_mm512_reduce_max_epu32(<8 x i64> %__W) #0 {
// CHECK-NEXT: entry:
-// CHECK-NEXT: [[__A_ADDR_I_I:%.*]] = alloca <4 x i64>, align 32
-// CHECK-NEXT: [[__B_ADDR_I_I:%.*]] = alloca <4 x i64>, align 32
// CHECK-NEXT: [[__V1_ADDR_I12_I:%.*]] = alloca <2 x i64>, align 16
// CHECK-NEXT: [[__V2_ADDR_I13_I:%.*]] = alloca <2 x i64>, align 16
// CHECK-NEXT: [[__V1_ADDR_I10_I:%.*]] = alloca <2 x i64>, align 16
// CHECK-NEXT: [[__V2_ADDR_I11_I:%.*]] = alloca <2 x i64>, align 16
// CHECK-NEXT: [[__V1_ADDR_I_I:%.*]] = alloca <2 x i64>, align 16
// CHECK-NEXT: [[__V2_ADDR_I_I:%.*]] = alloca <2 x i64>, align 16
+// CHECK-NEXT: [[__A_ADDR_I_I:%.*]] = alloca <4 x i64>, align 32
+// CHECK-NEXT: [[__B_ADDR_I_I:%.*]] = alloca <4 x i64>, align 32
// CHECK-NEXT: [[__V_ADDR_I:%.*]] = alloca <8 x i64>, align 64
// CHECK-NEXT: [[__T1_I:%.*]] = alloca <4 x i64>, align 32
// CHECK-NEXT: [[__T2_I:%.*]] = alloca <4 x i64>, align 32
@@ -1217,9 +1218,10 @@
// CHECK-NEXT: [[TMP48:%.*]] = icmp ugt <4 x i32> [[TMP45]], [[TMP47]]
// CHECK-NEXT: [[TMP49:%.*]] = select <4 x i1> [[TMP48]], <4 x i32> [[TMP45]], <4 x i32> [[TMP47]]
// CHECK-NEXT: [[TMP50:%.*]] = bitcast <4 x i32> [[TMP49]] to <2 x i64>
-// CHECK-NEXT: store <4 x i32> [[TMP49]], <4 x i32>* [[__T10_I]], align 16
-// CHECK-NEXT: [[TMP51:%.*]] = load <4 x i32>, <4 x i32>* [[__T10_I]], align 16
-// CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <4 x i32> [[TMP51]], i32 0
+// CHECK-NEXT: [[TMP51:%.*]] = bitcast <2 x i64> [[TMP50]] to <4 x i32>
+// CHECK-NEXT: store <4 x i32> [[TMP51]], <4 x i32>* [[__T10_I]], align 16
+// CHECK-NEXT: [[TMP52:%.*]] = load <4 x i32>, <4 x i32>* [[__T10_I]], align 16
+// CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <4 x i32> [[TMP52]], i32 0
// CHECK-NEXT: ret i32 [[VECEXT_I]]
unsigned int test_mm512_reduce_max_epu32(__m512i __W){
return _mm512_reduce_max_epu32(__W);
@@ -1227,14 +1229,14 @@
// CHECK-LABEL: define float @test_mm512_reduce_max_ps(<16 x float> %__W) #0 {
// CHECK-NEXT: entry:
-// CHECK-NEXT: [[__A_ADDR_I14_I:%.*]] = alloca <8 x float>, align 32
-// CHECK-NEXT: [[__B_ADDR_I15_I:%.*]] = alloca <8 x float>, align 32
// CHECK-NEXT: [[__A_ADDR_I12_I:%.*]] = alloca <4 x float>, align 16
// CHECK-NEXT: [[__B_ADDR_I13_I:%.*]] = alloca <4 x float>, align 16
// CHECK-NEXT: [[__A_ADDR_I10_I:%.*]] = alloca <4 x float>, align 16
// CHECK-NEXT: [[__B_ADDR_I11_I:%.*]] = alloca <4 x float>, align 16
// CHECK-NEXT: [[__A_ADDR_I_I:%.*]] = alloca <4 x float>, align 16
// CHECK-NEXT: [[__B_ADDR_I_I:%.*]] = alloca <4 x float>, align 16
+// CHECK-NEXT: [[__A_ADDR_I14_I:%.*]] = alloca <8 x float>, align 32
+// CHECK-NEXT: [[__B_ADDR_I15_I:%.*]] = alloca <8 x float>, align 32
// CHECK-NEXT: [[__V_ADDR_I:%.*]] = alloca <16 x float>, align 64
// CHECK-NEXT: [[__T1_I:%.*]] = alloca <8 x float>, align 32
// CHECK-NEXT: [[__T2_I:%.*]] = alloca <8 x float>, align 32
@@ -1315,14 +1317,14 @@
// CHECK-LABEL: define i32 @test_mm512_reduce_min_epi32(<8 x i64> %__W) #0 {
// CHECK-NEXT: entry:
-// CHECK-NEXT: [[__A_ADDR_I_I:%.*]] = alloca <4 x i64>, align 32
-// CHECK-NEXT: [[__B_ADDR_I_I:%.*]] = alloca <4 x i64>, align 32
// CHECK-NEXT: [[__V1_ADDR_I12_I:%.*]] = alloca <2 x i64>, align 16
// CHECK-NEXT: [[__V2_ADDR_I13_I:%.*]] = alloca <2 x i64>, align 16
// CHECK-NEXT: [[__V1_ADDR_I10_I:%.*]] = alloca <2 x i64>, align 16
// CHECK-NEXT: [[__V2_ADDR_I11_I:%.*]] = alloca <2 x i64>, align 16
// CHECK-NEXT: [[__V1_ADDR_I_I:%.*]] = alloca <2 x i64>, align 16
// CHECK-NEXT: [[__V2_ADDR_I_I:%.*]] = alloca <2 x i64>, align 16
+// CHECK-NEXT: [[__A_ADDR_I_I:%.*]] = alloca <4 x i64>, align 32
+// CHECK-NEXT: [[__B_ADDR_I_I:%.*]] = alloca <4 x i64>, align 32
// CHECK-NEXT: [[__V_ADDR_I:%.*]] = alloca <8 x i64>, align 64
// CHECK-NEXT: [[__T1_I:%.*]] = alloca <4 x i64>, align 32
// CHECK-NEXT: [[__T2_I:%.*]] = alloca <4 x i64>, align 32
@@ -1411,9 +1413,10 @@
// CHECK-NEXT: [[TMP48:%.*]] = icmp slt <4 x i32> [[TMP45]], [[TMP47]]
// CHECK-NEXT: [[TMP49:%.*]] = select <4 x i1> [[TMP48]], <4 x i32> [[TMP45]], <4 x i32> [[TMP47]]
// CHECK-NEXT: [[TMP50:%.*]] = bitcast <4 x i32> [[TMP49]] to <2 x i64>
-// CHECK-NEXT: store <4 x i32> [[TMP49]], <4 x i32>* [[__T10_I]], align 16
-// CHECK-NEXT: [[TMP51:%.*]] = load <4 x i32>, <4 x i32>* [[__T10_I]], align 16
-// CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <4 x i32> [[TMP51]], i32 0
+// CHECK-NEXT: [[TMP51:%.*]] = bitcast <2 x i64> [[TMP50]] to <4 x i32>
+// CHECK-NEXT: store <4 x i32> [[TMP51]], <4 x i32>* [[__T10_I]], align 16
+// CHECK-NEXT: [[TMP52:%.*]] = load <4 x i32>, <4 x i32>* [[__T10_I]], align 16
+// CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <4 x i32> [[TMP52]], i32 0
// CHECK-NEXT: ret i32 [[VECEXT_I]]
int test_mm512_reduce_min_epi32(__m512i __W){
return _mm512_reduce_min_epi32(__W);
@@ -1421,14 +1424,14 @@
// CHECK-LABEL: define i32 @test_mm512_reduce_min_epu32(<8 x i64> %__W) #0 {
// CHECK-NEXT: entry:
-// CHECK-NEXT: [[__A_ADDR_I_I:%.*]] = alloca <4 x i64>, align 32
-// CHECK-NEXT: [[__B_ADDR_I_I:%.*]] = alloca <4 x i64>, align 32
// CHECK-NEXT: [[__V1_ADDR_I12_I:%.*]] = alloca <2 x i64>, align 16
// CHECK-NEXT: [[__V2_ADDR_I13_I:%.*]] = alloca <2 x i64>, align 16
// CHECK-NEXT: [[__V1_ADDR_I10_I:%.*]] = alloca <2 x i64>, align 16
// CHECK-NEXT: [[__V2_ADDR_I11_I:%.*]] = alloca <2 x i64>, align 16
// CHECK-NEXT: [[__V1_ADDR_I_I:%.*]] = alloca <2 x i64>, align 16
// CHECK-NEXT: [[__V2_ADDR_I_I:%.*]] = alloca <2 x i64>, align 16
+// CHECK-NEXT: [[__A_ADDR_I_I:%.*]] = alloca <4 x i64>, align 32
+// CHECK-NEXT: [[__B_ADDR_I_I:%.*]] = alloca <4 x i64>, align 32
// CHECK-NEXT: [[__V_ADDR_I:%.*]] = alloca <8 x i64>, align 64
// CHECK-NEXT: [[__T1_I:%.*]] = alloca <4 x i64>, align 32
// CHECK-NEXT: [[__T2_I:%.*]] = alloca <4 x i64>, align 32
@@ -1517,9 +1520,10 @@
// CHECK-NEXT: [[TMP48:%.*]] = icmp ult <4 x i32> [[TMP45]], [[TMP47]]
// CHECK-NEXT: [[TMP49:%.*]] = select <4 x i1> [[TMP48]], <4 x i32> [[TMP45]], <4 x i32> [[TMP47]]
// CHECK-NEXT: [[TMP50:%.*]] = bitcast <4 x i32> [[TMP49]] to <2 x i64>
-// CHECK-NEXT: store <4 x i32> [[TMP49]], <4 x i32>* [[__T10_I]], align 16
-// CHECK-NEXT: [[TMP51:%.*]] = load <4 x i32>, <4 x i32>* [[__T10_I]], align 16
-// CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <4 x i32> [[TMP51]], i32 0
+// CHECK-NEXT: [[TMP51:%.*]] = bitcast <2 x i64> [[TMP50]] to <4 x i32>
+// CHECK-NEXT: store <4 x i32> [[TMP51]], <4 x i32>* [[__T10_I]], align 16
+// CHECK-NEXT: [[TMP52:%.*]] = load <4 x i32>, <4 x i32>* [[__T10_I]], align 16
+// CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <4 x i32> [[TMP52]], i32 0
// CHECK-NEXT: ret i32 [[VECEXT_I]]
unsigned int test_mm512_reduce_min_epu32(__m512i __W){
return _mm512_reduce_min_epu32(__W);
@@ -1527,14 +1531,14 @@
// CHECK-LABEL: define float @test_mm512_reduce_min_ps(<16 x float> %__W) #0 {
// CHECK-NEXT: entry:
-// CHECK-NEXT: [[__A_ADDR_I14_I:%.*]] = alloca <8 x float>, align 32
-// CHECK-NEXT: [[__B_ADDR_I15_I:%.*]] = alloca <8 x float>, align 32
// CHECK-NEXT: [[__A_ADDR_I12_I:%.*]] = alloca <4 x float>, align 16
// CHECK-NEXT: [[__B_ADDR_I13_I:%.*]] = alloca <4 x float>, align 16
// CHECK-NEXT: [[__A_ADDR_I10_I:%.*]] = alloca <4 x float>, align 16
// CHECK-NEXT: [[__B_ADDR_I11_I:%.*]] = alloca <4 x float>, align 16
// CHECK-NEXT: [[__A_ADDR_I_I:%.*]] = alloca <4 x float>, align 16
// CHECK-NEXT: [[__B_ADDR_I_I:%.*]] = alloca <4 x float>, align 16
+// CHECK-NEXT: [[__A_ADDR_I14_I:%.*]] = alloca <8 x float>, align 32
+// CHECK-NEXT: [[__B_ADDR_I15_I:%.*]] = alloca <8 x float>, align 32
// CHECK-NEXT: [[__V_ADDR_I:%.*]] = alloca <16 x float>, align 64
// CHECK-NEXT: [[__T1_I:%.*]] = alloca <8 x float>, align 32
// CHECK-NEXT: [[__T2_I:%.*]] = alloca <8 x float>, align 32
@@ -1615,19 +1619,19 @@
// CHECK-LABEL: define i32 @test_mm512_mask_reduce_max_epi32(i16 zeroext %__M, <8 x i64> %__W) #0 {
// CHECK-NEXT: entry:
+// CHECK-NEXT: [[__S_ADDR_I_I:%.*]] = alloca i32, align 4
+// CHECK-NEXT: [[DOTCOMPOUNDLITERAL_I_I:%.*]] = alloca <16 x i32>, align 64
// CHECK-NEXT: [[__W_ADDR_I_I:%.*]] = alloca <8 x i64>, align 64
// CHECK-NEXT: [[__U_ADDR_I_I:%.*]] = alloca i16, align 2
// CHECK-NEXT: [[__A2_ADDR_I_I:%.*]] = alloca <8 x i64>, align 64
-// CHECK-NEXT: [[__A_ADDR_I_I:%.*]] = alloca <4 x i64>, align 32
-// CHECK-NEXT: [[__B_ADDR_I_I:%.*]] = alloca <4 x i64>, align 32
// CHECK-NEXT: [[__V1_ADDR_I14_I:%.*]] = alloca <2 x i64>, align 16
// CHECK-NEXT: [[__V2_ADDR_I15_I:%.*]] = alloca <2 x i64>, align 16
// CHECK-NEXT: [[__V1_ADDR_I12_I:%.*]] = alloca <2 x i64>, align 16
// CHECK-NEXT: [[__V2_ADDR_I13_I:%.*]] = alloca <2 x i64>, align 16
// CHECK-NEXT: [[__V1_ADDR_I_I:%.*]] = alloca <2 x i64>, align 16
// CHECK-NEXT: [[__V2_ADDR_I_I:%.*]] = alloca <2 x i64>, align 16
-// CHECK-NEXT: [[__S_ADDR_I_I:%.*]] = alloca i32, align 4
-// CHECK-NEXT: [[DOTCOMPOUNDLITERAL_I_I:%.*]] = alloca <16 x i32>, align 64
+// CHECK-NEXT: [[__A_ADDR_I_I:%.*]] = alloca <4 x i64>, align 32
+// CHECK-NEXT: [[__B_ADDR_I_I:%.*]] = alloca <4 x i64>, align 32
// CHECK-NEXT: [[__M_ADDR_I:%.*]] = alloca i16, align 2
// CHECK-NEXT: [[__V_ADDR_I:%.*]] = alloca <8 x i64>, align 64
// CHECK-NEXT: [[__T1_I:%.*]] = alloca <4 x i64>, align 32
@@ -1771,9 +1775,10 @@
// CHECK-NEXT: [[TMP77:%.*]] = icmp sgt <4 x i32> [[TMP74]], [[TMP76]]
// CHECK-NEXT: [[TMP78:%.*]] = select <4 x i1> [[TMP77]], <4 x i32> [[TMP74]], <4 x i32> [[TMP76]]
// CHECK-NEXT: [[TMP79:%.*]] = bitcast <4 x i32> [[TMP78]] to <2 x i64>
-// CHECK-NEXT: store <4 x i32> [[TMP78]], <4 x i32>* [[__T10_I]], align 16
-// CHECK-NEXT: [[TMP80:%.*]] = load <4 x i32>, <4 x i32>* [[__T10_I]], align 16
-// CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <4 x i32> [[TMP80]], i32 0
+// CHECK-NEXT: [[TMP80:%.*]] = bitcast <2 x i64> [[TMP79]] to <4 x i32>
+// CHECK-NEXT: store <4 x i32> [[TMP80]], <4 x i32>* [[__T10_I]], align 16
+// CHECK-NEXT: [[TMP81:%.*]] = load <4 x i32>, <4 x i32>* [[__T10_I]], align 16
+// CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <4 x i32> [[TMP81]], i32 0
// CHECK-NEXT: ret i32 [[VECEXT_I]]
int test_mm512_mask_reduce_max_epi32(__mmask16 __M, __m512i __W){
return _mm512_mask_reduce_max_epi32(__M, __W);
@@ -1781,17 +1786,17 @@
// CHECK-LABEL: define i32 @test_mm512_mask_reduce_max_epu32(i16 zeroext %__M, <8 x i64> %__W) #0 {
// CHECK-NEXT: entry:
-// CHECK-NEXT: [[__A2_ADDR_I_I:%.*]] = alloca <4 x i64>, align 32
-// CHECK-NEXT: [[__B_ADDR_I_I:%.*]] = alloca <4 x i64>, align 32
+// CHECK-NEXT: [[DOTCOMPOUNDLITERAL_I_I_I:%.*]] = alloca <8 x i64>, align 64
+// CHECK-NEXT: [[__U_ADDR_I_I:%.*]] = alloca i16, align 2
+// CHECK-NEXT: [[__A_ADDR_I_I:%.*]] = alloca <8 x i64>, align 64
// CHECK-NEXT: [[__V1_ADDR_I13_I:%.*]] = alloca <2 x i64>, align 16
// CHECK-NEXT: [[__V2_ADDR_I14_I:%.*]] = alloca <2 x i64>, align 16
// CHECK-NEXT: [[__V1_ADDR_I11_I:%.*]] = alloca <2 x i64>, align 16
// CHECK-NEXT: [[__V2_ADDR_I12_I:%.*]] = alloca <2 x i64>, align 16
// CHECK-NEXT: [[__V1_ADDR_I_I:%.*]] = alloca <2 x i64>, align 16
// CHECK-NEXT: [[__V2_ADDR_I_I:%.*]] = alloca <2 x i64>, align 16
-// CHECK-NEXT: [[DOTCOMPOUNDLITERAL_I_I_I:%.*]] = alloca <8 x i64>, align 64
-// CHECK-NEXT: [[__U_ADDR_I_I:%.*]] = alloca i16, align 2
-// CHECK-NEXT: [[__A_ADDR_I_I:%.*]] = alloca <8 x i64>, align 64
+// CHECK-NEXT: [[__A2_ADDR_I_I:%.*]] = alloca <4 x i64>, align 32
+// CHECK-NEXT: [[__B_ADDR_I_I:%.*]] = alloca <4 x i64>, align 32
// CHECK-NEXT: [[__M_ADDR_I:%.*]] = alloca i16, align 2
// CHECK-NEXT: [[__V_ADDR_I:%.*]] = alloca <8 x i64>, align 64
// CHECK-NEXT: [[__T1_I:%.*]] = alloca <4 x i64>, align 32
@@ -1899,9 +1904,10 @@
// CHECK-NEXT: [[TMP59:%.*]] = icmp ugt <4 x i32> [[TMP56]], [[TMP58]]
// CHECK-NEXT: [[TMP60:%.*]] = select <4 x i1> [[TMP59]], <4 x i32> [[TMP56]], <4 x i32> [[TMP58]]
// CHECK-NEXT: [[TMP61:%.*]] = bitcast <4 x i32> [[TMP60]] to <2 x i64>
-// CHECK-NEXT: store <4 x i32> [[TMP60]], <4 x i32>* [[__T10_I]], align 16
-// CHECK-NEXT: [[TMP62:%.*]] = load <4 x i32>, <4 x i32>* [[__T10_I]], align 16
-// CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <4 x i32> [[TMP62]], i32 0
+// CHECK-NEXT: [[TMP62:%.*]] = bitcast <2 x i64> [[TMP61]] to <4 x i32>
+// CHECK-NEXT: store <4 x i32> [[TMP62]], <4 x i32>* [[__T10_I]], align 16
+// CHECK-NEXT: [[TMP63:%.*]] = load <4 x i32>, <4 x i32>* [[__T10_I]], align 16
+// CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <4 x i32> [[TMP63]], i32 0
// CHECK-NEXT: ret i32 [[VECEXT_I]]
unsigned int test_mm512_mask_reduce_max_epu32(__mmask16 __M, __m512i __W){
return _mm512_mask_reduce_max_epu32(__M, __W);
@@ -1909,19 +1915,19 @@
// CHECK-LABEL: define float @test_mm512_mask_reduce_max_ps(i16 zeroext %__M, <16 x float> %__W) #0 {
// CHECK-NEXT: entry:
+// CHECK-NEXT: [[__W_ADDR_I_I:%.*]] = alloca float, align 4
+// CHECK-NEXT: [[DOTCOMPOUNDLITERAL_I_I:%.*]] = alloca <16 x float>, align 64
// CHECK-NEXT: [[__W2_ADDR_I_I:%.*]] = alloca <16 x float>, align 64
// CHECK-NEXT: [[__U_ADDR_I_I:%.*]] = alloca i16, align 2
// CHECK-NEXT: [[__A_ADDR_I_I:%.*]] = alloca <16 x float>, align 64
-// CHECK-NEXT: [[__A_ADDR_I16_I:%.*]] = alloca <8 x float>, align 32
-// CHECK-NEXT: [[__B_ADDR_I17_I:%.*]] = alloca <8 x float>, align 32
// CHECK-NEXT: [[__A_ADDR_I14_I:%.*]] = alloca <4 x float>, align 16
// CHECK-NEXT: [[__B_ADDR_I15_I:%.*]] = alloca <4 x float>, align 16
// CHECK-NEXT: [[__A_ADDR_I12_I:%.*]] = alloca <4 x float>, align 16
// CHECK-NEXT: [[__B_ADDR_I13_I:%.*]] = alloca <4 x float>, align 16
// CHECK-NEXT: [[__A2_ADDR_I_I:%.*]] = alloca <4 x float>, align 16
// CHECK-NEXT: [[__B_ADDR_I_I:%.*]] = alloca <4 x float>, align 16
-// CHECK-NEXT: [[__W_ADDR_I_I:%.*]] = alloca float, align 4
-// CHECK-NEXT: [[DOTCOMPOUNDLITERAL_I_I:%.*]] = alloca <16 x float>, align 64
+// CHECK-NEXT: [[__A_ADDR_I16_I:%.*]] = alloca <8 x float>, align 32
+// CHECK-NEXT: [[__B_ADDR_I17_I:%.*]] = alloca <8 x float>, align 32
// CHECK-NEXT: [[__M_ADDR_I:%.*]] = alloca i16, align 2
// CHECK-NEXT: [[__V_ADDR_I:%.*]] = alloca <16 x float>, align 64
// CHECK-NEXT: [[__T1_I:%.*]] = alloca <8 x float>, align 32
@@ -2053,19 +2059,19 @@
// CHECK-LABEL: define i32 @test_mm512_mask_reduce_min_epi32(i16 zeroext %__M, <8 x i64> %__W) #0 {
// CHECK-NEXT: entry:
+// CHECK-NEXT: [[__S_ADDR_I_I:%.*]] = alloca i32, align 4
+// CHECK-NEXT: [[DOTCOMPOUNDLITERAL_I_I:%.*]] = alloca <16 x i32>, align 64
// CHECK-NEXT: [[__W_ADDR_I_I:%.*]] = alloca <8 x i64>, align 64
// CHECK-NEXT: [[__U_ADDR_I_I:%.*]] = alloca i16, align 2
// CHECK-NEXT: [[__A_ADDR_I_I:%.*]] = alloca <8 x i64>, align 64
-// CHECK-NEXT: [[__A2_ADDR_I_I:%.*]] = alloca <4 x i64>, align 32
-// CHECK-NEXT: [[__B_ADDR_I_I:%.*]] = alloca <4 x i64>, align 32
// CHECK-NEXT: [[__V1_ADDR_I14_I:%.*]] = alloca <2 x i64>, align 16
// CHECK-NEXT: [[__V2_ADDR_I15_I:%.*]] = alloca <2 x i64>, align 16
// CHECK-NEXT: [[__V1_ADDR_I12_I:%.*]] = alloca <2 x i64>, align 16
// CHECK-NEXT: [[__V2_ADDR_I13_I:%.*]] = alloca <2 x i64>, align 16
// CHECK-NEXT: [[__V1_ADDR_I_I:%.*]] = alloca <2 x i64>, align 16
// CHECK-NEXT: [[__V2_ADDR_I_I:%.*]] = alloca <2 x i64>, align 16
-// CHECK-NEXT: [[__S_ADDR_I_I:%.*]] = alloca i32, align 4
-// CHECK-NEXT: [[DOTCOMPOUNDLITERAL_I_I:%.*]] = alloca <16 x i32>, align 64
+// CHECK-NEXT: [[__A2_ADDR_I_I:%.*]] = alloca <4 x i64>, align 32
+// CHECK-NEXT: [[__B_ADDR_I_I:%.*]] = alloca <4 x i64>, align 32
// CHECK-NEXT: [[__M_ADDR_I:%.*]] = alloca i16, align 2
// CHECK-NEXT: [[__V_ADDR_I:%.*]] = alloca <8 x i64>, align 64
// CHECK-NEXT: [[__T1_I:%.*]] = alloca <4 x i64>, align 32
@@ -2209,9 +2215,10 @@
// CHECK-NEXT: [[TMP77:%.*]] = icmp slt <4 x i32> [[TMP74]], [[TMP76]]
// CHECK-NEXT: [[TMP78:%.*]] = select <4 x i1> [[TMP77]], <4 x i32> [[TMP74]], <4 x i32> [[TMP76]]
// CHECK-NEXT: [[TMP79:%.*]] = bitcast <4 x i32> [[TMP78]] to <2 x i64>
-// CHECK-NEXT: store <4 x i32> [[TMP78]], <4 x i32>* [[__T10_I]], align 16
-// CHECK-NEXT: [[TMP80:%.*]] = load <4 x i32>, <4 x i32>* [[__T10_I]], align 16
-// CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <4 x i32> [[TMP80]], i32 0
+// CHECK-NEXT: [[TMP80:%.*]] = bitcast <2 x i64> [[TMP79]] to <4 x i32>
+// CHECK-NEXT: store <4 x i32> [[TMP80]], <4 x i32>* [[__T10_I]], align 16
+// CHECK-NEXT: [[TMP81:%.*]] = load <4 x i32>, <4 x i32>* [[__T10_I]], align 16
+// CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <4 x i32> [[TMP81]], i32 0
// CHECK-NEXT: ret i32 [[VECEXT_I]]
int test_mm512_mask_reduce_min_epi32(__mmask16 __M, __m512i __W){
return _mm512_mask_reduce_min_epi32(__M, __W);
@@ -2219,19 +2226,19 @@
// CHECK-LABEL: define i32 @test_mm512_mask_reduce_min_epu32(i16 zeroext %__M, <8 x i64> %__W) #0 {
// CHECK-NEXT: entry:
+// CHECK-NEXT: [[__S_ADDR_I_I:%.*]] = alloca i32, align 4
+// CHECK-NEXT: [[DOTCOMPOUNDLITERAL_I_I:%.*]] = alloca <16 x i32>, align 64
// CHECK-NEXT: [[__W_ADDR_I_I:%.*]] = alloca <8 x i64>, align 64
// CHECK-NEXT: [[__U_ADDR_I_I:%.*]] = alloca i16, align 2
// CHECK-NEXT: [[__A_ADDR_I_I:%.*]] = alloca <8 x i64>, align 64
-// CHECK-NEXT: [[__A2_ADDR_I_I:%.*]] = alloca <4 x i64>, align 32
-// CHECK-NEXT: [[__B_ADDR_I_I:%.*]] = alloca <4 x i64>, align 32
// CHECK-NEXT: [[__V1_ADDR_I14_I:%.*]] = alloca <2 x i64>, align 16
// CHECK-NEXT: [[__V2_ADDR_I15_I:%.*]] = alloca <2 x i64>, align 16
// CHECK-NEXT: [[__V1_ADDR_I12_I:%.*]] = alloca <2 x i64>, align 16
// CHECK-NEXT: [[__V2_ADDR_I13_I:%.*]] = alloca <2 x i64>, align 16
// CHECK-NEXT: [[__V1_ADDR_I_I:%.*]] = alloca <2 x i64>, align 16
// CHECK-NEXT: [[__V2_ADDR_I_I:%.*]] = alloca <2 x i64>, align 16
-// CHECK-NEXT: [[__S_ADDR_I_I:%.*]] = alloca i32, align 4
-// CHECK-NEXT: [[DOTCOMPOUNDLITERAL_I_I:%.*]] = alloca <16 x i32>, align 64
+// CHECK-NEXT: [[__A2_ADDR_I_I:%.*]] = alloca <4 x i64>, align 32
+// CHECK-NEXT: [[__B_ADDR_I_I:%.*]] = alloca <4 x i64>, align 32
// CHECK-NEXT: [[__M_ADDR_I:%.*]] = alloca i16, align 2
// CHECK-NEXT: [[__V_ADDR_I:%.*]] = alloca <8 x i64>, align 64
// CHECK-NEXT: [[__T1_I:%.*]] = alloca <4 x i64>, align 32
@@ -2375,9 +2382,10 @@
// CHECK-NEXT: [[TMP77:%.*]] = icmp ult <4 x i32> [[TMP74]], [[TMP76]]
// CHECK-NEXT: [[TMP78:%.*]] = select <4 x i1> [[TMP77]], <4 x i32> [[TMP74]], <4 x i32> [[TMP76]]
// CHECK-NEXT: [[TMP79:%.*]] = bitcast <4 x i32> [[TMP78]] to <2 x i64>
-// CHECK-NEXT: store <4 x i32> [[TMP78]], <4 x i32>* [[__T10_I]], align 16
-// CHECK-NEXT: [[TMP80:%.*]] = load <4 x i32>, <4 x i32>* [[__T10_I]], align 16
-// CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <4 x i32> [[TMP80]], i32 0
+// CHECK-NEXT: [[TMP80:%.*]] = bitcast <2 x i64> [[TMP79]] to <4 x i32>
+// CHECK-NEXT: store <4 x i32> [[TMP80]], <4 x i32>* [[__T10_I]], align 16
+// CHECK-NEXT: [[TMP81:%.*]] = load <4 x i32>, <4 x i32>* [[__T10_I]], align 16
+// CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <4 x i32> [[TMP81]], i32 0
// CHECK-NEXT: ret i32 [[VECEXT_I]]
unsigned int test_mm512_mask_reduce_min_epu32(__mmask16 __M, __m512i __W){
return _mm512_mask_reduce_min_epu32(__M, __W);
@@ -2385,19 +2393,19 @@
// CHECK-LABEL: define float @test_mm512_mask_reduce_min_ps(i16 zeroext %__M, <16 x float> %__W) #0 {
// CHECK-NEXT: entry:
+// CHECK-NEXT: [[__W_ADDR_I_I:%.*]] = alloca float, align 4
+// CHECK-NEXT: [[DOTCOMPOUNDLITERAL_I_I:%.*]] = alloca <16 x float>, align 64
// CHECK-NEXT: [[__W2_ADDR_I_I:%.*]] = alloca <16 x float>, align 64
// CHECK-NEXT: [[__U_ADDR_I_I:%.*]] = alloca i16, align 2
// CHECK-NEXT: [[__A_ADDR_I_I:%.*]] = alloca <16 x float>, align 64
-// CHECK-NEXT: [[__A_ADDR_I16_I:%.*]] = alloca <8 x float>, align 32
-// CHECK-NEXT: [[__B_ADDR_I17_I:%.*]] = alloca <8 x float>, align 32
// CHECK-NEXT: [[__A_ADDR_I14_I:%.*]] = alloca <4 x float>, align 16
// CHECK-NEXT: [[__B_ADDR_I15_I:%.*]] = alloca <4 x float>, align 16
// CHECK-NEXT: [[__A_ADDR_I12_I:%.*]] = alloca <4 x float>, align 16
// CHECK-NEXT: [[__B_ADDR_I13_I:%.*]] = alloca <4 x float>, align 16
// CHECK-NEXT: [[__A2_ADDR_I_I:%.*]] = alloca <4 x float>, align 16
// CHECK-NEXT: [[__B_ADDR_I_I:%.*]] = alloca <4 x float>, align 16
-// CHECK-NEXT: [[__W_ADDR_I_I:%.*]] = alloca float, align 4
-// CHECK-NEXT: [[DOTCOMPOUNDLITERAL_I_I:%.*]] = alloca <16 x float>, align 64
+// CHECK-NEXT: [[__A_ADDR_I16_I:%.*]] = alloca <8 x float>, align 32
+// CHECK-NEXT: [[__B_ADDR_I17_I:%.*]] = alloca <8 x float>, align 32
// CHECK-NEXT: [[__M_ADDR_I:%.*]] = alloca i16, align 2
// CHECK-NEXT: [[__V_ADDR_I:%.*]] = alloca <16 x float>, align 64
// CHECK-NEXT: [[__T1_I:%.*]] = alloca <8 x float>, align 32
diff --git a/src/llvm-project/clang/test/CodeGen/avx512f-builtins.c b/src/llvm-project/clang/test/CodeGen/avx512f-builtins.c
index c2a45e7..9296108 100644
--- a/src/llvm-project/clang/test/CodeGen/avx512f-builtins.c
+++ b/src/llvm-project/clang/test/CodeGen/avx512f-builtins.c
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx512f -emit-llvm -o - -Wall -Werror | FileCheck %s
-// RUN: %clang_cc1 -fms-extensions -fms-compatibility -ffreestanding %s -triple=x86_64-windows-msvc -target-feature +avx512f -emit-llvm -o - -Wall -Werror | FileCheck %s
+// RUN: %clang_cc1 -fexperimental-new-pass-manager -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx512f -emit-llvm -o - -Wall -Werror | FileCheck %s
+// RUN: %clang_cc1 -fexperimental-new-pass-manager -flax-vector-conversions=none -fms-extensions -fms-compatibility -ffreestanding %s -triple=x86_64-windows-msvc -target-feature +avx512f -emit-llvm -o - -Wall -Werror | FileCheck %s
#include <immintrin.h>
@@ -523,13 +523,13 @@
}
__m512d test_mm512_fmsub_round_pd(__m512d __A, __m512d __B, __m512d __C) {
// CHECK-LABEL: @test_mm512_fmsub_round_pd
- // CHECK: fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>
+ // CHECK: fneg <8 x double>
// CHECK: @llvm.x86.avx512.vfmadd.pd.512
return _mm512_fmsub_round_pd(__A, __B, __C, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC);
}
__m512d test_mm512_mask_fmsub_round_pd(__m512d __A, __mmask8 __U, __m512d __B, __m512d __C) {
// CHECK-LABEL: @test_mm512_mask_fmsub_round_pd
- // CHECK: fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>
+ // CHECK: fneg <8 x double>
// CHECK: @llvm.x86.avx512.vfmadd.pd.512
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: select <8 x i1> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}}
@@ -537,7 +537,7 @@
}
__m512d test_mm512_maskz_fmsub_round_pd(__mmask8 __U, __m512d __A, __m512d __B, __m512d __C) {
// CHECK-LABEL: @test_mm512_maskz_fmsub_round_pd
- // CHECK: fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>
+ // CHECK: fneg <8 x double>
// CHECK: @llvm.x86.avx512.vfmadd.pd.512
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: select <8 x i1> %{{.*}}, <8 x double> %{{.*}}, <8 x double> zeroinitializer
@@ -545,13 +545,13 @@
}
__m512d test_mm512_fnmadd_round_pd(__m512d __A, __m512d __B, __m512d __C) {
// CHECK-LABEL: @test_mm512_fnmadd_round_pd
- // CHECK: fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>
+ // CHECK: fneg <8 x double>
// CHECK: @llvm.x86.avx512.vfmadd.pd.512
return _mm512_fnmadd_round_pd(__A, __B, __C, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC);
}
__m512d test_mm512_mask3_fnmadd_round_pd(__m512d __A, __m512d __B, __m512d __C, __mmask8 __U) {
// CHECK-LABEL: @test_mm512_mask3_fnmadd_round_pd
- // CHECK: fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>
+ // CHECK: fneg <8 x double>
// CHECK: @llvm.x86.avx512.vfmadd.pd.512
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: select <8 x i1> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}}
@@ -559,7 +559,7 @@
}
__m512d test_mm512_maskz_fnmadd_round_pd(__mmask8 __U, __m512d __A, __m512d __B, __m512d __C) {
// CHECK-LABEL: @test_mm512_maskz_fnmadd_round_pd
- // CHECK: fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>
+ // CHECK: fneg <8 x double>
// CHECK: @llvm.x86.avx512.vfmadd.pd.512
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: select <8 x i1> %{{.*}}, <8 x double> %{{.*}}, <8 x double> zeroinitializer
@@ -567,15 +567,15 @@
}
__m512d test_mm512_fnmsub_round_pd(__m512d __A, __m512d __B, __m512d __C) {
// CHECK-LABEL: @test_mm512_fnmsub_round_pd
- // CHECK: fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>
- // CHECK: fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>
+ // CHECK: fneg <8 x double>
+ // CHECK: fneg <8 x double>
// CHECK: @llvm.x86.avx512.vfmadd.pd.512
return _mm512_fnmsub_round_pd(__A, __B, __C, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC);
}
__m512d test_mm512_maskz_fnmsub_round_pd(__mmask8 __U, __m512d __A, __m512d __B, __m512d __C) {
// CHECK-LABEL: @test_mm512_maskz_fnmsub_round_pd
- // CHECK: fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>
- // CHECK: fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>
+ // CHECK: fneg <8 x double>
+ // CHECK: fneg <8 x double>
// CHECK: @llvm.x86.avx512.vfmadd.pd.512
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: select <8 x i1> %{{.*}}, <8 x double> %{{.*}}, <8 x double> zeroinitializer
@@ -609,13 +609,13 @@
}
__m512d test_mm512_fmsub_pd(__m512d __A, __m512d __B, __m512d __C) {
// CHECK-LABEL: @test_mm512_fmsub_pd
- // CHECK: fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <8 x double> %{{.*}}
// CHECK: call <8 x double> @llvm.fma.v8f64(<8 x double> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}})
return _mm512_fmsub_pd(__A, __B, __C);
}
__m512d test_mm512_mask_fmsub_pd(__m512d __A, __mmask8 __U, __m512d __B, __m512d __C) {
// CHECK-LABEL: @test_mm512_mask_fmsub_pd
- // CHECK: fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <8 x double> %{{.*}}
// CHECK: call <8 x double> @llvm.fma.v8f64(<8 x double> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: select <8 x i1> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}}
@@ -623,7 +623,7 @@
}
__m512d test_mm512_maskz_fmsub_pd(__mmask8 __U, __m512d __A, __m512d __B, __m512d __C) {
// CHECK-LABEL: @test_mm512_maskz_fmsub_pd
- // CHECK: fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <8 x double> %{{.*}}
// CHECK: call <8 x double> @llvm.fma.v8f64(<8 x double> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: select <8 x i1> %{{.*}}, <8 x double> %{{.*}}, <8 x double> zeroinitializer
@@ -631,13 +631,13 @@
}
__m512d test_mm512_fnmadd_pd(__m512d __A, __m512d __B, __m512d __C) {
// CHECK-LABEL: @test_mm512_fnmadd_pd
- // CHECK: fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <8 x double> %{{.*}}
// CHECK: call <8 x double> @llvm.fma.v8f64(<8 x double> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}})
return _mm512_fnmadd_pd(__A, __B, __C);
}
__m512d test_mm512_mask3_fnmadd_pd(__m512d __A, __m512d __B, __m512d __C, __mmask8 __U) {
// CHECK-LABEL: @test_mm512_mask3_fnmadd_pd
- // CHECK: fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <8 x double> %{{.*}}
// CHECK: call <8 x double> @llvm.fma.v8f64(<8 x double> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: select <8 x i1> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}}
@@ -645,7 +645,7 @@
}
__m512d test_mm512_maskz_fnmadd_pd(__mmask8 __U, __m512d __A, __m512d __B, __m512d __C) {
// CHECK-LABEL: @test_mm512_maskz_fnmadd_pd
- // CHECK: fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <8 x double> %{{.*}}
// CHECK: call <8 x double> @llvm.fma.v8f64(<8 x double> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: select <8 x i1> %{{.*}}, <8 x double> %{{.*}}, <8 x double> zeroinitializer
@@ -653,15 +653,15 @@
}
__m512d test_mm512_fnmsub_pd(__m512d __A, __m512d __B, __m512d __C) {
// CHECK-LABEL: @test_mm512_fnmsub_pd
- // CHECK: fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.*}}
- // CHECK: fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <8 x double> %{{.*}}
+ // CHECK: fneg <8 x double> %{{.*}}
// CHECK: call <8 x double> @llvm.fma.v8f64(<8 x double> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}})
return _mm512_fnmsub_pd(__A, __B, __C);
}
__m512d test_mm512_maskz_fnmsub_pd(__mmask8 __U, __m512d __A, __m512d __B, __m512d __C) {
// CHECK-LABEL: @test_mm512_maskz_fnmsub_pd
- // CHECK: fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.*}}
- // CHECK: fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <8 x double> %{{.*}}
+ // CHECK: fneg <8 x double> %{{.*}}
// CHECK: call <8 x double> @llvm.fma.v8f64(<8 x double> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: select <8 x i1> %{{.*}}, <8 x double> %{{.*}}, <8 x double> zeroinitializer
@@ -695,13 +695,13 @@
}
__m512 test_mm512_fmsub_round_ps(__m512 __A, __m512 __B, __m512 __C) {
// CHECK-LABEL: @test_mm512_fmsub_round_ps
- // CHECK: fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <16 x float> %{{.*}}
// CHECK: @llvm.x86.avx512.vfmadd.ps.512
return _mm512_fmsub_round_ps(__A, __B, __C, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC);
}
__m512 test_mm512_mask_fmsub_round_ps(__m512 __A, __mmask16 __U, __m512 __B, __m512 __C) {
// CHECK-LABEL: @test_mm512_mask_fmsub_round_ps
- // CHECK: fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <16 x float> %{{.*}}
// CHECK: @llvm.x86.avx512.vfmadd.ps.512
// CHECK: bitcast i16 %{{.*}} to <16 x i1>
// CHECK: select <16 x i1> %{{.*}}, <16 x float> %{{.*}}, <16 x float> %{{.*}}
@@ -709,7 +709,7 @@
}
__m512 test_mm512_maskz_fmsub_round_ps(__mmask16 __U, __m512 __A, __m512 __B, __m512 __C) {
// CHECK-LABEL: @test_mm512_maskz_fmsub_round_ps
- // CHECK: fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <16 x float> %{{.*}}
// CHECK: @llvm.x86.avx512.vfmadd.ps.512
// CHECK: bitcast i16 %{{.*}} to <16 x i1>
// CHECK: select <16 x i1> %{{.*}}, <16 x float> %{{.*}}, <16 x float> zeroinitializer
@@ -717,13 +717,13 @@
}
__m512 test_mm512_fnmadd_round_ps(__m512 __A, __m512 __B, __m512 __C) {
// CHECK-LABEL: @test_mm512_fnmadd_round_ps
- // CHECK: fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <16 x float> %{{.*}}
// CHECK: @llvm.x86.avx512.vfmadd.ps.512
return _mm512_fnmadd_round_ps(__A, __B, __C, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC);
}
__m512 test_mm512_mask3_fnmadd_round_ps(__m512 __A, __m512 __B, __m512 __C, __mmask16 __U) {
// CHECK-LABEL: @test_mm512_mask3_fnmadd_round_ps
- // CHECK: fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <16 x float> %{{.*}}
// CHECK: @llvm.x86.avx512.vfmadd.ps.512
// CHECK: bitcast i16 %{{.*}} to <16 x i1>
// CHECK: select <16 x i1> %{{.*}}, <16 x float> %{{.*}}, <16 x float> %{{.*}}
@@ -731,7 +731,7 @@
}
__m512 test_mm512_maskz_fnmadd_round_ps(__mmask16 __U, __m512 __A, __m512 __B, __m512 __C) {
// CHECK-LABEL: @test_mm512_maskz_fnmadd_round_ps
- // CHECK: fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <16 x float> %{{.*}}
// CHECK: @llvm.x86.avx512.vfmadd.ps.512
// CHECK: bitcast i16 %{{.*}} to <16 x i1>
// CHECK: select <16 x i1> %{{.*}}, <16 x float> %{{.*}}, <16 x float> zeroinitializer
@@ -739,15 +739,15 @@
}
__m512 test_mm512_fnmsub_round_ps(__m512 __A, __m512 __B, __m512 __C) {
// CHECK-LABEL: @test_mm512_fnmsub_round_ps
- // CHECK: fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
- // CHECK: fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <16 x float> %{{.*}}
+ // CHECK: fneg <16 x float> %{{.*}}
// CHECK: @llvm.x86.avx512.vfmadd.ps.512
return _mm512_fnmsub_round_ps(__A, __B, __C, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC);
}
__m512 test_mm512_maskz_fnmsub_round_ps(__mmask16 __U, __m512 __A, __m512 __B, __m512 __C) {
// CHECK-LABEL: @test_mm512_maskz_fnmsub_round_ps
- // CHECK: fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
- // CHECK: fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <16 x float> %{{.*}}
+ // CHECK: fneg <16 x float> %{{.*}}
// CHECK: @llvm.x86.avx512.vfmadd.ps.512
// CHECK: bitcast i16 %{{.*}} to <16 x i1>
// CHECK: select <16 x i1> %{{.*}}, <16 x float> %{{.*}}, <16 x float> zeroinitializer
@@ -779,13 +779,13 @@
}
__m512 test_mm512_fmsub_ps(__m512 __A, __m512 __B, __m512 __C) {
// CHECK-LABEL: @test_mm512_fmsub_ps
- // CHECK: fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <16 x float> %{{.*}}
// CHECK: call <16 x float> @llvm.fma.v16f32(<16 x float> %{{.*}}, <16 x float> %{{.*}}, <16 x float> %{{.*}})
return _mm512_fmsub_ps(__A, __B, __C);
}
__m512 test_mm512_mask_fmsub_ps(__m512 __A, __mmask16 __U, __m512 __B, __m512 __C) {
// CHECK-LABEL: @test_mm512_mask_fmsub_ps
- // CHECK: fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <16 x float> %{{.*}}
// CHECK: call <16 x float> @llvm.fma.v16f32(<16 x float> %{{.*}}, <16 x float> %{{.*}}, <16 x float> %{{.*}})
// CHECK: bitcast i16 %{{.*}} to <16 x i1>
// CHECK: select <16 x i1> %{{.*}}, <16 x float> %{{.*}}, <16 x float> %{{.*}}
@@ -793,7 +793,7 @@
}
__m512 test_mm512_maskz_fmsub_ps(__mmask16 __U, __m512 __A, __m512 __B, __m512 __C) {
// CHECK-LABEL: @test_mm512_maskz_fmsub_ps
- // CHECK: fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <16 x float> %{{.*}}
// CHECK: call <16 x float> @llvm.fma.v16f32(<16 x float> %{{.*}}, <16 x float> %{{.*}}, <16 x float> %{{.*}})
// CHECK: bitcast i16 %{{.*}} to <16 x i1>
// CHECK: select <16 x i1> %{{.*}}, <16 x float> %{{.*}}, <16 x float> zeroinitializer
@@ -801,13 +801,13 @@
}
__m512 test_mm512_fnmadd_ps(__m512 __A, __m512 __B, __m512 __C) {
// CHECK-LABEL: @test_mm512_fnmadd_ps
- // CHECK: fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <16 x float> %{{.*}}
// CHECK: call <16 x float> @llvm.fma.v16f32(<16 x float> %{{.*}}, <16 x float> %{{.*}}, <16 x float> %{{.*}})
return _mm512_fnmadd_ps(__A, __B, __C);
}
__m512 test_mm512_mask3_fnmadd_ps(__m512 __A, __m512 __B, __m512 __C, __mmask16 __U) {
// CHECK-LABEL: @test_mm512_mask3_fnmadd_ps
- // CHECK: fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <16 x float> %{{.*}}
// CHECK: call <16 x float> @llvm.fma.v16f32(<16 x float> %{{.*}}, <16 x float> %{{.*}}, <16 x float> %{{.*}})
// CHECK: bitcast i16 %{{.*}} to <16 x i1>
// CHECK: select <16 x i1> %{{.*}}, <16 x float> %{{.*}}, <16 x float> %{{.*}}
@@ -815,7 +815,7 @@
}
__m512 test_mm512_maskz_fnmadd_ps(__mmask16 __U, __m512 __A, __m512 __B, __m512 __C) {
// CHECK-LABEL: @test_mm512_maskz_fnmadd_ps
- // CHECK: fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <16 x float> %{{.*}}
// CHECK: call <16 x float> @llvm.fma.v16f32(<16 x float> %{{.*}}, <16 x float> %{{.*}}, <16 x float> %{{.*}})
// CHECK: bitcast i16 %{{.*}} to <16 x i1>
// CHECK: select <16 x i1> %{{.*}}, <16 x float> %{{.*}}, <16 x float> zeroinitializer
@@ -823,15 +823,15 @@
}
__m512 test_mm512_fnmsub_ps(__m512 __A, __m512 __B, __m512 __C) {
// CHECK-LABEL: @test_mm512_fnmsub_ps
- // CHECK: fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
- // CHECK: fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <16 x float> %{{.*}}
+ // CHECK: fneg <16 x float> %{{.*}}
// CHECK: call <16 x float> @llvm.fma.v16f32(<16 x float> %{{.*}}, <16 x float> %{{.*}}, <16 x float> %{{.*}})
return _mm512_fnmsub_ps(__A, __B, __C);
}
__m512 test_mm512_maskz_fnmsub_ps(__mmask16 __U, __m512 __A, __m512 __B, __m512 __C) {
// CHECK-LABEL: @test_mm512_maskz_fnmsub_ps
- // CHECK: fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
- // CHECK: fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <16 x float> %{{.*}}
+ // CHECK: fneg <16 x float> %{{.*}}
// CHECK: call <16 x float> @llvm.fma.v16f32(<16 x float> %{{.*}}, <16 x float> %{{.*}}, <16 x float> %{{.*}})
// CHECK: bitcast i16 %{{.*}} to <16 x i1>
// CHECK: select <16 x i1> %{{.*}}, <16 x float> %{{.*}}, <16 x float> zeroinitializer
@@ -865,13 +865,13 @@
}
__m512d test_mm512_fmsubadd_round_pd(__m512d __A, __m512d __B, __m512d __C) {
// CHECK-LABEL: @test_mm512_fmsubadd_round_pd
- // CHECK: fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <8 x double> %{{.*}}
// CHECK: @llvm.x86.avx512.vfmaddsub.pd.512
return _mm512_fmsubadd_round_pd(__A, __B, __C, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC);
}
__m512d test_mm512_mask_fmsubadd_round_pd(__m512d __A, __mmask8 __U, __m512d __B, __m512d __C) {
// CHECK-LABEL: @test_mm512_mask_fmsubadd_round_pd
- // CHECK: fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <8 x double> %{{.*}}
// CHECK: @llvm.x86.avx512.vfmaddsub.pd.512
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: select <8 x i1> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}}
@@ -879,7 +879,7 @@
}
__m512d test_mm512_maskz_fmsubadd_round_pd(__mmask8 __U, __m512d __A, __m512d __B, __m512d __C) {
// CHECK-LABEL: @test_mm512_maskz_fmsubadd_round_pd
- // CHECK: fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <8 x double> %{{.*}}
// CHECK: @llvm.x86.avx512.vfmaddsub.pd.512
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: select <8 x i1> %{{.*}}, <8 x double> %{{.*}}, <8 x double> zeroinitializer
@@ -888,7 +888,7 @@
__m512d test_mm512_fmaddsub_pd(__m512d __A, __m512d __B, __m512d __C) {
// CHECK-LABEL: @test_mm512_fmaddsub_pd
// CHECK: [[ADD:%.+]] = call <8 x double> @llvm.fma.v8f64(<8 x double> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}})
- // CHECK: [[NEG:%.+]] = fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <8 x double> %{{.*}}
// CHECK: [[SUB:%.+]] = call <8 x double> @llvm.fma.v8f64(<8 x double> %{{.*}}, <8 x double> %{{.*}}, <8 x double> [[NEG]]
// CHECK: shufflevector <8 x double> [[SUB]], <8 x double> [[ADD]], <8 x i32> <i32 0, i32 9, i32 2, i32 11, i32 4, i32 13, i32 6, i32 15>
return _mm512_fmaddsub_pd(__A, __B, __C);
@@ -896,7 +896,7 @@
__m512d test_mm512_mask_fmaddsub_pd(__m512d __A, __mmask8 __U, __m512d __B, __m512d __C) {
// CHECK-LABEL: @test_mm512_mask_fmaddsub_pd
// CHECK: [[ADD:%.+]] = call <8 x double> @llvm.fma.v8f64(<8 x double> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}})
- // CHECK: [[NEG:%.+]] = fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <8 x double> %{{.*}}
// CHECK: [[SUB:%.+]] = call <8 x double> @llvm.fma.v8f64(<8 x double> %{{.*}}, <8 x double> %{{.*}}, <8 x double> [[NEG]]
// CHECK: shufflevector <8 x double> [[SUB]], <8 x double> [[ADD]], <8 x i32> <i32 0, i32 9, i32 2, i32 11, i32 4, i32 13, i32 6, i32 15>
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
@@ -906,7 +906,7 @@
__m512d test_mm512_mask3_fmaddsub_pd(__m512d __A, __m512d __B, __m512d __C, __mmask8 __U) {
// CHECK-LABEL: @test_mm512_mask3_fmaddsub_pd
// CHECK: [[ADD:%.+]] = call <8 x double> @llvm.fma.v8f64(<8 x double> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}})
- // CHECK: [[NEG:%.+]] = fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <8 x double> %{{.*}}
// CHECK: [[SUB:%.+]] = call <8 x double> @llvm.fma.v8f64(<8 x double> %{{.*}}, <8 x double> %{{.*}}, <8 x double> [[NEG]]
// CHECK: shufflevector <8 x double> [[SUB]], <8 x double> [[ADD]], <8 x i32> <i32 0, i32 9, i32 2, i32 11, i32 4, i32 13, i32 6, i32 15>
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
@@ -916,7 +916,7 @@
__m512d test_mm512_maskz_fmaddsub_pd(__mmask8 __U, __m512d __A, __m512d __B, __m512d __C) {
// CHECK-LABEL: @test_mm512_maskz_fmaddsub_pd
// CHECK: [[ADD:%.+]] = call <8 x double> @llvm.fma.v8f64(<8 x double> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}})
- // CHECK: [[NEG:%.+]] = fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <8 x double> %{{.*}}
// CHECK: [[SUB:%.+]] = call <8 x double> @llvm.fma.v8f64(<8 x double> %{{.*}}, <8 x double> %{{.*}}, <8 x double> [[NEG]]
// CHECK: shufflevector <8 x double> [[SUB]], <8 x double> [[ADD]], <8 x i32> <i32 0, i32 9, i32 2, i32 11, i32 4, i32 13, i32 6, i32 15>
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
@@ -925,7 +925,7 @@
}
__m512d test_mm512_fmsubadd_pd(__m512d __A, __m512d __B, __m512d __C) {
// CHECK-LABEL: @test_mm512_fmsubadd_pd
- // CHECK: [[NEG:%.+]] = fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <8 x double> %{{.*}}
// CHECK: [[SUB:%.+]] = call <8 x double> @llvm.fma.v8f64(<8 x double> %{{.*}}, <8 x double> %{{.*}}, <8 x double> [[NEG]]
// CHECK: [[ADD:%.+]] = call <8 x double> @llvm.fma.v8f64(<8 x double> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}})
// CHECK: shufflevector <8 x double> [[ADD]], <8 x double> [[SUB]], <8 x i32> <i32 0, i32 9, i32 2, i32 11, i32 4, i32 13, i32 6, i32 15>
@@ -933,7 +933,7 @@
}
__m512d test_mm512_mask_fmsubadd_pd(__m512d __A, __mmask8 __U, __m512d __B, __m512d __C) {
// CHECK-LABEL: @test_mm512_mask_fmsubadd_pd
- // CHECK: [[NEG:%.+]] = fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <8 x double> %{{.*}}
// CHECK: [[SUB:%.+]] = call <8 x double> @llvm.fma.v8f64(<8 x double> %{{.*}}, <8 x double> %{{.*}}, <8 x double> [[NEG]]
// CHECK: [[ADD:%.+]] = call <8 x double> @llvm.fma.v8f64(<8 x double> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}})
// CHECK: shufflevector <8 x double> [[ADD]], <8 x double> [[SUB]], <8 x i32> <i32 0, i32 9, i32 2, i32 11, i32 4, i32 13, i32 6, i32 15>
@@ -943,7 +943,7 @@
}
__m512d test_mm512_maskz_fmsubadd_pd(__mmask8 __U, __m512d __A, __m512d __B, __m512d __C) {
// CHECK-LABEL: @test_mm512_maskz_fmsubadd_pd
- // CHECK: [[NEG:%.+]] = fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <8 x double> %{{.*}}
// CHECK: [[SUB:%.+]] = call <8 x double> @llvm.fma.v8f64(<8 x double> %{{.*}}, <8 x double> %{{.*}}, <8 x double> [[NEG]]
// CHECK: [[ADD:%.+]] = call <8 x double> @llvm.fma.v8f64(<8 x double> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}})
// CHECK: shufflevector <8 x double> [[ADD]], <8 x double> [[SUB]], <8 x i32> <i32 0, i32 9, i32 2, i32 11, i32 4, i32 13, i32 6, i32 15>
@@ -979,13 +979,13 @@
}
__m512 test_mm512_fmsubadd_round_ps(__m512 __A, __m512 __B, __m512 __C) {
// CHECK-LABEL: @test_mm512_fmsubadd_round_ps
- // CHECK: fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <16 x float> %{{.*}}
// CHECK: @llvm.x86.avx512.vfmaddsub.ps.512
return _mm512_fmsubadd_round_ps(__A, __B, __C, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC);
}
__m512 test_mm512_mask_fmsubadd_round_ps(__m512 __A, __mmask16 __U, __m512 __B, __m512 __C) {
// CHECK-LABEL: @test_mm512_mask_fmsubadd_round_ps
- // CHECK: fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <16 x float> %{{.*}}
// CHECK: @llvm.x86.avx512.vfmaddsub.ps.512
// CHECK: bitcast i16 %{{.*}} to <16 x i1>
// CHECK: select <16 x i1> %{{.*}}, <16 x float> %{{.*}}, <16 x float> %{{.*}}
@@ -993,7 +993,7 @@
}
__m512 test_mm512_maskz_fmsubadd_round_ps(__mmask16 __U, __m512 __A, __m512 __B, __m512 __C) {
// CHECK-LABEL: @test_mm512_maskz_fmsubadd_round_ps
- // CHECK: fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <16 x float> %{{.*}}
// CHECK: @llvm.x86.avx512.vfmaddsub.ps.512
// CHECK: bitcast i16 %{{.*}} to <16 x i1>
// CHECK: select <16 x i1> %{{.*}}, <16 x float> %{{.*}}, <16 x float> zeroinitializer
@@ -1002,7 +1002,7 @@
__m512 test_mm512_fmaddsub_ps(__m512 __A, __m512 __B, __m512 __C) {
// CHECK-LABEL: @test_mm512_fmaddsub_ps
// CHECK: [[ADD:%.+]] = call <16 x float> @llvm.fma.v16f32(<16 x float> %{{.*}}, <16 x float> %{{.*}}, <16 x float> %{{.*}})
- // CHECK: [[NEG:%.+]] = fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <16 x float> %{{.*}}
// CHECK: [[SUB:%.+]] = call <16 x float> @llvm.fma.v16f32(<16 x float> %{{.*}}, <16 x float> %{{.*}}, <16 x float> [[NEG]]
// CHECK: shufflevector <16 x float> [[SUB]], <16 x float> [[ADD]], <16 x i32> <i32 0, i32 17, i32 2, i32 19, i32 4, i32 21, i32 6, i32 23, i32 8, i32 25, i32 10, i32 27, i32 12, i32 29, i32 14, i32 31>
return _mm512_fmaddsub_ps(__A, __B, __C);
@@ -1010,7 +1010,7 @@
__m512 test_mm512_mask_fmaddsub_ps(__m512 __A, __mmask16 __U, __m512 __B, __m512 __C) {
// CHECK-LABEL: @test_mm512_mask_fmaddsub_ps
// CHECK: [[ADD:%.+]] = call <16 x float> @llvm.fma.v16f32(<16 x float> %{{.*}}, <16 x float> %{{.*}}, <16 x float> %{{.*}})
- // CHECK: [[NEG:%.+]] = fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <16 x float> %{{.*}}
// CHECK: [[SUB:%.+]] = call <16 x float> @llvm.fma.v16f32(<16 x float> %{{.*}}, <16 x float> %{{.*}}, <16 x float> [[NEG]]
// CHECK: shufflevector <16 x float> [[SUB]], <16 x float> [[ADD]], <16 x i32> <i32 0, i32 17, i32 2, i32 19, i32 4, i32 21, i32 6, i32 23, i32 8, i32 25, i32 10, i32 27, i32 12, i32 29, i32 14, i32 31>
// CHECK: bitcast i16 %{{.*}} to <16 x i1>
@@ -1020,7 +1020,7 @@
__m512 test_mm512_mask3_fmaddsub_ps(__m512 __A, __m512 __B, __m512 __C, __mmask16 __U) {
// CHECK-LABEL: @test_mm512_mask3_fmaddsub_ps
// CHECK: [[ADD:%.+]] = call <16 x float> @llvm.fma.v16f32(<16 x float> %{{.*}}, <16 x float> %{{.*}}, <16 x float> %{{.*}})
- // CHECK: [[NEG:%.+]] = fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <16 x float> %{{.*}}
// CHECK: [[SUB:%.+]] = call <16 x float> @llvm.fma.v16f32(<16 x float> %{{.*}}, <16 x float> %{{.*}}, <16 x float> [[NEG]]
// CHECK: shufflevector <16 x float> [[SUB]], <16 x float> [[ADD]], <16 x i32> <i32 0, i32 17, i32 2, i32 19, i32 4, i32 21, i32 6, i32 23, i32 8, i32 25, i32 10, i32 27, i32 12, i32 29, i32 14, i32 31>
// CHECK: bitcast i16 %{{.*}} to <16 x i1>
@@ -1030,7 +1030,7 @@
__m512 test_mm512_maskz_fmaddsub_ps(__mmask16 __U, __m512 __A, __m512 __B, __m512 __C) {
// CHECK-LABEL: @test_mm512_maskz_fmaddsub_ps
// CHECK: [[ADD:%.+]] = call <16 x float> @llvm.fma.v16f32(<16 x float> %{{.*}}, <16 x float> %{{.*}}, <16 x float> %{{.*}})
- // CHECK: [[NEG:%.+]] = fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <16 x float> %{{.*}}
// CHECK: [[SUB:%.+]] = call <16 x float> @llvm.fma.v16f32(<16 x float> %{{.*}}, <16 x float> %{{.*}}, <16 x float> [[NEG]]
// CHECK: shufflevector <16 x float> [[SUB]], <16 x float> [[ADD]], <16 x i32> <i32 0, i32 17, i32 2, i32 19, i32 4, i32 21, i32 6, i32 23, i32 8, i32 25, i32 10, i32 27, i32 12, i32 29, i32 14, i32 31>
// CHECK: bitcast i16 %{{.*}} to <16 x i1>
@@ -1039,7 +1039,7 @@
}
__m512 test_mm512_fmsubadd_ps(__m512 __A, __m512 __B, __m512 __C) {
// CHECK-LABEL: @test_mm512_fmsubadd_ps
- // CHECK: [[NEG:%.+]] = fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <16 x float> %{{.*}}
// CHECK: [[SUB:%.+]] = call <16 x float> @llvm.fma.v16f32(<16 x float> %{{.*}}, <16 x float> %{{.*}}, <16 x float> [[NEG]]
// CHECK: [[ADD:%.+]] = call <16 x float> @llvm.fma.v16f32(<16 x float> %{{.*}}, <16 x float> %{{.*}}, <16 x float> %{{.*}})
// CHECK: shufflevector <16 x float> [[ADD]], <16 x float> [[SUB]], <16 x i32> <i32 0, i32 17, i32 2, i32 19, i32 4, i32 21, i32 6, i32 23, i32 8, i32 25, i32 10, i32 27, i32 12, i32 29, i32 14, i32 31>
@@ -1047,7 +1047,7 @@
}
__m512 test_mm512_mask_fmsubadd_ps(__m512 __A, __mmask16 __U, __m512 __B, __m512 __C) {
// CHECK-LABEL: @test_mm512_mask_fmsubadd_ps
- // CHECK: [[NEG:%.+]] = fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <16 x float> %{{.*}}
// CHECK: [[SUB:%.+]] = call <16 x float> @llvm.fma.v16f32(<16 x float> %{{.*}}, <16 x float> %{{.*}}, <16 x float> [[NEG]]
// CHECK: [[ADD:%.+]] = call <16 x float> @llvm.fma.v16f32(<16 x float> %{{.*}}, <16 x float> %{{.*}}, <16 x float> %{{.*}})
// CHECK: shufflevector <16 x float> [[ADD]], <16 x float> [[SUB]], <16 x i32> <i32 0, i32 17, i32 2, i32 19, i32 4, i32 21, i32 6, i32 23, i32 8, i32 25, i32 10, i32 27, i32 12, i32 29, i32 14, i32 31>
@@ -1057,7 +1057,7 @@
}
__m512 test_mm512_maskz_fmsubadd_ps(__mmask16 __U, __m512 __A, __m512 __B, __m512 __C) {
// CHECK-LABEL: @test_mm512_maskz_fmsubadd_ps
- // CHECK: [[NEG:%.+]] = fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <16 x float> %{{.*}}
// CHECK: [[SUB:%.+]] = call <16 x float> @llvm.fma.v16f32(<16 x float> %{{.*}}, <16 x float> %{{.*}}, <16 x float> [[NEG]]
// CHECK: [[ADD:%.+]] = call <16 x float> @llvm.fma.v16f32(<16 x float> %{{.*}}, <16 x float> %{{.*}}, <16 x float> %{{.*}})
// CHECK: shufflevector <16 x float> [[ADD]], <16 x float> [[SUB]], <16 x i32> <i32 0, i32 17, i32 2, i32 19, i32 4, i32 21, i32 6, i32 23, i32 8, i32 25, i32 10, i32 27, i32 12, i32 29, i32 14, i32 31>
@@ -1067,7 +1067,7 @@
}
__m512d test_mm512_mask3_fmsub_round_pd(__m512d __A, __m512d __B, __m512d __C, __mmask8 __U) {
// CHECK-LABEL: @test_mm512_mask3_fmsub_round_pd
- // CHECK: fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>
+ // CHECK: fneg <8 x double> %{{.*}}
// CHECK: @llvm.x86.avx512.vfmadd.pd.512
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: select <8 x i1> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}}
@@ -1075,7 +1075,7 @@
}
__m512d test_mm512_mask3_fmsub_pd(__m512d __A, __m512d __B, __m512d __C, __mmask8 __U) {
// CHECK-LABEL: @test_mm512_mask3_fmsub_pd
- // CHECK: fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <8 x double> %{{.*}}
// CHECK: call <8 x double> @llvm.fma.v8f64(<8 x double> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: select <8 x i1> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}}
@@ -1083,7 +1083,7 @@
}
__m512 test_mm512_mask3_fmsub_round_ps(__m512 __A, __m512 __B, __m512 __C, __mmask16 __U) {
// CHECK-LABEL: @test_mm512_mask3_fmsub_round_ps
- // CHECK: fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <16 x float> %{{.*}}
// CHECK: @llvm.x86.avx512.vfmadd.ps.512
// CHECK: bitcast i16 %{{.*}} to <16 x i1>
// CHECK: select <16 x i1> %{{.*}}, <16 x float> %{{.*}}, <16 x float> %{{.*}}
@@ -1091,7 +1091,7 @@
}
__m512 test_mm512_mask3_fmsub_ps(__m512 __A, __m512 __B, __m512 __C, __mmask16 __U) {
// CHECK-LABEL: @test_mm512_mask3_fmsub_ps
- // CHECK: fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <16 x float> %{{.*}}
// CHECK: call <16 x float> @llvm.fma.v16f32(<16 x float> %{{.*}}, <16 x float> %{{.*}}, <16 x float> %{{.*}})
// CHECK: bitcast i16 %{{.*}} to <16 x i1>
// CHECK: select <16 x i1> %{{.*}}, <16 x float> %{{.*}}, <16 x float> %{{.*}}
@@ -1099,7 +1099,7 @@
}
__m512d test_mm512_mask3_fmsubadd_round_pd(__m512d __A, __m512d __B, __m512d __C, __mmask8 __U) {
// CHECK-LABEL: @test_mm512_mask3_fmsubadd_round_pd
- // CHECK: fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <8 x double> %{{.*}}
// CHECK: @llvm.x86.avx512.vfmaddsub.pd.512
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: select <8 x i1> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}}
@@ -1107,7 +1107,7 @@
}
__m512d test_mm512_mask3_fmsubadd_pd(__m512d __A, __m512d __B, __m512d __C, __mmask8 __U) {
// CHECK-LABEL: @test_mm512_mask3_fmsubadd_pd
- // CHECK: [[NEG:%.+]] = fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <8 x double> %{{.*}}
// CHECK: [[SUB:%.+]] = call <8 x double> @llvm.fma.v8f64(<8 x double> %{{.*}}, <8 x double> %{{.*}}, <8 x double> [[NEG]]
// CHECK: [[ADD:%.+]] = call <8 x double> @llvm.fma.v8f64(<8 x double> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}})
// CHECK: shufflevector <8 x double> [[ADD]], <8 x double> [[SUB]], <8 x i32> <i32 0, i32 9, i32 2, i32 11, i32 4, i32 13, i32 6, i32 15>
@@ -1117,7 +1117,7 @@
}
__m512 test_mm512_mask3_fmsubadd_round_ps(__m512 __A, __m512 __B, __m512 __C, __mmask16 __U) {
// CHECK-LABEL: @test_mm512_mask3_fmsubadd_round_ps
- // CHECK: fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <16 x float> %{{.*}}
// CHECK: @llvm.x86.avx512.vfmaddsub.ps.512
// CHECK: bitcast i16 %{{.*}} to <16 x i1>
// CHECK: select <16 x i1> %{{.*}}, <16 x float> %{{.*}}, <16 x float> %{{.*}}
@@ -1125,7 +1125,7 @@
}
__m512 test_mm512_mask3_fmsubadd_ps(__m512 __A, __m512 __B, __m512 __C, __mmask16 __U) {
// CHECK-LABEL: @test_mm512_mask3_fmsubadd_ps
- // CHECK: [[NEG:%.+]] = fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <16 x float> %{{.*}}
// CHECK: [[SUB:%.+]] = call <16 x float> @llvm.fma.v16f32(<16 x float> %{{.*}}, <16 x float> %{{.*}}, <16 x float> [[NEG]]
// CHECK: [[ADD:%.+]] = call <16 x float> @llvm.fma.v16f32(<16 x float> %{{.*}}, <16 x float> %{{.*}}, <16 x float> %{{.*}})
// CHECK: shufflevector <16 x float> [[ADD]], <16 x float> [[SUB]], <16 x i32> <i32 0, i32 17, i32 2, i32 19, i32 4, i32 21, i32 6, i32 23, i32 8, i32 25, i32 10, i32 27, i32 12, i32 29, i32 14, i32 31>
@@ -1135,7 +1135,7 @@
}
__m512d test_mm512_mask_fnmadd_round_pd(__m512d __A, __mmask8 __U, __m512d __B, __m512d __C) {
// CHECK-LABEL: @test_mm512_mask_fnmadd_round_pd
- // CHECK: fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>
+ // CHECK: fneg <8 x double>
// CHECK: @llvm.x86.avx512.vfmadd.pd.512
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: select <8 x i1> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}}
@@ -1143,7 +1143,7 @@
}
__m512d test_mm512_mask_fnmadd_pd(__m512d __A, __mmask8 __U, __m512d __B, __m512d __C) {
// CHECK-LABEL: @test_mm512_mask_fnmadd_pd
- // CHECK: fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <8 x double> %{{.*}}
// CHECK: call <8 x double> @llvm.fma.v8f64(<8 x double> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: select <8 x i1> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}}
@@ -1151,7 +1151,7 @@
}
__m512 test_mm512_mask_fnmadd_round_ps(__m512 __A, __mmask16 __U, __m512 __B, __m512 __C) {
// CHECK-LABEL: @test_mm512_mask_fnmadd_round_ps
- // CHECK: fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <16 x float> %{{.*}}
// CHECK: @llvm.x86.avx512.vfmadd.ps.512
// CHECK: bitcast i16 %{{.*}} to <16 x i1>
// CHECK: select <16 x i1> %{{.*}}, <16 x float> %{{.*}}, <16 x float> %{{.*}}
@@ -1159,7 +1159,7 @@
}
__m512 test_mm512_mask_fnmadd_ps(__m512 __A, __mmask16 __U, __m512 __B, __m512 __C) {
// CHECK-LABEL: @test_mm512_mask_fnmadd_ps
- // CHECK: fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <16 x float> %{{.*}}
// CHECK: call <16 x float> @llvm.fma.v16f32(<16 x float> %{{.*}}, <16 x float> %{{.*}}, <16 x float> %{{.*}})
// CHECK: bitcast i16 %{{.*}} to <16 x i1>
// CHECK: select <16 x i1> %{{.*}}, <16 x float> %{{.*}}, <16 x float> %{{.*}}
@@ -1167,8 +1167,8 @@
}
__m512d test_mm512_mask_fnmsub_round_pd(__m512d __A, __mmask8 __U, __m512d __B, __m512d __C) {
// CHECK-LABEL: @test_mm512_mask_fnmsub_round_pd
- // CHECK: fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>
- // CHECK: fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>
+ // CHECK: fneg <8 x double>
+ // CHECK: fneg <8 x double>
// CHECK: @llvm.x86.avx512.vfmadd.pd.512
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: select <8 x i1> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}}
@@ -1176,8 +1176,8 @@
}
__m512d test_mm512_mask3_fnmsub_round_pd(__m512d __A, __m512d __B, __m512d __C, __mmask8 __U) {
// CHECK-LABEL: @test_mm512_mask3_fnmsub_round_pd
- // CHECK: fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>
- // CHECK: fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>
+ // CHECK: fneg <8 x double>
+ // CHECK: fneg <8 x double>
// CHECK: @llvm.x86.avx512.vfmadd.pd.512
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: select <8 x i1> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}}
@@ -1185,8 +1185,8 @@
}
__m512d test_mm512_mask_fnmsub_pd(__m512d __A, __mmask8 __U, __m512d __B, __m512d __C) {
// CHECK-LABEL: @test_mm512_mask_fnmsub_pd
- // CHECK: fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.*}}
- // CHECK: fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <8 x double> %{{.*}}
+ // CHECK: fneg <8 x double> %{{.*}}
// CHECK: call <8 x double> @llvm.fma.v8f64(<8 x double> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: select <8 x i1> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}}
@@ -1194,8 +1194,8 @@
}
__m512d test_mm512_mask3_fnmsub_pd(__m512d __A, __m512d __B, __m512d __C, __mmask8 __U) {
// CHECK-LABEL: @test_mm512_mask3_fnmsub_pd
- // CHECK: fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.*}}
- // CHECK: fsub <8 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <8 x double> %{{.*}}
+ // CHECK: fneg <8 x double> %{{.*}}
// CHECK: call <8 x double> @llvm.fma.v8f64(<8 x double> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: select <8 x i1> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}}
@@ -1203,8 +1203,8 @@
}
__m512 test_mm512_mask_fnmsub_round_ps(__m512 __A, __mmask16 __U, __m512 __B, __m512 __C) {
// CHECK-LABEL: @test_mm512_mask_fnmsub_round_ps
- // CHECK: fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
- // CHECK: fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <16 x float> %{{.*}}
+ // CHECK: fneg <16 x float> %{{.*}}
// CHECK: @llvm.x86.avx512.vfmadd.ps.512
// CHECK: bitcast i16 %{{.*}} to <16 x i1>
// CHECK: select <16 x i1> %{{.*}}, <16 x float> %{{.*}}, <16 x float> %{{.*}}
@@ -1212,8 +1212,8 @@
}
__m512 test_mm512_mask3_fnmsub_round_ps(__m512 __A, __m512 __B, __m512 __C, __mmask16 __U) {
// CHECK-LABEL: @test_mm512_mask3_fnmsub_round_ps
- // CHECK: fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
- // CHECK: fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <16 x float> %{{.*}}
+ // CHECK: fneg <16 x float> %{{.*}}
// CHECK: @llvm.x86.avx512.vfmadd.ps.512
// CHECK: bitcast i16 %{{.*}} to <16 x i1>
// CHECK: select <16 x i1> %{{.*}}, <16 x float> %{{.*}}, <16 x float> %{{.*}}
@@ -1221,8 +1221,8 @@
}
__m512 test_mm512_mask_fnmsub_ps(__m512 __A, __mmask16 __U, __m512 __B, __m512 __C) {
// CHECK-LABEL: @test_mm512_mask_fnmsub_ps
- // CHECK: fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
- // CHECK: fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <16 x float> %{{.*}}
+ // CHECK: fneg <16 x float> %{{.*}}
// CHECK: call <16 x float> @llvm.fma.v16f32(<16 x float> %{{.*}}, <16 x float> %{{.*}}, <16 x float> %{{.*}})
// CHECK: bitcast i16 %{{.*}} to <16 x i1>
// CHECK: select <16 x i1> %{{.*}}, <16 x float> %{{.*}}, <16 x float> %{{.*}}
@@ -1230,8 +1230,8 @@
}
__m512 test_mm512_mask3_fnmsub_ps(__m512 __A, __m512 __B, __m512 __C, __mmask16 __U) {
// CHECK-LABEL: @test_mm512_mask3_fnmsub_ps
- // CHECK: fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
- // CHECK: fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <16 x float> %{{.*}}
+ // CHECK: fneg <16 x float> %{{.*}}
// CHECK: call <16 x float> @llvm.fma.v16f32(<16 x float> %{{.*}}, <16 x float> %{{.*}}, <16 x float> %{{.*}})
// CHECK: bitcast i16 %{{.*}} to <16 x i1>
// CHECK: select <16 x i1> %{{.*}}, <16 x float> %{{.*}}, <16 x float> %{{.*}}
@@ -4762,6 +4762,12 @@
return _mm_cvtsd_u32(__A);
}
+int test_mm512_cvtsi512_si32(__m512i a) {
+ // CHECK-LABEL: test_mm512_cvtsi512_si32
+ // CHECK: %{{.*}} = extractelement <16 x i32> %{{.*}}, i32 0
+ return _mm512_cvtsi512_si32(a);
+}
+
#ifdef __x86_64__
unsigned long long test_mm_cvt_roundsd_u64(__m128d __A) {
// CHECK-LABEL: @test_mm_cvt_roundsd_u64
@@ -7515,7 +7521,7 @@
__m128 test_mm_mask_fmsub_ss(__m128 __W, __mmask8 __U, __m128 __A, __m128 __B){
// CHECK-LABEL: @test_mm_mask_fmsub_ss
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> %{{.*}}
// CHECK: [[A:%.+]] = extractelement <4 x float> [[ORIGA:%.+]], i64 0
// CHECK-NEXT: [[B:%.+]] = extractelement <4 x float> %{{.*}}, i64 0
// CHECK-NEXT: [[C:%.+]] = extractelement <4 x float> [[NEG]], i64 0
@@ -7529,7 +7535,7 @@
__m128 test_mm_fmsub_round_ss(__m128 __A, __m128 __B, __m128 __C){
// CHECK-LABEL: @test_mm_fmsub_round_ss
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> %{{.*}}
// CHECK: [[A:%.+]] = extractelement <4 x float> [[ORIGA:%.+]], i64 0
// CHECK-NEXT: [[B:%.+]] = extractelement <4 x float> %{{.*}}, i64 0
// CHECK-NEXT: [[C:%.+]] = extractelement <4 x float> [[NEG]], i64 0
@@ -7540,7 +7546,7 @@
__m128 test_mm_mask_fmsub_round_ss(__m128 __W, __mmask8 __U, __m128 __A, __m128 __B){
// CHECK-LABEL: @test_mm_mask_fmsub_round_ss
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> %{{.*}}
// CHECK: [[A:%.+]] = extractelement <4 x float> [[ORIGA:%.+]], i64 0
// CHECK-NEXT: [[B:%.+]] = extractelement <4 x float> %{{.*}}, i64 0
// CHECK-NEXT: [[C:%.+]] = extractelement <4 x float> [[NEG]], i64 0
@@ -7554,7 +7560,7 @@
__m128 test_mm_maskz_fmsub_ss(__mmask8 __U, __m128 __A, __m128 __B, __m128 __C){
// CHECK-LABEL: @test_mm_maskz_fmsub_ss
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> %{{.*}}
// CHECK: [[A:%.+]] = extractelement <4 x float> [[ORIGA:%.+]], i64 0
// CHECK-NEXT: [[B:%.+]] = extractelement <4 x float> %{{.*}}, i64 0
// CHECK-NEXT: [[C:%.+]] = extractelement <4 x float> [[NEG]], i64 0
@@ -7568,7 +7574,7 @@
__m128 test_mm_maskz_fmsub_round_ss(__mmask8 __U, __m128 __A, __m128 __B, __m128 __C){
// CHECK-LABEL: @test_mm_maskz_fmsub_round_ss
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> %{{.*}}
// CHECK: [[A:%.+]] = extractelement <4 x float> [[ORIGA:%.+]], i64 0
// CHECK-NEXT: [[B:%.+]] = extractelement <4 x float> %{{.*}}, i64 0
// CHECK-NEXT: [[C:%.+]] = extractelement <4 x float> [[NEG]], i64 0
@@ -7582,7 +7588,7 @@
__m128 test_mm_mask3_fmsub_ss(__m128 __W, __m128 __X, __m128 __Y, __mmask8 __U){
// CHECK-LABEL: @test_mm_mask3_fmsub_ss
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, [[ORIGC:%.+]]
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> [[ORIGC:%.+]]
// CHECK: [[A:%.+]] = extractelement <4 x float> %{{.*}}, i64 0
// CHECK-NEXT: [[B:%.+]] = extractelement <4 x float> %{{.*}}, i64 0
// CHECK-NEXT: [[C:%.+]] = extractelement <4 x float> [[NEG]], i64 0
@@ -7597,7 +7603,7 @@
__m128 test_mm_mask3_fmsub_round_ss(__m128 __W, __m128 __X, __m128 __Y, __mmask8 __U){
// CHECK-LABEL: @test_mm_mask3_fmsub_round_ss
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, [[ORIGC:%.+]]
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> [[ORIGC:%.+]]
// CHECK: [[A:%.+]] = extractelement <4 x float> %{{.*}}, i64 0
// CHECK-NEXT: [[B:%.+]] = extractelement <4 x float> %{{.*}}, i64 0
// CHECK-NEXT: [[C:%.+]] = extractelement <4 x float> [[NEG]], i64 0
@@ -7612,7 +7618,7 @@
__m128 test_mm_mask_fnmadd_ss(__m128 __W, __mmask8 __U, __m128 __A, __m128 __B){
// CHECK-LABEL: @test_mm_mask_fnmadd_ss
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> %{{.*}}
// CHECK: [[A:%.+]] = extractelement <4 x float> [[ORIGA:%.+]], i64 0
// CHECK-NEXT: [[B:%.+]] = extractelement <4 x float> [[NEG]], i64 0
// CHECK-NEXT: [[C:%.+]] = extractelement <4 x float> %{{.*}}, i64 0
@@ -7626,7 +7632,7 @@
__m128 test_mm_fnmadd_round_ss(__m128 __A, __m128 __B, __m128 __C){
// CHECK-LABEL: @test_mm_fnmadd_round_ss
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> %{{.*}}
// CHECK: [[A:%.+]] = extractelement <4 x float> [[ORIGA:%.+]], i64 0
// CHECK-NEXT: [[B:%.+]] = extractelement <4 x float> [[NEG]], i64 0
// CHECK-NEXT: [[C:%.+]] = extractelement <4 x float> %{{.*}}, i64 0
@@ -7637,7 +7643,7 @@
__m128 test_mm_mask_fnmadd_round_ss(__m128 __W, __mmask8 __U, __m128 __A, __m128 __B){
// CHECK-LABEL: @test_mm_mask_fnmadd_round_ss
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> %{{.*}}
// CHECK: [[A:%.+]] = extractelement <4 x float> [[ORIGA:%.+]], i64 0
// CHECK-NEXT: [[B:%.+]] = extractelement <4 x float> [[NEG]], i64 0
// CHECK-NEXT: [[C:%.+]] = extractelement <4 x float> %{{.*}}, i64 0
@@ -7651,7 +7657,7 @@
__m128 test_mm_maskz_fnmadd_ss(__mmask8 __U, __m128 __A, __m128 __B, __m128 __C){
// CHECK-LABEL: @test_mm_maskz_fnmadd_ss
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> %{{.*}}
// CHECK: [[A:%.+]] = extractelement <4 x float> [[ORIGA:%.+]], i64 0
// CHECK-NEXT: [[B:%.+]] = extractelement <4 x float> [[NEG]], i64 0
// CHECK-NEXT: [[C:%.+]] = extractelement <4 x float> %{{.*}}, i64 0
@@ -7665,7 +7671,7 @@
__m128 test_mm_maskz_fnmadd_round_ss(__mmask8 __U, __m128 __A, __m128 __B, __m128 __C){
// CHECK-LABEL: @test_mm_maskz_fnmadd_round_ss
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> %{{.*}}
// CHECK: [[A:%.+]] = extractelement <4 x float> [[ORIGA:%.+]], i64 0
// CHECK-NEXT: [[B:%.+]] = extractelement <4 x float> [[NEG]], i64 0
// CHECK-NEXT: [[C:%.+]] = extractelement <4 x float> %{{.*}}, i64 0
@@ -7679,7 +7685,7 @@
__m128 test_mm_mask3_fnmadd_ss(__m128 __W, __m128 __X, __m128 __Y, __mmask8 __U){
// CHECK-LABEL: @test_mm_mask3_fnmadd_ss
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> %{{.*}}
// CHECK: [[A:%.+]] = extractelement <4 x float> %{{.*}}, i64 0
// CHECK-NEXT: [[B:%.+]] = extractelement <4 x float> [[NEG]], i64 0
// CHECK-NEXT: [[C:%.+]] = extractelement <4 x float> [[ORIGC:%.+]], i64 0
@@ -7693,7 +7699,7 @@
__m128 test_mm_mask3_fnmadd_round_ss(__m128 __W, __m128 __X, __m128 __Y, __mmask8 __U){
// CHECK-LABEL: @test_mm_mask3_fnmadd_round_ss
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> %{{.*}}
// CHECK: [[A:%.+]] = extractelement <4 x float> %{{.*}}, i64 0
// CHECK-NEXT: [[B:%.+]] = extractelement <4 x float> [[NEG]], i64 0
// CHECK-NEXT: [[C:%.+]] = extractelement <4 x float> [[ORIGC:%.+]], i64 0
@@ -7707,8 +7713,8 @@
__m128 test_mm_mask_fnmsub_ss(__m128 __W, __mmask8 __U, __m128 __A, __m128 __B){
// CHECK-LABEL: @test_mm_mask_fnmsub_ss
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
- // CHECK: [[NEG2:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> %{{.*}}
+ // CHECK: [[NEG2:%.+]] = fneg <4 x float> %{{.*}}
// CHECK: [[A:%.+]] = extractelement <4 x float> [[ORIGA:%.+]], i64 0
// CHECK-NEXT: [[B:%.+]] = extractelement <4 x float> [[NEG]], i64 0
// CHECK-NEXT: [[C:%.+]] = extractelement <4 x float> [[NEG2]], i64 0
@@ -7722,8 +7728,8 @@
__m128 test_mm_fnmsub_round_ss(__m128 __A, __m128 __B, __m128 __C){
// CHECK-LABEL: @test_mm_fnmsub_round_ss
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
- // CHECK: [[NEG2:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> %{{.*}}
+ // CHECK: [[NEG2:%.+]] = fneg <4 x float> %{{.*}}
// CHECK: [[A:%.+]] = extractelement <4 x float> [[ORIGA:%.+]], i64 0
// CHECK-NEXT: [[B:%.+]] = extractelement <4 x float> [[NEG]], i64 0
// CHECK-NEXT: [[C:%.+]] = extractelement <4 x float> [[NEG2]], i64 0
@@ -7734,8 +7740,8 @@
__m128 test_mm_mask_fnmsub_round_ss(__m128 __W, __mmask8 __U, __m128 __A, __m128 __B){
// CHECK-LABEL: @test_mm_mask_fnmsub_round_ss
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
- // CHECK: [[NEG2:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> %{{.*}}
+ // CHECK: [[NEG2:%.+]] = fneg <4 x float> %{{.*}}
// CHECK: [[A:%.+]] = extractelement <4 x float> [[ORIGA:%.+]], i64 0
// CHECK-NEXT: [[B:%.+]] = extractelement <4 x float> [[NEG]], i64 0
// CHECK-NEXT: [[C:%.+]] = extractelement <4 x float> [[NEG2]], i64 0
@@ -7749,8 +7755,8 @@
__m128 test_mm_maskz_fnmsub_ss(__mmask8 __U, __m128 __A, __m128 __B, __m128 __C){
// CHECK-LABEL: @test_mm_maskz_fnmsub_ss
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
- // CHECK: [[NEG2:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> %{{.*}}
+ // CHECK: [[NEG2:%.+]] = fneg <4 x float> %{{.*}}
// CHECK: [[A:%.+]] = extractelement <4 x float> [[ORIGA:%.+]], i64 0
// CHECK-NEXT: [[B:%.+]] = extractelement <4 x float> [[NEG]], i64 0
// CHECK-NEXT: [[C:%.+]] = extractelement <4 x float> [[NEG2]], i64 0
@@ -7764,8 +7770,8 @@
__m128 test_mm_maskz_fnmsub_round_ss(__mmask8 __U, __m128 __A, __m128 __B, __m128 __C){
// CHECK-LABEL: @test_mm_maskz_fnmsub_round_ss
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
- // CHECK: [[NEG2:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> %{{.*}}
+ // CHECK: [[NEG2:%.+]] = fneg <4 x float> %{{.*}}
// CHECK: [[A:%.+]] = extractelement <4 x float> [[ORIGA:%.+]], i64 0
// CHECK-NEXT: [[B:%.+]] = extractelement <4 x float> [[NEG]], i64 0
// CHECK-NEXT: [[C:%.+]] = extractelement <4 x float> [[NEG2]], i64 0
@@ -7779,8 +7785,8 @@
__m128 test_mm_mask3_fnmsub_ss(__m128 __W, __m128 __X, __m128 __Y, __mmask8 __U){
// CHECK-LABEL: @test_mm_mask3_fnmsub_ss
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
- // CHECK: [[NEG2:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, [[ORIGC:%.+]]
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> %{{.*}}
+ // CHECK: [[NEG2:%.+]] = fneg <4 x float> [[ORIGC:%.+]]
// CHECK: [[A:%.+]] = extractelement <4 x float> %{{.*}}, i64 0
// CHECK-NEXT: [[B:%.+]] = extractelement <4 x float> [[NEG]], i64 0
// CHECK-NEXT: [[C:%.+]] = extractelement <4 x float> [[NEG2]], i64 0
@@ -7795,8 +7801,8 @@
__m128 test_mm_mask3_fnmsub_round_ss(__m128 __W, __m128 __X, __m128 __Y, __mmask8 __U){
// CHECK-LABEL: @test_mm_mask3_fnmsub_round_ss
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
- // CHECK: [[NEG2:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, [[ORIGC:%.+]]
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> %{{.*}}
+ // CHECK: [[NEG2:%.+]] = fneg <4 x float> [[ORIGC:%.+]]
// CHECK: [[A:%.+]] = extractelement <4 x float> %{{.*}}, i64 0
// CHECK-NEXT: [[B:%.+]] = extractelement <4 x float> [[NEG]], i64 0
// CHECK-NEXT: [[C:%.+]] = extractelement <4 x float> [[NEG2]], i64 0
@@ -7899,7 +7905,7 @@
__m128d test_mm_mask_fmsub_sd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B){
// CHECK-LABEL: @test_mm_mask_fmsub_sd
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> %{{.*}}
// CHECK: [[A:%.+]] = extractelement <2 x double> [[ORIGA:%.+]], i64 0
// CHECK-NEXT: [[B:%.+]] = extractelement <2 x double> %{{.*}}, i64 0
// CHECK-NEXT: [[C:%.+]] = extractelement <2 x double> [[NEG]], i64 0
@@ -7913,7 +7919,7 @@
__m128d test_mm_fmsub_round_sd(__m128d __A, __m128d __B, __m128d __C){
// CHECK-LABEL: @test_mm_fmsub_round_sd
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> %{{.*}}
// CHECK: [[A:%.+]] = extractelement <2 x double> [[ORIGA:%.+]], i64 0
// CHECK-NEXT: [[B:%.+]] = extractelement <2 x double> %{{.*}}, i64 0
// CHECK-NEXT: [[C:%.+]] = extractelement <2 x double> [[NEG]], i64 0
@@ -7924,7 +7930,7 @@
__m128d test_mm_mask_fmsub_round_sd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B){
// CHECK-LABEL: @test_mm_mask_fmsub_round_sd
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> %{{.*}}
// CHECK: [[A:%.+]] = extractelement <2 x double> [[ORIGA:%.+]], i64 0
// CHECK-NEXT: [[B:%.+]] = extractelement <2 x double> %{{.*}}, i64 0
// CHECK-NEXT: [[C:%.+]] = extractelement <2 x double> [[NEG]], i64 0
@@ -7938,7 +7944,7 @@
__m128d test_mm_maskz_fmsub_sd(__mmask8 __U, __m128d __A, __m128d __B, __m128d __C){
// CHECK-LABEL: @test_mm_maskz_fmsub_sd
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> %{{.*}}
// CHECK: [[A:%.+]] = extractelement <2 x double> [[ORIGA:%.+]], i64 0
// CHECK-NEXT: [[B:%.+]] = extractelement <2 x double> %{{.*}}, i64 0
// CHECK-NEXT: [[C:%.+]] = extractelement <2 x double> [[NEG]], i64 0
@@ -7952,7 +7958,7 @@
__m128d test_mm_maskz_fmsub_round_sd(__mmask8 __U, __m128d __A, __m128d __B, __m128d __C){
// CHECK-LABEL: @test_mm_maskz_fmsub_round_sd
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> %{{.*}}
// CHECK: [[A:%.+]] = extractelement <2 x double> [[ORIGA:%.+]], i64 0
// CHECK-NEXT: [[B:%.+]] = extractelement <2 x double> %{{.*}}, i64 0
// CHECK-NEXT: [[C:%.+]] = extractelement <2 x double> [[NEG]], i64 0
@@ -7966,7 +7972,7 @@
__m128d test_mm_mask3_fmsub_sd(__m128d __W, __m128d __X, __m128d __Y, __mmask8 __U){
// CHECK-LABEL: @test_mm_mask3_fmsub_sd
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, [[ORIGC:%.+]]
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> [[ORIGC:%.+]]
// CHECK: [[A:%.+]] = extractelement <2 x double> %{{.*}}, i64 0
// CHECK-NEXT: [[B:%.+]] = extractelement <2 x double> %{{.*}}, i64 0
// CHECK-NEXT: [[C:%.+]] = extractelement <2 x double> [[NEG]], i64 0
@@ -7981,7 +7987,7 @@
__m128d test_mm_mask3_fmsub_round_sd(__m128d __W, __m128d __X, __m128d __Y, __mmask8 __U){
// CHECK-LABEL: @test_mm_mask3_fmsub_round_sd
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, [[ORIGC:%.+]]
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> [[ORIGC:%.+]]
// CHECK: [[A:%.+]] = extractelement <2 x double> %{{.*}}, i64 0
// CHECK-NEXT: [[B:%.+]] = extractelement <2 x double> %{{.*}}, i64 0
// CHECK-NEXT: [[C:%.+]] = extractelement <2 x double> [[NEG]], i64 0
@@ -7996,7 +8002,7 @@
__m128d test_mm_mask_fnmadd_sd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B){
// CHECK-LABEL: @test_mm_mask_fnmadd_sd
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> %{{.*}}
// CHECK: [[A:%.+]] = extractelement <2 x double> [[ORIGA:%.+]], i64 0
// CHECK-NEXT: [[B:%.+]] = extractelement <2 x double> [[NEG]], i64 0
// CHECK-NEXT: [[C:%.+]] = extractelement <2 x double> %{{.*}}, i64 0
@@ -8010,7 +8016,7 @@
__m128d test_mm_fnmadd_round_sd(__m128d __A, __m128d __B, __m128d __C){
// CHECK-LABEL: @test_mm_fnmadd_round_sd
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> %{{.*}}
// CHECK: [[A:%.+]] = extractelement <2 x double> [[ORIGA:%.+]], i64 0
// CHECK-NEXT: [[B:%.+]] = extractelement <2 x double> [[NEG]], i64 0
// CHECK-NEXT: [[C:%.+]] = extractelement <2 x double> %{{.*}}, i64 0
@@ -8021,7 +8027,7 @@
__m128d test_mm_mask_fnmadd_round_sd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B){
// CHECK-LABEL: @test_mm_mask_fnmadd_round_sd
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> %{{.*}}
// CHECK: [[A:%.+]] = extractelement <2 x double> [[ORIGA:%.+]], i64 0
// CHECK-NEXT: [[B:%.+]] = extractelement <2 x double> [[NEG]], i64 0
// CHECK-NEXT: [[C:%.+]] = extractelement <2 x double> %{{.*}}, i64 0
@@ -8035,7 +8041,7 @@
__m128d test_mm_maskz_fnmadd_sd(__mmask8 __U, __m128d __A, __m128d __B, __m128d __C){
// CHECK-LABEL: @test_mm_maskz_fnmadd_sd
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> %{{.*}}
// CHECK: [[A:%.+]] = extractelement <2 x double> [[ORIGA:%.+]], i64 0
// CHECK-NEXT: [[B:%.+]] = extractelement <2 x double> [[NEG]], i64 0
// CHECK-NEXT: [[C:%.+]] = extractelement <2 x double> %{{.*}}, i64 0
@@ -8049,7 +8055,7 @@
__m128d test_mm_maskz_fnmadd_round_sd(__mmask8 __U, __m128d __A, __m128d __B, __m128d __C){
// CHECK-LABEL: @test_mm_maskz_fnmadd_round_sd
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> %{{.*}}
// CHECK: [[A:%.+]] = extractelement <2 x double> [[ORIGA:%.+]], i64 0
// CHECK-NEXT: [[B:%.+]] = extractelement <2 x double> [[NEG]], i64 0
// CHECK-NEXT: [[C:%.+]] = extractelement <2 x double> %{{.*}}, i64 0
@@ -8063,7 +8069,7 @@
__m128d test_mm_mask3_fnmadd_sd(__m128d __W, __m128d __X, __m128d __Y, __mmask8 __U){
// CHECK-LABEL: @test_mm_mask3_fnmadd_sd
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> %{{.*}}
// CHECK: [[A:%.+]] = extractelement <2 x double> %{{.*}}, i64 0
// CHECK-NEXT: [[B:%.+]] = extractelement <2 x double> [[NEG]], i64 0
// CHECK-NEXT: [[C:%.+]] = extractelement <2 x double> [[ORIGC:%.+]], i64 0
@@ -8077,7 +8083,7 @@
__m128d test_mm_mask3_fnmadd_round_sd(__m128d __W, __m128d __X, __m128d __Y, __mmask8 __U){
// CHECK-LABEL: @test_mm_mask3_fnmadd_round_sd
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> %{{.*}}
// CHECK: [[A:%.+]] = extractelement <2 x double> %{{.*}}, i64 0
// CHECK-NEXT: [[B:%.+]] = extractelement <2 x double> [[NEG]], i64 0
// CHECK-NEXT: [[C:%.+]] = extractelement <2 x double> [[ORIGC:%.+]], i64 0
@@ -8091,8 +8097,8 @@
__m128d test_mm_mask_fnmsub_sd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B){
// CHECK-LABEL: @test_mm_mask_fnmsub_sd
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.*}}
- // CHECK: [[NEG2:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> %{{.*}}
+ // CHECK: [[NEG2:%.+]] = fneg <2 x double> %{{.*}}
// CHECK: [[A:%.+]] = extractelement <2 x double> [[ORIGA:%.]], i64 0
// CHECK-NEXT: [[B:%.+]] = extractelement <2 x double> [[NEG]], i64 0
// CHECK-NEXT: [[C:%.+]] = extractelement <2 x double> [[NEG2]], i64 0
@@ -8106,8 +8112,8 @@
__m128d test_mm_fnmsub_round_sd(__m128d __A, __m128d __B, __m128d __C){
// CHECK-LABEL: @test_mm_fnmsub_round_sd
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.*}}
- // CHECK: [[NEG2:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> %{{.*}}
+ // CHECK: [[NEG2:%.+]] = fneg <2 x double> %{{.*}}
// CHECK: [[A:%.+]] = extractelement <2 x double> [[ORIGA:%.]], i64 0
// CHECK-NEXT: [[B:%.+]] = extractelement <2 x double> [[NEG]], i64 0
// CHECK-NEXT: [[C:%.+]] = extractelement <2 x double> [[NEG2]], i64 0
@@ -8118,8 +8124,8 @@
__m128d test_mm_mask_fnmsub_round_sd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B){
// CHECK-LABEL: @test_mm_mask_fnmsub_round_sd
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.*}}
- // CHECK: [[NEG2:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> %{{.*}}
+ // CHECK: [[NEG2:%.+]] = fneg <2 x double> %{{.*}}
// CHECK: [[A:%.+]] = extractelement <2 x double> [[ORIGA:%.]], i64 0
// CHECK-NEXT: [[B:%.+]] = extractelement <2 x double> [[NEG]], i64 0
// CHECK-NEXT: [[C:%.+]] = extractelement <2 x double> [[NEG2]], i64 0
@@ -8133,8 +8139,8 @@
__m128d test_mm_maskz_fnmsub_sd(__mmask8 __U, __m128d __A, __m128d __B, __m128d __C){
// CHECK-LABEL: @test_mm_maskz_fnmsub_sd
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.*}}
- // CHECK: [[NEG2:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> %{{.*}}
+ // CHECK: [[NEG2:%.+]] = fneg <2 x double> %{{.*}}
// CHECK: [[A:%.+]] = extractelement <2 x double> [[ORIGA:%.]], i64 0
// CHECK-NEXT: [[B:%.+]] = extractelement <2 x double> [[NEG]], i64 0
// CHECK-NEXT: [[C:%.+]] = extractelement <2 x double> [[NEG2]], i64 0
@@ -8148,8 +8154,8 @@
__m128d test_mm_maskz_fnmsub_round_sd(__mmask8 __U, __m128d __A, __m128d __B, __m128d __C){
// CHECK-LABEL: @test_mm_maskz_fnmsub_round_sd
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.*}}
- // CHECK: [[NEG2:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> %{{.*}}
+ // CHECK: [[NEG2:%.+]] = fneg <2 x double> %{{.*}}
// CHECK: [[A:%.+]] = extractelement <2 x double> [[ORIGA:%.]], i64 0
// CHECK-NEXT: [[B:%.+]] = extractelement <2 x double> [[NEG]], i64 0
// CHECK-NEXT: [[C:%.+]] = extractelement <2 x double> [[NEG2]], i64 0
@@ -8163,8 +8169,8 @@
__m128d test_mm_mask3_fnmsub_sd(__m128d __W, __m128d __X, __m128d __Y, __mmask8 __U){
// CHECK-LABEL: @test_mm_mask3_fnmsub_sd
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.*}}
- // CHECK: [[NEG2:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, [[ORIGC:%.+]]
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> %{{.*}}
+ // CHECK: [[NEG2:%.+]] = fneg <2 x double> [[ORIGC:%.+]]
// CHECK: [[A:%.+]] = extractelement <2 x double> %{{.*}}, i64 0
// CHECK-NEXT: [[B:%.+]] = extractelement <2 x double> [[NEG]], i64 0
// CHECK-NEXT: [[C:%.+]] = extractelement <2 x double> [[NEG2]], i64 0
@@ -8179,8 +8185,8 @@
__m128d test_mm_mask3_fnmsub_round_sd(__m128d __W, __m128d __X, __m128d __Y, __mmask8 __U){
// CHECK-LABEL: @test_mm_mask3_fnmsub_round_sd
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.*}}
- // CHECK: [[NEG2:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, [[ORIGC:%.+]]
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> %{{.*}}
+ // CHECK: [[NEG2:%.+]] = fneg <2 x double> [[ORIGC:%.+]]
// CHECK: [[A:%.+]] = extractelement <2 x double> %{{.*}}, i64 0
// CHECK-NEXT: [[B:%.+]] = extractelement <2 x double> [[NEG]], i64 0
// CHECK-NEXT: [[C:%.+]] = extractelement <2 x double> [[NEG2]], i64 0
@@ -8569,6 +8575,12 @@
_mm512_stream_si512(__P, __A);
}
+void test_mm512_stream_si512_2(void * __P, __m512i __A) {
+ // CHECK-LABEL: @test_mm512_stream_si512
+ // CHECK: store <8 x i64> %{{.*}}, <8 x i64>* %{{.*}}, align 64, !nontemporal
+ _mm512_stream_si512(__P, __A);
+}
+
__m512i test_mm512_stream_load_si512(void *__P) {
// CHECK-LABEL: @test_mm512_stream_load_si512
// CHECK: load <8 x i64>, <8 x i64>* %{{.*}}, align 64, !nontemporal
@@ -8587,12 +8599,23 @@
return _mm512_stream_pd(__P, __A);
}
+void test_mm512_stream_pd_2(void *__P, __m512d __A) {
+ // CHECK-LABEL: @test_mm512_stream_pd
+ // CHECK: store <8 x double> %{{.*}}, <8 x double>* %{{.*}}, align 64, !nontemporal
+ return _mm512_stream_pd(__P, __A);
+}
+
void test_mm512_stream_ps(float *__P, __m512 __A) {
// CHECK-LABEL: @test_mm512_stream_ps
// CHECK: store <16 x float> %{{.*}}, <16 x float>* %{{.*}}, align 64, !nontemporal
_mm512_stream_ps(__P, __A);
}
+void test_mm512_stream_ps_2(void *__P, __m512 __A) {
+ // CHECK-LABEL: @test_mm512_stream_ps
+ // CHECK: store <16 x float> %{{.*}}, <16 x float>* %{{.*}}, align 64, !nontemporal
+ _mm512_stream_ps(__P, __A);
+}
__m512d test_mm512_mask_compress_pd(__m512d __W, __mmask8 __U, __m512d __A) {
// CHECK-LABEL: @test_mm512_mask_compress_pd
// CHECK: @llvm.x86.avx512.mask.compress
@@ -9445,7 +9468,7 @@
return _mm512_mask_cvtpd_ps (__W,__U,__A);
}
-__m512d test_mm512_cvtpd_pslo(__m512 __A)
+__m512 test_mm512_cvtpd_pslo(__m512d __A)
{
// CHECK-LABEL: @test_mm512_cvtpd_pslo
// CHECK: @llvm.x86.avx512.mask.cvtpd2ps.512
@@ -9454,7 +9477,7 @@
return _mm512_cvtpd_pslo(__A);
}
-__m512d test_mm512_mask_cvtpd_pslo(__m512 __W, __mmask8 __U, __m512d __A) {
+__m512 test_mm512_mask_cvtpd_pslo(__m512 __W, __mmask8 __U, __m512d __A) {
// CHECK-LABEL: @test_mm512_mask_cvtpd_pslo
// CHECK: @llvm.x86.avx512.mask.cvtpd2ps.512
// CHECK: zeroinitializer
@@ -10480,20 +10503,24 @@
__m512i test_mm512_mask_abs_epi32 (__m512i __W, __mmask16 __U, __m512i __A)
{
- // CHECK-LABEL: @test_mm512_mask_abs_epi32
+ // CHECK-LABEL: @test_mm512_mask_abs_epi32
// CHECK: [[SUB:%.*]] = sub <16 x i32> zeroinitializer, [[A:%.*]]
// CHECK: [[CMP:%.*]] = icmp sgt <16 x i32> [[A]], zeroinitializer
// CHECK: [[SEL:%.*]] = select <16 x i1> [[CMP]], <16 x i32> [[A]], <16 x i32> [[SUB]]
+ // CHECK: [[TMP:%.*]] = bitcast <16 x i32> [[SEL]] to <8 x i64>
+ // CHECK: [[SEL:%.*]] = bitcast <8 x i64> [[TMP]] to <16 x i32>
// CHECK: select <16 x i1> %{{.*}}, <16 x i32> [[SEL]], <16 x i32> %{{.*}}
return _mm512_mask_abs_epi32 (__W,__U,__A);
}
__m512i test_mm512_maskz_abs_epi32 (__mmask16 __U, __m512i __A)
{
- // CHECK-LABEL: @test_mm512_maskz_abs_epi32
+ // CHECK-LABEL: @test_mm512_maskz_abs_epi32
// CHECK: [[SUB:%.*]] = sub <16 x i32> zeroinitializer, [[A:%.*]]
// CHECK: [[CMP:%.*]] = icmp sgt <16 x i32> [[A]], zeroinitializer
// CHECK: [[SEL:%.*]] = select <16 x i1> [[CMP]], <16 x i32> [[A]], <16 x i32> [[SUB]]
+ // CHECK: [[TMP:%.*]] = bitcast <16 x i32> [[SEL]] to <8 x i64>
+ // CHECK: [[SEL:%.*]] = bitcast <8 x i64> [[TMP]] to <16 x i32>
// CHECK: select <16 x i1> %{{.*}}, <16 x i32> [[SEL]], <16 x i32> %{{.*}}
return _mm512_maskz_abs_epi32 (__U,__A);
}
@@ -10632,7 +10659,7 @@
return _mm512_setzero_epi32();
}
-__m512i test_mm512_setzero()
+__m512 test_mm512_setzero()
{
// CHECK-LABEL: @test_mm512_setzero
// CHECK: zeroinitializer
@@ -10646,7 +10673,7 @@
return _mm512_setzero_si512();
}
-__m512i test_mm512_setzero_ps()
+__m512 test_mm512_setzero_ps()
{
// CHECK-LABEL: @test_mm512_setzero_ps
// CHECK: zeroinitializer
diff --git a/src/llvm-project/clang/test/CodeGen/avx512vl-builtins.c b/src/llvm-project/clang/test/CodeGen/avx512vl-builtins.c
index 90349fa..81a689f 100644
--- a/src/llvm-project/clang/test/CodeGen/avx512vl-builtins.c
+++ b/src/llvm-project/clang/test/CodeGen/avx512vl-builtins.c
@@ -1,5 +1,4 @@
-// RUN: %clang_cc1 -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx512f -target-feature +avx512vl -emit-llvm -o - -Wall -Werror | FileCheck %s
-
+// RUN: %clang_cc1 -ffreestanding %s -fexperimental-new-pass-manager -triple=x86_64-apple-darwin -target-feature +avx512f -target-feature +avx512vl -emit-llvm -o - -Wall -Werror | FileCheck %s
#include <immintrin.h>
@@ -2846,7 +2845,7 @@
__m128d test_mm_mask_fmsub_pd(__m128d __A, __mmask8 __U, __m128d __B, __m128d __C) {
// CHECK-LABEL: @test_mm_mask_fmsub_pd
- // CHECK: fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <2 x double> %{{.*}}
// CHECK: call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: shufflevector <8 x i1> %{{.*}}, <8 x i1> %{{.*}}, <2 x i32> <i32 0, i32 1>
@@ -2865,7 +2864,7 @@
__m128d test_mm_mask3_fnmadd_pd(__m128d __A, __m128d __B, __m128d __C, __mmask8 __U) {
// CHECK-LABEL: @test_mm_mask3_fnmadd_pd
- // CHECK: fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <2 x double> %{{.*}}
// CHECK: call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: shufflevector <8 x i1> %{{.*}}, <8 x i1> %{{.*}}, <2 x i32> <i32 0, i32 1>
@@ -2884,7 +2883,7 @@
__m128d test_mm_maskz_fmsub_pd(__mmask8 __U, __m128d __A, __m128d __B, __m128d __C) {
// CHECK-LABEL: @test_mm_maskz_fmsub_pd
- // CHECK: fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <2 x double> %{{.*}}
// CHECK: call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: shufflevector <8 x i1> %{{.*}}, <8 x i1> %{{.*}}, <2 x i32> <i32 0, i32 1>
@@ -2894,7 +2893,7 @@
__m128d test_mm_maskz_fnmadd_pd(__mmask8 __U, __m128d __A, __m128d __B, __m128d __C) {
// CHECK-LABEL: @test_mm_maskz_fnmadd_pd
- // CHECK: fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <2 x double> %{{.*}}
// CHECK: call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: shufflevector <8 x i1> %{{.*}}, <8 x i1> %{{.*}}, <2 x i32> <i32 0, i32 1>
@@ -2904,8 +2903,8 @@
__m128d test_mm_maskz_fnmsub_pd(__mmask8 __U, __m128d __A, __m128d __B, __m128d __C) {
// CHECK-LABEL: @test_mm_maskz_fnmsub_pd
- // CHECK: fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.*}}
- // CHECK: fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <2 x double> %{{.*}}
+ // CHECK: fneg <2 x double> %{{.*}}
// CHECK: call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: shufflevector <8 x i1> %{{.*}}, <8 x i1> %{{.*}}, <2 x i32> <i32 0, i32 1>
@@ -2924,7 +2923,7 @@
__m256d test_mm256_mask_fmsub_pd(__m256d __A, __mmask8 __U, __m256d __B, __m256d __C) {
// CHECK-LABEL: @test_mm256_mask_fmsub_pd
- // CHECK: fsub <4 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <4 x double> %{{.*}}
// CHECK: call <4 x double> @llvm.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: shufflevector <8 x i1> %{{.*}}, <8 x i1> %{{.*}}, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
@@ -2943,7 +2942,7 @@
__m256d test_mm256_mask3_fnmadd_pd(__m256d __A, __m256d __B, __m256d __C, __mmask8 __U) {
// CHECK-LABEL: @test_mm256_mask3_fnmadd_pd
- // CHECK: fsub <4 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <4 x double> %{{.*}}
// CHECK: call <4 x double> @llvm.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: shufflevector <8 x i1> %{{.*}}, <8 x i1> %{{.*}}, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
@@ -2962,7 +2961,7 @@
__m256d test_mm256_maskz_fmsub_pd(__mmask8 __U, __m256d __A, __m256d __B, __m256d __C) {
// CHECK-LABEL: @test_mm256_maskz_fmsub_pd
- // CHECK: fsub <4 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <4 x double> %{{.*}}
// CHECK: call <4 x double> @llvm.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: shufflevector <8 x i1> %{{.*}}, <8 x i1> %{{.*}}, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
@@ -2972,7 +2971,7 @@
__m256d test_mm256_maskz_fnmadd_pd(__mmask8 __U, __m256d __A, __m256d __B, __m256d __C) {
// CHECK-LABEL: @test_mm256_maskz_fnmadd_pd
- // CHECK: fsub <4 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <4 x double> %{{.*}}
// CHECK: call <4 x double> @llvm.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: shufflevector <8 x i1> %{{.*}}, <8 x i1> %{{.*}}, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
@@ -2982,8 +2981,8 @@
__m256d test_mm256_maskz_fnmsub_pd(__mmask8 __U, __m256d __A, __m256d __B, __m256d __C) {
// CHECK-LABEL: @test_mm256_maskz_fnmsub_pd
- // CHECK: fsub <4 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.*}}
- // CHECK: fsub <4 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <4 x double> %{{.*}}
+ // CHECK: fneg <4 x double> %{{.*}}
// CHECK: call <4 x double> @llvm.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: shufflevector <8 x i1> %{{.*}}, <8 x i1> %{{.*}}, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
@@ -3002,7 +3001,7 @@
__m128 test_mm_mask_fmsub_ps(__m128 __A, __mmask8 __U, __m128 __B, __m128 __C) {
// CHECK-LABEL: @test_mm_mask_fmsub_ps
- // CHECK: fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <4 x float> %{{.*}}
// CHECK: call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: shufflevector <8 x i1> %{{.*}}, <8 x i1> %{{.*}}, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
@@ -3021,7 +3020,7 @@
__m128 test_mm_mask3_fnmadd_ps(__m128 __A, __m128 __B, __m128 __C, __mmask8 __U) {
// CHECK-LABEL: @test_mm_mask3_fnmadd_ps
- // CHECK: fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <4 x float> %{{.*}}
// CHECK: call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: shufflevector <8 x i1> %{{.*}}, <8 x i1> %{{.*}}, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
@@ -3040,7 +3039,7 @@
__m128 test_mm_maskz_fmsub_ps(__mmask8 __U, __m128 __A, __m128 __B, __m128 __C) {
// CHECK-LABEL: @test_mm_maskz_fmsub_ps
- // CHECK: fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <4 x float> %{{.*}}
// CHECK: call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: shufflevector <8 x i1> %{{.*}}, <8 x i1> %{{.*}}, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
@@ -3050,7 +3049,7 @@
__m128 test_mm_maskz_fnmadd_ps(__mmask8 __U, __m128 __A, __m128 __B, __m128 __C) {
// CHECK-LABEL: @test_mm_maskz_fnmadd_ps
- // CHECK: fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <4 x float> %{{.*}}
// CHECK: call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: shufflevector <8 x i1> %{{.*}}, <8 x i1> %{{.*}}, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
@@ -3060,8 +3059,8 @@
__m128 test_mm_maskz_fnmsub_ps(__mmask8 __U, __m128 __A, __m128 __B, __m128 __C) {
// CHECK-LABEL: @test_mm_maskz_fnmsub_ps
- // CHECK: fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
- // CHECK: fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <4 x float> %{{.*}}
+ // CHECK: fneg <4 x float> %{{.*}}
// CHECK: call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: shufflevector <8 x i1> %{{.*}}, <8 x i1> %{{.*}}, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
@@ -3079,7 +3078,7 @@
__m256 test_mm256_mask_fmsub_ps(__m256 __A, __mmask8 __U, __m256 __B, __m256 __C) {
// CHECK-LABEL: @test_mm256_mask_fmsub_ps
- // CHECK: fsub <8 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <8 x float> %{{.*}}
// CHECK: call <8 x float> @llvm.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: select <8 x i1> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}}
@@ -3096,7 +3095,7 @@
__m256 test_mm256_mask3_fnmadd_ps(__m256 __A, __m256 __B, __m256 __C, __mmask8 __U) {
// CHECK-LABEL: @test_mm256_mask3_fnmadd_ps
- // CHECK: fsub <8 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <8 x float> %{{.*}}
// CHECK: call <8 x float> @llvm.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: select <8 x i1> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}}
@@ -3113,7 +3112,7 @@
__m256 test_mm256_maskz_fmsub_ps(__mmask8 __U, __m256 __A, __m256 __B, __m256 __C) {
// CHECK-LABEL: @test_mm256_maskz_fmsub_ps
- // CHECK: fsub <8 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <8 x float> %{{.*}}
// CHECK: call <8 x float> @llvm.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: select <8 x i1> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}}
@@ -3122,7 +3121,7 @@
__m256 test_mm256_maskz_fnmadd_ps(__mmask8 __U, __m256 __A, __m256 __B, __m256 __C) {
// CHECK-LABEL: @test_mm256_maskz_fnmadd_ps
- // CHECK: fsub <8 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <8 x float> %{{.*}}
// CHECK: call <8 x float> @llvm.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: select <8 x i1> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}}
@@ -3131,8 +3130,8 @@
__m256 test_mm256_maskz_fnmsub_ps(__mmask8 __U, __m256 __A, __m256 __B, __m256 __C) {
// CHECK-LABEL: @test_mm256_maskz_fnmsub_ps
- // CHECK: fsub <8 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
- // CHECK: fsub <8 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <8 x float> %{{.*}}
+ // CHECK: fneg <8 x float> %{{.*}}
// CHECK: call <8 x float> @llvm.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: select <8 x i1> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}}
@@ -3142,7 +3141,7 @@
__m128d test_mm_mask_fmaddsub_pd(__m128d __A, __mmask8 __U, __m128d __B, __m128d __C) {
// CHECK-LABEL: @test_mm_mask_fmaddsub_pd
// CHECK: [[ADD:%.+]] = call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}})
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> %{{.+}}
// CHECK: [[SUB:%.+]] = call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> [[NEG]]
// CHECK: shufflevector <2 x double> [[SUB]], <2 x double> [[ADD]], <2 x i32> <i32 0, i32 3>
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
@@ -3153,7 +3152,7 @@
__m128d test_mm_mask_fmsubadd_pd(__m128d __A, __mmask8 __U, __m128d __B, __m128d __C) {
// CHECK-LABEL: @test_mm_mask_fmsubadd_pd
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> %{{.+}}
// CHECK: [[SUB:%.+]] = call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> [[NEG]]
// CHECK: [[ADD:%.+]] = call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}})
// CHECK: shufflevector <2 x double> [[ADD]], <2 x double> [[SUB]], <2 x i32> <i32 0, i32 3>
@@ -3166,7 +3165,7 @@
__m128d test_mm_mask3_fmaddsub_pd(__m128d __A, __m128d __B, __m128d __C, __mmask8 __U) {
// CHECK-LABEL: @test_mm_mask3_fmaddsub_pd
// CHECK: [[ADD:%.+]] = call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}})
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> %{{.+}}
// CHECK: [[SUB:%.+]] = call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> [[NEG]]
// CHECK: shufflevector <2 x double> [[SUB]], <2 x double> [[ADD]], <2 x i32> <i32 0, i32 3>
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
@@ -3178,7 +3177,7 @@
__m128d test_mm_maskz_fmaddsub_pd(__mmask8 __U, __m128d __A, __m128d __B, __m128d __C) {
// CHECK-LABEL: @test_mm_maskz_fmaddsub_pd
// CHECK: [[ADD:%.+]] = call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}})
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> %{{.+}}
// CHECK: [[SUB:%.+]] = call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> [[NEG]]
// CHECK: shufflevector <2 x double> [[SUB]], <2 x double> [[ADD]], <2 x i32> <i32 0, i32 3>
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
@@ -3189,7 +3188,7 @@
__m128d test_mm_maskz_fmsubadd_pd(__mmask8 __U, __m128d __A, __m128d __B, __m128d __C) {
// CHECK-LABEL: @test_mm_maskz_fmsubadd_pd
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> %{{.+}}
// CHECK: [[SUB:%.+]] = call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> [[NEG]]
// CHECK: [[ADD:%.+]] = call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}})
// CHECK: shufflevector <2 x double> [[ADD]], <2 x double> [[SUB]], <2 x i32> <i32 0, i32 3>
@@ -3202,7 +3201,7 @@
__m256d test_mm256_mask_fmaddsub_pd(__m256d __A, __mmask8 __U, __m256d __B, __m256d __C) {
// CHECK-LABEL: @test_mm256_mask_fmaddsub_pd
// CHECK: [[ADD:%.+]] = call <4 x double> @llvm.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}})
- // CHECK: [[NEG:%.+]] = fsub <4 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x double> %{{.+}}
// CHECK: [[SUB:%.+]] = call <4 x double> @llvm.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}})
// CHECK: shufflevector <4 x double> [[SUB]], <4 x double> [[ADD]], <4 x i32> <i32 0, i32 5, i32 2, i32 7>
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
@@ -3213,7 +3212,7 @@
__m256d test_mm256_mask_fmsubadd_pd(__m256d __A, __mmask8 __U, __m256d __B, __m256d __C) {
// CHECK-LABEL: @test_mm256_mask_fmsubadd_pd
- // CHECK: [[NEG:%.+]] = fsub <4 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x double> %{{.+}}
// CHECK: [[SUB:%.+]] = call <4 x double> @llvm.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> [[NEG]]
// CHECK: [[ADD:%.+]] = call <4 x double> @llvm.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}})
// CHECK: shufflevector <4 x double> [[ADD]], <4 x double> [[SUB]], <4 x i32> <i32 0, i32 5, i32 2, i32 7>
@@ -3226,7 +3225,7 @@
__m256d test_mm256_mask3_fmaddsub_pd(__m256d __A, __m256d __B, __m256d __C, __mmask8 __U) {
// CHECK-LABEL: @test_mm256_mask3_fmaddsub_pd
// CHECK: [[ADD:%.+]] = call <4 x double> @llvm.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}})
- // CHECK: [[NEG:%.+]] = fsub <4 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x double> %{{.+}}
// CHECK: [[SUB:%.+]] = call <4 x double> @llvm.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}})
// CHECK: shufflevector <4 x double> [[SUB]], <4 x double> [[ADD]], <4 x i32> <i32 0, i32 5, i32 2, i32 7>
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
@@ -3238,7 +3237,7 @@
__m256d test_mm256_maskz_fmaddsub_pd(__mmask8 __U, __m256d __A, __m256d __B, __m256d __C) {
// CHECK-LABEL: @test_mm256_maskz_fmaddsub_pd
// CHECK: [[ADD:%.+]] = call <4 x double> @llvm.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}})
- // CHECK: [[NEG:%.+]] = fsub <4 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x double> %{{.+}}
// CHECK: [[SUB:%.+]] = call <4 x double> @llvm.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}})
// CHECK: shufflevector <4 x double> [[SUB]], <4 x double> [[ADD]], <4 x i32> <i32 0, i32 5, i32 2, i32 7>
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
@@ -3249,7 +3248,7 @@
__m256d test_mm256_maskz_fmsubadd_pd(__mmask8 __U, __m256d __A, __m256d __B, __m256d __C) {
// CHECK-LABEL: @test_mm256_maskz_fmsubadd_pd
- // CHECK: [[NEG:%.+]] = fsub <4 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x double> %{{.+}}
// CHECK: [[SUB:%.+]] = call <4 x double> @llvm.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> [[NEG]]
// CHECK: [[ADD:%.+]] = call <4 x double> @llvm.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}})
// CHECK: shufflevector <4 x double> [[ADD]], <4 x double> [[SUB]], <4 x i32> <i32 0, i32 5, i32 2, i32 7>
@@ -3262,7 +3261,7 @@
__m128 test_mm_mask_fmaddsub_ps(__m128 __A, __mmask8 __U, __m128 __B, __m128 __C) {
// CHECK-LABEL: @test_mm_mask_fmaddsub_ps
// CHECK: [[ADD:%.+]] = call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> %{{.+}}
// CHECK: [[SUB:%.+]] = call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> [[NEG]]
// CHECK: shufflevector <4 x float> [[SUB]], <4 x float> [[ADD]], <4 x i32> <i32 0, i32 5, i32 2, i32 7>
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
@@ -3273,7 +3272,7 @@
__m128 test_mm_mask_fmsubadd_ps(__m128 __A, __mmask8 __U, __m128 __B, __m128 __C) {
// CHECK-LABEL: @test_mm_mask_fmsubadd_ps
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> %{{.+}}
// CHECK: [[SUB:%.+]] = call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> [[NEG]]
// CHECK: [[ADD:%.+]] = call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
// CHECK: shufflevector <4 x float> [[ADD]], <4 x float> [[SUB]], <4 x i32> <i32 0, i32 5, i32 2, i32 7>
@@ -3286,7 +3285,7 @@
__m128 test_mm_mask3_fmaddsub_ps(__m128 __A, __m128 __B, __m128 __C, __mmask8 __U) {
// CHECK-LABEL: @test_mm_mask3_fmaddsub_ps
// CHECK: [[ADD:%.+]] = call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> %{{.+}}
// CHECK: [[SUB:%.+]] = call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> [[NEG]]
// CHECK: shufflevector <4 x float> [[SUB]], <4 x float> [[ADD]], <4 x i32> <i32 0, i32 5, i32 2, i32 7>
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
@@ -3298,7 +3297,7 @@
__m128 test_mm_maskz_fmaddsub_ps(__mmask8 __U, __m128 __A, __m128 __B, __m128 __C) {
// CHECK-LABEL: @test_mm_maskz_fmaddsub_ps
// CHECK: [[ADD:%.+]] = call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> %{{.+}}
// CHECK: [[SUB:%.+]] = call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> [[NEG]]
// CHECK: shufflevector <4 x float> [[SUB]], <4 x float> [[ADD]], <4 x i32> <i32 0, i32 5, i32 2, i32 7>
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
@@ -3309,7 +3308,7 @@
__m128 test_mm_maskz_fmsubadd_ps(__mmask8 __U, __m128 __A, __m128 __B, __m128 __C) {
// CHECK-LABEL: @test_mm_maskz_fmsubadd_ps
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> %{{.+}}
// CHECK: [[SUB:%.+]] = call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> [[NEG]]
// CHECK: [[ADD:%.+]] = call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
// CHECK: shufflevector <4 x float> [[ADD]], <4 x float> [[SUB]], <4 x i32> <i32 0, i32 5, i32 2, i32 7>
@@ -3322,7 +3321,7 @@
__m256 test_mm256_mask_fmaddsub_ps(__m256 __A, __mmask8 __U, __m256 __B, __m256 __C) {
// CHECK-LABEL: @test_mm256_mask_fmaddsub_ps
// CHECK: [[ADD:%.+]] = call <8 x float> @llvm.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}})
- // CHECK: [[NEG:%.+]] = fsub <8 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <8 x float> %{{.*}}
// CHECK: [[SUB:%.+]] = call <8 x float> @llvm.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> [[NEG]]
// CHECK: shufflevector <8 x float> [[SUB]], <8 x float> [[ADD]], <8 x i32> <i32 0, i32 9, i32 2, i32 11, i32 4, i32 13, i32 6, i32 15>
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
@@ -3332,7 +3331,7 @@
__m256 test_mm256_mask_fmsubadd_ps(__m256 __A, __mmask8 __U, __m256 __B, __m256 __C) {
// CHECK-LABEL: @test_mm256_mask_fmsubadd_ps
- // CHECK: [[NEG:%.+]] = fsub <8 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <8 x float> %{{.*}}
// CHECK: [[SUB:%.+]] = call <8 x float> @llvm.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> [[NEG]]
// CHECK: [[ADD:%.+]] = call <8 x float> @llvm.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}})
// CHECK: shufflevector <8 x float> [[ADD]], <8 x float> [[SUB]], <8 x i32> <i32 0, i32 9, i32 2, i32 11, i32 4, i32 13, i32 6, i32 15>
@@ -3344,7 +3343,7 @@
__m256 test_mm256_mask3_fmaddsub_ps(__m256 __A, __m256 __B, __m256 __C, __mmask8 __U) {
// CHECK-LABEL: @test_mm256_mask3_fmaddsub_ps
// CHECK: [[ADD:%.+]] = call <8 x float> @llvm.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}})
- // CHECK: [[NEG:%.+]] = fsub <8 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <8 x float> %{{.*}}
// CHECK: [[SUB:%.+]] = call <8 x float> @llvm.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> [[NEG]]
// CHECK: shufflevector <8 x float> [[SUB]], <8 x float> [[ADD]], <8 x i32> <i32 0, i32 9, i32 2, i32 11, i32 4, i32 13, i32 6, i32 15>
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
@@ -3355,7 +3354,7 @@
__m256 test_mm256_maskz_fmaddsub_ps(__mmask8 __U, __m256 __A, __m256 __B, __m256 __C) {
// CHECK-LABEL: @test_mm256_maskz_fmaddsub_ps
// CHECK: [[ADD:%.+]] = call <8 x float> @llvm.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}})
- // CHECK: [[NEG:%.+]] = fsub <8 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <8 x float> %{{.*}}
// CHECK: [[SUB:%.+]] = call <8 x float> @llvm.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> [[NEG]]
// CHECK: shufflevector <8 x float> [[SUB]], <8 x float> [[ADD]], <8 x i32> <i32 0, i32 9, i32 2, i32 11, i32 4, i32 13, i32 6, i32 15>
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
@@ -3365,7 +3364,7 @@
__m256 test_mm256_maskz_fmsubadd_ps(__mmask8 __U, __m256 __A, __m256 __B, __m256 __C) {
// CHECK-LABEL: @test_mm256_maskz_fmsubadd_ps
- // CHECK: [[NEG:%.+]] = fsub <8 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <8 x float> %{{.*}}
// CHECK: [[SUB:%.+]] = call <8 x float> @llvm.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> [[NEG]]
// CHECK: [[ADD:%.+]] = call <8 x float> @llvm.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}})
// CHECK: shufflevector <8 x float> [[ADD]], <8 x float> [[SUB]], <8 x i32> <i32 0, i32 9, i32 2, i32 11, i32 4, i32 13, i32 6, i32 15>
@@ -3376,7 +3375,7 @@
__m128d test_mm_mask3_fmsub_pd(__m128d __A, __m128d __B, __m128d __C, __mmask8 __U) {
// CHECK-LABEL: @test_mm_mask3_fmsub_pd
- // CHECK: fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <2 x double> %{{.*}}
// CHECK: call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: shufflevector <8 x i1> %{{.*}}, <8 x i1> %{{.*}}, <2 x i32> <i32 0, i32 1>
@@ -3386,7 +3385,7 @@
__m256d test_mm256_mask3_fmsub_pd(__m256d __A, __m256d __B, __m256d __C, __mmask8 __U) {
// CHECK-LABEL: @test_mm256_mask3_fmsub_pd
- // CHECK: fsub <4 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <4 x double> %{{.*}}
// CHECK: call <4 x double> @llvm.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: shufflevector <8 x i1> %{{.*}}, <8 x i1> %{{.*}}, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
@@ -3396,7 +3395,7 @@
__m128 test_mm_mask3_fmsub_ps(__m128 __A, __m128 __B, __m128 __C, __mmask8 __U) {
// CHECK-LABEL: @test_mm_mask3_fmsub_ps
- // CHECK: fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <4 x float> %{{.*}}
// CHECK: call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: shufflevector <8 x i1> %{{.*}}, <8 x i1> %{{.*}}, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
@@ -3406,7 +3405,7 @@
__m256 test_mm256_mask3_fmsub_ps(__m256 __A, __m256 __B, __m256 __C, __mmask8 __U) {
// CHECK-LABEL: @test_mm256_mask3_fmsub_ps
- // CHECK: fsub <8 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <8 x float> %{{.*}}
// CHECK: call <8 x float> @llvm.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: select <8 x i1> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}}
@@ -3415,7 +3414,7 @@
__m128d test_mm_mask3_fmsubadd_pd(__m128d __A, __m128d __B, __m128d __C, __mmask8 __U) {
// CHECK-LABEL: @test_mm_mask3_fmsubadd_pd
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> %{{.+}}
// CHECK: [[SUB:%.+]] = call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> [[NEG]]
// CHECK: [[ADD:%.+]] = call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}})
// CHECK: shufflevector <2 x double> [[ADD]], <2 x double> [[SUB]], <2 x i32> <i32 0, i32 3>
@@ -3427,7 +3426,7 @@
__m256d test_mm256_mask3_fmsubadd_pd(__m256d __A, __m256d __B, __m256d __C, __mmask8 __U) {
// CHECK-LABEL: @test_mm256_mask3_fmsubadd_pd
- // CHECK: [[NEG:%.+]] = fsub <4 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x double> %{{.+}}
// CHECK: [[SUB:%.+]] = call <4 x double> @llvm.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> [[NEG]]
// CHECK: [[ADD:%.+]] = call <4 x double> @llvm.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}})
// CHECK: shufflevector <4 x double> [[ADD]], <4 x double> [[SUB]], <4 x i32> <i32 0, i32 5, i32 2, i32 7>
@@ -3439,7 +3438,7 @@
__m128 test_mm_mask3_fmsubadd_ps(__m128 __A, __m128 __B, __m128 __C, __mmask8 __U) {
// CHECK-LABEL: @test_mm_mask3_fmsubadd_ps
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> %{{.+}}
// CHECK: [[SUB:%.+]] = call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> [[NEG]]
// CHECK: [[ADD:%.+]] = call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
// CHECK: shufflevector <4 x float> [[ADD]], <4 x float> [[SUB]], <4 x i32> <i32 0, i32 5, i32 2, i32 7>
@@ -3451,7 +3450,7 @@
__m256 test_mm256_mask3_fmsubadd_ps(__m256 __A, __m256 __B, __m256 __C, __mmask8 __U) {
// CHECK-LABEL: @test_mm256_mask3_fmsubadd_ps
- // CHECK: [[NEG:%.+]] = fsub <8 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <8 x float> %{{.*}}
// CHECK: [[SUB:%.+]] = call <8 x float> @llvm.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> [[NEG]]
// CHECK: [[ADD:%.+]] = call <8 x float> @llvm.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}})
// CHECK: shufflevector <8 x float> [[ADD]], <8 x float> [[SUB]], <8 x i32> <i32 0, i32 9, i32 2, i32 11, i32 4, i32 13, i32 6, i32 15>
@@ -3462,7 +3461,7 @@
__m128d test_mm_mask_fnmadd_pd(__m128d __A, __mmask8 __U, __m128d __B, __m128d __C) {
// CHECK-LABEL: @test_mm_mask_fnmadd_pd
- // CHECK: fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <2 x double> %{{.*}}
// CHECK: call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: shufflevector <8 x i1> %{{.*}}, <8 x i1> %{{.*}}, <2 x i32> <i32 0, i32 1>
@@ -3472,7 +3471,7 @@
__m256d test_mm256_mask_fnmadd_pd(__m256d __A, __mmask8 __U, __m256d __B, __m256d __C) {
// CHECK-LABEL: @test_mm256_mask_fnmadd_pd
- // CHECK: fsub <4 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <4 x double> %{{.*}}
// CHECK: call <4 x double> @llvm.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: shufflevector <8 x i1> %{{.*}}, <8 x i1> %{{.*}}, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
@@ -3482,7 +3481,7 @@
__m128 test_mm_mask_fnmadd_ps(__m128 __A, __mmask8 __U, __m128 __B, __m128 __C) {
// CHECK-LABEL: @test_mm_mask_fnmadd_ps
- // CHECK: fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <4 x float> %{{.*}}
// CHECK: call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: shufflevector <8 x i1> %{{.*}}, <8 x i1> %{{.*}}, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
@@ -3492,7 +3491,7 @@
__m256 test_mm256_mask_fnmadd_ps(__m256 __A, __mmask8 __U, __m256 __B, __m256 __C) {
// CHECK-LABEL: @test_mm256_mask_fnmadd_ps
- // CHECK: fsub <8 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <8 x float> %{{.*}}
// CHECK: call <8 x float> @llvm.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: select <8 x i1> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}}
@@ -3501,8 +3500,8 @@
__m128d test_mm_mask_fnmsub_pd(__m128d __A, __mmask8 __U, __m128d __B, __m128d __C) {
// CHECK-LABEL: @test_mm_mask_fnmsub_pd
- // CHECK: fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.*}}
- // CHECK: fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <2 x double> %{{.*}}
+ // CHECK: fneg <2 x double> %{{.*}}
// CHECK: call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: shufflevector <8 x i1> %{{.*}}, <8 x i1> %{{.*}}, <2 x i32> <i32 0, i32 1>
@@ -3512,8 +3511,8 @@
__m128d test_mm_mask3_fnmsub_pd(__m128d __A, __m128d __B, __m128d __C, __mmask8 __U) {
// CHECK-LABEL: @test_mm_mask3_fnmsub_pd
- // CHECK: fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.*}}
- // CHECK: fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <2 x double> %{{.*}}
+ // CHECK: fneg <2 x double> %{{.*}}
// CHECK: call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: shufflevector <8 x i1> %{{.*}}, <8 x i1> %{{.*}}, <2 x i32> <i32 0, i32 1>
@@ -3523,8 +3522,8 @@
__m256d test_mm256_mask_fnmsub_pd(__m256d __A, __mmask8 __U, __m256d __B, __m256d __C) {
// CHECK-LABEL: @test_mm256_mask_fnmsub_pd
- // CHECK: fsub <4 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.*}}
- // CHECK: fsub <4 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <4 x double> %{{.*}}
+ // CHECK: fneg <4 x double> %{{.*}}
// CHECK: call <4 x double> @llvm.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: shufflevector <8 x i1> %{{.*}}, <8 x i1> %{{.*}}, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
@@ -3534,8 +3533,8 @@
__m256d test_mm256_mask3_fnmsub_pd(__m256d __A, __m256d __B, __m256d __C, __mmask8 __U) {
// CHECK-LABEL: @test_mm256_mask3_fnmsub_pd
- // CHECK: fsub <4 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.*}}
- // CHECK: fsub <4 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <4 x double> %{{.*}}
+ // CHECK: fneg <4 x double> %{{.*}}
// CHECK: call <4 x double> @llvm.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: shufflevector <8 x i1> %{{.*}}, <8 x i1> %{{.*}}, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
@@ -3545,8 +3544,8 @@
__m128 test_mm_mask_fnmsub_ps(__m128 __A, __mmask8 __U, __m128 __B, __m128 __C) {
// CHECK-LABEL: @test_mm_mask_fnmsub_ps
- // CHECK: fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
- // CHECK: fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <4 x float> %{{.*}}
+ // CHECK: fneg <4 x float> %{{.*}}
// CHECK: call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: shufflevector <8 x i1> %{{.*}}, <8 x i1> %{{.*}}, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
@@ -3556,8 +3555,8 @@
__m128 test_mm_mask3_fnmsub_ps(__m128 __A, __m128 __B, __m128 __C, __mmask8 __U) {
// CHECK-LABEL: @test_mm_mask3_fnmsub_ps
- // CHECK: fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
- // CHECK: fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <4 x float> %{{.*}}
+ // CHECK: fneg <4 x float> %{{.*}}
// CHECK: call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: shufflevector <8 x i1> %{{.*}}, <8 x i1> %{{.*}}, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
@@ -3567,8 +3566,8 @@
__m256 test_mm256_mask_fnmsub_ps(__m256 __A, __mmask8 __U, __m256 __B, __m256 __C) {
// CHECK-LABEL: @test_mm256_mask_fnmsub_ps
- // CHECK: fsub <8 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
- // CHECK: fsub <8 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <8 x float> %{{.*}}
+ // CHECK: fneg <8 x float> %{{.*}}
// CHECK: call <8 x float> @llvm.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: select <8 x i1> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}}
@@ -3577,8 +3576,8 @@
__m256 test_mm256_mask3_fnmsub_ps(__m256 __A, __m256 __B, __m256 __C, __mmask8 __U) {
// CHECK-LABEL: @test_mm256_mask3_fnmsub_ps
- // CHECK: fsub <8 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
- // CHECK: fsub <8 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: fneg <8 x float> %{{.*}}
+ // CHECK: fneg <8 x float> %{{.*}}
// CHECK: call <8 x float> @llvm.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}})
// CHECK: bitcast i8 %{{.*}} to <8 x i1>
// CHECK: select <8 x i1> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}}
@@ -4589,6 +4588,8 @@
// CHECK: [[SUB:%.*]] = sub <4 x i32> zeroinitializer, [[A:%.*]]
// CHECK: [[CMP:%.*]] = icmp sgt <4 x i32> [[A]], zeroinitializer
// CHECK: [[SEL:%.*]] = select <4 x i1> [[CMP]], <4 x i32> [[A]], <4 x i32> [[SUB]]
+ // CHECK: [[TMP:%.*]] = bitcast <4 x i32> [[SEL]] to <2 x i64>
+ // CHECK: [[SEL:%.*]] = bitcast <2 x i64> [[TMP]] to <4 x i32>
// CHECK: select <4 x i1> %{{.*}}, <4 x i32> [[SEL]], <4 x i32> %{{.*}}
return _mm_mask_abs_epi32(__W,__U,__A);
}
@@ -4597,6 +4598,8 @@
// CHECK: [[SUB:%.*]] = sub <4 x i32> zeroinitializer, [[A:%.*]]
// CHECK: [[CMP:%.*]] = icmp sgt <4 x i32> [[A]], zeroinitializer
// CHECK: [[SEL:%.*]] = select <4 x i1> [[CMP]], <4 x i32> [[A]], <4 x i32> [[SUB]]
+ // CHECK: [[TMP:%.*]] = bitcast <4 x i32> [[SEL]] to <2 x i64>
+ // CHECK: [[SEL:%.*]] = bitcast <2 x i64> [[TMP]] to <4 x i32>
// CHECK: select <4 x i1> %{{.*}}, <4 x i32> [[SEL]], <4 x i32> %{{.*}}
return _mm_maskz_abs_epi32(__U,__A);
}
@@ -4605,6 +4608,8 @@
// CHECK: [[SUB:%.*]] = sub <8 x i32> zeroinitializer, [[A:%.*]]
// CHECK: [[CMP:%.*]] = icmp sgt <8 x i32> [[A]], zeroinitializer
// CHECK: [[SEL:%.*]] = select <8 x i1> [[CMP]], <8 x i32> [[A]], <8 x i32> [[SUB]]
+ // CHECK: [[TMP:%.*]] = bitcast <8 x i32> [[SEL]] to <4 x i64>
+ // CHECK: [[SEL:%.*]] = bitcast <4 x i64> [[TMP]] to <8 x i32>
// CHECK: select <8 x i1> %{{.*}}, <8 x i32> [[SEL]], <8 x i32> %{{.*}}
return _mm256_mask_abs_epi32(__W,__U,__A);
}
@@ -4613,6 +4618,8 @@
// CHECK: [[SUB:%.*]] = sub <8 x i32> zeroinitializer, [[A:%.*]]
// CHECK: [[CMP:%.*]] = icmp sgt <8 x i32> [[A]], zeroinitializer
// CHECK: [[SEL:%.*]] = select <8 x i1> [[CMP]], <8 x i32> [[A]], <8 x i32> [[SUB]]
+ // CHECK: [[TMP:%.*]] = bitcast <8 x i32> [[SEL]] to <4 x i64>
+ // CHECK: [[SEL:%.*]] = bitcast <4 x i64> [[TMP]] to <8 x i32>
// CHECK: select <8 x i1> %{{.*}}, <8 x i32> [[SEL]], <8 x i32> %{{.*}}
return _mm256_maskz_abs_epi32(__U,__A);
}
@@ -4668,6 +4675,8 @@
// CHECK-LABEL: @test_mm_maskz_max_epi32
// CHECK: [[CMP:%.*]] = icmp sgt <4 x i32> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <4 x i1> [[CMP]], <4 x i32> [[X]], <4 x i32> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast <4 x i32> [[RES]] to <2 x i64>
+ // CHECK: [[RES:%.*]] = bitcast <2 x i64> [[TMP]] to <4 x i32>
// CHECK: select <4 x i1> {{.*}}, <4 x i32> [[RES]], <4 x i32> {{.*}}
return _mm_maskz_max_epi32(__M,__A,__B);
}
@@ -4675,6 +4684,8 @@
// CHECK-LABEL: @test_mm_mask_max_epi32
// CHECK: [[CMP:%.*]] = icmp sgt <4 x i32> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <4 x i1> [[CMP]], <4 x i32> [[X]], <4 x i32> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast <4 x i32> [[RES]] to <2 x i64>
+ // CHECK: [[RES:%.*]] = bitcast <2 x i64> [[TMP]] to <4 x i32>
// CHECK: select <4 x i1> {{.*}}, <4 x i32> [[RES]], <4 x i32> {{.*}}
return _mm_mask_max_epi32(__W,__M,__A,__B);
}
@@ -4682,6 +4693,8 @@
// CHECK-LABEL: @test_mm256_maskz_max_epi32
// CHECK: [[CMP:%.*]] = icmp sgt <8 x i32> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <8 x i1> [[CMP]], <8 x i32> [[X]], <8 x i32> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast <8 x i32> [[RES]] to <4 x i64>
+ // CHECK: [[RES:%.*]] = bitcast <4 x i64> [[TMP]] to <8 x i32>
// CHECK: select <8 x i1> {{.*}}, <8 x i32> [[RES]], <8 x i32> {{.*}}
return _mm256_maskz_max_epi32(__M,__A,__B);
}
@@ -4689,6 +4702,8 @@
// CHECK-LABEL: @test_mm256_mask_max_epi32
// CHECK: [[CMP:%.*]] = icmp sgt <8 x i32> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <8 x i1> [[CMP]], <8 x i32> [[X]], <8 x i32> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast <8 x i32> [[RES]] to <4 x i64>
+ // CHECK: [[RES:%.*]] = bitcast <4 x i64> [[TMP]] to <8 x i32>
// CHECK: select <8 x i1> {{.*}}, <8 x i32> [[RES]], <8 x i32> {{.*}}
return _mm256_mask_max_epi32(__W,__M,__A,__B);
}
@@ -4736,6 +4751,8 @@
// CHECK-LABEL: @test_mm_maskz_max_epu32
// CHECK: [[CMP:%.*]] = icmp ugt <4 x i32> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <4 x i1> [[CMP]], <4 x i32> [[X]], <4 x i32> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast <4 x i32> [[RES]] to <2 x i64>
+ // CHECK: [[RES:%.*]] = bitcast <2 x i64> [[TMP]] to <4 x i32>
// CHECK: select <4 x i1> {{.*}}, <4 x i32> [[RES]], <4 x i32> {{.*}}
return _mm_maskz_max_epu32(__M,__A,__B);
}
@@ -4743,6 +4760,8 @@
// CHECK-LABEL: @test_mm_mask_max_epu32
// CHECK: [[CMP:%.*]] = icmp ugt <4 x i32> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <4 x i1> [[CMP]], <4 x i32> [[X]], <4 x i32> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast <4 x i32> [[RES]] to <2 x i64>
+ // CHECK: [[RES:%.*]] = bitcast <2 x i64> [[TMP]] to <4 x i32>
// CHECK: select <4 x i1> {{.*}}, <4 x i32> [[RES]], <4 x i32> {{.*}}
return _mm_mask_max_epu32(__W,__M,__A,__B);
}
@@ -4750,6 +4769,8 @@
// CHECK-LABEL: @test_mm256_maskz_max_epu32
// CHECK: [[CMP:%.*]] = icmp ugt <8 x i32> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <8 x i1> [[CMP]], <8 x i32> [[X]], <8 x i32> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast <8 x i32> [[RES]] to <4 x i64>
+ // CHECK: [[RES:%.*]] = bitcast <4 x i64> [[TMP]] to <8 x i32>
// CHECK: select <8 x i1> {{.*}}, <8 x i32> [[RES]], <8 x i32> {{.*}}
return _mm256_maskz_max_epu32(__M,__A,__B);
}
@@ -4757,6 +4778,8 @@
// CHECK-LABEL: @test_mm256_mask_max_epu32
// CHECK: [[CMP:%.*]] = icmp ugt <8 x i32> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <8 x i1> [[CMP]], <8 x i32> [[X]], <8 x i32> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast <8 x i32> [[RES]] to <4 x i64>
+ // CHECK: [[RES:%.*]] = bitcast <4 x i64> [[TMP]] to <8 x i32>
// CHECK: select <8 x i1> {{.*}}, <8 x i32> [[RES]], <8 x i32> {{.*}}
return _mm256_mask_max_epu32(__W,__M,__A,__B);
}
@@ -4804,6 +4827,8 @@
// CHECK-LABEL: @test_mm_maskz_min_epi32
// CHECK: [[CMP:%.*]] = icmp slt <4 x i32> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <4 x i1> [[CMP]], <4 x i32> [[X]], <4 x i32> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast <4 x i32> [[RES]] to <2 x i64>
+ // CHECK: [[RES:%.*]] = bitcast <2 x i64> [[TMP]] to <4 x i32>
// CHECK: select <4 x i1> {{.*}}, <4 x i32> [[RES]], <4 x i32> {{.*}}
return _mm_maskz_min_epi32(__M,__A,__B);
}
@@ -4811,6 +4836,8 @@
// CHECK-LABEL: @test_mm_mask_min_epi32
// CHECK: [[CMP:%.*]] = icmp slt <4 x i32> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <4 x i1> [[CMP]], <4 x i32> [[X]], <4 x i32> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast <4 x i32> [[RES]] to <2 x i64>
+ // CHECK: [[RES:%.*]] = bitcast <2 x i64> [[TMP]] to <4 x i32>
// CHECK: select <4 x i1> {{.*}}, <4 x i32> [[RES]], <4 x i32> {{.*}}
return _mm_mask_min_epi32(__W,__M,__A,__B);
}
@@ -4818,6 +4845,8 @@
// CHECK-LABEL: @test_mm256_maskz_min_epi32
// CHECK: [[CMP:%.*]] = icmp slt <8 x i32> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <8 x i1> [[CMP]], <8 x i32> [[X]], <8 x i32> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast <8 x i32> [[RES]] to <4 x i64>
+ // CHECK: [[RES:%.*]] = bitcast <4 x i64> [[TMP]] to <8 x i32>
// CHECK: select <8 x i1> {{.*}}, <8 x i32> [[RES]], <8 x i32> {{.*}}
return _mm256_maskz_min_epi32(__M,__A,__B);
}
@@ -4825,6 +4854,8 @@
// CHECK-LABEL: @test_mm256_mask_min_epi32
// CHECK: [[CMP:%.*]] = icmp slt <8 x i32> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <8 x i1> [[CMP]], <8 x i32> [[X]], <8 x i32> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast <8 x i32> [[RES]] to <4 x i64>
+ // CHECK: [[RES:%.*]] = bitcast <4 x i64> [[TMP]] to <8 x i32>
// CHECK: select <8 x i1> {{.*}}, <8 x i32> [[RES]], <8 x i32> {{.*}}
return _mm256_mask_min_epi32(__W,__M,__A,__B);
}
@@ -4872,6 +4903,8 @@
// CHECK-LABEL: @test_mm_maskz_min_epu32
// CHECK: [[CMP:%.*]] = icmp ult <4 x i32> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <4 x i1> [[CMP]], <4 x i32> [[X]], <4 x i32> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast <4 x i32> [[RES]] to <2 x i64>
+ // CHECK: [[RES:%.*]] = bitcast <2 x i64> [[TMP]] to <4 x i32>
// CHECK: select <4 x i1> {{.*}}, <4 x i32> [[RES]], <4 x i32> {{.*}}
return _mm_maskz_min_epu32(__M,__A,__B);
}
@@ -4879,6 +4912,8 @@
// CHECK-LABEL: @test_mm_mask_min_epu32
// CHECK: [[CMP:%.*]] = icmp ult <4 x i32> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <4 x i1> [[CMP]], <4 x i32> [[X]], <4 x i32> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast <4 x i32> [[RES]] to <2 x i64>
+ // CHECK: [[RES:%.*]] = bitcast <2 x i64> [[TMP]] to <4 x i32>
// CHECK: select <4 x i1> {{.*}}, <4 x i32> [[RES]], <4 x i32> {{.*}}
return _mm_mask_min_epu32(__W,__M,__A,__B);
}
@@ -4886,6 +4921,8 @@
// CHECK-LABEL: @test_mm256_maskz_min_epu32
// CHECK: [[CMP:%.*]] = icmp ult <8 x i32> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <8 x i1> [[CMP]], <8 x i32> [[X]], <8 x i32> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast <8 x i32> [[RES]] to <4 x i64>
+ // CHECK: [[RES:%.*]] = bitcast <4 x i64> [[TMP]] to <8 x i32>
// CHECK: select <8 x i1> {{.*}}, <8 x i32> [[RES]], <8 x i32> {{.*}}
return _mm256_maskz_min_epu32(__M,__A,__B);
}
@@ -4893,6 +4930,8 @@
// CHECK-LABEL: @test_mm256_mask_min_epu32
// CHECK: [[CMP:%.*]] = icmp ult <8 x i32> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <8 x i1> [[CMP]], <8 x i32> [[X]], <8 x i32> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast <8 x i32> [[RES]] to <4 x i64>
+ // CHECK: [[RES:%.*]] = bitcast <4 x i64> [[TMP]] to <8 x i32>
// CHECK: select <8 x i1> {{.*}}, <8 x i32> [[RES]], <8 x i32> {{.*}}
return _mm256_mask_min_epu32(__W,__M,__A,__B);
}
diff --git a/src/llvm-project/clang/test/CodeGen/avx512vlbw-builtins.c b/src/llvm-project/clang/test/CodeGen/avx512vlbw-builtins.c
index 1d85384..7083a53 100644
--- a/src/llvm-project/clang/test/CodeGen/avx512vlbw-builtins.c
+++ b/src/llvm-project/clang/test/CodeGen/avx512vlbw-builtins.c
@@ -1,6 +1,5 @@
-// RUN: %clang_cc1 -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx512bw -target-feature +avx512vl -emit-llvm -o - -Wall -Werror | FileCheck %s
-// RUN: %clang_cc1 -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx512bw -target-feature +avx512vl -fno-signed-char -emit-llvm -o - -Wall -Werror | FileCheck %s
-
+// RUN: %clang_cc1 -ffreestanding %s -fexperimental-new-pass-manager -triple=x86_64-apple-darwin -target-feature +avx512bw -target-feature +avx512vl -emit-llvm -o - -Wall -Werror | FileCheck %s
+// RUN: %clang_cc1 -ffreestanding %s -fexperimental-new-pass-manager -triple=x86_64-apple-darwin -target-feature +avx512bw -target-feature +avx512vl -fno-signed-char -emit-llvm -o - -Wall -Werror | FileCheck %s
#include <immintrin.h>
@@ -901,6 +900,8 @@
// CHECK: [[SUB:%.*]] = sub <16 x i8> zeroinitializer, [[A:%.*]]
// CHECK: [[CMP:%.*]] = icmp sgt <16 x i8> [[A]], zeroinitializer
// CHECK: [[SEL:%.*]] = select <16 x i1> [[CMP]], <16 x i8> [[A]], <16 x i8> [[SUB]]
+ // CHECK: [[TMP:%.*]] = bitcast [[SRCTY:<16 x i8>]] [[SEL]] to [[DSTTY:<2 x i64>]]
+ // CHECK: [[SEL:%.*]] = bitcast [[DSTTY]] [[TMP]] to [[SRCTY]]
// CHECK: select <16 x i1> %{{.*}}, <16 x i8> [[SEL]], <16 x i8> %{{.*}}
return _mm_mask_abs_epi8(__W,__U,__A);
}
@@ -910,6 +911,8 @@
// CHECK: [[SUB:%.*]] = sub <16 x i8> zeroinitializer, [[A:%.*]]
// CHECK: [[CMP:%.*]] = icmp sgt <16 x i8> [[A]], zeroinitializer
// CHECK: [[SEL:%.*]] = select <16 x i1> [[CMP]], <16 x i8> [[A]], <16 x i8> [[SUB]]
+ // CHECK: [[TMP:%.*]] = bitcast [[SRCTY:<16 x i8>]] [[SEL]] to [[DSTTY:<2 x i64>]]
+ // CHECK: [[SEL:%.*]] = bitcast [[DSTTY]] [[TMP]] to [[SRCTY]]
// CHECK: select <16 x i1> %{{.*}}, <16 x i8> [[SEL]], <16 x i8> %{{.*}}
return _mm_maskz_abs_epi8(__U,__A);
}
@@ -919,6 +922,8 @@
// CHECK: [[SUB:%.*]] = sub <32 x i8> zeroinitializer, [[A:%.*]]
// CHECK: [[CMP:%.*]] = icmp sgt <32 x i8> [[A]], zeroinitializer
// CHECK: [[SEL:%.*]] = select <32 x i1> [[CMP]], <32 x i8> [[A]], <32 x i8> [[SUB]]
+ // CHECK: [[TMP:%.*]] = bitcast [[SRCTY:<32 x i8>]] [[SEL]] to [[DSTTY:<4 x i64>]]
+ // CHECK: [[SEL:%.*]] = bitcast [[DSTTY]] [[TMP]] to [[SRCTY]]
// CHECK: select <32 x i1> %{{.*}}, <32 x i8> [[SEL]], <32 x i8> %{{.*}}
return _mm256_mask_abs_epi8(__W,__U,__A);
}
@@ -928,6 +933,8 @@
// CHECK: [[SUB:%.*]] = sub <32 x i8> zeroinitializer, [[A:%.*]]
// CHECK: [[CMP:%.*]] = icmp sgt <32 x i8> [[A]], zeroinitializer
// CHECK: [[SEL:%.*]] = select <32 x i1> [[CMP]], <32 x i8> [[A]], <32 x i8> [[SUB]]
+ // CHECK: [[TMP:%.*]] = bitcast [[SRCTY:<32 x i8>]] [[SEL]] to [[DSTTY:<4 x i64>]]
+ // CHECK: [[SEL:%.*]] = bitcast [[DSTTY]] [[TMP]] to [[SRCTY]]
// CHECK: select <32 x i1> %{{.*}}, <32 x i8> [[SEL]], <32 x i8> %{{.*}}
return _mm256_maskz_abs_epi8(__U,__A);
}
@@ -937,6 +944,8 @@
// CHECK: [[SUB:%.*]] = sub <8 x i16> zeroinitializer, [[A:%.*]]
// CHECK: [[CMP:%.*]] = icmp sgt <8 x i16> [[A]], zeroinitializer
// CHECK: [[SEL:%.*]] = select <8 x i1> [[CMP]], <8 x i16> [[A]], <8 x i16> [[SUB]]
+ // CHECK: [[TMP:%.*]] = bitcast [[SRCTY:<8 x i16>]] [[SEL]] to [[DSTTY:<2 x i64>]]
+ // CHECK: [[SEL:%.*]] = bitcast [[DSTTY]] [[TMP]] to [[SRCTY]]
// CHECK: select <8 x i1> %{{.*}}, <8 x i16> [[SEL]], <8 x i16> %{{.*}}
return _mm_mask_abs_epi16(__W,__U,__A);
}
@@ -946,6 +955,8 @@
// CHECK: [[SUB:%.*]] = sub <8 x i16> zeroinitializer, [[A:%.*]]
// CHECK: [[CMP:%.*]] = icmp sgt <8 x i16> [[A]], zeroinitializer
// CHECK: [[SEL:%.*]] = select <8 x i1> [[CMP]], <8 x i16> [[A]], <8 x i16> [[SUB]]
+ // CHECK: [[TMP:%.*]] = bitcast [[SRCTY:<8 x i16>]] [[SEL]] to [[DSTTY:<2 x i64>]]
+ // CHECK: [[SEL:%.*]] = bitcast [[DSTTY]] [[TMP]] to [[SRCTY]]
// CHECK: select <8 x i1> %{{.*}}, <8 x i16> [[SEL]], <8 x i16> %{{.*}}
return _mm_maskz_abs_epi16(__U,__A);
}
@@ -955,6 +966,8 @@
// CHECK: [[SUB:%.*]] = sub <16 x i16> zeroinitializer, [[A:%.*]]
// CHECK: [[CMP:%.*]] = icmp sgt <16 x i16> [[A]], zeroinitializer
// CHECK: [[SEL:%.*]] = select <16 x i1> [[CMP]], <16 x i16> [[A]], <16 x i16> [[SUB]]
+ // CHECK: [[TMP:%.*]] = bitcast [[SRCTY:<16 x i16>]] [[SEL]] to [[DSTTY:<4 x i64>]]
+ // CHECK: [[SEL:%.*]] = bitcast [[DSTTY]] [[TMP]] to [[SRCTY]]
// CHECK: select <16 x i1> %{{.*}}, <16 x i16> [[SEL]], <16 x i16> %{{.*}}
return _mm256_mask_abs_epi16(__W,__U,__A);
}
@@ -964,6 +977,8 @@
// CHECK: [[SUB:%.*]] = sub <16 x i16> zeroinitializer, [[A:%.*]]
// CHECK: [[CMP:%.*]] = icmp sgt <16 x i16> [[A]], zeroinitializer
// CHECK: [[SEL:%.*]] = select <16 x i1> [[CMP]], <16 x i16> [[A]], <16 x i16> [[SUB]]
+ // CHECK: [[TMP:%.*]] = bitcast [[SRCTY:<16 x i16>]] [[SEL]] to [[DSTTY:<4 x i64>]]
+ // CHECK: [[SEL:%.*]] = bitcast [[DSTTY]] [[TMP]] to [[SRCTY]]
// CHECK: select <16 x i1> %{{.*}}, <16 x i16> [[SEL]], <16 x i16> %{{.*}}
return _mm256_maskz_abs_epi16(__U,__A);
}
@@ -1229,6 +1244,8 @@
// CHECK-LABEL: @test_mm_maskz_max_epi8
// CHECK: [[CMP:%.*]] = icmp sgt <16 x i8> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <16 x i1> [[CMP]], <16 x i8> [[X]], <16 x i8> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast [[SRCTY:<16 x i8>]] [[RES]] to [[DSTTY:<2 x i64>]]
+ // CHECK: [[RES:%.*]] = bitcast [[DSTTY]] [[TMP]] to [[SRCTY]]
// CHECK: select <16 x i1> {{.*}}, <16 x i8> [[RES]], <16 x i8> {{.*}}
return _mm_maskz_max_epi8(__M,__A,__B);
}
@@ -1236,6 +1253,8 @@
// CHECK-LABEL: @test_mm_mask_max_epi8
// CHECK: [[CMP:%.*]] = icmp sgt <16 x i8> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <16 x i1> [[CMP]], <16 x i8> [[X]], <16 x i8> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast [[SRCTY:<16 x i8>]] [[RES]] to [[DSTTY:<2 x i64>]]
+ // CHECK: [[RES:%.*]] = bitcast [[DSTTY]] [[TMP]] to [[SRCTY]]
// CHECK: select <16 x i1> {{.*}}, <16 x i8> [[RES]], <16 x i8> {{.*}}
return _mm_mask_max_epi8(__W,__M,__A,__B);
}
@@ -1243,6 +1262,8 @@
// CHECK-LABEL: @test_mm256_maskz_max_epi8
// CHECK: [[CMP:%.*]] = icmp sgt <32 x i8> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <32 x i1> [[CMP]], <32 x i8> [[X]], <32 x i8> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast [[SRCTY:<32 x i8>]] [[RES]] to [[DSTTY:<4 x i64>]]
+ // CHECK: [[RES:%.*]] = bitcast [[DSTTY]] [[TMP]] to [[SRCTY]]
// CHECK: select <32 x i1> {{.*}}, <32 x i8> [[RES]], <32 x i8> {{.*}}
return _mm256_maskz_max_epi8(__M,__A,__B);
}
@@ -1250,6 +1271,8 @@
// CHECK-LABEL: @test_mm256_mask_max_epi8
// CHECK: [[CMP:%.*]] = icmp sgt <32 x i8> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <32 x i1> [[CMP]], <32 x i8> [[X]], <32 x i8> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast [[SRCTY:<32 x i8>]] [[RES]] to [[DSTTY:<4 x i64>]]
+ // CHECK: [[RES:%.*]] = bitcast [[DSTTY]] [[TMP]] to [[SRCTY]]
// CHECK: select <32 x i1> {{.*}}, <32 x i8> [[RES]], <32 x i8> {{.*}}
return _mm256_mask_max_epi8(__W,__M,__A,__B);
}
@@ -1257,6 +1280,8 @@
// CHECK-LABEL: @test_mm_maskz_max_epi16
// CHECK: [[CMP:%.*]] = icmp sgt <8 x i16> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <8 x i1> [[CMP]], <8 x i16> [[X]], <8 x i16> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast [[SRCTY:<8 x i16>]] [[RES]] to [[DSTTY:<2 x i64>]]
+ // CHECK: [[RES:%.*]] = bitcast [[DSTTY]] [[TMP]] to [[SRCTY]]
// CHECK: select <8 x i1> {{.*}}, <8 x i16> [[RES]], <8 x i16> {{.*}}
return _mm_maskz_max_epi16(__M,__A,__B);
}
@@ -1264,6 +1289,8 @@
// CHECK-LABEL: @test_mm_mask_max_epi16
// CHECK: [[CMP:%.*]] = icmp sgt <8 x i16> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <8 x i1> [[CMP]], <8 x i16> [[X]], <8 x i16> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast [[SRCTY:<8 x i16>]] [[RES]] to [[DSTTY:<2 x i64>]]
+ // CHECK: [[RES:%.*]] = bitcast [[DSTTY]] [[TMP]] to [[SRCTY]]
// CHECK: select <8 x i1> {{.*}}, <8 x i16> [[RES]], <8 x i16> {{.*}}
return _mm_mask_max_epi16(__W,__M,__A,__B);
}
@@ -1271,6 +1298,8 @@
// CHECK-LABEL: @test_mm256_maskz_max_epi16
// CHECK: [[CMP:%.*]] = icmp sgt <16 x i16> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <16 x i1> [[CMP]], <16 x i16> [[X]], <16 x i16> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast [[SRCTY:<16 x i16>]] [[RES]] to [[DSTTY:<4 x i64>]]
+ // CHECK: [[RES:%.*]] = bitcast [[DSTTY]] [[TMP]] to [[SRCTY]]
// CHECK: select <16 x i1> {{.*}}, <16 x i16> [[RES]], <16 x i16> {{.*}}
return _mm256_maskz_max_epi16(__M,__A,__B);
}
@@ -1278,6 +1307,8 @@
// CHECK-LABEL: @test_mm256_mask_max_epi16
// CHECK: [[CMP:%.*]] = icmp sgt <16 x i16> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <16 x i1> [[CMP]], <16 x i16> [[X]], <16 x i16> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast [[SRCTY:<16 x i16>]] [[RES]] to [[DSTTY:<4 x i64>]]
+ // CHECK: [[RES:%.*]] = bitcast [[DSTTY]] [[TMP]] to [[SRCTY]]
// CHECK: select <16 x i1> {{.*}}, <16 x i16> [[RES]], <16 x i16> {{.*}}
return _mm256_mask_max_epi16(__W,__M,__A,__B);
}
@@ -1285,6 +1316,8 @@
// CHECK-LABEL: @test_mm_maskz_max_epu8
// CHECK: [[CMP:%.*]] = icmp ugt <16 x i8> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <16 x i1> [[CMP]], <16 x i8> [[X]], <16 x i8> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast [[SRCTY:<16 x i8>]] [[RES]] to [[DSTTY:<2 x i64>]]
+ // CHECK: [[RES:%.*]] = bitcast [[DSTTY]] [[TMP]] to [[SRCTY]]
// CHECK: select <16 x i1> {{.*}}, <16 x i8> [[RES]], <16 x i8> {{.*}}
return _mm_maskz_max_epu8(__M,__A,__B);
}
@@ -1292,6 +1325,8 @@
// CHECK-LABEL: @test_mm_mask_max_epu8
// CHECK: [[CMP:%.*]] = icmp ugt <16 x i8> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <16 x i1> [[CMP]], <16 x i8> [[X]], <16 x i8> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast [[SRCTY:<16 x i8>]] [[RES]] to [[DSTTY:<2 x i64>]]
+ // CHECK: [[RES:%.*]] = bitcast [[DSTTY]] [[TMP]] to [[SRCTY]]
// CHECK: select <16 x i1> {{.*}}, <16 x i8> [[RES]], <16 x i8> {{.*}}
return _mm_mask_max_epu8(__W,__M,__A,__B);
}
@@ -1299,6 +1334,8 @@
// CHECK-LABEL: @test_mm256_maskz_max_epu8
// CHECK: [[CMP:%.*]] = icmp ugt <32 x i8> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <32 x i1> [[CMP]], <32 x i8> [[X]], <32 x i8> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast [[SRCTY:<32 x i8>]] [[RES]] to [[DSTTY:<4 x i64>]]
+ // CHECK: [[RES:%.*]] = bitcast [[DSTTY]] [[TMP]] to [[SRCTY]]
// CHECK: select <32 x i1> {{.*}}, <32 x i8> [[RES]], <32 x i8> {{.*}}
return _mm256_maskz_max_epu8(__M,__A,__B);
}
@@ -1306,6 +1343,8 @@
// CHECK-LABEL: @test_mm256_mask_max_epu8
// CHECK: [[CMP:%.*]] = icmp ugt <32 x i8> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <32 x i1> [[CMP]], <32 x i8> [[X]], <32 x i8> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast [[SRCTY:<32 x i8>]] [[RES]] to [[DSTTY:<4 x i64>]]
+ // CHECK: [[RES:%.*]] = bitcast [[DSTTY]] [[TMP]] to [[SRCTY]]
// CHECK: select <32 x i1> {{.*}}, <32 x i8> [[RES]], <32 x i8> {{.*}}
return _mm256_mask_max_epu8(__W,__M,__A,__B);
}
@@ -1313,6 +1352,8 @@
// CHECK-LABEL: @test_mm_maskz_max_epu16
// CHECK: [[CMP:%.*]] = icmp ugt <8 x i16> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <8 x i1> [[CMP]], <8 x i16> [[X]], <8 x i16> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast [[SRCTY:<8 x i16>]] [[RES]] to [[DSTTY:<2 x i64>]]
+ // CHECK: [[RES:%.*]] = bitcast [[DSTTY]] [[TMP]] to [[SRCTY]]
// CHECK: select <8 x i1> {{.*}}, <8 x i16> [[RES]], <8 x i16> {{.*}}
return _mm_maskz_max_epu16(__M,__A,__B);
}
@@ -1320,6 +1361,8 @@
// CHECK-LABEL: @test_mm_mask_max_epu16
// CHECK: [[CMP:%.*]] = icmp ugt <8 x i16> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <8 x i1> [[CMP]], <8 x i16> [[X]], <8 x i16> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast [[SRCTY:<8 x i16>]] [[RES]] to [[DSTTY:<2 x i64>]]
+ // CHECK: [[RES:%.*]] = bitcast [[DSTTY]] [[TMP]] to [[SRCTY]]
// CHECK: select <8 x i1> {{.*}}, <8 x i16> [[RES]], <8 x i16> {{.*}}
return _mm_mask_max_epu16(__W,__M,__A,__B);
}
@@ -1327,6 +1370,8 @@
// CHECK-LABEL: @test_mm256_maskz_max_epu16
// CHECK: [[CMP:%.*]] = icmp ugt <16 x i16> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <16 x i1> [[CMP]], <16 x i16> [[X]], <16 x i16> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast [[SRCTY:<16 x i16>]] [[RES]] to [[DSTTY:<4 x i64>]]
+ // CHECK: [[RES:%.*]] = bitcast [[DSTTY]] [[TMP]] to [[SRCTY]]
// CHECK: select <16 x i1> {{.*}}, <16 x i16> [[RES]], <16 x i16> {{.*}}
return _mm256_maskz_max_epu16(__M,__A,__B);
}
@@ -1334,6 +1379,8 @@
// CHECK-LABEL: @test_mm256_mask_max_epu16
// CHECK: [[CMP:%.*]] = icmp ugt <16 x i16> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <16 x i1> [[CMP]], <16 x i16> [[X]], <16 x i16> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast [[SRCTY:<16 x i16>]] [[RES]] to [[DSTTY:<4 x i64>]]
+ // CHECK: [[RES:%.*]] = bitcast [[DSTTY]] [[TMP]] to [[SRCTY]]
// CHECK: select <16 x i1> {{.*}}, <16 x i16> [[RES]], <16 x i16> {{.*}}
return _mm256_mask_max_epu16(__W,__M,__A,__B);
}
@@ -1341,6 +1388,8 @@
// CHECK-LABEL: @test_mm_maskz_min_epi8
// CHECK: [[CMP:%.*]] = icmp slt <16 x i8> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <16 x i1> [[CMP]], <16 x i8> [[X]], <16 x i8> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast [[SRCTY:<16 x i8>]] [[RES]] to [[DSTTY:<2 x i64>]]
+ // CHECK: [[RES:%.*]] = bitcast [[DSTTY]] [[TMP]] to [[SRCTY]]
// CHECK: select <16 x i1> {{.*}}, <16 x i8> [[RES]], <16 x i8> {{.*}}
return _mm_maskz_min_epi8(__M,__A,__B);
}
@@ -1348,6 +1397,8 @@
// CHECK-LABEL: @test_mm_mask_min_epi8
// CHECK: [[CMP:%.*]] = icmp slt <16 x i8> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <16 x i1> [[CMP]], <16 x i8> [[X]], <16 x i8> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast [[SRCTY:<16 x i8>]] [[RES]] to [[DSTTY:<2 x i64>]]
+ // CHECK: [[RES:%.*]] = bitcast [[DSTTY]] [[TMP]] to [[SRCTY]]
// CHECK: select <16 x i1> {{.*}}, <16 x i8> [[RES]], <16 x i8> {{.*}}
return _mm_mask_min_epi8(__W,__M,__A,__B);
}
@@ -1355,6 +1406,8 @@
// CHECK-LABEL: @test_mm256_maskz_min_epi8
// CHECK: [[CMP:%.*]] = icmp slt <32 x i8> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <32 x i1> [[CMP]], <32 x i8> [[X]], <32 x i8> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast [[SRCTY:<32 x i8>]] [[RES]] to [[DSTTY:<4 x i64>]]
+ // CHECK: [[RES:%.*]] = bitcast [[DSTTY]] [[TMP]] to [[SRCTY]]
// CHECK: select <32 x i1> {{.*}}, <32 x i8> [[RES]], <32 x i8> {{.*}}
return _mm256_maskz_min_epi8(__M,__A,__B);
}
@@ -1362,6 +1415,8 @@
// CHECK-LABEL: @test_mm256_mask_min_epi8
// CHECK: [[CMP:%.*]] = icmp slt <32 x i8> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <32 x i1> [[CMP]], <32 x i8> [[X]], <32 x i8> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast [[SRCTY:<32 x i8>]] [[RES]] to [[DSTTY:<4 x i64>]]
+ // CHECK: [[RES:%.*]] = bitcast [[DSTTY]] [[TMP]] to [[SRCTY]]
// CHECK: select <32 x i1> {{.*}}, <32 x i8> [[RES]], <32 x i8> {{.*}}
return _mm256_mask_min_epi8(__W,__M,__A,__B);
}
@@ -1369,6 +1424,8 @@
// CHECK-LABEL: @test_mm_maskz_min_epi16
// CHECK: [[CMP:%.*]] = icmp slt <8 x i16> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <8 x i1> [[CMP]], <8 x i16> [[X]], <8 x i16> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast [[SRCTY:<8 x i16>]] [[RES]] to [[DSTTY:<2 x i64>]]
+ // CHECK: [[RES:%.*]] = bitcast [[DSTTY]] [[TMP]] to [[SRCTY]]
// CHECK: select <8 x i1> {{.*}}, <8 x i16> [[RES]], <8 x i16> {{.*}}
return _mm_maskz_min_epi16(__M,__A,__B);
}
@@ -1376,6 +1433,8 @@
// CHECK-LABEL: @test_mm_mask_min_epi16
// CHECK: [[CMP:%.*]] = icmp slt <8 x i16> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <8 x i1> [[CMP]], <8 x i16> [[X]], <8 x i16> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast [[SRCTY:<8 x i16>]] [[RES]] to [[DSTTY:<2 x i64>]]
+ // CHECK: [[RES:%.*]] = bitcast [[DSTTY]] [[TMP]] to [[SRCTY]]
// CHECK: select <8 x i1> {{.*}}, <8 x i16> [[RES]], <8 x i16> {{.*}}
return _mm_mask_min_epi16(__W,__M,__A,__B);
}
@@ -1383,6 +1442,8 @@
// CHECK-LABEL: @test_mm256_maskz_min_epi16
// CHECK: [[CMP:%.*]] = icmp slt <16 x i16> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <16 x i1> [[CMP]], <16 x i16> [[X]], <16 x i16> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast [[SRCTY:<16 x i16>]] [[RES]] to [[DSTTY:<4 x i64>]]
+ // CHECK: [[RES:%.*]] = bitcast [[DSTTY]] [[TMP]] to [[SRCTY]]
// CHECK: select <16 x i1> {{.*}}, <16 x i16> [[RES]], <16 x i16> {{.*}}
return _mm256_maskz_min_epi16(__M,__A,__B);
}
@@ -1390,6 +1451,8 @@
// CHECK-LABEL: @test_mm256_mask_min_epi16
// CHECK: [[CMP:%.*]] = icmp slt <16 x i16> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <16 x i1> [[CMP]], <16 x i16> [[X]], <16 x i16> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast [[SRCTY:<16 x i16>]] [[RES]] to [[DSTTY:<4 x i64>]]
+ // CHECK: [[RES:%.*]] = bitcast [[DSTTY]] [[TMP]] to [[SRCTY]]
// CHECK: select <16 x i1> {{.*}}, <16 x i16> [[RES]], <16 x i16> {{.*}}
return _mm256_mask_min_epi16(__W,__M,__A,__B);
}
@@ -1397,6 +1460,8 @@
// CHECK-LABEL: @test_mm_maskz_min_epu8
// CHECK: [[CMP:%.*]] = icmp ult <16 x i8> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <16 x i1> [[CMP]], <16 x i8> [[X]], <16 x i8> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast [[SRCTY:<16 x i8>]] [[RES]] to [[DSTTY:<2 x i64>]]
+ // CHECK: [[RES:%.*]] = bitcast [[DSTTY]] [[TMP]] to [[SRCTY]]
// CHECK: select <16 x i1> {{.*}}, <16 x i8> [[RES]], <16 x i8> {{.*}}
return _mm_maskz_min_epu8(__M,__A,__B);
}
@@ -1404,6 +1469,8 @@
// CHECK-LABEL: @test_mm_mask_min_epu8
// CHECK: [[CMP:%.*]] = icmp ult <16 x i8> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <16 x i1> [[CMP]], <16 x i8> [[X]], <16 x i8> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast [[SRCTY:<16 x i8>]] [[RES]] to [[DSTTY:<2 x i64>]]
+ // CHECK: [[RES:%.*]] = bitcast [[DSTTY]] [[TMP]] to [[SRCTY]]
// CHECK: select <16 x i1> {{.*}}, <16 x i8> [[RES]], <16 x i8> {{.*}}
return _mm_mask_min_epu8(__W,__M,__A,__B);
}
@@ -1411,6 +1478,8 @@
// CHECK-LABEL: @test_mm256_maskz_min_epu8
// CHECK: [[CMP:%.*]] = icmp ult <32 x i8> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <32 x i1> [[CMP]], <32 x i8> [[X]], <32 x i8> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast [[SRCTY:<32 x i8>]] [[RES]] to [[DSTTY:<4 x i64>]]
+ // CHECK: [[RES:%.*]] = bitcast [[DSTTY]] [[TMP]] to [[SRCTY]]
// CHECK: select <32 x i1> {{.*}}, <32 x i8> [[RES]], <32 x i8> {{.*}}
return _mm256_maskz_min_epu8(__M,__A,__B);
}
@@ -1418,6 +1487,8 @@
// CHECK-LABEL: @test_mm256_mask_min_epu8
// CHECK: [[CMP:%.*]] = icmp ult <32 x i8> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <32 x i1> [[CMP]], <32 x i8> [[X]], <32 x i8> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast [[SRCTY:<32 x i8>]] [[RES]] to [[DSTTY:<4 x i64>]]
+ // CHECK: [[RES:%.*]] = bitcast [[DSTTY]] [[TMP]] to [[SRCTY]]
// CHECK: select <32 x i1> {{.*}}, <32 x i8> [[RES]], <32 x i8> {{.*}}
return _mm256_mask_min_epu8(__W,__M,__A,__B);
}
@@ -1425,6 +1496,8 @@
// CHECK-LABEL: @test_mm_maskz_min_epu16
// CHECK: [[CMP:%.*]] = icmp ult <8 x i16> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <8 x i1> [[CMP]], <8 x i16> [[X]], <8 x i16> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast [[SRCTY:<8 x i16>]] [[RES]] to [[DSTTY:<2 x i64>]]
+ // CHECK: [[RES:%.*]] = bitcast [[DSTTY]] [[TMP]] to [[SRCTY]]
// CHECK: select <8 x i1> {{.*}}, <8 x i16> [[RES]], <8 x i16> {{.*}}
return _mm_maskz_min_epu16(__M,__A,__B);
}
@@ -1432,6 +1505,8 @@
// CHECK-LABEL: @test_mm_mask_min_epu16
// CHECK: [[CMP:%.*]] = icmp ult <8 x i16> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <8 x i1> [[CMP]], <8 x i16> [[X]], <8 x i16> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast [[SRCTY:<8 x i16>]] [[RES]] to [[DSTTY:<2 x i64>]]
+ // CHECK: [[RES:%.*]] = bitcast [[DSTTY]] [[TMP]] to [[SRCTY]]
// CHECK: select <8 x i1> {{.*}}, <8 x i16> [[RES]], <8 x i16> {{.*}}
return _mm_mask_min_epu16(__W,__M,__A,__B);
}
@@ -1439,6 +1514,8 @@
// CHECK-LABEL: @test_mm256_maskz_min_epu16
// CHECK: [[CMP:%.*]] = icmp ult <16 x i16> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <16 x i1> [[CMP]], <16 x i16> [[X]], <16 x i16> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast [[SRCTY:<16 x i16>]] [[RES]] to [[DSTTY:<4 x i64>]]
+ // CHECK: [[RES:%.*]] = bitcast [[DSTTY]] [[TMP]] to [[SRCTY]]
// CHECK: select <16 x i1> {{.*}}, <16 x i16> [[RES]], <16 x i16> {{.*}}
return _mm256_maskz_min_epu16(__M,__A,__B);
}
@@ -1446,6 +1523,8 @@
// CHECK-LABEL: @test_mm256_mask_min_epu16
// CHECK: [[CMP:%.*]] = icmp ult <16 x i16> [[X:%.*]], [[Y:%.*]]
// CHECK-NEXT: [[RES:%.*]] = select <16 x i1> [[CMP]], <16 x i16> [[X]], <16 x i16> [[Y]]
+ // CHECK: [[TMP:%.*]] = bitcast [[SRCTY:<16 x i16>]] [[RES]] to [[DSTTY:<4 x i64>]]
+ // CHECK: [[RES:%.*]] = bitcast [[DSTTY]] [[TMP]] to [[SRCTY]]
// CHECK: select <16 x i1> {{.*}}, <16 x i16> [[RES]], <16 x i16> {{.*}}
return _mm256_mask_min_epu16(__W,__M,__A,__B);
}
diff --git a/src/llvm-project/clang/test/CodeGen/backend-unsupported-error.ll b/src/llvm-project/clang/test/CodeGen/backend-unsupported-error.ll
index 75a5992..2de2c87 100644
--- a/src/llvm-project/clang/test/CodeGen/backend-unsupported-error.ll
+++ b/src/llvm-project/clang/test/CodeGen/backend-unsupported-error.ll
@@ -21,7 +21,7 @@
ret i32 %call, !dbg !15
}
-attributes #0 = { nounwind noinline "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #0 = { nounwind noinline "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!9, !10}
diff --git a/src/llvm-project/clang/test/CodeGen/blocks.c b/src/llvm-project/clang/test/CodeGen/blocks.c
index 3bf1939..fd348c9 100644
--- a/src/llvm-project/clang/test/CodeGen/blocks.c
+++ b/src/llvm-project/clang/test/CodeGen/blocks.c
@@ -33,7 +33,7 @@
^ { i = 1; }();
};
-// CHECK-LABEL: define linkonce_odr hidden void @__copy_helper_block_4_20r(i8*, i8*) unnamed_addr
+// CHECK-LABEL: define linkonce_odr hidden void @__copy_helper_block_4_20r(i8* %0, i8* %1) unnamed_addr
// CHECK: %[[_ADDR:.*]] = alloca i8*, align 4
// CHECK-NEXT: %[[_ADDR1:.*]] = alloca i8*, align 4
// CHECK-NEXT: store i8* %0, i8** %[[_ADDR]], align 4
@@ -49,7 +49,7 @@
// CHECK-NEXT: call void @_Block_object_assign(i8* %[[V6]], i8* %[[BLOCKCOPY_SRC]], i32 8)
// CHECK-NEXT: ret void
-// CHECK-LABEL: define linkonce_odr hidden void @__destroy_helper_block_4_20r(i8*) unnamed_addr
+// CHECK-LABEL: define linkonce_odr hidden void @__destroy_helper_block_4_20r(i8* %0) unnamed_addr
// CHECK: %[[_ADDR:.*]] = alloca i8*, align 4
// CHECK-NEXT: store i8* %0, i8** %[[_ADDR]], align 4
// CHECK-NEXT: %[[V1:.*]] = load i8*, i8** %[[_ADDR]], align 4
diff --git a/src/llvm-project/clang/test/CodeGen/bmi-builtins.c b/src/llvm-project/clang/test/CodeGen/bmi-builtins.c
index 9eda3f6..9f2d776 100644
--- a/src/llvm-project/clang/test/CodeGen/bmi-builtins.c
+++ b/src/llvm-project/clang/test/CodeGen/bmi-builtins.c
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +bmi -emit-llvm -o - -Wall -Werror | FileCheck %s
+// RUN: %clang_cc1 -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +bmi -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefixes=CHECK,CHECK_TZCNT
+// RUN: %clang_cc1 -fms-extensions -fms-compatibility -fms-compatibility-version=17.00 -ffreestanding %s -triple=x86_64-windows-msvc -emit-llvm -o - -Wall -Werror -DTEST_TZCNT | FileCheck %s --check-prefix=CHECK-TZCNT
#include <immintrin.h>
@@ -13,12 +14,57 @@
// instruction is identical in hardware, the AMD and Intel
// intrinsics are different!
+unsigned short test_tzcnt_u16(unsigned short __X) {
+ // CHECK-TZCNT-LABEL: test_tzcnt_u16
+ // CHECK-TZCNT: i16 @llvm.cttz.i16(i16 %{{.*}}, i1 false)
+ return _tzcnt_u16(__X);
+}
+
unsigned short test__tzcnt_u16(unsigned short __X) {
- // CHECK-LABEL: test__tzcnt_u16
- // CHECK: i16 @llvm.cttz.i16(i16 %{{.*}}, i1 false)
+ // CHECK-TZCNT-LABEL: test__tzcnt_u16
+ // CHECK-TZCNT: i16 @llvm.cttz.i16(i16 %{{.*}}, i1 false)
return __tzcnt_u16(__X);
}
+unsigned int test__tzcnt_u32(unsigned int __X) {
+ // CHECK-TZCNT-LABEL: test__tzcnt_u32
+ // CHECK-TZCNT: i32 @llvm.cttz.i32(i32 %{{.*}}, i1 false)
+ return __tzcnt_u32(__X);
+}
+
+int test_mm_tzcnt_32(unsigned int __X) {
+ // CHECK-TZCNT-LABEL: test_mm_tzcnt_32
+ // CHECK-TZCNT: i32 @llvm.cttz.i32(i32 %{{.*}}, i1 false)
+ return _mm_tzcnt_32(__X);
+}
+
+unsigned int test_tzcnt_u32(unsigned int __X) {
+ // CHECK-TZCNT-LABEL: test_tzcnt_u32
+ // CHECK-TZCNT: i32 @llvm.cttz.i32(i32 %{{.*}}, i1 false)
+ return _tzcnt_u32(__X);
+}
+
+#ifdef __x86_64__
+unsigned long long test__tzcnt_u64(unsigned long long __X) {
+ // CHECK-TZCNT-LABEL: test__tzcnt_u64
+ // CHECK-TZCNT: i64 @llvm.cttz.i64(i64 %{{.*}}, i1 false)
+ return __tzcnt_u64(__X);
+}
+
+long long test_mm_tzcnt_64(unsigned long long __X) {
+ // CHECK-TZCNT-LABEL: test_mm_tzcnt_64
+ // CHECK-TZCNT: i64 @llvm.cttz.i64(i64 %{{.*}}, i1 false)
+ return _mm_tzcnt_64(__X);
+}
+
+unsigned long long test_tzcnt_u64(unsigned long long __X) {
+ // CHECK-TZCNT-LABEL: test_tzcnt_u64
+ // CHECK-TZCNT: i64 @llvm.cttz.i64(i64 %{{.*}}, i1 false)
+ return _tzcnt_u64(__X);
+}
+#endif
+
+#if !defined(TEST_TZCNT)
unsigned int test__andn_u32(unsigned int __X, unsigned int __Y) {
// CHECK-LABEL: test__andn_u32
// CHECK: xor i32 %{{.*}}, -1
@@ -53,18 +99,6 @@
return __blsr_u32(__X);
}
-unsigned int test__tzcnt_u32(unsigned int __X) {
- // CHECK-LABEL: test__tzcnt_u32
- // CHECK: i32 @llvm.cttz.i32(i32 %{{.*}}, i1 false)
- return __tzcnt_u32(__X);
-}
-
-int test_mm_tzcnt_32(unsigned int __X) {
- // CHECK-LABEL: test_mm_tzcnt_32
- // CHECK: i32 @llvm.cttz.i32(i32 %{{.*}}, i1 false)
- return _mm_tzcnt_32(__X);
-}
-
#ifdef __x86_64__
unsigned long long test__andn_u64(unsigned long __X, unsigned long __Y) {
// CHECK-LABEL: test__andn_u64
@@ -99,28 +133,10 @@
// CHECK: and i64 %{{.*}}, %{{.*}}
return __blsr_u64(__X);
}
-
-unsigned long long test__tzcnt_u64(unsigned long long __X) {
- // CHECK-LABEL: test__tzcnt_u64
- // CHECK: i64 @llvm.cttz.i64(i64 %{{.*}}, i1 false)
- return __tzcnt_u64(__X);
-}
-
-long long test_mm_tzcnt_64(unsigned long long __X) {
- // CHECK-LABEL: test_mm_tzcnt_64
- // CHECK: i64 @llvm.cttz.i64(i64 %{{.*}}, i1 false)
- return _mm_tzcnt_64(__X);
-}
#endif
// Intel intrinsics
-unsigned short test_tzcnt_u16(unsigned short __X) {
- // CHECK-LABEL: test_tzcnt_u16
- // CHECK: i16 @llvm.cttz.i16(i16 %{{.*}}, i1 false)
- return _tzcnt_u16(__X);
-}
-
unsigned int test_andn_u32(unsigned int __X, unsigned int __Y) {
// CHECK-LABEL: test_andn_u32
// CHECK: xor i32 %{{.*}}, -1
@@ -160,12 +176,6 @@
return _blsr_u32(__X);
}
-unsigned int test_tzcnt_u32(unsigned int __X) {
- // CHECK-LABEL: test_tzcnt_u32
- // CHECK: i32 @llvm.cttz.i32(i32 %{{.*}}, i1 false)
- return _tzcnt_u32(__X);
-}
-
#ifdef __x86_64__
unsigned long long test_andn_u64(unsigned long __X, unsigned long __Y) {
// CHECK-LABEL: test_andn_u64
@@ -206,10 +216,6 @@
// CHECK: and i64 %{{.*}}, %{{.*}}
return _blsr_u64(__X);
}
-
-unsigned long long test_tzcnt_u64(unsigned long long __X) {
- // CHECK-LABEL: test_tzcnt_u64
- // CHECK: i64 @llvm.cttz.i64(i64 %{{.*}}, i1 false)
- return _tzcnt_u64(__X);
-}
#endif
+
+#endif // !defined(TEST_TZCNT)
diff --git a/src/llvm-project/clang/test/CodeGen/bpf-attr-preserve-access-index-1.c b/src/llvm-project/clang/test/CodeGen/bpf-attr-preserve-access-index-1.c
new file mode 100644
index 0000000..accf6ab
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/bpf-attr-preserve-access-index-1.c
@@ -0,0 +1,23 @@
+// REQUIRES: bpf-registered-target
+// RUN: %clang -target bpf -emit-llvm -S -g %s -o - | FileCheck %s
+
+#define __reloc__ __attribute__((preserve_access_index))
+
+// test simple member access and initial struct with non-zero stride access
+struct s1 {
+ int a;
+ union {
+ int b;
+ int c;
+ };
+} __reloc__;
+typedef struct s1 __s1;
+
+int test(__s1 *arg) {
+ return arg->a + arg[1].b;
+}
+
+// CHECK: call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1* %{{[0-9a-z]+}}, i32 0, i32 0)
+// CHECK: call %struct.s1* @llvm.preserve.array.access.index.p0s_struct.s1s.p0s_struct.s1s(%struct.s1* %{{[0-9a-z]+}}, i32 0, i32 1)
+// CHECK: call %union.anon* @llvm.preserve.struct.access.index.p0s_union.anons.p0s_struct.s1s(%struct.s1* %{{[0-9a-z]+}}, i32 1, i32 1)
+// CHECK: call %union.anon* @llvm.preserve.union.access.index.p0s_union.anons.p0s_union.anons(%union.anon* %{{[0-9a-z]+}}, i32 0)
diff --git a/src/llvm-project/clang/test/CodeGen/bpf-attr-preserve-access-index-2.c b/src/llvm-project/clang/test/CodeGen/bpf-attr-preserve-access-index-2.c
new file mode 100644
index 0000000..a136eee
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/bpf-attr-preserve-access-index-2.c
@@ -0,0 +1,24 @@
+// REQUIRES: bpf-registered-target
+// RUN: %clang -target bpf -emit-llvm -S -g %s -o - | FileCheck %s
+
+#define __reloc__ __attribute__((preserve_access_index))
+
+// test array access
+struct s1 {
+ int a[3];
+ union {
+ int b;
+ int c[4];
+ };
+} __reloc__;
+typedef struct s1 __s1;
+
+int test(__s1 *arg) {
+ return arg->a[2] + arg->c[2];
+}
+
+// CHECK: call [3 x i32]* @llvm.preserve.struct.access.index.p0a3i32.p0s_struct.s1s(%struct.s1* %{{[0-9a-z]+}}, i32 0, i32 0)
+// CHECK: call i32* @llvm.preserve.array.access.index.p0i32.p0a3i32([3 x i32]* %{{[0-9a-z]+}}, i32 1, i32 2)
+// CHECK: call %union.anon* @llvm.preserve.struct.access.index.p0s_union.anons.p0s_struct.s1s(%struct.s1* %{{[0-9a-z]+}}, i32 1, i32 1)
+// CHECK: call %union.anon* @llvm.preserve.union.access.index.p0s_union.anons.p0s_union.anons(%union.anon* %{{[0-9a-z]+}}, i32 1)
+// CHECK: call i32* @llvm.preserve.array.access.index.p0i32.p0a4i32([4 x i32]* %{{[0-9a-z]+}}, i32 1, i32 2)
diff --git a/src/llvm-project/clang/test/CodeGen/bpf-attr-preserve-access-index-3.c b/src/llvm-project/clang/test/CodeGen/bpf-attr-preserve-access-index-3.c
new file mode 100644
index 0000000..917b508
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/bpf-attr-preserve-access-index-3.c
@@ -0,0 +1,32 @@
+// REQUIRES: bpf-registered-target
+// RUN: %clang -target bpf -emit-llvm -S -g %s -o - | FileCheck %s
+
+#define __reloc__ __attribute__((preserve_access_index))
+
+// chain of records, all with attributes
+struct s1 {
+ int c;
+} __reloc__;
+typedef struct s1 __s1;
+
+struct s2 {
+ union {
+ __s1 b[3];
+ };
+} __reloc__;
+typedef struct s2 __s2;
+
+struct s3 {
+ __s2 a;
+} __reloc__;
+typedef struct s3 __s3;
+
+int test(__s3 *arg) {
+ return arg->a.b[2].c;
+}
+
+// CHECK: call %struct.s2* @llvm.preserve.struct.access.index.p0s_struct.s2s.p0s_struct.s3s(%struct.s3* %{{[0-9a-z]+}}, i32 0, i32 0)
+// CHECK: call %union.anon* @llvm.preserve.struct.access.index.p0s_union.anons.p0s_struct.s2s(%struct.s2* %{{[0-9a-z]+}}, i32 0, i32 0)
+// CHECK: call %union.anon* @llvm.preserve.union.access.index.p0s_union.anons.p0s_union.anons(%union.anon* %{{[0-9a-z]+}}, i32 0)
+// CHECK: call %struct.s1* @llvm.preserve.array.access.index.p0s_struct.s1s.p0a3s_struct.s1s([3 x %struct.s1]* %{{[0-9a-z]+}}, i32 1, i32 2)
+// CHECK: call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1* %{{[0-9a-z]+}}, i32 0, i32 0)
diff --git a/src/llvm-project/clang/test/CodeGen/bpf-attr-preserve-access-index-4.c b/src/llvm-project/clang/test/CodeGen/bpf-attr-preserve-access-index-4.c
new file mode 100644
index 0000000..4993099
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/bpf-attr-preserve-access-index-4.c
@@ -0,0 +1,33 @@
+// REQUIRES: bpf-registered-target
+// RUN: %clang -target bpf -emit-llvm -S -g %s -o - | FileCheck %s
+
+#define __reloc__ __attribute__((preserve_access_index))
+
+// chain of records, some do not have attributes.
+struct s1 {
+ int c;
+};
+typedef struct s1 __s1;
+
+struct s2 {
+ union {
+ __s1 b[3];
+ };
+} __reloc__;
+typedef struct s2 __s2;
+
+struct s3 {
+ __s2 a;
+};
+typedef struct s3 __s3;
+
+int test(__s3 *arg) {
+ return arg->a.b[2].c;
+}
+
+// CHECK: define dso_local i32 @test
+// CHECK-NOT: call %struct.s2* @llvm.preserve.struct.access.index.p0s_struct.s2s.p0s_struct.s3s
+// CHECK: call %union.anon* @llvm.preserve.struct.access.index.p0s_union.anons.p0s_struct.s2s(%struct.s2* %{{[0-9a-z]+}}, i32 0, i32 0)
+// CHECK: call %union.anon* @llvm.preserve.union.access.index.p0s_union.anons.p0s_union.anons(%union.anon* %{{[0-9a-z]+}}, i32 0)
+// CHECK: call %struct.s1* @llvm.preserve.array.access.index.p0s_struct.s1s.p0a3s_struct.s1s([3 x %struct.s1]* %{{[0-9a-z]+}}, i32 1, i32 2)
+// CHECK-NOT: call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s
diff --git a/src/llvm-project/clang/test/CodeGen/bpf-attr-preserve-access-index-5.c b/src/llvm-project/clang/test/CodeGen/bpf-attr-preserve-access-index-5.c
new file mode 100644
index 0000000..281bcdd
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/bpf-attr-preserve-access-index-5.c
@@ -0,0 +1,32 @@
+// REQUIRES: bpf-registered-target
+// RUN: %clang -target bpf -emit-llvm -S -g %s -o - | FileCheck %s
+
+#define __reloc__ __attribute__((preserve_access_index))
+
+// chain of records, attribute may be in inner record.
+struct s1 {
+ int c;
+} __reloc__;
+typedef struct s1 __s1;
+
+struct s2 {
+ union {
+ __s1 b[3];
+ } __reloc__;
+};
+typedef struct s2 __s2;
+
+struct s3 {
+ __s2 a;
+} __reloc__;
+typedef struct s3 __s3;
+
+int test(__s3 *arg) {
+ return arg->a.b[2].c;
+}
+
+// CHECK: call %struct.s2* @llvm.preserve.struct.access.index.p0s_struct.s2s.p0s_struct.s3s(%struct.s3* %{{[0-9a-z]+}}, i32 0, i32 0)
+// CHECK-NOT: call %union.anon* @llvm.preserve.struct.access.index.p0s_union.anons.p0s_struct.s2s
+// CHECK: call %union.anon* @llvm.preserve.union.access.index.p0s_union.anons.p0s_union.anons(%union.anon* %{{[0-9a-z]+}}, i32 0)
+// CHECK: call %struct.s1* @llvm.preserve.array.access.index.p0s_struct.s1s.p0a3s_struct.s1s([3 x %struct.s1]* %{{[0-9a-z]+}}, i32 1, i32 2)
+// CHECK: call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1* %{{[0-9a-z]+}}, i32 0, i32 0)
diff --git a/src/llvm-project/clang/test/CodeGen/bpf-attr-preserve-access-index-6.c b/src/llvm-project/clang/test/CodeGen/bpf-attr-preserve-access-index-6.c
new file mode 100644
index 0000000..a763f28
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/bpf-attr-preserve-access-index-6.c
@@ -0,0 +1,32 @@
+// REQUIRES: bpf-registered-target
+// RUN: %clang -target bpf -emit-llvm -S -g %s -o - | FileCheck %s
+
+#define __reloc__ __attribute__((preserve_access_index))
+
+// chain of records, both inner and outer record have attributes.
+struct s1 {
+ int c;
+} __reloc__;
+typedef struct s1 __s1;
+
+struct s2 {
+ union {
+ __s1 b[3];
+ } __reloc__;
+} __reloc__;
+typedef struct s2 __s2;
+
+struct s3 {
+ __s2 a;
+} __reloc__;
+typedef struct s3 __s3;
+
+int test(__s3 *arg) {
+ return arg->a.b[2].c;
+}
+
+// CHECK: call %struct.s2* @llvm.preserve.struct.access.index.p0s_struct.s2s.p0s_struct.s3s(%struct.s3* %{{[0-9a-z]+}}, i32 0, i32 0)
+// CHECK: call %union.anon* @llvm.preserve.struct.access.index.p0s_union.anons.p0s_struct.s2s(%struct.s2* %{{[0-9a-z]+}}, i32 0, i32 0)
+// CHECK: call %union.anon* @llvm.preserve.union.access.index.p0s_union.anons.p0s_union.anons(%union.anon* %{{[0-9a-z]+}}, i32 0)
+// CHECK: call %struct.s1* @llvm.preserve.array.access.index.p0s_struct.s1s.p0a3s_struct.s1s([3 x %struct.s1]* %{{[0-9a-z]+}}, i32 1, i32 2)
+// CHECK: call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1* %{{[0-9a-z]+}}, i32 0, i32 0)
diff --git a/src/llvm-project/clang/test/CodeGen/bpf-attr-preserve-access-index-7.c b/src/llvm-project/clang/test/CodeGen/bpf-attr-preserve-access-index-7.c
new file mode 100644
index 0000000..49f4a4d
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/bpf-attr-preserve-access-index-7.c
@@ -0,0 +1,36 @@
+// REQUIRES: bpf-registered-target
+// RUN: %clang -target bpf -emit-llvm -S -g %s -o - | FileCheck %s
+
+#define __reloc__ __attribute__((preserve_access_index))
+
+// chain of records, all with attributes
+struct __reloc__ s1;
+struct __reloc__ s2;
+struct __reloc__ s3;
+
+struct s1 {
+ int c;
+};
+typedef struct s1 __s1;
+
+struct s2 {
+ union {
+ __s1 b[3];
+ };
+};
+typedef struct s2 __s2;
+
+struct s3 {
+ __s2 a;
+};
+typedef struct s3 __s3;
+
+int test(__s3 *arg) {
+ return arg->a.b[2].c;
+}
+
+// CHECK: call %struct.s2* @llvm.preserve.struct.access.index.p0s_struct.s2s.p0s_struct.s3s(%struct.s3* %{{[0-9a-z]+}}, i32 0, i32 0)
+// CHECK: call %union.anon* @llvm.preserve.struct.access.index.p0s_union.anons.p0s_struct.s2s(%struct.s2* %{{[0-9a-z]+}}, i32 0, i32 0)
+// CHECK: call %union.anon* @llvm.preserve.union.access.index.p0s_union.anons.p0s_union.anons(%union.anon* %{{[0-9a-z]+}}, i32 0)
+// CHECK: call %struct.s1* @llvm.preserve.array.access.index.p0s_struct.s1s.p0a3s_struct.s1s([3 x %struct.s1]* %{{[0-9a-z]+}}, i32 1, i32 2)
+// CHECK: call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1* %{{[0-9a-z]+}}, i32 0, i32 0)
diff --git a/src/llvm-project/clang/test/CodeGen/bpf-attr-preserve-access-index-8.c b/src/llvm-project/clang/test/CodeGen/bpf-attr-preserve-access-index-8.c
new file mode 100644
index 0000000..7febf7c
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/bpf-attr-preserve-access-index-8.c
@@ -0,0 +1,36 @@
+// REQUIRES: bpf-registered-target
+// RUN: %clang -target bpf -emit-llvm -S -g %s -o - | FileCheck %s
+
+#define __reloc__ __attribute__((preserve_access_index))
+
+// chain of records, all with attributes
+struct s1;
+struct s2;
+struct s3;
+
+struct s1 {
+ int c;
+} __reloc__;
+typedef struct s1 __s1;
+
+struct s2 {
+ union {
+ __s1 b[3];
+ };
+} __reloc__;
+typedef struct s2 __s2;
+
+struct s3 {
+ __s2 a;
+} __reloc__;
+typedef struct s3 __s3;
+
+int test(__s3 *arg) {
+ return arg->a.b[2].c;
+}
+
+// CHECK: call %struct.s2* @llvm.preserve.struct.access.index.p0s_struct.s2s.p0s_struct.s3s(%struct.s3* %{{[0-9a-z]+}}, i32 0, i32 0)
+// CHECK: call %union.anon* @llvm.preserve.struct.access.index.p0s_union.anons.p0s_struct.s2s(%struct.s2* %{{[0-9a-z]+}}, i32 0, i32 0)
+// CHECK: call %union.anon* @llvm.preserve.union.access.index.p0s_union.anons.p0s_union.anons(%union.anon* %{{[0-9a-z]+}}, i32 0)
+// CHECK: call %struct.s1* @llvm.preserve.array.access.index.p0s_struct.s1s.p0a3s_struct.s1s([3 x %struct.s1]* %{{[0-9a-z]+}}, i32 1, i32 2)
+// CHECK: call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s(%struct.s1* %{{[0-9a-z]+}}, i32 0, i32 0)
diff --git a/src/llvm-project/clang/test/CodeGen/builtin-align-array.c b/src/llvm-project/clang/test/CodeGen/builtin-align-array.c
new file mode 100644
index 0000000..97235c3
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/builtin-align-array.c
@@ -0,0 +1,78 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+/// Check that the alignment builtins handle array-to-pointer decay
+// RUN: %clang_cc1 -triple=x86_64-unknown-unknown -o - -emit-llvm %s | FileCheck %s
+
+extern int func(char *c);
+
+// CHECK-LABEL: define {{[^@]+}}@test_array() #0
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[BUF:%.*]] = alloca [1024 x i8], align 16
+// CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BUF]], i64 0, i64 44
+// CHECK-NEXT: [[INTPTR:%.*]] = ptrtoint i8* [[ARRAYIDX]] to i64
+// CHECK-NEXT: [[ALIGNED_INTPTR:%.*]] = and i64 [[INTPTR]], -16
+// CHECK-NEXT: [[DIFF:%.*]] = sub i64 [[ALIGNED_INTPTR]], [[INTPTR]]
+// CHECK-NEXT: [[ALIGNED_RESULT:%.*]] = getelementptr inbounds i8, i8* [[ARRAYIDX]], i64 [[DIFF]]
+// CHECK-NEXT: [[PTRINT:%.*]] = ptrtoint i8* [[ALIGNED_RESULT]] to i64
+// CHECK-NEXT: [[MASKEDPTR:%.*]] = and i64 [[PTRINT]], 15
+// CHECK-NEXT: [[MASKCOND:%.*]] = icmp eq i64 [[MASKEDPTR]], 0
+// CHECK-NEXT: call void @llvm.assume(i1 [[MASKCOND]])
+// CHECK-NEXT: [[CALL:%.*]] = call i32 @func(i8* [[ALIGNED_RESULT]])
+// CHECK-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BUF]], i64 0, i64 22
+// CHECK-NEXT: [[INTPTR2:%.*]] = ptrtoint i8* [[ARRAYIDX1]] to i64
+// CHECK-NEXT: [[OVER_BOUNDARY:%.*]] = add i64 [[INTPTR2]], 31
+// CHECK-NEXT: [[ALIGNED_INTPTR4:%.*]] = and i64 [[OVER_BOUNDARY]], -32
+// CHECK-NEXT: [[DIFF5:%.*]] = sub i64 [[ALIGNED_INTPTR4]], [[INTPTR2]]
+// CHECK-NEXT: [[ALIGNED_RESULT6:%.*]] = getelementptr inbounds i8, i8* [[ARRAYIDX1]], i64 [[DIFF5]]
+// CHECK-NEXT: [[PTRINT7:%.*]] = ptrtoint i8* [[ALIGNED_RESULT6]] to i64
+// CHECK-NEXT: [[MASKEDPTR8:%.*]] = and i64 [[PTRINT7]], 31
+// CHECK-NEXT: [[MASKCOND9:%.*]] = icmp eq i64 [[MASKEDPTR8]], 0
+// CHECK-NEXT: call void @llvm.assume(i1 [[MASKCOND9]])
+// CHECK-NEXT: [[CALL10:%.*]] = call i32 @func(i8* [[ALIGNED_RESULT6]])
+// CHECK-NEXT: [[ARRAYIDX11:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BUF]], i64 0, i64 16
+// CHECK-NEXT: [[SRC_ADDR:%.*]] = ptrtoint i8* [[ARRAYIDX11]] to i64
+// CHECK-NEXT: [[SET_BITS:%.*]] = and i64 [[SRC_ADDR]], 63
+// CHECK-NEXT: [[IS_ALIGNED:%.*]] = icmp eq i64 [[SET_BITS]], 0
+// CHECK-NEXT: [[CONV:%.*]] = zext i1 [[IS_ALIGNED]] to i32
+// CHECK-NEXT: ret i32 [[CONV]]
+//
+int test_array(void) {
+ char buf[1024];
+ func(__builtin_align_down(&buf[44], 16));
+ func(__builtin_align_up(&buf[22], 32));
+ return __builtin_is_aligned(&buf[16], 64);
+}
+
+// CHECK-LABEL: define {{[^@]+}}@test_array_should_not_mask() #0
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[BUF:%.*]] = alloca [1024 x i8], align 32
+// CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BUF]], i64 0, i64 64
+// CHECK-NEXT: [[INTPTR:%.*]] = ptrtoint i8* [[ARRAYIDX]] to i64
+// CHECK-NEXT: [[ALIGNED_INTPTR:%.*]] = and i64 [[INTPTR]], -16
+// CHECK-NEXT: [[DIFF:%.*]] = sub i64 [[ALIGNED_INTPTR]], [[INTPTR]]
+// CHECK-NEXT: [[ALIGNED_RESULT:%.*]] = getelementptr inbounds i8, i8* [[ARRAYIDX]], i64 [[DIFF]]
+// CHECK-NEXT: [[PTRINT:%.*]] = ptrtoint i8* [[ALIGNED_RESULT]] to i64
+// CHECK-NEXT: [[MASKEDPTR:%.*]] = and i64 [[PTRINT]], 15
+// CHECK-NEXT: [[MASKCOND:%.*]] = icmp eq i64 [[MASKEDPTR]], 0
+// CHECK-NEXT: call void @llvm.assume(i1 [[MASKCOND]])
+// CHECK-NEXT: [[CALL:%.*]] = call i32 @func(i8* [[ALIGNED_RESULT]])
+// CHECK-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BUF]], i64 0, i64 32
+// CHECK-NEXT: [[INTPTR2:%.*]] = ptrtoint i8* [[ARRAYIDX1]] to i64
+// CHECK-NEXT: [[OVER_BOUNDARY:%.*]] = add i64 [[INTPTR2]], 31
+// CHECK-NEXT: [[ALIGNED_INTPTR4:%.*]] = and i64 [[OVER_BOUNDARY]], -32
+// CHECK-NEXT: [[DIFF5:%.*]] = sub i64 [[ALIGNED_INTPTR4]], [[INTPTR2]]
+// CHECK-NEXT: [[ALIGNED_RESULT6:%.*]] = getelementptr inbounds i8, i8* [[ARRAYIDX1]], i64 [[DIFF5]]
+// CHECK-NEXT: [[PTRINT7:%.*]] = ptrtoint i8* [[ALIGNED_RESULT6]] to i64
+// CHECK-NEXT: [[MASKEDPTR8:%.*]] = and i64 [[PTRINT7]], 31
+// CHECK-NEXT: [[MASKCOND9:%.*]] = icmp eq i64 [[MASKEDPTR8]], 0
+// CHECK-NEXT: call void @llvm.assume(i1 [[MASKCOND9]])
+// CHECK-NEXT: [[CALL10:%.*]] = call i32 @func(i8* [[ALIGNED_RESULT6]])
+// CHECK-NEXT: ret i32 1
+//
+int test_array_should_not_mask(void) {
+ _Alignas(32) char buf[1024];
+ // TODO: The align_up and align_down calls should be folded to no-ops
+ func(__builtin_align_down(&buf[64], 16));
+ func(__builtin_align_up(&buf[32], 32));
+ // This expression can be constant-evaluated:
+ return __builtin_is_aligned(&buf[64], 32);
+}
diff --git a/src/llvm-project/clang/test/CodeGen/builtin-align-assumption.c b/src/llvm-project/clang/test/CodeGen/builtin-align-assumption.c
new file mode 100644
index 0000000..442aa25
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/builtin-align-assumption.c
@@ -0,0 +1,12 @@
+/// Check that the new alignment set by the alignment builtins is propagated
+/// to e.g. llvm.memcpy calls.
+// RUN: %clang_cc1 -triple=x86_64-unknown-unknown %s -emit-llvm -O1 -o - | FileCheck %s
+
+// CHECK-LABEL: define {{[^@]+}}@align_up
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 64 dereferenceable(16) {{%.+}}, i8* nonnull align 1 dereferenceable(16) {{%.+}}, i64 16, i1 false)
+// CHECK-NEXT: ret void
+//
+void align_up(void* data, int* ptr) {
+ // The call to llvm.memcpy should have an "align 64" on the first argument
+ __builtin_memcpy(__builtin_align_up(ptr, 64), data, 16);
+}
diff --git a/src/llvm-project/clang/test/CodeGen/builtin-align.c b/src/llvm-project/clang/test/CodeGen/builtin-align.c
new file mode 100644
index 0000000..8fb5182
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/builtin-align.c
@@ -0,0 +1,127 @@
+/// Check the code generation for the alignment builtins
+/// To make the test case easier to read, run SROA after generating IR to remove the alloca instructions.
+// RUN: %clang_cc1 -triple=x86_64-unknown-unknown -DTEST_VOID_PTR \
+// RUN: -o - -emit-llvm %s -disable-O0-optnone | opt -S -sroa | \
+// RUN: FileCheck %s -check-prefixes CHECK,POINTER,ALIGNMENT_EXT \
+// RUN: -enable-var-scope '-D$PTRTYPE=i8'
+// RUN: %clang_cc1 -triple=x86_64-unknown-unknown -DTEST_FLOAT_PTR \
+// RUN: -o - -emit-llvm %s -disable-O0-optnone | opt -S -sroa | \
+// RUN: FileCheck %s -check-prefixes CHECK,POINTER,NON_I8_POINTER,ALIGNMENT_EXT \
+// RUN: -enable-var-scope '-D$PTRTYPE=f32'
+// RUN: %clang_cc1 -triple=x86_64-unknown-unknown -DTEST_LONG \
+// RUN: -o - -emit-llvm %s -disable-O0-optnone | opt -S -sroa | \
+// RUN: FileCheck %s -check-prefixes CHECK,INTEGER,ALIGNMENT_EXT -enable-var-scope
+/// Check that we can handle the case where the alignment parameter is wider
+/// than the source type (generate a trunc on alignment instead of zext)
+// RUN: %clang_cc1 -triple=x86_64-unknown-unknown -DTEST_USHORT \
+// RUN: -o - -emit-llvm %s -disable-O0-optnone | opt -S -sroa | \
+// RUN: FileCheck %s -check-prefixes CHECK,INTEGER,ALIGNMENT_TRUNC -enable-var-scope
+
+
+#ifdef TEST_VOID_PTR
+#define TYPE void *
+#elif defined(TEST_FLOAT_PTR)
+#define TYPE float *
+#elif defined(TEST_LONG)
+#define TYPE long
+#elif defined(TEST_CAP)
+#define TYPE void *__capability
+#elif defined(TEST_USHORT)
+#define TYPE unsigned short
+#else
+#error MISSING TYPE
+#endif
+
+/// Check that constant initializers work and are correct
+_Bool aligned_true = __builtin_is_aligned(1024, 512);
+// CHECK: @aligned_true = global i8 1, align 1
+_Bool aligned_false = __builtin_is_aligned(123, 512);
+// CHECK: @aligned_false = global i8 0, align 1
+
+int down_1 = __builtin_align_down(1023, 32);
+// CHECK: @down_1 = global i32 992, align 4
+int down_2 = __builtin_align_down(256, 32);
+// CHECK: @down_2 = global i32 256, align 4
+
+int up_1 = __builtin_align_up(1023, 32);
+// CHECK: @up_1 = global i32 1024, align 4
+int up_2 = __builtin_align_up(256, 32);
+// CHECK: @up_2 = global i32 256, align 4
+
+/// Capture the IR type here to use in the remaining FileCheck captures:
+// CHECK: define {{[^@]+}}@get_type() #0
+// CHECK-NEXT: entry:
+// POINTER-NEXT: ret [[$TYPE:.+]] null
+// INTEGER-NEXT: ret [[$TYPE:.+]] 0
+//
+TYPE get_type(void) {
+ return (TYPE)0;
+}
+
+// CHECK-LABEL: define {{[^@]+}}@is_aligned
+// CHECK-SAME: ([[$TYPE]] {{[^%]*}}[[PTR:%.*]], i32 [[ALIGN:%.*]]) #0
+// CHECK-NEXT: entry:
+// ALIGNMENT_EXT-NEXT: [[ALIGNMENT:%.*]] = zext i32 [[ALIGN]] to [[ALIGN_TYPE:i64]]
+// ALIGNMENT_TRUNC-NEXT: [[ALIGNMENT:%.*]] = trunc i32 [[ALIGN]] to [[ALIGN_TYPE:i16]]
+// CHECK-NEXT: [[MASK:%.*]] = sub [[ALIGN_TYPE]] [[ALIGNMENT]], 1
+// POINTER-NEXT: [[PTR:%.*]] = ptrtoint [[$TYPE]] %ptr to i64
+// CHECK-NEXT: [[SET_BITS:%.*]] = and [[ALIGN_TYPE]] [[PTR]], [[MASK]]
+// CHECK-NEXT: [[IS_ALIGNED:%.*]] = icmp eq [[ALIGN_TYPE]] [[SET_BITS]], 0
+// CHECK-NEXT: ret i1 [[IS_ALIGNED]]
+//
+_Bool is_aligned(TYPE ptr, unsigned align) {
+ return __builtin_is_aligned(ptr, align);
+}
+
+// CHECK-LABEL: define {{[^@]+}}@align_up
+// CHECK-SAME: ([[$TYPE]] {{[^%]*}}[[PTR:%.*]], i32 [[ALIGN:%.*]]) #0
+// CHECK-NEXT: entry:
+// ALIGNMENT_EXT-NEXT: [[ALIGNMENT:%.*]] = zext i32 [[ALIGN]] to [[ALIGN_TYPE:i64]]
+// ALIGNMENT_TRUNC-NEXT: [[ALIGNMENT:%.*]] = trunc i32 [[ALIGN]] to [[ALIGN_TYPE:i16]]
+// CHECK-NEXT: [[MASK:%.*]] = sub [[ALIGN_TYPE]] [[ALIGNMENT]], 1
+// INTEGER-NEXT: [[OVER_BOUNDARY:%.*]] = add [[$TYPE]] [[PTR]], [[MASK]]
+// NOTYET-POINTER-NEXT: [[ALIGNED_RESULT:%.*]] = call [[$TYPE]] @llvm.ptrmask.p0[[$PTRTYPE]].p0i8.i64(i8* [[OVER_BOUNDARY]], [[ALIGN_TYPE]] [[INVERTED_MASK]])
+// POINTER-NEXT: [[INTPTR:%.*]] = ptrtoint [[$TYPE]] [[PTR]] to [[ALIGN_TYPE]]
+// POINTER-NEXT: [[OVER_BOUNDARY:%.*]] = add [[ALIGN_TYPE]] [[INTPTR]], [[MASK]]
+// CHECK-NEXT: [[INVERTED_MASK:%.*]] = xor [[ALIGN_TYPE]] [[MASK]], -1
+// CHECK-NEXT: [[ALIGNED_RESULT:%.*]] = and [[ALIGN_TYPE]] [[OVER_BOUNDARY]], [[INVERTED_MASK]]
+// POINTER-NEXT: [[DIFF:%.*]] = sub i64 [[ALIGNED_RESULT]], [[INTPTR]]
+// NON_I8_POINTER-NEXT: [[PTR:%.*]] = bitcast [[$TYPE]] {{%.*}} to i8*
+// POINTER-NEXT: [[ALIGNED_RESULT:%.*]] = getelementptr inbounds i8, i8* [[PTR]], i64 [[DIFF]]
+// NON_I8_POINTER-NEXT: [[ALIGNED_RESULT:%.*]] = bitcast i8* {{%.*}} to [[$TYPE]]
+// POINTER-NEXT: [[ASSUME_MASK:%.*]] = sub i64 %alignment, 1
+// POINTER-NEXT: [[ASSUME_INTPTR:%.*]]= ptrtoint [[$TYPE]] [[ALIGNED_RESULT]] to i64
+// POINTER-NEXT: [[MASKEDPTR:%.*]] = and i64 %ptrint, [[ASSUME_MASK]]
+// POINTER-NEXT: [[MASKEDCOND:%.*]] = icmp eq i64 [[MASKEDPTR]], 0
+// POINTER-NEXT: call void @llvm.assume(i1 [[MASKEDCOND]])
+// CHECK-NEXT: ret [[$TYPE]] [[ALIGNED_RESULT]]
+//
+TYPE align_up(TYPE ptr, unsigned align) {
+ return __builtin_align_up(ptr, align);
+}
+
+// CHECK-LABEL: define {{[^@]+}}@align_down
+// CHECK-SAME: ([[$TYPE]] {{[^%]*}}[[PTR:%.*]], i32 [[ALIGN:%.*]]) #0
+// CHECK-NEXT: entry:
+// ALIGNMENT_EXT-NEXT: [[ALIGNMENT:%.*]] = zext i32 [[ALIGN]] to [[ALIGN_TYPE:i64]]
+// ALIGNMENT_TRUNC-NEXT: [[ALIGNMENT:%.*]] = trunc i32 [[ALIGN]] to [[ALIGN_TYPE:i16]]
+// CHECK-NEXT: [[MASK:%.*]] = sub [[ALIGN_TYPE]] [[ALIGNMENT]], 1
+// NOTYET-POINTER-NEXT: [[ALIGNED_RESULT:%.*]] = call [[$TYPE]] @llvm.ptrmask.p0[[$PTRTYPE]].p0[[$PTRTYPE]].i64([[$TYPE]] [[PTR]], [[ALIGN_TYPE]] [[INVERTED_MASK]])
+// POINTER-NEXT: [[INTPTR:%.*]] = ptrtoint [[$TYPE]] [[PTR]] to [[ALIGN_TYPE]]
+// CHECK-NEXT: [[INVERTED_MASK:%.*]] = xor [[ALIGN_TYPE]] [[MASK]], -1
+// POINTER-NEXT: [[ALIGNED_INTPTR:%.*]] = and [[ALIGN_TYPE]] [[INTPTR]], [[INVERTED_MASK]]
+// POINTER-NEXT: [[DIFF:%.*]] = sub i64 [[ALIGNED_INTPTR]], [[INTPTR]]
+// NON_I8_POINTER-NEXT: [[PTR:%.*]] = bitcast [[$TYPE]] {{%.*}} to i8*
+// POINTER-NEXT: [[ALIGNED_RESULT:%.*]] = getelementptr inbounds i8, i8* [[PTR]], i64 [[DIFF]]
+// NON_I8_POINTER-NEXT: [[ALIGNED_RESULT:%.*]] = bitcast i8* {{%.*}} to [[$TYPE]]
+// INTEGER-NEXT: [[ALIGNED_RESULT:%.*]] = and [[ALIGN_TYPE]] [[PTR]], [[INVERTED_MASK]]
+// POINTER-NEXT: [[ASSUME_MASK:%.*]] = sub i64 %alignment, 1
+// POINTER-NEXT: [[ASSUME_INTPTR:%.*]]= ptrtoint [[$TYPE]] [[ALIGNED_RESULT]] to i64
+// POINTER-NEXT: [[MASKEDPTR:%.*]] = and i64 %ptrint, [[ASSUME_MASK]]
+// POINTER-NEXT: [[MASKEDCOND:%.*]] = icmp eq i64 [[MASKEDPTR]], 0
+// POINTER-NEXT: call void @llvm.assume(i1 [[MASKEDCOND]])
+// CHECK-NEXT: ret [[$TYPE]] [[ALIGNED_RESULT]]
+//
+TYPE align_down(TYPE ptr, unsigned align) {
+ return __builtin_align_down(ptr, align);
+}
diff --git a/src/llvm-project/clang/test/CodeGen/builtin-assume-aligned.c b/src/llvm-project/clang/test/CodeGen/builtin-assume-aligned.c
index 1d807a4..f6a89a2 100644
--- a/src/llvm-project/clang/test/CodeGen/builtin-assume-aligned.c
+++ b/src/llvm-project/clang/test/CodeGen/builtin-assume-aligned.c
@@ -65,3 +65,12 @@
// CHECK: call void @llvm.assume(i1 [[MASKCOND6]])
}
+// CHECK-LABEL: @pr43638
+int pr43638(int *a) {
+ a = __builtin_assume_aligned(a, 4294967296);
+return a[0];
+// CHECK: [[PTRINT7:%.+]] = ptrtoint
+// CHECK: [[MASKEDPTR7:%.+]] = and i64 [[PTRINT7]], 536870911
+// CHECK: [[MASKCOND7:%.+]] = icmp eq i64 [[MASKEDPTR7]], 0
+// CHECK: call void @llvm.assume(i1 [[MASKCOND7]])
+}
diff --git a/src/llvm-project/clang/test/CodeGen/builtin-constant-p.c b/src/llvm-project/clang/test/CodeGen/builtin-constant-p.c
index 36c4598..7965dbe 100644
--- a/src/llvm-project/clang/test/CodeGen/builtin-constant-p.c
+++ b/src/llvm-project/clang/test/CodeGen/builtin-constant-p.c
@@ -1,12 +1,8 @@
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s -O2 | FileCheck %s
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s -O0 | FileCheck --check-prefix=O0 %s
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -disable-llvm-optzns -o - %s -O2 | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -disable-llvm-optzns -o - %s -O0 | FileCheck %s
int a = 42;
-inline int bcp(int x) {
- return __builtin_constant_p(x);
-}
-
/* --- Compound literals */
struct foo { int x, y; };
@@ -15,85 +11,56 @@
struct foo f = (struct foo){ __builtin_constant_p(y), 42 };
struct foo test0(int expr) {
- // CHECK: define i64 @test0(i32 %expr)
- // CHECK: call i1 @llvm.is.constant.i32(i32 %expr)
+ // CHECK-LABEL: test0
+ // CHECK: call i1 @llvm.is.constant.i32
struct foo f = (struct foo){ __builtin_constant_p(expr), 42 };
return f;
}
/* --- Pointer types */
-inline int test1_i(int *x) {
- return *x;
-}
-
int test1() {
- // CHECK: define i32 @test1
- // CHECK: add nsw i32 %0, -13
- // CHECK-NEXT: call i1 @llvm.is.constant.i32(i32 %sub)
- return bcp(test1_i(&a) - 13);
-}
-
-int test2() {
- // CHECK: define i32 @test2
+ // CHECK-LABEL: test1
// CHECK: ret i32 0
return __builtin_constant_p(&a - 13);
}
-inline int test3_i(int *x) {
- return 42;
-}
-
-int test3() {
- // CHECK: define i32 @test3
- // CHECK: ret i32 1
- return bcp(test3_i(&a) - 13);
-}
-
/* --- Aggregate types */
int b[] = {1, 2, 3};
-int test4() {
- // CHECK: define i32 @test4
+int test2() {
+ // CHECK-LABEL: test2
// CHECK: ret i32 0
return __builtin_constant_p(b);
}
-const char test5_c[] = {1, 2, 3, 0};
+const char test3_c[] = {1, 2, 3, 0};
-int test5() {
- // CHECK: define i32 @test5
+int test3() {
+ // CHECK-LABEL: test3
// CHECK: ret i32 0
- return __builtin_constant_p(test5_c);
+ return __builtin_constant_p(test3_c);
}
-inline char test6_i(const char *x) {
+inline char test4_i(const char *x) {
return x[1];
}
-int test6() {
- // CHECK: define i32 @test6
+int test4() {
+ // CHECK: define i32 @test4
// CHECK: ret i32 0
- return __builtin_constant_p(test6_i(test5_c));
-}
-
-/* --- Non-constant global variables */
-
-int test7() {
- // CHECK: define i32 @test7
- // CHECK: call i1 @llvm.is.constant.i32(i32 %0)
- return bcp(a);
+ return __builtin_constant_p(test4_i(test3_c));
}
/* --- Constant global variables */
const int c = 42;
-int test8() {
- // CHECK: define i32 @test8
+int test5() {
+ // CHECK-LABEL: test5
// CHECK: ret i32 1
- return bcp(c);
+ return __builtin_constant_p(c);
}
/* --- Array types */
@@ -101,34 +68,34 @@
int arr[] = { 1, 2, 3 };
const int c_arr[] = { 1, 2, 3 };
-int test9() {
- // CHECK: define i32 @test9
- // CHECK: call i1 @llvm.is.constant.i32(i32 %0)
+int test6() {
+ // CHECK-LABEL: test6
+ // CHECK: call i1 @llvm.is.constant.i32
return __builtin_constant_p(arr[2]);
}
-int test10() {
- // CHECK: define i32 @test10
- // CHECK: ret i32 1
+int test7() {
+ // CHECK-LABEL: test7
+ // CHECK: call i1 @llvm.is.constant.i32
return __builtin_constant_p(c_arr[2]);
}
-int test11() {
- // CHECK: define i32 @test11
+int test8() {
+ // CHECK-LABEL: test8
// CHECK: ret i32 0
return __builtin_constant_p(c_arr);
}
/* --- Function pointers */
-int test12() {
- // CHECK: define i32 @test12
+int test9() {
+ // CHECK-LABEL: test9
// CHECK: ret i32 0
- return __builtin_constant_p(&test10);
+ return __builtin_constant_p(&test9);
}
-int test13() {
- // CHECK: define i32 @test13
+int test10() {
+ // CHECK-LABEL: test10
// CHECK: ret i32 1
return __builtin_constant_p(&test10 != 0);
}
@@ -155,33 +122,31 @@
static void src_fn(void) {
}
-void test14() {
+void test11() {
assign(dest_p, src_fn);
}
-extern int test15_v;
+extern int test12_v;
-struct { const char *t; int a; } test15[] = {
- { "tag", __builtin_constant_p(test15_v) && !test15_v ? 1 : 0 }
+struct { const char *t; int a; } test12[] = {
+ { "tag", __builtin_constant_p(test12_v) && !test12_v ? 1 : 0 }
};
-extern char test16_v;
-struct { int a; } test16 = { __builtin_constant_p(test16_v) };
+extern char test13_v;
+struct { int a; } test13 = { __builtin_constant_p(test13_v) };
-extern unsigned long long test17_v;
+extern unsigned long long test14_v;
-void test17() {
- // O0: define void @test17
- // O0: call void asm sideeffect "", {{.*}}(i32 -1)
- // CHECK: define void @test17
+void test14() {
+ // CHECK-LABEL: test14
// CHECK: call void asm sideeffect "", {{.*}}(i32 -1)
- __asm__ __volatile__("" :: "n"( (__builtin_constant_p(test17_v) || 0) ? 1 : -1));
+ __asm__ __volatile__("" :: "n"( (__builtin_constant_p(test14_v) || 0) ? 1 : -1));
}
-int test18_f();
-// CHECK: define void @test18
-// CHECK-NOT: call {{.*}}test18_f
-void test18() {
+int test15_f();
+// CHECK-LABEL: define void @test15
+// CHECK-NOT: call {{.*}}test15_f
+void test15() {
int a, b;
- (void)__builtin_constant_p((a = b, test18_f()));
+ (void)__builtin_constant_p((a = b, test15_f()));
}
diff --git a/src/llvm-project/clang/test/CodeGen/builtin-memfns.c b/src/llvm-project/clang/test/CodeGen/builtin-memfns.c
index 2700442..14ffbe9 100644
--- a/src/llvm-project/clang/test/CodeGen/builtin-memfns.c
+++ b/src/llvm-project/clang/test/CodeGen/builtin-memfns.c
@@ -4,6 +4,7 @@
typedef __SIZE_TYPE__ size_t;
void *memcpy(void *, void const *, size_t);
+void *memccpy(void *, void const *, int, size_t);
// CHECK: @test1
// CHECK: call void @llvm.memset.p0i8.i32
@@ -118,3 +119,9 @@
// CHECK: call void @llvm.memcpy{{.*}}(
memcpy(&dest_array, &dest_array, 2);
}
+
+// CHECK-LABEL: @test13
+void test13(char *d, char *s, int c, size_t n) {
+ // CHECK: call i8* @memccpy
+ memccpy(d, s, c, n);
+}
diff --git a/src/llvm-project/clang/test/CodeGen/builtin-preserve-access-index-array.c b/src/llvm-project/clang/test/CodeGen/builtin-preserve-access-index-array.c
new file mode 100644
index 0000000..a449b28
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/builtin-preserve-access-index-array.c
@@ -0,0 +1,18 @@
+// RUN: %clang -target x86_64 -emit-llvm -S -g %s -o - | FileCheck %s
+
+#define _(x) (__builtin_preserve_access_index(x))
+
+struct s1 {
+ char a;
+ int b[4];
+};
+
+const void *unit1(struct s1 *arg) {
+ return _(&arg->b[2]);
+}
+// CHECK: define dso_local i8* @unit1
+// CHECK: call [4 x i32]* @llvm.preserve.struct.access.index.p0a4i32.p0s_struct.s1s(%struct.s1* %{{[0-9a-z]+}}, i32 1, i32 1), !dbg !{{[0-9]+}}, !llvm.preserve.access.index ![[STRUCT_S1:[0-9]+]]
+// CHECK: call i32* @llvm.preserve.array.access.index.p0i32.p0a4i32([4 x i32]* %{{[0-9a-z]+}}, i32 1, i32 2), !dbg !{{[0-9]+}}, !llvm.preserve.access.index ![[ARRAY:[0-9]+]]
+//
+// CHECK: ![[ARRAY]] = !DICompositeType(tag: DW_TAG_array_type
+// CHECK: ![[STRUCT_S1]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "s1"
diff --git a/src/llvm-project/clang/test/CodeGen/builtin-preserve-access-index-nonptr.c b/src/llvm-project/clang/test/CodeGen/builtin-preserve-access-index-nonptr.c
new file mode 100644
index 0000000..bb8caf49
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/builtin-preserve-access-index-nonptr.c
@@ -0,0 +1,18 @@
+// RUN: %clang -target x86_64 -emit-llvm -S -g %s -o - | FileCheck %s
+
+#define _(x) (__builtin_preserve_access_index(x))
+
+struct s1 {
+ char a;
+ int b[4];
+};
+
+int unit1(struct s1 *arg) {
+ return _(arg->b[2]);
+}
+// CHECK: define dso_local i32 @unit1
+// CHECK: call [4 x i32]* @llvm.preserve.struct.access.index.p0a4i32.p0s_struct.s1s(%struct.s1* %{{[0-9a-z]+}}, i32 1, i32 1), !dbg !{{[0-9]+}}, !llvm.preserve.access.index ![[STRUCT_S1:[0-9]+]]
+// CHECK: call i32* @llvm.preserve.array.access.index.p0i32.p0a4i32([4 x i32]* %{{[0-9a-z]+}}, i32 1, i32 2), !dbg !{{[0-9]+}}, !llvm.preserve.access.index ![[ARRAY:[0-9]+]]
+//
+// CHECK: ![[ARRAY]] = !DICompositeType(tag: DW_TAG_array_type
+// CHECK: ![[STRUCT_S1]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "s1"
diff --git a/src/llvm-project/clang/test/CodeGen/builtin-preserve-access-index.c b/src/llvm-project/clang/test/CodeGen/builtin-preserve-access-index.c
index 954a3b8..1084416 100644
--- a/src/llvm-project/clang/test/CodeGen/builtin-preserve-access-index.c
+++ b/src/llvm-project/clang/test/CodeGen/builtin-preserve-access-index.c
@@ -31,16 +31,16 @@
}
// CHECK: define dso_local i8* @unit4
// CHECK-NOT: getelementptr
-// CHECK: call i32* @llvm.preserve.array.access.index.p0i32.p0i32(i32* %{{[0-9a-z]+}}, i32 0, i32 1)
+// CHECK: call i32* @llvm.preserve.array.access.index.p0i32.p0i32(i32* %{{[0-9a-z]+}}, i32 0, i32 1), !dbg !{{[0-9]+}}, !llvm.preserve.access.index ![[POINTER:[0-9]+]]
const void *unit5(const int *arg[5]) {
return _(&arg[1][2]);
}
// CHECK: define dso_local i8* @unit5
// CHECK-NOT: getelementptr
-// CHECK: call i32** @llvm.preserve.array.access.index.p0p0i32.p0p0i32(i32** %{{[0-9a-z]+}}, i32 0, i32 1)
+// CHECK: call i32** @llvm.preserve.array.access.index.p0p0i32.p0p0i32(i32** %{{[0-9a-z]+}}, i32 0, i32 1), !dbg !{{[0-9]+}}, !llvm.preserve.access.index !{{[0-9]+}}
// CHECK-NOT: getelementptr
-// CHECK: call i32* @llvm.preserve.array.access.index.p0i32.p0i32(i32* %{{[0-9a-z]+}}, i32 0, i32 2)
+// CHECK: call i32* @llvm.preserve.array.access.index.p0i32.p0i32(i32* %{{[0-9a-z]+}}, i32 0, i32 2), !dbg !{{[0-9]+}}, !llvm.preserve.access.index ![[POINTER:[0-9]+]]
struct s1 {
char a;
@@ -141,7 +141,7 @@
// CHECK: define dso_local i8* @unit13
// CHECK: call %union.u* @llvm.preserve.struct.access.index.p0s_union.us.p0s_struct.s4s(%struct.s4* %{{[0-9a-z]+}}, i32 1, i32 1), !dbg !{{[0-9]+}}, !llvm.preserve.access.index ![[STRUCT_S4:[0-9]+]]
// CHECK: call %union.u* @llvm.preserve.union.access.index.p0s_union.us.p0s_union.us(%union.u* %{{[0-9a-z]+}}, i32 0), !dbg !{{[0-9]+}}, !llvm.preserve.access.index ![[UNION_I_U:[0-9]+]]
-// CHECK: call i32* @llvm.preserve.array.access.index.p0i32.p0a4i32([4 x i32]* %{{[0-9a-z]+}}, i32 1, i32 2)
+// CHECK: call i32* @llvm.preserve.array.access.index.p0i32.p0a4i32([4 x i32]* %{{[0-9a-z]+}}, i32 1, i32 2), !dbg !{{[0-9]+}}, !llvm.preserve.access.index !{{[0-9]+}}
const void *unit14(union u3 *arg) {
return _(&arg->c.b[2]);
@@ -149,13 +149,13 @@
// CHECK: define dso_local i8* @unit14
// CHECK: call %union.u3* @llvm.preserve.union.access.index.p0s_union.u3s.p0s_union.u3s(%union.u3* %{{[0-9a-z]+}}, i32 0), !dbg !{{[0-9]+}}, !llvm.preserve.access.index ![[UNION_U3:[0-9]+]]
// CHECK: call [4 x i32]* @llvm.preserve.struct.access.index.p0a4i32.p0s_struct.ss(%struct.s* %{{[0-9a-z]+}}, i32 0, i32 0), !dbg !{{[0-9]+}}, !llvm.preserve.access.index ![[STRUCT_I_S:[0-9]+]]
-// CHECK: call i32* @llvm.preserve.array.access.index.p0i32.p0a4i32([4 x i32]* %{{[0-9a-z]+}}, i32 1, i32 2)
+// CHECK: call i32* @llvm.preserve.array.access.index.p0i32.p0a4i32([4 x i32]* %{{[0-9a-z]+}}, i32 1, i32 2), !dbg !{{[0-9]+}}, !llvm.preserve.access.index !{{[0-9]+}}
const void *unit15(struct s4 *arg) {
return _(&arg[2].c.a);
}
// CHECK: define dso_local i8* @unit15
-// CHECK: call %struct.s4* @llvm.preserve.array.access.index.p0s_struct.s4s.p0s_struct.s4s(%struct.s4* %{{[0-9a-z]+}}, i32 0, i32 2)
+// CHECK: call %struct.s4* @llvm.preserve.array.access.index.p0s_struct.s4s.p0s_struct.s4s(%struct.s4* %{{[0-9a-z]+}}, i32 0, i32 2), !dbg !{{[0-9]+}}, !llvm.preserve.access.index !{{[0-9]+}}
// CHECK: call %union.u* @llvm.preserve.struct.access.index.p0s_union.us.p0s_struct.s4s(%struct.s4* %{{[0-9a-z]+}}, i32 1, i32 1), !dbg !{{[0-9]+}}, !llvm.preserve.access.index ![[STRUCT_S4]]
// CHECK: call %union.u* @llvm.preserve.union.access.index.p0s_union.us.p0s_union.us(%union.u* %{{[0-9a-z]+}}, i32 1), !dbg !{{[0-9]+}}, !llvm.preserve.access.index ![[UNION_I_U]]
@@ -163,15 +163,16 @@
return _(&arg[2].a);
}
// CHECK: define dso_local i8* @unit16
-// CHECK: call %union.u3* @llvm.preserve.array.access.index.p0s_union.u3s.p0s_union.u3s(%union.u3* %{{[0-9a-z]+}}, i32 0, i32 2)
+// CHECK: call %union.u3* @llvm.preserve.array.access.index.p0s_union.u3s.p0s_union.u3s(%union.u3* %{{[0-9a-z]+}}, i32 0, i32 2), !dbg !{{[0-9]+}}, !llvm.preserve.access.index !{{[0-9]+}}
// CHECK: call %union.u3* @llvm.preserve.union.access.index.p0s_union.u3s.p0s_union.u3s(%union.u3* %{{[0-9a-z]+}}, i32 1), !dbg !{{[0-9]+}}, !llvm.preserve.access.index ![[UNION_U3]]
+// CHECK: ![[POINTER]] = !DIDerivedType(tag: DW_TAG_pointer_type
+// CHECK: ![[STRUCT_S4]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "s4"
+// CHECK: ![[UNION_I_U]] = distinct !DICompositeType(tag: DW_TAG_union_type, name: "u"
+// CHECK: ![[UNION_U3]] = distinct !DICompositeType(tag: DW_TAG_union_type, name: "u3"
+// CHECK: ![[STRUCT_I_S]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "s"
// CHECK: ![[STRUCT_S1]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "s1"
// CHECK: ![[STRUCT_S2]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "s2"
// CHECK: ![[STRUCT_S3]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "s3"
// CHECK: ![[UNION_U1]] = distinct !DICompositeType(tag: DW_TAG_union_type, name: "u1"
// CHECK: ![[UNION_U2]] = distinct !DICompositeType(tag: DW_TAG_union_type, name: "u2"
-// CHECK: ![[STRUCT_S4]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "s4"
-// CHECK: ![[UNION_I_U]] = distinct !DICompositeType(tag: DW_TAG_union_type, name: "u"
-// CHECK: ![[UNION_U3]] = distinct !DICompositeType(tag: DW_TAG_union_type, name: "u3"
-// CHECK: ![[STRUCT_I_S]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "s"
diff --git a/src/llvm-project/clang/test/CodeGen/builtin-sponentry.c b/src/llvm-project/clang/test/CodeGen/builtin-sponentry.c
index 0a85089..46bfa25 100644
--- a/src/llvm-project/clang/test/CodeGen/builtin-sponentry.c
+++ b/src/llvm-project/clang/test/CodeGen/builtin-sponentry.c
@@ -4,5 +4,5 @@
return __builtin_sponentry();
}
// CHECK-LABEL: define dso_local i8* @test_sponentry()
-// CHECK: = tail call i8* @llvm.sponentry()
+// CHECK: = tail call i8* @llvm.sponentry.p0i8()
// CHECK: ret i8*
diff --git a/src/llvm-project/clang/test/CodeGen/builtin_float.c b/src/llvm-project/clang/test/CodeGen/builtin_float.c
new file mode 100644
index 0000000..b257854
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/builtin_float.c
@@ -0,0 +1,81 @@
+// RUN: %clang_cc1 -emit-llvm -triple x86_64-windows-pc -o - %s | FileCheck %s --check-prefixes=CHECK,FP16
+// RUN: %clang_cc1 -emit-llvm -triple ppc64-be -o - %s -DNO_FP16 | FileCheck %s --check-prefixes=CHECK,NOFP16
+
+// test to ensure that these builtins don't do the variadic promotion of float->double.
+void test_floats(float f1, float f2) {
+ (void)__builtin_isgreater(f1, f2);
+ // CHECK: fcmp ogt float
+ // CHECK-NEXT: zext i1
+ (void)__builtin_isgreaterequal(f1, f2);
+ // CHECK: fcmp oge float
+ // CHECK-NEXT: zext i1
+ (void)__builtin_isless(f1, f2);
+ // CHECK: fcmp olt float
+ // CHECK-NEXT: zext i1
+ (void)__builtin_islessequal(f1, f2);
+ // CHECK: fcmp ole float
+ // CHECK-NEXT: zext i1
+ (void)__builtin_islessgreater(f1, f2);
+ // CHECK: fcmp one float
+ // CHECK-NEXT: zext i1
+ (void)__builtin_isunordered(f1, f2);
+ // CHECK: fcmp uno float
+ // CHECK-NEXT: zext i1
+}
+
+void test_doubles(double d1, double f2) {
+ (void)__builtin_isgreater(d1, f2);
+ // CHECK: fcmp ogt double
+ // CHECK-NEXT: zext i1
+ (void)__builtin_isgreaterequal(d1, f2);
+ // CHECK: fcmp oge double
+ // CHECK-NEXT: zext i1
+ (void)__builtin_isless(d1, f2);
+ // CHECK: fcmp olt double
+ // CHECK-NEXT: zext i1
+ (void)__builtin_islessequal(d1, f2);
+ // CHECK: fcmp ole double
+ // CHECK-NEXT: zext i1
+ (void)__builtin_islessgreater(d1, f2);
+ // CHECK: fcmp one double
+ // CHECK-NEXT: zext i1
+ (void)__builtin_isunordered(d1, f2);
+ // CHECK: fcmp uno double
+ // CHECK-NEXT: zext i1
+}
+
+void test_half(__fp16 *H, __fp16 *H2) {
+ (void)__builtin_isgreater(*H, *H2);
+ // CHECK: fcmp ogt float
+ // CHECK-NEXT: zext i1
+ (void)__builtin_isinf(*H);
+ // NOFP16: fcmp oeq float %{{.+}}, 0x7FF
+ // FP16: fcmp oeq half %{{.+}}, 0xH7C
+}
+
+void test_mixed(double d1, float f2) {
+ (void)__builtin_isgreater(d1, f2);
+ // CHECK: fpext float {{.*}} to double
+ // CHECK-NEXT: fcmp ogt double
+ // CHECK-NEXT: zext i1
+ (void)__builtin_isgreaterequal(d1, f2);
+ // CHECK: fpext float {{.*}} to double
+ // CHECK-NEXT: fcmp oge double
+ // CHECK-NEXT: zext i1
+ (void)__builtin_isless(d1, f2);
+ // CHECK: fpext float {{.*}} to double
+ // CHECK-NEXT: fcmp olt double
+ // CHECK-NEXT: zext i1
+ (void)__builtin_islessequal(d1, f2);
+ // CHECK: fpext float {{.*}} to double
+ // CHECK-NEXT: fcmp ole double
+ // CHECK-NEXT: zext i1
+ (void)__builtin_islessgreater(d1, f2);
+ // CHECK: fpext float {{.*}} to double
+ // CHECK-NEXT: fcmp one double
+ // CHECK-NEXT: zext i1
+ (void)__builtin_isunordered(d1, f2);
+ // CHECK: fpext float {{.*}} to double
+ // CHECK-NEXT: fcmp uno double
+ // CHECK-NEXT: zext i1
+}
diff --git a/src/llvm-project/clang/test/CodeGen/builtins-arm.c b/src/llvm-project/clang/test/CodeGen/builtins-arm.c
index 020f2b4..f3c4ecae 100644
--- a/src/llvm-project/clang/test/CodeGen/builtins-arm.c
+++ b/src/llvm-project/clang/test/CodeGen/builtins-arm.c
@@ -92,14 +92,13 @@
void prefetch(int i) {
__builtin_arm_prefetch(&i, 0, 1);
-// CHECK: call {{.*}} @llvm.prefetch(i8* %{{.*}}, i32 0, i32 3, i32 1)
+ // CHECK: call {{.*}} @llvm.prefetch.p0i8(i8* %{{.*}}, i32 0, i32 3, i32 1)
__builtin_arm_prefetch(&i, 1, 1);
-// CHECK: call {{.*}} @llvm.prefetch(i8* %{{.*}}, i32 1, i32 3, i32 1)
-
+ // CHECK: call {{.*}} @llvm.prefetch.p0i8(i8* %{{.*}}, i32 1, i32 3, i32 1)
__builtin_arm_prefetch(&i, 1, 0);
-// CHECK: call {{.*}} @llvm.prefetch(i8* %{{.*}}, i32 1, i32 3, i32 0)
+ // CHECK: call {{.*}} @llvm.prefetch.p0i8(i8* %{{.*}}, i32 1, i32 3, i32 0)
}
void ldc(const void *i) {
@@ -257,6 +256,21 @@
__builtin_arm_wsrp("sysreg", v);
}
+unsigned int cls(uint32_t v) {
+ // CHECK: call i32 @llvm.arm.cls(i32 %v)
+ return __builtin_arm_cls(v);
+}
+
+unsigned int clsl(unsigned long v) {
+ // CHECK: call i32 @llvm.arm.cls(i32 %v)
+ return __builtin_arm_cls(v);
+}
+
+unsigned int clsll(uint64_t v) {
+ // CHECK: call i32 @llvm.arm.cls64(i64 %v)
+ return __builtin_arm_cls64(v);
+}
+
// CHECK: ![[M0]] = !{!"cp1:2:c3:c4:5"}
// CHECK: ![[M1]] = !{!"cp1:2:c3"}
// CHECK: ![[M2]] = !{!"sysreg"}
diff --git a/src/llvm-project/clang/test/CodeGen/builtins-arm64.c b/src/llvm-project/clang/test/CodeGen/builtins-arm64.c
index 5ec63fb..f5cf997 100644
--- a/src/llvm-project/clang/test/CodeGen/builtins-arm64.c
+++ b/src/llvm-project/clang/test/CodeGen/builtins-arm64.c
@@ -1,5 +1,6 @@
// RUN: %clang_cc1 -triple arm64-unknown-linux -disable-O0-optnone -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-LINUX
// RUN: %clang_cc1 -triple aarch64-windows -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-WIN
+// RUN: %clang_cc1 -triple arm64_32-apple-ios13 -disable-O0-optnone -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
#include <stdint.h>
void f0(void *a, void *b) {
@@ -9,7 +10,7 @@
void *tp (void) {
return __builtin_thread_pointer ();
-// CHECK: call {{.*}} @llvm.thread.pointer()
+// CHECK-LINUX: call {{.*}} @llvm.thread.pointer()
}
// CHECK: call {{.*}} @llvm.bitreverse.i32(i32 %a)
@@ -46,16 +47,16 @@
void prefetch() {
__builtin_arm_prefetch(0, 1, 2, 0, 1); // pstl3keep
-// CHECK: call {{.*}} @llvm.prefetch(i8* null, i32 1, i32 1, i32 1)
+ // CHECK: call {{.*}} @llvm.prefetch.p0i8(i8* null, i32 1, i32 1, i32 1)
__builtin_arm_prefetch(0, 0, 0, 1, 1); // pldl1keep
-// CHECK: call {{.*}} @llvm.prefetch(i8* null, i32 0, i32 0, i32 1)
+ // CHECK: call {{.*}} @llvm.prefetch.p0i8(i8* null, i32 0, i32 0, i32 1)
__builtin_arm_prefetch(0, 0, 0, 1, 1); // pldl1strm
-// CHECK: call {{.*}} @llvm.prefetch(i8* null, i32 0, i32 0, i32 1)
+ // CHECK: call {{.*}} @llvm.prefetch.p0i8(i8* null, i32 0, i32 0, i32 1)
__builtin_arm_prefetch(0, 0, 0, 0, 0); // plil1keep
-// CHECK: call {{.*}} @llvm.prefetch(i8* null, i32 0, i32 3, i32 0)
+ // CHECK: call {{.*}} @llvm.prefetch.p0i8(i8* null, i32 0, i32 3, i32 0)
}
int32_t jcvt(double v) {
@@ -106,4 +107,21 @@
__builtin_arm_wsrp("1:2:3:4:5", v);
}
+unsigned int cls(uint32_t v) {
+ // CHECK: call i32 @llvm.aarch64.cls(i32 %v)
+ return __builtin_arm_cls(v);
+}
+
+unsigned int clsl(unsigned long v) {
+ // CHECK-WIN: [[V64:%[^ ]+]] = zext i32 %v to i64
+ // CHECK-WIN: call i32 @llvm.aarch64.cls64(i64 [[V64]]
+ // CHECK-LINUX: call i32 @llvm.aarch64.cls64(i64 %v)
+ return __builtin_arm_cls64(v);
+}
+
+unsigned int clsll(uint64_t v) {
+ // CHECK: call i32 @llvm.aarch64.cls64(i64 %v)
+ return __builtin_arm_cls64(v);
+}
+
// CHECK: ![[M0]] = !{!"1:2:3:4:5"}
diff --git a/src/llvm-project/clang/test/CodeGen/builtins-bpf-preserve-field-info-1.c b/src/llvm-project/clang/test/CodeGen/builtins-bpf-preserve-field-info-1.c
new file mode 100644
index 0000000..a244bd1
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/builtins-bpf-preserve-field-info-1.c
@@ -0,0 +1,35 @@
+// REQUIRES: bpf-registered-target
+// RUN: %clang -target bpf -emit-llvm -S -g %s -o - | FileCheck %s
+
+#define _(x, y) (__builtin_preserve_field_info((x), (y)))
+
+struct s1 {
+ char a;
+ char b:2;
+};
+
+union u1 {
+ char a;
+ char b:2;
+};
+
+unsigned unit1(struct s1 *arg) {
+ return _(arg->a, 10) + _(arg->b, 10);
+}
+// CHECK: define dso_local i32 @unit1
+// CHECK: call i8* @llvm.preserve.struct.access.index.p0i8.p0s_struct.s1s(%struct.s1* %{{[0-9a-z]+}}, i32 0, i32 0), !dbg !{{[0-9]+}}, !llvm.preserve.access.index ![[STRUCT_S1:[0-9]+]]
+// CHECK: call i32 @llvm.bpf.preserve.field.info.p0i8(i8* %{{[0-9a-z]+}}, i64 10), !dbg !{{[0-9]+}}
+// CHECK: call i8* @llvm.preserve.struct.access.index.p0i8.p0s_struct.s1s(%struct.s1* %{{[0-9a-z]+}}, i32 1, i32 1), !dbg !{{[0-9]+}}, !llvm.preserve.access.index ![[STRUCT_S1:[0-9]+]]
+// CHECK: call i32 @llvm.bpf.preserve.field.info.p0i8(i8* %{{[0-9a-z]+}}, i64 10), !dbg !{{[0-9]+}}
+
+unsigned unit2(union u1 *arg) {
+ return _(arg->a, 10) + _(arg->b, 10);
+}
+// CHECK: define dso_local i32 @unit2
+// CHECK: call %union.u1* @llvm.preserve.union.access.index.p0s_union.u1s.p0s_union.u1s(%union.u1* %{{[0-9a-z]+}}, i32 0), !dbg !{{[0-9]+}}, !llvm.preserve.access.index ![[UNION_U1:[0-9]+]]
+// CHECK: call i32 @llvm.bpf.preserve.field.info.p0i8(i8* %{{[0-9a-z]+}}, i64 10), !dbg !{{[0-9]+}}
+// CHECK: call i8* @llvm.preserve.struct.access.index.p0i8.p0s_union.u1s(%union.u1* %{{[0-9a-z]+}}, i32 0, i32 1), !dbg !{{[0-9]+}}, !llvm.preserve.access.index ![[UNION_U1:[0-9]+]]
+// CHECK: call i32 @llvm.bpf.preserve.field.info.p0i8(i8* %{{[0-9a-z]+}}, i64 10), !dbg !{{[0-9]+}}
+
+// CHECK: ![[STRUCT_S1]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "s1"
+// CHECK: ![[UNION_U1]] = distinct !DICompositeType(tag: DW_TAG_union_type, name: "u1"
diff --git a/src/llvm-project/clang/test/CodeGen/builtins-bpf-preserve-field-info-2.c b/src/llvm-project/clang/test/CodeGen/builtins-bpf-preserve-field-info-2.c
new file mode 100644
index 0000000..f50c997
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/builtins-bpf-preserve-field-info-2.c
@@ -0,0 +1,26 @@
+// REQUIRES: bpf-registered-target
+// RUN: %clang -target bpf -emit-llvm -S -g %s -o - | FileCheck %s
+
+#define _(x, y) (__builtin_preserve_field_info((x), (y)))
+
+struct s1 {
+ char a;
+ char b:2;
+};
+struct s2 {
+ struct s1 s;
+};
+
+unsigned unit1(struct s2 *arg) {
+ return _(arg->s.a, 10) + _(arg->s.b, 10);
+}
+// CHECK: define dso_local i32 @unit1
+// CHECK: call %struct.s1* @llvm.preserve.struct.access.index.p0s_struct.s1s.p0s_struct.s2s(%struct.s2* %{{[0-9a-z]+}}, i32 0, i32 0), !dbg !{{[0-9]+}}, !llvm.preserve.access.index ![[STRUCT_S2:[0-9]+]]
+// CHECK: call i8* @llvm.preserve.struct.access.index.p0i8.p0s_struct.s1s(%struct.s1* %{{[0-9a-z]+}}, i32 0, i32 0), !dbg !{{[0-9]+}}, !llvm.preserve.access.index ![[STRUCT_S1:[0-9]+]]
+// CHECK: call i32 @llvm.bpf.preserve.field.info.p0i8(i8* %{{[0-9a-z]+}}, i64 10), !dbg !{{[0-9]+}}
+// CHECK: call %struct.s1* @llvm.preserve.struct.access.index.p0s_struct.s1s.p0s_struct.s2s(%struct.s2* %{{[0-9a-z]+}}, i32 0, i32 0), !dbg !{{[0-9]+}}, !llvm.preserve.access.index ![[STRUCT_S2:[0-9]+]]
+// CHECK: call i8* @llvm.preserve.struct.access.index.p0i8.p0s_struct.s1s(%struct.s1* %{{[0-9a-z]+}}, i32 1, i32 1), !dbg !{{[0-9]+}}, !llvm.preserve.access.index ![[STRUCT_S1:[0-9]+]]
+// CHECK: call i32 @llvm.bpf.preserve.field.info.p0i8(i8* %{{[0-9a-z]+}}, i64 10), !dbg !{{[0-9]+}}
+
+// CHECK: ![[STRUCT_S2]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "s2"
+// CHECK: ![[STRUCT_S1]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "s1"
diff --git a/src/llvm-project/clang/test/CodeGen/builtins-mips-args.c b/src/llvm-project/clang/test/CodeGen/builtins-mips-args.c
index cdb42af..a135848 100644
--- a/src/llvm-project/clang/test/CodeGen/builtins-mips-args.c
+++ b/src/llvm-project/clang/test/CodeGen/builtins-mips-args.c
@@ -1,5 +1,6 @@
// REQUIRES: mips-registered-target
-// RUN: %clang_cc1 -triple mips-unknown-linux-gnu -fsyntax-only -verify %s
+// RUN: %clang_cc1 -triple mips-unknown-linux-gnu -target-feature +dspr2 \
+// RUN: -fsyntax-only -verify %s
void foo() {
// MIPS DSP Rev 1
diff --git a/src/llvm-project/clang/test/CodeGen/builtins-mips.c b/src/llvm-project/clang/test/CodeGen/builtins-mips.c
index c6be896..d26f630 100644
--- a/src/llvm-project/clang/test/CodeGen/builtins-mips.c
+++ b/src/llvm-project/clang/test/CodeGen/builtins-mips.c
@@ -1,5 +1,6 @@
// REQUIRES: mips-registered-target
-// RUN: %clang_cc1 -triple mips-unknown-linux-gnu -emit-llvm %s -o - \
+// RUN: %clang_cc1 -triple mips-unknown-linux-gnu -emit-llvm %s \
+// RUN: -target-feature +dspr2 -o - \
// RUN: | FileCheck %s
typedef int q31;
diff --git a/src/llvm-project/clang/test/CodeGen/builtins-ppc-altivec.c b/src/llvm-project/clang/test/CodeGen/builtins-ppc-altivec.c
index e7ba716..d53011b 100644
--- a/src/llvm-project/clang/test/CodeGen/builtins-ppc-altivec.c
+++ b/src/llvm-project/clang/test/CodeGen/builtins-ppc-altivec.c
@@ -1,10 +1,10 @@
// REQUIRES: powerpc-registered-target
// RUN: %clang_cc1 -target-feature +altivec -triple powerpc-unknown-unknown -emit-llvm %s \
-// RUN: -o - | FileCheck %s
+// RUN: -flax-vector-conversions=none -o - | FileCheck %s
// RUN: %clang_cc1 -target-feature +altivec -triple powerpc64-unknown-unknown -emit-llvm %s \
-// RUN: -o - | FileCheck %s
+// RUN: -flax-vector-conversions=none -o - | FileCheck %s
// RUN: %clang_cc1 -target-feature +altivec -triple powerpc64le-unknown-unknown -emit-llvm %s \
-// RUN: -o - | FileCheck %s -check-prefix=CHECK-LE
+// RUN: -flax-vector-conversions=none -o - | FileCheck %s -check-prefix=CHECK-LE
// RUN: not %clang_cc1 -triple powerpc64le-unknown-unknown -emit-llvm %s \
// RUN: -ferror-limit 0 -DNO_ALTIVEC -o - 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK-NOALTIVEC
@@ -2419,7 +2419,7 @@
// CHECK-LE: or <16 x i8>
// CHECK-LE: xor <16 x i8>
- res_vuc = vec_nor(vbc, vbc);
+ res_vbc = vec_nor(vbc, vbc);
// CHECK: or <16 x i8>
// CHECK: xor <16 x i8>
// CHECK-LE: or <16 x i8>
@@ -2437,7 +2437,7 @@
// CHECK-LE: or <8 x i16>
// CHECK-LE: xor <8 x i16>
- res_vus = vec_nor(vbs, vbs);
+ res_vbs = vec_nor(vbs, vbs);
// CHECK: or <8 x i16>
// CHECK: xor <8 x i16>
// CHECK-LE: or <8 x i16>
@@ -2455,7 +2455,7 @@
// CHECK-LE: or <4 x i32>
// CHECK-LE: xor <4 x i32>
- res_vui = vec_nor(vbi, vbi);
+ res_vbi = vec_nor(vbi, vbi);
// CHECK: or <4 x i32>
// CHECK: xor <4 x i32>
// CHECK-LE: or <4 x i32>
@@ -2479,7 +2479,7 @@
// CHECK-LE: or <16 x i8>
// CHECK-LE: xor <16 x i8>
- res_vuc = vec_vnor(vbc, vbc);
+ res_vbc = vec_vnor(vbc, vbc);
// CHECK: or <16 x i8>
// CHECK: xor <16 x i8>
// CHECK-LE: or <16 x i8>
@@ -2497,7 +2497,7 @@
// CHECK-LE: or <8 x i16>
// CHECK-LE: xor <8 x i16>
- res_vus = vec_vnor(vbs, vbs);
+ res_vbs = vec_vnor(vbs, vbs);
// CHECK: or <8 x i16>
// CHECK: xor <8 x i16>
// CHECK-LE: or <8 x i16>
@@ -2515,7 +2515,7 @@
// CHECK-LE: or <4 x i32>
// CHECK-LE: xor <4 x i32>
- res_vui = vec_vnor(vbi, vbi);
+ res_vbi = vec_vnor(vbi, vbi);
// CHECK: or <4 x i32>
// CHECK: xor <4 x i32>
// CHECK-LE: or <4 x i32>
@@ -5385,11 +5385,11 @@
// CHECK: sub <8 x i16>
// CHECK-LE: sub <8 x i16>
- res_vs = vec_vsubuhm(vbs, vus);
+ res_vs = vec_vsubuhm(vbs, vs);
// CHECK: sub <8 x i16>
// CHECK-LE: sub <8 x i16>
- res_vs = vec_vsubuhm(vus, vbs);
+ res_vs = vec_vsubuhm(vs, vbs);
// CHECK: sub <8 x i16>
// CHECK-LE: sub <8 x i16>
@@ -9251,11 +9251,11 @@
// CHECK: shufflevector <8 x i16> %{{[0-9]+}}, <8 x i16> %{{[0-9]+}}, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
// CHECK-LE: shufflevector <8 x i16> %{{[0-9]+}}, <8 x i16> %{{[0-9]+}}, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
- res_vbs = vec_reve(vs);
+ res_vs = vec_reve(vs);
// CHECK: shufflevector <8 x i16> %{{[0-9]+}}, <8 x i16> %{{[0-9]+}}, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
// CHECK-LE: shufflevector <8 x i16> %{{[0-9]+}}, <8 x i16> %{{[0-9]+}}, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
- res_vbs = vec_reve(vus);
+ res_vus = vec_reve(vus);
// CHECK: shufflevector <8 x i16> %{{[0-9]+}}, <8 x i16> %{{[0-9]+}}, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
// CHECK-LE: shufflevector <8 x i16> %{{[0-9]+}}, <8 x i16> %{{[0-9]+}}, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
diff --git a/src/llvm-project/clang/test/CodeGen/builtins-ppc-error.c b/src/llvm-project/clang/test/CodeGen/builtins-ppc-error.c
index a50dc2c..80ca227 100644
--- a/src/llvm-project/clang/test/CodeGen/builtins-ppc-error.c
+++ b/src/llvm-project/clang/test/CodeGen/builtins-ppc-error.c
@@ -2,10 +2,19 @@
// RUN: %clang_cc1 -target-feature +altivec -target-feature +power9-vector \
// RUN: -triple powerpc64-unknown-unknown -fsyntax-only \
+// RUN: -flax-vector-conversions=integer \
// RUN: -Wall -Werror -verify %s
// RUN: %clang_cc1 -target-feature +altivec -target-feature +power9-vector \
// RUN: -triple powerpc64le-unknown-unknown -fsyntax-only \
+// RUN: -flax-vector-conversions=integer \
+// RUN: -Wall -Werror -verify %s
+
+// FIXME: Fix <altivec.h> so this test also passes under
+// -flax-vector-conversions=none (this last test exists to produce an error if
+// we change the default to that without fixing <altivec.h>).
+// RUN: %clang_cc1 -target-feature +altivec -target-feature +power9-vector \
+// RUN: -triple powerpc64-unknown-unknown -fsyntax-only \
// RUN: -Wall -Werror -verify %s
#include <altivec.h>
@@ -73,3 +82,19 @@
__builtin_unpack_vector_int128(vsllli, index); //expected-error {{argument to '__builtin_unpack_vector_int128' must be a constant integer}}
__builtin_unpack_vector_int128(vsllli, 5); //expected-error {{argument value 5 is outside the valid range [0, 1]}}
}
+
+void testDSS(int index) {
+ vec_dss(index); //expected-error {{argument to '__builtin_altivec_dss' must be a constant integer}}
+ vec_dss(5); //expected-error {{argument value 5 is outside the valid range [0, 3]}}
+}
+
+void testDST(int index) {
+ vec_dst(&vsi, index, index); //expected-error {{argument to '__builtin_altivec_dst' must be a constant integer}}
+ vec_dst(&vsi, index, 5); //expected-error {{argument value 5 is outside the valid range [0, 3]}}
+ vec_dstt(&vsi, index, index); //expected-error {{argument to '__builtin_altivec_dstt' must be a constant integer}}
+ vec_dstt(&vsi, index, 5); //expected-error {{argument value 5 is outside the valid range [0, 3]}}
+ vec_dstst(&vsi, index, index); //expected-error {{argument to '__builtin_altivec_dstst' must be a constant integer}}
+ vec_dstst(&vsi, index, 5); //expected-error {{argument value 5 is outside the valid range [0, 3]}}
+ vec_dststt(&vsi, index, index); //expected-error {{argument to '__builtin_altivec_dststt' must be a constant integer}}
+ vec_dststt(&vsi, index, 5); //expected-error {{argument value 5 is outside the valid range [0, 3]}}
+}
diff --git a/src/llvm-project/clang/test/CodeGen/builtins-ppc-p8vector.c b/src/llvm-project/clang/test/CodeGen/builtins-ppc-p8vector.c
index a686b0a..d494e46 100644
--- a/src/llvm-project/clang/test/CodeGen/builtins-ppc-p8vector.c
+++ b/src/llvm-project/clang/test/CodeGen/builtins-ppc-p8vector.c
@@ -469,6 +469,10 @@
// CHECK: @llvm.ppc.vsx.xvcmpeqdp.p
// CHECK-LE: @llvm.ppc.vsx.xvcmpeqdp.p
+ res_i = vec_all_eq(vfa, vfa);
+// CHECK: @llvm.ppc.vsx.xvcmpeqsp.p
+// CHECK-LE: @llvm.ppc.vsx.xvcmpeqsp.p
+
/* vec_all_ne */
res_i = vec_all_ne(vsll, vsll);
// CHECK: @llvm.ppc.altivec.vcmpequd.p
@@ -515,6 +519,13 @@
dummy();
// CHECK: @dummy
+ res_i = vec_all_ne(vfa, vfa);
+// CHECK: @llvm.ppc.vsx.xvcmpeqsp.p
+// CHECK-LE: @llvm.ppc.vsx.xvcmpeqsp.p
+
+ dummy();
+// CHECK: @dummy
+
res_i = vec_all_nge(vda, vda);
// CHECK: @llvm.ppc.vsx.xvcmpgedp.p
// CHECK-LE: @llvm.ppc.vsx.xvcmpgedp.p
@@ -563,6 +574,10 @@
// CHECK: @llvm.ppc.vsx.xvcmpeqdp.p
// CHECK-LE: @llvm.ppc.vsx.xvcmpeqdp.p
+ res_i = vec_any_eq(vfa, vfa);
+// CHECK: @llvm.ppc.vsx.xvcmpeqsp.p
+// CHECK-LE: @llvm.ppc.vsx.xvcmpeqsp.p
+
/* vec_any_ne */
res_i = vec_any_ne(vsll, vsll);
// CHECK: @llvm.ppc.altivec.vcmpequd.p
@@ -603,6 +618,10 @@
// CHECK: @llvm.ppc.vsx.xvcmpeqdp.p
// CHECK-LE: @llvm.ppc.vsx.xvcmpeqdp.p
+ res_i = vec_any_ne(vfa, vfa);
+// CHECK: @llvm.ppc.vsx.xvcmpeqsp.p
+// CHECK-LE: @llvm.ppc.vsx.xvcmpeqsp.p
+
/* vec_all_ge */
res_i = vec_all_ge(vsll, vsll);
// CHECK: @llvm.ppc.altivec.vcmpgtsd.p
@@ -643,6 +662,10 @@
// CHECK: @llvm.ppc.vsx.xvcmpgedp.p
// CHECK-LE: @llvm.ppc.vsx.xvcmpgedp.p
+ res_i = vec_all_ge(vfa, vfa);
+// CHECK: @llvm.ppc.vsx.xvcmpgesp.p
+// CHECK-LE: @llvm.ppc.vsx.xvcmpgesp.p
+
/* vec_all_gt */
res_i = vec_all_gt(vsll, vsll);
// CHECK: @llvm.ppc.altivec.vcmpgtsd.p
@@ -683,6 +706,10 @@
// CHECK: @llvm.ppc.vsx.xvcmpgtdp.p
// CHECK-LE: @llvm.ppc.vsx.xvcmpgtdp.p
+ res_i = vec_all_gt(vfa, vfa);
+// CHECK: @llvm.ppc.vsx.xvcmpgtsp.p
+// CHECK-LE: @llvm.ppc.vsx.xvcmpgtsp.p
+
/* vec_all_le */
res_i = vec_all_le(vsll, vsll);
// CHECK: @llvm.ppc.altivec.vcmpgtsd.p
@@ -723,6 +750,10 @@
// CHECK: @llvm.ppc.vsx.xvcmpgedp.p
// CHECK-LE: @llvm.ppc.vsx.xvcmpgedp.p
+ res_i = vec_all_le(vfa, vfa);
+// CHECK: @llvm.ppc.vsx.xvcmpgesp.p
+// CHECK-LE: @llvm.ppc.vsx.xvcmpgesp.p
+
/* vec_all_lt */
res_i = vec_all_lt(vsll, vsll);
// CHECK: @llvm.ppc.altivec.vcmpgtsd.p
@@ -763,10 +794,18 @@
// CHECK: @llvm.ppc.vsx.xvcmpgtdp.p
// CHECK-LE: @llvm.ppc.vsx.xvcmpgtdp.p
+ res_i = vec_all_lt(vfa, vfa);
+// CHECK: @llvm.ppc.vsx.xvcmpgtsp.p
+// CHECK-LE: @llvm.ppc.vsx.xvcmpgtsp.p
+
res_i = vec_all_nan(vda);
// CHECK: @llvm.ppc.vsx.xvcmpeqdp.p
// CHECK-LE: @llvm.ppc.vsx.xvcmpeqdp.p
+ res_i = vec_all_nan(vfa);
+// CHECK: @llvm.ppc.vsx.xvcmpeqsp.p
+// CHECK-LE: @llvm.ppc.vsx.xvcmpeqsp.p
+
/* vec_any_ge */
res_i = vec_any_ge(vsll, vsll);
// CHECK: @llvm.ppc.altivec.vcmpgtsd.p
@@ -807,6 +846,10 @@
// CHECK: @llvm.ppc.vsx.xvcmpgedp.p
// CHECK-LE: @llvm.ppc.vsx.xvcmpgedp.p
+ res_i = vec_any_ge(vfa, vfa);
+// CHECK: @llvm.ppc.vsx.xvcmpgesp.p
+// CHECK-LE: @llvm.ppc.vsx.xvcmpgesp.p
+
/* vec_any_gt */
res_i = vec_any_gt(vsll, vsll);
// CHECK: @llvm.ppc.altivec.vcmpgtsd.p
@@ -887,6 +930,10 @@
// CHECK: @llvm.ppc.vsx.xvcmpgedp.p
// CHECK-LE: @llvm.ppc.vsx.xvcmpgedp.p
+ res_i = vec_any_le(vfa, vfa);
+// CHECK: @llvm.ppc.vsx.xvcmpgesp.p
+// CHECK-LE: @llvm.ppc.vsx.xvcmpgesp.p
+
/* vec_any_lt */
res_i = vec_any_lt(vsll, vsll);
// CHECK: @llvm.ppc.altivec.vcmpgtsd.p
@@ -927,6 +974,10 @@
// CHECK: @llvm.ppc.vsx.xvcmpgtdp.p
// CHECK-LE: @llvm.ppc.vsx.xvcmpgtdp.p
+ res_i = vec_any_lt(vfa, vfa);
+// CHECK: @llvm.ppc.vsx.xvcmpgtsp.p
+// CHECK-LE: @llvm.ppc.vsx.xvcmpgtsp.p
+
/* vec_max */
res_vsll = vec_max(vsll, vsll);
// CHECK: @llvm.ppc.altivec.vmaxsd
@@ -1309,6 +1360,12 @@
// CHECK-LE: [[T1:%.+]] = and <2 x i64>
// CHECK-LE: xor <2 x i64> [[T1]], <i64 -1, i64 -1>
+ res_vf = vec_nand(vfa, vfa);
+// CHECK: [[T1:%.+]] = and <4 x i32>
+// CHECK: xor <4 x i32> [[T1]], <i32 -1, i32 -1, i32 -1, i32 -1>
+// CHECK-LE: [[T1:%.+]] = and <4 x i32>
+// CHECK-LE: xor <4 x i32> [[T1]], <i32 -1, i32 -1, i32 -1, i32 -1>
+
/* vec_orc */
res_vsc = vec_orc(vsc, vsc);
// CHECK: [[T1:%.+]] = xor <16 x i8> {{%.+}}, <i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1>
diff --git a/src/llvm-project/clang/test/CodeGen/builtins-ppc-p9vector.c b/src/llvm-project/clang/test/CodeGen/builtins-ppc-p9vector.c
index bfbb815..e920cb7 100644
--- a/src/llvm-project/clang/test/CodeGen/builtins-ppc-p9vector.c
+++ b/src/llvm-project/clang/test/CodeGen/builtins-ppc-p9vector.c
@@ -1,12 +1,20 @@
// REQUIRES: powerpc-registered-target
// RUN: %clang_cc1 -target-feature +altivec -target-feature +power9-vector \
// RUN: -triple powerpc64-unknown-unknown -emit-llvm %s \
+// RUN: -flax-vector-conversions=integer \
// RUN: -o - | FileCheck %s -check-prefix=CHECK-BE
// RUN: %clang_cc1 -target-feature +altivec -target-feature +power9-vector \
// RUN: -triple powerpc64le-unknown-unknown -emit-llvm %s \
+// RUN: -flax-vector-conversions=integer \
// RUN: -o - | FileCheck %s
+// FIXME: This last test is intended to fail if the default is changed to
+// -flax-vector-conversions=none and <altivec.h> isn't fixed first.
+// RUN: %clang_cc1 -target-feature +altivec -target-feature +power9-vector \
+// RUN: -triple powerpc64-unknown-unknown -emit-llvm %s \
+// RUN: -o - | FileCheck %s -check-prefix=CHECK-BE
+
#include <altivec.h>
vector signed char vsca, vscb;
@@ -919,7 +927,7 @@
// CHECK: insertelement <2 x double>
return vec_unpackl(vfa);
}
-vector double test81(void) {
+vector float test81(void) {
// CHECK: extractelement <2 x double>
// CHECK: fptrunc double
// CHECK: insertelement <4 x float>
diff --git a/src/llvm-project/clang/test/CodeGen/builtins-ppc-vsx.c b/src/llvm-project/clang/test/CodeGen/builtins-ppc-vsx.c
index 838d94c..a19e755 100644
--- a/src/llvm-project/clang/test/CodeGen/builtins-ppc-vsx.c
+++ b/src/llvm-project/clang/test/CodeGen/builtins-ppc-vsx.c
@@ -77,11 +77,11 @@
res_vf = vec_nabs(vf);
// CHECK: [[VEC:%[0-9]+]] = call <4 x float> @llvm.fabs.v4f32(<4 x float> %{{[0-9]*}})
-// CHECK-NEXT: fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, [[VEC]]
+// CHECK-NEXT: fneg <4 x float> [[VEC]]
res_vd = vec_nabs(vd);
// CHECK: [[VECD:%[0-9]+]] = call <2 x double> @llvm.fabs.v2f64(<2 x double> %{{[0-9]*}})
-// CHECK: fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, [[VECD]]
+// CHECK: fneg <2 x double> [[VECD]]
dummy();
// CHECK: call void @dummy()
@@ -882,7 +882,7 @@
// CHECK: call void @dummy()
// CHECK-LE: call void @dummy()
- res_vf = vec_sel(vd, vd, vbll);
+ res_vd = vec_sel(vd, vd, vbll);
// CHECK: xor <2 x i64> %{{[0-9]+}}, <i64 -1, i64 -1>
// CHECK: and <2 x i64> %{{[0-9]+}},
// CHECK: and <2 x i64> %{{[0-9]+}}, %{{[0-9]+}}
@@ -1686,12 +1686,12 @@
// CHECK-LE: call void @llvm.ppc.vsx.stxvd2x.be(<2 x double> %{{[0-9]+}}, i8* %{{[0-9]+}})
res_vf = vec_neg(vf);
-// CHECK: fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, {{%[0-9]+}}
-// CHECK-LE: fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, {{%[0-9]+}}
+// CHECK: fneg <4 x float> {{%[0-9]+}}
+// CHECK-LE: fneg <4 x float> {{%[0-9]+}}
res_vd = vec_neg(vd);
-// CHECK: fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, {{%[0-9]+}}
-// CHECK-LE: fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, {{%[0-9]+}}
+// CHECK: fneg <2 x double> {{%[0-9]+}}
+// CHECK-LE: fneg <2 x double> {{%[0-9]+}}
res_vd = vec_xxpermdi(vd, vd, 0);
// CHECK: shufflevector <2 x i64> %{{[0-9]+}}, <2 x i64> %{{[0-9]+}}, <2 x i32> <i32 0, i32 2>
diff --git a/src/llvm-project/clang/test/CodeGen/builtins-ppc-xl-xst.c b/src/llvm-project/clang/test/CodeGen/builtins-ppc-xl-xst.c
new file mode 100644
index 0000000..8ad4537
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/builtins-ppc-xl-xst.c
@@ -0,0 +1,490 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// REQUIRES: powerpc-registered-target
+// RUN: %clang_cc1 -target-feature +altivec -target-feature +vsx \
+// RUN: -triple powerpc64-unknown-unknown -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -target-feature +altivec -target-feature +vsx \
+// RUN: -target-feature +power8-vector -triple powerpc64le-unknown-unknown \
+// RUN: -emit-llvm %s -o - | FileCheck %s -check-prefixes=CHECK,CHECK-P8
+#include <altivec.h>
+
+// CHECK-LABEL: @test1(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[__VEC_ADDR_I:%.*]] = alloca <8 x i16>, align 16
+// CHECK-NEXT: [[__OFFSET_ADDR_I1:%.*]] = alloca i64, align 8
+// CHECK-NEXT: [[__PTR_ADDR_I2:%.*]] = alloca i16*, align 8
+// CHECK-NEXT: [[__ADDR_I3:%.*]] = alloca i8*, align 8
+// CHECK-NEXT: [[__OFFSET_ADDR_I:%.*]] = alloca i64, align 8
+// CHECK-NEXT: [[__PTR_ADDR_I:%.*]] = alloca i16*, align 8
+// CHECK-NEXT: [[__ADDR_I:%.*]] = alloca i8*, align 8
+// CHECK-NEXT: [[C_ADDR:%.*]] = alloca <8 x i16>*, align 8
+// CHECK-NEXT: [[PTR_ADDR:%.*]] = alloca i16*, align 8
+// CHECK-NEXT: store <8 x i16>* [[C:%.*]], <8 x i16>** [[C_ADDR]], align 8
+// CHECK-NEXT: store i16* [[PTR:%.*]], i16** [[PTR_ADDR]], align 8
+// CHECK-NEXT: [[TMP0:%.*]] = load i16*, i16** [[PTR_ADDR]], align 8
+// CHECK-NEXT: store i64 3, i64* [[__OFFSET_ADDR_I]], align 8
+// CHECK-NEXT: store i16* [[TMP0]], i16** [[__PTR_ADDR_I]], align 8
+// CHECK-NEXT: [[TMP1:%.*]] = load i16*, i16** [[__PTR_ADDR_I]], align 8
+// CHECK-NEXT: [[TMP2:%.*]] = bitcast i16* [[TMP1]] to i8*
+// CHECK-NEXT: [[TMP3:%.*]] = load i64, i64* [[__OFFSET_ADDR_I]], align 8
+// CHECK-NEXT: [[ADD_PTR_I:%.*]] = getelementptr inbounds i8, i8* [[TMP2]], i64 [[TMP3]]
+// CHECK-NEXT: store i8* [[ADD_PTR_I]], i8** [[__ADDR_I]], align 8
+// CHECK-NEXT: [[TMP4:%.*]] = load i8*, i8** [[__ADDR_I]], align 8
+// CHECK-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP4]] to <8 x i16>*
+// CHECK-NEXT: [[TMP6:%.*]] = load <8 x i16>, <8 x i16>* [[TMP5]], align 1
+// CHECK-NEXT: [[TMP7:%.*]] = load <8 x i16>*, <8 x i16>** [[C_ADDR]], align 8
+// CHECK-NEXT: store <8 x i16> [[TMP6]], <8 x i16>* [[TMP7]], align 16
+// CHECK-NEXT: [[TMP8:%.*]] = load <8 x i16>*, <8 x i16>** [[C_ADDR]], align 8
+// CHECK-NEXT: [[TMP9:%.*]] = load <8 x i16>, <8 x i16>* [[TMP8]], align 16
+// CHECK-NEXT: [[TMP10:%.*]] = load i16*, i16** [[PTR_ADDR]], align 8
+// CHECK-NEXT: store <8 x i16> [[TMP9]], <8 x i16>* [[__VEC_ADDR_I]], align 16
+// CHECK-NEXT: store i64 7, i64* [[__OFFSET_ADDR_I1]], align 8
+// CHECK-NEXT: store i16* [[TMP10]], i16** [[__PTR_ADDR_I2]], align 8
+// CHECK-NEXT: [[TMP11:%.*]] = load i16*, i16** [[__PTR_ADDR_I2]], align 8
+// CHECK-NEXT: [[TMP12:%.*]] = bitcast i16* [[TMP11]] to i8*
+// CHECK-NEXT: [[TMP13:%.*]] = load i64, i64* [[__OFFSET_ADDR_I1]], align 8
+// CHECK-NEXT: [[ADD_PTR_I4:%.*]] = getelementptr inbounds i8, i8* [[TMP12]], i64 [[TMP13]]
+// CHECK-NEXT: store i8* [[ADD_PTR_I4]], i8** [[__ADDR_I3]], align 8
+// CHECK-NEXT: [[TMP14:%.*]] = load <8 x i16>, <8 x i16>* [[__VEC_ADDR_I]], align 16
+// CHECK-NEXT: [[TMP15:%.*]] = load i8*, i8** [[__ADDR_I3]], align 8
+// CHECK-NEXT: [[TMP16:%.*]] = bitcast i8* [[TMP15]] to <8 x i16>*
+// CHECK-NEXT: store <8 x i16> [[TMP14]], <8 x i16>* [[TMP16]], align 1
+// CHECK-NEXT: ret void
+//
+void test1(vector signed short *c, signed short *ptr) {
+ *c = vec_xl(3ll, ptr);
+ vec_xst(*c, 7ll, ptr);
+}
+
+// CHECK-LABEL: @test2(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[__VEC_ADDR_I:%.*]] = alloca <8 x i16>, align 16
+// CHECK-NEXT: [[__OFFSET_ADDR_I1:%.*]] = alloca i64, align 8
+// CHECK-NEXT: [[__PTR_ADDR_I2:%.*]] = alloca i16*, align 8
+// CHECK-NEXT: [[__ADDR_I3:%.*]] = alloca i8*, align 8
+// CHECK-NEXT: [[__OFFSET_ADDR_I:%.*]] = alloca i64, align 8
+// CHECK-NEXT: [[__PTR_ADDR_I:%.*]] = alloca i16*, align 8
+// CHECK-NEXT: [[__ADDR_I:%.*]] = alloca i8*, align 8
+// CHECK-NEXT: [[C_ADDR:%.*]] = alloca <8 x i16>*, align 8
+// CHECK-NEXT: [[PTR_ADDR:%.*]] = alloca i16*, align 8
+// CHECK-NEXT: store <8 x i16>* [[C:%.*]], <8 x i16>** [[C_ADDR]], align 8
+// CHECK-NEXT: store i16* [[PTR:%.*]], i16** [[PTR_ADDR]], align 8
+// CHECK-NEXT: [[TMP0:%.*]] = load i16*, i16** [[PTR_ADDR]], align 8
+// CHECK-NEXT: store i64 3, i64* [[__OFFSET_ADDR_I]], align 8
+// CHECK-NEXT: store i16* [[TMP0]], i16** [[__PTR_ADDR_I]], align 8
+// CHECK-NEXT: [[TMP1:%.*]] = load i16*, i16** [[__PTR_ADDR_I]], align 8
+// CHECK-NEXT: [[TMP2:%.*]] = bitcast i16* [[TMP1]] to i8*
+// CHECK-NEXT: [[TMP3:%.*]] = load i64, i64* [[__OFFSET_ADDR_I]], align 8
+// CHECK-NEXT: [[ADD_PTR_I:%.*]] = getelementptr inbounds i8, i8* [[TMP2]], i64 [[TMP3]]
+// CHECK-NEXT: store i8* [[ADD_PTR_I]], i8** [[__ADDR_I]], align 8
+// CHECK-NEXT: [[TMP4:%.*]] = load i8*, i8** [[__ADDR_I]], align 8
+// CHECK-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP4]] to <8 x i16>*
+// CHECK-NEXT: [[TMP6:%.*]] = load <8 x i16>, <8 x i16>* [[TMP5]], align 1
+// CHECK-NEXT: [[TMP7:%.*]] = load <8 x i16>*, <8 x i16>** [[C_ADDR]], align 8
+// CHECK-NEXT: store <8 x i16> [[TMP6]], <8 x i16>* [[TMP7]], align 16
+// CHECK-NEXT: [[TMP8:%.*]] = load <8 x i16>*, <8 x i16>** [[C_ADDR]], align 8
+// CHECK-NEXT: [[TMP9:%.*]] = load <8 x i16>, <8 x i16>* [[TMP8]], align 16
+// CHECK-NEXT: [[TMP10:%.*]] = load i16*, i16** [[PTR_ADDR]], align 8
+// CHECK-NEXT: store <8 x i16> [[TMP9]], <8 x i16>* [[__VEC_ADDR_I]], align 16
+// CHECK-NEXT: store i64 7, i64* [[__OFFSET_ADDR_I1]], align 8
+// CHECK-NEXT: store i16* [[TMP10]], i16** [[__PTR_ADDR_I2]], align 8
+// CHECK-NEXT: [[TMP11:%.*]] = load i16*, i16** [[__PTR_ADDR_I2]], align 8
+// CHECK-NEXT: [[TMP12:%.*]] = bitcast i16* [[TMP11]] to i8*
+// CHECK-NEXT: [[TMP13:%.*]] = load i64, i64* [[__OFFSET_ADDR_I1]], align 8
+// CHECK-NEXT: [[ADD_PTR_I4:%.*]] = getelementptr inbounds i8, i8* [[TMP12]], i64 [[TMP13]]
+// CHECK-NEXT: store i8* [[ADD_PTR_I4]], i8** [[__ADDR_I3]], align 8
+// CHECK-NEXT: [[TMP14:%.*]] = load <8 x i16>, <8 x i16>* [[__VEC_ADDR_I]], align 16
+// CHECK-NEXT: [[TMP15:%.*]] = load i8*, i8** [[__ADDR_I3]], align 8
+// CHECK-NEXT: [[TMP16:%.*]] = bitcast i8* [[TMP15]] to <8 x i16>*
+// CHECK-NEXT: store <8 x i16> [[TMP14]], <8 x i16>* [[TMP16]], align 1
+// CHECK-NEXT: ret void
+//
+void test2(vector unsigned short *c, unsigned short *ptr) {
+ *c = vec_xl(3ll, ptr);
+ vec_xst(*c, 7ll, ptr);
+}
+
+// CHECK-LABEL: @test3(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[__VEC_ADDR_I:%.*]] = alloca <4 x i32>, align 16
+// CHECK-NEXT: [[__OFFSET_ADDR_I1:%.*]] = alloca i64, align 8
+// CHECK-NEXT: [[__PTR_ADDR_I2:%.*]] = alloca i32*, align 8
+// CHECK-NEXT: [[__ADDR_I3:%.*]] = alloca i8*, align 8
+// CHECK-NEXT: [[__OFFSET_ADDR_I:%.*]] = alloca i64, align 8
+// CHECK-NEXT: [[__PTR_ADDR_I:%.*]] = alloca i32*, align 8
+// CHECK-NEXT: [[__ADDR_I:%.*]] = alloca i8*, align 8
+// CHECK-NEXT: [[C_ADDR:%.*]] = alloca <4 x i32>*, align 8
+// CHECK-NEXT: [[PTR_ADDR:%.*]] = alloca i32*, align 8
+// CHECK-NEXT: store <4 x i32>* [[C:%.*]], <4 x i32>** [[C_ADDR]], align 8
+// CHECK-NEXT: store i32* [[PTR:%.*]], i32** [[PTR_ADDR]], align 8
+// CHECK-NEXT: [[TMP0:%.*]] = load i32*, i32** [[PTR_ADDR]], align 8
+// CHECK-NEXT: store i64 3, i64* [[__OFFSET_ADDR_I]], align 8
+// CHECK-NEXT: store i32* [[TMP0]], i32** [[__PTR_ADDR_I]], align 8
+// CHECK-NEXT: [[TMP1:%.*]] = load i32*, i32** [[__PTR_ADDR_I]], align 8
+// CHECK-NEXT: [[TMP2:%.*]] = bitcast i32* [[TMP1]] to i8*
+// CHECK-NEXT: [[TMP3:%.*]] = load i64, i64* [[__OFFSET_ADDR_I]], align 8
+// CHECK-NEXT: [[ADD_PTR_I:%.*]] = getelementptr inbounds i8, i8* [[TMP2]], i64 [[TMP3]]
+// CHECK-NEXT: store i8* [[ADD_PTR_I]], i8** [[__ADDR_I]], align 8
+// CHECK-NEXT: [[TMP4:%.*]] = load i8*, i8** [[__ADDR_I]], align 8
+// CHECK-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP4]] to <4 x i32>*
+// CHECK-NEXT: [[TMP6:%.*]] = load <4 x i32>, <4 x i32>* [[TMP5]], align 1
+// CHECK-NEXT: [[TMP7:%.*]] = load <4 x i32>*, <4 x i32>** [[C_ADDR]], align 8
+// CHECK-NEXT: store <4 x i32> [[TMP6]], <4 x i32>* [[TMP7]], align 16
+// CHECK-NEXT: [[TMP8:%.*]] = load <4 x i32>*, <4 x i32>** [[C_ADDR]], align 8
+// CHECK-NEXT: [[TMP9:%.*]] = load <4 x i32>, <4 x i32>* [[TMP8]], align 16
+// CHECK-NEXT: [[TMP10:%.*]] = load i32*, i32** [[PTR_ADDR]], align 8
+// CHECK-NEXT: store <4 x i32> [[TMP9]], <4 x i32>* [[__VEC_ADDR_I]], align 16
+// CHECK-NEXT: store i64 7, i64* [[__OFFSET_ADDR_I1]], align 8
+// CHECK-NEXT: store i32* [[TMP10]], i32** [[__PTR_ADDR_I2]], align 8
+// CHECK-NEXT: [[TMP11:%.*]] = load i32*, i32** [[__PTR_ADDR_I2]], align 8
+// CHECK-NEXT: [[TMP12:%.*]] = bitcast i32* [[TMP11]] to i8*
+// CHECK-NEXT: [[TMP13:%.*]] = load i64, i64* [[__OFFSET_ADDR_I1]], align 8
+// CHECK-NEXT: [[ADD_PTR_I4:%.*]] = getelementptr inbounds i8, i8* [[TMP12]], i64 [[TMP13]]
+// CHECK-NEXT: store i8* [[ADD_PTR_I4]], i8** [[__ADDR_I3]], align 8
+// CHECK-NEXT: [[TMP14:%.*]] = load <4 x i32>, <4 x i32>* [[__VEC_ADDR_I]], align 16
+// CHECK-NEXT: [[TMP15:%.*]] = load i8*, i8** [[__ADDR_I3]], align 8
+// CHECK-NEXT: [[TMP16:%.*]] = bitcast i8* [[TMP15]] to <4 x i32>*
+// CHECK-NEXT: store <4 x i32> [[TMP14]], <4 x i32>* [[TMP16]], align 1
+// CHECK-NEXT: ret void
+//
+void test3(vector signed int *c, signed int *ptr) {
+ *c = vec_xl(3ll, ptr);
+ vec_xst(*c, 7ll, ptr);
+}
+
+// CHECK-LABEL: @test4(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[__VEC_ADDR_I:%.*]] = alloca <4 x i32>, align 16
+// CHECK-NEXT: [[__OFFSET_ADDR_I1:%.*]] = alloca i64, align 8
+// CHECK-NEXT: [[__PTR_ADDR_I2:%.*]] = alloca i32*, align 8
+// CHECK-NEXT: [[__ADDR_I3:%.*]] = alloca i8*, align 8
+// CHECK-NEXT: [[__OFFSET_ADDR_I:%.*]] = alloca i64, align 8
+// CHECK-NEXT: [[__PTR_ADDR_I:%.*]] = alloca i32*, align 8
+// CHECK-NEXT: [[__ADDR_I:%.*]] = alloca i8*, align 8
+// CHECK-NEXT: [[C_ADDR:%.*]] = alloca <4 x i32>*, align 8
+// CHECK-NEXT: [[PTR_ADDR:%.*]] = alloca i32*, align 8
+// CHECK-NEXT: store <4 x i32>* [[C:%.*]], <4 x i32>** [[C_ADDR]], align 8
+// CHECK-NEXT: store i32* [[PTR:%.*]], i32** [[PTR_ADDR]], align 8
+// CHECK-NEXT: [[TMP0:%.*]] = load i32*, i32** [[PTR_ADDR]], align 8
+// CHECK-NEXT: store i64 3, i64* [[__OFFSET_ADDR_I]], align 8
+// CHECK-NEXT: store i32* [[TMP0]], i32** [[__PTR_ADDR_I]], align 8
+// CHECK-NEXT: [[TMP1:%.*]] = load i32*, i32** [[__PTR_ADDR_I]], align 8
+// CHECK-NEXT: [[TMP2:%.*]] = bitcast i32* [[TMP1]] to i8*
+// CHECK-NEXT: [[TMP3:%.*]] = load i64, i64* [[__OFFSET_ADDR_I]], align 8
+// CHECK-NEXT: [[ADD_PTR_I:%.*]] = getelementptr inbounds i8, i8* [[TMP2]], i64 [[TMP3]]
+// CHECK-NEXT: store i8* [[ADD_PTR_I]], i8** [[__ADDR_I]], align 8
+// CHECK-NEXT: [[TMP4:%.*]] = load i8*, i8** [[__ADDR_I]], align 8
+// CHECK-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP4]] to <4 x i32>*
+// CHECK-NEXT: [[TMP6:%.*]] = load <4 x i32>, <4 x i32>* [[TMP5]], align 1
+// CHECK-NEXT: [[TMP7:%.*]] = load <4 x i32>*, <4 x i32>** [[C_ADDR]], align 8
+// CHECK-NEXT: store <4 x i32> [[TMP6]], <4 x i32>* [[TMP7]], align 16
+// CHECK-NEXT: [[TMP8:%.*]] = load <4 x i32>*, <4 x i32>** [[C_ADDR]], align 8
+// CHECK-NEXT: [[TMP9:%.*]] = load <4 x i32>, <4 x i32>* [[TMP8]], align 16
+// CHECK-NEXT: [[TMP10:%.*]] = load i32*, i32** [[PTR_ADDR]], align 8
+// CHECK-NEXT: store <4 x i32> [[TMP9]], <4 x i32>* [[__VEC_ADDR_I]], align 16
+// CHECK-NEXT: store i64 7, i64* [[__OFFSET_ADDR_I1]], align 8
+// CHECK-NEXT: store i32* [[TMP10]], i32** [[__PTR_ADDR_I2]], align 8
+// CHECK-NEXT: [[TMP11:%.*]] = load i32*, i32** [[__PTR_ADDR_I2]], align 8
+// CHECK-NEXT: [[TMP12:%.*]] = bitcast i32* [[TMP11]] to i8*
+// CHECK-NEXT: [[TMP13:%.*]] = load i64, i64* [[__OFFSET_ADDR_I1]], align 8
+// CHECK-NEXT: [[ADD_PTR_I4:%.*]] = getelementptr inbounds i8, i8* [[TMP12]], i64 [[TMP13]]
+// CHECK-NEXT: store i8* [[ADD_PTR_I4]], i8** [[__ADDR_I3]], align 8
+// CHECK-NEXT: [[TMP14:%.*]] = load <4 x i32>, <4 x i32>* [[__VEC_ADDR_I]], align 16
+// CHECK-NEXT: [[TMP15:%.*]] = load i8*, i8** [[__ADDR_I3]], align 8
+// CHECK-NEXT: [[TMP16:%.*]] = bitcast i8* [[TMP15]] to <4 x i32>*
+// CHECK-NEXT: store <4 x i32> [[TMP14]], <4 x i32>* [[TMP16]], align 1
+// CHECK-NEXT: ret void
+//
+void test4(vector unsigned int *c, unsigned int *ptr) {
+ *c = vec_xl(3ll, ptr);
+ vec_xst(*c, 7ll, ptr);
+}
+
+// CHECK-LABEL: @test5(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[__VEC_ADDR_I:%.*]] = alloca <2 x i64>, align 16
+// CHECK-NEXT: [[__OFFSET_ADDR_I1:%.*]] = alloca i64, align 8
+// CHECK-NEXT: [[__PTR_ADDR_I2:%.*]] = alloca i64*, align 8
+// CHECK-NEXT: [[__ADDR_I3:%.*]] = alloca i8*, align 8
+// CHECK-NEXT: [[__OFFSET_ADDR_I:%.*]] = alloca i64, align 8
+// CHECK-NEXT: [[__PTR_ADDR_I:%.*]] = alloca i64*, align 8
+// CHECK-NEXT: [[__ADDR_I:%.*]] = alloca i8*, align 8
+// CHECK-NEXT: [[C_ADDR:%.*]] = alloca <2 x i64>*, align 8
+// CHECK-NEXT: [[PTR_ADDR:%.*]] = alloca i64*, align 8
+// CHECK-NEXT: store <2 x i64>* [[C:%.*]], <2 x i64>** [[C_ADDR]], align 8
+// CHECK-NEXT: store i64* [[PTR:%.*]], i64** [[PTR_ADDR]], align 8
+// CHECK-NEXT: [[TMP0:%.*]] = load i64*, i64** [[PTR_ADDR]], align 8
+// CHECK-NEXT: store i64 3, i64* [[__OFFSET_ADDR_I]], align 8
+// CHECK-NEXT: store i64* [[TMP0]], i64** [[__PTR_ADDR_I]], align 8
+// CHECK-NEXT: [[TMP1:%.*]] = load i64*, i64** [[__PTR_ADDR_I]], align 8
+// CHECK-NEXT: [[TMP2:%.*]] = bitcast i64* [[TMP1]] to i8*
+// CHECK-NEXT: [[TMP3:%.*]] = load i64, i64* [[__OFFSET_ADDR_I]], align 8
+// CHECK-NEXT: [[ADD_PTR_I:%.*]] = getelementptr inbounds i8, i8* [[TMP2]], i64 [[TMP3]]
+// CHECK-NEXT: store i8* [[ADD_PTR_I]], i8** [[__ADDR_I]], align 8
+// CHECK-NEXT: [[TMP4:%.*]] = load i8*, i8** [[__ADDR_I]], align 8
+// CHECK-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP4]] to <2 x i64>*
+// CHECK-NEXT: [[TMP6:%.*]] = load <2 x i64>, <2 x i64>* [[TMP5]], align 1
+// CHECK-NEXT: [[TMP7:%.*]] = load <2 x i64>*, <2 x i64>** [[C_ADDR]], align 8
+// CHECK-NEXT: store <2 x i64> [[TMP6]], <2 x i64>* [[TMP7]], align 16
+// CHECK-NEXT: [[TMP8:%.*]] = load <2 x i64>*, <2 x i64>** [[C_ADDR]], align 8
+// CHECK-NEXT: [[TMP9:%.*]] = load <2 x i64>, <2 x i64>* [[TMP8]], align 16
+// CHECK-NEXT: [[TMP10:%.*]] = load i64*, i64** [[PTR_ADDR]], align 8
+// CHECK-NEXT: store <2 x i64> [[TMP9]], <2 x i64>* [[__VEC_ADDR_I]], align 16
+// CHECK-NEXT: store i64 7, i64* [[__OFFSET_ADDR_I1]], align 8
+// CHECK-NEXT: store i64* [[TMP10]], i64** [[__PTR_ADDR_I2]], align 8
+// CHECK-NEXT: [[TMP11:%.*]] = load i64*, i64** [[__PTR_ADDR_I2]], align 8
+// CHECK-NEXT: [[TMP12:%.*]] = bitcast i64* [[TMP11]] to i8*
+// CHECK-NEXT: [[TMP13:%.*]] = load i64, i64* [[__OFFSET_ADDR_I1]], align 8
+// CHECK-NEXT: [[ADD_PTR_I4:%.*]] = getelementptr inbounds i8, i8* [[TMP12]], i64 [[TMP13]]
+// CHECK-NEXT: store i8* [[ADD_PTR_I4]], i8** [[__ADDR_I3]], align 8
+// CHECK-NEXT: [[TMP14:%.*]] = load <2 x i64>, <2 x i64>* [[__VEC_ADDR_I]], align 16
+// CHECK-NEXT: [[TMP15:%.*]] = load i8*, i8** [[__ADDR_I3]], align 8
+// CHECK-NEXT: [[TMP16:%.*]] = bitcast i8* [[TMP15]] to <2 x i64>*
+// CHECK-NEXT: store <2 x i64> [[TMP14]], <2 x i64>* [[TMP16]], align 1
+// CHECK-NEXT: ret void
+//
+void test5(vector signed long long *c, signed long long *ptr) {
+ *c = vec_xl(3ll, ptr);
+ vec_xst(*c, 7ll, ptr);
+}
+
+// CHECK-LABEL: @test6(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[__VEC_ADDR_I:%.*]] = alloca <2 x i64>, align 16
+// CHECK-NEXT: [[__OFFSET_ADDR_I1:%.*]] = alloca i64, align 8
+// CHECK-NEXT: [[__PTR_ADDR_I2:%.*]] = alloca i64*, align 8
+// CHECK-NEXT: [[__ADDR_I3:%.*]] = alloca i8*, align 8
+// CHECK-NEXT: [[__OFFSET_ADDR_I:%.*]] = alloca i64, align 8
+// CHECK-NEXT: [[__PTR_ADDR_I:%.*]] = alloca i64*, align 8
+// CHECK-NEXT: [[__ADDR_I:%.*]] = alloca i8*, align 8
+// CHECK-NEXT: [[C_ADDR:%.*]] = alloca <2 x i64>*, align 8
+// CHECK-NEXT: [[PTR_ADDR:%.*]] = alloca i64*, align 8
+// CHECK-NEXT: store <2 x i64>* [[C:%.*]], <2 x i64>** [[C_ADDR]], align 8
+// CHECK-NEXT: store i64* [[PTR:%.*]], i64** [[PTR_ADDR]], align 8
+// CHECK-NEXT: [[TMP0:%.*]] = load i64*, i64** [[PTR_ADDR]], align 8
+// CHECK-NEXT: store i64 3, i64* [[__OFFSET_ADDR_I]], align 8
+// CHECK-NEXT: store i64* [[TMP0]], i64** [[__PTR_ADDR_I]], align 8
+// CHECK-NEXT: [[TMP1:%.*]] = load i64*, i64** [[__PTR_ADDR_I]], align 8
+// CHECK-NEXT: [[TMP2:%.*]] = bitcast i64* [[TMP1]] to i8*
+// CHECK-NEXT: [[TMP3:%.*]] = load i64, i64* [[__OFFSET_ADDR_I]], align 8
+// CHECK-NEXT: [[ADD_PTR_I:%.*]] = getelementptr inbounds i8, i8* [[TMP2]], i64 [[TMP3]]
+// CHECK-NEXT: store i8* [[ADD_PTR_I]], i8** [[__ADDR_I]], align 8
+// CHECK-NEXT: [[TMP4:%.*]] = load i8*, i8** [[__ADDR_I]], align 8
+// CHECK-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP4]] to <2 x i64>*
+// CHECK-NEXT: [[TMP6:%.*]] = load <2 x i64>, <2 x i64>* [[TMP5]], align 1
+// CHECK-NEXT: [[TMP7:%.*]] = load <2 x i64>*, <2 x i64>** [[C_ADDR]], align 8
+// CHECK-NEXT: store <2 x i64> [[TMP6]], <2 x i64>* [[TMP7]], align 16
+// CHECK-NEXT: [[TMP8:%.*]] = load <2 x i64>*, <2 x i64>** [[C_ADDR]], align 8
+// CHECK-NEXT: [[TMP9:%.*]] = load <2 x i64>, <2 x i64>* [[TMP8]], align 16
+// CHECK-NEXT: [[TMP10:%.*]] = load i64*, i64** [[PTR_ADDR]], align 8
+// CHECK-NEXT: store <2 x i64> [[TMP9]], <2 x i64>* [[__VEC_ADDR_I]], align 16
+// CHECK-NEXT: store i64 7, i64* [[__OFFSET_ADDR_I1]], align 8
+// CHECK-NEXT: store i64* [[TMP10]], i64** [[__PTR_ADDR_I2]], align 8
+// CHECK-NEXT: [[TMP11:%.*]] = load i64*, i64** [[__PTR_ADDR_I2]], align 8
+// CHECK-NEXT: [[TMP12:%.*]] = bitcast i64* [[TMP11]] to i8*
+// CHECK-NEXT: [[TMP13:%.*]] = load i64, i64* [[__OFFSET_ADDR_I1]], align 8
+// CHECK-NEXT: [[ADD_PTR_I4:%.*]] = getelementptr inbounds i8, i8* [[TMP12]], i64 [[TMP13]]
+// CHECK-NEXT: store i8* [[ADD_PTR_I4]], i8** [[__ADDR_I3]], align 8
+// CHECK-NEXT: [[TMP14:%.*]] = load <2 x i64>, <2 x i64>* [[__VEC_ADDR_I]], align 16
+// CHECK-NEXT: [[TMP15:%.*]] = load i8*, i8** [[__ADDR_I3]], align 8
+// CHECK-NEXT: [[TMP16:%.*]] = bitcast i8* [[TMP15]] to <2 x i64>*
+// CHECK-NEXT: store <2 x i64> [[TMP14]], <2 x i64>* [[TMP16]], align 1
+// CHECK-NEXT: ret void
+//
+void test6(vector unsigned long long *c, unsigned long long *ptr) {
+ *c = vec_xl(3ll, ptr);
+ vec_xst(*c, 7ll, ptr);
+}
+
+// CHECK-LABEL: @test7(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[__VEC_ADDR_I:%.*]] = alloca <4 x float>, align 16
+// CHECK-NEXT: [[__OFFSET_ADDR_I1:%.*]] = alloca i64, align 8
+// CHECK-NEXT: [[__PTR_ADDR_I2:%.*]] = alloca float*, align 8
+// CHECK-NEXT: [[__ADDR_I3:%.*]] = alloca i8*, align 8
+// CHECK-NEXT: [[__OFFSET_ADDR_I:%.*]] = alloca i64, align 8
+// CHECK-NEXT: [[__PTR_ADDR_I:%.*]] = alloca float*, align 8
+// CHECK-NEXT: [[__ADDR_I:%.*]] = alloca i8*, align 8
+// CHECK-NEXT: [[C_ADDR:%.*]] = alloca <4 x float>*, align 8
+// CHECK-NEXT: [[PTR_ADDR:%.*]] = alloca float*, align 8
+// CHECK-NEXT: store <4 x float>* [[C:%.*]], <4 x float>** [[C_ADDR]], align 8
+// CHECK-NEXT: store float* [[PTR:%.*]], float** [[PTR_ADDR]], align 8
+// CHECK-NEXT: [[TMP0:%.*]] = load float*, float** [[PTR_ADDR]], align 8
+// CHECK-NEXT: store i64 3, i64* [[__OFFSET_ADDR_I]], align 8
+// CHECK-NEXT: store float* [[TMP0]], float** [[__PTR_ADDR_I]], align 8
+// CHECK-NEXT: [[TMP1:%.*]] = load float*, float** [[__PTR_ADDR_I]], align 8
+// CHECK-NEXT: [[TMP2:%.*]] = bitcast float* [[TMP1]] to i8*
+// CHECK-NEXT: [[TMP3:%.*]] = load i64, i64* [[__OFFSET_ADDR_I]], align 8
+// CHECK-NEXT: [[ADD_PTR_I:%.*]] = getelementptr inbounds i8, i8* [[TMP2]], i64 [[TMP3]]
+// CHECK-NEXT: store i8* [[ADD_PTR_I]], i8** [[__ADDR_I]], align 8
+// CHECK-NEXT: [[TMP4:%.*]] = load i8*, i8** [[__ADDR_I]], align 8
+// CHECK-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP4]] to <4 x float>*
+// CHECK-NEXT: [[TMP6:%.*]] = load <4 x float>, <4 x float>* [[TMP5]], align 1
+// CHECK-NEXT: [[TMP7:%.*]] = load <4 x float>*, <4 x float>** [[C_ADDR]], align 8
+// CHECK-NEXT: store <4 x float> [[TMP6]], <4 x float>* [[TMP7]], align 16
+// CHECK-NEXT: [[TMP8:%.*]] = load <4 x float>*, <4 x float>** [[C_ADDR]], align 8
+// CHECK-NEXT: [[TMP9:%.*]] = load <4 x float>, <4 x float>* [[TMP8]], align 16
+// CHECK-NEXT: [[TMP10:%.*]] = load float*, float** [[PTR_ADDR]], align 8
+// CHECK-NEXT: store <4 x float> [[TMP9]], <4 x float>* [[__VEC_ADDR_I]], align 16
+// CHECK-NEXT: store i64 7, i64* [[__OFFSET_ADDR_I1]], align 8
+// CHECK-NEXT: store float* [[TMP10]], float** [[__PTR_ADDR_I2]], align 8
+// CHECK-NEXT: [[TMP11:%.*]] = load float*, float** [[__PTR_ADDR_I2]], align 8
+// CHECK-NEXT: [[TMP12:%.*]] = bitcast float* [[TMP11]] to i8*
+// CHECK-NEXT: [[TMP13:%.*]] = load i64, i64* [[__OFFSET_ADDR_I1]], align 8
+// CHECK-NEXT: [[ADD_PTR_I4:%.*]] = getelementptr inbounds i8, i8* [[TMP12]], i64 [[TMP13]]
+// CHECK-NEXT: store i8* [[ADD_PTR_I4]], i8** [[__ADDR_I3]], align 8
+// CHECK-NEXT: [[TMP14:%.*]] = load <4 x float>, <4 x float>* [[__VEC_ADDR_I]], align 16
+// CHECK-NEXT: [[TMP15:%.*]] = load i8*, i8** [[__ADDR_I3]], align 8
+// CHECK-NEXT: [[TMP16:%.*]] = bitcast i8* [[TMP15]] to <4 x float>*
+// CHECK-NEXT: store <4 x float> [[TMP14]], <4 x float>* [[TMP16]], align 1
+// CHECK-NEXT: ret void
+//
+void test7(vector float *c, float *ptr) {
+ *c = vec_xl(3ll, ptr);
+ vec_xst(*c, 7ll, ptr);
+}
+
+// CHECK-LABEL: @test8(
+// CHECK-NEXT: entry:
+// CHECK-NEXT: [[__VEC_ADDR_I:%.*]] = alloca <2 x double>, align 16
+// CHECK-NEXT: [[__OFFSET_ADDR_I1:%.*]] = alloca i64, align 8
+// CHECK-NEXT: [[__PTR_ADDR_I2:%.*]] = alloca double*, align 8
+// CHECK-NEXT: [[__ADDR_I3:%.*]] = alloca i8*, align 8
+// CHECK-NEXT: [[__OFFSET_ADDR_I:%.*]] = alloca i64, align 8
+// CHECK-NEXT: [[__PTR_ADDR_I:%.*]] = alloca double*, align 8
+// CHECK-NEXT: [[__ADDR_I:%.*]] = alloca i8*, align 8
+// CHECK-NEXT: [[C_ADDR:%.*]] = alloca <2 x double>*, align 8
+// CHECK-NEXT: [[PTR_ADDR:%.*]] = alloca double*, align 8
+// CHECK-NEXT: store <2 x double>* [[C:%.*]], <2 x double>** [[C_ADDR]], align 8
+// CHECK-NEXT: store double* [[PTR:%.*]], double** [[PTR_ADDR]], align 8
+// CHECK-NEXT: [[TMP0:%.*]] = load double*, double** [[PTR_ADDR]], align 8
+// CHECK-NEXT: store i64 3, i64* [[__OFFSET_ADDR_I]], align 8
+// CHECK-NEXT: store double* [[TMP0]], double** [[__PTR_ADDR_I]], align 8
+// CHECK-NEXT: [[TMP1:%.*]] = load double*, double** [[__PTR_ADDR_I]], align 8
+// CHECK-NEXT: [[TMP2:%.*]] = bitcast double* [[TMP1]] to i8*
+// CHECK-NEXT: [[TMP3:%.*]] = load i64, i64* [[__OFFSET_ADDR_I]], align 8
+// CHECK-NEXT: [[ADD_PTR_I:%.*]] = getelementptr inbounds i8, i8* [[TMP2]], i64 [[TMP3]]
+// CHECK-NEXT: store i8* [[ADD_PTR_I]], i8** [[__ADDR_I]], align 8
+// CHECK-NEXT: [[TMP4:%.*]] = load i8*, i8** [[__ADDR_I]], align 8
+// CHECK-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP4]] to <2 x double>*
+// CHECK-NEXT: [[TMP6:%.*]] = load <2 x double>, <2 x double>* [[TMP5]], align 1
+// CHECK-NEXT: [[TMP7:%.*]] = load <2 x double>*, <2 x double>** [[C_ADDR]], align 8
+// CHECK-NEXT: store <2 x double> [[TMP6]], <2 x double>* [[TMP7]], align 16
+// CHECK-NEXT: [[TMP8:%.*]] = load <2 x double>*, <2 x double>** [[C_ADDR]], align 8
+// CHECK-NEXT: [[TMP9:%.*]] = load <2 x double>, <2 x double>* [[TMP8]], align 16
+// CHECK-NEXT: [[TMP10:%.*]] = load double*, double** [[PTR_ADDR]], align 8
+// CHECK-NEXT: store <2 x double> [[TMP9]], <2 x double>* [[__VEC_ADDR_I]], align 16
+// CHECK-NEXT: store i64 7, i64* [[__OFFSET_ADDR_I1]], align 8
+// CHECK-NEXT: store double* [[TMP10]], double** [[__PTR_ADDR_I2]], align 8
+// CHECK-NEXT: [[TMP11:%.*]] = load double*, double** [[__PTR_ADDR_I2]], align 8
+// CHECK-NEXT: [[TMP12:%.*]] = bitcast double* [[TMP11]] to i8*
+// CHECK-NEXT: [[TMP13:%.*]] = load i64, i64* [[__OFFSET_ADDR_I1]], align 8
+// CHECK-NEXT: [[ADD_PTR_I4:%.*]] = getelementptr inbounds i8, i8* [[TMP12]], i64 [[TMP13]]
+// CHECK-NEXT: store i8* [[ADD_PTR_I4]], i8** [[__ADDR_I3]], align 8
+// CHECK-NEXT: [[TMP14:%.*]] = load <2 x double>, <2 x double>* [[__VEC_ADDR_I]], align 16
+// CHECK-NEXT: [[TMP15:%.*]] = load i8*, i8** [[__ADDR_I3]], align 8
+// CHECK-NEXT: [[TMP16:%.*]] = bitcast i8* [[TMP15]] to <2 x double>*
+// CHECK-NEXT: store <2 x double> [[TMP14]], <2 x double>* [[TMP16]], align 1
+// CHECK-NEXT: ret void
+//
+void test8(vector double *c, double *ptr) {
+ *c = vec_xl(3ll, ptr);
+ vec_xst(*c, 7ll, ptr);
+}
+
+#ifdef __POWER8_VECTOR__
+// CHECK-P8-LABEL: @test9(
+// CHECK-P8-NEXT: entry:
+// CHECK-P8-NEXT: [[__VEC_ADDR_I:%.*]] = alloca <1 x i128>, align 16
+// CHECK-P8-NEXT: [[__OFFSET_ADDR_I1:%.*]] = alloca i64, align 8
+// CHECK-P8-NEXT: [[__PTR_ADDR_I2:%.*]] = alloca i128*, align 8
+// CHECK-P8-NEXT: [[__ADDR_I3:%.*]] = alloca i8*, align 8
+// CHECK-P8-NEXT: [[__OFFSET_ADDR_I:%.*]] = alloca i64, align 8
+// CHECK-P8-NEXT: [[__PTR_ADDR_I:%.*]] = alloca i128*, align 8
+// CHECK-P8-NEXT: [[__ADDR_I:%.*]] = alloca i8*, align 8
+// CHECK-P8-NEXT: [[C_ADDR:%.*]] = alloca <1 x i128>*, align 8
+// CHECK-P8-NEXT: [[PTR_ADDR:%.*]] = alloca i128*, align 8
+// CHECK-P8-NEXT: store <1 x i128>* [[C:%.*]], <1 x i128>** [[C_ADDR]], align 8
+// CHECK-P8-NEXT: store i128* [[PTR:%.*]], i128** [[PTR_ADDR]], align 8
+// CHECK-P8-NEXT: [[TMP0:%.*]] = load i128*, i128** [[PTR_ADDR]], align 8
+// CHECK-P8-NEXT: store i64 3, i64* [[__OFFSET_ADDR_I]], align 8
+// CHECK-P8-NEXT: store i128* [[TMP0]], i128** [[__PTR_ADDR_I]], align 8
+// CHECK-P8-NEXT: [[TMP1:%.*]] = load i128*, i128** [[__PTR_ADDR_I]], align 8
+// CHECK-P8-NEXT: [[TMP2:%.*]] = bitcast i128* [[TMP1]] to i8*
+// CHECK-P8-NEXT: [[TMP3:%.*]] = load i64, i64* [[__OFFSET_ADDR_I]], align 8
+// CHECK-P8-NEXT: [[ADD_PTR_I:%.*]] = getelementptr inbounds i8, i8* [[TMP2]], i64 [[TMP3]]
+// CHECK-P8-NEXT: store i8* [[ADD_PTR_I]], i8** [[__ADDR_I]], align 8
+// CHECK-P8-NEXT: [[TMP4:%.*]] = load i8*, i8** [[__ADDR_I]], align 8
+// CHECK-P8-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP4]] to <1 x i128>*
+// CHECK-P8-NEXT: [[TMP6:%.*]] = load <1 x i128>, <1 x i128>* [[TMP5]], align 1
+// CHECK-P8-NEXT: [[TMP7:%.*]] = load <1 x i128>*, <1 x i128>** [[C_ADDR]], align 8
+// CHECK-P8-NEXT: store <1 x i128> [[TMP6]], <1 x i128>* [[TMP7]], align 16
+// CHECK-P8-NEXT: [[TMP8:%.*]] = load <1 x i128>*, <1 x i128>** [[C_ADDR]], align 8
+// CHECK-P8-NEXT: [[TMP9:%.*]] = load <1 x i128>, <1 x i128>* [[TMP8]], align 16
+// CHECK-P8-NEXT: [[TMP10:%.*]] = load i128*, i128** [[PTR_ADDR]], align 8
+// CHECK-P8-NEXT: store <1 x i128> [[TMP9]], <1 x i128>* [[__VEC_ADDR_I]], align 16
+// CHECK-P8-NEXT: store i64 7, i64* [[__OFFSET_ADDR_I1]], align 8
+// CHECK-P8-NEXT: store i128* [[TMP10]], i128** [[__PTR_ADDR_I2]], align 8
+// CHECK-P8-NEXT: [[TMP11:%.*]] = load i128*, i128** [[__PTR_ADDR_I2]], align 8
+// CHECK-P8-NEXT: [[TMP12:%.*]] = bitcast i128* [[TMP11]] to i8*
+// CHECK-P8-NEXT: [[TMP13:%.*]] = load i64, i64* [[__OFFSET_ADDR_I1]], align 8
+// CHECK-P8-NEXT: [[ADD_PTR_I4:%.*]] = getelementptr inbounds i8, i8* [[TMP12]], i64 [[TMP13]]
+// CHECK-P8-NEXT: store i8* [[ADD_PTR_I4]], i8** [[__ADDR_I3]], align 8
+// CHECK-P8-NEXT: [[TMP14:%.*]] = load <1 x i128>, <1 x i128>* [[__VEC_ADDR_I]], align 16
+// CHECK-P8-NEXT: [[TMP15:%.*]] = load i8*, i8** [[__ADDR_I3]], align 8
+// CHECK-P8-NEXT: [[TMP16:%.*]] = bitcast i8* [[TMP15]] to <1 x i128>*
+// CHECK-P8-NEXT: store <1 x i128> [[TMP14]], <1 x i128>* [[TMP16]], align 1
+// CHECK-P8-NEXT: ret void
+//
+void test9(vector signed __int128 *c, signed __int128 *ptr) {
+ *c = vec_xl(3ll, ptr);
+ vec_xst(*c, 7ll, ptr);
+}
+
+// CHECK-P8-LABEL: @test10(
+// CHECK-P8-NEXT: entry:
+// CHECK-P8-NEXT: [[__VEC_ADDR_I:%.*]] = alloca <1 x i128>, align 16
+// CHECK-P8-NEXT: [[__OFFSET_ADDR_I1:%.*]] = alloca i64, align 8
+// CHECK-P8-NEXT: [[__PTR_ADDR_I2:%.*]] = alloca i128*, align 8
+// CHECK-P8-NEXT: [[__ADDR_I3:%.*]] = alloca i8*, align 8
+// CHECK-P8-NEXT: [[__OFFSET_ADDR_I:%.*]] = alloca i64, align 8
+// CHECK-P8-NEXT: [[__PTR_ADDR_I:%.*]] = alloca i128*, align 8
+// CHECK-P8-NEXT: [[__ADDR_I:%.*]] = alloca i8*, align 8
+// CHECK-P8-NEXT: [[C_ADDR:%.*]] = alloca <1 x i128>*, align 8
+// CHECK-P8-NEXT: [[PTR_ADDR:%.*]] = alloca i128*, align 8
+// CHECK-P8-NEXT: store <1 x i128>* [[C:%.*]], <1 x i128>** [[C_ADDR]], align 8
+// CHECK-P8-NEXT: store i128* [[PTR:%.*]], i128** [[PTR_ADDR]], align 8
+// CHECK-P8-NEXT: [[TMP0:%.*]] = load i128*, i128** [[PTR_ADDR]], align 8
+// CHECK-P8-NEXT: store i64 3, i64* [[__OFFSET_ADDR_I]], align 8
+// CHECK-P8-NEXT: store i128* [[TMP0]], i128** [[__PTR_ADDR_I]], align 8
+// CHECK-P8-NEXT: [[TMP1:%.*]] = load i128*, i128** [[__PTR_ADDR_I]], align 8
+// CHECK-P8-NEXT: [[TMP2:%.*]] = bitcast i128* [[TMP1]] to i8*
+// CHECK-P8-NEXT: [[TMP3:%.*]] = load i64, i64* [[__OFFSET_ADDR_I]], align 8
+// CHECK-P8-NEXT: [[ADD_PTR_I:%.*]] = getelementptr inbounds i8, i8* [[TMP2]], i64 [[TMP3]]
+// CHECK-P8-NEXT: store i8* [[ADD_PTR_I]], i8** [[__ADDR_I]], align 8
+// CHECK-P8-NEXT: [[TMP4:%.*]] = load i8*, i8** [[__ADDR_I]], align 8
+// CHECK-P8-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP4]] to <1 x i128>*
+// CHECK-P8-NEXT: [[TMP6:%.*]] = load <1 x i128>, <1 x i128>* [[TMP5]], align 1
+// CHECK-P8-NEXT: [[TMP7:%.*]] = load <1 x i128>*, <1 x i128>** [[C_ADDR]], align 8
+// CHECK-P8-NEXT: store <1 x i128> [[TMP6]], <1 x i128>* [[TMP7]], align 16
+// CHECK-P8-NEXT: [[TMP8:%.*]] = load <1 x i128>*, <1 x i128>** [[C_ADDR]], align 8
+// CHECK-P8-NEXT: [[TMP9:%.*]] = load <1 x i128>, <1 x i128>* [[TMP8]], align 16
+// CHECK-P8-NEXT: [[TMP10:%.*]] = load i128*, i128** [[PTR_ADDR]], align 8
+// CHECK-P8-NEXT: store <1 x i128> [[TMP9]], <1 x i128>* [[__VEC_ADDR_I]], align 16
+// CHECK-P8-NEXT: store i64 7, i64* [[__OFFSET_ADDR_I1]], align 8
+// CHECK-P8-NEXT: store i128* [[TMP10]], i128** [[__PTR_ADDR_I2]], align 8
+// CHECK-P8-NEXT: [[TMP11:%.*]] = load i128*, i128** [[__PTR_ADDR_I2]], align 8
+// CHECK-P8-NEXT: [[TMP12:%.*]] = bitcast i128* [[TMP11]] to i8*
+// CHECK-P8-NEXT: [[TMP13:%.*]] = load i64, i64* [[__OFFSET_ADDR_I1]], align 8
+// CHECK-P8-NEXT: [[ADD_PTR_I4:%.*]] = getelementptr inbounds i8, i8* [[TMP12]], i64 [[TMP13]]
+// CHECK-P8-NEXT: store i8* [[ADD_PTR_I4]], i8** [[__ADDR_I3]], align 8
+// CHECK-P8-NEXT: [[TMP14:%.*]] = load <1 x i128>, <1 x i128>* [[__VEC_ADDR_I]], align 16
+// CHECK-P8-NEXT: [[TMP15:%.*]] = load i8*, i8** [[__ADDR_I3]], align 8
+// CHECK-P8-NEXT: [[TMP16:%.*]] = bitcast i8* [[TMP15]] to <1 x i128>*
+// CHECK-P8-NEXT: store <1 x i128> [[TMP14]], <1 x i128>* [[TMP16]], align 1
+// CHECK-P8-NEXT: ret void
+//
+void test10(vector unsigned __int128 *c, unsigned __int128 *ptr) {
+ *c = vec_xl(3ll, ptr);
+ vec_xst(*c, 7ll, ptr);
+}
+#endif
diff --git a/src/llvm-project/clang/test/CodeGen/builtins-systemz-vector.c b/src/llvm-project/clang/test/CodeGen/builtins-systemz-vector.c
index 6d94cfa..116bd8f 100644
--- a/src/llvm-project/clang/test/CodeGen/builtins-systemz-vector.c
+++ b/src/llvm-project/clang/test/CodeGen/builtins-systemz-vector.c
@@ -1,5 +1,5 @@
// REQUIRES: systemz-registered-target
-// RUN: %clang_cc1 -target-cpu z13 -triple s390x-ibm-linux -fno-lax-vector-conversions \
+// RUN: %clang_cc1 -target-cpu z13 -triple s390x-ibm-linux -flax-vector-conversions=none \
// RUN: -Wall -Wno-unused -Werror -emit-llvm %s -o - | FileCheck %s
typedef __attribute__((vector_size(16))) signed char vec_schar;
@@ -584,14 +584,14 @@
vd = __builtin_s390_vfmadb(vd, vd, vd);
// CHECK: call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}})
vd = __builtin_s390_vfmsdb(vd, vd, vd);
- // CHECK: [[NEG:%[^ ]+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%[^ ]+]] = fneg <2 x double> %{{.*}}
// CHECK: call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> [[NEG]])
vd = __builtin_s390_vflpdb(vd);
// CHECK: call <2 x double> @llvm.fabs.v2f64(<2 x double> %{{.*}})
vd = __builtin_s390_vflndb(vd);
// CHECK: [[ABS:%[^ ]+]] = call <2 x double> @llvm.fabs.v2f64(<2 x double> %{{.*}})
- // CHECK: fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, [[ABS]]
+ // CHECK: fneg <2 x double> [[ABS]]
vd = __builtin_s390_vfidb(vd, 0, 0);
// CHECK: call <2 x double> @llvm.rint.v2f64(<2 x double> %{{.*}})
diff --git a/src/llvm-project/clang/test/CodeGen/builtins-systemz-vector2.c b/src/llvm-project/clang/test/CodeGen/builtins-systemz-vector2.c
index 8f0b8ae..0a99060 100644
--- a/src/llvm-project/clang/test/CodeGen/builtins-systemz-vector2.c
+++ b/src/llvm-project/clang/test/CodeGen/builtins-systemz-vector2.c
@@ -1,5 +1,5 @@
// REQUIRES: systemz-registered-target
-// RUN: %clang_cc1 -target-cpu z14 -triple s390x-ibm-linux -fno-lax-vector-conversions \
+// RUN: %clang_cc1 -target-cpu z14 -triple s390x-ibm-linux -flax-vector-conversions=none \
// RUN: -Wall -Wno-unused -Werror -emit-llvm %s -o - | FileCheck %s
typedef __attribute__((vector_size(16))) signed char vec_schar;
@@ -64,11 +64,11 @@
vd = __builtin_s390_vfnmadb(vd, vd, vd);
// CHECK: [[RES:%[^ ]+]] = call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}})
- // CHECK: fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, [[RES]]
+ // CHECK: fneg <2 x double> [[RES]]
vd = __builtin_s390_vfnmsdb(vd, vd, vd);
- // CHECK: [[NEG:%[^ ]+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%[^ ]+]] = fneg <2 x double> %{{.*}}
// CHECK: [[RES:%[^ ]+]] = call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> [[NEG]])
- // CHECK: fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, [[RES]]
+ // CHECK: fneg <2 x double> [[RES]]
vsi = __builtin_s390_vfcesbs(vf, vf, &cc);
// CHECK: call { <4 x i32>, i32 } @llvm.s390.vfcesbs(<4 x float> %{{.*}}, <4 x float> %{{.*}})
@@ -102,21 +102,21 @@
vf = __builtin_s390_vfmasb(vf, vf, vf);
// CHECK: call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
vf = __builtin_s390_vfmssb(vf, vf, vf);
- // CHECK: [[NEG:%[^ ]+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%[^ ]+]] = fneg <4 x float> %{{.*}}
// CHECK: call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> [[NEG]])
vf = __builtin_s390_vfnmasb(vf, vf, vf);
// CHECK: [[RES:%[^ ]+]] = call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
- // CHECK: fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, [[RES]]
+ // CHECK: fneg <4 x float> [[RES]]
vf = __builtin_s390_vfnmssb(vf, vf, vf);
- // CHECK: [[NEG:%[^ ]+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%[^ ]+]] = fneg <4 x float> %{{.*}}
// CHECK: [[RES:%[^ ]+]] = call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> [[NEG]])
- // CHECK: fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, [[RES]]
+ // CHECK: fneg <4 x float> [[RES]]
vf = __builtin_s390_vflpsb(vf);
// CHECK: call <4 x float> @llvm.fabs.v4f32(<4 x float> %{{.*}})
vf = __builtin_s390_vflnsb(vf);
// CHECK: [[ABS:%[^ ]+]] = call <4 x float> @llvm.fabs.v4f32(<4 x float> %{{.*}})
- // CHECK: fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, [[ABS]]
+ // CHECK: fneg <4 x float> [[ABS]]
vf = __builtin_s390_vfisb(vf, 0, 0);
// CHECK: call <4 x float> @llvm.rint.v4f32(<4 x float> %{{.*}})
diff --git a/src/llvm-project/clang/test/CodeGen/builtins-systemz-vector3-error.c b/src/llvm-project/clang/test/CodeGen/builtins-systemz-vector3-error.c
index 6583857..99b171c 100644
--- a/src/llvm-project/clang/test/CodeGen/builtins-systemz-vector3-error.c
+++ b/src/llvm-project/clang/test/CodeGen/builtins-systemz-vector3-error.c
@@ -1,5 +1,5 @@
// REQUIRES: systemz-registered-target
-// RUN: %clang_cc1 -target-cpu arch13 -triple s390x-unknown-unknown \
+// RUN: %clang_cc1 -target-cpu z15 -triple s390x-unknown-unknown \
// RUN: -Wall -Wno-unused -Werror -fsyntax-only -verify %s
typedef __attribute__((vector_size(16))) signed char vec_schar;
diff --git a/src/llvm-project/clang/test/CodeGen/builtins-systemz-vector3.c b/src/llvm-project/clang/test/CodeGen/builtins-systemz-vector3.c
index 976a3e2..e4af1c1 100644
--- a/src/llvm-project/clang/test/CodeGen/builtins-systemz-vector3.c
+++ b/src/llvm-project/clang/test/CodeGen/builtins-systemz-vector3.c
@@ -1,5 +1,5 @@
// REQUIRES: systemz-registered-target
-// RUN: %clang_cc1 -target-cpu arch13 -triple s390x-ibm-linux -fno-lax-vector-conversions \
+// RUN: %clang_cc1 -target-cpu z15 -triple s390x-ibm-linux -flax-vector-conversions=none \
// RUN: -Wall -Wno-unused -Werror -emit-llvm %s -o - | FileCheck %s
typedef __attribute__((vector_size(16))) signed char vec_schar;
diff --git a/src/llvm-project/clang/test/CodeGen/builtins-systemz-zvector-error.c b/src/llvm-project/clang/test/CodeGen/builtins-systemz-zvector-error.c
index cb60ea4..5fdcb40 100644
--- a/src/llvm-project/clang/test/CodeGen/builtins-systemz-zvector-error.c
+++ b/src/llvm-project/clang/test/CodeGen/builtins-systemz-zvector-error.c
@@ -1,6 +1,6 @@
// REQUIRES: systemz-registered-target
// RUN: %clang_cc1 -target-cpu z13 -triple s390x-linux-gnu \
-// RUN: -fzvector -fno-lax-vector-conversions \
+// RUN: -fzvector -flax-vector-conversions=none \
// RUN: -Wall -Wno-unused -Werror -fsyntax-only -verify %s
#include <vecintrin.h>
diff --git a/src/llvm-project/clang/test/CodeGen/builtins-systemz-zvector.c b/src/llvm-project/clang/test/CodeGen/builtins-systemz-zvector.c
index f814547..da0e720 100644
--- a/src/llvm-project/clang/test/CodeGen/builtins-systemz-zvector.c
+++ b/src/llvm-project/clang/test/CodeGen/builtins-systemz-zvector.c
@@ -1,9 +1,9 @@
// REQUIRES: systemz-registered-target
// RUN: %clang_cc1 -target-cpu z13 -triple s390x-linux-gnu \
-// RUN: -O -fzvector -fno-lax-vector-conversions \
+// RUN: -O -fzvector -flax-vector-conversions=none \
// RUN: -Wall -Wno-unused -Werror -emit-llvm %s -o - | FileCheck %s
// RUN: %clang_cc1 -target-cpu z13 -triple s390x-linux-gnu \
-// RUN: -O -fzvector -fno-lax-vector-conversions \
+// RUN: -O -fzvector -flax-vector-conversions=none \
// RUN: -Wall -Wno-unused -Werror -S %s -o - | FileCheck %s --check-prefix=CHECK-ASM
#include <vecintrin.h>
@@ -4442,14 +4442,14 @@
vd = vec_nabs(vd);
// CHECK: [[ABS:%[^ ]+]] = tail call <2 x double> @llvm.fabs.v2f64(<2 x double> %{{.*}})
- // CHECK-NEXT: fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, [[ABS]]
+ // CHECK-NEXT: fneg <2 x double> [[ABS]]
// CHECK-ASM: vflndb
vd = vec_madd(vd, vd, vd);
// CHECK: call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}})
// CHECK-ASM: vfmadb
vd = vec_msub(vd, vd, vd);
- // CHECK: [[NEG:%[^ ]+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%[^ ]+]] = fneg <2 x double> %{{.*}}
// CHECK: call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> [[NEG]])
// CHECK-ASM: vfmsdb
vd = vec_sqrt(vd);
diff --git a/src/llvm-project/clang/test/CodeGen/builtins-systemz-zvector2-error.c b/src/llvm-project/clang/test/CodeGen/builtins-systemz-zvector2-error.c
index 3b890b9..64fcbc4 100644
--- a/src/llvm-project/clang/test/CodeGen/builtins-systemz-zvector2-error.c
+++ b/src/llvm-project/clang/test/CodeGen/builtins-systemz-zvector2-error.c
@@ -1,6 +1,6 @@
// REQUIRES: systemz-registered-target
// RUN: %clang_cc1 -target-cpu z14 -triple s390x-linux-gnu \
-// RUN: -fzvector -fno-lax-vector-conversions \
+// RUN: -fzvector -flax-vector-conversions=none \
// RUN: -Wall -Wno-unused -Werror -fsyntax-only -verify %s
#include <vecintrin.h>
diff --git a/src/llvm-project/clang/test/CodeGen/builtins-systemz-zvector2.c b/src/llvm-project/clang/test/CodeGen/builtins-systemz-zvector2.c
index 990e4e5..a4f791e 100644
--- a/src/llvm-project/clang/test/CodeGen/builtins-systemz-zvector2.c
+++ b/src/llvm-project/clang/test/CodeGen/builtins-systemz-zvector2.c
@@ -1,9 +1,9 @@
// REQUIRES: systemz-registered-target
// RUN: %clang_cc1 -target-cpu z14 -triple s390x-linux-gnu \
-// RUN: -O -fzvector -fno-lax-vector-conversions \
+// RUN: -O -fzvector -flax-vector-conversions=none \
// RUN: -Wall -Wno-unused -Werror -emit-llvm %s -o - | FileCheck %s
// RUN: %clang_cc1 -target-cpu z14 -triple s390x-linux-gnu \
-// RUN: -O -fzvector -fno-lax-vector-conversions \
+// RUN: -O -fzvector -flax-vector-conversions=none \
// RUN: -Wall -Wno-unused -Werror -S %s -o - | FileCheck %s --check-prefix=CHECK-ASM
#include <vecintrin.h>
@@ -686,11 +686,11 @@
vf = vec_nabs(vf);
// CHECK: [[ABS:%[^ ]+]] = tail call <4 x float> @llvm.fabs.v4f32(<4 x float> %{{.*}})
- // CHECK-NEXT: fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, [[ABS]]
+ // CHECK-NEXT: fneg <4 x float> [[ABS]]
// CHECK-ASM: vflnsb
vd = vec_nabs(vd);
// CHECK: [[ABS:%[^ ]+]] = tail call <2 x double> @llvm.fabs.v2f64(<2 x double> %{{.*}})
- // CHECK-NEXT: fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, [[ABS]]
+ // CHECK-NEXT: fneg <2 x double> [[ABS]]
// CHECK-ASM: vflndb
vf = vec_max(vf, vf);
@@ -715,32 +715,32 @@
// CHECK-ASM: vfmadb
vf = vec_msub(vf, vf, vf);
- // CHECK: [[NEG:%[^ ]+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%[^ ]+]] = fneg <4 x float> %{{.*}}
// CHECK: call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> [[NEG]])
// CHECK-ASM: vfmssb
vd = vec_msub(vd, vd, vd);
- // CHECK: [[NEG:%[^ ]+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%[^ ]+]] = fneg <2 x double> %{{.*}}
// CHECK: call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> [[NEG]])
// CHECK-ASM: vfmsdb
vf = vec_nmadd(vf, vf, vf);
// CHECK: [[RES:%[^ ]+]] = tail call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
- // CHECK: fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, [[RES]]
+ // CHECK: fneg <4 x float> [[RES]]
// CHECK-ASM: vfnmasb
vd = vec_nmadd(vd, vd, vd);
// CHECK: [[RES:%[^ ]+]] = tail call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}})
- // CHECK: fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, [[RES]]
+ // CHECK: fneg <2 x double> [[RES]]
// CHECK-ASM: vfnmadb
vf = vec_nmsub(vf, vf, vf);
- // CHECK: [[NEG:%[^ ]+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%[^ ]+]] = fneg <4 x float> %{{.*}}
// CHECK: [[RES:%[^ ]+]] = tail call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> [[NEG]])
- // CHECK: fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, [[RES]]
+ // CHECK: fneg <4 x float> [[RES]]
// CHECK-ASM: vfnmssb
vd = vec_nmsub(vd, vd, vd);
- // CHECK: [[NEG:%[^ ]+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%[^ ]+]] = fneg <2 x double> %{{.*}}
// CHECK: [[RES:%[^ ]+]] = tail call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> [[NEG]])
- // CHECK: fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, [[RES]]
+ // CHECK: fneg <2 x double> [[RES]]
// CHECK-ASM: vfnmsdb
vf = vec_sqrt(vf);
diff --git a/src/llvm-project/clang/test/CodeGen/builtins-systemz-zvector3-error.c b/src/llvm-project/clang/test/CodeGen/builtins-systemz-zvector3-error.c
index 286cd3c..557b9a3 100644
--- a/src/llvm-project/clang/test/CodeGen/builtins-systemz-zvector3-error.c
+++ b/src/llvm-project/clang/test/CodeGen/builtins-systemz-zvector3-error.c
@@ -1,6 +1,6 @@
// REQUIRES: systemz-registered-target
-// RUN: %clang_cc1 -target-cpu arch13 -triple s390x-linux-gnu \
-// RUN: -fzvector -fno-lax-vector-conversions \
+// RUN: %clang_cc1 -target-cpu z15 -triple s390x-linux-gnu \
+// RUN: -fzvector -flax-vector-conversions=none \
// RUN: -Wall -Wno-unused -Werror -fsyntax-only -verify %s
#include <vecintrin.h>
diff --git a/src/llvm-project/clang/test/CodeGen/builtins-systemz-zvector3.c b/src/llvm-project/clang/test/CodeGen/builtins-systemz-zvector3.c
index 1367d87..a987c61 100644
--- a/src/llvm-project/clang/test/CodeGen/builtins-systemz-zvector3.c
+++ b/src/llvm-project/clang/test/CodeGen/builtins-systemz-zvector3.c
@@ -1,9 +1,9 @@
// REQUIRES: systemz-registered-target
-// RUN: %clang_cc1 -target-cpu arch13 -triple s390x-linux-gnu \
-// RUN: -O -fzvector -fno-lax-vector-conversions \
+// RUN: %clang_cc1 -target-cpu z15 -triple s390x-linux-gnu \
+// RUN: -O -fzvector -flax-vector-conversions=none \
// RUN: -Wall -Wno-unused -Werror -emit-llvm %s -o - | FileCheck %s
-// RUN: %clang_cc1 -target-cpu arch13 -triple s390x-linux-gnu \
-// RUN: -O -fzvector -fno-lax-vector-conversions \
+// RUN: %clang_cc1 -target-cpu z15 -triple s390x-linux-gnu \
+// RUN: -O -fzvector -flax-vector-conversions=none \
// RUN: -Wall -Wno-unused -Werror -S %s -o - | FileCheck %s --check-prefix=CHECK-ASM
#include <vecintrin.h>
diff --git a/src/llvm-project/clang/test/CodeGen/builtins-wasm.c b/src/llvm-project/clang/test/CodeGen/builtins-wasm.c
index 8a17fb3..5a6ae7a 100644
--- a/src/llvm-project/clang/test/CodeGen/builtins-wasm.c
+++ b/src/llvm-project/clang/test/CodeGen/builtins-wasm.c
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -triple wasm32-unknown-unknown -target-feature +unimplemented-simd128 -target-feature +nontrapping-fptoint -target-feature +exception-handling -target-feature +bulk-memory -fno-lax-vector-conversions -O3 -emit-llvm -o - %s | FileCheck %s -check-prefixes WEBASSEMBLY,WEBASSEMBLY32
-// RUN: %clang_cc1 -triple wasm64-unknown-unknown -target-feature +unimplemented-simd128 -target-feature +nontrapping-fptoint -target-feature +exception-handling -target-feature +bulk-memory -fno-lax-vector-conversions -O3 -emit-llvm -o - %s | FileCheck %s -check-prefixes WEBASSEMBLY,WEBASSEMBLY64
-// RUN: not %clang_cc1 -triple wasm64-unknown-unknown -target-feature +nontrapping-fptoint -target-feature +exception-handling -target-feature +bulk-memory -fno-lax-vector-conversions -O3 -emit-llvm -o - %s 2>&1 | FileCheck %s -check-prefixes MISSING-SIMD
+// RUN: %clang_cc1 -triple wasm32-unknown-unknown -target-feature +unimplemented-simd128 -target-feature +nontrapping-fptoint -target-feature +exception-handling -target-feature +bulk-memory -flax-vector-conversions=none -O3 -emit-llvm -o - %s | FileCheck %s -check-prefixes WEBASSEMBLY,WEBASSEMBLY32
+// RUN: %clang_cc1 -triple wasm64-unknown-unknown -target-feature +unimplemented-simd128 -target-feature +nontrapping-fptoint -target-feature +exception-handling -target-feature +bulk-memory -flax-vector-conversions=none -O3 -emit-llvm -o - %s | FileCheck %s -check-prefixes WEBASSEMBLY,WEBASSEMBLY64
+// RUN: not %clang_cc1 -triple wasm64-unknown-unknown -target-feature +nontrapping-fptoint -target-feature +exception-handling -target-feature +bulk-memory -flax-vector-conversions=none -O3 -emit-llvm -o - %s 2>&1 | FileCheck %s -check-prefixes MISSING-SIMD
// SIMD convenience types
typedef char i8x16 __attribute((vector_size(16)));
@@ -44,6 +44,17 @@
// WEBASSEMBLY64: call i64 @llvm.wasm.tls.size.i64()
}
+__SIZE_TYPE__ tls_align() {
+ return __builtin_wasm_tls_align();
+ // WEBASSEMBLY32: call i32 @llvm.wasm.tls.align.i32()
+ // WEBASSEMBLY64: call i64 @llvm.wasm.tls.align.i64()
+}
+
+void *tls_base() {
+ return __builtin_wasm_tls_base();
+ // WEBASSEMBLY: call i8* @llvm.wasm.tls.base()
+}
+
void throw(void *obj) {
return __builtin_wasm_throw(0, obj);
// WEBASSEMBLY32: call void @llvm.wasm.throw(i32 0, i8* %{{.*}})
@@ -74,6 +85,54 @@
// WEBASSEMBLY64: call i32 @llvm.wasm.atomic.notify(i32* %{{.*}}, i32 %{{.*}})
}
+int trunc_s_i32_f32(float f) {
+ return __builtin_wasm_trunc_s_i32_f32(f);
+ // WEBASSEMBLY: call i32 @llvm.wasm.trunc.signed.i32.f32(float %f)
+ // WEBASSEMBLY-NEXT: ret
+}
+
+int trunc_u_i32_f32(float f) {
+ return __builtin_wasm_trunc_u_i32_f32(f);
+ // WEBASSEMBLY: call i32 @llvm.wasm.trunc.unsigned.i32.f32(float %f)
+ // WEBASSEMBLY-NEXT: ret
+}
+
+int trunc_s_i32_f64(double f) {
+ return __builtin_wasm_trunc_s_i32_f64(f);
+ // WEBASSEMBLY: call i32 @llvm.wasm.trunc.signed.i32.f64(double %f)
+ // WEBASSEMBLY-NEXT: ret
+}
+
+int trunc_u_i32_f64(double f) {
+ return __builtin_wasm_trunc_u_i32_f64(f);
+ // WEBASSEMBLY: call i32 @llvm.wasm.trunc.unsigned.i32.f64(double %f)
+ // WEBASSEMBLY-NEXT: ret
+}
+
+long long trunc_s_i64_f32(float f) {
+ return __builtin_wasm_trunc_s_i64_f32(f);
+ // WEBASSEMBLY: call i64 @llvm.wasm.trunc.signed.i64.f32(float %f)
+ // WEBASSEMBLY-NEXT: ret
+}
+
+long long trunc_u_i64_f32(float f) {
+ return __builtin_wasm_trunc_u_i64_f32(f);
+ // WEBASSEMBLY: call i64 @llvm.wasm.trunc.unsigned.i64.f32(float %f)
+ // WEBASSEMBLY-NEXT: ret
+}
+
+long long trunc_s_i64_f64(double f) {
+ return __builtin_wasm_trunc_s_i64_f64(f);
+ // WEBASSEMBLY: call i64 @llvm.wasm.trunc.signed.i64.f64(double %f)
+ // WEBASSEMBLY-NEXT: ret
+}
+
+long long trunc_u_i64_f64(double f) {
+ return __builtin_wasm_trunc_u_i64_f64(f);
+ // WEBASSEMBLY: call i64 @llvm.wasm.trunc.unsigned.i64.f64(double %f)
+ // WEBASSEMBLY-NEXT: ret
+}
+
int trunc_saturate_s_i32_f32(float f) {
return __builtin_wasm_trunc_saturate_s_i32_f32(f);
// WEBASSEMBLY: call i32 @llvm.wasm.trunc.saturate.signed.i32.f32(float %f)
@@ -146,7 +205,6 @@
// WEBASSEMBLY-NEXT: ret
}
-
int extract_lane_s_i8x16(i8x16 v) {
return __builtin_wasm_extract_lane_s_i8x16(v, 13);
// MISSING-SIMD: error: '__builtin_wasm_extract_lane_s_i8x16' needs target feature simd128
@@ -294,6 +352,26 @@
// WEBASSEMBLY-NEXT: ret
}
+i8x16 avgr_u_i8x16(i8x16 x, i8x16 y) {
+ return __builtin_wasm_avgr_u_i8x16(x, y);
+ // WEBASSEMBLY: call <16 x i8> @llvm.wasm.avgr.unsigned.v16i8(
+ // WEBASSEMBLY-SAME: <16 x i8> %x, <16 x i8> %y)
+ // WEBASSEMBLY-NEXT: ret
+}
+
+i16x8 avgr_u_i16x8(i16x8 x, i16x8 y) {
+ return __builtin_wasm_avgr_u_i16x8(x, y);
+ // WEBASSEMBLY: call <8 x i16> @llvm.wasm.avgr.unsigned.v8i16(
+ // WEBASSEMBLY-SAME: <8 x i16> %x, <8 x i16> %y)
+ // WEBASSEMBLY-NEXT: ret
+}
+
+i32x4 dot_i16x8_s(i16x8 x, i16x8 y) {
+ return __builtin_wasm_dot_s_i32x4_i16x8(x, y);
+ // WEBASSEMBLY: call <4 x i32> @llvm.wasm.dot(<8 x i16> %x, <8 x i16> %y)
+ // WEBASSEMBLY-NEXT: ret
+}
+
i32x4 bitselect(i32x4 x, i32x4 y, i32x4 c) {
return __builtin_wasm_bitselect(x, y, c);
// WEBASSEMBLY: call <4 x i32> @llvm.wasm.bitselect.v4i32(
@@ -401,6 +479,34 @@
// WEBASSEMBLY: ret
}
+f32x4 qfma_f32x4(f32x4 a, f32x4 b, f32x4 c) {
+ return __builtin_wasm_qfma_f32x4(a, b, c);
+ // WEBASSEMBLY: call <4 x float> @llvm.wasm.qfma.v4f32(
+ // WEBASSEMBLY-SAME: <4 x float> %a, <4 x float> %b, <4 x float> %c)
+ // WEBASSEMBLY-NEXT: ret
+}
+
+f32x4 qfms_f32x4(f32x4 a, f32x4 b, f32x4 c) {
+ return __builtin_wasm_qfms_f32x4(a, b, c);
+ // WEBASSEMBLY: call <4 x float> @llvm.wasm.qfms.v4f32(
+ // WEBASSEMBLY-SAME: <4 x float> %a, <4 x float> %b, <4 x float> %c)
+ // WEBASSEMBLY-NEXT: ret
+}
+
+f64x2 qfma_f64x2(f64x2 a, f64x2 b, f64x2 c) {
+ return __builtin_wasm_qfma_f64x2(a, b, c);
+ // WEBASSEMBLY: call <2 x double> @llvm.wasm.qfma.v2f64(
+ // WEBASSEMBLY-SAME: <2 x double> %a, <2 x double> %b, <2 x double> %c)
+ // WEBASSEMBLY-NEXT: ret
+}
+
+f64x2 qfms_f64x2(f64x2 a, f64x2 b, f64x2 c) {
+ return __builtin_wasm_qfms_f64x2(a, b, c);
+ // WEBASSEMBLY: call <2 x double> @llvm.wasm.qfms.v2f64(
+ // WEBASSEMBLY-SAME: <2 x double> %a, <2 x double> %b, <2 x double> %c)
+ // WEBASSEMBLY-NEXT: ret
+}
+
i32x4 trunc_saturate_s_i32x4_f32x4(f32x4 f) {
return __builtin_wasm_trunc_saturate_s_i32x4_f32x4(f);
// WEBASSEMBLY: call <4 x i32> @llvm.wasm.trunc.saturate.signed.v4i32.v4f32(<4 x float> %f)
@@ -413,14 +519,84 @@
// WEBASSEMBLY-NEXT: ret
}
-i64x2 trunc_saturate_s_i64x2_f64x2(f64x2 f) {
- return __builtin_wasm_trunc_saturate_s_i64x2_f64x2(f);
- // WEBASSEMBLY: call <2 x i64> @llvm.wasm.trunc.saturate.signed.v2i64.v2f64(<2 x double> %f)
- // WEBASSEMBLY-NEXT: ret
+i8x16 narrow_s_i8x16_i16x8(i16x8 low, i16x8 high) {
+ return __builtin_wasm_narrow_s_i8x16_i16x8(low, high);
+ // WEBASSEMBLY: call <16 x i8> @llvm.wasm.narrow.signed.v16i8.v8i16(
+ // WEBASSEMBLY-SAME: <8 x i16> %low, <8 x i16> %high)
+ // WEBASSEMBLY: ret
}
-i64x2 trunc_saturate_u_i64x2_f64x2(f64x2 f) {
- return __builtin_wasm_trunc_saturate_u_i64x2_f64x2(f);
- // WEBASSEMBLY: call <2 x i64> @llvm.wasm.trunc.saturate.unsigned.v2i64.v2f64(<2 x double> %f)
+i8x16 narrow_u_i8x16_i16x8(i16x8 low, i16x8 high) {
+ return __builtin_wasm_narrow_u_i8x16_i16x8(low, high);
+ // WEBASSEMBLY: call <16 x i8> @llvm.wasm.narrow.unsigned.v16i8.v8i16(
+ // WEBASSEMBLY-SAME: <8 x i16> %low, <8 x i16> %high)
+ // WEBASSEMBLY: ret
+}
+
+i16x8 narrow_s_i16x8_i32x4(i32x4 low, i32x4 high) {
+ return __builtin_wasm_narrow_s_i16x8_i32x4(low, high);
+ // WEBASSEMBLY: call <8 x i16> @llvm.wasm.narrow.signed.v8i16.v4i32(
+ // WEBASSEMBLY-SAME: <4 x i32> %low, <4 x i32> %high)
+ // WEBASSEMBLY: ret
+}
+
+i16x8 narrow_u_i16x8_i32x4(i32x4 low, i32x4 high) {
+ return __builtin_wasm_narrow_u_i16x8_i32x4(low, high);
+ // WEBASSEMBLY: call <8 x i16> @llvm.wasm.narrow.unsigned.v8i16.v4i32(
+ // WEBASSEMBLY-SAME: <4 x i32> %low, <4 x i32> %high)
+ // WEBASSEMBLY: ret
+}
+
+i16x8 widen_low_s_i16x8_i8x16(i8x16 v) {
+ return __builtin_wasm_widen_low_s_i16x8_i8x16(v);
+ // WEBASSEMBLY: call <8 x i16> @llvm.wasm.widen.low.signed.v8i16.v16i8(<16 x i8> %v)
+ // WEBASSEMBLY: ret
+}
+
+i16x8 widen_high_s_i16x8_i8x16(i8x16 v) {
+ return __builtin_wasm_widen_high_s_i16x8_i8x16(v);
+ // WEBASSEMBLY: call <8 x i16> @llvm.wasm.widen.high.signed.v8i16.v16i8(<16 x i8> %v)
+ // WEBASSEMBLY: ret
+}
+
+i16x8 widen_low_u_i16x8_i8x16(i8x16 v) {
+ return __builtin_wasm_widen_low_u_i16x8_i8x16(v);
+ // WEBASSEMBLY: call <8 x i16> @llvm.wasm.widen.low.unsigned.v8i16.v16i8(<16 x i8> %v)
+ // WEBASSEMBLY: ret
+}
+
+i16x8 widen_high_u_i16x8_i8x16(i8x16 v) {
+ return __builtin_wasm_widen_high_u_i16x8_i8x16(v);
+ // WEBASSEMBLY: call <8 x i16> @llvm.wasm.widen.high.unsigned.v8i16.v16i8(<16 x i8> %v)
+ // WEBASSEMBLY: ret
+}
+
+i32x4 widen_low_s_i32x4_i16x8(i16x8 v) {
+ return __builtin_wasm_widen_low_s_i32x4_i16x8(v);
+ // WEBASSEMBLY: call <4 x i32> @llvm.wasm.widen.low.signed.v4i32.v8i16(<8 x i16> %v)
+ // WEBASSEMBLY: ret
+}
+
+i32x4 widen_high_s_i32x4_i16x8(i16x8 v) {
+ return __builtin_wasm_widen_high_s_i32x4_i16x8(v);
+ // WEBASSEMBLY: call <4 x i32> @llvm.wasm.widen.high.signed.v4i32.v8i16(<8 x i16> %v)
+ // WEBASSEMBLY: ret
+}
+
+i32x4 widen_low_u_i32x4_i16x8(i16x8 v) {
+ return __builtin_wasm_widen_low_u_i32x4_i16x8(v);
+ // WEBASSEMBLY: call <4 x i32> @llvm.wasm.widen.low.unsigned.v4i32.v8i16(<8 x i16> %v)
+ // WEBASSEMBLY: ret
+}
+
+i32x4 widen_high_u_i32x4_i16x8(i16x8 v) {
+ return __builtin_wasm_widen_high_u_i32x4_i16x8(v);
+ // WEBASSEMBLY: call <4 x i32> @llvm.wasm.widen.high.unsigned.v4i32.v8i16(<8 x i16> %v)
+ // WEBASSEMBLY: ret
+}
+
+i8x16 swizzle_v8x16(i8x16 x, i8x16 y) {
+ return __builtin_wasm_swizzle_v8x16(x, y);
+ // WEBASSEMBLY: call <16 x i8> @llvm.wasm.swizzle(<16 x i8> %x, <16 x i8> %y)
// WEBASSEMBLY-NEXT: ret
}
diff --git a/src/llvm-project/clang/test/CodeGen/builtins.c b/src/llvm-project/clang/test/CodeGen/builtins.c
index 5b48254..9f2a74f 100644
--- a/src/llvm-project/clang/test/CodeGen/builtins.c
+++ b/src/llvm-project/clang/test/CodeGen/builtins.c
@@ -193,8 +193,12 @@
}
// CHECK-LABEL: define void @test_float_builtins
-void test_float_builtins(float F, double D, long double LD) {
+void test_float_builtins(__fp16 *H, float F, double D, long double LD) {
volatile int res;
+ res = __builtin_isinf(*H);
+ // CHECK: call half @llvm.fabs.f16(half
+ // CHECK: fcmp oeq half {{.*}}, 0xH7C00
+
res = __builtin_isinf(F);
// CHECK: call float @llvm.fabs.f32(float
// CHECK: fcmp oeq float {{.*}}, 0x7FF0000000000000
@@ -207,6 +211,14 @@
// CHECK: call x86_fp80 @llvm.fabs.f80(x86_fp80
// CHECK: fcmp oeq x86_fp80 {{.*}}, 0xK7FFF8000000000000000
+ res = __builtin_isinf_sign(*H);
+ // CHECK: %[[ABS:.*]] = call half @llvm.fabs.f16(half %[[ARG:.*]])
+ // CHECK: %[[ISINF:.*]] = fcmp oeq half %[[ABS]], 0xH7C00
+ // CHECK: %[[BITCAST:.*]] = bitcast half %[[ARG]] to i16
+ // CHECK: %[[ISNEG:.*]] = icmp slt i16 %[[BITCAST]], 0
+ // CHECK: %[[SIGN:.*]] = select i1 %[[ISNEG]], i32 -1, i32 1
+ // CHECK: select i1 %[[ISINF]], i32 %[[SIGN]], i32 0
+
res = __builtin_isinf_sign(F);
// CHECK: %[[ABS:.*]] = call float @llvm.fabs.f32(float %[[ARG:.*]])
// CHECK: %[[ISINF:.*]] = fcmp oeq float %[[ABS]], 0x7FF0000000000000
@@ -231,6 +243,10 @@
// CHECK: %[[SIGN:.*]] = select i1 %[[ISNEG]], i32 -1, i32 1
// CHECK: select i1 %[[ISINF]], i32 %[[SIGN]], i32 0
+ res = __builtin_isfinite(*H);
+ // CHECK: call half @llvm.fabs.f16(half
+ // CHECK: fcmp one half {{.*}}, 0xH7C00
+
res = __builtin_isfinite(F);
// CHECK: call float @llvm.fabs.f32(float
// CHECK: fcmp one float {{.*}}, 0x7FF0000000000000
@@ -239,6 +255,14 @@
// CHECK: call double @llvm.fabs.f64(double
// CHECK: fcmp one double {{.*}}, 0x7FF0000000000000
+ res = __builtin_isnormal(*H);
+ // CHECK: fcmp oeq half
+ // CHECK: call half @llvm.fabs.f16(half
+ // CHECK: fcmp ult half {{.*}}, 0xH7C00
+ // CHECK: fcmp uge half {{.*}}, 0xH0400
+ // CHECK: and i1
+ // CHECK: and i1
+
res = __builtin_isnormal(F);
// CHECK: fcmp oeq float
// CHECK: call float @llvm.fabs.f32(float
@@ -429,6 +453,13 @@
int *d = __builtin_launder(p);
}
+// __warn_memset_zero_len should be NOP, see https://sourceware.org/bugzilla/show_bug.cgi?id=25399
+// CHECK-LABEL: define void @test___warn_memset_zero_len
+void test___warn_memset_zero_len() {
+ // CHECK-NOT: @__warn_memset_zero_len
+ __warn_memset_zero_len();
+}
+
// Behavior of __builtin_os_log differs between platforms, so only test on X86
#ifdef __x86_64__
diff --git a/src/llvm-project/clang/test/CodeGen/catch-alignment-assumption-builtin_assume_aligned-three-params-variable.cpp b/src/llvm-project/clang/test/CodeGen/catch-alignment-assumption-builtin_assume_aligned-three-params-variable.cpp
index 4384b9c..4306e32 100644
--- a/src/llvm-project/clang/test/CodeGen/catch-alignment-assumption-builtin_assume_aligned-three-params-variable.cpp
+++ b/src/llvm-project/clang/test/CodeGen/catch-alignment-assumption-builtin_assume_aligned-three-params-variable.cpp
@@ -18,13 +18,13 @@
// CHECK-NEXT: %[[OFFSET_RELOADED:.*]] = load i64, i64* %[[OFFSET_ADDR]], align 8
// CHECK-NEXT: %[[PTRINT:.*]] = ptrtoint i8* %[[BITCAST]] to i64
// CHECK-NEXT: %[[OFFSETPTR:.*]] = sub i64 %[[PTRINT]], %[[OFFSET_RELOADED]]
- // CHECK-NEXT: %[[MASKEDPTR:.*]] = and i64 %[[OFFSETPTR]], 2147483647
+ // CHECK-NEXT: %[[MASKEDPTR:.*]] = and i64 %[[OFFSETPTR]], 536870911
// CHECK-NEXT: %[[MASKCOND:.*]] = icmp eq i64 %[[MASKEDPTR]], 0
// CHECK-SANITIZE-NEXT: %[[PTRINT_DUP:.*]] = ptrtoint i8* %[[BITCAST]] to i64, !nosanitize
// CHECK-SANITIZE-NEXT: br i1 %[[MASKCOND]], label %[[CONT:.*]], label %[[HANDLER_ALIGNMENT_ASSUMPTION:[^,]+]],{{.*}} !nosanitize
// CHECK-SANITIZE: [[HANDLER_ALIGNMENT_ASSUMPTION]]:
- // CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_alignment_assumption_abort(i8* bitcast ({ {{{.*}}}, {{{.*}}}, {{{.*}}}* }* @[[LINE_100_ALIGNMENT_ASSUMPTION]] to i8*), i64 %[[PTRINT_DUP]], i64 2147483648, i64 %[[OFFSET_RELOADED]]){{.*}}, !nosanitize
- // CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_alignment_assumption(i8* bitcast ({ {{{.*}}}, {{{.*}}}, {{{.*}}}* }* @[[LINE_100_ALIGNMENT_ASSUMPTION]] to i8*), i64 %[[PTRINT_DUP]], i64 2147483648, i64 %[[OFFSET_RELOADED]]){{.*}}, !nosanitize
+ // CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_alignment_assumption_abort(i8* bitcast ({ {{{.*}}}, {{{.*}}}, {{{.*}}}* }* @[[LINE_100_ALIGNMENT_ASSUMPTION]] to i8*), i64 %[[PTRINT_DUP]], i64 536870912, i64 %[[OFFSET_RELOADED]]){{.*}}, !nosanitize
+ // CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_alignment_assumption(i8* bitcast ({ {{{.*}}}, {{{.*}}}, {{{.*}}}* }* @[[LINE_100_ALIGNMENT_ASSUMPTION]] to i8*), i64 %[[PTRINT_DUP]], i64 536870912, i64 %[[OFFSET_RELOADED]]){{.*}}, !nosanitize
// CHECK-SANITIZE-TRAP-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
// CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
// CHECK-SANITIZE: [[CONT]]:
diff --git a/src/llvm-project/clang/test/CodeGen/catch-alignment-assumption-builtin_assume_aligned-three-params.cpp b/src/llvm-project/clang/test/CodeGen/catch-alignment-assumption-builtin_assume_aligned-three-params.cpp
index 18a5734..27f53e9 100644
--- a/src/llvm-project/clang/test/CodeGen/catch-alignment-assumption-builtin_assume_aligned-three-params.cpp
+++ b/src/llvm-project/clang/test/CodeGen/catch-alignment-assumption-builtin_assume_aligned-three-params.cpp
@@ -15,13 +15,13 @@
// CHECK-NEXT: %[[BITCAST:.*]] = bitcast i8** %[[X_RELOADED]] to i8*
// CHECK-NEXT: %[[PTRINT:.*]] = ptrtoint i8* %[[BITCAST]] to i64
// CHECK-NEXT: %[[OFFSETPTR:.*]] = sub i64 %[[PTRINT]], 42
- // CHECK-NEXT: %[[MASKEDPTR:.*]] = and i64 %[[OFFSETPTR]], 2147483647
+ // CHECK-NEXT: %[[MASKEDPTR:.*]] = and i64 %[[OFFSETPTR]], 536870911
// CHECK-NEXT: %[[MASKCOND:.*]] = icmp eq i64 %[[MASKEDPTR]], 0
// CHECK-SANITIZE-NEXT: %[[PTRINT_DUP:.*]] = ptrtoint i8* %[[BITCAST]] to i64, !nosanitize
// CHECK-SANITIZE-NEXT: br i1 %[[MASKCOND]], label %[[CONT:.*]], label %[[HANDLER_ALIGNMENT_ASSUMPTION:[^,]+]],{{.*}} !nosanitize
// CHECK-SANITIZE: [[HANDLER_ALIGNMENT_ASSUMPTION]]:
- // CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_alignment_assumption_abort(i8* bitcast ({ {{{.*}}}, {{{.*}}}, {{{.*}}}* }* @[[LINE_100_ALIGNMENT_ASSUMPTION]] to i8*), i64 %[[PTRINT_DUP]], i64 2147483648, i64 42){{.*}}, !nosanitize
- // CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_alignment_assumption(i8* bitcast ({ {{{.*}}}, {{{.*}}}, {{{.*}}}* }* @[[LINE_100_ALIGNMENT_ASSUMPTION]] to i8*), i64 %[[PTRINT_DUP]], i64 2147483648, i64 42){{.*}}, !nosanitize
+ // CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_alignment_assumption_abort(i8* bitcast ({ {{{.*}}}, {{{.*}}}, {{{.*}}}* }* @[[LINE_100_ALIGNMENT_ASSUMPTION]] to i8*), i64 %[[PTRINT_DUP]], i64 536870912, i64 42){{.*}}, !nosanitize
+ // CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_alignment_assumption(i8* bitcast ({ {{{.*}}}, {{{.*}}}, {{{.*}}}* }* @[[LINE_100_ALIGNMENT_ASSUMPTION]] to i8*), i64 %[[PTRINT_DUP]], i64 536870912, i64 42){{.*}}, !nosanitize
// CHECK-SANITIZE-TRAP-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
// CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
// CHECK-SANITIZE: [[CONT]]:
diff --git a/src/llvm-project/clang/test/CodeGen/catch-alignment-assumption-builtin_assume_aligned-two-params.cpp b/src/llvm-project/clang/test/CodeGen/catch-alignment-assumption-builtin_assume_aligned-two-params.cpp
index fe43847..5412270 100644
--- a/src/llvm-project/clang/test/CodeGen/catch-alignment-assumption-builtin_assume_aligned-two-params.cpp
+++ b/src/llvm-project/clang/test/CodeGen/catch-alignment-assumption-builtin_assume_aligned-two-params.cpp
@@ -14,13 +14,13 @@
// CHECK-NEXT: %[[X_RELOADED:.*]] = load i8**, i8*** %[[X_ADDR]], align 8
// CHECK-NEXT: %[[BITCAST:.*]] = bitcast i8** %[[X_RELOADED]] to i8*
// CHECK-NEXT: %[[PTRINT:.*]] = ptrtoint i8* %[[BITCAST]] to i64
- // CHECK-NEXT: %[[MASKEDPTR:.*]] = and i64 %[[PTRINT]], 2147483647
+ // CHECK-NEXT: %[[MASKEDPTR:.*]] = and i64 %[[PTRINT]], 536870911
// CHECK-NEXT: %[[MASKCOND:.*]] = icmp eq i64 %[[MASKEDPTR]], 0
// CHECK-SANITIZE-NEXT: %[[PTRINT_DUP:.*]] = ptrtoint i8* %[[BITCAST]] to i64, !nosanitize
// CHECK-SANITIZE-NEXT: br i1 %[[MASKCOND]], label %[[CONT:.*]], label %[[HANDLER_ALIGNMENT_ASSUMPTION:[^,]+]],{{.*}} !nosanitize
// CHECK-SANITIZE: [[HANDLER_ALIGNMENT_ASSUMPTION]]:
- // CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_alignment_assumption_abort(i8* bitcast ({ {{{.*}}}, {{{.*}}}, {{{.*}}}* }* @[[LINE_100_ALIGNMENT_ASSUMPTION]] to i8*), i64 %[[PTRINT_DUP]], i64 2147483648, i64 0){{.*}}, !nosanitize
- // CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_alignment_assumption(i8* bitcast ({ {{{.*}}}, {{{.*}}}, {{{.*}}}* }* @[[LINE_100_ALIGNMENT_ASSUMPTION]] to i8*), i64 %[[PTRINT_DUP]], i64 2147483648, i64 0){{.*}}, !nosanitize
+ // CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_alignment_assumption_abort(i8* bitcast ({ {{{.*}}}, {{{.*}}}, {{{.*}}}* }* @[[LINE_100_ALIGNMENT_ASSUMPTION]] to i8*), i64 %[[PTRINT_DUP]], i64 536870912, i64 0){{.*}}, !nosanitize
+ // CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_alignment_assumption(i8* bitcast ({ {{{.*}}}, {{{.*}}}, {{{.*}}}* }* @[[LINE_100_ALIGNMENT_ASSUMPTION]] to i8*), i64 %[[PTRINT_DUP]], i64 536870912, i64 0){{.*}}, !nosanitize
// CHECK-SANITIZE-TRAP-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
// CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
// CHECK-SANITIZE: [[CONT]]:
diff --git a/src/llvm-project/clang/test/CodeGen/catch-implicit-conversions-basics-negatives.c b/src/llvm-project/clang/test/CodeGen/catch-implicit-conversions-basics-negatives.c
new file mode 100644
index 0000000..2e060cf
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/catch-implicit-conversions-basics-negatives.c
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -fsanitize=implicit-unsigned-integer-truncation,implicit-signed-integer-truncation,implicit-integer-sign-change -fsanitize-recover=implicit-unsigned-integer-truncation,implicit-signed-integer-truncation,implicit-integer-sign-change -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_implicit_conversion" --check-prefixes=CHECK
+
+// If we have an enum, it will be promoted to an unsigned integer.
+// But both types are unsigned, and have same bitwidth.
+// So we should not emit any sanitization. Also, for inc/dec we currently assume
+// (assert) that we will only have cases where at least one of the types
+// is signed, which isn't the case here.
+typedef enum { a } b;
+b t0(b c) {
+ c--;
+ return c;
+}
diff --git a/src/llvm-project/clang/test/CodeGen/catch-implicit-conversions-incdec-basics.c b/src/llvm-project/clang/test/CodeGen/catch-implicit-conversions-incdec-basics.c
new file mode 100644
index 0000000..e97a72c
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/catch-implicit-conversions-incdec-basics.c
@@ -0,0 +1,139 @@
+// RUN: %clang_cc1 -fsanitize=implicit-unsigned-integer-truncation,implicit-signed-integer-truncation,implicit-integer-sign-change -fsanitize-recover=implicit-unsigned-integer-truncation,implicit-signed-integer-truncation,implicit-integer-sign-change -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_implicit_conversion" --check-prefixes=CHECK
+
+// CHECK-DAG: @[[INT:.*]] = {{.*}} c"'int'\00" }
+// CHECK-DAG: @[[UNSIGNED_SHORT:.*]] = {{.*}} c"'unsigned short'\00" }
+// CHECK-DAG: @[[LINE_100:.*]] = {{.*}}, i32 100, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_SHORT]], i8 2 }
+// CHECK-DAG: @[[LINE_200:.*]] = {{.*}}, i32 200, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_SHORT]], i8 2 }
+// CHECK-DAG: @[[LINE_300:.*]] = {{.*}}, i32 300, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_SHORT]], i8 2 }
+// CHECK-DAG: @[[LINE_400:.*]] = {{.*}}, i32 400, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_SHORT]], i8 2 }
+// CHECK-DAG: @[[SHORT:.*]] = {{.*}} c"'short'\00" }
+// CHECK-DAG: @[[LINE_500:.*]] = {{.*}}, i32 500, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[SHORT]], i8 2 }
+// CHECK-DAG: @[[LINE_600:.*]] = {{.*}}, i32 600, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[SHORT]], i8 2 }
+// CHECK-DAG: @[[LINE_700:.*]] = {{.*}}, i32 700, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[SHORT]], i8 2 }
+// CHECK-DAG: @[[LINE_800:.*]] = {{.*}}, i32 800, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[SHORT]], i8 2 }
+// CHECK-DAG: @[[UNSIGNED_CHAR:.*]] = {{.*}} c"'unsigned char'\00" }
+// CHECK-DAG: @[[LINE_900:.*]] = {{.*}}, i32 900, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_CHAR]], i8 2 }
+// CHECK-DAG: @[[LINE_1000:.*]] = {{.*}}, i32 1000, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_CHAR]], i8 2 }
+// CHECK-DAG: @[[LINE_1100:.*]] = {{.*}}, i32 1100, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_CHAR]], i8 2 }
+// CHECK-DAG: @[[LINE_1200:.*]] = {{.*}}, i32 1200, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_CHAR]], i8 2 }
+// CHECK-DAG: @[[SIGNED_CHAR:.*]] = {{.*}} c"'signed char'\00" }
+// CHECK-DAG: @[[LINE_1300:.*]] = {{.*}}, i32 1300, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[SIGNED_CHAR]], i8 2 }
+// CHECK-DAG: @[[LINE_1400:.*]] = {{.*}}, i32 1400, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[SIGNED_CHAR]], i8 2 }
+// CHECK-DAG: @[[LINE_1500:.*]] = {{.*}}, i32 1500, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[SIGNED_CHAR]], i8 2 }
+// CHECK-DAG: @[[LINE_1600:.*]] = {{.*}}, i32 1600, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[SIGNED_CHAR]], i8 2 }
+
+// CHECK-LABEL: @t0(
+unsigned short t0(unsigned short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_100]] to i8*)
+#line 100
+ x++;
+ return x;
+}
+// CHECK-LABEL: @t1(
+unsigned short t1(unsigned short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_200]] to i8*)
+#line 200
+ x--;
+ return x;
+}
+// CHECK-LABEL: @t2(
+unsigned short t2(unsigned short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_300]] to i8*)
+#line 300
+ ++x;
+ return x;
+}
+// CHECK-LABEL: @t3(
+unsigned short t3(unsigned short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_400]] to i8*)
+#line 400
+ --x;
+ return x;
+}
+
+// CHECK-LABEL: @t4(
+signed short t4(signed short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_500]] to i8*)
+#line 500
+ x++;
+ return x;
+}
+// CHECK-LABEL: @t5(
+signed short t5(signed short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_600]] to i8*)
+#line 600
+ x--;
+ return x;
+}
+// CHECK-LABEL: @t6(
+signed short t6(signed short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_700]] to i8*)
+#line 700
+ ++x;
+ return x;
+}
+// CHECK-LABEL: @t7(
+signed short t7(signed short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_800]] to i8*)
+#line 800
+ --x;
+ return x;
+}
+
+// CHECK-LABEL: @t8(
+unsigned char t8(unsigned char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_900]] to i8*)
+#line 900
+ x++;
+ return x;
+}
+// CHECK-LABEL: @t9(
+unsigned char t9(unsigned char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_1000]] to i8*)
+#line 1000
+ x--;
+ return x;
+}
+// CHECK-LABEL: @t10(
+unsigned char t10(unsigned char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_1100]] to i8*)
+#line 1100
+ ++x;
+ return x;
+}
+// CHECK-LABEL: @t11(
+unsigned char t11(unsigned char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_1200]] to i8*)
+#line 1200
+ --x;
+ return x;
+}
+
+// CHECK-LABEL: @t12(
+signed char t12(signed char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_1300]] to i8*)
+#line 1300
+ x++;
+ return x;
+}
+// CHECK-LABEL: @t13(
+signed char t13(signed char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_1400]] to i8*)
+#line 1400
+ x--;
+ return x;
+}
+// CHECK-LABEL: @t14(
+signed char t14(signed char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_1500]] to i8*)
+#line 1500
+ ++x;
+ return x;
+}
+// CHECK-LABEL: @t15(
+signed char t15(signed char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_1600]] to i8*)
+#line 1600
+ --x;
+ return x;
+}
diff --git a/src/llvm-project/clang/test/CodeGen/catch-implicit-integer-arithmetic-value-change-incdec-basics.c b/src/llvm-project/clang/test/CodeGen/catch-implicit-integer-arithmetic-value-change-incdec-basics.c
new file mode 100644
index 0000000..5e0aa11
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/catch-implicit-integer-arithmetic-value-change-incdec-basics.c
@@ -0,0 +1,139 @@
+// RUN: %clang_cc1 -fsanitize=implicit-signed-integer-truncation,implicit-integer-sign-change -fsanitize-recover=implicit-signed-integer-truncation,implicit-integer-sign-change -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_implicit_conversion" --check-prefixes=CHECK
+
+// CHECK-DAG: @[[INT:.*]] = {{.*}} c"'int'\00" }
+// CHECK-DAG: @[[UNSIGNED_SHORT:.*]] = {{.*}} c"'unsigned short'\00" }
+// CHECK-DAG: @[[LINE_100:.*]] = {{.*}}, i32 100, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_SHORT]], i8 2 }
+// CHECK-DAG: @[[LINE_200:.*]] = {{.*}}, i32 200, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_SHORT]], i8 2 }
+// CHECK-DAG: @[[LINE_300:.*]] = {{.*}}, i32 300, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_SHORT]], i8 2 }
+// CHECK-DAG: @[[LINE_400:.*]] = {{.*}}, i32 400, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_SHORT]], i8 2 }
+// CHECK-DAG: @[[SHORT:.*]] = {{.*}} c"'short'\00" }
+// CHECK-DAG: @[[LINE_500:.*]] = {{.*}}, i32 500, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[SHORT]], i8 2 }
+// CHECK-DAG: @[[LINE_600:.*]] = {{.*}}, i32 600, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[SHORT]], i8 2 }
+// CHECK-DAG: @[[LINE_700:.*]] = {{.*}}, i32 700, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[SHORT]], i8 2 }
+// CHECK-DAG: @[[LINE_800:.*]] = {{.*}}, i32 800, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[SHORT]], i8 2 }
+// CHECK-DAG: @[[UNSIGNED_CHAR:.*]] = {{.*}} c"'unsigned char'\00" }
+// CHECK-DAG: @[[LINE_900:.*]] = {{.*}}, i32 900, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_CHAR]], i8 2 }
+// CHECK-DAG: @[[LINE_1000:.*]] = {{.*}}, i32 1000, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_CHAR]], i8 2 }
+// CHECK-DAG: @[[LINE_1100:.*]] = {{.*}}, i32 1100, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_CHAR]], i8 2 }
+// CHECK-DAG: @[[LINE_1200:.*]] = {{.*}}, i32 1200, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_CHAR]], i8 2 }
+// CHECK-DAG: @[[SIGNED_CHAR:.*]] = {{.*}} c"'signed char'\00" }
+// CHECK-DAG: @[[LINE_1300:.*]] = {{.*}}, i32 1300, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[SIGNED_CHAR]], i8 2 }
+// CHECK-DAG: @[[LINE_1400:.*]] = {{.*}}, i32 1400, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[SIGNED_CHAR]], i8 2 }
+// CHECK-DAG: @[[LINE_1500:.*]] = {{.*}}, i32 1500, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[SIGNED_CHAR]], i8 2 }
+// CHECK-DAG: @[[LINE_1600:.*]] = {{.*}}, i32 1600, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[SIGNED_CHAR]], i8 2 }
+
+// CHECK-LABEL: @t0(
+unsigned short t0(unsigned short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_100]] to i8*)
+#line 100
+ x++;
+ return x;
+}
+// CHECK-LABEL: @t1(
+unsigned short t1(unsigned short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_200]] to i8*)
+#line 200
+ x--;
+ return x;
+}
+// CHECK-LABEL: @t2(
+unsigned short t2(unsigned short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_300]] to i8*)
+#line 300
+ ++x;
+ return x;
+}
+// CHECK-LABEL: @t3(
+unsigned short t3(unsigned short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_400]] to i8*)
+#line 400
+ --x;
+ return x;
+}
+
+// CHECK-LABEL: @t4(
+signed short t4(signed short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_500]] to i8*)
+#line 500
+ x++;
+ return x;
+}
+// CHECK-LABEL: @t5(
+signed short t5(signed short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_600]] to i8*)
+#line 600
+ x--;
+ return x;
+}
+// CHECK-LABEL: @t6(
+signed short t6(signed short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_700]] to i8*)
+#line 700
+ ++x;
+ return x;
+}
+// CHECK-LABEL: @t7(
+signed short t7(signed short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_800]] to i8*)
+#line 800
+ --x;
+ return x;
+}
+
+// CHECK-LABEL: @t8(
+unsigned char t8(unsigned char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_900]] to i8*)
+#line 900
+ x++;
+ return x;
+}
+// CHECK-LABEL: @t9(
+unsigned char t9(unsigned char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_1000]] to i8*)
+#line 1000
+ x--;
+ return x;
+}
+// CHECK-LABEL: @t10(
+unsigned char t10(unsigned char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_1100]] to i8*)
+#line 1100
+ ++x;
+ return x;
+}
+// CHECK-LABEL: @t11(
+unsigned char t11(unsigned char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_1200]] to i8*)
+#line 1200
+ --x;
+ return x;
+}
+
+// CHECK-LABEL: @t12(
+signed char t12(signed char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_1300]] to i8*)
+#line 1300
+ x++;
+ return x;
+}
+// CHECK-LABEL: @t13(
+signed char t13(signed char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_1400]] to i8*)
+#line 1400
+ x--;
+ return x;
+}
+// CHECK-LABEL: @t14(
+signed char t14(signed char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_1500]] to i8*)
+#line 1500
+ ++x;
+ return x;
+}
+// CHECK-LABEL: @t15(
+signed char t15(signed char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_1600]] to i8*)
+#line 1600
+ --x;
+ return x;
+}
diff --git a/src/llvm-project/clang/test/CodeGen/catch-implicit-integer-conversions-incdec-basics.c b/src/llvm-project/clang/test/CodeGen/catch-implicit-integer-conversions-incdec-basics.c
new file mode 100644
index 0000000..e97a72c
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/catch-implicit-integer-conversions-incdec-basics.c
@@ -0,0 +1,139 @@
+// RUN: %clang_cc1 -fsanitize=implicit-unsigned-integer-truncation,implicit-signed-integer-truncation,implicit-integer-sign-change -fsanitize-recover=implicit-unsigned-integer-truncation,implicit-signed-integer-truncation,implicit-integer-sign-change -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_implicit_conversion" --check-prefixes=CHECK
+
+// CHECK-DAG: @[[INT:.*]] = {{.*}} c"'int'\00" }
+// CHECK-DAG: @[[UNSIGNED_SHORT:.*]] = {{.*}} c"'unsigned short'\00" }
+// CHECK-DAG: @[[LINE_100:.*]] = {{.*}}, i32 100, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_SHORT]], i8 2 }
+// CHECK-DAG: @[[LINE_200:.*]] = {{.*}}, i32 200, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_SHORT]], i8 2 }
+// CHECK-DAG: @[[LINE_300:.*]] = {{.*}}, i32 300, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_SHORT]], i8 2 }
+// CHECK-DAG: @[[LINE_400:.*]] = {{.*}}, i32 400, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_SHORT]], i8 2 }
+// CHECK-DAG: @[[SHORT:.*]] = {{.*}} c"'short'\00" }
+// CHECK-DAG: @[[LINE_500:.*]] = {{.*}}, i32 500, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[SHORT]], i8 2 }
+// CHECK-DAG: @[[LINE_600:.*]] = {{.*}}, i32 600, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[SHORT]], i8 2 }
+// CHECK-DAG: @[[LINE_700:.*]] = {{.*}}, i32 700, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[SHORT]], i8 2 }
+// CHECK-DAG: @[[LINE_800:.*]] = {{.*}}, i32 800, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[SHORT]], i8 2 }
+// CHECK-DAG: @[[UNSIGNED_CHAR:.*]] = {{.*}} c"'unsigned char'\00" }
+// CHECK-DAG: @[[LINE_900:.*]] = {{.*}}, i32 900, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_CHAR]], i8 2 }
+// CHECK-DAG: @[[LINE_1000:.*]] = {{.*}}, i32 1000, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_CHAR]], i8 2 }
+// CHECK-DAG: @[[LINE_1100:.*]] = {{.*}}, i32 1100, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_CHAR]], i8 2 }
+// CHECK-DAG: @[[LINE_1200:.*]] = {{.*}}, i32 1200, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_CHAR]], i8 2 }
+// CHECK-DAG: @[[SIGNED_CHAR:.*]] = {{.*}} c"'signed char'\00" }
+// CHECK-DAG: @[[LINE_1300:.*]] = {{.*}}, i32 1300, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[SIGNED_CHAR]], i8 2 }
+// CHECK-DAG: @[[LINE_1400:.*]] = {{.*}}, i32 1400, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[SIGNED_CHAR]], i8 2 }
+// CHECK-DAG: @[[LINE_1500:.*]] = {{.*}}, i32 1500, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[SIGNED_CHAR]], i8 2 }
+// CHECK-DAG: @[[LINE_1600:.*]] = {{.*}}, i32 1600, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[SIGNED_CHAR]], i8 2 }
+
+// CHECK-LABEL: @t0(
+unsigned short t0(unsigned short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_100]] to i8*)
+#line 100
+ x++;
+ return x;
+}
+// CHECK-LABEL: @t1(
+unsigned short t1(unsigned short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_200]] to i8*)
+#line 200
+ x--;
+ return x;
+}
+// CHECK-LABEL: @t2(
+unsigned short t2(unsigned short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_300]] to i8*)
+#line 300
+ ++x;
+ return x;
+}
+// CHECK-LABEL: @t3(
+unsigned short t3(unsigned short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_400]] to i8*)
+#line 400
+ --x;
+ return x;
+}
+
+// CHECK-LABEL: @t4(
+signed short t4(signed short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_500]] to i8*)
+#line 500
+ x++;
+ return x;
+}
+// CHECK-LABEL: @t5(
+signed short t5(signed short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_600]] to i8*)
+#line 600
+ x--;
+ return x;
+}
+// CHECK-LABEL: @t6(
+signed short t6(signed short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_700]] to i8*)
+#line 700
+ ++x;
+ return x;
+}
+// CHECK-LABEL: @t7(
+signed short t7(signed short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_800]] to i8*)
+#line 800
+ --x;
+ return x;
+}
+
+// CHECK-LABEL: @t8(
+unsigned char t8(unsigned char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_900]] to i8*)
+#line 900
+ x++;
+ return x;
+}
+// CHECK-LABEL: @t9(
+unsigned char t9(unsigned char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_1000]] to i8*)
+#line 1000
+ x--;
+ return x;
+}
+// CHECK-LABEL: @t10(
+unsigned char t10(unsigned char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_1100]] to i8*)
+#line 1100
+ ++x;
+ return x;
+}
+// CHECK-LABEL: @t11(
+unsigned char t11(unsigned char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_1200]] to i8*)
+#line 1200
+ --x;
+ return x;
+}
+
+// CHECK-LABEL: @t12(
+signed char t12(signed char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_1300]] to i8*)
+#line 1300
+ x++;
+ return x;
+}
+// CHECK-LABEL: @t13(
+signed char t13(signed char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_1400]] to i8*)
+#line 1400
+ x--;
+ return x;
+}
+// CHECK-LABEL: @t14(
+signed char t14(signed char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_1500]] to i8*)
+#line 1500
+ ++x;
+ return x;
+}
+// CHECK-LABEL: @t15(
+signed char t15(signed char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_1600]] to i8*)
+#line 1600
+ --x;
+ return x;
+}
diff --git a/src/llvm-project/clang/test/CodeGen/catch-implicit-integer-sign-changes-incdec-basics.c b/src/llvm-project/clang/test/CodeGen/catch-implicit-integer-sign-changes-incdec-basics.c
new file mode 100644
index 0000000..93495b3
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/catch-implicit-integer-sign-changes-incdec-basics.c
@@ -0,0 +1,139 @@
+// RUN: %clang_cc1 -fsanitize=implicit-integer-sign-change -fsanitize-recover=implicit-integer-sign-change -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_implicit_conversion" --check-prefixes=CHECK
+
+// CHECK-DAG: @[[INT:.*]] = {{.*}} c"'int'\00" }
+// CHECK-DAG: @[[UNSIGNED_SHORT:.*]] = {{.*}} c"'unsigned short'\00" }
+// CHECK-DAG: @[[LINE_100:.*]] = {{.*}}, i32 100, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_SHORT]], i8 3 }
+// CHECK-DAG: @[[LINE_200:.*]] = {{.*}}, i32 200, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_SHORT]], i8 3 }
+// CHECK-DAG: @[[LINE_300:.*]] = {{.*}}, i32 300, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_SHORT]], i8 3 }
+// CHECK-DAG: @[[LINE_400:.*]] = {{.*}}, i32 400, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_SHORT]], i8 3 }
+// CHECK-DAG: @[[SHORT:.*]] = {{.*}} c"'short'\00" }
+// CHECK-DAG: @[[LINE_500:.*]] = {{.*}}, i32 500, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[SHORT]], i8 3 }
+// CHECK-DAG: @[[LINE_600:.*]] = {{.*}}, i32 600, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[SHORT]], i8 3 }
+// CHECK-DAG: @[[LINE_700:.*]] = {{.*}}, i32 700, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[SHORT]], i8 3 }
+// CHECK-DAG: @[[LINE_800:.*]] = {{.*}}, i32 800, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[SHORT]], i8 3 }
+// CHECK-DAG: @[[UNSIGNED_CHAR:.*]] = {{.*}} c"'unsigned char'\00" }
+// CHECK-DAG: @[[LINE_900:.*]] = {{.*}}, i32 900, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_CHAR]], i8 3 }
+// CHECK-DAG: @[[LINE_1000:.*]] = {{.*}}, i32 1000, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_CHAR]], i8 3 }
+// CHECK-DAG: @[[LINE_1100:.*]] = {{.*}}, i32 1100, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_CHAR]], i8 3 }
+// CHECK-DAG: @[[LINE_1200:.*]] = {{.*}}, i32 1200, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_CHAR]], i8 3 }
+// CHECK-DAG: @[[SIGNED_CHAR:.*]] = {{.*}} c"'signed char'\00" }
+// CHECK-DAG: @[[LINE_1300:.*]] = {{.*}}, i32 1300, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[SIGNED_CHAR]], i8 3 }
+// CHECK-DAG: @[[LINE_1400:.*]] = {{.*}}, i32 1400, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[SIGNED_CHAR]], i8 3 }
+// CHECK-DAG: @[[LINE_1500:.*]] = {{.*}}, i32 1500, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[SIGNED_CHAR]], i8 3 }
+// CHECK-DAG: @[[LINE_1600:.*]] = {{.*}}, i32 1600, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[SIGNED_CHAR]], i8 3 }
+
+// CHECK-LABEL: @t0(
+unsigned short t0(unsigned short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_100]] to i8*)
+#line 100
+ x++;
+ return x;
+}
+// CHECK-LABEL: @t1(
+unsigned short t1(unsigned short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_200]] to i8*)
+#line 200
+ x--;
+ return x;
+}
+// CHECK-LABEL: @t2(
+unsigned short t2(unsigned short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_300]] to i8*)
+#line 300
+ ++x;
+ return x;
+}
+// CHECK-LABEL: @t3(
+unsigned short t3(unsigned short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_400]] to i8*)
+#line 400
+ --x;
+ return x;
+}
+
+// CHECK-LABEL: @t4(
+signed short t4(signed short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_500]] to i8*)
+#line 500
+ x++;
+ return x;
+}
+// CHECK-LABEL: @t5(
+signed short t5(signed short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_600]] to i8*)
+#line 600
+ x--;
+ return x;
+}
+// CHECK-LABEL: @t6(
+signed short t6(signed short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_700]] to i8*)
+#line 700
+ ++x;
+ return x;
+}
+// CHECK-LABEL: @t7(
+signed short t7(signed short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_800]] to i8*)
+#line 800
+ --x;
+ return x;
+}
+
+// CHECK-LABEL: @t8(
+unsigned char t8(unsigned char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_900]] to i8*)
+#line 900
+ x++;
+ return x;
+}
+// CHECK-LABEL: @t9(
+unsigned char t9(unsigned char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_1000]] to i8*)
+#line 1000
+ x--;
+ return x;
+}
+// CHECK-LABEL: @t10(
+unsigned char t10(unsigned char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_1100]] to i8*)
+#line 1100
+ ++x;
+ return x;
+}
+// CHECK-LABEL: @t11(
+unsigned char t11(unsigned char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_1200]] to i8*)
+#line 1200
+ --x;
+ return x;
+}
+
+// CHECK-LABEL: @t12(
+signed char t12(signed char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_1300]] to i8*)
+#line 1300
+ x++;
+ return x;
+}
+// CHECK-LABEL: @t13(
+signed char t13(signed char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_1400]] to i8*)
+#line 1400
+ x--;
+ return x;
+}
+// CHECK-LABEL: @t14(
+signed char t14(signed char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_1500]] to i8*)
+#line 1500
+ ++x;
+ return x;
+}
+// CHECK-LABEL: @t15(
+signed char t15(signed char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_1600]] to i8*)
+#line 1600
+ --x;
+ return x;
+}
diff --git a/src/llvm-project/clang/test/CodeGen/catch-implicit-integer-sign-changes-incdec.c b/src/llvm-project/clang/test/CodeGen/catch-implicit-integer-sign-changes-incdec.c
new file mode 100644
index 0000000..41e08ee
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/catch-implicit-integer-sign-changes-incdec.c
@@ -0,0 +1,307 @@
+// RUN: %clang_cc1 -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s --check-prefixes=CHECK,CHECK-NOSANITIZE
+
+// RUN: %clang_cc1 -fsanitize=implicit-integer-sign-change -fno-sanitize-recover=implicit-integer-sign-change -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_implicit_conversion" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-ANYRECOVER,CHECK-SANITIZE-NORECOVER,CHECK-SANITIZE-UNREACHABLE
+// RUN: %clang_cc1 -fsanitize=implicit-integer-sign-change -fsanitize-recover=implicit-integer-sign-change -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_implicit_conversion" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-ANYRECOVER,CHECK-SANITIZE-RECOVER
+// RUN: %clang_cc1 -fsanitize=implicit-integer-sign-change -fsanitize-trap=implicit-integer-sign-change -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_implicit_conversion" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-TRAP,CHECK-SANITIZE-UNREACHABLE
+
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[INT:.*]] = {{.*}} c"'int'\00" }
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[UNSIGNED_SHORT:.*]] = {{.*}} c"'unsigned short'\00" }
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_100:.*]] = {{.*}}, i32 100, i32 11 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_SHORT]], i8 3 }
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_200:.*]] = {{.*}}, i32 200, i32 11 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_SHORT]], i8 3 }
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_300:.*]] = {{.*}}, i32 300, i32 10 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_SHORT]], i8 3 }
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_400:.*]] = {{.*}}, i32 400, i32 10 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_SHORT]], i8 3 }
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[SHORT:.*]] = {{.*}} c"'short'\00" }
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_500:.*]] = {{.*}}, i32 500, i32 11 }, {{.*}}* @[[INT]], {{.*}}* @[[SHORT]], i8 3 }
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_600:.*]] = {{.*}}, i32 600, i32 11 }, {{.*}}* @[[INT]], {{.*}}* @[[SHORT]], i8 3 }
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_700:.*]] = {{.*}}, i32 700, i32 10 }, {{.*}}* @[[INT]], {{.*}}* @[[SHORT]], i8 3 }
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_800:.*]] = {{.*}}, i32 800, i32 10 }, {{.*}}* @[[INT]], {{.*}}* @[[SHORT]], i8 3 }
+
+unsigned short t0(unsigned short x) {
+// CHECK-NOSANITIZE-LABEL: @t0(
+// CHECK-NOSANITIZE-NEXT: entry:
+// CHECK-NOSANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
+// CHECK-NOSANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: [[INC:%.*]] = add i16 [[X_RELOADED]], 1
+// CHECK-NOSANITIZE-NEXT: store i16 [[INC]], i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: ret i16 [[X_RELOADED]]
+//
+// CHECK-SANITIZE-LABEL: @t0(
+// CHECK-SANITIZE-NEXT: entry:
+// CHECK-SANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
+// CHECK-SANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: [[X_PROMOTED:%.*]] = zext i16 [[X_RELOADED]] to i32
+// CHECK-SANITIZE-NEXT: [[INC:%.*]] = add i32 [[X_PROMOTED]], 1
+// CHECK-SANITIZE-NEXT: [[X_PROMOTED_DEMOTED:%.*]] = trunc i32 [[INC]] to i16
+// CHECK-SANITIZE-NEXT: [[SRC_INC_NEGATIVITYCHECK:%.*]] = icmp slt i32 [[INC]], 0, !nosanitize !2
+// CHECK-SANITIZE-NEXT: [[SIGNCHANGECHECK:%.*]] = icmp eq i1 [[SRC_INC_NEGATIVITYCHECK]], false, !nosanitize
+// CHECK-SANITIZE-NEXT: br i1 [[SIGNCHANGECHECK]], label %[[CONT:.*]], label %[[HANDLER_IMPLICIT_X_PROMOTEDERSION:[^,]+]],{{.*}} !nosanitize
+// CHECK-SANITIZE: [[HANDLER_IMPLICIT_X_PROMOTEDERSION]]:
+// CHECK-SANITIZE-TRAP-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
+// CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP1:%.*]] = zext i32 [[INC]] to i64, !nosanitize
+// CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP2:%.*]] = zext i16 [[X_PROMOTED_DEMOTED]] to i64, !nosanitize
+// CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_implicit_conversion_abort(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_100]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
+// CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_100]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
+// CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
+// CHECK-SANITIZE-RECOVER-NEXT: br label %[[CONT]], !nosanitize
+// CHECK-SANITIZE: [[CONT]]:
+// CHECK-SANITIZE-NEXT: store i16 [[X_PROMOTED_DEMOTED]], i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: ret i16 [[X_RELOADED]]
+#line 100
+ return x++;
+}
+unsigned short t1(unsigned short x) {
+// CHECK-NOSANITIZE-LABEL: @t1(
+// CHECK-NOSANITIZE-NEXT: entry:
+// CHECK-NOSANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
+// CHECK-NOSANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: [[INC:%.*]] = add i16 [[X_RELOADED]], -1
+// CHECK-NOSANITIZE-NEXT: store i16 [[INC]], i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: ret i16 [[X_RELOADED]]
+//
+// CHECK-SANITIZE-LABEL: @t1(
+// CHECK-SANITIZE-NEXT: entry:
+// CHECK-SANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
+// CHECK-SANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: [[X_PROMOTED:%.*]] = zext i16 [[X_RELOADED]] to i32
+// CHECK-SANITIZE-NEXT: [[INC:%.*]] = add i32 [[X_PROMOTED]], -1
+// CHECK-SANITIZE-NEXT: [[X_PROMOTED_DEMOTED:%.*]] = trunc i32 [[INC]] to i16
+// CHECK-SANITIZE-NEXT: [[SRC_INC_NEGATIVITYCHECK:%.*]] = icmp slt i32 [[INC]], 0, !nosanitize !2
+// CHECK-SANITIZE-NEXT: [[SIGNCHANGECHECK:%.*]] = icmp eq i1 [[SRC_INC_NEGATIVITYCHECK]], false, !nosanitize
+// CHECK-SANITIZE-NEXT: br i1 [[SIGNCHANGECHECK]], label %[[CONT:.*]], label %[[HANDLER_IMPLICIT_X_PROMOTEDERSION:[^,]+]],{{.*}} !nosanitize
+// CHECK-SANITIZE: [[HANDLER_IMPLICIT_X_PROMOTEDERSION]]:
+// CHECK-SANITIZE-TRAP-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
+// CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP1:%.*]] = zext i32 [[INC]] to i64, !nosanitize
+// CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP2:%.*]] = zext i16 [[X_PROMOTED_DEMOTED]] to i64, !nosanitize
+// CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_implicit_conversion_abort(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_200]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
+// CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_200]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
+// CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
+// CHECK-SANITIZE-RECOVER-NEXT: br label %[[CONT]], !nosanitize
+// CHECK-SANITIZE: [[CONT]]:
+// CHECK-SANITIZE-NEXT: store i16 [[X_PROMOTED_DEMOTED]], i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: ret i16 [[X_RELOADED]]
+#line 200
+ return x--;
+}
+
+unsigned short t2(unsigned short x) {
+// CHECK-NOSANITIZE-LABEL: @t2(
+// CHECK-NOSANITIZE-NEXT: entry:
+// CHECK-NOSANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
+// CHECK-NOSANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: [[INC:%.*]] = add i16 [[X_RELOADED]], 1
+// CHECK-NOSANITIZE-NEXT: store i16 [[INC]], i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: ret i16 [[INC]]
+//
+// CHECK-SANITIZE-LABEL: @t2(
+// CHECK-SANITIZE-NEXT: entry:
+// CHECK-SANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
+// CHECK-SANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: [[X_PROMOTED:%.*]] = zext i16 [[X_RELOADED]] to i32
+// CHECK-SANITIZE-NEXT: [[INC:%.*]] = add i32 [[X_PROMOTED]], 1
+// CHECK-SANITIZE-NEXT: [[X_PROMOTED_DEMOTED:%.*]] = trunc i32 [[INC]] to i16
+// CHECK-SANITIZE-NEXT: [[SRC_INC_NEGATIVITYCHECK:%.*]] = icmp slt i32 [[INC]], 0, !nosanitize !2
+// CHECK-SANITIZE-NEXT: [[SIGNCHANGECHECK:%.*]] = icmp eq i1 [[SRC_INC_NEGATIVITYCHECK]], false, !nosanitize
+// CHECK-SANITIZE-NEXT: br i1 [[SIGNCHANGECHECK]], label %[[CONT:.*]], label %[[HANDLER_IMPLICIT_X_PROMOTEDERSION:[^,]+]],{{.*}} !nosanitize
+// CHECK-SANITIZE: [[HANDLER_IMPLICIT_X_PROMOTEDERSION]]:
+// CHECK-SANITIZE-TRAP-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
+// CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP1:%.*]] = zext i32 [[INC]] to i64, !nosanitize
+// CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP2:%.*]] = zext i16 [[X_PROMOTED_DEMOTED]] to i64, !nosanitize
+// CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_implicit_conversion_abort(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_300]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
+// CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_300]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
+// CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
+// CHECK-SANITIZE-RECOVER-NEXT: br label %[[CONT]], !nosanitize
+// CHECK-SANITIZE: [[CONT]]:
+// CHECK-SANITIZE-NEXT: store i16 [[X_PROMOTED_DEMOTED]], i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: ret i16 [[X_PROMOTED_DEMOTED]]
+#line 300
+ return ++x;
+}
+
+unsigned short t3(unsigned short x) {
+// CHECK-NOSANITIZE-LABEL: @t3(
+// CHECK-NOSANITIZE-NEXT: entry:
+// CHECK-NOSANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
+// CHECK-NOSANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: [[INC:%.*]] = add i16 [[X_RELOADED]], -1
+// CHECK-NOSANITIZE-NEXT: store i16 [[INC]], i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: ret i16 [[INC]]
+//
+// CHECK-SANITIZE-LABEL: @t3(
+// CHECK-SANITIZE-NEXT: entry:
+// CHECK-SANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
+// CHECK-SANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: [[X_PROMOTED:%.*]] = zext i16 [[X_RELOADED]] to i32
+// CHECK-SANITIZE-NEXT: [[INC:%.*]] = add i32 [[X_PROMOTED]], -1
+// CHECK-SANITIZE-NEXT: [[X_PROMOTED_DEMOTED:%.*]] = trunc i32 [[INC]] to i16
+// CHECK-SANITIZE-NEXT: [[SRC_INC_NEGATIVITYCHECK:%.*]] = icmp slt i32 [[INC]], 0, !nosanitize !2
+// CHECK-SANITIZE-NEXT: [[SIGNCHANGECHECK:%.*]] = icmp eq i1 [[SRC_INC_NEGATIVITYCHECK]], false, !nosanitize
+// CHECK-SANITIZE-NEXT: br i1 [[SIGNCHANGECHECK]], label %[[CONT:.*]], label %[[HANDLER_IMPLICIT_X_PROMOTEDERSION:[^,]+]],{{.*}} !nosanitize
+// CHECK-SANITIZE: [[HANDLER_IMPLICIT_X_PROMOTEDERSION]]:
+// CHECK-SANITIZE-TRAP-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
+// CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP1:%.*]] = zext i32 [[INC]] to i64, !nosanitize
+// CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP2:%.*]] = zext i16 [[X_PROMOTED_DEMOTED]] to i64, !nosanitize
+// CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_implicit_conversion_abort(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_400]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
+// CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_400]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
+// CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
+// CHECK-SANITIZE-RECOVER-NEXT: br label %[[CONT]], !nosanitize
+// CHECK-SANITIZE: [[CONT]]:
+// CHECK-SANITIZE-NEXT: store i16 [[X_PROMOTED_DEMOTED]], i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: ret i16 [[X_PROMOTED_DEMOTED]]
+#line 400
+ return --x;
+}
+
+signed short t4(signed short x) {
+// CHECK-NOSANITIZE-LABEL: @t4(
+// CHECK-NOSANITIZE-NEXT: entry:
+// CHECK-NOSANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
+// CHECK-NOSANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: [[INC:%.*]] = add i16 [[X_RELOADED]], 1
+// CHECK-NOSANITIZE-NEXT: store i16 [[INC]], i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: ret i16 [[X_RELOADED]]
+//
+// CHECK-SANITIZE-LABEL: @t4(
+// CHECK-SANITIZE-NEXT: entry:
+// CHECK-SANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
+// CHECK-SANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: [[X_PROMOTED:%.*]] = sext i16 [[X_RELOADED]] to i32
+// CHECK-SANITIZE-NEXT: [[INC:%.*]] = add i32 [[X_PROMOTED]], 1
+// CHECK-SANITIZE-NEXT: [[X_PROMOTED_DEMOTED:%.*]] = trunc i32 [[INC]] to i16
+// CHECK-SANITIZE-NEXT: [[SRC_INC_NEGATIVITYCHECK:%.*]] = icmp slt i32 [[INC]], 0, !nosanitize !2
+// CHECK-SANITIZE-NEXT: [[DST_NEGATIVITYCHECK:%.*]] = icmp slt i16 [[X_PROMOTED_DEMOTED]], 0, !nosanitize !2
+// CHECK-SANITIZE-NEXT: [[SIGNCHANGECHECK:%.*]] = icmp eq i1 [[SRC_INC_NEGATIVITYCHECK]], [[DST_NEGATIVITYCHECK]], !nosanitize
+// CHECK-SANITIZE-NEXT: br i1 [[SIGNCHANGECHECK]], label %[[CONT:.*]], label %[[HANDLER_IMPLICIT_X_PROMOTEDERSION:[^,]+]],{{.*}} !nosanitize
+// CHECK-SANITIZE: [[HANDLER_IMPLICIT_X_PROMOTEDERSION]]:
+// CHECK-SANITIZE-TRAP-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
+// CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP1:%.*]] = zext i32 [[INC]] to i64, !nosanitize
+// CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP2:%.*]] = zext i16 [[X_PROMOTED_DEMOTED]] to i64, !nosanitize
+// CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_implicit_conversion_abort(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_500]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
+// CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_500]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
+// CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
+// CHECK-SANITIZE-RECOVER-NEXT: br label %[[CONT]], !nosanitize
+// CHECK-SANITIZE: [[CONT]]:
+// CHECK-SANITIZE-NEXT: store i16 [[X_PROMOTED_DEMOTED]], i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: ret i16 [[X_RELOADED]]
+#line 500
+ return x++;
+}
+signed short t5(signed short x) {
+// CHECK-NOSANITIZE-LABEL: @t5(
+// CHECK-NOSANITIZE-NEXT: entry:
+// CHECK-NOSANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
+// CHECK-NOSANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: [[INC:%.*]] = add i16 [[X_RELOADED]], -1
+// CHECK-NOSANITIZE-NEXT: store i16 [[INC]], i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: ret i16 [[X_RELOADED]]
+//
+// CHECK-SANITIZE-LABEL: @t5(
+// CHECK-SANITIZE-NEXT: entry:
+// CHECK-SANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
+// CHECK-SANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: [[X_PROMOTED:%.*]] = sext i16 [[X_RELOADED]] to i32
+// CHECK-SANITIZE-NEXT: [[INC:%.*]] = add i32 [[X_PROMOTED]], -1
+// CHECK-SANITIZE-NEXT: [[X_PROMOTED_DEMOTED:%.*]] = trunc i32 [[INC]] to i16
+// CHECK-SANITIZE-NEXT: [[SRC_INC_NEGATIVITYCHECK:%.*]] = icmp slt i32 [[INC]], 0, !nosanitize !2
+// CHECK-SANITIZE-NEXT: [[DST_NEGATIVITYCHECK:%.*]] = icmp slt i16 [[X_PROMOTED_DEMOTED]], 0, !nosanitize !2
+// CHECK-SANITIZE-NEXT: [[SIGNCHANGECHECK:%.*]] = icmp eq i1 [[SRC_INC_NEGATIVITYCHECK]], [[DST_NEGATIVITYCHECK]], !nosanitize
+// CHECK-SANITIZE-NEXT: br i1 [[SIGNCHANGECHECK]], label %[[CONT:.*]], label %[[HANDLER_IMPLICIT_X_PROMOTEDERSION:[^,]+]],{{.*}} !nosanitize
+// CHECK-SANITIZE: [[HANDLER_IMPLICIT_X_PROMOTEDERSION]]:
+// CHECK-SANITIZE-TRAP-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
+// CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP1:%.*]] = zext i32 [[INC]] to i64, !nosanitize
+// CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP2:%.*]] = zext i16 [[X_PROMOTED_DEMOTED]] to i64, !nosanitize
+// CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_implicit_conversion_abort(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_600]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
+// CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_600]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
+// CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
+// CHECK-SANITIZE-RECOVER-NEXT: br label %[[CONT]], !nosanitize
+// CHECK-SANITIZE: [[CONT]]:
+// CHECK-SANITIZE-NEXT: store i16 [[X_PROMOTED_DEMOTED]], i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: ret i16 [[X_RELOADED]]
+#line 600
+ return x--;
+}
+
+signed short t6(signed short x) {
+// CHECK-NOSANITIZE-LABEL: @t6(
+// CHECK-NOSANITIZE-NEXT: entry:
+// CHECK-NOSANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
+// CHECK-NOSANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: [[INC:%.*]] = add i16 [[X_RELOADED]], 1
+// CHECK-NOSANITIZE-NEXT: store i16 [[INC]], i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: ret i16 [[INC]]
+//
+// CHECK-SANITIZE-LABEL: @t6(
+// CHECK-SANITIZE-NEXT: entry:
+// CHECK-SANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
+// CHECK-SANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: [[X_PROMOTED:%.*]] = sext i16 [[X_RELOADED]] to i32
+// CHECK-SANITIZE-NEXT: [[INC:%.*]] = add i32 [[X_PROMOTED]], 1
+// CHECK-SANITIZE-NEXT: [[X_PROMOTED_DEMOTED:%.*]] = trunc i32 [[INC]] to i16
+// CHECK-SANITIZE-NEXT: [[SRC_INC_NEGATIVITYCHECK:%.*]] = icmp slt i32 [[INC]], 0, !nosanitize !2
+// CHECK-SANITIZE-NEXT: [[DST_NEGATIVITYCHECK:%.*]] = icmp slt i16 [[X_PROMOTED_DEMOTED]], 0, !nosanitize !2
+// CHECK-SANITIZE-NEXT: [[SIGNCHANGECHECK:%.*]] = icmp eq i1 [[SRC_INC_NEGATIVITYCHECK]], [[DST_NEGATIVITYCHECK]], !nosanitize
+// CHECK-SANITIZE-NEXT: br i1 [[SIGNCHANGECHECK]], label %[[CONT:.*]], label %[[HANDLER_IMPLICIT_X_PROMOTEDERSION:[^,]+]],{{.*}} !nosanitize
+// CHECK-SANITIZE: [[HANDLER_IMPLICIT_X_PROMOTEDERSION]]:
+// CHECK-SANITIZE-TRAP-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
+// CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP1:%.*]] = zext i32 [[INC]] to i64, !nosanitize
+// CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP2:%.*]] = zext i16 [[X_PROMOTED_DEMOTED]] to i64, !nosanitize
+// CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_implicit_conversion_abort(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_700]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
+// CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_700]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
+// CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
+// CHECK-SANITIZE-RECOVER-NEXT: br label %[[CONT]], !nosanitize
+// CHECK-SANITIZE: [[CONT]]:
+// CHECK-SANITIZE-NEXT: store i16 [[X_PROMOTED_DEMOTED]], i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: ret i16 [[X_PROMOTED_DEMOTED]]
+#line 700
+ return ++x;
+}
+
+signed short t7(signed short x) {
+// CHECK-NOSANITIZE-LABEL: @t7(
+// CHECK-NOSANITIZE-NEXT: entry:
+// CHECK-NOSANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
+// CHECK-NOSANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: [[INC:%.*]] = add i16 [[X_RELOADED]], -1
+// CHECK-NOSANITIZE-NEXT: store i16 [[INC]], i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: ret i16 [[INC]]
+//
+// CHECK-SANITIZE-LABEL: @t7(
+// CHECK-SANITIZE-NEXT: entry:
+// CHECK-SANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
+// CHECK-SANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: [[X_PROMOTED:%.*]] = sext i16 [[X_RELOADED]] to i32
+// CHECK-SANITIZE-NEXT: [[INC:%.*]] = add i32 [[X_PROMOTED]], -1
+// CHECK-SANITIZE-NEXT: [[X_PROMOTED_DEMOTED:%.*]] = trunc i32 [[INC]] to i16
+// CHECK-SANITIZE-NEXT: [[SRC_INC_NEGATIVITYCHECK:%.*]] = icmp slt i32 [[INC]], 0, !nosanitize !2
+// CHECK-SANITIZE-NEXT: [[DST_NEGATIVITYCHECK:%.*]] = icmp slt i16 [[X_PROMOTED_DEMOTED]], 0, !nosanitize !2
+// CHECK-SANITIZE-NEXT: [[SIGNCHANGECHECK:%.*]] = icmp eq i1 [[SRC_INC_NEGATIVITYCHECK]], [[DST_NEGATIVITYCHECK]], !nosanitize
+// CHECK-SANITIZE-NEXT: br i1 [[SIGNCHANGECHECK]], label %[[CONT:.*]], label %[[HANDLER_IMPLICIT_X_PROMOTEDERSION:[^,]+]],{{.*}} !nosanitize
+// CHECK-SANITIZE: [[HANDLER_IMPLICIT_X_PROMOTEDERSION]]:
+// CHECK-SANITIZE-TRAP-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
+// CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP1:%.*]] = zext i32 [[INC]] to i64, !nosanitize
+// CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP2:%.*]] = zext i16 [[X_PROMOTED_DEMOTED]] to i64, !nosanitize
+// CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_implicit_conversion_abort(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_800]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
+// CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_800]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
+// CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
+// CHECK-SANITIZE-RECOVER-NEXT: br label %[[CONT]], !nosanitize
+// CHECK-SANITIZE: [[CONT]]:
+// CHECK-SANITIZE-NEXT: store i16 [[X_PROMOTED_DEMOTED]], i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: ret i16 [[X_PROMOTED_DEMOTED]]
+#line 800
+ return --x;
+}
diff --git a/src/llvm-project/clang/test/CodeGen/catch-implicit-integer-truncations-incdec-basics.c b/src/llvm-project/clang/test/CodeGen/catch-implicit-integer-truncations-incdec-basics.c
new file mode 100644
index 0000000..6ac2be6
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/catch-implicit-integer-truncations-incdec-basics.c
@@ -0,0 +1,139 @@
+// RUN: %clang_cc1 -fsanitize=implicit-unsigned-integer-truncation,implicit-signed-integer-truncation -fsanitize-recover=implicit-unsigned-integer-truncation,implicit-signed-integer-truncation -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_implicit_conversion" --check-prefixes=CHECK
+
+// CHECK-DAG: @[[INT:.*]] = {{.*}} c"'int'\00" }
+// CHECK-DAG: @[[UNSIGNED_SHORT:.*]] = {{.*}} c"'unsigned short'\00" }
+// CHECK-DAG: @[[LINE_100:.*]] = {{.*}}, i32 100, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_SHORT]], i8 2 }
+// CHECK-DAG: @[[LINE_200:.*]] = {{.*}}, i32 200, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_SHORT]], i8 2 }
+// CHECK-DAG: @[[LINE_300:.*]] = {{.*}}, i32 300, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_SHORT]], i8 2 }
+// CHECK-DAG: @[[LINE_400:.*]] = {{.*}}, i32 400, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_SHORT]], i8 2 }
+// CHECK-DAG: @[[SHORT:.*]] = {{.*}} c"'short'\00" }
+// CHECK-DAG: @[[LINE_500:.*]] = {{.*}}, i32 500, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[SHORT]], i8 2 }
+// CHECK-DAG: @[[LINE_600:.*]] = {{.*}}, i32 600, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[SHORT]], i8 2 }
+// CHECK-DAG: @[[LINE_700:.*]] = {{.*}}, i32 700, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[SHORT]], i8 2 }
+// CHECK-DAG: @[[LINE_800:.*]] = {{.*}}, i32 800, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[SHORT]], i8 2 }
+// CHECK-DAG: @[[UNSIGNED_CHAR:.*]] = {{.*}} c"'unsigned char'\00" }
+// CHECK-DAG: @[[LINE_900:.*]] = {{.*}}, i32 900, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_CHAR]], i8 2 }
+// CHECK-DAG: @[[LINE_1000:.*]] = {{.*}}, i32 1000, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_CHAR]], i8 2 }
+// CHECK-DAG: @[[LINE_1100:.*]] = {{.*}}, i32 1100, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_CHAR]], i8 2 }
+// CHECK-DAG: @[[LINE_1200:.*]] = {{.*}}, i32 1200, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_CHAR]], i8 2 }
+// CHECK-DAG: @[[SIGNED_CHAR:.*]] = {{.*}} c"'signed char'\00" }
+// CHECK-DAG: @[[LINE_1300:.*]] = {{.*}}, i32 1300, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[SIGNED_CHAR]], i8 2 }
+// CHECK-DAG: @[[LINE_1400:.*]] = {{.*}}, i32 1400, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[SIGNED_CHAR]], i8 2 }
+// CHECK-DAG: @[[LINE_1500:.*]] = {{.*}}, i32 1500, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[SIGNED_CHAR]], i8 2 }
+// CHECK-DAG: @[[LINE_1600:.*]] = {{.*}}, i32 1600, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[SIGNED_CHAR]], i8 2 }
+
+// CHECK-LABEL: @t0(
+unsigned short t0(unsigned short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_100]] to i8*)
+#line 100
+ x++;
+ return x;
+}
+// CHECK-LABEL: @t1(
+unsigned short t1(unsigned short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_200]] to i8*)
+#line 200
+ x--;
+ return x;
+}
+// CHECK-LABEL: @t2(
+unsigned short t2(unsigned short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_300]] to i8*)
+#line 300
+ ++x;
+ return x;
+}
+// CHECK-LABEL: @t3(
+unsigned short t3(unsigned short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_400]] to i8*)
+#line 400
+ --x;
+ return x;
+}
+
+// CHECK-LABEL: @t4(
+signed short t4(signed short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_500]] to i8*)
+#line 500
+ x++;
+ return x;
+}
+// CHECK-LABEL: @t5(
+signed short t5(signed short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_600]] to i8*)
+#line 600
+ x--;
+ return x;
+}
+// CHECK-LABEL: @t6(
+signed short t6(signed short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_700]] to i8*)
+#line 700
+ ++x;
+ return x;
+}
+// CHECK-LABEL: @t7(
+signed short t7(signed short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_800]] to i8*)
+#line 800
+ --x;
+ return x;
+}
+
+// CHECK-LABEL: @t8(
+unsigned char t8(unsigned char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_900]] to i8*)
+#line 900
+ x++;
+ return x;
+}
+// CHECK-LABEL: @t9(
+unsigned char t9(unsigned char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_1000]] to i8*)
+#line 1000
+ x--;
+ return x;
+}
+// CHECK-LABEL: @t10(
+unsigned char t10(unsigned char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_1100]] to i8*)
+#line 1100
+ ++x;
+ return x;
+}
+// CHECK-LABEL: @t11(
+unsigned char t11(unsigned char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_1200]] to i8*)
+#line 1200
+ --x;
+ return x;
+}
+
+// CHECK-LABEL: @t12(
+signed char t12(signed char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_1300]] to i8*)
+#line 1300
+ x++;
+ return x;
+}
+// CHECK-LABEL: @t13(
+signed char t13(signed char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_1400]] to i8*)
+#line 1400
+ x--;
+ return x;
+}
+// CHECK-LABEL: @t14(
+signed char t14(signed char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_1500]] to i8*)
+#line 1500
+ ++x;
+ return x;
+}
+// CHECK-LABEL: @t15(
+signed char t15(signed char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_1600]] to i8*)
+#line 1600
+ --x;
+ return x;
+}
diff --git a/src/llvm-project/clang/test/CodeGen/catch-implicit-signed-integer-truncations-incdec-basics.c b/src/llvm-project/clang/test/CodeGen/catch-implicit-signed-integer-truncations-incdec-basics.c
new file mode 100644
index 0000000..b7e438c
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/catch-implicit-signed-integer-truncations-incdec-basics.c
@@ -0,0 +1,139 @@
+// RUN: %clang_cc1 -fsanitize=implicit-signed-integer-truncation -fsanitize-recover=implicit-signed-integer-truncation -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_implicit_conversion" --check-prefixes=CHECK
+
+// CHECK-DAG: @[[INT:.*]] = {{.*}} c"'int'\00" }
+// CHECK-DAG: @[[UNSIGNED_SHORT:.*]] = {{.*}} c"'unsigned short'\00" }
+// CHECK-DAG: @[[LINE_100:.*]] = {{.*}}, i32 100, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_SHORT]], i8 2 }
+// CHECK-DAG: @[[LINE_200:.*]] = {{.*}}, i32 200, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_SHORT]], i8 2 }
+// CHECK-DAG: @[[LINE_300:.*]] = {{.*}}, i32 300, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_SHORT]], i8 2 }
+// CHECK-DAG: @[[LINE_400:.*]] = {{.*}}, i32 400, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_SHORT]], i8 2 }
+// CHECK-DAG: @[[SHORT:.*]] = {{.*}} c"'short'\00" }
+// CHECK-DAG: @[[LINE_500:.*]] = {{.*}}, i32 500, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[SHORT]], i8 2 }
+// CHECK-DAG: @[[LINE_600:.*]] = {{.*}}, i32 600, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[SHORT]], i8 2 }
+// CHECK-DAG: @[[LINE_700:.*]] = {{.*}}, i32 700, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[SHORT]], i8 2 }
+// CHECK-DAG: @[[LINE_800:.*]] = {{.*}}, i32 800, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[SHORT]], i8 2 }
+// CHECK-DAG: @[[UNSIGNED_CHAR:.*]] = {{.*}} c"'unsigned char'\00" }
+// CHECK-DAG: @[[LINE_900:.*]] = {{.*}}, i32 900, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_CHAR]], i8 2 }
+// CHECK-DAG: @[[LINE_1000:.*]] = {{.*}}, i32 1000, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_CHAR]], i8 2 }
+// CHECK-DAG: @[[LINE_1100:.*]] = {{.*}}, i32 1100, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_CHAR]], i8 2 }
+// CHECK-DAG: @[[LINE_1200:.*]] = {{.*}}, i32 1200, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_CHAR]], i8 2 }
+// CHECK-DAG: @[[SIGNED_CHAR:.*]] = {{.*}} c"'signed char'\00" }
+// CHECK-DAG: @[[LINE_1300:.*]] = {{.*}}, i32 1300, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[SIGNED_CHAR]], i8 2 }
+// CHECK-DAG: @[[LINE_1400:.*]] = {{.*}}, i32 1400, i32 4 }, {{.*}}* @[[INT]], {{.*}}* @[[SIGNED_CHAR]], i8 2 }
+// CHECK-DAG: @[[LINE_1500:.*]] = {{.*}}, i32 1500, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[SIGNED_CHAR]], i8 2 }
+// CHECK-DAG: @[[LINE_1600:.*]] = {{.*}}, i32 1600, i32 3 }, {{.*}}* @[[INT]], {{.*}}* @[[SIGNED_CHAR]], i8 2 }
+
+// CHECK-LABEL: @t0(
+unsigned short t0(unsigned short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_100]] to i8*)
+#line 100
+ x++;
+ return x;
+}
+// CHECK-LABEL: @t1(
+unsigned short t1(unsigned short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_200]] to i8*)
+#line 200
+ x--;
+ return x;
+}
+// CHECK-LABEL: @t2(
+unsigned short t2(unsigned short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_300]] to i8*)
+#line 300
+ ++x;
+ return x;
+}
+// CHECK-LABEL: @t3(
+unsigned short t3(unsigned short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_400]] to i8*)
+#line 400
+ --x;
+ return x;
+}
+
+// CHECK-LABEL: @t4(
+signed short t4(signed short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_500]] to i8*)
+#line 500
+ x++;
+ return x;
+}
+// CHECK-LABEL: @t5(
+signed short t5(signed short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_600]] to i8*)
+#line 600
+ x--;
+ return x;
+}
+// CHECK-LABEL: @t6(
+signed short t6(signed short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_700]] to i8*)
+#line 700
+ ++x;
+ return x;
+}
+// CHECK-LABEL: @t7(
+signed short t7(signed short x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_800]] to i8*)
+#line 800
+ --x;
+ return x;
+}
+
+// CHECK-LABEL: @t8(
+unsigned char t8(unsigned char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_900]] to i8*)
+#line 900
+ x++;
+ return x;
+}
+// CHECK-LABEL: @t9(
+unsigned char t9(unsigned char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_1000]] to i8*)
+#line 1000
+ x--;
+ return x;
+}
+// CHECK-LABEL: @t10(
+unsigned char t10(unsigned char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_1100]] to i8*)
+#line 1100
+ ++x;
+ return x;
+}
+// CHECK-LABEL: @t11(
+unsigned char t11(unsigned char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_1200]] to i8*)
+#line 1200
+ --x;
+ return x;
+}
+
+// CHECK-LABEL: @t12(
+signed char t12(signed char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_1300]] to i8*)
+#line 1300
+ x++;
+ return x;
+}
+// CHECK-LABEL: @t13(
+signed char t13(signed char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_1400]] to i8*)
+#line 1400
+ x--;
+ return x;
+}
+// CHECK-LABEL: @t14(
+signed char t14(signed char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_1500]] to i8*)
+#line 1500
+ ++x;
+ return x;
+}
+// CHECK-LABEL: @t15(
+signed char t15(signed char x) {
+ // CHECK: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_1600]] to i8*)
+#line 1600
+ --x;
+ return x;
+}
diff --git a/src/llvm-project/clang/test/CodeGen/catch-implicit-signed-integer-truncations-incdec.c b/src/llvm-project/clang/test/CodeGen/catch-implicit-signed-integer-truncations-incdec.c
new file mode 100644
index 0000000..1e0bad1
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/catch-implicit-signed-integer-truncations-incdec.c
@@ -0,0 +1,303 @@
+// RUN: %clang_cc1 -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s --check-prefixes=CHECK,CHECK-NOSANITIZE
+
+// RUN: %clang_cc1 -fsanitize=implicit-signed-integer-truncation -fno-sanitize-recover=implicit-signed-integer-truncation -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_implicit_conversion" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-ANYRECOVER,CHECK-SANITIZE-NORECOVER,CHECK-SANITIZE-UNREACHABLE
+// RUN: %clang_cc1 -fsanitize=implicit-signed-integer-truncation -fsanitize-recover=implicit-signed-integer-truncation -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_implicit_conversion" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-ANYRECOVER,CHECK-SANITIZE-RECOVER
+// RUN: %clang_cc1 -fsanitize=implicit-signed-integer-truncation -fsanitize-trap=implicit-signed-integer-truncation -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_implicit_conversion" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-TRAP,CHECK-SANITIZE-UNREACHABLE
+
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[INT:.*]] = {{.*}} c"'int'\00" }
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[UNSIGNED_SHORT:.*]] = {{.*}} c"'unsigned short'\00" }
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_100:.*]] = {{.*}}, i32 100, i32 11 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_SHORT]], i8 2 }
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_200:.*]] = {{.*}}, i32 200, i32 11 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_SHORT]], i8 2 }
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_300:.*]] = {{.*}}, i32 300, i32 10 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_SHORT]], i8 2 }
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_400:.*]] = {{.*}}, i32 400, i32 10 }, {{.*}}* @[[INT]], {{.*}}* @[[UNSIGNED_SHORT]], i8 2 }
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[SHORT:.*]] = {{.*}} c"'short'\00" }
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_500:.*]] = {{.*}}, i32 500, i32 11 }, {{.*}}* @[[INT]], {{.*}}* @[[SHORT]], i8 2 }
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_600:.*]] = {{.*}}, i32 600, i32 11 }, {{.*}}* @[[INT]], {{.*}}* @[[SHORT]], i8 2 }
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_700:.*]] = {{.*}}, i32 700, i32 10 }, {{.*}}* @[[INT]], {{.*}}* @[[SHORT]], i8 2 }
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_800:.*]] = {{.*}}, i32 800, i32 10 }, {{.*}}* @[[INT]], {{.*}}* @[[SHORT]], i8 2 }
+
+unsigned short t0(unsigned short x) {
+// CHECK-NOSANITIZE-LABEL: @t0(
+// CHECK-NOSANITIZE-NEXT: entry:
+// CHECK-NOSANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
+// CHECK-NOSANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: [[INC:%.*]] = add i16 [[X_RELOADED]], 1
+// CHECK-NOSANITIZE-NEXT: store i16 [[INC]], i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: ret i16 [[X_RELOADED]]
+//
+// CHECK-SANITIZE-LABEL: @t0(
+// CHECK-SANITIZE-NEXT: entry:
+// CHECK-SANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
+// CHECK-SANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: [[X_PROMOTED:%.*]] = zext i16 [[X_RELOADED]] to i32
+// CHECK-SANITIZE-NEXT: [[INC:%.*]] = add i32 [[X_PROMOTED]], 1
+// CHECK-SANITIZE-NEXT: [[X_PROMOTED_DEMOTED:%.*]] = trunc i32 [[INC]] to i16
+// CHECK-SANITIZE-NEXT: [[X_PROMOTED_DEMOTED_PROMOTED:%.*]] = zext i16 [[X_PROMOTED_DEMOTED]] to i32, !nosanitize
+// CHECK-SANITIZE-NEXT: [[TRUNCHECK:%.*]] = icmp eq i32 [[X_PROMOTED_DEMOTED_PROMOTED]], [[INC]], !nosanitize
+// CHECK-SANITIZE-NEXT: br i1 [[TRUNCHECK]], label %[[CONT:.*]], label %[[HANDLER_IMPLICIT_X_PROMOTEDERSION:[^,]+]],{{.*}} !nosanitize
+// CHECK-SANITIZE: [[HANDLER_IMPLICIT_X_PROMOTEDERSION]]:
+// CHECK-SANITIZE-TRAP-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
+// CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP1:%.*]] = zext i32 [[INC]] to i64, !nosanitize
+// CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP2:%.*]] = zext i16 [[X_PROMOTED_DEMOTED]] to i64, !nosanitize
+// CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_implicit_conversion_abort(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_100]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
+// CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_100]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
+// CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
+// CHECK-SANITIZE-RECOVER-NEXT: br label %[[CONT]], !nosanitize
+// CHECK-SANITIZE: [[CONT]]:
+// CHECK-SANITIZE-NEXT: store i16 [[X_PROMOTED_DEMOTED]], i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: ret i16 [[X_RELOADED]]
+#line 100
+ return x++;
+}
+unsigned short t1(unsigned short x) {
+// CHECK-NOSANITIZE-LABEL: @t1(
+// CHECK-NOSANITIZE-NEXT: entry:
+// CHECK-NOSANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
+// CHECK-NOSANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: [[INC:%.*]] = add i16 [[X_RELOADED]], -1
+// CHECK-NOSANITIZE-NEXT: store i16 [[INC]], i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: ret i16 [[X_RELOADED]]
+//
+// CHECK-SANITIZE-LABEL: @t1(
+// CHECK-SANITIZE-NEXT: entry:
+// CHECK-SANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
+// CHECK-SANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: [[X_PROMOTED:%.*]] = zext i16 [[X_RELOADED]] to i32
+// CHECK-SANITIZE-NEXT: [[INC:%.*]] = add i32 [[X_PROMOTED]], -1
+// CHECK-SANITIZE-NEXT: [[X_PROMOTED_DEMOTED:%.*]] = trunc i32 [[INC]] to i16
+// CHECK-SANITIZE-NEXT: [[X_PROMOTED_DEMOTED_PROMOTED:%.*]] = zext i16 [[X_PROMOTED_DEMOTED]] to i32, !nosanitize
+// CHECK-SANITIZE-NEXT: [[TRUNCHECK:%.*]] = icmp eq i32 [[X_PROMOTED_DEMOTED_PROMOTED]], [[INC]], !nosanitize
+// CHECK-SANITIZE-NEXT: br i1 [[TRUNCHECK]], label %[[CONT:.*]], label %[[HANDLER_IMPLICIT_X_PROMOTEDERSION:[^,]+]],{{.*}} !nosanitize
+// CHECK-SANITIZE: [[HANDLER_IMPLICIT_X_PROMOTEDERSION]]:
+// CHECK-SANITIZE-TRAP-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
+// CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP1:%.*]] = zext i32 [[INC]] to i64, !nosanitize
+// CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP2:%.*]] = zext i16 [[X_PROMOTED_DEMOTED]] to i64, !nosanitize
+// CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_implicit_conversion_abort(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_200]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
+// CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_200]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
+// CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
+// CHECK-SANITIZE-RECOVER-NEXT: br label %[[CONT]], !nosanitize
+// CHECK-SANITIZE: [[CONT]]:
+// CHECK-SANITIZE-NEXT: store i16 [[X_PROMOTED_DEMOTED]], i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: ret i16 [[X_RELOADED]]
+#line 200
+ return x--;
+}
+
+unsigned short t2(unsigned short x) {
+// CHECK-NOSANITIZE-LABEL: @t2(
+// CHECK-NOSANITIZE-NEXT: entry:
+// CHECK-NOSANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
+// CHECK-NOSANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: [[INC:%.*]] = add i16 [[X_RELOADED]], 1
+// CHECK-NOSANITIZE-NEXT: store i16 [[INC]], i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: ret i16 [[INC]]
+//
+// CHECK-SANITIZE-LABEL: @t2(
+// CHECK-SANITIZE-NEXT: entry:
+// CHECK-SANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
+// CHECK-SANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: [[X_PROMOTED:%.*]] = zext i16 [[X_RELOADED]] to i32
+// CHECK-SANITIZE-NEXT: [[INC:%.*]] = add i32 [[X_PROMOTED]], 1
+// CHECK-SANITIZE-NEXT: [[X_PROMOTED_DEMOTED:%.*]] = trunc i32 [[INC]] to i16
+// CHECK-SANITIZE-NEXT: [[X_PROMOTED_DEMOTED_PROMOTED:%.*]] = zext i16 [[X_PROMOTED_DEMOTED]] to i32, !nosanitize
+// CHECK-SANITIZE-NEXT: [[TRUNCHECK:%.*]] = icmp eq i32 [[X_PROMOTED_DEMOTED_PROMOTED]], [[INC]], !nosanitize
+// CHECK-SANITIZE-NEXT: br i1 [[TRUNCHECK]], label %[[CONT:.*]], label %[[HANDLER_IMPLICIT_X_PROMOTEDERSION:[^,]+]],{{.*}} !nosanitize
+// CHECK-SANITIZE: [[HANDLER_IMPLICIT_X_PROMOTEDERSION]]:
+// CHECK-SANITIZE-TRAP-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
+// CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP1:%.*]] = zext i32 [[INC]] to i64, !nosanitize
+// CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP2:%.*]] = zext i16 [[X_PROMOTED_DEMOTED]] to i64, !nosanitize
+// CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_implicit_conversion_abort(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_300]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
+// CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_300]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
+// CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
+// CHECK-SANITIZE-RECOVER-NEXT: br label %[[CONT]], !nosanitize
+// CHECK-SANITIZE: [[CONT]]:
+// CHECK-SANITIZE-NEXT: store i16 [[X_PROMOTED_DEMOTED]], i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: ret i16 [[X_PROMOTED_DEMOTED]]
+#line 300
+ return ++x;
+}
+
+unsigned short t3(unsigned short x) {
+// CHECK-NOSANITIZE-LABEL: @t3(
+// CHECK-NOSANITIZE-NEXT: entry:
+// CHECK-NOSANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
+// CHECK-NOSANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: [[INC:%.*]] = add i16 [[X_RELOADED]], -1
+// CHECK-NOSANITIZE-NEXT: store i16 [[INC]], i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: ret i16 [[INC]]
+//
+// CHECK-SANITIZE-LABEL: @t3(
+// CHECK-SANITIZE-NEXT: entry:
+// CHECK-SANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
+// CHECK-SANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: [[X_PROMOTED:%.*]] = zext i16 [[X_RELOADED]] to i32
+// CHECK-SANITIZE-NEXT: [[INC:%.*]] = add i32 [[X_PROMOTED]], -1
+// CHECK-SANITIZE-NEXT: [[X_PROMOTED_DEMOTED:%.*]] = trunc i32 [[INC]] to i16
+// CHECK-SANITIZE-NEXT: [[X_PROMOTED_DEMOTED_PROMOTED:%.*]] = zext i16 [[X_PROMOTED_DEMOTED]] to i32, !nosanitize
+// CHECK-SANITIZE-NEXT: [[TRUNCHECK:%.*]] = icmp eq i32 [[X_PROMOTED_DEMOTED_PROMOTED]], [[INC]], !nosanitize
+// CHECK-SANITIZE-NEXT: br i1 [[TRUNCHECK]], label %[[CONT:.*]], label %[[HANDLER_IMPLICIT_X_PROMOTEDERSION:[^,]+]],{{.*}} !nosanitize
+// CHECK-SANITIZE: [[HANDLER_IMPLICIT_X_PROMOTEDERSION]]:
+// CHECK-SANITIZE-TRAP-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
+// CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP1:%.*]] = zext i32 [[INC]] to i64, !nosanitize
+// CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP2:%.*]] = zext i16 [[X_PROMOTED_DEMOTED]] to i64, !nosanitize
+// CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_implicit_conversion_abort(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_400]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
+// CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_400]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
+// CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
+// CHECK-SANITIZE-RECOVER-NEXT: br label %[[CONT]], !nosanitize
+// CHECK-SANITIZE: [[CONT]]:
+// CHECK-SANITIZE-NEXT: store i16 [[X_PROMOTED_DEMOTED]], i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: ret i16 [[X_PROMOTED_DEMOTED]]
+#line 400
+ return --x;
+}
+
+signed short t4(signed short x) {
+// CHECK-NOSANITIZE-LABEL: @t4(
+// CHECK-NOSANITIZE-NEXT: entry:
+// CHECK-NOSANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
+// CHECK-NOSANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: [[INC:%.*]] = add i16 [[X_RELOADED]], 1
+// CHECK-NOSANITIZE-NEXT: store i16 [[INC]], i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: ret i16 [[X_RELOADED]]
+//
+// CHECK-SANITIZE-LABEL: @t4(
+// CHECK-SANITIZE-NEXT: entry:
+// CHECK-SANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
+// CHECK-SANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: [[X_PROMOTED:%.*]] = sext i16 [[X_RELOADED]] to i32
+// CHECK-SANITIZE-NEXT: [[INC:%.*]] = add i32 [[X_PROMOTED]], 1
+// CHECK-SANITIZE-NEXT: [[X_PROMOTED_DEMOTED:%.*]] = trunc i32 [[INC]] to i16
+// CHECK-SANITIZE-NEXT: [[X_PROMOTED_DEMOTED_PROMOTED:%.*]] = sext i16 [[X_PROMOTED_DEMOTED]] to i32, !nosanitize
+// CHECK-SANITIZE-NEXT: [[TRUNCHECK:%.*]] = icmp eq i32 [[X_PROMOTED_DEMOTED_PROMOTED]], [[INC]], !nosanitize
+// CHECK-SANITIZE-NEXT: br i1 [[TRUNCHECK]], label %[[CONT:.*]], label %[[HANDLER_IMPLICIT_X_PROMOTEDERSION:[^,]+]],{{.*}} !nosanitize
+// CHECK-SANITIZE: [[HANDLER_IMPLICIT_X_PROMOTEDERSION]]:
+// CHECK-SANITIZE-TRAP-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
+// CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP1:%.*]] = zext i32 [[INC]] to i64, !nosanitize
+// CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP2:%.*]] = zext i16 [[X_PROMOTED_DEMOTED]] to i64, !nosanitize
+// CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_implicit_conversion_abort(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_500]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
+// CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_500]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
+// CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
+// CHECK-SANITIZE-RECOVER-NEXT: br label %[[CONT]], !nosanitize
+// CHECK-SANITIZE: [[CONT]]:
+// CHECK-SANITIZE-NEXT: store i16 [[X_PROMOTED_DEMOTED]], i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: ret i16 [[X_RELOADED]]
+#line 500
+ return x++;
+}
+signed short t5(signed short x) {
+// CHECK-NOSANITIZE-LABEL: @t5(
+// CHECK-NOSANITIZE-NEXT: entry:
+// CHECK-NOSANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
+// CHECK-NOSANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: [[INC:%.*]] = add i16 [[X_RELOADED]], -1
+// CHECK-NOSANITIZE-NEXT: store i16 [[INC]], i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: ret i16 [[X_RELOADED]]
+//
+// CHECK-SANITIZE-LABEL: @t5(
+// CHECK-SANITIZE-NEXT: entry:
+// CHECK-SANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
+// CHECK-SANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: [[X_PROMOTED:%.*]] = sext i16 [[X_RELOADED]] to i32
+// CHECK-SANITIZE-NEXT: [[INC:%.*]] = add i32 [[X_PROMOTED]], -1
+// CHECK-SANITIZE-NEXT: [[X_PROMOTED_DEMOTED:%.*]] = trunc i32 [[INC]] to i16
+// CHECK-SANITIZE-NEXT: [[X_PROMOTED_DEMOTED_PROMOTED:%.*]] = sext i16 [[X_PROMOTED_DEMOTED]] to i32, !nosanitize
+// CHECK-SANITIZE-NEXT: [[TRUNCHECK:%.*]] = icmp eq i32 [[X_PROMOTED_DEMOTED_PROMOTED]], [[INC]], !nosanitize
+// CHECK-SANITIZE-NEXT: br i1 [[TRUNCHECK]], label %[[CONT:.*]], label %[[HANDLER_IMPLICIT_X_PROMOTEDERSION:[^,]+]],{{.*}} !nosanitize
+// CHECK-SANITIZE: [[HANDLER_IMPLICIT_X_PROMOTEDERSION]]:
+// CHECK-SANITIZE-TRAP-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
+// CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP1:%.*]] = zext i32 [[INC]] to i64, !nosanitize
+// CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP2:%.*]] = zext i16 [[X_PROMOTED_DEMOTED]] to i64, !nosanitize
+// CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_implicit_conversion_abort(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_600]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
+// CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_600]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
+// CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
+// CHECK-SANITIZE-RECOVER-NEXT: br label %[[CONT]], !nosanitize
+// CHECK-SANITIZE: [[CONT]]:
+// CHECK-SANITIZE-NEXT: store i16 [[X_PROMOTED_DEMOTED]], i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: ret i16 [[X_RELOADED]]
+#line 600
+ return x--;
+}
+
+signed short t6(signed short x) {
+// CHECK-NOSANITIZE-LABEL: @t6(
+// CHECK-NOSANITIZE-NEXT: entry:
+// CHECK-NOSANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
+// CHECK-NOSANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: [[INC:%.*]] = add i16 [[X_RELOADED]], 1
+// CHECK-NOSANITIZE-NEXT: store i16 [[INC]], i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: ret i16 [[INC]]
+//
+// CHECK-SANITIZE-LABEL: @t6(
+// CHECK-SANITIZE-NEXT: entry:
+// CHECK-SANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
+// CHECK-SANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: [[X_PROMOTED:%.*]] = sext i16 [[X_RELOADED]] to i32
+// CHECK-SANITIZE-NEXT: [[INC:%.*]] = add i32 [[X_PROMOTED]], 1
+// CHECK-SANITIZE-NEXT: [[X_PROMOTED_DEMOTED:%.*]] = trunc i32 [[INC]] to i16
+// CHECK-SANITIZE-NEXT: [[X_PROMOTED_DEMOTED_PROMOTED:%.*]] = sext i16 [[X_PROMOTED_DEMOTED]] to i32, !nosanitize
+// CHECK-SANITIZE-NEXT: [[TRUNCHECK:%.*]] = icmp eq i32 [[X_PROMOTED_DEMOTED_PROMOTED]], [[INC]], !nosanitize
+// CHECK-SANITIZE-NEXT: br i1 [[TRUNCHECK]], label %[[CONT:.*]], label %[[HANDLER_IMPLICIT_X_PROMOTEDERSION:[^,]+]],{{.*}} !nosanitize
+// CHECK-SANITIZE: [[HANDLER_IMPLICIT_X_PROMOTEDERSION]]:
+// CHECK-SANITIZE-TRAP-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
+// CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP1:%.*]] = zext i32 [[INC]] to i64, !nosanitize
+// CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP2:%.*]] = zext i16 [[X_PROMOTED_DEMOTED]] to i64, !nosanitize
+// CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_implicit_conversion_abort(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_700]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
+// CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_700]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
+// CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
+// CHECK-SANITIZE-RECOVER-NEXT: br label %[[CONT]], !nosanitize
+// CHECK-SANITIZE: [[CONT]]:
+// CHECK-SANITIZE-NEXT: store i16 [[X_PROMOTED_DEMOTED]], i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: ret i16 [[X_PROMOTED_DEMOTED]]
+#line 700
+ return ++x;
+}
+
+signed short t7(signed short x) {
+// CHECK-NOSANITIZE-LABEL: @t7(
+// CHECK-NOSANITIZE-NEXT: entry:
+// CHECK-NOSANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
+// CHECK-NOSANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: [[INC:%.*]] = add i16 [[X_RELOADED]], -1
+// CHECK-NOSANITIZE-NEXT: store i16 [[INC]], i16* [[X_ADDR]], align 2
+// CHECK-NOSANITIZE-NEXT: ret i16 [[INC]]
+//
+// CHECK-SANITIZE-LABEL: @t7(
+// CHECK-SANITIZE-NEXT: entry:
+// CHECK-SANITIZE-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
+// CHECK-SANITIZE-NEXT: store i16 [[X:%.*]], i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: [[X_RELOADED:%.*]] = load i16, i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: [[X_PROMOTED:%.*]] = sext i16 [[X_RELOADED]] to i32
+// CHECK-SANITIZE-NEXT: [[INC:%.*]] = add i32 [[X_PROMOTED]], -1
+// CHECK-SANITIZE-NEXT: [[X_PROMOTED_DEMOTED:%.*]] = trunc i32 [[INC]] to i16
+// CHECK-SANITIZE-NEXT: [[X_PROMOTED_DEMOTED_PROMOTED:%.*]] = sext i16 [[X_PROMOTED_DEMOTED]] to i32, !nosanitize
+// CHECK-SANITIZE-NEXT: [[TRUNCHECK:%.*]] = icmp eq i32 [[X_PROMOTED_DEMOTED_PROMOTED]], [[INC]], !nosanitize
+// CHECK-SANITIZE-NEXT: br i1 [[TRUNCHECK]], label %[[CONT:.*]], label %[[HANDLER_IMPLICIT_X_PROMOTEDERSION:[^,]+]],{{.*}} !nosanitize
+// CHECK-SANITIZE: [[HANDLER_IMPLICIT_X_PROMOTEDERSION]]:
+// CHECK-SANITIZE-TRAP-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
+// CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP1:%.*]] = zext i32 [[INC]] to i64, !nosanitize
+// CHECK-SANITIZE-ANYRECOVER-NEXT: [[TMP2:%.*]] = zext i16 [[X_PROMOTED_DEMOTED]] to i64, !nosanitize
+// CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_implicit_conversion_abort(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_800]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
+// CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_implicit_conversion(i8* bitcast ({ {{{.*}}}, {{{.*}}}*, {{{.*}}}*, i8 }* @[[LINE_800]] to i8*), i64 [[TMP1]], i64 [[TMP2]]) #2, !nosanitize
+// CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
+// CHECK-SANITIZE-RECOVER-NEXT: br label %[[CONT]], !nosanitize
+// CHECK-SANITIZE: [[CONT]]:
+// CHECK-SANITIZE-NEXT: store i16 [[X_PROMOTED_DEMOTED]], i16* [[X_ADDR]], align 2
+// CHECK-SANITIZE-NEXT: ret i16 [[X_PROMOTED_DEMOTED]]
+#line 800
+ return --x;
+}
diff --git a/src/llvm-project/clang/test/CodeGen/catch-implicit-unsigned-integer-truncations-incdec-basics.c b/src/llvm-project/clang/test/CodeGen/catch-implicit-unsigned-integer-truncations-incdec-basics.c
new file mode 100644
index 0000000..7ad1231
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/catch-implicit-unsigned-integer-truncations-incdec-basics.c
@@ -0,0 +1,101 @@
+// RUN: %clang_cc1 -fsanitize=implicit-unsigned-integer-truncation -fsanitize-recover=implicit-unsigned-integer-truncation -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_implicit_conversion" --check-prefixes=CHECK
+
+// CHECK-LABEL: @t0(
+unsigned short t0(unsigned short x) {
+#line 100
+ x++;
+ return x;
+}
+// CHECK-LABEL: @t1(
+unsigned short t1(unsigned short x) {
+#line 200
+ x--;
+ return x;
+}
+// CHECK-LABEL: @t2(
+unsigned short t2(unsigned short x) {
+#line 300
+ ++x;
+ return x;
+}
+// CHECK-LABEL: @t3(
+unsigned short t3(unsigned short x) {
+#line 400
+ --x;
+ return x;
+}
+
+// CHECK-LABEL: @t4(
+signed short t4(signed short x) {
+#line 500
+ x++;
+ return x;
+}
+// CHECK-LABEL: @t5(
+signed short t5(signed short x) {
+#line 600
+ x--;
+ return x;
+}
+// CHECK-LABEL: @t6(
+signed short t6(signed short x) {
+#line 700
+ ++x;
+ return x;
+}
+// CHECK-LABEL: @t7(
+signed short t7(signed short x) {
+#line 800
+ --x;
+ return x;
+}
+
+// CHECK-LABEL: @t8(
+unsigned char t8(unsigned char x) {
+#line 900
+ x++;
+ return x;
+}
+// CHECK-LABEL: @t9(
+unsigned char t9(unsigned char x) {
+#line 1000
+ x--;
+ return x;
+}
+// CHECK-LABEL: @t10(
+unsigned char t10(unsigned char x) {
+#line 1100
+ ++x;
+ return x;
+}
+// CHECK-LABEL: @t11(
+unsigned char t11(unsigned char x) {
+#line 1200
+ --x;
+ return x;
+}
+
+// CHECK-LABEL: @t12(
+signed char t12(signed char x) {
+#line 1300
+ x++;
+ return x;
+}
+// CHECK-LABEL: @t13(
+signed char t13(signed char x) {
+#line 1400
+ x--;
+ return x;
+}
+// CHECK-LABEL: @t14(
+signed char t14(signed char x) {
+#line 1500
+ ++x;
+ return x;
+}
+// CHECK-LABEL: @t15(
+signed char t15(signed char x) {
+#line 1600
+ --x;
+ return x;
+}
diff --git a/src/llvm-project/clang/test/CodeGen/catch-nullptr-and-nonzero-offset-blacklist.c b/src/llvm-project/clang/test/CodeGen/catch-nullptr-and-nonzero-offset-blacklist.c
new file mode 100644
index 0000000..3cf53c8
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/catch-nullptr-and-nonzero-offset-blacklist.c
@@ -0,0 +1,34 @@
+// RUN: %clang_cc1 -x c -fsanitize=pointer-overflow -fsanitize-recover=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_pointer_overflow" --check-prefixes=CHECK,CHECK-NULL-IS-INVALID-PTR
+// RUN: %clang_cc1 -x c -fno-delete-null-pointer-checks -fsanitize=pointer-overflow -fsanitize-recover=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_pointer_overflow" --check-prefixes=CHECK,CHECK-NULL-IS-VALID-PTR
+
+// RUN: %clang_cc1 -x c++ -fsanitize=pointer-overflow -fsanitize-recover=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_pointer_overflow" --check-prefixes=CHECK,CHECK-NULL-IS-INVALID-PTR
+// RUN: %clang_cc1 -x c++ -fno-delete-null-pointer-checks -fsanitize=pointer-overflow -fsanitize-recover=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_pointer_overflow" --check-prefixes=CHECK,CHECK-NULL-IS-VALID-PTR
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// CHECK-LABEL: @baseline
+char *baseline(char *base, unsigned long offset) {
+ // CHECK: call void @__ubsan_handle_pointer_overflow(
+ return base + offset;
+}
+
+// CHECK-LABEL: @blacklist_0
+__attribute__((no_sanitize("undefined"))) char *blacklist_0(char *base, unsigned long offset) {
+ return base + offset;
+}
+
+// CHECK-LABEL: @blacklist_1
+__attribute__((no_sanitize("pointer-overflow"))) char *blacklist_1(char *base, unsigned long offset) {
+ return base + offset;
+}
+
+// CHECK-LABEL: @ignore_non_default_address_space
+__attribute__((address_space(1))) char *ignore_non_default_address_space(__attribute__((address_space(1))) char *base, unsigned long offset) {
+ return base + offset;
+}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/src/llvm-project/clang/test/CodeGen/catch-nullptr-and-nonzero-offset-in-offsetof-idiom.c b/src/llvm-project/clang/test/CodeGen/catch-nullptr-and-nonzero-offset-in-offsetof-idiom.c
new file mode 100644
index 0000000..09d644a
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/catch-nullptr-and-nonzero-offset-in-offsetof-idiom.c
@@ -0,0 +1,35 @@
+// RUN: %clang_cc1 -x c -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s
+// RUN: %clang_cc1 -x c -fsanitize=pointer-overflow -fno-sanitize-recover=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s
+
+// RUN: %clang_cc1 -x c++ -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s
+// RUN: %clang_cc1 -x c++ -fsanitize=pointer-overflow -fno-sanitize-recover=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct S {
+ int x, y;
+};
+
+// CHECK-LABEL: define i64 @{{.*}}get_offset_of_y_naively{{.*}}(
+uintptr_t get_offset_of_y_naively() {
+ // CHECK: [[ENTRY:.*]]:
+ // CHECK-NEXT: ret i64 ptrtoint (i32* getelementptr (i32, i32* null, i32 1) to i64)
+ // CHECK-NEXT: }
+ return ((uintptr_t)(&(((struct S *)0)->y)));
+}
+
+// CHECK-LABEL: define i64 @{{.*}}get_offset_of_y_via_builtin{{.*}}(
+uintptr_t get_offset_of_y_via_builtin() {
+ // CHECK: [[ENTRY:.*]]:
+ // CHECK-NEXT: ret i64 4
+ // CHECK-NEXT: }
+ return __builtin_offsetof(struct S, y);
+}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/src/llvm-project/clang/test/CodeGen/catch-nullptr-and-nonzero-offset-when-nullptr-is-defined.c b/src/llvm-project/clang/test/CodeGen/catch-nullptr-and-nonzero-offset-when-nullptr-is-defined.c
new file mode 100644
index 0000000..3f1e225
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/catch-nullptr-and-nonzero-offset-when-nullptr-is-defined.c
@@ -0,0 +1,66 @@
+// RUN: %clang_cc1 -x c -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s --check-prefixes=CHECK,CHECK-NOSANITIZE
+// RUN: %clang_cc1 -x c -fsanitize=pointer-overflow -fno-sanitize-recover=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_pointer_overflow" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-NULLNOTOK,CHECK-SANITIZE-NULLNOTOK-C,CHECK-SANITIZE-ANYRECOVER,CHECK-SANITIZE-NORECOVER,CHECK-SANITIZE-UNREACHABLE
+// RUN: %clang_cc1 -x c -fsanitize=pointer-overflow -fsanitize-recover=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_pointer_overflow" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-NULLNOTOK,CHECK-SANITIZE-NULLNOTOK-C,CHECK-SANITIZE-ANYRECOVER,CHECK-SANITIZE-RECOVER
+// RUN: %clang_cc1 -x c -fsanitize=pointer-overflow -fsanitize-trap=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_pointer_overflow" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-NULLNOTOK,CHECK-SANITIZE-NULLNOTOK-C,CHECK-SANITIZE-TRAP,CHECK-SANITIZE-UNREACHABLE
+
+// RUN: %clang_cc1 -x c -fno-delete-null-pointer-checks -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s --check-prefixes=CHECK,CHECK-NOSANITIZE
+// RUN: %clang_cc1 -x c -fno-delete-null-pointer-checks -fsanitize=pointer-overflow -fno-sanitize-recover=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_pointer_overflow" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-NULLOK,CHECK-SANITIZE-ANYRECOVER,CHECK-SANITIZE-NORECOVER,CHECK-SANITIZE-UNREACHABLE
+// RUN: %clang_cc1 -x c -fno-delete-null-pointer-checks -fsanitize=pointer-overflow -fsanitize-recover=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_pointer_overflow" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-NULLOK,CHECK-SANITIZE-ANYRECOVER,CHECK-SANITIZE-RECOVER
+// RUN: %clang_cc1 -x c -fno-delete-null-pointer-checks -fsanitize=pointer-overflow -fsanitize-trap=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_pointer_overflow" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-NULLOK,CHECK-SANITIZE-TRAP,CHECK-SANITIZE-UNREACHABLE
+
+// RUN: %clang_cc1 -x c++ -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s --check-prefixes=CHECK,CHECK-NOSANITIZE
+// RUN: %clang_cc1 -x c++ -fsanitize=pointer-overflow -fno-sanitize-recover=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_pointer_overflow" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-NULLNOTOK,CHECK-SANITIZE-NULLNOTOK-CPP,CHECK-SANITIZE-ANYRECOVER,CHECK-SANITIZE-NORECOVER,CHECK-SANITIZE-UNREACHABLE
+// RUN: %clang_cc1 -x c++ -fsanitize=pointer-overflow -fsanitize-recover=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_pointer_overflow" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-NULLNOTOK,CHECK-SANITIZE-NULLNOTOK-CPP,CHECK-SANITIZE-ANYRECOVER,CHECK-SANITIZE-RECOVER
+// RUN: %clang_cc1 -x c++ -fsanitize=pointer-overflow -fsanitize-trap=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_pointer_overflow" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-NULLNOTOK,CHECK-SANITIZE-NULLNOTOK-CPP,CHECK-SANITIZE-TRAP,CHECK-SANITIZE-UNREACHABLE
+
+// RUN: %clang_cc1 -x c++ -fno-delete-null-pointer-checks -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s --check-prefixes=CHECK,CHECK-NOSANITIZE
+// RUN: %clang_cc1 -x c++ -fno-delete-null-pointer-checks -fsanitize=pointer-overflow -fno-sanitize-recover=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_pointer_overflow" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-NULLOK,CHECK-SANITIZE-ANYRECOVER,CHECK-SANITIZE-NORECOVER,CHECK-SANITIZE-UNREACHABLE
+// RUN: %clang_cc1 -x c++ -fno-delete-null-pointer-checks -fsanitize=pointer-overflow -fsanitize-recover=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_pointer_overflow" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-NULLOK,CHECK-SANITIZE-ANYRECOVER,CHECK-SANITIZE-RECOVER
+// RUN: %clang_cc1 -x c++ -fno-delete-null-pointer-checks -fsanitize=pointer-overflow -fsanitize-trap=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_pointer_overflow" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-NULLOK,CHECK-SANITIZE-TRAP,CHECK-SANITIZE-UNREACHABLE
+
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_100:.*]] = {{.*}}, i32 100, i32 15 } }
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+char *add_unsigned(char *base, unsigned long offset) {
+ // CHECK: define i8* @add_unsigned(i8* %[[BASE:.*]], i64 %[[OFFSET:.*]])
+ // CHECK-NEXT: [[ENTRY:.*]]:
+ // CHECK-NEXT: %[[BASE_ADDR:.*]] = alloca i8*, align 8
+ // CHECK-NEXT: %[[OFFSET_ADDR:.*]] = alloca i64, align 8
+ // CHECK-NEXT: store i8* %[[BASE]], i8** %[[BASE_ADDR]], align 8
+ // CHECK-NEXT: store i64 %[[OFFSET]], i64* %[[OFFSET_ADDR]], align 8
+ // CHECK-NEXT: %[[BASE_RELOADED:.*]] = load i8*, i8** %[[BASE_ADDR]], align 8
+ // CHECK-NEXT: %[[OFFSET_RELOADED:.*]] = load i64, i64* %[[OFFSET_ADDR]], align 8
+ // CHECK-NEXT: %[[ADD_PTR:.*]] = getelementptr inbounds i8, i8* %[[BASE_RELOADED]], i64 %[[OFFSET_RELOADED]]
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_OFFSET_AGGREGATE:.*]] = call { i64, i1 } @llvm.smul.with.overflow.i64(i64 1, i64 %[[OFFSET_RELOADED]]), !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_OFFSET_OVERFLOWED:.*]] = extractvalue { i64, i1 } %[[COMPUTED_OFFSET_AGGREGATE]], 1, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_OFFSET:.*]] = extractvalue { i64, i1 } %[[COMPUTED_OFFSET_AGGREGATE]], 0, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[BASE_RELOADED_INT:.*]] = ptrtoint i8* %[[BASE_RELOADED]] to i64, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP:.*]] = add i64 %[[BASE_RELOADED_INT]], %[[COMPUTED_OFFSET]], !nosanitize
+ // CHECK-SANITIZE-NULLNOTOK-NEXT: %[[BASE_IS_NOT_NULLPTR:.*]] = icmp ne i8* %[[BASE_RELOADED]], null, !nosanitize
+ // CHECK-SANITIZE-NULLNOTOK-NEXT: %[[COMPUTED_GEP_IS_NOT_NULL:.*]] = icmp ne i64 %[[COMPUTED_GEP]], 0, !nosanitize
+ // CHECK-SANITIZE-NULLNOTOK-C-NEXT: %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL:.*]] = and i1 %[[BASE_IS_NOT_NULLPTR]], %[[COMPUTED_GEP_IS_NOT_NULL]], !nosanitize
+ // CHECK-SANITIZE-NULLNOTOK-CPP-NEXT: %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL:.*]] = icmp eq i1 %[[BASE_IS_NOT_NULLPTR]], %[[COMPUTED_GEP_IS_NOT_NULL]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_OFFSET_DID_NOT_OVERFLOW:.*]] = xor i1 %[[COMPUTED_OFFSET_OVERFLOWED]], true, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP_IS_UGE_BASE:.*]] = icmp uge i64 %[[COMPUTED_GEP]], %[[BASE_RELOADED_INT]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[GEP_DID_NOT_OVERFLOW:.*]] = and i1 %[[COMPUTED_GEP_IS_UGE_BASE]], %[[COMPUTED_OFFSET_DID_NOT_OVERFLOW]], !nosanitize
+ // CHECK-SANITIZE-NULLNOTOK-NEXT: %[[GEP_IS_OKAY:.*]] = and i1 %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL]], %[[GEP_DID_NOT_OVERFLOW]], !nosanitize
+ // CHECK-SANITIZE-NULLNOTOK-NEXT: br i1 %[[GEP_IS_OKAY]],
+ // CHECK-SANITIZE-NULLOK-NEXT: br i1 %[[GEP_DID_NOT_OVERFLOW]],
+ // CHECK-SANITIZE-SAME: label %[[CONT:.*]], label %[[HANDLER_POINTER_OVERFLOW:[^,]+]],{{.*}} !nosanitize
+ // CHECK-SANITIZE: [[HANDLER_POINTER_OVERFLOW]]:
+ // CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_pointer_overflow_abort(i8* bitcast ({ {{{.*}}} }* @[[LINE_100]] to i8*), i64 %[[BASE_RELOADED_INT]], i64 %[[COMPUTED_GEP]])
+ // CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_pointer_overflow(i8* bitcast ({ {{{.*}}} }* @[[LINE_100]] to i8*), i64 %[[BASE_RELOADED_INT]], i64 %[[COMPUTED_GEP]])
+ // CHECK-SANITIZE-TRAP-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
+ // CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
+ // CHECK-SANITIZE: [[CONT]]:
+ // CHECK-NEXT: ret i8* %[[ADD_PTR]]
+#line 100
+ return base + offset;
+}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/src/llvm-project/clang/test/CodeGen/catch-nullptr-and-nonzero-offset.c b/src/llvm-project/clang/test/CodeGen/catch-nullptr-and-nonzero-offset.c
new file mode 100644
index 0000000..60283e7
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/catch-nullptr-and-nonzero-offset.c
@@ -0,0 +1,421 @@
+// RUN: %clang_cc1 -x c -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s --check-prefixes=CHECK,CHECK-NOSANITIZE
+// RUN: %clang_cc1 -x c -fsanitize=pointer-overflow -fno-sanitize-recover=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_pointer_overflow" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-ANYRECOVER,CHECK-SANITIZE-NORECOVER,CHECK-SANITIZE-UNREACHABLE,CHECK-SANITIZE-C,CHECK-SANITIZE-ANYRECOVER-C,CHECK-SANITIZE-NORECOVER-C,CHECK-SANITIZE-UNREACHABLE-C
+// RUN: %clang_cc1 -x c -fsanitize=pointer-overflow -fsanitize-recover=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_pointer_overflow" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-ANYRECOVER,CHECK-SANITIZE-RECOVER,CHECK-SANITIZE-C,CHECK-SANITIZE-ANYRECOVER-C,CHECK-SANITIZE-RECOVER-C
+// RUN: %clang_cc1 -x c -fsanitize=pointer-overflow -fsanitize-trap=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_pointer_overflow" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-TRAP,CHECK-SANITIZE-UNREACHABLE,CHECK-SANITIZE-C,CHECK-SANITIZE-TRAP-C,CHECK-SANITIZE-UNREACHABLE-C
+
+// RUN: %clang_cc1 -x c++ -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s --check-prefixes=CHECK,CHECK-NOSANITIZE
+// RUN: %clang_cc1 -x c++ -fsanitize=pointer-overflow -fno-sanitize-recover=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_pointer_overflow" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-ANYRECOVER,CHECK-SANITIZE-NORECOVER,CHECK-SANITIZE-UNREACHABLE,CHECK-SANITIZE-CPP,CHECK-SANITIZE-ANYRECOVER-CPP,CHECK-SANITIZE-NORECOVER-CPP,CHECK-SANITIZE-UNREACHABLE-CPP
+// RUN: %clang_cc1 -x c++ -fsanitize=pointer-overflow -fsanitize-recover=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_pointer_overflow" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-ANYRECOVER,CHECK-SANITIZE-RECOVER,CHECK-SANITIZE-CPP,CHECK-SANITIZE-ANYRECOVER-CPP,CHECK-SANITIZE-RECOVER-CPP
+// RUN: %clang_cc1 -x c++ -fsanitize=pointer-overflow -fsanitize-trap=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_pointer_overflow" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-TRAP,CHECK-SANITIZE-UNREACHABLE,CHECK-SANITIZE-CPP,CHECK-SANITIZE-TRAP-CPP,CHECK-SANITIZE-UNREACHABLE-CPP
+
+// In C++/LLVM IR, if the base pointer evaluates to a null pointer value,
+// the only valid pointer this inbounds GEP can produce is also a null pointer.
+// Likewise, if we have non-zero base pointer, we can not get null pointer
+// as a result, so the offset can not be -int(BasePtr).
+
+// So in other words, the offset can not change "null status" of the pointer,
+// as in if the pointer was null, it can not become non-null, and vice versa,
+// if it was non-null, it can not become null.
+
+// In C, however, offsetting null pointer is completely undefined, even by 0.
+
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_100:.*]] = {{.*}}, i32 100, i32 15 } }
+// CHECK-SANITIZE-ANYRECOVER-C-DAG: @[[LINE_200:.*]] = {{.*}}, i32 200, i32 15 } }
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_300:.*]] = {{.*}}, i32 300, i32 15 } }
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_400:.*]] = {{.*}}, i32 400, i32 15 } }
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_500:.*]] = {{.*}}, i32 500, i32 15 } }
+// CHECK-SANITIZE-ANYRECOVER-C-DAG: @[[LINE_600:.*]] = {{.*}}, i32 600, i32 15 } }
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_700:.*]] = {{.*}}, i32 700, i32 15 } }
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_800:.*]] = {{.*}}, i32 800, i32 15 } }
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_900:.*]] = {{.*}}, i32 900, i32 15 } }
+// CHECK-SANITIZE-ANYRECOVER-C-DAG: @[[LINE_1000:.*]] = {{.*}}, i32 1000, i32 15 } }
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_1100:.*]] = {{.*}}, i32 1100, i32 15 } }
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_1200:.*]] = {{.*}}, i32 1200, i32 15 } }
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_1300:.*]] = {{.*}}, i32 1300, i32 15 } }
+// CHECK-SANITIZE-ANYRECOVER-C-DAG: @[[LINE_1400:.*]] = {{.*}}, i32 1400, i32 15 } }
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_1500:.*]] = {{.*}}, i32 1500, i32 15 } }
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_1600:.*]] = {{.*}}, i32 1600, i32 15 } }
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+char *var_var(char *base, unsigned long offset) {
+ // CHECK: define i8* @var_var(i8* %[[BASE:.*]], i64 %[[OFFSET:.*]])
+ // CHECK-NEXT: [[ENTRY:.*]]:
+ // CHECK-NEXT: %[[BASE_ADDR:.*]] = alloca i8*, align 8
+ // CHECK-NEXT: %[[OFFSET_ADDR:.*]] = alloca i64, align 8
+ // CHECK-NEXT: store i8* %[[BASE]], i8** %[[BASE_ADDR]], align 8
+ // CHECK-NEXT: store i64 %[[OFFSET]], i64* %[[OFFSET_ADDR]], align 8
+ // CHECK-NEXT: %[[BASE_RELOADED:.*]] = load i8*, i8** %[[BASE_ADDR]], align 8
+ // CHECK-NEXT: %[[OFFSET_RELOADED:.*]] = load i64, i64* %[[OFFSET_ADDR]], align 8
+ // CHECK-NEXT: %[[ADD_PTR:.*]] = getelementptr inbounds i8, i8* %[[BASE_RELOADED]], i64 %[[OFFSET_RELOADED]]
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_OFFSET_AGGREGATE:.*]] = call { i64, i1 } @llvm.smul.with.overflow.i64(i64 1, i64 %[[OFFSET_RELOADED]]), !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_OFFSET_OVERFLOWED:.*]] = extractvalue { i64, i1 } %[[COMPUTED_OFFSET_AGGREGATE]], 1, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_OFFSET:.*]] = extractvalue { i64, i1 } %[[COMPUTED_OFFSET_AGGREGATE]], 0, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[BASE_RELOADED_INT:.*]] = ptrtoint i8* %[[BASE_RELOADED]] to i64, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP:.*]] = add i64 %[[BASE_RELOADED_INT]], %[[COMPUTED_OFFSET]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[BASE_IS_NOT_NULLPTR:.*]] = icmp ne i8* %[[BASE_RELOADED]], null, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP_IS_NOT_NULL:.*]] = icmp ne i64 %[[COMPUTED_GEP]], 0, !nosanitize
+ // CHECK-SANITIZE-C-NEXT: %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL:.*]] = and i1 %[[BASE_IS_NOT_NULLPTR]], %[[COMPUTED_GEP_IS_NOT_NULL]], !nosanitize
+ // CHECK-SANITIZE-CPP-NEXT: %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL:.*]] = icmp eq i1 %[[BASE_IS_NOT_NULLPTR]], %[[COMPUTED_GEP_IS_NOT_NULL]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_OFFSET_DID_NOT_OVERFLOW:.*]] = xor i1 %[[COMPUTED_OFFSET_OVERFLOWED]], true, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP_IS_UGE_BASE:.*]] = icmp uge i64 %[[COMPUTED_GEP]], %[[BASE_RELOADED_INT]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[GEP_DID_NOT_OVERFLOW:.*]] = and i1 %[[COMPUTED_GEP_IS_UGE_BASE]], %[[COMPUTED_OFFSET_DID_NOT_OVERFLOW]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[GEP_IS_OKAY:.*]] = and i1 %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL]], %[[GEP_DID_NOT_OVERFLOW]], !nosanitize
+ // CHECK-SANITIZE-NEXT: br i1 %[[GEP_IS_OKAY]], label %[[CONT:.*]], label %[[HANDLER_POINTER_OVERFLOW:[^,]+]],{{.*}} !nosanitize
+ // CHECK-SANITIZE: [[HANDLER_POINTER_OVERFLOW]]:
+ // CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_pointer_overflow_abort(i8* bitcast ({ {{{.*}}} }* @[[LINE_100]] to i8*), i64 %[[BASE_RELOADED_INT]], i64 %[[COMPUTED_GEP]])
+ // CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_pointer_overflow(i8* bitcast ({ {{{.*}}} }* @[[LINE_100]] to i8*), i64 %[[BASE_RELOADED_INT]], i64 %[[COMPUTED_GEP]])
+ // CHECK-SANITIZE-TRAP-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
+ // CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
+ // CHECK-SANITIZE: [[CONT]]:
+ // CHECK-NEXT: ret i8* %[[ADD_PTR]]
+#line 100
+ return base + offset;
+}
+
+char *var_zero(char *base) {
+ // CHECK: define i8* @var_zero(i8* %[[BASE:.*]])
+ // CHECK-NEXT: [[ENTRY:.*]]:
+ // CHECK-NEXT: %[[BASE_ADDR:.*]] = alloca i8*, align 8
+ // CHECK-NEXT: store i8* %[[BASE]], i8** %[[BASE_ADDR]], align 8
+ // CHECK-NEXT: %[[BASE_RELOADED:.*]] = load i8*, i8** %[[BASE_ADDR]], align 8
+ // CHECK-NEXT: %[[ADD_PTR:.*]] = getelementptr inbounds i8, i8* %[[BASE_RELOADED]], i64 0
+ // CHECK-SANITIZE-C-NEXT: %[[BASE_RELOADED_INT:.*]] = ptrtoint i8* %[[BASE_RELOADED]] to i64, !nosanitize
+ // CHECK-SANITIZE-C-NEXT: %[[COMPUTED_GEP:.*]] = add i64 %[[BASE_RELOADED_INT]], 0, !nosanitize
+ // CHECK-SANITIZE-C-NEXT: %[[BASE_IS_NOT_NULLPTR:.*]] = icmp ne i8* %[[BASE_RELOADED]], null, !nosanitize
+ // CHECK-SANITIZE-C-NEXT: %[[COMPUTED_GEP_IS_NOT_NULL:.*]] = icmp ne i64 %[[COMPUTED_GEP]], 0, !nosanitize
+ // CHECK-SANITIZE-C-NEXT: %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL:.*]] = and i1 %[[BASE_IS_NOT_NULLPTR]], %[[COMPUTED_GEP_IS_NOT_NULL]], !nosanitize
+ // CHECK-SANITIZE-C-NEXT: %[[COMPUTED_GEP_IS_UGE_BASE:.*]] = icmp uge i64 %[[COMPUTED_GEP]], %[[BASE_RELOADED_INT]], !nosanitize
+ // CHECK-SANITIZE-C-NEXT: %[[GEP_IS_OKAY:.*]] = and i1 %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL]], %[[COMPUTED_GEP_IS_UGE_BASE]], !nosanitize
+ // CHECK-SANITIZE-C-NEXT: br i1 %[[GEP_IS_OKAY]], label %[[CONT:.*]], label %[[HANDLER_POINTER_OVERFLOW:[^,]+]],{{.*}} !nosanitize
+ // CHECK-SANITIZE-C: [[HANDLER_POINTER_OVERFLOW]]:
+ // CHECK-SANITIZE-NORECOVER-C-NEXT: call void @__ubsan_handle_pointer_overflow_abort(i8* bitcast ({ {{{.*}}} }* @[[LINE_200]] to i8*), i64 %[[BASE_RELOADED_INT]], i64 %[[COMPUTED_GEP]])
+ // CHECK-SANITIZE-RECOVER-C-NEXT: call void @__ubsan_handle_pointer_overflow(i8* bitcast ({ {{{.*}}} }* @[[LINE_200]] to i8*), i64 %[[BASE_RELOADED_INT]], i64 %[[COMPUTED_GEP]])
+ // CHECK-SANITIZE-TRAP-C-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
+ // CHECK-SANITIZE-UNREACHABLE-C-NEXT: unreachable, !nosanitize
+ // CHECK-SANITIZE-C: [[CONT]]:
+ // CHECK-NEXT: ret i8* %[[ADD_PTR]]
+ static const unsigned long offset = 0;
+#line 200
+ return base + offset;
+}
+
+char *var_one(char *base) {
+ // CHECK: define i8* @var_one(i8* %[[BASE:.*]])
+ // CHECK-NEXT: [[ENTRY:.*]]:
+ // CHECK-NEXT: %[[BASE_ADDR:.*]] = alloca i8*, align 8
+ // CHECK-NEXT: store i8* %[[BASE]], i8** %[[BASE_ADDR]], align 8
+ // CHECK-NEXT: %[[BASE_RELOADED:.*]] = load i8*, i8** %[[BASE_ADDR]], align 8
+ // CHECK-NEXT: %[[ADD_PTR:.*]] = getelementptr inbounds i8, i8* %[[BASE_RELOADED]], i64 1
+ // CHECK-SANITIZE-NEXT: %[[BASE_RELOADED_INT:.*]] = ptrtoint i8* %[[BASE_RELOADED]] to i64, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP:.*]] = add i64 %[[BASE_RELOADED_INT]], 1, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[BASE_IS_NOT_NULLPTR:.*]] = icmp ne i8* %[[BASE_RELOADED]], null, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP_IS_NOT_NULL:.*]] = icmp ne i64 %[[COMPUTED_GEP]], 0, !nosanitize
+ // CHECK-SANITIZE-C-NEXT: %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL:.*]] = and i1 %[[BASE_IS_NOT_NULLPTR]], %[[COMPUTED_GEP_IS_NOT_NULL]], !nosanitize
+ // CHECK-SANITIZE-CPP-NEXT: %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL:.*]] = icmp eq i1 %[[BASE_IS_NOT_NULLPTR]], %[[COMPUTED_GEP_IS_NOT_NULL]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP_IS_UGE_BASE:.*]] = icmp uge i64 %[[COMPUTED_GEP]], %[[BASE_RELOADED_INT]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[GEP_IS_OKAY:.*]] = and i1 %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL]], %[[COMPUTED_GEP_IS_UGE_BASE]], !nosanitize
+ // CHECK-SANITIZE-NEXT: br i1 %[[GEP_IS_OKAY]], label %[[CONT:.*]], label %[[HANDLER_POINTER_OVERFLOW:[^,]+]],{{.*}} !nosanitize
+ // CHECK-SANITIZE: [[HANDLER_POINTER_OVERFLOW]]:
+ // CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_pointer_overflow_abort(i8* bitcast ({ {{{.*}}} }* @[[LINE_300]] to i8*), i64 %[[BASE_RELOADED_INT]], i64 %[[COMPUTED_GEP]])
+ // CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_pointer_overflow(i8* bitcast ({ {{{.*}}} }* @[[LINE_300]] to i8*), i64 %[[BASE_RELOADED_INT]], i64 %[[COMPUTED_GEP]])
+ // CHECK-SANITIZE-TRAP-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
+ // CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
+ // CHECK-SANITIZE: [[CONT]]:
+ // CHECK-NEXT: ret i8* %[[ADD_PTR]]
+ static const unsigned long offset = 1;
+#line 300
+ return base + offset;
+}
+
+char *var_allones(char *base) {
+ // CHECK: define i8* @var_allones(i8* %[[BASE:.*]])
+ // CHECK-NEXT: [[ENTRY:.*]]:
+ // CHECK-NEXT: %[[BASE_ADDR:.*]] = alloca i8*, align 8
+ // CHECK-NEXT: store i8* %[[BASE]], i8** %[[BASE_ADDR]], align 8
+ // CHECK-NEXT: %[[BASE_RELOADED:.*]] = load i8*, i8** %[[BASE_ADDR]], align 8
+ // CHECK-NEXT: %[[ADD_PTR:.*]] = getelementptr inbounds i8, i8* %[[BASE_RELOADED]], i64 -1
+ // CHECK-SANITIZE-NEXT: %[[BASE_RELOADED_INT:.*]] = ptrtoint i8* %[[BASE_RELOADED]] to i64, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP:.*]] = add i64 %[[BASE_RELOADED_INT]], -1, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[BASE_IS_NOT_NULLPTR:.*]] = icmp ne i8* %[[BASE_RELOADED]], null, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP_IS_NOT_NULL:.*]] = icmp ne i64 %[[COMPUTED_GEP]], 0, !nosanitize
+ // CHECK-SANITIZE-C-NEXT: %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL:.*]] = and i1 %[[BASE_IS_NOT_NULLPTR]], %[[COMPUTED_GEP_IS_NOT_NULL]], !nosanitize
+ // CHECK-SANITIZE-CPP-NEXT: %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL:.*]] = icmp eq i1 %[[BASE_IS_NOT_NULLPTR]], %[[COMPUTED_GEP_IS_NOT_NULL]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP_IS_UGE_BASE:.*]] = icmp uge i64 %[[COMPUTED_GEP]], %[[BASE_RELOADED_INT]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[GEP_IS_OKAY:.*]] = and i1 %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL]], %[[COMPUTED_GEP_IS_UGE_BASE]], !nosanitize
+ // CHECK-SANITIZE-NEXT: br i1 %[[GEP_IS_OKAY]], label %[[CONT:.*]], label %[[HANDLER_POINTER_OVERFLOW:[^,]+]],{{.*}} !nosanitize
+ // CHECK-SANITIZE: [[HANDLER_POINTER_OVERFLOW]]:
+ // CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_pointer_overflow_abort(i8* bitcast ({ {{{.*}}} }* @[[LINE_400]] to i8*), i64 %[[BASE_RELOADED_INT]], i64 %[[COMPUTED_GEP]])
+ // CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_pointer_overflow(i8* bitcast ({ {{{.*}}} }* @[[LINE_400]] to i8*), i64 %[[BASE_RELOADED_INT]], i64 %[[COMPUTED_GEP]])
+ // CHECK-SANITIZE-TRAP-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
+ // CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
+ // CHECK-SANITIZE: [[CONT]]:
+ // CHECK-NEXT: ret i8* %[[ADD_PTR]]
+ static const unsigned long offset = -1;
+#line 400
+ return base + offset;
+}
+
+//------------------------------------------------------------------------------
+
+char *nullptr_var(unsigned long offset) {
+ // CHECK: define i8* @nullptr_var(i64 %[[OFFSET:.*]])
+ // CHECK-NEXT: [[ENTRY:.*]]:
+ // CHECK-NEXT: %[[OFFSET_ADDR:.*]] = alloca i64, align 8
+ // CHECK-NEXT: store i64 %[[OFFSET]], i64* %[[OFFSET_ADDR]], align 8
+ // CHECK-NEXT: %[[OFFSET_RELOADED:.*]] = load i64, i64* %[[OFFSET_ADDR]], align 8
+ // CHECK-NEXT: %[[ADD_PTR:.*]] = getelementptr inbounds i8, i8* null, i64 %[[OFFSET_RELOADED]]
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_OFFSET_AGGREGATE:.*]] = call { i64, i1 } @llvm.smul.with.overflow.i64(i64 1, i64 %[[OFFSET_RELOADED]]), !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_OFFSET_OVERFLOWED:.*]] = extractvalue { i64, i1 } %[[COMPUTED_OFFSET_AGGREGATE]], 1, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_OFFSET:.*]] = extractvalue { i64, i1 } %[[COMPUTED_OFFSET_AGGREGATE]], 0, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP:.*]] = add i64 0, %[[COMPUTED_OFFSET]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP_IS_NOT_NULL:.*]] = icmp ne i64 %[[COMPUTED_GEP]], 0, !nosanitize
+ // CHECK-SANITIZE-C-NEXT: %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL:.*]] = and i1 false, %[[COMPUTED_GEP_IS_NOT_NULL]], !nosanitize
+ // CHECK-SANITIZE-CPP-NEXT: %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL:.*]] = icmp eq i1 false, %[[COMPUTED_GEP_IS_NOT_NULL]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_OFFSET_DID_NOT_OVERFLOW:.*]] = xor i1 %[[COMPUTED_OFFSET_OVERFLOWED]], true, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP_IS_UGE_BASE:.*]] = icmp uge i64 %[[COMPUTED_GEP]], 0, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[GEP_DID_NOT_OVERFLOW:.*]] = and i1 %[[COMPUTED_GEP_IS_UGE_BASE]], %[[COMPUTED_OFFSET_DID_NOT_OVERFLOW]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[GEP_IS_OKAY:.*]] = and i1 %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL]], %[[GEP_DID_NOT_OVERFLOW]], !nosanitize
+ // CHECK-SANITIZE-NEXT: br i1 %[[GEP_IS_OKAY]], label %[[CONT:.*]], label %[[HANDLER_POINTER_OVERFLOW:[^,]+]],{{.*}} !nosanitize
+ // CHECK-SANITIZE: [[HANDLER_POINTER_OVERFLOW]]:
+ // CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_pointer_overflow_abort(i8* bitcast ({ {{{.*}}} }* @[[LINE_500]] to i8*), i64 0, i64 %[[COMPUTED_GEP]])
+ // CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_pointer_overflow(i8* bitcast ({ {{{.*}}} }* @[[LINE_500]] to i8*), i64 0, i64 %[[COMPUTED_GEP]])
+ // CHECK-SANITIZE-TRAP-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
+ // CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
+ // CHECK-SANITIZE: [[CONT]]:
+ // CHECK-NEXT: ret i8* %[[ADD_PTR]]
+ static char *const base = (char *)0;
+#line 500
+ return base + offset;
+}
+
+char *nullptr_zero() {
+ // CHECK: define i8* @nullptr_zero()
+ // CHECK-NEXT: [[ENTRY:.*]]:
+ // CHECK-SANITIZE-C-NEXT: br i1 false, label %[[CONT:.*]], label %[[HANDLER_POINTER_OVERFLOW:[^,]+]],{{.*}} !nosanitize
+ // CHECK-SANITIZE-C: [[HANDLER_POINTER_OVERFLOW]]:
+ // CHECK-SANITIZE-NORECOVER-C-NEXT: call void @__ubsan_handle_pointer_overflow_abort(i8* bitcast ({ {{{.*}}} }* @[[LINE_600]] to i8*), i64 0, i64 0)
+ // CHECK-SANITIZE-RECOVER-C-NEXT: call void @__ubsan_handle_pointer_overflow(i8* bitcast ({ {{{.*}}} }* @[[LINE_600]] to i8*), i64 0, i64 0)
+ // CHECK-SANITIZE-TRAP-C-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
+ // CHECK-SANITIZE-UNREACHABLE-C-NEXT: unreachable, !nosanitize
+ // CHECK-SANITIZE-C: [[CONT]]:
+ // CHECK-NEXT: ret i8* null
+ static char *const base = (char *)0;
+ static const unsigned long offset = 0;
+#line 600
+ return base + offset;
+}
+
+char *nullptr_one_BAD() {
+ // CHECK: define i8* @nullptr_one_BAD()
+ // CHECK-NEXT: [[ENTRY:.*]]:
+ // CHECK-SANITIZE-C-NEXT: br i1 false, label %[[CONT:.*]], label %[[HANDLER_POINTER_OVERFLOW:[^,]+]],{{.*}} !nosanitize
+ // CHECK-SANITIZE-CPP-NEXT: br i1 icmp eq (i64 ptrtoint (i8* getelementptr inbounds (i8, i8* null, i64 1) to i64), i64 0), label %[[CONT:.*]], label %[[HANDLER_POINTER_OVERFLOW:[^,]+]],{{.*}} !nosanitize
+ // CHECK-SANITIZE: [[HANDLER_POINTER_OVERFLOW]]:
+ // CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_pointer_overflow_abort(i8* bitcast ({ {{{.*}}} }* @[[LINE_700]] to i8*), i64 0, i64 ptrtoint (i8* getelementptr inbounds (i8, i8* null, i64 1) to i64))
+ // CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_pointer_overflow(i8* bitcast ({ {{{.*}}} }* @[[LINE_700]] to i8*), i64 0, i64 ptrtoint (i8* getelementptr inbounds (i8, i8* null, i64 1) to i64))
+ // CHECK-SANITIZE-TRAP-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
+ // CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
+ // CHECK-SANITIZE: [[CONT]]:
+ // CHECK-NEXT: ret i8* getelementptr inbounds (i8, i8* null, i64 1)
+ static char *const base = (char *)0;
+ static const unsigned long offset = 1;
+#line 700
+ return base + offset;
+}
+
+char *nullptr_allones_BAD() {
+ // CHECK: define i8* @nullptr_allones_BAD()
+ // CHECK-NEXT: [[ENTRY:.*]]:
+ // CHECK-SANITIZE-C-NEXT: br i1 false, label %[[CONT:.*]], label %[[HANDLER_POINTER_OVERFLOW:[^,]+]],{{.*}} !nosanitize
+ // CHECK-SANITIZE-CPP-NEXT: br i1 icmp eq (i64 mul (i64 ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64), i64 -1), i64 0), label %[[CONT:.*]], label %[[HANDLER_POINTER_OVERFLOW:[^,]+]],{{.*}} !nosanitize
+ // CHECK-SANITIZE: [[HANDLER_POINTER_OVERFLOW]]:
+ // CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_pointer_overflow_abort(i8* bitcast ({ {{{.*}}} }* @[[LINE_800]] to i8*), i64 0, i64 mul (i64 ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64), i64 -1))
+ // CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_pointer_overflow(i8* bitcast ({ {{{.*}}} }* @[[LINE_800]] to i8*), i64 0, i64 mul (i64 ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64), i64 -1))
+ // CHECK-SANITIZE-TRAP-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
+ // CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
+ // CHECK-SANITIZE: [[CONT]]:
+ // CHECK-NEXT: ret i8* getelementptr inbounds (i8, i8* null, i64 -1)
+ static char *const base = (char *)0;
+ static const unsigned long offset = -1;
+#line 800
+ return base + offset;
+}
+
+//------------------------------------------------------------------------------
+
+char *one_var(unsigned long offset) {
+ // CHECK: define i8* @one_var(i64 %[[OFFSET:.*]])
+ // CHECK-NEXT: [[ENTRY:.*]]:
+ // CHECK-NEXT: %[[OFFSET_ADDR:.*]] = alloca i64, align 8
+ // CHECK-NEXT: store i64 %[[OFFSET]], i64* %[[OFFSET_ADDR]], align 8
+ // CHECK-NEXT: %[[OFFSET_RELOADED:.*]] = load i64, i64* %[[OFFSET_ADDR]], align 8
+ // CHECK-NEXT: %[[ADD_PTR:.*]] = getelementptr inbounds i8, i8* inttoptr (i64 1 to i8*), i64 %[[OFFSET_RELOADED]]
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_OFFSET_AGGREGATE:.*]] = call { i64, i1 } @llvm.smul.with.overflow.i64(i64 1, i64 %[[OFFSET_RELOADED]]), !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_OFFSET_OVERFLOWED:.*]] = extractvalue { i64, i1 } %[[COMPUTED_OFFSET_AGGREGATE]], 1, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_OFFSET:.*]] = extractvalue { i64, i1 } %[[COMPUTED_OFFSET_AGGREGATE]], 0, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP:.*]] = add i64 1, %[[COMPUTED_OFFSET]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP_IS_NOT_NULL:.*]] = icmp ne i64 %[[COMPUTED_GEP]], 0, !nosanitize
+ // CHECK-SANITIZE-C-NEXT: %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL:.*]] = and i1 icmp ne (i8* inttoptr (i64 1 to i8*), i8* null), %[[COMPUTED_GEP_IS_NOT_NULL]], !nosanitize
+ // CHECK-SANITIZE-CPP-NEXT: %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL:.*]] = icmp eq i1 icmp ne (i8* inttoptr (i64 1 to i8*), i8* null), %[[COMPUTED_GEP_IS_NOT_NULL]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_OFFSET_DID_NOT_OVERFLOW:.*]] = xor i1 %[[COMPUTED_OFFSET_OVERFLOWED]], true, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP_IS_UGE_BASE:.*]] = icmp uge i64 %[[COMPUTED_GEP]], 1, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[GEP_DID_NOT_OVERFLOW:.*]] = and i1 %[[COMPUTED_GEP_IS_UGE_BASE]], %[[COMPUTED_OFFSET_DID_NOT_OVERFLOW]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[GEP_IS_OKAY:.*]] = and i1 %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL]], %[[GEP_DID_NOT_OVERFLOW]], !nosanitize
+ // CHECK-SANITIZE-NEXT: br i1 %[[GEP_IS_OKAY]], label %[[CONT:.*]], label %[[HANDLER_POINTER_OVERFLOW:[^,]+]],{{.*}} !nosanitize
+ // CHECK-SANITIZE: [[HANDLER_POINTER_OVERFLOW]]:
+ // CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_pointer_overflow_abort(i8* bitcast ({ {{{.*}}} }* @[[LINE_900]] to i8*), i64 1, i64 %[[COMPUTED_GEP]])
+ // CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_pointer_overflow(i8* bitcast ({ {{{.*}}} }* @[[LINE_900]] to i8*), i64 1, i64 %[[COMPUTED_GEP]])
+ // CHECK-SANITIZE-TRAP-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
+ // CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
+ // CHECK-SANITIZE: [[CONT]]:
+ // CHECK-NEXT: ret i8* %[[ADD_PTR]]
+ static char *const base = (char *)1;
+#line 900
+ return base + offset;
+}
+
+char *one_zero() {
+ // CHECK: define i8* @one_zero()
+ // CHECK-NEXT: [[ENTRY:.*]]:
+ // CHECK-SANITIZE-C-NEXT: br i1 icmp ne (i8* inttoptr (i64 1 to i8*), i8* null), label %[[CONT:.*]], label %[[HANDLER_POINTER_OVERFLOW:[^,]+]],{{.*}} !nosanitize
+ // CHECK-SANITIZE-C: [[HANDLER_POINTER_OVERFLOW]]:
+ // CHECK-SANITIZE-NORECOVER-C-NEXT: call void @__ubsan_handle_pointer_overflow_abort(i8* bitcast ({ {{{.*}}} }* @[[LINE_1000]] to i8*), i64 1, i64 1)
+ // CHECK-SANITIZE-RECOVER-C-NEXT: call void @__ubsan_handle_pointer_overflow(i8* bitcast ({ {{{.*}}} }* @[[LINE_1000]] to i8*), i64 1, i64 1)
+ // CHECK-SANITIZE-TRAP-C-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
+ // CHECK-SANITIZE-UNREACHABLE-C-NEXT: unreachable, !nosanitize
+ // CHECK-SANITIZE-C: [[CONT]]:
+ // CHECK-NEXT: ret i8* inttoptr (i64 1 to i8*)
+ static char *const base = (char *)1;
+ static const unsigned long offset = 0;
+#line 1000
+ return base + offset;
+}
+
+char *one_one_OK() {
+ // CHECK: define i8* @one_one_OK()
+ // CHECK-NEXT: [[ENTRY:.*]]:
+ // CHECK-SANITIZE-C-NEXT: br i1 and (i1 icmp ne (i8* inttoptr (i64 1 to i8*), i8* null), i1 icmp ne (i64 add (i64 sub (i64 ptrtoint (i8* getelementptr inbounds (i8, i8* inttoptr (i64 1 to i8*), i64 1) to i64), i64 1), i64 1), i64 0)), label %[[CONT:.*]], label %[[HANDLER_POINTER_OVERFLOW:[^,]+]],{{.*}} !nosanitize
+ // CHECK-SANITIZE-CPP-NEXT: br i1 xor (i1 icmp eq (i8* inttoptr (i64 1 to i8*), i8* null), i1 icmp ne (i64 add (i64 sub (i64 ptrtoint (i8* getelementptr inbounds (i8, i8* inttoptr (i64 1 to i8*), i64 1) to i64), i64 1), i64 1), i64 0)), label %[[CONT:.*]], label %[[HANDLER_POINTER_OVERFLOW:[^,]+]],{{.*}} !nosanitize
+ // CHECK-SANITIZE: [[HANDLER_POINTER_OVERFLOW]]:
+ // CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_pointer_overflow_abort(i8* bitcast ({ {{{.*}}} }* @[[LINE_1100]] to i8*), i64 1, i64 add (i64 sub (i64 ptrtoint (i8* getelementptr inbounds (i8, i8* inttoptr (i64 1 to i8*), i64 1) to i64), i64 1), i64 1))
+ // CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_pointer_overflow(i8* bitcast ({ {{{.*}}} }* @[[LINE_1100]] to i8*), i64 1, i64 add (i64 sub (i64 ptrtoint (i8* getelementptr inbounds (i8, i8* inttoptr (i64 1 to i8*), i64 1) to i64), i64 1), i64 1))
+ // CHECK-SANITIZE-TRAP-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
+ // CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
+ // CHECK-SANITIZE: [[CONT]]:
+ // CHECK-NEXT: ret i8* getelementptr inbounds (i8, i8* inttoptr (i64 1 to i8*), i64 1)
+ static char *const base = (char *)1;
+ static const unsigned long offset = 1;
+#line 1100
+ return base + offset;
+}
+
+char *one_allones_BAD() {
+ // CHECK: define i8* @one_allones_BAD()
+ // CHECK-NEXT: [[ENTRY:.*]]:
+ // CHECK-SANITIZE-C-NEXT: br i1 and (i1 icmp ne (i8* inttoptr (i64 1 to i8*), i8* null), i1 icmp ne (i64 add (i64 sub (i64 ptrtoint (i8* getelementptr inbounds (i8, i8* inttoptr (i64 1 to i8*), i64 -1) to i64), i64 1), i64 1), i64 0)), label %[[CONT:.*]], label %[[HANDLER_POINTER_OVERFLOW:[^,]+]],{{.*}} !nosanitize
+ // CHECK-SANITIZE-CPP-NEXT: br i1 xor (i1 icmp eq (i8* inttoptr (i64 1 to i8*), i8* null), i1 icmp ne (i64 add (i64 sub (i64 ptrtoint (i8* getelementptr inbounds (i8, i8* inttoptr (i64 1 to i8*), i64 -1) to i64), i64 1), i64 1), i64 0)), label %[[CONT:.*]], label %[[HANDLER_POINTER_OVERFLOW:[^,]+]],{{.*}} !nosanitize
+ // CHECK-SANITIZE: [[HANDLER_POINTER_OVERFLOW]]:
+ // CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_pointer_overflow_abort(i8* bitcast ({ {{{.*}}} }* @[[LINE_1200]] to i8*), i64 1, i64 add (i64 sub (i64 ptrtoint (i8* getelementptr inbounds (i8, i8* inttoptr (i64 1 to i8*), i64 -1) to i64), i64 1), i64 1))
+ // CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_pointer_overflow(i8* bitcast ({ {{{.*}}} }* @[[LINE_1200]] to i8*), i64 1, i64 add (i64 sub (i64 ptrtoint (i8* getelementptr inbounds (i8, i8* inttoptr (i64 1 to i8*), i64 -1) to i64), i64 1), i64 1))
+ // CHECK-SANITIZE-TRAP-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
+ // CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
+ // CHECK-SANITIZE: [[CONT]]:
+ // CHECK-NEXT: ret i8* getelementptr inbounds (i8, i8* inttoptr (i64 1 to i8*), i64 -1)
+ static char *const base = (char *)1;
+ static const unsigned long offset = -1;
+#line 1200
+ return base + offset;
+}
+
+//------------------------------------------------------------------------------
+
+char *allones_var(unsigned long offset) {
+ // CHECK: define i8* @allones_var(i64 %[[OFFSET:.*]])
+ // CHECK-NEXT: [[ENTRY:.*]]:
+ // CHECK-NEXT: %[[OFFSET_ADDR:.*]] = alloca i64, align 8
+ // CHECK-NEXT: store i64 %[[OFFSET]], i64* %[[OFFSET_ADDR]], align 8
+ // CHECK-NEXT: %[[OFFSET_RELOADED:.*]] = load i64, i64* %[[OFFSET_ADDR]], align 8
+ // CHECK-NEXT: %[[ADD_PTR:.*]] = getelementptr inbounds i8, i8* inttoptr (i64 -1 to i8*), i64 %[[OFFSET_RELOADED]]
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_OFFSET_AGGREGATE:.*]] = call { i64, i1 } @llvm.smul.with.overflow.i64(i64 1, i64 %[[OFFSET_RELOADED]]), !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_OFFSET_OVERFLOWED:.*]] = extractvalue { i64, i1 } %[[COMPUTED_OFFSET_AGGREGATE]], 1, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_OFFSET:.*]] = extractvalue { i64, i1 } %[[COMPUTED_OFFSET_AGGREGATE]], 0, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP:.*]] = add i64 -1, %[[COMPUTED_OFFSET]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP_IS_NOT_NULL:.*]] = icmp ne i64 %[[COMPUTED_GEP]], 0, !nosanitize
+ // CHECK-SANITIZE-C-NEXT: %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL:.*]] = and i1 icmp ne (i8* inttoptr (i64 -1 to i8*), i8* null), %[[COMPUTED_GEP_IS_NOT_NULL]], !nosanitize
+ // CHECK-SANITIZE-CPP-NEXT: %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL:.*]] = icmp eq i1 icmp ne (i8* inttoptr (i64 -1 to i8*), i8* null), %[[COMPUTED_GEP_IS_NOT_NULL]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_OFFSET_DID_NOT_OVERFLOW:.*]] = xor i1 %[[COMPUTED_OFFSET_OVERFLOWED]], true, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP_IS_UGE_BASE:.*]] = icmp uge i64 %[[COMPUTED_GEP]], -1, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[GEP_DID_NOT_OVERFLOW:.*]] = and i1 %[[COMPUTED_GEP_IS_UGE_BASE]], %[[COMPUTED_OFFSET_DID_NOT_OVERFLOW]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[GEP_IS_OKAY:.*]] = and i1 %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL]], %[[GEP_DID_NOT_OVERFLOW]], !nosanitize
+ // CHECK-SANITIZE-NEXT: br i1 %[[GEP_IS_OKAY]], label %[[CONT:.*]], label %[[HANDLER_POINTER_OVERFLOW:[^,]+]],{{.*}} !nosanitize
+ // CHECK-SANITIZE: [[HANDLER_POINTER_OVERFLOW]]:
+ // CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_pointer_overflow_abort(i8* bitcast ({ {{{.*}}} }* @[[LINE_1300]] to i8*), i64 -1, i64 %[[COMPUTED_GEP]])
+ // CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_pointer_overflow(i8* bitcast ({ {{{.*}}} }* @[[LINE_1300]] to i8*), i64 -1, i64 %[[COMPUTED_GEP]])
+ // CHECK-SANITIZE-TRAP-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
+ // CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
+ // CHECK-SANITIZE: [[CONT]]:
+ // CHECK-NEXT: ret i8* %[[ADD_PTR]]
+ static char *const base = (char *)-1;
+#line 1300
+ return base + offset;
+}
+
+char *allones_zero_OK() {
+ // CHECK: define i8* @allones_zero_OK()
+ // CHECK-NEXT: [[ENTRY:.*]]:
+ // CHECK-SANITIZE-C-NEXT: br i1 icmp ne (i8* inttoptr (i64 -1 to i8*), i8* null), label %[[CONT:.*]], label %[[HANDLER_POINTER_OVERFLOW:[^,]+]],{{.*}} !nosanitize
+ // CHECK-SANITIZE-C: [[HANDLER_POINTER_OVERFLOW]]:
+ // CHECK-SANITIZE-NORECOVER-C-NEXT: call void @__ubsan_handle_pointer_overflow_abort(i8* bitcast ({ {{{.*}}} }* @[[LINE_1400]] to i8*), i64 -1, i64 -1)
+ // CHECK-SANITIZE-RECOVER-C-NEXT: call void @__ubsan_handle_pointer_overflow(i8* bitcast ({ {{{.*}}} }* @[[LINE_1400]] to i8*), i64 -1, i64 -1)
+ // CHECK-SANITIZE-TRAP-C-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
+ // CHECK-SANITIZE-UNREACHABLE-C-NEXT: unreachable, !nosanitize
+ // CHECK-SANITIZE-C: [[CONT]]:
+ // CHECK-NEXT: ret i8* inttoptr (i64 -1 to i8*)
+ static char *const base = (char *)-1;
+ static const unsigned long offset = 0;
+#line 1400
+ return base + offset;
+}
+
+char *allones_one_BAD() {
+ // CHECK: define i8* @allones_one_BAD()
+ // CHECK-NEXT: [[ENTRY:.*]]:
+ // CHECK-SANITIZE-C-NEXT: br i1 and (i1 icmp ne (i8* inttoptr (i64 -1 to i8*), i8* null), i1 icmp ne (i64 add (i64 sub (i64 ptrtoint (i8* getelementptr inbounds (i8, i8* inttoptr (i64 -1 to i8*), i64 1) to i64), i64 -1), i64 -1), i64 0)), label %[[CONT:.*]], label %[[HANDLER_POINTER_OVERFLOW:[^,]+]],{{.*}} !nosanitize
+ // CHECK-SANITIZE-CPP-NEXT: br i1 xor (i1 icmp eq (i8* inttoptr (i64 -1 to i8*), i8* null), i1 icmp ne (i64 add (i64 sub (i64 ptrtoint (i8* getelementptr inbounds (i8, i8* inttoptr (i64 -1 to i8*), i64 1) to i64), i64 -1), i64 -1), i64 0)), label %[[CONT:.*]], label %[[HANDLER_POINTER_OVERFLOW:[^,]+]],{{.*}} !nosanitize
+ // CHECK-SANITIZE: [[HANDLER_POINTER_OVERFLOW]]:
+ // CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_pointer_overflow_abort(i8* bitcast ({ {{{.*}}} }* @[[LINE_1500]] to i8*), i64 -1, i64 add (i64 sub (i64 ptrtoint (i8* getelementptr inbounds (i8, i8* inttoptr (i64 -1 to i8*), i64 1) to i64), i64 -1), i64 -1))
+ // CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_pointer_overflow(i8* bitcast ({ {{{.*}}} }* @[[LINE_1500]] to i8*), i64 -1, i64 add (i64 sub (i64 ptrtoint (i8* getelementptr inbounds (i8, i8* inttoptr (i64 -1 to i8*), i64 1) to i64), i64 -1), i64 -1))
+ // CHECK-SANITIZE-TRAP-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
+ // CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
+ // CHECK-SANITIZE: [[CONT]]:
+ // CHECK-NEXT: ret i8* getelementptr inbounds (i8, i8* inttoptr (i64 -1 to i8*), i64 1)
+ static char *const base = (char *)-1;
+ static const unsigned long offset = 1;
+#line 1500
+ return base + offset;
+}
+
+char *allones_allones_OK() {
+ // CHECK: define i8* @allones_allones_OK()
+ // CHECK-NEXT: [[ENTRY:.*]]:
+ // CHECK-SANITIZE-C-NEXT: br i1 and (i1 icmp ne (i8* inttoptr (i64 -1 to i8*), i8* null), i1 icmp ne (i64 add (i64 sub (i64 ptrtoint (i8* getelementptr inbounds (i8, i8* inttoptr (i64 -1 to i8*), i64 -1) to i64), i64 -1), i64 -1), i64 0)), label %[[CONT:.*]], label %[[HANDLER_POINTER_OVERFLOW:[^,]+]],{{.*}} !nosanitize
+ // CHECK-SANITIZE-CPP-NEXT: br i1 xor (i1 icmp eq (i8* inttoptr (i64 -1 to i8*), i8* null), i1 icmp ne (i64 add (i64 sub (i64 ptrtoint (i8* getelementptr inbounds (i8, i8* inttoptr (i64 -1 to i8*), i64 -1) to i64), i64 -1), i64 -1), i64 0)), label %[[CONT:.*]], label %[[HANDLER_POINTER_OVERFLOW:[^,]+]],{{.*}} !nosanitize
+ // CHECK-SANITIZE: [[HANDLER_POINTER_OVERFLOW]]:
+ // CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_pointer_overflow_abort(i8* bitcast ({ {{{.*}}} }* @[[LINE_1600]] to i8*), i64 -1, i64 add (i64 sub (i64 ptrtoint (i8* getelementptr inbounds (i8, i8* inttoptr (i64 -1 to i8*), i64 -1) to i64), i64 -1), i64 -1))
+ // CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_pointer_overflow(i8* bitcast ({ {{{.*}}} }* @[[LINE_1600]] to i8*), i64 -1, i64 add (i64 sub (i64 ptrtoint (i8* getelementptr inbounds (i8, i8* inttoptr (i64 -1 to i8*), i64 -1) to i64), i64 -1), i64 -1))
+ // CHECK-SANITIZE-TRAP-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
+ // CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
+ // CHECK-SANITIZE: [[CONT]]:
+ // CHECK-NEXT: ret i8* getelementptr inbounds (i8, i8* inttoptr (i64 -1 to i8*), i64 -1)
+ static char *const base = (char *)-1;
+ static const unsigned long offset = -1;
+#line 1600
+ return base + offset;
+}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/src/llvm-project/clang/test/CodeGen/catch-pointer-overflow-volatile.c b/src/llvm-project/clang/test/CodeGen/catch-pointer-overflow-volatile.c
new file mode 100644
index 0000000..138a3b6
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/catch-pointer-overflow-volatile.c
@@ -0,0 +1,54 @@
+// RUN: %clang_cc1 -x c -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s --check-prefixes=CHECK,CHECK-NOSANITIZE
+// RUN: %clang_cc1 -x c -fsanitize=pointer-overflow -fno-sanitize-recover=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_pointer_overflow" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-C,CHECK-SANITIZE-ANYRECOVER,CHECK-SANITIZE-NORECOVER,CHECK-SANITIZE-UNREACHABLE
+// RUN: %clang_cc1 -x c -fsanitize=pointer-overflow -fsanitize-recover=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_pointer_overflow" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-C,CHECK-SANITIZE-ANYRECOVER,CHECK-SANITIZE-RECOVER
+// RUN: %clang_cc1 -x c -fsanitize=pointer-overflow -fsanitize-trap=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_pointer_overflow" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-C,CHECK-SANITIZE-TRAP,CHECK-SANITIZE-UNREACHABLE
+
+// RUN: %clang_cc1 -x c++ -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s --check-prefixes=CHECK,CHECK-NOSANITIZE
+// RUN: %clang_cc1 -x c++ -fsanitize=pointer-overflow -fno-sanitize-recover=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_pointer_overflow" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-CPP,CHECK-SANITIZE-ANYRECOVER,CHECK-SANITIZE-NORECOVER,CHECK-SANITIZE-UNREACHABLE
+// RUN: %clang_cc1 -x c++ -fsanitize=pointer-overflow -fsanitize-recover=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_pointer_overflow" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-CPP,CHECK-SANITIZE-ANYRECOVER,CHECK-SANITIZE-RECOVER
+// RUN: %clang_cc1 -x c++ -fsanitize=pointer-overflow -fsanitize-trap=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_pointer_overflow" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-CPP,CHECK-SANITIZE-TRAP,CHECK-SANITIZE-UNREACHABLE
+
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_100:.*]] = {{.*}}, i32 100, i32 15 } }
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+char *volatile_ptr(char *volatile base, unsigned long offset) {
+ // CHECK: define i8* @volatile_ptr(i8* %[[BASE:.*]], i64 %[[OFFSET:.*]])
+ // CHECK-NEXT: [[ENTRY:.*]]:
+ // CHECK-NEXT: %[[BASE_ADDR:.*]] = alloca i8*, align 8
+ // CHECK-NEXT: %[[OFFSET_ADDR:.*]] = alloca i64, align 8
+ // CHECK-NEXT: store volatile i8* %[[BASE]], i8** %[[BASE_ADDR]], align 8
+ // CHECK-NEXT: store i64 %[[OFFSET]], i64* %[[OFFSET_ADDR]], align 8
+ // CHECK-NEXT: %[[BASE_RELOADED:.*]] = load volatile i8*, i8** %[[BASE_ADDR]], align 8
+ // CHECK-NEXT: %[[OFFSET_RELOADED:.*]] = load i64, i64* %[[OFFSET_ADDR]], align 8
+ // CHECK-NEXT: %[[ADD_PTR:.*]] = getelementptr inbounds i8, i8* %[[BASE_RELOADED]], i64 %[[OFFSET_RELOADED]]
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_OFFSET_AGGREGATE:.*]] = call { i64, i1 } @llvm.smul.with.overflow.i64(i64 1, i64 %[[OFFSET_RELOADED]]), !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_OFFSET_OVERFLOWED:.*]] = extractvalue { i64, i1 } %[[COMPUTED_OFFSET_AGGREGATE]], 1, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_OFFSET:.*]] = extractvalue { i64, i1 } %[[COMPUTED_OFFSET_AGGREGATE]], 0, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[BASE_RELOADED_INT:.*]] = ptrtoint i8* %[[BASE_RELOADED]] to i64, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP:.*]] = add i64 %[[BASE_RELOADED_INT]], %[[COMPUTED_OFFSET]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[BASE_IS_NOT_NULLPTR:.*]] = icmp ne i8* %[[BASE_RELOADED]], null, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP_IS_NOT_NULL:.*]] = icmp ne i64 %[[COMPUTED_GEP]], 0, !nosanitize
+ // CHECK-SANITIZE-C-NEXT: %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL:.*]] = and i1 %[[BASE_IS_NOT_NULLPTR]], %[[COMPUTED_GEP_IS_NOT_NULL]], !nosanitize
+ // CHECK-SANITIZE-CPP-NEXT: %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL:.*]] = icmp eq i1 %[[BASE_IS_NOT_NULLPTR]], %[[COMPUTED_GEP_IS_NOT_NULL]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_OFFSET_DID_NOT_OVERFLOW:.*]] = xor i1 %[[COMPUTED_OFFSET_OVERFLOWED]], true, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP_IS_UGE_BASE:.*]] = icmp uge i64 %[[COMPUTED_GEP]], %[[BASE_RELOADED_INT]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[GEP_DID_NOT_OVERFLOW:.*]] = and i1 %[[COMPUTED_GEP_IS_UGE_BASE]], %[[COMPUTED_OFFSET_DID_NOT_OVERFLOW]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[GEP_IS_OKAY:.*]] = and i1 %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL]], %[[GEP_DID_NOT_OVERFLOW]], !nosanitize
+ // CHECK-SANITIZE-NEXT: br i1 %[[GEP_IS_OKAY]], label %[[CONT:.*]], label %[[HANDLER_POINTER_OVERFLOW:[^,]+]],{{.*}} !nosanitize
+ // CHECK-SANITIZE: [[HANDLER_POINTER_OVERFLOW]]:
+ // CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_pointer_overflow_abort(i8* bitcast ({ {{{.*}}} }* @[[LINE_100]] to i8*), i64 %[[BASE_RELOADED_INT]], i64 %[[COMPUTED_GEP]])
+ // CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_pointer_overflow(i8* bitcast ({ {{{.*}}} }* @[[LINE_100]] to i8*), i64 %[[BASE_RELOADED_INT]], i64 %[[COMPUTED_GEP]])
+ // CHECK-SANITIZE-TRAP-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
+ // CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
+ // CHECK-SANITIZE: [[CONT]]:
+ // CHECK-NEXT: ret i8* %[[ADD_PTR]]
+#line 100
+ return base + offset;
+}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/src/llvm-project/clang/test/CodeGen/catch-pointer-overflow.c b/src/llvm-project/clang/test/CodeGen/catch-pointer-overflow.c
new file mode 100644
index 0000000..19115e91
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/catch-pointer-overflow.c
@@ -0,0 +1,294 @@
+// RUN: %clang_cc1 -x c -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s --check-prefixes=CHECK,CHECK-NOSANITIZE
+// RUN: %clang_cc1 -x c -fsanitize=pointer-overflow -fno-sanitize-recover=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_pointer_overflow" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-C,CHECK-SANITIZE-ANYRECOVER,CHECK-SANITIZE-NORECOVER,CHECK-SANITIZE-UNREACHABLE
+// RUN: %clang_cc1 -x c -fsanitize=pointer-overflow -fsanitize-recover=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_pointer_overflow" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-C,CHECK-SANITIZE-ANYRECOVER,CHECK-SANITIZE-RECOVER
+// RUN: %clang_cc1 -x c -fsanitize=pointer-overflow -fsanitize-trap=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_pointer_overflow" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-C,CHECK-SANITIZE-TRAP,CHECK-SANITIZE-UNREACHABLE
+
+// RUN: %clang_cc1 -x c++ -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s --check-prefixes=CHECK,CHECK-NOSANITIZE
+// RUN: %clang_cc1 -x c++ -fsanitize=pointer-overflow -fno-sanitize-recover=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_pointer_overflow" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-CPP,CHECK-SANITIZE-ANYRECOVER,CHECK-SANITIZE-NORECOVER,CHECK-SANITIZE-UNREACHABLE
+// RUN: %clang_cc1 -x c++ -fsanitize=pointer-overflow -fsanitize-recover=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_pointer_overflow" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-CPP,CHECK-SANITIZE-ANYRECOVER,CHECK-SANITIZE-RECOVER
+// RUN: %clang_cc1 -x c++ -fsanitize=pointer-overflow -fsanitize-trap=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_pointer_overflow" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-CPP,CHECK-SANITIZE-TRAP,CHECK-SANITIZE-UNREACHABLE
+
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_100:.*]] = {{.*}}, i32 100, i32 15 } }
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_200:.*]] = {{.*}}, i32 200, i32 15 } }
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_300:.*]] = {{.*}}, i32 300, i32 15 } }
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_400:.*]] = {{.*}}, i32 400, i32 15 } }
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_500:.*]] = {{.*}}, i32 500, i32 7 } }
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_600:.*]] = {{.*}}, i32 600, i32 7 } }
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_700:.*]] = {{.*}}, i32 700, i32 3 } }
+// CHECK-SANITIZE-ANYRECOVER-DAG: @[[LINE_800:.*]] = {{.*}}, i32 800, i32 3 } }
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+char *add_unsigned(char *base, unsigned long offset) {
+ // CHECK: define i8* @add_unsigned(i8* %[[BASE:.*]], i64 %[[OFFSET:.*]])
+ // CHECK-NEXT: [[ENTRY:.*]]:
+ // CHECK-NEXT: %[[BASE_ADDR:.*]] = alloca i8*, align 8
+ // CHECK-NEXT: %[[OFFSET_ADDR:.*]] = alloca i64, align 8
+ // CHECK-NEXT: store i8* %[[BASE]], i8** %[[BASE_ADDR]], align 8
+ // CHECK-NEXT: store i64 %[[OFFSET]], i64* %[[OFFSET_ADDR]], align 8
+ // CHECK-NEXT: %[[BASE_RELOADED:.*]] = load i8*, i8** %[[BASE_ADDR]], align 8
+ // CHECK-NEXT: %[[OFFSET_RELOADED:.*]] = load i64, i64* %[[OFFSET_ADDR]], align 8
+ // CHECK-NEXT: %[[ADD_PTR:.*]] = getelementptr inbounds i8, i8* %[[BASE_RELOADED]], i64 %[[OFFSET_RELOADED]]
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_OFFSET_AGGREGATE:.*]] = call { i64, i1 } @llvm.smul.with.overflow.i64(i64 1, i64 %[[OFFSET_RELOADED]]), !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_OFFSET_OVERFLOWED:.*]] = extractvalue { i64, i1 } %[[COMPUTED_OFFSET_AGGREGATE]], 1, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_OFFSET:.*]] = extractvalue { i64, i1 } %[[COMPUTED_OFFSET_AGGREGATE]], 0, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[BASE_RELOADED_INT:.*]] = ptrtoint i8* %[[BASE_RELOADED]] to i64, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP:.*]] = add i64 %[[BASE_RELOADED_INT]], %[[COMPUTED_OFFSET]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[BASE_IS_NOT_NULLPTR:.*]] = icmp ne i8* %[[BASE_RELOADED]], null, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP_IS_NOT_NULL:.*]] = icmp ne i64 %[[COMPUTED_GEP]], 0, !nosanitize
+ // CHECK-SANITIZE-C-NEXT: %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL:.*]] = and i1 %[[BASE_IS_NOT_NULLPTR]], %[[COMPUTED_GEP_IS_NOT_NULL]], !nosanitize
+ // CHECK-SANITIZE-CPP-NEXT: %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL:.*]] = icmp eq i1 %[[BASE_IS_NOT_NULLPTR]], %[[COMPUTED_GEP_IS_NOT_NULL]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_OFFSET_DID_NOT_OVERFLOW:.*]] = xor i1 %[[COMPUTED_OFFSET_OVERFLOWED]], true, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP_IS_UGE_BASE:.*]] = icmp uge i64 %[[COMPUTED_GEP]], %[[BASE_RELOADED_INT]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[GEP_DID_NOT_OVERFLOW:.*]] = and i1 %[[COMPUTED_GEP_IS_UGE_BASE]], %[[COMPUTED_OFFSET_DID_NOT_OVERFLOW]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[GEP_IS_OKAY:.*]] = and i1 %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL]], %[[GEP_DID_NOT_OVERFLOW]], !nosanitize
+ // CHECK-SANITIZE-NEXT: br i1 %[[GEP_IS_OKAY]], label %[[CONT:.*]], label %[[HANDLER_POINTER_OVERFLOW:[^,]+]],{{.*}} !nosanitize
+ // CHECK-SANITIZE: [[HANDLER_POINTER_OVERFLOW]]:
+ // CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_pointer_overflow_abort(i8* bitcast ({ {{{.*}}} }* @[[LINE_100]] to i8*), i64 %[[BASE_RELOADED_INT]], i64 %[[COMPUTED_GEP]])
+ // CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_pointer_overflow(i8* bitcast ({ {{{.*}}} }* @[[LINE_100]] to i8*), i64 %[[BASE_RELOADED_INT]], i64 %[[COMPUTED_GEP]])
+ // CHECK-SANITIZE-TRAP-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
+ // CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
+ // CHECK-SANITIZE: [[CONT]]:
+ // CHECK-NEXT: ret i8* %[[ADD_PTR]]
+#line 100
+ return base + offset;
+}
+
+char *sub_unsigned(char *base, unsigned long offset) {
+ // CHECK: define i8* @sub_unsigned(i8* %[[BASE:.*]], i64 %[[OFFSET:.*]])
+ // CHECK-NEXT: [[ENTRY:.*]]:
+ // CHECK-NEXT: %[[BASE_ADDR:.*]] = alloca i8*, align 8
+ // CHECK-NEXT: %[[OFFSET_ADDR:.*]] = alloca i64, align 8
+ // CHECK-NEXT: store i8* %[[BASE]], i8** %[[BASE_ADDR]], align 8
+ // CHECK-NEXT: store i64 %[[OFFSET]], i64* %[[OFFSET_ADDR]], align 8
+ // CHECK-NEXT: %[[BASE_RELOADED:.*]] = load i8*, i8** %[[BASE_ADDR]], align 8
+ // CHECK-NEXT: %[[OFFSET_RELOADED:.*]] = load i64, i64* %[[OFFSET_ADDR]], align 8
+ // CHECK-NEXT: %[[IDX_NEG:.*]] = sub i64 0, %[[OFFSET_RELOADED]]
+ // CHECK-NEXT: %[[ADD_PTR:.*]] = getelementptr inbounds i8, i8* %[[BASE_RELOADED]], i64 %[[IDX_NEG]]
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_OFFSET_AGGREGATE:.*]] = call { i64, i1 } @llvm.smul.with.overflow.i64(i64 1, i64 %[[IDX_NEG]]), !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_OFFSET_OVERFLOWED:.*]] = extractvalue { i64, i1 } %[[COMPUTED_OFFSET_AGGREGATE]], 1, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_OFFSET:.*]] = extractvalue { i64, i1 } %[[COMPUTED_OFFSET_AGGREGATE]], 0, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[BASE_RELOADED_INT:.*]] = ptrtoint i8* %[[BASE_RELOADED]] to i64, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP:.*]] = add i64 %[[BASE_RELOADED_INT]], %[[COMPUTED_OFFSET]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[BASE_IS_NOT_NULLPTR:.*]] = icmp ne i8* %[[BASE_RELOADED]], null, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP_IS_NOT_NULL:.*]] = icmp ne i64 %[[COMPUTED_GEP]], 0, !nosanitize
+ // CHECK-SANITIZE-C-NEXT: %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL:.*]] = and i1 %[[BASE_IS_NOT_NULLPTR]], %[[COMPUTED_GEP_IS_NOT_NULL]], !nosanitize
+ // CHECK-SANITIZE-CPP-NEXT: %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL:.*]] = icmp eq i1 %[[BASE_IS_NOT_NULLPTR]], %[[COMPUTED_GEP_IS_NOT_NULL]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_OFFSET_DID_NOT_OVERFLOW:.*]] = xor i1 %[[COMPUTED_OFFSET_OVERFLOWED]], true, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP_IS_ULE_BASE:.*]] = icmp ule i64 %[[COMPUTED_GEP]], %[[BASE_RELOADED_INT]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[GEP_DID_NOT_OVERFLOW:.*]] = and i1 %[[COMPUTED_GEP_IS_ULE_BASE]], %[[COMPUTED_OFFSET_DID_NOT_OVERFLOW]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[GEP_IS_OKAY:.*]] = and i1 %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL]], %[[GEP_DID_NOT_OVERFLOW]], !nosanitize
+ // CHECK-SANITIZE-NEXT: br i1 %[[GEP_IS_OKAY]], label %[[CONT:.*]], label %[[HANDLER_POINTER_OVERFLOW:[^,]+]],{{.*}} !nosanitize
+ // CHECK-SANITIZE: [[HANDLER_POINTER_OVERFLOW]]:
+ // CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_pointer_overflow_abort(i8* bitcast ({ {{{.*}}} }* @[[LINE_200]] to i8*), i64 %[[BASE_RELOADED_INT]], i64 %[[COMPUTED_GEP]])
+ // CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_pointer_overflow(i8* bitcast ({ {{{.*}}} }* @[[LINE_200]] to i8*), i64 %[[BASE_RELOADED_INT]], i64 %[[COMPUTED_GEP]])
+ // CHECK-SANITIZE-TRAP-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
+ // CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
+ // CHECK-SANITIZE: [[CONT]]:
+ // CHECK-NEXT: ret i8* %[[ADD_PTR]]
+#line 200
+ return base - offset;
+}
+
+char *add_signed(char *base, signed long offset) {
+ // CHECK: define i8* @add_signed(i8* %[[BASE:.*]], i64 %[[OFFSET:.*]])
+ // CHECK-NEXT: [[ENTRY:.*]]:
+ // CHECK-NEXT: %[[BASE_ADDR:.*]] = alloca i8*, align 8
+ // CHECK-NEXT: %[[OFFSET_ADDR:.*]] = alloca i64, align 8
+ // CHECK-NEXT: store i8* %[[BASE]], i8** %[[BASE_ADDR]], align 8
+ // CHECK-NEXT: store i64 %[[OFFSET]], i64* %[[OFFSET_ADDR]], align 8
+ // CHECK-NEXT: %[[BASE_RELOADED:.*]] = load i8*, i8** %[[BASE_ADDR]], align 8
+ // CHECK-NEXT: %[[OFFSET_RELOADED:.*]] = load i64, i64* %[[OFFSET_ADDR]], align 8
+ // CHECK-NEXT: %[[ADD_PTR:.*]] = getelementptr inbounds i8, i8* %[[BASE_RELOADED]], i64 %[[OFFSET_RELOADED]]
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_OFFSET_AGGREGATE:.*]] = call { i64, i1 } @llvm.smul.with.overflow.i64(i64 1, i64 %[[OFFSET_RELOADED]]), !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_OFFSET_OVERFLOWED:.*]] = extractvalue { i64, i1 } %[[COMPUTED_OFFSET_AGGREGATE]], 1, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_OFFSET:.*]] = extractvalue { i64, i1 } %[[COMPUTED_OFFSET_AGGREGATE]], 0, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[BASE_RELOADED_INT:.*]] = ptrtoint i8* %[[BASE_RELOADED]] to i64, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP:.*]] = add i64 %[[BASE_RELOADED_INT]], %[[COMPUTED_OFFSET]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[BASE_IS_NOT_NULLPTR:.*]] = icmp ne i8* %[[BASE_RELOADED]], null, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP_IS_NOT_NULL:.*]] = icmp ne i64 %[[COMPUTED_GEP]], 0, !nosanitize
+ // CHECK-SANITIZE-C-NEXT: %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL:.*]] = and i1 %[[BASE_IS_NOT_NULLPTR]], %[[COMPUTED_GEP_IS_NOT_NULL]], !nosanitize
+ // CHECK-SANITIZE-CPP-NEXT: %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL:.*]] = icmp eq i1 %[[BASE_IS_NOT_NULLPTR]], %[[COMPUTED_GEP_IS_NOT_NULL]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_OFFSET_DID_NOT_OVERFLOW:.*]] = xor i1 %[[COMPUTED_OFFSET_OVERFLOWED]], true, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[POSORZEROVALID:.*]] = icmp uge i64 %[[COMPUTED_GEP]], %[[BASE_RELOADED_INT]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[POSORZEROOFFSET:.*]] = icmp sge i64 %[[COMPUTED_OFFSET]], 0, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[NEGVALID:.*]] = icmp ult i64 %[[COMPUTED_GEP]], %[[BASE_RELOADED_INT]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[APPLYING_OFFSET_DID_NOT_OVERFLOW:.*]] = select i1 %[[POSORZEROOFFSET]], i1 %[[POSORZEROVALID]], i1 %[[NEGVALID]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[GEP_DID_NOT_OVERFLOW:.*]] = and i1 %[[APPLYING_OFFSET_DID_NOT_OVERFLOW]], %[[COMPUTED_OFFSET_DID_NOT_OVERFLOW]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[GEP_IS_OKAY:.*]] = and i1 %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL]], %[[GEP_DID_NOT_OVERFLOW]], !nosanitize
+ // CHECK-SANITIZE-NEXT: br i1 %[[GEP_IS_OKAY]], label %[[CONT:.*]], label %[[HANDLER_POINTER_OVERFLOW:[^,]+]],{{.*}} !nosanitize
+ // CHECK-SANITIZE: [[HANDLER_POINTER_OVERFLOW]]:
+ // CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_pointer_overflow_abort(i8* bitcast ({ {{{.*}}} }* @[[LINE_300]] to i8*), i64 %[[BASE_RELOADED_INT]], i64 %[[COMPUTED_GEP]])
+ // CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_pointer_overflow(i8* bitcast ({ {{{.*}}} }* @[[LINE_300]] to i8*), i64 %[[BASE_RELOADED_INT]], i64 %[[COMPUTED_GEP]])
+ // CHECK-SANITIZE-TRAP-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
+ // CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
+ // CHECK-SANITIZE: [[CONT]]:
+ // CHECK-NEXT: ret i8* %[[ADD_PTR]]
+#line 300
+ return base + offset;
+}
+
+char *sub_signed(char *base, signed long offset) {
+ // CHECK: define i8* @sub_signed(i8* %[[BASE:.*]], i64 %[[OFFSET:.*]])
+ // CHECK-NEXT: [[ENTRY:.*]]:
+ // CHECK-NEXT: %[[BASE_ADDR:.*]] = alloca i8*, align 8
+ // CHECK-NEXT: %[[OFFSET_ADDR:.*]] = alloca i64, align 8
+ // CHECK-NEXT: store i8* %[[BASE]], i8** %[[BASE_ADDR]], align 8
+ // CHECK-NEXT: store i64 %[[OFFSET]], i64* %[[OFFSET_ADDR]], align 8
+ // CHECK-NEXT: %[[BASE_RELOADED:.*]] = load i8*, i8** %[[BASE_ADDR]], align 8
+ // CHECK-NEXT: %[[OFFSET_RELOADED:.*]] = load i64, i64* %[[OFFSET_ADDR]], align 8
+ // CHECK-NEXT: %[[IDX_NEG:.*]] = sub i64 0, %[[OFFSET_RELOADED]]
+ // CHECK-NEXT: %[[ADD_PTR:.*]] = getelementptr inbounds i8, i8* %[[BASE_RELOADED]], i64 %[[IDX_NEG]]
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_OFFSET_AGGREGATE:.*]] = call { i64, i1 } @llvm.smul.with.overflow.i64(i64 1, i64 %[[IDX_NEG]]), !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_OFFSET_OVERFLOWED:.*]] = extractvalue { i64, i1 } %[[COMPUTED_OFFSET_AGGREGATE]], 1, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_OFFSET:.*]] = extractvalue { i64, i1 } %[[COMPUTED_OFFSET_AGGREGATE]], 0, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[BASE_RELOADED_INT:.*]] = ptrtoint i8* %[[BASE_RELOADED]] to i64, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP:.*]] = add i64 %[[BASE_RELOADED_INT]], %[[COMPUTED_OFFSET]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[BASE_IS_NOT_NULLPTR:.*]] = icmp ne i8* %[[BASE_RELOADED]], null, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP_IS_NOT_NULL:.*]] = icmp ne i64 %[[COMPUTED_GEP]], 0, !nosanitize
+ // CHECK-SANITIZE-C-NEXT: %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL:.*]] = and i1 %[[BASE_IS_NOT_NULLPTR]], %[[COMPUTED_GEP_IS_NOT_NULL]], !nosanitize
+ // CHECK-SANITIZE-CPP-NEXT: %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL:.*]] = icmp eq i1 %[[BASE_IS_NOT_NULLPTR]], %[[COMPUTED_GEP_IS_NOT_NULL]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_OFFSET_DID_NOT_OVERFLOW:.*]] = xor i1 %[[COMPUTED_OFFSET_OVERFLOWED]], true, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[POSORZEROVALID:.*]] = icmp uge i64 %[[COMPUTED_GEP]], %[[BASE_RELOADED_INT]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[POSORZEROOFFSET:.*]] = icmp sge i64 %[[COMPUTED_OFFSET]], 0, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[NEGVALID:.*]] = icmp ult i64 %[[COMPUTED_GEP]], %[[BASE_RELOADED_INT]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[APPLYING_OFFSET_DID_NOT_OVERFLOW:.*]] = select i1 %[[POSORZEROOFFSET]], i1 %[[POSORZEROVALID]], i1 %[[NEGVALID]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[GEP_DID_NOT_OVERFLOW:.*]] = and i1 %[[APPLYING_OFFSET_DID_NOT_OVERFLOW]], %[[COMPUTED_OFFSET_DID_NOT_OVERFLOW]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[GEP_IS_OKAY:.*]] = and i1 %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL]], %[[GEP_DID_NOT_OVERFLOW]], !nosanitize
+ // CHECK-SANITIZE-NEXT: br i1 %[[GEP_IS_OKAY]], label %[[CONT:.*]], label %[[HANDLER_POINTER_OVERFLOW:[^,]+]],{{.*}} !nosanitize
+ // CHECK-SANITIZE: [[HANDLER_POINTER_OVERFLOW]]:
+ // CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_pointer_overflow_abort(i8* bitcast ({ {{{.*}}} }* @[[LINE_400]] to i8*), i64 %[[BASE_RELOADED_INT]], i64 %[[COMPUTED_GEP]])
+ // CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_pointer_overflow(i8* bitcast ({ {{{.*}}} }* @[[LINE_400]] to i8*), i64 %[[BASE_RELOADED_INT]], i64 %[[COMPUTED_GEP]])
+ // CHECK-SANITIZE-TRAP-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
+ // CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
+ // CHECK-SANITIZE: [[CONT]]:
+ // CHECK-NEXT: ret i8* %[[ADD_PTR]]
+#line 400
+ return base - offset;
+}
+
+char *postinc(char *base) {
+ // CHECK: define i8* @postinc(i8* %[[BASE:.*]])
+ // CHECK-NEXT: [[ENTRY:.*]]:
+ // CHECK-NEXT: %[[BASE_ADDR:.*]] = alloca i8*, align 8
+ // CHECK-NEXT: store i8* %[[BASE]], i8** %[[BASE_ADDR]], align 8
+ // CHECK-NEXT: %[[BASE_RELOADED:.*]] = load i8*, i8** %[[BASE_ADDR]], align 8
+ // CHECK-NEXT: %[[ADD_PTR:.*]] = getelementptr inbounds i8, i8* %[[BASE_RELOADED]], i32 1
+ // CHECK-SANITIZE-NEXT: %[[BASE_RELOADED_INT:.*]] = ptrtoint i8* %[[BASE_RELOADED]] to i64, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP:.*]] = add i64 %[[BASE_RELOADED_INT]], 1, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[BASE_IS_NOT_NULLPTR:.*]] = icmp ne i8* %[[BASE_RELOADED]], null, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP_IS_NOT_NULL:.*]] = icmp ne i64 %[[COMPUTED_GEP]], 0, !nosanitize
+ // CHECK-SANITIZE-C-NEXT: %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL:.*]] = and i1 %[[BASE_IS_NOT_NULLPTR]], %[[COMPUTED_GEP_IS_NOT_NULL]], !nosanitize
+ // CHECK-SANITIZE-CPP-NEXT: %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL:.*]] = icmp eq i1 %[[BASE_IS_NOT_NULLPTR]], %[[COMPUTED_GEP_IS_NOT_NULL]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP_IS_UGE_BASE:.*]] = icmp uge i64 %[[COMPUTED_GEP]], %[[BASE_RELOADED_INT]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[GEP_IS_OKAY:.*]] = and i1 %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL]], %[[COMPUTED_GEP_IS_UGE_BASE]], !nosanitize
+ // CHECK-SANITIZE-NEXT: br i1 %[[GEP_IS_OKAY]], label %[[CONT:.*]], label %[[HANDLER_POINTER_OVERFLOW:[^,]+]],{{.*}} !nosanitize
+ // CHECK-SANITIZE: [[HANDLER_POINTER_OVERFLOW]]:
+ // CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_pointer_overflow_abort(i8* bitcast ({ {{{.*}}} }* @[[LINE_500]] to i8*), i64 %[[BASE_RELOADED_INT]], i64 %[[COMPUTED_GEP]])
+ // CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_pointer_overflow(i8* bitcast ({ {{{.*}}} }* @[[LINE_500]] to i8*), i64 %[[BASE_RELOADED_INT]], i64 %[[COMPUTED_GEP]])
+ // CHECK-SANITIZE-TRAP-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
+ // CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
+ // CHECK-SANITIZE: [[CONT]]:
+ // CHECK-NEXT: store i8* %[[ADD_PTR]], i8** %[[BASE_ADDR]], align 8
+ // CHECK-NEXT: %[[ADD_PTR_RELOADED:.*]] = load i8*, i8** %[[BASE_ADDR]], align 8
+ // CHECK-NEXT: ret i8* %[[ADD_PTR_RELOADED]]
+#line 500
+ base++;
+ return base;
+}
+
+char *postdec(char *base) {
+ // CHECK: define i8* @postdec(i8* %[[BASE:.*]])
+ // CHECK-NEXT: [[ENTRY:.*]]:
+ // CHECK-NEXT: %[[BASE_ADDR:.*]] = alloca i8*, align 8
+ // CHECK-NEXT: store i8* %[[BASE]], i8** %[[BASE_ADDR]], align 8
+ // CHECK-NEXT: %[[BASE_RELOADED:.*]] = load i8*, i8** %[[BASE_ADDR]], align 8
+ // CHECK-NEXT: %[[ADD_PTR:.*]] = getelementptr inbounds i8, i8* %[[BASE_RELOADED]], i32 -1
+ // CHECK-SANITIZE-NEXT: %[[BASE_RELOADED_INT:.*]] = ptrtoint i8* %[[BASE_RELOADED]] to i64, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP:.*]] = add i64 %[[BASE_RELOADED_INT]], -1, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[BASE_IS_NOT_NULLPTR:.*]] = icmp ne i8* %[[BASE_RELOADED]], null, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP_IS_NOT_NULL:.*]] = icmp ne i64 %[[COMPUTED_GEP]], 0, !nosanitize
+ // CHECK-SANITIZE-C-NEXT: %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL:.*]] = and i1 %[[BASE_IS_NOT_NULLPTR]], %[[COMPUTED_GEP_IS_NOT_NULL]], !nosanitize
+ // CHECK-SANITIZE-CPP-NEXT: %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL:.*]] = icmp eq i1 %[[BASE_IS_NOT_NULLPTR]], %[[COMPUTED_GEP_IS_NOT_NULL]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP_IS_ULE_BASE:.*]] = icmp ule i64 %[[COMPUTED_GEP]], %[[BASE_RELOADED_INT]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[GEP_IS_OKAY:.*]] = and i1 %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL]], %[[COMPUTED_GEP_IS_ULE_BASE]], !nosanitize
+ // CHECK-SANITIZE-NEXT: br i1 %[[GEP_IS_OKAY]], label %[[CONT:.*]], label %[[HANDLER_POINTER_OVERFLOW:[^,]+]],{{.*}} !nosanitize
+ // CHECK-SANITIZE: [[HANDLER_POINTER_OVERFLOW]]:
+ // CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_pointer_overflow_abort(i8* bitcast ({ {{{.*}}} }* @[[LINE_600]] to i8*), i64 %[[BASE_RELOADED_INT]], i64 %[[COMPUTED_GEP]])
+ // CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_pointer_overflow(i8* bitcast ({ {{{.*}}} }* @[[LINE_600]] to i8*), i64 %[[BASE_RELOADED_INT]], i64 %[[COMPUTED_GEP]])
+ // CHECK-SANITIZE-TRAP-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
+ // CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
+ // CHECK-SANITIZE: [[CONT]]:
+ // CHECK-NEXT: store i8* %[[ADD_PTR]], i8** %[[BASE_ADDR]], align 8
+ // CHECK-NEXT: %[[ADD_PTR_RELOADED:.*]] = load i8*, i8** %[[BASE_ADDR]], align 8
+ // CHECK-NEXT: ret i8* %[[ADD_PTR_RELOADED]]
+#line 600
+ base--;
+ return base;
+}
+
+char *preinc(char *base) {
+ // CHECK: define i8* @preinc(i8* %[[BASE:.*]])
+ // CHECK-NEXT: [[ENTRY:.*]]:
+ // CHECK-NEXT: %[[BASE_ADDR:.*]] = alloca i8*, align 8
+ // CHECK-NEXT: store i8* %[[BASE]], i8** %[[BASE_ADDR]], align 8
+ // CHECK-NEXT: %[[BASE_RELOADED:.*]] = load i8*, i8** %[[BASE_ADDR]], align 8
+ // CHECK-NEXT: %[[ADD_PTR:.*]] = getelementptr inbounds i8, i8* %[[BASE_RELOADED]], i32 1
+ // CHECK-SANITIZE-NEXT: %[[BASE_RELOADED_INT:.*]] = ptrtoint i8* %[[BASE_RELOADED]] to i64, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP:.*]] = add i64 %[[BASE_RELOADED_INT]], 1, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[BASE_IS_NOT_NULLPTR:.*]] = icmp ne i8* %[[BASE_RELOADED]], null, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP_IS_NOT_NULL:.*]] = icmp ne i64 %[[COMPUTED_GEP]], 0, !nosanitize
+ // CHECK-SANITIZE-C-NEXT: %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL:.*]] = and i1 %[[BASE_IS_NOT_NULLPTR]], %[[COMPUTED_GEP_IS_NOT_NULL]], !nosanitize
+ // CHECK-SANITIZE-CPP-NEXT: %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL:.*]] = icmp eq i1 %[[BASE_IS_NOT_NULLPTR]], %[[COMPUTED_GEP_IS_NOT_NULL]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP_IS_UGE_BASE:.*]] = icmp uge i64 %[[COMPUTED_GEP]], %[[BASE_RELOADED_INT]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[GEP_IS_OKAY:.*]] = and i1 %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL]], %[[COMPUTED_GEP_IS_UGE_BASE]], !nosanitize
+ // CHECK-SANITIZE-NEXT: br i1 %[[GEP_IS_OKAY]], label %[[CONT:.*]], label %[[HANDLER_POINTER_OVERFLOW:[^,]+]],{{.*}} !nosanitize
+ // CHECK-SANITIZE: [[HANDLER_POINTER_OVERFLOW]]:
+ // CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_pointer_overflow_abort(i8* bitcast ({ {{{.*}}} }* @[[LINE_700]] to i8*), i64 %[[BASE_RELOADED_INT]], i64 %[[COMPUTED_GEP]])
+ // CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_pointer_overflow(i8* bitcast ({ {{{.*}}} }* @[[LINE_700]] to i8*), i64 %[[BASE_RELOADED_INT]], i64 %[[COMPUTED_GEP]])
+ // CHECK-SANITIZE-TRAP-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
+ // CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
+ // CHECK-SANITIZE: [[CONT]]:
+ // CHECK-NEXT: store i8* %[[ADD_PTR]], i8** %[[BASE_ADDR]], align 8
+ // CHECK-NEXT: %[[ADD_PTR_RELOADED:.*]] = load i8*, i8** %[[BASE_ADDR]], align 8
+ // CHECK-NEXT: ret i8* %[[ADD_PTR_RELOADED]]
+#line 700
+ ++base;
+ return base;
+}
+
+char *predec(char *base) {
+ // CHECK: define i8* @predec(i8* %[[BASE:.*]])
+ // CHECK-NEXT: [[ENTRY:.*]]:
+ // CHECK-NEXT: %[[BASE_ADDR:.*]] = alloca i8*, align 8
+ // CHECK-NEXT: store i8* %[[BASE]], i8** %[[BASE_ADDR]], align 8
+ // CHECK-NEXT: %[[BASE_RELOADED:.*]] = load i8*, i8** %[[BASE_ADDR]], align 8
+ // CHECK-NEXT: %[[ADD_PTR:.*]] = getelementptr inbounds i8, i8* %[[BASE_RELOADED]], i32 -1
+ // CHECK-SANITIZE-NEXT: %[[BASE_RELOADED_INT:.*]] = ptrtoint i8* %[[BASE_RELOADED]] to i64, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP:.*]] = add i64 %[[BASE_RELOADED_INT]], -1, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[BASE_IS_NOT_NULLPTR:.*]] = icmp ne i8* %[[BASE_RELOADED]], null, !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP_IS_NOT_NULL:.*]] = icmp ne i64 %[[COMPUTED_GEP]], 0, !nosanitize
+ // CHECK-SANITIZE-C-NEXT: %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL:.*]] = and i1 %[[BASE_IS_NOT_NULLPTR]], %[[COMPUTED_GEP_IS_NOT_NULL]], !nosanitize
+ // CHECK-SANITIZE-CPP-NEXT: %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL:.*]] = icmp eq i1 %[[BASE_IS_NOT_NULLPTR]], %[[COMPUTED_GEP_IS_NOT_NULL]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[COMPUTED_GEP_IS_ULE_BASE:.*]] = icmp ule i64 %[[COMPUTED_GEP]], %[[BASE_RELOADED_INT]], !nosanitize
+ // CHECK-SANITIZE-NEXT: %[[GEP_IS_OKAY:.*]] = and i1 %[[BOTH_POINTERS_ARE_NULL_OR_BOTH_ARE_NONNULL]], %[[COMPUTED_GEP_IS_ULE_BASE]], !nosanitize
+ // CHECK-SANITIZE-NEXT: br i1 %[[GEP_IS_OKAY]], label %[[CONT:.*]], label %[[HANDLER_POINTER_OVERFLOW:[^,]+]],{{.*}} !nosanitize
+ // CHECK-SANITIZE: [[HANDLER_POINTER_OVERFLOW]]:
+ // CHECK-SANITIZE-NORECOVER-NEXT: call void @__ubsan_handle_pointer_overflow_abort(i8* bitcast ({ {{{.*}}} }* @[[LINE_800]] to i8*), i64 %[[BASE_RELOADED_INT]], i64 %[[COMPUTED_GEP]])
+ // CHECK-SANITIZE-RECOVER-NEXT: call void @__ubsan_handle_pointer_overflow(i8* bitcast ({ {{{.*}}} }* @[[LINE_800]] to i8*), i64 %[[BASE_RELOADED_INT]], i64 %[[COMPUTED_GEP]])
+ // CHECK-SANITIZE-TRAP-NEXT: call void @llvm.trap(){{.*}}, !nosanitize
+ // CHECK-SANITIZE-UNREACHABLE-NEXT: unreachable, !nosanitize
+ // CHECK-SANITIZE: [[CONT]]:
+ // CHECK-NEXT: store i8* %[[ADD_PTR]], i8** %[[BASE_ADDR]], align 8
+ // CHECK-NEXT: %[[ADD_PTR_RELOADED:.*]] = load i8*, i8** %[[BASE_ADDR]], align 8
+ // CHECK-NEXT: ret i8* %[[ADD_PTR_RELOADED]]
+#line 800
+ --base;
+ return base;
+}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/src/llvm-project/clang/test/CodeGen/cf-runtime-abi.c b/src/llvm-project/clang/test/CodeGen/cf-runtime-abi.c
index d408977..b6385c1 100644
--- a/src/llvm-project/clang/test/CodeGen/cf-runtime-abi.c
+++ b/src/llvm-project/clang/test/CodeGen/cf-runtime-abi.c
@@ -46,15 +46,21 @@
// CHECK-SWIFT-DARWIN-5_0-64: @_unnamed_cfstring_ = private global %struct.__NSConstantString_tag { i64 ptrtoint (i64* @"$s15SwiftFoundation19_NSCFConstantStringCN" to i64), i64 1, i64 1992, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i32 0, i32 0), i64 0 }
// CHECK-SWIFT-DARWIN-5_0-32: @_unnamed_cfstring_ = private global %struct.__NSConstantString_tag { i32 ptrtoint (i32* @"$s15SwiftFoundation19_NSCFConstantStringCN" to i32), i32 1, i64 1992, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i32 0, i32 0), i32 0 }
// CHECK-SWIFT-5_0-64: @_unnamed_cfstring_ = private global %struct.__NSConstantString_tag { i64 ptrtoint (i64* @"$s10Foundation19_NSCFConstantStringCN" to i64), i64 1, i64 1992, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i32 0, i32 0), i64 0 }
+// CHECK-SWIFT-5_0-64-SAME: align 8
// CHECK-SWIFT-5_0-32: @_unnamed_cfstring_ = private global %struct.__NSConstantString_tag { i32 ptrtoint (i32* @"$s10Foundation19_NSCFConstantStringCN" to i32), i32 1, i64 1992, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i32 0, i32 0), i32 0 }
+// CHECK-SWIFT-5_0-32-SAME: align 8
// CHECK-SWIFT-DARWIN-4_2-64: @_unnamed_cfstring_ = private global %struct.__NSConstantString_tag { i64 ptrtoint (i64* @"$S15SwiftFoundation19_NSCFConstantStringCN" to i64), i64 1, i64 1992, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i32 0, i32 0), i32 0 }
// CHECK-SWIFT-DARWIN-4_2-32: @_unnamed_cfstring_ = private global %struct.__NSConstantString_tag { i32 ptrtoint (i32* @"$S15SwiftFoundation19_NSCFConstantStringCN" to i32), i32 1, i64 1992, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i32 0, i32 0), i32 0 }
// CHECK-SWIFT-4_2-64: @_unnamed_cfstring_ = private global %struct.__NSConstantString_tag { i64 ptrtoint (i64* @"$S10Foundation19_NSCFConstantStringCN" to i64), i64 1, i64 1992, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i32 0, i32 0), i32 0 }
+// CHECK-SWIFT-4_2-64-SAME: align 8
// CHECK-SWIFT-4_2-32: @_unnamed_cfstring_ = private global %struct.__NSConstantString_tag { i32 ptrtoint (i32* @"$S10Foundation19_NSCFConstantStringCN" to i32), i32 1, i64 1992, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i32 0, i32 0), i32 0 }
+// CHECK-SWIFT-4_2-32-SAME: align 8
// CHECK-SWIFT-DARWIN-4_1-64: @_unnamed_cfstring_ = private global %struct.__NSConstantString_tag { i64 ptrtoint (i64* @__T015SwiftFoundation19_NSCFConstantStringCN to i64), i64 5, i64 1992, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i32 0, i32 0), i32 0 }
// CHECK-SWIFT-DARWIN-4_1-32: @_unnamed_cfstring_ = private global %struct.__NSConstantString_tag { i32 ptrtoint (i32* @__T015SwiftFoundation19_NSCFConstantStringCN to i32), i32 5, i64 1992, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i32 0, i32 0), i32 0 }
// CHECK-SWIFT-4_1-64: @_unnamed_cfstring_ = private global %struct.__NSConstantString_tag { i64 ptrtoint (i64* @__T010Foundation19_NSCFConstantStringCN to i64), i64 5, i64 1992, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i32 0, i32 0), i32 0 }
+// CHECK-SWIFT-4_1-64-SAME: align 8
// CHECK-SWIFT-4_1-32: @_unnamed_cfstring_ = private global %struct.__NSConstantString_tag { i32 ptrtoint (i32* @__T010Foundation19_NSCFConstantStringCN to i32), i32 5, i64 1992, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i32 0, i32 0), i32 0 }
+// CHECK-SWIFT-4_1-32-SAME: align 8
diff --git a/src/llvm-project/clang/test/CodeGen/cfguardtable.c b/src/llvm-project/clang/test/CodeGen/cfguardtable.c
index 9649292..05284f6 100644
--- a/src/llvm-project/clang/test/CodeGen/cfguardtable.c
+++ b/src/llvm-project/clang/test/CodeGen/cfguardtable.c
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -cfguard -emit-llvm %s -o - | FileCheck %s
-
-void f() {}
-
-// Check that the cfguardtable metadata flag gets set on the module.
-// CHECK: !"cfguardtable", i32 1}
+// RUN: %clang_cc1 -cfguard-no-checks -emit-llvm %s -o - | FileCheck %s -check-prefix=CFGUARDNOCHECKS
+// RUN: %clang_cc1 -cfguard -emit-llvm %s -o - | FileCheck %s -check-prefix=CFGUARD
+
+void f() {}
+
+// Check that the cfguard metadata flag gets correctly set on the module.
+// CFGUARDNOCHECKS: !"cfguard", i32 1}
+// CFGUARD: !"cfguard", i32 2}
diff --git a/src/llvm-project/clang/test/CodeGen/cfi-check-fail-attrs.c b/src/llvm-project/clang/test/CodeGen/cfi-check-fail-attrs.c
new file mode 100644
index 0000000..77ba29a
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/cfi-check-fail-attrs.c
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 -triple aarch64-unknown-linux -fsanitize-cfi-cross-dso -target-feature +reserve-x18 -emit-llvm -o - %s | FileCheck %s
+
+// CHECK: define weak_odr hidden void @__cfi_check_fail{{.*}} [[ATTR:#[0-9]*]]
+
+// CHECK: attributes [[ATTR]] = {{.*}} "target-features"="+reserve-x18"
diff --git a/src/llvm-project/clang/test/CodeGen/cfi-check-fail.c b/src/llvm-project/clang/test/CodeGen/cfi-check-fail.c
index 0eb786a..b61e203 100644
--- a/src/llvm-project/clang/test/CodeGen/cfi-check-fail.c
+++ b/src/llvm-project/clang/test/CodeGen/cfi-check-fail.c
@@ -7,7 +7,7 @@
f();
}
-// CHECK: define weak_odr hidden void @__cfi_check_fail(i8*, i8*)
+// CHECK: define weak_odr hidden void @__cfi_check_fail(i8* %0, i8* %1)
// CHECK: store i8* %0, i8** %[[ALLOCA0:.*]], align 8
// CHECK: store i8* %1, i8** %[[ALLOCA1:.*]], align 8
// CHECK: %[[DATA:.*]] = load i8*, i8** %[[ALLOCA0]], align 8
@@ -73,7 +73,7 @@
// CHECK: [[CONT5]]:
// CHECK: ret void
-// CHECK: define weak void @__cfi_check(i64, i8*, i8*)
+// CHECK: define weak void @__cfi_check(i64 %0, i8* %1, i8* %2)
// CHECK-NOT: }
// CHECK: call void @llvm.trap()
// CHECK-NEXT: ret void
diff --git a/src/llvm-project/clang/test/CodeGen/cfi-check-fail2.c b/src/llvm-project/clang/test/CodeGen/cfi-check-fail2.c
index 9c4d0ac..884d66d 100644
--- a/src/llvm-project/clang/test/CodeGen/cfi-check-fail2.c
+++ b/src/llvm-project/clang/test/CodeGen/cfi-check-fail2.c
@@ -13,7 +13,7 @@
f();
}
-// CHECK: define weak_odr hidden void @__cfi_check_fail(i8*, i8*)
+// CHECK: define weak_odr hidden void @__cfi_check_fail(i8* %0, i8* %1)
// CHECK: store i8* %0, i8** %[[ALLOCA0:.*]], align 8
// CHECK: store i8* %1, i8** %[[ALLOCA1:.*]], align 8
// CHECK: %[[DATA:.*]] = load i8*, i8** %[[ALLOCA0]], align 8
diff --git a/src/llvm-project/clang/test/CodeGen/cfi-icall-canonical-jump-tables.c b/src/llvm-project/clang/test/CodeGen/cfi-icall-canonical-jump-tables.c
new file mode 100644
index 0000000..cf7ca42
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/cfi-icall-canonical-jump-tables.c
@@ -0,0 +1,24 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-linux -fsanitize=cfi-icall -fsanitize-cfi-cross-dso -emit-llvm -o - %s | FileCheck --check-prefixes=CHECK,NOCANON %s
+// RUN: %clang_cc1 -triple x86_64-unknown-linux -fsanitize=cfi-icall -fsanitize-cfi-cross-dso -fsanitize-cfi-canonical-jump-tables -emit-llvm -o - %s | FileCheck --check-prefixes=CHECK,CANON %s
+
+void ext(void);
+
+// CHECK: define void @f({{.*}} [[ATTR1:#[0-9]+]]
+void f() {
+ ext();
+}
+
+// NOCANON: declare !type {{.*}} @ext()
+// CANON: declare void @ext()
+
+// CHECK: define void @g({{.*}} [[ATTR2:#[0-9]+]]
+__attribute__((cfi_canonical_jump_table)) void g() {}
+
+// CHECK: [[ATTR1]] = {
+// CHECK-NOT: "cfi-canonical-jump-table"
+// CHECK: }
+
+// CHECK: [[ATTR2]] = { {{.*}} "cfi-canonical-jump-table" {{.*}} }
+
+// NOCANON: !{i32 4, !"CFI Canonical Jump Tables", i32 0}
+// CANON: !{i32 4, !"CFI Canonical Jump Tables", i32 1}
diff --git a/src/llvm-project/clang/test/CodeGen/cfi-icall-cross-dso.c b/src/llvm-project/clang/test/CodeGen/cfi-icall-cross-dso.c
index 67901c4..fbfe213c 100644
--- a/src/llvm-project/clang/test/CodeGen/cfi-icall-cross-dso.c
+++ b/src/llvm-project/clang/test/CodeGen/cfi-icall-cross-dso.c
@@ -1,27 +1,27 @@
// RUN: %clang_cc1 -triple x86_64-unknown-linux -O1 -fno-experimental-new-pass-manager \
// RUN: -fsanitize=cfi-icall -fsanitize-cfi-cross-dso \
-// RUN: -emit-llvm -o - %s | FileCheck \
+// RUN: -fsanitize-cfi-canonical-jump-tables -emit-llvm -o - %s | FileCheck \
// RUN: --check-prefix=CHECK --check-prefix=CHECK-DIAG \
// RUN: --check-prefix=ITANIUM --check-prefix=ITANIUM-DIAG \
// RUN: %s
// RUN: %clang_cc1 -triple x86_64-unknown-linux -O1 -fno-experimental-new-pass-manager \
// RUN: -fsanitize=cfi-icall -fsanitize-cfi-cross-dso -fsanitize-trap=cfi-icall \
-// RUN: -emit-llvm -o - %s | FileCheck \
+// RUN: -fsanitize-cfi-canonical-jump-tables -emit-llvm -o - %s | FileCheck \
// RUN: --check-prefix=CHECK \
// RUN: --check-prefix=ITANIUM --check-prefix=ITANIUM-TRAP \
// RUN: %s
// RUN: %clang_cc1 -triple x86_64-pc-windows-msvc -O1 -fno-experimental-new-pass-manager \
// RUN: -fsanitize=cfi-icall -fsanitize-cfi-cross-dso \
-// RUN: -emit-llvm -o - %s | FileCheck \
+// RUN: -fsanitize-cfi-canonical-jump-tables -emit-llvm -o - %s | FileCheck \
// RUN: --check-prefix=CHECK --check-prefix=CHECK-DIAG \
// RUN: --check-prefix=MS --check-prefix=MS-DIAG \
// RUN: %s
// RUN: %clang_cc1 -triple x86_64-pc-windows-msvc -O1 -fno-experimental-new-pass-manager \
// RUN: -fsanitize=cfi-icall -fsanitize-cfi-cross-dso -fsanitize-trap=cfi-icall \
-// RUN: -emit-llvm -o - %s | FileCheck \
+// RUN: -fsanitize-cfi-canonical-jump-tables -emit-llvm -o - %s | FileCheck \
// RUN: --check-prefix=CHECK \
// RUN: --check-prefix=MS --check-prefix=MS-TRAP \
// RUN: %s
diff --git a/src/llvm-project/clang/test/CodeGen/complex-builtins-2.c b/src/llvm-project/clang/test/CodeGen/complex-builtins-2.c
new file mode 100644
index 0000000..d112637
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/complex-builtins-2.c
@@ -0,0 +1,20 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -w -S -o - -emit-llvm %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -w -S -o - -emit-llvm -fmath-errno %s | FileCheck %s
+
+float _Complex test__builtin_conjf(float _Complex x) {
+// CHECK-LABEL: @test__builtin_conjf(
+// CHECK: fneg float %x.imag
+ return __builtin_conjf(x);
+}
+
+double _Complex test__builtin_conj(double _Complex x) {
+// CHECK-LABEL: @test__builtin_conj(
+// CHECK: fneg double %x.imag
+ return __builtin_conj(x);
+}
+
+long double _Complex test__builtin_conjl(long double _Complex x) {
+// CHECK-LABEL: @test__builtin_conjl(
+// CHECK: fneg x86_fp80 %x.imag
+ return __builtin_conjl(x);
+}
diff --git a/src/llvm-project/clang/test/CodeGen/complex-libcalls-2.c b/src/llvm-project/clang/test/CodeGen/complex-libcalls-2.c
new file mode 100644
index 0000000..1938cf4
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/complex-libcalls-2.c
@@ -0,0 +1,20 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -w -S -o - -emit-llvm %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -w -S -o - -emit-llvm -fmath-errno %s | FileCheck %s
+
+float _Complex test_conjf(float _Complex x) {
+// CHECK-LABEL: @test_conjf(
+// CHECK: fneg float %x.imag
+ return conjf(x);
+}
+
+double _Complex test_conj(double _Complex x) {
+// CHECK-LABEL: @test_conj(
+// CHECK: fneg double %x.imag
+ return conj(x);
+}
+
+long double _Complex test_conjl(long double _Complex x) {
+// CHECK-LABEL: @test_conjl(
+// CHECK: fneg x86_fp80 %x.imag
+ return conjl(x);
+}
diff --git a/src/llvm-project/clang/test/CodeGen/complex-libcalls.c b/src/llvm-project/clang/test/CodeGen/complex-libcalls.c
index 5690119..2480417 100644
--- a/src/llvm-project/clang/test/CodeGen/complex-libcalls.c
+++ b/src/llvm-project/clang/test/CodeGen/complex-libcalls.c
@@ -112,12 +112,10 @@
conj(f); conjf(f); conjl(f);
-// NO__ERRNO: declare { double, double } @conj(double, double) [[READNONE:#[0-9]+]]
-// NO__ERRNO: declare <2 x float> @conjf(<2 x float>) [[READNONE]]
-// NO__ERRNO: declare { x86_fp80, x86_fp80 } @conjl({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16) [[NOT_READNONE]]
-// HAS_ERRNO: declare { double, double } @conj(double, double) [[READNONE:#[0-9]+]]
-// HAS_ERRNO: declare <2 x float> @conjf(<2 x float>) [[READNONE]]
-// HAS_ERRNO: declare { x86_fp80, x86_fp80 } @conjl({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16) [[NOT_READNONE]]
+// NO__ERRNO-NOT: .conj
+// NO__ERRNO-NOT: @conj
+// HAS_ERRNO-NOT: .conj
+// HAS_ERRNO-NOT: @conj
clog(f); clogf(f); clogl(f);
@@ -133,7 +131,7 @@
// NO__ERRNO: declare { double, double } @cproj(double, double) [[READNONE]]
// NO__ERRNO: declare <2 x float> @cprojf(<2 x float>) [[READNONE]]
// NO__ERRNO: declare { x86_fp80, x86_fp80 } @cprojl({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16) [[NOT_READNONE]]
-// HAS_ERRNO: declare { double, double } @cproj(double, double) [[READNONE]]
+// HAS_ERRNO: declare { double, double } @cproj(double, double) [[READNONE:#[0-9]+]]
// HAS_ERRNO: declare <2 x float> @cprojf(<2 x float>) [[READNONE]]
// HAS_ERRNO: declare { x86_fp80, x86_fp80 } @cprojl({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16) [[NOT_READNONE]]
diff --git a/src/llvm-project/clang/test/CodeGen/complex-math.c b/src/llvm-project/clang/test/CodeGen/complex-math.c
index a5805b6..e42418a 100644
--- a/src/llvm-project/clang/test/CodeGen/complex-math.c
+++ b/src/llvm-project/clang/test/CodeGen/complex-math.c
@@ -1,3 +1,5 @@
+// FIXME: This file should not be using -O1; that makes it depend on the entire LLVM IR optimizer.
+
// RUN: %clang_cc1 %s -O1 -fno-experimental-new-pass-manager -emit-llvm -triple x86_64-unknown-unknown -o - | FileCheck %s --check-prefix=X86
// RUN: %clang_cc1 %s -O1 -fno-experimental-new-pass-manager -emit-llvm -triple x86_64-pc-win64 -o - | FileCheck %s --check-prefix=X86
// RUN: %clang_cc1 %s -O1 -fno-experimental-new-pass-manager -emit-llvm -triple i686-unknown-unknown -o - | FileCheck %s --check-prefix=X86
@@ -54,7 +56,7 @@
float _Complex sub_float_rc(float a, float _Complex b) {
// X86-LABEL: @sub_float_rc(
// X86: fsub
- // X86: fsub float -0.{{0+}}e+00,
+ // X86: fneg
// X86-NOT: fsub
// X86: ret
return a - b;
@@ -146,11 +148,11 @@
// AARCH64-FASTMATH: [[CCpDD:%.*]] = fadd fast float [[CC]], [[DD]]
//
// BC = 0
- // AARCH64-FASTMATH: [[AD:%.*]] = fmul fast float [[D]], %a
- // AARCH64-FASTMATH: [[BCmAD:%.*]] = fsub fast float -0.000000e+00, [[AD]]
+ // AARCH64-FASTMATH: [[NEGA:%.*]] = fsub fast float -0.000000e+00, %a
+ // AARCH64-FASTMATH: [[AD:%.*]] = fmul fast float [[D]], [[NEGA]]
//
// AARCH64-FASTMATH: fdiv fast float [[AC]], [[CCpDD]]
- // AARCH64-FASTMATH: fdiv fast float [[BCmAD]], [[CCpDD]]
+ // AARCH64-FASTMATH: fdiv fast float [[AD]], [[CCpDD]]
// AARCH64-FASTMATH: ret
return a / b;
}
@@ -232,7 +234,7 @@
double _Complex sub_double_rc(double a, double _Complex b) {
// X86-LABEL: @sub_double_rc(
// X86: fsub
- // X86: fsub double -0.{{0+}}e+00,
+ // X86: fneg
// X86-NOT: fsub
// X86: ret
return a - b;
@@ -324,11 +326,11 @@
// AARCH64-FASTMATH: [[CCpDD:%.*]] = fadd fast double [[CC]], [[DD]]
//
// BC = 0
- // AARCH64-FASTMATH: [[AD:%.*]] = fmul fast double [[D]], %a
- // AARCH64-FASTMATH: [[BCmAD:%.*]] = fsub fast double -0.000000e+00, [[AD]]
+ // AARCH64-FASTMATH: [[NEGA:%.*]] = fsub fast double -0.000000e+00, %a
+ // AARCH64-FASTMATH: [[AD:%.*]] = fmul fast double [[D]], [[NEGA]]
//
// AARCH64-FASTMATH: fdiv fast double [[AC]], [[CCpDD]]
- // AARCH64-FASTMATH: fdiv fast double [[BCmAD]], [[CCpDD]]
+ // AARCH64-FASTMATH: fdiv fast double [[AD]], [[CCpDD]]
// AARCH64-FASTMATH: ret
return a / b;
}
@@ -410,7 +412,7 @@
long double _Complex sub_long_double_rc(long double a, long double _Complex b) {
// X86-LABEL: @sub_long_double_rc(
// X86: fsub
- // X86: fsub x86_fp80 0xK8{{0+}},
+ // X86: fneg
// X86-NOT: fsub
// X86: ret
return a - b;
@@ -520,11 +522,11 @@
// AARCH64-FASTMATH: [[CCpDD:%.*]] = fadd fast fp128 [[CC]], [[DD]]
//
// BC = 0
- // AARCH64-FASTMATH: [[AD:%.*]] = fmul fast fp128 [[D]], %a
- // AARCH64-FASTMATH: [[BCmAD:%.*]] = fsub fast fp128 0xL00000000000000008000000000000000, [[AD]]
+ // AARCH64-FASTMATH: [[NEGA:%.*]] = fsub fast fp128 0xL00000000000000008000000000000000, %a
+ // AARCH64-FASTMATH: [[AD:%.*]] = fmul fast fp128 [[D]], [[NEGA]]
//
// AARCH64-FASTMATH: fdiv fast fp128 [[AC]], [[CCpDD]]
- // AARCH64-FASTMATH: fdiv fast fp128 [[BCmAD]], [[CCpDD]]
+ // AARCH64-FASTMATH: fdiv fast fp128 [[AD]], [[CCpDD]]
// AARCH64-FASTMATH: ret
return a / b;
}
diff --git a/src/llvm-project/clang/test/CodeGen/const-init.c b/src/llvm-project/clang/test/CodeGen/const-init.c
index 41ac8f2..374aa00 100644
--- a/src/llvm-project/clang/test/CodeGen/const-init.c
+++ b/src/llvm-project/clang/test/CodeGen/const-init.c
@@ -141,8 +141,8 @@
// CHECK: @g28.b = internal global <12 x i16> <i16 0, i16 0, i16 0, i16 -32768, i16 16383, i16 0, i16 0, i16 0, i16 0, i16 -32768, i16 16384, i16 0>
// CHECK: @g28.c = internal global <2 x x86_fp80> <x86_fp80 0xK3FFF8000000000000000, x86_fp80 0xK40008000000000000000>, align 32
static v1i64 a = (v1i64)10LL;
- static v12i16 b = (v2f80){1,2};
- static v2f80 c = (v12i16){0,0,0,-32768,16383,0,0,0,0,-32768,16384,0};
+ static v12i16 b = (v12i16)(v2f80){1,2};
+ static v2f80 c = (v2f80)(v12i16){0,0,0,-32768,16383,0,0,0,0,-32768,16384,0};
}
// PR13643
diff --git a/src/llvm-project/clang/test/CodeGen/constant-comparison.c b/src/llvm-project/clang/test/CodeGen/constant-comparison.c
index 371cb17..e2b3f1a 100644
--- a/src/llvm-project/clang/test/CodeGen/constant-comparison.c
+++ b/src/llvm-project/clang/test/CodeGen/constant-comparison.c
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -emit-llvm %s -o - 2>&1 | not grep warning
-// RUN: %clang_cc1 -emit-llvm %s -o - | grep @b | count 1
+// RUN: %clang_cc1 -fno-ident -emit-llvm %s -o - | grep @b | count 1
int a, b;
int *c1 = 1 < 2 ? &a : &b;
diff --git a/src/llvm-project/clang/test/CodeGen/constrained-math-builtins.c b/src/llvm-project/clang/test/CodeGen/constrained-math-builtins.c
new file mode 100644
index 0000000..72c2918
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/constrained-math-builtins.c
@@ -0,0 +1,150 @@
+// RUN: %clang_cc1 -triple x86_64-linux -ffp-exception-behavior=strict -w -S -o - -emit-llvm %s | FileCheck %s
+
+// Test codegen of constrained math builtins.
+
+void foo(double *d, float f, float *fp, long double *l, int *i, const char *c) {
+ f = __builtin_fmod(f,f); f = __builtin_fmodf(f,f); f = __builtin_fmodl(f,f);
+
+// CHECK: declare double @llvm.experimental.constrained.frem.f64(double, double, metadata, metadata)
+// CHECK: declare float @llvm.experimental.constrained.frem.f32(float, float, metadata, metadata)
+// CHECK: declare x86_fp80 @llvm.experimental.constrained.frem.f80(x86_fp80, x86_fp80, metadata, metadata)
+
+ __builtin_pow(f,f); __builtin_powf(f,f); __builtin_powl(f,f);
+
+// CHECK: declare double @llvm.experimental.constrained.pow.f64(double, double, metadata, metadata)
+// CHECK: declare float @llvm.experimental.constrained.pow.f32(float, float, metadata, metadata)
+// CHECK: declare x86_fp80 @llvm.experimental.constrained.pow.f80(x86_fp80, x86_fp80, metadata, metadata)
+
+ __builtin_powi(f,f); __builtin_powif(f,f); __builtin_powil(f,f);
+
+// CHECK: declare double @llvm.experimental.constrained.powi.f64(double, i32, metadata, metadata)
+// CHECK: declare float @llvm.experimental.constrained.powi.f32(float, i32, metadata, metadata)
+// CHECK: declare x86_fp80 @llvm.experimental.constrained.powi.f80(x86_fp80, i32, metadata, metadata)
+
+ __builtin_ceil(f); __builtin_ceilf(f); __builtin_ceill(f);
+
+// CHECK: declare double @llvm.experimental.constrained.ceil.f64(double, metadata)
+// CHECK: declare float @llvm.experimental.constrained.ceil.f32(float, metadata)
+// CHECK: declare x86_fp80 @llvm.experimental.constrained.ceil.f80(x86_fp80, metadata)
+
+ __builtin_cos(f); __builtin_cosf(f); __builtin_cosl(f);
+
+// CHECK: declare double @llvm.experimental.constrained.cos.f64(double, metadata, metadata)
+// CHECK: declare float @llvm.experimental.constrained.cos.f32(float, metadata, metadata)
+// CHECK: declare x86_fp80 @llvm.experimental.constrained.cos.f80(x86_fp80, metadata, metadata)
+
+ __builtin_exp(f); __builtin_expf(f); __builtin_expl(f);
+
+// CHECK: declare double @llvm.experimental.constrained.exp.f64(double, metadata, metadata)
+// CHECK: declare float @llvm.experimental.constrained.exp.f32(float, metadata, metadata)
+// CHECK: declare x86_fp80 @llvm.experimental.constrained.exp.f80(x86_fp80, metadata, metadata)
+
+ __builtin_exp2(f); __builtin_exp2f(f); __builtin_exp2l(f);
+
+// CHECK: declare double @llvm.experimental.constrained.exp2.f64(double, metadata, metadata)
+// CHECK: declare float @llvm.experimental.constrained.exp2.f32(float, metadata, metadata)
+// CHECK: declare x86_fp80 @llvm.experimental.constrained.exp2.f80(x86_fp80, metadata, metadata)
+
+ __builtin_floor(f); __builtin_floorf(f); __builtin_floorl(f);
+
+// CHECK: declare double @llvm.experimental.constrained.floor.f64(double, metadata)
+// CHECK: declare float @llvm.experimental.constrained.floor.f32(float, metadata)
+// CHECK: declare x86_fp80 @llvm.experimental.constrained.floor.f80(x86_fp80, metadata)
+
+ __builtin_fma(f,f,f); __builtin_fmaf(f,f,f); __builtin_fmal(f,f,f);
+
+// CHECK: declare double @llvm.experimental.constrained.fma.f64(double, double, double, metadata, metadata)
+// CHECK: declare float @llvm.experimental.constrained.fma.f32(float, float, float, metadata, metadata)
+// CHECK: declare x86_fp80 @llvm.experimental.constrained.fma.f80(x86_fp80, x86_fp80, x86_fp80, metadata, metadata)
+
+ __builtin_fmax(f,f); __builtin_fmaxf(f,f); __builtin_fmaxl(f,f);
+
+// CHECK: declare double @llvm.experimental.constrained.maxnum.f64(double, double, metadata)
+// CHECK: declare float @llvm.experimental.constrained.maxnum.f32(float, float, metadata)
+// CHECK: declare x86_fp80 @llvm.experimental.constrained.maxnum.f80(x86_fp80, x86_fp80, metadata)
+
+ __builtin_fmin(f,f); __builtin_fminf(f,f); __builtin_fminl(f,f);
+
+// CHECK: declare double @llvm.experimental.constrained.minnum.f64(double, double, metadata)
+// CHECK: declare float @llvm.experimental.constrained.minnum.f32(float, float, metadata)
+// CHECK: declare x86_fp80 @llvm.experimental.constrained.minnum.f80(x86_fp80, x86_fp80, metadata)
+
+ __builtin_llrint(f); __builtin_llrintf(f); __builtin_llrintl(f);
+
+// CHECK: declare i64 @llvm.experimental.constrained.llrint.i64.f64(double, metadata, metadata)
+// CHECK: declare i64 @llvm.experimental.constrained.llrint.i64.f32(float, metadata, metadata)
+// CHECK: declare i64 @llvm.experimental.constrained.llrint.i64.f80(x86_fp80, metadata, metadata)
+
+ __builtin_llround(f); __builtin_llroundf(f); __builtin_llroundl(f);
+
+// CHECK: declare i64 @llvm.experimental.constrained.llround.i64.f64(double, metadata)
+// CHECK: declare i64 @llvm.experimental.constrained.llround.i64.f32(float, metadata)
+// CHECK: declare i64 @llvm.experimental.constrained.llround.i64.f80(x86_fp80, metadata)
+
+ __builtin_log(f); __builtin_logf(f); __builtin_logl(f);
+
+// CHECK: declare double @llvm.experimental.constrained.log.f64(double, metadata, metadata)
+// CHECK: declare float @llvm.experimental.constrained.log.f32(float, metadata, metadata)
+// CHECK: declare x86_fp80 @llvm.experimental.constrained.log.f80(x86_fp80, metadata, metadata)
+
+ __builtin_log10(f); __builtin_log10f(f); __builtin_log10l(f);
+
+// CHECK: declare double @llvm.experimental.constrained.log10.f64(double, metadata, metadata)
+// CHECK: declare float @llvm.experimental.constrained.log10.f32(float, metadata, metadata)
+// CHECK: declare x86_fp80 @llvm.experimental.constrained.log10.f80(x86_fp80, metadata, metadata)
+
+ __builtin_log2(f); __builtin_log2f(f); __builtin_log2l(f);
+
+// CHECK: declare double @llvm.experimental.constrained.log2.f64(double, metadata, metadata)
+// CHECK: declare float @llvm.experimental.constrained.log2.f32(float, metadata, metadata)
+// CHECK: declare x86_fp80 @llvm.experimental.constrained.log2.f80(x86_fp80, metadata, metadata)
+
+ __builtin_lrint(f); __builtin_lrintf(f); __builtin_lrintl(f);
+
+// CHECK: declare i64 @llvm.experimental.constrained.lrint.i64.f64(double, metadata, metadata)
+// CHECK: declare i64 @llvm.experimental.constrained.lrint.i64.f32(float, metadata, metadata)
+// CHECK: declare i64 @llvm.experimental.constrained.lrint.i64.f80(x86_fp80, metadata, metadata)
+
+ __builtin_lround(f); __builtin_lroundf(f); __builtin_lroundl(f);
+
+// CHECK: declare i64 @llvm.experimental.constrained.lround.i64.f64(double, metadata)
+// CHECK: declare i64 @llvm.experimental.constrained.lround.i64.f32(float, metadata)
+// CHECK: declare i64 @llvm.experimental.constrained.lround.i64.f80(x86_fp80, metadata)
+
+ __builtin_nearbyint(f); __builtin_nearbyintf(f); __builtin_nearbyintl(f);
+
+// CHECK: declare double @llvm.experimental.constrained.nearbyint.f64(double, metadata, metadata)
+// CHECK: declare float @llvm.experimental.constrained.nearbyint.f32(float, metadata, metadata)
+// CHECK: declare x86_fp80 @llvm.experimental.constrained.nearbyint.f80(x86_fp80, metadata, metadata)
+
+ __builtin_rint(f); __builtin_rintf(f); __builtin_rintl(f);
+
+// CHECK: declare double @llvm.experimental.constrained.rint.f64(double, metadata, metadata)
+// CHECK: declare float @llvm.experimental.constrained.rint.f32(float, metadata, metadata)
+// CHECK: declare x86_fp80 @llvm.experimental.constrained.rint.f80(x86_fp80, metadata, metadata)
+
+ __builtin_round(f); __builtin_roundf(f); __builtin_roundl(f);
+
+// CHECK: declare double @llvm.experimental.constrained.round.f64(double, metadata)
+// CHECK: declare float @llvm.experimental.constrained.round.f32(float, metadata)
+// CHECK: declare x86_fp80 @llvm.experimental.constrained.round.f80(x86_fp80, metadata)
+
+ __builtin_sin(f); __builtin_sinf(f); __builtin_sinl(f);
+
+// CHECK: declare double @llvm.experimental.constrained.sin.f64(double, metadata, metadata)
+// CHECK: declare float @llvm.experimental.constrained.sin.f32(float, metadata, metadata)
+// CHECK: declare x86_fp80 @llvm.experimental.constrained.sin.f80(x86_fp80, metadata, metadata)
+
+ __builtin_sqrt(f); __builtin_sqrtf(f); __builtin_sqrtl(f);
+
+// CHECK: declare double @llvm.experimental.constrained.sqrt.f64(double, metadata, metadata)
+// CHECK: declare float @llvm.experimental.constrained.sqrt.f32(float, metadata, metadata)
+// CHECK: declare x86_fp80 @llvm.experimental.constrained.sqrt.f80(x86_fp80, metadata, metadata)
+
+ __builtin_trunc(f); __builtin_truncf(f); __builtin_truncl(f);
+
+// CHECK: declare double @llvm.experimental.constrained.trunc.f64(double, metadata)
+// CHECK: declare float @llvm.experimental.constrained.trunc.f32(float, metadata)
+// CHECK: declare x86_fp80 @llvm.experimental.constrained.trunc.f80(x86_fp80, metadata)
+};
+
diff --git a/src/llvm-project/clang/test/CodeGen/convergent-functions.cpp b/src/llvm-project/clang/test/CodeGen/convergent-functions.cpp
new file mode 100644
index 0000000..7ddb8d3
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/convergent-functions.cpp
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -triple i386-pc-win32 -emit-llvm -fconvergent-functions -o - < %s | FileCheck -check-prefix=CONVFUNC %s
+// RUN: %clang_cc1 -triple i386-pc-win32 -emit-llvm -o - < %s | FileCheck -check-prefix=NOCONVFUNC %s
+
+// Test that the -fconvergent-functions flag works
+
+// CONVFUNC: attributes #0 = { convergent {{.*}} }
+// NOCONVFUNC-NOT: convergent
+void func() { }
diff --git a/src/llvm-project/clang/test/CodeGen/debug-info-compilation-dir.c b/src/llvm-project/clang/test/CodeGen/debug-info-compilation-dir.c
index 786d235..b49a0f5 100644
--- a/src/llvm-project/clang/test/CodeGen/debug-info-compilation-dir.c
+++ b/src/llvm-project/clang/test/CodeGen/debug-info-compilation-dir.c
@@ -1,6 +1,7 @@
// RUN: mkdir -p %t.dir && cd %t.dir
// RUN: cp %s rel.c
// RUN: %clang_cc1 -fdebug-compilation-dir /nonsense -emit-llvm -debug-info-kind=limited rel.c -o - | FileCheck -check-prefix=CHECK-NONSENSE %s
+// RUN: %clang_cc1 -fdebug-compilation-dir=/nonsense -emit-llvm -debug-info-kind=limited rel.c -o - | FileCheck -check-prefix=CHECK-NONSENSE %s
// CHECK-NONSENSE: nonsense
// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited %s -o - | FileCheck -check-prefix=CHECK-DIR %s
diff --git a/src/llvm-project/clang/test/CodeGen/debug-info-extern-basic.c b/src/llvm-project/clang/test/CodeGen/debug-info-extern-basic.c
new file mode 100644
index 0000000..e2c9084
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/debug-info-extern-basic.c
@@ -0,0 +1,26 @@
+// RUN: %clang_cc1 -x c -debug-info-kind=limited -triple bpf-linux-gnu -emit-llvm %s -o - | FileCheck %s
+
+extern char ch;
+int test() {
+ return ch;
+}
+
+int test2() {
+ extern char ch2;
+ return ch2;
+}
+
+extern int (*foo)(int);
+int test3() {
+ return foo(0);
+}
+
+// CHECK: distinct !DIGlobalVariable(name: "ch",{{.*}} type: ![[CHART:[0-9]+]], isLocal: false, isDefinition: false
+// CHECK: distinct !DIGlobalVariable(name: "ch2",{{.*}} type: ![[CHART]], isLocal: false, isDefinition: false
+// CHECK: ![[CHART]] = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
+
+// CHECK: distinct !DIGlobalVariable(name: "foo",{{.*}} type: ![[FUNC:[0-9]+]], isLocal: false, isDefinition: false)
+// CHECK: ![[FUNC]] = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: ![[SUB:[0-9]+]], size: 64)
+// CHECK: ![[SUB]] = !DISubroutineType(types: ![[TYPES:[0-9]+]])
+// CHECK: ![[TYPES]] = !{![[BASET:[0-9]+]], ![[BASET]]}
+// CHECK: ![[BASET]] = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
diff --git a/src/llvm-project/clang/test/CodeGen/debug-info-extern-call.c b/src/llvm-project/clang/test/CodeGen/debug-info-extern-call.c
index e35669b..da3764f 100644
--- a/src/llvm-project/clang/test/CodeGen/debug-info-extern-call.c
+++ b/src/llvm-project/clang/test/CodeGen/debug-info-extern-call.c
@@ -1,15 +1,39 @@
-// RUN: %clang -Xclang -femit-debug-entry-values -g -O2 -target x86_64-none-linux-gnu -S -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK-EXT
-// CHECK-EXT: !DISubprogram(name: "fn1"
+// When entry values are emitted, expect a subprogram for extern decls so that
+// the dwarf generator can describe call site parameters at extern call sites.
+//
+// RUN: %clang -Xclang -femit-debug-entry-values -g -O2 -target x86_64-none-linux-gnu -S -emit-llvm %s -o - \
+// RUN: | FileCheck %s -check-prefix=DECLS-FOR-EXTERN
-// RUN: %clang -g -O2 -target x86_64-none-linux-gnu -S -emit-llvm %s -o - | FileCheck %s
-// CHECK-NOT: !DISubprogram(name: "fn1"
+// Similarly, when the debugger tuning is gdb, expect a subprogram for extern
+// decls so that the dwarf generator can describe information needed for tail
+// call frame reconstrution.
+//
+// RUN: %clang -g -O2 -target x86_64-none-linux-gnu -ggdb -S -emit-llvm %s -o - \
+// RUN: | FileCheck %s -check-prefix=DECLS-FOR-EXTERN
+//
+// Do not emit a subprogram for extern decls when entry values are disabled and
+// the tuning is not set to gdb.
+//
+// RUN: %clang -g -O2 -target x86_64-none-linux-gnu -gsce -S -emit-llvm %s -o - \
+// RUN: | FileCheck %s -check-prefix=NO-DECLS-FOR-EXTERN
+
+// DECLS-FOR-EXTERN: !DISubprogram(name: "fn1"
+// DECLS-FOR-EXTERN-NOT: !DISubprogram(name: "memcmp"
+// DECLS-FOR-EXTERN-NOT: !DISubprogram(name: "__some_reserved_name"
+
+// NO-DECLS-FOR-EXTERN-NOT: !DISubprogram(name: "fn1"
+// NO-DECLS-FOR-EXTERN-NOT: !DISubprogram(name: "memcmp"
+// NO-DECLS-FOR-EXTERN-NOT: !DISubprogram(name: "__some_reserved_name"
extern int fn1(int a, int b);
+extern int memcmp(const void *s1, const void *s2, unsigned long n);
+extern void __some_reserved_name(void);
-int fn2 () {
+int fn2 (int *src, int *dst) {
int x = 4, y = 5;
int res = fn1(x, y);
-
- return res;
+ int res2 = memcmp(dst, src, res);
+ __some_reserved_name();
+ return res + res2;
}
diff --git a/src/llvm-project/clang/test/CodeGen/debug-info-extern-duplicate.c b/src/llvm-project/clang/test/CodeGen/debug-info-extern-duplicate.c
new file mode 100644
index 0000000..1c6d86f
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/debug-info-extern-duplicate.c
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -x c -debug-info-kind=limited -triple bpf-linux-gnu -emit-llvm %s -o - | FileCheck %s
+
+extern char ch;
+extern char ch;
+int test() {
+ return ch;
+}
+
+// CHECK: distinct !DIGlobalVariable(name: "ch",{{.*}} type: ![[T:[0-9]+]], isLocal: false, isDefinition: false
+// CHECK-NOT: distinct !DIGlobalVariable(name: "ch"
diff --git a/src/llvm-project/clang/test/CodeGen/debug-info-extern-multi.c b/src/llvm-project/clang/test/CodeGen/debug-info-extern-multi.c
new file mode 100644
index 0000000..6a9021d
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/debug-info-extern-multi.c
@@ -0,0 +1,22 @@
+// RUN: %clang_cc1 -x c -debug-info-kind=limited -triple bpf-linux-gnu -emit-llvm %s -o - | FileCheck %s
+
+extern char ch;
+int test() {
+ extern short sh;
+ return ch + sh;
+}
+
+extern char (*foo)(char);
+int test2() {
+ return foo(0) + ch;
+}
+
+// CHECK: distinct !DIGlobalVariable(name: "ch",{{.*}} type: ![[Tch:[0-9]+]], isLocal: false, isDefinition: false
+// CHECK: distinct !DIGlobalVariable(name: "sh",{{.*}} type: ![[Tsh:[0-9]+]], isLocal: false, isDefinition: false
+// CHECK: ![[Tsh]] = !DIBasicType(name: "short", size: 16, encoding: DW_ATE_signed)
+
+// CHECK: distinct !DIGlobalVariable(name: "foo",{{.*}} type: ![[Tptr:[0-9]+]], isLocal: false, isDefinition: false
+// ![[Tptr]] = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: ![[Tsub:[0-9]+]], size: 64)
+// ![[Tsub]] = !DISubroutineType(types: ![[Tproto:[0-9]+]])
+// ![[Tproto]] = !{![[Tch]], ![[Tch]]}
+// CHECK: ![[Tch]] = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
diff --git a/src/llvm-project/clang/test/CodeGen/debug-info-extern-unused.c b/src/llvm-project/clang/test/CodeGen/debug-info-extern-unused.c
new file mode 100644
index 0000000..8b89eaa
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/debug-info-extern-unused.c
@@ -0,0 +1,26 @@
+// RUN: %clang_cc1 -x c -debug-info-kind=limited -triple bpf-linux-gnu -emit-llvm %s -o - | FileCheck %s
+
+extern char ch;
+int test() {
+ return 0;
+}
+
+int test2() {
+ extern char ch2;
+ return 0;
+}
+
+extern int (*foo)(int);
+int test3() {
+ return 0;
+}
+
+int test4() {
+ extern int (*foo2)(int);
+ return 0;
+}
+
+// CHECK-NOT: distinct !DIGlobalVariable(name: "ch"
+// CHECK-NOT: distinct !DIGlobalVariable(name: "ch2"
+// CHECK-NOT: distinct !DIGlobalVariable(name: "foo"
+// CHECK-NOT: distinct !DIGlobalVariable(name: "foo2"
diff --git a/src/llvm-project/clang/test/CodeGen/debug-info-no-inline-line-tables.c b/src/llvm-project/clang/test/CodeGen/debug-info-no-inline-line-tables.c
new file mode 100644
index 0000000..ac92162
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/debug-info-no-inline-line-tables.c
@@ -0,0 +1,31 @@
+// RUN: %clang_cc1 -triple x86_64-windows-msvc -debug-info-kind=limited \
+// RUN: -gno-inline-line-tables -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang -gno-inline-line-tables -S -emit-llvm -o - %s | FileCheck %s \
+// RUN: -check-prefix=INLINE-FLAG
+// RUN: %clang -S -emit-llvm -o - %s | FileCheck %s -check-prefix=NO-FLAG
+
+int x;
+__attribute((always_inline)) void f() {
+ x += 1;
+}
+int main() {
+ f();
+ x += 2;
+ return x;
+}
+
+// Check that clang emits the location of the call site and not the inlined
+// function in the debug info.
+// CHECK: define dso_local i32 @main()
+// CHECK: %{{.+}} = load i32, i32* @x, align 4, !dbg [[DbgLoc:![0-9]+]]
+
+// Check that the no-inline-line-tables attribute is added.
+// CHECK: attributes #0 = {{.*}}"no-inline-line-tables"{{.*}}
+// CHECK: attributes #1 = {{.*}}"no-inline-line-tables"{{.*}}
+
+// CHECK: [[DbgLoc]] = !DILocation(line: 12,
+// CHECK-NOT: inlinedAt:
+
+// INLINE-FLAG: attributes #0 = {{.*}}"no-inline-line-tables"{{.*}}
+// INLINE-FLAG: attributes #1 = {{.*}}"no-inline-line-tables"{{.*}}
+// NO-FLAG-NOT: "no-inline-line-tables"
diff --git a/src/llvm-project/clang/test/CodeGen/debug-info-param-modification.c b/src/llvm-project/clang/test/CodeGen/debug-info-param-modification.c
deleted file mode 100644
index f2aa4c7..0000000
--- a/src/llvm-project/clang/test/CodeGen/debug-info-param-modification.c
+++ /dev/null
@@ -1,21 +0,0 @@
-// RUN: %clang -Xclang -femit-debug-entry-values -g -O2 -Xclang -disable-llvm-passes -S -target x86_64-none-linux-gnu -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK-ENTRY-VAL-OPT
-// CHECK-ENTRY-VAL-OPT: !DILocalVariable(name: "a", arg: 1, scope: {{.*}}, file: {{.*}}, line: {{.*}}, type: {{.*}})
-// CHECK-ENTRY-VAL-OPT: !DILocalVariable(name: "b", arg: 2, scope: {{.*}}, file: {{.*}}, line: {{.*}}, type: {{.*}}, flags: DIFlagArgumentNotModified)
-//
-// For the os_log_helper:
-// CHECK-ENTRY-VAL-OPT: !DILocalVariable(name: "buffer", arg: 1, {{.*}}, flags: DIFlagArtificial)
-//
-// RUN: %clang -g -O2 -Xclang -disable-llvm-passes -target x86_64-none-linux-gnu -S -emit-llvm %s -o - | FileCheck %s
-// CHECK-NOT: !DILocalVariable(name: "b", arg: 2, scope: {{.*}}, file: {{.*}}, line: {{.*}}, type: {{.*}}, flags: DIFlagArgumentNotModified)
-//
-// For the os_log_helper:
-// CHECK: !DILocalVariable(name: "buffer", arg: 1, {{.*}}, flags: DIFlagArtificial)
-
-int fn2 (int a, int b) {
- ++a;
- return b;
-}
-
-void test_builtin_os_log(void *buf, int i, const char *data) {
- __builtin_os_log_format(buf, "%d %{public}s %{private}.16P", i, data, data);
-}
diff --git a/src/llvm-project/clang/test/CodeGen/debug-prefix-map.c b/src/llvm-project/clang/test/CodeGen/debug-prefix-map.c
index f755ba4..5366e19 100644
--- a/src/llvm-project/clang/test/CodeGen/debug-prefix-map.c
+++ b/src/llvm-project/clang/test/CodeGen/debug-prefix-map.c
@@ -2,6 +2,8 @@
// RUN: %clang_cc1 -debug-info-kind=standalone -fdebug-prefix-map=%p=/UNLIKELY_PATH=empty %s -emit-llvm -o - | FileCheck %s -check-prefix CHECK-EVIL
// RUN: %clang_cc1 -debug-info-kind=standalone -fdebug-prefix-map=%p=/UNLIKELY_PATH/empty %s -emit-llvm -o - -main-file-name debug-prefix-map.c | FileCheck %s
// RUN: %clang_cc1 -debug-info-kind=standalone -fdebug-prefix-map=%p=/UNLIKELY_PATH/empty %s -emit-llvm -o - -fdebug-compilation-dir %p | FileCheck %s -check-prefix CHECK-COMPILATION-DIR
+// RUN: %clang -g -fdebug-prefix-map=%p=/UNLIKELY_PATH/empty -S -c %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang -g -ffile-prefix-map=%p=/UNLIKELY_PATH/empty -S -c %s -emit-llvm -o - | FileCheck %s
#include "Inputs/stdio.h"
@@ -16,22 +18,22 @@
vprintf("string", argp);
}
-// CHECK-NO-MAIN-FILE-NAME: !DIFile(filename: "/UNLIKELY_PATH/empty{{/|\\5C}}<stdin>"
-// CHECK-NO-MAIN-FILE-NAME: !DIFile(filename: "/UNLIKELY_PATH/empty{{[/\\]}}{{.*}}",
+// CHECK-NO-MAIN-FILE-NAME: !DIFile(filename: "/UNLIKELY_PATH/empty{{/|\\\\}}<stdin>"
+// CHECK-NO-MAIN-FILE-NAME: !DIFile(filename: "/UNLIKELY_PATH/empty{{/|\\\\}}{{.*}}",
// On POSIX systems "Dir" should actually be empty, but on Windows we
// can't recognize "/UNLIKELY_PATH" as being an absolute path.
// CHECK-NO-MAIN-FILE-NAME-SAME: directory: "{{()|(.*:.*)}}")
-// CHECK-NO-MAIN-FILE-NAME: !DIFile(filename: "/UNLIKELY_PATH/empty{{[/\\]}}Inputs/stdio.h",
+// CHECK-NO-MAIN-FILE-NAME: !DIFile(filename: "/UNLIKELY_PATH/empty{{/|\\\\}}Inputs/stdio.h",
// CHECK-NO-MAIN-FILE-NAME-SAME: directory: "{{()|(.*:.*)}}")
// CHECK-NO-MAIN-FILE-NAME-NOT: !DIFile(filename:
-// CHECK-EVIL: !DIFile(filename: "/UNLIKELY_PATH=empty{{[/\\]}}{{.*}}"
-// CHECK-EVIL: !DIFile(filename: "/UNLIKELY_PATH=empty{{[/\\]}}{{.*}}Inputs/stdio.h",
+// CHECK-EVIL: !DIFile(filename: "/UNLIKELY_PATH=empty{{/|\\\\}}{{.*}}"
+// CHECK-EVIL: !DIFile(filename: "/UNLIKELY_PATH=empty{{/|\\\\}}{{.*}}Inputs/stdio.h",
// CHECK-EVIL-SAME: directory: "{{()|(.*:.*)}}")
// CHECK-EVIL-NOT: !DIFile(filename:
-// CHECK: !DIFile(filename: "/UNLIKELY_PATH/empty{{[/\\]}}{{.*}}"
-// CHECK: !DIFile(filename: "/UNLIKELY_PATH/empty{{[/\\]}}{{.*}}Inputs/stdio.h",
+// CHECK: !DIFile(filename: "/UNLIKELY_PATH/empty{{/|\\\\}}{{.*}}"
+// CHECK: !DIFile(filename: "/UNLIKELY_PATH/empty{{/|\\\\}}{{.*}}Inputs/stdio.h",
// CHECK-SAME: directory: "{{()|(.*:.*)}}")
// CHECK-NOT: !DIFile(filename:
diff --git a/src/llvm-project/clang/test/CodeGen/dwarf-version.c b/src/llvm-project/clang/test/CodeGen/dwarf-version.c
index 39bcbc2..87143ee 100644
--- a/src/llvm-project/clang/test/CodeGen/dwarf-version.c
+++ b/src/llvm-project/clang/test/CodeGen/dwarf-version.c
@@ -14,6 +14,7 @@
// RUN: %clang -target powerpc-unknown-openbsd -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER2
// RUN: %clang -target powerpc-unknown-freebsd -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER2
// RUN: %clang -target i386-pc-solaris -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER2
+// RUN: %clang -target i386-pc-solaris -gdwarf -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER2
// Check which debug info formats we use on Windows. By default, in an MSVC
// environment, we should use codeview. You can enable dwarf, which implicitly
@@ -37,10 +38,10 @@
// NOCODEVIEW-NOT: !"CodeView"
-// VER2: !{i32 2, !"Dwarf Version", i32 2}
-// VER3: !{i32 2, !"Dwarf Version", i32 3}
-// VER4: !{i32 2, !"Dwarf Version", i32 4}
-// VER5: !{i32 2, !"Dwarf Version", i32 5}
+// VER2: !{i32 7, !"Dwarf Version", i32 2}
+// VER3: !{i32 7, !"Dwarf Version", i32 3}
+// VER4: !{i32 7, !"Dwarf Version", i32 4}
+// VER5: !{i32 7, !"Dwarf Version", i32 5}
// NODWARF-NOT: !"Dwarf Version"
// CODEVIEW: !{i32 2, !"CodeView", i32 1}
diff --git a/src/llvm-project/clang/test/CodeGen/enum2.c b/src/llvm-project/clang/test/CodeGen/enum2.c
index 9729ad0..f41d5a1 100644
--- a/src/llvm-project/clang/test/CodeGen/enum2.c
+++ b/src/llvm-project/clang/test/CodeGen/enum2.c
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 -triple i386-unknown-unknown %s -debug-info-kind=limited -emit-llvm -o /dev/null
+// RUN: %clang_cc1 -triple i386-unknown-unknown %s -debug-info-kind=limited -emit-llvm -o - | FileCheck %s
+
int v;
enum e { MAX };
@@ -6,3 +7,9 @@
{
v = MAX;
}
+// CHECK: !DICompositeType(tag: DW_TAG_enumeration_type,
+// CHECK-SAME: baseType: ![[LONG:[0-9]+]]
+// CHECK-SAME: elements: ![[ELTS:[0-9]+]]
+// CHECK: ![[LONG]] = !DIBasicType(name: "unsigned int", size: 32, encoding: DW_ATE_unsigned)
+// CHECK: ![[ELTS]] = !{![[MAX:[0-9]+]]}
+// CHECK: ![[MAX]] = !DIEnumerator(name: "MAX", value: 0, isUnsigned: true)
diff --git a/src/llvm-project/clang/test/CodeGen/exceptions-seh.c b/src/llvm-project/clang/test/CodeGen/exceptions-seh.c
index 8c952a0..8a54a56 100644
--- a/src/llvm-project/clang/test/CodeGen/exceptions-seh.c
+++ b/src/llvm-project/clang/test/CodeGen/exceptions-seh.c
@@ -51,7 +51,7 @@
// 32-bit SEH needs this filter to save the exception code.
//
// X86-LABEL: define internal i32 @"?filt$0@0@safe_div@@"()
-// X86: %[[ebp:[^ ]*]] = call i8* @llvm.frameaddress(i32 1)
+// X86: %[[ebp:[^ ]*]] = call i8* @llvm.frameaddress.p0i8(i32 1)
// X86: %[[fp:[^ ]*]] = call i8* @llvm.eh.recoverfp(i8* bitcast (i32 (i32, i32, i32*)* @safe_div to i8*), i8* %[[ebp]])
// X86: call i8* @llvm.localrecover(i8* bitcast (i32 (i32, i32, i32*)* @safe_div to i8*), i8* %[[fp]], i32 0)
// X86: load i8*, i8**
@@ -103,7 +103,7 @@
// ARM64: call i8* @llvm.localrecover(i8* bitcast (i32 ()* @filter_expr_capture to i8*), i8* %[[fp]], i32 0)
//
// X86-LABEL: define internal i32 @"?filt$0@0@filter_expr_capture@@"()
-// X86: %[[ebp:[^ ]*]] = call i8* @llvm.frameaddress(i32 1)
+// X86: %[[ebp:[^ ]*]] = call i8* @llvm.frameaddress.p0i8(i32 1)
// X86: %[[fp:[^ ]*]] = call i8* @llvm.eh.recoverfp(i8* bitcast (i32 ()* @filter_expr_capture to i8*), i8* %[[ebp]])
// X86: call i8* @llvm.localrecover(i8* bitcast (i32 ()* @filter_expr_capture to i8*), i8* %[[fp]], i32 0)
//
diff --git a/src/llvm-project/clang/test/CodeGen/exprs.c b/src/llvm-project/clang/test/CodeGen/exprs.c
index 14f5895..41b429c 100644
--- a/src/llvm-project/clang/test/CodeGen/exprs.c
+++ b/src/llvm-project/clang/test/CodeGen/exprs.c
@@ -143,7 +143,7 @@
// Make sure negate of fp uses -0.0 for proper -0 handling.
double f13(double X) {
// CHECK-LABEL: define double @f13
- // CHECK: fsub double -0.0
+ // CHECK: fneg double
return -X;
}
diff --git a/src/llvm-project/clang/test/CodeGen/fma-builtins.c b/src/llvm-project/clang/test/CodeGen/fma-builtins.c
index ff047f3..1118e0c 100644
--- a/src/llvm-project/clang/test/CodeGen/fma-builtins.c
+++ b/src/llvm-project/clang/test/CodeGen/fma-builtins.c
@@ -37,21 +37,21 @@
__m128 test_mm_fmsub_ps(__m128 a, __m128 b, __m128 c) {
// CHECK-LABEL: test_mm_fmsub_ps
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> %{{.+}}
// CHECK: call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
return _mm_fmsub_ps(a, b, c);
}
__m128d test_mm_fmsub_pd(__m128d a, __m128d b, __m128d c) {
// CHECK-LABEL: test_mm_fmsub_pd
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> %{{.+}}
// CHECK: call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}})
return _mm_fmsub_pd(a, b, c);
}
__m128 test_mm_fmsub_ss(__m128 a, __m128 b, __m128 c) {
// CHECK-LABEL: test_mm_fmsub_ss
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> %{{.+}}
// CHECK: extractelement <4 x float> %{{.*}}, i64 0
// CHECK: extractelement <4 x float> %{{.*}}, i64 0
// CHECK: extractelement <4 x float> %{{.*}}, i64 0
@@ -62,7 +62,7 @@
__m128d test_mm_fmsub_sd(__m128d a, __m128d b, __m128d c) {
// CHECK-LABEL: test_mm_fmsub_sd
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> %{{.+}}
// CHECK: extractelement <2 x double> %{{.*}}, i64 0
// CHECK: extractelement <2 x double> %{{.*}}, i64 0
// CHECK: extractelement <2 x double> %{{.*}}, i64 0
@@ -73,21 +73,21 @@
__m128 test_mm_fnmadd_ps(__m128 a, __m128 b, __m128 c) {
// CHECK-LABEL: test_mm_fnmadd_ps
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> %{{.+}}
// CHECK: call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
return _mm_fnmadd_ps(a, b, c);
}
__m128d test_mm_fnmadd_pd(__m128d a, __m128d b, __m128d c) {
// CHECK-LABEL: test_mm_fnmadd_pd
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> %{{.+}}
// CHECK: call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}})
return _mm_fnmadd_pd(a, b, c);
}
__m128 test_mm_fnmadd_ss(__m128 a, __m128 b, __m128 c) {
// CHECK-LABEL: test_mm_fnmadd_ss
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> %{{.+}}
// CHECK: extractelement <4 x float> %{{.*}}, i64 0
// CHECK: extractelement <4 x float> %{{.*}}, i64 0
// CHECK: extractelement <4 x float> %{{.*}}, i64 0
@@ -98,7 +98,7 @@
__m128d test_mm_fnmadd_sd(__m128d a, __m128d b, __m128d c) {
// CHECK-LABEL: test_mm_fnmadd_sd
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> %{{.+}}
// CHECK: extractelement <2 x double> %{{.*}}, i64 0
// CHECK: extractelement <2 x double> %{{.*}}, i64 0
// CHECK: extractelement <2 x double> %{{.*}}, i64 0
@@ -109,24 +109,24 @@
__m128 test_mm_fnmsub_ps(__m128 a, __m128 b, __m128 c) {
// CHECK-LABEL: test_mm_fnmsub_ps
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.+}}
- // CHECK: [[NEG2:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> %{{.+}}
+ // CHECK: [[NEG2:%.+]] = fneg <4 x float> %{{.+}}
// CHECK: call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
return _mm_fnmsub_ps(a, b, c);
}
__m128d test_mm_fnmsub_pd(__m128d a, __m128d b, __m128d c) {
// CHECK-LABEL: test_mm_fnmsub_pd
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.+}}
- // CHECK: [[NEG2:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> %{{.+}}
+ // CHECK: [[NEG2:%.+]] = fneg <2 x double> %{{.+}}
// CHECK: call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}})
return _mm_fnmsub_pd(a, b, c);
}
__m128 test_mm_fnmsub_ss(__m128 a, __m128 b, __m128 c) {
// CHECK-LABEL: test_mm_fnmsub_ss
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.+}}
- // CHECK: [[NEG2:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> %{{.+}}
+ // CHECK: [[NEG2:%.+]] = fneg <4 x float> %{{.+}}
// CHECK: extractelement <4 x float> %{{.*}}, i64 0
// CHECK: extractelement <4 x float> %{{.*}}, i64 0
// CHECK: extractelement <4 x float> %{{.*}}, i64 0
@@ -137,8 +137,8 @@
__m128d test_mm_fnmsub_sd(__m128d a, __m128d b, __m128d c) {
// CHECK-LABEL: test_mm_fnmsub_sd
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.+}}
- // CHECK: [[NEG2:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> %{{.+}}
+ // CHECK: [[NEG2:%.+]] = fneg <2 x double> %{{.+}}
// CHECK: extractelement <2 x double> %{{.*}}, i64 0
// CHECK: extractelement <2 x double> %{{.*}}, i64 0
// CHECK: extractelement <2 x double> %{{.*}}, i64 0
@@ -150,7 +150,7 @@
__m128 test_mm_fmaddsub_ps(__m128 a, __m128 b, __m128 c) {
// CHECK-LABEL: test_mm_fmaddsub_ps
// CHECK: [[ADD:%.+]] = call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> %{{.+}}
// CHECK: [[SUB:%.+]] = call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> [[NEG]]
// CHECK: shufflevector <4 x float> [[SUB]], <4 x float> [[ADD]], <4 x i32> <i32 0, i32 5, i32 2, i32 7>
return _mm_fmaddsub_ps(a, b, c);
@@ -159,7 +159,7 @@
__m128d test_mm_fmaddsub_pd(__m128d a, __m128d b, __m128d c) {
// CHECK-LABEL: test_mm_fmaddsub_pd
// CHECK: [[ADD:%.+]] = call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}})
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> %{{.+}}
// CHECK: [[SUB:%.+]] = call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> [[NEG]]
// CHECK: shufflevector <2 x double> [[SUB]], <2 x double> [[ADD]], <2 x i32> <i32 0, i32 3>
return _mm_fmaddsub_pd(a, b, c);
@@ -167,7 +167,7 @@
__m128 test_mm_fmsubadd_ps(__m128 a, __m128 b, __m128 c) {
// CHECK-LABEL: test_mm_fmsubadd_ps
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> %{{.+}}
// CHECK: [[SUB:%.+]] = call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> [[NEG]]
// CHECK: [[ADD:%.+]] = call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
// CHECK: shufflevector <4 x float> [[ADD]], <4 x float> [[SUB]], <4 x i32> <i32 0, i32 5, i32 2, i32 7>
@@ -176,7 +176,7 @@
__m128d test_mm_fmsubadd_pd(__m128d a, __m128d b, __m128d c) {
// CHECK-LABEL: test_mm_fmsubadd_pd
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> %{{.+}}
// CHECK: [[SUB:%.+]] = call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> [[NEG]]
// CHECK: [[ADD:%.+]] = call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}})
// CHECK: shufflevector <2 x double> [[ADD]], <2 x double> [[SUB]], <2 x i32> <i32 0, i32 3>
@@ -197,44 +197,44 @@
__m256 test_mm256_fmsub_ps(__m256 a, __m256 b, __m256 c) {
// CHECK-LABEL: test_mm256_fmsub_ps
- // CHECK: [[NEG:%.+]] = fsub <8 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <8 x float> %{{.*}}
// CHECK: call <8 x float> @llvm.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}})
return _mm256_fmsub_ps(a, b, c);
}
__m256d test_mm256_fmsub_pd(__m256d a, __m256d b, __m256d c) {
// CHECK-LABEL: test_mm256_fmsub_pd
- // CHECK: [[NEG:%.+]] = fsub <4 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x double> %{{.+}}
// CHECK: call <4 x double> @llvm.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}})
return _mm256_fmsub_pd(a, b, c);
}
__m256 test_mm256_fnmadd_ps(__m256 a, __m256 b, __m256 c) {
// CHECK-LABEL: test_mm256_fnmadd_ps
- // CHECK: [[NEG:%.+]] = fsub <8 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <8 x float> %{{.*}}
// CHECK: call <8 x float> @llvm.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}})
return _mm256_fnmadd_ps(a, b, c);
}
__m256d test_mm256_fnmadd_pd(__m256d a, __m256d b, __m256d c) {
// CHECK-LABEL: test_mm256_fnmadd_pd
- // CHECK: [[NEG:%.+]] = fsub <4 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x double> %{{.+}}
// CHECK: call <4 x double> @llvm.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}})
return _mm256_fnmadd_pd(a, b, c);
}
__m256 test_mm256_fnmsub_ps(__m256 a, __m256 b, __m256 c) {
// CHECK-LABEL: test_mm256_fnmsub_ps
- // CHECK: [[NEG:%.+]] = fsub <8 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
- // CHECK: [[NEG2:%.+]] = fsub <8 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <8 x float> %{{.*}}
+ // CHECK: [[NEG2:%.+]] = fneg <8 x float> %{{.*}}
// CHECK: call <8 x float> @llvm.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}})
return _mm256_fnmsub_ps(a, b, c);
}
__m256d test_mm256_fnmsub_pd(__m256d a, __m256d b, __m256d c) {
// CHECK-LABEL: test_mm256_fnmsub_pd
- // CHECK: [[NEG:%.+]] = fsub <4 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.+}}
- // CHECK: [[NEG2:%.+]] = fsub <4 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x double> %{{.+}}
+ // CHECK: [[NEG2:%.+]] = fneg <4 x double> %{{.+}}
// CHECK: call <4 x double> @llvm.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}})
return _mm256_fnmsub_pd(a, b, c);
}
@@ -242,7 +242,7 @@
__m256 test_mm256_fmaddsub_ps(__m256 a, __m256 b, __m256 c) {
// CHECK-LABEL: test_mm256_fmaddsub_ps
// CHECK: [[ADD:%.+]] = call <8 x float> @llvm.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}})
- // CHECK: [[NEG:%.+]] = fsub <8 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <8 x float> %{{.*}}
// CHECK: [[SUB:%.+]] = call <8 x float> @llvm.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> [[NEG]]
// CHECK: shufflevector <8 x float> [[SUB]], <8 x float> [[ADD]], <8 x i32> <i32 0, i32 9, i32 2, i32 11, i32 4, i32 13, i32 6, i32 15>
return _mm256_fmaddsub_ps(a, b, c);
@@ -251,7 +251,7 @@
__m256d test_mm256_fmaddsub_pd(__m256d a, __m256d b, __m256d c) {
// CHECK-LABEL: test_mm256_fmaddsub_pd
// CHECK: [[ADD:%.+]] = call <4 x double> @llvm.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}})
- // CHECK: [[NEG:%.+]] = fsub <4 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x double> %{{.+}}
// CHECK: [[SUB:%.+]] = call <4 x double> @llvm.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}})
// CHECK: shufflevector <4 x double> [[SUB]], <4 x double> [[ADD]], <4 x i32> <i32 0, i32 5, i32 2, i32 7>
return _mm256_fmaddsub_pd(a, b, c);
@@ -259,7 +259,7 @@
__m256 test_mm256_fmsubadd_ps(__m256 a, __m256 b, __m256 c) {
// CHECK-LABEL: test_mm256_fmsubadd_ps
- // CHECK: [[NEG:%.+]] = fsub <8 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <8 x float> %{{.*}}
// CHECK: [[SUB:%.+]] = call <8 x float> @llvm.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> [[NEG]]
// CHECK: [[ADD:%.+]] = call <8 x float> @llvm.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}})
// CHECK: shufflevector <8 x float> [[ADD]], <8 x float> [[SUB]], <8 x i32> <i32 0, i32 9, i32 2, i32 11, i32 4, i32 13, i32 6, i32 15>
@@ -268,7 +268,7 @@
__m256d test_mm256_fmsubadd_pd(__m256d a, __m256d b, __m256d c) {
// CHECK-LABEL: test_mm256_fmsubadd_pd
- // CHECK: [[NEG:%.+]] = fsub <4 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x double> %{{.+}}
// CHECK: [[SUB:%.+]] = call <4 x double> @llvm.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> [[NEG]]
// CHECK: [[ADD:%.+]] = call <4 x double> @llvm.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}})
// CHECK: shufflevector <4 x double> [[ADD]], <4 x double> [[SUB]], <4 x i32> <i32 0, i32 5, i32 2, i32 7>
diff --git a/src/llvm-project/clang/test/CodeGen/fma4-builtins.c b/src/llvm-project/clang/test/CodeGen/fma4-builtins.c
index 8078a6e..e24a9b3 100644
--- a/src/llvm-project/clang/test/CodeGen/fma4-builtins.c
+++ b/src/llvm-project/clang/test/CodeGen/fma4-builtins.c
@@ -37,21 +37,21 @@
__m128 test_mm_msub_ps(__m128 a, __m128 b, __m128 c) {
// CHECK-LABEL: test_mm_msub_ps
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> %{{.+}}
// CHECK: call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
return _mm_msub_ps(a, b, c);
}
__m128d test_mm_msub_pd(__m128d a, __m128d b, __m128d c) {
// CHECK-LABEL: test_mm_msub_pd
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> %{{.+}}
// CHECK: call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}})
return _mm_msub_pd(a, b, c);
}
__m128 test_mm_msub_ss(__m128 a, __m128 b, __m128 c) {
// CHECK-LABEL: test_mm_msub_ss
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> %{{.+}}
// CHECK: extractelement <4 x float> %{{.*}}, i64 0
// CHECK: extractelement <4 x float> %{{.*}}, i64 0
// CHECK: [[C:%.+]] = extractelement <4 x float> [[NEG]], i64 0
@@ -62,7 +62,7 @@
__m128d test_mm_msub_sd(__m128d a, __m128d b, __m128d c) {
// CHECK-LABEL: test_mm_msub_sd
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> %{{.+}}
// CHECK: extractelement <2 x double> %{{.*}}, i64 0
// CHECK: extractelement <2 x double> %{{.*}}, i64 0
// CHECK: [[C:%.+]] = extractelement <2 x double> [[NEG]], i64 0
@@ -73,21 +73,21 @@
__m128 test_mm_nmacc_ps(__m128 a, __m128 b, __m128 c) {
// CHECK-LABEL: test_mm_nmacc_ps
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> %{{.+}}
// CHECK: call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
return _mm_nmacc_ps(a, b, c);
}
__m128d test_mm_nmacc_pd(__m128d a, __m128d b, __m128d c) {
// CHECK-LABEL: test_mm_nmacc_pd
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> %{{.+}}
// CHECK: call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}})
return _mm_nmacc_pd(a, b, c);
}
__m128 test_mm_nmacc_ss(__m128 a, __m128 b, __m128 c) {
// CHECK-LABEL: test_mm_nmacc_ss
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> %{{.+}}
// CHECK: [[A:%.+]] = extractelement <4 x float> [[NEG]], i64 0
// CHECK: extractelement <4 x float> %{{.*}}, i64 0
// CHECK: extractelement <4 x float> %{{.*}}, i64 0
@@ -98,7 +98,7 @@
__m128d test_mm_nmacc_sd(__m128d a, __m128d b, __m128d c) {
// CHECK-LABEL: test_mm_nmacc_sd
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> %{{.+}}
// CHECK: [[A:%.+]] = extractelement <2 x double> [[NEG]], i64 0
// CHECK: extractelement <2 x double> %{{.*}}, i64 0
// CHECK: extractelement <2 x double> %{{.*}}, i64 0
@@ -109,24 +109,24 @@
__m128 test_mm_nmsub_ps(__m128 a, __m128 b, __m128 c) {
// CHECK-LABEL: test_mm_nmsub_ps
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.+}}
- // CHECK: [[NEG2:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> %{{.+}}
+ // CHECK: [[NEG2:%.+]] = fneg <4 x float> %{{.+}}
// CHECK: call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
return _mm_nmsub_ps(a, b, c);
}
__m128d test_mm_nmsub_pd(__m128d a, __m128d b, __m128d c) {
// CHECK-LABEL: test_mm_nmsub_pd
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.+}}
- // CHECK: [[NEG2:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> %{{.+}}
+ // CHECK: [[NEG2:%.+]] = fneg <2 x double> %{{.+}}
// CHECK: call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}})
return _mm_nmsub_pd(a, b, c);
}
__m128 test_mm_nmsub_ss(__m128 a, __m128 b, __m128 c) {
// CHECK-LABEL: test_mm_nmsub_ss
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.+}}
- // CHECK: [[NEG2:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> %{{.+}}
+ // CHECK: [[NEG2:%.+]] = fneg <4 x float> %{{.+}}
// CHECK: [[A:%.+]] = extractelement <4 x float> [[NEG]], i64 0
// CHECK: extractelement <4 x float> %{{.*}}, i64 0
// CHECK: [[C:%.+]] = extractelement <4 x float> [[NEG2]], i64 0
@@ -137,8 +137,8 @@
__m128d test_mm_nmsub_sd(__m128d a, __m128d b, __m128d c) {
// CHECK-LABEL: test_mm_nmsub_sd
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.+}}
- // CHECK: [[NEG2:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> %{{.+}}
+ // CHECK: [[NEG2:%.+]] = fneg <2 x double> %{{.+}}
// CHECK: [[A:%.+]] = extractelement <2 x double> [[NEG]], i64 0
// CHECK: extractelement <2 x double> %{{.*}}, i64 0
// CHECK: [[C:%.+]] = extractelement <2 x double> [[NEG2]], i64 0
@@ -150,7 +150,7 @@
__m128 test_mm_maddsub_ps(__m128 a, __m128 b, __m128 c) {
// CHECK-LABEL: test_mm_maddsub_ps
// CHECK: [[ADD:%.+]] = call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> %{{.+}}
// CHECK: [[SUB:%.+]] = call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> [[NEG]]
// CHECK: shufflevector <4 x float> [[SUB]], <4 x float> [[ADD]], <4 x i32> <i32 0, i32 5, i32 2, i32 7>
return _mm_maddsub_ps(a, b, c);
@@ -159,7 +159,7 @@
__m128d test_mm_maddsub_pd(__m128d a, __m128d b, __m128d c) {
// CHECK-LABEL: test_mm_maddsub_pd
// CHECK: [[ADD:%.+]] = call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}})
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> %{{.+}}
// CHECK: [[SUB:%.+]] = call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> [[NEG]]
// CHECK: shufflevector <2 x double> [[SUB]], <2 x double> [[ADD]], <2 x i32> <i32 0, i32 3>
return _mm_maddsub_pd(a, b, c);
@@ -167,7 +167,7 @@
__m128 test_mm_msubadd_ps(__m128 a, __m128 b, __m128 c) {
// CHECK-LABEL: test_mm_msubadd_ps
- // CHECK: [[NEG:%.+]] = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x float> %{{.+}}
// CHECK: [[SUB:%.+]] = call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> [[NEG]]
// CHECK: [[ADD:%.+]] = call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
// CHECK: shufflevector <4 x float> [[ADD]], <4 x float> [[SUB]], <4 x i32> <i32 0, i32 5, i32 2, i32 7>
@@ -176,7 +176,7 @@
__m128d test_mm_msubadd_pd(__m128d a, __m128d b, __m128d c) {
// CHECK-LABEL: test_mm_msubadd_pd
- // CHECK: [[NEG:%.+]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <2 x double> %{{.+}}
// CHECK: [[SUB:%.+]] = call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> [[NEG]]
// CHECK: [[ADD:%.+]] = call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}})
// CHECK: shufflevector <2 x double> [[ADD]], <2 x double> [[SUB]], <2 x i32> <i32 0, i32 3>
@@ -197,44 +197,44 @@
__m256 test_mm256_msub_ps(__m256 a, __m256 b, __m256 c) {
// CHECK-LABEL: test_mm256_msub_ps
- // CHECK: [[NEG:%.+]] = fsub <8 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <8 x float> %{{.*}}
// CHECK: call <8 x float> @llvm.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}})
return _mm256_msub_ps(a, b, c);
}
__m256d test_mm256_msub_pd(__m256d a, __m256d b, __m256d c) {
// CHECK-LABEL: test_mm256_msub_pd
- // CHECK: [[NEG:%.+]] = fsub <4 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x double> %{{.+}}
// CHECK: call <4 x double> @llvm.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}})
return _mm256_msub_pd(a, b, c);
}
__m256 test_mm256_nmacc_ps(__m256 a, __m256 b, __m256 c) {
// CHECK-LABEL: test_mm256_nmacc_ps
- // CHECK: [[NEG:%.+]] = fsub <8 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <8 x float> %{{.*}}
// CHECK: call <8 x float> @llvm.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}})
return _mm256_nmacc_ps(a, b, c);
}
__m256d test_mm256_nmacc_pd(__m256d a, __m256d b, __m256d c) {
// CHECK-LABEL: test_mm256_nmacc_pd
- // CHECK: [[NEG:%.+]] = fsub <4 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x double> %{{.+}}
// CHECK: call <4 x double> @llvm.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}})
return _mm256_nmacc_pd(a, b, c);
}
__m256 test_mm256_nmsub_ps(__m256 a, __m256 b, __m256 c) {
// CHECK-LABEL: test_mm256_nmsub_ps
- // CHECK: [[NEG:%.+]] = fsub <8 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
- // CHECK: [[NEG2:%.+]] = fsub <8 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <8 x float> %{{.*}}
+ // CHECK: [[NEG2:%.+]] = fneg <8 x float> %{{.*}}
// CHECK: call <8 x float> @llvm.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}})
return _mm256_nmsub_ps(a, b, c);
}
__m256d test_mm256_nmsub_pd(__m256d a, __m256d b, __m256d c) {
// CHECK-LABEL: test_mm256_nmsub_pd
- // CHECK: [[NEG:%.+]] = fsub <4 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.+}}
- // CHECK: [[NEG2:%.+]] = fsub <4 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x double> %{{.+}}
+ // CHECK: [[NEG2:%.+]] = fneg <4 x double> %{{.+}}
// CHECK: call <4 x double> @llvm.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}})
return _mm256_nmsub_pd(a, b, c);
}
@@ -242,7 +242,7 @@
__m256 test_mm256_maddsub_ps(__m256 a, __m256 b, __m256 c) {
// CHECK-LABEL: test_mm256_maddsub_ps
// CHECK: [[ADD:%.+]] = call <8 x float> @llvm.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}})
- // CHECK: [[NEG:%.+]] = fsub <8 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <8 x float> %{{.*}}
// CHECK: [[SUB:%.+]] = call <8 x float> @llvm.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> [[NEG]]
// CHECK: shufflevector <8 x float> [[SUB]], <8 x float> [[ADD]], <8 x i32> <i32 0, i32 9, i32 2, i32 11, i32 4, i32 13, i32 6, i32 15>
return _mm256_maddsub_ps(a, b, c);
@@ -251,7 +251,7 @@
__m256d test_mm256_maddsub_pd(__m256d a, __m256d b, __m256d c) {
// CHECK-LABEL: test_mm256_maddsub_pd
// CHECK: [[ADD:%.+]] = call <4 x double> @llvm.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}})
- // CHECK: [[NEG:%.+]] = fsub <4 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x double> %{{.+}}
// CHECK: [[SUB:%.+]] = call <4 x double> @llvm.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}})
// CHECK: shufflevector <4 x double> [[SUB]], <4 x double> [[ADD]], <4 x i32> <i32 0, i32 5, i32 2, i32 7>
return _mm256_maddsub_pd(a, b, c);
@@ -259,7 +259,7 @@
__m256 test_mm256_msubadd_ps(__m256 a, __m256 b, __m256 c) {
// CHECK-LABEL: test_mm256_msubadd_ps
- // CHECK: [[NEG:%.+]] = fsub <8 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %{{.*}}
+ // CHECK: [[NEG:%.+]] = fneg <8 x float> %{{.*}}
// CHECK: [[SUB:%.+]] = call <8 x float> @llvm.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> [[NEG]]
// CHECK: [[ADD:%.+]] = call <8 x float> @llvm.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}})
// CHECK: shufflevector <8 x float> [[ADD]], <8 x float> [[SUB]], <8 x i32> <i32 0, i32 9, i32 2, i32 11, i32 4, i32 13, i32 6, i32 15>
@@ -268,7 +268,7 @@
__m256d test_mm256_msubadd_pd(__m256d a, __m256d b, __m256d c) {
// CHECK-LABEL: test_mm256_msubadd_pd
- // CHECK: [[NEG:%.+]] = fsub <4 x double> <double -0.000000e+00, double -0.000000e+00, double -0.000000e+00, double -0.000000e+00>, %{{.+}}
+ // CHECK: [[NEG:%.+]] = fneg <4 x double> {{.+}}
// CHECK: [[SUB:%.+]] = call <4 x double> @llvm.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> [[NEG]]
// CHECK: [[ADD:%.+]] = call <4 x double> @llvm.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}})
// CHECK: shufflevector <4 x double> [[ADD]], <4 x double> [[SUB]], <4 x i32> <i32 0, i32 5, i32 2, i32 7>
diff --git a/src/llvm-project/clang/test/CodeGen/fp-contract-pragma.cpp b/src/llvm-project/clang/test/CodeGen/fp-contract-pragma.cpp
index 1c5921a..805cc5d 100644
--- a/src/llvm-project/clang/test/CodeGen/fp-contract-pragma.cpp
+++ b/src/llvm-project/clang/test/CodeGen/fp-contract-pragma.cpp
@@ -74,3 +74,18 @@
return (a = 2 * b) - c;
}
+float fp_contract_8(float a, float b, float c) {
+// CHECK: _Z13fp_contract_8fff
+// CHECK: fneg float %c
+// CHECK: tail call float @llvm.fmuladd
+ #pragma STDC FP_CONTRACT ON
+ return a * b - c;
+}
+
+float fp_contract_9(float a, float b, float c) {
+// CHECK: _Z13fp_contract_9fff
+// CHECK: fneg float %a
+// CHECK: tail call float @llvm.fmuladd
+ #pragma STDC FP_CONTRACT ON
+ return c - a * b;
+}
diff --git a/src/llvm-project/clang/test/CodeGen/fp16-ops.c b/src/llvm-project/clang/test/CodeGen/fp16-ops.c
index f2ed667..f74552b 100644
--- a/src/llvm-project/clang/test/CodeGen/fp16-ops.c
+++ b/src/llvm-project/clang/test/CodeGen/fp16-ops.c
@@ -37,9 +37,9 @@
// NATIVE-HALF: fcmp une half
test = (!h1);
// CHECK: [[F16TOF32]]
- // CHECK: fsub float
+ // CHECK: fneg float
// NOTNATIVE: [[F32TOF16]]
- // NATIVE-HALF: fsub half
+ // NATIVE-HALF: fneg half
h1 = -h1;
// CHECK: [[F16TOF32]]
// CHECK: [[F32TOF16]]
diff --git a/src/llvm-project/clang/test/CodeGen/fpconstrained-cmp-double.c b/src/llvm-project/clang/test/CodeGen/fpconstrained-cmp-double.c
new file mode 100644
index 0000000..2819970
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/fpconstrained-cmp-double.c
@@ -0,0 +1,151 @@
+// RUN: %clang_cc1 -ffp-exception-behavior=ignore -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK -check-prefix=FCMP
+// RUN: %clang_cc1 -ffp-exception-behavior=strict -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK -check-prefix=EXCEPT
+// RUN: %clang_cc1 -ffp-exception-behavior=maytrap -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK -check-prefix=MAYTRAP
+// RUN: %clang_cc1 -frounding-math -ffp-exception-behavior=ignore -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK -check-prefix=IGNORE
+// RUN: %clang_cc1 -frounding-math -ffp-exception-behavior=strict -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK -check-prefix=EXCEPT
+// RUN: %clang_cc1 -frounding-math -ffp-exception-behavior=maytrap -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK -check-prefix=MAYTRAP
+
+_Bool QuietEqual(double f1, double f2) {
+ // CHECK-LABEL: define {{.*}}i1 @QuietEqual(double %f1, double %f2)
+
+ // FCMP: fcmp oeq double %{{.*}}, %{{.*}}
+ // IGNORE: call i1 @llvm.experimental.constrained.fcmp.f64(double %{{.*}}, double %{{.*}}, metadata !"oeq", metadata !"fpexcept.ignore")
+ // EXCEPT: call i1 @llvm.experimental.constrained.fcmp.f64(double %{{.*}}, double %{{.*}}, metadata !"oeq", metadata !"fpexcept.strict")
+ // MAYTRAP: call i1 @llvm.experimental.constrained.fcmp.f64(double %{{.*}}, double %{{.*}}, metadata !"oeq", metadata !"fpexcept.maytrap")
+ return f1 == f2;
+
+ // CHECK: ret
+}
+
+_Bool QuietNotEqual(double f1, double f2) {
+ // CHECK-LABEL: define {{.*}}i1 @QuietNotEqual(double %f1, double %f2)
+
+ // FCMP: fcmp une double %{{.*}}, %{{.*}}
+ // IGNORE: call i1 @llvm.experimental.constrained.fcmp.f64(double %{{.*}}, double %{{.*}}, metadata !"une", metadata !"fpexcept.ignore")
+ // EXCEPT: call i1 @llvm.experimental.constrained.fcmp.f64(double %{{.*}}, double %{{.*}}, metadata !"une", metadata !"fpexcept.strict")
+ // MAYTRAP: call i1 @llvm.experimental.constrained.fcmp.f64(double %{{.*}}, double %{{.*}}, metadata !"une", metadata !"fpexcept.maytrap")
+ return f1 != f2;
+
+ // CHECK: ret
+}
+
+_Bool SignalingLess(double f1, double f2) {
+ // CHECK-LABEL: define {{.*}}i1 @SignalingLess(double %f1, double %f2)
+
+ // FCMP: fcmp olt double %{{.*}}, %{{.*}}
+ // IGNORE: call i1 @llvm.experimental.constrained.fcmps.f64(double %{{.*}}, double %{{.*}}, metadata !"olt", metadata !"fpexcept.ignore")
+ // EXCEPT: call i1 @llvm.experimental.constrained.fcmps.f64(double %{{.*}}, double %{{.*}}, metadata !"olt", metadata !"fpexcept.strict")
+ // MAYTRAP: call i1 @llvm.experimental.constrained.fcmps.f64(double %{{.*}}, double %{{.*}}, metadata !"olt", metadata !"fpexcept.maytrap")
+ return f1 < f2;
+
+ // CHECK: ret
+}
+
+_Bool SignalingLessEqual(double f1, double f2) {
+ // CHECK-LABEL: define {{.*}}i1 @SignalingLessEqual(double %f1, double %f2)
+
+ // FCMP: fcmp ole double %{{.*}}, %{{.*}}
+ // IGNORE: call i1 @llvm.experimental.constrained.fcmps.f64(double %{{.*}}, double %{{.*}}, metadata !"ole", metadata !"fpexcept.ignore")
+ // EXCEPT: call i1 @llvm.experimental.constrained.fcmps.f64(double %{{.*}}, double %{{.*}}, metadata !"ole", metadata !"fpexcept.strict")
+ // MAYTRAP: call i1 @llvm.experimental.constrained.fcmps.f64(double %{{.*}}, double %{{.*}}, metadata !"ole", metadata !"fpexcept.maytrap")
+ return f1 <= f2;
+
+ // CHECK: ret
+}
+
+_Bool SignalingGreater(double f1, double f2) {
+ // CHECK-LABEL: define {{.*}}i1 @SignalingGreater(double %f1, double %f2)
+
+ // FCMP: fcmp ogt double %{{.*}}, %{{.*}}
+ // IGNORE: call i1 @llvm.experimental.constrained.fcmps.f64(double %{{.*}}, double %{{.*}}, metadata !"ogt", metadata !"fpexcept.ignore")
+ // EXCEPT: call i1 @llvm.experimental.constrained.fcmps.f64(double %{{.*}}, double %{{.*}}, metadata !"ogt", metadata !"fpexcept.strict")
+ // MAYTRAP: call i1 @llvm.experimental.constrained.fcmps.f64(double %{{.*}}, double %{{.*}}, metadata !"ogt", metadata !"fpexcept.maytrap")
+ return f1 > f2;
+
+ // CHECK: ret
+}
+
+_Bool SignalingGreaterEqual(double f1, double f2) {
+ // CHECK-LABEL: define {{.*}}i1 @SignalingGreaterEqual(double %f1, double %f2)
+
+ // FCMP: fcmp oge double %{{.*}}, %{{.*}}
+ // IGNORE: call i1 @llvm.experimental.constrained.fcmps.f64(double %{{.*}}, double %{{.*}}, metadata !"oge", metadata !"fpexcept.ignore")
+ // EXCEPT: call i1 @llvm.experimental.constrained.fcmps.f64(double %{{.*}}, double %{{.*}}, metadata !"oge", metadata !"fpexcept.strict")
+ // MAYTRAP: call i1 @llvm.experimental.constrained.fcmps.f64(double %{{.*}}, double %{{.*}}, metadata !"oge", metadata !"fpexcept.maytrap")
+ return f1 >= f2;
+
+ // CHECK: ret
+}
+
+_Bool QuietLess(double f1, double f2) {
+ // CHECK-LABEL: define {{.*}}i1 @QuietLess(double %f1, double %f2)
+
+ // FCMP: fcmp olt double %{{.*}}, %{{.*}}
+ // IGNORE: call i1 @llvm.experimental.constrained.fcmp.f64(double %{{.*}}, double %{{.*}}, metadata !"olt", metadata !"fpexcept.ignore")
+ // EXCEPT: call i1 @llvm.experimental.constrained.fcmp.f64(double %{{.*}}, double %{{.*}}, metadata !"olt", metadata !"fpexcept.strict")
+ // MAYTRAP: call i1 @llvm.experimental.constrained.fcmp.f64(double %{{.*}}, double %{{.*}}, metadata !"olt", metadata !"fpexcept.maytrap")
+ return __builtin_isless(f1, f2);
+
+ // CHECK: ret
+}
+
+_Bool QuietLessEqual(double f1, double f2) {
+ // CHECK-LABEL: define {{.*}}i1 @QuietLessEqual(double %f1, double %f2)
+
+ // FCMP: fcmp ole double %{{.*}}, %{{.*}}
+ // IGNORE: call i1 @llvm.experimental.constrained.fcmp.f64(double %{{.*}}, double %{{.*}}, metadata !"ole", metadata !"fpexcept.ignore")
+ // EXCEPT: call i1 @llvm.experimental.constrained.fcmp.f64(double %{{.*}}, double %{{.*}}, metadata !"ole", metadata !"fpexcept.strict")
+ // MAYTRAP: call i1 @llvm.experimental.constrained.fcmp.f64(double %{{.*}}, double %{{.*}}, metadata !"ole", metadata !"fpexcept.maytrap")
+ return __builtin_islessequal(f1, f2);
+
+ // CHECK: ret
+}
+
+_Bool QuietGreater(double f1, double f2) {
+ // CHECK-LABEL: define {{.*}}i1 @QuietGreater(double %f1, double %f2)
+
+ // FCMP: fcmp ogt double %{{.*}}, %{{.*}}
+ // IGNORE: call i1 @llvm.experimental.constrained.fcmp.f64(double %{{.*}}, double %{{.*}}, metadata !"ogt", metadata !"fpexcept.ignore")
+ // EXCEPT: call i1 @llvm.experimental.constrained.fcmp.f64(double %{{.*}}, double %{{.*}}, metadata !"ogt", metadata !"fpexcept.strict")
+ // MAYTRAP: call i1 @llvm.experimental.constrained.fcmp.f64(double %{{.*}}, double %{{.*}}, metadata !"ogt", metadata !"fpexcept.maytrap")
+ return __builtin_isgreater(f1, f2);
+
+ // CHECK: ret
+}
+
+_Bool QuietGreaterEqual(double f1, double f2) {
+ // CHECK-LABEL: define {{.*}}i1 @QuietGreaterEqual(double %f1, double %f2)
+
+ // FCMP: fcmp oge double %{{.*}}, %{{.*}}
+ // IGNORE: call i1 @llvm.experimental.constrained.fcmp.f64(double %{{.*}}, double %{{.*}}, metadata !"oge", metadata !"fpexcept.ignore")
+ // EXCEPT: call i1 @llvm.experimental.constrained.fcmp.f64(double %{{.*}}, double %{{.*}}, metadata !"oge", metadata !"fpexcept.strict")
+ // MAYTRAP: call i1 @llvm.experimental.constrained.fcmp.f64(double %{{.*}}, double %{{.*}}, metadata !"oge", metadata !"fpexcept.maytrap")
+ return __builtin_isgreaterequal(f1, f2);
+
+ // CHECK: ret
+}
+
+_Bool QuietLessGreater(double f1, double f2) {
+ // CHECK-LABEL: define {{.*}}i1 @QuietLessGreater(double %f1, double %f2)
+
+ // FCMP: fcmp one double %{{.*}}, %{{.*}}
+ // IGNORE: call i1 @llvm.experimental.constrained.fcmp.f64(double %{{.*}}, double %{{.*}}, metadata !"one", metadata !"fpexcept.ignore")
+ // EXCEPT: call i1 @llvm.experimental.constrained.fcmp.f64(double %{{.*}}, double %{{.*}}, metadata !"one", metadata !"fpexcept.strict")
+ // MAYTRAP: call i1 @llvm.experimental.constrained.fcmp.f64(double %{{.*}}, double %{{.*}}, metadata !"one", metadata !"fpexcept.maytrap")
+ return __builtin_islessgreater(f1, f2);
+
+ // CHECK: ret
+}
+
+_Bool QuietUnordered(double f1, double f2) {
+ // CHECK-LABEL: define {{.*}}i1 @QuietUnordered(double %f1, double %f2)
+
+ // FCMP: fcmp uno double %{{.*}}, %{{.*}}
+ // IGNORE: call i1 @llvm.experimental.constrained.fcmp.f64(double %{{.*}}, double %{{.*}}, metadata !"uno", metadata !"fpexcept.ignore")
+ // EXCEPT: call i1 @llvm.experimental.constrained.fcmp.f64(double %{{.*}}, double %{{.*}}, metadata !"uno", metadata !"fpexcept.strict")
+ // MAYTRAP: call i1 @llvm.experimental.constrained.fcmp.f64(double %{{.*}}, double %{{.*}}, metadata !"uno", metadata !"fpexcept.maytrap")
+ return __builtin_isunordered(f1, f2);
+
+ // CHECK: ret
+}
+
diff --git a/src/llvm-project/clang/test/CodeGen/fpconstrained-cmp-float.c b/src/llvm-project/clang/test/CodeGen/fpconstrained-cmp-float.c
new file mode 100644
index 0000000..0265fc5
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/fpconstrained-cmp-float.c
@@ -0,0 +1,151 @@
+// RUN: %clang_cc1 -ffp-exception-behavior=ignore -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK -check-prefix=FCMP
+// RUN: %clang_cc1 -ffp-exception-behavior=strict -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK -check-prefix=EXCEPT
+// RUN: %clang_cc1 -ffp-exception-behavior=maytrap -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK -check-prefix=MAYTRAP
+// RUN: %clang_cc1 -frounding-math -ffp-exception-behavior=ignore -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK -check-prefix=IGNORE
+// RUN: %clang_cc1 -frounding-math -ffp-exception-behavior=strict -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK -check-prefix=EXCEPT
+// RUN: %clang_cc1 -frounding-math -ffp-exception-behavior=maytrap -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK -check-prefix=MAYTRAP
+
+_Bool QuietEqual(float f1, float f2) {
+ // CHECK-LABEL: define {{.*}}i1 @QuietEqual(float %f1, float %f2)
+
+ // FCMP: fcmp oeq float %{{.*}}, %{{.*}}
+ // IGNORE: call i1 @llvm.experimental.constrained.fcmp.f32(float %{{.*}}, float %{{.*}}, metadata !"oeq", metadata !"fpexcept.ignore")
+ // EXCEPT: call i1 @llvm.experimental.constrained.fcmp.f32(float %{{.*}}, float %{{.*}}, metadata !"oeq", metadata !"fpexcept.strict")
+ // MAYTRAP: call i1 @llvm.experimental.constrained.fcmp.f32(float %{{.*}}, float %{{.*}}, metadata !"oeq", metadata !"fpexcept.maytrap")
+ return f1 == f2;
+
+ // CHECK: ret
+}
+
+_Bool QuietNotEqual(float f1, float f2) {
+ // CHECK-LABEL: define {{.*}}i1 @QuietNotEqual(float %f1, float %f2)
+
+ // FCMP: fcmp une float %{{.*}}, %{{.*}}
+ // IGNORE: call i1 @llvm.experimental.constrained.fcmp.f32(float %{{.*}}, float %{{.*}}, metadata !"une", metadata !"fpexcept.ignore")
+ // EXCEPT: call i1 @llvm.experimental.constrained.fcmp.f32(float %{{.*}}, float %{{.*}}, metadata !"une", metadata !"fpexcept.strict")
+ // MAYTRAP: call i1 @llvm.experimental.constrained.fcmp.f32(float %{{.*}}, float %{{.*}}, metadata !"une", metadata !"fpexcept.maytrap")
+ return f1 != f2;
+
+ // CHECK: ret
+}
+
+_Bool SignalingLess(float f1, float f2) {
+ // CHECK-LABEL: define {{.*}}i1 @SignalingLess(float %f1, float %f2)
+
+ // FCMP: fcmp olt float %{{.*}}, %{{.*}}
+ // IGNORE: call i1 @llvm.experimental.constrained.fcmps.f32(float %{{.*}}, float %{{.*}}, metadata !"olt", metadata !"fpexcept.ignore")
+ // EXCEPT: call i1 @llvm.experimental.constrained.fcmps.f32(float %{{.*}}, float %{{.*}}, metadata !"olt", metadata !"fpexcept.strict")
+ // MAYTRAP: call i1 @llvm.experimental.constrained.fcmps.f32(float %{{.*}}, float %{{.*}}, metadata !"olt", metadata !"fpexcept.maytrap")
+ return f1 < f2;
+
+ // CHECK: ret
+}
+
+_Bool SignalingLessEqual(float f1, float f2) {
+ // CHECK-LABEL: define {{.*}}i1 @SignalingLessEqual(float %f1, float %f2)
+
+ // FCMP: fcmp ole float %{{.*}}, %{{.*}}
+ // IGNORE: call i1 @llvm.experimental.constrained.fcmps.f32(float %{{.*}}, float %{{.*}}, metadata !"ole", metadata !"fpexcept.ignore")
+ // EXCEPT: call i1 @llvm.experimental.constrained.fcmps.f32(float %{{.*}}, float %{{.*}}, metadata !"ole", metadata !"fpexcept.strict")
+ // MAYTRAP: call i1 @llvm.experimental.constrained.fcmps.f32(float %{{.*}}, float %{{.*}}, metadata !"ole", metadata !"fpexcept.maytrap")
+ return f1 <= f2;
+
+ // CHECK: ret
+}
+
+_Bool SignalingGreater(float f1, float f2) {
+ // CHECK-LABEL: define {{.*}}i1 @SignalingGreater(float %f1, float %f2)
+
+ // FCMP: fcmp ogt float %{{.*}}, %{{.*}}
+ // IGNORE: call i1 @llvm.experimental.constrained.fcmps.f32(float %{{.*}}, float %{{.*}}, metadata !"ogt", metadata !"fpexcept.ignore")
+ // EXCEPT: call i1 @llvm.experimental.constrained.fcmps.f32(float %{{.*}}, float %{{.*}}, metadata !"ogt", metadata !"fpexcept.strict")
+ // MAYTRAP: call i1 @llvm.experimental.constrained.fcmps.f32(float %{{.*}}, float %{{.*}}, metadata !"ogt", metadata !"fpexcept.maytrap")
+ return f1 > f2;
+
+ // CHECK: ret
+}
+
+_Bool SignalingGreaterEqual(float f1, float f2) {
+ // CHECK-LABEL: define {{.*}}i1 @SignalingGreaterEqual(float %f1, float %f2)
+
+ // FCMP: fcmp oge float %{{.*}}, %{{.*}}
+ // IGNORE: call i1 @llvm.experimental.constrained.fcmps.f32(float %{{.*}}, float %{{.*}}, metadata !"oge", metadata !"fpexcept.ignore")
+ // EXCEPT: call i1 @llvm.experimental.constrained.fcmps.f32(float %{{.*}}, float %{{.*}}, metadata !"oge", metadata !"fpexcept.strict")
+ // MAYTRAP: call i1 @llvm.experimental.constrained.fcmps.f32(float %{{.*}}, float %{{.*}}, metadata !"oge", metadata !"fpexcept.maytrap")
+ return f1 >= f2;
+
+ // CHECK: ret
+}
+
+_Bool QuietLess(float f1, float f2) {
+ // CHECK-LABEL: define {{.*}}i1 @QuietLess(float %f1, float %f2)
+
+ // FCMP: fcmp olt float %{{.*}}, %{{.*}}
+ // IGNORE: call i1 @llvm.experimental.constrained.fcmp.f32(float %{{.*}}, float %{{.*}}, metadata !"olt", metadata !"fpexcept.ignore")
+ // EXCEPT: call i1 @llvm.experimental.constrained.fcmp.f32(float %{{.*}}, float %{{.*}}, metadata !"olt", metadata !"fpexcept.strict")
+ // MAYTRAP: call i1 @llvm.experimental.constrained.fcmp.f32(float %{{.*}}, float %{{.*}}, metadata !"olt", metadata !"fpexcept.maytrap")
+ return __builtin_isless(f1, f2);
+
+ // CHECK: ret
+}
+
+_Bool QuietLessEqual(float f1, float f2) {
+ // CHECK-LABEL: define {{.*}}i1 @QuietLessEqual(float %f1, float %f2)
+
+ // FCMP: fcmp ole float %{{.*}}, %{{.*}}
+ // IGNORE: call i1 @llvm.experimental.constrained.fcmp.f32(float %{{.*}}, float %{{.*}}, metadata !"ole", metadata !"fpexcept.ignore")
+ // EXCEPT: call i1 @llvm.experimental.constrained.fcmp.f32(float %{{.*}}, float %{{.*}}, metadata !"ole", metadata !"fpexcept.strict")
+ // MAYTRAP: call i1 @llvm.experimental.constrained.fcmp.f32(float %{{.*}}, float %{{.*}}, metadata !"ole", metadata !"fpexcept.maytrap")
+ return __builtin_islessequal(f1, f2);
+
+ // CHECK: ret
+}
+
+_Bool QuietGreater(float f1, float f2) {
+ // CHECK-LABEL: define {{.*}}i1 @QuietGreater(float %f1, float %f2)
+
+ // FCMP: fcmp ogt float %{{.*}}, %{{.*}}
+ // IGNORE: call i1 @llvm.experimental.constrained.fcmp.f32(float %{{.*}}, float %{{.*}}, metadata !"ogt", metadata !"fpexcept.ignore")
+ // EXCEPT: call i1 @llvm.experimental.constrained.fcmp.f32(float %{{.*}}, float %{{.*}}, metadata !"ogt", metadata !"fpexcept.strict")
+ // MAYTRAP: call i1 @llvm.experimental.constrained.fcmp.f32(float %{{.*}}, float %{{.*}}, metadata !"ogt", metadata !"fpexcept.maytrap")
+ return __builtin_isgreater(f1, f2);
+
+ // CHECK: ret
+}
+
+_Bool QuietGreaterEqual(float f1, float f2) {
+ // CHECK-LABEL: define {{.*}}i1 @QuietGreaterEqual(float %f1, float %f2)
+
+ // FCMP: fcmp oge float %{{.*}}, %{{.*}}
+ // IGNORE: call i1 @llvm.experimental.constrained.fcmp.f32(float %{{.*}}, float %{{.*}}, metadata !"oge", metadata !"fpexcept.ignore")
+ // EXCEPT: call i1 @llvm.experimental.constrained.fcmp.f32(float %{{.*}}, float %{{.*}}, metadata !"oge", metadata !"fpexcept.strict")
+ // MAYTRAP: call i1 @llvm.experimental.constrained.fcmp.f32(float %{{.*}}, float %{{.*}}, metadata !"oge", metadata !"fpexcept.maytrap")
+ return __builtin_isgreaterequal(f1, f2);
+
+ // CHECK: ret
+}
+
+_Bool QuietLessGreater(float f1, float f2) {
+ // CHECK-LABEL: define {{.*}}i1 @QuietLessGreater(float %f1, float %f2)
+
+ // FCMP: fcmp one float %{{.*}}, %{{.*}}
+ // IGNORE: call i1 @llvm.experimental.constrained.fcmp.f32(float %{{.*}}, float %{{.*}}, metadata !"one", metadata !"fpexcept.ignore")
+ // EXCEPT: call i1 @llvm.experimental.constrained.fcmp.f32(float %{{.*}}, float %{{.*}}, metadata !"one", metadata !"fpexcept.strict")
+ // MAYTRAP: call i1 @llvm.experimental.constrained.fcmp.f32(float %{{.*}}, float %{{.*}}, metadata !"one", metadata !"fpexcept.maytrap")
+ return __builtin_islessgreater(f1, f2);
+
+ // CHECK: ret
+}
+
+_Bool QuietUnordered(float f1, float f2) {
+ // CHECK-LABEL: define {{.*}}i1 @QuietUnordered(float %f1, float %f2)
+
+ // FCMP: fcmp uno float %{{.*}}, %{{.*}}
+ // IGNORE: call i1 @llvm.experimental.constrained.fcmp.f32(float %{{.*}}, float %{{.*}}, metadata !"uno", metadata !"fpexcept.ignore")
+ // EXCEPT: call i1 @llvm.experimental.constrained.fcmp.f32(float %{{.*}}, float %{{.*}}, metadata !"uno", metadata !"fpexcept.strict")
+ // MAYTRAP: call i1 @llvm.experimental.constrained.fcmp.f32(float %{{.*}}, float %{{.*}}, metadata !"uno", metadata !"fpexcept.maytrap")
+ return __builtin_isunordered(f1, f2);
+
+ // CHECK: ret
+}
+
diff --git a/src/llvm-project/clang/test/CodeGen/fpconstrained.c b/src/llvm-project/clang/test/CodeGen/fpconstrained.c
new file mode 100644
index 0000000..0a890e2
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/fpconstrained.c
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -ftrapping-math -frounding-math -ffp-exception-behavior=strict -emit-llvm -o - %s | FileCheck %s -check-prefix=FPMODELSTRICT
+// RUN: %clang_cc1 -ffp-contract=fast -emit-llvm -o - %s | FileCheck %s -check-prefix=PRECISE
+// RUN: %clang_cc1 -ffast-math -ffp-contract=fast -emit-llvm -o - %s | FileCheck %s -check-prefix=FAST
+// RUN: %clang_cc1 -ffast-math -emit-llvm -o - %s | FileCheck %s -check-prefix=FAST
+// RUN: %clang_cc1 -ffast-math -ffp-contract=fast -ffp-exception-behavior=ignore -emit-llvm -o - %s | FileCheck %s -check-prefix=FAST
+// RUN: %clang_cc1 -ffast-math -ffp-contract=fast -ffp-exception-behavior=strict -emit-llvm -o - %s | FileCheck %s -check-prefix=EXCEPT
+// RUN: %clang_cc1 -ffast-math -ffp-contract=fast -ffp-exception-behavior=maytrap -emit-llvm -o - %s | FileCheck %s -check-prefix=MAYTRAP
+float f0, f1, f2;
+
+void foo() {
+ // CHECK-LABEL: define {{.*}}void @foo()
+
+ // MAYTRAP: llvm.experimental.constrained.fadd.f32(float %{{.*}}, float %{{.*}}, metadata !"round.tonearest", metadata !"fpexcept.maytrap")
+ // EXCEPT: llvm.experimental.constrained.fadd.f32(float %{{.*}}, float %{{.*}}, metadata !"round.tonearest", metadata !"fpexcept.strict")
+ // FPMODELSTRICT: llvm.experimental.constrained.fadd.f32(float %{{.*}}, float %{{.*}}, metadata !"round.dynamic", metadata !"fpexcept.strict")
+ // STRICTEXCEPT: llvm.experimental.constrained.fadd.f32(float %{{.*}}, float %{{.*}}, metadata !"round.dynamic", metadata !"fpexcept.strict")
+ // STRICTNOEXCEPT: llvm.experimental.constrained.fadd.f32(float %{{.*}}, float %{{.*}}, metadata !"round.dynamic", metadata !"fpexcept.ignore")
+ // PRECISE: fadd contract float %{{.*}}, %{{.*}}
+ // FAST: fadd fast
+ f0 = f1 + f2;
+
+ // CHECK: ret
+}
diff --git a/src/llvm-project/clang/test/CodeGen/fpconstrained.cpp b/src/llvm-project/clang/test/CodeGen/fpconstrained.cpp
new file mode 100644
index 0000000..7aa34c9
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/fpconstrained.cpp
@@ -0,0 +1,47 @@
+// RUN: %clang_cc1 -x c++ -ftrapping-math -fexceptions -fcxx-exceptions -frounding-math -ffp-exception-behavior=strict -emit-llvm -o - %s | FileCheck %s -check-prefix=FPMODELSTRICT
+// RUN: %clang_cc1 -x c++ -ffp-contract=fast -fexceptions -fcxx-exceptions -emit-llvm -o - %s | FileCheck %s -check-prefix=PRECISE
+// RUN: %clang_cc1 -x c++ -ffast-math -fexceptions -fcxx-exceptions -ffp-contract=fast -emit-llvm -o - %s | FileCheck %s -check-prefix=FAST
+// RUN: %clang_cc1 -x c++ -ffast-math -fexceptions -fcxx-exceptions -emit-llvm -o - %s | FileCheck %s -check-prefix=FAST
+// RUN: %clang_cc1 -x c++ -ffast-math -fexceptions -fcxx-exceptions -ffp-contract=fast -ffp-exception-behavior=ignore -emit-llvm -o - %s | FileCheck %s -check-prefix=FAST
+// RUN: %clang_cc1 -x c++ -ffast-math -fexceptions -fcxx-exceptions -ffp-contract=fast -ffp-exception-behavior=strict -emit-llvm -o - %s | FileCheck %s -check-prefix=EXCEPT
+// RUN: %clang_cc1 -x c++ -ffast-math -fexceptions -fcxx-exceptions -ffp-contract=fast -ffp-exception-behavior=maytrap -emit-llvm -o - %s | FileCheck %s -check-prefix=MAYTRAP
+float f0, f1, f2;
+
+ template <class>
+ class aaaa {
+ public:
+ ~aaaa();
+ void b();
+ };
+
+ template <class c>
+ aaaa<c>::~aaaa() { try {
+ b();
+ // CHECK-LABEL: define {{.*}}void @_ZN4aaaaIiED2Ev{{.*}}
+
+ } catch (...) {
+ // MAYTRAP: llvm.experimental.constrained.fadd.f32(float %{{.*}}, float %{{.*}}, metadata !"round.tonearest", metadata !"fpexcept.maytrap")
+ // EXCEPT: llvm.experimental.constrained.fadd.f32(float %{{.*}}, float %{{.*}}, metadata !"round.tonearest", metadata !"fpexcept.strict")
+ // FPMODELSTRICT: llvm.experimental.constrained.fadd.f32(float %{{.*}}, float %{{.*}}, metadata !"round.dynamic", metadata !"fpexcept.strict")
+ // STRICTEXCEPT: llvm.experimental.constrained.fadd.f32(float %{{.*}}, float %{{.*}}, metadata !"round.dynamic", metadata !"fpexcept.strict")
+ // STRICTNOEXCEPT: llvm.experimental.constrained.fadd.f32(float %{{.*}}, float %{{.*}}, metadata !"round.dynamic", metadata !"fpexcept.ignore")
+ // PRECISE: fadd contract float %{{.*}}, %{{.*}}
+ // FAST: fadd fast
+ f0 = f1 + f2;
+
+ // CHECK: ret void
+ }
+ }
+
+ class d {
+ public:
+ d(const char *, int);
+ aaaa<int> e;
+ };
+
+float foo() {
+ d x("", 1);
+ aaaa<int> a;
+ return f0;
+}
+
diff --git a/src/llvm-project/clang/test/CodeGen/guard_nocf.c b/src/llvm-project/clang/test/CodeGen/guard_nocf.c
new file mode 100644
index 0000000..2fe5573
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/guard_nocf.c
@@ -0,0 +1,53 @@
+// RUN: %clang_cc1 -triple %ms_abi_triple -fms-extensions -emit-llvm -O2 -o - %s | FileCheck %s
+
+void target_func();
+void (*func_ptr)() = &target_func;
+
+// The "guard_nocf" attribute must be added.
+__declspec(guard(nocf)) void nocf0() {
+ (*func_ptr)();
+}
+// CHECK-LABEL: nocf0
+// CHECK: call{{.*}}[[NOCF:#[0-9]+]]
+
+// The "guard_nocf" attribute must *not* be added.
+void cf0() {
+ (*func_ptr)();
+}
+// CHECK-LABEL: cf0
+// CHECK: call{{.*}}[[CF:#[0-9]+]]
+
+// If the modifier is present on either the function declaration or definition,
+// the "guard_nocf" attribute must be added.
+__declspec(guard(nocf)) void nocf1();
+void nocf1() {
+ (*func_ptr)();
+}
+// CHECK-LABEL: nocf1
+// CHECK: call{{.*}}[[NOCF:#[0-9]+]]
+
+void nocf2();
+__declspec(guard(nocf)) void nocf2() {
+ (*func_ptr)();
+}
+// CHECK-LABEL: nocf2
+// CHECK: call{{.*}}[[NOCF:#[0-9]+]]
+
+// When inlining a function, the "guard_nocf" attribute on indirect calls must
+// be preserved.
+void nocf3() {
+ nocf0();
+}
+// CHECK-LABEL: nocf3
+// CHECK: call{{.*}}[[NOCF:#[0-9]+]]
+
+// When inlining into a function marked as __declspec(guard(nocf)), the
+// "guard_nocf" attribute must *not* be added to the inlined calls.
+__declspec(guard(nocf)) void cf1() {
+ cf0();
+}
+// CHECK-LABEL: cf1
+// CHECK: call{{.*}}[[CF:#[0-9]+]]
+
+// CHECK: attributes [[NOCF]] = { {{.*}}"guard_nocf"{{.*}} }
+// CHECK-NOT: attributes [[CF]] = { {{.*}}"guard_nocf"{{.*}} }
diff --git a/src/llvm-project/clang/test/CodeGen/iamcu-abi.c b/src/llvm-project/clang/test/CodeGen/iamcu-abi.c
index 897d475..6bb73d2 100644
--- a/src/llvm-project/clang/test/CodeGen/iamcu-abi.c
+++ b/src/llvm-project/clang/test/CodeGen/iamcu-abi.c
@@ -1,9 +1,8 @@
// RUN: %clang_cc1 -triple i386-pc-elfiamcu -emit-llvm -o - %s | FileCheck %s
-// CHECK: target datalayout = "e-m:e-p:32:32-i64:32-f64:32-f128:32-n8:16:32-a:0:32-S32"
+// CHECK: target datalayout = "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:32-f64:32-f128:32-n8:16:32-a:0:32-S32"
// CHECK: target triple = "i386-pc-elfiamcu"
-
void food(double *d);
void fooll(long long *ll);
void fooull(unsigned long long *ull);
diff --git a/src/llvm-project/clang/test/CodeGen/inline.c b/src/llvm-project/clang/test/CodeGen/inline.c
index ea6e9d7..b511ece 100644
--- a/src/llvm-project/clang/test/CodeGen/inline.c
+++ b/src/llvm-project/clang/test/CodeGen/inline.c
@@ -52,7 +52,7 @@
// CHECK3-LABEL: define i32 @_Z3barv()
// CHECK3-LABEL: define linkonce_odr i32 @_Z3foov()
// CHECK3-NOT: unreferenced
-// CHECK3-LABEL: define void @_Z10gnu_inlinev()
+// CHECK3-LABEL: define available_externally void @_Z10gnu_inlinev()
// CHECK3-LABEL: define available_externally void @_Z13gnu_ei_inlinev()
// CHECK3-NOT: @_Z5testCv
// CHECK3-LABEL: define linkonce_odr i32 @_Z2eiv()
@@ -85,6 +85,7 @@
extern __inline void unreferenced2() {}
__inline __attribute((__gnu_inline__)) void gnu_inline() {}
+void (*P1)() = gnu_inline;
// PR3988
extern __inline __attribute__((gnu_inline)) void gnu_ei_inline() {}
diff --git a/src/llvm-project/clang/test/CodeGen/integer-overflow.c b/src/llvm-project/clang/test/CodeGen/integer-overflow.c
index 0b28bc5..dd78908 100644
--- a/src/llvm-project/clang/test/CodeGen/integer-overflow.c
+++ b/src/llvm-project/clang/test/CodeGen/integer-overflow.c
@@ -99,8 +99,8 @@
// PR24256: don't instrument __builtin_frame_address.
__builtin_frame_address(0 + 0);
- // DEFAULT: call i8* @llvm.frameaddress(i32 0)
- // WRAPV: call i8* @llvm.frameaddress(i32 0)
- // TRAPV: call i8* @llvm.frameaddress(i32 0)
- // CATCH_UB: call i8* @llvm.frameaddress(i32 0)
+ // DEFAULT: call i8* @llvm.frameaddress.p0i8(i32 0)
+ // WRAPV: call i8* @llvm.frameaddress.p0i8(i32 0)
+ // TRAPV: call i8* @llvm.frameaddress.p0i8(i32 0)
+ // CATCH_UB: call i8* @llvm.frameaddress.p0i8(i32 0)
}
diff --git a/src/llvm-project/clang/test/CodeGen/label-array-aggregate-init.c b/src/llvm-project/clang/test/CodeGen/label-array-aggregate-init.c
new file mode 100644
index 0000000..5cefd8d
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/label-array-aggregate-init.c
@@ -0,0 +1,10 @@
+// RUN: %clang -cc1 -triple x86_64-windows-msvc -emit-llvm %s -o - | FileCheck %s
+
+// CHECK: @constinit = private global [3 x i8*] [i8* blockaddress(@main, %L), i8* null, i8* null]
+
+void receivePtrs(void **);
+
+int main() {
+L:
+ receivePtrs((void *[]){ &&L, 0, 0 });
+}
diff --git a/src/llvm-project/clang/test/CodeGen/libcalls-fno-builtin.c b/src/llvm-project/clang/test/CodeGen/libcalls-fno-builtin.c
index 6fac6ee..54fadb6 100644
--- a/src/llvm-project/clang/test/CodeGen/libcalls-fno-builtin.c
+++ b/src/llvm-project/clang/test/CodeGen/libcalls-fno-builtin.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -S -emit-llvm -fno-builtin -o - %s | FileCheck %s
+// RUN: %clang_cc1 -S -emit-llvm -fno-builtin -o - %s | FileCheck --check-prefixes=GLOBAL,CHECK %s
// RUN: %clang_cc1 -S -emit-llvm -fno-builtin-ceil -fno-builtin-copysign -fno-builtin-cos \
// RUN: -fno-builtin-fabs -fno-builtin-floor -fno-builtin-strcat -fno-builtin-strncat \
// RUN: -fno-builtin-strchr -fno-builtin-strrchr -fno-builtin-strcmp -fno-builtin-strncmp \
@@ -6,7 +6,7 @@
// RUN: -fno-builtin-strpbrk -fno-builtin-strspn -fno-builtin-strtod -fno-builtin-strtof \
// RUN: -fno-builtin-strtold -fno-builtin-strtol -fno-builtin-strtoll -fno-builtin-strtoul \
// RUN: -fno-builtin-strtoull -fno-builtin-fread -fno-builtin-fwrite -fno-builtin-fopen \
-// RUN: -o - %s | FileCheck %s
+// RUN: -o - %s | FileCheck --check-prefixes=INDIVIDUAL,CHECK %s
// RUN: %clang_cc1 -S -O3 -fno-builtin -o - %s | FileCheck --check-prefix=ASM %s
// RUN: %clang_cc1 -S -O3 -fno-builtin-ceil -o - %s | FileCheck --check-prefix=ASM-INDIV %s
@@ -56,108 +56,109 @@
double t2(double x, double y) { return copysign(x,y); }
// CHECK-LABEL: t2
-// CHECK: call{{.*}}@copysign{{.*}} [[ATTR]]
+// CHECK: call{{.*}}@copysign{{.*}} #2
double t3(double x) { return cos(x); }
// CHECK-LABEL: t3
-// CHECK: call{{.*}}@cos{{.*}} [[ATTR]]
+// CHECK: call{{.*}}@cos{{.*}} #2
double t4(double x) { return fabs(x); }
// CHECK-LABEL: t4
-// CHECK: call{{.*}}@fabs{{.*}} [[ATTR]]
+// CHECK: call{{.*}}@fabs{{.*}} #2
double t5(double x) { return floor(x); }
// CHECK-LABEL: t5
-// CHECK: call{{.*}}@floor{{.*}} [[ATTR]]
+// CHECK: call{{.*}}@floor{{.*}} #2
char *t6(char *x) { return strcat(x, ""); }
// CHECK-LABEL: t6
-// CHECK: call{{.*}}@strcat{{.*}} [[ATTR]]
+// CHECK: call{{.*}}@strcat{{.*}} #2
char *t7(char *x) { return strncat(x, "", 1); }
// CHECK-LABEL: t7
-// CHECK: call{{.*}}@strncat{{.*}} [[ATTR]]
+// CHECK: call{{.*}}@strncat{{.*}} #2
char *t8(void) { return strchr("hello, world", 'w'); }
// CHECK-LABEL: t8
-// CHECK: call{{.*}}@strchr{{.*}} [[ATTR]]
+// CHECK: call{{.*}}@strchr{{.*}} #2
char *t9(void) { return strrchr("hello, world", 'w'); }
// CHECK-LABEL: t9
-// CHECK: call{{.*}}@strrchr{{.*}} [[ATTR]]
+// CHECK: call{{.*}}@strrchr{{.*}} #2
int t10(void) { return strcmp("foo", "bar"); }
// CHECK-LABEL: t10
-// CHECK: call{{.*}}@strcmp{{.*}} [[ATTR]]
+// CHECK: call{{.*}}@strcmp{{.*}} #2
int t11(void) { return strncmp("foo", "bar", 3); }
// CHECK-LABEL: t11
-// CHECK: call{{.*}}@strncmp{{.*}} [[ATTR]]
+// CHECK: call{{.*}}@strncmp{{.*}} #2
char *t12(char *x) { return strcpy(x, "foo"); }
// CHECK-LABEL: t12
-// CHECK: call{{.*}}@strcpy{{.*}} [[ATTR]]
+// CHECK: call{{.*}}@strcpy{{.*}} #2
char *t13(char *x) { return stpcpy(x, "foo"); }
// CHECK-LABEL: t13
-// CHECK: call{{.*}}@stpcpy{{.*}} [[ATTR]]
+// CHECK: call{{.*}}@stpcpy{{.*}} #2
char *t14(char *x) { return strncpy(x, "foo", 3); }
// CHECK-LABEL: t14
-// CHECK: call{{.*}}@strncpy{{.*}} [[ATTR]]
+// CHECK: call{{.*}}@strncpy{{.*}} #2
size_t t15(void) { return strlen("foo"); }
// CHECK-LABEL: t15
-// CHECK: call{{.*}}@strlen{{.*}} [[ATTR]]
+// CHECK: call{{.*}}@strlen{{.*}} #2
char *t16(char *x) { return strpbrk(x, ""); }
// CHECK-LABEL: t16
-// CHECK: call{{.*}}@strpbrk{{.*}} [[ATTR]]
+// CHECK: call{{.*}}@strpbrk{{.*}} #2
size_t t17(char *x) { return strspn(x, ""); }
// CHECK-LABEL: t17
-// CHECK: call{{.*}}@strspn{{.*}} [[ATTR]]
+// CHECK: call{{.*}}@strspn{{.*}} #2
double t18(char **x) { return strtod("123.4", x); }
// CHECK-LABEL: t18
-// CHECK: call{{.*}}@strtod{{.*}} [[ATTR]]
+// CHECK: call{{.*}}@strtod{{.*}} #2
float t19(char **x) { return strtof("123.4", x); }
// CHECK-LABEL: t19
-// CHECK: call{{.*}}@strtof{{.*}} [[ATTR]]
+// CHECK: call{{.*}}@strtof{{.*}} #2
long double t20(char **x) { return strtold("123.4", x); }
// CHECK-LABEL: t20
-// CHECK: call{{.*}}@strtold{{.*}} [[ATTR]]
+// CHECK: call{{.*}}@strtold{{.*}} #2
long int t21(char **x) { return strtol("1234", x, 10); }
// CHECK-LABEL: t21
-// CHECK: call{{.*}}@strtol{{.*}} [[ATTR]]
+// CHECK: call{{.*}}@strtol{{.*}} #2
long int t22(char **x) { return strtoll("1234", x, 10); }
// CHECK-LABEL: t22
-// CHECK: call{{.*}}@strtoll{{.*}} [[ATTR]]
+// CHECK: call{{.*}}@strtoll{{.*}} #2
long int t23(char **x) { return strtoul("1234", x, 10); }
// CHECK-LABEL: t23
-// CHECK: call{{.*}}@strtoul{{.*}} [[ATTR]]
+// CHECK: call{{.*}}@strtoul{{.*}} #2
long int t24(char **x) { return strtoull("1234", x, 10); }
// CHECK-LABEL: t24
-// CHECK: call{{.*}}@strtoull{{.*}} [[ATTR]]
+// CHECK: call{{.*}}@strtoull{{.*}} #2
void t25(FILE *fp, int *buf) {
size_t x = fwrite(buf, sizeof(int), 10, fp);
size_t y = fread(buf, sizeof(int), 10, fp);
}
// CHECK-LABEL: t25
-// CHECK: call{{.*}}@fwrite{{.*}} [[ATTR]]
-// CHECK: call{{.*}}@fread{{.*}} [[ATTR]]
+// CHECK: call{{.*}}@fwrite{{.*}} #2
+// CHECK: call{{.*}}@fread{{.*}} #2
FILE *t26(const char *path, const char *mode) {
return fopen(path, mode);
}
// CHECK-LABEL: t26
-// CHECK: call{{.*}}@fopen{{.*}} [[ATTR]]
+// CHECK: call{{.*}}@fopen{{.*}} #2
-// CHECK: [[ATTR]] = { nobuiltin }
+// GLOBAL: #2 = { nobuiltin "no-builtins" }
+// INDIVIDUAL: #2 = { nobuiltin "no-builtin-ceil" "no-builtin-copysign" "no-builtin-cos" "no-builtin-fabs" "no-builtin-floor" "no-builtin-fopen" "no-builtin-fread" "no-builtin-fwrite" "no-builtin-stpcpy" "no-builtin-strcat" "no-builtin-strchr" "no-builtin-strcmp" "no-builtin-strcpy" "no-builtin-strlen" "no-builtin-strncat" "no-builtin-strncmp" "no-builtin-strncpy" "no-builtin-strpbrk" "no-builtin-strrchr" "no-builtin-strspn" "no-builtin-strtod" "no-builtin-strtof" "no-builtin-strtol" "no-builtin-strtold" "no-builtin-strtoll" "no-builtin-strtoul" "no-builtin-strtoull" }
diff --git a/src/llvm-project/clang/test/CodeGen/libcalls.c b/src/llvm-project/clang/test/CodeGen/libcalls.c
index 1b314f7..699dc78 100644
--- a/src/llvm-project/clang/test/CodeGen/libcalls.c
+++ b/src/llvm-project/clang/test/CodeGen/libcalls.c
@@ -124,4 +124,4 @@
}
// CHECK-NO-DAG: attributes [[NUW_RN]] = { nounwind readnone{{.*}} }
-// CHECK-NO-DAG: attributes [[NUW_RNI]] = { nounwind readnone speculatable }
+// CHECK-NO-DAG: attributes [[NUW_RNI]] = { nounwind readnone speculatable willreturn }
diff --git a/src/llvm-project/clang/test/CodeGen/lifetime-asan.c b/src/llvm-project/clang/test/CodeGen/lifetime-asan.c
deleted file mode 100644
index c5f25a2..0000000
--- a/src/llvm-project/clang/test/CodeGen/lifetime-asan.c
+++ /dev/null
@@ -1,21 +0,0 @@
-// RUN: %clang -target x86_64-linux-gnu -S -emit-llvm -o - -O0 %s | FileCheck %s -check-prefix=CHECK-O0
-// RUN: %clang -target x86_64-linux-gnu -S -emit-llvm -o - -O0 \
-// RUN: -fsanitize=address -fsanitize-address-use-after-scope %s | \
-// RUN: FileCheck %s -check-prefix=CHECK-ASAN-USE-AFTER-SCOPE
-
-extern int bar(char *A, int n);
-
-// CHECK-O0-NOT: @llvm.lifetime.start
-int foo(int n) {
- if (n) {
- // CHECK-ASAN-USE-AFTER-SCOPE: @llvm.lifetime.start.p0i8(i64 10, i8* {{.*}})
- char A[10];
- return bar(A, 1);
- // CHECK-ASAN-USE-AFTER-SCOPE: @llvm.lifetime.end.p0i8(i64 10, i8* {{.*}})
- } else {
- // CHECK-ASAN-USE-AFTER-SCOPE: @llvm.lifetime.start.p0i8(i64 20, i8* {{.*}})
- char A[20];
- return bar(A, 2);
- // CHECK-ASAN-USE-AFTER-SCOPE: @llvm.lifetime.end.p0i8(i64 20, i8* {{.*}})
- }
-}
diff --git a/src/llvm-project/clang/test/CodeGen/lifetime-sanitizer.c b/src/llvm-project/clang/test/CodeGen/lifetime-sanitizer.c
new file mode 100644
index 0000000..95fa970
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/lifetime-sanitizer.c
@@ -0,0 +1,27 @@
+// RUN: %clang -target x86_64-linux-gnu -S -emit-llvm -o - -O0 %s | FileCheck %s -check-prefix=CHECK-O0
+// RUN: %clang -target x86_64-linux-gnu -S -emit-llvm -o - -O0 \
+// RUN: -fsanitize=address -fsanitize-address-use-after-scope %s | \
+// RUN: FileCheck %s -check-prefix=LIFETIME
+// RUN: %clang -target x86_64-linux-gnu -S -emit-llvm -o - -O0 \
+// RUN: -fsanitize=memory %s | \
+// RUN: FileCheck %s -check-prefix=LIFETIME
+// RUN: %clang -target aarch64-linux-gnu -S -emit-llvm -o - -O0 \
+// RUN: -fsanitize=hwaddress %s | \
+// RUN: FileCheck %s -check-prefix=LIFETIME
+
+extern int bar(char *A, int n);
+
+// CHECK-O0-NOT: @llvm.lifetime.start
+int foo(int n) {
+ if (n) {
+ // LIFETIME: @llvm.lifetime.start.p0i8(i64 10, i8* {{.*}})
+ char A[10];
+ return bar(A, 1);
+ // LIFETIME: @llvm.lifetime.end.p0i8(i64 10, i8* {{.*}})
+ } else {
+ // LIFETIME: @llvm.lifetime.start.p0i8(i64 20, i8* {{.*}})
+ char A[20];
+ return bar(A, 2);
+ // LIFETIME: @llvm.lifetime.end.p0i8(i64 20, i8* {{.*}})
+ }
+}
diff --git a/src/llvm-project/clang/test/CodeGen/long_double_fp128.cpp b/src/llvm-project/clang/test/CodeGen/long_double_fp128.cpp
index 713a633..dc30767 100644
--- a/src/llvm-project/clang/test/CodeGen/long_double_fp128.cpp
+++ b/src/llvm-project/clang/test/CodeGen/long_double_fp128.cpp
@@ -17,10 +17,10 @@
// Android's gcc and llvm use fp128 for long double.
// NaCl uses double format for long double, but still has separate overloads.
void test(long, float, double, long double, long double _Complex) { }
-// A64: define void @_Z4testlfdgCg(i64, float, double, fp128, { fp128, fp128 }*
-// G64: define void @_Z4testlfdeCe(i64, float, double, x86_fp80, { x86_fp80, x86_fp80 }*
-// P64: define void @_Z4testlfdgCg(i64, float, double, ppc_fp128, ppc_fp128 {{.*}}, ppc_fp128
-// A32: define void @_Z4testlfdeCe(i32, float, double, double, { double, double }*
-// G32: define void @_Z4testlfdeCe(i32, float, double, x86_fp80, { x86_fp80, x86_fp80 }*
-// P32: define void @_Z4testlfdgCg(i32, float, double, ppc_fp128, { ppc_fp128, ppc_fp128 }*
-// N64: define void @_Z4testlfdeCe(i32, float, double, double, double {{.*}}, double
+// A64: define void @_Z4testlfdgCg(i64 %0, float %1, double %2, fp128 %3, { fp128, fp128 }*
+// G64: define void @_Z4testlfdeCe(i64 %0, float %1, double %2, x86_fp80 %3, { x86_fp80, x86_fp80 }*
+// P64: define void @_Z4testlfdgCg(i64 %0, float %1, double %2, ppc_fp128 %3, ppc_fp128 {{.*}}, ppc_fp128
+// A32: define void @_Z4testlfdeCe(i32 %0, float %1, double %2, double %3, { double, double }*
+// G32: define void @_Z4testlfdeCe(i32 %0, float %1, double %2, x86_fp80 %3, { x86_fp80, x86_fp80 }*
+// P32: define void @_Z4testlfdgCg(i32 %0, float %1, double %2, ppc_fp128 %3, { ppc_fp128, ppc_fp128 }*
+// N64: define void @_Z4testlfdeCe(i32 %0, float %1, double %2, double %3, double {{.*}}, double
diff --git a/src/llvm-project/clang/test/CodeGen/loop-info-asan.c b/src/llvm-project/clang/test/CodeGen/loop-info-asan.c
new file mode 100644
index 0000000..86bf405
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/loop-info-asan.c
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 -triple x86_64 -emit-llvm %s -o /dev/null
+
+// This test should not exhibit use-after-free in LoopInfo.
+
+int a() {
+ for (;;)
+ for (;;)
+ for (;;)
+ for (;;)
+ for (;;)
+ for (;;)
+ for (;;)
+ for (;;)
+ for (;;)
+ ;
+}
diff --git a/src/llvm-project/clang/test/CodeGen/memccpy-libcall.c b/src/llvm-project/clang/test/CodeGen/memccpy-libcall.c
new file mode 100644
index 0000000..98e0daf
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/memccpy-libcall.c
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -fno-builtin-memccpy -emit-llvm < %s| FileCheck %s
+
+typedef __SIZE_TYPE__ size_t;
+
+void *memccpy(void *, void const *, int, size_t);
+
+void test13(char *d, char *s, int c, size_t n) {
+ // CHECK: call i8* @memccpy{{.*}} #2
+ memccpy(d, s, c, n);
+}
+
+// CHECK: attributes #2 = { nobuiltin "no-builtin-memccpy" }
diff --git a/src/llvm-project/clang/test/CodeGen/memcpy-no-nobuiltin-if-not-emitted.c b/src/llvm-project/clang/test/CodeGen/memcpy-no-nobuiltin-if-not-emitted.c
new file mode 100644
index 0000000..b4c1376
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/memcpy-no-nobuiltin-if-not-emitted.c
@@ -0,0 +1,25 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -S -emit-llvm -o - %s | FileCheck %s
+//
+// Verifies that clang doesn't mark an inline builtin definition as `nobuiltin`
+// if the builtin isn't emittable.
+
+typedef unsigned long size_t;
+
+// always_inline is used so clang will emit this body. Otherwise, we need >=
+// -O1.
+#define AVAILABLE_EXTERNALLY extern inline __attribute__((always_inline)) \
+ __attribute__((gnu_inline))
+
+AVAILABLE_EXTERNALLY void *memcpy(void *a, const void *b, size_t c) {
+ return __builtin_memcpy(a, b, c);
+}
+
+// CHECK-LABEL: define void @foo
+void foo(void *a, const void *b, size_t c) {
+ // Clang will always _emit_ this as memcpy. LLVM turns it into @llvm.memcpy
+ // later on if optimizations are enabled.
+ // CHECK: call i8* @memcpy
+ memcpy(a, b, c);
+}
+
+// CHECK-NOT: nobuiltin
diff --git a/src/llvm-project/clang/test/CodeGen/memcpy-no-nobuiltin-if-not-emitted.cpp b/src/llvm-project/clang/test/CodeGen/memcpy-no-nobuiltin-if-not-emitted.cpp
new file mode 100644
index 0000000..d27aa9c
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/memcpy-no-nobuiltin-if-not-emitted.cpp
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 -triple i686-linux-gnu -std=c++11 -S -emit-llvm -o - %s | FileCheck %s
+//
+// Regression test for the issue reported at
+// https://reviews.llvm.org/D78162#1986104
+
+typedef unsigned long size_t;
+
+extern "C" __inline__ __attribute__((__gnu_inline__)) void *memcpy(void *a, const void *b, unsigned c) {
+ return __builtin_memcpy(a, b, c);
+}
+void *memcpy(void *, const void *, unsigned);
+
+// CHECK-LABEL: define void @_Z1av
+void a() { (void)memcpy; }
+
+// CHECK-NOT: nobuiltin
diff --git a/src/llvm-project/clang/test/CodeGen/memcpy-nobuiltin.c b/src/llvm-project/clang/test/CodeGen/memcpy-nobuiltin.c
new file mode 100644
index 0000000..fb51d87
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/memcpy-nobuiltin.c
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 -verify -S -emit-llvm -o- %s -isystem %S -DWITH_DECL | FileCheck --check-prefix=CHECK-WITH-DECL %s
+// RUN: %clang_cc1 -verify -S -emit-llvm -o- %s -isystem %S -UWITH_DECL | FileCheck --check-prefix=CHECK-NO-DECL %s
+// RUN: %clang_cc1 -verify -S -emit-llvm -o- %s -isystem %S -DWITH_SELF_REFERENCE_DECL | FileCheck --check-prefix=CHECK-SELF-REF-DECL %s
+//
+// CHECK-WITH-DECL-NOT: @llvm.memcpy
+// CHECK-NO-DECL: @llvm.memcpy
+// CHECK-SELF-REF-DECL: @llvm.memcpy
+//
+#include <memcpy-nobuiltin.inc>
+void test(void *dest, void const *from, size_t n) {
+ memcpy(dest, from, n);
+
+ static char buffer[1];
+ memcpy(buffer, from, 2); // expected-warning {{'memcpy' will always overflow; destination buffer has size 1, but size argument is 2}}
+}
diff --git a/src/llvm-project/clang/test/CodeGen/memcpy-nobuiltin.inc b/src/llvm-project/clang/test/CodeGen/memcpy-nobuiltin.inc
new file mode 100644
index 0000000..25eab0a
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/memcpy-nobuiltin.inc
@@ -0,0 +1,19 @@
+#include <stddef.h>
+extern void *memcpy(void *dest, void const *from, size_t n);
+
+#ifdef WITH_DECL
+inline void *memcpy(void *dest, void const *from, size_t n) {
+ char const *ifrom = from;
+ char *idest = dest;
+ while (n--)
+ *idest++ = *ifrom++;
+ return dest;
+}
+#endif
+#ifdef WITH_SELF_REFERENCE_DECL
+inline void *memcpy(void *dest, void const *from, size_t n) {
+ if (n != 0)
+ memcpy(dest, from, n);
+ return dest;
+}
+#endif
diff --git a/src/llvm-project/clang/test/CodeGen/mempcpy-libcall.c b/src/llvm-project/clang/test/CodeGen/mempcpy-libcall.c
new file mode 100644
index 0000000..1458c85
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/mempcpy-libcall.c
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm < %s| FileCheck %s
+
+typedef __SIZE_TYPE__ size_t;
+
+void *mempcpy(void *, void const *, size_t);
+
+char *test(char *d, char *s, size_t n) {
+ // CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* {{.*}} %[[REG1:[^ ]+]], i8* {{.*}} %1, i64 %[[REG2:[^ ]+]], i1 false)
+ // CHECK-NEXT: %[[REGr:[^ ]+]] = getelementptr inbounds i8, i8* %[[REG1]], i64 %[[REG2]]
+ // CHECK-NEXT: ret i8* %[[REGr]]
+ return mempcpy(d, s, n);
+}
diff --git a/src/llvm-project/clang/test/CodeGen/mingw-long-double.c b/src/llvm-project/clang/test/CodeGen/mingw-long-double.c
index 58f9440..57e4ada 100644
--- a/src/llvm-project/clang/test/CodeGen/mingw-long-double.c
+++ b/src/llvm-project/clang/test/CodeGen/mingw-long-double.c
@@ -32,7 +32,7 @@
return x * x;
}
// GNU32: define dso_local x86_fp80 @TestLD(x86_fp80 %x)
-// GNU64: define dso_local void @TestLD(x86_fp80* noalias sret %agg.result, x86_fp80*)
+// GNU64: define dso_local void @TestLD(x86_fp80* noalias sret %agg.result, x86_fp80* %0)
// MSC64: define dso_local double @TestLD(double %x)
long double _Complex TestLDC(long double _Complex x) {
diff --git a/src/llvm-project/clang/test/CodeGen/mips-vector-arg.c b/src/llvm-project/clang/test/CodeGen/mips-vector-arg.c
index c9eafc9..a429924 100644
--- a/src/llvm-project/clang/test/CodeGen/mips-vector-arg.c
+++ b/src/llvm-project/clang/test/CodeGen/mips-vector-arg.c
@@ -8,18 +8,18 @@
typedef float v4sf __attribute__ ((__vector_size__ (16)));
typedef int v4i32 __attribute__ ((__vector_size__ (16)));
-// O32: define void @test_v4sf(i32 inreg %a1.coerce0, i32 inreg %a1.coerce1, i32 inreg %a1.coerce2, i32 inreg %a1.coerce3, i32 signext %a2, i32, i32 inreg %a3.coerce0, i32 inreg %a3.coerce1, i32 inreg %a3.coerce2, i32 inreg %a3.coerce3) local_unnamed_addr [[NUW:#[0-9]+]]
+// O32: define void @test_v4sf(i32 inreg %a1.coerce0, i32 inreg %a1.coerce1, i32 inreg %a1.coerce2, i32 inreg %a1.coerce3, i32 signext %a2, i32 %0, i32 inreg %a3.coerce0, i32 inreg %a3.coerce1, i32 inreg %a3.coerce2, i32 inreg %a3.coerce3) local_unnamed_addr [[NUW:#[0-9]+]]
// O32: declare i32 @test_v4sf_2(i32 inreg, i32 inreg, i32 inreg, i32 inreg, i32 signext, i32, i32 inreg, i32 inreg, i32 inreg, i32 inreg)
-// N64: define void @test_v4sf(i64 inreg %a1.coerce0, i64 inreg %a1.coerce1, i32 signext %a2, i64, i64 inreg %a3.coerce0, i64 inreg %a3.coerce1) local_unnamed_addr [[NUW:#[0-9]+]]
+// N64: define void @test_v4sf(i64 inreg %a1.coerce0, i64 inreg %a1.coerce1, i32 signext %a2, i64 %0, i64 inreg %a3.coerce0, i64 inreg %a3.coerce1) local_unnamed_addr [[NUW:#[0-9]+]]
// N64: declare signext i32 @test_v4sf_2(i64 inreg, i64 inreg, i32 signext, i64, i64 inreg, i64 inreg)
extern test_v4sf_2(v4sf, int, v4sf);
void test_v4sf(v4sf a1, int a2, v4sf a3) {
test_v4sf_2(a3, a2, a1);
}
-// O32: define void @test_v4i32(i32 inreg %a1.coerce0, i32 inreg %a1.coerce1, i32 inreg %a1.coerce2, i32 inreg %a1.coerce3, i32 signext %a2, i32, i32 inreg %a3.coerce0, i32 inreg %a3.coerce1, i32 inreg %a3.coerce2, i32 inreg %a3.coerce3) local_unnamed_addr [[NUW]]
+// O32: define void @test_v4i32(i32 inreg %a1.coerce0, i32 inreg %a1.coerce1, i32 inreg %a1.coerce2, i32 inreg %a1.coerce3, i32 signext %a2, i32 %0, i32 inreg %a3.coerce0, i32 inreg %a3.coerce1, i32 inreg %a3.coerce2, i32 inreg %a3.coerce3) local_unnamed_addr [[NUW]]
// O32: declare i32 @test_v4i32_2(i32 inreg, i32 inreg, i32 inreg, i32 inreg, i32 signext, i32, i32 inreg, i32 inreg, i32 inreg, i32 inreg)
-// N64: define void @test_v4i32(i64 inreg %a1.coerce0, i64 inreg %a1.coerce1, i32 signext %a2, i64, i64 inreg %a3.coerce0, i64 inreg %a3.coerce1) local_unnamed_addr [[NUW]]
+// N64: define void @test_v4i32(i64 inreg %a1.coerce0, i64 inreg %a1.coerce1, i32 signext %a2, i64 %0, i64 inreg %a3.coerce0, i64 inreg %a3.coerce1) local_unnamed_addr [[NUW]]
// N64: declare signext i32 @test_v4i32_2(i64 inreg, i64 inreg, i32 signext, i64, i64 inreg, i64 inreg)
extern test_v4i32_2(v4i32, int, v4i32);
void test_v4i32(v4i32 a1, int a2, v4i32 a3) {
diff --git a/src/llvm-project/clang/test/CodeGen/mips64-padding-arg.c b/src/llvm-project/clang/test/CodeGen/mips64-padding-arg.c
index 7910734..a7c8f0f 100644
--- a/src/llvm-project/clang/test/CodeGen/mips64-padding-arg.c
+++ b/src/llvm-project/clang/test/CodeGen/mips64-padding-arg.c
@@ -9,7 +9,7 @@
// Insert padding to ensure arguments of type S0 are aligned to 16-byte boundaries.
-// N64-LABEL: define void @foo1(i32 signext %a0, i64, double inreg %a1.coerce0, i64 inreg %a1.coerce1, i64 inreg %a1.coerce2, i64 inreg %a1.coerce3, double inreg %a2.coerce0, i64 inreg %a2.coerce1, i64 inreg %a2.coerce2, i64 inreg %a2.coerce3, i32 signext %b, i64, double inreg %a3.coerce0, i64 inreg %a3.coerce1, i64 inreg %a3.coerce2, i64 inreg %a3.coerce3)
+// N64-LABEL: define void @foo1(i32 signext %a0, i64 %0, double inreg %a1.coerce0, i64 inreg %a1.coerce1, i64 inreg %a1.coerce2, i64 inreg %a1.coerce3, double inreg %a2.coerce0, i64 inreg %a2.coerce1, i64 inreg %a2.coerce2, i64 inreg %a2.coerce3, i32 signext %b, i64 %1, double inreg %a3.coerce0, i64 inreg %a3.coerce1, i64 inreg %a3.coerce2, i64 inreg %a3.coerce3)
// N64: tail call void @foo2(i32 signext 1, i32 signext 2, i32 signext %a0, i64 undef, double inreg %a1.coerce0, i64 inreg %a1.coerce1, i64 inreg %a1.coerce2, i64 inreg %a1.coerce3, double inreg %a2.coerce0, i64 inreg %a2.coerce1, i64 inreg %a2.coerce2, i64 inreg %a2.coerce3, i32 signext 3, i64 undef, double inreg %a3.coerce0, i64 inreg %a3.coerce1, i64 inreg %a3.coerce2, i64 inreg %a3.coerce3)
// N64: declare void @foo2(i32 signext, i32 signext, i32 signext, i64, double inreg, i64 inreg, i64 inreg, i64 inreg, double inreg, i64 inreg, i64 inreg, i64 inreg, i32 signext, i64, double inreg, i64 inreg, i64 inreg, i64 inreg)
@@ -21,7 +21,7 @@
// Insert padding before long double argument.
//
-// N64-LABEL: define void @foo3(i32 signext %a0, i64, fp128 %a1)
+// N64-LABEL: define void @foo3(i32 signext %a0, i64 %0, fp128 %a1)
// N64: tail call void @foo4(i32 signext 1, i32 signext 2, i32 signext %a0, i64 undef, fp128 %a1)
// N64: declare void @foo4(i32 signext, i32 signext, i32 signext, i64, fp128)
@@ -33,7 +33,7 @@
// Insert padding after hidden argument.
//
-// N64-LABEL: define void @foo5(%struct.S0* noalias sret %agg.result, i64, fp128 %a0)
+// N64-LABEL: define void @foo5(%struct.S0* noalias sret %agg.result, i64 %0, fp128 %a0)
// N64: call void @foo6(%struct.S0* sret %agg.result, i32 signext 1, i32 signext 2, i64 undef, fp128 %a0)
// N64: declare void @foo6(%struct.S0* sret, i32 signext, i32 signext, i64, fp128)
diff --git a/src/llvm-project/clang/test/CodeGen/mnop-mcount.c b/src/llvm-project/clang/test/CodeGen/mnop-mcount.c
new file mode 100644
index 0000000..ebb21cc
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/mnop-mcount.c
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -pg -mfentry -mnop-mcount -triple s390x-ibm-linux -emit-llvm \
+// RUN: -o - %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -pg -mnop-mcount -triple s390x-ibm-linux -emit-llvm -o - \
+// RUN: %s 2>&1 | FileCheck -check-prefix=NOMFENTRY %s
+// RUN: %clang_cc1 -mfentry -mnop-mcount -triple s390x-ibm-linux -emit-llvm -o - \
+// RUN: %s 2>&1 | FileCheck -check-prefix=NOPG %s
+// RUN: %clang_cc1 -mnop-mcount -triple s390x-ibm-linux -emit-llvm -o - %s \
+// RUN: 2>&1 | FileCheck -check-prefix=NOPG %s
+
+int foo(void) {
+ return 0;
+}
+
+int __attribute__((no_instrument_function)) no_instrument(void) {
+ return foo();
+}
+
+//CHECK: attributes #0 = { {{.*}}"mnop-mcount"{{.*}} }
+//CHECK: attributes #1 = { {{.*}} }
+//CHECK-NOT: attributes #1 = { {{.*}}"mnop-mcount"{{.*}} }
+//NOMFENTRY: error: option '-mnop-mcount' cannot be specified without '-mfentry'
+//NOPG-NOT: attributes #0 = { {{.*}}"mnop-mcount"{{.*}} }
+//NOPG-NOT: attributes #1 = { {{.*}}"mnop-mcount"{{.*}} }
diff --git a/src/llvm-project/clang/test/CodeGen/mozilla-ms-inline-asm.c b/src/llvm-project/clang/test/CodeGen/mozilla-ms-inline-asm.c
index 0774c8c..210c7f2 100644
--- a/src/llvm-project/clang/test/CodeGen/mozilla-ms-inline-asm.c
+++ b/src/llvm-project/clang/test/CodeGen/mozilla-ms-inline-asm.c
@@ -27,7 +27,7 @@
// CHECK-SAME: sub esp,eax
// CHECK-SAME: mov ecx,esp
// CHECK-SAME: push $0
-// CHECK-SAME: call dword ptr $2
+// CHECK-SAME: call dword ptr ${2:P}
// CHECK-SAME: {{.*}}__MSASMLABEL_.${:uid}__noparams:
// CHECK-SAME: mov ecx,$3
// CHECK-SAME: push ecx
diff --git a/src/llvm-project/clang/test/CodeGen/mrecord-mcount.c b/src/llvm-project/clang/test/CodeGen/mrecord-mcount.c
new file mode 100644
index 0000000..292a807
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/mrecord-mcount.c
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -pg -mfentry -mrecord-mcount -triple s390x-ibm-linux -emit-llvm \
+// RUN: -o - %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -pg -mrecord-mcount -triple s390x-ibm-linux -emit-llvm -o - \
+// RUN: %s 2>&1 | FileCheck -check-prefix=NOMFENTRY %s
+// RUN: %clang_cc1 -mfentry -mrecord-mcount -triple s390x-ibm-linux -emit-llvm -o - \
+// RUN: %s 2>&1 | FileCheck -check-prefix=NOPG %s
+// RUN: %clang_cc1 -mrecord-mcount -triple s390x-ibm-linux -emit-llvm -o - %s \
+// RUN: 2>&1 | FileCheck -check-prefix=NOPG %s
+
+int foo(void) {
+ return 0;
+}
+
+int __attribute__((no_instrument_function)) no_instrument(void) {
+ return foo();
+}
+
+//CHECK: attributes #0 = { {{.*}}"mrecord-mcount"{{.*}} }
+//CHECK: attributes #1 = { {{.*}} }
+//CHECK-NOT: attributes #1 = { {{.*}}"mrecord-mcount"{{.*}} }
+//NOMFENTRY: error: option '-mrecord-mcount' cannot be specified without '-mfentry'
+//NOPG-NOT: attributes #0 = { {{.*}}"mrecord-mcount"{{.*}} }
+//NOPG-NOT: attributes #1 = { {{.*}}"mrecord-mcount"{{.*}} }
diff --git a/src/llvm-project/clang/test/CodeGen/ms-inline-asm-64.c b/src/llvm-project/clang/test/CodeGen/ms-inline-asm-64.c
index 5b144eb..20e8228 100644
--- a/src/llvm-project/clang/test/CodeGen/ms-inline-asm-64.c
+++ b/src/llvm-project/clang/test/CodeGen/ms-inline-asm-64.c
@@ -12,10 +12,10 @@
void t2() {
int var = 10;
- __asm mov [eax], offset var
+ __asm mov qword ptr [eax], offset var
// CHECK: t2
// CHECK: call void asm sideeffect inteldialect
-// CHECK-SAME: mov [eax], $0
+// CHECK-SAME: mov qword ptr [eax], $0
// CHECK-SAME: "r,~{dirflag},~{fpsr},~{flags}"(i32* %{{.*}})
}
@@ -58,3 +58,17 @@
// CHECK-SAME: mov [ebx + $$4], ecx
// CHECK-SAME: "*m,~{eax},~{ebx},~{dirflag},~{fpsr},~{flags}"(%struct.t3_type* %{{.*}})
}
+
+void bar() {}
+
+void t5() {
+ __asm {
+ call bar
+ jmp bar
+ }
+ // CHECK: t5
+ // CHECK: call void asm sideeffect inteldialect
+ // CHECK-SAME: call qword ptr ${0:P}
+ // CHECK-SAME: jmp qword ptr ${1:P}
+ // CHECK-SAME: "*m,*m,~{dirflag},~{fpsr},~{flags}"(void (...)* bitcast (void ()* @bar to void (...)*), void (...)* bitcast (void ()* @bar to void (...)*))
+}
diff --git a/src/llvm-project/clang/test/CodeGen/ms-inline-asm.c b/src/llvm-project/clang/test/CodeGen/ms-inline-asm.c
index edcbaa8..17526f5 100644
--- a/src/llvm-project/clang/test/CodeGen/ms-inline-asm.c
+++ b/src/llvm-project/clang/test/CodeGen/ms-inline-asm.c
@@ -190,14 +190,20 @@
// CHECK: mov eax, $1
__asm mov eax, offset gvar ; eax = address of gvar
// CHECK: mov eax, $2
-// CHECK: "*m,r,r,~{eax},~{dirflag},~{fpsr},~{flags}"(i32* %{{.*}}, i32* %{{.*}}, i32* @{{.*}})
+ __asm mov eax, offset gvar+1 ; eax = 1 + address of gvar
+// CHECK: mov eax, $3 + $$1
+ __asm mov eax, 1+offset gvar ; eax = 1 + address of gvar
+// CHECK: mov eax, $4 + $$1
+ __asm mov eax, 1+offset gvar+1 ; eax = 2 + address of gvar
+// CHECK: mov eax, $5 + $$2
+// CHECK: "*m,r,i,i,i,i,~{eax},~{dirflag},~{fpsr},~{flags}"(i32* %{{.*}}, i32* %{{.*}}, i32* @{{.*}}, i32* @{{.*}}, i32* @{{.*}}, i32* @{{.*}})
}
void t16() {
int var = 10;
- __asm mov [eax], offset var
+ __asm mov dword ptr [eax], offset var
// CHECK: t16
-// CHECK: call void asm sideeffect inteldialect "mov [eax], $0", "r,~{dirflag},~{fpsr},~{flags}"(i32* %{{.*}})
+// CHECK: call void asm sideeffect inteldialect "mov dword ptr [eax], $0", "r,~{dirflag},~{fpsr},~{flags}"(i32* %{{.*}})
}
void t17() {
@@ -306,7 +312,7 @@
void t24() {
__asm call t24_helper
// CHECK: t24
-// CHECK: call void asm sideeffect inteldialect "call dword ptr $0", "*m,~{dirflag},~{fpsr},~{flags}"(void ()* @t24_helper)
+// CHECK: call void asm sideeffect inteldialect "call dword ptr ${0:P}", "*m,~{dirflag},~{fpsr},~{flags}"(void ()* @t24_helper)
}
void t25() {
@@ -592,13 +598,21 @@
}
void t42() {
-// CHECK-LABEL: define void @t42
+// CHECK-LABEL: define void @t42(
int flags;
__asm mov flags, eax
// CHECK: mov $0, eax
// CHECK: "=*m,~{dirflag},~{fpsr},~{flags}"(i32* %flags)
}
+void t42b() {
+// CHECK-LABEL: define void @t42b(
+ int mxcsr;
+ __asm mov mxcsr, eax
+// CHECK: mov $0, eax
+// CHECK: "=*m,~{dirflag},~{fpsr},~{flags}"(i32* %mxcsr)
+}
+
void t43() {
// CHECK-LABEL: define void @t43
C strct;
@@ -681,7 +695,7 @@
void call_clobber() {
__asm call t41
// CHECK-LABEL: define void @call_clobber
- // CHECK: call void asm sideeffect inteldialect "call dword ptr $0", "*m,~{dirflag},~{fpsr},~{flags}"(void (i16)* @t41)
+ // CHECK: call void asm sideeffect inteldialect "call dword ptr ${0:P}", "*m,~{dirflag},~{fpsr},~{flags}"(void (i16)* @t41)
}
void xgetbv() {
@@ -752,7 +766,7 @@
__asm fxrstor buf
}
// CHECK-LABEL: define void @mxcsr
-// CHECK: call void asm sideeffect inteldialect "fxrstor $0", "=*m,~{dirflag},~{fpsr},~{flags}"
+// CHECK: call void asm sideeffect inteldialect "fxrstor $0", "=*m,~{fpcr},~{dirflag},~{fpsr},~{flags}"
// Make sure we can find the register for the dirflag for popfd
void dirflag() {
diff --git a/src/llvm-project/clang/test/CodeGen/ms-inline-asm.cpp b/src/llvm-project/clang/test/CodeGen/ms-inline-asm.cpp
index 039cde9..463ff0f 100644
--- a/src/llvm-project/clang/test/CodeGen/ms-inline-asm.cpp
+++ b/src/llvm-project/clang/test/CodeGen/ms-inline-asm.cpp
@@ -40,7 +40,7 @@
// CHECK: call void asm sideeffect inteldialect
// CHECK-SAME: mov eax, $0
// CHECK-SAME: mov eax, $1
-// CHECK-SAME: "r,r,~{eax},~{dirflag},~{fpsr},~{flags}"(i32** @_ZN3Foo3ptrE, i32** @_ZN3Foo3Bar3ptrE)
+// CHECK-SAME: "i,i,~{eax},~{dirflag},~{fpsr},~{flags}"(i32** @_ZN3Foo3ptrE, i32** @_ZN3Foo3Bar3ptrE)
}
// CHECK-LABEL: define void @_Z2t3v()
@@ -109,7 +109,7 @@
__asm mov x, eax
// CHECK: call void asm sideeffect inteldialect
// CHECK-SAME: push $0
- // CHECK-SAME: call dword ptr $2
+ // CHECK-SAME: call dword ptr ${2:P}
// CHECK-SAME: mov $1, eax
// CHECK-SAME: "=*m,=*m,*m,~{esp},~{dirflag},~{fpsr},~{flags}"(i32* %y, i32* %x, i32 (float)* @_ZN2T5IiE6createIfEEiT_)
}
diff --git a/src/llvm-project/clang/test/CodeGen/ms-intrinsics-other.c b/src/llvm-project/clang/test/CodeGen/ms-intrinsics-other.c
index adc8ac9..33f8115 100644
--- a/src/llvm-project/clang/test/CodeGen/ms-intrinsics-other.c
+++ b/src/llvm-project/clang/test/CodeGen/ms-intrinsics-other.c
@@ -4,6 +4,15 @@
// RUN: %clang_cc1 -ffreestanding -fms-extensions \
// RUN: -triple x86_64--linux -Oz -emit-llvm %s -o - \
// RUN: | FileCheck %s
+// RUN: %clang_cc1 -ffreestanding -fms-extensions \
+// RUN: -triple aarch64--darwin -Oz -emit-llvm %s -o - \
+// RUN: | FileCheck %s --check-prefix=CHECK-ARM-ARM64
+// RUN: %clang_cc1 -ffreestanding -fms-extensions \
+// RUN: -triple aarch64--darwin -Oz -emit-llvm %s -o - \
+// RUN: | FileCheck %s --check-prefix=CHECK-ARM
+// RUN: %clang_cc1 -ffreestanding -fms-extensions \
+// RUN: -triple armv7--darwin -Oz -emit-llvm %s -o - \
+// RUN: | FileCheck %s --check-prefix=CHECK-ARM
// LP64 targets use 'long' as 'int' for MS intrinsics (-fms-extensions)
#ifdef __LP64__
@@ -196,3 +205,214 @@
// CHECK: [[RESULT:%[0-9]+]] = tail call i64 @llvm.ctpop.i64(i64 %x)
// CHECK: ret i64 [[RESULT]]
// CHECK: }
+
+#if defined(__aarch64__)
+LONG test_InterlockedAdd(LONG volatile *Addend, LONG Value) {
+ return _InterlockedAdd(Addend, Value);
+}
+
+// CHECK-ARM-ARM64: define{{.*}}i32 @test_InterlockedAdd(i32*{{[a-z_ ]*}}%Addend, i32 %Value) {{.*}} {
+// CHECK-ARM-ARM64: %[[OLDVAL:[0-9]+]] = atomicrmw add i32* %Addend, i32 %Value seq_cst
+// CHECK-ARM-ARM64: %[[NEWVAL:[0-9]+]] = add i32 %[[OLDVAL:[0-9]+]], %Value
+// CHECK-ARM-ARM64: ret i32 %[[NEWVAL:[0-9]+]]
+#endif
+
+#if defined(__arm__) || defined(__aarch64__)
+LONG test_InterlockedExchangeAdd_acq(LONG volatile *value, LONG mask) {
+ return _InterlockedExchangeAdd_acq(value, mask);
+}
+// CHECK-ARM: define{{.*}}i32 @test_InterlockedExchangeAdd_acq(i32*{{[a-z_ ]*}}%value, i32{{[a-z_ ]*}}%mask){{.*}}{
+// CHECK-ARM: [[RESULT:%[0-9]+]] = atomicrmw add i32* %value, i32 %mask acquire
+// CHECK-ARM: ret i32 [[RESULT:%[0-9]+]]
+// CHECK-ARM: }
+LONG test_InterlockedExchangeAdd_rel(LONG volatile *value, LONG mask) {
+ return _InterlockedExchangeAdd_rel(value, mask);
+}
+// CHECK-ARM: define{{.*}}i32 @test_InterlockedExchangeAdd_rel(i32*{{[a-z_ ]*}}%value, i32{{[a-z_ ]*}}%mask){{.*}}{
+// CHECK-ARM: [[RESULT:%[0-9]+]] = atomicrmw add i32* %value, i32 %mask release
+// CHECK-ARM: ret i32 [[RESULT:%[0-9]+]]
+// CHECK-ARM: }
+LONG test_InterlockedExchangeAdd_nf(LONG volatile *value, LONG mask) {
+ return _InterlockedExchangeAdd_nf(value, mask);
+}
+// CHECK-ARM: define{{.*}}i32 @test_InterlockedExchangeAdd_nf(i32*{{[a-z_ ]*}}%value, i32{{[a-z_ ]*}}%mask){{.*}}{
+// CHECK-ARM: [[RESULT:%[0-9]+]] = atomicrmw add i32* %value, i32 %mask monotonic
+// CHECK-ARM: ret i32 [[RESULT:%[0-9]+]]
+// CHECK-ARM: }
+
+LONG test_InterlockedExchange_acq(LONG volatile *value, LONG mask) {
+ return _InterlockedExchange_acq(value, mask);
+}
+// CHECK-ARM: define{{.*}}i32 @test_InterlockedExchange_acq(i32*{{[a-z_ ]*}}%value, i32{{[a-z_ ]*}}%mask){{.*}}{
+// CHECK-ARM: [[RESULT:%[0-9]+]] = atomicrmw xchg i32* %value, i32 %mask acquire
+// CHECK-ARM: ret i32 [[RESULT:%[0-9]+]]
+// CHECK-ARM: }
+LONG test_InterlockedExchange_rel(LONG volatile *value, LONG mask) {
+ return _InterlockedExchange_rel(value, mask);
+}
+// CHECK-ARM: define{{.*}}i32 @test_InterlockedExchange_rel(i32*{{[a-z_ ]*}}%value, i32{{[a-z_ ]*}}%mask){{.*}}{
+// CHECK-ARM: [[RESULT:%[0-9]+]] = atomicrmw xchg i32* %value, i32 %mask release
+// CHECK-ARM: ret i32 [[RESULT:%[0-9]+]]
+// CHECK-ARM: }
+LONG test_InterlockedExchange_nf(LONG volatile *value, LONG mask) {
+ return _InterlockedExchange_nf(value, mask);
+}
+// CHECK-ARM: define{{.*}}i32 @test_InterlockedExchange_nf(i32*{{[a-z_ ]*}}%value, i32{{[a-z_ ]*}}%mask){{.*}}{
+// CHECK-ARM: [[RESULT:%[0-9]+]] = atomicrmw xchg i32* %value, i32 %mask monotonic
+// CHECK-ARM: ret i32 [[RESULT:%[0-9]+]]
+// CHECK-ARM: }
+
+LONG test_InterlockedCompareExchange_acq(LONG volatile *Destination, LONG Exchange, LONG Comperand) {
+ return _InterlockedCompareExchange_acq(Destination, Exchange, Comperand);
+}
+// CHECK-ARM: define{{.*}}i32 @test_InterlockedCompareExchange_acq(i32*{{[a-z_ ]*}}%Destination, i32{{[a-z_ ]*}}%Exchange, i32{{[a-z_ ]*}}%Comperand){{.*}}{
+// CHECK-ARM: [[TMP:%[0-9]+]] = cmpxchg volatile i32* %Destination, i32 %Comperand, i32 %Exchange acquire acquire
+// CHECK-ARM: [[RESULT:%[0-9]+]] = extractvalue { i32, i1 } [[TMP]], 0
+// CHECK-ARM: ret i32 [[RESULT]]
+// CHECK-ARM: }
+
+LONG test_InterlockedCompareExchange_rel(LONG volatile *Destination, LONG Exchange, LONG Comperand) {
+ return _InterlockedCompareExchange_rel(Destination, Exchange, Comperand);
+}
+// CHECK-ARM: define{{.*}}i32 @test_InterlockedCompareExchange_rel(i32*{{[a-z_ ]*}}%Destination, i32{{[a-z_ ]*}}%Exchange, i32{{[a-z_ ]*}}%Comperand){{.*}}{
+// CHECK-ARM: [[TMP:%[0-9]+]] = cmpxchg volatile i32* %Destination, i32 %Comperand, i32 %Exchange release monotonic
+// CHECK-ARM: [[RESULT:%[0-9]+]] = extractvalue { i32, i1 } [[TMP]], 0
+// CHECK-ARM: ret i32 [[RESULT]]
+// CHECK-ARM: }
+
+LONG test_InterlockedCompareExchange_nf(LONG volatile *Destination, LONG Exchange, LONG Comperand) {
+ return _InterlockedCompareExchange_nf(Destination, Exchange, Comperand);
+}
+// CHECK-ARM: define{{.*}}i32 @test_InterlockedCompareExchange_nf(i32*{{[a-z_ ]*}}%Destination, i32{{[a-z_ ]*}}%Exchange, i32{{[a-z_ ]*}}%Comperand){{.*}}{
+// CHECK-ARM: [[TMP:%[0-9]+]] = cmpxchg volatile i32* %Destination, i32 %Comperand, i32 %Exchange monotonic monotonic
+// CHECK-ARM: [[RESULT:%[0-9]+]] = extractvalue { i32, i1 } [[TMP]], 0
+// CHECK-ARM: ret i32 [[RESULT]]
+// CHECK-ARM: }
+
+LONG test_InterlockedOr_acq(LONG volatile *value, LONG mask) {
+ return _InterlockedOr_acq(value, mask);
+}
+// CHECK-ARM: define{{.*}}i32 @test_InterlockedOr_acq(i32*{{[a-z_ ]*}}%value, i32{{[a-z_ ]*}}%mask){{.*}}{
+// CHECK-ARM: [[RESULT:%[0-9]+]] = atomicrmw or i32* %value, i32 %mask acquire
+// CHECK-ARM: ret i32 [[RESULT:%[0-9]+]]
+// CHECK-ARM: }
+
+LONG test_InterlockedOr_rel(LONG volatile *value, LONG mask) {
+ return _InterlockedOr_rel(value, mask);
+}
+// CHECK-ARM: define{{.*}}i32 @test_InterlockedOr_rel(i32*{{[a-z_ ]*}}%value, i32{{[a-z_ ]*}}%mask){{.*}}{
+// CHECK-ARM: [[RESULT:%[0-9]+]] = atomicrmw or i32* %value, i32 %mask release
+// CHECK-ARM: ret i32 [[RESULT:%[0-9]+]]
+// CHECK-ARM: }
+
+LONG test_InterlockedOr_nf(LONG volatile *value, LONG mask) {
+ return _InterlockedOr_nf(value, mask);
+}
+// CHECK-ARM: define{{.*}}i32 @test_InterlockedOr_nf(i32*{{[a-z_ ]*}}%value, i32{{[a-z_ ]*}}%mask){{.*}}{
+// CHECK-ARM: [[RESULT:%[0-9]+]] = atomicrmw or i32* %value, i32 %mask monotonic
+// CHECK-ARM: ret i32 [[RESULT:%[0-9]+]]
+// CHECK-ARM: }
+
+LONG test_InterlockedXor_acq(LONG volatile *value, LONG mask) {
+ return _InterlockedXor_acq(value, mask);
+}
+// CHECK-ARM: define{{.*}}i32 @test_InterlockedXor_acq(i32*{{[a-z_ ]*}}%value, i32{{[a-z_ ]*}}%mask){{.*}}{
+// CHECK-ARM: [[RESULT:%[0-9]+]] = atomicrmw xor i32* %value, i32 %mask acquire
+// CHECK-ARM: ret i32 [[RESULT:%[0-9]+]]
+// CHECK-ARM: }
+
+LONG test_InterlockedXor_rel(LONG volatile *value, LONG mask) {
+ return _InterlockedXor_rel(value, mask);
+}
+// CHECK-ARM: define{{.*}}i32 @test_InterlockedXor_rel(i32*{{[a-z_ ]*}}%value, i32{{[a-z_ ]*}}%mask){{.*}}{
+// CHECK-ARM: [[RESULT:%[0-9]+]] = atomicrmw xor i32* %value, i32 %mask release
+// CHECK-ARM: ret i32 [[RESULT:%[0-9]+]]
+// CHECK-ARM: }
+
+LONG test_InterlockedXor_nf(LONG volatile *value, LONG mask) {
+ return _InterlockedXor_nf(value, mask);
+}
+// CHECK-ARM: define{{.*}}i32 @test_InterlockedXor_nf(i32*{{[a-z_ ]*}}%value, i32{{[a-z_ ]*}}%mask){{.*}}{
+// CHECK-ARM: [[RESULT:%[0-9]+]] = atomicrmw xor i32* %value, i32 %mask monotonic
+// CHECK-ARM: ret i32 [[RESULT:%[0-9]+]]
+// CHECK-ARM: }
+
+LONG test_InterlockedAnd_acq(LONG volatile *value, LONG mask) {
+ return _InterlockedAnd_acq(value, mask);
+}
+// CHECK-ARM: define{{.*}}i32 @test_InterlockedAnd_acq(i32*{{[a-z_ ]*}}%value, i32{{[a-z_ ]*}}%mask){{.*}}{
+// CHECK-ARM: [[RESULT:%[0-9]+]] = atomicrmw and i32* %value, i32 %mask acquire
+// CHECK-ARM: ret i32 [[RESULT:%[0-9]+]]
+// CHECK-ARM: }
+
+LONG test_InterlockedAnd_rel(LONG volatile *value, LONG mask) {
+ return _InterlockedAnd_rel(value, mask);
+}
+// CHECK-ARM: define{{.*}}i32 @test_InterlockedAnd_rel(i32*{{[a-z_ ]*}}%value, i32{{[a-z_ ]*}}%mask){{.*}}{
+// CHECK-ARM: [[RESULT:%[0-9]+]] = atomicrmw and i32* %value, i32 %mask release
+// CHECK-ARM: ret i32 [[RESULT:%[0-9]+]]
+// CHECK-ARM: }
+
+LONG test_InterlockedAnd_nf(LONG volatile *value, LONG mask) {
+ return _InterlockedAnd_nf(value, mask);
+}
+// CHECK-ARM: define{{.*}}i32 @test_InterlockedAnd_nf(i32*{{[a-z_ ]*}}%value, i32{{[a-z_ ]*}}%mask){{.*}}{
+// CHECK-ARM: [[RESULT:%[0-9]+]] = atomicrmw and i32* %value, i32 %mask monotonic
+// CHECK-ARM: ret i32 [[RESULT:%[0-9]+]]
+// CHECK-ARM: }
+
+
+LONG test_InterlockedIncrement_acq(LONG volatile *Addend) {
+ return _InterlockedIncrement_acq(Addend);
+}
+// CHECK-ARM: define{{.*}}i32 @test_InterlockedIncrement_acq(i32*{{[a-z_ ]*}}%Addend){{.*}}{
+// CHECK-ARM: [[TMP:%[0-9]+]] = atomicrmw add i32* %Addend, i32 1 acquire
+// CHECK-ARM: [[RESULT:%[0-9]+]] = add i32 [[TMP]], 1
+// CHECK-ARM: ret i32 [[RESULT]]
+// CHECK-ARM: }
+
+LONG test_InterlockedIncrement_rel(LONG volatile *Addend) {
+ return _InterlockedIncrement_rel(Addend);
+}
+// CHECK-ARM: define{{.*}}i32 @test_InterlockedIncrement_rel(i32*{{[a-z_ ]*}}%Addend){{.*}}{
+// CHECK-ARM: [[TMP:%[0-9]+]] = atomicrmw add i32* %Addend, i32 1 release
+// CHECK-ARM: [[RESULT:%[0-9]+]] = add i32 [[TMP]], 1
+// CHECK-ARM: ret i32 [[RESULT]]
+// CHECK-ARM: }
+
+LONG test_InterlockedIncrement_nf(LONG volatile *Addend) {
+ return _InterlockedIncrement_nf(Addend);
+}
+// CHECK-ARM: define{{.*}}i32 @test_InterlockedIncrement_nf(i32*{{[a-z_ ]*}}%Addend){{.*}}{
+// CHECK-ARM: [[TMP:%[0-9]+]] = atomicrmw add i32* %Addend, i32 1 monotonic
+// CHECK-ARM: [[RESULT:%[0-9]+]] = add i32 [[TMP]], 1
+// CHECK-ARM: ret i32 [[RESULT]]
+// CHECK-ARM: }
+
+LONG test_InterlockedDecrement_acq(LONG volatile *Addend) {
+ return _InterlockedDecrement_acq(Addend);
+}
+// CHECK-ARM: define{{.*}}i32 @test_InterlockedDecrement_acq(i32*{{[a-z_ ]*}}%Addend){{.*}}{
+// CHECK-ARM: [[TMP:%[0-9]+]] = atomicrmw sub i32* %Addend, i32 1 acquire
+// CHECK-ARM: [[RESULT:%[0-9]+]] = add i32 [[TMP]], -1
+// CHECK-ARM: ret i32 [[RESULT]]
+// CHECK-ARM: }
+
+LONG test_InterlockedDecrement_rel(LONG volatile *Addend) {
+ return _InterlockedDecrement_rel(Addend);
+}
+// CHECK-ARM: define{{.*}}i32 @test_InterlockedDecrement_rel(i32*{{[a-z_ ]*}}%Addend){{.*}}{
+// CHECK-ARM: [[TMP:%[0-9]+]] = atomicrmw sub i32* %Addend, i32 1 release
+// CHECK-ARM: [[RESULT:%[0-9]+]] = add i32 [[TMP]], -1
+// CHECK-ARM: ret i32 [[RESULT]]
+// CHECK-ARM: }
+
+LONG test_InterlockedDecrement_nf(LONG volatile *Addend) {
+ return _InterlockedDecrement_nf(Addend);
+}
+// CHECK-ARM: define{{.*}}i32 @test_InterlockedDecrement_nf(i32*{{[a-z_ ]*}}%Addend){{.*}}{
+// CHECK-ARM: [[TMP:%[0-9]+]] = atomicrmw sub i32* %Addend, i32 1 monotonic
+// CHECK-ARM: [[RESULT:%[0-9]+]] = add i32 [[TMP]], -1
+// CHECK-ARM: ret i32 [[RESULT]]
+// CHECK-ARM: }
+#endif
diff --git a/src/llvm-project/clang/test/CodeGen/ms-intrinsics.c b/src/llvm-project/clang/test/CodeGen/ms-intrinsics.c
index cf41d23..fed789e 100644
--- a/src/llvm-project/clang/test/CodeGen/ms-intrinsics.c
+++ b/src/llvm-project/clang/test/CodeGen/ms-intrinsics.c
@@ -142,7 +142,7 @@
return _AddressOfReturnAddress();
}
// CHECK-INTEL-LABEL: define dso_local i8* @test_AddressOfReturnAddress()
-// CHECK-INTEL: = tail call i8* @llvm.addressofreturnaddress()
+// CHECK-INTEL: = tail call i8* @llvm.addressofreturnaddress.p0i8()
// CHECK-INTEL: ret i8*
#endif
diff --git a/src/llvm-project/clang/test/CodeGen/ms-mixed-ptr-sizes.c b/src/llvm-project/clang/test/CodeGen/ms-mixed-ptr-sizes.c
new file mode 100644
index 0000000..111d29b
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/ms-mixed-ptr-sizes.c
@@ -0,0 +1,51 @@
+// RUN: %clang_cc1 -triple x86_64-windows-msvc -fms-extensions -emit-llvm -O2 \
+// RUN: < %s | FileCheck %s --check-prefixes=X64,CHECK
+// RUN: %clang_cc1 -triple i386-pc-win32 -fms-extensions -emit-llvm -O2 \
+// RUN: < %s | FileCheck %s --check-prefixes=X86,CHECK
+
+struct Foo {
+ int * __ptr32 p32;
+ int * __ptr64 p64;
+};
+void use_foo(struct Foo *f);
+void test_sign_ext(struct Foo *f, int * __ptr32 __sptr i) {
+// X64-LABEL: define dso_local void @test_sign_ext({{.*}}i32 addrspace(270)* %i)
+// X86-LABEL: define dso_local void @test_sign_ext(%struct.Foo* %f, i32* %i)
+// X64: %{{.+}} = addrspacecast i32 addrspace(270)* %i to i32*
+// X86: %{{.+}} = addrspacecast i32* %i to i32 addrspace(272)*
+ f->p64 = i;
+ use_foo(f);
+}
+void test_zero_ext(struct Foo *f, int * __ptr32 __uptr i) {
+// X64-LABEL: define dso_local void @test_zero_ext({{.*}}i32 addrspace(271)* %i)
+// X86-LABEL: define dso_local void @test_zero_ext({{.*}}i32 addrspace(271)* %i)
+// X64: %{{.+}} = addrspacecast i32 addrspace(271)* %i to i32*
+// X86: %{{.+}} = addrspacecast i32 addrspace(271)* %i to i32 addrspace(272)*
+ f->p64 = i;
+ use_foo(f);
+}
+void test_trunc(struct Foo *f, int * __ptr64 i) {
+// X64-LABEL: define dso_local void @test_trunc(%struct.Foo* %f, i32* %i)
+// X86-LABEL: define dso_local void @test_trunc({{.*}}i32 addrspace(272)* %i)
+// X64: %{{.+}} = addrspacecast i32* %i to i32 addrspace(270)*
+// X86: %{{.+}} = addrspacecast i32 addrspace(272)* %i to i32*
+ f->p32 = i;
+ use_foo(f);
+}
+void test_noop(struct Foo *f, int * __ptr32 i) {
+// X64-LABEL: define dso_local void @test_noop({{.*}}i32 addrspace(270)* %i)
+// X86-LABEL: define dso_local void @test_noop({{.*}}i32* %i)
+// X64-NOT: addrspacecast
+// X86-NOT: addrspacecast
+ f->p32 = i;
+ use_foo(f);
+}
+
+void test_other(struct Foo *f, __attribute__((address_space(10))) int *i) {
+// X64-LABEL: define dso_local void @test_other({{.*}}i32 addrspace(10)* %i)
+// X86-LABEL: define dso_local void @test_other({{.*}}i32 addrspace(10)* %i)
+// X64: %{{.+}} = addrspacecast i32 addrspace(10)* %i to i32 addrspace(270)*
+// X86: %{{.+}} = addrspacecast i32 addrspace(10)* %i to i32*
+ f->p32 = (int * __ptr32)i;
+ use_foo(f);
+}
diff --git a/src/llvm-project/clang/test/CodeGen/ms-setjmp.c b/src/llvm-project/clang/test/CodeGen/ms-setjmp.c
index 5df9ce5..d1edf3a 100644
--- a/src/llvm-project/clang/test/CodeGen/ms-setjmp.c
+++ b/src/llvm-project/clang/test/CodeGen/ms-setjmp.c
@@ -20,12 +20,12 @@
// I386-NEXT: ret i32 %[[call]]
// X64-LABEL: define dso_local i32 @test_setjmp
- // X64: %[[addr:.*]] = call i8* @llvm.frameaddress(i32 0)
+ // X64: %[[addr:.*]] = call i8* @llvm.frameaddress.p0i8(i32 0)
// X64: %[[call:.*]] = call i32 @_setjmp(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @jb, i64 0, i64 0), i8* %[[addr]])
// X64-NEXT: ret i32 %[[call]]
// AARCH64-LABEL: define dso_local i32 @test_setjmp
- // AARCH64: %[[addr:.*]] = call i8* @llvm.sponentry()
+ // AARCH64: %[[addr:.*]] = call i8* @llvm.sponentry.p0i8()
// AARCH64: %[[call:.*]] = call i32 @_setjmpex(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @jb, i64 0, i64 0), i8* %[[addr]])
// AARCH64-NEXT: ret i32 %[[call]]
}
@@ -33,12 +33,12 @@
int test_setjmpex() {
return _setjmpex(jb);
// X64-LABEL: define dso_local i32 @test_setjmpex
- // X64: %[[addr:.*]] = call i8* @llvm.frameaddress(i32 0)
+ // X64: %[[addr:.*]] = call i8* @llvm.frameaddress.p0i8(i32 0)
// X64: %[[call:.*]] = call i32 @_setjmpex(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @jb, i64 0, i64 0), i8* %[[addr]])
// X64-NEXT: ret i32 %[[call]]
// AARCH64-LABEL: define dso_local i32 @test_setjmpex
- // AARCH64: %[[addr:.*]] = call i8* @llvm.sponentry()
+ // AARCH64: %[[addr:.*]] = call i8* @llvm.sponentry.p0i8()
// AARCH64: %[[call:.*]] = call i32 @_setjmpex(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @jb, i64 0, i64 0), i8* %[[addr]])
// AARCH64-NEXT: ret i32 %[[call]]
}
diff --git a/src/llvm-project/clang/test/CodeGen/msp430-fp-elim.c b/src/llvm-project/clang/test/CodeGen/msp430-fp-elim.c
index c022ade..194a84b 100644
--- a/src/llvm-project/clang/test/CodeGen/msp430-fp-elim.c
+++ b/src/llvm-project/clang/test/CodeGen/msp430-fp-elim.c
@@ -1,5 +1,5 @@
// REQUIRES: msp430-registered-target
-// RUN: %clang_cc1 -mdisable-fp-elim -triple msp430 -S %s -o - | FileCheck %s --check-prefix=FP_ENFORCED
+// RUN: %clang_cc1 -mframe-pointer=all -triple msp430 -S %s -o - | FileCheck %s --check-prefix=FP_ENFORCED
// RUN: %clang_cc1 -triple msp430 -S %s -o - | FileCheck %s --check-prefix=FP_DEFAULT
// Check the frame pointer is not used on MSP430 by default, but can be forcibly turned on.
diff --git a/src/llvm-project/clang/test/CodeGen/no-builtin.cpp b/src/llvm-project/clang/test/CodeGen/no-builtin.cpp
new file mode 100644
index 0000000..24df100
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/no-builtin.cpp
@@ -0,0 +1,65 @@
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -S -emit-llvm -o - %s | FileCheck %s
+// UNSUPPORTED: ppc64be
+
+// CHECK-LABEL: define void @foo_no_mempcy() #0
+extern "C" void foo_no_mempcy() __attribute__((no_builtin("memcpy"))) {}
+
+// CHECK-LABEL: define void @foo_no_mempcy_twice() #0
+extern "C" void foo_no_mempcy_twice() __attribute__((no_builtin("memcpy"))) __attribute__((no_builtin("memcpy"))) {}
+
+// CHECK-LABEL: define void @foo_no_builtins() #1
+extern "C" void foo_no_builtins() __attribute__((no_builtin)) {}
+
+// CHECK-LABEL: define void @foo_no_mempcy_memset() #2
+extern "C" void foo_no_mempcy_memset() __attribute__((no_builtin("memset", "memcpy"))) {}
+
+// CHECK-LABEL: define void @separate_attrs() #2
+extern "C" void separate_attrs() __attribute__((no_builtin("memset"))) __attribute__((no_builtin("memcpy"))) {}
+
+// CHECK-LABEL: define void @separate_attrs_ordering() #2
+extern "C" void separate_attrs_ordering() __attribute__((no_builtin("memcpy"))) __attribute__((no_builtin("memset"))) {}
+
+struct A {
+ virtual int foo() const __attribute__((no_builtin("memcpy"))) { return 1; }
+ virtual ~A();
+};
+
+struct B : public A {
+ int foo() const override __attribute__((no_builtin("memmove"))) { return 2; }
+ virtual ~B();
+};
+
+// CHECK-LABEL: define void @call_a_foo(%struct.A* %a) #3
+extern "C" void call_a_foo(A *a) {
+ // CHECK: %call = call i32 %2(%struct.A* %0)
+ a->foo(); // virtual call is not annotated
+}
+
+// CHECK-LABEL: define void @call_b_foo(%struct.B* %b) #3
+extern "C" void call_b_foo(B *b) {
+ // CHECK: %call = call i32 %2(%struct.B* %0)
+ b->foo(); // virtual call is not annotated
+}
+
+// CHECK-LABEL: define void @call_foo_no_mempcy() #3
+extern "C" void call_foo_no_mempcy() {
+ // CHECK: call void @foo_no_mempcy() #6
+ foo_no_mempcy(); // call gets annotated with "no-builtin-memcpy"
+}
+
+A::~A() {} // Anchoring A so A::foo() gets generated
+B::~B() {} // Anchoring B so B::foo() gets generated
+
+// CHECK-LABEL: define linkonce_odr i32 @_ZNK1A3fooEv(%struct.A* %this) unnamed_addr #0 comdat align 2
+// CHECK-LABEL: define linkonce_odr i32 @_ZNK1B3fooEv(%struct.B* %this) unnamed_addr #5 comdat align 2
+
+// CHECK: attributes #0 = {{{.*}}"no-builtin-memcpy"{{.*}}}
+// CHECK-NOT: attributes #0 = {{{.*}}"no-builtin-memmove"{{.*}}}
+// CHECK-NOT: attributes #0 = {{{.*}}"no-builtin-memset"{{.*}}}
+// CHECK: attributes #1 = {{{.*}}"no-builtins"{{.*}}}
+// CHECK: attributes #2 = {{{.*}}"no-builtin-memcpy"{{.*}}"no-builtin-memset"{{.*}}}
+// CHECK-NOT: attributes #2 = {{{.*}}"no-builtin-memmove"{{.*}}}
+// CHECK: attributes #5 = {{{.*}}"no-builtin-memmove"{{.*}}}
+// CHECK-NOT: attributes #5 = {{{.*}}"no-builtin-memcpy"{{.*}}}
+// CHECK-NOT: attributes #5 = {{{.*}}"no-builtin-memset"{{.*}}}
+// CHECK: attributes #6 = { "no-builtin-memcpy" }
diff --git a/src/llvm-project/clang/test/CodeGen/opt-record-1.c b/src/llvm-project/clang/test/CodeGen/opt-record-1.c
new file mode 100644
index 0000000..be83647
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/opt-record-1.c
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -target-cpu x86-64 %s -O3 -opt-record-file=t1.opt -fopenmp -emit-llvm-bc -o %t.bc
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -target-cpu x86-64 -O3 -x ir %t.bc -opt-record-file %t.opt -fopenmp -emit-obj
+// RUN: cat %t.opt | FileCheck -check-prefix=CHECK %s
+// REQUIRES: x86-registered-target
+
+void foo(int *a, int *b, int *c) {
+#pragma omp parallel for
+ for (int i = 0; i < 100; i++) {
+ a[i] = b[i] + c[i];
+ }
+}
+
+// CHECK: --- !Missed
+// CHECK: Pass: inline
+// CHECK: Name: NoDefinition
+// CHECK: Function: foo
diff --git a/src/llvm-project/clang/test/CodeGen/packed-stack.c b/src/llvm-project/clang/test/CodeGen/packed-stack.c
new file mode 100644
index 0000000..eaf00a7
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/packed-stack.c
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -mpacked-stack -triple s390x-ibm-linux -emit-llvm \
+// RUN: -o - %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -mpacked-stack -triple x86_64-linux-gnu \
+// RUN: -emit-llvm -o - %s 2>&1 | FileCheck -check-prefix=X86 %s
+
+int foo(void) {
+ return 0;
+}
+
+//CHECK: attributes #0 = { {{.*}}"packed-stack" {{.*}} }
+//X86: error: option '-mpacked-stack' cannot be specified on this target
diff --git a/src/llvm-project/clang/test/CodeGen/pass-object-size.c b/src/llvm-project/clang/test/CodeGen/pass-object-size.c
index 80c0a75..30c5e5f 100644
--- a/src/llvm-project/clang/test/CodeGen/pass-object-size.c
+++ b/src/llvm-project/clang/test/CodeGen/pass-object-size.c
@@ -11,49 +11,49 @@
int gi = 0;
-// CHECK-LABEL: define i32 @ObjectSize0(i8* %{{.*}}, i64)
+// CHECK-LABEL: define i32 @ObjectSize0(i8* %{{.*}}, i64 %0)
int ObjectSize0(void *const p PS(0)) {
// CHECK-NOT: @llvm.objectsize
return __builtin_object_size(p, 0);
}
-// CHECK-LABEL: define i32 @DynamicObjectSize0(i8* %{{.*}}, i64)
+// CHECK-LABEL: define i32 @DynamicObjectSize0(i8* %{{.*}}, i64 %0)
int DynamicObjectSize0(void *const p PDS(0)) {
// CHECK-NOT: @llvm.objectsize
return __builtin_dynamic_object_size(p, 0);
}
-// CHECK-LABEL: define i32 @ObjectSize1(i8* %{{.*}}, i64)
+// CHECK-LABEL: define i32 @ObjectSize1(i8* %{{.*}}, i64 %0)
int ObjectSize1(void *const p PS(1)) {
// CHECK-NOT: @llvm.objectsize
return __builtin_object_size(p, 1);
}
-// CHECK-LABEL: define i32 @DynamicObjectSize1(i8* %{{.*}}, i64)
+// CHECK-LABEL: define i32 @DynamicObjectSize1(i8* %{{.*}}, i64 %0)
int DynamicObjectSize1(void *const p PDS(1)) {
// CHECK-NOT: @llvm.objectsize
return __builtin_dynamic_object_size(p, 1);
}
-// CHECK-LABEL: define i32 @ObjectSize2(i8* %{{.*}}, i64)
+// CHECK-LABEL: define i32 @ObjectSize2(i8* %{{.*}}, i64 %0)
int ObjectSize2(void *const p PS(2)) {
// CHECK-NOT: @llvm.objectsize
return __builtin_object_size(p, 2);
}
-// CHECK-LABEL: define i32 @DynamicObjectSize2(i8* %{{.*}}, i64)
+// CHECK-LABEL: define i32 @DynamicObjectSize2(i8* %{{.*}}, i64 %0)
int DynamicObjectSize2(void *const p PDS(2)) {
// CHECK-NOT: @llvm.objectsize
return __builtin_object_size(p, 2);
}
-// CHECK-LABEL: define i32 @ObjectSize3(i8* %{{.*}}, i64)
+// CHECK-LABEL: define i32 @ObjectSize3(i8* %{{.*}}, i64 %0)
int ObjectSize3(void *const p PS(3)) {
// CHECK-NOT: @llvm.objectsize
return __builtin_object_size(p, 3);
}
-// CHECK-LABEL: define i32 @DynamicObjectSize3(i8* %{{.*}}, i64)
+// CHECK-LABEL: define i32 @DynamicObjectSize3(i8* %{{.*}}, i64 %0)
int DynamicObjectSize3(void *const p PDS(3)) {
// CHECK-NOT: @llvm.objectsize
return __builtin_object_size(p, 3);
diff --git a/src/llvm-project/clang/test/CodeGen/patchable-function-entry.c b/src/llvm-project/clang/test/CodeGen/patchable-function-entry.c
new file mode 100644
index 0000000..f41f12d
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/patchable-function-entry.c
@@ -0,0 +1,36 @@
+// RUN: %clang_cc1 -triple aarch64 -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64 -emit-llvm %s -fpatchable-function-entry=1 -o - | FileCheck --check-prefixes=CHECK,OPT %s
+
+// CHECK: define void @f0() #0
+__attribute__((patchable_function_entry(0))) void f0() {}
+
+// CHECK: define void @f00() #0
+__attribute__((patchable_function_entry(0, 0))) void f00() {}
+
+// CHECK: define void @f2() #1
+__attribute__((patchable_function_entry(2))) void f2() {}
+
+// CHECK: define void @f20() #1
+__attribute__((patchable_function_entry(2, 0))) void f20() {}
+
+// CHECK: define void @f20decl() #1
+__attribute__((patchable_function_entry(2, 0))) void f20decl();
+void f20decl() {}
+
+// CHECK: define void @f44() #2
+__attribute__((patchable_function_entry(4, 4))) void f44() {}
+
+// CHECK: define void @f52() #3
+__attribute__((patchable_function_entry(5, 2))) void f52() {}
+
+// OPT: define void @f() #4
+void f() {}
+
+/// No need to emit "patchable-function-entry"="0"
+// CHECK: attributes #0 = { {{.*}}
+// CHECK-NOT: "patchable-function-entry"
+
+// CHECK: attributes #1 = { {{.*}} "patchable-function-entry"="2"
+// CHECK: attributes #2 = { {{.*}} "patchable-function-entry"="0" "patchable-function-prefix"="4"
+// CHECK: attributes #3 = { {{.*}} "patchable-function-entry"="3" "patchable-function-prefix"="2"
+// OPT: attributes #4 = { {{.*}} "patchable-function-entry"="1"
diff --git a/src/llvm-project/clang/test/CodeGen/pch-dllexport.cpp b/src/llvm-project/clang/test/CodeGen/pch-dllexport.cpp
index b8db075..df705f0 100644
--- a/src/llvm-project/clang/test/CodeGen/pch-dllexport.cpp
+++ b/src/llvm-project/clang/test/CodeGen/pch-dllexport.cpp
@@ -83,7 +83,7 @@
// PCHWITHOBJ: define weak_odr dso_local dllexport void @"??$explicitInstantiationDef@H@@YAXH@Z"
template void __declspec(dllexport) explicitInstantiationDefAfterDecl<int>(int);
-// PCHWITHOBJ: define weak_odr dso_local dllexport void @"??$explicitInstantiationDefAfterDecl@H@@YAXH@Z"(i32)
+// PCHWITHOBJ: define weak_odr dso_local dllexport void @"??$explicitInstantiationDefAfterDecl@H@@YAXH@Z"(i32 %0)
template int __declspec(dllexport) variableTemplate<int>;
// PCHWITHOBJVARS: @"??$variableTemplate@H@@3HA" = weak_odr dso_local dllexport global
diff --git a/src/llvm-project/clang/test/CodeGen/ppc-emmintrin.c b/src/llvm-project/clang/test/CodeGen/ppc-emmintrin.c
index 87cee18..631b6c9 100644
--- a/src/llvm-project/clang/test/CodeGen/ppc-emmintrin.c
+++ b/src/llvm-project/clang/test/CodeGen/ppc-emmintrin.c
@@ -2,9 +2,9 @@
// REQUIRES: powerpc-registered-target
// RUN: %clang -S -emit-llvm -target powerpc64-unknown-linux-gnu -mcpu=pwr8 -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
-// RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt | FileCheck %s --check-prefixes=CHECK,CHECK-BE
+// RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt -n | FileCheck %s --check-prefixes=CHECK,CHECK-BE
// RUN: %clang -S -emit-llvm -target powerpc64le-unknown-linux-gnu -mcpu=pwr8 -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
-// RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt | FileCheck %s --check-prefixes=CHECK,CHECK-LE
+// RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt -n | FileCheck %s --check-prefixes=CHECK,CHECK-LE
// CHECK-BE-DAG: @_mm_movemask_pd.perm_mask = internal constant <4 x i32> <i32 -2139062144, i32 -2139062144, i32 -2139062144, i32 -2139078656>, align 16
// CHECK-BE-DAG: @_mm_shuffle_epi32.permute_selectors = internal constant [4 x i32] [i32 66051, i32 67438087, i32 134810123, i32 202182159], align 4
@@ -231,7 +231,9 @@
// CHECK-NEXT: br i1 [[REG147]], label %[[REG148:[0-9a-zA-Z_%.]+]], label %[[REG149:[0-9a-zA-Z_%.]+]]
// CHECK: [[REG148]]:
-// CHECK-LE-NEXT: br i1 false, label %[[REG150:[0-9a-zA-Z_%.]+]], label %[[REG151:[0-9a-zA-Z_%.]+]]
+// CHECK-LE-NEXT: load
+// CHECK-LE-NEXT: call i1 @llvm.is.constant
+// CHECK-LE-NEXT: br i1 %[[REG1896a:[0-9a-zA-Z_%.]+]], label %[[REG150:[0-9a-zA-Z_%.]+]], label %[[REG151:[0-9a-zA-Z_%.]+]]
// CHECK-LE: [[REG150]]:
// CHECK-LE: [[REG152:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG143]], align 16
// CHECK-LE-NEXT: [[REG153:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG152]] to <16 x i8>
@@ -2326,7 +2328,9 @@
// CHECK-NEXT: br i1 [[REG1559]], label %[[REG1560:[0-9a-zA-Z_%.]+]], label %[[REG1557:[0-9a-zA-Z_%.]+]]
// CHECK: [[REG1560]]:
-// CHECK-NEXT: br i1 false, label %[[REG1561:[0-9a-zA-Z_%.]+]], label %[[REG1562:[0-9a-zA-Z_%.]+]]
+// CHECK-NEXT: load
+// CHECK-NEXT: call i1 @llvm.is.constant
+// CHECK-NEXT: br i1 %[[REG1561a:[0-9a-zA-Z_%.]+]], label %[[REG1561:[0-9a-zA-Z_%.]+]], label %[[REG1562:[0-9a-zA-Z_%.]+]]
// CHECK: [[REG1561]]:
// CHECK-NEXT: [[REG1563:[0-9a-zA-Z_%.]+]] = load i32, i32* [[REG1552]], align 4
@@ -2369,7 +2373,9 @@
// CHECK-NEXT: br i1 [[REG1587]], label %[[REG1588:[0-9a-zA-Z_%.]+]], label %[[REG1585:[0-9a-zA-Z_%.]+]]
// CHECK: [[REG1588]]:
-// CHECK-NEXT: br i1 false, label %[[REG1589:[0-9a-zA-Z_%.]+]], label %[[REG1590:[0-9a-zA-Z_%.]+]]
+// CHECK-NEXT: load
+// CHECK-NEXT: call i1 @llvm.is.constant
+// CHECK-NEXT: br i1 %{{[0-9a-zA-Z_%.]+}}, label %[[REG1589:[0-9a-zA-Z_%.]+]], label %[[REG1590:[0-9a-zA-Z_%.]+]]
// CHECK: [[REG1589]]:
// CHECK-NEXT: [[REG1591:[0-9a-zA-Z_%.]+]] = load i32, i32* [[REG1580]], align 4
@@ -2416,7 +2422,9 @@
// CHECK-NEXT: br i1 [[REG1617]], label %[[REG1618:[0-9a-zA-Z_%.]+]], label %[[REG1615:[0-9a-zA-Z_%.]+]]
// CHECK: [[REG1618]]:
-// CHECK-NEXT: br i1 false, label %[[REG1619:[0-9a-zA-Z_%.]+]], label %[[REG1620:[0-9a-zA-Z_%.]+]]
+// CHECK-NEXT: load
+// CHECK-NEXT: call i1 @llvm.is.constant
+// CHECK-NEXT: br i1 %{{[0-9a-zA-Z_%.]+}}, label %[[REG1619:[0-9a-zA-Z_%.]+]], label %[[REG1620:[0-9a-zA-Z_%.]+]]
// CHECK: [[REG1619]]:
// CHECK-NEXT: [[REG1621:[0-9a-zA-Z_%.]+]] = load i32, i32* [[REG1610]], align 4
@@ -2563,7 +2571,9 @@
// CHECK-NEXT: br i1 [[REG1712]], label %[[REG1713:[0-9a-zA-Z_%.]+]], label %[[REG1714:[0-9a-zA-Z_%.]+]]
// CHECK: [[REG1713]]:
-// CHECK-NEXT: br i1 false, label %[[REG1715:[0-9a-zA-Z_%.]+]], label %[[REG1716:[0-9a-zA-Z_%.]+]]
+// CHECK-NEXT: load
+// CHECK-NEXT: call i1 @llvm.is.constant
+// CHECK-NEXT: br i1 %[[REG1715a:[0-9a-zA-Z_%.]+]], label %[[REG1715:[0-9a-zA-Z_%.]+]], label %[[REG1716:[0-9a-zA-Z_%.]+]]
// CHECK: [[REG1715]]:
// CHECK-NEXT: [[REG1717:[0-9a-zA-Z_%.]+]] = load i32, i32* [[REG1709]], align 4
@@ -2601,7 +2611,9 @@
// CHECK-NEXT: br i1 [[REG1737]], label %[[REG1738:[0-9a-zA-Z_%.]+]], label %[[REG1739:[0-9a-zA-Z_%.]+]]
// CHECK: [[REG1738]]:
-// CHECK-NEXT: br i1 false, label %[[REG1740:[0-9a-zA-Z_%.]+]], label %[[REG1741:[0-9a-zA-Z_%.]+]]
+// CHECK-NEXT: load
+// CHECK-NEXT: call i1 @llvm.is.constant
+// CHECK-NEXT: br i1 %[[REG1738:[0-9a-zA-Z_%.]+]], label %[[REG1740:[0-9a-zA-Z_%.]+]], label %[[REG1741:[0-9a-zA-Z_%.]+]]
// CHECK: [[REG1740]]:
// CHECK-NEXT: [[REG1742:[0-9a-zA-Z_%.]+]] = load i32, i32* [[REG1734]], align 4
@@ -2741,7 +2753,9 @@
// CHECK-NEXT: [[REG1837:[0-9a-zA-Z_%.]+]] = icmp slt i32 [[REG1836]], 16
// CHECK-NEXT: br i1 [[REG1837]], label %[[REG1838:[0-9a-zA-Z_%.]+]], label %[[REG1839:[0-9a-zA-Z_%.]+]]
// CHECK: [[REG1838]]:
-// CHECK-NEXT: br i1 false, label %[[REG1840:[0-9a-zA-Z_%.]+]], label %[[REG1841:[0-9a-zA-Z_%.]+]]
+// CHECK-NEXT: load
+// CHECK-NEXT: call i1 @llvm.is.constant
+// CHECK-NEXT: br i1 %[[REG1838a:[0-9a-zA-Z_%.]+]], label %[[REG1840:[0-9a-zA-Z_%.]+]], label %[[REG1841:[0-9a-zA-Z_%.]+]]
// CHECK: [[REG1840]]:
// CHECK-NEXT: [[REG1842:[0-9a-zA-Z_%.]+]] = load i32, i32* [[REG1834]], align 4
// CHECK-NEXT: [[REG1843:[0-9a-zA-Z_%.]+]] = trunc i32 [[REG1842]] to i8
@@ -2775,7 +2789,9 @@
// CHECK-NEXT: br i1 [[REG1862]], label %[[REG1863:[0-9a-zA-Z_%.]+]], label %[[REG1864:[0-9a-zA-Z_%.]+]]
// CHECK: [[REG1863]]:
-// CHECK-NEXT: br i1 false, label %[[REG1865:[0-9a-zA-Z_%.]+]], label %[[REG1866:[0-9a-zA-Z_%.]+]]
+// CHECK-NEXT: load
+// CHECK-NEXT: call i1 @llvm.is.constant
+// CHECK-NEXT: br i1 %[[REG1865a:[0-9a-zA-Z_%.]+]], label %[[REG1865:[0-9a-zA-Z_%.]+]], label %[[REG1866:[0-9a-zA-Z_%.]+]]
// CHECK: [[REG1865]]:
// CHECK-NEXT: [[REG1867:[0-9a-zA-Z_%.]+]] = load i32, i32* [[REG1859]], align 4
@@ -2826,7 +2842,9 @@
// CHECK-NEXT: br i1 [[REG1893]], label %[[REG1894:[0-9a-zA-Z_%.]+]], label %[[REG1895:[0-9a-zA-Z_%.]+]]
// CHECK: [[REG1894]]:
-// CHECK-NEXT: br i1 false, label %[[REG1896:[0-9a-zA-Z_%.]+]], label %[[REG1897:[0-9a-zA-Z_%.]+]]
+// CHECK-NEXT: load
+// CHECK-NEXT: call i1 @llvm.is.constant
+// CHECK-NEXT: br i1 %[[REG1896a:[0-9a-zA-Z_%.]+]], label %[[REG1896:[0-9a-zA-Z_%.]+]], label %[[REG1897:[0-9a-zA-Z_%.]+]]
// CHECK: [[REG1896]]:
// CHECK-NEXT: [[REG1898:[0-9a-zA-Z_%.]+]] = load i32, i32* [[REG1890]], align 4
diff --git a/src/llvm-project/clang/test/CodeGen/ppc-mmintrin.c b/src/llvm-project/clang/test/CodeGen/ppc-mmintrin.c
index 0196728..0a43f32 100644
--- a/src/llvm-project/clang/test/CodeGen/ppc-mmintrin.c
+++ b/src/llvm-project/clang/test/CodeGen/ppc-mmintrin.c
@@ -2,13 +2,13 @@
// REQUIRES: powerpc-registered-target
// RUN: %clang -S -emit-llvm -target powerpc64-unknown-linux-gnu -mcpu=pwr8 -DNO_WARN_X86_INTRINSICS %s \
-// RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt | FileCheck %s --check-prefixes=CHECK-P8,CHECK,CHECK-BE
+// RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt -n | FileCheck %s --check-prefixes=CHECK-P8,CHECK,CHECK-BE
// RUN: %clang -S -emit-llvm -target powerpc64le-unknown-linux-gnu -mcpu=pwr8 -DNO_WARN_X86_INTRINSICS %s \
-// RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt | FileCheck %s --check-prefixes=CHECK-P8,CHECK,CHECK-LE
+// RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt -n | FileCheck %s --check-prefixes=CHECK-P8,CHECK,CHECK-LE
// RUN: %clang -S -emit-llvm -target powerpc64-unknown-linux-gnu -mcpu=pwr9 -DNO_WARN_X86_INTRINSICS %s \
-// RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt | FileCheck %s --check-prefixes=CHECK-P9,CHECK,CHECK-BE
+// RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt -n | FileCheck %s --check-prefixes=CHECK-P9,CHECK,CHECK-BE
// RUN: %clang -S -emit-llvm -target powerpc64le-unknown-linux-gnu -mcpu=pwr9 -DNO_WARN_X86_INTRINSICS %s \
-// RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt | FileCheck %s --check-prefixes=CHECK-P9,CHECK,CHECK-LE
+// RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt -n| FileCheck %s --check-prefixes=CHECK-P9,CHECK,CHECK-LE
#include <mmintrin.h>
diff --git a/src/llvm-project/clang/test/CodeGen/ppc-pmmintrin.c b/src/llvm-project/clang/test/CodeGen/ppc-pmmintrin.c
new file mode 100644
index 0000000..f56a6a9
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/ppc-pmmintrin.c
@@ -0,0 +1,153 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// REQUIRES: powerpc-registered-target
+
+// RUN: %clang -S -emit-llvm -target powerpc64-gnu-linux -mcpu=pwr8 -DNO_MM_MALLOC -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
+// RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt -n | FileCheck %s
+// RUN: %clang -S -emit-llvm -target powerpc64le-gnu-linux -mcpu=pwr8 -DNO_MM_MALLOC -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
+// RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt -n | FileCheck %s
+
+#include <pmmintrin.h>
+
+__m128d resd, md1, md2;
+__m128 res, m1, m2;
+__m128i resi, mi;
+double *d;
+
+void __attribute__((noinline))
+test_pmmintrin() {
+ resd = _mm_addsub_pd(md1, md2);
+ res = _mm_addsub_ps(m1, m2);
+ resd = _mm_hadd_pd(md1, md2);
+ res = _mm_hadd_ps(m1, m2);
+ resd = _mm_hsub_pd(md1, md2);
+ res = _mm_hsub_ps(m1, m2);
+ resi = _mm_lddqu_si128(&mi);
+ resd = _mm_loaddup_pd(d);
+ resd = _mm_movedup_pd(md1);
+ res = _mm_movehdup_ps(m1);
+ res = _mm_moveldup_ps(m1);
+}
+
+// CHECK-LABEL: @test_pmmintrin
+
+// CHECK: define available_externally <2 x double> @_mm_addsub_pd(<2 x double> [[REG1:[0-9a-zA-Z_%.]+]], <2 x double> [[REG2:[0-9a-zA-Z_%.]+]])
+// CHECK: store <2 x double> [[REG1]], <2 x double>* [[REG3:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <2 x double> [[REG2]], <2 x double>* [[REG4:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <2 x double> <double -0.000000e+00, double 0.000000e+00>, <2 x double>* [[REG5:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG7:[0-9a-zA-Z_%.]+]] = load <2 x double>, <2 x double>* [[REG4]], align 16
+// CHECK-NEXT: [[REG8:[0-9a-zA-Z_%.]+]] = call <2 x double> @vec_xor(double vector[2], double vector[2])(<2 x double> [[REG7]], <2 x double> <double -0.000000e+00, double 0.000000e+00>)
+// CHECK-NEXT: store <2 x double> [[REG8]], <2 x double>* [[REG6:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG9:[0-9a-zA-Z_%.]+]] = load <2 x double>, <2 x double>* [[REG3]], align 16
+// CHECK-NEXT: [[REG10:[0-9a-zA-Z_%.]+]] = load <2 x double>, <2 x double>* [[REG6]], align 16
+// CHECK-NEXT: [[REG11:[0-9a-zA-Z_%.]+]] = call <2 x double> @vec_add(double vector[2], double vector[2])(<2 x double> [[REG9]], <2 x double> [[REG10]])
+// CHECK-NEXT: ret <2 x double> [[REG11]]
+
+// CHECK: define available_externally <4 x float> @_mm_addsub_ps(<4 x float> [[REG12:[0-9a-zA-Z_%.]+]], <4 x float> [[REG13:[0-9a-zA-Z_%.]+]])
+// CHECK: store <4 x float> [[REG12]], <4 x float>* [[REG14:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <4 x float> [[REG13]], <4 x float>* [[REG15:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <4 x float> <float -0.000000e+00, float 0.000000e+00, float -0.000000e+00, float 0.000000e+00>, <4 x float>* [[REG16:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG18:[0-9a-zA-Z_%.]+]] = load <4 x float>, <4 x float>* [[REG15]], align 16
+// CHECK-NEXT: [[REG19:[0-9a-zA-Z_%.]+]] = call <4 x float> @vec_xor(float vector[4], float vector[4])(<4 x float> [[REG18]], <4 x float> <float -0.000000e+00, float 0.000000e+00, float -0.000000e+00, float 0.000000e+00>)
+// CHECK-NEXT: store <4 x float> [[REG19]], <4 x float>* [[REG17:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG20:[0-9a-zA-Z_%.]+]] = load <4 x float>, <4 x float>* [[REG14]], align 16
+// CHECK-NEXT: [[REG21:[0-9a-zA-Z_%.]+]] = load <4 x float>, <4 x float>* [[REG17]], align 16
+// CHECK-NEXT: [[REG22:[0-9a-zA-Z_%.]+]] = call <4 x float> @vec_add(float vector[4], float vector[4])(<4 x float> [[REG20]], <4 x float> [[REG21]])
+// CHECK-NEXT: ret <4 x float> [[REG22]]
+
+// CHECK: define available_externally <2 x double> @_mm_hadd_pd(<2 x double> [[REG23:[0-9a-zA-Z_%.]+]], <2 x double> [[REG24:[0-9a-zA-Z_%.]+]])
+// CHECK: store <2 x double> [[REG23]], <2 x double>* [[REG25:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <2 x double> [[REG24]], <2 x double>* [[REG26:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG27:[0-9a-zA-Z_%.]+]] = load <2 x double>, <2 x double>* [[REG25]], align 16
+// CHECK-NEXT: [[REG28:[0-9a-zA-Z_%.]+]] = load <2 x double>, <2 x double>* [[REG26]], align 16
+// CHECK-NEXT: [[REG29:[0-9a-zA-Z_%.]+]] = call <2 x double> @vec_mergeh(double vector[2], double vector[2])(<2 x double> [[REG27]], <2 x double> [[REG28]])
+// CHECK-NEXT: [[REG30:[0-9a-zA-Z_%.]+]] = load <2 x double>, <2 x double>* [[REG25]], align 16
+// CHECK-NEXT: [[REG31:[0-9a-zA-Z_%.]+]] = load <2 x double>, <2 x double>* [[REG26]], align 16
+// CHECK-NEXT: [[REG32:[0-9a-zA-Z_%.]+]] = call <2 x double> @vec_mergel(double vector[2], double vector[2])(<2 x double> [[REG30]], <2 x double> [[REG31]])
+// CHECK-NEXT: [[REG33:[0-9a-zA-Z_%.]+]] = call <2 x double> @vec_add(double vector[2], double vector[2])(<2 x double> [[REG29]], <2 x double> [[REG32]])
+// CHECK-NEXT: ret <2 x double> [[REG33]]
+
+// CHECK: define available_externally <4 x float> @_mm_hadd_ps(<4 x float> [[REG34:[0-9a-zA-Z_%.]+]], <4 x float> [[REG35:[0-9a-zA-Z_%.]+]])
+// CHECK: store <4 x float> [[REG34]], <4 x float>* [[REG36:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <4 x float> [[REG35]], <4 x float>* [[REG37:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 8, i8 9, i8 10, i8 11, i8 16, i8 17, i8 18, i8 19, i8 24, i8 25, i8 26, i8 27>, <16 x i8>* [[REG38:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <16 x i8> <i8 4, i8 5, i8 6, i8 7, i8 12, i8 13, i8 14, i8 15, i8 20, i8 21, i8 22, i8 23, i8 28, i8 29, i8 30, i8 31>, <16 x i8>* [[REG39:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG40:[0-9a-zA-Z_%.]+]] = load <4 x float>, <4 x float>* [[REG36]], align 16
+// CHECK-NEXT: [[REG41:[0-9a-zA-Z_%.]+]] = load <4 x float>, <4 x float>* [[REG37]], align 16
+// CHECK-NEXT: [[REG42:[0-9a-zA-Z_%.]+]] = load <16 x i8>, <16 x i8>* [[REG38:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG43:[0-9a-zA-Z_%.]+]] = call <4 x float> @vec_perm(float vector[4], float vector[4], unsigned char vector[16])(<4 x float> [[REG40]], <4 x float> [[REG41]], <16 x i8> [[REG42]])
+// CHECK-NEXT: [[REG44:[0-9a-zA-Z_%.]+]] = load <4 x float>, <4 x float>* [[REG36]], align 16
+// CHECK-NEXT: [[REG45:[0-9a-zA-Z_%.]+]] = load <4 x float>, <4 x float>* [[REG37]], align 16
+// CHECK-NEXT: [[REG46:[0-9a-zA-Z_%.]+]] = load <16 x i8>, <16 x i8>* [[REG39:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG47:[0-9a-zA-Z_%.]+]] = call <4 x float> @vec_perm(float vector[4], float vector[4], unsigned char vector[16])(<4 x float> [[REG44]], <4 x float> [[REG45]], <16 x i8> [[REG46]])
+// CHECK-NEXT: [[REG48:[0-9a-zA-Z_%.]+]] = call <4 x float> @vec_add(float vector[4], float vector[4])(<4 x float> [[REG43]], <4 x float> [[REG47]])
+// CHECK-NEXT: ret <4 x float> [[REG48]]
+
+// CHECK: define available_externally <2 x double> @_mm_hsub_pd(<2 x double> [[REG49:[0-9a-zA-Z_%.]+]], <2 x double> [[REG50:[0-9a-zA-Z_%.]+]])
+// CHECK: store <2 x double> [[REG49]], <2 x double>* [[REG51:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <2 x double> [[REG50]], <2 x double>* [[REG52:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG53:[0-9a-zA-Z_%.]+]] = load <2 x double>, <2 x double>* [[REG51]], align 16
+// CHECK-NEXT: [[REG54:[0-9a-zA-Z_%.]+]] = load <2 x double>, <2 x double>* [[REG52]], align 16
+// CHECK-NEXT: [[REG55:[0-9a-zA-Z_%.]+]] = call <2 x double> @vec_mergeh(double vector[2], double vector[2])(<2 x double> [[REG53]], <2 x double> [[REG54]])
+// CHECK-NEXT: [[REG56:[0-9a-zA-Z_%.]+]] = load <2 x double>, <2 x double>* [[REG51]], align 16
+// CHECK-NEXT: [[REG57:[0-9a-zA-Z_%.]+]] = load <2 x double>, <2 x double>* [[REG52]], align 16
+// CHECK-NEXT: [[REG58:[0-9a-zA-Z_%.]+]] = call <2 x double> @vec_mergel(double vector[2], double vector[2])(<2 x double> [[REG56]], <2 x double> [[REG57]])
+// CHECK-NEXT: [[REG59:[0-9a-zA-Z_%.]+]] = call <2 x double> @vec_sub(double vector[2], double vector[2])(<2 x double> [[REG55]], <2 x double> [[REG58]])
+// CHECK-NEXT: ret <2 x double> [[REG59]]
+
+// CHECK: define available_externally <4 x float> @_mm_hsub_ps(<4 x float> [[REG60:[0-9a-zA-Z_%.]+]], <4 x float> [[REG61:[0-9a-zA-Z_%.]+]])
+// CHECK: store <4 x float> [[REG60]], <4 x float>* [[REG62:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <4 x float> [[REG61]], <4 x float>* [[REG63:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 8, i8 9, i8 10, i8 11, i8 16, i8 17, i8 18, i8 19, i8 24, i8 25, i8 26, i8 27>, <16 x i8>* [[REG64:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <16 x i8> <i8 4, i8 5, i8 6, i8 7, i8 12, i8 13, i8 14, i8 15, i8 20, i8 21, i8 22, i8 23, i8 28, i8 29, i8 30, i8 31>, <16 x i8>* [[REG65:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG66:[0-9a-zA-Z_%.]+]] = load <4 x float>, <4 x float>* [[REG62]], align 16
+// CHECK-NEXT: [[REG67:[0-9a-zA-Z_%.]+]] = load <4 x float>, <4 x float>* [[REG63]], align 16
+// CHECK-NEXT: [[REG68:[0-9a-zA-Z_%.]+]] = load <16 x i8>, <16 x i8>* [[REG64]], align 16
+// CHECK-NEXT: [[REG69:[0-9a-zA-Z_%.]+]] = call <4 x float> @vec_perm(float vector[4], float vector[4], unsigned char vector[16])(<4 x float> [[REG66]], <4 x float> [[REG67]], <16 x i8> [[REG68]])
+// CHECK-NEXT: [[REG70:[0-9a-zA-Z_%.]+]] = load <4 x float>, <4 x float>* [[REG62]], align 16
+// CHECK-NEXT: [[REG71:[0-9a-zA-Z_%.]+]] = load <4 x float>, <4 x float>* [[REG63]], align 16
+// CHECK-NEXT: [[REG72:[0-9a-zA-Z_%.]+]] = load <16 x i8>, <16 x i8>* [[REG65]], align 16
+// CHECK-NEXT: [[REG73:[0-9a-zA-Z_%.]+]] = call <4 x float> @vec_perm(float vector[4], float vector[4], unsigned char vector[16])(<4 x float> [[REG70]], <4 x float> [[REG71]], <16 x i8> [[REG72]])
+// CHECK-NEXT: [[REG74:[0-9a-zA-Z_%.]+]] = call <4 x float> @vec_sub(float vector[4], float vector[4])(<4 x float> [[REG69]], <4 x float> [[REG73]])
+// CHECK-NEXT: ret <4 x float> [[REG74]]
+
+// CHECK: define available_externally <2 x i64> @_mm_lddqu_si128(<2 x i64>* [[REG75:[0-9a-zA-Z_%.]+]])
+// CHECK: store <2 x i64>* [[REG75]], <2 x i64>** [[REG76:[0-9a-zA-Z_%.]+]], align 8
+// CHECK-NEXT: [[REG77:[0-9a-zA-Z_%.]+]] = load <2 x i64>*, <2 x i64>** [[REG76]], align 8
+// CHECK-NEXT: [[REG78:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64>* [[REG77]] to i32*
+// CHECK-NEXT: [[REG79:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_vsx_ld(int, int const*)(i32 signext 0, i32* [[REG78]])
+// CHECK-NEXT: [[REG80:[0-9a-zA-Z_%.]+]] = bitcast <4 x i32> [[REG79]] to <2 x i64>
+// CHECK-NEXT: ret <2 x i64> [[REG80]]
+
+// CHECK: define available_externally <2 x double> @_mm_loaddup_pd(double* [[REG81:[0-9a-zA-Z_%.]+]])
+// CHECK: store double* [[REG81]], double** [[REG82:[0-9a-zA-Z_%.]+]], align 8
+// CHECK-NEXT: [[REG83:[0-9a-zA-Z_%.]+]] = load double*, double** [[REG82]], align 8
+// CHECK-NEXT: [[REG84:[0-9a-zA-Z_%.]+]] = load double, double* [[REG83]], align 8
+// CHECK-NEXT: [[REG85:[0-9a-zA-Z_%.]+]] = call <2 x double> @vec_splats(double)(double [[REG84]])
+// CHECK-NEXT: ret <2 x double> [[REG85]]
+
+// CHECK: define available_externally <2 x double> @_mm_movedup_pd(<2 x double> [[REG86:[0-9a-zA-Z_%.]+]])
+// CHECK: store <2 x double> [[REG86]], <2 x double>* [[REG87:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG88:[0-9a-zA-Z_%.]+]] = load <2 x double>, <2 x double>* [[REG87]], align 16
+// CHECK-NEXT: [[REG89:[0-9a-zA-Z_%.]+]] = load <2 x double>, <2 x double>* [[REG87]], align 16
+// CHECK-NEXT: [[REG90:[0-9a-zA-Z_%.]+]] = call <2 x double> @_mm_shuffle_pd(<2 x double> [[REG88]], <2 x double> [[REG89]], i32 signext 0)
+// CHECK-NEXT: ret <2 x double> [[REG90]]
+
+// CHECK: define available_externally <4 x float> @_mm_movehdup_ps(<4 x float> [[REG91:[0-9a-zA-Z_%.]+]])
+// CHECK: store <4 x float> [[REG91]], <4 x float>* [[REG92:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG93:[0-9a-zA-Z_%.]+]] = load <4 x float>, <4 x float>* [[REG92]], align 16
+// CHECK-NEXT: [[REG94:[0-9a-zA-Z_%.]+]] = bitcast <4 x float> [[REG93]] to <4 x i32>
+// CHECK-NEXT: [[REG95:[0-9a-zA-Z_%.]+]] = load <4 x float>, <4 x float>* [[REG92]], align 16
+// CHECK-NEXT: [[REG96:[0-9a-zA-Z_%.]+]] = bitcast <4 x float> [[REG95]] to <4 x i32>
+// CHECK-NEXT: [[REG97:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_mergeo(unsigned int vector[4], unsigned int vector[4])(<4 x i32> [[REG94]], <4 x i32> [[REG96]])
+// CHECK-NEXT: [[REG98:[0-9a-zA-Z_%.]+]] = bitcast <4 x i32> [[REG97]] to <4 x float>
+// CHECK-NEXT: ret <4 x float> [[REG98]]
+
+// CHECK: define available_externally <4 x float> @_mm_moveldup_ps(<4 x float> [[REG99:[0-9a-zA-Z_%.]+]])
+// CHECK: store <4 x float> [[REG99]], <4 x float>* [[REG100:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG101:[0-9a-zA-Z_%.]+]] = load <4 x float>, <4 x float>* [[REG100]], align 16
+// CHECK-NEXT: [[REG102:[0-9a-zA-Z_%.]+]] = bitcast <4 x float> [[REG101]] to <4 x i32>
+// CHECK-NEXT: [[REG103:[0-9a-zA-Z_%.]+]] = load <4 x float>, <4 x float>* [[REG100]], align 16
+// CHECK-NEXT: [[REG104:[0-9a-zA-Z_%.]+]] = bitcast <4 x float> [[REG103]] to <4 x i32>
+// CHECK-NEXT: [[REG105:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_mergee(unsigned int vector[4], unsigned int vector[4])(<4 x i32> [[REG102]], <4 x i32> [[REG104]])
+// CHECK-NEXT: [[REG106:[0-9a-zA-Z_%.]+]] = bitcast <4 x i32> [[REG105]] to <4 x float>
+// CHECK-NEXT: ret <4 x float> [[REG106]]
diff --git a/src/llvm-project/clang/test/CodeGen/ppc-smmintrin.c b/src/llvm-project/clang/test/CodeGen/ppc-smmintrin.c
new file mode 100644
index 0000000..c3245ab
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/ppc-smmintrin.c
@@ -0,0 +1,118 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// REQUIRES: powerpc-registered-target
+
+// RUN: %clang -S -emit-llvm -target powerpc64le-unknown-linux-gnu -mcpu=pwr8 -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
+// RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt -n | FileCheck %s --check-prefixes=CHECK,LE
+// RUN: %clang -S -emit-llvm -target powerpc64-unknown-linux-gnu -mcpu=pwr8 -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
+// RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt -n | FileCheck %s --check-prefixes=CHECK,BE
+
+#include <smmintrin.h>
+
+__m128i mi, m1, m2;
+
+void __attribute__((noinline))
+test_extract() {
+ _mm_extract_epi8(mi, 0);
+ _mm_extract_epi32(mi, 0);
+ _mm_extract_epi64(mi, 0);
+ _mm_extract_ps((__m128)mi, 0);
+}
+
+// CHECK-LABEL: @test_extract
+
+// CHECK: define available_externally signext i32 @_mm_extract_epi8(<2 x i64> [[REG1:[0-9a-zA-Z_%.]+]], i32 signext [[REG2:[0-9a-zA-Z_%.]+]])
+// CHECK: store <2 x i64> [[REG1]], <2 x i64>* [[REG3:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store i32 [[REG2]], i32* [[REG4:[0-9a-zA-Z_%.]+]], align 4
+// CHECK-NEXT: [[REG5:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG3]], align 16
+// CHECK-NEXT: [[REG6:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG5]] to <16 x i8>
+// CHECK-NEXT: [[REG7:[0-9a-zA-Z_%.]+]] = load i32, i32* [[REG4]], align 4
+// CHECK-NEXT: [[REG8:[0-9a-zA-Z_%.]+]] = and i32 [[REG7]], 15
+// CHECK-NEXT: [[REG9:[0-9a-zA-Z_%.]+]] = extractelement <16 x i8> [[REG6]], i32 [[REG8]]
+// CHECK-NEXT: [[REG10:[0-9a-zA-Z_%.]+]] = zext i8 [[REG9]] to i32
+// CHECK-NEXT: ret i32 [[REG10]]
+
+// CHECK: define available_externally signext i32 @_mm_extract_epi32(<2 x i64> [[REG11:[0-9a-zA-Z_%.]+]], i32 signext [[REG12:[0-9a-zA-Z_%.]+]])
+// CHECK: store <2 x i64> [[REG11]], <2 x i64>* [[REG13:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store i32 [[REG12]], i32* [[REG14:[0-9a-zA-Z_%.]+]], align 4
+// CHECK-NEXT: [[REG15:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG13]], align 16
+// CHECK-NEXT: [[REG16:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG15]] to <4 x i32>
+// CHECK-NEXT: [[REG17:[0-9a-zA-Z_%.]+]] = load i32, i32* [[REG14]], align 4
+// CHECK-NEXT: [[REG18:[0-9a-zA-Z_%.]+]] = and i32 [[REG17]], 3
+// CHECK-NEXT: [[REG19:[0-9a-zA-Z_%.]+]] = extractelement <4 x i32> [[REG16]], i32 [[REG18]]
+// CHECK-NEXT: ret i32 [[REG19]]
+
+// CHECK: define available_externally signext i32 @_mm_extract_epi64(<2 x i64> [[REG20:[0-9a-zA-Z_%.]+]], i32 signext [[REG21:[0-9a-zA-Z_%.]+]])
+// CHECK: store <2 x i64> [[REG20]], <2 x i64>* [[REG22:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store i32 [[REG21]], i32* [[REG23:[0-9a-zA-Z_%.]+]], align 4
+// CHECK-NEXT: [[REG24:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG22]], align 16
+// CHECK-NEXT: [[REG25:[0-9a-zA-Z_%.]+]] = load i32, i32* [[REG23]], align 4
+// CHECK-NEXT: [[REG26:[0-9a-zA-Z_%.]+]] = and i32 [[REG25]], 1
+// CHECK-NEXT: [[REG27:[0-9a-zA-Z_%.]+]] = extractelement <2 x i64> [[REG24]], i32 [[REG26]]
+// CHECK-NEXT: [[REG28:[0-9a-zA-Z_%.]+]] = trunc i64 [[REG27]] to i32
+// CHECK-NEXT: ret i32 [[REG28]]
+
+// CHECK: define available_externally signext i32 @_mm_extract_ps(<4 x float> [[REG29:[0-9a-zA-Z_%.]+]], i32 signext [[REG30:[0-9a-zA-Z_%.]+]])
+// CHECK: store <4 x float> [[REG29]], <4 x float>* [[REG31:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store i32 [[REG30]], i32* [[REG32:[0-9a-zA-Z_%.]+]], align 4
+// CHECK-NEXT: [[REG33:[0-9a-zA-Z_%.]+]] = load <4 x float>, <4 x float>* [[REG31]], align 16
+// CHECK-NEXT: [[REG34:[0-9a-zA-Z_%.]+]] = bitcast <4 x float> [[REG33]] to <4 x i32>
+// CHECK-NEXT: [[REG35:[0-9a-zA-Z_%.]+]] = load i32, i32* [[REG32]], align 4
+// CHECK-NEXT: [[REG36:[0-9a-zA-Z_%.]+]] = and i32 [[REG35]], 3
+// CHECK-NEXT: [[REG37:[0-9a-zA-Z_%.]+]] = extractelement <4 x i32> [[REG34]], i32 [[REG36]]
+// CHECK-NEXT: ret i32 [[REG37]]
+
+void __attribute__((noinline))
+test_blend() {
+ _mm_blend_epi16(m1, m2, 0);
+ _mm_blendv_epi8(m1, m2, mi);
+}
+
+// CHECK-LABEL: @test_blend
+
+// CHECK: define available_externally <2 x i64> @_mm_blend_epi16(<2 x i64> [[REG38:[0-9a-zA-Z_%.]+]], <2 x i64> [[REG39:[0-9a-zA-Z_%.]+]], i32 signext [[REG40:[0-9a-zA-Z_%.]+]])
+// CHECK: store <2 x i64> [[REG38]], <2 x i64>* [[REG41:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <2 x i64> [[REG39]], <2 x i64>* [[REG42:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store i32 [[REG40]], i32* [[REG43:[0-9a-zA-Z_%.]+]], align 4
+// CHECK-NEXT: [[REG44:[0-9a-zA-Z_%.]+]] = load i32, i32* [[REG43]], align 4
+// CHECK-NEXT: [[REG45:[0-9a-zA-Z_%.]+]] = trunc i32 [[REG44]] to i8
+// CHECK-NEXT: [[REG46:[0-9a-zA-Z_%.]+]] = call <16 x i8> @vec_splats(signed char)(i8 signext [[REG45]])
+// CHECK-NEXT: store <16 x i8> [[REG46]], <16 x i8>* [[REG47:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG48:[0-9a-zA-Z_%.]+]] = load <16 x i8>, <16 x i8>* [[REG47]], align 16
+// CHECK-NEXT: [[REG49:[0-9a-zA-Z_%.]+]] = call <16 x i8> @llvm.ppc.altivec.vgbbd(<16 x i8> [[REG48]])
+// CHECK-NEXT: store <16 x i8> [[REG49]], <16 x i8>* [[REG47]], align 16
+// CHECK-NEXT: [[REG50:[0-9a-zA-Z_%.]+]] = load <16 x i8>, <16 x i8>* [[REG47]], align 16
+// CHECK-NEXT: [[REG51:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_unpackh(signed char vector[16])(<16 x i8> [[REG50]])
+// CHECK-NEXT: store <8 x i16> [[REG51]], <8 x i16>* [[REG52:[0-9a-zA-Z_%.]+]], align 16
+
+// BE: [[REG53:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG52]], align 16
+// BE-NEXT: [[REG54:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_reve(unsigned short vector[8])(<8 x i16> [[REG53]])
+// BE-NEXT: store <8 x i16> [[REG54]], <8 x i16>* [[REG52]], align 16
+
+// CHECK: [[REG55:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG41]], align 16
+// CHECK-NEXT: [[REG56:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG55]] to <8 x i16>
+// CHECK-NEXT: [[REG57:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG42]], align 16
+// CHECK-NEXT: [[REG58:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG57]] to <8 x i16>
+// CHECK-NEXT: [[REG59:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG52]], align 16
+// CHECK-NEXT: [[REG60:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_sel(unsigned short vector[8], unsigned short vector[8], unsigned short vector[8])(<8 x i16> [[REG56]], <8 x i16> [[REG58]], <8 x i16> [[REG59]])
+// CHECK-NEXT: [[REG61:[0-9a-zA-Z_%.]+]] = bitcast <8 x i16> [[REG60]] to <2 x i64>
+// CHECK-NEXT: ret <2 x i64> [[REG61]]
+
+// CHECK: define available_externally <2 x i64> @_mm_blendv_epi8(<2 x i64> [[REG62:[0-9a-zA-Z_%.]+]], <2 x i64> [[REG63:[0-9a-zA-Z_%.]+]], <2 x i64> [[REG64:[0-9a-zA-Z_%.]+]])
+// CHECK: store <2 x i64> [[REG62]], <2 x i64>* [[REG65:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <2 x i64> [[REG63]], <2 x i64>* [[REG66:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <2 x i64> [[REG64]], <2 x i64>* [[REG67:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG68:[0-9a-zA-Z_%.]+]] = call <16 x i8> @vec_splats(unsigned char)(i8 zeroext 7)
+// CHECK-NEXT: store <16 x i8> [[REG68]], <16 x i8>* [[REG69:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG70:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG67]], align 16
+// CHECK-NEXT: [[REG71:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG70]] to <16 x i8>
+// CHECK-NEXT: [[REG72:[0-9a-zA-Z_%.]+]] = load <16 x i8>, <16 x i8>* [[REG69]], align 16
+// CHECK-NEXT: [[REG73:[0-9a-zA-Z_%.]+]] = call <16 x i8> @vec_sra(unsigned char vector[16], unsigned char vector[16])(<16 x i8> [[REG71]], <16 x i8> [[REG72]])
+// CHECK-NEXT: store <16 x i8> [[REG73]], <16 x i8>* [[REG74:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG75:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG65]], align 16
+// CHECK-NEXT: [[REG76:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG75]] to <16 x i8>
+// CHECK-NEXT: [[REG77:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG66]], align 16
+// CHECK-NEXT: [[REG78:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG77]] to <16 x i8>
+// CHECK-NEXT: [[REG79:[0-9a-zA-Z_%.]+]] = load <16 x i8>, <16 x i8>* [[REG74]], align 16
+// CHECK-NEXT: [[REG80:[0-9a-zA-Z_%.]+]] = call <16 x i8> @vec_sel(unsigned char vector[16], unsigned char vector[16], unsigned char vector[16])(<16 x i8> [[REG76]], <16 x i8> [[REG78]], <16 x i8> [[REG79]])
+// CHECK-NEXT: [[REG81:[0-9a-zA-Z_%.]+]] = bitcast <16 x i8> [[REG80]] to <2 x i64>
+// CHECK-NEXT: ret <2 x i64> [[REG81]]
diff --git a/src/llvm-project/clang/test/CodeGen/ppc-tmmintrin.c b/src/llvm-project/clang/test/CodeGen/ppc-tmmintrin.c
new file mode 100644
index 0000000..099c165
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/ppc-tmmintrin.c
@@ -0,0 +1,1062 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// REQUIRES: powerpc-registered-target
+
+// RUN: %clang -S -emit-llvm -target powerpc64-gnu-linux -mcpu=pwr8 -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
+// RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt -n | FileCheck %s --check-prefixes=CHECK,CHECK-BE
+// RUN: %clang -S -emit-llvm -target powerpc64le-gnu-linux -mcpu=pwr8 -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
+// RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt -n | FileCheck %s --check-prefixes=CHECK,CHECK-LE
+
+#include <tmmintrin.h>
+
+__m64 res, m1, m2;
+__m128i resi, mi1, mi2;
+
+void __attribute__((noinline))
+test_abs() {
+ resi = _mm_abs_epi16(mi1);
+ resi = _mm_abs_epi32(mi1);
+ resi = _mm_abs_epi8(mi1);
+ res = _mm_abs_pi16(m1);
+ res = _mm_abs_pi32(m1);
+ res = _mm_abs_pi8(m1);
+}
+
+// CHECK-LABEL: @test_abs
+
+// CHECK: define available_externally <2 x i64> @_mm_abs_epi16(<2 x i64> [[REG1:[0-9a-zA-Z_%.]+]])
+// CHECK: store <2 x i64> [[REG1]], <2 x i64>* [[REG2:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG3:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG2]], align 16
+// CHECK-NEXT: [[REG4:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG3]] to <8 x i16>
+// CHECK-NEXT: [[REG5:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_abs(short vector[8])(<8 x i16> [[REG4]])
+// CHECK-NEXT: [[REG6:[0-9a-zA-Z_%.]+]] = bitcast <8 x i16> [[REG5]] to <2 x i64>
+// CHECK-NEXT: ret <2 x i64> [[REG6]]
+
+// CHECK: define available_externally <2 x i64> @_mm_abs_epi32(<2 x i64> [[REG7:[0-9a-zA-Z_%.]+]])
+// CHECK: store <2 x i64> [[REG7]], <2 x i64>* [[REG8:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG9:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG8]], align 16
+// CHECK-NEXT: [[REG10:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG9]] to <4 x i32>
+// CHECK-NEXT: [[REG11:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_abs(int vector[4])(<4 x i32> [[REG10]])
+// CHECK-NEXT: [[REG12:[0-9a-zA-Z_%.]+]] = bitcast <4 x i32> [[REG11]] to <2 x i64>
+// CHECK-NEXT: ret <2 x i64> [[REG12]]
+
+// CHECK: define available_externally <2 x i64> @_mm_abs_epi8(<2 x i64> [[REG13:[0-9a-zA-Z_%.]+]])
+// CHECK: store <2 x i64> [[REG13]], <2 x i64>* [[REG14:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG15:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG14]], align 16
+// CHECK-NEXT: [[REG16:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG15]] to <16 x i8>
+// CHECK-NEXT: [[REG17:[0-9a-zA-Z_%.]+]] = call <16 x i8> @vec_abs(signed char vector[16])(<16 x i8> [[REG16]])
+// CHECK-NEXT: [[REG18:[0-9a-zA-Z_%.]+]] = bitcast <16 x i8> [[REG17]] to <2 x i64>
+// CHECK-NEXT: ret <2 x i64> [[REG18]]
+
+// CHECK: define available_externally i64 @_mm_abs_pi16(i64 [[REG19:[0-9a-zA-Z_%.]+]])
+// CHECK: store i64 [[REG19]], i64* [[REG20:[0-9a-zA-Z_%.]+]], align 8
+// CHECK-NEXT: [[REG21:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG20]], align 8
+// CHECK-NEXT: [[REG22:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> undef, i64 [[REG21]], i32 0
+// CHECK-NEXT: [[REG23:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG20]], align 8
+// CHECK-NEXT: [[REG24:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> [[REG22]], i64 [[REG23]], i32 1
+// CHECK-NEXT: store <2 x i64> [[REG24]], <2 x i64>* [[REG25:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG26:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG25]], align 16
+// CHECK-NEXT: [[REG27:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG26]] to <8 x i16>
+// CHECK-NEXT: store <8 x i16> [[REG27]], <8 x i16>* [[REG28:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG29:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG28]], align 16
+// CHECK-NEXT: [[REG30:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_abs(short vector[8])(<8 x i16> [[REG29]])
+// CHECK-NEXT: [[REG31:[0-9a-zA-Z_%.]+]] = bitcast <8 x i16> [[REG30]] to <2 x i64>
+// CHECK-NEXT: [[REG32:[0-9a-zA-Z_%.]+]] = extractelement <2 x i64> [[REG31]], i32 0
+// CHECK-NEXT: ret i64 [[REG32]]
+
+// CHECK: define available_externally i64 @_mm_abs_pi32(i64 [[REG33:[0-9a-zA-Z_%.]+]])
+// CHECK: store i64 [[REG33]], i64* [[REG34:[0-9a-zA-Z_%.]+]], align 8
+// CHECK-NEXT: [[REG35:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG34]], align 8
+// CHECK-NEXT: [[REG36:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> undef, i64 [[REG35]], i32 0
+// CHECK-NEXT: [[REG37:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG34]], align 8
+// CHECK-NEXT: [[REG38:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> [[REG36]], i64 [[REG37]], i32 1
+// CHECK-NEXT: store <2 x i64> [[REG38]], <2 x i64>* [[REG39:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG40:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG39]], align 16
+// CHECK-NEXT: [[REG41:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG40]] to <4 x i32>
+// CHECK-NEXT: store <4 x i32> [[REG41]], <4 x i32>* [[REG42:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG43:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG42]], align 16
+// CHECK-NEXT: [[REG44:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_abs(int vector[4])(<4 x i32> [[REG43]])
+// CHECK-NEXT: [[REG45:[0-9a-zA-Z_%.]+]] = bitcast <4 x i32> [[REG44]] to <2 x i64>
+// CHECK-NEXT: [[REG46:[0-9a-zA-Z_%.]+]] = extractelement <2 x i64> [[REG45]], i32 0
+// CHECK-NEXT: ret i64 [[REG46]]
+
+// CHECK: define available_externally i64 @_mm_abs_pi8(i64 [[REG47:[0-9a-zA-Z_%.]+]])
+// CHECK: store i64 [[REG47]], i64* [[REG48:[0-9a-zA-Z_%.]+]], align 8
+// CHECK-NEXT: [[REG49:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG48]], align 8
+// CHECK-NEXT: [[REG50:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> undef, i64 [[REG49]], i32 0
+// CHECK-NEXT: [[REG51:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG48]], align 8
+// CHECK-NEXT: [[REG52:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> [[REG50]], i64 [[REG51]], i32 1
+// CHECK-NEXT: store <2 x i64> [[REG52]], <2 x i64>* [[REG53:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG54:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG53]], align 16
+// CHECK-NEXT: [[REG55:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG54]] to <16 x i8>
+// CHECK-NEXT: store <16 x i8> [[REG55]], <16 x i8>* [[REG56:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG57:[0-9a-zA-Z_%.]+]] = load <16 x i8>, <16 x i8>* [[REG56]], align 16
+// CHECK-NEXT: [[REG58:[0-9a-zA-Z_%.]+]] = call <16 x i8> @vec_abs(signed char vector[16])(<16 x i8> [[REG57]])
+// CHECK-NEXT: [[REG59:[0-9a-zA-Z_%.]+]] = bitcast <16 x i8> [[REG58]] to <2 x i64>
+// CHECK-NEXT: [[REG60:[0-9a-zA-Z_%.]+]] = extractelement <2 x i64> [[REG59]], i32 0
+// CHECK-NEXT: ret i64 [[REG60]]
+
+void __attribute__((noinline))
+test_alignr() {
+ resi = _mm_alignr_epi8(mi1, mi2, 1U);
+ res = _mm_alignr_pi8(m1, m2, 1U);
+}
+
+// CHECK-LABEL: @test_alignr
+
+// CHECK: define available_externally <2 x i64> @_mm_alignr_epi8(<2 x i64> [[REG61:[0-9a-zA-Z_%.]+]], <2 x i64> [[REG62:[0-9a-zA-Z_%.]+]], i32 zeroext [[REG63:[0-9a-zA-Z_%.]+]])
+// CHECK: [[REG64:[0-9a-zA-Z_%.]+]] = alloca i32, align 4
+// CHECK: store <2 x i64> [[REG61]], <2 x i64>* [[REG65:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <2 x i64> [[REG62]], <2 x i64>* [[REG66:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store i32 [[REG63]], i32* [[REG64:[0-9a-zA-Z_%.]+]], align 4
+// CHECK: %[[REG64b:[0-9a-zA-Z_%.]+]] = call i1 @llvm.is.constant.i32(i32 %0)
+// CHECK-NEXT: br i1 %[[REG64b]], label %[[REG67:[0-9a-zA-Z_%.]+]], label %[[REG68:[0-9a-zA-Z_%.]+]]
+
+// CHECK: [[REG67]]:
+// CHECK-NEXT: [[REG69:[0-9a-zA-Z_%.]+]] = load i32, i32* [[REG64]], align 4
+// CHECK-NEXT: [[REG70:[0-9a-zA-Z_%.]+]] = icmp ult i32 [[REG69]], 16
+// CHECK-NEXT: br i1 [[REG70]], label %[[REG71:[0-9a-zA-Z_%.]+]], label %[[REG68:[0-9a-zA-Z_%.]+]]
+
+// CHECK: [[REG71]]:
+// CHECK-BE-NEXT: load <2 x i64>, <2 x i64>* [[REG66]], align 16
+// CHECK-BE: call <16 x i8> @vec_sld(unsigned char vector[16], unsigned char vector[16], unsigned int)
+// CHECK-LE-NEXT: load <2 x i64>, <2 x i64>* [[REG65]], align 16
+// CHECK-LE: call <16 x i8> @vec_reve(unsigned char vector[16])
+// CHECK-LE: call <16 x i8> @vec_reve(unsigned char vector[16])
+// CHECk-LE: call <16 x i8> @vec_sld(unsigned char vector[16], unsigned char vector[16], unsigned int)
+// CHECK-LE: call <16 x i8> @vec_reve(unsigned char vector[16])
+// CHECK: br label %[[REG72:[0-9a-zA-Z_%.]+]]
+
+// CHECK: [[REG68]]:
+// CHECK-NEXT: [[REG73:[0-9a-zA-Z_%.]+]] = load i32, i32* [[REG64]], align 4
+// CHECK-NEXT: [[REG74:[0-9a-zA-Z_%.]+]] = icmp eq i32 [[REG73]], 0
+// CHECK-NEXT: br i1 [[REG74]], label %[[REG75:[0-9a-zA-Z_%.]+]], label %[[REG76:[0-9a-zA-Z_%.]+]]
+
+// CHECK: [[REG75]]:
+// CHECK-NEXT: [[REG77:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG66]], align 16
+// CHECK-NEXT: store <2 x i64> [[REG77]], <2 x i64>* {{[0-9a-zA-Z_%.]+}}, align 16
+// CHECK-NEXT: br label %[[REG72:[0-9a-zA-Z_%.]+]]
+
+// CHECK: [[REG76]]:
+// CHECK-NEXT: [[REG78:[0-9a-zA-Z_%.]+]] = load i32, i32* [[REG64]], align 4
+// CHECK-NEXT: [[REG79:[0-9a-zA-Z_%.]+]] = icmp uge i32 [[REG78]], 16
+// CHECK-NEXT: br i1 [[REG79]], label %[[REG80:[0-9a-zA-Z_%.]+]], label %[[REG81:[0-9a-zA-Z_%.]+]]
+
+// CHECK: [[REG80]]:
+// CHECK-NEXT: [[REG82:[0-9a-zA-Z_%.]+]] = load i32, i32* [[REG64]], align 4
+// CHECK-NEXT: [[REG83:[0-9a-zA-Z_%.]+]] = icmp uge i32 [[REG82]], 32
+// CHECK-NEXT: br i1 [[REG83]], label %[[REG84:[0-9a-zA-Z_%.]+]], label %[[REG85:[0-9a-zA-Z_%.]+]]
+
+// CHECK: [[REG84]]:
+// CHECK-NEXT: store <16 x i8> zeroinitializer, <16 x i8>* [[REG86:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <2 x i64> zeroinitializer, <2 x i64>* {{[0-9a-zA-Z_%.]+}}, align 16
+// CHECK-NEXT: br label %[[REG72:[0-9a-zA-Z_%.]+]]
+
+// CHECK: [[REG85]]:
+// CHECK-NEXT: [[REG87:[0-9a-zA-Z_%.]+]] = load i32, i32* [[REG64]], align 4
+// CHECK-NEXT: [[REG88:[0-9a-zA-Z_%.]+]] = sub i32 [[REG87]], 16
+// CHECK-NEXT: [[REG89:[0-9a-zA-Z_%.]+]] = mul i32 [[REG88]], 8
+// CHECK-NEXT: [[REG90:[0-9a-zA-Z_%.]+]] = trunc i32 [[REG89]] to i8
+// CHECK-NEXT: [[REG91:[0-9a-zA-Z_%.]+]] = call <16 x i8> @vec_splats(unsigned char)(i8 zeroext [[REG90]])
+// CHECK-NEXT: store <16 x i8> [[REG91]], <16 x i8>* [[REG92:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG93:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG65]], align 16
+// CHECK-NEXT: [[REG94:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG93]] to <16 x i8>
+// CHECK-NEXT: [[REG95:[0-9a-zA-Z_%.]+]] = load <16 x i8>, <16 x i8>* [[REG92]], align 16
+// CHECK-BE-NEXT: [[REG96:[0-9a-zA-Z_%.]+]] = call <16 x i8> @vec_slo(unsigned char vector[16], unsigned char vector[16])
+// CHECK-LE-NEXT: [[REG96:[0-9a-zA-Z_%.]+]] = call <16 x i8> @vec_sro(unsigned char vector[16], unsigned char vector[16])
+// CHECK-NEXT: [[REG97:[0-9a-zA-Z_%.]+]] = bitcast <16 x i8> [[REG96]] to <2 x i64>
+// CHECK-NEXT: store <2 x i64> [[REG97]], <2 x i64>* {{[0-9a-zA-Z_%.]+}}, align 16
+// CHECK-NEXT: br label %[[REG72:[0-9a-zA-Z_%.]+]]
+
+// CHECK: [[REG81]]:
+// CHECK-NEXT: [[REG98:[0-9a-zA-Z_%.]+]] = load i32, i32* [[REG64]], align 4
+// CHECK-NEXT: [[REG99:[0-9a-zA-Z_%.]+]] = sub i32 16, [[REG98]]
+// CHECK-NEXT: [[REG100:[0-9a-zA-Z_%.]+]] = mul i32 [[REG99]], 8
+
+// CHECK-BE: [[REG101:[0-9a-zA-Z_%.]+]] = trunc i32 [[REG100]] to i8
+// CHECK-BE: [[REG102:[0-9a-zA-Z_%.]+]] = call <16 x i8> @vec_splats(unsigned char)(i8 zeroext [[REG101]])
+// CHECK-BE: mul i32 {{[0-9a-zA-Z_%.]+}}, 8
+// CHECK-BE: call <16 x i8> @vec_sro(unsigned char vector[16], unsigned char vector[16])
+// CHECK-BE: call <16 x i8> @vec_slo(unsigned char vector[16], unsigned char vector[16])
+// CHECK-BE: [[REG103:[0-9a-zA-Z_%.]+]] = call <16 x i8> @vec_or(unsigned char vector[16], unsigned char vector[16])
+// CHECK-BE-NEXT: [[REG104:[0-9a-zA-Z_%.]+]] = bitcast <16 x i8> [[REG103]] to <2 x i64>
+// CHECK-BE-NEXT: store <2 x i64> [[REG104]], <2 x i64>* {{[0-9a-zA-Z_%.]+}}, align 16
+// CHECK-BE-NEXT: br label %[[REG72:[0-9a-zA-Z_%.]+]]
+
+// CHECK-LE: [[REG105:[0-9a-zA-Z_%.]+]] = mul i32 {{[0-9a-zA-Z_%.]+}}, 8
+// CHECK-LE-NEXT: trunc i32 [[REG105]] to i8
+// CHECK-LE: call <16 x i8> @vec_splats(unsigned char)
+// CHECK-LE: call <16 x i8> @vec_slo(unsigned char vector[16], unsigned char vector[16])
+// CHECK-LE: call <16 x i8> @vec_sro(unsigned char vector[16], unsigned char vector[16])
+// CHECK-LE: [[REG106:[0-9a-zA-Z_%.]+]] = call <16 x i8> @vec_or(unsigned char vector[16], unsigned char vector[16])
+// CHECK-LE-NEXT: [[REG107:[0-9a-zA-Z_%.]+]] = bitcast <16 x i8> [[REG106]] to <2 x i64>
+// CHECK-LE-NEXT: store <2 x i64> [[REG107]], <2 x i64>* {{[0-9a-zA-Z_%.]+}}, align 16
+
+// CHECK: [[REG72]]:
+// CHECK-NEXT: [[REG108:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* {{[0-9a-zA-Z_%.]+}}, align 16
+// CHECK-NEXT: ret <2 x i64> [[REG108]]
+
+// CHECK: define available_externally i64 @_mm_alignr_pi8(i64 [[REG109:[0-9a-zA-Z_%.]+]], i64 [[REG110:[0-9a-zA-Z_%.]+]], i32 zeroext [[REG111:[0-9a-zA-Z_%.]+]])
+// CHECK: store i64 [[REG109]], i64* [[REG112:[0-9a-zA-Z_%.]+]], align 8
+// CHECK-NEXT: store i64 [[REG110]], i64* [[REG113:[0-9a-zA-Z_%.]+]], align 8
+// CHECK-NEXT: store i32 [[REG111]], i32* [[REG114:[0-9a-zA-Z_%.]+]], align 4
+// CHECK-NEXT: [[REG115:[0-9a-zA-Z_%.]+]] = load i32, i32* [[REG114]], align 4
+// CHECK-NEXT: [[REG116:[0-9a-zA-Z_%.]+]] = icmp ult i32 [[REG115]], 16
+// CHECK-NEXT: br i1 [[REG116]], label %[[REG117:[0-9a-zA-Z_%.]+]], label %[[REG118:[0-9a-zA-Z_%.]+]]
+
+// CHECK: [[REG117]]:
+// CHECK-NEXT: [[REG119:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG113]], align 8
+// CHECK-NEXT: [[REG120:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> undef, i64 [[REG119]], i32 0
+// CHECK-NEXT: [[REG121:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG112]], align 8
+// CHECK-NEXT: [[REG122:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> [[REG120]], i64 [[REG121]], i32 1
+// CHECK-NEXT: store <2 x i64> [[REG122]], <2 x i64>* [[REG123:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG124:[0-9a-zA-Z_%.]+]] = load i32, i32* [[REG114]], align 4
+// CHECK-NEXT: [[REG125:[0-9a-zA-Z_%.]+]] = shl i32 [[REG124]], 3
+// CHECK-BE-NEXT: [[REG126:[0-9a-zA-Z_%.]+]] = insertelement <4 x i32> <i32 0, i32 0, i32 0, i32 undef>, i32 [[REG125]], i32 3
+// CHECK-LE-NEXT: [[REG127:[0-9a-zA-Z_%.]+]] = insertelement <4 x i32> undef, i32 [[REG125]], i32 0
+// CHECK-LE-NEXT: [[REG128:[0-9a-zA-Z_%.]+]] = insertelement <4 x i32> [[REG127]], i32 0, i32 1
+// CHECK-LE-NEXT: [[REG129:[0-9a-zA-Z_%.]+]] = insertelement <4 x i32> [[REG128]], i32 0, i32 2
+// CHECK-LE-NEXT: [[REG126:[0-9a-zA-Z_%.]+]] = insertelement <4 x i32> [[REG129]], i32 0, i32 3
+// CHECK-NEXT: store <4 x i32> [[REG126]], <4 x i32>* [[REG130:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG131:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG123]], align 16
+// CHECK-NEXT: [[REG132:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG131]] to <16 x i8>
+// CHECK-NEXT: [[REG133:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG130]], align 16
+// CHECK-NEXT: [[REG134:[0-9a-zA-Z_%.]+]] = bitcast <4 x i32> [[REG133]] to <16 x i8>
+// CHECK-BE-NEXT: [[REG135:[0-9a-zA-Z_%.]+]] = call <16 x i8> @vec_slo(unsigned char vector[16], unsigned char vector[16])(<16 x i8> [[REG132]], <16 x i8> [[REG134]])
+// CHECK-LE-NEXT: [[REG135:[0-9a-zA-Z_%.]+]] = call <16 x i8> @vec_sro(unsigned char vector[16], unsigned char vector[16])(<16 x i8> [[REG132]], <16 x i8> [[REG134]])
+// CHECK-NEXT: [[REG136:[0-9a-zA-Z_%.]+]] = bitcast <16 x i8> [[REG135]] to <2 x i64>
+// CHECK-NEXT: store <2 x i64> [[REG136]], <2 x i64>* [[REG123]], align 16
+// CHECK-NEXT: [[REG137:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG123]], align 16
+// CHECK-NEXT: [[REG138:[0-9a-zA-Z_%.]+]] = extractelement <2 x i64> [[REG137]], i32 0
+// CHECK-NEXT: store i64 [[REG138]], i64* [[REG139:[0-9a-zA-Z_%.]+]], align 8
+// CHECK-NEXT: br label %[[REG140:[0-9a-zA-Z_%.]+]]
+
+// CHECK: [[REG118]]:
+// CHECK-NEXT: store i64 0, i64* [[REG141:[0-9a-zA-Z_%.]+]], align 8
+// CHECK-NEXT: store i64 0, i64* [[REG139]], align 8
+// CHECK-NEXT: br label %[[REG140:[0-9a-zA-Z_%.]+]]
+
+// CHECK: [[REG140]]:
+// CHECK-NEXT: [[REG142:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG139]], align 8
+// CHECK-NEXT: ret i64 [[REG142]]
+
+void __attribute__((noinline))
+test_hadd() {
+ resi = _mm_hadd_epi16(mi1, mi2);
+ resi = _mm_hadd_epi32(mi1, mi2);
+ res = _mm_hadd_pi16(m1, m2);
+ res = _mm_hadd_pi32(m1, m2);
+ resi = _mm_hadds_epi16(mi1, mi2);
+ res = _mm_hadds_pi16(m1, m2);
+}
+
+// CHECK-LABEL: @test_hadd
+
+// CHECK: define available_externally <2 x i64> @_mm_hadd_epi16(<2 x i64> [[REG143:[0-9a-zA-Z_%.]+]], <2 x i64> [[REG144:[0-9a-zA-Z_%.]+]])
+// CHECK: store <2 x i64> [[REG143]], <2 x i64>* [[REG145:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <2 x i64> [[REG144]], <2 x i64>* [[REG146:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <16 x i8> <i8 0, i8 1, i8 4, i8 5, i8 8, i8 9, i8 12, i8 13, i8 16, i8 17, i8 20, i8 21, i8 24, i8 25, i8 28, i8 29>, <16 x i8>* [[REG147:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <16 x i8> <i8 2, i8 3, i8 6, i8 7, i8 10, i8 11, i8 14, i8 15, i8 18, i8 19, i8 22, i8 23, i8 26, i8 27, i8 30, i8 31>, <16 x i8>* [[REG148:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG149:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG145]], align 16
+// CHECK-NEXT: [[REG150:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG149]] to <8 x i16>
+// CHECK-NEXT: [[REG151:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG146]], align 16
+// CHECK-NEXT: [[REG152:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG151]] to <8 x i16>
+// CHECK-NEXT: [[REG153:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_perm(short vector[8], short vector[8], unsigned char vector[16])(<8 x i16> [[REG150]], <8 x i16> [[REG152]], <16 x i8> <i8 0, i8 1, i8 4, i8 5, i8 8, i8 9, i8 12, i8 13, i8 16, i8 17, i8 20, i8 21, i8 24, i8 25, i8 28, i8 29>)
+// CHECK-NEXT: store <8 x i16> [[REG153]], <8 x i16>* [[REG154:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG155:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG145]], align 16
+// CHECK-NEXT: [[REG156:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG155]] to <8 x i16>
+// CHECK-NEXT: [[REG157:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG146]], align 16
+// CHECK-NEXT: [[REG158:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG157]] to <8 x i16>
+// CHECK-NEXT: [[REG159:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_perm(short vector[8], short vector[8], unsigned char vector[16])(<8 x i16> [[REG156]], <8 x i16> [[REG158]], <16 x i8> <i8 2, i8 3, i8 6, i8 7, i8 10, i8 11, i8 14, i8 15, i8 18, i8 19, i8 22, i8 23, i8 26, i8 27, i8 30, i8 31>)
+// CHECK-NEXT: store <8 x i16> [[REG159]], <8 x i16>* [[REG160:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG161:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG154]], align 16
+// CHECK-NEXT: [[REG162:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG160]], align 16
+// CHECK-NEXT: [[REG163:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_add(short vector[8], short vector[8])(<8 x i16> [[REG161]], <8 x i16> [[REG162]])
+// CHECK-NEXT: [[REG164:[0-9a-zA-Z_%.]+]] = bitcast <8 x i16> [[REG163]] to <2 x i64>
+// CHECK-NEXT: ret <2 x i64> [[REG164]]
+
+// CHECK: define available_externally <2 x i64> @_mm_hadd_epi32(<2 x i64> [[REG165:[0-9a-zA-Z_%.]+]], <2 x i64> [[REG166:[0-9a-zA-Z_%.]+]])
+// CHECK: store <2 x i64> [[REG165]], <2 x i64>* [[REG167:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <2 x i64> [[REG166]], <2 x i64>* [[REG168:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 8, i8 9, i8 10, i8 11, i8 16, i8 17, i8 18, i8 19, i8 24, i8 25, i8 26, i8 27>, <16 x i8>* [[REG169:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <16 x i8> <i8 4, i8 5, i8 6, i8 7, i8 12, i8 13, i8 14, i8 15, i8 20, i8 21, i8 22, i8 23, i8 28, i8 29, i8 30, i8 31>, <16 x i8>* [[REG170:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG171:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG167]], align 16
+// CHECK-NEXT: [[REG172:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG171]] to <4 x i32>
+// CHECK-NEXT: [[REG173:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG168]], align 16
+// CHECK-NEXT: [[REG174:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG173]] to <4 x i32>
+// CHECK-NEXT: [[REG175:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_perm(int vector[4], int vector[4], unsigned char vector[16])(<4 x i32> [[REG172]], <4 x i32> [[REG174]], <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 8, i8 9, i8 10, i8 11, i8 16, i8 17, i8 18, i8 19, i8 24, i8 25, i8 26, i8 27>)
+// CHECK-NEXT: store <4 x i32> [[REG175]], <4 x i32>* [[REG176:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG177:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG167]], align 16
+// CHECK-NEXT: [[REG178:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG177]] to <4 x i32>
+// CHECK-NEXT: [[REG179:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG168]], align 16
+// CHECK-NEXT: [[REG180:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG179]] to <4 x i32>
+// CHECK-NEXT: [[REG181:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_perm(int vector[4], int vector[4], unsigned char vector[16])(<4 x i32> [[REG178]], <4 x i32> [[REG180]], <16 x i8> <i8 4, i8 5, i8 6, i8 7, i8 12, i8 13, i8 14, i8 15, i8 20, i8 21, i8 22, i8 23, i8 28, i8 29, i8 30, i8 31>)
+// CHECK-NEXT: store <4 x i32> [[REG181]], <4 x i32>* [[REG182:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG183:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG176]], align 16
+// CHECK-NEXT: [[REG184:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG182]], align 16
+// CHECK-NEXT: [[REG185:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_add(int vector[4], int vector[4])(<4 x i32> [[REG183]], <4 x i32> [[REG184]])
+// CHECK-NEXT: [[REG186:[0-9a-zA-Z_%.]+]] = bitcast <4 x i32> [[REG185]] to <2 x i64>
+// CHECK-NEXT: ret <2 x i64> [[REG186]]
+
+// CHECK: define available_externally i64 @_mm_hadd_pi16(i64 [[REG187:[0-9a-zA-Z_%.]+]], i64 [[REG188:[0-9a-zA-Z_%.]+]])
+// CHECK: store i64 [[REG187]], i64* [[REG189:[0-9a-zA-Z_%.]+]], align 8
+// CHECK-NEXT: store i64 [[REG188]], i64* [[REG190:[0-9a-zA-Z_%.]+]], align 8
+// CHECK-NEXT: [[REG191:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG189]], align 8
+// CHECK-NEXT: [[REG192:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> undef, i64 [[REG191]], i32 0
+// CHECK-NEXT: [[REG193:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG190]], align 8
+// CHECK-NEXT: [[REG194:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> [[REG192]], i64 [[REG193]], i32 1
+// CHECK-NEXT: store <2 x i64> [[REG194]], <2 x i64>* [[REG195:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG196:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG195]], align 16
+// CHECK-NEXT: [[REG197:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG196]] to <8 x i16>
+// CHECK-NEXT: store <8 x i16> [[REG197]], <8 x i16>* [[REG198:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <16 x i8> <i8 0, i8 1, i8 4, i8 5, i8 8, i8 9, i8 12, i8 13, i8 0, i8 1, i8 4, i8 5, i8 8, i8 9, i8 12, i8 13>, <16 x i8>* [[REG199:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <16 x i8> <i8 2, i8 3, i8 6, i8 7, i8 10, i8 11, i8 14, i8 15, i8 2, i8 3, i8 6, i8 7, i8 10, i8 11, i8 14, i8 15>, <16 x i8>* [[REG200:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG201:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG198]], align 16
+// CHECK-NEXT: [[REG202:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG198]], align 16
+// CHECK-NEXT: [[REG203:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_perm(short vector[8], short vector[8], unsigned char vector[16])(<8 x i16> [[REG201]], <8 x i16> [[REG202]], <16 x i8> <i8 2, i8 3, i8 6, i8 7, i8 10, i8 11, i8 14, i8 15, i8 2, i8 3, i8 6, i8 7, i8 10, i8 11, i8 14, i8 15>)
+// CHECK-NEXT: store <8 x i16> [[REG203]], <8 x i16>* [[REG204:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG205:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG198]], align 16
+// CHECK-NEXT: [[REG206:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG198]], align 16
+// CHECK-NEXT: [[REG207:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_perm(short vector[8], short vector[8], unsigned char vector[16])(<8 x i16> [[REG205]], <8 x i16> [[REG206]], <16 x i8> <i8 0, i8 1, i8 4, i8 5, i8 8, i8 9, i8 12, i8 13, i8 0, i8 1, i8 4, i8 5, i8 8, i8 9, i8 12, i8 13>)
+// CHECK-NEXT: store <8 x i16> [[REG207]], <8 x i16>* [[REG198]], align 16
+// CHECK-NEXT: [[REG208:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG198]], align 16
+// CHECK-NEXT: [[REG209:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG204]], align 16
+// CHECK-NEXT: [[REG210:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_add(short vector[8], short vector[8])(<8 x i16> [[REG208]], <8 x i16> [[REG209]])
+// CHECK-NEXT: store <8 x i16> [[REG210]], <8 x i16>* [[REG198]], align 16
+// CHECK-NEXT: [[REG211:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG198]], align 16
+// CHECK-NEXT: [[REG212:[0-9a-zA-Z_%.]+]] = bitcast <8 x i16> [[REG211]] to <2 x i64>
+// CHECK-NEXT: [[REG213:[0-9a-zA-Z_%.]+]] = extractelement <2 x i64> [[REG212]], i32 1
+// CHECK-NEXT: ret i64 [[REG213]]
+
+// CHECK: define available_externally i64 @_mm_hadd_pi32(i64 [[REG214:[0-9a-zA-Z_%.]+]], i64 [[REG215:[0-9a-zA-Z_%.]+]])
+// CHECK: store i64 [[REG214]], i64* [[REG216:[0-9a-zA-Z_%.]+]], align 8
+// CHECK-NEXT: store i64 [[REG215]], i64* [[REG217:[0-9a-zA-Z_%.]+]], align 8
+// CHECK-NEXT: [[REG218:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG216]], align 8
+// CHECK-NEXT: [[REG219:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> undef, i64 [[REG218]], i32 0
+// CHECK-NEXT: [[REG220:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG217]], align 8
+// CHECK-NEXT: [[REG221:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> [[REG219]], i64 [[REG220]], i32 1
+// CHECK-NEXT: store <2 x i64> [[REG221]], <2 x i64>* [[REG222:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG223:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG222]], align 16
+// CHECK-NEXT: [[REG224:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG223]] to <4 x i32>
+// CHECK-NEXT: store <4 x i32> [[REG224]], <4 x i32>* [[REG225:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 8, i8 9, i8 10, i8 11, i8 0, i8 1, i8 2, i8 3, i8 8, i8 9, i8 10, i8 11>, <16 x i8>* [[REG226:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <16 x i8> <i8 4, i8 5, i8 6, i8 7, i8 12, i8 13, i8 14, i8 15, i8 4, i8 5, i8 6, i8 7, i8 12, i8 13, i8 14, i8 15>, <16 x i8>* [[REG227:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG228:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG225]], align 16
+// CHECK-NEXT: [[REG229:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG225]], align 16
+// CHECK-NEXT: [[REG230:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_perm(int vector[4], int vector[4], unsigned char vector[16])(<4 x i32> [[REG228]], <4 x i32> [[REG229]], <16 x i8> <i8 4, i8 5, i8 6, i8 7, i8 12, i8 13, i8 14, i8 15, i8 4, i8 5, i8 6, i8 7, i8 12, i8 13, i8 14, i8 15>)
+// CHECK-NEXT: store <4 x i32> [[REG230]], <4 x i32>* [[REG231:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG232:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG225]], align 16
+// CHECK-NEXT: [[REG233:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG225]], align 16
+// CHECK-NEXT: [[REG234:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_perm(int vector[4], int vector[4], unsigned char vector[16])(<4 x i32> [[REG232]], <4 x i32> [[REG233]], <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 8, i8 9, i8 10, i8 11, i8 0, i8 1, i8 2, i8 3, i8 8, i8 9, i8 10, i8 11>)
+// CHECK-NEXT: store <4 x i32> [[REG234]], <4 x i32>* [[REG225]], align 16
+// CHECK-NEXT: [[REG235:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG225]], align 16
+// CHECK-NEXT: [[REG236:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG231]], align 16
+// CHECK-NEXT: [[REG237:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_add(int vector[4], int vector[4])(<4 x i32> [[REG235]], <4 x i32> [[REG236]])
+// CHECK-NEXT: store <4 x i32> [[REG237]], <4 x i32>* [[REG225]], align 16
+// CHECK-NEXT: [[REG238:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG225]], align 16
+// CHECK-NEXT: [[REG239:[0-9a-zA-Z_%.]+]] = bitcast <4 x i32> [[REG238]] to <2 x i64>
+// CHECK-NEXT: [[REG240:[0-9a-zA-Z_%.]+]] = extractelement <2 x i64> [[REG239]], i32 1
+// CHECK-NEXT: ret i64 [[REG240]]
+
+// CHECK: define available_externally <2 x i64> @_mm_hadds_epi16(<2 x i64> [[REG241:[0-9a-zA-Z_%.]+]], <2 x i64> [[REG242:[0-9a-zA-Z_%.]+]])
+// CHECK: store <2 x i64> [[REG241]], <2 x i64>* [[REG243:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <2 x i64> [[REG242]], <2 x i64>* [[REG244:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <4 x i32> zeroinitializer, <4 x i32>* [[REG245:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <4 x i32> zeroinitializer, <4 x i32>* [[REG246:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG247:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG243]], align 16
+// CHECK-NEXT: [[REG248:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG247]] to <8 x i16>
+// CHECK-NEXT: [[REG249:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG245]], align 16
+// CHECK-NEXT: [[REG250:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_sum4s(short vector[8], int vector[4])(<8 x i16> [[REG248]], <4 x i32> [[REG249]])
+// CHECK-NEXT: store <4 x i32> [[REG250]], <4 x i32>* [[REG245]], align 16
+// CHECK-NEXT: [[REG251:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG244]], align 16
+// CHECK-NEXT: [[REG252:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG251]] to <8 x i16>
+// CHECK-NEXT: [[REG253:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG246]], align 16
+// CHECK-NEXT: [[REG254:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_sum4s(short vector[8], int vector[4])(<8 x i16> [[REG252]], <4 x i32> [[REG253]])
+// CHECK-NEXT: store <4 x i32> [[REG254]], <4 x i32>* [[REG246]], align 16
+// CHECK-NEXT: [[REG255:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG245]], align 16
+// CHECK-NEXT: [[REG256:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG246]], align 16
+// CHECK-NEXT: [[REG257:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_packs(int vector[4], int vector[4])(<4 x i32> [[REG255]], <4 x i32> [[REG256]])
+// CHECK-NEXT: [[REG258:[0-9a-zA-Z_%.]+]] = bitcast <8 x i16> [[REG257]] to <4 x i32>
+// CHECK-NEXT: store <4 x i32> [[REG258]], <4 x i32>* [[REG245]], align 16
+// CHECK-NEXT: [[REG259:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG245]], align 16
+// CHECK-NEXT: [[REG260:[0-9a-zA-Z_%.]+]] = bitcast <4 x i32> [[REG259]] to <2 x i64>
+// CHECK-NEXT: ret <2 x i64> [[REG260]]
+
+// CHECK: define available_externally i64 @_mm_hadds_pi16(i64 [[REG261:[0-9a-zA-Z_%.]+]], i64 [[REG262:[0-9a-zA-Z_%.]+]])
+// CHECK: store i64 [[REG261]], i64* [[REG263:[0-9a-zA-Z_%.]+]], align 8
+// CHECK-NEXT: store i64 [[REG262]], i64* [[REG264:[0-9a-zA-Z_%.]+]], align 8
+// CHECK-NEXT: store <4 x i32> zeroinitializer, <4 x i32>* [[REG265:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG266:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG263]], align 8
+// CHECK-NEXT: [[REG267:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> undef, i64 [[REG266]], i32 0
+// CHECK-NEXT: [[REG268:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG264]], align 8
+// CHECK-NEXT: [[REG269:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> [[REG267]], i64 [[REG268]], i32 1
+// CHECK-NEXT: store <2 x i64> [[REG269]], <2 x i64>* [[REG270:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG271:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG270]], align 16
+// CHECK-NEXT: [[REG272:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG271]] to <8 x i16>
+// CHECK-NEXT: store <8 x i16> [[REG272]], <8 x i16>* [[REG273:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG274:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG273]], align 16
+// CHECK-NEXT: [[REG275:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_sum4s(short vector[8], int vector[4])(<8 x i16> [[REG274]], <4 x i32> zeroinitializer)
+// CHECK-NEXT: store <4 x i32> [[REG275]], <4 x i32>* [[REG276:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG277:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG276]], align 16
+// CHECK-NEXT: [[REG278:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG276]], align 16
+// CHECK-NEXT: [[REG279:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_packs(int vector[4], int vector[4])(<4 x i32> [[REG277]], <4 x i32> [[REG278]])
+// CHECK-NEXT: store <8 x i16> [[REG279]], <8 x i16>* [[REG273]], align 16
+// CHECK-NEXT: [[REG280:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG273]], align 16
+// CHECK-NEXT: [[REG281:[0-9a-zA-Z_%.]+]] = bitcast <8 x i16> [[REG280]] to <2 x i64>
+// CHECK-NEXT: [[REG282:[0-9a-zA-Z_%.]+]] = extractelement <2 x i64> [[REG281]], i32 1
+// CHECK-NEXT: ret i64 [[REG282]]
+
+void __attribute__((noinline))
+test_hsub() {
+ resi = _mm_hsub_epi16(mi1, mi2);
+ resi = _mm_hsub_epi32(mi1, mi2);
+ res = _mm_hsub_pi16(m1, m2);
+ res = _mm_hsub_pi32(m1, m2);
+ resi = _mm_hsubs_epi16(mi1, mi2);
+ res = _mm_hsubs_pi16(m1, m2);
+}
+
+// CHECK-LABEL: @test_hsub
+
+// CHECK: define available_externally <2 x i64> @_mm_hsub_epi16(<2 x i64> [[REG283:[0-9a-zA-Z_%.]+]], <2 x i64> [[REG284:[0-9a-zA-Z_%.]+]])
+// CHECK: store <2 x i64> [[REG283]], <2 x i64>* [[REG285:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <2 x i64> [[REG284]], <2 x i64>* [[REG286:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <16 x i8> <i8 0, i8 1, i8 4, i8 5, i8 8, i8 9, i8 12, i8 13, i8 16, i8 17, i8 20, i8 21, i8 24, i8 25, i8 28, i8 29>, <16 x i8>* [[REG287:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <16 x i8> <i8 2, i8 3, i8 6, i8 7, i8 10, i8 11, i8 14, i8 15, i8 18, i8 19, i8 22, i8 23, i8 26, i8 27, i8 30, i8 31>, <16 x i8>* [[REG288:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG289:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG285]], align 16
+// CHECK-NEXT: [[REG290:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG289]] to <8 x i16>
+// CHECK-NEXT: [[REG291:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG286]], align 16
+// CHECK-NEXT: [[REG292:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG291]] to <8 x i16>
+// CHECK-NEXT: [[REG293:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_perm(short vector[8], short vector[8], unsigned char vector[16])(<8 x i16> [[REG290]], <8 x i16> [[REG292]], <16 x i8> <i8 0, i8 1, i8 4, i8 5, i8 8, i8 9, i8 12, i8 13, i8 16, i8 17, i8 20, i8 21, i8 24, i8 25, i8 28, i8 29>)
+// CHECK-NEXT: store <8 x i16> [[REG293]], <8 x i16>* [[REG294:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG295:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG285]], align 16
+// CHECK-NEXT: [[REG296:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG295]] to <8 x i16>
+// CHECK-NEXT: [[REG297:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG286]], align 16
+// CHECK-NEXT: [[REG298:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG297]] to <8 x i16>
+// CHECK-NEXT: [[REG299:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_perm(short vector[8], short vector[8], unsigned char vector[16])(<8 x i16> [[REG296]], <8 x i16> [[REG298]], <16 x i8> <i8 2, i8 3, i8 6, i8 7, i8 10, i8 11, i8 14, i8 15, i8 18, i8 19, i8 22, i8 23, i8 26, i8 27, i8 30, i8 31>)
+// CHECK-NEXT: store <8 x i16> [[REG299]], <8 x i16>* [[REG300:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG301:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG294]], align 16
+// CHECK-NEXT: [[REG302:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG300]], align 16
+// CHECK-NEXT: [[REG303:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_sub(short vector[8], short vector[8])(<8 x i16> [[REG301]], <8 x i16> [[REG302]])
+// CHECK-NEXT: [[REG304:[0-9a-zA-Z_%.]+]] = bitcast <8 x i16> [[REG303]] to <2 x i64>
+// CHECK-NEXT: ret <2 x i64> [[REG304]]
+
+// CHECK: define available_externally <2 x i64> @_mm_hsub_epi32(<2 x i64> [[REG305:[0-9a-zA-Z_%.]+]], <2 x i64> [[REG306:[0-9a-zA-Z_%.]+]])
+// CHECK: store <2 x i64> [[REG305]], <2 x i64>* [[REG307:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <2 x i64> [[REG306]], <2 x i64>* [[REG308:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 8, i8 9, i8 10, i8 11, i8 16, i8 17, i8 18, i8 19, i8 24, i8 25, i8 26, i8 27>, <16 x i8>* [[REG309:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <16 x i8> <i8 4, i8 5, i8 6, i8 7, i8 12, i8 13, i8 14, i8 15, i8 20, i8 21, i8 22, i8 23, i8 28, i8 29, i8 30, i8 31>, <16 x i8>* [[REG310:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG311:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG307]], align 16
+// CHECK-NEXT: [[REG312:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG311]] to <4 x i32>
+// CHECK-NEXT: [[REG313:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG308]], align 16
+// CHECK-NEXT: [[REG314:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG313]] to <4 x i32>
+// CHECK-NEXT: [[REG315:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_perm(int vector[4], int vector[4], unsigned char vector[16])(<4 x i32> [[REG312]], <4 x i32> [[REG314]], <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 8, i8 9, i8 10, i8 11, i8 16, i8 17, i8 18, i8 19, i8 24, i8 25, i8 26, i8 27>)
+// CHECK-NEXT: store <4 x i32> [[REG315]], <4 x i32>* [[REG316:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG317:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG307]], align 16
+// CHECK-NEXT: [[REG318:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG317]] to <4 x i32>
+// CHECK-NEXT: [[REG319:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG308]], align 16
+// CHECK-NEXT: [[REG320:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG319]] to <4 x i32>
+// CHECK-NEXT: [[REG321:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_perm(int vector[4], int vector[4], unsigned char vector[16])(<4 x i32> [[REG318]], <4 x i32> [[REG320]], <16 x i8> <i8 4, i8 5, i8 6, i8 7, i8 12, i8 13, i8 14, i8 15, i8 20, i8 21, i8 22, i8 23, i8 28, i8 29, i8 30, i8 31>)
+// CHECK-NEXT: store <4 x i32> [[REG321]], <4 x i32>* [[REG322:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG323:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG316]], align 16
+// CHECK-NEXT: [[REG324:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG322]], align 16
+// CHECK-NEXT: [[REG325:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_sub(int vector[4], int vector[4])(<4 x i32> [[REG323]], <4 x i32> [[REG324]])
+// CHECK-NEXT: [[REG326:[0-9a-zA-Z_%.]+]] = bitcast <4 x i32> [[REG325]] to <2 x i64>
+// CHECK-NEXT: ret <2 x i64> [[REG326]]
+
+// CHECK: define available_externally i64 @_mm_hsub_pi16(i64 [[REG327:[0-9a-zA-Z_%.]+]], i64 [[REG328:[0-9a-zA-Z_%.]+]])
+// CHECK: store i64 [[REG327]], i64* [[REG329:[0-9a-zA-Z_%.]+]], align 8
+// CHECK-NEXT: store i64 [[REG328]], i64* [[REG330:[0-9a-zA-Z_%.]+]], align 8
+// CHECK-NEXT: store <16 x i8> <i8 0, i8 1, i8 4, i8 5, i8 8, i8 9, i8 12, i8 13, i8 0, i8 1, i8 4, i8 5, i8 8, i8 9, i8 12, i8 13>, <16 x i8>* [[REG331:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <16 x i8> <i8 2, i8 3, i8 6, i8 7, i8 10, i8 11, i8 14, i8 15, i8 2, i8 3, i8 6, i8 7, i8 10, i8 11, i8 14, i8 15>, <16 x i8>* [[REG332:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG333:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG329]], align 8
+// CHECK-NEXT: [[REG334:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> undef, i64 [[REG333]], i32 0
+// CHECK-NEXT: [[REG335:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG330]], align 8
+// CHECK-NEXT: [[REG336:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> [[REG334]], i64 [[REG335]], i32 1
+// CHECK-NEXT: store <2 x i64> [[REG336]], <2 x i64>* [[REG337:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG338:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG337]], align 16
+// CHECK-NEXT: [[REG339:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG338]] to <8 x i16>
+// CHECK-NEXT: store <8 x i16> [[REG339]], <8 x i16>* [[REG340:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG341:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG340]], align 16
+// CHECK-NEXT: [[REG342:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG340]], align 16
+// CHECK-NEXT: [[REG343:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_perm(short vector[8], short vector[8], unsigned char vector[16])(<8 x i16> [[REG341]], <8 x i16> [[REG342]], <16 x i8> <i8 2, i8 3, i8 6, i8 7, i8 10, i8 11, i8 14, i8 15, i8 2, i8 3, i8 6, i8 7, i8 10, i8 11, i8 14, i8 15>)
+// CHECK-NEXT: store <8 x i16> [[REG343]], <8 x i16>* [[REG344:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG345:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG340]], align 16
+// CHECK-NEXT: [[REG346:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG340]], align 16
+// CHECK-NEXT: [[REG347:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_perm(short vector[8], short vector[8], unsigned char vector[16])(<8 x i16> [[REG345]], <8 x i16> [[REG346]], <16 x i8> <i8 0, i8 1, i8 4, i8 5, i8 8, i8 9, i8 12, i8 13, i8 0, i8 1, i8 4, i8 5, i8 8, i8 9, i8 12, i8 13>)
+// CHECK-NEXT: store <8 x i16> [[REG347]], <8 x i16>* [[REG340]], align 16
+// CHECK-NEXT: [[REG348:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG340]], align 16
+// CHECK-NEXT: [[REG349:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG344]], align 16
+// CHECK-NEXT: [[REG350:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_sub(short vector[8], short vector[8])(<8 x i16> [[REG348]], <8 x i16> [[REG349]])
+// CHECK-NEXT: store <8 x i16> [[REG350]], <8 x i16>* [[REG340]], align 16
+// CHECK-NEXT: [[REG351:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG340]], align 16
+// CHECK-NEXT: [[REG352:[0-9a-zA-Z_%.]+]] = bitcast <8 x i16> [[REG351]] to <2 x i64>
+// CHECK-NEXT: [[REG353:[0-9a-zA-Z_%.]+]] = extractelement <2 x i64> [[REG352]], i32 1
+// CHECK-NEXT: ret i64 [[REG353]]
+
+// CHECK: define available_externally i64 @_mm_hsub_pi32(i64 [[REG354:[0-9a-zA-Z_%.]+]], i64 [[REG355:[0-9a-zA-Z_%.]+]])
+// CHECK: store i64 [[REG354]], i64* [[REG356:[0-9a-zA-Z_%.]+]], align 8
+// CHECK-NEXT: store i64 [[REG355]], i64* [[REG357:[0-9a-zA-Z_%.]+]], align 8
+// CHECK-NEXT: store <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 8, i8 9, i8 10, i8 11, i8 0, i8 1, i8 2, i8 3, i8 8, i8 9, i8 10, i8 11>, <16 x i8>* [[REG358:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <16 x i8> <i8 4, i8 5, i8 6, i8 7, i8 12, i8 13, i8 14, i8 15, i8 4, i8 5, i8 6, i8 7, i8 12, i8 13, i8 14, i8 15>, <16 x i8>* [[REG359:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG360:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG356]], align 8
+// CHECK-NEXT: [[REG361:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> undef, i64 [[REG360]], i32 0
+// CHECK-NEXT: [[REG362:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG357]], align 8
+// CHECK-NEXT: [[REG363:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> [[REG361]], i64 [[REG362]], i32 1
+// CHECK-NEXT: store <2 x i64> [[REG363]], <2 x i64>* [[REG364:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG365:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG364]], align 16
+// CHECK-NEXT: [[REG366:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG365]] to <4 x i32>
+// CHECK-NEXT: store <4 x i32> [[REG366]], <4 x i32>* [[REG367:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG368:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG367]], align 16
+// CHECK-NEXT: [[REG369:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG367]], align 16
+// CHECK-NEXT: [[REG370:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_perm(int vector[4], int vector[4], unsigned char vector[16])(<4 x i32> [[REG368]], <4 x i32> [[REG369]], <16 x i8> <i8 4, i8 5, i8 6, i8 7, i8 12, i8 13, i8 14, i8 15, i8 4, i8 5, i8 6, i8 7, i8 12, i8 13, i8 14, i8 15>)
+// CHECK-NEXT: store <4 x i32> [[REG370]], <4 x i32>* [[REG371:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG372:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG367]], align 16
+// CHECK-NEXT: [[REG373:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG367]], align 16
+// CHECK-NEXT: [[REG374:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_perm(int vector[4], int vector[4], unsigned char vector[16])(<4 x i32> [[REG372]], <4 x i32> [[REG373]], <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 8, i8 9, i8 10, i8 11, i8 0, i8 1, i8 2, i8 3, i8 8, i8 9, i8 10, i8 11>)
+// CHECK-NEXT: store <4 x i32> [[REG374]], <4 x i32>* [[REG367]], align 16
+// CHECK-NEXT: [[REG375:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG367]], align 16
+// CHECK-NEXT: [[REG376:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG371]], align 16
+// CHECK-NEXT: [[REG377:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_sub(int vector[4], int vector[4])(<4 x i32> [[REG375]], <4 x i32> [[REG376]])
+// CHECK-NEXT: store <4 x i32> [[REG377]], <4 x i32>* [[REG367]], align 16
+// CHECK-NEXT: [[REG378:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG367]], align 16
+// CHECK-NEXT: [[REG379:[0-9a-zA-Z_%.]+]] = bitcast <4 x i32> [[REG378]] to <2 x i64>
+// CHECK-NEXT: [[REG380:[0-9a-zA-Z_%.]+]] = extractelement <2 x i64> [[REG379]], i32 1
+// CHECK-NEXT: ret i64 [[REG380]]
+
+// CHECK: define available_externally <2 x i64> @_mm_hsubs_epi16(<2 x i64> [[REG381:[0-9a-zA-Z_%.]+]], <2 x i64> [[REG382:[0-9a-zA-Z_%.]+]])
+// CHECK: store <2 x i64> [[REG381]], <2 x i64>* [[REG383:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <2 x i64> [[REG382]], <2 x i64>* [[REG384:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <16 x i8> <i8 0, i8 1, i8 4, i8 5, i8 8, i8 9, i8 12, i8 13, i8 16, i8 17, i8 20, i8 21, i8 24, i8 25, i8 28, i8 29>, <16 x i8>* [[REG385:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <16 x i8> <i8 2, i8 3, i8 6, i8 7, i8 10, i8 11, i8 14, i8 15, i8 18, i8 19, i8 22, i8 23, i8 26, i8 27, i8 30, i8 31>, <16 x i8>* [[REG386:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG387:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG383]], align 16
+// CHECK-NEXT: [[REG388:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG387]] to <8 x i16>
+// CHECK-NEXT: [[REG389:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG384]], align 16
+// CHECK-NEXT: [[REG390:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG389]] to <8 x i16>
+// CHECK-NEXT: [[REG391:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_perm(short vector[8], short vector[8], unsigned char vector[16])(<8 x i16> [[REG388]], <8 x i16> [[REG390]], <16 x i8> <i8 0, i8 1, i8 4, i8 5, i8 8, i8 9, i8 12, i8 13, i8 16, i8 17, i8 20, i8 21, i8 24, i8 25, i8 28, i8 29>)
+// CHECK-NEXT: store <8 x i16> [[REG391]], <8 x i16>* [[REG392:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG393:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG383]], align 16
+// CHECK-NEXT: [[REG394:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG393]] to <8 x i16>
+// CHECK-NEXT: [[REG395:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG384]], align 16
+// CHECK-NEXT: [[REG396:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG395]] to <8 x i16>
+// CHECK-NEXT: [[REG397:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_perm(short vector[8], short vector[8], unsigned char vector[16])(<8 x i16> [[REG394]], <8 x i16> [[REG396]], <16 x i8> <i8 2, i8 3, i8 6, i8 7, i8 10, i8 11, i8 14, i8 15, i8 18, i8 19, i8 22, i8 23, i8 26, i8 27, i8 30, i8 31>)
+// CHECK-NEXT: store <8 x i16> [[REG397]], <8 x i16>* [[REG398:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG399:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG392]], align 16
+// CHECK-NEXT: [[REG400:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG398]], align 16
+// CHECK-NEXT: [[REG401:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_subs(short vector[8], short vector[8])(<8 x i16> [[REG399]], <8 x i16> [[REG400]])
+// CHECK-NEXT: [[REG402:[0-9a-zA-Z_%.]+]] = bitcast <8 x i16> [[REG401]] to <2 x i64>
+// CHECK-NEXT: ret <2 x i64> [[REG402]]
+
+// CHECK: define available_externally i64 @_mm_hsubs_pi16(i64 [[REG403:[0-9a-zA-Z_%.]+]], i64 [[REG404:[0-9a-zA-Z_%.]+]])
+// CHECK: store i64 [[REG403]], i64* [[REG405:[0-9a-zA-Z_%.]+]], align 8
+// CHECK-NEXT: store i64 [[REG404]], i64* [[REG406:[0-9a-zA-Z_%.]+]], align 8
+// CHECK-NEXT: store <16 x i8> <i8 0, i8 1, i8 4, i8 5, i8 8, i8 9, i8 12, i8 13, i8 0, i8 1, i8 4, i8 5, i8 8, i8 9, i8 12, i8 13>, <16 x i8>* [[REG407:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <16 x i8> <i8 2, i8 3, i8 6, i8 7, i8 10, i8 11, i8 14, i8 15, i8 2, i8 3, i8 6, i8 7, i8 10, i8 11, i8 14, i8 15>, <16 x i8>* [[REG408:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG409:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG405]], align 8
+// CHECK-NEXT: [[REG410:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> undef, i64 [[REG409]], i32 0
+// CHECK-NEXT: [[REG411:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG406]], align 8
+// CHECK-NEXT: [[REG412:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> [[REG410]], i64 [[REG411]], i32 1
+// CHECK-NEXT: store <2 x i64> [[REG412]], <2 x i64>* [[REG413:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG414:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG413]], align 16
+// CHECK-NEXT: [[REG415:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG414]] to <8 x i16>
+// CHECK-NEXT: store <8 x i16> [[REG415]], <8 x i16>* [[REG416:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG417:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG416]], align 16
+// CHECK-NEXT: [[REG418:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG416]], align 16
+// CHECK-NEXT: [[REG419:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_perm(short vector[8], short vector[8], unsigned char vector[16])(<8 x i16> [[REG417]], <8 x i16> [[REG418]], <16 x i8> <i8 0, i8 1, i8 4, i8 5, i8 8, i8 9, i8 12, i8 13, i8 0, i8 1, i8 4, i8 5, i8 8, i8 9, i8 12, i8 13>)
+// CHECK-NEXT: store <8 x i16> [[REG419]], <8 x i16>* [[REG420:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG421:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG416]], align 16
+// CHECK-NEXT: [[REG422:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG416]], align 16
+// CHECK-NEXT: [[REG423:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_perm(short vector[8], short vector[8], unsigned char vector[16])(<8 x i16> [[REG421]], <8 x i16> [[REG422]], <16 x i8> <i8 2, i8 3, i8 6, i8 7, i8 10, i8 11, i8 14, i8 15, i8 2, i8 3, i8 6, i8 7, i8 10, i8 11, i8 14, i8 15>)
+// CHECK-NEXT: store <8 x i16> [[REG423]], <8 x i16>* [[REG424:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG425:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG420]], align 16
+// CHECK-NEXT: [[REG426:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG424]], align 16
+// CHECK-NEXT: [[REG427:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_subs(short vector[8], short vector[8])(<8 x i16> [[REG425]], <8 x i16> [[REG426]])
+// CHECK-NEXT: store <8 x i16> [[REG427]], <8 x i16>* [[REG416]], align 16
+// CHECK-NEXT: [[REG428:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG416]], align 16
+// CHECK-NEXT: [[REG429:[0-9a-zA-Z_%.]+]] = bitcast <8 x i16> [[REG428]] to <2 x i64>
+// CHECK-NEXT: [[REG430:[0-9a-zA-Z_%.]+]] = extractelement <2 x i64> [[REG429]], i32 1
+// CHECK-NEXT: ret i64 [[REG430]]
+
+void __attribute__((noinline))
+test_shuffle() {
+ resi = _mm_shuffle_epi8(mi1, mi2);
+ res = _mm_shuffle_pi8(m1, m2);
+}
+
+// CHECK-LABEL: @test_shuffle
+
+// CHECK: define available_externally <2 x i64> @_mm_shuffle_epi8(<2 x i64> [[REG431:[0-9a-zA-Z_%.]+]], <2 x i64> [[REG432:[0-9a-zA-Z_%.]+]])
+// CHECK: store <2 x i64> [[REG431]], <2 x i64>* [[REG433:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <2 x i64> [[REG432]], <2 x i64>* [[REG434:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <16 x i8> zeroinitializer, <16 x i8>* [[REG435:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG436:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG434]], align 16
+// CHECK-NEXT: [[REG437:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG436]] to <16 x i8>
+// CHECK-NEXT: [[REG438:[0-9a-zA-Z_%.]+]] = call <16 x i8> @vec_cmplt(signed char vector[16], signed char vector[16])(<16 x i8> [[REG437]], <16 x i8> zeroinitializer)
+// CHECK-NEXT: store <16 x i8> [[REG438]], <16 x i8>* [[REG439:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG440:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG433]], align 16
+// CHECK-NEXT: [[REG441:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG440]] to <16 x i8>
+// CHECK-NEXT: [[REG442:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG433]], align 16
+// CHECK-NEXT: [[REG443:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG442]] to <16 x i8>
+// CHECK-NEXT: [[REG444:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG434]], align 16
+// CHECK-NEXT: [[REG445:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG444]] to <16 x i8>
+// CHECK-NEXT: [[REG446:[0-9a-zA-Z_%.]+]] = call <16 x i8> @vec_perm(signed char vector[16], signed char vector[16], unsigned char vector[16])(<16 x i8> [[REG441]], <16 x i8> [[REG443]], <16 x i8> [[REG445]])
+// CHECK-NEXT: store <16 x i8> [[REG446]], <16 x i8>* [[REG447:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG448:[0-9a-zA-Z_%.]+]] = load <16 x i8>, <16 x i8>* [[REG447]], align 16
+// CHECK-NEXT: [[REG449:[0-9a-zA-Z_%.]+]] = load <16 x i8>, <16 x i8>* [[REG439]], align 16
+// CHECK-NEXT: [[REG450:[0-9a-zA-Z_%.]+]] = call <16 x i8> @vec_sel(signed char vector[16], signed char vector[16], bool vector[16])(<16 x i8> [[REG448]], <16 x i8> zeroinitializer, <16 x i8> [[REG449]])
+// CHECK-NEXT: [[REG451:[0-9a-zA-Z_%.]+]] = bitcast <16 x i8> [[REG450]] to <2 x i64>
+// CHECK-NEXT: ret <2 x i64> [[REG451]]
+
+// CHECK: define available_externally i64 @_mm_shuffle_pi8(i64 [[REG452:[0-9a-zA-Z_%.]+]], i64 [[REG453:[0-9a-zA-Z_%.]+]])
+// CHECK: store i64 [[REG452]], i64* [[REG454:[0-9a-zA-Z_%.]+]], align 8
+// CHECK-NEXT: store i64 [[REG453]], i64* [[REG455:[0-9a-zA-Z_%.]+]], align 8
+// CHECK-NEXT: store <16 x i8> zeroinitializer, <16 x i8>* [[REG456:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG457:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG454]], align 8
+// CHECK-NEXT: [[REG458:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> undef, i64 [[REG457]], i32 0
+// CHECK-NEXT: [[REG459:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG454]], align 8
+// CHECK-NEXT: [[REG460:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> [[REG458]], i64 [[REG459]], i32 1
+// CHECK-NEXT: store <2 x i64> [[REG460]], <2 x i64>* [[REG461:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG462:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG461]], align 16
+// CHECK-NEXT: [[REG463:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG462]] to <16 x i8>
+// CHECK-NEXT: store <16 x i8> [[REG463]], <16 x i8>* [[REG464:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG465:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG455]], align 8
+// CHECK-NEXT: [[REG466:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> undef, i64 [[REG465]], i32 0
+// CHECK-NEXT: [[REG467:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG455]], align 8
+// CHECK-NEXT: [[REG468:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> [[REG466]], i64 [[REG467]], i32 1
+// CHECK-NEXT: store <2 x i64> [[REG468]], <2 x i64>* [[REG469:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG470:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG469]], align 16
+// CHECK-NEXT: [[REG471:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG470]] to <16 x i8>
+// CHECK-NEXT: store <16 x i8> [[REG471]], <16 x i8>* [[REG472:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG473:[0-9a-zA-Z_%.]+]] = load <16 x i8>, <16 x i8>* [[REG472]], align 16
+// CHECK-NEXT: [[REG474:[0-9a-zA-Z_%.]+]] = call <16 x i8> @vec_cmplt(signed char vector[16], signed char vector[16])(<16 x i8> [[REG473]], <16 x i8> zeroinitializer)
+// CHECK-NEXT: store <16 x i8> [[REG474]], <16 x i8>* [[REG475:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG476:[0-9a-zA-Z_%.]+]] = load <16 x i8>, <16 x i8>* [[REG464]], align 16
+// CHECK-NEXT: [[REG477:[0-9a-zA-Z_%.]+]] = load <16 x i8>, <16 x i8>* [[REG464]], align 16
+// CHECK-NEXT: [[REG478:[0-9a-zA-Z_%.]+]] = load <16 x i8>, <16 x i8>* [[REG472]], align 16
+// CHECK-NEXT: [[REG479:[0-9a-zA-Z_%.]+]] = call <16 x i8> @vec_perm(signed char vector[16], signed char vector[16], unsigned char vector[16])(<16 x i8> [[REG476]], <16 x i8> [[REG477]], <16 x i8> [[REG478]])
+// CHECK-NEXT: store <16 x i8> [[REG479]], <16 x i8>* [[REG464]], align 16
+// CHECK-NEXT: [[REG480:[0-9a-zA-Z_%.]+]] = load <16 x i8>, <16 x i8>* [[REG464]], align 16
+// CHECK-NEXT: [[REG481:[0-9a-zA-Z_%.]+]] = load <16 x i8>, <16 x i8>* [[REG475]], align 16
+// CHECK-NEXT: [[REG482:[0-9a-zA-Z_%.]+]] = call <16 x i8> @vec_sel(signed char vector[16], signed char vector[16], bool vector[16])(<16 x i8> [[REG480]], <16 x i8> zeroinitializer, <16 x i8> [[REG481]])
+// CHECK-NEXT: store <16 x i8> [[REG482]], <16 x i8>* [[REG464]], align 16
+// CHECK-NEXT: [[REG483:[0-9a-zA-Z_%.]+]] = load <16 x i8>, <16 x i8>* [[REG464]], align 16
+// CHECK-NEXT: [[REG484:[0-9a-zA-Z_%.]+]] = bitcast <16 x i8> [[REG483]] to <2 x i64>
+// CHECK-NEXT: [[REG485:[0-9a-zA-Z_%.]+]] = extractelement <2 x i64> [[REG484]], i32 0
+// CHECK-NEXT: ret i64 [[REG485]]
+
+void __attribute__((noinline))
+test_sign() {
+ resi = _mm_sign_epi8(mi1, mi2);
+ resi = _mm_sign_epi16(mi1, mi2);
+ resi = _mm_sign_epi32(mi1, mi2);
+ res = _mm_sign_pi8(m1, m2);
+ res = _mm_sign_pi16(m1, m2);
+ res = _mm_sign_pi32(m1, m2);
+}
+
+// CHECK-LABEL: @test_sign
+
+// CHECK: define available_externally <2 x i64> @_mm_sign_epi8(<2 x i64> [[REG486:[0-9a-zA-Z_%.]+]], <2 x i64> [[REG487:[0-9a-zA-Z_%.]+]])
+// CHECK: store <2 x i64> [[REG486]], <2 x i64>* [[REG488:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <2 x i64> [[REG487]], <2 x i64>* [[REG489:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <16 x i8> zeroinitializer, <16 x i8>* [[REG490:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG491:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG489]], align 16
+// CHECK-NEXT: [[REG492:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG491]] to <16 x i8>
+// CHECK-NEXT: [[REG493:[0-9a-zA-Z_%.]+]] = call <16 x i8> @vec_cmplt(signed char vector[16], signed char vector[16])(<16 x i8> [[REG492]], <16 x i8> zeroinitializer)
+// CHECK-NEXT: store <16 x i8> [[REG493]], <16 x i8>* [[REG494:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG495:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG489]], align 16
+// CHECK-NEXT: [[REG496:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG495]] to <16 x i8>
+// CHECK-NEXT: [[REG497:[0-9a-zA-Z_%.]+]] = call <16 x i8> @vec_cmpgt(signed char vector[16], signed char vector[16])(<16 x i8> [[REG496]], <16 x i8> zeroinitializer)
+// CHECK-NEXT: [[REG498:[0-9a-zA-Z_%.]+]] = call <16 x i8> @vec_neg(signed char vector[16])(<16 x i8> [[REG497]])
+// CHECK-NEXT: store <16 x i8> [[REG498]], <16 x i8>* [[REG499:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG500:[0-9a-zA-Z_%.]+]] = load <16 x i8>, <16 x i8>* [[REG494]], align 16
+// CHECK-NEXT: [[REG501:[0-9a-zA-Z_%.]+]] = load <16 x i8>, <16 x i8>* [[REG499]], align 16
+// CHECK-NEXT: [[REG502:[0-9a-zA-Z_%.]+]] = call <16 x i8> @vec_add(signed char vector[16], signed char vector[16])(<16 x i8> [[REG500]], <16 x i8> [[REG501]])
+// CHECK-NEXT: store <16 x i8> [[REG502]], <16 x i8>* [[REG503:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG504:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG488]], align 16
+// CHECK-NEXT: [[REG505:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG504]] to <16 x i8>
+// CHECK-NEXT: [[REG506:[0-9a-zA-Z_%.]+]] = load <16 x i8>, <16 x i8>* [[REG503]], align 16
+// CHECK-NEXT: [[REG507:[0-9a-zA-Z_%.]+]] = call <16 x i8> @vec_mul(signed char vector[16], signed char vector[16])(<16 x i8> [[REG505]], <16 x i8> [[REG506]])
+// CHECK-NEXT: [[REG508:[0-9a-zA-Z_%.]+]] = bitcast <16 x i8> [[REG507]] to <2 x i64>
+// CHECK-NEXT: ret <2 x i64> [[REG508]]
+
+// CHECK: define available_externally <2 x i64> @_mm_sign_epi16(<2 x i64> [[REG509:[0-9a-zA-Z_%.]+]], <2 x i64> [[REG510:[0-9a-zA-Z_%.]+]])
+// CHECK: store <2 x i64> [[REG509]], <2 x i64>* [[REG511:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <2 x i64> [[REG510]], <2 x i64>* [[REG512:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <8 x i16> zeroinitializer, <8 x i16>* [[REG513:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG514:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG512]], align 16
+// CHECK-NEXT: [[REG515:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG514]] to <8 x i16>
+// CHECK-NEXT: [[REG516:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_cmplt(short vector[8], short vector[8])(<8 x i16> [[REG515]], <8 x i16> zeroinitializer)
+// CHECK-NEXT: store <8 x i16> [[REG516]], <8 x i16>* [[REG517:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG518:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG512]], align 16
+// CHECK-NEXT: [[REG519:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG518]] to <8 x i16>
+// CHECK-NEXT: [[REG520:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_cmpgt(short vector[8], short vector[8])(<8 x i16> [[REG519]], <8 x i16> zeroinitializer)
+// CHECK-NEXT: [[REG521:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_neg(short vector[8])(<8 x i16> [[REG520]])
+// CHECK-NEXT: store <8 x i16> [[REG521]], <8 x i16>* [[REG522:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG523:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG517]], align 16
+// CHECK-NEXT: [[REG524:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG522]], align 16
+// CHECK-NEXT: [[REG525:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_add(short vector[8], short vector[8])(<8 x i16> [[REG523]], <8 x i16> [[REG524]])
+// CHECK-NEXT: store <8 x i16> [[REG525]], <8 x i16>* [[REG526:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG527:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG511]], align 16
+// CHECK-NEXT: [[REG528:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG527]] to <8 x i16>
+// CHECK-NEXT: [[REG529:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG526]], align 16
+// CHECK-NEXT: [[REG530:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_mul(short vector[8], short vector[8])(<8 x i16> [[REG528]], <8 x i16> [[REG529]])
+// CHECK-NEXT: [[REG531:[0-9a-zA-Z_%.]+]] = bitcast <8 x i16> [[REG530]] to <2 x i64>
+// CHECK-NEXT: ret <2 x i64> [[REG531]]
+
+// CHECK: define available_externally <2 x i64> @_mm_sign_epi32(<2 x i64> [[REG532:[0-9a-zA-Z_%.]+]], <2 x i64> [[REG533:[0-9a-zA-Z_%.]+]])
+// CHECK: store <2 x i64> [[REG532]], <2 x i64>* [[REG534:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <2 x i64> [[REG533]], <2 x i64>* [[REG535:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <4 x i32> zeroinitializer, <4 x i32>* [[REG536:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG537:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG535]], align 16
+// CHECK-NEXT: [[REG538:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG537]] to <4 x i32>
+// CHECK-NEXT: [[REG539:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_cmplt(int vector[4], int vector[4])(<4 x i32> [[REG538]], <4 x i32> zeroinitializer)
+// CHECK-NEXT: store <4 x i32> [[REG539]], <4 x i32>* [[REG540:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG541:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG535]], align 16
+// CHECK-NEXT: [[REG542:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG541]] to <4 x i32>
+// CHECK-NEXT: [[REG543:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_cmpgt(int vector[4], int vector[4])(<4 x i32> [[REG542]], <4 x i32> zeroinitializer)
+// CHECK-NEXT: [[REG544:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_neg(int vector[4])(<4 x i32> [[REG543]])
+// CHECK-NEXT: store <4 x i32> [[REG544]], <4 x i32>* [[REG545:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG546:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG540]], align 16
+// CHECK-NEXT: [[REG547:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG545]], align 16
+// CHECK-NEXT: [[REG548:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_add(int vector[4], int vector[4])(<4 x i32> [[REG546]], <4 x i32> [[REG547]])
+// CHECK-NEXT: store <4 x i32> [[REG548]], <4 x i32>* [[REG549:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG550:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG534]], align 16
+// CHECK-NEXT: [[REG551:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG550]] to <4 x i32>
+// CHECK-NEXT: [[REG552:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG549]], align 16
+// CHECK-NEXT: [[REG553:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_mul(int vector[4], int vector[4])(<4 x i32> [[REG551]], <4 x i32> [[REG552]])
+// CHECK-NEXT: [[REG554:[0-9a-zA-Z_%.]+]] = bitcast <4 x i32> [[REG553]] to <2 x i64>
+// CHECK-NEXT: ret <2 x i64> [[REG554]]
+
+// CHECK: define available_externally i64 @_mm_sign_pi8(i64 [[REG555:[0-9a-zA-Z_%.]+]], i64 [[REG556:[0-9a-zA-Z_%.]+]])
+// CHECK: store i64 [[REG555]], i64* [[REG557:[0-9a-zA-Z_%.]+]], align 8
+// CHECK-NEXT: store i64 [[REG556]], i64* [[REG558:[0-9a-zA-Z_%.]+]], align 8
+// CHECK-NEXT: store <16 x i8> zeroinitializer, <16 x i8>* [[REG559:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG560:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG557]], align 8
+// CHECK-NEXT: [[REG561:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> undef, i64 [[REG560]], i32 0
+// CHECK-NEXT: [[REG562:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG557]], align 8
+// CHECK-NEXT: [[REG563:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> [[REG561]], i64 [[REG562]], i32 1
+// CHECK-NEXT: store <2 x i64> [[REG563]], <2 x i64>* [[REG564:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG565:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG564]], align 16
+// CHECK-NEXT: [[REG566:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG565]] to <16 x i8>
+// CHECK-NEXT: store <16 x i8> [[REG566]], <16 x i8>* [[REG567:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG568:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG558]], align 8
+// CHECK-NEXT: [[REG569:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> undef, i64 [[REG568]], i32 0
+// CHECK-NEXT: [[REG570:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG558]], align 8
+// CHECK-NEXT: [[REG571:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> [[REG569]], i64 [[REG570]], i32 1
+// CHECK-NEXT: store <2 x i64> [[REG571]], <2 x i64>* [[REG572:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG573:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG572]], align 16
+// CHECK-NEXT: [[REG574:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG573]] to <16 x i8>
+// CHECK-NEXT: store <16 x i8> [[REG574]], <16 x i8>* [[REG575:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG576:[0-9a-zA-Z_%.]+]] = load <16 x i8>, <16 x i8>* [[REG567]], align 16
+// CHECK-NEXT: [[REG577:[0-9a-zA-Z_%.]+]] = bitcast <16 x i8> [[REG576]] to <2 x i64>
+// CHECK-NEXT: [[REG578:[0-9a-zA-Z_%.]+]] = load <16 x i8>, <16 x i8>* [[REG575]], align 16
+// CHECK-NEXT: [[REG579:[0-9a-zA-Z_%.]+]] = bitcast <16 x i8> [[REG578]] to <2 x i64>
+// CHECK-NEXT: [[REG580:[0-9a-zA-Z_%.]+]] = call <2 x i64> @_mm_sign_epi8(<2 x i64> [[REG577]], <2 x i64> [[REG579]])
+// CHECK-NEXT: [[REG581:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG580]] to <16 x i8>
+// CHECK-NEXT: store <16 x i8> [[REG581]], <16 x i8>* [[REG567]], align 16
+// CHECK-NEXT: [[REG582:[0-9a-zA-Z_%.]+]] = load <16 x i8>, <16 x i8>* [[REG567]], align 16
+// CHECK-NEXT: [[REG583:[0-9a-zA-Z_%.]+]] = bitcast <16 x i8> [[REG582]] to <2 x i64>
+// CHECK-NEXT: [[REG584:[0-9a-zA-Z_%.]+]] = extractelement <2 x i64> [[REG583]], i32 0
+// CHECK-NEXT: ret i64 [[REG584]]
+
+// CHECK: define available_externally i64 @_mm_sign_pi16(i64 [[REG585:[0-9a-zA-Z_%.]+]], i64 [[REG586:[0-9a-zA-Z_%.]+]])
+// CHECK: store i64 [[REG585]], i64* [[REG587:[0-9a-zA-Z_%.]+]], align 8
+// CHECK-NEXT: store i64 [[REG586]], i64* [[REG588:[0-9a-zA-Z_%.]+]], align 8
+// CHECK-NEXT: store <8 x i16> zeroinitializer, <8 x i16>* [[REG589:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG590:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG587]], align 8
+// CHECK-NEXT: [[REG591:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> undef, i64 [[REG590]], i32 0
+// CHECK-NEXT: [[REG592:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG587]], align 8
+// CHECK-NEXT: [[REG593:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> [[REG591]], i64 [[REG592]], i32 1
+// CHECK-NEXT: store <2 x i64> [[REG593]], <2 x i64>* [[REG594:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG595:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG594]], align 16
+// CHECK-NEXT: [[REG596:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG595]] to <8 x i16>
+// CHECK-NEXT: store <8 x i16> [[REG596]], <8 x i16>* [[REG597:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG598:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG588]], align 8
+// CHECK-NEXT: [[REG599:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> undef, i64 [[REG598]], i32 0
+// CHECK-NEXT: [[REG600:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG588]], align 8
+// CHECK-NEXT: [[REG601:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> [[REG599]], i64 [[REG600]], i32 1
+// CHECK-NEXT: store <2 x i64> [[REG601]], <2 x i64>* [[REG602:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG603:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG602]], align 16
+// CHECK-NEXT: [[REG604:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG603]] to <8 x i16>
+// CHECK-NEXT: store <8 x i16> [[REG604]], <8 x i16>* [[REG605:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG606:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG597]], align 16
+// CHECK-NEXT: [[REG607:[0-9a-zA-Z_%.]+]] = bitcast <8 x i16> [[REG606]] to <2 x i64>
+// CHECK-NEXT: [[REG608:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG605]], align 16
+// CHECK-NEXT: [[REG609:[0-9a-zA-Z_%.]+]] = bitcast <8 x i16> [[REG608]] to <2 x i64>
+// CHECK-NEXT: [[REG610:[0-9a-zA-Z_%.]+]] = call <2 x i64> @_mm_sign_epi16(<2 x i64> [[REG607]], <2 x i64> [[REG609]])
+// CHECK-NEXT: [[REG611:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG610]] to <8 x i16>
+// CHECK-NEXT: store <8 x i16> [[REG611]], <8 x i16>* [[REG597]], align 16
+// CHECK-NEXT: [[REG612:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG597]], align 16
+// CHECK-NEXT: [[REG613:[0-9a-zA-Z_%.]+]] = bitcast <8 x i16> [[REG612]] to <2 x i64>
+// CHECK-NEXT: [[REG614:[0-9a-zA-Z_%.]+]] = extractelement <2 x i64> [[REG613]], i32 0
+// CHECK-NEXT: ret i64 [[REG614]]
+
+// CHECK: define available_externally i64 @_mm_sign_pi32(i64 [[REG615:[0-9a-zA-Z_%.]+]], i64 [[REG616:[0-9a-zA-Z_%.]+]])
+// CHECK: store i64 [[REG615]], i64* [[REG617:[0-9a-zA-Z_%.]+]], align 8
+// CHECK-NEXT: store i64 [[REG616]], i64* [[REG618:[0-9a-zA-Z_%.]+]], align 8
+// CHECK-NEXT: store <4 x i32> zeroinitializer, <4 x i32>* [[REG619:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG620:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG617]], align 8
+// CHECK-NEXT: [[REG621:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> undef, i64 [[REG620]], i32 0
+// CHECK-NEXT: [[REG622:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG617]], align 8
+// CHECK-NEXT: [[REG623:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> [[REG621]], i64 [[REG622]], i32 1
+// CHECK-NEXT: store <2 x i64> [[REG623]], <2 x i64>* [[REG624:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG625:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG624]], align 16
+// CHECK-NEXT: [[REG626:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG625]] to <4 x i32>
+// CHECK-NEXT: store <4 x i32> [[REG626]], <4 x i32>* [[REG627:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG628:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG618]], align 8
+// CHECK-NEXT: [[REG629:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> undef, i64 [[REG628]], i32 0
+// CHECK-NEXT: [[REG630:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG618]], align 8
+// CHECK-NEXT: [[REG631:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> [[REG629]], i64 [[REG630]], i32 1
+// CHECK-NEXT: store <2 x i64> [[REG631]], <2 x i64>* [[REG632:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG633:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG632]], align 16
+// CHECK-NEXT: [[REG634:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG633]] to <4 x i32>
+// CHECK-NEXT: store <4 x i32> [[REG634]], <4 x i32>* [[REG635:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG636:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG627]], align 16
+// CHECK-NEXT: [[REG637:[0-9a-zA-Z_%.]+]] = bitcast <4 x i32> [[REG636]] to <2 x i64>
+// CHECK-NEXT: [[REG638:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG635]], align 16
+// CHECK-NEXT: [[REG639:[0-9a-zA-Z_%.]+]] = bitcast <4 x i32> [[REG638]] to <2 x i64>
+// CHECK-NEXT: [[REG640:[0-9a-zA-Z_%.]+]] = call <2 x i64> @_mm_sign_epi32(<2 x i64> [[REG637]], <2 x i64> [[REG639]])
+// CHECK-NEXT: [[REG641:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG640]] to <4 x i32>
+// CHECK-NEXT: store <4 x i32> [[REG641]], <4 x i32>* [[REG627]], align 16
+// CHECK-NEXT: [[REG642:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG627]], align 16
+// CHECK-NEXT: [[REG643:[0-9a-zA-Z_%.]+]] = bitcast <4 x i32> [[REG642]] to <2 x i64>
+// CHECK-NEXT: [[REG644:[0-9a-zA-Z_%.]+]] = extractelement <2 x i64> [[REG643]], i32 0
+// CHECK-NEXT: ret i64 [[REG644]]
+
+void __attribute__((noinline))
+test_maddubs() {
+ resi = _mm_maddubs_epi16(mi1, mi2);
+ res = _mm_maddubs_pi16(m1, m2);
+}
+
+// CHECK-LABEL: @test_maddubs
+
+// CHECK: define available_externally <2 x i64> @_mm_maddubs_epi16(<2 x i64> [[REG645:[0-9a-zA-Z_%.]+]], <2 x i64> [[REG646:[0-9a-zA-Z_%.]+]])
+// CHECK: store <2 x i64> [[REG645]], <2 x i64>* [[REG647:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <2 x i64> [[REG646]], <2 x i64>* [[REG648:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG649:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_splats(short)(i16 signext 255)
+// CHECK-NEXT: store <8 x i16> [[REG649]], <8 x i16>* [[REG650:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG651:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG647]], align 16
+// CHECK-NEXT: [[REG652:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG651]] to <16 x i8>
+// CHECK-NEXT: [[REG653:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_unpackh(signed char vector[16])(<16 x i8> [[REG652]])
+// CHECK-NEXT: [[REG654:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG650]], align 16
+// CHECK-NEXT: [[REG655:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_and(short vector[8], short vector[8])(<8 x i16> [[REG653]], <8 x i16> [[REG654]])
+// CHECK-NEXT: store <8 x i16> [[REG655]], <8 x i16>* [[REG656:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG657:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG647]], align 16
+// CHECK-NEXT: [[REG658:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG657]] to <16 x i8>
+// CHECK-NEXT: [[REG659:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_unpackl(signed char vector[16])(<16 x i8> [[REG658]])
+// CHECK-NEXT: [[REG660:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG650]], align 16
+// CHECK-NEXT: [[REG661:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_and(short vector[8], short vector[8])(<8 x i16> [[REG659]], <8 x i16> [[REG660]])
+// CHECK-NEXT: store <8 x i16> [[REG661]], <8 x i16>* [[REG662:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG663:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG648]], align 16
+// CHECK-NEXT: [[REG664:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG663]] to <16 x i8>
+// CHECK-NEXT: [[REG76:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_unpackh(signed char vector[16])(<16 x i8> [[REG664]])
+// CHECK-NEXT: store <8 x i16> [[REG76]], <8 x i16>* [[REG665:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG666:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG648]], align 16
+// CHECK-NEXT: [[REG667:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG666]] to <16 x i8>
+// CHECK-NEXT: [[REG668:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_unpackl(signed char vector[16])(<16 x i8> [[REG667]])
+// CHECK-NEXT: store <8 x i16> [[REG668]], <8 x i16>* [[REG669:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG670:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG656]], align 16
+// CHECK-NEXT: [[REG671:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG665]], align 16
+// CHECK-NEXT: [[REG672:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_mul(short vector[8], short vector[8])(<8 x i16> [[REG670]], <8 x i16> [[REG671]])
+// CHECK-NEXT: store <8 x i16> [[REG672]], <8 x i16>* [[REG656]], align 16
+// CHECK-NEXT: [[REG673:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG662]], align 16
+// CHECK-NEXT: [[REG674:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG669]], align 16
+// CHECK-NEXT: [[REG675:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_mul(short vector[8], short vector[8])(<8 x i16> [[REG673]], <8 x i16> [[REG674]])
+// CHECK-NEXT: store <8 x i16> [[REG675]], <8 x i16>* [[REG662]], align 16
+// CHECK-NEXT: store <16 x i8> <i8 0, i8 1, i8 4, i8 5, i8 8, i8 9, i8 12, i8 13, i8 16, i8 17, i8 20, i8 21, i8 24, i8 25, i8 28, i8 29>, <16 x i8>* [[REG676:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <16 x i8> <i8 2, i8 3, i8 6, i8 7, i8 10, i8 11, i8 14, i8 15, i8 18, i8 19, i8 22, i8 23, i8 26, i8 27, i8 30, i8 31>, <16 x i8>* [[REG677:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG678:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG656]], align 16
+// CHECK-NEXT: [[REG679:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG662]], align 16
+// CHECK-NEXT: [[REG680:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_perm(short vector[8], short vector[8], unsigned char vector[16])(<8 x i16> [[REG678]], <8 x i16> [[REG679]], <16 x i8> <i8 0, i8 1, i8 4, i8 5, i8 8, i8 9, i8 12, i8 13, i8 16, i8 17, i8 20, i8 21, i8 24, i8 25, i8 28, i8 29>)
+// CHECK-NEXT: store <8 x i16> [[REG680]], <8 x i16>* [[REG665]], align 16
+// CHECK-NEXT: [[REG681:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG656]], align 16
+// CHECK-NEXT: [[REG682:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG662]], align 16
+// CHECK-NEXT: [[REG683:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_perm(short vector[8], short vector[8], unsigned char vector[16])(<8 x i16> [[REG681]], <8 x i16> [[REG682]], <16 x i8> <i8 2, i8 3, i8 6, i8 7, i8 10, i8 11, i8 14, i8 15, i8 18, i8 19, i8 22, i8 23, i8 26, i8 27, i8 30, i8 31>)
+// CHECK-NEXT: store <8 x i16> [[REG683]], <8 x i16>* [[REG669]], align 16
+// CHECK-NEXT: [[REG684:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG665]], align 16
+// CHECK-NEXT: [[REG685:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG669]], align 16
+// CHECK-NEXT: [[REG686:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_adds(short vector[8], short vector[8])(<8 x i16> [[REG684]], <8 x i16> [[REG685]])
+// CHECK-NEXT: [[REG687:[0-9a-zA-Z_%.]+]] = bitcast <8 x i16> [[REG686]] to <2 x i64>
+// CHECK-NEXT: ret <2 x i64> [[REG687]]
+
+// CHECK: define available_externally i64 @_mm_maddubs_pi16(i64 [[REG688:[0-9a-zA-Z_%.]+]], i64 [[REG689:[0-9a-zA-Z_%.]+]])
+// CHECK: store i64 [[REG688]], i64* [[REG690:[0-9a-zA-Z_%.]+]], align 8
+// CHECK-NEXT: store i64 [[REG689]], i64* [[REG691:[0-9a-zA-Z_%.]+]], align 8
+// CHECK-NEXT: [[REG692:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG690]], align 8
+// CHECK-NEXT: [[REG75:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> undef, i64 [[REG692]], i32 0
+// CHECK-NEXT: [[REG693:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG690]], align 8
+// CHECK-NEXT: [[REG694:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> [[REG75]], i64 [[REG693]], i32 1
+// CHECK-NEXT: store <2 x i64> [[REG694]], <2 x i64>* [[REG80:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG695:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG80]], align 16
+// CHECK-NEXT: [[REG84:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG695]] to <8 x i16>
+// CHECK-NEXT: store <8 x i16> [[REG84]], <8 x i16>* [[REG696:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG697:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG696]], align 16
+// CHECK-NEXT: [[REG698:[0-9a-zA-Z_%.]+]] = bitcast <8 x i16> [[REG697]] to <16 x i8>
+// CHECK-NEXT: [[REG699:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_unpackl(signed char vector[16])(<16 x i8> [[REG698]])
+// CHECK-NEXT: store <8 x i16> [[REG699]], <8 x i16>* [[REG696]], align 16
+// CHECK-NEXT: [[REG700:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_splats(short)(i16 signext 255)
+// CHECK-NEXT: store <8 x i16> [[REG700]], <8 x i16>* [[REG701:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG702:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG696]], align 16
+// CHECK-NEXT: [[REG703:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG701]], align 16
+// CHECK-NEXT: [[REG704:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_and(short vector[8], short vector[8])(<8 x i16> [[REG702]], <8 x i16> [[REG703]])
+// CHECK-NEXT: store <8 x i16> [[REG704]], <8 x i16>* [[REG696]], align 16
+// CHECK-NEXT: [[REG705:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG691]], align 8
+// CHECK-NEXT: [[REG706:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> undef, i64 [[REG705]], i32 0
+// CHECK-NEXT: [[REG707:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG691]], align 8
+// CHECK-NEXT: [[REG708:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> [[REG706]], i64 [[REG707]], i32 1
+// CHECK-NEXT: store <2 x i64> [[REG708]], <2 x i64>* [[REG709:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG710:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG709]], align 16
+// CHECK-NEXT: [[REG711:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG710]] to <8 x i16>
+// CHECK-NEXT: store <8 x i16> [[REG711]], <8 x i16>* [[REG712:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG713:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG712]], align 16
+// CHECK-NEXT: [[REG714:[0-9a-zA-Z_%.]+]] = bitcast <8 x i16> [[REG713]] to <16 x i8>
+// CHECK-NEXT: [[REG715:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_unpackl(signed char vector[16])(<16 x i8> [[REG714]])
+// CHECK-NEXT: store <8 x i16> [[REG715]], <8 x i16>* [[REG712]], align 16
+// CHECK-NEXT: [[REG716:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG696]], align 16
+// CHECK-NEXT: [[REG717:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG712]], align 16
+// CHECK-NEXT: [[REG718:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_mul(short vector[8], short vector[8])(<8 x i16> [[REG716]], <8 x i16> [[REG717]])
+// CHECK-NEXT: store <8 x i16> [[REG718]], <8 x i16>* [[REG712]], align 16
+// CHECK-NEXT: store <16 x i8> <i8 0, i8 1, i8 4, i8 5, i8 8, i8 9, i8 12, i8 13, i8 16, i8 17, i8 20, i8 21, i8 24, i8 25, i8 28, i8 29>, <16 x i8>* [[REG719:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <16 x i8> <i8 2, i8 3, i8 6, i8 7, i8 10, i8 11, i8 14, i8 15, i8 18, i8 19, i8 22, i8 23, i8 26, i8 27, i8 30, i8 31>, <16 x i8>* [[REG720:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG721:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG712]], align 16
+// CHECK-NEXT: [[REG722:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG712]], align 16
+// CHECK-NEXT: [[REG723:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_perm(short vector[8], short vector[8], unsigned char vector[16])(<8 x i16> [[REG721]], <8 x i16> [[REG722]], <16 x i8> <i8 0, i8 1, i8 4, i8 5, i8 8, i8 9, i8 12, i8 13, i8 16, i8 17, i8 20, i8 21, i8 24, i8 25, i8 28, i8 29>)
+// CHECK-NEXT: store <8 x i16> [[REG723]], <8 x i16>* [[REG696]], align 16
+// CHECK-NEXT: [[REG724:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG712]], align 16
+// CHECK-NEXT: [[REG725:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG712]], align 16
+// CHECK-NEXT: [[REG726:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_perm(short vector[8], short vector[8], unsigned char vector[16])(<8 x i16> [[REG724]], <8 x i16> [[REG725]], <16 x i8> <i8 2, i8 3, i8 6, i8 7, i8 10, i8 11, i8 14, i8 15, i8 18, i8 19, i8 22, i8 23, i8 26, i8 27, i8 30, i8 31>)
+// CHECK-NEXT: store <8 x i16> [[REG726]], <8 x i16>* [[REG712]], align 16
+// CHECK-NEXT: [[REG727:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG696]], align 16
+// CHECK-NEXT: [[REG728:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG712]], align 16
+// CHECK-NEXT: [[REG729:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_adds(short vector[8], short vector[8])(<8 x i16> [[REG727]], <8 x i16> [[REG728]])
+// CHECK-NEXT: store <8 x i16> [[REG729]], <8 x i16>* [[REG696]], align 16
+// CHECK-NEXT: [[REG730:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG696]], align 16
+// CHECK-NEXT: [[REG731:[0-9a-zA-Z_%.]+]] = bitcast <8 x i16> [[REG730]] to <2 x i64>
+// CHECK-NEXT: [[REG732:[0-9a-zA-Z_%.]+]] = extractelement <2 x i64> [[REG731]], i32 0
+// CHECK-NEXT: ret i64 [[REG732]]
+
+void __attribute__((noinline))
+test_mulhrs() {
+ resi = _mm_mulhrs_epi16(mi1, mi2);
+ res = _mm_mulhrs_pi16(m1, m2);
+}
+
+// CHECK-LABEL: @test_mulhrs
+
+// CHECK: define available_externally <2 x i64> @_mm_mulhrs_epi16(<2 x i64> [[REG733:[0-9a-zA-Z_%.]+]], <2 x i64> [[REG734:[0-9a-zA-Z_%.]+]])
+// CHECK: store <2 x i64> [[REG733]], <2 x i64>* [[REG735:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: store <2 x i64> [[REG734]], <2 x i64>* [[REG736:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG737:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG735]], align 16
+// CHECK-NEXT: [[REG738:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG737]] to <8 x i16>
+// CHECK-NEXT: [[REG739:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_unpackh(short vector[8])(<8 x i16> [[REG738]])
+// CHECK-NEXT: store <4 x i32> [[REG739]], <4 x i32>* [[REG740:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG741:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG736]], align 16
+// CHECK-NEXT: [[REG742:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG741]] to <8 x i16>
+// CHECK-NEXT: [[REG743:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_unpackh(short vector[8])(<8 x i16> [[REG742]])
+// CHECK-NEXT: store <4 x i32> [[REG743]], <4 x i32>* [[REG744:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG745:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG740]], align 16
+// CHECK-NEXT: [[REG746:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG744]], align 16
+// CHECK-NEXT: [[REG747:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_mul(int vector[4], int vector[4])(<4 x i32> [[REG745]], <4 x i32> [[REG746]])
+// CHECK-NEXT: store <4 x i32> [[REG747]], <4 x i32>* [[REG740]], align 16
+// CHECK-NEXT: [[REG748:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG735]], align 16
+// CHECK-NEXT: [[REG749:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG748]] to <8 x i16>
+// CHECK-NEXT: [[REG750:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_unpackl(short vector[8])(<8 x i16> [[REG749]])
+// CHECK-NEXT: store <4 x i32> [[REG750]], <4 x i32>* [[REG744]], align 16
+// CHECK-NEXT: [[REG751:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG736]], align 16
+// CHECK-NEXT: [[REG752:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG751]] to <8 x i16>
+// CHECK-NEXT: [[REG753:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_unpackl(short vector[8])(<8 x i16> [[REG752]])
+// CHECK-NEXT: store <4 x i32> [[REG753]], <4 x i32>* [[REG754:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG755:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG744]], align 16
+// CHECK-NEXT: [[REG756:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG754]], align 16
+// CHECK-NEXT: [[REG757:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_mul(int vector[4], int vector[4])(<4 x i32> [[REG755]], <4 x i32> [[REG756]])
+// CHECK-NEXT: store <4 x i32> [[REG757]], <4 x i32>* [[REG744]], align 16
+// CHECK-NEXT: [[REG758:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_splats(unsigned int)(i32 zeroext 14)
+// CHECK-NEXT: store <4 x i32> [[REG758]], <4 x i32>* [[REG759:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG760:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG740]], align 16
+// CHECK-NEXT: [[REG761:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG759]], align 16
+// CHECK-NEXT: [[REG762:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_sr(int vector[4], unsigned int vector[4])(<4 x i32> [[REG760]], <4 x i32> [[REG761]])
+// CHECK-NEXT: store <4 x i32> [[REG762]], <4 x i32>* [[REG740]], align 16
+// CHECK-NEXT: [[REG763:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG744]], align 16
+// CHECK-NEXT: [[REG764:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG759]], align 16
+// CHECK-NEXT: [[REG765:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_sr(int vector[4], unsigned int vector[4])(<4 x i32> [[REG763]], <4 x i32> [[REG764]])
+// CHECK-NEXT: store <4 x i32> [[REG765]], <4 x i32>* [[REG744]], align 16
+// CHECK-NEXT: [[REG766:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_splats(int)(i32 signext 1)
+// CHECK-NEXT: store <4 x i32> [[REG766]], <4 x i32>* [[REG767:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG768:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG740]], align 16
+// CHECK-NEXT: [[REG769:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG767]], align 16
+// CHECK-NEXT: [[REG770:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_add(int vector[4], int vector[4])(<4 x i32> [[REG768]], <4 x i32> [[REG769]])
+// CHECK-NEXT: store <4 x i32> [[REG770]], <4 x i32>* [[REG740]], align 16
+// CHECK-NEXT: [[REG771:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG740]], align 16
+// CHECK-NEXT: [[REG772:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG767]], align 16
+// CHECK-NEXT: [[REG773:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_sr(int vector[4], unsigned int vector[4])(<4 x i32> [[REG771]], <4 x i32> [[REG772]])
+// CHECK-NEXT: store <4 x i32> [[REG773]], <4 x i32>* [[REG740]], align 16
+// CHECK-NEXT: [[REG774:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG744]], align 16
+// CHECK-NEXT: [[REG775:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG767]], align 16
+// CHECK-NEXT: [[REG776:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_add(int vector[4], int vector[4])(<4 x i32> [[REG774]], <4 x i32> [[REG775]])
+// CHECK-NEXT: store <4 x i32> [[REG776]], <4 x i32>* [[REG744]], align 16
+// CHECK-NEXT: [[REG777:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG744]], align 16
+// CHECK-NEXT: [[REG778:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG767]], align 16
+// CHECK-NEXT: [[REG779:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_sr(int vector[4], unsigned int vector[4])(<4 x i32> [[REG777]], <4 x i32> [[REG778]])
+// CHECK-NEXT: store <4 x i32> [[REG779]], <4 x i32>* [[REG744]], align 16
+// CHECK-NEXT: [[REG780:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG740]], align 16
+// CHECK-NEXT: [[REG781:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG744]], align 16
+// CHECK-NEXT: [[REG782:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_pack(int vector[4], int vector[4])(<4 x i32> [[REG780]], <4 x i32> [[REG781]])
+// CHECK-NEXT: [[REG783:[0-9a-zA-Z_%.]+]] = bitcast <8 x i16> [[REG782]] to <2 x i64>
+// CHECK-NEXT: ret <2 x i64> [[REG783]]
+
+// CHECK: define available_externally i64 @_mm_mulhrs_pi16(i64 [[REG784:[0-9a-zA-Z_%.]+]], i64 [[REG785:[0-9a-zA-Z_%.]+]])
+// CHECK: store i64 [[REG784]], i64* [[REG786:[0-9a-zA-Z_%.]+]], align 8
+// CHECK-NEXT: store i64 [[REG785]], i64* [[REG787:[0-9a-zA-Z_%.]+]], align 8
+// CHECK-NEXT: [[REG788:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG786]], align 8
+// CHECK-NEXT: [[REG789:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> undef, i64 [[REG788]], i32 0
+// CHECK-NEXT: [[REG790:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG786]], align 8
+// CHECK-NEXT: [[REG791:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> [[REG789]], i64 [[REG790]], i32 1
+// CHECK-NEXT: store <2 x i64> [[REG791]], <2 x i64>* [[REG792:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG793:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG792]], align 16
+// CHECK-NEXT: [[REG794:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG793]] to <4 x i32>
+// CHECK-NEXT: store <4 x i32> [[REG794]], <4 x i32>* [[REG795:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG796:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG795]], align 16
+// CHECK-NEXT: [[REG797:[0-9a-zA-Z_%.]+]] = bitcast <4 x i32> [[REG796]] to <8 x i16>
+// CHECK-NEXT: [[REG798:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_unpackh(short vector[8])(<8 x i16> [[REG797]])
+// CHECK-NEXT: store <4 x i32> [[REG798]], <4 x i32>* [[REG795]], align 16
+// CHECK-NEXT: [[REG799:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG787]], align 8
+// CHECK-NEXT: [[REG800:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> undef, i64 [[REG799]], i32 0
+// CHECK-NEXT: [[REG801:[0-9a-zA-Z_%.]+]] = load i64, i64* [[REG787]], align 8
+// CHECK-NEXT: [[REG802:[0-9a-zA-Z_%.]+]] = insertelement <2 x i64> [[REG800]], i64 [[REG801]], i32 1
+// CHECK-NEXT: store <2 x i64> [[REG802]], <2 x i64>* [[REG803:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG804:[0-9a-zA-Z_%.]+]] = load <2 x i64>, <2 x i64>* [[REG803]], align 16
+// CHECK-NEXT: [[REG805:[0-9a-zA-Z_%.]+]] = bitcast <2 x i64> [[REG804]] to <4 x i32>
+// CHECK-NEXT: store <4 x i32> [[REG805]], <4 x i32>* [[REG806:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG807:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG806]], align 16
+// CHECK-NEXT: [[REG808:[0-9a-zA-Z_%.]+]] = bitcast <4 x i32> [[REG807]] to <8 x i16>
+// CHECK-NEXT: [[REG809:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_unpackh(short vector[8])(<8 x i16> [[REG808]])
+// CHECK-NEXT: store <4 x i32> [[REG809]], <4 x i32>* [[REG806]], align 16
+// CHECK-NEXT: [[REG810:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG795]], align 16
+// CHECK-NEXT: [[REG811:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG806]], align 16
+// CHECK-NEXT: [[REG812:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_mul(int vector[4], int vector[4])(<4 x i32> [[REG810]], <4 x i32> [[REG811]])
+// CHECK-NEXT: store <4 x i32> [[REG812]], <4 x i32>* [[REG795]], align 16
+// CHECK-NEXT: [[REG813:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_splats(unsigned int)(i32 zeroext 14)
+// CHECK-NEXT: store <4 x i32> [[REG813]], <4 x i32>* [[REG814:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG815:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG795]], align 16
+// CHECK-NEXT: [[REG816:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG814]], align 16
+// CHECK-NEXT: [[REG817:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_sr(int vector[4], unsigned int vector[4])(<4 x i32> [[REG815]], <4 x i32> [[REG816]])
+// CHECK-NEXT: store <4 x i32> [[REG817]], <4 x i32>* [[REG795]], align 16
+// CHECK-NEXT: [[REG818:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_splats(int)(i32 signext 1)
+// CHECK-NEXT: store <4 x i32> [[REG818]], <4 x i32>* [[REG819:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG820:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG795]], align 16
+// CHECK-NEXT: [[REG821:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG819]], align 16
+// CHECK-NEXT: [[REG822:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_add(int vector[4], int vector[4])(<4 x i32> [[REG820]], <4 x i32> [[REG821]])
+// CHECK-NEXT: store <4 x i32> [[REG822]], <4 x i32>* [[REG795]], align 16
+// CHECK-NEXT: [[REG823:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG795]], align 16
+// CHECK-NEXT: [[REG824:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG819]], align 16
+// CHECK-NEXT: [[REG825:[0-9a-zA-Z_%.]+]] = call <4 x i32> @vec_sr(int vector[4], unsigned int vector[4])(<4 x i32> [[REG823]], <4 x i32> [[REG824]])
+// CHECK-NEXT: store <4 x i32> [[REG825]], <4 x i32>* [[REG795]], align 16
+// CHECK-NEXT: [[REG826:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG795]], align 16
+// CHECK-NEXT: [[REG827:[0-9a-zA-Z_%.]+]] = load <4 x i32>, <4 x i32>* [[REG806]], align 16
+// CHECK-NEXT: [[REG828:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_pack(int vector[4], int vector[4])(<4 x i32> [[REG826]], <4 x i32> [[REG827]])
+// CHECK-NEXT: store <8 x i16> [[REG828]], <8 x i16>* [[REG829:[0-9a-zA-Z_%.]+]], align 16
+// CHECK-NEXT: [[REG830:[0-9a-zA-Z_%.]+]] = load <8 x i16>, <8 x i16>* [[REG829]], align 16
+// CHECK-NEXT: [[REG831:[0-9a-zA-Z_%.]+]] = bitcast <8 x i16> [[REG830]] to <2 x i64>
+// CHECK-NEXT: [[REG832:[0-9a-zA-Z_%.]+]] = extractelement <2 x i64> [[REG831]], i32 0
+// CHECK-NEXT: ret i64 [[REG832]]
diff --git a/src/llvm-project/clang/test/CodeGen/ppc-vector-compare.cc b/src/llvm-project/clang/test/CodeGen/ppc-vector-compare.cpp
similarity index 100%
rename from src/llvm-project/clang/test/CodeGen/ppc-vector-compare.cc
rename to src/llvm-project/clang/test/CodeGen/ppc-vector-compare.cpp
diff --git a/src/llvm-project/clang/test/CodeGen/ppc-xmmintrin.c b/src/llvm-project/clang/test/CodeGen/ppc-xmmintrin.c
index fd81937..e9466b3 100644
--- a/src/llvm-project/clang/test/CodeGen/ppc-xmmintrin.c
+++ b/src/llvm-project/clang/test/CodeGen/ppc-xmmintrin.c
@@ -2,9 +2,9 @@
// REQUIRES: powerpc-registered-target
// RUN: %clang -S -emit-llvm -target powerpc64-unknown-linux-gnu -mcpu=pwr8 -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
-// RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt | FileCheck %s --check-prefixes=CHECK,CHECK-BE
+// RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt -n | FileCheck %s --check-prefixes=CHECK,CHECK-BE
// RUN: %clang -S -emit-llvm -target powerpc64le-unknown-linux-gnu -mcpu=pwr8 -ffreestanding -DNO_WARN_X86_INTRINSICS %s \
-// RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt | FileCheck %s --check-prefixes=CHECK,CHECK-LE
+// RUN: -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt -n | FileCheck %s --check-prefixes=CHECK,CHECK-LE
#include <xmmintrin.h>
@@ -1435,7 +1435,7 @@
// CHECK: store i8* {{[0-9a-zA-Z_%.]+}}, i8** {{[0-9a-zA-Z_%.]+}}, align 8
// CHECK-NEXT: store i32 {{[0-9a-zA-Z_%.]+}}, i32* {{[0-9a-zA-Z_%.]+}}, align 4
// CHECK-NEXT: [[REG715:[0-9a-zA-Z_%.]+]] = load i8*, i8** {{[0-9a-zA-Z_%.]+}}, align 8
-// CHECK-NEXT: call void @llvm.prefetch(i8* [[REG715]], i32 0, i32 3, i32 1)
+// CHECK-NEXT: call void @llvm.prefetch.p0i8(i8* [[REG715]], i32 0, i32 3, i32 1)
// CHECK-NEXT: ret void
void __attribute__((noinline))
diff --git a/src/llvm-project/clang/test/CodeGen/ppc64-align-struct.c b/src/llvm-project/clang/test/CodeGen/ppc64-align-struct.c
index e6ca3bb..bcff492 100644
--- a/src/llvm-project/clang/test/CodeGen/ppc64-align-struct.c
+++ b/src/llvm-project/clang/test/CodeGen/ppc64-align-struct.c
@@ -41,7 +41,7 @@
}
// This case requires run-time realignment of the incoming struct
-// CHECK-LABEL: define void @test7(i32 signext %x, %struct.test7* byval(%struct.test7) align 16)
+// CHECK-LABEL: define void @test7(i32 signext %x, %struct.test7* byval(%struct.test7) align 16 %0)
// CHECK: %y = alloca %struct.test7, align 32
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64
void test7 (int x, struct test7 y)
diff --git a/src/llvm-project/clang/test/CodeGen/ppc64-qpx-vector.c b/src/llvm-project/clang/test/CodeGen/ppc64-qpx-vector.c
index c42d4b3..e7c0093 100644
--- a/src/llvm-project/clang/test/CodeGen/ppc64-qpx-vector.c
+++ b/src/llvm-project/clang/test/CodeGen/ppc64-qpx-vector.c
@@ -24,6 +24,6 @@
// QPX-LABEL: define <4 x double> @foo2(<4 x double> inreg %a.coerce, <4 x double> %b, [2 x i256] %c.coerce)
// QPX: ret <4 x double>
-// NORMAL-LABEL: define void @foo2(<4 x double>* noalias sret %agg.result, [2 x i128] %a.coerce, <4 x double>*, [4 x i128] %c.coerce)
+// NORMAL-LABEL: define void @foo2(<4 x double>* noalias sret %agg.result, [2 x i128] %a.coerce, <4 x double>* %0, [4 x i128] %c.coerce)
// NORMAL: ret void
diff --git a/src/llvm-project/clang/test/CodeGen/ppc64-vector.c b/src/llvm-project/clang/test/CodeGen/ppc64-vector.c
index 87deb0f..7ed0bea 100644
--- a/src/llvm-project/clang/test/CodeGen/ppc64-vector.c
+++ b/src/llvm-project/clang/test/CodeGen/ppc64-vector.c
@@ -39,7 +39,7 @@
return x;
}
-// CHECK: define void @test_v16i16(<16 x i16>* noalias sret %agg.result, <16 x i16>*)
+// CHECK: define void @test_v16i16(<16 x i16>* noalias sret %agg.result, <16 x i16>* %0)
v16i16 test_v16i16(v16i16 x)
{
return x;
diff --git a/src/llvm-project/clang/test/CodeGen/pr9614.c b/src/llvm-project/clang/test/CodeGen/pr9614.c
index 63cb5af..0808984 100644
--- a/src/llvm-project/clang/test/CodeGen/pr9614.c
+++ b/src/llvm-project/clang/test/CodeGen/pr9614.c
@@ -34,7 +34,7 @@
// CHECK: call void @foo()
// CHECK: call i32 @abs(i32 0)
// CHECK: call i8* @strrchr(
-// CHECK: call void @llvm.prefetch(
+// CHECK: call void @llvm.prefetch.p0i8(
// CHECK: call i8* @memchr(
// CHECK: ret void
@@ -42,4 +42,4 @@
// CHECK: declare i32 @abs(i32
// CHECK: declare i8* @strrchr(i8*, i32)
// CHECK: declare i8* @memchr(
-// CHECK: declare void @llvm.prefetch(
+// CHECK: declare void @llvm.prefetch.p0i8(
diff --git a/src/llvm-project/clang/test/CodeGen/pragma-detect_mismatch.c b/src/llvm-project/clang/test/CodeGen/pragma-detect_mismatch.c
index 066183d..145b285 100644
--- a/src/llvm-project/clang/test/CodeGen/pragma-detect_mismatch.c
+++ b/src/llvm-project/clang/test/CodeGen/pragma-detect_mismatch.c
@@ -1,5 +1,9 @@
-// RUN: %clang_cc1 %s -triple i686-pc-win32 -fms-extensions -emit-llvm -o - | FileCheck %s
-// RUN: %clang_cc1 %s -triple thumbv7-windows -fms-extensions -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 %s -triple i686-pc-win32 -fms-extensions -emit-llvm -o - \
+// RUN: | FileCheck %s
+// RUN: %clang_cc1 %s -triple thumbv7-windows -fms-extensions -emit-llvm -o - \
+// RUN: | FileCheck %s
+// RUN: %clang_cc1 %s -triple amdgcn-amd-amdhsa -fms-extensions -emit-llvm -o \
+// RUN: - | FileCheck -check-prefix=AMD %s
#pragma detect_mismatch("test", "1")
@@ -9,3 +13,4 @@
// CHECK: !llvm.linker.options = !{![[test:[0-9]+]], ![[test2:[0-9]+]]}
// CHECK: ![[test]] = !{!"/FAILIFMISMATCH:\22test=1\22"}
// CHECK: ![[test2]] = !{!"/FAILIFMISMATCH:\22test2=2\22"}
+// AMD-NOT: !llvm.linker.options
diff --git a/src/llvm-project/clang/test/CodeGen/prefetch-addr-spaces.c b/src/llvm-project/clang/test/CodeGen/prefetch-addr-spaces.c
new file mode 100644
index 0000000..8781062
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/prefetch-addr-spaces.c
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -triple x86_64-pc-linux -emit-llvm %s -o - | FileCheck %s
+
+void f(int __attribute__((address_space(1))) * a, ...) {
+ __builtin_prefetch(a, 0, 1);
+ // CHECK: call void @llvm.prefetch.p1i8(i8 addrspace(1)* {{%.+}}, i32 0, i32 1, i32 1)
+}
diff --git a/src/llvm-project/clang/test/CodeGen/prefetchw-builtins.c b/src/llvm-project/clang/test/CodeGen/prefetchw-builtins.c
index 53416de..b3a8062 100644
--- a/src/llvm-project/clang/test/CodeGen/prefetchw-builtins.c
+++ b/src/llvm-project/clang/test/CodeGen/prefetchw-builtins.c
@@ -5,12 +5,12 @@
void test_m_prefetch(void *p) {
return _m_prefetch(p);
-// CHECK-LABEL: define void @test_m_prefetch
-// CHECK: call void @llvm.prefetch({{.*}}, i32 0, i32 3, i32 1)
+ // CHECK-LABEL: define void @test_m_prefetch
+ // CHECK: call void @llvm.prefetch.p0i8({{.*}}, i32 0, i32 3, i32 1)
}
void test_m_prefetch_w(void *p) {
return _m_prefetchw(p);
-// CHECK-LABEL: define void @test_m_prefetch_w
-// CHECK: call void @llvm.prefetch({{.*}}, i32 1, i32 3, i32 1)
+ // CHECK-LABEL: define void @test_m_prefetch_w
+ // CHECK: call void @llvm.prefetch.p0i8({{.*}}, i32 1, i32 3, i32 1)
}
diff --git a/src/llvm-project/clang/test/CodeGen/regcall.c b/src/llvm-project/clang/test/CodeGen/regcall.c
index 5820bcf..03d9d2f 100644
--- a/src/llvm-project/clang/test/CodeGen/regcall.c
+++ b/src/llvm-project/clang/test/CodeGen/regcall.c
@@ -27,7 +27,7 @@
void __regcall v3(int a, struct Small b, int c) {}
// Win32: define dso_local x86_regcallcc void @__regcall3__v3(i32 inreg %a, i32 %b.0, i32 inreg %c)
// Win64: define dso_local x86_regcallcc void @__regcall3__v3(i32 %a, i32 %b.coerce, i32 %c)
-// Lin32: define x86_regcallcc void @__regcall3__v3(i32 inreg %a, i32 inreg, i32 %b.0, i32 inreg %c)
+// Lin32: define x86_regcallcc void @__regcall3__v3(i32 inreg %a, i32 inreg %0, i32 %b.0, i32 inreg %c)
// Lin64: define x86_regcallcc void @__regcall3__v3(i32 %a, i32 %b.coerce, i32 %c)
struct Large { int a[5]; };
@@ -51,9 +51,9 @@
// indirectly. Additional vector arguments can consume the rest of the SSE
// registers.
void __regcall hfa2(struct HFA4 a, struct HFA4 b, double c) {}
-// Win32: define dso_local x86_regcallcc void @__regcall3__hfa2(double %a.0, double %a.1, double %a.2, double %a.3, double %b.0, double %b.1, double %b.2, double %b.3, double* inreg)
+// Win32: define dso_local x86_regcallcc void @__regcall3__hfa2(double %a.0, double %a.1, double %a.2, double %a.3, double %b.0, double %b.1, double %b.2, double %b.3, double* inreg %0)
// Win64: define dso_local x86_regcallcc void @__regcall3__hfa2(double %a.0, double %a.1, double %a.2, double %a.3, double %b.0, double %b.1, double %b.2, double %b.3, double %c)
-// Lin32: define x86_regcallcc void @__regcall3__hfa2(double %a.0, double %a.1, double %a.2, double %a.3, double %b.0, double %b.1, double %b.2, double %b.3, double* inreg)
+// Lin32: define x86_regcallcc void @__regcall3__hfa2(double %a.0, double %a.1, double %a.2, double %a.3, double %b.0, double %b.1, double %b.2, double %b.3, double* inreg %0)
// Lin64: define x86_regcallcc void @__regcall3__hfa2(double %a.coerce0, double %a.coerce1, double %a.coerce2, double %a.coerce3, double %b.coerce0, double %b.coerce1, double %b.coerce2, double %b.coerce3, double %c)
// Ensure that we pass builtin types directly while counting them against the
@@ -68,7 +68,7 @@
// Because they are not classified as homogeneous, they don't get special
// handling to ensure alignment.
void __regcall hfa4(struct HFA5 a) {}
-// Win32: define dso_local x86_regcallcc void @__regcall3__hfa4(%struct.HFA5* byval(%struct.HFA5) align 4)
+// Win32: define dso_local x86_regcallcc void @__regcall3__hfa4(%struct.HFA5* byval(%struct.HFA5) align 4 %0)
// Win64: define dso_local x86_regcallcc void @__regcall3__hfa4(%struct.HFA5* %a)
// Lin32: define x86_regcallcc void @__regcall3__hfa4(%struct.HFA5* byval(%struct.HFA5) align 4 %a)
// Lin64: define x86_regcallcc void @__regcall3__hfa4(double %a.coerce0, double %a.coerce1, double %a.coerce2, double %a.coerce3, double %a.coerce4)
@@ -92,9 +92,9 @@
// Lin64: define x86_regcallcc void @__regcall3__hva1(i32 %a, <4 x float> %b.coerce0, <4 x float> %b.coerce1, <4 x float> %b.coerce2, <4 x float> %b.coerce3, i32 %c)
void __regcall hva2(struct HVA4 a, struct HVA4 b, v4f32 c) {}
-// Win32: define dso_local x86_regcallcc void @__regcall3__hva2(<4 x float> %a.0, <4 x float> %a.1, <4 x float> %a.2, <4 x float> %a.3, <4 x float> %b.0, <4 x float> %b.1, <4 x float> %b.2, <4 x float> %b.3, <4 x float>* inreg)
+// Win32: define dso_local x86_regcallcc void @__regcall3__hva2(<4 x float> %a.0, <4 x float> %a.1, <4 x float> %a.2, <4 x float> %a.3, <4 x float> %b.0, <4 x float> %b.1, <4 x float> %b.2, <4 x float> %b.3, <4 x float>* inreg %0)
// Win64: define dso_local x86_regcallcc void @__regcall3__hva2(<4 x float> %a.0, <4 x float> %a.1, <4 x float> %a.2, <4 x float> %a.3, <4 x float> %b.0, <4 x float> %b.1, <4 x float> %b.2, <4 x float> %b.3, <4 x float> %c)
-// Lin32: define x86_regcallcc void @__regcall3__hva2(<4 x float> %a.0, <4 x float> %a.1, <4 x float> %a.2, <4 x float> %a.3, <4 x float> %b.0, <4 x float> %b.1, <4 x float> %b.2, <4 x float> %b.3, <4 x float>* inreg)
+// Lin32: define x86_regcallcc void @__regcall3__hva2(<4 x float> %a.0, <4 x float> %a.1, <4 x float> %a.2, <4 x float> %a.3, <4 x float> %b.0, <4 x float> %b.1, <4 x float> %b.2, <4 x float> %b.3, <4 x float>* inreg %0)
// Lin64: define x86_regcallcc void @__regcall3__hva2(<4 x float> %a.coerce0, <4 x float> %a.coerce1, <4 x float> %a.coerce2, <4 x float> %a.coerce3, <4 x float> %b.coerce0, <4 x float> %b.coerce1, <4 x float> %b.coerce2, <4 x float> %b.coerce3, <4 x float> %c)
void __regcall hva3(v4f32 a, v4f32 b, v4f32 c, v4f32 d, v4f32 e, struct HVA2 f) {}
diff --git a/src/llvm-project/clang/test/CodeGen/riscv-metadata.c b/src/llvm-project/clang/test/CodeGen/riscv-metadata.c
new file mode 100644
index 0000000..19bde4c
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/riscv-metadata.c
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -triple riscv32 -target-abi ilp32 -emit-llvm -o - %s | FileCheck -check-prefix=ILP32 %s
+// RUN: %clang_cc1 -triple riscv32 -target-feature +f -target-abi ilp32f -emit-llvm -o - %s | FileCheck -check-prefix=ILP32F %s
+// RUN: %clang_cc1 -triple riscv32 -target-feature +d -target-abi ilp32d -emit-llvm -o - %s | FileCheck -check-prefix=ILP32D %s
+// RUN: %clang_cc1 -triple riscv64 -target-abi lp64 -emit-llvm -o - %s | FileCheck -check-prefix=LP64 %s
+// RUN: %clang_cc1 -triple riscv64 -target-feature +f -target-abi lp64f -emit-llvm -o - %s | FileCheck -check-prefix=LP64F %s
+// RUN: %clang_cc1 -triple riscv64 -target-feature +d -target-abi lp64d -emit-llvm -o - %s | FileCheck -check-prefix=LP64D %s
+
+// ILP32: !{{[0-9]+}} = !{i32 1, !"target-abi", !"ilp32"}
+// ILP32F: !{{[0-9]+}} = !{i32 1, !"target-abi", !"ilp32f"}
+// ILP32D: !{{[0-9]+}} = !{i32 1, !"target-abi", !"ilp32d"}
+
+// LP64: !{{[0-9]+}} = !{i32 1, !"target-abi", !"lp64"}
+// LP64F: !{{[0-9]+}} = !{i32 1, !"target-abi", !"lp64f"}
+// LP64D: !{{[0-9]+}} = !{i32 1, !"target-abi", !"lp64d"}
diff --git a/src/llvm-project/clang/test/CodeGen/riscv32-ilp32-ilp32f-ilp32d-abi.c b/src/llvm-project/clang/test/CodeGen/riscv32-ilp32-ilp32f-ilp32d-abi.c
index fa11c17..86ad8fd 100644
--- a/src/llvm-project/clang/test/CodeGen/riscv32-ilp32-ilp32f-ilp32d-abi.c
+++ b/src/llvm-project/clang/test/CodeGen/riscv32-ilp32-ilp32f-ilp32d-abi.c
@@ -184,7 +184,7 @@
typedef unsigned char v16i8 __attribute__((vector_size(16)));
-// CHECK-LABEL: define void @f_vec_large_v16i8(<16 x i8>*)
+// CHECK-LABEL: define void @f_vec_large_v16i8(<16 x i8>* %0)
void f_vec_large_v16i8(v16i8 x) {
x[0] = x[7];
}
diff --git a/src/llvm-project/clang/test/CodeGen/riscv32-ilp32d-abi.c b/src/llvm-project/clang/test/CodeGen/riscv32-ilp32d-abi.c
index b10656c..b5b451c 100644
--- a/src/llvm-project/clang/test/CodeGen/riscv32-ilp32d-abi.c
+++ b/src/llvm-project/clang/test/CodeGen/riscv32-ilp32d-abi.c
@@ -25,7 +25,7 @@
struct double_s { double f; };
-// CHECK: define void @f_double_s_arg(double)
+// CHECK: define void @f_double_s_arg(double %0)
void f_double_s_arg(struct double_s a) {}
// CHECK: define double @f_ret_double_s()
@@ -39,7 +39,7 @@
struct zbf_double_s { int : 0; double f; };
struct zbf_double_zbf_s { int : 0; double f; int : 0; };
-// CHECK: define void @f_zbf_double_s_arg(double)
+// CHECK: define void @f_zbf_double_s_arg(double %0)
void f_zbf_double_s_arg(struct zbf_double_s a) {}
// CHECK: define double @f_ret_zbf_double_s()
@@ -47,7 +47,7 @@
return (struct zbf_double_s){1.0};
}
-// CHECK: define void @f_zbf_double_zbf_s_arg(double)
+// CHECK: define void @f_zbf_double_zbf_s_arg(double %0)
void f_zbf_double_zbf_s_arg(struct zbf_double_zbf_s a) {}
// CHECK: define double @f_ret_zbf_double_zbf_s()
@@ -61,7 +61,7 @@
struct double_double_s { double f; double g; };
struct double_float_s { double f; float g; };
-// CHECK: define void @f_double_double_s_arg(double, double)
+// CHECK: define void @f_double_double_s_arg(double %0, double %1)
void f_double_double_s_arg(struct double_double_s a) {}
// CHECK: define { double, double } @f_ret_double_double_s()
@@ -69,7 +69,7 @@
return (struct double_double_s){1.0, 2.0};
}
-// CHECK: define void @f_double_float_s_arg(double, float)
+// CHECK: define void @f_double_float_s_arg(double %0, float %1)
void f_double_float_s_arg(struct double_float_s a) {}
// CHECK: define { double, float } @f_ret_double_float_s()
@@ -92,7 +92,7 @@
struct double_int64bf_s { double f; int64_t i : 32; };
struct double_int8_zbf_s { double f; int8_t i; int : 0; };
-// CHECK: define void @f_double_int8_s_arg(double, i8)
+// CHECK: define void @f_double_int8_s_arg(double %0, i8 %1)
void f_double_int8_s_arg(struct double_int8_s a) {}
// CHECK: define { double, i8 } @f_ret_double_int8_s()
@@ -100,7 +100,7 @@
return (struct double_int8_s){1.0, 2};
}
-// CHECK: define void @f_double_uint8_s_arg(double, i8)
+// CHECK: define void @f_double_uint8_s_arg(double %0, i8 %1)
void f_double_uint8_s_arg(struct double_uint8_s a) {}
// CHECK: define { double, i8 } @f_ret_double_uint8_s()
@@ -108,7 +108,7 @@
return (struct double_uint8_s){1.0, 2};
}
-// CHECK: define void @f_double_int32_s_arg(double, i32)
+// CHECK: define void @f_double_int32_s_arg(double %0, i32 %1)
void f_double_int32_s_arg(struct double_int32_s a) {}
// CHECK: define { double, i32 } @f_ret_double_int32_s()
@@ -124,7 +124,7 @@
return (struct double_int64_s){1.0, 2};
}
-// CHECK: define void @f_double_int64bf_s_arg(double, i32)
+// CHECK: define void @f_double_int64bf_s_arg(double %0, i32 %1)
void f_double_int64bf_s_arg(struct double_int64bf_s a) {}
// CHECK: define { double, i32 } @f_ret_double_int64bf_s()
@@ -135,7 +135,7 @@
// The zero-width bitfield means the struct can't be passed according to the
// floating point calling convention.
-// CHECK: define void @f_double_int8_zbf_s(double, i8)
+// CHECK: define void @f_double_int8_zbf_s(double %0, i8 %1)
void f_double_int8_zbf_s(struct double_int8_zbf_s a) {}
// CHECK: define { double, i8 } @f_ret_double_int8_zbf_s()
@@ -164,7 +164,7 @@
struct doublecomplex_s { double __complex__ c; };
-// CHECK: define void @f_doublecomplex_s_arg(double, double)
+// CHECK: define void @f_doublecomplex_s_arg(double %0, double %1)
void f_doublecomplex_s_arg(struct doublecomplex_s a) {}
// CHECK: define { double, double } @f_ret_doublecomplex_s()
@@ -177,7 +177,7 @@
struct doublearr1_s { double a[1]; };
-// CHECK: define void @f_doublearr1_s_arg(double)
+// CHECK: define void @f_doublearr1_s_arg(double %0)
void f_doublearr1_s_arg(struct doublearr1_s a) {}
// CHECK: define double @f_ret_doublearr1_s()
@@ -187,7 +187,7 @@
struct doublearr2_s { double a[2]; };
-// CHECK: define void @f_doublearr2_s_arg(double, double)
+// CHECK: define void @f_doublearr2_s_arg(double %0, double %1)
void f_doublearr2_s_arg(struct doublearr2_s a) {}
// CHECK: define { double, double } @f_ret_doublearr2_s()
@@ -197,7 +197,7 @@
struct doublearr2_tricky1_s { struct { double f[1]; } g[2]; };
-// CHECK: define void @f_doublearr2_tricky1_s_arg(double, double)
+// CHECK: define void @f_doublearr2_tricky1_s_arg(double %0, double %1)
void f_doublearr2_tricky1_s_arg(struct doublearr2_tricky1_s a) {}
// CHECK: define { double, double } @f_ret_doublearr2_tricky1_s()
@@ -207,7 +207,7 @@
struct doublearr2_tricky2_s { struct {}; struct { double f[1]; } g[2]; };
-// CHECK: define void @f_doublearr2_tricky2_s_arg(double, double)
+// CHECK: define void @f_doublearr2_tricky2_s_arg(double %0, double %1)
void f_doublearr2_tricky2_s_arg(struct doublearr2_tricky2_s a) {}
// CHECK: define { double, double } @f_ret_doublearr2_tricky2_s()
@@ -217,7 +217,7 @@
struct doublearr2_tricky3_s { union {}; struct { double f[1]; } g[2]; };
-// CHECK: define void @f_doublearr2_tricky3_s_arg(double, double)
+// CHECK: define void @f_doublearr2_tricky3_s_arg(double %0, double %1)
void f_doublearr2_tricky3_s_arg(struct doublearr2_tricky3_s a) {}
// CHECK: define { double, double } @f_ret_doublearr2_tricky3_s()
@@ -227,7 +227,7 @@
struct doublearr2_tricky4_s { union {}; struct { struct {}; double f[1]; } g[2]; };
-// CHECK: define void @f_doublearr2_tricky4_s_arg(double, double)
+// CHECK: define void @f_doublearr2_tricky4_s_arg(double %0, double %1)
void f_doublearr2_tricky4_s_arg(struct doublearr2_tricky4_s a) {}
// CHECK: define { double, double } @f_ret_doublearr2_tricky4_s()
@@ -280,3 +280,27 @@
union double_u f_ret_double_u() {
return (union double_u){1.0};
}
+
+// Test that we don't incorrectly think double+int/double+double structs will
+// be returned indirectly and thus have an off-by-one error for the number of
+// GPRs available (this is an edge case when structs > 2*XLEN are still
+// returned in registers). This includes complex doubles, which are treated as
+// double+double structs by the ABI.
+
+// CHECK: define { double, i32 } @f_ret_double_int32_s_double_int32_s_just_sufficient_gprs(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e, i32 %f, i32 %g, double %0, i32 %1)
+struct double_int32_s f_ret_double_int32_s_double_int32_s_just_sufficient_gprs(
+ int a, int b, int c, int d, int e, int f, int g, struct double_int32_s h) {
+ return (struct double_int32_s){1.0, 2};
+}
+
+// CHECK: define { double, double } @f_ret_double_double_s_double_int32_s_just_sufficient_gprs(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e, i32 %f, i32 %g, double %0, i32 %1)
+struct double_double_s f_ret_double_double_s_double_int32_s_just_sufficient_gprs(
+ int a, int b, int c, int d, int e, int f, int g, struct double_int32_s h) {
+ return (struct double_double_s){1.0, 2.0};
+}
+
+// CHECK: define { double, double } @f_ret_doublecomplex_double_int32_s_just_sufficient_gprs(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e, i32 %f, i32 %g, double %0, i32 %1)
+double __complex__ f_ret_doublecomplex_double_int32_s_just_sufficient_gprs(
+ int a, int b, int c, int d, int e, int f, int g, struct double_int32_s h) {
+ return 1.0;
+}
diff --git a/src/llvm-project/clang/test/CodeGen/riscv32-ilp32f-ilp32d-abi.c b/src/llvm-project/clang/test/CodeGen/riscv32-ilp32f-ilp32d-abi.c
index b960513..e9705ca 100644
--- a/src/llvm-project/clang/test/CodeGen/riscv32-ilp32f-ilp32d-abi.c
+++ b/src/llvm-project/clang/test/CodeGen/riscv32-ilp32f-ilp32d-abi.c
@@ -27,7 +27,7 @@
struct float_s { float f; };
-// CHECK: define void @f_float_s_arg(float)
+// CHECK: define void @f_float_s_arg(float %0)
void f_float_s_arg(struct float_s a) {}
// CHECK: define float @f_ret_float_s()
@@ -41,7 +41,7 @@
struct zbf_float_s { int : 0; float f; };
struct zbf_float_zbf_s { int : 0; float f; int : 0; };
-// CHECK: define void @f_zbf_float_s_arg(float)
+// CHECK: define void @f_zbf_float_s_arg(float %0)
void f_zbf_float_s_arg(struct zbf_float_s a) {}
// CHECK: define float @f_ret_zbf_float_s()
@@ -49,7 +49,7 @@
return (struct zbf_float_s){1.0};
}
-// CHECK: define void @f_zbf_float_zbf_s_arg(float)
+// CHECK: define void @f_zbf_float_zbf_s_arg(float %0)
void f_zbf_float_zbf_s_arg(struct zbf_float_zbf_s a) {}
// CHECK: define float @f_ret_zbf_float_zbf_s()
@@ -62,7 +62,7 @@
struct float_float_s { float f; float g; };
-// CHECK: define void @f_float_float_s_arg(float, float)
+// CHECK: define void @f_float_float_s_arg(float %0, float %1)
void f_float_float_s_arg(struct float_float_s a) {}
// CHECK: define { float, float } @f_ret_float_float_s()
@@ -85,7 +85,7 @@
struct float_int64bf_s { float f; int64_t i : 32; };
struct float_int8_zbf_s { float f; int8_t i; int : 0; };
-// CHECK: define void @f_float_int8_s_arg(float, i8)
+// CHECK: define void @f_float_int8_s_arg(float %0, i8 %1)
void f_float_int8_s_arg(struct float_int8_s a) {}
// CHECK: define { float, i8 } @f_ret_float_int8_s()
@@ -93,7 +93,7 @@
return (struct float_int8_s){1.0, 2};
}
-// CHECK: define void @f_float_uint8_s_arg(float, i8)
+// CHECK: define void @f_float_uint8_s_arg(float %0, i8 %1)
void f_float_uint8_s_arg(struct float_uint8_s a) {}
// CHECK: define { float, i8 } @f_ret_float_uint8_s()
@@ -101,7 +101,7 @@
return (struct float_uint8_s){1.0, 2};
}
-// CHECK: define void @f_float_int32_s_arg(float, i32)
+// CHECK: define void @f_float_int32_s_arg(float %0, i32 %1)
void f_float_int32_s_arg(struct float_int32_s a) {}
// CHECK: define { float, i32 } @f_ret_float_int32_s()
@@ -117,7 +117,7 @@
return (struct float_int64_s){1.0, 2};
}
-// CHECK: define void @f_float_int64bf_s_arg(float, i32)
+// CHECK: define void @f_float_int64bf_s_arg(float %0, i32 %1)
void f_float_int64bf_s_arg(struct float_int64bf_s a) {}
// CHECK: define { float, i32 } @f_ret_float_int64bf_s()
@@ -128,7 +128,7 @@
// The zero-width bitfield means the struct can't be passed according to the
// floating point calling convention.
-// CHECK: define void @f_float_int8_zbf_s(float, i8)
+// CHECK: define void @f_float_int8_zbf_s(float %0, i8 %1)
void f_float_int8_zbf_s(struct float_int8_zbf_s a) {}
// CHECK: define { float, i8 } @f_ret_float_int8_zbf_s()
@@ -157,7 +157,7 @@
struct floatcomplex_s { float __complex__ c; };
-// CHECK: define void @f_floatcomplex_s_arg(float, float)
+// CHECK: define void @f_floatcomplex_s_arg(float %0, float %1)
void f_floatcomplex_s_arg(struct floatcomplex_s a) {}
// CHECK: define { float, float } @f_ret_floatcomplex_s()
@@ -170,7 +170,7 @@
struct floatarr1_s { float a[1]; };
-// CHECK: define void @f_floatarr1_s_arg(float)
+// CHECK: define void @f_floatarr1_s_arg(float %0)
void f_floatarr1_s_arg(struct floatarr1_s a) {}
// CHECK: define float @f_ret_floatarr1_s()
@@ -180,7 +180,7 @@
struct floatarr2_s { float a[2]; };
-// CHECK: define void @f_floatarr2_s_arg(float, float)
+// CHECK: define void @f_floatarr2_s_arg(float %0, float %1)
void f_floatarr2_s_arg(struct floatarr2_s a) {}
// CHECK: define { float, float } @f_ret_floatarr2_s()
@@ -190,7 +190,7 @@
struct floatarr2_tricky1_s { struct { float f[1]; } g[2]; };
-// CHECK: define void @f_floatarr2_tricky1_s_arg(float, float)
+// CHECK: define void @f_floatarr2_tricky1_s_arg(float %0, float %1)
void f_floatarr2_tricky1_s_arg(struct floatarr2_tricky1_s a) {}
// CHECK: define { float, float } @f_ret_floatarr2_tricky1_s()
@@ -200,7 +200,7 @@
struct floatarr2_tricky2_s { struct {}; struct { float f[1]; } g[2]; };
-// CHECK: define void @f_floatarr2_tricky2_s_arg(float, float)
+// CHECK: define void @f_floatarr2_tricky2_s_arg(float %0, float %1)
void f_floatarr2_tricky2_s_arg(struct floatarr2_tricky2_s a) {}
// CHECK: define { float, float } @f_ret_floatarr2_tricky2_s()
@@ -210,7 +210,7 @@
struct floatarr2_tricky3_s { union {}; struct { float f[1]; } g[2]; };
-// CHECK: define void @f_floatarr2_tricky3_s_arg(float, float)
+// CHECK: define void @f_floatarr2_tricky3_s_arg(float %0, float %1)
void f_floatarr2_tricky3_s_arg(struct floatarr2_tricky3_s a) {}
// CHECK: define { float, float } @f_ret_floatarr2_tricky3_s()
@@ -220,7 +220,7 @@
struct floatarr2_tricky4_s { union {}; struct { struct {}; float f[1]; } g[2]; };
-// CHECK: define void @f_floatarr2_tricky4_s_arg(float, float)
+// CHECK: define void @f_floatarr2_tricky4_s_arg(float %0, float %1)
void f_floatarr2_tricky4_s_arg(struct floatarr2_tricky4_s a) {}
// CHECK: define { float, float } @f_ret_floatarr2_tricky4_s()
diff --git a/src/llvm-project/clang/test/CodeGen/riscv64-lp64-abi.c b/src/llvm-project/clang/test/CodeGen/riscv64-lp64-abi.c
index 3720315..bae5470 100644
--- a/src/llvm-project/clang/test/CodeGen/riscv64-lp64-abi.c
+++ b/src/llvm-project/clang/test/CodeGen/riscv64-lp64-abi.c
@@ -15,7 +15,7 @@
// Scalars passed on the stack should not have signext/zeroext attributes
// (they are anyext).
-// CHECK-LABEL: define signext i32 @f_scalar_stack_1(i32 signext %a, i128 %b, float %c, fp128 %d, <32 x i8>*, i8 zeroext %f, i8 %g, i8 %h)
+// CHECK-LABEL: define signext i32 @f_scalar_stack_1(i32 signext %a, i128 %b, float %c, fp128 %d, <32 x i8>* %0, i8 zeroext %f, i8 %g, i8 %h)
int f_scalar_stack_1(int32_t a, __int128_t b, float c, long double d, v32i8 e,
uint8_t f, int8_t g, uint8_t h) {
return g + h;
@@ -25,7 +25,7 @@
// the presence of large return values that consume a register due to the need
// to pass a pointer.
-// CHECK-LABEL: define void @f_scalar_stack_2(%struct.large* noalias sret %agg.result, double %a, i128 %b, fp128 %c, <32 x i8>*, i8 zeroext %e, i8 %f, i8 %g)
+// CHECK-LABEL: define void @f_scalar_stack_2(%struct.large* noalias sret %agg.result, double %a, i128 %b, fp128 %c, <32 x i8>* %0, i8 zeroext %e, i8 %f, i8 %g)
struct large f_scalar_stack_2(double a, __int128_t b, long double c, v32i8 d,
uint8_t e, int8_t f, uint8_t g) {
return (struct large){a, e, f, g};
diff --git a/src/llvm-project/clang/test/CodeGen/riscv64-lp64-lp64f-abi.c b/src/llvm-project/clang/test/CodeGen/riscv64-lp64-lp64f-abi.c
index d457bdf..d9c909e 100644
--- a/src/llvm-project/clang/test/CodeGen/riscv64-lp64-lp64f-abi.c
+++ b/src/llvm-project/clang/test/CodeGen/riscv64-lp64-lp64f-abi.c
@@ -17,7 +17,7 @@
// Scalars passed on the stack should not have signext/zeroext attributes
// (they are anyext).
-// CHECK-LABEL: define signext i32 @f_scalar_stack_1(i32 signext %a, i128 %b, double %c, fp128 %d, <32 x i8>*, i8 zeroext %f, i8 %g, i8 %h)
+// CHECK-LABEL: define signext i32 @f_scalar_stack_1(i32 signext %a, i128 %b, double %c, fp128 %d, <32 x i8>* %0, i8 zeroext %f, i8 %g, i8 %h)
int f_scalar_stack_1(int32_t a, __int128_t b, double c, long double d, v32i8 e,
uint8_t f, int8_t g, uint8_t h) {
return g + h;
@@ -27,7 +27,7 @@
// the presence of large return values that consume a register due to the need
// to pass a pointer.
-// CHECK-LABEL: define void @f_scalar_stack_2(%struct.large* noalias sret %agg.result, double %a, i128 %b, fp128 %c, <32 x i8>*, i8 zeroext %e, i8 %f, i8 %g)
+// CHECK-LABEL: define void @f_scalar_stack_2(%struct.large* noalias sret %agg.result, double %a, i128 %b, fp128 %c, <32 x i8>* %0, i8 zeroext %e, i8 %f, i8 %g)
struct large f_scalar_stack_2(double a, __int128_t b, long double c, v32i8 d,
uint8_t e, int8_t f, uint8_t g) {
return (struct large){a, e, f, g};
diff --git a/src/llvm-project/clang/test/CodeGen/riscv64-lp64-lp64f-lp64d-abi.c b/src/llvm-project/clang/test/CodeGen/riscv64-lp64-lp64f-lp64d-abi.c
index f352370..f50a8ca 100644
--- a/src/llvm-project/clang/test/CodeGen/riscv64-lp64-lp64f-lp64d-abi.c
+++ b/src/llvm-project/clang/test/CodeGen/riscv64-lp64-lp64f-lp64d-abi.c
@@ -173,7 +173,7 @@
typedef unsigned char v32i8 __attribute__((vector_size(32)));
-// CHECK-LABEL: define void @f_vec_large_v32i8(<32 x i8>*)
+// CHECK-LABEL: define void @f_vec_large_v32i8(<32 x i8>* %0)
void f_vec_large_v32i8(v32i8 x) {
x[0] = x[7];
}
@@ -192,7 +192,7 @@
return g + h;
}
-// CHECK-LABEL: define signext i32 @f_scalar_stack_2(i32 signext %a, i128 %b, i64 %c, fp128 %d, <32 x i8>*, i8 zeroext %f, i8 %g, i8 %h)
+// CHECK-LABEL: define signext i32 @f_scalar_stack_2(i32 signext %a, i128 %b, i64 %c, fp128 %d, <32 x i8>* %0, i8 zeroext %f, i8 %g, i8 %h)
int f_scalar_stack_2(int32_t a, __int128_t b, int64_t c, long double d, v32i8 e,
uint8_t f, int8_t g, uint8_t h) {
return g + h;
@@ -202,7 +202,7 @@
// the presence of large return values that consume a register due to the need
// to pass a pointer.
-// CHECK-LABEL: define void @f_scalar_stack_3(%struct.large* noalias sret %agg.result, i32 signext %a, i128 %b, fp128 %c, <32 x i8>*, i8 zeroext %e, i8 %f, i8 %g)
+// CHECK-LABEL: define void @f_scalar_stack_3(%struct.large* noalias sret %agg.result, i32 signext %a, i128 %b, fp128 %c, <32 x i8>* %0, i8 zeroext %e, i8 %f, i8 %g)
struct large f_scalar_stack_3(uint32_t a, __int128_t b, long double c, v32i8 d,
uint8_t e, int8_t f, uint8_t g) {
return (struct large){a, e, f, g};
diff --git a/src/llvm-project/clang/test/CodeGen/riscv64-lp64d-abi.c b/src/llvm-project/clang/test/CodeGen/riscv64-lp64d-abi.c
index 00967b5..83947de 100644
--- a/src/llvm-project/clang/test/CodeGen/riscv64-lp64d-abi.c
+++ b/src/llvm-project/clang/test/CodeGen/riscv64-lp64d-abi.c
@@ -25,7 +25,7 @@
struct double_s { double f; };
-// CHECK: define void @f_double_s_arg(double)
+// CHECK: define void @f_double_s_arg(double %0)
void f_double_s_arg(struct double_s a) {}
// CHECK: define double @f_ret_double_s()
@@ -39,7 +39,7 @@
struct zbf_double_s { int : 0; double f; };
struct zbf_double_zbf_s { int : 0; double f; int : 0; };
-// CHECK: define void @f_zbf_double_s_arg(double)
+// CHECK: define void @f_zbf_double_s_arg(double %0)
void f_zbf_double_s_arg(struct zbf_double_s a) {}
// CHECK: define double @f_ret_zbf_double_s()
@@ -47,7 +47,7 @@
return (struct zbf_double_s){1.0};
}
-// CHECK: define void @f_zbf_double_zbf_s_arg(double)
+// CHECK: define void @f_zbf_double_zbf_s_arg(double %0)
void f_zbf_double_zbf_s_arg(struct zbf_double_zbf_s a) {}
// CHECK: define double @f_ret_zbf_double_zbf_s()
@@ -61,7 +61,7 @@
struct double_double_s { double f; double g; };
struct double_float_s { double f; float g; };
-// CHECK: define void @f_double_double_s_arg(double, double)
+// CHECK: define void @f_double_double_s_arg(double %0, double %1)
void f_double_double_s_arg(struct double_double_s a) {}
// CHECK: define { double, double } @f_ret_double_double_s()
@@ -69,7 +69,7 @@
return (struct double_double_s){1.0, 2.0};
}
-// CHECK: define void @f_double_float_s_arg(double, float)
+// CHECK: define void @f_double_float_s_arg(double %0, float %1)
void f_double_float_s_arg(struct double_float_s a) {}
// CHECK: define { double, float } @f_ret_double_float_s()
@@ -92,7 +92,7 @@
struct double_int128bf_s { double f; __int128_t i : 64; };
struct double_int8_zbf_s { double f; int8_t i; int : 0; };
-// CHECK: define void @f_double_int8_s_arg(double, i8)
+// CHECK: define void @f_double_int8_s_arg(double %0, i8 %1)
void f_double_int8_s_arg(struct double_int8_s a) {}
// CHECK: define { double, i8 } @f_ret_double_int8_s()
@@ -100,7 +100,7 @@
return (struct double_int8_s){1.0, 2};
}
-// CHECK: define void @f_double_uint8_s_arg(double, i8)
+// CHECK: define void @f_double_uint8_s_arg(double %0, i8 %1)
void f_double_uint8_s_arg(struct double_uint8_s a) {}
// CHECK: define { double, i8 } @f_ret_double_uint8_s()
@@ -108,7 +108,7 @@
return (struct double_uint8_s){1.0, 2};
}
-// CHECK: define void @f_double_int32_s_arg(double, i32)
+// CHECK: define void @f_double_int32_s_arg(double %0, i32 %1)
void f_double_int32_s_arg(struct double_int32_s a) {}
// CHECK: define { double, i32 } @f_ret_double_int32_s()
@@ -116,7 +116,7 @@
return (struct double_int32_s){1.0, 2};
}
-// CHECK: define void @f_double_int64_s_arg(double, i64)
+// CHECK: define void @f_double_int64_s_arg(double %0, i64 %1)
void f_double_int64_s_arg(struct double_int64_s a) {}
// CHECK: define { double, i64 } @f_ret_double_int64_s()
@@ -124,7 +124,7 @@
return (struct double_int64_s){1.0, 2};
}
-// CHECK: define void @f_double_int128bf_s_arg(double, i64)
+// CHECK: define void @f_double_int128bf_s_arg(double %0, i64 %1)
void f_double_int128bf_s_arg(struct double_int128bf_s a) {}
// CHECK: define { double, i64 } @f_ret_double_int128bf_s()
@@ -135,7 +135,7 @@
// The zero-width bitfield means the struct can't be passed according to the
// floating point calling convention.
-// CHECK: define void @f_double_int8_zbf_s(double, i8)
+// CHECK: define void @f_double_int8_zbf_s(double %0, i8 %1)
void f_double_int8_zbf_s(struct double_int8_zbf_s a) {}
// CHECK: define { double, i8 } @f_ret_double_int8_zbf_s()
@@ -164,7 +164,7 @@
struct doublecomplex_s { double __complex__ c; };
-// CHECK: define void @f_doublecomplex_s_arg(double, double)
+// CHECK: define void @f_doublecomplex_s_arg(double %0, double %1)
void f_doublecomplex_s_arg(struct doublecomplex_s a) {}
// CHECK: define { double, double } @f_ret_doublecomplex_s()
@@ -177,7 +177,7 @@
struct doublearr1_s { double a[1]; };
-// CHECK: define void @f_doublearr1_s_arg(double)
+// CHECK: define void @f_doublearr1_s_arg(double %0)
void f_doublearr1_s_arg(struct doublearr1_s a) {}
// CHECK: define double @f_ret_doublearr1_s()
@@ -187,7 +187,7 @@
struct doublearr2_s { double a[2]; };
-// CHECK: define void @f_doublearr2_s_arg(double, double)
+// CHECK: define void @f_doublearr2_s_arg(double %0, double %1)
void f_doublearr2_s_arg(struct doublearr2_s a) {}
// CHECK: define { double, double } @f_ret_doublearr2_s()
@@ -197,7 +197,7 @@
struct doublearr2_tricky1_s { struct { double f[1]; } g[2]; };
-// CHECK: define void @f_doublearr2_tricky1_s_arg(double, double)
+// CHECK: define void @f_doublearr2_tricky1_s_arg(double %0, double %1)
void f_doublearr2_tricky1_s_arg(struct doublearr2_tricky1_s a) {}
// CHECK: define { double, double } @f_ret_doublearr2_tricky1_s()
@@ -207,7 +207,7 @@
struct doublearr2_tricky2_s { struct {}; struct { double f[1]; } g[2]; };
-// CHECK: define void @f_doublearr2_tricky2_s_arg(double, double)
+// CHECK: define void @f_doublearr2_tricky2_s_arg(double %0, double %1)
void f_doublearr2_tricky2_s_arg(struct doublearr2_tricky2_s a) {}
// CHECK: define { double, double } @f_ret_doublearr2_tricky2_s()
@@ -217,7 +217,7 @@
struct doublearr2_tricky3_s { union {}; struct { double f[1]; } g[2]; };
-// CHECK: define void @f_doublearr2_tricky3_s_arg(double, double)
+// CHECK: define void @f_doublearr2_tricky3_s_arg(double %0, double %1)
void f_doublearr2_tricky3_s_arg(struct doublearr2_tricky3_s a) {}
// CHECK: define { double, double } @f_ret_doublearr2_tricky3_s()
@@ -227,7 +227,7 @@
struct doublearr2_tricky4_s { union {}; struct { struct {}; double f[1]; } g[2]; };
-// CHECK: define void @f_doublearr2_tricky4_s_arg(double, double)
+// CHECK: define void @f_doublearr2_tricky4_s_arg(double %0, double %1)
void f_doublearr2_tricky4_s_arg(struct doublearr2_tricky4_s a) {}
// CHECK: define { double, double } @f_ret_doublearr2_tricky4_s()
diff --git a/src/llvm-project/clang/test/CodeGen/riscv64-lp64f-lp64d-abi.c b/src/llvm-project/clang/test/CodeGen/riscv64-lp64f-lp64d-abi.c
index eee2bc1..9a44928 100644
--- a/src/llvm-project/clang/test/CodeGen/riscv64-lp64f-lp64d-abi.c
+++ b/src/llvm-project/clang/test/CodeGen/riscv64-lp64f-lp64d-abi.c
@@ -27,7 +27,7 @@
struct float_s { float f; };
-// CHECK: define void @f_float_s_arg(float)
+// CHECK: define void @f_float_s_arg(float %0)
void f_float_s_arg(struct float_s a) {}
// CHECK: define float @f_ret_float_s()
@@ -41,7 +41,7 @@
struct zbf_float_s { int : 0; float f; };
struct zbf_float_zbf_s { int : 0; float f; int : 0; };
-// CHECK: define void @f_zbf_float_s_arg(float)
+// CHECK: define void @f_zbf_float_s_arg(float %0)
void f_zbf_float_s_arg(struct zbf_float_s a) {}
// CHECK: define float @f_ret_zbf_float_s()
@@ -49,7 +49,7 @@
return (struct zbf_float_s){1.0};
}
-// CHECK: define void @f_zbf_float_zbf_s_arg(float)
+// CHECK: define void @f_zbf_float_zbf_s_arg(float %0)
void f_zbf_float_zbf_s_arg(struct zbf_float_zbf_s a) {}
// CHECK: define float @f_ret_zbf_float_zbf_s()
@@ -62,7 +62,7 @@
struct float_float_s { float f; float g; };
-// CHECK: define void @f_float_float_s_arg(float, float)
+// CHECK: define void @f_float_float_s_arg(float %0, float %1)
void f_float_float_s_arg(struct float_float_s a) {}
// CHECK: define { float, float } @f_ret_float_float_s()
@@ -85,7 +85,7 @@
struct float_int128bf_s { float f; __int128_t i : 64; };
struct float_int8_zbf_s { float f; int8_t i; int : 0; };
-// CHECK: define void @f_float_int8_s_arg(float, i8)
+// CHECK: define void @f_float_int8_s_arg(float %0, i8 %1)
void f_float_int8_s_arg(struct float_int8_s a) {}
// CHECK: define { float, i8 } @f_ret_float_int8_s()
@@ -93,7 +93,7 @@
return (struct float_int8_s){1.0, 2};
}
-// CHECK: define void @f_float_uint8_s_arg(float, i8)
+// CHECK: define void @f_float_uint8_s_arg(float %0, i8 %1)
void f_float_uint8_s_arg(struct float_uint8_s a) {}
// CHECK: define { float, i8 } @f_ret_float_uint8_s()
@@ -101,7 +101,7 @@
return (struct float_uint8_s){1.0, 2};
}
-// CHECK: define void @f_float_int32_s_arg(float, i32)
+// CHECK: define void @f_float_int32_s_arg(float %0, i32 %1)
void f_float_int32_s_arg(struct float_int32_s a) {}
// CHECK: define { float, i32 } @f_ret_float_int32_s()
@@ -109,7 +109,7 @@
return (struct float_int32_s){1.0, 2};
}
-// CHECK: define void @f_float_int64_s_arg(float, i64)
+// CHECK: define void @f_float_int64_s_arg(float %0, i64 %1)
void f_float_int64_s_arg(struct float_int64_s a) {}
// CHECK: define { float, i64 } @f_ret_float_int64_s()
@@ -117,7 +117,7 @@
return (struct float_int64_s){1.0, 2};
}
-// CHECK: define void @f_float_int128bf_s_arg(float, i64)
+// CHECK: define void @f_float_int128bf_s_arg(float %0, i64 %1)
void f_float_int128bf_s_arg(struct float_int128bf_s a) {}
// CHECK: define <{ float, i64 }> @f_ret_float_int128bf_s()
@@ -128,7 +128,7 @@
// The zero-width bitfield means the struct can't be passed according to the
// floating point calling convention.
-// CHECK: define void @f_float_int8_zbf_s(float, i8)
+// CHECK: define void @f_float_int8_zbf_s(float %0, i8 %1)
void f_float_int8_zbf_s(struct float_int8_zbf_s a) {}
// CHECK: define { float, i8 } @f_ret_float_int8_zbf_s()
@@ -157,7 +157,7 @@
struct floatcomplex_s { float __complex__ c; };
-// CHECK: define void @f_floatcomplex_s_arg(float, float)
+// CHECK: define void @f_floatcomplex_s_arg(float %0, float %1)
void f_floatcomplex_s_arg(struct floatcomplex_s a) {}
// CHECK: define { float, float } @f_ret_floatcomplex_s()
@@ -170,7 +170,7 @@
struct floatarr1_s { float a[1]; };
-// CHECK: define void @f_floatarr1_s_arg(float)
+// CHECK: define void @f_floatarr1_s_arg(float %0)
void f_floatarr1_s_arg(struct floatarr1_s a) {}
// CHECK: define float @f_ret_floatarr1_s()
@@ -180,7 +180,7 @@
struct floatarr2_s { float a[2]; };
-// CHECK: define void @f_floatarr2_s_arg(float, float)
+// CHECK: define void @f_floatarr2_s_arg(float %0, float %1)
void f_floatarr2_s_arg(struct floatarr2_s a) {}
// CHECK: define { float, float } @f_ret_floatarr2_s()
@@ -190,7 +190,7 @@
struct floatarr2_tricky1_s { struct { float f[1]; } g[2]; };
-// CHECK: define void @f_floatarr2_tricky1_s_arg(float, float)
+// CHECK: define void @f_floatarr2_tricky1_s_arg(float %0, float %1)
void f_floatarr2_tricky1_s_arg(struct floatarr2_tricky1_s a) {}
// CHECK: define { float, float } @f_ret_floatarr2_tricky1_s()
@@ -200,7 +200,7 @@
struct floatarr2_tricky2_s { struct {}; struct { float f[1]; } g[2]; };
-// CHECK: define void @f_floatarr2_tricky2_s_arg(float, float)
+// CHECK: define void @f_floatarr2_tricky2_s_arg(float %0, float %1)
void f_floatarr2_tricky2_s_arg(struct floatarr2_tricky2_s a) {}
// CHECK: define { float, float } @f_ret_floatarr2_tricky2_s()
@@ -210,7 +210,7 @@
struct floatarr2_tricky3_s { union {}; struct { float f[1]; } g[2]; };
-// CHECK: define void @f_floatarr2_tricky3_s_arg(float, float)
+// CHECK: define void @f_floatarr2_tricky3_s_arg(float %0, float %1)
void f_floatarr2_tricky3_s_arg(struct floatarr2_tricky3_s a) {}
// CHECK: define { float, float } @f_ret_floatarr2_tricky3_s()
@@ -220,7 +220,7 @@
struct floatarr2_tricky4_s { union {}; struct { struct {}; float f[1]; } g[2]; };
-// CHECK: define void @f_floatarr2_tricky4_s_arg(float, float)
+// CHECK: define void @f_floatarr2_tricky4_s_arg(float %0, float %1)
void f_floatarr2_tricky4_s_arg(struct floatarr2_tricky4_s a) {}
// CHECK: define { float, float } @f_ret_floatarr2_tricky4_s()
diff --git a/src/llvm-project/clang/test/CodeGen/s390x-packed-struct-func-arg.c b/src/llvm-project/clang/test/CodeGen/s390x-packed-struct-func-arg.c
new file mode 100644
index 0000000..df68b03
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/s390x-packed-struct-func-arg.c
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -triple s390x-linux-gnu -target-cpu z13 -emit-llvm -o - %s \
+// RUN: | FileCheck %s
+
+struct S0 {
+ long f1;
+ int f2 : 4;
+} d;
+
+#pragma pack(1)
+struct S1 {
+ struct S0 S0_member;
+};
+
+void f(struct S0 arg) {
+ arg.f2 = 1;
+}
+
+void g() {
+ struct S1 g;
+ // CHECK: alloca %struct.S0, align 8
+ // CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 {{.*}}, i8* align 1 {{.*}}, i64 16
+ f(g.S0_member);
+}
diff --git a/src/llvm-project/clang/test/CodeGen/sancov-new-pm.c b/src/llvm-project/clang/test/CodeGen/sancov-new-pm.c
new file mode 100644
index 0000000..06d9042
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/sancov-new-pm.c
@@ -0,0 +1,41 @@
+// Test that SanitizerCoverage works under the new pass manager.
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=fuzzer %s -fexperimental-new-pass-manager -S -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,CHECK-O0
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=fuzzer %s -fexperimental-new-pass-manager -O2 -S -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,CHECK-O2
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=fuzzer %s -fexperimental-new-pass-manager -flto -S -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,CHECK-O0
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=fuzzer %s -fexperimental-new-pass-manager -flto -O2 -S -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,CHECK-O2
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=fuzzer %s -fexperimental-new-pass-manager -flto=thin -S -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,CHECK-O0
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=fuzzer %s -fexperimental-new-pass-manager -flto=thin -O2 -S -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,CHECK-O2,CHECK-O2-THINLTO
+
+extern void *memcpy(void *, const void *, unsigned long);
+extern int printf(const char *restrict, ...);
+
+int LLVMFuzzerTestOneInput(const unsigned char *data, unsigned long size) {
+ unsigned char buf[4];
+
+ if (size < 8)
+ return 0;
+
+ if (data[0] == 'h' && data[1] == 'i' && data[2] == '!') {
+ memcpy(buf, data, size);
+ printf("test: %.2X\n", buf[0]);
+ }
+
+ return 0;
+}
+
+// CHECK-DAG: declare void @__sanitizer_cov_pcs_init(i64*, i64*)
+// CHECK-O0-DAG: declare void @__sanitizer_cov_trace_pc_indir(i64)
+// CHECK-O0-DAG: declare void @__sanitizer_cov_trace_cmp1(i8 zeroext, i8 zeroext)
+// CHECK-O0-DAG: declare void @__sanitizer_cov_trace_cmp2(i16 zeroext, i16 zeroext)
+// CHECK-O0-DAG: declare void @__sanitizer_cov_trace_cmp4(i32 zeroext, i32 zeroext)
+// CHECK-O0-DAG: declare void @__sanitizer_cov_trace_cmp8(i64, i64)
+// CHECK-O2-THINLTO-NOT: declare void @__sanitizer_cov_trace_const_cmp1(i8 zeroext, i8 zeroext)
+// CHECK-O0-DAG: declare void @__sanitizer_cov_trace_const_cmp2(i16 zeroext, i16 zeroext)
+// CHECK-O0-DAG: declare void @__sanitizer_cov_trace_const_cmp4(i32 zeroext, i32 zeroext)
+// CHECK-O2-THINLTO-NOT: declare void @__sanitizer_cov_trace_const_cmp8(i64, i64)
+// CHECK-O0-DAG: declare void @__sanitizer_cov_trace_div4(i32 zeroext)
+// CHECK-O0-DAG: declare void @__sanitizer_cov_trace_div8(i64)
+// CHECK-O0-DAG: declare void @__sanitizer_cov_trace_gep(i64)
+// CHECK-O0-DAG: declare void @__sanitizer_cov_trace_switch(i64, i64*)
+// CHECK-O0-DAG: declare void @__sanitizer_cov_trace_pc()
+// CHECK-O0-DAG: declare void @__sanitizer_cov_trace_pc_guard(i32*)
diff --git a/src/llvm-project/clang/test/CodeGen/sanitize-thread-no-checking-at-run-time.m b/src/llvm-project/clang/test/CodeGen/sanitize-thread-no-checking-at-run-time.m
index 16d3bc9..e0d7eb5 100644
--- a/src/llvm-project/clang/test/CodeGen/sanitize-thread-no-checking-at-run-time.m
+++ b/src/llvm-project/clang/test/CodeGen/sanitize-thread-no-checking-at-run-time.m
@@ -35,7 +35,7 @@
void test2(id x) {
extern void test2_helper(id (^)(void));
test2_helper(^{ return x; });
-// TSAN: define linkonce_odr hidden void @__destroy_helper_block_8_32o(i8*) unnamed_addr [[ATTR:#[0-9]+]]
+// TSAN: define linkonce_odr hidden void @__destroy_helper_block_8_32o(i8* %0) unnamed_addr [[ATTR:#[0-9]+]]
}
// TSAN: attributes [[ATTR]] = { noinline nounwind {{.*}} "sanitize_thread_no_checking_at_run_time" {{.*}} }
diff --git a/src/llvm-project/clang/test/CodeGen/sanitizer-module-constructor.c b/src/llvm-project/clang/test/CodeGen/sanitizer-module-constructor.c
new file mode 100644
index 0000000..70d75e9
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/sanitizer-module-constructor.c
@@ -0,0 +1,22 @@
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -fsanitize=address -emit-llvm -O3 -fdebug-pass-manager -fexperimental-new-pass-manager -o - %s 2>&1 | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -fsanitize=thread -emit-llvm -O3 -fdebug-pass-manager -fexperimental-new-pass-manager -o - %s 2>&1 | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -fsanitize=memory -emit-llvm -O3 -fdebug-pass-manager -fexperimental-new-pass-manager -o - %s 2>&1 | FileCheck %s
+
+// This is regression test for PR42877
+
+typedef struct a *b;
+struct a {
+ int c;
+};
+int d;
+b e;
+static void f(b g) {
+ for (d = g->c;;)
+ ;
+}
+void h() { f(e); }
+
+// CHECK: Running pass: {{.*}}SanitizerPass on {{.*}}sanitizer-module-constructor.c
+// CHECK-NOT: Running pass: LoopSimplifyPass on {{.*}}san.module_ctor
+// CHECK: Running analysis: DominatorTreeAnalysis on {{.*}}san.module_ctor
+// CHECK: Running pass: LoopSimplifyPass on {{.*}}san.module_ctor
diff --git a/src/llvm-project/clang/test/CodeGen/split-debug-output.c b/src/llvm-project/clang/test/CodeGen/split-debug-output.c
index 1507edd..19569f8 100644
--- a/src/llvm-project/clang/test/CodeGen/split-debug-output.c
+++ b/src/llvm-project/clang/test/CodeGen/split-debug-output.c
@@ -1,7 +1,11 @@
// REQUIRES: x86-registered-target
-// RUN: %clang_cc1 -triple x86_64-unknown-linux -debug-info-kind=limited -split-dwarf-file foo.dwo -split-dwarf-output %t -emit-obj -o - %s | llvm-dwarfdump -debug-info - | FileCheck %s
-// RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-unknown-linux -debug-info-kind=limited -dwarf-version=4 -split-dwarf-file foo.dwo -split-dwarf-output %t -emit-obj -o - %s | llvm-dwarfdump -debug-info - | FileCheck --check-prefix=DWARFv4 %s
+// RUN: llvm-dwarfdump -debug-info %t | FileCheck --check-prefix=DWARFv4 %s
+
+// RUN: %clang_cc1 -triple x86_64-unknown-linux -debug-info-kind=limited -dwarf-version=5 -split-dwarf-file foo.dwo -split-dwarf-output %t -emit-obj -o - %s | llvm-dwarfdump -debug-info - | FileCheck --check-prefix=DWARFv5 %s
+// RUN: llvm-dwarfdump -debug-info %t | FileCheck --check-prefix=DWARFv5 %s
int f() { return 0; }
-// CHECK: DW_AT_GNU_dwo_name ("foo.dwo")
+// DWARFv4: DW_AT_GNU_dwo_name ("foo.dwo")
+// DWARFv5: DW_AT_dwo_name ("foo.dwo")
diff --git a/src/llvm-project/clang/test/CodeGen/split-lto-unit.c b/src/llvm-project/clang/test/CodeGen/split-lto-unit.c
new file mode 100644
index 0000000..bd15765
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/split-lto-unit.c
@@ -0,0 +1,13 @@
+// ; Check that -flto=thin without -fsplit-lto-unit has EnableSplitLTOUnit = 0
+// RUN: %clang_cc1 -flto=thin -emit-llvm-bc < %s | llvm-dis -o - | FileCheck %s
+// CHECK: !{i32 1, !"EnableSplitLTOUnit", i32 0}
+//
+// ; Check that -flto=thin with -fsplit-lto-unit has EnableSplitLTOUnit = 1
+// RUN: %clang_cc1 -flto=thin -fsplit-lto-unit -emit-llvm-bc < %s | llvm-dis -o - | FileCheck %s --check-prefix=SPLIT
+// SPLIT: !{i32 1, !"EnableSplitLTOUnit", i32 1}
+//
+// ; Check that regular LTO has EnableSplitLTOUnit = 1
+// RUN: %clang_cc1 -fno-experimental-new-pass-manager -flto -triple x86_64-pc-linux-gnu -emit-llvm-bc < %s | llvm-dis -o - | FileCheck %s --implicit-check-not="EnableSplitLTOUnit" --check-prefix=SPLIT
+// RUN: %clang_cc1 -fexperimental-new-pass-manager -flto -triple x86_64-pc-linux-gnu -emit-llvm-bc < %s | llvm-dis -o - | FileCheck %s --implicit-check-not="EnableSplitLTOUnit" --check-prefix=SPLIT
+
+int main() {}
diff --git a/src/llvm-project/clang/test/CodeGen/sse-builtins.c b/src/llvm-project/clang/test/CodeGen/sse-builtins.c
index 4179341..3891c07 100644
--- a/src/llvm-project/clang/test/CodeGen/sse-builtins.c
+++ b/src/llvm-project/clang/test/CodeGen/sse-builtins.c
@@ -503,7 +503,7 @@
void test_mm_prefetch(char const* p) {
// CHECK-LABEL: test_mm_prefetch
- // CHECK: call void @llvm.prefetch(i8* {{.*}}, i32 0, i32 0, i32 1)
+ // CHECK: call void @llvm.prefetch.p0i8(i8* {{.*}}, i32 0, i32 0, i32 1)
_mm_prefetch(p, 0);
}
@@ -714,7 +714,7 @@
_mm_storeu_ps(x, y);
}
-void test_mm_stream_ps(float*A, __m128d B) {
+void test_mm_stream_ps(float*A, __m128 B) {
// CHECK-LABEL: test_mm_stream_ps
// CHECK: store <4 x float> %{{.*}}, <4 x float>* %{{.*}}, align 16, !nontemporal
_mm_stream_ps(A, B);
diff --git a/src/llvm-project/clang/test/CodeGen/sse.c b/src/llvm-project/clang/test/CodeGen/sse.c
index 1191f55..a75b8dc 100644
--- a/src/llvm-project/clang/test/CodeGen/sse.c
+++ b/src/llvm-project/clang/test/CodeGen/sse.c
@@ -5,37 +5,37 @@
#include <emmintrin.h>
// Byte-shifts look reversed due to xmm register layout
-__m128 test_mm_slli_si128(__m128 a) {
+__m128i test_mm_slli_si128(__m128i a) {
// CHECK-LABEL: @test_mm_slli_si128
// CHECK: shufflevector <16 x i8> <{{.*}}, i8 0, i8 0, i8 0, i8 0, i8 0>, <16 x i8> {{.*}}, <16 x i32> <i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26>
return _mm_slli_si128(a, 5);
}
-__m128 test_mm_slli_si128_0(__m128 a) {
+__m128i test_mm_slli_si128_0(__m128i a) {
// CHECK-LABEL: @test_mm_slli_si128_0
// CHECK-NOT: shufflevector
return _mm_slli_si128(a, 0);
}
-__m128 test_mm_slli_si128_16(__m128 a) {
+__m128i test_mm_slli_si128_16(__m128i a) {
// CHECK-LABEL: @test_mm_slli_si128_16
// CHECK-NOT: shufflevector
return _mm_slli_si128(a, 16);
}
-__m128 test_mm_srli_si128(__m128 a) {
+__m128i test_mm_srli_si128(__m128i a) {
// CHECK-LABEL: @test_mm_srli_si128
// CHECK: shufflevector <16 x i8> {{.*}}, <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, {{.*}}>, <16 x i32> <i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20>
return _mm_srli_si128(a, 5);
}
-__m128 test_mm_srli_si128_0(__m128 a) {
+__m128i test_mm_srli_si128_0(__m128i a) {
// CHECK-LABEL: @test_mm_srli_si128_0
// CHECK-NOT: shufflevector
return _mm_srli_si128(a, 0);
}
-__m128 test_mm_srli_si128_16(__m128 a) {
+__m128i test_mm_srli_si128_16(__m128i a) {
// CHECK-LABEL: @test_mm_srli_si128_16
// CHECK-NOT: shufflevector
return _mm_srli_si128(a, 16);
diff --git a/src/llvm-project/clang/test/CodeGen/sse2-builtins.c b/src/llvm-project/clang/test/CodeGen/sse2-builtins.c
index 280640c..6e4327f 100644
--- a/src/llvm-project/clang/test/CodeGen/sse2-builtins.c
+++ b/src/llvm-project/clang/test/CodeGen/sse2-builtins.c
@@ -808,6 +808,23 @@
return _mm_min_sd(A, B);
}
+__m64 test_mm_movepi64_pi64(__m128i A)
+{
+ // CHECK-LABEL: test_mm_movepi64_pi64
+ // CHECK: [[EXT:%.*]] = extractelement <2 x i64> %1, i32 0
+ // CHECK: bitcast i64 [[EXT]] to <1 x i64>
+ return _mm_movepi64_pi64(A);
+}
+
+__m128i test_mm_movpi64_epi64(__m64 A)
+{
+ // CHECK-LABEL: test_mm_movpi64_epi64
+ // CHECK: [[CAST:%.*]] = bitcast <1 x i64> %{{.*}} to i64
+ // CHECK: [[INS:%.*]] = insertelement <2 x i64> undef, i64 [[CAST]], i32 0
+ // CHECK: insertelement <2 x i64> [[INS]], i64 0, i32 1
+ return _mm_movpi64_epi64(A);
+}
+
__m128i test_mm_move_epi64(__m128i A) {
// CHECK-LABEL: test_mm_move_epi64
// CHECK: shufflevector <2 x i64> %{{.*}}, <2 x i64> %{{.*}}, <2 x i32> <i32 0, i32 2>
diff --git a/src/llvm-project/clang/test/CodeGen/string-literal.c b/src/llvm-project/clang/test/CodeGen/string-literal.c
index c460187..6634872 100644
--- a/src/llvm-project/clang/test/CodeGen/string-literal.c
+++ b/src/llvm-project/clang/test/CodeGen/string-literal.c
@@ -85,7 +85,7 @@
// CHECK-CXX11: private unnamed_addr constant [3 x i32] [i32 75, i32 76, i32 0], align 4
const wchar_t *l = LR"bar(KL)bar";
- // CHECK-CXX11: private unnamed_addr constant [9 x i8] c"abc\5Cndef\00", align 1
+ // CHECK-CXX11: private unnamed_addr constant [9 x i8] c"abc\\ndef\00", align 1
const char *m = R"(abc\ndef)";
// CHECK-CXX11: private unnamed_addr constant [8 x i8] c"abc\0Adef\00", align 1
@@ -96,13 +96,13 @@
const char *q = R"(abc
def)" "ghi";
- // CHECK-CXX11: private unnamed_addr constant [13 x i8] c"abc\5C\0A??=\0Adef\00", align 1
+ // CHECK-CXX11: private unnamed_addr constant [13 x i8] c"abc\\\0A??=\0Adef\00", align 1
const char *r = R\
"(abc\
??=
def)";
- // CHECK-CXX11: private unnamed_addr constant [13 x i8] c"def\5C\0A??=\0Aabc\00", align 1
+ // CHECK-CXX11: private unnamed_addr constant [13 x i8] c"def\\\0A??=\0Aabc\00", align 1
const char *s = u8R\
"(def\
??=
diff --git a/src/llvm-project/clang/test/CodeGen/struct-copy.c b/src/llvm-project/clang/test/CodeGen/struct-copy.c
index 6f3b664..49e7705 100644
--- a/src/llvm-project/clang/test/CodeGen/struct-copy.c
+++ b/src/llvm-project/clang/test/CodeGen/struct-copy.c
@@ -1,7 +1,17 @@
-// RUN: %clang_cc1 -emit-llvm %s -o - | grep 'call.*llvm.memcpy'
+// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
struct x { int a[100]; };
void foo(struct x *P, struct x *Q) {
+// CHECK-LABEL: @foo(
+// CHECK: call void @llvm.memcpy.p0i8.p0i8
*P = *Q;
}
+
+// CHECK: declare void @llvm.memcpy.p0i8.p0i8{{.*}}(i8* noalias nocapture writeonly, i8* noalias nocapture readonly
+
+void bar(struct x *P, struct x *Q) {
+// CHECK-LABEL: @bar(
+// CHECK: call void @llvm.memcpy.p0i8.p0i8
+ __builtin_memcpy(P, Q, sizeof(struct x));
+}
diff --git a/src/llvm-project/clang/test/CodeGen/systemz-abi-vector.c b/src/llvm-project/clang/test/CodeGen/systemz-abi-vector.c
index ce68b7c..f2e6c13 100644
--- a/src/llvm-project/clang/test/CodeGen/systemz-abi-vector.c
+++ b/src/llvm-project/clang/test/CodeGen/systemz-abi-vector.c
@@ -10,6 +10,8 @@
// RUN: -emit-llvm -o - %s | FileCheck --check-prefix=CHECK-VECTOR %s
// RUN: %clang_cc1 -triple s390x-linux-gnu -target-cpu arch12 \
// RUN: -emit-llvm -o - %s | FileCheck --check-prefix=CHECK-VECTOR %s
+// RUN: %clang_cc1 -triple s390x-linux-gnu -target-cpu z15 \
+// RUN: -emit-llvm -o - %s | FileCheck --check-prefix=CHECK-VECTOR %s
// RUN: %clang_cc1 -triple s390x-linux-gnu -target-cpu arch13 \
// RUN: -emit-llvm -o - %s | FileCheck --check-prefix=CHECK-VECTOR %s
@@ -48,91 +50,91 @@
// CHECK-VECTOR: @align = global i32 8
v1i8 pass_v1i8(v1i8 arg) { return arg; }
-// CHECK-LABEL: define void @pass_v1i8(<1 x i8>* noalias sret %{{.*}}, <1 x i8>*)
+// CHECK-LABEL: define void @pass_v1i8(<1 x i8>* noalias sret %{{.*}}, <1 x i8>* %0)
// CHECK-VECTOR-LABEL: define <1 x i8> @pass_v1i8(<1 x i8> %{{.*}})
v2i8 pass_v2i8(v2i8 arg) { return arg; }
-// CHECK-LABEL: define void @pass_v2i8(<2 x i8>* noalias sret %{{.*}}, <2 x i8>*)
+// CHECK-LABEL: define void @pass_v2i8(<2 x i8>* noalias sret %{{.*}}, <2 x i8>* %0)
// CHECK-VECTOR-LABEL: define <2 x i8> @pass_v2i8(<2 x i8> %{{.*}})
v4i8 pass_v4i8(v4i8 arg) { return arg; }
-// CHECK-LABEL: define void @pass_v4i8(<4 x i8>* noalias sret %{{.*}}, <4 x i8>*)
+// CHECK-LABEL: define void @pass_v4i8(<4 x i8>* noalias sret %{{.*}}, <4 x i8>* %0)
// CHECK-VECTOR-LABEL: define <4 x i8> @pass_v4i8(<4 x i8> %{{.*}})
v8i8 pass_v8i8(v8i8 arg) { return arg; }
-// CHECK-LABEL: define void @pass_v8i8(<8 x i8>* noalias sret %{{.*}}, <8 x i8>*)
+// CHECK-LABEL: define void @pass_v8i8(<8 x i8>* noalias sret %{{.*}}, <8 x i8>* %0)
// CHECK-VECTOR-LABEL: define <8 x i8> @pass_v8i8(<8 x i8> %{{.*}})
v16i8 pass_v16i8(v16i8 arg) { return arg; }
-// CHECK-LABEL: define void @pass_v16i8(<16 x i8>* noalias sret %{{.*}}, <16 x i8>*)
+// CHECK-LABEL: define void @pass_v16i8(<16 x i8>* noalias sret %{{.*}}, <16 x i8>* %0)
// CHECK-VECTOR-LABEL: define <16 x i8> @pass_v16i8(<16 x i8> %{{.*}})
v32i8 pass_v32i8(v32i8 arg) { return arg; }
-// CHECK-LABEL: define void @pass_v32i8(<32 x i8>* noalias sret %{{.*}}, <32 x i8>*)
-// CHECK-VECTOR-LABEL: define void @pass_v32i8(<32 x i8>* noalias sret %{{.*}}, <32 x i8>*)
+// CHECK-LABEL: define void @pass_v32i8(<32 x i8>* noalias sret %{{.*}}, <32 x i8>* %0)
+// CHECK-VECTOR-LABEL: define void @pass_v32i8(<32 x i8>* noalias sret %{{.*}}, <32 x i8>* %0)
v1i16 pass_v1i16(v1i16 arg) { return arg; }
-// CHECK-LABEL: define void @pass_v1i16(<1 x i16>* noalias sret %{{.*}}, <1 x i16>*)
+// CHECK-LABEL: define void @pass_v1i16(<1 x i16>* noalias sret %{{.*}}, <1 x i16>* %0)
// CHECK-VECTOR-LABEL: define <1 x i16> @pass_v1i16(<1 x i16> %{{.*}})
v2i16 pass_v2i16(v2i16 arg) { return arg; }
-// CHECK-LABEL: define void @pass_v2i16(<2 x i16>* noalias sret %{{.*}}, <2 x i16>*)
+// CHECK-LABEL: define void @pass_v2i16(<2 x i16>* noalias sret %{{.*}}, <2 x i16>* %0)
// CHECK-VECTOR-LABEL: define <2 x i16> @pass_v2i16(<2 x i16> %{{.*}})
v4i16 pass_v4i16(v4i16 arg) { return arg; }
-// CHECK-LABEL: define void @pass_v4i16(<4 x i16>* noalias sret %{{.*}}, <4 x i16>*)
+// CHECK-LABEL: define void @pass_v4i16(<4 x i16>* noalias sret %{{.*}}, <4 x i16>* %0)
// CHECK-VECTOR-LABEL: define <4 x i16> @pass_v4i16(<4 x i16> %{{.*}})
v8i16 pass_v8i16(v8i16 arg) { return arg; }
-// CHECK-LABEL: define void @pass_v8i16(<8 x i16>* noalias sret %{{.*}}, <8 x i16>*)
+// CHECK-LABEL: define void @pass_v8i16(<8 x i16>* noalias sret %{{.*}}, <8 x i16>* %0)
// CHECK-VECTOR-LABEL: define <8 x i16> @pass_v8i16(<8 x i16> %{{.*}})
v1i32 pass_v1i32(v1i32 arg) { return arg; }
-// CHECK-LABEL: define void @pass_v1i32(<1 x i32>* noalias sret %{{.*}}, <1 x i32>*)
+// CHECK-LABEL: define void @pass_v1i32(<1 x i32>* noalias sret %{{.*}}, <1 x i32>* %0)
// CHECK-VECTOR-LABEL: define <1 x i32> @pass_v1i32(<1 x i32> %{{.*}})
v2i32 pass_v2i32(v2i32 arg) { return arg; }
-// CHECK-LABEL: define void @pass_v2i32(<2 x i32>* noalias sret %{{.*}}, <2 x i32>*)
+// CHECK-LABEL: define void @pass_v2i32(<2 x i32>* noalias sret %{{.*}}, <2 x i32>* %0)
// CHECK-VECTOR-LABEL: define <2 x i32> @pass_v2i32(<2 x i32> %{{.*}})
v4i32 pass_v4i32(v4i32 arg) { return arg; }
-// CHECK-LABEL: define void @pass_v4i32(<4 x i32>* noalias sret %{{.*}}, <4 x i32>*)
+// CHECK-LABEL: define void @pass_v4i32(<4 x i32>* noalias sret %{{.*}}, <4 x i32>* %0)
// CHECK-VECTOR-LABEL: define <4 x i32> @pass_v4i32(<4 x i32> %{{.*}})
v1i64 pass_v1i64(v1i64 arg) { return arg; }
-// CHECK-LABEL: define void @pass_v1i64(<1 x i64>* noalias sret %{{.*}}, <1 x i64>*)
+// CHECK-LABEL: define void @pass_v1i64(<1 x i64>* noalias sret %{{.*}}, <1 x i64>* %0)
// CHECK-VECTOR-LABEL: define <1 x i64> @pass_v1i64(<1 x i64> %{{.*}})
v2i64 pass_v2i64(v2i64 arg) { return arg; }
-// CHECK-LABEL: define void @pass_v2i64(<2 x i64>* noalias sret %{{.*}}, <2 x i64>*)
+// CHECK-LABEL: define void @pass_v2i64(<2 x i64>* noalias sret %{{.*}}, <2 x i64>* %0)
// CHECK-VECTOR-LABEL: define <2 x i64> @pass_v2i64(<2 x i64> %{{.*}})
v1i128 pass_v1i128(v1i128 arg) { return arg; }
-// CHECK-LABEL: define void @pass_v1i128(<1 x i128>* noalias sret %{{.*}}, <1 x i128>*)
+// CHECK-LABEL: define void @pass_v1i128(<1 x i128>* noalias sret %{{.*}}, <1 x i128>* %0)
// CHECK-VECTOR-LABEL: define <1 x i128> @pass_v1i128(<1 x i128> %{{.*}})
v1f32 pass_v1f32(v1f32 arg) { return arg; }
-// CHECK-LABEL: define void @pass_v1f32(<1 x float>* noalias sret %{{.*}}, <1 x float>*)
+// CHECK-LABEL: define void @pass_v1f32(<1 x float>* noalias sret %{{.*}}, <1 x float>* %0)
// CHECK-VECTOR-LABEL: define <1 x float> @pass_v1f32(<1 x float> %{{.*}})
v2f32 pass_v2f32(v2f32 arg) { return arg; }
-// CHECK-LABEL: define void @pass_v2f32(<2 x float>* noalias sret %{{.*}}, <2 x float>*)
+// CHECK-LABEL: define void @pass_v2f32(<2 x float>* noalias sret %{{.*}}, <2 x float>* %0)
// CHECK-VECTOR-LABEL: define <2 x float> @pass_v2f32(<2 x float> %{{.*}})
v4f32 pass_v4f32(v4f32 arg) { return arg; }
-// CHECK-LABEL: define void @pass_v4f32(<4 x float>* noalias sret %{{.*}}, <4 x float>*)
+// CHECK-LABEL: define void @pass_v4f32(<4 x float>* noalias sret %{{.*}}, <4 x float>* %0)
// CHECK-VECTOR-LABEL: define <4 x float> @pass_v4f32(<4 x float> %{{.*}})
v1f64 pass_v1f64(v1f64 arg) { return arg; }
-// CHECK-LABEL: define void @pass_v1f64(<1 x double>* noalias sret %{{.*}}, <1 x double>*)
+// CHECK-LABEL: define void @pass_v1f64(<1 x double>* noalias sret %{{.*}}, <1 x double>* %0)
// CHECK-VECTOR-LABEL: define <1 x double> @pass_v1f64(<1 x double> %{{.*}})
v2f64 pass_v2f64(v2f64 arg) { return arg; }
-// CHECK-LABEL: define void @pass_v2f64(<2 x double>* noalias sret %{{.*}}, <2 x double>*)
+// CHECK-LABEL: define void @pass_v2f64(<2 x double>* noalias sret %{{.*}}, <2 x double>* %0)
// CHECK-VECTOR-LABEL: define <2 x double> @pass_v2f64(<2 x double> %{{.*}})
v1f128 pass_v1f128(v1f128 arg) { return arg; }
-// CHECK-LABEL: define void @pass_v1f128(<1 x fp128>* noalias sret %{{.*}}, <1 x fp128>*)
+// CHECK-LABEL: define void @pass_v1f128(<1 x fp128>* noalias sret %{{.*}}, <1 x fp128>* %0)
// CHECK-VECTOR-LABEL: define <1 x fp128> @pass_v1f128(<1 x fp128> %{{.*}})
diff --git a/src/llvm-project/clang/test/CodeGen/systemz-abi.c b/src/llvm-project/clang/test/CodeGen/systemz-abi.c
index b94cc83..3511983 100644
--- a/src/llvm-project/clang/test/CodeGen/systemz-abi.c
+++ b/src/llvm-project/clang/test/CodeGen/systemz-abi.c
@@ -10,6 +10,8 @@
// RUN: -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -triple s390x-linux-gnu -target-cpu arch12 \
// RUN: -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple s390x-linux-gnu -target-cpu z15 \
+// RUN: -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -triple s390x-linux-gnu -target-cpu arch13 \
// RUN: -emit-llvm -o - %s | FileCheck %s
@@ -31,7 +33,7 @@
// CHECK-LABEL: define i64 @pass_longlong(i64 %{{.*}})
__int128 pass_int128(__int128 arg) { return arg; }
-// CHECK-LABEL: define void @pass_int128(i128* noalias sret %{{.*}}, i128*)
+// CHECK-LABEL: define void @pass_int128(i128* noalias sret %{{.*}}, i128* %0)
float pass_float(float arg) { return arg; }
// CHECK-LABEL: define float @pass_float(float %{{.*}})
@@ -40,7 +42,7 @@
// CHECK-LABEL: define double @pass_double(double %{{.*}})
long double pass_longdouble(long double arg) { return arg; }
-// CHECK-LABEL: define void @pass_longdouble(fp128* noalias sret %{{.*}}, fp128*)
+// CHECK-LABEL: define void @pass_longdouble(fp128* noalias sret %{{.*}}, fp128* %0)
// Complex types
diff --git a/src/llvm-project/clang/test/CodeGen/systemz-inline-asm.c b/src/llvm-project/clang/test/CodeGen/systemz-inline-asm.c
index 7d5a6b2..7c273da 100644
--- a/src/llvm-project/clang/test/CodeGen/systemz-inline-asm.c
+++ b/src/llvm-project/clang/test/CodeGen/systemz-inline-asm.c
@@ -123,7 +123,7 @@
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* nocapture readonly, fp128* nocapture readonly)
+// CHECK: define void @test_f128(fp128* noalias nocapture sret [[DEST:%.*]], fp128* nocapture readonly %0, fp128* nocapture readonly %1)
// CHECK: %f = load fp128, fp128* %0
// CHECK: %g = load fp128, fp128* %1
// CHECK: [[RESULT:%.*]] = tail call fp128 asm "axbr $0, $2", "=f,0,f"(fp128 %f, fp128 %g)
diff --git a/src/llvm-project/clang/test/CodeGen/target-builtin-error.c b/src/llvm-project/clang/test/CodeGen/target-builtin-error.c
index ee41277..4e44b72 100644
--- a/src/llvm-project/clang/test/CodeGen/target-builtin-error.c
+++ b/src/llvm-project/clang/test/CodeGen/target-builtin-error.c
@@ -3,6 +3,6 @@
#include <x86intrin.h>
-__m128d foo(__m128d a, __m128d b) {
+__m128 foo(__m128 a, __m128 b) {
return __builtin_ia32_addsubps(b, a); // expected-error {{'__builtin_ia32_addsubps' needs target feature sse3}}
}
diff --git a/src/llvm-project/clang/test/CodeGen/target-builtin-noerror.c b/src/llvm-project/clang/test/CodeGen/target-builtin-noerror.c
index 364eae7..37e9b50 100644
--- a/src/llvm-project/clang/test/CodeGen/target-builtin-noerror.c
+++ b/src/llvm-project/clang/test/CodeGen/target-builtin-noerror.c
@@ -80,6 +80,7 @@
(void)__builtin_cpu_supports("vpclmulqdq");
(void)__builtin_cpu_supports("avx512vnni");
(void)__builtin_cpu_supports("avx512bitalg");
+ (void)__builtin_cpu_supports("avx512bf16");
}
void verifycpustrings() {
diff --git a/src/llvm-project/clang/test/CodeGen/target-data.c b/src/llvm-project/clang/test/CodeGen/target-data.c
index d9efe9f..1e2e757 100644
--- a/src/llvm-project/clang/test/CodeGen/target-data.c
+++ b/src/llvm-project/clang/test/CodeGen/target-data.c
@@ -1,22 +1,22 @@
// RUN: %clang_cc1 -triple i686-unknown-unknown -emit-llvm -o - %s | \
// RUN: FileCheck --check-prefix=I686-UNKNOWN %s
-// I686-UNKNOWN: target datalayout = "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128"
+// I686-UNKNOWN: target datalayout = "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-f64:32:64-f80:32-n8:16:32-S128"
// RUN: %clang_cc1 -triple i686-apple-darwin9 -emit-llvm -o - %s | \
// RUN: FileCheck --check-prefix=I686-DARWIN %s
-// I686-DARWIN: target datalayout = "e-m:o-p:32:32-f64:32:64-f80:128-n8:16:32-S128"
+// I686-DARWIN: target datalayout = "e-m:o-p:32:32-p270:32:32-p271:32:32-p272:64:64-f64:32:64-f80:128-n8:16:32-S128"
// RUN: %clang_cc1 -triple i686-unknown-win32 -emit-llvm -o - %s | \
// RUN: FileCheck --check-prefix=I686-WIN32 %s
-// I686-WIN32: target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
+// I686-WIN32: target datalayout = "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:32-n8:16:32-a:0:32-S32"
// RUN: %clang_cc1 -triple i686-unknown-cygwin -emit-llvm -o - %s | \
// RUN: FileCheck --check-prefix=I686-CYGWIN %s
-// I686-CYGWIN: target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
+// I686-CYGWIN: target datalayout = "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:32-n8:16:32-a:0:32-S32"
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s | \
// RUN: FileCheck --check-prefix=X86_64 %s
-// X86_64: target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+// X86_64: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
// RUN: %clang_cc1 -triple xcore-unknown-unknown -emit-llvm -o - %s | \
// RUN: FileCheck --check-prefix=XCORE %s
@@ -88,11 +88,11 @@
// RUN: %clang_cc1 -triple i686-nacl -o - -emit-llvm %s | \
// RUN: FileCheck %s -check-prefix=I686-NACL
-// I686-NACL: target datalayout = "e-m:e-p:32:32-i64:64-n8:16:32-S128"
+// I686-NACL: target datalayout = "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-n8:16:32-S128"
// RUN: %clang_cc1 -triple x86_64-nacl -o - -emit-llvm %s | \
// RUN: FileCheck %s -check-prefix=X86_64-NACL
-// X86_64-NACL: target datalayout = "e-m:e-p:32:32-i64:64-n8:16:32:64-S128"
+// X86_64-NACL: target datalayout = "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-n8:16:32:64-S128"
// RUN: %clang_cc1 -triple arm-nacl -o - -emit-llvm %s | \
// RUN: FileCheck %s -check-prefix=ARM-NACL
@@ -163,6 +163,10 @@
// RUN: FileCheck %s -check-prefix=AARCH64
// AARCH64: target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
+// RUN: %clang_cc1 -triple arm64_32-apple-ios7.0 -o - -emit-llvm %s | \
+// RUN: FileCheck %s -check-prefix=AARCH64-ILP32
+// AARCH64-ILP32: target datalayout = "e-m:o-p:32:32-i64:64-i128:128-n32:64-S128"
+
// RUN: %clang_cc1 -triple thumb-unknown-gnueabi -o - -emit-llvm %s | \
// RUN: FileCheck %s -check-prefix=THUMB
// THUMB: target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64"
@@ -199,6 +203,8 @@
// RUN: FileCheck %s -check-prefix=SYSTEMZ-VECTOR
// RUN: %clang_cc1 -triple s390x-unknown -target-cpu arch12 -o - -emit-llvm %s | \
// RUN: FileCheck %s -check-prefix=SYSTEMZ-VECTOR
+// RUN: %clang_cc1 -triple s390x-unknown -target-cpu z15 -o - -emit-llvm %s | \
+// RUN: FileCheck %s -check-prefix=SYSTEMZ-VECTOR
// RUN: %clang_cc1 -triple s390x-unknown -target-cpu arch13 -o - -emit-llvm %s | \
// RUN: FileCheck %s -check-prefix=SYSTEMZ-VECTOR
// SYSTEMZ-VECTOR: target datalayout = "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-v128:64-a:8:16-n32:64"
diff --git a/src/llvm-project/clang/test/CodeGen/tbaa-struct.cpp b/src/llvm-project/clang/test/CodeGen/tbaa-struct.cpp
index 670584e..0c0e4b4 100644
--- a/src/llvm-project/clang/test/CodeGen/tbaa-struct.cpp
+++ b/src/llvm-project/clang/test/CodeGen/tbaa-struct.cpp
@@ -17,7 +17,7 @@
void copy(A *a1, A *a2) {
// CHECK-LABEL: _Z4copyP1AS0_
-// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %{{.*}}, i8* align 4 %{{.*}}, i64 16, i1 false)
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 4 dereferenceable(16) %{{.*}}, i8* nonnull align 4 dereferenceable(16) %{{.*}}, i64 16, i1 false)
// CHECK-OLD-SAME: !tbaa.struct [[TS:!.*]]
// CHECK-NEW-SAME: !tbaa [[TAG_A:![0-9]*]]
*a1 = *a2;
@@ -31,7 +31,7 @@
void copy2(B *b1, B *b2) {
// CHECK-LABEL: _Z5copy2P1BS0_
-// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %{{.*}}, i8* align 4 %{{.*}}, i64 24, i1 false)
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 4 dereferenceable(24) %{{.*}}, i8* nonnull align 4 dereferenceable(24) %{{.*}}, i64 24, i1 false)
// CHECK-OLD-SAME: !tbaa.struct [[TS2:!.*]]
// CHECK-NEW-SAME: !tbaa [[TAG_B:![0-9]*]]
*b1 = *b2;
@@ -49,7 +49,7 @@
void copy3(U *u1, U *u2) {
// CHECK-LABEL: _Z5copy3P1US0_
-// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %{{.*}}, i8* align 4 %{{.*}}, i64 12, i1 false)
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 4 dereferenceable(12) %{{.*}}, i8* nonnull align 4 dereferenceable(12) %{{.*}}, i64 12, i1 false)
// CHECK-OLD-SAME: !tbaa.struct [[TS3:!.*]]
// CHECK-NEW-SAME: !tbaa [[TAG_U:![0-9]*]]
*u1 = *u2;
@@ -65,7 +65,7 @@
void copy4(C *c1, C *c2) {
// CHECK-LABEL: _Z5copy4P1CS0_
-// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* {{.*}}, i8* {{.*}}, i64 3, i1 false)
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 1 dereferenceable(3) {{.*}}, i8* nonnull align 1 dereferenceable(3) {{.*}}, i64 3, i1 false)
// CHECK-OLD-SAME: !tbaa.struct [[TS4:!.*]]
// CHECK-NEW-SAME: !tbaa [[TAG_C:![0-9]*]]
*c1 = *c2;
@@ -80,7 +80,7 @@
void copy5(D *d1, D *d2) {
// CHECK-LABEL: _Z5copy5P1DS0_
-// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* {{.*}}, i8* {{.*}}, i64 6, i1 false)
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 1 dereferenceable(6) {{.*}}, i8* nonnull align 1 dereferenceable(6) {{.*}}, i64 6, i1 false)
// CHECK-OLD-SAME: !tbaa.struct [[TS5:!.*]]
// CHECK-NEW-SAME: !tbaa [[TAG_D:![0-9]*]]
*d1 = *d2;
@@ -88,7 +88,7 @@
void copy6(AA *a1, A *a2) {
// CHECK-LABEL: _Z5copy6P1AS0_
-// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %{{.*}}, i8* align 4 %{{.*}}, i64 16, i1 false)
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 4 dereferenceable(16) %{{.*}}, i8* nonnull align 4 dereferenceable(16) %{{.*}}, i64 16, i1 false)
// CHECK-OLD-SAME: !tbaa.struct [[TS]]
// CHECK-NEW-SAME: !tbaa [[TAG_char:![0-9]*]]
*a1 = *a2;
@@ -96,7 +96,7 @@
void copy7(A *a1, AA *a2) {
// CHECK-LABEL: _Z5copy7P1AS0_
-// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %{{.*}}, i8* align 4 %{{.*}}, i64 16, i1 false)
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 4 dereferenceable(16) %{{.*}}, i8* nonnull align 4 dereferenceable(16) %{{.*}}, i64 16, i1 false)
// CHECK-OLD-SAME: !tbaa.struct [[TS]]
// CHECK-NEW-SAME: !tbaa [[TAG_char]]
*a1 = *a2;
diff --git a/src/llvm-project/clang/test/CodeGen/thin_link_bitcode.c b/src/llvm-project/clang/test/CodeGen/thin_link_bitcode.c
index 52c5715..052af9f 100644
--- a/src/llvm-project/clang/test/CodeGen/thin_link_bitcode.c
+++ b/src/llvm-project/clang/test/CodeGen/thin_link_bitcode.c
@@ -1,5 +1,7 @@
// REQUIRES: x86-registered-target
//
+// RUN: %clang -flto=thin -fthin-link-bitcode=%t.bc -target x86_64-unknown-linux-gnu -### %s 2>&1 | FileCheck %s --check-prefix=LINKBC
+//
// RUN: %clang_cc1 -o %t -flto=thin -fthin-link-bitcode=%t.nodebug -triple x86_64-unknown-linux-gnu -emit-llvm-bc -debug-info-kind=limited %s
// RUN: llvm-bcanalyzer -dump %t | FileCheck %s
// RUN: llvm-bcanalyzer -dump %t.nodebug | FileCheck %s --check-prefix=NO_DEBUG
@@ -10,5 +12,7 @@
return 0;
}
+// LINKBC: -fthin-link-bitcode=
+
// CHECK: COMPILE_UNIT
// NO_DEBUG-NOT: COMPILE_UNIT
diff --git a/src/llvm-project/clang/test/CodeGen/thinlto-clang-diagnostic-handler-in-be.c b/src/llvm-project/clang/test/CodeGen/thinlto-clang-diagnostic-handler-in-be.c
new file mode 100644
index 0000000..389d244
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/thinlto-clang-diagnostic-handler-in-be.c
@@ -0,0 +1,24 @@
+// Test clang diagnositic handler works in IR file compilation.
+
+// REQUIRES: x86-registered-target
+
+// RUN: llvm-profdata merge -o %t1.profdata %S/Inputs/thinlto_expect1.proftext
+// RUN: %clang -O2 -fexperimental-new-pass-manager -flto=thin -g -fprofile-use=%t1.profdata -c -o %t1.bo %s
+// RUN: llvm-lto -thinlto -o %t %t1.bo
+// RUN: %clang -cc1 -O2 -fexperimental-new-pass-manager -x ir %t1.bo -fthinlto-index=%t.thinlto.bc -emit-obj -Rpass-analysis=info 2>&1 | FileCheck %s -check-prefix=CHECK-REMARK
+// RUN: llvm-profdata merge -o %t2.profdata %S/Inputs/thinlto_expect2.proftext
+// RUN: %clang -cc1 -O2 -fexperimental-new-pass-manager -x ir %t1.bo -fthinlto-index=%t.thinlto.bc -fprofile-instrument-use-path=%t2.profdata -emit-obj -Wmisexpect 2>&1 | FileCheck %s -check-prefix=CHECK-WARNING
+// RUN: %clang -cc1 -O2 -fexperimental-new-pass-manager -x ir %t1.bo -fthinlto-index=%t.thinlto.bc -fprofile-instrument-use-path=%t2.profdata -emit-obj 2>&1 | FileCheck %s -allow-empty -check-prefix=CHECK-NOWARNING
+
+int sum;
+__attribute__((noinline)) void bar() {
+ sum = 1234;
+}
+
+__attribute__((noinline)) void foo(int m) {
+ if (__builtin_expect(m > 9, 1))
+ bar();
+}
+// CHECK-REMARK: remark: {{.*}}.c:
+// CHECK-WARNING: warning: Potential performance regression from use of __builtin_expect(): Annotation was correct on {{.*}}.c:{{[0-9]*}}:{{[0-9]*}}: 50.00% (12 / 24) of profiled executions.
+// CHECK-NOWARNING-NOT: warning: {{.*}}.c:{{[0-9]*}}:26: 50.00% (12 / 24)
diff --git a/src/llvm-project/clang/test/CodeGen/thinlto-diagnostic-handler-remarks-with-hotness.ll b/src/llvm-project/clang/test/CodeGen/thinlto-diagnostic-handler-remarks-with-hotness.ll
index 2d25930..50332037 100644
--- a/src/llvm-project/clang/test/CodeGen/thinlto-diagnostic-handler-remarks-with-hotness.ll
+++ b/src/llvm-project/clang/test/CodeGen/thinlto-diagnostic-handler-remarks-with-hotness.ll
@@ -28,11 +28,11 @@
; YAML-NEXT: ...
; Next try with pass remarks to stderr
-; RUN: %clang -target x86_64-scei-ps4 -O2 -x ir %t.o -fthinlto-index=%t.thinlto.bc -mllvm -pass-remarks=inline -fdiagnostics-show-hotness -o %t2.o -c 2>&1 | FileCheck %s
+; RUN: %clang -target x86_64-scei-ps4 -O2 -x ir %t.o -fthinlto-index=%t.thinlto.bc -Rpass=inline -fdiagnostics-show-hotness -o %t2.o -c 2>&1 | FileCheck %s
; CHECK: tinkywinky inlined into main with (cost=0, threshold=337) (hotness: 300)
-target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-scei-ps4"
declare i32 @patatino()
diff --git a/src/llvm-project/clang/test/CodeGen/thinlto-distributed-backend-skip.ll b/src/llvm-project/clang/test/CodeGen/thinlto-distributed-backend-skip.ll
index d9fa47d..d7b8225 100644
--- a/src/llvm-project/clang/test/CodeGen/thinlto-distributed-backend-skip.ll
+++ b/src/llvm-project/clang/test/CodeGen/thinlto-distributed-backend-skip.ll
@@ -9,7 +9,7 @@
; RUN: -fthinlto-index=%S/Inputs/thinlto-distributed-backend-skip.bc \
; RUN: -emit-llvm -o - -x ir %t.o | FileCheck %s
-target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-grtev4-linux-gnu"
; CHECK: "empty"
diff --git a/src/llvm-project/clang/test/CodeGen/thinlto-distributed-cfi-devirt.ll b/src/llvm-project/clang/test/CodeGen/thinlto-distributed-cfi-devirt.ll
index d69b77b..2920cf1 100644
--- a/src/llvm-project/clang/test/CodeGen/thinlto-distributed-cfi-devirt.ll
+++ b/src/llvm-project/clang/test/CodeGen/thinlto-distributed-cfi-devirt.ll
@@ -47,7 +47,7 @@
; RUN: -emit-obj -fthinlto-index=%t.o.thinlto.bc -O2 \
; RUN: -o %t.native.o -x ir %t.o
-target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-grtev4-linux-gnu"
%struct.A = type { i32 (...)** }
diff --git a/src/llvm-project/clang/test/CodeGen/thinlto-distributed-cfi.ll b/src/llvm-project/clang/test/CodeGen/thinlto-distributed-cfi.ll
index ccd5c24..65808fd 100644
--- a/src/llvm-project/clang/test/CodeGen/thinlto-distributed-cfi.ll
+++ b/src/llvm-project/clang/test/CodeGen/thinlto-distributed-cfi.ll
@@ -36,7 +36,7 @@
; RUN: -emit-obj -fthinlto-index=%t.o.thinlto.bc \
; RUN: -o %t.native.o -x ir %t.o
-target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-grtev4-linux-gnu"
%struct.B = type { %struct.A }
diff --git a/src/llvm-project/clang/test/CodeGen/thinlto-distributed.ll b/src/llvm-project/clang/test/CodeGen/thinlto-distributed.ll
index ae21d7b..a578aae 100644
--- a/src/llvm-project/clang/test/CodeGen/thinlto-distributed.ll
+++ b/src/llvm-project/clang/test/CodeGen/thinlto-distributed.ll
@@ -12,7 +12,7 @@
; RUN: -emit-obj -fthinlto-index=%t.o.thinlto.bc \
; RUN: -o %t.native.o -x ir %t.o
-target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-grtev4-linux-gnu"
define i32 @main() {
diff --git a/src/llvm-project/clang/test/CodeGen/thinlto-multi-module.ll b/src/llvm-project/clang/test/CodeGen/thinlto-multi-module.ll
index 385d98c..186b34d 100644
--- a/src/llvm-project/clang/test/CodeGen/thinlto-multi-module.ll
+++ b/src/llvm-project/clang/test/CodeGen/thinlto-multi-module.ll
@@ -11,7 +11,7 @@
; CHECK-OBJ: T f1
; CHECK-OBJ: U f2
-target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
declare void @f2()
diff --git a/src/llvm-project/clang/test/CodeGen/thinlto-slp-vectorize-pm.c b/src/llvm-project/clang/test/CodeGen/thinlto-slp-vectorize-pm.c
new file mode 100644
index 0000000..4700da6
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/thinlto-slp-vectorize-pm.c
@@ -0,0 +1,50 @@
+// REQUIRES: x86-registered-target
+// RUN: %clang_cc1 -o %t.o -flto=thin -fexperimental-new-pass-manager -triple x86_64-unknown-linux-gnu -emit-llvm-bc %s
+// RUN: llvm-lto -thinlto -o %t %t.o
+
+// Test to ensure the slp vectorize codegen option is passed down to the
+// ThinLTO backend. -vectorize-slp is a cc1 option and will be added
+// automatically when O2/O3/Os/Oz is available for clang. Once -vectorize-slp
+// is enabled, "-mllvm -vectorize-slp=false" won't disable slp vectorization
+// currently. "-mllvm -vectorize-slp=false" is added here in the test to
+// ensure the slp vectorization is executed because the -vectorize-slp cc1
+// flag is passed down, not because "-mllvm -vectorize-slp" is enabled
+// by default.
+//
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-obj -O2 -vectorize-slp -mllvm -vectorize-slp=false -o %t2.o -x ir %t.o -fthinlto-index=%t.thinlto.bc -fdebug-pass-manager -fexperimental-new-pass-manager 2>&1 | FileCheck %s --check-prefix=O2-SLP
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-obj -O0 -vectorize-slp -mllvm -vectorize-slp=false -o %t2.o -x ir %t.o -fthinlto-index=%t.thinlto.bc -fdebug-pass-manager -fexperimental-new-pass-manager 2>&1 | FileCheck %s --check-prefix=O0-SLP
+// O2-SLP: Running pass: SLPVectorizerPass
+// O0-SLP-NOT: Running pass: SLPVectorizerPass
+
+// Test to ensure the loop vectorize codegen option is passed down to the
+// ThinLTO backend. -vectorize-loops is a cc1 option and will be added
+// automatically when O2/O3/Os is available for clang. Once -vectorize-loops is
+// enabled, "-mllvm -vectorize-loops=false" won't disable loop vectorization
+// currently. "-mllvm -vectorize-loops=false" is added here in the test to
+// ensure the loop vectorization is executed because the -vectorize-loops cc1
+// flag is passed down, not because "-mllvm -vectorize-loops" is enabled
+// by default.
+//
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-obj -O2 -vectorize-loops -mllvm -vectorize-loops=false -mllvm -force-vector-width=2 -mllvm -force-vector-interleave=1 -emit-llvm -o - -x ir %t.o -fthinlto-index=%t.thinlto.bc -fexperimental-new-pass-manager 2>&1 | FileCheck %s --check-prefix=O2-LPV
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-obj -O0 -vectorize-loops -mllvm -vectorize-loops=false -mllvm -force-vector-width=2 -mllvm -force-vector-interleave=1 -emit-llvm -o - -x ir %t.o -fthinlto-index=%t.thinlto.bc -fexperimental-new-pass-manager 2>&1 | FileCheck %s --check-prefix=O0-LPV
+// O2-LPV: = !{!"llvm.loop.isvectorized", i32 1}
+// O0-LPV-NOT: = !{!"llvm.loop.isvectorized", i32 1}
+
+// Test to ensure the loop interleave codegen option is passed down to the
+// ThinLTO backend. The internal loop interleave codegen option will be
+// enabled automatically when O2/O3 is available for clang. Once the loop
+// interleave option is enabled, "-mllvm -interleave-loops=false" won't disable
+// the interleave. currently. "-mllvm -interleave-loops=false" is added here
+// in the test to ensure the loop interleave is executed because the interleave
+// codegen flag is passed down, not because "-mllvm -interleave-loops" is
+// enabled by default.
+//
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-obj -O2 -vectorize-loops -mllvm -interleave-loops=false -mllvm -force-vector-width=1 -mllvm -force-vector-interleave=2 -emit-llvm -o - -x ir %t.o -fthinlto-index=%t.thinlto.bc -fexperimental-new-pass-manager 2>&1 | FileCheck %s --check-prefix=O2-InterLeave
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-obj -O0 -vectorize-loops -mllvm -interleave-loops=false -mllvm -force-vector-width=1 -mllvm -force-vector-interleave=2 -emit-llvm -o - -x ir %t.o -fthinlto-index=%t.thinlto.bc -fexperimental-new-pass-manager 2>&1 | FileCheck %s --check-prefix=O0-InterLeave
+// O2-InterLeave: = !{!"llvm.loop.isvectorized", i32 1}
+// O0-InterLeave-NOT: = !{!"llvm.loop.isvectorized", i32 1}
+
+void foo(double *a) {
+ for (int i = 0; i < 1000; i++)
+ a[i] = 10;
+}
diff --git a/src/llvm-project/clang/test/CodeGen/thinlto-split-dwarf.c b/src/llvm-project/clang/test/CodeGen/thinlto-split-dwarf.c
index 60649b0..419bd13 100644
--- a/src/llvm-project/clang/test/CodeGen/thinlto-split-dwarf.c
+++ b/src/llvm-project/clang/test/CodeGen/thinlto-split-dwarf.c
@@ -13,11 +13,31 @@
// RUN: -o %t.native.o -split-dwarf-file %t.file.dwo \
// RUN: -split-dwarf-output %t.output.dwo -x ir %t.o
-// RUN: llvm-dwarfdump %t.native.o | FileCheck --check-prefix=O %s
-// RUN: llvm-dwarfdump %t.output.dwo | FileCheck --check-prefix=DWO %s
+// RUN: llvm-dwarfdump %t.native.o | FileCheck --check-prefix=DWARFv4-O %s
+// RUN: llvm-dwarfdump %t.output.dwo | FileCheck --check-prefix=DWARFv4-DWO %s
-// O: DW_AT_GNU_dwo_name ("{{.*}}.file.dwo")
-// O-NOT: DW_TAG_subprogram
-// DWO: DW_TAG_subprogram
+// DWARFv4-O: DW_AT_GNU_dwo_name ("{{.*}}.file.dwo")
+// DWARFv4-O-NOT: DW_TAG_subprogram
+// DWARFv4-DWO: DW_TAG_subprogram
+
+// RUN: %clang_cc1 -debug-info-kind=limited -dwarf-version=5 -triple x86_64-unknown-linux-gnu \
+// RUN: -flto=thin -emit-llvm-bc \
+// RUN: -o %t.o %s
+
+// RUN: llvm-lto2 run -thinlto-distributed-indexes %t.o \
+// RUN: -o %t2.index \
+// RUN: -r=%t.o,main,px
+
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu \
+// RUN: -emit-obj -fthinlto-index=%t.o.thinlto.bc \
+// RUN: -o %t.native.o -dwarf-version=5 -split-dwarf-file %t.file.dwo \
+// RUN: -split-dwarf-output %t.output.dwo -x ir %t.o
+
+// RUN: llvm-dwarfdump %t.native.o | FileCheck --check-prefix=DWARFv5-O %s
+// RUN: llvm-dwarfdump %t.output.dwo | FileCheck --check-prefix=DWARFv5-DWO %s
+
+// DWARFv5-O: DW_AT_dwo_name ("{{.*}}.file.dwo")
+// DWARFv5-O-NOT: DW_TAG_subprogram
+// DWARFv5-DWO: DW_TAG_subprogram
int main() {}
diff --git a/src/llvm-project/clang/test/CodeGen/thinlto_backend.ll b/src/llvm-project/clang/test/CodeGen/thinlto_backend.ll
index 2dd919d..6a18a94 100644
--- a/src/llvm-project/clang/test/CodeGen/thinlto_backend.ll
+++ b/src/llvm-project/clang/test/CodeGen/thinlto_backend.ll
@@ -1,5 +1,4 @@
-; shell required since the windows bot does not like the "(cd ..."
-; REQUIRES: x86-registered-target, shell
+; REQUIRES: x86-registered-target
; RUN: opt -module-summary -o %t1.o %s
; RUN: opt -module-summary -o %t2.o %S/Inputs/thinlto_backend.ll
@@ -32,10 +31,14 @@
; RUN: %clang -target x86_64-unknown-linux-gnu -O2 -o %t3.o -x ir %t1.o -c -fthinlto-index=%t.thinlto.bc -save-temps=obj
; RUN: llvm-dis %t1.s.3.import.bc -o - | FileCheck --check-prefix=CHECK-IMPORT %s
; RUN: mkdir -p %T/dir1
-; RUN: (cd %T/dir1 && %clang -target x86_64-unknown-linux-gnu -O2 -o %t3.o -x ir %t1.o -c -fthinlto-index=%t.thinlto.bc -save-temps=cwd)
+; RUN: cd %T/dir1
+; RUN: %clang -target x86_64-unknown-linux-gnu -O2 -o %t3.o -x ir %t1.o -c -fthinlto-index=%t.thinlto.bc -save-temps=cwd
+; RUN: cd ../..
; RUN: llvm-dis %T/dir1/*1.s.3.import.bc -o - | FileCheck --check-prefix=CHECK-IMPORT %s
; RUN: mkdir -p %T/dir2
-; RUN: (cd %T/dir2 && %clang -target x86_64-unknown-linux-gnu -O2 -o %t3.o -x ir %t1.o -c -fthinlto-index=%t.thinlto.bc -save-temps)
+; RUN: cd %T/dir2
+; RUN: %clang -target x86_64-unknown-linux-gnu -O2 -o %t3.o -x ir %t1.o -c -fthinlto-index=%t.thinlto.bc -save-temps
+; RUN: cd ../..
; RUN: llvm-dis %T/dir2/*1.s.3.import.bc -o - | FileCheck --check-prefix=CHECK-IMPORT %s
; CHECK-IMPORT: define available_externally void @f2()
; RUN: llvm-nm %t3.o | FileCheck --check-prefix=CHECK-OBJ %s
@@ -47,7 +50,7 @@
; RUN: %clang -target x86_64-unknown-linux-gnu -O2 -o %t3.o -x ir %t1.o -c -fthinlto-index=%t.thinlto.bc 2>&1 | FileCheck %s -check-prefix=CHECK-ERROR2
; CHECK-ERROR2: Error loading imported file '{{.*}}': Could not find module summary
-target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
declare void @f2()
diff --git a/src/llvm-project/clang/test/CodeGen/thinlto_backend_local_name_conflict.ll b/src/llvm-project/clang/test/CodeGen/thinlto_backend_local_name_conflict.ll
index cefbc51..2e3fe9b 100644
--- a/src/llvm-project/clang/test/CodeGen/thinlto_backend_local_name_conflict.ll
+++ b/src/llvm-project/clang/test/CodeGen/thinlto_backend_local_name_conflict.ll
@@ -21,7 +21,7 @@
; ModuleID = 'local_name_conflict_var_main.o'
source_filename = "local_name_conflict_var_main.c"
-target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
; Function Attrs: noinline nounwind uwtable
diff --git a/src/llvm-project/clang/test/CodeGen/ubsan-blacklist-vfs.c b/src/llvm-project/clang/test/CodeGen/ubsan-blacklist-vfs.c
new file mode 100644
index 0000000..0647cbf
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/ubsan-blacklist-vfs.c
@@ -0,0 +1,36 @@
+// Verify ubsan doesn't emit checks for blacklisted functions and files
+// RUN: echo "fun:hash" > %t-func.blacklist
+// RUN: echo "src:%s" | sed -e 's/\\/\\\\/g' > %t-file.blacklist
+
+// RUN: rm -f %t-vfsoverlay.yaml
+// RUN: rm -f %t-nonexistent.blacklist
+// RUN: sed -e "s|@DIR@|%/T|g" %S/Inputs/sanitizer-blacklist-vfsoverlay.yaml | sed -e "s|@REAL_FILE@|%/t-func.blacklist|g" | sed -e "s|@NONEXISTENT_FILE@|%/t-nonexistent.blacklist|g" > %t-vfsoverlay.yaml
+// RUN: %clang_cc1 -fsanitize=unsigned-integer-overflow -ivfsoverlay %t-vfsoverlay.yaml -fsanitize-blacklist=%/T/only-virtual-file.blacklist -emit-llvm %s -o - | FileCheck %s --check-prefix=FUNC
+
+// RUN: not %clang_cc1 -fsanitize=unsigned-integer-overflow -ivfsoverlay %t-vfsoverlay.yaml -fsanitize-blacklist=%/T/invalid-virtual-file.blacklist -emit-llvm %s -o - 2>&1 | FileCheck %s --check-prefix=INVALID-MAPPED-FILE
+// INVALID-MAPPED-FILE: invalid-virtual-file.blacklist': {{[Nn]}}o such file or directory
+
+// RUN: not %clang_cc1 -fsanitize=unsigned-integer-overflow -ivfsoverlay %t-vfsoverlay.yaml -fsanitize-blacklist=%t-nonexistent.blacklist -emit-llvm %s -o - 2>&1 | FileCheck %s --check-prefix=INVALID
+// INVALID: nonexistent.blacklist': {{[Nn]}}o such file or directory
+
+unsigned i;
+
+// DEFAULT: @hash
+// FUNC: @hash
+// FILE: @hash
+unsigned hash() {
+// DEFAULT: call {{.*}}void @__ubsan
+// FUNC-NOT: call {{.*}}void @__ubsan
+// FILE-NOT: call {{.*}}void @__ubsan
+ return i * 37;
+}
+
+// DEFAULT: @add
+// FUNC: @add
+// FILE: @add
+unsigned add() {
+// DEFAULT: call {{.*}}void @__ubsan
+// FUNC: call {{.*}}void @__ubsan
+// FILE-NOT: call {{.*}}void @__ubsan
+ return i + 1;
+}
diff --git a/src/llvm-project/clang/test/CodeGen/ubsan-pointer-overflow.c b/src/llvm-project/clang/test/CodeGen/ubsan-pointer-overflow.c
new file mode 100644
index 0000000..7934442
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/ubsan-pointer-overflow.c
@@ -0,0 +1,123 @@
+// RUN: %clang_cc1 -x c -triple x86_64-apple-darwin10 -w -emit-llvm -o - %s -fsanitize=pointer-overflow | FileCheck %s --check-prefixes=CHECK,CHECK-C
+// RUN: %clang_cc1 -x c++ -triple x86_64-apple-darwin10 -w -emit-llvm -o - %s -fsanitize=pointer-overflow | FileCheck %s --check-prefixes=CHECK,CHECK-CPP
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// CHECK-LABEL: define void @fixed_len_array
+void fixed_len_array(int k) {
+ // CHECK: getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* [[ARR:%.*]], i64 0, i64 [[IDXPROM:%.*]]
+ // CHECK-NEXT: [[SMUL:%.*]] = call { i64, i1 } @llvm.smul.with.overflow.i64(i64 40, i64 [[IDXPROM]]), !nosanitize
+ // CHECK-NEXT: [[SMULOFLOW:%.*]] = extractvalue { i64, i1 } [[SMUL]], 1, !nosanitize
+ // CHECK-NEXT: [[SMULVAL:%.*]] = extractvalue { i64, i1 } [[SMUL]], 0, !nosanitize
+ // CHECK-NEXT: [[BASE:%.*]] = ptrtoint [10 x [10 x i32]]* [[ARR]] to i64, !nosanitize
+ // CHECK-NEXT: [[COMPGEP:%.*]] = add i64 [[BASE]], [[SMULVAL]], !nosanitize
+ // CHECK: call void @__ubsan_handle_pointer_overflow{{.*}}, i64 [[BASE]], i64 [[COMPGEP]]){{.*}}, !nosanitize
+
+ // CHECK: getelementptr inbounds [10 x i32], [10 x i32]* {{.*}}, i64 0, i64 [[IDXPROM1:%.*]]
+ // CHECK-NEXT: @llvm.smul.with.overflow.i64(i64 4, i64 [[IDXPROM1]]), !nosanitize
+ // CHECK: call void @__ubsan_handle_pointer_overflow{{.*}}
+
+ int arr[10][10];
+ arr[k][k];
+}
+
+// CHECK-LABEL: define void @variable_len_array
+void variable_len_array(int n, int k) {
+ // CHECK: getelementptr inbounds i32, i32* {{.*}}, i64 [[IDXPROM:%.*]]
+ // CHECK-NEXT: @llvm.smul.with.overflow.i64(i64 4, i64 [[IDXPROM]]), !nosanitize
+ // CHECK: call void @__ubsan_handle_pointer_overflow{{.*}}
+
+ // CHECK: getelementptr inbounds i32, i32* {{.*}}, i64 [[IDXPROM1:%.*]]
+ // CHECK-NEXT: @llvm.smul.with.overflow.i64(i64 4, i64 [[IDXPROM1]]), !nosanitize
+ // CHECK: call void @__ubsan_handle_pointer_overflow{{.*}}
+
+ int arr[n][n];
+ arr[k][k];
+}
+
+// CHECK-LABEL: define void @pointer_array
+void pointer_array(int **arr, int k) {
+ // CHECK: @llvm.smul.with.overflow.i64(i64 8, i64 {{.*}}), !nosanitize
+ // CHECK: call void @__ubsan_handle_pointer_overflow{{.*}}
+
+ // CHECK: @llvm.smul.with.overflow.i64(i64 4, i64 {{.*}}), !nosanitize
+ // CHECK: call void @__ubsan_handle_pointer_overflow{{.*}}
+
+ arr[k][k];
+}
+
+// CHECK-LABEL: define void @pointer_array_unsigned_indices
+void pointer_array_unsigned_indices(int **arr, unsigned k) {
+ // CHECK: icmp uge
+ // CHECK-NOT: select
+ // CHECK: call void @__ubsan_handle_pointer_overflow{{.*}}
+ // CHECK: icmp uge
+ // CHECK-NOT: select
+ // CHECK: call void @__ubsan_handle_pointer_overflow{{.*}}
+ arr[k][k];
+}
+
+// CHECK-LABEL: define void @pointer_array_mixed_indices
+void pointer_array_mixed_indices(int **arr, int i, unsigned j) {
+ // CHECK: select
+ // CHECK: call void @__ubsan_handle_pointer_overflow{{.*}}
+ // CHECK-NOT: select
+ // CHECK: call void @__ubsan_handle_pointer_overflow{{.*}}
+ arr[i][j];
+}
+
+struct S1 {
+ int pad1;
+ union {
+ char leaf;
+ struct S1 *link;
+ } u;
+ struct S1 *arr;
+};
+
+// TODO: Currently, structure GEPs are not checked, so there are several
+// potentially unsafe GEPs here which we don't instrument.
+//
+// CHECK-LABEL: define void @struct_index
+void struct_index(struct S1 *p) {
+ // CHECK: getelementptr inbounds %struct.S1, %struct.S1* [[P:%.*]], i64 10
+ // CHECK-NEXT: [[BASE:%.*]] = ptrtoint %struct.S1* [[P]] to i64, !nosanitize
+ // CHECK-NEXT: [[COMPGEP:%.*]] = add i64 [[BASE]], 240, !nosanitize
+ // CHECK: select
+ // CHECK: @__ubsan_handle_pointer_overflow{{.*}} i64 [[BASE]], i64 [[COMPGEP]]) {{.*}}, !nosanitize
+
+ // CHECK-NOT: @__ubsan_handle_pointer_overflow
+
+ p->arr[10].u.link->u.leaf;
+}
+
+typedef void (*funcptr_t)(void);
+
+// CHECK-LABEL: define void @function_pointer_arith
+void function_pointer_arith(funcptr_t *p, int k) {
+ // CHECK: add i64 {{.*}}, 8, !nosanitize
+ // CHECK-NOT: select
+ // CHECK: @__ubsan_handle_pointer_overflow{{.*}}
+ ++p;
+
+ // CHECK: @llvm.smul.with.overflow.i64(i64 8, i64 {{.*}}), !nosanitize
+ // CHECK: select
+ // CHECK: call void @__ubsan_handle_pointer_overflow{{.*}}
+ p + k;
+}
+
+// CHECK-LABEL: define void @dont_emit_checks_for_no_op_GEPs
+// CHECK-C: __ubsan_handle_pointer_overflow
+// CHECK-CPP-NOT: __ubsan_handle_pointer_overflow
+void dont_emit_checks_for_no_op_GEPs(char *p) {
+ &p[0];
+
+ int arr[10][10];
+ &arr[0][0];
+}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/src/llvm-project/clang/test/CodeGen/ubsan-pointer-overflow.m b/src/llvm-project/clang/test/CodeGen/ubsan-pointer-overflow.m
index 977e245..d48e225 100644
--- a/src/llvm-project/clang/test/CodeGen/ubsan-pointer-overflow.m
+++ b/src/llvm-project/clang/test/CodeGen/ubsan-pointer-overflow.m
@@ -1,189 +1,5 @@
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -w -emit-llvm -o - %s -fsanitize=pointer-overflow | FileCheck %s
-// CHECK-LABEL: define void @unary_arith
-void unary_arith(char *p) {
- // CHECK: [[BASE:%.*]] = ptrtoint i8* {{.*}} to i64, !nosanitize
- // CHECK-NEXT: [[COMPGEP:%.*]] = add i64 [[BASE]], 1, !nosanitize
- // CHECK-NEXT: [[POSVALID:%.*]] = icmp uge i64 [[COMPGEP]], [[BASE]], !nosanitize
- // CHECK-NEXT: br i1 [[POSVALID]]{{.*}}, !nosanitize
- // CHECK: call void @__ubsan_handle_pointer_overflow{{.*}}, i64 [[BASE]], i64 [[COMPGEP]]){{.*}}, !nosanitize
- ++p;
-
- // CHECK: ptrtoint i8* {{.*}} to i64, !nosanitize
- // CHECK-NEXT: [[COMPGEP:%.*]] = add i64 {{.*}}, -1, !nosanitize
- // CHECK: [[NEGVALID:%.*]] = icmp ule i64 [[COMPGEP]], {{.*}}, !nosanitize
- // CHECK-NOT: select
- // CHECK: br i1 [[NEGVALID]]{{.*}}, !nosanitize
- // CHECK: call void @__ubsan_handle_pointer_overflow{{.*}}
- --p;
-
- // CHECK: icmp uge i64
- // CHECK-NOT: select
- // CHECK: call void @__ubsan_handle_pointer_overflow{{.*}}
- p++;
-
- // CHECK: icmp ule i64
- // CHECK-NOT: select
- // CHECK: call void @__ubsan_handle_pointer_overflow{{.*}}
- p--;
-}
-
-// CHECK-LABEL: define void @binary_arith
-void binary_arith(char *p, int i) {
- // CHECK: [[SMUL:%.*]] = call { i64, i1 } @llvm.smul.with.overflow.i64(i64 1, i64 %{{.*}}), !nosanitize
- // CHECK-NEXT: [[SMULOFLOW:%.*]] = extractvalue { i64, i1 } [[SMUL]], 1, !nosanitize
- // CHECK-NEXT: [[SMULVAL:%.*]] = extractvalue { i64, i1 } [[SMUL]], 0, !nosanitize
- // CHECK-NEXT: [[BASE:%.*]] = ptrtoint i8* {{.*}} to i64, !nosanitize
- // CHECK-NEXT: [[COMPGEP:%.*]] = add i64 [[BASE]], [[SMULVAL]], !nosanitize
- // CHECK-NEXT: [[OFFSETVALID:%.*]] = xor i1 [[SMULOFLOW]], true, !nosanitize
- // CHECK-NEXT: [[POSVALID:%.*]] = icmp uge i64 [[COMPGEP]], [[BASE]], !nosanitize
- // CHECK-NEXT: [[POSOFFSET:%.*]] = icmp sge i64 [[SMULVAL]], 0, !nosanitize
- // CHECK-NEXT: [[NEGVALID:%.*]] = icmp ult i64 [[COMPGEP]], [[BASE]], !nosanitize
- // CHECK-NEXT: [[DIFFVALID:%.*]] = select i1 [[POSOFFSET]], i1 [[POSVALID]], i1 [[NEGVALID]], !nosanitize
- // CHECK: [[VALID:%.*]] = and i1 [[DIFFVALID]], [[OFFSETVALID]], !nosanitize
- // CHECK-NEXT: br i1 [[VALID]]{{.*}}, !nosanitize
- // CHECK: call void @__ubsan_handle_pointer_overflow{{.*}}, i64 [[BASE]], i64 [[COMPGEP]]){{.*}}, !nosanitize
- p + i;
-
- // CHECK: [[OFFSET:%.*]] = sub i64 0, {{.*}}
- // CHECK-NEXT: getelementptr inbounds {{.*}} [[OFFSET]]
- // CHECK: select
- // CHECK: call void @__ubsan_handle_pointer_overflow{{.*}}
- p - i;
-}
-
-// CHECK-LABEL: define void @binary_arith_unsigned
-void binary_arith_unsigned(char *p, unsigned i) {
- // CHECK: [[SMUL:%.*]] = call { i64, i1 } @llvm.smul.with.overflow.i64(i64 1, i64 %{{.*}}), !nosanitize
- // CHECK-NEXT: [[SMULOFLOW:%.*]] = extractvalue { i64, i1 } [[SMUL]], 1, !nosanitize
- // CHECK-NEXT: [[SMULVAL:%.*]] = extractvalue { i64, i1 } [[SMUL]], 0, !nosanitize
- // CHECK-NEXT: [[BASE:%.*]] = ptrtoint i8* {{.*}} to i64, !nosanitize
- // CHECK-NEXT: [[COMPGEP:%.*]] = add i64 [[BASE]], [[SMULVAL]], !nosanitize
- // CHECK-NEXT: [[OFFSETVALID:%.*]] = xor i1 [[SMULOFLOW]], true, !nosanitize
- // CHECK-NEXT: [[POSVALID:%.*]] = icmp uge i64 [[COMPGEP]], [[BASE]], !nosanitize
- // CHECK: [[VALID:%.*]] = and i1 [[POSVALID]], [[OFFSETVALID]], !nosanitize
- // CHECK-NEXT: br i1 [[VALID]]{{.*}}, !nosanitize
- // CHECK: call void @__ubsan_handle_pointer_overflow{{.*}}, i64 [[BASE]], i64 [[COMPGEP]]){{.*}}, !nosanitize
- p + i;
-
- // CHECK: [[OFFSET:%.*]] = sub i64 0, {{.*}}
- // CHECK-NEXT: getelementptr inbounds {{.*}} [[OFFSET]]
- // CHECK: icmp ule i64
- // CHECK-NOT: select
- // CHECK: call void @__ubsan_handle_pointer_overflow{{.*}}
- p - i;
-}
-
-// CHECK-LABEL: define void @fixed_len_array
-void fixed_len_array(int k) {
- // CHECK: getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* [[ARR:%.*]], i64 0, i64 [[IDXPROM:%.*]]
- // CHECK-NEXT: [[SMUL:%.*]] = call { i64, i1 } @llvm.smul.with.overflow.i64(i64 40, i64 [[IDXPROM]]), !nosanitize
- // CHECK-NEXT: [[SMULOFLOW:%.*]] = extractvalue { i64, i1 } [[SMUL]], 1, !nosanitize
- // CHECK-NEXT: [[SMULVAL:%.*]] = extractvalue { i64, i1 } [[SMUL]], 0, !nosanitize
- // CHECK-NEXT: [[BASE:%.*]] = ptrtoint [10 x [10 x i32]]* [[ARR]] to i64, !nosanitize
- // CHECK-NEXT: [[COMPGEP:%.*]] = add i64 [[BASE]], [[SMULVAL]], !nosanitize
- // CHECK-NEXT: [[OFFSETVALID:%.*]] = xor i1 [[SMULOFLOW]], true, !nosanitize
- // CHECK-NEXT: [[POSVALID:%.*]] = icmp uge i64 [[COMPGEP]], [[BASE]], !nosanitize
- // CHECK-NEXT: [[POSOFFSET:%.*]] = icmp sge i64 [[SMULVAL]], 0, !nosanitize
- // CHECK-NEXT: [[NEGVALID:%.*]] = icmp ult i64 [[COMPGEP]], [[BASE]], !nosanitize
- // CHECK-NEXT: [[DIFFVALID:%.*]] = select i1 [[POSOFFSET]], i1 [[POSVALID]], i1 [[NEGVALID]], !nosanitize
- // CHECK: [[VALID:%.*]] = and i1 [[DIFFVALID]], [[OFFSETVALID]], !nosanitize
- // CHECK-NEXT: br i1 [[VALID]]{{.*}}, !nosanitize
- // CHECK: call void @__ubsan_handle_pointer_overflow{{.*}}, i64 [[BASE]], i64 [[COMPGEP]]){{.*}}, !nosanitize
-
- // CHECK: getelementptr inbounds [10 x i32], [10 x i32]* {{.*}}, i64 0, i64 [[IDXPROM1:%.*]]
- // CHECK-NEXT: @llvm.smul.with.overflow.i64(i64 4, i64 [[IDXPROM1]]), !nosanitize
- // CHECK: call void @__ubsan_handle_pointer_overflow{{.*}}
-
- int arr[10][10];
- arr[k][k];
-}
-
-// CHECK-LABEL: define void @variable_len_array
-void variable_len_array(int n, int k) {
- // CHECK: getelementptr inbounds i32, i32* {{.*}}, i64 [[IDXPROM:%.*]]
- // CHECK-NEXT: @llvm.smul.with.overflow.i64(i64 4, i64 [[IDXPROM]]), !nosanitize
- // CHECK: call void @__ubsan_handle_pointer_overflow{{.*}}
-
- // CHECK: getelementptr inbounds i32, i32* {{.*}}, i64 [[IDXPROM1:%.*]]
- // CHECK-NEXT: @llvm.smul.with.overflow.i64(i64 4, i64 [[IDXPROM1]]), !nosanitize
- // CHECK: call void @__ubsan_handle_pointer_overflow{{.*}}
-
- int arr[n][n];
- arr[k][k];
-}
-
-// CHECK-LABEL: define void @pointer_array
-void pointer_array(int **arr, int k) {
- // CHECK: @llvm.smul.with.overflow.i64(i64 8, i64 {{.*}}), !nosanitize
- // CHECK: call void @__ubsan_handle_pointer_overflow{{.*}}
-
- // CHECK: @llvm.smul.with.overflow.i64(i64 4, i64 {{.*}}), !nosanitize
- // CHECK: call void @__ubsan_handle_pointer_overflow{{.*}}
-
- arr[k][k];
-}
-
-// CHECK-LABEL: define void @pointer_array_unsigned_indices
-void pointer_array_unsigned_indices(int **arr, unsigned k) {
- // CHECK: icmp uge
- // CHECK-NOT: select
- // CHECK: call void @__ubsan_handle_pointer_overflow{{.*}}
- // CHECK: icmp uge
- // CHECK-NOT: select
- // CHECK: call void @__ubsan_handle_pointer_overflow{{.*}}
- arr[k][k];
-}
-
-// CHECK-LABEL: define void @pointer_array_mixed_indices
-void pointer_array_mixed_indices(int **arr, int i, unsigned j) {
- // CHECK: select
- // CHECK: call void @__ubsan_handle_pointer_overflow{{.*}}
- // CHECK-NOT: select
- // CHECK: call void @__ubsan_handle_pointer_overflow{{.*}}
- arr[i][j];
-}
-
-struct S1 {
- int pad1;
- union {
- char leaf;
- struct S1 *link;
- } u;
- struct S1 *arr;
-};
-
-// TODO: Currently, structure GEPs are not checked, so there are several
-// potentially unsafe GEPs here which we don't instrument.
-//
-// CHECK-LABEL: define void @struct_index
-void struct_index(struct S1 *p) {
- // CHECK: getelementptr inbounds %struct.S1, %struct.S1* [[P:%.*]], i64 10
- // CHECK-NEXT: [[BASE:%.*]] = ptrtoint %struct.S1* [[P]] to i64, !nosanitize
- // CHECK-NEXT: [[COMPGEP:%.*]] = add i64 [[BASE]], 240, !nosanitize
- // CHECK: select
- // CHECK: @__ubsan_handle_pointer_overflow{{.*}} i64 [[BASE]], i64 [[COMPGEP]]) {{.*}}, !nosanitize
-
- // CHECK-NOT: @__ubsan_handle_pointer_overflow
-
- p->arr[10].u.link->u.leaf;
-}
-
-typedef void (*funcptr_t)(void);
-
-// CHECK-LABEL: define void @function_pointer_arith
-void function_pointer_arith(funcptr_t *p, int k) {
- // CHECK: add i64 {{.*}}, 8, !nosanitize
- // CHECK-NOT: select
- // CHECK: @__ubsan_handle_pointer_overflow{{.*}}
- ++p;
-
- // CHECK: @llvm.smul.with.overflow.i64(i64 8, i64 {{.*}}), !nosanitize
- // CHECK: select
- // CHECK: call void @__ubsan_handle_pointer_overflow{{.*}}
- p + k;
-}
-
// CHECK-LABEL: define void @variable_len_array_arith
void variable_len_array_arith(int n, int k) {
int vla[n];
@@ -209,12 +25,3 @@
// CHECK: @__ubsan_handle_pointer_overflow{{.*}}
p++;
}
-
-// CHECK-LABEL: define void @dont_emit_checks_for_no_op_GEPs
-// CHECK-NOT: __ubsan_handle_pointer_overflow
-void dont_emit_checks_for_no_op_GEPs(char *p) {
- &p[0];
-
- int arr[10][10];
- &arr[0][0];
-}
diff --git a/src/llvm-project/clang/test/CodeGen/ubsan-strip-path-components.cpp b/src/llvm-project/clang/test/CodeGen/ubsan-strip-path-components.cpp
index 7a95324..7ab0007 100644
--- a/src/llvm-project/clang/test/CodeGen/ubsan-strip-path-components.cpp
+++ b/src/llvm-project/clang/test/CodeGen/ubsan-strip-path-components.cpp
@@ -10,13 +10,13 @@
// RUN: %clang_cc1 %s -triple=x86_64-linux-gnu -emit-llvm -fsanitize=unreachable -o - -fsanitize-undefined-strip-path-components=-2 | FileCheck %s -check-prefix=LAST-TWO
// RUN: %clang_cc1 %s -triple=x86_64-linux-gnu -emit-llvm -fsanitize=unreachable -o - -fsanitize-undefined-strip-path-components=-1 | FileCheck %s -check-prefix=LAST-ONLY
-// REGULAR: @[[SRC:[0-9.a-zA-Z_]+]] = private unnamed_addr constant [{{.*}} x i8] c"{{.*test(.|\\5C)CodeGen(.|\\5C)ubsan-strip-path-components\.cpp}}\00", align 1
+// REGULAR: @[[SRC:[0-9.a-zA-Z_]+]] = private unnamed_addr constant [{{.*}} x i8] c"{{.*test(.|\\\\)CodeGen(.|\\\\)ubsan-strip-path-components\.cpp}}\00", align 1
-// First path component: "/" or "$drive_letter:", then a name, or '\5C' on Windows
-// REMOVE-FIRST-TWO: @[[STR:[0-9.a-zA-Z_]+]] = private unnamed_addr constant [{{.*}} x i8] c"{{(.:|/)([^\\/]*(/|\\5C))}}[[REST:.*ubsan-strip-path-components\.cpp]]\00", align 1
+// First path component: "/" or "$drive_letter:", then a name, or '\\' on Windows
+// REMOVE-FIRST-TWO: @[[STR:[0-9.a-zA-Z_]+]] = private unnamed_addr constant [{{.*}} x i8] c"{{(.:|/)([^\\/]*(/|\\\\))}}[[REST:.*ubsan-strip-path-components\.cpp]]\00", align 1
// REMOVE-FIRST-TWO: @[[SRC:[0-9.a-zA-Z_]+]] = private unnamed_addr constant [{{.*}} x i8] c"[[REST]]\00", align 1
-// LAST-TWO: @[[SRC:[0-9.a-zA-Z_]+]] = private unnamed_addr constant [{{.*}} x i8] c"CodeGen{{/|\\5C}}ubsan-strip-path-components.cpp\00", align 1
+// LAST-TWO: @[[SRC:[0-9.a-zA-Z_]+]] = private unnamed_addr constant [{{.*}} x i8] c"CodeGen{{/|\\\\}}ubsan-strip-path-components.cpp\00", align 1
// LAST-ONLY: @[[SRC:[0-9.a-zA-Z_]+]] = private unnamed_addr constant [{{.*}} x i8] c"ubsan-strip-path-components.cpp\00", align 1
// CHECK: @[[STATIC_DATA:[0-9.a-zA-Z_]+]] = private unnamed_addr global { { [{{.*}} x i8]*, i32, i32 } } { { [{{.*}} x i8]*, i32, i32 } { [{{.*}} x i8]* @[[SRC]], i32 [[@LINE+6]], i32 3 } }
diff --git a/src/llvm-project/clang/test/CodeGen/vectorcall.c b/src/llvm-project/clang/test/CodeGen/vectorcall.c
index db0ba02..aa529d0 100644
--- a/src/llvm-project/clang/test/CodeGen/vectorcall.c
+++ b/src/llvm-project/clang/test/CodeGen/vectorcall.c
@@ -44,7 +44,7 @@
// Because they are not classified as homogeneous, they don't get special
// handling to ensure alignment.
void __vectorcall hfa4(struct HFA5 a) {}
-// X32: define dso_local x86_vectorcallcc void @"\01hfa4@@40"(%struct.HFA5* byval(%struct.HFA5) align 4)
+// X32: define dso_local x86_vectorcallcc void @"\01hfa4@@40"(%struct.HFA5* byval(%struct.HFA5) align 4 %0)
// X64: define dso_local x86_vectorcallcc void @"\01hfa4@@40"(%struct.HFA5* %a)
// Return HFAs of 4 or fewer elements in registers.
@@ -116,3 +116,24 @@
// X32: define dso_local x86_vectorcallcc void @"\01HVAAnywhere@@88"(%struct.HFA2 inreg %p1.coerce, i32 inreg %p2, i32 inreg %p3, float %p4, i32 %p5, i32 %p6, %struct.HFA4* %p7, %struct.HFA2 inreg %p8.coerce, float %p9)
// X64: define dso_local x86_vectorcallcc void @"\01HVAAnywhere@@112"(%struct.HFA2 inreg %p1.coerce, i32 %p2, i32 %p3, float %p4, i32 %p5, i32 %p6, %struct.HFA4* %p7, %struct.HFA2 inreg %p8.coerce, float %p9)
+#ifndef __x86_64__
+// This covers the three ways XMM values can be passed on 32-bit x86:
+// - directly in XMM register (xmm5)
+// - indirectly by address, address in GPR (ecx)
+// - indirectly by address, address on stack
+void __vectorcall vectorcall_indirect_vec(
+ double xmm0, double xmm1, double xmm2, double xmm3, double xmm4,
+ v4f32 xmm5, v4f32 ecx, int edx, v4f32 mem) {
+}
+
+// X32: define dso_local x86_vectorcallcc void @"\01vectorcall_indirect_vec@@{{[0-9]+}}"
+// X32-SAME: (double %xmm0,
+// X32-SAME: double %xmm1,
+// X32-SAME: double %xmm2,
+// X32-SAME: double %xmm3,
+// X32-SAME: double %xmm4,
+// X32-SAME: <4 x float> %xmm5,
+// X32-SAME: <4 x float>* inreg %0,
+// X32-SAME: i32 inreg %edx,
+// X32-SAME: <4 x float>* %1)
+#endif
diff --git a/src/llvm-project/clang/test/CodeGen/wasm-export-name.c b/src/llvm-project/clang/test/CodeGen/wasm-export-name.c
new file mode 100644
index 0000000..f255615
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/wasm-export-name.c
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 -triple wasm32-unknown-unknown-wasm -emit-llvm -o - %s | FileCheck %s
+
+int __attribute__((export_name("bar"))) foo(void);
+
+int foo(void) {
+ return 43;
+}
+
+// CHECK: @llvm.used = appending global [1 x i8*] [i8* bitcast (i32 ()* @foo to i8*)]
+
+// CHECK: define i32 @foo() [[A:#[0-9]+]]
+
+// CHECK: attributes [[A]] = {{{.*}} "wasm-export-name"="bar" {{.*}}}
diff --git a/src/llvm-project/clang/test/CodeGen/wasm-varargs.c b/src/llvm-project/clang/test/CodeGen/wasm-varargs.c
index 4cb46f1..2350687 100644
--- a/src/llvm-project/clang/test/CodeGen/wasm-varargs.c
+++ b/src/llvm-project/clang/test/CodeGen/wasm-varargs.c
@@ -80,20 +80,61 @@
return v;
}
-// CHECK: define void @test_struct([[STRUCT_S:%[^,=]+]]*{{.*}} noalias sret [[AGG_RESULT:%.*]], i8*{{.*}} %fmt, ...) {{.*}} {
-// CHECK: [[FMT_ADDR:%[^,=]+]] = alloca i8*, align 4
-// CHECK: [[VA:%[^,=]+]] = alloca i8*, align 4
-// CHECK: store i8* %fmt, i8** [[FMT_ADDR]], align 4
-// CHECK: [[VA1:%[^,=]+]] = bitcast i8** [[VA]] to i8*
-// CHECK: call void @llvm.va_start(i8* [[VA1]])
-// CHECK: [[ARGP_CUR:%[^,=]+]] = load i8*, i8** [[VA]], align 4
-// CHECK: [[ARGP_NEXT:%[^,=]+]] = getelementptr inbounds i8, i8* [[ARGP_CUR]], i32 12
-// CHECK: store i8* [[ARGP_NEXT]], i8** [[VA]], align 4
-// CHECK: [[R3:%[^,=]+]] = bitcast i8* [[ARGP_CUR]] to [[STRUCT_S]]*
-// CHECK: [[R4:%[^,=]+]] = bitcast [[STRUCT_S]]* [[AGG_RESULT]] to i8*
-// CHECK: [[R5:%[^,=]+]] = bitcast [[STRUCT_S]]* [[R3]] to i8*
-// CHECK: call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 [[R4]], i8* align 4 [[R5]], i32 12, i1 false)
-// CHECK: [[VA2:%[^,=]+]] = bitcast i8** [[VA]] to i8*
-// CHECK: call void @llvm.va_end(i8* [[VA2]])
-// CHECK: ret void
-// CHECK: }
+// CHECK: define void @test_struct([[STRUCT_S:%[^,=]+]]*{{.*}} noalias sret [[AGG_RESULT:%.*]], i8*{{.*}} %fmt, ...) {{.*}} {
+// CHECK: [[FMT_ADDR:%[^,=]+]] = alloca i8*, align 4
+// CHECK-NEXT: [[VA:%[^,=]+]] = alloca i8*, align 4
+// CHECK-NEXT: store i8* %fmt, i8** [[FMT_ADDR]], align 4
+// CHECK-NEXT: [[VA1:%[^,=]+]] = bitcast i8** [[VA]] to i8*
+// CHECK-NEXT: call void @llvm.va_start(i8* [[VA1]])
+// CHECK-NEXT: [[ARGP_CUR:%[^,=]+]] = load i8*, i8** [[VA]], align 4
+// CHECK-NEXT: [[ARGP_NEXT:%[^,=]+]] = getelementptr inbounds i8, i8* [[ARGP_CUR]], i32 4
+// CHECK-NEXT: store i8* [[ARGP_NEXT]], i8** [[VA]], align 4
+// CHECK-NEXT: [[R3:%[^,=]+]] = bitcast i8* [[ARGP_CUR]] to [[STRUCT_S]]**
+// CHECK-NEXT: [[R4:%[^,=]+]] = load [[STRUCT_S]]*, [[STRUCT_S]]** [[R3]], align 4
+// CHECK-NEXT: [[R5:%[^,=]+]] = bitcast [[STRUCT_S]]* [[AGG_RESULT]] to i8*
+// CHECK-NEXT: [[R6:%[^,=]+]] = bitcast [[STRUCT_S]]* [[R4]] to i8*
+// CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 [[R5]], i8* align 4 [[R6]], i32 12, i1 false)
+// CHECK-NEXT: [[VA2:%[^,=]+]] = bitcast i8** [[VA]] to i8*
+// CHECK-NEXT: call void @llvm.va_end(i8* [[VA2]])
+// CHECK-NEXT: ret void
+// CHECK-NEXT: }
+
+struct Z {};
+
+struct S test_empty_struct(char *fmt, ...) {
+ va_list va;
+
+ va_start(va, fmt);
+ struct Z u = va_arg(va, struct Z);
+ struct S v = va_arg(va, struct S);
+ va_end(va);
+
+ return v;
+}
+
+// CHECK: define void @test_empty_struct([[STRUCT_S:%[^,=]+]]*{{.*}} noalias sret [[AGG_RESULT:%.*]], i8*{{.*}} %fmt, ...) {{.*}} {
+// CHECK: [[FMT_ADDR:%[^,=]+]] = alloca i8*, align 4
+// CHECK-NEXT: [[VA:%[^,=]+]] = alloca i8*, align 4
+// CHECK-NEXT: [[U:%[^,=]+]] = alloca [[STRUCT_Z:%[^,=]+]], align 1
+// CHECK-NEXT: store i8* %fmt, i8** [[FMT_ADDR]], align 4
+// CHECK-NEXT: [[VA1:%[^,=]+]] = bitcast i8** [[VA]] to i8*
+// CHECK-NEXT: call void @llvm.va_start(i8* [[VA1]])
+// CHECK-NEXT: [[ARGP_CUR:%[^,=]+]] = load i8*, i8** [[VA]], align 4
+// CHECK-NEXT: [[ARGP_NEXT:%[^,=]+]] = getelementptr inbounds i8, i8* [[ARGP_CUR]], i32 0
+// CHECK-NEXT: store i8* [[ARGP_NEXT]], i8** [[VA]], align 4
+// CHECK-NEXT: [[R0:%[^,=]+]] = bitcast i8* [[ARGP_CUR]] to [[STRUCT_Z]]*
+// CHECK-NEXT: [[R1:%[^,=]+]] = bitcast [[STRUCT_Z]]* [[U]] to i8*
+// CHECK-NEXT: [[R2:%[^,=]+]] = bitcast [[STRUCT_Z]]* [[R0]] to i8*
+// CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 [[R1]], i8* align 4 [[R2]], i32 0, i1 false)
+// CHECK-NEXT: [[ARGP_CUR2:%[^,=]+]] = load i8*, i8** [[VA]], align 4
+// CHECK-NEXT: [[ARGP_NEXT2:%[^,=]+]] = getelementptr inbounds i8, i8* [[ARGP_CUR2]], i32 4
+// CHECK-NEXT: store i8* [[ARGP_NEXT2]], i8** [[VA]], align 4
+// CHECK-NEXT: [[R3:%[^,=]+]] = bitcast i8* [[ARGP_CUR2]] to [[STRUCT_S]]**
+// CHECK-NEXT: [[R4:%[^,=]+]] = load [[STRUCT_S]]*, [[STRUCT_S]]** [[R3]], align 4
+// CHECK-NEXT: [[R5:%[^,=]+]] = bitcast [[STRUCT_S]]* [[AGG_RESULT]] to i8*
+// CHECK-NEXT: [[R6:%[^,=]+]] = bitcast [[STRUCT_S]]* [[R4]] to i8*
+// CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 [[R5]], i8* align 4 [[R6]], i32 12, i1 false)
+// CHECK-NEXT: [[VA2:%[^,=]+]] = bitcast i8** [[VA]] to i8*
+// CHECK-NEXT: call void @llvm.va_end(i8* [[VA2]])
+// CHECK-NEXT: ret void
+// CHECK-NEXT: }
diff --git a/src/llvm-project/clang/test/CodeGen/win64-i128.c b/src/llvm-project/clang/test/CodeGen/win64-i128.c
index 0514c48..6031147 100644
--- a/src/llvm-project/clang/test/CodeGen/win64-i128.c
+++ b/src/llvm-project/clang/test/CodeGen/win64-i128.c
@@ -12,5 +12,5 @@
int128_t bar(int128_t a, int128_t b) { return a * b; }
-// GNU64: define dso_local <2 x i64> @bar(i128*, i128*)
-// MSC64: define dso_local <2 x i64> @bar(i128*, i128*)
+// GNU64: define dso_local <2 x i64> @bar(i128* %0, i128* %1)
+// MSC64: define dso_local <2 x i64> @bar(i128* %0, i128* %1)
diff --git a/src/llvm-project/clang/test/CodeGen/windows-on-arm-itanium-thread-local.c b/src/llvm-project/clang/test/CodeGen/windows-on-arm-itanium-thread-local.c
deleted file mode 100644
index 7f12c36..0000000
--- a/src/llvm-project/clang/test/CodeGen/windows-on-arm-itanium-thread-local.c
+++ /dev/null
@@ -1,11 +0,0 @@
-// RUN: %clang_cc1 -triple thumbv7--windows-itanium -fdeclspec -fms-compatibility -fms-compatibility-version=19.0 -S -emit-llvm -o - %s | FileCheck %s
-
-__declspec(thread) static void *c;
-void f(void *p) {
- c = p;
-}
-
-// CHECK-LABEL: @f(i8* %p)
-// CHECK-NOT: call i8** @_ZTWL1c()
-// CHECK: call arm_aapcs_vfpcc i8** @_ZTWL1c()
-
diff --git a/src/llvm-project/clang/test/CodeGen/windows-swiftcall.c b/src/llvm-project/clang/test/CodeGen/windows-swiftcall.c
index 98fb3bd..6c28499 100644
--- a/src/llvm-project/clang/test/CodeGen/windows-swiftcall.c
+++ b/src/llvm-project/clang/test/CodeGen/windows-swiftcall.c
@@ -29,7 +29,7 @@
// CHECK-LABEL: define {{.*}} void @context_2(i8*{{.*}}, i8* swiftself
SWIFTCALL void context_error_1(CONTEXT int *self, ERROR float **error) {}
-// CHECK-LABEL: define {{.*}} void @context_error_1(i32* swiftself{{.*}}, float** swifterror)
+// CHECK-LABEL: define {{.*}} void @context_error_1(i32* swiftself{{.*}}, float** swifterror %0)
// CHECK: [[TEMP:%.*]] = alloca float*, align 8
// CHECK: [[T0:%.*]] = load float*, float** [[ERRORARG:%.*]], align 8
// CHECK: store float* [[T0]], float** [[TEMP]], align 8
@@ -51,7 +51,7 @@
// CHECK: store float* [[T0]], float** [[ERROR]], align 8
SWIFTCALL void context_error_2(short s, CONTEXT int *self, ERROR float **error) {}
-// CHECK-LABEL: define {{.*}} void @context_error_2(i16{{.*}}, i32* swiftself{{.*}}, float** swifterror)
+// CHECK-LABEL: define {{.*}} void @context_error_2(i16{{.*}}, i32* swiftself{{.*}}, float** swifterror %0)
/*****************************************************************************/
/********************************** LOWERING *********************************/
@@ -109,7 +109,7 @@
// CHECK: [[R1:%.*]] = insertvalue { i64, i64 } [[R0]], i64 [[T1]], 1
// CHECK: ret { i64, i64 } [[R1]]
// CHECK: }
-// CHECK-LABEL: define dso_local swiftcc void @take_struct_1(i64, i64) {{.*}}{
+// CHECK-LABEL: define dso_local swiftcc void @take_struct_1(i64 %0, i64 %1) {{.*}}{
// CHECK: [[V:%.*]] = alloca [[STRUCT1:%.*]], align 4
// CHECK: [[CAST:%.*]] = bitcast [[STRUCT1]]* [[V]] to { i64, i64 }*
// CHECK: [[GEP0:%.*]] = getelementptr inbounds { i64, i64 }, { i64, i64 }* [[CAST]], i32 0, i32 0
@@ -158,7 +158,7 @@
// CHECK: [[R1:%.*]] = insertvalue { i64, i64 } [[R0]], i64 [[T1]], 1
// CHECK: ret { i64, i64 } [[R1]]
// CHECK: }
-// CHECK-LABEL: define dso_local swiftcc void @take_struct_2(i64, i64) {{.*}}{
+// CHECK-LABEL: define dso_local swiftcc void @take_struct_2(i64 %0, i64 %1) {{.*}}{
// CHECK: [[V:%.*]] = alloca [[STRUCT:%.*]], align 4
// CHECK: [[CAST:%.*]] = bitcast [[STRUCT]]* [[V]] to { i64, i64 }*
// CHECK: [[GEP0:%.*]] = getelementptr inbounds { i64, i64 }, { i64, i64 }* [[CAST]], i32 0, i32 0
@@ -206,7 +206,7 @@
// CHECK: [[R0:%.*]] = load i64, i64* [[GEP]], align 1
// CHECK: ret i64 [[R0]]
// CHECK:}
-// CHECK-LABEL: define dso_local swiftcc void @take_struct_misaligned_1(i64) {{.*}}{
+// CHECK-LABEL: define dso_local swiftcc void @take_struct_misaligned_1(i64 %0) {{.*}}{
// CHECK: [[V:%.*]] = alloca [[STRUCT:%.*]], align 1
// CHECK: [[CAST:%.*]] = bitcast [[STRUCT]]* [[V]] to { i64 }*
// CHECK: [[GEP:%.*]] = getelementptr inbounds { i64 }, { i64 }* [[CAST]], i32 0, i32 0
@@ -254,7 +254,7 @@
// CHECK: [[GEP:%.*]] = getelementptr inbounds { i64 }, { i64 }* [[CAST]], i32 0, i32 0
// CHECK: [[R0:%.*]] = load i64, i64* [[GEP]], align 8
// CHECK: ret i64 [[R0]]
-// CHECK-LABEL: define dso_local swiftcc void @take_union_het_fp(i64) {{.*}}{
+// CHECK-LABEL: define dso_local swiftcc void @take_union_het_fp(i64 %0) {{.*}}{
// CHECK: [[V:%.*]] = alloca [[UNION:%.*]], align 8
// CHECK: [[CAST:%.*]] = bitcast [[UNION]]* [[V]] to { i64 }*
// CHECK: [[GEP:%.*]] = getelementptr inbounds { i64 }, { i64 }* [[CAST]], i32 0, i32 0
@@ -378,7 +378,7 @@
// CHECK: [[T0:%.*]] = insertvalue [[UAGG:{ <4 x i32>, <4 x i32> }]] undef, <4 x i32> [[FIRST]], 0
// CHECK: [[T1:%.*]] = insertvalue [[UAGG]] [[T0]], <4 x i32> [[SECOND]], 1
// CHECK: ret [[UAGG]] [[T1]]
-// CHECK-LABEL: define {{.*}} @take_int8(<4 x i32>, <4 x i32>)
+// CHECK-LABEL: define {{.*}} @take_int8(<4 x i32> %0, <4 x i32> %1)
// CHECK: [[V:%.*]] = alloca [[REC]], align
// CHECK: [[CAST_TMP:%.*]] = bitcast [[REC]]* [[V]] to [[AGG]]*
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 0
@@ -422,7 +422,7 @@
// CHECK: [[T0:%.*]] = insertvalue [[UAGG:{ <4 x i32>, i32 }]] undef, <4 x i32> [[FIRST]], 0
// CHECK: [[T1:%.*]] = insertvalue [[UAGG]] [[T0]], i32 [[SECOND]], 1
// CHECK: ret [[UAGG]] [[T1]]
-// CHECK-LABEL: define {{.*}} @take_int5(<4 x i32>, i32)
+// CHECK-LABEL: define {{.*}} @take_int5(<4 x i32> %0, i32 %1)
// CHECK: [[V:%.*]] = alloca [[REC]], align
// CHECK: [[CAST_TMP:%.*]] = bitcast [[REC]]* [[V]] to [[AGG]]*
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 0
@@ -456,4 +456,4 @@
int3 v __attribute__((packed));
} misaligned_int3;
TEST(misaligned_int3)
-// CHECK-LABEL: define dso_local swiftcc void @take_misaligned_int3(i64, i64)
+// CHECK-LABEL: define dso_local swiftcc void @take_misaligned_int3(i64 %0, i64 %1)
diff --git a/src/llvm-project/clang/test/CodeGen/x86-builtins-vector-width.c b/src/llvm-project/clang/test/CodeGen/x86-builtins-vector-width.c
index 62f5929..dca3e58 100644
--- a/src/llvm-project/clang/test/CodeGen/x86-builtins-vector-width.c
+++ b/src/llvm-project/clang/test/CodeGen/x86-builtins-vector-width.c
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -triple i686-linux-gnu -target-cpu i686 -emit-llvm %s -o - | FileCheck %s
-typedef signed long long V2LLi __attribute__((vector_size(16)));
-typedef signed long long V4LLi __attribute__((vector_size(32)));
+typedef double V2LLi __attribute__((vector_size(16)));
+typedef double V4LLi __attribute__((vector_size(32)));
// Make sure builtin forces a min-legal-width attribute
void foo(void) {
diff --git a/src/llvm-project/clang/test/CodeGen/x86-builtins.c b/src/llvm-project/clang/test/CodeGen/x86-builtins.c
new file mode 100644
index 0000000..fa2530b
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/x86-builtins.c
@@ -0,0 +1,45 @@
+// RUN: %clang_cc1 -ffreestanding %s -triple=x86_64-unknown-unknown -emit-llvm -o - -Wall -Werror | FileCheck %s -check-prefix=CHECK-64
+// RUN: %clang_cc1 -ffreestanding %s -triple=i386-unknown-unknown -emit-llvm -o - -Wall -Werror | FileCheck %s -check-prefix=CHECK-32
+
+#include <x86intrin.h>
+
+unsigned int test_castf32_u32 (float __A){
+ // CHECK-64-LABEL: @test_castf32_u32
+ // CHECK-64: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %{{.*}}, i8* align 4 %{{.*}}, i64 4, i1 false)
+ // CHECK-64: %{{.*}} = load i32, i32* %{{.*}}, align 4
+ // CHECK-32-LABEL: @test_castf32_u32
+ // CHECK-32: call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %{{.*}}, i8* align 4 %{{.*}}, i32 4, i1 false)
+ // CHECK-32: %{{.*}} = load i32, i32* %{{.*}}, align 4
+ return _castf32_u32(__A);
+}
+
+unsigned long long test_castf64_u64 (double __A){
+ // CHECK-64-LABEL: @test_castf64_u64
+ // CHECK-64: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %{{.*}}, i8* align 8 %{{.*}}, i64 8, i1 false)
+ // CHECK-64: %{{.*}} = load i64, i64* %{{.*}}, align 8
+ // CHECK-32-LABEL: @test_castf64_u64
+ // CHECK-32: call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 8 %{{.*}}, i8* align 8 %{{.*}}, i32 8, i1 false)
+ // CHECK-32: %{{.*}} = load i64, i64* %{{.*}}, align 8
+ return _castf64_u64(__A);
+}
+
+float test_castu32_f32 (unsigned int __A){
+ // CHECK-64-LABEL: @test_castu32_f32
+ // CHECK-64: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %{{.*}}, i8* align 4 %{{.*}}, i64 4, i1 false)
+ // CHECK-64: %{{.*}} = load float, float* %{{.*}}, align 4
+ // CHECK-32-LABEL: @test_castu32_f32
+ // CHECK-32: call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %{{.*}}, i8* align 4 %{{.*}}, i32 4, i1 false)
+ // CHECK-32: %{{.*}} = load float, float* %{{.*}}, align 4
+ return _castu32_f32(__A);
+}
+
+double test_castu64_f64 (unsigned long long __A){
+ // CHECK-64-LABEL: @test_castu64_f64
+ // CHECK-64: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %{{.*}}, i8* align 8 %{{.*}}, i64 8, i1 false)
+ // CHECK-64: %{{.*}} = load double, double* %{{.*}}, align 8
+ // CHECK-32-LABEL: @test_castu64_f64
+ // CHECK-32: call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 8 %{{.*}}, i8* align 8 %{{.*}}, i32 8, i1 false)
+ // CHECK-32: %{{.*}} = load double, double* %{{.*}}, align 8
+ return _castu64_f64(__A);
+}
+
diff --git a/src/llvm-project/clang/test/CodeGen/x86-vec-i128.c b/src/llvm-project/clang/test/CodeGen/x86-vec-i128.c
new file mode 100644
index 0000000..aee3b9e
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/x86-vec-i128.c
@@ -0,0 +1,52 @@
+// RUN: %clang_cc1 -triple x86_64-linux-gnu %s -target-feature +sse2 -S -emit-llvm -o - | FileCheck %s --check-prefixes=CLANG10ABI128,MEM256ALIGN32,MEM512ALIGN64
+// RUN: %clang_cc1 -triple x86_64-netbsd %s -target-feature +sse2 -S -emit-llvm -o - | FileCheck %s --check-prefixes=CLANG10ABI128,MEM256ALIGN32,MEM512ALIGN64
+// RUN: %clang_cc1 -triple x86_64-apple-darwin %s -target-feature +sse2 -S -emit-llvm -o - | FileCheck %s --check-prefixes=CLANG9ABI128,MEM256ALIGN16,MEM512ALIGN16
+// RUN: %clang_cc1 -triple x86_64-scei-ps4 %s -target-feature +sse2 -S -emit-llvm -o - | FileCheck %s --check-prefixes=CLANG9ABI128,MEM256ALIGN32,MEM512ALIGN64
+// RUN: %clang_cc1 -triple x86_64-unknown-freebsd10.0 %s -target-feature +sse2 -S -emit-llvm -o - | FileCheck %s --check-prefixes=CLANG9ABI128,MEM256ALIGN32,MEM512ALIGN64
+// RUN: %clang_cc1 -triple x86_64-linux-gnu %s -target-feature +sse2 -S -emit-llvm -o - -fclang-abi-compat=9 | FileCheck %s --check-prefixes=CLANG9ABI128,MEM256ALIGN32,MEM512ALIGN64
+
+// RUN: %clang_cc1 -triple x86_64-linux-gnu %s -target-feature +avx -S -emit-llvm -o - | FileCheck %s --check-prefixes=CLANG10ABI128,CLANG10ABI256,MEM512ALIGN64
+// RUN: %clang_cc1 -triple x86_64-netbsd %s -target-feature +avx -S -emit-llvm -o - | FileCheck %s --check-prefixes=CLANG10ABI128,CLANG10ABI256,MEM512ALIGN64
+// RUN: %clang_cc1 -triple x86_64-apple-darwin %s -target-feature +avx -S -emit-llvm -o - | FileCheck %s --check-prefixes=CLANG9ABI128,CLANG9ABI256,MEM512ALIGN32
+// RUN: %clang_cc1 -triple x86_64-scei-ps4 %s -target-feature +avx -S -emit-llvm -o - | FileCheck %s --check-prefixes=CLANG9ABI128,CLANG9ABI256,MEM512ALIGN64
+// RUN: %clang_cc1 -triple x86_64-unknown-freebsd10.0 %s -target-feature +avx -S -emit-llvm -o - | FileCheck %s --check-prefixes=CLANG9ABI128,CLANG9ABI256,MEM512ALIGN64
+// RUN: %clang_cc1 -triple x86_64-linux-gnu %s -target-feature +avx -S -emit-llvm -o - -fclang-abi-compat=9 | FileCheck %s --check-prefixes=CLANG9ABI128,CLANG9ABI256,MEM512ALIGN64
+
+// RUN: %clang_cc1 -triple x86_64-linux-gnu %s -target-feature +avx512f -S -emit-llvm -o - | FileCheck %s --check-prefixes=CLANG10ABI128,CLANG10ABI256,CLANG10ABI512
+// RUN: %clang_cc1 -triple x86_64-netbsd %s -target-feature +avx512f -S -emit-llvm -o - | FileCheck %s --check-prefixes=CLANG10ABI128,CLANG10ABI256,CLANG10ABI512
+// RUN: %clang_cc1 -triple x86_64-apple-darwin %s -target-feature +avx512f -S -emit-llvm -o - | FileCheck %s --check-prefixes=CLANG9ABI128,CLANG9ABI256,CLANG9ABI512
+// RUN: %clang_cc1 -triple x86_64-scei-ps4 %s -target-feature +avx512f -S -emit-llvm -o - | FileCheck %s --check-prefixes=CLANG9ABI128,CLANG9ABI256,CLANG9ABI512
+// RUN: %clang_cc1 -triple x86_64-unknown-freebsd10.0 %s -target-feature +avx512f -S -emit-llvm -o - | FileCheck %s --check-prefixes=CLANG9ABI128,CLANG9ABI256,CLANG9ABI512
+// RUN: %clang_cc1 -triple x86_64-linux-gnu %s -target-feature +avx512f -S -emit-llvm -o - -fclang-abi-compat=9 | FileCheck %s --check-prefixes=CLANG9ABI128,CLANG9ABI256,CLANG9ABI512
+
+typedef unsigned long long v16u64 __attribute__((vector_size(16)));
+typedef unsigned __int128 v16u128 __attribute__((vector_size(16)));
+
+v16u64 test_v16u128(v16u64 a, v16u128 b) {
+// CLANG10ABI128: define <2 x i64> @test_v16u128(<2 x i64> %{{.*}}, <2 x i64> %{{.*}})
+// CLANG9ABI128: define <2 x i64> @test_v16u128(<2 x i64> %{{.*}}, <1 x i128> %{{.*}})
+ return a + (v16u64)b;
+}
+
+typedef unsigned long long v32u64 __attribute__((vector_size(32)));
+typedef unsigned __int128 v32u128 __attribute__((vector_size(32)));
+
+v32u64 test_v32u128(v32u64 a, v32u128 b) {
+// MEM256ALIGN16: define <4 x i64> @test_v32u128(<4 x i64>* byval(<4 x i64>) align 16 %{{.*}}, <2 x i128>* byval(<2 x i128>) align 16 %{{.*}})
+// MEM256ALIGN32: define <4 x i64> @test_v32u128(<4 x i64>* byval(<4 x i64>) align 32 %{{.*}}, <2 x i128>* byval(<2 x i128>) align 32 %{{.*}})
+// CLANG10ABI256: define <4 x i64> @test_v32u128(<4 x i64> %{{.*}}, <2 x i128>* byval(<2 x i128>) align 32 %{{.*}})
+// CLANG9ABI256: define <4 x i64> @test_v32u128(<4 x i64> %{{.*}}, <2 x i128> %{{.*}})
+ return a + (v32u64)b;
+}
+
+typedef unsigned long long v64u64 __attribute__((vector_size(64)));
+typedef unsigned __int128 v64u128 __attribute__((vector_size(64)));
+
+v64u64 test_v64u128(v64u64 a, v64u128 b) {
+// MEM512ALIGN16: define <8 x i64> @test_v64u128(<8 x i64>* byval(<8 x i64>) align 16 %{{.*}}, <4 x i128>* byval(<4 x i128>) align 16 %{{.*}})
+// MEM512ALIGN32: define <8 x i64> @test_v64u128(<8 x i64>* byval(<8 x i64>) align 32 %{{.*}}, <4 x i128>* byval(<4 x i128>) align 32 %{{.*}})
+// MEM512ALIGN64: define <8 x i64> @test_v64u128(<8 x i64>* byval(<8 x i64>) align 64 %{{.*}}, <4 x i128>* byval(<4 x i128>) align 64 %{{.*}})
+// CLANG10ABI512: define <8 x i64> @test_v64u128(<8 x i64> %{{.*}}, <4 x i128>* byval(<4 x i128>) align 64 %{{.*}})
+// CLANG9ABI512: define <8 x i64> @test_v64u128(<8 x i64> %{{.*}}, <4 x i128> %{{.*}})
+ return a + (v64u64)b;
+}
diff --git a/src/llvm-project/clang/test/CodeGen/x86_32-arguments-darwin.c b/src/llvm-project/clang/test/CodeGen/x86_32-arguments-darwin.c
index 2bb2f1b..71b8a2b 100644
--- a/src/llvm-project/clang/test/CodeGen/x86_32-arguments-darwin.c
+++ b/src/llvm-project/clang/test/CodeGen/x86_32-arguments-darwin.c
@@ -201,13 +201,13 @@
struct s51 { vvbp f0; int f1; };
void f51(struct s51 a0) { }
-// CHECK-LABEL: define void @f52(%struct.s52* byval(%struct.s52) align 4)
+// CHECK-LABEL: define void @f52(%struct.s52* byval(%struct.s52) align 4 %0)
struct s52 {
long double a;
};
void f52(struct s52 x) {}
-// CHECK-LABEL: define void @f53(%struct.s53* byval(%struct.s53) align 4)
+// CHECK-LABEL: define void @f53(%struct.s53* byval(%struct.s53) align 4 %0)
struct __attribute__((aligned(32))) s53 {
int x;
int y;
@@ -229,12 +229,12 @@
// CHECK-LABEL: define void @f56(
// CHECK: i8 signext %a0, %struct.s56_0* byval(%struct.s56_0) align 4 %a1,
-// CHECK: i64 %a2.coerce, %struct.s56_1* byval(%struct.s56_1) align 4,
-// CHECK: i64 %a4.coerce, %struct.s56_2* byval(%struct.s56_2) align 4,
+// CHECK: i64 %a2.coerce, %struct.s56_1* byval(%struct.s56_1) align 4 %0,
+// CHECK: i64 %a4.coerce, %struct.s56_2* byval(%struct.s56_2) align 4 %1,
// CHECK: <4 x i32> %a6, %struct.s56_3* byval(%struct.s56_3) align 16 %a7,
// CHECK: <2 x double> %a8, %struct.s56_4* byval(%struct.s56_4) align 16 %a9,
-// CHECK: <8 x i32> %a10, %struct.s56_5* byval(%struct.s56_5) align 4,
-// CHECK: <4 x double> %a12, %struct.s56_6* byval(%struct.s56_6) align 4)
+// CHECK: <8 x i32> %a10, %struct.s56_5* byval(%struct.s56_5) align 4 %2,
+// CHECK: <4 x double> %a12, %struct.s56_6* byval(%struct.s56_6) align 4 %3)
// CHECK: call void (i32, ...) @f56_0(i32 1,
// CHECK: i32 %{{[^ ]*}}, %struct.s56_0* byval(%struct.s56_0) align 4 %{{[^ ]*}},
@@ -289,7 +289,7 @@
struct s59 { float x __attribute((aligned(8))); };
struct s59 f59() { while (1) {} }
-// CHECK-LABEL: define void @f60(%struct.s60* byval(%struct.s60) align 4, i32 %y)
+// CHECK-LABEL: define void @f60(%struct.s60* byval(%struct.s60) align 4 %0, i32 %y)
struct s60 { int x __attribute((aligned(8))); };
void f60(struct s60 x, int y) {}
@@ -298,7 +298,7 @@
struct s61 { T61 x; int y; };
void f61(int x, struct s61 y) {}
-// CHECK-LABEL: define void @f62(i32 %x, %struct.s62* byval(%struct.s62) align 4)
+// CHECK-LABEL: define void @f62(i32 %x, %struct.s62* byval(%struct.s62) align 4 %0)
typedef int T62 __attribute((vector_size(16)));
struct s62 { T62 x; int y; } __attribute((packed, aligned(8)));
void f62(int x, struct s62 y) {}
diff --git a/src/llvm-project/clang/test/CodeGen/x86_32-arguments-linux.c b/src/llvm-project/clang/test/CodeGen/x86_32-arguments-linux.c
index 3c64fbc..a199b7d 100644
--- a/src/llvm-project/clang/test/CodeGen/x86_32-arguments-linux.c
+++ b/src/llvm-project/clang/test/CodeGen/x86_32-arguments-linux.c
@@ -3,12 +3,12 @@
// CHECK-LABEL: define void @f56(
// CHECK: i8 signext %a0, %struct.s56_0* byval(%struct.s56_0) align 4 %a1,
-// CHECK: i64 %a2.coerce, %struct.s56_1* byval(%struct.s56_1) align 4,
-// CHECK: <1 x double> %a4, %struct.s56_2* byval(%struct.s56_2) align 4,
-// CHECK: <4 x i32> %a6, %struct.s56_3* byval(%struct.s56_3) align 4,
-// CHECK: <2 x double> %a8, %struct.s56_4* byval(%struct.s56_4) align 4,
-// CHECK: <8 x i32> %a10, %struct.s56_5* byval(%struct.s56_5) align 4,
-// CHECK: <4 x double> %a12, %struct.s56_6* byval(%struct.s56_6) align 4)
+// CHECK: i64 %a2.coerce, %struct.s56_1* byval(%struct.s56_1) align 4 %0,
+// CHECK: <1 x double> %a4, %struct.s56_2* byval(%struct.s56_2) align 4 %1,
+// CHECK: <4 x i32> %a6, %struct.s56_3* byval(%struct.s56_3) align 4 %2,
+// CHECK: <2 x double> %a8, %struct.s56_4* byval(%struct.s56_4) align 4 %3,
+// CHECK: <8 x i32> %a10, %struct.s56_5* byval(%struct.s56_5) align 4 %4,
+// CHECK: <4 x double> %a12, %struct.s56_6* byval(%struct.s56_6) align 4 %5)
// CHECK: call void (i32, ...) @f56_0(i32 1,
// CHECK: i32 %{{.*}}, %struct.s56_0* byval(%struct.s56_0) align 4 %{{[^ ]*}},
diff --git a/src/llvm-project/clang/test/CodeGen/x86_32-arguments-realign.c b/src/llvm-project/clang/test/CodeGen/x86_32-arguments-realign.c
index cd1d1cf..4de87d2 100644
--- a/src/llvm-project/clang/test/CodeGen/x86_32-arguments-realign.c
+++ b/src/llvm-project/clang/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-LABEL: define void @f0(%struct.s0* byval(%struct.s0) align 4)
+// CHECK-LABEL: define void @f0(%struct.s0* byval(%struct.s0) align 4 %0)
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 16 %{{.*}}, i8* align 4 %{{.*}}, i32 16, i1 false)
// CHECK: }
struct s0 { long double a; };
diff --git a/src/llvm-project/clang/test/CodeGen/x86_32-inline-asm.c b/src/llvm-project/clang/test/CodeGen/x86_32-inline-asm.c
index c1fba0e..5a69064 100644
--- a/src/llvm-project/clang/test/CodeGen/x86_32-inline-asm.c
+++ b/src/llvm-project/clang/test/CodeGen/x86_32-inline-asm.c
@@ -70,3 +70,35 @@
__asm__ volatile("foo1 %0" : "=x" (val256)); // expected-error {{invalid output size for constraint '=x'}}
#endif
}
+
+int __attribute__((__target__("sse"))) _func2() {
+ __asm__ volatile("foo1 %0" : : "x" (val128)); // No error.
+ __asm__ volatile("foo1 %0" : "=x" (val128)); // No error.
+#ifdef __AVX__
+ __asm__ volatile("foo1 %0" : : "x" (val256)); // No error.
+ __asm__ volatile("foo1 %0" : "=x" (val256)); // No error.
+#else
+ __asm__ volatile("foo1 %0" : : "x" (val256)); // expected-error {{invalid input size for constraint 'x'}}
+ __asm__ volatile("foo1 %0" : "=x" (val256)); // expected-error {{invalid output size for constraint '=x'}}
+#endif
+ __asm__ volatile("foo1 %0" : : "x" (val512)); // expected-error {{invalid input size for constraint 'x'}}
+ __asm__ volatile("foo1 %0" : "=x" (val512)); // expected-error {{invalid output size for constraint '=x'}}
+}
+
+int __attribute__((__target__("avx"))) _func3() {
+ __asm__ volatile("foo1 %0" : : "x" (val128)); // No error.
+ __asm__ volatile("foo1 %0" : "=x" (val128)); // No error.
+ __asm__ volatile("foo1 %0" : : "x" (val256)); // No error.
+ __asm__ volatile("foo1 %0" : "=x" (val256)); // No error.
+ __asm__ volatile("foo1 %0" : : "x" (val512)); // expected-error {{invalid input size for constraint 'x'}}
+ __asm__ volatile("foo1 %0" : "=x" (val512)); // expected-error {{invalid output size for constraint '=x'}}
+}
+
+int __attribute__((__target__("avx512f"))) _func4() {
+ __asm__ volatile("foo1 %0" : : "x" (val128)); // No error.
+ __asm__ volatile("foo1 %0" : "=x" (val128)); // No error.
+ __asm__ volatile("foo1 %0" : : "x" (val256)); // No error.
+ __asm__ volatile("foo1 %0" : "=x" (val256)); // No error.
+ __asm__ volatile("foo1 %0" : : "x" (val512)); // No error.
+ __asm__ volatile("foo1 %0" : "=x" (val512)); // No error.
+}
diff --git a/src/llvm-project/clang/test/CodeGen/x86_64-PR42672.c b/src/llvm-project/clang/test/CodeGen/x86_64-PR42672.c
new file mode 100644
index 0000000..b3b57eb
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/x86_64-PR42672.c
@@ -0,0 +1,117 @@
+// RUN: %clang_cc1 -triple=x86_64-unknown-linux-gnu -DSTRUCT -emit-llvm %s -o - 2>&1 | FileCheck %s --check-prefix=CHECK-STRUCT
+// RUN: %clang_cc1 -triple=x86_64-unknown-linux-gnu -USTRUCT -emit-llvm %s -o - 2>&1 | FileCheck %s --check-prefix=CHECK-NOSTRUCT
+// RUN: not %clang_cc1 -triple=x86_64-unknown-linux-gnu -DIMPOSSIBLE_ODD -emit-llvm %s -o - 2>&1 | FileCheck %s --check-prefix=CHECK-IMPOSSIBLE_ODD
+// RUN: not %clang_cc1 -triple=x86_64-unknown-linux-gnu -DIMPOSSIBLE_BIG -emit-llvm %s -o - 2>&1 | FileCheck %s --check-prefix=CHECK-IMPOSSIBLE_BIG
+// RUN: %clang_cc1 -triple=x86_64-unknown-linux-gnu -DPOSSIBLE_X -emit-llvm %s -o - 2>&1 | FileCheck %s --check-prefix=CHECK-X
+// RUN: not %clang_cc1 -triple=x86_64-unknown-linux-gnu -DIMPOSSIBLE_X -emit-llvm %s -o - 2>&1 | FileCheck %s --check-prefix=CHECK-IMPOSSIBLE_X
+// RUN: not %clang_cc1 -triple=x86_64-unknown-linux-gnu -DIMPOSSIBLE_9BYTES -emit-llvm %s -o - 2>&1 | FileCheck %s --check-prefix=CHECK-IMPOSSIBLE_9BYTES
+
+// Make sure Clang doesn't treat |lockval| as asm input.
+void _raw_spin_lock(void) {
+#ifdef STRUCT
+ struct {
+ unsigned short owner, next;
+ } lockval;
+ lockval.owner = 1;
+ lockval.next = 2;
+#else
+ int lockval;
+ lockval = 3;
+#endif
+ asm("nop"
+ : "=r"(lockval));
+}
+// CHECK-LABEL: _raw_spin_lock
+// CHECK-LABEL: entry:
+
+// CHECK-STRUCT: %lockval = alloca %struct.anon, align 2
+// CHECK-STRUCT: store i16 1
+// CHECK-STRUCT: store i16 2
+// CHECK-STRUCT: [[RES:%[0-9]+]] = call i32 asm "nop", "=r,~{dirflag},~{fpsr},~{flags}"()
+// CHECK-STRUCT: [[CAST:%[0-9]+]] = bitcast %struct.anon* %lockval to i32*
+// CHECK-STRUCT: store i32 [[RES]], i32* [[CAST]], align 2
+
+// CHECK-NOSTRUCT: %lockval = alloca i32, align 4
+// CHECK-NOSTRUCT: store i32 3
+// CHECK-NOSTRUCT: [[RES:%[0-9]+]] = call i32 asm "nop", "=r,~{dirflag},~{fpsr},~{flags}"()
+// CHECK-NOSTRUCT: store i32 [[RES]], i32* %lockval, align 4
+
+// Check Clang correctly handles a structure with padding.
+void unusual_struct(void) {
+ struct {
+ unsigned short first;
+ unsigned char second;
+ } str;
+ asm("nop"
+ : "=r"(str));
+}
+
+// Check Clang reports an error if attempting to return a structure for which
+// no direct conversion to a register is possible.
+void odd_struct(void) {
+#ifdef IMPOSSIBLE_ODD
+ struct __attribute__((__packed__)) {
+ unsigned short first;
+ unsigned char second;
+ } str;
+ asm("nop"
+ : "=r"(str));
+#endif
+}
+// CHECK-IMPOSSIBLE_ODD: impossible constraint in asm: can't store value into a register
+
+// Check Clang reports an error if attempting to return a big structure via a register.
+void big_struct(void) {
+#ifdef IMPOSSIBLE_BIG
+ struct {
+ long long int v1, v2, v3, v4;
+ } str;
+ asm("nop"
+ : "=r"(str));
+#endif
+}
+// CHECK-IMPOSSIBLE_BIG: impossible constraint in asm: can't store value into a register
+
+// Clang is able to emit LLVM IR for an 16-byte structure.
+void x_constraint_fit() {
+#ifdef POSSIBLE_X
+ struct S {
+ unsigned x[4];
+ } z;
+ asm volatile("nop"
+ : "=x"(z));
+#endif
+}
+// CHECK-LABEL: x_constraint_fit
+// CHECK-X: %z = alloca %struct.S, align 4
+// CHECK-X: [[RES:%[0-9]+]] = call i128 asm sideeffect "nop", "=x,~{dirflag},~{fpsr},~{flags}"()
+// CHECK-X: [[CAST:%[0-9]+]] = bitcast %struct.S* %z to i128*
+// CHECK-X: store i128 [[RES]], i128* [[CAST]], align 4
+// CHECK-X: ret
+
+// Clang is unable to emit LLVM IR for a 32-byte structure.
+void x_constraint_nofit() {
+#ifdef IMPOSSIBLE_X
+ struct S {
+ unsigned x[8];
+ } z;
+ asm volatile("nop"
+ : "=x"(z));
+#endif
+}
+
+// CHECK-IMPOSSIBLE_X: invalid output size for constraint
+
+// http://crbug.com/999160
+// Clang used to report the following message:
+// "impossible constraint in asm: can't store struct into a register"
+// for the assembly directive below, although there's no struct.
+void crbug_999160_regtest() {
+#ifdef IMPOSSIBLE_9BYTES
+ char buf[9];
+ asm(""
+ : "=r"(buf));
+#endif
+}
+
+// CHECK-IMPOSSIBLE_9BYTES: impossible constraint in asm: can't store value into a register
diff --git a/src/llvm-project/clang/test/CodeGen/x86_64-mno-sse2.c b/src/llvm-project/clang/test/CodeGen/x86_64-mno-sse2.c
new file mode 100644
index 0000000..0c8e78e
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGen/x86_64-mno-sse2.c
@@ -0,0 +1,20 @@
+// RUN: %clang_cc1 -triple x86_64-linux -target-feature -sse2 -S -o /dev/null -verify %s
+// REQUIRES: x86-registered-target
+
+double f1(void) { // expected-error {{SSE2 register return with SSE2 disabled}}
+ return 1.4;
+}
+extern double g;
+void f2(void) { // expected-error {{SSE2 register return with SSE2 disabled}}
+ g = f1();
+}
+void take_double(double);
+void pass_double(void) {
+ // FIXME: Still asserts.
+ //take_double(1.5);
+}
+
+double return_double();
+void call_double(double *a) { // expected-error {{SSE2 register return with SSE2 disabled}}
+ *a = return_double();
+}
diff --git a/src/llvm-project/clang/test/CodeGen/x86_64-profiling-keep-fp.c b/src/llvm-project/clang/test/CodeGen/x86_64-profiling-keep-fp.c
index ca679fa..a51d87fa 100644
--- a/src/llvm-project/clang/test/CodeGen/x86_64-profiling-keep-fp.c
+++ b/src/llvm-project/clang/test/CodeGen/x86_64-profiling-keep-fp.c
@@ -1,7 +1,9 @@
// REQUIRES: x86-registered-target
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -O3 -pg -S -o - %s | \
// RUN: FileCheck %s
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown -O3 -momit-leaf-frame-pointer -pg -S -o - %s | \
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -O3 -mframe-pointer=all -pg -S -o - %s | \
+// RUN: FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -O3 -mframe-pointer=non-leaf -pg -S -o - %s | \
// RUN: FileCheck %s
// Test that the frame pointer is kept when compiling with
diff --git a/src/llvm-project/clang/test/CodeGen/xcore-abi.c b/src/llvm-project/clang/test/CodeGen/xcore-abi.c
index 90306ce..076c22c 100644
--- a/src/llvm-project/clang/test/CodeGen/xcore-abi.c
+++ b/src/llvm-project/clang/test/CodeGen/xcore-abi.c
@@ -138,5 +138,4 @@
return (char)-1;
}
-// CHECK: "no-frame-pointer-elim"="false"
-// CHECK-NOT: "no-frame-pointer-elim-non-leaf"
+// CHECK: "frame-pointer"="none"
diff --git a/src/llvm-project/clang/test/CodeGen/xcore-abi.cpp b/src/llvm-project/clang/test/CodeGen/xcore-abi.cpp
index fbf31ff..66ff33a 100644
--- a/src/llvm-project/clang/test/CodeGen/xcore-abi.cpp
+++ b/src/llvm-project/clang/test/CodeGen/xcore-abi.cpp
@@ -23,5 +23,4 @@
};
C c;
-// CHECK: "no-frame-pointer-elim"="false"
-// CHECK-NOT: "no-frame-pointer-elim-non-leaf"
+// CHECK: "frame-pointer"="none"
diff --git a/src/llvm-project/clang/test/CodeGen/zvector.c b/src/llvm-project/clang/test/CodeGen/zvector.c
index a8405a7..58fb60e 100644
--- a/src/llvm-project/clang/test/CodeGen/zvector.c
+++ b/src/llvm-project/clang/test/CodeGen/zvector.c
@@ -108,7 +108,7 @@
// CHECK: [[SUB3:%.*]] = sub <2 x i64> zeroinitializer, [[TMP3]]
// CHECK: store volatile <2 x i64> [[SUB3]], <2 x i64>* @sl, align 8
// CHECK: [[TMP4:%.*]] = load volatile <2 x double>, <2 x double>* @fd2, align 8
-// CHECK: [[SUB4:%.*]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, [[TMP4]]
+// CHECK: [[SUB4:%.*]] = fneg <2 x double> [[TMP4]]
// CHECK: store volatile <2 x double> [[SUB4]], <2 x double>* @fd, align 8
// CHECK: ret void
void test_neg(void) {
diff --git a/src/llvm-project/clang/test/CodeGen/zvector2.c b/src/llvm-project/clang/test/CodeGen/zvector2.c
index 909b3fd..c085dc1 100644
--- a/src/llvm-project/clang/test/CodeGen/zvector2.c
+++ b/src/llvm-project/clang/test/CodeGen/zvector2.c
@@ -24,7 +24,7 @@
{
// CHECK-LABEL: test_neg
// CHECK: [[VAL:%[^ ]+]] = load volatile <4 x float>, <4 x float>* @ff2
-// CHECK: %{{.*}} = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, [[VAL]]
+// CHECK: %{{.*}} = fneg <4 x float> [[VAL]]
ff = -ff2;
}
diff --git a/src/llvm-project/clang/test/CodeGenCUDA/Inputs/cuda.h b/src/llvm-project/clang/test/CodeGenCUDA/Inputs/cuda.h
index 0fd1757..5d73b81 100644
--- a/src/llvm-project/clang/test/CodeGenCUDA/Inputs/cuda.h
+++ b/src/llvm-project/clang/test/CodeGenCUDA/Inputs/cuda.h
@@ -14,12 +14,21 @@
__host__ __device__ dim3(unsigned x, unsigned y = 1, unsigned z = 1) : x(x), y(y), z(z) {}
};
+#ifdef __HIP__
+typedef struct hipStream *hipStream_t;
+typedef enum hipError {} hipError_t;
+int hipConfigureCall(dim3 gridSize, dim3 blockSize, size_t sharedSize = 0,
+ hipStream_t stream = 0);
+extern "C" hipError_t __hipPushCallConfiguration(dim3 gridSize, dim3 blockSize,
+ size_t sharedSize = 0,
+ hipStream_t stream = 0);
+extern "C" hipError_t hipLaunchKernel(const void *func, dim3 gridDim,
+ dim3 blockDim, void **args,
+ size_t sharedMem,
+ hipStream_t stream);
+#else
typedef struct cudaStream *cudaStream_t;
typedef enum cudaError {} cudaError_t;
-#ifdef __HIP__
-int hipConfigureCall(dim3 gridSize, dim3 blockSize, size_t sharedSize = 0,
- cudaStream_t stream = 0);
-#else
extern "C" int cudaConfigureCall(dim3 gridSize, dim3 blockSize,
size_t sharedSize = 0,
cudaStream_t stream = 0);
diff --git a/src/llvm-project/clang/test/CodeGenCUDA/amdgpu-kernel-arg-pointer-type.cu b/src/llvm-project/clang/test/CodeGenCUDA/amdgpu-kernel-arg-pointer-type.cu
new file mode 100644
index 0000000..cb8a758
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCUDA/amdgpu-kernel-arg-pointer-type.cu
@@ -0,0 +1,69 @@
+// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -fcuda-is-device -emit-llvm -x hip %s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm -x hip %s -o - | FileCheck -check-prefix=HOST %s
+
+#include "Inputs/cuda.h"
+
+// Coerced struct from `struct S` without all generic pointers lowered into
+// global ones.
+// CHECK: %struct.S.coerce = type { i32 addrspace(1)*, float addrspace(1)* }
+// CHECK: %struct.T.coerce = type { [2 x float addrspace(1)*] }
+
+// On the host-side compilation, generic pointer won't be coerced.
+// HOST-NOT: %struct.S.coerce
+// HOST-NOT: %struct.T.coerce
+
+// CHECK: define amdgpu_kernel void @_Z7kernel1Pi(i32 addrspace(1)* %x.coerce)
+// HOST: define void @_Z7kernel1Pi.stub(i32* %x)
+__global__ void kernel1(int *x) {
+ x[0]++;
+}
+
+// CHECK: define amdgpu_kernel void @_Z7kernel2Ri(i32 addrspace(1)* dereferenceable(4) %x.coerce)
+// HOST: define void @_Z7kernel2Ri.stub(i32* dereferenceable(4) %x)
+__global__ void kernel2(int &x) {
+ x++;
+}
+
+// CHECK: define amdgpu_kernel void @_Z7kernel3PU3AS2iPU3AS1i(i32 addrspace(2)* %x, i32 addrspace(1)* %y)
+// HOST: define void @_Z7kernel3PU3AS2iPU3AS1i.stub(i32 addrspace(2)* %x, i32 addrspace(1)* %y)
+__global__ void kernel3(__attribute__((address_space(2))) int *x,
+ __attribute__((address_space(1))) int *y) {
+ y[0] = x[0];
+}
+
+// CHECK: define void @_Z4funcPi(i32* %x)
+__device__ void func(int *x) {
+ x[0]++;
+}
+
+struct S {
+ int *x;
+ float *y;
+};
+// `by-val` struct will be coerced into a similar struct with all generic
+// pointers lowerd into global ones.
+// CHECK: define amdgpu_kernel void @_Z7kernel41S(%struct.S.coerce %s.coerce)
+// HOST: define void @_Z7kernel41S.stub(i32* %s.coerce0, float* %s.coerce1)
+__global__ void kernel4(struct S s) {
+ s.x[0]++;
+ s.y[0] += 1.f;
+}
+
+// If a pointer to struct is passed, only the pointer itself is coerced into the global one.
+// CHECK: define amdgpu_kernel void @_Z7kernel5P1S(%struct.S addrspace(1)* %s.coerce)
+// HOST: define void @_Z7kernel5P1S.stub(%struct.S* %s)
+__global__ void kernel5(struct S *s) {
+ s->x[0]++;
+ s->y[0] += 1.f;
+}
+
+struct T {
+ float *x[2];
+};
+// `by-val` array is also coerced.
+// CHECK: define amdgpu_kernel void @_Z7kernel61T(%struct.T.coerce %t.coerce)
+// HOST: define void @_Z7kernel61T.stub(float* %t.coerce0, float* %t.coerce1)
+__global__ void kernel6(struct T t) {
+ t.x[0][0] += 1.f;
+ t.x[1][0] += 2.f;
+}
diff --git a/src/llvm-project/clang/test/CodeGenCUDA/amdgpu-kernel-attrs.cu b/src/llvm-project/clang/test/CodeGenCUDA/amdgpu-kernel-attrs.cu
index 70eb909..ece8685 100644
--- a/src/llvm-project/clang/test/CodeGenCUDA/amdgpu-kernel-attrs.cu
+++ b/src/llvm-project/clang/test/CodeGenCUDA/amdgpu-kernel-attrs.cu
@@ -1,13 +1,21 @@
// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa \
-// RUN: -fcuda-is-device -emit-llvm -o - %s | FileCheck %s
+// RUN: -fcuda-is-device -emit-llvm -o - -x hip %s \
+// RUN: | FileCheck -check-prefixes=CHECK,DEFAULT %s
+// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa --gpu-max-threads-per-block=1024 \
+// RUN: -fcuda-is-device -emit-llvm -o - -x hip %s \
+// RUN: | FileCheck -check-prefixes=CHECK,MAX1024 %s
// RUN: %clang_cc1 -triple nvptx \
// RUN: -fcuda-is-device -emit-llvm -o - %s | FileCheck %s \
// RUN: -check-prefix=NAMD
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm \
-// RUN: -verify -o - %s | FileCheck -check-prefix=NAMD %s
+// RUN: -verify -o - -x hip %s | FileCheck -check-prefix=NAMD %s
#include "Inputs/cuda.h"
+__global__ void flat_work_group_size_default() {
+// CHECK: define amdgpu_kernel void @_Z28flat_work_group_size_defaultv() [[FLAT_WORK_GROUP_SIZE_DEFAULT:#[0-9]+]]
+}
+
__attribute__((amdgpu_flat_work_group_size(32, 64))) // expected-no-diagnostics
__global__ void flat_work_group_size_32_64() {
// CHECK: define amdgpu_kernel void @_Z26flat_work_group_size_32_64v() [[FLAT_WORK_GROUP_SIZE_32_64:#[0-9]+]]
@@ -31,7 +39,9 @@
// NAMD-NOT: "amdgpu-num-vgpr"
// NAMD-NOT: "amdgpu-num-sgpr"
-// CHECK-DAG: attributes [[FLAT_WORK_GROUP_SIZE_32_64]] = { convergent noinline nounwind optnone "amdgpu-flat-work-group-size"="32,64"
-// CHECK-DAG: attributes [[WAVES_PER_EU_2]] = { convergent noinline nounwind optnone "amdgpu-waves-per-eu"="2"
-// CHECK-DAG: attributes [[NUM_SGPR_32]] = { convergent noinline nounwind optnone "amdgpu-num-sgpr"="32"
-// CHECK-DAG: attributes [[NUM_VGPR_64]] = { convergent noinline nounwind optnone "amdgpu-num-vgpr"="64"
+// DEFAULT-DAG: attributes [[FLAT_WORK_GROUP_SIZE_DEFAULT]] = {{.*}}"amdgpu-flat-work-group-size"="1,256"
+// MAX1024-DAG: attributes [[FLAT_WORK_GROUP_SIZE_DEFAULT]] = {{.*}}"amdgpu-flat-work-group-size"="1,1024"
+// CHECK-DAG: attributes [[FLAT_WORK_GROUP_SIZE_32_64]] = {{.*}}"amdgpu-flat-work-group-size"="32,64"
+// CHECK-DAG: attributes [[WAVES_PER_EU_2]] = {{.*}}"amdgpu-waves-per-eu"="2"
+// CHECK-DAG: attributes [[NUM_SGPR_32]] = {{.*}}"amdgpu-num-sgpr"="32"
+// CHECK-DAG: attributes [[NUM_VGPR_64]] = {{.*}}"amdgpu-num-vgpr"="64"
diff --git a/src/llvm-project/clang/test/CodeGenCUDA/amdgpu-visibility.cu b/src/llvm-project/clang/test/CodeGenCUDA/amdgpu-visibility.cu
index 9f44eb0..f23e562 100644
--- a/src/llvm-project/clang/test/CodeGenCUDA/amdgpu-visibility.cu
+++ b/src/llvm-project/clang/test/CodeGenCUDA/amdgpu-visibility.cu
@@ -13,6 +13,16 @@
__constant__ int c;
__device__ int g;
+// CHECK-DEFAULT: @e = external addrspace(1) global
+// CHECK-PROTECTED: @e = external protected addrspace(1) global
+// CHECK-HIDDEN: @e = external protected addrspace(1) global
+extern __device__ int e;
+
+// dummy one to hold reference to `e`.
+__device__ int f() {
+ return e;
+}
+
// CHECK-DEFAULT: define amdgpu_kernel void @_Z3foov()
// CHECK-PROTECTED: define protected amdgpu_kernel void @_Z3foov()
// CHECK-HIDDEN: define protected amdgpu_kernel void @_Z3foov()
diff --git a/src/llvm-project/clang/test/CodeGenCUDA/device-init-fun.cu b/src/llvm-project/clang/test/CodeGenCUDA/device-init-fun.cu
new file mode 100644
index 0000000..4f3119a
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCUDA/device-init-fun.cu
@@ -0,0 +1,19 @@
+// REQUIRES: amdgpu-registered-target
+
+// RUN: %clang_cc1 -triple amdgcn -fcuda-is-device -std=c++11 \
+// RUN: -fgpu-allow-device-init -x hip \
+// RUN: -fno-threadsafe-statics -emit-llvm -o - %s \
+// RUN: | FileCheck %s
+
+#include "Inputs/cuda.h"
+
+// CHECK: define internal amdgpu_kernel void @_GLOBAL__sub_I_device_init_fun.cu() #[[ATTR:[0-9]*]]
+// CHECK: attributes #[[ATTR]] = {{.*}}"device-init"
+
+__device__ void f();
+
+struct A {
+ __device__ A() { f(); }
+};
+
+__device__ A a;
diff --git a/src/llvm-project/clang/test/CodeGenCUDA/kernel-amdgcn.cu b/src/llvm-project/clang/test/CodeGenCUDA/kernel-amdgcn.cu
index ffa6c95..135d303 100644
--- a/src/llvm-project/clang/test/CodeGenCUDA/kernel-amdgcn.cu
+++ b/src/llvm-project/clang/test/CodeGenCUDA/kernel-amdgcn.cu
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple amdgcn -fcuda-is-device -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple amdgcn -fcuda-is-device -emit-llvm -x hip %s -o - | FileCheck %s
#include "Inputs/cuda.h"
// CHECK: define amdgpu_kernel void @_ZN1A6kernelEv
@@ -25,7 +25,7 @@
EmptyKernelPtr Empty() { return EmptyKernel<void>; }
};
-// CHECK: define amdgpu_kernel void @_Z15template_kernelI1AEvT_
+// CHECK: define amdgpu_kernel void @_Z15template_kernelI1AEvT_{{.*}} #[[ATTR:[0-9][0-9]*]]
template<class T>
__global__ void template_kernel(T x) {}
@@ -39,3 +39,4 @@
launch((void*)D.Empty());
return 0;
}
+// CHECK: attributes #[[ATTR]] = {{.*}}"amdgpu-flat-work-group-size"="1,256"
diff --git a/src/llvm-project/clang/test/CodeGenCUDA/kernel-call.cu b/src/llvm-project/clang/test/CodeGenCUDA/kernel-call.cu
index ed48a6cc..b76f2c1 100644
--- a/src/llvm-project/clang/test/CodeGenCUDA/kernel-call.cu
+++ b/src/llvm-project/clang/test/CodeGenCUDA/kernel-call.cu
@@ -3,14 +3,17 @@
// RUN: %clang_cc1 -target-sdk-version=9.2 -emit-llvm %s -o - \
// RUN: | FileCheck %s --check-prefixes=CUDA-NEW,CHECK
// RUN: %clang_cc1 -x hip -emit-llvm %s -o - \
-// RUN: | FileCheck %s --check-prefixes=HIP,CHECK
-
+// RUN: | FileCheck %s --check-prefixes=HIP-OLD,CHECK
+// RUN: %clang_cc1 -fhip-new-launch-api -x hip -emit-llvm %s -o - \
+// RUN: | FileCheck %s --check-prefixes=HIP-NEW,CHECK
#include "Inputs/cuda.h"
// CHECK-LABEL: define{{.*}}g1
-// HIP: call{{.*}}hipSetupArgument
-// HIP: call{{.*}}hipLaunchByPtr
+// HIP-OLD: call{{.*}}hipSetupArgument
+// HIP-OLD: call{{.*}}hipLaunchByPtr
+// HIP-NEW: call{{.*}}__hipPopCallConfiguration
+// HIP-NEW: call{{.*}}hipLaunchKernel
// CUDA-OLD: call{{.*}}cudaSetupArgument
// CUDA-OLD: call{{.*}}cudaLaunch
// CUDA-NEW: call{{.*}}__cudaPopCallConfiguration
@@ -19,7 +22,8 @@
// CHECK-LABEL: define{{.*}}main
int main(void) {
- // HIP: call{{.*}}hipConfigureCall
+ // HIP-OLD: call{{.*}}hipConfigureCall
+ // HIP-NEW: call{{.*}}__hipPushCallConfiguration
// CUDA-OLD: call{{.*}}cudaConfigureCall
// CUDA-NEW: call{{.*}}__cudaPushCallConfiguration
// CHECK: icmp
diff --git a/src/llvm-project/clang/test/CodeGenCUDA/ms-linker-options.cu b/src/llvm-project/clang/test/CodeGenCUDA/ms-linker-options.cu
new file mode 100644
index 0000000..0be25fb
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCUDA/ms-linker-options.cu
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 -emit-llvm -o - -fcuda-is-device -fms-extensions -x hip %s \
+// RUN: -fno-autolink -triple amdgcn-amd-amdhsa \
+// RUN: | FileCheck -check-prefix=DEV %s
+// RUN: %clang_cc1 -emit-llvm -o - -fms-extensions -x hip %s -triple \
+// RUN: x86_64-pc-windows-msvc | FileCheck -check-prefix=HOST %s
+// RUN: %clang_cc1 -emit-llvm -o - -fcuda-is-device -fms-extensions %s \
+// RUN: -fno-autolink -triple amdgcn-amd-amdhsa \
+// RUN: | FileCheck -check-prefix=DEV %s
+// RUN: %clang_cc1 -emit-llvm -o - -fms-extensions %s -triple \
+// RUN: x86_64-pc-windows-msvc | FileCheck -check-prefix=HOST %s
+
+// DEV-NOT: llvm.linker.options
+// DEV-NOT: llvm.dependent-libraries
+// HOST: lvm.linker.options
+// HOST: "/DEFAULTLIB:libcpmt.lib"
+// HOST: "/FAILIFMISMATCH:\22myLib_version=9\22"
+
+#pragma comment(lib, "libcpmt")
+#pragma detect_mismatch("myLib_version", "9")
diff --git a/src/llvm-project/clang/test/CodeGenCUDA/openmp-target.cu b/src/llvm-project/clang/test/CodeGenCUDA/openmp-target.cu
new file mode 100644
index 0000000..869bde6
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCUDA/openmp-target.cu
@@ -0,0 +1,20 @@
+// REQUIRES: x86-registered-target
+// REQUIRES: nvptx-registered-target
+
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm \
+// RUN: -fopenmp -fopenmp-version=50 -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm \
+// RUN: -fopenmp -fopenmp-version=50 -o - -x c++ %s | FileCheck %s
+// RUN: %clang_cc1 -triple nvptx64-nvidia-cuda -fcuda-is-device \
+// RUN: -emit-llvm -o - %s | FileCheck -check-prefixes=DEV %s
+
+// CHECK: declare{{.*}}@_Z7nohost1v()
+// DEV-NOT: _Z7nohost1v
+void nohost1() {}
+#pragma omp declare target to(nohost1) device_type(nohost)
+
+// CHECK: declare{{.*}}@_Z7nohost2v()
+// DEV-NOT: _Z7nohost2v
+void nohost2() {nohost1();}
+#pragma omp declare target to(nohost2) device_type(nohost)
+
diff --git a/src/llvm-project/clang/test/CodeGenCUDA/propagate-metadata.cu b/src/llvm-project/clang/test/CodeGenCUDA/propagate-metadata.cu
index 773dd8a..52c88d3 100644
--- a/src/llvm-project/clang/test/CodeGenCUDA/propagate-metadata.cu
+++ b/src/llvm-project/clang/test/CodeGenCUDA/propagate-metadata.cu
@@ -11,7 +11,7 @@
// Build the bitcode library. This is not built in CUDA mode, otherwise it
// might have incompatible attributes. This mirrors how libdevice is built.
-// RUN: %clang_cc1 -x c++ -emit-llvm-bc -ftrapping-math -DLIB \
+// RUN: %clang_cc1 -x c++ -fconvergent-functions -emit-llvm-bc -ftrapping-math -DLIB \
// RUN: %s -o %t.bc -triple nvptx-unknown-unknown
// RUN: %clang_cc1 -x cuda %s -emit-llvm -mlink-builtin-bitcode %t.bc -o - \
@@ -53,7 +53,8 @@
// Check the attribute list.
// CHECK: attributes [[attr]] = {
-// CHECK: "no-trapping-math"="true"
+// CHECK-SAME: convergent
+// CHECK-SAME: "no-trapping-math"="true"
// FTZ-SAME: "nvptx-f32ftz"="true"
// NOFTZ-NOT: "nvptx-f32ftz"="true"
diff --git a/src/llvm-project/clang/test/CodeGenCUDA/unnamed-types.cu b/src/llvm-project/clang/test/CodeGenCUDA/unnamed-types.cu
new file mode 100644
index 0000000..8155781
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCUDA/unnamed-types.cu
@@ -0,0 +1,39 @@
+// RUN: %clang_cc1 -std=c++11 -x hip -triple x86_64-linux-gnu -aux-triple amdgcn-amd-amdhsa -emit-llvm %s -o - | FileCheck %s --check-prefix=HOST
+// RUN: %clang_cc1 -std=c++11 -x hip -triple amdgcn-amd-amdhsa -fcuda-is-device -emit-llvm %s -o - | FileCheck %s --check-prefix=DEVICE
+
+#include "Inputs/cuda.h"
+
+// HOST: @0 = private unnamed_addr constant [43 x i8] c"_Z2k0IZZ2f1PfENKUlS0_E_clES0_EUlfE_EvS0_T_\00", align 1
+
+__device__ float d0(float x) {
+ return [](float x) { return x + 2.f; }(x);
+}
+
+__device__ float d1(float x) {
+ return [](float x) { return x * 2.f; }(x);
+}
+
+// DEVICE: amdgpu_kernel void @_Z2k0IZZ2f1PfENKUlS0_E_clES0_EUlfE_EvS0_T_(
+template <typename F>
+__global__ void k0(float *p, F f) {
+ p[0] = f(p[0]) + d0(p[1]) + d1(p[2]);
+}
+
+void f0(float *p) {
+ [](float *p) {
+ *p = 1.f;
+ }(p);
+}
+
+// The inner/outer lambdas are required to be mangled following ODR but their
+// linkages are still required to keep the original `internal` linkage.
+
+// HOST: define internal void @_ZZ2f1PfENKUlS_E_clES_(
+// DEVICE: define internal float @_ZZZ2f1PfENKUlS_E_clES_ENKUlfE_clEf(
+void f1(float *p) {
+ [](float *p) {
+ k0<<<1,1>>>(p, [] __device__ (float x) { return x + 1.f; });
+ }(p);
+}
+// HOST: @__hip_register_globals
+// HOST: __hipRegisterFunction{{.*}}@_Z2k0IZZ2f1PfENKUlS0_E_clES0_EUlfE_EvS0_T_{{.*}}@0
diff --git a/src/llvm-project/clang/test/CodeGenCUDA/usual-deallocators.cu b/src/llvm-project/clang/test/CodeGenCUDA/usual-deallocators.cu
index 2d97c8c..7e77524 100644
--- a/src/llvm-project/clang/test/CodeGenCUDA/usual-deallocators.cu
+++ b/src/llvm-project/clang/test/CodeGenCUDA/usual-deallocators.cu
@@ -97,37 +97,37 @@
// Make sure we've picked deallocator for the correct side of compilation.
-// COMMON-LABEL: define linkonce_odr void @_ZN4H1D1dlEPv(i8*)
+// COMMON-LABEL: define linkonce_odr void @_ZN4H1D1dlEPv(i8* %0)
// DEVICE: call void @dev_fn()
// HOST: call void @host_fn()
-// DEVICE-LABEL: define linkonce_odr void @_ZN4H1D2dlEPvj(i8*, i32)
+// DEVICE-LABEL: define linkonce_odr void @_ZN4H1D2dlEPvj(i8* %0, i32 %1)
// DEVICE: call void @dev_fn()
-// HOST-LABEL: define linkonce_odr void @_ZN4H1D2dlEPv(i8*)
+// HOST-LABEL: define linkonce_odr void @_ZN4H1D2dlEPv(i8* %0)
// HOST: call void @host_fn()
-// DEVICE-LABEL: define linkonce_odr void @_ZN4H2D1dlEPv(i8*)
+// DEVICE-LABEL: define linkonce_odr void @_ZN4H2D1dlEPv(i8* %0)
// DEVICE: call void @dev_fn()
-// HOST-LABEL: define linkonce_odr void @_ZN4H2D1dlEPvj(i8*, i32)
+// HOST-LABEL: define linkonce_odr void @_ZN4H2D1dlEPvj(i8* %0, i32 %1)
// HOST: call void @host_fn()
-// COMMON-LABEL: define linkonce_odr void @_ZN4H2D2dlEPvj(i8*, i32)
+// COMMON-LABEL: define linkonce_odr void @_ZN4H2D2dlEPvj(i8* %0, i32 %1)
// DEVICE: call void @dev_fn()
// HOST: call void @host_fn()
-// COMMON-LABEL: define linkonce_odr void @_ZN6H1D1D2dlEPv(i8*)
+// COMMON-LABEL: define linkonce_odr void @_ZN6H1D1D2dlEPv(i8* %0)
// DEVICE: call void @dev_fn()
// HOST: call void @host_fn()
-// COMMON-LABEL: define linkonce_odr void @_ZN6H1H2D1dlEPv(i8*)
+// COMMON-LABEL: define linkonce_odr void @_ZN6H1H2D1dlEPv(i8* %0)
// DEVICE: call void @dev_fn()
// HOST: call void @host_fn()
-// DEVICE-LABEL: define linkonce_odr void @_ZN6H1H2D2dlEPvj(i8*, i32)
+// DEVICE-LABEL: define linkonce_odr void @_ZN6H1H2D2dlEPvj(i8* %0, i32 %1)
// DEVICE: call void @dev_fn()
-// HOST-LABEL: define linkonce_odr void @_ZN6H1H2D2dlEPv(i8*)
+// HOST-LABEL: define linkonce_odr void @_ZN6H1H2D2dlEPv(i8* %0)
// HOST: call void @host_fn()
-// COMMON-LABEL: define linkonce_odr void @_ZN8H1H2D1D2dlEPv(i8*)
+// COMMON-LABEL: define linkonce_odr void @_ZN8H1H2D1D2dlEPv(i8* %0)
// DEVICE: call void @dev_fn()
// HOST: call void @host_fn()
diff --git a/src/llvm-project/clang/test/CodeGenCXX/ARM/exception-alignment.cpp b/src/llvm-project/clang/test/CodeGenCXX/ARM/exception-alignment.cpp
new file mode 100644
index 0000000..8fd08df
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCXX/ARM/exception-alignment.cpp
@@ -0,0 +1,21 @@
+// Bug: https://bugs.llvm.org/show_bug.cgi?id=42668
+// REQUIRES: arm-registered-target
+
+// RUN: %clang_cc1 -triple armv8-arm-none-eabi -emit-llvm -target-cpu generic -Os -fcxx-exceptions -o - -x c++ %s | FileCheck --check-prefixes=CHECK,A8 %s
+// RUN: %clang_cc1 -triple armv8-unknown-linux-android -emit-llvm -target-cpu generic -Os -fcxx-exceptions -o - -x c++ %s | FileCheck --check-prefixes=CHECK,A16 %s
+
+// CHECK: [[E:%[A-z0-9]+]] = tail call i8* @__cxa_allocate_exception
+// CHECK-NEXT: [[BC:%[A-z0-9]+]] = bitcast i8* [[E]] to <2 x i64>*
+// A8-NEXT: store <2 x i64> <i64 1, i64 2>, <2 x i64>* [[BC]], align 8
+// A16-NEXT: store <2 x i64> <i64 1, i64 2>, <2 x i64>* [[BC]], align 16
+#include <arm_neon.h>
+
+int main(void) {
+ try {
+ throw vld1q_u64(((const uint64_t[2]){1, 2}));
+ } catch (uint64x2_t exc) {
+ return 0;
+ }
+ return 1;
+}
+
diff --git a/src/llvm-project/clang/test/CodeGenCXX/Inputs/profile-remap-error.map b/src/llvm-project/clang/test/CodeGenCXX/Inputs/profile-remap-error.map
new file mode 100644
index 0000000..feb6ce7
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCXX/Inputs/profile-remap-error.map
@@ -0,0 +1 @@
+name unmangled ignored
diff --git a/src/llvm-project/clang/test/CodeGenCXX/Inputs/std-compare.h b/src/llvm-project/clang/test/CodeGenCXX/Inputs/std-compare.h
index a6ab605..eaf7951 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/Inputs/std-compare.h
+++ b/src/llvm-project/clang/test/CodeGenCXX/Inputs/std-compare.h
@@ -6,11 +6,8 @@
// exposition only
enum class _EqResult : unsigned char {
- __zero = 0,
- __equal = __zero,
+ __equal = 0,
__equiv = __equal,
- __nonequal = 1,
- __nonequiv = __nonequal
};
enum class _OrdResult : signed char {
@@ -25,108 +22,6 @@
struct _CmpUnspecifiedType;
using _CmpUnspecifiedParam = void (_CmpUnspecifiedType::*)();
-class weak_equality {
- constexpr explicit weak_equality(_EqResult __val) noexcept : __value_(__val) {}
-
-public:
- static const weak_equality equivalent;
- static const weak_equality nonequivalent;
-
- friend constexpr bool operator==(weak_equality __v, _CmpUnspecifiedParam) noexcept;
- friend constexpr bool operator==(_CmpUnspecifiedParam, weak_equality __v) noexcept;
- friend constexpr bool operator!=(weak_equality __v, _CmpUnspecifiedParam) noexcept;
- friend constexpr bool operator!=(_CmpUnspecifiedParam, weak_equality __v) noexcept;
- friend constexpr weak_equality operator<=>(weak_equality __v, _CmpUnspecifiedParam) noexcept;
- friend constexpr weak_equality operator<=>(_CmpUnspecifiedParam, weak_equality __v) noexcept;
-
- // test helper
- constexpr bool test_eq(weak_equality const &other) const noexcept {
- return __value_ == other.__value_;
- }
-
-private:
- _EqResult __value_;
-};
-
-inline constexpr weak_equality weak_equality::equivalent(_EqResult::__equiv);
-inline constexpr weak_equality weak_equality::nonequivalent(_EqResult::__nonequiv);
-inline constexpr bool operator==(weak_equality __v, _CmpUnspecifiedParam) noexcept {
- return __v.__value_ == _EqResult::__zero;
-}
-inline constexpr bool operator==(_CmpUnspecifiedParam, weak_equality __v) noexcept {
- return __v.__value_ == _EqResult::__zero;
-}
-inline constexpr bool operator!=(weak_equality __v, _CmpUnspecifiedParam) noexcept {
- return __v.__value_ != _EqResult::__zero;
-}
-inline constexpr bool operator!=(_CmpUnspecifiedParam, weak_equality __v) noexcept {
- return __v.__value_ != _EqResult::__zero;
-}
-
-inline constexpr weak_equality operator<=>(weak_equality __v, _CmpUnspecifiedParam) noexcept {
- return __v;
-}
-inline constexpr weak_equality operator<=>(_CmpUnspecifiedParam, weak_equality __v) noexcept {
- return __v;
-}
-
-class strong_equality {
- explicit constexpr strong_equality(_EqResult __val) noexcept : __value_(__val) {}
-
-public:
- static const strong_equality equal;
- static const strong_equality nonequal;
- static const strong_equality equivalent;
- static const strong_equality nonequivalent;
-
- // conversion
- constexpr operator weak_equality() const noexcept {
- return __value_ == _EqResult::__zero ? weak_equality::equivalent
- : weak_equality::nonequivalent;
- }
-
- // comparisons
- friend constexpr bool operator==(strong_equality __v, _CmpUnspecifiedParam) noexcept;
- friend constexpr bool operator!=(strong_equality __v, _CmpUnspecifiedParam) noexcept;
- friend constexpr bool operator==(_CmpUnspecifiedParam, strong_equality __v) noexcept;
- friend constexpr bool operator!=(_CmpUnspecifiedParam, strong_equality __v) noexcept;
-
- friend constexpr strong_equality operator<=>(strong_equality __v, _CmpUnspecifiedParam) noexcept;
- friend constexpr strong_equality operator<=>(_CmpUnspecifiedParam, strong_equality __v) noexcept;
-
- // test helper
- constexpr bool test_eq(strong_equality const &other) const noexcept {
- return __value_ == other.__value_;
- }
-
-private:
- _EqResult __value_;
-};
-
-inline constexpr strong_equality strong_equality::equal(_EqResult::__equal);
-inline constexpr strong_equality strong_equality::nonequal(_EqResult::__nonequal);
-inline constexpr strong_equality strong_equality::equivalent(_EqResult::__equiv);
-inline constexpr strong_equality strong_equality::nonequivalent(_EqResult::__nonequiv);
-constexpr bool operator==(strong_equality __v, _CmpUnspecifiedParam) noexcept {
- return __v.__value_ == _EqResult::__zero;
-}
-constexpr bool operator==(_CmpUnspecifiedParam, strong_equality __v) noexcept {
- return __v.__value_ == _EqResult::__zero;
-}
-constexpr bool operator!=(strong_equality __v, _CmpUnspecifiedParam) noexcept {
- return __v.__value_ != _EqResult::__zero;
-}
-constexpr bool operator!=(_CmpUnspecifiedParam, strong_equality __v) noexcept {
- return __v.__value_ != _EqResult::__zero;
-}
-
-constexpr strong_equality operator<=>(strong_equality __v, _CmpUnspecifiedParam) noexcept {
- return __v;
-}
-constexpr strong_equality operator<=>(_CmpUnspecifiedParam, strong_equality __v) noexcept {
- return __v;
-}
-
class partial_ordering {
using _ValueT = signed char;
explicit constexpr partial_ordering(_EqResult __v) noexcept
@@ -147,11 +42,6 @@
static const partial_ordering greater;
static const partial_ordering unordered;
- // conversion
- constexpr operator weak_equality() const noexcept {
- return __value_ == 0 ? weak_equality::equivalent : weak_equality::nonequivalent;
- }
-
// comparisons
friend constexpr bool operator==(partial_ordering __v, _CmpUnspecifiedParam) noexcept;
friend constexpr bool operator!=(partial_ordering __v, _CmpUnspecifiedParam) noexcept;
@@ -237,10 +127,6 @@
static const weak_ordering greater;
// conversions
- constexpr operator weak_equality() const noexcept {
- return __value_ == 0 ? weak_equality::equivalent
- : weak_equality::nonequivalent;
- }
constexpr operator partial_ordering() const noexcept {
return __value_ == 0 ? partial_ordering::equivalent
: (__value_ < 0 ? partial_ordering::less : partial_ordering::greater);
@@ -331,14 +217,6 @@
static const strong_ordering greater;
// conversions
- constexpr operator weak_equality() const noexcept {
- return __value_ == 0 ? weak_equality::equivalent
- : weak_equality::nonequivalent;
- }
- constexpr operator strong_equality() const noexcept {
- return __value_ == 0 ? strong_equality::equal
- : strong_equality::nonequal;
- }
constexpr operator partial_ordering() const noexcept {
return __value_ == 0 ? partial_ordering::equivalent
: (__value_ < 0 ? partial_ordering::less : partial_ordering::greater);
@@ -423,14 +301,6 @@
return __v < 0 ? strong_ordering::greater : (__v > 0 ? strong_ordering::less : __v);
}
-// named comparison functions
-constexpr bool is_eq(weak_equality __cmp) noexcept { return __cmp == 0; }
-constexpr bool is_neq(weak_equality __cmp) noexcept { return __cmp != 0; }
-constexpr bool is_lt(partial_ordering __cmp) noexcept { return __cmp < 0; }
-constexpr bool is_lteq(partial_ordering __cmp) noexcept { return __cmp <= 0; }
-constexpr bool is_gt(partial_ordering __cmp) noexcept { return __cmp > 0; }
-constexpr bool is_gteq(partial_ordering __cmp) noexcept { return __cmp >= 0; }
-
} // namespace __1
} // end namespace std
diff --git a/src/llvm-project/clang/test/CodeGenCXX/aarch64-mangle-sve-vectors-msvc.cpp b/src/llvm-project/clang/test/CodeGenCXX/aarch64-mangle-sve-vectors-msvc.cpp
new file mode 100644
index 0000000..55b87da
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCXX/aarch64-mangle-sve-vectors-msvc.cpp
@@ -0,0 +1,7 @@
+// RUN: not %clang_cc1 -triple aarch64-unknown-windows-msvc %s -emit-llvm \
+// RUN: -o - 2>&1 | FileCheck %s
+
+template<typename T> struct S {};
+
+// CHECK: cannot mangle this built-in __SVInt8_t type yet
+void f1(S<__SVInt8_t>) {}
diff --git a/src/llvm-project/clang/test/CodeGenCXX/aarch64-mangle-sve-vectors.cpp b/src/llvm-project/clang/test/CodeGenCXX/aarch64-mangle-sve-vectors.cpp
new file mode 100644
index 0000000..87e38ab
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCXX/aarch64-mangle-sve-vectors.cpp
@@ -0,0 +1,31 @@
+// RUN: %clang_cc1 -triple aarch64-none-linux-gnu %s -emit-llvm -o - \
+// RUN: | FileCheck %s
+// RUN: %clang_cc1 -triple aarch64-none-linux-gnu %s -emit-llvm -o - \
+// RUN: -target-feature +sve | FileCheck %s
+
+template<typename T> struct S {};
+
+// CHECK: _Z2f11SIu10__SVInt8_tE
+void f1(S<__SVInt8_t>) {}
+// CHECK: _Z2f21SIu11__SVInt16_tE
+void f2(S<__SVInt16_t>) {}
+// CHECK: _Z2f31SIu11__SVInt32_tE
+void f3(S<__SVInt32_t>) {}
+// CHECK: _Z2f41SIu11__SVInt64_tE
+void f4(S<__SVInt64_t>) {}
+// CHECK: _Z2f51SIu11__SVUint8_tE
+void f5(S<__SVUint8_t>) {}
+// CHECK: _Z2f61SIu12__SVUint16_tE
+void f6(S<__SVUint16_t>) {}
+// CHECK: _Z2f71SIu12__SVUint32_tE
+void f7(S<__SVUint32_t>) {}
+// CHECK: _Z2f81SIu12__SVUint64_tE
+void f8(S<__SVUint64_t>) {}
+// CHECK: _Z2f91SIu13__SVFloat16_tE
+void f9(S<__SVFloat16_t>) {}
+// CHECK: _Z3f101SIu13__SVFloat32_tE
+void f10(S<__SVFloat32_t>) {}
+// CHECK: _Z3f111SIu13__SVFloat64_tE
+void f11(S<__SVFloat64_t>) {}
+// CHECK: _Z3f121SIu10__SVBool_tE
+void f12(S<__SVBool_t>) {}
diff --git a/src/llvm-project/clang/test/CodeGenCXX/aarch64-sve-typeinfo.cpp b/src/llvm-project/clang/test/CodeGenCXX/aarch64-sve-typeinfo.cpp
new file mode 100644
index 0000000..5627efa
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCXX/aarch64-sve-typeinfo.cpp
@@ -0,0 +1,58 @@
+// RUN: %clang_cc1 -triple aarch64-none-linux-gnu %s -emit-llvm -o - \
+// RUN: | FileCheck %s
+// RUN: %clang_cc1 -triple aarch64-none-linux-gnu %s -emit-llvm -o - \
+// RUN: -target-feature +sve | FileCheck %s
+
+namespace std { class type_info; };
+
+auto &s8 = typeid(__SVInt8_t);
+auto &s16 = typeid(__SVInt16_t);
+auto &s32 = typeid(__SVInt32_t);
+auto &s64 = typeid(__SVInt64_t);
+
+auto &u8 = typeid(__SVUint8_t);
+auto &u16 = typeid(__SVUint16_t);
+auto &u32 = typeid(__SVUint32_t);
+auto &u64 = typeid(__SVUint64_t);
+
+auto &f16 = typeid(__SVFloat16_t);
+auto &f32 = typeid(__SVFloat32_t);
+auto &f64 = typeid(__SVFloat64_t);
+
+auto &b8 = typeid(__SVBool_t);
+
+// CHECK-DAG: @_ZTSu10__SVInt8_t = {{.*}} c"u10__SVInt8_t\00"
+// CHECK-DAG: @_ZTIu10__SVInt8_t = {{.*}} @_ZTVN10__cxxabiv123__fundamental_type_infoE, {{.*}} @_ZTSu10__SVInt8_t
+
+// CHECK-DAG: @_ZTSu11__SVInt16_t = {{.*}} c"u11__SVInt16_t\00"
+// CHECK-DAG: @_ZTIu11__SVInt16_t = {{.*}} @_ZTVN10__cxxabiv123__fundamental_type_infoE, {{.*}} @_ZTSu11__SVInt16_t
+
+// CHECK-DAG: @_ZTSu11__SVInt32_t = {{.*}} c"u11__SVInt32_t\00"
+// CHECK-DAG: @_ZTIu11__SVInt32_t = {{.*}} @_ZTVN10__cxxabiv123__fundamental_type_infoE, {{.*}} @_ZTSu11__SVInt32_t
+
+// CHECK-DAG: @_ZTSu11__SVInt64_t = {{.*}} c"u11__SVInt64_t\00"
+// CHECK-DAG: @_ZTIu11__SVInt64_t = {{.*}} @_ZTVN10__cxxabiv123__fundamental_type_infoE, {{.*}} @_ZTSu11__SVInt64_t
+
+// CHECK-DAG: @_ZTSu11__SVUint8_t = {{.*}} c"u11__SVUint8_t\00"
+// CHECK-DAG: @_ZTIu11__SVUint8_t = {{.*}} @_ZTVN10__cxxabiv123__fundamental_type_infoE, {{.*}} @_ZTSu11__SVUint8_t
+
+// CHECK-DAG: @_ZTSu12__SVUint16_t = {{.*}} c"u12__SVUint16_t\00"
+// CHECK-DAG: @_ZTIu12__SVUint16_t = {{.*}} @_ZTVN10__cxxabiv123__fundamental_type_infoE, {{.*}} @_ZTSu12__SVUint16_t
+
+// CHECK-DAG: @_ZTSu12__SVUint32_t = {{.*}} c"u12__SVUint32_t\00"
+// CHECK-DAG: @_ZTIu12__SVUint32_t = {{.*}} @_ZTVN10__cxxabiv123__fundamental_type_infoE, {{.*}} @_ZTSu12__SVUint32_t
+
+// CHECK-DAG: @_ZTSu12__SVUint64_t = {{.*}} c"u12__SVUint64_t\00"
+// CHECK-DAG: @_ZTIu12__SVUint64_t = {{.*}} @_ZTVN10__cxxabiv123__fundamental_type_infoE, {{.*}} @_ZTSu12__SVUint64_t
+
+// CHECK-DAG: @_ZTSu13__SVFloat16_t = {{.*}} c"u13__SVFloat16_t\00"
+// CHECK-DAG: @_ZTIu13__SVFloat16_t = {{.*}} @_ZTVN10__cxxabiv123__fundamental_type_infoE, {{.*}} @_ZTSu13__SVFloat16_t
+
+// CHECK-DAG: @_ZTSu13__SVFloat32_t = {{.*}} c"u13__SVFloat32_t\00"
+// CHECK-DAG: @_ZTIu13__SVFloat32_t = {{.*}} @_ZTVN10__cxxabiv123__fundamental_type_infoE, {{.*}} @_ZTSu13__SVFloat32_t
+
+// CHECK-DAG: @_ZTSu13__SVFloat64_t = {{.*}} c"u13__SVFloat64_t\00"
+// CHECK-DAG: @_ZTIu13__SVFloat64_t = {{.*}} @_ZTVN10__cxxabiv123__fundamental_type_infoE, {{.*}} @_ZTSu13__SVFloat64_t
+
+// CHECK-DAG: @_ZTSu10__SVBool_t = {{.*}} c"u10__SVBool_t\00"
+// CHECK-DAG: @_ZTIu10__SVBool_t = {{.*}} @_ZTVN10__cxxabiv123__fundamental_type_infoE, {{.*}} @_ZTSu10__SVBool_t
diff --git a/src/llvm-project/clang/test/CodeGenCXX/apple-kext.cpp b/src/llvm-project/clang/test/CodeGenCXX/apple-kext.cpp
index 0d7ccfb..990bc14 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/apple-kext.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/apple-kext.cpp
@@ -4,6 +4,25 @@
// CHECK: @llvm.global_ctors = appending global {{.*}} { i32 65535, void ()* [[CTOR0:@.*]], i8* null }
// CHECK: @llvm.global_dtors = appending global {{.*}} { i32 65535, void ()* [[DTOR0:@.*]], i8* null }
+// Check that the base destructor is marked as always_inline when generating
+// code for kext.
+
+namespace testBaseDestructor {
+#pragma clang optimize off
+struct D {
+ virtual ~D();
+};
+
+D::~D() {}
+#pragma clang optimize on
+}
+
+// CHECK: define void @_ZN18testBaseDestructor1DD2Ev({{.*}}) unnamed_addr #[[ATTR0:.*]] align 2 {
+
+// CHECK: define void @_ZN18testBaseDestructor1DD1Ev({{.*}}) unnamed_addr #[[ATTR1:.*]] align 2 {
+
+// CHECK: define void @_ZN18testBaseDestructor1DD0Ev({{.*}}) unnamed_addr #[[ATTR1]] align 2 {
+
// rdar://11241230
namespace test0 {
struct A { A(); ~A(); };
@@ -20,3 +39,6 @@
// CHECK: define internal void [[DTOR0]]()
// CHECK: call void @_ZN5test01AD1Ev([[A]]* @_ZN5test01aE)
// CHECK-NEXT: ret void
+
+// CHECK: attributes #[[ATTR0]] = { alwaysinline nounwind {{.*}} }
+// CHECK: attributes #[[ATTR1]] = { noinline nounwind {{.*}} }
diff --git a/src/llvm-project/clang/test/CodeGenCXX/arm-swiftcall.cpp b/src/llvm-project/clang/test/CodeGenCXX/arm-swiftcall.cpp
index 62a92fc..94d9cd3 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/arm-swiftcall.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/arm-swiftcall.cpp
@@ -63,7 +63,7 @@
// CHECK: [[T2:%.*]] = insertvalue [[UAGG]] [[T1]], float [[THIRD]], 2
// CHECK: [[T3:%.*]] = insertvalue [[UAGG]] [[T2]], float [[FOURTH]], 3
// CHECK: ret [[UAGG]] [[T3]]
-// CHECK-LABEL: define {{.*}} @take_struct_1(i32, i8, float, float)
+// CHECK-LABEL: define {{.*}} @take_struct_1(i32 %0, i8 %1, float %2, float %3)
// CHECK: [[V:%.*]] = alloca [[REC]], align 4
// CHECK: [[CAST_TMP:%.*]] = bitcast [[REC]]* [[V]] to [[AGG]]*
// CHECK: [[T0:%.*]] = getelementptr inbounds [[AGG]], [[AGG]]* [[CAST_TMP]], i32 0, i32 0
diff --git a/src/llvm-project/clang/test/CodeGenCXX/armv7k.cpp b/src/llvm-project/clang/test/CodeGenCXX/armv7k.cpp
index 9b27b65..af1c0c3 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/armv7k.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/armv7k.cpp
@@ -1,6 +1,9 @@
// RUN: %clang_cc1 %s -triple=thumbv7k-apple-watchos -emit-llvm -o - -target-abi aapcs16 | FileCheck %s
// RUN: %clang_cc1 %s -triple=thumbv7k-apple-watchos -emit-llvm -o - -target-abi aapcs16 | FileCheck -check-prefix=CHECK-GLOBALS %s
+// RUN: %clang_cc1 %s -triple=arm64_32-apple-ios -emit-llvm -o - -target-abi darwinpcs | FileCheck %s
+// RUN: %clang_cc1 %s -triple=arm64_32-apple-ios -emit-llvm -o - -target-abi darwinpcs | FileCheck -check-prefix=CHECK-GLOBALS %s
+
// __cxa_guard_acquire argument is 64-bit
// rdar://11540122
struct A {
diff --git a/src/llvm-project/clang/test/CodeGenCXX/atomicinit.cpp b/src/llvm-project/clang/test/CodeGenCXX/atomicinit.cpp
index 85ec745..657ade5 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/atomicinit.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/atomicinit.cpp
@@ -31,7 +31,7 @@
// CHECK-LABEL: define void @_Z11atomic_initR1Ai
void atomic_init(A& a, int i) {
// CHECK-NOT: atomic
- // CHECK: tail call void @_ZN1BC1Ei
+ // CHECK: call void @_ZN1BC1Ei
__c11_atomic_init(&b, B(i));
// CHECK-NEXT: ret void
}
diff --git a/src/llvm-project/clang/test/CodeGenCXX/attr-cpuspecific.cpp b/src/llvm-project/clang/test/CodeGenCXX/attr-cpuspecific.cpp
index bfee49c..efe6921 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/attr-cpuspecific.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/attr-cpuspecific.cpp
@@ -13,13 +13,15 @@
s.Func();
}
-// LINUX: define void (%struct.S*)* @_ZN1S4FuncEv.resolver
+// LINUX: @_ZN1S4FuncEv = weak_odr alias void (%struct.S*), void (%struct.S*)* @_ZN1S4FuncEv.ifunc
+// LINUX: @_ZN1S4FuncEv.ifunc = weak_odr ifunc void (%struct.S*), void (%struct.S*)* ()* @_ZN1S4FuncEv.resolver
+// LINUX: define weak_odr void (%struct.S*)* @_ZN1S4FuncEv.resolver
// LINUX: ret void (%struct.S*)* @_ZN1S4FuncEv.S
// LINUX: ret void (%struct.S*)* @_ZN1S4FuncEv.O
// LINUX: declare void @_ZN1S4FuncEv.S
// LINUX: define linkonce_odr void @_ZN1S4FuncEv.O
-// WINDOWS: define dso_local void @"?Func@S@@QEAAXXZ"(%struct.S*)
+// WINDOWS: define weak_odr dso_local void @"?Func@S@@QEAAXXZ"(%struct.S* %0) comdat
// WINDOWS: musttail call void @"?Func@S@@QEAAXXZ.S"(%struct.S* %0)
// WINDOWS: musttail call void @"?Func@S@@QEAAXXZ.O"(%struct.S* %0)
// WINDOWS: declare dso_local void @"?Func@S@@QEAAXXZ.S"
diff --git a/src/llvm-project/clang/test/CodeGenCXX/attr-no-destroy-d54344.cpp b/src/llvm-project/clang/test/CodeGenCXX/attr-no-destroy-d54344.cpp
index 2e004d6..b03791e 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/attr-no-destroy-d54344.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/attr-no-destroy-d54344.cpp
@@ -14,6 +14,7 @@
class a {
public:
+ a();
~a();
};
class logger_base {
diff --git a/src/llvm-project/clang/test/CodeGenCXX/attr-target-mv-diff-ns.cpp b/src/llvm-project/clang/test/CodeGenCXX/attr-target-mv-diff-ns.cpp
index 77e1ad7..3c47af9b 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/attr-target-mv-diff-ns.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/attr-target-mv-diff-ns.cpp
@@ -18,35 +18,35 @@
return foo(1) + ns::foo(2);
}
-// LINUX: @_Z3fooi.ifunc = ifunc i32 (i32), i32 (i32)* ()* @_Z3fooi.resolver
-// LINUX: @_ZN2ns3fooEi.ifunc = ifunc i32 (i32), i32 (i32)* ()* @_ZN2ns3fooEi.resolver
+// LINUX: @_Z3fooi.ifunc = weak_odr ifunc i32 (i32), i32 (i32)* ()* @_Z3fooi.resolver
+// LINUX: @_ZN2ns3fooEi.ifunc = weak_odr ifunc i32 (i32), i32 (i32)* ()* @_ZN2ns3fooEi.resolver
-// LINUX: define i32 @_Z3fooi.sse4.2(i32)
+// LINUX: define i32 @_Z3fooi.sse4.2(i32 %0)
// LINUX: ret i32 0
-// LINUX: define i32 @_Z3fooi.arch_ivybridge(i32)
+// LINUX: define i32 @_Z3fooi.arch_ivybridge(i32 %0)
// LINUX: ret i32 1
-// LINUX: define i32 @_Z3fooi(i32)
+// LINUX: define i32 @_Z3fooi(i32 %0)
// LINUX: ret i32 2
-// WINDOWS: define dso_local i32 @"?foo@@[email protected]"(i32)
+// WINDOWS: define dso_local i32 @"?foo@@[email protected]"(i32 %0)
// WINDOWS: ret i32 0
-// WINDOWS: define dso_local i32 @"?foo@@[email protected]_ivybridge"(i32)
+// WINDOWS: define dso_local i32 @"?foo@@[email protected]_ivybridge"(i32 %0)
// WINDOWS: ret i32 1
-// WINDOWS: define dso_local i32 @"?foo@@YAHH@Z"(i32)
+// WINDOWS: define dso_local i32 @"?foo@@YAHH@Z"(i32 %0)
// WINDOWS: ret i32 2
-// LINUX: define i32 @_ZN2ns3fooEi.sse4.2(i32)
+// LINUX: define i32 @_ZN2ns3fooEi.sse4.2(i32 %0)
// LINUX: ret i32 0
-// LINUX: define i32 @_ZN2ns3fooEi.arch_ivybridge(i32)
+// LINUX: define i32 @_ZN2ns3fooEi.arch_ivybridge(i32 %0)
// LINUX: ret i32 1
-// LINUX: define i32 @_ZN2ns3fooEi(i32)
+// LINUX: define i32 @_ZN2ns3fooEi(i32 %0)
// LINUX: ret i32 2
-// WINDOWS: define dso_local i32 @"?foo@ns@@[email protected]"(i32)
+// WINDOWS: define dso_local i32 @"?foo@ns@@[email protected]"(i32 %0)
// WINDOWS: ret i32 0
-// WINDOWS: define dso_local i32 @"?foo@ns@@[email protected]_ivybridge"(i32)
+// WINDOWS: define dso_local i32 @"?foo@ns@@[email protected]_ivybridge"(i32 %0)
// WINDOWS: ret i32 1
-// WINDOWS: define dso_local i32 @"?foo@ns@@YAHH@Z"(i32)
+// WINDOWS: define dso_local i32 @"?foo@ns@@YAHH@Z"(i32 %0)
// WINDOWS: ret i32 2
// LINUX: define i32 @_Z3barv()
@@ -57,25 +57,25 @@
// WINDOWS: call i32 @"?foo@@[email protected]"(i32 1)
// WINDOWS: call i32 @"?foo@ns@@[email protected]"(i32 2)
-// LINUX: define i32 (i32)* @_Z3fooi.resolver() comdat
+// LINUX: define weak_odr i32 (i32)* @_Z3fooi.resolver() comdat
// LINUX: ret i32 (i32)* @_Z3fooi.arch_sandybridge
// LINUX: ret i32 (i32)* @_Z3fooi.arch_ivybridge
// LINUX: ret i32 (i32)* @_Z3fooi.sse4.2
// LINUX: ret i32 (i32)* @_Z3fooi
-// WINDOWS: define dso_local i32 @"?foo@@[email protected]"(i32) comdat
+// WINDOWS: define weak_odr dso_local i32 @"?foo@@[email protected]"(i32 %0) comdat
// WINDOWS: call i32 @"?foo@@[email protected]_sandybridge"(i32 %0)
// WINDOWS: call i32 @"?foo@@[email protected]_ivybridge"(i32 %0)
// WINDOWS: call i32 @"?foo@@[email protected]"(i32 %0)
// WINDOWS: call i32 @"?foo@@YAHH@Z"(i32 %0)
-// LINUX: define i32 (i32)* @_ZN2ns3fooEi.resolver() comdat
+// LINUX: define weak_odr i32 (i32)* @_ZN2ns3fooEi.resolver() comdat
// LINUX: ret i32 (i32)* @_ZN2ns3fooEi.arch_sandybridge
// LINUX: ret i32 (i32)* @_ZN2ns3fooEi.arch_ivybridge
// LINUX: ret i32 (i32)* @_ZN2ns3fooEi.sse4.2
// LINUX: ret i32 (i32)* @_ZN2ns3fooEi
-// WINDOWS: define dso_local i32 @"?foo@ns@@[email protected]"(i32) comdat
+// WINDOWS: define weak_odr dso_local i32 @"?foo@ns@@[email protected]"(i32 %0) comdat
// WINDOWS: call i32 @"?foo@ns@@[email protected]_sandybridge"(i32 %0)
// WINDOWS: call i32 @"?foo@ns@@[email protected]_ivybridge"(i32 %0)
// WINDOWS: call i32 @"?foo@ns@@[email protected]"(i32 %0)
diff --git a/src/llvm-project/clang/test/CodeGenCXX/attr-target-mv-inalloca.cpp b/src/llvm-project/clang/test/CodeGenCXX/attr-target-mv-inalloca.cpp
index 0b65622..a611587 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/attr-target-mv-inalloca.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/attr-target-mv-inalloca.cpp
@@ -16,20 +16,20 @@
bar(f);
}
-// WINDOWS: define dso_local i32 @"?bar@@YAHUFoo@@@Z"(<{ %struct.Foo }>* inalloca)
+// WINDOWS: define dso_local i32 @"?bar@@YAHUFoo@@@Z"(<{ %struct.Foo }>* inalloca %0)
// WINDOWS: %[[O:[0-9a-zA-Z]+]] = getelementptr inbounds <{ %struct.Foo }>, <{ %struct.Foo }>* %0, i32 0, i32 0
// WINDOWS: %[[X:[0-9a-zA-Z]+]] = getelementptr inbounds %struct.Foo, %struct.Foo* %[[O]], i32 0, i32 0
// WINDOWS: %[[LOAD:[0-9a-zA-Z]+]] = load i32, i32* %[[X]]
// WINDOWS: ret i32 %[[LOAD]]
-// WINDOWS: define dso_local i32 @"?bar@@YAHUFoo@@@Z.sse4.2"(<{ %struct.Foo }>* inalloca)
+// WINDOWS: define dso_local i32 @"?bar@@YAHUFoo@@@Z.sse4.2"(<{ %struct.Foo }>* inalloca %0)
// WINDOWS: %[[O:[0-9a-zA-Z]+]] = getelementptr inbounds <{ %struct.Foo }>, <{ %struct.Foo }>* %0, i32 0, i32 0
// WINDOWS: %[[X:[0-9a-zA-Z]+]] = getelementptr inbounds %struct.Foo, %struct.Foo* %[[O]], i32 0, i32 0
// WINDOWS: %[[LOAD:[0-9a-zA-Z]+]] = load i32, i32* %[[X]]
// WINDOWS: %[[ADD:[0-9a-zA-Z]+]] = add nsw i32 %[[LOAD]], 1
// WINDOWS: ret i32 %[[ADD]]
-// WINDOWS: define dso_local i32 @"?bar@@YAHUFoo@@@Z.arch_ivybridge"(<{ %struct.Foo }>* inalloca)
+// WINDOWS: define dso_local i32 @"?bar@@YAHUFoo@@@Z.arch_ivybridge"(<{ %struct.Foo }>* inalloca %0)
// WINDOWS: %[[O:[0-9a-zA-Z]+]] = getelementptr inbounds <{ %struct.Foo }>, <{ %struct.Foo }>* %0, i32 0, i32 0
// WINDOWS: %[[X:[0-9a-zA-Z]+]] = getelementptr inbounds %struct.Foo, %struct.Foo* %[[O]], i32 0, i32 0
// WINDOWS: %[[LOAD:[0-9a-zA-Z]+]] = load i32, i32* %[[X]]
@@ -41,7 +41,7 @@
// WINDOWS: %[[ARGMEM:[0-9a-zA-Z]+]] = alloca inalloca <{ %struct.Foo }>
// WINDOWS: %[[CALL:[0-9a-zA-Z]+]] = call i32 @"?bar@@YAHUFoo@@@Z.resolver"(<{ %struct.Foo }>* inalloca %[[ARGMEM]])
-// WINDOWS: define dso_local i32 @"?bar@@YAHUFoo@@@Z.resolver"(<{ %struct.Foo }>*)
+// WINDOWS: define weak_odr dso_local i32 @"?bar@@YAHUFoo@@@Z.resolver"(<{ %struct.Foo }>* %0)
// WINDOWS: %[[RET:[0-9a-zA-Z]+]] = musttail call i32 @"?bar@@YAHUFoo@@@Z.arch_ivybridge"(<{ %struct.Foo }>* %0)
// WINDOWS-NEXT: ret i32 %[[RET]]
// WINDOWS: %[[RET:[0-9a-zA-Z]+]] = musttail call i32 @"?bar@@YAHUFoo@@@Z.sse4.2"(<{ %struct.Foo }>* %0)
@@ -72,7 +72,7 @@
// WINDOWS64: %[[ARG:[0-9a-zA-Z.]+]] = alloca %struct.Foo
// WINDOWS64: %[[CALL:[0-9a-zA-Z]+]] = call i32 @"?bar@@YAHUFoo@@@Z.resolver"(%struct.Foo* %[[ARG]])
-// WINDOWS64: define dso_local i32 @"?bar@@YAHUFoo@@@Z.resolver"(%struct.Foo*)
+// WINDOWS64: define weak_odr dso_local i32 @"?bar@@YAHUFoo@@@Z.resolver"(%struct.Foo* %0)
// WINDOWS64: %[[RET:[0-9a-zA-Z]+]] = musttail call i32 @"?bar@@YAHUFoo@@@Z.arch_ivybridge"(%struct.Foo* %0)
// WINDOWS64-NEXT: ret i32 %[[RET]]
// WINDOWS64: %[[RET:[0-9a-zA-Z]+]] = musttail call i32 @"?bar@@YAHUFoo@@@Z.sse4.2"(%struct.Foo* %0)
diff --git a/src/llvm-project/clang/test/CodeGenCXX/attr-target-mv-member-funcs.cpp b/src/llvm-project/clang/test/CodeGenCXX/attr-target-mv-member-funcs.cpp
index a63737e..692a250 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/attr-target-mv-member-funcs.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/attr-target-mv-member-funcs.cpp
@@ -65,13 +65,13 @@
return a.foo(1) + b.foo(2);
}
-// LINUX: @_ZN1SaSERKS_.ifunc = ifunc %struct.S* (%struct.S*, %struct.S*), %struct.S* (%struct.S*, %struct.S*)* ()* @_ZN1SaSERKS_.resolver
-// LINUX: @_ZNK9ConvertTocv1SEv.ifunc = ifunc void (%struct.ConvertTo*), void (%struct.ConvertTo*)* ()* @_ZNK9ConvertTocv1SEv.resolver
-// LINUX: @_ZN1S3fooEi.ifunc = ifunc i32 (%struct.S*, i32), i32 (%struct.S*, i32)* ()* @_ZN1S3fooEi.resolver
-// LINUX: @_ZN2S23fooEi.ifunc = ifunc i32 (%struct.S2*, i32), i32 (%struct.S2*, i32)* ()* @_ZN2S23fooEi.resolver
+// LINUX: @_ZN1SaSERKS_.ifunc = weak_odr ifunc %struct.S* (%struct.S*, %struct.S*), %struct.S* (%struct.S*, %struct.S*)* ()* @_ZN1SaSERKS_.resolver
+// LINUX: @_ZNK9ConvertTocv1SEv.ifunc = weak_odr ifunc void (%struct.ConvertTo*), void (%struct.ConvertTo*)* ()* @_ZNK9ConvertTocv1SEv.resolver
+// LINUX: @_ZN1S3fooEi.ifunc = weak_odr ifunc i32 (%struct.S*, i32), i32 (%struct.S*, i32)* ()* @_ZN1S3fooEi.resolver
+// LINUX: @_ZN2S23fooEi.ifunc = weak_odr ifunc i32 (%struct.S2*, i32), i32 (%struct.S2*, i32)* ()* @_ZN2S23fooEi.resolver
// Templates:
-// LINUX: @_ZN5templIiE3fooEi.ifunc = ifunc i32 (%struct.templ*, i32), i32 (%struct.templ*, i32)* ()* @_ZN5templIiE3fooEi.resolver
-// LINUX: @_ZN5templIdE3fooEi.ifunc = ifunc i32 (%struct.templ.0*, i32), i32 (%struct.templ.0*, i32)* ()* @_ZN5templIdE3fooEi.resolver
+// LINUX: @_ZN5templIiE3fooEi.ifunc = weak_odr ifunc i32 (%struct.templ*, i32), i32 (%struct.templ*, i32)* ()* @_ZN5templIiE3fooEi.resolver
+// LINUX: @_ZN5templIdE3fooEi.ifunc = weak_odr ifunc i32 (%struct.templ.0*, i32), i32 (%struct.templ.0*, i32)* ()* @_ZN5templIdE3fooEi.resolver
// LINUX: define i32 @_Z3barv()
// LINUX: %s = alloca %struct.S, align 1
@@ -91,29 +91,29 @@
// WINDOWS: call dereferenceable(1) %struct.S* @"??4S@@QEAAAEAU0@AEBU0@@Z.resolver"(%struct.S* %s2
// WINDOWS: call i32 @"?foo@S@@[email protected]"(%struct.S* %s, i32 0)
-// LINUX: define %struct.S* (%struct.S*, %struct.S*)* @_ZN1SaSERKS_.resolver() comdat
+// LINUX: define weak_odr %struct.S* (%struct.S*, %struct.S*)* @_ZN1SaSERKS_.resolver() comdat
// LINUX: ret %struct.S* (%struct.S*, %struct.S*)* @_ZN1SaSERKS_.arch_ivybridge
// LINUX: ret %struct.S* (%struct.S*, %struct.S*)* @_ZN1SaSERKS_
-// WINDOWS: define dso_local %struct.S* @"??4S@@QEAAAEAU0@AEBU0@@Z.resolver"(%struct.S*, %struct.S*)
+// WINDOWS: define weak_odr dso_local %struct.S* @"??4S@@QEAAAEAU0@AEBU0@@Z.resolver"(%struct.S* %0, %struct.S* %1)
// WINDOWS: call %struct.S* @"??4S@@QEAAAEAU0@AEBU0@@Z.arch_ivybridge"
// WINDOWS: call %struct.S* @"??4S@@QEAAAEAU0@AEBU0@@Z"
-// LINUX: define void (%struct.ConvertTo*)* @_ZNK9ConvertTocv1SEv.resolver() comdat
+// LINUX: define weak_odr void (%struct.ConvertTo*)* @_ZNK9ConvertTocv1SEv.resolver() comdat
// LINUX: ret void (%struct.ConvertTo*)* @_ZNK9ConvertTocv1SEv.arch_ivybridge
// LINUX: ret void (%struct.ConvertTo*)* @_ZNK9ConvertTocv1SEv
-// WINDOWS: define dso_local void @"??BConvertTo@@QEBA?AUS@@XZ.resolver"(%struct.ConvertTo*, %struct.S*)
+// WINDOWS: define weak_odr dso_local void @"??BConvertTo@@QEBA?AUS@@XZ.resolver"(%struct.ConvertTo* %0, %struct.S* %1)
// WINDOWS: call void @"??BConvertTo@@QEBA?AUS@@XZ.arch_ivybridge"
// WINDOWS: call void @"??BConvertTo@@QEBA?AUS@@XZ"
-// LINUX: define i32 (%struct.S*, i32)* @_ZN1S3fooEi.resolver() comdat
+// LINUX: define weak_odr i32 (%struct.S*, i32)* @_ZN1S3fooEi.resolver() comdat
// LINUX: ret i32 (%struct.S*, i32)* @_ZN1S3fooEi.arch_sandybridge
// LINUX: ret i32 (%struct.S*, i32)* @_ZN1S3fooEi.arch_ivybridge
// LINUX: ret i32 (%struct.S*, i32)* @_ZN1S3fooEi.sse4.2
// LINUX: ret i32 (%struct.S*, i32)* @_ZN1S3fooEi
-// WINDOWS: define dso_local i32 @"?foo@S@@[email protected]"(%struct.S*, i32)
+// WINDOWS: define weak_odr dso_local i32 @"?foo@S@@[email protected]"(%struct.S* %0, i32 %1)
// WINDOWS: call i32 @"?foo@S@@[email protected]_sandybridge"
// WINDOWS: call i32 @"?foo@S@@[email protected]_ivybridge"
// WINDOWS: call i32 @"?foo@S@@[email protected]"
@@ -125,25 +125,25 @@
// WINDOWS: define dso_local i32 @"?bar2@@YAHXZ"()
// WINDOWS: call i32 @"?foo@S2@@[email protected]"
-// LINUX: define i32 (%struct.S2*, i32)* @_ZN2S23fooEi.resolver() comdat
+// LINUX: define weak_odr i32 (%struct.S2*, i32)* @_ZN2S23fooEi.resolver() comdat
// LINUX: ret i32 (%struct.S2*, i32)* @_ZN2S23fooEi.arch_sandybridge
// LINUX: ret i32 (%struct.S2*, i32)* @_ZN2S23fooEi.arch_ivybridge
// LINUX: ret i32 (%struct.S2*, i32)* @_ZN2S23fooEi.sse4.2
// LINUX: ret i32 (%struct.S2*, i32)* @_ZN2S23fooEi
-// WINDOWS: define dso_local i32 @"?foo@S2@@[email protected]"(%struct.S2*, i32)
+// WINDOWS: define weak_odr dso_local i32 @"?foo@S2@@[email protected]"(%struct.S2* %0, i32 %1)
// WINDOWS: call i32 @"?foo@S2@@[email protected]_sandybridge"
// WINDOWS: call i32 @"?foo@S2@@[email protected]_ivybridge"
// WINDOWS: call i32 @"?foo@S2@@[email protected]"
// WINDOWS: call i32 @"?foo@S2@@QEAAHH@Z"
-// LINUX: define i32 @_ZN2S23fooEi.sse4.2(%struct.S2* %this, i32)
-// LINUX: define i32 @_ZN2S23fooEi.arch_ivybridge(%struct.S2* %this, i32)
-// LINUX: define i32 @_ZN2S23fooEi(%struct.S2* %this, i32)
+// LINUX: define i32 @_ZN2S23fooEi.sse4.2(%struct.S2* %this, i32 %0)
+// LINUX: define i32 @_ZN2S23fooEi.arch_ivybridge(%struct.S2* %this, i32 %0)
+// LINUX: define i32 @_ZN2S23fooEi(%struct.S2* %this, i32 %0)
-// WINDOWS: define dso_local i32 @"?foo@S2@@[email protected]"(%struct.S2* %this, i32)
-// WINDOWS: define dso_local i32 @"?foo@S2@@[email protected]_ivybridge"(%struct.S2* %this, i32)
-// WINDOWS: define dso_local i32 @"?foo@S2@@QEAAHH@Z"(%struct.S2* %this, i32)
+// WINDOWS: define dso_local i32 @"?foo@S2@@[email protected]"(%struct.S2* %this, i32 %0)
+// WINDOWS: define dso_local i32 @"?foo@S2@@[email protected]_ivybridge"(%struct.S2* %this, i32 %0)
+// WINDOWS: define dso_local i32 @"?foo@S2@@QEAAHH@Z"(%struct.S2* %this, i32 %0)
// LINUX: define i32 @_Z9templ_usev()
// LINUX: call i32 @_ZN5templIiE3fooEi.ifunc
@@ -153,50 +153,50 @@
// WINDOWS: call i32 @"?foo@?$templ@H@@[email protected]"
// WINDOWS: call i32 @"?foo@?$templ@N@@[email protected]"
-// LINUX: define i32 (%struct.templ*, i32)* @_ZN5templIiE3fooEi.resolver() comdat
+// LINUX: define weak_odr i32 (%struct.templ*, i32)* @_ZN5templIiE3fooEi.resolver() comdat
// LINUX: ret i32 (%struct.templ*, i32)* @_ZN5templIiE3fooEi.arch_sandybridge
// LINUX: ret i32 (%struct.templ*, i32)* @_ZN5templIiE3fooEi.arch_ivybridge
// LINUX: ret i32 (%struct.templ*, i32)* @_ZN5templIiE3fooEi.sse4.2
// LINUX: ret i32 (%struct.templ*, i32)* @_ZN5templIiE3fooEi
-// WINDOWS: define dso_local i32 @"?foo@?$templ@H@@[email protected]"(%struct.templ*, i32)
+// WINDOWS: define weak_odr dso_local i32 @"?foo@?$templ@H@@[email protected]"(%struct.templ* %0, i32 %1)
// WINDOWS: call i32 @"?foo@?$templ@H@@[email protected]_sandybridge"
// WINDOWS: call i32 @"?foo@?$templ@H@@[email protected]_ivybridge"
// WINDOWS: call i32 @"?foo@?$templ@H@@[email protected]"
// WINDOWS: call i32 @"?foo@?$templ@H@@QEAAHH@Z"
-// LINUX: define i32 (%struct.templ.0*, i32)* @_ZN5templIdE3fooEi.resolver() comdat
+// LINUX: define weak_odr i32 (%struct.templ.0*, i32)* @_ZN5templIdE3fooEi.resolver() comdat
// LINUX: ret i32 (%struct.templ.0*, i32)* @_ZN5templIdE3fooEi.arch_sandybridge
// LINUX: ret i32 (%struct.templ.0*, i32)* @_ZN5templIdE3fooEi.arch_ivybridge
// LINUX: ret i32 (%struct.templ.0*, i32)* @_ZN5templIdE3fooEi.sse4.2
// LINUX: ret i32 (%struct.templ.0*, i32)* @_ZN5templIdE3fooEi
-// WINDOWS: define dso_local i32 @"?foo@?$templ@N@@[email protected]"(%struct.templ.0*, i32) comdat
+// WINDOWS: define weak_odr dso_local i32 @"?foo@?$templ@N@@[email protected]"(%struct.templ.0* %0, i32 %1) comdat
// WINDOWS: call i32 @"?foo@?$templ@N@@[email protected]_sandybridge"
// WINDOWS: call i32 @"?foo@?$templ@N@@[email protected]_ivybridge"
// WINDOWS: call i32 @"?foo@?$templ@N@@[email protected]"
// WINDOWS: call i32 @"?foo@?$templ@N@@QEAAHH@Z"
-// LINUX: define linkonce_odr i32 @_ZN1S3fooEi.sse4.2(%struct.S* %this, i32)
+// LINUX: define linkonce_odr i32 @_ZN1S3fooEi.sse4.2(%struct.S* %this, i32 %0)
// LINUX: ret i32 0
-// WINDOWS: define linkonce_odr dso_local i32 @"?foo@S@@[email protected]"(%struct.S* %this, i32)
+// WINDOWS: define linkonce_odr dso_local i32 @"?foo@S@@[email protected]"(%struct.S* %this, i32 %0)
// WINDOWS: ret i32 0
// LINUX: declare i32 @_ZN1S3fooEi.arch_sandybridge(%struct.S*, i32)
// WINDOWS: declare dso_local i32 @"?foo@S@@[email protected]_sandybridge"(%struct.S*, i32)
-// LINUX: define linkonce_odr i32 @_ZN1S3fooEi.arch_ivybridge(%struct.S* %this, i32)
+// LINUX: define linkonce_odr i32 @_ZN1S3fooEi.arch_ivybridge(%struct.S* %this, i32 %0)
// LINUX: ret i32 1
-// WINDOWS: define linkonce_odr dso_local i32 @"?foo@S@@[email protected]_ivybridge"(%struct.S* %this, i32)
+// WINDOWS: define linkonce_odr dso_local i32 @"?foo@S@@[email protected]_ivybridge"(%struct.S* %this, i32 %0)
// WINDOWS: ret i32 1
-// LINUX: define linkonce_odr i32 @_ZN1S3fooEi(%struct.S* %this, i32)
+// LINUX: define linkonce_odr i32 @_ZN1S3fooEi(%struct.S* %this, i32 %0)
// LINUX: ret i32 2
-// WINDOWS: define linkonce_odr dso_local i32 @"?foo@S@@QEAAHH@Z"(%struct.S* %this, i32)
+// WINDOWS: define linkonce_odr dso_local i32 @"?foo@S@@QEAAHH@Z"(%struct.S* %this, i32 %0)
// WINDOWS: ret i32 2
// LINUX: define linkonce_odr i32 @_ZN5templIiE3fooEi.sse4.2
diff --git a/src/llvm-project/clang/test/CodeGenCXX/attr-target-mv-modules.cpp b/src/llvm-project/clang/test/CodeGenCXX/attr-target-mv-modules.cpp
index 6ff2046..0fa15bf 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/attr-target-mv-modules.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/attr-target-mv-modules.cpp
@@ -22,7 +22,7 @@
void g() { f(); }
// Negative tests to validate that the resolver only calls each 1x.
-// CHECK: define void ()* @_Z1fv.resolver
+// CHECK: define weak_odr void ()* @_Z1fv.resolver
// CHECK: ret void ()* @_Z1fv.sse4.2
// CHECK-NOT: ret void ()* @_Z1fv.sse4.2
// CHECK: ret void ()* @_Z1fv
diff --git a/src/llvm-project/clang/test/CodeGenCXX/attr-target-mv-out-of-line-defs.cpp b/src/llvm-project/clang/test/CodeGenCXX/attr-target-mv-out-of-line-defs.cpp
index 1c051b3..1b9fb8f 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/attr-target-mv-out-of-line-defs.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/attr-target-mv-out-of-line-defs.cpp
@@ -16,24 +16,24 @@
return s.foo(0);
}
-// LINUX: @_ZN1S3fooEi.ifunc = ifunc i32 (%struct.S*, i32), i32 (%struct.S*, i32)* ()* @_ZN1S3fooEi.resolver
+// LINUX: @_ZN1S3fooEi.ifunc = weak_odr ifunc i32 (%struct.S*, i32), i32 (%struct.S*, i32)* ()* @_ZN1S3fooEi.resolver
-// LINUX: define i32 @_ZN1S3fooEi(%struct.S* %this, i32)
+// LINUX: define i32 @_ZN1S3fooEi(%struct.S* %this, i32 %0)
// LINUX: ret i32 2
-// WINDOWS: define dso_local i32 @"?foo@S@@QEAAHH@Z"(%struct.S* %this, i32)
+// WINDOWS: define dso_local i32 @"?foo@S@@QEAAHH@Z"(%struct.S* %this, i32 %0)
// WINDOWS: ret i32 2
-// LINUX: define i32 @_ZN1S3fooEi.sse4.2(%struct.S* %this, i32)
+// LINUX: define i32 @_ZN1S3fooEi.sse4.2(%struct.S* %this, i32 %0)
// LINUX: ret i32 0
-// WINDOWS: define dso_local i32 @"?foo@S@@[email protected]"(%struct.S* %this, i32)
+// WINDOWS: define dso_local i32 @"?foo@S@@[email protected]"(%struct.S* %this, i32 %0)
// WINDOWS: ret i32 0
-// LINUX: define i32 @_ZN1S3fooEi.arch_ivybridge(%struct.S* %this, i32)
+// LINUX: define i32 @_ZN1S3fooEi.arch_ivybridge(%struct.S* %this, i32 %0)
// LINUX: ret i32 1
-// WINDOWS: define dso_local i32 @"?foo@S@@[email protected]_ivybridge"(%struct.S* %this, i32)
+// WINDOWS: define dso_local i32 @"?foo@S@@[email protected]_ivybridge"(%struct.S* %this, i32 %0)
// WINDOWS: ret i32 1
// LINUX: define i32 @_Z3barv()
@@ -44,13 +44,13 @@
// WINDOWS: %s = alloca %struct.S, align 1
// WINDOWS: %call = call i32 @"?foo@S@@[email protected]"(%struct.S* %s, i32 0)
-// LINUX: define i32 (%struct.S*, i32)* @_ZN1S3fooEi.resolver() comdat
+// LINUX: define weak_odr i32 (%struct.S*, i32)* @_ZN1S3fooEi.resolver() comdat
// LINUX: ret i32 (%struct.S*, i32)* @_ZN1S3fooEi.arch_sandybridge
// LINUX: ret i32 (%struct.S*, i32)* @_ZN1S3fooEi.arch_ivybridge
// LINUX: ret i32 (%struct.S*, i32)* @_ZN1S3fooEi.sse4.2
// LINUX: ret i32 (%struct.S*, i32)* @_ZN1S3fooEi
-// WINDOWS: define dso_local i32 @"?foo@S@@[email protected]"(%struct.S*, i32) comdat
+// WINDOWS: define weak_odr dso_local i32 @"?foo@S@@[email protected]"(%struct.S* %0, i32 %1) comdat
// WINDOWS: call i32 @"?foo@S@@[email protected]_sandybridge"(%struct.S* %0, i32 %1)
// WINDOWS: call i32 @"?foo@S@@[email protected]_ivybridge"(%struct.S* %0, i32 %1)
// WINDOWS: call i32 @"?foo@S@@[email protected]"(%struct.S* %0, i32 %1)
diff --git a/src/llvm-project/clang/test/CodeGenCXX/attr-target-mv-overloads.cpp b/src/llvm-project/clang/test/CodeGenCXX/attr-target-mv-overloads.cpp
index a213d24..75350fe 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/attr-target-mv-overloads.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/attr-target-mv-overloads.cpp
@@ -14,14 +14,14 @@
return foo_overload() + foo_overload(1);
}
-// LINUX: @_Z12foo_overloadv.ifunc = ifunc i32 (), i32 ()* ()* @_Z12foo_overloadv.resolver
-// LINUX: @_Z12foo_overloadi.ifunc = ifunc i32 (i32), i32 (i32)* ()* @_Z12foo_overloadi.resolver
+// LINUX: @_Z12foo_overloadv.ifunc = weak_odr ifunc i32 (), i32 ()* ()* @_Z12foo_overloadv.resolver
+// LINUX: @_Z12foo_overloadi.ifunc = weak_odr ifunc i32 (i32), i32 (i32)* ()* @_Z12foo_overloadi.resolver
-// LINUX: define i32 @_Z12foo_overloadi.sse4.2(i32)
+// LINUX: define i32 @_Z12foo_overloadi.sse4.2(i32 %0)
// LINUX: ret i32 0
-// LINUX: define i32 @_Z12foo_overloadi.arch_ivybridge(i32)
+// LINUX: define i32 @_Z12foo_overloadi.arch_ivybridge(i32 %0)
// LINUX: ret i32 1
-// LINUX: define i32 @_Z12foo_overloadi(i32)
+// LINUX: define i32 @_Z12foo_overloadi(i32 %0)
// LINUX: ret i32 2
// LINUX: define i32 @_Z12foo_overloadv.sse4.2()
// LINUX: ret i32 0
@@ -30,11 +30,11 @@
// LINUX: define i32 @_Z12foo_overloadv()
// LINUX: ret i32 2
-// WINDOWS: define dso_local i32 @"?foo_overload@@[email protected]"(i32)
+// WINDOWS: define dso_local i32 @"?foo_overload@@[email protected]"(i32 %0)
// WINDOWS: ret i32 0
-// WINDOWS: define dso_local i32 @"?foo_overload@@[email protected]_ivybridge"(i32)
+// WINDOWS: define dso_local i32 @"?foo_overload@@[email protected]_ivybridge"(i32 %0)
// WINDOWS: ret i32 1
-// WINDOWS: define dso_local i32 @"?foo_overload@@YAHH@Z"(i32)
+// WINDOWS: define dso_local i32 @"?foo_overload@@YAHH@Z"(i32 %0)
// WINDOWS: ret i32 2
// WINDOWS: define dso_local i32 @"?foo_overload@@YAHXZ.sse4.2"()
// WINDOWS: ret i32 0
@@ -51,25 +51,25 @@
// WINDOWS: call i32 @"?foo_overload@@YAHXZ.resolver"()
// WINDOWS: call i32 @"?foo_overload@@[email protected]"(i32 1)
-// LINUX: define i32 ()* @_Z12foo_overloadv.resolver() comdat
+// LINUX: define weak_odr i32 ()* @_Z12foo_overloadv.resolver() comdat
// LINUX: ret i32 ()* @_Z12foo_overloadv.arch_sandybridge
// LINUX: ret i32 ()* @_Z12foo_overloadv.arch_ivybridge
// LINUX: ret i32 ()* @_Z12foo_overloadv.sse4.2
// LINUX: ret i32 ()* @_Z12foo_overloadv
-// WINDOWS: define dso_local i32 @"?foo_overload@@YAHXZ.resolver"() comdat
+// WINDOWS: define weak_odr dso_local i32 @"?foo_overload@@YAHXZ.resolver"() comdat
// WINDOWS: call i32 @"?foo_overload@@YAHXZ.arch_sandybridge"
// WINDOWS: call i32 @"?foo_overload@@YAHXZ.arch_ivybridge"
// WINDOWS: call i32 @"?foo_overload@@YAHXZ.sse4.2"
// WINDOWS: call i32 @"?foo_overload@@YAHXZ"
-// LINUX: define i32 (i32)* @_Z12foo_overloadi.resolver() comdat
+// LINUX: define weak_odr i32 (i32)* @_Z12foo_overloadi.resolver() comdat
// LINUX: ret i32 (i32)* @_Z12foo_overloadi.arch_sandybridge
// LINUX: ret i32 (i32)* @_Z12foo_overloadi.arch_ivybridge
// LINUX: ret i32 (i32)* @_Z12foo_overloadi.sse4.2
// LINUX: ret i32 (i32)* @_Z12foo_overloadi
-// WINDOWS: define dso_local i32 @"?foo_overload@@[email protected]"(i32) comdat
+// WINDOWS: define weak_odr dso_local i32 @"?foo_overload@@[email protected]"(i32 %0) comdat
// WINDOWS: call i32 @"?foo_overload@@[email protected]_sandybridge"
// WINDOWS: call i32 @"?foo_overload@@[email protected]_ivybridge"
// WINDOWS: call i32 @"?foo_overload@@[email protected]"
diff --git a/src/llvm-project/clang/test/CodeGenCXX/auto-var-init.cpp b/src/llvm-project/clang/test/CodeGenCXX/auto-var-init.cpp
index bb52d04..9cd71bd 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/auto-var-init.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/auto-var-init.cpp
@@ -645,7 +645,7 @@
// ZERO-LABEL: @test_smallpartinit_uninit()
// ZERO-O0: call void @llvm.memset{{.*}}, i8 0,
// ZERO-O1-LEGACY: store i16 0, i16* %uninit, align 2
-// ZERO-O1-NEWPM: store i16 42, i16* %uninit, align 2
+// ZERO-O1-NEWPM: store i16 0, i16* %uninit, align 2
TEST_BRACES(smallpartinit, smallpartinit);
// CHECK-LABEL: @test_smallpartinit_braces()
@@ -718,7 +718,7 @@
// PATTERN-LABEL: @test_paddednullinit_uninit()
// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_paddednullinit_uninit.uninit
// PATTERN-O1-LEGACY: store i64 [[I64]], i64* %uninit, align 8
-// PATTERN-O1-NEWPM: store i64 2863311360, i64* %uninit, align 8
+// PATTERN-O1-NEWPM: store i64 [[I64]], i64* %uninit, align 8
// ZERO-LABEL: @test_paddednullinit_uninit()
// ZERO-O0: call void @llvm.memset{{.*}}, i8 0,
// ZERO-O1: store i64 0, i64* %uninit, align 8
@@ -830,7 +830,7 @@
// PATTERN-LABEL: @test_paddedpackednested_uninit()
// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_paddedpackednested_uninit.uninit
// PATTERN-O1: getelementptr
-// PATTERN-O1: call void @llvm.memset.p0i8.i64(i8* nonnull align 1 %0, i8 [[I8]], i64 10, i1 false
+// PATTERN-O1: call void @llvm.memset.p0i8.i64(i8* nonnull align 1 dereferenceable(10) %0, i8 [[I8]], i64 10, i1 false
// ZERO-LABEL: @test_paddedpackednested_uninit()
// ZERO: call void @llvm.memset{{.*}}, i8 0,
@@ -1042,8 +1042,7 @@
// CHECK: %uninit = alloca [4 x i32*], align
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
// PATTERN-O1-LABEL: @test_intptr4_uninit()
-// PATTERN-O1: %1 = bitcast [4 x i32*]* %uninit to i8*
-// PATTERN-O1-NEXT: call void @llvm.memset.p0i8.i64(i8* nonnull align 16 %1, i8 -86, i64 32, i1 false)
+// PATTERN-O1: call void @llvm.memset.p0i8.i64(i8* nonnull align 16 dereferenceable(32) %{{[0-9*]}}, i8 -86, i64 32, i1 false)
// ZERO-LABEL: @test_intptr4_uninit()
// ZERO: call void @llvm.memset{{.*}}, i8 0,
@@ -1345,10 +1344,7 @@
// ZERO-LABEL: @test_virtualderived_uninit()
// ZERO-O0: call void @llvm.memset{{.*}}, i8 0,
// ZERO-O1-LEGACY: call void @llvm.memset{{.*}}, i8 0,
-// ZERO-O1-NEWPM: [[FIELD1:%.*]] = getelementptr inbounds %struct.virtualderived, %struct.virtualderived* %uninit, i64 0, i32 1, i32 0, i32 0
-// ZERO-O1-NEWPM: [[FIELD0:%.*]] = getelementptr inbounds %struct.virtualderived, %struct.virtualderived* %uninit, i64 0, i32 0, i32 0
-// ZERO-O1-NEWPM: store i32 (...)** bitcast (i8** getelementptr inbounds ({ [7 x i8*], [5 x i8*] }, { [7 x i8*], [5 x i8*] }* @_ZTV14virtualderived, i64 0, inrange i32 0, i64 5) to i32 (...)**), i32 (...)*** [[FIELD0]], align 8
-// ZERO-O1-NEWPM: store i32 (...)** bitcast (i8** getelementptr inbounds ({ [7 x i8*], [5 x i8*] }, { [7 x i8*], [5 x i8*] }* @_ZTV14virtualderived, i64 0, inrange i32 1, i64 3) to i32 (...)**), i32 (...)*** [[FIELD1]], align 8
+// ZERO-O1-NEWPM: call void @llvm.memset{{.*}}, i8 0,
TEST_BRACES(virtualderived, virtualderived);
// CHECK-LABEL: @test_virtualderived_braces()
diff --git a/src/llvm-project/clang/test/CodeGenCXX/builtin-bit-cast-no-tbaa.cpp b/src/llvm-project/clang/test/CodeGenCXX/builtin-bit-cast-no-tbaa.cpp
index 3f0e490..b26e519 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/builtin-bit-cast-no-tbaa.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/builtin-bit-cast-no-tbaa.cpp
@@ -15,5 +15,10 @@
// CHECK: load i32, i32* {{.*}}, align 4, !tbaa ![[MAY_ALIAS_TBAA]]
}
+int test_same_type(int &r) {
+ // CHECK: load i32, i32* {{.*}}, align 4, !tbaa ![[MAY_ALIAS_TBAA]]
+ return __builtin_bit_cast(int, r);
+}
+
// CHECK: ![[CHAR_TBAA:.*]] = !{!"omnipotent char", {{.*}}, i64 0}
// CHECK: ![[MAY_ALIAS_TBAA]] = !{![[CHAR_TBAA]], ![[CHAR_TBAA]], i64 0}
diff --git a/src/llvm-project/clang/test/CodeGenCXX/builtins-systemz-zvector.cpp b/src/llvm-project/clang/test/CodeGenCXX/builtins-systemz-zvector.cpp
index aedb30f..f6ce711 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/builtins-systemz-zvector.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/builtins-systemz-zvector.cpp
@@ -1,6 +1,6 @@
// REQUIRES: systemz-registered-target
// RUN: %clang_cc1 -target-cpu z13 -triple s390x-linux-gnu \
-// RUN: -fzvector -fno-lax-vector-conversions -std=c++11 \
+// RUN: -fzvector -flax-vector-conversions=none -std=c++11 \
// RUN: -Wall -Wno-unused -Werror -emit-llvm %s -o - | FileCheck %s
bool gb;
diff --git a/src/llvm-project/clang/test/CodeGenCXX/call-conv-thru-alias.cpp b/src/llvm-project/clang/test/CodeGenCXX/call-conv-thru-alias.cpp
new file mode 100644
index 0000000..5bd5c7d
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCXX/call-conv-thru-alias.cpp
@@ -0,0 +1,21 @@
+// RUN: %clang_cc1 -triple i686-windows-pc -emit-llvm -o - -mconstructor-aliases -O1 -disable-llvm-passes %s | FileCheck %s
+
+struct Base { virtual ~Base(); };
+struct Derived : Base {
+ virtual ~Derived();
+ static Derived inst;
+};
+
+Base::~Base(){}
+Derived::~Derived(){}
+Derived Derived::inst;
+
+// CHECK: @"??1Derived@@UAE@XZ" = dso_local unnamed_addr alias void (%struct.Derived*), bitcast (void (%struct.Base*)* @"??1Base@@UAE@XZ" to void (%struct.Derived*)*)
+
+// CHECK: define dso_local x86_thiscallcc void @"??1Base@@UAE@XZ"
+// CHECK: define internal void @"??__E?inst@Derived@@2U1@A@@YAXXZ"
+// CHECK: call i32 @atexit(void ()* @"??__F?inst@Derived@@2U1@A@@YAXXZ"
+//
+// CHECK: define internal void @"??__F?inst@Derived@@2U1@A@@YAXXZ"
+// CHECK-NEXT: entry:
+// CHECK-NEXT: call x86_thiscallcc void @"??1Derived@@UAE@XZ"
diff --git a/src/llvm-project/clang/test/CodeGenCXX/castexpr-basepathsize-threshold.cpp b/src/llvm-project/clang/test/CodeGenCXX/castexpr-basepathsize-threshold.cpp
index 61272b1..2d5f2e4 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/castexpr-basepathsize-threshold.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/castexpr-basepathsize-threshold.cpp
@@ -3,9 +3,9 @@
// https://bugs.llvm.org/show_bug.cgi?id=38356
// We only check that we do not crash.
-// ASAN increases stack usage, so we are hitting stack overflow before reaching
-// recursive template instantiation limit.
-// XFAIL: darwin && asan
+// This test can exceed stack usage in some configurations, so unless we can
+// properly handle that don't run it.
+// REQUIRES: thread_support
template <typename a, a b(unsigned), int c, unsigned...>
struct d : d<a, b, c - 1> {};
diff --git a/src/llvm-project/clang/test/CodeGenCXX/catch-nullptr-and-nonzero-offset-in-offsetof-idiom.cpp b/src/llvm-project/clang/test/CodeGenCXX/catch-nullptr-and-nonzero-offset-in-offsetof-idiom.cpp
new file mode 100644
index 0000000..9dc8b90
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCXX/catch-nullptr-and-nonzero-offset-in-offsetof-idiom.cpp
@@ -0,0 +1,24 @@
+// RUN: %clang_cc1 -x c++ -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s
+// RUN: %clang_cc1 -x c++ -fsanitize=pointer-overflow -fno-sanitize-recover=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s
+
+#include <stdint.h>
+
+struct S {
+ int x, y;
+};
+
+// CHECK-LABEL: define i64 @{{.*}}get_offset_of_y_naively{{.*}}(
+uintptr_t get_offset_of_y_naively() {
+ // CHECK: [[ENTRY:.*]]:
+ // CHECK-NEXT: ret i64 ptrtoint (i32* getelementptr (i32, i32* null, i32 1) to i64)
+ // CHECK-NEXT: }
+ return ((uintptr_t)(&(((S *)nullptr)->y)));
+}
+
+// CHECK-LABEL: define i64 @{{.*}}get_offset_of_y_via_builtin{{.*}}(
+uintptr_t get_offset_of_y_via_builtin() {
+ // CHECK: [[ENTRY:.*]]:
+ // CHECK-NEXT: ret i64 4
+ // CHECK-NEXT: }
+ return __builtin_offsetof(S, y);
+}
diff --git a/src/llvm-project/clang/test/CodeGenCXX/cfi-multiple-inheritance.cpp b/src/llvm-project/clang/test/CodeGenCXX/cfi-multiple-inheritance.cpp
new file mode 100644
index 0000000..bebf30d
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCXX/cfi-multiple-inheritance.cpp
@@ -0,0 +1,31 @@
+// Test that correct vtable ptr and type metadata are passed to llvm.type.test
+// Related to Bugzilla 43390.
+
+// RUN: %clang_cc1 -triple x86_64-unknown-linux -fvisibility hidden -std=c++11 -fsanitize=cfi-nvcall -emit-llvm -o - %s | FileCheck %s
+
+class A1 {
+public:
+ virtual int f1() = 0;
+};
+
+class A2 {
+public:
+ virtual int f2() = 0;
+};
+
+
+class B : public A1, public A2 {
+public:
+ int f2() final { return 1; }
+ int f1() final { return 2; }
+};
+
+// CHECK-LABEL: define hidden i32 @_Z3foov
+int foo() {
+ B b;
+ return static_cast<A2*>(&b)->f2();
+ // CHECK: [[P:%[^ ]*]] = bitcast %class.B* %b to i8**
+ // CHECK: [[V:%[^ ]*]] = load i8*, i8** [[P]], align 8
+ // CHECK: call i1 @llvm.type.test(i8* [[V]], metadata !"_ZTS1B")
+ // CHECK: call i1 @llvm.type.test(i8* [[V]], metadata !"all-vtables")
+}
diff --git a/src/llvm-project/clang/test/CodeGenCXX/clang-sections.cpp b/src/llvm-project/clang/test/CodeGenCXX/clang-sections.cpp
index 4fe42ea..59faf27 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/clang-sections.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/clang-sections.cpp
@@ -29,17 +29,20 @@
static int lstat_h; // my_bss.2
return zoo(g, &lstat_h);
}
-#pragma clang section rodata="my_rodata.2" data="my_data.2"
+#pragma clang section rodata="my_rodata.2" data="my_data.2" relro="my_relro.2"
int l = 5; // my_data.2
extern const int m;
const int m = 6; // my_rodata.2
+
+typedef int (*fptr_t)(void);
+const fptr_t fptrs[2] = {&foo, &goo};
#pragma clang section rodata="" data="" bss="" text=""
int n; // default
int o = 6; // default
extern const int p;
const int p = 7; // default
int hoo(void) {
- return b;
+ return b + fptrs[f]();
}
}
//CHECK: @a = global i32 0, align 4 #0
@@ -62,17 +65,19 @@
//CHECK: @n = global i32 0, align 4
//CHECK: @o = global i32 6, align 4
//CHECK: @p = constant i32 7, align 4
+//CHECK: @_ZL5fptrs = internal constant [2 x i32 ()*] [i32 ()* @foo, i32 ()* @goo], align 4 #3
-//CHECK: define i32 @foo() #4 {
-//CHECK: define i32 @goo() #5 {
-//CHECK: declare i32 @zoo(i32*, i32*) #6
-//CHECK: define i32 @hoo() #7 {
+//CHECK: define i32 @foo() #5 {
+//CHECK: define i32 @goo() #6 {
+//CHECK: declare i32 @zoo(i32*, i32*) #7
+//CHECK: define i32 @hoo() #8 {
//CHECK: attributes #0 = { "bss-section"="my_bss.1" "data-section"="my_data.1" "rodata-section"="my_rodata.1" }
//CHECK: attributes #1 = { "data-section"="my_data.1" "rodata-section"="my_rodata.1" }
//CHECK: attributes #2 = { "bss-section"="my_bss.2" "rodata-section"="my_rodata.1" }
-//CHECK: attributes #3 = { "bss-section"="my_bss.2" "data-section"="my_data.2" "rodata-section"="my_rodata.2" }
-//CHECK: attributes #4 = { {{.*"implicit-section-name"="my_text.1".*}} }
-//CHECK: attributes #5 = { {{.*"implicit-section-name"="my_text.2".*}} }
-//CHECK-NOT: attributes #6 = { {{.*"implicit-section-name".*}} }
+//CHECK: attributes #3 = { "bss-section"="my_bss.2" "data-section"="my_data.2" "relro-section"="my_relro.2" "rodata-section"="my_rodata.2" }
+//CHECK: attributes #4 = { "relro-section"="my_relro.2" }
+//CHECK: attributes #5 = { {{.*"implicit-section-name"="my_text.1".*}} }
+//CHECK: attributes #6 = { {{.*"implicit-section-name"="my_text.2".*}} }
//CHECK-NOT: attributes #7 = { {{.*"implicit-section-name".*}} }
+//CHECK-NOT: attributes #8 = { {{.*"implicit-section-name".*}} }
diff --git a/src/llvm-project/clang/test/CodeGenCXX/const-init-cxx2a.cpp b/src/llvm-project/clang/test/CodeGenCXX/const-init-cxx2a.cpp
new file mode 100644
index 0000000..1195b91
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCXX/const-init-cxx2a.cpp
@@ -0,0 +1,58 @@
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -o - %s -std=c++2a | FileCheck %s --implicit-check-not=cxx_global_var_init --implicit-check-not=cxa_atexit
+
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-pch -o %t.pch %s -std=c++2a
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -include-pch %t.pch -x c++ /dev/null -emit-llvm -o - -std=c++2a | FileCheck %s --implicit-check-not=cxx_global_var_init --implicit-check-not=cxa_atexit
+
+// CHECK: @a = global i32 123,
+int a = (delete new int, 123);
+
+struct B {
+ constexpr B() {}
+ constexpr ~B() { n *= 5; }
+ int n = 123;
+};
+// CHECK: @b = global {{.*}} i32 123
+extern constexpr B b = B();
+
+// CHECK: @_ZL1c = internal global {{.*}} i32 123
+const B c;
+int use_c() { return c.n; }
+
+struct D {
+ int n;
+ constexpr ~D() {}
+};
+D d;
+// CHECK: @d = global {{.*}} zeroinitializer
+
+D d_arr[3];
+// CHECK: @d_arr = global {{.*}} zeroinitializer
+
+thread_local D d_tl;
+// CHECK: @d_tl = thread_local global {{.*}} zeroinitializer
+
+// CHECK-NOT: @llvm.global_ctors
+
+// CHECK-LABEL: define {{.*}} @_Z1fv(
+void f() {
+ // CHECK-NOT: call
+ // CHECK: call {{.*}}memcpy
+ // CHECK-NOT: call
+ // CHECK: call {{.*}}memset
+ // CHECK-NOT: call
+ // CHECK: }
+ constexpr B b;
+ D d = D();
+}
+
+// CHECK-LABEL: define {{.*}} @_Z1gv(
+void g() {
+ // CHECK-NOT: call
+ // CHECK-NOT: cxa_guard
+ // CHECK-NOT: _ZGV
+ // CHECK: }
+ static constexpr B b1;
+ static const B b2;
+ static D d;
+ thread_local D d_tl;
+}
diff --git a/src/llvm-project/clang/test/CodeGenCXX/constructor-destructor-return-this.cpp b/src/llvm-project/clang/test/CodeGenCXX/constructor-destructor-return-this.cpp
index f6450e2..7ef9e11 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/constructor-destructor-return-this.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/constructor-destructor-return-this.cpp
@@ -3,6 +3,8 @@
//RUN: %clang_cc1 %s -emit-llvm -o - -triple=thumbv7-apple-ios5.0 -target-abi apcs-gnu | FileCheck --check-prefix=CHECKIOS5 %s
//RUN: %clang_cc1 %s -emit-llvm -o - -triple=wasm32-unknown-unknown \
//RUN: | FileCheck --check-prefix=CHECKARM %s
+//RUN: %clang_cc1 %s -emit-llvm -o - -triple=x86_64-unknown-fuchsia | FileCheck --check-prefix=CHECKFUCHSIA %s
+//RUN: %clang_cc1 %s -emit-llvm -o - -triple=aarch64-unknown-fuchsia | FileCheck --check-prefix=CHECKFUCHSIA %s
//RUN: %clang_cc1 %s -emit-llvm -o - -triple=i386-pc-win32 -fno-rtti | FileCheck --check-prefix=CHECKMS %s
// FIXME: these tests crash on the bots when run with -triple=x86_64-pc-win32
@@ -45,6 +47,11 @@
// CHECKIOS5-LABEL: define %class.B* @_ZN1BD2Ev(%class.B* %this)
// CHECKIOS5-LABEL: define %class.B* @_ZN1BD1Ev(%class.B* %this)
+// CHECKFUCHSIA-LABEL: define %class.B* @_ZN1BC2EPi(%class.B* returned %this, i32* %i)
+// CHECKFUCHSIA-LABEL: define %class.B* @_ZN1BC1EPi(%class.B* returned %this, i32* %i)
+// CHECKFUCHSIA-LABEL: define %class.B* @_ZN1BD2Ev(%class.B* returned %this)
+// CHECKFUCHSIA-LABEL: define %class.B* @_ZN1BD1Ev(%class.B* returned %this)
+
// CHECKMS-LABEL: define dso_local x86_thiscallcc %class.B* @"??0B@@QAE@PAH@Z"(%class.B* returned %this, i32* %i)
// CHECKMS-LABEL: define dso_local x86_thiscallcc void @"??1B@@UAE@XZ"(%class.B* %this)
@@ -83,6 +90,14 @@
// CHECKIOS5-LABEL: define void @_ZN1CD0Ev(%class.C* %this)
// CHECKIOS5-LABEL: define void @_ZThn8_N1CD0Ev(%class.C* %this)
+// CHECKFUCHSIA-LABEL: define %class.C* @_ZN1CC2EPiPc(%class.C* returned %this, i32* %i, i8* %c)
+// CHECKFUCHSIA-LABEL: define %class.C* @_ZN1CC1EPiPc(%class.C* returned %this, i32* %i, i8* %c)
+// CHECKFUCHSIA-LABEL: define %class.C* @_ZN1CD2Ev(%class.C* returned %this)
+// CHECKFUCHSIA-LABEL: define %class.C* @_ZN1CD1Ev(%class.C* returned %this)
+// CHECKFUCHSIA-LABEL: define %class.C* @_ZThn16_N1CD1Ev(%class.C* %this)
+// CHECKFUCHSIA-LABEL: define void @_ZN1CD0Ev(%class.C* %this)
+// CHECKFUCHSIA-LABEL: define void @_ZThn16_N1CD0Ev(%class.C* %this)
+
// CHECKMS-LABEL: define dso_local x86_thiscallcc %class.C* @"??0C@@QAE@PAHPAD@Z"(%class.C* returned %this, i32* %i, i8* %c)
// CHECKMS-LABEL: define dso_local x86_thiscallcc void @"??1C@@UAE@XZ"(%class.C* %this)
@@ -110,6 +125,11 @@
// CHECKIOS5-LABEL: define %class.D* @_ZN1DD2Ev(%class.D* %this, i8** %vtt)
// CHECKIOS5-LABEL: define %class.D* @_ZN1DD1Ev(%class.D* %this)
+// CHECKFUCHSIA-LABEL: define %class.D* @_ZN1DC2Ev(%class.D* returned %this, i8** %vtt)
+// CHECKFUCHSIA-LABEL: define %class.D* @_ZN1DC1Ev(%class.D* returned %this)
+// CHECKFUCHSIA-LABEL: define %class.D* @_ZN1DD2Ev(%class.D* returned %this, i8** %vtt)
+// CHECKFUCHSIA-LABEL: define %class.D* @_ZN1DD1Ev(%class.D* returned %this)
+
// CHECKMS-LABEL: define dso_local x86_thiscallcc %class.D* @"??0D@@QAE@XZ"(%class.D* returned %this, i32 %is_most_derived)
// CHECKMS-LABEL: define dso_local x86_thiscallcc void @"??1D@@UAE@XZ"(%class.D* %this)
@@ -127,15 +147,15 @@
e2->~E();
}
-// CHECKARM-LABEL: define void @_Z15test_destructorv()
+// CHECKARM-LABEL,CHECKFUCHSIA-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*)*, %class.E* (%class.E*)**
-// CHECKARM: [[THUNK:%.*]] = load %class.E* (%class.E*)*, %class.E* (%class.E*)** [[VFN]]
-// CHECKARM: call %class.E* [[THUNK]](%class.E* %
+// CHECKARM,CHECKFUCHSIA: [[VFN:%.*]] = getelementptr inbounds %class.E* (%class.E*)*, %class.E* (%class.E*)**
+// CHECKARM,CHECKFUCHSIA: [[THUNK:%.*]] = load %class.E* (%class.E*)*, %class.E* (%class.E*)** [[VFN]]
+// CHECKARM,CHECKFUCHSIA: call %class.E* [[THUNK]](%class.E* %
// ...but static calls create declarations with 'returned' this
-// CHECKARM: {{%.*}} = call %class.E* @_ZN1ED1Ev(%class.E* %
+// CHECKARM,CHECKFUCHSIA: {{%.*}} = call %class.E* @_ZN1ED1Ev(%class.E* %
-// CHECKARM: declare %class.E* @_ZN1ED1Ev(%class.E* returned)
+// CHECKARM,CHECKFUCHSIA: declare %class.E* @_ZN1ED1Ev(%class.E* returned)
diff --git a/src/llvm-project/clang/test/CodeGenCXX/copy-constructor-synthesis-2.cpp b/src/llvm-project/clang/test/CodeGenCXX/copy-constructor-synthesis-2.cpp
index 7940101c0..7d6dedc 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/copy-constructor-synthesis-2.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/copy-constructor-synthesis-2.cpp
@@ -23,5 +23,5 @@
struct A { virtual void a(); };
A x(A& y) { return y; }
-// CHECK: define linkonce_odr {{.*}} @_ZN1AC1ERKS_(%struct.A* {{.*}}%this, %struct.A* dereferenceable({{[0-9]+}})) unnamed_addr
+// CHECK: define linkonce_odr {{.*}} @_ZN1AC1ERKS_(%struct.A* {{.*}}%this, %struct.A* dereferenceable({{[0-9]+}}) %0) unnamed_addr
// CHECK: store i32 (...)** bitcast (i8** getelementptr inbounds ({ [3 x i8*] }, { [3 x i8*] }* @_ZTV1A, i32 0, inrange i32 0, i32 2) to i32 (...)**)
diff --git a/src/llvm-project/clang/test/CodeGenCXX/copy-constructor-synthesis.cpp b/src/llvm-project/clang/test/CodeGenCXX/copy-constructor-synthesis.cpp
index 4fdd8a3..3a692e4 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/copy-constructor-synthesis.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/copy-constructor-synthesis.cpp
@@ -21,7 +21,7 @@
};
-// CHECK-LABEL: define linkonce_odr void @_ZN1XC1ERKS_(%struct.X* %this, %struct.X* dereferenceable({{[0-9]+}})) unnamed_addr
+// CHECK-LABEL: define linkonce_odr void @_ZN1XC1ERKS_(%struct.X* %this, %struct.X* dereferenceable({{[0-9]+}}) %0) 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") {}
@@ -146,7 +146,7 @@
// CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 [[T4]], i8* align 8 [[T5]], i64 8, i1 false)
// CHECK-NEXT: ret [[A]]* [[THIS]]
-// CHECK-LABEL: define linkonce_odr void @_ZN6PR66281BC2ERKS0_(%"struct.PR6628::B"* %this, %"struct.PR6628::B"* dereferenceable({{[0-9]+}})) unnamed_addr
+// CHECK-LABEL: define linkonce_odr void @_ZN6PR66281BC2ERKS0_(%"struct.PR6628::B"* %this, %"struct.PR6628::B"* dereferenceable({{[0-9]+}}) %0) unnamed_addr
// CHECK: call void @_ZN6PR66281TC1Ev
// CHECK: call void @_ZN6PR66281TC1Ev
// CHECK: call void @_ZN6PR66281AC2ERKS0_RKNS_1TES5_
diff --git a/src/llvm-project/clang/test/CodeGenCXX/cxx0x-delegating-ctors.cpp b/src/llvm-project/clang/test/CodeGenCXX/cxx0x-delegating-ctors.cpp
index 614983d..8aef010 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/cxx0x-delegating-ctors.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/cxx0x-delegating-ctors.cpp
@@ -65,7 +65,7 @@
};
X::X(int) : X() {}
}
-// CHECK: define {{.*}} @_ZN7PR128901XC1Ei(%"class.PR12890::X"* %this, i32)
+// CHECK: define {{.*}} @_ZN7PR128901XC1Ei(%"class.PR12890::X"* %this, i32 %0)
// CHECK: call void @llvm.memset.p0i8.{{i32|i64}}(i8* align 4 {{.*}}, i8 0, {{i32|i64}} 4, i1 false)
namespace PR14588 {
diff --git a/src/llvm-project/clang/test/CodeGenCXX/cxx11-extern-constexpr.cpp b/src/llvm-project/clang/test/CodeGenCXX/cxx11-extern-constexpr.cpp
index 6c52003..0688d7b 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/cxx11-extern-constexpr.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/cxx11-extern-constexpr.cpp
@@ -1,10 +1,13 @@
-// RUN: %clang_cc1 -std=c++11 %s -emit-llvm -o - -triple x86_64-linux-gnu | FileCheck %s --check-prefix=CHECK --check-prefix=CXX11
-// RUN: %clang_cc1 -std=c++1z %s -emit-llvm -o - -triple x86_64-linux-gnu | FileCheck %s --check-prefix=CHECK --check-prefix=CXX17
+// RUN: %clang_cc1 -std=c++11 %s -emit-llvm -o - -triple x86_64-linux-gnu | FileCheck %s --check-prefixes=X86,CXX11X86
+// RUN: %clang_cc1 -std=c++1z %s -emit-llvm -o - -triple x86_64-linux-gnu | FileCheck %s --check-prefixes=X86,CXX17X86
+// RUN: %clang_cc1 -std=c++11 %s -emit-llvm -o - -triple amdgcn-amd-amdhsa | FileCheck %s --check-prefixes=AMD,CXX11AMD
+// RUN: %clang_cc1 -std=c++1z %s -emit-llvm -o - -triple amdgcn-amd-amdhsa | FileCheck %s --check-prefixes=AMD,CXX17AMD
struct A {
static const int Foo = 123;
};
-// CHECK: @_ZN1A3FooE = constant i32 123, align 4
+// X86: @_ZN1A3FooE = constant i32 123, align 4
+// AMD: @_ZN1A3FooE = addrspace(4) constant i32 123, align 4
const int *p = &A::Foo; // emit available_externally
const int A::Foo; // convert to full definition
@@ -16,7 +19,8 @@
// Deferred initialization of the structure here requires changing
// the type of the global variable: the initializer list does not include
// the tail padding.
- // CXX11: @_ZN9CreatePOD3podE = available_externally constant { i32, i8 } { i32 42, i8 43 },
+ // CXX11X86: @_ZN9CreatePOD3podE = available_externally constant { i32, i8 } { i32 42, i8 43 },
+ // CXX11AMD: @_ZN9CreatePOD3podE = available_externally addrspace(1) constant { i32, i8 } { i32 42, i8 43 },
static constexpr PODWithInit pod{};
};
const int *p_pod = &CreatePOD::pod.g;
@@ -30,29 +34,40 @@
};
struct Foo {
- // CXX11: @_ZN3Foo21ConstexprStaticMemberE = available_externally constant i32 42,
- // CXX17: @_ZN3Foo21ConstexprStaticMemberE = linkonce_odr constant i32 42,
+ // CXX11X86: @_ZN3Foo21ConstexprStaticMemberE = available_externally constant i32 42,
+ // CXX17X86: @_ZN3Foo21ConstexprStaticMemberE = linkonce_odr constant i32 42,
+ // CXX11AMD: @_ZN3Foo21ConstexprStaticMemberE = available_externally addrspace(4) constant i32 42,
+ // CXX17AMD: @_ZN3Foo21ConstexprStaticMemberE = linkonce_odr addrspace(4) constant i32 42,
static constexpr int ConstexprStaticMember = 42;
- // CHECK: @_ZN3Foo17ConstStaticMemberE = available_externally constant i32 43,
+ // X86: @_ZN3Foo17ConstStaticMemberE = available_externally constant i32 43,
+ // AMD: @_ZN3Foo17ConstStaticMemberE = available_externally addrspace(4) constant i32 43,
static const int ConstStaticMember = 43;
- // CXX11: @_ZN3Foo23ConstStaticStructMemberE = available_externally constant %struct.Bar { i32 44 },
- // CXX17: @_ZN3Foo23ConstStaticStructMemberE = linkonce_odr constant %struct.Bar { i32 44 },
+ // CXX11X86: @_ZN3Foo23ConstStaticStructMemberE = available_externally constant %struct.Bar { i32 44 },
+ // CXX17X86: @_ZN3Foo23ConstStaticStructMemberE = linkonce_odr constant %struct.Bar { i32 44 },
+ // CXX11AMD: @_ZN3Foo23ConstStaticStructMemberE = available_externally addrspace(1) constant %struct.Bar { i32 44 },
+ // CXX17AMD: @_ZN3Foo23ConstStaticStructMemberE = linkonce_odr addrspace(1) constant %struct.Bar { i32 44 },
static constexpr Bar ConstStaticStructMember = {44};
- // CXX11: @_ZN3Foo34ConstexprStaticMutableStructMemberE = external global %struct.MutableBar,
- // CXX17: @_ZN3Foo34ConstexprStaticMutableStructMemberE = linkonce_odr global %struct.MutableBar { i32 45 },
+ // CXX11X86: @_ZN3Foo34ConstexprStaticMutableStructMemberE = external global %struct.MutableBar,
+ // CXX17X86: @_ZN3Foo34ConstexprStaticMutableStructMemberE = linkonce_odr global %struct.MutableBar { i32 45 },
+ // CXX11AMD: @_ZN3Foo34ConstexprStaticMutableStructMemberE = external addrspace(1) global %struct.MutableBar,
+ // CXX17AMD: @_ZN3Foo34ConstexprStaticMutableStructMemberE = linkonce_odr addrspace(1) global %struct.MutableBar { i32 45 },
static constexpr MutableBar ConstexprStaticMutableStructMember = {45};
};
-// CHECK: @_ZL15ConstStaticexpr = internal constant i32 46,
+// X86: @_ZL15ConstStaticexpr = internal constant i32 46,
+// AMD: @_ZL15ConstStaticexpr = internal addrspace(4) constant i32 46,
static constexpr int ConstStaticexpr = 46;
-// CHECK: @_ZL9ConstExpr = internal constant i32 46, align 4
+// X86: @_ZL9ConstExpr = internal constant i32 46, align 4
+// AMD: @_ZL9ConstExpr = internal addrspace(4) constant i32 46, align 4
static const int ConstExpr = 46;
-// CHECK: @_ZL21ConstexprStaticStruct = internal constant %struct.Bar { i32 47 },
+// X86: @_ZL21ConstexprStaticStruct = internal constant %struct.Bar { i32 47 },
+// AMD: @_ZL21ConstexprStaticStruct = internal addrspace(1) constant %struct.Bar { i32 47 },
static constexpr Bar ConstexprStaticStruct = {47};
-// CHECK: @_ZL28ConstexprStaticMutableStruct = internal global %struct.MutableBar { i32 48 },
+// X86: @_ZL28ConstexprStaticMutableStruct = internal global %struct.MutableBar { i32 48 },
+// AMD: @_ZL28ConstexprStaticMutableStruct = internal addrspace(1) global %struct.MutableBar { i32 48 },
static constexpr MutableBar ConstexprStaticMutableStruct = {48};
void use(const int &);
diff --git a/src/llvm-project/clang/test/CodeGenCXX/cxx11-thread-local-reference.cpp b/src/llvm-project/clang/test/CodeGenCXX/cxx11-thread-local-reference.cpp
index 4c1e5a7..4177d3e 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/cxx11-thread-local-reference.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/cxx11-thread-local-reference.cpp
@@ -21,7 +21,7 @@
// DARWIN: call cxx_fast_tlscc i32* @_ZTW1r()
// CHECK: ret i32* %{{.*}}
-// LINUX: define weak_odr hidden i32* @_ZTW1r() [[ATTR0:#[0-9]+]] {
+// LINUX: define weak_odr hidden i32* @_ZTW1r() [[ATTR0:#[0-9]+]] comdat {
// DARWIN: define cxx_fast_tlscc i32* @_ZTW1r() [[ATTR1:#[0-9]+]] {
// LINUX: call void @_ZTH1r()
// DARWIN: call cxx_fast_tlscc void @_ZTH1r()
diff --git a/src/llvm-project/clang/test/CodeGenCXX/cxx11-thread-local.cpp b/src/llvm-project/clang/test/CodeGenCXX/cxx11-thread-local.cpp
index d159030..17a9542c 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/cxx11-thread-local.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/cxx11-thread-local.cpp
@@ -91,15 +91,16 @@
// LINUX-DAG: @_ZTH1a = alias void (), void ()* @__tls_init
// DARWIN-DAG: @_ZTH1a = internal alias void (), void ()* @__tls_init
-// CHECK-DAG: @_ZTHL1d = internal alias void (), void ()* @__tls_init
// LINUX-DAG: @_ZTHN1U1mE = alias void (), void ()* @__tls_init
// DARWIN-DAG: @_ZTHN1U1mE = internal alias void (), void ()* @__tls_init
// CHECK-DAG: @_ZTHN1VIiE1mE = linkonce_odr alias void (), void ()* @[[V_M_INIT:[^, ]*]]
-// CHECK-NOT: @_ZTHN1WIiE1mE =
// CHECK-DAG: @_ZTHN1XIiE1mE = linkonce_odr alias void (), void ()* @[[X_M_INIT:[^, ]*]]
// CHECK-DAG: @_ZTHN1VIfE1mE = weak_odr alias void (), void ()* @[[VF_M_INIT:[^, ]*]]
-// CHECK-NOT: @_ZTHN1WIfE1mE =
// CHECK-DAG: @_ZTHN1XIfE1mE = weak_odr alias void (), void ()* @[[XF_M_INIT:[^, ]*]]
+// FIXME: We really want a CHECK-DAG-NOT for these.
+// CHECK-NOT: @_ZTHN1WIiE1mE =
+// CHECK-NOT: @_ZTHN1WIfE1mE =
+// CHECK-NOT: @_ZTHL1d =
// Individual variable initialization functions:
@@ -130,7 +131,7 @@
// CHECK-NEXT: load i32, i32* %{{.*}}, align 4
// CHECK-NEXT: store i32 %{{.*}}, i32* @c, align 4
-// LINUX-LABEL: define weak_odr hidden i32* @_ZTW1b()
+// LINUX-LABEL: define linkonce_odr hidden i32* @_ZTW1b()
// LINUX: br i1 icmp ne (void ()* @_ZTH1b, void ()* null),
// not null:
// LINUX: call void @_ZTH1b()
@@ -203,22 +204,19 @@
// DARWIN: declare i32 @_tlv_atexit(void (i8*)*, i8*, i8*)
// DARWIN: declare cxx_fast_tlscc i32* @_ZTWN1VIcE1mE()
-// LINUX: define weak_odr hidden i32* @_ZTWN1VIcE1mE()
-// LINUX-NOT: comdat
+// LINUX: define linkonce_odr hidden i32* @_ZTWN1VIcE1mE() {{#[0-9]+}} comdat {
// LINUX: br i1 icmp ne (void ()* @_ZTHN1VIcE1mE,
// LINUX: call void @_ZTHN1VIcE1mE()
// LINUX: ret i32* @_ZN1VIcE1mE
// DARWIN: declare cxx_fast_tlscc i32* @_ZTWN1WIcE1mE()
-// LINUX: define weak_odr hidden i32* @_ZTWN1WIcE1mE()
-// LINUX-NOT: comdat
+// LINUX: define linkonce_odr hidden i32* @_ZTWN1WIcE1mE() {{#[0-9]+}} comdat {
// LINUX: br i1 icmp ne (void ()* @_ZTHN1WIcE1mE,
// LINUX: call void @_ZTHN1WIcE1mE()
// LINUX: ret i32* @_ZN1WIcE1mE
// DARWIN: declare cxx_fast_tlscc {{.*}}* @_ZTWN1XIcE1mE()
-// LINUX: define weak_odr hidden {{.*}}* @_ZTWN1XIcE1mE()
-// LINUX-NOT: comdat
+// LINUX: define linkonce_odr hidden {{.*}}* @_ZTWN1XIcE1mE() {{#[0-9]+}} comdat {
// LINUX: br i1 icmp ne (void ()* @_ZTHN1XIcE1mE,
// LINUX: call void @_ZTHN1XIcE1mE()
// LINUX: ret {{.*}}* @_ZN1XIcE1mE
@@ -269,7 +267,7 @@
}
namespace {
-thread_local int anon_i{1};
+thread_local int anon_i{f()};
}
void set_anon_i() {
anon_i = 2;
@@ -332,14 +330,10 @@
// CHECK: }
-// LINUX: declare extern_weak void @_ZTH1b() [[ATTR:#[0-9]+]]
-
-
-// LINUX-LABEL: define internal i32* @_ZTWL1d()
-// DARWIN-LABEL: define internal cxx_fast_tlscc i32* @_ZTWL1d()
-// LINUX: call void @_ZTHL1d()
-// DARWIN: call cxx_fast_tlscc void @_ZTHL1d()
-// CHECK: ret i32* @_ZL1d
+// Should not emit a thread wrapper for internal-linkage unused variable 'd'.
+// We separately check that 'd' does in fact get initialized with the other
+// thread-local variables in this TU.
+// CHECK-NOT: define {{.*}} @_ZTWL1d()
// LINUX-LABEL: define weak_odr hidden i32* @_ZTWN1U1mE()
// DARWIN-LABEL: define cxx_fast_tlscc i32* @_ZTWN1U1mE()
@@ -347,4 +341,6 @@
// DARWIN: call cxx_fast_tlscc void @_ZTHN1U1mE()
// CHECK: ret i32* @_ZN1U1mE
+// LINUX: declare extern_weak void @_ZTH1b() [[ATTR:#[0-9]+]]
+
// LINUX: attributes [[ATTR]] = { {{.+}} }
diff --git a/src/llvm-project/clang/test/CodeGenCXX/cxx2a-compare.cpp b/src/llvm-project/clang/test/CodeGenCXX/cxx2a-compare.cpp
index 57b4449..262fead 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/cxx2a-compare.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/cxx2a-compare.cpp
@@ -1,8 +1,6 @@
// RUN: %clang_cc1 -std=c++2a -emit-llvm %s -o - -triple %itanium_abi_triple | \
// RUN: FileCheck %s \
-// RUN: '-DWE="class.std::__1::weak_equality"' \
// RUN: '-DSO="class.std::__1::strong_ordering"' \
-// RUN: '-DSE="class.std::__1::strong_equality"' \
// RUN: '-DPO="class.std::__1::partial_ordering"' \
// RUN: -DEQ=0 -DLT=-1 -DGT=1 -DUNORD=-127 -DNE=1
@@ -69,36 +67,6 @@
return x <=> y;
}
-struct MemPtr {};
-using MemPtrT = void (MemPtr::*)();
-using MemDataT = int(MemPtr::*);
-
-// CHECK-LABEL: @_Z12mem_ptr_testM6MemPtrFvvES1_
-auto mem_ptr_test(MemPtrT x, MemPtrT y) {
- // CHECK: %[[DEST:retval|agg.result]]
- // CHECK: %cmp.ptr = icmp eq [[TY:i[0-9]+]] %lhs.memptr.ptr, %rhs.memptr.ptr
- // CHECK: %cmp.ptr.null = icmp eq [[TY]] %lhs.memptr.ptr, 0
- // CHECK: %cmp.adj = icmp eq [[TY]] %lhs.memptr.adj, %rhs.memptr.adj
- // CHECK: %[[OR:.*]] = or i1
- // CHECK-SAME: %cmp.adj
- // CHECK: %memptr.eq = and i1 %cmp.ptr, %[[OR]]
- // CHECK: %sel.eq = select i1 %memptr.eq, i8 [[EQ]], i8 [[NE]]
- // CHECK: %__value_ = getelementptr inbounds %[[SE]], %[[SE]]* %[[DEST]]
- // CHECK: store i8 %sel.eq, i8* %__value_, align 1
- // CHECK: ret
- return x <=> y;
-}
-
-// CHECK-LABEL: @_Z13mem_data_testM6MemPtriS0_
-auto mem_data_test(MemDataT x, MemDataT y) {
- // CHECK: %[[DEST:retval|agg.result]]
- // CHECK: %[[CMP:.*]] = icmp eq i{{[0-9]+}} %{{.+}}, %{{.+}}
- // CHECK: %sel.eq = select i1 %[[CMP]], i8 [[EQ]], i8 [[NE]]
- // CHECK: %__value_ = getelementptr inbounds %[[SE]], %[[SE]]* %[[DEST]]
- // CHECK: store i8 %sel.eq, i8* %__value_, align 1
- return x <=> y;
-}
-
// CHECK-LABEL: @_Z13test_constantv
auto test_constant() {
// CHECK: %[[DEST:retval|agg.result]]
@@ -111,16 +79,6 @@
return x <=> y;
}
-// CHECK-LABEL: @_Z16test_nullptr_objPiDn
-auto test_nullptr_obj(int* x, decltype(nullptr) y) {
- // CHECK: %[[DEST:retval|agg.result]]
- // CHECK: %cmp.eq = icmp eq i32* %{{.+}}, null
- // CHECK: %sel.eq = select i1 %cmp.eq, i8 [[EQ]], i8 [[NE]]
- // CHECK: %__value_ = getelementptr inbounds %[[SE]], %[[SE]]* %[[DEST]]
- // CHECK: store i8 %sel.eq, i8* %__value_, align 1
- return x <=> y;
-}
-
// CHECK-LABEL: @_Z18unscoped_enum_testijxy
void unscoped_enum_test(int i, unsigned u, long long l, unsigned long long ul) {
enum EnumA : int { A };
@@ -145,44 +103,3 @@
// CHECK: icmp ult i64 {{.*}} %[[UL]]
(void)(B <=> ul);
}
-
-namespace NullptrTest {
-using nullptr_t = decltype(nullptr);
-
-// CHECK-LABEL: @_ZN11NullptrTest4testEDnDn(
-auto test(nullptr_t x, nullptr_t y) {
- // CHECK: %[[DEST:retval|agg.result]]
- // CHECK-NOT: select
- // CHECK: %__value_ = getelementptr inbounds %[[SE]], %[[SE]]* %[[DEST]]
- // CHECK-NEXT: store i8 [[EQ]], i8* %__value_
- // CHECK: ret
- return x <=> y;
-}
-} // namespace NullptrTest
-
-namespace ComplexTest {
-
-auto test_float(_Complex float x, _Complex float y) {
- // CHECK: %[[DEST:retval|agg.result]]
- // CHECK: %cmp.eq.r = fcmp oeq float %x.real, %y.real
- // CHECK: %cmp.eq.i = fcmp oeq float %x.imag, %y.imag
- // CHECK: %and.eq = and i1 %cmp.eq.r, %cmp.eq.i
- // CHECK: %sel.eq = select i1 %and.eq, i8 [[EQ]], i8 [[NE]]
- // CHECK: %__value_ = getelementptr inbounds %[[WE]], %[[WE]]* %[[DEST]]
- // CHECK: store i8 %sel.eq, i8* %__value_, align 1
- return x <=> y;
-}
-
-// CHECK-LABEL: @_ZN11ComplexTest8test_intECiS0_(
-auto test_int(_Complex int x, _Complex int y) {
- // CHECK: %[[DEST:retval|agg.result]]
- // CHECK: %cmp.eq.r = icmp eq i32 %x.real, %y.real
- // CHECK: %cmp.eq.i = icmp eq i32 %x.imag, %y.imag
- // CHECK: %and.eq = and i1 %cmp.eq.r, %cmp.eq.i
- // CHECK: %sel.eq = select i1 %and.eq, i8 [[EQ]], i8 [[NE]]
- // CHECK: %__value_ = getelementptr inbounds %[[SE]], %[[SE]]* %[[DEST]]
- // CHECK: store i8 %sel.eq, i8* %__value_, align 1
- return x <=> y;
-}
-
-} // namespace ComplexTest
diff --git a/src/llvm-project/clang/test/CodeGenCXX/cxx2a-thread-local-constinit.cpp b/src/llvm-project/clang/test/CodeGenCXX/cxx2a-thread-local-constinit.cpp
new file mode 100644
index 0000000..af46a92
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCXX/cxx2a-thread-local-constinit.cpp
@@ -0,0 +1,69 @@
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++2a %s -emit-llvm -o - | FileCheck %s
+
+// CHECK-DAG: @a = external thread_local global i32
+extern thread_local int a;
+
+// CHECK-DAG: @b = external thread_local global i32
+extern thread_local constinit int b;
+
+// CHECK-LABEL: define i32 @_Z1fv()
+// CHECK: call i32* @_ZTW1a()
+// CHECK: }
+int f() { return a; }
+
+// CHECK-LABEL: define linkonce_odr {{.*}} @_ZTW1a()
+// CHECK: br i1
+// CHECK: call void @_ZTH1a()
+// CHECK: }
+
+// CHECK-LABEL: define i32 @_Z1gv()
+// CHECK-NOT: call
+// CHECK: load i32, i32* @b
+// CHECK-NOT: call
+// CHECK: }
+int g() { return b; }
+
+// CHECK-NOT: define {{.*}} @_ZTW1b()
+
+extern thread_local int c;
+
+// CHECK-LABEL: define i32 @_Z1hv()
+// CHECK: call i32* @_ZTW1c()
+// CHECK: load i32, i32* %
+// CHECK: }
+int h() { return c; }
+
+// Note: use of 'c' does not trigger initialization of 'd', because 'c' has a
+// constant initializer.
+// CHECK-LABEL: define weak_odr {{.*}} @_ZTW1c()
+// CHECK-NOT: br i1
+// CHECK-NOT: call
+// CHECK: ret i32* @c
+// CHECK: }
+
+thread_local int c = 0;
+
+int d_init();
+
+// CHECK: define {{.*}}[[D_INIT:@__cxx_global_var_init[^(]*]](
+// CHECK: call {{.*}} @_Z6d_initv()
+thread_local int d = d_init();
+
+struct Destructed {
+ int n;
+ ~Destructed();
+};
+
+extern thread_local constinit Destructed e;
+// CHECK-LABEL: define i32 @_Z1iv()
+// CHECK: call {{.*}}* @_ZTW1e()
+// CHECK: }
+int i() { return e.n; }
+
+// CHECK: define {{.*}}[[E2_INIT:@__cxx_global_var_init[^(]*]](
+// CHECK: call {{.*}} @__cxa_thread_atexit({{.*}} @_ZN10DestructedD1Ev {{.*}} @e2
+thread_local constinit Destructed e2;
+
+// CHECK-LABEL: define {{.*}}__tls_init
+// CHECK: call {{.*}} [[D_INIT]]
+// CHECK: call {{.*}} [[E2_INIT]]
diff --git a/src/llvm-project/clang/test/CodeGenCXX/cxx2a-three-way-comparison.cpp b/src/llvm-project/clang/test/CodeGenCXX/cxx2a-three-way-comparison.cpp
index e3c1535..a48bb0e 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/cxx2a-three-way-comparison.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/cxx2a-three-way-comparison.cpp
@@ -1,6 +1,42 @@
-// RUN: %clang_cc1 -std=c++2a -emit-llvm %s -o - -triple %itanium_abi_triple | FileCheck %s --check-prefix=ITANIUM
-// RUN: %clang_cc1 -std=c++2a -emit-llvm %s -o - -triple x86_64-pc-win32 2>&1 | FileCheck %s --check-prefix=MSABI
-// RUN: not %clang_cc1 -std=c++2a -emit-llvm %s -o - -triple %itanium_abi_triple -DBUILTIN 2>&1 | FileCheck %s --check-prefix=BUILTIN
+// RUN: %clang_cc1 -std=c++2a -emit-llvm %s -o - -triple %itanium_abi_triple | FileCheck %s --check-prefixes=CHECK,ITANIUM
+// RUN: %clang_cc1 -std=c++2a -emit-llvm %s -o - -triple x86_64-pc-win32 2>&1 | FileCheck %s --check-prefixes=CHECK,MSABI
+
+namespace std {
+ struct strong_ordering {
+ int n;
+ constexpr operator int() const { return n; }
+ static const strong_ordering less, equal, greater;
+ };
+ constexpr strong_ordering strong_ordering::less = {-1};
+ constexpr strong_ordering strong_ordering::equal = {0};
+ constexpr strong_ordering strong_ordering::greater = {1};
+}
+
+struct Primary {
+ virtual void f();
+ std::strong_ordering operator<=>(const Primary&) const = default;
+};
+struct X {
+ virtual struct Y &operator=(Y&&);
+ virtual struct Y &operator=(const Y&);
+ std::strong_ordering operator<=>(const X&) const = default;
+};
+// The vtable for Y should contain the following entries in order:
+// - Primary::f
+// - Y::operator<=>
+// - Y::operator=(const Y&) (implicit)
+// - Y::operator=(Y&&) (implicit)
+// - Y::operator==(const Y&) const (implicit)
+// See:
+// https://github.com/itanium-cxx-abi/cxx-abi/issues/83 for assignment operator
+// https://github.com/itanium-cxx-abi/cxx-abi/issues/88 for equality comparison
+// FIXME: What rule does MSVC use?
+struct Y : Primary, X {
+ virtual std::strong_ordering operator<=>(const Y&) const = default;
+};
+Y y;
+// ITANIUM: @_ZTV1Y = {{.*}}constant {{.*}} null, {{.*}} @_ZTI1Y {{.*}} @_ZN7Primary1fEv {{.*}} @_ZNK1YssERKS_ {{.*}} @_ZN1YaSERKS_ {{.*}} @_ZN1YaSEOS_ {{.*}} @_ZNK1YeqERKS_ {{.*}} -[[POINTERSIZE:4|8]]
+// ITANIUM-SAME: @_ZTI1Y {{.*}} @_ZThn[[POINTERSIZE]]_N1YaSERKS_
struct A {
void operator<=>(int);
@@ -26,8 +62,11 @@
return a <=> a;
}
-#ifdef BUILTIN
-void builtin(int a) {
- a <=> a; // BUILTIN: cannot compile this scalar expression yet
+// CHECK-LABEL: define {{.*}}builtin_cmp
+void builtin_cmp(int a) {
+ // CHECK: icmp slt
+ // CHECK: select
+ // CHECK: icmp eq
+ // CHECK: select
+ a <=> a;
}
-#endif
diff --git a/src/llvm-project/clang/test/CodeGenCXX/dbg-info-all-calls-described.cpp b/src/llvm-project/clang/test/CodeGenCXX/dbg-info-all-calls-described.cpp
index f04f327..667c246 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/dbg-info-all-calls-described.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/dbg-info-all-calls-described.cpp
@@ -22,6 +22,13 @@
// RUN: | FileCheck %s -check-prefix=HAS-ATTR \
// RUN: -implicit-check-not=DIFlagAllCallsDescribed
+// Supported: DWARF4 + LLDB tuning by using '-femit-debug-entry-values'
+// RUN: %clang_cc1 -femit-debug-entry-values -emit-llvm -triple x86_64-linux-gnu \
+// RUN: %s -o - -O1 -disable-llvm-passes -debugger-tuning=lldb \
+// RUN: -debug-info-kind=standalone -dwarf-version=4 \
+// RUN: | FileCheck %s -check-prefix=HAS-ATTR \
+// RUN: -implicit-check-not=DIFlagAllCallsDescribed
+
// Unsupported: -O0 + '-femit-debug-entry-values'
// RUN: %clang_cc1 -femit-debug-entry-values -emit-llvm -triple x86_64-linux-gnu \
// RUN: %s -o - -O0 -disable-llvm-passes -debugger-tuning=gdb \
@@ -49,6 +56,7 @@
// NO-ATTR-NOT: FlagAllCallsDescribed
+// HAS-ATTR-DAG: DISubprogram(name: "declaration1", {{.*}}, flags: DIFlagPrototyped
// HAS-ATTR-DAG: DISubprogram(name: "declaration2", {{.*}}, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition
// HAS-ATTR-DAG: DISubprogram(name: "struct1", {{.*}}, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized)
// HAS-ATTR-DAG: DISubprogram(name: "struct1", {{.*}}, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition
diff --git a/src/llvm-project/clang/test/CodeGenCXX/debug-info-deleted.cpp b/src/llvm-project/clang/test/CodeGenCXX/debug-info-deleted.cpp
new file mode 100644
index 0000000..d7d0b6d
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCXX/debug-info-deleted.cpp
@@ -0,0 +1,31 @@
+// Test for debug info for C++11 deleted member functions
+
+//Supported: -O0, standalone DI
+// RUN: %clang_cc1 -emit-llvm -triple x86_64-linux-gnu %s -o - \
+// RUN: -O0 -disable-llvm-passes \
+// RUN: -debug-info-kind=standalone \
+// RUN: | FileCheck %s -check-prefix=ATTR
+
+// ATTR: DISubprogram(name: "deleted", {{.*}}, flags: DIFlagPublic | DIFlagPrototyped,
+// ATTR: DISubprogram(name: "deleted", {{.*}}, flags: DIFlagPublic | DIFlagPrototyped, spFlags: DISPFlagDeleted
+// ATTR: DISubprogram(name: "operator=", linkageName: "_ZN7deletedaSERKS_", {{.*}}, flags: DIFlagPublic | DIFlagPrototyped, spFlags: DISPFlagDeleted
+// ATTR: DISubprogram(name: "deleted", {{.*}}, flags: DIFlagPublic | DIFlagPrototyped, spFlags: DISPFlagDeleted
+// ATTR: DISubprogram(name: "operator=", linkageName: "_ZN7deletedaSEOS_", {{.*}}, flags: DIFlagPublic | DIFlagPrototyped, spFlags: DISPFlagDeleted
+// ATTR: DISubprogram(name: "~deleted", {{.*}}, flags: DIFlagPublic | DIFlagPrototyped,
+class deleted {
+public:
+ // Defaulted on purpose, so as to facilitate object creation
+ deleted() = default;
+
+ deleted(const deleted &) = delete;
+ deleted &operator=(const deleted &) = delete;
+
+ deleted(deleted &&) = delete;
+ deleted &operator=(deleted &&) = delete;
+
+ ~deleted() = default;
+};
+
+void foo() {
+ deleted obj1;
+}
diff --git a/src/llvm-project/clang/test/CodeGenCXX/debug-info-export_symbols.cpp b/src/llvm-project/clang/test/CodeGenCXX/debug-info-export_symbols.cpp
new file mode 100644
index 0000000..19697be
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCXX/debug-info-export_symbols.cpp
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -emit-llvm -debug-info-kind=standalone -triple %itanium_abi_triple %s -o - | FileCheck %s
+
+// CHECK: [[SCOPE:![0-9]+]] = distinct !DICompositeType({{.*}}flags: DIFlagTypePassByValue
+// CHECK: !DICompositeType(tag: DW_TAG_structure_type, scope: [[SCOPE]]
+// CHECK-SAME: DIFlagExportSymbols | DIFlagTypePassByValue
+struct A {
+ // Anonymous class exports its symbols into A
+ struct {
+ int y;
+ };
+} a;
diff --git a/src/llvm-project/clang/test/CodeGenCXX/debug-info-limited-ctor.cpp b/src/llvm-project/clang/test/CodeGenCXX/debug-info-limited-ctor.cpp
new file mode 100644
index 0000000..321f173
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCXX/debug-info-limited-ctor.cpp
@@ -0,0 +1,30 @@
+// RUN: %clang -cc1 -debug-info-kind=constructor -emit-llvm %s -o - | FileCheck %s
+
+// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "A"
+// CHECK-NOT: DIFlagFwdDecl
+// CHECK-SAME: ){{$}}
+struct A {};
+void TestA() { A a; }
+
+// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "B"
+// CHECK-SAME: flags: DIFlagFwdDecl
+struct B {
+ B();
+};
+void TestB() { B b; }
+
+// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "C"
+// CHECK-NOT: flags: DIFlagFwdDecl
+// CHECK-SAME: ){{$}}
+struct C {
+ C() {}
+};
+void TestC() { C c; }
+
+// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "D"
+// CHECK-NOT: flags: DIFlagFwdDecl
+// CHECK-SAME: ){{$}}
+struct D {
+ D();
+};
+D::D() {}
diff --git a/src/llvm-project/clang/test/CodeGenCXX/debug-info-noreturn.cpp b/src/llvm-project/clang/test/CodeGenCXX/debug-info-noreturn.cpp
new file mode 100644
index 0000000..85b8132
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCXX/debug-info-noreturn.cpp
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 -std=c++11 -emit-llvm -fcxx-exceptions -debug-info-kind=standalone %s -o - | FileCheck %s
+// Test for NoReturn flags in debug info.
+
+// CHECK: DISubprogram(name: "f", {{.*}}, flags: DIFlagPrototyped | DIFlagNoReturn, spFlags: DISPFlagDefinition
+// CHECK: DISubprogram(name: "foo_member", {{.*}}, flags: DIFlagPrototyped | DIFlagNoReturn, spFlags: 0
+// CHECK-NOT: DISubprogram(name: "func",{{.*}}, flags: DIFlagPrototyped | DIFlagNoReturn, spFlags: DISPFlagDefinition
+
+class foo {
+
+ [[noreturn]] void foo_member() { throw 1; }
+};
+
+[[noreturn]] void f() {
+ throw 1;
+}
+
+void func() {
+ foo object;
+}
diff --git a/src/llvm-project/clang/test/CodeGenCXX/debug-info-template-align.cpp b/src/llvm-project/clang/test/CodeGenCXX/debug-info-template-align.cpp
new file mode 100644
index 0000000..42fdb26
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCXX/debug-info-template-align.cpp
@@ -0,0 +1,14 @@
+// Test for debug info related to DW_AT_alignment attribute in the typedef operator
+// Supported: -O0, standalone DI
+// RUN: %clang_cc1 -dwarf-version=5 -emit-llvm -triple x86_64-linux-gnu %s -o - \
+// RUN: -O0 -disable-llvm-passes \
+// RUN: -debug-info-kind=standalone \
+// RUN: | FileCheck %s
+
+// CHECK: DIDerivedType(tag: DW_TAG_typedef, {{.*}}, align: 512
+
+typedef char __attribute__((__aligned__(64))) alchar;
+
+int main() {
+ alchar newChar;
+}
diff --git a/src/llvm-project/clang/test/CodeGenCXX/debug-info-template-explicit-specialization.cpp b/src/llvm-project/clang/test/CodeGenCXX/debug-info-template-explicit-specialization.cpp
index cd51b52..4e41c40 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/debug-info-template-explicit-specialization.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/debug-info-template-explicit-specialization.cpp
@@ -105,7 +105,12 @@
};
extern template class j<int>;
j<int> jj;
+template <typename T>
+struct j_wrap {
+};
+j_wrap<j<int>> j_wrap_j;
// CHECK: DICompositeType(tag: DW_TAG_structure_type, name: "j<int, int>"
+// CHECK: DICompositeType(tag: DW_TAG_structure_type, name: "j_wrap<j<int, int> >"
template <typename T>
struct k {
diff --git a/src/llvm-project/clang/test/CodeGenCXX/devirtualize-dtor-final.cpp b/src/llvm-project/clang/test/CodeGenCXX/devirtualize-dtor-final.cpp
new file mode 100644
index 0000000..ea11be7
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCXX/devirtualize-dtor-final.cpp
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -triple i386-unknown-unknown -std=c++11 %s -emit-llvm -o - | FileCheck %s
+
+namespace Test1 {
+ struct A { virtual ~A() {} };
+ struct B final : A {};
+ struct C : A { virtual ~C() final {} };
+ struct D { virtual ~D() final = 0; };
+ // CHECK-LABEL: define void @_ZN5Test13fooEPNS_1BE
+ void foo(B *b) {
+ // CHECK: call void @_ZN5Test11BD1Ev
+ delete b;
+ }
+ // CHECK-LABEL: define void @_ZN5Test14foo2EPNS_1CE
+ void foo2(C *c) {
+ // CHECK: call void @_ZN5Test11CD1Ev
+ delete c;
+ }
+ // CHECK-LABEL: define void @_ZN5Test14evilEPNS_1DE
+ void evil(D *p) {
+ // CHECK-NOT: call void @_ZN5Test11DD1Ev
+ delete p;
+ }
+}
diff --git a/src/llvm-project/clang/test/CodeGenCXX/devirtualize-virtual-function-calls-final.cpp b/src/llvm-project/clang/test/CodeGenCXX/devirtualize-virtual-function-calls-final.cpp
index 2ab2f75..6f5e844 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/devirtualize-virtual-function-calls-final.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/devirtualize-virtual-function-calls-final.cpp
@@ -24,11 +24,24 @@
}
}
-namespace Test3 {
+namespace Test2a {
struct A {
+ virtual ~A() final {}
virtual int f();
};
+ // CHECK-LABEL: define i32 @_ZN6Test2a1fEPNS_1AE
+ int f(A *a) {
+ // CHECK: call i32 @_ZN6Test2a1A1fEv
+ return a->f();
+ }
+}
+
+
+namespace Test3 {
+ struct A {
+ virtual int f(); };
+
struct B final : A { };
// CHECK-LABEL: define i32 @_ZN5Test31fEPNS_1BE
@@ -242,6 +255,49 @@
}
}
+namespace TestVBase {
+ struct A { virtual void f(); };
+ struct B : virtual A {};
+ struct C : virtual A { void f() override; };
+
+ extern struct BC final : B, C {} &bc;
+ extern struct BCusingA final : B, C { using A::f; } &bc_using_a;
+ extern struct BCusingB final : B, C { using B::f; } &bc_using_b;
+ extern struct BCusingC final : B, C { using C::f; } &bc_using_c;
+
+ extern struct CB final : C, B {} &cb;
+ extern struct CBusingA final : C, B { using A::f; } &cb_using_a;
+ extern struct CBusingB final : C, B { using B::f; } &cb_using_b;
+ extern struct CBusingC final : C, B { using C::f; } &cb_using_c;
+
+ // CHECK-LABEL: @_ZN9TestVBase4testEv(
+ void test() {
+ // FIXME: The 'using A' case can be devirtualized to call A's virtual
+ // adjustment thunk for C::f.
+ // FIXME: The 'using B' case can be devirtualized, but requires us to emit
+ // a derived-to-base or base-to-derived conversion as part of
+ // devirtualization.
+
+ // CHECK: call void @_ZN9TestVBase1C1fEv(
+ bc.f();
+ // CHECK: call void %
+ bc_using_a.f();
+ // CHECK: call void %
+ bc_using_b.f();
+ // CHECK: call void @_ZN9TestVBase1C1fEv(
+ bc_using_c.f();
+
+ // CHECK: call void @_ZN9TestVBase1C1fEv(
+ cb.f();
+ // CHECK: call void %
+ cb_using_a.f();
+ // CHECK: call void %
+ cb_using_b.f();
+ // CHECK: call void @_ZN9TestVBase1C1fEv(
+ cb_using_c.f();
+ }
+}
+
namespace Test11 {
// Check that the definitions of Derived's operators are emitted.
diff --git a/src/llvm-project/clang/test/CodeGenCXX/discard-name-values.cpp b/src/llvm-project/clang/test/CodeGenCXX/discard-name-values.cpp
index aa30dae..91328a4 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/discard-name-values.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/discard-name-values.cpp
@@ -11,11 +11,11 @@
if (pred) {
// DISCARDVALUE: 2:
- // DISCARDVALUE-NEXT: tail call void @branch()
+ // DISCARDVALUE-NEXT: call void @branch()
// DISCARDVALUE-NEXT: br label %3
// CHECK: if.then:
- // CHECK-NEXT: tail call void @branch()
+ // CHECK-NEXT: call void @branch()
// CHECK-NEXT: br label %if.end
branch();
}
diff --git a/src/llvm-project/clang/test/CodeGenCXX/dllexport-dtor-thunks.cpp b/src/llvm-project/clang/test/CodeGenCXX/dllexport-dtor-thunks.cpp
index bda126e..d2aa195 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/dllexport-dtor-thunks.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/dllexport-dtor-thunks.cpp
@@ -1,5 +1,12 @@
// RUN: %clang_cc1 -mconstructor-aliases -fms-extensions %s -emit-llvm -o - -triple x86_64-windows-msvc | FileCheck %s
+namespace test1 {
+struct A { ~A(); };
+struct __declspec(dllexport) B : virtual A { };
+// CHECK: define weak_odr dso_local dllexport void @"??1B@test1@@QEAA@XZ"
+// CHECK: define weak_odr dso_local dllexport void @"??_DB@test1@@QEAAXXZ"
+}
+
struct __declspec(dllexport) A { virtual ~A(); };
struct __declspec(dllexport) B { virtual ~B(); };
struct __declspec(dllexport) C : A, B { virtual ~C(); };
diff --git a/src/llvm-project/clang/test/CodeGenCXX/dllexport-members.cpp b/src/llvm-project/clang/test/CodeGenCXX/dllexport-members.cpp
index b027538..3de4a71 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/dllexport-members.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/dllexport-members.cpp
@@ -296,32 +296,32 @@
// G64-DAG: define dso_local dllexport void @_ZN14ExportSpecialsD2Ev(%struct.ExportSpecials* %this)
__declspec(dllexport) ~ExportSpecials();
- // M32-DAG: define dso_local dllexport x86_thiscallcc %struct.ExportSpecials* @"??0ExportSpecials@@QAE@ABU0@@Z"(%struct.ExportSpecials* returned %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
- // M64-DAG: define dso_local dllexport %struct.ExportSpecials* @"??0ExportSpecials@@QEAA@AEBU0@@Z"(%struct.ExportSpecials* returned %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
- // G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN14ExportSpecialsC1ERKS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
- // G64-DAG: define dso_local dllexport void @_ZN14ExportSpecialsC1ERKS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
- // G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN14ExportSpecialsC2ERKS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
- // G64-DAG: define dso_local dllexport void @_ZN14ExportSpecialsC2ERKS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
+ // M32-DAG: define dso_local dllexport x86_thiscallcc %struct.ExportSpecials* @"??0ExportSpecials@@QAE@ABU0@@Z"(%struct.ExportSpecials* returned %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}) %0)
+ // M64-DAG: define dso_local dllexport %struct.ExportSpecials* @"??0ExportSpecials@@QEAA@AEBU0@@Z"(%struct.ExportSpecials* returned %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}) %0)
+ // G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN14ExportSpecialsC1ERKS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}) %0)
+ // G64-DAG: define dso_local dllexport void @_ZN14ExportSpecialsC1ERKS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}) %0)
+ // G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN14ExportSpecialsC2ERKS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}) %0)
+ // G64-DAG: define dso_local dllexport void @_ZN14ExportSpecialsC2ERKS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}) %0)
__declspec(dllexport) ExportSpecials(const ExportSpecials&);
- // M32-DAG: define dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @"??4ExportSpecials@@QAEAAU0@ABU0@@Z"(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
- // M64-DAG: define dso_local dllexport dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @"??4ExportSpecials@@QEAAAEAU0@AEBU0@@Z"(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
- // G32-DAG: define dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @_ZN14ExportSpecialsaSERKS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
- // G64-DAG: define dso_local dllexport dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @_ZN14ExportSpecialsaSERKS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
+ // M32-DAG: define dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @"??4ExportSpecials@@QAEAAU0@ABU0@@Z"(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}) %0)
+ // M64-DAG: define dso_local dllexport dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @"??4ExportSpecials@@QEAAAEAU0@AEBU0@@Z"(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}) %0)
+ // G32-DAG: define dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @_ZN14ExportSpecialsaSERKS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}) %0)
+ // G64-DAG: define dso_local dllexport dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @_ZN14ExportSpecialsaSERKS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}) %0)
__declspec(dllexport) ExportSpecials& operator=(const ExportSpecials&);
- // M32-DAG: define dso_local dllexport x86_thiscallcc %struct.ExportSpecials* @"??0ExportSpecials@@QAE@$$QAU0@@Z"(%struct.ExportSpecials* returned %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
- // M64-DAG: define dso_local dllexport %struct.ExportSpecials* @"??0ExportSpecials@@QEAA@$$QEAU0@@Z"(%struct.ExportSpecials* returned %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
- // G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN14ExportSpecialsC1EOS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
- // G64-DAG: define dso_local dllexport void @_ZN14ExportSpecialsC1EOS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
- // G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN14ExportSpecialsC2EOS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
- // G64-DAG: define dso_local dllexport void @_ZN14ExportSpecialsC2EOS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
+ // M32-DAG: define dso_local dllexport x86_thiscallcc %struct.ExportSpecials* @"??0ExportSpecials@@QAE@$$QAU0@@Z"(%struct.ExportSpecials* returned %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}) %0)
+ // M64-DAG: define dso_local dllexport %struct.ExportSpecials* @"??0ExportSpecials@@QEAA@$$QEAU0@@Z"(%struct.ExportSpecials* returned %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}) %0)
+ // G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN14ExportSpecialsC1EOS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}) %0)
+ // G64-DAG: define dso_local dllexport void @_ZN14ExportSpecialsC1EOS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}) %0)
+ // G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN14ExportSpecialsC2EOS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}) %0)
+ // G64-DAG: define dso_local dllexport void @_ZN14ExportSpecialsC2EOS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}) %0)
__declspec(dllexport) ExportSpecials(ExportSpecials&&);
- // M32-DAG: define dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @"??4ExportSpecials@@QAEAAU0@$$QAU0@@Z"(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
- // M64-DAG: define dso_local dllexport dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @"??4ExportSpecials@@QEAAAEAU0@$$QEAU0@@Z"(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
- // G32-DAG: define dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @_ZN14ExportSpecialsaSEOS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
- // G64-DAG: define dso_local dllexport dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @_ZN14ExportSpecialsaSEOS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}))
+ // M32-DAG: define dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @"??4ExportSpecials@@QAEAAU0@$$QAU0@@Z"(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}) %0)
+ // M64-DAG: define dso_local dllexport dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @"??4ExportSpecials@@QEAAAEAU0@$$QEAU0@@Z"(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}) %0)
+ // G32-DAG: define dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @_ZN14ExportSpecialsaSEOS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}) %0)
+ // G64-DAG: define dso_local dllexport dereferenceable({{[0-9]+}}) %struct.ExportSpecials* @_ZN14ExportSpecialsaSEOS_(%struct.ExportSpecials* %this, %struct.ExportSpecials* dereferenceable({{[0-9]+}}) %0)
__declspec(dllexport) ExportSpecials& operator=(ExportSpecials&&);
};
ExportSpecials::ExportSpecials() {}
@@ -400,32 +400,32 @@
// G64-DAG: define dso_local dllexport void @_ZN19ExportDefaultedDefsD2Ev(%struct.ExportDefaultedDefs* %this)
ExportDefaultedDefs::~ExportDefaultedDefs() = default;
-// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc %struct.ExportDefaultedDefs* @"??0ExportDefaultedDefs@@QAE@ABU0@@Z"(%struct.ExportDefaultedDefs* returned %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// M64-DAG: define weak_odr dso_local dllexport %struct.ExportDefaultedDefs* @"??0ExportDefaultedDefs@@QEAA@AEBU0@@Z"(%struct.ExportDefaultedDefs* returned %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN19ExportDefaultedDefsC1ERKS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G64-DAG: define weak_odr dso_local dllexport void @_ZN19ExportDefaultedDefsC1ERKS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN19ExportDefaultedDefsC2ERKS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G64-DAG: define weak_odr dso_local dllexport void @_ZN19ExportDefaultedDefsC2ERKS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
+// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc %struct.ExportDefaultedDefs* @"??0ExportDefaultedDefs@@QAE@ABU0@@Z"(%struct.ExportDefaultedDefs* returned %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}) %0)
+// M64-DAG: define weak_odr dso_local dllexport %struct.ExportDefaultedDefs* @"??0ExportDefaultedDefs@@QEAA@AEBU0@@Z"(%struct.ExportDefaultedDefs* returned %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}) %0)
+// G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN19ExportDefaultedDefsC1ERKS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}) %0)
+// G64-DAG: define weak_odr dso_local dllexport void @_ZN19ExportDefaultedDefsC1ERKS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}) %0)
+// G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc void @_ZN19ExportDefaultedDefsC2ERKS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}) %0)
+// G64-DAG: define weak_odr dso_local dllexport void @_ZN19ExportDefaultedDefsC2ERKS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}) %0)
__declspec(dllexport) ExportDefaultedDefs::ExportDefaultedDefs(const ExportDefaultedDefs&) = default;
-// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @"??4ExportDefaultedDefs@@QAEAAU0@ABU0@@Z"(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// M64-DAG: define weak_odr dso_local dllexport dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @"??4ExportDefaultedDefs@@QEAAAEAU0@AEBU0@@Z"(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @_ZN19ExportDefaultedDefsaSERKS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G64-DAG: define weak_odr dso_local dllexport dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @_ZN19ExportDefaultedDefsaSERKS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
+// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @"??4ExportDefaultedDefs@@QAEAAU0@ABU0@@Z"(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}) %0)
+// M64-DAG: define weak_odr dso_local dllexport dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @"??4ExportDefaultedDefs@@QEAAAEAU0@AEBU0@@Z"(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}) %0)
+// G32-DAG: define weak_odr dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @_ZN19ExportDefaultedDefsaSERKS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}) %0)
+// G64-DAG: define weak_odr dso_local dllexport dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @_ZN19ExportDefaultedDefsaSERKS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}) %0)
inline ExportDefaultedDefs& ExportDefaultedDefs::operator=(const ExportDefaultedDefs&) = default;
-// M32-DAG: define dso_local dllexport x86_thiscallcc %struct.ExportDefaultedDefs* @"??0ExportDefaultedDefs@@QAE@$$QAU0@@Z"(%struct.ExportDefaultedDefs* returned %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// M64-DAG: define dso_local dllexport %struct.ExportDefaultedDefs* @"??0ExportDefaultedDefs@@QEAA@$$QEAU0@@Z"(%struct.ExportDefaultedDefs* returned %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN19ExportDefaultedDefsC1EOS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G64-DAG: define dso_local dllexport void @_ZN19ExportDefaultedDefsC1EOS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN19ExportDefaultedDefsC2EOS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G64-DAG: define dso_local dllexport void @_ZN19ExportDefaultedDefsC2EOS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
+// M32-DAG: define dso_local dllexport x86_thiscallcc %struct.ExportDefaultedDefs* @"??0ExportDefaultedDefs@@QAE@$$QAU0@@Z"(%struct.ExportDefaultedDefs* returned %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}) %0)
+// M64-DAG: define dso_local dllexport %struct.ExportDefaultedDefs* @"??0ExportDefaultedDefs@@QEAA@$$QEAU0@@Z"(%struct.ExportDefaultedDefs* returned %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}) %0)
+// G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN19ExportDefaultedDefsC1EOS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}) %0)
+// G64-DAG: define dso_local dllexport void @_ZN19ExportDefaultedDefsC1EOS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}) %0)
+// G32-DAG: define dso_local dllexport x86_thiscallcc void @_ZN19ExportDefaultedDefsC2EOS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}) %0)
+// G64-DAG: define dso_local dllexport void @_ZN19ExportDefaultedDefsC2EOS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}) %0)
__declspec(dllexport) ExportDefaultedDefs::ExportDefaultedDefs(ExportDefaultedDefs&&) = default;
-// M32-DAG: define dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @"??4ExportDefaultedDefs@@QAEAAU0@$$QAU0@@Z"(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// M64-DAG: define dso_local dllexport dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @"??4ExportDefaultedDefs@@QEAAAEAU0@$$QEAU0@@Z"(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G32-DAG: define dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @_ZN19ExportDefaultedDefsaSEOS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G64-DAG: define dso_local dllexport dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @_ZN19ExportDefaultedDefsaSEOS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}))
+// M32-DAG: define dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @"??4ExportDefaultedDefs@@QAEAAU0@$$QAU0@@Z"(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}) %0)
+// M64-DAG: define dso_local dllexport dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @"??4ExportDefaultedDefs@@QEAAAEAU0@$$QEAU0@@Z"(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}) %0)
+// G32-DAG: define dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @_ZN19ExportDefaultedDefsaSEOS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}) %0)
+// G64-DAG: define dso_local dllexport dereferenceable({{[0-9]+}}) %struct.ExportDefaultedDefs* @_ZN19ExportDefaultedDefsaSEOS_(%struct.ExportDefaultedDefs* %this, %struct.ExportDefaultedDefs* dereferenceable({{[0-9]+}}) %0)
ExportDefaultedDefs& ExportDefaultedDefs::operator=(ExportDefaultedDefs&&) = default;
@@ -444,14 +444,14 @@
// M64VS2015-NOT: define weak_odr dso_local dllexport void @"??1ExportDefaultedInclassDefs@@QEAA@XZ"(%struct.ExportDefaultedInclassDefs* %this)
__declspec(dllexport) ExportDefaultedInclassDefs(const ExportDefaultedInclassDefs&) = default;
- // M32VS2013-DAG: define weak_odr dso_local dllexport x86_thiscallcc %struct.ExportDefaultedInclassDefs* @"??0ExportDefaultedInclassDefs@@QAE@ABU0@@Z"(%struct.ExportDefaultedInclassDefs* returned %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}}))
- // M64VS2013-DAG: define weak_odr dso_local dllexport %struct.ExportDefaultedInclassDefs* @"??0ExportDefaultedInclassDefs@@QEAA@AEBU0@@Z"(%struct.ExportDefaultedInclassDefs* returned %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}}))
- // M32VS2015-NOT: define weak_odr dso_local dllexport x86_thiscallcc %struct.ExportDefaultedInclassDefs* @"??0ExportDefaultedInclassDefs@@QAE@ABU0@@Z"(%struct.ExportDefaultedInclassDefs* returned %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}}))
- // M64VS2015-NOT: define weak_odr dso_local dllexport %struct.ExportDefaultedInclassDefs* @"??0ExportDefaultedInclassDefs@@QEAA@AEBU0@@Z"(%struct.ExportDefaultedInclassDefs* returned %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}}))
+ // M32VS2013-DAG: define weak_odr dso_local dllexport x86_thiscallcc %struct.ExportDefaultedInclassDefs* @"??0ExportDefaultedInclassDefs@@QAE@ABU0@@Z"(%struct.ExportDefaultedInclassDefs* returned %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}}) %0)
+ // M64VS2013-DAG: define weak_odr dso_local dllexport %struct.ExportDefaultedInclassDefs* @"??0ExportDefaultedInclassDefs@@QEAA@AEBU0@@Z"(%struct.ExportDefaultedInclassDefs* returned %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}}) %0)
+ // M32VS2015-NOT: define weak_odr dso_local dllexport x86_thiscallcc %struct.ExportDefaultedInclassDefs* @"??0ExportDefaultedInclassDefs@@QAE@ABU0@@Z"(%struct.ExportDefaultedInclassDefs* returned %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}}) %0)
+ // M64VS2015-NOT: define weak_odr dso_local dllexport %struct.ExportDefaultedInclassDefs* @"??0ExportDefaultedInclassDefs@@QEAA@AEBU0@@Z"(%struct.ExportDefaultedInclassDefs* returned %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}}) %0)
__declspec(dllexport) ExportDefaultedInclassDefs& operator=(const ExportDefaultedInclassDefs&) = default;
- // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportDefaultedInclassDefs* @"??4ExportDefaultedInclassDefs@@QAEAAU0@ABU0@@Z"(%struct.ExportDefaultedInclassDefs* %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}}))
- // M64-DAG: define weak_odr dso_local dllexport dereferenceable({{[0-9]+}}) %struct.ExportDefaultedInclassDefs* @"??4ExportDefaultedInclassDefs@@QEAAAEAU0@AEBU0@@Z"(%struct.ExportDefaultedInclassDefs* %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}}))
+ // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportDefaultedInclassDefs* @"??4ExportDefaultedInclassDefs@@QAEAAU0@ABU0@@Z"(%struct.ExportDefaultedInclassDefs* %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}}) %0)
+ // M64-DAG: define weak_odr dso_local dllexport dereferenceable({{[0-9]+}}) %struct.ExportDefaultedInclassDefs* @"??4ExportDefaultedInclassDefs@@QEAAAEAU0@AEBU0@@Z"(%struct.ExportDefaultedInclassDefs* %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}}) %0)
};
diff --git a/src/llvm-project/clang/test/CodeGenCXX/dllexport.cpp b/src/llvm-project/clang/test/CodeGenCXX/dllexport.cpp
index 59ba6d8..045cb45 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/dllexport.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/dllexport.cpp
@@ -672,8 +672,8 @@
// M64VS2015-NOT: define weak_odr dso_local dllexport %struct.ExportDefaultedInclassDefs* @"??0ExportDefaultedInclassDefs@@QEAA@AEBU0@@Z"(%struct.ExportDefaultedInclassDefs* returned %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}}))
ExportDefaultedInclassDefs& operator=(const ExportDefaultedInclassDefs&) = default;
- // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportDefaultedInclassDefs* @"??4ExportDefaultedInclassDefs@@QAEAAU0@ABU0@@Z"(%struct.ExportDefaultedInclassDefs* %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}}))
- // M64-DAG: define weak_odr dso_local dllexport dereferenceable({{[0-9]+}}) %struct.ExportDefaultedInclassDefs* @"??4ExportDefaultedInclassDefs@@QEAAAEAU0@AEBU0@@Z"(%struct.ExportDefaultedInclassDefs* %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}}))
+ // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ExportDefaultedInclassDefs* @"??4ExportDefaultedInclassDefs@@QAEAAU0@ABU0@@Z"(%struct.ExportDefaultedInclassDefs* %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}}) %0)
+ // M64-DAG: define weak_odr dso_local dllexport dereferenceable({{[0-9]+}}) %struct.ExportDefaultedInclassDefs* @"??4ExportDefaultedInclassDefs@@QEAAAEAU0@AEBU0@@Z"(%struct.ExportDefaultedInclassDefs* %this, %struct.ExportDefaultedInclassDefs* dereferenceable({{[0-9]+}}) %0)
};
namespace ReferencedInlineMethodInNestedClass {
@@ -860,6 +860,20 @@
};
// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc %"struct.InClassInits::PR40006"* @"??0PR40006@InClassInits@@QAE@XZ"
+namespace pr40006 {
+// Delay emitting the method also past the instantiation of Tmpl<Inner>, i.e.
+// until the top-level class Outer is completely finished.
+template<typename> struct Tmpl {};
+struct Outer {
+ struct Inner {
+ __declspec(dllexport) Inner() = default;
+ unsigned int x = 0;
+ };
+ Tmpl<Inner> y;
+};
+// M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc %"struct.InClassInits::pr40006::Outer::Inner"* @"??0Inner@Outer@pr40006@InClassInits@@QAE@XZ"
+}
+
// PR42857: Clang would try to emit the non-trivial explicitly defaulted
// dllexport ctor twice when doing an explicit instantiation definition.
struct Qux { Qux(); };
diff --git a/src/llvm-project/clang/test/CodeGenCXX/dllimport-dtor-thunks.cpp b/src/llvm-project/clang/test/CodeGenCXX/dllimport-dtor-thunks.cpp
index da3227a..53aa2cd 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/dllimport-dtor-thunks.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/dllimport-dtor-thunks.cpp
@@ -19,9 +19,9 @@
virtual ~ImportOverrideVDtor() {}
};
-// Virtually inherits from a non-dllimport base class. This time we need to call
-// the complete destructor and emit it inline. It's not exported from the DLL,
-// and it must be emitted.
+// Virtually inherits from a non-dllimport base class. In this case, we can
+// expect the DLL to provide a definition of the complete dtor. See
+// dllexport-dtor-thunks.cpp.
struct __declspec(dllimport) ImportVBaseOverrideVDtor
: public virtual BaseClass {
virtual ~ImportVBaseOverrideVDtor() {}
diff --git a/src/llvm-project/clang/test/CodeGenCXX/dllimport-members.cpp b/src/llvm-project/clang/test/CodeGenCXX/dllimport-members.cpp
index 1c8fabf..4f63fc7 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/dllimport-members.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/dllimport-members.cpp
@@ -467,32 +467,32 @@
// M32-DAG: declare dllimport x86_thiscallcc %struct.ImportInlineSpecials* @"??0ImportInlineSpecials@@QAE@ABU0@@Z"(%struct.ImportInlineSpecials* returned, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}))
// M64-DAG: declare dllimport %struct.ImportInlineSpecials* @"??0ImportInlineSpecials@@QEAA@AEBU0@@Z"(%struct.ImportInlineSpecials* returned, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}))
- // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN20ImportInlineSpecialsC1ERKS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}))
- // G64-DAG: define linkonce_odr dso_local void @_ZN20ImportInlineSpecialsC1ERKS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}))
+ // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN20ImportInlineSpecialsC1ERKS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}) %0)
+ // G64-DAG: define linkonce_odr dso_local void @_ZN20ImportInlineSpecialsC1ERKS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}) %0)
// MO1-DAG: define available_externally dllimport x86_thiscallcc %struct.ImportInlineSpecials* @"??0ImportInlineSpecials@@QAE@ABU0@@Z"(
// GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN20ImportInlineSpecialsC1ERKS_(
__declspec(dllimport) inline ImportInlineSpecials(const ImportInlineSpecials&);
// M32-DAG: declare dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @"??4ImportInlineSpecials@@QAEAAU0@ABU0@@Z"(%struct.ImportInlineSpecials*, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}))
// M64-DAG: declare dllimport dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @"??4ImportInlineSpecials@@QEAAAEAU0@AEBU0@@Z"(%struct.ImportInlineSpecials*, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}))
- // G32-DAG: define linkonce_odr dso_local x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @_ZN20ImportInlineSpecialsaSERKS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}))
- // G64-DAG: define linkonce_odr dso_local dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @_ZN20ImportInlineSpecialsaSERKS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}))
+ // G32-DAG: define linkonce_odr dso_local x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @_ZN20ImportInlineSpecialsaSERKS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}) %0)
+ // G64-DAG: define linkonce_odr dso_local dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @_ZN20ImportInlineSpecialsaSERKS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}) %0)
// MO1-DAG: define available_externally dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @"??4ImportInlineSpecials@@QAEAAU0@ABU0@@Z"(
// GO1-DAG: define linkonce_odr dso_local x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @_ZN20ImportInlineSpecialsaSERKS_(
__declspec(dllimport) ImportInlineSpecials& operator=(const ImportInlineSpecials&);
// M32-DAG: declare dllimport x86_thiscallcc %struct.ImportInlineSpecials* @"??0ImportInlineSpecials@@QAE@$$QAU0@@Z"(%struct.ImportInlineSpecials* returned, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}))
// M64-DAG: declare dllimport %struct.ImportInlineSpecials* @"??0ImportInlineSpecials@@QEAA@$$QEAU0@@Z"(%struct.ImportInlineSpecials* returned, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}))
- // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN20ImportInlineSpecialsC1EOS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}))
- // G64-DAG: define linkonce_odr dso_local void @_ZN20ImportInlineSpecialsC1EOS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}))
+ // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN20ImportInlineSpecialsC1EOS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}) %0)
+ // G64-DAG: define linkonce_odr dso_local void @_ZN20ImportInlineSpecialsC1EOS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}) %0)
// MO1-DAG: define available_externally dllimport x86_thiscallcc %struct.ImportInlineSpecials* @"??0ImportInlineSpecials@@QAE@$$QAU0@@Z"(
// GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN20ImportInlineSpecialsC1EOS_(
__declspec(dllimport) ImportInlineSpecials(ImportInlineSpecials&&) {}
// M32-DAG: declare dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @"??4ImportInlineSpecials@@QAEAAU0@$$QAU0@@Z"(%struct.ImportInlineSpecials*, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}))
// M64-DAG: declare dllimport dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @"??4ImportInlineSpecials@@QEAAAEAU0@$$QEAU0@@Z"(%struct.ImportInlineSpecials*, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}))
- // G32-DAG: define linkonce_odr dso_local x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @_ZN20ImportInlineSpecialsaSEOS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}))
- // G64-DAG: define linkonce_odr dso_local dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @_ZN20ImportInlineSpecialsaSEOS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}))
+ // G32-DAG: define linkonce_odr dso_local x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @_ZN20ImportInlineSpecialsaSEOS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}) %0)
+ // G64-DAG: define linkonce_odr dso_local dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @_ZN20ImportInlineSpecialsaSEOS_(%struct.ImportInlineSpecials* %this, %struct.ImportInlineSpecials* dereferenceable({{[0-9]+}}) %0)
// MO1-DAG: define available_externally dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @"??4ImportInlineSpecials@@QAEAAU0@$$QAU0@@Z"(
// GO1-DAG: define linkonce_odr dso_local x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportInlineSpecials* @_ZN20ImportInlineSpecialsaSEOS_(
__declspec(dllimport) ImportInlineSpecials& operator=(ImportInlineSpecials&&) { return *this; }
@@ -522,34 +522,34 @@
// M32-DAG: declare dllimport x86_thiscallcc %struct.ImportDefaulted* @"??0ImportDefaulted@@QAE@ABU0@@Z"(%struct.ImportDefaulted* returned, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
// M64-DAG: declare dllimport %struct.ImportDefaulted* @"??0ImportDefaulted@@QEAA@AEBU0@@Z"(%struct.ImportDefaulted* returned, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
- // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN15ImportDefaultedC1ERKS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
- // G64-DAG: define linkonce_odr dso_local void @_ZN15ImportDefaultedC1ERKS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
- // MO1-DAG: define available_externally dllimport x86_thiscallcc %struct.ImportDefaulted* @"??0ImportDefaulted@@QAE@ABU0@@Z"(%struct.ImportDefaulted* returned %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
- // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN15ImportDefaultedC1ERKS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
+ // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN15ImportDefaultedC1ERKS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}) %0)
+ // G64-DAG: define linkonce_odr dso_local void @_ZN15ImportDefaultedC1ERKS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}) %0)
+ // MO1-DAG: define available_externally dllimport x86_thiscallcc %struct.ImportDefaulted* @"??0ImportDefaulted@@QAE@ABU0@@Z"(%struct.ImportDefaulted* returned %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}) %0)
+ // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN15ImportDefaultedC1ERKS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}) %0)
__declspec(dllimport) ImportDefaulted(const ImportDefaulted&) = default;
// M32-DAG: declare dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @"??4ImportDefaulted@@QAEAAU0@ABU0@@Z"(%struct.ImportDefaulted*, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
// M64-DAG: declare dllimport dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @"??4ImportDefaulted@@QEAAAEAU0@AEBU0@@Z"(%struct.ImportDefaulted*, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
- // G32-DAG: define linkonce_odr dso_local x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @_ZN15ImportDefaultedaSERKS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
- // G64-DAG: define linkonce_odr dso_local dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @_ZN15ImportDefaultedaSERKS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
- // MO1-DAG: define available_externally dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @"??4ImportDefaulted@@QAEAAU0@ABU0@@Z"(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
- // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @_ZN15ImportDefaultedaSERKS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
+ // G32-DAG: define linkonce_odr dso_local x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @_ZN15ImportDefaultedaSERKS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}) %0)
+ // G64-DAG: define linkonce_odr dso_local dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @_ZN15ImportDefaultedaSERKS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}) %0)
+ // MO1-DAG: define available_externally dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @"??4ImportDefaulted@@QAEAAU0@ABU0@@Z"(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}) %0)
+ // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @_ZN15ImportDefaultedaSERKS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}) %0)
__declspec(dllimport) ImportDefaulted& operator=(const ImportDefaulted&) = default;
// M32-DAG: declare dllimport x86_thiscallcc %struct.ImportDefaulted* @"??0ImportDefaulted@@QAE@$$QAU0@@Z"(%struct.ImportDefaulted* returned, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
// M64-DAG: declare dllimport %struct.ImportDefaulted* @"??0ImportDefaulted@@QEAA@$$QEAU0@@Z"(%struct.ImportDefaulted* returned, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
- // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN15ImportDefaultedC1EOS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
- // G64-DAG: define linkonce_odr dso_local void @_ZN15ImportDefaultedC1EOS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
- // MO1-DAG: define available_externally dllimport x86_thiscallcc %struct.ImportDefaulted* @"??0ImportDefaulted@@QAE@$$QAU0@@Z"(%struct.ImportDefaulted* returned %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
- // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN15ImportDefaultedC1EOS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
+ // G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN15ImportDefaultedC1EOS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}) %0)
+ // G64-DAG: define linkonce_odr dso_local void @_ZN15ImportDefaultedC1EOS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}) %0)
+ // MO1-DAG: define available_externally dllimport x86_thiscallcc %struct.ImportDefaulted* @"??0ImportDefaulted@@QAE@$$QAU0@@Z"(%struct.ImportDefaulted* returned %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}) %0)
+ // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN15ImportDefaultedC1EOS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}) %0)
__declspec(dllimport) ImportDefaulted(ImportDefaulted&&) = default;
// M32-DAG: declare dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @"??4ImportDefaulted@@QAEAAU0@$$QAU0@@Z"(%struct.ImportDefaulted*, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
// M64-DAG: declare dllimport dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @"??4ImportDefaulted@@QEAAAEAU0@$$QEAU0@@Z"(%struct.ImportDefaulted*, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
- // G32-DAG: define linkonce_odr dso_local x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @_ZN15ImportDefaultedaSEOS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
- // G64-DAG: define linkonce_odr dso_local dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @_ZN15ImportDefaultedaSEOS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
- // MO1-DAG: define available_externally dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @"??4ImportDefaulted@@QAEAAU0@$$QAU0@@Z"(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
- // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @_ZN15ImportDefaultedaSEOS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}))
+ // G32-DAG: define linkonce_odr dso_local x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @_ZN15ImportDefaultedaSEOS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}) %0)
+ // G64-DAG: define linkonce_odr dso_local dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @_ZN15ImportDefaultedaSEOS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}) %0)
+ // MO1-DAG: define available_externally dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @"??4ImportDefaulted@@QAEAAU0@$$QAU0@@Z"(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}) %0)
+ // GO1-DAG: define linkonce_odr dso_local x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaulted* @_ZN15ImportDefaultedaSEOS_(%struct.ImportDefaulted* %this, %struct.ImportDefaulted* dereferenceable({{[0-9]+}}) %0)
__declspec(dllimport) ImportDefaulted& operator=(ImportDefaulted&&) = default;
ForceNonTrivial v; // ensure special members are non-trivial
@@ -585,28 +585,28 @@
// M32-DAG: declare dllimport x86_thiscallcc %struct.ImportDefaultedDefs* @"??0ImportDefaultedDefs@@QAE@ABU0@@Z"(%struct.ImportDefaultedDefs* returned, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
// M64-DAG: declare dllimport %struct.ImportDefaultedDefs* @"??0ImportDefaultedDefs@@QEAA@AEBU0@@Z"(%struct.ImportDefaultedDefs* returned, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN19ImportDefaultedDefsC1ERKS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G64-DAG: define linkonce_odr dso_local void @_ZN19ImportDefaultedDefsC1ERKS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
+// G32-DAG: define linkonce_odr dso_local x86_thiscallcc void @_ZN19ImportDefaultedDefsC1ERKS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}) %0)
+// G64-DAG: define linkonce_odr dso_local void @_ZN19ImportDefaultedDefsC1ERKS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}) %0)
inline ImportDefaultedDefs::ImportDefaultedDefs(const ImportDefaultedDefs&) = default;
// M32-DAG: declare dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @"??4ImportDefaultedDefs@@QAEAAU0@ABU0@@Z"(%struct.ImportDefaultedDefs*, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
// M64-DAG: declare dllimport dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @"??4ImportDefaultedDefs@@QEAAAEAU0@AEBU0@@Z"(%struct.ImportDefaultedDefs*, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G32-DAG: define linkonce_odr dso_local x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @_ZN19ImportDefaultedDefsaSERKS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G64-DAG: define linkonce_odr dso_local dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @_ZN19ImportDefaultedDefsaSERKS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
+// G32-DAG: define linkonce_odr dso_local x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @_ZN19ImportDefaultedDefsaSERKS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}) %0)
+// G64-DAG: define linkonce_odr dso_local dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @_ZN19ImportDefaultedDefsaSERKS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}) %0)
inline ImportDefaultedDefs& ImportDefaultedDefs::operator=(const ImportDefaultedDefs&) = default;
-// M32-DAG: define dso_local dllexport x86_thiscallcc %struct.ImportDefaultedDefs* @"??0ImportDefaultedDefs@@QAE@$$QAU0@@Z"(%struct.ImportDefaultedDefs* returned %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// M64-DAG: define dso_local dllexport %struct.ImportDefaultedDefs* @"??0ImportDefaultedDefs@@QEAA@$$QEAU0@@Z"(%struct.ImportDefaultedDefs* returned %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G32-DAG: define dso_local x86_thiscallcc void @_ZN19ImportDefaultedDefsC1EOS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G64-DAG: define dso_local void @_ZN19ImportDefaultedDefsC1EOS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G32-DAG: define dso_local x86_thiscallcc void @_ZN19ImportDefaultedDefsC2EOS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G64-DAG: define dso_local void @_ZN19ImportDefaultedDefsC2EOS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
+// M32-DAG: define dso_local dllexport x86_thiscallcc %struct.ImportDefaultedDefs* @"??0ImportDefaultedDefs@@QAE@$$QAU0@@Z"(%struct.ImportDefaultedDefs* returned %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}) %0)
+// M64-DAG: define dso_local dllexport %struct.ImportDefaultedDefs* @"??0ImportDefaultedDefs@@QEAA@$$QEAU0@@Z"(%struct.ImportDefaultedDefs* returned %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}) %0)
+// G32-DAG: define dso_local x86_thiscallcc void @_ZN19ImportDefaultedDefsC1EOS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}) %0)
+// G64-DAG: define dso_local void @_ZN19ImportDefaultedDefsC1EOS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}) %0)
+// G32-DAG: define dso_local x86_thiscallcc void @_ZN19ImportDefaultedDefsC2EOS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}) %0)
+// G64-DAG: define dso_local void @_ZN19ImportDefaultedDefsC2EOS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}) %0)
ImportDefaultedDefs::ImportDefaultedDefs(ImportDefaultedDefs&&) = default; // dllimport ignored
-// M32-DAG: define dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @"??4ImportDefaultedDefs@@QAEAAU0@$$QAU0@@Z"(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// M64-DAG: define dso_local dllexport dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @"??4ImportDefaultedDefs@@QEAAAEAU0@$$QEAU0@@Z"(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G32-DAG: define dso_local x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @_ZN19ImportDefaultedDefsaSEOS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
-// G64-DAG: define dso_local dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @_ZN19ImportDefaultedDefsaSEOS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}))
+// M32-DAG: define dso_local dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @"??4ImportDefaultedDefs@@QAEAAU0@$$QAU0@@Z"(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}) %0)
+// M64-DAG: define dso_local dllexport dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @"??4ImportDefaultedDefs@@QEAAAEAU0@$$QEAU0@@Z"(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}) %0)
+// G32-DAG: define dso_local x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @_ZN19ImportDefaultedDefsaSEOS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}) %0)
+// G64-DAG: define dso_local dereferenceable({{[0-9]+}}) %struct.ImportDefaultedDefs* @_ZN19ImportDefaultedDefsaSEOS_(%struct.ImportDefaultedDefs* %this, %struct.ImportDefaultedDefs* dereferenceable({{[0-9]+}}) %0)
ImportDefaultedDefs& ImportDefaultedDefs::operator=(ImportDefaultedDefs&&) = default; // dllimport ignored
USESPECIALS(ImportDefaultedDefs)
diff --git a/src/llvm-project/clang/test/CodeGenCXX/dllimport-runtime-fns.cpp b/src/llvm-project/clang/test/CodeGenCXX/dllimport-runtime-fns.cpp
index a42fcce..78ab280 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/dllimport-runtime-fns.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/dllimport-runtime-fns.cpp
@@ -28,14 +28,14 @@
// MSVC: declare dso_local void @__std_terminate()
// _ZSt9terminatev and __cxa_begin_catch should be marked dllimport.
-// ITANIUM-LABEL: define linkonce_odr hidden void @__clang_call_terminate(i8*)
+// ITANIUM-LABEL: define linkonce_odr hidden void @__clang_call_terminate(i8* %0)
// ITANIUM: call i8* @__cxa_begin_catch({{.*}})
// ITANIUM: call void @_ZSt9terminatev()
// ITANIUM: declare dllimport i8* @__cxa_begin_catch(i8*)
// ITANIUM: declare dllimport void @_ZSt9terminatev()
// .. not for mingw.
-// GNU-LABEL: define linkonce_odr hidden void @__clang_call_terminate(i8*)
+// GNU-LABEL: define linkonce_odr hidden void @__clang_call_terminate(i8* %0)
// GNU: call i8* @__cxa_begin_catch({{.*}})
// GNU: call void @_ZSt9terminatev()
// GNU: declare dso_local i8* @__cxa_begin_catch(i8*)
diff --git a/src/llvm-project/clang/test/CodeGenCXX/exceptions.cpp b/src/llvm-project/clang/test/CodeGenCXX/exceptions.cpp
index e31d6fc..302488a 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/exceptions.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/exceptions.cpp
@@ -78,7 +78,7 @@
// rdar://11904428
// Terminate landing pads should call __cxa_begin_catch first.
- // CHECK98: define linkonce_odr hidden void @__clang_call_terminate(i8*) [[NI_NR_NUW:#[0-9]+]] comdat
+ // CHECK98: define linkonce_odr hidden void @__clang_call_terminate(i8* %0) [[NI_NR_NUW:#[0-9]+]] comdat
// CHECK98-NEXT: [[T0:%.*]] = call i8* @__cxa_begin_catch(i8* %0) [[NUW:#[0-9]+]]
// CHECK98-NEXT: call void @_ZSt9terminatev() [[NR_NUW:#[0-9]+]]
// CHECK98-NEXT: unreachable
diff --git a/src/llvm-project/clang/test/CodeGenCXX/global-init.cpp b/src/llvm-project/clang/test/CodeGenCXX/global-init.cpp
index f96e603..1970de8 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/global-init.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/global-init.cpp
@@ -1,7 +1,6 @@
// 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 CHECK-NOEXC %s
-// RUN: %clang_cc1 -triple=x86_64-apple-darwin10 -emit-llvm \
-// RUN: -momit-leaf-frame-pointer -mdisable-fp-elim %s -o - \
+// RUN: %clang_cc1 -triple=x86_64-apple-darwin10 -emit-llvm -mframe-pointer=non-leaf %s -o - \
// RUN: | FileCheck -check-prefix CHECK-FP %s
struct A {
@@ -208,4 +207,4 @@
// PR21811: attach the appropriate attribute to the global init function
// CHECK-FP: define internal void @_GLOBAL__sub_I_global_init.cpp() [[NUX:#[0-9]+]] section "__TEXT,__StaticInit,regular,pure_instructions" {
-// CHECK-FP: attributes [[NUX]] = { noinline nounwind {{.*}}"no-frame-pointer-elim-non-leaf"{{.*}} }
+// CHECK-FP: attributes [[NUX]] = { noinline nounwind {{.*}}"frame-pointer"="non-leaf"{{.*}} }
diff --git a/src/llvm-project/clang/test/CodeGenCXX/guard_nocf.cpp b/src/llvm-project/clang/test/CodeGenCXX/guard_nocf.cpp
new file mode 100644
index 0000000..3dc5c50
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCXX/guard_nocf.cpp
@@ -0,0 +1,84 @@
+// RUN: %clang_cc1 -triple %ms_abi_triple -fms-extensions -std=c++11 -emit-llvm -O2 -o - %s | FileCheck %s
+
+void target_func();
+void (*func_ptr)() = &target_func;
+
+// The "guard_nocf" attribute must be added.
+__declspec(guard(nocf)) void nocf0() {
+ (*func_ptr)();
+}
+// CHECK-LABEL: nocf0
+// CHECK: call{{.*}}[[NOCF:#[0-9]+]]
+
+// The "guard_nocf" attribute must *not* be added.
+void cf0() {
+ (*func_ptr)();
+}
+// CHECK-LABEL: cf0
+// CHECK: call{{.*}}[[CF:#[0-9]+]]
+
+// If the modifier is present on either the function declaration or definition,
+// the "guard_nocf" attribute must be added.
+__declspec(guard(nocf)) void nocf1();
+void nocf1() {
+ (*func_ptr)();
+}
+// CHECK-LABEL: nocf1
+// CHECK: call{{.*}}[[NOCF:#[0-9]+]]
+
+void nocf2();
+__declspec(guard(nocf)) void nocf2() {
+ (*func_ptr)();
+}
+// CHECK-LABEL: nocf2
+// CHECK: call{{.*}}[[NOCF:#[0-9]+]]
+
+// When inlining a function, the "guard_nocf" attribute on indirect calls must
+// be preserved.
+void nocf3() {
+ nocf0();
+}
+// CHECK-LABEL: nocf3
+// CHECK: call{{.*}}[[NOCF:#[0-9]+]]
+
+// When inlining into a function marked as __declspec(guard(nocf)), the
+// "guard_nocf" attribute must *not* be added to the inlined calls.
+__declspec(guard(nocf)) void cf1() {
+ cf0();
+}
+// CHECK-LABEL: cf1
+// CHECK: call{{.*}}[[CF:#[0-9]+]]
+
+// When the __declspec(guard(nocf)) modifier is present on an override function,
+// the "guard_nocf" attribute must be added.
+struct Base {
+ virtual void nocf4();
+};
+
+struct Derived : Base {
+ __declspec(guard(nocf)) void nocf4() override {
+ (*func_ptr)();
+ }
+};
+Derived d;
+// CHECK-LABEL: nocf4
+// CHECK: call{{.*}}[[NOCF:#[0-9]+]]
+
+// When the modifier is not present on an override function, the "guard_nocf"
+// attribute must *not* be added, even if the modifier is present on the virtual
+// function.
+struct Base1 {
+ __declspec(guard(nocf)) virtual void cf2();
+};
+
+struct Derived1 : Base1 {
+ void cf2() override {
+ (*func_ptr)();
+ }
+};
+Derived1 d1;
+// CHECK-LABEL: cf2
+// CHECK: call{{.*}}[[CF:#[0-9]+]]
+
+// CHECK: attributes [[NOCF]] = { {{.*}}"guard_nocf"{{.*}} }
+// CHECK-NOT: attributes [[CF]] = { {{.*}}"guard_nocf"{{.*}} }
diff --git a/src/llvm-project/clang/test/CodeGenCXX/implicit-copy-constructor.cpp b/src/llvm-project/clang/test/CodeGenCXX/implicit-copy-constructor.cpp
index 3f8665a..323ab2f 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/implicit-copy-constructor.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/implicit-copy-constructor.cpp
@@ -40,7 +40,7 @@
D d2(d);
}
-// CHECK-LABEL: define linkonce_odr void @_ZN1DC1ERS_(%struct.D* %this, %struct.D* dereferenceable({{[0-9]+}})) unnamed_addr
+// CHECK-LABEL: define linkonce_odr void @_ZN1DC1ERS_(%struct.D* %this, %struct.D* dereferenceable({{[0-9]+}}) %0) unnamed_addr
// CHECK: call void @_ZN1AC1Ev
// CHECK: call void @_ZN1CC2ERS_1A
// CHECK: call void @_ZN1AD1Ev
diff --git a/src/llvm-project/clang/test/CodeGenCXX/implicit-function-conversion.cpp b/src/llvm-project/clang/test/CodeGenCXX/implicit-function-conversion.cpp
new file mode 100644
index 0000000..2d14c6a
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCXX/implicit-function-conversion.cpp
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-unknown-linux -std=c++17 | FileCheck %s
+
+double a(double) noexcept;
+int b(double (&)(double));
+
+// CHECK: call i32 @_Z1bRFddE(double (double)* @_Z1ad)
+int c = b(a);
diff --git a/src/llvm-project/clang/test/CodeGenCXX/lifetime-asan.cpp b/src/llvm-project/clang/test/CodeGenCXX/lifetime-asan.cpp
deleted file mode 100644
index 9ccb28c..0000000
--- a/src/llvm-project/clang/test/CodeGenCXX/lifetime-asan.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-// RUN: %clang -target x86_64-linux-gnu -S -emit-llvm -o - -fno-exceptions -O0 %s | FileCheck %s -check-prefixes=CHECK,CHECK-O0 --implicit-check-not=llvm.lifetime
-// RUN: %clang -target x86_64-linux-gnu -S -emit-llvm -o - -fno-exceptions -O0 \
-// RUN: -fsanitize=address -fsanitize-address-use-after-scope %s | \
-// RUN: FileCheck %s -check-prefixes=CHECK,CHECK-ASAN-USE-AFTER-SCOPE
-
-extern int bar(char *A, int n);
-
-struct X { X(); ~X(); int *p; };
-struct Y { Y(); int *p; };
-
-extern "C" void a(), b(), c(), d();
-
-// CHECK-LABEL: @_Z3foo
-void foo(int n) {
- // CHECK: call void @a()
- a();
-
- // CHECK: call void @b()
- // CHECK-ASAN-USE-AFTER-SCOPE: store i1 false
- // CHECK-ASAN-USE-AFTER-SCOPE: store i1 false
- // CHECK: br i1
- //
- // CHECK-ASAN-USE-AFTER-SCOPE: @llvm.lifetime.start
- // CHECK-ASAN-USE-AFTER-SCOPE: store i1 true
- // CHECK: call void @_ZN1XC
- // CHECK: br label
- //
- // CHECK-ASAN-USE-AFTER-SCOPE: @llvm.lifetime.start
- // CHECK-ASAN-USE-AFTER-SCOPE: store i1 true
- // CHECK: call void @_ZN1YC
- // CHECK: br label
- //
- // CHECK: call void @c()
- // CHECK-ASAN-USE-AFTER-SCOPE: br i1
- // CHECK-ASAN-USE-AFTER-SCOPE: @llvm.lifetime.end
- // CHECK-ASAN-USE-AFTER-SCOPE: br i1
- // CHECK-ASAN-USE-AFTER-SCOPE: @llvm.lifetime.end
- b(), (n ? X().p : Y().p), c();
-
- // CHECK: call void @d()
- d();
-}
diff --git a/src/llvm-project/clang/test/CodeGenCXX/lifetime-sanitizer.cpp b/src/llvm-project/clang/test/CodeGenCXX/lifetime-sanitizer.cpp
new file mode 100644
index 0000000..15ec3a9
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCXX/lifetime-sanitizer.cpp
@@ -0,0 +1,59 @@
+// RUN: %clang -w -target x86_64-linux-gnu -S -emit-llvm -o - -fno-exceptions -O0 %s | \
+// RUN: FileCheck %s -check-prefixes=CHECK,CHECK-O0 --implicit-check-not=llvm.lifetime
+// RUN: %clang -w -target x86_64-linux-gnu -S -emit-llvm -o - -fno-exceptions -O0 \
+// RUN: -fsanitize=address -fsanitize-address-use-after-scope %s | \
+// RUN: FileCheck %s -check-prefixes=CHECK,LIFETIME
+// RUN: %clang -w -target x86_64-linux-gnu -S -emit-llvm -o - -fno-exceptions -O0 \
+// RUN: -fsanitize=memory %s | \
+// RUN: FileCheck %s -check-prefixes=CHECK,LIFETIME
+// RUN: %clang -w -target aarch64-linux-gnu -S -emit-llvm -o - -fno-exceptions -O0 \
+// RUN: -fsanitize=hwaddress %s | \
+// RUN: FileCheck %s -check-prefixes=CHECK,LIFETIME
+
+extern int bar(char *A, int n);
+
+struct X {
+ X();
+ ~X();
+ int *p;
+};
+struct Y {
+ Y();
+ int *p;
+};
+
+extern "C" void a(), b(), c(), d();
+
+// CHECK: define dso_local void @_Z3fooi(i32 %[[N:[^)]+]])
+void foo(int n) {
+ // CHECK: store i32 %[[N]], i32* %[[NADDR:[^,]+]]
+ // CHECK-LABEL: call void @a()
+ a();
+
+ // CHECK-LABEL: call void @b()
+ // CHECK: [[NARG:%[^ ]+]] = load i32, i32* %[[NADDR]]
+ // CHECK: [[BOOL:%[^ ]+]] = icmp ne i32 [[NARG]], 0
+ // CHECK: store i1 false
+ // CHECK: br i1 [[BOOL]], label %[[ONTRUE:[^,]+]], label %[[ONFALSE:[^,]+]]
+ //
+ // CHECK: [[ONTRUE]]:
+ // LIFETIME: @llvm.lifetime.start
+ // LIFETIME: store i1 true
+ // LIFETIME: call void @_ZN1XC
+ // CHECK: br label %[[END:[^,]+]]
+ //
+ // CHECK: [[ONFALSE]]:
+ // LIFETIME: @llvm.lifetime.start
+ // LIFETIME: store i1 true
+ // LIFETIME: call void @_ZN1YC
+ // CHECK: br label %[[END]]
+ //
+ // CHECK: [[END]]:
+ // CHECK: call void @c()
+ // LIFETIME: @llvm.lifetime.end
+ // LIFETIME: @llvm.lifetime.end
+ b(), (n ? X().p : Y().p), c();
+
+ // CHECK: call void @d()
+ d();
+}
diff --git a/src/llvm-project/clang/test/CodeGenCXX/linetable-virtual-variadic.cpp b/src/llvm-project/clang/test/CodeGenCXX/linetable-virtual-variadic.cpp
index 60dee5f..fd65e98 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/linetable-virtual-variadic.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/linetable-virtual-variadic.cpp
@@ -1,5 +1,6 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -debug-info-kind=line-tables-only %s -o - | FileCheck %s
-// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -debug-info-kind=line-directives-only %s -o - | FileCheck %s
+// Sparc64 is used because AArch64 and X86_64 would both use musttail.
+// RUN: %clang_cc1 -triple sparc64-linux-gnu -emit-llvm -debug-info-kind=line-tables-only %s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple sparc64-linux-gnu -emit-llvm -debug-info-kind=line-directives-only %s -o - | FileCheck %s
// Crasher for PR22929.
class Base {
virtual void VariadicFunction(...);
diff --git a/src/llvm-project/clang/test/CodeGenCXX/mangle-concept.cpp b/src/llvm-project/clang/test/CodeGenCXX/mangle-concept.cpp
new file mode 100644
index 0000000..b0fcd58
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCXX/mangle-concept.cpp
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 -verify -Wno-return-type -Wno-main -std=c++2a -emit-llvm -triple %itanium_abi_triple -o - %s | FileCheck %s
+// expected-no-diagnostics
+
+namespace test1 {
+template <bool> struct S {};
+template <typename> concept C = true;
+template <typename T = int> S<C<T>> f0() { return S<C<T>>{}; }
+template S<C<int>> f0<>();
+// CHECK: @_ZN5test12f0IiEENS_1SIXL_ZNS_1CIT_EEEEEEv(
+}
+
+template <bool> struct S {};
+template <typename> concept C = true;
+template <typename T = int> S<C<T>> f0() { return S<C<T>>{}; }
+template S<C<int>> f0<>();
+// CHECK: @_Z2f0IiE1SIXL_Z1CIT_EEEEv(
diff --git a/src/llvm-project/clang/test/CodeGenCXX/mangle-cxx2a.cpp b/src/llvm-project/clang/test/CodeGenCXX/mangle-cxx2a.cpp
new file mode 100644
index 0000000..3e46899
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCXX/mangle-cxx2a.cpp
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-linux-gnu -std=c++2a | FileCheck %s
+
+namespace spaceship {
+ struct X {};
+ struct Y {};
+ int operator<=>(X, Y);
+
+ // CHECK-LABEL: define {{.*}} @_ZN9spaceship1fIiEEvDTcmltcvNS_1YE_EcvNS_1XE_EcvT__EE
+ template<typename T> void f(decltype(Y() < X(), T()) x) {}
+ template void f<int>(int);
+}
diff --git a/src/llvm-project/clang/test/CodeGenCXX/mangle-exprs.cpp b/src/llvm-project/clang/test/CodeGenCXX/mangle-exprs.cpp
index 6c46402..1b99272 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/mangle-exprs.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/mangle-exprs.cpp
@@ -373,3 +373,19 @@
template<typename T> void f(decltype(T{.a.b[3][1 ... 4] = 9}) x) {}
void use_f(A a) { f<A>(a); }
}
+
+namespace null {
+ template <decltype(nullptr) P>
+ void cpp_nullptr(typename enable_if<P == nullptr>::type* = 0) {
+ }
+
+ template <void *P>
+ void gnu_null(typename enable_if<P == __null>::type* = 0) {
+ }
+
+ // CHECK-LABEL: define {{.*}} @_ZN4null11cpp_nullptrILDn0EEEvPN9enable_ifIXeqT_LDnEEvE4typeE
+ template void cpp_nullptr<nullptr>(void *);
+
+ // CHECK-LABEL: define {{.*}} @_ZN4null8gnu_nullILPv0EEEvPN9enable_ifIXeqT_Ll0EEvE4typeE
+ template void gnu_null<nullptr>(void *);
+}
diff --git a/src/llvm-project/clang/test/CodeGenCXX/mangle-lambda-explicit-template-params.cpp b/src/llvm-project/clang/test/CodeGenCXX/mangle-lambda-explicit-template-params.cpp
index 3bec641..45fdec3 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/mangle-lambda-explicit-template-params.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/mangle-lambda-explicit-template-params.cpp
@@ -32,3 +32,75 @@
void call_inline_func() {
inline_func();
}
+
+template<typename T, int> struct X {};
+
+inline auto pack = []<typename ...T, T ...N>(T (&...)[N]) {};
+int arr1[] = {1};
+int arr2[] = {1, 2};
+// CHECK: @_ZNK4packMUlTpTyTpTnT_DpRAT0__S_E_clIJiiEJLi1ELi2EEEEDaS2_(
+void use_pack() { pack(arr1, arr2); }
+
+inline void collision() {
+ auto a = []<typename T, template<typename U, T> typename>{};
+ auto b = []<typename T, template<typename U, U> typename>{};
+ auto c = []<typename T, template<typename U, T> typename>{};
+ a.operator()<int, X>();
+ // CHECK: @_ZZ9collisionvENKUlTyTtTyTnT_EvE_clIi1XEEDav
+ b.operator()<int, X>();
+ // CHECK: @_ZZ9collisionvENKUlTyTtTyTnTL0__EvE_clIi1XEEDav
+ c.operator()<int, X>();
+ // CHECK: @_ZZ9collisionvENKUlTyTtTyTnT_EvE0_clIi1XEEDav
+}
+void use_collision() { collision(); }
+
+namespace pack_not_pack_expansion {
+ template<typename T, int, T...> struct X;
+ // CHECK: @_ZNK23pack_not_pack_expansion1xMUlTyTtTyTnT_TpTnTL0__ETpTyvE_clIiNS_1XEJfEEEDav
+ inline auto x = []<typename T, template<typename U, T, U...> typename, typename ...V>(){}; void f() { x.operator()<int, X, float>(); }
+}
+
+template<typename> void f() {
+ // CHECK: define linkonce_odr {{.*}} @_ZZ1fIiEvvENKUlT_E_clIiEEDaS0_(
+ auto x = [](auto){};
+ x(0);
+}
+void use_f() { f<int>(); }
+
+template<typename> struct Y {
+ template<int> struct Z {};
+};
+
+template<typename ...T> void expanded() {
+ auto x = []<T..., template<T> typename...>{};
+ auto y = []<int, template<int> typename>{};
+ auto z = []<int, int, template<int> typename, template<int> typename>{};
+ // FIXME: Should we really require 'template' for y and z?
+ x.template operator()<(T())..., Y<T>::template Z...>();
+ y.template operator()<0, Y<int>::Z>();
+ y.template operator()<1, Y<int>::Z>();
+ z.template operator()<1, 2, Y<int>::Z, Y<float>::Z>();
+}
+void use_expanded() {
+ // CHECK: @_ZZ8expandedIJEEvvENKUlvE_clIJEJEEEDav(
+ // CHECK: @_ZZ8expandedIJEEvvENKUlTniTtTniEvE_clILi0EN1YIiE1ZEEEDav(
+ // CHECK: @_ZZ8expandedIJEEvvENKUlTniTtTniEvE_clILi1EN1YIiE1ZEEEDav(
+ // CHECK: @_ZZ8expandedIJEEvvENKUlTniTniTtTniETtTniEvE_clILi1ELi2EN1YIiE1ZENS2_IfE1ZEEEDav(
+ expanded<>();
+
+ // FIXME: Should we really be using J...E for arguments corresponding to an
+ // expanded parameter pack?
+ // Note that the <lambda-sig>s of 'x' and 'y' collide here, after pack expansion.
+ // CHECK: @_ZZ8expandedIJiEEvvENKUlTniTtTniEvE_clIJLi0EEJN1YIiE1ZEEEEDav(
+ // CHECK: @_ZZ8expandedIJiEEvvENKUlTniTtTniEvE0_clILi0EN1YIiE1ZEEEDav(
+ // CHECK: @_ZZ8expandedIJiEEvvENKUlTniTtTniEvE0_clILi1EN1YIiE1ZEEEDav(
+ // CHECK: @_ZZ8expandedIJiEEvvENKUlTniTniTtTniETtTniEvE_clILi1ELi2EN1YIiE1ZENS2_IfE1ZEEEDav(
+ expanded<int>();
+
+ // Note that the <lambda-sig>s of 'x' and 'z' collide here, after pack expansion.
+ // CHECK: @_ZZ8expandedIJiiEEvvENKUlTniTniTtTniETtTniEvE_clIJLi0ELi0EEJN1YIiE1ZES4_EEEDav(
+ // CHECK: @_ZZ8expandedIJiiEEvvENKUlTniTtTniEvE_clILi0EN1YIiE1ZEEEDav(
+ // CHECK: @_ZZ8expandedIJiiEEvvENKUlTniTtTniEvE_clILi1EN1YIiE1ZEEEDav(
+ // CHECK: @_ZZ8expandedIJiiEEvvENKUlTniTniTtTniETtTniEvE0_clILi1ELi2EN1YIiE1ZENS2_IfE1ZEEEDav(
+ expanded<int, int>();
+}
diff --git a/src/llvm-project/clang/test/CodeGenCXX/mangle-lambdas.cpp b/src/llvm-project/clang/test/CodeGenCXX/mangle-lambdas.cpp
index d49ed4b..fcca878 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/mangle-lambdas.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/mangle-lambdas.cpp
@@ -178,18 +178,24 @@
}
namespace std {
- struct type_info;
+ struct type_info {
+ bool before(const type_info &) const noexcept;
+ };
}
namespace PR12123 {
struct A { virtual ~A(); } g;
+ struct C { virtual ~C(); } k;
struct B {
void f(const std::type_info& x = typeid([]()->A& { return g; }()));
void h();
+ void j(bool cond = typeid([]() -> A & { return g; }()).before(typeid([]() -> C & { return k; }())));
};
- void B::h() { f(); }
+ void B::h() { f(); j(); }
}
// CHECK-LABEL: define linkonce_odr dereferenceable({{[0-9]+}}) %"struct.PR12123::A"* @_ZZN7PR121231B1fERKSt9type_infoEd_NKUlvE_clEv
+// CHECK-LABEL: define linkonce_odr dereferenceable({{[0-9]+}}) %"struct.PR12123::A"* @_ZZN7PR121231B1jEbEd_NKUlvE_clEv
+// CHECK-LABEL: define linkonce_odr dereferenceable({{[0-9]+}}) %"struct.PR12123::C"* @_ZZN7PR121231B1jEbEd_NKUlvE0_clEv
// CHECK-LABEL: define {{.*}} @_Z{{[0-9]*}}testVarargsLambdaNumberingv(
inline int testVarargsLambdaNumbering() {
diff --git a/src/llvm-project/clang/test/CodeGenCXX/mangle-ms-back-references.cpp b/src/llvm-project/clang/test/CodeGenCXX/mangle-ms-back-references.cpp
index cd4d1e2..cb95c10 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/mangle-ms-back-references.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/mangle-ms-back-references.cpp
@@ -66,3 +66,20 @@
void foo() { }
// CHECK: "?foo@0@YAXXZ"
}
+
+class T01;
+class T02;
+class T03;
+class T04;
+class T05;
+class T06;
+class T07;
+class T08;
+class T09;
+class T10;
+class T11;
+template <typename T>
+class H;
+
+void ManyParams(T01 &, T02 &, T03 &, T04 &, T05 &, T06 &, T07 &, T08 &, T09 &, T10 &, H<T11> &, H<T11> &) {}
+// CHECK: "?ManyParams@@YAXAAVT01@@AAVT02@@AAVT03@@AAVT04@@AAVT05@@AAVT06@@AAVT07@@AAVT08@@AAVT09@@AAVT10@@AAV?$H@VT11@@@@AAV?$H@VT11@@@@@Z"
diff --git a/src/llvm-project/clang/test/CodeGenCXX/mangle-ms-cxx17.cpp b/src/llvm-project/clang/test/CodeGenCXX/mangle-ms-cxx17.cpp
new file mode 100644
index 0000000..897f0d6
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCXX/mangle-ms-cxx17.cpp
@@ -0,0 +1,21 @@
+// RUN: %clang_cc1 -std=c++1z -fms-extensions -emit-llvm %s -o - -triple=i386-pc-win32 -fms-compatibility-version=19.10 | FileCheck -allow-deprecated-dag-overlap %s --check-prefix=CHECK --check-prefix=MSVC2017
+// RUN: %clang_cc1 -std=c++1z -fms-extensions -emit-llvm %s -o - -triple=i386-pc-win32 -fms-compatibility-version=19.00 | FileCheck -allow-deprecated-dag-overlap %s --check-prefix=CHECK --check-prefix=MSVC2015
+
+struct S {
+ int x;
+ double y;
+};
+S f();
+
+// CHECK-DAG: "?$S1@@3US@@B"
+const auto [x0, y0] = f();
+// CHECK-DAG: "?$S2@@3US@@B"
+const auto [x1, y1] = f();
+
+static union {
+int a;
+double b;
+};
+
+// CHECK-DAG: "?$S4@@3US@@B"
+const auto [x2, y2] = f();
diff --git a/src/llvm-project/clang/test/CodeGenCXX/mangle-ptr-size-address-space.cpp b/src/llvm-project/clang/test/CodeGenCXX/mangle-ptr-size-address-space.cpp
new file mode 100644
index 0000000..a56b455
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCXX/mangle-ptr-size-address-space.cpp
@@ -0,0 +1,18 @@
+// RUN: %clang_cc1 -fms-extensions -emit-llvm -triple x86_64-linux-gnu -o - %s | FileCheck %s --check-prefixes=CHECK
+// RUN: %clang_cc1 -fms-extensions -emit-llvm -triple x86_64-windows-msvc -o - %s | FileCheck %s --check-prefixes=WIN
+
+// CHECK-LABEL: define {{.*}}void @_Z2f0PU10ptr32_sptri
+// WIN-LABEL: define {{.*}}void @"?f0@@YAXPAH@Z"
+void f0(int * __ptr32 p) {}
+
+// CHECK-LABEL: define {{.*}}i8 addrspace(271)* @_Z2f1PU10ptr32_sptri
+// WIN-LABEL: define {{.*}}i8 addrspace(271)* @"?f1@@YAPAXPAH@Z"
+void * __ptr32 __uptr f1(int * __ptr32 p) { return 0; }
+
+// CHECK-LABEL: define {{.*}}void @_Z2f2Pi
+// WIN-LABEL: define {{.*}}void @"?f2@@YAXPEAH@Z"
+void f2(int * __ptr64 p) {}
+
+// CHECK-LABEL: define {{.*}}i8* @_Z2f3Pi
+// WIN-LABEL: define {{.*}}i8* @"?f3@@YAPEAXPEAH@Z"
+void * __ptr64 f3(int * __ptr64 p) { return 0; }
diff --git a/src/llvm-project/clang/test/CodeGenCXX/mangle.cpp b/src/llvm-project/clang/test/CodeGenCXX/mangle.cpp
index 919f8af..8fde95f 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/mangle.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/mangle.cpp
@@ -960,7 +960,7 @@
template <typename T>
void f(enum T::e *) {}
template void f<S>(S::e *);
- // CHECK-LABEL: define weak_odr void @_ZN6test451fINS_1SEEEvPTeNT_1eE(i32*)
+ // CHECK-LABEL: define weak_odr void @_ZN6test451fINS_1SEEEvPTeNT_1eE(i32* %0)
}
namespace test46 {
@@ -970,7 +970,7 @@
template <typename T>
void f(struct T::s *) {}
template void f<S>(S::s *);
- // CHECK-LABEL: define weak_odr void @_ZN6test461fINS_1SEEEvPTsNT_1sE(%"struct.test46::S::s"*)
+ // CHECK-LABEL: define weak_odr void @_ZN6test461fINS_1SEEEvPTsNT_1sE(%"struct.test46::S::s"* %0)
}
namespace test47 {
@@ -980,7 +980,7 @@
template <typename T>
void f(class T::c *) {}
template void f<S>(S::c *);
- // CHECK-LABEL: define weak_odr void @_ZN6test471fINS_1SEEEvPTsNT_1cE(%"class.test47::S::c"*)
+ // CHECK-LABEL: define weak_odr void @_ZN6test471fINS_1SEEEvPTsNT_1cE(%"class.test47::S::c"* %0)
}
namespace test48 {
@@ -990,7 +990,7 @@
template <typename T>
void f(union T::u *) {}
template void f<S>(S::u *);
- // CHECK-LABEL: define weak_odr void @_ZN6test481fINS_1SEEEvPTuNT_1uE(%"union.test48::S::u"*)
+ // CHECK-LABEL: define weak_odr void @_ZN6test481fINS_1SEEEvPTuNT_1uE(%"union.test48::S::u"* %0)
}
namespace test49 {
diff --git a/src/llvm-project/clang/test/CodeGenCXX/may_alias.cpp b/src/llvm-project/clang/test/CodeGenCXX/may_alias.cpp
new file mode 100644
index 0000000..fbc4e22
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCXX/may_alias.cpp
@@ -0,0 +1,25 @@
+// RUN: %clang_cc1 %s -triple %itanium_abi_triple -emit-llvm -O2 -disable-llvm-passes -o - | FileCheck %s
+// RUN: %clang_cc1 %s -triple %ms_abi_triple -emit-llvm -O2 -disable-llvm-passes -o - | FileCheck %s
+
+enum class __attribute__((may_alias)) E {};
+
+template<typename T> struct A {
+ using B __attribute__((may_alias)) = enum {};
+};
+
+template<typename T> using Alias = typename A<T>::B;
+
+// CHECK-LABEL: define {{.*}}foo
+// CHECK: load i{{[0-9]*}}, {{.*}}, !tbaa ![[MAY_ALIAS:[^ ,]*]]
+auto foo(E &r) { return r; }
+
+// CHECK-LABEL: define {{.*}}goo
+// CHECK: load i{{[0-9]*}}, {{.*}}, !tbaa ![[MAY_ALIAS]]
+auto goo(A<int>::B &r) { return r; }
+
+// CHECK-LABEL: define {{.*}}hoo
+// CHECK: load i{{[0-9]*}}, {{.*}}, !tbaa ![[MAY_ALIAS]]
+auto hoo(Alias<int> &r) { return r; }
+
+// CHECK: ![[CHAR:.*]] = !{!"omnipotent char", !{{.*}}, i64 0}
+// CHECK: ![[MAY_ALIAS]] = !{![[CHAR]], ![[CHAR]], i64 0}
diff --git a/src/llvm-project/clang/test/CodeGenCXX/member-templates.cpp b/src/llvm-project/clang/test/CodeGenCXX/member-templates.cpp
index 93d36ff..097cc32 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/member-templates.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/member-templates.cpp
@@ -15,8 +15,8 @@
template<typename T> B::B(T) {}
-// CHECK-LABEL: 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 %0) unnamed_addr
+// CHECK-LABEL: define weak_odr void @_ZN1BC1IiEET_(%struct.B* %this, i32 %0) unnamed_addr
template B::B(int);
template<typename T>
diff --git a/src/llvm-project/clang/test/CodeGenCXX/microsoft-abi-arg-order.cpp b/src/llvm-project/clang/test/CodeGenCXX/microsoft-abi-arg-order.cpp
index df945f9..7a162e9 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/microsoft-abi-arg-order.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/microsoft-abi-arg-order.cpp
@@ -14,7 +14,7 @@
// Order of destruction should be left to right.
//
// X86-LABEL: define dso_local void @"?foo@@YAXUA@@00@Z"
-// X86: ([[argmem_ty:<{ %struct.A, %struct.A, %struct.A }>]]* inalloca)
+// X86: ([[argmem_ty:<{ %struct.A, %struct.A, %struct.A }>]]* inalloca %0)
// X86: %[[a:[^ ]*]] = getelementptr inbounds [[argmem_ty]], [[argmem_ty]]* %0, i32 0, i32 0
// X86: %[[b:[^ ]*]] = getelementptr inbounds [[argmem_ty]], [[argmem_ty]]* %0, i32 0, i32 1
// X86: %[[c:[^ ]*]] = getelementptr inbounds [[argmem_ty]], [[argmem_ty]]* %0, i32 0, i32 2
diff --git a/src/llvm-project/clang/test/CodeGenCXX/microsoft-abi-byval-sret.cpp b/src/llvm-project/clang/test/CodeGenCXX/microsoft-abi-byval-sret.cpp
index cbedec6..2c940d2 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/microsoft-abi-byval-sret.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/microsoft-abi-byval-sret.cpp
@@ -19,7 +19,7 @@
}
// CHECK-LABEL: define dso_local x86_thiscallcc %struct.A* @"?foo@B@@QAE?AUA@@U2@@Z"
-// CHECK: (%struct.B* %this, <{ %struct.A*, %struct.A }>* inalloca)
+// CHECK: (%struct.B* %this, <{ %struct.A*, %struct.A }>* inalloca %0)
// CHECK: getelementptr inbounds <{ %struct.A*, %struct.A }>, <{ %struct.A*, %struct.A }>* %{{.*}}, i32 0, i32 0
// CHECK: load %struct.A*, %struct.A**
// CHECK: ret %struct.A*
@@ -29,7 +29,7 @@
}
// CHECK-LABEL: define dso_local %struct.A* @"?bar@B@@QAA?AUA@@U2@@Z"
-// CHECK: (<{ %struct.B*, %struct.A*, %struct.A }>* inalloca)
+// CHECK: (<{ %struct.B*, %struct.A*, %struct.A }>* inalloca %0)
// CHECK: getelementptr inbounds <{ %struct.B*, %struct.A*, %struct.A }>, <{ %struct.B*, %struct.A*, %struct.A }>* %{{.*}}, i32 0, i32 1
// CHECK: load %struct.A*, %struct.A**
// CHECK: ret %struct.A*
@@ -39,7 +39,7 @@
}
// CHECK-LABEL: define dso_local x86_stdcallcc %struct.A* @"?baz@B@@QAG?AUA@@U2@@Z"
-// CHECK: (<{ %struct.B*, %struct.A*, %struct.A }>* inalloca)
+// CHECK: (<{ %struct.B*, %struct.A*, %struct.A }>* inalloca %0)
// CHECK: getelementptr inbounds <{ %struct.B*, %struct.A*, %struct.A }>, <{ %struct.B*, %struct.A*, %struct.A }>* %{{.*}}, i32 0, i32 1
// CHECK: load %struct.A*, %struct.A**
// CHECK: ret %struct.A*
@@ -49,7 +49,7 @@
}
// CHECK-LABEL: define dso_local x86_fastcallcc void @"?qux@B@@QAI?AUA@@U2@@Z"
-// CHECK: (%struct.B* inreg %this, %struct.A* inreg noalias sret %agg.result, <{ %struct.A }>* inalloca)
+// CHECK: (%struct.B* inreg %this, %struct.A* inreg noalias sret %agg.result, <{ %struct.A }>* inalloca %0)
// CHECK: ret void
int main() {
diff --git a/src/llvm-project/clang/test/CodeGenCXX/microsoft-abi-byval-thunks.cpp b/src/llvm-project/clang/test/CodeGenCXX/microsoft-abi-byval-thunks.cpp
index 45dd4d0..ed4e1fb 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/microsoft-abi-byval-thunks.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/microsoft-abi-byval-thunks.cpp
@@ -15,7 +15,7 @@
C::C() {} // force emission
// CHECK32-LABEL: define linkonce_odr dso_local x86_thiscallcc void @"?foo@C@byval_thunk@@W3AEXUAgg@2@@Z"
-// CHECK32: (%"struct.byval_thunk::C"* %this, <{ %"struct.byval_thunk::Agg" }>* inalloca)
+// CHECK32: (%"struct.byval_thunk::C"* %this, <{ %"struct.byval_thunk::Agg" }>* inalloca %0)
// CHECK32: getelementptr i8, i8* %{{.*}}, i32 -4
// CHECK32: musttail call x86_thiscallcc void @"?foo@C@byval_thunk@@UAEXUAgg@2@@Z"
// CHECK32: (%"struct.byval_thunk::C"* %{{.*}}, <{ %"struct.byval_thunk::Agg" }>* inalloca %0)
@@ -44,7 +44,7 @@
C::C() {} // force emission
// CHECK32-LABEL: define linkonce_odr dso_local x86_stdcallcc void @"?foo@C@stdcall_thunk@@W3AGXUAgg@2@@Z"
-// CHECK32: (<{ %"struct.stdcall_thunk::C"*, %"struct.stdcall_thunk::Agg" }>* inalloca)
+// CHECK32: (<{ %"struct.stdcall_thunk::C"*, %"struct.stdcall_thunk::Agg" }>* inalloca %0)
// CHECK32: %[[this_slot:[^ ]*]] = getelementptr inbounds <{ %"struct.stdcall_thunk::C"*, %"struct.stdcall_thunk::Agg" }>, <{ %"struct.stdcall_thunk::C"*, %"struct.stdcall_thunk::Agg" }>* %0, i32 0, i32 0
// CHECK32: load %"struct.stdcall_thunk::C"*, %"struct.stdcall_thunk::C"** %[[this_slot]]
// CHECK32: getelementptr i8, i8* %{{.*}}, i32 -4
@@ -76,7 +76,7 @@
C::C() {} // force emission
// CHECK32-LABEL: define linkonce_odr dso_local %"struct.sret_thunk::Agg"* @"?foo@C@sret_thunk@@W3AA?AUAgg@2@U32@@Z"
-// CHECK32: (<{ %"struct.sret_thunk::C"*, %"struct.sret_thunk::Agg"*, %"struct.sret_thunk::Agg" }>* inalloca)
+// CHECK32: (<{ %"struct.sret_thunk::C"*, %"struct.sret_thunk::Agg"*, %"struct.sret_thunk::Agg" }>* inalloca %0)
// CHECK32: %[[this_slot:[^ ]*]] = getelementptr inbounds <{ %"struct.sret_thunk::C"*, %"struct.sret_thunk::Agg"*, %"struct.sret_thunk::Agg" }>, <{ %"struct.sret_thunk::C"*, %"struct.sret_thunk::Agg"*, %"struct.sret_thunk::Agg" }>* %0, i32 0, i32 0
// CHECK32: load %"struct.sret_thunk::C"*, %"struct.sret_thunk::C"** %[[this_slot]]
// CHECK32: getelementptr i8, i8* %{{.*}}, i32 -4
diff --git a/src/llvm-project/clang/test/CodeGenCXX/microsoft-abi-byval-vararg.cpp b/src/llvm-project/clang/test/CodeGenCXX/microsoft-abi-byval-vararg.cpp
index e6a36e2..26f6814 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/microsoft-abi-byval-vararg.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/microsoft-abi-byval-vararg.cpp
@@ -19,7 +19,7 @@
return sum;
}
-// CHECK-LABEL: define dso_local i32 @"?foo@@YAHUA@@ZZ"(<{ %struct.A }>* inalloca, ...)
+// CHECK-LABEL: define dso_local i32 @"?foo@@YAHUA@@ZZ"(<{ %struct.A }>* inalloca %0, ...)
int main() {
return foo(A(3), 1, 2, 3);
diff --git a/src/llvm-project/clang/test/CodeGenCXX/microsoft-abi-dynamic-cast.cpp b/src/llvm-project/clang/test/CodeGenCXX/microsoft-abi-dynamic-cast.cpp
index 9567245..a07114d 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/microsoft-abi-dynamic-cast.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/microsoft-abi-dynamic-cast.cpp
@@ -13,25 +13,25 @@
T* test1(V* x) { return &dynamic_cast<T&>(*x); }
// CHECK-LABEL: define dso_local %struct.T* @"?test1@@YAPAUT@@PAUV@@@Z"(%struct.V* %x)
// CHECK: [[CAST:%.*]] = bitcast %struct.V* %x to i8*
-// CHECK-NEXT: [[CALL:%.*]] = tail call i8* @__RTDynamicCast(i8* [[CAST]], i32 0, i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUV@@@8" to i8*), i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUT@@@8" to i8*), i32 1)
+// CHECK-NEXT: [[CALL:%.*]] = call i8* @__RTDynamicCast(i8* [[CAST]], i32 0, i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUV@@@8" to i8*), i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUT@@@8" to i8*), i32 1)
// CHECK-NEXT: [[RET:%.*]] = bitcast i8* [[CALL]] to %struct.T*
// CHECK-NEXT: ret %struct.T* [[RET]]
T* test2(A* x) { return &dynamic_cast<T&>(*x); }
// CHECK-LABEL: define dso_local %struct.T* @"?test2@@YAPAUT@@PAUA@@@Z"(%struct.A* %x)
// CHECK: [[CAST:%.*]] = bitcast %struct.A* %x to i8*
-// CHECK-NEXT: [[VBPTRPTR:%.*]] = getelementptr inbounds %struct.A, %struct.A* %x, i32 0, i32 0
+// CHECK-NEXT: [[VBPTRPTR:%.*]] = getelementptr %struct.A, %struct.A* %x, i32 0, i32 0
// CHECK-NEXT: [[VBTBL:%.*]] = load i32*, i32** [[VBPTRPTR]], align 4
// CHECK-NEXT: [[VBOFFP:%.*]] = getelementptr inbounds i32, i32* [[VBTBL]], i32 1
// CHECK-NEXT: [[VBOFFS:%.*]] = load i32, i32* [[VBOFFP]], align 4
// CHECK-NEXT: [[ADJ:%.*]] = getelementptr inbounds i8, i8* [[CAST]], i32 [[VBOFFS]]
-// CHECK-NEXT: [[CALL:%.*]] = tail call i8* @__RTDynamicCast(i8* [[ADJ]], i32 [[VBOFFS]], i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUA@@@8" to i8*), i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUT@@@8" to i8*), i32 1)
+// CHECK-NEXT: [[CALL:%.*]] = call i8* @__RTDynamicCast(i8* [[ADJ]], i32 [[VBOFFS]], i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUA@@@8" to i8*), i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUT@@@8" to i8*), i32 1)
// CHECK-NEXT: [[RET:%.*]] = bitcast i8* [[CALL]] to %struct.T*
// CHECK-NEXT: ret %struct.T* [[RET]]
T* test3(B* x) { return &dynamic_cast<T&>(*x); }
// CHECK-LABEL: define dso_local %struct.T* @"?test3@@YAPAUT@@PAUB@@@Z"(%struct.B* %x)
-// CHECK: [[VOIDP:%.*]] = getelementptr inbounds %struct.B, %struct.B* %x, i32 0, i32 0, i32 0
+// CHECK: [[VOIDP:%.*]] = getelementptr %struct.B, %struct.B* %x, i32 0, i32 0, i32 0
// CHECK-NEXT: [[VBPTR:%.*]] = getelementptr inbounds i8, i8* [[VOIDP]], i32 4
// CHECK-NEXT: [[VBPTRPTR:%.*]] = bitcast i8* [[VBPTR:%.*]] to i32**
// CHECK-NEXT: [[VBTBL:%.*]] = load i32*, i32** [[VBPTRPTR]], align 4
@@ -39,14 +39,14 @@
// CHECK-NEXT: [[VBOFFS:%.*]] = load i32, i32* [[VBOFFP]], align 4
// CHECK-NEXT: [[DELTA:%.*]] = add nsw i32 [[VBOFFS]], 4
// CHECK-NEXT: [[ADJ:%.*]] = getelementptr inbounds i8, i8* [[VOIDP]], i32 [[DELTA]]
-// CHECK-NEXT: [[CALL:%.*]] = tail call i8* @__RTDynamicCast(i8* [[ADJ]], i32 [[DELTA]], i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUB@@@8" to i8*), i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUT@@@8" to i8*), i32 1)
+// CHECK-NEXT: [[CALL:%.*]] = call i8* @__RTDynamicCast(i8* [[ADJ]], i32 [[DELTA]], i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUB@@@8" to i8*), i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUT@@@8" to i8*), i32 1)
// CHECK-NEXT: [[RET:%.*]] = bitcast i8* [[CALL]] to %struct.T*
// CHECK-NEXT: ret %struct.T* [[RET]]
T* test4(V* x) { return dynamic_cast<T*>(x); }
// CHECK-LABEL: define dso_local %struct.T* @"?test4@@YAPAUT@@PAUV@@@Z"(%struct.V* %x)
// CHECK: [[CAST:%.*]] = bitcast %struct.V* %x to i8*
-// CHECK-NEXT: [[CALL:%.*]] = tail call i8* @__RTDynamicCast(i8* [[CAST]], i32 0, i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUV@@@8" to i8*), i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUT@@@8" to i8*), i32 0)
+// CHECK-NEXT: [[CALL:%.*]] = call i8* @__RTDynamicCast(i8* [[CAST]], i32 0, i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUV@@@8" to i8*), i8* bitcast (%rtti.TypeDescriptor7* @"??_R0?AUT@@@8" to i8*), i32 0)
// CHECK-NEXT: [[RET:%.*]] = bitcast i8* [[CALL]] to %struct.T*
// CHECK-NEXT: ret %struct.T* [[RET]]
@@ -55,12 +55,12 @@
// CHECK: [[CHECK:%.*]] = icmp eq %struct.A* %x, null
// CHECK-NEXT: br i1 [[CHECK]]
// CHECK: [[VOIDP:%.*]] = bitcast %struct.A* %x to i8*
-// CHECK-NEXT: [[VBPTRPTR:%.*]] = getelementptr inbounds %struct.A, %struct.A* %x, i32 0, i32 0
+// CHECK-NEXT: [[VBPTRPTR:%.*]] = getelementptr %struct.A, %struct.A* %x, i32 0, i32 0
// CHECK-NEXT: [[VBTBL:%.*]] = load i32*, i32** [[VBPTRPTR]], align 4
// CHECK-NEXT: [[VBOFFP:%.*]] = getelementptr inbounds i32, i32* [[VBTBL]], i32 1
// CHECK-NEXT: [[VBOFFS:%.*]] = load i32, i32* [[VBOFFP]], align 4
// CHECK-NEXT: [[ADJ:%.*]] = getelementptr inbounds i8, i8* [[VOIDP]], i32 [[VBOFFS]]
-// CHECK-NEXT: [[CALL:%.*]] = tail call i8* @__RTDynamicCast(i8* nonnull [[ADJ]], i32 [[VBOFFS]], i8* {{.*}}bitcast (%rtti.TypeDescriptor7* @"??_R0?AUA@@@8" to i8*), i8* {{.*}}bitcast (%rtti.TypeDescriptor7* @"??_R0?AUT@@@8" to i8*), i32 0)
+// CHECK-NEXT: [[CALL:%.*]] = call i8* @__RTDynamicCast(i8* nonnull [[ADJ]], i32 [[VBOFFS]], i8* {{.*}}bitcast (%rtti.TypeDescriptor7* @"??_R0?AUA@@@8" to i8*), i8* {{.*}}bitcast (%rtti.TypeDescriptor7* @"??_R0?AUT@@@8" to i8*), i32 0)
// CHECK-NEXT: [[RES:%.*]] = bitcast i8* [[CALL]] to %struct.T*
// CHECK-NEXT: br label
// CHECK: [[RET:%.*]] = phi %struct.T*
@@ -70,7 +70,7 @@
// CHECK-LABEL: define dso_local %struct.T* @"?test6@@YAPAUT@@PAUB@@@Z"(%struct.B* %x)
// CHECK: [[CHECK:%.*]] = icmp eq %struct.B* %x, null
// CHECK-NEXT: br i1 [[CHECK]]
-// CHECK: [[CAST:%.*]] = getelementptr inbounds %struct.B, %struct.B* %x, i32 0, i32 0, i32 0
+// CHECK: [[CAST:%.*]] = getelementptr %struct.B, %struct.B* %x, i32 0, i32 0, i32 0
// CHECK-NEXT: [[VBPTR:%.*]] = getelementptr inbounds i8, i8* [[CAST]], i32 4
// CHECK-NEXT: [[VBPTRPTR:%.*]] = bitcast i8* [[VBPTR]] to i32**
// CHECK-NEXT: [[VBTBL:%.*]] = load i32*, i32** [[VBPTRPTR]], align 4
@@ -78,7 +78,7 @@
// CHECK-NEXT: [[VBOFFS:%.*]] = load i32, i32* [[VBOFFP]], align 4
// CHECK-NEXT: [[DELTA:%.*]] = add nsw i32 [[VBOFFS]], 4
// CHECK-NEXT: [[ADJ:%.*]] = getelementptr inbounds i8, i8* [[CAST]], i32 [[DELTA]]
-// CHECK-NEXT: [[CALL:%.*]] = tail call i8* @__RTDynamicCast(i8* nonnull [[ADJ]], i32 [[DELTA]], i8* {{.*}}bitcast (%rtti.TypeDescriptor7* @"??_R0?AUB@@@8" to i8*), i8* {{.*}}bitcast (%rtti.TypeDescriptor7* @"??_R0?AUT@@@8" to i8*), i32 0)
+// CHECK-NEXT: [[CALL:%.*]] = call i8* @__RTDynamicCast(i8* [[ADJ]], i32 [[DELTA]], i8* {{.*}}bitcast (%rtti.TypeDescriptor7* @"??_R0?AUB@@@8" to i8*), i8* {{.*}}bitcast (%rtti.TypeDescriptor7* @"??_R0?AUT@@@8" to i8*), i32 0)
// CHECK-NEXT: [[RES:%.*]] = bitcast i8* [[CALL]] to %struct.T*
// CHECK-NEXT: br label
// CHECK: [[RET:%.*]] = phi %struct.T*
@@ -87,7 +87,7 @@
void* test7(V* x) { return dynamic_cast<void*>(x); }
// CHECK-LABEL: define dso_local i8* @"?test7@@YAPAXPAUV@@@Z"(%struct.V* %x)
// CHECK: [[CAST:%.*]] = bitcast %struct.V* %x to i8*
-// CHECK-NEXT: [[RET:%.*]] = tail call i8* @__RTCastToVoid(i8* [[CAST]])
+// CHECK-NEXT: [[RET:%.*]] = call i8* @__RTCastToVoid(i8* [[CAST]])
// CHECK-NEXT: ret i8* [[RET]]
void* test8(A* x) { return dynamic_cast<void*>(x); }
@@ -95,12 +95,12 @@
// CHECK: [[CHECK:%.*]] = icmp eq %struct.A* %x, null
// CHECK-NEXT: br i1 [[CHECK]]
// CHECK: [[VOIDP:%.*]] = bitcast %struct.A* %x to i8*
-// CHECK-NEXT: [[VBPTRPTR:%.*]] = getelementptr inbounds %struct.A, %struct.A* %x, i32 0, i32 0
+// CHECK-NEXT: [[VBPTRPTR:%.*]] = getelementptr %struct.A, %struct.A* %x, i32 0, i32 0
// CHECK-NEXT: [[VBTBL:%.*]] = load i32*, i32** [[VBPTRPTR]], align 4
// CHECK-NEXT: [[VBOFFP:%.*]] = getelementptr inbounds i32, i32* [[VBTBL]], i32 1
// CHECK-NEXT: [[VBOFFS:%.*]] = load i32, i32* [[VBOFFP]], align 4
// CHECK-NEXT: [[ADJ:%.*]] = getelementptr inbounds i8, i8* [[VOIDP]], i32 [[VBOFFS]]
-// CHECK-NEXT: [[RES:%.*]] = tail call i8* @__RTCastToVoid(i8* nonnull [[ADJ]])
+// CHECK-NEXT: [[RES:%.*]] = call i8* @__RTCastToVoid(i8* nonnull [[ADJ]])
// CHECK-NEXT: br label
// CHECK: [[RET:%.*]] = phi i8*
// CHECK-NEXT: ret i8* [[RET]]
@@ -109,7 +109,7 @@
// CHECK-LABEL: define dso_local i8* @"?test9@@YAPAXPAUB@@@Z"(%struct.B* %x)
// CHECK: [[CHECK:%.*]] = icmp eq %struct.B* %x, null
// CHECK-NEXT: br i1 [[CHECK]]
-// CHECK: [[CAST:%.*]] = getelementptr inbounds %struct.B, %struct.B* %x, i32 0, i32 0, i32 0
+// CHECK: [[CAST:%.*]] = getelementptr %struct.B, %struct.B* %x, i32 0, i32 0, i32 0
// CHECK-NEXT: [[VBPTR:%.*]] = getelementptr inbounds i8, i8* [[CAST]], i32 4
// CHECK-NEXT: [[VBPTRPTR:%.*]] = bitcast i8* [[VBPTR]] to i32**
// CHECK-NEXT: [[VBTBL:%.*]] = load i32*, i32** [[VBPTRPTR]], align 4
@@ -117,7 +117,7 @@
// CHECK-NEXT: [[VBOFFS:%.*]] = load i32, i32* [[VBOFFP]], align 4
// CHECK-NEXT: [[DELTA:%.*]] = add nsw i32 [[VBOFFS]], 4
// CHECK-NEXT: [[ADJ:%.*]] = getelementptr inbounds i8, i8* [[CAST]], i32 [[DELTA]]
-// CHECK-NEXT: [[CALL:%.*]] = tail call i8* @__RTCastToVoid(i8* nonnull [[ADJ]])
+// CHECK-NEXT: [[CALL:%.*]] = call i8* @__RTCastToVoid(i8* [[ADJ]])
// CHECK-NEXT: br label
// CHECK: [[RET:%.*]] = phi i8*
// CHECK-NEXT: ret i8* [[RET]]
diff --git a/src/llvm-project/clang/test/CodeGenCXX/microsoft-abi-member-pointers.cpp b/src/llvm-project/clang/test/CodeGenCXX/microsoft-abi-member-pointers.cpp
index 4202f84..bfe620d 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/microsoft-abi-member-pointers.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/microsoft-abi-member-pointers.cpp
@@ -417,7 +417,7 @@
// Pass this large type indirectly.
// X64-LABEL: define dso_local zeroext i1 @"?nullTestDataUnspecified@@
-// X64: ({ i32, i32, i32 }*)
+// X64: ({ i32, i32, i32 }* %0)
}
bool nullTestFunctionUnspecified(void (Unspecified::*mp)()) {
@@ -591,7 +591,7 @@
// CHECK: }
// X64-LABEL: define dso_local zeroext i1 @"?unspecFuncMemptrEq@@
-// X64: ({ i8*, i32, i32, i32 }*, { i8*, i32, i32, i32 }*)
+// X64: ({ i8*, i32, i32, i32 }* %0, { i8*, i32, i32, i32 }* %1)
}
bool unspecFuncMemptrNeq(void (Unspecified::*l)(), void (Unspecified::*r)()) {
@@ -636,7 +636,7 @@
// CHECK: }
// X64-LABEL: define dso_local zeroext i1 @"?unspecDataMemptrEq@@
-// X64: ({ i32, i32, i32 }*, { i32, i32, i32 }*)
+// X64: ({ i32, i32, i32 }* %0, { i32, i32, i32 }* %1)
}
void (Multiple::*convertB2FuncToMultiple(void (B2::*mp)()))() {
diff --git a/src/llvm-project/clang/test/CodeGenCXX/microsoft-abi-sret-and-byval.cpp b/src/llvm-project/clang/test/CodeGenCXX/microsoft-abi-sret-and-byval.cpp
index 96dec274..9fb9f39 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/microsoft-abi-sret-and-byval.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/microsoft-abi-sret-and-byval.cpp
@@ -163,7 +163,7 @@
// Test that dtors are invoked in the callee.
void small_arg_with_dtor(SmallWithDtor s) {}
-// WIN32: define dso_local void @"?small_arg_with_dtor@@YAXUSmallWithDtor@@@Z"(<{ %struct.SmallWithDtor }>* inalloca) {{.*}} {
+// WIN32: define dso_local void @"?small_arg_with_dtor@@YAXUSmallWithDtor@@@Z"(<{ %struct.SmallWithDtor }>* inalloca %0) {{.*}} {
// WIN32: call x86_thiscallcc void @"??1SmallWithDtor@@QAE@XZ"
// WIN32: }
// WIN64: define dso_local void @"?small_arg_with_dtor@@YAXUSmallWithDtor@@@Z"(i32 %s.coerce) {{.*}} {
@@ -240,13 +240,13 @@
void small_arg_with_vftable(SmallWithVftable s) {}
// LINUX-LABEL: define void @_Z22small_arg_with_vftable16SmallWithVftable(%struct.SmallWithVftable* %s)
-// WIN32: define dso_local void @"?small_arg_with_vftable@@YAXUSmallWithVftable@@@Z"(<{ %struct.SmallWithVftable }>* inalloca)
+// WIN32: define dso_local void @"?small_arg_with_vftable@@YAXUSmallWithVftable@@@Z"(<{ %struct.SmallWithVftable }>* inalloca %0)
// WIN64: define dso_local void @"?small_arg_with_vftable@@YAXUSmallWithVftable@@@Z"(%struct.SmallWithVftable* %s)
// WOA64: define dso_local void @"?small_arg_with_vftable@@YAXUSmallWithVftable@@@Z"(%struct.SmallWithVftable* %s)
void medium_arg_with_copy_ctor(MediumWithCopyCtor s) {}
// LINUX-LABEL: define void @_Z25medium_arg_with_copy_ctor18MediumWithCopyCtor(%struct.MediumWithCopyCtor* %s)
-// WIN32: define dso_local void @"?medium_arg_with_copy_ctor@@YAXUMediumWithCopyCtor@@@Z"(<{ %struct.MediumWithCopyCtor }>* inalloca)
+// WIN32: define dso_local void @"?medium_arg_with_copy_ctor@@YAXUMediumWithCopyCtor@@@Z"(<{ %struct.MediumWithCopyCtor }>* inalloca %0)
// WIN64: define dso_local void @"?medium_arg_with_copy_ctor@@YAXUMediumWithCopyCtor@@@Z"(%struct.MediumWithCopyCtor* %s)
// WOA: define dso_local arm_aapcs_vfpcc void @"?medium_arg_with_copy_ctor@@YAXUMediumWithCopyCtor@@@Z"(%struct.MediumWithCopyCtor* %s)
// WOA64: define dso_local void @"?medium_arg_with_copy_ctor@@YAXUMediumWithCopyCtor@@@Z"(%struct.MediumWithCopyCtor* %s)
@@ -347,7 +347,7 @@
};
void g(X) {
}
-// WIN32: define dso_local void @"?g@@YAXUX@@@Z"(<{ %struct.X, [3 x i8] }>* inalloca) {{.*}} {
+// WIN32: define dso_local void @"?g@@YAXUX@@@Z"(<{ %struct.X, [3 x i8] }>* inalloca %0) {{.*}} {
// WIN32: call x86_thiscallcc void @"??1X@@QAE@XZ"(%struct.X* {{.*}})
// WIN32: }
void f() {
@@ -398,7 +398,7 @@
int a;
};
void foo(NonTrivial a, bool b) { }
-// WIN32-LABEL: define dso_local void @"?foo@test3@@YAXUNonTrivial@1@_N@Z"(<{ %"struct.test3::NonTrivial", i8, [3 x i8] }>* inalloca)
+// WIN32-LABEL: define dso_local void @"?foo@test3@@YAXUNonTrivial@1@_N@Z"(<{ %"struct.test3::NonTrivial", i8, [3 x i8] }>* inalloca %0)
}
diff --git a/src/llvm-project/clang/test/CodeGenCXX/microsoft-abi-throw.cpp b/src/llvm-project/clang/test/CodeGenCXX/microsoft-abi-throw.cpp
index f55b94a..937f2da 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/microsoft-abi-throw.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/microsoft-abi-throw.cpp
@@ -14,6 +14,8 @@
// CHECK-DAG: @"_CTA5?AUY@@" = linkonce_odr unnamed_addr constant %eh.CatchableTypeArray.5 { i32 5, [5 x %eh.CatchableType*] [%eh.CatchableType* @"_CT??_R0?AUY@@@8??0Y@@QAE@ABU0@@Z8", %eh.CatchableType* @"_CT??_R0?AUZ@@@81", %eh.CatchableType* @"_CT??_R0?AUW@@@8??0W@@QAE@ABU0@@Z44", %eh.CatchableType* @"_CT??_R0?AUM@@@818", %eh.CatchableType* @"_CT??_R0?AUV@@@81044"] }, section ".xdata", comdat
// CHECK-DAG: @"_TI5?AUY@@" = linkonce_odr unnamed_addr constant %eh.ThrowInfo { i32 0, i8* bitcast (void (%struct.Y*)* @"??_DY@@QAEXXZ" to i8*), i8* null, i8* bitcast (%eh.CatchableTypeArray.5* @"_CTA5?AUY@@" to i8*) }, section ".xdata", comdat
// CHECK-DAG: @"_CT??_R0?AUDefault@@@8??_ODefault@@QAEXAAU0@@Z1" = linkonce_odr unnamed_addr constant %eh.CatchableType { i32 0, i8* bitcast (%rtti.TypeDescriptor13* @"??_R0?AUDefault@@@8" to i8*), i32 0, i32 -1, i32 0, i32 1, i8* bitcast (void (%struct.Default*, %struct.Default*)* @"??_ODefault@@QAEXAAU0@@Z" to i8*) }, section ".xdata", comdat
+// CHECK-DAG: @"_CT??_R0?AUDeletedCopy@@@81" = linkonce_odr unnamed_addr constant %eh.CatchableType { i32 0, i8* bitcast (%rtti.TypeDescriptor17* @"??_R0?AUDeletedCopy@@@8" to i8*), i32 0, i32 -1, i32 0, i32 1, i8* null }, section ".xdata", comdat
+// CHECk-DAG: @"_CT??_R0?AUMoveOnly@@@84" = linkonce_odr unnamed_addr constant %eh.CatchableType { i32 0, i8* bitcast (%rtti.TypeDescriptor14* @"??_R0?AUMoveOnly@@@8" to i8*), i32 0, i321-1, i32 0, i32 4, i8* null }, section ".xdata", comda
// CHECK-DAG: @"_CT??_R0?AUVariadic@@@8??_OVariadic@@QAEXAAU0@@Z1" = linkonce_odr unnamed_addr constant %eh.CatchableType { i32 0, i8* bitcast (%rtti.TypeDescriptor14* @"??_R0?AUVariadic@@@8" to i8*), i32 0, i32 -1, i32 0, i32 1, i8* bitcast (void (%struct.Variadic*, %struct.Variadic*)* @"??_OVariadic@@QAEXAAU0@@Z" to i8*) }, section ".xdata", comdat
// CHECK-DAG: @"_CT??_R0?AUTemplateWithDefault@@@8??$?_OH@TemplateWithDefault@@QAEXAAU0@@Z1" = linkonce_odr unnamed_addr constant %eh.CatchableType { i32 0, i8* bitcast (%rtti.TypeDescriptor25* @"??_R0?AUTemplateWithDefault@@@8" to i8*), i32 0, i32 -1, i32 0, i32 1, i8* bitcast (void (%struct.TemplateWithDefault*, %struct.TemplateWithDefault*)* @"??$?_OH@TemplateWithDefault@@QAEXAAU0@@Z" to i8*) }, section ".xdata", comdat
// CHECK-DAG: @"_CTA2$$T" = linkonce_odr unnamed_addr constant %eh.CatchableTypeArray.2 { i32 2, [2 x %eh.CatchableType*] [%eh.CatchableType* @"_CT??_R0$$T@84", %eh.CatchableType* @"_CT??_R0PAX@84"] }, section ".xdata", comdat
@@ -71,6 +73,31 @@
throw d;
}
+struct DeletedCopy {
+ DeletedCopy();
+ DeletedCopy(DeletedCopy &&);
+ DeletedCopy(const DeletedCopy &) = delete;
+};
+void throwDeletedCopy() { throw DeletedCopy(); }
+
+
+struct MoveOnly {
+ MoveOnly();
+ MoveOnly(MoveOnly &&);
+ ~MoveOnly();
+ MoveOnly(const MoveOnly &) = delete;
+
+ // For some reason this subobject was important for reproducing PR43680
+ struct HasCopy {
+ HasCopy();
+ HasCopy(const HasCopy &o);
+ ~HasCopy();
+ int x;
+ } sub;
+};
+
+void throwMoveOnly() { throw MoveOnly(); }
+
struct Variadic {
Variadic(Variadic &, ...);
};
diff --git a/src/llvm-project/clang/test/CodeGenCXX/microsoft-abi-typeid.cpp b/src/llvm-project/clang/test/CodeGenCXX/microsoft-abi-typeid.cpp
index 128f271..f3bd7e6 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/microsoft-abi-typeid.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/microsoft-abi-typeid.cpp
@@ -25,18 +25,18 @@
const std::type_info* test3_typeid() { return &typeid(*fn()); }
// CHECK-LABEL: define dso_local %struct.type_info* @"?test3_typeid@@YAPBUtype_info@@XZ"()
-// CHECK: [[CALL:%.*]] = tail call %struct.A* @"?fn@@YAPAUA@@XZ"()
+// CHECK: [[CALL:%.*]] = call %struct.A* @"?fn@@YAPAUA@@XZ"()
// CHECK-NEXT: [[CMP:%.*]] = icmp eq %struct.A* [[CALL]], null
// CHECK-NEXT: br i1 [[CMP]]
-// CHECK: tail call i8* @__RTtypeid(i8* null)
+// CHECK: call i8* @__RTtypeid(i8* null)
// CHECK-NEXT: unreachable
// CHECK: [[THIS:%.*]] = bitcast %struct.A* [[CALL]] to i8*
-// CHECK-NEXT: [[VBTBLP:%.*]] = getelementptr inbounds %struct.A, %struct.A* [[CALL]], i32 0, i32 0
+// CHECK-NEXT: [[VBTBLP:%.*]] = getelementptr %struct.A, %struct.A* [[CALL]], i32 0, i32 0
// CHECK-NEXT: [[VBTBL:%.*]] = load i32*, i32** [[VBTBLP]], align 4
// CHECK-NEXT: [[VBSLOT:%.*]] = getelementptr inbounds i32, i32* [[VBTBL]], i32 1
// CHECK-NEXT: [[VBASE_OFFS:%.*]] = load i32, i32* [[VBSLOT]], align 4
// CHECK-NEXT: [[ADJ:%.*]] = getelementptr inbounds i8, i8* [[THIS]], i32 [[VBASE_OFFS]]
-// CHECK-NEXT: [[RT:%.*]] = tail call i8* @__RTtypeid(i8* nonnull [[ADJ]])
+// CHECK-NEXT: [[RT:%.*]] = call i8* @__RTtypeid(i8* nonnull [[ADJ]])
// CHECK-NEXT: [[RET:%.*]] = bitcast i8* [[RT]] to %struct.type_info*
// CHECK-NEXT: ret %struct.type_info* [[RET]]
@@ -46,7 +46,7 @@
const std::type_info* test5_typeid() { return &typeid(v); }
// CHECK: define dso_local %struct.type_info* @"?test5_typeid@@YAPBUtype_info@@XZ"()
-// CHECK: [[RT:%.*]] = tail call i8* @__RTtypeid(i8* bitcast (%struct.V* @"?v@@3UV@@A" to i8*))
+// CHECK: [[RT:%.*]] = call i8* @__RTtypeid(i8* bitcast (%struct.V* @"?v@@3UV@@A" to i8*))
// CHECK-NEXT: [[RET:%.*]] = bitcast i8* [[RT]] to %struct.type_info*
// CHECK-NEXT: ret %struct.type_info* [[RET]]
diff --git a/src/llvm-project/clang/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-this-adjustment.cpp b/src/llvm-project/clang/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-this-adjustment.cpp
index e34c4d0..93a7d46 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-this-adjustment.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-this-adjustment.cpp
@@ -189,7 +189,7 @@
whatsthis = this;
}
-// BITCODE-LABEL: define dso_local void @"?g@C@pr30293@@UAAXUNonTrivial@2@@Z"(<{ i8*, %"struct.pr30293::NonTrivial" }>* inalloca)
+// BITCODE-LABEL: define dso_local void @"?g@C@pr30293@@UAAXUNonTrivial@2@@Z"(<{ i8*, %"struct.pr30293::NonTrivial" }>* inalloca %0)
// BITCODE: %[[thisaddr:[^ ]*]] = getelementptr inbounds <{ i8*, %"struct.pr30293::NonTrivial" }>, <{ i8*, %"struct.pr30293::NonTrivial" }>* {{.*}}, i32 0, i32 0
// BITCODE: %[[thisaddr1:[^ ]*]] = bitcast i8** %[[thisaddr]] to %"struct.pr30293::C"**
// BITCODE: %[[this1:[^ ]*]] = load %"struct.pr30293::C"*, %"struct.pr30293::C"** %[[thisaddr1]], align 4
diff --git a/src/llvm-project/clang/test/CodeGenCXX/microsoft-uuidof-mangling.cpp b/src/llvm-project/clang/test/CodeGenCXX/microsoft-uuidof-mangling.cpp
index 9019aa8..10b19dd 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/microsoft-uuidof-mangling.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/microsoft-uuidof-mangling.cpp
@@ -24,7 +24,7 @@
template <class T> void test_uuidofType(void *arg[sizeof(__uuidof(T))] = 0) {}
-template <class T> void test_uuidofExpr(void *arg[sizeof(__uuidof(T::member))] = 0) {}
+template <class T> void test_uuidofExpr(void *arg[sizeof(__uuidof(typename T::member))] = 0) {}
struct HasMember { typedef TestStruct member; };
diff --git a/src/llvm-project/clang/test/CodeGenCXX/mingw-thread-local.cpp b/src/llvm-project/clang/test/CodeGenCXX/mingw-thread-local.cpp
new file mode 100644
index 0000000..ffcc697
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCXX/mingw-thread-local.cpp
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - -triple x86_64-w64-mingw32 | FileCheck %s
+
+extern thread_local int var;
+
+int get() {
+ return var;
+}
+
+// CHECK: declare extern_weak void @_ZTH3var()
diff --git a/src/llvm-project/clang/test/CodeGenCXX/ms-constexpr-static-data-member.cpp b/src/llvm-project/clang/test/CodeGenCXX/ms-constexpr-static-data-member.cpp
new file mode 100644
index 0000000..dc2c486
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCXX/ms-constexpr-static-data-member.cpp
@@ -0,0 +1,26 @@
+// RUN: %clang_cc1 -emit-llvm -triple=x86_64-windows-msvc %s -o - | FileCheck %s
+
+struct Foo { int x, y; };
+
+struct S {
+ // PR36125
+ static constexpr char sdm_char_array[] = "asdf";
+
+ // PR43280
+ static constexpr const char *sdm_char_ptr = "asdf";
+
+ static constexpr Foo sdm_udt{1, 2};
+};
+
+void useptr(const void *p);
+void usethem() {
+ useptr(&S::sdm_char_array);
+ useptr(&S::sdm_char_ptr);
+ useptr(&S::sdm_udt);
+}
+
+// CHECK-DAG: @"?sdm_char_array@S@@2QBDB" = linkonce_odr dso_local constant [5 x i8] c"asdf\00", comdat, align 1
+
+// CHECK-DAG: @"?sdm_char_ptr@S@@2QEBDEB" = linkonce_odr dso_local constant i8* getelementptr inbounds ([5 x i8], [5 x i8]* @"??_C@_04JIHMPGLA@asdf?$AA@", i32 0, i32 0), comdat, align 8
+
+// CHECK-DAG: @"?sdm_udt@S@@2UFoo@@B" = linkonce_odr dso_local constant %struct.Foo { i32 1, i32 2 }, comdat, align 4
diff --git a/src/llvm-project/clang/test/CodeGenCXX/ms-constexpr-var-template.cpp b/src/llvm-project/clang/test/CodeGenCXX/ms-constexpr-var-template.cpp
deleted file mode 100644
index a40f7aa..0000000
--- a/src/llvm-project/clang/test/CodeGenCXX/ms-constexpr-var-template.cpp
+++ /dev/null
@@ -1,11 +0,0 @@
-// RUN: %clang_cc1 -emit-llvm -triple=x86_64-windows-msvc -fms-compatibility %s -o - | FileCheck %s
-
-template <typename> constexpr bool _Is_integer = false;
-template <> constexpr bool _Is_integer<int> = true;
-template <> constexpr bool _Is_integer<char> = false;
-extern "C" const bool *escape = &_Is_integer<int>;
-
-// CHECK: @"??$_Is_integer@H@@3_NB" = linkonce_odr dso_local constant i8 1, comdat, align 1
-// Should not emit _Is_integer<char>, since it's not referenced.
-// CHECK-NOT: @"??$_Is_integer@D@@3_NB"
-// CHECK: @escape = dso_local global i8* @"??$_Is_integer@H@@3_NB", align 8
diff --git a/src/llvm-project/clang/test/CodeGenCXX/ms-integer-static-data-members-exported.cpp b/src/llvm-project/clang/test/CodeGenCXX/ms-integer-static-data-members-exported.cpp
index 2537361..d01b101 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/ms-integer-static-data-members-exported.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/ms-integer-static-data-members-exported.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -triple=i386-pc-win32 -fms-compatibility %s -o - | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -triple=i386-pc-win32 -fms-extensions %s -o - | FileCheck %s
enum Enum { zero, one, two };
diff --git a/src/llvm-project/clang/test/CodeGenCXX/ms-integer-static-data-members.cpp b/src/llvm-project/clang/test/CodeGenCXX/ms-integer-static-data-members.cpp
index 9841435..e48acbf 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/ms-integer-static-data-members.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/ms-integer-static-data-members.cpp
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 -emit-llvm -triple=i386-pc-win32 -fms-compatibility %s -o - | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -triple=i386-pc-win32 %s -o - | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -triple=x86_64-windows-msvc %s -o - | FileCheck %s
struct S {
static const int NoInit_Ref;
diff --git a/src/llvm-project/clang/test/CodeGenCXX/ms-thunks-ehspec.cpp b/src/llvm-project/clang/test/CodeGenCXX/ms-thunks-ehspec.cpp
new file mode 100644
index 0000000..f72100d5
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCXX/ms-thunks-ehspec.cpp
@@ -0,0 +1,27 @@
+// RUN: %clang_cc1 -fexceptions -fcxx-exceptions %s -triple=i686-windows-msvc -emit-llvm -o - | FileCheck %s
+
+// When generating thunks using musttail due to inalloca parameters, don't push
+// and pop terminate scopes. PR44987
+
+struct NonTrivial {
+ NonTrivial();
+ NonTrivial(const NonTrivial &o);
+ ~NonTrivial();
+ int x;
+};
+struct A {
+ virtual void f(NonTrivial o) noexcept;
+};
+struct B {
+ virtual void f(NonTrivial o) noexcept;
+};
+class C : A, B {
+ virtual void f(NonTrivial o) noexcept;
+};
+C c;
+
+// CHECK-LABEL: define linkonce_odr dso_local x86_thiscallcc void @"?f@C@@G3AEXUNonTrivial@@@Z"(%class.C* %this, <{ %struct.NonTrivial }>* inalloca %0)
+// CHECK-NOT: invoke
+// CHECK: musttail call x86_thiscallcc void @"?f@C@@EAEXUNonTrivial@@@Z"(%class.C* %{{.*}}, <{ %struct.NonTrivial }>* inalloca %0)
+// CHECK-NEXT ret void
+
diff --git a/src/llvm-project/clang/test/CodeGenCXX/ms-thunks-variadic-return.cpp b/src/llvm-project/clang/test/CodeGenCXX/ms-thunks-variadic-return.cpp
new file mode 100644
index 0000000..ae306ab
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCXX/ms-thunks-variadic-return.cpp
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 -fno-rtti-data -triple x86_64-windows-msvc -emit-llvm-only %s -verify
+
+// Verify that we error out on this return adjusting thunk that we can't emit.
+
+struct A {
+ virtual A *clone(const char *f, ...) = 0;
+};
+struct B : virtual A {
+ // expected-error@+1 2 {{cannot compile this return-adjusting thunk with variadic arguments yet}}
+ B *clone(const char *f, ...) override;
+};
+struct C : B { int c; };
+C c;
diff --git a/src/llvm-project/clang/test/CodeGenCXX/ms-union-member-ref.cpp b/src/llvm-project/clang/test/CodeGenCXX/ms-union-member-ref.cpp
new file mode 100644
index 0000000..59cdda5
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCXX/ms-union-member-ref.cpp
@@ -0,0 +1,34 @@
+// RUN: %clang_cc1 -triple=i686-pc-win32 -fms-extensions %s -emit-llvm -o- | FileCheck %s
+
+union A {
+ int *&ref;
+ int **ptr;
+};
+
+int *f1(A *a) {
+ return a->ref;
+}
+// CHECK-LABEL: define {{.*}}i32* @"?f1@@YAPAHPATA@@@Z"(%union.A* %a)
+// CHECK: [[REF:%[^[:space:]]+]] = bitcast %union.A* %{{.*}} to i32***
+// CHECK: [[IPP:%[^[:space:]]+]] = load i32**, i32*** [[REF]]
+// CHECK: [[IP:%[^[:space:]]+]] = load i32*, i32** [[IPP]]
+// CHECK: ret i32* [[IP]]
+
+void f2(A *a) {
+ *a->ref = 1;
+}
+// CHECK-LABEL: define {{.*}}void @"?f2@@YAXPATA@@@Z"(%union.A* %a)
+// CHECK: [[REF:%[^[:space:]]+]] = bitcast %union.A* %{{.*}} to i32***
+// CHECK: [[IPP:%[^[:space:]]+]] = load i32**, i32*** [[REF]]
+// CHECK: [[IP:%[^[:space:]]+]] = load i32*, i32** [[IPP]]
+// CHECK: store i32 1, i32* [[IP]]
+
+bool f3(A *a, int *b) {
+ return a->ref != b;
+}
+// CHECK-LABEL: define {{.*}}i1 @"?f3@@YA_NPATA@@PAH@Z"(%union.A* %a, i32* %b)
+// CHECK: [[REF:%[^[:space:]]+]] = bitcast %union.A* %{{.*}} to i32***
+// CHECK: [[IPP:%[^[:space:]]+]] = load i32**, i32*** [[REF]]
+// CHECK: [[IP:%[^[:space:]]+]] = load i32*, i32** [[IPP]]
+// CHECK: [[IP2:%[^[:space:]]+]] = load i32*, i32** %b.addr
+// CHECK: icmp ne i32* [[IP]], [[IP2]]
diff --git a/src/llvm-project/clang/test/CodeGenCXX/no-const-init-cxx2a.cpp b/src/llvm-project/clang/test/CodeGenCXX/no-const-init-cxx2a.cpp
new file mode 100644
index 0000000..a945c06
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCXX/no-const-init-cxx2a.cpp
@@ -0,0 +1,18 @@
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -o - %s -std=c++2a | FileCheck %s
+
+// CHECK-DAG: @p = {{.*}} null
+// CHECK-DAG: @_ZGR1p_ = {{.*}} null
+int *const &p = new int;
+
+struct d {
+ constexpr d(int &&f) : e(f) {}
+ int &e;
+};
+
+// CHECK-DAG: @g = {{.*}} null
+// CHECK-DAG: @_ZGR1g_ = {{.*}} zeroinitializer
+d &&g{{0}};
+
+// CHECK: define {{.*}} @__cxx_global_var_init
+// CHECK: define {{.*}} @__cxx_global_var_init
+// CHECK-NOT: define {{.*}} @__cxx_global_var_init
diff --git a/src/llvm-project/clang/test/CodeGenCXX/no-unique-address-2.cpp b/src/llvm-project/clang/test/CodeGenCXX/no-unique-address-2.cpp
new file mode 100644
index 0000000..aa0c677
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCXX/no-unique-address-2.cpp
@@ -0,0 +1,25 @@
+// RUN: %clang_cc1 -std=c++2a %s -emit-llvm -o - -triple x86_64-linux-gnu | FileCheck %s
+
+struct TriviallyCopyable {};
+
+struct NonTriviallyCopyable {
+ NonTriviallyCopyable() = default;
+ NonTriviallyCopyable(const NonTriviallyCopyable&) = default;
+ NonTriviallyCopyable(NonTriviallyCopyable &&) {}
+};
+
+struct Foo {
+ int i;
+ [[no_unique_address]] TriviallyCopyable m;
+ [[no_unique_address]] NonTriviallyCopyable n;
+};
+
+void call() {
+ Foo foo;
+ Foo foo2(static_cast<Foo&&>(foo));
+}
+
+// The memcpy call should copy exact 4 bytes for member 'int i'
+// CHECK: define {{.*}} void @_ZN3FooC2EOS_
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* {{.+}}, i8* {{.+}}, i64 4, i1 false)
+// CHECK: call void @_ZN20NonTriviallyCopyableC2EOS_
diff --git a/src/llvm-project/clang/test/CodeGenCXX/no_destroy.cpp b/src/llvm-project/clang/test/CodeGenCXX/no_destroy.cpp
index 3400b60..607cbfb 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/no_destroy.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/no_destroy.cpp
@@ -5,10 +5,8 @@
~NonTrivial();
};
-// CHECK-LABEL: define internal void @__cxx_global_var_init
// CHECK-NOT: __cxa_atexit{{.*}}_ZN10NonTrivialD1Ev
[[clang::no_destroy]] NonTrivial nt1;
-// CHECK-LABEL: define internal void @__cxx_global_var_init
// CHECK-NOT: _tlv_atexit{{.*}}_ZN10NonTrivialD1Ev
[[clang::no_destroy]] thread_local NonTrivial nt2;
@@ -16,11 +14,9 @@
~NonTrivial2();
};
-// CHECK-LABEL: define internal void @__cxx_global_var_init
-// CHECK: __cxa_atexit{{.*}}_ZN11NonTrivial2D1Ev
+// CHECK: __cxa_atexit{{.*}}_ZN11NonTrivial2D1Ev{{.*}}nt21
NonTrivial2 nt21;
-// CHECK-LABEL: define internal void @__cxx_global_var_init
-// CHECK: _tlv_atexit{{.*}}_ZN11NonTrivial2D1Ev
+// CHECK: _tlv_atexit{{.*}}_ZN11NonTrivial2D1Ev{{.*}}nt22
thread_local NonTrivial2 nt22;
// CHECK-LABEL: define void @_Z1fv
diff --git a/src/llvm-project/clang/test/CodeGenCXX/noescape.cpp b/src/llvm-project/clang/test/CodeGenCXX/noescape.cpp
index dbd97da..835964e 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/noescape.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/noescape.cpp
@@ -8,19 +8,19 @@
virtual void vm1(int *, int * __attribute__((noescape)));
};
-// CHECK: define void @_ZN1SC2EPiS0_(%struct.S* {{.*}}, {{.*}}, {{.*}} nocapture)
-// CHECK: define void @_ZN1SC1EPiS0_(%struct.S* {{.*}}, {{.*}}, {{.*}} nocapture) {{.*}} {
+// CHECK: define void @_ZN1SC2EPiS0_(%struct.S* {{.*}}, {{.*}}, {{.*}} nocapture {{%.*}})
+// CHECK: define void @_ZN1SC1EPiS0_(%struct.S* {{.*}}, {{.*}}, {{.*}} nocapture {{%.*}}) {{.*}} {
// CHECK: call void @_ZN1SC2EPiS0_(%struct.S* {{.*}}, {{.*}}, {{.*}} nocapture {{.*}})
S::S(int *, int * __attribute__((noescape))) {}
-// CHECK: define {{.*}} %struct.S* @_ZN1SaSEPi(%struct.S* {{.*}}, {{.*}} nocapture)
+// CHECK: define {{.*}} %struct.S* @_ZN1SaSEPi(%struct.S* {{.*}}, {{.*}} nocapture {{%.*}})
S &S::operator=(int * __attribute__((noescape))) { return *this; }
-// CHECK: define void @_ZN1S2m0EPiS0_(%struct.S* {{.*}}, {{.*}} nocapture)
+// CHECK: define void @_ZN1S2m0EPiS0_(%struct.S* {{.*}}, {{.*}} nocapture {{%.*}})
void S::m0(int *, int * __attribute__((noescape))) {}
-// CHECK: define void @_ZN1S3vm1EPiS0_(%struct.S* {{.*}}, {{.*}} nocapture)
+// CHECK: define void @_ZN1S3vm1EPiS0_(%struct.S* {{.*}}, {{.*}} nocapture {{%.*}})
void S::vm1(int *, int * __attribute__((noescape))) {}
// CHECK-LABEL: define void @_Z5test0P1SPiS1_(
@@ -52,7 +52,7 @@
// CHECK-LABEL: define void @_Z5test2PiS_(
// CHECK: call void @"_ZZ5test2PiS_ENK3$_0clES_S_"({{.*}}, {{.*}}, {{.*}} nocapture {{.*}})
-// CHECK: define internal void @"_ZZ5test2PiS_ENK3$_0clES_S_"({{.*}}, {{.*}}, {{.*}} nocapture)
+// CHECK: define internal void @"_ZZ5test2PiS_ENK3$_0clES_S_"({{.*}}, {{.*}}, {{.*}} nocapture {{%.*}})
void test2(int *p0, int *p1) {
auto t = [](int *, int * __attribute__((noescape))){};
t(p0, p1);
diff --git a/src/llvm-project/clang/test/CodeGenCXX/non-const-init-cxx2a.cpp b/src/llvm-project/clang/test/CodeGenCXX/non-const-init-cxx2a.cpp
new file mode 100644
index 0000000..120b320
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCXX/non-const-init-cxx2a.cpp
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -o - %s -std=c++2a | FileCheck %s
+
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-pch -o %t.pch %s -std=c++2a
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -include-pch %t.pch -x c++ /dev/null -emit-llvm -o - -std=c++2a | FileCheck %s
+
+struct B {
+ constexpr B() {}
+ constexpr ~B() { n *= 5; }
+ int n = 123;
+};
+
+// We emit a dynamic destructor here because b.n might have been modified
+// before b is destroyed.
+//
+// CHECK: @b = global {{.*}} i32 123
+B b = B();
+
+// CHECK: define {{.*}}cxx_global_var_init
+// CHECK: call {{.*}} @__cxa_atexit({{.*}} @_ZN1BD1Ev {{.*}} @b
diff --git a/src/llvm-project/clang/test/CodeGenCXX/nrvo.cpp b/src/llvm-project/clang/test/CodeGenCXX/nrvo.cpp
index aab2689..74a5af7 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/nrvo.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/nrvo.cpp
@@ -33,13 +33,13 @@
// CHECK-LABEL: define void @_Z5test1b(
// CHECK-EH-LABEL: define void @_Z5test1b(
X test1(bool B) {
- // CHECK: tail call {{.*}} @_ZN1XC1Ev
+ // CHECK: call {{.*}} @_ZN1XC1Ev
// CHECK-NEXT: ret void
X x;
if (B)
return (x);
return x;
- // CHECK-EH: tail call {{.*}} @_ZN1XC1Ev
+ // CHECK-EH: call {{.*}} @_ZN1XC1Ev
// CHECK-EH-NEXT: ret void
}
@@ -130,7 +130,7 @@
// CHECK-LABEL: define void @_Z5test3b
X test3(bool B) {
- // CHECK: tail call {{.*}} @_ZN1XC1Ev
+ // CHECK: call {{.*}} @_ZN1XC1Ev
// CHECK-NOT: call {{.*}} @_ZN1XC1ERKS_
// CHECK: call {{.*}} @_ZN1XC1Ev
// CHECK: call {{.*}} @_ZN1XC1ERKS_
@@ -148,14 +148,14 @@
// CHECK-LABEL: define void @_Z5test4b
X test4(bool B) {
{
- // CHECK: tail call {{.*}} @_ZN1XC1Ev
+ // CHECK: call {{.*}} @_ZN1XC1Ev
X x;
// CHECK: br i1
if (B)
return x;
}
- // CHECK: tail call {{.*}} @_ZN1XD1Ev
- // CHECK: tail call void @exit(i32 1)
+ // CHECK: call {{.*}} @_ZN1XD1Ev
+ // CHECK: call void @exit(i32 1)
exit(1);
}
@@ -191,7 +191,7 @@
// CHECK-LABEL: define void @_Z5test7b
X test7(bool b) {
- // CHECK: tail call {{.*}} @_ZN1XC1Ev
+ // CHECK: call {{.*}} @_ZN1XC1Ev
// CHECK-NEXT: ret
if (b) {
X x;
@@ -202,7 +202,7 @@
// CHECK-LABEL: define void @_Z5test8b
X test8(bool b) {
- // CHECK: tail call {{.*}} @_ZN1XC1Ev
+ // CHECK: call {{.*}} @_ZN1XC1Ev
// CHECK-NEXT: ret
if (b) {
X x;
@@ -218,6 +218,6 @@
}
// CHECK-LABEL: define linkonce_odr void @_ZN1YIiE1fEv
-// CHECK: tail call {{.*}} @_ZN1YIiEC1Ev
+// CHECK: call {{.*}} @_ZN1YIiEC1Ev
// CHECK-EH-03: attributes [[NR_NUW]] = { noreturn nounwind }
diff --git a/src/llvm-project/clang/test/CodeGenCXX/odr-use-lookahead.cpp b/src/llvm-project/clang/test/CodeGenCXX/odr-use-lookahead.cpp
new file mode 100644
index 0000000..8ce3753
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCXX/odr-use-lookahead.cpp
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -emit-llvm-only %s
+
+namespace PR43080 {
+ int f(int i) { return sizeof i<i; }
+}
+
+namespace PR42861 {
+ const unsigned long s = alignof(int);
+ void foo() { alignas(s) int j; }
+}
diff --git a/src/llvm-project/clang/test/CodeGenCXX/pod-member-memcpys.cpp b/src/llvm-project/clang/test/CodeGenCXX/pod-member-memcpys.cpp
index a43706c..4d46ace 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/pod-member-memcpys.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/pod-member-memcpys.cpp
@@ -123,41 +123,41 @@
CALL_AO(PackedMembers)
// Basic copy-assignment:
-// CHECK-LABEL: define linkonce_odr dereferenceable({{[0-9]+}}) %struct.Basic* @_ZN5BasicaSERKS_(%struct.Basic* %this, %struct.Basic* dereferenceable({{[0-9]+}}))
+// CHECK-LABEL: define linkonce_odr dereferenceable({{[0-9]+}}) %struct.Basic* @_ZN5BasicaSERKS_(%struct.Basic* %this, %struct.Basic* dereferenceable({{[0-9]+}}) %0)
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 16, i1 {{.*}})
// CHECK: call dereferenceable({{[0-9]+}}) %struct.NonPOD* @_ZN6NonPODaSERKS_
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 16, i1 {{.*}})
// CHECK: ret %struct.Basic*
// PODMember copy-assignment:
-// CHECK-LABEL: define linkonce_odr dereferenceable({{[0-9]+}}) %struct.PODMember* @_ZN9PODMemberaSERKS_(%struct.PODMember* %this, %struct.PODMember* dereferenceable({{[0-9]+}}))
+// CHECK-LABEL: define linkonce_odr dereferenceable({{[0-9]+}}) %struct.PODMember* @_ZN9PODMemberaSERKS_(%struct.PODMember* %this, %struct.PODMember* dereferenceable({{[0-9]+}}) %0)
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 32, i1 {{.*}})
// CHECK: call dereferenceable({{[0-9]+}}) %struct.NonPOD* @_ZN6NonPODaSERKS_
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 16, i1 {{.*}})
// CHECK: ret %struct.PODMember*
// PODLikeMember copy-assignment:
-// CHECK-LABEL: define linkonce_odr dereferenceable({{[0-9]+}}) %struct.PODLikeMember* @_ZN13PODLikeMemberaSERKS_(%struct.PODLikeMember* %this, %struct.PODLikeMember* dereferenceable({{[0-9]+}}))
+// CHECK-LABEL: define linkonce_odr dereferenceable({{[0-9]+}}) %struct.PODLikeMember* @_ZN13PODLikeMemberaSERKS_(%struct.PODLikeMember* %this, %struct.PODLikeMember* dereferenceable({{[0-9]+}}) %0)
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 32, i1 {{.*}})
// CHECK: call dereferenceable({{[0-9]+}}) %struct.NonPOD* @_ZN6NonPODaSERKS_
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 16, i1 {{.*}})
// CHECK: ret %struct.PODLikeMember*
// ArrayMember copy-assignment:
-// CHECK-LABEL: define linkonce_odr dereferenceable({{[0-9]+}}) %struct.ArrayMember* @_ZN11ArrayMemberaSERKS_(%struct.ArrayMember* %this, %struct.ArrayMember* dereferenceable({{[0-9]+}}))
+// CHECK-LABEL: define linkonce_odr dereferenceable({{[0-9]+}}) %struct.ArrayMember* @_ZN11ArrayMemberaSERKS_(%struct.ArrayMember* %this, %struct.ArrayMember* dereferenceable({{[0-9]+}}) %0)
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 64, i1 {{.*}})
// CHECK: call dereferenceable({{[0-9]+}}) %struct.NonPOD* @_ZN6NonPODaSERKS_
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 64, i1 {{.*}})
// CHECK: ret %struct.ArrayMember*
// ZeroLengthArrayMember copy-assignment:
-// CHECK-LABEL: define linkonce_odr dereferenceable({{[0-9]+}}) %struct.ZeroLengthArrayMember* @_ZN21ZeroLengthArrayMemberaSERKS_(%struct.ZeroLengthArrayMember* %this, %struct.ZeroLengthArrayMember* dereferenceable({{[0-9]+}}))
+// CHECK-LABEL: define linkonce_odr dereferenceable({{[0-9]+}}) %struct.ZeroLengthArrayMember* @_ZN21ZeroLengthArrayMemberaSERKS_(%struct.ZeroLengthArrayMember* %this, %struct.ZeroLengthArrayMember* dereferenceable({{[0-9]+}}) %0)
// CHECK: call dereferenceable({{[0-9]+}}) %struct.NonPOD* @_ZN6NonPODaSERKS_
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 8, i1 {{.*}})
// CHECK: ret %struct.ZeroLengthArrayMember*
// VolatileMember copy-assignment:
-// CHECK-LABEL: define linkonce_odr dereferenceable({{[0-9]+}}) %struct.VolatileMember* @_ZN14VolatileMemberaSERKS_(%struct.VolatileMember* %this, %struct.VolatileMember* dereferenceable({{[0-9]+}}))
+// CHECK-LABEL: define linkonce_odr dereferenceable({{[0-9]+}}) %struct.VolatileMember* @_ZN14VolatileMemberaSERKS_(%struct.VolatileMember* %this, %struct.VolatileMember* dereferenceable({{[0-9]+}}) %0)
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 16, i1 {{.*}})
// CHECK: load volatile i32, i32* {{.*}}, align 4
// CHECK: store volatile i32 {{.*}}, align 4
@@ -166,21 +166,21 @@
// CHECK: ret %struct.VolatileMember*
// BitfieldMember copy-assignment:
-// CHECK-LABEL: define linkonce_odr dereferenceable({{[0-9]+}}) %struct.BitfieldMember* @_ZN14BitfieldMemberaSERKS_(%struct.BitfieldMember* %this, %struct.BitfieldMember* dereferenceable({{[0-9]+}}))
+// CHECK-LABEL: define linkonce_odr dereferenceable({{[0-9]+}}) %struct.BitfieldMember* @_ZN14BitfieldMemberaSERKS_(%struct.BitfieldMember* %this, %struct.BitfieldMember* dereferenceable({{[0-9]+}}) %0)
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 16, i1 {{.*}})
// CHECK: call dereferenceable({{[0-9]+}}) %struct.NonPOD* @_ZN6NonPODaSERKS_
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 1 {{.*}} align 1 {{.*}}i64 3, i1 {{.*}})
// CHECK: ret %struct.BitfieldMember*
// InnerClass copy-assignment:
-// CHECK-LABEL: define linkonce_odr dereferenceable({{[0-9]+}}) %struct.InnerClassMember* @_ZN16InnerClassMemberaSERKS_(%struct.InnerClassMember* %this, %struct.InnerClassMember* dereferenceable({{[0-9]+}}))
+// CHECK-LABEL: define linkonce_odr dereferenceable({{[0-9]+}}) %struct.InnerClassMember* @_ZN16InnerClassMemberaSERKS_(%struct.InnerClassMember* %this, %struct.InnerClassMember* dereferenceable({{[0-9]+}}) %0)
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 32, i1 {{.*}})
// CHECK: call dereferenceable({{[0-9]+}}) %struct.NonPOD* @_ZN6NonPODaSERKS_
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 16, i1 {{.*}})
// CHECK: ret %struct.InnerClassMember*
// PackedMembers copy-assignment:
-// CHECK-LABEL: define linkonce_odr dereferenceable({{[0-9]+}}) %struct.PackedMembers* @_ZN13PackedMembersaSERKS_(%struct.PackedMembers* %this, %struct.PackedMembers* dereferenceable({{[0-9]+}}))
+// CHECK-LABEL: define linkonce_odr dereferenceable({{[0-9]+}}) %struct.PackedMembers* @_ZN13PackedMembersaSERKS_(%struct.PackedMembers* %this, %struct.PackedMembers* dereferenceable({{[0-9]+}}) %0)
// CHECK: call dereferenceable({{[0-9]+}}) %struct.NonPOD* @_ZN6NonPODaSERKS_
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 1 {{.*}} align 1 {{.*}}i64 16, i1 {{.*}})
// CHECK: ret %struct.PackedMembers*
@@ -195,27 +195,27 @@
CALL_CC(PackedMembers)
// PackedMembers copy-assignment:
-// CHECK-LABEL: define linkonce_odr void @_ZN13PackedMembersC2ERKS_(%struct.PackedMembers* %this, %struct.PackedMembers* dereferenceable({{[0-9]+}}))
+// CHECK-LABEL: define linkonce_odr void @_ZN13PackedMembersC2ERKS_(%struct.PackedMembers* %this, %struct.PackedMembers* dereferenceable({{[0-9]+}}) %0)
// CHECK: call void @_ZN6NonPODC1ERKS_
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 1 {{.*}} align 1 {{.*}}i64 16, i1 {{.*}})
// CHECK: ret void
CALL_CC(BitfieldMember2)
// BitfieldMember2 copy-constructor:
-// CHECK-2-LABEL: define linkonce_odr void @_ZN15BitfieldMember2C2ERKS_(%struct.BitfieldMember2* %this, %struct.BitfieldMember2* dereferenceable({{[0-9]+}}))
+// CHECK-2-LABEL: define linkonce_odr void @_ZN15BitfieldMember2C2ERKS_(%struct.BitfieldMember2* %this, %struct.BitfieldMember2* dereferenceable({{[0-9]+}}) %0)
// CHECK-2: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 16, i1 false)
// CHECK-2: call void @_ZN6NonPODC1ERKS_
// CHECK-2: ret void
CALL_CC(BitfieldMember3)
// BitfieldMember3 copy-constructor:
-// CHECK-LABEL: define linkonce_odr void @_ZN15BitfieldMember3C2ERKS_(%struct.BitfieldMember3* %this, %struct.BitfieldMember3* dereferenceable({{[0-9]+}}))
+// CHECK-LABEL: define linkonce_odr void @_ZN15BitfieldMember3C2ERKS_(%struct.BitfieldMember3* %this, %struct.BitfieldMember3* dereferenceable({{[0-9]+}}) %0)
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 8 {{.*}} align 8 {{.*}}i64 8, i1 false)
// CHECK: ret void
CALL_CC(ReferenceMember)
// ReferenceMember copy-constructor:
-// CHECK-LABEL: define linkonce_odr void @_ZN15ReferenceMemberC2ERKS_(%struct.ReferenceMember* %this, %struct.ReferenceMember* dereferenceable({{[0-9]+}}))
+// CHECK-LABEL: define linkonce_odr void @_ZN15ReferenceMemberC2ERKS_(%struct.ReferenceMember* %this, %struct.ReferenceMember* dereferenceable({{[0-9]+}}) %0)
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 8 {{.*}} align 8 {{.*}}i64 16, i1 {{.*}})
// CHECK: call void @_ZN6NonPODC1ERKS_
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 8 {{.*}} align 8 {{.*}}i64 16, i1 {{.*}})
@@ -223,7 +223,7 @@
CALL_CC(InnerClassMember)
// InnerClass copy-constructor:
-// CHECK-LABEL: define linkonce_odr void @_ZN16InnerClassMemberC2ERKS_(%struct.InnerClassMember* %this, %struct.InnerClassMember* dereferenceable({{[0-9]+}}))
+// CHECK-LABEL: define linkonce_odr void @_ZN16InnerClassMemberC2ERKS_(%struct.InnerClassMember* %this, %struct.InnerClassMember* dereferenceable({{[0-9]+}}) %0)
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 32, i1 {{.*}})
// CHECK: call void @_ZN6NonPODC1ERKS_
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 16, i1 {{.*}})
@@ -231,7 +231,7 @@
CALL_CC(BitfieldMember)
// BitfieldMember copy-constructor:
-// CHECK-LABEL: define linkonce_odr void @_ZN14BitfieldMemberC2ERKS_(%struct.BitfieldMember* %this, %struct.BitfieldMember* dereferenceable({{[0-9]+}}))
+// CHECK-LABEL: define linkonce_odr void @_ZN14BitfieldMemberC2ERKS_(%struct.BitfieldMember* %this, %struct.BitfieldMember* dereferenceable({{[0-9]+}}) %0)
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 16, i1 {{.*}})
// CHECK: call void @_ZN6NonPODC1ERKS_
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 1 {{.*}} align 1 {{.*}}i64 3, i1 {{.*}})
@@ -239,7 +239,7 @@
CALL_CC(VolatileMember)
// VolatileMember copy-constructor:
-// CHECK-LABEL: define linkonce_odr void @_ZN14VolatileMemberC2ERKS_(%struct.VolatileMember* %this, %struct.VolatileMember* dereferenceable({{[0-9]+}}))
+// CHECK-LABEL: define linkonce_odr void @_ZN14VolatileMemberC2ERKS_(%struct.VolatileMember* %this, %struct.VolatileMember* dereferenceable({{[0-9]+}}) %0)
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 16, i1 {{.*}})
// CHECK: load volatile i32, i32* {{.*}}, align 4
// CHECK: store volatile i32 {{.*}}, align 4
@@ -249,7 +249,7 @@
CALL_CC(ArrayMember)
// ArrayMember copy-constructor:
-// CHECK-LABEL: define linkonce_odr void @_ZN11ArrayMemberC2ERKS_(%struct.ArrayMember* %this, %struct.ArrayMember* dereferenceable({{[0-9]+}}))
+// CHECK-LABEL: define linkonce_odr void @_ZN11ArrayMemberC2ERKS_(%struct.ArrayMember* %this, %struct.ArrayMember* dereferenceable({{[0-9]+}}) %0)
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 64, i1 {{.*}})
// CHECK: call void @_ZN6NonPODC1ERKS_
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 64, i1 {{.*}})
@@ -257,7 +257,7 @@
CALL_CC(PODLikeMember)
// PODLikeMember copy-constructor:
-// CHECK-LABEL: define linkonce_odr void @_ZN13PODLikeMemberC2ERKS_(%struct.PODLikeMember* %this, %struct.PODLikeMember* dereferenceable({{[0-9]+}}))
+// CHECK-LABEL: define linkonce_odr void @_ZN13PODLikeMemberC2ERKS_(%struct.PODLikeMember* %this, %struct.PODLikeMember* dereferenceable({{[0-9]+}}) %0)
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 32, i1 {{.*}})
// CHECK: invoke void @_ZN6NonPODC1ERKS_
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 16, i1 {{.*}})
@@ -267,7 +267,7 @@
CALL_CC(PODMember)
// PODMember copy-constructor:
-// CHECK-LABEL: define linkonce_odr void @_ZN9PODMemberC2ERKS_(%struct.PODMember* %this, %struct.PODMember* dereferenceable({{[0-9]+}}))
+// CHECK-LABEL: define linkonce_odr void @_ZN9PODMemberC2ERKS_(%struct.PODMember* %this, %struct.PODMember* dereferenceable({{[0-9]+}}) %0)
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 32, i1 {{.*}})
// CHECK: call void @_ZN6NonPODC1ERKS_
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 16, i1 {{.*}})
@@ -275,7 +275,7 @@
CALL_CC(Basic)
// Basic copy-constructor:
-// CHECK-LABEL: define linkonce_odr void @_ZN5BasicC2ERKS_(%struct.Basic* %this, %struct.Basic* dereferenceable({{[0-9]+}}))
+// CHECK-LABEL: define linkonce_odr void @_ZN5BasicC2ERKS_(%struct.Basic* %this, %struct.Basic* dereferenceable({{[0-9]+}}) %0)
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 16, i1 {{.*}})
// CHECK: call void @_ZN6NonPODC1ERKS_
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}} align 4 {{.*}} align 4 {{.*}}i64 16, i1 {{.*}})
diff --git a/src/llvm-project/clang/test/CodeGenCXX/pr18661.cpp b/src/llvm-project/clang/test/CodeGenCXX/pr18661.cpp
index 65ffd6f..dc9f4ac 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/pr18661.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/pr18661.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -triple %itanium_abi_triple -fcxx-exceptions -fms-extensions -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 %s -triple %itanium_abi_triple -fcxx-exceptions -fms-compatibility -emit-llvm -o - | FileCheck %s
extern "C" {
void f();
diff --git a/src/llvm-project/clang/test/CodeGenCXX/pragma-loop-pr27643.cpp b/src/llvm-project/clang/test/CodeGenCXX/pragma-loop-pr27643.cpp
new file mode 100644
index 0000000..87a2250
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCXX/pragma-loop-pr27643.cpp
@@ -0,0 +1,52 @@
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++11 -emit-llvm -o - %s | FileCheck %s
+
+void loop1(int *List, int Length) {
+// CHECK-LABEL: @{{.*}}loop1{{.*}}(
+// CHECK: br label {{.*}}, !llvm.loop ![[LOOP1:.*]]
+
+ #pragma clang loop vectorize(enable) vectorize_width(1)
+ for (int i = 0; i < Length; i++)
+ List[i] = i * 2;
+}
+
+// Here, vectorize.enable should be set, obviously, but also check that
+// metadata isn't added twice.
+void loop2(int *List, int Length) {
+// CHECK-LABEL: @{{.*}}loop2{{.*}}(
+// CHECK: br label {{.*}}, !llvm.loop ![[LOOP2:.*]]
+
+ #pragma clang loop vectorize(enable) vectorize_width(2)
+ for (int i = 0; i < Length; i++)
+ List[i] = i * 2;
+}
+
+// Test that we do *not* imply vectorize.enable.
+void loop3(int *List, int Length) {
+// CHECK-LABEL: @{{.*}}loop3{{.*}}(
+// CHECK: br label {{.*}}, !llvm.loop ![[LOOP3:.*]]
+
+ #pragma clang loop vectorize_width(1)
+ for (int i = 0; i < Length; i++)
+ List[i] = i * 2;
+}
+
+// Test that we *do* imply vectorize.enable.
+void loop4(int *List, int Length) {
+// CHECK-LABEL: @{{.*}}loop4{{.*}}(
+// CHECK: br label {{.*}}, !llvm.loop ![[LOOP4:.*]]
+
+ #pragma clang loop vectorize_width(2)
+ for (int i = 0; i < Length; i++)
+ List[i] = i * 2;
+}
+
+// CHECK: ![[LOOP1]] = distinct !{![[LOOP1]], ![[VEC_WIDTH_1:.*]], ![[VEC_ENABLE:.*]]}
+// CHECK: ![[VEC_WIDTH_1]] = !{!"llvm.loop.vectorize.width", i32 1}
+// CHECK: ![[VEC_ENABLE]] = !{!"llvm.loop.vectorize.enable", i1 true}
+
+// CHECK: ![[LOOP2]] = distinct !{![[LOOP2]], ![[VEC_WIDTH_2:.*]], ![[VEC_ENABLE]]}
+// CHECK: ![[VEC_WIDTH_2]] = !{!"llvm.loop.vectorize.width", i32 2}
+
+// CHECK: ![[LOOP3]] = distinct !{![[LOOP3]], ![[VEC_WIDTH_1]]}
+
+// CHECK: ![[LOOP4]] = distinct !{![[LOOP4]], ![[VEC_WIDTH_2]], ![[VEC_ENABLE]]}
diff --git a/src/llvm-project/clang/test/CodeGenCXX/pragma-loop-predicate.cpp b/src/llvm-project/clang/test/CodeGenCXX/pragma-loop-predicate.cpp
new file mode 100644
index 0000000..ec2161d
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCXX/pragma-loop-predicate.cpp
@@ -0,0 +1,76 @@
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++11 -emit-llvm -o - %s | FileCheck %s
+
+void test0(int *List, int Length) {
+// CHECK-LABEL: @{{.*}}test0{{.*}}(
+// CHECK: br label {{.*}}, !llvm.loop ![[LOOP0:.*]]
+
+ #pragma clang loop vectorize(enable)
+ for (int i = 0; i < Length; i++)
+ List[i] = i * 2;
+}
+
+void test1(int *List, int Length) {
+// CHECK-LABEL: @{{.*}}test1{{.*}}(
+// CHECK: br label {{.*}}, !llvm.loop ![[LOOP1:.*]]
+
+ #pragma clang loop vectorize(enable) vectorize_predicate(enable)
+ for (int i = 0; i < Length; i++)
+ List[i] = i * 2;
+}
+
+void test2(int *List, int Length) {
+// CHECK-LABEL: @{{.*}}test2{{.*}}(
+// CHECK: br label {{.*}}, !llvm.loop ![[LOOP2:.*]]
+
+ #pragma clang loop vectorize(enable) vectorize_predicate(disable)
+ for (int i = 0; i < Length; i++)
+ List[i] = i * 2;
+}
+
+// vectorize_predicate(enable) implies vectorize(enable)
+void test3(int *List, int Length) {
+// CHECK-LABEL: @{{.*}}test3{{.*}}(
+// CHECK: br label {{.*}}, !llvm.loop ![[LOOP3:.*]]
+
+ #pragma clang loop vectorize_predicate(enable)
+ for (int i = 0; i < Length; i++)
+ List[i] = i * 2;
+}
+
+// Check that disabling vectorization means a vectorization width of 1, and
+// also that vectorization_predicate isn't enabled.
+void test4(int *List, int Length) {
+// CHECK-LABEL: @{{.*}}test4{{.*}}(
+// CHECK: br label {{.*}}, !llvm.loop ![[LOOP4:.*]]
+
+ #pragma clang loop vectorize(disable)
+ for (int i = 0; i < Length; i++)
+ List[i] = i * 2;
+}
+
+// Check that vectorize and vectorize_predicate are disabled.
+void test5(int *List, int Length) {
+// CHECK-LABEL: @{{.*}}test5{{.*}}(
+// CHECK: br label {{.*}}, !llvm.loop ![[LOOP5:.*]]
+
+ #pragma clang loop vectorize(disable) vectorize_predicate(enable)
+ for (int i = 0; i < Length; i++)
+ List[i] = i * 2;
+}
+
+
+// CHECK: ![[LOOP0]] = distinct !{![[LOOP0]], !3}
+// CHECK-NEXT: !3 = !{!"llvm.loop.vectorize.enable", i1 true}
+
+// CHECK-NEXT: ![[LOOP1]] = distinct !{![[LOOP1]], !5, !3}
+// CHECK-NEXT: !5 = !{!"llvm.loop.vectorize.predicate.enable", i1 true}
+
+// CHECK-NEXT: ![[LOOP2]] = distinct !{![[LOOP2]], !7, !3}
+// CHECK-NEXT: !7 = !{!"llvm.loop.vectorize.predicate.enable", i1 false}
+
+// CHECK-NEXT: ![[LOOP3]] = distinct !{![[LOOP3]], !5, !3}
+
+// CHECK-NEXT: ![[LOOP4]] = distinct !{![[LOOP4]], !10}
+// CHECK-NEXT: !10 = !{!"llvm.loop.vectorize.width", i32 1}
+
+// CHECK-NEXT: ![[LOOP5]] = distinct !{![[LOOP5]], !10}
diff --git a/src/llvm-project/clang/test/CodeGenCXX/pragma-loop.cpp b/src/llvm-project/clang/test/CodeGenCXX/pragma-loop.cpp
index 32075f9..d730f30 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/pragma-loop.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/pragma-loop.cpp
@@ -161,20 +161,20 @@
// CHECK: ![[LOOP_1]] = distinct !{![[LOOP_1]], ![[UNROLL_FULL:.*]]}
// CHECK: ![[UNROLL_FULL]] = !{!"llvm.loop.unroll.full"}
-// CHECK: ![[LOOP_2]] = distinct !{![[LOOP_2]], ![[UNROLL_DISABLE:.*]], ![[DISTRIBUTE_DISABLE:.*]], ![[WIDTH_8:.*]], ![[INTERLEAVE_4:.*]]}
+// CHECK: ![[LOOP_2]] = distinct !{![[LOOP_2]], ![[UNROLL_DISABLE:.*]], ![[DISTRIBUTE_DISABLE:.*]], ![[WIDTH_8:.*]], ![[INTERLEAVE_4:.*]], ![[VECTORIZE_ENABLE:.*]]}
// CHECK: ![[UNROLL_DISABLE]] = !{!"llvm.loop.unroll.disable"}
// CHECK: ![[DISTRIBUTE_DISABLE]] = !{!"llvm.loop.distribute.enable", i1 false}
// CHECK: ![[WIDTH_8]] = !{!"llvm.loop.vectorize.width", i32 8}
// CHECK: ![[INTERLEAVE_4]] = !{!"llvm.loop.interleave.count", i32 4}
+// CHECK: ![[VECTORIZE_ENABLE]] = !{!"llvm.loop.vectorize.enable", i1 true}
-// CHECK: ![[LOOP_3]] = distinct !{![[LOOP_3]], ![[INTERLEAVE_4:.*]], ![[INTENABLE_1:.*]], ![[FOLLOWUP_VECTOR_3:.*]]}
-// CHECK: ![[INTENABLE_1]] = !{!"llvm.loop.vectorize.enable", i1 true}
+// CHECK: ![[LOOP_3]] = distinct !{![[LOOP_3]], ![[INTERLEAVE_4:.*]], ![[VECTORIZE_ENABLE]], ![[FOLLOWUP_VECTOR_3:.*]]}
// CHECK: ![[FOLLOWUP_VECTOR_3]] = !{!"llvm.loop.vectorize.followup_all", ![[AFTER_VECTOR_3:.*]]}
// CHECK: ![[AFTER_VECTOR_3]] = distinct !{![[AFTER_VECTOR_3]], ![[ISVECTORIZED:.*]], ![[UNROLL_8:.*]]}
// CHECK: ![[ISVECTORIZED]] = !{!"llvm.loop.isvectorized"}
// CHECK: ![[UNROLL_8]] = !{!"llvm.loop.unroll.count", i32 8}
-// CHECK: ![[LOOP_4]] = distinct !{![[LOOP_4]], ![[WIDTH_2:.*]], ![[INTERLEAVE_2:.*]]}
+// CHECK: ![[LOOP_4]] = distinct !{![[LOOP_4]], ![[WIDTH_2:.*]], ![[INTERLEAVE_2:.*]], ![[VECTORIZE_ENABLE]]}
// CHECK: ![[WIDTH_2]] = !{!"llvm.loop.vectorize.width", i32 2}
// CHECK: ![[INTERLEAVE_2]] = !{!"llvm.loop.interleave.count", i32 2}
@@ -185,7 +185,7 @@
// CHECK: ![[FOLLOWUP_VECTOR_6]] = !{!"llvm.loop.vectorize.followup_all", ![[AFTER_VECTOR_6:.*]]}
// CHECK: ![[AFTER_VECTOR_6]] = distinct !{![[AFTER_VECTOR_6]], ![[ISVECTORIZED:.*]], ![[UNROLL_8:.*]]}
-// CHECK: ![[LOOP_7]] = distinct !{![[LOOP_7]], ![[WIDTH_5:.*]]}
+// CHECK: ![[LOOP_7]] = distinct !{![[LOOP_7]], ![[WIDTH_5:.*]], ![[VECTORIZE_ENABLE]]}
// CHECK: ![[WIDTH_5]] = !{!"llvm.loop.vectorize.width", i32 5}
// CHECK: ![[LOOP_8]] = distinct !{![[LOOP_8]], ![[WIDTH_5:.*]]}
@@ -207,11 +207,11 @@
// CHECK: ![[AFTER_VECTOR_12]] = distinct !{![[AFTER_VECTOR_12]], ![[ISVECTORIZED:.*]], ![[UNROLL_24:.*]]}
// CHECK: ![[UNROLL_24]] = !{!"llvm.loop.unroll.count", i32 24}
-// CHECK: ![[LOOP_13]] = distinct !{![[LOOP_13]], ![[WIDTH_8:.*]], ![[INTERLEAVE_16:.*]], ![[FOLLOWUP_VECTOR_13:.*]]}
+// CHECK: ![[LOOP_13]] = distinct !{![[LOOP_13]], ![[WIDTH_8:.*]], ![[INTERLEAVE_16:.*]], ![[VECTORIZE_ENABLE]], ![[FOLLOWUP_VECTOR_13:.*]]}
// CHECK: ![[INTERLEAVE_16]] = !{!"llvm.loop.interleave.count", i32 16}
// CHECK: ![[FOLLOWUP_VECTOR_13]] = !{!"llvm.loop.vectorize.followup_all", ![[AFTER_VECTOR_13:.*]]}
// CHECK: ![[AFTER_VECTOR_13]] = distinct !{![[AFTER_VECTOR_13]], ![[ISVECTORIZED:.*]], ![[UNROLL_32:.*]]}
// CHECK: ![[UNROLL_32]] = !{!"llvm.loop.unroll.count", i32 32}
-// CHECK: ![[LOOP_14]] = distinct !{![[LOOP_14]], ![[WIDTH_10:.*]]}
+// CHECK: ![[LOOP_14]] = distinct !{![[LOOP_14]], ![[WIDTH_10:.*]], ![[VECTORIZE_ENABLE]]}
// CHECK: ![[WIDTH_10]] = !{!"llvm.loop.vectorize.width", i32 10}
diff --git a/src/llvm-project/clang/test/CodeGenCXX/profile-remap-error.cpp b/src/llvm-project/clang/test/CodeGenCXX/profile-remap-error.cpp
new file mode 100644
index 0000000..0a04e85
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCXX/profile-remap-error.cpp
@@ -0,0 +1,7 @@
+// REQUIRES: x86-registered-target
+
+// RUN: not %clang_cc1 -triple x86_64-linux-gnu -fprofile-sample-use=%S/Inputs/profile-remap.samples -fprofile-remapping-file=%S/Inputs/profile-remap-error.map -fexperimental-new-pass-manager -O2 %s -emit-llvm -o - 2>&1 | FileCheck %s
+
+// CHECK: error: {{.*}}/profile-remap-error.map:1: Could not demangle 'unmangled' as a <name>; invalid mangling?
+// CHECK-NEXT: error: {{.*}}/profile-remap-error.map: Could not create remapper: Malformed sample profile data
+// CHECK-NEXT: error: {{.*}}/profile-remap.samples: Could not open profile: Malformed sample profile data
diff --git a/src/llvm-project/clang/test/CodeGenCXX/regcall.cpp b/src/llvm-project/clang/test/CodeGenCXX/regcall.cpp
index 315c5bc..bdf7696 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/regcall.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/regcall.cpp
@@ -74,8 +74,8 @@
// CHECK-WIN32-DAG: define dso_local x86_regcallcc zeroext i1 @"??8@Yw_NABVtest_class@@0@Z"
test_class __regcall operator""_test_class (unsigned long long) { ++x; return test_class{};}
-// CHECK-LIN64-DAG: define x86_regcallcc void @_Zli11_test_classy(%class.test_class* noalias sret %agg.result, i64)
-// CHECK-LIN32-DAG: define x86_regcallcc void @_Zli11_test_classy(%class.test_class* inreg noalias sret %agg.result, i64)
+// CHECK-LIN64-DAG: define x86_regcallcc void @_Zli11_test_classy(%class.test_class* noalias sret %agg.result, i64 %0)
+// CHECK-LIN32-DAG: define x86_regcallcc void @_Zli11_test_classy(%class.test_class* inreg noalias sret %agg.result, i64 %0)
// CHECK-WIN64-DAG: ??__K_test_class@@Yw?AVtest_class@@_K@Z"
// CHECK-WIN32-DAG: ??__K_test_class@@Yw?AVtest_class@@_K@Z"
diff --git a/src/llvm-project/clang/test/CodeGenCXX/runtime-dllstorage.cpp b/src/llvm-project/clang/test/CodeGenCXX/runtime-dllstorage.cpp
index d89b508..694a9b4 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/runtime-dllstorage.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/runtime-dllstorage.cpp
@@ -1,13 +1,13 @@
// RUN: %clang_cc1 -triple i686-windows-msvc -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -emit-llvm -o - %s | FileCheck -allow-deprecated-dag-overlap %s -check-prefix CHECK-MS -check-prefix CHECK-MS-DYNAMIC
// RUN: %clang_cc1 -triple i686-windows-msvc -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -flto-visibility-public-std -emit-llvm -o - %s | FileCheck -allow-deprecated-dag-overlap %s -check-prefix CHECK-MS -check-prefix CHECK-MS-STATIC
-// RUN: %clang_cc1 -triple i686-windows-itanium -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -emit-llvm -o - %s | FileCheck -allow-deprecated-dag-overlap %s -check-prefix CHECK-IA -check-prefix CHECK-DYNAMIC-IA -check-prefix CHECK-DYNAMIC-NODECL-IA -check-prefix CHECK-DYANMIC-IA-CXA-ATEXIT
+// RUN: %clang_cc1 -triple i686-windows-itanium -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -emit-llvm -o - %s | FileCheck -allow-deprecated-dag-overlap %s -check-prefix CHECK-IA -check-prefix CHECK-DYNAMIC-IA -check-prefix CHECK-DYNAMIC-NODECL-IA -check-prefix CHECK-DYNAMIC-IA-CXA-ATEXIT
// RUN: %clang_cc1 -triple i686-windows-itanium -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -flto-visibility-public-std -emit-llvm -o - %s | FileCheck -allow-deprecated-dag-overlap %s -check-prefix CHECK-IA -check-prefix CHECK-STATIC-IA -check-prefix CHECK-STATIC-NODECL-IA -check-prefix CHECK-IA-STATIC-CXA-ATEXIT
-// RUN: %clang_cc1 -triple i686-windows-itanium -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -DIMPORT_DECLARATIONS -emit-llvm -o - %s | FileCheck -allow-deprecated-dag-overlap %s -check-prefix CHECK-IA -check-prefix CHECK-DYNAMIC-IA -check-prefix CHECK-DYNAMIC-IMPORT-IA -check-prefix CHECK-DYANMIC-IA-CXA-ATEXIT
+// RUN: %clang_cc1 -triple i686-windows-itanium -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -DIMPORT_DECLARATIONS -emit-llvm -o - %s | FileCheck -allow-deprecated-dag-overlap %s -check-prefix CHECK-IA -check-prefix CHECK-DYNAMIC-IA -check-prefix CHECK-DYNAMIC-IMPORT-IA -check-prefix CHECK-DYNAMIC-IA-CXA-ATEXIT
// RUN: %clang_cc1 -triple i686-windows-itanium -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -flto-visibility-public-std -DIMPORT_DECLARATIONS -emit-llvm -o - %s | FileCheck -allow-deprecated-dag-overlap %s -check-prefix CHECK-IA -check-prefix CHECK-STATIC-IA -check-prefix CHECK-STATIC-IMPORT-IA -check-prefix CHECK-IA-STATIC-CXA-ATEXIT
-// RUN: %clang_cc1 -triple i686-windows-itanium -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -DEXPORT_DECLARATIONS -emit-llvm -o - %s | FileCheck -allow-deprecated-dag-overlap %s -check-prefix CHECK-IA -check-prefix CHECK-DYNAMIC-IA -check-prefix CHECK-DYANMIC-IA-CXA-ATEXIT
+// RUN: %clang_cc1 -triple i686-windows-itanium -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -DEXPORT_DECLARATIONS -emit-llvm -o - %s | FileCheck -allow-deprecated-dag-overlap %s -check-prefix CHECK-IA -check-prefix CHECK-DYNAMIC-IA -check-prefix CHECK-DYNAMIC-IA-CXA-ATEXIT
// RUN: %clang_cc1 -triple i686-windows-itanium -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -flto-visibility-public-std -DEXPORT_DECLARATIONS -emit-llvm -o - %s | FileCheck -allow-deprecated-dag-overlap %s -check-prefix CHECK-IA -check-prefix CHECK-STATIC-IA -check-prefix CHECK-IA-STATIC-CXA-ATEXIT
-// RUN: %clang_cc1 -triple i686-windows-itanium -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -DDECL -emit-llvm -o - %s | FileCheck -allow-deprecated-dag-overlap %s -check-prefix CHECK-IA -check-prefix CHECK-DYNAMIC-IA -check-prefix CHECK-DYNAMIC-DECL-IA -check-prefix CHECK-DYANMIC-IA-CXA-ATEXIT
+// RUN: %clang_cc1 -triple i686-windows-itanium -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -DDECL -emit-llvm -o - %s | FileCheck -allow-deprecated-dag-overlap %s -check-prefix CHECK-IA -check-prefix CHECK-DYNAMIC-IA -check-prefix CHECK-DYNAMIC-DECL-IA -check-prefix CHECK-DYNAMIC-IA-CXA-ATEXIT
// RUN: %clang_cc1 -triple i686-windows-itanium -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -flto-visibility-public-std -DDECL -emit-llvm -o - %s | FileCheck -allow-deprecated-dag-overlap %s -check-prefix CHECK-IA -check-prefix CHECK-STATIC-IA -check-prefix CHECK-STATIC-DECL-IA -check-prefix CHECK-IA-STATIC-CXA-ATEXIT
// %clang_cc1 -triple i686-windows-itanium -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -fno-use-cxa-atexit -emit-llvm -o - %s | FileCheck %s -check-prefix CHECK-IA -check-prefix CHECK-DYNAMIC-IA -check-prefix CHECK-DYNAMIC-IA-ATEXIT
// %clang_cc1 -triple i686-windows-itanium -std=c++11 -fdeclspec -fms-compatibility -fexceptions -fcxx-exceptions -fno-use-cxa-atexit -emit-llvm -o - %s | FileCheck %s -check-prefix CHECK-IA -check-prefix CHECK-STATIC-IA -check-prefix CHECK-STATIC-IA-ATEXIT
@@ -116,7 +116,7 @@
// CHECK-IA-DAG: @_ZTH1t = dso_local alias void (), void ()* @__tls_init
// CHECK-IA-DAG: declare dso_local i32 @__gxx_personality_v0(...)
-// CHECK-IA-DAG: define linkonce_odr hidden void @__clang_call_terminate(i8*)
+// CHECK-IA-DAG: define linkonce_odr hidden void @__clang_call_terminate(i8* %0)
// CHECK-DYNAMIC-IA-DAG: declare dllimport i32 @__cxa_thread_atexit(void (i8*)*, i8*, i8*)
// CHECK-DYNAMIC-IA-DAG: declare dllimport i32 @__cxa_atexit(void (i8*)*, i8*, i8*)
diff --git a/src/llvm-project/clang/test/CodeGenCXX/stack-reuse.cpp b/src/llvm-project/clang/test/CodeGenCXX/stack-reuse.cpp
index 8325604..35dcb5b 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/stack-reuse.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/stack-reuse.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple armv7-unknown-linux-gnueabihf %s -o - -emit-llvm -O1 | FileCheck %s
+// RUN: %clang_cc1 -triple armv7-unknown-linux-gnueabihf %s -o - -emit-llvm -O2 | FileCheck %s
// Stack should be reused when possible, no need to allocate two separate slots
// if they have disjoint lifetime.
diff --git a/src/llvm-project/clang/test/CodeGenCXX/static-destructor.cpp b/src/llvm-project/clang/test/CodeGenCXX/static-destructor.cpp
index 0ea84f8..1feb506 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/static-destructor.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/static-destructor.cpp
@@ -29,5 +29,5 @@
// WASM: define internal void @__cxx_global_var_init()
// WASM: call i32 @__cxa_atexit(void (i8*)* @__cxx_global_array_dtor, i8* null, i8* @__dso_handle)
-// WASM: define internal void @__cxx_global_array_dtor(i8*)
+// WASM: define internal void @__cxx_global_array_dtor(i8* %0)
// WASM: %call = call %class.Foo* @_ZN3FooD1Ev(%class.Foo* @global)
diff --git a/src/llvm-project/clang/test/CodeGenCXX/target-features-error.cpp b/src/llvm-project/clang/test/CodeGenCXX/target-features-error.cpp
index 44179de..28fe4d0 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/target-features-error.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/target-features-error.cpp
@@ -1,4 +1,6 @@
-// RUN: %clang_cc1 %s -triple=x86_64-linux-gnu -S -verify -o -
+// RUN: %clang_cc1 %s -triple=x86_64-linux-gnu -S -verify -o - -DTEST1
+// RUN: %clang_cc1 %s -triple=x86_64-linux-gnu -S -verify -o - -DTEST2
+// RUN: %clang_cc1 %s -triple=x86_64-linux-gnu -S -verify -o - -DTEST3
struct S {
__attribute__((always_inline, target("avx512f")))
@@ -9,9 +11,51 @@
void operator()(){ }
};
+__attribute__((always_inline, target("avx512f")))
+void free_func(){}
+
+#ifdef TEST1
void usage(S & s) {
s.foo(); // expected-error {{'foo' requires target feature 'avx512f'}}
(void)(int)s; // expected-error {{'operator int' requires target feature 'avx512f'}}
s(); // expected-error {{'operator()' requires target feature 'avx512f'}}
+ free_func(); // expected-error{{'free_func' requires target feature 'avx512f'}}
+
}
+#endif
+
+#ifdef TEST2
+__attribute__((target("avx512f")))
+void usage(S & s) {
+ s.foo();
+ (void)(int)s;
+ s();
+
+ [&s] {
+ s.foo(); // expected-error {{'foo' requires target feature 'avx512f'}}
+ (void)(int) s; // expected-error {{'operator int' requires target feature 'avx512f'}}
+ s(); // expected-error {{'operator()' requires target feature 'avx512f'}}
+ free_func(); // expected-error{{'free_func' requires target feature 'avx512f'}}
+ }();
+}
+#endif
+
+#ifdef TEST3
+void usage(S & s) {
+
+ [&s] () __attribute__((target("avx512f"))) {
+ s.foo();
+ (void)(int) s;
+ s();
+ free_func();
+ }();
+
+ [&s] {
+ s.foo(); // expected-error {{'foo' requires target feature 'avx512f'}}
+ (void)(int) s; // expected-error {{'operator int' requires target feature 'avx512f'}}
+ s(); // expected-error {{'operator()' requires target feature 'avx512f'}}
+ free_func(); // expected-error{{'free_func' requires target feature 'avx512f'}}
+ }();
+}
+#endif
diff --git a/src/llvm-project/clang/test/CodeGenCXX/thunks-ehspec.cpp b/src/llvm-project/clang/test/CodeGenCXX/thunks-ehspec.cpp
new file mode 100644
index 0000000..3027694
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCXX/thunks-ehspec.cpp
@@ -0,0 +1,29 @@
+// RUN: %clang_cc1 -fexceptions -fcxx-exceptions %s -triple=x86_64-pc-linux-gnu -munwind-tables -emit-llvm -o - -O1 -disable-llvm-passes | FileCheck %s
+
+// When generating the thunk for secondary, do not push terminate scopes for
+// either the varargs or non-varargs case. Related to PR44987.
+
+struct A {
+ virtual void primary_key();
+};
+struct B {
+ virtual void secondary();
+ virtual void secondary_vararg(int, ...);
+};
+class C : A, B {
+ virtual void primary_key();
+ void secondary() noexcept;
+ void secondary_vararg(int, ...) noexcept;
+};
+void C::primary_key() {}
+
+// CHECK-LABEL: define available_externally void @_ZThn8_N1C9secondaryEv(%class.C* %this)
+// CHECK-NOT: invoke
+// CHECK: tail call void @_ZN1C9secondaryEv(%class.C* %{{.*}})
+// CHECK-NOT: invoke
+// CHECK: ret void
+
+// CHECK-LABEL: define available_externally void @_ZThn8_N1C16secondary_varargEiz(%class.C* %this, i32 %0, ...)
+// CHECK-NOT: invoke
+// CHECK: musttail call void (%class.C*, i32, ...) @_ZN1C16secondary_varargEiz(%class.C* %{{.*}}, i32 %{{.*}}, ...) #2
+// CHECK-NEXT: ret void
diff --git a/src/llvm-project/clang/test/CodeGenCXX/thunks.cpp b/src/llvm-project/clang/test/CodeGenCXX/thunks.cpp
index b4a0f90..4a0610e 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/thunks.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/thunks.cpp
@@ -1,5 +1,20 @@
-// RUN: %clang_cc1 %s -triple=x86_64-pc-linux-gnu -munwind-tables -emit-llvm -o - | FileCheck --check-prefix=CHECK --check-prefix=CHECK-NONOPT %s
-// RUN: %clang_cc1 %s -triple=x86_64-pc-linux-gnu -munwind-tables -emit-llvm -o - -O1 -disable-llvm-passes | FileCheck --check-prefix=CHECK --check-prefix=CHECK-OPT %s
+// Sparc64 doesn't support musttail (yet), so it uses method cloning for
+// variadic thunks. Use it for testing.
+// RUN: %clang_cc1 %s -triple=sparc64-pc-linux-gnu -munwind-tables -emit-llvm -o - \
+// RUN: | FileCheck --check-prefixes=CHECK,CHECK-CLONE,CHECK-NONOPT %s
+// RUN: %clang_cc1 %s -triple=sparc64-pc-linux-gnu -debug-info-kind=standalone -dwarf-version=5 -munwind-tables -emit-llvm -o - \
+// RUN: | FileCheck --check-prefixes=CHECK,CHECK-CLONE,CHECK-NONOPT,CHECK-DBG %s
+// RUN: %clang_cc1 %s -triple=sparc64-pc-linux-gnu -munwind-tables -emit-llvm -o - -O1 -disable-llvm-passes \
+// RUN: | FileCheck --check-prefixes=CHECK,CHECK-CLONE,CHECK-OPT %s
+
+// Test x86_64, which uses musttail for variadic thunks.
+// RUN: %clang_cc1 %s -triple=x86_64-pc-linux-gnu -munwind-tables -emit-llvm -o - -O1 -disable-llvm-passes \
+// RUN: | FileCheck --check-prefixes=CHECK,CHECK-TAIL,CHECK-OPT %s
+
+// Finally, reuse these tests for the MS ABI.
+// RUN: %clang_cc1 %s -triple=x86_64-windows-msvc -munwind-tables -emit-llvm -o - -O1 -disable-llvm-passes \
+// RUN: | FileCheck --check-prefixes=WIN64 %s
+
namespace Test1 {
@@ -20,6 +35,13 @@
};
// CHECK-LABEL: define void @_ZThn8_N5Test11C1fEv(
+// CHECK-DBG-NOT: dbg.declare
+// CHECK: ret void
+//
+// WIN64-LABEL: define dso_local void @"?f@C@Test1@@UEAAXXZ"(
+// WIN64-LABEL: define linkonce_odr dso_local void @"?f@C@Test1@@W7EAAXXZ"(
+// WIN64: getelementptr i8, i8* {{.*}}, i32 -8
+// WIN64: ret void
void C::f() { }
}
@@ -38,8 +60,14 @@
};
// CHECK-LABEL: define void @_ZTv0_n24_N5Test21B1fEv(
+// CHECK-DBG-NOT: dbg.declare
+// CHECK: ret void
void B::f() { }
+// No thunk is used for this case in the MS ABI.
+// WIN64-LABEL: define dso_local void @"?f@B@Test2@@UEAAXXZ"(
+// WIN64-NOT: define {{.*}} void @"?f@B@Test2
+
}
namespace Test3 {
@@ -60,6 +88,7 @@
};
// CHECK: define %{{.*}}* @_ZTch0_v0_n24_N5Test31B1fEv(
+// WIN64: define weak_odr dso_local %{{.*}} @"?f@B@Test3@@QEAAPEAUV1@2@XZ"(
V2 *B::f() { return 0; }
}
@@ -83,8 +112,14 @@
};
// CHECK-LABEL: define protected void @_ZThn8_N5Test41C1fEv(
+// CHECK-DBG-NOT: dbg.declare
+// CHECK: ret void
void C::f() { }
+// Visibility doesn't matter on COFF, but whatever. We could add an ELF test
+// mode later.
+// WIN64-LABEL: define protected void @"?f@C@Test4@@UEAAXXZ"(
+// WIN64-LABEL: define linkonce_odr protected void @"?f@C@Test4@@W7EAAXXZ"(
}
// Check that the thunk gets internal linkage.
@@ -112,6 +147,8 @@
c.f();
}
}
+// Not sure why this isn't delayed like in Itanium.
+// WIN64-LABEL: define internal void @"?f@C@?A{{.*}}@Test4B@@UEAAXXZ"(
namespace Test5 {
@@ -127,6 +164,7 @@
void f(B b) {
b.f();
}
+// No thunk in MS ABI in this case.
}
namespace Test6 {
@@ -166,10 +204,15 @@
};
// CHECK-LABEL: define void @_ZThn16_N5Test66Thunks1fEv
+ // CHECK-DBG-NOT: dbg.declare
// CHECK-NOT: memcpy
// CHECK: {{call void @_ZN5Test66Thunks1fEv.*sret}}
// CHECK: ret void
X Thunks::f() { return X(); }
+
+ // WIN64-LABEL: define linkonce_odr dso_local void @"?f@Thunks@Test6@@WBA@EAA?AUX@2@XZ"({{.*}} sret %{{.*}})
+ // WIN64-NOT: memcpy
+ // WIN64: tail call void @"?f@Thunks@Test6@@UEAA?AUX@2@XZ"({{.*}} sret %{{.*}})
}
namespace Test7 {
@@ -212,9 +255,12 @@
void D::baz(X, X&, _Complex float, Small, Small&, Large) { }
// CHECK-LABEL: define void @_ZThn8_N5Test71D3bazENS_1XERS1_CfNS_5SmallERS4_NS_5LargeE(
+ // CHECK-DBG-NOT: dbg.declare
// CHECK-NOT: memcpy
// CHECK: ret void
void testD() { D d; }
+
+ // MS C++ ABI doesn't use a thunk, so this case isn't interesting.
}
namespace Test8 {
@@ -227,10 +273,13 @@
void C::helper(NonPOD var) {}
// CHECK-LABEL: define void @_ZThn8_N5Test81C3barENS_6NonPODE(
+ // CHECK-DBG-NOT: dbg.declare
// CHECK-NOT: load [[NONPODTYPE]], [[NONPODTYPE]]*
// CHECK-NOT: memcpy
// CHECK: ret void
void C::bar(NonPOD var) {}
+
+ // MS C++ ABI doesn't use a thunk, so this case isn't interesting.
}
// PR7241: Emitting thunks for a method shouldn't require the vtable for
@@ -269,10 +318,24 @@
// The this-adjustment and return-adjustment thunk required when
// C::f appears in a vtable where A is at a nonzero offset from C.
// CHECK: define {{.*}} @_ZTcv0_n24_v0_n32_N6Test111C1fEv(
+ // CHECK-DBG-NOT: dbg.declare
+ // CHECK: ret
// The return-adjustment thunk required when C::f appears in a vtable
// where A is at a zero offset from C.
// CHECK: define {{.*}} @_ZTch0_v0_n32_N6Test111C1fEv(
+ // CHECK-DBG-NOT: dbg.declare
+ // CHECK: ret
+
+ // WIN64-LABEL: define dso_local %{{.*}}* @"?f@C@Test11@@UEAAPEAU12@XZ"(i8*
+
+ // WIN64-LABEL: define weak_odr dso_local %{{.*}}* @"?f@C@Test11@@QEAAPEAUA@2@XZ"(i8*
+ // WIN64: call %{{.*}}* @"?f@C@Test11@@UEAAPEAU12@XZ"(i8* %{{.*}})
+ //
+ // Match the vbtable return adjustment.
+ // WIN64: load i32*, i32** %{{[^,]*}}, align 8
+ // WIN64: getelementptr inbounds i32, i32* %{{[^,]*}}, i32 1
+ // WIN64: load i32, i32* %{{[^,]*}}, align 4
}
// Varargs thunk test.
@@ -287,7 +350,8 @@
virtual void c();
virtual C* f(int x, ...);
};
- C* C::f(int x, ...) { return this; }
+ C* makeC();
+ C* C::f(int x, ...) { return makeC(); }
// C::f
// CHECK: define {{.*}} @_ZN6Test121C1fEiz
@@ -295,8 +359,31 @@
// Varargs thunk; check that both the this and covariant adjustments
// are generated.
// CHECK: define {{.*}} @_ZTchn8_h8_N6Test121C1fEiz
+ // CHECK-DBG-NOT: dbg.declare
// CHECK: getelementptr inbounds i8, i8* {{.*}}, i64 -8
// CHECK: getelementptr inbounds i8, i8* {{.*}}, i64 8
+
+ // The vtable layout goes:
+ // C vtable in A:
+ // - f impl, no adjustment
+ // C vtable in B:
+ // - f thunk 2, covariant, clone
+ // - f thunk 2, musttail this adjust to impl
+ // FIXME: The weak_odr linkage is probably not necessary and just an artifact
+ // of Itanium ABI details.
+ // WIN64-LABEL: define dso_local {{.*}} @"?f@C@Test12@@UEAAPEAU12@HZZ"(
+ // WIN64: call %{{.*}}* @"?makeC@Test12@@YAPEAUC@1@XZ"()
+ //
+ // This thunk needs return adjustment, clone.
+ // WIN64-LABEL: define weak_odr dso_local {{.*}} @"?f@C@Test12@@W7EAAPEAUB@2@HZZ"(
+ // WIN64: call %{{.*}}* @"?makeC@Test12@@YAPEAUC@1@XZ"()
+ // WIN64: getelementptr inbounds i8, i8* %{{.*}}, i32 8
+ //
+ // Musttail call back to the A implementation after this adjustment from B to A.
+ // WIN64-LABEL: define linkonce_odr dso_local %{{.*}}* @"?f@C@Test12@@W7EAAPEAU12@HZZ"(
+ // WIN64: getelementptr i8, i8* %{{[^,]*}}, i32 -8
+ // WIN64: musttail call {{.*}} @"?f@C@Test12@@UEAAPEAU12@HZZ"(
+ C c;
}
// PR13832
@@ -318,11 +405,23 @@
return *this;
}
// CHECK: define {{.*}} @_ZTcvn8_n32_v8_n24_N6Test131D4foo1Ev
+ // CHECK-DBG-NOT: dbg.declare
// CHECK: getelementptr inbounds i8, i8* {{.*}}, i64 -8
// CHECK: getelementptr inbounds i8, i8* {{.*}}, i64 -32
// CHECK: getelementptr inbounds i8, i8* {{.*}}, i64 -24
// CHECK: getelementptr inbounds i8, i8* {{.*}}, i64 8
// CHECK: ret %"struct.Test13::D"*
+
+ // WIN64-LABEL: define weak_odr dso_local dereferenceable(32) %"struct.Test13::D"* @"?foo1@D@Test13@@$4PPPPPPPE@A@EAAAEAUB1@2@XZ"(
+ // This adjustment.
+ // WIN64: getelementptr inbounds i8, i8* {{.*}}, i64 -12
+ // Call implementation.
+ // WIN64: call {{.*}} @"?foo1@D@Test13@@UEAAAEAU12@XZ"(i8* {{.*}})
+ // Virtual + nonvirtual return adjustment.
+ // WIN64: load i32*, i32** %{{[^,]*}}, align 8
+ // WIN64: getelementptr inbounds i32, i32* %{{[^,]*}}, i32 1
+ // WIN64: load i32, i32* %{{[^,]*}}, align 4
+ // WIN64: getelementptr inbounds i8, i8* %{{[^,]*}}, i32 %{{[^,]*}}
}
namespace Test14 {
@@ -338,6 +437,8 @@
void C::f() {
}
// CHECK: define void @_ZThn8_N6Test141C1fEv({{.*}}) unnamed_addr [[NUW:#[0-9]+]]
+ // CHECK-DBG-NOT: dbg.declare
+ // CHECK: ret void
}
// Varargs non-covariant thunk test.
@@ -356,9 +457,16 @@
void C::c() {}
// C::c
- // CHECK: declare void @_ZN6Test151C1fEiz
+ // CHECK-CLONE: declare void @_ZN6Test151C1fEiz
// non-virtual thunk to C::f
- // CHECK: declare void @_ZThn8_N6Test151C1fEiz
+ // CHECK-CLONE: declare void @_ZThn8_N6Test151C1fEiz
+
+ // If we have musttail, then we emit the thunk as available_externally.
+ // CHECK-TAIL: declare void @_ZN6Test151C1fEiz
+ // CHECK-TAIL: define available_externally void @_ZThn8_N6Test151C1fEiz({{.*}})
+ // CHECK-TAIL: musttail call void (%"struct.Test15::C"*, i32, ...) @_ZN6Test151C1fEiz({{.*}}, ...)
+
+ // MS C++ ABI doesn't use a thunk, so this case isn't interesting.
}
namespace Test16 {
@@ -376,6 +484,35 @@
};
D::~D() {}
// CHECK: define linkonce_odr void @_ZThn8_N6Test161C3fooEv({{.*}}) {{.*}} comdat
+// CHECK-DBG-NOT: dbg.declare
+// CHECK: ret void
+}
+
+namespace Test17 {
+class A {
+ virtual void f(const char *, ...);
+};
+class B {
+ virtual void f(const char *, ...);
+};
+class C : A, B {
+ virtual void anchor();
+ void f(const char *, ...) override;
+};
+// Key method and object anchor vtable for Itanium and MSVC.
+void C::anchor() {}
+C c;
+
+// CHECK-CLONE-LABEL: declare void @_ZThn8_N6Test171C1fEPKcz(
+
+// CHECK-TAIL-LABEL: define available_externally void @_ZThn8_N6Test171C1fEPKcz(
+// CHECK-TAIL: getelementptr inbounds i8, i8* %{{.*}}, i64 -8
+// CHECK-TAIL: musttail call {{.*}} @_ZN6Test171C1fEPKcz({{.*}}, ...)
+
+// MSVC-LABEL: define linkonce_odr dso_local void @"?f@C@Test17@@G7EAAXPEBDZZ"
+// MSVC-SAME: (%"class.Test17::C"* %this, i8* %[[ARG:[^,]+]], ...)
+// MSVC: getelementptr i8, i8* %{{.*}}, i32 -8
+// MSVC: musttail call void (%"class.Test17::C"*, i8*, ...) @"?f@C@Test17@@EEAAXPEBDZZ"(%"class.Test17::C"* %{{.*}}, i8* %[[ARG]], ...)
}
/**** The following has to go at the end of the file ****/
@@ -401,5 +538,9 @@
// CHECK-OPT-LABEL: define linkonce_odr void @_ZN6Test101C3fooEv
// CHECK-OPT-LABEL: define linkonce_odr void @_ZThn8_N6Test101C3fooEv
+// This is from Test10:
+// WIN64-LABEL: define linkonce_odr dso_local void @"?foo@C@Test10@@UEAAXXZ"(
+// WIN64-LABEL: define linkonce_odr dso_local void @"?foo@C@Test10@@W7EAAXXZ"(
+
// CHECK-NONOPT: attributes [[NUW]] = { noinline nounwind optnone uwtable{{.*}} }
// CHECK-OPT: attributes [[NUW]] = { nounwind uwtable{{.*}} }
diff --git a/src/llvm-project/clang/test/CodeGenCXX/tls-init-funcs.cpp b/src/llvm-project/clang/test/CodeGenCXX/tls-init-funcs.cpp
index a2a563b..e7e6540 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/tls-init-funcs.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/tls-init-funcs.cpp
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.8 -std=c++1y -S -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-windows-gnu -std=c++1y -S -emit-llvm %s -o - | FileCheck %s --check-prefix=MINGW
// CHECK: @a = internal thread_local global
// CHECK: @_Z2vtIiE = linkonce_odr thread_local global i32 5
@@ -6,9 +7,12 @@
// CHECK: @_tlv_atexit({{.*}}@_ZN1AD1Ev
// CHECK: call cxx_fast_tlscc i32* @_ZTW3ext()
// CHECK: declare cxx_fast_tlscc i32* @_ZTW3ext()
-// CHECK: define weak_odr hidden cxx_fast_tlscc i32* @_ZTW2vtIiE()
-// CHECK: define weak_odr hidden cxx_fast_tlscc i32* @_ZTW2vtIvE()
-// CHECK: define {{.*}} @_ZTW1a
+// CHECK-DAG: define weak_odr hidden cxx_fast_tlscc i32* @_ZTW2vtIiE()
+// CHECK-DAG: define weak_odr hidden cxx_fast_tlscc i32* @_ZTW2vtIvE()
+// CHECK-DAG: define {{.*}} @_ZTW1a
+
+// MINGW-DAG: define weak_odr hidden i32* @_ZTW2vtIiE() {{.*}} comdat
+// MINGW-DAG: define weak_odr hidden i32* @_ZTW2vtIvE() {{.*}} comdat
struct A {
~A();
diff --git a/src/llvm-project/clang/test/CodeGenCXX/ubsan-coroutines.cpp b/src/llvm-project/clang/test/CodeGenCXX/ubsan-coroutines.cpp
new file mode 100644
index 0000000..8728c15
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCXX/ubsan-coroutines.cpp
@@ -0,0 +1,51 @@
+// This test merely verifies that emitting the object file does not cause a
+// crash when the LLVM coroutines passes are run.
+// PR42867: Disable this test for the new PM since the passes that lower the
+// llvm.coro.* intrinsics have not yet been ported.
+// RUN: %clang_cc1 -fno-experimental-new-pass-manager -emit-obj -std=c++2a -fsanitize=null %s -o %t.o
+
+namespace std::experimental {
+template <typename R, typename... T> struct coroutine_traits {
+ using promise_type = typename R::promise_type;
+};
+
+template <class Promise = void> struct coroutine_handle;
+template <> struct coroutine_handle<void> {
+ static coroutine_handle from_address(void *) noexcept;
+ coroutine_handle() = default;
+ template <class PromiseType>
+ coroutine_handle(coroutine_handle<PromiseType>) noexcept;
+};
+template <class Promise> struct coroutine_handle : coroutine_handle<void> {
+ coroutine_handle() = default;
+ static coroutine_handle from_address(void *) noexcept;
+};
+}
+
+struct suspend_always {
+ bool await_ready() noexcept;
+ void await_suspend(std::experimental::coroutine_handle<>) noexcept;
+ void await_resume() noexcept;
+};
+
+struct task {
+ struct promise_type {
+ task get_return_object() { return task(); }
+ suspend_always initial_suspend() { return {}; }
+ suspend_always final_suspend() { return {}; }
+ void return_void() {}
+ void unhandled_exception() {}
+ };
+};
+
+struct awaitable {
+ task await() { (void)co_await *this; }
+ bool await_ready() { return false; }
+ bool await_suspend(std::experimental::coroutine_handle<> awaiter) { return false; }
+ bool await_resume() { return false; }
+};
+
+int main() {
+ awaitable a;
+ a.await();
+}
diff --git a/src/llvm-project/clang/test/CodeGenCXX/union-tbaa2.cpp b/src/llvm-project/clang/test/CodeGenCXX/union-tbaa2.cpp
index d3e3740..5d13ff1 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/union-tbaa2.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/union-tbaa2.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -O2 -std=c++11 -triple x86_64-unknown-linux-gnu -target-cpu x86-64 -target-feature +sse4.2 -target-feature +avx -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 %s -O2 -fno-experimental-new-pass-manager -std=c++11 -triple x86_64-unknown-linux-gnu -target-cpu x86-64 -target-feature +sse4.2 -target-feature +avx -emit-llvm -o - | FileCheck %s
// Testcase from llvm.org/PR32056
diff --git a/src/llvm-project/clang/test/CodeGenCXX/vcall-visibility-metadata.cpp b/src/llvm-project/clang/test/CodeGenCXX/vcall-visibility-metadata.cpp
new file mode 100644
index 0000000..7cf4839
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCXX/vcall-visibility-metadata.cpp
@@ -0,0 +1,88 @@
+// RUN: %clang_cc1 -flto -flto-unit -triple x86_64-unknown-linux -emit-llvm -fvirtual-function-elimination -fwhole-program-vtables -o - %s | FileCheck %s
+
+
+// Anonymous namespace.
+namespace {
+// CHECK: @_ZTVN12_GLOBAL__N_11AE = {{.*}} !vcall_visibility [[VIS_TU:![0-9]+]]
+struct A {
+ A() {}
+ virtual int f() { return 1; }
+};
+}
+void *construct_A() {
+ return new A();
+}
+
+
+// Hidden visibility.
+// CHECK: @_ZTV1B = {{.*}} !vcall_visibility [[VIS_DSO:![0-9]+]]
+struct __attribute__((visibility("hidden"))) B {
+ B() {}
+ virtual int f() { return 1; }
+};
+B *construct_B() {
+ return new B();
+}
+
+
+// Default visibility.
+// CHECK-NOT: @_ZTV1C = {{.*}} !vcall_visibility
+struct __attribute__((visibility("default"))) C {
+ C() {}
+ virtual int f() { return 1; }
+};
+C *construct_C() {
+ return new C();
+}
+
+
+// Hidden visibility, public LTO visibility.
+// CHECK-NOT: @_ZTV1D = {{.*}} !vcall_visibility
+struct __attribute__((visibility("hidden"))) [[clang::lto_visibility_public]] D {
+ D() {}
+ virtual int f() { return 1; }
+};
+D *construct_D() {
+ return new D();
+}
+
+
+// Hidden visibility, but inherits from class with default visibility.
+// CHECK-NOT: @_ZTV1E = {{.*}} !vcall_visibility
+struct __attribute__((visibility("hidden"))) E : C {
+ E() {}
+ virtual int f() { return 1; }
+};
+E *construct_E() {
+ return new E();
+}
+
+
+// Anonymous namespace, but inherits from class with default visibility.
+// CHECK-NOT: @_ZTVN12_GLOBAL__N_11FE = {{.*}} !vcall_visibility
+namespace {
+struct __attribute__((visibility("hidden"))) F : C {
+ F() {}
+ virtual int f() { return 1; }
+};
+}
+void *construct_F() {
+ return new F();
+}
+
+
+// Anonymous namespace, but inherits from class with hidden visibility.
+// CHECK: @_ZTVN12_GLOBAL__N_11GE = {{.*}} !vcall_visibility [[VIS_DSO:![0-9]+]]
+namespace {
+struct __attribute__((visibility("hidden"))) G : B {
+ G() {}
+ virtual int f() { return 1; }
+};
+}
+void *construct_G() {
+ return new G();
+}
+
+
+// CHECK-DAG: [[VIS_DSO]] = !{i64 1}
+// CHECK-DAG: [[VIS_TU]] = !{i64 2}
diff --git a/src/llvm-project/clang/test/CodeGenCXX/vector-conditional.cpp b/src/llvm-project/clang/test/CodeGenCXX/vector-conditional.cpp
new file mode 100644
index 0000000..117f938
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCXX/vector-conditional.cpp
@@ -0,0 +1,231 @@
+// RUN: %clang_cc1 %s -triple x86_64-linux-gnu -Wno-unused -std=c++11 -emit-llvm -o - | FileCheck %s
+
+using FourShorts = short __attribute__((__vector_size__(8)));
+using TwoInts = int __attribute__((__vector_size__(8)));
+using TwoUInts = unsigned __attribute__((__vector_size__(8)));
+using FourInts = int __attribute__((__vector_size__(16)));
+using FourUInts = unsigned __attribute__((__vector_size__(16)));
+using TwoLongLong = long long __attribute__((__vector_size__(16)));
+using FourLongLong = long long __attribute__((__vector_size__(32)));
+using TwoFloats = float __attribute__((__vector_size__(8)));
+using FourFloats = float __attribute__((__vector_size__(16)));
+using TwoDoubles = double __attribute__((__vector_size__(16)));
+using FourDoubles = double __attribute__((__vector_size__(32)));
+
+FourShorts four_shorts;
+TwoInts two_ints;
+TwoUInts two_uints;
+FourInts four_ints;
+FourUInts four_uints;
+TwoLongLong two_ll;
+FourLongLong four_ll;
+TwoFloats two_floats;
+FourFloats four_floats;
+TwoDoubles two_doubles;
+FourDoubles four_doubles;
+
+short some_short;
+unsigned short some_ushort;
+int some_int;
+float some_float;
+unsigned int some_uint;
+long long some_ll;
+unsigned long long some_ull;
+double some_double;
+
+// CHECK: TwoVectorOps
+void TwoVectorOps() {
+ two_ints ? two_ints : two_ints;
+ // CHECK: %[[COND:.+]] = load <2 x i32>
+ // CHECK: %[[LHS:.+]] = load <2 x i32>
+ // CHECK: %[[RHS:.+]] = load <2 x i32>
+ // CHECK: %[[NEZERO:.+]] = icmp ne <2 x i32> %[[COND]], zeroinitializer
+ // CHECK: %[[SELECT:.+]] = select <2 x i1> %[[NEZERO]], <2 x i32> %[[LHS]], <2 x i32> %[[RHS]]
+
+ two_ints ? two_floats : two_floats;
+ // CHECK: %[[COND:.+]] = load <2 x i32>
+ // CHECK: %[[LHS:.+]] = load <2 x float>
+ // CHECK: %[[RHS:.+]] = load <2 x float>
+ // CHECK: %[[NEZERO:.+]] = icmp ne <2 x i32> %[[COND]], zeroinitializer
+ // CHECK: %[[SELECT:.+]] = select <2 x i1> %[[NEZERO]], <2 x float> %[[LHS]], <2 x float> %[[RHS]]
+
+ two_ll ? two_doubles : two_doubles;
+ // CHECK: %[[COND:.+]] = load <2 x i64>
+ // CHECK: %[[LHS:.+]] = load <2 x double>
+ // CHECK: %[[RHS:.+]] = load <2 x double>
+ // CHECK: %[[NEZERO:.+]] = icmp ne <2 x i64> %[[COND]], zeroinitializer
+ // CHECK: %[[SELECT:.+]] = select <2 x i1> %[[NEZERO]], <2 x double> %[[LHS]], <2 x double> %[[RHS]]
+}
+
+// CHECK: TwoScalarOps
+void TwoScalarOps() {
+ four_shorts ? some_short : some_short;
+ // CHECK: %[[COND:.+]] = load <4 x i16>
+ // CHECK: %[[LHS:.+]] = load i16
+ // CHECK: %[[LHS_SPLAT_INSERT:.+]] = insertelement <4 x i16> undef, i16 %[[LHS]], i32 0
+ // CHECK: %[[LHS_SPLAT:.+]] = shufflevector <4 x i16> %[[LHS_SPLAT_INSERT]], <4 x i16> undef, <4 x i32> zeroinitializer
+ // CHECK: %[[RHS:.+]] = load i16
+ // CHECK: %[[RHS_SPLAT_INSERT:.+]] = insertelement <4 x i16> undef, i16 %[[RHS]], i32 0
+ // CHECK: %[[RHS_SPLAT:.+]] = shufflevector <4 x i16> %[[RHS_SPLAT_INSERT]], <4 x i16> undef, <4 x i32> zeroinitializer
+ // CHECK: %[[NEZERO:.+]] = icmp ne <4 x i16> %[[COND]], zeroinitializer
+ // CHECK: %[[SELECT:.+]] = select <4 x i1> %[[NEZERO]], <4 x i16> %[[LHS_SPLAT]], <4 x i16> %[[RHS_SPLAT]]
+
+ four_shorts ? some_ushort : some_ushort;
+ // CHECK: %[[COND:.+]] = load <4 x i16>
+ // CHECK: %[[LHS:.+]] = load i16
+ // CHECK: %[[LHS_SPLAT_INSERT:.+]] = insertelement <4 x i16> undef, i16 %[[LHS]], i32 0
+ // CHECK: %[[LHS_SPLAT:.+]] = shufflevector <4 x i16> %[[LHS_SPLAT_INSERT]], <4 x i16> undef, <4 x i32> zeroinitializer
+ // CHECK: %[[RHS:.+]] = load i16
+ // CHECK: %[[RHS_SPLAT_INSERT:.+]] = insertelement <4 x i16> undef, i16 %[[RHS]], i32 0
+ // CHECK: %[[RHS_SPLAT:.+]] = shufflevector <4 x i16> %[[RHS_SPLAT_INSERT]], <4 x i16> undef, <4 x i32> zeroinitializer
+ // CHECK: %[[NEZERO:.+]] = icmp ne <4 x i16> %[[COND]], zeroinitializer
+ // CHECK: %[[SELECT:.+]] = select <4 x i1> %[[NEZERO]], <4 x i16> %[[LHS_SPLAT]], <4 x i16> %[[RHS_SPLAT]]
+
+ four_ints ? some_ushort : some_short;
+ // CHECK: %[[COND:.+]] = load <4 x i32>
+ // CHECK: %[[LHS:.+]] = load i16
+ // CHECK: %[[LHS_ZEXT:.+]] = zext i16 %[[LHS]] to i32
+ // CHECK: %[[LHS_SPLAT_INSERT:.+]] = insertelement <4 x i32> undef, i32 %[[LHS_ZEXT]], i32 0
+ // CHECK: %[[LHS_SPLAT:.+]] = shufflevector <4 x i32> %[[LHS_SPLAT_INSERT]], <4 x i32> undef, <4 x i32> zeroinitializer
+ // CHECK: %[[RHS:.+]] = load i16
+ // CHECK: %[[RHS_SEXT:.+]] = sext i16 %[[RHS]] to i32
+ // CHECK: %[[RHS_SPLAT_INSERT:.+]] = insertelement <4 x i32> undef, i32 %[[RHS_SEXT]], i32 0
+ // CHECK: %[[RHS_SPLAT:.+]] = shufflevector <4 x i32> %[[RHS_SPLAT_INSERT]], <4 x i32> undef, <4 x i32> zeroinitializer
+ // CHECK: %[[NEZERO:.+]] = icmp ne <4 x i32> %[[COND]], zeroinitializer
+ // CHECK: %[[SELECT:.+]] = select <4 x i1> %[[NEZERO]], <4 x i32> %[[LHS_SPLAT]], <4 x i32> %[[RHS_SPLAT]]
+
+ four_ints ? some_int : some_float;
+ // CHECK: %[[COND:.+]] = load <4 x i32>
+ // CHECK: %[[LHS:.+]] = load i32
+ // CHECK: %[[LHS_CONV:.+]] = sitofp i32 %[[LHS]] to float
+ // CHECK: %[[LHS_SPLAT_INSERT:.+]] = insertelement <4 x float> undef, float %[[LHS_CONV]], i32 0
+ // CHECK: %[[LHS_SPLAT:.+]] = shufflevector <4 x float> %[[LHS_SPLAT_INSERT]], <4 x float> undef, <4 x i32> zeroinitializer
+ // CHECK: %[[RHS:.+]] = load float
+ // CHECK: %[[RHS_SPLAT_INSERT:.+]] = insertelement <4 x float> undef, float %[[RHS]], i32 0
+ // CHECK: %[[RHS_SPLAT:.+]] = shufflevector <4 x float> %[[RHS_SPLAT_INSERT]], <4 x float> undef, <4 x i32> zeroinitializer
+ // CHECK: %[[NEZERO:.+]] = icmp ne <4 x i32> %[[COND]], zeroinitializer
+ // CHECK: %[[SELECT:.+]] = select <4 x i1> %[[NEZERO]], <4 x float> %[[LHS_SPLAT]], <4 x float> %[[RHS_SPLAT]]
+
+ four_ll ? some_double : some_ll;
+ // CHECK: %[[COND:.+]] = load <4 x i64>
+ // CHECK: %[[LHS:.+]] = load double
+ // CHECK: %[[LHS_SPLAT_INSERT:.+]] = insertelement <4 x double> undef, double %[[LHS]], i32 0
+ // CHECK: %[[LHS_SPLAT:.+]] = shufflevector <4 x double> %[[LHS_SPLAT_INSERT]], <4 x double> undef, <4 x i32> zeroinitializer
+ // CHECK: %[[RHS:.+]] = load i64
+ // CHECK: %[[RHS_CONV:.+]] = sitofp i64 %[[RHS]] to double
+ // CHECK: %[[RHS_SPLAT_INSERT:.+]] = insertelement <4 x double> undef, double %[[RHS_CONV]], i32 0
+ // CHECK: %[[RHS_SPLAT:.+]] = shufflevector <4 x double> %[[RHS_SPLAT_INSERT]], <4 x double> undef, <4 x i32> zeroinitializer
+ // CHECK: %[[NEZERO:.+]] = icmp ne <4 x i64> %[[COND]], zeroinitializer
+ // CHECK: %[[SELECT:.+]] = select <4 x i1> %[[NEZERO]], <4 x double> %[[LHS_SPLAT]], <4 x double> %[[RHS_SPLAT]]
+
+ four_ints ? some_int : some_short;
+ // CHECK: %[[COND:.+]] = load <4 x i32>
+ // CHECK: %[[LHS:.+]] = load i32
+ // CHECK: %[[LHS_SPLAT_INSERT:.+]] = insertelement <4 x i32> undef, i32 %[[LHS]], i32 0
+ // CHECK: %[[LHS_SPLAT:.+]] = shufflevector <4 x i32> %[[LHS_SPLAT_INSERT]], <4 x i32> undef, <4 x i32> zeroinitializer
+ // CHECK: %[[RHS:.+]] = load i16
+ // CHECK: %[[RHS_SEXT:.+]] = sext i16 %[[RHS]] to i32
+ // CHECK: %[[RHS_SPLAT_INSERT:.+]] = insertelement <4 x i32> undef, i32 %[[RHS_SEXT]], i32 0
+ // CHECK: %[[RHS_SPLAT:.+]] = shufflevector <4 x i32> %[[RHS_SPLAT_INSERT]], <4 x i32> undef, <4 x i32> zeroinitializer
+ // CHECK: %[[NEZERO:.+]] = icmp ne <4 x i32> %[[COND]], zeroinitializer
+ // CHECK: %[[SELECT:.+]] = select <4 x i1> %[[NEZERO]], <4 x i32> %[[LHS_SPLAT]], <4 x i32> %[[RHS_SPLAT]]
+}
+
+// CHECK: OneScalarOp
+void OneScalarOp() {
+ four_ints ? four_ints : some_int;
+ // CHECK: %[[COND:.+]] = load <4 x i32>
+ // CHECK: %[[LHS:.+]] = load <4 x i32>
+ // CHECK: %[[RHS:.+]] = load i32
+ // CHECK: %[[RHS_SPLAT_INSERT:.+]] = insertelement <4 x i32> undef, i32 %[[RHS]], i32 0
+ // CHECK: %[[RHS_SPLAT:.+]] = shufflevector <4 x i32> %[[RHS_SPLAT_INSERT]], <4 x i32> undef, <4 x i32> zeroinitializer
+ // CHECK: %[[NEZERO:.+]] = icmp ne <4 x i32> %[[COND]], zeroinitializer
+ // CHECK: %[[SELECT:.+]] = select <4 x i1> %[[NEZERO]], <4 x i32> %[[LHS]], <4 x i32> %[[RHS_SPLAT]]
+
+ four_ints ? four_ints : 5;
+ // CHECK: %[[COND:.+]] = load <4 x i32>
+ // CHECK: %[[LHS:.+]] = load <4 x i32>
+ // CHECK: %[[NEZERO:.+]] = icmp ne <4 x i32> %[[COND]], zeroinitializer
+ // CHECK: %[[SELECT:.+]] = select <4 x i1> %[[NEZERO]], <4 x i32> %[[LHS]], <4 x i32> <i32 5, i32 5, i32 5, i32 5>
+
+ four_ints ?: some_float;
+ // CHECK: %[[COND:.+]] = load <4 x i32>
+ // CHECK: %[[RHS:.+]] = load float
+ // CHECK: %[[RHS_CONV:.+]] = fptosi float %[[RHS]] to i32
+ // CHECK: %[[RHS_SPLAT_INSERT:.+]] = insertelement <4 x i32> undef, i32 %[[RHS_CONV]], i32 0
+ // CHECK: %[[RHS_SPLAT:.+]] = shufflevector <4 x i32> %[[RHS_SPLAT_INSERT]], <4 x i32> undef, <4 x i32> zeroinitializer
+ // CHECK: %[[NEZERO:.+]] = icmp ne <4 x i32> %[[COND]], zeroinitializer
+ // CHECK: %[[SELECT:.+]] = select <4 x i1> %[[NEZERO]], <4 x i32> %[[COND]], <4 x i32> %[[RHS_SPLAT]]
+
+ four_ints ? four_ints : 5.0f;
+ // CHECK: %[[COND:.+]] = load <4 x i32>
+ // CHECK: %[[LHS:.+]] = load <4 x i32>
+ // CHECK: %[[NEZERO:.+]] = icmp ne <4 x i32> %[[COND]], zeroinitializer
+ // CHECK: %[[SELECT:.+]] = select <4 x i1> %[[NEZERO]], <4 x i32> %[[LHS]], <4 x i32> <i32 5, i32 5, i32 5, i32 5>
+
+ four_ints ? some_float : four_ints;
+ // CHECK: %[[COND:.+]] = load <4 x i32>
+ // CHECK: %[[LHS:.+]] = load float
+ // CHECK: %[[LHS_CONV:.+]] = fptosi float %[[LHS]] to i32
+ // CHECK: %[[LHS_SPLAT_INSERT:.+]] = insertelement <4 x i32> undef, i32 %[[LHS_CONV]], i32 0
+ // CHECK: %[[LHS_SPLAT:.+]] = shufflevector <4 x i32> %[[LHS_SPLAT_INSERT]], <4 x i32> undef, <4 x i32> zeroinitializer
+ // CHECK: %[[RHS:.+]] = load <4 x i32>
+ // CHECK: %[[NEZERO:.+]] = icmp ne <4 x i32> %[[COND]], zeroinitializer
+ // CHECK: %[[SELECT:.+]] = select <4 x i1> %[[NEZERO]], <4 x i32> %[[LHS_SPLAT]], <4 x i32> %[[RHS]]
+
+ four_ints ? four_floats : some_float;
+ // CHECK: %[[COND:.+]] = load <4 x i32>
+ // CHECK: %[[LHS:.+]] = load <4 x float>
+ // CHECK: %[[RHS:.+]] = load float
+ // CHECK: %[[RHS_SPLAT_INSERT:.+]] = insertelement <4 x float> undef, float %[[RHS]], i32 0
+ // CHECK: %[[RHS_SPLAT:.+]] = shufflevector <4 x float> %[[RHS_SPLAT_INSERT]], <4 x float> undef, <4 x i32> zeroinitializer
+ // CHECK: %[[NEZERO:.+]] = icmp ne <4 x i32> %[[COND]], zeroinitializer
+ // CHECK: %[[SELECT:.+]] = select <4 x i1> %[[NEZERO]], <4 x float> %[[LHS]], <4 x float> %[[RHS_SPLAT]]
+
+ four_ll ? four_doubles : 6.0;
+ // CHECK: %[[COND:.+]] = load <4 x i64>
+ // CHECK: %[[LHS:.+]] = load <4 x double>
+ // CHECK: %[[NEZERO:.+]] = icmp ne <4 x i64> %[[COND]], zeroinitializer
+ // CHECK: %[[SELECT:.+]] = select <4 x i1> %[[NEZERO]], <4 x double> %[[LHS]], <4 x double> <double 6.{{.+}}, double 6.{{.+}}, double 6.{{.+}}>
+
+ four_ll ? four_ll : 6.0;
+ // CHECK: %[[COND:.+]] = load <4 x i64>
+ // CHECK: %[[LHS:.+]] = load <4 x i64>
+ // CHECK: %[[NEZERO:.+]] = icmp ne <4 x i64> %[[COND]], zeroinitializer
+ // CHECK: %[[SELECT:.+]] = select <4 x i1> %[[NEZERO]], <4 x i64> %[[LHS]], <4 x i64> <i64 6, i64 6, i64 6, i64 6>
+
+ four_ll ? four_ll : 6;
+ // CHECK: %[[COND:.+]] = load <4 x i64>
+ // CHECK: %[[LHS:.+]] = load <4 x i64>
+ // CHECK: %[[NEZERO:.+]] = icmp ne <4 x i64> %[[COND]], zeroinitializer
+ // CHECK: %[[SELECT:.+]] = select <4 x i1> %[[NEZERO]], <4 x i64> %[[LHS]], <4 x i64> <i64 6, i64 6, i64 6, i64 6>
+
+ four_ll ? four_ll : some_int;
+ // CHECK: %[[COND:.+]] = load <4 x i64>
+ // CHECK: %[[LHS:.+]] = load <4 x i64>
+ // CHECK: %[[RHS:.+]] = load i32
+ // CHECK: %[[RHS_CONV:.+]] = sext i32 %[[RHS]] to i64
+ // CHECK: %[[RHS_SPLAT_INSERT:.+]] = insertelement <4 x i64> undef, i64 %[[RHS_CONV]], i32 0
+ // CHECK: %[[RHS_SPLAT:.+]] = shufflevector <4 x i64> %[[RHS_SPLAT_INSERT]], <4 x i64> undef, <4 x i32> zeroinitializer
+ // CHECK: %[[NEZERO:.+]] = icmp ne <4 x i64> %[[COND]], zeroinitializer
+ // CHECK: %[[SELECT:.+]] = select <4 x i1> %[[NEZERO]], <4 x i64> %[[LHS]], <4 x i64> %[[RHS_SPLAT]]
+
+ four_ll ? four_ll : some_ll;
+ // CHECK: %[[COND:.+]] = load <4 x i64>
+ // CHECK: %[[LHS:.+]] = load <4 x i64>
+ // CHECK: %[[RHS:.+]] = load i64
+ // CHECK: %[[RHS_SPLAT_INSERT:.+]] = insertelement <4 x i64> undef, i64 %[[RHS]], i32 0
+ // CHECK: %[[RHS_SPLAT:.+]] = shufflevector <4 x i64> %[[RHS_SPLAT_INSERT]], <4 x i64> undef, <4 x i32> zeroinitializer
+ // CHECK: %[[NEZERO:.+]] = icmp ne <4 x i64> %[[COND]], zeroinitializer
+ // CHECK: %[[SELECT:.+]] = select <4 x i1> %[[NEZERO]], <4 x i64> %[[LHS]], <4 x i64> %[[RHS_SPLAT]]
+
+ four_ll ? four_ll : some_double;
+ // CHECK: %[[COND:.+]] = load <4 x i64>
+ // CHECK: %[[LHS:.+]] = load <4 x i64>
+ // CHECK: %[[RHS:.+]] = load double
+ // CHECK: %[[RHS_CONV:.+]] = fptosi double %[[RHS]] to i64
+ // CHECK: %[[RHS_SPLAT_INSERT:.+]] = insertelement <4 x i64> undef, i64 %[[RHS_CONV]], i32 0
+ // CHECK: %[[RHS_SPLAT:.+]] = shufflevector <4 x i64> %[[RHS_SPLAT_INSERT]], <4 x i64> undef, <4 x i32> zeroinitializer
+ // CHECK: %[[NEZERO:.+]] = icmp ne <4 x i64> %[[COND]], zeroinitializer
+ // CHECK: %[[SELECT:.+]] = select <4 x i1> %[[NEZERO]], <4 x i64> %[[LHS]], <4 x i64> %[[RHS_SPLAT]]
+}
diff --git a/src/llvm-project/clang/test/CodeGenCXX/vector-splat-conversion.cpp b/src/llvm-project/clang/test/CodeGenCXX/vector-splat-conversion.cpp
index 805f9f5..618ad76 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/vector-splat-conversion.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/vector-splat-conversion.cpp
@@ -49,3 +49,14 @@
// CHECK: store <4 x i128> zeroinitializer
constexpr bigint4 cBigintsF = (bigint4)false;
}
+
+typedef __attribute__((vector_size(8))) int gcc_int_2;
+gcc_int_2 FloatToIntConversion(gcc_int_2 Int2, float f) {
+ return Int2 + f;
+ // CHECK: %[[LOAD_INT:.+]] = load <2 x i32>
+ // CHECK: %[[LOAD:.+]] = load float, float*
+ // CHECK: %[[CONV:.+]] = fptosi float %[[LOAD]] to i32
+ // CHECK: %[[INSERT:.+]] = insertelement <2 x i32> undef, i32 %[[CONV]], i32 0
+ // CHECK: %[[SPLAT:.+]] = shufflevector <2 x i32> %[[INSERT]], <2 x i32> undef, <2 x i32> zeroinitializer
+ // CHECK: add <2 x i32> %[[LOAD_INT]], %[[SPLAT]]
+}
diff --git a/src/llvm-project/clang/test/CodeGenCXX/virtual-bases.cpp b/src/llvm-project/clang/test/CodeGenCXX/virtual-bases.cpp
index 259b1c1..58f76e2 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/virtual-bases.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/virtual-bases.cpp
@@ -20,8 +20,8 @@
C(bool);
};
-// CHECK-LABEL: 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 %0) unnamed_addr
+// CHECK-LABEL: define void @_ZN1CC1Eb(%struct.C* %this, i1 zeroext %0) unnamed_addr
C::C(bool) { }
// PR6251
diff --git a/src/llvm-project/clang/test/CodeGenCXX/virtual-function-elimination.cpp b/src/llvm-project/clang/test/CodeGenCXX/virtual-function-elimination.cpp
new file mode 100644
index 0000000..a89e6eb
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCXX/virtual-function-elimination.cpp
@@ -0,0 +1,75 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-linux -flto -flto-unit -fvirtual-function-elimination -fwhole-program-vtables -emit-llvm -o - %s | FileCheck %s
+
+
+struct __attribute__((visibility("default"))) A {
+ virtual void foo();
+};
+
+void test_1(A *p) {
+ // A has default visibility, so no need for type.checked.load.
+// CHECK-LABEL: define void @_Z6test_1P1A
+// CHECK: [[FN_PTR_ADDR:%.+]] = getelementptr inbounds void (%struct.A*)*, void (%struct.A*)** {{%.+}}, i64 0
+// CHECK: [[FN_PTR:%.+]] = load void (%struct.A*)*, void (%struct.A*)** [[FN_PTR_ADDR]]
+// CHECK: call void [[FN_PTR]](
+ p->foo();
+}
+
+
+struct __attribute__((visibility("hidden"))) [[clang::lto_visibility_public]] B {
+ virtual void foo();
+};
+
+void test_2(B *p) {
+ // B has public LTO visibility, so no need for type.checked.load.
+// CHECK-LABEL: define void @_Z6test_2P1B
+// CHECK: [[FN_PTR_ADDR:%.+]] = getelementptr inbounds void (%struct.B*)*, void (%struct.B*)** {{%.+}}, i64 0
+// CHECK: [[FN_PTR:%.+]] = load void (%struct.B*)*, void (%struct.B*)** [[FN_PTR_ADDR]]
+// CHECK: call void [[FN_PTR]](
+ p->foo();
+}
+
+
+struct __attribute__((visibility("hidden"))) C {
+ virtual void foo();
+ virtual void bar();
+};
+
+void test_3(C *p) {
+ // C has hidden visibility, so we generate type.checked.load to allow VFE.
+// CHECK-LABEL: define void @_Z6test_3P1C
+// CHECK: [[LOAD:%.+]] = call { i8*, i1 } @llvm.type.checked.load(i8* {{%.+}}, i32 0, metadata !"_ZTS1C")
+// CHECK: [[FN_PTR_I8:%.+]] = extractvalue { i8*, i1 } [[LOAD]], 0
+// CHECK: [[FN_PTR:%.+]] = bitcast i8* [[FN_PTR_I8]] to void (%struct.C*)*
+// CHECK: call void [[FN_PTR]](
+ p->foo();
+}
+
+void test_4(C *p) {
+ // When using type.checked.load, we pass the vtable offset to the intrinsic,
+ // rather than adding it to the pointer with a GEP.
+// CHECK-LABEL: define void @_Z6test_4P1C
+// CHECK: [[LOAD:%.+]] = call { i8*, i1 } @llvm.type.checked.load(i8* {{%.+}}, i32 8, metadata !"_ZTS1C")
+// CHECK: [[FN_PTR_I8:%.+]] = extractvalue { i8*, i1 } [[LOAD]], 0
+// CHECK: [[FN_PTR:%.+]] = bitcast i8* [[FN_PTR_I8]] to void (%struct.C*)*
+// CHECK: call void [[FN_PTR]](
+ p->bar();
+}
+
+void test_5(C *p, void (C::*q)(void)) {
+ // We also use type.checked.load for the virtual side of member function
+ // pointer calls. We use a GEP to calculate the address to load from and pass
+ // 0 as the offset to the intrinsic, because we know that the load must be
+ // from exactly the point marked by one of the function-type metadatas (in
+ // this case "_ZTSM1CFvvE.virtual"). If we passed the offset from the member
+ // function pointer to the intrinsic, this information would be lost. No
+ // codegen changes on the non-virtual side.
+// CHECK-LABEL: define void @_Z6test_5P1CMS_FvvE(
+// CHECK: [[FN_PTR_ADDR:%.+]] = getelementptr i8, i8* %vtable, i64 {{%.+}}
+// CHECK: [[LOAD:%.+]] = call { i8*, i1 } @llvm.type.checked.load(i8* [[FN_PTR_ADDR]], i32 0, metadata !"_ZTSM1CFvvE.virtual")
+// CHECK: [[FN_PTR_I8:%.+]] = extractvalue { i8*, i1 } [[LOAD]], 0
+// CHECK: [[FN_PTR:%.+]] = bitcast i8* [[FN_PTR_I8]] to void (%struct.C*)*
+
+// CHECK: [[PHI:%.+]] = phi void (%struct.C*)* {{.*}}[ [[FN_PTR]], {{.*}} ]
+// CHECK: call void [[PHI]](
+ (p->*q)();
+}
diff --git a/src/llvm-project/clang/test/CodeGenCXX/wasm-args-returns.cpp b/src/llvm-project/clang/test/CodeGenCXX/wasm-args-returns.cpp
index 50ebdb9..c547eb8 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/wasm-args-returns.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/wasm-args-returns.cpp
@@ -19,8 +19,8 @@
// CHECK: define double @_Z7forward9one_field(double returned %{{.*}})
//
// CHECK: define void @_Z14test_one_fieldv()
-// CHECK: %[[call:.*]] = tail call double @_Z13def_one_fieldv()
-// CHECK: tail call void @_Z3use9one_field(double %[[call]])
+// CHECK: %[[call:.*]] = call double @_Z13def_one_fieldv()
+// CHECK: call void @_Z3use9one_field(double %[[call]])
// CHECK: ret void
//
// CHECK: declare void @_Z3use9one_field(double)
@@ -46,7 +46,7 @@
copy_ctor(copy_ctor const &);
};
test(copy_ctor);
-// CHECK: define void @_Z7forward9copy_ctor(%struct.copy_ctor* noalias sret %{{.*}}, %struct.copy_ctor* %{{.*}})
+// CHECK: define void @_Z7forward9copy_ctor(%struct.copy_ctor* noalias sret %{{.*}}, %struct.copy_ctor* nonnull %{{.*}})
//
// CHECK: declare %struct.copy_ctor* @_ZN9copy_ctorC1ERKS_(%struct.copy_ctor* returned, %struct.copy_ctor* dereferenceable(8))
//
@@ -64,7 +64,7 @@
aligned_copy_ctor(aligned_copy_ctor const &);
};
test(aligned_copy_ctor);
-// CHECK: define void @_Z7forward17aligned_copy_ctor(%struct.aligned_copy_ctor* noalias sret %{{.*}}, %struct.aligned_copy_ctor* %{{.*}})
+// CHECK: define void @_Z7forward17aligned_copy_ctor(%struct.aligned_copy_ctor* noalias sret %{{.*}}, %struct.aligned_copy_ctor* nonnull %{{.*}})
//
// CHECK: declare %struct.aligned_copy_ctor* @_ZN17aligned_copy_ctorC1ERKS_(%struct.aligned_copy_ctor* returned, %struct.aligned_copy_ctor* dereferenceable(16))
//
@@ -82,8 +82,8 @@
// CHECK: define void @_Z7forward5empty()
//
// CHECK: define void @_Z10test_emptyv()
-// CHECK: tail call void @_Z9def_emptyv()
-// CHECK: tail call void @_Z3use5empty()
+// CHECK: call void @_Z9def_emptyv()
+// CHECK: call void @_Z3use5empty()
// CHECK: ret void
//
// CHECK: declare void @_Z3use5empty()
@@ -96,8 +96,8 @@
// CHECK: define i32 @_Z7forward12one_bitfield(i32 returned %{{.*}})
//
// CHECK: define void @_Z17test_one_bitfieldv()
-// CHECK: %[[call:.*]] = tail call i32 @_Z16def_one_bitfieldv()
-// CHECK: tail call void @_Z3use12one_bitfield(i32 %[[call]])
+// CHECK: %[[call:.*]] = call i32 @_Z16def_one_bitfieldv()
+// CHECK: call void @_Z3use12one_bitfield(i32 %[[call]])
// CHECK: ret void
//
// CHECK: declare void @_Z3use12one_bitfield(i32)
diff --git a/src/llvm-project/clang/test/CodeGenCXX/wasm-eh.cpp b/src/llvm-project/clang/test/CodeGenCXX/wasm-eh.cpp
index fbbf4dd..2d56c6b 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/wasm-eh.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/wasm-eh.cpp
@@ -1,5 +1,7 @@
-// RUN: %clang_cc1 %s -triple wasm32-unknown-unknown -fms-extensions -fexceptions -fcxx-exceptions -target-feature +exception-handling -emit-llvm -o - -std=c++11 | FileCheck %s
-// RUN: %clang_cc1 %s -triple wasm64-unknown-unknown -fms-extensions -fexceptions -fcxx-exceptions -target-feature +exception-handling -emit-llvm -o - -std=c++11 | FileCheck %s
+// REQUIRES: webassembly-registered-target
+// RUN: %clang_cc1 %s -triple wasm32-unknown-unknown -fms-extensions -fexceptions -fcxx-exceptions -fwasm-exceptions -target-feature +exception-handling -emit-llvm -o - -std=c++11 | FileCheck %s
+// RUN: %clang_cc1 %s -triple wasm64-unknown-unknown -fms-extensions -fexceptions -fcxx-exceptions -fwasm-exceptions -target-feature +exception-handling -emit-llvm -o - -std=c++11 | FileCheck %s
+// RUN: %clang_cc1 %s -triple wasm32-unknown-unknown -fms-extensions -fexceptions -fcxx-exceptions -fwasm-exceptions -target-feature +exception-handling -S -o - -std=c++11 | FileCheck %s --check-prefix=ASSEMBLY
void may_throw();
void dont_throw() noexcept;
@@ -191,7 +193,7 @@
// CHECK-NEXT: call void @__clang_call_terminate(i8* %[[EXN]]) {{.*}} [ "funclet"(token %[[CLEANUPPAD1]]) ]
// CHECK-NEXT: unreachable
-// CHECK-LABEL: define {{.*}} void @__clang_call_terminate(i8*)
+// CHECK-LABEL: define {{.*}} void @__clang_call_terminate(i8* %0)
// CHECK-NEXT: call i8* @__cxa_begin_catch(i8* %{{.*}})
// CHECK-NEXT: call void @_ZSt9terminatev()
// CHECK-NEXT: unreachable
@@ -382,3 +384,11 @@
// CHECK: cleanupret from %[[CLEANUPPAD1]] unwind to caller
// CHECK: unreachable
+
+// Here we only check if the command enables wasm exception handling in the
+// backend so that exception handling instructions can be generated in .s file.
+
+// ASSEMBLY: try
+// ASSEMBLY: catch
+// ASSEMBLY: rethrow
+// ASSEMBLY: end_try
diff --git a/src/llvm-project/clang/test/CodeGenCXX/windows-on-arm-itanium-thread-local.cpp b/src/llvm-project/clang/test/CodeGenCXX/windows-on-arm-itanium-thread-local.cpp
new file mode 100644
index 0000000..ace6599
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCXX/windows-on-arm-itanium-thread-local.cpp
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -triple thumbv7--windows-itanium -fdeclspec -fms-compatibility -fms-compatibility-version=19.0 -emit-llvm -o - %s | FileCheck %s
+
+void *g();
+thread_local static void *c = g();
+void f(void *p) {
+ c = p;
+}
+
+// CHECK-LABEL: @_Z1fPv(i8* %p)
+// CHECK-NOT: call i8** @_ZTWL1c()
+// CHECK: call arm_aapcs_vfpcc i8** @_ZTWL1c()
+
diff --git a/src/llvm-project/clang/test/CodeGenCXX/x86_32-arguments.cpp b/src/llvm-project/clang/test/CodeGenCXX/x86_32-arguments.cpp
index 148a3a9..8301686 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/x86_32-arguments.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/x86_32-arguments.cpp
@@ -8,7 +8,7 @@
// CHECK-LABEL: define void @_Z1fv(%struct.S* noalias sret %
S f() { return S(); }
-// CHECK-LABEL: define void @_Z1f1S(%struct.S*)
+// CHECK-LABEL: define void @_Z1f1S(%struct.S* %0)
void f(S) { }
// Non-trivial dtors, should both be passed indirectly.
@@ -21,7 +21,7 @@
// CHECK-LABEL: define void @_Z1gv(%class.C* noalias sret %
C g() { return C(); }
-// CHECK-LABEL: define void @_Z1f1C(%class.C*)
+// CHECK-LABEL: define void @_Z1f1C(%class.C* %0)
void f(C) { }
@@ -89,7 +89,7 @@
s5 f5() { return s5(); }
// CHECK-LABEL: define i32 @_Z4f6_0M2s6i(i32 %a)
-// CHECK: define i64 @_Z4f6_1M2s6FivE({ i32, i32 }* byval({ i32, i32 }) align 4)
+// CHECK: define i64 @_Z4f6_1M2s6FivE({ i32, i32 }* byval({ i32, i32 }) align 4 %0)
// FIXME: It would be nice to avoid byval on the previous case.
struct s6 {};
typedef int s6::* s6_mdp;
diff --git a/src/llvm-project/clang/test/CodeGenCXX/x86_64-arguments.cpp b/src/llvm-project/clang/test/CodeGenCXX/x86_64-arguments.cpp
index 2ea2df3..e905907 100644
--- a/src/llvm-project/clang/test/CodeGenCXX/x86_64-arguments.cpp
+++ b/src/llvm-project/clang/test/CodeGenCXX/x86_64-arguments.cpp
@@ -139,7 +139,7 @@
// Check that the StringRef is passed byval instead of expanded
// (which would split it between registers and memory).
// rdar://problem/9686430
- // CHECK: define void @_ZN5test71xENS_1AES0_llNS_9StringRefE({{.*}} byval({{.*}}) align 8)
+ // CHECK: define void @_ZN5test71xENS_1AES0_llNS_9StringRefE({{.*}} byval({{.*}}) align 8 {{%.*}})
// And a couple extra related tests:
A y(A, long double, long, long, StringRef) { return A(); }
@@ -147,7 +147,7 @@
struct StringDouble {char * ptr; double d;};
A z(A, A, A, A, A, StringDouble) { return A(); }
A zz(A, A, A, A, StringDouble) { return A(); }
- // CHECK: define void @_ZN5test71zENS_1AES0_S0_S0_S0_NS_12StringDoubleE({{.*}} byval({{.*}}) align 8)
+ // CHECK: define void @_ZN5test71zENS_1AES0_S0_S0_S0_NS_12StringDoubleE({{.*}} byval({{.*}}) align 8 {{%.*}})
// CHECK: define void @_ZN5test72zzENS_1AES0_S0_S0_NS_12StringDoubleE({{.*}} i8*
}
@@ -173,25 +173,25 @@
struct T { void *data[2]; };
- // CHECK: define void @_ZN5test93fooEPNS_1SEPNS_1TE([[S:%.*]]*, [[T:%.*]]*)
+ // CHECK: define void @_ZN5test93fooEPNS_1SEPNS_1TE([[S:%.*]]* %0, [[T:%.*]]* %1)
void foo(S*, T*) {}
- // CHECK: define void @_ZN5test91aEiiiiNS_1TEPv([[S]]* noalias sret {{%.*}}, i32, i32, i32, i32, [[T]]* byval([[T]]) align 8, i8*)
+ // CHECK: define void @_ZN5test91aEiiiiNS_1TEPv([[S]]* noalias sret {{%.*}}, i32 %0, i32 %1, i32 %2, i32 %3, [[T]]* byval([[T]]) align 8 %4, i8* %5)
S a(int, int, int, int, T, void*) {
return S();
}
- // CHECK: define [[S]]* @_ZN5test91bEPNS_1SEiiiiNS_1TEPv([[S]]* {{%.*}}, i32, i32, i32, i32, [[T:%.*]]* byval([[T]]) align 8, i8*)
+ // CHECK: define [[S]]* @_ZN5test91bEPNS_1SEiiiiNS_1TEPv([[S]]* {{%.*}}, i32 %0, i32 %1, i32 %2, i32 %3, [[T:%.*]]* byval([[T]]) align 8 %4, i8* %5)
S* b(S* sret, int, int, int, int, T, void*) {
return sret;
}
- // CHECK: define void @_ZN5test91cEiiiNS_1TEPv([[S]]* noalias sret {{%.*}}, i32, i32, i32, i8* {{%.*}}, i8* {{%.*}}, i8*)
+ // CHECK: define void @_ZN5test91cEiiiNS_1TEPv([[S]]* noalias sret {{%.*}}, i32 %0, i32 %1, i32 %2, i8* {{%.*}}, i8* {{%.*}}, i8* %3)
S c(int, int, int, T, void*) {
return S();
}
- // CHECK: define [[S]]* @_ZN5test91dEPNS_1SEiiiNS_1TEPv([[S]]* {{%.*}}, i32, i32, i32, i8* {{%.*}}, i8* {{%.*}}, i8*)
+ // CHECK: define [[S]]* @_ZN5test91dEPNS_1SEiiiNS_1TEPv([[S]]* {{%.*}}, i32 %0, i32 %1, i32 %2, i8* {{%.*}}, i8* {{%.*}}, i8* %3)
S* d(S* sret, int, int, int, T, void*) {
return sret;
}
diff --git a/src/llvm-project/clang/test/CodeGenCoroutines/coro-await.cpp b/src/llvm-project/clang/test/CodeGenCoroutines/coro-await.cpp
index 41881d7..86bacc7 100644
--- a/src/llvm-project/clang/test/CodeGenCoroutines/coro-await.cpp
+++ b/src/llvm-project/clang/test/CodeGenCoroutines/coro-await.cpp
@@ -303,7 +303,7 @@
// Verifies that we don't crash when returning an lvalue from an await_resume()
// expression.
-// CHECK-LABEL: define void @_Z18AwaitReturnsLValued(double)
+// CHECK-LABEL: define void @_Z18AwaitReturnsLValued(double %0)
void AwaitReturnsLValue(double) {
AwaitResumeReturnsLValue a;
// CHECK: %[[AVAR:.+]] = alloca %struct.AwaitResumeReturnsLValue,
diff --git a/src/llvm-project/clang/test/CodeGenCoroutines/coro-gro-nrvo.cpp b/src/llvm-project/clang/test/CodeGenCoroutines/coro-gro-nrvo.cpp
index 48931cb..f4a7186 100644
--- a/src/llvm-project/clang/test/CodeGenCoroutines/coro-gro-nrvo.cpp
+++ b/src/llvm-project/clang/test/CodeGenCoroutines/coro-gro-nrvo.cpp
@@ -34,7 +34,7 @@
};
// Verify that the NRVO is applied to the Gro object.
-// CHECK-LABEL: define void @_Z1fi(%struct.coro* noalias sret %agg.result, i32)
+// CHECK-LABEL: define void @_Z1fi(%struct.coro* noalias sret %agg.result, i32 %0)
coro f(int) {
// CHECK: %call = call i8* @_Znwm(
// CHECK-NEXT: br label %[[CoroInit:.*]]
@@ -65,7 +65,7 @@
};
// Verify that the NRVO is applied to the Gro object.
-// CHECK-LABEL: define void @_Z1hi(%struct.coro_two* noalias sret %agg.result, i32)
+// CHECK-LABEL: define void @_Z1hi(%struct.coro_two* noalias sret %agg.result, i32 %0)
coro_two h(int) {
// CHECK: %call = call i8* @_ZnwmRKSt9nothrow_t
diff --git a/src/llvm-project/clang/test/CodeGenCoroutines/coro-params.cpp b/src/llvm-project/clang/test/CodeGenCoroutines/coro-params.cpp
index d15286a..6d76433 100644
--- a/src/llvm-project/clang/test/CodeGenCoroutines/coro-params.cpp
+++ b/src/llvm-project/clang/test/CodeGenCoroutines/coro-params.cpp
@@ -95,7 +95,7 @@
// CHECK-NEXT: call i8* @llvm.coro.free(
}
-// CHECK-LABEL: void @_Z16dependent_paramsI1A1BEvT_T0_S3_(%struct.A* %x, %struct.B*, %struct.B* %y)
+// CHECK-LABEL: void @_Z16dependent_paramsI1A1BEvT_T0_S3_(%struct.A* %x, %struct.B* %0, %struct.B* %y)
template <typename T, typename U>
void dependent_params(T x, U, U y) {
// CHECK: %[[x_copy:.+]] = alloca %struct.A
@@ -148,7 +148,7 @@
};
};
-// CHECK-LABEL: void @_Z38coroutine_matching_promise_constructor28promise_matching_constructorifd(i32, float, double)
+// CHECK-LABEL: void @_Z38coroutine_matching_promise_constructor28promise_matching_constructorifd(i32 %0, float %1, double %2)
void coroutine_matching_promise_constructor(promise_matching_constructor, int, float, double) {
// CHECK: %[[INT:.+]] = load i32, i32* %5, align 4
// CHECK: %[[FLOAT:.+]] = load float, float* %6, align 4
diff --git a/src/llvm-project/clang/test/CodeGenCoroutines/coro-retcon-unreachable.ll b/src/llvm-project/clang/test/CodeGenCoroutines/coro-retcon-unreachable.ll
new file mode 100644
index 0000000..27ee2fd
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenCoroutines/coro-retcon-unreachable.ll
@@ -0,0 +1,46 @@
+; RUN: opt < %s -coro-early -coro-split -S | FileCheck %s
+target datalayout = "E-p:64:64"
+
+%swift.type = type { i64 }
+%swift.opaque = type opaque
+%T4red215EmptyCollectionV = type opaque
+%TSi = type <{ i64 }>
+
+define hidden swiftcc { i8*, %swift.opaque* } @no_suspends(i8* %buffer, i64 %arg) #1 {
+ %id = call token @llvm.coro.id.retcon.once(i32 32, i32 8, i8* %buffer, i8* bitcast (void (i8*, i1)* @prototype to i8*), i8* bitcast (i8* (i64)* @malloc to i8*), i8* bitcast (void (i8*)* @free to i8*))
+ %begin = call i8* @llvm.coro.begin(token %id, i8* null)
+ call void @print(i64 %arg)
+ call void @llvm.trap()
+ unreachable
+
+bb1:
+ call void @print(i64 %arg)
+ call i1 @llvm.coro.end(i8* %begin, i1 false)
+ unreachable
+}
+; CHECK-LABEL: define hidden swiftcc { i8*, %swift.opaque* } @no_suspends(
+; CHECK: call token @llvm.coro.id.retcon.once
+; CHECK-NEXT: call void @print(i64 %arg)
+; CHECK-NEXT: call void @llvm.trap()
+; CHECK-NEXT: unreachable
+
+declare swiftcc void @prototype(i8* noalias dereferenceable(32), i1)
+declare void @print(i64)
+
+declare noalias i8* @malloc(i64) #5
+declare void @free(i8* nocapture) #5
+
+declare token @llvm.coro.id.retcon.once(i32, i32, i8*, i8*, i8*, i8*) #5
+declare i8* @llvm.coro.begin(token, i8* writeonly) #5
+declare token @llvm.coro.alloca.alloc.i64(i64, i32) #5
+declare i8* @llvm.coro.alloca.get(token) #5
+declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #6
+declare i1 @llvm.coro.suspend.retcon.i1(...) #5
+declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #6
+declare void @llvm.coro.alloca.free(token) #5
+declare i1 @llvm.coro.end(i8*, i1) #5
+
+declare void @llvm.trap()
+
+attributes #1 = { noreturn nounwind }
+attributes #5 = { nounwind }
diff --git a/src/llvm-project/clang/test/CodeGenObjC/aarch64-sve-types.m b/src/llvm-project/clang/test/CodeGenObjC/aarch64-sve-types.m
new file mode 100644
index 0000000..625c752
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenObjC/aarch64-sve-types.m
@@ -0,0 +1,32 @@
+// RUN: not %clang_cc1 -triple aarch64-none-linux-gnu %s -emit-llvm -o - \
+// RUN: 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple aarch64-none-linux-gnu %s -emit-llvm -o - \
+// RUN: -target-feature +sve 2>&1 | FileCheck %s
+
+// CHECK: error: cannot yet @encode type __SVInt8_t
+const char s8[] = @encode(__SVInt8_t);
+// CHECK: error: cannot yet @encode type __SVInt16_t
+const char s16[] = @encode(__SVInt16_t);
+// CHECK: error: cannot yet @encode type __SVInt32_t
+const char s32[] = @encode(__SVInt32_t);
+// CHECK: error: cannot yet @encode type __SVInt64_t
+const char s64[] = @encode(__SVInt64_t);
+
+// CHECK: error: cannot yet @encode type __SVUint8_t
+const char u8[] = @encode(__SVUint8_t);
+// CHECK: error: cannot yet @encode type __SVUint16_t
+const char u16[] = @encode(__SVUint16_t);
+// CHECK: error: cannot yet @encode type __SVUint32_t
+const char u32[] = @encode(__SVUint32_t);
+// CHECK: error: cannot yet @encode type __SVUint64_t
+const char u64[] = @encode(__SVUint64_t);
+
+// CHECK: error: cannot yet @encode type __SVFloat16_t
+const char f16[] = @encode(__SVFloat16_t);
+// CHECK: error: cannot yet @encode type __SVFloat32_t
+const char f32[] = @encode(__SVFloat32_t);
+// CHECK: error: cannot yet @encode type __SVFloat64_t
+const char f64[] = @encode(__SVFloat64_t);
+
+// CHECK: error: cannot yet @encode type __SVBool_t
+const char b8[] = @encode(__SVBool_t);
diff --git a/src/llvm-project/clang/test/CodeGenObjC/arc-blocks.m b/src/llvm-project/clang/test/CodeGenObjC/arc-blocks.m
index e64a7e4..85c22a1b 100644
--- a/src/llvm-project/clang/test/CodeGenObjC/arc-blocks.m
+++ b/src/llvm-project/clang/test/CodeGenObjC/arc-blocks.m
@@ -49,7 +49,7 @@
extern void test2_helper(id (^)(void));
test2_helper(^{ return x; });
-// CHECK: define linkonce_odr hidden void @__copy_helper_block_8_32s(i8*, i8*) unnamed_addr #{{[0-9]+}} {
+// CHECK: define linkonce_odr hidden void @__copy_helper_block_8_32s(i8* %0, i8* %1) unnamed_addr #{{[0-9]+}} {
// CHECK: [[T0:%.*]] = load i8*, i8**
// CHECK-NEXT: [[SRC:%.*]] = bitcast i8* [[T0]] to [[BLOCK_T]]*
// CHECK-NEXT: [[T0:%.*]] = load i8*, i8**
@@ -60,7 +60,7 @@
// CHECK-NEXT: ret void
-// CHECK: define linkonce_odr hidden void @__destroy_helper_block_8_32s(i8*) unnamed_addr #{{[0-9]+}} {
+// CHECK: define linkonce_odr hidden void @__destroy_helper_block_8_32s(i8* %0) unnamed_addr #{{[0-9]+}} {
// CHECK: [[T0:%.*]] = load i8*, i8**
// CHECK-NEXT: [[T1:%.*]] = bitcast i8* [[T0]] to [[BLOCK_T]]*
// CHECK-NEXT: [[T2:%.*]] = getelementptr inbounds [[BLOCK_T]], [[BLOCK_T]]* [[T1]], i32 0, i32 5
@@ -141,7 +141,7 @@
// CHECK-NEXT: call void @llvm.objc.release(i8* [[T0]])
// CHECK: ret void
- // CHECK-LABEL: define internal void @__Block_byref_object_copy_(i8*, i8*) #{{[0-9]+}} {
+ // CHECK-LABEL: define internal void @__Block_byref_object_copy_(i8* %0, i8* %1) #{{[0-9]+}} {
// CHECK: [[T0:%.*]] = getelementptr inbounds [[BYREF_T]], [[BYREF_T]]* {{%.*}}, i32 0, i32 6
// CHECK-NEXT: load i8*, i8**
// CHECK-NEXT: bitcast i8* {{%.*}} to [[BYREF_T]]*
@@ -150,7 +150,7 @@
// CHECK-NEXT: store i8* [[T2]], i8** [[T0]]
// CHECK-NEXT: store i8* null, i8** [[T1]]
- // CHECK-LABEL: define internal void @__Block_byref_object_dispose_(i8*) #{{[0-9]+}} {
+ // CHECK-LABEL: define internal void @__Block_byref_object_dispose_(i8* %0) #{{[0-9]+}} {
// CHECK: [[T0:%.*]] = getelementptr inbounds [[BYREF_T]], [[BYREF_T]]* {{%.*}}, i32 0, i32 6
// CHECK-NEXT: [[T1:%.*]] = load i8*, i8** [[T0]]
// CHECK-NEXT: call void @llvm.objc.release(i8* [[T1]])
@@ -162,10 +162,10 @@
// CHECK-NEXT: call void @llvm.objc.release(i8* [[T0]])
// CHECK-NEXT: ret void
- // CHECK-LABEL: define linkonce_odr hidden void @__copy_helper_block_8_32r(i8*, i8*) unnamed_addr #{{[0-9]+}} {
+ // CHECK-LABEL: define linkonce_odr hidden void @__copy_helper_block_8_32r(i8* %0, i8* %1) unnamed_addr #{{[0-9]+}} {
// CHECK: call void @_Block_object_assign(i8* {{%.*}}, i8* {{%.*}}, i32 8)
- // CHECK-LABEL: define linkonce_odr hidden void @__destroy_helper_block_8_32r(i8*) unnamed_addr #{{[0-9]+}} {
+ // CHECK-LABEL: define linkonce_odr hidden void @__destroy_helper_block_8_32r(i8* %0) unnamed_addr #{{[0-9]+}} {
// CHECK: call void @_Block_object_dispose(i8* {{%.*}}, i32 8)
}
@@ -230,14 +230,14 @@
// CHECK-NEXT: call void @llvm.lifetime.end.p0i8(i64 48, i8* [[VARPTR2]])
// CHECK-NEXT: ret void
- // CHECK-LABEL: define internal void @__Block_byref_object_copy_.{{[0-9]+}}(i8*, i8*) #{{[0-9]+}} {
+ // CHECK-LABEL: define internal void @__Block_byref_object_copy_.{{[0-9]+}}(i8* %0, i8* %1) #{{[0-9]+}} {
// CHECK: [[T0:%.*]] = getelementptr inbounds [[BYREF_T]], [[BYREF_T]]* {{%.*}}, i32 0, i32 6
// CHECK-NEXT: load i8*, i8**
// CHECK-NEXT: bitcast i8* {{%.*}} to [[BYREF_T]]*
// CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds [[BYREF_T]], [[BYREF_T]]* {{%.*}}, i32 0, i32 6
// CHECK-NEXT: call void @llvm.objc.moveWeak(i8** [[T0]], i8** [[T1]])
- // CHECK-LABEL: define internal void @__Block_byref_object_dispose_.{{[0-9]+}}(i8*) #{{[0-9]+}} {
+ // CHECK-LABEL: define internal void @__Block_byref_object_dispose_.{{[0-9]+}}(i8* %0) #{{[0-9]+}} {
// CHECK: [[T0:%.*]] = getelementptr inbounds [[BYREF_T]], [[BYREF_T]]* {{%.*}}, i32 0, i32 6
// CHECK-NEXT: call void @llvm.objc.destroyWeak(i8** [[T0]])
@@ -277,12 +277,12 @@
// CHECK-NEXT: call void @llvm.objc.release(i8* [[T0]])
// CHECK: ret void
- // CHECK-LABEL: define linkonce_odr hidden void @__copy_helper_block_8_32w(i8*, i8*) unnamed_addr #{{[0-9]+}} {
+ // CHECK-LABEL: define linkonce_odr hidden void @__copy_helper_block_8_32w(i8* %0, i8* %1) unnamed_addr #{{[0-9]+}} {
// CHECK: getelementptr
// CHECK-NEXT: getelementptr
// CHECK-NEXT: call void @llvm.objc.copyWeak(
- // CHECK-LABEL: define linkonce_odr hidden void @__destroy_helper_block_8_32w(i8*) unnamed_addr #{{[0-9]+}} {
+ // CHECK-LABEL: define linkonce_odr hidden void @__destroy_helper_block_8_32w(i8* %0) unnamed_addr #{{[0-9]+}} {
// CHECK: getelementptr
// CHECK-NEXT: call void @llvm.objc.destroyWeak(
}
@@ -369,7 +369,7 @@
// We can also use _Block_object_assign/destroy with
// BLOCK_FIELD_IS_BLOCK as long as we don't pass BLOCK_BYREF_CALLER.
-// CHECK-LABEL: define internal void @__Block_byref_object_copy_.{{[0-9]+}}(i8*, i8*) #{{[0-9]+}} {
+// CHECK-LABEL: define internal void @__Block_byref_object_copy_.{{[0-9]+}}(i8* %0, i8* %1) #{{[0-9]+}} {
// CHECK: [[D0:%.*]] = load i8*, i8** {{%.*}}
// CHECK-NEXT: [[D1:%.*]] = bitcast i8* [[D0]] to [[BYREF_T]]*
// CHECK-NEXT: [[D2:%.*]] = getelementptr inbounds [[BYREF_T]], [[BYREF_T]]* [[D1]], i32 0, i32 6
@@ -383,7 +383,7 @@
// CHECK-NEXT: store void ()* [[T3]], void ()** [[D2]], align 8
// CHECK: ret void
-// CHECK-LABEL: define internal void @__Block_byref_object_dispose_.{{[0-9]+}}(i8*) #{{[0-9]+}} {
+// CHECK-LABEL: define internal void @__Block_byref_object_dispose_.{{[0-9]+}}(i8* %0) #{{[0-9]+}} {
// CHECK: [[T0:%.*]] = load i8*, i8** {{%.*}}
// CHECK-NEXT: [[T1:%.*]] = bitcast i8* [[T0]] to [[BYREF_T]]*
// CHECK-NEXT: [[T2:%.*]] = getelementptr inbounds [[BYREF_T]], [[BYREF_T]]* [[T1]], i32 0, i32 6
@@ -730,5 +730,15 @@
test20_callee(^{ (void)x; });
}
+// CHECK-LABEL: define void @test21(
+// CHECK: %[[V6:.*]] = call i8* @llvm.objc.retainBlock(
+// CHECK: %[[V7:.*]] = bitcast i8* %[[V6]] to void ()*
+// CHECK: call void (i32, ...) @test21_callee(i32 1, void ()* %[[V7]]),
+
+void test21_callee(int n, ...);
+void test21(id x) {
+ test21_callee(1, ^{ (void)x; });
+}
+
// CHECK: attributes [[NUW]] = { nounwind }
// CHECK-UNOPT: attributes [[NUW]] = { nounwind }
diff --git a/src/llvm-project/clang/test/CodeGenObjC/debug-info-blocks.m b/src/llvm-project/clang/test/CodeGenObjC/debug-info-blocks.m
index b6e5b42..9204f8d 100644
--- a/src/llvm-project/clang/test/CodeGenObjC/debug-info-blocks.m
+++ b/src/llvm-project/clang/test/CodeGenObjC/debug-info-blocks.m
@@ -13,13 +13,13 @@
// Test that we do emit scope info for the helper functions, and that the
// parameters to these functions are marked as artificial (so the debugger
// doesn't accidentally step into the function).
-// CHECK: define {{.*}} @__copy_helper_block_{{.*}}(i8*, i8*)
+// CHECK: define {{.*}} @__copy_helper_block_{{.*}}(i8* %0, i8* %1)
// CHECK-NOT: ret
// CHECK: call {{.*}}, !dbg ![[DBG_LINE:[0-9]+]]
// CHECK-NOT: ret
// CHECK: load {{.*}}, !dbg ![[COPY_LINE:[0-9]+]]
// CHECK: ret void, !dbg ![[COPY_LINE]]
-// CHECK: define {{.*}} @__destroy_helper_block_{{.*}}(i8*)
+// CHECK: define {{.*}} @__destroy_helper_block_{{.*}}(i8* %0)
// CHECK-NOT: ret
// CHECK: load {{.*}}, !dbg ![[DESTROY_LINE:[0-9]+]]
// CHECK: ret void, !dbg ![[DESTROY_LINE]]
diff --git a/src/llvm-project/clang/test/CodeGenObjC/debug-info-direct-method.m b/src/llvm-project/clang/test/CodeGenObjC/debug-info-direct-method.m
new file mode 100644
index 0000000..e5e2939
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenObjC/debug-info-direct-method.m
@@ -0,0 +1,29 @@
+// RUN: %clang_cc1 -dwarf-version=5 -emit-llvm -debug-info-kind=limited -w -triple x86_64-apple-darwin10 %s -o - | FileCheck %s
+// RUN: %clang_cc1 -dwarf-version=4 -emit-llvm -debug-info-kind=limited -w -triple x86_64-apple-darwin10 %s -o - | FileCheck %s
+// RUN: %clang_cc1 -dwarf-version=5 -emit-llvm -debug-info-kind=limited -w -triple x86_64-apple-darwin10 %s -o - -DDISABLE_DIRECT | FileCheck --check-prefix=CHECK-DISABLED %s
+
+__attribute__((objc_root_class))
+@interface Root
+@end
+
+@implementation Root
+- (int)getInt
+#ifndef DISABLE_DIRECT
+ __attribute__((objc_direct))
+#endif
+{
+ return 42;
+}
+@end
+
+// Test that objc_direct methods are always (even in DWARF < 5) emitted
+// as members of their containing class.
+
+// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "Root",
+// CHECK-SAME: elements: ![[MEMBERS:[0-9]+]],
+// CHECK-SAME: runtimeLang: DW_LANG_ObjC)
+// CHECK: ![[MEMBERS]] = !{![[GETTER:[0-9]+]]}
+// CHECK: ![[GETTER]] = !DISubprogram(name: "-[Root getInt]",
+// CHECK-SAME: spFlags: DISPFlagObjCDirect
+
+// CHECK-DISABLED-NOT: DISPFlagObjCDirect
diff --git a/src/llvm-project/clang/test/CodeGenObjC/debug-info-objc-property-dwarf5.m b/src/llvm-project/clang/test/CodeGenObjC/debug-info-objc-property-dwarf5.m
new file mode 100644
index 0000000..2b3a86f
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenObjC/debug-info-objc-property-dwarf5.m
@@ -0,0 +1,29 @@
+// RUN: %clang_cc1 -emit-llvm -debug-info-kind=standalone -dwarf-version=5 %s -o - | FileCheck %s
+
+@protocol NSObject
+@end
+
+@interface NSObject <NSObject> {}
+@end
+
+struct Bar {};
+
+@protocol BarProto
+@property struct Bar *bar;
+@end
+
+@interface Foo <BarProto>
+@end
+
+@implementation Foo {}
+@synthesize bar = _bar;
+- (void)f {}
+@end
+
+// CHECK: ![[FOO:[0-9]+]] = !DICompositeType(tag: DW_TAG_structure_type, name: "Foo"
+
+// CHECK: ![[DECL:[0-9]+]] = !DISubprogram(name: "-[Foo setBar:]",
+// CHECK-SAME: scope: ![[FOO]]
+
+// CHECK: distinct !DISubprogram(name: "-[Foo setBar:]",
+// CHECK-SAME: declaration: ![[DECL:[0-9]+]]
diff --git a/src/llvm-project/clang/test/CodeGenObjC/debug-info-synthesis.m b/src/llvm-project/clang/test/CodeGenObjC/debug-info-synthesis.m
index f954256..7fbbc6d 100644
--- a/src/llvm-project/clang/test/CodeGenObjC/debug-info-synthesis.m
+++ b/src/llvm-project/clang/test/CodeGenObjC/debug-info-synthesis.m
@@ -30,8 +30,8 @@
}
}
-// CHECK: ![[FILE:.*]] = !DIFile(filename: "{{[^"]+}}foo.h"
+// CHECK: ![[FILE:.*]] = !DIFile(filename: "foo.m"
// CHECK: !DISubprogram(name: "-[Foo setDict:]"
// CHECK-SAME: file: ![[FILE]],
-// CHECK-SAME: line: 8,
+// CHECK-SAME: line: 7,
// CHECK-SAME: DISPFlagLocalToUnit | DISPFlagDefinition
diff --git a/src/llvm-project/clang/test/CodeGenObjC/debug-property-synth.m b/src/llvm-project/clang/test/CodeGenObjC/debug-property-synth.m
index 124c61e..ddcf4d9 100644
--- a/src/llvm-project/clang/test/CodeGenObjC/debug-property-synth.m
+++ b/src/llvm-project/clang/test/CodeGenObjC/debug-property-synth.m
@@ -7,6 +7,10 @@
@interface I {
int _p1;
}
+@property int p1;
+@end
+
+@implementation I
// Test that the linetable entries for the synthesized getter and
// setter are correct.
//
@@ -22,10 +26,6 @@
// CHECK: ![[DBG1]] = !DILocation(line: [[@LINE+3]],
// CHECK: !DISubprogram(name: "-[I setP1:]",{{.*}} line: [[@LINE+2]],{{.*}} DISPFlagLocalToUnit | DISPFlagDefinition
// CHECK: ![[DBG2]] = !DILocation(line: [[@LINE+1]],
-@property int p1;
-@end
-
-@implementation I
@synthesize p1 = _p1;
@end
diff --git a/src/llvm-project/clang/test/CodeGenObjC/debuginfo-properties.m b/src/llvm-project/clang/test/CodeGenObjC/debuginfo-properties.m
index c0de620..53f5e2d 100644
--- a/src/llvm-project/clang/test/CodeGenObjC/debuginfo-properties.m
+++ b/src/llvm-project/clang/test/CodeGenObjC/debuginfo-properties.m
@@ -11,19 +11,6 @@
@protocol HasASelection <NSObject>
@property (nonatomic, retain) Selection* selection;
-// CHECK: !DISubprogram(name: "-[MyClass selection]"
-// CHECK-SAME: line: [[@LINE-2]]
-// CHECK-SAME: DISPFlagLocalToUnit | DISPFlagDefinition
-// CHECK: !DISubprogram(name: "-[MyClass setSelection:]"
-// CHECK-SAME: line: [[@LINE-5]]
-// CHECK-SAME: DISPFlagLocalToUnit | DISPFlagDefinition
-// CHECK: !DISubprogram(name: "-[OtherClass selection]"
-// CHECK-SAME: line: [[@LINE-8]]
-// CHECK-SAME: DISPFlagLocalToUnit | DISPFlagDefinition
-// CHECK: !DISubprogram(name: "-[OtherClass setSelection:]"
-// CHECK-SAME: line: [[@LINE-11]]
-// CHECK-SAME: DISPFlagLocalToUnit | DISPFlagDefinition
-
@end
@interface MyClass : NSObject <HasASelection> {
@@ -33,6 +20,12 @@
@implementation MyClass
@synthesize selection = _selection;
+// CHECK: !DISubprogram(name: "-[MyClass selection]"
+// CHECK-SAME: line: [[@LINE-2]]
+// CHECK-SAME: DISPFlagLocalToUnit | DISPFlagDefinition
+// CHECK: !DISubprogram(name: "-[MyClass setSelection:]"
+// CHECK-SAME: line: [[@LINE-5]]
+// CHECK-SAME: DISPFlagLocalToUnit | DISPFlagDefinition
@end
@interface OtherClass : NSObject <HasASelection> {
@@ -41,4 +34,10 @@
@end
@implementation OtherClass
@synthesize selection = _selection;
+// CHECK: !DISubprogram(name: "-[OtherClass selection]"
+// CHECK-SAME: line: [[@LINE-2]]
+// CHECK-SAME: DISPFlagLocalToUnit | DISPFlagDefinition
+// CHECK: !DISubprogram(name: "-[OtherClass setSelection:]"
+// CHECK-SAME: line: [[@LINE-5]]
+// CHECK-SAME: DISPFlagLocalToUnit | DISPFlagDefinition
@end
diff --git a/src/llvm-project/clang/test/CodeGenObjC/direct-method.m b/src/llvm-project/clang/test/CodeGenObjC/direct-method.m
new file mode 100644
index 0000000..e53c99b
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenObjC/direct-method.m
@@ -0,0 +1,237 @@
+// RUN: %clang_cc1 -emit-llvm -fobjc-arc -triple x86_64-apple-darwin10 %s -o - | FileCheck %s
+
+struct my_complex_struct {
+ int a, b;
+};
+
+struct my_aggregate_struct {
+ int a, b;
+ char buf[128];
+};
+
+__attribute__((objc_root_class))
+@interface Root
+- (int)getInt __attribute__((objc_direct));
+@property(direct, readonly) int intProperty;
+@property(direct, readonly) int intProperty2;
+@end
+
+@implementation Root
+// CHECK-LABEL: define hidden i32 @"\01-[Root intProperty2]"
+- (int)intProperty2 {
+ return 42;
+}
+
+// CHECK-LABEL: define hidden i32 @"\01-[Root getInt]"(
+- (int)getInt __attribute__((objc_direct)) {
+ // loading parameters
+ // CHECK-LABEL: entry:
+ // CHECK-NEXT: [[RETVAL:%.*]] = alloca
+ // CHECK-NEXT: [[SELFADDR:%.*]] = alloca %0*,
+ // CHECK-NEXT: [[_CMDADDR:%.*]] = alloca i8*,
+ // CHECK-NEXT: store %0* %{{.*}}, %0** [[SELFADDR]],
+ // CHECK-NEXT: store i8* %{{.*}}, i8** [[_CMDADDR]],
+
+ // self nil-check
+ // CHECK-NEXT: [[SELF:%.*]] = load %0*, %0** [[SELFADDR]],
+ // CHECK-NEXT: [[NILCHECK:%.*]] = icmp eq %0* [[SELF]], null
+ // CHECK-NEXT: br i1 [[NILCHECK]],
+
+ // setting return value to nil
+ // CHECK-LABEL: objc_direct_method.self_is_nil:
+ // CHECK: [[RET0:%.*]] = bitcast{{.*}}[[RETVAL]]
+ // CHECK-NEXT: call void @llvm.memset{{[^(]*}}({{[^,]*}}[[RET0]], i8 0,
+ // CHECK-NEXT: br label
+
+ // set value
+ // CHECK-LABEL: objc_direct_method.cont:
+ // CHECK: store{{.*}}[[RETVAL]],
+ // CHECK-NEXT: br label
+
+ // return
+ // CHECK-LABEL: return:
+ // CHECK: {{%.*}} = load{{.*}}[[RETVAL]],
+ // CHECK-NEXT: ret
+ return 42;
+}
+
+// CHECK-LABEL: define hidden i32 @"\01+[Root classGetInt]"(
++ (int)classGetInt __attribute__((objc_direct)) {
+ // loading parameters
+ // CHECK-LABEL: entry:
+ // CHECK-NEXT: [[SELFADDR:%.*]] = alloca i8*,
+ // CHECK-NEXT: [[_CMDADDR:%.*]] = alloca i8*,
+ // CHECK-NEXT: store i8* %{{.*}}, i8** [[SELFADDR]],
+ // CHECK-NEXT: store i8* %{{.*}}, i8** [[_CMDADDR]],
+
+ // [self self]
+ // CHECK-NEXT: [[SELF:%.*]] = load i8*, i8** [[SELFADDR]],
+ // CHECK-NEXT: [[SELFSEL:%.*]] = load i8*, i8** @OBJC_SELECTOR_REFERENCES_
+ // CHECK-NEXT: [[SELF0:%.*]] = call {{.*}} @objc_msgSend
+ // CHECK-NEXT: store i8* [[SELF0]], i8** [[SELFADDR]],
+
+ // return
+ // CHECK-NEXT: ret
+ return 42;
+}
+
+// CHECK-LABEL: define hidden i64 @"\01-[Root getComplex]"(
+- (struct my_complex_struct)getComplex __attribute__((objc_direct)) {
+ // loading parameters
+ // CHECK-LABEL: entry:
+ // CHECK-NEXT: [[RETVAL:%.*]] = alloca
+ // CHECK-NEXT: [[SELFADDR:%.*]] = alloca %0*,
+ // CHECK-NEXT: [[_CMDADDR:%.*]] = alloca i8*,
+ // CHECK-NEXT: store %0* %{{.*}}, %0** [[SELFADDR]],
+ // CHECK-NEXT: store i8* %{{.*}}, i8** [[_CMDADDR]],
+
+ // self nil-check
+ // CHECK-NEXT: [[SELF:%.*]] = load %0*, %0** [[SELFADDR]],
+ // CHECK-NEXT: [[NILCHECK:%.*]] = icmp eq %0* [[SELF]], null
+ // CHECK-NEXT: br i1 [[NILCHECK]],
+
+ // setting return value to nil
+ // CHECK-LABEL: objc_direct_method.self_is_nil:
+ // CHECK: [[RET0:%.*]] = bitcast{{.*}}[[RETVAL]]
+ // CHECK-NEXT: call void @llvm.memset{{[^(]*}}({{[^,]*}}[[RET0]], i8 0,
+ // CHECK-NEXT: br label
+
+ // set value
+ // CHECK-LABEL: objc_direct_method.cont:
+ // CHECK: [[RET1:%.*]] = bitcast{{.*}}[[RETVAL]]
+ // CHECK-NEXT: call void @llvm.memcpy{{[^(]*}}({{[^,]*}}[[RET1]],
+ // CHECK-NEXT: br label
+
+ // return
+ // CHECK-LABEL: return:
+ // CHECK: [[RET2:%.*]] = bitcast{{.*}}[[RETVAL]]
+ // CHECK-NEXT: {{%.*}} = load{{.*}}[[RET2]],
+ // CHECK-NEXT: ret
+ struct my_complex_struct st = {.a = 42};
+ return st;
+}
+
+// CHECK-LABEL: define hidden i64 @"\01+[Root classGetComplex]"(
++ (struct my_complex_struct)classGetComplex __attribute__((objc_direct)) {
+ struct my_complex_struct st = {.a = 42};
+ return st;
+ // CHECK: ret i64
+}
+
+// CHECK-LABEL: define hidden void @"\01-[Root getAggregate]"(
+- (struct my_aggregate_struct)getAggregate __attribute__((objc_direct)) {
+ // CHECK: %struct.my_aggregate_struct* noalias sret [[RETVAL:%[^,]*]],
+
+ // loading parameters
+ // CHECK-LABEL: entry:
+ // CHECK-NEXT: [[SELFADDR:%.*]] = alloca %0*,
+ // CHECK-NEXT: [[_CMDADDR:%.*]] = alloca i8*,
+ // CHECK-NEXT: store %0* %{{.*}}, %0** [[SELFADDR]],
+ // CHECK-NEXT: store i8* %{{.*}}, i8** [[_CMDADDR]],
+
+ // self nil-check
+ // CHECK-NEXT: [[SELF:%.*]] = load %0*, %0** [[SELFADDR]],
+ // CHECK-NEXT: [[NILCHECK:%.*]] = icmp eq %0* [[SELF]], null
+ // CHECK-NEXT: br i1 [[NILCHECK]],
+
+ // setting return value to nil
+ // CHECK-LABEL: objc_direct_method.self_is_nil:
+ // CHECK: [[RET0:%.*]] = bitcast{{.*}}[[RETVAL]]
+ // CHECK-NEXT: call void @llvm.memset{{[^(]*}}({{[^,]*}}[[RET0]], i8 0,
+ // CHECK-NEXT: br label
+
+ // set value
+ // CHECK-LABEL: objc_direct_method.cont:
+ // CHECK: [[RET1:%.*]] = bitcast{{.*}}[[RETVAL]]
+ // CHECK: br label
+
+ // return
+ // CHECK-LABEL: return:
+ // CHECK: ret void
+ struct my_aggregate_struct st = {.a = 42};
+ return st;
+}
+
+// CHECK-LABEL: define hidden void @"\01+[Root classGetAggregate]"(
++ (struct my_aggregate_struct)classGetAggregate __attribute__((objc_direct)) {
+ struct my_aggregate_struct st = {.a = 42};
+ return st;
+ // CHECK: ret void
+}
+
+@end
+// CHECK-LABEL: define hidden i32 @"\01-[Root intProperty]"
+
+@interface Foo : Root {
+ id __strong _cause_cxx_destruct;
+}
+@property(nonatomic, readonly, direct) int getDirect_setDynamic;
+@property(nonatomic, readonly) int getDynamic_setDirect;
+@end
+
+@interface Foo ()
+@property(nonatomic, readwrite) int getDirect_setDynamic;
+@property(nonatomic, readwrite, direct) int getDynamic_setDirect;
+- (int)directMethodInExtension __attribute__((objc_direct));
+@end
+
+@interface Foo (Cat)
+- (int)directMethodInCategory __attribute__((objc_direct));
+@end
+
+__attribute__((objc_direct_members))
+@implementation Foo
+// CHECK-LABEL: define hidden i32 @"\01-[Foo directMethodInExtension]"(
+- (int)directMethodInExtension {
+ return 42;
+}
+// CHECK-LABEL: define hidden i32 @"\01-[Foo getDirect_setDynamic]"(
+// CHECK-LABEL: define internal void @"\01-[Foo setGetDirect_setDynamic:]"(
+// CHECK-LABEL: define internal i32 @"\01-[Foo getDynamic_setDirect]"(
+// CHECK-LABEL: define hidden void @"\01-[Foo setGetDynamic_setDirect:]"(
+// CHECK-LABEL: define internal void @"\01-[Foo .cxx_destruct]"(
+@end
+
+@implementation Foo (Cat)
+// CHECK-LABEL: define hidden i32 @"\01-[Foo directMethodInCategory]"(
+- (int)directMethodInCategory {
+ return 42;
+}
+// CHECK-LABEL: define hidden i32 @"\01-[Foo directMethodInCategoryNoDecl]"(
+- (int)directMethodInCategoryNoDecl __attribute__((objc_direct)) {
+ return 42;
+}
+@end
+
+int useRoot(Root *r) {
+ // CHECK-LABEL: define i32 @useRoot
+ // CHECK: %{{[^ ]*}} = call i32 bitcast {{.*}} @"\01-[Root getInt]"
+ // CHECK: %{{[^ ]*}} = call i32 bitcast {{.*}} @"\01-[Root intProperty]"
+ // CHECK: %{{[^ ]*}} = call i32 bitcast {{.*}} @"\01-[Root intProperty2]"
+ return [r getInt] + [r intProperty] + [r intProperty2];
+}
+
+int useFoo(Foo *f) {
+ // CHECK-LABEL: define i32 @useFoo
+ // CHECK: call void bitcast {{.*}} @"\01-[Foo setGetDynamic_setDirect:]"
+ // CHECK: %{{[^ ]*}} = call i32 bitcast {{.*}} @"\01-[Foo getDirect_setDynamic]"
+ // CHECK: %{{[^ ]*}} = call i32 bitcast {{.*}} @"\01-[Foo directMethodInExtension]"
+ // CHECK: %{{[^ ]*}} = call i32 bitcast {{.*}} @"\01-[Foo directMethodInCategory]"
+ // CHECK: %{{[^ ]*}} = call i32 bitcast {{.*}} @"\01-[Foo directMethodInCategoryNoDecl]"
+ [f setGetDynamic_setDirect:1];
+ return [f getDirect_setDynamic] +
+ [f directMethodInExtension] +
+ [f directMethodInCategory] +
+ [f directMethodInCategoryNoDecl];
+}
+
+__attribute__((objc_root_class))
+@interface RootDeclOnly
+@property(direct, readonly) int intProperty;
+@end
+
+int useRootDeclOnly(RootDeclOnly *r) {
+ // CHECK-LABEL: define i32 @useRootDeclOnly
+ // CHECK: %{{[^ ]*}} = call i32 bitcast {{.*}} @"\01-[RootDeclOnly intProperty]"
+ return [r intProperty];
+}
diff --git a/src/llvm-project/clang/test/CodeGenObjC/encode-test-2.m b/src/llvm-project/clang/test/CodeGenObjC/encode-test-2.m
index 9e14237..2d9593d 100644
--- a/src/llvm-project/clang/test/CodeGenObjC/encode-test-2.m
+++ b/src/llvm-project/clang/test/CodeGenObjC/encode-test-2.m
@@ -1,9 +1,13 @@
-// RUN: %clang_cc1 -triple=i686-apple-darwin9 -emit-llvm -o %t %s
-// RUN: grep -e "@\\\22<X>\\\22" %t
-// RUN: grep -e "@\\\22<X><Y>\\\22" %t
-// RUN: grep -e "@\\\22<X><Y><Z>\\\22" %t
-// RUN: grep -e "@\\\22Foo<X><Y><Z>\\\22" %t
-// RUN: grep -e "{Intf=@@@@#}" %t
+// RUN: %clang_cc1 -triple=i686-apple-darwin9 -emit-llvm -o - %s | FileCheck %s
+
+// CHECK: private unnamed_addr constant [7 x i8] c"@\22<X>\22\00",
+// CHECK: private unnamed_addr constant [10 x i8] c"@\22<X><Y>\22\00",
+// CHECK: private unnamed_addr constant [13 x i8] c"@\22<X><Y><Z>\22\00",
+// CHECK: private unnamed_addr constant [16 x i8] c"@\22Foo<X><Y><Z>\22\00",
+// CHECK: private unnamed_addr constant [13 x i8] c"{Intf=@@@@#}\00",
+
+// CHECK: @[[PROP_NAME_ATTR:.*]] = private unnamed_addr constant [5 x i8] c"T@,D\00",
+// CHECK: @"_OBJC_$_PROP_LIST_C0" = internal global { i32, i32, [1 x %{{.*}}] } { i32 8, i32 1, [1 x %{{.*}}] [%{{.*}} { {{.*}}, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @[[PROP_NAME_ATTR]], i32 0, i32 0) }] },
@protocol X, Y, Z;
@class Foo;
@@ -28,3 +32,18 @@
{
const char * en = @encode(Intf);
}
+
+@protocol P0
+@property id prop0;
+@end
+
+@protocol P1 <P0>
+@property id prop0;
+@end
+
+@interface C0 <P1>
+@end
+
+@implementation C0
+@dynamic prop0;
+@end
diff --git a/src/llvm-project/clang/test/CodeGenObjC/gnu-init.m b/src/llvm-project/clang/test/CodeGenObjC/gnu-init.m
index 6d562b8..076e081 100644
--- a/src/llvm-project/clang/test/CodeGenObjC/gnu-init.m
+++ b/src/llvm-project/clang/test/CodeGenObjC/gnu-init.m
@@ -1,7 +1,7 @@
-// RUN: %clang_cc1 -triple x86_64-unknown-freebsd -S -emit-llvm -fobjc-runtime=gnustep-2.0 -o - %s | FileCheck %s -check-prefix=CHECK-NEW
-// RUN: %clang_cc1 -triple x86_64-pc-windows-msvc -S -emit-llvm -fobjc-runtime=gnustep-2.0 -o - %s | FileCheck %s -check-prefix=CHECK-WIN
-// RUN: %clang_cc1 -triple x86_64-unknown-freebsd -S -emit-llvm -fobjc-runtime=gnustep-1.8 -o - %s | FileCheck %s -check-prefix=CHECK-OLD
-// RUN: %clang_cc1 -triple x86_64-unknown-freebsd -fuse-init-array -S -emit-llvm -fobjc-runtime=gnustep-2.0 -o - %s | FileCheck %s -check-prefix=CHECK-INIT_ARRAY
+// RUN: %clang_cc1 -triple x86_64-unknown-freebsd -S -emit-llvm -fno-use-init-array -fobjc-runtime=gnustep-2.0 -o - %s | FileCheck %s -check-prefix=CHECK-NEW
+// RUN: %clang_cc1 -triple x86_64-pc-windows-msvc -S -emit-llvm -fno-use-init-array -fobjc-runtime=gnustep-2.0 -o - %s | FileCheck %s -check-prefix=CHECK-WIN
+// RUN: %clang_cc1 -triple x86_64-unknown-freebsd -S -emit-llvm -fno-use-init-array -fobjc-runtime=gnustep-1.8 -o - %s | FileCheck %s -check-prefix=CHECK-OLD
+// RUN: %clang_cc1 -triple x86_64-unknown-freebsd -S -emit-llvm -fobjc-runtime=gnustep-2.0 -o - %s | FileCheck %s -check-prefix=CHECK-INIT_ARRAY
// Almost minimal Objective-C file, check that it emits calls to the correct
// runtime entry points.
diff --git a/src/llvm-project/clang/test/CodeGenObjC/initialize-function-static.m b/src/llvm-project/clang/test/CodeGenObjC/initialize-function-static.m
new file mode 100644
index 0000000..21ad320
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenObjC/initialize-function-static.m
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.15 -emit-llvm -fobjc-arc -o - %s | FileCheck %s
+
+@interface I
+@end
+
+I *i() {
+ static I *i = ((void *)0);
+ return i;
+}
+
+// CHECK-NOT: __cxa_guard_acquire
+// CHECK-NOT: __cxa_guard_release
diff --git a/src/llvm-project/clang/test/CodeGenObjC/instance-method-metadata.m b/src/llvm-project/clang/test/CodeGenObjC/instance-method-metadata.m
index 96f499c..e08de8f 100644
--- a/src/llvm-project/clang/test/CodeGenObjC/instance-method-metadata.m
+++ b/src/llvm-project/clang/test/CodeGenObjC/instance-method-metadata.m
@@ -1,6 +1,5 @@
// REQUIRES: x86-registered-target
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -S -o %t %s
-// RUN: FileCheck < %t %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -S %s -o - | FileCheck %s
// rdar://9072317
diff --git a/src/llvm-project/clang/test/CodeGenObjC/nontrivial-c-struct-exception.m b/src/llvm-project/clang/test/CodeGenObjC/nontrivial-c-struct-exception.m
index 7db53bb..1733a01 100644
--- a/src/llvm-project/clang/test/CodeGenObjC/nontrivial-c-struct-exception.m
+++ b/src/llvm-project/clang/test/CodeGenObjC/nontrivial-c-struct-exception.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple arm64-apple-ios11 -fobjc-arc -fblocks -fobjc-runtime=ios-11.0 -fobjc-exceptions -fexceptions -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple arm64-apple-ios11 -fobjc-arc -fblocks -fobjc-runtime=ios-11.0 -fobjc-exceptions -fexceptions -debug-info-kind=line-tables-only -emit-llvm -o - %s | FileCheck %s
// CHECK: %[[STRUCT_STRONG:.*]] = type { i32, i8* }
// CHECK: %[[STRUCT_WEAK:.*]] = type { i32, i8* }
@@ -25,8 +25,8 @@
// CHECK-NEXT: ret void
// CHECK: landingpad { i8*, i32 }
-// CHECK: %[[V9:.*]] = bitcast %[[STRUCT_STRONG]]* %[[AGG_TMP]] to i8**
-// CHECK: call void @__destructor_8_s8(i8** %[[V9]])
+// CHECK: %[[V9:.*]] = bitcast %[[STRUCT_STRONG]]* %[[AGG_TMP]] to i8**{{.*}}, !dbg [[ARTIFICIAL_LOC_1:![0-9]+]]
+// CHECK: call void @__destructor_8_s8(i8** %[[V9]]){{.*}}, !dbg [[ARTIFICIAL_LOC_1]]
// CHECK: br label
// CHECK: resume
@@ -48,8 +48,8 @@
// CHECK: ret void
// CHECK: landingpad { i8*, i32 }
-// CHECK: %[[V3:.*]] = bitcast %[[STRUCT_WEAK]]* %[[AGG_TMP]] to i8**
-// CHECK: call void @__destructor_8_w8(i8** %[[V3]])
+// CHECK: %[[V3:.*]] = bitcast %[[STRUCT_WEAK]]* %[[AGG_TMP]] to i8**{{.*}}, !dbg [[ARTIFICIAL_LOC_2:![0-9]+]]
+// CHECK: call void @__destructor_8_w8(i8** %[[V3]]){{.*}}, !dbg [[ARTIFICIAL_LOC_2]]
// CHECK: br label
// CHECK: resume
@@ -60,3 +60,6 @@
void testWeakException(void) {
calleeWeak(genWeak(), genWeak());
}
+
+// CHECK-DAG: [[ARTIFICIAL_LOC_1]] = !DILocation(line: 0
+// CHECK-DAG: [[ARTIFICIAL_LOC_2]] = !DILocation(line: 0
diff --git a/src/llvm-project/clang/test/CodeGenObjC/nontrivial-struct-param-init.m b/src/llvm-project/clang/test/CodeGenObjC/nontrivial-struct-param-init.m
new file mode 100644
index 0000000..96a63b8
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenObjC/nontrivial-struct-param-init.m
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 -triple i386-apple-watchos6.0-simulator -emit-llvm -fblocks -fobjc-arc -o - %s | FileCheck %s
+
+// CHECK: %[[STRUCT_S:.*]] = type { i8* }
+
+typedef struct {
+ id x;
+} S;
+
+// CHECK: define void @test0(i8* %[[A_0:.*]])
+// CHECK: %[[A:.*]] = alloca %[[STRUCT_S]], align 4
+// CHECK: %[[X:.*]] = getelementptr inbounds %[[STRUCT_S]], %[[STRUCT_S]]* %[[A]], i32 0, i32 0
+// CHECK: store i8* %[[A_0]], i8** %[[X]], align 4
+// CHECK: %[[V0:.*]] = bitcast %[[STRUCT_S]]* %[[A]] to i8**
+// CHECK: call void @__destructor_4_s0(i8** %[[V0]]) #2
+
+void test0(S a) {
+}
diff --git a/src/llvm-project/clang/test/CodeGenObjC/objc-alloc-init.m b/src/llvm-project/clang/test/CodeGenObjC/objc-alloc-init.m
index c5c1a76..8370202 100644
--- a/src/llvm-project/clang/test/CodeGenObjC/objc-alloc-init.m
+++ b/src/llvm-project/clang/test/CodeGenObjC/objc-alloc-init.m
@@ -22,21 +22,30 @@
}
@interface Y : X
++(Class)class;
+(void)meth;
-(void)instanceMeth;
@end
@implementation Y
++(Class)class {
+ return self;
+}
+(void)meth {
[[self alloc] init];
// OPTIMIZED: call i8* @objc_alloc_init(
// NOT_OPTIMIZED: call i8* @objc_alloc(
}
++ (void)meth2 {
+ [[[self class] alloc] init];
+ // OPTIMIZED: call i8* @objc_alloc_init(
+ // NOT_OPTIMIZED: call i8* @objc_alloc(
+}
-(void)instanceMeth {
// EITHER-NOT: call i8* @objc_alloc
// EITHER: call {{.*}} @objc_msgSend
// EITHER: call {{.*}} @objc_msgSend
- [[self alloc] init];
+ [[(id)self alloc] init];
}
@end
diff --git a/src/llvm-project/clang/test/CodeGenObjC/protocol-comdat.m b/src/llvm-project/clang/test/CodeGenObjC/protocol-comdat.m
index 1402ad0..79a1d55 100644
--- a/src/llvm-project/clang/test/CodeGenObjC/protocol-comdat.m
+++ b/src/llvm-project/clang/test/CodeGenObjC/protocol-comdat.m
@@ -1,4 +1,4 @@
-// RUN: %clang -cc1 -triple thumbv7--windows-itanium -fobjc-runtime=ios -emit-llvm -o - %s -Wno-objc-root-class | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv7--windows-itanium -fobjc-runtime=ios -emit-llvm -o - %s -Wno-objc-root-class | FileCheck %s
@protocol P
- (void) method;
diff --git a/src/llvm-project/clang/test/CodeGenObjC/strong-in-c-struct.m b/src/llvm-project/clang/test/CodeGenObjC/strong-in-c-struct.m
index 8eeee4a..eae5013 100644
--- a/src/llvm-project/clang/test/CodeGenObjC/strong-in-c-struct.m
+++ b/src/llvm-project/clang/test/CodeGenObjC/strong-in-c-struct.m
@@ -247,7 +247,7 @@
// CHECK: %[[V9:.*]] = bitcast %[[STRUCT_STRONGOUTER]]* %[[T2]] to i8**
// CHECK: call void @__destructor_8_S_s16_s24(i8** %[[V9]])
-// CHECK: define internal void @__Block_byref_object_copy_(i8*, i8*)
+// CHECK: define internal void @__Block_byref_object_copy_(i8* %0, i8* %1)
// CHECK: call void @__move_constructor_8_8_S_t0w16_s16_s24_t32w8(
// CHECK: define linkonce_odr hidden void @__move_constructor_8_8_S_t0w16_s16_s24_t32w8(i8** %[[DST:.*]], i8** %[[SRC:.*]])
@@ -268,7 +268,7 @@
// CHECK: store i8* null, i8** %[[V7]], align 8
// CHECK: store i8* %[[V8]], i8** %[[V4]], align 8
-// CHECK: define internal void @__Block_byref_object_dispose_(i8*)
+// CHECK: define internal void @__Block_byref_object_dispose_(i8* %0)
// CHECK: call void @__destructor_8_S_s16_s24(
void test_move_constructor_StrongOuter(void) {
@@ -545,7 +545,7 @@
// CHECK: call void @__destructor_8_s16(
// CHECK: ret void
-// CHECK: define linkonce_odr hidden void @__copy_helper_block_8_32n13_8_8_t0w16_s16(i8*, i8*)
+// CHECK: define linkonce_odr hidden void @__copy_helper_block_8_32n13_8_8_t0w16_s16(i8* %0, i8* %1)
// CHECK: call void @__copy_constructor_8_8_t0w16_s16(
// CHECK: ret void
diff --git a/src/llvm-project/clang/test/CodeGenObjC/weak-in-c-struct.m b/src/llvm-project/clang/test/CodeGenObjC/weak-in-c-struct.m
index 1b2d860..001a7ed 100644
--- a/src/llvm-project/clang/test/CodeGenObjC/weak-in-c-struct.m
+++ b/src/llvm-project/clang/test/CodeGenObjC/weak-in-c-struct.m
@@ -101,7 +101,7 @@
*d = *s;
}
-// ARM64: define internal void @__Block_byref_object_copy_(i8*, i8*)
+// ARM64: define internal void @__Block_byref_object_copy_(i8* %0, i8* %1)
// ARM64: call void @__move_constructor_8_8_t0w4_w8(i8** %{{.*}}, i8** %{{.*}})
// ARM64: define linkonce_odr hidden void @__move_constructor_8_8_t0w4_w8(i8** %[[DST:.*]], i8** %[[SRC:.*]])
diff --git a/src/llvm-project/clang/test/CodeGenObjCXX/arc-blocks.mm b/src/llvm-project/clang/test/CodeGenObjCXX/arc-blocks.mm
index 24697cf..d29491e 100644
--- a/src/llvm-project/clang/test/CodeGenObjCXX/arc-blocks.mm
+++ b/src/llvm-project/clang/test/CodeGenObjCXX/arc-blocks.mm
@@ -122,7 +122,7 @@
// CHECK: call void @__clang_call_terminate(
// CHECK-O1-LABEL: define linkonce_odr hidden void @__copy_helper_block_ea8_32s40r48w56c15_ZTSN5test12S0E60c15_ZTSN5test12S0E(
-// CHECK-O1: tail call void @llvm.objc.release({{.*}}) {{.*}} !clang.imprecise_release
+// CHECK-O1: call void @llvm.objc.release({{.*}}) {{.*}} !clang.imprecise_release
// CHECK-NOEXCP: define linkonce_odr hidden void @__copy_helper_block_8_32s40r48w56c15_ZTSN5test12S0E60c15_ZTSN5test12S0E(
// CHECK: define linkonce_odr hidden void @__destroy_helper_block_ea8_32s40r48w56c15_ZTSN5test12S0E60c15_ZTSN5test12S0E(
@@ -170,8 +170,8 @@
// CHECK: call void @__clang_call_terminate(
// CHECK-O1-LABEL: define linkonce_odr hidden void @__destroy_helper_block_ea8_32s40r48w56c15_ZTSN5test12S0E60c15_ZTSN5test12S0E(
-// CHECK-O1: tail call void @llvm.objc.release({{.*}}) {{.*}} !clang.imprecise_release
-// CHECK-O1: tail call void @llvm.objc.release({{.*}}) {{.*}} !clang.imprecise_release
+// CHECK-O1: call void @llvm.objc.release({{.*}}) {{.*}} !clang.imprecise_release
+// CHECK-O1: call void @llvm.objc.release({{.*}}) {{.*}} !clang.imprecise_release
// CHECK-NOEXCP: define linkonce_odr hidden void @__destroy_helper_block_8_32s40r48w56c15_ZTSN5test12S0E60c15_ZTSN5test12S0E(
namespace {
diff --git a/src/llvm-project/clang/test/CodeGenObjCXX/arc-indirect.mm b/src/llvm-project/clang/test/CodeGenObjCXX/arc-indirect.mm
index 49fdc51..de7566f 100644
--- a/src/llvm-project/clang/test/CodeGenObjCXX/arc-indirect.mm
+++ b/src/llvm-project/clang/test/CodeGenObjCXX/arc-indirect.mm
@@ -15,8 +15,8 @@
}
@end
-// CHECK-GNUSTEP: define internal void @_i_C__object_struct_(<{ %0*, i8*, i8*, %struct.S, [3 x i8] }>* inalloca)
-// CHECK-DARWIN: define internal void @"\01-[C object:struct:]"(<{ %0*, i8*, i8*, %struct.S, [3 x i8] }>* inalloca)
+// CHECK-GNUSTEP: define internal void @_i_C__object_struct_(<{ %0*, i8*, i8*, %struct.S, [3 x i8] }>* inalloca %0)
+// CHECK-DARWIN: define internal void @"\01-[C object:struct:]"(<{ %0*, i8*, i8*, %struct.S, [3 x i8] }>* inalloca %0)
// CHECK: %obj = getelementptr inbounds <{ %0*, i8*, i8*, %struct.S, [3 x i8] }>, <{ %0*, i8*, i8*, %struct.S, [3 x i8] }>* %0, i32 0, i32 2
// CHECK: %[[INSTANCE:[0-9]+]] = load i8*, i8** %obj, align 4
// CHECK: call void @llvm.objc.storeStrong(i8** %obj, i8* %[[INSTANCE]])
diff --git a/src/llvm-project/clang/test/CodeGenObjCXX/arc-mangle.mm b/src/llvm-project/clang/test/CodeGenObjCXX/arc-mangle.mm
index b39aa7b..b061b3f 100644
--- a/src/llvm-project/clang/test/CodeGenObjCXX/arc-mangle.mm
+++ b/src/llvm-project/clang/test/CodeGenObjCXX/arc-mangle.mm
@@ -1,21 +1,21 @@
// RUN: %clang_cc1 -fobjc-arc -fobjc-runtime-has-weak -triple %itanium_abi_triple -emit-llvm -fblocks -o - %s | FileCheck %s
// RUN: %clang_cc1 -DTEST_UNALIGNED -fms-extensions -fobjc-arc -fobjc-runtime-has-weak -triple %itanium_abi_triple -emit-llvm -fblocks -o - %s | FileCheck %s --check-prefix=UNALIGNED
-// CHECK-LABEL: define {{.*}}void @_Z1fPU8__strongP11objc_object(i8**)
+// CHECK-LABEL: define {{.*}}void @_Z1fPU8__strongP11objc_object(i8** %0)
void f(__strong id *) {}
-// CHECK-LABEL: define {{.*}}void @_Z1fPU6__weakP11objc_object(i8**)
+// CHECK-LABEL: define {{.*}}void @_Z1fPU6__weakP11objc_object(i8** %0)
void f(__weak id *) {}
-// CHECK-LABEL: define {{.*}}void @_Z1fPU15__autoreleasingP11objc_object(i8**)
+// CHECK-LABEL: define {{.*}}void @_Z1fPU15__autoreleasingP11objc_object(i8** %0)
void f(__autoreleasing id *) {}
-// CHECK-LABEL: define {{.*}}void @_Z1fPP11objc_object(i8**)
+// CHECK-LABEL: define {{.*}}void @_Z1fPP11objc_object(i8** %0)
void f(__unsafe_unretained id *) {}
-// CHECK-LABEL: define {{.*}}void @_Z1fPU8__strongKP11objc_object(i8**)
+// CHECK-LABEL: define {{.*}}void @_Z1fPU8__strongKP11objc_object(i8** %0)
void f(const __strong id *) {}
-// CHECK-LABEL: define {{.*}}void @_Z1fPU6__weakKP11objc_object(i8**)
+// CHECK-LABEL: define {{.*}}void @_Z1fPU6__weakKP11objc_object(i8** %0)
void f(const __weak id *) {}
-// CHECK-LABEL: define {{.*}}void @_Z1fPU15__autoreleasingKP11objc_object(i8**)
+// CHECK-LABEL: define {{.*}}void @_Z1fPU15__autoreleasingKP11objc_object(i8** %0)
void f(const __autoreleasing id *) {}
-// CHECK-LABEL: define {{.*}}void @_Z1fPKP11objc_object(i8**)
+// CHECK-LABEL: define {{.*}}void @_Z1fPKP11objc_object(i8** %0)
void f(const __unsafe_unretained id *) {}
// CHECK-LABEL: define {{.*}}void @_Z1fPFU19ns_returns_retainedP11objc_objectvE
void f(__attribute__((ns_returns_retained)) id (*fn)()) {}
@@ -35,10 +35,10 @@
template void g<const void>(unsigned_c<sizeof(id) + 1> *);
#if TEST_UNALIGNED
-// UNALIGNED-LABEL: define {{.*}}void @_Z1gPU6__weakU11__unalignedP11objc_object(i8**)
+// UNALIGNED-LABEL: define {{.*}}void @_Z1gPU6__weakU11__unalignedP11objc_object(i8** %0)
void g(__weak __unaligned id *) {}
-// UNALIGNED-LABEL: define {{.*}}void @_Z1gPU11__unalignedU8__strongP11objc_object(i8**)
+// UNALIGNED-LABEL: define {{.*}}void @_Z1gPU11__unalignedU8__strongP11objc_object(i8** %0)
void g(__strong __unaligned id *) {}
-// UNALIGNED-LABEL: define {{.*}}void @_Z1gPU11__unalignedU15__autoreleasingP11objc_object(i8**)
+// UNALIGNED-LABEL: define {{.*}}void @_Z1gPU11__unalignedU15__autoreleasingP11objc_object(i8** %0)
void g(__autoreleasing __unaligned id *) {}
#endif // TEST_UNALIGNED
diff --git a/src/llvm-project/clang/test/CodeGenObjCXX/designated-initializers.mm b/src/llvm-project/clang/test/CodeGenObjCXX/designated-initializers.mm
index 71ffe1fb..1773f26 100644
--- a/src/llvm-project/clang/test/CodeGenObjCXX/designated-initializers.mm
+++ b/src/llvm-project/clang/test/CodeGenObjCXX/designated-initializers.mm
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple arm64 %s -verify -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -triple arm64 %s -verify -emit-llvm -o - -Wno-c99-designator | FileCheck %s
// expected-no-diagnostics
// Make sure we don't enter an infinite loop (rdar://21942503)
diff --git a/src/llvm-project/clang/test/CodeGenObjCXX/implicit-copy-constructor.mm b/src/llvm-project/clang/test/CodeGenObjCXX/implicit-copy-constructor.mm
index e1c7b8d..404d11d 100644
--- a/src/llvm-project/clang/test/CodeGenObjCXX/implicit-copy-constructor.mm
+++ b/src/llvm-project/clang/test/CodeGenObjCXX/implicit-copy-constructor.mm
@@ -41,7 +41,7 @@
D d2(d);
}
-// CHECK-LABEL: define linkonce_odr void @_ZN1DC1ERS_(%struct.D* %this, %struct.D* dereferenceable({{[0-9]+}})) unnamed_addr
+// CHECK-LABEL: define linkonce_odr void @_ZN1DC1ERS_(%struct.D* %this, %struct.D* dereferenceable({{[0-9]+}}) %0) unnamed_addr
// CHECK: call void @_ZN1AC1Ev
// CHECK: call void @_ZN1CC2ERS_1A
// CHECK: call void @_ZN1AD1Ev
diff --git a/src/llvm-project/clang/test/CodeGenObjCXX/microsoft-abi-arc-param-order.mm b/src/llvm-project/clang/test/CodeGenObjCXX/microsoft-abi-arc-param-order.mm
index 50c2e4a..2c0ffac 100644
--- a/src/llvm-project/clang/test/CodeGenObjCXX/microsoft-abi-arc-param-order.mm
+++ b/src/llvm-project/clang/test/CodeGenObjCXX/microsoft-abi-arc-param-order.mm
@@ -10,7 +10,7 @@
// Verify that we destruct things from left to right in the MS C++ ABI: a, b, c, d.
//
// CHECK-LABEL: define dso_local void @"?test_arc_order@@YAXUA@@PAUobjc_object@@01@Z"
-// CHECK: (<{ %struct.A, i8*, %struct.A, i8* }>* inalloca)
+// CHECK: (<{ %struct.A, i8*, %struct.A, i8* }>* inalloca %0)
void test_arc_order(A a, id __attribute__((ns_consumed)) b , A c, id __attribute__((ns_consumed)) d) {
// CHECK: call x86_thiscallcc void @"??1A@@QAE@XZ"(%struct.A* %{{.*}})
// CHECK: call void @llvm.objc.storeStrong(i8** %{{.*}}, i8* null)
diff --git a/src/llvm-project/clang/test/CodeGenObjCXX/msabi-stret.mm b/src/llvm-project/clang/test/CodeGenObjCXX/msabi-stret.mm
index 66e407a..db34737 100644
--- a/src/llvm-project/clang/test/CodeGenObjCXX/msabi-stret.mm
+++ b/src/llvm-project/clang/test/CodeGenObjCXX/msabi-stret.mm
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple i686-unknown-windows-msvc -fobjc-runtime=ios-6.0 -Os -S -emit-llvm -o - %s -mdisable-fp-elim | FileCheck %s
+// RUN: %clang_cc1 -triple i686-unknown-windows-msvc -fobjc-runtime=ios-6.0 -Os -S -emit-llvm -o - %s -mframe-pointer=all | FileCheck %s
struct S {
S() = default;
diff --git a/src/llvm-project/clang/test/CodeGenObjCXX/nrvo.mm b/src/llvm-project/clang/test/CodeGenObjCXX/nrvo.mm
index 1ad5f79..a02b38b 100644
--- a/src/llvm-project/clang/test/CodeGenObjCXX/nrvo.mm
+++ b/src/llvm-project/clang/test/CodeGenObjCXX/nrvo.mm
@@ -14,7 +14,7 @@
// CHECK: define internal void @"\01-[NRVO getNRVO]"
- (X)getNRVO {
X x;
- // CHECK: tail call void @_ZN1XC1Ev
+ // CHECK: call void @_ZN1XC1Ev
// CHECK-NEXT: ret void
return x;
}
@@ -24,7 +24,7 @@
return ^{
// CHECK-LABEL: define internal void @___Z10blocksNRVOv_block_invoke
X x;
- // CHECK: tail call void @_ZN1XC1Ev
+ // CHECK: call void @_ZN1XC1Ev
// CHECK-NEXT: ret void
return x;
}() ;
diff --git a/src/llvm-project/clang/test/CodeGenObjCXX/property-dot-reference.mm b/src/llvm-project/clang/test/CodeGenObjCXX/property-dot-reference.mm
index 8f3b29d..37840ea 100644
--- a/src/llvm-project/clang/test/CodeGenObjCXX/property-dot-reference.mm
+++ b/src/llvm-project/clang/test/CodeGenObjCXX/property-dot-reference.mm
@@ -14,7 +14,7 @@
// CHECK: call dereferenceable({{[0-9]+}}) %struct.TFENode* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend
// CHECK-NEXT: call void @_ZNK7TFENode6GetURLEv(%struct.TFENode* %{{.*}})
self.node.GetURL();
-} // expected-warning {{control reaches end of non-void function}}
+} // expected-warning {{non-void function does not return a value}}
@end
// rdar://8437240
diff --git a/src/llvm-project/clang/test/CodeGenObjCXX/property-object-reference-2.mm b/src/llvm-project/clang/test/CodeGenObjCXX/property-object-reference-2.mm
index 230fe48..247c670 100644
--- a/src/llvm-project/clang/test/CodeGenObjCXX/property-object-reference-2.mm
+++ b/src/llvm-project/clang/test/CodeGenObjCXX/property-object-reference-2.mm
@@ -29,7 +29,7 @@
@synthesize MyProperty1 = _cppObject1;
@end
-// CHECK-LABEL: define internal void @__copy_helper_atomic_property_(%struct.TCPPObject*, %struct.TCPPObject*) #
+// CHECK-LABEL: define internal void @__copy_helper_atomic_property_(%struct.TCPPObject* %0, %struct.TCPPObject* %1) #
// CHECK: [[TWO:%.*]] = load %struct.TCPPObject*, %struct.TCPPObject** [[ADDR:%.*]], align 8
// CHECK: [[THREE:%.*]] = load %struct.TCPPObject*, %struct.TCPPObject** [[ADDR1:%.*]], align 8
// CHECK: [[CALL:%.*]] = call i32 @_Z7DEFAULTv()
@@ -43,7 +43,7 @@
// 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-LABEL: define internal void @__assign_helper_atomic_property_(%struct.TCPPObject*, %struct.TCPPObject*) #
+// CHECK-LABEL: define internal void @__assign_helper_atomic_property_(%struct.TCPPObject* %0, %struct.TCPPObject* %1) #
// CHECK: [[THREE:%.*]] = load %struct.TCPPObject*, %struct.TCPPObject** [[ADDR1:%.*]], align 8
// CHECK: [[TWO:%.*]] = load %struct.TCPPObject*, %struct.TCPPObject** [[ADDR:%.*]], align 8
// CHECK: [[CALL:%.*]] = call dereferenceable({{[0-9]+}}) %struct.TCPPObject* @_ZN10TCPPObjectaSERKS_(%struct.TCPPObject* [[TWO]], %struct.TCPPObject* dereferenceable({{[0-9]+}}) [[THREE]])
diff --git a/src/llvm-project/clang/test/CodeGenObjCXX/synthesized-property-cleanup.mm b/src/llvm-project/clang/test/CodeGenObjCXX/synthesized-property-cleanup.mm
new file mode 100644
index 0000000..8740a4c
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenObjCXX/synthesized-property-cleanup.mm
@@ -0,0 +1,34 @@
+// RUN: %clang_cc1 -triple arm64e-apple-ios13.0 -debug-info-kind=standalone -fobjc-arc -fsanitize=nullability-return \
+// RUN: %s -emit-llvm -o - | FileCheck %s
+
+@interface NSObject
++ (id)alloc;
+@end
+
+@interface NSString : NSObject
+@end
+
+// CHECK: define {{.*}}@"\01-[MyData setData:]"
+// CHECK: [[DATA:%.*]] = alloca %struct.Data
+// CHECK: call %struct.Data* @_ZN4DataD1Ev(%struct.Data* [[DATA]]){{.*}}, !dbg [[DATA_PROPERTY_LOC:![0-9]+]]
+// CHECK-NEXT: ret void
+
+// CHECK: define {{.*}}@"\01-[MyData string]"
+// CHECK: call void @__ubsan_handle_nullability_return_v1_abort{{.*}}, !dbg [[STRING_PROPERTY_LOC:![0-9]+]]
+// CHECK: ret
+
+@interface MyData : NSObject
+struct Data {
+ NSString *name;
+};
+
+// CHECK-DAG: [[DATA_PROPERTY_LOC]] = !DILocation(line: [[@LINE+1]]
+@property struct Data data;
+
+// CHECK-DAG: [[STRING_PROPERTY_LOC]] = !DILocation(line: [[@LINE+1]]
+@property (nonnull) NSString *string;
+
+@end
+
+@implementation MyData
+@end
diff --git a/src/llvm-project/clang/test/CodeGenOpenCL/amdgpu-attrs.cl b/src/llvm-project/clang/test/CodeGenOpenCL/amdgpu-attrs.cl
index ba4322f..b667148 100644
--- a/src/llvm-project/clang/test/CodeGenOpenCL/amdgpu-attrs.cl
+++ b/src/llvm-project/clang/test/CodeGenOpenCL/amdgpu-attrs.cl
@@ -143,6 +143,10 @@
// CHECK: define void @a_function() [[A_FUNCTION:#[0-9]+]]
}
+kernel void default_kernel() {
+// CHECK: define amdgpu_kernel void @default_kernel() [[DEFAULT_KERNEL_ATTRS:#[0-9]+]]
+}
+
// Make sure this is silently accepted on other targets.
// X86-NOT: "amdgpu-flat-work-group-size"
@@ -158,23 +162,25 @@
// CHECK-NOT: "amdgpu-num-sgpr"="0"
// CHECK-NOT: "amdgpu-num-vgpr"="0"
-// CHECK-DAG: attributes [[FLAT_WORK_GROUP_SIZE_32_64]] = { convergent noinline nounwind optnone "amdgpu-flat-work-group-size"="32,64" "amdgpu-implicitarg-num-bytes"="56"
-// CHECK-DAG: attributes [[FLAT_WORK_GROUP_SIZE_64_64]] = { convergent noinline nounwind optnone "amdgpu-flat-work-group-size"="64,64" "amdgpu-implicitarg-num-bytes"="56"
-// CHECK-DAG: attributes [[FLAT_WORK_GROUP_SIZE_16_128]] = { convergent noinline nounwind optnone "amdgpu-flat-work-group-size"="16,128" "amdgpu-implicitarg-num-bytes"="56"
-// CHECK-DAG: attributes [[WAVES_PER_EU_2]] = { convergent noinline nounwind optnone "amdgpu-implicitarg-num-bytes"="56" "amdgpu-waves-per-eu"="2"
-// CHECK-DAG: attributes [[WAVES_PER_EU_2_4]] = { convergent noinline nounwind optnone "amdgpu-implicitarg-num-bytes"="56" "amdgpu-waves-per-eu"="2,4"
-// CHECK-DAG: attributes [[NUM_SGPR_32]] = { convergent noinline nounwind optnone "amdgpu-implicitarg-num-bytes"="56" "amdgpu-num-sgpr"="32"
-// CHECK-DAG: attributes [[NUM_VGPR_64]] = { convergent noinline nounwind optnone "amdgpu-implicitarg-num-bytes"="56" "amdgpu-num-vgpr"="64"
+// CHECK-DAG: attributes [[FLAT_WORK_GROUP_SIZE_32_64]] = { convergent noinline nounwind optnone "amdgpu-flat-work-group-size"="32,64" "amdgpu-implicitarg-num-bytes"="56"
+// CHECK-DAG: attributes [[FLAT_WORK_GROUP_SIZE_64_64]] = { convergent noinline nounwind optnone "amdgpu-flat-work-group-size"="64,64" "amdgpu-implicitarg-num-bytes"="56"
+// CHECK-DAG: attributes [[FLAT_WORK_GROUP_SIZE_16_128]] = { convergent noinline nounwind optnone "amdgpu-flat-work-group-size"="16,128" "amdgpu-implicitarg-num-bytes"="56"
+
+// CHECK-DAG: attributes [[WAVES_PER_EU_2]] = { convergent noinline nounwind optnone "amdgpu-flat-work-group-size"="1,256" "amdgpu-implicitarg-num-bytes"="56" "amdgpu-waves-per-eu"="2"
+
+// CHECK-DAG: attributes [[WAVES_PER_EU_2_4]] = { convergent noinline nounwind optnone "amdgpu-flat-work-group-size"="1,256" "amdgpu-implicitarg-num-bytes"="56" "amdgpu-waves-per-eu"="2,4"
+// CHECK-DAG: attributes [[NUM_SGPR_32]] = { convergent noinline nounwind optnone "amdgpu-flat-work-group-size"="1,256" "amdgpu-implicitarg-num-bytes"="56" "amdgpu-num-sgpr"="32"
+// CHECK-DAG: attributes [[NUM_VGPR_64]] = { convergent noinline nounwind optnone "amdgpu-flat-work-group-size"="1,256" "amdgpu-implicitarg-num-bytes"="56" "amdgpu-num-vgpr"="64"
// CHECK-DAG: attributes [[FLAT_WORK_GROUP_SIZE_32_64_WAVES_PER_EU_2]] = { convergent noinline nounwind optnone "amdgpu-flat-work-group-size"="32,64" "amdgpu-implicitarg-num-bytes"="56" "amdgpu-waves-per-eu"="2"
// CHECK-DAG: attributes [[FLAT_WORK_GROUP_SIZE_32_64_WAVES_PER_EU_2_4]] = { convergent noinline nounwind optnone "amdgpu-flat-work-group-size"="32,64" "amdgpu-implicitarg-num-bytes"="56" "amdgpu-waves-per-eu"="2,4"
-// CHECK-DAG: attributes [[FLAT_WORK_GROUP_SIZE_32_64_NUM_SGPR_32]] = { convergent noinline nounwind optnone "amdgpu-flat-work-group-size"="32,64" "amdgpu-implicitarg-num-bytes"="56" "amdgpu-num-sgpr"="32"
-// CHECK-DAG: attributes [[FLAT_WORK_GROUP_SIZE_32_64_NUM_VGPR_64]] = { convergent noinline nounwind optnone "amdgpu-flat-work-group-size"="32,64" "amdgpu-implicitarg-num-bytes"="56" "amdgpu-num-vgpr"="64"
-// CHECK-DAG: attributes [[WAVES_PER_EU_2_NUM_SGPR_32]] = { convergent noinline nounwind optnone "amdgpu-implicitarg-num-bytes"="56" "amdgpu-num-sgpr"="32" "amdgpu-waves-per-eu"="2"
-// CHECK-DAG: attributes [[WAVES_PER_EU_2_NUM_VGPR_64]] = { convergent noinline nounwind optnone "amdgpu-implicitarg-num-bytes"="56" "amdgpu-num-vgpr"="64" "amdgpu-waves-per-eu"="2"
-// CHECK-DAG: attributes [[WAVES_PER_EU_2_4_NUM_SGPR_32]] = { convergent noinline nounwind optnone "amdgpu-implicitarg-num-bytes"="56" "amdgpu-num-sgpr"="32" "amdgpu-waves-per-eu"="2,4"
-// CHECK-DAG: attributes [[WAVES_PER_EU_2_4_NUM_VGPR_64]] = { convergent noinline nounwind optnone "amdgpu-implicitarg-num-bytes"="56" "amdgpu-num-vgpr"="64" "amdgpu-waves-per-eu"="2,4"
-// CHECK-DAG: attributes [[NUM_SGPR_32_NUM_VGPR_64]] = { convergent noinline nounwind optnone "amdgpu-implicitarg-num-bytes"="56" "amdgpu-num-sgpr"="32" "amdgpu-num-vgpr"="64"
+// CHECK-DAG: attributes [[FLAT_WORK_GROUP_SIZE_32_64_NUM_SGPR_32]] = { convergent noinline nounwind optnone "amdgpu-flat-work-group-size"="32,64" "amdgpu-implicitarg-num-bytes"="56" "amdgpu-num-sgpr"="32"
+// CHECK-DAG: attributes [[FLAT_WORK_GROUP_SIZE_32_64_NUM_VGPR_64]] = { convergent noinline nounwind optnone "amdgpu-flat-work-group-size"="32,64" "amdgpu-implicitarg-num-bytes"="56" "amdgpu-num-vgpr"="64"
+// CHECK-DAG: attributes [[WAVES_PER_EU_2_NUM_SGPR_32]] = { convergent noinline nounwind optnone "amdgpu-flat-work-group-size"="1,256" "amdgpu-implicitarg-num-bytes"="56" "amdgpu-num-sgpr"="32" "amdgpu-waves-per-eu"="2"
+// CHECK-DAG: attributes [[WAVES_PER_EU_2_NUM_VGPR_64]] = { convergent noinline nounwind optnone "amdgpu-flat-work-group-size"="1,256" "amdgpu-implicitarg-num-bytes"="56" "amdgpu-num-vgpr"="64" "amdgpu-waves-per-eu"="2"
+// CHECK-DAG: attributes [[WAVES_PER_EU_2_4_NUM_SGPR_32]] = { convergent noinline nounwind optnone "amdgpu-flat-work-group-size"="1,256" "amdgpu-implicitarg-num-bytes"="56" "amdgpu-num-sgpr"="32" "amdgpu-waves-per-eu"="2,4"
+// CHECK-DAG: attributes [[WAVES_PER_EU_2_4_NUM_VGPR_64]] = { convergent noinline nounwind optnone "amdgpu-flat-work-group-size"="1,256" "amdgpu-implicitarg-num-bytes"="56" "amdgpu-num-vgpr"="64" "amdgpu-waves-per-eu"="2,4"
+// CHECK-DAG: attributes [[NUM_SGPR_32_NUM_VGPR_64]] = { convergent noinline nounwind optnone "amdgpu-flat-work-group-size"="1,256" "amdgpu-implicitarg-num-bytes"="56" "amdgpu-num-sgpr"="32" "amdgpu-num-vgpr"="64"
// CHECK-DAG: attributes [[FLAT_WORK_GROUP_SIZE_32_64_WAVES_PER_EU_2_NUM_SGPR_32]] = { convergent noinline nounwind optnone "amdgpu-flat-work-group-size"="32,64" "amdgpu-implicitarg-num-bytes"="56" "amdgpu-num-sgpr"="32" "amdgpu-waves-per-eu"="2"
// CHECK-DAG: attributes [[FLAT_WORK_GROUP_SIZE_32_64_WAVES_PER_EU_2_NUM_VGPR_64]] = { convergent noinline nounwind optnone "amdgpu-flat-work-group-size"="32,64" "amdgpu-implicitarg-num-bytes"="56" "amdgpu-num-vgpr"="64" "amdgpu-waves-per-eu"="2"
@@ -185,3 +191,4 @@
// CHECK-DAG: attributes [[FLAT_WORK_GROUP_SIZE_32_64_WAVES_PER_EU_2_4_NUM_SGPR_32_NUM_VGPR_64]] = { convergent noinline nounwind optnone "amdgpu-flat-work-group-size"="32,64" "amdgpu-implicitarg-num-bytes"="56" "amdgpu-num-sgpr"="32" "amdgpu-num-vgpr"="64" "amdgpu-waves-per-eu"="2,4"
// CHECK-DAG: attributes [[A_FUNCTION]] = { convergent noinline nounwind optnone "correctly-rounded-divide-sqrt-fp-math"="false"
+// CHECK-DAG: attributes [[DEFAULT_KERNEL_ATTRS]] = { convergent noinline nounwind optnone "amdgpu-flat-work-group-size"="1,256" "amdgpu-implicitarg-num-bytes"="56"
diff --git a/src/llvm-project/clang/test/CodeGenOpenCL/amdgpu-enqueue-kernel.cl b/src/llvm-project/clang/test/CodeGenOpenCL/amdgpu-enqueue-kernel.cl
index 875c35c..4b989fa 100644
--- a/src/llvm-project/clang/test/CodeGenOpenCL/amdgpu-enqueue-kernel.cl
+++ b/src/llvm-project/clang/test/CodeGenOpenCL/amdgpu-enqueue-kernel.cl
@@ -36,7 +36,7 @@
enqueue_kernel(default_queue, flags, ndrange, block);
}
-// CHECK-LABEL: define internal amdgpu_kernel void @__test_block_invoke_kernel(<{ i32, i32, i8*, i8 addrspace(1)*, i8 }>)
+// CHECK-LABEL: define internal amdgpu_kernel void @__test_block_invoke_kernel(<{ i32, i32, i8*, i8 addrspace(1)*, i8 }> %0)
// CHECK-SAME: #[[ATTR:[0-9]+]] !kernel_arg_addr_space !{{.*}} !kernel_arg_access_qual !{{.*}} !kernel_arg_type !{{.*}} !kernel_arg_base_type !{{.*}} !kernel_arg_type_qual !{{.*}}
// CHECK: entry:
// CHECK: %1 = alloca <{ i32, i32, i8*, i8 addrspace(1)*, i8 }>, align 8, addrspace(5)
@@ -46,13 +46,13 @@
// CHECK: ret void
// CHECK:}
-// CHECK-LABEL: define internal amdgpu_kernel void @__test_block_invoke_2_kernel(<{ i32, i32, i8*, i8 addrspace(1)*, i64 addrspace(1)*, i64, i8 }>)
+// CHECK-LABEL: define internal amdgpu_kernel void @__test_block_invoke_2_kernel(<{ i32, i32, i8*, i8 addrspace(1)*, i64 addrspace(1)*, i64, i8 }> %0)
// CHECK-SAME: #[[ATTR]] !kernel_arg_addr_space !{{.*}} !kernel_arg_access_qual !{{.*}} !kernel_arg_type !{{.*}} !kernel_arg_base_type !{{.*}} !kernel_arg_type_qual !{{.*}}
-// CHECK-LABEL: define internal amdgpu_kernel void @__test_block_invoke_3_kernel(<{ i32, i32, i8*, i8 addrspace(1)*, i64 addrspace(1)*, i64, i8 }>, i8 addrspace(3)*)
+// CHECK-LABEL: define internal amdgpu_kernel void @__test_block_invoke_3_kernel(<{ i32, i32, i8*, i8 addrspace(1)*, i64 addrspace(1)*, i64, i8 }> %0, i8 addrspace(3)* %1)
// CHECK-SAME: #[[ATTR]] !kernel_arg_addr_space !{{.*}} !kernel_arg_access_qual !{{.*}} !kernel_arg_type !{{.*}} !kernel_arg_base_type !{{.*}} !kernel_arg_type_qual !{{.*}}
-// CHECK-LABEL: define internal amdgpu_kernel void @__test_block_invoke_4_kernel(<{ i32, i32, i8*, i64, i64 addrspace(1)* }>)
+// CHECK-LABEL: define internal amdgpu_kernel void @__test_block_invoke_4_kernel(<{ i32, i32, i8*, i64, i64 addrspace(1)* }> %0)
// CHECK-SAME: #[[ATTR]] !kernel_arg_addr_space !{{.*}} !kernel_arg_access_qual !{{.*}} !kernel_arg_type !{{.*}} !kernel_arg_base_type !{{.*}} !kernel_arg_type_qual !{{.*}}
// CHECK: attributes #[[ATTR]] = { nounwind "enqueued-block" }
diff --git a/src/llvm-project/clang/test/CodeGenOpenCL/amdgpu-features.cl b/src/llvm-project/clang/test/CodeGenOpenCL/amdgpu-features.cl
index 0bb3d6f..fdc8f40 100644
--- a/src/llvm-project/clang/test/CodeGenOpenCL/amdgpu-features.cl
+++ b/src/llvm-project/clang/test/CodeGenOpenCL/amdgpu-features.cl
@@ -14,14 +14,14 @@
// RUN: %clang_cc1 -triple amdgcn -target-cpu gfx600 -S -emit-llvm -o - %s | FileCheck --check-prefix=GFX600 %s
// RUN: %clang_cc1 -triple amdgcn -target-cpu gfx601 -S -emit-llvm -o - %s | FileCheck --check-prefix=GFX601 %s
-// GFX904: "target-features"="+16-bit-insts,+ci-insts,+dpp,+fp32-denormals,+fp64-fp16-denormals,+gfx8-insts,+gfx9-insts,+s-memrealtime"
-// GFX906: "target-features"="+16-bit-insts,+ci-insts,+dl-insts,+dot1-insts,+dot2-insts,+dpp,+fp32-denormals,+fp64-fp16-denormals,+gfx8-insts,+gfx9-insts,+s-memrealtime"
-// GFX908: "target-features"="+16-bit-insts,+ci-insts,+dl-insts,+dot1-insts,+dot2-insts,+dot3-insts,+dot4-insts,+dot5-insts,+dot6-insts,+dpp,+fp32-denormals,+fp64-fp16-denormals,+gfx8-insts,+gfx9-insts,+s-memrealtime"
-// GFX1010: "target-features"="+16-bit-insts,+ci-insts,+dl-insts,+dpp,+fp32-denormals,+fp64-fp16-denormals,+gfx10-insts,+gfx8-insts,+gfx9-insts,+s-memrealtime"
-// GFX1011: "target-features"="+16-bit-insts,+ci-insts,+dl-insts,+dot1-insts,+dot2-insts,+dot5-insts,+dot6-insts,+dpp,+fp32-denormals,+fp64-fp16-denormals,+gfx10-insts,+gfx8-insts,+gfx9-insts,+s-memrealtime"
-// GFX1012: "target-features"="+16-bit-insts,+ci-insts,+dl-insts,+dot1-insts,+dot2-insts,+dot5-insts,+dot6-insts,+dpp,+fp32-denormals,+fp64-fp16-denormals,+gfx10-insts,+gfx8-insts,+gfx9-insts,+s-memrealtime"
-// GFX801: "target-features"="+16-bit-insts,+ci-insts,+dpp,+fp32-denormals,+fp64-fp16-denormals,+gfx8-insts,+s-memrealtime"
-// GFX700: "target-features"="+ci-insts,+fp64-fp16-denormals,-fp32-denormals"
+// GFX904: "target-features"="+16-bit-insts,+ci-insts,+dpp,+flat-address-space,+fp32-denormals,+fp64-fp16-denormals,+gfx8-insts,+gfx9-insts,+s-memrealtime"
+// GFX906: "target-features"="+16-bit-insts,+ci-insts,+dl-insts,+dot1-insts,+dot2-insts,+dpp,+flat-address-space,+fp32-denormals,+fp64-fp16-denormals,+gfx8-insts,+gfx9-insts,+s-memrealtime"
+// GFX908: "target-features"="+16-bit-insts,+ci-insts,+dl-insts,+dot1-insts,+dot2-insts,+dot3-insts,+dot4-insts,+dot5-insts,+dot6-insts,+dpp,+flat-address-space,+fp32-denormals,+fp64-fp16-denormals,+gfx8-insts,+gfx9-insts,+s-memrealtime"
+// GFX1010: "target-features"="+16-bit-insts,+ci-insts,+dl-insts,+dpp,+flat-address-space,+fp32-denormals,+fp64-fp16-denormals,+gfx10-insts,+gfx8-insts,+gfx9-insts,+s-memrealtime"
+// GFX1011: "target-features"="+16-bit-insts,+ci-insts,+dl-insts,+dot1-insts,+dot2-insts,+dot5-insts,+dot6-insts,+dpp,+flat-address-space,+fp32-denormals,+fp64-fp16-denormals,+gfx10-insts,+gfx8-insts,+gfx9-insts,+s-memrealtime"
+// GFX1012: "target-features"="+16-bit-insts,+ci-insts,+dl-insts,+dot1-insts,+dot2-insts,+dot5-insts,+dot6-insts,+dpp,+flat-address-space,+fp32-denormals,+fp64-fp16-denormals,+gfx10-insts,+gfx8-insts,+gfx9-insts,+s-memrealtime"
+// GFX801: "target-features"="+16-bit-insts,+ci-insts,+dpp,+flat-address-space,+fp32-denormals,+fp64-fp16-denormals,+gfx8-insts,+s-memrealtime"
+// GFX700: "target-features"="+ci-insts,+flat-address-space,+fp64-fp16-denormals,-fp32-denormals"
// GFX600: "target-features"="+fp64-fp16-denormals,-fp32-denormals"
// GFX601: "target-features"="+fp64-fp16-denormals,-fp32-denormals"
diff --git a/src/llvm-project/clang/test/CodeGenOpenCL/builtins-amdgcn-ci.cl b/src/llvm-project/clang/test/CodeGenOpenCL/builtins-amdgcn-ci.cl
index f6fcfa5..b3bf368 100644
--- a/src/llvm-project/clang/test/CodeGenOpenCL/builtins-amdgcn-ci.cl
+++ b/src/llvm-project/clang/test/CodeGenOpenCL/builtins-amdgcn-ci.cl
@@ -1,8 +1,8 @@
// REQUIRES: amdgpu-registered-target
-// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu hawaii -S -emit-llvm -o - %s | FileCheck %s
-// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu fiji -S -emit-llvm -o - %s | FileCheck %s
-// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu gfx906 -S -emit-llvm -o - %s | FileCheck %s
-// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu gfx1010 -S -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -cl-std=CL2.0 -O0 -triple amdgcn-unknown-unknown -target-cpu hawaii -S -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -cl-std=CL2.0 -O0 -triple amdgcn-unknown-unknown -target-cpu fiji -S -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -cl-std=CL2.0 -O0 -triple amdgcn-unknown-unknown -target-cpu gfx906 -S -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -cl-std=CL2.0 -O0 -triple amdgcn-unknown-unknown -target-cpu gfx1010 -S -emit-llvm -o - %s | FileCheck %s
typedef unsigned int uint;
@@ -21,8 +21,36 @@
}
// CHECK-LABEL: @test_gws_sema_release_all(
-// CHECK: call void @llvm.amdgcn.ds.gws.sema.release.all(i32 %id)
+// CHECK: call void @llvm.amdgcn.ds.gws.sema.release.all(i32 %{{[0-9]+}})
void test_gws_sema_release_all(uint id)
{
__builtin_amdgcn_ds_gws_sema_release_all(id);
}
+
+// CHECK-LABEL: @test_is_shared(
+// CHECK: [[CAST:%[0-9]+]] = bitcast i32* %{{[0-9]+}} to i8*
+// CHECK: call i1 @llvm.amdgcn.is.shared(i8* [[CAST]]
+int test_is_shared(const int* ptr) {
+ return __builtin_amdgcn_is_shared(ptr);
+}
+
+// CHECK-LABEL: @test_is_private(
+// CHECK: [[CAST:%[0-9]+]] = bitcast i32* %{{[0-9]+}} to i8*
+// CHECK: call i1 @llvm.amdgcn.is.private(i8* [[CAST]]
+int test_is_private(const int* ptr) {
+ return __builtin_amdgcn_is_private(ptr);
+}
+
+// CHECK-LABEL: @test_is_shared_global(
+// CHECK: [[CAST:%[0-9]+]] = addrspacecast i32 addrspace(1)* %{{[0-9]+}} to i8*
+// CHECK: call i1 @llvm.amdgcn.is.shared(i8* [[CAST]]
+int test_is_shared_global(const global int* ptr) {
+ return __builtin_amdgcn_is_shared(ptr);
+}
+
+// CHECK-LABEL: @test_is_private_global(
+// CHECK: [[CAST:%[0-9]+]] = addrspacecast i32 addrspace(1)* %{{[0-9]+}} to i8*
+// CHECK: call i1 @llvm.amdgcn.is.private(i8* [[CAST]]
+int test_is_private_global(const global int* ptr) {
+ return __builtin_amdgcn_is_private(ptr);
+}
diff --git a/src/llvm-project/clang/test/CodeGenOpenCL/builtins-amdgcn.cl b/src/llvm-project/clang/test/CodeGenOpenCL/builtins-amdgcn.cl
index bbae5ea..6cda2a7 100644
--- a/src/llvm-project/clang/test/CodeGenOpenCL/builtins-amdgcn.cl
+++ b/src/llvm-project/clang/test/CodeGenOpenCL/builtins-amdgcn.cl
@@ -9,6 +9,7 @@
typedef half __attribute__((ext_vector_type(2))) half2;
typedef short __attribute__((ext_vector_type(2))) short2;
typedef ushort __attribute__((ext_vector_type(2))) ushort2;
+typedef uint __attribute__((ext_vector_type(4))) uint4;
// CHECK-LABEL: @test_div_scale_f64
// CHECK: call { double, i1 } @llvm.amdgcn.div.scale.f64(double %a, double %b, i1 true)
@@ -654,6 +655,48 @@
*out = __builtin_amdgcn_cvt_pk_u8_f32(src0, src1, src2);
}
+// CHECK-LABEL: @test_sad_u8(
+// CHECK: tail call i32 @llvm.amdgcn.sad.u8(i32 %src0, i32 %src1, i32 %src2)
+kernel void test_sad_u8(global uint* out, uint src0, uint src1, uint src2) {
+ *out = __builtin_amdgcn_sad_u8(src0, src1, src2);
+}
+
+// CHECK-LABEL: test_msad_u8(
+// CHECK: call i32 @llvm.amdgcn.msad.u8(i32 %src0, i32 %src1, i32 %src2)
+kernel void test_msad_u8(global uint* out, uint src0, uint src1, uint src2) {
+ *out = __builtin_amdgcn_msad_u8(src0, src1, src2);
+}
+
+// CHECK-LABEL: test_sad_hi_u8(
+// CHECK: call i32 @llvm.amdgcn.sad.hi.u8(i32 %src0, i32 %src1, i32 %src2)
+kernel void test_sad_hi_u8(global uint* out, uint src0, uint src1, uint src2) {
+ *out = __builtin_amdgcn_sad_hi_u8(src0, src1, src2);
+}
+
+// CHECK-LABEL: @test_sad_u16(
+// CHECK: call i32 @llvm.amdgcn.sad.u16(i32 %src0, i32 %src1, i32 %src2)
+kernel void test_sad_u16(global uint* out, uint src0, uint src1, uint src2) {
+ *out = __builtin_amdgcn_sad_u16(src0, src1, src2);
+}
+
+// CHECK-LABEL: @test_qsad_pk_u16_u8(
+// CHECK: call i64 @llvm.amdgcn.qsad.pk.u16.u8(i64 %src0, i32 %src1, i64 %src2)
+kernel void test_qsad_pk_u16_u8(global ulong* out, ulong src0, uint src1, ulong src2) {
+ *out = __builtin_amdgcn_qsad_pk_u16_u8(src0, src1, src2);
+}
+
+// CHECK-LABEL: @test_mqsad_pk_u16_u8(
+// CHECK: call i64 @llvm.amdgcn.mqsad.pk.u16.u8(i64 %src0, i32 %src1, i64 %src2)
+kernel void test_mqsad_pk_u16_u8(global ulong* out, ulong src0, uint src1, ulong src2) {
+ *out = __builtin_amdgcn_mqsad_pk_u16_u8(src0, src1, src2);
+}
+
+// CHECK-LABEL: test_mqsad_u32_u8(
+// CHECK: call <4 x i32> @llvm.amdgcn.mqsad.u32.u8(i64 %src0, i32 %src1, <4 x i32> %src2)
+kernel void test_mqsad_u32_u8(global uint4* out, ulong src0, uint src1, uint4 src2) {
+ *out = __builtin_amdgcn_mqsad_u32_u8(src0, src1, src2);
+}
+
// CHECK-DAG: [[$WI_RANGE]] = !{i32 0, i32 1024}
// CHECK-DAG: attributes #[[$NOUNWIND_READONLY:[0-9]+]] = { nounwind readonly }
// CHECK-DAG: attributes #[[$READ_EXEC_ATTRS]] = { convergent }
diff --git a/src/llvm-project/clang/test/CodeGenOpenCL/builtins-f16.cl b/src/llvm-project/clang/test/CodeGenOpenCL/builtins-f16.cl
new file mode 100644
index 0000000..4aef2c2
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenOpenCL/builtins-f16.cl
@@ -0,0 +1,71 @@
+// RUN: %clang_cc1 -emit-llvm -o - -triple x86_64-darwin-apple %s | FileCheck %s
+
+#pragma OPENCL EXTENSION cl_khr_fp16 : enable
+
+// CHECK-LABEL: define void @test_half_builtins
+void test_half_builtins(half h0, half h1, half h2) {
+ volatile half res;
+
+ // CHECK: call half @llvm.copysign.f16(half %h0, half %h1)
+ res = __builtin_copysignf16(h0, h1);
+
+ // CHECK: call half @llvm.fabs.f16(half %h0)
+ res = __builtin_fabsf16(h0);
+
+ // CHECK: call half @llvm.ceil.f16(half %h0)
+ res = __builtin_ceilf16(h0);
+
+ // CHECK: call half @llvm.cos.f16(half %h0)
+ res = __builtin_cosf16(h0);
+
+ // CHECK: call half @llvm.exp.f16(half %h0)
+ res = __builtin_expf16(h0);
+
+ // CHECK: call half @llvm.exp2.f16(half %h0)
+ res = __builtin_exp2f16(h0);
+
+ // CHECK: call half @llvm.floor.f16(half %h0)
+ res = __builtin_floorf16(h0);
+
+ // CHECK: call half @llvm.fma.f16(half %h0, half %h1, half %h2)
+ res = __builtin_fmaf16(h0, h1 ,h2);
+
+ // CHECK: call half @llvm.maxnum.f16(half %h0, half %h1)
+ res = __builtin_fmaxf16(h0, h1);
+
+ // CHECK: call half @llvm.minnum.f16(half %h0, half %h1)
+ res = __builtin_fminf16(h0, h1);
+
+ // CHECK: frem half %h0, %h1
+ res = __builtin_fmodf16(h0, h1);
+
+ // CHECK: call half @llvm.pow.f16(half %h0, half %h1)
+ res = __builtin_powf16(h0, h1);
+
+ // CHECK: call half @llvm.log10.f16(half %h0)
+ res = __builtin_log10f16(h0);
+
+ // CHECK: call half @llvm.log2.f16(half %h0)
+ res = __builtin_log2f16(h0);
+
+ // CHECK: call half @llvm.log.f16(half %h0)
+ res = __builtin_logf16(h0);
+
+ // CHECK: call half @llvm.rint.f16(half %h0)
+ res = __builtin_rintf16(h0);
+
+ // CHECK: call half @llvm.round.f16(half %h0)
+ res = __builtin_roundf16(h0);
+
+ // CHECK: call half @llvm.sin.f16(half %h0)
+ res = __builtin_sinf16(h0);
+
+ // CHECK: call half @llvm.sqrt.f16(half %h0)
+ res = __builtin_sqrtf16(h0);
+
+ // CHECK: call half @llvm.trunc.f16(half %h0)
+ res = __builtin_truncf16(h0);
+
+ // CHECK: call half @llvm.canonicalize.f16(half %h0)
+ res = __builtin_canonicalizef16(h0);
+}
diff --git a/src/llvm-project/clang/test/CodeGenOpenCL/builtins-generic-amdgcn.cl b/src/llvm-project/clang/test/CodeGenOpenCL/builtins-generic-amdgcn.cl
index 5a4756b..993b0bb 100644
--- a/src/llvm-project/clang/test/CodeGenOpenCL/builtins-generic-amdgcn.cl
+++ b/src/llvm-project/clang/test/CodeGenOpenCL/builtins-generic-amdgcn.cl
@@ -14,3 +14,8 @@
{
*out = __builtin_clzl(a);
}
+
+// CHECK: tail call i8 addrspace(5)* @llvm.frameaddress.p5i8(i32 0)
+void test_builtin_frame_address(int *out) {
+ *out = __builtin_frame_address(0);
+}
diff --git a/src/llvm-project/clang/test/CodeGenOpenCL/cl20-device-side-enqueue.cl b/src/llvm-project/clang/test/CodeGenOpenCL/cl20-device-side-enqueue.cl
index 4abeb92..d33e362 100644
--- a/src/llvm-project/clang/test/CodeGenOpenCL/cl20-device-side-enqueue.cl
+++ b/src/llvm-project/clang/test/CodeGenOpenCL/cl20-device-side-enqueue.cl
@@ -402,7 +402,7 @@
size = get_kernel_sub_group_count_for_ndrange(ndrange, ^(){});
}
-// COMMON: define internal spir_kernel void [[INVLK1]](i8 addrspace(4)*) #{{[0-9]+}} {
+// COMMON: define internal spir_kernel void [[INVLK1]](i8 addrspace(4)* %0) #{{[0-9]+}} {
// COMMON: entry:
// COMMON: call void @__device_side_enqueue_block_invoke(i8 addrspace(4)* %0)
// COMMON: ret void
@@ -413,7 +413,7 @@
// COMMON: define internal spir_kernel void [[INVGK3]](i8 addrspace(4)*{{.*}}, i8 addrspace(3)*{{.*}})
// COMMON: define internal spir_kernel void [[INVGK4]](i8 addrspace(4)*{{.*}}, i8 addrspace(3)*{{.*}})
// COMMON: define internal spir_kernel void [[INVGK5]](i8 addrspace(4)*{{.*}}, i8 addrspace(3)*{{.*}})
-// COMMON: define internal spir_kernel void [[INVGK6]](i8 addrspace(4)*, i8 addrspace(3)*, i8 addrspace(3)*, i8 addrspace(3)*) #{{[0-9]+}} {
+// COMMON: define internal spir_kernel void [[INVGK6]](i8 addrspace(4)* %0, i8 addrspace(3)* %1, i8 addrspace(3)* %2, i8 addrspace(3)* %3) #{{[0-9]+}} {
// COMMON: entry:
// COMMON: call void @__device_side_enqueue_block_invoke_9(i8 addrspace(4)* %0, i8 addrspace(3)* %1, i8 addrspace(3)* %2, i8 addrspace(3)* %3)
// COMMON: ret void
diff --git a/src/llvm-project/clang/test/CodeGenOpenCL/fdeclare-opencl-builtins.cl b/src/llvm-project/clang/test/CodeGenOpenCL/fdeclare-opencl-builtins.cl
new file mode 100644
index 0000000..64f2d89
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenOpenCL/fdeclare-opencl-builtins.cl
@@ -0,0 +1,29 @@
+// RUN: %clang_cc1 -emit-llvm -o - -O0 -triple spir-unknown-unknown -fdeclare-opencl-builtins -finclude-default-header %s | FileCheck %s
+
+// Test that Attr.Const from OpenCLBuiltins.td is lowered to a readnone attribute.
+// CHECK-LABEL: @test_const_attr
+// CHECK: call i32 @_Z3maxii({{.*}}) [[ATTR_CONST:#[0-9]]]
+// CHECK: ret
+int test_const_attr(int a) {
+ return max(a, 2);
+}
+
+// Test that Attr.Pure from OpenCLBuiltins.td is lowered to a readonly attribute.
+// CHECK-LABEL: @test_pure_attr
+// CHECK: call <4 x float> @_Z11read_imagef{{.*}} [[ATTR_PURE:#[0-9]]]
+// CHECK: ret
+kernel void test_pure_attr(read_only image1d_t img) {
+ float4 resf = read_imagef(img, 42);
+}
+
+// Test that builtins with only one prototype are mangled.
+// CHECK-LABEL: @test_mangling
+// CHECK: call i32 @_Z12get_local_idj
+kernel void test_mangling() {
+ size_t lid = get_local_id(0);
+}
+
+// CHECK: attributes [[ATTR_CONST]] =
+// CHECK-SAME: readnone
+// CHECK: attributes [[ATTR_PURE]] =
+// CHECK-SAME: readonly
diff --git a/src/llvm-project/clang/test/CodeGenOpenCLCXX/address-space-deduction.cl b/src/llvm-project/clang/test/CodeGenOpenCLCXX/address-space-deduction.cl
index a6ae5af..58502e9 100644
--- a/src/llvm-project/clang/test/CodeGenOpenCLCXX/address-space-deduction.cl
+++ b/src/llvm-project/clang/test/CodeGenOpenCLCXX/address-space-deduction.cl
@@ -12,17 +12,15 @@
//COMMON: @glob = addrspace(1) global i32
int glob;
//PTR: @glob_p = addrspace(1) global i32 addrspace(4)* addrspacecast (i32 addrspace(1)* @glob to i32 addrspace(4)*)
-//REF: @glob_p = addrspace(1) global i32 addrspace(4)* null
+//REF: @glob_p = addrspace(1) constant i32 addrspace(4)* addrspacecast (i32 addrspace(1)* @glob to i32 addrspace(4)*)
int PTR glob_p = ADR(glob);
//COMMON: @_ZZ3fooi{{P|R}}U3AS4iE6loc_st = internal addrspace(1) global i32
//PTR: @_ZZ3fooiPU3AS4iE8loc_st_p = internal addrspace(1) global i32 addrspace(4)* addrspacecast (i32 addrspace(1)* @_ZZ3fooiPU3AS4iE6loc_st to i32 addrspace(4)*)
-//REF: @_ZZ3fooiRU3AS4iE8loc_st_p = internal addrspace(1) global i32 addrspace(4)* null
+//REF: @_ZZ3fooiRU3AS4iE8loc_st_p = internal addrspace(1) constant i32 addrspace(4)* addrspacecast (i32 addrspace(1)* @_ZZ3fooiRU3AS4iE6loc_st to i32 addrspace(4)*)
//COMMON: @loc_ext_p = external addrspace(1) {{global|constant}} i32 addrspace(4)*
//COMMON: @loc_ext = external addrspace(1) global i32
-//REF: store i32 addrspace(4)* addrspacecast (i32 addrspace(1)* @glob to i32 addrspace(4)*), i32 addrspace(4)* addrspace(1)* @glob_p
-
//COMMON: define spir_func i32 @_Z3fooi{{P|R}}U3AS4i(i32 %par, i32 addrspace(4)*{{.*}} %par_p)
int foo(int par, int PTR par_p){
//COMMON: %loc = alloca i32
@@ -37,7 +35,6 @@
// CHECK directives for the following code are located above.
static int loc_st;
- //REF: store i32 addrspace(4)* addrspacecast (i32 addrspace(1)* @_ZZ3fooiRU3AS4iE6loc_st to i32 addrspace(4)*), i32 addrspace(4)* addrspace(1)* @_ZZ3fooiRU3AS4iE8loc_st_p
static int PTR loc_st_p = ADR(loc_st);
extern int loc_ext;
extern int PTR loc_ext_p;
diff --git a/src/llvm-project/clang/test/CodeGenOpenCLCXX/addrspace-derived-base.cl b/src/llvm-project/clang/test/CodeGenOpenCLCXX/addrspace-derived-base.cl
index 916bb50..623d201 100644
--- a/src/llvm-project/clang/test/CodeGenOpenCLCXX/addrspace-derived-base.cl
+++ b/src/llvm-project/clang/test/CodeGenOpenCLCXX/addrspace-derived-base.cl
@@ -11,6 +11,7 @@
void foo() {
D d;
+ //CHECK-LABEL: foo
//CHECK: addrspacecast %class.D* %d to %class.D addrspace(4)*
//CHECK: call spir_func i32 @_ZNU3AS41D5getmbEv(%class.D addrspace(4)*
d.getmb();
@@ -20,3 +21,62 @@
//CHECK: define linkonce_odr spir_func i32 @_ZNU3AS41D5getmbEv(%class.D addrspace(4)* %this)
//CHECK: bitcast %class.D addrspace(4)* %this1 to %struct.B addrspace(4)*
+
+
+// Calling base method through multiple inheritance.
+
+class B2 {
+ public:
+ void baseMethod() const { }
+ int &getRef() { return bb; }
+ int bb;
+};
+
+class Derived : public B, public B2 {
+ public:
+ void work() const { baseMethod(); }
+ // CHECK-LABEL: work
+ // CHECK: bitcast i8 addrspace(4)* %add.ptr to %class.B2 addrspace(4)*
+};
+
+void pr43145(const Derived *argDerived) {
+ argDerived->work();
+}
+
+// Casting from base to derived.
+
+void pr43145_2(B *argB) {
+ Derived *x = (Derived*)argB;
+ // CHECK-LABEL: @_Z9pr43145_2
+ // CHECK: bitcast %struct.B addrspace(4)* %0 to %class.Derived addrspace(4)*
+}
+
+// Assigning to reference returned by base class method through derived class.
+
+void pr43145_3(int n) {
+ Derived d;
+ d.getRef() = n;
+
+ // CHECK-LABEL: @_Z9pr43145_3
+ // CHECK: addrspacecast %class.Derived* %d to %class.Derived addrspace(4)*
+ // CHECK: bitcast i8 addrspace(4)* %add.ptr to %class.B2 addrspace(4)*
+ // CHECK: call {{.*}} @_ZNU3AS42B26getRefEv
+
+ private Derived *pd = &d;
+ pd->getRef() = n;
+
+ // CHECK: addrspacecast %class.Derived* %4 to %class.Derived addrspace(4)*
+ // CHECK: bitcast i8 addrspace(4)* %add.ptr1 to %class.B2 addrspace(4)*
+ // CHECK: call {{.*}} @_ZNU3AS42B26getRefEv
+}
+
+// Implicit conversion of derived to base.
+
+void functionWithBaseArgPtr(class B2 *b) {}
+void functionWithBaseArgRef(class B2 &b) {}
+
+void pr43145_4() {
+ Derived d;
+ functionWithBaseArgPtr(&d);
+ functionWithBaseArgRef(d);
+}
diff --git a/src/llvm-project/clang/test/CodeGenOpenCLCXX/addrspace-of-this.cl b/src/llvm-project/clang/test/CodeGenOpenCLCXX/addrspace-of-this.cl
index 8a282ac..07e3b0b 100644
--- a/src/llvm-project/clang/test/CodeGenOpenCLCXX/addrspace-of-this.cl
+++ b/src/llvm-project/clang/test/CodeGenOpenCLCXX/addrspace-of-this.cl
@@ -174,7 +174,7 @@
TEST(__private)
-// CHECK-LABEL: @test__private
+// COMMON-LABEL: @test__private
// Test the address space of 'this' when invoking a constructor for an object in non-default address space
// EXPL: [[CGEN:%[.a-z0-9]+]] = addrspacecast %class.C* %c to %class.C addrspace(4)*
@@ -203,3 +203,14 @@
// IMPL: [[C2GENVOID:%[0-9]+]] = bitcast %class.C addrspace(4)* [[C2GEN]] to i8 addrspace(4)*
// IMPL: [[C1GENVOID:%[0-9]+]] = bitcast %class.C addrspace(4)* [[C1GEN]] to i8 addrspace(4)*
// IMPL: call void @llvm.memcpy.p4i8.p4i8.i32(i8 addrspace(4)* {{.*}}[[C2GENVOID]], i8 addrspace(4)* {{.*}}[[C1GENVOID]]
+
+// Test that calling a const method from a non-const method does not crash Clang.
+class ConstAndNonConstMethod {
+public:
+ void DoConst() const {
+ }
+
+ void DoNonConst() {
+ DoConst();
+ }
+};
diff --git a/src/llvm-project/clang/test/CodeGenOpenCLCXX/constexpr.cl b/src/llvm-project/clang/test/CodeGenOpenCLCXX/constexpr.cl
new file mode 100644
index 0000000..8c3fad0
--- /dev/null
+++ b/src/llvm-project/clang/test/CodeGenOpenCLCXX/constexpr.cl
@@ -0,0 +1,54 @@
+// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=clc++ -O0 -emit-llvm -o - | FileCheck %s
+
+typedef int int2 __attribute__((ext_vector_type(2)));
+typedef int int4 __attribute__((ext_vector_type(4)));
+
+struct Storage final {
+ constexpr const float& operator[](const int index) const noexcept {
+ return InternalStorage[index];
+ }
+
+ const float InternalStorage[1];
+};
+
+constexpr Storage getStorage() {
+ return Storage{{1.0f}};
+}
+
+constexpr float compute() {
+ constexpr auto s = getStorage();
+ return 2.0f / (s[0]);
+}
+
+constexpr float FloatConstant = compute();
+
+// CHECK-LABEL: define spir_kernel void @foo
+// CHECK: store float 2.000000e+00
+kernel void foo(global float *x) {
+ *x = FloatConstant;
+}
+
+// Test evaluation of constant vectors.
+// CHECK-LABEL: define spir_kernel void @vecEval
+// CHECK: store i32 3
+// CHECK: store <2 x i32> <i32 22, i32 33>, <2 x i32>
+
+const int oneElt = int4(3).x;
+const int2 twoElts = (int4)(11, 22, 33, 44).yz;
+
+kernel void vecEval(global int *x, global int2 *y) {
+ *x = oneElt;
+ *y = twoElts;
+}
+
+// Test evaluation of vectors initialized through a constexpr function.
+// CHECK-LABEL: define spir_kernel void @vecEval2
+// CHECK: store <2 x i32>
+constexpr int2 addOne(int2 x) {
+ return (int2)(x.x + 1, x.y + 1);
+}
+const int2 fromConstexprFunc = addOne(int2(2));
+
+kernel void vecEval2(global int2 *x) {
+ *x = fromConstexprFunc;
+}
diff --git a/src/llvm-project/clang/test/CoverageMapping/abspath.cpp b/src/llvm-project/clang/test/CoverageMapping/abspath.cpp
index 4b92a37..892dff8 100644
--- a/src/llvm-project/clang/test/CoverageMapping/abspath.cpp
+++ b/src/llvm-project/clang/test/CoverageMapping/abspath.cpp
@@ -9,7 +9,7 @@
// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -emit-llvm -main-file-name abspath.cpp ../test/f1.c -o - | FileCheck -check-prefix=RELPATH %s
// RELPATH: @__llvm_coverage_mapping = {{.*}}"\01
-// RELPATH: {{[/\\]}}{{.*}}{{[/\\][^/\\]*}}test{{[/\\][^/\\]*}}f1.c
+// RELPATH: {{[/\\].*(/|\\\\)test(/|\\\\)f1}}.c
// RELPATH: "
void f1() {}
diff --git a/src/llvm-project/clang/test/CoverageMapping/macro-stringize-twice.cpp b/src/llvm-project/clang/test/CoverageMapping/macro-stringize-twice.cpp
new file mode 100644
index 0000000..7a91d91
--- /dev/null
+++ b/src/llvm-project/clang/test/CoverageMapping/macro-stringize-twice.cpp
@@ -0,0 +1,30 @@
+// RUN: %clang_cc1 -triple %itanium_abi_triple -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only %s | FileCheck %s
+
+// PR39942
+
+class a;
+template <class b> a &operator<<(b &, const char *);
+int c;
+#define d(l) l(__FILE__, __LINE__, c)
+#define COMPACT_GOOGLE_LOG_ERROR d(e)
+#define f(g, cond) cond ? (void)0 : h() & g
+#define i(j) COMPACT_GOOGLE_LOG_##j.g()
+#define k(j) f(i(j), 0)
+class e {
+public:
+ e(const char *, int, int);
+ a &g();
+};
+class h {
+public:
+ void operator&(a &);
+};
+void use_str(const char *);
+
+#define m(func) \
+ use_str(#func); \
+ k(ERROR) << #func; \
+ return 0; // CHECK: File 1, [[@LINE-1]]:4 -> [[@LINE-1]]:16 = (#0 - #1)
+int main() {
+ m(asdf);
+}
diff --git a/src/llvm-project/clang/test/CoverageMapping/switch.cpp b/src/llvm-project/clang/test/CoverageMapping/switch.cpp
index 30c6492..25ea405 100644
--- a/src/llvm-project/clang/test/CoverageMapping/switch.cpp
+++ b/src/llvm-project/clang/test/CoverageMapping/switch.cpp
@@ -2,11 +2,11 @@
// CHECK: foo
void foo(int i) { // CHECK-NEXT: File 0, [[@LINE]]:17 -> [[@LINE+8]]:2 = #0
- switch(i) {
+ switch(i) { // CHECK-NEXT: Gap,File 0, [[@LINE]]:13 -> [[@LINE+4]]:10 = 0
case 1: // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE+1]]:11 = #2
return;
case 2: // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE+1]]:10 = #3
- break; // CHECK-NEXT: File 0, [[@LINE]]:10 -> [[@LINE+2]]:3 = #1
+ break; // CHECK-NEXT: Gap,File 0, [[@LINE]]:10 -> [[@LINE+2]]:3 = #1
}
int x = 0; // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE+1]]:2 = #1
}
@@ -29,7 +29,7 @@
nop();
switch (i) { // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE+6]]:2 = #4
- nop(); // CHECK-NEXT: File 0, [[@LINE]]:5 -> [[@LINE+2]]:10 = 0
+ nop(); // CHECK-NEXT: Gap,File 0, [[@LINE-1]]:14 -> [[@LINE+2]]:10 = 0
case 1: // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE+1]]:10 = #7
nop();
}
@@ -47,7 +47,7 @@
// CHECK-NEXT: main
int main() { // CHECK-NEXT: File 0, [[@LINE]]:12 -> [[@LINE+35]]:2 = #0
int i = 0;
- switch(i) {
+ switch(i) { // CHECK-NEXT: Gap,File 0, [[@LINE]]:13 -> [[@LINE+8]]:10 = 0
case 0: // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE+2]]:10 = #2
i = 1;
break;
@@ -58,16 +58,16 @@
break; // CHECK-NEXT: File 0, [[@LINE]]:10 -> [[@LINE+2]]:3 = #1
}
switch(i) { // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE+23]]:2 = #1
- case 0: // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE+2]]:10 = #6
- i = 1;
+ case 0: // CHECK-NEXT: Gap,File 0, [[@LINE-1]]:13 -> [[@LINE+6]]:10 = 0
+ i = 1; // CHECK-NEXT: File 0, [[@LINE-1]]:3 -> [[@LINE+1]]:10 = #6
break;
case 1: // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE+3]]:10 = #7
i = 2;
default: // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE+1]]:10 = (#7 + #8)
break; // CHECK-NEXT: File 0, [[@LINE]]:10 -> [[@LINE+3]]:3 = #5
}
-
- switch(i) { // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE+13]]:2 = #5
+ // CHECK-NEXT: File 0, [[@LINE+1]]:3 -> [[@LINE+14]]:2 = #5
+ switch(i) { // CHECK-NEXT: Gap,File 0, [[@LINE]]:13 -> [[@LINE+6]]:11 = 0
case 1: // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE+5]]:11 = #10
case 2: // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE+4]]:11 = (#10 + #11)
i = 11;
@@ -82,10 +82,23 @@
return 0;
}
+ // CHECK: pr44011
+int pr44011(int i) { // CHECK-NEXT: File 0, [[@LINE]]:20 -> {{.*}}:2 = #0
+ switch (i) { // CHECK-NEXT: Gap,File 0, [[@LINE]]:14 -> [[@LINE+6]]:13 = 0
+
+ case 1: // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE+1]]:13 = #2
+ return 0;
+
+ default: // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE+1]]:13 = #3
+ return 1;
+ }
+} // A region for counter #1 is missing due to the missing return.
+
+
// FIXME: End location for "case 1" shouldn't point at the end of the switch.
// CHECK: fallthrough
int fallthrough(int i) { // CHECK-NEXT: File 0, [[@LINE]]:24 -> [[@LINE+12]]:2 = #0
- switch(i) {
+ switch(i) { // CHECK-NEXT: Gap,File 0, [[@LINE]]:13 -> [[@LINE+9]]:10 = 0
case 1: // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE+8]]:10 = #2
i = 23;
case 2: // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE+2]]:10 = (#2 + #3)
@@ -101,7 +114,7 @@
void abort(void) __attribute((noreturn));
// CHECK: noret
int noret(int x) { // CHECK-NEXT: File 0, [[@LINE]]:18 -> [[@LINE+9]]:2
- switch (x) {
+ switch (x) { // CHECK-NEXT: Gap,File 0, [[@LINE]]:14 -> [[@LINE+6]]:14 = 0
default: // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE+1]]:12
abort();
case 1: // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE+1]]:13
diff --git a/src/llvm-project/clang/test/CoverageMapping/switchmacro.c b/src/llvm-project/clang/test/CoverageMapping/switchmacro.c
index f4c14f7..fc0392f 100644
--- a/src/llvm-project/clang/test/CoverageMapping/switchmacro.c
+++ b/src/llvm-project/clang/test/CoverageMapping/switchmacro.c
@@ -4,7 +4,7 @@
// CHECK: foo
int foo(int i) { // CHECK-NEXT: File 0, [[@LINE]]:16 -> {{[0-9]+}}:2 = #0
- switch (i) {
+ switch (i) { // CHECK-NEXT: Gap,File 0, [[@LINE]]:14 -> {{[0-9]+}}:11 = 0
default: // CHECK-NEXT: File 0, [[@LINE]]:3 -> {{[0-9]+}}:11 = #2
if (i == 1) // CHECK-NEXT: File 0, [[@LINE]]:9 -> [[@LINE]]:15 = #2
return 0; // CHECK: File 0, [[@LINE]]:7 -> [[@LINE]]:15 = #3
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/CUDA-unknown/usr/local/cuda/bin/.keep
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/CUDA-unknown/usr/local/cuda/bin/.keep
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/CUDA-unknown/usr/local/cuda/include/.keep
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/CUDA-unknown/usr/local/cuda/include/.keep
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/CUDA-unknown/usr/local/cuda/lib/.keep
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/CUDA-unknown/usr/local/cuda/lib/.keep
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/CUDA-unknown/usr/local/cuda/lib64/.keep
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/CUDA-unknown/usr/local/cuda/lib64/.keep
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/CUDA-unknown/usr/local/cuda/nvvm/libdevice/libdevice.10.bc
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/CUDA-unknown/usr/local/cuda/nvvm/libdevice/libdevice.10.bc
diff --git a/src/llvm-project/clang/test/Driver/Inputs/CUDA-unknown/usr/local/cuda/version.txt b/src/llvm-project/clang/test/Driver/Inputs/CUDA-unknown/usr/local/cuda/version.txt
new file mode 100644
index 0000000..20e55f7
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/Inputs/CUDA-unknown/usr/local/cuda/version.txt
@@ -0,0 +1 @@
+CUDA Version 999.999.999
diff --git a/src/llvm-project/clang/test/Driver/Inputs/WatchOS6.0.sdk/SDKSettings.json b/src/llvm-project/clang/test/Driver/Inputs/WatchOS6.0.sdk/SDKSettings.json
new file mode 100644
index 0000000..b78b8c1
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/Inputs/WatchOS6.0.sdk/SDKSettings.json
@@ -0,0 +1 @@
+{"Version":"6.0.0"}
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/aix_ppc_tree/dummy0.s
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/aix_ppc_tree/dummy0.s
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/aix_ppc_tree/dummy1.s
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/aix_ppc_tree/dummy1.s
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/aix_ppc_tree/dummy2.s
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/aix_ppc_tree/dummy2.s
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/aix_ppc_tree/powerpc-ibm-aix7.1.0.0/dummy.a
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/aix_ppc_tree/powerpc-ibm-aix7.1.0.0/dummy.a
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/aix_ppc_tree/usr/lib/crt0.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/aix_ppc_tree/usr/lib/crt0.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/aix_ppc_tree/usr/lib/crt0_64.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/aix_ppc_tree/usr/lib/crt0_64.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/aix_ppc_tree/usr/lib/crti.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/aix_ppc_tree/usr/lib/crti.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/aix_ppc_tree/usr/lib/crti_64.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/aix_ppc_tree/usr/lib/crti_64.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/aix_ppc_tree/usr/lib/gcrt0.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/aix_ppc_tree/usr/lib/gcrt0.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/aix_ppc_tree/usr/lib/gcrt0_64.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/aix_ppc_tree/usr/lib/gcrt0_64.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/aix_ppc_tree/usr/lib/mcrt0.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/aix_ppc_tree/usr/lib/mcrt0.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/aix_ppc_tree/usr/lib/mcrt0_64.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/aix_ppc_tree/usr/lib/mcrt0_64.o
diff --git a/src/llvm-project/clang/test/Driver/Inputs/basic_riscv32_nogcc_tree/bin/riscv32-unknown-elf-ld b/src/llvm-project/clang/test/Driver/Inputs/basic_riscv32_nogcc_tree/bin/riscv32-unknown-elf-ld
new file mode 100755
index 0000000..b23e556
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/Inputs/basic_riscv32_nogcc_tree/bin/riscv32-unknown-elf-ld
@@ -0,0 +1 @@
+#!/bin/true
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/basic_riscv32_nogcc_tree/riscv32-unknown-elf/lib/crt0.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/basic_riscv32_nogcc_tree/riscv32-unknown-elf/lib/crt0.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/basic_riscv32_nogcc_tree/riscv32-unknown-elf/lib/crtbegin.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/basic_riscv32_nogcc_tree/riscv32-unknown-elf/lib/crtbegin.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/basic_riscv32_nogcc_tree/riscv32-unknown-elf/lib/crtend.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/basic_riscv32_nogcc_tree/riscv32-unknown-elf/lib/crtend.o
diff --git a/src/llvm-project/clang/test/Driver/Inputs/basic_riscv64_nogcc_tree/bin/riscv64-unknown-elf-ld b/src/llvm-project/clang/test/Driver/Inputs/basic_riscv64_nogcc_tree/bin/riscv64-unknown-elf-ld
new file mode 100755
index 0000000..b23e556
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/Inputs/basic_riscv64_nogcc_tree/bin/riscv64-unknown-elf-ld
@@ -0,0 +1 @@
+#!/bin/true
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/basic_riscv64_nogcc_tree/riscv64-unknown-elf/lib/crt0.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/basic_riscv64_nogcc_tree/riscv64-unknown-elf/lib/crt0.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/basic_riscv64_nogcc_tree/riscv64-unknown-elf/lib/crtbegin.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/basic_riscv64_nogcc_tree/riscv64-unknown-elf/lib/crtbegin.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/basic_riscv64_nogcc_tree/riscv64-unknown-elf/lib/crtend.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/basic_riscv64_nogcc_tree/riscv64-unknown-elf/lib/crtend.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/hexagon_tree/Tools/bin/ld.lld
old mode 100644
new mode 100755
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/hexagon_tree/Tools/bin/ld.lld
diff --git a/src/llvm-project/clang/test/Driver/Inputs/iPhoneOS13.0.sdk/SDKSettings.json b/src/llvm-project/clang/test/Driver/Inputs/iPhoneOS13.0.sdk/SDKSettings.json
new file mode 100644
index 0000000..04cb164
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/Inputs/iPhoneOS13.0.sdk/SDKSettings.json
@@ -0,0 +1 @@
+{"Version":"13.0"}
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/crtbegin.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/crtbegin.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/crtend.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/crtend.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv32i/ilp32/crtbegin.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv32i/ilp32/crtbegin.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv32i/ilp32/crtend.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv32i/ilp32/crtend.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv32iac/ilp32/crtbegin.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv32iac/ilp32/crtbegin.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv32iac/ilp32/crtend.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv32iac/ilp32/crtend.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv32im/ilp32/crtbegin.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv32im/ilp32/crtbegin.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv32im/ilp32/crtend.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv32im/ilp32/crtend.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv32imac/ilp32/crtbegin.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv32imac/ilp32/crtbegin.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv32imac/ilp32/crtend.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv32imac/ilp32/crtend.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv32imafc/ilp32f/crtbegin.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv32imafc/ilp32f/crtbegin.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv32imafc/ilp32f/crtend.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv32imafc/ilp32f/crtend.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv64imac/lp64/crtbegin.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv64imac/lp64/crtbegin.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv64imac/lp64/crtend.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv64imac/lp64/crtend.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv64imafdc/lp64d/crtbegin.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv64imafdc/lp64d/crtbegin.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv64imafdc/lp64d/crtend.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv64imafdc/lp64d/crtend.o
diff --git a/src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/riscv64-unknown-elf/bin/ld b/src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/riscv64-unknown-elf/bin/ld
new file mode 100755
index 0000000..b23e556
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/riscv64-unknown-elf/bin/ld
@@ -0,0 +1 @@
+#!/bin/true
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/riscv64-unknown-elf/lib/crt0.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/riscv64-unknown-elf/lib/crt0.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/riscv64-unknown-elf/lib/rv32i/ilp32/crt0.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/riscv64-unknown-elf/lib/rv32i/ilp32/crt0.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/riscv64-unknown-elf/lib/rv32iac/ilp32/crt0.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/riscv64-unknown-elf/lib/rv32iac/ilp32/crt0.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/riscv64-unknown-elf/lib/rv32im/ilp32/crt0.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/riscv64-unknown-elf/lib/rv32im/ilp32/crt0.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/riscv64-unknown-elf/lib/rv32imac/ilp32/crt0.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/riscv64-unknown-elf/lib/rv32imac/ilp32/crt0.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/riscv64-unknown-elf/lib/rv32imafc/ilp32f/crt0.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/riscv64-unknown-elf/lib/rv32imafc/ilp32f/crt0.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/riscv64-unknown-elf/lib/rv64imac/lp64/crt0.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/riscv64-unknown-elf/lib/rv64imac/lp64/crt0.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/riscv64-unknown-elf/lib/rv64imafdc/lp64d/crt0.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/riscv64-unknown-elf/lib/rv64imafdc/lp64d/crt0.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/opensuse_tumbleweed_ppc_tree/usr/lib/crt1.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/opensuse_tumbleweed_ppc_tree/usr/lib/crt1.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/opensuse_tumbleweed_ppc_tree/usr/lib/crti.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/opensuse_tumbleweed_ppc_tree/usr/lib/crti.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/opensuse_tumbleweed_ppc_tree/usr/lib/crtn.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/opensuse_tumbleweed_ppc_tree/usr/lib/crtn.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/opensuse_tumbleweed_ppc_tree/usr/lib/gcc/powerpc64-suse-linux/9/crtbegin.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/opensuse_tumbleweed_ppc_tree/usr/lib/gcc/powerpc64-suse-linux/9/crtbegin.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/opensuse_tumbleweed_ppc_tree/usr/lib/gcc/powerpc64-suse-linux/9/crtend.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/opensuse_tumbleweed_ppc_tree/usr/lib/gcc/powerpc64-suse-linux/9/crtend.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/opensuse_tumbleweed_riscv64_tree/usr/lib64/crt1.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/opensuse_tumbleweed_riscv64_tree/usr/lib64/crt1.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/opensuse_tumbleweed_riscv64_tree/usr/lib64/crti.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/opensuse_tumbleweed_riscv64_tree/usr/lib64/crti.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/opensuse_tumbleweed_riscv64_tree/usr/lib64/crtn.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/opensuse_tumbleweed_riscv64_tree/usr/lib64/crtn.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/opensuse_tumbleweed_riscv64_tree/usr/lib64/gcc/riscv64-suse-linux/9/crtbegin.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/opensuse_tumbleweed_riscv64_tree/usr/lib64/gcc/riscv64-suse-linux/9/crtbegin.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/opensuse_tumbleweed_riscv64_tree/usr/lib64/gcc/riscv64-suse-linux/9/crtend.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/opensuse_tumbleweed_riscv64_tree/usr/lib64/gcc/riscv64-suse-linux/9/crtend.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.asan_ios_dynamic.dylib
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.asan_ios_dynamic.dylib
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.asan_iossim_dynamic.dylib
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.asan_iossim_dynamic.dylib
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.asan_osx_dynamic.dylib
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.asan_osx_dynamic.dylib
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.asan_tvos_dynamic.dylib
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.asan_tvos_dynamic.dylib
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.asan_tvossim_dynamic.dylib
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.asan_tvossim_dynamic.dylib
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.asan_watchos_dynamic.dylib
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.asan_watchos_dynamic.dylib
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.asan_watchossim_dynamic.dylib
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.asan_watchossim_dynamic.dylib
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.lsan_ios_dynamic.dylib
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.lsan_ios_dynamic.dylib
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.lsan_iossim_dynamic.dylib
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.lsan_iossim_dynamic.dylib
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.lsan_osx_dynamic.dylib
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.lsan_osx_dynamic.dylib
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.lsan_tvos_dynamic.dylib
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.lsan_tvos_dynamic.dylib
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.lsan_tvossim_dynamic.dylib
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.lsan_tvossim_dynamic.dylib
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.lsan_watchos_dynamic.dylib
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.lsan_watchos_dynamic.dylib
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.lsan_watchossim_dynamic.dylib
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.lsan_watchossim_dynamic.dylib
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.tsan_iossim_dynamic.dylib
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.tsan_iossim_dynamic.dylib
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.tsan_osx_dynamic.dylib
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.tsan_osx_dynamic.dylib
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.tsan_tvossim_dynamic.dylib
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.tsan_tvossim_dynamic.dylib
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.ubsan_ios_dynamic.dylib
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.ubsan_ios_dynamic.dylib
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.ubsan_iossim_dynamic.dylib
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.ubsan_iossim_dynamic.dylib
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.ubsan_minimal_ios_dynamic.dylib
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.ubsan_minimal_ios_dynamic.dylib
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.ubsan_minimal_iossim_dynamic.dylib
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.ubsan_minimal_iossim_dynamic.dylib
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.ubsan_minimal_osx_dynamic.dylib
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.ubsan_minimal_osx_dynamic.dylib
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.ubsan_minimal_tvos_dynamic.dylib
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.ubsan_minimal_tvos_dynamic.dylib
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.ubsan_minimal_tvossim_dynamic.dylib
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.ubsan_minimal_tvossim_dynamic.dylib
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.ubsan_minimal_watchos_dynamic.dylib
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.ubsan_minimal_watchos_dynamic.dylib
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.ubsan_minimal_watchossim_dynamic.dylib
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.ubsan_minimal_watchossim_dynamic.dylib
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.ubsan_osx_dynamic.dylib
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.ubsan_osx_dynamic.dylib
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.ubsan_tvos_dynamic.dylib
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.ubsan_tvos_dynamic.dylib
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.ubsan_tvossim_dynamic.dylib
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.ubsan_tvossim_dynamic.dylib
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.ubsan_watchos_dynamic.dylib
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.ubsan_watchos_dynamic.dylib
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.ubsan_watchossim_dynamic.dylib
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.ubsan_watchossim_dynamic.dylib
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/resource_dir_with_per_target_subdir/lib/riscv64-fuchsia/libclang_rt.builtins.a
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/resource_dir_with_per_target_subdir/lib/riscv64-fuchsia/libclang_rt.builtins.a
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/solaris_sparc_tree/usr/lib/values-Xa.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/solaris_sparc_tree/usr/lib/values-Xa.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/solaris_sparc_tree/usr/lib/values-Xc.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/solaris_sparc_tree/usr/lib/values-Xc.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/solaris_sparc_tree/usr/lib/values-xpg4.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/solaris_sparc_tree/usr/lib/values-xpg4.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/solaris_sparc_tree/usr/lib/values-xpg6.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/solaris_sparc_tree/usr/lib/values-xpg6.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/solaris_x86_tree/usr/lib/values-Xa.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/solaris_x86_tree/usr/lib/values-Xa.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/solaris_x86_tree/usr/lib/values-Xc.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/solaris_x86_tree/usr/lib/values-Xc.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/solaris_x86_tree/usr/lib/values-xpg4.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/solaris_x86_tree/usr/lib/values-xpg4.o
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Driver/Inputs/solaris_x86_tree/usr/lib/values-xpg6.o
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Driver/Inputs/solaris_x86_tree/usr/lib/values-xpg6.o
diff --git a/src/llvm-project/clang/test/Driver/Wp-args.c b/src/llvm-project/clang/test/Driver/Wp-args.c
index e01e2a2..587b7b8 100644
--- a/src/llvm-project/clang/test/Driver/Wp-args.c
+++ b/src/llvm-project/clang/test/Driver/Wp-args.c
@@ -19,3 +19,13 @@
// MMD: "-cc1"
// MMD-NOT: -MMD
// MMD: "-dependency-file" "Wp-args.d"
+
+// Ensure response files are properly expanded with -Wp
+// RUN: echo -DTEST > %t.rsp
+// RUN: %clang -Wp,@%t.rsp -E %s | FileCheck -check-prefix RSP %s
+
+#ifdef TEST
+void foo();
+#endif
+
+// RSP: foo()
diff --git a/src/llvm-project/clang/test/Driver/XRay/xray-instrument-macos.c b/src/llvm-project/clang/test/Driver/XRay/xray-instrument-macos.c
new file mode 100644
index 0000000..ce68345
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/XRay/xray-instrument-macos.c
@@ -0,0 +1,4 @@
+// RUN: %clang -o /dev/null -v -fxray-instrument -target x86_64-apple-macos10.11 -c %s
+// RUN: %clang -o /dev/null -v -fxray-instrument -target x86_64-apple-darwin15 -c %s
+// REQUIRES: x86_64 || x86_64h
+typedef int a;
diff --git a/src/llvm-project/clang/test/Driver/XRay/xray-instrument-os.c b/src/llvm-project/clang/test/Driver/XRay/xray-instrument-os.c
index 3a0c428..ba97328 100644
--- a/src/llvm-project/clang/test/Driver/XRay/xray-instrument-os.c
+++ b/src/llvm-project/clang/test/Driver/XRay/xray-instrument-os.c
@@ -1,4 +1,4 @@
// RUN: not %clang -o /dev/null -v -fxray-instrument -c %s
// XFAIL: -linux-, -freebsd, -darwin, -macos
-// REQUIRES-ANY: amd64, x86_64, x86_64h, arm, aarch64, arm64
+// REQUIRES: amd64 || x86_64 || x86_64h || arm || aarch64 || arm64
typedef int a;
diff --git a/src/llvm-project/clang/test/Driver/XRay/xray-instrumentation-bundles-flags.cpp b/src/llvm-project/clang/test/Driver/XRay/xray-instrumentation-bundles-flags.cpp
index da25355..b68dca2 100644
--- a/src/llvm-project/clang/test/Driver/XRay/xray-instrumentation-bundles-flags.cpp
+++ b/src/llvm-project/clang/test/Driver/XRay/xray-instrumentation-bundles-flags.cpp
@@ -7,5 +7,5 @@
// RUN: | FileCheck %s
// CHECK: -fxray-instrumentation-bundle=function
//
-// REQUIRES-ANY: linux, freebsd
-// REQUIRES-ANY: amd64, x86_64, x86_64h, arm, aarch64, arm64
+// REQUIRES: linux || freebsd
+// REQUIRES: amd64 || x86_64 || x86_64h || arm || aarch64 || arm64
diff --git a/src/llvm-project/clang/test/Driver/XRay/xray-mode-flags.cpp b/src/llvm-project/clang/test/Driver/XRay/xray-mode-flags.cpp
index 281cf0b..e95053a 100644
--- a/src/llvm-project/clang/test/Driver/XRay/xray-mode-flags.cpp
+++ b/src/llvm-project/clang/test/Driver/XRay/xray-mode-flags.cpp
@@ -45,5 +45,5 @@
// FDR: libclang_rt.xray-fdr
// NONE-NOT: libclang_rt.xray-basic
// NONE-NOT: libclang_rt.xray-fdr
-// REQUIRES-ANY: linux, freebsd
-// REQUIRES-ANY: amd64, x86_64, x86_64h, arm, aarch64, arm64
+// REQUIRES: linux || freebsd
+// REQUIRES: amd64 || x86_64 || x86_64h || arm || aarch64 || arm64
diff --git a/src/llvm-project/clang/test/Driver/XRay/xray-nolinkdeps.cpp b/src/llvm-project/clang/test/Driver/XRay/xray-nolinkdeps.cpp
index 5a79e36..5461fc3 100644
--- a/src/llvm-project/clang/test/Driver/XRay/xray-nolinkdeps.cpp
+++ b/src/llvm-project/clang/test/Driver/XRay/xray-nolinkdeps.cpp
@@ -4,5 +4,5 @@
// RUN: 2>&1 | FileCheck --check-prefix ENABLE %s
// ENABLE: clang_rt.xray
// DISABLE-NOT: clang_rt.xray
-// REQUIRES-ANY: linux, freebsd
-// REQUIRES-ANY: amd64, x86_64, x86_64h, arm, aarch64, arm64
+// REQUIRES: linux || freebsd
+// REQUIRES: amd64 || x86_64 || x86_64h || arm || aarch64 || arm64
diff --git a/src/llvm-project/clang/test/Driver/aarch64-cpus.c b/src/llvm-project/clang/test/Driver/aarch64-cpus.c
index 32920ea..c7dc5f6 100644
--- a/src/llvm-project/clang/test/Driver/aarch64-cpus.c
+++ b/src/llvm-project/clang/test/Driver/aarch64-cpus.c
@@ -23,9 +23,12 @@
// RUN: %clang -target arm64-apple-darwin -arch arm64 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-DARWIN %s
// RUN: %clang -target arm64-apple-darwin -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-DARWIN %s
// RUN: %clang -target arm64-apple-ios12.0 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-DARWIN %s
-// ARM64-DARWIN: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "cyclone"
+// ARM64-DARWIN: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "apple-a7"
// ARM64-DARWIN-SAME: "-target-feature" "+aes"
+// RUN: %clang -target arm64-apple-darwin -arch arm64_32 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64_32-DARWIN %s
+// ARM64_32-DARWIN: "-cc1"{{.*}} "-triple" "aarch64_32{{.*}}" "-target-cpu" "apple-s4"
+
// RUN: %clang -target aarch64 -mcpu=cortex-a35 -### -c %s 2>&1 | FileCheck -check-prefix=CA35 %s
// RUN: %clang -target aarch64 -mlittle-endian -mcpu=cortex-a35 -### -c %s 2>&1 | FileCheck -check-prefix=CA35 %s
// RUN: %clang -target aarch64_be -mlittle-endian -mcpu=cortex-a35 -### -c %s 2>&1 | FileCheck -check-prefix=CA35 %s
@@ -152,24 +155,6 @@
// ARM64-CORTEX-A76: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "cortex-a76"
// ARM64-CORTEX-A76-TUNE: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "generic"
-// RUN: %clang -target aarch64 -mcpu=exynos-m1 -### -c %s 2>&1 | FileCheck -check-prefix=M1 %s
-// RUN: %clang -target aarch64 -mlittle-endian -mcpu=exynos-m1 -### -c %s 2>&1 | FileCheck -check-prefix=M1 %s
-// RUN: %clang -target aarch64_be -mlittle-endian -mcpu=exynos-m1 -### -c %s 2>&1 | FileCheck -check-prefix=M1 %s
-// RUN: %clang -target aarch64 -mtune=exynos-m1 -### -c %s 2>&1 | FileCheck -check-prefix=M1-TUNE %s
-// RUN: %clang -target aarch64 -mlittle-endian -mtune=exynos-m1 -### -c %s 2>&1 | FileCheck -check-prefix=M1-TUNE %s
-// RUN: %clang -target aarch64_be -mlittle-endian -mtune=exynos-m1 -### -c %s 2>&1 | FileCheck -check-prefix=M1-TUNE %s
-// M1: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "exynos-m1"
-// M1-TUNE: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "generic"
-
-// RUN: %clang -target aarch64 -mcpu=exynos-m2 -### -c %s 2>&1 | FileCheck -check-prefix=M2 %s
-// RUN: %clang -target aarch64 -mlittle-endian -mcpu=exynos-m2 -### -c %s 2>&1 | FileCheck -check-prefix=M2 %s
-// RUN: %clang -target aarch64_be -mlittle-endian -mcpu=exynos-m2 -### -c %s 2>&1 | FileCheck -check-prefix=M2 %s
-// RUN: %clang -target aarch64 -mtune=exynos-m2 -### -c %s 2>&1 | FileCheck -check-prefix=M2-TUNE %s
-// RUN: %clang -target aarch64 -mlittle-endian -mtune=exynos-m2 -### -c %s 2>&1 | FileCheck -check-prefix=M2-TUNE %s
-// RUN: %clang -target aarch64_be -mlittle-endian -mtune=exynos-m2 -### -c %s 2>&1 | FileCheck -check-prefix=M2-TUNE %s
-// M2: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "exynos-m2"
-// M2-TUNE: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic"
-
// RUN: %clang -target aarch64_be -mcpu=exynos-m3 -### -c %s 2>&1 | FileCheck -check-prefix=M3 %s
// RUN: %clang -target aarch64 -mbig-endian -mcpu=exynos-m3 -### -c %s 2>&1 | FileCheck -check-prefix=M3 %s
// RUN: %clang -target aarch64_be -mbig-endian -mcpu=exynos-m3 -### -c %s 2>&1 | FileCheck -check-prefix=M3 %s
@@ -199,20 +184,6 @@
// M5-TUNE: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic"
// M5-TUNE-NOT: "+v8.2a"
-// RUN: %clang -target arm64 -mcpu=exynos-m1 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-M1 %s
-// RUN: %clang -target arm64 -mlittle-endian -mcpu=exynos-m1 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-M1 %s
-// RUN: %clang -target arm64 -mtune=exynos-m1 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-M1-TUNE %s
-// RUN: %clang -target arm64 -mlittle-endian -mtune=exynos-m1 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-M1-TUNE %s
-// ARM64-M1: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "exynos-m1"
-// ARM64-M1-TUNE: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "generic"
-
-// RUN: %clang -target arm64 -mcpu=exynos-m2 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-M2 %s
-// RUN: %clang -target arm64 -mlittle-endian -mcpu=exynos-m2 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-M2 %s
-// RUN: %clang -target arm64 -mtune=exynos-m2 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-M2-TUNE %s
-// RUN: %clang -target arm64 -mlittle-endian -mtune=exynos-m2 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-M2-TUNE %s
-// ARM64-M2: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "exynos-m2"
-// ARM64-M2-TUNE: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "generic"
-
// RUN: %clang -target arm64 -mcpu=exynos-m3 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-M3 %s
// RUN: %clang -target arm64 -mlittle-endian -mcpu=exynos-m3 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-M3 %s
// RUN: %clang -target arm64 -mtune=exynos-m3 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-M3-TUNE %s
@@ -341,24 +312,6 @@
// CORTEX-A73-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "cortex-a73"
// CORTEX-A73-BE-TUNE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "generic"
-// RUN: %clang -target aarch64_be -mcpu=exynos-m1 -### -c %s 2>&1 | FileCheck -check-prefix=M1-BE %s
-// RUN: %clang -target aarch64 -mbig-endian -mcpu=exynos-m1 -### -c %s 2>&1 | FileCheck -check-prefix=M1-BE %s
-// RUN: %clang -target aarch64_be -mbig-endian -mcpu=exynos-m1 -### -c %s 2>&1 | FileCheck -check-prefix=M1-BE %s
-// RUN: %clang -target aarch64_be -mtune=exynos-m1 -### -c %s 2>&1 | FileCheck -check-prefix=M1-BE-TUNE %s
-// RUN: %clang -target aarch64 -mbig-endian -mtune=exynos-m1 -### -c %s 2>&1 | FileCheck -check-prefix=M1-BE-TUNE %s
-// RUN: %clang -target aarch64_be -mbig-endian -mtune=exynos-m1 -### -c %s 2>&1 | FileCheck -check-prefix=M1-BE-TUNE %s
-// M1-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "exynos-m1"
-// M1-BE-TUNE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "generic"
-
-// RUN: %clang -target aarch64_be -mcpu=exynos-m2 -### -c %s 2>&1 | FileCheck -check-prefix=M2-BE %s
-// RUN: %clang -target aarch64 -mbig-endian -mcpu=exynos-m2 -### -c %s 2>&1 | FileCheck -check-prefix=M2-BE %s
-// RUN: %clang -target aarch64_be -mbig-endian -mcpu=exynos-m2 -### -c %s 2>&1 | FileCheck -check-prefix=M2-BE %s
-// RUN: %clang -target aarch64_be -mtune=exynos-m2 -### -c %s 2>&1 | FileCheck -check-prefix=M2-BE-TUNE %s
-// RUN: %clang -target aarch64 -mbig-endian -mtune=exynos-m2 -### -c %s 2>&1 | FileCheck -check-prefix=M2-BE-TUNE %s
-// RUN: %clang -target aarch64_be -mbig-endian -mtune=exynos-m2 -### -c %s 2>&1 | FileCheck -check-prefix=M2-BE-TUNE %s
-// M2-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "exynos-m2"
-// M2-BE-TUNE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "generic"
-
// RUN: %clang -target aarch64_be -mcpu=exynos-m3 -### -c %s 2>&1 | FileCheck -check-prefix=M3-BE %s
// RUN: %clang -target aarch64 -mbig-endian -mcpu=exynos-m3 -### -c %s 2>&1 | FileCheck -check-prefix=M3-BE %s
// RUN: %clang -target aarch64_be -mbig-endian -mcpu=exynos-m3 -### -c %s 2>&1 | FileCheck -check-prefix=M3-BE %s
diff --git a/src/llvm-project/clang/test/Driver/aix-as.c b/src/llvm-project/clang/test/Driver/aix-as.c
new file mode 100644
index 0000000..4f67d1b
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/aix-as.c
@@ -0,0 +1,73 @@
+// General tests that as(1) invocations on AIX targets are sane. Note that we
+// only test assembler functionalities in this suite.
+
+// Check powerpc-ibm-aix7.1.0.0, 32-bit.
+// RUN: %clang -no-canonical-prefixes %s -### -c -o %t.o 2>&1 \
+// RUN: -target powerpc-ibm-aix7.1.0.0 \
+// RUN: | FileCheck --check-prefix=CHECK-AS32 %s
+// CHECK-AS32-NOT: warning:
+// CHECK-AS32: {{.*}}clang{{(.exe)?}}" "-cc1" "-triple" "powerpc-ibm-aix7.1.0.0"
+// CHECK-AS32: "{{.*}}as{{(.exe)?}}"
+// CHECK-AS32: "-a32"
+// CHECK-AS32: "-u"
+// CHECK-AS32: "-many"
+
+// Check powerpc64-ibm-aix7.1.0.0, 64-bit.
+// RUN: %clang -no-canonical-prefixes %s -### -c -o %t.o 2>&1 \
+// RUN: -target powerpc64-ibm-aix7.1.0.0 \
+// RUN: | FileCheck --check-prefix=CHECK-AS64 %s
+// CHECK-AS64-NOT: warning:
+// CHECK-AS64: {{.*}}clang{{(.exe)?}}" "-cc1" "-triple" "powerpc64-ibm-aix7.1.0.0"
+// CHECK-AS64: "{{.*}}as{{(.exe)?}}"
+// CHECK-AS64: "-a64"
+// CHECK-AS64: "-u"
+// CHECK-AS64: "-many"
+
+
+// Check powerpc-ibm-aix7.1.0.0, 32-bit. -Xassembler <arg> option.
+// RUN: %clang -no-canonical-prefixes %s -### -c -o %t.o 2>&1 \
+// RUN: -Xassembler -w \
+// RUN: -target powerpc-ibm-aix7.1.0.0 \
+// RUN: | FileCheck --check-prefix=CHECK-AS32-Xassembler %s
+// CHECK-AS32-Xassembler-NOT: warning:
+// CHECK-AS32-Xassembler: {{.*}}clang{{(.exe)?}}" "-cc1" "-triple" "powerpc-ibm-aix7.1.0.0"
+// CHECK-AS32-Xassembler: "{{.*}}as{{(.exe)?}}"
+// CHECK-AS32-Xassembler: "-a32"
+// CHECK-AS32-Xassembler: "-u"
+// CHECK-AS32-Xassembler: "-many"
+// CHECK-AS32-Xassembler: "-w"
+
+// Check powerpc64-ibm-aix7.1.0.0, 64-bit. -Wa,<arg>,<arg> option.
+// RUN: %clang -no-canonical-prefixes %s -### -c -o %t.o 2>&1 \
+// RUN: -Wa,-v,-w \
+// RUN: -target powerpc64-ibm-aix7.1.0.0 \
+// RUN: | FileCheck --check-prefix=CHECK-AS64-Wa %s
+// CHECK-AS64-Wa-NOT: warning:
+// CHECK-AS64-Wa: {{.*}}clang{{(.exe)?}}" "-cc1" "-triple" "powerpc64-ibm-aix7.1.0.0"
+// CHECK-AS64-Wa: "{{.*}}as{{(.exe)?}}"
+// CHECK-AS64-Wa: "-a64"
+// CHECK-AS64-Wa: "-u"
+// CHECK-AS64-Wa: "-many"
+// CHECK-AS64-Wa: "-v"
+// CHECK-AS64-Wa: "-w"
+
+// Check powerpc-ibm-aix7.1.0.0, 32-bit. Multiple input files.
+// RUN: %clang -no-canonical-prefixes -### -c \
+// RUN: %S/Inputs/aix_ppc_tree/dummy0.s \
+// RUN: %S/Inputs/aix_ppc_tree/dummy1.s \
+// RUN: %S/Inputs/aix_ppc_tree/dummy2.s 2>&1 \
+// RUN: -target powerpc-ibm-aix7.1.0.0 \
+// RUN: | FileCheck --check-prefix=CHECK-AS32-MultiInput %s
+// CHECK-AS32-MultiInput-NOT: warning:
+// CHECK-AS32-MultiInput: "{{.*}}as{{(.exe)?}}"
+// CHECK-AS32-MultiInput: "-a32"
+// CHECK-AS32-MultiInput: "-u"
+// CHECK-AS32-MultiInput: "-many"
+// CHECK-AS32-MultiInput: "{{.*}}as{{(.exe)?}}"
+// CHECK-AS32-MultiInput: "-a32"
+// CHECK-AS32-MultiInput: "-u"
+// CHECK-AS32-MultiInput: "-many"
+// CHECK-AS32-MultiInput: "{{.*}}as{{(.exe)?}}"
+// CHECK-AS32-MultiInput: "-a32"
+// CHECK-AS32-MultiInput: "-u"
+// CHECK-AS32-MultiInput: "-many"
diff --git a/src/llvm-project/clang/test/Driver/aix-ld.c b/src/llvm-project/clang/test/Driver/aix-ld.c
new file mode 100644
index 0000000..9549571
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/aix-ld.c
@@ -0,0 +1,177 @@
+// General tests that ld invocations on AIX targets are sane. Note that we use
+// sysroot to make these tests independent of the host system.
+
+// Check powerpc-ibm-aix7.1.0.0, 32-bit.
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: -target powerpc-ibm-aix7.1.0.0 \
+// RUN: --sysroot %S/Inputs/aix_ppc_tree \
+// RUN: | FileCheck --check-prefix=CHECK-LD32 %s
+// CHECK-LD32-NOT: warning:
+// CHECK-LD32: {{.*}}clang{{(.exe)?}}" "-cc1" "-triple" "powerpc-ibm-aix7.1.0.0"
+// CHECK-LD32: "-isysroot" "[[SYSROOT:[^"]+]]"
+// CHECK-LD32: "{{.*}}ld{{(.exe)?}}"
+// CHECK-LD32-NOT: "-bnso"
+// CHECK-LD32: "-b32"
+// CHECK-LD32: "-bpT:0x10000000" "-bpD:0x20000000"
+// CHECK-LD32: "[[SYSROOT]]/usr/lib{{/|\\\\}}crt0.o"
+// CHECK-LD32: "-L[[SYSROOT]]/usr/lib"
+// CHECK-LD32: "-lc"
+
+// Check powerpc64-ibm-aix7.1.0.0, 64-bit.
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: -target powerpc64-ibm-aix7.1.0.0 \
+// RUN: --sysroot %S/Inputs/aix_ppc_tree \
+// RUN: | FileCheck --check-prefix=CHECK-LD64 %s
+// CHECK-LD64-NOT: warning:
+// CHECK-LD64: {{.*}}clang{{(.exe)?}}" "-cc1" "-triple" "powerpc64-ibm-aix7.1.0.0"
+// CHECK-LD64: "-isysroot" "[[SYSROOT:[^"]+]]"
+// CHECK-LD64: "{{.*}}ld{{(.exe)?}}"
+// CHECK-LD64-NOT: "-bnso"
+// CHECK-LD64: "-b64"
+// CHECK-LD64: "-bpT:0x100000000" "-bpD:0x110000000"
+// CHECK-LD64: "[[SYSROOT]]/usr/lib{{/|\\\\}}crt0_64.o"
+// CHECK-LD64: "-L[[SYSROOT]]/usr/lib"
+// CHECK-LD64: "-lc"
+
+// Check powerpc-ibm-aix7.1.0.0, 32-bit. Enable POSIX thread support.
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: -pthread \
+// RUN: -target powerpc-ibm-aix7.1.0.0 \
+// RUN: --sysroot %S/Inputs/aix_ppc_tree \
+// RUN: | FileCheck --check-prefix=CHECK-LD32-PTHREAD %s
+// CHECK-LD32-PTHREAD-NOT: warning:
+// CHECK-LD32-PTHREAD: {{.*}}clang{{(.exe)?}}" "-cc1" "-triple" "powerpc-ibm-aix7.1.0.0"
+// CHECK-LD32-PTHREAD: "-isysroot" "[[SYSROOT:[^"]+]]"
+// CHECK-LD32-PTHREAD: "{{.*}}ld{{(.exe)?}}"
+// CHECK-LD32-PTHREAD-NOT: "-bnso"
+// CHECK-LD32-PTHREAD: "-b32"
+// CHECK-LD32-PTHREAD: "-bpT:0x10000000" "-bpD:0x20000000"
+// CHECK-LD32-PTHREAD: "[[SYSROOT]]/usr/lib{{/|\\\\}}crt0.o"
+// CHECK-LD32-PTHREAD: "-L[[SYSROOT]]/usr/lib"
+// CHECK-LD32-PTHREAD: "-lpthreads"
+// CHECK-LD32-PTHREAD: "-lc"
+
+// Check powerpc-ibm-aix7.1.0.0, 64-bit. POSIX thread alias.
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: -pthreads \
+// RUN: -target powerpc64-ibm-aix7.1.0.0 \
+// RUN: --sysroot %S/Inputs/aix_ppc_tree \
+// RUN: | FileCheck --check-prefix=CHECK-LD64-PTHREAD %s
+// CHECK-LD64-PTHREAD-NOT: warning:
+// CHECK-LD64-PTHREAD: {{.*}}clang{{(.exe)?}}" "-cc1" "-triple" "powerpc64-ibm-aix7.1.0.0"
+// CHECK-LD64-PTHREAD: "-isysroot" "[[SYSROOT:[^"]+]]"
+// CHECK-LD64-PTHREAD: "{{.*}}ld{{(.exe)?}}"
+// CHECK-LD64-PTHREAD-NOT: "-bnso"
+// CHECK-LD64-PTHREAD: "-b64"
+// CHECK-LD64-PTHREAD: "-bpT:0x100000000" "-bpD:0x110000000"
+// CHECK-LD64-PTHREAD: "[[SYSROOT]]/usr/lib{{/|\\\\}}crt0_64.o"
+// CHECK-LD64-PTHREAD: "-L[[SYSROOT]]/usr/lib"
+// CHECK-LD64-PTHREAD: "-lpthreads"
+// CHECK-LD64-PTHREAD: "-lc"
+
+// Check powerpc-ibm-aix7.1.0.0, 32-bit. Enable profiling.
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: -p \
+// RUN: -target powerpc-ibm-aix7.1.0.0 \
+// RUN: --sysroot %S/Inputs/aix_ppc_tree \
+// RUN: | FileCheck --check-prefix=CHECK-LD32-PROF %s
+// CHECK-LD32-PROF-NOT: warning:
+// CHECK-LD32-PROF: {{.*}}clang{{(.exe)?}}" "-cc1" "-triple" "powerpc-ibm-aix7.1.0.0"
+// CHECK-LD32-PROF: "-isysroot" "[[SYSROOT:[^"]+]]"
+// CHECK-LD32-PROF: "{{.*}}ld{{(.exe)?}}"
+// CHECK-LD32-PROF-NOT: "-bnso"
+// CHECK-LD32-PROF: "-b32"
+// CHECK-LD32-PROF: "-bpT:0x10000000" "-bpD:0x20000000"
+// CHECK-LD32-PROF: "[[SYSROOT]]/usr/lib{{/|\\\\}}mcrt0.o"
+// CHECK-LD32-PROF: "-L[[SYSROOT]]/usr/lib"
+// CHECK-LD32-PROF: "-lc"
+
+// Check powerpc64-ibm-aix7.1.0.0, 64-bit. Enable g-profiling.
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: -pg \
+// RUN: -target powerpc64-ibm-aix7.1.0.0 \
+// RUN: --sysroot %S/Inputs/aix_ppc_tree \
+// RUN: | FileCheck --check-prefix=CHECK-LD64-GPROF %s
+// CHECK-LD64-GPROF-NOT: warning:
+// CHECK-LD64-GPROF: {{.*}}clang{{(.exe)?}}" "-cc1" "-triple" "powerpc64-ibm-aix7.1.0.0"
+// CHECK-LD64-GPROF: "-isysroot" "[[SYSROOT:[^"]+]]"
+// CHECK-LD64-GPROF: "{{.*}}ld{{(.exe)?}}"
+// CHECK-LD64-GPROF-NOT: "-bnso"
+// CHECK-LD64-GPROF: "-b64"
+// CHECK-LD64-GPROF: "-bpT:0x100000000" "-bpD:0x110000000"
+// CHECK-LD64-GPROF: "[[SYSROOT]]/usr/lib{{/|\\\\}}gcrt0_64.o"
+// CHECK-LD64-GPROF: "-L[[SYSROOT]]/usr/lib"
+// CHECK-LD64-GPROF: "-lc"
+
+// Check powerpc-ibm-aix7.1.0.0, 32-bit. Static linking.
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: -static \
+// RUN: -target powerpc-ibm-aix7.1.0.0 \
+// RUN: --sysroot %S/Inputs/aix_ppc_tree \
+// RUN: | FileCheck --check-prefix=CHECK-LD32-STATIC %s
+// CHECK-LD32-STATIC-NOT: warning:
+// CHECK-LD32-STATIC: {{.*}}clang{{(.exe)?}}" "-cc1" "-triple" "powerpc-ibm-aix7.1.0.0"
+// CHECK-LD32-STATIC: "-isysroot" "[[SYSROOT:[^"]+]]"
+// CHECK-LD32-STATIC: "{{.*}}ld{{(.exe)?}}"
+// CHECK-LD32-STATIC: "-bnso"
+// CHECK-LD32-STATIC: "-b32"
+// CHECK-LD32-STATIC: "-bpT:0x10000000" "-bpD:0x20000000"
+// CHECK-LD32-STATIC: "[[SYSROOT]]/usr/lib{{/|\\\\}}crt0.o"
+// CHECK-LD32-STATIC: "-L[[SYSROOT]]/usr/lib"
+// CHECK-LD32-STATIC: "-lc"
+
+// Check powerpc-ibm-aix7.1.0.0, 32-bit. Library search path.
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: -L%S/Inputs/aix_ppc_tree/powerpc-ibm-aix7.1.0.0 \
+// RUN: -target powerpc-ibm-aix7.1.0.0 \
+// RUN: --sysroot %S/Inputs/aix_ppc_tree \
+// RUN: | FileCheck --check-prefix=CHECK-LD32-LIBP %s
+// CHECK-LD32-LIBP-NOT: warning:
+// CHECK-LD32-LIBP: {{.*}}clang{{(.exe)?}}" "-cc1" "-triple" "powerpc-ibm-aix7.1.0.0"
+// CHECK-LD32-LIBP: "-isysroot" "[[SYSROOT:[^"]+]]"
+// CHECK-LD32-LIBP: "{{.*}}ld{{(.exe)?}}"
+// CHECK-LD32-LIBP-NOT: "-bnso"
+// CHECK-LD32-LIBP: "-b32"
+// CHECK-LD32-LIBP: "-bpT:0x10000000" "-bpD:0x20000000"
+// CHECK-LD32-LIBP: "[[SYSROOT]]/usr/lib{{/|\\\\}}crt0.o"
+// CHECK-LD32-LIBP: "-L[[SYSROOT]]/powerpc-ibm-aix7.1.0.0"
+// CHECK-LD32-LIBP: "-L[[SYSROOT]]/usr/lib"
+// CHECK-LD32-LIBP: "-lc"
+
+// Check powerpc-ibm-aix7.1.0.0, 32-bit. nostdlib.
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: -nostdlib \
+// RUN: -pthread \
+// RUN: -target powerpc-ibm-aix7.1.0.0 \
+// RUN: --sysroot %S/Inputs/aix_ppc_tree \
+// RUN: | FileCheck --check-prefix=CHECK-LD32-NO-STD-LIB %s
+// CHECK-LD32-NO-STD-LIB-NOT: warning:
+// CHECK-LD32-NO-STD-LIB: {{.*}}clang{{(.exe)?}}" "-cc1" "-triple" "powerpc-ibm-aix7.1.0.0"
+// CHECK-LD32-NO-STD-LIB: "-isysroot" "[[SYSROOT:[^"]+]]"
+// CHECK-LD32-NO-STD-LIB: "{{.*}}ld{{(.exe)?}}"
+// CHECK-LD32-NO-STD-LIB-NOT: "-bnso"
+// CHECK-LD32-NO-STD-LIB: "-b32"
+// CHECK-LD32-NO-STD-LIB: "-bpT:0x10000000" "-bpD:0x20000000"
+// CHECK-LD32-NO-STD-LIB-NOT: "[[SYSROOT]]/usr/lib{{/|\\\\}}crt0.o"
+// CHECK-LD32-NO-STD-LIB: "-L[[SYSROOT]]/usr/lib"
+// CHECK-LD32-NO-STD-LIB-NOT: "-lpthreads"
+// CHECK-LD32-NO-STD-LIB-NOT: "-lc"
+
+// Check powerpc-ibm-aix7.1.0.0, 64-bit. nodefaultlibs.
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: -nodefaultlibs \
+// RUN: -pthread \
+// RUN: -target powerpc64-ibm-aix7.1.0.0 \
+// RUN: --sysroot %S/Inputs/aix_ppc_tree \
+// RUN: | FileCheck --check-prefix=CHECK-LD64-NO-DEFAULT-LIBS %s
+// CHECK-LD64-NO-DEFAULT-LIBS-NOT: warning:
+// CHECK-LD64-NO-DEFAULT-LIBS: {{.*}}clang{{(.exe)?}}" "-cc1" "-triple" "powerpc64-ibm-aix7.1.0.0"
+// CHECK-LD64-NO-DEFAULT-LIBS: "-isysroot" "[[SYSROOT:[^"]+]]"
+// CHECK-LD64-NO-DEFAULT-LIBS: "{{.*}}ld{{(.exe)?}}"
+// CHECK-LD64-NO-DEFAULT-LIBS-NOT: "-bnso"
+// CHECK-LD64-NO-DEFAULT-LIBS: "-b64"
+// CHECK-LD64-NO-DEFAULT-LIBS: "-bpT:0x100000000" "-bpD:0x110000000"
+// CHECK-LD64-NO-DEFAULT-LIBS: "[[SYSROOT]]/usr/lib{{/|\\\\}}crt0_64.o"
+// CHECK-LD64-NO-DEFAULT-LIBS: "-L[[SYSROOT]]/usr/lib"
+// CHECK-LD64-NO-DEFAULT-LIBS-NOT: "-lpthreads"
+// CHECK-LD64-NO-DEFAULT-LIBS-NOT: "-lc"
diff --git a/src/llvm-project/clang/test/Driver/amdgpu-mcpu.cl b/src/llvm-project/clang/test/Driver/amdgpu-mcpu.cl
index 1559c7f..3aa5076 100644
--- a/src/llvm-project/clang/test/Driver/amdgpu-mcpu.cl
+++ b/src/llvm-project/clang/test/Driver/amdgpu-mcpu.cl
@@ -52,6 +52,7 @@
// AMDGCN-based processors.
//
+// RUN: %clang -### -target amdgcn %s 2>&1 | FileCheck --check-prefix=GCNDEFAULT %s
// RUN: %clang -### -target amdgcn -mcpu=gfx600 %s 2>&1 | FileCheck --check-prefix=GFX600 %s
// RUN: %clang -### -target amdgcn -mcpu=tahiti %s 2>&1 | FileCheck --check-prefix=TAHITI %s
// RUN: %clang -### -target amdgcn -mcpu=gfx601 %s 2>&1 | FileCheck --check-prefix=GFX601 %s
@@ -90,6 +91,7 @@
// RUN: %clang -### -target amdgcn -mcpu=gfx1011 %s 2>&1 | FileCheck --check-prefix=GFX1011 %s
// RUN: %clang -### -target amdgcn -mcpu=gfx1012 %s 2>&1 | FileCheck --check-prefix=GFX1012 %s
+// GCNDEFAULT-NOT: -target-cpu
// GFX600: "-target-cpu" "gfx600"
// TAHITI: "-target-cpu" "tahiti"
// GFX601: "-target-cpu" "gfx601"
diff --git a/src/llvm-project/clang/test/Driver/amdgpu-toolchain.c b/src/llvm-project/clang/test/Driver/amdgpu-toolchain.c
index e51b7b5..c058ef2 100644
--- a/src/llvm-project/clang/test/Driver/amdgpu-toolchain.c
+++ b/src/llvm-project/clang/test/Driver/amdgpu-toolchain.c
@@ -8,4 +8,4 @@
// AS_LINK: clang{{.*}} "-cc1as"
// AS_LINK: ld.lld{{.*}} "-shared"
-// DWARF_VER: "-dwarf-version=5"
+// DWARF_VER: "-dwarf-version=4"
diff --git a/src/llvm-project/clang/test/Driver/android-no-installed-libcxx.cpp b/src/llvm-project/clang/test/Driver/android-no-installed-libcxx.cpp
new file mode 100644
index 0000000..a496a82
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/android-no-installed-libcxx.cpp
@@ -0,0 +1,10 @@
+// Check that we don't find the libc++ in the installation directory when
+// targeting Android.
+
+// RUN: mkdir -p %t/bin
+// RUN: mkdir -p %t/include/c++/v1
+// RUN: mkdir -p %t/sysroot
+// RUN: %clang -target aarch64-linux-android -ccc-install-dir %t/bin \
+// RUN: --sysroot=%t/sysroot -stdlib=libc++ -fsyntax-only \
+// RUN: %s -### 2>&1 | FileCheck %s
+// CHECK-NOT: "-internal-isystem" "{{.*}}v1"
diff --git a/src/llvm-project/clang/test/Driver/arm-compiler-rt.c b/src/llvm-project/clang/test/Driver/arm-compiler-rt.c
index a7e947c..b1acd6d 100644
--- a/src/llvm-project/clang/test/Driver/arm-compiler-rt.c
+++ b/src/llvm-project/clang/test/Driver/arm-compiler-rt.c
@@ -1,21 +1,42 @@
-// RUN: %clang -target arm-linux-gnueabi -rtlib=compiler-rt -### %s 2>&1 | FileCheck %s -check-prefix ARM-GNUEABI
+// RUN: %clang -target arm-linux-gnueabi \
+// RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \
+// RUN: -rtlib=compiler-rt -### %s 2>&1 \
+// RUN: | FileCheck %s -check-prefix ARM-GNUEABI
// ARM-GNUEABI: "{{.*[/\\]}}libclang_rt.builtins-arm.a"
-// RUN: %clang -target arm-linux-gnueabi -rtlib=compiler-rt -mfloat-abi=hard -### %s 2>&1 | FileCheck %s -check-prefix ARM-GNUEABI-ABI
+// RUN: %clang -target arm-linux-gnueabi \
+// RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \
+// RUN: -rtlib=compiler-rt -mfloat-abi=hard -### %s 2>&1 \
+// RUN: | FileCheck %s -check-prefix ARM-GNUEABI-ABI
// ARM-GNUEABI-ABI: "{{.*[/\\]}}libclang_rt.builtins-armhf.a"
-// RUN: %clang -target arm-linux-gnueabihf -rtlib=compiler-rt -### %s 2>&1 | FileCheck %s -check-prefix ARM-GNUEABIHF
+// RUN: %clang -target arm-linux-gnueabihf \
+// RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \
+// RUN: -rtlib=compiler-rt -### %s 2>&1 \
+// RUN: | FileCheck %s -check-prefix ARM-GNUEABIHF
// ARM-GNUEABIHF: "{{.*[/\\]}}libclang_rt.builtins-armhf.a"
-// RUN: %clang -target arm-linux-gnueabihf -rtlib=compiler-rt -mfloat-abi=soft -### %s 2>&1 | FileCheck %s -check-prefix ARM-GNUEABIHF-ABI
+// RUN: %clang -target arm-linux-gnueabihf \
+// RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \
+// RUN: -rtlib=compiler-rt -mfloat-abi=soft -### %s 2>&1 \
+// RUN: | FileCheck %s -check-prefix ARM-GNUEABIHF-ABI
// ARM-GNUEABIHF-ABI: "{{.*[/\\]}}libclang_rt.builtins-arm.a"
-// RUN: %clang -target arm-windows-itanium -rtlib=compiler-rt -### %s 2>&1 | FileCheck %s -check-prefix ARM-WINDOWS
+// RUN: %clang -target arm-windows-itanium \
+// RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \
+// RUN: -rtlib=compiler-rt -### %s 2>&1 \
+// RUN: | FileCheck %s -check-prefix ARM-WINDOWS
// ARM-WINDOWS: "{{.*[/\\]}}clang_rt.builtins-arm.lib"
-// RUN: %clang -target arm-linux-androideabi -rtlib=compiler-rt -### %s 2>&1 | FileCheck %s -check-prefix ARM-ANDROID
+// RUN: %clang -target arm-linux-androideabi \
+// RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \
+// RUN: -rtlib=compiler-rt -### %s 2>&1 \
+// RUN: | FileCheck %s -check-prefix ARM-ANDROID
// ARM-ANDROID: "{{.*[/\\]}}libclang_rt.builtins-arm-android.a"
-// RUN: %clang -target arm-linux-androideabi -rtlib=compiler-rt -mfloat-abi=hard -### %s 2>&1 | FileCheck %s -check-prefix ARM-ANDROIDHF
+// RUN: %clang -target arm-linux-androideabi \
+// RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \
+// RUN: -rtlib=compiler-rt -mfloat-abi=hard -### %s 2>&1 \
+// RUN: | FileCheck %s -check-prefix ARM-ANDROIDHF
// ARM-ANDROIDHF: "{{.*[/\\]}}libclang_rt.builtins-armhf-android.a"
diff --git a/src/llvm-project/clang/test/Driver/arm-cortex-cpus.c b/src/llvm-project/clang/test/Driver/arm-cortex-cpus.c
index f73fc77..bb2f4ec 100644
--- a/src/llvm-project/clang/test/Driver/arm-cortex-cpus.c
+++ b/src/llvm-project/clang/test/Driver/arm-cortex-cpus.c
@@ -658,11 +658,7 @@
// RUN: %clang -target arm -mcpu=cortex-a72 -mlittle-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV8A %s
// RUN: %clang -target arm -mcpu=cortex-a73 -mlittle-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV8A %s
//
-// RUN: %clang -target arm -mcpu=exynos-m1 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV8A %s
-// RUN: %clang -target arm -mcpu=exynos-m2 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV8A %s
// RUN: %clang -target arm -mcpu=exynos-m3 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV8A %s
-// RUN: %clang -target arm -mcpu=exynos-m1 -mlittle-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV8A %s
-// RUN: %clang -target arm -mcpu=exynos-m2 -mlittle-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV8A %s
// RUN: %clang -target arm -mcpu=exynos-m3 -mlittle-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV8A %s
// CHECK-CPUV8A: "-cc1"{{.*}} "-triple" "armv8-{{.*}}
@@ -694,11 +690,7 @@
// RUN: %clang -target arm -mcpu=cortex-a72 -mbig-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV8A %s
// RUN: %clang -target arm -mcpu=cortex-a73 -mbig-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV8A %s
//
-// RUN: %clang -target armeb -mcpu=exynos-m1 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV8A %s
-// RUN: %clang -target armeb -mcpu=exynos-m2 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV8A %s
// RUN: %clang -target armeb -mcpu=exynos-m3 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV8A %s
-// RUN: %clang -target arm -mcpu=exynos-m1 -mbig-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV8A %s
-// RUN: %clang -target arm -mcpu=exynos-m2 -mbig-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV8A %s
// RUN: %clang -target arm -mcpu=exynos-m3 -mbig-endian -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV8A %s
// CHECK-BE-CPUV8A: "-cc1"{{.*}} "-triple" "armebv8-{{.*}}
@@ -733,11 +725,7 @@
// RUN: %clang -target arm -mcpu=cortex-a72 -mlittle-endian -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV8A-THUMB %s
// RUN: %clang -target arm -mcpu=cortex-a73 -mlittle-endian -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV8A-THUMB %s
//
-// RUN: %clang -target arm -mcpu=exynos-m1 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV8A-THUMB %s
-// RUN: %clang -target arm -mcpu=exynos-m2 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV8A-THUMB %s
// RUN: %clang -target arm -mcpu=exynos-m3 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV8A-THUMB %s
-// RUN: %clang -target arm -mcpu=exynos-m1 -mlittle-endian -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV8A-THUMB %s
-// RUN: %clang -target arm -mcpu=exynos-m2 -mlittle-endian -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV8A-THUMB %s
// RUN: %clang -target arm -mcpu=exynos-m3 -mlittle-endian -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV8A-THUMB %s
// CHECK-CPUV8A-THUMB: "-cc1"{{.*}} "-triple" "thumbv8-{{.*}}
@@ -769,11 +757,7 @@
// RUN: %clang -target arm -mcpu=cortex-a72 -mbig-endian -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV8A-THUMB %s
// RUN: %clang -target arm -mcpu=cortex-a73 -mbig-endian -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV8A-THUMB %s
//
-// RUN: %clang -target armeb -mcpu=exynos-m1 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV8A-THUMB %s
-// RUN: %clang -target armeb -mcpu=exynos-m2 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV8A-THUMB %s
// RUN: %clang -target armeb -mcpu=exynos-m3 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV8A-THUMB %s
-// RUN: %clang -target arm -mcpu=exynos-m1 -mbig-endian -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV8A-THUMB %s
-// RUN: %clang -target arm -mcpu=exynos-m2 -mbig-endian -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV8A-THUMB %s
// RUN: %clang -target arm -mcpu=exynos-m3 -mbig-endian -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BE-CPUV8A-THUMB %s
// CHECK-BE-CPUV8A-THUMB: "-cc1"{{.*}} "-triple" "thumbebv8-{{.*}}
diff --git a/src/llvm-project/clang/test/Driver/arm-features.c b/src/llvm-project/clang/test/Driver/arm-features.c
index b278af1..0d15f11 100644
--- a/src/llvm-project/clang/test/Driver/arm-features.c
+++ b/src/llvm-project/clang/test/Driver/arm-features.c
@@ -37,7 +37,8 @@
// RUN: %clang -target arm-arm-none-eabi -march=armv8.2a+crypto -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CRYPTO2 %s
// RUN: %clang -target arm-arm-none-eabi -march=armv8.3a+crypto -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CRYPTO2 %s
// RUN: %clang -target arm-arm-none-eabi -march=armv8.4a+crypto -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CRYPTO2 %s
-// CHECK-CRYPTO2: "-cc1"{{.*}} "-target-cpu" "generic"{{.*}} "-target-feature" "+crypto" "-target-feature" "+sha2" "-target-feature" "+aes"
+// RUN: %clang -target arm-arm-none-eabi -march=armv8.5a+crypto -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CRYPTO2 %s
+// CHECK-CRYPTO2: "-cc1"{{.*}} "-target-cpu" "generic"{{.*}} "-target-feature" "+crypto"{{.*}} "-target-feature" "+sha2" "-target-feature" "+aes"
//
// Check -crypto:
//
@@ -45,14 +46,51 @@
// RUN: %clang -target arm-arm-none-eabi -march=armv8.2a+nocrypto -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-NOCRYPTO2 %s
// RUN: %clang -target arm-arm-none-eabi -march=armv8.3a+nocrypto -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-NOCRYPTO2 %s
// RUN: %clang -target arm-arm-none-eabi -march=armv8.4a+nocrypto -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-NOCRYPTO2 %s
+// RUN: %clang -target arm-arm-none-eabi -march=armv8.5a+nocrypto -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-NOCRYPTO2 %s
// CHECK-NOCRYPTO2-NOT: "-target-feature" "+crypto" "-target-feature" "+sha2" "-target-feature" "+aes"
//
+// RUN: %clang -target arm-arm-none-eabi -mcpu=cortex-a57+crypto -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CRYPTO2-CPU %s
+// RUN: %clang -target arm-arm-none-eabi -mcpu=cortex-a57 -mfpu=crypto-neon-fp-armv8 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CRYPTO2-CPU %s
+// CHECK-CRYPTO2-CPU: "-cc1"{{.*}} "-target-cpu" "cortex-a57"{{.*}} "-target-feature" "+crypto"{{.*}} "-target-feature" "+sha2" "-target-feature" "+aes"
+//
+// RUN: %clang -target arm-arm-none-eabi -mcpu=cortex-a57+norypto -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-NOCRYPTO2-CPU %s
+// RUN: %clang -target arm-arm-none-eabi -mcpu=cortex-a57 -mfpu=neon-fp-armv8 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-NOCRYPTO2-CPU %s
+// CHECK-NOCRYPTO2-CPU-NOT: "-cc1"{{.*}} "-target-cpu" "cortex-a57"{{.*}} "-target-feature" "+crypto"{{.*}} "-target-feature" "+sha2" "-target-feature" "+aes"
+//
// Check +crypto -sha2 -aes:
//
// RUN: %clang -target arm-arm-none-eabi -march=armv8.1a+crypto+nosha2+noaes -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CRYPTO3 %s
+// RUN: %clang -target arm-arm-none-eabi -mcpu=cortex-a57+crypto+nosha2+noaes -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CRYPTO3 %s
+// RUN: %clang -target arm-arm-none-eabi -mcpu=cortex-a57+nosha2+noaes -mfpu=crypto-neon-fp-armv8 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CRYPTO3 %s
// CHECK-CRYPTO3-NOT: "-target-feature" "+sha2" "-target-feature" "+aes"
//
// Check -crypto +sha2 +aes:
//
// RUN: %clang -target arm-arm-none-eabi -march=armv8.1a+nocrypto+sha2+aes -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CRYPTO4 %s
+// RUN: %clang -target arm-arm-none-eabi -mcpu=cortex-a57+nocrypto+sha2+aes -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CRYPTO4 %s
+// RUN: %clang -target arm-arm-none-eabi -mcpu=cortex-a57+sha2+aes -mfpu=neon-fp-armv8 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CRYPTO4 %s
// CHECK-CRYPTO4: "-target-feature" "+sha2" "-target-feature" "+aes"
+//
+// Check +crypto for M and R profiles:
+//
+// RUN: %clang -target arm-arm-none-eabi -march=armv8-r+crypto -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-NOCRYPTO5 %s
+// RUN: %clang -target arm-arm-none-eabi -march=armv8-m.base+crypto -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-NOCRYPTO5 %s
+// RUN: %clang -target arm-arm-none-eabi -march=armv8-m.main+crypto -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-NOCRYPTO5 %s
+// RUN: %clang -target arm-arm-none-eabi -mcpu=cortex-m23+crypto -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-NOCRYPTO5 %s
+// CHECK-NOCRYPTO5: warning: ignoring extension 'crypto' because the {{.*}} architecture does not support it
+// CHECK-NOCRYPTO5-NOT: "-target-feature" "+crypto"{{.*}} "-target-feature" "+sha2" "-target-feature" "+aes"
+//
+// Check +crypto does not affect -march=armv7a -mfpu=crypto-neon-fp-armv8, but it does warn that +crypto has no effect
+// RUN: %clang -target arm-none-none-eabi -fno-integrated-as -march=armv7a -mfpu=crypto-neon-fp-armv8 -### -c %s 2>&1 | FileCheck -check-prefixes=CHECK-WARNONLY,ALL %s
+// RUN: %clang -target arm-none-none-eabi -fno-integrated-as -march=armv7a+aes -mfpu=crypto-neon-fp-armv8 -### -c %s 2>&1 | FileCheck -check-prefixes=CHECK-WARNONLY,ALL,CHECK-HASAES %s
+// RUN: %clang -target arm-none-none-eabi -fno-integrated-as -march=armv7a+sha2 -mfpu=crypto-neon-fp-armv8 -### -c %s 2>&1 | FileCheck -check-prefixes=CHECK-WARNONLY,ALL,CHECK-HASSHA %s
+// RUN: %clang -target arm-none-none-eabi -fno-integrated-as -march=armv7a+sha2+aes -mfpu=crypto-neon-fp-armv8 -### -c %s 2>&1 | FileCheck -check-prefixes=CHECK-WARNONLY,ALL,CHECK-HASSHA,CHECK-HASAES %s
+// RUN: %clang -target arm-none-none-eabi -fno-integrated-as -march=armv7a+aes -mfpu=neon-fp-armv8 -### -c %s 2>&1 | FileCheck -check-prefixes=ALL,CHECK-HASAES %s
+// RUN: %clang -target arm-none-none-eabi -fno-integrated-as -march=armv7a+sha2 -mfpu=neon-fp-armv8 -### -c %s 2>&1 | FileCheck -check-prefixes=ALL,CHECK-HASSHA %s
+// RUN: %clang -target arm-none-none-eabi -fno-integrated-as -march=armv7a+sha2+aes -mfpu=neon-fp-armv8 -### -c %s 2>&1 | FileCheck -check-prefixes=ALL,CHECK-HASSHA,CHECK-HASAES %s
+// CHECK-WARNONLY: warning: ignoring extension 'crypto' because the 'armv7-a' architecture does not support it
+// ALL: "-target-feature"
+// CHECK-WARNONLY-NOT: "-target-feature" "-crypto"
+// CHECK-HASSHA-SAME: "-target-feature" "+sha2"
+// CHECK-HASAES-SAME: "-target-feature" "+aes"
+//
diff --git a/src/llvm-project/clang/test/Driver/arm-mfpu.c b/src/llvm-project/clang/test/Driver/arm-mfpu.c
index 4b0289b..c3731fa 100644
--- a/src/llvm-project/clang/test/Driver/arm-mfpu.c
+++ b/src/llvm-project/clang/test/Driver/arm-mfpu.c
@@ -35,7 +35,7 @@
// CHECK-SOFT-ABI-FP-2-DAG: "-target-feature" "-fp-armv8d16sp"
// CHECK-SOFT-ABI-FP-2-DAG: "-target-feature" "-neon"
// CHECK-SOFT-ABI-FP-2-DAG: "-target-feature" "-crypto"
-// CHECK-SOFT-ABI-FP-2-DAG: "-target-feature" "-vfp2d16sp"
+// CHECK-SOFT-ABI-FP-2-DAG: "-target-feature" "-vfp2sp"
// RUN: %clang -target arm-linux-eabi -mfpu=vfp3 %s -### -o %t.o 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-VFP3 %s
@@ -50,7 +50,7 @@
// CHECK-VFP3-DAG: "-target-feature" "-fp-armv8d16sp"
// CHECK-VFP3-DAG: "-target-feature" "-neon"
// CHECK-SOFT-ABI-FP-3-DAG: "-target-feature" "+soft-float-abi"
-// CHECK-SOFT-ABI-FP-3-DAG: "-target-feature" "-vfp2d16sp"
+// CHECK-SOFT-ABI-FP-3-DAG: "-target-feature" "-vfp2sp"
// CHECK-SOFT-ABI-FP-3-DAG: "-target-feature" "-vfp4d16sp"
// CHECK-SOFT-ABI-FP-3-DAG: "-target-feature" "-fp-armv8d16sp"
// CHECK-SOFT-ABI-FP-3-DAG: "-target-feature" "-neon"
@@ -84,7 +84,7 @@
// CHECK-VFP3-D16-DAG: "-target-feature" "-vfp4d16sp"
// CHECK-VFP3-D16-DAG: "-target-feature" "-fp-armv8d16sp"
// CHECK-VFP3-D16-DAG: "-target-feature" "+fp64"
-// CHECK-VFP3-D16-NOT: "-target-feature" "+d32"
+// CHECK-VFP3-D16-DAG: "-target-feature" "-d32"
// CHECK-VFP3-D16-DAG: "-target-feature" "-neon"
// RUN: %clang -target arm-linux-eabi -mfpu=vfpv3-d16-fp16 %s -### -o %t.o 2>&1 \
@@ -98,7 +98,7 @@
// CHECK-VFP3-D16-FP16-DAG: "-target-feature" "-vfp4d16sp"
// CHECK-VFP3-D16-FP16-DAG: "-target-feature" "-fp-armv8d16sp"
// CHECK-VFP3-D16-FP16-DAG: "-target-feature" "+fp64"
-// CHECK-VFP3-D16-FP16-NOT: "-target-feature" "+d32"
+// CHECK-VFP3-D16-FP16-DAG: "-target-feature" "-d32"
// CHECK-VFP3-D16-FP16-DAG: "-target-feature" "-neon"
// CHECK-VFP3-D16-FP16-DAG: "-target-feature" "-crypto"
@@ -108,8 +108,8 @@
// RUN: | FileCheck --check-prefix=CHECK-SOFT-ABI-FP-3 %s
// CHECK-VFP3XD-NOT: "-target-feature" "+soft-float"
// CHECK-VFP3XD-DAG: "-target-feature" "+soft-float-abi"
-// CHECK-VFP3XD-NOT: "-target-feature" "+fp64"
-// CHECK-VFP3XD-NOT: "-target-feature" "+d32"
+// CHECK-VFP3XD-DAG: "-target-feature" "-fp64"
+// CHECK-VFP3XD-DAG: "-target-feature" "-d32"
// CHECK-VFP3XD-DAG: "-target-feature" "+vfp3d16sp"
// CHECK-VFP3XD-DAG: "-target-feature" "-fp16"
// CHECK-VFP3XD-DAG: "-target-feature" "-vfp4d16sp"
@@ -127,8 +127,8 @@
// CHECK-VFP3XD-FP16-DAG: "-target-feature" "+fp16"
// CHECK-VFP3XD-FP16-DAG: "-target-feature" "-vfp4d16sp"
// CHECK-VFP3XD-FP16-DAG: "-target-feature" "-fp-armv8d16sp"
-// CHECK-VFP3XD-FP16-NOT: "-target-feature" "+fp64"
-// CHECK-VFP3XD-FP16-NOT: "-target-feature" "+d32"
+// CHECK-VFP3XD-FP16-DAG: "-target-feature" "-fp64"
+// CHECK-VFP3XD-FP16-DAG: "-target-feature" "-d32"
// CHECK-VFP3XD-FP16-DAG: "-target-feature" "-neon"
// CHECK-VFP3XD-FP16-DAG: "-target-feature" "-crypto"
@@ -144,7 +144,7 @@
// CHECK-VFP4-DAG: "-target-feature" "-fp-armv8d16sp"
// CHECK-VFP4-DAG: "-target-feature" "-neon"
// CHECK-SOFT-ABI-FP-4-DAG: "-target-feature" "+soft-float-abi"
-// CHECK-SOFT-ABI-FP-4-DAG: "-target-feature" "-vfp2d16sp"
+// CHECK-SOFT-ABI-FP-4-DAG: "-target-feature" "-vfp2sp"
// CHECK-SOFT-ABI-FP-4-DAG: "-target-feature" "-vfp3d16sp"
// CHECK-SOFT-ABI-FP-4-DAG: "-target-feature" "-fp-armv8d16sp"
// CHECK-SOFT-ABI-FP-4-DAG: "-target-feature" "-neon"
@@ -162,7 +162,7 @@
// CHECK-VFP4-D16-DAG: "-target-feature" "+vfp4d16"
// CHECK-VFP4-D16-DAG: "-target-feature" "-fp-armv8d16sp"
// CHECK-VFP4-D16-DAG: "-target-feature" "+fp64"
-// CHECK-VFP4-D16-NOT: "-target-feature" "+d32"
+// CHECK-VFP4-D16-DAG: "-target-feature" "-d32"
// CHECK-VFP4-D16-DAG: "-target-feature" "-neon"
// RUN: %clang -target arm-linux-eabi -mfpu=fp4-sp-d16 %s -### -o %t.o 2>&1 \
@@ -175,8 +175,8 @@
// CHECK-FP4-SP-D16-DAG: "-target-feature" "+soft-float-abi"
// CHECK-FP4-SP-D16-DAG: "-target-feature" "+vfp4d16sp"
// CHECK-FP4-SP-D16-DAG: "-target-feature" "-fp-armv8d16sp"
-// CHECK-FP4-SP-D16-NOT: "-target-feature" "+fp64"
-// CHECK-FP4-SP-D16-NOT: "-target-feature" "+d32"
+// CHECK-FP4-SP-D16-DAG: "-target-feature" "-fp64"
+// CHECK-FP4-SP-D16-DAG: "-target-feature" "-d32"
// CHECK-FP4-SP-D16-DAG: "-target-feature" "-neon"
// RUN: %clang -target arm-linux-eabi -mfpu=fp5-sp-d16 %s -### -o %t.o 2>&1 \
@@ -189,8 +189,8 @@
// CHECK-FP5-SP-D16-DAG: "-target-feature" "+soft-float-abi"
// CHECK-FP5-SP-D16-DAG: "-target-feature" "+fp-armv8d16sp"
// CHECK-FP5-SP-D16-DAG: "-target-feature" "-neon"
-// CHECK-FP5-SP-D16-NOT: "-target-feature" "+fp64"
-// CHECK-FP5-SP-D16-NOT: "-target-feature" "+d32"
+// CHECK-FP5-SP-D16-DAG: "-target-feature" "-fp64"
+// CHECK-FP5-SP-D16-DAG: "-target-feature" "-d32"
// CHECK-FP5-SP-D16-DAG: "-target-feature" "-crypto"
// RUN: %clang -target arm-linux-eabi -mfpu=fp5-dp-d16 %s -### -o %t.o 2>&1 \
@@ -203,12 +203,12 @@
// CHECK-FP5-DP-D16-DAG: "-target-feature" "+soft-float-abi"
// CHECK-FP5-DP-D16-DAG: "-target-feature" "+fp-armv8d16"
// CHECK-FP5-DP-D16-DAG: "-target-feature" "+fp64"
-// CHECK-FP5-DP-D16-NOT: "-target-feature" "+d32"
+// CHECK-FP5-DP-D16-DAG: "-target-feature" "-d32"
// CHECK-FP5-DP-D16-DAG: "-target-feature" "-neon"
// CHECK-FP5-DP-D16-DAG: "-target-feature" "-crypto"
// CHECK-SOFT-ABI-FP-5-DAG: "-target-feature" "+soft-float"
// CHECK-SOFT-ABI-FP-5-DAG: "-target-feature" "+soft-float-abi"
-// CHECK-SOFT-ABI-FP-5-DAG: "-target-feature" "-vfp2d16sp"
+// CHECK-SOFT-ABI-FP-5-DAG: "-target-feature" "-vfp2sp"
// CHECK-SOFT-ABI-FP-5-DAG: "-target-feature" "-vfp3d16sp"
// CHECK-SOFT-ABI-FP-5-DAG: "-target-feature" "-vfp4d16sp"
// CHECK-SOFT-ABI-FP-5-DAG: "-target-feature" "-neon"
@@ -222,7 +222,7 @@
// CHECK-NEON-NOT: "-target-feature" "+soft-float"
// CHECK-NEON-DAG: "-target-feature" "+neon"
// CHECK-SOFT-ABI-FP-6-DAG: "-target-feature" "+soft-float-abi"
-// CHECK-SOFT-ABI-FP-6-DAG: "-target-feature" "-vfp2d16sp"
+// CHECK-SOFT-ABI-FP-6-DAG: "-target-feature" "-vfp2sp"
// CHECK-SOFT-ABI-FP-6-DAG: "-target-feature" "-vfp4d16sp"
// CHECK-SOFT-ABI-FP-6-DAG: "-target-feature" "-fp-armv8d16sp"
// CHECK-SOFT-ABI-FP-6-DAG: "-target-feature" "-crypto"
@@ -262,7 +262,7 @@
// CHECK-NEON-VFPV4-DAG: "-target-feature" "+vfp4"
// CHECK-NEON-VFPV4-DAG: "-target-feature" "+neon"
// CHECK-SOFT-ABI-FP-7-DAG: "-target-feature" "+soft-float-abi"
-// CHECK-SOFT-ABI-FP-7-DAG: "-target-feature" "-vfp2d16sp"
+// CHECK-SOFT-ABI-FP-7-DAG: "-target-feature" "-vfp2sp"
// CHECK-SOFT-ABI-FP-7-DAG: "-target-feature" "-vfp3d16sp"
// CHECK-SOFT-ABI-FP-7-DAG: "-target-feature" "-fp-armv8d16sp"
// CHECK-SOFT-ABI-FP-7-DAG: "-target-feature" "-crypto"
@@ -276,7 +276,7 @@
// RUN: %clang -target armv8a -mfpu=neon %s -### -c 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-SOFT-ABI-FP-8 %s
// CHECK-SOFT-ABI-FP-8-DAG: "-target-feature" "+soft-float-abi"
-// CHECK-SOFT-ABI-FP-8-DAG: "-target-feature" "-vfp2d16sp"
+// CHECK-SOFT-ABI-FP-8-DAG: "-target-feature" "-vfp2sp"
// CHECK-SOFT-ABI-FP-8-DAG: "-target-feature" "-vfp4d16sp"
// CHECK-SOFT-ABI-FP-8-DAG: "-target-feature" "-fp-armv8d16sp"
// CHECK-SOFT-ABI-FP-8-DAG: "-target-feature" "-crypto"
@@ -319,12 +319,12 @@
// CHECK-NO-FP-NOT: "-target-feature" "+soft-float"
// CHECK-NO-FP-DAG: "-target-feature" "+soft-float-abi"
// CHECK-NO-FP-DAG: "-target-feature" "-fpregs"
-// CHECK-NO-FP-DAG: "-target-feature" "-vfp2d16sp"
+// CHECK-NO-FP-DAG: "-target-feature" "-vfp2sp"
// CHECK-NO-FP-DAG: "-target-feature" "-vfp3d16sp"
// CHECK-NO-FP-DAG: "-target-feature" "-vfp4d16sp"
// CHECK-NO-FP-DAG: "-target-feature" "-fp-armv8d16sp"
-// CHECK-NO-FP-NOT: "-target-feature" "+fp64"
-// CHECK-NO-FP-NOT: "-target-feature" "+d32"
+// CHECK-NO-FP-DAG: "-target-feature" "-fp64"
+// CHECK-NO-FP-DAG: "-target-feature" "-d32"
// CHECK-NO-FP-DAG: "-target-feature" "-neon"
// CHECK-NO-FP-DAG: "-target-feature" "-crypto"
@@ -358,7 +358,7 @@
// RUN: | FileCheck --check-prefix=CHECK-SOFT-ABI-FP %s
// CHECK-SOFT-ABI-FP-DAG: "-target-feature" "+soft-float"
// CHECK-SOFT-ABI-FP-DAG: "-target-feature" "+soft-float-abi"
-// CHECK-SOFT-ABI-FP-DAG: "-target-feature" "-vfp2d16sp"
+// CHECK-SOFT-ABI-FP-DAG: "-target-feature" "-vfp2sp"
// CHECK-SOFT-ABI-FP-DAG: "-target-feature" "-vfp3d16sp"
// CHECK-SOFT-ABI-FP-DAG: "-target-feature" "-vfp4d16sp"
// CHECK-SOFT-ABI-FP-DAG: "-target-feature" "-fp-armv8d16sp"
@@ -382,8 +382,8 @@
// CHECK-ARM7-ANDROID-FP-DEFAULT-NOT: "-target-feature" "+soft-float"
// CHECK-ARM7-ANDROID-FP-DEFAULT-DAG: "-target-feature" "+soft-float-abi"
// CHECK-ARM7-ANDROID-FP-DEFAULT-DAG: "-target-feature" "+vfp3"
-// CHECK-ARM7-ANDROID-FP-DEFAULT-NOT: "-target-feature" "+vfp4"
-// CHECK-ARM7-ANDROID-FP-DEFAULT-NOT: "-target-feature" "+fp-armv8"
+// CHECK-ARM7-ANDROID-FP-DEFAULT-DAG: "-target-feature" "-vfp4"
+// CHECK-ARM7-ANDROID-FP-DEFAULT-DAG: "-target-feature" "-fp-armv8"
// CHECK-ARM7-ANDROID-FP-DEFAULT-DAG: "-target-feature" "+neon"
// CHECK-ARM7-ANDROID-FP-DEFAULT-NOT: "-target-feature" "+crypto"
@@ -391,9 +391,35 @@
// RUN: | FileCheck --check-prefix=CHECK-ARM7-ANDROID-FP-D16 %s
// CHECK-ARM7-ANDROID-FP-D16-NOT: "-target-feature" "+soft-float"
// CHECK-ARM7-ANDROID-FP-D16-DAG: "-target-feature" "+soft-float-abi"
-// CHECK-ARM7-ANDROID-FP-D16-NOT: "-target-feature" "+d32"
+// CHECK-ARM7-ANDROID-FP-D16-DAG: "-target-feature" "-d32"
// CHECK-ARM7-ANDROID-FP-D16-DAG: "-target-feature" "+vfp3d16"
// CHECK-ARM7-ANDROID-FP-D16-NOT: "-target-feature" "+vfp4"
// CHECK-ARM7-ANDROID-FP-D16-NOT: "-target-feature" "+fp-armv8"
// CHECK-ARM7-ANDROID-FP-D16-NOT: "-target-feature" "+neon"
// CHECK-ARM7-ANDROID-FP-D16-NOT: "-target-feature" "+crypto"
+
+// RUN: %clang -target arm-none-none-eabi %s -march=armv8.1-m.main+mve.fp+fp.dp -mfloat-abi=soft -### -c 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-SOFTFLOATABI-INHIBITS-MVE %s
+// CHECK-SOFTFLOATABI-INHIBITS-MVE-NOT: "-target-feature" "+mve"
+// CHECK-SOFTFLOATABI-INHIBITS-MVE-DAG: "-target-feature" "-mve"
+// CHECK-SOFTFLOATABI-INHIBITS-MVE-DAG: "-target-feature" "-mve.fp"
+
+// RUN: %clang -target arm-none-none-eabi %s -march=armv8.1-m.main+mve.fp -mfpu=none -### -c 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-MVEFP-FPUNONE %s
+// CHECK-MVEFP-FPUNONE-DAG: "-target-feature" "-vfp2sp"
+// CHECK-MVEFP-FPUNONE-DAG: "-target-feature" "-vfp3d16sp"
+// CHECK-MVEFP-FPUNONE-DAG: "-target-feature" "-vfp4d16sp"
+// CHECK-MVEFP-FPUNONE-DAG: "-target-feature" "-fp-armv8d16sp"
+// CHECK-MVEFP-FPUNONE-DAG: "-target-feature" "-fp64"
+// CHECK-MVEFP-FPUNONE-DAG: "-target-feature" "-d32"
+// CHECK-MVEFP-FPUNONE-DAG: "-target-feature" "-neon"
+// CHECK-MVEFP-FPUNONE-DAG: "-target-feature" "-crypto"
+// CHECK-MVEFP-FPUNONE-DAG: "-target-feature" "-mve.fp"
+// CHECK-MVEFP-FPUNONE-NOT: "-target-feature" "-fpregs"
+
+
+// RUN: %clang -target arm-none-none-eabi %s -march=armv8.1-m.main+mve -mfpu=none -### -c 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-MVEI-FPUNONE %s
+// CHECK-MVEI-FPUNONE-DAG: "-target-feature" "-mve.fp"
+// CHECK-MVEI-FPUNONE-DAG: "-target-feature" "+mve"
+// CHECK-MVEI-FPUNONE-NOT: "-target-feature" "-fpregs"
diff --git a/src/llvm-project/clang/test/Driver/arm64-as.s b/src/llvm-project/clang/test/Driver/arm64-as.s
index 061e5b2..956ea93 100644
--- a/src/llvm-project/clang/test/Driver/arm64-as.s
+++ b/src/llvm-project/clang/test/Driver/arm64-as.s
@@ -2,4 +2,4 @@
// RUN: %clang -target arm64-apple-ios -arch arm64 -### -c %s 2>&1 | FileCheck -check-prefix=TARGET %s
//
// TARGET: "-cc1as"
-// TARGET: "-target-cpu" "cyclone"
+// TARGET: "-target-cpu" "apple-a7"
diff --git a/src/llvm-project/clang/test/Driver/arm64_32-link.c b/src/llvm-project/clang/test/Driver/arm64_32-link.c
new file mode 100644
index 0000000..972ae6a
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/arm64_32-link.c
@@ -0,0 +1,4 @@
+// RUN: %clang -target x86_64-apple-darwin -arch arm64_32 -miphoneos-version-min=8.0 %s -### 2>&1 | FileCheck %s
+
+// CHECK: "-cc1"{{.*}} "-triple" "aarch64_32-apple-ios8.0.0"
+// CHECK: ld{{.*}} "-arch" "arm64_32"
diff --git a/src/llvm-project/clang/test/Driver/as-no-warnings.c b/src/llvm-project/clang/test/Driver/as-no-warnings.c
new file mode 100644
index 0000000..4338d11
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/as-no-warnings.c
@@ -0,0 +1,23 @@
+// RUN: %clang -### %s -c -o tmp.o -target i686-pc-linux-gnu -fno-integrated-as -Wa,--no-warn 2>&1 | FileCheck -check-prefix=CHECK-NOIAS %s
+// RUN: %clang -### %s -c -o tmp.o -integrated-as -Wa,--no-warn 2>&1 | FileCheck %s
+
+/// -W is alias for --no-warn.
+// RUN: %clang -### %s -c -o tmp.o -target i686-pc-linux-gnu -fno-integrated-as -Wa,-W 2>&1 | FileCheck -check-prefix=CHECK-NOIAS %s
+// RUN: %clang -### %s -c -o tmp.o -integrated-as -Wa,-W 2>&1 | FileCheck %s
+
+// RUN: %clang %s -c -o %t.o -integrated-as -Wa,--no-warn 2>&1 | FileCheck -allow-empty --check-prefix=CHECK-AS-NOWARN %s
+// RUN: %clang %s -c -o %t.o -target i686-pc-linux-gnu -fno-integrated-as -Wa,--no-warn 2>&1 | FileCheck -allow-empty --check-prefix=CHECK-AS-NOWARN %s
+// RUN: not %clang %s -c -o %t.o -target i686-pc-linux-gnu -integrated-as -Wa,--fatal-warnings 2>&1 | FileCheck --check-prefix=CHECK-AS-FATAL %s
+// RUN: not %clang %s -c -o %t.o -target i686-pc-linux-gnu -fno-integrated-as -Wa,--fatal-warnings 2>&1 | FileCheck --check-prefix=CHECK-AS-FATAL %s
+
+// REQUIRES: clang-driver
+// REQUIRES: x86-registered-target
+// REQUIRES: linux
+
+// CHECK: "-cc1" {{.*}} "-massembler-no-warn"
+// CHECK-NOIAS: "--no-warn"
+// CHECK-AS-NOWARN-NOT: warning:
+// CHECK-AS-FATAL-NOT: warning:
+// CHECK-AS-FATAL: error
+
+__asm(".warning");
diff --git a/src/llvm-project/clang/test/Driver/as-options.s b/src/llvm-project/clang/test/Driver/as-options.s
index 405030f..6426968 100644
--- a/src/llvm-project/clang/test/Driver/as-options.s
+++ b/src/llvm-project/clang/test/Driver/as-options.s
@@ -35,3 +35,84 @@
// RUN: | FileCheck %s
// CHECK: "-I" "foo_dir"
+
+// Test that assembler options don't cause warnings when there's no assembler
+// stage.
+
+// RUN: %clang -mincremental-linker-compatible -E -fintegrated-as \
+// RUN: -o /dev/null -x c++ %s 2>&1 \
+// RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s
+// RUN: %clang -mincremental-linker-compatible -E -fno-integrated-as \
+// RUN: -o /dev/null -x c++ %s 2>&1 \
+// RUN: | FileCheck --check-prefix=WARN --allow-empty %s
+
+// RUN: %clang -mincremental-linker-compatible -E -fintegrated-as \
+// RUN: -o /dev/null -x assembler-with-cpp %s 2>&1 \
+// RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s
+// RUN: %clang -mincremental-linker-compatible -E -fno-integrated-as \
+// RUN: -o /dev/null -x assembler-with-cpp %s 2>&1 \
+// RUN: | FileCheck --check-prefix=WARN --allow-empty %s
+
+// RUN: %clang -mimplicit-it=always -target armv7-linux-gnueabi -E \
+// RUN: -fintegrated-as -o /dev/null -x c++ %s 2>&1 \
+// RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s
+// RUN: %clang -mimplicit-it=always -target armv7-linux-gnueabi -E \
+// RUN: -fno-integrated-as -o /dev/null -x c++ %s 2>&1 \
+// RUN: | FileCheck --check-prefix=WARN --allow-empty %s
+
+// RUN: %clang -mimplicit-it=always -target armv7-linux-gnueabi -E \
+// RUN: -fintegrated-as -o /dev/null -x assembler-with-cpp %s 2>&1 \
+// RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s
+// RUN: %clang -mimplicit-it=always -target armv7-linux-gnueabi -E \
+// RUN: -fno-integrated-as -o /dev/null -x assembler-with-cpp %s 2>&1 \
+// RUN: | FileCheck --check-prefix=WARN --allow-empty %s
+
+// RUN: %clang -Wa,-mbig-obj -target i386-pc-windows -E -fintegrated-as \
+// RUN: -o /dev/null -x c++ %s 2>&1 \
+// RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s
+// RUN: %clang -Wa,-mbig-obj -target i386-pc-windows -E -fno-integrated-as \
+// RUN: -o /dev/null -x c++ %s 2>&1 \
+// RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s
+
+// RUN: %clang -Wa,-mbig-obj -target i386-pc-windows -E -fintegrated-as \
+// RUN: -o /dev/null -x assembler-with-cpp %s 2>&1 \
+// RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s
+// RUN: %clang -Wa,-mbig-obj -target i386-pc-windows -E -fno-integrated-as \
+// RUN: -o /dev/null -x assembler-with-cpp %s 2>&1 \
+// RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s
+
+// RUN: %clang -Xassembler -mbig-obj -target i386-pc-windows -E -fintegrated-as \
+// RUN: -o /dev/null -x c++ %s 2>&1 \
+// RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s
+// RUN: %clang -Xassembler -mbig-obj -target i386-pc-windows -E \
+// RUN: -fno-integrated-as -o /dev/null -x c++ %s 2>&1 \
+// RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s
+
+// RUN: %clang -Xassembler -mbig-obj -target i386-pc-windows -E -fintegrated-as \
+// RUN: -o /dev/null -x assembler-with-cpp %s 2>&1 \
+// RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s
+// RUN: %clang -Xassembler -mbig-obj -target i386-pc-windows -E \
+// RUN: -fno-integrated-as -o /dev/null -x assembler-with-cpp %s 2>&1 \
+// RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s
+
+// NOWARN-NOT: unused
+
+// Test that unsupported arguments do not cause errors when -fno-integrated-as
+// is set.
+// RUN: %clang -Wa,-mno-warn-deprecated -fno-integrated-as %s -S 2>&1 \
+// RUN: | FileCheck --check-prefix=NOERROR --allow-empty %s
+// NOERROR-NOT: error: unsupported argument '-mno-warn-deprecated' to option 'Wa,'
+
+// -Wa flags shouldn't cause warnings without an assembler stage with
+// -fno-integrated-as either.
+// RUN: %clang -Wa,-mno-warn-deprecated -fno-integrated-as -x c++ %s -S 2>&1 \
+// RUN: -o /dev/null \
+// RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s
+
+// But -m flags for the integrated assembler _should_ warn if the integrated
+// assembler is not in use.
+// RUN: %clang -mrelax-all -fintegrated-as -x c++ %s -S -o /dev/null 2>&1 \
+// RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s
+// RUN: %clang -mrelax-all -fno-integrated-as -x c++ %s -S -o /dev/null 2>&1 \
+// RUN: | FileCheck --check-prefix=WARN --allow-empty %s
+// WARN: unused
diff --git a/src/llvm-project/clang/test/Driver/cc-log-diagnostics.c b/src/llvm-project/clang/test/Driver/cc-log-diagnostics.c
index 88c99f5..069d2ad 100644
--- a/src/llvm-project/clang/test/Driver/cc-log-diagnostics.c
+++ b/src/llvm-project/clang/test/Driver/cc-log-diagnostics.c
@@ -29,7 +29,7 @@
// CHECK: <key>column</key>
// CHECK: <integer>11</integer>
// CHECK: <key>message</key>
-// CHECK: <string>control reaches end of non-void function</string>
+// CHECK: <string>non-void function does not return a value</string>
// CHECK: </dict>
// CHECK: </array>
// CHECK: </dict>
diff --git a/src/llvm-project/clang/test/Driver/cc-print-options.c b/src/llvm-project/clang/test/Driver/cc-print-options.c
index 77dd0fe..dc7f4a3 100644
--- a/src/llvm-project/clang/test/Driver/cc-print-options.c
+++ b/src/llvm-project/clang/test/Driver/cc-print-options.c
@@ -3,5 +3,6 @@
// RUN: %clang -no-canonical-prefixes -S -o %t.s %s
// RUN: FileCheck %s < %t.log
-// CHECK: [Logging clang options]{{.*}}clang{{.*}}"-S"
+// CHECK: [Logging clang options]
+// CHECK: {{.*}}clang{{.*}}"-S"
diff --git a/src/llvm-project/clang/test/Driver/cc1-spawnprocess.c b/src/llvm-project/clang/test/Driver/cc1-spawnprocess.c
new file mode 100644
index 0000000..8af8cc4
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/cc1-spawnprocess.c
@@ -0,0 +1,37 @@
+// RUN: %clang -fintegrated-cc1 -c -### %s 2>&1 | FileCheck %s --check-prefix=YES
+// RUN: %clang -fno-integrated-cc1 -c -### %s 2>&1 | FileCheck %s --check-prefix=NO
+
+// RUN: %clang -fintegrated-cc1 -fno-integrated-cc1 -c -### %s 2>&1 \
+// RUN: | FileCheck %s --check-prefix=NO
+// RUN: %clang -fno-integrated-cc1 -fintegrated-cc1 -c -### %s 2>&1 \
+// RUN: | FileCheck %s --check-prefix=YES
+
+// RUN: %clang_cl -fintegrated-cc1 -c -### -- %s 2>&1 \
+// RUN: | FileCheck %s --check-prefix=YES
+// RUN: %clang_cl -fno-integrated-cc1 -c -### -- %s 2>&1 \
+// RUN: | FileCheck %s --check-prefix=NO
+
+// RUN: env CCC_OVERRIDE_OPTIONS=+-fintegrated-cc1 \
+// RUN: %clang -fintegrated-cc1 -c -### %s 2>&1 \
+// RUN: | FileCheck %s --check-prefix=YES
+// RUN: env CCC_OVERRIDE_OPTIONS=+-fno-integrated-cc1 \
+// RUN: %clang -fintegrated-cc1 -c -### %s 2>&1 \
+// RUN: | FileCheck %s --check-prefix=NO
+
+// YES: (in-process)
+// NO-NOT: (in-process)
+
+// The following tests ensure that only one integrated-cc1 is executed.
+
+// Only one TU, one job, thus integrated-cc1 is enabled.
+// RUN: %clang -fintegrated-cc1 -c %s -### 2>&1 | FileCheck %s --check-prefix=YES
+
+// Only one TU, but we're linking, two jobs, thus integrated-cc1 is disabled.
+// RUN: %clang -fintegrated-cc1 %s -### 2>&1 | FileCheck %s --check-prefix=NO
+
+// RUN: echo 'int main() { return f() + g(); }' > %t1.cpp
+// RUN: echo 'int f() { return 1; }' > %t2.cpp
+// RUN: echo 'int g() { return 2; }' > %t3.cpp
+
+// Three jobs, thus integrated-cc1 is disabled.
+// RUN: %clang -fintegrated-cc1 -c %t1.cpp %t2.cpp %t3.cpp -### 2>&1 | FileCheck %s --check-prefix=NO
diff --git a/src/llvm-project/clang/test/Driver/check-time-trace-sections.cpp b/src/llvm-project/clang/test/Driver/check-time-trace-sections.cpp
new file mode 100644
index 0000000..2dbe203
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/check-time-trace-sections.cpp
@@ -0,0 +1,6 @@
+// RUN: %clangxx -S -ftime-trace -ftime-trace-granularity=0 -o %T/check-time-trace-sections %s
+// RUN: cat %T/check-time-trace-sections.json | %python %S/check-time-trace-sections.py
+
+template <typename T>
+void foo(T) {}
+void bar() { foo(0); }
diff --git a/src/llvm-project/clang/test/Driver/check-time-trace-sections.py b/src/llvm-project/clang/test/Driver/check-time-trace-sections.py
new file mode 100644
index 0000000..7b59853
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/check-time-trace-sections.py
@@ -0,0 +1,25 @@
+#!/usr/bin/env python
+
+import json, sys
+
+def is_inside(range1, range2):
+ a = range1["ts"]; b = a + range1["dur"]
+ c = range2["ts"]; d = c + range2["dur"]
+ return (a >= c and a <= d) and (b >= c and b <= d)
+
+def is_before(range1, range2):
+ b = range1["ts"] + range1["dur"]; c = range2["ts"]
+ return b <= c
+
+events = json.loads(sys.stdin.read())["traceEvents"]
+codegens = [event for event in events if event["name"] == "CodeGen Function"]
+frontends = [event for event in events if event["name"] == "Frontend"]
+backends = [event for event in events if event["name"] == "Backend"]
+
+if not all([any([is_inside(codegen, frontend) for frontend in frontends])
+ for codegen in codegens]):
+ sys.exit("Not all CodeGen sections are inside any Frontend section!")
+
+if not all([all([is_before(frontend, backend) for frontend in frontends])
+ for backend in backends]):
+ sys.exit("Not all Frontend section are before all Backend sections!")
diff --git a/src/llvm-project/clang/test/Driver/check-time-trace.cpp b/src/llvm-project/clang/test/Driver/check-time-trace.cpp
index 0809108..bff2c19 100644
--- a/src/llvm-project/clang/test/Driver/check-time-trace.cpp
+++ b/src/llvm-project/clang/test/Driver/check-time-trace.cpp
@@ -1,5 +1,4 @@
-// REQUIRES: shell
-// RUN: %clangxx -S -ftime-trace -mllvm --time-trace-granularity=0 -o %T/check-time-trace %s
+// RUN: %clangxx -S -ftime-trace -ftime-trace-granularity=0 -o %T/check-time-trace %s
// RUN: cat %T/check-time-trace.json \
// RUN: | %python -c 'import json, sys; json.dump(json.loads(sys.stdin.read()), sys.stdout, sort_keys=True, indent=2)' \
// RUN: | FileCheck %s
@@ -13,7 +12,7 @@
// CHECK-NEXT: "pid":
// CHECK-NEXT: "tid":
// CHECK-NEXT: "ts":
-// CHECK: "name": "clang"
+// CHECK: "name": "clang{{.*}}"
// CHECK: "name": "process_name"
template <typename T>
diff --git a/src/llvm-project/clang/test/Driver/cl-fallback.c b/src/llvm-project/clang/test/Driver/cl-fallback.c
index 2e5698ce..a840883 100644
--- a/src/llvm-project/clang/test/Driver/cl-fallback.c
+++ b/src/llvm-project/clang/test/Driver/cl-fallback.c
@@ -2,7 +2,7 @@
// command-line option, e.g. on Mac where %s is commonly under /Users.
// RUN: %clang_cl --target=i686-pc-win32 /fallback /Dfoo=bar /Ubaz /Ifoo /O0 /Ox /GR /GR- /GS /GS- /Gy /Gy- \
-// RUN: /Gw /Gw- /LD /LDd /EHs /EHs- /Zl /MD /MDd /MTd /MT /FImyheader.h /Zi \
+// RUN: /Gw /Gw- /LD /LDd /EHs /EHs- /Zl /MD /MDd /MTd /MT /guard:cf /guard:cf- /FImyheader.h /Zi \
// RUN: -garbage -moregarbage \
// RUN: -### -- %s 2>&1 \
// RUN: | FileCheck %s
@@ -33,6 +33,7 @@
// CHECK: "/EHs-"
// CHECK: "/Zl"
// CHECK: "/MT"
+// CHECK: "/guard:cf-"
// CHECK: "-garbage"
// CHECK: "-moregarbage"
// CHECK: "/Tc" "{{.*cl-fallback.c}}"
diff --git a/src/llvm-project/clang/test/Driver/cl-options.c b/src/llvm-project/clang/test/Driver/cl-options.c
index 04aa08a..49f5166 100644
--- a/src/llvm-project/clang/test/Driver/cl-options.c
+++ b/src/llvm-project/clang/test/Driver/cl-options.c
@@ -160,33 +160,29 @@
// RUN: %clang_cl /Os --target=i686-pc-windows-msvc -### -- %s 2>&1 | FileCheck -check-prefix=Os %s
// RUN: %clang_cl /Os --target=x86_64-pc-windows-msvc -### -- %s 2>&1 | FileCheck -check-prefix=Os %s
-// Os-NOT: -mdisable-fp-elim
-// Os: -momit-leaf-frame-pointer
+// Os: -mframe-pointer=none
// Os: -Os
// RUN: %clang_cl /Ot --target=i686-pc-windows-msvc -### -- %s 2>&1 | FileCheck -check-prefix=Ot %s
// RUN: %clang_cl /Ot --target=x86_64-pc-windows-msvc -### -- %s 2>&1 | FileCheck -check-prefix=Ot %s
-// Ot-NOT: -mdisable-fp-elim
-// Ot: -momit-leaf-frame-pointer
+// Ot: -mframe-pointer=none
// Ot: -O2
// RUN: %clang_cl /Ox --target=i686-pc-windows-msvc -### -- %s 2>&1 | FileCheck -check-prefix=Ox %s
// RUN: %clang_cl /Ox --target=x86_64-pc-windows-msvc -### -- %s 2>&1 | FileCheck -check-prefix=Ox %s
-// Ox-NOT: -mdisable-fp-elim
-// Ox: -momit-leaf-frame-pointer
+// Ox: -mframe-pointer=none
// Ox: -O2
// RUN: %clang_cl --target=i686-pc-win32 /O2sy- -### -- %s 2>&1 | FileCheck -check-prefix=PR24003 %s
-// PR24003: -mdisable-fp-elim
-// PR24003: -momit-leaf-frame-pointer
+// PR24003: -mframe-pointer=all
// PR24003: -Os
// RUN: %clang_cl --target=i686-pc-win32 -Werror /Oy- /O2 -### -- %s 2>&1 | FileCheck -check-prefix=Oy_2 %s
-// Oy_2: -momit-leaf-frame-pointer
+// Oy_2: -mframe-pointer=all
// Oy_2: -O2
// RUN: %clang_cl --target=aarch64-pc-windows-msvc -Werror /Oy- /O2 -### -- %s 2>&1 | FileCheck -check-prefix=Oy_aarch64 %s
-// Oy_aarch64: -mdisable-fp-elim
+// Oy_aarch64: -mframe-pointer=non-leaf
// Oy_aarch64: -O2
// RUN: %clang_cl --target=i686-pc-win32 -Werror /O2 /O2 -### -- %s 2>&1 | FileCheck -check-prefix=O2O2 %s
@@ -195,7 +191,7 @@
// RUN: %clang_cl /Zs -Werror /Oy -- %s 2>&1
// RUN: %clang_cl --target=i686-pc-win32 -Werror /Oy- -### -- %s 2>&1 | FileCheck -check-prefix=Oy_ %s
-// Oy_: -mdisable-fp-elim
+// Oy_: -mframe-pointer=all
// RUN: %clang_cl /Qvec -### -- %s 2>&1 | FileCheck -check-prefix=Qvec %s
// Qvec: -vectorize-loops
@@ -381,6 +377,9 @@
// RUN: /Zc:rvalueCast \
// RUN: /Zc:ternary \
// RUN: /Zc:wchar_t \
+// RUN: /ZH:MD5 \
+// RUN: /ZH:SHA1 \
+// RUN: /ZH:SHA_256 \
// RUN: /Zm \
// RUN: /Zo \
// RUN: /Zo- \
@@ -598,9 +597,14 @@
// NOCFGUARD-NOT: -cfguard
// RUN: %clang_cl /guard:cf -### -- %s 2>&1 | FileCheck -check-prefix=CFGUARD %s
-// RUN: %clang_cl /guard:cf,nochecks -### -- %s 2>&1 | FileCheck -check-prefix=CFGUARD %s
-// RUN: %clang_cl /guard:nochecks -### -- %s 2>&1 | FileCheck -check-prefix=CFGUARD %s
// CFGUARD: -cfguard
+// CFGUARD-NOT: -cfguard-no-checks
+
+// RUN: %clang_cl /guard:cf,nochecks -### -- %s 2>&1 | FileCheck -check-prefix=CFGUARDNOCHECKS %s
+// CFGUARDNOCHECKS: -cfguard-no-checks
+
+// RUN: %clang_cl /guard:nochecks -### -- %s 2>&1 | FileCheck -check-prefix=CFGUARDNOCHECKSINVALID %s
+// CFGUARDNOCHECKSINVALID: invalid value 'nochecks' in '/guard:'
// RUN: %clang_cl /guard:foo -### -- %s 2>&1 | FileCheck -check-prefix=CFGUARDINVALID %s
// CFGUARDINVALID: invalid value 'foo' in '/guard:'
@@ -623,6 +627,7 @@
// RUN: -fdiagnostics-color \
// RUN: -fno-diagnostics-color \
// RUN: -fdebug-compilation-dir . \
+// RUN: -fdebug-compilation-dir=. \
// RUN: -fdiagnostics-parseable-fixits \
// RUN: -fdiagnostics-absolute-paths \
// RUN: -ferror-limit=10 \
@@ -654,6 +659,8 @@
// RUN: -fcs-profile-generate \
// RUN: -fcs-profile-generate=dir \
// RUN: -ftime-trace \
+// RUN: -ftrivial-auto-var-init=zero \
+// RUN: -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang \
// RUN: --version \
// RUN: -Werror /Zs -- %s 2>&1
diff --git a/src/llvm-project/clang/test/Driver/cl-showfilenames.c b/src/llvm-project/clang/test/Driver/cl-showfilenames.c
index b2932f1..7320597 100644
--- a/src/llvm-project/clang/test/Driver/cl-showfilenames.c
+++ b/src/llvm-project/clang/test/Driver/cl-showfilenames.c
@@ -2,11 +2,19 @@
// target Windows.
// REQUIRES: x86-registered-target
-// RUN: %clang_cl --target=i686-pc-win32 /c /Fo%T/ /showFilenames -- %s 2>&1 | FileCheck -check-prefix=show %s
-// RUN: %clang_cl --target=i686-pc-win32 /c /Fo%T/ /showFilenames -- %s %S/Inputs/wildcard*.c 2>&1 | FileCheck -check-prefix=multiple %s
+// NOTE: -fno-integrated-cc1 has been added to work around an ASAN failure
+// caused by in-process cc1 invocation. Clang InterfaceStubs is not the
+// culprit, but Clang Interface Stubs' Driver pipeline setup uncovers an
+// existing ASAN issue when invoking multiple normal cc1 jobs along with
+// multiple Clang Interface Stubs cc1 jobs together.
+// There is currently a discussion of this going on at:
+// https://reviews.llvm.org/D69825
-// RUN: %clang_cl --target=i686-pc-win32 /c /Fo%T/ -- %s 2>&1 | FileCheck -check-prefix=noshow %s
-// RUN: %clang_cl --target=i686-pc-win32 /c /Fo%T/ /showFilenames /showFilenames- -- %s 2>&1 | FileCheck -check-prefix=noshow %s
+// RUN: %clang_cl -fno-integrated-cc1 --target=i686-pc-win32 /c /Fo%T/ /showFilenames -- %s 2>&1 | FileCheck -check-prefix=show %s
+// RUN: %clang_cl -fno-integrated-cc1 --target=i686-pc-win32 /c /Fo%T/ /showFilenames -- %s %S/Inputs/wildcard*.c 2>&1 | FileCheck -check-prefix=multiple %s
+
+// RUN: %clang_cl -fno-integrated-cc1 --target=i686-pc-win32 /c /Fo%T/ -- %s 2>&1 | FileCheck -check-prefix=noshow %s
+// RUN: %clang_cl -fno-integrated-cc1 --target=i686-pc-win32 /c /Fo%T/ /showFilenames /showFilenames- -- %s 2>&1 | FileCheck -check-prefix=noshow %s
#pragma message "Hello"
diff --git a/src/llvm-project/clang/test/Driver/clang-offload-bundler.c b/src/llvm-project/clang/test/Driver/clang-offload-bundler.c
index 5411a30..35c327c 100644
--- a/src/llvm-project/clang/test/Driver/clang-offload-bundler.c
+++ b/src/llvm-project/clang/test/Driver/clang-offload-bundler.c
@@ -1,16 +1,17 @@
// REQUIRES: x86-registered-target
// REQUIRES: powerpc-registered-target
+// UNSUPPORTED: darwin
//
// Generate all the types of files we can bundle.
//
-// RUN: %clang -O0 -target powerpc64le-ibm-linux-gnu %s -E -o %t.i
-// RUN: %clangxx -O0 -target powerpc64le-ibm-linux-gnu -x c++ %s -E -o %t.ii
-// RUN: %clang -O0 -target powerpc64le-ibm-linux-gnu %s -S -emit-llvm -o %t.ll
-// RUN: %clang -O0 -target powerpc64le-ibm-linux-gnu %s -c -emit-llvm -o %t.bc
-// RUN: %clang -O0 -target powerpc64le-ibm-linux-gnu %s -S -o %t.s
-// RUN: %clang -O0 -target powerpc64le-ibm-linux-gnu %s -c -o %t.o
-// RUN: %clang -O0 -target powerpc64le-ibm-linux-gnu %s -emit-ast -o %t.ast
+// RUN: %clang -O0 -target %itanium_abi_triple %s -E -o %t.i
+// RUN: %clangxx -O0 -target %itanium_abi_triple -x c++ %s -E -o %t.ii
+// RUN: %clang -O0 -target %itanium_abi_triple %s -S -emit-llvm -o %t.ll
+// RUN: %clang -O0 -target %itanium_abi_triple %s -c -emit-llvm -o %t.bc
+// RUN: %clang -O0 -target %itanium_abi_triple %s -S -o %t.s
+// RUN: %clang -O0 -target %itanium_abi_triple %s -c -o %t.o
+// RUN: %clang -O0 -target %itanium_abi_triple %s -emit-ast -o %t.ast
//
// Generate an empty file to help with the checks of empty files.
@@ -50,28 +51,28 @@
//
// Check errors.
//
-// RUN: not clang-offload-bundler -type=i -targets=host-powerpc64le-ibm-linux-gnu,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -inputs=%t.i,%t.tgt1,%t.tgt2 -outputs=%t.bundle.i -unbundle 2>&1 | FileCheck %s --check-prefix CK-ERR1
-// CK-ERR1: error: only one input file supported in unbundling mode.
-// CK-ERR1: error: number of output files and targets should match in unbundling mode.
+// RUN: not clang-offload-bundler -type=i -targets=host-%itanium_abi_triple,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -inputs=%t.i,%t.tgt1,%t.tgt2 -outputs=%t.bundle.i -unbundle 2>&1 | FileCheck %s --check-prefix CK-ERR1
+// CK-ERR1: error: only one input file supported in unbundling mode
+// CK-ERR1: error: number of output files and targets should match in unbundling mode
-// RUN: not clang-offload-bundler -type=i -targets=host-powerpc64le-ibm-linux-gnu,openmp-powerpc64le-ibm-linux-gnu -inputs=%t.i,%t.tgt1,%t.tgt2 -outputs=%t.bundle.i 2>&1 | FileCheck %s --check-prefix CK-ERR2
-// RUN: not clang-offload-bundler -type=i -targets=host-powerpc64le-ibm-linux-gnu,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -inputs=%t.i,%t.tgt1 -outputs=%t.bundle.i 2>&1 | FileCheck %s --check-prefix CK-ERR2
-// CK-ERR2: error: number of input files and targets should match in bundling mode.
+// RUN: not clang-offload-bundler -type=i -targets=host-%itanium_abi_triple,openmp-powerpc64le-ibm-linux-gnu -inputs=%t.i,%t.tgt1,%t.tgt2 -outputs=%t.bundle.i 2>&1 | FileCheck %s --check-prefix CK-ERR2
+// RUN: not clang-offload-bundler -type=i -targets=host-%itanium_abi_triple,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -inputs=%t.i,%t.tgt1 -outputs=%t.bundle.i 2>&1 | FileCheck %s --check-prefix CK-ERR2
+// CK-ERR2: error: number of input files and targets should match in bundling mode
-// RUN: not clang-offload-bundler -type=i -targets=host-powerpc64le-ibm-linux-gnu,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -outputs=%t.i,%t.tgt1,%t.tgt2 -inputs=%t.bundle.i 2>&1 | FileCheck %s --check-prefix CK-ERR3
-// CK-ERR3: error: only one output file supported in bundling mode.
-// CK-ERR3: error: number of input files and targets should match in bundling mode.
+// RUN: not clang-offload-bundler -type=i -targets=host-%itanium_abi_triple,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -outputs=%t.i,%t.tgt1,%t.tgt2 -inputs=%t.bundle.i 2>&1 | FileCheck %s --check-prefix CK-ERR3
+// CK-ERR3: error: only one output file supported in bundling mode
+// CK-ERR3: error: number of input files and targets should match in bundling mode
-// RUN: not clang-offload-bundler -type=i -targets=host-powerpc64le-ibm-linux-gnu,openmp-powerpc64le-ibm-linux-gnu -outputs=%t.i,%t.tgt1,%t.tgt2 -inputs=%t.bundle.i -unbundle 2>&1 | FileCheck %s --check-prefix CK-ERR4
-// RUN: not clang-offload-bundler -type=i -targets=host-powerpc64le-ibm-linux-gnu,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -outputs=%t.i,%t.tgt1 -inputs=%t.bundle.i -unbundle 2>&1 | FileCheck %s --check-prefix CK-ERR4
-// CK-ERR4: error: number of output files and targets should match in unbundling mode.
+// RUN: not clang-offload-bundler -type=i -targets=host-%itanium_abi_triple,openmp-powerpc64le-ibm-linux-gnu -outputs=%t.i,%t.tgt1,%t.tgt2 -inputs=%t.bundle.i -unbundle 2>&1 | FileCheck %s --check-prefix CK-ERR4
+// RUN: not clang-offload-bundler -type=i -targets=host-%itanium_abi_triple,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -outputs=%t.i,%t.tgt1 -inputs=%t.bundle.i -unbundle 2>&1 | FileCheck %s --check-prefix CK-ERR4
+// CK-ERR4: error: number of output files and targets should match in unbundling mode
-// RUN: not clang-offload-bundler -type=i -targets=host-powerpc64le-ibm-linux-gnu,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -inputs=%t.i,%t.tgt1,%t.tgt2.notexist -outputs=%t.bundle.i 2>&1 | FileCheck %s --check-prefix CK-ERR5
-// RUN: not clang-offload-bundler -type=i -targets=host-powerpc64le-ibm-linux-gnu,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -outputs=%t.i,%t.tgt1,%t.tgt2 -inputs=%t.bundle.i.notexist -unbundle 2>&1 | FileCheck %s --check-prefix CK-ERR5
-// CK-ERR5: error: Can't open file {{.+}}.notexist: {{N|n}}o such file or directory
+// RUN: not clang-offload-bundler -type=i -targets=host-%itanium_abi_triple,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -inputs=%t.i,%t.tgt1,%t.tgt2.notexist -outputs=%t.bundle.i 2>&1 | FileCheck %s -DFILE=%t.tgt2.notexist --check-prefix CK-ERR5
+// RUN: not clang-offload-bundler -type=i -targets=host-%itanium_abi_triple,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -outputs=%t.i,%t.tgt1,%t.tgt2 -inputs=%t.bundle.i.notexist -unbundle 2>&1 | FileCheck %s -DFILE=%t.bundle.i.notexist --check-prefix CK-ERR5
+// CK-ERR5: error: '[[FILE]]': {{N|n}}o such file or directory
-// RUN: not clang-offload-bundler -type=invalid -targets=host-powerpc64le-ibm-linux-gnu,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -inputs=%t.i,%t.tgt1,%t.tgt2 -outputs=%t.bundle.i 2>&1 | FileCheck %s --check-prefix CK-ERR6
-// CK-ERR6: error: invalid file type specified.
+// RUN: not clang-offload-bundler -type=invalid -targets=host-%itanium_abi_triple,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -inputs=%t.i,%t.tgt1,%t.tgt2 -outputs=%t.bundle.i 2>&1 | FileCheck %s -DTYPE=invalid --check-prefix CK-ERR6
+// CK-ERR6: error: '[[TYPE]]': invalid file type specified
// RUN: not clang-offload-bundler 2>&1 | FileCheck %s --check-prefix CK-ERR7
// CK-ERR7-DAG: clang-offload-bundler: for the --type option: must be specified at least once!
@@ -80,33 +81,33 @@
// CK-ERR7-DAG: clang-offload-bundler: for the --targets option: must be specified at least once!
// RUN: not clang-offload-bundler -type=i -targets=hxst-powerpcxxle-ibm-linux-gnu,openxp-pxxerpc64le-ibm-linux-gnu,xpenmp-x86_xx-pc-linux-gnu -inputs=%t.i,%t.tgt1,%t.tgt2 -outputs=%t.bundle.i 2>&1 | FileCheck %s --check-prefix CK-ERR8
-// CK-ERR8: error: invalid target 'hxst-powerpcxxle-ibm-linux-gnu', unknown offloading kind 'hxst', unknown target triple 'powerpcxxle-ibm-linux-gnu'.
-// CK-ERR8: error: invalid target 'openxp-pxxerpc64le-ibm-linux-gnu', unknown offloading kind 'openxp', unknown target triple 'pxxerpc64le-ibm-linux-gnu'.
-// CK-ERR8: error: invalid target 'xpenmp-x86_xx-pc-linux-gnu', unknown offloading kind 'xpenmp', unknown target triple 'x86_xx-pc-linux-gnu'.
+// CK-ERR8: error: invalid target 'hxst-powerpcxxle-ibm-linux-gnu', unknown offloading kind 'hxst', unknown target triple 'powerpcxxle-ibm-linux-gnu'
+// CK-ERR8: error: invalid target 'openxp-pxxerpc64le-ibm-linux-gnu', unknown offloading kind 'openxp', unknown target triple 'pxxerpc64le-ibm-linux-gnu'
+// CK-ERR8: error: invalid target 'xpenmp-x86_xx-pc-linux-gnu', unknown offloading kind 'xpenmp', unknown target triple 'x86_xx-pc-linux-gnu'
// RUN: not clang-offload-bundler -type=i -targets=openmp-powerpc64le-linux,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -inputs=%t.i,%t.tgt1,%t.tgt2 -outputs=%t.bundle.i 2>&1 | FileCheck %s --check-prefix CK-ERR9A
-// RUN: not clang-offload-bundler -type=i -targets=host-powerpc64le-ibm-linux-gnu,host-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -inputs=%t.i,%t.tgt1,%t.tgt2 -outputs=%t.bundle.i 2>&1 | FileCheck %s --check-prefix CK-ERR9B
-// CK-ERR9A: error: expecting exactly one host target but got 0.
-// CK-ERR9B: error: expecting exactly one host target but got 2.
+// RUN: not clang-offload-bundler -type=i -targets=host-%itanium_abi_triple,host-%itanium_abi_triple,openmp-x86_64-pc-linux-gnu -inputs=%t.i,%t.tgt1,%t.tgt2 -outputs=%t.bundle.i 2>&1 | FileCheck %s --check-prefix CK-ERR9B
+// CK-ERR9A: error: expecting exactly one host target but got 0
+// CK-ERR9B: error: expecting exactly one host target but got 2
//
// Check text bundle. This is a readable format, so we check for the format we expect to find.
//
-// RUN: clang-offload-bundler -type=i -targets=host-powerpc64le-ibm-linux-gnu,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -inputs=%t.i,%t.tgt1,%t.tgt2 -outputs=%t.bundle3.i
-// RUN: clang-offload-bundler -type=ii -targets=host-powerpc64le-ibm-linux-gnu,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -inputs=%t.ii,%t.tgt1,%t.tgt2 -outputs=%t.bundle3.ii
-// RUN: clang-offload-bundler -type=ll -targets=host-powerpc64le-ibm-linux-gnu,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -inputs=%t.ll,%t.tgt1,%t.tgt2 -outputs=%t.bundle3.ll
-// RUN: clang-offload-bundler -type=s -targets=host-powerpc64le-ibm-linux-gnu,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -inputs=%t.s,%t.tgt1,%t.tgt2 -outputs=%t.bundle3.s
-// RUN: clang-offload-bundler -type=s -targets=openmp-powerpc64le-ibm-linux-gnu,host-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -inputs=%t.tgt1,%t.s,%t.tgt2 -outputs=%t.bundle3.unordered.s
+// RUN: clang-offload-bundler -type=i -targets=host-%itanium_abi_triple,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -inputs=%t.i,%t.tgt1,%t.tgt2 -outputs=%t.bundle3.i
+// RUN: clang-offload-bundler -type=ii -targets=host-%itanium_abi_triple,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -inputs=%t.ii,%t.tgt1,%t.tgt2 -outputs=%t.bundle3.ii
+// RUN: clang-offload-bundler -type=ll -targets=host-%itanium_abi_triple,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -inputs=%t.ll,%t.tgt1,%t.tgt2 -outputs=%t.bundle3.ll
+// RUN: clang-offload-bundler -type=s -targets=host-%itanium_abi_triple,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -inputs=%t.s,%t.tgt1,%t.tgt2 -outputs=%t.bundle3.s
+// RUN: clang-offload-bundler -type=s -targets=openmp-powerpc64le-ibm-linux-gnu,host-%itanium_abi_triple,openmp-x86_64-pc-linux-gnu -inputs=%t.tgt1,%t.s,%t.tgt2 -outputs=%t.bundle3.unordered.s
// RUN: FileCheck %s --input-file %t.bundle3.i --check-prefix CK-TEXTI
// RUN: FileCheck %s --input-file %t.bundle3.ii --check-prefix CK-TEXTI
// RUN: FileCheck %s --input-file %t.bundle3.ll --check-prefix CK-TEXTLL
// RUN: FileCheck %s --input-file %t.bundle3.s --check-prefix CK-TEXTS
// RUN: FileCheck %s --input-file %t.bundle3.unordered.s --check-prefix CK-TEXTS-UNORDERED
-// CK-TEXTI: // __CLANG_OFFLOAD_BUNDLE____START__ host-powerpc64le-ibm-linux-gnu
+// CK-TEXTI: // __CLANG_OFFLOAD_BUNDLE____START__ host-[[HOST:.+]]
// CK-TEXTI: int A = 0;
// CK-TEXTI: test_func(void)
-// CK-TEXTI: // __CLANG_OFFLOAD_BUNDLE____END__ host-powerpc64le-ibm-linux-gnu
+// CK-TEXTI: // __CLANG_OFFLOAD_BUNDLE____END__ host-[[HOST]]
// CK-TEXTI: // __CLANG_OFFLOAD_BUNDLE____START__ openmp-powerpc64le-ibm-linux-gnu
// CK-TEXTI: Content of device file 1
// CK-TEXTI: // __CLANG_OFFLOAD_BUNDLE____END__ openmp-powerpc64le-ibm-linux-gnu
@@ -114,10 +115,10 @@
// CK-TEXTI: Content of device file 2
// CK-TEXTI: // __CLANG_OFFLOAD_BUNDLE____END__ openmp-x86_64-pc-linux-gnu
-// CK-TEXTLL: ; __CLANG_OFFLOAD_BUNDLE____START__ host-powerpc64le-ibm-linux-gnu
-// CK-TEXTLL: @A = dso_local global i32 0
+// CK-TEXTLL: ; __CLANG_OFFLOAD_BUNDLE____START__ host-[[HOST:.+]]
+// CK-TEXTLL: @A = {{.*}}global i32 0
// CK-TEXTLL: define {{.*}}@test_func()
-// CK-TEXTLL: ; __CLANG_OFFLOAD_BUNDLE____END__ host-powerpc64le-ibm-linux-gnu
+// CK-TEXTLL: ; __CLANG_OFFLOAD_BUNDLE____END__ host-[[HOST]]
// CK-TEXTLL: ; __CLANG_OFFLOAD_BUNDLE____START__ openmp-powerpc64le-ibm-linux-gnu
// CK-TEXTLL: Content of device file 1
// CK-TEXTLL: ; __CLANG_OFFLOAD_BUNDLE____END__ openmp-powerpc64le-ibm-linux-gnu
@@ -125,10 +126,10 @@
// CK-TEXTLL: Content of device file 2
// CK-TEXTLL: ; __CLANG_OFFLOAD_BUNDLE____END__ openmp-x86_64-pc-linux-gnu
-// CK-TEXTS: # __CLANG_OFFLOAD_BUNDLE____START__ host-powerpc64le-ibm-linux-gnu
+// CK-TEXTS: # __CLANG_OFFLOAD_BUNDLE____START__ host-[[HOST:.+]]
// CK-TEXTS: .globl {{.*}}test_func
// CK-TEXTS: .globl {{.*}}A
-// CK-TEXTS: # __CLANG_OFFLOAD_BUNDLE____END__ host-powerpc64le-ibm-linux-gnu
+// CK-TEXTS: # __CLANG_OFFLOAD_BUNDLE____END__ host-[[HOST]]
// CK-TEXTS: # __CLANG_OFFLOAD_BUNDLE____START__ openmp-powerpc64le-ibm-linux-gnu
// CK-TEXTS: Content of device file 1
// CK-TEXTS: # __CLANG_OFFLOAD_BUNDLE____END__ openmp-powerpc64le-ibm-linux-gnu
@@ -139,10 +140,10 @@
// CK-TEXTS-UNORDERED: # __CLANG_OFFLOAD_BUNDLE____START__ openmp-powerpc64le-ibm-linux-gnu
// CK-TEXTS-UNORDERED: Content of device file 1
// CK-TEXTS-UNORDERED: # __CLANG_OFFLOAD_BUNDLE____END__ openmp-powerpc64le-ibm-linux-gnu
-// CK-TEXTS-UNORDERED: # __CLANG_OFFLOAD_BUNDLE____START__ host-powerpc64le-ibm-linux-gnu
+// CK-TEXTS-UNORDERED: # __CLANG_OFFLOAD_BUNDLE____START__ host-[[HOST:.+]]
// CK-TEXTS-UNORDERED: .globl {{.*}}test_func
// CK-TEXTS-UNORDERED: .globl {{.*}}A
-// CK-TEXTS-UNORDERED: # __CLANG_OFFLOAD_BUNDLE____END__ host-powerpc64le-ibm-linux-gnu
+// CK-TEXTS-UNORDERED: # __CLANG_OFFLOAD_BUNDLE____END__ host-[[HOST]]
// CK-TEXTS-UNORDERED: # __CLANG_OFFLOAD_BUNDLE____START__ openmp-x86_64-pc-linux-gnu
// CK-TEXTS-UNORDERED: Content of device file 2
// CK-TEXTS-UNORDERED: # __CLANG_OFFLOAD_BUNDLE____END__ openmp-x86_64-pc-linux-gnu
@@ -150,75 +151,98 @@
//
// Check text unbundle. Check if we get the exact same content that we bundled before for each file.
//
-// RUN: clang-offload-bundler -type=i -targets=host-powerpc64le-ibm-linux-gnu,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -outputs=%t.res.i,%t.res.tgt1,%t.res.tgt2 -inputs=%t.bundle3.i -unbundle
+// RUN: clang-offload-bundler -type=i -targets=host-%itanium_abi_triple,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -outputs=%t.res.i,%t.res.tgt1,%t.res.tgt2 -inputs=%t.bundle3.i -unbundle
// RUN: diff %t.i %t.res.i
// RUN: diff %t.tgt1 %t.res.tgt1
// RUN: diff %t.tgt2 %t.res.tgt2
-// RUN: clang-offload-bundler -type=ii -targets=host-powerpc64le-ibm-linux-gnu,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -outputs=%t.res.ii,%t.res.tgt1,%t.res.tgt2 -inputs=%t.bundle3.ii -unbundle
+// RUN: clang-offload-bundler -type=i -targets=openmp-powerpc64le-ibm-linux-gnu -outputs=%t.res.tgt1 -inputs=%t.bundle3.i -unbundle
+// RUN: diff %t.tgt1 %t.res.tgt1
+// RUN: clang-offload-bundler -type=ii -targets=host-%itanium_abi_triple,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -outputs=%t.res.ii,%t.res.tgt1,%t.res.tgt2 -inputs=%t.bundle3.ii -unbundle
// RUN: diff %t.ii %t.res.ii
// RUN: diff %t.tgt1 %t.res.tgt1
// RUN: diff %t.tgt2 %t.res.tgt2
-// RUN: clang-offload-bundler -type=ll -targets=host-powerpc64le-ibm-linux-gnu,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -outputs=%t.res.ll,%t.res.tgt1,%t.res.tgt2 -inputs=%t.bundle3.ll -unbundle
+// RUN: clang-offload-bundler -type=ii -targets=openmp-x86_64-pc-linux-gnu -outputs=%t.res.tgt2 -inputs=%t.bundle3.ii -unbundle
+// RUN: diff %t.tgt2 %t.res.tgt2
+// RUN: clang-offload-bundler -type=ll -targets=host-%itanium_abi_triple,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -outputs=%t.res.ll,%t.res.tgt1,%t.res.tgt2 -inputs=%t.bundle3.ll -unbundle
// RUN: diff %t.ll %t.res.ll
// RUN: diff %t.tgt1 %t.res.tgt1
// RUN: diff %t.tgt2 %t.res.tgt2
-// RUN: clang-offload-bundler -type=s -targets=host-powerpc64le-ibm-linux-gnu,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -outputs=%t.res.s,%t.res.tgt1,%t.res.tgt2 -inputs=%t.bundle3.s -unbundle
+// RUN: clang-offload-bundler -type=ll -targets=openmp-powerpc64le-ibm-linux-gnu -outputs=%t.res.tgt1 -inputs=%t.bundle3.ll -unbundle
+// RUN: diff %t.tgt1 %t.res.tgt1
+// RUN: clang-offload-bundler -type=s -targets=host-%itanium_abi_triple,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -outputs=%t.res.s,%t.res.tgt1,%t.res.tgt2 -inputs=%t.bundle3.s -unbundle
// RUN: diff %t.s %t.res.s
// RUN: diff %t.tgt1 %t.res.tgt1
// RUN: diff %t.tgt2 %t.res.tgt2
-// RUN: clang-offload-bundler -type=s -targets=openmp-powerpc64le-ibm-linux-gnu,host-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -outputs=%t.res.tgt1,%t.res.s,%t.res.tgt2 -inputs=%t.bundle3.s -unbundle
+// RUN: clang-offload-bundler -type=s -targets=openmp-powerpc64le-ibm-linux-gnu,host-%itanium_abi_triple,openmp-x86_64-pc-linux-gnu -outputs=%t.res.tgt1,%t.res.s,%t.res.tgt2 -inputs=%t.bundle3.s -unbundle
// RUN: diff %t.s %t.res.s
// RUN: diff %t.tgt1 %t.res.tgt1
// RUN: diff %t.tgt2 %t.res.tgt2
+// RUN: clang-offload-bundler -type=s -targets=openmp-x86_64-pc-linux-gnu -outputs=%t.res.tgt2 -inputs=%t.bundle3.s -unbundle
+// RUN: diff %t.tgt2 %t.res.tgt2
// Check if we can unbundle a file with no magic strings.
-// RUN: clang-offload-bundler -type=s -targets=host-powerpc64le-ibm-linux-gnu,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -outputs=%t.res.s,%t.res.tgt1,%t.res.tgt2 -inputs=%t.s -unbundle
+// RUN: clang-offload-bundler -type=s -targets=host-%itanium_abi_triple,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -outputs=%t.res.s,%t.res.tgt1,%t.res.tgt2 -inputs=%t.s -unbundle
// RUN: diff %t.s %t.res.s
// RUN: diff %t.empty %t.res.tgt1
// RUN: diff %t.empty %t.res.tgt2
-// RUN: clang-offload-bundler -type=s -targets=openmp-powerpc64le-ibm-linux-gnu,host-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -outputs=%t.res.tgt1,%t.res.s,%t.res.tgt2 -inputs=%t.s -unbundle
+// RUN: clang-offload-bundler -type=s -targets=openmp-powerpc64le-ibm-linux-gnu,host-%itanium_abi_triple,openmp-x86_64-pc-linux-gnu -outputs=%t.res.tgt1,%t.res.s,%t.res.tgt2 -inputs=%t.s -unbundle
// RUN: diff %t.s %t.res.s
// RUN: diff %t.empty %t.res.tgt1
// RUN: diff %t.empty %t.res.tgt2
+// Check that bindler prints an error if given host bundle does not exist in the fat binary.
+// RUN: not clang-offload-bundler -type=s -targets=host-x86_64-xxx-linux-gnu,openmp-powerpc64le-ibm-linux-gnu -outputs=%t.res.s,%t.res.tgt1 -inputs=%t.bundle3.s -unbundle 2>&1 | FileCheck %s --check-prefix CK-NO-HOST-BUNDLE
+// CK-NO-HOST-BUNDLE: error: Can't find bundle for the host target
+
//
// Check binary bundle/unbundle. The content that we have before bundling must be the same we have after unbundling.
//
-// RUN: clang-offload-bundler -type=bc -targets=host-powerpc64le-ibm-linux-gnu,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -inputs=%t.bc,%t.tgt1,%t.tgt2 -outputs=%t.bundle3.bc
-// RUN: clang-offload-bundler -type=gch -targets=host-powerpc64le-ibm-linux-gnu,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -inputs=%t.ast,%t.tgt1,%t.tgt2 -outputs=%t.bundle3.gch
-// RUN: clang-offload-bundler -type=ast -targets=host-powerpc64le-ibm-linux-gnu,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -inputs=%t.ast,%t.tgt1,%t.tgt2 -outputs=%t.bundle3.ast
-// RUN: clang-offload-bundler -type=ast -targets=openmp-powerpc64le-ibm-linux-gnu,host-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -inputs=%t.tgt1,%t.ast,%t.tgt2 -outputs=%t.bundle3.unordered.ast
-// RUN: clang-offload-bundler -type=bc -targets=host-powerpc64le-ibm-linux-gnu,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -outputs=%t.res.bc,%t.res.tgt1,%t.res.tgt2 -inputs=%t.bundle3.bc -unbundle
+// RUN: clang-offload-bundler -type=bc -targets=host-%itanium_abi_triple,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -inputs=%t.bc,%t.tgt1,%t.tgt2 -outputs=%t.bundle3.bc
+// RUN: clang-offload-bundler -type=gch -targets=host-%itanium_abi_triple,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -inputs=%t.ast,%t.tgt1,%t.tgt2 -outputs=%t.bundle3.gch
+// RUN: clang-offload-bundler -type=ast -targets=host-%itanium_abi_triple,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -inputs=%t.ast,%t.tgt1,%t.tgt2 -outputs=%t.bundle3.ast
+// RUN: clang-offload-bundler -type=ast -targets=openmp-powerpc64le-ibm-linux-gnu,host-%itanium_abi_triple,openmp-x86_64-pc-linux-gnu -inputs=%t.tgt1,%t.ast,%t.tgt2 -outputs=%t.bundle3.unordered.ast
+// RUN: clang-offload-bundler -type=bc -targets=host-%itanium_abi_triple,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -outputs=%t.res.bc,%t.res.tgt1,%t.res.tgt2 -inputs=%t.bundle3.bc -unbundle
// RUN: diff %t.bc %t.res.bc
// RUN: diff %t.tgt1 %t.res.tgt1
// RUN: diff %t.tgt2 %t.res.tgt2
-// RUN: clang-offload-bundler -type=gch -targets=host-powerpc64le-ibm-linux-gnu,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -outputs=%t.res.gch,%t.res.tgt1,%t.res.tgt2 -inputs=%t.bundle3.gch -unbundle
+// RUN: clang-offload-bundler -type=bc -targets=openmp-powerpc64le-ibm-linux-gnu -outputs=%t.res.tgt1 -inputs=%t.bundle3.bc -unbundle
+// RUN: diff %t.tgt1 %t.res.tgt1
+// RUN: clang-offload-bundler -type=gch -targets=host-%itanium_abi_triple,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -outputs=%t.res.gch,%t.res.tgt1,%t.res.tgt2 -inputs=%t.bundle3.gch -unbundle
// RUN: diff %t.ast %t.res.gch
// RUN: diff %t.tgt1 %t.res.tgt1
// RUN: diff %t.tgt2 %t.res.tgt2
-// RUN: clang-offload-bundler -type=ast -targets=host-powerpc64le-ibm-linux-gnu,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -outputs=%t.res.ast,%t.res.tgt1,%t.res.tgt2 -inputs=%t.bundle3.ast -unbundle
+// RUN: clang-offload-bundler -type=gch -targets=openmp-x86_64-pc-linux-gnu -outputs=%t.res.tgt2 -inputs=%t.bundle3.gch -unbundle
+// RUN: diff %t.tgt2 %t.res.tgt2
+// RUN: clang-offload-bundler -type=ast -targets=host-%itanium_abi_triple,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -outputs=%t.res.ast,%t.res.tgt1,%t.res.tgt2 -inputs=%t.bundle3.ast -unbundle
// RUN: diff %t.ast %t.res.ast
// RUN: diff %t.tgt1 %t.res.tgt1
// RUN: diff %t.tgt2 %t.res.tgt2
-// RUN: clang-offload-bundler -type=ast -targets=openmp-powerpc64le-ibm-linux-gnu,host-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -outputs=%t.res.tgt1,%t.res.ast,%t.res.tgt2 -inputs=%t.bundle3.ast -unbundle
+// RUN: clang-offload-bundler -type=ast -targets=openmp-powerpc64le-ibm-linux-gnu,host-%itanium_abi_triple,openmp-x86_64-pc-linux-gnu -outputs=%t.res.tgt1,%t.res.ast,%t.res.tgt2 -inputs=%t.bundle3.ast -unbundle
// RUN: diff %t.ast %t.res.ast
// RUN: diff %t.tgt1 %t.res.tgt1
// RUN: diff %t.tgt2 %t.res.tgt2
-// RUN: clang-offload-bundler -type=ast -targets=openmp-powerpc64le-ibm-linux-gnu,host-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -outputs=%t.res.tgt1,%t.res.ast,%t.res.tgt2 -inputs=%t.bundle3.unordered.ast -unbundle
+// RUN: clang-offload-bundler -type=ast -targets=openmp-powerpc64le-ibm-linux-gnu,host-%itanium_abi_triple,openmp-x86_64-pc-linux-gnu -outputs=%t.res.tgt1,%t.res.ast,%t.res.tgt2 -inputs=%t.bundle3.unordered.ast -unbundle
// RUN: diff %t.ast %t.res.ast
// RUN: diff %t.tgt1 %t.res.tgt1
// RUN: diff %t.tgt2 %t.res.tgt2
+// RUN: clang-offload-bundler -type=ast -targets=openmp-powerpc64le-ibm-linux-gnu -outputs=%t.res.tgt1 -inputs=%t.bundle3.ast -unbundle
+// RUN: diff %t.tgt1 %t.res.tgt1
// Check if we can unbundle a file with no magic strings.
-// RUN: clang-offload-bundler -type=bc -targets=host-powerpc64le-ibm-linux-gnu,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -outputs=%t.res.bc,%t.res.tgt1,%t.res.tgt2 -inputs=%t.bc -unbundle
+// RUN: clang-offload-bundler -type=bc -targets=host-%itanium_abi_triple,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -outputs=%t.res.bc,%t.res.tgt1,%t.res.tgt2 -inputs=%t.bc -unbundle
// RUN: diff %t.bc %t.res.bc
// RUN: diff %t.empty %t.res.tgt1
// RUN: diff %t.empty %t.res.tgt2
-// RUN: clang-offload-bundler -type=bc -targets=openmp-powerpc64le-ibm-linux-gnu,host-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -outputs=%t.res.tgt1,%t.res.bc,%t.res.tgt2 -inputs=%t.bc -unbundle
+// RUN: clang-offload-bundler -type=bc -targets=openmp-powerpc64le-ibm-linux-gnu,host-%itanium_abi_triple,openmp-x86_64-pc-linux-gnu -outputs=%t.res.tgt1,%t.res.bc,%t.res.tgt2 -inputs=%t.bc -unbundle
// RUN: diff %t.bc %t.res.bc
// RUN: diff %t.empty %t.res.tgt1
// RUN: diff %t.empty %t.res.tgt2
+// Check that we do not have to unbundle all available bundles from the fat binary.
+// RUN: clang-offload-bundler -type=ast -targets=host-%itanium_abi_triple,openmp-x86_64-pc-linux-gnu -outputs=%t.res.ast,%t.res.tgt2 -inputs=%t.bundle3.unordered.ast -unbundle
+// RUN: diff %t.ast %t.res.ast
+// RUN: diff %t.tgt2 %t.res.tgt2
+
//
// Check object bundle/unbundle. The content should be bundled into an ELF
// section (we are using a PowerPC little-endian host which uses ELF). We
@@ -227,28 +251,28 @@
// tests.
//
-// RUN: clang-offload-bundler -type=o -targets=host-powerpc64le-ibm-linux-gnu,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -inputs=%t.o,%t.tgt1,%t.tgt2 -outputs=%t.bundle3.o -### -dump-temporary-files 2>&1 \
-// RUN: | FileCheck %s --check-prefix CK-OBJ-CMD
-// CK-OBJ-CMD: private constant [1 x i8] zeroinitializer, section "__CLANG_OFFLOAD_BUNDLE__host-powerpc64le-ibm-linux-gnu"
-// CK-OBJ-CMD: private constant [{{[0-9]+}} x i8] c"Content of device file 1{{.+}}", section "__CLANG_OFFLOAD_BUNDLE__openmp-powerpc64le-ibm-linux-gnu"
-// CK-OBJ-CMD: private constant [{{[0-9]+}} x i8] c"Content of device file 2{{.+}}", section "__CLANG_OFFLOAD_BUNDLE__openmp-x86_64-pc-linux-gnu"
-// CK-OBJ-CMD: clang{{(.exe)?}}" "-r" "-target" "powerpc64le-ibm-linux-gnu" "-o" "{{.+}}.o" "{{.+}}.o" "{{.+}}.bc" "-nostdlib"
+// RUN: clang-offload-bundler -type=o -targets=host-%itanium_abi_triple,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -inputs=%t.o,%t.tgt1,%t.tgt2 -outputs=%t.bundle3.o -### 2>&1 \
+// RUN: | FileCheck %s -DHOST=%itanium_abi_triple -DINOBJ1=%t.o -DINOBJ2=%t.tgt1 -DINOBJ3=%t.tgt2 -DOUTOBJ=%t.bundle3.o --check-prefix CK-OBJ-CMD
+// CK-OBJ-CMD: llvm-objcopy{{(.exe)?}}" "--add-section=__CLANG_OFFLOAD_BUNDLE__host-[[HOST]]=[[INOBJ1]]" "--add-section=__CLANG_OFFLOAD_BUNDLE__openmp-powerpc64le-ibm-linux-gnu=[[INOBJ2]]" "--add-section=__CLANG_OFFLOAD_BUNDLE__openmp-x86_64-pc-linux-gnu=[[INOBJ3]]" "[[INOBJ1]]" "[[OUTOBJ]]"
-// RUN: clang-offload-bundler -type=o -targets=host-powerpc64le-ibm-linux-gnu,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -outputs=%t.res.o,%t.res.tgt1,%t.res.tgt2 -inputs=%s.o -unbundle
-// RUN: diff %s.o %t.res.o
+// RUN: clang-offload-bundler -type=o -targets=host-%itanium_abi_triple,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -inputs=%t.o,%t.tgt1,%t.tgt2 -outputs=%t.bundle3.o
+// RUN: clang-offload-bundler -type=o -targets=host-%itanium_abi_triple,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -outputs=%t.res.o,%t.res.tgt1,%t.res.tgt2 -inputs=%t.bundle3.o -unbundle
+// RUN: diff %t.o %t.res.o
// RUN: diff %t.tgt1 %t.res.tgt1
// RUN: diff %t.tgt2 %t.res.tgt2
-// RUN: clang-offload-bundler -type=o -targets=openmp-powerpc64le-ibm-linux-gnu,host-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -outputs=%t.res.tgt1,%t.res.o,%t.res.tgt2 -inputs=%s.o -unbundle
-// RUN: diff %s.o %t.res.o
+// RUN: clang-offload-bundler -type=o -targets=openmp-powerpc64le-ibm-linux-gnu,host-%itanium_abi_triple,openmp-x86_64-pc-linux-gnu -outputs=%t.res.tgt1,%t.res.o,%t.res.tgt2 -inputs=%t.bundle3.o -unbundle
+// RUN: diff %t.o %t.res.o
// RUN: diff %t.tgt1 %t.res.tgt1
// RUN: diff %t.tgt2 %t.res.tgt2
+// RUN: clang-offload-bundler -type=o -targets=openmp-powerpc64le-ibm-linux-gnu -outputs=%t.res.tgt1 -inputs=%t.bundle3.o -unbundle
+// RUN: diff %t.tgt1 %t.res.tgt1
// Check if we can unbundle a file with no magic strings.
-// RUN: clang-offload-bundler -type=o -targets=host-powerpc64le-ibm-linux-gnu,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -outputs=%t.res.o,%t.res.tgt1,%t.res.tgt2 -inputs=%t.o -unbundle
+// RUN: clang-offload-bundler -type=o -targets=host-%itanium_abi_triple,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -outputs=%t.res.o,%t.res.tgt1,%t.res.tgt2 -inputs=%t.o -unbundle
// RUN: diff %t.o %t.res.o
// RUN: diff %t.empty %t.res.tgt1
// RUN: diff %t.empty %t.res.tgt2
-// RUN: clang-offload-bundler -type=o -targets=openmp-powerpc64le-ibm-linux-gnu,host-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu -outputs=%t.res.tgt1,%t.res.o,%t.res.tgt2 -inputs=%t.o -unbundle
+// RUN: clang-offload-bundler -type=o -targets=openmp-powerpc64le-ibm-linux-gnu,host-%itanium_abi_triple,openmp-x86_64-pc-linux-gnu -outputs=%t.res.tgt1,%t.res.o,%t.res.tgt2 -inputs=%t.o -unbundle
// RUN: diff %t.o %t.res.o
// RUN: diff %t.empty %t.res.tgt1
// RUN: diff %t.empty %t.res.tgt2
diff --git a/src/llvm-project/clang/test/Driver/clang-offload-bundler.c.o b/src/llvm-project/clang/test/Driver/clang-offload-bundler.c.o
deleted file mode 100644
index 2cdba14..0000000
--- a/src/llvm-project/clang/test/Driver/clang-offload-bundler.c.o
+++ /dev/null
Binary files differ
diff --git a/src/llvm-project/clang/test/Driver/clang-offload-wrapper.c b/src/llvm-project/clang/test/Driver/clang-offload-wrapper.c
new file mode 100644
index 0000000..c8c17bd
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/clang-offload-wrapper.c
@@ -0,0 +1,55 @@
+// REQUIRES: x86-registered-target
+
+//
+// Check help message.
+//
+// RUN: clang-offload-wrapper --help | FileCheck %s --check-prefix CHECK-HELP
+// CHECK-HELP: {{.*}}OVERVIEW: A tool to create a wrapper bitcode for offload target binaries. Takes offload
+// CHECK-HELP: {{.*}}target binaries as input and produces bitcode file containing target binaries packaged
+// CHECK-HELP: {{.*}}as data and initialization code which registers target binaries in offload runtime.
+// CHECK-HELP: {{.*}}USAGE: clang-offload-wrapper [options] <input files>
+// CHECK-HELP: {{.*}} -o=<filename> - Output filename
+// CHECK-HELP: {{.*}} --target=<triple> - Target triple for the output module
+
+//
+// Generate a file to wrap.
+//
+// RUN: echo 'Content of device file' > %t.tgt
+
+//
+// Check bitcode produced by the wrapper tool.
+//
+// RUN: clang-offload-wrapper -target=x86_64-pc-linux-gnu -o %t.wrapper.bc %t.tgt
+// RUN: llvm-dis %t.wrapper.bc -o - | FileCheck %s --check-prefix CHECK-IR
+
+// CHECK-IR: target triple = "x86_64-pc-linux-gnu"
+
+// CHECK-IR-DAG: [[ENTTY:%.+]] = type { i8*, i8*, i{{32|64}}, i32, i32 }
+// CHECK-IR-DAG: [[IMAGETY:%.+]] = type { i8*, i8*, [[ENTTY]]*, [[ENTTY]]* }
+// CHECK-IR-DAG: [[DESCTY:%.+]] = type { i32, [[IMAGETY]]*, [[ENTTY]]*, [[ENTTY]]* }
+
+// CHECK-IR: [[ENTBEGIN:@.+]] = external hidden constant [[ENTTY]]
+// CHECK-IR: [[ENTEND:@.+]] = external hidden constant [[ENTTY]]
+
+// CHECK-IR: [[DUMMY:@.+]] = hidden constant [0 x [[ENTTY]]] zeroinitializer, section "omp_offloading_entries"
+
+// CHECK-IR: [[BIN:@.+]] = internal unnamed_addr constant [[BINTY:\[[0-9]+ x i8\]]] c"Content of device file{{.+}}"
+
+// CHECK-IR: [[IMAGES:@.+]] = internal unnamed_addr constant [1 x [[IMAGETY]]] [{{.+}} { i8* getelementptr inbounds ([[BINTY]], [[BINTY]]* [[BIN]], i64 0, i64 0), i8* getelementptr inbounds ([[BINTY]], [[BINTY]]* [[BIN]], i64 1, i64 0), [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }]
+
+// CHECK-IR: [[DESC:@.+]] = internal constant [[DESCTY]] { i32 1, [[IMAGETY]]* getelementptr inbounds ([1 x [[IMAGETY]]], [1 x [[IMAGETY]]]* [[IMAGES]], i64 0, i64 0), [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }
+
+// CHECK-IR: @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* [[REGFN:@.+]], i8* null }]
+// CHECK-IR: @llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* [[UNREGFN:@.+]], i8* null }]
+
+// CHECK-IR: define internal void [[REGFN]]()
+// CHECK-IR: call void @__tgt_register_lib([[DESCTY]]* [[DESC]])
+// CHECK-IR: ret void
+
+// CHECK-IR: declare void @__tgt_register_lib([[DESCTY]]*)
+
+// CHECK-IR: define internal void [[UNREGFN]]()
+// CHECK-IR: call void @__tgt_unregister_lib([[DESCTY]]* [[DESC]])
+// CHECK-IR: ret void
+
+// CHECK-IR: declare void @__tgt_unregister_lib([[DESCTY]]*)
diff --git a/src/llvm-project/clang/test/Driver/clang-translation.c b/src/llvm-project/clang/test/Driver/clang-translation.c
index 766e779..79d8f6f 100644
--- a/src/llvm-project/clang/test/Driver/clang-translation.c
+++ b/src/llvm-project/clang/test/Driver/clang-translation.c
@@ -3,7 +3,7 @@
// I386: "-S"
// I386: "-disable-free"
// I386: "-mrelocation-model" "static"
-// I386: "-mdisable-fp-elim"
+// I386: "-mframe-pointer=all"
// I386: "-masm-verbose"
// I386: "-munwind-tables"
// I386: "-Os"
@@ -277,6 +277,18 @@
// PPC64NS: "-target-cpu" "ppc64"
// RUN: %clang -target powerpc-fsl-linux -### -S %s \
+// RUN: -mcpu=e500 2>&1 | FileCheck -check-prefix=PPCE500 %s
+// PPCE500: clang
+// PPCE500: "-cc1"
+// PPCE500: "-target-cpu" "e500"
+
+// RUN: %clang -target powerpc-fsl-linux -### -S %s \
+// RUN: -mcpu=8548 2>&1 | FileCheck -check-prefix=PPC8548 %s
+// PPC8548: clang
+// PPC8548: "-cc1"
+// PPC8548: "-target-cpu" "e500"
+
+// RUN: %clang -target powerpc-fsl-linux -### -S %s \
// RUN: -mcpu=e500mc 2>&1 | FileCheck -check-prefix=PPCE500MC %s
// PPCE500MC: clang
// PPCE500MC: "-cc1"
diff --git a/src/llvm-project/clang/test/Driver/clang_f_opts.c b/src/llvm-project/clang/test/Driver/clang_f_opts.c
index d3d80fd..7038a2b 100644
--- a/src/llvm-project/clang/test/Driver/clang_f_opts.c
+++ b/src/llvm-project/clang/test/Driver/clang_f_opts.c
@@ -85,6 +85,9 @@
// CHECK-PROFILE-DIR-UNUSED-NOT: "-coverage-data-file" "abc
// CHECK-PROFILE-DIR-NEITHER-NOT: argument unused
+// RUN: %clang_cl -### /c --coverage /Fo/foo/bar.obj -- %s 2>&1 | FileCheck -check-prefix=CHECK-GCNO-LOCATION %s
+// CHECK-GCNO-LOCATION: "-coverage-notes-file" "{{.*}}/foo/bar.gcno"
+
// RUN: %clang -### -fprofile-arcs -ftest-coverage %s 2>&1 | FileCheck -check-prefix=CHECK-u %s
// RUN: %clang -### --coverage %s 2>&1 | FileCheck -check-prefix=CHECK-u %s
// CHECK-u-NOT: "-u{{.*}}"
@@ -198,6 +201,22 @@
// CHECK-EXTENDED-IDENTIFIERS-NOT: "-fextended-identifiers"
// CHECK-NO-EXTENDED-IDENTIFIERS: error: unsupported option '-fno-extended-identifiers'
+// RUN: %clang -### -S -frounding-math %s 2>&1 | FileCheck -check-prefix=CHECK-ROUNDING-MATH %s
+// CHECK-ROUNDING-MATH: "-cc1"
+// CHECK-ROUNDING-MATH: "-frounding-math"
+// CHECK-ROUNDING-MATH-NOT: "-fno-rounding-math"
+// RUN: %clang -### -S %s 2>&1 | FileCheck -check-prefix=CHECK-ROUNDING-MATH-NOT %s
+// RUN: %clang -### -S -ffp-model=imprecise %s 2>&1 | FileCheck -check-prefix=CHECK-FPMODEL %s
+// CHECK-FPMODEL: unsupported argument 'imprecise' to option 'ffp-model='
+// RUN: %clang -### -S -ffp-model=precise %s 2>&1 | FileCheck -check-prefix=IGNORE %s
+// RUN: %clang -### -S -ffp-model=strict %s 2>&1 | FileCheck -check-prefix=IGNORE %s
+// RUN: %clang -### -S -ffp-model=fast %s 2>&1 | FileCheck -check-prefix=IGNORE %s
+// RUN: %clang -### -S -ffp-exception-behavior=trap %s 2>&1 | FileCheck -check-prefix=CHECK-FPEB %s
+// CHECK-FPEB: unsupported argument 'trap' to option 'ffp-exception-behavior='
+// RUN: %clang -### -S -ffp-exception-behavior=maytrap %s 2>&1 | FileCheck -check-prefix=IGNORE %s
+// RUN: %clang -### -S -ffp-exception-behavior=ignore %s 2>&1 | FileCheck -check-prefix=IGNORE %s
+// RUN: %clang -### -S -ffp-exception-behavior=strict %s 2>&1 | FileCheck -check-prefix=IGNORE %s
+
// 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"
@@ -232,6 +251,7 @@
// RUN: -fexec-charset=UTF-8 \
// RUN: -fivopts -fno-ivopts \
// RUN: -fnon-call-exceptions -fno-non-call-exceptions \
+// RUN: -fno-semantic-interposition \
// RUN: -fpermissive -fno-permissive \
// RUN: -fdefer-pop -fno-defer-pop \
// RUN: -fprefetch-loop-arrays -fno-prefetch-loop-arrays \
@@ -320,7 +340,6 @@
// RUN: -fprefetch-loop-arrays \
// RUN: -fprofile-correction \
// RUN: -fprofile-values \
-// RUN: -frounding-math \
// RUN: -fschedule-insns \
// RUN: -fsignaling-nans \
// RUN: -fstrength-reduce \
@@ -385,7 +404,6 @@
// CHECK-WARNING-DAG: optimization flag '-fprefetch-loop-arrays' is not supported
// CHECK-WARNING-DAG: optimization flag '-fprofile-correction' is not supported
// CHECK-WARNING-DAG: optimization flag '-fprofile-values' is not supported
-// CHECK-WARNING-DAG: optimization flag '-frounding-math' is not supported
// CHECK-WARNING-DAG: optimization flag '-fschedule-insns' is not supported
// CHECK-WARNING-DAG: optimization flag '-fsignaling-nans' is not supported
// CHECK-WARNING-DAG: optimization flag '-fstrength-reduce' is not supported
@@ -476,7 +494,7 @@
// RUN: %clang -target x86_64-unknown-none-none -### -fno-short-wchar -fshort-wchar %s 2>&1 | FileCheck -check-prefix=CHECK-WCHAR2 -check-prefix=DELIMITERS %s
// Make sure we don't match the -NOT lines with the linker invocation.
// Delimiters match the start of the cc1 and the start of the linker lines
-// DELIMITERS: {{^ *"}}
+// DELIMITERS: {{^ (\(in-process\)|")}}
// CHECK-WCHAR1: -fwchar-type=int
// CHECK-WCHAR1-NOT: -fwchar-type=short
// CHECK-WCHAR2: -fwchar-type=short
@@ -526,7 +544,9 @@
// CHECK-NO-CF-PROTECTION-BRANCH-NOT: -fcf-protection=branch
// RUN: %clang -### -S -fdebug-compilation-dir . %s 2>&1 | FileCheck -check-prefix=CHECK-DEBUG-COMPILATION-DIR %s
+// RUN: %clang -### -S -fdebug-compilation-dir=. %s 2>&1 | FileCheck -check-prefix=CHECK-DEBUG-COMPILATION-DIR %s
// RUN: %clang -### -fdebug-compilation-dir . -x assembler %s 2>&1 | FileCheck -check-prefix=CHECK-DEBUG-COMPILATION-DIR %s
+// RUN: %clang -### -fdebug-compilation-dir=. -x assembler %s 2>&1 | FileCheck -check-prefix=CHECK-DEBUG-COMPILATION-DIR %s
// CHECK-DEBUG-COMPILATION-DIR: "-fdebug-compilation-dir" "."
// RUN: %clang -### -S -fdiscard-value-names %s 2>&1 | FileCheck -check-prefix=CHECK-DISCARD-NAMES %s
@@ -548,11 +568,6 @@
// CHECK-NO-NULL-POINTER-CHECKS: "-fno-delete-null-pointer-checks"
// CHECK-NULL-POINTER-CHECKS-NOT: "-fno-delete-null-pointer-checks"
-// RUN: %clang -### -S -fomit-frame-pointer -pg %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-OMIT-FP-PG %s
-// RUN: %clang -### -S -fomit-frame-pointer -fno-omit-frame-pointer -pg %s 2>&1 | FileCheck -check-prefix=CHECK-MIX-NO-OMIT-FP-PG %s
-// CHECK-NO-MIX-OMIT-FP-PG: '-fomit-frame-pointer' not allowed with '-pg'
-// CHECK-MIX-NO-OMIT-FP-PG-NOT: '-fomit-frame-pointer' not allowed with '-pg'
-
// RUN: %clang -### -S -target x86_64-unknown-linux -frecord-gcc-switches %s 2>&1 | FileCheck -check-prefix=CHECK-RECORD-GCC-SWITCHES %s
// RUN: %clang -### -S -target x86_64-unknown-linux -fno-record-gcc-switches %s 2>&1 | FileCheck -check-prefix=CHECK-NO-RECORD-GCC-SWITCHES %s
// RUN: %clang -### -S -target x86_64-unknown-linux -fno-record-gcc-switches -frecord-gcc-switches %s 2>&1 | FileCheck -check-prefix=CHECK-RECORD-GCC-SWITCHES %s
@@ -576,3 +591,6 @@
// CHECK-TRIVIAL-PATTERN-NOT: hasn't been enabled
// CHECK-TRIVIAL-ZERO-GOOD-NOT: hasn't been enabled
// CHECK-TRIVIAL-ZERO-BAD: hasn't been enabled
+
+// RUN: %clang -### -S -fno-temp-file %s 2>&1 | FileCheck -check-prefix=CHECK-NO-TEMP-FILE %s
+// CHECK-NO-TEMP-FILE: "-fno-temp-file"
diff --git a/src/llvm-project/clang/test/Driver/compiler-rt-unwind.c b/src/llvm-project/clang/test/Driver/compiler-rt-unwind.c
index 0ec067c..652a48c 100644
--- a/src/llvm-project/clang/test/Driver/compiler-rt-unwind.c
+++ b/src/llvm-project/clang/test/Driver/compiler-rt-unwind.c
@@ -13,7 +13,15 @@
// RUN: --gcc-toolchain="" \
// RUN: | FileCheck --check-prefix=RTLIB-GCC-UNWINDLIB-COMPILER-RT %s
// RTLIB-GCC-UNWINDLIB-COMPILER-RT: "{{.*}}lgcc"
-// RTLIB-GCC-UNWINDLIB-COMPILER-RT: "{{.*}}lunwind"
+// RTLIB-GCC-UNWINDLIB-COMPILER-RT: "{{.*}}l:libunwind.so"
+//
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=x86_64-unknown-linux -rtlib=libgcc --unwindlib=libunwind \
+// RUN: -static-libgcc \
+// RUN: --gcc-toolchain="" \
+// RUN: | FileCheck --check-prefix=RTLIB-GCC-STATIC-UNWINDLIB-COMPILER-RT %s
+// RTLIB-GCC-STATIC-UNWINDLIB-COMPILER-RT: "{{.*}}lgcc"
+// RTLIB-GCC-STATIC-UNWINDLIB-COMPILER-RT: "{{.*}}l:libunwind.a"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=x86_64-unknown-linux -rtlib=compiler-rt \
diff --git a/src/llvm-project/clang/test/Driver/constructors.c b/src/llvm-project/clang/test/Driver/constructors.c
index a3443a3..e5d453d 100644
--- a/src/llvm-project/clang/test/Driver/constructors.c
+++ b/src/llvm-project/clang/test/Driver/constructors.c
@@ -1,8 +1,8 @@
// Test whether or not the driver instructs the backend to use .init_array
// sections for global constructors.
//
-// CHECK-INIT-ARRAY: -fuse-init-array
-// CHECK-NO-INIT-ARRAY-NOT: -fuse-init-array
+// CHECK-INIT-ARRAY-NOT: -fno-use-init-array
+// CHECK-NO-INIT-ARRAY: -fno-use-init-array
//
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target i386-unknown-linux \
@@ -34,7 +34,7 @@
// RUN: -target i386-unknown-linux \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: --gcc-toolchain="" \
-// RUN: | FileCheck --check-prefix=CHECK-NO-INIT-ARRAY %s
+// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
//
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -fuse-init-array \
diff --git a/src/llvm-project/clang/test/Driver/coverage_no_integrated_as.c b/src/llvm-project/clang/test/Driver/coverage_no_integrated_as.c
index d7689e5..fc9af6b 100644
--- a/src/llvm-project/clang/test/Driver/coverage_no_integrated_as.c
+++ b/src/llvm-project/clang/test/Driver/coverage_no_integrated_as.c
@@ -1,21 +1,26 @@
// REQUIRES: clang-driver
-// XFAIL: windows-msvc
+
+// RUN: %clang -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-NO-COV %s
// RUN: %clang -### -S -fprofile-arcs %s 2>&1 | FileCheck -check-prefix=CHECK-GCNO-DEFAULT-LOCATION %s
-// RUN: %clang -### -S -fprofile-arcs -no-integrated-as %s 2>&1 | FileCheck -check-prefix=CHECK-GCNO-DEFAULT-LOCATION %s
+// RUN: %clang -### -S -fprofile-arcs --target=%itanium_abi_triple -no-integrated-as %s 2>&1 | FileCheck -check-prefix=CHECK-GCNO-DEFAULT-LOCATION %s
// RUN: %clang -### -c -fprofile-arcs %s 2>&1 | FileCheck -check-prefix=CHECK-GCNO-DEFAULT-LOCATION %s
-// RUN: %clang -### -c -fprofile-arcs -no-integrated-as %s 2>&1 | FileCheck -check-prefix=CHECK-GCNO-DEFAULT-LOCATION %s
+// RUN: %clang -### -c -fprofile-arcs --target=%itanium_abi_triple -no-integrated-as %s 2>&1 | FileCheck -check-prefix=CHECK-GCNO-DEFAULT-LOCATION %s
// RUN: %clang -### -S -fprofile-arcs %s -o /foo/bar.o 2>&1 | FileCheck -check-prefix=CHECK-GCNO-LOCATION %s
-// RUN: %clang -### -S -fprofile-arcs -no-integrated-as %s -o /foo/bar.o 2>&1 | FileCheck -check-prefix=CHECK-GCNO-LOCATION %s
+// RUN: %clang -### -S -fprofile-arcs --target=%itanium_abi_triple -no-integrated-as %s -o /foo/bar.o 2>&1 | FileCheck -check-prefix=CHECK-GCNO-LOCATION %s
// RUN: %clang -### -c -fprofile-arcs %s -o /foo/bar.o 2>&1 | FileCheck -check-prefix=CHECK-GCNO-LOCATION %s
-// RUN: %clang -### -c -fprofile-arcs -no-integrated-as %s -o /foo/bar.o 2>&1 | FileCheck -check-prefix=CHECK-GCNO-LOCATION %s
+// RUN: %clang -### -c -fprofile-arcs --target=%itanium_abi_triple -no-integrated-as %s -o /foo/bar.o 2>&1 | FileCheck -check-prefix=CHECK-GCNO-LOCATION %s
// RUN: %clang -### -S -fprofile-arcs %s -o foo/bar.o 2>&1 | FileCheck -check-prefix=CHECK-GCNO-LOCATION-REL-PATH %s
-// RUN: %clang -### -S -fprofile-arcs -no-integrated-as %s -o foo/bar.o 2>&1 | FileCheck -check-prefix=CHECK-GCNO-LOCATION-REL-PATH %s
+// RUN: %clang -### -S -fprofile-arcs --target=%itanium_abi_triple -no-integrated-as %s -o foo/bar.o 2>&1 | FileCheck -check-prefix=CHECK-GCNO-LOCATION-REL-PATH %s
// RUN: %clang -### -c -fprofile-arcs %s -o foo/bar.o 2>&1 | FileCheck -check-prefix=CHECK-GCNO-LOCATION-REL-PATH %s
-// RUN: %clang -### -c -fprofile-arcs -no-integrated-as %s -o foo/bar.o 2>&1 | FileCheck -check-prefix=CHECK-GCNO-LOCATION-REL-PATH %s
+// RUN: %clang -### -c -fprofile-arcs --target=%itanium_abi_triple -no-integrated-as %s -o foo/bar.o 2>&1 | FileCheck -check-prefix=CHECK-GCNO-LOCATION-REL-PATH %s
+// These should only get passed if any of --coverage, -ftest-coverage, or
+// -fprofile-arcs is passed.
+// CHECK-NO-COV-NOT: "-coverage-notes-file"
+// CHECK-NO-COV-NOT: "-coverage-data-file"
// CHECK-GCNO-DEFAULT-LOCATION: "-coverage-notes-file" "{{.*}}{{/|\\\\}}coverage_no_integrated_as.c"
// CHECK-GCNO-DEFAULT-LOCATION-NOT: "-coverage-notes-file" "/tmp/{{.*}}/coverage_no_integrated_as.c"
diff --git a/src/llvm-project/clang/test/Driver/crash-report-crashfile.m b/src/llvm-project/clang/test/Driver/crash-report-crashfile.m
index fbfb532..980b1ac 100644
--- a/src/llvm-project/clang/test/Driver/crash-report-crashfile.m
+++ b/src/llvm-project/clang/test/Driver/crash-report-crashfile.m
@@ -1,15 +1,15 @@
-// REQUIRES: crash-recovery, shell, system-darwin
+// REQUIRES: crash-recovery, system-darwin
// RUN: rm -rf %t
// RUN: mkdir -p %t/i %t/m %t
-// RUN: not env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%t TEMP=%t TMP=%t \
-// RUN: %clang -fsyntax-only %s \
+// RUN: env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%t TEMP=%t TMP=%t \
+// RUN: not %clang -fsyntax-only %s \
// RUN: -I %S/Inputs/module -isysroot %/t/i/ \
// RUN: -fmodules -fmodules-cache-path=%t/m/ -DFOO=BAR 2>&1 | \
// RUN: FileCheck -check-prefix=CRASH_ENV %s
-// RUN: not env TMPDIR=%t TEMP=%t TMP=%t \
-// RUN: %clang -gen-reproducer -fsyntax-only %s \
+// RUN: env TMPDIR=%t TEMP=%t TMP=%t \
+// RUN: not %clang -gen-reproducer -fsyntax-only %s \
// RUN: -I %S/Inputs/module -isysroot %/t/i/ \
// RUN: -fmodules -fmodules-cache-path=%t/m/ -DFOO=BAR 2>&1 | \
// RUN: FileCheck -check-prefix=CRASH_FLAG %s
diff --git a/src/llvm-project/clang/test/Driver/crash-report-null.test b/src/llvm-project/clang/test/Driver/crash-report-null.test
index 22c211e..7281f53 100644
--- a/src/llvm-project/clang/test/Driver/crash-report-null.test
+++ b/src/llvm-project/clang/test/Driver/crash-report-null.test
@@ -1,4 +1,4 @@
-// RUN: not env FORCE_CLANG_DIAGNOSTICS_CRASH=1 %clang -fsyntax-only -x c /dev/null -lstdc++ 2>&1 | FileCheck %s
+// RUN: env FORCE_CLANG_DIAGNOSTICS_CRASH=1 not %clang -fsyntax-only -x c /dev/null -lstdc++ 2>&1 | FileCheck %s
// FIXME: Investigating. "fatal error: file 'nul' modified since it was first processed"
// XFAIL: windows-gnu
diff --git a/src/llvm-project/clang/test/Driver/crash-report-with-asserts.c b/src/llvm-project/clang/test/Driver/crash-report-with-asserts.c
new file mode 100644
index 0000000..7a614aa
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/crash-report-with-asserts.c
@@ -0,0 +1,58 @@
+// RUN: rm -rf %t
+// RUN: mkdir %t
+
+// RUN: echo '-fsyntax-only \
+// RUN: -F/tmp/ -I /tmp/ -idirafter /tmp/ -iquote /tmp/ -isystem /tmp/ \
+// RUN: -iprefix /the/prefix -iwithprefix /tmp -iwithprefixbefore /tmp/ \
+// RUN: -Xclang -internal-isystem -Xclang /tmp/ \
+// RUN: -Xclang -internal-externc-isystem -Xclang /tmp/ \
+// RUN: -Xclang -main-file-name -Xclang foo.c \
+// RUN: -DFOO=BAR -DBAR="BAZ QUX"' > %t.rsp
+
+// RUN: env TMPDIR=%t TEMP=%t TMP=%t RC_DEBUG_OPTIONS=1 \
+// RUN: CC_PRINT_HEADERS=1 CC_LOG_DIAGNOSTICS=1 \
+// RUN: not %clang %s @%t.rsp -DASSERT 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
+
+// RUN: env TMPDIR=%t TEMP=%t TMP=%t RC_DEBUG_OPTIONS=1 \
+// RUN: CC_PRINT_HEADERS=1 CC_LOG_DIAGNOSTICS=1 \
+// RUN: not %clang %s @%t.rsp -DUNREACHABLE 2>&1 | FileCheck %s
+// RUN: cat %t/crash-report-with-asserts-*.c | FileCheck --check-prefix=CHECKSRC %s
+// RUN: cat %t/crash-report-with-asserts-*.sh | FileCheck --check-prefix=CHECKSH %s
+
+// REQUIRES: crash-recovery, asserts
+
+#ifdef ASSERT
+#pragma clang __debug assert
+#elif UNREACHABLE
+#pragma clang __debug llvm_unreachable
+#endif
+
+// CHECK: Preprocessed source(s) and associated run script(s) are located at:
+// CHECK-NEXT: note: diagnostic msg: {{.*}}crash-report-with-asserts-{{.*}}.c
+FOO
+// CHECKSRC: FOO
+// CHECKSH: # Crash reproducer
+// CHECKSH-NEXT: # Driver args: {{.*}}"-fsyntax-only"
+// CHECKSH-SAME: "-D" "FOO=BAR"
+// CHECKSH-SAME: "-D" "BAR=BAZ QUX"
+// CHECKSH-NEXT: # Original command: {{.*$}}
+// CHECKSH-NEXT: "-cc1"
+// CHECKSH: "-main-file-name" "crash-report-with-asserts.c"
+// CHECKSH-NOT: "-header-include-file"
+// CHECKSH-NOT: "-diagnostic-log-file"
+// CHECKSH: "-D" "FOO=BAR"
+// CHECKSH: "-D" "BAR=BAZ QUX"
+// CHECKSH-NOT: "-F/tmp/"
+// CHECKSH-NOT: "-I" "/tmp/"
+// CHECKSH-NOT: "-idirafter" "/tmp/"
+// CHECKSH-NOT: "-iquote" "/tmp/"
+// CHECKSH-NOT: "-isystem" "/tmp/"
+// CHECKSH-NOT: "-iprefix" "/the/prefix"
+// CHECKSH-NOT: "-iwithprefix" "/tmp/"
+// CHECKSH-NOT: "-iwithprefixbefore" "/tmp/"
+// CHECKSH-NOT: "-internal-isystem" "/tmp/"
+// CHECKSH-NOT: "-internal-externc-isystem" "/tmp/"
+// CHECKSH-NOT: "-dwarf-debug-flags"
+// CHECKSH: "crash-report-with-asserts-{{[^ ]*}}.c"
diff --git a/src/llvm-project/clang/test/Driver/crash-report.c b/src/llvm-project/clang/test/Driver/crash-report.c
index 711b04ea..ceb16cb 100644
--- a/src/llvm-project/clang/test/Driver/crash-report.c
+++ b/src/llvm-project/clang/test/Driver/crash-report.c
@@ -1,25 +1,48 @@
// RUN: rm -rf %t
// RUN: mkdir %t
-// RUN: env TMPDIR=%t TEMP=%t TMP=%t RC_DEBUG_OPTIONS=1 \
-// RUN: CC_PRINT_HEADERS=1 CC_LOG_DIAGNOSTICS=1 \
-// RUN: not %clang -fsyntax-only %s \
+
+// RUN: echo '-fsyntax-only \
// RUN: -F/tmp/ -I /tmp/ -idirafter /tmp/ -iquote /tmp/ -isystem /tmp/ \
// RUN: -iprefix /the/prefix -iwithprefix /tmp -iwithprefixbefore /tmp/ \
// RUN: -Xclang -internal-isystem -Xclang /tmp/ \
// RUN: -Xclang -internal-externc-isystem -Xclang /tmp/ \
// RUN: -Xclang -main-file-name -Xclang foo.c \
-// RUN: -DFOO=BAR -DBAR="BAZ QUX" 2>&1 | FileCheck %s
+// RUN: -DFOO=BAR -DBAR="BAZ QUX"' > %t.rsp
+
+// RUN: env TMPDIR=%t TEMP=%t TMP=%t RC_DEBUG_OPTIONS=1 \
+// RUN: CC_PRINT_HEADERS=1 CC_LOG_DIAGNOSTICS=1 \
+// RUN: not %clang %s @%t.rsp -DPARSER 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
+
+// RUN: env TMPDIR=%t TEMP=%t TMP=%t RC_DEBUG_OPTIONS=1 \
+// RUN: CC_PRINT_HEADERS=1 CC_LOG_DIAGNOSTICS=1 \
+// RUN: not %clang %s @%t.rsp -DCRASH 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
+
+// RUN: env TMPDIR=%t TEMP=%t TMP=%t RC_DEBUG_OPTIONS=1 \
+// RUN: CC_PRINT_HEADERS=1 CC_LOG_DIAGNOSTICS=1 \
+// RUN: not %clang %s @%t.rsp -DFATAL 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
+#ifdef PARSER
#pragma clang __debug parser_crash
+#elif CRASH
+#pragma clang __debug crash
+#elif FATAL
+#pragma clang __debug llvm_fatal_error
+#endif
+
// CHECK: Preprocessed source(s) and associated run script(s) are located at:
// CHECK-NEXT: note: diagnostic msg: {{.*}}crash-report-{{.*}}.c
FOO
// CHECKSRC: FOO
// CHECKSH: # Crash reproducer
-// CHECKSH-NEXT: # Driver args: "-fsyntax-only"
+// CHECKSH-NEXT: # Driver args: {{.*}}"-fsyntax-only"
// CHECKSH-SAME: "-D" "FOO=BAR"
// CHECKSH-SAME: "-D" "BAR=BAZ QUX"
// CHECKSH-NEXT: # Original command: {{.*$}}
diff --git a/src/llvm-project/clang/test/Driver/cross-linux.c b/src/llvm-project/clang/test/Driver/cross-linux.c
index a5ea832..6c2dab2 100644
--- a/src/llvm-project/clang/test/Driver/cross-linux.c
+++ b/src/llvm-project/clang/test/Driver/cross-linux.c
@@ -52,6 +52,7 @@
// RUN: %clang -### -o %t %s 2>&1 -no-integrated-as -fuse-ld=ld \
// RUN: --gcc-toolchain=%S/Inputs/multilib_32bit_linux_tree/usr \
// RUN: --target=x86_64-unknown-linux \
+// RUN: --rtlib=platform \
// 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"
@@ -70,6 +71,7 @@
// RUN: %clang -### -o %t %s 2>&1 -no-integrated-as -fuse-ld=ld \
// RUN: --gcc-toolchain=%S/Inputs/multilib_64bit_linux_tree/usr \
// RUN: --target=i386-unknown-linux \
+// RUN: --rtlib=platform \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-MULTI64-I386 %s
// CHECK-MULTI64-I386: "-cc1" "-triple" "i386-unknown-linux"
@@ -88,6 +90,7 @@
// RUN: %clang -### -o %t %s 2>&1 -no-integrated-as -fuse-ld=ld \
// RUN: --gcc-toolchain=%S/Inputs/multilib_64bit_linux_tree/usr \
// RUN: --target=x86_64-unknown-linux \
+// RUN: --rtlib=platform \
// 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"
diff --git a/src/llvm-project/clang/test/Driver/cuda-options-freebsd.cu b/src/llvm-project/clang/test/Driver/cuda-options-freebsd.cu
new file mode 100644
index 0000000..cee38e4
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/cuda-options-freebsd.cu
@@ -0,0 +1,289 @@
+// Tests CUDA compilation pipeline construction in Driver.
+// REQUIRES: clang-driver
+// REQUIRES: x86-registered-target
+// REQUIRES: nvptx-registered-target
+
+// Simple compilation case. Compile device-side to PTX assembly and make sure
+// we use it on the host side.
+// RUN: %clang -### -target x86_64-unknown-freebsd -c %s 2>&1 \
+// RUN: | FileCheck -check-prefix DEVICE -check-prefix DEVICE-NOSAVE \
+// RUN: -check-prefix HOST -check-prefix INCLUDES-DEVICE \
+// RUN: -check-prefix NOLINK %s
+
+// Typical compilation + link case.
+// RUN: %clang -### -target x86_64-unknown-freebsd %s 2>&1 \
+// RUN: | FileCheck -check-prefix DEVICE -check-prefix DEVICE-NOSAVE \
+// RUN: -check-prefix HOST -check-prefix INCLUDES-DEVICE \
+// RUN: -check-prefix LINK %s
+
+// Verify that --cuda-host-only disables device-side compilation, but doesn't
+// disable host-side compilation/linking.
+// RUN: %clang -### -target x86_64-unknown-freebsd --cuda-host-only %s 2>&1 \
+// RUN: | FileCheck -check-prefix NODEVICE -check-prefix HOST \
+// RUN: -check-prefix NOINCLUDES-DEVICE -check-prefix LINK %s
+
+// Verify that --cuda-device-only disables host-side compilation and linking.
+// RUN: %clang -### -target x86_64-unknown-freebsd --cuda-device-only %s 2>&1 \
+// RUN: | FileCheck -check-prefix DEVICE -check-prefix DEVICE-NOSAVE \
+// RUN: -check-prefix NOHOST -check-prefix NOLINK %s
+
+// Check that the last of --cuda-compile-host-device, --cuda-host-only, and
+// --cuda-device-only wins.
+
+// RUN: %clang -### -target x86_64-unknown-freebsd --cuda-device-only \
+// RUN: --cuda-host-only %s 2>&1 \
+// RUN: | FileCheck -check-prefix NODEVICE -check-prefix HOST \
+// RUN: -check-prefix NOINCLUDES-DEVICE -check-prefix LINK %s
+
+// RUN: %clang -### -target x86_64-unknown-freebsd --cuda-compile-host-device \
+// RUN: --cuda-host-only %s 2>&1 \
+// RUN: | FileCheck -check-prefix NODEVICE -check-prefix HOST \
+// RUN: -check-prefix NOINCLUDES-DEVICE -check-prefix LINK %s
+
+// RUN: %clang -### -target x86_64-unknown-freebsd --cuda-host-only \
+// RUN: --cuda-device-only %s 2>&1 \
+// RUN: | FileCheck -check-prefix DEVICE -check-prefix DEVICE-NOSAVE \
+// RUN: -check-prefix NOHOST -check-prefix NOLINK %s
+
+// RUN: %clang -### -target x86_64-unknown-freebsd --cuda-compile-host-device \
+// RUN: --cuda-device-only %s 2>&1 \
+// RUN: | FileCheck -check-prefix DEVICE -check-prefix DEVICE-NOSAVE \
+// RUN: -check-prefix NOHOST -check-prefix NOLINK %s
+
+// RUN: %clang -### -target x86_64-unknown-freebsd --cuda-host-only \
+// RUN: --cuda-compile-host-device %s 2>&1 \
+// RUN: | FileCheck -check-prefix DEVICE -check-prefix DEVICE-NOSAVE \
+// RUN: -check-prefix HOST -check-prefix INCLUDES-DEVICE \
+// RUN: -check-prefix LINK %s
+
+// RUN: %clang -### -target x86_64-unknown-freebsd --cuda-device-only \
+// RUN: --cuda-compile-host-device %s 2>&1 \
+// RUN: | FileCheck -check-prefix DEVICE -check-prefix DEVICE-NOSAVE \
+// RUN: -check-prefix HOST -check-prefix INCLUDES-DEVICE \
+// RUN: -check-prefix LINK %s
+
+// Verify that --cuda-gpu-arch option passes the correct GPU architecture to
+// device compilation.
+// RUN: %clang -### -target x86_64-unknown-freebsd --cuda-gpu-arch=sm_30 -c %s 2>&1 \
+// RUN: | FileCheck -check-prefix DEVICE -check-prefix DEVICE-NOSAVE \
+// RUN: -check-prefix DEVICE-SM30 -check-prefix HOST \
+// RUN: -check-prefix INCLUDES-DEVICE -check-prefix NOLINK %s
+
+// Verify that there is one device-side compilation per --cuda-gpu-arch args
+// and that all results are included on the host side.
+// RUN: %clang -### -target x86_64-unknown-freebsd \
+// RUN: --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_30 -c %s 2>&1 \
+// RUN: | FileCheck -check-prefixes DEVICE,DEVICE-NOSAVE,DEVICE2 \
+// RUN: -check-prefixes DEVICE-SM30,DEVICE2-SM35 \
+// RUN: -check-prefixes INCLUDES-DEVICE,INCLUDES-DEVICE2 \
+// RUN: -check-prefixes HOST,HOST-NOSAVE,NOLINK %s
+
+// Verify that device-side results are passed to the correct tool when
+// -save-temps is used.
+// RUN: %clang -### -target x86_64-unknown-freebsd -save-temps -c %s 2>&1 \
+// RUN: | FileCheck -check-prefix DEVICE -check-prefix DEVICE-SAVE \
+// RUN: -check-prefix HOST -check-prefix HOST-SAVE -check-prefix NOLINK %s
+
+// Verify that device-side results are passed to the correct tool when
+// -fno-integrated-as is used.
+// RUN: %clang -### -target x86_64-unknown-freebsd -fno-integrated-as -c %s 2>&1 \
+// RUN: | FileCheck -check-prefix DEVICE -check-prefix DEVICE-NOSAVE \
+// RUN: -check-prefix HOST -check-prefix HOST-NOSAVE \
+// RUN: -check-prefix HOST-AS -check-prefix NOLINK %s
+
+// Verify that --[no-]cuda-gpu-arch arguments are handled correctly.
+// a) --no-cuda-gpu-arch=X negates preceding --cuda-gpu-arch=X
+// RUN: %clang -### -target x86_64-unknown-freebsd --cuda-device-only \
+// RUN: --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_30 \
+// RUN: --no-cuda-gpu-arch=sm_35 \
+// RUN: -c %s 2>&1 \
+// RUN: | FileCheck -check-prefixes NOARCH-SM20,ARCH-SM30,NOARCH-SM35 %s
+
+// b) --no-cuda-gpu-arch=X negates more than one preceding --cuda-gpu-arch=X
+// RUN: %clang -### -target x86_64-unknown-freebsd --cuda-device-only \
+// RUN: --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_30 \
+// RUN: --no-cuda-gpu-arch=sm_35 \
+// RUN: -c %s 2>&1 \
+// RUN: | FileCheck -check-prefixes NOARCH-SM20,ARCH-SM30,NOARCH-SM35 %s
+
+// c) if --no-cuda-gpu-arch=X negates all preceding --cuda-gpu-arch=X
+// we default to sm_20 -- same as if no --cuda-gpu-arch were passed.
+// RUN: %clang -### -target x86_64-unknown-freebsd --cuda-device-only \
+// RUN: --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_30 \
+// RUN: --no-cuda-gpu-arch=sm_35 --no-cuda-gpu-arch=sm_30 \
+// RUN: -c %s 2>&1 \
+// RUN: | FileCheck -check-prefixes ARCH-SM20,NOARCH-SM30,NOARCH-SM35 %s
+
+// d) --no-cuda-gpu-arch=X is a no-op if there's no preceding --cuda-gpu-arch=X
+// RUN: %clang -### -target x86_64-unknown-freebsd --cuda-device-only \
+// RUN: --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_30\
+// RUN: --no-cuda-gpu-arch=sm_50 \
+// RUN: -c %s 2>&1 \
+// RUN: | FileCheck -check-prefixes NOARCH-SM20,ARCH-SM30,ARCH-SM35 %s
+
+// e) --no-cuda-gpu-arch=X does not affect following --cuda-gpu-arch=X
+// RUN: %clang -### -target x86_64-unknown-freebsd --cuda-device-only \
+// RUN: --no-cuda-gpu-arch=sm_35 --no-cuda-gpu-arch=sm_30 \
+// RUN: --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_30 \
+// RUN: -c %s 2>&1 \
+// RUN: | FileCheck -check-prefixes NOARCH-SM20,ARCH-SM30,ARCH-SM35 %s
+
+// f) --no-cuda-gpu-arch=all negates all preceding --cuda-gpu-arch=X
+// RUN: %clang -### -target x86_64-unknown-freebsd --cuda-device-only \
+// RUN: --cuda-gpu-arch=sm_20 --cuda-gpu-arch=sm_30 \
+// RUN: --no-cuda-gpu-arch=all \
+// RUN: --cuda-gpu-arch=sm_35 \
+// RUN: -c %s 2>&1 \
+// RUN: | FileCheck -check-prefixes NOARCH-SM20,NOARCH-SM30,ARCH-SM35 %s
+
+// g) There's no --cuda-gpu-arch=all
+// RUN: %clang -### -target x86_64-unknown-freebsd --cuda-device-only \
+// RUN: --cuda-gpu-arch=all \
+// RUN: -c %s 2>&1 \
+// RUN: | FileCheck -check-prefix ARCHALLERROR %s
+
+
+// Verify that --[no-]cuda-include-ptx arguments are handled correctly.
+// a) by default we're including PTX for all GPUs.
+// RUN: %clang -### -target x86_64-unknown-freebsd \
+// RUN: --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_30 \
+// RUN: -c %s 2>&1 \
+// RUN: | FileCheck -check-prefixes FATBIN-COMMON,PTX-SM35,PTX-SM30 %s
+
+// b) --no-cuda-include-ptx=all disables PTX inclusion for all GPUs
+// RUN: %clang -### -target x86_64-unknown-freebsd \
+// RUN: --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_30 \
+// RUN: --no-cuda-include-ptx=all \
+// RUN: -c %s 2>&1 \
+// RUN: | FileCheck -check-prefixes FATBIN-COMMON,NOPTX-SM35,NOPTX-SM30 %s
+
+// c) --no-cuda-include-ptx=sm_XX disables PTX inclusion for that GPU only.
+// RUN: %clang -### -target x86_64-unknown-freebsd \
+// RUN: --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_30 \
+// RUN: --no-cuda-include-ptx=sm_35 \
+// RUN: -c %s 2>&1 \
+// RUN: | FileCheck -check-prefixes FATBIN-COMMON,NOPTX-SM35,PTX-SM30 %s
+// RUN: %clang -### -target x86_64-unknown-freebsd \
+// RUN: --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_30 \
+// RUN: --no-cuda-include-ptx=sm_30 \
+// RUN: -c %s 2>&1 \
+// RUN: | FileCheck -check-prefixes FATBIN-COMMON,PTX-SM35,NOPTX-SM30 %s
+
+// d) --cuda-include-ptx=all overrides preceding --no-cuda-include-ptx=all
+// RUN: %clang -### -target x86_64-unknown-freebsd \
+// RUN: --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_30 \
+// RUN: --no-cuda-include-ptx=all --cuda-include-ptx=all \
+// RUN: -c %s 2>&1 \
+// RUN: | FileCheck -check-prefixes FATBIN-COMMON,PTX-SM35,PTX-SM30 %s
+
+// e) --cuda-include-ptx=all overrides preceding --no-cuda-include-ptx=sm_XX
+// RUN: %clang -### -target x86_64-unknown-freebsd \
+// RUN: --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_30 \
+// RUN: --no-cuda-include-ptx=sm_30 --cuda-include-ptx=all \
+// RUN: -c %s 2>&1 \
+// RUN: | FileCheck -check-prefixes FATBIN-COMMON,PTX-SM35,PTX-SM30 %s
+
+
+// ARCH-SM20: "-cc1"{{.*}}"-target-cpu" "sm_20"
+// NOARCH-SM20-NOT: "-cc1"{{.*}}"-target-cpu" "sm_20"
+// ARCH-SM30: "-cc1"{{.*}}"-target-cpu" "sm_30"
+// NOARCH-SM30-NOT: "-cc1"{{.*}}"-target-cpu" "sm_30"
+// ARCH-SM35: "-cc1"{{.*}}"-target-cpu" "sm_35"
+// NOARCH-SM35-NOT: "-cc1"{{.*}}"-target-cpu" "sm_35"
+// ARCHALLERROR: error: Unsupported CUDA gpu architecture: all
+
+// Match device-side preprocessor and compiler phases with -save-temps.
+// DEVICE-SAVE: "-cc1" "-triple" "nvptx64-nvidia-cuda"
+// DEVICE-SAVE-SAME: "-aux-triple" "x86_64-unknown-freebsd"
+// DEVICE-SAVE-SAME: "-fcuda-is-device"
+// DEVICE-SAVE-SAME: "-x" "cuda"
+
+// DEVICE-SAVE: "-cc1" "-triple" "nvptx64-nvidia-cuda"
+// DEVICE-SAVE-SAME: "-aux-triple" "x86_64-unknown-freebsd"
+// DEVICE-SAVE-SAME: "-fcuda-is-device"
+// DEVICE-SAVE-SAME: "-x" "cuda-cpp-output"
+
+// Match the job that produces PTX assembly.
+// DEVICE: "-cc1" "-triple" "nvptx64-nvidia-cuda"
+// DEVICE-NOSAVE-SAME: "-aux-triple" "x86_64-unknown-freebsd"
+// DEVICE-SAME: "-fcuda-is-device"
+// DEVICE-SM30-SAME: "-target-cpu" "sm_30"
+// DEVICE-SAME: "-o" "[[PTXFILE:[^"]*]]"
+// DEVICE-NOSAVE-SAME: "-x" "cuda"
+// DEVICE-SAVE-SAME: "-x" "ir"
+
+// Match the call to ptxas (which assembles PTX to SASS).
+// DEVICE:ptxas
+// DEVICE-SM30-DAG: "--gpu-name" "sm_30"
+// DEVICE-DAG: "--output-file" "[[CUBINFILE:[^"]*]]"
+// DEVICE-DAG: "[[PTXFILE]]"
+
+// Match another device-side compilation.
+// DEVICE2: "-cc1" "-triple" "nvptx64-nvidia-cuda"
+// DEVICE2-SAME: "-aux-triple" "x86_64-unknown-freebsd"
+// DEVICE2-SAME: "-fcuda-is-device"
+// DEVICE2-SM35-SAME: "-target-cpu" "sm_35"
+// DEVICE2-SAME: "-o" "[[PTXFILE2:[^"]*]]"
+// DEVICE2-SAME: "-x" "cuda"
+
+// Match another call to ptxas.
+// DEVICE2: ptxas
+// DEVICE2-SM35-DAG: "--gpu-name" "sm_35"
+// DEVICE2-DAG: "--output-file" "[[CUBINFILE2:[^"]*]]"
+// DEVICE2-DAG: "[[PTXFILE2]]"
+
+// Match no device-side compilation.
+// NODEVICE-NOT: "-cc1" "-triple" "nvptx64-nvidia-cuda"
+// NODEVICE-NOT: "-fcuda-is-device"
+
+// INCLUDES-DEVICE:fatbinary
+// INCLUDES-DEVICE-DAG: "--create" "[[FATBINARY:[^"]*]]"
+// INCLUDES-DEVICE-DAG: "--image=profile=sm_{{[0-9]+}},file=[[CUBINFILE]]"
+// INCLUDES-DEVICE-DAG: "--image=profile=compute_{{[0-9]+}},file=[[PTXFILE]]"
+// INCLUDES-DEVICE2-DAG: "--image=profile=sm_{{[0-9]+}},file=[[CUBINFILE2]]"
+// INCLUDES-DEVICE2-DAG: "--image=profile=compute_{{[0-9]+}},file=[[PTXFILE2]]"
+
+// Match host-side preprocessor job with -save-temps.
+// HOST-SAVE: "-cc1" "-triple" "x86_64-unknown-freebsd"
+// HOST-SAVE-SAME: "-aux-triple" "nvptx64-nvidia-cuda"
+// HOST-SAVE-NOT: "-fcuda-is-device"
+// HOST-SAVE-SAME: "-x" "cuda"
+
+// Match host-side compilation.
+// HOST: "-cc1" "-triple" "x86_64-unknown-freebsd"
+// HOST-SAME: "-aux-triple" "nvptx64-nvidia-cuda"
+// HOST-NOT: "-fcuda-is-device"
+// There is only one GPU binary after combining it with fatbinary!
+// INCLUDES-DEVICE2-NOT: "-fcuda-include-gpubinary"
+// INCLUDES-DEVICE-SAME: "-fcuda-include-gpubinary" "[[FATBINARY]]"
+// There is only one GPU binary after combining it with fatbinary.
+// INCLUDES-DEVICE2-NOT: "-fcuda-include-gpubinary"
+// HOST-SAME: "-o" "[[HOSTOUTPUT:[^"]*]]"
+// HOST-NOSAVE-SAME: "-x" "cuda"
+// HOST-SAVE-SAME: "-x" "cuda-cpp-output"
+
+// Match external assembler that uses compilation output.
+// HOST-AS: "-o" "{{.*}}.o" "[[HOSTOUTPUT]]"
+
+// Match no GPU code inclusion.
+// NOINCLUDES-DEVICE-NOT: "-fcuda-include-gpubinary"
+
+// Match no host compilation.
+// NOHOST-NOT: "-cc1" "-triple"
+// NOHOST-NOT: "-x" "cuda"
+
+// Match linker.
+// LINK: "{{.*}}{{ld|link}}{{(.exe)?}}"
+// LINK-SAME: "[[HOSTOUTPUT]]"
+
+// Match no linker.
+// NOLINK-NOT: "{{.*}}{{ld|link}}{{(.exe)?}}"
+
+// FATBIN-COMMON:fatbinary
+// FATBIN-COMMON: "--create" "[[FATBINARY:[^"]*]]"
+// FATBIN-COMMON: "--image=profile=sm_30,file=
+// PTX-SM30: "--image=profile=compute_30,file=
+// NOPTX-SM30-NOT: "--image=profile=compute_30,file=
+// FATBIN-COMMON: "--image=profile=sm_35,file=
+// PTX-SM35: "--image=profile=compute_35,file=
+// NOPTX-SM35-NOT: "--image=profile=compute_35,file=
diff --git a/src/llvm-project/clang/test/Driver/cuda-simple.cu b/src/llvm-project/clang/test/Driver/cuda-simple.cu
index b6840be..54e1840 100644
--- a/src/llvm-project/clang/test/Driver/cuda-simple.cu
+++ b/src/llvm-project/clang/test/Driver/cuda-simple.cu
@@ -5,10 +5,10 @@
// Verify that we pass -x cuda-cpp-output to compiler after
// preprocessing a CUDA file
// RUN: %clang -Werror -### -save-temps -c %s 2>&1 | FileCheck %s
-// CHECK: "-cc1"
+// CHECK-LABEL: "-cc1"
// CHECK: "-E"
// CHECK: "-x" "cuda"
-// CHECK-NEXT: "-cc1"
+// CHECK-LABEL: "-cc1"
// CHECK: "-x" "cuda-cpp-output"
//
// Verify that compiler accepts CUDA syntax with "-x cuda-cpp-output".
diff --git a/src/llvm-project/clang/test/Driver/cuda-version-check.cu b/src/llvm-project/clang/test/Driver/cuda-version-check.cu
index 2fdd9c4..a09b248 100644
--- a/src/llvm-project/clang/test/Driver/cuda-version-check.cu
+++ b/src/llvm-project/clang/test/Driver/cuda-version-check.cu
@@ -8,6 +8,12 @@
// RUN: FileCheck %s --check-prefix=OK
// RUN: %clang --target=x86_64-linux -v -### --cuda-gpu-arch=sm_60 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda 2>&1 %s | \
// RUN: FileCheck %s --check-prefix=OK
+// RUN: %clang --target=x86_64-linux -v -### --cuda-gpu-arch=sm_60 --cuda-path=%S/Inputs/CUDA-unknown/usr/local/cuda 2>&1 %s | \
+// RUN: FileCheck %s --check-prefix=UNKNOWN_VERSION
+// Make sure that we don't warn about CUDA version during C++ compilation.
+// RUN: %clang --target=x86_64-linux -v -### -x c++ --cuda-gpu-arch=sm_60 \
+// RUN: --cuda-path=%S/Inputs/CUDA-unknown/usr/local/cuda 2>&1 %s | \
+// RUN: FileCheck %s --check-prefix=UNKNOWN_VERSION_CXX
// The installation at Inputs/CUDA is CUDA 7.0, which doesn't support sm_60.
// RUN: %clang --target=x86_64-linux -v -### --cuda-gpu-arch=sm_60 --cuda-path=%S/Inputs/CUDA/usr/local/cuda 2>&1 %s | \
@@ -58,3 +64,6 @@
// ERR_SM61: error: GPU arch sm_61 {{.*}}
// ERR_SM61-NOT: error: GPU arch sm_61
+
+// UNKNOWN_VERSION: Unknown CUDA version 999.999. Assuming the latest supported version
+// UNKNOWN_VERSION_CXX-NOT: Unknown CUDA version
diff --git a/src/llvm-project/clang/test/Driver/darwin-debug-flags.c b/src/llvm-project/clang/test/Driver/darwin-debug-flags.c
index e37680e..79a7f48 100644
--- a/src/llvm-project/clang/test/Driver/darwin-debug-flags.c
+++ b/src/llvm-project/clang/test/Driver/darwin-debug-flags.c
@@ -7,7 +7,7 @@
// CHECK: distinct !DICompileUnit(
// CHECK-SAME: flags:
-// CHECK-SAME: -I path\5C with\5C \5C\5Cspaces
+// CHECK-SAME: -I path\\ with\\ \\\\spaces
// CHECK-SAME: -g -Os
// CHECK-SAME: -mmacosx-version-min=10.5.0
diff --git a/src/llvm-project/clang/test/Driver/darwin-infer-simulator-sdkroot.c b/src/llvm-project/clang/test/Driver/darwin-infer-simulator-sdkroot.c
index 3fda599..a084bf6 100644
--- a/src/llvm-project/clang/test/Driver/darwin-infer-simulator-sdkroot.c
+++ b/src/llvm-project/clang/test/Driver/darwin-infer-simulator-sdkroot.c
@@ -4,9 +4,9 @@
//
// RUN: rm -rf %t/SDKs/iPhoneOS8.0.0.sdk
// RUN: mkdir -p %t/SDKs/iPhoneOS8.0.0.sdk
-// RUN: env SDKROOT=%t/SDKs/iPhoneOS8.0.0.sdk %clang %s -### 2>&1 \
+// RUN: env SDKROOT=%t/SDKs/iPhoneOS8.0.0.sdk %clang %s -mlinker-version=400 -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-IPHONE %s
-// RUN: env SDKROOT=%t/SDKs/iPhoneOS8.0.0.sdk IPHONEOS_DEPLOYMENT_TARGET=8.0 %clang %s -### 2>&1 \
+// RUN: env SDKROOT=%t/SDKs/iPhoneOS8.0.0.sdk IPHONEOS_DEPLOYMENT_TARGET=8.0 %clang %s -mlinker-version=400 -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-IPHONE %s
// CHECK-IPHONE: clang
// CHECK-IPHONE: "-cc1"
@@ -17,7 +17,7 @@
//
// RUN: rm -rf %t/SDKs/iPhoneSimulator8.0.sdk
// RUN: mkdir -p %t/SDKs/iPhoneSimulator8.0.sdk
-// RUN: env SDKROOT=%t/SDKs/iPhoneSimulator8.0.sdk %clang %s -### 2>&1 \
+// RUN: env SDKROOT=%t/SDKs/iPhoneSimulator8.0.sdk %clang %s -mlinker-version=400 -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-SIMULATOR %s
//
// CHECK-SIMULATOR: clang
@@ -29,9 +29,9 @@
//
// RUN: rm -rf %t/SDKs/WatchOS3.0.sdk
// RUN: mkdir -p %t/SDKs/WatchOS3.0.sdk
-// RUN: env SDKROOT=%t/SDKs/WatchOS3.0.sdk %clang %s -### 2>&1 \
+// RUN: env SDKROOT=%t/SDKs/WatchOS3.0.sdk %clang %s -mlinker-version=400 -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-WATCH %s
-// RUN: env WATCHOS_DEPLOYMENT_TARGET=3.0 %clang %s -isysroot %t/SDKs/WatchOS3.0.sdk -### 2>&1 \
+// RUN: env WATCHOS_DEPLOYMENT_TARGET=3.0 %clang %s -isysroot %t/SDKs/WatchOS3.0.sdk -mlinker-version=400 -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-WATCH %s
//
// CHECK-WATCH: clang
@@ -43,7 +43,7 @@
//
// RUN: rm -rf %t/SDKs/WatchSimulator3.0.sdk
// RUN: mkdir -p %t/SDKs/WatchSimulator3.0.sdk
-// RUN: env SDKROOT=%t/SDKs/WatchSimulator3.0.sdk %clang %s -### 2>&1 \
+// RUN: env SDKROOT=%t/SDKs/WatchSimulator3.0.sdk %clang %s -mlinker-version=400 -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-WATCH-SIMULATOR %s
//
// CHECK-WATCH-SIMULATOR: clang
@@ -55,7 +55,7 @@
//
// RUN: rm -rf %t/SDKs/AppleTVOS10.0.sdk
// RUN: mkdir -p %t/SDKs/AppleTVOS10.0.sdk
-// RUN: env SDKROOT=%t/SDKs/AppleTVOS10.0.sdk %clang %s -### 2>&1 \
+// RUN: env SDKROOT=%t/SDKs/AppleTVOS10.0.sdk %clang %s -mlinker-version=400 -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-TV %s
//
// CHECK-TV: clang
@@ -67,7 +67,7 @@
//
// RUN: rm -rf %t/SDKs/AppleTVSimulator10.0.sdk
// RUN: mkdir -p %t/SDKs/AppleTVSimulator10.0.sdk
-// RUN: env SDKROOT=%t/SDKs/AppleTVSimulator10.0.sdk %clang %s -### 2>&1 \
+// RUN: env SDKROOT=%t/SDKs/AppleTVSimulator10.0.sdk %clang %s -mlinker-version=400 -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-TV-SIMULATOR %s
//
// CHECK-TV-SIMULATOR: clang
diff --git a/src/llvm-project/clang/test/Driver/darwin-ld-lto.c b/src/llvm-project/clang/test/Driver/darwin-ld-lto.c
index b5b33aa..e02af1a 100644
--- a/src/llvm-project/clang/test/Driver/darwin-ld-lto.c
+++ b/src/llvm-project/clang/test/Driver/darwin-ld-lto.c
@@ -23,8 +23,10 @@
// RUN: %clang -target x86_64-apple-darwin10 %s -flto=full -### 2>&1 | \
// RUN: FileCheck -check-prefix=FULL_LTO_OBJECT_PATH %s
// FULL_LTO_OBJECT_PATH: {{ld(.exe)?"}}
-// FULL_LTO_OBJECT_PATH-SAME: "-object_path_lto" "{{[a-zA-Z0-9_\/]+\/cc\-[a-zA-Z0-9_]+.o}}"
+// FULL_LTO_OBJECT_PATH-SAME: "-object_path_lto"
+// FULL_LTO_OBJECT_PATH-SAME: {{cc\-[a-zA-Z0-9_]+.o}}"
// RUN: %clang -target x86_64-apple-darwin10 %s -flto=thin -### 2>&1 | \
// RUN: FileCheck -check-prefix=THIN_LTO_OBJECT_PATH %s
// THIN_LTO_OBJECT_PATH: {{ld(.exe)?"}}
-// THIN_LTO_OBJECT_PATH-SAME: "-object_path_lto" "{{[a-zA-Z0-9_\/]+\/thinlto\-[a-zA-Z0-9_]+}}"
+// THIN_LTO_OBJECT_PATH-SAME: "-object_path_lto"
+// THIN_LTO_OBJECT_PATH-SAME: {{thinlto\-[a-zA-Z0-9_]+}}
diff --git a/src/llvm-project/clang/test/Driver/darwin-ld-platform-version-ios.c b/src/llvm-project/clang/test/Driver/darwin-ld-platform-version-ios.c
new file mode 100644
index 0000000..0569803
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/darwin-ld-platform-version-ios.c
@@ -0,0 +1,14 @@
+// RUN: touch %t.o
+
+// RUN: %clang -target arm64-apple-ios12.3 -isysroot %S/Inputs/iPhoneOS13.0.sdk -mlinker-version=0 -### %t.o 2>&1 \
+// RUN: | FileCheck --check-prefix=LINKER-OLD %s
+// RUN: %clang -target arm64-apple-ios12.3 -isysroot %S/Inputs/iPhoneOS13.0.sdk -mlinker-version=400 -### %t.o 2>&1 \
+// RUN: | FileCheck --check-prefix=LINKER-OLD %s
+// RUN: %clang -target arm64-apple-ios12.3 -isysroot %S/Inputs/iPhoneOS13.0.sdk -mlinker-version=520 -### %t.o 2>&1 \
+// RUN: | FileCheck --check-prefix=LINKER-NEW %s
+// RUN: %clang -target x86_64-apple-ios13-simulator -isysroot %S/Inputs/iPhoneOS13.0.sdk -mlinker-version=520 -### %t.o 2>&1 \
+// RUN: | FileCheck --check-prefix=SIMUL %s
+
+// LINKER-OLD: "-iphoneos_version_min" "12.3.0"
+// LINKER-NEW: "-platform_version" "ios" "12.3.0" "13.0"
+// SIMUL: "-platform_version" "ios-simulator" "13.0.0" "13.0"
diff --git a/src/llvm-project/clang/test/Driver/darwin-ld-platform-version-macos.c b/src/llvm-project/clang/test/Driver/darwin-ld-platform-version-macos.c
new file mode 100644
index 0000000..c1b940a
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/darwin-ld-platform-version-macos.c
@@ -0,0 +1,15 @@
+// RUN: touch %t.o
+
+// RUN: %clang -target x86_64-apple-macos10.13 -isysroot %S/Inputs/MacOSX10.14.sdk -mlinker-version=0 -### %t.o 2>&1 \
+// RUN: | FileCheck --check-prefix=LINKER-OLD %s
+// RUN: %clang -target x86_64-apple-macos10.13 -isysroot %S/Inputs/MacOSX10.14.sdk -mlinker-version=400 -### %t.o 2>&1 \
+// RUN: | FileCheck --check-prefix=LINKER-OLD %s
+// RUN: env SDKROOT=%S/Inputs/MacOSX10.14.sdk %clang -target x86_64-apple-macos10.13.0.1 -mlinker-version=520 -### %t.o 2>&1 \
+// RUN: | FileCheck --check-prefix=LINKER-NEW %s
+
+// LINKER-OLD: "-macosx_version_min" "10.13.0"
+// LINKER-NEW: "-platform_version" "macos" "10.13.0" "10.14"
+
+// RUN: %clang -target x86_64-apple-macos10.13 -mlinker-version=520 -### %t.o 2>&1 \
+// RUN: | FileCheck --check-prefix=NOSDK %s
+// NOSDK: "-platform_version" "macos" "10.13.0" "0.0.0"
diff --git a/src/llvm-project/clang/test/Driver/darwin-ld-platform-version-tvos.c b/src/llvm-project/clang/test/Driver/darwin-ld-platform-version-tvos.c
new file mode 100644
index 0000000..39a2020
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/darwin-ld-platform-version-tvos.c
@@ -0,0 +1,14 @@
+// RUN: touch %t.o
+
+// RUN: %clang -target arm64-apple-tvos12.3 -isysroot %S/Inputs/iPhoneOS13.0.sdk -mlinker-version=0 -### %t.o 2>&1 \
+// RUN: | FileCheck --check-prefix=LINKER-OLD %s
+// RUN: %clang -target arm64-apple-tvos12.3 -isysroot %S/Inputs/iPhoneOS13.0.sdk -mlinker-version=400 -### %t.o 2>&1 \
+// RUN: | FileCheck --check-prefix=LINKER-OLD %s
+// RUN: %clang -target arm64-apple-tvos12.3 -isysroot %S/Inputs/iPhoneOS13.0.sdk -mlinker-version=520 -### %t.o 2>&1 \
+// RUN: | FileCheck --check-prefix=LINKER-NEW %s
+// RUN: %clang -target x86_64-apple-tvos13-simulator -isysroot %S/Inputs/iPhoneOS13.0.sdk -mlinker-version=520 -### %t.o 2>&1 \
+// RUN: | FileCheck --check-prefix=SIMUL %s
+
+// LINKER-OLD: "-tvos_version_min" "12.3.0"
+// LINKER-NEW: "-platform_version" "tvos" "12.3.0" "13.0"
+// SIMUL: "-platform_version" "tvos-simulator" "13.0.0" "13.0"
diff --git a/src/llvm-project/clang/test/Driver/darwin-ld-platform-version-watchos.c b/src/llvm-project/clang/test/Driver/darwin-ld-platform-version-watchos.c
new file mode 100644
index 0000000..db565dd
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/darwin-ld-platform-version-watchos.c
@@ -0,0 +1,14 @@
+// RUN: touch %t.o
+
+// RUN: %clang -target arm64_32-apple-watchos5.2 -isysroot %S/Inputs/WatchOS6.0.sdk -mlinker-version=0 -### %t.o 2>&1 \
+// RUN: | FileCheck --check-prefix=LINKER-OLD %s
+// RUN: %clang -target arm64_32-apple-watchos5.2 -isysroot %S/Inputs/WatchOS6.0.sdk -mlinker-version=400 -### %t.o 2>&1 \
+// RUN: | FileCheck --check-prefix=LINKER-OLD %s
+// RUN: %clang -target arm64_32-apple-watchos5.2 -isysroot %S/Inputs/WatchOS6.0.sdk -mlinker-version=520 -### %t.o 2>&1 \
+// RUN: | FileCheck --check-prefix=LINKER-NEW %s
+// RUN: %clang -target x86_64-apple-watchos6-simulator -isysroot %S/Inputs/WatchOS6.0.sdk -mlinker-version=520 -### %t.o 2>&1 \
+// RUN: | FileCheck --check-prefix=SIMUL %s
+
+// LINKER-OLD: "-watchos_version_min" "5.2.0"
+// LINKER-NEW: "-platform_version" "watchos" "5.2.0" "6.0.0"
+// SIMUL: "-platform_version" "watchos-simulator" "6.0.0" "6.0.0"
diff --git a/src/llvm-project/clang/test/Driver/darwin-ld.c b/src/llvm-project/clang/test/Driver/darwin-ld.c
index eb357a9..001ed87 100644
--- a/src/llvm-project/clang/test/Driver/darwin-ld.c
+++ b/src/llvm-project/clang/test/Driver/darwin-ld.c
@@ -5,15 +5,15 @@
// Make sure we run dsymutil on source input files.
// RUN: %clang -target i386-apple-darwin9 -### -g %s -o BAR 2> %t.log
-// RUN: grep '".*dsymutil\(.exe\)\?" "-o" "BAR.dSYM" "BAR"' %t.log
+// RUN: grep -E '".*dsymutil(\.exe)?" "-o" "BAR.dSYM" "BAR"' %t.log
// RUN: %clang -target i386-apple-darwin9 -### -g -filelist FOO %s -o BAR 2> %t.log
-// RUN: grep '".*dsymutil\(.exe\)\?" "-o" "BAR.dSYM" "BAR"' %t.log
+// RUN: grep -E '".*dsymutil(\.exe)?" "-o" "BAR.dSYM" "BAR"' %t.log
// Check linker changes that came with new linkedit format.
// RUN: touch %t.o
-// RUN: %clang -target i386-apple-darwin9 -### -arch armv6 -miphoneos-version-min=3.0 %t.o 2> %t.log
-// RUN: %clang -target i386-apple-darwin9 -### -arch armv6 -miphoneos-version-min=3.0 -dynamiclib %t.o 2>> %t.log
-// RUN: %clang -target i386-apple-darwin9 -### -arch armv6 -miphoneos-version-min=3.0 -bundle %t.o 2>> %t.log
+// RUN: %clang -target i386-apple-darwin9 -mlinker-version=400 -### -arch armv6 -miphoneos-version-min=3.0 %t.o 2> %t.log
+// RUN: %clang -target i386-apple-darwin9 -mlinker-version=400 -### -arch armv6 -miphoneos-version-min=3.0 -dynamiclib %t.o 2>> %t.log
+// RUN: %clang -target i386-apple-darwin9 -mlinker-version=400 -### -arch armv6 -miphoneos-version-min=3.0 -bundle %t.o 2>> %t.log
// RUN: FileCheck -check-prefix=LINK_IPHONE_3_0 %s < %t.log
// LINK_IPHONE_3_0: {{ld(.exe)?"}}
@@ -30,9 +30,9 @@
// LINK_IPHONE_3_0: -lbundle1.o
// LINK_IPHONE_3_0: -lSystem
-// RUN: %clang -target i386-apple-darwin9 -### -arch armv7 -miphoneos-version-min=3.1 %t.o 2> %t.log
-// RUN: %clang -target i386-apple-darwin9 -### -arch armv7 -miphoneos-version-min=3.1 -dynamiclib %t.o 2>> %t.log
-// RUN: %clang -target i386-apple-darwin9 -### -arch armv7 -miphoneos-version-min=3.1 -bundle %t.o 2>> %t.log
+// RUN: %clang -target i386-apple-darwin9 -mlinker-version=400 -### -arch armv7 -miphoneos-version-min=3.1 %t.o 2> %t.log
+// RUN: %clang -target i386-apple-darwin9 -mlinker-version=400 -### -arch armv7 -miphoneos-version-min=3.1 -dynamiclib %t.o 2>> %t.log
+// RUN: %clang -target i386-apple-darwin9 -mlinker-version=400 -### -arch armv7 -miphoneos-version-min=3.1 -bundle %t.o 2>> %t.log
// RUN: FileCheck -check-prefix=LINK_IPHONE_3_1 %s < %t.log
// LINK_IPHONE_3_1: {{ld(.exe)?"}}
@@ -49,9 +49,9 @@
// LINK_IPHONE_3_1-NOT: -lbundle1.o
// LINK_IPHONE_3_1: -lSystem
-// RUN: %clang -target i386-apple-darwin9 -### -arch i386 -mios-simulator-version-min=3.0 %t.o 2> %t.log
-// RUN: %clang -target i386-apple-darwin9 -### -arch i386 -mios-simulator-version-min=3.0 -dynamiclib %t.o 2>> %t.log
-// RUN: %clang -target i386-apple-darwin9 -### -arch i386 -mios-simulator-version-min=3.0 -bundle %t.o 2>> %t.log
+// RUN: %clang -target i386-apple-darwin9 -mlinker-version=400 -### -arch i386 -mios-simulator-version-min=3.0 %t.o 2> %t.log
+// RUN: %clang -target i386-apple-darwin9 -mlinker-version=400 -### -arch i386 -mios-simulator-version-min=3.0 -dynamiclib %t.o 2>> %t.log
+// RUN: %clang -target i386-apple-darwin9 -mlinker-version=400 -### -arch i386 -mios-simulator-version-min=3.0 -bundle %t.o 2>> %t.log
// RUN: FileCheck -check-prefix=LINK_IOSSIM_3_0 %s < %t.log
// LINK_IOSSIM_3_0: {{ld(.exe)?"}}
@@ -132,8 +132,8 @@
// LINK_LAZY_LIBRARY: {{ld(.exe)?"}}
// LINK_LAZY_LIBRARY: "-lazy_library" "Library"
-// RUN: %clang -target x86_64-apple-darwin10 -### %t.o 2> %t.log
-// RUN: %clang -target x86_64-apple-macosx10.7 -### %t.o 2>> %t.log
+// RUN: %clang -target x86_64-apple-darwin10 -mlinker-version=400 -### %t.o 2> %t.log
+// RUN: %clang -target x86_64-apple-macosx10.7 -mlinker-version=400 -### %t.o 2>> %t.log
// RUN: FileCheck -check-prefix=LINK_VERSION_MIN %s < %t.log
// LINK_VERSION_MIN: {{ld(.exe)?"}}
// LINK_VERSION_MIN: "-macosx_version_min" "10.6.0"
@@ -158,7 +158,7 @@
// LINK_IOSSIM_PROFILE: libclang_rt.profile_iossim.a
// LINK_IOSSIM_PROFILE: libclang_rt.ios.a
-// RUN: %clang -target arm64-apple-tvos8.3 -mtvos-version-min=8.3 -resource-dir=%S/Inputs/resource_dir -### %t.o 2> %t.log
+// RUN: %clang -target arm64-apple-tvos8.3 -mlinker-version=400 -mtvos-version-min=8.3 -resource-dir=%S/Inputs/resource_dir -### %t.o 2> %t.log
// RUN: FileCheck -check-prefix=LINK_TVOS_ARM64 %s < %t.log
// LINK_TVOS_ARM64: {{ld(.exe)?"}}
// LINK_TVOS_ARM64: -tvos_version_min
@@ -166,19 +166,19 @@
// LINK_TVOS_ARM64-NOT: lgcc_s.1
// LINK_TVOS_ARM64: libclang_rt.tvos.a
-// RUN: %clang -target arm64-apple-tvos8.3 -mtvos-version-min=8.3 -fprofile-instr-generate -resource-dir=%S/Inputs/resource_dir -### %t.o 2> %t.log
+// RUN: %clang -target arm64-apple-tvos8.3 -mlinker-version=400 -mtvos-version-min=8.3 -fprofile-instr-generate -resource-dir=%S/Inputs/resource_dir -### %t.o 2> %t.log
// RUN: FileCheck -check-prefix=LINK_TVOS_PROFILE %s < %t.log
// LINK_TVOS_PROFILE: {{ld(.exe)?"}}
// LINK_TVOS_PROFILE: libclang_rt.profile_tvos.a
// LINK_TVOS_PROFILE: libclang_rt.tvos.a
-// RUN: %clang -target arm64-apple-tvos8.3 -mtvos-version-min=8.3 -resource-dir=%S/Inputs/resource_dir -### %t.o -lcc_kext 2> %t.log
+// RUN: %clang -target arm64-apple-tvos8.3 -mlinker-version=400 -mtvos-version-min=8.3 -resource-dir=%S/Inputs/resource_dir -### %t.o -lcc_kext 2> %t.log
// RUN: FileCheck -check-prefix=LINK_TVOS_KEXT %s < %t.log
// LINK_TVOS_KEXT: {{ld(.exe)?"}}
// LINK_TVOS_KEXT: libclang_rt.cc_kext_tvos.a
// LINK_TVOS_KEXT: libclang_rt.tvos.a
-// RUN: %clang -target armv7k-apple-watchos2.0 -mwatchos-version-min=2.0 -resource-dir=%S/Inputs/resource_dir -### %t.o 2> %t.log
+// RUN: %clang -target armv7k-apple-watchos2.0 -mlinker-version=400 -mwatchos-version-min=2.0 -resource-dir=%S/Inputs/resource_dir -### %t.o 2> %t.log
// RUN: FileCheck -check-prefix=LINK_WATCHOS_ARM %s < %t.log
// LINK_WATCHOS_ARM: {{ld(.exe)?"}}
// LINK_WATCHOS_ARM: -watchos_version_min
@@ -186,13 +186,13 @@
// LINK_WATCHOS_ARM-NOT: lgcc_s.1
// LINK_WATCHOS_ARM: libclang_rt.watchos.a
-// RUN: %clang -target armv7k-apple-watchos2.0 -mwatchos-version-min=2.0 -resource-dir=%S/Inputs/resource_dir -fprofile-instr-generate -### %t.o 2> %t.log
+// RUN: %clang -target armv7k-apple-watchos2.0 -mlinker-version=400 -mwatchos-version-min=2.0 -resource-dir=%S/Inputs/resource_dir -fprofile-instr-generate -### %t.o 2> %t.log
// RUN: FileCheck -check-prefix=LINK_WATCHOS_PROFILE %s < %t.log
// LINK_WATCHOS_PROFILE: {{ld(.exe)?"}}
// LINK_WATCHOS_PROFILE: libclang_rt.profile_watchos.a
// LINK_WATCHOS_PROFILE: libclang_rt.watchos.a
-// RUN: %clang -target armv7k-apple-watchos2.0 -mwatchos-version-min=2.0 -resource-dir=%S/Inputs/resource_dir -### %t.o -lcc_kext 2> %t.log
+// RUN: %clang -target armv7k-apple-watchos2.0 -mlinker-version=400 -mwatchos-version-min=2.0 -resource-dir=%S/Inputs/resource_dir -### %t.o -lcc_kext 2> %t.log
// RUN: FileCheck -check-prefix=LINK_WATCHOS_KEXT %s < %t.log
// LINK_WATCHOS_KEXT: {{ld(.exe)?"}}
// LINK_WATCHOS_KEXT: libclang_rt.cc_kext_watchos.a
@@ -251,30 +251,30 @@
// IPHONEOS_DEPLOYMENT_TARGET variable is used instead of the command-line
// deployment target options.
// RUN: env IPHONEOS_DEPLOYMENT_TARGET=7.0 \
-// RUN: %clang -target arm64-apple-darwin -### %t.o 2> %t.log
+// RUN: %clang -target arm64-apple-darwin -mlinker-version=400 -### %t.o 2> %t.log
// RUN: FileCheck -check-prefix=LINK_IPHONEOS_VERSION_MIN %s < %t.log
// RUN: env IPHONEOS_DEPLOYMENT_TARGET=7.0 \
-// RUN: %clang -target i386-apple-darwin -### %t.o 2> %t.log
+// RUN: %clang -target i386-apple-darwin -mlinker-version=400 -### %t.o 2> %t.log
// RUN: FileCheck -check-prefix=LINK_IOS_SIMULATOR_VERSION_MIN %s < %t.log
// LINK_IPHONEOS_VERSION_MIN: -iphoneos_version_min
// LINK_IOS_SIMULATOR_VERSION_MIN: -ios_simulator_version_min
// Ditto for tvOS....
// RUN: env TVOS_DEPLOYMENT_TARGET=7.0 \
-// RUN: %clang -target armv7-apple-darwin -### %t.o 2> %t.log
+// RUN: %clang -target armv7-apple-darwin -mlinker-version=400 -### %t.o 2> %t.log
// RUN: FileCheck -check-prefix=LINK_TVOS_VERSION_MIN %s < %t.log
// RUN: env TVOS_DEPLOYMENT_TARGET=7.0 \
-// RUN: %clang -target x86_64-apple-darwin -### %t.o 2> %t.log
+// RUN: %clang -target x86_64-apple-darwin -mlinker-version=400 -### %t.o 2> %t.log
// RUN: FileCheck -check-prefix=LINK_TVOS_SIMULATOR_VERSION_MIN %s < %t.log
// LINK_TVOS_VERSION_MIN: -tvos_version_min
// LINK_TVOS_SIMULATOR_VERSION_MIN: -tvos_simulator_version_min
// ...and for watchOS.
// RUN: env WATCHOS_DEPLOYMENT_TARGET=2.0 \
-// RUN: %clang -target armv7k-apple-darwin -### %t.o 2> %t.log
+// RUN: %clang -target armv7k-apple-darwin -mlinker-version=400 -### %t.o 2> %t.log
// RUN: FileCheck -check-prefix=LINK_WATCHOS_VERSION_MIN %s < %t.log
// RUN: env WATCHOS_DEPLOYMENT_TARGET=2.0 \
-// RUN: %clang -target i386-apple-darwin -### %t.o 2> %t.log
+// RUN: %clang -target i386-apple-darwin -mlinker-version=400 -### %t.o 2> %t.log
// RUN: FileCheck -check-prefix=LINK_WATCHOS_SIMULATOR_VERSION_MIN %s < %t.log
// LINK_WATCHOS_VERSION_MIN: -watchos_version_min
// LINK_WATCHOS_SIMULATOR_VERSION_MIN: -watchos_simulator_version_min
@@ -345,6 +345,12 @@
// RUN: FileCheck -check-prefix=LINK_PROFILE_FIRST %s < %t.log
// LINK_PROFILE_FIRST: {{ld(.exe)?"}} "{{[^"]+}}libclang_rt.profile_{{[a-z]+}}.a"
+// RUN: %clang -target x86_64-apple-darwin12 -fprofile-instr-generate -### %t.o 2> %t.log
+// RUN: FileCheck -check-prefix=PROFILE_SECTALIGN %s < %t.log
+// RUN: %clang -target arm64-apple-ios12 -fprofile-instr-generate -### %t.o 2> %t.log
+// RUN: FileCheck -check-prefix=PROFILE_SECTALIGN %s < %t.log
+// PROFILE_SECTALIGN: "-sectalign" "__DATA" "__llvm_prf_cnts" "0x4000" "-sectalign" "__DATA" "__llvm_prf_data" "0x4000"
+
// RUN: %clang -target x86_64-apple-darwin12 -fprofile-instr-generate -exported_symbols_list /dev/null -### %t.o 2> %t.log
// RUN: FileCheck -check-prefix=PROFILE_EXPORT %s < %t.log
// RUN: %clang -target x86_64-apple-darwin12 -fprofile-instr-generate -Wl,-exported_symbols_list,/dev/null -### %t.o 2> %t.log
@@ -355,7 +361,7 @@
// RUN: FileCheck -check-prefix=PROFILE_EXPORT %s < %t.log
// RUN: %clang -target x86_64-apple-darwin12 -fprofile-instr-generate -Xlinker -exported_symbols_list -Xlinker /dev/null -### %t.o 2> %t.log
// RUN: FileCheck -check-prefix=PROFILE_EXPORT %s < %t.log
-// PROFILE_EXPORT: "-exported_symbol" "___llvm_profile_filename" "-exported_symbol" "___llvm_profile_raw_version" "-exported_symbol" "_lprofCurFilename"
+// PROFILE_EXPORT: "-exported_symbol" "___llvm_profile_filename" "-exported_symbol" "___llvm_profile_raw_version"
//
// RUN: %clang -target x86_64-apple-darwin12 -fprofile-instr-generate --coverage -### %t.o 2> %t.log
// RUN: FileCheck -check-prefix=NO_PROFILE_EXPORT %s < %t.log
diff --git a/src/llvm-project/clang/test/Driver/darwin-opt-record.c b/src/llvm-project/clang/test/Driver/darwin-opt-record.c
new file mode 100644
index 0000000..4a61932
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/darwin-opt-record.c
@@ -0,0 +1,31 @@
+// REQUIRES: system-darwin
+
+// RUN: %clang -target x86_64-apple-darwin10 -### -c -o FOO -fsave-optimization-record -arch x86_64 -arch x86_64h %s 2>&1 | FileCheck %s --check-prefix=CHECK-MULTIPLE-ARCH
+// RUN: %clang -target x86_64-apple-darwin10 -### -c -o FOO -foptimization-record-file=tmp -arch x86_64 -arch x86_64h %s 2>&1 | FileCheck %s --check-prefix=CHECK-MULTIPLE-ARCH-ERROR
+// RUN: %clang -target x86_64-apple-darwin10 -### -o FOO -fsave-optimization-record %s 2>&1 | FileCheck %s --check-prefix=CHECK-DSYMUTIL-NO-G
+// RUN: %clang -target x86_64-apple-darwin10 -### -o FOO -g0 -fsave-optimization-record %s 2>&1 | FileCheck %s --check-prefix=CHECK-DSYMUTIL-G0
+// RUN: %clang -target x86_64-apple-darwin10 -### -o FOO -fsave-optimization-record=bitstream %s 2>&1 | FileCheck %s --check-prefix=CHECK-NO-G-PATH-BITSTREAM
+//
+// CHECK-MULTIPLE-ARCH: "-cc1"
+// CHECK-MULTIPLE-ARCH: "-opt-record-file" "FOO-x86_64.opt.yaml"
+// CHECK-MULTIPLE-ARCH: "-cc1"
+// CHECK-MULTIPLE-ARCH: "-opt-record-file" "FOO-x86_64h.opt.yaml"
+//
+// CHECK-MULTIPLE-ARCH-ERROR: cannot use '-foptimization-record-file' output with multiple -arch options
+//
+// CHECK-DSYMUTIL-NO-G: "-cc1"
+// CHECK-DSYMUTIL-NO-G: ld
+// CHECK-DSYMUTIL-NO-G: dsymutil
+//
+// Even in the presence of -g0, -fsave-optimization-record implies
+// -gline-tables-only and would need -fno-save-optimization-record to
+// completely disable it.
+// CHECK-DSYMUTIL-G0: "-cc1"
+// CHECK-DSYMUTIL-G0: ld
+// CHECK-DSYMUTIL-G0: dsymutil
+//
+// CHECK-NO-G-PATH-BITSTREAM: "-cc1"
+// CHECK-NO-G-PATH-BITSTREAM: "-opt-record-file" "[[OUTPATH:.*]].opt.bitstream"
+// CHECK-NO-G-PATH-BITSTREAM: "-o" "[[OUTPATH:.*]].o"
+// CHECK-NO-G-PATH-BITSTREAM: ld
+// CHECK-NO-G-PATH-BITSTREAM: dsymutil
diff --git a/src/llvm-project/clang/test/Driver/darwin-sdkroot.c b/src/llvm-project/clang/test/Driver/darwin-sdkroot.c
index 8b3782e..fae0d44 100644
--- a/src/llvm-project/clang/test/Driver/darwin-sdkroot.c
+++ b/src/llvm-project/clang/test/Driver/darwin-sdkroot.c
@@ -2,7 +2,7 @@
//
// RUN: rm -rf %t.tmpdir
// RUN: mkdir -p %t.tmpdir
-// RUN: env SDKROOT=%t.tmpdir %clang -target x86_64-apple-darwin10 \
+// RUN: env SDKROOT=%t.tmpdir %clang -target x86_64-apple-darwin10 --sysroot="" \
// RUN: -c %s -### 2> %t.log
// RUN: FileCheck --check-prefix=CHECK-BASIC < %t.log %s
//
@@ -13,7 +13,7 @@
// Check that we don't use SDKROOT as the default if it is not a valid path.
//
// RUN: rm -rf %t.nonpath
-// RUN: env SDKROOT=%t.nonpath %clang -target x86_64-apple-darwin10 \
+// RUN: env SDKROOT=%t.nonpath %clang -target x86_64-apple-darwin10 --sysroot="" \
// RUN: -c %s -### 2> %t.log
// RUN: FileCheck --check-prefix=CHECK-NONPATH < %t.log %s
//
@@ -23,7 +23,7 @@
// Check that we don't use SDKROOT as the default if it is just "/"
//
-// RUN: env SDKROOT=/ %clang -target x86_64-apple-darwin10 \
+// RUN: env SDKROOT=/ %clang -target x86_64-apple-darwin10 --sysroot="" \
// RUN: -c %s -### 2> %t.log
// RUN: FileCheck --check-prefix=CHECK-NONROOT < %t.log %s
//
@@ -43,7 +43,7 @@
//
// RUN: rm -rf %t/SDKs/iPhoneOS8.0.0.sdk
// RUN: mkdir -p %t/SDKs/iPhoneOS8.0.0.sdk
-// RUN: env SDKROOT=%t/SDKs/iPhoneOS8.0.0.sdk %clang -target arm64-apple-darwin %s -### 2>&1 \
+// RUN: env SDKROOT=%t/SDKs/iPhoneOS8.0.0.sdk %clang -target arm64-apple-darwin -mlinker-version=400 --sysroot="" %s -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-IPHONE %s
//
// CHECK-IPHONE: clang
@@ -55,7 +55,7 @@
//
// RUN: rm -rf %t/SDKs/iPhoneSimulator8.0.sdk
// RUN: mkdir -p %t/SDKs/iPhoneSimulator8.0.sdk
-// RUN: env SDKROOT=%t/SDKs/iPhoneSimulator8.0.sdk %clang -target x86_64-apple-darwin %s -### 2>&1 \
+// RUN: env SDKROOT=%t/SDKs/iPhoneSimulator8.0.sdk %clang -target x86_64-apple-darwin -mlinker-version=400 --sysroot="" %s -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-SIMULATOR %s
//
// CHECK-SIMULATOR: clang
@@ -66,7 +66,7 @@
//
// RUN: rm -rf %t/SDKs/MacOSX10.10.0.sdk
// RUN: mkdir -p %t/SDKs/MacOSX10.10.0.sdk
-// RUN: env SDKROOT=%t/SDKs/MacOSX10.10.0.sdk %clang -target x86_64-apple-darwin %s -### 2>&1 \
+// RUN: env SDKROOT=%t/SDKs/MacOSX10.10.0.sdk %clang -target x86_64-apple-darwin -mlinker-version=400 --sysroot="" %s -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-MACOSX %s
//
// CHECK-MACOSX: clang
diff --git a/src/llvm-project/clang/test/Driver/debug-default-version.c b/src/llvm-project/clang/test/Driver/debug-default-version.c
new file mode 100644
index 0000000..f244c88
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/debug-default-version.c
@@ -0,0 +1,44 @@
+// RUN: %clang -### -Werror -target x86_64-linux-gnu -fdebug-default-version=4 -gdwarf-2 -S -o - %s 2>&1 | FileCheck %s --check-prefix=DWARF2
+// RUN: %clang -### -Werror -target x86_64-linux-gnu -gdwarf-3 -fdebug-default-version=4 -S -o - %s 2>&1 | FileCheck %s --check-prefix=DWARF3
+// RUN: %clang -### -Werror -target x86_64-linux-gnu -gdwarf-4 -fdebug-default-version=2 -S -o - %s 2>&1 | FileCheck %s --check-prefix=DWARF4
+// RUN: %clang -### -Werror -target x86_64-linux-gnu -gdwarf-5 -S -fdebug-default-version=2 -o - %s 2>&1 | FileCheck %s --check-prefix=DWARF5
+// RUN: %clang -### -Werror -target x86_64-linux-gnu -fdebug-default-version=5 -g -S -o - %s 2>&1 | FileCheck %s --check-prefix=DWARF5
+// RUN: %clang -### -Werror -target x86_64-linux-gnu -gdwarf -fdebug-default-version=2 -S -o - %s 2>&1 | FileCheck %s --check-prefix=DWARF2
+// RUN: %clang -### -Werror -target x86_64-linux-gnu -fdebug-default-version=4 -S -o - %s 2>&1 | FileCheck %s --check-prefixes=NODEBUGINFO,NODWARF4
+
+// Check which debug info formats we use on Windows. By default, in an MSVC
+// environment, we should use codeview. You can enable dwarf, which implicitly
+// disables codeview, or you can explicitly ask for both if you don't know how
+// the app will be debugged.
+// RUN: %clang -### -Werror -target i686-pc-windows-msvc -fdebug-default-version=2 -gdwarf -S -o - %s 2>&1 \
+// RUN: | FileCheck %s --check-prefixes=DWARF2,NOCODEVIEW
+// Explicitly request both.
+// RUN: %clang -### -Werror -target i686-pc-windows-msvc -fdebug-default-version=4 -gdwarf -gcodeview -S -o - %s 2>&1 \
+// RUN: | FileCheck %s --check-prefixes=DWARF4,CODEVIEW
+
+// Do Assembler testing most of the same test cases as those above.
+
+// RUN: %clang -### -Werror -target x86_64-linux-gnu -fdebug-default-version=5 -g -x assembler -c -o - %s 2>&1 | FileCheck %s --check-prefix=DWARF5
+
+// RUN: %clang -### -Werror -target x86_64-linux-gnu -fdebug-default-version=4 -gdwarf-2 -x assembler -c -o - %s 2>&1 | FileCheck %s --check-prefix=DWARF2
+// RUN: %clang -### -Werror -target x86_64-linux-gnu -gdwarf-3 -fdebug-default-version=4 -x assembler -c -o - %s 2>&1 | FileCheck %s --check-prefix=DWARF3
+// RUN: %clang -### -Werror -target x86_64-linux-gnu -gdwarf-4 -fdebug-default-version=2 -x assembler -c -o - %s 2>&1 | FileCheck %s --check-prefix=DWARF4
+// RUN: %clang -### -Werror -target x86_64-linux-gnu -gdwarf-5 -x assembler -c -fdebug-default-version=2 -o - %s 2>&1 | FileCheck %s --check-prefix=DWARF5
+// RUN: %clang -### -Werror -target x86_64-linux-gnu -fdebug-default-version=5 -g -x assembler -c -o - %s 2>&1 | FileCheck %s --check-prefix=DWARF5
+
+int main(void) {
+ return 0;
+}
+
+// NOCODEVIEW-NOT: -gcodeview
+// CODEVIEW: "-gcodeview"
+
+// NODEBUGINFO-NOT: -debug-info-kind=
+
+// DWARF2: "-dwarf-version=2"
+// DWARF3: "-dwarf-version=3"
+// DWARF4: "-dwarf-version=4"
+// DWARF5: "-dwarf-version=5"
+
+// NOCODEVIEW-NOT: -gcodeview
+// NODWARF4-NOT: -dwarf-version=4
diff --git a/src/llvm-project/clang/test/Driver/debug-options.c b/src/llvm-project/clang/test/Driver/debug-options.c
index dce72ff..acbc056 100644
--- a/src/llvm-project/clang/test/Driver/debug-options.c
+++ b/src/llvm-project/clang/test/Driver/debug-options.c
@@ -64,10 +64,20 @@
// RUN: %clang -### -c -g %s -target arm64-apple-tvos9.0 2>&1 \
// RUN: | FileCheck -check-prefix=G_STANDALONE \
// RUN: -check-prefix=G_DWARF4 %s
+// RUN: %clang -### -c -fsave-optimization-record %s \
+// RUN: -target x86_64-apple-darwin 2>&1 \
+// RUN: | FileCheck -check-prefix=GLTO_ONLY %s
+// RUN: %clang -### -c -g -fsave-optimization-record %s \
+// RUN: -target x86_64-apple-darwin 2>&1 \
+// RUN: | FileCheck -check-prefix=G_STANDALONE %s
// FreeBSD.
-// RUN: %clang -### -c -g %s -target x86_64-pc-freebsd10.0 2>&1 \
-// RUN: | FileCheck -check-prefix=G_GDB %s
+// RUN: %clang -### -c -g %s -target x86_64-pc-freebsd11.0 2>&1 \
+// RUN: | FileCheck -check-prefix=G_GDB \
+// RUN: -check-prefix=G_DWARF2 %s
+// RUN: %clang -### -c -g %s -target x86_64-pc-freebsd12.0 2>&1 \
+// RUN: | FileCheck -check-prefix=G_GDB \
+// RUN: -check-prefix=G_DWARF4 %s
// Windows.
// RUN: %clang -### -c -g %s -target x86_64-w64-windows-gnu 2>&1 \
@@ -193,7 +203,7 @@
// RUN: %clang -### -c %s 2>&1 | FileCheck -check-prefix=NORNGBSE %s
// RUN: %clang -### -c -fdebug-ranges-base-address -fno-debug-ranges-base-address %s 2>&1 | FileCheck -check-prefix=NORNGBSE %s
//
-// RUN: %clang -### -c -glldb %s 2>&1 | FileCheck -check-prefix=GPUB %s
+// RUN: %clang -### -c -glldb %s 2>&1 | FileCheck -check-prefix=NOPUB %s
// RUN: %clang -### -c -glldb -gno-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s
//
// RUN: %clang -### -c -gdwarf-aranges %s 2>&1 | FileCheck -check-prefix=GARANGE %s
diff --git a/src/llvm-project/clang/test/Driver/debug-prefix-map.S b/src/llvm-project/clang/test/Driver/debug-prefix-map.S
index 2ba66be..7d12a17 100644
--- a/src/llvm-project/clang/test/Driver/debug-prefix-map.S
+++ b/src/llvm-project/clang/test/Driver/debug-prefix-map.S
@@ -1,4 +1,5 @@
// RUN: %clang -### -g -fdebug-prefix-map=old=new %s 2>&1 | FileCheck %s
+// RUN: %clang -### -g -ffile-prefix-map=old=new %s 2>&1 | FileCheck %s
// CHECK: cc1as
// CHECK-SAME: -fdebug-prefix-map=old=new
diff --git a/src/llvm-project/clang/test/Driver/debug-prefix-map.c b/src/llvm-project/clang/test/Driver/debug-prefix-map.c
index b4f3859..f2c87cb 100644
--- a/src/llvm-project/clang/test/Driver/debug-prefix-map.c
+++ b/src/llvm-project/clang/test/Driver/debug-prefix-map.c
@@ -1,9 +1,28 @@
-// RUN: %clang -### -fdebug-prefix-map=old %s 2>&1 | FileCheck %s -check-prefix CHECK-INVALID
-// RUN: %clang -### -fdebug-prefix-map=old=new %s 2>&1 | FileCheck %s -check-prefix CHECK-SIMPLE
-// RUN: %clang -### -fdebug-prefix-map=old=n=ew %s 2>&1 | FileCheck %s -check-prefix CHECK-COMPLEX
-// RUN: %clang -### -fdebug-prefix-map=old= %s 2>&1 | FileCheck %s -check-prefix CHECK-EMPTY
+// RUN: %clang -### -fdebug-prefix-map=old %s 2>&1 | FileCheck %s -check-prefix CHECK-DEBUG-INVALID
+// RUN: %clang -### -fmacro-prefix-map=old %s 2>&1 | FileCheck %s -check-prefix CHECK-MACRO-INVALID
+// RUN: %clang -### -ffile-prefix-map=old %s 2>&1 | FileCheck %s -check-prefix CHECK-FILE-INVALID
-// CHECK-INVALID: error: invalid argument 'old' to -fdebug-prefix-map
-// CHECK-SIMPLE: fdebug-prefix-map=old=new
-// CHECK-COMPLEX: fdebug-prefix-map=old=n=ew
-// CHECK-EMPTY: fdebug-prefix-map=old=
+// RUN: %clang -### -fdebug-prefix-map=old=new %s 2>&1 | FileCheck %s -check-prefix CHECK-DEBUG-SIMPLE
+// RUN: %clang -### -fmacro-prefix-map=old=new %s 2>&1 | FileCheck %s -check-prefix CHECK-MACRO-SIMPLE
+// RUN: %clang -### -ffile-prefix-map=old=new %s 2>&1 | FileCheck %s -check-prefix CHECK-DEBUG-SIMPLE
+// RUN: %clang -### -ffile-prefix-map=old=new %s 2>&1 | FileCheck %s -check-prefix CHECK-MACRO-SIMPLE
+
+// RUN: %clang -### -fdebug-prefix-map=old=n=ew %s 2>&1 | FileCheck %s -check-prefix CHECK-DEBUG-COMPLEX
+// RUN: %clang -### -fmacro-prefix-map=old=n=ew %s 2>&1 | FileCheck %s -check-prefix CHECK-MACRO-COMPLEX
+// RUN: %clang -### -ffile-prefix-map=old=n=ew %s 2>&1 | FileCheck %s -check-prefix CHECK-DEBUG-COMPLEX
+// RUN: %clang -### -ffile-prefix-map=old=n=ew %s 2>&1 | FileCheck %s -check-prefix CHECK-MACRO-COMPLEX
+
+// RUN: %clang -### -fdebug-prefix-map=old= %s 2>&1 | FileCheck %s -check-prefix CHECK-DEBUG-EMPTY
+// RUN: %clang -### -fmacro-prefix-map=old= %s 2>&1 | FileCheck %s -check-prefix CHECK-MACRO-EMPTY
+// RUN: %clang -### -ffile-prefix-map=old= %s 2>&1 | FileCheck %s -check-prefix CHECK-DEBUG-EMPTY
+// RUN: %clang -### -ffile-prefix-map=old= %s 2>&1 | FileCheck %s -check-prefix CHECK-MACRO-EMPTY
+
+// CHECK-DEBUG-INVALID: error: invalid argument 'old' to -fdebug-prefix-map
+// CHECK-MACRO-INVALID: error: invalid argument 'old' to -fmacro-prefix-map
+// CHECK-FILE-INVALID: error: invalid argument 'old' to -ffile-prefix-map
+// CHECK-DEBUG-SIMPLE: fdebug-prefix-map=old=new
+// CHECK-MACRO-SIMPLE: fmacro-prefix-map=old=new
+// CHECK-DEBUG-COMPLEX: fdebug-prefix-map=old=n=ew
+// CHECK-MACRO-COMPLEX: fmacro-prefix-map=old=n=ew
+// CHECK-DEBUG-EMPTY: fdebug-prefix-map=old=
+// CHECK-MACRO-EMPTY: fmacro-prefix-map=old=
diff --git a/src/llvm-project/clang/test/Driver/embed-bitcode-wasm.c b/src/llvm-project/clang/test/Driver/embed-bitcode-wasm.c
new file mode 100644
index 0000000..3705a4d
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/embed-bitcode-wasm.c
@@ -0,0 +1,6 @@
+// REQUIRES: webassembly-registered-target
+
+// RUN: %clang -c -target wasm32-unknown-unknown %s -fembed-bitcode -o %t.o
+// RUN: llvm-readobj -S %t.o | FileCheck --check-prefix=CHECK %s
+// CHECK: Name: .llvmbc
+// CHECK: Name: .llvmcmd
diff --git a/src/llvm-project/clang/test/Driver/fast-math.c b/src/llvm-project/clang/test/Driver/fast-math.c
index 9163842..da47de2 100644
--- a/src/llvm-project/clang/test/Driver/fast-math.c
+++ b/src/llvm-project/clang/test/Driver/fast-math.c
@@ -170,11 +170,11 @@
// RUN: %clang -### -fno-fast-math -ffast-math -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-FAST-MATH %s
// RUN: %clang -### -funsafe-math-optimizations -ffinite-math-only \
-// RUN: -fno-math-errno -ffp-contract=fast -c %s 2>&1 \
+// RUN: -fno-math-errno -ffp-contract=fast -fno-rounding-math -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-FAST-MATH %s
// RUN: %clang -### -fno-honor-infinities -fno-honor-nans -fno-math-errno \
// RUN: -fassociative-math -freciprocal-math -fno-signed-zeros \
-// RUN: -fno-trapping-math -ffp-contract=fast -c %s 2>&1 \
+// RUN: -fno-trapping-math -ffp-contract=fast -fno-rounding-math -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-FAST-MATH %s
// CHECK-FAST-MATH: "-cc1"
// CHECK-FAST-MATH: "-ffast-math"
diff --git a/src/llvm-project/clang/test/Driver/fembed-bitcode.c b/src/llvm-project/clang/test/Driver/fembed-bitcode.c
index c1f020b..9705005 100644
--- a/src/llvm-project/clang/test/Driver/fembed-bitcode.c
+++ b/src/llvm-project/clang/test/Driver/fembed-bitcode.c
@@ -4,7 +4,7 @@
// CHECK-X64: "-cc1"
// CHECK-X64: "-cc1"
-// CHECK-X64-NOT: "-fdebug-compilation-dir"
+// CHECK-X64-NOT: "-fdebug-compilation-dir
// RUN: %clang -target armv7-apple-ios -fembed-bitcode=all -c %s -o /dev/null -### 2>&1 \
// RUN: | FileCheck -check-prefix CHECK-ARM %s
@@ -14,7 +14,7 @@
// CHECK-ARM: "-cc1"
// CHECK-ARM: "-target-abi"
// CHECK-ARM: "apcs-gnu"
-// CHECK-ARM-NOT: "-fdebug-compilation-dir"
+// CHECK-ARM-NOT: "-fdebug-compilation-dir
// RUN: %clang -target arm64-apple-ios -fembed-bitcode=all -c %s -o /dev/null -### 2>&1 \
// RUN: | FileCheck -check-prefix CHECK-AARCH64 %s
@@ -24,13 +24,18 @@
// CHECK-AARCH64: "-cc1"
// CHECK-AARCH64: "-target-abi"
// CHECK-AARCH64: "darwinpcs"
-// CHECK-AARCH64-NOT: "-fdebug-compilation-dir"
-
-// RUN: %clang -target x86_64-pc-freebsd12 -fembed-bitcode=all -c %s -### 2>&1 \
-// RUN: | FileCheck --check-prefix=CHECK-INITARRAY %s
-// CHECK-INITARRAY: "-fuse-init-array"
+// CHECK-AARCH64-NOT: "-fdebug-compilation-dir
// RUN: %clang -target hexagon-unknown-elf -ffixed-r19 -fembed-bitcode=all -c %s -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-HEXAGON %s
// CHECK-HEXAGON: "-target-feature"
// CHECK-HEXAGON: "+reserved-r19"
+//
+// RUN: %clang -target wasm32-unknown-unknown -fembed-bitcode=all -pthread -c %s -o /dev/null -### 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-WASM %s
+
+// CHECK-WASM: "-cc1"
+// CHECK-WASM: "-target-feature" "+atomics"
+
+// CHECK-WASM: "-cc1"
+// CHECK-WASM: "-target-feature" "+atomics"
diff --git a/src/llvm-project/clang/test/Driver/fforce-dwarf-frame.c b/src/llvm-project/clang/test/Driver/fforce-dwarf-frame.c
new file mode 100644
index 0000000..fb5442c
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/fforce-dwarf-frame.c
@@ -0,0 +1,6 @@
+// RUN: %clang -target arm -c -### %s -fforce-dwarf-frame 2>&1 | FileCheck --check-prefix=CHECK-ALWAYS %s
+// RUN: %clang -target arm -c -### %s -fno-force-dwarf-frame 2>&1 | FileCheck --check-prefix=CHECK-NO-ALWAYS %s
+// RUN: %clang -target arm -c -### %s 2>&1 | FileCheck --check-prefix=CHECK-NO-ALWAYS %s
+
+// CHECK-ALWAYS: -fforce-dwarf-frame
+// CHECK-NO-ALWAYS-NOT: -fforce-dwarf-frame
diff --git a/src/llvm-project/clang/test/Driver/fgnuc-version.c b/src/llvm-project/clang/test/Driver/fgnuc-version.c
new file mode 100644
index 0000000..dea82bb
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/fgnuc-version.c
@@ -0,0 +1,26 @@
+//
+// Verify -fgnuc-version parsing
+//
+
+// RUN: %clang -c %s -target i686-linux -### 2>&1 | FileCheck %s -check-prefix GNUC-DEFAULT
+// GNUC-DEFAULT: "-fgnuc-version=4.2.1"
+
+// RUN: %clang -c %s -target i686-linux -fgnuc-version=100.99.99 -### 2>&1 | FileCheck %s -check-prefix GNUC-OVERRIDE
+// GNUC-OVERRIDE: "-fgnuc-version=100.99.99"
+
+// RUN: %clang -c %s -target i686-linux -fgnuc-version=0 -### 2>&1 | FileCheck %s -check-prefix GNUC-DISABLE
+// RUN: %clang -c %s -target i686-linux -fgnuc-version= -### 2>&1 | FileCheck %s -check-prefix GNUC-DISABLE
+// GNUC-DISABLE-NOT: "-fgnuc-version=
+
+// RUN: not %clang -c %s -target i686-linux -fgnuc-version=100.100.10 2>&1 | FileCheck %s -check-prefix GNUC-INVALID
+// RUN: not %clang -c %s -target i686-linux -fgnuc-version=100.10.100 2>&1 | FileCheck %s -check-prefix GNUC-INVALID
+// RUN: not %clang -c %s -target i686-linux -fgnuc-version=-1.0.0 2>&1 | FileCheck %s -check-prefix GNUC-INVALID
+// GNUC-INVALID: error: invalid value {{.*}} in '-fgnuc-version={{.*}}'
+
+// RUN: %clang -fgnuc-version=100.99.99 %s -dM -E -o - | FileCheck %s -check-prefix GNUC-LARGE
+// GNUC-LARGE: #define __GNUC_MINOR__ 99
+// GNUC-LARGE: #define __GNUC_PATCHLEVEL__ 99
+// GNUC-LARGE: #define __GNUC__ 100
+
+// RUN: %clang -fgnuc-version=100.99.99 -x c++ %s -dM -E -o - | FileCheck %s -check-prefix GXX-LARGE
+// GXX-LARGE: #define __GNUG__ 100
diff --git a/src/llvm-project/clang/test/Driver/flang/Inputs/one.f90 b/src/llvm-project/clang/test/Driver/flang/Inputs/one.f90
new file mode 100644
index 0000000..3c234da
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/flang/Inputs/one.f90
@@ -0,0 +1 @@
+! This file only exists to facilitate a driver -### test.
diff --git a/src/llvm-project/clang/test/Driver/flang/Inputs/other.c b/src/llvm-project/clang/test/Driver/flang/Inputs/other.c
new file mode 100644
index 0000000..719903e
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/flang/Inputs/other.c
@@ -0,0 +1 @@
+/* This file only exists to facilitate a driver -### test. */
diff --git a/src/llvm-project/clang/test/Driver/flang/Inputs/two.f90 b/src/llvm-project/clang/test/Driver/flang/Inputs/two.f90
new file mode 100644
index 0000000..3c234da
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/flang/Inputs/two.f90
@@ -0,0 +1 @@
+! This file only exists to facilitate a driver -### test.
diff --git a/src/llvm-project/clang/test/Driver/flang/flang.f90 b/src/llvm-project/clang/test/Driver/flang/flang.f90
new file mode 100644
index 0000000..9d47c7c
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/flang/flang.f90
@@ -0,0 +1,51 @@
+! Check that flang -fc1 is invoked when in --driver-mode=flang.
+
+! This is a copy of flang_ucase.F90 because the driver has logic in it which
+! differentiates between F90 and f90 files. Flang will not treat these files
+! differently.
+
+! Test various output types:
+! * -E
+! * -fsyntax-only
+! * -emit-llvm -S
+! * -emit-llvm
+! * -S
+! * (no type specified, resulting in an object file)
+
+! All invocations should begin with flang -fc1, consume up to here.
+! ALL-LABEL: "{{[^"]*}}flang" "-fc1"
+
+! Check that f90 files are not treated as "previously preprocessed"
+! ... in --driver-mode=flang.
+! RUN: %clang --driver-mode=flang -### -E %s 2>&1 | FileCheck --check-prefixes=ALL,CHECK-E %s
+! CHECK-E-NOT: previously preprocessed input
+! CHECK-E-DAG: "-E"
+! CHECK-E-DAG: "-o" "-"
+
+! RUN: %clang --driver-mode=flang -### -emit-ast %s 2>&1 | FileCheck --check-prefixes=ALL,CHECK-EMIT-AST %s
+! CHECK-EMIT-AST-DAG: "-triple"
+! CHECK-EMIT-AST-DAG: "-emit-ast"
+! CHECK-EMIT-AST-DAG: "-o" "{{[^"]*}}.ast"
+
+! RUN: %clang --driver-mode=flang -### -fsyntax-only %s 2>&1 | FileCheck --check-prefixes=ALL,CHECK-SYNTAX-ONLY %s
+! CHECK-SYNTAX-ONLY-NOT: "-o"
+! CHECK-SYNTAX-ONLY-DAG: "-fsyntax-only"
+
+! RUN: %clang --driver-mode=flang -### -emit-llvm -S %s 2>&1 | FileCheck --check-prefixes=ALL,CHECK-EMIT-LLVM-IR %s
+! CHECK-EMIT-LLVM-IR-DAG: "-emit-llvm"
+! CHECK-EMIT-LLVM-IR-DAG: "-o" "{{[^"]*}}.ll"
+
+! RUN: %clang --driver-mode=flang -### -emit-llvm %s 2>&1 | FileCheck --check-prefixes=ALL,CHECK-EMIT-LLVM-BC %s
+! CHECK-EMIT-LLVM-BC-DAG: "-emit-llvm-bc"
+! CHECK-EMIT-LLVM-BC-DAG: "-o" "{{[^"]*}}.bc"
+
+! RUN: %clang --driver-mode=flang -### -S %s 2>&1 | FileCheck --check-prefixes=ALL,CHECK-S %s
+! CHECK-S-DAG: "-S"
+! CHECK-S-DAG: "-o" "{{[^"]*}}.s"
+
+! RUN: %clang --driver-mode=flang -### %s 2>&1 | FileCheck --check-prefixes=ALL,CHECK-EMIT-OBJ %s
+! CHECK-EMIT-OBJ-DAG: "-emit-obj"
+! CHECK-EMIT-OBJ-DAG: "-o" "{{[^"]*}}.o"
+
+! Should end in the input file.
+! ALL: "{{.*}}flang.f90"{{$}}
diff --git a/src/llvm-project/clang/test/Driver/flang/flang_ucase.F90 b/src/llvm-project/clang/test/Driver/flang/flang_ucase.F90
new file mode 100644
index 0000000..323afb2
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/flang/flang_ucase.F90
@@ -0,0 +1,51 @@
+! Check that flang -fc1 is invoked when in --driver-mode=flang.
+
+! This is a copy of flang.f90 because the driver has logic in it which
+! differentiates between F90 and f90 files. Flang will not treat these files
+! differently.
+
+! Test various output types:
+! * -E
+! * -fsyntax-only
+! * -emit-llvm -S
+! * -emit-llvm
+! * -S
+! * (no type specified, resulting in an object file)
+
+! All invocations should begin with flang -fc1, consume up to here.
+! ALL-LABEL: "{{[^"]*}}flang" "-fc1"
+
+! Check that f90 files are not treated as "previously preprocessed"
+! ... in --driver-mode=flang.
+! RUN: %clang --driver-mode=flang -### -E %s 2>&1 | FileCheck --check-prefixes=ALL,CHECK-E %s
+! CHECK-E-NOT: previously preprocessed input
+! CHECK-E-DAG: "-E"
+! CHECK-E-DAG: "-o" "-"
+
+! RUN: %clang --driver-mode=flang -### -emit-ast %s 2>&1 | FileCheck --check-prefixes=ALL,CHECK-EMIT-AST %s
+! CHECK-EMIT-AST-DAG: "-triple"
+! CHECK-EMIT-AST-DAG: "-emit-ast"
+! CHECK-EMIT-AST-DAG: "-o" "{{[^"]*}}.ast"
+
+! RUN: %clang --driver-mode=flang -### -fsyntax-only %s 2>&1 | FileCheck --check-prefixes=ALL,CHECK-SYNTAX-ONLY %s
+! CHECK-SYNTAX-ONLY-NOT: "-o"
+! CHECK-SYNTAX-ONLY-DAG: "-fsyntax-only"
+
+! RUN: %clang --driver-mode=flang -### -emit-llvm -S %s 2>&1 | FileCheck --check-prefixes=ALL,CHECK-EMIT-LLVM-IR %s
+! CHECK-EMIT-LLVM-IR-DAG: "-emit-llvm"
+! CHECK-EMIT-LLVM-IR-DAG: "-o" "{{[^"]*}}.ll"
+
+! RUN: %clang --driver-mode=flang -### -emit-llvm %s 2>&1 | FileCheck --check-prefixes=ALL,CHECK-EMIT-LLVM-BC %s
+! CHECK-EMIT-LLVM-BC-DAG: "-emit-llvm-bc"
+! CHECK-EMIT-LLVM-BC-DAG: "-o" "{{[^"]*}}.bc"
+
+! RUN: %clang --driver-mode=flang -### -S %s 2>&1 | FileCheck --check-prefixes=ALL,CHECK-S %s
+! CHECK-S-DAG: "-S"
+! CHECK-S-DAG: "-o" "{{[^"]*}}.s"
+
+! RUN: %clang --driver-mode=flang -### %s 2>&1 | FileCheck --check-prefixes=ALL,CHECK-EMIT-OBJ %s
+! CHECK-EMIT-OBJ-DAG: "-emit-obj"
+! CHECK-EMIT-OBJ-DAG: "-o" "{{[^"]*}}.o"
+
+! Should end in the input file.
+! ALL: "{{.*}}flang_ucase.F90"{{$}}
diff --git a/src/llvm-project/clang/test/Driver/flang/multiple-inputs-mixed.f90 b/src/llvm-project/clang/test/Driver/flang/multiple-inputs-mixed.f90
new file mode 100644
index 0000000..98d8cab
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/flang/multiple-inputs-mixed.f90
@@ -0,0 +1,7 @@
+! Check that flang can handle mixed C and fortran inputs.
+
+! RUN: %clang --driver-mode=flang -### -fsyntax-only %S/Inputs/one.f90 %S/Inputs/other.c 2>&1 | FileCheck --check-prefixes=CHECK-SYNTAX-ONLY %s
+! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}flang{{[^"/]*}}" "-fc1"
+! CHECK-SYNTAX-ONLY: "{{[^"]*}}/Inputs/one.f90"
+! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}clang{{[^"/]*}}" "-cc1"
+! CHECK-SYNTAX-ONLY: "{{[^"]*}}/Inputs/other.c"
diff --git a/src/llvm-project/clang/test/Driver/flang/multiple-inputs.f90 b/src/llvm-project/clang/test/Driver/flang/multiple-inputs.f90
new file mode 100644
index 0000000..34592a3d
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/flang/multiple-inputs.f90
@@ -0,0 +1,7 @@
+! Check that flang driver can handle multiple inputs at once.
+
+! RUN: %clang --driver-mode=flang -### -fsyntax-only %S/Inputs/one.f90 %S/Inputs/two.f90 2>&1 | FileCheck --check-prefixes=CHECK-SYNTAX-ONLY %s
+! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}flang" "-fc1"
+! CHECK-SYNTAX-ONLY: "{{[^"]*}}/Inputs/one.f90"
+! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}flang" "-fc1"
+! CHECK-SYNTAX-ONLY: "{{[^"]*}}/Inputs/two.f90"
diff --git a/src/llvm-project/clang/test/Driver/fopenmp.c b/src/llvm-project/clang/test/Driver/fopenmp.c
index 63334ba..c45dbaf 100644
--- a/src/llvm-project/clang/test/Driver/fopenmp.c
+++ b/src/llvm-project/clang/test/Driver/fopenmp.c
@@ -13,6 +13,13 @@
// RUN: %clang -target x86_64-windows-gnu -fopenmp=libomp -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP
// RUN: %clang -target x86_64-windows-gnu -fopenmp=libgomp -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-NO-OPENMP
// RUN: %clang -target x86_64-windows-gnu -fopenmp=libiomp5 -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP
+// RUN: %clang_cl --target=x86_64-windows-msvc /clang:-fopenmp=libomp /openmp -### -- %s 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP
+// RUN: %clang_cl --target=x86_64-windows-msvc /clang:-fopenmp=libgomp /openmp -### -- %s 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-NO-OPENMP
+// RUN: %clang_cl --target=x86_64-windows-msvc /clang:-fopenmp=libiomp5 /openmp -### -- %s 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP
+// RUN: %clang_cl --target=x86_64-windows-msvc /clang:-fopenmp=libomp /openmp:experimental -### -- %s 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP
+// RUN: %clang_cl --target=x86_64-windows-msvc /clang:-fopenmp=libgomp /openmp:experimental -### -- %s 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-NO-OPENMP
+// RUN: %clang_cl --target=x86_64-windows-msvc /clang:-fopenmp=libiomp5 /openmp:experimental -### -- %s 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP
+// RUN: %clang_cl --target=x86_64-windows-msvc /openmp- -### -- %s 2>&1 | FileCheck --check-prefix=CHECK-CC1-NO-OPENMP %s
//
// CHECK-CC1-OPENMP: "-cc1"
// CHECK-CC1-OPENMP: "-fopenmp"
@@ -24,6 +31,11 @@
// RUN: %clang -target x86_64-linux-gnu -fopenmp=libgomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-GOMP --check-prefix=CHECK-LD-GOMP-RT
// RUN: %clang -target x86_64-linux-gnu -fopenmp=libiomp5 %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-IOMP5
//
+// RUN: %clang -target x86_64-linux-gnu -fopenmp=libomp -static-openmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-STATIC-OMP
+// RUN: %clang -target x86_64-linux-gnu -fopenmp=libgomp -static-openmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-STATIC-GOMP --check-prefix=CHECK-LD-STATIC-GOMP-RT
+// RUN: %clang -target x86_64-linux-gnu -fopenmp=libiomp5 -static-openmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-STATIC-IOMP5
+// RUN: %clang -target x86_64-linux-gnu -fopenmp=libiomp5 -static -static-openmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-STATIC-IOMP5-NO-BDYNAMIC
+//
// RUN: %clang -nostdlib -target x86_64-linux-gnu -fopenmp=libomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-OMP
// RUN: %clang -nostdlib -target x86_64-linux-gnu -fopenmp=libgomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-GOMP
// RUN: %clang -nostdlib -target x86_64-linux-gnu -fopenmp=libiomp5 %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-IOMP5
@@ -40,6 +52,11 @@
// RUN: %clang -target x86_64-freebsd -fopenmp=libgomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-GOMP --check-prefix=CHECK-LD-GOMP-NO-RT
// RUN: %clang -target x86_64-freebsd -fopenmp=libiomp5 %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-IOMP5
//
+// RUN: %clang -target x86_64-freebsd -fopenmp=libomp -static-openmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-STATIC-OMP
+// RUN: %clang -target x86_64-freebsd -fopenmp=libgomp -static-openmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-STATIC-GOMP --check-prefix=CHECK-LD-STATIC-GOMP-NO-RT
+// RUN: %clang -target x86_64-freebsd -fopenmp=libiomp5 -static-openmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-STATIC-IOMP5
+// RUN: %clang -target x86_64-freebsd -fopenmp=libiomp5 -static -static-openmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-STATIC-IOMP5-NO-BDYNAMIC
+//
// RUN: %clang -nostdlib -target x86_64-freebsd -fopenmp=libomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-OMP
// RUN: %clang -nostdlib -target x86_64-freebsd -fopenmp=libgomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-GOMP
// RUN: %clang -nostdlib -target x86_64-freebsd -fopenmp=libiomp5 %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-IOMP5
@@ -48,6 +65,11 @@
// RUN: %clang -target x86_64-netbsd -fopenmp=libgomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-GOMP --check-prefix=CHECK-LD-GOMP-NO-RT
// RUN: %clang -target x86_64-netbsd -fopenmp=libiomp5 %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-IOMP5
//
+// RUN: %clang -target x86_64-netbsd -fopenmp=libomp -static-openmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-STATIC-OMP
+// RUN: %clang -target x86_64-netbsd -fopenmp=libgomp -static-openmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-STATIC-GOMP --check-prefix=CHECK-LD-STATIC-GOMP-NO-RT
+// RUN: %clang -target x86_64-netbsd -fopenmp=libiomp5 -static-openmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-STATIC-IOMP5
+// RUN: %clang -target x86_64-netbsd -fopenmp=libiomp5 -static -static-openmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-STATIC-IOMP5-NO-BDYNAMIC
+//
// RUN: %clang -nostdlib -target x86_64-netbsd -fopenmp=libomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-OMP
// RUN: %clang -nostdlib -target x86_64-netbsd -fopenmp=libgomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-GOMP
// RUN: %clang -nostdlib -target x86_64-netbsd -fopenmp=libiomp5 %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-IOMP5
@@ -86,6 +108,28 @@
// CHECK-NO-IOMP5MD: "{{.*}}ld{{(.exe)?}}"
// CHECK-NO-IOMP5MD-NOT: "-liomp5md"
//
+// CHECK-LD-STATIC-OMP: "{{.*}}ld{{(.exe)?}}"
+// CHECK-LD-STATIC-OMP: "-Bstatic" "-lomp" "-Bdynamic"
+//
+// CHECK-LD-STATIC-GOMP: "{{.*}}ld{{(.exe)?}}"
+// CHECK-LD-STATIC-GOMP: "-Bstatic" "-lgomp" "-Bdynamic"
+// CHECK-LD-STATIC-GOMP-RT: "-lrt"
+// CHECK-LD-STATIC-NO-GOMP-RT-NOT: "-lrt"
+//
+// CHECK-LD-STATIC-IOMP5: "{{.*}}ld{{(.exe)?}}"
+// CHECK-LD-STATIC-IOMP5: "-Bstatic" "-liomp5" "-Bdynamic"
+//
+// CHECK-LD-STATIC-IOMP5-NO-BDYNAMIC: "{{.*}}ld{{(.exe)?}}"
+// For x86 Gnu, the driver passes -static, while NetBSD and FreeBSD pass -Bstatic
+// CHECK-LD-STATIC-IOMP5-NO-BDYNAMIC: "-{{B?}}static" {{.*}} "-liomp5"
+// CHECK-LD-STATIC-IOMP5-NO-BDYNAMIC-NOT: "-Bdynamic"
+//
+// RUN: %clang -target x86_64-linux-gnu -fopenmp -fopenmp-enable-irbuilder -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMPIRBUILDER
+//
+// CHECK-CC1-OPENMPIRBUILDER: "-cc1"
+// CHECK-CC1-OPENMPIRBUILDER-SAME: "-fopenmp"
+// CHECK-CC1-OPENMPIRBUILDER-SAME: "-fopenmp-enable-irbuilder"
+//
// We'd like to check that the default is sane, but until we have the ability
// to *always* semantically analyze OpenMP without always generating runtime
// calls (in the event of an unsupported runtime), we don't have a good way to
diff --git a/src/llvm-project/clang/test/Driver/fortran.f95 b/src/llvm-project/clang/test/Driver/fortran.f95
index 47c6e7b..03ff99f 100644
--- a/src/llvm-project/clang/test/Driver/fortran.f95
+++ b/src/llvm-project/clang/test/Driver/fortran.f95
@@ -1,21 +1,22 @@
-// Check that the clang driver can invoke gcc to compile Fortran.
+! Check that the clang driver can invoke gcc to compile Fortran when in
+! --driver-mode=clang. This is legacy behaviour - see also --driver-mode=flang.
-// RUN: %clang -target x86_64-unknown-linux-gnu -integrated-as -c %s -### 2>&1 \
-// RUN: | FileCheck --check-prefix=CHECK-OBJECT %s
-// CHECK-OBJECT: gcc
-// CHECK-OBJECT: "-c"
-// CHECK-OBJECT: "-x" "f95"
-// CHECK-OBJECT-NOT: cc1as
+! RUN: %clang -target x86_64-unknown-linux-gnu -integrated-as -c %s -### 2>&1 \
+! RUN: | FileCheck --check-prefix=CHECK-OBJECT %s
+! CHECK-OBJECT: gcc
+! CHECK-OBJECT: "-c"
+! CHECK-OBJECT: "-x" "f95"
+! CHECK-OBJECT-NOT: cc1as
-// RUN: %clang -target x86_64-unknown-linux-gnu -integrated-as -S %s -### 2>&1 \
-// RUN: | FileCheck --check-prefix=CHECK-ASM %s
-// CHECK-ASM: gcc
-// CHECK-ASM: "-S"
-// CHECK-ASM: "-x" "f95"
-// CHECK-ASM-NOT: cc1
+! RUN: %clang -target x86_64-unknown-linux-gnu -integrated-as -S %s -### 2>&1 \
+! RUN: | FileCheck --check-prefix=CHECK-ASM %s
+! CHECK-ASM: gcc
+! CHECK-ASM: "-S"
+! CHECK-ASM: "-x" "f95"
+! CHECK-ASM-NOT: cc1
-// RUN: %clang -Wall -target x86_64-unknown-linux-gnu -integrated-as %s -o %t -### 2>&1 | FileCheck --check-prefix=CHECK-WARN %s
-// CHECK-WARN: gcc
-// CHECK-WARN-NOT: "-Wall"
-// CHECK-WARN: ld
-// CHECK-WARN-NOT: "-Wall"
+! RUN: %clang -Wall -target x86_64-unknown-linux-gnu -integrated-as %s -o %t -### 2>&1 | FileCheck --check-prefix=CHECK-WARN %s
+! CHECK-WARN: gcc
+! CHECK-WARN-NOT: "-Wall"
+! CHECK-WARN: ld
+! CHECK-WARN-NOT: "-Wall"
diff --git a/src/llvm-project/clang/test/Driver/fp-model.c b/src/llvm-project/clang/test/Driver/fp-model.c
new file mode 100644
index 0000000..a3984ac
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/fp-model.c
@@ -0,0 +1,137 @@
+// Test that incompatible combinations of -ffp-model= options
+// and other floating point options get a warning diagnostic.
+//
+// REQUIRES: clang-driver
+
+// RUN: %clang -### -ffp-model=fast -ffp-contract=off -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=WARN %s
+// WARN: warning: overriding '-ffp-model=fast' option with '-ffp-contract=off' [-Woverriding-t-option]
+
+// RUN: %clang -### -ffp-model=fast -ffp-contract=on -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=WARN1 %s
+// WARN1: warning: overriding '-ffp-model=fast' option with '-ffp-contract=on' [-Woverriding-t-option]
+
+// RUN: %clang -### -ffp-model=strict -fassociative-math -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=WARN2 %s
+// WARN2: warning: overriding '-ffp-model=strict' option with '-fassociative-math' [-Woverriding-t-option]
+
+// RUN: %clang -### -ffp-model=strict -ffast-math -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=WARN3 %s
+// WARN3: warning: overriding '-ffp-model=strict' option with '-ffast-math' [-Woverriding-t-option]
+
+// RUN: %clang -### -ffp-model=strict -ffinite-math-only -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=WARN4 %s
+// WARN4: warning: overriding '-ffp-model=strict' option with '-ffinite-math-only' [-Woverriding-t-option]
+
+// RUN: %clang -### -ffp-model=strict -ffp-contract=fast -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=WARN5 %s
+// WARN5: warning: overriding '-ffp-model=strict' option with '-ffp-contract=fast' [-Woverriding-t-option]
+
+// RUN: %clang -### -ffp-model=strict -ffp-contract=off -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=WARN6 %s
+// WARN6: warning: overriding '-ffp-model=strict' option with '-ffp-contract=off' [-Woverriding-t-option]
+
+// RUN: %clang -### -ffp-model=strict -ffp-contract=on -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=WARN7 %s
+// WARN7: warning: overriding '-ffp-model=strict' option with '-ffp-contract=on' [-Woverriding-t-option]
+
+// RUN: %clang -### -ffp-model=strict -fno-honor-infinities -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=WARN8 %s
+// WARN8: warning: overriding '-ffp-model=strict' option with '-fno-honor-infinities' [-Woverriding-t-option]
+
+// RUN: %clang -### -ffp-model=strict -fno-honor-nans -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=WARN9 %s
+// WARN9: warning: overriding '-ffp-model=strict' option with '-fno-honor-nans' [-Woverriding-t-option]
+
+// RUN: %clang -### -ffp-model=strict -fno-rounding-math -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=WARNa %s
+// WARNa: warning: overriding '-ffp-model=strict' option with '-fno-rounding-math' [-Woverriding-t-option]
+
+// RUN: %clang -### -ffp-model=strict -fno-signed-zeros -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=WARNb %s
+// WARNb: warning: overriding '-ffp-model=strict' option with '-fno-signed-zeros' [-Woverriding-t-option]
+
+// RUN: %clang -### -ffp-model=strict -fno-trapping-math -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=WARNc %s
+// WARNc: warning: overriding '-ffp-model=strict' option with '-fno-trapping-math' [-Woverriding-t-option]
+
+// RUN: %clang -### -ffp-model=strict -freciprocal-math -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=WARNd %s
+// WARNd: warning: overriding '-ffp-model=strict' option with '-freciprocal-math' [-Woverriding-t-option]
+
+// RUN: %clang -### -ffp-model=strict -funsafe-math-optimizations -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=WARNe %s
+// WARNe: warning: overriding '-ffp-model=strict' option with '-funsafe-math-optimizations' [-Woverriding-t-option]
+
+// RUN: %clang -### -ffp-model=strict -Ofast -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=WARNf %s
+// WARNf: warning: overriding '-ffp-model=strict' option with '-Ofast' [-Woverriding-t-option]
+
+// RUN: %clang -### -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-NOROUND %s
+// CHECK-NOROUND: "-cc1"
+// CHECK-NOROUND: "-fno-rounding-math"
+
+// RUN: %clang -### -frounding-math -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-ROUND --implicit-check-not ffp-exception-behavior=strict %s
+// CHECK-ROUND: "-cc1"
+// CHECK-ROUND: "-frounding-math"
+
+// RUN: %clang -### -ftrapping-math -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-TRAP %s
+// CHECK-TRAP: "-cc1"
+// CHECK-TRAP: "-ftrapping-math"
+// CHECK-TRAP: "-ffp-exception-behavior=strict"
+
+// RUN: %clang -### -nostdinc -ffp-model=fast -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-FPM-FAST %s
+// CHECK-FPM-FAST: "-cc1"
+// CHECK-FPM-FAST: "-menable-no-infs"
+// CHECK-FPM-FAST: "-menable-no-nans"
+// CHECK-FPM-FAST: "-menable-unsafe-fp-math"
+// CHECK-FPM-FAST: "-fno-signed-zeros"
+// CHECK-FPM-FAST: "-mreassociate"
+// CHECK-FPM-FAST: "-freciprocal-math"
+// CHECK-FPM-FAST: "-ffp-contract=fast"
+// CHECK-FPM-FAST: "-fno-rounding-math"
+// CHECK-FPM-FAST: "-ffast-math"
+// CHECK-FPM-FAST: "-ffinite-math-only"
+
+// RUN: %clang -### -nostdinc -ffp-model=precise -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-FPM-PRECISE %s
+// CHECK-FPM-PRECISE: "-cc1"
+// CHECK-FPM-PRECISE: "-ffp-contract=fast"
+// CHECK-FPM-PRECISE: "-fno-rounding-math"
+
+// RUN: %clang -### -nostdinc -ffp-model=strict -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-FPM-STRICT %s
+// CHECK-FPM-STRICT: "-cc1"
+// CHECK-FPM-STRICT: "-ftrapping-math"
+// CHECK-FPM-STRICT: "-frounding-math"
+// CHECK-FPM-STRICT: "-ffp-exception-behavior=strict"
+
+// RUN: %clang -### -nostdinc -ftrapping-math -ffp-exception-behavior=ignore -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-TRAP-IGNORE %s
+// CHECK-TRAP-IGNORE: "-cc1"
+// CHECK-TRAP-IGNORE: "-fno-rounding-math"
+// CHECK-TRAP-IGNORE: "-ffp-exception-behavior=ignore"
+
+
+// RUN: %clang -### -nostdinc -ffp-exception-behavior=strict -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-FEB-STRICT %s
+// CHECK-FEB-STRICT: "-cc1"
+// CHECK-FEB-STRICT: "-fno-rounding-math"
+// CHECK-FEB-STRICT: "-ffp-exception-behavior=strict"
+
+// RUN: %clang -### -nostdinc -ffp-exception-behavior=maytrap -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-FEB-MAYTRAP %s
+// CHECK-FEB-MAYTRAP: "-cc1"
+// CHECK-FEB-MAYTRAP: "-fno-rounding-math"
+// CHECK-FEB-MAYTRAP: "-ffp-exception-behavior=maytrap"
+
+// RUN: %clang -### -nostdinc -ffp-exception-behavior=ignore -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-FEB-IGNORE %s
+// CHECK-FEB-IGNORE: "-cc1"
+// CHECK-FEB-IGNORE: "-fno-rounding-math"
+// CHECK-FEB-IGNORE: "-ffp-exception-behavior=ignore"
+
diff --git a/src/llvm-project/clang/test/Driver/fpatchable-function-entry.c b/src/llvm-project/clang/test/Driver/fpatchable-function-entry.c
new file mode 100644
index 0000000..5ac262c
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/fpatchable-function-entry.c
@@ -0,0 +1,19 @@
+// RUN: %clang -target i386 %s -fpatchable-function-entry=1 -c -### 2>&1 | FileCheck %s
+// RUN: %clang -target x86_64 %s -fpatchable-function-entry=1 -c -### 2>&1 | FileCheck %s
+// RUN: %clang -target aarch64 %s -fpatchable-function-entry=1 -c -### 2>&1 | FileCheck %s
+// RUN: %clang -target aarch64 %s -fpatchable-function-entry=1,0 -c -### 2>&1 | FileCheck %s
+// CHECK: "-fpatchable-function-entry=1"
+
+// RUN: %clang -target aarch64 -fsyntax-only %s -fpatchable-function-entry=1,1 -c -### 2>&1 | FileCheck --check-prefix=11 %s
+// 11: "-fpatchable-function-entry=1" "-fpatchable-function-entry-offset=1"
+// RUN: %clang -target aarch64 -fsyntax-only %s -fpatchable-function-entry=2,1 -c -### 2>&1 | FileCheck --check-prefix=21 %s
+// 21: "-fpatchable-function-entry=2" "-fpatchable-function-entry-offset=1"
+
+// RUN: not %clang -target ppc64 -fsyntax-only %s -fpatchable-function-entry=1 2>&1 | FileCheck --check-prefix=TARGET %s
+// TARGET: error: unsupported option '-fpatchable-function-entry=1' for target 'ppc64'
+
+// RUN: not %clang -target x86_64 -fsyntax-only %s -fpatchable-function-entry=1,0, 2>&1 | FileCheck --check-prefix=EXCESS %s
+// EXCESS: error: invalid argument '1,0,' to -fpatchable-function-entry=
+
+// RUN: not %clang -target aarch64-linux -fsyntax-only %s -fxray-instrument -fpatchable-function-entry=1 2>&1 | FileCheck --check-prefix=XRAY %s
+// XRAY: error: invalid argument '-fxray-instrument' not allowed with '-fpatchable-function-entry='
diff --git a/src/llvm-project/clang/test/Driver/frame-pointer-elim.c b/src/llvm-project/clang/test/Driver/frame-pointer-elim.c
index 300953f..47c1c05 100644
--- a/src/llvm-project/clang/test/Driver/frame-pointer-elim.c
+++ b/src/llvm-project/clang/test/Driver/frame-pointer-elim.c
@@ -1,79 +1,107 @@
-// For these next two tests when optimized we should omit the leaf frame
-// pointer, for unoptimized we should have a leaf frame pointer.
-// RUN: %clang -### -target i386-pc-linux-gnu -S -O1 %s 2>&1 | \
-// RUN: FileCheck --check-prefix=LINUX-OPT %s
-// LINUX-OPT: "-momit-leaf-frame-pointer"
+// KEEP-ALL-NOT: warning:
+// KEEP-ALL: "-mframe-pointer=all"
+// KEEP-NON-LEAF-NOT: warning:
+// KEEP-NON-LEAF: "-mframe-pointer=non-leaf"
+// KEEP-NONE-NOT: warning:
+// KEEP-NONE: "-mframe-pointer=none"
-// RUN: %clang -### -target i386-pc-linux-gnu -S %s 2>&1 | \
-// RUN: FileCheck --check-prefix=LINUX %s
-// LINUX-NOT: "-momit-leaf-frame-pointer"
+// On Linux x86, omit frame pointer when optimization is enabled.
+// RUN: %clang -### -target i386-linux -S -fomit-frame-pointer %s 2>&1 | \
+// RUN: FileCheck --check-prefix=KEEP-NONE %s
+// RUN: %clang -### -target i386-linux -S -O1 %s 2>&1 | \
+// RUN: FileCheck --check-prefix=KEEP-NONE %s
+
+// -fno-omit-frame-pointer or -pg disables frame pointer omission.
+// RUN: %clang -### -target i386-linux -S %s 2>&1 | \
+// RUN: FileCheck --check-prefix=KEEP-ALL %s
+// RUN: %clang -### -target i386-linux -S -O1 -fno-omit-frame-pointer %s 2>&1 | \
+// RUN: FileCheck --check-prefix=KEEP-ALL %s
+// RUN: %clang -### -target i386-linux -S -O1 -pg %s 2>&1 | \
+// RUN: FileCheck --check-prefix=KEEP-ALL %s
+
+// -momit-leaf-frame-pointer omits leaf frame pointer.
+// -fno-omit-frame-pointer loses out to -momit-leaf-frame-pointer.
+// RUN: %clang -### -target i386 -S -momit-leaf-frame-pointer %s 2>&1 | \
+// RUN: FileCheck --check-prefix=KEEP-NON-LEAF %s
+// RUN: %clang -### -target i386-linux -S -O1 -fno-omit-frame-pointer -momit-leaf-frame-pointer %s 2>&1 | \
+// RUN: FileCheck --check-prefix=KEEP-NON-LEAF %s
+// RUN: %clang -### -target i386-linux -S -O1 -momit-leaf-frame-pointer %s 2>&1 | \
+// RUN: FileCheck --check-prefix=KEEP-NONE %s
+
+// fno-omit-frame-pointer -momit-leaf-frame-pointer can be overwritten by
+// fomit-frame-pointer later on the command without warning
+// RUN: %clang -### -target i386-linux -S -O1 -fno-omit-frame-pointer -momit-leaf-frame-pointer -fomit-frame-pointer %s 2>&1 | \
+// RUN: FileCheck --check-prefix=KEEP-NONE %s
+
+// RUN: %clang -### -target i386-linux -S -O1 -fno-omit-frame-pointer -momit-leaf-frame-pointer %s 2>&1 | \
+// RUN: FileCheck --check-prefix=KEEP-NON-LEAF %s
+// Explicit or default -fomit-frame-pointer wins over -mno-omit-leaf-frame-pointer.
+// RUN: %clang -### -target i386 -S %s -fomit-frame-pointer -mno-omit-leaf-frame-pointer 2>&1 | \
+// RUN: FileCheck --check-prefix=KEEP-NONE %s
+// RUN: %clang -### -target i386-linux -S %s -O1 -mno-omit-leaf-frame-pointer 2>&1 | \
+// RUN: FileCheck --check-prefix=KEEP-NONE %s
+
+// -pg -fomit-frame-pointer => error.
+// RUN: %clang -### -S -fomit-frame-pointer -pg %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-OMIT-FP-PG %s
+// RUN: %clang -### -S -fomit-frame-pointer -fno-omit-frame-pointer -pg %s 2>&1 | FileCheck -check-prefix=CHECK-MIX-NO-OMIT-FP-PG %s
+// CHECK-NO-MIX-OMIT-FP-PG: '-fomit-frame-pointer' not allowed with '-pg'
+// CHECK-MIX-NO-OMIT-FP-PG-NOT: '-fomit-frame-pointer' not allowed with '-pg'
// CloudABI follows the same rules as Linux.
// RUN: %clang -### -target x86_64-unknown-cloudabi -S -O1 %s 2>&1 | \
-// RUN: FileCheck --check-prefix=CLOUDABI-OPT %s
-// CLOUDABI-OPT: "-momit-leaf-frame-pointer"
+// RUN: FileCheck --check-prefix=KEEP-NONE %s
// RUN: %clang -### -target x86_64-unknown-cloudabi -S %s 2>&1 | \
-// RUN: FileCheck --check-prefix=CLOUDABI %s
-// CLOUDABI-NOT: "-momit-leaf-frame-pointer"
+// RUN: FileCheck --check-prefix=KEEP-ALL %s
// NetBSD follows the same rules as Linux.
// RUN: %clang -### -target x86_64-unknown-netbsd -S -O1 %s 2>&1 | \
-// RUN: FileCheck --check-prefix=NETBSD-OPT %s
-// NETBSD-OPT: "-momit-leaf-frame-pointer"
+// RUN: FileCheck --check-prefix=KEEP-NONE %s
// RUN: %clang -### -target x86_64-unknown-netbsd -S %s 2>&1 | \
-// RUN: FileCheck --check-prefix=NETBSD %s
-// NETBSD-NOT: "-momit-leaf-frame-pointer"
+// RUN: FileCheck --check-prefix=KEEP-ALL %s
// Darwin disables omitting the leaf frame pointer even under optimization
// unless the command lines are given.
// RUN: %clang -### -target i386-apple-darwin -S %s 2>&1 | \
-// RUN: FileCheck --check-prefix=DARWIN %s
-// DARWIN: "-mdisable-fp-elim"
+// RUN: FileCheck --check-prefix=KEEP-ALL %s
// RUN: %clang -### -target i386-apple-darwin -S -O1 %s 2>&1 | \
-// RUN: FileCheck --check-prefix=DARWIN-OPT %s
-// DARWIN-OPT-NOT: "-momit-leaf-frame-pointer"
+// RUN: FileCheck --check-prefix=KEEP-ALL %s
// RUN: %clang -### -target i386-darwin -S -fomit-frame-pointer %s 2>&1 | \
-// RUN: FileCheck --check-prefix=OMIT_ALL %s
-// OMIT_ALL-NOT: "-mdisable-fp-elim"
+// RUN: FileCheck --check-prefix=KEEP-NONE %s
// RUN: %clang -### -target i386-darwin -S -momit-leaf-frame-pointer %s 2>&1 | \
-// RUN: FileCheck --check-prefix=OMIT_LEAF %s
-// OMIT_LEAF: "-momit-leaf-frame-pointer"
+// RUN: FileCheck --check-prefix=KEEP-NON-LEAF %s
// RUN: %clang -### -target armv7s-apple-ios -fomit-frame-pointer %s 2>&1 | \
// RUN: FileCheck --check-prefix=WARN-OMIT-7S %s
// WARN-OMIT-7S: warning: optimization flag '-fomit-frame-pointer' is not supported for target 'armv7s'
-// WARN-OMIT-7S: "-mdisable-fp-elim"
-// WARN-OMIT-7S-NOT: "-momit-leaf-frame-pointer"
+// WARN-OMIT-7S: "-mframe-pointer=all"
// RUN: %clang -### -target armv7k-apple-watchos -fomit-frame-pointer %s 2>&1 | \
// RUN: FileCheck --check-prefix=WARN-OMIT-7K %s
// WARN-OMIT-7K: warning: optimization flag '-fomit-frame-pointer' is not supported for target 'armv7k'
-// WARN-OMIT-7K: "-mdisable-fp-elim"
-// WARN-OMIT-7K-NOT: "-momit-leaf-frame-pointer"
+// WARN-OMIT-7K: "-mframe-pointer=all"
// RUN: %clang -### -target armv7s-apple-ios8.0 -momit-leaf-frame-pointer %s 2>&1 | \
// RUN: FileCheck --check-prefix=WARN-OMIT-LEAF-7S %s
// WARN-OMIT-LEAF-7S-NOT: warning: optimization flag '-momit-leaf-frame-pointer' is not supported for target 'armv7s'
-// WARN-OMIT-LEAF-7S: "-mdisable-fp-elim"
-// WARN-OMIT-LEAF-7S: "-momit-leaf-frame-pointer"
+// WARN-OMIT-LEAF-7S: "-mframe-pointer=non-leaf"
-// On the PS4, we default to omitting the frame pointer on leaf functions
-// (OMIT_LEAF check line is above)
+// On AArch64 and PS4, default to omitting the frame pointer on leaf functions
+// RUN: %clang -### -target aarch64 -S %s 2>&1 | \
+// RUN: FileCheck --check-prefix=KEEP-NON-LEAF %s
// RUN: %clang -### -target x86_64-scei-ps4 -S %s 2>&1 | \
-// RUN: FileCheck --check-prefix=OMIT_LEAF %s
+// RUN: FileCheck --check-prefix=KEEP-NON-LEAF %s
// RUN: %clang -### -target x86_64-scei-ps4 -S -O2 %s 2>&1 | \
-// RUN: FileCheck --check-prefix=OMIT_LEAF %s
+// RUN: FileCheck --check-prefix=KEEP-NON-LEAF %s
// RUN: %clang -### -target powerpc64 -S %s 2>&1 | \
-// RUN: FileCheck --check-prefix=KEEP_ALL %s
-// KEEP_ALL: "-mdisable-fp-elim"
+// RUN: FileCheck --check-prefix=KEEP-ALL %s
// RUN: %clang -### -target powerpc64 -S -O1 %s 2>&1 | \
-// RUN: FileCheck --check-prefix=OMIT_ALL %s
+// RUN: FileCheck --check-prefix=KEEP-NONE %s
void f0() {}
void f1() { f0(); }
diff --git a/src/llvm-project/clang/test/Driver/frame-pointer-elim.cl b/src/llvm-project/clang/test/Driver/frame-pointer-elim.cl
new file mode 100644
index 0000000..c469d10
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/frame-pointer-elim.cl
@@ -0,0 +1,8 @@
+// RUN: %clang -target amdgcn-amd-amdhsa -### -S -O3 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECKNONE %s
+// RUN: %clang -target amdgcn-amd-amdhsa -### -S -O3 -fno-omit-frame-pointer %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECKALL %s
+// RUN: %clang -target amdgcn-amd-amdhsa -### -S %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECKALL %s
+// RUN: %clang -target amdgcn-amd-amdhsa -### -S -O0 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECKALL %s
+// RUN: %clang -target amdgcn-amd-amdhsa -### -S -cl-opt-disable %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECKALL %s
+
+// CHECKNONE: -mframe-pointer=none
+// CHECKALL: -mframe-pointer=all
diff --git a/src/llvm-project/clang/test/Driver/frame-pointer.c b/src/llvm-project/clang/test/Driver/frame-pointer.c
index 85c9f3a..7d780f0 100644
--- a/src/llvm-project/clang/test/Driver/frame-pointer.c
+++ b/src/llvm-project/clang/test/Driver/frame-pointer.c
@@ -57,15 +57,15 @@
// RUN: %clang -target riscv64-unknown-linux-gnu -### -S -O3 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK3-64 %s
// RUN: %clang -target riscv64-unknown-linux-gnu -### -S -Os %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECKs-64 %s
-// CHECK0-32: -mdisable-fp-elim
-// CHECK1-32-NOT: -mdisable-fp-elim
-// CHECK2-32-NOT: -mdisable-fp-elim
-// CHECK3-32-NOT: -mdisable-fp-elim
-// CHECKs-32-NOT: -mdisable-fp-elim
+// CHECK0-32: -mframe-pointer=all
+// CHECK1-32-NOT: -mframe-pointer=all
+// CHECK2-32-NOT: -mframe-pointer=all
+// CHECK3-32-NOT: -mframe-pointer=all
+// CHECKs-32-NOT: -mframe-pointer=all
-// CHECK0-64: -mdisable-fp-elim
-// CHECK1-64-NOT: -mdisable-fp-elim
-// CHECK2-64-NOT: -mdisable-fp-elim
-// CHECK3-64-NOT: -mdisable-fp-elim
-// CHECKs-64-NOT: -mdisable-fp-elim
-// CHECK-MACHO-64: -mdisable-fp-elim
+// CHECK0-64: -mframe-pointer=all
+// CHECK1-64-NOT: -mframe-pointer=all
+// CHECK2-64-NOT: -mframe-pointer=all
+// CHECK3-64-NOT: -mframe-pointer=all
+// CHECKs-64-NOT: -mframe-pointer=all
+// CHECK-MACHO-64: -mframe-pointer=all
diff --git a/src/llvm-project/clang/test/Driver/freebsd.c b/src/llvm-project/clang/test/Driver/freebsd.c
index c772101..dc20970 100644
--- a/src/llvm-project/clang/test/Driver/freebsd.c
+++ b/src/llvm-project/clang/test/Driver/freebsd.c
@@ -63,6 +63,15 @@
// RUN: | FileCheck --check-prefix=CHECK-MIPSN32EL-LD %s
// CHECK-MIPSN32EL-LD: ld{{.*}}" {{.*}} "-m" "elf32ltsmipn32_fbsd"
//
+// Check that RISC-V passes the correct linker emulation.
+//
+// RUN: %clang -target riscv32-freebsd %s -### %s 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-RV32I-LD %s
+// CHECK-RV32I-LD: ld{{.*}}" {{.*}} "-m" "elf32lriscv"
+// RUN: %clang -target riscv64-freebsd %s -### %s 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-RV64I-LD %s
+// CHECK-RV64I-LD: ld{{.*}}" {{.*}} "-m" "elf64lriscv"
+//
// Check that the new linker flags are passed to FreeBSD
// RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd8 -m32 %s \
// RUN: --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \
@@ -188,3 +197,7 @@
// RUN: %clang -target sparc64-unknown-freebsd -### -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK-IAS %s
// CHECK-IAS-NOT: "-no-integrated-as"
+
+// RUN: %clang -target ppc64-unknown-freebsd13.0 -### -S %s 2>&1 | \
+// RUN: FileCheck -check-prefix=PPC64-MUNWIND %s
+// PPC64-MUNWIND: -munwind-table
diff --git a/src/llvm-project/clang/test/Driver/fsanitize-blacklist.c b/src/llvm-project/clang/test/Driver/fsanitize-blacklist.c
index e08905c..2d3ef3f 100644
--- a/src/llvm-project/clang/test/Driver/fsanitize-blacklist.c
+++ b/src/llvm-project/clang/test/Driver/fsanitize-blacklist.c
@@ -6,7 +6,7 @@
// Make sure we don't match the -NOT lines with the linker invocation.
// Delimiters match the start of the cc1 and the start of the linker lines
// for fragile tests.
-// DELIMITERS: {{^ *"}}
+// DELIMITERS: {{^ (\(in-process\)|")}}
// RUN: echo "fun:foo" > %t.good
// RUN: echo "fun:bar" > %t.second
@@ -16,22 +16,18 @@
// RUN: %clang -target aarch64-linux-gnu -fsanitize=hwaddress -fsanitize-blacklist=%t.good -fsanitize-blacklist=%t.second %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-BLACKLIST
// CHECK-BLACKLIST: -fsanitize-blacklist={{.*}}.good" "-fsanitize-blacklist={{.*}}.second
-// Now, check for -fdepfile-entry flags.
-// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-blacklist=%t.good -fsanitize-blacklist=%t.second %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-BLACKLIST2
-// CHECK-BLACKLIST2: -fdepfile-entry={{.*}}.good" "-fdepfile-entry={{.*}}.second
-
// Check that the default blacklist is not added as an extra dependency.
// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -resource-dir=%S/Inputs/resource_dir %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-DEFAULT-BLACKLIST-ASAN --implicit-check-not=fdepfile-entry --implicit-check-not=-fsanitize-blacklist=
-// CHECK-DEFAULT-BLACKLIST-ASAN: -fsanitize-blacklist={{.*[^w]}}asan_blacklist.txt
+// CHECK-DEFAULT-BLACKLIST-ASAN: -fsanitize-system-blacklist={{.*[^w]}}asan_blacklist.txt
// RUN: %clang -target x86_64-linux-gnu -fsanitize=hwaddress -resource-dir=%S/Inputs/resource_dir %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-DEFAULT-BLACKLIST-HWASAN --implicit-check-not=fdepfile-entry --implicit-check-not=-fsanitize-blacklist=
-// CHECK-DEFAULT-BLACKLIST-HWASAN: -fsanitize-blacklist={{.*}}hwasan_blacklist.txt
+// CHECK-DEFAULT-BLACKLIST-HWASAN: -fsanitize-system-blacklist={{.*}}hwasan_blacklist.txt
// RUN: %clang -target x86_64-linux-gnu -fsanitize=integer -resource-dir=%S/Inputs/resource_dir %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-DEFAULT-UBSAN-BLACKLIST --implicit-check-not=fdepfile-entry --implicit-check-not=-fsanitize-blacklist=
// RUN: %clang -target x86_64-linux-gnu -fsanitize=nullability -resource-dir=%S/Inputs/resource_dir %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-DEFAULT-UBSAN-BLACKLIST --implicit-check-not=fdepfile-entry --implicit-check-not=-fsanitize-blacklist=
// RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined -resource-dir=%S/Inputs/resource_dir %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-DEFAULT-UBSAN-BLACKLIST --implicit-check-not=fdepfile-entry --implicit-check-not=-fsanitize-blacklist=
// RUN: %clang -target x86_64-linux-gnu -fsanitize=alignment -resource-dir=%S/Inputs/resource_dir %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-DEFAULT-UBSAN-BLACKLIST --implicit-check-not=fdepfile-entry --implicit-check-not=-fsanitize-blacklist=
// RUN: %clang -target %itanium_abi_triple -fsanitize=float-divide-by-zero -resource-dir=%S/Inputs/resource_dir %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-DEFAULT-UBSAN-BLACKLIST --implicit-check-not=fdepfile-entry --implicit-check-not=-fsanitize-blacklist=
-// CHECK-DEFAULT-UBSAN-BLACKLIST: -fsanitize-blacklist={{.*}}ubsan_blacklist.txt
+// CHECK-DEFAULT-UBSAN-BLACKLIST: -fsanitize-system-blacklist={{.*}}ubsan_blacklist.txt
// Check that combining ubsan and another sanitizer results in both blacklists being used.
// RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined,address -resource-dir=%S/Inputs/resource_dir %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-DEFAULT-UBSAN-BLACKLIST --check-prefix=CHECK-DEFAULT-ASAN-BLACKLIST --implicit-check-not=fdepfile-entry --implicit-check-not=-fsanitize-blacklist=
diff --git a/src/llvm-project/clang/test/Driver/fsanitize-coverage.c b/src/llvm-project/clang/test/Driver/fsanitize-coverage.c
index 20589e4..db66989 100644
--- a/src/llvm-project/clang/test/Driver/fsanitize-coverage.c
+++ b/src/llvm-project/clang/test/Driver/fsanitize-coverage.c
@@ -118,8 +118,8 @@
// CLANG-CL-COVERAGE: -fsanitize=address
// RUN: %clang -target x86_64-linux-gnu -fsanitize=safe-stack -fsanitize-coverage=trace-pc-guard %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-VS-SAFESTACK
+// CHECK-VS-SAFESTACK: -fsanitize-coverage-trace-pc-guard
// CHECK-VS-SAFESTACK: -fsanitize=safe-stack
-// CHECK-VS-SAFESTACK-NOT: -fsanitize-coverage-trace-pc-guard
// RUN: %clang -target x86_64-linux-gnu -fsanitize=safe-stack -fsanitize-coverage=trace-pc-guard -fno-sanitize=safe-stack %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-SAFESTACK
// CHECK-NO-SAFESTACK-NOT: error:
@@ -128,3 +128,15 @@
// CHECK-NO-SAFESTACK-NOT: unknown argument
// CHECK-NO-SAFESTACK-NOT: -fsanitize=safe-stack
// CHECK-NO-SAFESTACK: -fsanitize-coverage-trace-pc-guard
+
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=shadow-call-stack -fsanitize-coverage=trace-pc-guard %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-VS-SHADOWCALLSTACK
+// CHECK-VS-SHADOWCALLSTACK: -fsanitize-coverage-trace-pc-guard
+// CHECK-VS-SHADOWCALLSTACK: -fsanitize=shadow-call-stack
+
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=shadow-call-stack -fsanitize-coverage=trace-pc-guard -fno-sanitize=shadow-call-stack %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-SAFESTACK
+// CHECK-NO-SHADOWCALLSTACK-NOT: error:
+// CHECK-NO-SHADOWCALLSTACK-NOT: warning:
+// CHECK-NO-SHADOWCALLSTACK-NOT: argument unused
+// CHECK-NO-SHADOWCALLSTACK-NOT: unknown argument
+// CHECK-NO-SHADOWCALLSTACK-NOT: -fsanitize=shadow-call-stack
+// CHECK-NO-SHADOWCALLSTACK: -fsanitize-coverage-trace-pc-guard
diff --git a/src/llvm-project/clang/test/Driver/fsanitize.c b/src/llvm-project/clang/test/Driver/fsanitize.c
index 2896eda..f02f94d 100644
--- a/src/llvm-project/clang/test/Driver/fsanitize.c
+++ b/src/llvm-project/clang/test/Driver/fsanitize.c
@@ -191,6 +191,16 @@
// RUN: %clang -target x86_64-linux-android -fsanitize=memtag -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANMT-BAD-ARCH
// CHECK-SANMT-BAD-ARCH: unsupported option '-fsanitize=memtag' for target
+// RUN: %clang -target aarch64-linux -fsanitize=memtag -march=armv8-a+memtag %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANMT-MT
+// CHECK-SANMT-MT: "-target-feature" "+mte"
+// CHECK-SANMT-MT-SAME: "-fsanitize=memtag"
+
+// RUN: %clang -target aarch64-linux -fsanitize=memtag %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANMT-NOMT-0
+// CHECK-SANMT-NOMT-0: '-fsanitize=memtag' requires hardware support (+memtag)
+
+// RUN: %clang -target aarch64-linux -fsanitize=memtag -I +mte %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANMT-NOMT-1
+// CHECK-SANMT-NOMT-1: '-fsanitize=memtag' requires hardware support (+memtag)
+
// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-address-use-after-scope %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-USE-AFTER-SCOPE
// RUN: %clang_cl --target=x86_64-windows -fsanitize=address -fsanitize-address-use-after-scope -### -- %s 2>&1 | FileCheck %s --check-prefix=CHECK-USE-AFTER-SCOPE
// CHECK-USE-AFTER-SCOPE: -cc1{{.*}}-fsanitize-address-use-after-scope
@@ -621,6 +631,12 @@
// RUN: %clang -target x86_64-linux-gnu -fsanitize=cfi-icall -fsanitize-cfi-icall-generalize-pointers -fsanitize-cfi-cross-dso -fvisibility=hidden -flto -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-GENERALIZE-AND-CROSS-DSO
// CHECK-CFI-GENERALIZE-AND-CROSS-DSO: error: invalid argument '-fsanitize-cfi-cross-dso' not allowed with '-fsanitize-cfi-icall-generalize-pointers'
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=cfi-icall -fsanitize-cfi-canonical-jump-tables -fvisibility=hidden -flto -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-CANONICAL-JUMP-TABLES
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=cfi-icall -fno-sanitize-cfi-canonical-jump-tables -fvisibility=hidden -flto -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-CFI-CANONICAL-JUMP-TABLES
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=cfi-icall -fvisibility=hidden -flto -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-CANONICAL-JUMP-TABLES
+// CHECK-CFI-CANONICAL-JUMP-TABLES: -fsanitize-cfi-canonical-jump-tables
+// CHECK-NO-CFI-CANONICAL-JUMP-TABLES-NOT: -fsanitize-cfi-canonical-jump-tables
+
// RUN: %clang -target x86_64-linux-gnu -fsanitize=cfi -fsanitize-stats -flto -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-STATS
// CHECK-CFI-STATS: -fsanitize-stats
@@ -727,6 +743,9 @@
// RUN: %clang -target x86_64--netbsd -fsanitize=scudo %s -### 2>&1 | FileCheck %s -check-prefix=SCUDO-NETBSD
// SCUDO-NETBSD: "-fsanitize=scudo"
+// RUN: %clang -target i386--solaris -fsanitize=function %s -### 2>&1 | FileCheck %s -check-prefix=FUNCTION-SOLARIS
+// RUN: %clang -target x86_64--solaris -fsanitize=function %s -### 2>&1 | FileCheck %s -check-prefix=FUNCTION-SOLARIS
+// FUNCTION-SOLARIS: "-fsanitize=function"
// RUN: %clang -target x86_64-scei-ps4 -fsanitize=function -fsanitize=undefined %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-FSAN-UBSAN-PS4
@@ -840,7 +859,9 @@
// RUN: %clang -target x86_64-linux-gnu -fsanitize=hwaddress -fsanitize-hwaddress-abi=platform %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-HWASAN-PLATFORM-ABI
// RUN: %clang -target x86_64-linux-gnu -fsanitize=hwaddress -fsanitize-hwaddress-abi=foo %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-HWASAN-FOO-ABI
// CHECK-HWASAN-INTERCEPTOR-ABI: "-default-function-attr" "hwasan-abi=interceptor"
+// CHECK-HWASAN-INTERCEPTOR-ABI: "-target-feature" "+tagged-globals"
// CHECK-HWASAN-PLATFORM-ABI: "-default-function-attr" "hwasan-abi=platform"
+// CHECK-HWASAN-PLATFORM-ABI: "-target-feature" "+tagged-globals"
// CHECK-HWASAN-FOO-ABI: error: invalid value 'foo' in '-fsanitize-hwaddress-abi=foo'
// RUN: %clang -target x86_64-linux-gnu -fsanitize=address,pointer-compare,pointer-subtract %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-POINTER-ALL
diff --git a/src/llvm-project/clang/test/Driver/fuchsia.c b/src/llvm-project/clang/test/Driver/fuchsia.c
index c31e373..13280c8 100644
--- a/src/llvm-project/clang/test/Driver/fuchsia.c
+++ b/src/llvm-project/clang/test/Driver/fuchsia.c
@@ -6,17 +6,24 @@
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
// RUN: --sysroot=%S/platform -fuse-ld=lld 2>&1 \
// RUN: | FileCheck -check-prefixes=CHECK,CHECK-AARCH64 %s
+// RUN: %clang %s -### -no-canonical-prefixes --target=riscv64-fuchsia \
+// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
+// RUN: --sysroot=%S/platform -fuse-ld=lld 2>&1 \
+// RUN: | FileCheck -check-prefixes=CHECK,CHECK-RISCV64 %s
// CHECK: {{.*}}clang{{.*}}" "-cc1"
+// CHECK-X86_64: "-triple" "x86_64-unknown-fuchsia"
+// CHECK-AARCH64: "-triple" "aarch64-unknown-fuchsia"
+// CHECK-RISCV64: "-triple" "riscv64-unknown-fuchsia"
// CHECK: "--mrelax-relocations"
// CHECK: "-munwind-tables"
-// CHECK: "-fuse-init-array"
// CHECK: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
// CHECK: "-isysroot" "[[SYSROOT:[^"]+]]"
// CHECK: "-internal-externc-isystem" "[[SYSROOT]]{{/|\\\\}}include"
-// CHECK: "-fsanitize=safe-stack"
+// CHECK-AARCH64: "-fsanitize=shadow-call-stack"
+// CHECK-X86_64: "-fsanitize=safe-stack"
// CHECK: "-stack-protector" "2"
// CHECK: "-fno-common"
-// CHECK: {{.*}}ld.lld{{.*}}" "-z" "rodynamic"
+// CHECK: {{.*}}ld.lld{{.*}}" "-z" "now" "-z" "rodynamic" "-z" "separate-loadable-segments"
// CHECK: "--sysroot=[[SYSROOT]]"
// CHECK: "-pie"
// CHECK: "--build-id"
@@ -28,6 +35,7 @@
// CHECK: "-L[[SYSROOT]]{{/|\\\\}}lib"
// CHECK-X86_64: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}x86_64-fuchsia{{/|\\\\}}libclang_rt.builtins.a"
// CHECK-AARCH64: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}aarch64-fuchsia{{/|\\\\}}libclang_rt.builtins.a"
+// CHECK-RISCV64: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}riscv64-fuchsia{{/|\\\\}}libclang_rt.builtins.a"
// CHECK: "-lc"
// CHECK-NOT: crtend.o
// CHECK-NOT: crtn.o
@@ -102,7 +110,7 @@
// RUN: -fuse-ld=lld \
// RUN: | FileCheck %s -check-prefix=CHECK-ASAN-AARCH64
// CHECK-ASAN-AARCH64: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
-// CHECK-ASAN-AARCH64: "-fsanitize=address"
+// CHECK-ASAN-AARCH64: "-fsanitize=address,shadow-call-stack"
// CHECK-ASAN-AARCH64: "-fsanitize-address-globals-dead-stripping"
// CHECK-ASAN-AARCH64: "-dynamic-linker" "asan/ld.so.1"
// CHECK-ASAN-AARCH64: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}aarch64-fuchsia{{/|\\\\}}libclang_rt.asan.so"
@@ -134,7 +142,7 @@
// RUN: -fuse-ld=lld \
// RUN: | FileCheck %s -check-prefix=CHECK-FUZZER-AARCH64
// CHECK-FUZZER-AARCH64: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
-// CHECK-FUZZER-AARCH64: "-fsanitize=fuzzer,fuzzer-no-link,safe-stack"
+// CHECK-FUZZER-AARCH64: "-fsanitize=fuzzer,fuzzer-no-link,shadow-call-stack"
// CHECK-FUZZER-AARCH64: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}aarch64-fuchsia{{/|\\\\}}libclang_rt.fuzzer.a"
// RUN: %clang %s -### --target=x86_64-fuchsia \
@@ -153,7 +161,7 @@
// RUN: -fuse-ld=lld \
// RUN: | FileCheck %s -check-prefix=CHECK-SCUDO-AARCH64
// CHECK-SCUDO-AARCH64: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
-// CHECK-SCUDO-AARCH64: "-fsanitize=safe-stack,scudo"
+// CHECK-SCUDO-AARCH64: "-fsanitize=shadow-call-stack,scudo"
// CHECK-SCUDO-AARCH64: "-pie"
// CHECK-SCUDO-AARCH64: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}aarch64-fuchsia{{/|\\\\}}libclang_rt.scudo.so"
diff --git a/src/llvm-project/clang/test/Driver/fuchsia.cpp b/src/llvm-project/clang/test/Driver/fuchsia.cpp
index a5297e7..b0aeb04 100644
--- a/src/llvm-project/clang/test/Driver/fuchsia.cpp
+++ b/src/llvm-project/clang/test/Driver/fuchsia.cpp
@@ -1,15 +1,28 @@
// RUN: %clangxx %s -### -no-canonical-prefixes --target=x86_64-fuchsia \
// RUN: -ccc-install-dir %S/Inputs/basic_fuchsia_tree/bin \
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
-// RUN: --sysroot=%S/platform -fuse-ld=lld 2>&1 | FileCheck %s
+// RUN: --sysroot=%S/platform -fuse-ld=lld 2>&1 \
+// RUN: | FileCheck -check-prefixes=CHECK,CHECK-X86_64 %s
+// RUN: %clangxx %s -### -no-canonical-prefixes --target=aarch64-fuchsia \
+// RUN: -ccc-install-dir %S/Inputs/basic_fuchsia_tree/bin \
+// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
+// RUN: --sysroot=%S/platform -fuse-ld=lld 2>&1 \
+// RUN: | FileCheck -check-prefixes=CHECK,CHECK-AARCH64 %s
+// RUN: %clangxx %s -### -no-canonical-prefixes --target=riscv64-fuchsia \
+// RUN: -ccc-install-dir %S/Inputs/basic_fuchsia_tree/bin \
+// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
+// RUN: --sysroot=%S/platform -fuse-ld=lld 2>&1 \
+// RUN: | FileCheck -check-prefixes=CHECK,CHECK-RISCV64 %s
// CHECK: {{.*}}clang{{.*}}" "-cc1"
-// CHECK: "-triple" "x86_64-fuchsia"
-// CHECK: "-fuse-init-array"
+// CHECK-X86_64: "-triple" "x86_64-unknown-fuchsia"
+// CHECK-AARCH64: "-triple" "aarch64-unknown-fuchsia"
+// CHECK-RISCV64: "-triple" "riscv64-unknown-fuchsia"
+// CHECK-NOT: "-fno-use-init-array"
// CHECK: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
// CHECK: "-isysroot" "[[SYSROOT:[^"]+]]"
// CHECK: "-internal-isystem" "{{.*[/\\]}}include{{/|\\\\}}c++{{/|\\\\}}v1"
// CHECK: "-internal-externc-isystem" "[[SYSROOT]]{{/|\\\\}}include"
-// CHECK: {{.*}}ld.lld{{.*}}" "-z" "rodynamic"
+// CHECK: {{.*}}ld.lld{{.*}}" "-z" "now" "-z" "rodynamic" "-z" "separate-loadable-segments"
// CHECK: "--sysroot=[[SYSROOT]]"
// CHECK: "-pie"
// CHECK: "--build-id"
@@ -23,7 +36,9 @@
// CHECK: "-lc++"
// CHECK: "-lm"
// CHECK: "--pop-state"
-// CHECK: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}x86_64-fuchsia{{/|\\\\}}libclang_rt.builtins.a"
+// CHECK-X86_64: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}x86_64-fuchsia{{/|\\\\}}libclang_rt.builtins.a"
+// CHECK-AARCH64: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}aarch64-fuchsia{{/|\\\\}}libclang_rt.builtins.a"
+// CHECK-RISCV64: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}riscv64-fuchsia{{/|\\\\}}libclang_rt.builtins.a"
// CHECK: "-lc"
// CHECK-NOT: crtend.o
// CHECK-NOT: crtn.o
diff --git a/src/llvm-project/clang/test/Driver/fuse-ld.c b/src/llvm-project/clang/test/Driver/fuse-ld.c
index b043ce6..13e709c 100644
--- a/src/llvm-project/clang/test/Driver/fuse-ld.c
+++ b/src/llvm-project/clang/test/Driver/fuse-ld.c
@@ -1,5 +1,6 @@
// RUN: %clang %s -### \
// RUN: -fuse-ld=/usr/local/bin/or1k-linux-ld 2>&1 \
+// RUN: -target x86_64-unknown-linux \
// RUN: | FileCheck %s --check-prefix=CHECK-ABSOLUTE-LD
// CHECK-ABSOLUTE-LD: /usr/local/bin/or1k-linux-ld
@@ -78,13 +79,13 @@
// RUN: %clang %s -### -fuse-ld=lld \
// RUN: -target i686-unknown-windows-msvc 2>&1 \
// RUN: | FileCheck %s --check-prefix CHECK-WINDOWS-MSVC-LLD
-// CHECK-WINDOWS-MSVC-LLD: "{{.*}}lld-link"
+// CHECK-WINDOWS-MSVC-LLD: "{{.*}}lld-link{{\.exe"|"}}
// CHECK-WINDOWS-MSVC-LLD-SAME: "-out:{{.*}}"
// RUN: %clang %s -### -fuse-ld=lld-link \
// RUN: -target i686-unknown-windows-msvc 2>&1 \
// RUN: | FileCheck %s --check-prefix CHECK-WINDOWS-MSVC-LLD-LINK
-// CHECK-WINDOWS-MSVC-LLD-LINK: "{{.*}}lld-link"
+// CHECK-WINDOWS-MSVC-LLD-LINK: "{{.*}}lld-link{{\.exe"|"}}
// CHECK-WINDOWS-MSVC-LLD-LINK-SAME: "-out:{{.*}}"
// RUN: %clang %s -### -fuse-ld=bfd \
diff --git a/src/llvm-project/clang/test/Driver/gcc-toolchain.cpp b/src/llvm-project/clang/test/Driver/gcc-toolchain.cpp
index ca96757..6c872f4 100644
--- a/src/llvm-project/clang/test/Driver/gcc-toolchain.cpp
+++ b/src/llvm-project/clang/test/Driver/gcc-toolchain.cpp
@@ -3,12 +3,14 @@
// RUN: %clangxx -no-canonical-prefixes %s -### -o %t 2>&1 \
// RUN: --target=i386-unknown-linux -stdlib=libstdc++ \
// RUN: --gcc-toolchain=%S/Inputs/ubuntu_11.04_multiarch_tree/usr \
+// RUN: --sysroot="" \
// 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 -stdlib=libstdc++ \
// RUN: -gcc-toolchain %S/Inputs/ubuntu_11.04_multiarch_tree/usr \
+// RUN: --sysroot="" \
// RUN: | FileCheck %s
//
// Test for header search toolchain detection.
diff --git a/src/llvm-project/clang/test/Driver/gen-cdb-fragment.c b/src/llvm-project/clang/test/Driver/gen-cdb-fragment.c
new file mode 100644
index 0000000..41d6989
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/gen-cdb-fragment.c
@@ -0,0 +1,37 @@
+// REQUIRES: x86-registered-target
+// RUN: rm -rf %t.cdb
+// RUN: %clang -target x86_64-apple-macos10.15 -c %s -o - -gen-cdb-fragment-path %t.cdb
+// RUN: ls %t.cdb | FileCheck --check-prefix=CHECK-LS %s
+// CHECK-LS: gen-cdb-fragment.c.{{.*}}.json
+
+// RUN: cat %t.cdb/*.json | FileCheck --check-prefix=CHECK %s
+// CHECK: { "directory": "{{.*}}", "file": "{{.*}}gen-cdb-fragment.c", "output": "-", "arguments": [{{.*}}, "--target=x86_64-apple-macos10.15"{{.*}}]},
+// RUN: cat %t.cdb/*.json | FileCheck --check-prefix=CHECK-FLAG %s
+// CHECK-FLAG-NOT: -gen-cdb-fragment-path
+
+// RUN: rm -rf %t.cdb
+// RUN: mkdir %t.cdb
+// RUN: ls %t.cdb | not FileCheck --check-prefix=CHECK-LS %s
+// RUN: %clang -target x86_64-apple-macos10.15 -S %s -o - -gen-cdb-fragment-path %t.cdb
+// RUN: ls %t.cdb | FileCheck --check-prefix=CHECK-LS %s
+
+// Working directory arg is respected.
+// RUN: rm -rf %t.cdb
+// RUN: mkdir %t.cdb
+// RUN: %clang -target x86_64-apple-macos10.15 -working-directory %t.cdb -c %s -o - -gen-cdb-fragment-path "."
+// RUN: ls %t.cdb | FileCheck --check-prefix=CHECK-LS %s
+// RUN: cat %t.cdb/*.json | FileCheck --check-prefix=CHECK-CWD %s
+// CHECK-CWD: "directory": "{{.*}}.cdb"
+
+// -### does not emit the CDB fragment
+// RUN: rm -rf %t.cdb
+// RUN: mkdir %t.cdb
+// RUN: %clang -target x86_64-apple-macos10.15 -S %s -o - -gen-cdb-fragment-path %t.cdb -###
+// RUN: ls %t.cdb | not FileCheck --check-prefix=CHECK-LS %s
+
+// -MJ is preferred over -gen-cdb-fragment-path
+// RUN: rm -rf %t.cdb
+// RUN: mkdir %t.cdb
+// RUN: %clang -target x86_64-apple-macos10.15 -S %s -o - -gen-cdb-fragment-path %t.cdb -MJ %t.out
+// RUN: ls %t.cdb | not FileCheck --check-prefix=CHECK-LS %s
+// RUN: FileCheck %s < %t.out
diff --git a/src/llvm-project/clang/test/Driver/hexagon-toolchain-elf.c b/src/llvm-project/clang/test/Driver/hexagon-toolchain-elf.c
index a7eeca0..44bff6f 100644
--- a/src/llvm-project/clang/test/Driver/hexagon-toolchain-elf.c
+++ b/src/llvm-project/clang/test/Driver/hexagon-toolchain-elf.c
@@ -121,6 +121,19 @@
// CHECK028-NOT: "-ffp-contract=fast"
// CHECK028: {{hexagon-link|ld}}
+// RUN: %clang -### -target hexagon-unknown-elf \
+// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
+// RUN: -mcpu=hexagonv65 -march=hexagon\
+// RUN: %s 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK029 %s
+// RUN: %clang -### -target hexagon-unknown-elf \
+// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
+// RUN: -mv65 -march=hexagon\
+// RUN: %s 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK029 %s
+// CHECK029: "-cc1" {{.*}} "-target-cpu" "hexagonv65"
+// CHECK029: {{hexagon-link|ld}}{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v65/crt0
+
// -----------------------------------------------------------------------------
// Test Linker related args
// -----------------------------------------------------------------------------
@@ -523,3 +536,27 @@
// RUN: | FileCheck -check-prefix=CHECK080 %s
// CHECK080: "-cc1"
// CHECK080: "-Wreturn-type"
+
+// -----------------------------------------------------------------------------
+// Default, hexagon-link is used
+// -----------------------------------------------------------------------------
+// RUN: %clang -### -target hexagon-unknown-elf \
+// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
+// RUN: -mcpu=hexagonv60 \
+// RUN: -fuse-ld=fake-value-to-ignore-CLANG_DEFAULT_LINKER \
+// RUN: %s 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK081 %s
+// REQUIRES: hexagon-registered-target
+// CHECK081: "-march=hexagon"
+// CHECK081: "-mcpu=hexagonv60"
+// -----------------------------------------------------------------------------
+// Passing -fuse-ld=lld
+// -----------------------------------------------------------------------------
+// RUN: %clang -### -target hexagon-unknown-elf \
+// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
+// RUN: -mcpu=hexagonv60 \
+// RUN: -fuse-ld=lld \
+// RUN: %s 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK082 %s
+// CHECK082-NOT: -march=
+// CHECK082-NOT: -mcpu=
diff --git a/src/llvm-project/clang/test/Driver/hip-autolink.hip b/src/llvm-project/clang/test/Driver/hip-autolink.hip
new file mode 100644
index 0000000..9c1b65f
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/hip-autolink.hip
@@ -0,0 +1,14 @@
+// REQUIRES: clang-driver
+// REQUIRES: x86-registered-target
+// REQUIRES: amdgpu-registered-target
+//
+// RUN: %clang --target=i386-pc-windows-msvc --cuda-gpu-arch=gfx906 -nogpulib \
+// RUN: --cuda-device-only -x hip %s -### 2>&1 | FileCheck --check-prefix=DEV %s
+// RUN: %clang --target=i386-pc-windows-msvc --cuda-gpu-arch=gfx906 -nogpulib \
+// RUN: --cuda-host-only -x hip %s -### 2>&1 | FileCheck --check-prefix=HOST %s
+
+// DEV: "-cc1" "-triple" "amdgcn-amd-amdhsa"
+// DEV-SAME: "-fno-autolink"
+
+// HOST: "-cc1" "-triple" "i386-pc-windows-msvc{{.*}}"
+// HOST-NOT: "-fno-autolink"
diff --git a/src/llvm-project/clang/test/Driver/hip-default-gpu-arch.hip b/src/llvm-project/clang/test/Driver/hip-default-gpu-arch.hip
new file mode 100644
index 0000000..56e36882
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/hip-default-gpu-arch.hip
@@ -0,0 +1,7 @@
+// REQUIRES: clang-driver
+// REQUIRES: x86-registered-target
+// REQUIRES: amdgpu-registered-target
+
+// RUN: %clang -### -x hip -c %s 2>&1 | FileCheck %s
+
+// CHECK: {{.*}}clang{{.*}}"-target-cpu" "gfx803"
diff --git a/src/llvm-project/clang/test/Driver/hip-device-compile.hip b/src/llvm-project/clang/test/Driver/hip-device-compile.hip
new file mode 100644
index 0000000..b6f1f1c
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/hip-device-compile.hip
@@ -0,0 +1,72 @@
+// REQUIRES: clang-driver
+// REQUIRES: x86-registered-target
+// REQUIRES: amdgpu-registered-target
+
+// If -emit-llvm and/or -S is used in device only compilation,
+// the output should not be bundled.
+
+// RUN: %clang -c -emit-llvm --cuda-device-only -### -target x86_64-linux-gnu \
+// RUN: -o a.bc -x hip --cuda-gpu-arch=gfx900 \
+// RUN: --hip-device-lib=lib1.bc \
+// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \
+// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
+// RUN: 2>&1 | FileCheck -check-prefixes=CHECK,BC %s
+
+// RUN: %clang -c -S -emit-llvm --cuda-device-only -### -target x86_64-linux-gnu \
+// RUN: -o a.ll -x hip --cuda-gpu-arch=gfx900 \
+// RUN: --hip-device-lib=lib1.bc \
+// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \
+// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
+// RUN: 2>&1 | FileCheck -check-prefixes=CHECK,LL %s
+
+// RUN: %clang -c -S --cuda-device-only -### -target x86_64-linux-gnu \
+// RUN: -o a.s -x hip --cuda-gpu-arch=gfx900 \
+// RUN: --hip-device-lib=lib1.bc \
+// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \
+// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
+// RUN: 2>&1 | FileCheck -check-prefixes=CHECK,ASM %s
+
+// CHECK: {{".*clang.*"}} "-cc1" "-triple" "amdgcn-amd-amdhsa"
+// CHECK-SAME: "-aux-triple" "x86_64-unknown-linux-gnu"
+// BC-SAME: "-emit-llvm-bc"
+// LL-SAME: "-emit-llvm"
+// ASM-NOT: "-emit-llvm"
+// CHECK-SAME: "-main-file-name" "a.cu" {{.*}} "-target-cpu" "gfx900"
+// CHECK-SAME: "-fcuda-is-device"
+// CHECK-SAME: {{".*lib1.bc"}}
+// BC-SAME: "-o" "a.bc"
+// LL-SAME: "-o" "a.ll"
+// ASM-SAME: "-o" "a.s"
+// CHECK-SAME: {{".*a.cu"}}
+
+// CHECK-NOT: {{"*.llvm-link"}}
+// CHECK-NOT: {{".*opt"}}
+// CHECK-NOT: {{".*llc"}}
+// CHECK-NOT: {{".*lld"}}
+// CHECK-NOT: {{".*clang-offload-bundler"}}
+// CHECK-NOT: {{".*ld.*"}}
+
+// If neither -emit-llvm nor -S is used in device only compilation,
+// the output should be bundled.
+
+// RUN: %clang -c --cuda-device-only -### -target x86_64-linux-gnu \
+// RUN: -o a.s -x hip --cuda-gpu-arch=gfx900 \
+// RUN: --hip-device-lib=lib1.bc \
+// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \
+// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
+// RUN: 2>&1 | FileCheck -check-prefixes=BUNDLE %s
+
+// RUN: %clang --cuda-device-only -### -target x86_64-linux-gnu \
+// RUN: -o a.s -x hip --cuda-gpu-arch=gfx900 \
+// RUN: --hip-device-lib=lib1.bc \
+// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \
+// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
+// RUN: 2>&1 | FileCheck -check-prefixes=BUNDLE %s
+
+// BUNDLE: {{"*.clang.*"}}
+// BUNDLE: {{"*.llvm-link"}}
+// BUNDLE: {{".*opt"}}
+// BUNDLE: {{".*llc"}}
+// BUNDLE: {{".*lld"}}
+// BUNDLE: {{".*clang-offload-bundler"}}
+
diff --git a/src/llvm-project/clang/test/Driver/hip-device-libs.hip b/src/llvm-project/clang/test/Driver/hip-device-libs.hip
index 59c1927..14401a9 100644
--- a/src/llvm-project/clang/test/Driver/hip-device-libs.hip
+++ b/src/llvm-project/clang/test/Driver/hip-device-libs.hip
@@ -22,7 +22,6 @@
// COM: {{"[^"]*clang[^"]*"}}
// COM-SAME: "-mlink-builtin-bitcode" "{{.*}}hip.amdgcn.bc"
-// COM-SAME: "-mlink-builtin-bitcode" "{{.*}}opencl.amdgcn.bc"
// COM-SAME: "-mlink-builtin-bitcode" "{{.*}}ocml.amdgcn.bc"
// COM-SAME: "-mlink-builtin-bitcode" "{{.*}}ockl.amdgcn.bc"
// FLUSHD-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_daz_opt_on.amdgcn.bc"
diff --git a/src/llvm-project/clang/test/Driver/hip-no-device-libs.hip b/src/llvm-project/clang/test/Driver/hip-no-device-libs.hip
new file mode 100644
index 0000000..9fc73699
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/hip-no-device-libs.hip
@@ -0,0 +1,11 @@
+// REQUIRES: clang-driver
+// REQUIRES: x86-registered-target
+// REQUIRES: amdgpu-registered-target
+
+// RUN: %clang -### -nogpulib -target x86_64-linux-gnu \
+// RUN: -x hip --cuda-gpu-arch=gfx900 \
+// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
+// RUN: 2>&1 | FileCheck %s
+
+// CHECK-NOT: "-mlink-builtin-bitcode"
+
diff --git a/src/llvm-project/clang/test/Driver/hip-options.hip b/src/llvm-project/clang/test/Driver/hip-options.hip
new file mode 100644
index 0000000..b2ad042
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/hip-options.hip
@@ -0,0 +1,10 @@
+// REQUIRES: clang-driver
+// REQUIRES: x86-registered-target
+// REQUIRES: amdgpu-registered-target
+
+// RUN: %clang -### -x hip --gpu-max-threads-per-block=1024 %s 2>&1 | FileCheck %s
+
+// Check that there are commands for both host- and device-side compilations.
+//
+// CHECK: clang{{.*}}" "-cc1" {{.*}} "-fcuda-is-device"
+// CHECK-SAME: "--gpu-max-threads-per-block=1024"
diff --git a/src/llvm-project/clang/test/Driver/hip-save-temps.hip b/src/llvm-project/clang/test/Driver/hip-save-temps.hip
new file mode 100644
index 0000000..f7f2c6e
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/hip-save-temps.hip
@@ -0,0 +1,41 @@
+// REQUIRES: clang-driver
+// REQUIRES: x86-registered-target
+// REQUIRES: amdgpu-registered-target
+
+// -fno-gpu-rdc without -o
+// RUN: %clang -### -target x86_64-linux-gnu -nogpulib -save-temps \
+// RUN: -x hip --cuda-gpu-arch=gfx900 %s 2>&1 | \
+// RUN: FileCheck -check-prefixes=CHECK,NORDC,NOUT %s
+
+// -fno-gpu-rdc with -o
+// RUN: %clang -### -target x86_64-linux-gnu -nogpulib -save-temps \
+// RUN: -o executable -x hip --cuda-gpu-arch=gfx900 %s 2>&1 | \
+// RUN: FileCheck -check-prefixes=CHECK,NORDC,WOUT %s
+
+// -fgpu-rdc without -o
+// RUN: %clang -### -target x86_64-linux-gnu -nogpulib -save-temps \
+// RUN: -fgpu-rdc -x hip --cuda-gpu-arch=gfx900 %s 2>&1 | \
+// RUN: FileCheck -check-prefixes=CHECK,RDC,RDC-NOUT,NOUT %s
+
+// -fgpu-rdc with -o
+// RUN: %clang -### -target x86_64-linux-gnu -nogpulib -save-temps \
+// RUN: -o executable -fgpu-rdc -x hip --cuda-gpu-arch=gfx900 %s 2>&1 | \
+// RUN: FileCheck -check-prefixes=CHECK,RDC,RDC-WOUT,WOUT %s
+
+// CHECK: {{.*}}clang{{.*}}"-o" "hip-save-temps-hip-amdgcn-amd-amdhsa-gfx900.cui"
+// CHECK: {{.*}}llvm-link{{.*}}"-o" "hip-save-temps-hip-amdgcn-amd-amdhsa-gfx900-linked.bc"
+// CHECK: {{.*}}opt{{.*}}"-o" "hip-save-temps-hip-amdgcn-amd-amdhsa-gfx900-optimized.bc"
+// CHECK: {{.*}}llc{{.*}}"-filetype=asm"{{.*}}"-o" "hip-save-temps-hip-amdgcn-amd-amdhsa-gfx900.s"
+// CHECK: {{.*}}llc{{.*}}"-filetype=obj"{{.*}}"-o" "hip-save-temps-hip-amdgcn-amd-amdhsa-gfx900.o"
+// NORDC: {{.*}}lld{{.*}}"-o" "hip-save-temps-hip-amdgcn-amd-amdhsa-gfx900.out"
+// RDC: {{.*}}lld{{.*}}"-o" "a.out-hip-amdgcn-amd-amdhsa-gfx900"
+// NORDC: {{.*}}clang-offload-bundler{{.*}}"-outputs=hip-save-temps.hip-hip-amdgcn-amd-amdhsa.hipfb"
+// CHECK: {{.*}}clang{{.*}}"-o" "hip-save-temps-host-x86_64-unknown-linux-gnu.cui"
+// CHECK: {{.*}}clang{{.*}}"-o" "hip-save-temps-host-x86_64-unknown-linux-gnu.bc"
+// CHECK: {{.*}}clang{{.*}}"-o" "hip-save-temps-host-x86_64-unknown-linux-gnu.s"
+// CHECK: {{.*}}clang{{.*}}"-o" "hip-save-temps{{.*}}.o"
+// RDC-NOUT: {{.*}}clang-offload-bundler{{.*}}"-outputs=a.out.hipfb"
+// RDC-WOUT: {{.*}}clang-offload-bundler{{.*}}"-outputs=executable.hipfb"
+// NOUT: {{.*}}ld{{.*}}"-o" "a.out"
+// WOUT: {{.*}}ld{{.*}}"-o" "executable"
+
diff --git a/src/llvm-project/clang/test/Driver/hip-syntax-only.hip b/src/llvm-project/clang/test/Driver/hip-syntax-only.hip
new file mode 100644
index 0000000..051c3c6
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/hip-syntax-only.hip
@@ -0,0 +1,11 @@
+// REQUIRES: clang-driver
+// REQUIRES: x86-registered-target
+// REQUIRES: amdgpu-registered-target
+
+// RUN: %clang -### -x hip -nogpulib -target x86_64 -fsyntax-only %s 2>&1 | FileCheck %s
+
+// Check that there are commands for both host- and device-side compilations.
+//
+// CHECK-DAG: clang{{.*}}" "-cc1" {{.*}} "-fcuda-is-device"
+// CHECK-DAG: clang{{.*}}" "-cc1" "-triple" "x86_64"
+// CHECK-NOT: clang-offload-bundler"
diff --git a/src/llvm-project/clang/test/Driver/hip-toolchain-dwarf.hip b/src/llvm-project/clang/test/Driver/hip-toolchain-dwarf.hip
new file mode 100644
index 0000000..44d66fe
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/hip-toolchain-dwarf.hip
@@ -0,0 +1,9 @@
+// REQUIRES: clang-driver
+// REQUIRES: x86-registered-target
+// REQUIRES: amdgpu-registered-target
+
+// RUN: %clang -### -c -target x86_64-linux-gnu -fgpu-rdc \
+// RUN: -x hip --cuda-gpu-arch=gfx803 %s \
+// RUN: -Xarch_gfx803 -g 2>&1 | FileCheck %s -check-prefix=DWARF_VER
+
+// DWARF_VER: "-dwarf-version=4"
diff --git a/src/llvm-project/clang/test/Driver/hip-toolchain-mllvm.hip b/src/llvm-project/clang/test/Driver/hip-toolchain-mllvm.hip
index d8f9c0b..ab66505 100644
--- a/src/llvm-project/clang/test/Driver/hip-toolchain-mllvm.hip
+++ b/src/llvm-project/clang/test/Driver/hip-toolchain-mllvm.hip
@@ -18,8 +18,9 @@
// CHECK-SAME: "-o" [[OPT_803_BC:".*-gfx803-optimized.*bc"]]
// CHECK: [[LLC: ".*llc"]] [[OPT_803_BC]]
-// CHECK-SAME: "-mtriple=amdgcn-amd-amdhsa" "-filetype=obj"
+// CHECK-SAME: "-mtriple=amdgcn-amd-amdhsa"
// CHECK-SAME: {{.*}} "-mcpu=gfx803"
+// CHECK-SAME: "-filetype=obj"
// CHECK-SAME: "-amdgpu-function-calls=0" "-o" {{".*-gfx803-.*o"}}
// CHECK: [[CLANG]] "-cc1" "-triple" "amdgcn-amd-amdhsa"
@@ -33,6 +34,7 @@
// CHECK-SAME: "-o" [[OPT_900_BC:".*-gfx900-optimized.*bc"]]
// CHECK: [[LLC]] [[OPT_900_BC]]
-// CHECK-SAME: "-mtriple=amdgcn-amd-amdhsa" "-filetype=obj"
+// CHECK-SAME: "-mtriple=amdgcn-amd-amdhsa"
// CHECK-SAME: {{.*}} "-mcpu=gfx900"
+// CHECk-SAME: "-filetype=obj"
// CHECK-SAME: "-amdgpu-function-calls=0" "-o" {{".*-gfx900-.*o"}}
diff --git a/src/llvm-project/clang/test/Driver/hip-toolchain-no-rdc.hip b/src/llvm-project/clang/test/Driver/hip-toolchain-no-rdc.hip
index 540b932..cda852e 100644
--- a/src/llvm-project/clang/test/Driver/hip-toolchain-no-rdc.hip
+++ b/src/llvm-project/clang/test/Driver/hip-toolchain-no-rdc.hip
@@ -20,7 +20,7 @@
// CHECK-SAME: "-aux-triple" "x86_64-unknown-linux-gnu"
// CHECK-SAME: "-emit-llvm-bc"
// CHECK-SAME: {{.*}} "-main-file-name" "a.cu" {{.*}} "-target-cpu" "gfx803"
-// CHECK-SAME: "-fcuda-is-device" "-fvisibility" "hidden"
+// CHECK-SAME: "-fcuda-is-device" "-fcuda-allow-variadic-functions" "-fvisibility" "hidden"
// CHECK-SAME: "-fapply-global-visibility-to-externs"
// CHECK-SAME: "{{.*}}lib1.bc" "{{.*}}lib2.bc"
// CHECK-SAME: {{.*}} "-o" [[A_BC_803:".*bc"]] "-x" "hip"
@@ -34,8 +34,9 @@
// CHECK-SAME: "-o" [[OPT_BC_DEV_A_803:".*-gfx803-optimized.*bc"]]
// CHECK: [[LLC: ".*llc"]] [[OPT_BC_DEV_A_803]] "-mtriple=amdgcn-amd-amdhsa"
+// CHECK-SAME: "-mcpu=gfx803"
// CHECK-SAME: "-filetype=obj"
-// CHECK-SAME: "-mcpu=gfx803" "-o" [[OBJ_DEV_A_803:".*-gfx803-.*o"]]
+// CHECK-SAME: "-o" [[OBJ_DEV_A_803:".*-gfx803-.*o"]]
// CHECK: [[LLD: ".*lld"]] "-flavor" "gnu" "-shared"
// CHECK-SAME: "-o" "[[IMG_DEV_A_803:.*out]]" [[OBJ_DEV_A_803]]
@@ -48,7 +49,7 @@
// CHECK-SAME: "-aux-triple" "x86_64-unknown-linux-gnu"
// CHECK-SAME: "-emit-llvm-bc"
// CHECK-SAME: {{.*}} "-main-file-name" "a.cu" {{.*}} "-target-cpu" "gfx900"
-// CHECK-SAME: "-fcuda-is-device" "-fvisibility" "hidden"
+// CHECK-SAME: "-fcuda-is-device" "-fcuda-allow-variadic-functions" "-fvisibility" "hidden"
// CHECK-SAME: "-fapply-global-visibility-to-externs"
// CHECK-SAME: "{{.*}}lib1.bc" "{{.*}}lib2.bc"
// CHECK-SAME: {{.*}} "-o" [[A_BC_900:".*bc"]] "-x" "hip"
@@ -62,8 +63,9 @@
// CHECK-SAME: "-o" [[OPT_BC_DEV_A_900:".*-gfx900-optimized.*bc"]]
// CHECK: [[LLC: ".*llc"]] [[OPT_BC_DEV_A_900]] "-mtriple=amdgcn-amd-amdhsa"
+// CHECK-SAME: "-mcpu=gfx900"
// CHECK-SAME: "-filetype=obj"
-// CHECK-SAME: "-mcpu=gfx900" "-o" [[OBJ_DEV_A_900:".*-gfx900-.*o"]]
+// CHECK-SAME: "-o" [[OBJ_DEV_A_900:".*-gfx900-.*o"]]
// CHECK: [[LLD: ".*lld"]] "-flavor" "gnu" "-shared"
// CHECK-SAME: "-o" "[[IMG_DEV_A_900:.*out]]" [[OBJ_DEV_A_900]]
@@ -92,7 +94,7 @@
// CHECK-SAME: "-aux-triple" "x86_64-unknown-linux-gnu"
// CHECK-SAME: "-emit-llvm-bc"
// CHECK-SAME: {{.*}} "-main-file-name" "b.hip" {{.*}} "-target-cpu" "gfx803"
-// CHECK-SAME: "-fcuda-is-device" "-fvisibility" "hidden"
+// CHECK-SAME: "-fcuda-is-device" "-fcuda-allow-variadic-functions" "-fvisibility" "hidden"
// CHECK-SAME: "-fapply-global-visibility-to-externs"
// CHECK-SAME: "{{.*}}lib1.bc" "{{.*}}lib2.bc"
// CHECK-SAME: {{.*}} "-o" [[B_BC_803:".*bc"]] "-x" "hip"
@@ -106,8 +108,9 @@
// CHECK-SAME: "-o" [[OPT_BC_DEV_B_803:".*-gfx803-optimized.*bc"]]
// CHECK: [[LLC: ".*llc"]] [[OPT_BC_DEV_B_803]] "-mtriple=amdgcn-amd-amdhsa"
+// CHECK-SAME: "-mcpu=gfx803"
// CHECK-SAME: "-filetype=obj"
-// CHECK-SAME: "-mcpu=gfx803" "-o" [[OBJ_DEV_B_803:".*-gfx803-.*o"]]
+// CHECK-SAME: "-o" [[OBJ_DEV_B_803:".*-gfx803-.*o"]]
// CHECK: [[LLD: ".*lld"]] "-flavor" "gnu" "-shared"
// CHECK-SAME: "-o" "[[IMG_DEV_B_803:.*out]]" [[OBJ_DEV_B_803]]
@@ -120,7 +123,7 @@
// CHECK-SAME: "-aux-triple" "x86_64-unknown-linux-gnu"
// CHECK-SAME: "-emit-llvm-bc"
// CHECK-SAME: {{.*}} "-main-file-name" "b.hip" {{.*}} "-target-cpu" "gfx900"
-// CHECK-SAME: "-fcuda-is-device" "-fvisibility" "hidden"
+// CHECK-SAME: "-fcuda-is-device" "-fcuda-allow-variadic-functions" "-fvisibility" "hidden"
// CHECK-SAME: "-fapply-global-visibility-to-externs"
// CHECK-SAME: "{{.*}}lib1.bc" "{{.*}}lib2.bc"
// CHECK-SAME: {{.*}} "-o" [[B_BC_900:".*bc"]] "-x" "hip"
@@ -134,8 +137,9 @@
// CHECK-SAME: "-o" [[OPT_BC_DEV_B_900:".*-gfx900-optimized.*bc"]]
// CHECK: [[LLC: ".*llc"]] [[OPT_BC_DEV_B_900]] "-mtriple=amdgcn-amd-amdhsa"
+// CHECk-SAME: "-mcpu=gfx900"
// CHECK-SAME: "-filetype=obj"
-// CHECK-SAME: "-mcpu=gfx900" "-o" [[OBJ_DEV_B_900:".*-gfx900-.*o"]]
+// CHECK-SAME: "-o" [[OBJ_DEV_B_900:".*-gfx900-.*o"]]
// CHECK: [[LLD: ".*lld"]] "-flavor" "gnu" "-shared"
// CHECK-SAME: "-o" "[[IMG_DEV_B_900:.*out]]" [[OBJ_DEV_B_900]]
diff --git a/src/llvm-project/clang/test/Driver/hip-toolchain-opt.hip b/src/llvm-project/clang/test/Driver/hip-toolchain-opt.hip
new file mode 100644
index 0000000..ae64ae7
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/hip-toolchain-opt.hip
@@ -0,0 +1,101 @@
+// REQUIRES: clang-driver
+// REQUIRES: x86-registered-target
+// REQUIRES: amdgpu-registered-target
+
+// RUN: %clang -### \
+// RUN: -target x86_64-unknown-linux-gnu \
+// RUN: -x hip --cuda-gpu-arch=gfx900 \
+// RUN: -c -nogpulib \
+// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
+// RUN: 2>&1 | FileCheck --check-prefixes=ALL,DEFAULT %s
+
+// RUN: %clang -### -O0 \
+// RUN: -target x86_64-unknown-linux-gnu \
+// RUN: -x hip --cuda-gpu-arch=gfx900 \
+// RUN: -c -nogpulib \
+// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
+// RUN: 2>&1 | FileCheck --check-prefixes=ALL,O0 %s
+
+// RUN: %clang -### -O1 \
+// RUN: -target x86_64-unknown-linux-gnu \
+// RUN: -x hip --cuda-gpu-arch=gfx900 \
+// RUN: -c -nogpulib \
+// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
+// RUN: 2>&1 | FileCheck --check-prefixes=ALL,O1 %s
+
+// RUN: %clang -### -O2 \
+// RUN: -target x86_64-unknown-linux-gnu \
+// RUN: -x hip --cuda-gpu-arch=gfx900 \
+// RUN: -c -nogpulib \
+// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
+// RUN: 2>&1 | FileCheck --check-prefixes=ALL,O2 %s
+
+// RUN: %clang -### -O3 \
+// RUN: -target x86_64-unknown-linux-gnu \
+// RUN: -x hip --cuda-gpu-arch=gfx900 \
+// RUN: -c -nogpulib \
+// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
+// RUN: 2>&1 | FileCheck --check-prefixes=ALL,O3 %s
+
+// RUN: %clang -### -Os \
+// RUN: -target x86_64-unknown-linux-gnu \
+// RUN: -x hip --cuda-gpu-arch=gfx900 \
+// RUN: -c -nogpulib \
+// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
+// RUN: 2>&1 | FileCheck --check-prefixes=ALL,Os %s
+
+// RUN: %clang -### -Oz \
+// RUN: -target x86_64-unknown-linux-gnu \
+// RUN: -x hip --cuda-gpu-arch=gfx900 \
+// RUN: -c -nogpulib \
+// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
+// RUN: 2>&1 | FileCheck --check-prefixes=ALL,Oz %s
+
+// RUN: %clang -### -Og \
+// RUN: -target x86_64-unknown-linux-gnu \
+// RUN: -x hip --cuda-gpu-arch=gfx900 \
+// RUN: -c -nogpulib \
+// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
+// RUN: 2>&1 | FileCheck --check-prefixes=ALL,Og %s
+
+// ALL: "{{.*}}clang{{.*}}" "-cc1" "-triple" "amdgcn-amd-amdhsa"
+// DEFAULT-NOT: "-O{{.}}"
+// O0-SAME: "-O0"
+// O1-SAME: "-O1"
+// O2-SAME: "-O2"
+// O3-SAME: "-O3"
+// Os-SAME: "-Os"
+// Oz-SAME: "-Oz"
+// Og-SAME: "-Og"
+
+// ALL: "{{.*}}opt"
+// DEFAULT-NOT: "-O{{.}}"
+// O0-SAME: "-O0"
+// O1-SAME: "-O1"
+// O2-SAME: "-O2"
+// O3-SAME: "-O3"
+// Os-SAME: "-Os"
+// Oz-SAME: "-Oz"
+// Og-SAME: "-O1"
+// ALL-SAME: "-mtriple=amdgcn-amd-amdhsa"
+
+// ALL: "{{.*}}llc"
+// DEFAULT-NOT: "-O{{.}}"
+// O0-SAME: "-O0"
+// O1-SAME: "-O1"
+// O2-SAME: "-O2"
+// O3-SAME: "-O3"
+// Os-SAME: "-O2"
+// Oz-SAME: "-O2"
+// Og-SAME: "-O1"
+// ALL-SAME: "-mtriple=amdgcn-amd-amdhsa"
+
+// ALL: "{{.*}}clang{{.*}}" "-cc1" "-triple" "x86_64-unknown-linux-gnu"
+// DEFAULT-NOT: "-O{{.}}"
+// O0-SAME: "-O0"
+// O1-SAME: "-O1"
+// O2-SAME: "-O2"
+// O3-SAME: "-O3"
+// Os-SAME: "-Os"
+// Oz-SAME: "-Oz"
+// Og-SAME: "-Og"
diff --git a/src/llvm-project/clang/test/Driver/hip-toolchain-rdc.hip b/src/llvm-project/clang/test/Driver/hip-toolchain-rdc.hip
index 15ac5f1..18fd1d7 100644
--- a/src/llvm-project/clang/test/Driver/hip-toolchain-rdc.hip
+++ b/src/llvm-project/clang/test/Driver/hip-toolchain-rdc.hip
@@ -16,7 +16,7 @@
// CHECK-SAME: "-aux-triple" "x86_64-unknown-linux-gnu"
// CHECK-SAME: "-emit-llvm-bc"
// CHECK-SAME: {{.*}} "-main-file-name" "a.cu" {{.*}} "-target-cpu" "gfx803"
-// CHECK-SAME: "-fcuda-is-device" "-fgpu-rdc" "-fvisibility" "hidden"
+// CHECK-SAME: "-fcuda-is-device" "-fgpu-rdc" "-fcuda-allow-variadic-functions" "-fvisibility" "hidden"
// CHECK-SAME: "-fapply-global-visibility-to-externs"
// CHECK-SAME: "{{.*}}lib1.bc" "{{.*}}lib2.bc"
// CHECK-SAME: {{.*}} "-o" [[A_BC:".*bc"]] "-x" "hip"
@@ -26,7 +26,7 @@
// CHECK-SAME: "-aux-triple" "x86_64-unknown-linux-gnu"
// CHECK-SAME: "-emit-llvm-bc"
// CHECK-SAME: {{.*}} "-main-file-name" "b.hip" {{.*}} "-target-cpu" "gfx803"
-// CHECK-SAME: "-fcuda-is-device" "-fgpu-rdc" "-fvisibility" "hidden"
+// CHECK-SAME: "-fcuda-is-device" "-fgpu-rdc" "-fcuda-allow-variadic-functions" "-fvisibility" "hidden"
// CHECK-SAME: "-fapply-global-visibility-to-externs"
// CHECK-SAME: "{{.*}}lib1.bc" "{{.*}}lib2.bc"
// CHECK-SAME: {{.*}} "-o" [[B_BC:".*bc"]] "-x" "hip"
@@ -40,13 +40,14 @@
// CHECK-SAME: "-o" [[OPT_BC_DEV1:".*-gfx803-optimized.*bc"]]
// CHECK: [[LLC: ".*llc"]] [[OPT_BC_DEV1]] "-mtriple=amdgcn-amd-amdhsa"
+// CHECK-SAME: "-mcpu=gfx803"
// CHECK-SAME: "-filetype=obj"
-// CHECK-SAME: "-mcpu=gfx803" "-o" [[OBJ_DEV1:".*-gfx803-.*o"]]
+// CHECK-SAME: "-o" [[OBJ_DEV1:".*-gfx803-.*o"]]
// CHECK: [[LLD: ".*lld"]] "-flavor" "gnu" "-shared"
// CHECK-SAME: "-o" "[[IMG_DEV1:.*out]]" [[OBJ_DEV1]]
-// CHECK: [[CLANG]] "-cc1" "-triple" "amdgcn-amd-amdhsa"
+// CHECK: [[CLANG]] "-cc1" "-triple" "amdgcn-amd-amdhsa"
// CHECK-SAME: "-aux-triple" "x86_64-unknown-linux-gnu"
// CHECK-SAME: "-emit-llvm-bc"
// CHECK-SAME: {{.*}} "-main-file-name" "a.cu" {{.*}} "-target-cpu" "gfx900"
@@ -72,8 +73,9 @@
// CHECK-SAME: "-o" [[OPT_BC_DEV2:".*-gfx900-optimized.*bc"]]
// CHECK: [[LLC]] [[OPT_BC_DEV2]] "-mtriple=amdgcn-amd-amdhsa"
+// CHECk-SAME: "-mcpu=gfx900"
// CHECK-SAME: "-filetype=obj"
-// CHECK-SAME: "-mcpu=gfx900" "-o" [[OBJ_DEV2:".*-gfx900-.*o"]]
+// CHECK-SAME: "-o" [[OBJ_DEV2:".*-gfx900-.*o"]]
// CHECK: [[LLD]] "-flavor" "gnu" "-shared"
// CHECK-SAME: "-o" "[[IMG_DEV2:.*out]]" [[OBJ_DEV2]]
diff --git a/src/llvm-project/clang/test/Driver/integrated-as.s b/src/llvm-project/clang/test/Driver/integrated-as.s
index 3ad0860..0194a3d 100644
--- a/src/llvm-project/clang/test/Driver/integrated-as.s
+++ b/src/llvm-project/clang/test/Driver/integrated-as.s
@@ -52,7 +52,9 @@
// PIC: "-mrelocation-model" "pic"
// RUN: %clang -### -target x86_64--- -c -integrated-as %s -Wa,-fdebug-compilation-dir,. 2>&1 | FileCheck --check-prefix=WA_DEBUGDIR %s
+// RUN: %clang -### -target x86_64--- -c -integrated-as %s -Wa,-fdebug-compilation-dir=. 2>&1 | FileCheck --check-prefix=WA_DEBUGDIR %s
// WA_DEBUGDIR: "-fdebug-compilation-dir" "."
// RUN: %clang -### -target x86_64--- -c -integrated-as %s -Xassembler -fdebug-compilation-dir -Xassembler . 2>&1 | FileCheck --check-prefix=XA_DEBUGDIR %s
+// RUN: %clang -### -target x86_64--- -c -integrated-as %s -Xassembler -fdebug-compilation-dir=. 2>&1 | FileCheck --check-prefix=XA_DEBUGDIR %s
// XA_DEBUGDIR: "-fdebug-compilation-dir" "."
diff --git a/src/llvm-project/clang/test/Driver/linker-opts.c b/src/llvm-project/clang/test/Driver/linker-opts.c
index 68b1e9f..e1673f7 100644
--- a/src/llvm-project/clang/test/Driver/linker-opts.c
+++ b/src/llvm-project/clang/test/Driver/linker-opts.c
@@ -1,17 +1,18 @@
// RUN: rm -rf %t
// RUN: mkdir %t
//
-// RUN: env LIBRARY_PATH=%t/test1 %clang -x c %s -### 2>&1 | FileCheck %s
+// RUN: env LIBRARY_PATH=%t/test1 %clang -target %itanium_abi_triple %s -la -### 2>&1 | FileCheck %s
// CHECK: "-L{{.*}}/test1"
+// CHECK: "{{[^"]+}}.o"
+// CHECK: "-la"
// GCC driver is used as linker on cygming. It should be aware of LIBRARY_PATH.
-// XFAIL: windows-msvc
// REQUIRES: clang-driver
// REQUIRES: native
// Make sure that LIBRARY_PATH works for both i386 and x86_64 on Darwin.
-// RUN: env LIBRARY_PATH=%t/test1 %clang -target x86_64-apple-darwin %s -### 2>&1 | FileCheck %s
-// RUN: env LIBRARY_PATH=%t/test1 %clang -target i386-apple-darwin %s -### 2>&1 | FileCheck %s
+// RUN: env LIBRARY_PATH=%t/test1 %clang -target x86_64-apple-darwin %s -la -### 2>&1 | FileCheck %s
+// RUN: env LIBRARY_PATH=%t/test1 %clang -target i386-apple-darwin %s -la -### 2>&1 | FileCheck %s
//
// Make sure that we don't warn on unused compiler arguments.
// RUN: %clang -Xclang -I. -x c %s -c -o %t/tmp.o
diff --git a/src/llvm-project/clang/test/Driver/linux-ld.c b/src/llvm-project/clang/test/Driver/linux-ld.c
index 70fc178..5122755 100644
--- a/src/llvm-project/clang/test/Driver/linux-ld.c
+++ b/src/llvm-project/clang/test/Driver/linux-ld.c
@@ -859,6 +859,41 @@
// CHECK-OPENSUSE-TW-ARMV7HL: "{{.*}}/usr/lib/gcc/armv7hl-suse-linux-gnueabi/5{{/|\\\\}}crtend.o"
// CHECK-OPENSUSE-TW-ARMV7HL: "{{.*}}/usr/lib/gcc/armv7hl-suse-linux-gnueabi/5/../../../../lib{{/|\\\\}}crtn.o"
//
+// Check openSUSE Tumbleweed on riscv64
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=riscv64-suse-linux -rtlib=platform \
+// RUN: --gcc-toolchain="" \
+// RUN: --sysroot=%S/Inputs/opensuse_tumbleweed_riscv64_tree \
+// RUN: | FileCheck --check-prefix=CHECK-OPENSUSE-TW-RISCV64 %s
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=riscv64-suse-linux -rtlib=platform \
+// RUN: --gcc-toolchain="" \
+// RUN: --sysroot=%S/Inputs/opensuse_tumbleweed_riscv64_tree \
+// RUN: | FileCheck --check-prefix=CHECK-OPENSUSE-TW-RISCV64 %s
+// CHECK-OPENSUSE-TW-RISCV64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-OPENSUSE-TW-RISCV64: "{{.*}}/usr/lib64/gcc/riscv64-suse-linux/9/../../../../lib64{{/|\\\\}}crt1.o"
+// CHECK-OPENSUSE-TW-RISCV64: "{{.*}}/usr/lib64/gcc/riscv64-suse-linux/9/../../../../lib64{{/|\\\\}}crti.o"
+// CHECK-OPENSUSE-TW-RISCV64: "{{.*}}/usr/lib64/gcc/riscv64-suse-linux/9{{/|\\\\}}crtbegin.o"
+// CHECK-OPENSUSE-TW-RISCV64: "-L[[SYSROOT]]/usr/lib64/gcc/riscv64-suse-linux/9"
+// CHECK-OPENSUSE-TW-RISCV64: "-L[[SYSROOT]]/usr/lib64/gcc/riscv64-suse-linux/9/../../../../lib64"
+// CHECK-OPENSUSE-TW-RISCV64: "{{.*}}/usr/lib64/gcc/riscv64-suse-linux/9{{/|\\\\}}crtend.o"
+// CHECK-OPENSUSE-TW-RISCV64: "{{.*}}/usr/lib64/gcc/riscv64-suse-linux/9/../../../../lib64{{/|\\\\}}crtn.o"
+//
+// Check openSUSE Tumbleweed on ppc
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=powerpc-unknown-linux-gnu -rtlib=platform \
+// RUN: --gcc-toolchain="" \
+// RUN: --sysroot=%S/Inputs/opensuse_tumbleweed_ppc_tree \
+// RUN: | FileCheck --check-prefix=CHECK-OPENSUSE-TW-PPC %s
+// CHECK-OPENSUSE-TW-PPC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-OPENSUSE-TW-PPC: "{{.*}}/usr/lib/gcc/powerpc64-suse-linux/9/../../..{{/|\\\\}}crt1.o"
+// CHECK-OPENSUSE-TW-PPC: "{{.*}}/usr/lib/gcc/powerpc64-suse-linux/9/../../..{{/|\\\\}}crti.o"
+// CHECK-OPENSUSE-TW-PPC: "{{.*}}/usr/lib/gcc/powerpc64-suse-linux/9{{/|\\\\}}crtbegin.o"
+// CHECK-OPENSUSE-TW-PPC: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-suse-linux/9"
+// CHECK-OPENSUSE-TW-PPC: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-suse-linux/9/../../.."
+// CHECK-OPENSUSE-TW-PPC: "{{.*}}/usr/lib/gcc/powerpc64-suse-linux/9{{/|\\\\}}crtend.o"
+// CHECK-OPENSUSE-TW-PPC: "{{.*}}/usr/lib/gcc/powerpc64-suse-linux/9/../../..{{/|\\\\}}crtn.o"
+//
// Check dynamic-linker for different archs
// RUN: %clang %s -### -o %t.o 2>&1 \
// RUN: --target=arm-linux-gnueabi \
diff --git a/src/llvm-project/clang/test/Driver/lit.local.cfg b/src/llvm-project/clang/test/Driver/lit.local.cfg
index 4a4ef2a..ad3f0e9 100644
--- a/src/llvm-project/clang/test/Driver/lit.local.cfg
+++ b/src/llvm-project/clang/test/Driver/lit.local.cfg
@@ -1,4 +1,4 @@
-config.suffixes = ['.c', '.cpp', '.h', '.m', '.mm', '.S', '.s', '.f90', '.f95',
+config.suffixes = ['.c', '.cpp', '.h', '.m', '.mm', '.S', '.s', '.f90', '.F90', '.f95',
'.cu', '.rs', '.cl', '.hip']
config.substitutions = list(config.substitutions)
config.substitutions.insert(0,
diff --git a/src/llvm-project/clang/test/Driver/lto-unit.c b/src/llvm-project/clang/test/Driver/lto-unit.c
index 1f1a286..0fdd493 100644
--- a/src/llvm-project/clang/test/Driver/lto-unit.c
+++ b/src/llvm-project/clang/test/Driver/lto-unit.c
@@ -1,9 +1,8 @@
// RUN: %clang -target x86_64-unknown-linux -### %s -flto=full 2>&1 | FileCheck --check-prefix=UNIT %s
// RUN: %clang -target x86_64-unknown-linux -### %s -flto=thin 2>&1 | FileCheck --check-prefix=UNIT %s
// RUN: %clang -target x86_64-apple-darwin13.3.0 -### %s -flto=full 2>&1 | FileCheck --check-prefix=UNIT %s
-// RUN: %clang -target x86_64-apple-darwin13.3.0 -### %s -flto=thin 2>&1 | FileCheck --check-prefix=NOUNIT %s
+// RUN: %clang -target x86_64-apple-darwin13.3.0 -### %s -flto=thin 2>&1 | FileCheck --check-prefix=UNIT %s
// RUN: %clang -target x86_64-scei-ps4 -### %s -flto=full 2>&1 | FileCheck --check-prefix=UNIT %s
-// RUN: %clang -target x86_64-scei-ps4 -### %s -flto=thin 2>&1 | FileCheck --check-prefix=NOUNIT %s
+// RUN: %clang -target x86_64-scei-ps4 -### %s -flto=thin 2>&1 | FileCheck --check-prefix=UNIT %s
// UNIT: "-flto-unit"
-// NOUNIT-NOT: "-flto-unit"
diff --git a/src/llvm-project/clang/test/Driver/m-and-mm.c b/src/llvm-project/clang/test/Driver/m-and-mm.c
new file mode 100644
index 0000000..cb719a6
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/m-and-mm.c
@@ -0,0 +1,35 @@
+// RUN: %clang -M %s 2>&1 | FileCheck %s --implicit-check-not=warning
+// RUN: %clang -MM %s 2>&1 | FileCheck %s --implicit-check-not=warning
+
+// CHECK: m-and-mm.o:
+// TEST-I: {{.*}}test.i:
+// TEST: {{.*}}test:
+
+// RUN: mkdir -p %t.dir
+
+/// if -MD and -MMD are not specified, -o specifies the dependency file name.
+// RUN: rm -f %t.dir/test.i
+// RUN: %clang -M %s -o %t.dir/test.i
+// RUN: FileCheck %s < %t.dir/test.i
+// RUN: rm -f %t.dir/test.i
+// RUN: %clang -MM %s -o %t.dir/test.i
+// RUN: FileCheck %s < %t.dir/test.i
+
+// RUN: rm -f %t.dir/test.d
+// RUN: %clang -fsyntax-only -MD %s -o %t.dir/test.i
+// RUN: FileCheck --check-prefix=TEST-I %s < %t.dir/test.d
+
+// RUN: rm -f %t.dir/test.d
+// RUN: %clang -M -MD %s -o %t.dir/test.i
+// RUN: FileCheck --check-prefix=TEST-I %s < %t.dir/test.d
+
+/// If the output file name does not have a suffix, just append `.d`.
+// RUN: rm -f %t.dir/test.d
+// RUN: %clang -fsyntax-only -MD %s -o %t.dir/test
+// RUN: FileCheck --check-prefix=TEST %s < %t.dir/test.d
+
+#warning "-M and -MM suppresses warnings, thus this warning shouldn't show up"
+int main(void)
+{
+ return 0;
+}
diff --git a/src/llvm-project/clang/test/Driver/m_and_mm.c b/src/llvm-project/clang/test/Driver/m_and_mm.c
deleted file mode 100644
index 6e40c82..0000000
--- a/src/llvm-project/clang/test/Driver/m_and_mm.c
+++ /dev/null
@@ -1,15 +0,0 @@
-// RUN: %clang -### \
-// RUN: -M -MM %s 2> %t
-// RUN: not grep '"-sys-header-deps"' %t
-
-// RUN: %clang -M -MM %s 2> %t
-// RUN: not grep "warning" %t
-
-// RUN: %clang -MMD -MD %s 2> %t || true
-// RUN: grep "warning" %t
-
-#warning "This warning shouldn't show up with -M and -MM"
-int main (void)
-{
- return 0;
-}
diff --git a/src/llvm-project/clang/test/Driver/mbackchain.c b/src/llvm-project/clang/test/Driver/mbackchain.c
new file mode 100644
index 0000000..3307682
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/mbackchain.c
@@ -0,0 +1,3 @@
+// RUN: %clang -target s390x -c -### %s -mpacked-stack -mbackchain 2>&1 | FileCheck %s
+
+// CHECK: error: unsupported option '-mpacked-stack -mbackchain'
diff --git a/src/llvm-project/clang/test/Driver/mcount.c b/src/llvm-project/clang/test/Driver/mcount.c
new file mode 100644
index 0000000..a89150c
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/mcount.c
@@ -0,0 +1,12 @@
+// RUN: %clang -target s390x -c -### %s -mnop-mcount -mrecord-mcount 2>&1 | FileCheck %s
+
+// CHECK: "-mnop-mcount"
+// CHECK: "-mrecord-mcount"
+
+// RUN: %clang -target x86_64 -c -### %s -mnop-mcount -mrecord-mcount 2>&1 | FileCheck --check-prefix=ERR1 %s
+// RUN: %clang -target aarch64 -c -### %s -mnop-mcount -mrecord-mcount 2>&1 | FileCheck --check-prefix=ERR2 %s
+
+// ERR1: error: unsupported option '-mnop-mcount' for target 'x86_64'
+// ERR1: error: unsupported option '-mrecord-mcount' for target 'x86_64'
+// ERR2: error: unsupported option '-mnop-mcount' for target 'aarch64'
+// ERR2: error: unsupported option '-mrecord-mcount' for target 'aarch64'
diff --git a/src/llvm-project/clang/test/Driver/mfentry.c b/src/llvm-project/clang/test/Driver/mfentry.c
new file mode 100644
index 0000000..ee402ea
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/mfentry.c
@@ -0,0 +1,9 @@
+// RUN: %clang -target s390x -c -### %s -mfentry 2>&1 | FileCheck %s
+// RUN: %clang -target i386 -c -### %s -mfentry 2>&1 | FileCheck %s
+// RUN: %clang -target x86_64 -c -### %s -mfentry 2>&1 | FileCheck %s
+
+// CHECK: "-mfentry"
+
+// RUN: %clang -target powerpc64le -c -### %s -mfentry 2>&1 | FileCheck --check-prefix=ERR %s
+
+// ERR: error: unsupported option '-mfentry' for target 'powerpc64le'
diff --git a/src/llvm-project/clang/test/Driver/mingw-implicit-extension-cross.c b/src/llvm-project/clang/test/Driver/mingw-implicit-extension-cross.c
new file mode 100644
index 0000000..2cf24dc
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/mingw-implicit-extension-cross.c
@@ -0,0 +1,9 @@
+// Test how an implicit .exe extension is added. If not running the compiler
+// on windows, no implicit extension is added. (Therefore, this test is skipped
+// when running on windows.)
+
+// UNSUPPORTED: system-windows
+
+// RUN: %clang -target i686-windows-gnu -### --sysroot=%S/Inputs/mingw_clang_tree/mingw32 %s -o outputname 2>&1 | FileCheck %s
+
+// CHECK: "-o" "outputname"
diff --git a/src/llvm-project/clang/test/Driver/mingw-implicit-extension-windows.c b/src/llvm-project/clang/test/Driver/mingw-implicit-extension-windows.c
new file mode 100644
index 0000000..9c60308
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/mingw-implicit-extension-windows.c
@@ -0,0 +1,14 @@
+// Test how an implicit .exe extension is added. If running the compiler
+// on windows, an implicit extension is added if none is provided in the
+// given name. (Therefore, this test is skipped when not running on windows.)
+
+// REQUIRES: system-windows
+
+// RUN: %clang -target i686-windows-gnu -### --sysroot=%S/Inputs/mingw_clang_tree/mingw32 %s -o outputname 2>&1 | FileCheck %s --check-prefix=CHECK-OUTPUTNAME-EXE
+
+// RUN: %clang -target i686-windows-gnu -### --sysroot=%S/Inputs/mingw_clang_tree/mingw32 %s -o outputname.exe 2>&1 | FileCheck %s --check-prefix=CHECK-OUTPUTNAME-EXE
+
+// RUN: %clang -target i686-windows-gnu -### --sysroot=%S/Inputs/mingw_clang_tree/mingw32 %s -o outputname.q 2>&1 | FileCheck %s --check-prefix=CHECK-OUTPUTNAME-Q
+
+// CHECK-OUTPUTNAME-EXE: "-o" "outputname.exe"
+// CHECK-OUTPUTNAME-Q: "-o" "outputname.q"
diff --git a/src/llvm-project/clang/test/Driver/mips-abi.c b/src/llvm-project/clang/test/Driver/mips-abi.c
index 63ffd99..f0f678b 100644
--- a/src/llvm-project/clang/test/Driver/mips-abi.c
+++ b/src/llvm-project/clang/test/Driver/mips-abi.c
@@ -153,6 +153,12 @@
// MIPS-ARCH-OCTEON: "-target-cpu" "octeon"
// MIPS-ARCH-OCTEON: "-target-abi" "n64"
//
+// RUN: %clang -target mips64-linux-gnu -### -c %s \
+// RUN: -march=octeon+ 2>&1 \
+// RUN: | FileCheck -check-prefix=MIPS-ARCH-OCTEONP %s
+// MIPS-ARCH-OCTEONP: "-target-cpu" "octeon+"
+// MIPS-ARCH-OCTEONP: "-target-abi" "n64"
+//
// RUN: not %clang -target mips64-linux-gnu -c %s \
// RUN: -march=mips32 2>&1 \
// RUN: | FileCheck -check-prefix=MIPS-ARCH-6432 %s
diff --git a/src/llvm-project/clang/test/Driver/mips-as.c b/src/llvm-project/clang/test/Driver/mips-as.c
index ced64d8..cd4808d 100644
--- a/src/llvm-project/clang/test/Driver/mips-as.c
+++ b/src/llvm-project/clang/test/Driver/mips-as.c
@@ -88,6 +88,16 @@
// RUN: | FileCheck -check-prefix=MIPS-OCTEON %s
// MIPS-OCTEON: as{{(.exe)?}}" "-march" "octeon" "-mabi" "64" "-mno-shared" "-EB"
//
+// RUN: %clang -target mips64-linux-gnu -march=octeon+ -### \
+// RUN: -no-integrated-as -c %s 2>&1 \
+// RUN: | FileCheck -check-prefix=MIPS-OCTEONP-PIC %s
+// MIPS-OCTEONP-PIC: as{{(.exe)?}}" "-march" "octeon+" "-mabi" "64" "-EB" "-KPIC"
+//
+// RUN: %clang -target mips64-linux-gnu -march=octeon+ -### \
+// RUN: -no-integrated-as -c %s -fno-pic -mno-abicalls 2>&1 \
+// RUN: | FileCheck -check-prefix=MIPS-OCTEONP %s
+// MIPS-OCTEONP: as{{(.exe)?}}" "-march" "octeon+" "-mabi" "64" "-mno-shared" "-EB"
+//
// RUN: %clang -target mips-linux-gnu -mips1 -### \
// RUN: -no-integrated-as -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=MIPS-ALIAS-1 %s
diff --git a/src/llvm-project/clang/test/Driver/mips-features.c b/src/llvm-project/clang/test/Driver/mips-features.c
index 19725bc..5ae5667 100644
--- a/src/llvm-project/clang/test/Driver/mips-features.c
+++ b/src/llvm-project/clang/test/Driver/mips-features.c
@@ -268,13 +268,13 @@
// RUN: %clang -target mips-linux-gnu -### -c %s \
// RUN: -mno-xgot -mxgot 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-XGOT %s
-// CHECK-XGOT: "-mllvm" "-mxgot"
+// CHECK-XGOT: "-target-feature" "+xgot"
//
// -mno-xgot
// RUN: %clang -target mips-linux-gnu -### -c %s \
// RUN: -mxgot -mno-xgot 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NOXGOT %s
-// CHECK-NOXGOT-NOT: "-mllvm" "-mxgot"
+// CHECK-NOXGOT: "-target-feature" "-xgot"
//
// -mldc1-sdc1
// RUN: %clang -target mips-linux-gnu -### -c %s \
diff --git a/src/llvm-project/clang/test/Driver/mips-float.c b/src/llvm-project/clang/test/Driver/mips-float.c
index 1621075..2f1b813 100644
--- a/src/llvm-project/clang/test/Driver/mips-float.c
+++ b/src/llvm-project/clang/test/Driver/mips-float.c
@@ -7,6 +7,14 @@
// RUN: | FileCheck --check-prefix=CHECK-DEF %s
// CHECK-DEF: "-mfloat-abi" "hard"
//
+// Default on FreeBSD
+// RUN: %clang -c %s -### -o %t.o 2>&1 \
+// RUN: -target mips-freebsd12 \
+// RUN: | FileCheck --check-prefix=DEF-FREEBSD %s
+// DEF-FREEBSD: "-target-feature" "+soft-float"
+// DEF-FREEBSD: "-msoft-float"
+// DEF-FREEBSD: "-mfloat-abi" "soft"
+//
// -mhard-float
// RUN: %clang -c %s -### -o %t.o 2>&1 \
// RUN: -target mips-linux-gnu -mhard-float \
diff --git a/src/llvm-project/clang/test/Driver/mips-integrated-as.s b/src/llvm-project/clang/test/Driver/mips-integrated-as.s
index 0e12877..46ce5b6 100644
--- a/src/llvm-project/clang/test/Driver/mips-integrated-as.s
+++ b/src/llvm-project/clang/test/Driver/mips-integrated-as.s
@@ -293,3 +293,13 @@
// IMG-SINGLEFLOAT-EXPLICIT-FPXX: "-target-feature" "+single-float"
// IMG-SINGLEFLOAT-EXPLICIT-FPXX: "-target-feature" "+fpxx"
// IMG-SINGLEFLOAT-EXPLICIT-FPXX: "-target-feature" "+nooddspreg"
+
+// RUN: %clang -target mips-linux-gnu -### -fintegrated-as -mxgot -c %s 2>&1 | \
+// RUN: FileCheck -check-prefix=XGOT %s
+// XGOT: -cc1as
+// XGOT: "-target-feature" "+xgot"
+
+// RUN: %clang -target mips-linux-gnu -### -fintegrated-as -mno-xgot -c %s 2>&1 | \
+// RUN: FileCheck -check-prefix=NOXGOT %s
+// NOXGOT: -cc1as
+// NOXGOT: "-target-feature" "-xgot"
diff --git a/src/llvm-project/clang/test/Driver/mips-mti-linux.c b/src/llvm-project/clang/test/Driver/mips-mti-linux.c
index ddc8498..21b270c 100644
--- a/src/llvm-project/clang/test/Driver/mips-mti-linux.c
+++ b/src/llvm-project/clang/test/Driver/mips-mti-linux.c
@@ -13,7 +13,7 @@
// RUN: | FileCheck --check-prefix=CHECK-BE-HF-32R2 %s
//
// CHECK-BE-HF-32R2: "{{[^"]*}}clang{{[^"]*}}" {{.*}} "-triple" "mips-mti-linux"
-// CHECK-BE-HF-32R2-SAME: "-fuse-init-array" "-target-cpu" "mips32r2"
+// CHECK-BE-HF-32R2-SAME: "-target-cpu" "mips32r2"
// CHECK-BE-HF-32R2-SAME: "-isysroot" "{{.*}}mips_mti_linux/sysroot"
// CHECK-BE-HF-32R2: "{{[^"]*}}ld.lld{{[^"]*}}"
// CHECK-BE-HF-32R2-SAME: "--sysroot=[[SYSROOT:[^"]+]]" {{.*}} "-dynamic-linker" "/lib/ld-musl-mips.so.1"
@@ -31,7 +31,7 @@
// RUN: | FileCheck --check-prefix=CHECK-LE-HF-32R2 %s
//
// CHECK-LE-HF-32R2: "{{[^"]*}}clang{{[^"]*}}" {{.*}} "-triple" "mipsel-mti-linux"
-// CHECK-LE-HF-32R2-SAME: "-fuse-init-array" "-target-cpu" "mips32r2"
+// CHECK-LE-HF-32R2-SAME: "-target-cpu" "mips32r2"
// CHECK-LE-HF-32R2-SAME: "-isysroot" "{{.*}}mips_mti_linux/sysroot"
// CHECK-LE-HF-32R2: "{{[^"]*}}ld.lld{{[^"]*}}"
// CHECK-LE-HF-32R2-SAME: "--sysroot=[[SYSROOT:[^"]+]]" {{.*}} "-dynamic-linker" "/lib/ld-musl-mipsel.so.1"
diff --git a/src/llvm-project/clang/test/Driver/mips-mti.cpp b/src/llvm-project/clang/test/Driver/mips-mti.cpp
index 147239c..94c3c55 100644
--- a/src/llvm-project/clang/test/Driver/mips-mti.cpp
+++ b/src/llvm-project/clang/test/Driver/mips-mti.cpp
@@ -4,6 +4,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips-mti-linux-gnu \
// RUN: --gcc-toolchain=%S/Inputs/mips_mti_tree \
+// RUN: --sysroot="" \
// RUN: -stdlib=libstdc++ \
// RUN: -EB -mhard-float -mabi=32 \
// RUN: | FileCheck --check-prefix=EB-HARD-O32 %s
@@ -32,6 +33,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips-mti-linux-gnu \
// RUN: --gcc-toolchain=%S/Inputs/mips_mti_tree \
+// RUN: --sysroot="" \
// RUN: -stdlib=libstdc++ \
// RUN: -EB -mhard-float -mabi=n32 \
// RUN: | FileCheck --check-prefix=EB-HARD-N32 %s
@@ -60,6 +62,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips64-mti-linux-gnu \
// RUN: --gcc-toolchain=%S/Inputs/mips_mti_tree \
+// RUN: --sysroot="" \
// RUN: -stdlib=libstdc++ \
// RUN: -EB -mhard-float -mabi=64 \
// RUN: | FileCheck --check-prefix=EB-HARD-N64 %s
@@ -88,6 +91,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips-mti-linux-gnu \
// RUN: --gcc-toolchain=%S/Inputs/mips_mti_tree \
+// RUN: --sysroot="" \
// RUN: -stdlib=libstdc++ \
// RUN: -EL -mhard-float -mabi=32 \
// RUN: | FileCheck --check-prefix=EL-HARD-O32 %s
@@ -116,6 +120,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips-mti-linux-gnu \
// RUN: --gcc-toolchain=%S/Inputs/mips_mti_tree \
+// RUN: --sysroot="" \
// RUN: -stdlib=libstdc++ \
// RUN: -EL -mhard-float -mabi=n32 \
// RUN: | FileCheck --check-prefix=EL-HARD-N32 %s
@@ -144,6 +149,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips64-mti-linux-gnu \
// RUN: --gcc-toolchain=%S/Inputs/mips_mti_tree \
+// RUN: --sysroot="" \
// RUN: -stdlib=libstdc++ \
// RUN: -EL -mhard-float -mabi=64 \
// RUN: | FileCheck --check-prefix=EL-HARD-N64 %s
@@ -172,6 +178,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips-mti-linux-gnu \
// RUN: --gcc-toolchain=%S/Inputs/mips_mti_tree \
+// RUN: --sysroot="" \
// RUN: -stdlib=libstdc++ \
// RUN: -EB -msoft-float \
// RUN: | FileCheck --check-prefix=EB-SOFT %s
@@ -200,6 +207,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips-mti-linux-gnu \
// RUN: --gcc-toolchain=%S/Inputs/mips_mti_tree \
+// RUN: --sysroot="" \
// RUN: -stdlib=libstdc++ \
// RUN: -EL -msoft-float \
// RUN: | FileCheck --check-prefix=EL-SOFT %s
@@ -228,6 +236,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips-mti-linux-gnu \
// RUN: --gcc-toolchain=%S/Inputs/mips_mti_tree \
+// RUN: --sysroot="" \
// RUN: -stdlib=libstdc++ \
// RUN: -EB -mhard-float -muclibc \
// RUN: | FileCheck --check-prefix=EB-HARD-UCLIBC %s
@@ -256,6 +265,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips-mti-linux-gnu \
// RUN: --gcc-toolchain=%S/Inputs/mips_mti_tree \
+// RUN: --sysroot="" \
// RUN: -stdlib=libstdc++ \
// RUN: -EL -mhard-float -muclibc \
// RUN: | FileCheck --check-prefix=EL-HARD-UCLIBC %s
@@ -284,6 +294,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips-mti-linux-gnu \
// RUN: --gcc-toolchain=%S/Inputs/mips_mti_tree \
+// RUN: --sysroot="" \
// RUN: -stdlib=libstdc++ \
// RUN: -EB -mhard-float -mnan=2008 \
// RUN: | FileCheck --check-prefix=EB-HARD-NAN2008 %s
@@ -312,6 +323,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips-mti-linux-gnu \
// RUN: --gcc-toolchain=%S/Inputs/mips_mti_tree \
+// RUN: --sysroot="" \
// RUN: -stdlib=libstdc++ \
// RUN: -EL -mhard-float -mnan=2008 \
// RUN: | FileCheck --check-prefix=EL-HARD-NAN2008 %s
@@ -340,6 +352,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips-mti-linux-gnu \
// RUN: --gcc-toolchain=%S/Inputs/mips_mti_tree \
+// RUN: --sysroot="" \
// RUN: -stdlib=libstdc++ \
// RUN: -EB -mhard-float -muclibc -mnan=2008 \
// RUN: | FileCheck --check-prefix=EB-HARD-UCLIBC-NAN2008 %s
@@ -368,6 +381,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips-mti-linux-gnu \
// RUN: --gcc-toolchain=%S/Inputs/mips_mti_tree \
+// RUN: --sysroot="" \
// RUN: -stdlib=libstdc++ \
// RUN: -EL -mhard-float -muclibc -mnan=2008 \
// RUN: | FileCheck --check-prefix=EL-HARD-UCLIBC-NAN2008 %s
@@ -396,6 +410,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips-mti-linux-gnu \
// RUN: --gcc-toolchain=%S/Inputs/mips_mti_tree \
+// RUN: --sysroot="" \
// RUN: -stdlib=libstdc++ \
// RUN: -EL -msoft-float -mmicromips \
// RUN: | FileCheck --check-prefix=EL-SOFT-MICRO %s
@@ -424,6 +439,7 @@
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=mips-mti-linux-gnu \
// RUN: --gcc-toolchain=%S/Inputs/mips_mti_tree \
+// RUN: --sysroot="" \
// RUN: -stdlib=libstdc++ \
// RUN: -EL -mhard-float -mmicromips -mnan=2008 \
// RUN: | FileCheck --check-prefix=EL-SOFT-MICRO-NAN2008 %s
diff --git a/src/llvm-project/clang/test/Driver/mlong-double-128.c b/src/llvm-project/clang/test/Driver/mlong-double-128.c
index ae76265..28d777a 100644
--- a/src/llvm-project/clang/test/Driver/mlong-double-128.c
+++ b/src/llvm-project/clang/test/Driver/mlong-double-128.c
@@ -2,10 +2,14 @@
// RUN: %clang -target powerpc64-pc-freebsd12 -c -### %s -mlong-double-128 2>&1 | FileCheck %s
// RUN: %clang -target powerpc64le-linux-musl -c -### %s -mlong-double-128 2>&1 | FileCheck %s
// RUN: %clang -target i686-linux-gnu -c -### %s -mlong-double-128 2>&1 | FileCheck %s
-// RUN: %clang -target x86_64-linux-musl -c -### %s -mlong-double-128 2>&1 | FileCheck %s
+
+// RUN: %clang -target x86_64-linux-musl -c -### %s -mlong-double-128 -mlong-double-80 2>&1 | FileCheck --implicit-check-not=-mlong-double-128 /dev/null
+// RUN: %clang -target x86_64-linux-musl -c -### %s -mlong-double-80 -mlong-double-128 2>&1 | FileCheck %s
// CHECK: "-mlong-double-128"
// RUN: %clang -target aarch64 -c -### %s -mlong-double-128 2>&1 | FileCheck --check-prefix=ERR %s
+// RUN: %clang -target powerpc -c -### %s -mlong-double-80 2>&1 | FileCheck --check-prefix=ERR2 %s
// ERR: error: unsupported option '-mlong-double-128' for target 'aarch64'
+// ERR2: error: unsupported option '-mlong-double-80' for target 'powerpc'
diff --git a/src/llvm-project/clang/test/Driver/msp430-toolchain.c b/src/llvm-project/clang/test/Driver/msp430-toolchain.c
index 62ef1c0..f741491 100644
--- a/src/llvm-project/clang/test/Driver/msp430-toolchain.c
+++ b/src/llvm-project/clang/test/Driver/msp430-toolchain.c
@@ -1,11 +1,11 @@
// A basic clang -cc1 command-line, and simple environment check.
-// RUN: %clang %s -### -no-canonical-prefixes -target msp430 2>&1 \
+// RUN: %clang %s -### -no-canonical-prefixes -target msp430 --sysroot="" 2>&1 \
// RUN: | FileCheck -check-prefix=CC1 %s
// CC1: clang{{.*}} "-cc1" "-triple" "msp430"
// RUN: %clang %s -### -no-canonical-prefixes -target msp430 \
-// RUN: --gcc-toolchain=%S/Inputs/basic_msp430_tree 2>&1 \
+// RUN: --gcc-toolchain=%S/Inputs/basic_msp430_tree --sysroot="" 2>&1 \
// RUN: | FileCheck -check-prefix=MSP430 %s
// MSP430: "{{.*}}Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../..{{/|\\\\}}..{{/|\\\\}}bin{{/|\\\\}}msp430-elf-ld"
@@ -18,7 +18,7 @@
// MSP430: "{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../..{{/|\\\\}}..{{/|\\\\}}msp430-elf{{/|\\\\}}lib/430{{/|\\\\}}crtn.o"
// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -nodefaultlibs \
-// RUN: --gcc-toolchain=%S/Inputs/basic_msp430_tree 2>&1 \
+// RUN: --gcc-toolchain=%S/Inputs/basic_msp430_tree --sysroot="" 2>&1 \
// RUN: | FileCheck -check-prefix=MSP430-NO-DFT-LIB %s
// MSP430-NO-DFT-LIB: "{{.*}}Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../..{{/|\\\\}}..{{/|\\\\}}bin{{/|\\\\}}msp430-elf-ld"
@@ -31,7 +31,7 @@
// MSP430-NO-DFT-LIB: "{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../..{{/|\\\\}}..{{/|\\\\}}msp430-elf{{/|\\\\}}lib/430{{/|\\\\}}crtn.o"
// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -nostartfiles \
-// RUN: --gcc-toolchain=%S/Inputs/basic_msp430_tree 2>&1 \
+// RUN: --gcc-toolchain=%S/Inputs/basic_msp430_tree --sysroot="" 2>&1 \
// RUN: | FileCheck -check-prefix=MSP430-NO-START %s
// MSP430-NO-START: "{{.*}}Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../..{{/|\\\\}}..{{/|\\\\}}bin{{/|\\\\}}msp430-elf-ld"
@@ -40,7 +40,7 @@
// MSP430-NO-START: "--start-group" "-lmul_none" "-lgcc" "-lc" "-lcrt" "-lnosys" "--end-group"
// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -nostdlib \
-// RUN: --gcc-toolchain=%S/Inputs/basic_msp430_tree 2>&1 \
+// RUN: --gcc-toolchain=%S/Inputs/basic_msp430_tree --sysroot="" 2>&1 \
// RUN: | FileCheck -check-prefix=MSP430-NO-STD-LIB %s
// MSP430-NO-STD-LIB: "{{.*}}Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../..{{/|\\\\}}..{{/|\\\\}}bin{{/|\\\\}}msp430-elf-ld"
@@ -48,31 +48,31 @@
// MSP430-NO-STD-LIB: "-L{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../..{{/|\\\\}}..{{/|\\\\}}msp430-elf{{/|\\\\}}lib/430"
// MSP430-NO-STD-LIB: "--start-group" "-lmul_none" "-lgcc" "--end-group"
-// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mmcu=msp430f147 2>&1 \
+// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mmcu=msp430f147 --sysroot="" 2>&1 \
// RUN: | FileCheck -check-prefix=MSP430-HWMult-16BIT %s
-// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mmcu=msp430f147 -mhwmult=auto 2>&1 \
+// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mmcu=msp430f147 -mhwmult=auto --sysroot="" 2>&1 \
// RUN: | FileCheck -check-prefix=MSP430-HWMult-16BIT %s
-// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mhwmult=16bit 2>&1 \
+// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mhwmult=16bit --sysroot="" 2>&1 \
// RUN: | FileCheck -check-prefix=MSP430-HWMult-16BIT %s
// MSP430-HWMult-16BIT: "--start-group" "-lmul_16"
-// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mmcu=msp430f4783 2>&1 \
+// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mmcu=msp430f4783 --sysroot="" 2>&1 \
// RUN: | FileCheck -check-prefix=MSP430-HWMult-32BIT %s
-// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mmcu=msp430f4783 -mhwmult=auto 2>&1 \
+// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mmcu=msp430f4783 -mhwmult=auto --sysroot="" 2>&1 \
// RUN: | FileCheck -check-prefix=MSP430-HWMult-32BIT %s
-// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mhwmult=32bit 2>&1 \
+// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mhwmult=32bit --sysroot="" 2>&1 \
// RUN: | FileCheck -check-prefix=MSP430-HWMult-32BIT %s
// MSP430-HWMult-32BIT: "--start-group" "-lmul_32"
-// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mhwmult=f5series 2>&1 \
+// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mhwmult=f5series --sysroot="" 2>&1 \
// RUN: | FileCheck -check-prefix=MSP430-HWMult-F5 %s
// MSP430-HWMult-F5: "--start-group" "-lmul_f5"
-// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mhwmult=none 2>&1 \
+// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mhwmult=none --sysroot="" 2>&1 \
// RUN: | FileCheck -check-prefix=MSP430-HWMult-NONE %s
-// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mhwmult=none -mmcu=msp430f4783 2>&1 \
+// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mhwmult=none -mmcu=msp430f4783 --sysroot="" 2>&1 \
// RUN: | FileCheck -check-prefix=MSP430-HWMult-NONE %s
// MSP430-HWMult-NONE: "--start-group" "-lmul_none"
diff --git a/src/llvm-project/clang/test/Driver/nacl-direct.c b/src/llvm-project/clang/test/Driver/nacl-direct.c
index 194c2f8..7cfa6cb 100644
--- a/src/llvm-project/clang/test/Driver/nacl-direct.c
+++ b/src/llvm-project/clang/test/Driver/nacl-direct.c
@@ -5,7 +5,7 @@
// RUN: -target i686-unknown-nacl -resource-dir foo 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-I686 %s
// CHECK-I686: {{.*}}clang{{.*}}" "-cc1"
-// CHECK-I686: "-fuse-init-array"
+// CHECK-I686-NOT: "-fno-use-init-array"
// CHECK-I686: "-target-cpu" "pentium4"
// CHECK-I686: "-resource-dir" "foo"
// CHECK-I686: "-internal-isystem" "foo{{/|\\\\}}include"
@@ -25,7 +25,7 @@
// RUN: -target x86_64-unknown-nacl -resource-dir foo 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-x86_64 %s
// CHECK-x86_64: {{.*}}clang{{.*}}" "-cc1"
-// CHECK-x86_64: "-fuse-init-array"
+// CHECK-x86_64-NOT: "-fno-use-init-array"
// CHECK-x86_64: "-target-cpu" "x86-64"
// CHECK-x86_64: "-resource-dir" "foo"
// CHECK-x86_64: "-internal-isystem" "foo{{/|\\\\}}include"
@@ -45,7 +45,7 @@
// RUN: -target armv7a-unknown-nacl-gnueabihf -resource-dir foo 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-ARM %s
// CHECK-ARM: {{.*}}clang{{.*}}" "-cc1"
-// CHECK-ARM: "-fuse-init-array"
+// CHECK-ARM-NOT: "-fno-use-init-array"
// CHECK-ARM: "-target-cpu" "generic"
// CHECK-ARM: "-target-abi" "aapcs-linux"
// CHECK-ARM: "-mfloat-abi" "hard"
@@ -68,7 +68,7 @@
// RUN: -target mipsel-unknown-nacl -resource-dir foo 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-MIPS %s
// CHECK-MIPS: {{.*}}clang{{.*}}" "-cc1"
-// CHECK-MIPS: "-fuse-init-array"
+// CHECK-MIPS-NOT: "-fno-use-init-array"
// CHECK-MIPS: "-target-cpu" "mips32r2"
// CHECK-MIPS: "-target-abi" "o32"
// CHECK-MIPS: "-mfloat-abi" "hard"
diff --git a/src/llvm-project/clang/test/Driver/netbsd.c b/src/llvm-project/clang/test/Driver/netbsd.c
index 221264a..9cf6b2e 100644
--- a/src/llvm-project/clang/test/Driver/netbsd.c
+++ b/src/llvm-project/clang/test/Driver/netbsd.c
@@ -169,12 +169,14 @@
// PIE: "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
// X86_64: clang{{.*}}" "-cc1" "-triple" "x86_64-unknown-netbsd"
+// X86_64-NOT: "-fno-use-init-array"
// 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-unknown-netbsd7.0.0"
+// X86_64-7: "-fno-use-init-array"
// 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"
@@ -187,30 +189,35 @@
// X86_64-6: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
// AARCH64: clang{{.*}}" "-cc1" "-triple" "aarch64-unknown-netbsd"
+// AARCH64-NOT: "-fno-use-init-array"
// AARCH64: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
// AARCH64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
// AARCH64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
// AARCH64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
// AARCH64-7: clang{{.*}}" "-cc1" "-triple" "aarch64-unknown-netbsd7.0.0"
+// AARCH64-7-NOT: "-fno-use-init-array"
// AARCH64-7: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
// AARCH64-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
// AARCH64-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
// AARCH64-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
// AARCH64_BE: clang{{.*}}" "-cc1" "-triple" "aarch64_be-unknown-netbsd"
+// AARCH64_BE-NOT: "-fno-use-init-array"
// AARCH64_BE: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
// AARCH64_BE: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
// AARCH64_BE: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
// AARCH64_BE: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
// AARCH64_BE-7: clang{{.*}}" "-cc1" "-triple" "aarch64_be-unknown-netbsd7.0.0"
+// AARCH64_BE-7-NOT: "-fno-use-init-array"
// AARCH64_BE-7: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
// AARCH64_BE-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
// AARCH64_BE-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
// AARCH64_BE-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
// ARM: clang{{.*}}" "-cc1" "-triple" "armv5e-unknown-netbsd-eabi"
+// ARM-NOT: "-fno-use-init-array"
// ARM: as{{.*}}" "-mcpu=arm926ej-s" "-o"
// ARM: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
// ARM: "-m" "armelf_nbsd_eabi"
@@ -220,6 +227,7 @@
// ARM: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
// ARMEB: clang{{.*}}" "-cc1" "-triple" "armebv5e-unknown-netbsd-eabi"
+// ARMEB-NOT: "-fno-use-init-array"
// ARMEB: as{{.*}}" "-mcpu=arm926ej-s" "-o"
// ARMEB: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
// ARMEB-NOT: "--be8"
@@ -271,6 +279,7 @@
// THUMBEB: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
// ARM-7: clang{{.*}}" "-cc1" "-triple" "armv5e-unknown-netbsd7.0.0-eabi"
+// ARM-7-NOT: "-fno-use-init-array"
// ARM-7: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
// ARM-7: "-m" "armelf_nbsd_eabi"
// ARM-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
@@ -287,6 +296,7 @@
// ARM-6: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
// SPARC: clang{{.*}}" "-cc1" "-triple" "sparc-unknown-netbsd"
+// SPARC-NOT: "-fno-use-init-array"
// SPARC: as{{.*}}" "-32" "-Av8" "-o"
// SPARC: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
// SPARC: "-m" "elf32_sparc"
@@ -296,6 +306,7 @@
// SPARC: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
// SPARC64: clang{{.*}}" "-cc1" "-triple" "sparc64-unknown-netbsd"
+// SPARC64-NOT: "-fno-use-init-array"
// SPARC64: as{{.*}}" "-64" "-Av9" "-o"
// SPARC64: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
// SPARC64: "-m" "elf64_sparc"
@@ -304,6 +315,7 @@
// SPARC64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
// POWERPC: clang{{.*}}" "-cc1" "-triple" "powerpc-unknown-netbsd"
+// POWERPC-NOT: "-fno-use-init-array"
// POWERPC: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
// POWERPC: "-m" "elf32ppc_nbsd"
// POWERPC: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
@@ -312,6 +324,7 @@
// POWERPC: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
// POWERPC64: clang{{.*}}" "-cc1" "-triple" "powerpc64-unknown-netbsd"
+// POWERPC64-NOT: "-fno-use-init-array"
// POWERPC64: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
// POWERPC64: "-m" "elf64ppc"
// POWERPC64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
@@ -405,6 +418,7 @@
// S-SPARC-6: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
// S-SPARC-7: clang{{.*}}" "-cc1" "-triple" "sparc-unknown-netbsd7.0.0"
+// S-SPARC-7: "-fno-use-init-array"
// S-SPARC-7: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
// S-SPARC-7: "-m" "elf32_sparc"
// S-SPARC-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
@@ -421,6 +435,7 @@
// S-SPARC64-6: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
// S-SPARC64-7: clang{{.*}}" "-cc1" "-triple" "sparc64-unknown-netbsd7.0.0"
+// S-SPARC64-7: "-fno-use-init-array"
// S-SPARC64-7: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
// S-SPARC64-7: "-m" "elf64_sparc"
// S-SPARC64-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
diff --git a/src/llvm-project/clang/test/Driver/no-canonical-prefixes.c b/src/llvm-project/clang/test/Driver/no-canonical-prefixes.c
index 85de9f1..c222dd4 100644
--- a/src/llvm-project/clang/test/Driver/no-canonical-prefixes.c
+++ b/src/llvm-project/clang/test/Driver/no-canonical-prefixes.c
@@ -4,10 +4,11 @@
// RUN: cd %t.real
// RUN: ln -sf %clang test-clang
// RUN: cd ..
-// If %.fake already is a symlink to %t.real when `ln -sf %t.real %t.fake`
-// runs, then that would symlink %t.real to itself, forming a cycle.
-// The `-n` flag prevents this.
-// RUN: ln -sfn %t.real %t.fake
+// Important to remove %t.fake: If it already is a symlink to %t.real when
+// `ln -sf %t.real %t.fake` runs, then that would symlink %t.real to itself,
+// forming a cycle.
+// RUN: rm -f %t.fake
+// RUN: ln -sf %t.real %t.fake
// RUN: cd %t.fake
// RUN: ./test-clang -v -S %s 2>&1 | FileCheck --check-prefix=CANONICAL %s
// RUN: ./test-clang -v -S %s -no-canonical-prefixes 2>&1 | FileCheck --check-prefix=NON-CANONICAL %s
diff --git a/src/llvm-project/clang/test/Driver/offloading-interoperability.c b/src/llvm-project/clang/test/Driver/offloading-interoperability.c
index 9c80d91..c3a72f0 100644
--- a/src/llvm-project/clang/test/Driver/offloading-interoperability.c
+++ b/src/llvm-project/clang/test/Driver/offloading-interoperability.c
@@ -8,10 +8,10 @@
// RUN: %clang -no-canonical-prefixes -### -x cuda -target powerpc64le-linux-gnu -std=c++11 --cuda-gpu-arch=sm_35 -fopenmp=libomp %s 2>&1 \
// RUN: | FileCheck %s --check-prefix NO-OPENMP-FLAGS-FOR-CUDA-DEVICE
//
-// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE: clang{{.*}}" "-cc1" "-triple" "nvptx64-nvidia-cuda"
+// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-LABEL:clang{{.*}}" "-cc1" "-triple" "nvptx64-nvidia-cuda"
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NOT: -fopenmp
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NEXT: ptxas" "-m64"
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NEXT: fatbinary"{{( "--cuda")?}} "-64"
-// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NEXT: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux-gnu"
+// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-LABEL:clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux-gnu"
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE: -fopenmp
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NEXT: {{ld(.exe)?"}} {{.*}}"-m" "elf64lppc"
diff --git a/src/llvm-project/clang/test/Driver/openbsd.c b/src/llvm-project/clang/test/Driver/openbsd.c
index 33c6647..51a5b43 100644
--- a/src/llvm-project/clang/test/Driver/openbsd.c
+++ b/src/llvm-project/clang/test/Driver/openbsd.c
@@ -117,3 +117,8 @@
// RUN: %clang -target powerpc-unknown-openbsd -### -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK-POWERPC-SECUREPLT %s
// CHECK-POWERPC-SECUREPLT: "-target-feature" "+secure-plt"
+
+// Check -fno-init-array
+// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd %s -### 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-CTORS %s
+// CHECK-CTORS: "-fno-use-init-array"
diff --git a/src/llvm-project/clang/test/Driver/openmp-offload-gpu.c b/src/llvm-project/clang/test/Driver/openmp-offload-gpu.c
index 3d2ac45..dc4dbd1 100644
--- a/src/llvm-project/clang/test/Driver/openmp-offload-gpu.c
+++ b/src/llvm-project/clang/test/Driver/openmp-offload-gpu.c
@@ -55,7 +55,7 @@
// RUN: -fopenmp-targets=nvptx64-nvidia-cuda %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHK-CUBIN-NVLINK %s
-// CHK-CUBIN-NVLINK: clang{{.*}}" "-o" "[[PTX:.*\.s]]"
+// CHK-CUBIN-NVLINK: clang{{.*}}" {{.*}}"-fopenmp-is-device" {{.*}}"-o" "[[PTX:.*\.s]]"
// CHK-CUBIN-NVLINK-NEXT: ptxas{{.*}}" "--output-file" "[[CUBIN:.*\.cubin]]" {{.*}}"[[PTX]]"
// CHK-CUBIN-NVLINK-NEXT: nvlink{{.*}}" {{.*}}"[[CUBIN]]"
diff --git a/src/llvm-project/clang/test/Driver/openmp-offload.c b/src/llvm-project/clang/test/Driver/openmp-offload.c
index 413e24b..30669bb 100644
--- a/src/llvm-project/clang/test/Driver/openmp-offload.c
+++ b/src/llvm-project/clang/test/Driver/openmp-offload.c
@@ -106,15 +106,18 @@
// CHK-PHASES: 2: compiler, {1}, ir, (host-openmp)
// CHK-PHASES: 3: backend, {2}, assembler, (host-openmp)
// CHK-PHASES: 4: assembler, {3}, object, (host-openmp)
-// CHK-PHASES: 5: linker, {4}, image, (host-openmp)
-// CHK-PHASES: 6: input, "[[INPUT]]", c, (device-openmp)
-// CHK-PHASES: 7: preprocessor, {6}, cpp-output, (device-openmp)
-// CHK-PHASES: 8: compiler, {7}, ir, (device-openmp)
-// CHK-PHASES: 9: offload, "host-openmp (powerpc64le-ibm-linux-gnu)" {2}, "device-openmp (x86_64-pc-linux-gnu)" {8}, ir
-// CHK-PHASES: 10: backend, {9}, assembler, (device-openmp)
-// CHK-PHASES: 11: assembler, {10}, object, (device-openmp)
-// CHK-PHASES: 12: linker, {11}, image, (device-openmp)
-// CHK-PHASES: 13: offload, "host-openmp (powerpc64le-ibm-linux-gnu)" {5}, "device-openmp (x86_64-pc-linux-gnu)" {12}, image
+// CHK-PHASES: 5: input, "[[INPUT]]", c, (device-openmp)
+// CHK-PHASES: 6: preprocessor, {5}, cpp-output, (device-openmp)
+// CHK-PHASES: 7: compiler, {6}, ir, (device-openmp)
+// CHK-PHASES: 8: offload, "host-openmp (powerpc64le-ibm-linux-gnu)" {2}, "device-openmp (x86_64-pc-linux-gnu)" {7}, ir
+// CHK-PHASES: 9: backend, {8}, assembler, (device-openmp)
+// CHK-PHASES: 10: assembler, {9}, object, (device-openmp)
+// CHK-PHASES: 11: linker, {10}, image, (device-openmp)
+// CHK-PHASES: 12: offload, "device-openmp (x86_64-pc-linux-gnu)" {11}, image
+// CHK-PHASES: 13: clang-offload-wrapper, {12}, ir, (host-openmp)
+// CHK-PHASES: 14: backend, {13}, assembler, (host-openmp)
+// CHK-PHASES: 15: assembler, {14}, object, (host-openmp)
+// CHK-PHASES: 16: linker, {4, 15}, image, (host-openmp)
/// ###########################################################################
@@ -128,15 +131,15 @@
// CHK-PHASES-LIB: 3: compiler, {2}, ir, (host-openmp)
// CHK-PHASES-LIB: 4: backend, {3}, assembler, (host-openmp)
// CHK-PHASES-LIB: 5: assembler, {4}, object, (host-openmp)
-// CHK-PHASES-LIB: 6: linker, {0, 5}, image, (host-openmp)
-// CHK-PHASES-LIB: 7: input, "somelib", object, (device-openmp)
-// CHK-PHASES-LIB: 8: input, "[[INPUT]]", c, (device-openmp)
-// CHK-PHASES-LIB: 9: preprocessor, {8}, cpp-output, (device-openmp)
-// CHK-PHASES-LIB: 10: compiler, {9}, ir, (device-openmp)
-// CHK-PHASES-LIB: 11: offload, "host-openmp (powerpc64-ibm-linux-gnu)" {3}, "device-openmp (x86_64-pc-linux-gnu)" {10}, ir
-// CHK-PHASES-LIB: 12: backend, {11}, assembler, (device-openmp)
-// CHK-PHASES-LIB: 13: assembler, {12}, object, (device-openmp)
-// CHK-PHASES-LIB: 14: linker, {7, 13}, image, (device-openmp)
+// CHK-PHASES-LIB: 6: input, "somelib", object, (device-openmp)
+// CHK-PHASES-LIB: 7: input, "[[INPUT]]", c, (device-openmp)
+// CHK-PHASES-LIB: 8: preprocessor, {7}, cpp-output, (device-openmp)
+// CHK-PHASES-LIB: 9: compiler, {8}, ir, (device-openmp)
+// CHK-PHASES-LIB: 10: offload, "host-openmp (powerpc64-ibm-linux-gnu)" {3}, "device-openmp (x86_64-pc-linux-gnu)" {9}, ir
+// CHK-PHASES-LIB: 11: backend, {10}, assembler, (device-openmp)
+// CHK-PHASES-LIB: 12: assembler, {11}, object, (device-openmp)
+// CHK-PHASES-LIB: 13: linker, {6, 12}, image, (device-openmp)
+// CHK-PHASES-LIB: 14: offload, "device-openmp (x86_64-pc-linux-gnu)" {13}, image
// CHK-PHASES-LIB: 15: input, "somelib", object, (device-openmp)
// CHK-PHASES-LIB: 16: input, "[[INPUT]]", c, (device-openmp)
// CHK-PHASES-LIB: 17: preprocessor, {16}, cpp-output, (device-openmp)
@@ -145,8 +148,11 @@
// CHK-PHASES-LIB: 20: backend, {19}, assembler, (device-openmp)
// CHK-PHASES-LIB: 21: assembler, {20}, object, (device-openmp)
// CHK-PHASES-LIB: 22: linker, {15, 21}, image, (device-openmp)
-// CHK-PHASES-LIB: 23: offload, "host-openmp (powerpc64-ibm-linux-gnu)" {6}, "device-openmp (x86_64-pc-linux-gnu)" {14}, "device-openmp (powerpc64-ibm-linux-gnu)" {22}, image
-
+// CHK-PHASES-LIB: 23: offload, "device-openmp (powerpc64-ibm-linux-gnu)" {22}, image
+// CHK-PHASES-LIB: 24: clang-offload-wrapper, {14, 23}, ir, (host-openmp)
+// CHK-PHASES-LIB: 25: backend, {24}, assembler, (host-openmp)
+// CHK-PHASES-LIB: 26: assembler, {25}, object, (host-openmp)
+// CHK-PHASES-LIB: 27: linker, {0, 5, 26}, image, (host-openmp)
/// ###########################################################################
@@ -165,21 +171,21 @@
// CHK-PHASES-FILES: 8: compiler, {7}, ir, (host-openmp)
// CHK-PHASES-FILES: 9: backend, {8}, assembler, (host-openmp)
// CHK-PHASES-FILES: 10: assembler, {9}, object, (host-openmp)
-// CHK-PHASES-FILES: 11: linker, {0, 5, 10}, image, (host-openmp)
-// CHK-PHASES-FILES: 12: input, "somelib", object, (device-openmp)
-// CHK-PHASES-FILES: 13: input, "[[INPUT1]]", c, (device-openmp)
-// CHK-PHASES-FILES: 14: preprocessor, {13}, cpp-output, (device-openmp)
-// CHK-PHASES-FILES: 15: compiler, {14}, ir, (device-openmp)
-// CHK-PHASES-FILES: 16: offload, "host-openmp (powerpc64-ibm-linux-gnu)" {3}, "device-openmp (x86_64-pc-linux-gnu)" {15}, ir
-// CHK-PHASES-FILES: 17: backend, {16}, assembler, (device-openmp)
-// CHK-PHASES-FILES: 18: assembler, {17}, object, (device-openmp)
-// CHK-PHASES-FILES: 19: input, "[[INPUT2]]", c, (device-openmp)
-// CHK-PHASES-FILES: 20: preprocessor, {19}, cpp-output, (device-openmp)
-// CHK-PHASES-FILES: 21: compiler, {20}, ir, (device-openmp)
-// CHK-PHASES-FILES: 22: offload, "host-openmp (powerpc64-ibm-linux-gnu)" {8}, "device-openmp (x86_64-pc-linux-gnu)" {21}, ir
-// CHK-PHASES-FILES: 23: backend, {22}, assembler, (device-openmp)
-// CHK-PHASES-FILES: 24: assembler, {23}, object, (device-openmp)
-// CHK-PHASES-FILES: 25: linker, {12, 18, 24}, image, (device-openmp)
+// CHK-PHASES-FILES: 11: input, "somelib", object, (device-openmp)
+// CHK-PHASES-FILES: 12: input, "[[INPUT1]]", c, (device-openmp)
+// CHK-PHASES-FILES: 13: preprocessor, {12}, cpp-output, (device-openmp)
+// CHK-PHASES-FILES: 14: compiler, {13}, ir, (device-openmp)
+// CHK-PHASES-FILES: 15: offload, "host-openmp (powerpc64-ibm-linux-gnu)" {3}, "device-openmp (x86_64-pc-linux-gnu)" {14}, ir
+// CHK-PHASES-FILES: 16: backend, {15}, assembler, (device-openmp)
+// CHK-PHASES-FILES: 17: assembler, {16}, object, (device-openmp)
+// CHK-PHASES-FILES: 18: input, "[[INPUT2]]", c, (device-openmp)
+// CHK-PHASES-FILES: 19: preprocessor, {18}, cpp-output, (device-openmp)
+// CHK-PHASES-FILES: 20: compiler, {19}, ir, (device-openmp)
+// CHK-PHASES-FILES: 21: offload, "host-openmp (powerpc64-ibm-linux-gnu)" {8}, "device-openmp (x86_64-pc-linux-gnu)" {20}, ir
+// CHK-PHASES-FILES: 22: backend, {21}, assembler, (device-openmp)
+// CHK-PHASES-FILES: 23: assembler, {22}, object, (device-openmp)
+// CHK-PHASES-FILES: 24: linker, {11, 17, 23}, image, (device-openmp)
+// CHK-PHASES-FILES: 25: offload, "device-openmp (x86_64-pc-linux-gnu)" {24}, image
// CHK-PHASES-FILES: 26: input, "somelib", object, (device-openmp)
// CHK-PHASES-FILES: 27: input, "[[INPUT1]]", c, (device-openmp)
// CHK-PHASES-FILES: 28: preprocessor, {27}, cpp-output, (device-openmp)
@@ -194,7 +200,11 @@
// CHK-PHASES-FILES: 37: backend, {36}, assembler, (device-openmp)
// CHK-PHASES-FILES: 38: assembler, {37}, object, (device-openmp)
// CHK-PHASES-FILES: 39: linker, {26, 32, 38}, image, (device-openmp)
-// CHK-PHASES-FILES: 40: offload, "host-openmp (powerpc64-ibm-linux-gnu)" {11}, "device-openmp (x86_64-pc-linux-gnu)" {25}, "device-openmp (powerpc64-ibm-linux-gnu)" {39}, image
+// CHK-PHASES-FILES: 40: offload, "device-openmp (powerpc64-ibm-linux-gnu)" {39}, image
+// CHK-PHASES-FILES: 41: clang-offload-wrapper, {25, 40}, ir, (host-openmp)
+// CHK-PHASES-FILES: 42: backend, {41}, assembler, (host-openmp)
+// CHK-PHASES-FILES: 43: assembler, {42}, object, (host-openmp)
+// CHK-PHASES-FILES: 44: linker, {0, 5, 10, 43}, image, (host-openmp)
/// ###########################################################################
@@ -216,15 +226,18 @@
// CHK-PHASES-WITH-CUDA: 11: offload, "host-cuda-openmp (powerpc64le-ibm-linux-gnu)" {2}, "device-cuda (nvptx64-nvidia-cuda)" {10}, ir
// CHK-PHASES-WITH-CUDA: 12: backend, {11}, assembler, (host-cuda-openmp)
// CHK-PHASES-WITH-CUDA: 13: assembler, {12}, object, (host-cuda-openmp)
-// CHK-PHASES-WITH-CUDA: 14: linker, {13}, image, (host-cuda-openmp)
-// CHK-PHASES-WITH-CUDA: 15: input, "[[INPUT]]", cuda, (device-openmp)
-// CHK-PHASES-WITH-CUDA: 16: preprocessor, {15}, cuda-cpp-output, (device-openmp)
-// CHK-PHASES-WITH-CUDA: 17: compiler, {16}, ir, (device-openmp)
-// CHK-PHASES-WITH-CUDA: 18: offload, "host-cuda-openmp (powerpc64le-ibm-linux-gnu)" {2}, "device-openmp (nvptx64-nvidia-cuda)" {17}, ir
-// CHK-PHASES-WITH-CUDA: 19: backend, {18}, assembler, (device-openmp)
-// CHK-PHASES-WITH-CUDA: 20: assembler, {19}, object, (device-openmp)
-// CHK-PHASES-WITH-CUDA: 21: linker, {20}, image, (device-openmp)
-// CHK-PHASES-WITH-CUDA: 22: offload, "host-cuda-openmp (powerpc64le-ibm-linux-gnu)" {14}, "device-openmp (nvptx64-nvidia-cuda)" {21}, image
+// CHK-PHASES-WITH-CUDA: 14: input, "[[INPUT]]", cuda, (device-openmp)
+// CHK-PHASES-WITH-CUDA: 15: preprocessor, {14}, cuda-cpp-output, (device-openmp)
+// CHK-PHASES-WITH-CUDA: 16: compiler, {15}, ir, (device-openmp)
+// CHK-PHASES-WITH-CUDA: 17: offload, "host-cuda-openmp (powerpc64le-ibm-linux-gnu)" {2}, "device-openmp (nvptx64-nvidia-cuda)" {16}, ir
+// CHK-PHASES-WITH-CUDA: 18: backend, {17}, assembler, (device-openmp)
+// CHK-PHASES-WITH-CUDA: 19: assembler, {18}, object, (device-openmp)
+// CHK-PHASES-WITH-CUDA: 20: linker, {19}, image, (device-openmp)
+// CHK-PHASES-WITH-CUDA: 21: offload, "device-openmp (nvptx64-nvidia-cuda)" {20}, image
+// CHK-PHASES-WITH-CUDA: 22: clang-offload-wrapper, {21}, ir, (host-cuda-openmp)
+// CHK-PHASES-WITH-CUDA: 23: backend, {22}, assembler, (host-cuda-openmp)
+// CHK-PHASES-WITH-CUDA: 24: assembler, {23}, object, (host-cuda-openmp)
+// CHK-PHASES-WITH-CUDA: 25: linker, {13, 24}, image, (host-cuda-openmp)
/// ###########################################################################
@@ -237,73 +250,31 @@
/// -fopenmp-host-ir-file-path: specifies the host IR file that can be loaded by
/// the target code generation to gather information about which declaration
/// really need to be emitted.
-/// We use -fopenmp-dump-offload-linker-script to dump the linker script and
-/// check its contents.
///
-// RUN: %clang -### -fopenmp=libomp -o %t.out -target powerpc64le-linux -fopenmp-targets=powerpc64le-ibm-linux-gnu,x86_64-pc-linux-gnu %s -fopenmp-dump-offload-linker-script -no-canonical-prefixes 2>&1 \
-// RUN: | FileCheck -check-prefix=CHK-COMMANDS -check-prefix=CHK-LKS -check-prefix=CHK-LKS-REG %s
-// RUN: %clang -### -fopenmp=libomp -o %t.out -target powerpc64le-linux -fopenmp-targets=powerpc64le-ibm-linux-gnu,x86_64-pc-linux-gnu %s -save-temps -fopenmp-dump-offload-linker-script -no-canonical-prefixes 2>&1 \
-// RUN: | FileCheck -check-prefix=CHK-COMMANDS-ST -check-prefix=CHK-LKS -check-prefix=CHK-LKS-ST %s
-
-// Make sure we are not dumping the script unless the user requested it.
// RUN: %clang -### -fopenmp=libomp -o %t.out -target powerpc64le-linux -fopenmp-targets=powerpc64le-ibm-linux-gnu,x86_64-pc-linux-gnu %s -no-canonical-prefixes 2>&1 \
-// RUN: | FileCheck -check-prefix=CHK-LKS-NODUMP %s
+// RUN: | FileCheck -check-prefix=CHK-COMMANDS %s
// RUN: %clang -### -fopenmp=libomp -o %t.out -target powerpc64le-linux -fopenmp-targets=powerpc64le-ibm-linux-gnu,x86_64-pc-linux-gnu %s -save-temps -no-canonical-prefixes 2>&1 \
-// RUN: | FileCheck -check-prefix=CHK-LKS-NODUMP %s
+// RUN: | FileCheck -check-prefix=CHK-COMMANDS-ST %s
//
-// Check the linker script contains what we expect.
-//
-// CHK-LKS: /*
-// CHK-LKS: OpenMP Offload Linker Script
-// CHK-LKS: *** Automatically generated by Clang ***
-// CHK-LKS-NODUMP-NOT: OpenMP Offload Linker Script.
-// CHK-LKS: */
-// CHK-LKS: TARGET(binary)
-// CHK-LKS-REG: INPUT([[T1BIN:.+\.out]])
-// CHK-LKS-REG: INPUT([[T2BIN:.+\.out]])
-// CHK-LKS-ST: INPUT([[T1BIN:.+\.out-openmp-powerpc64le-ibm-linux-gnu]])
-// CHK-LKS-ST: INPUT([[T2BIN:.+\.out-openmp-x86_64-pc-linux-gnu]])
-// CHK-LKS: SECTIONS
-// CHK-LKS: {
-// CHK-LKS: .omp_offloading.powerpc64le-ibm-linux-gnu :
-// CHK-LKS: ALIGN(0x10)
-// CHK-LKS: {
-// CHK-LKS: PROVIDE_HIDDEN(.omp_offloading.img_start.powerpc64le-ibm-linux-gnu = .);
-// CHK-LKS: [[T1BIN]]
-// CHK-LKS: PROVIDE_HIDDEN(.omp_offloading.img_end.powerpc64le-ibm-linux-gnu = .);
-// CHK-LKS: }
-// CHK-LKS: .omp_offloading.x86_64-pc-linux-gnu :
-// CHK-LKS: ALIGN(0x10)
-// CHK-LKS: {
-// CHK-LKS: PROVIDE_HIDDEN(.omp_offloading.img_start.x86_64-pc-linux-gnu = .);
-// CHK-LKS: [[T2BIN]]
-// CHK-LKS: PROVIDE_HIDDEN(.omp_offloading.img_end.x86_64-pc-linux-gnu = .);
-// CHK-LKS: }
-// CHK-LKS: .omp_offloading.entries :
-// CHK-LKS: ALIGN(0x10)
-// CHK-LKS: SUBALIGN(0x01)
-// CHK-LKS: {
-// CHK-LKS: PROVIDE_HIDDEN(.omp_offloading.entries_begin = .);
-// CHK-LKS: *(.omp_offloading.entries)
-// CHK-LKS: PROVIDE_HIDDEN(.omp_offloading.entries_end = .);
-// CHK-LKS: }
-// CHK-LKS: }
-// CHK-LKS: INSERT BEFORE .data
-
-//
-// Generate host BC file.
+// Generate host BC file and host object.
//
// CHK-COMMANDS: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" {{.*}}"-emit-llvm-bc"
// CHK-COMMANDS-SAME: "-fopenmp-targets=powerpc64le-ibm-linux-gnu,x86_64-pc-linux-gnu"
// CHK-COMMANDS-SAME: "-o" "
// CHK-COMMANDS-SAME: [[HOSTBC:[^\\/]+\.bc]]" "-x" "c" "
// CHK-COMMANDS-SAME: [[INPUT:[^\\/]+\.c]]"
+// CHK-COMMANDS: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" {{.*}}"-emit-obj" {{.*}}"-fopenmp" {{.*}}"-o" "
+// CHK-COMMANDS-SAME: [[HOSTOBJ:[^\\/]+\.o]]" "-x" "ir" "{{.*}}[[HOSTBC]]"
// CHK-COMMANDS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" {{.*}}"-E" {{.*}}"-fopenmp" {{.*}}"-o" "
// CHK-COMMANDS-ST-SAME: [[HOSTPP:[^\\/]+\.i]]" "-x" "c" "
// CHK-COMMANDS-ST-SAME: [[INPUT:[^\\/]+\.c]]"
// CHK-COMMANDS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" {{.*}}"-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-fopenmp-targets=powerpc64le-ibm-linux-gnu,x86_64-pc-linux-gnu" {{.*}}"-o" "
// CHK-COMMANDS-ST-SAME: [[HOSTBC:[^\\/]+\.bc]]" "-x" "cpp-output" "{{.*}}[[HOSTPP]]"
+// CHK-COMMANDS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" {{.*}}"-S" {{.*}}"-fopenmp" {{.*}}"-o" "
+// CHK-COMMANDS-ST-SAME: [[HOSTASM:[^\\/]+\.s]]" "-x" "ir" "{{.*}}[[HOSTBC]]"
+// CHK-COMMANDS-ST: clang{{.*}}" "-cc1as" "-triple" "powerpc64le-unknown-linux" "-filetype" "obj" {{.*}}"-o" "
+// CHK-COMMANDS-ST-SAME: [[HOSTOBJ:[^\\/]+\.o]]" "{{.*}}[[HOSTASM]]"
//
// Compile for the powerpc device.
@@ -343,21 +314,26 @@
// CHK-COMMANDS-ST-SAME: [[T2BIN:[^\\/]+\.out-openmp-x86_64-pc-linux-gnu]]" {{.*}}"{{.*}}[[T2OBJ]]"
//
-// Generate host object from the BC file and link using the linker script.
+// Create wrapper BC file and wrapper object.
//
+// CHK-COMMANDS: clang-offload-wrapper{{(\.exe)?}}" "-target" "powerpc64le-unknown-linux" {{.*}}"-o" "
+// CHK-COMMANDS-SAME: [[WRAPPERBC:[^\\/]+\.bc]]" "{{.*}}[[T1BIN]]" "{{.*}}[[T2BIN]]"
// CHK-COMMANDS: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" {{.*}}"-emit-obj" {{.*}}"-fopenmp" {{.*}}"-o" "
-// CHK-COMMANDS-SAME: [[HOSTOBJ:[^\\/]+\.o]]" "-x" "ir" "{{.*}}[[HOSTBC]]"
-// CHK-COMMANDS: ld{{(\.exe)?}}" {{.*}}"-o" "
-// CHK-COMMANDS-SAME: [[HOSTBIN:[^\\/]+\.out]]" {{.*}}"-lomptarget" {{.*}}"-T" "
-// CHK-COMMANDS-SAME: [[HOSTLK:[^\\/]+\.lk]]"
+// CHK-COMMANDS-SAME: [[WRAPPEROBJ:[^\\/]+\.o]]" "-x" "ir" "{{.*}}[[WRAPPERBC]]"
+// CHK-COMMANDS-ST: clang-offload-wrapper{{(\.exe)?}}" "-target" "powerpc64le-unknown-linux" {{.*}}"-o" "
+// CHK-COMMANDS-ST-SAME: [[WRAPPERBC:[^\\/]+\.bc]]" "{{.*}}[[T1BIN]]" "{{.*}}[[T2BIN]]"
// CHK-COMMANDS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" {{.*}}"-S" {{.*}}"-fopenmp" {{.*}}"-o" "
-// CHK-COMMANDS-ST-SAME: [[HOSTASM:[^\\/]+\.s]]" "-x" "ir" "{{.*}}[[HOSTBC]]"
+// CHK-COMMANDS-ST-SAME: [[WRAPPERASM:[^\\/]+\.s]]" "-x" "ir" "{{.*}}[[WRAPPERBC]]"
// CHK-COMMANDS-ST: clang{{.*}}" "-cc1as" "-triple" "powerpc64le-unknown-linux" "-filetype" "obj" {{.*}}"-o" "
-// CHK-COMMANDS-ST-SAME: [[HOSTOBJ:[^\\/]+\.o]]" "{{.*}}[[HOSTASM]]"
-// CHK-COMMANDS-ST: ld{{(\.exe)?}}" {{.*}}"-o" "
-// CHK-COMMANDS-ST-SAME: [[HOSTBIN:[^\\/]+\.out]]" {{.*}}"-lomptarget" {{.*}}"-T" "
-// CHK-COMMANDS-ST-SAME: [[HOSTLK:[^\\/]+\.lk]]"
+// CHK-COMMANDS-ST-SAME: [[WRAPPEROBJ:[^\\/]+\.o]]" "{{.*}}[[WRAPPERASM]]"
+//
+// Link host binary.
+//
+// CHK-COMMANDS: ld{{(\.exe)?}}" {{.*}}"-o" "
+// CHK-COMMANDS-SAME: [[HOSTBIN:[^\\/]+\.out]]" {{.*}}"{{.*}}[[HOSTOBJ]]" "{{.*}}[[WRAPPEROBJ]]" {{.*}}"-lomptarget"
+// CHK-COMMANDS-ST: ld{{(\.exe)?}}" {{.*}}"-o" "
+// CHK-COMMANDS-ST-SAME: [[HOSTBIN:[^\\/]+\.out]]" {{.*}}"{{.*}}[[HOSTOBJ]]" "{{.*}}[[WRAPPEROBJ]]" {{.*}}"-lomptarget"
/// ###########################################################################
@@ -399,20 +375,24 @@
// CHK-UBACTIONS: 3: compiler, {2}, ir, (host-openmp)
// CHK-UBACTIONS: 4: backend, {3}, assembler, (host-openmp)
// CHK-UBACTIONS: 5: assembler, {4}, object, (host-openmp)
-// CHK-UBACTIONS: 6: linker, {0, 5}, image, (host-openmp)
-// CHK-UBACTIONS: 7: input, "somelib", object, (device-openmp)
-// CHK-UBACTIONS: 8: compiler, {2}, ir, (device-openmp)
-// CHK-UBACTIONS: 9: offload, "host-openmp (powerpc64le-unknown-linux)" {3}, "device-openmp (powerpc64le-ibm-linux-gnu)" {8}, ir
-// CHK-UBACTIONS: 10: backend, {9}, assembler, (device-openmp)
-// CHK-UBACTIONS: 11: assembler, {10}, object, (device-openmp)
-// CHK-UBACTIONS: 12: linker, {7, 11}, image, (device-openmp)
+// CHK-UBACTIONS: 6: input, "somelib", object, (device-openmp)
+// CHK-UBACTIONS: 7: compiler, {2}, ir, (device-openmp)
+// CHK-UBACTIONS: 8: offload, "host-openmp (powerpc64le-unknown-linux)" {3}, "device-openmp (powerpc64le-ibm-linux-gnu)" {7}, ir
+// CHK-UBACTIONS: 9: backend, {8}, assembler, (device-openmp)
+// CHK-UBACTIONS: 10: assembler, {9}, object, (device-openmp)
+// CHK-UBACTIONS: 11: linker, {6, 10}, image, (device-openmp)
+// CHK-UBACTIONS: 12: offload, "device-openmp (powerpc64le-ibm-linux-gnu)" {11}, image
// CHK-UBACTIONS: 13: input, "somelib", object, (device-openmp)
// CHK-UBACTIONS: 14: compiler, {2}, ir, (device-openmp)
// CHK-UBACTIONS: 15: offload, "host-openmp (powerpc64le-unknown-linux)" {3}, "device-openmp (x86_64-pc-linux-gnu)" {14}, ir
// CHK-UBACTIONS: 16: backend, {15}, assembler, (device-openmp)
// CHK-UBACTIONS: 17: assembler, {16}, object, (device-openmp)
// CHK-UBACTIONS: 18: linker, {13, 17}, image, (device-openmp)
-// CHK-UBACTIONS: 19: offload, "host-openmp (powerpc64le-unknown-linux)" {6}, "device-openmp (powerpc64le-ibm-linux-gnu)" {12}, "device-openmp (x86_64-pc-linux-gnu)" {18}, image
+// CHK-UBACTIONS: 19: offload, "device-openmp (x86_64-pc-linux-gnu)" {18}, image
+// CHK-UBACTIONS: 20: clang-offload-wrapper, {12, 19}, ir, (host-openmp)
+// CHK-UBACTIONS: 21: backend, {20}, assembler, (host-openmp)
+// CHK-UBACTIONS: 22: assembler, {21}, object, (host-openmp)
+// CHK-UBACTIONS: 23: linker, {0, 5, 22}, image, (host-openmp)
/// ###########################################################################
@@ -515,6 +495,8 @@
// CHK-UBJOBS-SAME: [[T2PP:[^\\/]+\.i]]" "-unbundle"
// CHK-UBJOBS: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" {{.*}}"-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-fopenmp-targets=powerpc64le-ibm-linux-gnu,x86_64-pc-linux-gnu" {{.*}}"-o" "
// CHK-UBJOBS-SAME: [[HOSTBC:[^\\/]+\.bc]]" "-x" "cpp-output" "{{.*}}[[HOSTPP]]"
+// CHK-UBJOBS: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" {{.*}}"-emit-obj" {{.*}}"-fopenmp" {{.*}}"-o" "
+// CHK-UBJOBS-SAME: [[HOSTOBJ:[^\\/]+\.o]]" "-x" "ir" "{{.*}}[[HOSTBC]]"
// CHK-UBJOBS-ST: clang-offload-bundler{{.*}}" "-type=i" "-targets=host-powerpc64le-unknown-linux,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu" "-inputs=
// CHK-UBJOBS-ST-SAME: [[INPUT:[^\\/]+\.i]]" "-outputs=
// CHK-UBJOBS-ST-SAME: [[HOSTPP:[^\\/,]+\.i]],
@@ -522,6 +504,10 @@
// CHK-UBJOBS-ST-SAME: [[T2PP:[^\\/,]+\.i]]" "-unbundle"
// CHK-UBJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" {{.*}}"-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-fopenmp-targets=powerpc64le-ibm-linux-gnu,x86_64-pc-linux-gnu" {{.*}}"-o" "
// CHK-UBJOBS-ST-SAME: [[HOSTBC:[^\\/]+\.bc]]" "-x" "cpp-output" "{{.*}}[[HOSTPP]]"
+// CHK-UBJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" {{.*}}"-S" {{.*}}"-fopenmp" {{.*}}"-o" "
+// CHK-UBJOBS-ST-SAME: [[HOSTASM:[^\\/]+\.s]]" "-x" "ir" "{{.*}}[[HOSTBC]]"
+// CHK-UBJOBS-ST: clang{{.*}}" "-cc1as" "-triple" "powerpc64le-unknown-linux" "-filetype" "obj" {{.*}}"-o" "
+// CHK-UBJOBS-ST-SAME: [[HOSTOBJ:[^\\/]+\.o]]" "{{.*}}[[HOSTASM]]"
// Create target 1 object.
// CHK-UBJOBS: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le-unknown-linux" {{.*}}"-emit-obj" {{.*}}"-fopenmp" {{.*}}"-fopenmp-is-device" "-fopenmp-host-ir-file-path" "{{.*}}[[HOSTBC]]" {{.*}}"-o" "
@@ -551,19 +537,23 @@
// CHK-UBJOBS-ST: ld{{(\.exe)?}}" {{.*}}"-o" "
// CHK-UBJOBS-ST-SAME: [[T2BIN:[^\\/]+\.out-openmp-x86_64-pc-linux-gnu]]" {{.*}}"{{.*}}[[T2OBJ]]"
-// Create binary.
+// Create wrapper BC file and wrapper object.
+// CHK-UBJOBS: clang-offload-wrapper{{(\.exe)?}}" "-target" "powerpc64le-unknown-linux" {{.*}}"-o" "
+// CHK-UBJOBS-SAME: [[WRAPPERBC:[^\\/]+\.bc]]" "{{.*}}[[T1BIN]]" "{{.*}}[[T2BIN]]"
// CHK-UBJOBS: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" {{.*}}"-emit-obj" {{.*}}"-fopenmp" {{.*}}"-o" "
-// CHK-UBJOBS-SAME: [[HOSTOBJ:[^\\/]+\.o]]" "-x" "ir" "{{.*}}[[HOSTBC]]"
-// CHK-UBJOBS: ld{{(\.exe)?}}" {{.*}}"-o" "
-// CHK-UBJOBS-SAME: [[HOSTBIN:[^\\/]+\.out]]" {{.*}}"{{.*}}[[HOSTOBJ]]" {{.*}}"-T" "
-// CHK-UBJOBS-SAME: [[LKS:[^\\/]+\.lk]]"
+// CHK-UBJOBS-SAME: [[WRAPPEROBJ:[^\\/]+\.o]]" "-x" "ir" "{{.*}}[[WRAPPERBC]]"
+// CHK-UBJOBS-ST: clang-offload-wrapper{{(\.exe)?}}" "-target" "powerpc64le-unknown-linux" {{.*}}"-o" "
+// CHK-UBJOBS-ST-SAME: [[WRAPPERBC:[^\\/]+\.bc]]" "{{.*}}[[T1BIN]]" "{{.*}}[[T2BIN]]"
// CHK-UBJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" {{.*}}"-S" {{.*}}"-fopenmp" {{.*}}"-o" "
-// CHK-UBJOBS-ST-SAME: [[HOSTASM:[^\\/]+\.s]]" "-x" "ir" "{{.*}}[[HOSTBC]]"
+// CHK-UBJOBS-ST-SAME: [[WRAPPERASM:[^\\/]+\.s]]" "-x" "ir" "{{.*}}[[WRAPPERBC]]"
// CHK-UBJOBS-ST: clang{{.*}}" "-cc1as" "-triple" "powerpc64le-unknown-linux" "-filetype" "obj" {{.*}}"-o" "
-// CHK-UBJOBS-ST-SAME: [[HOSTOBJ:[^\\/]+\.o]]" "{{.*}}[[HOSTASM]]"
+// CHK-UBJOBS-ST-SAME: [[WRAPPEROBJ:[^\\/]+\.o]]" "{{.*}}[[WRAPPERASM]]"
+
+// Create binary.
+// CHK-UBJOBS: ld{{(\.exe)?}}" {{.*}}"-o" "
+// CHK-UBJOBS-SAME: [[HOSTBIN:[^\\/]+\.out]]" {{.*}}"{{.*}}[[HOSTOBJ]]" "{{.*}}[[WRAPPEROBJ]]"
// CHK-UBJOBS-ST: ld{{(\.exe)?}}" {{.*}}"-o" "
-// CHK-UBJOBS-ST-SAME: [[HOSTBIN:[^\\/]+\.out]]" {{.*}}"{{.*}}[[HOSTOBJ]]" {{.*}}"-T" "
-// CHK-UBJOBS-ST-SAME: [[LKS:[^\\/]+\.lk]]"
+// CHK-UBJOBS-ST-SAME: [[HOSTBIN:[^\\/]+\.out]]" {{.*}}"{{.*}}[[HOSTOBJ]]" "{{.*}}[[WRAPPEROBJ]]"
// Unbundle object file.
// CHK-UBJOBS2: clang-offload-bundler{{.*}}" "-type=o" "-targets=host-powerpc64le-unknown-linux,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu" "-inputs=
@@ -575,9 +565,12 @@
// CHK-UBJOBS2-SAME: [[T1BIN:[^\\/]+\.out]]" {{.*}}"{{.*}}[[T1OBJ]]"
// CHK-UBJOBS2: ld{{(\.exe)?}}" {{.*}}"-o" "
// CHK-UBJOBS2-SAME: [[T2BIN:[^\\/]+\.out]]" {{.*}}"{{.*}}[[T2OBJ]]"
+// CHK-UBJOBS2: clang-offload-wrapper{{(\.exe)?}}" "-target" "powerpc64le-unknown-linux" {{.*}}"-o" "
+// CHK-UBJOBS2-SAME: [[WRAPPERBC:[^\\/]+\.bc]]" "{{.*}}[[T1BIN]]" "{{.*}}[[T2BIN]]"
+// CHK-UBJOBS2: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" {{.*}}"-emit-obj" {{.*}}"-fopenmp" {{.*}}"-o" "
+// CHK-UBJOBS2-SAME: [[WRAPPEROBJ:[^\\/]+\.o]]" "-x" "ir" "{{.*}}[[WRAPPERBC]]"
// CHK-UBJOBS2: ld{{(\.exe)?}}" {{.*}}"-o" "
-// CHK-UBJOBS2-SAME: [[HOSTBIN:[^\\/]+\.out]]" {{.*}}"{{.*}}[[HOSTOBJ]]" {{.*}}"-T" "
-// CHK-UBJOBS2-SAME: [[LKS:[^\\/]+\.lk]]"
+// CHK-UBJOBS2-SAME: [[HOSTBIN:[^\\/]+\.out]]" {{.*}}"{{.*}}[[HOSTOBJ]]" "{{.*}}[[WRAPPEROBJ]]"
// CHK-UBJOBS2-ST-NOT: clang-offload-bundler{{.*}}in.so
// CHK-UBJOBS2-ST: clang-offload-bundler{{.*}}" "-type=o" "-targets=host-powerpc64le-unknown-linux,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu" "-inputs=
// CHK-UBJOBS2-ST-SAME: [[INPUT:[^\\/]+\.o]]" "-outputs=
@@ -589,9 +582,14 @@
// CHK-UBJOBS2-ST-SAME: [[T1BIN:[^\\/]+\.out-openmp-powerpc64le-ibm-linux-gnu]]" {{.*}}"{{.*}}[[T1OBJ]]"
// CHK-UBJOBS2-ST: ld{{(\.exe)?}}" {{.*}}"-o" "
// CHK-UBJOBS2-ST-SAME: [[T2BIN:[^\\/]+\.out-openmp-x86_64-pc-linux-gnu]]" {{.*}}"{{.*}}[[T2OBJ]]"
+// CHK-UBJOBS2-ST: clang-offload-wrapper{{(\.exe)?}}" "-target" "powerpc64le-unknown-linux" {{.*}}"-o" "
+// CHK-UBJOBS2-ST-SAME: [[WRAPPERBC:[^\\/]+\.bc]]" "{{.*}}[[T1BIN]]" "{{.*}}[[T2BIN]]"
+// CHK-UBJOBS2-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" {{.*}}"-S" {{.*}}"-fopenmp" {{.*}}"-o" "
+// CHK-UBJOBS2-ST-SAME: [[WRAPPERASM:[^\\/]+\.s]]" "-x" "ir" "{{.*}}[[WRAPPERBC]]"
+// CHK-UBJOBS2-ST: clang{{.*}}" "-cc1as" "-triple" "powerpc64le-unknown-linux" "-filetype" "obj" {{.*}}"-o" "
+// CHK-UBJOBS2-ST-SAME: [[WRAPPEROBJ:[^\\/]+\.o]]" "{{.*}}[[WRAPPERASM]]"
// CHK-UBJOBS2-ST: ld{{(\.exe)?}}" {{.*}}"-o" "
-// CHK-UBJOBS2-ST-SAME: [[HOSTBIN:[^\\/]+\.out]]" {{.*}}"{{.*}}[[HOSTOBJ]]" {{.*}}"-T" "
-// CHK-UBJOBS2-ST-SAME: [[LKS:[^\\/]+\.lk]]"
+// CHK-UBJOBS2-ST-SAME: [[HOSTBIN:[^\\/]+\.out]]" {{.*}}"{{.*}}[[HOSTOBJ]]" "{{.*}}[[WRAPPEROBJ]]"
/// ###########################################################################
diff --git a/src/llvm-project/clang/test/Driver/option-aliases.c b/src/llvm-project/clang/test/Driver/option-aliases.c
index 9cd9252..e50289c 100644
--- a/src/llvm-project/clang/test/Driver/option-aliases.c
+++ b/src/llvm-project/clang/test/Driver/option-aliases.c
@@ -3,12 +3,12 @@
// RUN: --param=FOO --output=FOO %s 2>&1 | \
// RUN: FileCheck %s
-// CHECK: "-cc1"
+// CHECK-LABEL: "-cc1"
// CHECK: "-E"
// CHECK: "-U" "FOO"
// CHECK: "-U" "BAR"
// CHECK: "-o" "option-aliases.i"
-// CHECK-NEXT: "-cc1"
+// CHECK-LABEL: "-cc1"
// CHECK: "-S"
// CHECK: "-o" "FOO"
diff --git a/src/llvm-project/clang/test/Driver/ppc-abi.c b/src/llvm-project/clang/test/Driver/ppc-abi.c
index fdcf45d..acc4981 100644
--- a/src/llvm-project/clang/test/Driver/ppc-abi.c
+++ b/src/llvm-project/clang/test/Driver/ppc-abi.c
@@ -24,16 +24,24 @@
// RUN: %clang -target powerpc64le-unknown-linux-gnu %s -### -o %t.o 2>&1 \
// RUN: -mabi=altivec | FileCheck -check-prefix=CHECK-ELFv2 %s
-// CHECK-ELFv1: "-mrelocation-model" "pic" "-pic-level" "2"
+// RUN: %clang -target powerpc64-unknown-freebsd11 %s -### 2>&1 | FileCheck --check-prefix=CHECK-ELFv1 %s
+// RUN: %clang -target powerpc64-unknown-freebsd12 %s -### 2>&1 | FileCheck --check-prefix=CHECK-ELFv1 %s
+// RUN: %clang -target powerpc64-unknown-freebsd13 %s -### 2>&1 | FileCheck --check-prefix=CHECK-ELFv2-BE %s
+// RUN: %clang -target powerpc64-unknown-freebsd14 %s -### 2>&1 | FileCheck --check-prefix=CHECK-ELFv2-BE %s
+// RUN: %clang -target powerpc64-linux-musl %s -### 2>&1 | FileCheck --check-prefix=CHECK-ELFv2-BE-PIE %s
+
+// CHECK-ELFv1: "-mrelocation-model" "static"
// CHECK-ELFv1: "-target-abi" "elfv1"
// CHECK-ELFv1-LE: "-mrelocation-model" "static"
// CHECK-ELFv1-LE: "-target-abi" "elfv1"
-// CHECK-ELFv1-QPX: "-mrelocation-model" "pic" "-pic-level" "2"
+// CHECK-ELFv1-QPX: "-mrelocation-model" "static"
// CHECK-ELFv1-QPX: "-target-abi" "elfv1-qpx"
// CHECK-ELFv2: "-mrelocation-model" "static"
// CHECK-ELFv2: "-target-abi" "elfv2"
-// CHECK-ELFv2-BE: "-mrelocation-model" "pic" "-pic-level" "2"
+// CHECK-ELFv2-BE: "-mrelocation-model" "static"
// CHECK-ELFv2-BE: "-target-abi" "elfv2"
+// CHECK-ELFv2-BE-PIE: "-mrelocation-model" "pic" "-pic-level" "2" "-pic-is-pie"
+// CHECK-ELFv2-BE-PIE: "-target-abi" "elfv2"
// RUN: %clang -fPIC -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK-ELFv1-PIC %s
diff --git a/src/llvm-project/clang/test/Driver/ppc-features.cpp b/src/llvm-project/clang/test/Driver/ppc-features.cpp
index 1cb6cee..d21774c 100644
--- a/src/llvm-project/clang/test/Driver/ppc-features.cpp
+++ b/src/llvm-project/clang/test/Driver/ppc-features.cpp
@@ -168,6 +168,12 @@
// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-invariant-function-descriptors -minvariant-function-descriptors -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-INVFUNCDESC %s
// CHECK-INVFUNCDESC: "-target-feature" "+invariant-function-descriptors"
+// RUN: %clang -target powerpc %s -mno-spe -mspe -c -### 2>&1 | FileCheck -check-prefix=CHECK-SPE %s
+// RUN: %clang -target powerpcspe %s -c -### 2>&1 | FileCheck -check-prefix=CHECK-SPE %s
+// RUN: %clang -target powerpcspe %s -mno-spe -c -### 2>&1 | FileCheck -check-prefix=CHECK-NOSPE %s
+// CHECK-SPE: "-target-feature" "+spe"
+// CHECK-NOSPE: "-target-feature" "-spe"
+
// Assembler features
// RUN: %clang -target powerpc64-unknown-linux-gnu %s -### -o %t.o -no-integrated-as 2>&1 | FileCheck -check-prefix=CHECK_BE_AS_ARGS %s
// CHECK_BE_AS_ARGS: "-mppc64"
diff --git a/src/llvm-project/clang/test/Driver/print-libgcc-file-name-clangrt.c b/src/llvm-project/clang/test/Driver/print-libgcc-file-name-clangrt.c
index ce941dc..74a88e5 100644
--- a/src/llvm-project/clang/test/Driver/print-libgcc-file-name-clangrt.c
+++ b/src/llvm-project/clang/test/Driver/print-libgcc-file-name-clangrt.c
@@ -2,11 +2,13 @@
// RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name 2>&1 \
// RUN: --target=x86_64-pc-linux \
+// RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \
// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-X8664 %s
// CHECK-CLANGRT-X8664: libclang_rt.builtins-x86_64.a
// RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name 2>&1 \
// RUN: --target=i386-pc-linux \
+// RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \
// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-I386 %s
// CHECK-CLANGRT-I386: libclang_rt.builtins-i386.a
@@ -14,24 +16,29 @@
//
// RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name 2>&1 \
// RUN: --target=i686-pc-linux \
+// RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \
// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-I386 %s
// RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name 2>&1 \
// RUN: --target=arm-linux-gnueabi \
+// RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \
// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-ARM %s
// CHECK-CLANGRT-ARM: libclang_rt.builtins-arm.a
// RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name 2>&1 \
// RUN: --target=arm-linux-androideabi \
+// RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \
// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-ARM-ANDROID %s
// CHECK-CLANGRT-ARM-ANDROID: libclang_rt.builtins-arm-android.a
// RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name 2>&1 \
// RUN: --target=arm-linux-gnueabihf \
+// RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \
// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-ARMHF %s
// CHECK-CLANGRT-ARMHF: libclang_rt.builtins-armhf.a
// RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name 2>&1 \
// RUN: --target=arm-linux-gnueabi -mfloat-abi=hard \
+// RUN: -resource-dir=%S/Inputs/resource_dir_with_arch_subdir \
// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-ARM-ABI %s
// CHECK-CLANGRT-ARM-ABI: libclang_rt.builtins-armhf.a
diff --git a/src/llvm-project/clang/test/Driver/rewrite-legacy-objc.m b/src/llvm-project/clang/test/Driver/rewrite-legacy-objc.m
index 6461aec..dc92dd4 100644
--- a/src/llvm-project/clang/test/Driver/rewrite-legacy-objc.m
+++ b/src/llvm-project/clang/test/Driver/rewrite-legacy-objc.m
@@ -3,11 +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" "-fblocks" "-fencode-extended-block-signature" "-fregister-global-dtors-with-atexit" "-fobjc-runtime=macosx-fragile" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fexceptions" "-fmax-type-align=16" "-fdiagnostics-show-option"
+// TEST0: "-fmessage-length" "0" "-stack-protector" "1" "-fblocks" "-fencode-extended-block-signature" "-fregister-global-dtors-with-atexit" "-fgnuc-version=4.2.1" "-fobjc-runtime=macosx-fragile" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fexceptions" "-fmax-type-align=16" "-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" "-fblocks" "-fencode-extended-block-signature" "-fregister-global-dtors-with-atexit" "-fobjc-runtime=macosx-fragile" "-fobjc-subscripting-legacy-runtime" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fmax-type-align=16" "-fdiagnostics-show-option"
-// TEST2: "-fmessage-length" "0" "-stack-protector" "1" "-fblocks" "-fencode-extended-block-signature" "-fregister-global-dtors-with-atexit" "-fobjc-runtime=macosx-fragile" "-fobjc-subscripting-legacy-runtime" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fmax-type-align=16" "-fdiagnostics-show-option"
+// TEST1: "-fmessage-length" "0" "-stack-protector" "1" "-fblocks" "-fencode-extended-block-signature" "-fregister-global-dtors-with-atexit" "-fgnuc-version=4.2.1" "-fobjc-runtime=macosx-fragile" "-fobjc-subscripting-legacy-runtime" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fmax-type-align=16" "-fdiagnostics-show-option"
+// TEST2: "-fmessage-length" "0" "-stack-protector" "1" "-fblocks" "-fencode-extended-block-signature" "-fregister-global-dtors-with-atexit" "-fgnuc-version=4.2.1" "-fobjc-runtime=macosx-fragile" "-fobjc-subscripting-legacy-runtime" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fmax-type-align=16" "-fdiagnostics-show-option"
diff --git a/src/llvm-project/clang/test/Driver/rewrite-map-in-diagnostics.c b/src/llvm-project/clang/test/Driver/rewrite-map-in-diagnostics.c
index 4aea0ec..ef598ff 100644
--- a/src/llvm-project/clang/test/Driver/rewrite-map-in-diagnostics.c
+++ b/src/llvm-project/clang/test/Driver/rewrite-map-in-diagnostics.c
@@ -1,7 +1,7 @@
// RUN: rm -rf "%t"
// RUN: mkdir -p "%t"
-// RUN: not env TMPDIR="%t" TEMP="%t" TMP="%t" RC_DEBUG_OPTION=1 \
-// RUN: %clang -fsyntax-only -frewrite-map-file %p/Inputs/rewrite.map %s 2>&1 \
+// RUN: env TMPDIR="%t" TEMP="%t" TMP="%t" RC_DEBUG_OPTION=1 \
+// RUN: not %clang -fsyntax-only -frewrite-map-file %p/Inputs/rewrite.map %s 2>&1 \
// RUN: | FileCheck %s
#pragma clang __debug parser_crash
@@ -9,6 +9,3 @@
// CHECK: note: diagnostic msg: {{.*}}rewrite.map
// REQUIRES: crash-recovery
-
-// FIXME: This doesn't fail on "env clang". Investigating.
-// REQUIRES: shell
diff --git a/src/llvm-project/clang/test/Driver/rewrite-objc.m b/src/llvm-project/clang/test/Driver/rewrite-objc.m
index 1c6dbcc..b040629 100644
--- a/src/llvm-project/clang/test/Driver/rewrite-objc.m
+++ b/src/llvm-project/clang/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" "-fblocks" "-fencode-extended-block-signature" "-fregister-global-dtors-with-atexit" "-fobjc-runtime=macosx" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fexceptions" "-fmax-type-align=16" "-fdiagnostics-show-option"
+// TEST0: "-fmessage-length" "0" "-stack-protector" "1" "-fblocks" "-fencode-extended-block-signature" "-fregister-global-dtors-with-atexit" "-fgnuc-version=4.2.1" "-fobjc-runtime=macosx" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fexceptions" "-fmax-type-align=16" "-fdiagnostics-show-option"
diff --git a/src/llvm-project/clang/test/Driver/riscv-abi.c b/src/llvm-project/clang/test/Driver/riscv-abi.c
index 1a4c7ed..ef3913e 100644
--- a/src/llvm-project/clang/test/Driver/riscv-abi.c
+++ b/src/llvm-project/clang/test/Driver/riscv-abi.c
@@ -16,6 +16,10 @@
// RUN: %clang -target riscv32-unknown-elf %s -### -o %t.o -march=rv32ifd -mabi=ilp32d 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK-ILP32D %s
+// RUN: %clang -target riscv32-unknown-linux-gnu %s -### -o %t.o 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-ILP32D %s
+// RUN: %clang -target riscv32-unknown-linux-gnu -x assembler %s -### -o %t.o 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-ILP32D %s
// CHECK-ILP32D: "-target-abi" "ilp32d"
@@ -42,6 +46,10 @@
// RUN: %clang -target riscv64-unknown-elf %s -### -o %t.o -march=rv64d -mabi=lp64d 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK-LP64D %s
+// RUN: %clang -target riscv64-unknown-linux-gnu %s -### -o %t.o 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-LP64D %s
+// RUN: %clang -target riscv64-unknown-linux-gnu -x assembler %s -### -o %t.o 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-LP64D %s
// CHECK-LP64D: "-target-abi" "lp64d"
diff --git a/src/llvm-project/clang/test/Driver/riscv-arch.c b/src/llvm-project/clang/test/Driver/riscv-arch.c
index 5329fe8..3e1be9a 100644
--- a/src/llvm-project/clang/test/Driver/riscv-arch.c
+++ b/src/llvm-project/clang/test/Driver/riscv-arch.c
@@ -315,3 +315,15 @@
// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32-X-S-SX-INVAL %s
// RV32-X-S-SX-INVAL: error: invalid arch name 'rv32ixabc_sdef_sxghi',
// RV32-X-S-SX-INVAL: unsupported non-standard user-level extension 'xabc'
+
+// RUN: %clang -target riscv32-unknown-elf -march=rv32i -### %s \
+// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32-TARGET %s
+// RUN: %clang -target riscv64-unknown-elf -march=rv32i -### %s \
+// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32-TARGET %s
+// RV32-TARGET: "-triple" "riscv32-unknown-unknown-elf"
+
+// RUN: %clang -target riscv32-unknown-elf -march=rv64i -### %s \
+// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV64-TARGET %s
+// RUN: %clang -target riscv64-unknown-elf -march=rv64i -### %s \
+// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV64-TARGET %s
+// RV64-TARGET: "-triple" "riscv64-unknown-unknown-elf"
diff --git a/src/llvm-project/clang/test/Driver/riscv-features.c b/src/llvm-project/clang/test/Driver/riscv-features.c
index 44fb59b..2f2ae51 100644
--- a/src/llvm-project/clang/test/Driver/riscv-features.c
+++ b/src/llvm-project/clang/test/Driver/riscv-features.c
@@ -18,4 +18,15 @@
// SAVE-RESTORE: warning: the clang compiler does not support '-msave-restore'
// NO-SAVE-RESTORE-NOT: warning: the clang compiler does not support
-// DEFAULT-NOT: warning: the clang compiler does not support
\ No newline at end of file
+// DEFAULT-NOT: warning: the clang compiler does not support
+
+// RUN: %clang -target riscv32-linux -### %s -fsyntax-only 2>&1 \
+// RUN: | FileCheck %s -check-prefix=DEFAULT-LINUX
+// RUN: %clang -target riscv64-linux -### %s -fsyntax-only 2>&1 \
+// RUN: | FileCheck %s -check-prefix=DEFAULT-LINUX
+
+// DEFAULT-LINUX: "-target-feature" "+m"
+// DEFAULT-LINUX-SAME: "-target-feature" "+a"
+// DEFAULT-LINUX-SAME: "-target-feature" "+f"
+// DEFAULT-LINUX-SAME: "-target-feature" "+d"
+// DEFAULT-LINUX-SAME: "-target-feature" "+c"
diff --git a/src/llvm-project/clang/test/Driver/riscv-fixed-x-register.c b/src/llvm-project/clang/test/Driver/riscv-fixed-x-register.c
new file mode 100644
index 0000000..79df4d9
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/riscv-fixed-x-register.c
@@ -0,0 +1,341 @@
+// RUN: %clang -target riscv32 -ffixed-x1 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X1 < %t %s
+// RUN: %clang -target riscv64 -ffixed-x1 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X1 < %t %s
+// CHECK-FIXED-X1: "-target-feature" "+reserve-x1"
+
+// RUN: %clang -target riscv32 -ffixed-x2 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X2 < %t %s
+// RUN: %clang -target riscv64 -ffixed-x2 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X2 < %t %s
+// CHECK-FIXED-X2: "-target-feature" "+reserve-x2"
+
+// RUN: %clang -target riscv32 -ffixed-x3 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X3 < %t %s
+// RUN: %clang -target riscv64 -ffixed-x3 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X3 < %t %s
+// CHECK-FIXED-X3: "-target-feature" "+reserve-x3"
+
+// RUN: %clang -target riscv32 -ffixed-x4 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X4 < %t %s
+// RUN: %clang -target riscv64 -ffixed-x4 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X4 < %t %s
+// CHECK-FIXED-X4: "-target-feature" "+reserve-x4"
+
+// RUN: %clang -target riscv32 -ffixed-x5 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X5 < %t %s
+// RUN: %clang -target riscv64 -ffixed-x5 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X5 < %t %s
+// CHECK-FIXED-X5: "-target-feature" "+reserve-x5"
+
+// RUN: %clang -target riscv32 -ffixed-x6 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X6 < %t %s
+// RUN: %clang -target riscv64 -ffixed-x6 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X6 < %t %s
+// CHECK-FIXED-X6: "-target-feature" "+reserve-x6"
+
+// RUN: %clang -target riscv32 -ffixed-x7 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X7 < %t %s
+// RUN: %clang -target riscv64 -ffixed-x7 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X7 < %t %s
+// CHECK-FIXED-X7: "-target-feature" "+reserve-x7"
+
+// RUN: %clang -target riscv32 -ffixed-x8 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X8 < %t %s
+// RUN: %clang -target riscv64 -ffixed-x8 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X8 < %t %s
+// CHECK-FIXED-X8: "-target-feature" "+reserve-x8"
+
+// RUN: %clang -target riscv32 -ffixed-x9 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X9 < %t %s
+// RUN: %clang -target riscv64 -ffixed-x9 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X9 < %t %s
+// CHECK-FIXED-X9: "-target-feature" "+reserve-x9"
+
+// RUN: %clang -target riscv32 -ffixed-x10 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X10 < %t %s
+// RUN: %clang -target riscv64 -ffixed-x10 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X10 < %t %s
+// CHECK-FIXED-X10: "-target-feature" "+reserve-x10"
+
+// RUN: %clang -target riscv32 -ffixed-x11 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X11 < %t %s
+// RUN: %clang -target riscv64 -ffixed-x11 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X11 < %t %s
+// CHECK-FIXED-X11: "-target-feature" "+reserve-x11"
+
+// RUN: %clang -target riscv32 -ffixed-x12 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X12 < %t %s
+// RUN: %clang -target riscv64 -ffixed-x12 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X12 < %t %s
+// CHECK-FIXED-X12: "-target-feature" "+reserve-x12"
+
+// RUN: %clang -target riscv32 -ffixed-x13 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X13 < %t %s
+// RUN: %clang -target riscv64 -ffixed-x13 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X13 < %t %s
+// CHECK-FIXED-X13: "-target-feature" "+reserve-x13"
+
+// RUN: %clang -target riscv32 -ffixed-x14 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X14 < %t %s
+// RUN: %clang -target riscv64 -ffixed-x14 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X14 < %t %s
+// CHECK-FIXED-X14: "-target-feature" "+reserve-x14"
+
+// RUN: %clang -target riscv32 -ffixed-x15 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X15 < %t %s
+// RUN: %clang -target riscv64 -ffixed-x15 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X15 < %t %s
+// CHECK-FIXED-X15: "-target-feature" "+reserve-x15"
+
+// RUN: %clang -target riscv32 -ffixed-x16 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X16 < %t %s
+// RUN: %clang -target riscv64 -ffixed-x16 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X16 < %t %s
+// CHECK-FIXED-X16: "-target-feature" "+reserve-x16"
+
+// RUN: %clang -target riscv32 -ffixed-x17 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X17 < %t %s
+// RUN: %clang -target riscv64 -ffixed-x17 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X17 < %t %s
+// CHECK-FIXED-X17: "-target-feature" "+reserve-x17"
+
+// RUN: %clang -target riscv32 -ffixed-x18 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X18 < %t %s
+// RUN: %clang -target riscv64 -ffixed-x18 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X18 < %t %s
+// CHECK-FIXED-X18: "-target-feature" "+reserve-x18"
+
+// RUN: %clang -target riscv32 -ffixed-x19 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X19 < %t %s
+// RUN: %clang -target riscv64 -ffixed-x19 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X19 < %t %s
+// CHECK-FIXED-X19: "-target-feature" "+reserve-x19"
+
+// RUN: %clang -target riscv32 -ffixed-x20 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X20 < %t %s
+// RUN: %clang -target riscv64 -ffixed-x20 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X20 < %t %s
+// CHECK-FIXED-X20: "-target-feature" "+reserve-x20"
+
+// RUN: %clang -target riscv32 -ffixed-x21 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X21 < %t %s
+// RUN: %clang -target riscv64 -ffixed-x21 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X21 < %t %s
+// CHECK-FIXED-X21: "-target-feature" "+reserve-x21"
+
+// RUN: %clang -target riscv32 -ffixed-x22 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X22 < %t %s
+// RUN: %clang -target riscv64 -ffixed-x22 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X22 < %t %s
+// CHECK-FIXED-X22: "-target-feature" "+reserve-x22"
+
+// RUN: %clang -target riscv32 -ffixed-x23 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X23 < %t %s
+// RUN: %clang -target riscv64 -ffixed-x23 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X23 < %t %s
+// CHECK-FIXED-X23: "-target-feature" "+reserve-x23"
+
+// RUN: %clang -target riscv32 -ffixed-x24 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X24 < %t %s
+// RUN: %clang -target riscv64 -ffixed-x24 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X24 < %t %s
+// CHECK-FIXED-X24: "-target-feature" "+reserve-x24"
+
+// RUN: %clang -target riscv32 -ffixed-x25 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X25 < %t %s
+// RUN: %clang -target riscv64 -ffixed-x25 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X25 < %t %s
+// CHECK-FIXED-X25: "-target-feature" "+reserve-x25"
+
+// RUN: %clang -target riscv32 -ffixed-x26 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X26 < %t %s
+// RUN: %clang -target riscv64 -ffixed-x26 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X26 < %t %s
+// CHECK-FIXED-X26: "-target-feature" "+reserve-x26"
+
+// RUN: %clang -target riscv32 -ffixed-x27 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X27 < %t %s
+// RUN: %clang -target riscv64 -ffixed-x27 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X27 < %t %s
+// CHECK-FIXED-X27: "-target-feature" "+reserve-x27"
+
+// RUN: %clang -target riscv32 -ffixed-x28 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X28 < %t %s
+// RUN: %clang -target riscv64 -ffixed-x28 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X28 < %t %s
+// CHECK-FIXED-X28: "-target-feature" "+reserve-x28"
+
+// RUN: %clang -target riscv32 -ffixed-x29 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X29 < %t %s
+// RUN: %clang -target riscv64 -ffixed-x29 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X29 < %t %s
+// CHECK-FIXED-X29: "-target-feature" "+reserve-x29"
+
+// RUN: %clang -target riscv32 -ffixed-x30 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X30 < %t %s
+// RUN: %clang -target riscv64 -ffixed-x30 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X30 < %t %s
+// CHECK-FIXED-X30: "-target-feature" "+reserve-x30"
+
+// RUN: %clang -target riscv32 -ffixed-x31 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X31 < %t %s
+// RUN: %clang -target riscv64 -ffixed-x31 -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-FIXED-X31 < %t %s
+// CHECK-FIXED-X31: "-target-feature" "+reserve-x31"
+
+// Test multiple of reserve-x# options together.
+// RUN: %clang -target riscv32 \
+// RUN: -ffixed-x1 \
+// RUN: -ffixed-x2 \
+// RUN: -ffixed-x18 \
+// RUN: -### %s 2> %t
+// RUN: FileCheck \
+// RUN: --check-prefix=CHECK-FIXED-X1 \
+// RUN: --check-prefix=CHECK-FIXED-X2 \
+// RUN: --check-prefix=CHECK-FIXED-X18 \
+// RUN: < %t %s
+// RUN: %clang -target riscv64 \
+// RUN: -ffixed-x1 \
+// RUN: -ffixed-x2 \
+// RUN: -ffixed-x18 \
+// RUN: -### %s 2> %t
+// RUN: FileCheck \
+// RUN: --check-prefix=CHECK-FIXED-X1 \
+// RUN: --check-prefix=CHECK-FIXED-X2 \
+// RUN: --check-prefix=CHECK-FIXED-X18 \
+// RUN: < %t %s
+
+// Test all reserve-x# options together.
+// RUN: %clang -target riscv32 \
+// RUN: -ffixed-x1 \
+// RUN: -ffixed-x2 \
+// RUN: -ffixed-x3 \
+// RUN: -ffixed-x4 \
+// RUN: -ffixed-x5 \
+// RUN: -ffixed-x6 \
+// RUN: -ffixed-x7 \
+// RUN: -ffixed-x8 \
+// RUN: -ffixed-x9 \
+// RUN: -ffixed-x10 \
+// RUN: -ffixed-x11 \
+// RUN: -ffixed-x12 \
+// RUN: -ffixed-x13 \
+// RUN: -ffixed-x14 \
+// RUN: -ffixed-x15 \
+// RUN: -ffixed-x16 \
+// RUN: -ffixed-x17 \
+// RUN: -ffixed-x18 \
+// RUN: -ffixed-x19 \
+// RUN: -ffixed-x20 \
+// RUN: -ffixed-x21 \
+// RUN: -ffixed-x22 \
+// RUN: -ffixed-x23 \
+// RUN: -ffixed-x24 \
+// RUN: -ffixed-x25 \
+// RUN: -ffixed-x26 \
+// RUN: -ffixed-x27 \
+// RUN: -ffixed-x28 \
+// RUN: -ffixed-x29 \
+// RUN: -ffixed-x30 \
+// RUN: -ffixed-x31 \
+// RUN: -### %s 2> %t
+// RUN: FileCheck \
+// RUN: --check-prefix=CHECK-FIXED-X1 \
+// RUN: --check-prefix=CHECK-FIXED-X2 \
+// RUN: --check-prefix=CHECK-FIXED-X3 \
+// RUN: --check-prefix=CHECK-FIXED-X4 \
+// RUN: --check-prefix=CHECK-FIXED-X5 \
+// RUN: --check-prefix=CHECK-FIXED-X6 \
+// RUN: --check-prefix=CHECK-FIXED-X7 \
+// RUN: --check-prefix=CHECK-FIXED-X8 \
+// RUN: --check-prefix=CHECK-FIXED-X9 \
+// RUN: --check-prefix=CHECK-FIXED-X10 \
+// RUN: --check-prefix=CHECK-FIXED-X11 \
+// RUN: --check-prefix=CHECK-FIXED-X12 \
+// RUN: --check-prefix=CHECK-FIXED-X13 \
+// RUN: --check-prefix=CHECK-FIXED-X14 \
+// RUN: --check-prefix=CHECK-FIXED-X15 \
+// RUN: --check-prefix=CHECK-FIXED-X16 \
+// RUN: --check-prefix=CHECK-FIXED-X17 \
+// RUN: --check-prefix=CHECK-FIXED-X18 \
+// RUN: --check-prefix=CHECK-FIXED-X19 \
+// RUN: --check-prefix=CHECK-FIXED-X20 \
+// RUN: --check-prefix=CHECK-FIXED-X21 \
+// RUN: --check-prefix=CHECK-FIXED-X22 \
+// RUN: --check-prefix=CHECK-FIXED-X23 \
+// RUN: --check-prefix=CHECK-FIXED-X24 \
+// RUN: --check-prefix=CHECK-FIXED-X25 \
+// RUN: --check-prefix=CHECK-FIXED-X26 \
+// RUN: --check-prefix=CHECK-FIXED-X27 \
+// RUN: --check-prefix=CHECK-FIXED-X28 \
+// RUN: --check-prefix=CHECK-FIXED-X29 \
+// RUN: --check-prefix=CHECK-FIXED-X30 \
+// RUN: --check-prefix=CHECK-FIXED-X31 \
+// RUN: < %t %s
+// RUN: %clang -target riscv64 \
+// RUN: -ffixed-x1 \
+// RUN: -ffixed-x2 \
+// RUN: -ffixed-x3 \
+// RUN: -ffixed-x4 \
+// RUN: -ffixed-x5 \
+// RUN: -ffixed-x6 \
+// RUN: -ffixed-x7 \
+// RUN: -ffixed-x8 \
+// RUN: -ffixed-x9 \
+// RUN: -ffixed-x10 \
+// RUN: -ffixed-x11 \
+// RUN: -ffixed-x12 \
+// RUN: -ffixed-x13 \
+// RUN: -ffixed-x14 \
+// RUN: -ffixed-x15 \
+// RUN: -ffixed-x16 \
+// RUN: -ffixed-x17 \
+// RUN: -ffixed-x18 \
+// RUN: -ffixed-x19 \
+// RUN: -ffixed-x20 \
+// RUN: -ffixed-x21 \
+// RUN: -ffixed-x22 \
+// RUN: -ffixed-x23 \
+// RUN: -ffixed-x24 \
+// RUN: -ffixed-x25 \
+// RUN: -ffixed-x26 \
+// RUN: -ffixed-x27 \
+// RUN: -ffixed-x28 \
+// RUN: -ffixed-x29 \
+// RUN: -ffixed-x30 \
+// RUN: -ffixed-x31 \
+// RUN: -### %s 2> %t
+// RUN: FileCheck \
+// RUN: --check-prefix=CHECK-FIXED-X1 \
+// RUN: --check-prefix=CHECK-FIXED-X2 \
+// RUN: --check-prefix=CHECK-FIXED-X3 \
+// RUN: --check-prefix=CHECK-FIXED-X4 \
+// RUN: --check-prefix=CHECK-FIXED-X5 \
+// RUN: --check-prefix=CHECK-FIXED-X6 \
+// RUN: --check-prefix=CHECK-FIXED-X7 \
+// RUN: --check-prefix=CHECK-FIXED-X8 \
+// RUN: --check-prefix=CHECK-FIXED-X9 \
+// RUN: --check-prefix=CHECK-FIXED-X10 \
+// RUN: --check-prefix=CHECK-FIXED-X11 \
+// RUN: --check-prefix=CHECK-FIXED-X12 \
+// RUN: --check-prefix=CHECK-FIXED-X13 \
+// RUN: --check-prefix=CHECK-FIXED-X14 \
+// RUN: --check-prefix=CHECK-FIXED-X15 \
+// RUN: --check-prefix=CHECK-FIXED-X16 \
+// RUN: --check-prefix=CHECK-FIXED-X17 \
+// RUN: --check-prefix=CHECK-FIXED-X18 \
+// RUN: --check-prefix=CHECK-FIXED-X19 \
+// RUN: --check-prefix=CHECK-FIXED-X20 \
+// RUN: --check-prefix=CHECK-FIXED-X21 \
+// RUN: --check-prefix=CHECK-FIXED-X22 \
+// RUN: --check-prefix=CHECK-FIXED-X23 \
+// RUN: --check-prefix=CHECK-FIXED-X24 \
+// RUN: --check-prefix=CHECK-FIXED-X25 \
+// RUN: --check-prefix=CHECK-FIXED-X26 \
+// RUN: --check-prefix=CHECK-FIXED-X27 \
+// RUN: --check-prefix=CHECK-FIXED-X28 \
+// RUN: --check-prefix=CHECK-FIXED-X29 \
+// RUN: --check-prefix=CHECK-FIXED-X30 \
+// RUN: --check-prefix=CHECK-FIXED-X31 \
+// RUN: < %t %s
diff --git a/src/llvm-project/clang/test/Driver/riscv-gnutools.c b/src/llvm-project/clang/test/Driver/riscv-gnutools.c
index afcb505..b5ea737 100644
--- a/src/llvm-project/clang/test/Driver/riscv-gnutools.c
+++ b/src/llvm-project/clang/test/Driver/riscv-gnutools.c
@@ -1,19 +1,40 @@
// Check gnutools are invoked with propagated values for -mabi and -march.
+//
+// This test also checks the default -march/-mabi for certain targets.
-// RUN: %clang -target riscv32 -fno-integrated-as %s -### -c \
-// RUN: 2>&1 | FileCheck -check-prefix=MABI-ILP32 %s
+// 32-bit checks
-// RUN: %clang -target riscv32 -fno-integrated-as -march=rv32g %s -### -c \
-// RUN: 2>&1 | FileCheck -check-prefix=MABI-ILP32-MARCH-G %s
+// Check default on riscv32-unknown-elf
+// RUN: %clang -target riscv32-unknown-elf -fno-integrated-as %s -### -c \
+// RUN: 2>&1 | FileCheck -check-prefix=CHECK-RV32IMAC-ILP32 %s
-// RUN: %clang -target riscv64 -fno-integrated-as %s -### -c \
-// RUN: 2>&1 | FileCheck -check-prefix=MABI-ILP64 %s
+// Check default on riscv32-unknown-linux-gnu
+// RUN: %clang -target riscv32-unknown-linux-gnu -fno-integrated-as %s -### -c \
+// RUN: 2>&1 | FileCheck -check-prefix=CHECK-RV32IMAFDC-ILP32D %s
-// RUN: %clang -target riscv64 -fno-integrated-as -march=rv64g %s -### -c \
-// RUN: 2>&1 | FileCheck -check-prefix=MABI-ILP64-MARCH-G %s
+// Check default when -march=rv32g specified
+// RUN: %clang -target riscv32 -fno-integrated-as %s -### -c -march=rv32g \
+// RUN: 2>&1 | FileCheck -check-prefix=CHECK-RV32G-ILP32D %s
-// MABI-ILP32: "{{.*}}as{{(.exe)?}}" "-mabi" "ilp32"
-// MABI-ILP32-MARCH-G: "{{.*}}as{{(.exe)?}}" "-mabi" "ilp32" "-march" "rv32g"
+// CHECK-RV32IMAC-ILP32: "{{.*}}as{{(.exe)?}}" "-mabi" "ilp32" "-march" "rv32imac"
+// CHECK-RV32IMAFDC-ILP32D: "{{.*}}as{{(.exe)?}}" "-mabi" "ilp32d" "-march" "rv32imafdc"
+// CHECK-RV32G-ILP32D: "{{.*}}as{{(.exe)?}}" "-mabi" "ilp32d" "-march" "rv32g"
-// MABI-ILP64: "{{.*}}as{{(.exe)?}}" "-mabi" "lp64"
-// MABI-ILP64-MARCH-G: "{{.*}}as{{(.exe)?}}" "-mabi" "lp64" "-march" "rv64g"
+
+// 64-bit checks
+
+// Check default on riscv64-unknown-elf
+// RUN: %clang -target riscv64-unknown-elf -fno-integrated-as %s -### -c \
+// RUN: 2>&1 | FileCheck -check-prefix=CHECK-RV64IMAC-LP64 %s
+
+// Check default on riscv64-unknown-linux-gnu
+// RUN: %clang -target riscv64-unknown-linux-gnu -fno-integrated-as %s -### -c \
+// RUN: 2>&1 | FileCheck -check-prefix=CHECK-RV64IMAFDC-LP64D %s
+
+// Check default when -march=rv64g specified
+// RUN: %clang -target riscv64 -fno-integrated-as %s -### -c -march=rv64g \
+// RUN: 2>&1 | FileCheck -check-prefix=CHECK-RV64G-LP64D %s
+
+// CHECK-RV64IMAC-LP64: "{{.*}}as{{(.exe)?}}" "-mabi" "lp64" "-march" "rv64imac"
+// CHECK-RV64IMAFDC-LP64D: "{{.*}}as{{(.exe)?}}" "-mabi" "lp64d" "-march" "rv64imafdc"
+// CHECK-RV64G-LP64D: "{{.*}}as{{(.exe)?}}" "-mabi" "lp64d" "-march" "rv64g"
diff --git a/src/llvm-project/clang/test/Driver/riscv32-toolchain-extra.c b/src/llvm-project/clang/test/Driver/riscv32-toolchain-extra.c
new file mode 100644
index 0000000..ad3974b
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/riscv32-toolchain-extra.c
@@ -0,0 +1,32 @@
+// A basic clang -cc1 command-line, and simple environment check.
+
+// The tests here are similar to those in riscv32-toolchain.c, however
+// these tests need to create symlinks to test directory trees in order to
+// set up the environment and therefore shell support is required.
+// REQUIRES: shell, riscv-registered-target
+// UNSUPPORTED: system-windows
+
+// If there is no GCC install detected then the driver searches for executables
+// and runtime starting from the directory tree above the driver itself.
+// The test below checks that the driver correctly finds the linker and
+// runtime if and only if they exist.
+//
+// RUN: mkdir -p %T/testroot-riscv32-baremetal-nogcc/bin
+// RUN: [ ! -s %T/testroot-riscv32-baremetal-nogcc/bin/clang ] || rm %T/testroot-riscv32-baremetal-nogcc/bin/clang
+// RUN: [ ! -s %T/testroot-riscv32-baremetal-nogcc/bin/riscv32-unknown-elf-ld ] || rm %T/testroot-riscv32-baremetal-nogcc/bin/riscv32-unknown-elf-ld
+// RUN: [ ! -s %T/testroot-riscv32-baremetal-nogcc/riscv32-unknown-elf ] || rm %T/testroot-riscv32-baremetal-nogcc/riscv32-unknown-elf
+// RUN: ln -s %clang %T/testroot-riscv32-baremetal-nogcc/bin/clang
+// RUN: ln -s %S/Inputs/basic_riscv32_nogcc_tree/bin/riscv32-unknown-elf-ld %T/testroot-riscv32-baremetal-nogcc/bin/riscv32-unknown-elf-ld
+// RUN: ln -s %S/Inputs/basic_riscv32_nogcc_tree/riscv32-unknown-elf %T/testroot-riscv32-baremetal-nogcc/riscv32-unknown-elf
+// RUN: %T/testroot-riscv32-baremetal-nogcc/bin/clang %s -### -no-canonical-prefixes \
+// RUN: -target riscv32-unknown-elf --rtlib=platform 2>&1 \
+// RUN: | FileCheck -check-prefix=C-RV32-BAREMETAL-ILP32-NOGCC %s
+
+// C-RV32-BAREMETAL-ILP32-NOGCC: "-internal-isystem" "{{.*}}Output/testroot-riscv32-baremetal-nogcc/bin/../riscv32-unknown-elf/include"
+// C-RV32-BAREMETAL-ILP32-NOGCC: "{{.*}}Output/testroot-riscv32-baremetal-nogcc/bin/riscv32-unknown-elf-ld"
+// C-RV32-BAREMETAL-ILP32-NOGCC: "{{.*}}Output/testroot-riscv32-baremetal-nogcc/bin/../riscv32-unknown-elf/lib/crt0.o"
+// C-RV32-BAREMETAL-ILP32-NOGCC: "{{.*}}Output/testroot-riscv32-baremetal-nogcc/{{.*}}/lib/clang_rt.crtbegin-riscv32.o"
+// C-RV32-BAREMETAL-ILP32-NOGCC: "{{.*}}Output/testroot-riscv32-baremetal-nogcc/bin/../riscv32-unknown-elf/lib"
+// C-RV32-BAREMETAL-ILP32-NOGCC: "--start-group" "-lc" "-lgloss" "--end-group"
+// C-RV32-BAREMETAL-ILP32-NOGCC: "{{.*}}Output/testroot-riscv32-baremetal-nogcc/{{.*}}/lib/libclang_rt.builtins-riscv32.a"
+// C-RV32-BAREMETAL-ILP32-NOGCC: "{{.*}}Output/testroot-riscv32-baremetal-nogcc/{{.*}}/lib/clang_rt.crtend-riscv32.o"
diff --git a/src/llvm-project/clang/test/Driver/riscv32-toolchain.c b/src/llvm-project/clang/test/Driver/riscv32-toolchain.c
index 117c773..2ff3a58 100644
--- a/src/llvm-project/clang/test/Driver/riscv32-toolchain.c
+++ b/src/llvm-project/clang/test/Driver/riscv32-toolchain.c
@@ -3,78 +3,76 @@
// RUN: %clang %s -### -no-canonical-prefixes -target riscv32 2>&1 | FileCheck -check-prefix=CC1 %s
// CC1: clang{{.*}} "-cc1" "-triple" "riscv32"
+// In the below tests, --rtlib=platform is used so that the driver ignores
+// the configure-time CLANG_DEFAULT_RTLIB option when choosing the runtime lib
+
// RUN: %clang %s -### -no-canonical-prefixes \
-// RUN: -target riscv32-unknown-elf \
+// RUN: -target riscv32-unknown-elf --rtlib=platform \
// RUN: --gcc-toolchain=%S/Inputs/basic_riscv32_tree \
// RUN: --sysroot=%S/Inputs/basic_riscv32_tree/riscv32-unknown-elf 2>&1 \
// RUN: | FileCheck -check-prefix=C-RV32-BAREMETAL-ILP32 %s
-// C-RV32-BAREMETAL-ILP32: "-fuse-init-array"
-// C-RV32-BAREMETAL-ILP32: "{{.*}}Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1/../../../../bin{{/|\\\\}}riscv32-unknown-elf-ld"
+// C-RV32-BAREMETAL-ILP32: "{{.*}}Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1/../../..{{/|\\\\}}..{{/|\\\\}}bin{{/|\\\\}}riscv32-unknown-elf-ld"
// C-RV32-BAREMETAL-ILP32: "--sysroot={{.*}}/Inputs/basic_riscv32_tree/riscv32-unknown-elf"
// C-RV32-BAREMETAL-ILP32: "{{.*}}/Inputs/basic_riscv32_tree/riscv32-unknown-elf/lib{{/|\\\\}}crt0.o"
// C-RV32-BAREMETAL-ILP32: "{{.*}}/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1{{/|\\\\}}crtbegin.o"
-// C-RV32-BAREMETAL-ILP32: "-L{{.*}}/Inputs/basic_riscv32_tree/riscv32-unknown-elf/lib"
// C-RV32-BAREMETAL-ILP32: "-L{{.*}}/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1"
+// C-RV32-BAREMETAL-ILP32: "-L{{.*}}/Inputs/basic_riscv32_tree/riscv32-unknown-elf/lib"
// C-RV32-BAREMETAL-ILP32: "--start-group" "-lc" "-lgloss" "--end-group" "-lgcc"
// C-RV32-BAREMETAL-ILP32: "{{.*}}/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1{{/|\\\\}}crtend.o"
// RUN: %clang %s -### -no-canonical-prefixes \
-// RUN: -target riscv32-unknown-elf \
+// RUN: -target riscv32-unknown-elf --rtlib=platform \
// RUN: --sysroot= \
// RUN: --gcc-toolchain=%S/Inputs/basic_riscv32_tree 2>&1 \
// RUN: | FileCheck -check-prefix=C-RV32-BAREMETAL-NOSYSROOT-ILP32 %s
-// C-RV32-BAREMETAL-NOSYSROOT-ILP32: "-fuse-init-array"
-// C-RV32-BAREMETAL-NOSYSROOT-ILP32: "{{.*}}Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1/../../../../bin{{/|\\\\}}riscv32-unknown-elf-ld"
-// C-RV32-BAREMETAL-NOSYSROOT-ILP32: "{{.*}}/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1/../../../../riscv32-unknown-elf/lib{{/|\\\\}}crt0.o"
+// C-RV32-BAREMETAL-NOSYSROOT-ILP32: "{{.*}}Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1/../../..{{/|\\\\}}..{{/|\\\\}}bin{{/|\\\\}}riscv32-unknown-elf-ld"
+// C-RV32-BAREMETAL-NOSYSROOT-ILP32: "{{.*}}/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1/../../..{{/|\\\\}}..{{/|\\\\}}riscv32-unknown-elf/lib{{/|\\\\}}crt0.o"
// C-RV32-BAREMETAL-NOSYSROOT-ILP32: "{{.*}}/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1{{/|\\\\}}crtbegin.o"
-// C-RV32-BAREMETAL-NOSYSROOT-ILP32: "-L{{.*}}/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1/../../../../riscv32-unknown-elf{{/|\\\\}}lib"
// C-RV32-BAREMETAL-NOSYSROOT-ILP32: "-L{{.*}}/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1"
+// C-RV32-BAREMETAL-NOSYSROOT-ILP32: "-L{{.*}}/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1/../../..{{/|\\\\}}..{{/|\\\\}}riscv32-unknown-elf{{/|\\\\}}lib"
// C-RV32-BAREMETAL-NOSYSROOT-ILP32: "--start-group" "-lc" "-lgloss" "--end-group" "-lgcc"
// C-RV32-BAREMETAL-NOSYSROOT-ILP32: "{{.*}}/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1{{/|\\\\}}crtend.o"
// RUN: %clangxx %s -### -no-canonical-prefixes \
-// RUN: -target riscv32-unknown-elf -stdlib=libstdc++ \
+// RUN: -target riscv32-unknown-elf -stdlib=libstdc++ --rtlib=platform \
// RUN: --gcc-toolchain=%S/Inputs/basic_riscv32_tree \
// RUN: --sysroot=%S/Inputs/basic_riscv32_tree/riscv32-unknown-elf 2>&1 \
// RUN: | FileCheck -check-prefix=CXX-RV32-BAREMETAL-ILP32 %s
-// CXX-RV32-BAREMETAL-ILP32: "-fuse-init-array"
// CXX-RV32-BAREMETAL-ILP32: "-internal-isystem" "{{.*}}Inputs/basic_riscv32_tree/riscv32-unknown-elf/include/c++{{/|\\\\}}8.0.1"
-// CXX-RV32-BAREMETAL-ILP32: "{{.*}}Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1/../../../../bin{{/|\\\\}}riscv32-unknown-elf-ld"
+// CXX-RV32-BAREMETAL-ILP32: "{{.*}}Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1/../../..{{/|\\\\}}..{{/|\\\\}}bin{{/|\\\\}}riscv32-unknown-elf-ld"
// CXX-RV32-BAREMETAL-ILP32: "--sysroot={{.*}}/Inputs/basic_riscv32_tree/riscv32-unknown-elf"
// CXX-RV32-BAREMETAL-ILP32: "{{.*}}/Inputs/basic_riscv32_tree/riscv32-unknown-elf/lib{{/|\\\\}}crt0.o"
// CXX-RV32-BAREMETAL-ILP32: "{{.*}}/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1{{/|\\\\}}crtbegin.o"
-// CXX-RV32-BAREMETAL-ILP32: "-L{{.*}}/Inputs/basic_riscv32_tree/riscv32-unknown-elf/lib"
// CXX-RV32-BAREMETAL-ILP32: "-L{{.*}}/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1"
+// CXX-RV32-BAREMETAL-ILP32: "-L{{.*}}/Inputs/basic_riscv32_tree/riscv32-unknown-elf/lib"
// CXX-RV32-BAREMETAL-ILP32: "-lstdc++" "--start-group" "-lc" "-lgloss" "--end-group" "-lgcc"
// CXX-RV32-BAREMETAL-ILP32: "{{.*}}/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1{{/|\\\\}}crtend.o"
// RUN: %clangxx %s -### -no-canonical-prefixes \
-// RUN: -target riscv32-unknown-elf -stdlib=libstdc++ \
+// RUN: -target riscv32-unknown-elf -stdlib=libstdc++ --rtlib=platform \
// RUN: --sysroot= \
// RUN: --gcc-toolchain=%S/Inputs/basic_riscv32_tree 2>&1 \
// RUN: | FileCheck -check-prefix=CXX-RV32-BAREMETAL-NOSYSROOT-ILP32 %s
-// CXX-RV32-BAREMETAL-NOSYSROOT-ILP32: "-fuse-init-array"
-// CXX-RV32-BAREMETAL-NOSYSROOT-ILP32: "-internal-isystem" "{{.*}}Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1/../../../../riscv32-unknown-elf/include/c++{{/|\\\\}}8.0.1"
-// CXX-RV32-BAREMETAL-NOSYSROOT-ILP32: "{{.*}}Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1/../../../../bin{{/|\\\\}}riscv32-unknown-elf-ld"
-// CXX-RV32-BAREMETAL-NOSYSROOT-ILP32: "{{.*}}/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1/../../../../riscv32-unknown-elf/lib{{/|\\\\}}crt0.o"
+// CXX-RV32-BAREMETAL-NOSYSROOT-ILP32: "-internal-isystem" "{{.*}}Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1/../../..{{/|\\\\}}..{{/|\\\\}}riscv32-unknown-elf/include/c++{{/|\\\\}}8.0.1"
+// CXX-RV32-BAREMETAL-NOSYSROOT-ILP32: "{{.*}}Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1/../../..{{/|\\\\}}..{{/|\\\\}}bin{{/|\\\\}}riscv32-unknown-elf-ld"
+// CXX-RV32-BAREMETAL-NOSYSROOT-ILP32: "{{.*}}/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1/../../..{{/|\\\\}}..{{/|\\\\}}riscv32-unknown-elf/lib{{/|\\\\}}crt0.o"
// CXX-RV32-BAREMETAL-NOSYSROOT-ILP32: "{{.*}}/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1{{/|\\\\}}crtbegin.o"
-// CXX-RV32-BAREMETAL-NOSYSROOT-ILP32: "-L{{.*}}/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1/../../../../riscv32-unknown-elf/lib"
// CXX-RV32-BAREMETAL-NOSYSROOT-ILP32: "-L{{.*}}/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1"
+// CXX-RV32-BAREMETAL-NOSYSROOT-ILP32: "-L{{.*}}/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1/../../..{{/|\\\\}}..{{/|\\\\}}riscv32-unknown-elf/lib"
// CXX-RV32-BAREMETAL-NOSYSROOT-ILP32: "-lstdc++" "--start-group" "-lc" "-lgloss" "--end-group" "-lgcc"
// CXX-RV32-BAREMETAL-NOSYSROOT-ILP32: "{{.*}}/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1{{/|\\\\}}crtend.o"
// RUN: %clang %s -### -no-canonical-prefixes -fuse-ld=ld \
-// RUN: -target riscv32-unknown-linux-gnu \
+// RUN: -target riscv32-unknown-linux-gnu --rtlib=platform -mabi=ilp32 \
// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_linux_sdk \
// RUN: --sysroot=%S/Inputs/multilib_riscv_linux_sdk/sysroot 2>&1 \
// RUN: | FileCheck -check-prefix=C-RV32-LINUX-MULTI-ILP32 %s
-// C-RV32-LINUX-MULTI-ILP32: "-fuse-init-array"
-// C-RV32-LINUX-MULTI-ILP32: "{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/../../../../riscv64-unknown-linux-gnu/bin{{/|\\\\}}ld"
+// C-RV32-LINUX-MULTI-ILP32: "{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/../../..{{/|\\\\}}..{{/|\\\\}}riscv64-unknown-linux-gnu/bin{{/|\\\\}}ld"
// C-RV32-LINUX-MULTI-ILP32: "--sysroot={{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot"
// C-RV32-LINUX-MULTI-ILP32: "-m" "elf32lriscv"
// C-RV32-LINUX-MULTI-ILP32: "-dynamic-linker" "/lib/ld-linux-riscv32-ilp32.so.1"
@@ -84,13 +82,12 @@
// C-RV32-LINUX-MULTI-ILP32: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/usr/lib32/ilp32"
// RUN: %clang %s -### -no-canonical-prefixes -fuse-ld=ld \
-// RUN: -target riscv32-unknown-linux-gnu -march=rv32imafd -mabi=ilp32d \
+// RUN: -target riscv32-unknown-linux-gnu --rtlib=platform -march=rv32imafd \
// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_linux_sdk \
// RUN: --sysroot=%S/Inputs/multilib_riscv_linux_sdk/sysroot 2>&1 \
// RUN: | FileCheck -check-prefix=C-RV32-LINUX-MULTI-ILP32D %s
-// C-RV32-LINUX-MULTI-ILP32D: "-fuse-init-array"
-// C-RV32-LINUX-MULTI-ILP32D: "{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/../../../../riscv64-unknown-linux-gnu/bin{{/|\\\\}}ld"
+// C-RV32-LINUX-MULTI-ILP32D: "{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/../../..{{/|\\\\}}..{{/|\\\\}}riscv64-unknown-linux-gnu/bin{{/|\\\\}}ld"
// C-RV32-LINUX-MULTI-ILP32D: "--sysroot={{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot"
// C-RV32-LINUX-MULTI-ILP32D: "-m" "elf32lriscv"
// C-RV32-LINUX-MULTI-ILP32D: "-dynamic-linker" "/lib/ld-linux-riscv32-ilp32d.so.1"
@@ -99,6 +96,97 @@
// C-RV32-LINUX-MULTI-ILP32D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/lib32/ilp32d"
// C-RV32-LINUX-MULTI-ILP32D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/usr/lib32/ilp32d"
+// RUN: %clang %s -### -no-canonical-prefixes -fuse-ld=ld \
+// RUN: -target riscv32-unknown-elf --rtlib=platform --sysroot= \
+// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk 2>&1 \
+// RUN: | FileCheck -check-prefix=C-RV32I-BAREMETAL-MULTI-ILP32 %s
+
+// C-RV32I-BAREMETAL-MULTI-ILP32: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/../../..{{/|\\\\}}..{{/|\\\\}}riscv64-unknown-elf/bin{{/|\\\\}}ld"
+// C-RV32I-BAREMETAL-MULTI-ILP32: "-m" "elf32lriscv"
+// C-RV32I-BAREMETAL-MULTI-ILP32: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/../../..{{/|\\\\}}..{{/|\\\\}}riscv64-unknown-elf/lib/rv32imac/ilp32{{/|\\\\}}crt0.o"
+// C-RV32I-BAREMETAL-MULTI-ILP32: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv32imac/ilp32{{/|\\\\}}crtbegin.o"
+// C-RV32I-BAREMETAL-MULTI-ILP32: "-L{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0"
+// C-RV32I-BAREMETAL-MULTI-ILP32: "-L{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/../../..{{/|\\\\}}..{{/|\\\\}}riscv64-unknown-elf/lib"
+// C-RV32I-BAREMETAL-MULTI-ILP32: "--start-group" "-lc" "-lgloss" "--end-group" "-lgcc"
+// C-RV32I-BAREMETAL-MULTI-ILP32: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv32imac/ilp32{{/|\\\\}}crtend.o"
+
+// RUN: %clang %s -### -no-canonical-prefixes -fuse-ld=ld \
+// RUN: -target riscv32-unknown-elf --rtlib=platform --sysroot= \
+// RUN: -march=rv32im -mabi=ilp32\
+// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk 2>&1 \
+// RUN: | FileCheck -check-prefix=C-RV32IM-BAREMETAL-MULTI-ILP32 %s
+
+// C-RV32IM-BAREMETAL-MULTI-ILP32: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/../../..{{/|\\\\}}..{{/|\\\\}}riscv64-unknown-elf/bin{{/|\\\\}}ld"
+// C-RV32IM-BAREMETAL-MULTI-ILP32: "-m" "elf32lriscv"
+// C-RV32IM-BAREMETAL-MULTI-ILP32: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/../../..{{/|\\\\}}..{{/|\\\\}}riscv64-unknown-elf/lib/rv32im/ilp32{{/|\\\\}}crt0.o"
+// C-RV32IM-BAREMETAL-MULTI-ILP32: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv32im/ilp32{{/|\\\\}}crtbegin.o"
+// C-RV32IM-BAREMETAL-MULTI-ILP32: "-L{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0"
+// C-RV32IM-BAREMETAL-MULTI-ILP32: "-L{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/../../..{{/|\\\\}}..{{/|\\\\}}riscv64-unknown-elf/lib"
+// C-RV32IM-BAREMETAL-MULTI-ILP32: "--start-group" "-lc" "-lgloss" "--end-group" "-lgcc"
+// C-RV32IM-BAREMETAL-MULTI-ILP32: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv32im/ilp32{{/|\\\\}}crtend.o"
+
+// RUN: %clang %s -### -no-canonical-prefixes -fuse-ld=ld \
+// RUN: -target riscv32-unknown-elf --rtlib=platform --sysroot= \
+// RUN: -march=rv32iac -mabi=ilp32\
+// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk 2>&1 \
+// RUN: | FileCheck -check-prefix=C-RV32IAC-BAREMETAL-MULTI-ILP32 %s
+
+// C-RV32IAC-BAREMETAL-MULTI-ILP32: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/../../..{{/|\\\\}}..{{/|\\\\}}riscv64-unknown-elf/bin{{/|\\\\}}ld"
+// C-RV32IAC-BAREMETAL-MULTI-ILP32: "-m" "elf32lriscv"
+// C-RV32IAC-BAREMETAL-MULTI-ILP32: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/../../..{{/|\\\\}}..{{/|\\\\}}riscv64-unknown-elf/lib/rv32iac/ilp32{{/|\\\\}}crt0.o"
+// C-RV32IAC-BAREMETAL-MULTI-ILP32: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv32iac/ilp32{{/|\\\\}}crtbegin.o"
+// C-RV32IAC-BAREMETAL-MULTI-ILP32: "-L{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0"
+// C-RV32IAC-BAREMETAL-MULTI-ILP32: "-L{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/../../..{{/|\\\\}}..{{/|\\\\}}riscv64-unknown-elf/lib"
+// C-RV32IAC-BAREMETAL-MULTI-ILP32: "--start-group" "-lc" "-lgloss" "--end-group" "-lgcc"
+// C-RV32IAC-BAREMETAL-MULTI-ILP32: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv32iac/ilp32{{/|\\\\}}crtend.o"
+
+// RUN: %clang %s -### -no-canonical-prefixes -fuse-ld=ld \
+// RUN: -target riscv32-unknown-elf --rtlib=platform --sysroot= \
+// RUN: -march=rv32imac -mabi=ilp32\
+// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk 2>&1 \
+// RUN: | FileCheck -check-prefix=C-RV32IMAC-BAREMETAL-MULTI-ILP32 %s
+
+// C-RV32IMAC-BAREMETAL-MULTI-ILP32: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/../../..{{/|\\\\}}..{{/|\\\\}}riscv64-unknown-elf/bin{{/|\\\\}}ld"
+// C-RV32IMAC-BAREMETAL-MULTI-ILP32: "-m" "elf32lriscv"
+// C-RV32IMAC-BAREMETAL-MULTI-ILP32: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/../../..{{/|\\\\}}..{{/|\\\\}}riscv64-unknown-elf/lib/rv32imac/ilp32{{/|\\\\}}crt0.o"
+// C-RV32IMAC-BAREMETAL-MULTI-ILP32: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv32imac/ilp32{{/|\\\\}}crtbegin.o"
+// C-RV32IMAC-BAREMETAL-MULTI-ILP32: "-L{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0"
+// C-RV32IMAC-BAREMETAL-MULTI-ILP32: "-L{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/../../..{{/|\\\\}}..{{/|\\\\}}riscv64-unknown-elf/lib"
+// C-RV32IMAC-BAREMETAL-MULTI-ILP32: "--start-group" "-lc" "-lgloss" "--end-group" "-lgcc"
+// C-RV32IMAC-BAREMETAL-MULTI-ILP32: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv32imac/ilp32{{/|\\\\}}crtend.o"
+
+// RUN: %clang %s -### -no-canonical-prefixes -fuse-ld=ld \
+// RUN: -target riscv32-unknown-elf --rtlib=platform --sysroot= \
+// RUN: -march=rv32imafc -mabi=ilp32f \
+// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk 2>&1 \
+// RUN: | FileCheck -check-prefix=C-RV32IMAFC-BAREMETAL-MULTI-ILP32F %s
+
+// C-RV32IMAFC-BAREMETAL-MULTI-ILP32F: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/../../..{{/|\\\\}}..{{/|\\\\}}riscv64-unknown-elf/bin{{/|\\\\}}ld"
+// C-RV32IMAFC-BAREMETAL-MULTI-ILP32F: "-m" "elf32lriscv"
+// C-RV32IMAFC-BAREMETAL-MULTI-ILP32F: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/../../..{{/|\\\\}}..{{/|\\\\}}riscv64-unknown-elf/lib/rv32imafc/ilp32f{{/|\\\\}}crt0.o"
+// C-RV32IMAFC-BAREMETAL-MULTI-ILP32F: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv32imafc/ilp32f{{/|\\\\}}crtbegin.o"
+// C-RV32IMAFC-BAREMETAL-MULTI-ILP32F: "-L{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0"
+// C-RV32IMAFC-BAREMETAL-MULTI-ILP32F: "-L{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/../../..{{/|\\\\}}..{{/|\\\\}}riscv64-unknown-elf/lib"
+// C-RV32IMAFC-BAREMETAL-MULTI-ILP32F: "--start-group" "-lc" "-lgloss" "--end-group" "-lgcc"
+// C-RV32IMAFC-BAREMETAL-MULTI-ILP32F: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv32imafc/ilp32f{{/|\\\\}}crtend.o"
+
+// Check that --rtlib can be used to override the used runtime library
+// RUN: %clang %s -### -no-canonical-prefixes \
+// RUN: -target riscv32-unknown-elf --rtlib=libgcc 2>&1 \
+// RUN: | FileCheck -check-prefix=C-RV32-RTLIB-LIBGCC-ILP32 %s
+// C-RV32-RTLIB-LIBGCC-ILP32: "{{.*}}crt0.o"
+// C-RV32-RTLIB-LIBGCC-ILP32: "{{.*}}crtbegin.o"
+// C-RV32-RTLIB-LIBGCC-ILP32: "--start-group" "-lc" "-lgloss" "--end-group" "-lgcc"
+// C-RV32-RTLIB-LIBGCC-ILP32: "{{.*}}crtend.o"
+
+// RUN: %clang %s -### -no-canonical-prefixes \
+// RUN: -target riscv32-unknown-elf --rtlib=compiler-rt 2>&1 \
+// RUN: | FileCheck -check-prefix=C-RV32-RTLIB-COMPILERRT-ILP32 %s
+// C-RV32-RTLIB-COMPILERRT-ILP32: "{{.*}}crt0.o"
+// C-RV32-RTLIB-COMPILERRT-ILP32: "{{.*}}clang_rt.crtbegin-riscv32.o"
+// C-RV32-RTLIB-COMPILERRT-ILP32: "--start-group" "-lc" "-lgloss" "--end-group" "{{.*}}libclang_rt.builtins-riscv32.a"
+// C-RV32-RTLIB-COMPILERRT-ILP32: "{{.*}}clang_rt.crtend-riscv32.o"
+
// RUN: %clang -target riscv32 %s -emit-llvm -S -o - | FileCheck %s
typedef __builtin_va_list va_list;
diff --git a/src/llvm-project/clang/test/Driver/riscv64-toolchain-extra.c b/src/llvm-project/clang/test/Driver/riscv64-toolchain-extra.c
new file mode 100644
index 0000000..2213d96
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/riscv64-toolchain-extra.c
@@ -0,0 +1,32 @@
+// A basic clang -cc1 command-line, and simple environment check.
+
+// The tests here are similar to those in riscv64-toolchain.c, however
+// these tests need to create symlinks to test directory trees in order to
+// set up the environment and therefore shell support is required.
+// REQUIRES: shell, riscv-registered-target
+// UNSUPPORTED: system-windows
+
+// If there is no GCC install detected then the driver searches for executables
+// and runtime starting from the directory tree above the driver itself.
+// The test below checks that the driver correctly finds the linker and
+// runtime if and only if they exist.
+//
+// RUN: mkdir -p %T/testroot-riscv64-baremetal-nogcc/bin
+// RUN: [ ! -s %T/testroot-riscv64-baremetal-nogcc/bin/clang ] || rm %T/testroot-riscv64-baremetal-nogcc/bin/clang
+// RUN: [ ! -s %T/testroot-riscv64-baremetal-nogcc/bin/riscv64-unknown-elf-ld ] || rm %T/testroot-riscv64-baremetal-nogcc/bin/riscv64-unknown-elf-ld
+// RUN: [ ! -s %T/testroot-riscv64-baremetal-nogcc/riscv64-unknown-elf ] || rm %T/testroot-riscv64-baremetal-nogcc/riscv64-unknown-elf
+// RUN: ln -s %clang %T/testroot-riscv64-baremetal-nogcc/bin/clang
+// RUN: ln -s %S/Inputs/basic_riscv64_nogcc_tree/bin/riscv64-unknown-elf-ld %T/testroot-riscv64-baremetal-nogcc/bin/riscv64-unknown-elf-ld
+// RUN: ln -s %S/Inputs/basic_riscv64_nogcc_tree/riscv64-unknown-elf %T/testroot-riscv64-baremetal-nogcc/riscv64-unknown-elf
+// RUN: %T/testroot-riscv64-baremetal-nogcc/bin/clang %s -### -no-canonical-prefixes \
+// RUN: -target riscv64-unknown-elf --rtlib=platform 2>&1 \
+// RUN: | FileCheck -check-prefix=C-RV64-BAREMETAL-LP64-NOGCC %s
+
+// C-RV64-BAREMETAL-LP64-NOGCC: "-internal-isystem" "{{.*}}Output/testroot-riscv64-baremetal-nogcc/bin/../riscv64-unknown-elf/include"
+// C-RV64-BAREMETAL-LP64-NOGCC: "{{.*}}Output/testroot-riscv64-baremetal-nogcc/bin/riscv64-unknown-elf-ld"
+// C-RV64-BAREMETAL-LP64-NOGCC: "{{.*}}Output/testroot-riscv64-baremetal-nogcc/bin/../riscv64-unknown-elf/lib/crt0.o"
+// C-RV64-BAREMETAL-LP64-NOGCC: "{{.*}}Output/testroot-riscv64-baremetal-nogcc/{{.*}}/lib/clang_rt.crtbegin-riscv64.o"
+// C-RV64-BAREMETAL-LP64-NOGCC: "{{.*}}Output/testroot-riscv64-baremetal-nogcc/bin/../riscv64-unknown-elf/lib"
+// C-RV64-BAREMETAL-LP64-NOGCC: "--start-group" "-lc" "-lgloss" "--end-group"
+// C-RV64-BAREMETAL-LP64-NOGCC: "{{.*}}Output/testroot-riscv64-baremetal-nogcc/{{.*}}/lib/libclang_rt.builtins-riscv64.a"
+// C-RV64-BAREMETAL-LP64-NOGCC: "{{.*}}Output/testroot-riscv64-baremetal-nogcc/{{.*}}/lib/clang_rt.crtend-riscv64.o"
diff --git a/src/llvm-project/clang/test/Driver/riscv64-toolchain.c b/src/llvm-project/clang/test/Driver/riscv64-toolchain.c
index 3d57494..42cac51 100644
--- a/src/llvm-project/clang/test/Driver/riscv64-toolchain.c
+++ b/src/llvm-project/clang/test/Driver/riscv64-toolchain.c
@@ -3,78 +3,76 @@
// RUN: %clang %s -### -no-canonical-prefixes -target riscv64 2>&1 | FileCheck -check-prefix=CC1 %s
// CC1: clang{{.*}} "-cc1" "-triple" "riscv64"
+// In the below tests, --rtlib=platform is used so that the driver ignores
+// the configure-time CLANG_DEFAULT_RTLIB option when choosing the runtime lib
+
// RUN: %clang %s -### -no-canonical-prefixes \
-// RUN: -target riscv64-unknown-elf \
+// RUN: -target riscv64-unknown-elf --rtlib=platform \
// RUN: --gcc-toolchain=%S/Inputs/basic_riscv64_tree \
// RUN: --sysroot=%S/Inputs/basic_riscv64_tree/riscv64-unknown-elf 2>&1 \
// RUN: | FileCheck -check-prefix=C-RV64-BAREMETAL-LP64 %s
-// C-RV64-BAREMETAL-LP64: "-fuse-init-array"
-// C-RV64-BAREMETAL-LP64: "{{.*}}Inputs/basic_riscv64_tree/lib/gcc/riscv64-unknown-elf/8.0.1/../../../../bin{{/|\\\\}}riscv64-unknown-elf-ld"
+// C-RV64-BAREMETAL-LP64: "{{.*}}Inputs/basic_riscv64_tree/lib/gcc/riscv64-unknown-elf/8.0.1/../../..{{/|\\\\}}..{{/|\\\\}}bin{{/|\\\\}}riscv64-unknown-elf-ld"
// C-RV64-BAREMETAL-LP64: "--sysroot={{.*}}/Inputs/basic_riscv64_tree/riscv64-unknown-elf"
// C-RV64-BAREMETAL-LP64: "{{.*}}/Inputs/basic_riscv64_tree/riscv64-unknown-elf/lib{{/|\\\\}}crt0.o"
// C-RV64-BAREMETAL-LP64: "{{.*}}/Inputs/basic_riscv64_tree/lib/gcc/riscv64-unknown-elf/8.0.1{{/|\\\\}}crtbegin.o"
-// C-RV64-BAREMETAL-LP64: "-L{{.*}}/Inputs/basic_riscv64_tree/riscv64-unknown-elf/lib"
// C-RV64-BAREMETAL-LP64: "-L{{.*}}/Inputs/basic_riscv64_tree/lib/gcc/riscv64-unknown-elf/8.0.1"
+// C-RV64-BAREMETAL-LP64: "-L{{.*}}/Inputs/basic_riscv64_tree/riscv64-unknown-elf/lib"
// C-RV64-BAREMETAL-LP64: "--start-group" "-lc" "-lgloss" "--end-group" "-lgcc"
// C-RV64-BAREMETAL-LP64: "{{.*}}/Inputs/basic_riscv64_tree/lib/gcc/riscv64-unknown-elf/8.0.1{{/|\\\\}}crtend.o"
// RUN: %clang %s -### -no-canonical-prefixes \
-// RUN: -target riscv64-unknown-elf \
+// RUN: -target riscv64-unknown-elf --rtlib=platform \
// RUN: --sysroot= \
// RUN: --gcc-toolchain=%S/Inputs/basic_riscv64_tree 2>&1 \
// RUN: | FileCheck -check-prefix=C-RV64-BAREMETAL-NOSYSROOT-LP64 %s
-// C-RV64-BAREMETAL-NOSYSROOT-LP64: "-fuse-init-array"
-// C-RV64-BAREMETAL-NOSYSROOT-LP64: "{{.*}}Inputs/basic_riscv64_tree/lib/gcc/riscv64-unknown-elf/8.0.1/../../../../bin{{/|\\\\}}riscv64-unknown-elf-ld"
-// C-RV64-BAREMETAL-NOSYSROOT-LP64: "{{.*}}/Inputs/basic_riscv64_tree/lib/gcc/riscv64-unknown-elf/8.0.1/../../../../riscv64-unknown-elf/lib{{/|\\\\}}crt0.o"
+// C-RV64-BAREMETAL-NOSYSROOT-LP64: "{{.*}}Inputs/basic_riscv64_tree/lib/gcc/riscv64-unknown-elf/8.0.1/../../..{{/|\\\\}}..{{/|\\\\}}bin{{/|\\\\}}riscv64-unknown-elf-ld"
+// C-RV64-BAREMETAL-NOSYSROOT-LP64: "{{.*}}/Inputs/basic_riscv64_tree/lib/gcc/riscv64-unknown-elf/8.0.1/../../..{{/|\\\\}}..{{/|\\\\}}riscv64-unknown-elf/lib{{/|\\\\}}crt0.o"
// C-RV64-BAREMETAL-NOSYSROOT-LP64: "{{.*}}/Inputs/basic_riscv64_tree/lib/gcc/riscv64-unknown-elf/8.0.1{{/|\\\\}}crtbegin.o"
-// C-RV64-BAREMETAL-NOSYSROOT-LP64: "-L{{.*}}/Inputs/basic_riscv64_tree/lib/gcc/riscv64-unknown-elf/8.0.1/../../../../riscv64-unknown-elf{{/|\\\\}}lib"
// C-RV64-BAREMETAL-NOSYSROOT-LP64: "-L{{.*}}/Inputs/basic_riscv64_tree/lib/gcc/riscv64-unknown-elf/8.0.1"
+// C-RV64-BAREMETAL-NOSYSROOT-LP64: "-L{{.*}}/Inputs/basic_riscv64_tree/lib/gcc/riscv64-unknown-elf/8.0.1/../../..{{/|\\\\}}..{{/|\\\\}}riscv64-unknown-elf{{/|\\\\}}lib"
// C-RV64-BAREMETAL-NOSYSROOT-LP64: "--start-group" "-lc" "-lgloss" "--end-group" "-lgcc"
// C-RV64-BAREMETAL-NOSYSROOT-LP64: "{{.*}}/Inputs/basic_riscv64_tree/lib/gcc/riscv64-unknown-elf/8.0.1{{/|\\\\}}crtend.o"
// RUN: %clangxx %s -### -no-canonical-prefixes \
-// RUN: -target riscv64-unknown-elf -stdlib=libstdc++ \
+// RUN: -target riscv64-unknown-elf -stdlib=libstdc++ --rtlib=platform \
// RUN: --gcc-toolchain=%S/Inputs/basic_riscv64_tree \
// RUN: --sysroot=%S/Inputs/basic_riscv64_tree/riscv64-unknown-elf 2>&1 \
// RUN: | FileCheck -check-prefix=CXX-RV64-BAREMETAL-LP64 %s
-// CXX-RV64-BAREMETAL-LP64: "-fuse-init-array"
// CXX-RV64-BAREMETAL-LP64: "-internal-isystem" "{{.*}}Inputs/basic_riscv64_tree/riscv64-unknown-elf/include/c++{{/|\\\\}}8.0.1"
-// CXX-RV64-BAREMETAL-LP64: "{{.*}}Inputs/basic_riscv64_tree/lib/gcc/riscv64-unknown-elf/8.0.1/../../../../bin{{/|\\\\}}riscv64-unknown-elf-ld"
+// CXX-RV64-BAREMETAL-LP64: "{{.*}}Inputs/basic_riscv64_tree/lib/gcc/riscv64-unknown-elf/8.0.1/../../..{{/|\\\\}}..{{/|\\\\}}bin{{/|\\\\}}riscv64-unknown-elf-ld"
// CXX-RV64-BAREMETAL-LP64: "--sysroot={{.*}}/Inputs/basic_riscv64_tree/riscv64-unknown-elf"
// CXX-RV64-BAREMETAL-LP64: "{{.*}}/Inputs/basic_riscv64_tree/riscv64-unknown-elf/lib{{/|\\\\}}crt0.o"
// CXX-RV64-BAREMETAL-LP64: "{{.*}}/Inputs/basic_riscv64_tree/lib/gcc/riscv64-unknown-elf/8.0.1{{/|\\\\}}crtbegin.o"
-// CXX-RV64-BAREMETAL-LP64: "-L{{.*}}/Inputs/basic_riscv64_tree/riscv64-unknown-elf/lib"
// CXX-RV64-BAREMETAL-LP64: "-L{{.*}}/Inputs/basic_riscv64_tree/lib/gcc/riscv64-unknown-elf/8.0.1"
+// CXX-RV64-BAREMETAL-LP64: "-L{{.*}}/Inputs/basic_riscv64_tree/riscv64-unknown-elf/lib"
// CXX-RV64-BAREMETAL-LP64: "-lstdc++" "--start-group" "-lc" "-lgloss" "--end-group" "-lgcc"
// CXX-RV64-BAREMETAL-LP64: "{{.*}}/Inputs/basic_riscv64_tree/lib/gcc/riscv64-unknown-elf/8.0.1{{/|\\\\}}crtend.o"
// RUN: %clangxx %s -### -no-canonical-prefixes \
-// RUN: -target riscv64-unknown-elf -stdlib=libstdc++ \
+// RUN: -target riscv64-unknown-elf -stdlib=libstdc++ --rtlib=platform \
// RUN: --sysroot= \
// RUN: --gcc-toolchain=%S/Inputs/basic_riscv64_tree 2>&1 \
// RUN: | FileCheck -check-prefix=CXX-RV64-BAREMETAL-NOSYSROOT-LP64 %s
-// CXX-RV64-BAREMETAL-NOSYSROOT-LP64: "-fuse-init-array"
-// CXX-RV64-BAREMETAL-NOSYSROOT-LP64: "-internal-isystem" "{{.*}}Inputs/basic_riscv64_tree/lib/gcc/riscv64-unknown-elf/8.0.1/../../../../riscv64-unknown-elf/include/c++{{/|\\\\}}8.0.1"
-// CXX-RV64-BAREMETAL-NOSYSROOT-LP64: "{{.*}}Inputs/basic_riscv64_tree/lib/gcc/riscv64-unknown-elf/8.0.1/../../../../bin{{/|\\\\}}riscv64-unknown-elf-ld"
-// CXX-RV64-BAREMETAL-NOSYSROOT-LP64: "{{.*}}/Inputs/basic_riscv64_tree/lib/gcc/riscv64-unknown-elf/8.0.1/../../../../riscv64-unknown-elf/lib{{/|\\\\}}crt0.o"
+// CXX-RV64-BAREMETAL-NOSYSROOT-LP64: "-internal-isystem" "{{.*}}Inputs/basic_riscv64_tree/lib/gcc/riscv64-unknown-elf/8.0.1/../../..{{/|\\\\}}..{{/|\\\\}}riscv64-unknown-elf/include/c++{{/|\\\\}}8.0.1"
+// CXX-RV64-BAREMETAL-NOSYSROOT-LP64: "{{.*}}Inputs/basic_riscv64_tree/lib/gcc/riscv64-unknown-elf/8.0.1/../../..{{/|\\\\}}..{{/|\\\\}}bin{{/|\\\\}}riscv64-unknown-elf-ld"
+// CXX-RV64-BAREMETAL-NOSYSROOT-LP64: "{{.*}}/Inputs/basic_riscv64_tree/lib/gcc/riscv64-unknown-elf/8.0.1/../../..{{/|\\\\}}..{{/|\\\\}}riscv64-unknown-elf/lib{{/|\\\\}}crt0.o"
// CXX-RV64-BAREMETAL-NOSYSROOT-LP64: "{{.*}}/Inputs/basic_riscv64_tree/lib/gcc/riscv64-unknown-elf/8.0.1{{/|\\\\}}crtbegin.o"
-// CXX-RV64-BAREMETAL-NOSYSROOT-LP64: "-L{{.*}}/Inputs/basic_riscv64_tree/lib/gcc/riscv64-unknown-elf/8.0.1/../../../../riscv64-unknown-elf/lib"
// CXX-RV64-BAREMETAL-NOSYSROOT-LP64: "-L{{.*}}/Inputs/basic_riscv64_tree/lib/gcc/riscv64-unknown-elf/8.0.1"
+// CXX-RV64-BAREMETAL-NOSYSROOT-LP64: "-L{{.*}}/Inputs/basic_riscv64_tree/lib/gcc/riscv64-unknown-elf/8.0.1/../../..{{/|\\\\}}..{{/|\\\\}}riscv64-unknown-elf/lib"
// CXX-RV64-BAREMETAL-NOSYSROOT-LP64: "-lstdc++" "--start-group" "-lc" "-lgloss" "--end-group" "-lgcc"
// CXX-RV64-BAREMETAL-NOSYSROOT-LP64: "{{.*}}/Inputs/basic_riscv64_tree/lib/gcc/riscv64-unknown-elf/8.0.1{{/|\\\\}}crtend.o"
// RUN: %clang %s -### -no-canonical-prefixes -fuse-ld=ld \
-// RUN: -target riscv64-unknown-linux-gnu \
+// RUN: -target riscv64-unknown-linux-gnu --rtlib=platform -mabi=lp64 \
// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_linux_sdk \
// RUN: --sysroot=%S/Inputs/multilib_riscv_linux_sdk/sysroot 2>&1 \
// RUN: | FileCheck -check-prefix=C-RV64-LINUX-MULTI-LP64 %s
-// C-RV64-LINUX-MULTI-LP64: "-fuse-init-array"
-// C-RV64-LINUX-MULTI-LP64: "{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/../../../../riscv64-unknown-linux-gnu/bin{{/|\\\\}}ld"
+// C-RV64-LINUX-MULTI-LP64: "{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/../../..{{/|\\\\}}..{{/|\\\\}}riscv64-unknown-linux-gnu/bin{{/|\\\\}}ld"
// C-RV64-LINUX-MULTI-LP64: "--sysroot={{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot"
// C-RV64-LINUX-MULTI-LP64: "-m" "elf64lriscv"
// C-RV64-LINUX-MULTI-LP64: "-dynamic-linker" "/lib/ld-linux-riscv64-lp64.so.1"
@@ -84,13 +82,12 @@
// C-RV64-LINUX-MULTI-LP64: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/usr/lib64/lp64"
// RUN: %clang %s -### -no-canonical-prefixes -fuse-ld=ld \
-// RUN: -target riscv64-unknown-linux-gnu -march=rv64imafd -mabi=lp64d \
+// RUN: -target riscv64-unknown-linux-gnu --rtlib=platform -march=rv64imafd \
// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_linux_sdk \
// RUN: --sysroot=%S/Inputs/multilib_riscv_linux_sdk/sysroot 2>&1 \
// RUN: | FileCheck -check-prefix=C-RV64-LINUX-MULTI-LP64D %s
-// C-RV64-LINUX-MULTI-LP64D: "-fuse-init-array"
-// C-RV64-LINUX-MULTI-LP64D: "{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/../../../../riscv64-unknown-linux-gnu/bin{{/|\\\\}}ld"
+// C-RV64-LINUX-MULTI-LP64D: "{{.*}}/Inputs/multilib_riscv_linux_sdk/lib/gcc/riscv64-unknown-linux-gnu/7.2.0/../../..{{/|\\\\}}..{{/|\\\\}}riscv64-unknown-linux-gnu/bin{{/|\\\\}}ld"
// C-RV64-LINUX-MULTI-LP64D: "--sysroot={{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot"
// C-RV64-LINUX-MULTI-LP64D: "-m" "elf64lriscv"
// C-RV64-LINUX-MULTI-LP64D: "-dynamic-linker" "/lib/ld-linux-riscv64-lp64d.so.1"
@@ -99,6 +96,53 @@
// C-RV64-LINUX-MULTI-LP64D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/lib64/lp64d"
// C-RV64-LINUX-MULTI-LP64D: "-L{{.*}}/Inputs/multilib_riscv_linux_sdk/sysroot/usr/lib64/lp64d"
+// RUN: %clang %s -### -no-canonical-prefixes -fuse-ld=ld \
+// RUN: -target riscv64-unknown-elf --rtlib=platform --sysroot= \
+// RUN: -march=rv64imac -mabi=lp64\
+// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk 2>&1 \
+// RUN: | FileCheck -check-prefix=C-RV64IMAC-BAREMETAL-MULTI-LP64 %s
+
+// C-RV64IMAC-BAREMETAL-MULTI-LP64: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/../../..{{/|\\\\}}..{{/|\\\\}}riscv64-unknown-elf/bin{{/|\\\\}}ld"
+// C-RV64IMAC-BAREMETAL-MULTI-LP64: "-m" "elf64lriscv"
+// C-RV64IMAC-BAREMETAL-MULTI-LP64: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/../../..{{/|\\\\}}..{{/|\\\\}}riscv64-unknown-elf/lib/rv64imac/lp64{{/|\\\\}}crt0.o"
+// C-RV64IMAC-BAREMETAL-MULTI-LP64: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv64imac/lp64{{/|\\\\}}crtbegin.o"
+// C-RV64IMAC-BAREMETAL-MULTI-LP64: "-L{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0"
+// C-RV64IMAC-BAREMETAL-MULTI-LP64: "-L{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/../../..{{/|\\\\}}..{{/|\\\\}}riscv64-unknown-elf/lib"
+// C-RV64IMAC-BAREMETAL-MULTI-LP64: "--start-group" "-lc" "-lgloss" "--end-group" "-lgcc"
+// C-RV64IMAC-BAREMETAL-MULTI-LP64: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv64imac/lp64{{/|\\\\}}crtend.o"
+
+// RUN: %clang %s -### -no-canonical-prefixes -fuse-ld=ld \
+// RUN: -target riscv64-unknown-elf --rtlib=platform --sysroot= \
+// RUN: -march=rv64imafdc -mabi=lp64d \
+// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk 2>&1 \
+// RUN: | FileCheck -check-prefix=C-RV64IMAFDC-BAREMETAL-MULTI-ILP64D %s
+
+// C-RV64IMAFDC-BAREMETAL-MULTI-ILP64D: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/../../..{{/|\\\\}}..{{/|\\\\}}riscv64-unknown-elf/bin{{/|\\\\}}ld"
+// C-RV64IMAFDC-BAREMETAL-MULTI-ILP64D: "-m" "elf64lriscv"
+// C-RV64IMAFDC-BAREMETAL-MULTI-ILP64D: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/../../..{{/|\\\\}}..{{/|\\\\}}riscv64-unknown-elf/lib/rv64imafdc/lp64d{{/|\\\\}}crt0.o"
+// C-RV64IMAFDC-BAREMETAL-MULTI-ILP64D: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv64imafdc/lp64d{{/|\\\\}}crtbegin.o"
+// C-RV64IMAFDC-BAREMETAL-MULTI-ILP64D: "-L{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0"
+// C-RV64IMAFDC-BAREMETAL-MULTI-ILP64D: "-L{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/../../..{{/|\\\\}}..{{/|\\\\}}riscv64-unknown-elf/lib"
+// C-RV64IMAFDC-BAREMETAL-MULTI-ILP64D: "--start-group" "-lc" "-lgloss" "--end-group" "-lgcc"
+// C-RV64IMAFDC-BAREMETAL-MULTI-ILP64D: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv64imafdc/lp64d{{/|\\\\}}crtend.o"
+
+// Check that --rtlib can be used to override the used runtime library
+// RUN: %clang %s -### -no-canonical-prefixes \
+// RUN: -target riscv64-unknown-elf --rtlib=libgcc 2>&1 \
+// RUN: | FileCheck -check-prefix=C-RV64-RTLIB-LIBGCC-LP64 %s
+// C-RV64-RTLIB-LIBGCC-LP64: "{{.*}}crt0.o"
+// C-RV64-RTLIB-LIBGCC-LP64: "{{.*}}crtbegin.o"
+// C-RV64-RTLIB-LIBGCC-LP64: "--start-group" "-lc" "-lgloss" "--end-group" "-lgcc"
+// C-RV64-RTLIB-LIBGCC-LP64: "{{.*}}crtend.o"
+
+// RUN: %clang %s -### -no-canonical-prefixes \
+// RUN: -target riscv64-unknown-elf --rtlib=compiler-rt 2>&1 \
+// RUN: | FileCheck -check-prefix=C-RV64-RTLIB-COMPILERRT-LP64 %s
+// C-RV64-RTLIB-COMPILERRT-LP64: "{{.*}}crt0.o"
+// C-RV64-RTLIB-COMPILERRT-LP64: "{{.*}}clang_rt.crtbegin-riscv64.o"
+// C-RV64-RTLIB-COMPILERRT-LP64: "--start-group" "-lc" "-lgloss" "--end-group" "{{.*}}libclang_rt.builtins-riscv64.a"
+// C-RV64-RTLIB-COMPILERRT-LP64: "{{.*}}clang_rt.crtend-riscv64.o"
+
// RUN: %clang -target riscv64 %s -emit-llvm -S -o - | FileCheck %s
typedef __builtin_va_list va_list;
diff --git a/src/llvm-project/clang/test/Driver/sanitizer-ld.c b/src/llvm-project/clang/test/Driver/sanitizer-ld.c
index 596c1da..82a033f 100644
--- a/src/llvm-project/clang/test/Driver/sanitizer-ld.c
+++ b/src/llvm-project/clang/test/Driver/sanitizer-ld.c
@@ -16,6 +16,14 @@
// CHECK-ASAN-LINUX: "-lrt"
// CHECK-ASAN-LINUX: "-ldl"
+// RUN: %clang -fsanitize=address -fno-sanitize-link-runtime %s -### -o %t.o 2>&1 \
+// RUN: -target x86_64-unknown-linux -fuse-ld=ld \
+// RUN: -resource-dir=%S/Inputs/resource_dir \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN: | FileCheck --check-prefix=CHECK-ASAN-NO-LINK-RUNTIME-LINUX %s
+//
+// CHECK-ASAN-NO-LINK-RUNTIME-LINUX-NOT: libclang_rt.asan
+
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: -target i386-unknown-linux -fuse-ld=ld -fsanitize=address -shared-libsan \
// RUN: -resource-dir=%S/Inputs/resource_dir \
@@ -239,6 +247,14 @@
// CHECK-TSAN-LINUX-CXX: "-lrt"
// CHECK-TSAN-LINUX-CXX: "-ldl"
+// RUN: %clang -fsanitize=thread -fno-sanitize-link-runtime %s -### -o %t.o 2>&1 \
+// RUN: -target x86_64-unknown-linux -fuse-ld=ld \
+// RUN: -resource-dir=%S/Inputs/resource_dir \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN: | FileCheck --check-prefix=CHECK-TSAN-NO-LINK-RUNTIME-LINUX %s
+//
+// CHECK-TSAN-NO-LINK-RUNTIME-LINUX-NOT: libclang_rt.tsan
+
// RUN: %clangxx -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: -target x86_64-unknown-linux -fuse-ld=ld -stdlib=platform -lstdc++ \
// RUN: -fsanitize=memory \
@@ -258,6 +274,14 @@
// CHECK-MSAN-LINUX-CXX: "-lrt"
// CHECK-MSAN-LINUX-CXX: "-ldl"
+// RUN: %clang -fsanitize=memory -fno-sanitize-link-runtime %s -### -o %t.o 2>&1 \
+// RUN: -target x86_64-unknown-linux -fuse-ld=ld \
+// RUN: -resource-dir=%S/Inputs/resource_dir \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN: | FileCheck --check-prefix=CHECK-MSAN-NO-LINK-RUNTIME-LINUX %s
+//
+// CHECK-MSAN-NO-LINK-RUNTIME-LINUX-NOT: libclang_rt.msan
+
// RUN: %clang -fsanitize=undefined %s -### -o %t.o 2>&1 \
// RUN: -target i386-unknown-linux -fuse-ld=ld \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
@@ -283,6 +307,14 @@
// CHECK-UBSAN-LINUX-NOT: "-lstdc++"
// CHECK-UBSAN-LINUX: "-lpthread"
+// RUN: %clang -fsanitize=undefined -fno-sanitize-link-runtime %s -### -o %t.o 2>&1 \
+// RUN: -target x86_64-unknown-linux -fuse-ld=ld \
+// RUN: -resource-dir=%S/Inputs/resource_dir \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN: | FileCheck --check-prefix=CHECK-UBSAN-NO-LINK-RUNTIME-LINUX %s
+//
+// CHECK-UBSAN-NO-LINK-RUNTIME-LINUX-NOT: libclang_rt.undefined
+
// RUN: %clang -fsanitize=undefined %s -### -o %t.o 2>&1 \
// RUN: -target i386-unknown-linux -fuse-ld=ld \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
@@ -409,6 +441,14 @@
// CHECK-LSAN-LINUX: "-lpthread"
// CHECK-LSAN-LINUX: "-ldl"
+// RUN: %clang -fsanitize=leak -fno-sanitize-link-runtime %s -### -o %t.o 2>&1 \
+// RUN: -target x86_64-unknown-linux -fuse-ld=ld \
+// RUN: -resource-dir=%S/Inputs/resource_dir \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree \
+// RUN: | FileCheck --check-prefix=CHECK-LSAN-NO-LINK-RUNTIME-LINUX %s
+//
+// CHECK-LSAN-NO-LINK-RUNTIME-LINUX-NOT: libclang_rt.lsan
+
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: -target x86_64-unknown-linux -fuse-ld=ld -fsanitize=leak -fsanitize-coverage=func \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
diff --git a/src/llvm-project/clang/test/Driver/solaris-ld-values.c b/src/llvm-project/clang/test/Driver/solaris-ld-values.c
new file mode 100644
index 0000000..95601da
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/solaris-ld-values.c
@@ -0,0 +1,77 @@
+// General tests that the correct versions of values-*.o are used on
+// Solaris targets sane. Note that we use sysroot to make these tests
+// independent of the host system.
+
+// Check sparc-sun-solaris2.11, 32bit
+// RUN: %clang -no-canonical-prefixes -ansi %s -### -o %t.o 2>&1 \
+// RUN: --target=sparc-sun-solaris2.11 \
+// RUN: --gcc-toolchain="" \
+// RUN: --sysroot=%S/Inputs/solaris_sparc_tree \
+// RUN: | FileCheck --check-prefix=CHECK-LD-SPARC32-ANSI %s
+// CHECK-LD-SPARC32-ANSI: values-Xc.o
+// CHECK-LD-SPARC32-ANSI: values-xpg6.o
+
+// RUN: %clang -no-canonical-prefixes -std=c89 %s -### -o %t.o 2>&1 \
+// RUN: --target=sparc-sun-solaris2.11 \
+// RUN: --gcc-toolchain="" \
+// RUN: --sysroot=%S/Inputs/solaris_sparc_tree \
+// RUN: | FileCheck --check-prefix=CHECK-LD-SPARC32-C89 %s
+// CHECK-LD-SPARC32-C89: values-Xc.o
+// CHECK-LD-SPARC32-C89: values-xpg4.o
+
+// RUN: %clang -no-canonical-prefixes -std=c90 %s -### -o %t.o 2>&1 \
+// RUN: --target=sparc-sun-solaris2.11 \
+// RUN: --gcc-toolchain="" \
+// RUN: --sysroot=%S/Inputs/solaris_sparc_tree \
+// RUN: | FileCheck --check-prefix=CHECK-LD-SPARC32-C90 %s
+// CHECK-LD-SPARC32-C90: values-Xc.o
+// CHECK-LD-SPARC32-C90: values-xpg4.o
+
+// RUN: %clang -no-canonical-prefixes -std=iso9899:199409 %s -### -o %t.o 2>&1 \
+// RUN: --target=sparc-sun-solaris2.11 \
+// RUN: --gcc-toolchain="" \
+// RUN: --sysroot=%S/Inputs/solaris_sparc_tree \
+// RUN: | FileCheck --check-prefix=CHECK-LD-SPARC32-C94 %s
+// CHECK-LD-SPARC32-C94: values-Xc.o
+// CHECK-LD-SPARC32-C94: values-xpg4.o
+
+// RUN: %clang -no-canonical-prefixes -std=c11 %s -### -o %t.o 2>&1 \
+// RUN: --target=sparc-sun-solaris2.11 \
+// RUN: --gcc-toolchain="" \
+// RUN: --sysroot=%S/Inputs/solaris_sparc_tree \
+// RUN: | FileCheck --check-prefix=CHECK-LD-SPARC32-C11 %s
+// CHECK-LD-SPARC32-C11: values-Xc.o
+// CHECK-LD-SPARC32-C11: values-xpg6.o
+
+// RUN: %clang -no-canonical-prefixes -std=gnu89 %s -### -o %t.o 2>&1 \
+// RUN: --target=sparc-sun-solaris2.11 \
+// RUN: --gcc-toolchain="" \
+// RUN: --sysroot=%S/Inputs/solaris_sparc_tree \
+// RUN: | FileCheck --check-prefix=CHECK-LD-SPARC32-GNU89 %s
+// CHECK-LD-SPARC32-GNU89: values-Xa.o
+// CHECK-LD-SPARC32-GNU89: values-xpg4.o
+
+// RUN: %clang -no-canonical-prefixes -std=gnu90 %s -### -o %t.o 2>&1 \
+// RUN: --target=sparc-sun-solaris2.11 \
+// RUN: --gcc-toolchain="" \
+// RUN: --sysroot=%S/Inputs/solaris_sparc_tree \
+// RUN: | FileCheck --check-prefix=CHECK-LD-SPARC32-GNU90 %s
+// CHECK-LD-SPARC32-GNU90: values-Xa.o
+// CHECK-LD-SPARC32-GNU90: values-xpg4.o
+
+// RUN: %clang -no-canonical-prefixes -std=gnu11 %s -### -o %t.o 2>&1 \
+// RUN: --target=sparc-sun-solaris2.11 \
+// RUN: --gcc-toolchain="" \
+// RUN: --sysroot=%S/Inputs/solaris_sparc_tree \
+// RUN: | FileCheck --check-prefix=CHECK-LD-SPARC32-GNU11 %s
+// CHECK-LD-SPARC32-GNU11: values-Xa.o
+// CHECK-LD-SPARC32-GNU11: values-xpg6.o
+
+// Check i386-pc-solaris2.11, 32bit
+// RUN: %clang -no-canonical-prefixes -ansi %s -### -o %t.o 2>&1 \
+// RUN: --target=i386-pc-solaris2.11 \
+// RUN: --gcc-toolchain="" \
+// RUN: --sysroot=%S/Inputs/solaris_x86_tree \
+// RUN: | FileCheck --check-prefix=CHECK-LD-X32-ANSI %s
+// CHECK-LD-X32-ANSI: values-Xc.o
+// CHECK-LD-X32-ANSI: values-xpg6.o
diff --git a/src/llvm-project/clang/test/Driver/solaris-ld-values.cpp b/src/llvm-project/clang/test/Driver/solaris-ld-values.cpp
new file mode 100644
index 0000000..a190f12
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/solaris-ld-values.cpp
@@ -0,0 +1,45 @@
+// General tests that the correct versions of values-*.o are used on
+// Solaris targets sane. Note that we use sysroot to make these tests
+// independent of the host system.
+
+// Check sparc-sun-solaris2.11, 32bit
+// RUN: %clang -no-canonical-prefixes -ansi %s -### -o %t.o 2>&1 \
+// RUN: --target=sparc-sun-solaris2.11 \
+// RUN: --gcc-toolchain="" \
+// RUN: --sysroot=%S/Inputs/solaris_sparc_tree \
+// RUN: | FileCheck --check-prefix=CHECK-LD-SPARC32-ANSI %s
+// CHECK-LD-SPARC32-ANSI: values-Xc.o
+// CHECK-LD-SPARC32-ANSI: values-xpg6.o
+
+// RUN: %clang -no-canonical-prefixes -std=c++98 %s -### -o %t.o 2>&1 \
+// RUN: --target=sparc-sun-solaris2.11 \
+// RUN: --gcc-toolchain="" \
+// RUN: --sysroot=%S/Inputs/solaris_sparc_tree \
+// RUN: | FileCheck --check-prefix=CHECK-LD-SPARC32-CPP98 %s
+// CHECK-LD-SPARC32-CPP98: values-Xc.o
+// CHECK-LD-SPARC32-CPP98: values-xpg6.o
+
+// RUN: %clang -no-canonical-prefixes -std=c++11 %s -### -o %t.o 2>&1 \
+// RUN: --target=sparc-sun-solaris2.11 \
+// RUN: --gcc-toolchain="" \
+// RUN: --sysroot=%S/Inputs/solaris_sparc_tree \
+// RUN: | FileCheck --check-prefix=CHECK-LD-SPARC32-CPP11 %s
+// CHECK-LD-SPARC32-CPP11: values-Xc.o
+// CHECK-LD-SPARC32-CPP11: values-xpg6.o
+
+// RUN: %clang -no-canonical-prefixes -std=gnu++98 %s -### -o %t.o 2>&1 \
+// RUN: --target=sparc-sun-solaris2.11 \
+// RUN: --gcc-toolchain="" \
+// RUN: --sysroot=%S/Inputs/solaris_sparc_tree \
+// RUN: | FileCheck --check-prefix=CHECK-LD-SPARC32-GNUPP98 %s
+// CHECK-LD-SPARC32-GNUPP98: values-Xa.o
+// CHECK-LD-SPARC32-GNUPP98: values-xpg6.o
+
+// Check i386-pc-solaris2.11, 32bit
+// RUN: %clang -no-canonical-prefixes -ANSI %s -### -o %t.o 2>&1 \
+// RUN: --target=i386-pc-solaris2.11 \
+// RUN: --gcc-toolchain="" \
+// RUN: --sysroot=%S/Inputs/solaris_x86_tree \
+// RUN: | FileCheck --check-prefix=CHECK-LD-X32-ANSI %s
+// CHECK-LD-X32-ANSI: values-Xa.o
+// CHECK-LD-X32-ANSI: values-xpg6.o
diff --git a/src/llvm-project/clang/test/Driver/split-debug.c b/src/llvm-project/clang/test/Driver/split-debug.c
index 860aebb..d40207d 100644
--- a/src/llvm-project/clang/test/Driver/split-debug.c
+++ b/src/llvm-project/clang/test/Driver/split-debug.c
@@ -61,6 +61,9 @@
// CHECK-GMLT-WITH-SPLIT: "-split-dwarf-file"
// CHECK-GMLT-WITH-SPLIT: "-split-dwarf-output"
+// RUN: %clang -target x86_64-unknown-linux-gnu -g -S -### %s 2> %t
+// RUN: FileCheck -check-prefix=CHECK-NOINLINE-WITHOUT-SPLIT < %t %s
+//
// RUN: %clang -target x86_64-unknown-linux-gnu -g -fno-split-dwarf-inlining -S -### %s 2> %t
// RUN: FileCheck -check-prefix=CHECK-NOINLINE-WITHOUT-SPLIT < %t %s
//
@@ -79,7 +82,7 @@
// CHECK-SPLIT-WITH-NOINL: "-debug-info-kind=limited"
// CHECK-SPLIT-WITH-NOINL: "-split-dwarf-output"
-// RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -gmlt -S -### %s 2> %t
+// RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -gmlt -fsplit-dwarf-inlining -S -### %s 2> %t
// RUN: FileCheck -check-prefix=CHECK-GMLT-OVER-SPLIT < %t %s
//
// CHECK-GMLT-OVER-SPLIT: "-debug-info-kind=line-tables-only"
diff --git a/src/llvm-project/clang/test/Driver/split-lto-unit.c b/src/llvm-project/clang/test/Driver/split-lto-unit.c
index fab5790..6631416 100644
--- a/src/llvm-project/clang/test/Driver/split-lto-unit.c
+++ b/src/llvm-project/clang/test/Driver/split-lto-unit.c
@@ -3,8 +3,12 @@
// RUN: %clang -target x86_64-unknown-linux -### %s -flto=thin -fno-split-lto-unit 2>&1 | FileCheck --check-prefix=NOUNIT %s
// RUN: %clang -target x86_64-unknown-linux -### %s -flto=thin -fno-split-lto-unit -fwhole-program-vtables 2>&1 | FileCheck --check-prefix=ERROR1 %s
// RUN: %clang -target x86_64-unknown-linux -### %s -flto=thin -fno-split-lto-unit -fsanitize=cfi 2>&1 | FileCheck --check-prefix=ERROR2 %s
+// RUN: %clang -target x86_64-apple-darwin13.3.0 -### %s -fwhole-program-vtables -flto=full 2>&1 | FileCheck --check-prefix=UNIT %s
+// RUN: %clang -target x86_64-apple-darwin13.3.0 -### %s -fwhole-program-vtables -flto=thin 2>&1 | FileCheck --check-prefix=NOUNIT %s
+// RUN: %clang -target x86_64-scei-ps4 -### %s -fwhole-program-vtables -flto=full 2>&1 | FileCheck --check-prefix=UNIT %s
+// RUN: %clang -target x86_64-scei-ps4 -### %s -fwhole-program-vtables -flto=thin 2>&1 | FileCheck --check-prefix=NOUNIT %s
// UNIT: "-fsplit-lto-unit"
// NOUNIT-NOT: "-fsplit-lto-unit"
-// ERROR1: error: invalid argument '-fno-split-lto-unit' not allowed with '-fwhole-program-vtables'
+// ERROR1-NOT: error: invalid argument
// ERROR2: error: invalid argument '-fno-split-lto-unit' not allowed with '-fsanitize=cfi'
diff --git a/src/llvm-project/clang/test/Driver/stdlibxx-isystem.cpp b/src/llvm-project/clang/test/Driver/stdlibxx-isystem.cpp
new file mode 100644
index 0000000..827cdf9
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/stdlibxx-isystem.cpp
@@ -0,0 +1,53 @@
+// Backslash escaping makes matching against the installation directory fail on
+// Windows. Temporarily disable the test there until we add an option to print
+// the installation directory unescaped.
+// UNSUPPORTED: system-windows
+
+// By default, we should search for libc++ next to the driver.
+// RUN: mkdir -p %t/bin
+// RUN: mkdir -p %t/include/c++/v1
+// RUN: %clang -target aarch64-linux-gnu -ccc-install-dir %t/bin \
+// RUN: -stdlib=libc++ -fsyntax-only %s -### 2>&1 | \
+// RUN: FileCheck -check-prefix=LIBCXX %s
+// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %t/bin \
+// RUN: -stdlib=libc++ -fsyntax-only %s -### 2>&1 | \
+// RUN: FileCheck -check-prefix=LIBCXX %s
+// LIBCXX: InstalledDir: [[INSTALLDIR:.+$]]
+// LIBCXX: "-internal-isystem" "[[INSTALLDIR]]/../include/c++/v1"
+
+// Passing -stdlib++-isystem should suppress the default search.
+// RUN: %clang -target aarch64-linux-gnu -ccc-install-dir %t/bin \
+// RUN: -stdlib++-isystem /tmp/foo -stdlib++-isystem /tmp/bar -stdlib=libc++ \
+// RUN: -fsyntax-only %s -### 2>&1 | FileCheck -check-prefix=NODEFAULT %s
+// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %t/bin \
+// RUN: -stdlib++-isystem /tmp/foo -stdlib++-isystem /tmp/bar -stdlib=libc++ \
+// RUN: -fsyntax-only %s -### 2>&1 | FileCheck -check-prefix=NODEFAULT %s
+// NODEFAULT: InstalledDir: [[INSTALLDIR:.+$]]
+// NODEFAULT-NOT: "-internal-isystem" "[[INSTALLDIR]]/../include/c++/v1"
+
+// And we should add it as an -internal-isystem.
+// RUN: %clang -target aarch64-linux-gnu -ccc-install-dir %t/bin \
+// RUN: -stdlib++-isystem /tmp/foo -stdlib++-isystem /tmp/bar -stdlib=libc++ \
+// RUN: -fsyntax-only %s -### 2>&1 | FileCheck -check-prefix=INCPATH %s
+// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %t/bin \
+// RUN: -stdlib++-isystem /tmp/foo -stdlib++-isystem /tmp/bar -stdlib=libc++ \
+// RUN: -fsyntax-only %s -### 2>&1 | FileCheck -check-prefix=INCPATH %s
+// INCPATH: "-internal-isystem" "/tmp/foo" "-internal-isystem" "/tmp/bar"
+
+// We shouldn't pass the -stdlib++-isystem to cc1.
+// RUN: %clang -target aarch64-linux-gnu -ccc-install-dir %t/bin \
+// RUN: -stdlib++-isystem /tmp -stdlib=libc++ -fsyntax-only %s -### 2>&1 | \
+// RUN: FileCheck -check-prefix=NOCC1 %s
+// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %t/bin \
+// RUN: -stdlib++-isystem /tmp -stdlib=libc++ -fsyntax-only %s -### 2>&1 | \
+// RUN: FileCheck -check-prefix=NOCC1 %s
+// NOCC1-NOT: "-stdlib++-isystem" "/tmp"
+
+// It should respect -nostdinc++.
+// RUN: %clang -target aarch64-linux-gnu -ccc-install-dir %t/bin \
+// RUN: -stdlib++-isystem /tmp/foo -stdlib++-isystem /tmp/bar -nostdinc++ \
+// RUN: -fsyntax-only %s -### 2>&1 | FileCheck -check-prefix=NOSTDINCXX %s
+// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %t/bin \
+// RUN: -stdlib++-isystem /tmp/foo -stdlib++-isystem /tmp/bar -nostdinc++ \
+// RUN: -fsyntax-only %s -### 2>&1 | FileCheck -check-prefix=NOSTDINCXX %s
+// NOSTDINCXX-NOT: "-internal-isystem" "/tmp/foo" "-internal-isystem" "/tmp/bar"
diff --git a/src/llvm-project/clang/test/Driver/systemz-march.c b/src/llvm-project/clang/test/Driver/systemz-march.c
index 6b75152..f07a2c5 100644
--- a/src/llvm-project/clang/test/Driver/systemz-march.c
+++ b/src/llvm-project/clang/test/Driver/systemz-march.c
@@ -11,6 +11,7 @@
// RUN: %clang -target s390x -### -S -emit-llvm -march=arch11 %s 2>&1 | FileCheck --check-prefix=CHECK-ARCH11 %s
// RUN: %clang -target s390x -### -S -emit-llvm -march=z14 %s 2>&1 | FileCheck --check-prefix=CHECK-Z14 %s
// RUN: %clang -target s390x -### -S -emit-llvm -march=arch12 %s 2>&1 | FileCheck --check-prefix=CHECK-ARCH12 %s
+// RUN: %clang -target s390x -### -S -emit-llvm -march=z15 %s 2>&1 | FileCheck --check-prefix=CHECK-Z15 %s
// RUN: %clang -target s390x -### -S -emit-llvm -march=arch13 %s 2>&1 | FileCheck --check-prefix=CHECK-ARCH13 %s
// CHECK-Z9: error: unknown target CPU 'z9'
@@ -24,6 +25,7 @@
// CHECK-ARCH11: "-target-cpu" "arch11"
// CHECK-Z14: "-target-cpu" "z14"
// CHECK-ARCH12: "-target-cpu" "arch12"
+// CHECK-Z15: "-target-cpu" "z15"
// CHECK-ARCH13: "-target-cpu" "arch13"
int x;
diff --git a/src/llvm-project/clang/test/Driver/target-triple-deployment.c b/src/llvm-project/clang/test/Driver/target-triple-deployment.c
index b59f81a..351f2ac 100644
--- a/src/llvm-project/clang/test/Driver/target-triple-deployment.c
+++ b/src/llvm-project/clang/test/Driver/target-triple-deployment.c
@@ -1,14 +1,14 @@
// RUN: touch %t.o
-// RUN: %clang -target x86_64-apple-macosx10.4 -### %t.o 2> %t.log
-// RUN: %clang -target x86_64-apple-darwin9 -### %t.o 2>> %t.log
-// RUN: %clang -target x86_64-apple-macosx10.7 -### %t.o 2>> %t.log
+// RUN: %clang -target x86_64-apple-macosx10.4 -mlinker-version=400 -### %t.o 2> %t.log
+// RUN: %clang -target x86_64-apple-darwin9 -mlinker-version=400 -### %t.o 2>> %t.log
+// RUN: %clang -target x86_64-apple-macosx10.7 -mlinker-version=400 -### %t.o 2>> %t.log
//
-// RUN: %clang -target armv7-apple-ios -### %t.o 2>> %t.log
-// RUN: %clang -target armv7-apple-ios0.0 -### %t.o 2>> %t.log
-// RUN: %clang -target armv7-apple-ios1.2.3 -### %t.o 2>> %t.log
-// RUN: %clang -target armv7-apple-ios5.0 -### %t.o 2>> %t.log
-// RUN: %clang -target armv7-apple-ios7.0 -### %t.o 2>> %t.log
-// RUN: %clang -target arm64-apple-ios -### %t.o 2>> %t.log
+// RUN: %clang -target armv7-apple-ios -mlinker-version=400 -### %t.o 2>> %t.log
+// RUN: %clang -target armv7-apple-ios0.0 -mlinker-version=400 -### %t.o 2>> %t.log
+// RUN: %clang -target armv7-apple-ios1.2.3 -mlinker-version=400 -### %t.o 2>> %t.log
+// RUN: %clang -target armv7-apple-ios5.0 -mlinker-version=400 -### %t.o 2>> %t.log
+// RUN: %clang -target armv7-apple-ios7.0 -mlinker-version=400 -### %t.o 2>> %t.log
+// RUN: %clang -target arm64-apple-ios -mlinker-version=400 -### %t.o 2>> %t.log
//
// RUN: FileCheck %s < %t.log
diff --git a/src/llvm-project/clang/test/Driver/tls-size.c b/src/llvm-project/clang/test/Driver/tls-size.c
new file mode 100644
index 0000000..7e94a91
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/tls-size.c
@@ -0,0 +1,26 @@
+// Options for AArch64 ELF
+// RUN: %clang -### -target aarch64-linux-gnu -mtls-size=12 %s 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-12 %s
+// RUN: %clang -### -target aarch64-linux-gnu -mtls-size=24 %s 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-24 %s
+// RUN: %clang -### -target aarch64-linux-gnu -mtls-size=32 %s 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-32 %s
+// RUN: %clang -### -target aarch64-linux-gnu -mtls-size=48 %s 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-48 %s
+
+// Unsupported target
+// RUN: not %clang -target aarch64-unknown-windows-msvc -mtls-size=24 %s 2>&1 \
+// RUN: | FileCheck -check-prefix=UNSUPPORTED-TARGET %s
+// RUN: not %clang -target x86_64-linux-gnu -mtls-size=24 %s 2>&1 \
+// RUN: | FileCheck -check-prefix=UNSUPPORTED-TARGET %s
+
+// Invalid option value
+// RUN: not %clang -target aarch64-linux-gnu -mtls-size=0 %s 2>&1 \
+// RUN: | FileCheck -check-prefix=INVALID-VALUE %s
+
+// CHECK-12: "-cc1" {{.*}}"-mtls-size=12"
+// CHECK-24: "-cc1" {{.*}}"-mtls-size=24"
+// CHECK-32: "-cc1" {{.*}}"-mtls-size=32"
+// CHECK-48: "-cc1" {{.*}}"-mtls-size=48"
+// UNSUPPORTED-TARGET: error: unsupported option
+// INVALID-VALUE: error: invalid integral value
diff --git a/src/llvm-project/clang/test/Driver/unknown-arg.c b/src/llvm-project/clang/test/Driver/unknown-arg.c
index 074a57b..0e3e5bf 100644
--- a/src/llvm-project/clang/test/Driver/unknown-arg.c
+++ b/src/llvm-project/clang/test/Driver/unknown-arg.c
@@ -54,7 +54,7 @@
// SILENT-NOT: warning:
// CC1AS-DID-YOU-MEAN: error: unknown argument '-hell'; did you mean '-help'?
// CC1AS-DID-YOU-MEAN: error: unknown argument '--version'; did you mean '-version'?
-// UNKNOWN-INTEGRATED: error: unknown integrated tool 'asphalt'. Valid tools include '-cc1' and '-cc1as'.
+// UNKNOWN-INTEGRATED: error: unknown integrated tool '-cc1asphalt'. Valid tools include '-cc1' and '-cc1as'.
// RUN: %clang -S %s -o %t.s -Wunknown-to-clang-option 2>&1 | FileCheck --check-prefix=IGNORED %s
diff --git a/src/llvm-project/clang/test/Driver/unknown-std.cpp b/src/llvm-project/clang/test/Driver/unknown-std.cpp
index 2122a74..9ce9507 100644
--- a/src/llvm-project/clang/test/Driver/unknown-std.cpp
+++ b/src/llvm-project/clang/test/Driver/unknown-std.cpp
@@ -15,8 +15,8 @@
// CHECK-NEXT: note: use 'gnu++14' for 'ISO C++ 2014 with amendments and GNU extensions' standard
// CHECK-NEXT: note: use 'c++17' for 'ISO C++ 2017 with amendments' standard
// CHECK-NEXT: note: use 'gnu++17' for 'ISO C++ 2017 with amendments and GNU extensions' standard
-// CHECK-NEXT: note: use 'c++2a' for 'Working draft for ISO C++ 2020' standard
-// CHECK-NEXT: note: use 'gnu++2a' for 'Working draft for ISO C++ 2020 with GNU extensions' standard
+// CHECK-NEXT: note: use 'c++20' for 'ISO C++ 2020 DIS' standard
+// CHECK-NEXT: note: use 'gnu++20' for 'ISO C++ 2020 DIS with GNU extensions' standard
// CUDA-NEXT: note: use 'cuda' for 'NVIDIA CUDA(tm)' standard
// Make sure that no other output is present.
diff --git a/src/llvm-project/clang/test/Driver/verbose-output-quoting.c b/src/llvm-project/clang/test/Driver/verbose-output-quoting.c
index 1e1afdb..b2781b7 100644
--- a/src/llvm-project/clang/test/Driver/verbose-output-quoting.c
+++ b/src/llvm-project/clang/test/Driver/verbose-output-quoting.c
@@ -1,10 +1,10 @@
// REQUIRES: shell
-// RUN: %clang --verbose -DSPACE="a b" -c %s 2>&1 | FileCheck -check-prefix=SPACE -strict-whitespace %s
-// RUN: %clang --verbose -DQUOTES=\"\" -c %s 2>&1 | FileCheck -check-prefix=QUOTES -strict-whitespace %s
-// RUN: %clang --verbose -DBACKSLASH=\\ -c %s 2>&1 | FileCheck -check-prefix=BACKSLASH -strict-whitespace %s
-// RUN: %clang --verbose -DDOLLAR=\$ -c %s 2>&1 | FileCheck -check-prefix=DOLLAR -strict-whitespace %s
+// RUN: %clang --verbose -DSPACE="a b" -### %s 2>&1 | FileCheck -check-prefix=SPACE -strict-whitespace %s
+// RUN: %clang --verbose -DQUOTES=\"\" -### %s 2>&1 | FileCheck -check-prefix=QUOTES -strict-whitespace %s
+// RUN: %clang --verbose -DBACKSLASH=\\ -### %s 2>&1 | FileCheck -check-prefix=BACKSLASH -strict-whitespace %s
+// RUN: %clang --verbose -DDOLLAR=\$ -### %s 2>&1 | FileCheck -check-prefix=DOLLAR -strict-whitespace %s
-// SPACE: -cc1 {{.*}} -D "SPACE=a b"
-// QUOTES: -cc1 {{.*}} -D "QUOTES=\"\""
-// BACKSLASH: -cc1 {{.*}} -D "BACKSLASH=\\"
-// DOLLAR: -cc1 {{.*}} -D "DOLLAR=\$"
+// SPACE: "-cc1" {{.*}} "-D" "SPACE=a b"
+// QUOTES: "-cc1" {{.*}} "-D" "QUOTES=\"\""
+// BACKSLASH: "-cc1" {{.*}} "-D" "BACKSLASH=\\"
+// DOLLAR: "-cc1" {{.*}} "-D" "DOLLAR=\$"
diff --git a/src/llvm-project/clang/test/Driver/virtual-function-elimination.cpp b/src/llvm-project/clang/test/Driver/virtual-function-elimination.cpp
new file mode 100644
index 0000000..3a026bb
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/virtual-function-elimination.cpp
@@ -0,0 +1,11 @@
+// RUN: %clang -target x86_64-unknown-linux -fvirtual-function-elimination -### %s 2>&1 | FileCheck --check-prefix=BAD-LTO %s
+// RUN: %clang -target x86_64-unknown-linux -fvirtual-function-elimination -flto=thin -### %s 2>&1 | FileCheck --check-prefix=BAD-LTO %s
+// BAD-LTO: invalid argument '-fvirtual-function-elimination' only allowed with '-flto=full'
+
+// RUN: %clang -target x86_64-unknown-linux -fvirtual-function-elimination -flto -### %s 2>&1 | FileCheck --check-prefix=GOOD %s
+// RUN: %clang -target x86_64-unknown-linux -fvirtual-function-elimination -flto=full -### %s 2>&1 | FileCheck --check-prefix=GOOD %s
+// RUN: %clang -target x86_64-unknown-linux -fvirtual-function-elimination -flto -fwhole-program-vtables -### %s 2>&1 | FileCheck --check-prefix=GOOD %s
+// GOOD: "-fvirtual-function-elimination" "-fwhole-program-vtables"
+
+// RUN: %clang -target x86_64-unknown-linux -fvirtual-function-elimination -fno-whole-program-vtables -flto -### %s 2>&1 | FileCheck --check-prefix=NO-WHOLE-PROGRAM-VTABLES %s
+// NO-WHOLE-PROGRAM-VTABLES: invalid argument '-fno-whole-program-vtables' not allowed with '-fvirtual-function-elimination'
diff --git a/src/llvm-project/clang/test/Driver/warning-options_pedantic.cpp b/src/llvm-project/clang/test/Driver/warning-options_pedantic.cpp
index 4dbf92d..f3c9969 100644
--- a/src/llvm-project/clang/test/Driver/warning-options_pedantic.cpp
+++ b/src/llvm-project/clang/test/Driver/warning-options_pedantic.cpp
@@ -1,6 +1,6 @@
// Make sure we don't match the -NOT lines with the linker invocation.
// Delimiters match the start of the cc1 and the start of the linker lines
-// DELIMITERS: {{^ *"}}
+// DELIMITERS: {{^ (\(in-process\)|")}}
// RUN: %clang -### -pedantic -no-pedantic %s 2>&1 | FileCheck -check-prefix=NO_PEDANTIC -check-prefix=DELIMITERS %s
// RUN: %clang -### -pedantic -Wno-pedantic %s 2>&1 | FileCheck -check-prefix=PEDANTIC -check-prefix=DELIMITERS %s
diff --git a/src/llvm-project/clang/test/Driver/wasm-toolchain-lto.c b/src/llvm-project/clang/test/Driver/wasm-toolchain-lto.c
new file mode 100644
index 0000000..2162073
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/wasm-toolchain-lto.c
@@ -0,0 +1,6 @@
+// A basic C link command-line with optimization with known OS and LTO enabled.
+
+// RUN: %clang -### -O2 -flto -no-canonical-prefixes -target wasm32-wasi --sysroot=/foo %s 2>&1 \
+// RUN: | FileCheck -check-prefix=LINK_OPT_KNOWN %s
+// LINK_OPT_KNOWN: clang{{.*}}" "-cc1" {{.*}} "-o" "[[temp:[^"]*]]"
+// LINK_OPT_KNOWN: wasm-ld{{.*}}" "-L/foo/lib/wasm32-wasi/llvm-lto/
diff --git a/src/llvm-project/clang/test/Driver/wasm-toolchain.c b/src/llvm-project/clang/test/Driver/wasm-toolchain.c
index 263fcf7..343c1b0 100644
--- a/src/llvm-project/clang/test/Driver/wasm-toolchain.c
+++ b/src/llvm-project/clang/test/Driver/wasm-toolchain.c
@@ -48,11 +48,11 @@
// Thread-related command line tests.
-// '-pthread' sets +atomics, +bulk-memory, +mutable-globals, and --shared-memory
+// '-pthread' sets +atomics, +bulk-memory, +mutable-globals, +sign-ext, and --shared-memory
// RUN: %clang -### -no-canonical-prefixes -target wasm32-unknown-unknown \
// RUN: --sysroot=/foo %s -fuse-ld=wasm-ld -pthread 2>&1 \
// RUN: | FileCheck -check-prefix=PTHREAD %s
-// PTHREAD: clang{{.*}}" "-cc1" {{.*}} "-target-feature" "+atomics" "-target-feature" "+bulk-memory" "-target-feature" "+mutable-globals"
+// PTHREAD: clang{{.*}}" "-cc1" {{.*}} "-target-feature" "+atomics" "-target-feature" "+bulk-memory" "-target-feature" "+mutable-globals" "-target-feature" "+sign-ext"
// PTHREAD: wasm-ld{{.*}}" "-lpthread" "--shared-memory"
// '-pthread' not allowed with '-mno-atomics'
@@ -73,6 +73,37 @@
// RUN: | FileCheck -check-prefix=PTHREAD_NO_MUT_GLOBALS %s
// PTHREAD_NO_MUT_GLOBALS: invalid argument '-pthread' not allowed with '-mno-mutable-globals'
+// '-pthread' not allowed with '-mno-sign-ext'
+// RUN: %clang -### -no-canonical-prefixes -target wasm32-unknown-unknown \
+// RUN: --sysroot=/foo %s -pthread -mno-sign-ext 2>&1 \
+// RUN: | FileCheck -check-prefix=PTHREAD_NO_SIGN_EXT %s
+// PTHREAD_NO_SIGN_EXT: invalid argument '-pthread' not allowed with '-mno-sign-ext'
+
+// '-fwasm-exceptions' sets +exception-handling and +reference-types
+// RUN: %clang -### -no-canonical-prefixes -target wasm32-unknown-unknown \
+// RUN: --sysroot=/foo %s -fwasm-exceptions 2>&1 \
+// RUN: | FileCheck -check-prefix=WASM_EXCEPTIONS %s
+// WASM_EXCEPTIONS: clang{{.*}}" "-cc1" {{.*}} "-target-feature" "+exception-handling" "-target-feature" "+reference-types"
+
+// '-fwasm-exceptions' not allowed with '-mno-exception-handling'
+// RUN: %clang -### -no-canonical-prefixes -target wasm32-unknown-unknown \
+// RUN: --sysroot=/foo %s -fwasm-exceptions -mno-exception-handling 2>&1 \
+// RUN: | FileCheck -check-prefix=WASM_EXCEPTIONS_NO_EH %s
+// WASM_EXCEPTIONS_NO_EH: invalid argument '-fwasm-exceptions' not allowed with '-mno-exception-handling'
+
+// '-fwasm-exceptions' not allowed with '-mno-reference-types'
+// RUN: %clang -### -no-canonical-prefixes -target wasm32-unknown-unknown \
+// RUN: --sysroot=/foo %s -fwasm-exceptions -mno-reference-types 2>&1 \
+// RUN: | FileCheck -check-prefix=WASM_EXCEPTIONS_NO_REFTYPES %s
+// WASM_EXCEPTIONS_NO_REFTYPES: invalid argument '-fwasm-exceptions' not allowed with '-mno-reference-types'
+
+// '-fwasm-exceptions' not allowed with
+// '-mllvm -enable-emscripten-cxx-exceptions'
+// RUN: %clang -### -no-canonical-prefixes -target wasm32-unknown-unknown \
+// RUN: --sysroot=/foo %s -fwasm-exceptions -mllvm -enable-emscripten-cxx-exceptions 2>&1 \
+// RUN: | FileCheck -check-prefix=WASM_EXCEPTIONS_EMSCRIPTEN_EH %s
+// WASM_EXCEPTIONS_EMSCRIPTEN_EH: invalid argument '-fwasm-exceptions' not allowed with '-mllvm -enable-emscripten-cxx-exceptions'
+
// RUN: %clang %s -### -fsanitize=address -target wasm32-unknown-emscripten 2>&1 | FileCheck -check-prefix=CHECK-ASAN-EMSCRIPTEN %s
// CHECK-ASAN-EMSCRIPTEN: "-fsanitize=address"
// CHECK-ASAN-EMSCRIPTEN: "-fsanitize-address-globals-dead-stripping"
diff --git a/src/llvm-project/clang/test/Driver/woa-fp.c b/src/llvm-project/clang/test/Driver/woa-fp.c
index f851e93..7848252 100644
--- a/src/llvm-project/clang/test/Driver/woa-fp.c
+++ b/src/llvm-project/clang/test/Driver/woa-fp.c
@@ -34,7 +34,7 @@
// RUN: %clang -target armv7-windows-itanium -fno-omit-frame-pointer -### -S %s -O3 -o /dev/null 2>&1 | FileCheck %s -check-prefix CHECK-NO-FPO
// RUN: %clang -target armv7-windows-itanium -fno-omit-frame-pointer -### -S %s -Os -o /dev/null 2>&1 | FileCheck %s -check-prefix CHECK-NO-FPO
-// CHECK-DEFAULT: "-mdisable-fp-elim"
-// CHECK-FPO-NOT: "-mdisable-fp-elim"
-// CHECK-NO-FPO: "-mdisable-fp-elim"
+// CHECK-DEFAULT: "-mframe-pointer=all"
+// CHECK-FPO-NOT: "-mframe-pointer=all"
+// CHECK-NO-FPO: "-mframe-pointer=all"
diff --git a/src/llvm-project/clang/test/Driver/working-directory.c b/src/llvm-project/clang/test/Driver/working-directory.c
index 15ba8f0..bba9574 100644
--- a/src/llvm-project/clang/test/Driver/working-directory.c
+++ b/src/llvm-project/clang/test/Driver/working-directory.c
@@ -1,3 +1,11 @@
-// RUN: %clang -### -working-directory /no/such/dir/ input 2>&1 | FileCheck %s
+// RUN: %clang -### -coverage -working-directory /no/such/dir/ input 2>&1 | FileCheck %s
+// RUN: %clang -### -coverage -working-directory %p/Inputs no_such_file.cpp -c 2>&1 | FileCheck %s --check-prefix=CHECK_NO_FILE
+// RUN: %clang -### -coverage -working-directory %p/Inputs pchfile.cpp -c 2>&1 | FileCheck %s --check-prefix=CHECK_WORKS
-//CHECK: no such file or directory: '/no/such/dir/input'
+// CHECK: unable to set working directory: /no/such/dir/
+
+// CHECK_NO_FILE: no such file or directory: 'no_such_file.cpp'
+
+// CHECK_WORKS: "-coverage-notes-file" "{{[^"]+}}test{{/|\\\\}}Driver{{/|\\\\}}Inputs{{/|\\\\}}pchfile.gcno"
+// CHECK_WORKS: "-working-directory" "{{[^"]+}}test{{/|\\\\}}Driver{{/|\\\\}}Inputs"
+// CHECK_WORKS: "-fdebug-compilation-dir" "{{[^"]+}}test{{/|\\\\}}Driver{{/|\\\\}}Inputs"
diff --git a/src/llvm-project/clang/test/Driver/x86-malign-branch.c b/src/llvm-project/clang/test/Driver/x86-malign-branch.c
new file mode 100644
index 0000000..6098caf
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/x86-malign-branch.c
@@ -0,0 +1,39 @@
+/// Test that -malign-branch* and -mbranches-within-32B-boundaries are parsed and converted to -mllvm options.
+
+/// Test -malign-branch-boundary=
+// RUN: %clang -target x86_64 -malign-branch-boundary=16 %s -c -### 2>&1 | FileCheck %s --check-prefix=BOUNDARY
+// BOUNDARY: "-mllvm" "-x86-align-branch-boundary=16"
+
+// RUN: %clang -target x86_64 -malign-branch-boundary=8 %s -c -### 2>&1 | FileCheck %s --check-prefix=BOUNDARY-ERR
+// RUN: %clang -target x86_64 -malign-branch-boundary=15 %s -c -### 2>&1 | FileCheck %s --check-prefix=BOUNDARY-ERR
+// BOUNDARY-ERR: invalid argument {{.*}} to -malign-branch-boundary=
+
+/// Test -malign-branch=
+// RUN: %clang -target x86_64 -malign-branch=fused,jcc,jmp %s -c -### %s 2>&1 | FileCheck %s --check-prefix=TYPE0
+// TYPE0: "-mllvm" "-x86-align-branch=fused+jcc+jmp"
+// RUN: %clang -target x86_64 -malign-branch=fused,jcc,jmp,ret,call,indirect %s -c -### %s 2>&1 | FileCheck %s --check-prefix=TYPE1
+// TYPE1: "-mllvm" "-x86-align-branch=fused+jcc+jmp+ret+call+indirect"
+
+// RUN: %clang -target x86_64 -malign-branch=fused,foo,bar %s -c -### %s 2>&1 | FileCheck %s --check-prefix=TYPE-ERR
+// TYPE-ERR: invalid argument 'foo' to -malign-branch=; each element must be one of: fused, jcc, jmp, call, ret, indirect
+// TYPE-ERR: invalid argument 'bar' to -malign-branch=; each element must be one of: fused, jcc, jmp, call, ret, indirect
+
+/// Test -malign-branch-prefix-size=
+// RUN: %clang -target x86_64 -malign-branch-prefix-size=0 %s -c -### 2>&1 | FileCheck %s --check-prefix=PREFIX-0
+// PREFIX-0: "-mllvm" "-x86-align-branch-prefix-size=0"
+// RUN: %clang -target x86_64 -malign-branch-prefix-size=5 %s -c -### 2>&1 | FileCheck %s --check-prefix=PREFIX-5
+// PREFIX-5: "-mllvm" "-x86-align-branch-prefix-size=5"
+
+// RUN: %clang -target x86_64 -malign-branch-prefix-size=6 %s -c -### 2>&1 | FileCheck %s --check-prefix=PREFIX-6
+// PREFIX-6: invalid argument
+
+/// Test -mbranches-within-32B-boundaries
+// RUN: %clang -target x86_64 -mbranches-within-32B-boundaries %s -c -### 2>&1 | FileCheck %s --check-prefix=32B
+// 32B: "-mllvm" "-x86-branches-within-32B-boundaries"
+
+/// Unsupported on other targets.
+// RUN: %clang -target aarch64 -malign-branch=jmp %s -c -### 2>&1 | FileCheck --check-prefix=UNUSED %s
+// RUN: %clang -target aarch64 -malign-branch-boundary=7 %s -c -### 2>&1 | FileCheck --check-prefix=UNUSED %s
+// RUN: %clang -target aarch64 -malign-branch-prefix-size=15 %s -c -### 2>&1 | FileCheck --check-prefix=UNUSED %s
+// RUN: %clang -target aarch64 -mbranches-within-32B-boundaries %s -c -### 2>&1 | FileCheck --check-prefix=UNUSED %s
+// UNUSED: warning: argument unused
diff --git a/src/llvm-project/clang/test/Driver/x86-malign-branch.s b/src/llvm-project/clang/test/Driver/x86-malign-branch.s
new file mode 100644
index 0000000..280a84e
--- /dev/null
+++ b/src/llvm-project/clang/test/Driver/x86-malign-branch.s
@@ -0,0 +1,13 @@
+/// Test that -malign-branch* and -mbranches-within-32B-boundaries are handled for assembly files.
+
+// RUN: %clang -target x86_64 -malign-branch-boundary=16 %s -c -### 2>&1 | FileCheck %s --check-prefix=BOUNDARY
+// BOUNDARY: "-mllvm" "-x86-align-branch-boundary=16"
+
+// RUN: %clang -target x86_64 -malign-branch=fused,jcc,jmp %s -c -### %s 2>&1 | FileCheck %s --check-prefix=TYPE
+// TYPE: "-mllvm" "-x86-align-branch=fused+jcc+jmp"
+
+// RUN: %clang -target x86_64 -malign-branch-prefix-size=5 %s -c -### 2>&1 | FileCheck %s --check-prefix=PREFIX
+// PREFIX: "-mllvm" "-x86-align-branch-prefix-size=5"
+
+// RUN: %clang -target x86_64 -mbranches-within-32B-boundaries %s -c -### 2>&1 | FileCheck %s --check-prefix=32B
+// 32B: "-mllvm" "-x86-branches-within-32B-boundaries"
diff --git a/src/llvm-project/clang/test/Driver/x86-march.c b/src/llvm-project/clang/test/Driver/x86-march.c
index ba900bb..87fdf62 100644
--- a/src/llvm-project/clang/test/Driver/x86-march.c
+++ b/src/llvm-project/clang/test/Driver/x86-march.c
@@ -76,6 +76,10 @@
// RUN: | FileCheck %s -check-prefix=icelake-server
// icelake-server: "-target-cpu" "icelake-server"
//
+// RUN: %clang -target x86_64-unknown-unknown -c -### %s -march=tigerlake 2>&1 \
+// RUN: | FileCheck %s -check-prefix=tigerlake
+// tigerlake: "-target-cpu" "tigerlake"
+//
// RUN: %clang -target x86_64-unknown-unknown -c -### %s -march=lakemont 2>&1 \
// RUN: | FileCheck %s -check-prefix=lakemont
// lakemont: "-target-cpu" "lakemont"
diff --git a/src/llvm-project/clang/test/Driver/x86-target-features.c b/src/llvm-project/clang/test/Driver/x86-target-features.c
index ed9c0af..9a406b5 100644
--- a/src/llvm-project/clang/test/Driver/x86-target-features.c
+++ b/src/llvm-project/clang/test/Driver/x86-target-features.c
@@ -72,8 +72,8 @@
// RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mmpx %s -### -o %t.o 2>&1 | FileCheck -check-prefix=MPX %s
// RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mno-mpx %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-MPX %s
-// MPX: "-target-feature" "+mpx"
-// NO-MPX: "-target-feature" "-mpx"
+// MPX: the flag '-mmpx' has been deprecated and will be ignored
+// NO-MPX: the flag '-mno-mpx' has been deprecated and will be ignored
// RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mshstk %s -### -o %t.o 2>&1 | FileCheck -check-prefix=CETSS %s
// RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mno-shstk %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-CETSS %s
@@ -193,3 +193,8 @@
// RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mno-enqcmd %s -### -o %t.o 2>&1 | FileCheck --check-prefix=NO-ENQCMD %s
// ENQCMD: "-target-feature" "+enqcmd"
// NO-ENQCMD: "-target-feature" "-enqcmd"
+
+// RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mvzeroupper %s -### -o %t.o 2>&1 | FileCheck --check-prefix=VZEROUPPER %s
+// RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mno-vzeroupper %s -### -o %t.o 2>&1 | FileCheck --check-prefix=NO-VZEROUPPER %s
+// VZEROUPPER: "-target-feature" "+vzeroupper"
+// NO-VZEROUPPER: "-target-feature" "-vzeroupper"
diff --git a/src/llvm-project/clang/test/Driver/xcore-opts.c b/src/llvm-project/clang/test/Driver/xcore-opts.c
index 9300085..2bf5796 100644
--- a/src/llvm-project/clang/test/Driver/xcore-opts.c
+++ b/src/llvm-project/clang/test/Driver/xcore-opts.c
@@ -3,9 +3,8 @@
// RUN: %clang -target xcore -x c++ %s -fexceptions -### -o %t.o 2>&1 | FileCheck -check-prefix CHECK-EXCEP %s
// RUN: %clang -target xcore %s -g0 -### -o %t.o 2>&1 | FileCheck -check-prefix CHECK-G0 %s
+// CHECK: "-mframe-pointer=none"
// CHECK: "-nostdsysteminc"
-// CHECK: "-momit-leaf-frame-pointer"
-// CHECK-NOT: "-mdisable-fp-elim"
// CHECK: "-fno-signed-char"
// CHECK: "-fno-use-cxa-atexit"
// CHECK-NOT: "-fcxx-exceptions"
diff --git a/src/llvm-project/clang/test/FixIt/fixit-c++2a.cpp b/src/llvm-project/clang/test/FixIt/fixit-c++2a.cpp
index c97bb7a..6fe05da 100644
--- a/src/llvm-project/clang/test/FixIt/fixit-c++2a.cpp
+++ b/src/llvm-project/clang/test/FixIt/fixit-c++2a.cpp
@@ -1,7 +1,8 @@
-// RUN: %clang_cc1 -verify -std=c++2a %s
+// RUN: %clang_cc1 -verify -std=c++2a -pedantic-errors %s
// RUN: cp %s %t
// RUN: not %clang_cc1 -x c++ -std=c++2a -fixit %t
-// RUN: %clang_cc1 -Wall -pedantic -x c++ -std=c++2a %t
+// RUN: %clang_cc1 -Wall -pedantic-errors -x c++ -std=c++2a %t
+// RUN: cat %t | FileCheck %s
/* This is a test of the various code modification hints that only
apply in C++2a. */
@@ -13,3 +14,36 @@
[&...a]{}; // expected-error {{must appear after the name}}
[...&a]{}; // expected-error {{must appear after the name}}
}
+
+namespace constinit_mismatch {
+ extern thread_local constinit int a; // expected-note {{declared constinit here}}
+ thread_local int a = 123; // expected-error {{'constinit' specifier missing on initializing declaration of 'a'}}
+ // CHECK: {{^}} constinit thread_local int a = 123;
+
+ int b = 123; // expected-note {{add the 'constinit' specifier}}
+ extern constinit int b; // expected-error {{'constinit' specifier added after initialization of variable}}
+ // CHECK: {{^}} extern int b;
+
+ template<typename> struct X {
+ template<int> static constinit int n; // expected-note {{constinit}}
+ };
+ template<typename T> template<int N>
+ int X<T>::n = 123; // expected-error {{missing}}
+ // CHECK: {{^}} constinit int X<T>::n = 123;
+
+#define ABSL_CONST_INIT [[clang::require_constant_initialization]]
+ extern constinit int c; // expected-note {{constinit}}
+ int c; // expected-error {{missing}}
+ // CHECK: {{^}} ABSL_CONST_INIT int c;
+
+#define MY_CONST_INIT constinit
+ extern constinit int d; // expected-note {{constinit}}
+ int d; // expected-error {{missing}}
+ // CHECK: {{^}} MY_CONST_INIT int d;
+#undef MY_CONST_INIT
+
+ extern constinit int e; // expected-note {{constinit}}
+ int e; // expected-error {{missing}}
+ // CHECK: {{^}} ABSL_CONST_INIT int e;
+#undef ABSL_CONST_INIT
+}
diff --git a/src/llvm-project/clang/test/FixIt/format.m b/src/llvm-project/clang/test/FixIt/format.m
index 40655a0..ef27b1b 100644
--- a/src/llvm-project/clang/test/FixIt/format.m
+++ b/src/llvm-project/clang/test/FixIt/format.m
@@ -205,9 +205,7 @@
// CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:11-[[@LINE-1]]:13}:"%f"
// CHECK-NOT: fix-it:"{{.*}}":{[[@LINE-2]]:16-[[@LINE-2]]:16}:"(unichar)"
- 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)"
+ NSLog(@"%C", (char)0x260300);
NSLog(@"%C", 'a'); // 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"
diff --git a/src/llvm-project/clang/test/Format/dry-run-alias.cpp b/src/llvm-project/clang/test/Format/dry-run-alias.cpp
new file mode 100644
index 0000000..41ccc8f
--- /dev/null
+++ b/src/llvm-project/clang/test/Format/dry-run-alias.cpp
@@ -0,0 +1,4 @@
+// RUN: clang-format -style=LLVM -i -n %s 2> %t.stderr
+// RUN: grep -E "(.*)code should be clang-formatted(.*)" %t.stderr
+
+int a ;
diff --git a/src/llvm-project/clang/test/Format/dry-run.cpp b/src/llvm-project/clang/test/Format/dry-run.cpp
new file mode 100644
index 0000000..78498a6
--- /dev/null
+++ b/src/llvm-project/clang/test/Format/dry-run.cpp
@@ -0,0 +1,4 @@
+// RUN: clang-format -style=LLVM -i --dry-run %s 2> %t.stderr
+// RUN: grep -E "(.*)code should be clang-formatted(.*)" %t.stderr
+
+int a ;
diff --git a/src/llvm-project/clang/test/Format/style-on-command-line.cpp b/src/llvm-project/clang/test/Format/style-on-command-line.cpp
index 0e6078e..ba06bab 100644
--- a/src/llvm-project/clang/test/Format/style-on-command-line.cpp
+++ b/src/llvm-project/clang/test/Format/style-on-command-line.cpp
@@ -39,4 +39,4 @@
// On Windows, the 'rm' commands fail when the previous process is still alive.
// This happens enough to make the test useless.
-// REQUIRES: shell
+// UNSUPPORTED: system-windows
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/NextIncludes/rewrite-includes9.h b/src/llvm-project/clang/test/Frontend/Inputs/NextIncludes/rewrite-includes9.h
index b074bd1..75e4c96 100644
--- a/src/llvm-project/clang/test/Frontend/Inputs/NextIncludes/rewrite-includes9.h
+++ b/src/llvm-project/clang/test/Frontend/Inputs/NextIncludes/rewrite-includes9.h
@@ -1 +1 @@
-included_line9
+int included_line9;
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_sanitizer_blacklist/share/ubsan_blacklist.txt
similarity index 100%
rename from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
rename to src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_sanitizer_blacklist/share/ubsan_blacklist.txt
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/rewrite-includes1.h b/src/llvm-project/clang/test/Frontend/Inputs/rewrite-includes1.h
index 1b6c80d..3312f9f 100644
--- a/src/llvm-project/clang/test/Frontend/Inputs/rewrite-includes1.h
+++ b/src/llvm-project/clang/test/Frontend/Inputs/rewrite-includes1.h
@@ -1,3 +1,3 @@
#pragma clang system_header
-included_line1
+int included_line1;
#include "rewrite-includes2.h"
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/rewrite-includes2.h b/src/llvm-project/clang/test/Frontend/Inputs/rewrite-includes2.h
index 1114e51..d1097c8 100644
--- a/src/llvm-project/clang/test/Frontend/Inputs/rewrite-includes2.h
+++ b/src/llvm-project/clang/test/Frontend/Inputs/rewrite-includes2.h
@@ -1 +1 @@
-included_line2
+int included_line2;
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/rewrite-includes3.h b/src/llvm-project/clang/test/Frontend/Inputs/rewrite-includes3.h
index 3757bc8..2abf780 100644
--- a/src/llvm-project/clang/test/Frontend/Inputs/rewrite-includes3.h
+++ b/src/llvm-project/clang/test/Frontend/Inputs/rewrite-includes3.h
@@ -1 +1 @@
-included_line3
+unsigned int included_line3 = -10;
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/rewrite-includes4.h b/src/llvm-project/clang/test/Frontend/Inputs/rewrite-includes4.h
index b4e25d2..7a44201 100644
--- a/src/llvm-project/clang/test/Frontend/Inputs/rewrite-includes4.h
+++ b/src/llvm-project/clang/test/Frontend/Inputs/rewrite-includes4.h
@@ -1 +1 @@
-included_line4
+int included_line4;
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/rewrite-includes5.h b/src/llvm-project/clang/test/Frontend/Inputs/rewrite-includes5.h
index 934bf41..0de1211 100644
--- a/src/llvm-project/clang/test/Frontend/Inputs/rewrite-includes5.h
+++ b/src/llvm-project/clang/test/Frontend/Inputs/rewrite-includes5.h
@@ -1 +1 @@
-included_line5
+int included_line5;
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/rewrite-includes6.h b/src/llvm-project/clang/test/Frontend/Inputs/rewrite-includes6.h
index c18e501..5d89144 100644
--- a/src/llvm-project/clang/test/Frontend/Inputs/rewrite-includes6.h
+++ b/src/llvm-project/clang/test/Frontend/Inputs/rewrite-includes6.h
@@ -1,2 +1,2 @@
#pragma once
-included_line6
+int included_line6;
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/rewrite-includes7.h b/src/llvm-project/clang/test/Frontend/Inputs/rewrite-includes7.h
index da00d4f..221bab8 100644
--- a/src/llvm-project/clang/test/Frontend/Inputs/rewrite-includes7.h
+++ b/src/llvm-project/clang/test/Frontend/Inputs/rewrite-includes7.h
@@ -1,4 +1,4 @@
#ifndef REWRITE_INCLUDES_7
#define REWRITE_INCLUDES_7
-included_line7
+int included_line7;
#endif
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Frontend/Inputs/sysroot_x86_64_cross_linux_tree/lib/.keep
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Frontend/Inputs/sysroot_x86_64_cross_linux_tree/lib/.keep
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Frontend/Inputs/sysroot_x86_64_cross_linux_tree/usr/include/c++/.keep
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Frontend/Inputs/sysroot_x86_64_cross_linux_tree/usr/include/c++/.keep
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Frontend/Inputs/sysroot_x86_64_cross_linux_tree/usr/lib/gcc/.keep
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Frontend/Inputs/sysroot_x86_64_cross_linux_tree/usr/lib/gcc/.keep
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Frontend/Inputs/sysroot_x86_64_cross_linux_tree/usr/local/include/.keep
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Frontend/Inputs/sysroot_x86_64_cross_linux_tree/usr/local/include/.keep
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Frontend/Inputs/sysroot_x86_64_cross_linux_tree/usr/local/lib/.keep
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Frontend/Inputs/sysroot_x86_64_cross_linux_tree/usr/local/lib/.keep
diff --git a/src/llvm-project/clang/test/Frontend/aarch64-target-cpu.c b/src/llvm-project/clang/test/Frontend/aarch64-target-cpu.c
index c803694..4055dde 100644
--- a/src/llvm-project/clang/test/Frontend/aarch64-target-cpu.c
+++ b/src/llvm-project/clang/test/Frontend/aarch64-target-cpu.c
@@ -6,7 +6,7 @@
// RUN: %clang_cc1 -triple aarch64-unknown-unknown -target-cpu cortex-a72 -verify %s
// RUN: %clang_cc1 -triple aarch64-unknown-unknown -target-cpu cortex-a73 -verify %s
// RUN: %clang_cc1 -triple aarch64-unknown-unknown -target-cpu cyclone -verify %s
-// RUN: %clang_cc1 -triple aarch64-unknown-unknown -target-cpu exynos-m1 -verify %s
+// RUN: %clang_cc1 -triple aarch64-unknown-unknown -target-cpu exynos-m3 -verify %s
// RUN: %clang_cc1 -triple aarch64-unknown-unknown -target-cpu generic -verify %s
// RUN: %clang_cc1 -triple aarch64-unknown-unknown -target-cpu kryo -verify %s
// RUN: %clang_cc1 -triple aarch64-unknown-unknown -target-cpu thunderx2t99 -verify %s
diff --git a/src/llvm-project/clang/test/Frontend/absolute-paths-symlinks.c b/src/llvm-project/clang/test/Frontend/absolute-paths-symlinks.c
new file mode 100644
index 0000000..8170910b
--- /dev/null
+++ b/src/llvm-project/clang/test/Frontend/absolute-paths-symlinks.c
@@ -0,0 +1,17 @@
+// RUN: rm -rf %t
+// RUN: mkdir %t
+// RUN: cd %t
+// RUN: cp %s test.c
+// RUN: ln -sf test.c link.c
+// RUN: not %clang_cc1 -fsyntax-only -fdiagnostics-absolute-paths link.c 2>&1 | FileCheck %s
+
+// Verify that -fdiagnostics-absolute-paths resolve symbolic links in
+// diagnostics messages.
+
+// CHECK: test.c
+// CHECK-SAME: error: unknown type name
+This do not compile
+
+// REQUIRES: shell
+// Don't make symlinks on Windows.
+// UNSUPPORTED: system-windows
diff --git a/src/llvm-project/clang/test/Frontend/absolute-paths.c b/src/llvm-project/clang/test/Frontend/absolute-paths.c
index 4782162..07c8183 100644
--- a/src/llvm-project/clang/test/Frontend/absolute-paths.c
+++ b/src/llvm-project/clang/test/Frontend/absolute-paths.c
@@ -7,11 +7,11 @@
// directory in the path.
// NORMAL: SystemHeaderPrefix
// ABSOLUTE-NOT: SystemHeaderPrefix
-// CHECK: warning: control reaches end of non-void function
+// CHECK: warning: non-void function does not return a value
// For files which don't exist, just print the filename.
#line 123 "non-existant.c"
int g() {}
-// NORMAL: non-existant.c:123:10: warning: control reaches end of non-void function
-// ABSOLUTE: non-existant.c:123:10: warning: control reaches end of non-void function
+// NORMAL: non-existant.c:123:10: warning: non-void function does not return a value
+// ABSOLUTE: non-existant.c:123:10: warning: non-void function does not return a value
diff --git a/src/llvm-project/clang/test/Frontend/ast-main.cpp b/src/llvm-project/clang/test/Frontend/ast-main.cpp
index 89fd5e5..e6e2825bb3 100644
--- a/src/llvm-project/clang/test/Frontend/ast-main.cpp
+++ b/src/llvm-project/clang/test/Frontend/ast-main.cpp
@@ -10,7 +10,7 @@
};
template<typename T>
T *S<T>::mf() {
- // warning: control reaches end of non-void function [-Wreturn-type]
+ // warning: non-void function does not return a value [-Wreturn-type]
}
void f() {
diff --git a/src/llvm-project/clang/test/Frontend/cc1-return-codes.c b/src/llvm-project/clang/test/Frontend/cc1-return-codes.c
index da329b9..fde1b4a 100644
--- a/src/llvm-project/clang/test/Frontend/cc1-return-codes.c
+++ b/src/llvm-project/clang/test/Frontend/cc1-return-codes.c
@@ -1,4 +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
+// RUN: %clang_cc1 -help
+// RUN: %clang_cc1 -version
diff --git a/src/llvm-project/clang/test/Frontend/dependency-gen-has-include.c b/src/llvm-project/clang/test/Frontend/dependency-gen-has-include.c
index e8abb2c..51de72a 100644
--- a/src/llvm-project/clang/test/Frontend/dependency-gen-has-include.c
+++ b/src/llvm-project/clang/test/Frontend/dependency-gen-has-include.c
@@ -1,5 +1,3 @@
-// REQUIRES: shell
-
// Basic test
// RUN: rm -rf %t.dir
// RUN: mkdir %t.dir
@@ -19,16 +17,16 @@
// RUN: FileCheck -input-file=%t.dir/file.deps %s
// CHECK: dependency-gen-has-include.o
// CHECK: dependency-gen-has-include.c
-// CHECK: a/header.h
-// CHECK-NOT: missing/file.h
-// CHECK: system/system-header.h
-// CHECK: next-a/next-header.h
-// CHECK: next-b/next-header.h
+// CHECK: a{{[/\\]}}header.h
+// CHECK-NOT: missing{{[/\\]}}file.h
+// CHECK: system{{[/\\]}}system-header.h
+// CHECK: next-a{{[/\\]}}next-header.h
+// CHECK: next-b{{[/\\]}}next-header.h
// Verify that we ignore system headers in user-only headers mode.
// RUN: %clang -MMD -MF %t.dir/user-headers.deps %s -fsyntax-only -I %t.dir -isystem %t.dir/system -I %t.dir/next-a -I %t.dir/next-b
// RUN: FileCheck -input-file=%t.dir/user-headers.deps --check-prefix CHECK-USER-HEADER %s
-// CHECK-USER-HEADER-NOT: system/system-header.h
+// CHECK-USER-HEADER-NOT: system{{[/\\]}}system-header.h
#if __has_include("a/header.h")
#endif
diff --git a/src/llvm-project/clang/test/Frontend/dependency-gen.c b/src/llvm-project/clang/test/Frontend/dependency-gen.c
index 963419c..a42804d 100644
--- a/src/llvm-project/clang/test/Frontend/dependency-gen.c
+++ b/src/llvm-project/clang/test/Frontend/dependency-gen.c
@@ -21,9 +21,26 @@
// RUN: %clang -MD -MF - %s -fsyntax-only -I ./ | FileCheck -check-prefix=CHECK-SIX %s
// CHECK-SIX: {{ }}x.h
// RUN: echo "fun:foo" > %t.blacklist
-// RUN: %clang -MD -MF - %s -fsyntax-only -resource-dir=%S/Inputs/resource_dir_with_cfi_blacklist -fsanitize=cfi-vcall -flto -fvisibility=hidden -fsanitize-blacklist=%t.blacklist -I ./ | FileCheck -check-prefix=CHECK-SEVEN %s
+// RUN: %clang -MD -MF - %s -fsyntax-only -resource-dir=%S/Inputs/resource_dir_with_sanitizer_blacklist -fsanitize=undefined -flto -fvisibility=hidden -fsanitize-blacklist=%t.blacklist -I ./ | FileCheck -check-prefix=CHECK-SEVEN %s
// CHECK-SEVEN: .blacklist
// CHECK-SEVEN: {{ }}x.h
#ifndef INCLUDE_FLAG_TEST
#include <x.h>
#endif
+
+// RUN: echo "fun:foo" > %t.blacklist1
+// RUN: echo "fun:foo" > %t.blacklist2
+// RUN: %clang -MD -MF - %s -fsyntax-only -resource-dir=%S/Inputs/resource_dir_with_sanitizer_blacklist -fsanitize=undefined -flto -fvisibility=hidden -fsanitize-blacklist=%t.blacklist1 -fsanitize-blacklist=%t.blacklist2 -I ./ | FileCheck -check-prefix=TWO-BLACK-LISTS %s
+// TWO-BLACK-LISTS: dependency-gen.o:
+// TWO-BLACK-LISTS-DAG: blacklist1
+// TWO-BLACK-LISTS-DAG: blacklist2
+// TWO-BLACK-LISTS-DAG: x.h
+// TWO-BLACK-LISTS-DAG: dependency-gen.c
+
+// RUN: %clang -MD -MF - %s -fsyntax-only -resource-dir=%S/Inputs/resource_dir_with_sanitizer_blacklist -fsanitize=undefined -flto -fvisibility=hidden -I ./ | FileCheck -check-prefix=USER-AND-SYS-DEPS %s
+// USER-AND-SYS-DEPS: dependency-gen.o:
+// USER-AND-SYS-DEPS-DAG: ubsan_blacklist.txt
+
+// RUN: %clang -MMD -MF - %s -fsyntax-only -resource-dir=%S/Inputs/resource_dir_with_sanitizer_blacklist -fsanitize=undefined -flto -fvisibility=hidden -I ./ | FileCheck -check-prefix=ONLY-USER-DEPS %s
+// ONLY-USER-DEPS: dependency-gen.o:
+// NOT-ONLY-USER-DEPS: ubsan_blacklist.txt
diff --git a/src/llvm-project/clang/test/Frontend/gnu-inline.c b/src/llvm-project/clang/test/Frontend/gnu-inline.c
index 75d4fe6..ef99669 100644
--- a/src/llvm-project/clang/test/Frontend/gnu-inline.c
+++ b/src/llvm-project/clang/test/Frontend/gnu-inline.c
@@ -1,9 +1,9 @@
-// RUN: %clang_cc1 -std=c89 -fsyntax-only -x c -E -dM %s | FileCheck --check-prefix=GNU-INLINE %s
-// RUN: %clang_cc1 -std=c99 -fsyntax-only -x c -E -dM %s | FileCheck --check-prefix=STDC-INLINE %s
-// RUN: %clang_cc1 -std=c99 -fgnu89-inline -fsyntax-only -x c -E -dM %s | FileCheck --check-prefix=GNU-INLINE %s
-// RUN: %clang_cc1 -fsyntax-only -x c++ -E -dM %s | FileCheck --check-prefix=GNU-INLINE %s
-// RUN: not %clang_cc1 -fgnu89-inline -fsyntax-only -x c++ %s 2>&1 | FileCheck --check-prefix=CXX %s
-// RUN: not %clang_cc1 -fgnu89-inline -fsyntax-only -x objective-c++ %s 2>&1 | FileCheck --check-prefix=OBJCXX %s
+// RUN: %clang_cc1 -fgnuc-version=4.2.1 -std=c89 -fsyntax-only -x c -E -dM %s | FileCheck --check-prefix=GNU-INLINE %s
+// RUN: %clang_cc1 -fgnuc-version=4.2.1 -std=c99 -fsyntax-only -x c -E -dM %s | FileCheck --check-prefix=STDC-INLINE %s
+// RUN: %clang_cc1 -fgnuc-version=4.2.1 -std=c99 -fgnu89-inline -fsyntax-only -x c -E -dM %s | FileCheck --check-prefix=GNU-INLINE %s
+// RUN: %clang_cc1 -fgnuc-version=4.2.1 -fsyntax-only -x c++ -E -dM %s | FileCheck --check-prefix=GNU-INLINE %s
+// RUN: not %clang_cc1 -fgnu89-inline -fgnuc-version=4.2.1 -fsyntax-only -x c++ %s 2>&1 | FileCheck --check-prefix=CXX %s
+// RUN: not %clang_cc1 -fgnu89-inline -fgnuc-version=4.2.1 -fsyntax-only -x objective-c++ %s 2>&1 | FileCheck --check-prefix=OBJCXX %s
// CXX: '-fgnu89-inline' not allowed with 'C++'
// OBJCXX: '-fgnu89-inline' not allowed with 'Objective-C++'
diff --git a/src/llvm-project/clang/test/Frontend/gnu-mcount.c b/src/llvm-project/clang/test/Frontend/gnu-mcount.c
index baac555..6e89dfe 100644
--- a/src/llvm-project/clang/test/Frontend/gnu-mcount.c
+++ b/src/llvm-project/clang/test/Frontend/gnu-mcount.c
@@ -66,7 +66,7 @@
// CHECK-ARM64-EABI-OPENBSD: attributes #{{[0-9]+}} = { {{.*}}"instrument-function-entry-inlined"="__mcount"{{.*}} }
// CHECK-ARM64-EABI-OPENBSD-NOT: attributes #{{[0-9]+}} = { {{.*}}"instrument-function-entry-inlined"="\01__gnu_mcount_nc"{{.*}} }
// CHECK-ARM-EABI-MEABI-GNU-NOT: attributes #{{[0-9]+}} = { {{.*}}"instrument-function-entry-inlined"="mcount"{{.*}} }
-// CHECK-ARM-EABI-MEABI-GNU: attributes #{{[0-9]+}} = { {{.*}}"instrument-function-entry-inlined"="\01__gnu_mcount_nc"{{.*}} }
+// CHECK-ARM-EABI-MEABI-GNU: attributes #{{[0-9]+}} = { {{.*}}"instrument-function-entry-inlined"="llvm.arm.gnu.eabi.mcount"{{.*}} }
// CHECK-ARM-EABI-RTEMS: attributes #{{[0-9]+}} = { {{.*}}"instrument-function-entry-inlined"="mcount"{{.*}} }
// CHECK-ARM-EABI-RTEMS-NOT: attributes #{{[0-9]+}} = { {{.*}}"instrument-function-entry-inlined"="\01__gnu_mcount_nc"{{.*}} }
// CHECK-ARM64-EABI-RTEMS: attributes #{{[0-9]+}} = { {{.*}}"instrument-function-entry-inlined"="mcount"{{.*}} }
diff --git a/src/llvm-project/clang/test/Frontend/nostdlib-for-asmpp.s b/src/llvm-project/clang/test/Frontend/nostdlib-for-asmpp.s
index 330fee3..c1be5a2 100644
--- a/src/llvm-project/clang/test/Frontend/nostdlib-for-asmpp.s
+++ b/src/llvm-project/clang/test/Frontend/nostdlib-for-asmpp.s
@@ -1,4 +1,4 @@
-// RUN: %clang -cc1 -x assembler-with-cpp -triple arm64-apple-ios6.0.0 -isysroot %S/doesnotexist -std=c++11 -v %s 2>&1 | FileCheck %s
+// RUN: %clang_cc1 -x assembler-with-cpp -triple arm64-apple-ios6.0.0 -isysroot %S/doesnotexist -std=c++11 -v %s 2>&1 | FileCheck %s
// The C++ stdlib path should not be included for an assembly source.
// CHECK-NOT: usr/include/c++/
diff --git a/src/llvm-project/clang/test/Frontend/rewrite-includes-cli-include.c b/src/llvm-project/clang/test/Frontend/rewrite-includes-cli-include.c
index ba96039..d63f966 100644
--- a/src/llvm-project/clang/test/Frontend/rewrite-includes-cli-include.c
+++ b/src/llvm-project/clang/test/Frontend/rewrite-includes-cli-include.c
@@ -2,7 +2,7 @@
main_file_line
// CHECK: {{^}}# 1 "<built-in>"{{$}}
// CHECK-NEXT: {{^}}# 1 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes2.h" 1{{$}}
-// CHECK-NEXT: {{^}}included_line2{{$}}
+// CHECK-NEXT: {{^}}int included_line2;{{$}}
// CHECK-NEXT: {{^}}# 1 "<built-in>" 2{{$}}
// CHECK-NEXT: {{^}}# 1 "{{.*}}rewrite-includes-cli-include.c"{{$}}
// CHECK-NEXT: FileCheck
diff --git a/src/llvm-project/clang/test/Frontend/rewrite-includes-conditions.c b/src/llvm-project/clang/test/Frontend/rewrite-includes-conditions.c
new file mode 100644
index 0000000..37a55f3
--- /dev/null
+++ b/src/llvm-project/clang/test/Frontend/rewrite-includes-conditions.c
@@ -0,0 +1,113 @@
+// RUN: %clang_cc1 -E -frewrite-includes -I %S/Inputs %s -o - | FileCheck -strict-whitespace %s
+// RUN: %clang_cc1 -E -frewrite-includes -I %S/Inputs %s -o - | %clang_cc1 -Wall -Wextra -Wconversion -x c -fsyntax-only 2>&1 | FileCheck -check-prefix=COMPILE --implicit-check-not warning: %s
+
+#define value1 1
+#if value1
+int line1;
+#else
+int line2;
+#endif
+
+#define value2 2
+
+#if value1 == value2
+int line3;
+#elif value1 > value2
+int line4;
+#elif value1 < value2
+int line5;
+#else
+int line6;
+#endif
+
+#if __has_include(<rewrite-includes3.h>)
+#include <rewrite-includes3.h>
+#endif
+
+#define HAS_INCLUDE(x) __has_include(x)
+
+#if HAS_INCLUDE(<rewrite-includes1.h>)
+#endif
+
+/*
+#if value1
+commented out
+*/
+
+#if value1 < value2 \
+|| value1 != value2
+int line7;
+#endif
+
+#if value1 /*
+*/
+#endif
+
+static int unused;
+
+// ENDCOMPARE
+
+// CHECK: #if 0 /* disabled by -frewrite-includes */
+// CHECK-NEXT: #if value1
+// CHECK-NEXT: #endif
+// CHECK-NEXT: #endif /* disabled by -frewrite-includes */
+// CHECK-NEXT: #if 1 /* evaluated by -frewrite-includes */
+// CHECK-NEXT: # 6 "{{.*}}rewrite-includes-conditions.c"
+
+// CHECK: #if 0 /* disabled by -frewrite-includes */
+// CHECK-NEXT: #if value1 == value2
+// CHECK-NEXT: #endif
+// CHECK-NEXT: #endif /* disabled by -frewrite-includes */
+// CHECK-NEXT: #if 0 /* evaluated by -frewrite-includes */
+// CHECK-NEXT: # 14 "{{.*}}rewrite-includes-conditions.c"
+
+// CHECK: #if 0 /* disabled by -frewrite-includes */
+// CHECK-NEXT: #if 0
+// CHECK-NEXT: #elif value1 > value2
+// CHECK-NEXT: #endif
+// CHECK-NEXT: #endif /* disabled by -frewrite-includes */
+// CHECK-NEXT: #elif 0 /* evaluated by -frewrite-includes */
+// CHECK-NEXT: # 16 "{{.*}}rewrite-includes-conditions.c"
+
+// CHECK: #if 0 /* disabled by -frewrite-includes */
+// CHECK-NEXT: #if 0
+// CHECK-NEXT: #elif value1 < value2
+// CHECK-NEXT: #endif
+// CHECK-NEXT: #endif /* disabled by -frewrite-includes */
+// CHECK-NEXT: #elif 1 /* evaluated by -frewrite-includes */
+// CHECK-NEXT: # 18 "{{.*}}rewrite-includes-conditions.c"
+
+// CHECK: #if 0 /* disabled by -frewrite-includes */
+// CHECK-NEXT: #if __has_include(<rewrite-includes3.h>)
+// CHECK-NEXT: #endif
+// CHECK-NEXT: #endif /* disabled by -frewrite-includes */
+// CHECK-NEXT: #if 1 /* evaluated by -frewrite-includes */
+// CHECK-NEXT: # 24 "{{.*}}rewrite-includes-conditions.c"
+
+// CHECK: #if 0 /* disabled by -frewrite-includes */
+// CHECK-NEXT: #if HAS_INCLUDE(<rewrite-includes1.h>)
+// CHECK-NEXT: #endif
+// CHECK-NEXT: #endif /* disabled by -frewrite-includes */
+// CHECK-NEXT: #if 1 /* evaluated by -frewrite-includes */
+// CHECK-NEXT: # 30 "{{.*}}rewrite-includes-conditions.c"
+
+// CHECK: #if 0 /* disabled by -frewrite-includes */
+// CHECK-NEXT: #if value1 < value2 \
+// CHECK-NEXT: || value1 != value2
+// CHECK-NEXT: #endif
+// CHECK-NEXT: #endif /* disabled by -frewrite-includes */
+// CHECK-NEXT: #if 1 /* evaluated by -frewrite-includes */
+// CHECK-NEXT: # 39 "{{.*}}rewrite-includes-conditions.c"
+
+// CHECK: #if 0 /* disabled by -frewrite-includes */
+// CHECK-NEXT: #if value1 /*
+// CHECK-NEXT: */
+// CHECK-NEXT: #endif
+// CHECK-NEXT: #endif /* disabled by -frewrite-includes */
+// CHECK-NEXT: #if 1 /* evaluated by -frewrite-includes */
+// CHECK-NEXT: # 44 "{{.*}}rewrite-includes-conditions.c"
+
+// CHECK: {{^}}// ENDCOMPARE{{$}}
+
+// COMPILE: Inputs{{[/\\]}}rewrite-includes3.h:1:31: warning: implicit conversion changes signedness:
+// COMPILE: rewrite-includes-conditions.c:46:12: warning: unused variable 'unused'
diff --git a/src/llvm-project/clang/test/Frontend/rewrite-includes-warnings.c b/src/llvm-project/clang/test/Frontend/rewrite-includes-warnings.c
index 1fb98db..d955f86 100644
--- a/src/llvm-project/clang/test/Frontend/rewrite-includes-warnings.c
+++ b/src/llvm-project/clang/test/Frontend/rewrite-includes-warnings.c
@@ -1,4 +1,7 @@
-// RUN: %clang_cc1 -verify -Wall -Wextra -E -frewrite-includes %s
+// RUN: %clang_cc1 -verify -Wall -Wextra -Wunused-macros -E -frewrite-includes %s
// expected-no-diagnostics
#pragma GCC visibility push (default)
+
+#define USED_MACRO 1
+int test() { return USED_MACRO; }
diff --git a/src/llvm-project/clang/test/Frontend/rewrite-includes.c b/src/llvm-project/clang/test/Frontend/rewrite-includes.c
index 630e761..1525493 100644
--- a/src/llvm-project/clang/test/Frontend/rewrite-includes.c
+++ b/src/llvm-project/clang/test/Frontend/rewrite-includes.c
@@ -1,8 +1,9 @@
-// RUN: not %clang_cc1 -verify -E -frewrite-includes -DFIRST -I %S/Inputs -I %S/Inputs/NextIncludes %s -o - | FileCheck -strict-whitespace %s
-// RUN: not %clang_cc1 -verify -E -frewrite-includes -P -DFIRST -I %S/Inputs -I %S/Inputs/NextIncludes %s -o - | FileCheck -check-prefix=CHECKNL -strict-whitespace %s
+// RUN: %clang_cc1 -E -frewrite-includes -DFIRST -I %S/Inputs -I %S/Inputs/NextIncludes %s -o - | FileCheck -strict-whitespace %s
+// RUN: %clang_cc1 -E -frewrite-includes -P -DFIRST -I %S/Inputs -I %S/Inputs/NextIncludes %s -o - | FileCheck -check-prefix=CHECKNL -strict-whitespace %s
+// RUN: %clang_cc1 -E -frewrite-includes -DFIRST -I %S/Inputs -I %S/Inputs/NextIncludes %s -o - | %clang_cc1 -Wall -Wextra -Wconversion -DFIRST -x c -fsyntax-only 2>&1 | FileCheck -check-prefix=COMPILE --implicit-check-not warning: %s
// STARTCOMPARE
#define A(a,b) a ## b
-A(1,2)
+A(in,t) a;
#include "rewrite-includes1.h"
#ifdef FIRST
#define HEADER "rewrite-includes3.h"
@@ -21,142 +22,164 @@
#include "rewrite-includes7.h"
#include "rewrite-includes8.h"
#include "rewrite-includes9.h"
+static int unused;
// ENDCOMPARE
// CHECK: {{^}}# 1 "{{.*}}rewrite-includes.c"{{$}}
// CHECK: {{^}}// STARTCOMPARE{{$}}
// CHECK-NEXT: {{^}}#define A(a,b) a ## b{{$}}
-// CHECK-NEXT: {{^}}A(1,2){{$}}
+// CHECK-NEXT: {{^}}A(in,t) a;{{$}}
// CHECK-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}#include "rewrite-includes1.h"{{$}}
// CHECK-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
-// CHECK-NEXT: {{^}}# 6 "{{.*}}rewrite-includes.c"{{$}}
+// CHECK-NEXT: {{^}}# 7 "{{.*}}rewrite-includes.c"{{$}}
// 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: {{^}}included_line1{{$}}
+// CHECK-NEXT: {{^}}int 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: {{^}}# 3 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes1.h" 3{{$}}
// CHECK-NEXT: {{^}}# 1 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes2.h" 1 3{{$}}
-// CHECK-NEXT: {{^}}included_line2{{$}}
+// CHECK-NEXT: {{^}}int included_line2;{{$}}
// CHECK-NEXT: {{^}}# 4 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes1.h" 2 3{{$}}
-// CHECK-NEXT: {{^}}# 7 "{{.*}}rewrite-includes.c" 2{{$}}
+// CHECK-NEXT: {{^}}# 8 "{{.*}}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: {{^}}# 9 "{{.*}}rewrite-includes.c"{{$}}
+// CHECK-NEXT: {{^}}# 10 "{{.*}}rewrite-includes.c"{{$}}
// CHECK-NEXT: {{^}}# 1 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes3.h" 1{{$}}
-// CHECK-NEXT: {{^}}included_line3{{$}}
-// CHECK-NEXT: {{^}}# 10 "{{.*}}rewrite-includes.c" 2{{$}}
+// CHECK-NEXT: {{^}}unsigned int included_line3 = -10;{{$}}
+// CHECK-NEXT: {{^}}# 11 "{{.*}}rewrite-includes.c" 2{{$}}
// CHECK-NEXT: {{^}}#else{{$}}
-// CHECK-NEXT: {{^}}# 11 "{{.*}}rewrite-includes.c"{{$}}
+// CHECK-NEXT: {{^}}# 12 "{{.*}}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: {{^}}# 11 "{{.*}}rewrite-includes.c"{{$}}
// CHECK-NEXT: {{^}}# 12 "{{.*}}rewrite-includes.c"{{$}}
-// CHECK-NEXT: {{^}}#endif{{$}}
// CHECK-NEXT: {{^}}# 13 "{{.*}}rewrite-includes.c"{{$}}
+// CHECK-NEXT: {{^}}#endif{{$}}
+// CHECK-NEXT: {{^}}# 14 "{{.*}}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: {{^}}# 15 "{{.*}}rewrite-includes.c"{{$}}
+// CHECK-NEXT: {{^}}# 16 "{{.*}}rewrite-includes.c"{{$}}
// CHECK-NEXT: {{^}}# 1 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes5.h" 1{{$}}
-// CHECK-NEXT: {{^}}included_line5{{$}}
-// CHECK-NEXT: {{^}}# 16 "{{.*}}rewrite-includes.c" 2{{$}}
+// CHECK-NEXT: {{^}}int included_line5;{{$}}
+// CHECK-NEXT: {{^}}# 17 "{{.*}}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: {{^}}# 16 "{{.*}}rewrite-includes.c"{{$}}
+// CHECK-NEXT: {{^}}# 17 "{{.*}}rewrite-includes.c"{{$}}
// 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: {{^}}included_line6{{$}}
-// CHECK-NEXT: {{^}}# 17 "{{.*}}rewrite-includes.c" 2{{$}}
+// CHECK-NEXT: {{^}}int included_line6;{{$}}
+// CHECK-NEXT: {{^}}# 18 "{{.*}}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: {{^}}# 20 "{{.*}}rewrite-includes.c"{{$}}
-// 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: {{^}}# 5 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes7.h"{{$}}
-// CHECK-NEXT: {{^}}# 21 "{{.*}}rewrite-includes.c" 2{{$}}
+// CHECK-NEXT: {{^}}# 21 "{{.*}}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: {{^}}# 21 "{{.*}}rewrite-includes.c"{{$}}
+// CHECK-NEXT: {{^}}# 1 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes7.h" 1{{$}}
+// CHECK-NEXT: {{^}}#ifndef REWRITE_INCLUDES_7{{$}}
+// CHECK-NEXT: {{^}}#define REWRITE_INCLUDES_7{{$}}
+// CHECK-NEXT: {{^}}int included_line7;{{$}}
+// CHECK-NEXT: {{^}}#endif{{$}}
+// CHECK-NEXT: {{^}}# 5 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes7.h"{{$}}
+// CHECK-NEXT: {{^}}# 22 "{{.*}}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: {{^}}# 22 "{{.*}}rewrite-includes.c"{{$}}
+// CHECK-NEXT: {{^}}# 23 "{{.*}}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: {{^}}# 22 "{{.*}}rewrite-includes.c"{{$}}
+// CHECK-NEXT: {{^}}# 23 "{{.*}}rewrite-includes.c"{{$}}
// CHECK-NEXT: {{^}}# 1 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes8.h" 1{{$}}
-// CHECK-NEXT: {{^}}#if (0)/*__has_include_next(<rewrite-includes8.h>)*/{{$}}
-// CHECK-NEXT: {{^}}#elif (0)/*__has_include(<rewrite-includes8.hfail>)*/{{$}}
+// CHECK-NEXT: {{^}}#if 0 /* disabled by -frewrite-includes */{{$}}
+// CHECK-NEXT: {{^}}#if __has_include_next(<rewrite-includes8.h>){{$}}
+// CHECK-NEXT: {{^}}#endif{{$}}
+// CHECK-NEXT: {{^}}#endif /* disabled by -frewrite-includes */{{$}}
+// CHECK-NEXT: {{^}}#if 0 /* evaluated by -frewrite-includes */{{$}}
+// CHECK-NEXT: {{^}}# 2 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes8.h"{{$}}
+// CHECK-NEXT: {{^}}#if 0 /* disabled by -frewrite-includes */{{$}}
+// CHECK-NEXT: {{^}}#if 0{{$}}
+// CHECK-NEXT: {{^}}#elif __has_include(<rewrite-includes8.hfail>){{$}}
+// CHECK-NEXT: {{^}}#endif{{$}}
+// CHECK-NEXT: {{^}}#endif /* disabled by -frewrite-includes */{{$}}
+// CHECK-NEXT: {{^}}#elif 0 /* evaluated by -frewrite-includes */{{$}}
// 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: {{^}}#if 0 /* disabled by -frewrite-includes */{{$}}
+// CHECK-NEXT: {{^}}#if !__has_include("rewrite-includes8.h"){{$}}
+// CHECK-NEXT: {{^}}#endif{{$}}
+// CHECK-NEXT: {{^}}#endif /* disabled by -frewrite-includes */{{$}}
+// CHECK-NEXT: {{^}}#if 0 /* evaluated by -frewrite-includes */{{$}}
+// CHECK-NEXT: {{^}}# 5 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes8.h"{{$}}
// CHECK-NEXT: {{^}}#endif{{$}}
// CHECK-NEXT: {{^}}# 6 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes8.h"{{$}}
-// CHECK-NEXT: {{^}}# 23 "{{.*}}rewrite-includes.c" 2{{$}}
+// CHECK-NEXT: {{^}}# 24 "{{.*}}rewrite-includes.c" 2{{$}}
// CHECK-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}#include "rewrite-includes9.h"{{$}}
// CHECK-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
-// CHECK-NEXT: {{^}}# 23 "{{.*}}rewrite-includes.c"{{$}}
+// CHECK-NEXT: {{^}}# 24 "{{.*}}rewrite-includes.c"{{$}}
// CHECK-NEXT: {{^}}# 1 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes9.h" 1{{$}}
-// CHECK-NEXT: {{^}}#if (1)/*__has_include_next(<rewrite-includes9.h>)*/{{$}}
+// CHECK-NEXT: {{^}}#if 0 /* disabled by -frewrite-includes */{{$}}
+// CHECK-NEXT: {{^}}#if __has_include_next(<rewrite-includes9.h>){{$}}
+// CHECK-NEXT: {{^}}#endif{{$}}
+// CHECK-NEXT: {{^}}#endif /* disabled by -frewrite-includes */{{$}}
+// CHECK-NEXT: {{^}}#if 1 /* evaluated by -frewrite-includes */{{$}}
+// CHECK-NEXT: {{^}}# 2 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes9.h"{{$}}
// CHECK-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}#include_next <rewrite-includes9.h>{{$}}
// CHECK-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}# 2 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes9.h"{{$}}
// CHECK-NEXT: {{^}}# 1 "{{.*[/\\]Inputs(/|\\\\)NextIncludes(/|\\\\)}}rewrite-includes9.h" 1{{$}}
-// CHECK-NEXT: {{^}}included_line9{{$}}
+// CHECK-NEXT: {{^}}int included_line9;{{$}}
// CHECK-NEXT: {{^}}# 3 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes9.h" 2{{$}}
// CHECK-NEXT: {{^}}#endif{{$}}
// CHECK-NEXT: {{^}}# 4 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes9.h"{{$}}
-// CHECK-NEXT: {{^}}# 24 "{{.*}}rewrite-includes.c" 2{{$}}
+// CHECK-NEXT: {{^}}# 25 "{{.*}}rewrite-includes.c" 2{{$}}
+// CHECK-NEXT: {{^}}static int unused;{{$}}
// CHECK-NEXT: {{^}}// ENDCOMPARE{{$}}
// CHECKNL: {{^}}// STARTCOMPARE{{$}}
// CHECKNL-NEXT: {{^}}#define A(a,b) a ## b{{$}}
-// CHECKNL-NEXT: {{^}}A(1,2){{$}}
+// CHECKNL-NEXT: {{^}}A(in,t) a;{{$}}
// CHECKNL-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}#include "rewrite-includes1.h"{{$}}
// CHECKNL-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}#pragma clang system_header{{$}}
// CHECKNL-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
-// CHECKNL-NEXT: {{^}}included_line1{{$}}
+// CHECKNL-NEXT: {{^}}int included_line1;{{$}}
// CHECKNL-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}#include "rewrite-includes2.h"{{$}}
// CHECKNL-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
-// CHECKNL-NEXT: {{^}}included_line2{{$}}
+// CHECKNL-NEXT: {{^}}int included_line2;{{$}}
// CHECKNL-NEXT: {{^}}#ifdef FIRST{{$}}
// CHECKNL-NEXT: {{^}}#define HEADER "rewrite-includes3.h"{{$}}
// CHECKNL-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}#include HEADER{{$}}
// CHECKNL-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
-// CHECKNL-NEXT: {{^}}included_line3{{$}}
+// CHECKNL-NEXT: {{^}}unsigned int included_line3 = -10;{{$}}
// CHECKNL-NEXT: {{^}}#else{{$}}
// CHECKNL-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}#include "rewrite-includes4.h"{{$}}
@@ -167,14 +190,14 @@
// CHECKNL-NEXT: {{^}}#/**/include /**/ "rewrite-includes5.h" /**/ {{\\}}{{$}}
// CHECKNL-NEXT: {{^}} {{$}}
// CHECKNL-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
-// CHECKNL-NEXT: {{^}}included_line5{{$}}
+// CHECKNL-NEXT: {{^}}int included_line5;{{$}}
// CHECKNL-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}#include "rewrite-includes6.h" // comment{{$}}
// CHECKNL-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}#pragma once{{$}}
// CHECKNL-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
-// CHECKNL-NEXT: {{^}}included_line6{{$}}
+// CHECKNL-NEXT: {{^}}int included_line6;{{$}}
// CHECKNL-NEXT: {{^}} {{$}}
// CHECKNL-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}#include "rewrite-includes6.h" /* comment{{$}}
@@ -185,7 +208,7 @@
// CHECKNL-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}#ifndef REWRITE_INCLUDES_7{{$}}
// CHECKNL-NEXT: {{^}}#define REWRITE_INCLUDES_7{{$}}
-// CHECKNL-NEXT: {{^}}included_line7{{$}}
+// CHECKNL-NEXT: {{^}}int included_line7;{{$}}
// CHECKNL-NEXT: {{^}}#endif{{$}}
// CHECKNL-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}#include "rewrite-includes7.h"{{$}}
@@ -193,18 +216,39 @@
// CHECKNL-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}#include "rewrite-includes8.h"{{$}}
// CHECKNL-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
-// CHECKNL-NEXT: {{^}}#if (0)/*__has_include_next(<rewrite-includes8.h>)*/{{$}}
-// CHECKNL-NEXT: {{^}}#elif (0)/*__has_include(<rewrite-includes8.hfail>)*/{{$}}
+// CHECKNL-NEXT: {{^}}#if 0 /* disabled by -frewrite-includes */{{$}}
+// CHECKNL-NEXT: {{^}}#if __has_include_next(<rewrite-includes8.h>){{$}}
// CHECKNL-NEXT: {{^}}#endif{{$}}
-// CHECKNL-NEXT: {{^}}#if !(1)/*__has_include("rewrite-includes8.h")*/{{$}}
+// CHECKNL-NEXT: {{^}}#endif /* disabled by -frewrite-includes */{{$}}
+// CHECKNL-NEXT: {{^}}#if 0 /* evaluated by -frewrite-includes */{{$}}
+// CHECKNL-NEXT: {{^}}#if 0 /* disabled by -frewrite-includes */{{$}}
+// CHECKNL-NEXT: {{^}}#if 0{{$}}
+// CHECKNL-NEXT: {{^}}#elif __has_include(<rewrite-includes8.hfail>){{$}}
+// CHECKNL-NEXT: {{^}}#endif{{$}}
+// CHECKNL-NEXT: {{^}}#endif /* disabled by -frewrite-includes */{{$}}
+// CHECKNL-NEXT: {{^}}#elif 0 /* evaluated by -frewrite-includes */{{$}}
+// CHECKNL-NEXT: {{^}}#endif{{$}}
+// CHECKNL-NEXT: {{^}}#if 0 /* disabled by -frewrite-includes */{{$}}
+// CHECKNL-NEXT: {{^}}#if !__has_include("rewrite-includes8.h"){{$}}
+// CHECKNL-NEXT: {{^}}#endif{{$}}
+// CHECKNL-NEXT: {{^}}#endif /* disabled by -frewrite-includes */{{$}}
+// CHECKNL-NEXT: {{^}}#if 0 /* evaluated by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}#endif{{$}}
// CHECKNL-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}#include "rewrite-includes9.h"{{$}}
// CHECKNL-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
-// CHECKNL-NEXT: {{^}}#if (1)/*__has_include_next(<rewrite-includes9.h>)*/{{$}}
+// CHECKNL-NEXT: {{^}}#if 0 /* disabled by -frewrite-includes */{{$}}
+// CHECKNL-NEXT: {{^}}#if __has_include_next(<rewrite-includes9.h>){{$}}
+// CHECKNL-NEXT: {{^}}#endif{{$}}
+// CHECKNL-NEXT: {{^}}#endif /* disabled by -frewrite-includes */{{$}}
+// CHECKNL-NEXT: {{^}}#if 1 /* evaluated by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}#include_next <rewrite-includes9.h>{{$}}
// CHECKNL-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
-// CHECKNL-NEXT: {{^}}included_line9{{$}}
+// CHECKNL-NEXT: {{^}}int included_line9;{{$}}
// CHECKNL-NEXT: {{^}}#endif{{$}}
+// CHECKNL-NEXT: {{^}}static int unused;{{$}}
// CHECKNL-NEXT: {{^}}// ENDCOMPARE{{$}}
+
+// COMPILE: Inputs{{[/\\]}}rewrite-includes3.h:1:31: warning: implicit conversion changes signedness:
+// COMPILE: rewrite-includes.c:25:12: warning: unused variable 'unused'
diff --git a/src/llvm-project/clang/test/Frontend/stdin-input.c b/src/llvm-project/clang/test/Frontend/stdin-input.c
new file mode 100644
index 0000000..7b15482
--- /dev/null
+++ b/src/llvm-project/clang/test/Frontend/stdin-input.c
@@ -0,0 +1,7 @@
+// RUN: cat %s | %clang -emit-llvm -g -S \
+// RUN: -Xclang -main-file-name -Xclang test/foo.c -x c - -o - | FileCheck %s
+// CHECK: ; ModuleID = 'test/foo.c'
+// CHECK: source_filename = "test/foo.c"
+// CHECK: !DIFile(filename: "test/foo.c"
+
+int main() {}
diff --git a/src/llvm-project/clang/test/Frontend/sycl-aux-triple.cpp b/src/llvm-project/clang/test/Frontend/sycl-aux-triple.cpp
new file mode 100644
index 0000000..38b6a24
--- /dev/null
+++ b/src/llvm-project/clang/test/Frontend/sycl-aux-triple.cpp
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 %s -triple spir -aux-triple x86_64-unknown-linux-gnu -E -dM | FileCheck %s
+// RUN: %clang_cc1 %s -fsycl-is-device -triple spir -aux-triple x86_64-unknown-linux-gnu -E -dM | FileCheck --check-prefix=CHECK-SYCL %s
+
+// CHECK-NOT:#define __x86_64__ 1
+// CHECK-SYCL:#define __x86_64__ 1
diff --git a/src/llvm-project/clang/test/Frontend/warn-device-init-fun.cu b/src/llvm-project/clang/test/Frontend/warn-device-init-fun.cu
new file mode 100644
index 0000000..479f3c9
--- /dev/null
+++ b/src/llvm-project/clang/test/Frontend/warn-device-init-fun.cu
@@ -0,0 +1,8 @@
+// REQUIRES: nvptx-registered-target
+
+// RUN: %clang_cc1 -triple nvptx -fcuda-is-device \
+// RUN: -fgpu-allow-device-init \
+// RUN: %s 2>&1 | FileCheck %s
+
+// CHECK: warning: '-fgpu-allow-device-init' is ignored since it is only supported for HIP
+
diff --git a/src/llvm-project/clang/test/Frontend/warning-poison-system-directories.c b/src/llvm-project/clang/test/Frontend/warning-poison-system-directories.c
new file mode 100644
index 0000000..ba4c0e1
--- /dev/null
+++ b/src/llvm-project/clang/test/Frontend/warning-poison-system-directories.c
@@ -0,0 +1,29 @@
+// REQUIRES: x86-registered-target
+
+// System directory and sysroot option causes warning.
+// RUN: %clang -Wpoison-system-directories -target x86_64 -I/usr/include --sysroot %S/Inputs/sysroot_x86_64_cross_linux_tree -c -o - %s 2> %t.1.stderr
+// RUN: FileCheck -check-prefix=WARN < %t.1.stderr %s
+// RUN: %clang -Wpoison-system-directories -target x86_64 -cxx-isystem/usr/include --sysroot %S/Inputs/sysroot_x86_64_cross_linux_tree -c -o - %s 2> %t.1.stderr
+// RUN: FileCheck -check-prefix=WARN < %t.1.stderr %s
+// RUN: %clang -Wpoison-system-directories -target x86_64 -iquote/usr/local/include --sysroot %S/Inputs/sysroot_x86_64_cross_linux_tree -c -o - %s 2> %t.1.stderr
+// RUN: FileCheck -check-prefix=WARN < %t.1.stderr %s
+// RUN: %clang -Wpoison-system-directories -target x86_64 -isystem/usr/local/include --sysroot %S/Inputs/sysroot_x86_64_cross_linux_tree -c -o - %s 2> %t.1.stderr
+// RUN: FileCheck -check-prefix=WARN < %t.1.stderr %s
+
+// Missing target but included sysroot still causes the warning.
+// RUN: %clang -Wpoison-system-directories -I/usr/include --sysroot %S/Inputs/sysroot_x86_64_cross_linux_tree -c -o - %s 2> %t.2.stderr
+// RUN: FileCheck -check-prefix=WARN < %t.2.stderr %s
+
+// With -Werror the warning causes the failure.
+// RUN: not %clang -Werror=poison-system-directories -target x86_64 -I/usr/include --sysroot %S/Inputs/sysroot_x86_64_cross_linux_tree -c -o - %s 2> %t.3.stderr
+// RUN: FileCheck -check-prefix=ERROR < %t.3.stderr %s
+
+// Cros target without sysroot causes no warning.
+// RUN: %clang -Wpoison-system-directories -Werror -target x86_64 -I/usr/include -c -o - %s
+
+// By default the warning is off.
+// RUN: %clang -Werror -target x86_64 -I/usr/include --sysroot %S/Inputs/sysroot_x86_64_cross_linux_tree -c -o - %s
+
+// WARN: warning: include location {{[^ ]+}} is unsafe for cross-compilation [-Wpoison-system-directories]
+
+// ERROR: error: include location {{[^ ]+}} is unsafe for cross-compilation [-Werror,-Wpoison-system-directories]
diff --git a/src/llvm-project/clang/test/Frontend/x86-embed-bitcode.ll b/src/llvm-project/clang/test/Frontend/x86-embed-bitcode.ll
new file mode 100644
index 0000000..709f56b
--- /dev/null
+++ b/src/llvm-project/clang/test/Frontend/x86-embed-bitcode.ll
@@ -0,0 +1,74 @@
+; REQUIRES: x86-registered-target
+; check .ll input
+; RUN: %clang_cc1 -triple x86_64-apple-macosx10.10 -emit-llvm \
+; RUN: -fembed-bitcode=all -x ir %s -o - \
+; RUN: | FileCheck %s
+; RUN: %clang_cc1 -triple x86_64-apple-macosx10.10 -emit-llvm \
+; RUN: -fembed-bitcode=marker -x ir %s -o - \
+; RUN: | FileCheck %s -check-prefix=CHECK-MARKER
+; RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm \
+; RUN: -fembed-bitcode=all -x ir %s -o - \
+; RUN: | FileCheck %s -check-prefix=CHECK-ELF
+; RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm \
+; RUN: -fembed-bitcode=marker -x ir %s -o - \
+; RUN: | FileCheck %s -check-prefix=CHECK-ELF-MARKER
+; RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm \
+; RUN: -fembed-bitcode=bitcode -x ir %s -o - \
+; RUN: | FileCheck %s -check-prefix=CHECK-ELF-ONLY-BITCODE
+
+; check .bc input
+; RUN: %clang_cc1 -triple x86_64-apple-macosx10.10 -emit-llvm-bc \
+; RUN: -x ir %s -o %t.bc
+; RUN: %clang_cc1 -triple x86_64-apple-macosx10.10 -emit-llvm \
+; RUN: -fembed-bitcode=all -x ir %t.bc -o - \
+; RUN: | FileCheck %s
+; RUN: %clang_cc1 -triple x86_64-apple-macosx10.10 -emit-llvm \
+; RUN: -fembed-bitcode=bitcode -x ir %t.bc -o - \
+; RUN: | FileCheck %s -check-prefix=CHECK-ONLY-BITCODE
+; RUN: %clang_cc1 -triple x86_64-apple-macosx10.10 -emit-llvm \
+; RUN: -fembed-bitcode=marker -x ir %t.bc -o - \
+; RUN: | FileCheck %s -check-prefix=CHECK-MARKER
+
+; run through -fembed-bitcode twice and make sure it doesn't crash
+; RUN: %clang_cc1 -triple x86_64-apple-macosx10.10 -emit-llvm-bc \
+; RUN: -fembed-bitcode=all -x ir %s -o - \
+; RUN: | %clang_cc1 -triple x86_64-apple-macosx10.10 -emit-llvm \
+; RUN: -fembed-bitcode=all -x ir - -o /dev/null
+
+; check the magic number of bitcode at the beginning of the string
+; CHECK: @llvm.embedded.module = private constant
+; CHECK: c"\DE\C0\17\0B
+; CHECK: section "__LLVM,__bitcode"
+; CHECK: @llvm.cmdline = private constant
+; CHECK: section "__LLVM,__cmdline"
+
+; CHECK-ELF: @llvm.embedded.module
+; CHECK-ELF: section ".llvmbc"
+; CHECK-ELF: @llvm.cmdline
+; CHECK-ELF: section ".llvmcmd"
+
+; CHECK-ELF-MARKER: @llvm.embedded.module
+; CHECK-ELF-MARKER: constant [0 x i8] zeroinitializer
+; CHECK-ELF-MARKER: @llvm.cmdline
+; CHECK-ELF-MARKER: section ".llvmcmd"
+
+; CHECK-ELF-ONLY-BITCODE: @llvm.embedded.module
+; CHECK-ELF-ONLY-BITCODE: section ".llvmbc"
+; CHECK-ELF-ONLY-BITCODE-NOT: @llvm.cmdline
+; CHECK-ELF-ONLY-BITCODE-NOT: section ".llvmcmd"
+
+; CHECK-ONLY-BITCODE: @llvm.embedded.module = private constant
+; CHECK-ONLY-BITCODE: c"\DE\C0\17\0B
+; CHECK-ONLY-BITCODE: section "__LLVM,__bitcode"
+; CHECK-ONLY-BITCODE-NOT: @llvm.cmdline = private constant
+; CHECK-ONLY-BITCODE-NOT: section "__LLVM,__cmdline"
+
+; CHECK-MARKER: @llvm.embedded.module
+; CHECK-MARKER: constant [0 x i8] zeroinitializer
+; CHECK-MARKER: section "__LLVM,__bitcode"
+; CHECK-MARKER: @llvm.cmdline
+; CHECK-MARKER: section "__LLVM,__cmdline"
+
+define i32 @f0() {
+ ret i32 0
+}
diff --git a/src/llvm-project/clang/test/Headers/altivec-header.c b/src/llvm-project/clang/test/Headers/altivec-header.c
index 733ab50..00e5f44 100644
--- a/src/llvm-project/clang/test/Headers/altivec-header.c
+++ b/src/llvm-project/clang/test/Headers/altivec-header.c
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -triple powerpc64-unknown-unknown -target-feature +altivec -ffreestanding -emit-llvm -o - %s | FileCheck %s
-// RUN: %clang_cc1 -triple powerpc64-unknown-unknown -target-feature +altivec -ffreestanding -emit-llvm -fno-lax-vector-conversions -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple powerpc64-unknown-unknown -target-feature +altivec -ffreestanding -emit-llvm -flax-vector-conversions=none -o - %s | FileCheck %s
// RUN: %clang_cc1 -triple powerpc64-unknown-unknown -target-feature +altivec -ffreestanding -emit-llvm -x c++ -o - %s | FileCheck %s
#include <altivec.h>
diff --git a/src/llvm-project/clang/test/Headers/arm-acle-header.c b/src/llvm-project/clang/test/Headers/arm-acle-header.c
index d9d2e04..932c59d 100644
--- a/src/llvm-project/clang/test/Headers/arm-acle-header.c
+++ b/src/llvm-project/clang/test/Headers/arm-acle-header.c
@@ -4,6 +4,12 @@
// RUN: %clang_cc1 -x c++ -triple armv7-eabi -target-cpu cortex-a15 -fsyntax-only -ffreestanding %s
// RUN: %clang_cc1 -x c++ -triple aarch64-eabi -target-cpu cortex-a57 -fsyntax-only -ffreestanding %s
// RUN: %clang_cc1 -x c++ -triple thumbv7-windows -target-cpu cortex-a15 -fsyntax-only -ffreestanding %s
+// RUN: %clang_cc1 -x c++ -triple thumbv7-windows -target-cpu cortex-a15 -fsyntax-only -ffreestanding -fms-extensions -fms-compatibility -fms-compatibility-version=19.11 %s
+// RUN: %clang_cc1 -x c++ -triple aarch64-windows -target-cpu cortex-a53 -fsyntax-only -ffreestanding -fms-extensions -fms-compatibility -fms-compatibility-version=19.11 %s
// expected-no-diagnostics
#include <arm_acle.h>
+#ifdef _MSC_VER
+#include <intrin.h>
+#endif
+void f() { __nop(); __dmb(0); __wfi(); }
diff --git a/src/llvm-project/clang/test/Headers/arm-cmse-header-ns.c b/src/llvm-project/clang/test/Headers/arm-cmse-header-ns.c
new file mode 100644
index 0000000..a6e63ef
--- /dev/null
+++ b/src/llvm-project/clang/test/Headers/arm-cmse-header-ns.c
@@ -0,0 +1,27 @@
+// RUN: %clang_cc1 -triple thumbv8m.base-eabi -fsyntax-only %s 2>&1 | FileCheck --check-prefix=CHECK-c %s
+// RUN: not %clang_cc1 -triple thumbv8m.base-eabi -fsyntax-only -x c++ %s 2>&1 | FileCheck --check-prefix=CHECK-cpp %s
+
+#include <arm_cmse.h>
+
+typedef void (*callback_t)(void);
+
+void func(callback_t fptr, void *p)
+{
+ cmse_TT(p);
+ cmse_TTT(p);
+ cmse_TT_fptr(fptr);
+ cmse_TTT_fptr(fptr);
+
+ cmse_TTA(p);
+ cmse_TTAT(p);
+ cmse_TTA_fptr(fptr);
+ cmse_TTAT_fptr(fptr);
+// CHECK-c: warning: implicit declaration of function 'cmse_TTA'
+// CHECK-c: warning: implicit declaration of function 'cmse_TTAT'
+// CHECK-c: warning: implicit declaration of function 'cmse_TTA_fptr'
+// CHECK-c: warning: implicit declaration of function 'cmse_TTAT_fptr'
+// CHECK-cpp: error: use of undeclared identifier 'cmse_TTA'
+// CHECK-cpp: error: use of undeclared identifier 'cmse_TTAT'
+// CHECK-cpp: error: use of undeclared identifier 'cmse_TTA_fptr'
+// CHECK-cpp: error: use of undeclared identifier 'cmse_TTAT_fptr'
+}
diff --git a/src/llvm-project/clang/test/Headers/arm-cmse-header.c b/src/llvm-project/clang/test/Headers/arm-cmse-header.c
new file mode 100644
index 0000000..862572d
--- /dev/null
+++ b/src/llvm-project/clang/test/Headers/arm-cmse-header.c
@@ -0,0 +1,20 @@
+// RUN: %clang_cc1 -triple thumbv8m.base-eabi -fsyntax-only -ffreestanding %s -verify -mcmse
+// RUN: %clang_cc1 -triple thumbv8m.base-eabi -fsyntax-only -ffreestanding -x c++ %s -verify -mcmse
+// expected-no-diagnostics
+
+#include <arm_cmse.h>
+
+typedef void (*callback_t)(void);
+
+void func(callback_t fptr, void *p)
+{
+ cmse_TT(p);
+ cmse_TTT(p);
+ cmse_TTA(p);
+ cmse_TTAT(p);
+
+ cmse_TT_fptr(fptr);
+ cmse_TTT_fptr(fptr);
+ cmse_TTA_fptr(fptr);
+ cmse_TTAT_fptr(fptr);
+}
diff --git a/src/llvm-project/clang/test/Headers/arm-fp16-header.c b/src/llvm-project/clang/test/Headers/arm-fp16-header.c
index 781113d..85068bb 100644
--- a/src/llvm-project/clang/test/Headers/arm-fp16-header.c
+++ b/src/llvm-project/clang/test/Headers/arm-fp16-header.c
@@ -6,14 +6,14 @@
// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding --target=aarch64_be-none-eabi -march=armv8.2-a+fp16 -std=c99 -xc %s
// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding --target=aarch64_be-none-eabi -march=armv8.2-a+fp16 -std=c11 -xc %s
-// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding --target=aarch64-none-eabi -march=armv8.2-a+fp16 -std=c++98 -xc++ %s
-// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding --target=aarch64-none-eabi -march=armv8.2-a+fp16 -std=c++11 -xc++ %s
-// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding --target=aarch64-none-eabi -march=armv8.2-a+fp16 -std=c++14 -xc++ %s
-// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding --target=aarch64-none-eabi -march=armv8.2-a+fp16 -std=c++17 -xc++ %s
+// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding -nostdinc++ --target=aarch64-none-eabi -march=armv8.2-a+fp16 -std=c++98 -xc++ %s
+// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding -nostdinc++ --target=aarch64-none-eabi -march=armv8.2-a+fp16 -std=c++11 -xc++ %s
+// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding -nostdinc++ --target=aarch64-none-eabi -march=armv8.2-a+fp16 -std=c++14 -xc++ %s
+// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding -nostdinc++ --target=aarch64-none-eabi -march=armv8.2-a+fp16 -std=c++17 -xc++ %s
-// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding --target=aarch64_be-none-eabi -march=armv8.2-a+fp16 -std=c++98 -xc++ %s
-// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding --target=aarch64_be-none-eabi -march=armv8.2-a+fp16 -std=c++11 -xc++ %s
-// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding --target=aarch64_be-none-eabi -march=armv8.2-a+fp16 -std=c++14 -xc++ %s
-// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding --target=aarch64_be-none-eabi -march=armv8.2-a+fp16 -std=c++17 -xc++ %s
+// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding -nostdinc++ --target=aarch64_be-none-eabi -march=armv8.2-a+fp16 -std=c++98 -xc++ %s
+// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding -nostdinc++ --target=aarch64_be-none-eabi -march=armv8.2-a+fp16 -std=c++11 -xc++ %s
+// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding -nostdinc++ --target=aarch64_be-none-eabi -march=armv8.2-a+fp16 -std=c++14 -xc++ %s
+// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding -nostdinc++ --target=aarch64_be-none-eabi -march=armv8.2-a+fp16 -std=c++17 -xc++ %s
#include <arm_fp16.h>
diff --git a/src/llvm-project/clang/test/Headers/arm-neon-header.c b/src/llvm-project/clang/test/Headers/arm-neon-header.c
index 06b99a4..f636288 100644
--- a/src/llvm-project/clang/test/Headers/arm-neon-header.c
+++ b/src/llvm-project/clang/test/Headers/arm-neon-header.c
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -triple thumbv7-apple-darwin10 -target-cpu cortex-a8 -fsyntax-only -Wvector-conversions -ffreestanding %s
-// RUN: %clang_cc1 -triple thumbv7-apple-darwin10 -target-cpu cortex-a8 -fsyntax-only -fno-lax-vector-conversions -ffreestanding %s
+// RUN: %clang_cc1 -triple thumbv7-apple-darwin10 -target-cpu cortex-a8 -fsyntax-only -flax-vector-conversions=none -ffreestanding %s
// RUN: %clang_cc1 -x c++ -triple thumbv7-apple-darwin10 -target-cpu cortex-a8 -fsyntax-only -Wvector-conversions -ffreestanding %s
// RUN: %clang -fsyntax-only -ffreestanding --target=aarch64-none-eabi -march=armv8.2-a+fp16 -std=c89 -xc %s
@@ -10,14 +10,17 @@
// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding --target=aarch64_be-none-eabi -march=armv8.2-a+fp16 -std=c99 -xc %s
// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding --target=aarch64_be-none-eabi -march=armv8.2-a+fp16 -std=c11 -xc %s
-// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding --target=aarch64-none-eabi -march=armv8.2-a+fp16 -std=c++98 -xc++ %s
-// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding --target=aarch64-none-eabi -march=armv8.2-a+fp16 -std=c++11 -xc++ %s
-// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding --target=aarch64-none-eabi -march=armv8.2-a+fp16 -std=c++14 -xc++ %s
-// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding --target=aarch64-none-eabi -march=armv8.2-a+fp16 -std=c++17 -xc++ %s
+// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding -nostdinc++ --target=aarch64-none-eabi -march=armv8.2-a+fp16 -std=c++98 -xc++ %s
+// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding -nostdinc++ --target=aarch64-none-eabi -march=armv8.2-a+fp16 -std=c++11 -xc++ %s
+// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding -nostdinc++ --target=aarch64-none-eabi -march=armv8.2-a+fp16 -std=c++14 -xc++ %s
+// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding -nostdinc++ --target=aarch64-none-eabi -march=armv8.2-a+fp16 -std=c++17 -xc++ %s
-// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding --target=aarch64_be-none-eabi -march=armv8.2-a+fp16 -std=c++98 -xc++ %s
-// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding --target=aarch64_be-none-eabi -march=armv8.2-a+fp16 -std=c++11 -xc++ %s
-// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding --target=aarch64_be-none-eabi -march=armv8.2-a+fp16 -std=c++14 -xc++ %s
-// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding --target=aarch64_be-none-eabi -march=armv8.2-a+fp16 -std=c++17 -xc++ %s
+// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding -nostdinc++ --target=aarch64_be-none-eabi -march=armv8.2-a+fp16 -std=c++98 -xc++ %s
+// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding -nostdinc++ --target=aarch64_be-none-eabi -march=armv8.2-a+fp16 -std=c++11 -xc++ %s
+// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding -nostdinc++ --target=aarch64_be-none-eabi -march=armv8.2-a+fp16 -std=c++14 -xc++ %s
+// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding -nostdinc++ --target=aarch64_be-none-eabi -march=armv8.2-a+fp16 -std=c++17 -xc++ %s
+
+// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding --target=aarch64-none-eabi -march=armv8.2-a+fp16fml+crypto+dotprod -std=c11 -xc -flax-vector-conversions=none %s
+// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding --target=aarch64_be-none-eabi -march=armv8.2-a+fp16fml+crypto+dotprod -std=c11 -xc -flax-vector-conversions=none %s
#include <arm_neon.h>
diff --git a/src/llvm-project/clang/test/Headers/ms-intrin.cpp b/src/llvm-project/clang/test/Headers/ms-intrin.cpp
index 18bb798..d3b6a1a 100644
--- a/src/llvm-project/clang/test/Headers/ms-intrin.cpp
+++ b/src/llvm-project/clang/test/Headers/ms-intrin.cpp
@@ -56,12 +56,8 @@
__nop();
__readmsr(0);
- // FIXME: Call these in 64-bit too once the intrinsics have been fixed to
- // work there, PR19301
-#ifndef _M_X64
__readcr3();
__writecr3(0);
-#endif
#ifdef _M_ARM
__dmb(_ARM_BARRIER_ISHST);
diff --git a/src/llvm-project/clang/test/Headers/ppc-intrinsics.c b/src/llvm-project/clang/test/Headers/ppc-intrinsics.c
new file mode 100644
index 0000000..3b37533
--- /dev/null
+++ b/src/llvm-project/clang/test/Headers/ppc-intrinsics.c
@@ -0,0 +1,28 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// REQUIRES: powerpc-registered-target
+// expected-no-diagnostics
+
+// Don't include mm_malloc.h, it's system specific.
+#define _MM_MALLOC_H_INCLUDED
+
+// RUN: %clang -S -emit-llvm -DNO_WARN_X86_INTRINSICS -mcpu=pwr8 -target powerpc64-unknown-linux-gnu %s -Xclang -verify
+// RUN: %clang -S -emit-llvm -DNO_WARN_X86_INTRINSICS -mcpu=pwr8 -target powerpc64-unknown-linux-gnu %s -Xclang -verify -x c++
+
+// Since mm_malloc.h references system native stdlib.h, doing cross-compile
+// testing may cause unexpected problems. This would affect xmmintrin.h and
+// other following intrinsics headers. If there's need to test them using
+// cross-compile, please add -ffreestanding to compiler options, like
+// test/CodeGen/ppc-xmmintrin.c.
+
+// RUN: not %clang -S -emit-llvm -target powerpc64-unknown-linux-gnu -mcpu=pwr8 %s -o /dev/null 2>&1 | FileCheck %s -check-prefix=CHECK-ERROR
+
+#include <mmintrin.h>
+
+// Altivec must be enabled.
+#include <xmmintrin.h>
+#include <emmintrin.h>
+#include <pmmintrin.h>
+#include <tmmintrin.h>
+#include <smmintrin.h>
+
+// CHECK-ERROR: {{[0-9]+}}:{{[0-9]+}}: error: "Please read comment above. Use -DNO_WARN_X86_INTRINSICS to disable this error."
diff --git a/src/llvm-project/clang/test/Headers/ppc-mmx-intrinsics.c b/src/llvm-project/clang/test/Headers/ppc-mmx-intrinsics.c
deleted file mode 100644
index 406694d..0000000
--- a/src/llvm-project/clang/test/Headers/ppc-mmx-intrinsics.c
+++ /dev/null
@@ -1,11 +0,0 @@
-// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
-// REQUIRES: powerpc-registered-target
-
-// RUN: %clang -S -emit-llvm -DNO_WARN_X86_INTRINSICS -mcpu=pwr7 -target powerpc64-unknown-linux-gnu %s -Xclang -verify
-// RUN: %clang -S -emit-llvm -DNO_WARN_X86_INTRINSICS -mcpu=pwr7 -target powerpc64-unknown-linux-gnu %s -Xclang -verify -x c++
-// expected-no-diagnostics
-
-// RUN: not %clang -S -emit-llvm -target powerpc64-unknown-linux-gnu -mcpu=pwr7 %s -o /dev/null 2>&1 | FileCheck %s -check-prefix=CHECK-ERROR
-
-#include <mmintrin.h>
-// CHECK-ERROR: mmintrin.h:{{[0-9]+}}:{{[0-9]+}}: error: "Please read comment above. Use -DNO_WARN_X86_INTRINSICS to disable this error."
diff --git a/src/llvm-project/clang/test/Headers/ppc-sse-intrinsics.c b/src/llvm-project/clang/test/Headers/ppc-sse-intrinsics.c
deleted file mode 100644
index 91906f0..0000000
--- a/src/llvm-project/clang/test/Headers/ppc-sse-intrinsics.c
+++ /dev/null
@@ -1,22 +0,0 @@
-// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
-// REQUIRES: powerpc-registered-target
-
-// Since mm_malloc.h references system native stdlib.h, doing cross-compile
-// testing may cause unexpected problems. This would affect xmmintrin.h and
-// other following intrinsics headers. If there's need to test them using
-// cross-compile, please add -ffreestanding to compiler options, like
-// test/CodeGen/ppc-xmmintrin.c.
-
-// RUN: %clang -target powerpc64-unknown-linux-gnu -S -emit-llvm -DNO_WARN_X86_INTRINSICS %s -mcpu=pwr7 -Xclang -verify
-// RUN: %clang -target powerpc64-unknown-linux-gnu -S -emit-llvm -DNO_WARN_X86_INTRINSICS %s -mcpu=pwr7 -Xclang -verify -x c++
-// expected-no-diagnostics
-
-// RUN: not %clang -target powerpc64-unknown-linux-gnu -S -emit-llvm %s -mcpu=pwr7 -o /dev/null 2>&1 | FileCheck %s -check-prefix=SSE-ERROR
-
-// Don't include mm_malloc.h, it's system specific.
-#define _MM_MALLOC_H_INCLUDED
-
-// Altivec must be enabled.
-#include <xmmintrin.h>
-
-// SSE-ERROR: xmmintrin.h:{{[0-9]+}}:{{[0-9]+}}: error: "Please read comment above. Use -DNO_WARN_X86_INTRINSICS to disable this error."
diff --git a/src/llvm-project/clang/test/Headers/ppc-sse2-intrinsics.c b/src/llvm-project/clang/test/Headers/ppc-sse2-intrinsics.c
deleted file mode 100644
index f1581dd..0000000
--- a/src/llvm-project/clang/test/Headers/ppc-sse2-intrinsics.c
+++ /dev/null
@@ -1,14 +0,0 @@
-// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
-// REQUIRES: powerpc-registered-target
-
-// RUN: %clang -target powerpc64-unknown-linux-gnu -S -emit-llvm -mcpu=pwr8 -DNO_WARN_X86_INTRINSICS %s -Xclang -verify
-// RUN: %clang -target powerpc64le-unknown-linux-gnu -S -emit-llvm -mcpu=pwr8 -DNO_WARN_X86_INTRINSICS %s -Xclang -verify -x c++
-// expected-no-diagnostics
-
-// RUN: not %clang -target powerpc64-unknown-linux-gnu -S -emit-llvm %s -mcpu=pwr8 -o /dev/null 2>&1 | FileCheck %s -check-prefix=SSE2-ERROR
-
-// Don't include mm_malloc.h, it's system specific.
-#define _MM_MALLOC_H_INCLUDED
-
-#include <emmintrin.h>
-// SSE2-ERROR: xmmintrin.h:{{[0-9]+}}:{{[0-9]+}}: error: "Please read comment above. Use -DNO_WARN_X86_INTRINSICS to disable this error."
diff --git a/src/llvm-project/clang/test/Headers/stdbool.cpp b/src/llvm-project/clang/test/Headers/stdbool.cpp
index 0110a45..70a921f 100644
--- a/src/llvm-project/clang/test/Headers/stdbool.cpp
+++ b/src/llvm-project/clang/test/Headers/stdbool.cpp
@@ -1,7 +1,7 @@
-// RUN: %clang_cc1 -std=gnu++98 -E -dM %s | FileCheck --check-prefix=CHECK-GNU-COMPAT-98 %s
-// RUN: %clang_cc1 -std=gnu++11 -E -dM %s | FileCheck --check-prefix=CHECK-GNU-COMPAT-11 %s
-// RUN: %clang_cc1 -std=c++98 -E -dM %s | FileCheck --check-prefix=CHECK-CONFORMING %s
-// RUN: %clang_cc1 -fsyntax-only -std=gnu++98 -verify -Weverything %s
+// RUN: %clang_cc1 -fgnuc-version=4.2.1 -std=gnu++98 -E -dM %s | FileCheck --check-prefix=CHECK-GNU-COMPAT-98 %s
+// RUN: %clang_cc1 -fgnuc-version=4.2.1 -std=gnu++11 -E -dM %s | FileCheck --check-prefix=CHECK-GNU-COMPAT-11 %s
+// RUN: %clang_cc1 -fgnuc-version=4.2.1 -std=c++98 -E -dM %s | FileCheck --check-prefix=CHECK-CONFORMING %s
+// RUN: %clang_cc1 -fgnuc-version=4.2.1 -fsyntax-only -std=gnu++98 -verify -Weverything %s
#include <stdbool.h>
#define zzz
diff --git a/src/llvm-project/clang/test/Headers/x86-intrinsics-headers-clean.cpp b/src/llvm-project/clang/test/Headers/x86-intrinsics-headers-clean.cpp
index 0a06790..d0b86ba 100644
--- a/src/llvm-project/clang/test/Headers/x86-intrinsics-headers-clean.cpp
+++ b/src/llvm-project/clang/test/Headers/x86-intrinsics-headers-clean.cpp
@@ -1,7 +1,7 @@
// Make sure the intrinsic headers compile cleanly with no warnings or errors.
// RUN: %clang_cc1 -ffreestanding -triple x86_64-unknown-unknown -Wsystem-headers \
-// RUN: -fsyntax-only -fno-lax-vector-conversions -x c++ -verify %s
+// RUN: -Wcast-qual -fsyntax-only -flax-vector-conversions=none -x c++ -verify %s
// expected-no-diagnostics
diff --git a/src/llvm-project/clang/test/Headers/x86-intrinsics-headers.c b/src/llvm-project/clang/test/Headers/x86-intrinsics-headers.c
index 91c4ffa..59ca354 100644
--- a/src/llvm-project/clang/test/Headers/x86-intrinsics-headers.c
+++ b/src/llvm-project/clang/test/Headers/x86-intrinsics-headers.c
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -fsyntax-only -ffreestanding %s
-// RUN: %clang_cc1 -fsyntax-only -ffreestanding -fno-lax-vector-conversions %s
+// RUN: %clang_cc1 -fsyntax-only -ffreestanding -flax-vector-conversions=none %s
// RUN: %clang_cc1 -fsyntax-only -ffreestanding -x c++ %s
#if defined(i386) || defined(__x86_64__)
diff --git a/src/llvm-project/clang/test/Headers/x86intrin-2.c b/src/llvm-project/clang/test/Headers/x86intrin-2.c
index e6fd7c8..90475c6 100644
--- a/src/llvm-project/clang/test/Headers/x86intrin-2.c
+++ b/src/llvm-project/clang/test/Headers/x86intrin-2.c
@@ -1,6 +1,6 @@
-// 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
+// RUN: %clang_cc1 -fsyntax-only -ffreestanding -Wcast-qual %s -verify
+// RUN: %clang_cc1 -fsyntax-only -ffreestanding -flax-vector-conversions=none -Wcast-qual %s -verify
+// RUN: %clang_cc1 -fsyntax-only -ffreestanding -Wcast-qual -x c++ %s -verify
// expected-no-diagnostics
#if defined(i386) || defined(__x86_64__)
@@ -16,6 +16,10 @@
return _mm_add_ss(a, b);
}
+void __attribute__((__target__("sse"))) mm_prefetch_wrap(const void *p) {
+ _mm_prefetch(p, 0x3);
+}
+
__m128d __attribute__((__target__("sse2"))) mm_sqrt_sd_wrap(__m128d a, __m128d b) {
return _mm_sqrt_sd(a, b);
}
diff --git a/src/llvm-project/clang/test/Headers/x86intrin.c b/src/llvm-project/clang/test/Headers/x86intrin.c
index 7c15c48..53e3695 100644
--- a/src/llvm-project/clang/test/Headers/x86intrin.c
+++ b/src/llvm-project/clang/test/Headers/x86intrin.c
@@ -1,5 +1,5 @@
// 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 -flax-vector-conversions=none %s -verify
// RUN: %clang_cc1 -fsyntax-only -ffreestanding -x c++ %s -verify
// expected-no-diagnostics
diff --git a/src/llvm-project/clang/test/Headers/xmmintrin.c b/src/llvm-project/clang/test/Headers/xmmintrin.c
index c617504..9b8993e 100644
--- a/src/llvm-project/clang/test/Headers/xmmintrin.c
+++ b/src/llvm-project/clang/test/Headers/xmmintrin.c
@@ -22,7 +22,7 @@
// Make sure that including <xmmintrin.h> also makes <emmintrin.h>'s content available.
// This is an ugly hack for GCC compatibility.
-__m128 test_xmmintrin_provides_emmintrin(__m128d __a, __m128d __b) {
+__m128d test_xmmintrin_provides_emmintrin(__m128d __a, __m128d __b) {
return _mm_add_sd(__a, __b);
}
diff --git a/src/llvm-project/clang/test/Import/builtin-template/Inputs/S.cpp b/src/llvm-project/clang/test/Import/builtin-template/Inputs/S.cpp
new file mode 100644
index 0000000..d5c9a9a
--- /dev/null
+++ b/src/llvm-project/clang/test/Import/builtin-template/Inputs/S.cpp
@@ -0,0 +1,16 @@
+template <class T, T... I>
+struct Seq {
+ static constexpr T PackSize = sizeof...(I);
+};
+
+template <typename T, T N>
+using MakeSeq = __make_integer_seq<Seq, T, N>;
+
+
+using SizeT = decltype(sizeof(int));
+
+template <SizeT i, typename ...T>
+using TypePackElement = __type_pack_element<i, T...>;
+
+template <int i>
+struct X;
diff --git a/src/llvm-project/clang/test/Import/builtin-template/test.cpp b/src/llvm-project/clang/test/Import/builtin-template/test.cpp
new file mode 100644
index 0000000..3ae7b53
--- /dev/null
+++ b/src/llvm-project/clang/test/Import/builtin-template/test.cpp
@@ -0,0 +1,30 @@
+// RUN: clang-import-test -dump-ast -import %S/Inputs/S.cpp -expression %s -Xcc -DSEQ | FileCheck --check-prefix=CHECK-SEQ %s
+// RUN: clang-import-test -dump-ast -import %S/Inputs/S.cpp -expression %s -Xcc -DPACK | FileCheck --check-prefix=CHECK-PACK %s
+// RUN: clang-import-test -dump-ast -import %S/Inputs/S.cpp -expression %s -Xcc -DPACK -Xcc -DSEQ | FileCheck --check-prefixes=CHECK-SEQ,CHECK-PACK %s
+
+// CHECK-SEQ: BuiltinTemplateDecl
+// CHECK-SEQ-SAME: <invalid sloc>
+// CHECK-SEQ-SAME: implicit
+// CHECK-SEQ-SAME: __make_integer_seq
+
+// CHECK-PACK: BuiltinTemplateDecl
+// CHECK-PACK-SAME: <invalid sloc>
+// CHECK-PACK-SAME: implicit
+// CHECK-PACK-SAME: __type_pack_element
+
+void expr() {
+#ifdef SEQ
+ typedef MakeSeq<int, 3> M1;
+ M1 m1;
+ typedef MakeSeq<long, 4> M2;
+ M2 m2;
+ static_assert(M1::PackSize == 3, "");
+ static_assert(M2::PackSize == 4, "");
+#endif
+
+#ifdef PACK
+ static_assert(__is_same(TypePackElement<0, X<0>>, X<0>), "");
+ static_assert(__is_same(TypePackElement<0, X<0>, X<1>>, X<0>), "");
+ static_assert(__is_same(TypePackElement<1, X<0>, X<1>>, X<1>), "");
+#endif
+}
diff --git a/src/llvm-project/clang/test/Import/cxx-anon-namespace/test.cpp b/src/llvm-project/clang/test/Import/cxx-anon-namespace/test.cpp
index 0cbf08c..e7668cc 100644
--- a/src/llvm-project/clang/test/Import/cxx-anon-namespace/test.cpp
+++ b/src/llvm-project/clang/test/Import/cxx-anon-namespace/test.cpp
@@ -2,9 +2,13 @@
// The implicit UsingDirectiveDecls for the anonymous namespaces are created by the Sema.
-// CHECK: NamespaceDecl
+// There might be another builtin namespace before our first namespace, so we can't
+// just look for NamespaceDecl. Instead look for the first line of F.cpp (which only
+// contains the namespace we are looking for but no other decl).
+// CHECK: F.cpp:1:1
// The nested anonymous namespace.
// CHECK-NEXT: NamespaceDecl
+// CHECK-SAME: line:21:11
// CHECK: FunctionDecl
// CHECK-SAME: func4
// CHECK-NEXT: CompoundStmt
diff --git a/src/llvm-project/clang/test/Import/enum/test.cpp b/src/llvm-project/clang/test/Import/enum/test.cpp
index 491c3b7..3698aea 100644
--- a/src/llvm-project/clang/test/Import/enum/test.cpp
+++ b/src/llvm-project/clang/test/Import/enum/test.cpp
@@ -1,5 +1,7 @@
// RUN: clang-import-test -dump-ast -import %S/Inputs/S.cpp -expression %s | FileCheck %s
+// CHECK: |-EnumDecl
+// CHECK-SAME: Inputs/S.cpp:1:1, line:4:1> line:1:6 E
// CHECK: OpaqueWithType 'long'
void expr() {
diff --git a/src/llvm-project/clang/test/Import/namespace/Inputs/NS.cpp b/src/llvm-project/clang/test/Import/namespace/Inputs/NS.cpp
new file mode 100644
index 0000000..0dc86f8
--- /dev/null
+++ b/src/llvm-project/clang/test/Import/namespace/Inputs/NS.cpp
@@ -0,0 +1,5 @@
+namespace NS {
+void f1();
+void f2();
+const int A = 3;
+}; // namespace NS
diff --git a/src/llvm-project/clang/test/Import/namespace/test.cpp b/src/llvm-project/clang/test/Import/namespace/test.cpp
new file mode 100644
index 0000000..f14b807
--- /dev/null
+++ b/src/llvm-project/clang/test/Import/namespace/test.cpp
@@ -0,0 +1,8 @@
+// RUN: clang-import-test -dump-ast -import %S/Inputs/NS.cpp -expression %s | FileCheck %s
+
+// CHECK: `-NamespaceDecl
+// CHECK-SAME: Inputs/NS.cpp:1:1, line:5:1> line:1:11 NS
+
+void expr() {
+ static_assert(NS::A == 3);
+}
diff --git a/src/llvm-project/clang/test/Import/struct-and-var/test.cpp b/src/llvm-project/clang/test/Import/struct-and-var/test.cpp
index 76f539e..8a499bf 100644
--- a/src/llvm-project/clang/test/Import/struct-and-var/test.cpp
+++ b/src/llvm-project/clang/test/Import/struct-and-var/test.cpp
@@ -1,4 +1,8 @@
-// RUN: clang-import-test --import %S/Inputs/S1.cpp --import %S/Inputs/S2.cpp -expression %s
+// RUN: clang-import-test -dump-ast --import %S/Inputs/S1.cpp --import %S/Inputs/S2.cpp -expression %s | FileCheck %s
+
+// CHECK: {{^`-CXXRecordDecl}}
+// CHECK-SAME: Inputs/S2.cpp:1:1, line:3:1> line:1:8 struct F
+
void expr() {
struct F f;
int x = f.a;
diff --git a/src/llvm-project/clang/test/Import/template-specialization/test.cpp b/src/llvm-project/clang/test/Import/template-specialization/test.cpp
index 30df818..3e7e4bc 100644
--- a/src/llvm-project/clang/test/Import/template-specialization/test.cpp
+++ b/src/llvm-project/clang/test/Import/template-specialization/test.cpp
@@ -1,4 +1,7 @@
-// RUN: clang-import-test -import %S/Inputs/T.cpp -expression %s
+// RUN: clang-import-test -dump-ast -import %S/Inputs/T.cpp -expression %s | FileCheck %s
+
+// CHECK: |-ClassTemplateSpecializationDecl
+// CHECK-SAME: <line:4:1, line:8:1> line:4:20 struct A
void expr() {
A<int>::B b1;
diff --git a/src/llvm-project/clang/test/Index/Core/index-source.cpp b/src/llvm-project/clang/test/Index/Core/index-source.cpp
index b57b156..f159b1c 100644
--- a/src/llvm-project/clang/test/Index/Core/index-source.cpp
+++ b/src/llvm-project/clang/test/Index/Core/index-source.cpp
@@ -461,12 +461,12 @@
};
static_assert(StaticAssertRef::constVar, "index static asserts");
-// CHECK: [[@LINE-1]]:32 | static-property/C++ | constVar | c:@S@StaticAssertRef@constVar | __ZN15StaticAssertRef8constVarE | Ref | rel: 0
+// CHECK: [[@LINE-1]]:32 | static-property/C++ | constVar | c:@S@StaticAssertRef@constVar | __ZN15StaticAssertRef8constVarE | Ref,Read | rel: 0
// CHECK: [[@LINE-2]]:15 | struct/C++ | StaticAssertRef | c:@S@StaticAssertRef | <no-cgname> | Ref | rel: 0
void staticAssertInFn() {
static_assert(StaticAssertRef::constVar, "index static asserts");
-// CHECK: [[@LINE-1]]:34 | static-property/C++ | constVar | c:@S@StaticAssertRef@constVar | __ZN15StaticAssertRef8constVarE | Ref,RelCont | rel: 1
+// CHECK: [[@LINE-1]]:34 | static-property/C++ | constVar | c:@S@StaticAssertRef@constVar | __ZN15StaticAssertRef8constVarE | Ref,Read,RelCont | rel: 1
// CHECK-NEXT: RelCont | staticAssertInFn | c:@F@staticAssertInFn#
// CHECK: [[@LINE-3]]:17 | struct/C++ | StaticAssertRef | c:@S@StaticAssertRef | <no-cgname> | Ref,RelCont | rel: 1
// CHECK-NEXT: RelCont | staticAssertInFn | c:@F@staticAssertInFn#
diff --git a/src/llvm-project/clang/test/Index/Inputs/CommentXML/valid-inline-command-01.xml b/src/llvm-project/clang/test/Index/Inputs/CommentXML/valid-inline-command-01.xml
new file mode 100644
index 0000000..6f1a81c
--- /dev/null
+++ b/src/llvm-project/clang/test/Index/Inputs/CommentXML/valid-inline-command-01.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Namespace>
+<Name>aaa</Name>
+<Abstract>
+ <Para>
+ <anchor id="aaa"></anchor>
+ </Para>
+</Abstract>
+</Namespace>
diff --git a/src/llvm-project/clang/test/Index/annotate-comments-typedef.m b/src/llvm-project/clang/test/Index/annotate-comments-typedef.m
index 751cfaa..77c4d63 100644
--- a/src/llvm-project/clang/test/Index/annotate-comments-typedef.m
+++ b/src/llvm-project/clang/test/Index/annotate-comments-typedef.m
@@ -17,7 +17,7 @@
MyEnumBar, /**< value Bar */
MyEnumBaz, /**< value Baz */
} MyEnum;
-// CHECK: TypedefDecl=MyEnum:[[@LINE-1]]:3 (Definition) FullCommentAsHTML=[<p class="para-brief"> Documentation for MyEnum </p>] FullCommentAsXML=[<Typedef file="{{[^"]+}}annotate-comments-typedef.m" line="[[@LINE-1]]" column="3"><Name><anonymous></Name><USR>c:@EA@MyEnum</USR><Declaration>typedef enum MyEnum MyEnum</Declaration><Abstract><Para> Documentation for MyEnum </Para></Abstract></Typedef>]
+// CHECK: TypedefDecl=MyEnum:[[@LINE-1]]:3 (Definition) {{.*}} FullCommentAsHTML=[<p class="para-brief"> Documentation for MyEnum </p>] FullCommentAsXML=[<Typedef file="{{[^"]+}}annotate-comments-typedef.m" line="[[@LINE-1]]" column="3"><Name>MyEnum</Name><USR>c:@T@MyEnum</USR><Declaration>typedef enum MyEnum MyEnum</Declaration><Abstract><Para> Documentation for MyEnum </Para></Abstract></Typedef>]
/** Documentation for E */
@@ -35,7 +35,7 @@
typedef struct {
int iii;
} Foo;
-// CHECK: TypedefDecl=Foo:[[@LINE-1]]:11 (Definition) FullCommentAsHTML=[<p class="para-brief"> Comment about Foo </p>] FullCommentAsXML=[<Typedef file="{{[^"]+}}annotate-comments-typedef.m" line="[[@LINE-1]]" column="11"><Name><anonymous></Name><USR>c:@SA@Foo</USR><Declaration>typedef struct Foo Foo</Declaration><Abstract><Para> Comment about Foo </Para></Abstract></Typedef>]
+// CHECK: TypedefDecl=Foo:[[@LINE-1]]:11 (Definition) {{.*}} FullCommentAsHTML=[<p class="para-brief"> Comment about Foo </p>] FullCommentAsXML=[<Typedef file="{{[^"]+}}annotate-comments-typedef.m" line="[[@LINE-1]]" column="11"><Name>Foo</Name><USR>c:@T@Foo</USR><Declaration>typedef struct Foo Foo</Declaration><Abstract><Para> Comment about Foo </Para></Abstract></Typedef>]
// CHECK: StructDecl=:[[@LINE-4]]:9 (Definition) {{.*}} BriefComment=[Comment about Foo] FullCommentAsHTML=[<p class="para-brief"> Comment about Foo </p>] FullCommentAsXML=[<Class file="{{[^"]+}}annotate-comments-typedef.m" line="[[@LINE-4]]" column="9"><Name><anonymous></Name><USR>c:@SA@Foo</USR><Declaration>struct {}</Declaration><Abstract><Para> Comment about Foo </Para></Abstract></Class>]
diff --git a/src/llvm-project/clang/test/Index/comment-redeclarations.cpp b/src/llvm-project/clang/test/Index/comment-redeclarations.cpp
new file mode 100644
index 0000000..da9db7c
--- /dev/null
+++ b/src/llvm-project/clang/test/Index/comment-redeclarations.cpp
@@ -0,0 +1,14 @@
+// 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 %s > %t/out
+// RUN: FileCheck %s < %t/out
+
+class Foo;
+// CHECK: CXComment_Text Text=[ Foo is the best!])))]
+
+/// Foo is the best!
+class Foo;
+// CHECK: CXComment_Text Text=[ Foo is the best!])))]
+
+class Foo {};
+// CHECK: CXComment_Text Text=[ Foo is the best!])))]
diff --git a/src/llvm-project/clang/test/Index/comment-to-html-xml-conversion.cpp b/src/llvm-project/clang/test/Index/comment-to-html-xml-conversion.cpp
index 9e25ff1..bba5cf8 100644
--- a/src/llvm-project/clang/test/Index/comment-to-html-xml-conversion.cpp
+++ b/src/llvm-project/clang/test/Index/comment-to-html-xml-conversion.cpp
@@ -734,6 +734,16 @@
// CHECK-NEXT: (CXComment_Text Text=[Aaa])
// CHECK-NEXT: (CXComment_HTMLEndTag Name=[h1])))]
+/// \anchor A
+void comment_to_html_conversion_37();
+
+// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_html_conversion_37:{{.*}} FullCommentAsHTML=[<p class="para-brief"> <span id="A"></span></p>] FullCommentAsXML=[<Function file="{{[^"]+}}comment-to-html-xml-conversion.cpp" line="[[@LINE-2]]" column="6"><Name>comment_to_html_conversion_37</Name><USR>c:@F@comment_to_html_conversion_37#</USR><Declaration>void comment_to_html_conversion_37()</Declaration><Abstract><Para> <anchor id="A"></anchor></Para></Abstract></Function>]
+// CHECK-NEXT: CommentAST=[
+// CHECK-NEXT: (CXComment_FullComment
+// CHECK-NEXT: (CXComment_Paragraph
+// CHECK-NEXT: (CXComment_Text Text=[ ] IsWhitespace)
+// CHECK-NEXT: (CXComment_InlineCommand CommandName=[anchor] RenderAnchor Arg[0]=A)))]
+
/// Aaa.
class comment_to_xml_conversion_01 {
diff --git a/src/llvm-project/clang/test/Index/comment-xml-schema.c b/src/llvm-project/clang/test/Index/comment-xml-schema.c
index 37cb47c..da529a5 100644
--- a/src/llvm-project/clang/test/Index/comment-xml-schema.c
+++ b/src/llvm-project/clang/test/Index/comment-xml-schema.c
@@ -33,6 +33,8 @@
// RUN: xmllint --noout --relaxng %S/../../bindings/xml/comment-xml-schema.rng %S/Inputs/CommentXML/valid-enum-01.xml
//
// 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/valid-inline-command-01.xml
// 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
diff --git a/src/llvm-project/clang/test/Index/crash-recovery-modules.m b/src/llvm-project/clang/test/Index/crash-recovery-modules.m
index 296416d..82979f7 100644
--- a/src/llvm-project/clang/test/Index/crash-recovery-modules.m
+++ b/src/llvm-project/clang/test/Index/crash-recovery-modules.m
@@ -2,16 +2,15 @@
// RUN: rm -rf %t
// Parse the file, such that building the module will cause Clang to 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 %s > /dev/null 2> %t.err
+// RUN: env CINDEXTEST_FAILONERROR=1 not c-index-test -test-load-source all -fmodules -fmodules-cache-path=%t -Xclang -fdisable-module-hash -I %S/Inputs/Headers -DCRASH %s > /dev/null 2> %t.err
// RUN: FileCheck < %t.err -check-prefix=CHECK-CRASH %s
-// CHECK-CRASH: crash-recovery-modules.m:17:9:{17:2-17:14}: fatal error: could not build module 'Crash'
+// CHECK-CRASH: crash-recovery-modules.m:16:9:{16:2-16:14}: fatal error: could not build module 'Crash'
// Parse the file again, without crashing, to make sure that
// subsequent parses do the right thing.
// RUN: env CINDEXTEST_FAILONERROR=1 c-index-test -test-load-source all -fmodules -fmodules-cache-path=%t -Xclang -fdisable-module-hash -I %S/Inputs/Headers %s > /dev/null
// REQUIRES: crash-recovery
-// REQUIRES: shell
// UNSUPPORTED: libstdcxx-safe-mode
@import Crash;
@@ -27,10 +26,10 @@
// 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 > /dev/null 2> %t.err
+// RUN: env CINDEXTEST_FAILONERROR=1 not c-index-test -test-load-source all -fmodules -fmodules-cache-path=%t -Xclang -fdisable-module-hash -I %S/Inputs/Headers -DCRASH -DLIBCLANG_CRASH %s > /dev/null 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 > /dev/null 2> %t.err
+// RUN: env CINDEXTEST_FAILONERROR=1 not c-index-test -test-load-source all -fmodules -fmodules-cache-path=%t -Xclang -fdisable-module-hash -I %S/Inputs/Headers -DLIBCLANG_CRASH %s > /dev/null 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!
+// CHECK-LIBCLANG-CRASH-DAG: libclang: crash detected during parsing
+// CHECK-LIBCLANG-CRASH-DAG: Unable to load translation unit!
diff --git a/src/llvm-project/clang/test/Index/index-module-with-vfs.m b/src/llvm-project/clang/test/Index/index-module-with-vfs.m
index f3ca60c..06944d3 100644
--- a/src/llvm-project/clang/test/Index/index-module-with-vfs.m
+++ b/src/llvm-project/clang/test/Index/index-module-with-vfs.m
@@ -1,4 +1,3 @@
-// REQUIRES: shell
@import ModuleNeedsVFS;
void foo() {
@@ -7,11 +6,11 @@
}
// RUN: rm -rf %t.cache
-// RUN: sed -e "s:INPUT_DIR:%S/Inputs:g" -e "s:OUT_DIR:%t:g" %S/Inputs/vfsoverlay.yaml > %t.yaml
+// RUN: sed -e "s@INPUT_DIR@%{/S:regex_replacement}/Inputs@g" -e "s@OUT_DIR@%{/t:regex_replacement}@g" %S/Inputs/vfsoverlay.yaml > %t.yaml
// RUN: c-index-test -index-file %s -fmodules-cache-path=%t.cache -fmodules -F %t -I %t \
// RUN: -ivfsoverlay %t.yaml -Xclang -fdisable-module-hash | FileCheck %s
-// CHECK: [importedASTFile]: {{.*}}ModuleNeedsVFS.pcm | loc: 2:1 | name: "ModuleNeedsVFS" | isImplicit: 0
+// CHECK: [importedASTFile]: {{.*}}ModuleNeedsVFS.pcm | loc: 1:1 | name: "ModuleNeedsVFS" | isImplicit: 0
// CHECK: [indexEntityReference]: kind: function | name: module_needs_vfs
// CHECK: [indexEntityReference]: kind: function | name: base_module_needs_vfs
diff --git a/src/llvm-project/clang/test/Index/index-templates.cpp b/src/llvm-project/clang/test/Index/index-templates.cpp
index 424a638..b06ea7f 100644
--- a/src/llvm-project/clang/test/Index/index-templates.cpp
+++ b/src/llvm-project/clang/test/Index/index-templates.cpp
@@ -155,7 +155,7 @@
// CHECK-LOAD: index-templates.cpp:36:44: DeclRefExpr=OneDimension:35:16 Extent=[36:44 - 36:56]
// CHECK-LOAD: index-templates.cpp:40:8: ClassTemplate=storage:40:8 (Definition) Extent=[39:1 - 40:19]
// CHECK-LOAD: index-templates.cpp:39:45: TemplateTemplateParameter=DataStructure:39:45 (Definition) Extent=[39:10 - 39:66]
-// CHECK-LOAD: index-templates.cpp:39:19: TemplateTypeParameter=:39:19 (Definition) Extent=[39:19 - 39:27]
+// CHECK-LOAD: index-templates.cpp:39:27: TemplateTypeParameter=:39:27 (Definition) Extent=[39:19 - 39:27]
// CHECK-LOAD: index-templates.cpp:39:37: NonTypeTemplateParameter=:39:37 (Definition) Extent=[39:29 - 39:37]
// CHECK-LOAD: index-templates.cpp:39:61: TemplateRef=array:37:8 Extent=[39:61 - 39:66]
// CHECK-LOAD: index-templates.cpp:42:18: TypedefDecl=Unsigned:42:18 (Definition) Extent=[42:1 - 42:26]
diff --git a/src/llvm-project/clang/test/Index/lit.local.cfg b/src/llvm-project/clang/test/Index/lit.local.cfg
new file mode 100644
index 0000000..fb7d197
--- /dev/null
+++ b/src/llvm-project/clang/test/Index/lit.local.cfg
@@ -0,0 +1,12 @@
+import platform
+
+# Some tests perform deep recursion, which requires a larger pthread stack size
+# than the relatively low default of 192 KiB for 64-bit processes on AIX. The
+# `AIXTHREAD_STK` environment variable provides a non-intrusive way to request
+# a larger pthread stack size for the tests. Various applications and runtime
+# libraries on AIX use a default pthread stack size of 4 MiB, so we will use
+# that as a default value here.
+if 'AIXTHREAD_STK' in os.environ:
+ config.environment['AIXTHREAD_STK'] = os.environ['AIXTHREAD_STK']
+elif platform.system() == 'AIX':
+ config.environment['AIXTHREAD_STK'] = '4194304'
diff --git a/src/llvm-project/clang/test/Index/opencl-types.cl b/src/llvm-project/clang/test/Index/opencl-types.cl
index e132c9d..496f387 100644
--- a/src/llvm-project/clang/test/Index/opencl-types.cl
+++ b/src/llvm-project/clang/test/Index/opencl-types.cl
@@ -16,12 +16,12 @@
double4 vectorDouble;
}
-// CHECK: VarDecl=scalarHalf:11:8 (Definition){{( \(invalid\))?}} [type=half] [typekind=Half] [isPOD=1]
-// CHECK: VarDecl=vectorHalf:12:9 (Definition) [type=half4] [typekind=Typedef] [canonicaltype=half __attribute__((ext_vector_type(4)))] [canonicaltypekind=ExtVector] [isPOD=1]
-// CHECK: VarDecl=scalarFloat:13:9 (Definition) [type=float] [typekind=Float] [isPOD=1]
-// CHECK: VarDecl=vectorFloat:14:10 (Definition) [type=float4] [typekind=Typedef] [canonicaltype=float __attribute__((ext_vector_type(4)))] [canonicaltypekind=ExtVector] [isPOD=1]
-// CHECK: VarDecl=scalarDouble:15:10 (Definition){{( \(invalid\))?}} [type=double] [typekind=Double] [isPOD=1]
-// CHECK: VarDecl=vectorDouble:16:11 (Definition){{( \(invalid\))?}} [type=double4] [typekind=Typedef] [canonicaltype=double __attribute__((ext_vector_type(4)))] [canonicaltypekind=ExtVector] [isPOD=1]
+// CHECK: VarDecl=scalarHalf:11:8 (Definition){{( \(invalid\))?}} [type=__private half] [typekind=Half] [isPOD=1]
+// CHECK: VarDecl=vectorHalf:12:9 (Definition) [type=__private half4] [typekind=Typedef] [canonicaltype=half __private __attribute__((ext_vector_type(4)))] [canonicaltypekind=ExtVector] [isPOD=1]
+// CHECK: VarDecl=scalarFloat:13:9 (Definition) [type=__private float] [typekind=Float] [isPOD=1]
+// CHECK: VarDecl=vectorFloat:14:10 (Definition) [type=__private float4] [typekind=Typedef] [canonicaltype=float __private __attribute__((ext_vector_type(4)))] [canonicaltypekind=ExtVector] [isPOD=1]
+// CHECK: VarDecl=scalarDouble:15:10 (Definition){{( \(invalid\))?}} [type=__private double] [typekind=Double] [isPOD=1]
+// CHECK: VarDecl=vectorDouble:16:11 (Definition){{( \(invalid\))?}} [type=__private double4] [typekind=Typedef] [canonicaltype=double __private __attribute__((ext_vector_type(4)))] [canonicaltypekind=ExtVector] [isPOD=1]
#pragma OPENCL EXTENSION cl_khr_gl_msaa_sharing : enable
@@ -38,18 +38,18 @@
void kernel OCLImage2dArrayMSAADepthROTest(read_only image2d_array_msaa_depth_t scalarOCLImage2dArrayMSAADepthRO);
void kernel OCLImage3dROTest(read_only image3d_t scalarOCLImage3dRO);
-// CHECK: ParmDecl=scalarOCLImage1dRO:28:50 (Definition) [type=__read_only image1d_t] [typekind=OCLImage1dRO] [isPOD=1]
-// CHECK: ParmDecl=scalarOCLImage1dArrayRO:29:61 (Definition) [type=__read_only image1d_array_t] [typekind=OCLImage1dArrayRO] [isPOD=1]
-// CHECK: ParmDecl=scalarOCLImage1dBufferRO:30:63 (Definition) [type=__read_only image1d_buffer_t] [typekind=OCLImage1dBufferRO] [isPOD=1]
-// CHECK: ParmDecl=scalarOCLImage2dRO:31:50 (Definition) [type=__read_only image2d_t] [typekind=OCLImage2dRO] [isPOD=1]
-// CHECK: ParmDecl=scalarOCLImage2dArrayRO:32:61 (Definition) [type=__read_only image2d_array_t] [typekind=OCLImage2dArrayRO] [isPOD=1]
-// CHECK: ParmDecl=scalarOCLImage2dDepthRO:33:61 (Definition) [type=__read_only image2d_depth_t] [typekind=OCLImage2dDepthRO] [isPOD=1]
-// CHECK: ParmDecl=scalarOCLImage2dArrayDepthRO:34:72 (Definition) [type=__read_only image2d_array_depth_t] [typekind=OCLImage2dArrayDepthRO] [isPOD=1]
-// CHECK: ParmDecl=scalarOCLImage2dMSAARO:35:59 (Definition){{( \(invalid\))?}} [type=__read_only image2d_msaa_t] [typekind=OCLImage2dMSAARO] [isPOD=1]
-// CHECK: ParmDecl=scalarOCLImage2dArrayMSAARO:36:70 (Definition){{( \(invalid\))?}} [type=__read_only image2d_array_msaa_t] [typekind=OCLImage2dArrayMSAARO] [isPOD=1]
-// CHECK: ParmDecl=scalarOCLImage2dMSAADepthRO:37:70 (Definition){{( \(invalid\))?}} [type=__read_only image2d_msaa_depth_t] [typekind=OCLImage2dMSAADepthRO] [isPOD=1]
-// CHECK: ParmDecl=scalarOCLImage2dArrayMSAADepthRO:38:81 (Definition){{( \(invalid\))?}} [type=__read_only image2d_array_msaa_depth_t] [typekind=OCLImage2dArrayMSAADepthRO] [isPOD=1]
-// CHECK: ParmDecl=scalarOCLImage3dRO:39:50 (Definition) [type=__read_only image3d_t] [typekind=OCLImage3dRO] [isPOD=1]
+// CHECK: ParmDecl=scalarOCLImage1dRO:28:50 (Definition) [type=__private __read_only image1d_t] [typekind=OCLImage1dRO] [isPOD=1]
+// CHECK: ParmDecl=scalarOCLImage1dArrayRO:29:61 (Definition) [type=__private __read_only image1d_array_t] [typekind=OCLImage1dArrayRO] [isPOD=1]
+// CHECK: ParmDecl=scalarOCLImage1dBufferRO:30:63 (Definition) [type=__private __read_only image1d_buffer_t] [typekind=OCLImage1dBufferRO] [isPOD=1]
+// CHECK: ParmDecl=scalarOCLImage2dRO:31:50 (Definition) [type=__private __read_only image2d_t] [typekind=OCLImage2dRO] [isPOD=1]
+// CHECK: ParmDecl=scalarOCLImage2dArrayRO:32:61 (Definition) [type=__private __read_only image2d_array_t] [typekind=OCLImage2dArrayRO] [isPOD=1]
+// CHECK: ParmDecl=scalarOCLImage2dDepthRO:33:61 (Definition) [type=__private __read_only image2d_depth_t] [typekind=OCLImage2dDepthRO] [isPOD=1]
+// CHECK: ParmDecl=scalarOCLImage2dArrayDepthRO:34:72 (Definition) [type=__private __read_only image2d_array_depth_t] [typekind=OCLImage2dArrayDepthRO] [isPOD=1]
+// CHECK: ParmDecl=scalarOCLImage2dMSAARO:35:59 (Definition){{( \(invalid\))?}} [type=__private __read_only image2d_msaa_t] [typekind=OCLImage2dMSAARO] [isPOD=1]
+// CHECK: ParmDecl=scalarOCLImage2dArrayMSAARO:36:70 (Definition){{( \(invalid\))?}} [type=__private __read_only image2d_array_msaa_t] [typekind=OCLImage2dArrayMSAARO] [isPOD=1]
+// CHECK: ParmDecl=scalarOCLImage2dMSAADepthRO:37:70 (Definition){{( \(invalid\))?}} [type=__private __read_only image2d_msaa_depth_t] [typekind=OCLImage2dMSAADepthRO] [isPOD=1]
+// CHECK: ParmDecl=scalarOCLImage2dArrayMSAADepthRO:38:81 (Definition){{( \(invalid\))?}} [type=__private __read_only image2d_array_msaa_depth_t] [typekind=OCLImage2dArrayMSAADepthRO] [isPOD=1]
+// CHECK: ParmDecl=scalarOCLImage3dRO:39:50 (Definition) [type=__private __read_only image3d_t] [typekind=OCLImage3dRO] [isPOD=1]
void kernel OCLImage1dWOTest(write_only image1d_t scalarOCLImage1dWO);
void kernel OCLImage1dArrayWOTest(write_only image1d_array_t scalarOCLImage1dArrayWO);
@@ -64,18 +64,18 @@
void kernel OCLImage2dArrayMSAADepthWOTest(write_only image2d_array_msaa_depth_t scalarOCLImage2dArrayMSAADepthWO);
void kernel OCLImage3dWOTest(write_only image3d_t scalarOCLImage3dWO);
-// CHECK: ParmDecl=scalarOCLImage1dWO:54:51 (Definition) [type=__write_only image1d_t] [typekind=OCLImage1dWO] [isPOD=1]
-// CHECK: ParmDecl=scalarOCLImage1dArrayWO:55:62 (Definition) [type=__write_only image1d_array_t] [typekind=OCLImage1dArrayWO] [isPOD=1]
-// CHECK: ParmDecl=scalarOCLImage1dBufferWO:56:64 (Definition) [type=__write_only image1d_buffer_t] [typekind=OCLImage1dBufferWO] [isPOD=1]
-// CHECK: ParmDecl=scalarOCLImage2dWO:57:51 (Definition) [type=__write_only image2d_t] [typekind=OCLImage2dWO] [isPOD=1]
-// CHECK: ParmDecl=scalarOCLImage2dArrayWO:58:62 (Definition) [type=__write_only image2d_array_t] [typekind=OCLImage2dArrayWO] [isPOD=1]
-// CHECK: ParmDecl=scalarOCLImage2dDepthWO:59:62 (Definition) [type=__write_only image2d_depth_t] [typekind=OCLImage2dDepthWO] [isPOD=1]
-// CHECK: ParmDecl=scalarOCLImage2dArrayDepthWO:60:73 (Definition) [type=__write_only image2d_array_depth_t] [typekind=OCLImage2dArrayDepthWO] [isPOD=1]
-// CHECK: ParmDecl=scalarOCLImage2dMSAAWO:61:60 (Definition){{( \(invalid\))?}} [type=__write_only image2d_msaa_t] [typekind=OCLImage2dMSAAWO] [isPOD=1]
-// CHECK: ParmDecl=scalarOCLImage2dArrayMSAAWO:62:71 (Definition){{( \(invalid\))?}} [type=__write_only image2d_array_msaa_t] [typekind=OCLImage2dArrayMSAAWO] [isPOD=1]
-// CHECK: ParmDecl=scalarOCLImage2dMSAADepthWO:63:71 (Definition){{( \(invalid\))?}} [type=__write_only image2d_msaa_depth_t] [typekind=OCLImage2dMSAADepthWO] [isPOD=1]
-// CHECK: ParmDecl=scalarOCLImage2dArrayMSAADepthWO:64:82 (Definition){{( \(invalid\))?}} [type=__write_only image2d_array_msaa_depth_t] [typekind=OCLImage2dArrayMSAADepthWO] [isPOD=1]
-// CHECK: ParmDecl=scalarOCLImage3dWO:65:51 (Definition){{( \(invalid\))?}} [type=__write_only image3d_t] [typekind=OCLImage3dWO] [isPOD=1]
+// CHECK: ParmDecl=scalarOCLImage1dWO:54:51 (Definition) [type=__private __write_only image1d_t] [typekind=OCLImage1dWO] [isPOD=1]
+// CHECK: ParmDecl=scalarOCLImage1dArrayWO:55:62 (Definition) [type=__private __write_only image1d_array_t] [typekind=OCLImage1dArrayWO] [isPOD=1]
+// CHECK: ParmDecl=scalarOCLImage1dBufferWO:56:64 (Definition) [type=__private __write_only image1d_buffer_t] [typekind=OCLImage1dBufferWO] [isPOD=1]
+// CHECK: ParmDecl=scalarOCLImage2dWO:57:51 (Definition) [type=__private __write_only image2d_t] [typekind=OCLImage2dWO] [isPOD=1]
+// CHECK: ParmDecl=scalarOCLImage2dArrayWO:58:62 (Definition) [type=__private __write_only image2d_array_t] [typekind=OCLImage2dArrayWO] [isPOD=1]
+// CHECK: ParmDecl=scalarOCLImage2dDepthWO:59:62 (Definition) [type=__private __write_only image2d_depth_t] [typekind=OCLImage2dDepthWO] [isPOD=1]
+// CHECK: ParmDecl=scalarOCLImage2dArrayDepthWO:60:73 (Definition) [type=__private __write_only image2d_array_depth_t] [typekind=OCLImage2dArrayDepthWO] [isPOD=1]
+// CHECK: ParmDecl=scalarOCLImage2dMSAAWO:61:60 (Definition){{( \(invalid\))?}} [type=__private __write_only image2d_msaa_t] [typekind=OCLImage2dMSAAWO] [isPOD=1]
+// CHECK: ParmDecl=scalarOCLImage2dArrayMSAAWO:62:71 (Definition){{( \(invalid\))?}} [type=__private __write_only image2d_array_msaa_t] [typekind=OCLImage2dArrayMSAAWO] [isPOD=1]
+// CHECK: ParmDecl=scalarOCLImage2dMSAADepthWO:63:71 (Definition){{( \(invalid\))?}} [type=__private __write_only image2d_msaa_depth_t] [typekind=OCLImage2dMSAADepthWO] [isPOD=1]
+// CHECK: ParmDecl=scalarOCLImage2dArrayMSAADepthWO:64:82 (Definition){{( \(invalid\))?}} [type=__private __write_only image2d_array_msaa_depth_t] [typekind=OCLImage2dArrayMSAADepthWO] [isPOD=1]
+// CHECK: ParmDecl=scalarOCLImage3dWO:65:51 (Definition){{( \(invalid\))?}} [type=__private __write_only image3d_t] [typekind=OCLImage3dWO] [isPOD=1]
void kernel OCLImage1dRWTest(read_write image1d_t scalarOCLImage1dRW);
void kernel OCLImage1dArrayRWTest(read_write image1d_array_t scalarOCLImage1dArrayRW);
@@ -90,24 +90,24 @@
void kernel OCLImage2dArrayMSAADepthRWTest(read_write image2d_array_msaa_depth_t scalarOCLImage2dArrayMSAADepthRW);
void kernel OCLImage3dRWTest(read_write image3d_t scalarOCLImage3dRW);
-// CHECK: ParmDecl=scalarOCLImage1dRW:80:51 (Definition) [type=__read_write image1d_t] [typekind=OCLImage1dRW] [isPOD=1]
-// CHECK: ParmDecl=scalarOCLImage1dArrayRW:81:62 (Definition) [type=__read_write image1d_array_t] [typekind=OCLImage1dArrayRW] [isPOD=1]
-// CHECK: ParmDecl=scalarOCLImage1dBufferRW:82:64 (Definition) [type=__read_write image1d_buffer_t] [typekind=OCLImage1dBufferRW] [isPOD=1]
-// CHECK: ParmDecl=scalarOCLImage2dRW:83:51 (Definition) [type=__read_write image2d_t] [typekind=OCLImage2dRW] [isPOD=1]
-// CHECK: ParmDecl=scalarOCLImage2dArrayRW:84:62 (Definition) [type=__read_write image2d_array_t] [typekind=OCLImage2dArrayRW] [isPOD=1]
-// CHECK: ParmDecl=scalarOCLImage2dDepthRW:85:62 (Definition) [type=__read_write image2d_depth_t] [typekind=OCLImage2dDepthRW] [isPOD=1]
-// CHECK: ParmDecl=scalarOCLImage2dArrayDepthRW:86:73 (Definition) [type=__read_write image2d_array_depth_t] [typekind=OCLImage2dArrayDepthRW] [isPOD=1]
-// CHECK: ParmDecl=scalarOCLImage2dMSAARW:87:60 (Definition){{( \(invalid\))?}} [type=__read_write image2d_msaa_t] [typekind=OCLImage2dMSAARW] [isPOD=1]
-// CHECK: ParmDecl=scalarOCLImage2dArrayMSAARW:88:71 (Definition){{( \(invalid\))?}} [type=__read_write image2d_array_msaa_t] [typekind=OCLImage2dArrayMSAARW] [isPOD=1]
-// CHECK: ParmDecl=scalarOCLImage2dMSAADepthRW:89:71 (Definition){{( \(invalid\))?}} [type=__read_write image2d_msaa_depth_t] [typekind=OCLImage2dMSAADepthRW] [isPOD=1]
-// CHECK: ParmDecl=scalarOCLImage2dArrayMSAADepthRW:90:82 (Definition){{( \(invalid\))?}} [type=__read_write image2d_array_msaa_depth_t] [typekind=OCLImage2dArrayMSAADepthRW] [isPOD=1]
-// CHECK: ParmDecl=scalarOCLImage3dRW:91:51 (Definition) [type=__read_write image3d_t] [typekind=OCLImage3dRW] [isPOD=1]
+// CHECK: ParmDecl=scalarOCLImage1dRW:80:51 (Definition) [type=__private __read_write image1d_t] [typekind=OCLImage1dRW] [isPOD=1]
+// CHECK: ParmDecl=scalarOCLImage1dArrayRW:81:62 (Definition) [type=__private __read_write image1d_array_t] [typekind=OCLImage1dArrayRW] [isPOD=1]
+// CHECK: ParmDecl=scalarOCLImage1dBufferRW:82:64 (Definition) [type=__private __read_write image1d_buffer_t] [typekind=OCLImage1dBufferRW] [isPOD=1]
+// CHECK: ParmDecl=scalarOCLImage2dRW:83:51 (Definition) [type=__private __read_write image2d_t] [typekind=OCLImage2dRW] [isPOD=1]
+// CHECK: ParmDecl=scalarOCLImage2dArrayRW:84:62 (Definition) [type=__private __read_write image2d_array_t] [typekind=OCLImage2dArrayRW] [isPOD=1]
+// CHECK: ParmDecl=scalarOCLImage2dDepthRW:85:62 (Definition) [type=__private __read_write image2d_depth_t] [typekind=OCLImage2dDepthRW] [isPOD=1]
+// CHECK: ParmDecl=scalarOCLImage2dArrayDepthRW:86:73 (Definition) [type=__private __read_write image2d_array_depth_t] [typekind=OCLImage2dArrayDepthRW] [isPOD=1]
+// CHECK: ParmDecl=scalarOCLImage2dMSAARW:87:60 (Definition){{( \(invalid\))?}} [type=__private __read_write image2d_msaa_t] [typekind=OCLImage2dMSAARW] [isPOD=1]
+// CHECK: ParmDecl=scalarOCLImage2dArrayMSAARW:88:71 (Definition){{( \(invalid\))?}} [type=__private __read_write image2d_array_msaa_t] [typekind=OCLImage2dArrayMSAARW] [isPOD=1]
+// CHECK: ParmDecl=scalarOCLImage2dMSAADepthRW:89:71 (Definition){{( \(invalid\))?}} [type=__private __read_write image2d_msaa_depth_t] [typekind=OCLImage2dMSAADepthRW] [isPOD=1]
+// CHECK: ParmDecl=scalarOCLImage2dArrayMSAADepthRW:90:82 (Definition){{( \(invalid\))?}} [type=__private __read_write image2d_array_msaa_depth_t] [typekind=OCLImage2dArrayMSAADepthRW] [isPOD=1]
+// CHECK: ParmDecl=scalarOCLImage3dRW:91:51 (Definition) [type=__private __read_write image3d_t] [typekind=OCLImage3dRW] [isPOD=1]
void kernel intPipeTestRO(read_only pipe int scalarPipe);
void kernel intPipeTestWO(write_only pipe int scalarPipe);
-// CHECK: ParmDecl=scalarPipe:106:46 (Definition) [type=read_only pipe int] [typekind=Pipe] [isPOD=0]
-// CHECK: ParmDecl=scalarPipe:107:47 (Definition) [type=write_only pipe int] [typekind=Pipe] [isPOD=0]
+// CHECK: ParmDecl=scalarPipe:106:46 (Definition) [type=__private read_only pipe int] [typekind=Pipe] [isPOD=0]
+// CHECK: ParmDecl=scalarPipe:107:47 (Definition) [type=__private write_only pipe int] [typekind=Pipe] [isPOD=0]
#define CLK_ADDRESS_CLAMP_TO_EDGE 2
#define CLK_NORMALIZED_COORDS_TRUE 1
@@ -121,9 +121,9 @@
}
// CHECK: VarDecl=scalarOCLSampler:117:19 (Definition) [type=const sampler_t] [typekind=Typedef] const [canonicaltype=const sampler_t] [canonicaltypekind=OCLSampler] [isPOD=1]
-// CHECK: VarDecl=scalarOCLEvent:118:15 (Definition) [type=clk_event_t] [typekind=Typedef] [canonicaltype=clk_event_t] [canonicaltypekind=Unexposed] [isPOD=1]
-// CHECK: VarDecl=scalarOCLQueue:119:11 (Definition) [type=queue_t] [typekind=Typedef] [canonicaltype=queue_t] [canonicaltypekind=OCLQueue] [isPOD=1]
-// CHECK: VarDecl=scalarOCLReserveID:120:16 (Definition) [type=reserve_id_t] [typekind=Typedef] [canonicaltype=reserve_id_t] [canonicaltypekind=OCLReserveID] [isPOD=1]
+// CHECK: VarDecl=scalarOCLEvent:118:15 (Definition) [type=__private clk_event_t] [typekind=Typedef] [canonicaltype=__private clk_event_t] [canonicaltypekind=Unexposed] [isPOD=1]
+// CHECK: VarDecl=scalarOCLQueue:119:11 (Definition) [type=__private queue_t] [typekind=Typedef] [canonicaltype=__private queue_t] [canonicaltypekind=OCLQueue] [isPOD=1]
+// CHECK: VarDecl=scalarOCLReserveID:120:16 (Definition) [type=__private reserve_id_t] [typekind=Typedef] [canonicaltype=__private reserve_id_t] [canonicaltypekind=OCLReserveID] [isPOD=1]
#pragma OPENCL EXTENSION cl_intel_device_side_avc_motion_estimation : enable
@@ -131,4 +131,4 @@
intel_sub_group_avc_mce_payload_t mce_payload;
}
-// CHECK: VarDecl=mce_payload:131:37 (Definition){{( \(invalid\))?}} [type=intel_sub_group_avc_mce_payload_t] [typekind=Typedef] [canonicaltype=intel_sub_group_avc_mce_payload_t] [canonicaltypekind=OCLIntelSubgroupAVCMcePayload] [isPOD=1]
+// CHECK: VarDecl=mce_payload:131:37 (Definition){{( \(invalid\))?}} [type=__private intel_sub_group_avc_mce_payload_t] [typekind=Typedef] [canonicaltype=__private intel_sub_group_avc_mce_payload_t] [canonicaltypekind=OCLIntelSubgroupAVCMcePayload] [isPOD=1]
diff --git a/src/llvm-project/clang/test/Index/pragma-diag-reparse.c b/src/llvm-project/clang/test/Index/pragma-diag-reparse.c
index 71d0618..aa1413c 100644
--- a/src/llvm-project/clang/test/Index/pragma-diag-reparse.c
+++ b/src/llvm-project/clang/test/Index/pragma-diag-reparse.c
@@ -11,6 +11,7 @@
return x;
}
+#pragma clang diagnostic ignored "-Wmisleading-indentation"
void foo() { int b=0; while (b==b); }
// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_FAILONERROR=1 c-index-test -test-load-source-reparse 5 local \
diff --git a/src/llvm-project/clang/test/Index/print-display-names.cpp b/src/llvm-project/clang/test/Index/print-display-names.cpp
index 958948d..ff221e1 100644
--- a/src/llvm-project/clang/test/Index/print-display-names.cpp
+++ b/src/llvm-project/clang/test/Index/print-display-names.cpp
@@ -22,7 +22,7 @@
// RUN: env CINDEXTEST_PRINTINGPOLICY_TERSEOUTPUT=1 c-index-test -test-load-source all-pretty %s | FileCheck %s --check-prefix=PRETTY
// PRETTY: print-display-names.cpp:2:7: ClassTemplate=template <typename T, typename> class ClassTmpl {}:2:7 (Definition) Extent=[1:1 - 2:20]
// PRETTY: print-display-names.cpp:4:13: TypedefDecl=typedef int Integer:4:13 (Definition) Extent=[4:1 - 4:20]
-// PRETTY: print-display-names.cpp:6:16: ClassDecl=template<> class ClassTmpl<int, int> {}:6:16 (Definition) [Specialization of ClassTmpl:2:7] Extent=[6:1 - 6:43]
+// PRETTY: print-display-names.cpp:6:16: ClassDecl=template<> class ClassTmpl<Integer, Integer> {}:6:16 (Definition) [Specialization of ClassTmpl:2:7] Extent=[6:1 - 6:43]
// PRETTY: print-display-names.cpp:8:6: FunctionDecl=void f(ClassTmpl<float, Integer> p):8:6 Extent=[8:1 - 8:36]
// PRETTY: print-display-names.cpp:8:34: ParmDecl=ClassTmpl<float, Integer> p:8:34 (Definition) Extent=[8:8 - 8:35]
// PRETTY: print-display-names.cpp:11:6: FunctionTemplate=template <typename T> void g(ClassTmpl<T, T>):11:6 Extent=[10:1 - 11:24]
diff --git a/src/llvm-project/clang/test/Index/print-type.cpp b/src/llvm-project/clang/test/Index/print-type.cpp
index 32d1185..abe8d45 100644
--- a/src/llvm-project/clang/test/Index/print-type.cpp
+++ b/src/llvm-project/clang/test/Index/print-type.cpp
@@ -196,7 +196,7 @@
// CHECK: TemplateRef=Specialization:66:8 [type=] [typekind=Invalid] [isPOD=0]
// CHECK: CallExpr=Specialization:66:8 [type=Specialization<Specialization<bool> &>] [typekind=Unexposed] [templateargs/1= [type=Specialization<bool> &] [typekind=LValueReference]] [canonicaltype=Specialization<Specialization<bool> &>] [canonicaltypekind=Record] [canonicaltemplateargs/1= [type=Specialization<bool> &] [typekind=LValueReference]] [isPOD=1]
// CHECK: VarDecl=autoTemplRefParam:72:6 (Definition) [type=Specialization<Specialization<bool> &>] [typekind=Auto] [templateargs/1= [type=Specialization<bool> &] [typekind=LValueReference]] [canonicaltype=Specialization<Specialization<bool> &>] [canonicaltypekind=Record] [canonicaltemplateargs/1= [type=Specialization<bool> &] [typekind=LValueReference]] [isPOD=1]
-// CHECK: UnexposedExpr=templRefParam:71:40 [type=const Specialization<Specialization<bool> &>] [typekind=Unexposed] const [templateargs/1= [type=Specialization<bool> &] [typekind=LValueReference]] [canonicaltype=const Specialization<Specialization<bool> &>] [canonicaltypekind=Record] [canonicaltemplateargs/1= [type=Specialization<bool> &] [typekind=LValueReference]] [isPOD=1]
+// CHECK: UnexposedExpr=templRefParam:71:40 [type=const Specialization<Specialization<bool> &>] [typekind=Record] const [templateargs/1= [type=Specialization<bool> &] [typekind=LValueReference]] [isPOD=1]
// CHECK: DeclRefExpr=templRefParam:71:40 [type=Specialization<Specialization<bool> &>] [typekind=Unexposed] [templateargs/1= [type=Specialization<bool> &] [typekind=LValueReference]] [canonicaltype=Specialization<Specialization<bool> &>] [canonicaltypekind=Record] [canonicaltemplateargs/1= [type=Specialization<bool> &] [typekind=LValueReference]] [isPOD=1]
// CHECK: TypeAliasDecl=baz:76:7 (Definition) [type=baz] [typekind=Typedef] [templateargs/1= [type=A<void>] [typekind=Unexposed]] [canonicaltype=A<void>] [canonicaltypekind=Record] [canonicaltemplateargs/1= [type=void] [typekind=Void]] [isPOD=0]
// CHECK: VarDecl=autoTemplPointer:78:6 (Definition) [type=Specialization<Specialization<bool> &> *] [typekind=Auto] [canonicaltype=Specialization<Specialization<bool> &> *] [canonicaltypekind=Pointer] [isPOD=1] [pointeetype=Specialization<Specialization<bool> &>] [pointeekind=Record]
diff --git a/src/llvm-project/clang/test/Index/retain-excluded-conditional-blocks.m b/src/llvm-project/clang/test/Index/retain-excluded-conditional-blocks.m
new file mode 100644
index 0000000..ebfc7c5
--- /dev/null
+++ b/src/llvm-project/clang/test/Index/retain-excluded-conditional-blocks.m
@@ -0,0 +1,132 @@
+// RUN: c-index-test -retain-excluded-conditional-blocks %s | FileCheck %s
+
+#include <stdint.h>
+
+// CHECK: TypedefDecl=intptr_t
+
+// CHECK: [[@LINE+1]]:12: ObjCInterfaceDecl=MyCls
+@interface MyCls
+// CHECK: [[@LINE+1]]:8: ObjCInstanceMethodDecl=some_meth
+-(void)some_meth;
+@end
+
+#if 1
+// CHECK: [[@LINE+1]]:12: ObjCInterfaceDecl=Test1
+@interface Test1 @end
+#else
+// CHECK: [[@LINE+1]]:12:
+@interface Test2 @end
+#endif
+
+#if 0
+// CHECK: [[@LINE+1]]:12:
+@interface Test3 @end
+#else
+// CHECK: [[@LINE+1]]:12: ObjCInterfaceDecl=Test4
+@interface Test4 @end
+#endif
+
+#if SOMETHING_NOT_DEFINED
+// CHECK: [[@LINE+1]]:12: ObjCInterfaceDecl=Test5
+@interface Test5 @end
+#else
+// CHECK: [[@LINE+1]]:12: ObjCInterfaceDecl=Test6
+@interface Test6 @end
+#endif
+
+#define SOMETHING_DEFINED 1
+#if SOMETHING_DEFINED
+// CHECK: [[@LINE+1]]:12: ObjCInterfaceDecl=Test7
+@interface Test7 @end
+#else
+// CHECK: [[@LINE+1]]:12:
+@interface Test8 @end
+#endif
+
+#if defined(SOMETHING_NOT_DEFINED)
+// CHECK: [[@LINE+1]]:12: ObjCInterfaceDecl=Test9
+@interface Test9 @end
+#else
+// CHECK: [[@LINE+1]]:12: ObjCInterfaceDecl=Test10
+@interface Test10 @end
+#endif
+
+#if defined(SOMETHING_DEFINED)
+// CHECK: [[@LINE+1]]:12: ObjCInterfaceDecl=Test11
+@interface Test11 @end
+#else
+// CHECK: [[@LINE+1]]:12:
+@interface Test12 @end
+#endif
+
+#if SOMETHING_NOT_DEFINED1
+// CHECK: [[@LINE+1]]:12: ObjCInterfaceDecl=Test13
+@interface Test13 @end
+#elif SOMETHING_NOT_DEFINED2
+// CHECK: [[@LINE+1]]:12: ObjCInterfaceDecl=Test14
+@interface Test14 @end
+#else
+// CHECK: [[@LINE+1]]:12: ObjCInterfaceDecl=Test15
+@interface Test15 @end
+#endif
+
+#ifdef SOMETHING_NOT_DEFINED
+// CHECK: [[@LINE+1]]:12: ObjCInterfaceDecl=Test19
+@interface Test19 @end
+#else
+// CHECK: [[@LINE+1]]:12: ObjCInterfaceDecl=Test20
+@interface Test20 @end
+#endif
+
+#ifdef SOMETHING_DEFINED
+// CHECK: [[@LINE+1]]:12: ObjCInterfaceDecl=Test21
+@interface Test21 @end
+#else
+// CHECK: [[@LINE+1]]:12:
+@interface Test22 @end
+#endif
+
+#ifndef SOMETHING_NOT_DEFINED
+// CHECK: [[@LINE+1]]:12: ObjCInterfaceDecl=Test23
+@interface Test23 @end
+#else
+// CHECK: [[@LINE+1]]:12: ObjCInterfaceDecl=Test24
+@interface Test24 @end
+#endif
+
+#ifndef SOMETHING_DEFINED
+// CHECK: [[@LINE+1]]:12:
+@interface Test25 @end
+#else
+// CHECK: [[@LINE+1]]:12: ObjCInterfaceDecl=Test26
+@interface Test26 @end
+#endif
+
+#if 1 < SOMETHING_NOT_DEFINED
+// CHECK: [[@LINE+1]]:12: ObjCInterfaceDecl=Test27
+@interface Test27 @end
+#else
+// CHECK: [[@LINE+1]]:12: ObjCInterfaceDecl=Test28
+@interface Test28 @end
+#endif
+
+#if SOMETHING_NOT_DEFINED
+// CHECK: [[@LINE+1]]:12: ObjCInterfaceDecl=Test29
+@interface Test29 @end
+#endif
+
+#ifdef SOMETHING_NOT_DEFINED
+// CHECK: [[@LINE+1]]:12: ObjCInterfaceDecl=Test30
+@interface Test30 @end
+#endif
+
+#ifdef SOMETHING_DEFINED
+// CHECK: [[@LINE+1]]:12: ObjCInterfaceDecl=Test31
+@interface Test31 @end
+#elif !defined(SOMETHING_NOT_DEFINED)
+// CHECK: [[@LINE+1]]:12: ObjCInterfaceDecl=Test32
+@interface Test32 @end
+#else
+// CHECK: [[@LINE+1]]:12: ObjCInterfaceDecl=Test33
+@interface Test33 @end
+#endif
diff --git a/src/llvm-project/clang/test/Index/skip-parsed-bodies/compile_commands.json b/src/llvm-project/clang/test/Index/skip-parsed-bodies/compile_commands.json
index 62303cb..21021a9 100644
--- a/src/llvm-project/clang/test/Index/skip-parsed-bodies/compile_commands.json
+++ b/src/llvm-project/clang/test/Index/skip-parsed-bodies/compile_commands.json
@@ -12,7 +12,7 @@
{
"directory": ".",
"command": "/usr/bin/clang++ -fsyntax-only -fno-ms-compatibility -fno-delayed-template-parsing t3.cpp -DBLAH",
- "file": "t2.cpp"
+ "file": "t3.cpp"
}
]
diff --git a/src/llvm-project/clang/test/Index/warning-flags.c b/src/llvm-project/clang/test/Index/warning-flags.c
index af789c0..2d9a1d9 100644
--- a/src/llvm-project/clang/test/Index/warning-flags.c
+++ b/src/llvm-project/clang/test/Index/warning-flags.c
@@ -9,10 +9,10 @@
// RUN: c-index-test -test-load-source-reparse 5 all -w %s 2>&1 | FileCheck -check-prefix=NOWARNINGS %s
// RUN: c-index-test -test-load-source all -w -O4 %s 2>&1 | FileCheck -check-prefix=NOWARNINGS %s
-// CHECK-BOTH-WARNINGS: warning: control reaches end of non-void function
+// CHECK-BOTH-WARNINGS: warning: non-void function does not return a value
// CHECK-BOTH-WARNINGS: warning: incompatible pointer types returning 'float *' from a function with result type 'int *'
-// CHECK-SECOND-WARNING-NOT:control reaches end of non-void
+// CHECK-SECOND-WARNING-NOT:non-void function does not return a value
// CHECK-SECOND-WARNING: warning: incompatible pointer types returning 'float *' from a function with result type 'int *'
// NOWARNINGS-NOT: warning:
diff --git a/src/llvm-project/clang/test/InterfaceStubs/XlinkerInputArgs.cpp b/src/llvm-project/clang/test/InterfaceStubs/XlinkerInputArgs.cpp
new file mode 100644
index 0000000..cb4ef8a
--- /dev/null
+++ b/src/llvm-project/clang/test/InterfaceStubs/XlinkerInputArgs.cpp
@@ -0,0 +1,3 @@
+// RUN: %clang -### -Xlinker -Bsymbolic -emit-interface-stubs 2>&1 | FileCheck %s
+// CHECK: Bsymbolic
+// CHECK-NOT: Bsymbolic
diff --git a/src/llvm-project/clang/test/InterfaceStubs/bad-format.cpp b/src/llvm-project/clang/test/InterfaceStubs/bad-format.cpp
index 463f39a..4d51ac8 100644
--- a/src/llvm-project/clang/test/InterfaceStubs/bad-format.cpp
+++ b/src/llvm-project/clang/test/InterfaceStubs/bad-format.cpp
@@ -1,8 +1,36 @@
-// REQUIRES: x86-registered-target
-// RUN: not %clang -target x86_64-linux-gnu -o - -emit-interface-stubs \
-// RUN: -interface-stub-version=bar-format %s 2>&1 | FileCheck %s
+// RUN: not %clang -emit-interface-stubs -interface-stub-version=bad-format %s 2>&1 | \
+// RUN: FileCheck %s
+
+// RUN: not %clang -emit-interface-stubs -interface-stub-version=experimental-tapi-elf-v1 %s 2>&1 | \
+// RUN: FileCheck -check-prefix=CHECK-TAPI-DEPRECATED %s
+
+// RUN: not %clang -emit-interface-stubs -interface-stub-version=experimental-yaml-elf-v1 %s 2>&1 | \
+// RUN: FileCheck -check-prefix=CHECK-YAML-DEPRECATED %s
+
+// RUN: not %clang -emit-interface-stubs -interface-stub-version=bad-format %s 2>&1 | \
+// RUN: FileCheck %s
+
+// RUN: not %clang -emit-interface-stubs \
+// RUN: -interface-stub-version=experimental-tapi-elf-v1 %s 2>&1 | \
+// RUN: FileCheck -check-prefix=CHECK-TAPI-DEPRECATED %s
+
+// RUN: not %clang -emit-interface-stubs \
+// RUN: -interface-stub-version=experimental-yaml-elf-v1 %s 2>&1 | \
+// RUN: FileCheck -check-prefix=CHECK-YAML-DEPRECATED %s
// CHECK: error: invalid value
-// CHECK: '-interface-stub-version=<experimental-tapi-elf-v1 |
-// CHECK: experimental-yaml-elf-v1>' in 'Must specify a valid interface
-// CHECK: stub format type using
+// CHECK: 'Invalid interface stub format: bad-format.' in 'Must specify a
+// CHECK: valid interface stub format type, ie:
+// CHECK: -interface-stub-version=experimental-ifs-v1'
+
+// CHECK-TAPI-DEPRECATED: error: invalid value
+// CHECK-TAPI-DEPRECATED: 'Invalid interface stub format:
+// CHECK-TAPI-DEPRECATED: experimental-tapi-elf-v1 is deprecated.' in 'Must
+// CHECK-TAPI-DEPRECATED: specify a valid interface stub format type, ie:
+// CHECK-TAPI-DEPRECATED: -interface-stub-version=experimental-ifs-v1'
+
+// CHECK-YAML-DEPRECATED: error: invalid value
+// CHECK-YAML-DEPRECATED: 'Invalid interface stub format:
+// CHECK-YAML-DEPRECATED: experimental-yaml-elf-v1 is deprecated.' in 'Must
+// CHECK-YAML-DEPRECATED: specify a valid interface stub format type, ie:
+// CHECK-YAML-DEPRECATED: -interface-stub-version=experimental-ifs-v1'
diff --git a/src/llvm-project/clang/test/InterfaceStubs/blocks.c b/src/llvm-project/clang/test/InterfaceStubs/blocks.c
new file mode 100644
index 0000000..927f2bf
--- /dev/null
+++ b/src/llvm-project/clang/test/InterfaceStubs/blocks.c
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -emit-interface-stubs -fblocks -o - %s | FileCheck %s
+
+// CHECK: --- !experimental-ifs-v1
+// CHECK-NEXT: IfsVersion: 1.0
+// CHECK-NEXT: Triple:
+// CHECK-NEXT: ObjectFileFormat: ELF
+// CHECK-NEXT: Symbols:
+// CHECK-NEXT: ...
+static void (^f)(void*) = ^(void* data) { int i; };
diff --git a/src/llvm-project/clang/test/InterfaceStubs/class-template-partial-specialization.cpp b/src/llvm-project/clang/test/InterfaceStubs/class-template-partial-specialization.cpp
new file mode 100644
index 0000000..4c0edaa
--- /dev/null
+++ b/src/llvm-project/clang/test/InterfaceStubs/class-template-partial-specialization.cpp
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -o - -emit-interface-stubs %s | FileCheck %s
+
+// CHECK: --- !experimental-ifs-v1
+// CHECK-NEXT: IfsVersion: 1.0
+// CHECK-NEXT: Triple:
+// CHECK-NEXT: ObjectFileFormat: ELF
+// CHECK-NEXT: Symbols:
+// CHECK-NEXT: ...
+
+template<typename> struct S7 { };
+template<typename T> struct S7<T&> { };
diff --git a/src/llvm-project/clang/test/InterfaceStubs/class-template-specialization.cpp b/src/llvm-project/clang/test/InterfaceStubs/class-template-specialization.cpp
index 53baa34..3457654 100644
--- a/src/llvm-project/clang/test/InterfaceStubs/class-template-specialization.cpp
+++ b/src/llvm-project/clang/test/InterfaceStubs/class-template-specialization.cpp
@@ -1,13 +1,11 @@
// REQUIRES: x86-registered-target
-// RUN: %clang -target x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
-// RUN: -interface-stub-version=experimental-tapi-elf-v1 %s | \
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -o - -emit-interface-stubs %s | \
// RUN: FileCheck -check-prefix=CHECK-TAPI %s
-// RUN: %clang -target x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
-// RUN: -interface-stub-version=experimental-tapi-elf-v1 %s | \
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -o - -emit-interface-stubs %s | \
// RUN: FileCheck -check-prefix=CHECK-TAPI2 %s
-// RUN: %clang -target x86_64-unknown-linux-gnu -o - -c %s | \
-// RUN: llvm-readelf -s - 2>&1 | \
+
+// RUN: %clang -target x86_64-unknown-linux-gnu -c -o - %s | llvm-readelf -s - 2>&1 | \
// RUN: FileCheck -check-prefix=CHECK-SYMBOLS %s
// For the following:
diff --git a/src/llvm-project/clang/test/InterfaceStubs/conflict-type.ifs b/src/llvm-project/clang/test/InterfaceStubs/conflict-type.ifs
new file mode 100644
index 0000000..aaa0477
--- /dev/null
+++ b/src/llvm-project/clang/test/InterfaceStubs/conflict-type.ifs
@@ -0,0 +1,16 @@
+# RUN: not %clang -emit-merged-ifs -emit-interface-stubs -o - %s %S/func.ifs 2>&1 | \
+# RUN: FileCheck %s --check-prefixes=CHECK-IFS
+
+# Here we are testing to see if two symbols with identical names will fail to
+# merge in conflict due to mismatched types.
+# CHECK-IFS: error: Interface Stub: Type Mismatch for a.
+# CHECK-IFS-NEXT: Filename:
+# CHECK-IFS-NEXT: Type Values: Object Func
+
+--- !experimental-ifs-v1
+IfsVersion: 1.0
+Triple: x86_64-linux-gnu
+ObjectFileFormat: ELF
+Symbols:
+ a: { Type: Object, Size: 1 }
+...
diff --git a/src/llvm-project/clang/test/InterfaceStubs/constructor-using-shadow.cpp b/src/llvm-project/clang/test/InterfaceStubs/constructor-using-shadow.cpp
new file mode 100644
index 0000000..d4b85ac
--- /dev/null
+++ b/src/llvm-project/clang/test/InterfaceStubs/constructor-using-shadow.cpp
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -o - -emit-interface-stubs %s | FileCheck %s
+
+// CHECK: --- !experimental-ifs-v1
+// CHECK-NEXT: IfsVersion: 1.0
+// CHECK-NEXT: Triple:
+// CHECK-NEXT: ObjectFileFormat: ELF
+// CHECK-NEXT: Symbols:
+// CHECK-NEXT: ...
+
+ // ConstructorUsingShadowDecl
+struct Base { Base(int); };
+struct Derived : public Base { using Base::Base; };
diff --git a/src/llvm-project/clang/test/InterfaceStubs/cxx-conversion.cpp b/src/llvm-project/clang/test/InterfaceStubs/cxx-conversion.cpp
new file mode 100644
index 0000000..96425a4
--- /dev/null
+++ b/src/llvm-project/clang/test/InterfaceStubs/cxx-conversion.cpp
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 -o - -emit-interface-stubs %s | FileCheck %s
+
+// CHECK: --- !experimental-ifs-v1
+// CHECK-NEXT: IfsVersion: 1.0
+// CHECK-NEXT: Triple:
+// CHECK-NEXT: ObjectFileFormat: ELF
+// CHECK-NEXT: Symbols:
+// CHECK-NEXT: ...
+
+template<typename T> class C1 {
+ long a;
+ operator long() const { return a; }
+};
diff --git a/src/llvm-project/clang/test/InterfaceStubs/cxxdeduction-guide.cpp b/src/llvm-project/clang/test/InterfaceStubs/cxxdeduction-guide.cpp
new file mode 100644
index 0000000..f09b9d9
--- /dev/null
+++ b/src/llvm-project/clang/test/InterfaceStubs/cxxdeduction-guide.cpp
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -o - -emit-interface-stubs -std=c++17 %s | FileCheck %s
+
+// CHECK: --- !experimental-ifs-v1
+// CHECK-NEXT: IfsVersion: 1.0
+// CHECK-NEXT: Triple:
+// CHECK-NEXT: ObjectFileFormat: ELF
+// CHECK-NEXT: Symbols:
+// CHECK-NEXT: ...
+
+// CXXDeductionGuideDecl
+template<typename T> struct A { A(); A(T); };
+A() -> A<int>;
diff --git a/src/llvm-project/clang/test/InterfaceStubs/driver-test.c b/src/llvm-project/clang/test/InterfaceStubs/driver-test.c
new file mode 100644
index 0000000..894d896
--- /dev/null
+++ b/src/llvm-project/clang/test/InterfaceStubs/driver-test.c
@@ -0,0 +1,22 @@
+// REQUIRES: x86-registered-target
+// REQUIRES: shell
+
+// NOTE: -fno-integrated-cc1 has been added to work around an ASAN failure
+// caused by in-process cc1 invocation. Clang InterfaceStubs is not the
+// culprit, but Clang Interface Stubs' Driver pipeline setup uncovers an
+// existing ASAN issue when invoking multiple normal cc1 jobs along with
+// multiple Clang Interface Stubs cc1 jobs together.
+// There is currently a discussion of this going on at:
+// https://reviews.llvm.org/D69825
+// RUN: mkdir -p %t; cd %t
+// RUN: %clang -target x86_64-unknown-linux-gnu -x c -S \
+// RUN: -fno-integrated-cc1 \
+// RUN: -emit-interface-stubs %s %S/object.c %S/weak.cpp && \
+// RUN: llvm-nm %t/a.out.ifso 2>&1 | FileCheck --check-prefix=CHECK-IFS %s
+
+// CHECK-IFS-DAG: data
+// CHECK-IFS-DAG: foo
+// CHECK-IFS-DAG: strongFunc
+// CHECK-IFS-DAG: weakFunc
+
+int foo(int bar) { return 42 + 1844; }
diff --git a/src/llvm-project/clang/test/InterfaceStubs/driver-test2.c b/src/llvm-project/clang/test/InterfaceStubs/driver-test2.c
new file mode 100644
index 0000000..905b279
--- /dev/null
+++ b/src/llvm-project/clang/test/InterfaceStubs/driver-test2.c
@@ -0,0 +1,25 @@
+// REQUIRES: x86-registered-target
+// REQUIRES: shell
+
+// NOTE: -fno-integrated-cc1 has been added to work around an ASAN failure
+// caused by in-process cc1 invocation. Clang InterfaceStubs is not the
+// culprit, but Clang Interface Stubs' Driver pipeline setup uncovers an
+// existing ASAN issue when invoking multiple normal cc1 jobs along with
+// multiple Clang Interface Stubs cc1 jobs together.
+// There is currently a discussion of this going on at:
+// https://reviews.llvm.org/D69825
+// RUN: mkdir -p %t; cd %t
+// RUN: %clang -target x86_64-unknown-linux-gnu -c -emit-interface-stubs \
+// RUN: -fno-integrated-cc1 \
+// RUN: %s %S/object.c %S/weak.cpp
+// RUN: %clang -emit-interface-stubs -emit-merged-ifs \
+// RUN: -fno-integrated-cc1 \
+// RUN: %t/driver-test2.o %t/object.o %t/weak.o -S -o - 2>&1 | FileCheck %s
+
+// CHECK-DAG: data
+// CHECK-DAG: bar
+// CHECK-DAG: strongFunc
+// CHECK-DAG: weakFunc
+
+int bar(int a) { return a; }
+int main() { return 0; }
diff --git a/src/llvm-project/clang/test/InterfaceStubs/driver-test3.c b/src/llvm-project/clang/test/InterfaceStubs/driver-test3.c
new file mode 100644
index 0000000..bccd1c9
--- /dev/null
+++ b/src/llvm-project/clang/test/InterfaceStubs/driver-test3.c
@@ -0,0 +1,19 @@
+// REQUIRES: x86-registered-target
+// REQUIRES: shell
+
+// RUN: mkdir -p %t; cd %t
+// RUN: %clang -target x86_64-unknown-linux-gnu -c -emit-interface-stubs %s -o %t/driver-test3.o
+// RUN: llvm-nm %t/driver-test3.o | FileCheck --check-prefix=CHECK-OBJ %s
+// RUN: cat %t/driver-test3.ifs | FileCheck --check-prefix=CHECK-IFS %s
+
+// CHECK-OBJ: bar
+
+// CHECK-IFS: --- !experimental-ifs-v1
+// CHECK-IFS-NEXT: IfsVersion:
+// CHECK-IFS-NEXT: Triple:
+// CHECK-IFS-NEXT: ObjectFileFormat:
+// CHECK-IFS-NEXT: Symbols:
+// CHECK-IFS-NEXT: "bar" : { Type: Func }
+// CHECK-IFS-NEXT: ...
+
+int bar(int a) { return a; }
diff --git a/src/llvm-project/clang/test/InterfaceStubs/externstatic.c b/src/llvm-project/clang/test/InterfaceStubs/externstatic.c
index 832b4b3..8975fe6 100644
--- a/src/llvm-project/clang/test/InterfaceStubs/externstatic.c
+++ b/src/llvm-project/clang/test/InterfaceStubs/externstatic.c
@@ -1,24 +1,20 @@
-// REQUIRES: x86-registered-target
-// RUN: %clang -DSTORAGE="extern" -target x86_64-unknown-linux-gnu -o - \
-// RUN: -emit-interface-stubs \
-// RUN: -interface-stub-version=experimental-yaml-elf-v1 -std=c99 -xc %s | \
+// RUN: %clang -cc1 -fvisibility default -DSTORAGE="extern" -o - -emit-interface-stubs -std=c99 -xc %s | \
// RUN: FileCheck -check-prefix=CHECK-EXTERN %s
-// RUN: %clang -DSTORAGE="extern" -target x86_64-linux-gnu -O0 -o - -c -std=c99 \
+
+// RUN: %clang -fvisibility=default -DSTORAGE="extern" -O0 -o - -c -std=c99 \
// RUN: -xc %s | llvm-nm - 2>&1 | FileCheck -check-prefix=CHECK-EXTERN %s
-// RUN: %clang -DSTORAGE="extern" -target x86_64-unknown-linux-gnu -o - \
-// RUN: -emit-interface-stubs \
-// RUN: -interface-stub-version=experimental-yaml-elf-v1 -std=c99 -xc %s | \
+// RUN: %clang -cc1 -fvisibility default -DSTORAGE="extern" -o - -emit-interface-stubs -std=c99 -xc %s | \
// RUN: FileCheck -check-prefix=CHECK-EXTERN2 %s
-// RUN: %clang -DSTORAGE="extern" -target x86_64-linux-gnu -O0 -o - -c -std=c99 \
-// RUN: -xc %s | llvm-nm - 2>&1 | FileCheck -check-prefix=CHECK-EXTERN2 %s
-// RUN: %clang -DSTORAGE="static" -target x86_64-unknown-linux-gnu -o - \
-// RUN: -emit-interface-stubs \
-// RUN: -interface-stub-version=experimental-yaml-elf-v1 -std=c99 -xc %s | \
+// RUN: %clang -fvisibility=default -DSTORAGE="extern" -O0 -o - -c -std=c99 -xc %s | llvm-nm - 2>&1 | \
+// RUN: FileCheck -check-prefix=CHECK-EXTERN2 %s
+
+// RUN: %clang -cc1 -fvisibility default -DSTORAGE="static" -o - -emit-interface-stubs -std=c99 -xc %s | \
// RUN: FileCheck -check-prefix=CHECK-STATIC %s
-// RUN: %clang -DSTORAGE="static" -target x86_64-linux-gnu -O0 -o - -c -std=c99 \
-// RUN: -xc %s | llvm-nm - 2>&1 | FileCheck -check-prefix=CHECK-STATIC %s
+
+// RUN: %clang -fvisibility=default -DSTORAGE="static" -O0 -o - -c -std=c99 -xc %s | llvm-nm - 2>&1 | \
+// RUN: FileCheck -check-prefix=CHECK-STATIC %s
// CHECK-EXTERN-NOT: foo
// CHECK-STATIC-NOT: foo
diff --git a/src/llvm-project/clang/test/InterfaceStubs/func.ifs b/src/llvm-project/clang/test/InterfaceStubs/func.ifs
new file mode 100644
index 0000000..d115523
--- /dev/null
+++ b/src/llvm-project/clang/test/InterfaceStubs/func.ifs
@@ -0,0 +1,40 @@
+# RUN: %clang -emit-interface-stubs -o - %s %S/object.ifs -emit-merged-ifs | \
+# RUN: FileCheck %s --check-prefixes=CHECK-IFS
+
+# RUN: %clang -emit-interface-stubs -o - %s %S/object.ifs | llvm-readelf --all | \
+# RUN: FileCheck %s --check-prefixes=CHECK-ELF
+
+# RUN: %clang -emit-interface-stubs -o - %s %s -emit-merged-ifs | \
+# RUN: FileCheck %s --check-prefixes=CHECK-MERGE-IFS
+
+# CHECK-IFS: --- !experimental-ifs-v1
+# CHECK-IFS-NEXT: IfsVersion: 1.0
+# CHECK-IFS-NEXT: Triple: x86_64-linux-gnu
+# CHECK-IFS-NEXT: ObjectFileFormat: ELF
+# CHECK-IFS-NEXT: Symbols:
+# CHECK-IFS-DAG: a: { Type: Func }
+# CHECK-IFS-DAG: b: { Type: Object, Size: 4 }
+# CHECK-IFS: ...
+
+# CHECK-ELF: ELF Header:
+# CHECK-ELF: Class: ELF64
+# CHECK-ELF: Type: DYN (Shared object file)
+# CHECK-ELF: FUNC GLOBAL DEFAULT 1 a
+# CHECK-ELF: OBJECT GLOBAL DEFAULT 1 b
+
+# Here we are testing to see if two identical symbols will merge.
+# CHECK-MERGE-IFS: --- !experimental-ifs-v1
+# CHECK-MERGE-IFS-NEXT: IfsVersion: 1.0
+# CHECK-MERGE-IFS-NEXT: Triple: x86_64-linux-gnu
+# CHECK-MERGE-IFS-NEXT: ObjectFileFormat: ELF
+# CHECK-MERGE-IFS-NEXT: Symbols:
+# CHECK-MERGE-IFS-NEXT: a: { Type: Func }
+# CHECK-MERGE-IFS-NEXT: ...
+
+--- !experimental-ifs-v1
+IfsVersion: 1.0
+Triple: x86_64-linux-gnu
+ObjectFileFormat: ELF
+Symbols:
+ a: { Type: Func }
+...
diff --git a/src/llvm-project/clang/test/InterfaceStubs/function-template-specialization.cpp b/src/llvm-project/clang/test/InterfaceStubs/function-template-specialization.cpp
index f01b431..5198baf 100644
--- a/src/llvm-project/clang/test/InterfaceStubs/function-template-specialization.cpp
+++ b/src/llvm-project/clang/test/InterfaceStubs/function-template-specialization.cpp
@@ -1,14 +1,12 @@
// REQUIRES: x86-registered-target
-// RUN: %clang -target x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
-// RUN: -interface-stub-version=experimental-tapi-elf-v1 %s | FileCheck %s
-// RUN: %clang -target x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
-// RUN: -interface-stub-version=experimental-tapi-elf-v1 \
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -o - -emit-interface-stubs %s | FileCheck %s
+
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
// RUN: -DUSE_TEMPLATE_FUNCTION=1 %s | \
// RUN: FileCheck -check-prefix=CHECK-USES-TEMPLATE-FUNCTION %s
-// RUN: %clang -target x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
-// RUN: -interface-stub-version=experimental-tapi-elf-v1 \
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
// RUN: -DSPECIALIZE_TEMPLATE_FUNCTION=1 %s | \
// RUN: FileCheck -check-prefix=CHECK-SPECIALIZES-TEMPLATE-FUNCTION %s
diff --git a/src/llvm-project/clang/test/InterfaceStubs/hidden-class-inheritance.cpp b/src/llvm-project/clang/test/InterfaceStubs/hidden-class-inheritance.cpp
index 9152914..19ba5796 100644
--- a/src/llvm-project/clang/test/InterfaceStubs/hidden-class-inheritance.cpp
+++ b/src/llvm-project/clang/test/InterfaceStubs/hidden-class-inheritance.cpp
@@ -1,6 +1,5 @@
// REQUIRES: x86-registered-target
-// RUN: %clang -target x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
-// RUN: -interface-stub-version=experimental-tapi-elf-v1 \
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
// RUN: -DPARENT_CLASS_VISIBILITY="" -DCHILD_CLASS_VISIBILITY="" \
// RUN: -DPARENT_METHOD_VISIBILITY="" -DCHILD_METHOD_VISIBILITY="" %s | \
// RUN: FileCheck -check-prefix=CHECK-X %s
@@ -10,13 +9,12 @@
// RUN: llvm-readelf -s - 2>&1 | \
// RUN: FileCheck -check-prefix=CHECK-X-RE %s
-// RUN: %clang -target x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
-// RUN: -interface-stub-version=experimental-tapi-elf-v1 \
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
// RUN: -DPARENT_CLASS_VISIBILITY=HIDDEN -DCHILD_CLASS_VISIBILITY="" \
// RUN: -DPARENT_METHOD_VISIBILITY="" -DCHILD_METHOD_VISIBILITY="" %s | \
// RUN: FileCheck -check-prefix=CHECK-HP %s
-// RUN: %clang -target x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
-// RUN: -interface-stub-version=experimental-tapi-elf-v1 \
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
+// RUN: -interface-stub-version=experimental-ifs-v1 \
// RUN: -DPARENT_CLASS_VISIBILITY=HIDDEN -DCHILD_CLASS_VISIBILITY="" \
// RUN: -DPARENT_METHOD_VISIBILITY="" -DCHILD_METHOD_VISIBILITY="" %s | \
// RUN: FileCheck -check-prefix=CHECK-HP2 %s
@@ -26,13 +24,11 @@
// RUN: llvm-readelf -s - 2>&1 | \
// RUN: FileCheck -check-prefix=CHECK-HP-RE %s
-// RUN: %clang -target x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
-// RUN: -interface-stub-version=experimental-tapi-elf-v1 \
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
// RUN: -DPARENT_CLASS_VISIBILITY="" -DCHILD_CLASS_VISIBILITY=HIDDEN \
// RUN: -DPARENT_METHOD_VISIBILITY="" -DCHILD_METHOD_VISIBILITY="" %s | \
// RUN: FileCheck -check-prefix=CHECK-HC %s
-// RUN: %clang -target x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
-// RUN: -interface-stub-version=experimental-tapi-elf-v1 \
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
// RUN: -DPARENT_CLASS_VISIBILITY="" -DCHILD_CLASS_VISIBILITY=HIDDEN \
// RUN: -DPARENT_METHOD_VISIBILITY="" -DCHILD_METHOD_VISIBILITY="" %s | \
// RUN: FileCheck -check-prefix=CHECK-HC2 %s
@@ -42,8 +38,7 @@
// RUN: llvm-readelf -s - 2>&1 | \
// RUN: FileCheck -check-prefix=CHECK-HC-RE %s
-// RUN: %clang -target x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
-// RUN: -interface-stub-version=experimental-tapi-elf-v1 \
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
// RUN: -DPARENT_CLASS_VISIBILITY=HIDDEN -DCHILD_CLASS_VISIBILITY=HIDDEN \
// RUN: -DPARENT_METHOD_VISIBILITY="" -DCHILD_METHOD_VISIBILITY="" %s | \
// RUN: FileCheck -check-prefix=CHECK-HP-HC %s
diff --git a/src/llvm-project/clang/test/InterfaceStubs/indirect-field-decl.cpp b/src/llvm-project/clang/test/InterfaceStubs/indirect-field-decl.cpp
new file mode 100644
index 0000000..d0e5fd2
--- /dev/null
+++ b/src/llvm-project/clang/test/InterfaceStubs/indirect-field-decl.cpp
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -o - -emit-interface-stubs %s | FileCheck %s
+
+// CHECK: --- !experimental-ifs-v1
+// CHECK-NEXT: IfsVersion: 1.0
+// CHECK-NEXT: Triple:
+// CHECK-NEXT: ObjectFileFormat: ELF
+// CHECK-NEXT: Symbols:
+// CHECK-NEXT: ...
+
+template<typename T> class C2 { union { T c; }; };
diff --git a/src/llvm-project/clang/test/InterfaceStubs/inline.c b/src/llvm-project/clang/test/InterfaceStubs/inline.c
index 40dc455..3ff7db9 100644
--- a/src/llvm-project/clang/test/InterfaceStubs/inline.c
+++ b/src/llvm-project/clang/test/InterfaceStubs/inline.c
@@ -1,37 +1,32 @@
// REQUIRES: x86-registered-target
-// RUN: %clang -DINLINE=inline -target x86_64-unknown-linux-gnu -o - \
-// RUN: -emit-interface-stubs \
-// RUN: -interface-stub-version=experimental-yaml-elf-v1 -std=gnu89 -xc %s | \
+// RUN: %clang_cc1 -DINLINE=inline -triple x86_64-unknown-linux-gnu -o - \
+// RUN: -emit-interface-stubs -std=gnu89 -xc %s | \
// RUN: FileCheck -check-prefix=CHECK-GNU %s
// RUN: %clang -DINLINE=inline -target x86_64-linux-gnu -O0 -o - -c \
// RUN: -std=gnu89 -xc %s | llvm-nm - | FileCheck -check-prefix=CHECK-GNU %s
-// RUN: %clang -DINLINE="__attribute__((always_inline))" \
-// RUN: -target x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
-// RUN: -interface-stub-version=experimental-yaml-elf-v1 -xc %s | \
+// RUN: %clang_cc1 -DINLINE="__attribute__((always_inline))" \
+// RUN: -triple x86_64-unknown-linux-gnu -o - -emit-interface-stubs -xc %s | \
// RUN: FileCheck -check-prefix=CHECK-GNU %s
// RUN: %clang -DINLINE="__attribute__((always_inline))" \
// RUN: -target x86_64-linux-gnu -O0 -o - -c -xc %s | \
// RUN: llvm-nm - | FileCheck -check-prefix=CHECK-GNU %s
-// RUN: %clang -DINLINE=inline -target x86_64-unknown-linux-gnu -o - \
-// RUN: -emit-interface-stubs \
-// RUN: -interface-stub-version=experimental-yaml-elf-v1 -std=c99 -xc %s | \
+// RUN: %clang_cc1 -DINLINE=inline -triple x86_64-unknown-linux-gnu -o - \
+// RUN: -emit-interface-stubs -std=c99 -xc %s | \
// RUN: FileCheck -check-prefix=CHECK-STD %s
// RUN: %clang -DINLINE=inline -target x86_64-linux-gnu -O0 -o - -c -std=c99 \
// RUN: -xc %s | llvm-nm - 2>&1 | FileCheck -check-prefix=CHECK-STD %s
-// RUN: %clang -DINLINE="__attribute__((noinline))" \
-// RUN: -target x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
-// RUN: -interface-stub-version=experimental-yaml-elf-v1 -std=c99 -xc %s | \
+// RUN: %clang_cc1 -DINLINE="__attribute__((noinline))" \
+// RUN: -triple x86_64-unknown-linux-gnu -o - -emit-interface-stubs -std=c99 -xc %s | \
// RUN: FileCheck -check-prefix=CHECK-NOINLINE %s
// RUN: %clang -DINLINE="__attribute__((noinline))" -target x86_64-linux-gnu \
// RUN: -O0 -o - -c -std=c99 -xc %s | llvm-nm - 2>&1 | \
// RUN: FileCheck -check-prefix=CHECK-NOINLINE %s
-// RUN: %clang -DINLINE="static" -target x86_64-unknown-linux-gnu -o - \
-// RUN: -emit-interface-stubs \
-// RUN: -interface-stub-version=experimental-yaml-elf-v1 -std=c99 -xc %s | \
+// RUN: %clang_cc1 -DINLINE="static" -triple x86_64-unknown-linux-gnu -o - \
+// RUN: -emit-interface-stubs -std=c99 -xc %s | \
// RUN: FileCheck -check-prefix=CHECK-STATIC %s
// RUN: %clang -DINLINE="static" -target x86_64-linux-gnu -O0 -o - -c \
// RUN: -std=c99 -xc %s | llvm-nm - 2>&1 | \
@@ -50,19 +45,19 @@
return var;
}
-// RUN: %clang -DINLINE=inline -target x86_64-linux-gnu -o - \
-// RUN: -emit-interface-stubs -interface-stub-version=experimental-tapi-elf-v1 \
+// RUN: %clang_cc1 -DINLINE=inline -triple x86_64-linux-gnu -o - \
+// RUN: -emit-interface-stubs \
// RUN: -std=gnu89 -xc %s | FileCheck -check-prefix=CHECK-TAPI %s
-// RUN: %clang -DINLINE=inline -target x86_64-linux-gnu -o - \
-// RUN: -emit-interface-stubs -interface-stub-version=experimental-tapi-elf-v1 \
+// RUN: %clang_cc1 -DINLINE=inline -triple x86_64-linux-gnu -o - \
+// RUN: -emit-interface-stubs \
// RUN: -std=gnu89 -xc %s | FileCheck -check-prefix=CHECK-SYMBOLS %s
// RUN: %clang -DINLINE=inline -target x86_64-linux-gnu -o - \
// RUN: -c -std=gnu89 -xc %s | llvm-nm - 2>&1 | \
// RUN: FileCheck -check-prefix=CHECK-SYMBOLS %s
-// CHECK-TAPI-DAG: foo: { Type: Func }
-// CHECK-TAPI-DAG: foo.var: { Type: Object, Size: 4 }
+// CHECK-TAPI-DAG: foo" : { Type: Func }
+// CHECK-TAPI-DAG: foo.var" : { Type: Object, Size: 4 }
// CHECK-SYMBOLS-DAG: foo
// CHECK-SYMBOLS-DAG: foo.var
#include "inline.h"
diff --git a/src/llvm-project/clang/test/InterfaceStubs/lambda.cpp b/src/llvm-project/clang/test/InterfaceStubs/lambda.cpp
new file mode 100644
index 0000000..e892f1e
--- /dev/null
+++ b/src/llvm-project/clang/test/InterfaceStubs/lambda.cpp
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-interface-stubs -o - %s \
+// RUN: | FileCheck %s
+
+// CHECK: --- !experimental-ifs-v1
+// CHECK-NEXT: IfsVersion: 1.0
+// CHECK-NEXT: Triple:
+// CHECK-NEXT: ObjectFileFormat: ELF
+// CHECK-NEXT: Symbols:
+// CHECK-NEXT: f" : { Type: Object, Size: 1 }
+// CHECK-NEXT: ...
+auto f = [](void* data) { int i; };
diff --git a/src/llvm-project/clang/test/InterfaceStubs/merge-conflict-test.c b/src/llvm-project/clang/test/InterfaceStubs/merge-conflict-test.c
new file mode 100644
index 0000000..81d20bd
--- /dev/null
+++ b/src/llvm-project/clang/test/InterfaceStubs/merge-conflict-test.c
@@ -0,0 +1,3 @@
+// RUN: not %clang -fvisibility=default -o libfoo.so -emit-interface-stubs %s %S/driver-test.c 2>&1 | FileCheck %s
+// CHECK: error: Interface Stub: Type Mismatch
+int foo;
diff --git a/src/llvm-project/clang/test/InterfaceStubs/namespace-alias.cpp b/src/llvm-project/clang/test/InterfaceStubs/namespace-alias.cpp
new file mode 100644
index 0000000..6a7f27c
--- /dev/null
+++ b/src/llvm-project/clang/test/InterfaceStubs/namespace-alias.cpp
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -o - -emit-interface-stubs %s | FileCheck %s
+
+// CHECK: --- !experimental-ifs-v1
+// CHECK-NEXT: IfsVersion: 1.0
+// CHECK-NEXT: Triple:
+// CHECK-NEXT: ObjectFileFormat: ELF
+// CHECK-NEXT: Symbols:
+// CHECK-NEXT: ...
+
+// NamespaceAliasDecl
+namespace NS { }
+namespace B = NS;
diff --git a/src/llvm-project/clang/test/InterfaceStubs/namespace.cpp b/src/llvm-project/clang/test/InterfaceStubs/namespace.cpp
new file mode 100644
index 0000000..1c62346
--- /dev/null
+++ b/src/llvm-project/clang/test/InterfaceStubs/namespace.cpp
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -o - -emit-interface-stubs %s | FileCheck %s
+
+// CHECK: --- !experimental-ifs-v1
+// CHECK-NEXT: IfsVersion: 1.0
+// CHECK-NEXT: Triple:
+// CHECK-NEXT: ObjectFileFormat: ELF
+// CHECK-NEXT: Symbols:
+// CHECK-NEXT: ...
+
+namespace NS1 { }
+using namespace NS1;
diff --git a/src/llvm-project/clang/test/InterfaceStubs/non-type-template-parm-decl.cpp b/src/llvm-project/clang/test/InterfaceStubs/non-type-template-parm-decl.cpp
new file mode 100644
index 0000000..51176ac
--- /dev/null
+++ b/src/llvm-project/clang/test/InterfaceStubs/non-type-template-parm-decl.cpp
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -o - -emit-interface-stubs %s | FileCheck %s
+
+// CHECK: --- !experimental-ifs-v1
+// CHECK-NEXT: IfsVersion: 1.0
+// CHECK-NEXT: Triple:
+// CHECK-NEXT: ObjectFileFormat: ELF
+// CHECK-NEXT: Symbols:
+// CHECK-NEXT: ...
+
+template<bool T> struct S1 {};
diff --git a/src/llvm-project/clang/test/InterfaceStubs/noninstancetypes.c b/src/llvm-project/clang/test/InterfaceStubs/noninstancetypes.c
new file mode 100644
index 0000000..ad80aa6
--- /dev/null
+++ b/src/llvm-project/clang/test/InterfaceStubs/noninstancetypes.c
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -o - -emit-interface-stubs %s | FileCheck %s
+// TODO: Change clang_cc1 to clang when llvm-ifs can accept empty symbol lists.
+
+// CHECK: Symbols:
+// CHECK-NEXT: ...
+
+struct a;
+enum { b };
+typedef int c;
+
diff --git a/src/llvm-project/clang/test/InterfaceStubs/object-double.c b/src/llvm-project/clang/test/InterfaceStubs/object-double.c
new file mode 100644
index 0000000..c6d2b61
--- /dev/null
+++ b/src/llvm-project/clang/test/InterfaceStubs/object-double.c
@@ -0,0 +1,5 @@
+// RUN: not %clang -o - -emit-interface-stubs %s %S/object.c 2>&1 | FileCheck %s
+// Need to encode more type info or weak vs strong symbol resolution in llvm-ifs
+// XFAIL: *
+// CHECK: error: Interface Stub: Size Mismatch
+float data = 42.0;
\ No newline at end of file
diff --git a/src/llvm-project/clang/test/InterfaceStubs/object-float.c b/src/llvm-project/clang/test/InterfaceStubs/object-float.c
new file mode 100644
index 0000000..be51e86
--- /dev/null
+++ b/src/llvm-project/clang/test/InterfaceStubs/object-float.c
@@ -0,0 +1,3 @@
+// RUN: not %clang -fvisibility=default -o - -emit-interface-stubs %s %S/object.c 2>&1 | FileCheck %s
+// CHECK: error: Interface Stub: Size Mismatch
+double data = 42.0;
diff --git a/src/llvm-project/clang/test/InterfaceStubs/object.c b/src/llvm-project/clang/test/InterfaceStubs/object.c
new file mode 100644
index 0000000..d6e28c5
--- /dev/null
+++ b/src/llvm-project/clang/test/InterfaceStubs/object.c
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -fvisibility default -o - -emit-interface-stubs %s | FileCheck -check-prefix=CHECK-TAPI %s
+// RUN: %clang -fvisibility=default -c -o - %s | llvm-nm - 2>&1 | FileCheck -check-prefix=CHECK-SYMBOLS %s
+
+// CHECK-TAPI: data" : { Type: Object, Size: 4 }
+// CHECK-SYMBOLS: data
+int data = 42;
diff --git a/src/llvm-project/clang/test/InterfaceStubs/object.cpp b/src/llvm-project/clang/test/InterfaceStubs/object.cpp
deleted file mode 100644
index 090a29d..0000000
--- a/src/llvm-project/clang/test/InterfaceStubs/object.cpp
+++ /dev/null
@@ -1,14 +0,0 @@
-// REQUIRES: x86-registered-target
-// RUN: %clang -target x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
-// RUN: -interface-stub-version=experimental-tapi-elf-v1 %s | \
-// RUN: FileCheck -check-prefix=CHECK-TAPI %s
-
-// RUN: %clang -target x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
-// RUN: -interface-stub-version=experimental-tapi-elf-v1 %s | \
-// RUN: FileCheck -check-prefix=CHECK-SYMBOLS %s
-// RUN: %clang -target x86_64-unknown-linux-gnu -o - -c %s | llvm-nm - 2>&1 | \
-// RUN: FileCheck -check-prefix=CHECK-SYMBOLS %s
-
-// CHECK-TAPI: data: { Type: Object, Size: 4 }
-// CHECK-SYMBOLS: data
-int data = 42;
diff --git a/src/llvm-project/clang/test/InterfaceStubs/object.ifs b/src/llvm-project/clang/test/InterfaceStubs/object.ifs
new file mode 100644
index 0000000..7dc1134
--- /dev/null
+++ b/src/llvm-project/clang/test/InterfaceStubs/object.ifs
@@ -0,0 +1,28 @@
+# RUN: %clang -emit-interface-stubs -o - -emit-merged-ifs %s | \
+# RUN: FileCheck %s --check-prefixes=CHECK-IFS
+
+# RUN: %clang -emit-interface-stubs -o - %s | llvm-readelf --all | \
+# RUN: FileCheck %s --check-prefixes=CHECK-ELF
+
+# CHECK-IFS: --- !experimental-ifs-v1
+# CHECK-IFS-NEXT: IfsVersion: 1.0
+# CHECK-IFS-NEXT: Triple: x86_64-linux-gnu
+# CHECK-IFS-NEXT: ObjectFileFormat: ELF
+# CHECK-IFS-NEXT: Symbols:
+# CHECK-IFS-NEXT: b: { Type: Object, Size: 4 }
+# CHECK-IFS-NEXT: ...
+
+# CHECK-ELF: ELF Header:
+# CHECK-ELF: Class: ELF64
+# CHECK-ELF: Data: 2's complement, little endian
+# CHECK-ELF: Type: DYN (Shared object file)
+# CHECK-ELF-NOT: FUNC GLOBAL DEFAULT 1 a
+# CHECK-ELF: OBJECT GLOBAL DEFAULT 1 b
+
+--- !experimental-ifs-v1
+IfsVersion: 1.0
+Triple: x86_64-linux-gnu
+ObjectFileFormat: ELF
+Symbols:
+ b: { Type: Object, Size: 4 }
+...
diff --git a/src/llvm-project/clang/test/InterfaceStubs/ppc.cpp b/src/llvm-project/clang/test/InterfaceStubs/ppc.cpp
new file mode 100644
index 0000000..9a91697
--- /dev/null
+++ b/src/llvm-project/clang/test/InterfaceStubs/ppc.cpp
@@ -0,0 +1,14 @@
+// REQUIRES: powerpc-registered-target
+
+// RUN: %clang -x c++ -target powerpc64le-unknown-linux-gnu -o - %s \
+// RUN: -emit-interface-stubs -emit-merged-ifs -S | \
+// RUN: FileCheck -check-prefix=CHECK-IFS %s
+
+ // CHECK-IFS: --- !experimental-ifs-v1
+ // CHECK-IFS: IfsVersion: 1.0
+ // CHECK-IFS: Triple: powerpc64le
+ // CHECK-IFS: Symbols:
+ // CHECK-IFS: _Z8helloPPCv: { Type: Func }
+ // CHECK-IFS: ...
+
+int helloPPC();
diff --git a/src/llvm-project/clang/test/InterfaceStubs/template-constexpr.cpp b/src/llvm-project/clang/test/InterfaceStubs/template-constexpr.cpp
new file mode 100644
index 0000000..c4c7afa
--- /dev/null
+++ b/src/llvm-project/clang/test/InterfaceStubs/template-constexpr.cpp
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -o - -emit-interface-stubs %s | FileCheck %s
+
+// CHECK: --- !experimental-ifs-v1
+// CHECK-NEXT: IfsVersion: 1.0
+// CHECK-NEXT: Triple:
+// CHECK-NEXT: ObjectFileFormat: ELF
+// CHECK-NEXT: Symbols:
+// CHECK-NEXT: ...
+
+template<typename T, T v> struct S8 { static constexpr T value = v; };
+template<typename T, T v> constexpr T S8<T, v>::value;
diff --git a/src/llvm-project/clang/test/InterfaceStubs/template-namespace-function.cpp b/src/llvm-project/clang/test/InterfaceStubs/template-namespace-function.cpp
index 41e5fde..47788d4 100644
--- a/src/llvm-project/clang/test/InterfaceStubs/template-namespace-function.cpp
+++ b/src/llvm-project/clang/test/InterfaceStubs/template-namespace-function.cpp
@@ -1,16 +1,15 @@
// REQUIRES: x86-registered-target
-// RUN: %clang -target x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
-// RUN: -interface-stub-version=experimental-tapi-elf-v1 %s | \
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -o - -emit-interface-stubs %s | \
// RUN: FileCheck %s
// RUN: %clang -target x86_64-unknown-linux-gnu -o - -c %s | llvm-nm - 2>&1 | \
// RUN: FileCheck -check-prefix=CHECK-SYMBOLS %s
// CHECK: Symbols:
-// CHECK-DAG: _ZN3qux3barEii: { Type: Func }
-// CHECK-DAG: _ZN3baz3addIiEET_S1_S1_: { Type: Func }
-// CHECK-DAG: _Z4fbarff: { Type: Func }
-// CHECK-DAG: _ZN3baz3addIfEET_S1_S1_: { Type: Func }
+// CHECK-DAG: "_ZN3qux3barEii" : { Type: Func }
+// CHECK-DAG: "_ZN3baz3addIiEET_S1_S1_" : { Type: Func }
+// CHECK-DAG: "_Z4fbarff" : { Type: Func }
+// CHECK-DAG: "_ZN3baz3addIfEET_S1_S1_" : { Type: Func }
// Same symbols just different order.
// CHECK-SYMBOLS-DAG: _Z4fbarff
diff --git a/src/llvm-project/clang/test/InterfaceStubs/template-template-parm-decl.cpp b/src/llvm-project/clang/test/InterfaceStubs/template-template-parm-decl.cpp
new file mode 100644
index 0000000..6388353
--- /dev/null
+++ b/src/llvm-project/clang/test/InterfaceStubs/template-template-parm-decl.cpp
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -o - -emit-interface-stubs %s | FileCheck %s
+
+// CHECK: --- !experimental-ifs-v1
+// CHECK-NEXT: IfsVersion: 1.0
+// CHECK-NEXT: Triple:
+// CHECK-NEXT: ObjectFileFormat: ELF
+// CHECK-NEXT: Symbols:
+// CHECK-NEXT: ...
+
+template<template<typename...> class a> struct S6 { };
diff --git a/src/llvm-project/clang/test/InterfaceStubs/trycatch.cpp b/src/llvm-project/clang/test/InterfaceStubs/trycatch.cpp
new file mode 100644
index 0000000..57076a0
--- /dev/null
+++ b/src/llvm-project/clang/test/InterfaceStubs/trycatch.cpp
@@ -0,0 +1,15 @@
+// REQUIRES: x86-registered-target
+
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fcxx-exceptions -o - -emit-interface-stubs %s | FileCheck %s
+
+
+// CHECK: --- !experimental-ifs-v1
+// CHECK-NEXT: IfsVersion: 1.0
+// CHECK-NEXT: Triple: x86_64-unknown-linux-gnu
+// CHECK-NEXT: ObjectFileFormat: ELF
+// CHECK-NEXT: Symbols:
+// CHECK-NEXT: "_Z1fv" : { Type: Func }
+// CHECK-NEXT: ...
+
+class C5 {};
+void f() { try {} catch(C5&){} }
diff --git a/src/llvm-project/clang/test/InterfaceStubs/unresolved-using-typename.cpp b/src/llvm-project/clang/test/InterfaceStubs/unresolved-using-typename.cpp
new file mode 100644
index 0000000..e6afc78
--- /dev/null
+++ b/src/llvm-project/clang/test/InterfaceStubs/unresolved-using-typename.cpp
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -o - -emit-interface-stubs %s | FileCheck %s
+
+// CHECK: --- !experimental-ifs-v1
+// CHECK-NEXT: IfsVersion: 1.0
+// CHECK-NEXT: Triple:
+// CHECK-NEXT: ObjectFileFormat: ELF
+// CHECK-NEXT: Symbols:
+// CHECK-NEXT: ...
+
+// UnresolvedUsingTypenameDecl
+template<typename T> class C1 { using ReprType = unsigned; };
+template<typename T> class C2 : public C1<T> { using typename C1<T>::Repr; };
diff --git a/src/llvm-project/clang/test/InterfaceStubs/usings.cpp b/src/llvm-project/clang/test/InterfaceStubs/usings.cpp
new file mode 100644
index 0000000..735a040
--- /dev/null
+++ b/src/llvm-project/clang/test/InterfaceStubs/usings.cpp
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 -o - -emit-interface-stubs %s | FileCheck %s
+
+// CHECK: --- !experimental-ifs-v1
+// CHECK-NEXT: IfsVersion: 1.0
+// CHECK-NEXT: Triple:
+// CHECK-NEXT: ObjectFileFormat: ELF
+// CHECK-NEXT: Symbols:
+// CHECK-NEXT: ...
+
+template<typename T> struct S2 { static unsigned f(); };
+template<typename T> struct S3 { using S2<T>::f; };
+
+typedef struct {} S4;
+using ::S4;
+
+template<typename T, T t> struct C3{};
+template<bool b> using U1 = C3<bool, b>;
diff --git a/src/llvm-project/clang/test/InterfaceStubs/var-template-specialization-decl.cpp b/src/llvm-project/clang/test/InterfaceStubs/var-template-specialization-decl.cpp
new file mode 100644
index 0000000..bbb5ae8
--- /dev/null
+++ b/src/llvm-project/clang/test/InterfaceStubs/var-template-specialization-decl.cpp
@@ -0,0 +1,17 @@
+// REQUIRES: x86-registered-target
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -o - -emit-interface-stubs %s | FileCheck %s
+
+// CHECK: --- !experimental-ifs-v1
+// CHECK-NEXT: IfsVersion: 1.0
+// CHECK-NEXT: Triple: x86_64-unknown-linux-gnu
+// CHECK-NEXT: ObjectFileFormat: ELF
+// CHECK-NEXT: Symbols:
+// CHECK-NEXT: "a" : { Type: Object, Size: 4 }
+// CHECK-NEXT: ...
+
+template<typename T, T v> struct S9 {
+ static constexpr T value = v;
+};
+template<typename T> struct S0 : public S9<bool, true> { };
+template<typename T> constexpr bool CE2 = S0<T>::value;
+int a = CE2<int>;
diff --git a/src/llvm-project/clang/test/InterfaceStubs/virtual.cpp b/src/llvm-project/clang/test/InterfaceStubs/virtual.cpp
index 0fdb604..cea58aa 100644
--- a/src/llvm-project/clang/test/InterfaceStubs/virtual.cpp
+++ b/src/llvm-project/clang/test/InterfaceStubs/virtual.cpp
@@ -1,9 +1,7 @@
// REQUIRES: x86-registered-target
-// RUN: %clang -target x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
-// RUN: -interface-stub-version=experimental-tapi-elf-v1 %s | \
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -o - -emit-interface-stubs %s | \
// RUN: FileCheck -check-prefix=CHECK-TAPI %s
-// RUN: %clang -target x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
-// RUN: -interface-stub-version=experimental-tapi-elf-v1 %s | \
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -o - -emit-interface-stubs %s | \
// RUN: FileCheck -check-prefix=CHECK-TAPI2 %s
// RUN: %clang -target x86_64-unknown-linux-gnu -o - -c %s | \
// RUN: llvm-readelf -s - 2>&1 | FileCheck -check-prefix=CHECK-SYMBOLS %s
diff --git a/src/llvm-project/clang/test/InterfaceStubs/visibility.cpp b/src/llvm-project/clang/test/InterfaceStubs/visibility.cpp
index 137c593..223be53 100644
--- a/src/llvm-project/clang/test/InterfaceStubs/visibility.cpp
+++ b/src/llvm-project/clang/test/InterfaceStubs/visibility.cpp
@@ -1,26 +1,20 @@
// REQUIRES: x86-registered-target
-// RUN: %clang -target x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
-// RUN: -interface-stub-version=experimental-tapi-elf-v1 -fvisibility=hidden \
-// RUN: %s | FileCheck --check-prefix=CHECK-CMD-HIDDEN %s
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
+// RUN: -fvisibility hidden %s | FileCheck --check-prefix=CHECK-CMD-HIDDEN %s
-// RUN: %clang -target x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
-// RUN: -interface-stub-version=experimental-yaml-elf-v1 -fvisibility=hidden \
-// RUN: %s | FileCheck --check-prefix=CHECK-CMD-HIDDEN %s
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
+// RUN: -fvisibility hidden %s | FileCheck --check-prefix=CHECK-CMD-HIDDEN %s
-// RUN: %clang -target x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
-// RUN: -interface-stub-version=experimental-tapi-elf-v1 %s | \
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -o - -emit-interface-stubs %s | \
// RUN: FileCheck --check-prefix=CHECK-CMD %s
-// RUN: %clang -target x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
-// RUN: -interface-stub-version=experimental-yaml-elf-v1 %s | \
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -o - -emit-interface-stubs %s | \
// RUN: FileCheck --check-prefix=CHECK-CMD %s
-// RUN: %clang -target x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
-// RUN: -interface-stub-version=experimental-tapi-elf-v1 %s | \
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -o - -emit-interface-stubs %s | \
// RUN: FileCheck --check-prefix=CHECK-CMD2 %s
-// RUN: %clang -target x86_64-unknown-linux-gnu -o - -emit-interface-stubs \
-// RUN: -interface-stub-version=experimental-yaml-elf-v1 %s | \
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -o - -emit-interface-stubs %s | \
// RUN: FileCheck --check-prefix=CHECK-CMD2 %s
// RUN: %clang -target x86_64-unknown-linux-gnu -o - -c %s | llvm-readelf -s - 2>&1 | \
diff --git a/src/llvm-project/clang/test/InterfaceStubs/weak.cpp b/src/llvm-project/clang/test/InterfaceStubs/weak.cpp
index 50bae58..1581ffa 100644
--- a/src/llvm-project/clang/test/InterfaceStubs/weak.cpp
+++ b/src/llvm-project/clang/test/InterfaceStubs/weak.cpp
@@ -1,26 +1,14 @@
// REQUIRES: x86-registered-target
-// RUN: %clang -target x86_64-linux-gnu -o - -emit-interface-stubs \
-// RUN: -interface-stub-version=experimental-tapi-elf-v1 %s | \
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -o - -emit-interface-stubs \
+// RUN: -interface-stub-version=experimental-ifs-v1 %s | \
// RUN: FileCheck %s
-// RUN: %clang -target x86_64-linux-gnu -o - -emit-interface-stubs \
-// RUN: -interface-stub-version=experimental-yaml-elf-v1 %s | \
-// RUN: FileCheck --check-prefix=CHECK-YAML %s
-
// RUN: %clang -target x86_64-unknown-linux-gnu -o - -c %s | llvm-nm - 2>&1 | \
// RUN: FileCheck -check-prefix=CHECK-SYMBOLS %s
// CHECK: Symbols:
-// CHECK-DAG: _Z8weakFuncv: { Type: Func, Weak: true }
-// CHECK-DAG: _Z10strongFuncv: { Type: Func }
-
-// CHECK-YAML: Symbols:
-// CHECK-YAML-DAG: - Name: _Z8weakFuncv
-// CHECK-YAML-DAG: Type: STT_FUNC
-// CHECK-YAML-DAG: Binding: STB_WEAK
-// CHECK-YAML-DAG: - Name: _Z10strongFuncv
-// CHECK-YAML-DAG: Type: STT_FUNC
-// CHECK-YAML-DAG: Binding: STB_GLOBAL
+// CHECK-DAG: "_Z8weakFuncv" : { Type: Func, Weak: true }
+// CHECK-DAG: "_Z10strongFuncv" : { Type: Func }
// CHECK-SYMBOLS-DAG: _Z10strongFuncv
// CHECK-SYMBOLS-DAG: _Z8weakFuncv
diff --git a/src/llvm-project/clang/test/InterfaceStubs/windows.cpp b/src/llvm-project/clang/test/InterfaceStubs/windows.cpp
new file mode 100644
index 0000000..c81c702
--- /dev/null
+++ b/src/llvm-project/clang/test/InterfaceStubs/windows.cpp
@@ -0,0 +1,16 @@
+// REQUIRES: x86-registered-target
+// RUN: %clang_cc1 -triple x86_64-windows-msvc -o - %s -emit-interface-stubs | FileCheck -check-prefix=CHECK-CC1 %s
+// RUN: %clang -target x86_64-windows-msvc -o - %s -emit-interface-stubs -emit-merged-ifs -S | FileCheck -check-prefix=CHECK-IFS %s
+// note: -S is added here to prevent clang from invoking link.exe
+
+// CHECK-CC1: Symbols:
+// CHECK-CC1-NEXT: ?helloWindowsMsvc@@YAHXZ
+
+ // CHECK-IFS: --- !experimental-ifs-v1
+ // CHECK-IFS: IfsVersion: 1.0
+ // CHECK-IFS: Triple:
+ // CHECK-IFS: Symbols:
+ // CHECK-IFS: ?helloWindowsMsvc@@YAHXZ: { Type: Func }
+ // CHECK-IFS: ...
+
+int helloWindowsMsvc();
diff --git a/src/llvm-project/clang/test/Lexer/cross-windows-on-linux-default.cpp b/src/llvm-project/clang/test/Lexer/cross-windows-on-linux-default.cpp
index 520b419..bcd4999 100644
--- a/src/llvm-project/clang/test/Lexer/cross-windows-on-linux-default.cpp
+++ b/src/llvm-project/clang/test/Lexer/cross-windows-on-linux-default.cpp
@@ -1,4 +1,4 @@
-// RUN: not %clang_cc1 -fsyntax-only -fms-compatibility -triple i686-win32 %s 2>&1 \
+// RUN: not %clang_cc1 -fsyntax-only -fms-extensions -triple i686-win32 %s 2>&1 \
// RUN: | FileCheck %s
#include "Inputs\success.h"
diff --git a/src/llvm-project/clang/test/Lexer/cross-windows-on-linux.cpp b/src/llvm-project/clang/test/Lexer/cross-windows-on-linux.cpp
index c6dcbca..3932ffc 100644
--- a/src/llvm-project/clang/test/Lexer/cross-windows-on-linux.cpp
+++ b/src/llvm-project/clang/test/Lexer/cross-windows-on-linux.cpp
@@ -6,10 +6,8 @@
// CHECK: #include "Inputs\success.h"
// CHECK: ^
-// expected to fail on windows as the inclusion would succeed and the
-// compilation will fail due to the '#error success'.
-// XFAIL: windows-msvc
-
-// This test may or may not fail since 'Inputs\success.h' is passed
-// to Win32 APIs on Windows.
-// REQUIRES: disabled
+// This test is really checking that we *don't* replace backslashes with slashes
+// on non-Windows unless -fms-extensions is passed. It won't fail in this way on
+// Windows because the filesystem will interpret the backslash as a directory
+// separator.
+// UNSUPPORTED: system-windows
diff --git a/src/llvm-project/clang/test/Lexer/cxx-features.cpp b/src/llvm-project/clang/test/Lexer/cxx-features.cpp
index 75d6e0a..8b9cb54 100644
--- a/src/llvm-project/clang/test/Lexer/cxx-features.cpp
+++ b/src/llvm-project/clang/test/Lexer/cxx-features.cpp
@@ -5,7 +5,7 @@
// RUN: %clang_cc1 -std=c++2a -fcxx-exceptions -fsized-deallocation -verify %s
//
// RUN: %clang_cc1 -std=c++17 -fcxx-exceptions -fsized-deallocation -frelaxed-template-template-args -DRELAXED_TEMPLATE_TEMPLATE_ARGS=1 -verify %s
-// RUN: %clang_cc1 -std=c++17 -fcxx-exceptions -fsized-deallocation -fconcepts-ts -DCONCEPTS_TS=1 -verify %s
+// RUN: %clang_cc1 -std=c++17 -fcxx-exceptions -fsized-deallocation -DCONCEPTS_TS=1 -verify %s
// RUN: %clang_cc1 -std=c++14 -fno-rtti -fno-threadsafe-statics -verify %s -DNO_EXCEPTIONS -DNO_RTTI -DNO_THREADSAFE_STATICS -fsized-deallocation
// RUN: %clang_cc1 -std=c++14 -fcoroutines-ts -DNO_EXCEPTIONS -DCOROUTINES -verify -fsized-deallocation %s
// RUN: %clang_cc1 -std=c++14 -fchar8_t -DNO_EXCEPTIONS -DCHAR8_T -verify -fsized-deallocation %s
@@ -34,10 +34,44 @@
#error "wrong value for __cpp_char8_t"
#endif
+#if check(conditional_explicit, 0, 0, 0, 0, 201806)
+#error "wrong value for __cpp_conditional_explicit"
+#endif
+
+// constexpr checked below
+
+#if check(constexpr_dynamic_alloc, 0, 0, 0, 0, 201907)
+#error "wrong value for __cpp_constexpr_dynamic_alloc"
+#endif
+
+#if check(constexpr_in_decltype, 0, 201711, 201711, 201711, 201711)
+#error "wrong value for __cpp_constexpr_in_decltype"
+#endif
+
+#if check(constinit, 0, 0, 0, 0, 201907)
+#error "wrong value for __cpp_constinit"
+#endif
+
+#if check(designated_initializers, 0, 0, 0, 0, 201707)
+#error "wrong value for __cpp_designated_initializers"
+#endif
+
+// generic_lambdas checked below
+
#if check(impl_destroying_delete, 201806, 201806, 201806, 201806, 201806)
#error "wrong value for __cpp_impl_destroying_delete"
#endif
+#if check(impl_three_way_comparison, 0, 0, 0, 0, 201907)
+#error "wrong value for __cpp_impl_three_way_comparison"
+#endif
+
+// init_captures checked below
+
+#if check(concepts, 0, 0, 0, 0, 201907)
+#error "wrong value for __cpp_concepts"
+#endif
+
// --- C++17 features ---
#if check(hex_float, 0, 0, 0, 201603, 201603)
@@ -142,11 +176,11 @@
#error "wrong value for __cpp_digit_separators"
#endif
-#if check(init_captures, 0, 0, 201304, 201304, 201304)
+#if check(init_captures, 0, 0, 201304, 201304, 201803)
#error "wrong value for __cpp_init_captures"
#endif
-#if check(generic_lambdas, 0, 0, 201304, 201304, 201304)
+#if check(generic_lambdas, 0, 0, 201304, 201304, 201707)
#error "wrong value for __cpp_generic_lambdas"
#endif
@@ -203,7 +237,7 @@
#error "wrong value for __cpp_lambdas"
#endif
-#if check(constexpr, 0, 200704, 201304, 201603, 201603)
+#if check(constexpr, 0, 200704, 201304, 201603, 201907)
#error "wrong value for __cpp_constexpr"
#endif
@@ -267,10 +301,6 @@
// --- TS features --
-#if check(experimental_concepts, 0, 0, CONCEPTS_TS, CONCEPTS_TS, CONCEPTS_TS)
-#error "wrong value for __cpp_experimental_concepts"
-#endif
-
#if defined(COROUTINES) ? check(coroutines, 201703L, 201703L, 201703L, 201703L, 201703L) : check(coroutines, 0, 0, 0, 0, 201703L)
#error "wrong value for __cpp_coroutines"
#endif
diff --git a/src/llvm-project/clang/test/Lexer/cxx2a-spaceship.cpp b/src/llvm-project/clang/test/Lexer/cxx2a-spaceship.cpp
index 604575e..2163a0b 100644
--- a/src/llvm-project/clang/test/Lexer/cxx2a-spaceship.cpp
+++ b/src/llvm-project/clang/test/Lexer/cxx2a-spaceship.cpp
@@ -1,9 +1,9 @@
// RUN: %clang_cc1 -std=c++17 %s -verify
-// RUN: %clang_cc1 -std=c++2a %s -verify
-// RUN: %clang_cc1 -std=c++2a %s -verify -Wc++17-compat -DCOMPAT
+// RUN: %clang_cc1 -std=c++20 %s -verify
+// RUN: %clang_cc1 -std=c++20 %s -verify -Wc++17-compat -DCOMPAT
//
// RUN: %clang_cc1 -std=c++17 %s -E -o - | FileCheck %s --check-prefix=CXX17
-// RUN: %clang_cc1 -std=c++2a %s -E -o - | FileCheck %s --check-prefix=CXX20
+// RUN: %clang_cc1 -std=c++20 %s -E -o - | FileCheck %s --check-prefix=CXX20
namespace N {
@@ -12,19 +12,19 @@
#if __cplusplus > 201703L
void operator<=>(A, A);
#ifdef COMPAT
-// expected-warning@-2 {{'<=>' operator is incompatible with C++ standards before C++2a}}
+// expected-warning@-2 {{'<=>' operator is incompatible with C++ standards before C++20}}
#endif
#endif
template<auto> struct X {};
X<operator<=>
#if __cplusplus <= 201703L
- // expected-warning@-2 {{'<=>' is a single token in C++2a; add a space to avoid a change in behavior}}
+ // expected-warning@-2 {{'<=>' is a single token in C++20; add a space to avoid a change in behavior}}
#else
>
#endif
#ifdef COMPAT
-// expected-warning@-7 {{'<=>' operator is incompatible with C++ standards before C++2a}}
+// expected-warning@-7 {{'<=>' operator is incompatible with C++ standards before C++20}}
#endif
x;
}
diff --git a/src/llvm-project/clang/test/Lexer/cxx2a_keyword_as_cxx17.cpp b/src/llvm-project/clang/test/Lexer/cxx2a_keyword_as_cxx17.cpp
index d2ed7d3..ec42e21 100644
--- a/src/llvm-project/clang/test/Lexer/cxx2a_keyword_as_cxx17.cpp
+++ b/src/llvm-project/clang/test/Lexer/cxx2a_keyword_as_cxx17.cpp
@@ -1,13 +1,15 @@
-// RUN: %clang_cc1 %s -verify -fsyntax-only -Wc++2a-compat -std=c++17
+// RUN: %clang_cc1 %s -verify -fsyntax-only -Wc++20-compat -std=c++17
#define concept constexpr bool
template<typename T>
concept x = 0;
#undef concept
-int co_await = 0; // expected-warning {{'co_await' is a keyword in C++2a}}
-int co_return = 0; // expected-warning {{'co_return' is a keyword in C++2a}}
-int co_yield = 0; // expected-warning {{'co_yield' is a keyword in C++2a}}
-int char8_t = 0; // expected-warning {{'char8_t' is a keyword in C++2a}}
-int concept = 0; // expected-warning {{'concept' is a keyword in C++2a}}
-int requires = 0; // expected-warning {{'requires' is a keyword in C++2a}}
+int co_await = 0; // expected-warning {{'co_await' is a keyword in C++20}}
+int co_return = 0; // expected-warning {{'co_return' is a keyword in C++20}}
+int co_yield = 0; // expected-warning {{'co_yield' is a keyword in C++20}}
+int char8_t = 0; // expected-warning {{'char8_t' is a keyword in C++20}}
+int concept = 0; // expected-warning {{'concept' is a keyword in C++20}}
+int requires = 0; // expected-warning {{'requires' is a keyword in C++20}}
+int consteval = 0; // expected-warning {{'consteval' is a keyword in C++20}}
+int constinit = 0; // expected-warning {{'constinit' is a keyword in C++20}}
diff --git a/src/llvm-project/clang/test/Lexer/has_feature_leak_sanitizer.cpp b/src/llvm-project/clang/test/Lexer/has_feature_leak_sanitizer.cpp
new file mode 100644
index 0000000..00ca96f
--- /dev/null
+++ b/src/llvm-project/clang/test/Lexer/has_feature_leak_sanitizer.cpp
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -E -fsanitize=leak %s -o - | FileCheck --check-prefix=CHECK-LSAN %s
+// RUN: %clang_cc1 -E %s -o - | FileCheck --check-prefix=CHECK-NO-LSAN %s
+
+#if __has_feature(leak_sanitizer)
+int LeakSanitizerEnabled();
+#else
+int LeakSanitizerDisabled();
+#endif
+
+// CHECK-LSAN: LeakSanitizerEnabled
+// CHECK-NO-LSAN: LeakSanitizerDisabled
diff --git a/src/llvm-project/clang/test/Lexer/keywords_test.cpp b/src/llvm-project/clang/test/Lexer/keywords_test.cpp
index 4c6ccca..952d7041f 100644
--- a/src/llvm-project/clang/test/Lexer/keywords_test.cpp
+++ b/src/llvm-project/clang/test/Lexer/keywords_test.cpp
@@ -1,6 +1,5 @@
// RUN: %clang_cc1 -std=c++03 -fsyntax-only %s
// RUN: %clang_cc1 -std=c++11 -DCXX11 -fsyntax-only %s
-// RUN: %clang_cc1 -std=c++14 -fconcepts-ts -DCXX11 -DCONCEPTS -fsyntax-only %s
// RUN: %clang_cc1 -std=c++2a -DCXX11 -DCXX2A -fsyntax-only %s
// RUN: %clang_cc1 -std=c++03 -fdeclspec -DDECLSPEC -fsyntax-only %s
// RUN: %clang_cc1 -std=c++03 -fms-extensions -DDECLSPEC -fsyntax-only %s
@@ -20,7 +19,7 @@
#define NOT_KEYWORD(NAME) _Static_assert(__is_identifier(NAME), #NAME)
#define IS_TYPE(NAME) void is_##NAME##_type() { int f(NAME); }
-#if defined(CONCEPTS) || defined(CXX2A)
+#if defined(CXX2A)
#define CONCEPTS_KEYWORD(NAME) IS_KEYWORD(NAME)
#else
#define CONCEPTS_KEYWORD(NAME) NOT_KEYWORD(NAME)
@@ -59,7 +58,7 @@
#endif
CXX11_KEYWORD(thread_local);
-// Concepts TS keywords
+// Concepts keywords
CONCEPTS_KEYWORD(concept);
CONCEPTS_KEYWORD(requires);
diff --git a/src/llvm-project/clang/test/Lexer/minimize_source_to_dependency_directives_include.c b/src/llvm-project/clang/test/Lexer/minimize_source_to_dependency_directives_include.c
new file mode 100644
index 0000000..678753d
--- /dev/null
+++ b/src/llvm-project/clang/test/Lexer/minimize_source_to_dependency_directives_include.c
@@ -0,0 +1,8 @@
+// Test double slashes in #include directive along with angle brackets. Previously, this was interpreted as comments.
+// RUN: %clang_cc1 -DTEST -print-dependency-directives-minimized-source %s 2>&1 | FileCheck %s
+
+#include "a//b.h"
+#include <a//b.h>
+
+// CHECK: #include "a//b.h"
+// CHECK: #include <a//b.h>
diff --git a/src/llvm-project/clang/test/Lexer/minimize_source_to_dependency_directives_invalid_error.c b/src/llvm-project/clang/test/Lexer/minimize_source_to_dependency_directives_invalid_error.c
new file mode 100644
index 0000000..020912a
--- /dev/null
+++ b/src/llvm-project/clang/test/Lexer/minimize_source_to_dependency_directives_invalid_error.c
@@ -0,0 +1,16 @@
+// Test CF+LF are properly handled along with quoted, multi-line #error
+// RUN: %clang_cc1 -DOTHER -print-dependency-directives-minimized-source %s 2>&1 | FileCheck %s
+
+#ifndef TEST
+#error "message \
+ more message \
+ even more"
+#endif
+
+#ifdef OTHER
+#include <string>
+#endif
+
+// CHECK: #ifdef OTHER
+// CHECK-NEXT: #include <string>
+// CHECK-NEXT: #endif
diff --git a/src/llvm-project/clang/test/Lexer/minimize_source_to_dependency_directives_utf8bom.c b/src/llvm-project/clang/test/Lexer/minimize_source_to_dependency_directives_utf8bom.c
new file mode 100644
index 0000000..305442f
--- /dev/null
+++ b/src/llvm-project/clang/test/Lexer/minimize_source_to_dependency_directives_utf8bom.c
@@ -0,0 +1,10 @@
+// Test UTF8 BOM at start of file
+// RUN: printf '\xef\xbb\xbf' > %t.c
+// RUN: echo '#ifdef TEST\n' >> %t.c
+// RUN: echo '#include <string>' >> %t.c
+// RUN: echo '#endif' >> %t.c
+// RUN: %clang_cc1 -DTEST -print-dependency-directives-minimized-source %t.c 2>&1 | FileCheck %s
+
+// CHECK: #ifdef TEST
+// CHECK-NEXT: #include <string>
+// CHECK-NEXT: #endif
diff --git a/src/llvm-project/clang/test/Misc/Inputs/serialized-diags-stable.dia b/src/llvm-project/clang/test/Misc/Inputs/serialized-diags-stable.dia
index acdaad2..1637284 100644
--- a/src/llvm-project/clang/test/Misc/Inputs/serialized-diags-stable.dia
+++ b/src/llvm-project/clang/test/Misc/Inputs/serialized-diags-stable.dia
Binary files differ
diff --git a/src/llvm-project/clang/test/Misc/diag-macro-backtrace2.c b/src/llvm-project/clang/test/Misc/diag-macro-backtrace2.c
index 64fc5f6..ca13dca 100644
--- a/src/llvm-project/clang/test/Misc/diag-macro-backtrace2.c
+++ b/src/llvm-project/clang/test/Misc/diag-macro-backtrace2.c
@@ -1,4 +1,4 @@
-// RUN: not %clang -cc1 -fsyntax-only %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -fsyntax-only %s 2>&1 | FileCheck %s
#define a b
#define b c
diff --git a/src/llvm-project/clang/test/Misc/driver-verify.c b/src/llvm-project/clang/test/Misc/driver-verify.c
index fa31f82..f858a3d 100644
--- a/src/llvm-project/clang/test/Misc/driver-verify.c
+++ b/src/llvm-project/clang/test/Misc/driver-verify.c
@@ -1,5 +1,5 @@
// RUN: not %clang -verify %s 2>&1 | FileCheck %s
-// RUN: %clang -cc1 -verify %s
+// RUN: %clang_cc1 -verify %s
// expected-no-diagnostics
// Test that -verify is strictly rejected as unknown by the driver.
diff --git a/src/llvm-project/clang/test/Misc/loop-opt-setup.c b/src/llvm-project/clang/test/Misc/loop-opt-setup.c
new file mode 100644
index 0000000..f283e80
--- /dev/null
+++ b/src/llvm-project/clang/test/Misc/loop-opt-setup.c
@@ -0,0 +1,12 @@
+// RUN: %clang -O1 -fexperimental-new-pass-manager -fno-unroll-loops -S -o - %s -emit-llvm | FileCheck %s
+// RUN: %clang -O1 -fno-experimental-new-pass-manager -fno-unroll-loops -S -o - %s -emit-llvm | FileCheck %s
+extern int a[16];
+int b = 0;
+int foo(void) {
+#pragma unroll
+ for (int i = 0; i < 16; ++i)
+ a[i] = b += 2;
+ return b;
+}
+// CHECK-NOT: br i1
+
diff --git a/src/llvm-project/clang/test/Misc/permissions.cpp b/src/llvm-project/clang/test/Misc/permissions.cpp
deleted file mode 100644
index 83f6c57..0000000
--- a/src/llvm-project/clang/test/Misc/permissions.cpp
+++ /dev/null
@@ -1,11 +0,0 @@
-// REQUIRES: shell
-
-// 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/src/llvm-project/clang/test/Misc/pragma-attribute-cxx.cpp b/src/llvm-project/clang/test/Misc/pragma-attribute-cxx.cpp
index a8a3bde..38b025e 100644
--- a/src/llvm-project/clang/test/Misc/pragma-attribute-cxx.cpp
+++ b/src/llvm-project/clang/test/Misc/pragma-attribute-cxx.cpp
@@ -87,14 +87,14 @@
int testCI1 = 1;
// CHECK-LABEL: VarDecl{{.*}} testCI1
// CHECK-NEXT: IntegerLiteral
-// CHECK-NEXT: RequireConstantInitAttr
+// CHECK-NEXT: ConstInitAttr
#pragma clang attribute pop
int testNoCI = 0;
// CHECK-LABEL: VarDecl{{.*}} testNoCI
// CHECK-NEXT: IntegerLiteral
-// CHECK-NOT: RequireConstantInitAttr
+// CHECK-NOT: ConstInitAttr
// Check support for CXX11 style attributes
#pragma clang attribute push ([[noreturn]], apply_to = function)
diff --git a/src/llvm-project/clang/test/Misc/pragma-attribute-supported-attributes-list.test b/src/llvm-project/clang/test/Misc/pragma-attribute-supported-attributes-list.test
index fc9d86e..76401ef 100644
--- a/src/llvm-project/clang/test/Misc/pragma-attribute-supported-attributes-list.test
+++ b/src/llvm-project/clang/test/Misc/pragma-attribute-supported-attributes-list.test
@@ -9,6 +9,7 @@
// CHECK-NEXT: AMDGPUWavesPerEU (SubjectMatchRule_function)
// CHECK-NEXT: AVRSignal (SubjectMatchRule_function)
// CHECK-NEXT: AbiTag (SubjectMatchRule_record_not_is_union, SubjectMatchRule_variable, SubjectMatchRule_function, SubjectMatchRule_namespace)
+// CHECK-NEXT: AcquireHandle (SubjectMatchRule_function, SubjectMatchRule_type_alias, SubjectMatchRule_variable_is_parameter)
// CHECK-NEXT: Alias (SubjectMatchRule_function, SubjectMatchRule_variable_is_global)
// CHECK-NEXT: AlignValue (SubjectMatchRule_variable, SubjectMatchRule_type_alias)
// CHECK-NEXT: AllocSize (SubjectMatchRule_function)
@@ -17,10 +18,13 @@
// CHECK-NEXT: Annotate ()
// CHECK-NEXT: AnyX86NoCfCheck (SubjectMatchRule_hasType_functionType)
// CHECK-NEXT: ArcWeakrefUnavailable (SubjectMatchRule_objc_interface)
+// CHECK-NEXT: ArmMveAlias (SubjectMatchRule_function)
// CHECK-NEXT: AssumeAligned (SubjectMatchRule_objc_method, SubjectMatchRule_function)
// CHECK-NEXT: Availability ((SubjectMatchRule_record, SubjectMatchRule_enum, SubjectMatchRule_enum_constant, SubjectMatchRule_field, SubjectMatchRule_function, SubjectMatchRule_namespace, SubjectMatchRule_objc_category, SubjectMatchRule_objc_implementation, SubjectMatchRule_objc_interface, SubjectMatchRule_objc_method, SubjectMatchRule_objc_property, SubjectMatchRule_objc_protocol, SubjectMatchRule_record, SubjectMatchRule_type_alias, SubjectMatchRule_variable))
+// CHECK-NEXT: BPFPreserveAccessIndex (SubjectMatchRule_record)
// CHECK-NEXT: CFAuditedTransfer (SubjectMatchRule_function)
// CHECK-NEXT: CFConsumed (SubjectMatchRule_variable_is_parameter)
+// CHECK-NEXT: CFICanonicalJumpTable (SubjectMatchRule_function)
// CHECK-NEXT: CFUnknownTransfer (SubjectMatchRule_function)
// CHECK-NEXT: CPUDispatch (SubjectMatchRule_function)
// CHECK-NEXT: CPUSpecific (SubjectMatchRule_function)
@@ -37,6 +41,7 @@
// CHECK-NEXT: CarriesDependency (SubjectMatchRule_variable_is_parameter, SubjectMatchRule_objc_method, SubjectMatchRule_function)
// CHECK-NEXT: Cold (SubjectMatchRule_function)
// CHECK-NEXT: Common (SubjectMatchRule_variable)
+// CHECK-NEXT: ConstInit (SubjectMatchRule_variable_is_global)
// CHECK-NEXT: Constructor (SubjectMatchRule_function)
// CHECK-NEXT: Consumable (SubjectMatchRule_record)
// CHECK-NEXT: ConsumableAutoCast (SubjectMatchRule_record)
@@ -72,6 +77,7 @@
// CHECK-NEXT: NSConsumed (SubjectMatchRule_variable_is_parameter)
// CHECK-NEXT: NSConsumesSelf (SubjectMatchRule_objc_method)
// CHECK-NEXT: Naked (SubjectMatchRule_function)
+// CHECK-NEXT: NoBuiltin (SubjectMatchRule_function)
// CHECK-NEXT: NoCommon (SubjectMatchRule_variable)
// CHECK-NEXT: NoDebug (SubjectMatchRule_type_alias, SubjectMatchRule_hasType_functionType, SubjectMatchRule_objc_method, SubjectMatchRule_variable_not_is_parameter)
// CHECK-NEXT: NoDestroy (SubjectMatchRule_variable)
@@ -100,6 +106,8 @@
// CHECK-NEXT: ObjCBridgeRelated (SubjectMatchRule_record)
// CHECK-NEXT: ObjCClassStub (SubjectMatchRule_objc_interface)
// CHECK-NEXT: ObjCDesignatedInitializer (SubjectMatchRule_objc_method)
+// CHECK-NEXT: ObjCDirect (SubjectMatchRule_objc_method)
+// CHECK-NEXT: ObjCDirectMembers (SubjectMatchRule_objc_implementation, SubjectMatchRule_objc_category)
// CHECK-NEXT: ObjCException (SubjectMatchRule_objc_interface)
// CHECK-NEXT: ObjCExplicitProtocolImpl (SubjectMatchRule_objc_protocol)
// CHECK-NEXT: ObjCExternallyRetained (SubjectMatchRule_variable_not_is_parameter, SubjectMatchRule_function, SubjectMatchRule_block, SubjectMatchRule_objc_method)
@@ -117,11 +125,14 @@
// CHECK-NEXT: OpenCLNoSVM (SubjectMatchRule_variable)
// CHECK-NEXT: OptimizeNone (SubjectMatchRule_function, SubjectMatchRule_objc_method)
// CHECK-NEXT: Overloadable (SubjectMatchRule_function)
+// CHECK-NEXT: Owner (SubjectMatchRule_record_not_is_union)
// CHECK-NEXT: ParamTypestate (SubjectMatchRule_variable_is_parameter)
// CHECK-NEXT: PassObjectSize (SubjectMatchRule_variable_is_parameter)
+// CHECK-NEXT: PatchableFunctionEntry (SubjectMatchRule_function, SubjectMatchRule_objc_method)
+// CHECK-NEXT: Pointer (SubjectMatchRule_record_not_is_union)
+// CHECK-NEXT: ReleaseHandle (SubjectMatchRule_variable_is_parameter)
// CHECK-NEXT: RenderScriptKernel (SubjectMatchRule_function)
// CHECK-NEXT: ReqdWorkGroupSize (SubjectMatchRule_function)
-// CHECK-NEXT: RequireConstantInit (SubjectMatchRule_variable_is_global)
// CHECK-NEXT: Restrict (SubjectMatchRule_function)
// CHECK-NEXT: ReturnTypestate (SubjectMatchRule_function, SubjectMatchRule_variable_is_parameter)
// CHECK-NEXT: ReturnsNonNull (SubjectMatchRule_objc_method, SubjectMatchRule_function)
@@ -137,12 +148,14 @@
// CHECK-NEXT: Target (SubjectMatchRule_function)
// CHECK-NEXT: TestTypestate (SubjectMatchRule_function_is_member)
// CHECK-NEXT: TrivialABI (SubjectMatchRule_record)
+// CHECK-NEXT: UseHandle (SubjectMatchRule_variable_is_parameter)
// CHECK-NEXT: VecReturn (SubjectMatchRule_record)
// CHECK-NEXT: VecTypeHint (SubjectMatchRule_function)
// CHECK-NEXT: WarnUnused (SubjectMatchRule_record)
// CHECK-NEXT: WarnUnusedResult (SubjectMatchRule_objc_method, SubjectMatchRule_enum, SubjectMatchRule_record, SubjectMatchRule_hasType_functionType)
// CHECK-NEXT: Weak (SubjectMatchRule_variable, SubjectMatchRule_function, SubjectMatchRule_record)
// CHECK-NEXT: WeakRef (SubjectMatchRule_variable, SubjectMatchRule_function)
+// CHECK-NEXT: WebAssemblyExportName (SubjectMatchRule_function)
// CHECK-NEXT: WebAssemblyImportModule (SubjectMatchRule_function)
// CHECK-NEXT: WebAssemblyImportName (SubjectMatchRule_function)
// CHECK-NEXT: WorkGroupSizeHint (SubjectMatchRule_function)
diff --git a/src/llvm-project/clang/test/Misc/printer.c b/src/llvm-project/clang/test/Misc/printer.c
new file mode 100644
index 0000000..085e02c
--- /dev/null
+++ b/src/llvm-project/clang/test/Misc/printer.c
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 -emit-llvm -fexperimental-new-pass-manager -mllvm -print-before-all %s -o %t 2>&1 | FileCheck %s --check-prefix=CHECK-BEFORE
+// RUN: %clang_cc1 -emit-llvm -fexperimental-new-pass-manager -mllvm -print-after-all %s -o %t 2>&1 | FileCheck %s --check-prefix=CHECK-AFTER
+// CHECK-BEFORE: *** IR Dump Before AlwaysInlinerPass ***
+// CHECK-AFTER: *** IR Dump After AlwaysInlinerPass ***
+void foo() {}
diff --git a/src/llvm-project/clang/test/Misc/serialized-diags-stable.c b/src/llvm-project/clang/test/Misc/serialized-diags-stable.c
index 4bd4c99..e05e3f0 100644
--- a/src/llvm-project/clang/test/Misc/serialized-diags-stable.c
+++ b/src/llvm-project/clang/test/Misc/serialized-diags-stable.c
@@ -5,7 +5,7 @@
// RUN: c-index-test -read-diagnostics %S/Inputs/serialized-diags-stable.dia 2>&1 | FileCheck %s
int foo() {
- // CHECK: serialized-diags-stable.c:[[@LINE+2]]:1: warning: control reaches end of non-void function [-Wreturn-type] [Semantic Issue]
+ // CHECK: serialized-diags-stable.c:[[@LINE+2]]:1: warning: non-void function does not return a value [-Wreturn-type] [Semantic Issue]
// CHECK-NEXT: Number FIXITs = 0
}
diff --git a/src/llvm-project/clang/test/Misc/target-invalid-cpu-note.c b/src/llvm-project/clang/test/Misc/target-invalid-cpu-note.c
index 2831aae..9f036c9 100644
--- a/src/llvm-project/clang/test/Misc/target-invalid-cpu-note.c
+++ b/src/llvm-project/clang/test/Misc/target-invalid-cpu-note.c
@@ -16,7 +16,7 @@
// X86-SAME: nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont,
// X86-SAME: nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge,
// X86-SAME: core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512,
-// X86-SAME: skx, cascadelake, cooperlake, cannonlake, icelake-client, icelake-server, knl, knm, lakemont, k6, k6-2, k6-3,
+// X86-SAME: skx, cascadelake, cooperlake, cannonlake, icelake-client, icelake-server, tigerlake, knl, knm, lakemont, k6, k6-2, k6-3,
// X86-SAME: athlon, athlon-tbird, athlon-xp, athlon-mp, athlon-4, k8, athlon64,
// X86-SAME: athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10,
// X86-SAME: barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2,
@@ -28,7 +28,7 @@
// X86_64-SAME: atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere,
// X86_64-SAME: sandybridge, corei7-avx, ivybridge, core-avx-i, haswell,
// X86_64-SAME: core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cooperlake, cannonlake,
-// X86_64-SAME: icelake-client, icelake-server, knl, knm, k8, athlon64, athlon-fx, opteron, k8-sse3,
+// X86_64-SAME: icelake-client, icelake-server, tigerlake, knl, knm, k8, athlon64, athlon-fx, opteron, k8-sse3,
// X86_64-SAME: athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1,
// X86_64-SAME: btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, x86-64
@@ -60,7 +60,7 @@
// RUN: not %clang_cc1 -triple systemz--- -target-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix SYSTEMZ
// SYSTEMZ: error: unknown target CPU 'not-a-cpu'
// SYSTEMZ: note: valid target CPU values are: arch8, z10, arch9, z196, arch10,
-// SYSTEMZ-SAME: zEC12, arch11, z13, arch12, z14, arch13
+// SYSTEMZ-SAME: zEC12, arch11, z13, arch12, z14, arch13, z15
// RUN: not %clang_cc1 -triple sparc--- -target-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix SPARC
// SPARC: error: unknown target CPU 'not-a-cpu'
@@ -79,16 +79,16 @@
// PPC: error: unknown target CPU 'not-a-cpu'
// PPC: note: valid target CPU values are: generic, 440, 450, 601, 602, 603,
// PPC-SAME: 603e, 603ev, 604, 604e, 620, 630, g3, 7400, g4, 7450, g4+, 750,
-// PPC-SAME: 970, g5, a2, a2q, e500mc, e5500, power3, pwr3, power4, pwr4,
-// PPC-SAME: power5, pwr5, power5x, pwr5x, power6, pwr6, power6x, pwr6x, power7,
-// PPC-SAME: pwr7, power8, pwr8, power9, pwr9, powerpc, ppc, powerpc64, ppc64,
-// PPC-SAME: powerpc64le, ppc64le
+// PPC-SAME: 8548, 970, g5, a2, a2q, e500, e500mc, e5500, power3, pwr3, power4,
+// PPC-SAME: pwr4, power5, pwr5, power5x, pwr5x, power6, pwr6, power6x, pwr6x,
+// PPC-SAME: power7, pwr7, power8, pwr8, power9, pwr9, powerpc, ppc, powerpc64,
+// PPC-SAME: ppc64, powerpc64le, ppc64le, future
// RUN: not %clang_cc1 -triple mips--- -target-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix MIPS
// MIPS: error: unknown target CPU 'not-a-cpu'
// MIPS: note: valid target CPU values are: mips1, mips2, mips3, mips4, mips5,
// MIPS-SAME: mips32, mips32r2, mips32r3, mips32r5, mips32r6, mips64, mips64r2,
-// MIPS-SAME: mips64r3, mips64r5, mips64r6, octeon, p5600
+// MIPS-SAME: mips64r3, mips64r5, mips64r6, octeon, octeon+, p5600
// RUN: not %clang_cc1 -triple lanai--- -target-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix LANAI
// LANAI: error: unknown target CPU 'not-a-cpu'
diff --git a/src/llvm-project/clang/test/Misc/warning-flags.c b/src/llvm-project/clang/test/Misc/warning-flags.c
index 81d332c..05172b2 100644
--- a/src/llvm-project/clang/test/Misc/warning-flags.c
+++ b/src/llvm-project/clang/test/Misc/warning-flags.c
@@ -96,4 +96,4 @@
The list of warnings in -Wpedantic should NEVER grow.
-CHECK: Number in -Wpedantic (not covered by other -W flags): 28
+CHECK: Number in -Wpedantic (not covered by other -W flags): 27
diff --git a/src/llvm-project/clang/test/Misc/warning-wall.c b/src/llvm-project/clang/test/Misc/warning-wall.c
new file mode 100644
index 0000000..737ed76
--- /dev/null
+++ b/src/llvm-project/clang/test/Misc/warning-wall.c
@@ -0,0 +1,97 @@
+RUN: diagtool tree -Wall > %t 2>&1
+RUN: FileCheck --input-file=%t %s
+
+ CHECK:-Wall
+CHECK-NEXT: -Wmost
+CHECK-NEXT: -Wchar-subscripts
+CHECK-NEXT: -Wcomment
+CHECK-NEXT: -Wdelete-non-virtual-dtor
+CHECK-NEXT: -Wdelete-non-abstract-non-virtual-dtor
+CHECK-NEXT: -Wdelete-abstract-non-virtual-dtor
+CHECK-NEXT: -Wformat
+CHECK-NEXT: -Wformat-extra-args
+CHECK-NEXT: -Wformat-zero-length
+CHECK-NEXT: -Wnonnull
+CHECK-NEXT: -Wformat-security
+CHECK-NEXT: -Wformat-y2k
+CHECK-NEXT: -Wformat-invalid-specifier
+CHECK-NEXT: -Wfor-loop-analysis
+CHECK-NEXT: -Wimplicit
+CHECK-NEXT: -Wimplicit-function-declaration
+CHECK-NEXT: -Wimplicit-int
+CHECK-NEXT: -Winfinite-recursion
+CHECK-NEXT: -Wint-in-bool-context
+CHECK-NEXT: -Wmismatched-tags
+CHECK-NEXT: -Wmissing-braces
+CHECK-NEXT: -Wmove
+CHECK-NEXT: -Wpessimizing-move
+CHECK-NEXT: -Wredundant-move
+CHECK-NEXT: -Wreturn-std-move
+CHECK-NEXT: -Wself-move
+CHECK-NEXT: -Wmultichar
+CHECK-NEXT: -Wrange-loop-construct
+CHECK-NEXT: -Wreorder
+CHECK-NEXT: -Wreorder-ctor
+CHECK-NEXT: -Wreorder-init-list
+CHECK-NEXT: -Wreturn-type
+CHECK-NEXT: -Wreturn-type-c-linkage
+CHECK-NEXT: -Wself-assign
+CHECK-NEXT: -Wself-assign-overloaded
+CHECK-NEXT: -Wself-assign-field
+CHECK-NEXT: -Wself-move
+CHECK-NEXT: -Wsizeof-array-argument
+CHECK-NEXT: -Wsizeof-array-decay
+CHECK-NEXT: -Wstring-plus-int
+CHECK-NEXT: -Wtautological-compare
+CHECK-NEXT: -Wtautological-constant-compare
+CHECK-NEXT: -Wtautological-constant-out-of-range-compare
+CHECK-NEXT: -Wtautological-pointer-compare
+CHECK-NEXT: -Wtautological-overlap-compare
+CHECK-NEXT: -Wtautological-bitwise-compare
+CHECK-NEXT: -Wtautological-undefined-compare
+CHECK-NEXT: -Wtautological-objc-bool-compare
+CHECK-NEXT: -Wtrigraphs
+CHECK-NEXT: -Wuninitialized
+CHECK-NEXT: -Wsometimes-uninitialized
+CHECK-NEXT: -Wstatic-self-init
+CHECK-NEXT: -Wunknown-pragmas
+CHECK-NEXT: -Wunused
+CHECK-NEXT: -Wunused-argument
+CHECK-NEXT: -Wunused-function
+CHECK-NEXT: -Wunneeded-internal-declaration
+CHECK-NEXT: -Wunused-label
+CHECK-NEXT: -Wunused-private-field
+CHECK-NEXT: -Wunused-lambda-capture
+CHECK-NEXT: -Wunused-local-typedef
+CHECK-NEXT: -Wunused-value
+CHECK-NEXT: -Wunused-comparison
+CHECK-NEXT: -Wunused-result
+CHECK-NEXT: -Wunevaluated-expression
+CHECK-NEXT: -Wpotentially-evaluated-expression
+CHECK-NEXT: -Wunused-variable
+CHECK-NEXT: -Wunused-const-variable
+CHECK-NEXT: -Wunused-property-ivar
+CHECK-NEXT: -Wvolatile-register-var
+CHECK-NEXT: -Wobjc-missing-super-calls
+CHECK-NEXT: -Wobjc-designated-initializers
+CHECK-NEXT: -Wobjc-flexible-array
+CHECK-NEXT: -Woverloaded-virtual
+CHECK-NEXT: -Wprivate-extern
+CHECK-NEXT: -Wcast-of-sel-type
+CHECK-NEXT: -Wextern-c-compat
+CHECK-NEXT: -Wuser-defined-warnings
+CHECK-NEXT: -Wparentheses
+CHECK-NEXT: -Wlogical-op-parentheses
+CHECK-NEXT: -Wlogical-not-parentheses
+CHECK-NEXT: -Wbitwise-conditional-parentheses
+CHECK-NEXT: -Wbitwise-op-parentheses
+CHECK-NEXT: -Wshift-op-parentheses
+CHECK-NEXT: -Woverloaded-shift-op-parentheses
+CHECK-NEXT: -Wparentheses-equality
+CHECK-NEXT: -Wdangling-else
+CHECK-NEXT: -Wswitch
+CHECK-NEXT: -Wswitch-bool
+CHECK-NEXT: -Wmisleading-indentation
+
+
+CHECK-NOT:-W
diff --git a/src/llvm-project/clang/test/Misc/win32-macho.c b/src/llvm-project/clang/test/Misc/win32-macho.c
index 517bde9..1eab538 100644
--- a/src/llvm-project/clang/test/Misc/win32-macho.c
+++ b/src/llvm-project/clang/test/Misc/win32-macho.c
@@ -1,2 +1,5 @@
// Check that basic use of win32-macho targets works.
// RUN: %clang -fsyntax-only -target x86_64-pc-win32-macho %s
+
+// RUN: %clang -fsyntax-only -target x86_64-pc-win32-macho -g %s -### 2>&1 | FileCheck %s -check-prefix=DEBUG-INFO
+// DEBUG-INFO: -dwarf-version={{.*}}
diff --git a/src/llvm-project/clang/test/Modules/Inputs/codegen-extern-template.modulemap b/src/llvm-project/clang/test/Modules/Inputs/codegen-extern-template.modulemap
new file mode 100644
index 0000000..8583c65
--- /dev/null
+++ b/src/llvm-project/clang/test/Modules/Inputs/codegen-extern-template.modulemap
@@ -0,0 +1 @@
+module foo { header "../codegen-extern-template.h" }
diff --git a/src/llvm-project/clang/test/Modules/Inputs/implicit-invalidate-common/A.h b/src/llvm-project/clang/test/Modules/Inputs/implicit-invalidate-common/A.h
new file mode 100644
index 0000000..7ad7e6b
--- /dev/null
+++ b/src/llvm-project/clang/test/Modules/Inputs/implicit-invalidate-common/A.h
@@ -0,0 +1,2 @@
+// A
+#include "Common.h"
diff --git a/src/llvm-project/clang/test/Modules/Inputs/implicit-invalidate-common/B.h b/src/llvm-project/clang/test/Modules/Inputs/implicit-invalidate-common/B.h
new file mode 100644
index 0000000..2952dcb
--- /dev/null
+++ b/src/llvm-project/clang/test/Modules/Inputs/implicit-invalidate-common/B.h
@@ -0,0 +1,2 @@
+// B
+#include "Common.h"
diff --git a/src/llvm-project/clang/test/Modules/Inputs/implicit-invalidate-common/Common.h b/src/llvm-project/clang/test/Modules/Inputs/implicit-invalidate-common/Common.h
new file mode 100644
index 0000000..01419c7
--- /dev/null
+++ b/src/llvm-project/clang/test/Modules/Inputs/implicit-invalidate-common/Common.h
@@ -0,0 +1 @@
+// Common
diff --git a/src/llvm-project/clang/test/Modules/Inputs/implicit-invalidate-common/module.modulemap b/src/llvm-project/clang/test/Modules/Inputs/implicit-invalidate-common/module.modulemap
new file mode 100644
index 0000000..97c674a
--- /dev/null
+++ b/src/llvm-project/clang/test/Modules/Inputs/implicit-invalidate-common/module.modulemap
@@ -0,0 +1,3 @@
+module A { header "A.h" }
+module B { header "B.h" }
+module Common { header "Common.h" }
diff --git a/src/llvm-project/clang/test/Modules/Inputs/interface-diagnose-missing-import/Foo.framework/Headers/Bar.h b/src/llvm-project/clang/test/Modules/Inputs/interface-diagnose-missing-import/Foo.framework/Headers/Bar.h
new file mode 100644
index 0000000..3ce482e
--- /dev/null
+++ b/src/llvm-project/clang/test/Modules/Inputs/interface-diagnose-missing-import/Foo.framework/Headers/Bar.h
@@ -0,0 +1 @@
+// interface-diagnose-missing-import/Foo.framework/Headers/Bar.h
diff --git a/src/llvm-project/clang/test/Modules/Inputs/interface-diagnose-missing-import/Foo.framework/Headers/Foo.h b/src/llvm-project/clang/test/Modules/Inputs/interface-diagnose-missing-import/Foo.framework/Headers/Foo.h
new file mode 100644
index 0000000..c9c4098
--- /dev/null
+++ b/src/llvm-project/clang/test/Modules/Inputs/interface-diagnose-missing-import/Foo.framework/Headers/Foo.h
@@ -0,0 +1,2 @@
+#import <Foo/RandoPriv.h>
+#import <Foo/Bar.h>
diff --git a/src/llvm-project/clang/test/Modules/Inputs/interface-diagnose-missing-import/Foo.framework/Modules/module.modulemap b/src/llvm-project/clang/test/Modules/Inputs/interface-diagnose-missing-import/Foo.framework/Modules/module.modulemap
new file mode 100644
index 0000000..ebb4fa6
--- /dev/null
+++ b/src/llvm-project/clang/test/Modules/Inputs/interface-diagnose-missing-import/Foo.framework/Modules/module.modulemap
@@ -0,0 +1,6 @@
+// interface-diagnose-missing-import/Foo.framework/Modules/module.modulemap
+framework module Foo {
+ umbrella header "Foo.h"
+ export *
+ module * { export * }
+}
diff --git a/src/llvm-project/clang/test/Modules/Inputs/interface-diagnose-missing-import/Foo.framework/PrivateHeaders/RandoPriv.h b/src/llvm-project/clang/test/Modules/Inputs/interface-diagnose-missing-import/Foo.framework/PrivateHeaders/RandoPriv.h
new file mode 100644
index 0000000..3e195fd
--- /dev/null
+++ b/src/llvm-project/clang/test/Modules/Inputs/interface-diagnose-missing-import/Foo.framework/PrivateHeaders/RandoPriv.h
@@ -0,0 +1,4 @@
+@interface NSObject
+@end
+@interface Buggy : NSObject
+@end
diff --git a/src/llvm-project/clang/test/Modules/Inputs/merge-lifetime-extended-temporary/a.h b/src/llvm-project/clang/test/Modules/Inputs/merge-lifetime-extended-temporary/a.h
new file mode 100644
index 0000000..8adab29
--- /dev/null
+++ b/src/llvm-project/clang/test/Modules/Inputs/merge-lifetime-extended-temporary/a.h
@@ -0,0 +1,2 @@
+
+constexpr const int& LETemp = 0;
diff --git a/src/llvm-project/clang/test/Modules/Inputs/merge-lifetime-extended-temporary/b.h b/src/llvm-project/clang/test/Modules/Inputs/merge-lifetime-extended-temporary/b.h
new file mode 100644
index 0000000..2bd1b09
--- /dev/null
+++ b/src/llvm-project/clang/test/Modules/Inputs/merge-lifetime-extended-temporary/b.h
@@ -0,0 +1,4 @@
+
+#include "a.h"
+
+constexpr const int* PtrTemp1 = &LETemp;
diff --git a/src/llvm-project/clang/test/Modules/Inputs/merge-lifetime-extended-temporary/c.h b/src/llvm-project/clang/test/Modules/Inputs/merge-lifetime-extended-temporary/c.h
new file mode 100644
index 0000000..b023eeb
--- /dev/null
+++ b/src/llvm-project/clang/test/Modules/Inputs/merge-lifetime-extended-temporary/c.h
@@ -0,0 +1,4 @@
+
+#include "a.h"
+
+constexpr const int* PtrTemp2 = &LETemp;
diff --git a/src/llvm-project/clang/test/Modules/Inputs/merge-lifetime-extended-temporary/module.modulemap b/src/llvm-project/clang/test/Modules/Inputs/merge-lifetime-extended-temporary/module.modulemap
new file mode 100644
index 0000000..1339d62
--- /dev/null
+++ b/src/llvm-project/clang/test/Modules/Inputs/merge-lifetime-extended-temporary/module.modulemap
@@ -0,0 +1,14 @@
+module "a" {
+ export *
+ header "a.h"
+}
+
+module "b" {
+ export *
+ header "b.h"
+}
+
+module "c" {
+ export *
+ header "c.h"
+}
diff --git a/src/llvm-project/clang/test/Modules/Inputs/module.map b/src/llvm-project/clang/test/Modules/Inputs/module.map
index 3f128c0..ed220e6 100644
--- a/src/llvm-project/clang/test/Modules/Inputs/module.map
+++ b/src/llvm-project/clang/test/Modules/Inputs/module.map
@@ -193,6 +193,10 @@
header "weird_objc.h"
}
+module objc_type_param {
+ header "objc_type_param.h"
+}
+
module ignored_macros {
header "ignored_macros.h"
}
diff --git a/src/llvm-project/clang/test/Modules/Inputs/objc_type_param.h b/src/llvm-project/clang/test/Modules/Inputs/objc_type_param.h
new file mode 100644
index 0000000..7728b68
--- /dev/null
+++ b/src/llvm-project/clang/test/Modules/Inputs/objc_type_param.h
@@ -0,0 +1,13 @@
+__attribute__((objc_root_class))
+@interface Root {
+ Class isa;
+}
+@end
+
+@interface A<T,U> : Root
+@end
+
+@interface B<T,U> : A<T,U>
+typedef void (*BCallback)(T, U);
++ (id) newWithCallback: (BCallback) callback;
+@end
diff --git a/src/llvm-project/clang/test/Modules/Inputs/rec-types/a.h b/src/llvm-project/clang/test/Modules/Inputs/rec-types/a.h
new file mode 100644
index 0000000..8e88ea7
--- /dev/null
+++ b/src/llvm-project/clang/test/Modules/Inputs/rec-types/a.h
@@ -0,0 +1,2 @@
+// rec-types/a.h
+#include "b.h"
diff --git a/src/llvm-project/clang/test/Modules/Inputs/rec-types/b.h b/src/llvm-project/clang/test/Modules/Inputs/rec-types/b.h
new file mode 100644
index 0000000..05bbd99
--- /dev/null
+++ b/src/llvm-project/clang/test/Modules/Inputs/rec-types/b.h
@@ -0,0 +1,2 @@
+// rec-types/b.h
+#include "c.h"
diff --git a/src/llvm-project/clang/test/Modules/Inputs/rec-types/c.h b/src/llvm-project/clang/test/Modules/Inputs/rec-types/c.h
new file mode 100644
index 0000000..fd2eb5a
--- /dev/null
+++ b/src/llvm-project/clang/test/Modules/Inputs/rec-types/c.h
@@ -0,0 +1,7 @@
+struct some_descriptor
+{
+ // commenting line above make this struct work
+ void *(*thunk)(struct some_descriptor *);
+ unsigned long key;
+};
+
diff --git a/src/llvm-project/clang/test/Modules/Inputs/rec-types/module.modulemap b/src/llvm-project/clang/test/Modules/Inputs/rec-types/module.modulemap
new file mode 100644
index 0000000..680ed71
--- /dev/null
+++ b/src/llvm-project/clang/test/Modules/Inputs/rec-types/module.modulemap
@@ -0,0 +1,9 @@
+module a {
+ header "a.h"
+ // Hide content by not re-exporting module b.
+}
+
+module b {
+ header "b.h"
+ export *
+}
diff --git a/src/llvm-project/clang/test/Modules/ModuleDebugInfo.cpp b/src/llvm-project/clang/test/Modules/ModuleDebugInfo.cpp
index 6fe546f..4013697 100644
--- a/src/llvm-project/clang/test/Modules/ModuleDebugInfo.cpp
+++ b/src/llvm-project/clang/test/Modules/ModuleDebugInfo.cpp
@@ -12,7 +12,7 @@
// PCH:
// RUN: %clang_cc1 -triple %itanium_abi_triple -x c++ -std=c++11 -debugger-tuning=lldb -emit-pch -fmodule-format=obj -I %S/Inputs -o %t.pch %S/Inputs/DebugCXX.h -mllvm -debug-only=pchcontainer &>%t-pch.ll
-// RUN: cat %t-pch.ll | FileCheck %s
+// RUN: cat %t-pch.ll | FileCheck --check-prefix=CHECK-CXX %s
// RUN: cat %t-pch.ll | FileCheck --check-prefix=CHECK-NEG %s
#ifdef MODULES
@@ -23,6 +23,7 @@
// CHECK-MOD: distinct !DICompileUnit(language: DW_LANG_{{.*}}C_plus_plus,
// CHECK: distinct !DICompileUnit(language: DW_LANG_{{.*}}C_plus_plus,
+// CHECK-CXX: distinct !DICompileUnit(language: DW_LANG_C_plus_plus_11,
// CHECK-SAME: isOptimized: false,
// CHECK-NOT: splitDebugFilename:
// CHECK-SAME: dwoId:
diff --git a/src/llvm-project/clang/test/Modules/at-import-in-framework-header.m b/src/llvm-project/clang/test/Modules/at-import-in-framework-header.m
index fe36638..043c694 100644
--- a/src/llvm-project/clang/test/Modules/at-import-in-framework-header.m
+++ b/src/llvm-project/clang/test/Modules/at-import-in-framework-header.m
@@ -1,5 +1,3 @@
-// REQUIRES: shell
-
// RUN: rm -rf %t
// RUN: mkdir %t
diff --git a/src/llvm-project/clang/test/Modules/builtin-import.mm b/src/llvm-project/clang/test/Modules/builtin-import.mm
index cbc312b..8a27cb3 100644
--- a/src/llvm-project/clang/test/Modules/builtin-import.mm
+++ b/src/llvm-project/clang/test/Modules/builtin-import.mm
@@ -1,5 +1,5 @@
// RUN: rm -rf %t
-// RUN: %clang -cc1 -fsyntax-only -nobuiltininc -nostdinc++ -isysroot %S/Inputs/libc-libcxx/sysroot -isystem %S/Inputs/libc-libcxx/sysroot/usr/include/c++/v1 -isystem %S/Inputs/libc-libcxx/sysroot/usr/include -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -x objective-c++ -fmodules-local-submodule-visibility %s
+// RUN: %clang_cc1 -fsyntax-only -nobuiltininc -nostdinc++ -isysroot %S/Inputs/libc-libcxx/sysroot -isystem %S/Inputs/libc-libcxx/sysroot/usr/include/c++/v1 -isystem %S/Inputs/libc-libcxx/sysroot/usr/include -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -x objective-c++ -fmodules-local-submodule-visibility %s
#include <stdio.h>
#include <stddef.h>
diff --git a/src/llvm-project/clang/test/Modules/builtins.m b/src/llvm-project/clang/test/Modules/builtins.m
index 88a44e7..2480e63 100644
--- a/src/llvm-project/clang/test/Modules/builtins.m
+++ b/src/llvm-project/clang/test/Modules/builtins.m
@@ -8,7 +8,6 @@
// RUN: %clang_cc1 -fmodules-cache-path=%t.pch.cache -fmodules -fimplicit-module-maps -I %S/Inputs %s -include-pch %t.pch %s -verify
// expected-no-diagnostics
-// REQUIRES: shell
void use_constant_string_builtins1(void) {
(void)__builtin___CFStringMakeConstantString("");
diff --git a/src/llvm-project/clang/test/Modules/codegen-extern-template.cpp b/src/llvm-project/clang/test/Modules/codegen-extern-template.cpp
new file mode 100644
index 0000000..56916e7
--- /dev/null
+++ b/src/llvm-project/clang/test/Modules/codegen-extern-template.cpp
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -triple=x86_64-linux-gnu -fmodules -fmodules-codegen -emit-module -fmodule-name=foo %S/Inputs/codegen-extern-template.modulemap -x c++ -o %t.pcm
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -fmodules -fmodule-file=%t.pcm %s -emit-llvm -o - | FileCheck %s
+// expected-no-diagnostics
+
+#include "codegen-extern-template.h"
+
+template int foo<int>();
+
+// CHECK: define weak_odr i32 @_Z3fooIiET_v
diff --git a/src/llvm-project/clang/test/Modules/codegen-extern-template.h b/src/llvm-project/clang/test/Modules/codegen-extern-template.h
new file mode 100644
index 0000000..56ee036
--- /dev/null
+++ b/src/llvm-project/clang/test/Modules/codegen-extern-template.h
@@ -0,0 +1,12 @@
+// header for codegen-extern-template.cpp
+#ifndef CODEGEN_EXTERN_TEMPLATE_H
+#define CODEGEN_EXTERN_TEMPLATE_H
+
+template <typename T>
+inline T foo() { return 10; }
+
+extern template int foo<int>();
+
+inline int bar() { return foo<int>(); }
+
+#endif
diff --git a/src/llvm-project/clang/test/Modules/context-hash.c b/src/llvm-project/clang/test/Modules/context-hash.c
new file mode 100644
index 0000000..33dfb2f
--- /dev/null
+++ b/src/llvm-project/clang/test/Modules/context-hash.c
@@ -0,0 +1,34 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fsyntax-only -internal-isystem \
+// RUN: %S/Inputs/System/usr/include -fmodules -fimplicit-module-maps \
+// RUN: -fmodules-cache-path=%t %s -Rmodule-build 2> %t1
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fsyntax-only -internal-isystem \
+// RUN: %S/Inputs/System/usr/include -internal-isystem %S -fmodules \
+// RUN: -fimplicit-module-maps -fmodules-cache-path=%t %s -Rmodule-build 2> \
+// RUN: %t2
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fsyntax-only -internal-isystem \
+// RUN: %S/Inputs/System/usr/include -internal-isystem %S -fmodules \
+// RUN: -fimplicit-module-maps -fmodules-cache-path=%t %s \
+// RUN: -fmodules-strict-context-hash -Rmodule-build 2> %t3
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fsyntax-only -Weverything -internal-isystem \
+// RUN: %S/Inputs/System/usr/include -fmodules -fmodules-strict-context-hash \
+// RUN: -fimplicit-module-maps -fmodules-cache-path=%t %s -Rmodule-build 2> \
+// RUN: %t4
+// RUN: echo %t > %t.path
+// RUN: cat %t.path %t1 %t2 %t3 %t4 | FileCheck %s
+
+// This test verifies that only strict hashing includes search paths and
+// diagnostics in the module context hash.
+
+#include <stdio.h>
+
+// CHECK: [[PREFIX:(.*[/\\])+[a-zA-Z0-9.-]+]]
+// CHECK: building module 'cstd' as '[[PREFIX]]{{[/\\]}}[[CONTEXT_HASH:[A-Z0-9]+]]{{[/\\]}}cstd-[[AST_HASH:[A-Z0-9]+]].pcm'
+// CHECK: building module 'cstd' as '{{.*[/\\]}}[[CONTEXT_HASH]]{{[/\\]}}cstd-[[AST_HASH]].pcm'
+// CHECK-NOT: building module 'cstd' as '{{.*[/\\]}}[[CONTEXT_HASH]]{{[/\\]}}
+// CHECK: cstd-[[AST_HASH]].pcm'
+// CHECK-NOT: building module 'cstd' as '{{.*[/\\]}}[[CONTEXT_HASH]]{{[/\\]}}
+// CHECK: cstd-[[AST_HASH]].pcm'
diff --git a/src/llvm-project/clang/test/Modules/crash-vfs-headermaps.m b/src/llvm-project/clang/test/Modules/crash-vfs-headermaps.m
index f4c101cd..0afa0de 100644
--- a/src/llvm-project/clang/test/Modules/crash-vfs-headermaps.m
+++ b/src/llvm-project/clang/test/Modules/crash-vfs-headermaps.m
@@ -5,8 +5,8 @@
// RUN: echo '// Foo.h' > %t/i/Foo.framework/Headers/Foo.h
// RUN: %hmaptool write %S/../Preprocessor/Inputs/headermap-rel/foo.hmap.json %t/i/foo.hmap
-// RUN: not env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%t TEMP=%t TMP=%t \
-// RUN: %clang -fsyntax-only -fmodules -fmodules-cache-path=%t/m %s \
+// RUN: env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%t TEMP=%t TMP=%t \
+// RUN: not %clang -fsyntax-only -fmodules -fmodules-cache-path=%t/m %s \
// RUN: -I %t/i/foo.hmap -F %t/i 2>&1 | FileCheck %s
// RUN: FileCheck --check-prefix=CHECKSH %s -input-file %t/crash-vfs-*.sh
diff --git a/src/llvm-project/clang/test/Modules/crash-vfs-include-pch.m b/src/llvm-project/clang/test/Modules/crash-vfs-include-pch.m
index f4ae00e..5289f18 100644
--- a/src/llvm-project/clang/test/Modules/crash-vfs-include-pch.m
+++ b/src/llvm-project/clang/test/Modules/crash-vfs-include-pch.m
@@ -8,8 +8,8 @@
// RUN: -fmodules-cache-path=%t/cache -O0 \
// RUN: -isystem %S/Inputs/System/usr/include
-// RUN: not env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%t TEMP=%t TMP=%t \
-// RUN: %clang %s -E -include-pch %t/out/pch-used.h.pch -fmodules -nostdlibinc \
+// RUN: env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%t TEMP=%t TMP=%t \
+// RUN: not %clang %s -E -include-pch %t/out/pch-used.h.pch -fmodules -nostdlibinc \
// RUN: -fimplicit-module-maps -fmodules-cache-path=%t/cache -O0 \
// RUN: -Xclang -fno-validate-pch -isystem %S/Inputs/System/usr/include \
// RUN: -o %t/output.E 2>&1 | FileCheck %s
diff --git a/src/llvm-project/clang/test/Modules/crash-vfs-ivfsoverlay.m b/src/llvm-project/clang/test/Modules/crash-vfs-ivfsoverlay.m
index 3cb0f1d..d2d2ccb 100644
--- a/src/llvm-project/clang/test/Modules/crash-vfs-ivfsoverlay.m
+++ b/src/llvm-project/clang/test/Modules/crash-vfs-ivfsoverlay.m
@@ -1,14 +1,14 @@
-// REQUIRES: crash-recovery, shell, system-darwin
+// REQUIRES: crash-recovery, system-darwin
// RUN: rm -rf %t
// RUN: mkdir -p %t/m
// RUN: cp %S/../VFS/Inputs/actual_module2.map %t/actual_module2.map
-// RUN: sed -e "s:INPUT_DIR:%t:g" -e "s:OUT_DIR:%t/example:g" \
+// RUN: sed -e "s@INPUT_DIR@%{/t:regex_replacement}@g" -e "s@OUT_DIR@%{/t:regex_replacement}/example@g" \
// RUN: %S/../VFS/Inputs/vfsoverlay2.yaml > %t/srcvfs.yaml
-// RUN: not env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%t TEMP=%t TMP=%t \
+// RUN: env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%t TEMP=%t TMP=%t \
// RUN: ASAN_OPTIONS=detect_leaks=0 \
-// RUN: %clang -fsyntax-only -nostdinc %s \
+// RUN: not %clang -fsyntax-only -nostdinc %s \
// RUN: -I %S/Inputs/crash-recovery/usr/include \
// RUN: -ivfsoverlay %t/srcvfs.yaml \
// RUN: -fmodules -fmodules-cache-path=%t/m/ 2>&1 | FileCheck %s
diff --git a/src/llvm-project/clang/test/Modules/crash-vfs-path-emptydir-entries.m b/src/llvm-project/clang/test/Modules/crash-vfs-path-emptydir-entries.m
index 0c7286d..a5b22d7 100644
--- a/src/llvm-project/clang/test/Modules/crash-vfs-path-emptydir-entries.m
+++ b/src/llvm-project/clang/test/Modules/crash-vfs-path-emptydir-entries.m
@@ -10,8 +10,8 @@
// RUN: mkdir -p %t/i %t/m %t %t/sysroot
// RUN: cp -R %S/Inputs/crash-recovery/usr %t/i/
-// RUN: not env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%t TEMP=%t TMP=%t \
-// RUN: %clang -fsyntax-only %s -I %/t/i -isysroot %/t/sysroot/ \
+// RUN: env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%t TEMP=%t TMP=%t \
+// RUN: not %clang -fsyntax-only %s -I %/t/i -isysroot %/t/sysroot/ \
// RUN: -fmodules -fmodules-cache-path=%t/m/ 2>&1 | FileCheck %s
// RUN: FileCheck --check-prefix=CHECKSRC %s -input-file %t/crash-vfs-*.m
diff --git a/src/llvm-project/clang/test/Modules/crash-vfs-path-symlink-component.m b/src/llvm-project/clang/test/Modules/crash-vfs-path-symlink-component.m
index b868625..e8b5848 100644
--- a/src/llvm-project/clang/test/Modules/crash-vfs-path-symlink-component.m
+++ b/src/llvm-project/clang/test/Modules/crash-vfs-path-symlink-component.m
@@ -11,8 +11,8 @@
// RUN: cp -R %S/Inputs/crash-recovery/usr %t/i/
// RUN: ln -s include/tcl-private %t/i/usr/x
-// RUN: not env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%t TEMP=%t TMP=%t \
-// RUN: %clang -fsyntax-only %s -I %/t/i -isysroot %/t/sysroot/ \
+// RUN: env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%t TEMP=%t TMP=%t \
+// RUN: not %clang -fsyntax-only %s -I %/t/i -isysroot %/t/sysroot/ \
// RUN: -fmodules -fmodules-cache-path=%t/m/ 2>&1 | FileCheck %s
// RUN: FileCheck --check-prefix=CHECKSRC %s -input-file %t/crash-vfs-*.m
diff --git a/src/llvm-project/clang/test/Modules/crash-vfs-path-symlink-topheader.m b/src/llvm-project/clang/test/Modules/crash-vfs-path-symlink-topheader.m
index 6582243..beea957 100644
--- a/src/llvm-project/clang/test/Modules/crash-vfs-path-symlink-topheader.m
+++ b/src/llvm-project/clang/test/Modules/crash-vfs-path-symlink-topheader.m
@@ -12,8 +12,8 @@
// RUN: rm -f %t/i/usr/include/pthread_impl.h
// RUN: ln -s pthread/pthread_impl.h %t/i/usr/include/pthread_impl.h
-// RUN: not env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%t TEMP=%t TMP=%t \
-// RUN: %clang -fsyntax-only %s -I %/t/i -isysroot %/t/sysroot/ \
+// RUN: env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%t TEMP=%t TMP=%t \
+// RUN: not %clang -fsyntax-only %s -I %/t/i -isysroot %/t/sysroot/ \
// RUN: -fmodules -fmodules-cache-path=%t/m/ 2>&1 | FileCheck %s
// RUN: FileCheck --check-prefix=CHECKSRC %s -input-file %t/crash-vfs-*.m
diff --git a/src/llvm-project/clang/test/Modules/crash-vfs-path-traversal.m b/src/llvm-project/clang/test/Modules/crash-vfs-path-traversal.m
index 1a2550b..198e1fc 100644
--- a/src/llvm-project/clang/test/Modules/crash-vfs-path-traversal.m
+++ b/src/llvm-project/clang/test/Modules/crash-vfs-path-traversal.m
@@ -9,8 +9,8 @@
// RUN: rm -rf %t
// RUN: mkdir -p %t/i %t/m %t
-// RUN: not env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%t TEMP=%t TMP=%t \
-// RUN: %clang -fsyntax-only %s -I %S/Inputs/crash-recovery -isysroot %/t/i/ \
+// RUN: env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%t TEMP=%t TMP=%t \
+// RUN: not %clang -fsyntax-only %s -I %S/Inputs/crash-recovery -isysroot %/t/i/ \
// RUN: -fmodules -fmodules-cache-path=%t/m/ 2>&1 | FileCheck %s
// RUN: FileCheck --check-prefix=CHECKSRC %s -input-file %t/crash-vfs-*.m
diff --git a/src/llvm-project/clang/test/Modules/crash-vfs-relative-incdir.m b/src/llvm-project/clang/test/Modules/crash-vfs-relative-incdir.m
index d019c01..e35c1e9 100644
--- a/src/llvm-project/clang/test/Modules/crash-vfs-relative-incdir.m
+++ b/src/llvm-project/clang/test/Modules/crash-vfs-relative-incdir.m
@@ -4,8 +4,8 @@
// RUN: mkdir -p %t/m
// RUN: cd %S/Inputs/crash-recovery/usr
-// RUN: not env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%t TEMP=%t TMP=%t \
-// RUN: %clang -fsyntax-only -nostdinc %s -Iinclude \
+// RUN: env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%t TEMP=%t TMP=%t \
+// RUN: not %clang -fsyntax-only -nostdinc %s -Iinclude \
// RUN: -fmodules -fmodules-cache-path=%t/m/ 2>&1 | FileCheck %s
// RUN: FileCheck --check-prefix=CHECKSRC %s -input-file %t/crash-vfs-*.m
diff --git a/src/llvm-project/clang/test/Modules/crash-vfs-relative-overlay.m b/src/llvm-project/clang/test/Modules/crash-vfs-relative-overlay.m
index 9eeed01..59cd8fd 100644
--- a/src/llvm-project/clang/test/Modules/crash-vfs-relative-overlay.m
+++ b/src/llvm-project/clang/test/Modules/crash-vfs-relative-overlay.m
@@ -6,8 +6,8 @@
// RUN: rm -rf %t
// RUN: mkdir -p %t/i %t/m %t
-// RUN: not env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%t TEMP=%t TMP=%t \
-// RUN: %clang -fsyntax-only -nostdinc %s \
+// RUN: env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%t TEMP=%t TMP=%t \
+// RUN: not %clang -fsyntax-only -nostdinc %s \
// RUN: -I %S/Inputs/crash-recovery/usr/include -isysroot %/t/i/ \
// RUN: -fmodules -fmodules-cache-path=%t/m/ 2>&1 | FileCheck %s
diff --git a/src/llvm-project/clang/test/Modules/crash-vfs-run-reproducer.m b/src/llvm-project/clang/test/Modules/crash-vfs-run-reproducer.m
index d15b52d..d43f7b5 100644
--- a/src/llvm-project/clang/test/Modules/crash-vfs-run-reproducer.m
+++ b/src/llvm-project/clang/test/Modules/crash-vfs-run-reproducer.m
@@ -3,8 +3,8 @@
// RUN: rm -rf %t
// RUN: mkdir -p %t/i %t/m %t
-// RUN: not env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%t TEMP=%t TMP=%t \
-// RUN: %clang -fsyntax-only -nostdinc %s \
+// RUN: env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%t TEMP=%t TMP=%t \
+// RUN: not %clang -fsyntax-only -nostdinc %s \
// RUN: -I %S/Inputs/crash-recovery/usr/include -isysroot %/t/i/ \
// RUN: -fmodules -fmodules-cache-path=%t/m/ 2>&1 | FileCheck %s
diff --git a/src/llvm-project/clang/test/Modules/crash-vfs-umbrella-frameworks.m b/src/llvm-project/clang/test/Modules/crash-vfs-umbrella-frameworks.m
index e311c60..8cd3afb 100644
--- a/src/llvm-project/clang/test/Modules/crash-vfs-umbrella-frameworks.m
+++ b/src/llvm-project/clang/test/Modules/crash-vfs-umbrella-frameworks.m
@@ -9,8 +9,8 @@
// RUN: mkdir -p %t/i/Frameworks/A.framework/Frameworks
// RUN: ln -s ../../B.framework %t/i/Frameworks/A.framework/Frameworks/B.framework
-// RUN: not env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%t TEMP=%t TMP=%t \
-// RUN: %clang -nostdinc -fsyntax-only %s \
+// RUN: env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%t TEMP=%t TMP=%t \
+// RUN: not %clang -nostdinc -fsyntax-only %s \
// RUN: -F %/t/i/Frameworks -fmodules \
// RUN: -fmodules-cache-path=%t/m/ 2>&1 | FileCheck %s
diff --git a/src/llvm-project/clang/test/Modules/debug-info-moduleimport.m b/src/llvm-project/clang/test/Modules/debug-info-moduleimport.m
index 16820ba..df8a66b 100644
--- a/src/llvm-project/clang/test/Modules/debug-info-moduleimport.m
+++ b/src/llvm-project/clang/test/Modules/debug-info-moduleimport.m
@@ -15,7 +15,7 @@
// CHECK: ![[MODULE]] = !DIModule(scope: null, name: "DebugObjC",
// CHECK-SAME: configMacros: "\22-DGREETING=Hello World\22 \22-UNDEBUG\22",
// CHECK-SAME: includePath: "{{.*}}test{{.*}}Modules{{.*}}Inputs",
-// CHECK-SAME: isysroot: "/tmp/..")
+// CHECK-SAME: sysroot: "/tmp/..")
// CHECK: ![[F]] = !DIFile(filename: {{.*}}debug-info-moduleimport.m
// RUN: %clang_cc1 -debug-info-kind=limited -fmodules -fimplicit-module-maps -fmodules-cache-path=%t \
diff --git a/src/llvm-project/clang/test/Modules/dependency-dump-dependent-module.m b/src/llvm-project/clang/test/Modules/dependency-dump-dependent-module.m
index 4906986..2430726 100644
--- a/src/llvm-project/clang/test/Modules/dependency-dump-dependent-module.m
+++ b/src/llvm-project/clang/test/Modules/dependency-dump-dependent-module.m
@@ -1,8 +1,6 @@
// When a module depends on another, check that we dump the dependency header
// files for both.
-// REQUIRES: shell
-
// RUN: rm -rf %t
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/cache -module-dependency-dir %t/vfs -F %S/Inputs -I %S/Inputs -verify %s
// expected-no-diagnostics
diff --git a/src/llvm-project/clang/test/Modules/dependency-dump.m b/src/llvm-project/clang/test/Modules/dependency-dump.m
index deb6618..f3a4875 100644
--- a/src/llvm-project/clang/test/Modules/dependency-dump.m
+++ b/src/llvm-project/clang/test/Modules/dependency-dump.m
@@ -1,8 +1,6 @@
// Check that we can dump all of the headers a module depends on, and a VFS map
// for the same.
-// REQUIRES: shell
-
// RUN: rm -rf %t
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/cache -module-dependency-dir %t/vfs -F %S/Inputs -I %S/Inputs -verify %s
// expected-no-diagnostics
diff --git a/src/llvm-project/clang/test/Modules/double-quotes.m b/src/llvm-project/clang/test/Modules/double-quotes.m
index 8eec365..99187fc 100644
--- a/src/llvm-project/clang/test/Modules/double-quotes.m
+++ b/src/llvm-project/clang/test/Modules/double-quotes.m
@@ -1,12 +1,10 @@
-// REQUIRES: shell
-
// RUN: rm -rf %t
// RUN: mkdir %t
// RUN: %hmaptool write %S/Inputs/double-quotes/a.hmap.json %t/a.hmap
// RUN: %hmaptool write %S/Inputs/double-quotes/x.hmap.json %t/x.hmap
-// RUN: sed -e "s:TEST_DIR:%S/Inputs/double-quotes:g" \
+// RUN: sed -e "s@TEST_DIR@%{/S:regex_replacement}/Inputs/double-quotes@g" \
// RUN: %S/Inputs/double-quotes/z.yaml > %t/z.yaml
// The output with and without modules should be the same
diff --git a/src/llvm-project/clang/test/Modules/framework-public-includes-private.m b/src/llvm-project/clang/test/Modules/framework-public-includes-private.m
index eb4d287..37c43e9 100644
--- a/src/llvm-project/clang/test/Modules/framework-public-includes-private.m
+++ b/src/llvm-project/clang/test/Modules/framework-public-includes-private.m
@@ -1,12 +1,10 @@
-// REQUIRES: shell
-
// RUN: rm -rf %t
// RUN: mkdir %t
// RUN: %hmaptool write %S/Inputs/framework-public-includes-private/a.hmap.json %t/a.hmap
// RUN: %hmaptool write %S/Inputs/framework-public-includes-private/z.hmap.json %t/z.hmap
-// RUN: sed -e "s:TEST_DIR:%S/Inputs/framework-public-includes-private:g" \
+// RUN: sed -e "s@TEST_DIR@%{/S:regex_replacement}/Inputs/framework-public-includes-private@g" \
// RUN: %S/Inputs/framework-public-includes-private/z.yaml > %t/z.yaml
// The output with and without modules should be the same, without modules first.
diff --git a/src/llvm-project/clang/test/Modules/implicit-invalidate-common.c b/src/llvm-project/clang/test/Modules/implicit-invalidate-common.c
new file mode 100644
index 0000000..143a00f
--- /dev/null
+++ b/src/llvm-project/clang/test/Modules/implicit-invalidate-common.c
@@ -0,0 +1,35 @@
+// RUN: rm -rf %t
+// RUN: mkdir -p %t/implicit-invalidate-common
+// RUN: cp -r %S/Inputs/implicit-invalidate-common %t/
+// RUN: echo '#include "A.h"' > %t/A.c
+// RUN: echo '#include "B.h"' > %t/B.c
+
+// Build with an empty module cache. Module 'Common' should be built only once.
+//
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/Cache \
+// RUN: -fsyntax-only -I %t/implicit-invalidate-common -Rmodule-build \
+// RUN: %t/A.c 2> %t/initial_build.txt
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/Cache \
+// RUN: -fsyntax-only -I %t/implicit-invalidate-common -Rmodule-build \
+// RUN: %t/B.c 2>> %t/initial_build.txt
+// RUN: FileCheck %s --implicit-check-not "remark:" --input-file %t/initial_build.txt
+
+// Update module 'Common' and build with the populated module cache. Module
+// 'Common' still should be built only once. Note that we are using the same
+// flags for A.c and B.c to avoid building Common.pcm at different paths.
+//
+// RUN: echo ' // ' >> %t/implicit-invalidate-common/Common.h
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/Cache \
+// RUN: -fsyntax-only -I %t/implicit-invalidate-common -Rmodule-build \
+// RUN: %t/A.c 2> %t/incremental_build.txt
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/Cache \
+// RUN: -fsyntax-only -I %t/implicit-invalidate-common -Rmodule-build \
+// RUN: %t/B.c 2>> %t/incremental_build.txt
+// RUN: FileCheck %s --implicit-check-not "remark:" --input-file %t/incremental_build.txt
+
+// CHECK: remark: building module 'A'
+// CHECK: remark: building module 'Common'
+// CHECK: remark: finished building module 'Common'
+// CHECK: remark: finished building module 'A'
+// CHECK: remark: building module 'B'
+// CHECK: remark: finished building module 'B'
diff --git a/src/llvm-project/clang/test/Modules/interface-diagnose-missing-import.m b/src/llvm-project/clang/test/Modules/interface-diagnose-missing-import.m
new file mode 100644
index 0000000..5bbac36
--- /dev/null
+++ b/src/llvm-project/clang/test/Modules/interface-diagnose-missing-import.m
@@ -0,0 +1,11 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 %s -fsyntax-only -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -F%S/Inputs/interface-diagnose-missing-import -verify
+@interface Buggy
+@end
+
+@import Foo.Bar;
+
+@interface Buggy (MyExt) // expected-error {{definition of 'Buggy' must be imported from module 'Foo' before it is required}}
+@end
+
+// expected-note@Foo/RandoPriv.h:3{{previous definition is here}}
diff --git a/src/llvm-project/clang/test/Modules/lsv-debuginfo.cpp b/src/llvm-project/clang/test/Modules/lsv-debuginfo.cpp
old mode 100755
new mode 100644
diff --git a/src/llvm-project/clang/test/Modules/merge-lifetime-extended-temporary.cpp b/src/llvm-project/clang/test/Modules/merge-lifetime-extended-temporary.cpp
new file mode 100644
index 0000000..36db948
--- /dev/null
+++ b/src/llvm-project/clang/test/Modules/merge-lifetime-extended-temporary.cpp
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -x c++ -I%S/Inputs/merge-lifetime-extended-temporary -verify -std=c++11 %s -DORDER=1
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -x c++ -I%S/Inputs/merge-lifetime-extended-temporary -verify -std=c++11 %s -DORDER=2
+
+// expected-no-diagnostics
+#if ORDER == 1
+#include "c.h"
+#include "b.h"
+#else
+#include "b.h"
+#include "c.h"
+#endif
+
+static_assert(PtrTemp1 == &LETemp, "");
+static_assert(PtrTemp1 == PtrTemp2, "");
diff --git a/src/llvm-project/clang/test/Modules/objc-type-param.m b/src/llvm-project/clang/test/Modules/objc-type-param.m
new file mode 100644
index 0000000..3417d62
--- /dev/null
+++ b/src/llvm-project/clang/test/Modules/objc-type-param.m
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -x objective-c -fmodule-name=objc_type_param -emit-module %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs %s -verify
+
+@import objc_type_param;
+
+id make(BCallback callback, id arg) {
+ return callback(arg); // expected-error {{too few arguments to function call}}
+}
diff --git a/src/llvm-project/clang/test/Modules/odr_hash.cpp b/src/llvm-project/clang/test/Modules/odr_hash.cpp
index ff7cfb3..6d26b3c 100644
--- a/src/llvm-project/clang/test/Modules/odr_hash.cpp
+++ b/src/llvm-project/clang/test/Modules/odr_hash.cpp
@@ -311,6 +311,20 @@
#endif
#if defined(FIRST)
+struct S9b {
+ mutable int x : 2;
+};
+#elif defined(SECOND)
+struct S9b {
+ int x : 2;
+};
+#else
+S9b s9b;
+// [email protected]:* {{'Field::S9b' has different definitions in different modules; first difference is definition in module 'SecondModule' found non-mutable field 'x'}}
+// [email protected]:* {{but in 'FirstModule' found mutable field 'x'}}
+#endif
+
+#if defined(FIRST)
struct S10 {
unsigned x = 5;
};
@@ -372,7 +386,9 @@
unsigned c : 1 + 2; \
s d; \
double e = 1.0; \
- long f[5];
+ long f[5]; \
+ mutable int g; \
+ mutable int h : 5;
#if defined(FIRST) || defined(SECOND)
typedef short s;
diff --git a/src/llvm-project/clang/test/Modules/preprocess-module.cpp b/src/llvm-project/clang/test/Modules/preprocess-module.cpp
index b0cbac1..ee909a8 100644
--- a/src/llvm-project/clang/test/Modules/preprocess-module.cpp
+++ b/src/llvm-project/clang/test/Modules/preprocess-module.cpp
@@ -51,7 +51,7 @@
// RUN: %clang_cc1 -fmodules -fmodule-file=%t/file.rewrite.pcm %s -I%t -verify -fno-modules-error-recovery -DFILE_REWRITE -DINCLUDE -I%S/Inputs/preprocess
//
// Check that we can preprocess this user of the .pcm file.
-// RUN: %clang_cc1 -fmodules -fmodule-file=%t/file.pcm %s -I%t -E -frewrite-imports -o %t/preprocess-module.ii
+// RUN: %clang_cc1 -fmodules -fmodule-file=%t/file.pcm %s -I%t -E -frewrite-imports -DFILE_REWRITE_FULL -o %t/preprocess-module.ii
// RUN: %clang_cc1 -fmodules %t/preprocess-module.ii -verify -fno-modules-error-recovery -DFILE_REWRITE_FULL
//
// Check that language / header search options are ignored when preprocessing from a .pcm file.
diff --git a/src/llvm-project/clang/test/Modules/redecl-merge.m b/src/llvm-project/clang/test/Modules/redecl-merge.m
index 59a19af..62b74f4 100644
--- a/src/llvm-project/clang/test/Modules/redecl-merge.m
+++ b/src/llvm-project/clang/test/Modules/redecl-merge.m
@@ -12,11 +12,11 @@
int *call_eventually_noreturn(void) {
eventually_noreturn();
-} // expected-warning{{control reaches end of non-void function}}
+} // expected-warning{{non-void function does not return a value}}
int *call_eventually_noreturn2(void) {
eventually_noreturn2();
-} // expected-warning{{control reaches end of non-void function}}
+} // expected-warning{{non-void function does not return a value}}
@import redecl_merge_right;
diff --git a/src/llvm-project/clang/test/Modules/structural-equivalent-recursive-types.c b/src/llvm-project/clang/test/Modules/structural-equivalent-recursive-types.c
new file mode 100644
index 0000000..bb3ec7b
--- /dev/null
+++ b/src/llvm-project/clang/test/Modules/structural-equivalent-recursive-types.c
@@ -0,0 +1,7 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I%S/Inputs/rec-types -fsyntax-only %s -verify
+#include "a.h"
+#include "c.h"
+void foo(struct some_descriptor *st) { (void)st->thunk; }
+
+// expected-no-diagnostics
diff --git a/src/llvm-project/clang/test/Modules/umbrella-header-include-builtin.mm b/src/llvm-project/clang/test/Modules/umbrella-header-include-builtin.mm
index b14c737..9f8a45e 100644
--- a/src/llvm-project/clang/test/Modules/umbrella-header-include-builtin.mm
+++ b/src/llvm-project/clang/test/Modules/umbrella-header-include-builtin.mm
@@ -1,5 +1,5 @@
// RUN: rm -rf %t
-// RUN: %clang -cc1 -fsyntax-only -nobuiltininc -nostdinc++ -isysroot %S/Inputs/libc-libcxx/sysroot -isystem %S/Inputs/libc-libcxx/sysroot/usr/include/c++/v1 -isystem %S/Inputs/libc-libcxx/sysroot/usr/include -F%S/Inputs/libc-libcxx/sysroot/Frameworks -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -x objective-c++ %s
+// RUN: %clang_cc1 -fsyntax-only -nobuiltininc -nostdinc++ -isysroot %S/Inputs/libc-libcxx/sysroot -isystem %S/Inputs/libc-libcxx/sysroot/usr/include/c++/v1 -isystem %S/Inputs/libc-libcxx/sysroot/usr/include -F%S/Inputs/libc-libcxx/sysroot/Frameworks -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -x objective-c++ %s
#include <A/A.h>
diff --git a/src/llvm-project/clang/test/Modules/validate-file-content.m b/src/llvm-project/clang/test/Modules/validate-file-content.m
new file mode 100644
index 0000000..327a68a
--- /dev/null
+++ b/src/llvm-project/clang/test/Modules/validate-file-content.m
@@ -0,0 +1,33 @@
+// REQUIRES: shell
+//
+// Check driver works
+// RUN: %clang -fmodules -fsyntax-only -fmodules-validate-input-files-content %s -### 2>&1 | FileCheck --check-prefix=CHECK-CC1 %s
+// CHECK-CC1: -fvalidate-ast-input-files-content
+//
+// PCH+Modules: Test that a mtime mismatch without content change is fine
+// RUN: rm -rf %t
+// RUN: mkdir %t
+// RUN: echo '// m.h' > %t/m.h
+// RUN: echo '#include "m.h"' > %t/a.h
+// RUN: echo 'module m { header "m.h" }' > %t/module.modulemap
+// RUN: %clang_cc1 -emit-pch -fmodules-cache-path=%t/cache -fmodules -fimplicit-module-maps -o %t/a.pch -I %t -x objective-c-header %t/a.h -fvalidate-ast-input-files-content
+// RUN: touch -m -a -t 202901010000 %t/m.h
+// RUN: %clang_cc1 -fsyntax-only -fmodules-cache-path=%t/cache -fmodules -fimplicit-module-maps -I %t -include-pch %t/a.pch %s -verify -fvalidate-ast-input-files-content
+//
+// PCH+Modules: Test that a mtime mismatch with content change
+// RUN: rm -rf %t
+// RUN: mkdir %t
+// RUN: echo '// m.h' > %t/m.h
+// RUN: echo '#include "m.h"' > %t/a.h
+// RUN: echo 'module m { header "m.h" }' > %t/module.modulemap
+// RUN: %clang_cc1 -emit-pch -fmodules-cache-path=%t/cache -fmodules -fimplicit-module-maps -o %t/a.pch -I %t -x objective-c-header %t/a.h -fvalidate-ast-input-files-content
+// RUN: echo '// m.x' > %t/m.h
+// RUN: touch -m -a -t 202901010000 %t/m.h
+// RUN: not %clang_cc1 -fsyntax-only -fmodules-cache-path=%t/cache -fmodules -fimplicit-module-maps -I %t -include-pch %t/a.pch %s -fvalidate-ast-input-files-content 2> %t/stderr
+// RUN: FileCheck %s < %t/stderr
+//
+// CHECK: file '[[M_H:.*[/\\]m\.h]]' has been modified since the precompiled header '[[A_PCH:.*/a\.pch]]' was built: content changed
+// CHECK: '[[M_H]]' required by '[[M_PCM:.*[/\\]m.*\.pcm]]'
+// CHECK: '[[M_PCM]]' required by '[[A_PCH]]'
+// CHECK: please rebuild precompiled header '[[A_PCH]]'
+// expected-no-diagnostics
diff --git a/src/llvm-project/clang/test/OpenMP/aux-triple-macros.cpp b/src/llvm-project/clang/test/OpenMP/aux-triple-macros.cpp
new file mode 100644
index 0000000..73b74bd
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/aux-triple-macros.cpp
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 %s -triple nvptx64 -aux-triple x86_64-unknown-linux-gnu -E -dM | FileCheck %s
+// RUN: %clang_cc1 %s -fopenmp -fopenmp-is-device -triple nvptx64 -aux-triple x86_64-unknown-linux-gnu -E -dM | FileCheck --check-prefix=CHECK-OMP-DEVICE %s
+
+// CHECK-NOT:#define __x86_64__ 1
+// CHECK-OMP-DEVICE:#define __x86_64__ 1
diff --git a/src/llvm-project/clang/test/OpenMP/barrier_codegen.cpp b/src/llvm-project/clang/test/OpenMP/barrier_codegen.cpp
index aa3358c..3f2e7e3 100644
--- a/src/llvm-project/clang/test/OpenMP/barrier_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/barrier_codegen.cpp
@@ -1,6 +1,14 @@
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -o - | FileCheck %s --check-prefixes=CHECK,CLANGCG
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,CLANGCG
+
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-unknown -fopenmp-enable-irbuilder -emit-llvm %s -o - | FileCheck %s --check-prefixes=CHECK,IRBUILDER
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -fopenmp-enable-irbuilder -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-unknown -fopenmp-enable-irbuilder -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,IRBUILDER
+
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-unknown -fopenmp-enable-irbuilder -mllvm -openmp-ir-builder-optimistic-attributes -emit-llvm %s -o - | FileCheck %s --check-prefixes=CHECK,IRBUILDER_OPT
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -fopenmp-enable-irbuilder -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-unknown -fopenmp-enable-irbuilder -mllvm -openmp-ir-builder-optimistic-attributes -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,IRBUILDER_OPT
// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple x86_64-unknown-unknown -emit-pch -o %t %s
@@ -34,6 +42,13 @@
return tmain(argc) + tmain(argv[0][0]) + a;
}
+// CLANGCG: declare i32 @__kmpc_global_thread_num(%struct.ident_t*)
+// CLANGCG-NOT: #
+// IRBUILDER: ; Function Attrs: nounwind
+// IRBUILDER-NEXT: declare i32 @__kmpc_global_thread_num(%struct.ident_t*) #
+// IRBUILDER_OPT: ; Function Attrs: nofree nosync nounwind readonly
+// IRBUILDER_OPT-NEXT: declare i32 @__kmpc_global_thread_num(%struct.ident_t*) #
+
// CHECK: define {{.+}} [[TMAIN_INT]](
// CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num([[IDENT_T]]* [[LOC]])
// CHECK: call void @__kmpc_barrier([[IDENT_T]]* [[EXPLICIT_BARRIER_LOC]], i32 [[GTID]])
diff --git a/src/llvm-project/clang/test/OpenMP/cancel_codegen.cpp b/src/llvm-project/clang/test/OpenMP/cancel_codegen.cpp
index 75fd5e4..b2ef1d5 100644
--- a/src/llvm-project/clang/test/OpenMP/cancel_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/cancel_codegen.cpp
@@ -1,6 +1,10 @@
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -triple x86_64-apple-darwin13.4.0 -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -triple x86_64-apple-darwin13.4.0 -emit-llvm -o - %s | FileCheck %s --check-prefixes=ALL,CHECK
// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -triple x86_64-apple-darwin13.4.0 -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -triple x86_64-apple-darwin13.4.0 -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -triple x86_64-apple-darwin13.4.0 -emit-llvm -o - | FileCheck %s --check-prefixes=ALL,CHECK
+
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -fopenmp-enable-irbuilder -triple x86_64-apple-darwin13.4.0 -emit-llvm -o - %s | FileCheck %s --check-prefixes=ALL,IRBUILDER
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -fopenmp-enable-irbuilder -x c++ -std=c++11 -triple x86_64-apple-darwin13.4.0 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -fopenmp-enable-irbuilder -std=c++11 -include-pch %t -fsyntax-only -verify %s -triple x86_64-apple-darwin13.4.0 -emit-llvm -o - | FileCheck %s --check-prefixes=ALL,IRBUILDER
// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -triple x86_64-apple-darwin13.4.0 -emit-llvm -o - %s | FileCheck --check-prefix SIMD-ONLY0 %s
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -triple x86_64-apple-darwin13.4.0 -emit-pch -o %t %s
@@ -12,7 +16,7 @@
float flag;
int main (int argc, char **argv) {
-// CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num(
+// ALL: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num(
#pragma omp parallel
{
#pragma omp cancel parallel if(flag)
@@ -20,15 +24,15 @@
#pragma omp barrier
argv[0][0] += argc;
}
-// CHECK: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(
+// ALL: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(
#pragma omp sections
{
#pragma omp cancel sections
}
-// CHECK: call void @__kmpc_for_static_init_4(
-// CHECK: call i32 @__kmpc_cancel(
-// CHECK: call void @__kmpc_for_static_fini(
-// CHECK: call void @__kmpc_barrier(%struct.ident_t*
+// ALL: call void @__kmpc_for_static_init_4(
+// ALL: call i32 @__kmpc_cancel(
+// ALL: call void @__kmpc_for_static_fini(
+// ALL: call void @__kmpc_barrier(%struct.ident_t*
#pragma omp sections
{
#pragma omp cancel sections
@@ -37,53 +41,53 @@
#pragma omp cancel sections
}
}
-// CHECK: call void @__kmpc_for_static_init_4(
-// CHECK: [[RES:%.+]] = call i32 @__kmpc_cancel(%struct.ident_t* {{[^,]+}}, i32 [[GTID]], i32 3)
-// CHECK: [[CMP:%.+]] = icmp ne i32 [[RES]], 0
-// CHECK: br i1 [[CMP]], label %[[EXIT:[^,].+]], label %[[CONTINUE:.+]]
-// CHECK: [[EXIT]]
-// CHECK: br label
-// CHECK: [[CONTINUE]]
-// CHECK: br label
-// CHECK: [[RES:%.+]] = call i32 @__kmpc_cancel(%struct.ident_t* {{[^,]+}}, i32 [[GTID]], i32 3)
-// CHECK: [[CMP:%.+]] = icmp ne i32 [[RES]], 0
-// CHECK: br i1 [[CMP]], label %[[EXIT:[^,].+]], label %[[CONTINUE:.+]]
-// CHECK: [[EXIT]]
-// CHECK: br label
-// CHECK: [[CONTINUE]]
-// CHECK: br label
-// CHECK: call void @__kmpc_for_static_fini(
+// ALL: call void @__kmpc_for_static_init_4(
+// ALL: [[RES:%.+]] = call i32 @__kmpc_cancel(%struct.ident_t* {{[^,]+}}, i32 [[GTID]], i32 3)
+// ALL: [[CMP:%.+]] = icmp ne i32 [[RES]], 0
+// ALL: br i1 [[CMP]], label %[[EXIT:[^,].+]], label %[[CONTINUE:.+]]
+// ALL: [[EXIT]]
+// ALL: br label
+// ALL: [[CONTINUE]]
+// ALL: br label
+// ALL: [[RES:%.+]] = call i32 @__kmpc_cancel(%struct.ident_t* {{[^,]+}}, i32 [[GTID]], i32 3)
+// ALL: [[CMP:%.+]] = icmp ne i32 [[RES]], 0
+// ALL: br i1 [[CMP]], label %[[EXIT:[^,].+]], label %[[CONTINUE:.+]]
+// ALL: [[EXIT]]
+// ALL: br label
+// ALL: [[CONTINUE]]
+// ALL: br label
+// ALL: call void @__kmpc_for_static_fini(
#pragma omp for
for (int i = 0; i < argc; ++i) {
#pragma omp cancel for if(cancel: flag)
}
-// CHECK: call void @__kmpc_for_static_init_4(
-// CHECK: [[FLAG:%.+]] = load float, float* @{{.+}},
-// CHECK: [[BOOL:%.+]] = fcmp une float [[FLAG]], 0.000000e+00
-// CHECK: br i1 [[BOOL]], label %[[THEN:[^,]+]], label %[[ELSE:[^,]+]]
-// CHECK: [[THEN]]
-// CHECK: [[RES:%.+]] = call i32 @__kmpc_cancel(%struct.ident_t* {{[^,]+}}, i32 [[GTID]], i32 2)
-// CHECK: [[CMP:%.+]] = icmp ne i32 [[RES]], 0
-// CHECK: br i1 [[CMP]], label %[[EXIT:[^,].+]], label %[[CONTINUE:.+]]
-// CHECK: [[EXIT]]
-// CHECK: br label
-// CHECK: [[CONTINUE]]
-// CHECK: br label
-// CHECK: [[ELSE]]
-// CHECK: br label
-// CHECK: call void @__kmpc_for_static_fini(
-// CHECK: call void @__kmpc_barrier(%struct.ident_t*
+// ALL: call void @__kmpc_for_static_init_4(
+// ALL: [[FLAG:%.+]] = load float, float* @{{.+}},
+// ALL: [[BOOL:%.+]] = fcmp une float [[FLAG]], 0.000000e+00
+// ALL: br i1 [[BOOL]], label %[[THEN:[^,]+]], label %[[ELSE:[^,]+]]
+// ALL: [[THEN]]
+// ALL: [[RES:%.+]] = call i32 @__kmpc_cancel(%struct.ident_t* {{[^,]+}}, i32 [[GTID]], i32 2)
+// ALL: [[CMP:%.+]] = icmp ne i32 [[RES]], 0
+// ALL: br i1 [[CMP]], label %[[EXIT:[^,].+]], label %[[CONTINUE:.+]]
+// ALL: [[EXIT]]
+// ALL: br label
+// ALL: [[CONTINUE]]
+// ALL: br label
+// ALL: [[ELSE]]
+// ALL: br label
+// ALL: call void @__kmpc_for_static_fini(
+// ALL: call void @__kmpc_barrier(%struct.ident_t*
#pragma omp task
{
#pragma omp cancel taskgroup
}
-// CHECK: call i8* @__kmpc_omp_task_alloc(
-// CHECK: call i32 @__kmpc_omp_task(
+// ALL: call i8* @__kmpc_omp_task_alloc(
+// ALL: call i32 @__kmpc_omp_task(
#pragma omp parallel sections
{
#pragma omp cancel sections
}
-// CHECK: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(
+// ALL: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(
#pragma omp parallel sections
{
#pragma omp cancel sections
@@ -92,14 +96,14 @@
#pragma omp cancel sections
}
}
-// CHECK: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(
+// ALL: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(
int r = 0;
#pragma omp parallel for reduction(+: r)
for (int i = 0; i < argc; ++i) {
#pragma omp cancel for
r += i;
}
-// CHECK: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(
+// ALL: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(
return argc;
}
@@ -169,4 +173,29 @@
// CHECK: call void @__kmpc_for_static_fini(
// CHECK: ret void
+// IRBUILDER: define internal void @main
+
+// IRBUILDER: [[RETURN:omp.par.exit[^:]*]]
+// IRBUILDER-NEXT: ret void
+// IRBUILDER: [[FLAG:%.+]] = load float, float* @{{.+}},
+
+// IRBUILDER: [[BOOL:%.+]] = fcmp une float [[FLAG]], 0.000000e+00
+// IRBUILDER: br i1 [[BOOL]], label %[[THEN:[^,]+]], label %[[ELSE:[^,]+]]
+// IRBUILDER: [[ELSE]]
+// IRBUILDER-NEXT: br label %[[ELSE2:.*]]
+// IRBUILDER: [[ELSE2]]
+// The barrier directive should now call __kmpc_cancel_barrier
+// IRBUILDER: call i32 @__kmpc_cancel_barrier(%struct.ident_t*
+// IRBUILDER: br label
+// IRBUILDER: [[THEN]]
+// IRBUILDER: [[RES:%.+]] = call i32 @__kmpc_cancel(%struct.ident_t* {{[^,]+}}, i32 {{[^,]+}}, i32 1)
+// IRBUILDER: [[CMP:%.+]] = icmp eq i32 [[RES]], 0
+// IRBUILDER: br i1 [[CMP]], label %[[CONTINUE:[^,].+]], label %[[EXIT:.+]]
+// IRBUILDER: [[EXIT]]
+// IRBUILDER: br label %[[EXIT2:.+]]
+// IRBUILDER: [[EXIT2]]
+// IRBUILDER: br label %[[RETURN]]
+// IRBUILDER: [[CONTINUE]]
+// IRBUILDER: br label %[[ELSE:.+]]
+
#endif
diff --git a/src/llvm-project/clang/test/OpenMP/constexpr_capture.cpp b/src/llvm-project/clang/test/OpenMP/constexpr_capture.cpp
new file mode 100644
index 0000000..9577f6e
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/constexpr_capture.cpp
@@ -0,0 +1,21 @@
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple powerpc64le-unknown-linux -S -emit-llvm %s -o - -std=c++11 2>&1 | FileCheck %s
+// expected-no-diagnostics
+
+template <int __v> struct integral_constant {
+ static constexpr int value = __v;
+};
+
+template <typename _Tp, int v = 0, bool _IsArray = integral_constant<v>::value>
+struct decay {
+ typedef int type;
+};
+struct V {
+ template <typename TArg0 = int, typename = typename decay<TArg0>::type> V();
+};
+int main() {
+#pragma omp target
+ V v;
+ return 0;
+}
+
+// CHECK: call void @__omp_offloading_{{.+}}_main_l16()
diff --git a/src/llvm-project/clang/test/OpenMP/crash-skipped-bodies-template-inst.cpp b/src/llvm-project/clang/test/OpenMP/crash-skipped-bodies-template-inst.cpp
new file mode 100644
index 0000000..c7ba432
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/crash-skipped-bodies-template-inst.cpp
@@ -0,0 +1,30 @@
+// RUN: not %clang_cc1 -fsyntax-only -std=c++14 -code-completion-at=%s:28:5 -fopenmp %s -o - 2>&1 | FileCheck %s
+template <class T>
+auto make_func() {
+ struct impl {
+ impl* func() {
+ int x;
+ if (x = 10) {
+ #pragma omp parallel
+ ;
+ }
+ // Check that body of this function is actually skipped.
+ // CHECK-NOT: crash-skipped-bodies-template-inst.cpp:7:{{[0-9]+}}: warning: using the result of an assignment as a condition without parentheses
+ return this;
+ }
+ };
+
+ int x;
+ if (x = 10) {}
+ // Check that this function is not skipped.
+ // CHECK: crash-skipped-bodies-template-inst.cpp:18:9: warning: using the result of an assignment as a condition without parentheses
+ return impl();
+}
+
+void foo() {
+ []() {
+ make_func<int>();
+ m
+ // CHECK: COMPLETION: make_func : [#auto#]make_func<<#class T#>>()
+ };
+}
diff --git a/src/llvm-project/clang/test/OpenMP/declare_mapper_codegen.cpp b/src/llvm-project/clang/test/OpenMP/declare_mapper_codegen.cpp
index 6f1d6ec..f2ed4d2 100644
--- a/src/llvm-project/clang/test/OpenMP/declare_mapper_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/declare_mapper_codegen.cpp
@@ -1,92 +1,414 @@
-///==========================================================================///
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s
-// RUN: %clang_cc1 -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s
-// RUN: %clang_cc1 -fopenmp -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s
-
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -fopenmp-simd -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
-
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
// expected-no-diagnostics
#ifndef HEADER
#define HEADER
+///==========================================================================///
+// RUN: %clang_cc1 -DCK0 -verify -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm -femit-all-decls -disable-llvm-passes %s -o - | FileCheck --check-prefix CK0 --check-prefix CK0-64 %s
+// RUN: %clang_cc1 -DCK0 -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -femit-all-decls -disable-llvm-passes -o %t %s
+// RUN: %clang_cc1 -DCK0 -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -femit-all-decls -disable-llvm-passes -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix CK0 --check-prefix CK0-64 %s
+// RUN: %clang_cc1 -DCK0 -verify -fopenmp -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm -femit-all-decls -disable-llvm-passes %s -o - | FileCheck --check-prefix CK0 --check-prefix CK0-32 %s
+// RUN: %clang_cc1 -DCK0 -fopenmp -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -femit-all-decls -disable-llvm-passes -o %t %s
+// RUN: %clang_cc1 -DCK0 -fopenmp -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -femit-all-decls -disable-llvm-passes -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix CK0 --check-prefix CK0-32 %s
+
+// RUN: %clang_cc1 -DCK0 -verify -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm -femit-all-decls -disable-llvm-passes %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DCK0 -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -femit-all-decls -disable-llvm-passes -o %t %s
+// RUN: %clang_cc1 -DCK0 -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -femit-all-decls -disable-llvm-passes -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DCK0 -verify -fopenmp-simd -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm -femit-all-decls -disable-llvm-passes %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DCK0 -fopenmp-simd -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -femit-all-decls -disable-llvm-passes -o %t %s
+// RUN: %clang_cc1 -DCK0 -fopenmp-simd -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -femit-all-decls -disable-llvm-passes -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+
+#ifdef CK0
+
+// CK0-LABEL: @.__omp_offloading_{{.*}}foo{{.*}}.region_id = weak constant i8 0
+// CK0-64: [[SIZES:@.+]] = {{.+}}constant [1 x i64] [i64 16]
+// CK0-32: [[SIZES:@.+]] = {{.+}}constant [1 x i64] [i64 8]
+// CK0: [[TYPES:@.+]] = {{.+}}constant [1 x i64] [i64 35]
+// CK0-64: [[TSIZES:@.+]] = {{.+}}constant [1 x i64] [i64 16]
+// CK0-32: [[TSIZES:@.+]] = {{.+}}constant [1 x i64] [i64 8]
+// CK0: [[TTYPES:@.+]] = {{.+}}constant [1 x i64] [i64 33]
+// CK0-64: [[FSIZES:@.+]] = {{.+}}constant [1 x i64] [i64 16]
+// CK0-32: [[FSIZES:@.+]] = {{.+}}constant [1 x i64] [i64 8]
+// CK0: [[FTYPES:@.+]] = {{.+}}constant [1 x i64] [i64 34]
+
class C {
public:
int a;
+ double *b;
};
-#pragma omp declare mapper(id: C s) map(s.a)
+#pragma omp declare mapper(id: C s) map(s.a, s.b[0:2])
-// CHECK-LABEL: @.__omp_offloading_{{.*}}foo{{.*}}_l54.region_id = weak constant i8 0
+// CK0-LABEL: define {{.*}}void @.omp_mapper.{{.*}}C.id{{.*}}(i8*{{.*}}, i8*{{.*}}, i8*{{.*}}, i64{{.*}}, i64{{.*}})
+// CK0: store i8* %{{[^,]+}}, i8** [[HANDLEADDR:%[^,]+]]
+// CK0: store i8* %{{[^,]+}}, i8** [[BPTRADDR:%[^,]+]]
+// CK0: store i8* %{{[^,]+}}, i8** [[VPTRADDR:%[^,]+]]
+// CK0: store i64 %{{[^,]+}}, i{{64|32}}* [[SIZEADDR:%[^,]+]]
+// CK0: store i64 %{{[^,]+}}, i64* [[TYPEADDR:%[^,]+]]
+// CK0-DAG: [[SIZE:%.+]] = load i64, i64* [[SIZEADDR]]
+// CK0-DAG: [[TYPE:%.+]] = load i64, i64* [[TYPEADDR]]
+// CK0-DAG: [[HANDLE:%.+]] = load i8*, i8** [[HANDLEADDR]]
+// CK0-DAG: [[PTRBEGIN:%.+]] = bitcast i8** [[VPTRADDR]] to %class.C**
+// CK0-DAG: [[PTREND:%.+]] = getelementptr %class.C*, %class.C** [[PTRBEGIN]], i64 [[SIZE]]
+// CK0-DAG: [[BPTR:%.+]] = load i8*, i8** [[BPTRADDR]]
+// CK0-DAG: [[BEGIN:%.+]] = load i8*, i8** [[VPTRADDR]]
+// CK0: [[ISARRAY:%.+]] = icmp sge i64 [[SIZE]], 1
+// CK0: br i1 [[ISARRAY]], label %[[INITEVALDEL:[^,]+]], label %[[LHEAD:[^,]+]]
-// CHECK: [[SIZES:@.+]] = {{.+}}constant [1 x i[[sz:64|32]]] [i{{64|32}} 4]
-// CHECK: [[TYPES:@.+]] = {{.+}}constant [1 x i64] [i64 35]
-// CHECK: [[TSIZES:@.+]] = {{.+}}constant [1 x i[[sz]]] [i[[sz]] 4]
-// CHECK: [[TTYPES:@.+]] = {{.+}}constant [1 x i64] [i64 33]
-// CHECK: [[FSIZES:@.+]] = {{.+}}constant [1 x i[[sz]]] [i[[sz]] 4]
-// CHECK: [[FTYPES:@.+]] = {{.+}}constant [1 x i64] [i64 34]
+// CK0: [[INITEVALDEL]]
+// CK0: [[TYPEDEL:%.+]] = and i64 [[TYPE]], 8
+// CK0: [[ISNOTDEL:%.+]] = icmp eq i64 [[TYPEDEL]], 0
+// CK0: br i1 [[ISNOTDEL]], label %[[INIT:[^,]+]], label %[[LHEAD:[^,]+]]
+// CK0: [[INIT]]
+// CK0-64-DAG: [[ARRSIZE:%.+]] = mul nuw i64 [[SIZE]], 16
+// CK0-32-DAG: [[ARRSIZE:%.+]] = mul nuw i64 [[SIZE]], 8
+// CK0-DAG: [[ITYPE:%.+]] = and i64 [[TYPE]], -4
+// CK0: call void @__tgt_push_mapper_component(i8* [[HANDLE]], i8* [[BPTR]], i8* [[BEGIN]], i64 [[ARRSIZE]], i64 [[ITYPE]])
+// CK0: br label %[[LHEAD:[^,]+]]
-// CHECK-LABEL: foo{{.*}}(
+// CK0: [[LHEAD]]
+// CK0: [[ISEMPTY:%.+]] = icmp eq %class.C** [[PTRBEGIN]], [[PTREND]]
+// CK0: br i1 [[ISEMPTY]], label %[[DONE:[^,]+]], label %[[LBODY:[^,]+]]
+// CK0: [[LBODY]]
+// CK0: [[PTR:%.+]] = phi %class.C** [ [[PTRBEGIN]], %[[LHEAD]] ], [ [[PTRNEXT:%.+]], %[[LCORRECT:[^,]+]] ]
+// CK0: [[OBJ:%.+]] = load %class.C*, %class.C** [[PTR]]
+// CK0-DAG: [[ABEGIN:%.+]] = getelementptr inbounds %class.C, %class.C* [[OBJ]], i32 0, i32 0
+// CK0-DAG: [[BBEGIN:%.+]] = getelementptr inbounds %class.C, %class.C* [[OBJ]], i32 0, i32 1
+// CK0-DAG: [[BBEGIN2:%.+]] = getelementptr inbounds %class.C, %class.C* [[OBJ]], i32 0, i32 1
+// CK0-DAG: [[BARRBEGIN:%.+]] = load double*, double** [[BBEGIN2]]
+// CK0-DAG: [[BARRBEGINGEP:%.+]] = getelementptr inbounds double, double* [[BARRBEGIN]], i[[sz:64|32]] 0
+// CK0-DAG: [[BEND:%.+]] = getelementptr double*, double** [[BBEGIN]], i32 1
+// CK0-DAG: [[ABEGINV:%.+]] = bitcast i32* [[ABEGIN]] to i8*
+// CK0-DAG: [[BENDV:%.+]] = bitcast double** [[BEND]] to i8*
+// CK0-DAG: [[ABEGINI:%.+]] = ptrtoint i8* [[ABEGINV]] to i64
+// CK0-DAG: [[BENDI:%.+]] = ptrtoint i8* [[BENDV]] to i64
+// CK0-DAG: [[CSIZE:%.+]] = sub i64 [[BENDI]], [[ABEGINI]]
+// CK0-DAG: [[CUSIZE:%.+]] = sdiv exact i64 [[CSIZE]], ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64)
+// CK0-DAG: [[BPTRADDR0BC:%.+]] = bitcast %class.C* [[OBJ]] to i8*
+// CK0-DAG: [[PTRADDR0BC:%.+]] = bitcast i32* [[ABEGIN]] to i8*
+// CK0-DAG: [[PRESIZE:%.+]] = call i64 @__tgt_mapper_num_components(i8* [[HANDLE]])
+// CK0-DAG: [[SHIPRESIZE:%.+]] = shl i64 [[PRESIZE]], 48
+// CK0-DAG: br label %[[MEMBER:[^,]+]]
+// CK0-DAG: [[MEMBER]]
+// CK0-DAG: br i1 true, label %[[LTYPE:[^,]+]], label %[[MEMBERCOM:[^,]+]]
+// CK0-DAG: [[MEMBERCOM]]
+// CK0-DAG: [[MEMBERCOMTYPE:%.+]] = add nuw i64 32, [[SHIPRESIZE]]
+// CK0-DAG: br label %[[LTYPE]]
+// CK0-DAG: [[LTYPE]]
+// CK0-DAG: [[MEMBERTYPE:%.+]] = phi i64 [ 32, %[[MEMBER]] ], [ [[MEMBERCOMTYPE]], %[[MEMBERCOM]] ]
+// CK0-DAG: [[TYPETF:%.+]] = and i64 [[TYPE]], 3
+// CK0-DAG: [[ISALLOC:%.+]] = icmp eq i64 [[TYPETF]], 0
+// CK0-DAG: br i1 [[ISALLOC]], label %[[ALLOC:[^,]+]], label %[[ALLOCELSE:[^,]+]]
+// CK0-DAG: [[ALLOC]]
+// CK0-DAG: [[ALLOCTYPE:%.+]] = and i64 [[MEMBERTYPE]], -4
+// CK0-DAG: br label %[[TYEND:[^,]+]]
+// CK0-DAG: [[ALLOCELSE]]
+// CK0-DAG: [[ISTO:%.+]] = icmp eq i64 [[TYPETF]], 1
+// CK0-DAG: br i1 [[ISTO]], label %[[TO:[^,]+]], label %[[TOELSE:[^,]+]]
+// CK0-DAG: [[TO]]
+// CK0-DAG: [[TOTYPE:%.+]] = and i64 [[MEMBERTYPE]], -3
+// CK0-DAG: br label %[[TYEND]]
+// CK0-DAG: [[TOELSE]]
+// CK0-DAG: [[ISFROM:%.+]] = icmp eq i64 [[TYPETF]], 2
+// CK0-DAG: br i1 [[ISFROM]], label %[[FROM:[^,]+]], label %[[TYEND]]
+// CK0-DAG: [[FROM]]
+// CK0-DAG: [[FROMTYPE:%.+]] = and i64 [[MEMBERTYPE]], -2
+// CK0-DAG: br label %[[TYEND]]
+// CK0-DAG: [[TYEND]]
+// CK0-DAG: [[PHITYPE0:%.+]] = phi i64 [ [[ALLOCTYPE]], %[[ALLOC]] ], [ [[TOTYPE]], %[[TO]] ], [ [[FROMTYPE]], %[[FROM]] ], [ [[MEMBERTYPE]], %[[TOELSE]] ]
+// CK0: call void @__tgt_push_mapper_component(i8* [[HANDLE]], i8* [[BPTRADDR0BC]], i8* [[PTRADDR0BC]], i64 [[CUSIZE]], i64 [[PHITYPE0]])
+// CK0-DAG: [[BPTRADDR1BC:%.+]] = bitcast %class.C* [[OBJ]] to i8*
+// CK0-DAG: [[PTRADDR1BC:%.+]] = bitcast i32* [[ABEGIN]] to i8*
+// CK0-DAG: br label %[[MEMBER:[^,]+]]
+// CK0-DAG: [[MEMBER]]
+// CK0-DAG: br i1 false, label %[[LTYPE:[^,]+]], label %[[MEMBERCOM:[^,]+]]
+// CK0-DAG: [[MEMBERCOM]]
+// 281474976710659 == 0x1,000,000,003
+// CK0-DAG: [[MEMBERCOMTYPE:%.+]] = add nuw i64 281474976710659, [[SHIPRESIZE]]
+// CK0-DAG: br label %[[LTYPE]]
+// CK0-DAG: [[LTYPE]]
+// CK0-DAG: [[MEMBERTYPE:%.+]] = phi i64 [ 281474976710659, %[[MEMBER]] ], [ [[MEMBERCOMTYPE]], %[[MEMBERCOM]] ]
+// CK0-DAG: [[TYPETF:%.+]] = and i64 [[TYPE]], 3
+// CK0-DAG: [[ISALLOC:%.+]] = icmp eq i64 [[TYPETF]], 0
+// CK0-DAG: br i1 [[ISALLOC]], label %[[ALLOC:[^,]+]], label %[[ALLOCELSE:[^,]+]]
+// CK0-DAG: [[ALLOC]]
+// CK0-DAG: [[ALLOCTYPE:%.+]] = and i64 [[MEMBERTYPE]], -4
+// CK0-DAG: br label %[[TYEND:[^,]+]]
+// CK0-DAG: [[ALLOCELSE]]
+// CK0-DAG: [[ISTO:%.+]] = icmp eq i64 [[TYPETF]], 1
+// CK0-DAG: br i1 [[ISTO]], label %[[TO:[^,]+]], label %[[TOELSE:[^,]+]]
+// CK0-DAG: [[TO]]
+// CK0-DAG: [[TOTYPE:%.+]] = and i64 [[MEMBERTYPE]], -3
+// CK0-DAG: br label %[[TYEND]]
+// CK0-DAG: [[TOELSE]]
+// CK0-DAG: [[ISFROM:%.+]] = icmp eq i64 [[TYPETF]], 2
+// CK0-DAG: br i1 [[ISFROM]], label %[[FROM:[^,]+]], label %[[TYEND]]
+// CK0-DAG: [[FROM]]
+// CK0-DAG: [[FROMTYPE:%.+]] = and i64 [[MEMBERTYPE]], -2
+// CK0-DAG: br label %[[TYEND]]
+// CK0-DAG: [[TYEND]]
+// CK0-DAG: [[TYPE1:%.+]] = phi i64 [ [[ALLOCTYPE]], %[[ALLOC]] ], [ [[TOTYPE]], %[[TO]] ], [ [[FROMTYPE]], %[[FROM]] ], [ [[MEMBERTYPE]], %[[TOELSE]] ]
+// CK0: call void @__tgt_push_mapper_component(i8* [[HANDLE]], i8* [[BPTRADDR1BC]], i8* [[PTRADDR1BC]], i64 4, i64 [[TYPE1]])
+// CK0-DAG: [[BPTRADDR2BC:%.+]] = bitcast double** [[BBEGIN]] to i8*
+// CK0-DAG: [[PTRADDR2BC:%.+]] = bitcast double* [[BARRBEGINGEP]] to i8*
+// CK0-DAG: br label %[[MEMBER:[^,]+]]
+// CK0-DAG: [[MEMBER]]
+// CK0-DAG: br i1 false, label %[[LTYPE:[^,]+]], label %[[MEMBERCOM:[^,]+]]
+// CK0-DAG: [[MEMBERCOM]]
+// 281474976710675 == 0x1,000,000,013
+// CK0-DAG: [[MEMBERCOMTYPE:%.+]] = add nuw i64 281474976710675, [[SHIPRESIZE]]
+// CK0-DAG: br label %[[LTYPE]]
+// CK0-DAG: [[LTYPE]]
+// CK0-DAG: [[MEMBERTYPE:%.+]] = phi i64 [ 281474976710675, %[[MEMBER]] ], [ [[MEMBERCOMTYPE]], %[[MEMBERCOM]] ]
+// CK0-DAG: [[TYPETF:%.+]] = and i64 [[TYPE]], 3
+// CK0-DAG: [[ISALLOC:%.+]] = icmp eq i64 [[TYPETF]], 0
+// CK0-DAG: br i1 [[ISALLOC]], label %[[ALLOC:[^,]+]], label %[[ALLOCELSE:[^,]+]]
+// CK0-DAG: [[ALLOC]]
+// CK0-DAG: [[ALLOCTYPE:%.+]] = and i64 [[MEMBERTYPE]], -4
+// CK0-DAG: br label %[[TYEND:[^,]+]]
+// CK0-DAG: [[ALLOCELSE]]
+// CK0-DAG: [[ISTO:%.+]] = icmp eq i64 [[TYPETF]], 1
+// CK0-DAG: br i1 [[ISTO]], label %[[TO:[^,]+]], label %[[TOELSE:[^,]+]]
+// CK0-DAG: [[TO]]
+// CK0-DAG: [[TOTYPE:%.+]] = and i64 [[MEMBERTYPE]], -3
+// CK0-DAG: br label %[[TYEND]]
+// CK0-DAG: [[TOELSE]]
+// CK0-DAG: [[ISFROM:%.+]] = icmp eq i64 [[TYPETF]], 2
+// CK0-DAG: br i1 [[ISFROM]], label %[[FROM:[^,]+]], label %[[TYEND]]
+// CK0-DAG: [[FROM]]
+// CK0-DAG: [[FROMTYPE:%.+]] = and i64 [[MEMBERTYPE]], -2
+// CK0-DAG: br label %[[TYEND]]
+// CK0-DAG: [[TYEND]]
+// CK0-DAG: [[TYPE2:%.+]] = phi i64 [ [[ALLOCTYPE]], %[[ALLOC]] ], [ [[TOTYPE]], %[[TO]] ], [ [[FROMTYPE]], %[[FROM]] ], [ [[MEMBERTYPE]], %[[TOELSE]] ]
+// CK0: call void @__tgt_push_mapper_component(i8* [[HANDLE]], i8* [[BPTRADDR2BC]], i8* [[PTRADDR2BC]], i64 16, i64 [[TYPE2]])
+// CK0: [[PTRNEXT]] = getelementptr %class.C*, %class.C** [[PTR]], i32 1
+// CK0: [[ISDONE:%.+]] = icmp eq %class.C** [[PTRNEXT]], [[PTREND]]
+// CK0: br i1 [[ISDONE]], label %[[LEXIT:[^,]+]], label %[[LBODY]]
+
+// CK0: [[LEXIT]]
+// CK0: [[ISARRAY:%.+]] = icmp sge i64 [[SIZE]], 1
+// CK0: br i1 [[ISARRAY]], label %[[EVALDEL:[^,]+]], label %[[DONE]]
+// CK0: [[EVALDEL]]
+// CK0: [[TYPEDEL:%.+]] = and i64 [[TYPE]], 8
+// CK0: [[ISDEL:%.+]] = icmp ne i64 [[TYPEDEL]], 0
+// CK0: br i1 [[ISDEL]], label %[[DEL:[^,]+]], label %[[DONE]]
+// CK0: [[DEL]]
+// CK0-64-DAG: [[ARRSIZE:%.+]] = mul nuw i64 [[SIZE]], 16
+// CK0-32-DAG: [[ARRSIZE:%.+]] = mul nuw i64 [[SIZE]], 8
+// CK0-DAG: [[DTYPE:%.+]] = and i64 [[TYPE]], -4
+// CK0: call void @__tgt_push_mapper_component(i8* [[HANDLE]], i8* [[BPTR]], i8* [[BEGIN]], i64 [[ARRSIZE]], i64 [[DTYPE]])
+// CK0: br label %[[DONE]]
+// CK0: [[DONE]]
+// CK0: ret void
+
+
+// CK0-LABEL: define {{.*}}void @{{.*}}foo{{.*}}
void foo(int a){
int i = a;
C c;
c.a = a;
- // CHECK-DAG: call i32 @__tgt_target(i64 {{.+}}, i8* {{.+}}, i32 1, i8** [[BPGEP:%[0-9]+]], i8** [[PGEP:%[0-9]+]], {{.+}}[[SIZES]]{{.+}}, {{.+}}[[TYPES]]{{.+}})
- // CHECK-DAG: [[BPGEP]] = getelementptr inbounds {{.+}}[[BPS:%[^,]+]], i32 0, i32 0
- // CHECK-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0
- // CHECK-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0
- // CHECK-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0
- // CHECK-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to %class.C**
- // CHECK-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to %class.C**
- // CHECK-DAG: store %class.C* [[VAL:%[^,]+]], %class.C** [[CBP1]]
- // CHECK-DAG: store %class.C* [[VAL]], %class.C** [[CP1]]
- // CHECK: call void [[KERNEL:@.+]](%class.C* [[VAL]])
+ // CK0-DAG: call i32 @__tgt_target(i64 {{.+}}, i8* {{.+}}, i32 1, i8** [[BPGEP:%[0-9]+]], i8** [[PGEP:%[0-9]+]], {{.+}}[[SIZES]]{{.+}}, {{.+}}[[TYPES]]{{.+}})
+ // CK0-DAG: [[BPGEP]] = getelementptr inbounds {{.+}}[[BPS:%[^,]+]], i32 0, i32 0
+ // CK0-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0
+ // CK0-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0
+ // CK0-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0
+ // CK0-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to %class.C**
+ // CK0-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to %class.C**
+ // CK0-DAG: store %class.C* [[VAL:%[^,]+]], %class.C** [[CBP1]]
+ // CK0-DAG: store %class.C* [[VAL]], %class.C** [[CP1]]
+ // CK0: call void [[KERNEL:@.+]](%class.C* [[VAL]])
#pragma omp target map(mapper(id),tofrom: c)
{
++c.a;
}
- // CHECK-DAG: call void @__tgt_target_data_update(i64 -1, i32 1, i8** [[TGEPBP:%.+]], i8** [[TGEPP:%.+]], i[[sz]]* getelementptr {{.+}}[1 x i[[sz]]]* [[TSIZES]], i32 0, i32 0), {{.+}}getelementptr {{.+}}[1 x i64]* [[TTYPES]]{{.+}})
- // CHECK-DAG: [[TGEPBP]] = getelementptr inbounds {{.+}}[[TBP:%[^,]+]], i{{.+}} 0, i{{.+}} 0
- // CHECK-DAG: [[TGEPP]] = getelementptr inbounds {{.+}}[[TP:%[^,]+]], i{{.+}} 0, i{{.+}} 0
- // CHECK-DAG: [[TBP0:%.+]] = getelementptr inbounds {{.+}}[[TBP]], i{{.+}} 0, i{{.+}} 0
- // CHECK-DAG: [[TP0:%.+]] = getelementptr inbounds {{.+}}[[TP]], i{{.+}} 0, i{{.+}} 0
- // CHECK-DAG: [[TCBP0:%.+]] = bitcast i8** [[TBP0]] to %class.C**
- // CHECK-DAG: [[TCP0:%.+]] = bitcast i8** [[TP0]] to %class.C**
- // CHECK-DAG: store %class.C* [[VAL]], %class.C** [[TCBP0]]
- // CHECK-DAG: store %class.C* [[VAL]], %class.C** [[TCP0]]
+ // CK0-DAG: call void @__tgt_target_data_update(i64 -1, i32 1, i8** [[TGEPBP:%.+]], i8** [[TGEPP:%.+]], i64* getelementptr {{.+}}[1 x i64]* [[TSIZES]], i32 0, i32 0), {{.+}}getelementptr {{.+}}[1 x i64]* [[TTYPES]]{{.+}})
+ // CK0-DAG: [[TGEPBP]] = getelementptr inbounds {{.+}}[[TBP:%[^,]+]], i{{.+}} 0, i{{.+}} 0
+ // CK0-DAG: [[TGEPP]] = getelementptr inbounds {{.+}}[[TP:%[^,]+]], i{{.+}} 0, i{{.+}} 0
+ // CK0-DAG: [[TBP0:%.+]] = getelementptr inbounds {{.+}}[[TBP]], i{{.+}} 0, i{{.+}} 0
+ // CK0-DAG: [[TP0:%.+]] = getelementptr inbounds {{.+}}[[TP]], i{{.+}} 0, i{{.+}} 0
+ // CK0-DAG: [[TCBP0:%.+]] = bitcast i8** [[TBP0]] to %class.C**
+ // CK0-DAG: [[TCP0:%.+]] = bitcast i8** [[TP0]] to %class.C**
+ // CK0-DAG: store %class.C* [[VAL]], %class.C** [[TCBP0]]
+ // CK0-DAG: store %class.C* [[VAL]], %class.C** [[TCP0]]
#pragma omp target update to(mapper(id): c)
- // CHECK-DAG: call void @__tgt_target_data_update(i64 -1, i32 1, i8** [[FGEPBP:%.+]], i8** [[FGEPP:%.+]], i[[sz]]* getelementptr {{.+}}[1 x i[[sz]]]* [[FSIZES]], i32 0, i32 0), {{.+}}getelementptr {{.+}}[1 x i64]* [[FTYPES]]{{.+}})
- // CHECK-DAG: [[FGEPBP]] = getelementptr inbounds {{.+}}[[FBP:%[^,]+]], i{{.+}} 0, i{{.+}} 0
- // CHECK-DAG: [[FGEPP]] = getelementptr inbounds {{.+}}[[FP:%[^,]+]], i{{.+}} 0, i{{.+}} 0
- // CHECK-DAG: [[FBP0:%.+]] = getelementptr inbounds {{.+}}[[FBP]], i{{.+}} 0, i{{.+}} 0
- // CHECK-DAG: [[FP0:%.+]] = getelementptr inbounds {{.+}}[[FP]], i{{.+}} 0, i{{.+}} 0
- // CHECK-DAG: [[FCBP0:%.+]] = bitcast i8** [[FBP0]] to %class.C**
- // CHECK-DAG: [[FCP0:%.+]] = bitcast i8** [[FP0]] to %class.C**
- // CHECK-DAG: store %class.C* [[VAL]], %class.C** [[FCBP0]]
- // CHECK-DAG: store %class.C* [[VAL]], %class.C** [[FCP0]]
+ // CK0-DAG: call void @__tgt_target_data_update(i64 -1, i32 1, i8** [[FGEPBP:%.+]], i8** [[FGEPP:%.+]], i64* getelementptr {{.+}}[1 x i64]* [[FSIZES]], i32 0, i32 0), {{.+}}getelementptr {{.+}}[1 x i64]* [[FTYPES]]{{.+}})
+ // CK0-DAG: [[FGEPBP]] = getelementptr inbounds {{.+}}[[FBP:%[^,]+]], i{{.+}} 0, i{{.+}} 0
+ // CK0-DAG: [[FGEPP]] = getelementptr inbounds {{.+}}[[FP:%[^,]+]], i{{.+}} 0, i{{.+}} 0
+ // CK0-DAG: [[FBP0:%.+]] = getelementptr inbounds {{.+}}[[FBP]], i{{.+}} 0, i{{.+}} 0
+ // CK0-DAG: [[FP0:%.+]] = getelementptr inbounds {{.+}}[[FP]], i{{.+}} 0, i{{.+}} 0
+ // CK0-DAG: [[FCBP0:%.+]] = bitcast i8** [[FBP0]] to %class.C**
+ // CK0-DAG: [[FCP0:%.+]] = bitcast i8** [[FP0]] to %class.C**
+ // CK0-DAG: store %class.C* [[VAL]], %class.C** [[FCBP0]]
+ // CK0-DAG: store %class.C* [[VAL]], %class.C** [[FCP0]]
#pragma omp target update from(mapper(id): c)
}
-// CHECK: define internal void [[KERNEL]](%class.C* {{.+}}[[ARG:%.+]])
-// CHECK: [[ADDR:%.+]] = alloca %class.C*,
-// CHECK: store %class.C* [[ARG]], %class.C** [[ADDR]]
-// CHECK: [[CADDR:%.+]] = load %class.C*, %class.C** [[ADDR]]
-// CHECK: [[CAADDR:%.+]] = getelementptr inbounds %class.C, %class.C* [[CADDR]], i32 0, i32 0
-// CHECK: [[VAL:%[^,]+]] = load i32, i32* [[CAADDR]]
-// CHECK: {{.+}} = add nsw i32 [[VAL]], 1
-// CHECK: }
+// CK0: define internal void [[KERNEL]](%class.C* {{.+}}[[ARG:%.+]])
+// CK0: [[ADDR:%.+]] = alloca %class.C*,
+// CK0: store %class.C* [[ARG]], %class.C** [[ADDR]]
+// CK0: [[CADDR:%.+]] = load %class.C*, %class.C** [[ADDR]]
+// CK0: [[CAADDR:%.+]] = getelementptr inbounds %class.C, %class.C* [[CADDR]], i32 0, i32 0
+// CK0: [[VAL:%[^,]+]] = load i32, i32* [[CAADDR]]
+// CK0: {{.+}} = add nsw i32 [[VAL]], 1
+// CK0: }
+
+#endif
+
+
+///==========================================================================///
+// RUN: %clang_cc1 -DCK1 -verify -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm -femit-all-decls -disable-llvm-passes %s -o - | FileCheck --check-prefix CK1 --check-prefix CK1-64 %s
+// RUN: %clang_cc1 -DCK1 -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -femit-all-decls -disable-llvm-passes -o %t %s
+// RUN: %clang_cc1 -DCK1 -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -femit-all-decls -disable-llvm-passes -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix CK1 --check-prefix CK1-64 %s
+// RUN: %clang_cc1 -DCK1 -verify -fopenmp -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm -femit-all-decls -disable-llvm-passes %s -o - | FileCheck --check-prefix CK1 --check-prefix CK1-32 %s
+// RUN: %clang_cc1 -DCK1 -fopenmp -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -femit-all-decls -disable-llvm-passes -o %t %s
+// RUN: %clang_cc1 -DCK1 -fopenmp -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -femit-all-decls -disable-llvm-passes -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix CK1 --check-prefix CK1-32 %s
+
+// RUN: %clang_cc1 -DCK1 -verify -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm -femit-all-decls -disable-llvm-passes %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DCK1 -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -femit-all-decls -disable-llvm-passes -o %t %s
+// RUN: %clang_cc1 -DCK1 -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -femit-all-decls -disable-llvm-passes -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DCK1 -verify -fopenmp-simd -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm -femit-all-decls -disable-llvm-passes %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DCK1 -fopenmp-simd -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -femit-all-decls -disable-llvm-passes -o %t %s
+// RUN: %clang_cc1 -DCK1 -fopenmp-simd -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -femit-all-decls -disable-llvm-passes -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+
+#ifdef CK1
+
+template <class T>
+class C {
+public:
+ T a;
+};
+
+#pragma omp declare mapper(id: C<int> s) map(s.a)
+
+// CK1-LABEL: define {{.*}}void @.omp_mapper.{{.*}}C{{.*}}.id{{.*}}(i8*{{.*}}, i8*{{.*}}, i8*{{.*}}, i64{{.*}}, i64{{.*}})
+// CK1: store i8* %{{[^,]+}}, i8** [[HANDLEADDR:%[^,]+]]
+// CK1: store i8* %{{[^,]+}}, i8** [[BPTRADDR:%[^,]+]]
+// CK1: store i8* %{{[^,]+}}, i8** [[VPTRADDR:%[^,]+]]
+// CK1: store i64 %{{[^,]+}}, i{{64|32}}* [[SIZEADDR:%[^,]+]]
+// CK1: store i64 %{{[^,]+}}, i64* [[TYPEADDR:%[^,]+]]
+// CK1-DAG: [[SIZE:%.+]] = load i64, i64* [[SIZEADDR]]
+// CK1-DAG: [[TYPE:%.+]] = load i64, i64* [[TYPEADDR]]
+// CK1-DAG: [[HANDLE:%.+]] = load i8*, i8** [[HANDLEADDR]]
+// CK1-DAG: [[PTRBEGIN:%.+]] = bitcast i8** [[VPTRADDR]] to %class.C**
+// CK1-DAG: [[PTREND:%.+]] = getelementptr %class.C*, %class.C** [[PTRBEGIN]], i64 [[SIZE]]
+// CK1-DAG: [[BPTR:%.+]] = load i8*, i8** [[BPTRADDR]]
+// CK1-DAG: [[BEGIN:%.+]] = load i8*, i8** [[VPTRADDR]]
+// CK1: [[ISARRAY:%.+]] = icmp sge i64 [[SIZE]], 1
+// CK1: br i1 [[ISARRAY]], label %[[INITEVALDEL:[^,]+]], label %[[LHEAD:[^,]+]]
+
+// CK1: [[INITEVALDEL]]
+// CK1: [[TYPEDEL:%.+]] = and i64 [[TYPE]], 8
+// CK1: [[ISNOTDEL:%.+]] = icmp eq i64 [[TYPEDEL]], 0
+// CK1: br i1 [[ISNOTDEL]], label %[[INIT:[^,]+]], label %[[LHEAD:[^,]+]]
+// CK1: [[INIT]]
+// CK1-DAG: [[ARRSIZE:%.+]] = mul nuw i64 [[SIZE]], 4
+// CK1-DAG: [[ITYPE:%.+]] = and i64 [[TYPE]], -4
+// CK1: call void @__tgt_push_mapper_component(i8* [[HANDLE]], i8* [[BPTR]], i8* [[BEGIN]], i64 [[ARRSIZE]], i64 [[ITYPE]])
+// CK1: br label %[[LHEAD:[^,]+]]
+
+// CK1: [[LHEAD]]
+// CK1: [[ISEMPTY:%.+]] = icmp eq %class.C** [[PTRBEGIN]], [[PTREND]]
+// CK1: br i1 [[ISEMPTY]], label %[[DONE:[^,]+]], label %[[LBODY:[^,]+]]
+// CK1: [[LBODY]]
+// CK1: [[PTR:%.+]] = phi %class.C** [ [[PTRBEGIN]], %[[LHEAD]] ], [ [[PTRNEXT:%.+]], %[[LCORRECT:[^,]+]] ]
+// CK1: [[OBJ:%.+]] = load %class.C*, %class.C** [[PTR]]
+// CK1-DAG: [[ABEGIN:%.+]] = getelementptr inbounds %class.C, %class.C* [[OBJ]], i32 0, i32 0
+// CK1-DAG: [[AEND:%.+]] = getelementptr i32, i32* [[ABEGIN]], i32 1
+// CK1-DAG: [[ABEGINV:%.+]] = bitcast i32* [[ABEGIN]] to i8*
+// CK1-DAG: [[AENDV:%.+]] = bitcast i32* [[AEND]] to i8*
+// CK1-DAG: [[ABEGINI:%.+]] = ptrtoint i8* [[ABEGINV]] to i64
+// CK1-DAG: [[AENDI:%.+]] = ptrtoint i8* [[AENDV]] to i64
+// CK1-DAG: [[CSIZE:%.+]] = sub i64 [[AENDI]], [[ABEGINI]]
+// CK1-DAG: [[CUSIZE:%.+]] = sdiv exact i64 [[CSIZE]], ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64)
+// CK1-DAG: [[BPTRADDR0BC:%.+]] = bitcast %class.C* [[OBJ]] to i8*
+// CK1-DAG: [[PTRADDR0BC:%.+]] = bitcast i32* [[ABEGIN]] to i8*
+// CK1-DAG: [[PRESIZE:%.+]] = call i64 @__tgt_mapper_num_components(i8* [[HANDLE]])
+// CK1-DAG: [[SHIPRESIZE:%.+]] = shl i64 [[PRESIZE]], 48
+// CK1-DAG: br label %[[MEMBER:[^,]+]]
+// CK1-DAG: [[MEMBER]]
+// CK1-DAG: br i1 true, label %[[LTYPE:[^,]+]], label %[[MEMBERCOM:[^,]+]]
+// CK1-DAG: [[MEMBERCOM]]
+// CK1-DAG: [[MEMBERCOMTYPE:%.+]] = add nuw i64 32, [[SHIPRESIZE]]
+// CK1-DAG: br label %[[LTYPE]]
+// CK1-DAG: [[LTYPE]]
+// CK1-DAG: [[MEMBERTYPE:%.+]] = phi i64 [ 32, %[[MEMBER]] ], [ [[MEMBERCOMTYPE]], %[[MEMBERCOM]] ]
+// CK1-DAG: [[TYPETF:%.+]] = and i64 [[TYPE]], 3
+// CK1-DAG: [[ISALLOC:%.+]] = icmp eq i64 [[TYPETF]], 0
+// CK1-DAG: br i1 [[ISALLOC]], label %[[ALLOC:[^,]+]], label %[[ALLOCELSE:[^,]+]]
+// CK1-DAG: [[ALLOC]]
+// CK1-DAG: [[ALLOCTYPE:%.+]] = and i64 [[MEMBERTYPE]], -4
+// CK1-DAG: br label %[[TYEND:[^,]+]]
+// CK1-DAG: [[ALLOCELSE]]
+// CK1-DAG: [[ISTO:%.+]] = icmp eq i64 [[TYPETF]], 1
+// CK1-DAG: br i1 [[ISTO]], label %[[TO:[^,]+]], label %[[TOELSE:[^,]+]]
+// CK1-DAG: [[TO]]
+// CK1-DAG: [[TOTYPE:%.+]] = and i64 [[MEMBERTYPE]], -3
+// CK1-DAG: br label %[[TYEND]]
+// CK1-DAG: [[TOELSE]]
+// CK1-DAG: [[ISFROM:%.+]] = icmp eq i64 [[TYPETF]], 2
+// CK1-DAG: br i1 [[ISFROM]], label %[[FROM:[^,]+]], label %[[TYEND]]
+// CK1-DAG: [[FROM]]
+// CK1-DAG: [[FROMTYPE:%.+]] = and i64 [[MEMBERTYPE]], -2
+// CK1-DAG: br label %[[TYEND]]
+// CK1-DAG: [[TYEND]]
+// CK1-DAG: [[TYPE0:%.+]] = phi i64 [ [[ALLOCTYPE]], %[[ALLOC]] ], [ [[TOTYPE]], %[[TO]] ], [ [[FROMTYPE]], %[[FROM]] ], [ [[MEMBERTYPE]], %[[TOELSE]] ]
+// CK1-64: call void @__tgt_push_mapper_component(i8* [[HANDLE]], i8* [[BPTRADDR0BC]], i8* [[PTRADDR0BC]], i64 [[CUSIZE]], i64 [[TYPE0]])
+// CK1-DAG: [[BPTRADDR1BC:%.+]] = bitcast %class.C* [[OBJ]] to i8*
+// CK1-DAG: [[PTRADDR1BC:%.+]] = bitcast i32* [[ABEGIN]] to i8*
+// CK1-DAG: br label %[[MEMBER:[^,]+]]
+// CK1-DAG: [[MEMBER]]
+// CK1-DAG: br i1 false, label %[[LTYPE:[^,]+]], label %[[MEMBERCOM:[^,]+]]
+// CK1-DAG: [[MEMBERCOM]]
+// 281474976710659 == 0x1,000,000,003
+// CK1-DAG: [[MEMBERCOMTYPE:%.+]] = add nuw i64 281474976710659, [[SHIPRESIZE]]
+// CK1-DAG: br label %[[LTYPE]]
+// CK1-DAG: [[LTYPE]]
+// CK1-DAG: [[MEMBERTYPE:%.+]] = phi i64 [ 281474976710659, %[[MEMBER]] ], [ [[MEMBERCOMTYPE]], %[[MEMBERCOM]] ]
+// CK1-DAG: [[TYPETF:%.+]] = and i64 [[TYPE]], 3
+// CK1-DAG: [[ISALLOC:%.+]] = icmp eq i64 [[TYPETF]], 0
+// CK1-DAG: br i1 [[ISALLOC]], label %[[ALLOC:[^,]+]], label %[[ALLOCELSE:[^,]+]]
+// CK1-DAG: [[ALLOC]]
+// CK1-DAG: [[ALLOCTYPE:%.+]] = and i64 [[MEMBERTYPE]], -4
+// CK1-DAG: br label %[[TYEND:[^,]+]]
+// CK1-DAG: [[ALLOCELSE]]
+// CK1-DAG: [[ISTO:%.+]] = icmp eq i64 [[TYPETF]], 1
+// CK1-DAG: br i1 [[ISTO]], label %[[TO:[^,]+]], label %[[TOELSE:[^,]+]]
+// CK1-DAG: [[TO]]
+// CK1-DAG: [[TOTYPE:%.+]] = and i64 [[MEMBERTYPE]], -3
+// CK1-DAG: br label %[[TYEND]]
+// CK1-DAG: [[TOELSE]]
+// CK1-DAG: [[ISFROM:%.+]] = icmp eq i64 [[TYPETF]], 2
+// CK1-DAG: br i1 [[ISFROM]], label %[[FROM:[^,]+]], label %[[TYEND]]
+// CK1-DAG: [[FROM]]
+// CK1-DAG: [[FROMTYPE:%.+]] = and i64 [[MEMBERTYPE]], -2
+// CK1-DAG: br label %[[TYEND]]
+// CK1-DAG: [[TYEND]]
+// CK1-DAG: [[TYPE1:%.+]] = phi i64 [ [[ALLOCTYPE]], %[[ALLOC]] ], [ [[TOTYPE]], %[[TO]] ], [ [[FROMTYPE]], %[[FROM]] ], [ [[MEMBERTYPE]], %[[TOELSE]] ]
+// CK1: call void @__tgt_push_mapper_component(i8* [[HANDLE]], i8* [[BPTRADDR1BC]], i8* [[PTRADDR1BC]], i64 4, i64 [[TYPE1]])
+// CK1: [[PTRNEXT]] = getelementptr %class.C*, %class.C** [[PTR]], i32 1
+// CK1: [[ISDONE:%.+]] = icmp eq %class.C** [[PTRNEXT]], [[PTREND]]
+// CK1: br i1 [[ISDONE]], label %[[LEXIT:[^,]+]], label %[[LBODY]]
+
+// CK1: [[LEXIT]]
+// CK1: [[ISARRAY:%.+]] = icmp sge i64 [[SIZE]], 1
+// CK1: br i1 [[ISARRAY]], label %[[EVALDEL:[^,]+]], label %[[DONE]]
+// CK1: [[EVALDEL]]
+// CK1: [[TYPEDEL:%.+]] = and i64 [[TYPE]], 8
+// CK1: [[ISDEL:%.+]] = icmp ne i64 [[TYPEDEL]], 0
+// CK1: br i1 [[ISDEL]], label %[[DEL:[^,]+]], label %[[DONE]]
+// CK1: [[DEL]]
+// CK1-DAG: [[ARRSIZE:%.+]] = mul nuw i64 [[SIZE]], 4
+// CK1-DAG: [[DTYPE:%.+]] = and i64 [[TYPE]], -4
+// CK1: call void @__tgt_push_mapper_component(i8* [[HANDLE]], i8* [[BPTR]], i8* [[BEGIN]], i64 [[ARRSIZE]], i64 [[DTYPE]])
+// CK1: br label %[[DONE]]
+// CK1: [[DONE]]
+// CK1: ret void
+
+#endif
#endif
diff --git a/src/llvm-project/clang/test/OpenMP/declare_mapper_messages.c b/src/llvm-project/clang/test/OpenMP/declare_mapper_messages.c
index 51b761e..a7400b6 100644
--- a/src/llvm-project/clang/test/OpenMP/declare_mapper_messages.c
+++ b/src/llvm-project/clang/test/OpenMP/declare_mapper_messages.c
@@ -36,6 +36,8 @@
{
#pragma omp declare mapper(id: struct vec v) map(v.len) allocate(v) // expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp declare mapper'}}
struct vec vv, v1;
+ struct vec arr[10];
+ double d;
#pragma omp target map(mapper) // expected-error {{use of undeclared identifier 'mapper'}}
{}
#pragma omp target map(mapper:vv) // expected-error {{expected '(' after 'mapper'}}
@@ -46,9 +48,13 @@
{}
#pragma omp target map(mapper(ab) :vv) // expected-error {{missing map type}} expected-error {{cannot find a valid user-defined mapper for type 'struct vec' with name 'ab'}}
{}
+#pragma omp target map(mapper(ab) :arr[0:2]) // expected-error {{missing map type}} expected-error {{cannot find a valid user-defined mapper for type 'struct vec' with name 'ab'}}
+ {}
#pragma omp target map(mapper(aa) :vv) // expected-error {{missing map type}}
{}
-#pragma omp target map(mapper(aa) to:vv) map(close mapper(aa) from:v1)
+#pragma omp target map(mapper(aa) to:d) // expected-error {{mapper type must be of struct, union or class type}}
+ {}
+#pragma omp target map(mapper(aa) to:vv) map(close mapper(aa) from:v1) map(mapper(aa) to:arr[0])
{}
#pragma omp target update to(mapper) // expected-error {{expected '(' after 'mapper'}} expected-error {{expected expression}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
@@ -57,7 +63,10 @@
#pragma omp target update to(mapper(:vv) // expected-error {{illegal OpenMP user-defined mapper identifier}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
#pragma omp target update to(mapper(aa :vv) // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
#pragma omp target update to(mapper(ab):vv) // expected-error {{cannot find a valid user-defined mapper for type 'struct vec' with name 'ab'}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
-#pragma omp target update to(mapper(aa):vv)
+#pragma omp target update to(mapper(ab):arr[0:2]) // expected-error {{cannot find a valid user-defined mapper for type 'struct vec' with name 'ab'}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
+#pragma omp target update to(mapper(aa) a:vv) // expected-warning {{missing ':' after ) - ignoring}}
+#pragma omp target update to(mapper(aa):d) // expected-error {{mapper type must be of struct, union or class type}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
+#pragma omp target update to(mapper(aa):vv) to(mapper(aa):arr[0])
#pragma omp target update from(mapper) // expected-error {{expected '(' after 'mapper'}} expected-error {{expected expression}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
#pragma omp target update from(mapper() // expected-error {{illegal OpenMP user-defined mapper identifier}} expected-error {{expected expression}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
@@ -65,8 +74,10 @@
#pragma omp target update from(mapper(:vv) // expected-error {{illegal OpenMP user-defined mapper identifier}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
#pragma omp target update from(mapper(aa :vv) // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
#pragma omp target update from(mapper(ab):vv) // expected-error {{cannot find a valid user-defined mapper for type 'struct vec' with name 'ab'}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
+#pragma omp target update from(mapper(ab):arr[0:2]) // expected-error {{cannot find a valid user-defined mapper for type 'struct vec' with name 'ab'}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
#pragma omp target update from(mapper(aa) a:vv) // expected-warning {{missing ':' after ) - ignoring}}
-#pragma omp target update from(mapper(aa):vv)
+#pragma omp target update from(mapper(aa):d) // expected-error {{mapper type must be of struct, union or class type}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
+#pragma omp target update from(mapper(aa):vv) from(mapper(aa):arr[0])
}
}
return arg;
diff --git a/src/llvm-project/clang/test/OpenMP/declare_mapper_messages.cpp b/src/llvm-project/clang/test/OpenMP/declare_mapper_messages.cpp
index bcb5ac4..bd91cda 100644
--- a/src/llvm-project/clang/test/OpenMP/declare_mapper_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/declare_mapper_messages.cpp
@@ -8,12 +8,12 @@
int temp; // expected-note {{'temp' declared here}}
-class vec { // expected-note {{definition of 'vec' is not complete until the closing '}'}}
+class vec {
private:
int p; // expected-note {{declared private here}}
public:
int len;
-#pragma omp declare mapper(id: vec v) map(v.len) // expected-error {{member access into incomplete type 'vec'}}
+#pragma omp declare mapper(id: vec v) map(v.len)
double *data;
};
@@ -64,6 +64,7 @@
{
#pragma omp declare mapper(id: vec v) map(v.len)
vec vv, v1;
+ vec arr[10];
#pragma omp target map(mapper) // expected-error {{use of undeclared identifier 'mapper'}}
{}
#pragma omp target map(mapper:vv) // expected-error {{expected '(' after 'mapper'}}
@@ -82,7 +83,9 @@
{}
#pragma omp target map(mapper(N1::aa) alloc:vv) // expected-error {{cannot find a valid user-defined mapper for type 'vec' with name 'aa'}}
{}
-#pragma omp target map(mapper(aa) to:vv) map(close mapper(aa) from:v1)
+#pragma omp target map(mapper(N1::aa) alloc:arr[0:2]) // expected-error {{cannot find a valid user-defined mapper for type 'vec' with name 'aa'}}
+ {}
+#pragma omp target map(mapper(aa) to:vv) map(close mapper(aa) from:v1) map(mapper(aa) to:arr[0])
{}
#pragma omp target map(mapper(N1::stack<int>::id) to:vv)
{}
@@ -96,8 +99,9 @@
#pragma omp target update to(mapper(N1:: :vv) // expected-error {{illegal OpenMP user-defined mapper identifier}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
#pragma omp target update to(mapper(N1::aa) :vv) // expected-error {{cannot find a valid user-defined mapper for type 'vec' with name 'aa'}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
#pragma omp target update to(mapper(ab):vv) // expected-error {{cannot find a valid user-defined mapper for type 'vec' with name 'ab'}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
+#pragma omp target update to(mapper(ab):arr[0:2]) // expected-error {{cannot find a valid user-defined mapper for type 'vec' with name 'ab'}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
#pragma omp target update to(mapper(aa) a:vv) // expected-warning {{missing ':' after ) - ignoring}}
-#pragma omp target update to(mapper(aa):vv)
+#pragma omp target update to(mapper(aa):vv) to(mapper(aa):arr[0])
#pragma omp target update to(mapper(N1::stack<int>::id) :vv)
#pragma omp target update from(mapper) // expected-error {{expected '(' after 'mapper'}} expected-error {{expected expression}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
@@ -109,8 +113,9 @@
#pragma omp target update from(mapper(N1:: :vv) // expected-error {{illegal OpenMP user-defined mapper identifier}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
#pragma omp target update from(mapper(N1::aa) :vv) // expected-error {{cannot find a valid user-defined mapper for type 'vec' with name 'aa'}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
#pragma omp target update from(mapper(ab):vv) // expected-error {{cannot find a valid user-defined mapper for type 'vec' with name 'ab'}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
+#pragma omp target update from(mapper(ab):arr[0:2]) // expected-error {{cannot find a valid user-defined mapper for type 'vec' with name 'ab'}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
#pragma omp target update from(mapper(aa) a:vv) // expected-warning {{missing ':' after ) - ignoring}}
-#pragma omp target update from(mapper(aa):vv)
+#pragma omp target update from(mapper(aa):vv) from(mapper(aa):arr[0])
#pragma omp target update from(mapper(N1::stack<int>::id) :vv)
}
#pragma omp declare mapper(id: vec v) map(v.len) // expected-error {{redefinition of user-defined mapper for type 'vec' with name 'id'}}
diff --git a/src/llvm-project/clang/test/OpenMP/declare_reduction_ast_print.cpp b/src/llvm-project/clang/test/OpenMP/declare_reduction_ast_print.cpp
index 6344394..8de954e 100644
--- a/src/llvm-project/clang/test/OpenMP/declare_reduction_ast_print.cpp
+++ b/src/llvm-project/clang/test/OpenMP/declare_reduction_ast_print.cpp
@@ -23,14 +23,24 @@
// CHECK: #pragma omp declare reduction (+ : int : omp_out *= omp_in){{$}}
// CHECK-NEXT: #pragma omp declare reduction (+ : char : omp_out *= omp_in)
+
template <class T>
class SSS {
public:
#pragma omp declare reduction(fun : T : omp_out += omp_in) initializer(omp_priv = omp_orig + 15)
- // CHECK: #pragma omp declare reduction (fun : T : omp_out += omp_in) initializer(omp_priv = omp_orig + 15)
- // CHECK: #pragma omp declare reduction (fun : int : omp_out += omp_in) initializer(omp_priv = omp_orig + 15)
+#pragma omp declare reduction(fun1 : T : omp_out=1, omp_out=foo(omp_in)) initializer(omp_priv = omp_orig + 14)
+ static T foo(T &);
};
+// CHECK: template <class T> class SSS {
+// CHECK: #pragma omp declare reduction (fun : T : omp_out += omp_in) initializer(omp_priv = omp_orig + 15)
+// CHECK: #pragma omp declare reduction (fun1 : T : omp_out = 1 , omp_out = foo(omp_in)) initializer(omp_priv = omp_orig + 14)
+// CHECK: };
+// CHECK: template<> class SSS<int> {
+// CHECK: #pragma omp declare reduction (fun : int : omp_out += omp_in) initializer(omp_priv = omp_orig + 15)
+// CHECK: #pragma omp declare reduction (fun1 : int : omp_out = 1 , omp_out = foo(omp_in)) initializer(omp_priv = omp_orig + 14)
+// CHECK: };
+
SSS<int> d;
void init(SSS<int> &lhs, SSS<int> rhs);
diff --git a/src/llvm-project/clang/test/OpenMP/declare_reduction_codegen.c b/src/llvm-project/clang/test/OpenMP/declare_reduction_codegen.c
index 8ccb8cc..efc2466 100644
--- a/src/llvm-project/clang/test/OpenMP/declare_reduction_codegen.c
+++ b/src/llvm-project/clang/test/OpenMP/declare_reduction_codegen.c
@@ -15,18 +15,18 @@
// CHECK-LOAD: [[SSS_INT:.+]] = type { i32 }
#pragma omp declare reduction(+ : int, char : omp_out *= omp_in)
-// CHECK: define internal {{.*}}void @{{[^(]+}}(i32* noalias, i32* noalias)
+// CHECK: define internal {{.*}}void @{{[^(]+}}(i32* noalias %0, i32* noalias %1)
// CHECK: [[MUL:%.+]] = mul nsw i32
// CHECK-NEXT: store i32 [[MUL]], i32*
// CHECK-NEXT: ret void
// CHECK-NEXT: }
-// CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}(i32* noalias, i32* noalias)
+// CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}(i32* noalias %0, i32* noalias %1)
// CHECK-LOAD: [[MUL:%.+]] = mul nsw i32
// CHECK-LOAD-NEXT: store i32 [[MUL]], i32*
// CHECK-LOAD-NEXT: ret void
// CHECK-LOAD-NEXT: }
-// CHECK: define internal {{.*}}void @{{[^(]+}}(i8* noalias, i8* noalias)
+// CHECK: define internal {{.*}}void @{{[^(]+}}(i8* noalias %0, i8* noalias %1)
// CHECK: sext i8
// CHECK: sext i8
// CHECK: [[MUL:%.+]] = mul nsw i32
@@ -34,7 +34,7 @@
// CHECK-NEXT: store i8 [[TRUNC]], i8*
// CHECK-NEXT: ret void
// CHECK-NEXT: }
-// CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}(i8* noalias, i8* noalias)
+// CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}(i8* noalias %0, i8* noalias %1)
// CHECK-LOAD: sext i8
// CHECK-LOAD: sext i8
// CHECK-LOAD: [[MUL:%.+]] = mul nsw i32
@@ -44,22 +44,22 @@
// CHECK-LOAD-NEXT: }
#pragma omp declare reduction(fun : float : omp_out += omp_in) initializer(omp_priv = 15 + omp_orig)
-// CHECK: define internal {{.*}}void @{{[^(]+}}(float* noalias, float* noalias)
+// CHECK: define internal {{.*}}void @{{[^(]+}}(float* noalias %0, float* noalias %1)
// CHECK: [[ADD:%.+]] = fadd float
// CHECK-NEXT: store float [[ADD]], float*
// CHECK-NEXT: ret void
// CHECK-NEXT: }
-// CHECK: define internal {{.*}}void @{{[^(]+}}(float* noalias, float* noalias)
+// CHECK: define internal {{.*}}void @{{[^(]+}}(float* noalias %0, float* noalias %1)
// CHECK: [[ADD:%.+]] = fadd float 1.5
// CHECK-NEXT: store float [[ADD]], float*
// CHECK-NEXT: ret void
// CHECK-NEXT: }
-// CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}(float* noalias, float* noalias)
+// CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}(float* noalias %0, float* noalias %1)
// CHECK-LOAD: [[ADD:%.+]] = fadd float
// CHECK-LOAD-NEXT: store float [[ADD]], float*
// CHECK-LOAD-NEXT: ret void
// CHECK-LOAD-NEXT: }
-// CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}(float* noalias, float* noalias)
+// CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}(float* noalias %0, float* noalias %1)
// CHECK-LOAD: [[ADD:%.+]] = fadd float 1.5
// CHECK-LOAD-NEXT: store float [[ADD]], float*
// CHECK-LOAD-NEXT: ret void
@@ -68,13 +68,13 @@
struct SSS {
int field;
#pragma omp declare reduction(+ : int, char : omp_out *= omp_in)
- // CHECK: define internal {{.*}}void @{{[^(]+}}(i32* noalias, i32* noalias)
+ // CHECK: define internal {{.*}}void @{{[^(]+}}(i32* noalias %0, i32* noalias %1)
// CHECK: [[MUL:%.+]] = mul nsw i32
// CHECK-NEXT: store i32 [[MUL]], i32*
// CHECK-NEXT: ret void
// CHECK-NEXT: }
- // CHECK: define internal {{.*}}void @{{[^(]+}}(i8* noalias, i8* noalias)
+ // CHECK: define internal {{.*}}void @{{[^(]+}}(i8* noalias %0, i8* noalias %1)
// CHECK: sext i8
// CHECK: sext i8
// CHECK: [[MUL:%.+]] = mul nsw i32
@@ -87,19 +87,19 @@
void init(struct SSS *priv, struct SSS orig);
#pragma omp declare reduction(fun : struct SSS : omp_out = omp_in) initializer(init(&omp_priv, omp_orig))
-// CHECK: define internal {{.*}}void @{{[^(]+}}([[SSS_INT]]* noalias, [[SSS_INT]]* noalias)
+// CHECK: define internal {{.*}}void @{{[^(]+}}([[SSS_INT]]* noalias %0, [[SSS_INT]]* noalias %1)
// CHECK: call void @llvm.memcpy
// CHECK-NEXT: ret void
// CHECK-NEXT: }
-// CHECK: define internal {{.*}}void @{{[^(]+}}([[SSS_INT]]* noalias, [[SSS_INT]]* noalias)
+// CHECK: define internal {{.*}}void @{{[^(]+}}([[SSS_INT]]* noalias %0, [[SSS_INT]]* noalias %1)
// CHECK: call void @init(
// CHECK-NEXT: ret void
// CHECK-NEXT: }
-// CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}([[SSS_INT]]* noalias, [[SSS_INT]]* noalias)
+// CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}([[SSS_INT]]* noalias %0, [[SSS_INT]]* noalias %1)
// CHECK-LOAD: call void @llvm.memcpy
// CHECK-LOAD-NEXT: ret void
// CHECK-LOAD-NEXT: }
-// CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}([[SSS_INT]]* noalias, [[SSS_INT]]* noalias)
+// CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}([[SSS_INT]]* noalias %0, [[SSS_INT]]* noalias %1)
// CHECK-LOAD: call void @init(
// CHECK-LOAD-NEXT: ret void
// CHECK-LOAD-NEXT: }
@@ -108,37 +108,37 @@
// CHECK-LOAD-LABEL: @main
int main() {
#pragma omp declare reduction(fun : struct SSS : omp_out = omp_in) initializer(init(&omp_priv, omp_orig))
- // CHECK: define internal {{.*}}void @{{[^(]+}}([[SSS_INT]]* noalias, [[SSS_INT]]* noalias)
+ // CHECK: define internal {{.*}}void @{{[^(]+}}([[SSS_INT]]* noalias %0, [[SSS_INT]]* noalias %1)
// CHECK: call void @llvm.memcpy
// CHECK-NEXT: ret void
// CHECK-NEXT: }
- // CHECK: define internal {{.*}}void @{{[^(]+}}([[SSS_INT]]* noalias, [[SSS_INT]]* noalias)
+ // CHECK: define internal {{.*}}void @{{[^(]+}}([[SSS_INT]]* noalias %0, [[SSS_INT]]* noalias %1)
// CHECK: call void @init(
// CHECK-NEXT: ret void
// CHECK-NEXT: }
- // CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}([[SSS_INT]]* noalias, [[SSS_INT]]* noalias)
+ // CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}([[SSS_INT]]* noalias %0, [[SSS_INT]]* noalias %1)
// CHECK-LOAD: call void @llvm.memcpy
// CHECK-LOAD-NEXT: ret void
// CHECK-LOAD-NEXT: }
- // CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}([[SSS_INT]]* noalias, [[SSS_INT]]* noalias)
+ // CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}([[SSS_INT]]* noalias %0, [[SSS_INT]]* noalias %1)
// CHECK-LOAD: call void @init(
// CHECK-LOAD-NEXT: ret void
// CHECK-LOAD-NEXT: }
{
#pragma omp declare reduction(fun : struct SSS : omp_out = omp_in) initializer(init(&omp_priv, omp_orig))
- // CHECK: define internal {{.*}}void @{{[^(]+}}([[SSS_INT]]* noalias, [[SSS_INT]]* noalias)
+ // CHECK: define internal {{.*}}void @{{[^(]+}}([[SSS_INT]]* noalias %0, [[SSS_INT]]* noalias %1)
// CHECK: call void @llvm.memcpy
// CHECK-NEXT: ret void
// CHECK-NEXT: }
- // CHECK: define internal {{.*}}void @{{[^(]+}}([[SSS_INT]]* noalias, [[SSS_INT]]* noalias)
+ // CHECK: define internal {{.*}}void @{{[^(]+}}([[SSS_INT]]* noalias %0, [[SSS_INT]]* noalias %1)
// CHECK: call void @init(
// CHECK-NEXT: ret void
// CHECK-NEXT: }
- // CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}([[SSS_INT]]* noalias, [[SSS_INT]]* noalias)
+ // CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}([[SSS_INT]]* noalias %0, [[SSS_INT]]* noalias %1)
// CHECK-LOAD: call void @llvm.memcpy
// CHECK-LOAD-NEXT: ret void
// CHECK-LOAD-NEXT: }
- // CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}([[SSS_INT]]* noalias, [[SSS_INT]]* noalias)
+ // CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}([[SSS_INT]]* noalias %0, [[SSS_INT]]* noalias %1)
// CHECK-LOAD: call void @init(
// CHECK-LOAD-NEXT: ret void
// CHECK-LOAD-NEXT: }
@@ -146,13 +146,13 @@
return 0;
}
-// CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}(i32* noalias, i32* noalias)
+// CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}(i32* noalias %0, i32* noalias %1)
// CHECK-LOAD: [[MUL:%.+]] = mul nsw i32
// CHECK-LOAD-NEXT: store i32 [[MUL]], i32*
// CHECK-LOAD-NEXT: ret void
// CHECK-LOAD-NEXT: }
-// CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}(i8* noalias, i8* noalias)
+// CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}(i8* noalias %0, i8* noalias %1)
// CHECK-LOAD: sext i8
// CHECK-LOAD: sext i8
// CHECK-LOAD: [[MUL:%.+]] = mul nsw i32
diff --git a/src/llvm-project/clang/test/OpenMP/declare_reduction_codegen.cpp b/src/llvm-project/clang/test/OpenMP/declare_reduction_codegen.cpp
index d0e355c..129823c 100644
--- a/src/llvm-project/clang/test/OpenMP/declare_reduction_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/declare_reduction_codegen.cpp
@@ -35,18 +35,18 @@
// CHECK: define internal void @
#pragma omp declare reduction(+ : int, char : omp_out *= omp_in)
-// CHECK: define internal {{.*}}void @{{[^(]+}}(i32* noalias, i32* noalias)
+// CHECK: define internal {{.*}}void @{{[^(]+}}(i32* noalias %0, i32* noalias %1)
// CHECK: [[MUL:%.+]] = mul nsw i32
// CHECK-NEXT: store i32 [[MUL]], i32*
// CHECK-NEXT: ret void
// CHECK-NEXT: }
-// CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}(i32* noalias, i32* noalias)
+// CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}(i32* noalias %0, i32* noalias %1)
// CHECK-LOAD: [[MUL:%.+]] = mul nsw i32
// CHECK-LOAD-NEXT: store i32 [[MUL]], i32*
// CHECK-LOAD-NEXT: ret void
// CHECK-LOAD-NEXT: }
-// CHECK: define internal {{.*}}void @{{[^(]+}}(i8* noalias, i8* noalias)
+// CHECK: define internal {{.*}}void @{{[^(]+}}(i8* noalias %0, i8* noalias %1)
// CHECK: sext i8
// CHECK: sext i8
// CHECK: [[MUL:%.+]] = mul nsw i32
@@ -55,7 +55,7 @@
// CHECK-NEXT: ret void
// CHECK-NEXT: }
-// CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}(i8* noalias, i8* noalias)
+// CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}(i8* noalias %0, i8* noalias %1)
// CHECK-LOAD: sext i8
// CHECK-LOAD: sext i8
// CHECK-LOAD: [[MUL:%.+]] = mul nsw i32
@@ -69,45 +69,60 @@
T a;
SSS() : a() {}
#pragma omp declare reduction(fun : T : omp_out ^= omp_in) initializer(omp_priv = 24 + omp_orig)
+#pragma omp declare reduction(sssss : T : ssssss(omp_in)) initializer(omp_priv = 18 + omp_orig)
+ static void ssssss(T &x);
};
SSS<int> d;
-// CHECK: define internal {{.*}}void @{{[^(]+}}(i32* noalias, i32* noalias)
+// CHECK: define internal {{.*}}void @{{[^(]+}}(i32* noalias %0, i32* noalias %1)
// CHECK: [[XOR:%.+]] = xor i32
// CHECK-NEXT: store i32 [[XOR]], i32*
// CHECK-NEXT: ret void
// CHECK-NEXT: }
-// CHECK: define internal {{.*}}void @{{[^(]+}}(i32* noalias, i32* noalias)
+// CHECK: define internal {{.*}}void @{{[^(]+}}(i32* noalias %0, i32* noalias %1)
// CHECK: [[ADD:%.+]] = add nsw i32 24,
// CHECK-NEXT: store i32 [[ADD]], i32*
// CHECK-NEXT: ret void
// CHECK-NEXT: }
-// CHECK: define {{.*}}void [[INIT:@[^(]+]]([[SSS_INT]]*
-// CHECK-LOAD: define {{.*}}void [[INIT:@[^(]+]]([[SSS_INT]]*
-void init(SSS<int> &lhs, SSS<int> &rhs) {}
+// CHECK: define internal {{.*}}void @{{[^(]+}}(i32* noalias %0, i32* noalias %1)
+// CHECK: call void @_ZN3SSSIiE6ssssssERi(i32* dereferenceable{{.*}})
+// CHECK-NEXT: ret void
+// CHECK-NEXT: }
+
+// CHECK: define internal {{.*}}void @{{[^(]+}}(i32* noalias %0, i32* noalias %1)
+// CHECK: [[ADD:%.+]] = add nsw i32 18,
+// CHECK-NEXT: store i32 [[ADD]], i32*
+// CHECK-NEXT: ret void
+// CHECK-NEXT: }
+
+template <typename T>
+void init(T &lhs, T &rhs) {}
#pragma omp declare reduction(fun : SSS < int > : omp_out = omp_in) initializer(init(omp_priv, omp_orig))
-// CHECK: define internal {{.*}}void @{{[^(]+}}([[SSS_INT]]* noalias, [[SSS_INT]]* noalias)
+// CHECK: define internal {{.*}}void @{{[^(]+}}([[SSS_INT]]* noalias %0, [[SSS_INT]]* noalias %1)
// CHECK: call void @llvm.memcpy
// CHECK-NEXT: ret void
// CHECK-NEXT: }
-// CHECK: define internal {{.*}}void @{{[^(]+}}([[SSS_INT]]* noalias, [[SSS_INT]]* noalias)
-// CHECK: call {{.*}}void [[INIT]](
+// CHECK: define internal {{.*}}void @{{[^(]+}}([[SSS_INT]]* noalias %0, [[SSS_INT]]* noalias %1)
+// CHECK: call {{.*}}void @_Z4initI3SSSIiEEvRT_S3_(
// CHECK-NEXT: ret void
// CHECK-NEXT: }
-// CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}([[SSS_INT]]* noalias, [[SSS_INT]]* noalias)
+// CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}([[SSS_INT]]* noalias %0, [[SSS_INT]]* noalias %1)
// CHECK-LOAD: call void @llvm.memcpy
// CHECK-LOAD-NEXT: ret void
// CHECK-LOAD-NEXT: }
-// CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}([[SSS_INT]]* noalias, [[SSS_INT]]* noalias)
-// CHECK-LOAD: call {{.*}}void [[INIT]](
+// CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}([[SSS_INT]]* noalias %0, [[SSS_INT]]* noalias %1)
+// CHECK-LOAD: call {{.*}}void @_Z4initI3SSSIiEEvRT_S3_(
// CHECK-LOAD-NEXT: ret void
// CHECK-LOAD-NEXT: }
+// CHECK: define {{.*}}void @_Z4initI3SSSIiEEvRT_S3_(%struct.SSS* {{.+}}, %struct.SSS* {{.+}})
+// CHECK-LOAD: define {{.*}}void @_Z4initI3SSSIiEEvRT_S3_(%struct.SSS* {{.+}}, %struct.SSS* {{.+}})
+
template <typename T>
T foo(T a) {
#pragma omp declare reduction(fun : T : omp_out += omp_in) initializer(omp_priv = 15 * omp_orig)
@@ -166,57 +181,57 @@
// CHECK-LABEL: i32 @{{.+}}foo{{[^(].+}}(i32
// CHECK-LOAD-LABEL: i32 @{{.+}}foo{{[^(].+}}(i32
-// CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}(i32* noalias, i32* noalias)
+// CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}(i32* noalias %0, i32* noalias %1)
// CHECK-LOAD: [[XOR:%.+]] = xor i32
// CHECK-LOAD-NEXT: store i32 [[XOR]], i32*
// CHECK-LOAD-NEXT: ret void
// CHECK-LOAD-NEXT: }
-// CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}(i32* noalias, i32* noalias)
+// CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}(i32* noalias %0, i32* noalias %1)
// CHECK-LOAD: [[ADD:%.+]] = add nsw i32 24,
// CHECK-LOAD-NEXT: store i32 [[ADD]], i32*
// CHECK-LOAD-NEXT: ret void
// CHECK-LOAD-NEXT: }
-// CHECK: define internal {{.*}}void @{{[^(]+}}(i32* noalias, i32* noalias)
+// CHECK: define internal {{.*}}void @{{[^(]+}}(i32* noalias %0, i32* noalias %1)
// CHECK: [[ADD:%.+]] = add nsw i32
// CHECK-NEXT: store i32 [[ADD]], i32*
// CHECK-NEXT: ret void
// CHECK-NEXT: }
-// CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}(i32* noalias, i32* noalias)
+// CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}(i32* noalias %0, i32* noalias %1)
// CHECK-LOAD: [[ADD:%.+]] = add nsw i32
// CHECK-LOAD-NEXT: store i32 [[ADD]], i32*
// CHECK-LOAD-NEXT: ret void
// CHECK-LOAD-NEXT: }
-// CHECK: define internal {{.*}}void @{{[^(]+}}(i32* noalias, i32* noalias)
+// CHECK: define internal {{.*}}void @{{[^(]+}}(i32* noalias %0, i32* noalias %1)
// CHECK: [[MUL:%.+]] = mul nsw i32 15,
// CHECK-NEXT: store i32 [[MUL]], i32*
// CHECK-NEXT: ret void
// CHECK-NEXT: }
-// CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}(i32* noalias, i32* noalias)
+// CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}(i32* noalias %0, i32* noalias %1)
// CHECK-LOAD: [[MUL:%.+]] = mul nsw i32 15,
// CHECK-LOAD-NEXT: store i32 [[MUL]], i32*
// CHECK-LOAD-NEXT: ret void
// CHECK-LOAD-NEXT: }
-// CHECK: define internal {{.*}}void @{{[^(]+}}(i32* noalias, i32* noalias)
+// CHECK: define internal {{.*}}void @{{[^(]+}}(i32* noalias %0, i32* noalias %1)
// CHECK: [[DIV:%.+]] = sdiv i32
// CHECK-NEXT: store i32 [[DIV]], i32*
// CHECK-NEXT: ret void
// CHECK-NEXT: }
-// CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}(i32* noalias, i32* noalias)
+// CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}(i32* noalias %0, i32* noalias %1)
// CHECK-LOAD: [[DIV:%.+]] = sdiv i32
// CHECK-LOAD-NEXT: store i32 [[DIV]], i32*
// CHECK-LOAD-NEXT: ret void
// CHECK-LOAD-NEXT: }
-// CHECK: define internal {{.*}}void @{{[^(]+}}(i32* noalias, i32* noalias)
+// CHECK: define internal {{.*}}void @{{[^(]+}}(i32* noalias %0, i32* noalias %1)
// CHECK: [[SUB:%.+]] = sub nsw i32 11,
// CHECK-NEXT: store i32 [[SUB]], i32*
// CHECK-NEXT: ret void
// CHECK-NEXT: }
-// CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}(i32* noalias, i32* noalias)
+// CHECK-LOAD: define internal {{.*}}void @{{[^(]+}}(i32* noalias %0, i32* noalias %1)
// CHECK-LOAD: [[SUB:%.+]] = sub nsw i32 11,
// CHECK-LOAD-NEXT: store i32 [[SUB]], i32*
// CHECK-LOAD-NEXT: ret void
diff --git a/src/llvm-project/clang/test/OpenMP/declare_reduction_codegen_in_templates.cpp b/src/llvm-project/clang/test/OpenMP/declare_reduction_codegen_in_templates.cpp
new file mode 100644
index 0000000..0409c02
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/declare_reduction_codegen_in_templates.cpp
@@ -0,0 +1,43 @@
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++17 -emit-llvm %s -triple x86_64-linux -fexceptions -fcxx-exceptions -o - -femit-all-decls -disable-llvm-passes | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++17 -triple x86_64-linux -fexceptions -fcxx-exceptions -emit-pch -o %t %s -femit-all-decls -disable-llvm-passes
+// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-linux -fexceptions -fcxx-exceptions -std=c++17 -include-pch %t -verify %s -emit-llvm -o - -femit-all-decls -disable-llvm-passes | FileCheck %s
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++17 -emit-llvm %s -triple x86_64-linux -fexceptions -fcxx-exceptions -o - -femit-all-decls -disable-llvm-passes | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++17 -triple x86_64-linux -fexceptions -fcxx-exceptions -emit-pch -o %t %s -femit-all-decls -disable-llvm-passes
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-linux -fexceptions -fcxx-exceptions -std=c++17 -include-pch %t -verify %s -emit-llvm -o - -femit-all-decls -disable-llvm-passes | FileCheck --check-prefix SIMD-ONLY0 %s
+// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
+// expected-no-diagnostics
+
+// CHECK: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @{{.+}}, i32 1, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, [[STD_D:%.+]]*)* [[OUTLINED:@.+]] to void (i32*, i32*, ...)*), [[STD_D]]* %{{.+}})
+
+// CHECK: define internal void [[OUTLINED]](i32* noalias %{{.+}}, i32* noalias %{{.+}}, [[STD_D]]* {{.+}})
+// CHECK: call i32 @__kmpc_reduce_nowait(%struct.ident_t*
+
+#ifndef HEADER
+#define HEADER
+
+typedef long unsigned a;
+namespace std {
+template <class> class initializer_list {
+ const int *b;
+ a c;
+};
+template <typename, typename> class d {};
+template <typename e> class f {
+public:
+ f(initializer_list<e>);
+};
+} // namespace std
+template <class g, class h> void foo(g, h) {
+ std::d<a, double> i;
+#pragma omp declare reduction(j : std::d <a, double> : []{}())
+#pragma omp parallel reduction(j : i)
+ ;
+}
+void k() {
+ std::f<int> l{};
+ std::f<int> m{2};
+ foo(l, m);
+}
+
+#endif // HEADER
diff --git a/src/llvm-project/clang/test/OpenMP/declare_reduction_messages.c b/src/llvm-project/clang/test/OpenMP/declare_reduction_messages.c
index 4a0d6ef..69b73f4 100644
--- a/src/llvm-project/clang/test/OpenMP/declare_reduction_messages.c
+++ b/src/llvm-project/clang/test/OpenMP/declare_reduction_messages.c
@@ -45,6 +45,8 @@
int s;
};
#pragma omp declare reduction(+: struct S: omp_out.s += omp_in.s) // initializer(omp_priv = { .s = 0 })
+#pragma omp declare reduction(&: struct S: omp_out.s += omp_in.s) initializer(omp_priv = { .s = 0 })
+#pragma omp declare reduction(|: struct S: omp_out.s += omp_in.s) initializer(omp_priv = { 0 })
int fun(int arg) {
struct S s;// expected-note {{'s' defined here}}
diff --git a/src/llvm-project/clang/test/OpenMP/declare_reduction_messages.cpp b/src/llvm-project/clang/test/OpenMP/declare_reduction_messages.cpp
index a674af7..b1e5959 100644
--- a/src/llvm-project/clang/test/OpenMP/declare_reduction_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/declare_reduction_messages.cpp
@@ -142,13 +142,13 @@
#if __cplusplus == 201103L
struct A {
A() {}
- A& operator=(A&&) = default;
+ A(const A &) = default;
};
int A_TEST() {
- A test;
+ A test, test1;
#pragma omp declare reduction(+ : A : omp_out) initializer(omp_priv = A()) allocate(test) // expected-warning {{extra tokens at the end of '#pragma omp declare reduction' are ignored}}
-#pragma omp parallel reduction(+ : test)
+#pragma omp parallel reduction(+ : test) reduction(::operator+: test1) // expected-error {{unable to resolve declare reduction construct for type 'A'}}
{}
return 0;
}
@@ -166,6 +166,8 @@
void foo(S &x) {};
// expected-error@+1 {{too many arguments to function call, expected single argument 'x', have 2 arguments}}
#pragma omp declare reduction (foo : U, S : omp_out.foo(omp_in, false))
+ #pragma omp declare reduction (xxx : U, S : bar(omp_in)) // expected-error {{non-const lvalue reference to type 'S<1>' cannot bind to a value of unrelated type 'U'}}
+ static void bar(S &x); // expected-note {{passing argument to parameter 'x' here}}
};
// expected-warning@+2 {{extra tokens at the end of '#pragma omp declare reduction' are ignored}}
// expected-note@+1 {{in instantiation of template class 'S<1>' requested here}}
diff --git a/src/llvm-project/clang/test/OpenMP/declare_simd_ast_print.cpp b/src/llvm-project/clang/test/OpenMP/declare_simd_ast_print.cpp
index c09f8b4..565dc2d 100644
--- a/src/llvm-project/clang/test/OpenMP/declare_simd_ast_print.cpp
+++ b/src/llvm-project/clang/test/OpenMP/declare_simd_ast_print.cpp
@@ -21,6 +21,15 @@
// CHECK-NEXT: void add_1(float *d) __attribute__((cold));
//
+#pragma omp declare simd aligned(hp, hp2:V)
+#pragma omp declare simd aligned(hp, hp2:V)
+template <class C, int V> void h(C *hp, C *hp2, C *hq, C *lin) {
+}
+// CHECK-NEXT: #pragma omp declare simd aligned(hp: V) aligned(hp2: V)
+// CHECK-NEXT: #pragma omp declare simd aligned(hp: V) aligned(hp2: V)
+// CHECK-NEXT: template <class C, int V> void h(C *hp, C *hp2, C *hq, C *lin) {
+// CHECK-NEXT: }
+
#pragma omp declare simd aligned(hp, hp2)
template <class C> void h(C *hp, C *hp2, C *hq, C *lin) {
}
diff --git a/src/llvm-project/clang/test/OpenMP/declare_simd_messages.cpp b/src/llvm-project/clang/test/OpenMP/declare_simd_messages.cpp
index d5451ab..44cf415 100644
--- a/src/llvm-project/clang/test/OpenMP/declare_simd_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/declare_simd_messages.cpp
@@ -197,7 +197,8 @@
#pragma omp declare simd linear(ref(b))
// expected-error@+1 {{expected one of 'ref', val' or 'uval' modifiers}} expected-warning@+1 {{extra tokens at the end of '#pragma omp declare simd' are ignored}}
#pragma omp declare simd linear(uref(b)) allocate(b)
-void bar(int a, int *b);
+#pragma omp declare simd linear(ref(c))
+void bar(int a, int *b, float &c);
template <class T>
struct St {
diff --git a/src/llvm-project/clang/test/OpenMP/declare_target_ast_print.cpp b/src/llvm-project/clang/test/OpenMP/declare_target_ast_print.cpp
index 613926d..510162f 100644
--- a/src/llvm-project/clang/test/OpenMP/declare_target_ast_print.cpp
+++ b/src/llvm-project/clang/test/OpenMP/declare_target_ast_print.cpp
@@ -2,6 +2,10 @@
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -I %S/Inputs -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp -std=c++11 -include-pch %t -fsyntax-only -I %S/Inputs -verify %s -ast-print | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -I %S/Inputs -ast-print %s | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -I %S/Inputs -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -I %S/Inputs -verify %s -ast-print | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50
+
// RUN: %clang_cc1 -verify -fopenmp-simd -I %S/Inputs -ast-print %s | FileCheck %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -I %S/Inputs -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp-simd -std=c++11 -include-pch %t -fsyntax-only -I %S/Inputs -verify %s -ast-print | FileCheck %s
@@ -10,7 +14,29 @@
#ifndef HEADER
#define HEADER
+#if _OPENMP == 201811
+void bar();
+#pragma omp declare target to(bar) device_type(any)
+// OMP50: #pragma omp declare target{{$}}
+// OMP50: void bar();
+// OMP50: #pragma omp end declare target{{$}}
+void baz();
+#pragma omp declare target to(baz) device_type(nohost)
+// OMP50: #pragma omp declare target device_type(nohost){{$}}
+// OMP50: void baz();
+// OMP50: #pragma omp end declare target{{$}}
+void bazz();
+#pragma omp declare target to(bazz) device_type(host)
+// OMP50: #pragma omp declare target device_type(host){{$}}
+// OMP50: void bazz();
+// OMP50: #pragma omp end declare target{{$}}
+#endif // _OPENMP
+
int out_decl_target = 0;
+#if _OPENMP == 201811
+#pragma omp declare target (out_decl_target)
+#endif // _OPENMP
+
// CHECK: #pragma omp declare target{{$}}
// CHECK: int out_decl_target = 0;
// CHECK: #pragma omp end declare target{{$}}
diff --git a/src/llvm-project/clang/test/OpenMP/declare_target_codegen.cpp b/src/llvm-project/clang/test/OpenMP/declare_target_codegen.cpp
index 71c6875..165ba09 100644
--- a/src/llvm-project/clang/test/OpenMP/declare_target_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/declare_target_codegen.cpp
@@ -1,44 +1,55 @@
// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm-bc %s -o %t-ppc-host.bc
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck %s
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -emit-pch -o %t
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -include-pch %t -o - | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -emit-pch -o %t
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -include-pch %t -o - | FileCheck %s
+
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -fopenmp-version=50 -DOMP5 | FileCheck %s --check-prefix HOST5
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm-bc %s -o %t-ppc-host.bc -fopenmp-version=50 -DOMP5
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - -fopenmp-version=50 -DOMP5 | FileCheck %s --check-prefix DEV5
+
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - -fopenmp-version=50 -DOMP5 | FileCheck %s --check-prefix KMPC-ONLY
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -fopenmp-version=50 -DOMP5 | FileCheck %s --check-prefix SIMD-ONLY
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm-bc %s -o %t-ppc-host.bc -fopenmp-version=50 -DOMP5
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - -fopenmp-version=50 -DOMP5 | FileCheck %s --check-prefix SIMD-ONLY
// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm-bc %s -o %t-ppc-host.bc
-// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o -| FileCheck %s --check-prefix SIMD-ONLY
-// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -emit-pch -o %t
-// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -include-pch %t -verify -o - | FileCheck %s --check-prefix SIMD-ONLY
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o -| FileCheck %s --check-prefix SIMD-ONLY
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -emit-pch -o %t
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -include-pch %t -verify -o - | FileCheck %s --check-prefix SIMD-ONLY
// expected-no-diagnostics
// SIMD-ONLY-NOT: {{__kmpc|__tgt}}
+// KMPC-ONLY-NOT: __tgt
// CHECK-NOT: define {{.*}}{{baz1|baz4|maini1|Base|virtual_}}
// CHECK-DAG: Bake
// CHECK-NOT: @{{hhh|ggg|fff|eee}} =
// CHECK-DAG: @aaa = external global i32,
-// CHECK-DAG: @bbb ={{ dso_local | }}global i32 0,
+// CHECK-DAG: @bbb ={{ hidden | }}global i32 0,
// CHECK-DAG: weak constant %struct.__tgt_offload_entry { i8* bitcast (i32* @bbb to i8*),
// CHECK-DAG: @ccc = external global i32,
-// CHECK-DAG: @ddd ={{ dso_local | }}global i32 0,
-// CHECK-DAG: @hhh_decl_tgt_ref_ptr = common global i32* null
-// CHECK-DAG: @ggg_decl_tgt_ref_ptr = common global i32* null
-// CHECK-DAG: @fff_decl_tgt_ref_ptr = common global i32* null
-// CHECK-DAG: @eee_decl_tgt_ref_ptr = common global i32* null
+// CHECK-DAG: @ddd ={{ hidden | }}global i32 0,
+// CHECK-DAG: @hhh_decl_tgt_ref_ptr = weak global i32* null
+// CHECK-DAG: @ggg_decl_tgt_ref_ptr = weak global i32* null
+// CHECK-DAG: @fff_decl_tgt_ref_ptr = weak global i32* null
+// CHECK-DAG: @eee_decl_tgt_ref_ptr = weak global i32* null
// CHECK-DAG: @{{.*}}maini1{{.*}}aaa = internal global i64 23,
-// CHECK-DAG: @b ={{ dso_local | }}global i32 15,
-// CHECK-DAG: @d ={{ dso_local | }}global i32 0,
+// CHECK-DAG: @b ={{ hidden | }}global i32 15,
+// CHECK-DAG: @d ={{ hidden | }}global i32 0,
// CHECK-DAG: @c = external global i32,
-// CHECK-DAG: @globals ={{ dso_local | }}global %struct.S zeroinitializer,
+// CHECK-DAG: @globals ={{ hidden | }}global %struct.S zeroinitializer,
// CHECK-DAG: [[STAT:@.+stat]] = internal global %struct.S zeroinitializer,
// CHECK-DAG: [[STAT_REF:@.+]] = internal constant %struct.S* [[STAT]]
-// CHECK-DAG: @out_decl_target ={{ dso_local | }}global i32 0,
-// CHECK-DAG: @llvm.used = appending global [6 x i8*] [i8* bitcast (void ()* @__omp_offloading__{{.+}}_globals_l[[@LINE+80]]_ctor to i8*), i8* bitcast (void ()* @__omp_offloading__{{.+}}_stat_l[[@LINE+81]]_ctor to i8*),
+// CHECK-DAG: @out_decl_target ={{ hidden | }}global i32 0,
+// CHECK-DAG: @llvm.used = appending global [2 x i8*] [i8* bitcast (void ()* @__omp_offloading__{{.+}}_globals_l[[@LINE+84]]_ctor to i8*), i8* bitcast (void ()* @__omp_offloading__{{.+}}_stat_l[[@LINE+85]]_ctor to i8*)],
// CHECK-DAG: @llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (%struct.S** [[STAT_REF]] to i8*)],
// CHECK-DAG: define {{.*}}i32 @{{.*}}{{foo|bar|baz2|baz3|FA|f_method}}{{.*}}()
// CHECK-DAG: define {{.*}}void @{{.*}}TemplateClass{{.*}}(%class.TemplateClass* %{{.*}})
// CHECK-DAG: define {{.*}}i32 @{{.*}}TemplateClass{{.*}}f_method{{.*}}(%class.TemplateClass* %{{.*}})
-// CHECK-DAG: define {{.*}}void @__omp_offloading__{{.*}}_globals_l[[@LINE+74]]_ctor()
+// CHECK-DAG: define {{.*}}void @__omp_offloading__{{.*}}_globals_l[[@LINE+78]]_ctor()
#ifndef HEADER
#define HEADER
@@ -68,6 +79,10 @@
#pragma omp declare target link(eee, fff, ggg, hhh)
int out_decl_target = 0;
+#ifdef OMP5
+#pragma omp declare target(out_decl_target)
+#endif
+
#pragma omp declare target
void lambda () {
#ifdef __cpp_lambdas
@@ -224,4 +239,18 @@
// CHECK-DAG: !{i32 1, !"ccc", i32 0, i32 {{[0-9]+}}}
// CHECK-DAG: !{{{.+}}virtual_foo
+#ifdef OMP5
+void host_fun() {}
+#pragma omp declare target to(host_fun) device_type(host)
+void device_fun() {}
+#pragma omp declare target to(device_fun) device_type(nohost)
+// HOST5-NOT: define {{.*}}void {{.*}}device_fun{{.*}}
+// HOST5: define {{.*}}void {{.*}}host_fun{{.*}}
+// HOST5-NOT: define {{.*}}void {{.*}}device_fun{{.*}}
+
+// DEV5-NOT: define {{.*}}void {{.*}}host_fun{{.*}}
+// DEV5: define {{.*}}void {{.*}}device_fun{{.*}}
+// DEV5-NOT: define {{.*}}void {{.*}}host_fun{{.*}}
+#endif // OMP5
+
#endif // HEADER
diff --git a/src/llvm-project/clang/test/OpenMP/declare_target_link_codegen.cpp b/src/llvm-project/clang/test/OpenMP/declare_target_link_codegen.cpp
index 2f92eb6..613c837 100644
--- a/src/llvm-project/clang/test/OpenMP/declare_target_link_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/declare_target_link_codegen.cpp
@@ -18,24 +18,31 @@
#define HEADER
// HOST-DAG: @c = external global i32,
-// HOST-DAG: @c_decl_tgt_ref_ptr = global i32* @c
+// HOST-DAG: @c_decl_tgt_ref_ptr = weak global i32* @c
+// HOST-DAG: @[[D:.+]] = internal global i32 2
+// HOST-DAG: @[[D_PTR:.+]] = weak global i32* @[[D]]
// DEVICE-NOT: @c =
-// DEVICE: @c_decl_tgt_ref_ptr = common global i32* null
-// HOST: [[SIZES:@.+]] = private unnamed_addr constant [2 x i64] [i64 4, i64 4]
-// HOST: [[MAPTYPES:@.+]] = private unnamed_addr constant [2 x i64] [i64 35, i64 531]
+// DEVICE: @c_decl_tgt_ref_ptr = weak global i32* null
+// HOST: [[SIZES:@.+]] = private unnamed_addr constant [3 x i64] [i64 4, i64 4, i64 4]
+// HOST: [[MAPTYPES:@.+]] = private unnamed_addr constant [3 x i64] [i64 35, i64 531, i64 531]
// HOST: @.omp_offloading.entry_name{{.*}} = internal unnamed_addr constant [{{[0-9]+}} x i8] c"c_decl_tgt_ref_ptr\00"
-// HOST: @.omp_offloading.entry.c_decl_tgt_ref_ptr = weak constant %struct.__tgt_offload_entry { i8* bitcast (i32** @c_decl_tgt_ref_ptr to i8*), i8* getelementptr inbounds ([{{[0-9]+}} x i8], [{{[0-9]+}} x i8]* @.omp_offloading.entry_name, i32 0, i32 0), i64 8, i32 1, i32 0 }, section ".omp_offloading.entries", align 1
-// DEVICE-NOT: internal unnamed_addr constant [{{[0-9]+}} x i8] c"c_decl_tgt_ref_ptr\00"
-// CHECK: @llvm.used = appending global [1 x i8*] [i8* bitcast (i32** @c_decl_tgt_ref_ptr to i8*)]
+// HOST: @.omp_offloading.entry.c_decl_tgt_ref_ptr = weak constant %struct.__tgt_offload_entry { i8* bitcast (i32** @c_decl_tgt_ref_ptr to i8*), i8* getelementptr inbounds ([{{[0-9]+}} x i8], [{{[0-9]+}} x i8]* @.omp_offloading.entry_name, i32 0, i32 0), i64 8, i32 1, i32 0 }, section "omp_offloading_entries", align 1
+// DEVICE-NOT: internal unnamed_addr constant [{{[0-9]+}} x i8] c"c_{{.*}}_decl_tgt_ref_ptr\00"
+// HOST: @.omp_offloading.entry_name{{.*}} = internal unnamed_addr constant [{{[0-9]+}} x i8] c"_{{.*}}d_{{.*}}_decl_tgt_ref_ptr\00"
+// HOST: @.omp_offloading.entry.[[D_PTR]] = weak constant %struct.__tgt_offload_entry { i8* bitcast (i32** @[[D_PTR]] to i8*), i8* getelementptr inbounds ([{{[0-9]+}} x i8], [{{[0-9]+}} x i8]* @.omp_offloading.entry_name{{.*}}, i32 0, i32 0
extern int c;
#pragma omp declare target link(c)
+static int d = 2;
+#pragma omp declare target link(d)
+
int maini1() {
int a;
#pragma omp target map(tofrom : a)
{
a = c;
+ d++;
}
#pragma omp target
#pragma omp teams
@@ -43,29 +50,38 @@
return 0;
}
-// DEVICE: define weak void @__omp_offloading_{{.*}}_{{.*}}maini1{{.*}}_l[[@LINE-10]](i32* dereferenceable{{[^,]*}}
+// DEVICE: define weak void @__omp_offloading_{{.*}}_{{.*}}maini1{{.*}}_l42(i32* dereferenceable{{[^,]*}}
// DEVICE: [[C_REF:%.+]] = load i32*, i32** @c_decl_tgt_ref_ptr,
// DEVICE: [[C:%.+]] = load i32, i32* [[C_REF]],
// DEVICE: store i32 [[C]], i32* %
// HOST: define {{.*}}i32 @{{.*}}maini1{{.*}}()
-// HOST: [[BASEPTRS:%.+]] = alloca [2 x i8*],
-// HOST: [[PTRS:%.+]] = alloca [2 x i8*],
-// HOST: getelementptr inbounds [2 x i8*], [2 x i8*]* [[BASEPTRS]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
-// HOST: getelementptr inbounds [2 x i8*], [2 x i8*]* [[PTRS]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
-// HOST: [[BP1:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[BASEPTRS]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
+// HOST: [[BASEPTRS:%.+]] = alloca [3 x i8*],
+// HOST: [[PTRS:%.+]] = alloca [3 x i8*],
+// HOST: getelementptr inbounds [3 x i8*], [3 x i8*]* [[BASEPTRS]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// HOST: getelementptr inbounds [3 x i8*], [3 x i8*]* [[PTRS]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+
+// HOST: [[BP1:%.+]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[BASEPTRS]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
// HOST: [[BP1_CAST:%.+]] = bitcast i8** [[BP1]] to i32***
// HOST: store i32** @c_decl_tgt_ref_ptr, i32*** [[BP1_CAST]],
-// HOST: [[P1:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[PTRS]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
+// HOST: [[P1:%.+]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[PTRS]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
// HOST: [[P1_CAST:%.+]] = bitcast i8** [[P1]] to i32**
// HOST: store i32* @c, i32** [[P1_CAST]],
-// HOST: [[BP0:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[BASEPTRS]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
-// HOST: [[P0:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[PTRS]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
-// HOST: call i32 @__tgt_target(i64 -1, i8* @{{[^,]+}}, i32 2, i8** [[BP0]], i8** [[P0]], i64* getelementptr inbounds ([2 x i64], [2 x i64]* [[SIZES]], i{{[0-9]+}} 0, i{{[0-9]+}} 0), i64* getelementptr inbounds ([2 x i64], [2 x i64]* [[MAPTYPES]], i{{[0-9]+}} 0, i{{[0-9]+}} 0))
-// HOST: call void @__omp_offloading_{{.*}}_{{.*}}maini1{{.*}}_l[[@LINE-29]](i32* %{{[^,]+}})
-// HOST: call i32 @__tgt_target_teams(i64 -1, i8* @.__omp_offloading_{{.+}}_l40.region_id, i32 2, {{.+}})
-// HOST: define internal void @__omp_offloading_{{.*}}_{{.*}}maini1{{.*}}_l[[@LINE-32]](i32* dereferenceable{{.*}})
+// HOST: [[BP2:%.+]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[BASEPTRS]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
+// HOST: [[BP2_CAST:%.+]] = bitcast i8** [[BP2]] to i32***
+// HOST: store i32** @[[D_PTR]], i32*** [[BP2_CAST]],
+// HOST: [[P2:%.+]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[PTRS]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
+// HOST: [[P2_CAST:%.+]] = bitcast i8** [[P2]] to i32**
+// HOST: store i32* @[[D]], i32** [[P2_CAST]],
+
+// HOST: [[BP0:%.+]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[BASEPTRS]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// HOST: [[P0:%.+]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[PTRS]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// HOST: call i32 @__tgt_target(i64 -1, i8* @{{[^,]+}}, i32 3, i8** [[BP0]], i8** [[P0]], i64* getelementptr inbounds ([3 x i64], [3 x i64]* [[SIZES]], i{{[0-9]+}} 0, i{{[0-9]+}} 0), i64* getelementptr inbounds ([3 x i64], [3 x i64]* [[MAPTYPES]], i{{[0-9]+}} 0, i{{[0-9]+}} 0))
+// HOST: call void @__omp_offloading_{{.*}}_{{.*}}_{{.*}}maini1{{.*}}_l42(i32* %{{[^,]+}})
+// HOST: call i32 @__tgt_target_teams(i64 -1, i8* @.__omp_offloading_{{.+}}_l47.region_id, i32 2, {{.+}})
+
+// HOST: define internal void @__omp_offloading_{{.*}}_{{.*}}maini1{{.*}}_l42(i32* dereferenceable{{.*}})
// HOST: [[C:%.*]] = load i32, i32* @c,
// HOST: store i32 [[C]], i32* %
diff --git a/src/llvm-project/clang/test/OpenMP/declare_target_messages.cpp b/src/llvm-project/clang/test/OpenMP/declare_target_messages.cpp
index 642d3e8..cc6558d 100644
--- a/src/llvm-project/clang/test/OpenMP/declare_target_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/declare_target_messages.cpp
@@ -1,10 +1,14 @@
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -fnoopenmp-use-tls -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify=expected,omp45 -fopenmp -fnoopenmp-use-tls -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify=expected,omp5,host5 -fopenmp -fopenmp-version=50 -fnoopenmp-use-tls -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify=expected,omp5,dev5 -fopenmp -fopenmp-is-device -fopenmp-targets=x86_64-apple-macos10.7.0 -aux-triple x86_64-apple-macos10.7.0 -fopenmp-version=50 -fnoopenmp-use-tls -ferror-limit 100 -o - %s
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -fnoopenmp-use-tls -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify=expected,omp5,host5 -fopenmp-simd -fopenmp-version=50 -fnoopenmp-use-tls -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify=expected,omp5,host5 -fopenmp-simd -fopenmp-is-device -fopenmp-version=50 -fnoopenmp-use-tls -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify=expected,omp45 -fopenmp-simd -fnoopenmp-use-tls -ferror-limit 100 -o - %s
#pragma omp end declare target // expected-error {{unexpected OpenMP directive '#pragma omp end declare target'}}
-int a, b;
+int a, b, z; // omp5-error {{variable captured in declare target region must appear in a to clause}}
__thread int t; // expected-note {{defined as threadprivate or thread local}}
#pragma omp declare target . // expected-error {{expected '(' after 'declare target'}}
@@ -13,17 +17,23 @@
void f();
#pragma omp end declare target shared(a) // expected-warning {{extra tokens at the end of '#pragma omp end declare target' are ignored}}
-#pragma omp declare target map(a) // expected-error {{unexpected 'map' clause, only 'to' or 'link' clauses expected}}
+#pragma omp declare target map(a) // omp45-error {{unexpected 'map' clause, only 'to' or 'link' clauses expected}} omp5-error {{unexpected 'map' clause, only 'to', 'link' or 'device_type' clauses expected}}
#pragma omp declare target to(foo1) // expected-error {{use of undeclared identifier 'foo1'}}
#pragma omp declare target link(foo2) // expected-error {{use of undeclared identifier 'foo2'}}
+#pragma omp declare target to(f) device_type(any) device_type(any) device_type(host) // omp45-error {{unexpected 'device_type' clause, only 'to' or 'link' clauses expected}} omp5-warning 2 {{more than one 'device_type' clause is specified}} omp5-error {{'device_type(host)' does not match previously specified 'device_type(any)' for the same declaration}}
+
void c();
void func() {} // expected-note {{'func' defined here}}
-#pragma omp declare target link(func) allocate(a) // expected-error {{function name is not allowed in 'link' clause}} expected-error {{unexpected 'allocate' clause, only 'to' or 'link' clauses expected}}
+#pragma omp declare target link(func) allocate(a) // expected-error {{function name is not allowed in 'link' clause}} omp45-error {{unexpected 'allocate' clause, only 'to' or 'link' clauses expected}} omp5-error {{unexpected 'allocate' clause, only 'to', 'link' or 'device_type' clauses expected}}
+
+void bar();
+void baz() {bar();}
+#pragma omp declare target(bar) // omp5-warning {{declaration marked as declare target after first use, it may lead to incorrect results}}
extern int b;
@@ -65,11 +75,11 @@
void cba();
#pragma omp end declare target // expected-error {{unexpected OpenMP directive '#pragma omp end declare target'}}
-#pragma omp declare target
- #pragma omp declare target
- void def();
- #pragma omp end declare target
- void fed();
+#pragma omp declare target
+#pragma omp declare target
+void def();
+#pragma omp end declare target
+void fed();
#pragma omp declare target
#pragma omp threadprivate(a) // expected-note {{defined as threadprivate or thread local}}
@@ -112,7 +122,9 @@
c();
}
#pragma omp declare target
-void foo1() {}
+void foo1() {
+ [&](){ (void)(b+z);}(); // omp5-note {{variable 'z' is captured here}}
+}
#pragma omp end declare target
#pragma omp end declare target
@@ -149,4 +161,30 @@
#pragma omp declare target to(x) to(x) // expected-error {{'x' appears multiple times in clauses on the same declare target directive}}
#pragma omp declare target link(x) // expected-error {{'x' must not appear in both clauses 'to' and 'link'}}
+void bazz() {}
+#pragma omp declare target to(bazz) device_type(nohost) // omp45-error {{unexpected 'device_type' clause, only 'to' or 'link' clauses expected}} host5-note {{marked as 'device_type(nohost)' here}}
+void bazzz() {bazz();}
+#pragma omp declare target to(bazzz) device_type(nohost) // omp45-error {{unexpected 'device_type' clause, only 'to' or 'link' clauses expected}}
+void any() {bazz();} // host5-error {{function with 'device_type(nohost)' is not available on host}}
+void host1() {bazz();}
+#pragma omp declare target to(host1) device_type(host) // omp45-error {{unexpected 'device_type' clause, only 'to' or 'link' clauses expected}} dev5-note 2 {{marked as 'device_type(host)' here}}
+void host2() {bazz();}
+#pragma omp declare target to(host2)
+void device() {host1();}
+#pragma omp declare target to(device) device_type(nohost) // omp45-error {{unexpected 'device_type' clause, only 'to' or 'link' clauses expected}} host5-note 2 {{marked as 'device_type(nohost)' here}}
+void host3() {host1();}
+#pragma omp declare target to(host3)
+
+#pragma omp declare target
+void any1() {any();}
+void any2() {host1();} // dev5-error {{function with 'device_type(host)' is not available on device}}
+void any3() {device();} // host5-error {{function with 'device_type(nohost)' is not available on host}}
+void any4() {any2();}
+#pragma omp end declare target
+
+void any5() {any();}
+void any6() {host1();} // dev5-error {{function with 'device_type(host)' is not available on device}}
+void any7() {device();} // host5-error {{function with 'device_type(nohost)' is not available on host}}
+void any8() {any2();}
+
#pragma omp declare target // expected-error {{expected '#pragma omp end declare target'}} expected-note {{to match this '#pragma omp declare target'}}
diff --git a/src/llvm-project/clang/test/OpenMP/declare_variant_ast_print.c b/src/llvm-project/clang/test/OpenMP/declare_variant_ast_print.c
new file mode 100644
index 0000000..0173626
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/declare_variant_ast_print.c
@@ -0,0 +1,26 @@
+// RUN: %clang_cc1 -verify -fopenmp -x c -std=c99 -ast-print %s -o - -Wno-openmp-clauses | FileCheck %s
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c -std=c99 -ast-print %s -o - -Wno-openmp-clauses | FileCheck %s
+
+// expected-no-diagnostics
+
+int foo(void);
+
+#pragma omp declare variant(foo) match(xxx={}, yyy={ccc})
+#pragma omp declare variant(foo) match(xxx={vvv})
+#pragma omp declare variant(foo) match(implementation={vendor(llvm)}, device={kind(fpga)})
+#pragma omp declare variant(foo) match(implementation={vendor(llvm), xxx})
+#pragma omp declare variant(foo) match(implementation={vendor(unknown)}, device={kind(gpu)})
+#pragma omp declare variant(foo) match(implementation={vendor(score(5): ibm, xxx, ibm)}, device={kind(cpu, nohost)})
+#pragma omp declare variant(foo) match(device={kind(host)})
+#pragma omp declare variant(foo) match(device={kind(nohost), xxx})
+int bar(void);
+
+// CHECK: int foo();
+// CHECK-NEXT: #pragma omp declare variant(foo) match(device={kind(nohost)})
+// CHECK-NEXT: #pragma omp declare variant(foo) match(device={kind(host)})
+// CHECK-NEXT: #pragma omp declare variant(foo) match(implementation={vendor(score(5):ibm, xxx)},device={kind(cpu, nohost)})
+// CHECK-NEXT: #pragma omp declare variant(foo) match(implementation={vendor(score(0):unknown)},device={kind(gpu)})
+// CHECK-NEXT: #pragma omp declare variant(foo) match(implementation={vendor(score(0):llvm)})
+// CHECK-NEXT: #pragma omp declare variant(foo) match(implementation={vendor(score(0):llvm)},device={kind(fpga)})
+// CHECK-NEXT: int bar();
diff --git a/src/llvm-project/clang/test/OpenMP/declare_variant_ast_print.cpp b/src/llvm-project/clang/test/OpenMP/declare_variant_ast_print.cpp
new file mode 100644
index 0000000..4964c69
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/declare_variant_ast_print.cpp
@@ -0,0 +1,210 @@
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++14 -fexceptions -fcxx-exceptions %s -ast-print -o - -Wno-source-uses-openmp -Wno-openmp-clauses | FileCheck %s
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++14 -fexceptions -fcxx-exceptions %s -ast-print -o - -Wno-source-uses-openmp -Wno-openmp-clauses | FileCheck %s
+
+// expected-no-diagnostics
+
+// CHECK: int foo();
+int foo();
+
+// CHECK: template <typename T> T foofoo() {
+// CHECK-NEXT: return T();
+// CHECK-NEXT: }
+template <typename T>
+T foofoo() { return T(); }
+
+// CHECK: template<> int foofoo<int>() {
+// CHECK-NEXT: return int();
+// CHECK-NEXT: }
+
+// CHECK: #pragma omp declare variant(foofoo<int>) match(implementation={vendor(score(5):ibm)},device={kind(fpga)})
+// CHECK-NEXT: #pragma omp declare variant(foofoo<int>) match(implementation={vendor(score(0):unknown)})
+// CHECK-NEXT: #pragma omp declare variant(foofoo<int>) match(implementation={vendor(score(0):llvm)},device={kind(cpu)})
+// CHECK-NEXT: int bar();
+#pragma omp declare variant(foofoo <int>) match(xxx = {})
+#pragma omp declare variant(foofoo <int>) match(xxx = {vvv})
+#pragma omp declare variant(foofoo <int>) match(implementation={vendor(llvm), xxx}, device={kind(cpu)})
+#pragma omp declare variant(foofoo <int>) match(implementation={vendor(unknown)})
+#pragma omp declare variant(foofoo <int>) match(implementation={vendor(score(5): ibm)}, device={kind(fpga)})
+int bar();
+
+// CHECK: #pragma omp declare variant(foofoo<T>) match(implementation={vendor(score(C + 5):ibm, xxx)},device={kind(cpu, host)})
+// CHECK-NEXT: #pragma omp declare variant(foofoo<T>) match(implementation={vendor(score(0):unknown)})
+// CHECK-NEXT: #pragma omp declare variant(foofoo<T>) match(implementation={vendor(score(0):llvm)},device={kind(cpu)})
+// CHECK-NEXT: template <typename T, int C> T barbar();
+#pragma omp declare variant(foofoo <T>) match(xxx = {})
+#pragma omp declare variant(foofoo <T>) match(xxx = {vvv})
+#pragma omp declare variant(foofoo <T>) match(user = {score(<expr>) : condition(<expr>)})
+#pragma omp declare variant(foofoo <T>) match(user = {score(<expr>) : condition(<expr>)})
+#pragma omp declare variant(foofoo <T>) match(user = {condition(<expr>)})
+#pragma omp declare variant(foofoo <T>) match(user = {condition(<expr>)})
+#pragma omp declare variant(foofoo <T>) match(implementation={vendor(llvm)},device={kind(cpu)})
+#pragma omp declare variant(foofoo <T>) match(implementation={vendor(unknown)})
+#pragma omp declare variant(foofoo <T>) match(implementation={vendor(score(C+5): ibm, xxx, ibm)},device={kind(cpu,host)})
+template <typename T, int C>
+T barbar();
+
+// CHECK: #pragma omp declare variant(foofoo<int>) match(implementation={vendor(score(3 + 5):ibm, xxx)},device={kind(cpu, host)})
+// CHECK-NEXT: #pragma omp declare variant(foofoo<int>) match(implementation={vendor(score(0):unknown)})
+// CHECK-NEXT: #pragma omp declare variant(foofoo<int>) match(implementation={vendor(score(0):llvm)},device={kind(cpu)})
+// CHECK-NEXT: template<> int barbar<int, 3>();
+
+// CHECK-NEXT: int baz() {
+// CHECK-NEXT: return barbar<int, 3>();
+// CHECK-NEXT: }
+int baz() {
+ return barbar<int, 3>();
+}
+
+// CHECK: template <class C> void h_ref(C *hp, C *hp2, C *hq, C *lin) {
+// CHECK-NEXT: }
+// CHECK-NEXT: template<> void h_ref<double>(double *hp, double *hp2, double *hq, double *lin) {
+// CHECK-NEXT: }
+// CHECK-NEXT: template<> void h_ref<float>(float *hp, float *hp2, float *hq, float *lin) {
+// CHECK-NEXT: }
+template <class C>
+void h_ref(C *hp, C *hp2, C *hq, C *lin) {
+}
+
+// CHECK: #pragma omp declare variant(h_ref<C>) match(implementation={vendor(score(0):unknown)},device={kind(nohost)})
+// CHECK-NEXT: #pragma omp declare variant(h_ref<C>) match(implementation={vendor(score(0):llvm)},device={kind(gpu)})
+// CHECK-NEXT: template <class C> void h(C *hp, C *hp2, C *hq, C *lin) {
+// CHECK-NEXT: }
+#pragma omp declare variant(h_ref <C>) match(xxx = {})
+#pragma omp declare variant(h_ref <C>) match(implementation={vendor(llvm)}, device={kind(gpu)})
+#pragma omp declare variant(h_ref <C>) match(implementation={vendor(unknown)},device={kind(nohost)})
+template <class C>
+void h(C *hp, C *hp2, C *hq, C *lin) {
+}
+
+// CHECK: #pragma omp declare variant(h_ref<float>) match(implementation={vendor(score(0):unknown)},device={kind(nohost)})
+// CHECK-NEXT: #pragma omp declare variant(h_ref<float>) match(implementation={vendor(score(0):llvm)},device={kind(gpu)})
+// CHECK-NEXT: template<> void h<float>(float *hp, float *hp2, float *hq, float *lin) {
+// CHECK-NEXT: }
+
+// CHECK-NEXT: template<> void h<double>(double *hp, double *hp2, double *hq, double *lin) {
+// CHECK-NEXT: h((float *)hp, (float *)hp2, (float *)hq, (float *)lin);
+// CHECK-NEXT: }
+#pragma omp declare variant(h_ref <double>) match(xxx = {})
+#pragma omp declare variant(h_ref <double>) match(implementation={vendor(ibm)},device={kind(cpu,gpu)})
+#pragma omp declare variant(h_ref <double>) match(implementation={vendor(unknown)})
+template <>
+void h(double *hp, double *hp2, double *hq, double *lin) {
+ h((float *)hp, (float *)hp2, (float *)hq, (float *)lin);
+}
+
+// CHECK: int fn();
+int fn();
+// CHECK: int fn(int);
+int fn(int);
+// CHECK: #pragma omp declare variant(fn) match(implementation={vendor(score(0):unknown)},device={kind(cpu, gpu)})
+// CHECK-NEXT: #pragma omp declare variant(fn) match(implementation={vendor(score(0):llvm)})
+// CHECK-NEXT: int overload();
+#pragma omp declare variant(fn) match(xxx = {})
+#pragma omp declare variant(fn) match(implementation={vendor(llvm)})
+#pragma omp declare variant(fn) match(implementation={vendor(unknown)},device={kind(cpu,gpu)})
+int overload(void);
+
+// CHECK: int fn_deduced_variant() {
+// CHECK-NEXT: return 0;
+// CHECK-NEXT: }
+auto fn_deduced_variant() { return 0; }
+// CHECK: #pragma omp declare variant(fn_deduced_variant) match(implementation={vendor(score(0):unknown)},device={kind(gpu, nohost)})
+// CHECK-NEXT: #pragma omp declare variant(fn_deduced_variant) match(implementation={vendor(score(0):llvm)},device={kind(cpu, host)})
+// CHECK-NEXT: int fn_deduced();
+#pragma omp declare variant(fn_deduced_variant) match(xxx = {})
+#pragma omp declare variant(fn_deduced_variant) match(implementation={vendor(llvm)},device={kind(cpu,host)})
+#pragma omp declare variant(fn_deduced_variant) match(implementation={vendor(unknown)},device={kind(gpu,nohost)})
+int fn_deduced();
+
+// CHECK: int fn_deduced_variant1();
+int fn_deduced_variant1();
+// CHECK: #pragma omp declare variant(fn_deduced_variant1) match(implementation={vendor(score(0):unknown)},device={kind(cpu, host)})
+// CHECK-NEXT: #pragma omp declare variant(fn_deduced_variant1) match(implementation={vendor(score(0):ibm)},device={kind(gpu, nohost)})
+// CHECK-NEXT: int fn_deduced1() {
+// CHECK-NEXT: return 0;
+// CHECK-NEXT: }
+#pragma omp declare variant(fn_deduced_variant1) match(xxx = {})
+#pragma omp declare variant(fn_deduced_variant1) match(implementation={vendor(ibm)},device={kind(gpu,nohost)})
+#pragma omp declare variant(fn_deduced_variant1) match(implementation={vendor(unknown)},device={kind(cpu,host)})
+auto fn_deduced1() { return 0; }
+
+// CHECK: struct SpecialFuncs {
+// CHECK-NEXT: void vd() {
+// CHECK-NEXT: }
+// CHECK-NEXT: SpecialFuncs();
+// CHECK-NEXT: ~SpecialFuncs() noexcept;
+// CHECK-NEXT: void baz() {
+// CHECK-NEXT: }
+// CHECK-NEXT: void bar() {
+// CHECK-NEXT: }
+// CHECK-NEXT: void bar(int) {
+// CHECK-NEXT: }
+// CHECK-NEXT: #pragma omp declare variant(SpecialFuncs::baz) match(implementation={vendor(score(0):unknown)},device={kind(nohost)})
+// CHECK-NEXT: #pragma omp declare variant(SpecialFuncs::bar) match(implementation={vendor(score(0):ibm)},device={kind(cpu)})
+// CHECK-NEXT: void foo1() {
+// CHECK-NEXT: }
+// CHECK-NEXT: #pragma omp declare variant(SpecialFuncs::baz) match(implementation={vendor(score(0):unknown)},device={kind(cpu, host)})
+// CHECK-NEXT: void xxx();
+// CHECK-NEXT: } s;
+struct SpecialFuncs {
+ void vd() {}
+ SpecialFuncs();
+ ~SpecialFuncs();
+
+ void baz() {}
+ void bar() {}
+ void bar(int) {}
+#pragma omp declare variant(SpecialFuncs::baz) match(xxx = {})
+#pragma omp declare variant(SpecialFuncs::bar) match(xxx = {})
+#pragma omp declare variant(SpecialFuncs::bar) match(implementation={vendor(ibm)},device={kind(cpu)})
+#pragma omp declare variant(SpecialFuncs::baz) match(implementation={vendor(unknown)},device={kind(nohost)})
+ void foo1() {}
+#pragma omp declare variant(SpecialFuncs::baz) match(implementation={vendor(unknown)},device={kind(cpu, host)})
+ void xxx();
+} s;
+
+// CHECK: #pragma omp declare variant(SpecialFuncs::baz) match(implementation={vendor(score(0):unknown)},device={kind(cpu, host)})
+// CHECK-NEXT: void SpecialFuncs::xxx() {
+// CHECK-NEXT: }
+void SpecialFuncs::xxx() {}
+
+// CHECK: static void static_f_variant() {
+// CHECK-NEXT: }
+static void static_f_variant() {}
+// CHECK: #pragma omp declare variant(static_f_variant) match(implementation={vendor(score(0):unknown)})
+// CHECK-NEXT: #pragma omp declare variant(static_f_variant) match(implementation={vendor(score(0):llvm)},device={kind(fpga)})
+// CHECK-NEXT: static void static_f() {
+// CHECK-NEXT: }
+#pragma omp declare variant(static_f_variant) match(xxx = {})
+#pragma omp declare variant(static_f_variant) match(implementation={vendor(llvm)},device={kind(fpga)})
+#pragma omp declare variant(static_f_variant) match(implementation={vendor(unknown)})
+static void static_f() {}
+
+// CHECK: void bazzzz() {
+// CHECK-NEXT: s.foo1();
+// CHECK-NEXT: static_f();
+// CHECK-NEXT: }
+void bazzzz() {
+ s.foo1();
+ static_f();
+}
+
+// CHECK: int fn_linkage_variant();
+// CHECK: extern "C" {
+// CHECK: #pragma omp declare variant(fn_linkage_variant) match(implementation={vendor(score(0):xxx)},device={kind(cpu, host)})
+// CHECK: int fn_linkage();
+// CHECK: }
+int fn_linkage_variant();
+extern "C" {
+#pragma omp declare variant(fn_linkage_variant) match(implementation = {vendor(xxx)},device={kind(cpu,host)})
+int fn_linkage();
+}
+
+// CHECK: extern "C" int fn_linkage_variant1()
+// CHECK: #pragma omp declare variant(fn_linkage_variant1) match(implementation={vendor(score(0):xxx)},device={kind(cpu, host)})
+// CHECK: int fn_linkage1();
+extern "C" int fn_linkage_variant1();
+#pragma omp declare variant(fn_linkage_variant1) match(implementation = {vendor(xxx)},device={kind(cpu,host)})
+int fn_linkage1();
+
diff --git a/src/llvm-project/clang/test/OpenMP/declare_variant_device_kind_codegen.cpp b/src/llvm-project/clang/test/OpenMP/declare_variant_device_kind_codegen.cpp
new file mode 100644
index 0000000..225990d
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/declare_variant_device_kind_codegen.cpp
@@ -0,0 +1,187 @@
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-linux -emit-llvm %s -fexceptions -fcxx-exceptions -o - -fsanitize-address-use-after-scope -DHOST | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-linux -fexceptions -fcxx-exceptions -emit-pch -o %t -fopenmp-version=50 %s -DHOST
+// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-linux -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -fopenmp-version=50 -DHOST | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple aarch64-unknown-linux -emit-llvm %s -fexceptions -fcxx-exceptions -o - -fsanitize-address-use-after-scope -DHOST | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple aarch64-unknown-linux -fexceptions -fcxx-exceptions -emit-pch -o %t -fopenmp-version=50 %s -DHOST
+// RUN: %clang_cc1 -fopenmp -x c++ -triple aarch64-unknown-linux -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -fopenmp-version=50 -DHOST | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple ppc64le-unknown-linux -emit-llvm %s -fexceptions -fcxx-exceptions -o - -fsanitize-address-use-after-scope -DHOST | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple ppc64le-unknown-linux -fexceptions -fcxx-exceptions -emit-pch -o %t -fopenmp-version=50 %s -DHOST
+// RUN: %clang_cc1 -fopenmp -x c++ -triple ppc64le-unknown-linux -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -fopenmp-version=50 -DHOST | FileCheck %s
+
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-linux -emit-llvm %s -fexceptions -fcxx-exceptions -o - -fsanitize-address-use-after-scope -DCPU | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-linux -fexceptions -fcxx-exceptions -emit-pch -o %t -fopenmp-version=50 %s -DCPU
+// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-linux -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -fopenmp-version=50 -DCPU | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple aarch64-unknown-linux -emit-llvm %s -fexceptions -fcxx-exceptions -o - -fsanitize-address-use-after-scope -DCPU | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple aarch64-unknown-linux -fexceptions -fcxx-exceptions -emit-pch -o %t -fopenmp-version=50 %s -DCPU
+// RUN: %clang_cc1 -fopenmp -x c++ -triple aarch64-unknown-linux -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -fopenmp-version=50 -DCPU | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple ppc64le-unknown-linux -emit-llvm %s -fexceptions -fcxx-exceptions -o - -fsanitize-address-use-after-scope -DCPU | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple ppc64le-unknown-linux -fexceptions -fcxx-exceptions -emit-pch -o %t -fopenmp-version=50 %s -DCPU
+// RUN: %clang_cc1 -fopenmp -x c++ -triple ppc64le-unknown-linux -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -fopenmp-version=50 -DCPU | FileCheck %s
+
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-linux -fopenmp-targets=x86_64-unknown-linux -emit-llvm-bc %s -o %t-host.bc -DCPU
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-linux -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -o - -DCPU | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-linux -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -emit-pch -o %t -DCPU
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-linux -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -include-pch %t -o - -DCPU | FileCheck %s
+
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple ppc64le-unknown-linux -fopenmp-targets=ppc64le-unknown-linux -emit-llvm-bc %s -o %t-host.bc -DCPU
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple ppc64le-unknown-linux -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -o - -DCPU | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple ppc64le-unknown-linux -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -emit-pch -o %t -DCPU
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple ppc64le-unknown-linux -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -include-pch %t -o - -DCPU | FileCheck %s
+
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-linux -fopenmp-targets=x86_64-unknown-linux -emit-llvm-bc %s -o %t-host.bc -DNOHOST
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-linux -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -o - -DNOHOST | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-linux -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -emit-pch -o %t -DNOHOST
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-linux -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -include-pch %t -o - -DNOHOST | FileCheck %s
+
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple ppc64le-unknown-linux -fopenmp-targets=ppc64le-unknown-linux -emit-llvm-bc %s -o %t-host.bc -DNOHOST
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple ppc64le-unknown-linux -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -o - -DNOHOST | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple ppc64le-unknown-linux -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -emit-pch -o %t -DNOHOST
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple ppc64le-unknown-linux -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-host.bc -include-pch %t -o - -DNOHOST | FileCheck %s
+
+// expected-no-diagnostics
+
+// CHECK-NOT: ret i32 {{1|4|81|84}}
+// CHECK-DAG: @_Z3barv = {{.*}}alias i32 (), i32 ()* @_Z3foov
+// CHECK-DAG: @_ZN16SpecSpecialFuncs6MethodEv = {{.*}}alias i32 (%struct.SpecSpecialFuncs*), i32 (%struct.SpecSpecialFuncs*)* @_ZN16SpecSpecialFuncs7method_Ev
+// CHECK-DAG: @_ZN16SpecSpecialFuncs6methodEv = linkonce_odr {{.*}}alias i32 (%struct.SpecSpecialFuncs*), i32 (%struct.SpecSpecialFuncs*)* @_ZN16SpecSpecialFuncs7method_Ev
+// CHECK-DAG: @_ZN12SpecialFuncs6methodEv = linkonce_odr {{.*}}alias i32 (%struct.SpecialFuncs*), i32 (%struct.SpecialFuncs*)* @_ZN12SpecialFuncs7method_Ev
+// CHECK-DAG: @_Z5prio_v = {{.*}}alias i32 (), i32 ()* @_Z5prio1v
+// CHECK-DAG: @_ZL6prio1_v = internal alias i32 (), i32 ()* @_ZL5prio2v
+// CHECK-DAG: @_Z4callv = {{.*}}alias i32 (), i32 ()* @_Z4testv
+// CHECK-DAG: @_ZL9stat_usedv = internal alias i32 (), i32 ()* @_ZL10stat_used_v
+// CHECK-DAG: @_ZN12SpecialFuncs6MethodEv = {{.*}}alias i32 (%struct.SpecialFuncs*), i32 (%struct.SpecialFuncs*)* @_ZN12SpecialFuncs7method_Ev
+// CHECK-DAG: @fn_linkage = {{.*}}alias i32 (), i32 ()* @_Z18fn_linkage_variantv
+// CHECK-DAG: @_Z11fn_linkage1v = {{.*}}alias i32 (), i32 ()* @fn_linkage_variant1
+// CHECK-DAG: declare {{.*}}i32 @_Z5bazzzv()
+// CHECK-DAG: declare {{.*}}i32 @_Z3bazv()
+// CHECK-DAG: ret i32 2
+// CHECK-DAG: ret i32 3
+// CHECK-DAG: ret i32 5
+// CHECK-DAG: ret i32 6
+// CHECK-DAG: ret i32 7
+// CHECK-DAG: ret i32 82
+// CHECK-DAG: ret i32 83
+// CHECK-DAG: ret i32 85
+// CHECK-DAG: ret i32 86
+// CHECK-DAG: ret i32 87
+// CHECK-NOT: ret i32 {{1|4|81|84}}
+
+#ifndef HEADER
+#define HEADER
+
+#pragma omp declare target
+#ifdef HOST
+#define CORRECT host
+#define SUBSET host, cpu
+#define WRONG host, nohost
+#endif // HOST
+#ifdef CPU
+#define CORRECT cpu
+#define SUBSET host, cpu
+#define WRONG cpu, gpu
+#endif // CPU
+#ifdef NOHOST
+#define CORRECT nohost
+#define SUBSET nohost, cpu
+#define WRONG nohost, host
+#endif // NOHOST
+
+int foo() { return 2; }
+
+#pragma omp declare variant(foo) match(device = {kind(CORRECT)})
+int bar() { return 1; }
+
+int bazzz();
+#pragma omp declare variant(bazzz) match(device = {kind(CORRECT)})
+int baz() { return 1; }
+
+int test();
+#pragma omp declare variant(test) match(device = {kind(CORRECT)})
+int call() { return 1; }
+
+static int stat_unused_();
+#pragma omp declare variant(stat_unused_) match(device = {kind(CORRECT)})
+static int stat_unused() { return 1; }
+
+static int stat_used_();
+#pragma omp declare variant(stat_used_) match(device = {kind(CORRECT)})
+static int stat_used() { return 1; }
+
+int main() { return bar() + baz() + call() + stat_used(); }
+
+int test() { return 3; }
+static int stat_unused_() { return 4; }
+static int stat_used_() { return 5; }
+
+struct SpecialFuncs {
+ void vd() {}
+ SpecialFuncs();
+ ~SpecialFuncs();
+
+ int method_() { return 6; }
+#pragma omp declare variant(SpecialFuncs::method_) \
+ match(device = {kind(CORRECT)})
+ int method() { return 1; }
+#pragma omp declare variant(SpecialFuncs::method_) \
+ match(device = {kind(CORRECT)})
+ int Method();
+} s;
+
+int SpecialFuncs::Method() { return 1; }
+
+struct SpecSpecialFuncs {
+ void vd() {}
+ SpecSpecialFuncs();
+ ~SpecSpecialFuncs();
+
+ int method_();
+#pragma omp declare variant(SpecSpecialFuncs::method_) \
+ match(device = {kind(CORRECT)})
+ int method() { return 1; }
+#pragma omp declare variant(SpecSpecialFuncs::method_) \
+ match(device = {kind(CORRECT)})
+ int Method();
+} s1;
+
+int SpecSpecialFuncs::method_() { return 7; }
+int SpecSpecialFuncs::Method() { return 1; }
+
+void xxx() {
+ (void)s.method();
+ (void)s1.method();
+}
+
+int prio() { return 81; }
+int prio1() { return 82; }
+
+#pragma omp declare variant(prio) match(device = {kind(SUBSET)})
+#pragma omp declare variant(prio1) match(device = {kind(CORRECT)})
+int prio_() { return 1; }
+
+static int prio2() { return 83; }
+static int prio3() { return 84; }
+static int prio4() { return 84; }
+
+#pragma omp declare variant(prio4) match(device = {kind(SUBSET)})
+#pragma omp declare variant(prio2) match(device = {kind(CORRECT)})
+#pragma omp declare variant(prio3) match(device = {kind(SUBSET)})
+static int prio1_() { return 1; }
+
+int int_fn() { return prio1_(); }
+
+int fn_linkage_variant() { return 85; }
+extern "C" {
+#pragma omp declare variant(fn_linkage_variant) match(device = {kind(CORRECT)})
+int fn_linkage() { return 1; }
+}
+
+extern "C" int fn_linkage_variant1() { return 86; }
+#pragma omp declare variant(fn_linkage_variant1) match(device = {kind(CORRECT)})
+int fn_linkage1() { return 1; }
+
+int fn_variant2() { return 1; }
+#pragma omp declare variant(fn_variant2) match(device = {kind(WRONG)})
+int fn2() { return 87; }
+
+#pragma omp end declare target
+#endif // HEADER
diff --git a/src/llvm-project/clang/test/OpenMP/declare_variant_implementation_vendor_codegen.cpp b/src/llvm-project/clang/test/OpenMP/declare_variant_implementation_vendor_codegen.cpp
new file mode 100644
index 0000000..a8f6a26
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/declare_variant_implementation_vendor_codegen.cpp
@@ -0,0 +1,132 @@
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple %itanium_abi_triple -emit-llvm %s -fexceptions -fcxx-exceptions -o - -fsanitize-address-use-after-scope | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple %itanium_abi_triple -fexceptions -fcxx-exceptions -emit-pch -o %t -fopenmp-version=50 %s
+// RUN: %clang_cc1 -fopenmp -x c++ -triple %itanium_abi_triple -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -fopenmp-version=50 | FileCheck %s
+// expected-no-diagnostics
+
+// CHECK-NOT: ret i32 {{1|4|81|84}}
+// CHECK-DAG: @_Z3barv = {{.*}}alias i32 (), i32 ()* @_Z3foov
+// CHECK-DAG: @_ZN16SpecSpecialFuncs6MethodEv = {{.*}}alias i32 (%struct.SpecSpecialFuncs*), i32 (%struct.SpecSpecialFuncs*)* @_ZN16SpecSpecialFuncs7method_Ev
+// CHECK-DAG: @_ZN16SpecSpecialFuncs6methodEv = linkonce_odr {{.*}}alias i32 (%struct.SpecSpecialFuncs*), i32 (%struct.SpecSpecialFuncs*)* @_ZN16SpecSpecialFuncs7method_Ev
+// CHECK-DAG: @_ZN12SpecialFuncs6methodEv = linkonce_odr {{.*}}alias i32 (%struct.SpecialFuncs*), i32 (%struct.SpecialFuncs*)* @_ZN12SpecialFuncs7method_Ev
+// CHECK-DAG: @_Z5prio_v = {{.*}}alias i32 (), i32 ()* @_Z5prio1v
+// CHECK-DAG: @_ZL6prio1_v = internal alias i32 (), i32 ()* @_ZL5prio2v
+// CHECK-DAG: @_Z4callv = {{.*}}alias i32 (), i32 ()* @_Z4testv
+// CHECK-DAG: @_ZL9stat_usedv = internal alias i32 (), i32 ()* @_ZL10stat_used_v
+// CHECK-DAG: @_ZN12SpecialFuncs6MethodEv = {{.*}}alias i32 (%struct.SpecialFuncs*), i32 (%struct.SpecialFuncs*)* @_ZN12SpecialFuncs7method_Ev
+// CHECK-DAG: @fn_linkage = {{.*}}alias i32 (), i32 ()* @_Z18fn_linkage_variantv
+// CHECK-DAG: @_Z11fn_linkage1v = {{.*}}alias i32 (), i32 ()* @fn_linkage_variant1
+// CHECK-DAG: declare {{.*}}i32 @_Z5bazzzv()
+// CHECK-DAG: declare {{.*}}i32 @_Z3bazv()
+// CHECK-DAG: ret i32 2
+// CHECK-DAG: ret i32 3
+// CHECK-DAG: ret i32 5
+// CHECK-DAG: ret i32 6
+// CHECK-DAG: ret i32 7
+// CHECK-DAG: ret i32 82
+// CHECK-DAG: ret i32 83
+// CHECK-DAG: ret i32 85
+// CHECK-DAG: ret i32 86
+// CHECK-DAG: ret i32 87
+// CHECK-NOT: ret i32 {{1|4|81|84}}
+
+#ifndef HEADER
+#define HEADER
+
+int foo() { return 2; }
+
+#pragma omp declare variant(foo) match(implementation = {vendor(llvm)})
+int bar() { return 1; }
+
+int bazzz();
+#pragma omp declare variant(bazzz) match(implementation = {vendor(llvm)})
+int baz() { return 1; }
+
+int test();
+#pragma omp declare variant(test) match(implementation = {vendor(llvm)})
+int call() { return 1; }
+
+static int stat_unused_();
+#pragma omp declare variant(stat_unused_) match(implementation = {vendor(llvm)})
+static int stat_unused() { return 1; }
+
+static int stat_used_();
+#pragma omp declare variant(stat_used_) match(implementation = {vendor(llvm)})
+static int stat_used() { return 1; }
+
+int main() { return bar() + baz() + call() + stat_used(); }
+
+int test() { return 3; }
+static int stat_unused_() { return 4; }
+static int stat_used_() { return 5; }
+
+struct SpecialFuncs {
+ void vd() {}
+ SpecialFuncs();
+ ~SpecialFuncs();
+
+ int method_() { return 6; }
+#pragma omp declare variant(SpecialFuncs::method_) \
+ match(implementation = {vendor(llvm)})
+ int method() { return 1; }
+#pragma omp declare variant(SpecialFuncs::method_) \
+ match(implementation = {vendor(llvm)})
+ int Method();
+} s;
+
+int SpecialFuncs::Method() { return 1; }
+
+struct SpecSpecialFuncs {
+ void vd() {}
+ SpecSpecialFuncs();
+ ~SpecSpecialFuncs();
+
+ int method_();
+#pragma omp declare variant(SpecSpecialFuncs::method_) \
+ match(implementation = {vendor(llvm)})
+ int method() { return 1; }
+#pragma omp declare variant(SpecSpecialFuncs::method_) \
+ match(implementation = {vendor(llvm)})
+ int Method();
+} s1;
+
+int SpecSpecialFuncs::method_() { return 7; }
+int SpecSpecialFuncs::Method() { return 1; }
+
+void xxx() {
+ (void)s.method();
+ (void)s1.method();
+}
+
+int prio() { return 81; }
+int prio1() { return 82; }
+
+#pragma omp declare variant(prio) match(implementation = {vendor(llvm)})
+#pragma omp declare variant(prio1) match(implementation = {vendor(score(1): llvm)})
+int prio_() { return 1; }
+
+static int prio2() { return 83; }
+static int prio3() { return 84; }
+static int prio4() { return 84; }
+
+#pragma omp declare variant(prio4) match(implementation = {vendor(score(3): llvm)})
+#pragma omp declare variant(prio2) match(implementation = {vendor(score(5): llvm)})
+#pragma omp declare variant(prio3) match(implementation = {vendor(score(1): llvm)})
+static int prio1_() { return 1; }
+
+int int_fn() { return prio1_(); }
+
+int fn_linkage_variant() { return 85; }
+extern "C" {
+#pragma omp declare variant(fn_linkage_variant) match(implementation = {vendor(llvm)})
+int fn_linkage() { return 1; }
+}
+
+extern "C" int fn_linkage_variant1() { return 86; }
+#pragma omp declare variant(fn_linkage_variant1) match(implementation = {vendor(llvm)})
+int fn_linkage1() { return 1; }
+
+int fn_variant2() { return 1; }
+#pragma omp declare variant(fn_variant2) match(implementation = {vendor(llvm, ibm)})
+int fn2() { return 87; }
+
+#endif // HEADER
diff --git a/src/llvm-project/clang/test/OpenMP/declare_variant_messages.c b/src/llvm-project/clang/test/OpenMP/declare_variant_messages.c
new file mode 100644
index 0000000..2650762
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/declare_variant_messages.c
@@ -0,0 +1,135 @@
+// RUN: %clang_cc1 -triple=x86_64-pc-win32 -verify -fopenmp -x c -std=c99 -fms-extensions -Wno-pragma-pack %s
+
+// RUN: %clang_cc1 -triple=x86_64-pc-win32 -verify -fopenmp-simd -x c -std=c99 -fms-extensions -Wno-pragma-pack %s
+
+// expected-error@+1 {{expected an OpenMP directive}}
+#pragma omp declare
+
+int foo(void);
+
+#pragma omp declare variant // expected-error {{expected '(' after 'declare variant'}}
+#pragma omp declare variant( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+#pragma omp declare variant(foo // expected-error {{expected ')'}} expected-error {{expected 'match' clause on 'omp declare variant' directive}} expected-note {{to match this '('}}
+#pragma omp declare variant(x) // expected-error {{use of undeclared identifier 'x'}}
+#pragma omp declare variant(foo) // expected-error {{expected 'match' clause on 'omp declare variant' directive}}
+#pragma omp declare variant(foo) // expected-error {{expected 'match' clause on 'omp declare variant' directive}}
+#pragma omp declare variant(foo) xxx // expected-error {{expected 'match' clause on 'omp declare variant' directive}}
+#pragma omp declare variant(foo) match // expected-error {{expected '(' after 'match'}}
+#pragma omp declare variant(foo) match( // expected-error {{expected context selector in 'match' clause on 'omp declare variant' directive}}
+#pragma omp declare variant(foo) match() // expected-error {{expected context selector in 'match' clause on 'omp declare variant' directive}}
+#pragma omp declare variant(foo) match(xxx) // expected-error {{expected '=' after 'xxx' context selector set name on 'omp declare variant' directive}}
+#pragma omp declare variant(foo) match(xxx=) // expected-error {{expected '{' after '='}}
+#pragma omp declare variant(foo) match(xxx=yyy) // expected-error {{expected '{' after '='}}
+#pragma omp declare variant(foo) match(xxx=yyy}) // expected-error {{expected '{' after '='}}
+#pragma omp declare variant(foo) match(xxx={) // expected-error {{expected '}' or ',' after ')'}} expected-error {{expected '}'}} expected-note {{to match this '{'}}
+#pragma omp declare variant(foo) match(xxx={})
+#pragma omp declare variant(foo) match(xxx={vvv, vvv})
+#pragma omp declare variant(foo) match(xxx={vvv} xxx) // expected-error {{expected ','}} expected-error {{expected '=' after 'xxx' context selector set name on 'omp declare variant' directive}} expected-error {{context selector set 'xxx' is used already in the same 'omp declare variant' directive}} expected-note {{previously context selector set 'xxx' used here}}
+#pragma omp declare variant(foo) match(xxx={vvv}) xxx // expected-warning {{extra tokens at the end of '#pragma omp declare variant' are ignored}}
+#pragma omp declare variant(foo) match(implementation={xxx}) // expected-warning {{unknown context selector in 'implementation' context selector set of 'omp declare variant' directive, ignored}}
+#pragma omp declare variant(foo) match(implementation={vendor}) // expected-error {{expected '(' after 'vendor'}} expected-error {{expected vendor identifier in 'vendor' context selector of 'implementation' selector set of 'omp declare variant' directive}} expected-error {{expected ')' or ',' after 'vendor name'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+#pragma omp declare variant(foo) match(implementation={vendor(}) // expected-error {{expected vendor identifier in 'vendor' context selector of 'implementation' selector set of 'omp declare variant' directive}} expected-error {{expected ')' or ',' after 'vendor name'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+#pragma omp declare variant(foo) match(implementation={vendor()}) // expected-error {{expected vendor identifier in 'vendor' context selector of 'implementation' selector set of 'omp declare variant' directive}}
+#pragma omp declare variant(foo) match(implementation={vendor(score ibm)}) // expected-error {{expected '(' after 'score'}} expected-warning {{missing ':' after context selector score clause - ignoring}}
+#pragma omp declare variant(foo) match(implementation={vendor(score( ibm)}) // expected-error {{expected ')' or ',' after 'vendor name'}} expected-error {{expected ')'}} expected-error {{use of undeclared identifier 'ibm'}} expected-error {{expected vendor identifier in 'vendor' context selector of 'implementation' selector set of 'omp declare variant' directive}} expected-warning {{missing ':' after context selector score clause - ignoring}} expected-note {{to match this '('}}
+#pragma omp declare variant(foo) match(implementation={vendor(score(2 ibm)}) // expected-error {{expected ')' or ',' after 'vendor name'}} expected-error 2 {{expected ')'}} expected-error {{expected vendor identifier in 'vendor' context selector of 'implementation' selector set of 'omp declare variant' directive}} expected-warning {{missing ':' after context selector score clause - ignoring}} expected-note 2 {{to match this '('}}
+#pragma omp declare variant(foo) match(implementation={vendor(score(foo()) ibm)}) // expected-warning {{missing ':' after context selector score clause - ignoring}} expected-error {{expression is not an integer constant expression}}
+#pragma omp declare variant(foo) match(implementation={vendor(score(5): ibm), vendor(llvm)}) // expected-error {{context trait selector 'vendor' is used already in the same 'implementation' context selector set of 'omp declare variant' directive}} expected-note {{previously context trait selector 'vendor' used here}}
+#pragma omp declare variant(foo) match(implementation={vendor(score(5): ibm), kind(cpu)}) // expected-warning {{unknown context selector in 'implementation' context selector set of 'omp declare variant' directive, ignored}}
+#pragma omp declare variant(foo) match(device={xxx}) // expected-warning {{unknown context selector in 'device' context selector set of 'omp declare variant' directive, ignored}}
+#pragma omp declare variant(foo) match(device={kind}) // expected-error {{expected '(' after 'kind'}} expected-error {{expected 'host', 'nohost', 'cpu', 'gpu', or 'fpga' in 'kind' context selector of 'device' selector set of 'omp declare variant' directive}} expected-error {{expected ')'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+#pragma omp declare variant(foo) match(device={kind(}) // expected-error {{expected 'host', 'nohost', 'cpu', 'gpu', or 'fpga' in 'kind' context selector of 'device' selector set of 'omp declare variant' directive}} expected-error 2 {{expected ')'}} expected-note {{to match this '('}}
+#pragma omp declare variant(foo) match(device={kind()}) // expected-error {{expected 'host', 'nohost', 'cpu', 'gpu', or 'fpga' in 'kind' context selector of 'device' selector set of 'omp declare variant' directive}}
+#pragma omp declare variant(foo) match(device={kind(score cpu)}) // expected-error {{expected ')' or ',' after 'score'}} expected-error {{unknown 'score' device kind trait in the 'device' context selector set, expected one of 'host', 'nohost', 'cpu', 'gpu' or 'fpga'}}
+#pragma omp declare variant(foo) match(device={kind(score( ibm)}) // expected-error 2 {{expected ')'}} expected-note {{to match this '('}} expected-error {{unknown 'score' device kind trait in the 'device' context selector set, expected one of 'host', 'nohost', 'cpu', 'gpu' or 'fpga'}}
+#pragma omp declare variant(foo) match(device={kind(score(2 gpu)}) // expected-error 2 {{expected ')'}} expected-note {{to match this '('}} expected-error {{unknown 'score' device kind trait in the 'device' context selector set, expected one of 'host', 'nohost', 'cpu', 'gpu' or 'fpga'}}
+#pragma omp declare variant(foo) match(device={kind(score(foo()) ibm)}) // expected-error {{expected ')' or ',' after 'score'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{unknown 'score' device kind trait in the 'device' context selector set, expected one of 'host', 'nohost', 'cpu', 'gpu' or 'fpga'}}
+#pragma omp declare variant(foo) match(device={kind(score(5): host), kind(llvm)}) // expected-error {{context trait selector 'kind' is used already in the same 'device' context selector set of 'omp declare variant' directive}} expected-note {{previously context trait selector 'kind' used here}} expected-error {{expected ')' or ',' after 'score'}} expected-note {{to match this '('}} expected-error {{expected ')'}} expected-error {{unknown 'score' device kind trait in the 'device' context selector set, expected one of 'host', 'nohost', 'cpu', 'gpu' or 'fpga'}} expected-error {{unknown 'llvm' device kind trait in the 'device' context selector set, expected one of 'host', 'nohost', 'cpu', 'gpu' or 'fpga'}}
+#pragma omp declare variant(foo) match(device={kind(score(5): nohost), vendor(llvm)}) // expected-warning {{unknown context selector in 'device' context selector set of 'omp declare variant' directive, ignored}} expected-error {{expected ')' or ',' after 'score'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{unknown 'score' device kind trait in the 'device' context selector set, expected one of 'host', 'nohost', 'cpu', 'gpu' or 'fpga'}}}
+int bar(void);
+
+// expected-error@+2 {{'#pragma omp declare variant' can only be applied to functions}}
+#pragma omp declare variant(foo) match(xxx={})
+int a;
+// expected-error@+2 {{'#pragma omp declare variant' can only be applied to functions}}
+#pragma omp declare variant(foo) match(xxx={})
+#pragma omp threadprivate(a)
+int var;
+#pragma omp threadprivate(var)
+
+// expected-error@+2 {{expected an OpenMP directive}} expected-error@+1 {{function declaration is expected after 'declare variant' directive}}
+#pragma omp declare variant(foo) match(xxx={})
+#pragma omp declare
+
+// expected-error@+3 {{function declaration is expected after 'declare variant' directive}}
+// expected-error@+1 {{function declaration is expected after 'declare variant' directive}}
+#pragma omp declare variant(foo) match(xxx={})
+#pragma omp declare variant(foo) match(xxx={})
+#pragma options align=packed
+int main();
+
+// expected-error@+3 {{function declaration is expected after 'declare variant' directive}}
+// expected-error@+1 {{function declaration is expected after 'declare variant' directive}}
+#pragma omp declare variant(foo) match(xxx={})
+#pragma omp declare variant(foo) match(xxx={})
+#pragma init_seg(compiler)
+int main();
+
+// expected-error@+1 {{single declaration is expected after 'declare variant' directive}}
+#pragma omp declare variant(foo) match(xxx={})
+int b, c;
+
+int no_proto();
+#pragma omp declare variant(no_proto) match(xxx={})
+int no_proto_too();
+
+int proto1(int);
+// expected-note@+2 {{previous declaration is here}}
+#pragma omp declare variant(proto1) match(xxx={})
+int diff_proto();
+// expected-error@+1 {{conflicting types for 'diff_proto'}}
+int diff_proto(double);
+
+#pragma omp declare variant(no_proto) match(xxx={})
+int diff_proto1(double);
+
+int after_use_variant(void);
+int after_use();
+int bar() {
+ return after_use();
+}
+
+// expected-warning@+1 {{'#pragma omp declare variant' cannot be applied for function after first usage; the original function might be used}}
+#pragma omp declare variant(after_use_variant) match(xxx={})
+int after_use(void);
+#pragma omp declare variant(after_use_variant) match(xxx={})
+int defined(void) { return 0; }
+int defined1(void) { return 0; }
+// expected-warning@+1 {{#pragma omp declare variant' cannot be applied to the function that was defined already; the original function might be used}}
+#pragma omp declare variant(after_use_variant) match(xxx={})
+int defined1(void);
+
+
+int diff_cc_variant(void);
+// expected-error@+1 {{variant in '#pragma omp declare variant' with type 'int (void)' is incompatible with type 'int (void) __attribute__((vectorcall))'}}
+#pragma omp declare variant(diff_cc_variant) match(xxx={})
+__vectorcall int diff_cc(void);
+
+int diff_ret_variant(void);
+// expected-error@+1 {{variant in '#pragma omp declare variant' with type 'int (void)' is incompatible with type 'void (void)'}}
+#pragma omp declare variant(diff_ret_variant) match(xxx={})
+void diff_ret(void);
+
+void marked(void);
+void not_marked(void);
+// expected-note@+1 {{marked as 'declare variant' here}}
+#pragma omp declare variant(not_marked) match(implementation={vendor(unknown)}, device={kind(cpu)})
+void marked_variant(void);
+// expected-warning@+1 {{variant function in '#pragma omp declare variant' is itself marked as '#pragma omp declare variant'}}
+#pragma omp declare variant(marked_variant) match(xxx={})
+void marked(void);
+
+// expected-error@+1 {{function declaration is expected after 'declare variant' directive}}
+#pragma omp declare variant
+// expected-error@+1 {{function declaration is expected after 'declare variant' directive}}
+#pragma omp declare variant
diff --git a/src/llvm-project/clang/test/OpenMP/declare_variant_messages.cpp b/src/llvm-project/clang/test/OpenMP/declare_variant_messages.cpp
new file mode 100644
index 0000000..ca1e4c3
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/declare_variant_messages.cpp
@@ -0,0 +1,254 @@
+// RUN: %clang_cc1 -triple=x86_64-pc-win32 -verify -fopenmp -x c++ -std=c++14 -fms-extensions -Wno-pragma-pack -fexceptions -fcxx-exceptions %s
+
+// RUN: %clang_cc1 -triple=x86_64-pc-win32 -verify -fopenmp-simd -x c++ -std=c++14 -fms-extensions -Wno-pragma-pack -fexceptions -fcxx-exceptions %s
+
+// expected-error@+1 {{expected an OpenMP directive}}
+#pragma omp declare
+
+int foo();
+
+template <typename T>
+T foofoo(); // expected-note 2 {{declared here}}
+
+#pragma omp declare variant // expected-error {{expected '(' after 'declare variant'}}
+#pragma omp declare variant( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+#pragma omp declare variant(foo // expected-error {{expected ')'}} expected-error {{expected 'match' clause on 'omp declare variant' directive}} expected-note {{to match this '('}}
+#pragma omp declare variant(x) // expected-error {{use of undeclared identifier 'x'}}
+#pragma omp declare variant(foo) // expected-error {{expected 'match' clause on 'omp declare variant' directive}}
+#pragma omp declare variant(foofoo <int>) // expected-error {{expected 'match' clause on 'omp declare variant' directive}}
+#pragma omp declare variant(foofoo <int>) xxx // expected-error {{expected 'match' clause on 'omp declare variant' directive}}
+#pragma omp declare variant(foofoo <int>) match // expected-error {{expected '(' after 'match'}}
+#pragma omp declare variant(foofoo <int>) match( // expected-error {{expected context selector in 'match' clause on 'omp declare variant' directive}}
+#pragma omp declare variant(foofoo <int>) match() // expected-error {{expected context selector in 'match' clause on 'omp declare variant' directive}}
+#pragma omp declare variant(foofoo <int>) match(xxx) // expected-error {{expected '=' after 'xxx' context selector set name on 'omp declare variant' directive}}
+#pragma omp declare variant(foofoo <int>) match(xxx =) // expected-error {{expected '{' after '='}}
+#pragma omp declare variant(foofoo <int>) match(xxx = yyy) // expected-error {{expected '{' after '='}}
+#pragma omp declare variant(foofoo <int>) match(xxx = yyy }) // expected-error {{expected '{' after '='}}
+#pragma omp declare variant(foofoo <int>) match(xxx = {) // expected-error {{expected '}' or ',' after ')'}} expected-error {{expected '}'}} expected-note {{to match this '{'}}
+#pragma omp declare variant(foofoo <int>) match(xxx = {})
+#pragma omp declare variant(foofoo <int>) match(xxx = {vvv, vvv})
+#pragma omp declare variant(foofoo <int>) match(xxx = {vvv} xxx) // expected-error {{expected ','}} expected-error {{expected '=' after 'xxx' context selector set name on 'omp declare variant' directive}} expected-error {{context selector set 'xxx' is used already in the same 'omp declare variant' directive}} expected-note {{previously context selector set 'xxx' used here}}
+#pragma omp declare variant(foofoo <int>) match(xxx = {vvv}) xxx // expected-warning {{extra tokens at the end of '#pragma omp declare variant' are ignored}}
+#pragma omp declare variant(foofoo <int>) match(implementation={xxx}) // expected-warning {{unknown context selector in 'implementation' context selector set of 'omp declare variant' directive, ignored}}
+#pragma omp declare variant(foofoo <int>) match(implementation={vendor}) // expected-error {{expected '(' after 'vendor'}} expected-error {{expected vendor identifier in 'vendor' context selector of 'implementation' selector set of 'omp declare variant' directive}} expected-error {{expected ')' or ',' after 'vendor name'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+#pragma omp declare variant(foofoo <int>) match(implementation={vendor(}) // expected-error {{expected vendor identifier in 'vendor' context selector of 'implementation' selector set of 'omp declare variant' directive}} expected-error {{expected ')' or ',' after 'vendor name'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+#pragma omp declare variant(foofoo <int>) match(implementation={vendor()}) // expected-error {{expected vendor identifier in 'vendor' context selector of 'implementation' selector set of 'omp declare variant' directive}}
+#pragma omp declare variant(foofoo <int>) match(implementation={vendor(score ibm)}) // expected-error {{expected '(' after 'score'}} expected-warning {{missing ':' after context selector score clause - ignoring}}
+#pragma omp declare variant(foofoo <int>) match(implementation={vendor(score( ibm)}) // expected-error {{expected ')' or ',' after 'vendor name'}} expected-error {{expected ')'}} expected-error {{use of undeclared identifier 'ibm'}} expected-error {{expected vendor identifier in 'vendor' context selector of 'implementation' selector set of 'omp declare variant' directive}} expected-warning {{missing ':' after context selector score clause - ignoring}} expected-note {{to match this '('}}
+#pragma omp declare variant(foofoo <int>) match(implementation={vendor(score(2 ibm)}) // expected-error {{expected ')' or ',' after 'vendor name'}} expected-error 2 {{expected ')'}} expected-error {{expected vendor identifier in 'vendor' context selector of 'implementation' selector set of 'omp declare variant' directive}} expected-warning {{missing ':' after context selector score clause - ignoring}} expected-note 2 {{to match this '('}}
+#pragma omp declare variant(foofoo <int>) match(implementation={vendor(score(foofoo <int>()) ibm)}) // expected-warning {{missing ':' after context selector score clause - ignoring}} expected-error {{expression is not an integral constant expression}} expected-note {{non-constexpr function 'foofoo<int>' cannot be used in a constant expression}}
+#pragma omp declare variant(foofoo <int>) match(implementation={vendor(score(5): ibm), vendor(llvm)}) // expected-error {{context trait selector 'vendor' is used already in the same 'implementation' context selector set of 'omp declare variant' directive}} expected-note {{previously context trait selector 'vendor' used here}}
+#pragma omp declare variant(foofoo <int>) match(implementation={vendor(score(5): ibm), kind(cpu)}) // expected-warning {{unknown context selector in 'implementation' context selector set of 'omp declare variant' directive, ignored}}
+#pragma omp declare variant(foofoo <int>) match(device={xxx}) // expected-warning {{unknown context selector in 'device' context selector set of 'omp declare variant' directive, ignored}}
+#pragma omp declare variant(foofoo <int>) match(device={kind}) // expected-error {{expected '(' after 'kind'}} expected-error {{expected 'host', 'nohost', 'cpu', 'gpu', or 'fpga' in 'kind' context selector of 'device' selector set of 'omp declare variant' directive}} expected-error {{expected ')'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+#pragma omp declare variant(foofoo <int>) match(device={kind(}) // expected-error {{expected 'host', 'nohost', 'cpu', 'gpu', or 'fpga' in 'kind' context selector of 'device' selector set of 'omp declare variant' directive}} expected-error 2 {{expected ')'}} expected-note {{to match this '('}}
+#pragma omp declare variant(foofoo <int>) match(device={kind()}) // expected-error {{expected 'host', 'nohost', 'cpu', 'gpu', or 'fpga' in 'kind' context selector of 'device' selector set of 'omp declare variant' directive}}
+#pragma omp declare variant(foofoo <int>) match(device={kind(score cpu)}) // expected-error {{expected ')' or ',' after 'score'}} expected-error {{unknown 'score' device kind trait in the 'device' context selector set, expected one of 'host', 'nohost', 'cpu', 'gpu' or 'fpga'}}
+#pragma omp declare variant(foofoo <int>) match(device={kind(score( ibm)}) // expected-error 2 {{expected ')'}} expected-note {{to match this '('}} expected-error {{unknown 'score' device kind trait in the 'device' context selector set, expected one of 'host', 'nohost', 'cpu', 'gpu' or 'fpga'}}
+#pragma omp declare variant(foofoo <int>) match(device={kind(score(2 gpu)}) // expected-error 2 {{expected ')'}} expected-note {{to match this '('}} expected-error {{unknown 'score' device kind trait in the 'device' context selector set, expected one of 'host', 'nohost', 'cpu', 'gpu' or 'fpga'}}
+#pragma omp declare variant(foofoo <int>) match(device={kind(score(foofoo <int>()) ibm)}) // expected-error {{expected ')' or ',' after 'score'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{unknown 'score' device kind trait in the 'device' context selector set, expected one of 'host', 'nohost', 'cpu', 'gpu' or 'fpga'}}
+#pragma omp declare variant(foofoo <int>) match(device={kind(score(5): host), kind(llvm)}) // expected-error {{context trait selector 'kind' is used already in the same 'device' context selector set of 'omp declare variant' directive}} expected-note {{previously context trait selector 'kind' used here}} expected-error {{expected ')' or ',' after 'score'}} expected-note {{to match this '('}} expected-error {{expected ')'}} expected-error {{unknown 'score' device kind trait in the 'device' context selector set, expected one of 'host', 'nohost', 'cpu', 'gpu' or 'fpga'}} expected-error {{unknown 'llvm' device kind trait in the 'device' context selector set, expected one of 'host', 'nohost', 'cpu', 'gpu' or 'fpga'}}
+#pragma omp declare variant(foofoo <int>) match(device={kind(score(5): nohost), vendor(llvm)}) // expected-warning {{unknown context selector in 'device' context selector set of 'omp declare variant' directive, ignored}} expected-error {{expected ')' or ',' after 'score'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{unknown 'score' device kind trait in the 'device' context selector set, expected one of 'host', 'nohost', 'cpu', 'gpu' or 'fpga'}}
+int bar();
+
+#pragma omp declare variant // expected-error {{expected '(' after 'declare variant'}}
+#pragma omp declare variant( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+#pragma omp declare variant(foofoo <T> // expected-error {{expected ')'}} expected-error {{expected 'match' clause on 'omp declare variant' directive}} expected-note {{to match this '('}}
+#pragma omp declare variant(x) // expected-error {{use of undeclared identifier 'x'}}
+#pragma omp declare variant(foo) // expected-error {{expected 'match' clause on 'omp declare variant' directive}}
+#pragma omp declare variant(foofoo) // expected-error {{expected 'match' clause on 'omp declare variant' directive}}
+#pragma omp declare variant(foofoo <T>) // expected-error {{expected 'match' clause on 'omp declare variant' directive}}
+#pragma omp declare variant(foofoo <T>) xxx // expected-error {{expected 'match' clause on 'omp declare variant' directive}}
+#pragma omp declare variant(foofoo <T>) match // expected-error {{expected '(' after 'match'}}
+#pragma omp declare variant(foofoo <T>) match( // expected-error {{expected context selector in 'match' clause on 'omp declare variant' directive}}
+#pragma omp declare variant(foofoo <T>) match() // expected-error {{expected context selector in 'match' clause on 'omp declare variant' directive}}
+#pragma omp declare variant(foofoo <T>) match(xxx) // expected-error {{expected '=' after 'xxx' context selector set name on 'omp declare variant' directive}}
+#pragma omp declare variant(foofoo <T>) match(xxx =) // expected-error {{expected '{' after '='}}
+#pragma omp declare variant(foofoo <T>) match(xxx = {) // expected-error {{expected '}' or ',' after ')'}} expected-error {{expected '}'}} expected-note {{to match this '{'}}
+#pragma omp declare variant(foofoo <T>) match(xxx = {})
+#pragma omp declare variant(foofoo <T>) match(xxx = {vvv, vvv})
+#pragma omp declare variant(foofoo <T>) match(user = {score(<expr>) : condition(<expr>)})
+#pragma omp declare variant(foofoo <T>) match(user = {score(<expr>) : condition(<expr>)})
+#pragma omp declare variant(foofoo <T>) match(user = {condition(<expr>)})
+#pragma omp declare variant(foofoo <T>) match(user = {condition(<expr>)})
+#pragma omp declare variant(foofoo <T>) match(xxx = {vvv} xxx) // expected-error {{expected ','}} expected-error {{expected '=' after 'xxx' context selector set name on 'omp declare variant' directive}} expected-error {{context selector set 'xxx' is used already in the same 'omp declare variant' directive}} expected-note {{previously context selector set 'xxx' used here}}
+#pragma omp declare variant(foofoo <T>) match(xxx = {vvv}) xxx // expected-warning {{extra tokens at the end of '#pragma omp declare variant' are ignored}}
+#pragma omp declare variant(foofoo <int>) match(implementation={vendor(score ibm)}) // expected-error {{expected '(' after 'score'}} expected-warning {{missing ':' after context selector score clause - ignoring}}
+#pragma omp declare variant(foofoo <int>) match(implementation={vendor(score( ibm)}) // expected-error {{expected ')' or ',' after 'vendor name'}} expected-error {{expected ')'}} expected-error {{use of undeclared identifier 'ibm'}} expected-error {{expected vendor identifier in 'vendor' context selector of 'implementation' selector set of 'omp declare variant' directive}} expected-warning {{missing ':' after context selector score clause - ignoring}} expected-note {{to match this '('}}
+#pragma omp declare variant(foofoo <int>) match(implementation={vendor(score(C ibm)}) // expected-error {{expected ')' or ',' after 'vendor name'}} expected-error 2 {{expected ')'}} expected-error {{expected vendor identifier in 'vendor' context selector of 'implementation' selector set of 'omp declare variant' directive}} expected-warning {{missing ':' after context selector score clause - ignoring}} expected-note 2 {{to match this '('}}
+#pragma omp declare variant(foofoo <int>) match(implementation={vendor(score(foofoo <int>()) ibm)}) // expected-warning {{missing ':' after context selector score clause - ignoring}} expected-error {{expression is not an integral constant expression}} expected-note {{non-constexpr function 'foofoo<int>' cannot be used in a constant expression}}
+#pragma omp declare variant(foofoo <int>) match(implementation={vendor(score(C+5): ibm), vendor(llvm)}) // expected-error {{context trait selector 'vendor' is used already in the same 'implementation' context selector set of 'omp declare variant' directive}} expected-note {{previously context trait selector 'vendor' used here}}
+#pragma omp declare variant(foofoo <int>) match(implementation={vendor(score(5): ibm), kind(cpu)}) // expected-warning {{unknown context selector in 'implementation' context selector set of 'omp declare variant' directive, ignored}}
+#pragma omp declare variant(foofoo <int>) match(device={xxx}) // expected-warning {{unknown context selector in 'device' context selector set of 'omp declare variant' directive, ignored}}
+#pragma omp declare variant(foofoo <int>) match(device={kind}) // expected-error {{expected '(' after 'kind'}} expected-error {{expected 'host', 'nohost', 'cpu', 'gpu', or 'fpga' in 'kind' context selector of 'device' selector set of 'omp declare variant' directive}} expected-error {{expected ')'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+#pragma omp declare variant(foofoo <int>) match(device={kind(}) // expected-error {{expected 'host', 'nohost', 'cpu', 'gpu', or 'fpga' in 'kind' context selector of 'device' selector set of 'omp declare variant' directive}} expected-error 2 {{expected ')'}} expected-note {{to match this '('}}
+#pragma omp declare variant(foofoo <int>) match(device={kind()}) // expected-error {{expected 'host', 'nohost', 'cpu', 'gpu', or 'fpga' in 'kind' context selector of 'device' selector set of 'omp declare variant' directive}}
+#pragma omp declare variant(foofoo <int>) match(device={kind(score cpu)}) // expected-error {{expected ')' or ',' after 'score'}} expected-error {{unknown 'score' device kind trait in the 'device' context selector set, expected one of 'host', 'nohost', 'cpu', 'gpu' or 'fpga'}}
+#pragma omp declare variant(foofoo <int>) match(device={kind(score( ibm)}) // expected-error 2 {{expected ')'}} expected-note {{to match this '('}} expected-error {{unknown 'score' device kind trait in the 'device' context selector set, expected one of 'host', 'nohost', 'cpu', 'gpu' or 'fpga'}}
+#pragma omp declare variant(foofoo <int>) match(device={kind(score(C gpu)}) // expected-error 2 {{expected ')'}} expected-note {{to match this '('}} expected-error {{unknown 'score' device kind trait in the 'device' context selector set, expected one of 'host', 'nohost', 'cpu', 'gpu' or 'fpga'}}
+#pragma omp declare variant(foofoo <int>) match(device={kind(score(foofoo <int>()) ibm)}) // expected-error {{expected ')' or ',' after 'score'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{unknown 'score' device kind trait in the 'device' context selector set, expected one of 'host', 'nohost', 'cpu', 'gpu' or 'fpga'}}
+#pragma omp declare variant(foofoo <int>) match(device={kind(score(C+5): host), kind(llvm)}) // expected-error {{context trait selector 'kind' is used already in the same 'device' context selector set of 'omp declare variant' directive}} expected-note {{previously context trait selector 'kind' used here}} expected-error {{expected ')' or ',' after 'score'}} expected-note {{to match this '('}} expected-error {{expected ')'}} expected-error {{unknown 'score' device kind trait in the 'device' context selector set, expected one of 'host', 'nohost', 'cpu', 'gpu' or 'fpga'}} expected-error {{unknown 'llvm' device kind trait in the 'device' context selector set, expected one of 'host', 'nohost', 'cpu', 'gpu' or 'fpga'}}
+#pragma omp declare variant(foofoo <int>) match(device={kind(score(C+5): nohost), vendor(llvm)}) // expected-warning {{unknown context selector in 'device' context selector set of 'omp declare variant' directive, ignored}} expected-error {{expected ')' or ',' after 'score'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{unknown 'score' device kind trait in the 'device' context selector set, expected one of 'host', 'nohost', 'cpu', 'gpu' or 'fpga'}}
+template <typename T, int C>
+T barbar();
+
+// expected-error@+2 {{'#pragma omp declare variant' can only be applied to functions}}
+#pragma omp declare variant(barbar <int>) match(xxx = {})
+int a;
+// expected-error@+2 {{'#pragma omp declare variant' can only be applied to functions}}
+#pragma omp declare variant(barbar <int>) match(xxx = {})
+#pragma omp threadprivate(a)
+int var;
+#pragma omp threadprivate(var)
+
+// expected-error@+2 {{expected an OpenMP directive}} expected-error@+1 {{function declaration is expected after 'declare variant' directive}}
+#pragma omp declare variant(barbar <int>) match(xxx = {})
+#pragma omp declare
+
+// expected-error@+3 {{function declaration is expected after 'declare variant' directive}}
+// expected-error@+1 {{function declaration is expected after 'declare variant' directive}}
+#pragma omp declare variant(barbar <int>) match(xxx = {})
+#pragma omp declare variant(barbar <int>) match(xxx = {})
+#pragma options align = packed
+int main();
+
+// expected-error@+3 {{function declaration is expected after 'declare variant' directive}}
+// expected-error@+1 {{function declaration is expected after 'declare variant' directive}}
+#pragma omp declare variant(barbar <int>) match(xxx = {})
+#pragma omp declare variant(barbar <int>) match(xxx = {})
+#pragma init_seg(compiler)
+int main();
+
+// expected-error@+1 {{single declaration is expected after 'declare variant' directive}}
+#pragma omp declare variant(barbar <int>) match(xxx = {})
+int b, c;
+
+// expected-error@+1 {{'C' does not refer to a value}}
+#pragma omp declare variant(C) match(xxx = {})
+// expected-note@+1 {{declared here}}
+template <class C>
+void h(C *hp, C *hp2, C *hq, C *lin) {
+ b = 0;
+}
+
+// expected-error@+1 {{variant in '#pragma omp declare variant' with type '<overloaded function type>' is incompatible with type 'void (int *, int *, int *, int *)'}}
+#pragma omp declare variant(barbar <int>) match(xxx = {})
+template <>
+void h(int *hp, int *hp2, int *hq, int *lin);
+
+int after_use_variant(void);
+int after_use();
+int bar() {
+ return after_use();
+}
+
+// expected-warning@+1 {{'#pragma omp declare variant' cannot be applied for function after first usage; the original function might be used}}
+#pragma omp declare variant(after_use_variant) match(xxx = {})
+int after_use(void);
+
+int fn();
+int fn(int);
+#pragma omp declare variant(fn) match(xxx = {})
+int overload(void);
+
+int fn1();
+int fn1(int);
+// expected-error@+1 {{variant in '#pragma omp declare variant' with type '<overloaded function type>' is incompatible with type 'int (float)'}}
+#pragma omp declare variant(fn1) match(xxx = {})
+int overload1(float);
+
+int fn_constexpr_variant();
+// expected-error@+2 {{'#pragma omp declare variant' does not support constexpr functions}}
+#pragma omp declare variant(fn_constexpr_variant) match(xxx = {})
+constexpr int fn_constexpr();
+
+constexpr int fn_constexpr_variant1();
+// expected-error@+1 {{'#pragma omp declare variant' does not support constexpr functions}}
+#pragma omp declare variant(fn_constexpr_variant1) match(xxx = {})
+int fn_constexpr1();
+
+int fn_sc_variant();
+// expected-error@+1 {{function with '#pragma omp declare variant' has a different storage class}}
+#pragma omp declare variant(fn_sc_variant) match(xxx = {})
+static int fn_sc();
+
+static int fn_sc_variant1();
+// expected-error@+1 {{function with '#pragma omp declare variant' has a different storage class}}
+#pragma omp declare variant(fn_sc_variant1) match(xxx = {})
+int fn_sc1();
+
+int fn_inline_variant();
+// expected-error@+1 {{function with '#pragma omp declare variant' has a different inline specification}}
+#pragma omp declare variant(fn_inline_variant) match(xxx = {})
+inline int fn_inline();
+
+inline int fn_inline_variant1();
+// expected-error@+1 {{function with '#pragma omp declare variant' has a different inline specification}}
+#pragma omp declare variant(fn_inline_variant1) match(xxx = {})
+int fn_inline1();
+
+auto fn_deduced_variant() { return 0; }
+#pragma omp declare variant(fn_deduced_variant) match(xxx = {})
+int fn_deduced();
+
+int fn_deduced_variant1();
+#pragma omp declare variant(fn_deduced_variant1) match(xxx = {})
+auto fn_deduced1() { return 0; }
+
+auto fn_deduced3() { return 0; }
+// expected-warning@+1 {{'#pragma omp declare variant' cannot be applied to the function that was defined already; the original function might be used}}
+#pragma omp declare variant(fn_deduced_variant1) match(xxx = {})
+auto fn_deduced3();
+
+auto fn_deduced_variant2() { return 0; }
+// expected-error@+1 {{variant in '#pragma omp declare variant' with type 'int ()' is incompatible with type 'float ()'}}
+#pragma omp declare variant(fn_deduced_variant2) match(xxx = {})
+float fn_deduced2();
+
+// expected-error@+1 {{exception specification in declaration does not match previous declaration}}
+int fn_except_variant() noexcept(true);
+// expected-note@+2 {{previous declaration is here}}
+#pragma omp declare variant(fn_except_variant) match(xxx = {})
+int fn_except() noexcept(false);
+
+// expected-error@+1 {{exception specification in declaration does not match previous declaration}}
+int fn_except_variant1() noexcept(false);
+// expected-note@+2 {{previous declaration is here}}
+#pragma omp declare variant(fn_except_variant1) match(xxx = {})
+int fn_except1() noexcept(true);
+
+struct SpecialFuncs {
+ void vd();
+ // expected-error@+2 {{'#pragma omp declare variant' does not support constructors}}
+#pragma omp declare variant(SpecialFuncs::vd) match(xxx = {})
+ SpecialFuncs();
+ // expected-error@+2 {{'#pragma omp declare variant' does not support destructors}}
+#pragma omp declare variant(SpecialFuncs::vd) match(xxx = {})
+ ~SpecialFuncs();
+
+ void baz();
+ void bar();
+ void bar(int);
+#pragma omp declare variant(SpecialFuncs::baz) match(xxx = {})
+#pragma omp declare variant(SpecialFuncs::bar) match(xxx = {})
+// expected-error@+1 {{variant in '#pragma omp declare variant' with type 'int (*)()' is incompatible with type 'void (SpecialFuncs::*)()'}}
+#pragma omp declare variant(fn_sc_variant1) match(xxx = {})
+ void foo1();
+ SpecialFuncs& foo(const SpecialFuncs&);
+ SpecialFuncs& bar(SpecialFuncs&&);
+ // expected-error@+2 {{'#pragma omp declare variant' does not support defaulted functions}}
+#pragma omp declare variant(SpecialFuncs::foo) match(xxx = {})
+ SpecialFuncs& operator=(const SpecialFuncs&) = default;
+ // expected-error@+2 {{'#pragma omp declare variant' does not support deleted functions}}
+#pragma omp declare variant(SpecialFuncs::bar) match(xxx = {})
+ SpecialFuncs& operator=(SpecialFuncs&&) = delete;
+};
+
+namespace N {
+// expected-error@+1 {{function declaration is expected after 'declare variant' directive}}
+#pragma omp declare variant
+} // namespace N
+// expected-error@+1 {{function declaration is expected after 'declare variant' directive}}
+#pragma omp declare variant
+// expected-error@+1 {{function declaration is expected after 'declare variant' directive}}
+#pragma omp declare variant
diff --git a/src/llvm-project/clang/test/OpenMP/declare_variant_mixed_codegen.c b/src/llvm-project/clang/test/OpenMP/declare_variant_mixed_codegen.c
new file mode 100644
index 0000000..6345709
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/declare_variant_mixed_codegen.c
@@ -0,0 +1,49 @@
+// RUN: %clang_cc1 -verify -fopenmp -x c -triple x86_64-unknown-linux -emit-llvm %s -o - | FileCheck %s --check-prefix HOST
+// RUN: %clang_cc1 -fopenmp -x c -triple x86_64-unknown-linux -emit-pch -o %t -fopenmp-version=50 %s
+// RUN: %clang_cc1 -fopenmp -x c -triple x86_64-unknown-linux -include-pch %t -verify %s -emit-llvm -o - -fopenmp-version=50 | FileCheck %s --check-prefix HOST
+// RUN: %clang_cc1 -verify -fopenmp -x c -triple powerpc64le-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm-bc %s -o %t-ppc-host.bc -fopenmp-version=50
+// RUN: %clang_cc1 -verify -fopenmp -x c -triple nvptx64-unknown-unknown -aux-triple powerpc64le-unknown-unknown -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - -fopenmp-version=50 | FileCheck %s --check-prefix GPU
+// RUN: %clang_cc1 -verify -fopenmp -x c -triple nvptx64-unknown-unknown -aux-triple powerpc64le-unknown-unknown -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -emit-pch -o %t -fopenmp-version=50
+// RUN: %clang_cc1 -verify -fopenmp -x c -triple nvptx64-unknown-unknown -aux-triple powerpc64le-unknown-unknown -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -include-pch %t -o - -fopenmp-version=50 | FileCheck %s --check-prefix GPU
+// expected-no-diagnostics
+
+// HOST: @base = alias i32 (double), i32 (double)* @hst
+#ifndef HEADER
+#define HEADER
+
+int dev(double i) { return 0; }
+
+int hst(double i) { return 1; }
+
+#pragma omp declare variant(hst) match(device = {kind(host)})
+#pragma omp declare variant(dev) match(device = {kind(gpu)})
+int base();
+
+// HOST-LABEL: define void @foo()
+// HOST: call i32 (double, ...) bitcast (i32 (double)* @base to i32 (double, ...)*)(double -1.000000e+00)
+// HOST: call i32 @hst(double -2.000000e+00)
+// HOST: call void [[OFFL:@.+_foo_l29]]()
+void foo() {
+ base(-1);
+ hst(-2);
+#pragma omp target
+ {
+ base(-3);
+ dev(-4);
+ }
+}
+
+// HOST: define {{.*}}void [[OFFL]]()
+// HOST: call i32 (double, ...) bitcast (i32 (double)* @base to i32 (double, ...)*)(double -3.000000e+00)
+// HOST: call i32 @dev(double -4.000000e+00)
+
+// GPU: define {{.*}}void @__omp_offloading_{{.+}}_foo_l29()
+// GPU: call i32 @base(double -3.000000e+00)
+// GPU: call i32 @dev(double -4.000000e+00)
+
+// GPU: define {{.*}}i32 @base(double
+// GPU: ret i32 0
+// GPU: define {{.*}}i32 @dev(double
+// GPU: ret i32 0
+
+#endif // HEADER
diff --git a/src/llvm-project/clang/test/OpenMP/declare_variant_mixed_codegen.cpp b/src/llvm-project/clang/test/OpenMP/declare_variant_mixed_codegen.cpp
new file mode 100644
index 0000000..0c13f5f
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/declare_variant_mixed_codegen.cpp
@@ -0,0 +1,148 @@
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-linux -emit-llvm %s -fexceptions -fcxx-exceptions -o - -fsanitize-address-use-after-scope | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-linux -fexceptions -fcxx-exceptions -emit-pch -o %t -fopenmp-version=50 %s
+// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-linux -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -fopenmp-version=50 | FileCheck %s
+// expected-no-diagnostics
+
+// CHECK-NOT: ret i32 {{1|4|81|84}}
+// CHECK-DAG: @_Z3barv = {{.*}}alias i32 (), i32 ()* @_Z3foov
+// CHECK-DAG: @_ZN16SpecSpecialFuncs6MethodEv = {{.*}}alias i32 (%struct.SpecSpecialFuncs*), i32 (%struct.SpecSpecialFuncs*)* @_ZN16SpecSpecialFuncs7method_Ev
+// CHECK-DAG: @_ZN16SpecSpecialFuncs6methodEv = linkonce_odr {{.*}}alias i32 (%struct.SpecSpecialFuncs*), i32 (%struct.SpecSpecialFuncs*)* @_ZN16SpecSpecialFuncs7method_Ev
+// CHECK-DAG: @_ZN12SpecialFuncs6methodEv = linkonce_odr {{.*}}alias i32 (%struct.SpecialFuncs*), i32 (%struct.SpecialFuncs*)* @_ZN12SpecialFuncs7method_Ev
+// CHECK-DAG: @_Z5prio_v = {{.*}}alias i32 (), i32 ()* @_Z5prio1v
+// CHECK-DAG: @_ZL6prio1_v = internal alias i32 (), i32 ()* @_ZL5prio2v
+// CHECK-DAG: @_Z4callv = {{.*}}alias i32 (), i32 ()* @_Z4testv
+// CHECK-DAG: @_ZL9stat_usedv = internal alias i32 (), i32 ()* @_ZL10stat_used_v
+// CHECK-DAG: @_ZN12SpecialFuncs6MethodEv = {{.*}}alias i32 (%struct.SpecialFuncs*), i32 (%struct.SpecialFuncs*)* @_ZN12SpecialFuncs7method_Ev
+// CHECK-DAG: @fn_linkage = {{.*}}alias i32 (), i32 ()* @_Z18fn_linkage_variantv
+// CHECK-DAG: @_Z11fn_linkage1v = {{.*}}alias i32 (), i32 ()* @fn_linkage_variant1
+// CHECK-DAG: declare {{.*}}i32 @_Z5bazzzv()
+// CHECK-DAG: declare {{.*}}i32 @_Z3bazv()
+// CHECK-DAG: ret i32 2
+// CHECK-DAG: ret i32 3
+// CHECK-DAG: ret i32 5
+// CHECK-DAG: ret i32 6
+// CHECK-DAG: ret i32 7
+// CHECK-DAG: ret i32 82
+// CHECK-DAG: ret i32 83
+// CHECK-DAG: ret i32 85
+// CHECK-DAG: ret i32 86
+// CHECK-DAG: ret i32 87
+// CHECK-DAG: ret i32 88
+// CHECK-NOT: ret i32 {{1|4|81|84}}
+
+#ifndef HEADER
+#define HEADER
+
+int foo() { return 2; }
+
+#pragma omp declare variant(foo) match(implementation = {vendor(llvm)}, device={kind(cpu)})
+int bar() { return 1; }
+
+int bazzz();
+#pragma omp declare variant(bazzz) match(implementation = {vendor(llvm)}, device={kind(host)})
+int baz() { return 1; }
+
+int test();
+#pragma omp declare variant(test) match(implementation = {vendor(llvm)}, device={kind(cpu)})
+int call() { return 1; }
+
+static int stat_unused_no_emit() { return 1; }
+static int stat_unused_();
+#pragma omp declare variant(stat_unused_) match(implementation = {vendor(llvm)}, device={kind(cpu)})
+#pragma omp declare variant(stat_unused_no_emit) match(implementation = {vendor(xxx)}, device={kind(gpu)})
+static int stat_unused() { return 1; }
+
+static int stat_used_();
+#pragma omp declare variant(stat_used_) match(implementation = {vendor(llvm)}, device={kind(host)})
+static int stat_used() { return 1; }
+
+int main() { return bar() + baz() + call() + stat_used(); }
+
+int test() { return 3; }
+static int stat_unused_() { return 4; }
+static int stat_used_() { return 5; }
+
+struct SpecialFuncs {
+ void vd() {}
+ SpecialFuncs();
+ ~SpecialFuncs();
+
+ int method_() { return 6; }
+#pragma omp declare variant(SpecialFuncs::method_) \
+ match(implementation = {vendor(llvm)}, device={kind(cpu)})
+ int method() { return 1; }
+#pragma omp declare variant(SpecialFuncs::method_) \
+ match(implementation = {vendor(llvm)}, device={kind(host)})
+ int Method();
+} s;
+
+int SpecialFuncs::Method() { return 1; }
+
+struct SpecSpecialFuncs {
+ void vd() {}
+ SpecSpecialFuncs();
+ ~SpecSpecialFuncs();
+
+ int method_();
+#pragma omp declare variant(SpecSpecialFuncs::method_) \
+ match(implementation = {vendor(llvm)}, device={kind(cpu)})
+ int method() { return 1; }
+#pragma omp declare variant(SpecSpecialFuncs::method_) \
+ match(implementation = {vendor(llvm)}, device={kind(host)})
+ int Method();
+} s1;
+
+int SpecSpecialFuncs::method_() { return 7; }
+int SpecSpecialFuncs::Method() { return 1; }
+
+void xxx() {
+ (void)s.method();
+ (void)s1.method();
+}
+
+int prio() { return 81; }
+int prio1() { return 82; }
+
+#pragma omp declare variant(prio) match(implementation = {vendor(score(2): llvm)}, device={kind(cpu,host)})
+#pragma omp declare variant(prio1) match(implementation = {vendor(score(1): llvm)}, device={kind(cpu)})
+int prio_() { return 1; }
+
+static int prio2() { return 83; }
+static int prio3() { return 84; }
+static int prio4() { return 84; }
+
+#pragma omp declare variant(prio4) match(implementation = {vendor(score(8): llvm)},device={kind(cpu,host)})
+#pragma omp declare variant(prio2) match(implementation = {vendor(score(5): llvm)})
+#pragma omp declare variant(prio3) match(implementation = {vendor(score(7): llvm)}, device={kind(cpu)})
+static int prio1_() { return 1; }
+
+int int_fn() { return prio1_(); }
+
+int fn_linkage_variant() { return 85; }
+extern "C" {
+#pragma omp declare variant(fn_linkage_variant) match(implementation = {vendor(llvm)}, device={kind(cpu)})
+int fn_linkage() { return 1; }
+}
+
+extern "C" int fn_linkage_variant1() { return 86; }
+#pragma omp declare variant(fn_linkage_variant1) match(implementation = {vendor(llvm)}, device={kind(host)})
+int fn_linkage1() { return 1; }
+
+int fn_variant2() { return 1; }
+#pragma omp declare variant(fn_variant2) match(implementation = {vendor(llvm, ibm)}, device={kind(cpu)})
+#pragma omp declare variant(fn_variant2) match(implementation = {vendor(llvm)}, device={kind(cpu,gpu)})
+#pragma omp declare variant(fn_variant2) match(implementation = {vendor(llvm)}, device={kind(nohost)})
+#pragma omp declare variant(fn_variant2) match(implementation = {vendor(llvm)}, device={kind(cpu,nohost)})
+#pragma omp declare variant(fn_variant2) match(implementation = {vendor(llvm)}, device={kind(gpu)})
+#pragma omp declare variant(fn_variant2) match(implementation = {vendor(llvm)}, device={kind(fpga)})
+int fn2() { return 87; }
+
+#pragma omp declare variant(stat_unused_no_emit) match(implementation = {vendor(xxx)}, device={kind(gpu)})
+template <typename T>
+static T stat_unused_T() { return 88; }
+
+int bazzzzzzzz() {
+ return stat_unused_T<int>();
+}
+
+#endif // HEADER
diff --git a/src/llvm-project/clang/test/OpenMP/distribute_ast_print.cpp b/src/llvm-project/clang/test/OpenMP/distribute_ast_print.cpp
index 560e2276..fb90505 100644
--- a/src/llvm-project/clang/test/OpenMP/distribute_ast_print.cpp
+++ b/src/llvm-project/clang/test/OpenMP/distribute_ast_print.cpp
@@ -1,10 +1,10 @@
-// RUN: %clang_cc1 -verify -fopenmp -ast-print %s -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -ast-print %s -Wno-openmp-mapping | 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 -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s -Wno-openmp-mapping | FileCheck %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -fopenmp-simd -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s
// expected-no-diagnostics
#ifndef HEADER
diff --git a/src/llvm-project/clang/test/OpenMP/distribute_codegen.cpp b/src/llvm-project/clang/test/OpenMP/distribute_codegen.cpp
index 9641b8a..e3b65ca 100644
--- a/src/llvm-project/clang/test/OpenMP/distribute_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/distribute_codegen.cpp
@@ -5,6 +5,13 @@
// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32 --check-prefix HCHECK
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32 --check-prefix HCHECK
+// Test host codegen.
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64 --check-prefix HCHECK
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32 --check-prefix HCHECK
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32 --check-prefix HCHECK
// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
@@ -14,6 +21,14 @@
// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
+
// Test target codegen - host bc file has to be created first. (no significant differences with host version of target region)
// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm-bc %s -o %t-ppc-host.bc
// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck %s
diff --git a/src/llvm-project/clang/test/OpenMP/distribute_firstprivate_codegen.cpp b/src/llvm-project/clang/test/OpenMP/distribute_firstprivate_codegen.cpp
index 245d8a5..9aac97d 100644
--- a/src/llvm-project/clang/test/OpenMP/distribute_firstprivate_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/distribute_firstprivate_codegen.cpp
@@ -1,31 +1,31 @@
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
+// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
-// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
// SIMD-ONLY1-NOT: {{__kmpc|__tgt}}
// expected-no-diagnostics
#ifndef HEADER
diff --git a/src/llvm-project/clang/test/OpenMP/distribute_firstprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/distribute_firstprivate_messages.cpp
index c13f142..346d1a8 100644
--- a/src/llvm-project/clang/test/OpenMP/distribute_firstprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/distribute_firstprivate_messages.cpp
@@ -95,7 +95,7 @@
for (i = 0; i < argc; ++i) foo();
#pragma omp target
#pragma omp teams
- #pragma omp distribute firstprivate (a, b, c, d, f) // expected-error {{firstprivate variable with incomplete type 'S1'}} expected-warning {{Non-trivial type 'const S2' is mapped, only trivial types are guaranteed to be mapped correctly}} expected-warning {{Non-trivial type 'const S3' is mapped, only trivial types are guaranteed to be mapped correctly}} expected-error {{incomplete type 'S1' where a complete type is required}}
+ #pragma omp distribute firstprivate (a, b, c, d, f) // expected-error {{firstprivate variable with incomplete type 'S1'}} expected-warning {{Type 'const S2' is not trivially copyable and not guaranteed to be mapped correctly}} expected-warning {{Type 'const S3' is not trivially copyable and not guaranteed to be mapped correctly}} expected-error {{incomplete type 'S1' where a complete type is required}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target
#pragma omp teams
@@ -103,11 +103,11 @@
for (i = 0; i < argc; ++i) foo();
#pragma omp target
#pragma omp teams
- #pragma omp distribute firstprivate(ba) // expected-warning {{Non-trivial type 'const S2 [5]' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ #pragma omp distribute firstprivate(ba) // expected-warning {{Type 'const S2 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target
#pragma omp teams
- #pragma omp distribute firstprivate(ca) // expected-error {{no matching constructor for initialization of 'S3'}} expected-warning {{Non-trivial type 'const S3 [5]' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ #pragma omp distribute firstprivate(ca) // expected-error {{no matching constructor for initialization of 'S3'}} expected-warning {{Type 'const S3 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target
#pragma omp teams
diff --git a/src/llvm-project/clang/test/OpenMP/distribute_lastprivate_codegen.cpp b/src/llvm-project/clang/test/OpenMP/distribute_lastprivate_codegen.cpp
index 8d6ceb6..278e18e 100644
--- a/src/llvm-project/clang/test/OpenMP/distribute_lastprivate_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/distribute_lastprivate_codegen.cpp
@@ -1,31 +1,31 @@
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
+// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
-// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
// SIMD-ONLY1-NOT: {{__kmpc|__tgt}}
// expected-no-diagnostics
#ifndef HEADER
diff --git a/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_ast_print.cpp b/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_ast_print.cpp
index 3b32d08..e0442ba 100644
--- a/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_ast_print.cpp
+++ b/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_ast_print.cpp
@@ -1,10 +1,10 @@
-// RUN: %clang_cc1 -verify -std=c++11 -fopenmp -fopenmp-version=45 -ast-print %s -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -verify -std=c++11 -fopenmp -fopenmp-version=45 -ast-print %s -Wno-openmp-mapping | FileCheck %s
// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s
-// RUN: %clang_cc1 -verify -std=c++11 -fopenmp-simd -fopenmp-version=45 -ast-print %s -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -verify -std=c++11 -fopenmp-simd -fopenmp-version=45 -ast-print %s -Wno-openmp-mapping | FileCheck %s
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s
// expected-no-diagnostics
#ifndef HEADER
diff --git a/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_firstprivate_codegen.cpp b/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_firstprivate_codegen.cpp
index 9dc38b3..ed1b977 100644
--- a/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_firstprivate_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_firstprivate_codegen.cpp
@@ -1,30 +1,30 @@
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
+// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
-// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
// SIMD-ONLY1-NOT: {{__kmpc|__tgt}}
// expected-no-diagnostics
#ifndef HEADER
diff --git a/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_firstprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_firstprivate_messages.cpp
index d283c29..9d355cc 100644
--- a/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_firstprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_firstprivate_messages.cpp
@@ -8,6 +8,14 @@
bool foobool(int argc) {
return argc;
}
+
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp distribute parallel for firstprivate(fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
extern int omp_default_mem_alloc;
struct S1; // expected-note 2 {{declared here}} expected-note 2 {{forward declaration of 'S1'}}
@@ -111,7 +119,7 @@
++k;
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for firstprivate(a, b) // expected-error {{firstprivate variable with incomplete type 'S1'}} expected-warning {{Non-trivial type 'const S2' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute parallel for firstprivate(a, b) // expected-error {{firstprivate variable with incomplete type 'S1'}} expected-warning {{Type 'const S2' is not trivially copyable and not guaranteed to be mapped correctly}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp target
@@ -121,7 +129,7 @@
++k;
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for firstprivate(e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-warning {{Non-trivial type 'S4' is mapped, only trivial types are guaranteed to be mapped correctly}} expected-warning {{Non-trivial type 'S5' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute parallel for firstprivate(e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-warning {{Type 'S4' is not trivially copyable and not guaranteed to be mapped correctly}} expected-warning {{Type 'S5' is not trivially copyable and not guaranteed to be mapped correctly}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp target
@@ -233,7 +241,7 @@
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for firstprivate(a, b, c, d, f) // expected-error {{firstprivate variable with incomplete type 'S1'}} expected-error {{incomplete type 'S1' where a complete type is required}} expected-warning {{Non-trivial type 'const S2' is mapped, only trivial types are guaranteed to be mapped correctly}} expected-warning {{Non-trivial type 'const S3' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute parallel for firstprivate(a, b, c, d, f) // expected-error {{firstprivate variable with incomplete type 'S1'}} expected-error {{incomplete type 'S1' where a complete type is required}} expected-warning {{Type 'const S2' is not trivially copyable and not guaranteed to be mapped correctly}} expected-warning {{Type 'const S3' is not trivially copyable and not guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i)
foo();
#pragma omp target
@@ -248,12 +256,12 @@
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for firstprivate(ba) // expected-warning {{Non-trivial type 'const S2 [5]' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute parallel for firstprivate(ba) // expected-warning {{Type 'const S2 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i)
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for firstprivate(ca) // expected-warning {{Non-trivial type 'const S3 [5]' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute parallel for firstprivate(ca) // expected-warning {{Type 'const S3 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i)
foo();
#pragma omp target
@@ -284,12 +292,12 @@
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for firstprivate(e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-warning {{Non-trivial type 'S4' is mapped, only trivial types are guaranteed to be mapped correctly}} expected-warning {{Non-trivial type 'S5' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute parallel for firstprivate(e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-warning {{Type 'S4' is not trivially copyable and not guaranteed to be mapped correctly}} expected-warning {{Type 'S5' is not trivially copyable and not guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i)
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for firstprivate(m) // expected-warning {{Non-trivial type 'S3' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute parallel for firstprivate(m) // expected-warning {{Type 'S3' is not trivially copyable and not guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i)
foo();
#pragma omp target
@@ -321,13 +329,13 @@
// expected-error@+3 {{lastprivate variable cannot be firstprivate}} expected-note@+3 {{defined as lastprivate}}
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for lastprivate(g) firstprivate(g) // expected-warning {{Non-trivial type 'S5' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute parallel for lastprivate(g) firstprivate(g) // expected-warning {{Type 'S5' is not trivially copyable and not guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i)
foo();
// expected-error@+3 {{lastprivate variable cannot be firstprivate}} expected-note@+3 {{defined as lastprivate}}
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for lastprivate(n) firstprivate(n) // expected-error {{calling a private constructor of class 'S6'}} expected-warning {{Non-trivial type 'S6' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute parallel for lastprivate(n) firstprivate(n) // expected-error {{calling a private constructor of class 'S6'}} expected-warning {{Type 'S6' is not trivially copyable and not guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i)
foo();
#pragma omp parallel
diff --git a/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_lastprivate_codegen.cpp b/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_lastprivate_codegen.cpp
index 20b233f..087aef8 100644
--- a/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_lastprivate_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_lastprivate_codegen.cpp
@@ -1,31 +1,31 @@
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
+// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
-// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
// SIMD-ONLY1-NOT: {{__kmpc|__tgt}}
// expected-no-diagnostics
#ifndef HEADER
diff --git a/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_lastprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_lastprivate_messages.cpp
index b91f41e..6ff3ad9 100644
--- a/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_lastprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_lastprivate_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 %s -Wuninitialized
void foo() {
}
@@ -107,12 +109,17 @@
++k;
#pragma omp target
#pragma omp teams
+#pragma omp distribute parallel for lastprivate(conditional: argc) lastprivate(conditional: // expected-error 2 {{use of undeclared identifier 'conditional'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp target
+#pragma omp teams
#pragma omp distribute parallel for lastprivate(S1) // expected-error {{'S1' does not refer to a value}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for lastprivate(a, b) // expected-error {{lastprivate variable with incomplete type 'S1'}} expected-warning {{Non-trivial type 'const S2' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute parallel for lastprivate(a, b) // expected-error {{lastprivate variable with incomplete type 'S1'}} expected-warning {{Type 'const S2' is not trivially copyable and not guaranteed to be mapped correctly}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp target
@@ -122,7 +129,7 @@
++k;
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for lastprivate(e, g) // expected-error 2 {{calling a private constructor of class 'S4'}} expected-warning 2 {{Non-trivial type 'S4' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute parallel for lastprivate(e, g) // expected-error 2 {{calling a private constructor of class 'S4'}} expected-warning 2 {{Type 'S4' is not trivially copyable and not guaranteed to be mapped correctly}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp target
@@ -221,7 +228,7 @@
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for lastprivate(a, b, c, d, f) // expected-error {{lastprivate variable with incomplete type 'S1'}} expected-error 1 {{const-qualified variable without mutable fields cannot be lastprivate}} expected-error 2 {{const-qualified variable cannot be lastprivate}} expected-error {{incomplete type 'S1' where a complete type is required}} expected-warning {{Non-trivial type 'const S2' is mapped, only trivial types are guaranteed to be mapped correctly}} expected-warning {{Non-trivial type 'const S3' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute parallel for lastprivate(a, b, c, d, f) // expected-error {{lastprivate variable with incomplete type 'S1'}} expected-error 1 {{const-qualified variable without mutable fields cannot be lastprivate}} expected-error 2 {{const-qualified variable cannot be lastprivate}} expected-error {{incomplete type 'S1' where a complete type is required}} expected-warning {{Type 'const S2' is not trivially copyable and not guaranteed to be mapped correctly}} expected-warning {{Type 'const S3' is not trivially copyable and not guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i)
foo();
#pragma omp target
@@ -236,12 +243,12 @@
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for lastprivate(ba) // expected-warning {{Non-trivial type 'const S2 [5]' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute parallel for lastprivate(ba) // expected-warning {{Type 'const S2 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i)
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for lastprivate(ca) // expected-error {{const-qualified variable without mutable fields cannot be lastprivate}} expected-warning {{Non-trivial type 'const S3 [5]' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute parallel for lastprivate(ca) // expected-error {{const-qualified variable without mutable fields cannot be lastprivate}} expected-warning {{Type 'const S3 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i)
foo();
#pragma omp target
@@ -272,12 +279,12 @@
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for lastprivate(e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-warning {{Non-trivial type 'S4' is mapped, only trivial types are guaranteed to be mapped correctly}} expected-warning {{Non-trivial type 'S5' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute parallel for lastprivate(e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-warning {{Type 'S4' is not trivially copyable and not guaranteed to be mapped correctly}} expected-warning {{Type 'S5' is not trivially copyable and not guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i)
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for lastprivate(m) // expected-error {{'operator=' is a private member of 'S3'}} expected-warning {{Non-trivial type 'S3' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute parallel for lastprivate(m) // expected-error {{'operator=' is a private member of 'S3'}} expected-warning {{Type 'S3' is not trivially copyable and not guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i)
foo();
#pragma omp target
@@ -318,13 +325,13 @@
// expected-error@+3 {{firstprivate variable cannot be lastprivate}} expected-note@+3 {{defined as firstprivate}}
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for firstprivate(m) lastprivate(m) // expected-warning {{Non-trivial type 'S3' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute parallel for firstprivate(m) lastprivate(m) // expected-warning {{Type 'S3' is not trivially copyable and not guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i)
foo();
// expected-error@+3 {{lastprivate variable cannot be firstprivate}} expected-note@+3 {{defined as lastprivate}}
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for lastprivate(n) firstprivate(n) // expected-error {{calling a private constructor of class 'S6'}} expected-warning {{Non-trivial type 'S6' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute parallel for lastprivate(n) firstprivate(n) // expected-error {{calling a private constructor of class 'S6'}} expected-warning {{Type 'S6' is not trivially copyable and not guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i)
foo();
static int si;
diff --git a/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_private_messages.cpp b/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_private_messages.cpp
index 729a4a7..05c9dbb 100644
--- a/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_private_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_private_messages.cpp
@@ -50,7 +50,7 @@
#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for private(a) private(this->a) private(s.a) // expected-error {{expected variable name or data member of current class}}
- for (int k = 0; k < s.a; ++k) // expected-warning {{Non-trivial type 'S5' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (int k = 0; k < s.a; ++k) // expected-warning {{Type 'S5' is not trivially copyable and not guaranteed to be mapped correctly}}
++s.a;
return *this;
}
diff --git a/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_reduction_messages.cpp b/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_reduction_messages.cpp
index 75b4112..0bdacd01 100644
--- a/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_reduction_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_reduction_messages.cpp
@@ -7,6 +7,14 @@
// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
extern int omp_default_mem_alloc;
+
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp distribute parallel for reduction(+:fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
void foo() {
}
@@ -161,7 +169,7 @@
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}} expected-warning 2 {{Non-trivial type 'S2' is mapped, only trivial types are guaranteed to be mapped correctly}} expected-warning 2 {{Non-trivial type 'S3' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute parallel for reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}} expected-warning 2 {{Type 'S2' is not trivially copyable and not guaranteed to be mapped correctly}} expected-warning 2 {{Type 'S3' is not trivially copyable and not guaranteed to be mapped correctly}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp target
@@ -206,7 +214,7 @@
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for reduction(+ : h, k) // expected-error {{threadprivate or thread local variable cannot be reduction}} expected-warning 2 {{Non-trivial type 'S3' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute parallel for reduction(+ : h, k) // expected-error {{threadprivate or thread local variable cannot be reduction}} expected-warning 2 {{Type 'S3' is not trivially copyable and not guaranteed to be mapped correctly}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp target
@@ -345,12 +353,12 @@
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{const-qualified variable cannot be reduction}} expected-error {{'operator+' is a private member of 'S2'}} expected-error {{incomplete type 'S1' where a complete type is required}} expected-warning {{Non-trivial type 'S2' is mapped, only trivial types are guaranteed to be mapped correctly}} expected-warning {{Non-trivial type 'S3' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute parallel for reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{const-qualified variable cannot be reduction}} expected-error {{'operator+' is a private member of 'S2'}} expected-error {{incomplete type 'S1' where a complete type is required}} expected-warning {{Type 'S2' is not trivially copyable and not guaranteed to be mapped correctly}} expected-warning {{Type 'S3' is not trivially copyable and not guaranteed to be mapped correctly}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 2 {{const-qualified variable cannot be reduction}} expected-error {{incomplete type 'S1' where a complete type is required}} expected-warning {{Non-trivial type 'S2' is mapped, only trivial types are guaranteed to be mapped correctly}} expected-warning {{Non-trivial type 'S3' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute parallel for reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 2 {{const-qualified variable cannot be reduction}} expected-error {{incomplete type 'S1' where a complete type is required}} expected-warning {{Type 'S2' is not trivially copyable and not guaranteed to be mapped correctly}} expected-warning {{Type 'S3' is not trivially copyable and not guaranteed to be mapped correctly}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp target
@@ -360,12 +368,12 @@
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for reduction(+ : ba) // expected-error {{const-qualified variable cannot be reduction}} expected-warning {{Non-trivial type 'const S2 [5]' is mapped, only trivial types are guaranteed to be mapped correctl}}
+#pragma omp distribute parallel for reduction(+ : ba) // expected-error {{const-qualified variable cannot be reduction}} expected-warning {{Type 'const S2 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for reduction(* : ca) // expected-error {{const-qualified variable cannot be reduction}} expected-warning {{Non-trivial type 'const S3 [5]' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute parallel for reduction(* : ca) // expected-error {{const-qualified variable cannot be reduction}} expected-warning {{Type 'const S3 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp target
@@ -390,17 +398,17 @@
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{invalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} expected-warning {{Non-trivial type 'S4' is mapped, only trivial types are guaranteed to be mapped correctly}} expected-warning {{Non-trivial type 'S5' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute parallel for reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{invalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} expected-warning {{Type 'S4' is not trivially copyable and not guaranteed to be mapped correctly}} expected-warning {{Type 'S5' is not trivially copyable and not guaranteed to be mapped correctly}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}} expected-warning {{Non-trivial type 'S3' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute parallel for reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}} expected-warning {{Type 'S3' is not trivially copyable and not guaranteed to be mapped correctly}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for reduction(+ : o) // expected-error {{no viable overloaded '='}} expected-warning {{Non-trivial type 'class S6' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute parallel for reduction(+ : o) // expected-error {{no viable overloaded '='}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp target
@@ -411,12 +419,12 @@
#pragma omp parallel private(k)
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for reduction(+ : p), reduction(+ : p) // expected-error 2 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}} expected-warning {{Non-trivial type 'S3' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute parallel for reduction(+ : p), reduction(+ : p) // expected-error 2 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}} expected-warning {{Type 'S3' is not trivially copyable and not guaranteed to be mapped correctly}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for reduction(+ : p), reduction(+ : p) // expected-error {{variable can appear only once in OpenMP 'reduction' clause}} expected-note {{previously referenced here}} expected-warning {{Non-trivial type 'S3' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute parallel for reduction(+ : p), reduction(+ : p) // expected-error {{variable can appear only once in OpenMP 'reduction' clause}} expected-note {{previously referenced here}} expected-warning {{Type 'S3' is not trivially copyable and not guaranteed to be mapped correctly}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp target
diff --git a/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_shared_messages.cpp b/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_shared_messages.cpp
index d5a68f6..576d728 100644
--- a/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_shared_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_shared_messages.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wno-openmp-mapping -Wuninitialized
struct S1; // expected-note 2 {{declared here}}
diff --git a/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_aligned_messages.cpp b/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_aligned_messages.cpp
index 27f5f60..4a32eb3 100644
--- a/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_aligned_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_aligned_messages.cpp
@@ -287,7 +287,7 @@
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for simd aligned (a, b) // expected-error {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'S1'}} expected-error {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'S2'}} expected-error {{incomplete type 'S1' where a complete type is required}} expected-warning {{Non-trivial type 'const S2' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute parallel for simd aligned (a, b) // expected-error {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'S1'}} expected-error {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'S2'}} expected-error {{incomplete type 'S1' where a complete type is required}}
for (int k = 0; k < argc; ++k) ++k;
#pragma omp target
diff --git a/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_ast_print.cpp b/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_ast_print.cpp
index 137a746..79b29f4 100644
--- a/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_ast_print.cpp
+++ b/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_ast_print.cpp
@@ -1,10 +1,16 @@
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ast-print %s -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix OMP45
// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix OMP45
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -ast-print %s -Wno-openmp-mapping -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix OMP50
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -emit-pch -o %t %s -DOMP5
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix OMP50
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ast-print %s -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix OMP45
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix OMP45
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -ast-print %s -Wno-openmp-mapping -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix OMP50
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -emit-pch -o %t %s -DOMP5
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix OMP50
// expected-no-diagnostics
#ifndef HEADER
@@ -143,11 +149,16 @@
int i;
#pragma omp target
#pragma omp teams
+#ifdef OMP5
+#pragma omp distribute parallel for simd aligned(x:8) linear(i:2) safelen(8) simdlen(8) if(simd: argc) nontemporal(argc, c, d)
+#else
#pragma omp distribute parallel for simd aligned(x:8) linear(i:2) safelen(8) simdlen(8)
+#endif // OMP5
for (i = 0; i < 100; i++)
for (int j = 0; j < 200; j++)
a += h + x[j];
- // CHECK: #pragma omp distribute parallel for simd aligned(x: 8) linear(i: 2) safelen(8) simdlen(8)
+ // OMP45: #pragma omp distribute parallel for simd aligned(x: 8) linear(i: 2) safelen(8) simdlen(8)
+ // OMP50: #pragma omp distribute parallel for simd aligned(x: 8) linear(i: 2) safelen(8) simdlen(8) if(simd: argc) nontemporal(argc,c,d)
// CHECK-NEXT: for (i = 0; i < 100; i++)
// CHECK-NEXT: for (int j = 0; j < 200; j++)
// CHECK-NEXT: a += h + x[j];
diff --git a/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_firstprivate_codegen.cpp b/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_firstprivate_codegen.cpp
index 62e2c8c..8e96aa5 100644
--- a/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_firstprivate_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_firstprivate_codegen.cpp
@@ -1,30 +1,30 @@
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
+// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
-// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
// SIMD-ONLY1-NOT: {{__kmpc|__tgt}}
// expected-no-diagnostics
#ifndef HEADER
diff --git a/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_firstprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_firstprivate_messages.cpp
index 953cd20..247bc56 100644
--- a/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_firstprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_firstprivate_messages.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-mapping -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
@@ -10,6 +10,13 @@
return argc;
}
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp distribute parallel for simd firstprivate(fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
struct S1; // expected-note 2 {{declared here}} expected-note 2 {{forward declaration of 'S1'}}
extern S1 a;
class S2 {
diff --git a/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_if_codegen.cpp b/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_if_codegen.cpp
index 2beea79..dc8230d 100644
--- a/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_if_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_if_codegen.cpp
@@ -1,10 +1,16 @@
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck %s --check-prefix CHECK --check-prefix OMP45
// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple %itanium_abi_triple -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple %itanium_abi_triple -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple %itanium_abi_triple -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CHECK --check-prefix OMP45
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck %s --check-prefix CHECK --check-prefix OMP50
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple %itanium_abi_triple -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple %itanium_abi_triple -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CHECK --check-prefix OMP50
// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple %itanium_abi_triple -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple %itanium_abi_triple -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple %itanium_abi_triple -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple %itanium_abi_triple -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
// expected-no-diagnostics
#ifndef HEADER
@@ -143,7 +149,8 @@
// CHECK: define{{.+}} void [[OMP_TEAMS_OUTLINED_2]](
// CHECK: call void @__kmpc_for_static_init_4(
- // CHECK: call void {{.+}} @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{.+}} 2, {{.+}}* [[OMP_OUTLINED_4:@.+]] to void
+ // OMP45: call void {{.+}} @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{.+}} 2, {{.+}}* [[OMP_OUTLINED_4:@.+]] to void
+ // OMP50: call void {{.+}} @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{.+}} 3, {{.+}}* [[OMP_OUTLINED_4:@.+]] to void
// CHECK: call void @__kmpc_serialized_parallel(
// CHECK: call void [[OMP_OUTLINED_4:@.+]](
// CHECK: call void @__kmpc_end_serialized_parallel(
@@ -194,4 +201,9 @@
// CHECK: call {{.*}}void @{{.+}}fn3
// CHECK: call void @__kmpc_for_static_fini(
// CHECK: ret void
+
+// OMP45-NOT: !{!"llvm.loop.vectorize.enable", i1 false}
+// CHECK-DAG: !{!"llvm.loop.vectorize.enable", i1 true}
+// OMP50-DAG: !{!"llvm.loop.vectorize.enable", i1 false}
+// OMP45-NOT: !{!"llvm.loop.vectorize.enable", i1 false}
#endif
diff --git a/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_lastprivate_codegen.cpp b/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_lastprivate_codegen.cpp
index 516e9c0..9a36bbf 100644
--- a/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_lastprivate_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_lastprivate_codegen.cpp
@@ -1,31 +1,31 @@
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
+// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
-// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
// SIMD-ONLY1-NOT: {{__kmpc|__tgt}}
// expected-no-diagnostics
#ifndef HEADER
diff --git a/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_lastprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_lastprivate_messages.cpp
index 110e102..aeb2ded 100644
--- a/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_lastprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_lastprivate_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp -fopenmp-version=45 %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp -fopenmp-version=50 %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-simd -fopenmp-version=45 %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-simd -fopenmp-version=50 %s -Wno-openmp-mapping -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
@@ -108,6 +110,11 @@
++k;
#pragma omp target
#pragma omp teams
+#pragma omp distribute parallel for simd lastprivate(conditional: argc) lastprivate(conditional: // expected-error 2 {{use of undeclared identifier 'conditional'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp target
+#pragma omp teams
#pragma omp distribute parallel for simd lastprivate(S1) // expected-error {{'S1' does not refer to a value}}
for (int k = 0; k < argc; ++k)
++k;
@@ -298,8 +305,8 @@
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for simd lastprivate(i) // expected-note {{defined as lastprivate}}
- for (i = 0; i < argc; ++i) // expected-error{{loop iteration variable in the associated loop of 'omp distribute parallel for simd' directive may not be lastprivate, predetermined as linear}}
+#pragma omp distribute parallel for simd lastprivate(i) // omp45-note {{defined as lastprivate}}
+ for (i = 0; i < argc; ++i) // omp45-error {{loop iteration variable in the associated loop of 'omp distribute parallel for simd' directive may not be lastprivate, predetermined as linear}}
foo();
#pragma omp target
#pragma omp teams
diff --git a/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_linear_messages.cpp b/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_linear_messages.cpp
index e8521c0..53667c2 100644
--- a/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_linear_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_linear_messages.cpp
@@ -1,8 +1,16 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-mapping -Wuninitialized
extern int omp_default_mem_alloc;
+
+void xxx(int argc) {
+ int i;
+#pragma omp distribute parallel for simd linear(i)
+ for (i = 0; i < 10; ++i)
+ ;
+}
+
namespace X {
int x;
};
diff --git a/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_loop_messages.cpp b/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_loop_messages.cpp
index ef17dd4..c58c56b 100644
--- a/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_loop_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_loop_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wno-openmp-mapping -Wuninitialized
class S {
int a;
@@ -124,14 +126,14 @@
#pragma omp target
#pragma omp teams
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
#pragma omp distribute parallel for simd
for (int i = 0; i; i++)
c[i] = a[i];
#pragma omp target
#pragma omp teams
-// expected-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'i'}}
#pragma omp distribute parallel for simd
for (int i = 0; jj < kk; ii++)
@@ -139,21 +141,21 @@
#pragma omp target
#pragma omp teams
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
#pragma omp distribute parallel for simd
for (int i = 0; !!i; i++)
c[i] = a[i];
-// Ok
#pragma omp target
#pragma omp teams
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
#pragma omp distribute parallel for simd
for (int i = 0; i != 1; i++)
c[i] = a[i];
#pragma omp target
#pragma omp teams
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
#pragma omp distribute parallel for simd
for (int i = 0;; i++)
c[i] = a[i];
@@ -339,16 +341,16 @@
#pragma omp target
#pragma omp teams
-// expected-note@+2 {{defined as private}}
-// expected-error@+2 {{loop iteration variable in the associated loop of 'omp distribute parallel for simd' directive may not be private, predetermined as linear}}
+// omp4-note@+2 {{defined as private}}
+// omp4-error@+2 {{loop iteration variable in the associated loop of 'omp distribute parallel for simd' directive may not be private, predetermined as linear}}
#pragma omp distribute parallel for simd private(ii)
for (ii = 0; ii < 10; ii++)
c[ii] = a[ii];
#pragma omp target
#pragma omp teams
-// expected-note@+2 {{defined as lastprivate}}
-// expected-error@+2 {{loop iteration variable in the associated loop of 'omp distribute parallel for simd' directive may not be lastprivate, predetermined as linear}}
+// omp4-note@+2 {{defined as lastprivate}}
+// omp4-error@+2 {{loop iteration variable in the associated loop of 'omp distribute parallel for simd' directive may not be lastprivate, predetermined as linear}}
#pragma omp distribute parallel for simd lastprivate(ii)
for (ii = 0; ii < 10; ii++)
c[ii] = a[ii];
@@ -377,7 +379,7 @@
#pragma omp target
#pragma omp teams
-// expected-error@+2 {{statement after '#pragma omp distribute parallel for simd' must be a for loop}}
+// omp4-error@+2 {{statement after '#pragma omp distribute parallel for simd' must be a for loop}}
#pragma omp distribute parallel for simd
for (auto &item : a) {
item = item + 1;
@@ -543,19 +545,19 @@
++begin;
#pragma omp target
#pragma omp teams
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
#pragma omp distribute parallel for simd
for (GoodIter I = begin; I - I; ++I)
++I;
#pragma omp target
#pragma omp teams
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
#pragma omp distribute parallel for simd
for (GoodIter I = begin; begin < end; ++I)
++I;
#pragma omp target
#pragma omp teams
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
#pragma omp distribute parallel for simd
for (GoodIter I = begin; !I; ++I)
++I;
diff --git a/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_misc_messages.c b/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_misc_messages.c
index 1721da8..6b6c5d6 100644
--- a/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_misc_messages.c
+++ b/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_misc_messages.c
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=45 -verify=expected,omp45 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -verify=expected,omp50 %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=45 -verify=expected,omp45 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -verify=expected,omp50 %s -Wuninitialized
void xxx(int argc) {
int x; // expected-note {{initialize the variable 'x' to silence this warning}}
@@ -898,3 +900,87 @@
}
}
+void test_nontemporal() {
+ int i;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute parallel for simd'}} expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp distribute parallel for simd nontemporal(
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute parallel for simd'}} expected-error@+1 2 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp distribute parallel for simd nontemporal(,
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute parallel for simd'}} expected-error@+1 2 {{expected expression}}
+#pragma omp distribute parallel for simd nontemporal(, )
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute parallel for simd'}} expected-error@+1 {{expected expression}}
+#pragma omp distribute parallel for simd nontemporal()
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute parallel for simd'}} expected-error@+1 {{expected expression}}
+#pragma omp distribute parallel for simd nontemporal(int)
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute parallel for simd'}} omp50-error@+1 {{expected variable name}}
+#pragma omp distribute parallel for simd nontemporal(0)
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute parallel for simd'}} expected-error@+1 {{use of undeclared identifier 'x'}}
+#pragma omp distribute parallel for simd nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+// expected-error@+2 {{use of undeclared identifier 'x'}}
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute parallel for simd'}} expected-error@+1 {{use of undeclared identifier 'y'}}
+#pragma omp distribute parallel for simd nontemporal(x, y)
+ for (i = 0; i < 16; ++i)
+ ;
+// expected-error@+3 {{use of undeclared identifier 'x'}}
+// expected-error@+2 {{use of undeclared identifier 'y'}}
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute parallel for simd'}} expected-error@+1 {{use of undeclared identifier 'z'}}
+#pragma omp distribute parallel for simd nontemporal(x, y, z)
+ for (i = 0; i < 16; ++i)
+ ;
+
+ int x, y;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute parallel for simd'}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp distribute parallel for simd nontemporal(x :)
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute parallel for simd'}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}}
+#pragma omp distribute parallel for simd nontemporal(x :, )
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp50-note@+2 {{defined as nontemporal}}
+// omp45-error@+1 2 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute parallel for simd'}} omp50-error@+1 {{a variable cannot appear in more than one nontemporal clause}}
+#pragma omp distribute parallel for simd nontemporal(x) nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute parallel for simd'}}
+#pragma omp distribute parallel for simd private(x) nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute parallel for simd'}}
+#pragma omp distribute parallel for simd nontemporal(x) private(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute parallel for simd'}} expected-note@+1 {{to match this '('}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}} expected-error@+1 {{expected ')'}}
+#pragma omp distribute parallel for simd nontemporal(x, y : 0)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute parallel for simd'}}
+#pragma omp distribute parallel for simd nontemporal(x) lastprivate(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute parallel for simd'}}
+#pragma omp distribute parallel for simd lastprivate(x) nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+}
+
diff --git a/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_private_messages.cpp b/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_private_messages.cpp
index 615a45f..d279d2f 100644
--- a/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_private_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_private_messages.cpp
@@ -50,7 +50,7 @@
#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for simd private(a) private(this->a) private(s.a) // expected-error {{expected variable name or data member of current class}}
- for (int k = 0; k < s.a; ++k) // expected-warning {{Non-trivial type 'S5' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (int k = 0; k < s.a; ++k) // expected-warning {{Type 'S5' is not trivially copyable and not guaranteed to be mapped correctly}}
++s.a;
return *this;
}
diff --git a/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_reduction_messages.cpp b/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_reduction_messages.cpp
index 0b27fe2..0cab19c 100644
--- a/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_reduction_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_reduction_messages.cpp
@@ -1,12 +1,19 @@
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s -Wno-openmp-mapping -Wuninitialized
extern int omp_default_mem_alloc;
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp distribute parallel for simd reduction(+:fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
void foo() {
}
diff --git a/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_shared_messages.cpp b/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_shared_messages.cpp
index 8e21c07..a38f892 100644
--- a/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_shared_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/distribute_parallel_for_simd_shared_messages.cpp
@@ -117,7 +117,7 @@
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for simd shared (a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} expected-warning {{Non-trivial type 'const S2' is mapped, only trivial types are guaranteed to be mapped correctly}} expected-warning {{Non-trivial type 'const S3' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute parallel for simd shared (a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} expected-warning {{Type 'const S2' is not trivially copyable and not guaranteed to be mapped correctly}} expected-warning {{Type 'const S3' is not trivially copyable and not guaranteed to be mapped correctly}}
for(int k = 0 ; k < n ; k++) {
acc++;
}
@@ -131,14 +131,14 @@
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for simd shared(ba) // expected-warning {{Non-trivial type 'const S2 [5]' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute parallel for simd shared(ba) // expected-warning {{Type 'const S2 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
for(int k = 0 ; k < n ; k++) {
acc++;
}
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for simd shared(ca) // expected-warning {{Non-trivial type 'const S3 [5]' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute parallel for simd shared(ca) // expected-warning {{Type 'const S3 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
for(int k = 0 ; k < n ; k++) {
acc++;
}
@@ -152,7 +152,7 @@
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for simd shared(e, g) // expected-warning {{Non-trivial type 'S4' is mapped, only trivial types are guaranteed to be mapped correctly}} expected-warning {{Non-trivial type 'S5' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute parallel for simd shared(e, g) // expected-warning {{Type 'S4' is not trivially copyable and not guaranteed to be mapped correctly}} expected-warning {{Type 'S5' is not trivially copyable and not guaranteed to be mapped correctly}}
for(int k = 0 ; k < n ; k++) {
acc++;
}
@@ -291,7 +291,7 @@
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for simd shared (a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} expected-warning {{Non-trivial type 'const S2' is mapped, only trivial types are guaranteed to be mapped correctly}} expected-warning {{Non-trivial type 'const S3' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute parallel for simd shared (a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} expected-warning {{Type 'const S2' is not trivially copyable and not guaranteed to be mapped correctly}} expected-warning {{Type 'const S3' is not trivially copyable and not guaranteed to be mapped correctly}}
for(int k = 0 ; k < n ; k++) {
acc++;
}
@@ -305,14 +305,14 @@
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for simd shared(ba) // expected-warning {{Non-trivial type 'const S2 [5]' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute parallel for simd shared(ba) // expected-warning {{Type 'const S2 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
for(int k = 0 ; k < n ; k++) {
acc++;
}
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for simd shared(ca) // expected-warning {{Non-trivial type 'const S3 [5]' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute parallel for simd shared(ca) // expected-warning {{Type 'const S3 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
for(int k = 0 ; k < n ; k++) {
acc++;
}
@@ -326,7 +326,7 @@
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for simd shared(e, g) // expected-warning {{Non-trivial type 'S4' is mapped, only trivial types are guaranteed to be mapped correctly}} expected-warning {{Non-trivial type 'S5' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute parallel for simd shared(e, g) // expected-warning {{Type 'S4' is not trivially copyable and not guaranteed to be mapped correctly}} expected-warning {{Type 'S5' is not trivially copyable and not guaranteed to be mapped correctly}}
for(int k = 0 ; k < n ; k++) {
acc++;
}
diff --git a/src/llvm-project/clang/test/OpenMP/distribute_simd_aligned_messages.cpp b/src/llvm-project/clang/test/OpenMP/distribute_simd_aligned_messages.cpp
index 0febeed..6f7c04f 100644
--- a/src/llvm-project/clang/test/OpenMP/distribute_simd_aligned_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/distribute_simd_aligned_messages.cpp
@@ -287,7 +287,7 @@
#pragma omp target
#pragma omp teams
-#pragma omp distribute simd aligned (a, b) // expected-error {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'S1'}} expected-error {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'S2'}} expected-error {{incomplete type 'S1' where a complete type is required}} expected-warning {{Non-trivial type 'const S2' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute simd aligned (a, b) // expected-error {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'S1'}} expected-error {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'S2'}} expected-error {{incomplete type 'S1' where a complete type is required}}
for (int k = 0; k < argc; ++k) ++k;
#pragma omp target
diff --git a/src/llvm-project/clang/test/OpenMP/distribute_simd_ast_print.cpp b/src/llvm-project/clang/test/OpenMP/distribute_simd_ast_print.cpp
index 528f8da..28f8c51 100644
--- a/src/llvm-project/clang/test/OpenMP/distribute_simd_ast_print.cpp
+++ b/src/llvm-project/clang/test/OpenMP/distribute_simd_ast_print.cpp
@@ -1,10 +1,16 @@
-// RUN: %clang_cc1 -verify -fopenmp -ast-print %s -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45
// 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 -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -ast-print %s -Wno-openmp-mapping -DOMP5 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -emit-pch -o %t %s -DOMP5
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping -DOMP5 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50
-// RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -fopenmp-simd -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -ast-print %s -Wno-openmp-mapping -DOMP5 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -emit-pch -o %t %s -DOMP5
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping -DOMP5 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50
// expected-no-diagnostics
#ifndef HEADER
@@ -124,11 +130,16 @@
#pragma omp target
#pragma omp teams
+#ifdef OMP5
+#pragma omp distribute simd private(argc, b), firstprivate(argv, c), lastprivate(d, f) collapse(2) reduction(+ : h) dist_schedule(static, b) if(simd:argc)
+#else
#pragma omp distribute simd private(argc, b), firstprivate(argv, c), lastprivate(d, f) collapse(2) reduction(+ : h) dist_schedule(static, b)
+#endif // OMP5
for (int i = 0; i < 10; ++i)
for (int j = 0; j < 10; ++j)
a++;
-// CHECK: #pragma omp distribute simd private(argc,b) firstprivate(argv,c) lastprivate(d,f) collapse(2) reduction(+: h) dist_schedule(static, b)
+// OMP45: #pragma omp distribute simd private(argc,b) firstprivate(argv,c) lastprivate(d,f) collapse(2) reduction(+: h) dist_schedule(static, b)
+// OMP50: #pragma omp distribute simd private(argc,b) firstprivate(argv,c) lastprivate(d,f) collapse(2) reduction(+: h) dist_schedule(static, b) if(simd: argc)
// CHECK-NEXT: for (int i = 0; i < 10; ++i)
// CHECK-NEXT: for (int j = 0; j < 10; ++j)
// CHECK-NEXT: a++;
@@ -136,11 +147,16 @@
int i;
#pragma omp target
#pragma omp teams
+#ifdef OMP5
+#pragma omp distribute simd aligned(x:8) linear(i:2) safelen(8) simdlen(8) if(argc) nontemporal(argc, c, d)
+#else
#pragma omp distribute simd aligned(x:8) linear(i:2) safelen(8) simdlen(8)
+#endif // OMP5
for (i = 0; i < 100; i++)
for (int j = 0; j < 200; j++)
a += h + x[j];
-// CHECK: #pragma omp distribute simd aligned(x: 8) linear(i: 2) safelen(8) simdlen(8)
+// OMP45: #pragma omp distribute simd aligned(x: 8) linear(i: 2) safelen(8) simdlen(8)
+// OMP50: #pragma omp distribute simd aligned(x: 8) linear(i: 2) safelen(8) simdlen(8) if(argc) nontemporal(argc,c,d)
// CHECK-NEXT: for (i = 0; i < 100; i++)
// CHECK-NEXT: for (int j = 0; j < 200; j++)
// CHECK-NEXT: a += h + x[j];
diff --git a/src/llvm-project/clang/test/OpenMP/distribute_simd_codegen.cpp b/src/llvm-project/clang/test/OpenMP/distribute_simd_codegen.cpp
index 55e24c0..104b1ba 100644
--- a/src/llvm-project/clang/test/OpenMP/distribute_simd_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/distribute_simd_codegen.cpp
@@ -1,10 +1,16 @@
// Test host codegen.
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64 --check-prefix OMP45
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64 --check-prefix HCHECK
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32 --check-prefix HCHECK
+// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64 --check-prefix HCHECK --check-prefix OMP45
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32 --check-prefix HCHECK --check-prefix OMP45
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32 --check-prefix HCHECK
+// RUN: %clang_cc1 -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32 --check-prefix HCHECK --check-prefix OMP45
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64 --check-prefix OMP50
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -DOMP5
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64 --check-prefix HCHECK --check-prefix OMP50
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -DOMP5| FileCheck %s --check-prefix CHECK --check-prefix CHECK-32 --check-prefix HCHECK --check-prefix OMP50
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -DOMP5
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32 --check-prefix HCHECK --check-prefix OMP50
// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
@@ -12,17 +18,31 @@
// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -DOMP5 | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -DOMP5
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -DOMP5 | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -DOMP5 | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -DOMP5
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -DOMP5 | FileCheck --check-prefix SIMD-ONLY0 %s
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
// Test target codegen - host bc file has to be created first. (no significant differences with host version of target region)
// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm-bc %s -o %t-ppc-host.bc
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck %s --check-prefix CHECK --check-prefix OMP45
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o %t %s
-// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CHECK --check-prefix OMP45
// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm-bc %s -o %t-x86-host.bc
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o - | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o - | FileCheck %s --check-prefix CHECK --check-prefix OMP45
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o %t %s
-// RUN: %clang_cc1 -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CHECK --check-prefix OMP45
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm-bc %s -o %t-ppc-host.bc -DOMP5
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix OMP50
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o %t %s -DOMP5
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -include-pch %t -verify %s -emit-llvm -o - -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix OMP50
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm-bc %s -o %t-x86-host.bc -DOMP5
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o - -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix OMP50
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o %t %s -DOMP5
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -include-pch %t -verify %s -emit-llvm -o - -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix OMP50
// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm-bc %s -o %t-ppc-host.bc
// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck --check-prefix SIMD-ONLY1 %s
@@ -32,6 +52,14 @@
// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o - | FileCheck --check-prefix SIMD-ONLY1 %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o %t %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm-bc %s -o %t-ppc-host.bc -DOMP5
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - -DOMP5 | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o %t %s -DOMP5
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -include-pch %t -verify %s -emit-llvm -o - -DOMP5 | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm-bc %s -o %t-x86-host.bc -DOMP5
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o - -DOMP5 | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o %t %s -DOMP5
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -include-pch %t -verify %s -emit-llvm -o - -DOMP5 | FileCheck --check-prefix SIMD-ONLY1 %s
// SIMD-ONLY1-NOT: {{__kmpc|__tgt}}
// expected-no-diagnostics
@@ -47,7 +75,11 @@
void without_schedule_clause(float *a, float *b, float *c, float *d) {
#pragma omp target
#pragma omp teams
+#ifdef OMP5
+ #pragma omp distribute simd simdlen(8) aligned(a) if(true)
+#else
#pragma omp distribute simd simdlen(8) aligned(a)
+#endif // OMP5
for (int i = 33; i < 32000000; i += 7) {
a[i] = b[i] * c[i] * d[i];
}
@@ -110,7 +142,11 @@
void static_not_chunked(float *a, float *b, float *c, float *d) {
#pragma omp target
#pragma omp teams
+#ifdef OMP5
+ #pragma omp distribute simd dist_schedule(static) safelen(32) if(simd: true) nontemporal(a, b)
+#else
#pragma omp distribute simd dist_schedule(static) safelen(32)
+#endif // OMP5
for (int i = 32000000; i > 33; i += -7) {
a[i] = b[i] * c[i] * d[i];
}
@@ -153,6 +189,11 @@
// CHECK: [[BBINNBODY]]:
// CHECK: {{.+}} = load i32, i32* [[IV]]
// ... loop body ...
+// OMP45-NOT: !nontemporal
+// OMP50: load float*,{{.*}}!nontemporal
+// OMP50: load float*,{{.*}}!nontemporal
+// OMP50-NOT: !nontemporal
+
// CHECK: br label %[[BBBODYCONT:.+]]
// CHECK: [[BBBODYCONT]]:
// CHECK: br label %[[BBINNINC:.+]]
@@ -234,7 +275,11 @@
char a = 0; char i;
#pragma omp target
#pragma omp teams
+#ifdef OMP5
+ #pragma omp distribute simd linear(i) if(a) nontemporal(i)
+#else
#pragma omp distribute simd linear(i)
+#endif // OMP5
for(i = a; i < 10; ++i);
}
@@ -253,6 +298,9 @@
// CHECK: br i1 [[ACMP]], label %[[PRECOND_THEN:.+]], label %[[PRECOND_END:.+]]
// CHECK: [[PRECOND_THEN]]
// CHECK: call void @__kmpc_for_static_init_4
+// OMP45-NOT: !nontemporal
+// OMP50: store i8 {{.*}}!nontemporal
+// OMP50-NOT: !nontemporal
// CHECK: call void @__kmpc_for_static_fini
// CHECK: [[PRECOND_END]]
@@ -282,6 +330,9 @@
#endif
-// CHECK: !{!"llvm.loop.vectorize.width", i32 8}
-// CHECK: !{!"llvm.loop.vectorize.enable", i1 true}
-// CHECK: !{!"llvm.loop.vectorize.width", i32 32}
+// OMP45-NOT: !{!"llvm.loop.vectorize.enable", i1 false}
+// CHECK-DAG: !{!"llvm.loop.vectorize.width", i32 8}
+// CHECK-DAG: !{!"llvm.loop.vectorize.enable", i1 true}
+// CHECK-DAG: !{!"llvm.loop.vectorize.width", i32 32}
+// OMP45-NOT: !{!"llvm.loop.vectorize.enable", i1 false}
+// OMP50-DAG: !{!"llvm.loop.vectorize.enable", i1 false}
diff --git a/src/llvm-project/clang/test/OpenMP/distribute_simd_firstprivate_codegen.cpp b/src/llvm-project/clang/test/OpenMP/distribute_simd_firstprivate_codegen.cpp
index 858a7b9..60557c1 100644
--- a/src/llvm-project/clang/test/OpenMP/distribute_simd_firstprivate_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/distribute_simd_firstprivate_codegen.cpp
@@ -1,31 +1,31 @@
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
+// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
-// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
// SIMD-ONLY1-NOT: {{__kmpc|__tgt}}
// expected-no-diagnostics
#ifndef HEADER
diff --git a/src/llvm-project/clang/test/OpenMP/distribute_simd_firstprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/distribute_simd_firstprivate_messages.cpp
index 0e00f31..b88045b 100644
--- a/src/llvm-project/clang/test/OpenMP/distribute_simd_firstprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/distribute_simd_firstprivate_messages.cpp
@@ -111,7 +111,7 @@
++k;
#pragma omp target
#pragma omp teams
-#pragma omp distribute simd firstprivate(z, a, b) // expected-error {{firstprivate variable with incomplete type 'S1'}} expected-warning {{Non-trivial type 'const S2' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute simd firstprivate(z, a, b) // expected-error {{firstprivate variable with incomplete type 'S1'}} expected-warning {{Type 'const S2' is not trivially copyable and not guaranteed to be mapped correctly}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp target
@@ -121,7 +121,7 @@
++k;
#pragma omp target
#pragma omp teams
-#pragma omp distribute simd firstprivate(e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-warning {{Non-trivial type 'S4' is mapped, only trivial types are guaranteed to be mapped correctly}} expected-warning {{Non-trivial type 'S5' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute simd firstprivate(e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-warning {{Type 'S4' is not trivially copyable and not guaranteed to be mapped correctly}} expected-warning {{Type 'S5' is not trivially copyable and not guaranteed to be mapped correctly}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp target
@@ -233,7 +233,7 @@
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute simd firstprivate(a, b, c, d, f) // expected-error {{firstprivate variable with incomplete type 'S1'}} expected-error {{incomplete type 'S1' where a complete type is required}} expected-warning {{Non-trivial type 'const S2' is mapped, only trivial types are guaranteed to be mapped correctly}} expected-warning {{Non-trivial type 'const S3' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute simd firstprivate(a, b, c, d, f) // expected-error {{firstprivate variable with incomplete type 'S1'}} expected-error {{incomplete type 'S1' where a complete type is required}} expected-warning {{Type 'const S2' is not trivially copyable and not guaranteed to be mapped correctly}} expected-warning {{Type 'const S3' is not trivially copyable and not guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i)
foo();
#pragma omp target
@@ -248,12 +248,12 @@
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute simd firstprivate(ba) // expected-warning {{Non-trivial type 'const S2 [5]' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute simd firstprivate(ba) // expected-warning {{Type 'const S2 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i)
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute simd firstprivate(ca) // expected-warning {{Non-trivial type 'const S3 [5]' is mapped, only trivial types are guaranteed to be mapped correctl}}
+#pragma omp distribute simd firstprivate(ca) // expected-warning {{Type 'const S3 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i)
foo();
#pragma omp target
@@ -284,12 +284,12 @@
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute simd firstprivate(e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-warning {{Non-trivial type 'S4' is mapped, only trivial types are guaranteed to be mapped correctly}} expected-warning {{Non-trivial type 'S5' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute simd firstprivate(e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-warning {{Type 'S4' is not trivially copyable and not guaranteed to be mapped correctly}} expected-warning {{Type 'S5' is not trivially copyable and not guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i)
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute simd firstprivate(m) // expected-warning {{Non-trivial type 'S3' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute simd firstprivate(m) // expected-warning {{Type 'S3' is not trivially copyable and not guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i)
foo();
#pragma omp target
@@ -321,13 +321,13 @@
// expected-error@+3 {{lastprivate variable cannot be firstprivate}} expected-note@+3 {{defined as lastprivate}}
#pragma omp target
#pragma omp teams
-#pragma omp distribute simd lastprivate(g) firstprivate(g) //expected-warning {{Non-trivial type 'S5' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute simd lastprivate(g) firstprivate(g) //expected-warning {{Type 'S5' is not trivially copyable and not guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i)
foo();
// expected-error@+3 {{lastprivate variable cannot be firstprivate}} expected-note@+3 {{defined as lastprivate}}
#pragma omp target
#pragma omp teams
-#pragma omp distribute simd lastprivate(n) firstprivate(n) // expected-error {{calling a private constructor of class 'S6'}} expected-warning {{Non-trivial type 'S6' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute simd lastprivate(n) firstprivate(n) // expected-error {{calling a private constructor of class 'S6'}} expected-warning {{Type 'S6' is not trivially copyable and not guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i)
foo();
#pragma omp parallel
diff --git a/src/llvm-project/clang/test/OpenMP/distribute_simd_if_messages.cpp b/src/llvm-project/clang/test/OpenMP/distribute_simd_if_messages.cpp
new file mode 100644
index 0000000..1579fb6
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/distribute_simd_if_messages.cpp
@@ -0,0 +1,136 @@
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 %s -Wuninitialized
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+void xxx(int argc) {
+ int cond; // expected-note {{initialize the variable 'cond' to silence this warning}}
+#pragma omp teams
+#pragma omp distribute simd if(cond) // expected-warning {{variable 'cond' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
+struct S1; // expected-note {{declared here}}
+
+template <class T, class S> // expected-note {{declared here}}
+int tmain(T argc, S **argv) {
+ T z;
+ int i;
+ #pragma omp teams
+ #pragma omp distribute simd if // expected-error {{expected '(' after 'if'}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams
+ #pragma omp distribute simd if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams
+ #pragma omp distribute simd if () // expected-error {{expected expression}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams
+ #pragma omp distribute simd if (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams
+ #pragma omp distribute simd if (argc)) // expected-warning {{extra tokens at the end of '#pragma omp distribute simd' are ignored}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams
+ #pragma omp distribute simd if (argc > 0 ? argv[1] : argv[2])
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams
+ #pragma omp distribute simd if (foobool(argc)), if (true) // expected-error {{directive '#pragma omp distribute simd' cannot contain more than one 'if' clause}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams
+ #pragma omp distribute simd if (S) // expected-error {{'S' does not refer to a value}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams
+ #pragma omp distribute simd if (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams
+ #pragma omp distribute simd if (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams
+ #pragma omp distribute simd if(argc + z)
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams
+ #pragma omp distribute simd if(simd : // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams
+ #pragma omp distribute simd if(simd : argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams
+ #pragma omp distribute simd if(simd : argc)
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams
+ #pragma omp distribute simd if(target : argc) // expected-error {{directive name modifier 'target' is not allowed for '#pragma omp distribute simd'}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams
+ #pragma omp distribute simd if(simd : argc) if (simd :argc) // expected-error {{directive '#pragma omp distribute simd' cannot contain more than one 'if' clause with 'simd' name modifier}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams
+ #pragma omp distribute simd if(simd : argc) if (argc) // expected-note {{previous clause with directive name modifier specified here}} expected-error {{no more 'if' clause is allowed}}
+ for (i = 0; i < argc; ++i) foo();
+
+ return 0;
+}
+
+int main(int argc, char **argv) {
+ int i, z;
+ #pragma omp teams
+ #pragma omp distribute simd if // expected-error {{expected '(' after 'if'}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams
+ #pragma omp distribute simd if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams
+ #pragma omp distribute simd if () // expected-error {{expected expression}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams
+ #pragma omp distribute simd if (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams
+ #pragma omp distribute simd if (argc)) // expected-warning {{extra tokens at the end of '#pragma omp distribute simd' are ignored}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams
+ #pragma omp distribute simd if (argc > 0 ? argv[1] : argv[2])
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams
+ #pragma omp distribute simd if (foobool(argc)), if (true) // expected-error {{directive '#pragma omp distribute simd' cannot contain more than one 'if' clause}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams
+ #pragma omp distribute simd if (S1) // expected-error {{'S1' does not refer to a value}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams
+ #pragma omp distribute simd if (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams
+ #pragma omp distribute simd if (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams
+ #pragma omp distribute simd if (1 0) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams
+ #pragma omp distribute simd if(if(tmain(argc, argv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams
+ #pragma omp distribute simd if(simd : // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams
+ #pragma omp distribute simd if(simd : argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams
+ #pragma omp distribute simd if(simd : argc + z) if (for:argc) // expected-error {{directive name modifier 'for' is not allowed for '#pragma omp distribute simd'}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams
+ #pragma omp distribute simd if(simd : argc) if (simd :argc) // expected-error {{directive '#pragma omp distribute simd' cannot contain more than one 'if' clause with 'simd' name modifier}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams
+ #pragma omp distribute simd if(simd : argc) if (argc) // expected-note {{previous clause with directive name modifier specified here}} expected-error {{no more 'if' clause is allowed}}
+ for (i = 0; i < argc; ++i) foo();
+
+ return tmain(argc, argv);
+}
diff --git a/src/llvm-project/clang/test/OpenMP/distribute_simd_lastprivate_codegen.cpp b/src/llvm-project/clang/test/OpenMP/distribute_simd_lastprivate_codegen.cpp
index 6bc146f..264b0e1 100644
--- a/src/llvm-project/clang/test/OpenMP/distribute_simd_lastprivate_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/distribute_simd_lastprivate_codegen.cpp
@@ -1,31 +1,31 @@
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
+// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
-// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
// SIMD-ONLY1-NOT: {{__kmpc|__tgt}}
// expected-no-diagnostics
#ifndef HEADER
diff --git a/src/llvm-project/clang/test/OpenMP/distribute_simd_lastprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/distribute_simd_lastprivate_messages.cpp
index 50a1fc3..8929b88 100644
--- a/src/llvm-project/clang/test/OpenMP/distribute_simd_lastprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/distribute_simd_lastprivate_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
@@ -113,7 +115,12 @@
++k;
#pragma omp target
#pragma omp teams
-#pragma omp distribute simd lastprivate(a, b) // expected-error {{lastprivate variable with incomplete type 'S1'}} expected-warning {{Non-trivial type 'const S2' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute simd lastprivate(conditional: argc) lastprivate(conditional: // expected-error 2 {{use of undeclared identifier 'conditional'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp target
+#pragma omp teams
+#pragma omp distribute simd lastprivate(a, b) // expected-error {{lastprivate variable with incomplete type 'S1'}} expected-warning {{Type 'const S2' is not trivially copyable and not guaranteed to be mapped correctly}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp target
@@ -123,7 +130,7 @@
++k;
#pragma omp target
#pragma omp teams
-#pragma omp distribute simd lastprivate(e, g) // expected-error 2 {{calling a private constructor of class 'S4'}} expected-warning 2 {{Non-trivial type 'S4' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute simd lastprivate(e, g) // expected-error 2 {{calling a private constructor of class 'S4'}} expected-warning 2 {{Type 'S4' is not trivially copyable and not guaranteed to be mapped correctly}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp target
@@ -222,7 +229,7 @@
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute simd lastprivate(a, b, c, d, f) // expected-error {{lastprivate variable with incomplete type 'S1'}} expected-error 1 {{const-qualified variable without mutable fields cannot be lastprivate}} expected-error 2 {{const-qualified variable cannot be lastprivate}} expected-error {{incomplete type 'S1' where a complete type is required}} expected-warning {{Non-trivial type 'const S2' is mapped, only trivial types are guaranteed to be mapped correctly}} expected-warning {{Non-trivial type 'const S3' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute simd lastprivate(a, b, c, d, f) // expected-error {{lastprivate variable with incomplete type 'S1'}} expected-error 1 {{const-qualified variable without mutable fields cannot be lastprivate}} expected-error 2 {{const-qualified variable cannot be lastprivate}} expected-error {{incomplete type 'S1' where a complete type is required}} expected-warning {{Type 'const S2' is not trivially copyable and not guaranteed to be mapped correctly}} expected-warning {{Type 'const S3' is not trivially copyable and not guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i)
foo();
#pragma omp target
@@ -237,12 +244,12 @@
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute simd lastprivate(ba) // expected-warning {{Non-trivial type 'const S2 [5]' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute simd lastprivate(ba) // expected-warning {{Type 'const S2 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i)
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute simd lastprivate(ca) // expected-error {{const-qualified variable without mutable fields cannot be lastprivate}} expected-warning {{Non-trivial type 'const S3 [5]' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute simd lastprivate(ca) // expected-error {{const-qualified variable without mutable fields cannot be lastprivate}} expected-warning {{Type 'const S3 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i)
foo();
#pragma omp target
@@ -273,12 +280,12 @@
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute simd lastprivate(e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-warning {{Non-trivial type 'S4' is mapped, only trivial types are guaranteed to be mapped correctly}} expected-warning {{Non-trivial type 'S5' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute simd lastprivate(e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-warning {{Type 'S4' is not trivially copyable and not guaranteed to be mapped correctly}} expected-warning {{Type 'S5' is not trivially copyable and not guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i)
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute simd lastprivate(m) // expected-error {{'operator=' is a private member of 'S3'}} expected-warning {{Non-trivial type 'S3' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute simd lastprivate(m) // expected-error {{'operator=' is a private member of 'S3'}} expected-warning {{Type 'S3' is not trivially copyable and not guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i)
foo();
#pragma omp target
@@ -298,8 +305,8 @@
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute simd lastprivate(i) // expected-note {{defined as lastprivate}}
- for (i = 0; i < argc; ++i) // expected-error{{loop iteration variable in the associated loop of 'omp distribute simd' directive may not be lastprivate, predetermined as linear}}
+#pragma omp distribute simd lastprivate(i) // omp45-note {{defined as lastprivate}}
+ for (i = 0; i < argc; ++i) // omp45-error{{loop iteration variable in the associated loop of 'omp distribute simd' directive may not be lastprivate, predetermined as linear}}
foo();
#pragma omp target
#pragma omp teams
@@ -319,13 +326,13 @@
// expected-error@+3 {{firstprivate variable cannot be lastprivate}} expected-note@+3 {{defined as firstprivate}}
#pragma omp target
#pragma omp teams
-#pragma omp distribute simd firstprivate(m) lastprivate(m) // expected-warning {{Non-trivial type 'S3' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute simd firstprivate(m) lastprivate(m) // expected-warning {{Type 'S3' is not trivially copyable and not guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i)
foo();
// expected-error@+3 {{lastprivate variable cannot be firstprivate}} expected-note@+3 {{defined as lastprivate}}
#pragma omp target
#pragma omp teams
-#pragma omp distribute simd lastprivate(n) firstprivate(n) // expected-error {{calling a private constructor of class 'S6'}} expected-warning {{Non-trivial type 'S6' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute simd lastprivate(n) firstprivate(n) // expected-error {{calling a private constructor of class 'S6'}} expected-warning {{Type 'S6' is not trivially copyable and not guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i)
foo();
static int si;
diff --git a/src/llvm-project/clang/test/OpenMP/distribute_simd_linear_messages.cpp b/src/llvm-project/clang/test/OpenMP/distribute_simd_linear_messages.cpp
index 53bd4c0..0054738 100644
--- a/src/llvm-project/clang/test/OpenMP/distribute_simd_linear_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/distribute_simd_linear_messages.cpp
@@ -3,6 +3,14 @@
// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
+
+void xxx(int argc) {
+ int i;
+#pragma omp distribute simd linear(i)
+ for (i = 0; i < 10; ++i)
+ ;
+}
+
namespace X {
int x;
};
@@ -284,7 +292,7 @@
#pragma omp target
#pragma omp teams
-#pragma omp distribute simd linear (a, b) // expected-error {{linear variable with incomplete type 'S1'}} expected-error {{argument of a linear clause should be of integral or pointer type, not 'S2'}} expected-warning {{Non-trivial type 'const S2' is mapped, only trivial types are guaranteed to be mapped correctly}} expected-error {{incomplete type 'S1' where a complete type is required}}
+#pragma omp distribute simd linear (a, b) // expected-error {{linear variable with incomplete type 'S1'}} expected-error {{argument of a linear clause should be of integral or pointer type, not 'S2'}} expected-error {{incomplete type 'S1' where a complete type is required}}
for (int k = 0; k < argc; ++k) ++k;
#pragma omp target
@@ -294,7 +302,7 @@
#pragma omp target
#pragma omp teams
-#pragma omp distribute simd linear(e, g) // expected-error {{argument of a linear clause should be of integral or pointer type, not 'S4'}} expected-error {{argument of a linear clause should be of integral or pointer type, not 'S5'}} expected-warning {{Non-trivial type 'S4' is mapped, only trivial types are guaranteed to be mapped correctly}} expected-warning {{Non-trivial type 'S5' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute simd linear(e, g) // expected-error {{argument of a linear clause should be of integral or pointer type, not 'S4'}} expected-error {{argument of a linear clause should be of integral or pointer type, not 'S5'}}
for (int k = 0; k < argc; ++k) ++k;
#pragma omp target
diff --git a/src/llvm-project/clang/test/OpenMP/distribute_simd_loop_messages.cpp b/src/llvm-project/clang/test/OpenMP/distribute_simd_loop_messages.cpp
index ee57cd5..ff50109 100644
--- a/src/llvm-project/clang/test/OpenMP/distribute_simd_loop_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/distribute_simd_loop_messages.cpp
@@ -1,6 +1,24 @@
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wuninitialized
+
+class S5 {
+ int a;
+ S5() : a(0) {}
+
+public:
+ S5(int v) : a(v) {}
+ S5 &operator=(S5 &s) {
+#pragma omp target
+#pragma omp teams
+#pragma omp distribute simd
+ for (int k = 0; k < s.a; ++k) // expected-warning {{Type 'S5' is not trivially copyable and not guaranteed to be mapped correctly}}
+ ++s.a;
+ return *this;
+ }
+};
static int sii;
// expected-note@+1 {{defined as threadprivate or thread local}}
@@ -115,14 +133,14 @@
#pragma omp target
#pragma omp teams
- // expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+ // omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
#pragma omp distribute simd
for (int i = 0; i; i++)
c[i] = a[i];
#pragma omp target
#pragma omp teams
- // expected-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+ // omp4-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'i'}}
#pragma omp distribute simd
for (int i = 0; jj < kk; ii++)
@@ -130,21 +148,21 @@
#pragma omp target
#pragma omp teams
- // expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+ // omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
#pragma omp distribute simd
for (int i = 0; !!i; i++)
c[i] = a[i];
- // Ok
#pragma omp target
#pragma omp teams
+ // omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
#pragma omp distribute simd
for (int i = 0; i != 1; i++)
c[i] = a[i];
#pragma omp target
#pragma omp teams
- // expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+ // omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
#pragma omp distribute simd
for (int i = 0; ; i++)
c[i] = a[i];
@@ -316,8 +334,8 @@
#pragma omp target
#pragma omp teams
- // expected-note@+2 {{defined as private}}
- // expected-error@+2 {{loop iteration variable in the associated loop of 'omp distribute simd' directive may not be private, predetermined as linear}}
+ // omp4-note@+2 {{defined as private}}
+ // omp4-error@+2 {{loop iteration variable in the associated loop of 'omp distribute simd' directive may not be private, predetermined as linear}}
#pragma omp distribute simd private(ii)
for (ii = 0; ii < 10; ii++)
c[ii] = a[ii];
@@ -374,7 +392,7 @@
#pragma omp target
#pragma omp teams
- // expected-error@+2 {{statement after '#pragma omp distribute simd' must be a for loop}}
+ // omp4-error@+2 {{statement after '#pragma omp distribute simd' must be a for loop}}
#pragma omp distribute simd
for (auto &item : a) {
item = item + 1;
@@ -472,7 +490,7 @@
#pragma omp target
#pragma omp teams
#pragma omp distribute simd
- for (GoodIter I = begin; I < end; ++I) // expected-warning 2 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (GoodIter I = begin; I < end; ++I) // expected-warning 2 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
#pragma omp target
#pragma omp teams
@@ -483,41 +501,41 @@
#pragma omp target
#pragma omp teams
#pragma omp distribute simd
- for (GoodIter I = begin; I >= end; --I) // expected-warning 2 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (GoodIter I = begin; I >= end; --I) // expected-warning 2 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
#pragma omp target
#pragma omp teams
// expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
#pragma omp distribute simd
- for (GoodIter I(begin); I < end; ++I) // expected-warning 2 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (GoodIter I(begin); I < end; ++I) // expected-warning 2 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
#pragma omp target
#pragma omp teams
// expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
#pragma omp distribute simd
- for (GoodIter I(nullptr); I < end; ++I) // expected-warning {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (GoodIter I(nullptr); I < end; ++I) // expected-warning {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
#pragma omp target
#pragma omp teams
// expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
#pragma omp distribute simd
- for (GoodIter I(0); I < end; ++I) // expected-warning {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (GoodIter I(0); I < end; ++I) // expected-warning {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
#pragma omp target
#pragma omp teams
// expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
#pragma omp distribute simd
- for (GoodIter I(1,2); I < end; ++I) // expected-warning {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (GoodIter I(1,2); I < end; ++I) // expected-warning {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
#pragma omp target
#pragma omp teams
#pragma omp distribute simd
- for (begin = GoodIter(0); begin < end; ++begin) // expected-warning 2 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (begin = GoodIter(0); begin < end; ++begin) // expected-warning 2 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++begin;
#pragma omp target
#pragma omp teams
#pragma omp distribute simd
- for (begin = GoodIter(1,2); begin < end; ++begin) // expected-warning 2 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (begin = GoodIter(1,2); begin < end; ++begin) // expected-warning 2 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++begin;
#pragma omp target
#pragma omp teams
@@ -528,23 +546,23 @@
#pragma omp target
#pragma omp teams
#pragma omp distribute simd
- for (begin = end; begin < end; ++begin) // expected-warning 2 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (begin = end; begin < end; ++begin) // expected-warning 2 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++begin;
#pragma omp target
#pragma omp teams
- // expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+ // omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
#pragma omp distribute simd
for (GoodIter I = begin; I - I; ++I)
++I;
#pragma omp target
#pragma omp teams
- // expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+ // omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
#pragma omp distribute simd
for (GoodIter I = begin; begin < end; ++I)
++I;
#pragma omp target
#pragma omp teams
- // expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+ // omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
#pragma omp distribute simd
for (GoodIter I = begin; !I; ++I)
++I;
@@ -558,7 +576,7 @@
#pragma omp target
#pragma omp teams
#pragma omp distribute simd
- for (GoodIter I = begin; I >= end; I = I - 1) // expected-warning 2 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (GoodIter I = begin; I >= end; I = I - 1) // expected-warning 2 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
#pragma omp target
#pragma omp teams
@@ -582,7 +600,7 @@
#pragma omp target
#pragma omp teams
#pragma omp distribute simd
- for (Iter0 I = begin0; I < end0; ++I) // expected-warning 2 {{Non-trivial type 'Iter0' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (Iter0 I = begin0; I < end0; ++I) // expected-warning 2 {{Type 'Iter0' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
#pragma omp target
@@ -590,7 +608,7 @@
// Initializer is constructor without params.
// expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
#pragma omp distribute simd
- for (Iter0 I; I < end0; ++I) // expected-warning {{Non-trivial type 'Iter0' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (Iter0 I; I < end0; ++I) // expected-warning {{Type 'Iter0' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
Iter1 begin1, end1;
@@ -636,7 +654,7 @@
// expected-note@+3 {{loop step is expected to be positive due to this condition}}
// expected-error@+2 {{increment expression must cause 'I' to increase on each iteration of OpenMP for loop}}
#pragma omp distribute simd
- for (IT I = begin; I <= end; I += ST) { // expected-warning 2 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (IT I = begin; I <= end; I += ST) { // expected-warning 2 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
}
#pragma omp distribute simd
@@ -679,7 +697,7 @@
#pragma omp target
#pragma omp teams
#pragma omp distribute simd
- for (IT I = begin; I < end; I+=TC<int,ST>::step()) { // expected-warning 2 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (IT I = begin; I < end; I+=TC<int,ST>::step()) { // expected-warning 2 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
}
}
diff --git a/src/llvm-project/clang/test/OpenMP/distribute_simd_misc_messages.c b/src/llvm-project/clang/test/OpenMP/distribute_simd_misc_messages.c
index 4c82b7a..e5e9751 100644
--- a/src/llvm-project/clang/test/OpenMP/distribute_simd_misc_messages.c
+++ b/src/llvm-project/clang/test/OpenMP/distribute_simd_misc_messages.c
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=45 -verify=expected,omp45 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -verify=expected,omp50 %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=45 -verify=expected,omp45 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -verify=expected,omp50 %s -Wuninitialized
void xxx(int argc) {
int x; // expected-note {{initialize the variable 'x' to silence this warning}}
@@ -1032,3 +1034,87 @@
for (k = 0; k < argc; ++k) ++k;
}
+void test_nontemporal() {
+ int i;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute simd'}} expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp distribute simd nontemporal(
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute simd'}} expected-error@+1 2 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp distribute simd nontemporal(,
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute simd'}} expected-error@+1 2 {{expected expression}}
+#pragma omp distribute simd nontemporal(, )
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute simd'}} expected-error@+1 {{expected expression}}
+#pragma omp distribute simd nontemporal()
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute simd'}} expected-error@+1 {{expected expression}}
+#pragma omp distribute simd nontemporal(int)
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute simd'}} omp50-error@+1 {{expected variable name}}
+#pragma omp distribute simd nontemporal(0)
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute simd'}} expected-error@+1 {{use of undeclared identifier 'x'}}
+#pragma omp distribute simd nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+// expected-error@+2 {{use of undeclared identifier 'x'}}
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute simd'}} expected-error@+1 {{use of undeclared identifier 'y'}}
+#pragma omp distribute simd nontemporal(x, y)
+ for (i = 0; i < 16; ++i)
+ ;
+// expected-error@+3 {{use of undeclared identifier 'x'}}
+// expected-error@+2 {{use of undeclared identifier 'y'}}
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute simd'}} expected-error@+1 {{use of undeclared identifier 'z'}}
+#pragma omp distribute simd nontemporal(x, y, z)
+ for (i = 0; i < 16; ++i)
+ ;
+
+ int x, y;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute simd'}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp distribute simd nontemporal(x :)
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute simd'}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}}
+#pragma omp distribute simd nontemporal(x :, )
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp50-note@+2 {{defined as nontemporal}}
+// omp45-error@+1 2 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute simd'}} omp50-error@+1 {{a variable cannot appear in more than one nontemporal clause}}
+#pragma omp distribute simd nontemporal(x) nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute simd'}}
+#pragma omp distribute simd private(x) nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute simd'}}
+#pragma omp distribute simd nontemporal(x) private(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute simd'}} expected-note@+1 {{to match this '('}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}} expected-error@+1 {{expected ')'}}
+#pragma omp distribute simd nontemporal(x, y : 0)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute simd'}}
+#pragma omp distribute simd nontemporal(x) lastprivate(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute simd'}}
+#pragma omp distribute simd lastprivate(x) nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+}
+
diff --git a/src/llvm-project/clang/test/OpenMP/distribute_simd_private_messages.cpp b/src/llvm-project/clang/test/OpenMP/distribute_simd_private_messages.cpp
index 9556422..17ef7a0 100644
--- a/src/llvm-project/clang/test/OpenMP/distribute_simd_private_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/distribute_simd_private_messages.cpp
@@ -50,7 +50,7 @@
#pragma omp target
#pragma omp teams
#pragma omp distribute simd private(a) private(this->a) private(s.a) // expected-error {{expected variable name or data member of current class}}
- for (int k = 0; k < s.a; ++k) // expected-warning {{Non-trivial type 'S5' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (int k = 0; k < s.a; ++k) // expected-warning {{Type 'S5' is not trivially copyable and not guaranteed to be mapped correctly}}
++s.a;
return *this;
}
diff --git a/src/llvm-project/clang/test/OpenMP/distribute_simd_reduction_messages.cpp b/src/llvm-project/clang/test/OpenMP/distribute_simd_reduction_messages.cpp
index 4486877..b3a4565 100644
--- a/src/llvm-project/clang/test/OpenMP/distribute_simd_reduction_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/distribute_simd_reduction_messages.cpp
@@ -7,6 +7,13 @@
// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
extern int omp_default_mem_alloc;
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp distribute simd reduction(+:fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
void foo() {
}
@@ -162,7 +169,7 @@
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute simd reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}} expected-warning 2 {{Non-trivial type 'S2' is mapped, only trivial types are guaranteed to be mapped correctly}} expected-warning 2 {{Non-trivial type 'S3' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute simd reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}} expected-warning 2 {{Type 'S2' is not trivially copyable and not guaranteed to be mapped correctly}} expected-warning 2 {{Type 'S3' is not trivially copyable and not guaranteed to be mapped correctly}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp target
@@ -207,7 +214,7 @@
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute simd reduction(+ : h, k) // expected-error {{threadprivate or thread local variable cannot be reduction}} expected-warning 2 {{Non-trivial type 'S3' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute simd reduction(+ : h, k) // expected-error {{threadprivate or thread local variable cannot be reduction}} expected-warning 2 {{Type 'S3' is not trivially copyable and not guaranteed to be mapped correctly}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp target
@@ -346,12 +353,12 @@
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute simd reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{const-qualified variable cannot be reduction}} expected-error {{'operator+' is a private member of 'S2'}} expected-warning {{Non-trivial type 'S2' is mapped, only trivial types are guaranteed to be mapped correctly}} expected-warning {{Non-trivial type 'S3' is mapped, only trivial types are guaranteed to be mapped correctly}} expected-error {{incomplete type 'S1' where a complete type is required}}
+#pragma omp distribute simd reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{const-qualified variable cannot be reduction}} expected-error {{'operator+' is a private member of 'S2'}} expected-warning {{Type 'S2' is not trivially copyable and not guaranteed to be mapped correctly}} expected-warning {{Type 'S3' is not trivially copyable and not guaranteed to be mapped correctly}} expected-error {{incomplete type 'S1' where a complete type is required}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute simd reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 2 {{const-qualified variable cannot be reduction}} expected-warning {{Non-trivial type 'S2' is mapped, only trivial types are guaranteed to be mapped correctly}} expected-warning {{Non-trivial type 'S3' is mapped, only trivial types are guaranteed to be mapped correctly}} expected-error {{incomplete type 'S1' where a complete type is required}}
+#pragma omp distribute simd reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 2 {{const-qualified variable cannot be reduction}} expected-warning {{Type 'S2' is not trivially copyable and not guaranteed to be mapped correctly}} expected-warning {{Type 'S3' is not trivially copyable and not guaranteed to be mapped correctly}} expected-error {{incomplete type 'S1' where a complete type is required}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp target
@@ -361,12 +368,12 @@
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute simd reduction(+ : ba) // expected-error {{const-qualified variable cannot be reduction}} expected-warning {{Non-trivial type 'const S2 [5]' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute simd reduction(+ : ba) // expected-error {{const-qualified variable cannot be reduction}} expected-warning {{Type 'const S2 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute simd reduction(* : ca) // expected-error {{const-qualified variable cannot be reduction}} expected-warning {{Non-trivial type 'const S3 [5]' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute simd reduction(* : ca) // expected-error {{const-qualified variable cannot be reduction}} expected-warning {{Type 'const S3 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp target
@@ -391,17 +398,17 @@
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute simd reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{invalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} expected-warning {{Non-trivial type 'S4' is mapped, only trivial types are guaranteed to be mapped correctly}} expected-warning {{Non-trivial type 'S5' is mapped, only trivial types are guaranteed to be mapped correctly}}}
+#pragma omp distribute simd reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{invalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} expected-warning {{Type 'S4' is not trivially copyable and not guaranteed to be mapped correctly}} expected-warning {{Type 'S5' is not trivially copyable and not guaranteed to be mapped correctly}}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute simd reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}} expected-warning {{Non-trivial type 'S3' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute simd reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}} expected-warning {{Type 'S3' is not trivially copyable and not guaranteed to be mapped correctly}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute simd reduction(+ : o) // expected-error {{no viable overloaded '='}} expected-warning {{Non-trivial type 'class S6' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute simd reduction(+ : o) // expected-error {{no viable overloaded '='}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp target
@@ -410,7 +417,7 @@
for (int i = 0; i < 10; ++i)
foo();
#if __cplusplus < 201103L // < C++11
-// expected-warning@+5 {{Non-trivial type 'S3' is mapped, only trivial types are guaranteed to be mapped correctly}}
+// expected-warning@+5 {{Type 'S3' is not trivially copyable and not guaranteed to be mapped correctly}}
#endif
#pragma omp parallel private(k)
#pragma omp target
@@ -419,7 +426,7 @@
for (int i = 0; i < 10; ++i)
foo();
#if __cplusplus < 201103L // < C++11
-// expected-warning@+4 {{Non-trivial type 'S3' is mapped, only trivial types are guaranteed to be mapped correctly}}
+// expected-warning@+4 {{Type 'S3' is not trivially copyable and not guaranteed to be mapped correctly}}
#endif
#pragma omp target
#pragma omp teams
diff --git a/src/llvm-project/clang/test/OpenMP/driver.c b/src/llvm-project/clang/test/OpenMP/driver.c
index 4c8b1df..dad4479 100644
--- a/src/llvm-project/clang/test/OpenMP/driver.c
+++ b/src/llvm-project/clang/test/OpenMP/driver.c
@@ -15,9 +15,12 @@
// RUN: %clang %s -c -E -dM -fopenmp=libomp -fopenmp-version=1 | FileCheck --check-prefix=CHECK-DEFAULT-VERSION %s
// RUN: %clang %s -c -E -dM -fopenmp=libomp -fopenmp-version=0 | FileCheck --check-prefix=CHECK-DEFAULT-VERSION %s
// RUN: %clang %s -c -E -dM -fopenmp=libomp -fopenmp-version=100 | FileCheck --check-prefix=CHECK-DEFAULT-VERSION %s
-// RUN: %clang %s -c -E -dM -fopenmp=libomp -fopenmp-version=31 | FileCheck --check-prefix=CHECK-DEFAULT-VERSION %s
+// RUN: %clang %s -c -E -dM -fopenmp=libomp -fopenmp-version=45 | FileCheck --check-prefix=CHECK-DEFAULT-VERSION %s
-// CHECK-DEFAULT-VERSION: #define _OPENMP 201107
+// CHECK-DEFAULT-VERSION: #define _OPENMP 201511
+
+// RUN: %clang %s -c -E -dM -fopenmp=libomp -fopenmp-version=31 | FileCheck --check-prefix=CHECK-31-VERSION %s
+// CHECK-31-VERSION: #define _OPENMP 201107
// RUN: %clang %s -c -E -dM -fopenmp=libomp -fopenmp-version=40 | FileCheck --check-prefix=CHECK-40-VERSION %s
// CHECK-40-VERSION: #define _OPENMP 201307
@@ -28,6 +31,9 @@
// CHECK-45-VERSION: #define _OPENMP 201511
// CHECK-45-VERSION2: #define _OPENMP 201511
+// RUN: %clang %s -c -E -dM -fopenmp=libomp -fopenmp-version=50 | FileCheck --check-prefix=CHECK-50-VERSION %s
+// CHECK-50-VERSION: #define _OPENMP 201811
+
// RUN: %clang %s -c -E -dM -fopenmp-version=1 | FileCheck --check-prefix=CHECK-VERSION %s
// RUN: %clang %s -c -E -dM -fopenmp-version=31 | FileCheck --check-prefix=CHECK-VERSION %s
// RUN: %clang %s -c -E -dM -fopenmp-version=40 | FileCheck --check-prefix=CHECK-VERSION %s
diff --git a/src/llvm-project/clang/test/OpenMP/for_ast_print.cpp b/src/llvm-project/clang/test/OpenMP/for_ast_print.cpp
index cdbe9aa..f5b98c8 100644
--- a/src/llvm-project/clang/test/OpenMP/for_ast_print.cpp
+++ b/src/llvm-project/clang/test/OpenMP/for_ast_print.cpp
@@ -1,10 +1,10 @@
-// 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
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -ast-print %s | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s | FileCheck %s
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -ast-print %s | FileCheck %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s
// expected-no-diagnostics
#ifndef HEADER
@@ -103,6 +103,7 @@
template <class T, int N>
T tmain(T argc) {
T b = argc, c, d, e, f, g;
+ T arr[N];
static T a;
// CHECK: static T a;
#pragma omp for schedule(dynamic) linear(a) allocate(a)
@@ -113,20 +114,30 @@
// CHECK-NEXT: a = 2;
#pragma omp parallel
#pragma omp for allocate(argc) private(argc, b), firstprivate(c, d), lastprivate(d, f) collapse(N) schedule(static, N) ordered(N) nowait
- for (int i = 0; i < 2; ++i)
- for (int j = 0; j < 2; ++j)
+ for (auto &x : arr) {
+ int j, hhh = 0;
+ for (int i = 0; i < 2; ++i) {
+ int j, hhh = 0;
for (int j = 0; j < 2; ++j)
for (int j = 0; j < 2; ++j)
for (int j = 0; j < 2; ++j)
- for (int i = 0; i < 2; ++i)
- for (int j = 0; j < 2; ++j)
- for (int j = 0; j < 2; ++j)
- for (int j = 0; j < 2; ++j)
- for (int j = 0; j < 2; ++j)
- foo();
+ for (int j = 0; j < 2; ++j)
+ for (int i = 0; i < 2; ++i)
+ for (int j = 0; j < 2; ++j)
+ for (int j = 0; j < 2; ++j)
+ for (int j = 0; j < 2; ++j)
+ for (int j = 0; j < 2; ++j)
+ foo();
+ ++hhh;
+ }
+ ++hhh;
+ }
// CHECK-NEXT: #pragma omp parallel
// CHECK-NEXT: #pragma omp for allocate(argc) private(argc,b) firstprivate(c,d) lastprivate(d,f) collapse(N) schedule(static, N) ordered(N) nowait
- // CHECK-NEXT: for (int i = 0; i < 2; ++i)
+ // CHECK-NEXT: for (auto &x : arr) {
+ // CHECK-NEXT: int j, hhh = 0;
+ // CHECK-NEXT: for (int i = 0; i < 2; ++i) {
+ // CHECK-NEXT: int j, hhh = 0;
// CHECK-NEXT: for (int j = 0; j < 2; ++j)
// CHECK-NEXT: for (int j = 0; j < 2; ++j)
// CHECK-NEXT: for (int j = 0; j < 2; ++j)
@@ -137,12 +148,17 @@
// CHECK-NEXT: for (int j = 0; j < 2; ++j)
// CHECK-NEXT: for (int j = 0; j < 2; ++j)
// CHECK-NEXT: foo();
+ // CHECK-NEXT: ++hhh;
+ // CHECK-NEXT: }
+ // CHECK-NEXT: ++hhh;
+ // CHECK-NEXT: }
return T();
}
int main(int argc, char **argv) {
// CHECK: int main(int argc, char **argv) {
int b = argc, c, d, e, f, g;
+ float arr[20];
static int a;
// CHECK: static int a;
#pragma omp for schedule(guided, argc) reduction(+:argv[0][:1])
@@ -152,15 +168,17 @@
// CHECK-NEXT: for (int i = 0; i < 2; ++i)
// CHECK-NEXT: a = 2;
#pragma omp parallel
-#pragma omp for private(argc, b), firstprivate(argv, c), lastprivate(d, f) collapse(2) schedule(auto) ordered nowait linear(g:-1)
+#pragma omp for private(argc, b), firstprivate(argv, c), lastprivate(d, f) collapse(3) schedule(auto) ordered nowait linear(g:-1)
for (int i = 0; i < 10; ++i)
for (int j = 0; j < 10; ++j)
- foo();
+ for (auto x : arr)
+ foo(), (void)x;
// CHECK-NEXT: #pragma omp parallel
- // CHECK-NEXT: #pragma omp for private(argc,b) firstprivate(argv,c) lastprivate(d,f) collapse(2) schedule(auto) ordered nowait linear(g: -1)
+ // CHECK-NEXT: #pragma omp for private(argc,b) firstprivate(argv,c) lastprivate(d,f) collapse(3) schedule(auto) ordered nowait linear(g: -1)
// CHECK-NEXT: for (int i = 0; i < 10; ++i)
// CHECK-NEXT: for (int j = 0; j < 10; ++j)
- // CHECK-NEXT: foo();
+ // CHECK-NEXT: for (auto x : arr)
+ // CHECK-NEXT: foo() , (void)x;
char buf[9] = "01234567";
char *p, *q;
#pragma omp parallel
diff --git a/src/llvm-project/clang/test/OpenMP/for_codegen.cpp b/src/llvm-project/clang/test/OpenMP/for_codegen.cpp
index 47c5be9..a837a4a 100644
--- a/src/llvm-project/clang/test/OpenMP/for_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/for_codegen.cpp
@@ -1,10 +1,14 @@
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -fexceptions -fcxx-exceptions -o - -fsanitize-address-use-after-scope | FileCheck %s --check-prefix=CHECK --check-prefix=LIFETIME
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -fexceptions -fcxx-exceptions -o - -fsanitize-address-use-after-scope | FileCheck %s --check-prefix=CHECK --check-prefix=LIFETIME --check-prefix=OMP45
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t -fopenmp-version=50 %s
+// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -fopenmp-version=50 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP5
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45
// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp -fexceptions -fcxx-exceptions -debug-info-kind=line-tables-only -x c++ -emit-llvm %s -o - | FileCheck %s --check-prefix=TERM_DEBUG
// RUN: %clang_cc1 -main-file-name for_codegen.cpp %s -o - -emit-llvm -fprofile-instrument=clang -fprofile-instrument-path=for_codegen-test.profraw | FileCheck %s --check-prefix=PROF-INSTR-PATH
// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t -fopenmp-version=50 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -fopenmp-version=50 | FileCheck --check-prefix SIMD-ONLY0 %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp-simd -fexceptions -fcxx-exceptions -debug-info-kind=line-tables-only -x c++ -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
@@ -25,10 +29,159 @@
// CHECK-LABEL: loop_with_counter_collapse
void loop_with_counter_collapse() {
- // LIFETIME: call void @llvm.lifetime.end
- // LIFETIME: call void @llvm.lifetime.end
- // CHECK: call void @__kmpc_for_static_init_8(%struct.ident_t* @
- // CHECK: call void @__kmpc_for_static_fini(%struct.ident_t* @
+ // Captured initializations.
+ // CHECK: store i32 0, i32* [[I_TMP:%.+]],
+ // CHECK: [[VAL:%.+]] = load i32, i32* [[I_TMP]],
+ // CHECK: store i32 [[VAL]], i32* [[J_LB_MIN:%.+]],
+ // CHECK: store i32 3, i32* [[I_TMP]],
+ // CHECK: [[VAL:%.+]] = load i32, i32* [[I_TMP]],
+ // CHECK: store i32 [[VAL]], i32* [[J_LB_MAX:%.+]],
+ // CHECK: [[J_LB_MIN_VAL:%.+]] = load i32, i32* [[J_LB_MIN]],
+ // CHECK: [[J_LB_MAX_VAL:%.+]] = load i32, i32* [[J_LB_MAX]],
+ // CHECK: [[CMP:%.+]] = icmp slt i32 [[J_LB_MIN_VAL]], [[J_LB_MAX_VAL]]
+ // CHECK: [[BOOL:%.+]] = zext i1 [[CMP]] to i8
+ // CHECK: store i8 [[BOOL]], i8* [[J_LB_CMP:%.+]],
+ // CHECK: store i32 0, i32* [[I_TMP]],
+ // CHECK: [[VAL:%.+]] = load i32, i32* [[I_TMP]],
+ // CHECK: [[J_UB_MIN_VAL:%.+]] = add nsw i32 4, [[VAL]]
+ // CHECK: store i32 [[J_UB_MIN_VAL]], i32* [[J_UB_MIN:%.+]],
+ // CHECK: store i32 3, i32* [[I_TMP]],
+ // CHECK: [[VAL:%.+]] = load i32, i32* [[I_TMP]],
+ // CHECK: [[J_UB_MAX_VAL:%.+]] = add nsw i32 4, [[VAL]]
+ // CHECK: store i32 [[J_UB_MAX_VAL]], i32* [[J_UB_MAX:%.+]],
+ // CHECK: [[J_UB_MIN_VAL:%.+]] = load i32, i32* [[J_UB_MIN]],
+ // CHECK: [[J_UB_MAX_VAL:%.+]] = load i32, i32* [[J_UB_MAX]],
+ // CHECK: [[CMP:%.+]] = icmp sgt i32 [[J_UB_MIN_VAL]], [[J_UB_MAX_VAL]]
+ // CHECK: [[BOOL:%.+]] = zext i1 [[CMP]] to i8
+ // CHECK: store i8 [[BOOL]], i8* [[J_UB_CMP:%.+]],
+ // CHECK: [[J_UB_CMP_VAL:%.+]] = load i8, i8* [[J_UB_CMP]],
+ // CHECK: [[BOOL:%.+]] = trunc i8 [[J_UB_CMP_VAL]] to i1
+ // CHECK: br i1 [[BOOL]], label %[[TRUE:[^,]+]], label %[[FALSE:[^,]+]]
+ // CHECK: [[TRUE]]:
+ // CHECK: [[J_UB_MIN_VAL:%.+]] = load i32, i32* [[J_UB_MIN]],
+ // CHECK: br label %[[EXIT:[^,]+]]
+ // CHECK: [[FALSE]]:
+ // CHECK: [[J_UB_MAX_VAL:%.+]] = load i32, i32* [[J_UB_MAX]],
+ // CHECK: br label %[[EXIT]]
+ // CHECK: [[EXIT]]:
+ // CHECK: [[J_UB_VAL:%.+]] = phi i32 [ [[J_UB_MIN_VAL]], %[[TRUE]] ], [ [[J_UB_MAX_VAL]], %[[FALSE]] ]
+ // CHECK: store i32 [[J_UB_VAL]], i32* [[J_UB:%.+]],
+ // CHECK: [[J_LB_CMP_VAL:%.+]] = load i8, i8* [[J_LB_CMP]],
+ // CHECK: [[BOOL:%.+]] = trunc i8 [[J_LB_CMP_VAL]] to i1
+ // CHECK: br i1 [[BOOL]], label %[[TRUE:[^,]+]], label %[[FALSE:[^,]+]]
+ // CHECK: [[TRUE]]:
+ // CHECK: [[J_LB_MIN_VAL:%.+]] = load i32, i32* [[J_LB_MIN]],
+ // CHECK: br label %[[EXIT:[^,]+]]
+ // CHECK: [[FALSE]]:
+ // CHECK: [[J_LB_MAX_VAL:%.+]] = load i32, i32* [[J_LB_MAX]],
+ // CHECK: br label %[[EXIT]]
+ // CHECK: [[EXIT]]:
+ // CHECK: [[J_LB_VAL:%.+]] = phi i32 [ [[J_LB_MIN_VAL]], %[[TRUE]] ], [ [[J_LB_MAX_VAL]], %[[FALSE]] ]
+ // CHECK: store i32 [[J_LB_VAL]], i32* [[J_LB:%.+]],
+ // CHECK: [[J_UB_VAL:%.+]] = load i32, i32* [[J_UB]],
+ // CHECK: [[J_LB_VAL:%.+]] = load i32, i32* [[J_LB]],
+ // CHECK: [[SUB:%.+]] = sub nsw i32 [[J_UB_VAL]], [[J_LB_VAL]]
+ // CHECK: [[SUB_ST:%.+]] = sub nsw i32 [[SUB]], 1
+ // CHECK: [[ADD_ST:%.+]] = add nsw i32 [[SUB_ST]], 1
+ // CHECK: [[DIV_ST:%.+]] = sdiv i32 [[ADD_ST]], 1
+ // CHECK: [[CAST:%.+]] = sext i32 [[DIV_ST]] to i64
+ // CHECK: [[MUL:%.+]] = mul nsw i64 4, [[CAST]]
+ // CHECK: [[NUM_ITERS_VAL:%.+]] = sub nsw i64 [[MUL]], 1
+ // CHECK: store i64 [[NUM_ITERS_VAL]], i64* [[NUM_ITERS:%.+]],
+
+ // CHECK: store i64 0, i64* [[LB:%.+]],
+ // CHECK: [[NUM_ITERS_VAL:%.+]] = load i64, i64* [[NUM_ITERS]],
+ // CHECK: store i64 [[NUM_ITERS_VAL]], i64* [[UB:%.+]],
+ // CHECK: store i64 1, i64* [[STRIDE:%.+]],
+ // CHECK: store i32 0, i32* [[IS_LAST:%.+]],
+ // CHECK: call void @__kmpc_for_static_init_8(%struct.ident_t* @{{.+}}, i32 %{{.+}}, i32 34, i32* [[IS_LAST]], i64* [[LB]], i64* [[UB]], i64* [[STRIDE]], i64 1, i64 1)
+ // CHECK: [[UB_VAL:%.+]] = load i64, i64* [[UB]],
+ // CHECK: [[NUM_ITERS_VAL:%.+]] = load i64, i64* [[NUM_ITERS]],
+ // CHECK: [[CMP:%.+]] = icmp sgt i64 [[UB_VAL]], [[NUM_ITERS_VAL]]
+ // CHECK: br i1 [[CMP]], label %[[TRUE:[^,]+]], label %[[FALSE:[^,]+]]
+ // CHECK: [[TRUE]]:
+ // CHECK: [[NUM_ITERS_VAL:%.+]] = load i64, i64* [[NUM_ITERS]],
+ // CHECK: br label %[[DONE:[^,]+]]
+ // CHECK: [[FALSE]]:
+ // CHECK: [[UB_VAL:%.+]] = load i64, i64* [[UB]],
+ // CHECK: br label %[[DONE]]
+ // CHECK: [[DONE]]:
+ // CHECK: [[TOP:%.+]] = phi i64 [ [[NUM_ITERS_VAL]], %[[TRUE]] ], [ [[UB_VAL]], %[[FALSE]] ]
+ // CHECK: store i64 [[TOP]], i64* [[UB]],
+ // CHECK: [[LB_VAL:%.+]] = load i64, i64* [[LB]],
+ // CHECK: store i64 [[LB_VAL]], i64* [[IV:%.+]],
+ // CHECK: br label %[[COND:[^,]+]]
+ // CHECK: [[COND]]:
+ // CHECK: [[IV_VAL:%.+]] = load i64, i64* [[IV]],
+ // CHECK: [[UB_VAL:%.+]] = load i64, i64* [[UB]],
+ // CHECK: [[CMP:%.+]] = icmp sle i64 [[IV_VAL]], [[UB_VAL]]
+ // CHECK: br i1 [[CMP]], label %[[BODY:[^,]+]], label %[[CLEANUP:[^,]+]]
+ // LIFETIME: [[CLEANUP]]:
+ // LIFETIME: br label %[[CLEANUP:[^,]+]]
+ // CHECK: [[BODY]]:
+ // CHECK: [[IV_VAL:%.+]] = load i64, i64* [[IV]],
+ // CHECK: [[J_UB_VAL:%.+]] = load i32, i32* [[J_UB]],
+ // CHECK: [[J_LB_VAL:%.+]] = load i32, i32* [[J_LB]],
+ // CHECK: [[SUB:%.+]] = sub nsw i32 [[J_UB_VAL]], [[J_LB_VAL]]
+ // CHECK: [[SUB_ST:%.+]] = sub nsw i32 [[SUB]], 1
+ // CHECK: [[ADD_ST:%.+]] = add nsw i32 [[SUB_ST]], 1
+ // CHECK: [[DIV_ST:%.+]] = sdiv i32 [[ADD_ST]], 1
+ // CHECK: [[MUL:%.+]] = mul nsw i32 1, [[DIV_ST]]
+ // CHECK: [[CAST:%.+]] = sext i32 [[MUL]] to i64
+ // CHECK: [[DIV:%.+]] = sdiv i64 [[IV_VAL]], [[CAST]]
+ // CHECK: [[MUL:%.+]] = mul nsw i64 [[DIV]], 1
+ // CHECK: [[ADD:%.+]] = add nsw i64 0, [[MUL]]
+ // CHECK: [[CAST:%.+]] = trunc i64 [[ADD]] to i32
+ // CHECK: store i32 [[CAST]], i32* [[I_PRIV:%.+]],
+ // CHECK: [[I_VAL:%.+]] = load i32, i32* [[I_PRIV]],
+ // CHECK: [[CONV:%.+]] = sext i32 [[I_VAL]] to i64
+ // CHECK: [[IV_VAL:%.+]] = load i64, i64* [[IV]],
+ // CHECK: [[IV_VAL1:%.+]] = load i64, i64* [[IV]],
+ // CHECK: [[J_UB_VAL:%.+]] = load i32, i32* [[J_UB]],
+ // CHECK: [[J_LB_VAL:%.+]] = load i32, i32* [[J_LB]],
+ // CHECK: [[SUB:%.+]] = sub nsw i32 [[J_UB_VAL]], [[J_LB_VAL]]
+ // CHECK: [[SUB_ST:%.+]] = sub nsw i32 [[SUB]], 1
+ // CHECK: [[ADD_ST:%.+]] = add nsw i32 [[SUB_ST]], 1
+ // CHECK: [[DIV_ST:%.+]] = sdiv i32 [[ADD_ST]], 1
+ // CHECK: [[MUL:%.+]] = mul nsw i32 1, [[DIV_ST]]
+ // CHECK: [[CAST:%.+]] = sext i32 [[MUL]] to i64
+ // CHECK: [[DIV:%.+]] = sdiv i64 [[IV_VAL1]], [[CAST]]
+ // CHECK: [[J_UB_VAL:%.+]] = load i32, i32* [[J_UB]],
+ // CHECK: [[J_LB_VAL:%.+]] = load i32, i32* [[J_LB]],
+ // CHECK: [[SUB:%.+]] = sub nsw i32 [[J_UB_VAL]], [[J_LB_VAL]]
+ // CHECK: [[SUB_ST:%.+]] = sub nsw i32 [[SUB]], 1
+ // CHECK: [[ADD_ST:%.+]] = add nsw i32 [[SUB_ST]], 1
+ // CHECK: [[DIV_ST:%.+]] = sdiv i32 [[ADD_ST]], 1
+ // CHECK: [[MUL:%.+]] = mul nsw i32 1, [[DIV_ST]]
+ // CHECK: [[CAST:%.+]] = sext i32 [[MUL]] to i64
+ // CHECK: [[MUL:%.+]] = mul nsw i64 [[DIV]], [[CAST]]
+ // CHECK: [[SUB:%.+]] = sub nsw i64 [[IV_VAL]], [[MUL]]
+ // CHECK: [[MUL:%.+]] = mul nsw i64 [[SUB:%.+]], 1
+ // CHECK: [[ADD:%.+]] = add nsw i64 [[CONV]], [[MUL]]
+ // CHECK: [[CAST:%.+]] = trunc i64 [[ADD]] to i32
+ // CHECK: store i32 [[CAST]], i32* [[J_PRIV:%.+]],
+
+ // Check that the loop variable is not out of its boundaries.
+ // CHECK: [[J_VAL:%.+]] = load i32, i32* [[J_PRIV]],
+ // CHECK: [[I_VAL:%.+]] = load i32, i32* [[I_PRIV]],
+ // CHECK: [[J_COND:%.+]] = add nsw i32 4, [[I_VAL]]
+ // CHECK: [[CMP:%.+]] = icmp slt i32 [[J_VAL]], [[J_COND]]
+ // CHECK: br i1 [[CMP]], label %[[NEXT:[^,]+]], label %[[BODY_CONT:[^,]+]]
+ // CHECK: [[NEXT]]:
+
+ // Main body is empty.
+ // CHECK: br label %[[BODY_CONT]]
+ // CHECK: [[BODY_CONT]]:
+ // CHECK: br label %[[INC:[^,]+]]
+ // CHECK: [[INC]]:
+ // CHECK: [[IV_VAL:%.+]] = load i64, i64* [[IV]],
+ // CHECK: [[ADD:%.+]] = add nsw i64 [[IV_VAL]], 1
+ // CHECK: store i64 [[ADD]], i64* [[IV]],
+ // CHECK: br label %[[COND]]
+ // CHECK: [[CLEANUP]]:
+ // CHECK: br label %[[EXIT:[^,]+]]
+ // CHECK: [[EXIT]]:
+ // CHECK: call void @__kmpc_for_static_fini(%struct.ident_t* @{{.+}}, i32 %{{.+}})
// LIFETIME: call void @llvm.lifetime.end
// LIFETIME: call void @llvm.lifetime.end
// LIFETIME: call void @llvm.lifetime.end
@@ -40,7 +193,7 @@
// LIFETIME: call void @llvm.lifetime.end
#pragma omp for collapse(2)
for (int i = 0; i < 4; i++) {
- for (int j = i; j < 4; j++) {
+ for (int j = i; j < 4 + i; j++) {
}
}
}
@@ -232,7 +385,8 @@
void guided7(float *a, float *b, float *c, float *d) {
// CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num([[IDENT_T_TY]]* [[DEFAULT_LOC:[@%].+]])
#pragma omp for schedule(guided, 7)
-// CHECK: call void @__kmpc_dispatch_init_8u([[IDENT_T_TY]]* [[DEFAULT_LOC]], i32 [[GTID]], i32 36, i64 0, i64 16908287, i64 1, i64 7)
+// OMP45: call void @__kmpc_dispatch_init_8u([[IDENT_T_TY]]* [[DEFAULT_LOC]], i32 [[GTID]], i32 36, i64 0, i64 16908287, i64 1, i64 7)
+// OMP5: call void @__kmpc_dispatch_init_8u([[IDENT_T_TY]]* [[DEFAULT_LOC]], i32 [[GTID]], i32 1073741860, i64 0, i64 16908287, i64 1, i64 7)
//
// CHECK: [[HASWORK:%.+]] = call i32 @__kmpc_dispatch_next_8u([[IDENT_T_TY]]* [[DEFAULT_LOC]], i32 [[GTID]], i32* [[OMP_ISLAST:%[^,]+]], i64* [[OMP_LB:%[^,]+]], i64* [[OMP_UB:%[^,]+]], i64* [[OMP_ST:%[^,]+]])
// CHECK-NEXT: [[O_CMP:%.+]] = icmp ne i32 [[HASWORK]], 0
@@ -276,7 +430,8 @@
unsigned int y = 0;
// CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num([[IDENT_T_TY]]* [[DEFAULT_LOC:[@%].+]])
#pragma omp for schedule(auto) collapse(2)
-// CHECK: call void @__kmpc_dispatch_init_8([[IDENT_T_TY]]* [[DEFAULT_LOC]], i32 [[GTID]], i32 38, i64 0, i64 [[LAST_ITER:%[^,]+]], i64 1, i64 1)
+// OMP45: call void @__kmpc_dispatch_init_8([[IDENT_T_TY]]* [[DEFAULT_LOC]], i32 [[GTID]], i32 38, i64 0, i64 [[LAST_ITER:%[^,]+]], i64 1, i64 1)
+// OMP5: call void @__kmpc_dispatch_init_8([[IDENT_T_TY]]* [[DEFAULT_LOC]], i32 [[GTID]], i32 1073741862, i64 0, i64 [[LAST_ITER:%[^,]+]], i64 1, i64 1)
//
// CHECK: [[HASWORK:%.+]] = call i32 @__kmpc_dispatch_next_8([[IDENT_T_TY]]* [[DEFAULT_LOC]], i32 [[GTID]], i32* [[OMP_ISLAST:%[^,]+]], i64* [[OMP_LB:%[^,]+]], i64* [[OMP_UB:%[^,]+]], i64* [[OMP_ST:%[^,]+]])
// CHECK-NEXT: [[O_CMP:%.+]] = icmp ne i32 [[HASWORK]], 0
@@ -320,7 +475,8 @@
int x = 0;
// CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num([[IDENT_T_TY]]* [[DEFAULT_LOC:[@%].+]])
#pragma omp for collapse(2) schedule(runtime)
-// CHECK: call void @__kmpc_dispatch_init_4([[IDENT_T_TY]]* [[DEFAULT_LOC]], i32 [[GTID]], i32 37, i32 0, i32 199, i32 1, i32 1)
+// OMP45: call void @__kmpc_dispatch_init_4([[IDENT_T_TY]]* [[DEFAULT_LOC]], i32 [[GTID]], i32 37, i32 0, i32 199, i32 1, i32 1)
+// OMP5: call void @__kmpc_dispatch_init_4([[IDENT_T_TY]]* [[DEFAULT_LOC]], i32 [[GTID]], i32 1073741861, i32 0, i32 199, i32 1, i32 1)
//
// CHECK: [[HASWORK:%.+]] = call i32 @__kmpc_dispatch_next_4([[IDENT_T_TY]]* [[DEFAULT_LOC]], i32 [[GTID]], i32* [[OMP_ISLAST:%[^,]+]], i32* [[OMP_LB:%[^,]+]], i32* [[OMP_UB:%[^,]+]], i32* [[OMP_ST:%[^,]+]])
// CHECK-NEXT: [[O_CMP:%.+]] = icmp ne i32 [[HASWORK]], 0
@@ -449,13 +605,30 @@
// CHECK: [[I:%.+]] = alloca i8,
// CHECK: [[CNT:%.+]] = alloca i8*,
// CHECK: [[CNT_PRIV:%.+]] = alloca i8,
-// CHECK: call void @__kmpc_for_static_init_4(
+// CHECK: call void @__kmpc_for_static_init_8(
// CHECK-NOT: load i8, i8* [[CNT]],
// CHECK: call void @__kmpc_for_static_fini(
char i = 0;
char &cnt = i;
-#pragma omp for
+#pragma omp for collapse(2)
for (cnt = 0; cnt < 2; ++cnt)
+ for (int j = cnt; j < 4 + cnt; j++)
+ k = cnt;
+}
+
+// CHECK-LABEL: for_with_references_dep_cond
+void for_with_references_dep_cond() {
+// CHECK: [[I:%.+]] = alloca i8,
+// CHECK: [[CNT:%.+]] = alloca i8*,
+// CHECK: [[CNT_PRIV:%.+]] = alloca i8,
+// CHECK: call void @__kmpc_for_static_init_8(
+// CHECK-NOT: load i8, i8* [[CNT]],
+// CHECK: call void @__kmpc_for_static_fini(
+ char i = 0;
+ char &cnt = i;
+#pragma omp for collapse(2)
+ for (cnt = 0; cnt < 2; ++cnt)
+ for (int j = 0; j < 4 + cnt; j++)
k = cnt;
}
@@ -528,13 +701,14 @@
// CHECK: call void @__kmpc_for_static_fini(
void loop_with_stmt_expr() {
-#pragma omp for
+#pragma omp for collapse(2)
for (int i = __extension__({float b = 0;b; }); i < __extension__({double c = 1;c; }); i += __extension__({char d = 1; d; }))
+ for (int j = i; j < 4 + i; j++)
;
}
// CHECK-LABEL: loop_with_stmt_expr
// CHECK: call i32 @__kmpc_global_thread_num(
-// CHECK: call void @__kmpc_for_static_init_4(
+// CHECK: call void @__kmpc_for_static_init_8(
// CHECK: call void @__kmpc_for_static_fini(
@@ -558,4 +732,50 @@
int fint(void) { return ftemplate<int>(); }
+// Check for imperfectly loop nests codegen.
+#if _OPENMP == 201811
+void first();
+void last();
+void inner_f();
+void inner_l();
+void body_f();
+
+// OMP5-LABEL: imperfectly_nested_loop
+void imperfectly_nested_loop() {
+ // OMP5: call void @__kmpc_for_static_init_4(
+#pragma omp for collapse(3)
+ for (int i = 0; i < 10; ++i) {
+ {
+ int a, d;
+ // OMP5: invoke void @{{.+}}first{{.+}}()
+ first();
+ // OMP5: load i32
+ // OMP5: store i32
+ a = d;
+ for (int j = 0; j < 10; ++j) {
+ int a, d;
+ // OMP5: invoke void @{{.+}}inner_f{{.+}}()
+ inner_f();
+ // OMP5: load i32
+ // OMP5: store i32
+ a = d;
+ for (int k = 0; k < 10; ++k) {
+ int a, d;
+ // OMP5: invoke void @{{.+}}body_f{{.+}}()
+ body_f();
+ // OMP5: load i32
+ // OMP5: store i32
+ a = d;
+ }
+ // OMP5: invoke void @{{.+}}inner_l{{.+}}()
+ inner_l();
+ }
+ // OMP5: invoke void @{{.+}}last{{.+}}()
+ last();
+ }
+ }
+ // OMP5: call void @__kmpc_for_static_fini(
+}
+#endif
+
#endif // HEADER
diff --git a/src/llvm-project/clang/test/OpenMP/for_collapse_messages.cpp b/src/llvm-project/clang/test/OpenMP/for_collapse_messages.cpp
index ce65651..2316ca6b 100644
--- a/src/llvm-project/clang/test/OpenMP/for_collapse_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/for_collapse_messages.cpp
@@ -1,10 +1,16 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp -std=c++11 %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp -fopenmp-version=50 %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp -fopenmp-version=50 -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp -fopenmp-version=50 -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-simd -std=c++11 %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-simd -fopenmp-version=50 %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-simd -fopenmp-version=50 -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-simd -fopenmp-version=50 -std=c++11 %s -Wuninitialized
void foo() {
}
@@ -87,7 +93,7 @@
#endif
// expected-error@+2 2 {{directive '#pragma omp for' cannot contain more than one 'collapse' clause}}
// expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}}
- #pragma omp for collapse (foobool(argc)), collapse (true), collapse (-5)
+ #pragma omp for collapse (foobool(argc)), collapse (true), collapse (-5)
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#pragma omp for collapse (S1) // expected-error {{'S1' does not refer to a value}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
@@ -108,3 +114,39 @@
return tmain<int, char, 1, 0>(argc, argv);
}
+void imperfectlyNestedLoops() {
+#pragma omp for collapse(2) // expected-note {{as specified in 'collapse' clause}}
+ for (int i = 0; i < 10; ++i) { // expected-error {{expected 2 for loops after '#pragma omp for', but found only 1}}
+ for (int j = 0; j < 10; ++j)
+ ;
+ for (int j = 0; j < 10; ++j)
+ ;
+ }
+#pragma omp for collapse(2) // expected-note {{as specified in 'collapse' clause}}
+ for (int i = 0; i < 10; ++i) { // expected-error {{expected 2 for loops after '#pragma omp for', but found only 1}}
+ {
+ for (int j = 0; j < 10; ++j)
+ ;
+ for (int j = 0; j < 10; ++j)
+ ;
+ }
+ {
+ for (int j = 0; j < 10; ++j)
+ ;
+ for (int j = 0; j < 10; ++j)
+ ;
+ }
+ }
+#pragma omp for collapse(2) // omp45-note {{as specified in 'collapse' clause}}
+ for (int i = 0; i < 10; ++i) { // omp45-error {{expected 2 for loops after '#pragma omp for', but found only 1}}
+ int a, b, c;
+ for (int j = 0; j < 10; ++j)
+ ;
+ {
+ for (int j = 0; j < 10; ++j)
+ ;
+ for (int j = 0; j < 10; ++j)
+ ;
+ }
+ }
+}
diff --git a/src/llvm-project/clang/test/OpenMP/for_lastprivate_codegen.cpp b/src/llvm-project/clang/test/OpenMP/for_lastprivate_codegen.cpp
index b7c82c2..b310055 100644
--- a/src/llvm-project/clang/test/OpenMP/for_lastprivate_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/for_lastprivate_codegen.cpp
@@ -3,17 +3,33 @@
// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-apple-darwin10 -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=LAMBDA %s
// RUN: %clang_cc1 -verify -fopenmp -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=BLOCKS %s
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=OMP50
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple x86_64-apple-darwin10 -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s -check-prefix=CHECK -check-prefix=OMP50
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=LAMBDA %s
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=BLOCKS %s
// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple x86_64-apple-darwin10 -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple x86_64-apple-darwin10 -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
// expected-no-diagnostics
#ifndef HEADER
#define HEADER
+#ifdef OMP5
+#define CONDITIONAL conditional :
+#else
+#define CONDITIONAL
+#endif //OMP5
+
enum omp_allocator_handle_t {
omp_null_allocator = 0,
omp_default_mem_alloc = 1,
@@ -160,6 +176,10 @@
// CHECK-DAG: [[X:@.+]] = global double 0.0
// CHECK-DAG: [[F:@.+]] = global float 0.0
// CHECK-DAG: [[CNT:@.+]] = global i8 0
+// OMP50-DAG: [[IV_REF:@.+]] = {{.*}}common global i32 0
+// OMP50-DAG: [[LAST_IV_F:@.+]] = {{.*}}common global i32 0
+// OMP50-DAG: [[LAST_F:@.+]] = {{.*}}common global float 0.000000e+00,
+
template <typename T>
T tmain() {
S<T> test;
@@ -477,9 +497,10 @@
A::x++;
}
#pragma omp parallel
-#pragma omp for allocate(omp_const_mem_alloc :cnt) lastprivate(cnt)
+#pragma omp for allocate(omp_const_mem_alloc :cnt) lastprivate(cnt) lastprivate(CONDITIONAL f)
for (cnt = 0; cnt < 2; ++cnt) {
A::x++;
+ f = 0;
}
return tmain<int>();
#endif
@@ -653,11 +674,32 @@
// CHECK-NEXT: [[LB:%.+]] = load i32, i32* [[OMP_LB]]
// CHECK-NEXT: store i32 [[LB]], i32* [[OMP_IV:[^,]+]]
// <Skip loop body>
+// OMP50: [[LOCAL_IV_REF:%.+]] = call i8* @__kmpc_threadprivate_cached(%struct.ident_t* @{{.+}}, i32 [[GTID]], i8* bitcast (i32* [[IV_REF]] to i8*), i64 4, i8*** @{{.+}})
+// OMP50: [[BC:%.+]] = bitcast i8* [[LOCAL_IV_REF]] to i32*
+// OMP50: store i32 %{{.+}}, i32* [[BC]],
+// CHECK: store float 0.000000e+00, float* [[F_PRIV:%.+]],
+// OMP50: [[LOCAL_IV_REF:%.+]] = call i8* @__kmpc_threadprivate_cached(%struct.ident_t* @{{.+}}, i32 [[GTID]], i8* bitcast (i32* [[IV_REF]] to i8*), i64 4, i8*** @{{.+}})
+// OMP50: [[BC:%.+]] = bitcast i8* [[LOCAL_IV_REF]] to i32*
+// OMP50: [[IV:%.+]] = load i32, i32* [[BC]],
+// OMP50: call void @__kmpc_critical(%struct.ident_t* @{{.+}}, i32 [[GTID]], [8 x i32]* [[F_REGION:@.+]])
+// OMP50: [[LAST_IV:%.+]] = load i32, i32* [[LAST_IV_F]],
+// OMP50: [[CMP:%.+]] = icmp sle i32 [[LAST_IV]], [[IV]]
+// OMP50: br i1 [[CMP]], label %[[LP_THEN:.+]], label %[[LP_DONE:[^,]+]]
+
+// OMP50: [[LP_THEN]]:
+// OMP50: store i32 [[IV]], i32* [[LAST_IV_F]],
+// OMP50: [[F_VAL:%.+]] = load float, float* [[F_PRIV]],
+// OMP50: store float [[F_VAL]], float* [[LAST_F]],
+// OMP50: br label %[[LP_DONE]]
+
+// OMP50: [[LP_DONE]]:
+// OMP50: call void @__kmpc_end_critical(%struct.ident_t* @{{.+}}, i32 [[GTID]], [8 x i32]* [[F_REGION]])
// CHECK: call void @__kmpc_for_static_fini(%{{.+}}* @{{.+}}, i32 [[GTID]])
// Check for final copying of private values back to original vars.
// CHECK: [[IS_LAST_VAL:%.+]] = load i32, i32* [[IS_LAST_ADDR]],
// CHECK: [[IS_LAST_ITER:%.+]] = icmp ne i32 [[IS_LAST_VAL]], 0
+// OMP50-NEXT: call void @__kmpc_barrier(%{{.+}}* [[IMPLICIT_BARRIER_LOC]], i{{[0-9]+}} [[GTID]])
// CHECK: br i1 [[IS_LAST_ITER:%.+]], label %[[LAST_THEN:.+]], label %[[LAST_DONE:.+]]
// CHECK: [[LAST_THEN]]
@@ -666,6 +708,10 @@
// original cnt=private_cnt;
// CHECK: [[CNT_VAL:%.+]] = load i8, i8* [[CNT_PRIV]],
// CHECK: store i8 [[CNT_VAL]], i8* [[CNT]],
+// OMP50: [[F_VAL:%.+]] = load float, float* [[LAST_F]],
+// OMP50: store float [[F_VAL]], float* [[F_PRIV]],
+// CHECK: [[F_VAL:%.+]] = load float, float* [[F_PRIV]],
+// CHECK: store float [[F_VAL]], float* [[F]],
// CHECK-NEXT: br label %[[LAST_DONE]]
// CHECK: [[LAST_DONE]]
diff --git a/src/llvm-project/clang/test/OpenMP/for_lastprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/for_lastprivate_messages.cpp
index 919b40f..5ad8552 100644
--- a/src/llvm-project/clang/test/OpenMP/for_lastprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/for_lastprivate_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
@@ -55,7 +57,7 @@
};
class S6 {
int a;
- S6() : a(0) {}
+ S6() : a(0) {} // omp45-note 2 {{implicitly declared private here}}
public:
S6(const S6 &s6) : a(s6.a) {}
@@ -71,6 +73,7 @@
I g(5);
int i, k;
int &j = i;
+ S6 s(0); // omp50-note {{'s' defined here}}
#pragma omp parallel
#pragma omp for lastprivate // expected-error {{expected '(' after 'lastprivate'}}
for (int k = 0; k < argc; ++k)
@@ -104,6 +107,14 @@
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel
+#pragma omp for lastprivate(foo:argc) // omp50-error {{expected 'conditional' in OpenMP clause 'lastprivate'}} omp45-error {{expected ',' or ')' in 'lastprivate' clause}} omp45-error {{expected ')'}} omp45-error {{expected variable name}} omp45-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp for lastprivate(conditional: argc,s) lastprivate(conditional: // omp45-error 2 {{use of undeclared identifier 'conditional'}} omp50-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp45-error 2 {{calling a private constructor of class 'S6'}} omp50-error {{expected list item of scalar type in 'lastprivate' clause with 'conditional' modifier}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
#pragma omp for lastprivate(a, b) // expected-error {{lastprivate variable with incomplete type 'S1'}}
for (int k = 0; k < argc; ++k)
++k;
diff --git a/src/llvm-project/clang/test/OpenMP/for_linear_messages.cpp b/src/llvm-project/clang/test/OpenMP/for_linear_messages.cpp
index 3a54acb2..363bbdb 100644
--- a/src/llvm-project/clang/test/OpenMP/for_linear_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/for_linear_messages.cpp
@@ -3,6 +3,14 @@
// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
+
+void xxx(int argc) {
+ int i, lin, step; // expected-note {{initialize the variable 'lin' to silence this warning}} expected-note {{initialize the variable 'step' to silence this warning}}
+#pragma omp for linear(lin : step) // expected-warning {{variable 'lin' is uninitialized when used here}} expected-warning {{variable 'step' is uninitialized when used here}}
+ for (i = 0; i < 10; ++i)
+ ;
+}
+
namespace X {
int x;
};
diff --git a/src/llvm-project/clang/test/OpenMP/for_loop_messages.cpp b/src/llvm-project/clang/test/OpenMP/for_loop_messages.cpp
index f5f6d0b..73c69ed 100644
--- a/src/llvm-project/clang/test/OpenMP/for_loop_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/for_loop_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wuninitialized
class S {
int a;
@@ -113,32 +115,32 @@
c[ii] = a[ii];
#pragma omp parallel
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
#pragma omp for
for (int i = 0; i; i++)
c[i] = a[i];
#pragma omp parallel
-// expected-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'i'}}
#pragma omp for
for (int i = 0; jj < kk; ii++)
c[i] = a[i];
#pragma omp parallel
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
#pragma omp for
for (int i = 0; !!i; i++)
c[i] = a[i];
-// Ok
#pragma omp parallel
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
#pragma omp for
for (int i = 0; i != 1; i++)
c[i] = a[i];
#pragma omp parallel
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
#pragma omp for
for (int i = 0;; i++)
c[i] = a[i];
@@ -368,7 +370,7 @@
}
#pragma omp parallel
-// expected-error@+2 {{statement after '#pragma omp for' must be a for loop}}
+// omp4-error@+2 {{statement after '#pragma omp for' must be a for loop}}
#pragma omp for
for (auto &item : a) {
item = item + 1;
@@ -533,17 +535,17 @@
for (begin = end; begin < end; ++begin)
++begin;
#pragma omp parallel
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
#pragma omp for
for (GoodIter I = begin; I - I; ++I)
++I;
#pragma omp parallel
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
#pragma omp for
for (GoodIter I = begin; begin < end; ++I)
++I;
#pragma omp parallel
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
#pragma omp for
for (GoodIter I = begin; !I; ++I)
++I;
@@ -651,10 +653,9 @@
;
#pragma omp parallel
-// expected-error@+6 2 {{expected loop invariant expression or '<invariant1> * ii + <invariant2>' kind of expression}}
-// expected-error@+5 {{expected loop invariant expression or '<invariant1> * TC::ii + <invariant2>' kind of expression}}
// expected-error@+5 2 {{expected loop invariant expression or '<invariant1> * ii + <invariant2>' kind of expression}}
// expected-error@+4 {{expected loop invariant expression or '<invariant1> * TC::ii + <invariant2>' kind of expression}}
+// expected-error@+4 {{expected loop invariant expression or '<invariant1> * TC::ii + <invariant2>' kind of expression}}
#pragma omp for collapse(3)
for (ii = 10 + 25; ii < 1000; ii += 1)
for (iii = ii * 10 + 25; iii < ii / ii - 23; iii += 1)
diff --git a/src/llvm-project/clang/test/OpenMP/for_reduction_codegen.cpp b/src/llvm-project/clang/test/OpenMP/for_reduction_codegen.cpp
index 2e616db..d74b56b 100644
--- a/src/llvm-project/clang/test/OpenMP/for_reduction_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/for_reduction_codegen.cpp
@@ -465,7 +465,7 @@
// *(Type<n>-1*)lhs[<n>-1] = ReductionOperation<n>-1(*(Type<n>-1*)lhs[<n>-1],
// *(Type<n>-1*)rhs[<n>-1]);
// }
-// CHECK: define internal void [[REDUCTION_FUNC]](i8*, i8*)
+// CHECK: define internal void [[REDUCTION_FUNC]](i8* %0, i8* %1)
// t_var_lhs = (float*)lhs[0];
// CHECK: [[T_VAR_RHS_REF:%.+]] = getelementptr inbounds [4 x i8*], [4 x i8*]* [[RED_LIST_RHS:%.+]], i64 0, i64 0
// CHECK: [[T_VAR_RHS_VOID:%.+]] = load i8*, i8** [[T_VAR_RHS_REF]],
@@ -688,7 +688,7 @@
// *(Type<n>-1*)lhs[<n>-1] = ReductionOperation<n>-1(*(Type<n>-1*)lhs[<n>-1],
// *(Type<n>-1*)rhs[<n>-1]);
// }
-// CHECK: define internal void [[REDUCTION_FUNC]](i8*, i8*)
+// CHECK: define internal void [[REDUCTION_FUNC]](i8* %0, i8* %1)
// arr_rhs = (int*)rhs[0];
// CHECK: [[ARR_RHS_REF:%.+]] = getelementptr inbounds [4 x i8*], [4 x i8*]* [[RED_LIST_RHS:%.+]], i64 0, i64 0
// CHECK: [[ARR_RHS_VOID:%.+]] = load i8*, i8** [[ARR_RHS_REF]],
@@ -883,7 +883,7 @@
// *(Type<n>-1*)lhs[<n>-1] = ReductionOperation<n>-1(*(Type<n>-1*)lhs[<n>-1],
// *(Type<n>-1*)rhs[<n>-1]);
// }
-// CHECK: define internal void [[REDUCTION_FUNC]](i8*, i8*)
+// CHECK: define internal void [[REDUCTION_FUNC]](i8* %0, i8* %1)
// arr_rhs = (int*)rhs[0];
// CHECK: [[ARR_RHS_REF:%.+]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[RED_LIST_RHS:%.+]], i64 0, i64 0
// CHECK: [[ARR_RHS_VOID:%.+]] = load i8*, i8** [[ARR_RHS_REF]],
@@ -1383,7 +1383,7 @@
// *(Type<n>-1*)lhs[<n>-1] = ReductionOperation<n>-1(*(Type<n>-1*)lhs[<n>-1],
// *(Type<n>-1*)rhs[<n>-1]);
// }
-// CHECK: define internal void [[REDUCTION_FUNC]](i8*, i8*)
+// CHECK: define internal void [[REDUCTION_FUNC]](i8* %0, i8* %1)
// t_var_lhs = (i{{[0-9]+}}*)lhs[0];
// CHECK: [[T_VAR_RHS_REF:%.+]] = getelementptr inbounds [4 x i8*], [4 x i8*]* [[RED_LIST_RHS:%.+]], i64 0, i64 0
// CHECK: [[T_VAR_RHS_VOID:%.+]] = load i8*, i8** [[T_VAR_RHS_REF]],
diff --git a/src/llvm-project/clang/test/OpenMP/for_reduction_codegen_UDR.cpp b/src/llvm-project/clang/test/OpenMP/for_reduction_codegen_UDR.cpp
index c7c3f93..6d8223c 100644
--- a/src/llvm-project/clang/test/OpenMP/for_reduction_codegen_UDR.cpp
+++ b/src/llvm-project/clang/test/OpenMP/for_reduction_codegen_UDR.cpp
@@ -38,6 +38,7 @@
T f;
S(T a) : f(a + g) {}
S() : f(g) {}
+ S& operator=(const S&);
~S() {}
};
void red(BaseS1&, const BaseS1&);
@@ -56,6 +57,34 @@
// CHECK-DAG: [[REDUCTION_LOC:@.+]] = private unnamed_addr global %struct.ident_t { i32 0, i32 18, i32 0, i32 0, i8*
// CHECK-DAG: [[REDUCTION_LOCK:@.+]] = common global [8 x i32] zeroinitializer
+#pragma omp declare reduction(operator* : S<int> : omp_out.f = 17 * omp_in.f) initializer(omp_priv = S<int>())
+// CHECK-LABEL: bazz
+void bazz() {
+ S<int> s;
+// CHECK: [[S_ADDR:%.+]] = alloca [[S_INT_TY]],
+// CHECK: call {{.*}} [[S_INT_TY_CONSTR:@.+]]([[S_INT_TY]]* [[S_ADDR]])
+// CHECK: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @{{.+}}, i32 1, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, [[S_INT_TY]]*)* [[BAZZ_OUTLINE:@.+]] to void (i32*, i32*, ...)*), [[S_INT_TY]]* [[S_ADDR]])
+// CHECK: call {{.*}} [[S_INT_TY_DESTR:@.+]]([[S_INT_TY]]*
+// CHECK: ret void
+#pragma omp parallel
+#pragma omp simd reduction(*: s)
+ for (int I = 0; I < 10; ++I)
+ ;
+}
+
+// CHECK: define internal void [[BAZZ_OUTLINE]](i32* {{.+}}, i32* {{.+}}, [[S_INT_TY]]* {{.+}})
+// CHECK: [[S_PRIV_ADDR:%.+]] = alloca [[S_INT_TY]],
+// CHECK: call void [[BAZZ_INIT:@.+]]([[S_INT_TY]]* [[S_PRIV_ADDR]], [[S_INT_TY]]* [[S_ORIG_ADDR:%.+]])
+// CHECK: call void @{{.+}}([[S_INT_TY]]* [[S_ORIG_ADDR]], [[S_INT_TY]]* [[S_PRIV_ADDR]])
+// CHECK-NEXT: call void [[S_INT_TY_DESTR]]([[S_INT_TY]]* [[S_PRIV_ADDR]])
+// CHECK-NEXT: ret void
+
+// CHECK: define internal void [[BAZZ_INIT]]([[S_INT_TY]]* {{.*}}[[S_PRIV_ADDR:%.+]], [[S_INT_TY]]* {{.*}}[[S_ORIG_ADDR:%.+]])
+// CHECK: store [[S_INT_TY]]* [[S_PRIV_ADDR]], [[S_INT_TY]]** [[S_PRIV_ADDR_REF:%.+]],
+// CHECK: [[S_PRIV_ADDR:%.+]] = load [[S_INT_TY]]*, [[S_INT_TY]]** [[S_PRIV_ADDR_REF]],
+// CHECK: call void [[S_INT_TY_CONSTR]]([[S_INT_TY]]* [[S_PRIV_ADDR]])
+// CHECK-NEXT: ret void
+
#pragma omp declare reduction(operator&& : int : omp_out = 111 & omp_in)
template <typename T, int length>
T tmain() {
@@ -268,10 +297,10 @@
// CHECK: ret void
-// CHECK: define internal void [[RED_COMB1]](float* noalias, float* noalias)
+// CHECK: define internal void [[RED_COMB1]](float* noalias %0, float* noalias %1)
// CHECK: fsub float 2.220000e+02, %
-// CHECK: define internal void [[RED_INIT1]](float* noalias, float* noalias)
+// CHECK: define internal void [[RED_INIT1]](float* noalias %0, float* noalias %1)
// CHECK: store float -1.0{{.+}}, float*
// CHECK: define internal void [[RED_COMB2]](
@@ -292,7 +321,7 @@
// *(Type<n>-1*)lhs[<n>-1] = ReductionOperation<n>-1(*(Type<n>-1*)lhs[<n>-1],
// *(Type<n>-1*)rhs[<n>-1]);
// }
-// CHECK: define internal void [[REDUCTION_FUNC]](i8*, i8*)
+// CHECK: define internal void [[REDUCTION_FUNC]](i8* %0, i8* %1)
// t_var_lhs = (float*)lhs[0];
// CHECK: [[T_VAR_RHS_REF:%.+]] = getelementptr inbounds [4 x i8*], [4 x i8*]* [[RED_LIST_RHS:%.+]], i64 0, i64 0
// CHECK: [[T_VAR_RHS_VOID:%.+]] = load i8*, i8** [[T_VAR_RHS_REF]],
@@ -485,10 +514,10 @@
// CHECK: ret void
-// CHECK: define internal void [[RED_COMB5]](i32* noalias, i32* noalias)
+// CHECK: define internal void [[RED_COMB5]](i32* noalias %0, i32* noalias %1)
// CHECK: mul nsw i32 555, %
-// CHECK: define internal void [[RED_INIT5]](i32* noalias, i32* noalias)
+// CHECK: define internal void [[RED_INIT5]](i32* noalias %0, i32* noalias %1)
// CHECK: store i32 888, i32* %
// void reduce_func(void *lhs[<n>], void *rhs[<n>]) {
@@ -497,7 +526,7 @@
// *(Type<n>-1*)lhs[<n>-1] = ReductionOperation<n>-1(*(Type<n>-1*)lhs[<n>-1],
// *(Type<n>-1*)rhs[<n>-1]);
// }
-// CHECK: define internal void [[REDUCTION_FUNC]](i8*, i8*)
+// CHECK: define internal void [[REDUCTION_FUNC]](i8* %0, i8* %1)
// arr_rhs = (int*)rhs[0];
// CHECK: [[ARR_RHS_REF:%.+]] = getelementptr inbounds [4 x i8*], [4 x i8*]* [[RED_LIST_RHS:%.+]], i64 0, i64 0
// CHECK: [[ARR_RHS_VOID:%.+]] = load i8*, i8** [[ARR_RHS_REF]],
@@ -687,7 +716,7 @@
// *(Type<n>-1*)lhs[<n>-1] = ReductionOperation<n>-1(*(Type<n>-1*)lhs[<n>-1],
// *(Type<n>-1*)rhs[<n>-1]);
// }
-// CHECK: define internal void [[REDUCTION_FUNC]](i8*, i8*)
+// CHECK: define internal void [[REDUCTION_FUNC]](i8* %0, i8* %1)
// arr_rhs = (int*)rhs[0];
// CHECK: [[ARR_RHS_REF:%.+]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[RED_LIST_RHS:%.+]], i64 0, i64 0
// CHECK: [[ARR_RHS_VOID:%.+]] = load i8*, i8** [[ARR_RHS_REF]],
@@ -828,7 +857,7 @@
// CHECK: store [4 x [[S_FLOAT_TY]]]* [[VAR3_ORIG]], [4 x [[S_FLOAT_TY]]]** [[VAR3_ORIG_ADDR:%.+]],
// CHECK: [[VAR3_ORIG:%.+]] = load [4 x [[S_FLOAT_TY]]]*, [4 x [[S_FLOAT_TY]]]** [[VAR3_ORIG_ADDR]],
// CHECK: [[VAR3_VOID_PTR:%.+]] = call i8* @__kmpc_alloc(i32 [[GTID:%.+]], i64 48, i8* inttoptr (i64 6 to i8*))
-// CHECK: [[VAR3_PRIV:%.+]] = bitcast i8* [[VAR3_VOID_PTR]] to [4 x %struct.S]*
+// CHECK: [[VAR3_PRIV:%.+]] = bitcast i8* [[VAR3_VOID_PTR]] to [4 x [[S_FLOAT_TY]]]*
// CHECK: getelementptr inbounds [4 x [[S_FLOAT_TY]]], [4 x [[S_FLOAT_TY]]]* [[VAR3_PRIV]], i32 0, i32 0
// CHECK: bitcast [4 x [[S_FLOAT_TY]]]* [[VAR3_ORIG]] to [[S_FLOAT_TY]]*
// CHECK: getelementptr [[S_FLOAT_TY]], [[S_FLOAT_TY]]* %{{.+}}, i64 4
@@ -839,13 +868,13 @@
// CHECK: define {{.*}} i{{[0-9]+}} [[TMAIN_INT_42]]()
// CHECK: [[TEST:%.+]] = alloca [[S_INT_TY]],
-// CHECK: call {{.*}} [[S_INT_TY_CONSTR:@.+]]([[S_INT_TY]]* [[TEST]])
+// CHECK: call {{.*}} [[S_INT_TY_CONSTR]]([[S_INT_TY]]* [[TEST]])
// CHECK: call void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)*, ...) @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{[0-9]+}} 6, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bitcast (void (i{{[0-9]+}}*, i{{[0-9]+}}*, i32*, [[S_INT_TY]]*, [[S_INT_TY]]*, i32*, [2 x i32]*, [2 x [[S_INT_TY]]]*)* [[TMAIN_MICROTASK:@.+]] to void
// Not interested in this one:
// CHECK: call void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)*, ...) @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{[0-9]+}} 4,
// CHECK: call void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)*, ...) @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{[0-9]+}} 5, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bitcast (void (i{{[0-9]+}}*, i{{[0-9]+}}*, [42 x [[S_INT_TY]]]*, [2 x i32]*, i32*, [2 x [[S_INT_TY]]]*, [[S_INT_TY]]*)* [[TMAIN_MICROTASK2:@.+]] to void
-// CHECK: call {{.*}} [[S_INT_TY_DESTR:@.+]]([[S_INT_TY]]*
-// CHECK: call {{.*}} [[S_INT_TY_DESTR:@.+]]([[S_INT_TY]]*
+// CHECK: call {{.*}} [[S_INT_TY_DESTR]]([[S_INT_TY]]*
+// CHECK: call {{.*}} [[S_INT_TY_DESTR]]([[S_INT_TY]]*
// CHECK: ret
//
// CHECK: define internal void [[TMAIN_MICROTASK]](i{{[0-9]+}}* noalias [[GTID_ADDR:%.+]], i{{[0-9]+}}* noalias %{{.+}}, i32* dereferenceable(4) %{{.+}}, [[S_INT_TY]]* dereferenceable(12) %{{.+}}, [[S_INT_TY]]* dereferenceable(12) %{{.+}}, i32* dereferenceable(4) %{{.+}}, [2 x i32]* dereferenceable(8) %{{.+}}, [2 x [[S_INT_TY]]]* dereferenceable(24) %{{.+}})
@@ -960,10 +989,10 @@
// CHECK-DAG: call {{.*}} [[S_INT_TY_DESTR]]([[S_INT_TY]]*
// CHECK: ret void
-// CHECK: define internal void [[RED_COMB6]](i32* noalias, i32* noalias)
+// CHECK: define internal void [[RED_COMB6]](i32* noalias %0, i32* noalias %1)
// CHECK: add nsw i32 1513, %
-// CHECK: define internal void [[RED_INIT6]](i32* noalias, i32* noalias)
+// CHECK: define internal void [[RED_INIT6]](i32* noalias %0, i32* noalias %1)
// CHECK: store i32 321, i32* %
// CHECK: define internal void [[RED_COMB7]](
@@ -972,10 +1001,10 @@
// CHECK: define internal void [[RED_INIT7]](
// CHECK: call void @_Z5init2R6BaseS1RKS_(
-// CHECK: define internal void [[RED_COMB8]](i32* noalias, i32* noalias)
+// CHECK: define internal void [[RED_COMB8]](i32* noalias %0, i32* noalias %1)
// CHECK: sub nsw i32 47, %
-// CHECK: define internal void [[RED_INIT8]](i32* noalias, i32* noalias)
+// CHECK: define internal void [[RED_INIT8]](i32* noalias %0, i32* noalias %1)
// CHECK: sdiv i32 432, %
// void reduce_func(void *lhs[<n>], void *rhs[<n>]) {
@@ -984,7 +1013,7 @@
// *(Type<n>-1*)lhs[<n>-1] = ReductionOperation<n>-1(*(Type<n>-1*)lhs[<n>-1],
// *(Type<n>-1*)rhs[<n>-1]);
// }
-// CHECK: define internal void [[REDUCTION_FUNC]](i8*, i8*)
+// CHECK: define internal void [[REDUCTION_FUNC]](i8* %0, i8* %1)
// t_var_lhs = (i{{[0-9]+}}*)lhs[0];
// CHECK: [[T_VAR_RHS_REF:%.+]] = getelementptr inbounds [4 x i8*], [4 x i8*]* [[RED_LIST_RHS:%.+]], i64 0, i64 0
// CHECK: [[T_VAR_RHS_VOID:%.+]] = load i8*, i8** [[T_VAR_RHS_REF]],
diff --git a/src/llvm-project/clang/test/OpenMP/for_reduction_messages.cpp b/src/llvm-project/clang/test/OpenMP/for_reduction_messages.cpp
index a082e58..1ba3a60 100644
--- a/src/llvm-project/clang/test/OpenMP/for_reduction_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/for_reduction_messages.cpp
@@ -7,6 +7,14 @@
// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
extern int omp_default_mem_alloc;
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp parallel
+#pragma omp for reduction(+:fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
void foo() {
}
diff --git a/src/llvm-project/clang/test/OpenMP/for_simd_ast_print.cpp b/src/llvm-project/clang/test/OpenMP/for_simd_ast_print.cpp
index d626994..df84215 100644
--- a/src/llvm-project/clang/test/OpenMP/for_simd_ast_print.cpp
+++ b/src/llvm-project/clang/test/OpenMP/for_simd_ast_print.cpp
@@ -1,10 +1,16 @@
-// RUN: %clang_cc1 -verify -fopenmp -ast-print %s | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -ast-print %s | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45
// 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
+// RUN: %clang_cc1 -fopenmp -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45
+// RUN: %clang_cc1 -verify -fopenmp -ast-print %s -fopenmp-version=50 -DOMP5 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -emit-pch -o %t %s -fopenmp-version=50 -DOMP5
+// RUN: %clang_cc1 -fopenmp -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -fopenmp-version=50 -DOMP5 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50
-// RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s
+// RUN: %clang_cc1 -fopenmp-simd -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45
+// RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s -fopenmp-version=50 -DOMP5 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -emit-pch -o %t %s -fopenmp-version=50 -DOMP5
+// RUN: %clang_cc1 -fopenmp-simd -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -fopenmp-version=50 -DOMP5 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50
// expected-no-diagnostics
#ifndef HEADER
@@ -46,7 +52,7 @@
public:
S8(int v) : S7<S1>(v){
-#pragma omp for simd private(a) private(this->a) private(S7<S1>::a)
+#pragma omp for simd private(a) private(this->a) private(S7<S1>::a)
for (int k = 0; k < a.a; ++k)
++this->a.a;
}
@@ -90,8 +96,13 @@
// CHECK: T res;
// CHECK: T val;
// CHECK: T lin = 0;
+#ifdef OMP5
+ #pragma omp for simd private(val) safelen(7) linear(lin : -5) lastprivate(res) simdlen(5) allocate(res) if(res) nontemporal(res, val, lin)
+#else
#pragma omp for simd private(val) safelen(7) linear(lin : -5) lastprivate(res) simdlen(5) allocate(res)
-// CHECK-NEXT: #pragma omp for simd private(val) safelen(7) linear(lin: -5) lastprivate(res) simdlen(5)
+#endif
+// OMP50-NEXT: #pragma omp for simd private(val) safelen(7) linear(lin: -5) lastprivate(res) simdlen(5) allocate(res) if(res) nontemporal(res,val,lin)
+// OMP45-NEXT: #pragma omp for simd private(val) safelen(7) linear(lin: -5) lastprivate(res) simdlen(5) allocate(res)
for (T i = 7; i < m_a; ++i) {
val = v[i-7] + m_a;
res = val;
@@ -169,8 +180,13 @@
// CHECK-NEXT: foo();
const int CLEN = 4;
// CHECK-NEXT: const int CLEN = 4;
+#ifdef OMP5
+ #pragma omp for simd aligned(a:CLEN) linear(a:CLEN) safelen(CLEN) collapse( 1 ) simdlen(CLEN) if(simd:a)
+#else
#pragma omp for simd aligned(a:CLEN) linear(a:CLEN) safelen(CLEN) collapse( 1 ) simdlen(CLEN)
-// CHECK-NEXT: #pragma omp for simd aligned(a: CLEN) linear(a: CLEN) safelen(CLEN) collapse(1) simdlen(CLEN)
+#endif
+// OMP50-NEXT: #pragma omp for simd aligned(a: CLEN) linear(a: CLEN) safelen(CLEN) collapse(1) simdlen(CLEN) if(simd: a)
+// OMP45-NEXT: #pragma omp for simd aligned(a: CLEN) linear(a: CLEN) safelen(CLEN) collapse(1) simdlen(CLEN)
for (int i = 0; i < 10; ++i)foo();
// CHECK-NEXT: for (int i = 0; i < 10; ++i)
// CHECK-NEXT: foo();
diff --git a/src/llvm-project/clang/test/OpenMP/for_simd_codegen.cpp b/src/llvm-project/clang/test/OpenMP/for_simd_codegen.cpp
index c36f527..a668cb7 100644
--- a/src/llvm-project/clang/test/OpenMP/for_simd_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/for_simd_codegen.cpp
@@ -1,12 +1,20 @@
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-unknown -emit-llvm -fexceptions -fcxx-exceptions -o - < %s | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-unknown -emit-llvm -fexceptions -fcxx-exceptions -o - < %s | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t < %s
-// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -debug-info-kind=limited -std=c++11 -include-pch %t -verify -emit-llvm -o - < %s | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -debug-info-kind=limited -std=c++11 -include-pch %t -verify -emit-llvm -o - < %s | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45
// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp -fexceptions -fcxx-exceptions -debug-info-kind=line-tables-only -x c++ -emit-llvm -o - < %s | FileCheck %s --check-prefix=TERM_DEBUG
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-unknown -emit-llvm -fexceptions -fcxx-exceptions -o - < %s -fopenmp-version=50 -DOMP5 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t < %s -fopenmp-version=50 -DOMP5
+// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -debug-info-kind=limited -std=c++11 -include-pch %t -verify -emit-llvm -o - -fopenmp-version=50 -DOMP5 < %s | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50
+// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp -fexceptions -fcxx-exceptions -debug-info-kind=line-tables-only -x c++ -emit-llvm -o - < %s -fopenmp-version=50 -DOMP5 | FileCheck %s --check-prefix=TERM_DEBUG
// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple x86_64-unknown-unknown -emit-llvm -fexceptions -fcxx-exceptions -o - < %s | FileCheck --check-prefix SIMD-ONLY0 %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t < %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -debug-info-kind=limited -std=c++11 -include-pch %t -verify -emit-llvm -o - < %s | FileCheck --check-prefix SIMD-ONLY0 %s
// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp-simd -fexceptions -fcxx-exceptions -debug-info-kind=line-tables-only -x c++ -emit-llvm -o - < %s | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple x86_64-unknown-unknown -emit-llvm -fexceptions -fcxx-exceptions -o - < %s -fopenmp-version=50 -DOMP5 | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t < %s -fopenmp-version=50 -DOMP5
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -debug-info-kind=limited -std=c++11 -include-pch %t -verify -fopenmp-version=50 -DOMP5 -emit-llvm -o - < %s | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp-simd -fexceptions -fcxx-exceptions -debug-info-kind=line-tables-only -x c++ -emit-llvm -o - < %s -fopenmp-version=50 -DOMP5 | FileCheck --check-prefix SIMD-ONLY0 %s
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
// expected-no-diagnostics
#ifndef HEADER
@@ -17,7 +25,11 @@
// CHECK-LABEL: define {{.*void}} @{{.*}}simple{{.*}}(float* {{.+}}, float* {{.+}}, float* {{.+}}, float* {{.+}})
void simple(float *a, float *b, float *c, float *d) {
+#ifdef OMP5
+ #pragma omp for simd if (true)
+#else
#pragma omp for simd
+#endif
// CHECK: call void @__kmpc_for_static_init_4(%struct.ident_t* {{[^,]+}}, i32 %{{[^,]+}}, i32 34, i32* %{{[^,]+}}, i32* [[LB:%[^,]+]], i32* [[UB:%[^,]+]], i32* [[STRIDE:%[^,]+]], i32 1, i32 1)
// CHECK: [[UB_VAL:%.+]] = load i32, i32* [[UB]],
// CHECK: [[CMP:%.+]] = icmp sgt i32 [[UB_VAL]], 5
@@ -316,7 +328,15 @@
// CHECK: store i32 -1, i32* [[R:%[^,]+]],
R = -1;
// CHECK: store i32 1, i32* [[R_PRIV:%[^,]+]],
+// OMP50: [[A_VAL:%.+]] = load i32, i32* %
+// OMP50: [[COND:%.+]] = icmp ne i32 [[A_VAL]], 0
+// OMP50: br i1 [[COND]], label {{%?}}[[THEN:[^,]+]], label {{%?}}[[ELSE:[^,]+]]
+// OMP50: [[THEN]]:
+#ifdef OMP5
+ #pragma omp for simd reduction(*:R) if (simd:A) nontemporal(R)
+#else
#pragma omp for simd reduction(*:R)
+#endif
// CHECK: call void @__kmpc_for_static_init_8(%struct.ident_t* {{[^,]+}}, i32 %{{[^,]+}}, i32 34, i32* %{{[^,]+}}, i64* [[LB:%[^,]+]], i64* [[UB:%[^,]+]], i64* [[STRIDE:%[^,]+]], i64 1, i64 1)
// CHECK: [[UB_VAL:%.+]] = load i64, i64* [[UB]],
// CHECK: [[CMP:%.+]] = icmp sgt i64 [[UB_VAL]], 6
@@ -346,13 +366,54 @@
// CHECK-NEXT: [[LC_IT_2:%.+]] = add nsw i64 -10, [[LC_IT_1]]
// CHECK-NEXT: store i64 [[LC_IT_2]], i64* [[LC:%[^,]+]],
// CHECK-NEXT: [[LC_VAL:%.+]] = load i64, i64* [[LC]]
-// CHECK: store i32 %{{.+}}, i32* [[R_PRIV]],
+// OMP45: store i32 %{{.+}}, i32* [[R_PRIV]],
+// OMP50: store i32 %{{.+}}, i32* [[R_PRIV]],{{.*}}!nontemporal
R *= i;
// CHECK: [[IV8_2:%.+]] = load i64, i64* [[OMP_IV8]]
// CHECK-NEXT: [[ADD8_2:%.+]] = add nsw i64 [[IV8_2]], 1
// CHECK-NEXT: store i64 [[ADD8_2]], i64* [[OMP_IV8]]
+// CHECK-NEXT: br label {{%?}}[[SIMD_LOOP8_COND]], {{.*}}!llvm.loop ![[SIMD_LOOP:.+]]
}
// CHECK: [[SIMPLE_LOOP8_END]]:
+// OMP50: br label {{%?}}[[IF_EXIT:[^,]+]]
+// OMP50: [[ELSE]]:
+// OMP50: call void @__kmpc_for_static_init_8(%struct.ident_t* {{[^,]+}}, i32 %{{[^,]+}}, i32 34, i32* %{{[^,]+}}, i64* [[LB:%[^,]+]], i64* [[UB:%[^,]+]], i64* [[STRIDE:%[^,]+]], i64 1, i64 1)
+// OMP50: [[UB_VAL:%.+]] = load i64, i64* [[UB]],
+// OMP50: [[CMP:%.+]] = icmp sgt i64 [[UB_VAL]], 6
+// OMP50: br i1 [[CMP]], label %[[TRUE:.+]], label %[[FALSE:[^,]+]]
+// OMP50: [[TRUE]]:
+// OMP50: br label %[[SWITCH:[^,]+]]
+// OMP50: [[FALSE]]:
+// OMP50: [[UB_VAL:%.+]] = load i64, i64* [[UB]],
+// OMP50: br label %[[SWITCH]]
+// OMP50: [[SWITCH]]:
+// OMP50: [[UP:%.+]] = phi i64 [ 6, %[[TRUE]] ], [ [[UB_VAL]], %[[FALSE]] ]
+// OMP50: store i64 [[UP]], i64* [[UB]],
+// OMP50: [[LB_VAL:%.+]] = load i64, i64* [[LB]],
+// OMP50: store i64 [[LB_VAL]], i64* [[OMP_IV8:%[^,]+]],
+
+// OMP50: br label %[[SIMD_LOOP8_COND:[^,]+]]
+// OMP50: [[SIMD_LOOP8_COND]]:
+// OMP50-NEXT: [[IV8:%.+]] = load i64, i64* [[OMP_IV8]]
+// OMP50-NEXT: [[UB_VAL:%.+]] = load i64, i64* [[UB]]
+// OMP50-NEXT: [[CMP8:%.+]] = icmp sle i64 [[IV8]], [[UB_VAL]]
+// OMP50-NEXT: br i1 [[CMP8]], label %[[SIMPLE_LOOP8_BODY:.+]], label %[[SIMPLE_LOOP8_END:[^,]+]]
+// OMP50: [[SIMPLE_LOOP8_BODY]]:
+// Start of body: calculate i from IV:
+// OMP50: [[IV8_0:%.+]] = load i64, i64* [[OMP_IV8]]
+// OMP50-NEXT: [[LC_IT_1:%.+]] = mul nsw i64 [[IV8_0]], 3
+// OMP50-NEXT: [[LC_IT_2:%.+]] = add nsw i64 -10, [[LC_IT_1]]
+// OMP50-NEXT: store i64 [[LC_IT_2]], i64* [[LC:%[^,]+]],
+// OMP50-NEXT: [[LC_VAL:%.+]] = load i64, i64* [[LC]]
+// OMP50: store i32 %{{.+}}, i32* [[R_PRIV]],
+// OMP50: [[IV8_2:%.+]] = load i64, i64* [[OMP_IV8]]
+// OMP50-NEXT: [[ADD8_2:%.+]] = add nsw i64 [[IV8_2]], 1
+// OMP50-NEXT: store i64 [[ADD8_2]], i64* [[OMP_IV8]]
+// OMP50-NEXT: br label {{%?}}[[SIMD_LOOP8_COND]], {{.*}}!llvm.loop ![[NOSIMD_LOOP:.+]]
+// OMP50: [[SIMPLE_LOOP8_END]]:
+// OMP50: br label {{%?}}[[IF_EXIT]]
+// OMP50: [[IF_EXIT]]:
+
// CHECK: call void @__kmpc_for_static_fini(%struct.ident_t* {{.+}}, i32 %{{.+}})
// CHECK: call i32 @__kmpc_reduce(
// CHECK: [[R_PRIV_VAL:%.+]] = load i32, i32* [[R_PRIV]],
@@ -742,4 +803,10 @@
}
// TERM_DEBUG: !{{[0-9]+}} = !DILocation(line: [[@LINE-11]],
// TERM_DEBUG-NOT: line: 0,
+// OMP45-NOT: !"llvm.loop.vectorize.enable", i1 false
+// CHECK-DAG: ![[SIMD_LOOP]] = distinct !{![[SIMD_LOOP]], {{.*}}![[VECT_LOOP:[^,]+]]}
+// CHECK-DAG: ![[VECT_LOOP]] = !{!"llvm.loop.vectorize.enable", i1 true}
+// OMP45-NOT: !"llvm.loop.vectorize.enable", i1 false
+// OMP50-DAG: ![[NOSIMD_LOOP]] = distinct !{![[NOSIMD_LOOP]], {{.*}}![[NOVECT_LOOP:[^,]+]]}
+// OMP50-DAG: ![[NOVECT_LOOP]] = !{!"llvm.loop.vectorize.enable", i1 false}
#endif // HEADER
diff --git a/src/llvm-project/clang/test/OpenMP/for_simd_if_messages.cpp b/src/llvm-project/clang/test/OpenMP/for_simd_if_messages.cpp
new file mode 100644
index 0000000..6dd9dd3
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/for_simd_if_messages.cpp
@@ -0,0 +1,101 @@
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 %s -Wuninitialized
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+void xxx(int argc) {
+ int cond; // expected-note {{initialize the variable 'cond' to silence this warning}}
+#pragma omp for simd if(cond) // expected-warning {{variable 'cond' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
+struct S1; // expected-note {{declared here}}
+
+template <class T, class S> // expected-note {{declared here}}
+int tmain(T argc, S **argv) {
+ T z;
+ int i;
+ #pragma omp for simd if // expected-error {{expected '(' after 'if'}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp for simd if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp for simd if () // expected-error {{expected expression}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp for simd if (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp for simd if (argc)) // expected-warning {{extra tokens at the end of '#pragma omp for simd' are ignored}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp for simd if (argc > 0 ? argv[1] : argv[2])
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp for simd if (foobool(argc)), if (true) // expected-error {{directive '#pragma omp for simd' cannot contain more than one 'if' clause}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp for simd if (S) // expected-error {{'S' does not refer to a value}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp for simd if (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp for simd if (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp for simd if(argc + z)
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp for simd if(simd : // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp for simd if(simd : argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp for simd if(simd : argc)
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp for simd if(target : argc) // expected-error {{directive name modifier 'target' is not allowed for '#pragma omp for simd'}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp for simd if(simd : argc) if (simd :argc) // expected-error {{directive '#pragma omp for simd' cannot contain more than one 'if' clause with 'simd' name modifier}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp for simd if(simd : argc) if (argc) // expected-note {{previous clause with directive name modifier specified here}} expected-error {{no more 'if' clause is allowed}}
+ for (i = 0; i < argc; ++i) foo();
+
+ return 0;
+}
+
+int main(int argc, char **argv) {
+ int i, z;
+ #pragma omp for simd if // expected-error {{expected '(' after 'if'}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp for simd if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp for simd if () // expected-error {{expected expression}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp for simd if (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp for simd if (argc)) // expected-warning {{extra tokens at the end of '#pragma omp for simd' are ignored}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp for simd if (argc > 0 ? argv[1] : argv[2])
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp for simd if (foobool(argc)), if (true) // expected-error {{directive '#pragma omp for simd' cannot contain more than one 'if' clause}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp for simd if (S1) // expected-error {{'S1' does not refer to a value}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp for simd if (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp for simd if (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp for simd if (1 0) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp for simd if(if(tmain(argc, argv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp for simd if(simd : // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp for simd if(simd : argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp for simd if(simd : argc + z) if (for:argc) // expected-error {{directive name modifier 'for' is not allowed for '#pragma omp for simd'}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp for simd if(simd : argc) if (simd :argc) // expected-error {{directive '#pragma omp for simd' cannot contain more than one 'if' clause with 'simd' name modifier}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp for simd if(simd : argc) if (argc) // expected-note {{previous clause with directive name modifier specified here}} expected-error {{no more 'if' clause is allowed}}
+ for (i = 0; i < argc; ++i) foo();
+
+ return tmain(argc, argv);
+}
diff --git a/src/llvm-project/clang/test/OpenMP/for_simd_lastprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/for_simd_lastprivate_messages.cpp
index a69a3c1..023f56c 100644
--- a/src/llvm-project/clang/test/OpenMP/for_simd_lastprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/for_simd_lastprivate_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
@@ -55,7 +57,7 @@
};
class S6 {
int a;
- S6() : a(0) {}
+ S6() : a(0) {} // omp45-note 2 {{implicitly declared private here}}
public:
S6(const S6 &s6) : a(s6.a) {}
@@ -71,6 +73,7 @@
I g(5);
int i, z;
int &j = i;
+ S6 s(0); // omp50-note {{'s' defined here}}
#pragma omp parallel
#pragma omp for simd lastprivate // expected-error {{expected '(' after 'lastprivate'}}
for (int k = 0; k < argc; ++k)
@@ -104,6 +107,14 @@
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel
+#pragma omp for simd lastprivate(conditional: argc,s) lastprivate(conditional: // omp45-error 2 {{use of undeclared identifier 'conditional'}} omp50-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp45-error 2 {{calling a private constructor of class 'S6'}} omp50-error {{expected list item of scalar type in 'lastprivate' clause with 'conditional' modifier}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp for simd lastprivate(foo:argc) // omp50-error {{expected 'conditional' in OpenMP clause 'lastprivate'}} omp45-error {{expected ',' or ')' in 'lastprivate' clause}} omp45-error {{expected ')'}} omp45-error {{expected variable name}} omp45-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
#pragma omp for simd lastprivate(z, a, b) // expected-error {{lastprivate variable with incomplete type 'S1'}}
for (int k = 0; k < argc; ++k)
++k;
@@ -252,8 +263,8 @@
for (i = 0; i < argc; ++i)
foo();
#pragma omp parallel
-#pragma omp for simd lastprivate(i) // expected-note {{defined as lastprivate}}
- for (i = 0; i < argc; ++i) // expected-error {{loop iteration variable in the associated loop of 'omp for simd' directive may not be lastprivate, predetermined as linear}}
+#pragma omp for simd lastprivate(i) // omp45-note {{defined as lastprivate}}
+ for (i = 0; i < argc; ++i) // omp45-error {{loop iteration variable in the associated loop of 'omp for simd' directive may not be lastprivate, predetermined as linear}}
foo();
#pragma omp parallel private(xa) // expected-note {{defined as private}}
#pragma omp for simd lastprivate(xa) // expected-error {{lastprivate variable must be shared}}
diff --git a/src/llvm-project/clang/test/OpenMP/for_simd_linear_messages.cpp b/src/llvm-project/clang/test/OpenMP/for_simd_linear_messages.cpp
index 9df53ae..27b9087 100644
--- a/src/llvm-project/clang/test/OpenMP/for_simd_linear_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/for_simd_linear_messages.cpp
@@ -3,6 +3,14 @@
// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
+
+void xxx(int argc) {
+ int i, lin, step; // expected-note {{initialize the variable 'lin' to silence this warning}} expected-note {{initialize the variable 'step' to silence this warning}}
+#pragma omp for simd linear(i, lin : step) // expected-warning {{variable 'lin' is uninitialized when used here}} expected-warning {{variable 'step' is uninitialized when used here}}
+ for (i = 0; i < 10; ++i)
+ ;
+}
+
namespace X {
int x;
};
diff --git a/src/llvm-project/clang/test/OpenMP/for_simd_loop_messages.cpp b/src/llvm-project/clang/test/OpenMP/for_simd_loop_messages.cpp
index 2a5a6e8..99f30a6 100644
--- a/src/llvm-project/clang/test/OpenMP/for_simd_loop_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/for_simd_loop_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wuninitialized
class S {
int a;
@@ -108,32 +110,32 @@
c[ii] = a[ii];
#pragma omp parallel
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
#pragma omp for simd
for (int i = 0; i; i++)
c[i] = a[i];
#pragma omp parallel
-// expected-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'i'}}
#pragma omp for simd
for (int i = 0; jj < kk; ii++)
c[i] = a[i];
#pragma omp parallel
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
#pragma omp for simd
for (int i = 0; !!i; i++)
c[i] = a[i];
-// Ok
#pragma omp parallel
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
#pragma omp for simd
for (int i = 0; i != 1; i++)
c[i] = a[i];
#pragma omp parallel
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
#pragma omp for simd
for (int i = 0;; i++)
c[i] = a[i];
@@ -294,15 +296,15 @@
c[ii] = a[ii];
#pragma omp parallel
-// expected-note@+2 {{defined as private}}
-// expected-error@+2 {{loop iteration variable in the associated loop of 'omp for simd' directive may not be private, predetermined as linear}}
+// omp4-note@+2 {{defined as private}}
+// omp4-error@+2 {{loop iteration variable in the associated loop of 'omp for simd' directive may not be private, predetermined as linear}}
#pragma omp for simd private(ii)
for (ii = 0; ii < 10; ii++)
c[ii] = a[ii];
#pragma omp parallel
-// expected-note@+2 {{defined as lastprivate}}
-// expected-error@+2 {{loop iteration variable in the associated loop of 'omp for simd' directive may not be lastprivate, predetermined as linear}}
+// omp4-note@+2 {{defined as lastprivate}}
+// omp4-error@+2 {{loop iteration variable in the associated loop of 'omp for simd' directive may not be lastprivate, predetermined as linear}}
#pragma omp for simd lastprivate(ii)
for (ii = 0; ii < 10; ii++)
c[ii] = a[ii];
@@ -331,7 +333,7 @@
}
#pragma omp parallel
-// expected-error@+2 {{statement after '#pragma omp for simd' must be a for loop}}
+// omp4-error@+2 {{statement after '#pragma omp for simd' must be a for loop}}
#pragma omp for simd
for (auto &item : a) {
item = item + 1;
@@ -482,17 +484,17 @@
for (begin = end; begin < end; ++begin)
++begin;
#pragma omp parallel
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
#pragma omp for simd
for (GoodIter I = begin; I - I; ++I)
++I;
#pragma omp parallel
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
#pragma omp for simd
for (GoodIter I = begin; begin < end; ++I)
++I;
#pragma omp parallel
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
#pragma omp for simd
for (GoodIter I = begin; !I; ++I)
++I;
diff --git a/src/llvm-project/clang/test/OpenMP/for_simd_misc_messages.c b/src/llvm-project/clang/test/OpenMP/for_simd_misc_messages.c
index ced5ee5..1ab4f9d 100644
--- a/src/llvm-project/clang/test/OpenMP/for_simd_misc_messages.c
+++ b/src/llvm-project/clang/test/OpenMP/for_simd_misc_messages.c
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=45 -verify=expected,omp45 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -verify=expected,omp50 %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=45 -verify=expected,omp45 -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -verify=expected,omp50 -verify %s -Wuninitialized
void xxx(int argc) {
int x; // expected-note {{initialize the variable 'x' to silence this warning}}
@@ -763,3 +765,89 @@
}
}
+void test_nontemporal() {
+ int i;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp for simd'}} expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp for simd nontemporal(
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp for simd'}} expected-error@+1 2 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp for simd nontemporal(,
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp for simd'}} expected-error@+1 2 {{expected expression}}
+#pragma omp for simd nontemporal(, )
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp for simd'}} expected-error@+1 {{expected expression}}
+#pragma omp for simd nontemporal()
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp for simd'}} expected-error@+1 {{expected expression}}
+#pragma omp for simd nontemporal(int)
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp for simd'}} omp50-error@+1 {{expected variable name}}
+#pragma omp for simd nontemporal(0)
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp for simd'}} expected-error@+1 {{use of undeclared identifier 'x'}}
+#pragma omp for simd nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+// expected-error@+2 {{use of undeclared identifier 'x'}}
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp for simd'}} expected-error@+1 {{use of undeclared identifier 'y'}}
+#pragma omp for simd nontemporal(x, y)
+ for (i = 0; i < 16; ++i)
+ ;
+// expected-error@+3 {{use of undeclared identifier 'x'}}
+// expected-error@+2 {{use of undeclared identifier 'y'}}
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp for simd'}} expected-error@+1 {{use of undeclared identifier 'z'}}
+#pragma omp for simd nontemporal(x, y, z)
+ for (i = 0; i < 16; ++i)
+ ;
+
+ int x, y;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp for simd'}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp for simd nontemporal(x :)
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp for simd'}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}}
+#pragma omp for simd nontemporal(x :, )
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp50-note@+2 {{defined as nontemporal}}
+// omp45-error@+1 2 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp for simd'}} omp50-error@+1 {{a variable cannot appear in more than one nontemporal clause}}
+#pragma omp for simd nontemporal(x) nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp for simd'}}
+#pragma omp for simd private(x) nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp for simd'}}
+#pragma omp for simd nontemporal(x) private(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp for simd'}} expected-note@+1 {{to match this '('}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}} expected-error@+1 {{expected ')'}}
+#pragma omp for simd nontemporal(x, y : 0)
+ for (i = 0; i < 16; ++i)
+ ;
+
+#pragma omp parallel
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp for simd'}}
+#pragma omp for simd nontemporal(x) lastprivate(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+#pragma omp parallel
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp for simd'}}
+#pragma omp for simd lastprivate(x) nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+}
+
diff --git a/src/llvm-project/clang/test/OpenMP/for_simd_reduction_messages.cpp b/src/llvm-project/clang/test/OpenMP/for_simd_reduction_messages.cpp
index 9a112bc..c739608 100644
--- a/src/llvm-project/clang/test/OpenMP/for_simd_reduction_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/for_simd_reduction_messages.cpp
@@ -7,6 +7,14 @@
// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
extern int omp_default_mem_alloc;
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp parallel
+#pragma omp for simd reduction(+:fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
void foo() {
}
diff --git a/src/llvm-project/clang/test/OpenMP/function-attr.cpp b/src/llvm-project/clang/test/OpenMP/function-attr.cpp
index a370cc3..676c71b3 100644
--- a/src/llvm-project/clang/test/OpenMP/function-attr.cpp
+++ b/src/llvm-project/clang/test/OpenMP/function-attr.cpp
@@ -14,7 +14,7 @@
~S() {}
};
-// CHECK: define internal void @.omp.copyprivate.copy_func(i8*, i8*) [[ATTR0:#[0-9]+]] {
+// CHECK: define internal void @.omp.copyprivate.copy_func(i8* %0, i8* %1) [[ATTR0:#[0-9]+]] {
void foo0();
@@ -41,7 +41,7 @@
return 0;
}
-// CHECK: define internal void @.omp.reduction.reduction_func(i8*, i8*) [[ATTR0]] {
+// CHECK: define internal void @.omp.reduction.reduction_func(i8* %0, i8* %1) [[ATTR0]] {
float foo3(int n, float *a, float *b) {
int i;
diff --git a/src/llvm-project/clang/test/OpenMP/master_taskloop_ast_print.cpp b/src/llvm-project/clang/test/OpenMP/master_taskloop_ast_print.cpp
new file mode 100644
index 0000000..55ed21b
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/master_taskloop_ast_print.cpp
@@ -0,0 +1,83 @@
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ast-print %s | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ast-print %s | FileCheck %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s
+// expected-no-diagnostics
+
+#ifndef HEADER
+#define HEADER
+
+void foo() {}
+
+template <class T, int N>
+T tmain(T argc) {
+ T b = argc, c, d, e, f, g;
+ static T a;
+// CHECK: static T a;
+#pragma omp taskgroup allocate(d) task_reduction(+: d)
+#pragma omp master taskloop if(taskloop: argc > N) default(shared) untied priority(N) grainsize(N) reduction(+:g) in_reduction(+: d) allocate(d)
+ // CHECK-NEXT: #pragma omp taskgroup allocate(d) task_reduction(+: d)
+ // CHECK-NEXT: #pragma omp master taskloop if(taskloop: argc > N) default(shared) untied priority(N) grainsize(N) reduction(+: g) in_reduction(+: d) allocate(d){{$}}
+ for (int i = 0; i < 2; ++i)
+ a = 2;
+// CHECK-NEXT: for (int i = 0; i < 2; ++i)
+// CHECK-NEXT: a = 2;
+#pragma omp parallel
+#pragma omp master taskloop private(argc, b), firstprivate(c, d), lastprivate(d, f) collapse(N) shared(g) if (c) final(d) mergeable priority(f) nogroup num_tasks(N)
+ for (int i = 0; i < 2; ++i)
+ for (int j = 0; j < 2; ++j)
+ for (int j = 0; j < 2; ++j)
+ for (int j = 0; j < 2; ++j)
+ for (int j = 0; j < 2; ++j)
+ for (int i = 0; i < 2; ++i)
+ for (int j = 0; j < 2; ++j)
+ for (int j = 0; j < 2; ++j)
+ for (int j = 0; j < 2; ++j)
+ for (int j = 0; j < 2; ++j)
+ foo();
+ // CHECK-NEXT: #pragma omp parallel
+ // CHECK-NEXT: #pragma omp master taskloop private(argc,b) firstprivate(c,d) lastprivate(d,f) collapse(N) shared(g) if(c) final(d) mergeable priority(f) nogroup num_tasks(N)
+ // CHECK-NEXT: for (int i = 0; i < 2; ++i)
+ // CHECK-NEXT: for (int j = 0; j < 2; ++j)
+ // CHECK-NEXT: for (int j = 0; j < 2; ++j)
+ // CHECK-NEXT: for (int j = 0; j < 2; ++j)
+ // CHECK-NEXT: for (int j = 0; j < 2; ++j)
+ // CHECK-NEXT: for (int i = 0; i < 2; ++i)
+ // CHECK-NEXT: for (int j = 0; j < 2; ++j)
+ // CHECK-NEXT: for (int j = 0; j < 2; ++j)
+ // CHECK-NEXT: for (int j = 0; j < 2; ++j)
+ // CHECK-NEXT: for (int j = 0; j < 2; ++j)
+ // CHECK-NEXT: foo();
+ return T();
+}
+
+// CHECK-LABEL: int main(int argc, char **argv) {
+int main(int argc, char **argv) {
+ int b = argc, c, d, e, f, g;
+ static int a;
+// CHECK: static int a;
+#pragma omp taskgroup task_reduction(+: d)
+#pragma omp master taskloop if(taskloop: a) default(none) shared(a) final(b) priority(5) num_tasks(argc) reduction(*: g) in_reduction(+:d)
+ // CHECK-NEXT: #pragma omp taskgroup task_reduction(+: d)
+ // CHECK-NEXT: #pragma omp master taskloop if(taskloop: a) default(none) shared(a) final(b) priority(5) num_tasks(argc) reduction(*: g) in_reduction(+: d)
+ for (int i = 0; i < 2; ++i)
+ a = 2;
+// CHECK-NEXT: for (int i = 0; i < 2; ++i)
+// CHECK-NEXT: a = 2;
+#pragma omp parallel
+#pragma omp master taskloop private(argc, b), firstprivate(argv, c), lastprivate(d, f) collapse(2) shared(g) if(argc) mergeable priority(argc) grainsize(argc) reduction(max: a, e)
+ for (int i = 0; i < 10; ++i)
+ for (int j = 0; j < 10; ++j)
+ foo();
+ // CHECK-NEXT: #pragma omp parallel
+ // CHECK-NEXT: #pragma omp master taskloop private(argc,b) firstprivate(argv,c) lastprivate(d,f) collapse(2) shared(g) if(argc) mergeable priority(argc) grainsize(argc) reduction(max: a,e)
+ // CHECK-NEXT: for (int i = 0; i < 10; ++i)
+ // CHECK-NEXT: for (int j = 0; j < 10; ++j)
+ // CHECK-NEXT: foo();
+ return (tmain<int, 5>(argc) + tmain<char, 1>(argv[0][0]));
+}
+
+#endif
diff --git a/src/llvm-project/clang/test/OpenMP/master_taskloop_codegen.cpp b/src/llvm-project/clang/test/OpenMP/master_taskloop_codegen.cpp
new file mode 100644
index 0000000..9b97400
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/master_taskloop_codegen.cpp
@@ -0,0 +1,225 @@
+// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp -x c++ -emit-llvm %s -o - -femit-all-decls | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-apple-darwin10 -include-pch %t -verify %s -emit-llvm -o - -femit-all-decls | FileCheck %s
+
+// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp-simd -x c++ -emit-llvm %s -o - -femit-all-decls | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -include-pch %t -verify %s -emit-llvm -o - -femit-all-decls | FileCheck --check-prefix SIMD-ONLY0 %s
+// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
+// expected-no-diagnostics
+#ifndef HEADER
+#define HEADER
+
+// CHECK-LABEL: @main
+int main(int argc, char **argv) {
+// CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* [[DEFLOC:@.+]])
+// CHECK: call i8* @__kmpc_omp_task_alloc(%struct.ident_t* [[DEFLOC]], i32 [[GTID]],
+// CHECK: call i32 @__kmpc_omp_task(%struct.ident_t* [[DEFLOC]], i32 [[GTID]],
+#pragma omp task
+ ;
+// CHECK: [[RES:%.+]] = call {{.*}}i32 @__kmpc_master(%struct.ident_t* [[DEFLOC]], i32 [[GTID]])
+// CHECK-NEXT: [[IS_MASTER:%.+]] = icmp ne i32 [[RES]], 0
+// CHECK-NEXT: br i1 [[IS_MASTER]], label {{%?}}[[THEN:.+]], label {{%?}}[[EXIT:.+]]
+// CHECK: [[THEN]]
+// CHECK: call void @__kmpc_taskgroup(%struct.ident_t* [[DEFLOC]], i32 [[GTID]])
+// CHECK: [[TASKV:%.+]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* [[DEFLOC]], i32 [[GTID]], i32 33, i64 80, i64 1, i32 (i32, i8*)* bitcast (i32 (i32, [[TDP_TY:%.+]]*)* [[TASK1:@.+]] to i32 (i32, i8*)*))
+// CHECK: [[TASK:%.+]] = bitcast i8* [[TASKV]] to [[TDP_TY]]*
+// CHECK: [[TASK_DATA:%.+]] = getelementptr inbounds [[TDP_TY]], [[TDP_TY]]* [[TASK]], i32 0, i32 0
+// CHECK: [[DOWN:%.+]] = getelementptr inbounds [[TD_TY:%.+]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 5
+// CHECK: store i64 0, i64* [[DOWN]],
+// CHECK: [[UP:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 6
+// CHECK: store i64 9, i64* [[UP]],
+// CHECK: [[ST:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 7
+// CHECK: store i64 1, i64* [[ST]],
+// CHECK: [[ST_VAL:%.+]] = load i64, i64* [[ST]],
+// CHECK: call void @__kmpc_taskloop(%struct.ident_t* [[DEFLOC]], i32 [[GTID]], i8* [[TASKV]], i32 1, i64* [[DOWN]], i64* [[UP]], i64 [[ST_VAL]], i32 1, i32 0, i64 0, i8* null)
+// CHECK: call void @__kmpc_end_taskgroup(%struct.ident_t* [[DEFLOC]], i32 [[GTID]])
+// CHECK-NEXT: call {{.*}}void @__kmpc_end_master(%struct.ident_t* [[DEFLOC]], i32 [[GTID]])
+// CHECK-NEXT: br label {{%?}}[[EXIT]]
+// CHECK: [[EXIT]]
+#pragma omp master taskloop priority(argc)
+ for (int i = 0; i < 10; ++i)
+ ;
+// CHECK: [[RES:%.+]] = call {{.*}}i32 @__kmpc_master(%struct.ident_t* [[DEFLOC]], i32 [[GTID]])
+// CHECK-NEXT: [[IS_MASTER:%.+]] = icmp ne i32 [[RES]], 0
+// CHECK-NEXT: br i1 [[IS_MASTER]], label {{%?}}[[THEN:.+]], label {{%?}}[[EXIT:.+]]
+// CHECK: [[THEN]]
+// CHECK: [[TASKV:%.+]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* [[DEFLOC]], i32 [[GTID]], i32 1, i64 80, i64 1, i32 (i32, i8*)* bitcast (i32 (i32, [[TDP_TY:%.+]]*)* [[TASK2:@.+]] to i32 (i32, i8*)*))
+// CHECK: [[TASK:%.+]] = bitcast i8* [[TASKV]] to [[TDP_TY]]*
+// CHECK: [[TASK_DATA:%.+]] = getelementptr inbounds [[TDP_TY]], [[TDP_TY]]* [[TASK]], i32 0, i32 0
+// CHECK: [[DOWN:%.+]] = getelementptr inbounds [[TD_TY:%.+]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 5
+// CHECK: store i64 0, i64* [[DOWN]],
+// CHECK: [[UP:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 6
+// CHECK: store i64 9, i64* [[UP]],
+// CHECK: [[ST:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 7
+// CHECK: store i64 1, i64* [[ST]],
+// CHECK: [[ST_VAL:%.+]] = load i64, i64* [[ST]],
+// CHECK: [[GRAINSIZE:%.+]] = zext i32 %{{.+}} to i64
+// CHECK: call void @__kmpc_taskloop(%struct.ident_t* [[DEFLOC]], i32 [[GTID]], i8* [[TASKV]], i32 1, i64* [[DOWN]], i64* [[UP]], i64 [[ST_VAL]], i32 1, i32 1, i64 [[GRAINSIZE]], i8* null)
+// CHECK-NEXT: call {{.*}}void @__kmpc_end_master(%struct.ident_t* [[DEFLOC]], i32 [[GTID]])
+// CHECK-NEXT: br label {{%?}}[[EXIT]]
+// CHECK: [[EXIT]]
+#pragma omp master taskloop nogroup grainsize(argc)
+ for (int i = 0; i < 10; ++i)
+ ;
+// CHECK: [[RES:%.+]] = call {{.*}}i32 @__kmpc_master(%struct.ident_t* [[DEFLOC]], i32 [[GTID]])
+// CHECK-NEXT: [[IS_MASTER:%.+]] = icmp ne i32 [[RES]], 0
+// CHECK-NEXT: br i1 [[IS_MASTER]], label {{%?}}[[THEN:.+]], label {{%?}}[[EXIT:.+]]
+// CHECK: [[THEN]]
+// CHECK: call void @__kmpc_taskgroup(%struct.ident_t* [[DEFLOC]], i32 [[GTID]])
+// CHECK: [[TASKV:%.+]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* [[DEFLOC]], i32 [[GTID]], i32 1, i64 80, i64 16, i32 (i32, i8*)* bitcast (i32 (i32, [[TDP_TY:%.+]]*)* [[TASK3:@.+]] to i32 (i32, i8*)*))
+// CHECK: [[TASK:%.+]] = bitcast i8* [[TASKV]] to [[TDP_TY]]*
+// CHECK: [[TASK_DATA:%.+]] = getelementptr inbounds [[TDP_TY]], [[TDP_TY]]* [[TASK]], i32 0, i32 0
+// CHECK: [[IF:%.+]] = icmp ne i32 %{{.+}}, 0
+// CHECK: [[IF_INT:%.+]] = sext i1 [[IF]] to i32
+// CHECK: [[DOWN:%.+]] = getelementptr inbounds [[TD_TY:%.+]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 5
+// CHECK: store i64 0, i64* [[DOWN]],
+// CHECK: [[UP:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 6
+// CHECK: store i64 %{{.+}}, i64* [[UP]],
+// CHECK: [[ST:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 7
+// CHECK: store i64 1, i64* [[ST]],
+// CHECK: [[ST_VAL:%.+]] = load i64, i64* [[ST]],
+// CHECK: call void @__kmpc_taskloop(%struct.ident_t* [[DEFLOC]], i32 [[GTID]], i8* [[TASKV]], i32 [[IF_INT]], i64* [[DOWN]], i64* [[UP]], i64 [[ST_VAL]], i32 1, i32 2, i64 4, i8* null)
+// CHECK: call void @__kmpc_end_taskgroup(%struct.ident_t* [[DEFLOC]], i32 [[GTID]])
+// CHECK-NEXT: call {{.*}}void @__kmpc_end_master(%struct.ident_t* [[DEFLOC]], i32 [[GTID]])
+// CHECK-NEXT: br label {{%?}}[[EXIT]]
+// CHECK: [[EXIT]]
+ int i;
+#pragma omp master taskloop if(argc) shared(argc, argv) collapse(2) num_tasks(4)
+ for (i = 0; i < argc; ++i)
+ for (int j = argc; j < argv[argc][argc]; ++j)
+ ;
+}
+
+// CHECK: define internal i32 [[TASK1]](
+// CHECK: [[DOWN:%.+]] = getelementptr inbounds [[TD_TY:%.+]], [[TD_TY]]* %{{.+}}, i32 0, i32 5
+// CHECK: [[DOWN_VAL:%.+]] = load i64, i64* [[DOWN]],
+// CHECK: [[UP:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 6
+// CHECK: [[UP_VAL:%.+]] = load i64, i64* [[UP]],
+// CHECK: [[ST:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 7
+// CHECK: [[ST_VAL:%.+]] = load i64, i64* [[ST]],
+// CHECK: [[LITER:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 8
+// CHECK: [[LITER_VAL:%.+]] = load i32, i32* [[LITER]],
+// CHECK: store i64 [[DOWN_VAL]], i64* [[LB:%[^,]+]],
+// CHECK: store i64 [[UP_VAL]], i64* [[UB:%[^,]+]],
+// CHECK: store i64 [[ST_VAL]], i64* [[ST:%[^,]+]],
+// CHECK: store i32 [[LITER_VAL]], i32* [[LITER:%[^,]+]],
+// CHECK: [[LB_VAL:%.+]] = load i64, i64* [[LB]],
+// CHECK: [[LB_I32:%.+]] = trunc i64 [[LB_VAL]] to i32
+// CHECK: store i32 [[LB_I32]], i32* [[CNT:%.+]],
+// CHECK: br label
+// CHECK: [[VAL:%.+]] = load i32, i32* [[CNT]],
+// CHECK: [[VAL_I64:%.+]] = sext i32 [[VAL]] to i64
+// CHECK: [[UB_VAL:%.+]] = load i64, i64* [[UB]],
+// CHECK: [[CMP:%.+]] = icmp ule i64 [[VAL_I64]], [[UB_VAL]]
+// CHECK: br i1 [[CMP]], label %{{.+}}, label %{{.+}}
+// CHECK: load i32, i32* %
+// CHECK: store i32 %
+// CHECK: load i32, i32* %
+// CHECK: add nsw i32 %{{.+}}, 1
+// CHECK: store i32 %{{.+}}, i32* %
+// CHECK: br label %
+// CHECK: ret i32 0
+
+// CHECK: define internal i32 [[TASK2]](
+// CHECK: [[DOWN:%.+]] = getelementptr inbounds [[TD_TY:%.+]], [[TD_TY]]* %{{.+}}, i32 0, i32 5
+// CHECK: [[DOWN_VAL:%.+]] = load i64, i64* [[DOWN]],
+// CHECK: [[UP:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 6
+// CHECK: [[UP_VAL:%.+]] = load i64, i64* [[UP]],
+// CHECK: [[ST:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 7
+// CHECK: [[ST_VAL:%.+]] = load i64, i64* [[ST]],
+// CHECK: [[LITER:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 8
+// CHECK: [[LITER_VAL:%.+]] = load i32, i32* [[LITER]],
+// CHECK: store i64 [[DOWN_VAL]], i64* [[LB:%[^,]+]],
+// CHECK: store i64 [[UP_VAL]], i64* [[UB:%[^,]+]],
+// CHECK: store i64 [[ST_VAL]], i64* [[ST:%[^,]+]],
+// CHECK: store i32 [[LITER_VAL]], i32* [[LITER:%[^,]+]],
+// CHECK: [[LB_VAL:%.+]] = load i64, i64* [[LB]],
+// CHECK: [[LB_I32:%.+]] = trunc i64 [[LB_VAL]] to i32
+// CHECK: store i32 [[LB_I32]], i32* [[CNT:%.+]],
+// CHECK: br label
+// CHECK: [[VAL:%.+]] = load i32, i32* [[CNT]],
+// CHECK: [[VAL_I64:%.+]] = sext i32 [[VAL]] to i64
+// CHECK: [[UB_VAL:%.+]] = load i64, i64* [[UB]],
+// CHECK: [[CMP:%.+]] = icmp ule i64 [[VAL_I64]], [[UB_VAL]]
+// CHECK: br i1 [[CMP]], label %{{.+}}, label %{{.+}}
+// CHECK: load i32, i32* %
+// CHECK: store i32 %
+// CHECK: load i32, i32* %
+// CHECK: add nsw i32 %{{.+}}, 1
+// CHECK: store i32 %{{.+}}, i32* %
+// CHECK: br label %
+// CHECK: ret i32 0
+
+// CHECK: define internal i32 [[TASK3]](
+// CHECK: [[DOWN:%.+]] = getelementptr inbounds [[TD_TY:%.+]], [[TD_TY]]* %{{.+}}, i32 0, i32 5
+// CHECK: [[DOWN_VAL:%.+]] = load i64, i64* [[DOWN]],
+// CHECK: [[UP:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 6
+// CHECK: [[UP_VAL:%.+]] = load i64, i64* [[UP]],
+// CHECK: [[ST:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 7
+// CHECK: [[ST_VAL:%.+]] = load i64, i64* [[ST]],
+// CHECK: [[LITER:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 8
+// CHECK: [[LITER_VAL:%.+]] = load i32, i32* [[LITER]],
+// CHECK: store i64 [[DOWN_VAL]], i64* [[LB:%[^,]+]],
+// CHECK: store i64 [[UP_VAL]], i64* [[UB:%[^,]+]],
+// CHECK: store i64 [[ST_VAL]], i64* [[ST:%[^,]+]],
+// CHECK: store i32 [[LITER_VAL]], i32* [[LITER:%[^,]+]],
+// CHECK: [[LB_VAL:%.+]] = load i64, i64* [[LB]],
+// CHECK: store i64 [[LB_VAL]], i64* [[CNT:%.+]],
+// CHECK: br label
+// CHECK: ret i32 0
+
+// CHECK-LABEL: @_ZN1SC2Ei
+struct S {
+ int a;
+ S(int c) {
+// CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* [[DEFLOC:@.+]])
+// CHECK: [[TASKV:%.+]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* [[DEFLOC]], i32 [[GTID]], i32 1, i64 80, i64 16, i32 (i32, i8*)* bitcast (i32 (i32, [[TDP_TY:%.+]]*)* [[TASK4:@.+]] to i32 (i32, i8*)*))
+// CHECK: [[TASK:%.+]] = bitcast i8* [[TASKV]] to [[TDP_TY]]*
+// CHECK: [[TASK_DATA:%.+]] = getelementptr inbounds [[TDP_TY]], [[TDP_TY]]* [[TASK]], i32 0, i32 0
+// CHECK: [[DOWN:%.+]] = getelementptr inbounds [[TD_TY:%.+]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 5
+// CHECK: store i64 0, i64* [[DOWN]],
+// CHECK: [[UP:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 6
+// CHECK: store i64 %{{.+}}, i64* [[UP]],
+// CHECK: [[ST:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 7
+// CHECK: store i64 1, i64* [[ST]],
+// CHECK: [[ST_VAL:%.+]] = load i64, i64* [[ST]],
+// CHECK: [[NUM_TASKS:%.+]] = zext i32 %{{.+}} to i64
+// CHECK: call void @__kmpc_taskloop(%struct.ident_t* [[DEFLOC]], i32 [[GTID]], i8* [[TASKV]], i32 1, i64* [[DOWN]], i64* [[UP]], i64 [[ST_VAL]], i32 1, i32 2, i64 [[NUM_TASKS]], i8* null)
+#pragma omp master taskloop shared(c) num_tasks(a)
+ for (a = 0; a < c; ++a)
+ ;
+ }
+} s(1);
+
+// CHECK: define internal i32 [[TASK4]](
+// CHECK: [[DOWN:%.+]] = getelementptr inbounds [[TD_TY:%.+]], [[TD_TY]]* %{{.+}}, i32 0, i32 5
+// CHECK: [[DOWN_VAL:%.+]] = load i64, i64* [[DOWN]],
+// CHECK: [[UP:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 6
+// CHECK: [[UP_VAL:%.+]] = load i64, i64* [[UP]],
+// CHECK: [[ST:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 7
+// CHECK: [[ST_VAL:%.+]] = load i64, i64* [[ST]],
+// CHECK: [[LITER:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 8
+// CHECK: [[LITER_VAL:%.+]] = load i32, i32* [[LITER]],
+// CHECK: store i64 [[DOWN_VAL]], i64* [[LB:%[^,]+]],
+// CHECK: store i64 [[UP_VAL]], i64* [[UB:%[^,]+]],
+// CHECK: store i64 [[ST_VAL]], i64* [[ST:%[^,]+]],
+// CHECK: store i32 [[LITER_VAL]], i32* [[LITER:%[^,]+]],
+// CHECK: [[LB_VAL:%.+]] = load i64, i64* [[LB]],
+// CHECK: [[LB_I32:%.+]] = trunc i64 [[LB_VAL]] to i32
+// CHECK: store i32 [[LB_I32]], i32* [[CNT:%.+]],
+// CHECK: br label
+// CHECK: [[VAL:%.+]] = load i32, i32* [[CNT]],
+// CHECK: [[VAL_I64:%.+]] = sext i32 [[VAL]] to i64
+// CHECK: [[UB_VAL:%.+]] = load i64, i64* [[UB]],
+// CHECK: [[CMP:%.+]] = icmp ule i64 [[VAL_I64]], [[UB_VAL]]
+// CHECK: br i1 [[CMP]], label %{{.+}}, label %{{.+}}
+// CHECK: load i32, i32* %
+// CHECK: store i32 %
+// CHECK: load i32, i32* %
+// CHECK: add nsw i32 %{{.+}}, 1
+// CHECK: store i32 %{{.+}}, i32* %
+// CHECK: br label %
+// CHECK: ret i32 0
+
+#endif
diff --git a/src/llvm-project/clang/test/OpenMP/master_taskloop_collapse_messages.cpp b/src/llvm-project/clang/test/OpenMP/master_taskloop_collapse_messages.cpp
new file mode 100644
index 0000000..83e5b85
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/master_taskloop_collapse_messages.cpp
@@ -0,0 +1,110 @@
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
+
+void foo() {
+}
+
+#if __cplusplus >= 201103L
+// expected-note@+2 4 {{declared here}}
+#endif
+bool foobool(int argc) {
+ return argc;
+}
+
+struct S1; // expected-note {{declared here}}
+
+template <class T, typename S, int N, int ST> // expected-note {{declared here}}
+T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
+ #pragma omp master taskloop collapse // expected-error {{expected '(' after 'collapse'}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp master taskloop collapse ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp master taskloop collapse () // expected-error {{expected expression}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ // expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
+ // expected-error@+2 2 {{expression is not an integral constant expression}}
+ // expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
+ #pragma omp master taskloop collapse (argc
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ // expected-error@+1 2 {{argument to 'collapse' clause must be a strictly positive integer value}}
+ #pragma omp master taskloop collapse (ST // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp master taskloop collapse (1)) // expected-warning {{extra tokens at the end of '#pragma omp master taskloop' are ignored}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp master taskloop collapse ((ST > 0) ? 1 + ST : 2) // expected-note 2 {{as specified in 'collapse' clause}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp master taskloop', but found only 1}}
+ // expected-error@+6 2 {{directive '#pragma omp master taskloop' cannot contain more than one 'collapse' clause}}
+ // expected-error@+5 {{argument to 'collapse' clause must be a strictly positive integer value}}
+ // expected-error@+4 2 {{expression is not an integral constant expression}}
+#if __cplusplus >= 201103L
+ // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
+#endif
+ #pragma omp master taskloop collapse (foobool(argc)), collapse (true), collapse (-5)
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp master taskloop collapse (S) // expected-error {{'S' does not refer to a value}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+#if __cplusplus <= 199711L
+ // expected-error@+4 2 {{expression is not an integral constant expression}}
+#else
+ // expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
+#endif
+ #pragma omp master taskloop collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp master taskloop collapse (1)
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp master taskloop collapse (N) // expected-error {{argument to 'collapse' clause must be a strictly positive integer value}}
+ for (T i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp master taskloop collapse (2) // expected-note {{as specified in 'collapse' clause}}
+ foo(); // expected-error {{expected 2 for loops after '#pragma omp master taskloop'}}
+ return argc;
+}
+
+int main(int argc, char **argv) {
+ #pragma omp master taskloop collapse // expected-error {{expected '(' after 'collapse'}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ #pragma omp master taskloop collapse ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ #pragma omp master taskloop collapse () // expected-error {{expected expression}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ #pragma omp master taskloop collapse (4 // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-note {{as specified in 'collapse' clause}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp master taskloop', but found only 1}}
+ #pragma omp master taskloop collapse (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp master taskloop' are ignored}} expected-note {{as specified in 'collapse' clause}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp master taskloop', but found only 1}}
+ // expected-error@+4 {{expression is not an integral constant expression}}
+#if __cplusplus >= 201103L
+ // expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
+#endif
+ #pragma omp master taskloop collapse (foobool(1) > 0 ? 1 : 2)
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ // expected-error@+6 {{expression is not an integral constant expression}}
+#if __cplusplus >= 201103L
+ // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
+#endif
+ // expected-error@+2 2 {{directive '#pragma omp master taskloop' cannot contain more than one 'collapse' clause}}
+ // expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}}
+ #pragma omp master taskloop collapse (foobool(argc)), collapse (true), collapse (-5)
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ #pragma omp master taskloop collapse (S1) // expected-error {{'S1' does not refer to a value}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+#if __cplusplus <= 199711L
+ // expected-error@+4 {{expression is not an integral constant expression}}
+#else
+ // expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
+#endif
+ #pragma omp master taskloop collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ // expected-error@+3 {{statement after '#pragma omp master taskloop' must be a for loop}}
+ // expected-note@+1 {{in instantiation of function template specialization 'tmain<int, char, -1, -2>' requested here}}
+ #pragma omp master taskloop collapse(collapse(tmain<int, char, -1, -2>(argc, argv) // expected-error 2 {{expected ')'}} expected-note 2 {{to match this '('}}
+ foo();
+ #pragma omp master taskloop collapse (2) // expected-note {{as specified in 'collapse' clause}}
+ foo(); // expected-error {{expected 2 for loops after '#pragma omp master taskloop'}}
+ // expected-note@+1 {{in instantiation of function template specialization 'tmain<int, char, 1, 0>' requested here}}
+ return tmain<int, char, 1, 0>(argc, argv);
+}
+
diff --git a/src/llvm-project/clang/test/OpenMP/master_taskloop_final_messages.cpp b/src/llvm-project/clang/test/OpenMP/master_taskloop_final_messages.cpp
new file mode 100644
index 0000000..caa507c
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/master_taskloop_final_messages.cpp
@@ -0,0 +1,94 @@
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+struct S1; // expected-note {{declared here}}
+
+template <class T, class S> // expected-note {{declared here}}
+int tmain(T argc, S **argv) {
+ T z;
+#pragma omp master taskloop final // expected-error {{expected '(' after 'final'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop final( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop final() // expected-error {{expected expression}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop final(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop final(argc)) // expected-warning {{extra tokens at the end of '#pragma omp master taskloop' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop final(argc > 0 ? argv[1] : argv[2] + z)
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop final(foobool(argc)), final(true) // expected-error {{directive '#pragma omp master taskloop' cannot contain more than one 'final' clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop final(S) // expected-error {{'S' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop final(argv[1] = 2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop final(argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop final(argc)
+ for (int i = 0; i < 10; ++i)
+ foo();
+
+ return 0;
+}
+
+int main(int argc, char **argv) {
+ int z;
+#pragma omp master taskloop final // expected-error {{expected '(' after 'final'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop final( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop final() // expected-error {{expected expression}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop final(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop final(argc)) // expected-warning {{extra tokens at the end of '#pragma omp master taskloop' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop final(argc > 0 ? argv[1] : argv[2] - z)
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop final(foobool(argc)), final(true) // expected-error {{directive '#pragma omp master taskloop' cannot contain more than one 'final' clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop final(S1) // expected-error {{'S1' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop final(argv[1] = 2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop final(argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop final(1 0) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop final(if (tmain(argc, argv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+
+ return tmain(argc, argv);
+}
diff --git a/src/llvm-project/clang/test/OpenMP/master_taskloop_firstprivate_codegen.cpp b/src/llvm-project/clang/test/OpenMP/master_taskloop_firstprivate_codegen.cpp
new file mode 100644
index 0000000..6d78ea5
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/master_taskloop_firstprivate_codegen.cpp
@@ -0,0 +1,538 @@
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-apple-darwin10 -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=LAMBDA %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=BLOCKS %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DARRAY -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=ARRAY %s
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DARRAY -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
+// expected-no-diagnostics
+
+#ifndef ARRAY
+#ifndef HEADER
+#define HEADER
+
+template <class T>
+struct S {
+ T f;
+ S(T a) : f(a) {}
+ S() : f() {}
+ S(const S &s, T t = T()) : f(s.f + t) {}
+ operator T() { return T(); }
+ ~S() {}
+};
+
+volatile double g;
+
+// CHECK-DAG: [[KMP_TASK_T_TY:%.+]] = type { i8*, i32 (i32, i8*)*, i32, %union{{.+}}, %union{{.+}}, i64, i64, i64, i32, i8* }
+// CHECK-DAG: [[S_DOUBLE_TY:%.+]] = type { double }
+// CHECK-DAG: [[PRIVATES_MAIN_TY:%.+]] = type {{.?}}{ [2 x [[S_DOUBLE_TY]]], [[S_DOUBLE_TY]], i32, [2 x i32]
+// CHECK-DAG: [[CAP_MAIN_TY:%.+]] = type {{.*}}{ [2 x i32]*, i32, {{.*}}[2 x [[S_DOUBLE_TY]]]*, [[S_DOUBLE_TY]]*, i{{[0-9]+}}
+// CHECK-DAG: [[KMP_TASK_MAIN_TY:%.+]] = type { [[KMP_TASK_T_TY]], [[PRIVATES_MAIN_TY]] }
+// CHECK-DAG: [[S_INT_TY:%.+]] = type { i32 }
+// CHECK-DAG: [[CAP_TMAIN_TY:%.+]] = type { [2 x i32]*, i32*, [2 x [[S_INT_TY]]]*, [[S_INT_TY]]* }
+// CHECK-DAG: [[PRIVATES_TMAIN_TY:%.+]] = type { i32, [2 x i32], [2 x [[S_INT_TY]]], [[S_INT_TY]], [104 x i8] }
+// CHECK-DAG: [[KMP_TASK_TMAIN_TY:%.+]] = type { [[KMP_TASK_T_TY]], [{{[0-9]+}} x i8], [[PRIVATES_TMAIN_TY]] }
+template <typename T>
+T tmain() {
+ S<T> ttt;
+ S<T> test(ttt);
+ T t_var __attribute__((aligned(128))) = T();
+ T vec[] = {1, 2};
+ S<T> s_arr[] = {1, 2};
+ S<T> var(3);
+#pragma omp master taskloop firstprivate(t_var, vec, s_arr, s_arr, var, var)
+ for (int i = 0; i < 10; ++i) {
+ vec[0] = t_var;
+ s_arr[0] = var;
+ }
+ return T();
+}
+
+int main() {
+ static int sivar;
+#ifdef LAMBDA
+ // LAMBDA: [[G:@.+]] = global double
+ // LAMBDA: [[SIVAR:@.+]] = internal global i{{[0-9]+}} 0,
+ // LAMBDA-LABEL: @main
+ // LAMBDA: call{{( x86_thiscallcc)?}} void [[OUTER_LAMBDA:@.+]](
+ [&]() {
+ // LAMBDA: define{{.*}} internal{{.*}} void [[OUTER_LAMBDA]](
+// LAMBDA: [[RES:%.+]] = call {{.*}}i32 @__kmpc_master(
+// LAMBDA-NEXT: [[IS_MASTER:%.+]] = icmp ne i32 [[RES]], 0
+// LAMBDA-NEXT: br i1 [[IS_MASTER]], label {{%?}}[[THEN:.+]], label {{%?}}[[EXIT:.+]]
+// LAMBDA: [[THEN]]
+// LAMBDA: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc(%{{[^ ]+}} @{{[^,]+}}, i32 %{{[^,]+}}, i32 1, i64 96, i64 16, i32 (i32, i8*)* bitcast (i32 (i32, %{{[^*]+}}*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+// LAMBDA: [[PRIVATES:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i{{.+}} 0, i{{.+}} 1
+// LAMBDA: [[G_PRIVATE_ADDR:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[PRIVATES]], i{{.+}} 0, i{{.+}} 0
+// LAMBDA: [[G_ADDR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i{{.+}} 0, i{{.+}} 0
+// LAMBDA: [[G_VAL:%.+]] = load volatile double, double* [[G_ADDR_REF]]
+// LAMBDA: store volatile double [[G_VAL]], double* [[G_PRIVATE_ADDR]]
+
+// LAMBDA: [[SIVAR_PRIVATE_ADDR:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
+// LAMBDA: [[SIVAR_ADDR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i{{.+}} 0, i{{.+}} 1
+// LAMBDA: [[SIVAR_VAL:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[SIVAR_ADDR_REF]]
+// LAMBDA: store i{{[0-9]+}} [[SIVAR_VAL]], i{{[0-9]+}}* [[SIVAR_PRIVATE_ADDR]]
+
+// LAMBDA: call void @__kmpc_taskloop(%{{.+}}* @{{.+}}, i32 %{{.+}}, i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* null)
+// LAMBDA: call {{.*}}void @__kmpc_end_master(
+// LAMBDA-NEXT: br label {{%?}}[[EXIT]]
+// LAMBDA: [[EXIT]]
+// LAMBDA: ret
+#pragma omp master taskloop firstprivate(g, sivar)
+ for (int i = 0; i < 10; ++i) {
+ // LAMBDA: define {{.+}} void [[INNER_LAMBDA:@.+]](%{{.+}}* [[ARG_PTR:%.+]])
+ // LAMBDA: store %{{.+}}* [[ARG_PTR]], %{{.+}}** [[ARG_PTR_REF:%.+]],
+ // LAMBDA: [[ARG_PTR:%.+]] = load %{{.+}}*, %{{.+}}** [[ARG_PTR_REF]]
+ // LAMBDA: [[G_PTR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[ARG_PTR]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+ // LAMBDA: [[G_REF:%.+]] = load double*, double** [[G_PTR_REF]]
+ // LAMBDA: store double 2.0{{.+}}, double* [[G_REF]]
+
+ // LAMBDA: store double* %{{.+}}, double** %{{.+}},
+ // LAMBDA: define internal i32 [[TASK_ENTRY]](i32 %0, %{{.+}}* noalias %1)
+ g = 1;
+ sivar = 11;
+ // LAMBDA: store double 1.0{{.+}}, double* %{{.+}},
+ // LAMBDA: store i{{[0-9]+}} 11, i{{[0-9]+}}* %{{.+}},
+ // LAMBDA: call void [[INNER_LAMBDA]](%
+ // LAMBDA: ret
+ [&]() {
+ g = 2;
+ sivar = 22;
+ }();
+ }
+ }();
+ return 0;
+#elif defined(BLOCKS)
+ // BLOCKS: [[G:@.+]] = global double
+ // BLOCKS-LABEL: @main
+ // BLOCKS: call void {{%.+}}(i8
+ ^{
+ // BLOCKS: define{{.*}} internal{{.*}} void {{.+}}(i8*
+ // BLOCKS: [[RES:%.+]] = call {{.*}}i32 @__kmpc_master(
+ // BLOCKS-NEXT: [[IS_MASTER:%.+]] = icmp ne i32 [[RES]], 0
+ // BLOCKS-NEXT: br i1 [[IS_MASTER]], label {{%?}}[[THEN:.+]], label {{%?}}[[EXIT:.+]]
+ // BLOCKS: [[THEN]]
+ // BLOCKS: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc(%{{[^ ]+}} @{{[^,]+}}, i32 %{{[^,]+}}, i32 1, i64 96, i64 16, i32 (i32, i8*)* bitcast (i32 (i32, %{{[^*]+}}*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+ // BLOCKS: [[PRIVATES:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i{{.+}} 0, i{{.+}} 1
+ // BLOCKS: [[G_PRIVATE_ADDR:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[PRIVATES]], i{{.+}} 0, i{{.+}} 0
+ // BLOCKS: [[G_ADDR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i{{.+}} 0, i{{.+}} 0
+ // BLOCKS: [[G_VAL:%.+]] = load volatile double, double* [[G_ADDR_REF]]
+ // BLOCKS: store volatile double [[G_VAL]], double* [[G_PRIVATE_ADDR]]
+
+ // BLOCKS: [[SIVAR_PRIVATE_ADDR:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
+ // BLOCKS: [[SIVAR_ADDR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i{{.+}} 0, i{{.+}} 1
+ // BLOCKS: [[SIVAR_VAL:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[SIVAR_ADDR_REF]]
+ // BLOCKS: store i{{[0-9]+}} [[SIVAR_VAL]], i{{[0-9]+}}* [[SIVAR_PRIVATE_ADDR]]
+ // BLOCKS: call void @__kmpc_taskloop(%{{.+}}* @{{.+}}, i32 %{{.+}}, i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* null)
+ // BLOCKS: call {{.*}}void @__kmpc_end_master(
+ // BLOCKS-NEXT: br label {{%?}}[[EXIT]]
+ // BLOCKS: [[EXIT]]
+ // BLOCKS: ret
+#pragma omp master taskloop firstprivate(g, sivar)
+ for (int i = 0; i < 10; ++i) {
+ // BLOCKS: define {{.+}} void {{@.+}}(i8*
+ // BLOCKS-NOT: [[G]]{{[[^:word:]]}}
+ // BLOCKS: store double 2.0{{.+}}, double*
+ // BLOCKS-NOT: [[G]]{{[[^:word:]]}}
+ // BLOCKS-NOT: [[ISVAR]]{{[[^:word:]]}}
+ // BLOCKS: store i{{[0-9]+}} 22, i{{[0-9]+}}*
+ // BLOCKS-NOT: [[SIVAR]]{{[[^:word:]]}}
+ // BLOCKS: ret
+
+ // BLOCKS: store double* %{{.+}}, double** %{{.+}},
+ // BLOCKS: store i{{[0-9]+}}* %{{.+}}, i{{[0-9]+}}** %{{.+}},
+ // BLOCKS: define internal i32 [[TASK_ENTRY]](i32 %0, %{{.+}}* noalias %1)
+ g = 1;
+ sivar = 11;
+ // BLOCKS: store double 1.0{{.+}}, double* %{{.+}},
+ // BLOCKS-NOT: [[G]]{{[[^:word:]]}}
+ // BLOCKS: store i{{[0-9]+}} 11, i{{[0-9]+}}* %{{.+}},
+ // BLOCKS-NOT: [[SIVAR]]{{[[^:word:]]}}
+ // BLOCKS: call void {{%.+}}(i8
+ ^{
+ g = 2;
+ sivar = 22;
+ }();
+ }
+ }();
+ return 0;
+#else
+ S<double> ttt;
+ S<double> test(ttt);
+ int t_var = 0;
+ int vec[] = {1, 2};
+ S<double> s_arr[] = {1, 2};
+ S<double> var(3);
+#pragma omp master taskloop firstprivate(var, t_var, s_arr, vec, s_arr, var, sivar)
+ for (int i = 0; i < 10; ++i) {
+ vec[0] = t_var;
+ s_arr[0] = var;
+ sivar = 33;
+ }
+ return tmain<int>();
+#endif
+}
+
+// CHECK: [[SIVAR:.+]] = internal global i{{[0-9]+}} 0,
+// CHECK: define i{{[0-9]+}} @main()
+// CHECK: alloca [[S_DOUBLE_TY]],
+// CHECK: [[TEST:%.+]] = alloca [[S_DOUBLE_TY]],
+// CHECK: [[T_VAR_ADDR:%.+]] = alloca i32,
+// CHECK: [[VEC_ADDR:%.+]] = alloca [2 x i32],
+// CHECK: [[S_ARR_ADDR:%.+]] = alloca [2 x [[S_DOUBLE_TY]]],
+// CHECK: [[VAR_ADDR:%.+]] = alloca [[S_DOUBLE_TY]],
+// CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num([[LOC:%.+]])
+
+// CHECK: call {{.*}} [[S_DOUBLE_TY_COPY_CONSTR:@.+]]([[S_DOUBLE_TY]]* [[TEST]],
+
+// CHECK: [[RES:%.+]] = call {{.*}}i32 @__kmpc_master(
+// CHECK-NEXT: [[IS_MASTER:%.+]] = icmp ne i32 [[RES]], 0
+// CHECK-NEXT: br i1 [[IS_MASTER]], label {{%?}}[[THEN:.+]], label {{%?}}[[EXIT:.+]]
+// CHECK: [[THEN]]
+// Store original variables in capture struct.
+// CHECK: [[VEC_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: store [2 x i32]* [[VEC_ADDR]], [2 x i32]** [[VEC_REF]],
+// CHECK: [[T_VAR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 1
+// CHECK: [[T_VAR_VAL:%.+]] = load i32, i32* [[T_VAR_ADDR]],
+// CHECK: store i32 [[T_VAR_VAL]], i32* [[T_VAR_REF]],
+// CHECK: [[S_ARR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 3
+// CHECK: store [2 x [[S_DOUBLE_TY]]]* [[S_ARR_ADDR]], [2 x [[S_DOUBLE_TY]]]** [[S_ARR_REF]],
+// CHECK: [[VAR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 4
+// CHECK: store [[S_DOUBLE_TY]]* [[VAR_ADDR]], [[S_DOUBLE_TY]]** [[VAR_REF]],
+// CHECK: [[SIVAR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 5
+// CHECK: [[SIVAR_VAL:%.+]] = load i32, i32* [[SIVAR]],
+// CHECK: store i{{[0-9]+}} [[SIVAR_VAL]], i{{[0-9]+}}* [[SIVAR_REF]],
+
+// Allocate task.
+// Returns struct kmp_task_t {
+// [[KMP_TASK_T]] task_data;
+// [[KMP_TASK_MAIN_TY]] privates;
+// };
+// CHECK: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc([[LOC]], i32 [[GTID]], i32 9, i64 120, i64 40, i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_MAIN_TY]]*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+// CHECK: [[RES_KMP_TASK:%.+]] = bitcast i8* [[RES]] to [[KMP_TASK_MAIN_TY]]*
+
+// Fill kmp_task_t->shareds by copying from original capture argument.
+// CHECK: [[TASK:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: [[SHAREDS_REF_ADDR:%.+]] = getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* [[TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: [[SHAREDS_REF:%.+]] = load i8*, i8** [[SHAREDS_REF_ADDR]],
+// CHECK: [[CAPTURES_ADDR:%.+]] = bitcast [[CAP_MAIN_TY]]* %{{.+}} to i8*
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 [[SHAREDS_REF]], i8* align 8 [[CAPTURES_ADDR]], i64 40, i1 false)
+
+// Initialize kmp_task_t->privates with default values (no init for simple types, default constructors for classes).
+// Also copy address of private copy to the corresponding shareds reference.
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
+// CHECK: [[SHAREDS:%.+]] = bitcast i8* [[SHAREDS_REF]] to [[CAP_MAIN_TY]]*
+
+// Constructors for s_arr and var.
+// s_arr;
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: [[S_ARR_ADDR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* [[SHAREDS]], i{{.+}} 0, i{{.+}} 3
+// CHECK: load [2 x [[S_DOUBLE_TY]]]*, [2 x [[S_DOUBLE_TY]]]** [[S_ARR_ADDR_REF]],
+// CHECK: call void [[S_DOUBLE_TY_COPY_CONSTR]]([[S_DOUBLE_TY]]* [[S_ARR_CUR:%[^,]+]],
+// CHECK: getelementptr [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* [[S_ARR_CUR]], i{{.+}} 1
+// CHECK: getelementptr [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i{{.+}} 1
+// CHECK: icmp eq
+// CHECK: br i1
+
+// var;
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
+// CHECK: [[VAR_ADDR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* [[SHAREDS]], i{{.+}} 0, i{{.+}} 4
+// CHECK: [[VAR_REF:%.+]] = load [[S_DOUBLE_TY]]*, [[S_DOUBLE_TY]]** [[VAR_ADDR_REF]],
+// CHECK: call void [[S_DOUBLE_TY_COPY_CONSTR]]([[S_DOUBLE_TY]]* [[PRIVATE_VAR_REF]], [[S_DOUBLE_TY]]* {{.*}}[[VAR_REF]],
+
+// t_var;
+// CHECK: [[PRIVATE_T_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK: [[T_VAR_ADDR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* [[SHAREDS]], i{{.+}} 0, i{{.+}} 1
+// CHECK: [[T_VAR:%.+]] = load i{{.+}}, i{{.+}}* [[T_VAR_ADDR_REF]],
+// CHECK: store i32 [[T_VAR]], i32* [[PRIVATE_T_VAR_REF]],
+
+// vec;
+// CHECK: [[PRIVATE_VEC_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: [[VEC_ADDR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* [[SHAREDS]], i{{.+}} 0, i{{.+}} 0
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(
+
+// sivar;
+// CHECK: [[PRIVATE_SIVAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 4
+// CHECK: [[SIVAR_ADDR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* [[SHAREDS]], i{{.+}} 0, i{{.+}} 5
+// CHECK: [[SIVAR:%.+]] = load i{{.+}}, i{{.+}}* [[SIVAR_ADDR_REF]],
+// CHECK: store i32 [[SIVAR]], i32* [[PRIVATE_SIVAR_REF]],
+
+// Provide pointer to destructor function, which will destroy private variables at the end of the task.
+// CHECK: [[DESTRUCTORS_REF:%.+]] = getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* [[TASK]], i{{.+}} 0, i{{.+}} 3
+// CHECK: [[DESTRUCTORS_PTR:%.+]] = bitcast %union{{.+}}* [[DESTRUCTORS_REF]] to i32 (i32, i8*)**
+// CHECK: store i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_MAIN_TY]]*)* [[DESTRUCTORS:@.+]] to i32 (i32, i8*)*), i32 (i32, i8*)** [[DESTRUCTORS_PTR]],
+
+// Start task.
+// CHECK: call void @__kmpc_taskloop([[LOC]], i32 [[GTID]], i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* bitcast (void ([[KMP_TASK_MAIN_TY]]*, [[KMP_TASK_MAIN_TY]]*, i32)* [[MAIN_DUP:@.+]] to i8*))
+// CHECK: call {{.*}}void @__kmpc_end_master(
+// CHECK-NEXT: br label {{%?}}[[EXIT]]
+// CHECK: [[EXIT]]
+
+// CHECK: = call i{{.+}} [[TMAIN_INT:@.+]]()
+
+// No destructors must be called for private copies of s_arr and var.
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: call void [[S_DOUBLE_TY_DESTR:@.+]]([[S_DOUBLE_TY]]*
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: ret
+//
+
+// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_MAIN_TY]]* noalias %0, [[S_DOUBLE_TY]]** noalias %1, i32** noalias %2, [2 x [[S_DOUBLE_TY]]]** noalias %3, [2 x i32]** noalias %4, i32** noalias %5)
+// CHECK: [[PRIVATES:%.+]] = load [[PRIVATES_MAIN_TY]]*, [[PRIVATES_MAIN_TY]]**
+// CHECK: [[PRIV_S_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 0
+// CHECK: [[ARG3:%.+]] = load [2 x [[S_DOUBLE_TY]]]**, [2 x [[S_DOUBLE_TY]]]*** %{{.+}},
+// CHECK: store [2 x [[S_DOUBLE_TY]]]* [[PRIV_S_VAR]], [2 x [[S_DOUBLE_TY]]]** [[ARG3]],
+// CHECK: [[PRIV_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 1
+// CHECK: [[ARG1:%.+]] = load [[S_DOUBLE_TY]]**, [[S_DOUBLE_TY]]*** {{.+}},
+// CHECK: store [[S_DOUBLE_TY]]* [[PRIV_VAR]], [[S_DOUBLE_TY]]** [[ARG1]],
+// CHECK: [[PRIV_T_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 2
+// CHECK: [[ARG2:%.+]] = load i32**, i32*** %{{.+}},
+// CHECK: store i32* [[PRIV_T_VAR]], i32** [[ARG2]],
+// CHECK: [[PRIV_VEC:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 3
+// CHECK: [[ARG4:%.+]] = load [2 x i32]**, [2 x i32]*** %{{.+}},
+// CHECK: store [2 x i32]* [[PRIV_VEC]], [2 x i32]** [[ARG4]],
+// CHECK: [[PRIV_SIVAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 4
+// CHECK: [[ARG5:%.+]] = load i{{[0-9]+}}**, i{{[0-9]+}}*** %{{.+}},
+// CHECK: store i{{[0-9]+}}* [[PRIV_SIVAR]], i{{[0-9]+}}** [[ARG5]],
+// CHECK: ret void
+
+// CHECK: define internal i32 [[TASK_ENTRY]](i32 %0, [[KMP_TASK_MAIN_TY]]* noalias %1)
+
+// CHECK: [[PRIV_VAR_ADDR:%.+]] = alloca [[S_DOUBLE_TY]]*,
+// CHECK: [[PRIV_T_VAR_ADDR:%.+]] = alloca i32*,
+// CHECK: [[PRIV_S_ARR_ADDR:%.+]] = alloca [2 x [[S_DOUBLE_TY]]]*,
+// CHECK: [[PRIV_VEC_ADDR:%.+]] = alloca [2 x i32]*,
+// CHECK: [[PRIV_SIVAR_ADDR:%.+]] = alloca i32*,
+// CHECK: store void (i8*, ...)* bitcast (void ([[PRIVATES_MAIN_TY]]*, [[S_DOUBLE_TY]]**, i32**, [2 x [[S_DOUBLE_TY]]]**, [2 x i32]**, i32**)* [[PRIVATES_MAP_FN]] to void (i8*, ...)*), void (i8*, ...)** [[MAP_FN_ADDR:%.+]],
+// CHECK: [[MAP_FN:%.+]] = load void (i8*, ...)*, void (i8*, ...)** [[MAP_FN_ADDR]],
+
+// CHECK: call void (i8*, ...) [[MAP_FN]](i8* %{{.+}}, [[S_DOUBLE_TY]]** [[PRIV_VAR_ADDR]], i32** [[PRIV_T_VAR_ADDR]], [2 x [[S_DOUBLE_TY]]]** [[PRIV_S_ARR_ADDR]], [2 x i32]** [[PRIV_VEC_ADDR]], i32** [[PRIV_SIVAR_ADDR]])
+
+// CHECK: [[PRIV_VAR:%.+]] = load [[S_DOUBLE_TY]]*, [[S_DOUBLE_TY]]** [[PRIV_VAR_ADDR]],
+// CHECK: [[PRIV_T_VAR:%.+]] = load i32*, i32** [[PRIV_T_VAR_ADDR]],
+// CHECK: [[PRIV_S_ARR:%.+]] = load [2 x [[S_DOUBLE_TY]]]*, [2 x [[S_DOUBLE_TY]]]** [[PRIV_S_ARR_ADDR]],
+// CHECK: [[PRIV_VEC:%.+]] = load [2 x i32]*, [2 x i32]** [[PRIV_VEC_ADDR]],
+// CHECK: [[PRIV_SIVAR:%.+]] = load i32*, i32** [[PRIV_SIVAR_ADDR]],
+
+// Privates actually are used.
+// CHECK-DAG: [[PRIV_VAR]]
+// CHECK-DAG: [[PRIV_T_VAR]]
+// CHECK-DAG: [[PRIV_S_ARR]]
+// CHECK-DAG: [[PRIV_VEC]]
+// CHECK-DAG: [[PRIV_SIVAR]]
+
+// CHECK: ret
+
+// CHECK: define internal void [[MAIN_DUP]]([[KMP_TASK_MAIN_TY]]* %0, [[KMP_TASK_MAIN_TY]]* %1, i32 %2)
+// CHECK: getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* %{{.+}}, i32 0, i32 1
+// CHECK: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr inbounds [2 x [[S_DOUBLE_TY]]], [2 x [[S_DOUBLE_TY]]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i64 2
+// CHECK: br i1 %
+
+// CHECK: phi [[S_DOUBLE_TY]]*
+// CHECK: call {{.*}} [[S_DOUBLE_TY_COPY_CONSTR]]([[S_DOUBLE_TY]]*
+// CHECK: getelementptr [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i32 1
+// CHECK: icmp eq [[S_DOUBLE_TY]]* %
+// CHECK: br i1 %
+
+// CHECK: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* %{{.+}}, i32 0, i32 1
+// CHECK: call {{.*}} [[S_DOUBLE_TY_COPY_CONSTR]]([[S_DOUBLE_TY]]*
+// CHECK: ret void
+
+// CHECK: define internal i32 [[DESTRUCTORS]](i32 %0, [[KMP_TASK_MAIN_TY]]* noalias %1)
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 0
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
+// CHECK: call void [[S_DOUBLE_TY_DESTR]]([[S_DOUBLE_TY]]* [[PRIVATE_VAR_REF]])
+// CHECK: getelementptr inbounds [2 x [[S_DOUBLE_TY]]], [2 x [[S_DOUBLE_TY]]]* [[PRIVATE_S_ARR_REF]], i{{.+}} 0, i{{.+}} 0
+// CHECK: getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i{{.+}} 2
+// CHECK: [[PRIVATE_S_ARR_ELEM_REF:%.+]] = getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i{{.+}} -1
+// CHECK: call void [[S_DOUBLE_TY_DESTR]]([[S_DOUBLE_TY]]* [[PRIVATE_S_ARR_ELEM_REF]])
+// CHECK: icmp eq
+// CHECK: br i1
+// CHECK: ret i32
+
+// CHECK: define {{.*}} i{{[0-9]+}} [[TMAIN_INT]]()
+// CHECK: alloca [[S_INT_TY]],
+// CHECK: [[TEST:%.+]] = alloca [[S_INT_TY]],
+// CHECK: [[T_VAR_ADDR:%.+]] = alloca i32, align 128
+// CHECK: [[VEC_ADDR:%.+]] = alloca [2 x i32],
+// CHECK: [[S_ARR_ADDR:%.+]] = alloca [2 x [[S_INT_TY]]],
+// CHECK: [[VAR_ADDR:%.+]] = alloca [[S_INT_TY]],
+// CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num([[LOC:%.+]])
+
+// CHECK: call {{.*}} [[S_INT_TY_COPY_CONSTR:@.+]]([[S_INT_TY]]* [[TEST]],
+
+// Store original variables in capture struct.
+// CHECK: [[VEC_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: store [2 x i32]* [[VEC_ADDR]], [2 x i32]** [[VEC_REF]],
+// CHECK: [[T_VAR_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 1
+// CHECK: store i32* [[T_VAR_ADDR]], i32** [[T_VAR_REF]],
+// CHECK: [[S_ARR_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 2
+// CHECK: store [2 x [[S_INT_TY]]]* [[S_ARR_ADDR]], [2 x [[S_INT_TY]]]** [[S_ARR_REF]],
+// CHECK: [[VAR_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 3
+// CHECK: store [[S_INT_TY]]* [[VAR_ADDR]], [[S_INT_TY]]** [[VAR_REF]],
+
+// Allocate task.
+// Returns struct kmp_task_t {
+// [[KMP_TASK_T_TY]] task_data;
+// [[KMP_TASK_TMAIN_TY]] privates;
+// };
+// CHECK: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc([[LOC]], i32 [[GTID]], i32 9, i64 256, i64 32, i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_TMAIN_TY]]*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+// CHECK: [[RES_KMP_TASK:%.+]] = bitcast i8* [[RES]] to [[KMP_TASK_TMAIN_TY]]*
+
+// Fill kmp_task_t->shareds by copying from original capture argument.
+// CHECK: [[TASK:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: [[SHAREDS_REF_ADDR:%.+]] = getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* [[TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: [[SHAREDS_REF:%.+]] = load i8*, i8** [[SHAREDS_REF_ADDR]],
+// CHECK: [[CAPTURES_ADDR:%.+]] = bitcast [[CAP_TMAIN_TY]]* %{{.+}} to i8*
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 [[SHAREDS_REF]], i8* align 8 [[CAPTURES_ADDR]], i64 32, i1 false)
+
+// Initialize kmp_task_t->privates with default values (no init for simple types, default constructors for classes).
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
+// CHECK: [[SHAREDS:%.+]] = bitcast i8* [[SHAREDS_REF]] to [[CAP_TMAIN_TY]]*
+
+// t_var;
+// CHECK: [[PRIVATE_T_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 0
+// CHECK: [[T_VAR_ADDR_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* [[SHAREDS]], i{{.+}} 0, i{{.+}} 1
+// CHECK: [[T_VAR_REF:%.+]] = load i{{.+}}*, i{{.+}}** [[T_VAR_ADDR_REF]],
+// CHECK: [[T_VAR:%.+]] = load i{{.+}}, i{{.+}}* [[T_VAR_REF]], align 128
+// CHECK: store i32 [[T_VAR]], i32* [[PRIVATE_T_VAR_REF]], align 128
+
+// vec;
+// CHECK: [[PRIVATE_VEC_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
+// CHECK: [[VEC_ADDR_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* [[SHAREDS]], i{{.+}} 0, i{{.+}} 0
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(
+
+// Constructors for s_arr and var.
+// a_arr;
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
+// CHECK: [[S_ARR_ADDR_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* [[SHAREDS]], i{{.+}} 0, i{{.+}} 2
+// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* [[PRIVATE_S_ARR_REF]], i{{.+}} 0, i{{.+}} 0
+// CHECK: getelementptr [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i{{.+}} 2
+// CHECK: call void [[S_INT_TY_COPY_CONSTR]]([[S_INT_TY]]* [[S_ARR_CUR:%[^,]+]],
+// CHECK: getelementptr [[S_INT_TY]], [[S_INT_TY]]* [[S_ARR_CUR]], i{{.+}} 1
+// CHECK: icmp eq
+// CHECK: br i1
+
+// var;
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: [[VAR_ADDR_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* [[SHAREDS]], i{{.+}} 0, i{{.+}} 3
+// CHECK: call void [[S_INT_TY_COPY_CONSTR]]([[S_INT_TY]]* [[PRIVATE_VAR_REF]],
+
+// Provide pointer to destructor function, which will destroy private variables at the end of the task.
+// CHECK: [[DESTRUCTORS_REF:%.+]] = getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* [[TASK]], i{{.+}} 0, i{{.+}} 3
+// CHECK: [[DESTRUCTORS_PTR:%.+]] = bitcast %union{{.+}}* [[DESTRUCTORS_REF]] to i32 (i32, i8*)**
+// CHECK: store i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_TMAIN_TY]]*)* [[DESTRUCTORS:@.+]] to i32 (i32, i8*)*), i32 (i32, i8*)** [[DESTRUCTORS_PTR]],
+
+// Start task.
+// CHECK: call void @__kmpc_taskloop([[LOC]], i32 [[GTID]], i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* bitcast (void ([[KMP_TASK_TMAIN_TY]]*, [[KMP_TASK_TMAIN_TY]]*, i32)* [[TMAIN_DUP:@.+]] to i8*))
+
+// No destructors must be called for private copies of s_arr and var.
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: call void [[S_INT_TY_DESTR:@.+]]([[S_INT_TY]]*
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: ret
+//
+
+// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_TMAIN_TY]]* noalias %0, i32** noalias %1, [2 x i32]** noalias %2, [2 x [[S_INT_TY]]]** noalias %3, [[S_INT_TY]]** noalias %4)
+// CHECK: [[PRIVATES:%.+]] = load [[PRIVATES_TMAIN_TY]]*, [[PRIVATES_TMAIN_TY]]**
+// CHECK: [[PRIV_T_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 0
+// CHECK: [[ARG1:%.+]] = load i32**, i32*** %{{.+}},
+// CHECK: store i32* [[PRIV_T_VAR]], i32** [[ARG1]],
+// CHECK: [[PRIV_VEC:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 1
+// CHECK: [[ARG2:%.+]] = load [2 x i32]**, [2 x i32]*** %{{.+}},
+// CHECK: store [2 x i32]* [[PRIV_VEC]], [2 x i32]** [[ARG2]],
+// CHECK: [[PRIV_S_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 2
+// CHECK: [[ARG3:%.+]] = load [2 x [[S_INT_TY]]]**, [2 x [[S_INT_TY]]]*** %{{.+}},
+// CHECK: store [2 x [[S_INT_TY]]]* [[PRIV_S_VAR]], [2 x [[S_INT_TY]]]** [[ARG3]],
+// CHECK: [[PRIV_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 3
+// CHECK: [[ARG4:%.+]] = load [[S_INT_TY]]**, [[S_INT_TY]]*** {{.+}},
+// CHECK: store [[S_INT_TY]]* [[PRIV_VAR]], [[S_INT_TY]]** [[ARG4]],
+// CHECK: ret void
+
+// CHECK: define internal i32 [[TASK_ENTRY]](i32 %0, [[KMP_TASK_TMAIN_TY]]* noalias %1)
+// CHECK: alloca i32*,
+// CHECK-DAG: [[PRIV_T_VAR_ADDR:%.+]] = alloca i32*,
+// CHECK-DAG: [[PRIV_VEC_ADDR:%.+]] = alloca [2 x i32]*,
+// CHECK-DAG: [[PRIV_S_ARR_ADDR:%.+]] = alloca [2 x [[S_INT_TY]]]*,
+// CHECK-DAG: [[PRIV_VAR_ADDR:%.+]] = alloca [[S_INT_TY]]*,
+// CHECK: store void (i8*, ...)* bitcast (void ([[PRIVATES_TMAIN_TY]]*, i32**, [2 x i32]**, [2 x [[S_INT_TY]]]**, [[S_INT_TY]]**)* [[PRIVATES_MAP_FN]] to void (i8*, ...)*), void (i8*, ...)** [[MAP_FN_ADDR:%.+]],
+// CHECK: [[MAP_FN:%.+]] = load void (i8*, ...)*, void (i8*, ...)** [[MAP_FN_ADDR]],
+// CHECK: call void (i8*, ...) [[MAP_FN]](i8* %{{.+}}, i32** [[PRIV_T_VAR_ADDR]], [2 x i32]** [[PRIV_VEC_ADDR]], [2 x [[S_INT_TY]]]** [[PRIV_S_ARR_ADDR]], [[S_INT_TY]]** [[PRIV_VAR_ADDR]])
+// CHECK: [[PRIV_T_VAR:%.+]] = load i32*, i32** [[PRIV_T_VAR_ADDR]],
+// CHECK: [[PRIV_VEC:%.+]] = load [2 x i32]*, [2 x i32]** [[PRIV_VEC_ADDR]],
+// CHECK: [[PRIV_S_ARR:%.+]] = load [2 x [[S_INT_TY]]]*, [2 x [[S_INT_TY]]]** [[PRIV_S_ARR_ADDR]],
+// CHECK: [[PRIV_VAR:%.+]] = load [[S_INT_TY]]*, [[S_INT_TY]]** [[PRIV_VAR_ADDR]],
+
+// Privates actually are used.
+// CHECK-DAG: [[PRIV_VAR]]
+// CHECK-DAG: [[PRIV_T_VAR]]
+// CHECK-DAG: [[PRIV_S_ARR]]
+// CHECK-DAG: [[PRIV_VEC]]
+
+// CHECK: ret
+
+// CHECK: define internal void [[TMAIN_DUP]]([[KMP_TASK_TMAIN_TY]]* %0, [[KMP_TASK_TMAIN_TY]]* %1, i32 %2)
+// CHECK: getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* %{{.+}}, i32 0, i32 2
+// CHECK: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* %{{.+}}, i32 0, i32 2
+// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i64 2
+// CHECK: br i1 %
+
+// CHECK: phi [[S_INT_TY]]*
+// CHECK: call {{.*}} [[S_INT_TY_COPY_CONSTR]]([[S_INT_TY]]*
+// CHECK: getelementptr [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i32 1
+// CHECK: icmp eq [[S_INT_TY]]* %
+// CHECK: br i1 %
+
+// CHECK: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* %{{.+}}, i32 0, i32 3
+// CHECK: call {{.*}} [[S_INT_TY_COPY_CONSTR]]([[S_INT_TY]]*
+// CHECK: ret void
+
+// CHECK: define internal i32 [[DESTRUCTORS]](i32 %0, [[KMP_TASK_TMAIN_TY]]* noalias %1)
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: call void [[S_INT_TY_DESTR]]([[S_INT_TY]]* [[PRIVATE_VAR_REF]])
+// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* [[PRIVATE_S_ARR_REF]], i{{.+}} 0, i{{.+}} 0
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i{{.+}} 2
+// CHECK: [[PRIVATE_S_ARR_ELEM_REF:%.+]] = getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i{{.+}} -1
+// CHECK: call void [[S_INT_TY_DESTR]]([[S_INT_TY]]* [[PRIVATE_S_ARR_ELEM_REF]])
+// CHECK: icmp eq
+// CHECK: br i1
+// CHECK: ret i32
+
+#endif
+#else
+// ARRAY-LABEL: array_func
+struct St {
+ int a, b;
+ St() : a(0), b(0) {}
+ St(const St &) {}
+ ~St() {}
+};
+
+void array_func(int n, float a[n], St s[2]) {
+// ARRAY: call i8* @__kmpc_omp_task_alloc(
+// ARRAY: call void @__kmpc_taskloop(
+// ARRAY: store float** %{{.+}}, float*** %{{.+}},
+// ARRAY: store %struct.St** %{{.+}}, %struct.St*** %{{.+}},
+#pragma omp master taskloop firstprivate(a, s)
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+#endif
+
diff --git a/src/llvm-project/clang/test/OpenMP/master_taskloop_firstprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/master_taskloop_firstprivate_messages.cpp
new file mode 100644
index 0000000..0a4e7a8
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/master_taskloop_firstprivate_messages.cpp
@@ -0,0 +1,335 @@
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+
+typedef void **omp_allocator_handle_t;
+extern const omp_allocator_handle_t omp_default_mem_alloc;
+extern const omp_allocator_handle_t omp_large_cap_mem_alloc;
+extern const omp_allocator_handle_t omp_const_mem_alloc;
+extern const omp_allocator_handle_t omp_high_bw_mem_alloc;
+extern const omp_allocator_handle_t omp_low_lat_mem_alloc;
+extern const omp_allocator_handle_t omp_cgroup_mem_alloc;
+extern const omp_allocator_handle_t omp_pteam_mem_alloc;
+extern const omp_allocator_handle_t omp_thread_mem_alloc;
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp master taskloop firstprivate(fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
+struct S1; // expected-note 2 {{declared here}} expected-note 2 {{forward declaration of 'S1'}}
+extern S1 a;
+class S2 {
+ mutable int a;
+
+public:
+ S2() : a(0) {}
+ S2(const 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;
+ S3 &operator=(const S3 &s3);
+
+public:
+ S3() : a(0) {} // expected-note 2 {{candidate constructor not viable: requires 0 arguments, but 1 was provided}}
+ S3(S3 &s3) : a(s3.a) {} // expected-note 2 {{candidate constructor not viable: 1st argument ('const S3') would lose const qualifier}}
+};
+const S3 c;
+const S3 ca[5];
+extern const int f;
+class S4 {
+ int a;
+ S4();
+ S4(const S4 &s4); // expected-note 2 {{implicitly declared private here}}
+
+public:
+ S4(int v) : a(v) {}
+};
+class S5 {
+ int a;
+ S5(const S5 &s5) : a(s5.a) {} // expected-note 4 {{implicitly declared private here}}
+
+public:
+ S5() : a(0) {}
+ S5(int v) : a(v) {}
+};
+class S6 {
+ int a;
+ S6() : a(0) {}
+
+public:
+ S6(const S6 &s6) : a(s6.a) {}
+ S6(int v) : a(v) {}
+};
+
+S3 h;
+#pragma omp threadprivate(h) // expected-note 2 {{defined as threadprivate or thread local}}
+
+template <class I, class C>
+int foomain(int argc, char **argv) {
+ I e(4);
+ C g(5);
+ int i, z;
+ int &j = i;
+#pragma omp parallel
+#pragma omp master taskloop firstprivate // expected-error {{expected '(' after 'firstprivate'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop firstprivate( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop firstprivate() // expected-error {{expected expression}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop firstprivate(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop firstprivate(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop firstprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop allocate(omp_thread_mem_alloc: argc) firstprivate(argc) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'master taskloop' directive}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop firstprivate(S1) // expected-error {{'S1' does not refer to a value}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop firstprivate(a, b) // expected-error {{firstprivate variable with incomplete type 'S1'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop firstprivate(argv[1]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop firstprivate(z, e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop firstprivate(h) // expected-error {{threadprivate or thread local variable cannot be firstprivate}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+ {
+ int v = 0;
+ int i;
+#pragma omp master taskloop firstprivate(i)
+ for (int k = 0; k < argc; ++k) {
+ i = k;
+ v += i;
+ }
+ }
+#pragma omp parallel shared(i)
+#pragma omp parallel private(i)
+#pragma omp master taskloop firstprivate(j)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop firstprivate(i)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(g) firstprivate(g) // expected-error {{calling a private constructor of class 'S5'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel private(i)
+#pragma omp master taskloop firstprivate(i) // expected-note 2 {{defined as firstprivate}}
+ for (i = 0; i < argc; ++i) // expected-error 2 {{loop iteration variable in the associated loop of 'omp master taskloop' directive may not be firstprivate, predetermined as private}}
+ foo();
+#pragma omp parallel reduction(+ : i) // expected-note {{defined as reduction}}
+#pragma omp master taskloop firstprivate(i) // expected-note {{defined as firstprivate}} expected-error {{argument of a reduction clause of a parallel construct must not appear in a firstprivate clause on a task construct}}
+ for (i = 0; i < argc; ++i) // expected-error {{loop iteration variable in the associated loop of 'omp master taskloop' directive may not be firstprivate, predetermined as private}}
+ foo();
+ return 0;
+}
+
+void bar(S4 a[2]) {
+#pragma omp parallel
+#pragma omp master taskloop firstprivate(a)
+ for (int i = 0; i < 2; ++i)
+ foo();
+}
+
+namespace A {
+double x;
+#pragma omp threadprivate(x) // expected-note {{defined as threadprivate or thread local}}
+}
+namespace B {
+using A::x;
+}
+
+int main(int argc, char **argv) {
+ const int d = 5;
+ const int da[5] = {0};
+ S4 e(4);
+ S5 g(5);
+ S3 m;
+ S6 n(2);
+ int i;
+ int &j = i;
+#pragma omp parallel
+#pragma omp master taskloop firstprivate // expected-error {{expected '(' after 'firstprivate'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop firstprivate( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop firstprivate() // expected-error {{expected expression}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop firstprivate(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop firstprivate(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop firstprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop firstprivate(S1) // expected-error {{'S1' does not refer to a value}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop firstprivate(a, b, c, d, f) // expected-error {{firstprivate variable with incomplete type 'S1'}} expected-error {{no matching constructor for initialization of 'S3'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop firstprivate(argv[1]) // expected-error {{expected variable name}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop firstprivate(2 * 2) // expected-error {{expected variable name}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop firstprivate(ba) // OK
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop firstprivate(ca) // expected-error {{no matching constructor for initialization of 'S3'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop firstprivate(da) // OK
+ for (i = 0; i < argc; ++i)
+ foo();
+ int xa;
+#pragma omp parallel
+#pragma omp master taskloop firstprivate(xa) // OK
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop firstprivate(S2::S2s) // OK
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop firstprivate(S2::S2sc) // OK
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop safelen(5) // expected-error {{unexpected OpenMP clause 'safelen' in directive '#pragma omp master taskloop'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop firstprivate(e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop firstprivate(m) // OK
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop firstprivate(h) // expected-error {{threadprivate or thread local variable cannot be firstprivate}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop private(xa), firstprivate(xa) // expected-error {{private variable cannot be firstprivate}} expected-note {{defined as private}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop firstprivate(i) // expected-note {{defined as firstprivate}}
+ for (i = 0; i < argc; ++i) // expected-error {{loop iteration variable in the associated loop of 'omp master taskloop' directive may not be firstprivate, predetermined as private}}
+ foo();
+#pragma omp parallel shared(xa)
+#pragma omp master taskloop firstprivate(xa) // OK: may be firstprivate
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop firstprivate(j)
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(g) firstprivate(g) // expected-error {{calling a private constructor of class 'S5'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(n) firstprivate(n) // OK
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+ {
+ int v = 0;
+ int i;
+#pragma omp master taskloop firstprivate(i)
+ for (int k = 0; k < argc; ++k) {
+ i = k;
+ v += i;
+ }
+ }
+#pragma omp parallel private(i)
+#pragma omp master taskloop firstprivate(i) // expected-note {{defined as firstprivate}}
+ for (i = 0; i < argc; ++i) // expected-error {{loop iteration variable in the associated loop of 'omp master taskloop' directive may not be firstprivate, predetermined as private}}
+ foo();
+#pragma omp parallel reduction(+ : i) // expected-note {{defined as reduction}}
+#pragma omp master taskloop firstprivate(i) //expected-error {{argument of a reduction clause of a parallel construct must not appear in a firstprivate clause on a task construct}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp master taskloop firstprivate(i) //expected-note {{defined as firstprivate}}
+ for (i = 0; i < argc; ++i) // expected-error {{loop iteration variable in the associated loop of 'omp master taskloop' directive may not be firstprivate, predetermined as private}}
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop firstprivate(B::x) // expected-error {{threadprivate or thread local variable cannot be firstprivate}}
+ for (i = 0; i < argc; ++i)
+ foo();
+ static int si;
+#pragma omp master taskloop firstprivate(si) // OK
+ for (i = 0; i < argc; ++i)
+ si = i + 1;
+
+ return foomain<S4, S5>(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<S4, S5>' requested here}}
+}
+
diff --git a/src/llvm-project/clang/test/OpenMP/master_taskloop_grainsize_messages.cpp b/src/llvm-project/clang/test/OpenMP/master_taskloop_grainsize_messages.cpp
new file mode 100644
index 0000000..077dfb9
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/master_taskloop_grainsize_messages.cpp
@@ -0,0 +1,103 @@
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+struct S1; // expected-note {{declared here}}
+
+template <class T, class S> // expected-note {{declared here}}
+int tmain(T argc, S **argv) {
+ T z;
+ #pragma omp master taskloop grainsize // expected-error {{expected '(' after 'grainsize'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop grainsize ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop grainsize () // expected-error {{expected expression}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop grainsize (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop grainsize (argc)) // expected-warning {{extra tokens at the end of '#pragma omp master taskloop' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop grainsize (argc > 0 ? argv[1][0] : argv[2][argc] + z)
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop grainsize (foobool(argc)), grainsize (true) // expected-error {{directive '#pragma omp master taskloop' cannot contain more than one 'grainsize' clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop grainsize (S) // expected-error {{'S' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop grainsize (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop grainsize(0) // expected-error {{argument to 'grainsize' clause must be a strictly positive integer value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop grainsize(-1) // expected-error {{argument to 'grainsize' clause must be a strictly positive integer value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop grainsize(argc) num_tasks(argc) // expected-error {{'num_tasks' and 'grainsize' clause are mutually exclusive and may not appear on the same directive}} expected-note {{'grainsize' clause is specified here}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+
+ return 0;
+}
+
+int main(int argc, char **argv) {
+ int z;
+ #pragma omp master taskloop grainsize // expected-error {{expected '(' after 'grainsize'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop grainsize ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop grainsize () // expected-error {{expected expression}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop grainsize (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop grainsize (argc)) // expected-warning {{extra tokens at the end of '#pragma omp master taskloop' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop grainsize (argc > 0 ? argv[1][0] : argv[2][argc] + z)
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop grainsize (foobool(argc)), grainsize (true) // expected-error {{directive '#pragma omp master taskloop' cannot contain more than one 'grainsize' clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop grainsize (S1) // expected-error {{'S1' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop grainsize (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop grainsize (1 0) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop grainsize(if(tmain(argc, argv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop grainsize(0) // expected-error {{argument to 'grainsize' clause must be a strictly positive integer value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop grainsize(-1) // expected-error {{argument to 'grainsize' clause must be a strictly positive integer value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop grainsize(argc) num_tasks(argc) // expected-error {{'num_tasks' and 'grainsize' clause are mutually exclusive and may not appear on the same directive}} expected-note {{'grainsize' clause is specified here}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+
+ return tmain(argc, argv);
+}
diff --git a/src/llvm-project/clang/test/OpenMP/master_taskloop_in_reduction_codegen.cpp b/src/llvm-project/clang/test/OpenMP/master_taskloop_in_reduction_codegen.cpp
new file mode 100644
index 0000000..62c782d
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/master_taskloop_in_reduction_codegen.cpp
@@ -0,0 +1,94 @@
+// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp -x c++ -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-apple-darwin10 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
+
+// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp-simd -x c++ -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
+// expected-no-diagnostics
+#ifndef HEADER
+#define HEADER
+
+// CHECK: [[PRIVATES:%.+]] = type { i8*, i8* }
+
+struct S {
+ int a;
+ S() : a(0) {}
+ S(const S&) {}
+ S& operator=(const S&) {return *this;}
+ ~S() {}
+ friend S operator+(const S&a, const S&b) {return a;}
+};
+
+
+int main(int argc, char **argv) {
+ int a;
+ float b;
+ S c[5];
+ short d[argc];
+#pragma omp taskgroup task_reduction(+: a, b, argc)
+ {
+#pragma omp taskgroup task_reduction(-:c, d)
+#pragma omp parallel
+#pragma omp master taskloop in_reduction(+:a) in_reduction(-:d)
+ for (int i = 0; i < 5; ++i)
+ a += d[a];
+ }
+ return 0;
+}
+
+// CHECK-LABEL: @main
+// CHECK: void @__kmpc_taskgroup(%struct.ident_t* @0, i32 [[GTID:%.+]])
+// CHECK: [[TD1:%.+]] = call i8* @__kmpc_task_reduction_init(i32 [[GTID]], i32 3, i8* %
+// CHECK-NEXT: store i8* [[TD1]], i8** [[TD1_ADDR:%[^,]+]],
+// CHECK-NEXT: call void @__kmpc_taskgroup(%struct.ident_t* @0, i32 [[GTID]])
+// CHECK: [[TD2:%.+]] = call i8* @__kmpc_task_reduction_init(i32 [[GTID]], i32 2, i8* %
+// CHECK-NEXT: store i8* [[TD2]], i8** [[TD2_ADDR:%[^,]+]],
+// CHECK-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @0, i32 5, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32*, i64, i16*, i8**, i8**)* [[OMP_PARALLEL:@.+]] to void (i32*, i32*, ...)*), i32* %{{.+}}, i64 %{{.+}}, i16* %{{.+}}, i8** [[TD1_ADDR]], i8** [[TD2_ADDR]])
+// CHECK-NEXT: call void @__kmpc_end_taskgroup(%struct.ident_t* @0, i32 [[GTID]])
+// CHECK-NEXT: call void @__kmpc_end_taskgroup(%struct.ident_t* @0, i32 [[GTID]])
+
+// CHECK: define internal void [[OMP_PARALLEL]](
+// CHECK: [[RES:%.+]] = call {{.*}}i32 @__kmpc_master(
+// CHECK-NEXT: [[IS_MASTER:%.+]] = icmp ne i32 [[RES]], 0
+// CHECK-NEXT: br i1 [[IS_MASTER]], label {{%?}}[[THEN:.+]], label {{%?}}[[EXIT:.+]]
+// CHECK: [[THEN]]
+// CHECK: [[TASK_T:%.+]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* @0, i32 [[GTID:%.+]], i32 1, i64 96, i64 40, i32 (i32, i8*)* bitcast (i32 (i32, [[T:%.+]]*)* [[OMP_TASK:@.+]] to i32 (i32, i8*)*))
+// CHECK-NEXT: [[TASK_T_WITH_PRIVS:%.+]] = bitcast i8* [[TASK_T]] to [[T]]*
+// CHECK: [[PRIVS:%.+]] = getelementptr inbounds [[T]], [[T]]* [[TASK_T_WITH_PRIVS]], i32 0, i32 1
+// CHECK: [[TD1_REF:%.+]] = getelementptr inbounds [[PRIVATES]], [[PRIVATES]]* [[PRIVS]], i32 0, i32 0
+// CHECK-NEXT: [[TD1_SHAR:%.+]] = getelementptr inbounds %
+// CHECK-NEXT: [[TD1_ADDR:%.+]] = load i8**, i8*** [[TD1_SHAR]],
+// CHECK-NEXT: [[TD1:%.+]] = load i8*, i8** [[TD1_ADDR]],
+// CHECK-NEXT: store i8* [[TD1]], i8** [[TD1_REF]],
+// CHECK-NEXT: [[TD2_REF:%.+]] = getelementptr inbounds [[PRIVATES]], [[PRIVATES]]* [[PRIVS]], i32 0, i32 1
+// CHECK-NEXT: [[TD2_SHAR:%.+]] = getelementptr inbounds %
+// CHECK-NEXT: [[TD2_ADDR:%.+]] = load i8**, i8*** [[TD2_SHAR]],
+// CHECK-NEXT: [[TD2:%.+]] = load i8*, i8** [[TD2_ADDR]],
+// CHECK-NEXT: store i8* [[TD2]], i8** [[TD2_REF]],
+// CHECK: call void @__kmpc_taskloop(%struct.ident_t* @0, i32 [[GTID]], i8* [[TASK_T]], i32 1,
+// CHECK: call {{.*}}void @__kmpc_end_master(
+// CHECK-NEXT: br label {{%?}}[[EXIT]]
+// CHECK: [[EXIT]]
+// CHECK: ret void
+// CHECK-NEXT: }
+
+// CHECK: define internal {{.*}} [[OMP_TASK]](
+// CHECK: call void (i8*, ...) %{{[^(]+}}(i8* %{{.+}}, i8*** [[TD1_REF:%[^,]+]], i8*** [[TD2_REF:%[^,]+]])
+// CHECK-NEXT: [[TD1_ADDR:%.+]] = load i8**, i8*** [[TD1_REF]],
+// CHECK-NEXT: [[TD2_ADDR:%.+]] = load i8**, i8*** [[TD2_REF]],
+// CHECK-NEXT: [[A_REF:%.+]] = getelementptr inbounds %
+// CHECK-NEXT: [[A_ADDR:%.+]] = load i32*, i32** [[A_REF]],
+// CHECK-NEXT: [[TD1:%.+]] = load i8*, i8** [[TD1_ADDR]],
+// CHECK-NEXT: [[GTID:%.+]] = load i32, i32* %
+// CHECK-NEXT: [[A_PTR:%.+]] = bitcast i32* [[A_ADDR]] to i8*
+// CHECK-NEXT: call i8* @__kmpc_task_reduction_get_th_data(i32 [[GTID]], i8* [[TD1]], i8* [[A_PTR]])
+// CHECK: [[D_REF:%.+]] = getelementptr inbounds %
+// CHECK-NEXT: [[D_ADDR:%.+]] = load i16*, i16** [[D_REF]],
+// CHECK: [[TD2:%.+]] = load i8*, i8** [[TD2_ADDR]],
+// CHECK-NEXT: [[D_PTR:%.+]] = bitcast i16* [[D_ADDR]] to i8*
+// CHECK-NEXT: call i8* @__kmpc_task_reduction_get_th_data(i32 [[GTID]], i8* [[TD2]], i8* [[D_PTR]])
+// CHECK: add nsw i32
+// CHECK: store i32 %
+#endif
diff --git a/src/llvm-project/clang/test/OpenMP/master_taskloop_in_reduction_messages.cpp b/src/llvm-project/clang/test/OpenMP/master_taskloop_in_reduction_messages.cpp
new file mode 100644
index 0000000..b9fa587
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/master_taskloop_in_reduction_messages.cpp
@@ -0,0 +1,390 @@
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
+
+typedef void **omp_allocator_handle_t;
+extern const omp_allocator_handle_t omp_default_mem_alloc;
+extern const omp_allocator_handle_t omp_large_cap_mem_alloc;
+extern const omp_allocator_handle_t omp_const_mem_alloc;
+extern const omp_allocator_handle_t omp_high_bw_mem_alloc;
+extern const omp_allocator_handle_t omp_low_lat_mem_alloc;
+extern const omp_allocator_handle_t omp_cgroup_mem_alloc;
+extern const omp_allocator_handle_t omp_pteam_mem_alloc;
+extern const omp_allocator_handle_t omp_thread_mem_alloc;
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+void foobar(int &ref) {
+#pragma omp taskgroup task_reduction(+:ref)
+#pragma omp master taskloop in_reduction(+:ref)
+ for (int i = 0; i < 10; ++i)
+ foo();
+}
+
+void foobar1(int &ref) {
+#pragma omp taskgroup task_reduction(+:ref)
+#pragma omp master taskloop in_reduction(-:ref)
+ for (int i = 0; i < 10; ++i)
+ foo();
+}
+
+#pragma omp declare reduction (red:int:omp_out += omp_in)
+
+void foobar2(int &ref) {
+#pragma omp taskgroup task_reduction(+:ref) // expected-note {{previously marked as task_reduction with different reduction operation}}
+#pragma omp master taskloop in_reduction(red:ref) // expected-error{{in_reduction variable must have the same reduction operation as in a task_reduction clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+}
+
+void foobar3(int &ref) {
+#pragma omp taskgroup task_reduction(red:ref) // expected-note {{previously marked as task_reduction with different reduction operation}}
+#pragma omp master taskloop in_reduction(min:ref) // expected-error{{in_reduction variable must have the same reduction operation as in a task_reduction clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+}
+
+void foobar4(int &ref) {
+#pragma omp master taskloop in_reduction(min:ref) // expected-error {{in_reduction variable must appear in a task_reduction clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+}
+
+struct S1; // expected-note {{declared here}} expected-note 4 {{forward declaration of 'S1'}}
+extern S1 a;
+class S2 {
+ mutable int a;
+ S2 &operator+(const S2 &arg) { return (*this); } // expected-note 3 {{implicitly declared private here}}
+
+public:
+ S2() : a(0) {}
+ S2(S2 &s2) : a(s2.a) {}
+ static float S2s; // expected-note 2 {{static data member is predetermined as shared}}
+ static const float S2sc; // expected-note 2 {{'S2sc' declared here}}
+};
+const float S2::S2sc = 0;
+S2 b; // expected-note 3 {{'b' defined here}}
+const S2 ba[5]; // expected-note 2 {{'ba' defined here}}
+class S3 {
+ int a;
+
+public:
+ int b;
+ S3() : a(0) {}
+ S3(const S3 &s3) : a(s3.a) {}
+ S3 operator+(const S3 &arg1) { return arg1; }
+};
+int operator+(const S3 &arg1, const S3 &arg2) { return 5; }
+S3 c; // expected-note 3 {{'c' defined here}}
+const S3 ca[5]; // expected-note 2 {{'ca' defined here}}
+extern const int f; // expected-note 4 {{'f' declared here}}
+class S4 {
+ int a;
+ S4(); // expected-note {{implicitly declared private here}}
+ S4(const S4 &s4);
+ S4 &operator+(const S4 &arg) { return (*this); }
+
+public:
+ S4(int v) : a(v) {}
+};
+S4 &operator&=(S4 &arg1, S4 &arg2) { return arg1; }
+class S5 {
+ int a;
+ S5() : a(0) {} // expected-note {{implicitly declared private here}}
+ S5(const S5 &s5) : a(s5.a) {}
+ S5 &operator+(const S5 &arg);
+
+public:
+ S5(int v) : a(v) {}
+};
+class S6 { // expected-note 3 {{candidate function (the implicit copy assignment operator) not viable: no known conversion from 'int' to 'const S6' for 1st argument}}
+#if __cplusplus >= 201103L // C++11 or later
+// expected-note@-2 3 {{candidate function (the implicit move assignment operator) not viable}}
+#endif
+ int a;
+
+public:
+ S6() : a(6) {}
+ operator int() { return 6; }
+} o;
+
+S3 h, k;
+#pragma omp threadprivate(h) // expected-note 2 {{defined as threadprivate or thread local}}
+
+template <class T> // expected-note {{declared here}}
+T tmain(T argc) {
+ const T d = T(); // expected-note 4 {{'d' defined here}}
+ const T da[5] = {T()}; // expected-note 2 {{'da' defined here}}
+ T qa[5] = {T()};
+ T i;
+ T &j = i; // expected-note 2 {{'j' defined here}}
+ S3 &p = k; // expected-note 2 {{'p' defined here}}
+ const T &r = da[(int)i]; // expected-note 2 {{'r' defined here}}
+ T &q = qa[(int)i];
+ T fl;
+#pragma omp taskgroup task_reduction(+:argc)
+#pragma omp master taskloop in_reduction // expected-error {{expected '(' after 'in_reduction'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp taskgroup task_reduction(+:argc)
+#pragma omp master taskloop in_reduction + // expected-error {{expected '(' after 'in_reduction'}} expected-warning {{extra tokens at the end of '#pragma omp master taskloop' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp taskgroup task_reduction(+:argc)
+#pragma omp master taskloop in_reduction( // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp taskgroup task_reduction(+:argc)
+#pragma omp master taskloop in_reduction(- // expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp taskgroup task_reduction(+:argc)
+#pragma omp master taskloop in_reduction() // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp taskgroup task_reduction(+:argc)
+#pragma omp master taskloop in_reduction(*) // expected-warning {{missing ':' after reduction identifier - ignoring}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp taskgroup task_reduction(+:argc)
+#pragma omp master taskloop in_reduction(\) // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp taskgroup task_reduction(&:argc) // expected-error {{invalid operands to binary expression ('float' and 'float')}}
+#pragma omp master taskloop in_reduction(& : argc // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{invalid operands to binary expression ('float' and 'float')}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp taskgroup task_reduction(|:argc) // expected-error {{invalid operands to binary expression ('float' and 'float')}}
+#pragma omp master taskloop in_reduction(| : argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{invalid operands to binary expression ('float' and 'float')}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop in_reduction(|| : argc ? i : argc) // expected-error 2 {{expected variable name, array element or array section}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop in_reduction(foo : argc) //expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'float'}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'int'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp taskgroup task_reduction(&&:argc)
+#pragma omp master taskloop in_reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop in_reduction(^ : T) // expected-error {{'T' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp taskgroup task_reduction(+:c)
+#pragma omp master taskloop in_reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be in_reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}} expected-error 2 {{in_reduction variable must appear in a task_reduction clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop in_reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 4 {{arguments of OpenMP clause 'in_reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 3 {{const-qualified variable cannot be in_reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop in_reduction(max : h.b) // expected-error {{expected variable name, array element or array section}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop in_reduction(+ : ba) // expected-error {{const-qualified variable cannot be in_reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop in_reduction(* : ca) // expected-error {{const-qualified variable cannot be in_reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop in_reduction(- : da) // expected-error {{const-qualified variable cannot be in_reduction}} expected-error {{const-qualified variable cannot be in_reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop in_reduction(^ : fl) // expected-error {{invalid operands to binary expression ('float' and 'float')}} expected-error {{in_reduction variable must appear in a task_reduction clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop in_reduction(&& : S2::S2s) // expected-error {{shared variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop in_reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be in_reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp taskgroup task_reduction(+:k)
+#pragma omp master taskloop in_reduction(+ : h, k) // expected-error {{threadprivate or thread local variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop in_reduction(+ : o) // expected-error 2 {{no viable overloaded '='}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel private(k)
+#pragma omp master taskloop in_reduction(+ : p), in_reduction(+ : p) // expected-error 2 {{argument of OpenMP clause 'in_reduction' must reference the same object in all threads}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp taskgroup task_reduction(+:p)
+#pragma omp master taskloop in_reduction(+ : p), in_reduction(+ : p) // expected-error 2 {{variable can appear only once in OpenMP 'in_reduction' clause}} expected-note 2 {{previously referenced here}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop in_reduction(+ : r) // expected-error 2 {{const-qualified variable cannot be in_reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel shared(i)
+#pragma omp parallel reduction(min : i)
+#pragma omp master taskloop in_reduction(max : j) // expected-error 2 {{argument of OpenMP clause 'in_reduction' must reference the same object in all threads}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp taskgroup task_reduction(+:fl)
+{
+#pragma omp master taskloop in_reduction(+ : fl) allocate(omp_thread_mem_alloc: fl) // expected-warning 2 {{allocator with the 'thread' trait access has unspecified behavior on 'master taskloop' directive}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp taskgroup task_reduction(*:fl) // expected-note 2 {{previously marked as task_reduction with different reduction operation}}
+{
+#pragma omp master taskloop in_reduction(+ : fl) // expected-error 2 {{in_reduction variable must have the same reduction operation as in a task_reduction clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+}
+}
+#pragma omp parallel
+#pragma omp for reduction(- : fl)
+ for (int i = 0; i < 10; ++i)
+#pragma omp taskgroup task_reduction(+:fl)
+#pragma omp master taskloop in_reduction(+ : fl)
+ for (int j = 0; j < 10; ++j)
+ foo();
+
+ return T();
+}
+
+namespace A {
+double x;
+#pragma omp threadprivate(x) // expected-note {{defined as threadprivate or thread local}}
+}
+namespace B {
+using A::x;
+}
+
+int main(int argc, char **argv) {
+ const int d = 5; // expected-note 2 {{'d' defined here}}
+ const int da[5] = {0}; // expected-note {{'da' defined here}}
+ int qa[5] = {0};
+ S4 e(4);
+ S5 g(5);
+ int i;
+ int &j = i; // expected-note {{'j' defined here}}
+ S3 &p = k; // expected-note 2 {{'p' defined here}}
+ const int &r = da[i]; // expected-note {{'r' defined here}}
+ int &q = qa[i];
+ float fl;
+#pragma omp master taskloop in_reduction // expected-error {{expected '(' after 'in_reduction'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop in_reduction + // expected-error {{expected '(' after 'in_reduction'}} expected-warning {{extra tokens at the end of '#pragma omp master taskloop' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop in_reduction( // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop in_reduction(- // expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop in_reduction() // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop in_reduction(*) // expected-warning {{missing ':' after reduction identifier - ignoring}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop in_reduction(\) // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop in_reduction(foo : argc // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp taskgroup task_reduction(|:argc)
+#pragma omp master taskloop in_reduction(| : argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop in_reduction(|| : argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name, array element or array section}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop in_reduction(~ : argc) // expected-error {{expected unqualified-id}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp taskgroup task_reduction(&&:argc)
+#pragma omp master taskloop in_reduction(&& : argc)
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop in_reduction(^ : S1) // expected-error {{'S1' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp taskgroup task_reduction(+:c)
+#pragma omp master taskloop in_reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{const-qualified variable cannot be in_reduction}} expected-error {{'operator+' is a private member of 'S2'}} expected-error {{in_reduction variable must appear in a task_reduction clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop in_reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{arguments of OpenMP clause 'in_reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 2 {{const-qualified variable cannot be in_reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop in_reduction(max : h.b) // expected-error {{expected variable name, array element or array section}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop in_reduction(+ : ba) // expected-error {{const-qualified variable cannot be in_reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop in_reduction(* : ca) // expected-error {{const-qualified variable cannot be in_reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop in_reduction(- : da) // expected-error {{const-qualified variable cannot be in_reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop in_reduction(^ : fl) // expected-error {{invalid operands to binary expression ('float' and 'float')}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop in_reduction(&& : S2::S2s) // expected-error {{shared variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop in_reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be in_reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop in_reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{nvalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp taskgroup task_reduction(+:k)
+#pragma omp master taskloop in_reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop in_reduction(+ : o) // expected-error {{no viable overloaded '='}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel private(k)
+#pragma omp master taskloop in_reduction(+ : p), in_reduction(+ : p) // expected-error 2 {{argument of OpenMP clause 'in_reduction' must reference the same object in all threads}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp taskgroup task_reduction(+:p)
+#pragma omp master taskloop in_reduction(+ : p), in_reduction(+ : p) // expected-error {{variable can appear only once in OpenMP 'in_reduction' clause}} expected-note {{previously referenced here}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop in_reduction(+ : r) // expected-error {{const-qualified variable cannot be in_reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel shared(i)
+#pragma omp parallel reduction(min : i)
+#pragma omp master taskloop in_reduction(max : j) // expected-error {{argument of OpenMP clause 'in_reduction' must reference the same object in all threads}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp for private(fl)
+ for (int i = 0; i < 10; ++i)
+#pragma omp taskgroup task_reduction(+:fl)
+#pragma omp master taskloop in_reduction(+ : fl)
+ for (int j = 0; j < 10; ++j)
+ foo();
+#pragma omp taskgroup task_reduction(+:fl)
+#pragma omp master taskloop in_reduction(+ : fl)
+ for (int i = 0; i < 10; ++i)
+ foo();
+ static int m;
+#pragma omp taskgroup task_reduction(+:m)
+#pragma omp master taskloop in_reduction(+ : m) // OK
+ for (int i = 0; i < 10; ++i)
+ m++;
+
+ return tmain(argc) + tmain(fl); // expected-note {{in instantiation of function template specialization 'tmain<int>' requested here}} expected-note {{in instantiation of function template specialization 'tmain<float>' requested here}}
+}
diff --git a/src/llvm-project/clang/test/OpenMP/master_taskloop_lastprivate_codegen.cpp b/src/llvm-project/clang/test/OpenMP/master_taskloop_lastprivate_codegen.cpp
new file mode 100644
index 0000000..90a82e4
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/master_taskloop_lastprivate_codegen.cpp
@@ -0,0 +1,545 @@
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-apple-darwin10 -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=LAMBDA %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=BLOCKS %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DARRAY -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=ARRAY %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DLOOP -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=LOOP %s
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DARRAY -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DLOOP -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=SIMD-ONLY0 %s
+// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
+// expected-no-diagnostics
+
+#if !defined(ARRAY) && !defined(LOOP)
+#ifndef HEADER
+#define HEADER
+
+template <class T>
+struct S {
+ T f;
+ S(T a) : f(a) {}
+ S() : f() {}
+ S(const S &s, T t = T()) : f(s.f + t) {}
+ operator T() { return T(); }
+ ~S() {}
+};
+
+volatile double g;
+
+// CHECK-DAG: [[KMP_TASK_T_TY:%.+]] = type { i8*, i32 (i32, i8*)*, i32, %union{{.+}}, %union{{.+}}, i64, i64, i64, i32, i8* }
+// CHECK-DAG: [[S_DOUBLE_TY:%.+]] = type { double }
+// CHECK-DAG: [[PRIVATES_MAIN_TY:%.+]] = type {{.?}}{ [2 x [[S_DOUBLE_TY]]], [[S_DOUBLE_TY]], i32, [2 x i32]
+// CHECK-DAG: [[CAP_MAIN_TY:%.+]] = type { [2 x i32]*, i32*, [2 x [[S_DOUBLE_TY]]]*, [[S_DOUBLE_TY]]*, i{{[0-9]+}}* }
+// CHECK-DAG: [[KMP_TASK_MAIN_TY:%.+]] = type { [[KMP_TASK_T_TY]], [[PRIVATES_MAIN_TY]] }
+// CHECK-DAG: [[S_INT_TY:%.+]] = type { i32 }
+// CHECK-DAG: [[CAP_TMAIN_TY:%.+]] = type { [2 x i32]*, i32*, [2 x [[S_INT_TY]]]*, [[S_INT_TY]]* }
+// CHECK-DAG: [[PRIVATES_TMAIN_TY:%.+]] = type { i32, [2 x i32], [2 x [[S_INT_TY]]], [[S_INT_TY]], [104 x i8] }
+// CHECK-DAG: [[KMP_TASK_TMAIN_TY:%.+]] = type { [[KMP_TASK_T_TY]], [{{[0-9]+}} x i8], [[PRIVATES_TMAIN_TY]] }
+template <typename T>
+T tmain() {
+ S<T> ttt;
+ S<T> test;
+ T t_var __attribute__((aligned(128))) = T();
+ T vec[] = {1, 2};
+ S<T> s_arr[] = {1, 2};
+ S<T> var(3);
+#pragma omp master taskloop lastprivate(t_var, vec, s_arr, s_arr, var, var)
+ for (int i = 0; i < 10; ++i) {
+ vec[0] = t_var;
+ s_arr[0] = var;
+ }
+ return T();
+}
+
+int main() {
+ static int sivar;
+#ifdef LAMBDA
+ // LAMBDA: [[G:@.+]] = global double
+ // LAMBDA: [[SIVAR:@.+]] = internal global i{{[0-9]+}} 0,
+ // LAMBDA-LABEL: @main
+ // LAMBDA: call{{( x86_thiscallcc)?}} void [[OUTER_LAMBDA:@.+]](
+ [&]() {
+ // LAMBDA: define{{.*}} internal{{.*}} void [[OUTER_LAMBDA]](
+ // LAMBDA: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc(%{{[^ ]+}} @{{[^,]+}}, i32 %{{[^,]+}}, i32 1, i64 96, i64 16, i32 (i32, i8*)* bitcast (i32 (i32, %{{[^*]+}}*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+// LAMBDA: [[PRIVATES:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i{{.+}} 0, i{{.+}} 1
+
+// LAMBDA: call void @__kmpc_taskloop(%{{.+}}* @{{.+}}, i32 %{{.+}}, i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* bitcast (void ([[KMP_TASK_MAIN_TY:%[^*]+]]*, [[KMP_TASK_MAIN_TY]]*, i32)* [[MAIN_DUP:@.+]] to i8*))
+// LAMBDA: ret
+#pragma omp master taskloop lastprivate(g, sivar)
+ for (int i = 0; i < 10; ++i) {
+ // LAMBDA: define {{.+}} void [[INNER_LAMBDA:@.+]](%{{.+}}* [[ARG_PTR:%.+]])
+ // LAMBDA: store %{{.+}}* [[ARG_PTR]], %{{.+}}** [[ARG_PTR_REF:%.+]],
+ // LAMBDA: [[ARG_PTR:%.+]] = load %{{.+}}*, %{{.+}}** [[ARG_PTR_REF]]
+ // LAMBDA: [[G_PTR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[ARG_PTR]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+ // LAMBDA: [[G_REF:%.+]] = load double*, double** [[G_PTR_REF]]
+ // LAMBDA: store double 2.0{{.+}}, double* [[G_REF]]
+
+ // LAMBDA: store double* %{{.+}}, double** %{{.+}},
+ // LAMBDA: define internal i32 [[TASK_ENTRY]](i32 %0, %{{.+}}* noalias %1)
+ g = 1;
+ sivar = 11;
+ // LAMBDA: store double 1.0{{.+}}, double* %{{.+}},
+ // LAMBDA: store i{{[0-9]+}} 11, i{{[0-9]+}}* %{{.+}},
+ // LAMBDA: call void [[INNER_LAMBDA]](%
+ // LAMBDA: icmp ne i32 %{{.+}}, 0
+ // LAMBDA: br i1
+ // LAMBDA: load double, double* %
+ // LAMBDA: store volatile double %
+ // LAMBDA: load i32, i32* %
+ // LAMBDA: store i32 %
+ // LAMBDA: ret
+ [&]() {
+ g = 2;
+ sivar = 22;
+ }();
+ }
+ }();
+ return 0;
+#elif defined(BLOCKS)
+ // BLOCKS: [[G:@.+]] = global double
+ // BLOCKS-LABEL: @main
+ // BLOCKS: call void {{%.+}}(i8
+ ^{
+ // BLOCKS: define{{.*}} internal{{.*}} void {{.+}}(i8*
+ // BLOCKS: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc(%{{[^ ]+}} @{{[^,]+}}, i32 %{{[^,]+}}, i32 1, i64 96, i64 16, i32 (i32, i8*)* bitcast (i32 (i32, %{{[^*]+}}*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+ // BLOCKS: [[PRIVATES:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i{{.+}} 0, i{{.+}} 1
+ // BLOCKS: call void @__kmpc_taskloop(%{{.+}}* @{{.+}}, i32 %{{.+}}, i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* bitcast (void ([[KMP_TASK_MAIN_TY:%[^*]+]]*, [[KMP_TASK_MAIN_TY]]*, i32)* [[MAIN_DUP:@.+]] to i8*))
+ // BLOCKS: ret
+#pragma omp master taskloop lastprivate(g, sivar)
+ for (int i = 0; i < 10; ++i) {
+ // BLOCKS: define {{.+}} void {{@.+}}(i8*
+ // BLOCKS-NOT: [[G]]{{[[^:word:]]}}
+ // BLOCKS: store double 2.0{{.+}}, double*
+ // BLOCKS-NOT: [[G]]{{[[^:word:]]}}
+ // BLOCKS-NOT: [[ISVAR]]{{[[^:word:]]}}
+ // BLOCKS: store i{{[0-9]+}} 22, i{{[0-9]+}}*
+ // BLOCKS-NOT: [[SIVAR]]{{[[^:word:]]}}
+ // BLOCKS: ret
+
+ // BLOCKS: store double* %{{.+}}, double** %{{.+}},
+ // BLOCKS: store i{{[0-9]+}}* %{{.+}}, i{{[0-9]+}}** %{{.+}},
+ // BLOCKS: define internal i32 [[TASK_ENTRY]](i32 %0, %{{.+}}* noalias %1)
+ g = 1;
+ sivar = 11;
+ // BLOCKS: store double 1.0{{.+}}, double* %{{.+}},
+ // BLOCKS-NOT: [[G]]{{[[^:word:]]}}
+ // BLOCKS: store i{{[0-9]+}} 11, i{{[0-9]+}}* %{{.+}},
+ // BLOCKS-NOT: [[SIVAR]]{{[[^:word:]]}}
+ // BLOCKS: call void {{%.+}}(i8
+ // BLOCKS: icmp ne i32 %{{.+}}, 0
+ // BLOCKS: br i1
+ // BLOCKS: load double, double* %
+ // BLOCKS: store volatile double %
+ // BLOCKS: load i32, i32* %
+ // BLOCKS: store i32 %
+ ^{
+ g = 2;
+ sivar = 22;
+ }();
+ }
+ }();
+ return 0;
+#else
+ S<double> ttt;
+ S<double> test;
+ int t_var = 0;
+ int vec[] = {1, 2};
+ S<double> s_arr[] = {1, 2};
+ S<double> var(3);
+#pragma omp master taskloop lastprivate(var, t_var, s_arr, vec, s_arr, var, sivar)
+ for (int i = 0; i < 10; ++i) {
+ vec[0] = t_var;
+ s_arr[0] = var;
+ sivar = 33;
+ }
+ return tmain<int>();
+#endif
+}
+
+// CHECK: [[SIVAR:.+]] = internal global i{{[0-9]+}} 0,
+// CHECK: define i{{[0-9]+}} @main()
+// CHECK: alloca [[S_DOUBLE_TY]],
+// CHECK: [[TEST:%.+]] = alloca [[S_DOUBLE_TY]],
+// CHECK: [[T_VAR_ADDR:%.+]] = alloca i32,
+// CHECK: [[VEC_ADDR:%.+]] = alloca [2 x i32],
+// CHECK: [[S_ARR_ADDR:%.+]] = alloca [2 x [[S_DOUBLE_TY]]],
+// CHECK: [[VAR_ADDR:%.+]] = alloca [[S_DOUBLE_TY]],
+// CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num([[LOC:%.+]])
+
+// CHECK: call {{.*}} [[S_DOUBLE_TY_CONSTR:@.+]]([[S_DOUBLE_TY]]* [[TEST]])
+
+// CHECK: [[RES:%.+]] = call {{.*}}i32 @__kmpc_master(
+// CHECK-NEXT: [[IS_MASTER:%.+]] = icmp ne i32 [[RES]], 0
+// CHECK-NEXT: br i1 [[IS_MASTER]], label {{%?}}[[THEN:.+]], label {{%?}}[[EXIT:.+]]
+// CHECK: [[THEN]]
+// Store original variables in capture struct.
+// CHECK: [[VEC_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: store [2 x i32]* [[VEC_ADDR]], [2 x i32]** [[VEC_REF]],
+// CHECK: [[T_VAR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 1
+// CHECK: store i32* [[T_VAR_ADDR]], i32** [[T_VAR_REF]],
+// CHECK: [[S_ARR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 2
+// CHECK: store [2 x [[S_DOUBLE_TY]]]* [[S_ARR_ADDR]], [2 x [[S_DOUBLE_TY]]]** [[S_ARR_REF]],
+// CHECK: [[VAR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 3
+// CHECK: store [[S_DOUBLE_TY]]* [[VAR_ADDR]], [[S_DOUBLE_TY]]** [[VAR_REF]],
+// CHECK: [[SIVAR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 4
+// CHECK: store i{{[0-9]+}}* [[SIVAR]], i{{[0-9]+}}** [[SIVAR_REF]],
+
+// Allocate task.
+// Returns struct kmp_task_t {
+// [[KMP_TASK_T]] task_data;
+// [[KMP_TASK_MAIN_TY]] privates;
+// };
+// CHECK: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc([[LOC]], i32 [[GTID]], i32 9, i64 120, i64 40, i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_MAIN_TY]]*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+// CHECK: [[RES_KMP_TASK:%.+]] = bitcast i8* [[RES]] to [[KMP_TASK_MAIN_TY]]*
+
+// Fill kmp_task_t->shareds by copying from original capture argument.
+// CHECK: [[TASK:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: [[SHAREDS_REF_ADDR:%.+]] = getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* [[TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: [[SHAREDS_REF:%.+]] = load i8*, i8** [[SHAREDS_REF_ADDR]],
+// CHECK: [[CAPTURES_ADDR:%.+]] = bitcast [[CAP_MAIN_TY]]* %{{.+}} to i8*
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 [[SHAREDS_REF]], i8* align 8 [[CAPTURES_ADDR]], i64 40, i1 false)
+
+// Initialize kmp_task_t->privates with default values (no init for simple types, default constructors for classes).
+// Also copy address of private copy to the corresponding shareds reference.
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
+
+// Constructors for s_arr and var.
+// s_arr;
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: call {{.*}} [[S_DOUBLE_TY_CONSTR]]([[S_DOUBLE_TY]]* [[S_ARR_CUR:%[^,]+]])
+// CHECK: getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* [[S_ARR_CUR]], i{{.+}} 1
+// CHECK: icmp eq
+// CHECK: br i1
+
+// var;
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
+// CHECK: call {{.*}} [[S_DOUBLE_TY_CONSTR]]([[S_DOUBLE_TY]]* [[PRIVATE_VAR_REF]])
+
+// t_var;
+// vec;
+// sivar;
+
+// Provide pointer to destructor function, which will destroy private variables at the end of the task.
+// CHECK: [[DESTRUCTORS_REF:%.+]] = getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* [[TASK]], i{{.+}} 0, i{{.+}} 3
+// CHECK: [[DESTRUCTORS_PTR:%.+]] = bitcast %union{{.+}}* [[DESTRUCTORS_REF]] to i32 (i32, i8*)**
+// CHECK: store i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_MAIN_TY]]*)* [[DESTRUCTORS:@.+]] to i32 (i32, i8*)*), i32 (i32, i8*)** [[DESTRUCTORS_PTR]],
+
+// Start task.
+// CHECK: call void @__kmpc_taskloop([[LOC]], i32 [[GTID]], i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* bitcast (void ([[KMP_TASK_MAIN_TY]]*, [[KMP_TASK_MAIN_TY]]*, i32)* [[MAIN_DUP:@.+]] to i8*))
+// CHECK: call {{.*}}void @__kmpc_end_master(
+// CHECK-NEXT: br label {{%?}}[[EXIT]]
+// CHECK: [[EXIT]]
+
+// CHECK: = call i{{.+}} [[TMAIN_INT:@.+]]()
+
+// No destructors must be called for private copies of s_arr and var.
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: call void [[S_DOUBLE_TY_DESTR:@.+]]([[S_DOUBLE_TY]]*
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: ret
+//
+
+// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_MAIN_TY]]* noalias %0, [[S_DOUBLE_TY]]** noalias %1, i32** noalias %2, [2 x [[S_DOUBLE_TY]]]** noalias %3, [2 x i32]** noalias %4, i32** noalias %5)
+// CHECK: [[PRIVATES:%.+]] = load [[PRIVATES_MAIN_TY]]*, [[PRIVATES_MAIN_TY]]**
+// CHECK: [[PRIV_S_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 0
+// CHECK: [[ARG3:%.+]] = load [2 x [[S_DOUBLE_TY]]]**, [2 x [[S_DOUBLE_TY]]]*** %{{.+}},
+// CHECK: store [2 x [[S_DOUBLE_TY]]]* [[PRIV_S_VAR]], [2 x [[S_DOUBLE_TY]]]** [[ARG3]],
+// CHECK: [[PRIV_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 1
+// CHECK: [[ARG1:%.+]] = load [[S_DOUBLE_TY]]**, [[S_DOUBLE_TY]]*** {{.+}},
+// CHECK: store [[S_DOUBLE_TY]]* [[PRIV_VAR]], [[S_DOUBLE_TY]]** [[ARG1]],
+// CHECK: [[PRIV_T_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 2
+// CHECK: [[ARG2:%.+]] = load i32**, i32*** %{{.+}},
+// CHECK: store i32* [[PRIV_T_VAR]], i32** [[ARG2]],
+// CHECK: [[PRIV_VEC:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 3
+// CHECK: [[ARG4:%.+]] = load [2 x i32]**, [2 x i32]*** %{{.+}},
+// CHECK: store [2 x i32]* [[PRIV_VEC]], [2 x i32]** [[ARG4]],
+// CHECK: [[PRIV_SIVAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 4
+// CHECK: [[ARG5:%.+]] = load i{{[0-9]+}}**, i{{[0-9]+}}*** %{{.+}},
+// CHECK: store i{{[0-9]+}}* [[PRIV_SIVAR]], i{{[0-9]+}}** [[ARG5]],
+// CHECK: ret void
+
+// CHECK: define internal i32 [[TASK_ENTRY]](i32 %0, [[KMP_TASK_MAIN_TY]]* noalias %1)
+
+// CHECK: [[PRIV_VAR_ADDR:%.+]] = alloca [[S_DOUBLE_TY]]*,
+// CHECK: [[PRIV_T_VAR_ADDR:%.+]] = alloca i32*,
+// CHECK: [[PRIV_S_ARR_ADDR:%.+]] = alloca [2 x [[S_DOUBLE_TY]]]*,
+// CHECK: [[PRIV_VEC_ADDR:%.+]] = alloca [2 x i32]*,
+// CHECK: [[PRIV_SIVAR_ADDR:%.+]] = alloca i32*,
+// CHECK: store void (i8*, ...)* bitcast (void ([[PRIVATES_MAIN_TY]]*, [[S_DOUBLE_TY]]**, i32**, [2 x [[S_DOUBLE_TY]]]**, [2 x i32]**, i32**)* [[PRIVATES_MAP_FN]] to void (i8*, ...)*), void (i8*, ...)** [[MAP_FN_ADDR:%.+]],
+// CHECK: [[MAP_FN:%.+]] = load void (i8*, ...)*, void (i8*, ...)** [[MAP_FN_ADDR]],
+
+// CHECK: call void (i8*, ...) [[MAP_FN]](i8* %{{.+}}, [[S_DOUBLE_TY]]** [[PRIV_VAR_ADDR]], i32** [[PRIV_T_VAR_ADDR]], [2 x [[S_DOUBLE_TY]]]** [[PRIV_S_ARR_ADDR]], [2 x i32]** [[PRIV_VEC_ADDR]], i32** [[PRIV_SIVAR_ADDR]])
+
+// CHECK: [[PRIV_VAR:%.+]] = load [[S_DOUBLE_TY]]*, [[S_DOUBLE_TY]]** [[PRIV_VAR_ADDR]],
+// CHECK: [[PRIV_T_VAR:%.+]] = load i32*, i32** [[PRIV_T_VAR_ADDR]],
+// CHECK: [[PRIV_S_ARR:%.+]] = load [2 x [[S_DOUBLE_TY]]]*, [2 x [[S_DOUBLE_TY]]]** [[PRIV_S_ARR_ADDR]],
+// CHECK: [[PRIV_VEC:%.+]] = load [2 x i32]*, [2 x i32]** [[PRIV_VEC_ADDR]],
+// CHECK: [[PRIV_SIVAR:%.+]] = load i32*, i32** [[PRIV_SIVAR_ADDR]],
+
+// Privates actually are used.
+// CHECK-DAG: [[PRIV_VAR]]
+// CHECK-DAG: [[PRIV_T_VAR]]
+// CHECK-DAG: [[PRIV_S_ARR]]
+// CHECK-DAG: [[PRIV_VEC]]
+// CHECK-DAG: [[PRIV_SIVAR]]
+
+// CHECK: icmp ne i32 %{{.+}}, 0
+// CHECK-NEXT: br i1
+// CHECK: bitcast [[S_DOUBLE_TY]]* %{{.+}} to i8*
+// CHECK: bitcast [[S_DOUBLE_TY]]* %{{.+}} to i8*
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align {{[0-9]+}} %
+// CHECK: load i32, i32* %
+// CHECK: store i32 %{{.+}}, i32* %
+// CHECK: getelementptr inbounds [2 x [[S_DOUBLE_TY]]], [2 x [[S_DOUBLE_TY]]]* %
+// CHECK: phi [[S_DOUBLE_TY]]*
+// CHECK: phi [[S_DOUBLE_TY]]*
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align {{[0-9]+}} %
+// CHECK: icmp eq [[S_DOUBLE_TY]]* %
+// CHECK-NEXT: br i1
+// CHECK: bitcast [2 x i32]* %{{.+}} to i8*
+// CHECK: bitcast [2 x i32]* %{{.+}} to i8*
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align {{[0-9]+}} %
+// CHECK: load i32, i32* %
+// CHECK: store i32 %{{.+}}, i32* %
+// CHECK: br label
+// CHECK: ret
+
+// CHECK: define internal void [[MAIN_DUP]]([[KMP_TASK_MAIN_TY]]* %0, [[KMP_TASK_MAIN_TY]]* %1, i32 %2)
+// CHECK: getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* %{{.+}}, i32 0, i32 8
+// CHECK: load i32, i32* %
+// CHECK: store i32 %{{.+}}, i32* %
+// CHECK: getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* %{{.+}}, i32 0, i32 1
+// CHECK: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr inbounds [2 x [[S_DOUBLE_TY]]], [2 x [[S_DOUBLE_TY]]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i64 2
+// CHECK: br label %
+
+// CHECK: phi [[S_DOUBLE_TY]]*
+// CHECK: call {{.*}} [[S_DOUBLE_TY_CONSTR]]([[S_DOUBLE_TY]]*
+// CHECK: getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i64 1
+// CHECK: icmp eq [[S_DOUBLE_TY]]* %
+// CHECK: br i1 %
+
+// CHECK: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* %{{.+}}, i32 0, i32 1
+// CHECK: call {{.*}} [[S_DOUBLE_TY_CONSTR]]([[S_DOUBLE_TY]]*
+// CHECK: ret void
+
+// CHECK: define internal i32 [[DESTRUCTORS]](i32 %0, [[KMP_TASK_MAIN_TY]]* noalias %1)
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 0
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
+// CHECK: call {{.*}} [[S_DOUBLE_TY_DESTR]]([[S_DOUBLE_TY]]* [[PRIVATE_VAR_REF]])
+// CHECK: getelementptr inbounds [2 x [[S_DOUBLE_TY]]], [2 x [[S_DOUBLE_TY]]]* [[PRIVATE_S_ARR_REF]], i{{.+}} 0, i{{.+}} 0
+// CHECK: getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i{{.+}} 2
+// CHECK: [[PRIVATE_S_ARR_ELEM_REF:%.+]] = getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i{{.+}} -1
+// CHECK: call {{.*}} [[S_DOUBLE_TY_DESTR]]([[S_DOUBLE_TY]]* [[PRIVATE_S_ARR_ELEM_REF]])
+// CHECK: icmp eq
+// CHECK: br i1
+// CHECK: ret i32
+
+// CHECK: define {{.*}} i{{[0-9]+}} [[TMAIN_INT]]()
+// CHECK: alloca [[S_INT_TY]],
+// CHECK: [[TEST:%.+]] = alloca [[S_INT_TY]],
+// CHECK: [[T_VAR_ADDR:%.+]] = alloca i32, align 128
+// CHECK: [[VEC_ADDR:%.+]] = alloca [2 x i32],
+// CHECK: [[S_ARR_ADDR:%.+]] = alloca [2 x [[S_INT_TY]]],
+// CHECK: [[VAR_ADDR:%.+]] = alloca [[S_INT_TY]],
+// CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num([[LOC:%.+]])
+
+// CHECK: call {{.*}} [[S_INT_TY_CONSTR:@.+]]([[S_INT_TY]]* [[TEST]])
+
+// Store original variables in capture struct.
+// CHECK: [[VEC_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: store [2 x i32]* [[VEC_ADDR]], [2 x i32]** [[VEC_REF]],
+// CHECK: [[T_VAR_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 1
+// CHECK: store i32* [[T_VAR_ADDR]], i32** [[T_VAR_REF]],
+// CHECK: [[S_ARR_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 2
+// CHECK: store [2 x [[S_INT_TY]]]* [[S_ARR_ADDR]], [2 x [[S_INT_TY]]]** [[S_ARR_REF]],
+// CHECK: [[VAR_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 3
+// CHECK: store [[S_INT_TY]]* [[VAR_ADDR]], [[S_INT_TY]]** [[VAR_REF]],
+
+// Allocate task.
+// Returns struct kmp_task_t {
+// [[KMP_TASK_T_TY]] task_data;
+// [[KMP_TASK_TMAIN_TY]] privates;
+// };
+// CHECK: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc([[LOC]], i32 [[GTID]], i32 9, i64 256, i64 32, i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_TMAIN_TY]]*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+// CHECK: [[RES_KMP_TASK:%.+]] = bitcast i8* [[RES]] to [[KMP_TASK_TMAIN_TY]]*
+
+// Fill kmp_task_t->shareds by copying from original capture argument.
+// CHECK: [[TASK:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: [[SHAREDS_REF_ADDR:%.+]] = getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* [[TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: [[SHAREDS_REF:%.+]] = load i8*, i8** [[SHAREDS_REF_ADDR]],
+// CHECK: [[CAPTURES_ADDR:%.+]] = bitcast [[CAP_TMAIN_TY]]* %{{.+}} to i8*
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 [[SHAREDS_REF]], i8* align 8 [[CAPTURES_ADDR]], i64 32, i1 false)
+
+// Initialize kmp_task_t->privates with default values (no init for simple types, default constructors for classes).
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
+
+// t_var;
+// vec;
+
+// Constructors for s_arr and var.
+// a_arr;
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
+// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* [[PRIVATE_S_ARR_REF]], i{{.+}} 0, i{{.+}} 0
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i{{.+}} 2
+// CHECK: call {{.*}} [[S_INT_TY_CONSTR]]([[S_INT_TY]]* [[S_ARR_CUR:%[^,]+]])
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* [[S_ARR_CUR]], i{{.+}} 1
+// CHECK: icmp eq
+// CHECK: br i1
+
+// var;
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: call {{.*}} [[S_INT_TY_CONSTR]]([[S_INT_TY]]* [[PRIVATE_VAR_REF]])
+
+// Provide pointer to destructor function, which will destroy private variables at the end of the task.
+// CHECK: [[DESTRUCTORS_REF:%.+]] = getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* [[TASK]], i{{.+}} 0, i{{.+}} 3
+// CHECK: [[DESTRUCTORS_PTR:%.+]] = bitcast %union{{.+}}* [[DESTRUCTORS_REF]] to i32 (i32, i8*)**
+// CHECK: store i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_TMAIN_TY]]*)* [[DESTRUCTORS:@.+]] to i32 (i32, i8*)*), i32 (i32, i8*)** [[DESTRUCTORS_PTR]],
+
+// Start task.
+// CHECK: call void @__kmpc_taskloop([[LOC]], i32 [[GTID]], i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* bitcast (void ([[KMP_TASK_TMAIN_TY]]*, [[KMP_TASK_TMAIN_TY]]*, i32)* [[TMAIN_DUP:@.+]] to i8*))
+
+// No destructors must be called for private copies of s_arr and var.
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: call void [[S_INT_TY_DESTR:@.+]]([[S_INT_TY]]*
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: ret
+//
+
+// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_TMAIN_TY]]* noalias %0, i32** noalias %1, [2 x i32]** noalias %2, [2 x [[S_INT_TY]]]** noalias %3, [[S_INT_TY]]** noalias %4)
+// CHECK: [[PRIVATES:%.+]] = load [[PRIVATES_TMAIN_TY]]*, [[PRIVATES_TMAIN_TY]]**
+// CHECK: [[PRIV_T_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 0
+// CHECK: [[ARG1:%.+]] = load i32**, i32*** %{{.+}},
+// CHECK: store i32* [[PRIV_T_VAR]], i32** [[ARG1]],
+// CHECK: [[PRIV_VEC:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 1
+// CHECK: [[ARG2:%.+]] = load [2 x i32]**, [2 x i32]*** %{{.+}},
+// CHECK: store [2 x i32]* [[PRIV_VEC]], [2 x i32]** [[ARG2]],
+// CHECK: [[PRIV_S_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 2
+// CHECK: [[ARG3:%.+]] = load [2 x [[S_INT_TY]]]**, [2 x [[S_INT_TY]]]*** %{{.+}},
+// CHECK: store [2 x [[S_INT_TY]]]* [[PRIV_S_VAR]], [2 x [[S_INT_TY]]]** [[ARG3]],
+// CHECK: [[PRIV_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 3
+// CHECK: [[ARG4:%.+]] = load [[S_INT_TY]]**, [[S_INT_TY]]*** {{.+}},
+// CHECK: store [[S_INT_TY]]* [[PRIV_VAR]], [[S_INT_TY]]** [[ARG4]],
+// CHECK: ret void
+
+// CHECK: define internal i32 [[TASK_ENTRY]](i32 %0, [[KMP_TASK_TMAIN_TY]]* noalias %1)
+// CHECK: alloca i32*,
+// CHECK-DAG: [[PRIV_T_VAR_ADDR:%.+]] = alloca i32*,
+// CHECK-DAG: [[PRIV_VEC_ADDR:%.+]] = alloca [2 x i32]*,
+// CHECK-DAG: [[PRIV_S_ARR_ADDR:%.+]] = alloca [2 x [[S_INT_TY]]]*,
+// CHECK-DAG: [[PRIV_VAR_ADDR:%.+]] = alloca [[S_INT_TY]]*,
+// CHECK: store void (i8*, ...)* bitcast (void ([[PRIVATES_TMAIN_TY]]*, i32**, [2 x i32]**, [2 x [[S_INT_TY]]]**, [[S_INT_TY]]**)* [[PRIVATES_MAP_FN]] to void (i8*, ...)*), void (i8*, ...)** [[MAP_FN_ADDR:%.+]],
+// CHECK: [[MAP_FN:%.+]] = load void (i8*, ...)*, void (i8*, ...)** [[MAP_FN_ADDR]],
+// CHECK: call void (i8*, ...) [[MAP_FN]](i8* %{{.+}}, i32** [[PRIV_T_VAR_ADDR]], [2 x i32]** [[PRIV_VEC_ADDR]], [2 x [[S_INT_TY]]]** [[PRIV_S_ARR_ADDR]], [[S_INT_TY]]** [[PRIV_VAR_ADDR]])
+// CHECK: [[PRIV_T_VAR:%.+]] = load i32*, i32** [[PRIV_T_VAR_ADDR]],
+// CHECK: [[PRIV_VEC:%.+]] = load [2 x i32]*, [2 x i32]** [[PRIV_VEC_ADDR]],
+// CHECK: [[PRIV_S_ARR:%.+]] = load [2 x [[S_INT_TY]]]*, [2 x [[S_INT_TY]]]** [[PRIV_S_ARR_ADDR]],
+// CHECK: [[PRIV_VAR:%.+]] = load [[S_INT_TY]]*, [[S_INT_TY]]** [[PRIV_VAR_ADDR]],
+
+// Privates actually are used.
+// CHECK-DAG: [[PRIV_VAR]]
+// CHECK-DAG: [[PRIV_T_VAR]]
+// CHECK-DAG: [[PRIV_S_ARR]]
+// CHECK-DAG: [[PRIV_VEC]]
+
+// CHECK: icmp ne i32 %{{.+}}, 0
+// CHECK-NEXT: br i1
+// CHECK: load i32, i32* %
+// CHECK: store i32 %{{.+}}, i32* %
+// CHECK: bitcast [2 x i32]* %{{.+}} to i8*
+// CHECK: bitcast [2 x i32]* %{{.+}} to i8*
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align {{[0-9]+}} %
+// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* %
+// CHECK: phi [[S_INT_TY]]*
+// CHECK: phi [[S_INT_TY]]*
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align {{[0-9]+}} %
+// CHECK: icmp eq [[S_INT_TY]]* %
+// CHECK-NEXT: br i1
+// CHECK: bitcast [[S_INT_TY]]* %{{.+}} to i8*
+// CHECK: bitcast [[S_INT_TY]]* %{{.+}} to i8*
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align {{[0-9]+}} %
+// CHECK: br label
+// CHECK: ret
+
+// CHECK: define internal void [[TMAIN_DUP]]([[KMP_TASK_TMAIN_TY]]* %0, [[KMP_TASK_TMAIN_TY]]* %1, i32 %2)
+// CHECK: getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* %{{.+}}, i32 0, i32 8
+// CHECK: load i32, i32* %
+// CHECK: store i32 %{{.+}}, i32* %
+// CHECK: getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* %{{.+}}, i32 0, i32 2
+// CHECK: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* %{{.+}}, i32 0, i32 2
+// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i64 2
+// CHECK: br label %
+
+// CHECK: phi [[S_INT_TY]]*
+// CHECK: call {{.*}} [[S_INT_TY_CONSTR]]([[S_INT_TY]]*
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i64 1
+// CHECK: icmp eq [[S_INT_TY]]* %
+// CHECK: br i1 %
+
+// CHECK: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* %{{.+}}, i32 0, i32 3
+// CHECK: call {{.*}} [[S_INT_TY_CONSTR]]([[S_INT_TY]]*
+// CHECK: ret void
+
+// CHECK: define internal i32 [[DESTRUCTORS]](i32 %0, [[KMP_TASK_TMAIN_TY]]* noalias %1)
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: call void [[S_INT_TY_DESTR]]([[S_INT_TY]]* [[PRIVATE_VAR_REF]])
+// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* [[PRIVATE_S_ARR_REF]], i{{.+}} 0, i{{.+}} 0
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i{{.+}} 2
+// CHECK: [[PRIVATE_S_ARR_ELEM_REF:%.+]] = getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i{{.+}} -1
+// CHECK: call void [[S_INT_TY_DESTR]]([[S_INT_TY]]* [[PRIVATE_S_ARR_ELEM_REF]])
+// CHECK: icmp eq
+// CHECK: br i1
+// CHECK: ret i32
+
+#endif
+#elif defined(ARRAY)
+// ARRAY-LABEL: array_func
+struct St {
+ int a, b;
+ St() : a(0), b(0) {}
+ St(const St &) {}
+ ~St() {}
+};
+
+void array_func(int n, float a[n], St s[2]) {
+// ARRAY: call i8* @__kmpc_omp_task_alloc(
+// ARRAY: call void @__kmpc_taskloop(
+// ARRAY: store float** %{{.+}}, float*** %{{.+}},
+// ARRAY: store %struct.St** %{{.+}}, %struct.St*** %{{.+}},
+// ARRAY: icmp ne i32 %{{.+}}, 0
+// ARRAY: store float* %{{.+}}, float** %{{.+}},
+// ARRAY: store %struct.St* %{{.+}}, %struct.St** %{{.+}},
+#pragma omp master taskloop lastprivate(a, s)
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+#else
+
+// LOOP-LABEL: loop
+void loop() {
+// LOOP: call i8* @__kmpc_omp_task_alloc(
+// LOOP: call void @__kmpc_taskloop(
+ int i;
+#pragma omp master taskloop lastprivate(i)
+ for (i = 0; i < 10; ++i)
+ ;
+}
+#endif
+
diff --git a/src/llvm-project/clang/test/OpenMP/master_taskloop_lastprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/master_taskloop_lastprivate_messages.cpp
new file mode 100644
index 0000000..86623a5
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/master_taskloop_lastprivate_messages.cpp
@@ -0,0 +1,305 @@
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp-simd %s -Wuninitialized
+
+typedef void **omp_allocator_handle_t;
+extern const omp_allocator_handle_t omp_default_mem_alloc;
+extern const omp_allocator_handle_t omp_large_cap_mem_alloc;
+extern const omp_allocator_handle_t omp_const_mem_alloc;
+extern const omp_allocator_handle_t omp_high_bw_mem_alloc;
+extern const omp_allocator_handle_t omp_low_lat_mem_alloc;
+extern const omp_allocator_handle_t omp_cgroup_mem_alloc;
+extern const omp_allocator_handle_t omp_pteam_mem_alloc;
+extern const omp_allocator_handle_t omp_thread_mem_alloc;
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+struct S1; // expected-note 2 {{declared here}} expected-note 2 {{forward declaration of 'S1'}}
+extern S1 a;
+class S2 {
+ mutable int a;
+
+public:
+ S2() : a(0) {}
+ S2(S2 &s2) : a(s2.a) {}
+ const S2 &operator =(const S2&) const;
+ S2 &operator =(const S2&);
+ static float S2s; // expected-note {{static data member is predetermined as shared}}
+ static const float S2sc; // expected-note {{'S2sc' declared here}}
+};
+const float S2::S2sc = 0;
+const S2 b;
+const S2 ba[5];
+class S3 {
+ int a;
+ S3 &operator=(const S3 &s3); // expected-note 2 {{implicitly declared private here}}
+
+public:
+ S3() : a(0) {}
+ S3(S3 &s3) : a(s3.a) {}
+};
+const S3 c; // expected-note {{'c' defined here}}
+const S3 ca[5]; // expected-note {{'ca' defined here}}
+extern const int f; // expected-note {{'f' declared here}}
+class S4 {
+ int a;
+ S4(); // expected-note 3 {{implicitly declared private here}}
+ S4(const S4 &s4);
+
+public:
+ S4(int v) : a(v) {}
+};
+class S5 {
+ int a;
+ S5() : a(0) {} // expected-note {{implicitly declared private here}}
+
+public:
+ S5(const S5 &s5) : a(s5.a) {}
+ S5(int v) : a(v) {}
+};
+class S6 {
+ int a;
+ S6() : a(0) {}
+
+public:
+ S6(const S6 &s6) : a(s6.a) {}
+ S6(int v) : a(v) {}
+};
+
+S3 h;
+#pragma omp threadprivate(h) // expected-note 2 {{defined as threadprivate or thread local}}
+
+template <class I, class C>
+int foomain(int argc, char **argv) {
+ I e(4);
+ I g(5);
+ int i, z;
+ int &j = i;
+#pragma omp parallel
+#pragma omp master taskloop lastprivate // expected-error {{expected '(' after 'lastprivate'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop lastprivate( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop lastprivate() // expected-error {{expected expression}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(conditional: argc) lastprivate(conditional: // expected-error 2 {{use of undeclared identifier 'conditional'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(S1) // expected-error {{'S1' does not refer to a value}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(a, b) // expected-error {{lastprivate variable with incomplete type 'S1'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(argv[1]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(z, e, g) // expected-error 2 {{calling a private constructor of class 'S4'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(h) // expected-error {{threadprivate or thread local variable cannot be lastprivate}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+ {
+ int v = 0;
+ int i;
+#pragma omp master taskloop allocate(omp_thread_mem_alloc: i) lastprivate(i) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'master taskloop' directive}}
+ for (int k = 0; k < argc; ++k) {
+ i = k;
+ v += i;
+ }
+ }
+#pragma omp parallel shared(i)
+#pragma omp parallel private(i)
+#pragma omp master taskloop lastprivate(j)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(i)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+ return 0;
+}
+
+void bar(S4 a[2]) {
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(a)
+ for (int i = 0; i < 2; ++i)
+ foo();
+}
+
+namespace A {
+double x;
+#pragma omp threadprivate(x) // expected-note {{defined as threadprivate or thread local}}
+}
+namespace B {
+using A::x;
+}
+
+int main(int argc, char **argv) {
+ const int d = 5; // expected-note {{'d' defined here}}
+ const int da[5] = {0}; // expected-note {{'da' defined here}}
+ S4 e(4);
+ S5 g(5);
+ S3 m;
+ S6 n(2);
+ int i, z;
+ int &j = i;
+#pragma omp parallel
+#pragma omp master taskloop lastprivate // expected-error {{expected '(' after 'lastprivate'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop lastprivate( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop lastprivate() // expected-error {{expected expression}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(argc, z)
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(S1) // expected-error {{'S1' does not refer to a value}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(a, b, c, d, f) // expected-error {{lastprivate variable with incomplete type 'S1'}} expected-error 1 {{const-qualified variable without mutable fields cannot be lastprivate}} expected-error 2 {{const-qualified variable cannot be lastprivate}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(argv[1]) // expected-error {{expected variable name}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(2 * 2) // expected-error {{expected variable name}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(ba)
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(ca) // expected-error {{const-qualified variable without mutable fields cannot be lastprivate}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(da) // expected-error {{const-qualified variable cannot be lastprivate}}
+ for (i = 0; i < argc; ++i)
+ foo();
+ int xa;
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(xa) // OK
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(S2::S2s) // expected-error {{shared variable cannot be lastprivate}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(S2::S2sc) // expected-error {{const-qualified variable cannot be lastprivate}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop safelen(5) // expected-error {{unexpected OpenMP clause 'safelen' in directive '#pragma omp master taskloop'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(m) // expected-error {{'operator=' is a private member of 'S3'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(h) // expected-error {{threadprivate or thread local variable cannot be lastprivate}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(B::x) // expected-error {{threadprivate or thread local variable cannot be lastprivate}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop private(xa), lastprivate(xa) // expected-error {{private variable cannot be lastprivate}} expected-note {{defined as private}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(i)
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel private(xa)
+#pragma omp master taskloop lastprivate(xa)
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel reduction(+ : xa)
+#pragma omp master taskloop lastprivate(xa)
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(j)
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop firstprivate(m) lastprivate(m) // expected-error {{'operator=' is a private member of 'S3'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(n) firstprivate(n) // OK
+ for (i = 0; i < argc; ++i)
+ foo();
+ static int si;
+#pragma omp master taskloop lastprivate(si) // OK
+ for (i = 0; i < argc; ++i)
+ si = i + 1;
+ return foomain<S4, S5>(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<S4, S5>' requested here}}
+}
diff --git a/src/llvm-project/clang/test/OpenMP/master_taskloop_loop_messages.cpp b/src/llvm-project/clang/test/OpenMP/master_taskloop_loop_messages.cpp
new file mode 100644
index 0000000..9b50439
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/master_taskloop_loop_messages.cpp
@@ -0,0 +1,741 @@
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wuninitialized
+
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wuninitialized
+
+class S {
+ int a;
+ S() : a(0) {}
+
+public:
+ S(int v) : a(v) {}
+ S(const S &s) : a(s.a) {}
+};
+
+static int sii;
+// expected-note@+1 {{defined as threadprivate or thread local}}
+#pragma omp threadprivate(sii)
+static int globalii;
+
+// Currently, we cannot use "0" for global register variables.
+// register int reg0 __asm__("0");
+int reg0;
+
+int test_iteration_spaces() {
+ const int N = 100;
+ float a[N], b[N], c[N];
+ int ii, jj, kk;
+ float fii;
+ double dii;
+ register int reg; // expected-warning {{'register' storage class specifier is deprecated}}
+#pragma omp parallel
+#pragma omp master taskloop
+ for (int i = 0; i < 10; i += 1) {
+ c[i] = a[i] + b[i];
+ }
+#pragma omp parallel
+#pragma omp master taskloop
+ for (char i = 0; i < 10; i++) {
+ c[i] = a[i] + b[i];
+ }
+#pragma omp parallel
+#pragma omp master taskloop
+ for (char i = 0; i < 10; i += '\1') {
+ c[i] = a[i] + b[i];
+ }
+#pragma omp parallel
+#pragma omp master taskloop
+ for (long long i = 0; i < 10; i++) {
+ c[i] = a[i] + b[i];
+ }
+#pragma omp parallel
+// expected-error@+2 {{expression must have integral or unscoped enumeration type, not 'double'}}
+#pragma omp master taskloop
+ for (long long i = 0; i < 10; i += 1.5) {
+ c[i] = a[i] + b[i];
+ }
+#pragma omp parallel
+#pragma omp master taskloop
+ for (long long i = 0; i < 'z'; i += 1u) {
+ c[i] = a[i] + b[i];
+ }
+#pragma omp parallel
+// expected-error@+2 {{variable must be of integer or random access iterator type}}
+#pragma omp master taskloop
+ for (float fi = 0; fi < 10.0; fi++) {
+ c[(int)fi] = a[(int)fi] + b[(int)fi];
+ }
+#pragma omp parallel
+// expected-error@+2 {{variable must be of integer or random access iterator type}}
+#pragma omp master taskloop
+ for (double fi = 0; fi < 10.0; fi++) {
+ c[(int)fi] = a[(int)fi] + b[(int)fi];
+ }
+#pragma omp parallel
+// expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp master taskloop
+ for (int &ref = ii; ref < 10; ref++) {
+ }
+#pragma omp parallel
+// expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp master taskloop
+ for (int i; i < 10; i++)
+ c[i] = a[i];
+
+#pragma omp parallel
+// expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp master taskloop
+ for (int i = 0, j = 0; i < 10; ++i)
+ c[i] = a[i];
+
+#pragma omp parallel
+// expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp master taskloop
+ for (; ii < 10; ++ii)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-warning@+3 {{expression result unused}}
+// expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp master taskloop
+ for (ii + 1; ii < 10; ++ii)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp master taskloop
+ for (c[ii] = 0; ii < 10; ++ii)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// Ok to skip parenthesises.
+#pragma omp master taskloop
+ for (((ii)) = 0; ii < 10; ++ii)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
+#pragma omp master taskloop
+ for (int i = 0; i; i++)
+ c[i] = a[i];
+
+#pragma omp parallel
+// omp4-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'i'}}
+#pragma omp master taskloop
+ for (int i = 0; jj < kk; ii++)
+ c[i] = a[i];
+
+#pragma omp parallel
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
+#pragma omp master taskloop
+ for (int i = 0; !!i; i++)
+ c[i] = a[i];
+
+// Ok
+#pragma omp parallel
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+#pragma omp master taskloop
+ for (int i = 0; i != 1; i++)
+ c[i] = a[i];
+
+#pragma omp parallel
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
+#pragma omp master taskloop
+ for (int i = 0;; i++)
+ c[i] = a[i];
+
+#pragma omp parallel
+// Ok.
+#pragma omp master taskloop
+ for (int i = 11; i > 10; i--)
+ c[i] = a[i];
+
+#pragma omp parallel
+// Ok.
+#pragma omp master taskloop
+ for (int i = 0; i < 10; ++i)
+ c[i] = a[i];
+
+#pragma omp parallel
+// Ok.
+#pragma omp master taskloop
+ for (ii = 0; ii < 10; ++ii)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
+#pragma omp master taskloop
+ for (ii = 0; ii < 10; ++jj)
+ c[ii] = a[jj];
+
+#pragma omp parallel
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
+#pragma omp master taskloop
+ for (ii = 0; ii < 10; ++++ii)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// Ok but undefined behavior (in general, cannot check that incr
+// is really loop-invariant).
+#pragma omp master taskloop
+ for (ii = 0; ii < 10; ii = ii + ii)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-error@+2 {{expression must have integral or unscoped enumeration type, not 'float'}}
+#pragma omp master taskloop
+ for (ii = 0; ii < 10; ii = ii + 1.0f)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// Ok - step was converted to integer type.
+#pragma omp master taskloop
+ for (ii = 0; ii < 10; ii = ii + (int)1.1f)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
+#pragma omp master taskloop
+ for (ii = 0; ii < 10; jj = ii + 2)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-warning@+3 {{relational comparison result unused}}
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
+#pragma omp master taskloop
+ for (ii = 0; ii<10; jj> kk + 2)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
+#pragma omp master taskloop
+ for (ii = 0; ii < 10;)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-warning@+3 {{expression result unused}}
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
+#pragma omp master taskloop
+ for (ii = 0; ii < 10; !ii)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
+#pragma omp master taskloop
+ for (ii = 0; ii < 10; ii ? ++ii : ++jj)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
+#pragma omp master taskloop
+ for (ii = 0; ii < 10; ii = ii < 10)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be positive due to this condition}}
+// expected-error@+2 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
+#pragma omp master taskloop
+ for (ii = 0; ii < 10; ii = ii + 0)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be positive due to this condition}}
+// expected-error@+2 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
+#pragma omp master taskloop
+ for (ii = 0; ii < 10; ii = ii + (int)(0.8 - 0.45))
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be positive due to this condition}}
+// expected-error@+2 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
+#pragma omp master taskloop
+ for (ii = 0; (ii) < 10; ii -= 25)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be positive due to this condition}}
+// expected-error@+2 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
+#pragma omp master taskloop
+ for (ii = 0; (ii < 10); ii -= 0)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be negative due to this condition}}
+// expected-error@+2 {{increment expression must cause 'ii' to decrease on each iteration of OpenMP for loop}}
+#pragma omp master taskloop
+ for (ii = 0; ii > 10; (ii += 0))
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be positive due to this condition}}
+// expected-error@+2 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
+#pragma omp master taskloop
+ for (ii = 0; ii < 10; (ii) = (1 - 1) + (ii))
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be negative due to this condition}}
+// expected-error@+2 {{increment expression must cause 'ii' to decrease on each iteration of OpenMP for loop}}
+#pragma omp master taskloop
+ for ((ii = 0); ii > 10; (ii -= 0))
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be positive due to this condition}}
+// expected-error@+2 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
+#pragma omp master taskloop
+ for (ii = 0; (ii < 10); (ii -= 0))
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-note@+2 {{defined as firstprivate}}
+// expected-error@+2 {{loop iteration variable in the associated loop of 'omp master taskloop' directive may not be firstprivate, predetermined as private}}
+#pragma omp master taskloop firstprivate(ii)
+ for (ii = 0; ii < 10; ii++)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-error@+1 {{unexpected OpenMP clause 'linear' in directive '#pragma omp master taskloop'}}
+#pragma omp master taskloop linear(ii)
+ for (ii = 0; ii < 10; ii++)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+#pragma omp master taskloop private(ii)
+ for (ii = 0; ii < 10; ii++)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(ii)
+ for (ii = 0; ii < 10; ii++)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+ {
+// expected-error@+2 {{loop iteration variable in the associated loop of 'omp master taskloop' directive may not be threadprivate or thread local, predetermined as private}}
+#pragma omp master taskloop
+ for (sii = 0; sii < 10; sii += 1)
+ c[sii] = a[sii];
+ }
+
+#pragma omp parallel
+ {
+#pragma omp master taskloop
+ for (reg0 = 0; reg0 < 10; reg0 += 1)
+ c[reg0] = a[reg0];
+ }
+
+#pragma omp parallel
+ {
+#pragma omp master taskloop
+ for (reg = 0; reg < 10; reg += 1)
+ c[reg] = a[reg];
+ }
+
+#pragma omp parallel
+ {
+#pragma omp master taskloop
+ for (globalii = 0; globalii < 10; globalii += 1)
+ c[globalii] = a[globalii];
+ }
+
+#pragma omp parallel
+ {
+#pragma omp master taskloop collapse(2)
+ for (ii = 0; ii < 10; ii += 1)
+ for (globalii = 0; globalii < 10; globalii += 1)
+ c[globalii] += a[globalii] + ii;
+ }
+
+#pragma omp parallel
+// omp4-error@+2 {{statement after '#pragma omp master taskloop' must be a for loop}}
+#pragma omp master taskloop
+ for (auto &item : a) {
+ item = item + 1;
+ }
+
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be positive due to this condition}}
+// expected-error@+2 {{increment expression must cause 'i' to increase on each iteration of OpenMP for loop}}
+#pragma omp master taskloop
+ for (unsigned i = 9; i < 10; i--) {
+ c[i] = a[i] + b[i];
+ }
+
+ int(*lb)[4] = nullptr;
+#pragma omp parallel
+#pragma omp master taskloop
+ for (int(*p)[4] = lb; p < lb + 8; ++p) {
+ }
+
+#pragma omp parallel
+// expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp master taskloop
+ for (int a{0}; a < 10; ++a) {
+ }
+
+ return 0;
+}
+
+// Iterators allowed in openmp for-loops.
+namespace std {
+struct random_access_iterator_tag {};
+template <class Iter>
+struct iterator_traits {
+ typedef typename Iter::difference_type difference_type;
+ typedef typename Iter::iterator_category iterator_category;
+};
+template <class Iter>
+typename iterator_traits<Iter>::difference_type
+distance(Iter first, Iter last) { return first - last; }
+}
+class Iter0 {
+public:
+ Iter0() {}
+ Iter0(const Iter0 &) {}
+ Iter0 operator++() { return *this; }
+ Iter0 operator--() { return *this; }
+ bool operator<(Iter0 a) { return true; }
+};
+// expected-note@+2 {{candidate function not viable: no known conversion from 'GoodIter' to 'Iter0' for 1st argument}}
+// expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter1' to 'Iter0' for 1st argument}}
+int operator-(Iter0 a, Iter0 b) { return 0; }
+class Iter1 {
+public:
+ Iter1(float f = 0.0f, double d = 0.0) {}
+ Iter1(const Iter1 &) {}
+ Iter1 operator++() { return *this; }
+ Iter1 operator--() { return *this; }
+ bool operator<(Iter1 a) { return true; }
+ bool operator>=(Iter1 a) { return false; }
+};
+class GoodIter {
+public:
+ GoodIter() {}
+ GoodIter(const GoodIter &) {}
+ GoodIter(int fst, int snd) {}
+ GoodIter &operator=(const GoodIter &that) { return *this; }
+ GoodIter &operator=(const Iter0 &that) { return *this; }
+ GoodIter &operator+=(int x) { return *this; }
+ GoodIter &operator-=(int x) { return *this; }
+ explicit GoodIter(void *) {}
+ GoodIter operator++() { return *this; }
+ GoodIter operator--() { return *this; }
+ bool operator!() { return true; }
+ bool operator<(GoodIter a) { return true; }
+ bool operator<=(GoodIter a) { return true; }
+ bool operator>=(GoodIter a) { return false; }
+ typedef int difference_type;
+ typedef std::random_access_iterator_tag iterator_category;
+};
+// expected-note@+2 {{candidate function not viable: no known conversion from 'const Iter0' to 'GoodIter' for 2nd argument}}
+// expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter1' to 'GoodIter' for 1st argument}}
+int operator-(GoodIter a, GoodIter b) { return 0; }
+// expected-note@+1 3 {{candidate function not viable: requires single argument 'a', but 2 arguments were provided}}
+GoodIter operator-(GoodIter a) { return a; }
+// expected-note@+2 {{candidate function not viable: no known conversion from 'const Iter0' to 'int' for 2nd argument}}
+// expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter1' to 'GoodIter' for 1st argument}}
+GoodIter operator-(GoodIter a, int v) { return GoodIter(); }
+// expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter0' to 'GoodIter' for 1st argument}}
+GoodIter operator+(GoodIter a, int v) { return GoodIter(); }
+// expected-note@+2 {{candidate function not viable: no known conversion from 'GoodIter' to 'int' for 1st argument}}
+// expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter1' to 'int' for 1st argument}}
+GoodIter operator-(int v, GoodIter a) { return GoodIter(); }
+// expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter0' to 'int' for 1st argument}}
+GoodIter operator+(int v, GoodIter a) { return GoodIter(); }
+
+int test_with_random_access_iterator() {
+ GoodIter begin, end;
+ Iter0 begin0, end0;
+#pragma omp parallel
+#pragma omp master taskloop
+ for (GoodIter I = begin; I < end; ++I)
+ ++I;
+#pragma omp parallel
+// expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp master taskloop
+ for (GoodIter &I = begin; I < end; ++I)
+ ++I;
+#pragma omp parallel
+#pragma omp master taskloop
+ for (GoodIter I = begin; I >= end; --I)
+ ++I;
+#pragma omp parallel
+// expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp master taskloop
+ for (GoodIter I(begin); I < end; ++I)
+ ++I;
+#pragma omp parallel
+// expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp master taskloop
+ for (GoodIter I(nullptr); I < end; ++I)
+ ++I;
+#pragma omp parallel
+// expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp master taskloop
+ for (GoodIter I(0); I < end; ++I)
+ ++I;
+#pragma omp parallel
+// expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp master taskloop
+ for (GoodIter I(1, 2); I < end; ++I)
+ ++I;
+#pragma omp parallel
+#pragma omp master taskloop
+ for (begin = GoodIter(0); begin < end; ++begin)
+ ++begin;
+// expected-error@+4 {{invalid operands to binary expression ('GoodIter' and 'const Iter0')}}
+// expected-error@+3 {{could not calculate number of iterations calling 'operator-' with upper and lower loop bounds}}
+#pragma omp parallel
+#pragma omp master taskloop
+ for (begin = begin0; begin < end; ++begin)
+ ++begin;
+#pragma omp parallel
+// expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp master taskloop
+ for (++begin; begin < end; ++begin)
+ ++begin;
+#pragma omp parallel
+#pragma omp master taskloop
+ for (begin = end; begin < end; ++begin)
+ ++begin;
+#pragma omp parallel
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
+#pragma omp master taskloop
+ for (GoodIter I = begin; I - I; ++I)
+ ++I;
+#pragma omp parallel
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
+#pragma omp master taskloop
+ for (GoodIter I = begin; begin < end; ++I)
+ ++I;
+#pragma omp parallel
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
+#pragma omp master taskloop
+ for (GoodIter I = begin; !I; ++I)
+ ++I;
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be negative due to this condition}}
+// expected-error@+2 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
+#pragma omp master taskloop
+ for (GoodIter I = begin; I >= end; I = I + 1)
+ ++I;
+#pragma omp parallel
+#pragma omp master taskloop
+ for (GoodIter I = begin; I >= end; I = I - 1)
+ ++I;
+#pragma omp parallel
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'I'}}
+#pragma omp master taskloop
+ for (GoodIter I = begin; I >= end; I = -I)
+ ++I;
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be negative due to this condition}}
+// expected-error@+2 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
+#pragma omp master taskloop
+ for (GoodIter I = begin; I >= end; I = 2 + I)
+ ++I;
+#pragma omp parallel
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'I'}}
+#pragma omp master taskloop
+ for (GoodIter I = begin; I >= end; I = 2 - I)
+ ++I;
+// In the following example, we cannot update the loop variable using '+='
+// expected-error@+3 {{invalid operands to binary expression ('Iter0' and 'int')}}
+#pragma omp parallel
+#pragma omp master taskloop
+ for (Iter0 I = begin0; I < end0; ++I)
+ ++I;
+#pragma omp parallel
+// Initializer is constructor without params.
+// expected-error@+3 {{invalid operands to binary expression ('Iter0' and 'int')}}
+// expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp master taskloop
+ for (Iter0 I; I < end0; ++I)
+ ++I;
+ Iter1 begin1, end1;
+// expected-error@+4 {{invalid operands to binary expression ('Iter1' and 'Iter1')}}
+// expected-error@+3 {{could not calculate number of iterations calling 'operator-' with upper and lower loop bounds}}
+#pragma omp parallel
+#pragma omp master taskloop
+ for (Iter1 I = begin1; I < end1; ++I)
+ ++I;
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be negative due to this condition}}
+// expected-error@+2 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
+#pragma omp master taskloop
+ for (Iter1 I = begin1; I >= end1; ++I)
+ ++I;
+#pragma omp parallel
+// expected-error@+5 {{invalid operands to binary expression ('Iter1' and 'float')}}
+// expected-error@+4 {{could not calculate number of iterations calling 'operator-' with upper and lower loop bounds}}
+// Initializer is constructor with all default params.
+// expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp master taskloop
+ for (Iter1 I; I < end1; ++I) {
+ }
+ return 0;
+}
+
+template <typename IT, int ST>
+class TC {
+public:
+ int dotest_lt(IT begin, IT end) {
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be positive due to this condition}}
+// expected-error@+2 {{increment expression must cause 'I' to increase on each iteration of OpenMP for loop}}
+#pragma omp master taskloop
+ for (IT I = begin; I < end; I = I + ST) {
+ ++I;
+ }
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be positive due to this condition}}
+// expected-error@+2 {{increment expression must cause 'I' to increase on each iteration of OpenMP for loop}}
+#pragma omp master taskloop
+ for (IT I = begin; I <= end; I += ST) {
+ ++I;
+ }
+#pragma omp parallel
+#pragma omp master taskloop
+ for (IT I = begin; I < end; ++I) {
+ ++I;
+ }
+ }
+
+ static IT step() {
+ return IT(ST);
+ }
+};
+template <typename IT, int ST = 0>
+int dotest_gt(IT begin, IT end) {
+#pragma omp parallel
+// expected-note@+3 2 {{loop step is expected to be negative due to this condition}}
+// expected-error@+2 2 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
+#pragma omp master taskloop
+ for (IT I = begin; I >= end; I = I + ST) {
+ ++I;
+ }
+#pragma omp parallel
+// expected-note@+3 2 {{loop step is expected to be negative due to this condition}}
+// expected-error@+2 2 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
+#pragma omp master taskloop
+ for (IT I = begin; I >= end; I += ST) {
+ ++I;
+ }
+
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be negative due to this condition}}
+// expected-error@+2 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
+#pragma omp master taskloop
+ for (IT I = begin; I >= end; ++I) {
+ ++I;
+ }
+
+#pragma omp parallel
+#pragma omp master taskloop
+ for (IT I = begin; I < end; I += TC<int, ST>::step()) {
+ ++I;
+ }
+}
+
+void test_with_template() {
+ GoodIter begin, end;
+ TC<GoodIter, 100> t1;
+ TC<GoodIter, -100> t2;
+ t1.dotest_lt(begin, end);
+ t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC<GoodIter, -100>::dotest_lt' requested here}}
+ dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt<GoodIter, 0>' requested here}}
+ dotest_gt<unsigned, 10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, 10>' requested here}}
+}
+
+void test_loop_break() {
+ const int N = 100;
+ float a[N], b[N], c[N];
+#pragma omp parallel
+#pragma omp master taskloop
+ for (int i = 0; i < 10; i++) {
+ c[i] = a[i] + b[i];
+ for (int j = 0; j < 10; ++j) {
+ if (a[i] > b[j])
+ break; // OK in nested loop
+ }
+ switch (i) {
+ case 1:
+ b[i]++;
+ break;
+ default:
+ break;
+ }
+ if (c[i] > 10)
+ break; // expected-error {{'break' statement cannot be used in OpenMP for loop}}
+
+ if (c[i] > 11)
+ break; // expected-error {{'break' statement cannot be used in OpenMP for loop}}
+ }
+
+#pragma omp parallel
+#pragma omp master taskloop
+ for (int i = 0; i < 10; i++) {
+ for (int j = 0; j < 10; j++) {
+ c[i] = a[i] + b[i];
+ if (c[i] > 10) {
+ if (c[i] < 20) {
+ break; // OK
+ }
+ }
+ }
+ }
+}
+
+void test_loop_eh() {
+ const int N = 100;
+ float a[N], b[N], c[N];
+#pragma omp parallel
+#pragma omp master taskloop
+ for (int i = 0; i < 10; i++) {
+ c[i] = a[i] + b[i];
+ try {
+ for (int j = 0; j < 10; ++j) {
+ if (a[i] > b[j])
+ throw a[i];
+ }
+ throw a[i];
+ } catch (float f) {
+ if (f > 0.1)
+ throw a[i];
+ return; // expected-error {{cannot return from OpenMP region}}
+ }
+ switch (i) {
+ case 1:
+ b[i]++;
+ break;
+ default:
+ break;
+ }
+ for (int j = 0; j < 10; j++) {
+ if (c[i] > 10)
+ throw c[i];
+ }
+ }
+ if (c[9] > 10)
+ throw c[9]; // OK
+
+#pragma omp parallel
+#pragma omp master taskloop
+ for (int i = 0; i < 10; ++i) {
+ struct S {
+ void g() { throw 0; }
+ };
+ }
+}
+
+void test_loop_firstprivate_lastprivate() {
+ S s(4);
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(s) firstprivate(s)
+ for (int i = 0; i < 16; ++i)
+ ;
+}
+
diff --git a/src/llvm-project/clang/test/OpenMP/master_taskloop_misc_messages.c b/src/llvm-project/clang/test/OpenMP/master_taskloop_misc_messages.c
new file mode 100644
index 0000000..17f2831
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/master_taskloop_misc_messages.c
@@ -0,0 +1,382 @@
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -triple x86_64-unknown-unknown -verify %s -Wuninitialized
+
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -triple x86_64-unknown-unknown -verify %s -Wuninitialized
+
+void xxx(int argc) {
+ int x; // expected-note {{initialize the variable 'x' to silence this warning}}
+#pragma omp master taskloop
+ for (int i = 0; i < 10; ++i)
+ argc = x; // expected-warning {{variable 'x' is uninitialized when used here}}
+}
+
+// expected-error@+1 {{unexpected OpenMP directive '#pragma omp master taskloop'}}
+#pragma omp master taskloop
+
+// expected-error@+1 {{unexpected OpenMP directive '#pragma omp master taskloop'}}
+#pragma omp master taskloop foo
+
+void test_no_clause() {
+ int i;
+#pragma omp master taskloop
+ for (i = 0; i < 16; ++i)
+ ;
+
+// expected-error@+2 {{statement after '#pragma omp master taskloop' must be a for loop}}
+#pragma omp master taskloop
+ ++i;
+}
+
+void test_branch_protected_scope() {
+ int i = 0;
+L1:
+ ++i;
+
+ int x[24];
+
+#pragma omp parallel
+#pragma omp master taskloop
+ for (i = 0; i < 16; ++i) {
+ if (i == 5)
+ goto L1; // expected-error {{use of undeclared label 'L1'}}
+ else if (i == 6)
+ return; // expected-error {{cannot return from OpenMP region}}
+ else if (i == 7)
+ goto L2;
+ else if (i == 8) {
+ L2:
+ x[i]++;
+ }
+ }
+
+ if (x[0] == 0)
+ goto L2; // expected-error {{use of undeclared label 'L2'}}
+ else if (x[1] == 1)
+ goto L1;
+}
+
+void test_invalid_clause() {
+ int i;
+#pragma omp parallel
+// expected-warning@+1 {{extra tokens at the end of '#pragma omp master taskloop' are ignored}}
+#pragma omp master taskloop foo bar
+ for (i = 0; i < 16; ++i)
+ ;
+// expected-error@+1 {{directive '#pragma omp master taskloop' cannot contain more than one 'nogroup' clause}}
+#pragma omp master taskloop nogroup nogroup
+ for (i = 0; i < 16; ++i)
+ ;
+}
+
+void test_non_identifiers() {
+ int i, x;
+
+#pragma omp parallel
+// expected-warning@+1 {{extra tokens at the end of '#pragma omp master taskloop' are ignored}}
+#pragma omp master taskloop;
+ for (i = 0; i < 16; ++i)
+ ;
+// expected-warning@+3 {{extra tokens at the end of '#pragma omp master taskloop' are ignored}}
+// expected-error@+2 {{unexpected OpenMP clause 'linear' in directive '#pragma omp master taskloop'}}
+#pragma omp parallel
+#pragma omp master taskloop linear(x);
+ for (i = 0; i < 16; ++i)
+ ;
+
+#pragma omp parallel
+// expected-warning@+1 {{extra tokens at the end of '#pragma omp master taskloop' are ignored}}
+#pragma omp master taskloop private(x);
+ for (i = 0; i < 16; ++i)
+ ;
+
+#pragma omp parallel
+// expected-warning@+1 {{extra tokens at the end of '#pragma omp master taskloop' are ignored}}
+#pragma omp master taskloop, private(x);
+ for (i = 0; i < 16; ++i)
+ ;
+}
+
+extern int foo();
+
+void test_collapse() {
+ int i;
+#pragma omp parallel
+// expected-error@+1 {{expected '('}}
+#pragma omp master taskloop collapse
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp master taskloop collapse(
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected expression}}
+#pragma omp master taskloop collapse()
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp master taskloop collapse(,
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp master taskloop collapse(, )
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-warning@+2 {{extra tokens at the end of '#pragma omp master taskloop' are ignored}}
+// expected-error@+1 {{expected '('}}
+#pragma omp master taskloop collapse 4)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}}
+// expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}}
+#pragma omp master taskloop collapse(4
+ for (i = 0; i < 16; ++i)
+ ; // expected-error {{expected 4 for loops after '#pragma omp master taskloop', but found only 1}}
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}}
+// expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}}
+#pragma omp master taskloop collapse(4,
+ for (i = 0; i < 16; ++i)
+ ; // expected-error {{expected 4 for loops after '#pragma omp master taskloop', but found only 1}}
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}}
+// expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}}
+#pragma omp master taskloop collapse(4, )
+ for (i = 0; i < 16; ++i)
+ ; // expected-error {{expected 4 for loops after '#pragma omp master taskloop', but found only 1}}
+#pragma omp parallel
+// expected-note@+1 {{as specified in 'collapse' clause}}
+#pragma omp master taskloop collapse(4)
+ for (i = 0; i < 16; ++i)
+ ; // expected-error {{expected 4 for loops after '#pragma omp master taskloop', but found only 1}}
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}}
+// expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}}
+#pragma omp master taskloop collapse(4 4)
+ for (i = 0; i < 16; ++i)
+ ; // expected-error {{expected 4 for loops after '#pragma omp master taskloop', but found only 1}}
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}}
+// expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}}
+#pragma omp master taskloop collapse(4, , 4)
+ for (i = 0; i < 16; ++i)
+ ; // expected-error {{expected 4 for loops after '#pragma omp master taskloop', but found only 1}}
+#pragma omp parallel
+#pragma omp master taskloop collapse(4)
+ for (int i1 = 0; i1 < 16; ++i1)
+ for (int i2 = 0; i2 < 16; ++i2)
+ for (int i3 = 0; i3 < 16; ++i3)
+ for (int i4 = 0; i4 < 16; ++i4)
+ foo();
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}}
+// expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}}
+#pragma omp master taskloop collapse(4, 8)
+ for (i = 0; i < 16; ++i)
+ ; // expected-error {{expected 4 for loops after '#pragma omp master taskloop', but found only 1}}
+#pragma omp parallel
+// expected-error@+1 {{expression is not an integer constant expression}}
+#pragma omp master taskloop collapse(2.5)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expression is not an integer constant expression}}
+#pragma omp master taskloop collapse(foo())
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}}
+#pragma omp master taskloop collapse(-5)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}}
+#pragma omp master taskloop collapse(0)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}}
+#pragma omp master taskloop collapse(5 - 5)
+ for (i = 0; i < 16; ++i)
+ ;
+}
+
+void test_private() {
+ int i;
+#pragma omp parallel
+// expected-error@+2 {{expected expression}}
+// expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp master taskloop private(
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
+// expected-error@+1 2 {{expected expression}}
+#pragma omp master taskloop private(,
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 2 {{expected expression}}
+#pragma omp master taskloop private(, )
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected expression}}
+#pragma omp master taskloop private()
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected expression}}
+#pragma omp master taskloop private(int)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected variable name}}
+#pragma omp master taskloop private(0)
+ for (i = 0; i < 16; ++i)
+ ;
+
+ int x, y, z;
+#pragma omp parallel
+#pragma omp master taskloop private(x)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+#pragma omp master taskloop private(x, y)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+#pragma omp master taskloop private(x, y, z)
+ for (i = 0; i < 16; ++i) {
+ x = y * i + z;
+ }
+}
+
+void test_lastprivate() {
+ int i;
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
+// expected-error@+1 {{expected expression}}
+#pragma omp master taskloop lastprivate(
+ for (i = 0; i < 16; ++i)
+ ;
+
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
+// expected-error@+1 2 {{expected expression}}
+#pragma omp master taskloop lastprivate(,
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 2 {{expected expression}}
+#pragma omp master taskloop lastprivate(, )
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected expression}}
+#pragma omp master taskloop lastprivate()
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected expression}}
+#pragma omp master taskloop lastprivate(int)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected variable name}}
+#pragma omp master taskloop lastprivate(0)
+ for (i = 0; i < 16; ++i)
+ ;
+
+ int x, y, z;
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(x)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(x, y)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(x, y, z)
+ for (i = 0; i < 16; ++i)
+ ;
+}
+
+void test_firstprivate() {
+ int i;
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
+// expected-error@+1 {{expected expression}}
+#pragma omp master taskloop firstprivate(
+ for (i = 0; i < 16; ++i)
+ ;
+
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
+// expected-error@+1 2 {{expected expression}}
+#pragma omp master taskloop firstprivate(,
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 2 {{expected expression}}
+#pragma omp master taskloop firstprivate(, )
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected expression}}
+#pragma omp master taskloop firstprivate()
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected expression}}
+#pragma omp master taskloop firstprivate(int)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected variable name}}
+#pragma omp master taskloop firstprivate(0)
+ for (i = 0; i < 16; ++i)
+ ;
+
+ int x, y, z;
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(x) firstprivate(x)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(x, y) firstprivate(x, y)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+#pragma omp master taskloop lastprivate(x, y, z) firstprivate(x, y, z)
+ for (i = 0; i < 16; ++i)
+ ;
+}
+
+void test_loop_messages() {
+ float a[100], b[100], c[100];
+#pragma omp parallel
+// expected-error@+2 {{variable must be of integer or pointer type}}
+#pragma omp master taskloop
+ for (float fi = 0; fi < 10.0; fi++) {
+ c[(int)fi] = a[(int)fi] + b[(int)fi];
+ }
+#pragma omp parallel
+// expected-error@+2 {{variable must be of integer or pointer type}}
+#pragma omp master taskloop
+ for (double fi = 0; fi < 10.0; fi++) {
+ c[(int)fi] = a[(int)fi] + b[(int)fi];
+ }
+
+ // expected-warning@+2 {{OpenMP loop iteration variable cannot have more than 64 bits size and will be narrowed}}
+ #pragma omp master taskloop
+ for (__int128 ii = 0; ii < 10; ii++) {
+ c[ii] = a[ii] + b[ii];
+ }
+}
+
diff --git a/src/llvm-project/clang/test/OpenMP/master_taskloop_num_tasks_messages.cpp b/src/llvm-project/clang/test/OpenMP/master_taskloop_num_tasks_messages.cpp
new file mode 100644
index 0000000..0675fc6
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/master_taskloop_num_tasks_messages.cpp
@@ -0,0 +1,103 @@
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+struct S1; // expected-note {{declared here}}
+
+template <class T, class S> // expected-note {{declared here}}
+int tmain(T argc, S **argv) {
+ T z;
+ #pragma omp master taskloop num_tasks // expected-error {{expected '(' after 'num_tasks'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop num_tasks ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop num_tasks () // expected-error {{expected expression}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop num_tasks (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop num_tasks (argc)) // expected-warning {{extra tokens at the end of '#pragma omp master taskloop' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop num_tasks (argc > 0 ? argv[1][0] : argv[2][argc] + z)
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop num_tasks (foobool(argc)), num_tasks (true) // expected-error {{directive '#pragma omp master taskloop' cannot contain more than one 'num_tasks' clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop num_tasks (S) // expected-error {{'S' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop num_tasks (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop num_tasks(0) // expected-error {{argument to 'num_tasks' clause must be a strictly positive integer value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop num_tasks(-1) // expected-error {{argument to 'num_tasks' clause must be a strictly positive integer value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop num_tasks(argc) grainsize(argc) // expected-error {{'grainsize' and 'num_tasks' clause are mutually exclusive and may not appear on the same directive}} expected-note {{'num_tasks' clause is specified here}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+
+ return 0;
+}
+
+int main(int argc, char **argv) {
+ int z;
+ #pragma omp master taskloop num_tasks // expected-error {{expected '(' after 'num_tasks'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop num_tasks ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop num_tasks () // expected-error {{expected expression}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop num_tasks (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop num_tasks (argc)) // expected-warning {{extra tokens at the end of '#pragma omp master taskloop' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop num_tasks (argc > 0 ? argv[1][0] : argv[2][argc] - z)
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop num_tasks (foobool(argc)), num_tasks (true) // expected-error {{directive '#pragma omp master taskloop' cannot contain more than one 'num_tasks' clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop num_tasks (S1) // expected-error {{'S1' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop num_tasks (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop num_tasks (1 0) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop num_tasks(if(tmain(argc, argv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop num_tasks(0) // expected-error {{argument to 'num_tasks' clause must be a strictly positive integer value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop num_tasks(-1) // expected-error {{argument to 'num_tasks' clause must be a strictly positive integer value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop num_tasks(argc) grainsize(argc) // expected-error {{'grainsize' and 'num_tasks' clause are mutually exclusive and may not appear on the same directive}} expected-note {{'num_tasks' clause is specified here}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+
+ return tmain(argc, argv);
+}
diff --git a/src/llvm-project/clang/test/OpenMP/master_taskloop_priority_messages.cpp b/src/llvm-project/clang/test/OpenMP/master_taskloop_priority_messages.cpp
new file mode 100644
index 0000000..63c3d5c
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/master_taskloop_priority_messages.cpp
@@ -0,0 +1,97 @@
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+struct S1; // expected-note {{declared here}}
+
+template <class T, class S> // expected-note {{declared here}}
+int tmain(T argc, S **argv) {
+ T z;
+ #pragma omp master taskloop priority // expected-error {{expected '(' after 'priority'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop priority ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop priority () // expected-error {{expected expression}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop priority (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop priority (argc)) // expected-warning {{extra tokens at the end of '#pragma omp master taskloop' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop priority (argc > 0 ? argv[1][0] : argv[2][argc] + z)
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop priority (foobool(argc)), priority (true) // expected-error {{directive '#pragma omp master taskloop' cannot contain more than one 'priority' clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop priority (S) // expected-error {{'S' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop priority (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop priority(0)
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop priority(-1) // expected-error {{argument to 'priority' clause must be a non-negative integer value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+
+ return 0;
+}
+
+int main(int argc, char **argv) {
+ int z;
+ #pragma omp master taskloop priority // expected-error {{expected '(' after 'priority'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop priority ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop priority () // expected-error {{expected expression}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop priority (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop priority (argc)) // expected-warning {{extra tokens at the end of '#pragma omp master taskloop' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop priority (argc > 0 ? argv[1][0] : argv[2][argc] - z)
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop priority (foobool(argc)), priority (true) // expected-error {{directive '#pragma omp master taskloop' cannot contain more than one 'priority' clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop priority (S1) // expected-error {{'S1' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop priority (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop priority (1 0) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop priority(if(tmain(argc, argv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop priority(0)
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop priority(-1) // expected-error {{argument to 'priority' clause must be a non-negative integer value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+
+ return tmain(argc, argv);
+}
diff --git a/src/llvm-project/clang/test/OpenMP/master_taskloop_private_codegen.cpp b/src/llvm-project/clang/test/OpenMP/master_taskloop_private_codegen.cpp
new file mode 100644
index 0000000..5d3ad2a
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/master_taskloop_private_codegen.cpp
@@ -0,0 +1,432 @@
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-apple-darwin10 -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=LAMBDA %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=BLOCKS %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DARRAY -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=ARRAY %s
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DARRAY -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
+// expected-no-diagnostics
+
+#ifndef ARRAY
+#ifndef HEADER
+#define HEADER
+
+template <class T>
+struct S {
+ T f;
+ S(T a) : f(a) {}
+ S() : f() {}
+ operator T() { return T(); }
+ ~S() {}
+};
+
+volatile double g;
+
+// CHECK-DAG: [[KMP_TASK_T_TY:%.+]] = type { i8*, i32 (i32, i8*)*, i32, %union{{.+}}, %union{{.+}}, i64, i64, i64, i32, i8* }
+// CHECK-DAG: [[S_DOUBLE_TY:%.+]] = type { double }
+// CHECK-DAG: [[CAP_MAIN_TY:%.+]] = type { i8 }
+// CHECK-DAG: [[PRIVATES_MAIN_TY:%.+]] = type {{.?}}{ [2 x [[S_DOUBLE_TY]]], [[S_DOUBLE_TY]], i32, [2 x i32]
+// CHECK-DAG: [[KMP_TASK_MAIN_TY:%.+]] = type { [[KMP_TASK_T_TY]], [[PRIVATES_MAIN_TY]] }
+// CHECK-DAG: [[S_INT_TY:%.+]] = type { i32 }
+// CHECK-DAG: [[CAP_TMAIN_TY:%.+]] = type { i8 }
+// CHECK-DAG: [[PRIVATES_TMAIN_TY:%.+]] = type { i32, [2 x i32], [2 x [[S_INT_TY]]], [[S_INT_TY]], [104 x i8] }
+// CHECK-DAG: [[KMP_TASK_TMAIN_TY:%.+]] = type { [[KMP_TASK_T_TY]], [{{[0-9]+}} x i8], [[PRIVATES_TMAIN_TY]] }
+template <typename T>
+T tmain() {
+ S<T> test;
+ T t_var __attribute__((aligned(128))) = T();
+ T vec[] = {1, 2};
+ S<T> s_arr[] = {1, 2};
+ S<T> var(3);
+#pragma omp master taskloop private(t_var, vec, s_arr, s_arr, var, var)
+ for (int i = 0; i < 10; ++i) {
+ vec[0] = t_var;
+ s_arr[0] = var;
+ }
+ return T();
+}
+
+int main() {
+ static int sivar;
+#ifdef LAMBDA
+ // LAMBDA: [[G:@.+]] = global double
+ // LAMBDA-LABEL: @main
+ // LAMBDA: call{{( x86_thiscallcc)?}} void [[OUTER_LAMBDA:@.+]](
+ [&]() {
+ // LAMBDA: define{{.*}} internal{{.*}} void [[OUTER_LAMBDA]](
+ // LAMBDA: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc(%{{[^ ]+}} @{{[^,]+}}, i32 %{{[^,]+}}, i32 1, i64 96, i64 1, i32 (i32, i8*)* bitcast (i32 (i32, %{{[^*]+}}*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+// LAMBDA: [[PRIVATES:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i{{.+}} 0, i{{.+}} 1
+// LAMBDA: call void @__kmpc_taskloop(%{{.+}}* @{{.+}}, i32 %{{.+}}, i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* null)
+// LAMBDA: ret
+#pragma omp master taskloop private(g, sivar)
+ for (int i = 0; i < 10; ++i) {
+ // LAMBDA: define {{.+}} void [[INNER_LAMBDA:@.+]](%{{.+}}* [[ARG_PTR:%.+]])
+ // LAMBDA: store %{{.+}}* [[ARG_PTR]], %{{.+}}** [[ARG_PTR_REF:%.+]],
+ // LAMBDA: [[ARG_PTR:%.+]] = load %{{.+}}*, %{{.+}}** [[ARG_PTR_REF]]
+ // LAMBDA: [[G_PTR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[ARG_PTR]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+ // LAMBDA: [[G_REF:%.+]] = load double*, double** [[G_PTR_REF]]
+ // LAMBDA: store double 2.0{{.+}}, double* [[G_REF]]
+ // LAMBDA: [[SIVAR_PTR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[ARG_PTR]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
+ // LAMBDA: [[SIVAR_REF:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** [[SIVAR_PTR_REF]]
+ // LAMBDA: store i{{[0-9]+}} 3, i{{[0-9]+}}* [[SIVAR_REF]]
+
+ // LAMBDA: define internal i32 [[TASK_ENTRY]](i32 %0, %{{.+}}* noalias %1)
+ g = 1;
+ sivar = 2;
+ // LAMBDA: store double 1.0{{.+}}, double* %{{.+}},
+ // LAMBDA: store i{{[0-9]+}} 2, i{{[0-9]+}}* %{{.+}},
+ // LAMBDA: call void [[INNER_LAMBDA]](%
+ // LAMBDA: ret
+ [&]() {
+ g = 2;
+ sivar = 3;
+ }();
+ }
+ }();
+ return 0;
+#elif defined(BLOCKS)
+ // BLOCKS: [[G:@.+]] = global double
+ // BLOCKS-LABEL: @main
+ // BLOCKS: call void {{%.+}}(i8
+ ^{
+ // BLOCKS: define{{.*}} internal{{.*}} void {{.+}}(i8*
+ // BLOCKS: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc(%{{[^ ]+}} @{{[^,]+}}, i32 %{{[^,]+}}, i32 1, i64 96, i64 1, i32 (i32, i8*)* bitcast (i32 (i32, %{{[^*]+}}*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+ // BLOCKS: [[PRIVATES:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i{{.+}} 0, i{{.+}} 1
+ // BLOCKS: call void @__kmpc_taskloop(%{{.+}}* @{{.+}}, i32 %{{.+}}, i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* null)
+ // BLOCKS: ret
+#pragma omp master taskloop private(g, sivar)
+ for (int i = 0; i < 10; ++i) {
+ // BLOCKS: define {{.+}} void {{@.+}}(i8*
+ // BLOCKS-NOT: [[G]]{{[[^:word:]]}}
+ // BLOCKS: store double 2.0{{.+}}, double*
+ // BLOCKS-NOT: [[G]]{{[[^:word:]]}}
+ // BLOCKS-NOT: [[SIVAR]]{{[[^:word:]]}}
+ // BLOCKS: store i{{[0-9]+}} 4, i{{[0-9]+}}*
+ // BLOCKS-NOT: [[SIVAR]]{{[[^:word:]]}}
+ // BLOCKS: ret
+
+ // BLOCKS: define internal i32 [[TASK_ENTRY]](i32 %0, %{{.+}}* noalias %1)
+ g = 1;
+ sivar = 3;
+ // BLOCKS: store double 1.0{{.+}}, double* %{{.+}},
+ // BLOCKS-NOT: [[G]]{{[[^:word:]]}}
+ // BLOCKS: store i{{[0-9]+}} 3, i{{[0-9]+}}* %{{.+}},
+ // BLOCKS-NOT: [[SIVAR]]{{[[^:word:]]}}
+ // BLOCKS: call void {{%.+}}(i8
+ ^{
+ g = 2;
+ sivar = 4;
+ }();
+ }
+ }();
+ return 0;
+#else
+ S<double> test;
+ int t_var = 0;
+ int vec[] = {1, 2};
+ S<double> s_arr[] = {1, 2};
+ S<double> var(3);
+#pragma omp master taskloop private(var, t_var, s_arr, vec, s_arr, var, sivar)
+ for (int i = 0; i < 10; ++i) {
+ vec[0] = t_var;
+ s_arr[0] = var;
+ sivar = 8;
+ }
+#pragma omp task
+ g+=1;
+ return tmain<int>();
+#endif
+}
+
+// CHECK: define i{{[0-9]+}} @main()
+// CHECK: [[TEST:%.+]] = alloca [[S_DOUBLE_TY]],
+// CHECK: [[T_VAR_ADDR:%.+]] = alloca i32,
+// CHECK: [[VEC_ADDR:%.+]] = alloca [2 x i32],
+// CHECK: [[S_ARR_ADDR:%.+]] = alloca [2 x [[S_DOUBLE_TY]]],
+// CHECK: [[VAR_ADDR:%.+]] = alloca [[S_DOUBLE_TY]],
+// CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num([[LOC:%.+]])
+
+// CHECK: call {{.*}} [[S_DOUBLE_TY_DEF_CONSTR:@.+]]([[S_DOUBLE_TY]]* [[TEST]])
+
+// CHECK: [[RES:%.+]] = call {{.*}}i32 @__kmpc_master(
+// CHECK-NEXT: [[IS_MASTER:%.+]] = icmp ne i32 [[RES]], 0
+// CHECK-NEXT: br i1 [[IS_MASTER]], label {{%?}}[[THEN:.+]], label {{%?}}[[EXIT:.+]]
+// CHECK: [[THEN]]
+// Do not store original variables in capture struct.
+// CHECK-NOT: getelementptr inbounds [[CAP_MAIN_TY]],
+
+// Allocate task.
+// Returns struct kmp_task_t {
+// [[KMP_TASK_T_TY]] task_data;
+// [[KMP_TASK_MAIN_TY]] privates;
+// };
+// CHECK: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc([[LOC]], i32 [[GTID]], i32 9, i64 120, i64 1, i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_MAIN_TY]]*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+// CHECK: [[RES_KMP_TASK:%.+]] = bitcast i8* [[RES]] to [[KMP_TASK_MAIN_TY]]*
+
+// CHECK: [[TASK:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// Initialize kmp_task_t->privates with default values (no init for simple types, default constructors for classes).
+// Also copy address of private copy to the corresponding shareds reference.
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
+
+// Constructors for s_arr and var.
+// a_arr;
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: getelementptr inbounds [2 x [[S_DOUBLE_TY]]], [2 x [[S_DOUBLE_TY]]]* [[PRIVATE_S_ARR_REF]], i{{.+}} 0, i{{.+}} 0
+// CHECK: getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i{{.+}} 2
+// CHECK: call void [[S_DOUBLE_TY_DEF_CONSTR]]([[S_DOUBLE_TY]]* [[S_ARR_CUR:%.+]])
+// CHECK: getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* [[S_ARR_CUR]], i{{.+}} 1
+// CHECK: icmp eq
+// CHECK: br i1
+
+// var;
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
+// CHECK: call void [[S_DOUBLE_TY_DEF_CONSTR]]([[S_DOUBLE_TY]]* [[PRIVATE_VAR_REF:%.+]])
+
+// Provide pointer to destructor function, which will destroy private variables at the end of the task.
+// CHECK: [[DESTRUCTORS_REF:%.+]] = getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* [[TASK]], i{{.+}} 0, i{{.+}} 3
+// CHECK: [[DESTRUCTORS_PTR:%.+]] = bitcast %union{{.+}}* [[DESTRUCTORS_REF]] to i32 (i32, i8*)**
+// CHECK: store i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_MAIN_TY]]*)* [[DESTRUCTORS:@.+]] to i32 (i32, i8*)*), i32 (i32, i8*)** [[DESTRUCTORS_PTR]],
+
+// Start task.
+// CHECK: call void @__kmpc_taskloop([[LOC]], i32 [[GTID]], i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* bitcast (void ([[KMP_TASK_MAIN_TY]]*, [[KMP_TASK_MAIN_TY]]*, i32)* [[MAIN_DUP:@.+]] to i8*))
+// CHECK: call {{.*}}void @__kmpc_end_master(
+// CHECK-NEXT: br label {{%?}}[[EXIT]]
+// CHECK: [[EXIT]]
+// CHECK: call i32 @__kmpc_omp_task([[LOC]], i32 [[GTID]], i8*
+
+// CHECK: = call i{{.+}} [[TMAIN_INT:@.+]]()
+
+// No destructors must be called for private copies of s_arr and var.
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: call void [[S_DOUBLE_TY_DESTR:@.+]]([[S_DOUBLE_TY]]*
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: ret
+//
+
+// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_MAIN_TY]]* noalias %0, [[S_DOUBLE_TY]]** noalias %1, i32** noalias %2, [2 x [[S_DOUBLE_TY]]]** noalias %3, [2 x i32]** noalias %4, i32** noalias %5)
+// CHECK: [[PRIVATES:%.+]] = load [[PRIVATES_MAIN_TY]]*, [[PRIVATES_MAIN_TY]]**
+// CHECK: [[PRIV_S_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 0
+// CHECK: [[ARG3:%.+]] = load [2 x [[S_DOUBLE_TY]]]**, [2 x [[S_DOUBLE_TY]]]*** %{{.+}},
+// CHECK: store [2 x [[S_DOUBLE_TY]]]* [[PRIV_S_VAR]], [2 x [[S_DOUBLE_TY]]]** [[ARG3]],
+// CHECK: [[PRIV_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 1
+// CHECK: [[ARG1:%.+]] = load [[S_DOUBLE_TY]]**, [[S_DOUBLE_TY]]*** {{.+}},
+// CHECK: store [[S_DOUBLE_TY]]* [[PRIV_VAR]], [[S_DOUBLE_TY]]** [[ARG1]],
+// CHECK: [[PRIV_T_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 2
+// CHECK: [[ARG2:%.+]] = load i32**, i32*** %{{.+}},
+// CHECK: store i32* [[PRIV_T_VAR]], i32** [[ARG2]],
+// CHECK: [[PRIV_VEC:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 3
+// CHECK: [[ARG4:%.+]] = load [2 x i32]**, [2 x i32]*** %{{.+}},
+// CHECK: store [2 x i32]* [[PRIV_VEC]], [2 x i32]** [[ARG4]],
+// CHECK: ret void
+
+// CHECK: define internal i32 [[TASK_ENTRY]](i32 %0, [[KMP_TASK_MAIN_TY]]* noalias %1)
+
+// CHECK: [[PRIV_VAR_ADDR:%.+]] = alloca [[S_DOUBLE_TY]]*,
+// CHECK: [[PRIV_T_VAR_ADDR:%.+]] = alloca i32*,
+// CHECK: [[PRIV_S_ARR_ADDR:%.+]] = alloca [2 x [[S_DOUBLE_TY]]]*,
+// CHECK: [[PRIV_VEC_ADDR:%.+]] = alloca [2 x i32]*,
+// CHECK: [[PRIV_SIVAR_ADDR:%.+]] = alloca i32*,
+// CHECK: store void (i8*, ...)* bitcast (void ([[PRIVATES_MAIN_TY]]*, [[S_DOUBLE_TY]]**, i32**, [2 x [[S_DOUBLE_TY]]]**, [2 x i32]**, i32**)* [[PRIVATES_MAP_FN]] to void (i8*, ...)*), void (i8*, ...)** [[MAP_FN_ADDR:%.+]],
+// CHECK: [[MAP_FN:%.+]] = load void (i8*, ...)*, void (i8*, ...)** [[MAP_FN_ADDR]],
+// CHECK: call void (i8*, ...) [[MAP_FN]](i8* %{{.+}}, [[S_DOUBLE_TY]]** [[PRIV_VAR_ADDR]], i32** [[PRIV_T_VAR_ADDR]], [2 x [[S_DOUBLE_TY]]]** [[PRIV_S_ARR_ADDR]], [2 x i32]** [[PRIV_VEC_ADDR]], i32** [[PRIV_SIVAR_ADDR]])
+// CHECK: [[PRIV_VAR:%.+]] = load [[S_DOUBLE_TY]]*, [[S_DOUBLE_TY]]** [[PRIV_VAR_ADDR]],
+// CHECK: [[PRIV_T_VAR:%.+]] = load i32*, i32** [[PRIV_T_VAR_ADDR]],
+// CHECK: [[PRIV_S_ARR:%.+]] = load [2 x [[S_DOUBLE_TY]]]*, [2 x [[S_DOUBLE_TY]]]** [[PRIV_S_ARR_ADDR]],
+// CHECK: [[PRIV_VEC:%.+]] = load [2 x i32]*, [2 x i32]** [[PRIV_VEC_ADDR]],
+// CHECK: [[PRIV_SIVAR:%.+]] = load i32*, i32** [[PRIV_SIVAR_ADDR]],
+
+// Privates actually are used.
+// CHECK-DAG: [[PRIV_VAR]]
+// CHECK-DAG: [[PRIV_T_VAR]]
+// CHECK-DAG: [[PRIV_S_ARR]]
+// CHECK-DAG: [[PRIV_VEC]]
+// CHECK_DAG: [[PRIV_SIVAR]]
+
+// CHECK: ret
+
+// CHECK: define internal void [[MAIN_DUP]]([[KMP_TASK_MAIN_TY]]* %0, [[KMP_TASK_MAIN_TY]]* %1, i32 %2)
+// CHECK: getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* %{{.+}}, i32 0, i32 1
+// CHECK: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr inbounds [2 x [[S_DOUBLE_TY]]], [2 x [[S_DOUBLE_TY]]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i64 2
+// CHECK: br label %
+
+// CHECK: phi [[S_DOUBLE_TY]]*
+// CHECK: call {{.*}} [[S_DOUBLE_TY_DEF_CONSTR]]([[S_DOUBLE_TY]]*
+// CHECK: getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i64 1
+// CHECK: icmp eq [[S_DOUBLE_TY]]* %
+// CHECK: br i1 %
+
+// CHECK: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* %{{.+}}, i32 0, i32 1
+// CHECK: call {{.*}} [[S_DOUBLE_TY_DEF_CONSTR]]([[S_DOUBLE_TY]]*
+// CHECK: ret void
+
+// CHECK: define internal i32 [[DESTRUCTORS]](i32 %0, [[KMP_TASK_MAIN_TY]]* noalias %1)
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 0
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
+// CHECK: call void [[S_DOUBLE_TY_DESTR]]([[S_DOUBLE_TY]]* [[PRIVATE_VAR_REF]])
+// CHECK: getelementptr inbounds [2 x [[S_DOUBLE_TY]]], [2 x [[S_DOUBLE_TY]]]* [[PRIVATE_S_ARR_REF]], i{{.+}} 0, i{{.+}} 0
+// CHECK: getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i{{.+}} 2
+// CHECK: [[PRIVATE_S_ARR_ELEM_REF:%.+]] = getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i{{.+}} -1
+// CHECK: call void [[S_DOUBLE_TY_DESTR]]([[S_DOUBLE_TY]]* [[PRIVATE_S_ARR_ELEM_REF]])
+// CHECK: icmp eq
+// CHECK: br i1
+// CHECK: ret i32
+
+// CHECK: define {{.*}} i{{[0-9]+}} [[TMAIN_INT]]()
+// CHECK: [[TEST:%.+]] = alloca [[S_INT_TY]],
+// CHECK: [[T_VAR_ADDR:%.+]] = alloca i32,
+// CHECK: [[VEC_ADDR:%.+]] = alloca [2 x i32],
+// CHECK: [[S_ARR_ADDR:%.+]] = alloca [2 x [[S_INT_TY]]],
+// CHECK: [[VAR_ADDR:%.+]] = alloca [[S_INT_TY]],
+// CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num([[LOC:%.+]])
+
+// CHECK: call {{.*}} [[S_INT_TY_DEF_CONSTR:@.+]]([[S_INT_TY]]* [[TEST]])
+
+// Do not store original variables in capture struct.
+// CHECK-NOT: getelementptr inbounds [[CAP_TMAIN_TY]],
+
+// Allocate task.
+// Returns struct kmp_task_t {
+// [[KMP_TASK_T_TY]] task_data;
+// [[KMP_TASK_TMAIN_TY]] privates;
+// };
+// CHECK: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc([[LOC]], i32 [[GTID]], i32 9, i64 256, i64 1, i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_TMAIN_TY]]*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+// CHECK: [[RES_KMP_TASK:%.+]] = bitcast i8* [[RES]] to [[KMP_TASK_TMAIN_TY]]*
+
+// CHECK: [[TASK:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+
+// Initialize kmp_task_t->privates with default values (no init for simple types, default constructors for classes).
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
+
+// Constructors for s_arr and var.
+// a_arr;
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
+// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* [[PRIVATE_S_ARR_REF]], i{{.+}} 0, i{{.+}} 0
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i{{.+}} 2
+// CHECK: call void [[S_INT_TY_DEF_CONSTR]]([[S_INT_TY]]* [[S_ARR_CUR:%.+]])
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* [[S_ARR_CUR]], i{{.+}} 1
+// CHECK: icmp eq
+// CHECK: br i1
+
+// var;
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: call void [[S_INT_TY_DEF_CONSTR]]([[S_INT_TY]]* [[PRIVATE_VAR_REF:%.+]])
+
+// Provide pointer to destructor function, which will destroy private variables at the end of the task.
+// CHECK: [[DESTRUCTORS_REF:%.+]] = getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* [[TASK]], i{{.+}} 0, i{{.+}} 3
+// CHECK: [[DESTRUCTORS_PTR:%.+]] = bitcast %union{{.+}}* [[DESTRUCTORS_REF]] to i32 (i32, i8*)**
+// CHECK: store i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_TMAIN_TY]]*)* [[DESTRUCTORS:@.+]] to i32 (i32, i8*)*), i32 (i32, i8*)** [[DESTRUCTORS_PTR]],
+
+// Start task.
+// CHECK: call void @__kmpc_taskloop([[LOC]], i32 [[GTID]], i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* bitcast (void ([[KMP_TASK_TMAIN_TY]]*, [[KMP_TASK_TMAIN_TY]]*, i32)* [[TMAIN_DUP:@.+]] to i8*))
+
+// No destructors must be called for private copies of s_arr and var.
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: call void [[S_INT_TY_DESTR:@.+]]([[S_INT_TY]]*
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: ret
+//
+
+// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_TMAIN_TY]]* noalias %0, i32** noalias %1, [2 x i32]** noalias %2, [2 x [[S_INT_TY]]]** noalias %3, [[S_INT_TY]]** noalias %4)
+// CHECK: [[PRIVATES:%.+]] = load [[PRIVATES_TMAIN_TY]]*, [[PRIVATES_TMAIN_TY]]**
+// CHECK: [[PRIV_T_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 0
+// CHECK: [[ARG1:%.+]] = load i32**, i32*** %{{.+}},
+// CHECK: store i32* [[PRIV_T_VAR]], i32** [[ARG1]],
+// CHECK: [[PRIV_VEC:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 1
+// CHECK: [[ARG2:%.+]] = load [2 x i32]**, [2 x i32]*** %{{.+}},
+// CHECK: store [2 x i32]* [[PRIV_VEC]], [2 x i32]** [[ARG2]],
+// CHECK: [[PRIV_S_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 2
+// CHECK: [[ARG3:%.+]] = load [2 x [[S_INT_TY]]]**, [2 x [[S_INT_TY]]]*** %{{.+}},
+// CHECK: store [2 x [[S_INT_TY]]]* [[PRIV_S_VAR]], [2 x [[S_INT_TY]]]** [[ARG3]],
+// CHECK: [[PRIV_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 3
+// CHECK: [[ARG4:%.+]] = load [[S_INT_TY]]**, [[S_INT_TY]]*** {{.+}},
+// CHECK: store [[S_INT_TY]]* [[PRIV_VAR]], [[S_INT_TY]]** [[ARG4]],
+// CHECK: ret void
+
+// CHECK: define internal i32 [[TASK_ENTRY]](i32 %0, [[KMP_TASK_TMAIN_TY]]* noalias %1)
+
+// CHECK: alloca i32*,
+// CHECK-DAG: [[PRIV_T_VAR_ADDR:%.+]] = alloca i32*,
+// CHECK-DAG: [[PRIV_VEC_ADDR:%.+]] = alloca [2 x i32]*,
+// CHECK-DAG: [[PRIV_S_ARR_ADDR:%.+]] = alloca [2 x [[S_INT_TY]]]*,
+// CHECK-DAG: [[PRIV_VAR_ADDR:%.+]] = alloca [[S_INT_TY]]*,
+// CHECK: store void (i8*, ...)* bitcast (void ([[PRIVATES_TMAIN_TY]]*, i32**, [2 x i32]**, [2 x [[S_INT_TY]]]**, [[S_INT_TY]]**)* [[PRIVATES_MAP_FN]] to void (i8*, ...)*), void (i8*, ...)** [[MAP_FN_ADDR:%.+]],
+// CHECK: [[MAP_FN:%.+]] = load void (i8*, ...)*, void (i8*, ...)** [[MAP_FN_ADDR]],
+// CHECK: call void (i8*, ...) [[MAP_FN]](i8* %{{.+}}, i32** [[PRIV_T_VAR_ADDR]], [2 x i32]** [[PRIV_VEC_ADDR]], [2 x [[S_INT_TY]]]** [[PRIV_S_ARR_ADDR]], [[S_INT_TY]]** [[PRIV_VAR_ADDR]])
+// CHECK: [[PRIV_T_VAR:%.+]] = load i32*, i32** [[PRIV_T_VAR_ADDR]],
+// CHECK: [[PRIV_VEC:%.+]] = load [2 x i32]*, [2 x i32]** [[PRIV_VEC_ADDR]],
+// CHECK: [[PRIV_S_ARR:%.+]] = load [2 x [[S_INT_TY]]]*, [2 x [[S_INT_TY]]]** [[PRIV_S_ARR_ADDR]],
+// CHECK: [[PRIV_VAR:%.+]] = load [[S_INT_TY]]*, [[S_INT_TY]]** [[PRIV_VAR_ADDR]],
+
+// Privates actually are used.
+// CHECK-DAG: [[PRIV_VAR]]
+// CHECK-DAG: [[PRIV_T_VAR]]
+// CHECK-DAG: [[PRIV_S_ARR]]
+// CHECK-DAG: [[PRIV_VEC]]
+
+// CHECK: ret
+
+// CHECK: define internal void [[TMAIN_DUP]]([[KMP_TASK_TMAIN_TY]]* %0, [[KMP_TASK_TMAIN_TY]]* %1, i32 %2)
+// CHECK: getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* %{{.+}}, i32 0, i32 2
+// CHECK: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* %{{.+}}, i32 0, i32 2
+// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i64 2
+// CHECK: br label %
+
+// CHECK: phi [[S_INT_TY]]*
+// CHECK: call {{.*}} [[S_INT_TY_DEF_CONSTR]]([[S_INT_TY]]*
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i64 1
+// CHECK: icmp eq [[S_INT_TY]]* %
+// CHECK: br i1 %
+
+// CHECK: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* %{{.+}}, i32 0, i32 3
+// CHECK: call {{.*}} [[S_INT_TY_DEF_CONSTR]]([[S_INT_TY]]*
+// CHECK: ret void
+
+// CHECK: define internal i32 [[DESTRUCTORS]](i32 %0, [[KMP_TASK_TMAIN_TY]]* noalias %1)
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: call void [[S_INT_TY_DESTR]]([[S_INT_TY]]* [[PRIVATE_VAR_REF]])
+// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* [[PRIVATE_S_ARR_REF]], i{{.+}} 0, i{{.+}} 0
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i{{.+}} 2
+// CHECK: [[PRIVATE_S_ARR_ELEM_REF:%.+]] = getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i{{.+}} -1
+// CHECK: call void [[S_INT_TY_DESTR]]([[S_INT_TY]]* [[PRIVATE_S_ARR_ELEM_REF]])
+// CHECK: icmp eq
+// CHECK: br i1
+// CHECK: ret i32
+
+#endif
+#else
+// ARRAY-LABEL: array_func
+struct St {
+ int a, b;
+ St() : a(0), b(0) {}
+ St &operator=(const St &) { return *this; };
+ ~St() {}
+};
+
+void array_func(int n, float a[n], St s[2]) {
+// ARRAY: call i8* @__kmpc_omp_task_alloc(
+// ARRAY: call void @__kmpc_taskloop(
+// ARRAY: store float** %{{.+}}, float*** %{{.+}},
+// ARRAY: store %struct.St** %{{.+}}, %struct.St*** %{{.+}},
+#pragma omp master taskloop private(a, s)
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+#endif
+
diff --git a/src/llvm-project/clang/test/OpenMP/master_taskloop_private_messages.cpp b/src/llvm-project/clang/test/OpenMP/master_taskloop_private_messages.cpp
new file mode 100644
index 0000000..30220cb
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/master_taskloop_private_messages.cpp
@@ -0,0 +1,259 @@
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+
+typedef void **omp_allocator_handle_t;
+extern const omp_allocator_handle_t omp_default_mem_alloc;
+extern const omp_allocator_handle_t omp_large_cap_mem_alloc;
+extern const omp_allocator_handle_t omp_const_mem_alloc;
+extern const omp_allocator_handle_t omp_high_bw_mem_alloc;
+extern const omp_allocator_handle_t omp_low_lat_mem_alloc;
+extern const omp_allocator_handle_t omp_cgroup_mem_alloc;
+extern const omp_allocator_handle_t omp_pteam_mem_alloc;
+extern const omp_allocator_handle_t omp_thread_mem_alloc;
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+struct S1; // expected-note 2 {{declared here}} expected-note 2 {{forward declaration of 'S1'}}
+extern S1 a;
+class S2 {
+ mutable int a;
+
+public:
+ S2() : a(0) {}
+};
+const S2 b;
+const S2 ba[5];
+class S3 {
+ int a;
+
+public:
+ S3() : a(0) {}
+};
+const S3 ca[5];
+class S4 {
+ int a;
+ S4(); // expected-note {{implicitly declared private here}}
+
+public:
+ S4(int v) : a(v) {
+#pragma omp master taskloop private(a) private(this->a)
+ for (int k = 0; k < v; ++k)
+ ++this->a;
+ }
+};
+class S5 {
+ int a;
+ S5() : a(0) {} // expected-note {{implicitly declared private here}}
+
+public:
+ S5(int v) : a(v) {}
+ S5 &operator=(S5 &s) {
+#pragma omp master taskloop private(a) private(this->a) private(s.a) // expected-error {{expected variable name or data member of current class}}
+ for (int k = 0; k < s.a; ++k)
+ ++s.a;
+ return *this;
+ }
+};
+
+template <typename T>
+class S6 {
+public:
+ T a;
+
+ S6() : a(0) {}
+ S6(T v) : a(v) {
+#pragma omp master taskloop private(a) private(this->a) allocate(omp_thread_mem_alloc: a) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'master taskloop' directive}}
+ for (int k = 0; k < v; ++k)
+ ++this->a;
+ }
+ S6 &operator=(S6 &s) {
+#pragma omp master taskloop private(a) private(this->a) private(s.a) // expected-error {{expected variable name or data member of current class}}
+ for (int k = 0; k < s.a; ++k)
+ ++s.a;
+ return *this;
+ }
+};
+
+template <typename T>
+class S7 : public T {
+ T a;
+ S7() : a(0) {}
+
+public:
+ S7(T v) : a(v) {
+#pragma omp master taskloop private(a) private(this->a) private(T::a)
+ for (int k = 0; k < a.a; ++k)
+ ++this->a.a;
+ }
+ S7 &operator=(S7 &s) {
+#pragma omp master taskloop private(a) private(this->a) private(s.a) private(s.T::a) // expected-error 2 {{expected variable name or data member of current class}}
+ for (int k = 0; k < s.a.a; ++k)
+ ++s.a.a;
+ return *this;
+ }
+};
+
+S3 h;
+#pragma omp threadprivate(h) // expected-note 2 {{defined as threadprivate or thread local}}
+
+template <class I, class C>
+int foomain(I argc, C **argv) {
+ I e(4);
+ I g(5);
+ int i, z;
+ int &j = i;
+#pragma omp master taskloop private // expected-error {{expected '(' after 'private'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop private( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop private() // expected-error {{expected expression}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop private(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop private(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop private(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop private(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop private(S1) // expected-error {{'S1' does not refer to a value}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop private(a, b) // expected-error {{private variable with incomplete type 'S1'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop private(argv[1]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop private(e, g, z)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop private(h) // expected-error {{threadprivate or thread local variable cannot be private}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop shared(i)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+ {
+ int v = 0;
+ int i;
+#pragma omp master taskloop private(i)
+ for (int k = 0; k < argc; ++k) {
+ i = k;
+ v += i;
+ }
+ }
+#pragma omp parallel shared(i)
+#pragma omp parallel private(i)
+#pragma omp master taskloop private(j)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop private(i)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+ return 0;
+}
+
+void bar(S4 a[2]) {
+#pragma omp parallel
+#pragma omp master taskloop private(a)
+ for (int i = 0; i < 2; ++i)
+ foo();
+}
+
+namespace A {
+double x;
+#pragma omp threadprivate(x) // expected-note {{defined as threadprivate or thread local}}
+}
+namespace B {
+using A::x;
+}
+
+int main(int argc, char **argv) {
+ S4 e(4);
+ S5 g(5);
+ S6<float> s6(0.0) , s6_0(1.0); // expected-note {{in instantiation of member function 'S6<float>::S6' requested here}}
+ S7<S6<float> > s7(0.0) , s7_0(1.0);
+ int i, z;
+ int &j = i;
+#pragma omp master taskloop private // expected-error {{expected '(' after 'private'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop private( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop private() // expected-error {{expected expression}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop private(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop private(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop private(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop private(argc)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop private(S1) // expected-error {{'S1' does not refer to a value}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop private(a, b) // expected-error {{private variable with incomplete type 'S1'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop private(argv[1]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop private(e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop private(h) // expected-error {{threadprivate or thread local variable cannot be private}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop private(B::x) // expected-error {{threadprivate or thread local variable cannot be private}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop shared(i)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+ {
+ int i;
+#pragma omp master taskloop private(i)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+ }
+#pragma omp parallel shared(i)
+#pragma omp parallel private(i)
+#pragma omp master taskloop private(j)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop private(i, z)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+ static int si;
+#pragma omp master taskloop private(si) // OK
+ for(int k = 0; k < argc; ++k)
+ si = k + 1;
+
+ s6 = s6_0; // expected-note {{in instantiation of member function 'S6<float>::operator=' requested here}}
+ s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float> >::operator=' requested here}}
+ return foomain(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<int, char>' requested here}}
+}
+
diff --git a/src/llvm-project/clang/test/OpenMP/master_taskloop_reduction_codegen.cpp b/src/llvm-project/clang/test/OpenMP/master_taskloop_reduction_codegen.cpp
new file mode 100644
index 0000000..70b8334
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/master_taskloop_reduction_codegen.cpp
@@ -0,0 +1,236 @@
+// RUN: %clang_cc1 -fopenmp -x c++ %s -verify -debug-info-kind=limited -emit-llvm -o - -triple powerpc64le-unknown-linux-gnu -fnoopenmp-use-tls -std=c++98 | FileCheck %s
+
+// RUN: %clang_cc1 -fopenmp-simd -x c++ %s -verify -debug-info-kind=limited -emit-llvm -o - -triple powerpc64le-unknown-linux-gnu -fnoopenmp-use-tls -std=c++98 | FileCheck --check-prefix SIMD-ONLY0 %s
+// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
+// expected-no-diagnostics
+
+struct S {
+ float a;
+ S() : a(0.0f) {}
+ ~S() {}
+};
+
+#pragma omp declare reduction(+:S:omp_out.a += omp_in.a) initializer(omp_priv = omp_orig)
+
+float g;
+
+int a;
+#pragma omp threadprivate(a)
+int main (int argc, char *argv[])
+{
+int i, n;
+float a[100], b[100], sum, e[argc + 100];
+S c[100];
+float &d = g;
+
+/* Some initializations */
+n = 100;
+for (i=0; i < n; i++)
+ a[i] = b[i] = i * 1.0;
+sum = 0.0;
+
+#pragma omp master taskloop reduction(+:sum, c[:n], d, e)
+ for (i=0; i < n; i++) {
+ sum = sum + (a[i] * b[i]);
+ c[i].a = i*i;
+ d += i*i;
+ e[i] = i;
+ }
+
+}
+
+// CHECK-LABEL: @main(
+// CHECK: [[RETVAL:%.*]] = alloca i32,
+// CHECK: [[ARGC_ADDR:%.*]] = alloca i32,
+// CHECK: [[ARGV_ADDR:%.*]] = alloca i8**,
+// CHECK: [[I:%.*]] = alloca i32,
+// CHECK: [[N:%.*]] = alloca i32,
+// CHECK: [[A:%.*]] = alloca [100 x float],
+// CHECK: [[B:%.*]] = alloca [100 x float],
+// CHECK: [[SUM:%.*]] = alloca float,
+// CHECK: [[SAVED_STACK:%.*]] = alloca i8*,
+// CHECK: [[C:%.*]] = alloca [100 x %struct.S],
+// CHECK: [[D:%.*]] = alloca float*,
+// CHECK: [[AGG_CAPTURED:%.*]] = alloca [[STRUCT_ANON:%.*]],
+// CHECK: [[DOTRD_INPUT_:%.*]] = alloca [4 x %struct.kmp_task_red_input_t],
+// CHECK: alloca i32,
+// CHECK: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32,
+// CHECK: [[DOTCAPTURE_EXPR_9:%.*]] = alloca i32,
+// CHECK: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t*
+// CHECK: store i32 0, i32* [[RETVAL]],
+// CHECK: store i32 [[ARGC:%.*]], i32* [[ARGC_ADDR]],
+// CHECK: store i8** [[ARGV:%.*]], i8*** [[ARGV_ADDR]],
+// CHECK: [[TMP1:%.*]] = load i32, i32* [[ARGC_ADDR]],
+// CHECK: [[ADD:%.*]] = add nsw i32 [[TMP1]], 100
+// CHECK: [[TMP2:%.*]] = zext i32 [[ADD]] to i64
+// CHECK: [[VLA:%.+]] = alloca float, i64 %
+
+// CHECK: [[RES:%.+]] = call {{.*}}i32 @__kmpc_master(
+// CHECK-NEXT: [[IS_MASTER:%.+]] = icmp ne i32 [[RES]], 0
+// CHECK-NEXT: br i1 [[IS_MASTER]], label {{%?}}[[THEN:.+]], label {{%?}}[[EXIT:[^,]+]]
+// CHECK: [[THEN]]
+// CHECK: call void @__kmpc_taskgroup(%struct.ident_t*
+// CHECK-DAG: [[TMP21:%.*]] = bitcast float* [[SUM]] to i8*
+// CHECK-DAG: store i8* [[TMP21]], i8** [[TMP20:%[^,]+]],
+// CHECK-DAG: [[TMP20]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T:%.+]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_:%.+]], i32 0, i32 0
+// CHECK-DAG: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 1
+// CHECK-DAG: store i64 4, i64* [[TMP22]],
+// CHECK-DAG: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 2
+// CHECK-DAG: store i8* bitcast (void (i8*)* @[[RED_INIT1:.+]] to i8*), i8** [[TMP23]],
+// CHECK-DAG: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 3
+// CHECK-DAG: store i8* null, i8** [[TMP24]],
+// CHECK-DAG: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 4
+// CHECK-DAG: store i8* bitcast (void (i8*, i8*)* @[[RED_COMB1:.+]] to i8*), i8** [[TMP25]],
+// CHECK-DAG: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 5
+// CHECK-DAG: [[TMP27:%.*]] = bitcast i32* [[TMP26]] to i8*
+// CHECK-DAG: call void @llvm.memset.p0i8.i64(i8* align 8 [[TMP27]], i8 0, i64 4, i1 false)
+// CHECK-DAG: [[ARRAYIDX5:%.*]] = getelementptr inbounds [100 x %struct.S], [100 x %struct.S]* [[C]], i64 0, i64 0
+// CHECK-DAG: [[LB_ADD_LEN:%.*]] = add nsw i64 -1, %
+// CHECK-DAG: [[ARRAYIDX6:%.*]] = getelementptr inbounds [100 x %struct.S], [100 x %struct.S]* [[C]], i64 0, i64 [[LB_ADD_LEN]]
+// CHECK-DAG: [[TMP31:%.*]] = bitcast %struct.S* [[ARRAYIDX5]] to i8*
+// CHECK-DAG: store i8* [[TMP31]], i8** [[TMP28:%[^,]+]],
+// CHECK-DAG: [[TMP28]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_4:%.+]], i32 0, i32 0
+// CHECK-DAG: [[TMP32:%.*]] = ptrtoint %struct.S* [[ARRAYIDX6]] to i64
+// CHECK-DAG: [[TMP33:%.*]] = ptrtoint %struct.S* [[ARRAYIDX5]] to i64
+// CHECK-DAG: [[TMP34:%.*]] = sub i64 [[TMP32]], [[TMP33]]
+// CHECK-DAG: [[TMP35:%.*]] = sdiv exact i64 [[TMP34]], ptrtoint (float* getelementptr (float, float* null, i32 1) to i64)
+// CHECK-DAG: [[TMP36:%.*]] = add nuw i64 [[TMP35]], 1
+// CHECK-DAG: [[TMP37:%.*]] = mul nuw i64 [[TMP36]], ptrtoint (float* getelementptr (float, float* null, i32 1) to i64)
+// CHECK-DAG: store i64 [[TMP37]], i64* [[TMP38:%[^,]+]],
+// CHECK-DAG: [[TMP38]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_4]], i32 0, i32 1
+// CHECK-DAG: [[TMP39:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_4]], i32 0, i32 2
+// CHECK-DAG: store i8* bitcast (void (i8*)* @[[RED_INIT2:.+]] to i8*), i8** [[TMP39]],
+// CHECK-DAG: [[TMP40:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_4]], i32 0, i32 3
+// CHECK-DAG: store i8* bitcast (void (i8*)* @[[RED_FINI2:.+]] to i8*), i8** [[TMP40]],
+// CHECK-DAG: [[TMP41:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_4]], i32 0, i32 4
+// CHECK-DAG: store i8* bitcast (void (i8*, i8*)* @[[RED_COMB2:.+]] to i8*), i8** [[TMP41]],
+// CHECK-DAG: [[TMP42:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_4]], i32 0, i32 5
+// CHECK-DAG: store i32 1, i32* [[TMP42]],
+// CHECK-DAG: [[TMP44:%.*]] = load float*, float** [[D]],
+// CHECK-DAG: [[TMP45:%.*]] = bitcast float* [[TMP44]] to i8*
+// CHECK-DAG: store i8* [[TMP45]], i8** [[TMP43:%[^,]+]],
+// CHECK-DAG: [[TMP43]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_7:%.+]], i32 0, i32 0
+// CHECK-DAG: [[TMP46:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 1
+// CHECK-DAG: store i64 4, i64* [[TMP46]],
+// CHECK-DAG: [[TMP47:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 2
+// CHECK-DAG: store i8* bitcast (void (i8*)* @[[RED_INIT3:.+]] to i8*), i8** [[TMP47]],
+// CHECK-DAG: [[TMP48:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 3
+// CHECK-DAG: store i8* null, i8** [[TMP48]],
+// CHECK-DAG: [[TMP49:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 4
+// CHECK-DAG: store i8* bitcast (void (i8*, i8*)* @[[RED_COMB3:.+]] to i8*), i8** [[TMP49]],
+// CHECK-DAG: [[TMP50:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 5
+// CHECK-DAG: [[TMP51:%.*]] = bitcast i32* [[TMP50]] to i8*
+// CHECK-DAG: call void @llvm.memset.p0i8.i64(i8* align 8 [[TMP51]], i8 0, i64 4, i1 false)
+// CHECK-DAG: [[TMP53:%.*]] = bitcast float* [[VLA]] to i8*
+// CHECK-DAG: store i8* [[TMP53]], i8** [[TMP52:%[^,]+]],
+// CHECK-DAG: [[TMP52]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_8:%.+]], i32 0, i32 0
+// CHECK-DAG: [[TMP54:%.*]] = mul nuw i64 [[TMP2]], 4
+// CHECK-DAG: [[TMP55:%.*]] = udiv exact i64 [[TMP54]], ptrtoint (float* getelementptr (float, float* null, i32 1) to i64)
+// CHECK-DAG: store i64 [[TMP54]], i64* [[TMP56:%[^,]+]],
+// CHECK-DAG: [[TMP56]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_8]], i32 0, i32 1
+// CHECK-DAG: [[TMP57:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_8]], i32 0, i32 2
+// CHECK-DAG: store i8* bitcast (void (i8*)* @[[RED_INIT4:.+]] to i8*), i8** [[TMP57]],
+// CHECK-DAG: [[TMP58:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_8]], i32 0, i32 3
+// CHECK-DAG: store i8* null, i8** [[TMP58]],
+// CHECK-DAG: [[TMP59:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_8]], i32 0, i32 4
+// CHECK-DAG: store i8* bitcast (void (i8*, i8*)* @[[RED_COMB4:.+]] to i8*), i8** [[TMP59]],
+// CHECK-DAG: [[TMP60:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_8]], i32 0, i32 5
+// CHECK-DAG: store i32 1, i32* [[TMP60]],
+// CHECK-DAG: [[DOTRD_INPUT_GEP_]] = getelementptr inbounds [4 x %struct.kmp_task_red_input_t], [4 x %struct.kmp_task_red_input_t]* [[DOTRD_INPUT_]], i64 0, i64
+// CHECK-DAG: [[DOTRD_INPUT_GEP_4]] = getelementptr inbounds [4 x %struct.kmp_task_red_input_t], [4 x %struct.kmp_task_red_input_t]* [[DOTRD_INPUT_]], i64 0, i64
+// CHECK-DAG: [[DOTRD_INPUT_GEP_7]] = getelementptr inbounds [4 x %struct.kmp_task_red_input_t], [4 x %struct.kmp_task_red_input_t]* [[DOTRD_INPUT_]], i64 0, i64
+// CHECK-DAG: [[DOTRD_INPUT_GEP_8]] = getelementptr inbounds [4 x %struct.kmp_task_red_input_t], [4 x %struct.kmp_task_red_input_t]* [[DOTRD_INPUT_]], i64 0, i64
+// CHECK: [[TMP61:%.*]] = bitcast [4 x %struct.kmp_task_red_input_t]* [[DOTRD_INPUT_]] to i8*
+// CHECK: [[TMP62:%.*]] = call i8* @__kmpc_task_reduction_init(i32 [[TMP0]], i32 4, i8* [[TMP61]])
+// CHECK: [[TMP63:%.*]] = load i32, i32* [[N]],
+// CHECK: store i32 [[TMP63]], i32* [[DOTCAPTURE_EXPR_]],
+// CHECK: [[TMP64:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]],
+// CHECK: [[SUB:%.*]] = sub nsw i32 [[TMP64]], 0
+// CHECK: [[SUB10:%.*]] = sub nsw i32 [[SUB]], 1
+// CHECK: [[ADD11:%.*]] = add nsw i32 [[SUB10]], 1
+// CHECK: [[DIV:%.*]] = sdiv i32 [[ADD11]], 1
+// CHECK: [[SUB12:%.*]] = sub nsw i32 [[DIV]], 1
+// CHECK: store i32 [[SUB12]], i32* [[DOTCAPTURE_EXPR_9]],
+// CHECK: [[TMP65:%.*]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* %{{.+}}, i32 [[TMP0]], i32 1, i64 888, i64 64, i32 (i32, i8*)* bitcast (i32 (i32, %struct.kmp_task_t_with_privates*)* @[[TASK:.+]] to i32 (i32, i8*)*))
+// CHECK: call void @__kmpc_taskloop(%struct.ident_t* %{{.+}}, i32 [[TMP0]], i8* [[TMP65]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* null)
+// CHECK: call void @__kmpc_end_taskgroup(%struct.ident_t*
+// CHECK: call {{.*}}void @__kmpc_end_master(
+// CHECK-NEXT: br label {{%?}}[[EXIT]]
+// CHECK: [[EXIT]]
+
+// CHECK: ret i32
+
+// CHECK: define internal void @[[RED_INIT1]](i8* %0)
+// CHECK: store float 0.000000e+00, float* %
+// CHECK: ret void
+
+// CHECK: define internal void @[[RED_COMB1]](i8* %0, i8* %1)
+// CHECK: fadd float %
+// CHECK: store float %{{.+}}, float* %
+// CHECK: ret void
+
+// CHECK: define internal void @[[RED_INIT2]](i8* %0)
+// CHECK: call i8* @__kmpc_threadprivate_cached(
+// CHECK: [[ORIG_PTR_ADDR:%.+]] = call i8* @__kmpc_threadprivate_cached(
+// CHECK: [[ORIG_PTR_REF:%.+]] = bitcast i8* [[ORIG_PTR_ADDR]] to i8**
+// CHECK: load i8*, i8** [[ORIG_PTR_REF]],
+// CHECK: call void [[OMP_INIT1:@.+]](
+// CHECK: ret void
+
+// CHECK: define internal void [[OMP_COMB1:@.+]](%struct.S* noalias %0, %struct.S* noalias %1)
+// CHECK: fadd float %
+
+// CHECK: define internal void [[OMP_INIT1]](%struct.S* noalias %0, %struct.S* noalias %1)
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(
+
+// CHECK: define internal void @[[RED_FINI2]](i8* %0)
+// CHECK: call i8* @__kmpc_threadprivate_cached(
+// CHECK: call void @
+// CHECK: ret void
+
+// CHECK: define internal void @[[RED_COMB2]](i8* %0, i8* %1)
+// CHECK: call i8* @__kmpc_threadprivate_cached(
+// CHECK: call void [[OMP_COMB1]](
+// CHECK: ret void
+
+// CHECK: define internal void @[[RED_INIT3]](i8* %0)
+// CHECK: store float 0.000000e+00, float* %
+// CHECK: ret void
+
+// CHECK: define internal void @[[RED_COMB3]](i8* %0, i8* %1)
+// CHECK: fadd float %
+// CHECK: store float %{{.+}}, float* %
+// CHECK: ret void
+
+// CHECK: define internal void @[[RED_INIT4]](i8* %0)
+// CHECK: call i8* @__kmpc_threadprivate_cached(
+// CHECK: store float 0.000000e+00, float* %
+// CHECK: ret void
+
+// CHECK: define internal void @[[RED_COMB4]](i8* %0, i8* %1)
+// CHECK: call i8* @__kmpc_threadprivate_cached(
+// CHECK: fadd float %
+// CHECK: store float %{{.+}}, float* %
+// CHECK: ret void
+
+// CHECK-NOT: call i8* @__kmpc_threadprivate_cached(
+// CHECK: call i8* @__kmpc_task_reduction_get_th_data(
+// CHECK: call i8* @__kmpc_threadprivate_cached(
+// CHECK: call i8* @__kmpc_threadprivate_cached(
+// CHECK: call i8* @__kmpc_task_reduction_get_th_data(
+// CHECK-NOT: call i8* @__kmpc_threadprivate_cached(
+// CHECK: call i8* @__kmpc_task_reduction_get_th_data(
+// CHECK: call i8* @__kmpc_threadprivate_cached(
+// CHECK: call i8* @__kmpc_task_reduction_get_th_data(
+// CHECK-NOT: call i8* @__kmpc_threadprivate_cached(
+
+// CHECK-DAG: distinct !DISubprogram(linkageName: "[[TASK]]", scope: !
+// CHECK-DAG: !DISubprogram(linkageName: "[[RED_INIT1]]"
+// CHECK-DAG: !DISubprogram(linkageName: "[[RED_COMB1]]"
+// CHECK-DAG: !DISubprogram(linkageName: "[[RED_INIT2]]"
+// CHECK-DAG: !DISubprogram(linkageName: "[[RED_FINI2]]"
+// CHECK-DAG: !DISubprogram(linkageName: "[[RED_COMB2]]"
+// CHECK-DAG: !DISubprogram(linkageName: "[[RED_INIT3]]"
+// CHECK-DAG: !DISubprogram(linkageName: "[[RED_COMB3]]"
+// CHECK-DAG: !DISubprogram(linkageName: "[[RED_INIT4]]"
+// CHECK-DAG: !DISubprogram(linkageName: "[[RED_COMB4]]"
diff --git a/src/llvm-project/clang/test/OpenMP/master_taskloop_reduction_messages.cpp b/src/llvm-project/clang/test/OpenMP/master_taskloop_reduction_messages.cpp
new file mode 100644
index 0000000..58be898
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/master_taskloop_reduction_messages.cpp
@@ -0,0 +1,352 @@
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
+
+typedef void **omp_allocator_handle_t;
+extern const omp_allocator_handle_t omp_default_mem_alloc;
+extern const omp_allocator_handle_t omp_large_cap_mem_alloc;
+extern const omp_allocator_handle_t omp_const_mem_alloc;
+extern const omp_allocator_handle_t omp_high_bw_mem_alloc;
+extern const omp_allocator_handle_t omp_low_lat_mem_alloc;
+extern const omp_allocator_handle_t omp_cgroup_mem_alloc;
+extern const omp_allocator_handle_t omp_pteam_mem_alloc;
+extern const omp_allocator_handle_t omp_thread_mem_alloc;
+
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp master taskloop reduction(+:fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+void foobar(int &ref) {
+#pragma omp master taskloop reduction(+:ref)
+ for (int i = 0; i < 10; ++i)
+ foo();
+}
+
+struct S1; // expected-note {{declared here}} expected-note 4 {{forward declaration of 'S1'}}
+extern S1 a;
+class S2 {
+ mutable int a;
+ S2 &operator+(const S2 &arg) { return (*this); } // expected-note 3 {{implicitly declared private here}}
+
+public:
+ S2() : a(0) {}
+ S2(S2 &s2) : a(s2.a) {}
+ static float S2s; // expected-note 2 {{static data member is predetermined as shared}}
+ static const float S2sc; // expected-note 2 {{'S2sc' declared here}}
+};
+const float S2::S2sc = 0;
+S2 b; // expected-note 3 {{'b' defined here}}
+const S2 ba[5]; // expected-note 2 {{'ba' defined here}}
+class S3 {
+ int a;
+
+public:
+ int b;
+ S3() : a(0) {}
+ S3(const S3 &s3) : a(s3.a) {}
+ S3 operator+(const S3 &arg1) { return arg1; }
+};
+int operator+(const S3 &arg1, const S3 &arg2) { return 5; }
+S3 c; // expected-note 3 {{'c' defined here}}
+const S3 ca[5]; // expected-note 2 {{'ca' defined here}}
+extern const int f; // expected-note 4 {{'f' declared here}}
+class S4 {
+ int a;
+ S4(); // expected-note {{implicitly declared private here}}
+ S4(const S4 &s4);
+ S4 &operator+(const S4 &arg) { return (*this); }
+
+public:
+ S4(int v) : a(v) {}
+};
+S4 &operator&=(S4 &arg1, S4 &arg2) { return arg1; }
+class S5 {
+ int a:32;
+ S5() : a(0) {} // expected-note {{implicitly declared private here}}
+ S5(const S5 &s5) : a(s5.a) {}
+ S5 &operator+(const S5 &arg);
+
+public:
+ S5(int v) : a(v) {}
+};
+class S6 { // expected-note 3 {{candidate function (the implicit copy assignment operator) not viable: no known conversion from 'int' to 'const S6' for 1st argument}}
+#if __cplusplus >= 201103L // C++11 or later
+// expected-note@-2 3 {{candidate function (the implicit move assignment operator) not viable}}
+#endif
+ int a;
+
+public:
+ S6() : a(6) {}
+ operator int() { return 6; }
+} o;
+
+struct S7 {
+ int a: 32;
+ S7() {
+#pragma omp master taskloop reduction(+:a) // expected-error {{expected addressable reduction item for the task-based directives}}
+ for (int i = 0; i < 10; ++i)
+ ++a;
+ }
+};
+
+S3 h, k;
+#pragma omp threadprivate(h) // expected-note 2 {{defined as threadprivate or thread local}}
+
+template <class T> // expected-note {{declared here}}
+T tmain(T argc) {
+ const T d = T(); // expected-note 4 {{'d' defined here}}
+ const T da[5] = {T()}; // expected-note 2 {{'da' defined here}}
+ T qa[5] = {T()};
+ T i, z;
+ T &j = i; // expected-note 4 {{'j' defined here}}
+ S3 &p = k; // expected-note 2 {{'p' defined here}}
+ const T &r = da[(int)i]; // expected-note 2 {{'r' defined here}}
+ T &q = qa[(int)i]; // expected-note 2 {{'q' defined here}}
+ T fl;
+#pragma omp master taskloop reduction // expected-error {{expected '(' after 'reduction'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction + // expected-error {{expected '(' after 'reduction'}} expected-warning {{extra tokens at the end of '#pragma omp master taskloop' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction( // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(- // expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction() // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(*) // expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected expression}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(\) // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(& : argc // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{invalid operands to binary expression ('float' and 'float')}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(| : argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{invalid operands to binary expression ('float' and 'float')}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(|| : argc ? i : argc) // expected-error 2 {{expected variable name, array element or array section}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(foo : argc) //expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'float'}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'int'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(^ : T) // expected-error {{'T' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(+ : z, a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 4 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 3 {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(max : h.b) // expected-error {{expected variable name, array element or array section}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(+ : ba) // expected-error {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(* : ca) // expected-error {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(- : da) // expected-error {{const-qualified variable cannot be reduction}} expected-error {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(^ : fl) // expected-error {{invalid operands to binary expression ('float' and 'float')}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(&& : S2::S2s) // expected-error {{shared variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(+ : h, k) // expected-error {{threadprivate or thread local variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(+ : o) // expected-error 2 {{no viable overloaded '='}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop private(i), reduction(+ : j), reduction(+ : q) // expected-error 4 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel private(k)
+#pragma omp master taskloop reduction(+ : p), reduction(+ : p) // expected-error 2 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(+ : p), reduction(+ : p) // expected-error 2 {{variable can appear only once in OpenMP 'reduction' clause}} expected-note 2 {{previously referenced here}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(+ : r) // expected-error 2 {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel shared(i)
+#pragma omp parallel reduction(min : i)
+#pragma omp master taskloop reduction(max : j) // expected-error 2 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel private(fl)
+#pragma omp master taskloop reduction(+ : fl) allocate(omp_thread_mem_alloc: fl) // expected-warning 2 {{allocator with the 'thread' trait access has unspecified behavior on 'master taskloop' directive}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel reduction(* : fl)
+#pragma omp master taskloop reduction(+ : fl)
+ for (int i = 0; i < 10; ++i)
+ foo();
+
+ return T();
+}
+
+namespace A {
+double x;
+#pragma omp threadprivate(x) // expected-note {{defined as threadprivate or thread local}}
+}
+namespace B {
+using A::x;
+}
+
+int main(int argc, char **argv) {
+ const int d = 5; // expected-note 2 {{'d' defined here}}
+ const int da[5] = {0}; // expected-note {{'da' defined here}}
+ int qa[5] = {0};
+ S4 e(4);
+ S5 g(5);
+ int i, z;
+ int &j = i; // expected-note 2 {{'j' defined here}}
+ S3 &p = k; // expected-note 2 {{'p' defined here}}
+ const int &r = da[i]; // expected-note {{'r' defined here}}
+ int &q = qa[i]; // expected-note {{'q' defined here}}
+ float fl;
+#pragma omp master taskloop reduction // expected-error {{expected '(' after 'reduction'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction + // expected-error {{expected '(' after 'reduction'}} expected-warning {{extra tokens at the end of '#pragma omp master taskloop' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction( // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(- // expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction() // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(*) // expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected expression}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(\) // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(foo : argc // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(| : argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(|| : argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name, array element or array section}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(~ : argc) // expected-error {{expected unqualified-id}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(&& : argc, z)
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(^ : S1) // expected-error {{'S1' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{const-qualified variable cannot be reduction}} expected-error {{'operator+' is a private member of 'S2'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 2 {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(max : h.b) // expected-error {{expected variable name, array element or array section}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(+ : ba) // expected-error {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(* : ca) // expected-error {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(- : da) // expected-error {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(^ : fl) // expected-error {{invalid operands to binary expression ('float' and 'float')}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(&& : S2::S2s) // expected-error {{shared variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{invalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(+ : o) // expected-error {{no viable overloaded '='}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop private(i), reduction(+ : j), reduction(+ : q) // expected-error 2 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel private(k)
+#pragma omp master taskloop reduction(+ : p), reduction(+ : p) // expected-error 2 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(+ : p), reduction(+ : p) // expected-error {{variable can appear only once in OpenMP 'reduction' clause}} expected-note {{previously referenced here}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop reduction(+ : r) // expected-error {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel shared(i)
+#pragma omp parallel reduction(min : i)
+#pragma omp master taskloop reduction(max : j) // expected-error {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel private(fl)
+#pragma omp master taskloop reduction(+ : fl)
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel reduction(* : fl)
+#pragma omp master taskloop reduction(+ : fl)
+ for (int i = 0; i < 10; ++i)
+ foo();
+ static int m;
+#pragma omp master taskloop reduction(+ : m) // OK
+ for (int i = 0; i < 10; ++i)
+ m++;
+#pragma omp master taskloop nogroup reduction(+ : m) // expected-error {{'reduction' clause cannot be used with 'nogroup' clause}}
+ for (int i = 0; i < 10; ++i)
+ m++;
+
+ return tmain(argc) + tmain(fl); // expected-note {{in instantiation of function template specialization 'tmain<int>' requested here}} expected-note {{in instantiation of function template specialization 'tmain<float>' requested here}}
+}
diff --git a/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_aligned_messages.cpp b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_aligned_messages.cpp
new file mode 100644
index 0000000..349fd60
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_aligned_messages.cpp
@@ -0,0 +1,205 @@
+// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp %s -Wuninitialized
+
+// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp-simd %s -Wuninitialized
+
+struct B {
+ static int ib[20]; // expected-note 0 {{'B::ib' declared here}}
+ static constexpr int bfoo() { return 8; }
+};
+namespace X {
+ B x; // expected-note {{'x' defined here}}
+};
+constexpr int bfoo() { return 4; }
+
+int **z;
+const int C1 = 1;
+const int C2 = 2;
+void test_aligned_colons(int *&rp)
+{
+ int *B = 0;
+ #pragma omp master taskloop simd aligned(B:bfoo())
+ for (int i = 0; i < 10; ++i) ;
+ // expected-error@+1 {{unexpected ':' in nested name specifier; did you mean '::'}}
+ #pragma omp master taskloop simd aligned(B::ib:B:bfoo())
+ for (int i = 0; i < 10; ++i) ;
+ #pragma omp master taskloop simd aligned(B:B::bfoo())
+ for (int i = 0; i < 10; ++i) ;
+ // expected-error@+1 {{unexpected ':' in nested name specifier; did you mean '::'?}}
+ #pragma omp master taskloop simd aligned(z:B:bfoo())
+ for (int i = 0; i < 10; ++i) ;
+ #pragma omp master taskloop simd aligned(B:B::bfoo())
+ for (int i = 0; i < 10; ++i) ;
+ // expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'int **'}}
+ // expected-error@+1 {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'B'}}
+ #pragma omp master taskloop simd aligned(X::x : ::z)
+ for (int i = 0; i < 10; ++i) ;
+ // expected-error@+1 {{integral constant expression must have integral or unscoped enumeration type, not 'B'}}
+ #pragma omp master taskloop simd aligned(B,rp,::z: X::x)
+ for (int i = 0; i < 10; ++i) ;
+ #pragma omp master taskloop simd aligned(::z)
+ for (int i = 0; i < 10; ++i) ;
+ // expected-error@+1 {{expected variable name}}
+ #pragma omp master taskloop simd aligned(B::bfoo())
+ for (int i = 0; i < 10; ++i) ;
+ // expected-warning@+1 {{aligned clause will be ignored because the requested alignment is not a power of 2}}
+ #pragma omp master taskloop simd aligned(B::ib,B:C1+C2)
+ for (int i = 0; i < 10; ++i) ;
+}
+
+// expected-note@+1 {{'num' defined here}}
+template<int L, class T, class N> T test_template(T* arr, N num) {
+ N i;
+ T sum = (T)0;
+ T ind2 = - num * L;
+ // Negative number is passed as L.
+ // expected-error@+1 {{argument to 'aligned' clause must be a strictly positive integer value}}
+ #pragma omp master taskloop simd aligned(arr:L)
+ for (i = 0; i < num; ++i) {
+ T cur = arr[(int)ind2];
+ ind2 += L;
+ sum += cur;
+ }
+ // expected-error@+1 {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'int'}}
+ #pragma omp master taskloop simd aligned(num:4)
+ for (i = 0; i < num; ++i);
+ return T();
+}
+
+template<int LEN> int test_warn() {
+ int *ind2 = 0;
+ // expected-error@+1 {{argument to 'aligned' clause must be a strictly positive integer value}}
+ #pragma omp master taskloop simd aligned(ind2:LEN)
+ for (int i = 0; i < 100; i++) {
+ ind2 += LEN;
+ }
+ return 0;
+}
+
+struct S1; // expected-note 2 {{declared here}}
+extern S1 a; // expected-note {{'a' declared here}}
+class S2 {
+ mutable int a;
+public:
+ S2():a(0) { }
+};
+const S2 b; // expected-note 1 {{'b' defined here}}
+const S2 ba[5];
+class S3 {
+ int a;
+public:
+ S3():a(0) { }
+};
+const S3 ca[5];
+class S4 {
+ int a;
+ S4();
+public:
+ S4(int v):a(v) { }
+};
+class S5 {
+ int a;
+ S5():a(0) {}
+public:
+ S5(int v):a(v) { }
+};
+
+S3 h; // expected-note 2 {{'h' defined here}}
+#pragma omp threadprivate(h)
+
+template<class I, class C> int foomain(I argc, C **argv) {
+ I e(argc);
+ I g(argc);
+ int i; // expected-note {{'i' defined here}}
+ // expected-note@+1 {{declared here}}
+ int &j = i;
+ #pragma omp master taskloop simd aligned // expected-error {{expected '(' after 'aligned'}}
+ for (I k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd aligned ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (I k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd aligned () // expected-error {{expected expression}}
+ for (I k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd aligned (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (I k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd aligned (argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (I k = 0; k < argc; ++k) ++k;
+// FIXME: Should argc really be a pointer?
+ #pragma omp master taskloop simd aligned (*argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
+ for (I k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd aligned (argc : 5) // expected-warning {{aligned clause will be ignored because the requested alignment is not a power of 2}}
+ for (I k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd aligned (S1) // expected-error {{'S1' does not refer to a value}}
+ for (I k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd aligned (argv[1]) // expected-error {{expected variable name}}
+ for (I k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd aligned(e, g)
+ for (I k = 0; k < argc; ++k) ++k;
+ // expected-error@+1 {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'S3'}}
+ #pragma omp master taskloop simd aligned(h)
+ for (I k = 0; k < argc; ++k) ++k;
+ // expected-error@+1 {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'int'}}
+ #pragma omp master taskloop simd aligned(i)
+ for (I k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel
+ {
+ int *v = 0;
+ I i;
+ #pragma omp master taskloop simd aligned(v:16)
+ for (I k = 0; k < argc; ++k) { i = k; v += 2; }
+ }
+ float *f;
+ #pragma omp master taskloop simd aligned(f)
+ for (I k = 0; k < argc; ++k) ++k;
+ int v = 0;
+ // expected-note@+2 {{initializer of 'j' is not a constant expression}}
+ // expected-error@+1 {{expression is not an integral constant expression}}
+ #pragma omp master taskloop simd aligned(f:j)
+ for (I k = 0; k < argc; ++k) { ++k; v += j; }
+ #pragma omp master taskloop simd aligned(f)
+ for (I k = 0; k < argc; ++k) ++k;
+ return 0;
+}
+
+// expected-note@+1 2 {{'argc' defined here}}
+int main(int argc, char **argv) {
+ double darr[100];
+ // expected-note@+1 {{in instantiation of function template specialization 'test_template<-4, double, int>' requested here}}
+ test_template<-4>(darr, 4);
+ test_warn<4>(); // ok
+ // expected-note@+1 {{in instantiation of function template specialization 'test_warn<0>' requested here}}
+ test_warn<0>();
+
+ int i;
+ int &j = i;
+ #pragma omp master taskloop simd aligned // expected-error {{expected '(' after 'aligned'}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd aligned ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd aligned () // expected-error {{expected expression}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd aligned (argv // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k) ++k;
+ // expected-error@+1 {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'int'}}
+ #pragma omp master taskloop simd aligned (argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd aligned (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k) ++k;
+ // expected-error@+1 {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'int'}}
+ #pragma omp master taskloop simd aligned (argc)
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd aligned (S1) // expected-error {{'S1' does not refer to a value}}
+ for (int k = 0; k < argc; ++k) ++k;
+ // expected-error@+2 {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'S1'}}
+ // expected-error@+1 {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'S2'}}
+#pragma omp master taskloop simd aligned(a, b)
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd aligned (argv[1]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k) ++k;
+ // expected-error@+1 {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'S3'}}
+ #pragma omp master taskloop simd aligned(h)
+ for (int k = 0; k < argc; ++k) ++k;
+ int *pargc = &argc;
+ // expected-note@+1 {{in instantiation of function template specialization 'foomain<int *, char>' requested here}}
+ foomain<int*,char>(pargc,argv);
+ return 0;
+}
+
diff --git a/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_ast_print.cpp b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_ast_print.cpp
new file mode 100644
index 0000000..fc74cf7
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_ast_print.cpp
@@ -0,0 +1,95 @@
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ast-print %s | FileCheck %s --check-prefix CHECK --check-prefix OMP45
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s --check-prefix CHECK --check-prefix OMP45
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -ast-print %s -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix OMP50
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -emit-pch -o %t %s -DOMP5
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix OMP50
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ast-print %s | FileCheck %s --check-prefix CHECK --check-prefix OMP45
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s --check-prefix CHECK --check-prefix OMP45
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -ast-print %s -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix OMP50
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -emit-pch -o %t %s -DOMP5
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix OMP50
+// expected-no-diagnostics
+
+#ifndef HEADER
+#define HEADER
+
+void foo() {}
+
+template <class T, int N>
+T tmain(T argc) {
+ T b = argc, c, d, e, f, g;
+ T *ptr;
+ static T a;
+// CHECK: static T a;
+#pragma omp taskgroup task_reduction(+: d) allocate(d)
+#pragma omp master taskloop simd allocate(d) if(taskloop: argc > N) default(shared) untied priority(N) safelen(N) linear(c) aligned(ptr) grainsize(N) reduction(+:g) in_reduction(+: d)
+ // CHECK-NEXT: #pragma omp taskgroup task_reduction(+: d) allocate(d)
+ // CHECK-NEXT: #pragma omp master taskloop simd allocate(d) if(taskloop: argc > N) default(shared) untied priority(N) safelen(N) linear(c) aligned(ptr) grainsize(N) reduction(+: g) in_reduction(+: d){{$}}
+ for (int i = 0; i < 2; ++i)
+ a = 2;
+// CHECK-NEXT: for (int i = 0; i < 2; ++i)
+// CHECK-NEXT: a = 2;
+#pragma omp parallel
+#pragma omp master taskloop simd private(argc, b), firstprivate(c, d), lastprivate(d, f) collapse(N) shared(g) if (c) final(d) mergeable priority(f) simdlen(N) nogroup num_tasks(N)
+ for (int i = 0; i < 2; ++i)
+ for (int j = 0; j < 2; ++j)
+ for (int j = 0; j < 2; ++j)
+ for (int j = 0; j < 2; ++j)
+ for (int j = 0; j < 2; ++j)
+ for (int i = 0; i < 2; ++i)
+ for (int j = 0; j < 2; ++j)
+ for (int j = 0; j < 2; ++j)
+ for (int j = 0; j < 2; ++j)
+ for (int j = 0; j < 2; ++j)
+ foo();
+ // CHECK-NEXT: #pragma omp parallel
+ // CHECK-NEXT: #pragma omp master taskloop simd private(argc,b) firstprivate(c,d) lastprivate(d,f) collapse(N) shared(g) if(c) final(d) mergeable priority(f) simdlen(N) nogroup num_tasks(N)
+ // CHECK-NEXT: for (int i = 0; i < 2; ++i)
+ // CHECK-NEXT: for (int j = 0; j < 2; ++j)
+ // CHECK-NEXT: for (int j = 0; j < 2; ++j)
+ // CHECK-NEXT: for (int j = 0; j < 2; ++j)
+ // CHECK-NEXT: for (int j = 0; j < 2; ++j)
+ // CHECK-NEXT: for (int i = 0; i < 2; ++i)
+ // CHECK-NEXT: for (int j = 0; j < 2; ++j)
+ // CHECK-NEXT: for (int j = 0; j < 2; ++j)
+ // CHECK-NEXT: for (int j = 0; j < 2; ++j)
+ // CHECK-NEXT: for (int j = 0; j < 2; ++j)
+ // CHECK-NEXT: foo();
+ return T();
+}
+
+// CHECK-LABEL: int main(int argc, char **argv) {
+int main(int argc, char **argv) {
+ int b = argc, c, d, e, f, g, h;
+ static int a;
+// CHECK: static int a;
+#pragma omp taskgroup task_reduction(+: d)
+#pragma omp master taskloop simd if(taskloop: a) default(none) shared(a) final(b) priority(5) safelen(8) linear(b), aligned(argv) num_tasks(argc) reduction(*: g) in_reduction(+: d)
+ // CHECK-NEXT: #pragma omp taskgroup task_reduction(+: d)
+ // CHECK-NEXT: #pragma omp master taskloop simd if(taskloop: a) default(none) shared(a) final(b) priority(5) safelen(8) linear(b) aligned(argv) num_tasks(argc) reduction(*: g) in_reduction(+: d)
+ for (int i = 0; i < 2; ++i)
+ a = 2;
+// CHECK-NEXT: for (int i = 0; i < 2; ++i)
+// CHECK-NEXT: a = 2;
+#pragma omp parallel
+#ifdef OMP5
+#pragma omp master taskloop simd private(argc, b), firstprivate(argv, c), lastprivate(d, f) collapse(2) shared(g) if(simd:argc) mergeable priority(argc) simdlen(16) grainsize(argc) reduction(max: a, e) nontemporal(argc, c, d)
+#else
+#pragma omp master taskloop simd private(argc, b), firstprivate(argv, c), lastprivate(d, f) collapse(2) shared(g) if(argc) mergeable priority(argc) simdlen(16) grainsize(argc) reduction(max: a, e)
+#endif // OMP5
+ for (int i = 0; i < 10; ++i)
+ for (int j = 0; j < 10; ++j)
+ foo();
+ // CHECK-NEXT: #pragma omp parallel
+ // OMP50-NEXT: #pragma omp master taskloop simd private(argc,b) firstprivate(argv,c) lastprivate(d,f) collapse(2) shared(g) if(simd: argc) mergeable priority(argc) simdlen(16) grainsize(argc) reduction(max: a,e) nontemporal(argc,c,d)
+ // OMP45-NEXT: #pragma omp master taskloop simd private(argc,b) firstprivate(argv,c) lastprivate(d,f) collapse(2) shared(g) if(argc) mergeable priority(argc) simdlen(16) grainsize(argc) reduction(max: a,e)
+ // CHECK-NEXT: for (int i = 0; i < 10; ++i)
+ // CHECK-NEXT: for (int j = 0; j < 10; ++j)
+ // CHECK-NEXT: foo();
+ return (tmain<int, 5>(argc) + tmain<char, 1>(argv[0][0]));
+}
+
+#endif
diff --git a/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_codegen.cpp b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_codegen.cpp
new file mode 100644
index 0000000..b21b3bc
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_codegen.cpp
@@ -0,0 +1,253 @@
+// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp -fopenmp-version=45 -x c++ -emit-llvm %s -o - -femit-all-decls | FileCheck %s --check-prefix CHECK --check-prefix OMP45
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -triple x86_64-apple-darwin10 -include-pch %t -verify %s -emit-llvm -o - -femit-all-decls | FileCheck %s --check-prefix CHECK --check-prefix OMP45
+// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp -fopenmp-version=50 -x c++ -emit-llvm %s -o - | FileCheck %s --check-prefix CHECK --check-prefix OMP50
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -triple x86_64-apple-darwin10 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CHECK --check-prefix OMP50
+
+// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp-simd -fopenmp-version=45 -x c++ -emit-llvm %s -o - -femit-all-decls | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -triple x86_64-apple-darwin10 -include-pch %t -verify %s -emit-llvm -o - -femit-all-decls | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp-simd -fopenmp-version=50 -x c++ -emit-llvm %s -o - -femit-all-decls | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -x c++ -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -x c++ -triple x86_64-apple-darwin10 -include-pch %t -verify %s -emit-llvm -o - -femit-all-decls | FileCheck --check-prefix SIMD-ONLY0 %s
+// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
+// expected-no-diagnostics
+#ifndef HEADER
+#define HEADER
+
+// CHECK-LABEL: @main
+int main(int argc, char **argv) {
+// CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* [[DEFLOC:@.+]])
+// CHECK: [[RES:%.+]] = call {{.*}}i32 @__kmpc_master(%struct.ident_t* [[DEFLOC]], i32 [[GTID]])
+// CHECK-NEXT: [[IS_MASTER:%.+]] = icmp ne i32 [[RES]], 0
+// CHECK-NEXT: br i1 [[IS_MASTER]], label {{%?}}[[THEN:.+]], label {{%?}}[[EXIT:.+]]
+// CHECK: [[THEN]]
+// CHECK: call void @__kmpc_taskgroup(%struct.ident_t* [[DEFLOC]], i32 [[GTID]])
+// CHECK: [[TASKV:%.+]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* [[DEFLOC]], i32 [[GTID]], i32 33, i64 80, i64 1, i32 (i32, i8*)* bitcast (i32 (i32, [[TDP_TY:%.+]]*)* [[TASK1:@.+]] to i32 (i32, i8*)*))
+// CHECK: [[TASK:%.+]] = bitcast i8* [[TASKV]] to [[TDP_TY]]*
+// CHECK: [[TASK_DATA:%.+]] = getelementptr inbounds [[TDP_TY]], [[TDP_TY]]* [[TASK]], i32 0, i32 0
+// CHECK: [[DOWN:%.+]] = getelementptr inbounds [[TD_TY:%.+]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 5
+// CHECK: store i64 0, i64* [[DOWN]],
+// CHECK: [[UP:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 6
+// CHECK: store i64 9, i64* [[UP]],
+// CHECK: [[ST:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 7
+// CHECK: store i64 1, i64* [[ST]],
+// CHECK: [[ST_VAL:%.+]] = load i64, i64* [[ST]],
+// CHECK: call void @__kmpc_taskloop(%struct.ident_t* [[DEFLOC]], i32 [[GTID]], i8* [[TASKV]], i32 1, i64* [[DOWN]], i64* [[UP]], i64 [[ST_VAL]], i32 1, i32 0, i64 0, i8* null)
+// CHECK: call void @__kmpc_end_taskgroup(%struct.ident_t* [[DEFLOC]], i32 [[GTID]])
+// CHECK: call {{.*}}void @__kmpc_end_master(%struct.ident_t* [[DEFLOC]], i32 [[GTID]])
+// CHECK-NEXT: br label {{%?}}[[EXIT]]
+// CHECK: [[EXIT]]
+#pragma omp master taskloop simd priority(argc)
+ for (int i = 0; i < 10; ++i)
+ ;
+// CHECK: [[RES:%.+]] = call {{.*}}i32 @__kmpc_master(%struct.ident_t* [[DEFLOC]], i32 [[GTID]])
+// CHECK-NEXT: [[IS_MASTER:%.+]] = icmp ne i32 [[RES]], 0
+// CHECK-NEXT: br i1 [[IS_MASTER]], label {{%?}}[[THEN:.+]], label {{%?}}[[EXIT:.+]]
+// CHECK: [[THEN]]
+// CHECK: [[TASKV:%.+]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* [[DEFLOC]], i32 [[GTID]], i32 1, i64 80, i64 1, i32 (i32, i8*)* bitcast (i32 (i32, [[TDP_TY:%.+]]*)* [[TASK2:@.+]] to i32 (i32, i8*)*))
+// CHECK: [[TASK:%.+]] = bitcast i8* [[TASKV]] to [[TDP_TY]]*
+// CHECK: [[TASK_DATA:%.+]] = getelementptr inbounds [[TDP_TY]], [[TDP_TY]]* [[TASK]], i32 0, i32 0
+// CHECK: [[DOWN:%.+]] = getelementptr inbounds [[TD_TY:%.+]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 5
+// CHECK: store i64 0, i64* [[DOWN]],
+// CHECK: [[UP:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 6
+// CHECK: store i64 9, i64* [[UP]],
+// CHECK: [[ST:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 7
+// CHECK: store i64 1, i64* [[ST]],
+// CHECK: [[ST_VAL:%.+]] = load i64, i64* [[ST]],
+// CHECK: [[GRAINSIZE:%.+]] = zext i32 %{{.+}} to i64
+// CHECK: call void @__kmpc_taskloop(%struct.ident_t* [[DEFLOC]], i32 [[GTID]], i8* [[TASKV]], i32 1, i64* [[DOWN]], i64* [[UP]], i64 [[ST_VAL]], i32 1, i32 1, i64 [[GRAINSIZE]], i8* null)
+// CHECK: call {{.*}}void @__kmpc_end_master(%struct.ident_t* [[DEFLOC]], i32 [[GTID]])
+// CHECK-NEXT: br label {{%?}}[[EXIT]]
+// CHECK: [[EXIT]]
+#pragma omp master taskloop simd nogroup grainsize(argc) simdlen(4)
+ for (int i = 0; i < 10; ++i)
+ ;
+// CHECK: [[RES:%.+]] = call {{.*}}i32 @__kmpc_master(%struct.ident_t* [[DEFLOC]], i32 [[GTID]])
+// CHECK-NEXT: [[IS_MASTER:%.+]] = icmp ne i32 [[RES]], 0
+// CHECK-NEXT: br i1 [[IS_MASTER]], label {{%?}}[[THEN:.+]], label {{%?}}[[EXIT:.+]]
+// CHECK: [[THEN]]
+// CHECK: call void @__kmpc_taskgroup(%struct.ident_t* [[DEFLOC]], i32 [[GTID]])
+// OMP45: [[TASKV:%.+]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* [[DEFLOC]], i32 [[GTID]], i32 1, i64 80, i64 24, i32 (i32, i8*)* bitcast (i32 (i32, [[TDP_TY:%.+]]*)* [[TASK3:@.+]] to i32 (i32, i8*)*))
+// OMP50: [[TASKV:%.+]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* [[DEFLOC]], i32 [[GTID]], i32 1, i64 80, i64 32, i32 (i32, i8*)* bitcast (i32 (i32, [[TDP_TY:%.+]]*)* [[TASK3:@.+]] to i32 (i32, i8*)*))
+// CHECK: [[TASK:%.+]] = bitcast i8* [[TASKV]] to [[TDP_TY]]*
+// CHECK: [[TASK_DATA:%.+]] = getelementptr inbounds [[TDP_TY]], [[TDP_TY]]* [[TASK]], i32 0, i32 0
+// OMP45: [[IF:%.+]] = icmp ne i32 %{{.+}}, 0
+// OMP50: [[IF_VAL:%.+]] = load i8, i8* %
+// OMP50: [[IF:%.+]] = trunc i8 [[IF_VAL]] to i1
+// CHECK: [[IF_INT:%.+]] = sext i1 [[IF]] to i32
+// CHECK: [[DOWN:%.+]] = getelementptr inbounds [[TD_TY:%.+]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 5
+// CHECK: store i64 0, i64* [[DOWN]],
+// CHECK: [[UP:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 6
+// CHECK: store i64 %{{.+}}, i64* [[UP]],
+// CHECK: [[ST:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 7
+// CHECK: store i64 1, i64* [[ST]],
+// CHECK: [[ST_VAL:%.+]] = load i64, i64* [[ST]],
+// CHECK: call void @__kmpc_taskloop(%struct.ident_t* [[DEFLOC]], i32 [[GTID]], i8* [[TASKV]], i32 [[IF_INT]], i64* [[DOWN]], i64* [[UP]], i64 [[ST_VAL]], i32 1, i32 2, i64 4, i8* null)
+// CHECK: call void @__kmpc_end_taskgroup(%struct.ident_t* [[DEFLOC]], i32 [[GTID]])
+// CHECK: call {{.*}}void @__kmpc_end_master(%struct.ident_t* [[DEFLOC]], i32 [[GTID]])
+// CHECK-NEXT: br label {{%?}}[[EXIT]]
+// CHECK: [[EXIT]]
+ int i;
+#pragma omp master taskloop simd if(argc) shared(argc, argv) collapse(2) num_tasks(4) safelen(32)
+ for (i = 0; i < argc; ++i)
+ for (int j = argc; j < argv[argc][argc]; ++j)
+ ;
+}
+
+// CHECK: define internal i32 [[TASK1]](
+// CHECK: [[DOWN:%.+]] = getelementptr inbounds [[TD_TY:%.+]], [[TD_TY]]* %{{.+}}, i32 0, i32 5
+// CHECK: [[DOWN_VAL:%.+]] = load i64, i64* [[DOWN]],
+// CHECK: [[UP:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 6
+// CHECK: [[UP_VAL:%.+]] = load i64, i64* [[UP]],
+// CHECK: [[ST:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 7
+// CHECK: [[ST_VAL:%.+]] = load i64, i64* [[ST]],
+// CHECK: [[LITER:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 8
+// CHECK: [[LITER_VAL:%.+]] = load i32, i32* [[LITER]],
+// CHECK: store i64 [[DOWN_VAL]], i64* [[LB:%[^,]+]],
+// CHECK: store i64 [[UP_VAL]], i64* [[UB:%[^,]+]],
+// CHECK: store i64 [[ST_VAL]], i64* [[ST:%[^,]+]],
+// CHECK: store i32 [[LITER_VAL]], i32* [[LITER:%[^,]+]],
+// CHECK: [[LB_VAL:%.+]] = load i64, i64* [[LB]],
+// CHECK: [[LB_I32:%.+]] = trunc i64 [[LB_VAL]] to i32
+// CHECK: store i32 [[LB_I32]], i32* [[CNT:%.+]],
+// CHECK: br label
+// CHECK: [[VAL:%.+]] = load i32, i32* [[CNT]],{{.*}}!llvm.access.group
+// CHECK: [[VAL_I64:%.+]] = sext i32 [[VAL]] to i64
+// CHECK: [[UB_VAL:%.+]] = load i64, i64* [[UB]],{{.*}}!llvm.access.group
+// CHECK: [[CMP:%.+]] = icmp ule i64 [[VAL_I64]], [[UB_VAL]]
+// CHECK: br i1 [[CMP]], label %{{.+}}, label %{{.+}}
+// CHECK: load i32, i32* %{{.*}}!llvm.access.group
+// CHECK: store i32 %{{.*}}!llvm.access.group
+// CHECK: load i32, i32* %{{.*}}!llvm.access.group
+// CHECK: add nsw i32 %{{.+}}, 1
+// CHECK: store i32 %{{.+}}, i32* %{{.*}}!llvm.access.group
+// CHECK: br label %{{.*}}!llvm.loop
+// CHECK: ret i32 0
+
+// CHECK: define internal i32 [[TASK2]](
+// CHECK: [[DOWN:%.+]] = getelementptr inbounds [[TD_TY:%.+]], [[TD_TY]]* %{{.+}}, i32 0, i32 5
+// CHECK: [[DOWN_VAL:%.+]] = load i64, i64* [[DOWN]],
+// CHECK: [[UP:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 6
+// CHECK: [[UP_VAL:%.+]] = load i64, i64* [[UP]],
+// CHECK: [[ST:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 7
+// CHECK: [[ST_VAL:%.+]] = load i64, i64* [[ST]],
+// CHECK: [[LITER:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 8
+// CHECK: [[LITER_VAL:%.+]] = load i32, i32* [[LITER]],
+// CHECK: store i64 [[DOWN_VAL]], i64* [[LB:%[^,]+]],
+// CHECK: store i64 [[UP_VAL]], i64* [[UB:%[^,]+]],
+// CHECK: store i64 [[ST_VAL]], i64* [[ST:%[^,]+]],
+// CHECK: store i32 [[LITER_VAL]], i32* [[LITER:%[^,]+]],
+// CHECK: [[LB_VAL:%.+]] = load i64, i64* [[LB]],
+// CHECK: [[LB_I32:%.+]] = trunc i64 [[LB_VAL]] to i32
+// CHECK: store i32 [[LB_I32]], i32* [[CNT:%.+]],
+// CHECK: br label
+// CHECK: [[VAL:%.+]] = load i32, i32* [[CNT]],{{.*}}!llvm.access.group
+// CHECK: [[VAL_I64:%.+]] = sext i32 [[VAL]] to i64
+// CHECK: [[UB_VAL:%.+]] = load i64, i64* [[UB]],{{.*}}!llvm.access.group
+// CHECK: [[CMP:%.+]] = icmp ule i64 [[VAL_I64]], [[UB_VAL]]
+// CHECK: br i1 [[CMP]], label %{{.+}}, label %{{.+}}
+// CHECK: load i32, i32* %{{.*}}!llvm.access.group
+// CHECK: store i32 %{{.*}}!llvm.access.group
+// CHECK: load i32, i32* %{{.*}}!llvm.access.group
+// CHECK: add nsw i32 %{{.+}}, 1
+// CHECK: store i32 %{{.+}}, i32* %{{.*}}!llvm.access.group
+// CHECK: br label %{{.*}}!llvm.loop
+// CHECK: ret i32 0
+
+// CHECK: define internal i32 [[TASK3]](
+// CHECK: [[DOWN:%.+]] = getelementptr inbounds [[TD_TY:%.+]], [[TD_TY]]* %{{.+}}, i32 0, i32 5
+// CHECK: [[DOWN_VAL:%.+]] = load i64, i64* [[DOWN]],
+// CHECK: [[UP:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 6
+// CHECK: [[UP_VAL:%.+]] = load i64, i64* [[UP]],
+// CHECK: [[ST:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 7
+// CHECK: [[ST_VAL:%.+]] = load i64, i64* [[ST]],
+// CHECK: [[LITER:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 8
+// CHECK: [[LITER_VAL:%.+]] = load i32, i32* [[LITER]],
+// CHECK: store i64 [[DOWN_VAL]], i64* [[LB:%[^,]+]],
+// CHECK: store i64 [[UP_VAL]], i64* [[UB:%[^,]+]],
+// CHECK: store i64 [[ST_VAL]], i64* [[ST:%[^,]+]],
+// CHECK: store i32 [[LITER_VAL]], i32* [[LITER:%[^,]+]],
+// CHECK: [[LB_VAL:%.+]] = load i64, i64* [[LB]],
+// CHECK: store i64 [[LB_VAL]], i64* [[CNT:%.+]],
+// CHECK: br label
+// CHECK-NOT: !llvm.access.group
+// CHECK: br label %{{.*}}!llvm.loop
+// OMP45-NOT: br label %{{.*}}!llvm.loop
+// OMP50: br label %{{.*}}!llvm.loop
+// CHECK: ret i32 0
+
+// CHECK-LABEL: @_ZN1SC2Ei
+struct S {
+ int a;
+ S(int c) {
+// CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* [[DEFLOC:@.+]])
+// CHECK: [[RES:%.+]] = call {{.*}}i32 @__kmpc_master(%struct.ident_t* [[DEFLOC]], i32 [[GTID]])
+// CHECK-NEXT: [[IS_MASTER:%.+]] = icmp ne i32 [[RES]], 0
+// CHECK-NEXT: br i1 [[IS_MASTER]], label {{%?}}[[THEN:.+]], label {{%?}}[[EXIT:.+]]
+// CHECK: [[THEN]]
+// CHECK: [[TASKV:%.+]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* [[DEFLOC]], i32 [[GTID]], i32 1, i64 80, i64 16, i32 (i32, i8*)* bitcast (i32 (i32, [[TDP_TY:%.+]]*)* [[TASK4:@.+]] to i32 (i32, i8*)*))
+// CHECK: [[TASK:%.+]] = bitcast i8* [[TASKV]] to [[TDP_TY]]*
+// CHECK: [[TASK_DATA:%.+]] = getelementptr inbounds [[TDP_TY]], [[TDP_TY]]* [[TASK]], i32 0, i32 0
+// CHECK: [[DOWN:%.+]] = getelementptr inbounds [[TD_TY:%.+]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 5
+// CHECK: store i64 0, i64* [[DOWN]],
+// CHECK: [[UP:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 6
+// CHECK: store i64 %{{.+}}, i64* [[UP]],
+// CHECK: [[ST:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 7
+// CHECK: store i64 1, i64* [[ST]],
+// CHECK: [[ST_VAL:%.+]] = load i64, i64* [[ST]],
+// CHECK: [[NUM_TASKS:%.+]] = zext i32 %{{.+}} to i64
+// CHECK: call void @__kmpc_taskloop(%struct.ident_t* [[DEFLOC]], i32 [[GTID]], i8* [[TASKV]], i32 1, i64* [[DOWN]], i64* [[UP]], i64 [[ST_VAL]], i32 1, i32 2, i64 [[NUM_TASKS]], i8* null)
+// CHECK: call {{.*}}void @__kmpc_end_master(%struct.ident_t* [[DEFLOC]], i32 [[GTID]])
+// CHECK-NEXT: br label {{%?}}[[EXIT]]
+// CHECK: [[EXIT]]
+#pragma omp master taskloop simd shared(c) num_tasks(a) simdlen(8) safelen(64)
+ for (a = 0; a < c; ++a)
+ ;
+ }
+} s(1);
+
+// CHECK: define internal i32 [[TASK4]](
+// CHECK: [[DOWN:%.+]] = getelementptr inbounds [[TD_TY:%.+]], [[TD_TY]]* %{{.+}}, i32 0, i32 5
+// CHECK: [[DOWN_VAL:%.+]] = load i64, i64* [[DOWN]],
+// CHECK: [[UP:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 6
+// CHECK: [[UP_VAL:%.+]] = load i64, i64* [[UP]],
+// CHECK: [[ST:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 7
+// CHECK: [[ST_VAL:%.+]] = load i64, i64* [[ST]],
+// CHECK: [[LITER:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 8
+// CHECK: [[LITER_VAL:%.+]] = load i32, i32* [[LITER]],
+// CHECK: store i64 [[DOWN_VAL]], i64* [[LB:%[^,]+]],
+// CHECK: store i64 [[UP_VAL]], i64* [[UB:%[^,]+]],
+// CHECK: store i64 [[ST_VAL]], i64* [[ST:%[^,]+]],
+// CHECK: store i32 [[LITER_VAL]], i32* [[LITER:%[^,]+]],
+// CHECK: [[LB_VAL:%.+]] = load i64, i64* [[LB]],
+// CHECK: [[LB_I32:%.+]] = trunc i64 [[LB_VAL]] to i32
+// CHECK: store i32 [[LB_I32]], i32* [[CNT:%.+]],
+// CHECK: br label
+// CHECK: [[VAL:%.+]] = load i32, i32* [[CNT]],
+// CHECK: [[VAL_I64:%.+]] = sext i32 [[VAL]] to i64
+// CHECK: [[UB_VAL:%.+]] = load i64, i64* [[UB]],
+// CHECK: [[CMP:%.+]] = icmp ule i64 [[VAL_I64]], [[UB_VAL]]
+// CHECK: br i1 [[CMP]], label %{{.+}}, label %{{.+}}
+// CHECK: load i32, i32* %
+// CHECK-NOT: !llvm.access.group
+// CHECK: store i32 %
+// CHECK-NOT: !llvm.access.group
+// CHECK: load i32, i32* %
+// CHECK-NOT: !llvm.access.group
+// CHECK: add nsw i32 %{{.+}}, 1
+// CHECK: store i32 %{{.+}}, i32* %
+// CHECK-NOT: !llvm.access.group
+// CHECK: br label %{{.*}}!llvm.loop
+// CHECK: ret i32 0
+
+// OMP45-NOT: !{!"llvm.loop.vectorize.enable", i1 false}
+// CHECK-DAG: !{!"llvm.loop.vectorize.enable", i1 true}
+// OMP50-DAG: !{!"llvm.loop.vectorize.enable", i1 false}
+// OMP45-NOT: !{!"llvm.loop.vectorize.enable", i1 false}
+// CHECK-DAG: !{!"llvm.loop.vectorize.width", i32 4}
+// CHECK-DAG: !{!"llvm.loop.vectorize.width", i32 32}
+// CHECK-DAG: !{!"llvm.loop.vectorize.width", i32 8}
+
+#endif
diff --git a/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_collapse_messages.cpp b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_collapse_messages.cpp
new file mode 100644
index 0000000..653f52e
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_collapse_messages.cpp
@@ -0,0 +1,110 @@
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
+
+void foo() {
+}
+
+#if __cplusplus >= 201103L
+// expected-note@+2 4 {{declared here}}
+#endif
+bool foobool(int argc) {
+ return argc;
+}
+
+struct S1; // expected-note {{declared here}}
+
+template <class T, typename S, int N, int ST> // expected-note {{declared here}}
+T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
+ #pragma omp master taskloop simd collapse // expected-error {{expected '(' after 'collapse'}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp master taskloop simd collapse ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp master taskloop simd collapse () // expected-error {{expected expression}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ // expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
+ // expected-error@+2 2 {{expression is not an integral constant expression}}
+ // expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
+ #pragma omp master taskloop simd collapse (argc
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ // expected-error@+1 2 {{argument to 'collapse' clause must be a strictly positive integer value}}
+ #pragma omp master taskloop simd collapse (ST // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp master taskloop simd collapse (1)) // expected-warning {{extra tokens at the end of '#pragma omp master taskloop simd' are ignored}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp master taskloop simd collapse ((ST > 0) ? 1 + ST : 2) // expected-note 2 {{as specified in 'collapse' clause}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp master taskloop simd', but found only 1}}
+ // expected-error@+6 2 {{directive '#pragma omp master taskloop simd' cannot contain more than one 'collapse' clause}}
+ // expected-error@+5 {{argument to 'collapse' clause must be a strictly positive integer value}}
+ // expected-error@+4 2 {{expression is not an integral constant expression}}
+#if __cplusplus >= 201103L
+ // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
+#endif
+ #pragma omp master taskloop simd collapse (foobool(argc)), collapse (true), collapse (-5)
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp master taskloop simd collapse (S) // expected-error {{'S' does not refer to a value}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+#if __cplusplus <= 199711L
+ // expected-error@+4 2 {{expression is not an integral constant expression}}
+#else
+ // expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
+#endif
+ #pragma omp master taskloop simd collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp master taskloop simd collapse (1)
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp master taskloop simd collapse (N) // expected-error {{argument to 'collapse' clause must be a strictly positive integer value}}
+ for (T i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp master taskloop simd collapse (2) // expected-note {{as specified in 'collapse' clause}}
+ foo(); // expected-error {{expected 2 for loops after '#pragma omp master taskloop simd'}}
+ return argc;
+}
+
+int main(int argc, char **argv) {
+ #pragma omp master taskloop simd collapse // expected-error {{expected '(' after 'collapse'}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ #pragma omp master taskloop simd collapse ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ #pragma omp master taskloop simd collapse () // expected-error {{expected expression}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ #pragma omp master taskloop simd collapse (4 // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-note {{as specified in 'collapse' clause}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp master taskloop simd', but found only 1}}
+ #pragma omp master taskloop simd collapse (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp master taskloop simd' are ignored}} expected-note {{as specified in 'collapse' clause}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp master taskloop simd', but found only 1}}
+ // expected-error@+4 {{expression is not an integral constant expression}}
+#if __cplusplus >= 201103L
+ // expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
+#endif
+ #pragma omp master taskloop simd collapse (foobool(1) > 0 ? 1 : 2)
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ // expected-error@+6 {{expression is not an integral constant expression}}
+#if __cplusplus >= 201103L
+ // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
+#endif
+ // expected-error@+2 2 {{directive '#pragma omp master taskloop simd' cannot contain more than one 'collapse' clause}}
+ // expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}}
+ #pragma omp master taskloop simd collapse (foobool(argc)), collapse (true), collapse (-5)
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ #pragma omp master taskloop simd collapse (S1) // expected-error {{'S1' does not refer to a value}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+#if __cplusplus <= 199711L
+ // expected-error@+4 {{expression is not an integral constant expression}}
+#else
+ // expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
+#endif
+ #pragma omp master taskloop simd collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ // expected-error@+3 {{statement after '#pragma omp master taskloop simd' must be a for loop}}
+ // expected-note@+1 {{in instantiation of function template specialization 'tmain<int, char, -1, -2>' requested here}}
+ #pragma omp master taskloop simd collapse(collapse(tmain<int, char, -1, -2>(argc, argv) // expected-error 2 {{expected ')'}} expected-note 2 {{to match this '('}}
+ foo();
+ #pragma omp master taskloop simd collapse (2) // expected-note {{as specified in 'collapse' clause}}
+ foo(); // expected-error {{expected 2 for loops after '#pragma omp master taskloop simd'}}
+ // expected-note@+1 {{in instantiation of function template specialization 'tmain<int, char, 1, 0>' requested here}}
+ return tmain<int, char, 1, 0>(argc, argv);
+}
+
diff --git a/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_final_messages.cpp b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_final_messages.cpp
new file mode 100644
index 0000000..387431f
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_final_messages.cpp
@@ -0,0 +1,94 @@
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+struct S1; // expected-note {{declared here}}
+
+template <class T, class S> // expected-note {{declared here}}
+int tmain(T argc, S **argv) {
+ T z;
+#pragma omp master taskloop simd final // expected-error {{expected '(' after 'final'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd final( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd final() // expected-error {{expected expression}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd final(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd final(argc + z)) // expected-warning {{extra tokens at the end of '#pragma omp master taskloop simd' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd final(argc > 0 ? argv[1] : argv[2])
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd final(foobool(argc)), final(true) // expected-error {{directive '#pragma omp master taskloop simd' cannot contain more than one 'final' clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd final(S) // expected-error {{'S' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd final(argv[1] = 2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd final(argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd final(argc)
+ for (int i = 0; i < 10; ++i)
+ foo();
+
+ return 0;
+}
+
+int main(int argc, char **argv) {
+ int z;
+#pragma omp master taskloop simd final // expected-error {{expected '(' after 'final'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd final( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd final() // expected-error {{expected expression}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd final(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd final(z+argc)) // expected-warning {{extra tokens at the end of '#pragma omp master taskloop simd' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd final(argc > 0 ? argv[1] : argv[2])
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd final(foobool(argc)), final(true) // expected-error {{directive '#pragma omp master taskloop simd' cannot contain more than one 'final' clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd final(S1) // expected-error {{'S1' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd final(argv[1] = 2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd final(argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd final(1 0) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd final(if (tmain(argc, argv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+
+ return tmain(argc, argv);
+}
diff --git a/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_firstprivate_codegen.cpp b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_firstprivate_codegen.cpp
new file mode 100644
index 0000000..c771ed1
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_firstprivate_codegen.cpp
@@ -0,0 +1,517 @@
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-apple-darwin10 -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=LAMBDA %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=BLOCKS %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DARRAY -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=ARRAY %s
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DARRAY -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
+// expected-no-diagnostics
+
+#ifndef ARRAY
+#ifndef HEADER
+#define HEADER
+
+template <class T>
+struct S {
+ T f;
+ S(T a) : f(a) {}
+ S() : f() {}
+ S(const S &s, T t = T()) : f(s.f + t) {}
+ operator T() { return T(); }
+ ~S() {}
+};
+
+volatile double g;
+
+// CHECK-DAG: [[KMP_TASK_T_TY:%.+]] = type { i8*, i32 (i32, i8*)*, i32, %union{{.+}}, %union{{.+}}, i64, i64, i64, i32, i8* }
+// CHECK-DAG: [[S_DOUBLE_TY:%.+]] = type { double }
+// CHECK-DAG: [[PRIVATES_MAIN_TY:%.+]] = type {{.?}}{ [2 x [[S_DOUBLE_TY]]], [[S_DOUBLE_TY]], i32, [2 x i32]
+// CHECK-DAG: [[CAP_MAIN_TY:%.+]] = type {{.*}}{ [2 x i32]*, i32, {{.*}}[2 x [[S_DOUBLE_TY]]]*, [[S_DOUBLE_TY]]*, i{{[0-9]+}}
+// CHECK-DAG: [[KMP_TASK_MAIN_TY:%.+]] = type { [[KMP_TASK_T_TY]], [[PRIVATES_MAIN_TY]] }
+// CHECK-DAG: [[S_INT_TY:%.+]] = type { i32 }
+// CHECK-DAG: [[CAP_TMAIN_TY:%.+]] = type { [2 x i32]*, i32*, [2 x [[S_INT_TY]]]*, [[S_INT_TY]]* }
+// CHECK-DAG: [[PRIVATES_TMAIN_TY:%.+]] = type { i32, [2 x i32], [2 x [[S_INT_TY]]], [[S_INT_TY]], [104 x i8] }
+// CHECK-DAG: [[KMP_TASK_TMAIN_TY:%.+]] = type { [[KMP_TASK_T_TY]], [{{[0-9]+}} x i8], [[PRIVATES_TMAIN_TY]] }
+template <typename T>
+T tmain() {
+ S<T> ttt;
+ S<T> test(ttt);
+ T t_var __attribute__((aligned(128))) = T();
+ T vec[] = {1, 2};
+ S<T> s_arr[] = {1, 2};
+ S<T> var(3);
+#pragma omp master taskloop simd firstprivate(t_var, vec, s_arr, s_arr, var, var)
+ for (int i = 0; i < 10; ++i) {
+ vec[0] = t_var;
+ s_arr[0] = var;
+ }
+ return T();
+}
+
+int main() {
+ static int sivar;
+#ifdef LAMBDA
+ // LAMBDA: [[G:@.+]] = global double
+ // LAMBDA: [[SIVAR:@.+]] = internal global i{{[0-9]+}} 0,
+ // LAMBDA-LABEL: @main
+ // LAMBDA: call{{( x86_thiscallcc)?}} void [[OUTER_LAMBDA:@.+]](
+ [&]() {
+ // LAMBDA: define{{.*}} internal{{.*}} void [[OUTER_LAMBDA]](
+ // LAMBDA: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc(%{{[^ ]+}} @{{[^,]+}}, i32 %{{[^,]+}}, i32 1, i64 96, i64 16, i32 (i32, i8*)* bitcast (i32 (i32, %{{[^*]+}}*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+// LAMBDA: [[PRIVATES:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i{{.+}} 0, i{{.+}} 1
+// LAMBDA: [[G_PRIVATE_ADDR:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[PRIVATES]], i{{.+}} 0, i{{.+}} 0
+// LAMBDA: [[G_ADDR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i{{.+}} 0, i{{.+}} 0
+// LAMBDA: [[G_VAL:%.+]] = load volatile double, double* [[G_ADDR_REF]]
+// LAMBDA: store volatile double [[G_VAL]], double* [[G_PRIVATE_ADDR]]
+
+// LAMBDA: [[SIVAR_PRIVATE_ADDR:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
+// LAMBDA: [[SIVAR_ADDR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i{{.+}} 0, i{{.+}} 1
+// LAMBDA: [[SIVAR_VAL:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[SIVAR_ADDR_REF]]
+// LAMBDA: store i{{[0-9]+}} [[SIVAR_VAL]], i{{[0-9]+}}* [[SIVAR_PRIVATE_ADDR]]
+
+// LAMBDA: call void @__kmpc_taskloop(%{{.+}}* @{{.+}}, i32 %{{.+}}, i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* null)
+// LAMBDA: ret
+#pragma omp master taskloop simd firstprivate(g, sivar)
+ for (int i = 0; i < 10; ++i) {
+ // LAMBDA: define {{.+}} void [[INNER_LAMBDA:@.+]](%{{.+}}* [[ARG_PTR:%.+]])
+ // LAMBDA: store %{{.+}}* [[ARG_PTR]], %{{.+}}** [[ARG_PTR_REF:%.+]],
+ // LAMBDA: [[ARG_PTR:%.+]] = load %{{.+}}*, %{{.+}}** [[ARG_PTR_REF]]
+ // LAMBDA: [[G_PTR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[ARG_PTR]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+ // LAMBDA: [[G_REF:%.+]] = load double*, double** [[G_PTR_REF]]
+ // LAMBDA: store double 2.0{{.+}}, double* [[G_REF]]
+
+ // LAMBDA: store double* %{{.+}}, double** %{{.+}},
+ // LAMBDA: define internal i32 [[TASK_ENTRY]](i32 %0, %{{.+}}* noalias %1)
+ g = 1;
+ sivar = 11;
+ // LAMBDA: store double 1.0{{.+}}, double* %{{.+}},
+ // LAMBDA: store i{{[0-9]+}} 11, i{{[0-9]+}}* %{{.+}},
+ // LAMBDA: call void [[INNER_LAMBDA]](%
+ // LAMBDA: ret
+ [&]() {
+ g = 2;
+ sivar = 22;
+ }();
+ }
+ }();
+ return 0;
+#elif defined(BLOCKS)
+ // BLOCKS: [[G:@.+]] = global double
+ // BLOCKS-LABEL: @main
+ // BLOCKS: call void {{%.+}}(i8
+ ^{
+ // BLOCKS: define{{.*}} internal{{.*}} void {{.+}}(i8*
+ // BLOCKS: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc(%{{[^ ]+}} @{{[^,]+}}, i32 %{{[^,]+}}, i32 1, i64 96, i64 16, i32 (i32, i8*)* bitcast (i32 (i32, %{{[^*]+}}*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+ // BLOCKS: [[PRIVATES:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i{{.+}} 0, i{{.+}} 1
+ // BLOCKS: [[G_PRIVATE_ADDR:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[PRIVATES]], i{{.+}} 0, i{{.+}} 0
+ // BLOCKS: [[G_ADDR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i{{.+}} 0, i{{.+}} 0
+ // BLOCKS: [[G_VAL:%.+]] = load volatile double, double* [[G_ADDR_REF]]
+ // BLOCKS: store volatile double [[G_VAL]], double* [[G_PRIVATE_ADDR]]
+
+ // BLOCKS: [[SIVAR_PRIVATE_ADDR:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
+ // BLOCKS: [[SIVAR_ADDR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i{{.+}} 0, i{{.+}} 1
+ // BLOCKS: [[SIVAR_VAL:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[SIVAR_ADDR_REF]]
+ // BLOCKS: store i{{[0-9]+}} [[SIVAR_VAL]], i{{[0-9]+}}* [[SIVAR_PRIVATE_ADDR]]
+ // BLOCKS: call void @__kmpc_taskloop(%{{.+}}* @{{.+}}, i32 %{{.+}}, i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* null)
+ // BLOCKS: ret
+#pragma omp master taskloop simd firstprivate(g, sivar)
+ for (int i = 0; i < 10; ++i) {
+ // BLOCKS: define {{.+}} void {{@.+}}(i8*
+ // BLOCKS-NOT: [[G]]{{[[^:word:]]}}
+ // BLOCKS: store double 2.0{{.+}}, double*
+ // BLOCKS-NOT: [[G]]{{[[^:word:]]}}
+ // BLOCKS-NOT: [[ISVAR]]{{[[^:word:]]}}
+ // BLOCKS: store i{{[0-9]+}} 22, i{{[0-9]+}}*
+ // BLOCKS-NOT: [[SIVAR]]{{[[^:word:]]}}
+ // BLOCKS: ret
+
+ // BLOCKS: store double* %{{.+}}, double** %{{.+}},
+ // BLOCKS: store i{{[0-9]+}}* %{{.+}}, i{{[0-9]+}}** %{{.+}},
+ // BLOCKS: define internal i32 [[TASK_ENTRY]](i32 %0, %{{.+}}* noalias %1)
+ g = 1;
+ sivar = 11;
+ // BLOCKS: store double 1.0{{.+}}, double* %{{.+}},
+ // BLOCKS-NOT: [[G]]{{[[^:word:]]}}
+ // BLOCKS: store i{{[0-9]+}} 11, i{{[0-9]+}}* %{{.+}},
+ // BLOCKS-NOT: [[SIVAR]]{{[[^:word:]]}}
+ // BLOCKS: call void {{%.+}}(i8
+ ^{
+ g = 2;
+ sivar = 22;
+ }();
+ }
+ }();
+ return 0;
+#else
+ S<double> ttt;
+ S<double> test(ttt);
+ int t_var = 0;
+ int vec[] = {1, 2};
+ S<double> s_arr[] = {1, 2};
+ S<double> var(3);
+#pragma omp master taskloop simd firstprivate(var, t_var, s_arr, vec, s_arr, var, sivar)
+ for (int i = 0; i < 10; ++i) {
+ vec[0] = t_var;
+ s_arr[0] = var;
+ sivar = 33;
+ }
+ return tmain<int>();
+#endif
+}
+
+// CHECK: [[SIVAR:.+]] = internal global i{{[0-9]+}} 0,
+// CHECK: define i{{[0-9]+}} @main()
+// CHECK: alloca [[S_DOUBLE_TY]],
+// CHECK: [[TEST:%.+]] = alloca [[S_DOUBLE_TY]],
+// CHECK: [[T_VAR_ADDR:%.+]] = alloca i32,
+// CHECK: [[VEC_ADDR:%.+]] = alloca [2 x i32],
+// CHECK: [[S_ARR_ADDR:%.+]] = alloca [2 x [[S_DOUBLE_TY]]],
+// CHECK: [[VAR_ADDR:%.+]] = alloca [[S_DOUBLE_TY]],
+// CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num([[LOC:%.+]])
+
+// CHECK: call {{.*}} [[S_DOUBLE_TY_COPY_CONSTR:@.+]]([[S_DOUBLE_TY]]* [[TEST]],
+
+// Store original variables in capture struct.
+// CHECK: [[VEC_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: store [2 x i32]* [[VEC_ADDR]], [2 x i32]** [[VEC_REF]],
+// CHECK: [[T_VAR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 1
+// CHECK: [[T_VAR_VAL:%.+]] = load i32, i32* [[T_VAR_ADDR]],
+// CHECK: store i32 [[T_VAR_VAL]], i32* [[T_VAR_REF]],
+// CHECK: [[S_ARR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 3
+// CHECK: store [2 x [[S_DOUBLE_TY]]]* [[S_ARR_ADDR]], [2 x [[S_DOUBLE_TY]]]** [[S_ARR_REF]],
+// CHECK: [[VAR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 4
+// CHECK: store [[S_DOUBLE_TY]]* [[VAR_ADDR]], [[S_DOUBLE_TY]]** [[VAR_REF]],
+// CHECK: [[SIVAR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 5
+// CHECK: [[SIVAR_VAL:%.+]] = load i32, i32* [[SIVAR]],
+// CHECK: store i{{[0-9]+}} [[SIVAR_VAL]], i{{[0-9]+}}* [[SIVAR_REF]],
+
+// Allocate task.
+// Returns struct kmp_task_t {
+// [[KMP_TASK_T]] task_data;
+// [[KMP_TASK_MAIN_TY]] privates;
+// };
+// CHECK: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc([[LOC]], i32 [[GTID]], i32 9, i64 120, i64 40, i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_MAIN_TY]]*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+// CHECK: [[RES_KMP_TASK:%.+]] = bitcast i8* [[RES]] to [[KMP_TASK_MAIN_TY]]*
+
+// Fill kmp_task_t->shareds by copying from original capture argument.
+// CHECK: [[TASK:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: [[SHAREDS_REF_ADDR:%.+]] = getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* [[TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: [[SHAREDS_REF:%.+]] = load i8*, i8** [[SHAREDS_REF_ADDR]],
+// CHECK: [[CAPTURES_ADDR:%.+]] = bitcast [[CAP_MAIN_TY]]* %{{.+}} to i8*
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 [[SHAREDS_REF]], i8* align 8 [[CAPTURES_ADDR]], i64 40, i1 false)
+
+// Initialize kmp_task_t->privates with default values (no init for simple types, default constructors for classes).
+// Also copy address of private copy to the corresponding shareds reference.
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
+// CHECK: [[SHAREDS:%.+]] = bitcast i8* [[SHAREDS_REF]] to [[CAP_MAIN_TY]]*
+
+// Constructors for s_arr and var.
+// s_arr;
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: [[S_ARR_ADDR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* [[SHAREDS]], i{{.+}} 0, i{{.+}} 3
+// CHECK: load [2 x [[S_DOUBLE_TY]]]*, [2 x [[S_DOUBLE_TY]]]** [[S_ARR_ADDR_REF]],
+// CHECK: call void [[S_DOUBLE_TY_COPY_CONSTR]]([[S_DOUBLE_TY]]* [[S_ARR_CUR:%[^,]+]],
+// CHECK: getelementptr [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* [[S_ARR_CUR]], i{{.+}} 1
+// CHECK: getelementptr [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i{{.+}} 1
+// CHECK: icmp eq
+// CHECK: br i1
+
+// var;
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
+// CHECK: [[VAR_ADDR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* [[SHAREDS]], i{{.+}} 0, i{{.+}} 4
+// CHECK: [[VAR_REF:%.+]] = load [[S_DOUBLE_TY]]*, [[S_DOUBLE_TY]]** [[VAR_ADDR_REF]],
+// CHECK: call void [[S_DOUBLE_TY_COPY_CONSTR]]([[S_DOUBLE_TY]]* [[PRIVATE_VAR_REF]], [[S_DOUBLE_TY]]* {{.*}}[[VAR_REF]],
+
+// t_var;
+// CHECK: [[PRIVATE_T_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK: [[T_VAR_ADDR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* [[SHAREDS]], i{{.+}} 0, i{{.+}} 1
+// CHECK: [[T_VAR:%.+]] = load i{{.+}}, i{{.+}}* [[T_VAR_ADDR_REF]],
+// CHECK: store i32 [[T_VAR]], i32* [[PRIVATE_T_VAR_REF]],
+
+// vec;
+// CHECK: [[PRIVATE_VEC_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: [[VEC_ADDR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* [[SHAREDS]], i{{.+}} 0, i{{.+}} 0
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(
+
+// sivar;
+// CHECK: [[PRIVATE_SIVAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 4
+// CHECK: [[SIVAR_ADDR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* [[SHAREDS]], i{{.+}} 0, i{{.+}} 5
+// CHECK: [[SIVAR:%.+]] = load i{{.+}}, i{{.+}}* [[SIVAR_ADDR_REF]],
+// CHECK: store i32 [[SIVAR]], i32* [[PRIVATE_SIVAR_REF]],
+
+// Provide pointer to destructor function, which will destroy private variables at the end of the task.
+// CHECK: [[DESTRUCTORS_REF:%.+]] = getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* [[TASK]], i{{.+}} 0, i{{.+}} 3
+// CHECK: [[DESTRUCTORS_PTR:%.+]] = bitcast %union{{.+}}* [[DESTRUCTORS_REF]] to i32 (i32, i8*)**
+// CHECK: store i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_MAIN_TY]]*)* [[DESTRUCTORS:@.+]] to i32 (i32, i8*)*), i32 (i32, i8*)** [[DESTRUCTORS_PTR]],
+
+// Start task.
+// CHECK: call void @__kmpc_taskloop([[LOC]], i32 [[GTID]], i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* bitcast (void ([[KMP_TASK_MAIN_TY]]*, [[KMP_TASK_MAIN_TY]]*, i32)* [[MAIN_DUP:@.+]] to i8*))
+
+// CHECK: = call i{{.+}} [[TMAIN_INT:@.+]]()
+
+// No destructors must be called for private copies of s_arr and var.
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: call void [[S_DOUBLE_TY_DESTR:@.+]]([[S_DOUBLE_TY]]*
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: ret
+//
+
+// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_MAIN_TY]]* noalias %0, [[S_DOUBLE_TY]]** noalias %1, i32** noalias %2, [2 x [[S_DOUBLE_TY]]]** noalias %3, [2 x i32]** noalias %4, i32** noalias %5)
+// CHECK: [[PRIVATES:%.+]] = load [[PRIVATES_MAIN_TY]]*, [[PRIVATES_MAIN_TY]]**
+// CHECK: [[PRIV_S_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 0
+// CHECK: [[ARG3:%.+]] = load [2 x [[S_DOUBLE_TY]]]**, [2 x [[S_DOUBLE_TY]]]*** %{{.+}},
+// CHECK: store [2 x [[S_DOUBLE_TY]]]* [[PRIV_S_VAR]], [2 x [[S_DOUBLE_TY]]]** [[ARG3]],
+// CHECK: [[PRIV_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 1
+// CHECK: [[ARG1:%.+]] = load [[S_DOUBLE_TY]]**, [[S_DOUBLE_TY]]*** {{.+}},
+// CHECK: store [[S_DOUBLE_TY]]* [[PRIV_VAR]], [[S_DOUBLE_TY]]** [[ARG1]],
+// CHECK: [[PRIV_T_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 2
+// CHECK: [[ARG2:%.+]] = load i32**, i32*** %{{.+}},
+// CHECK: store i32* [[PRIV_T_VAR]], i32** [[ARG2]],
+// CHECK: [[PRIV_VEC:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 3
+// CHECK: [[ARG4:%.+]] = load [2 x i32]**, [2 x i32]*** %{{.+}},
+// CHECK: store [2 x i32]* [[PRIV_VEC]], [2 x i32]** [[ARG4]],
+// CHECK: [[PRIV_SIVAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 4
+// CHECK: [[ARG5:%.+]] = load i{{[0-9]+}}**, i{{[0-9]+}}*** %{{.+}},
+// CHECK: store i{{[0-9]+}}* [[PRIV_SIVAR]], i{{[0-9]+}}** [[ARG5]],
+// CHECK: ret void
+
+// CHECK: define internal i32 [[TASK_ENTRY]](i32 %0, [[KMP_TASK_MAIN_TY]]* noalias %1)
+
+// CHECK: [[PRIV_VAR_ADDR:%.+]] = alloca [[S_DOUBLE_TY]]*,
+// CHECK: [[PRIV_T_VAR_ADDR:%.+]] = alloca i32*,
+// CHECK: [[PRIV_S_ARR_ADDR:%.+]] = alloca [2 x [[S_DOUBLE_TY]]]*,
+// CHECK: [[PRIV_VEC_ADDR:%.+]] = alloca [2 x i32]*,
+// CHECK: [[PRIV_SIVAR_ADDR:%.+]] = alloca i32*,
+// CHECK: store void (i8*, ...)* bitcast (void ([[PRIVATES_MAIN_TY]]*, [[S_DOUBLE_TY]]**, i32**, [2 x [[S_DOUBLE_TY]]]**, [2 x i32]**, i32**)* [[PRIVATES_MAP_FN]] to void (i8*, ...)*), void (i8*, ...)** [[MAP_FN_ADDR:%.+]],
+// CHECK: [[MAP_FN:%.+]] = load void (i8*, ...)*, void (i8*, ...)** [[MAP_FN_ADDR]],
+
+// CHECK: call void (i8*, ...) [[MAP_FN]](i8* %{{.+}}, [[S_DOUBLE_TY]]** [[PRIV_VAR_ADDR]], i32** [[PRIV_T_VAR_ADDR]], [2 x [[S_DOUBLE_TY]]]** [[PRIV_S_ARR_ADDR]], [2 x i32]** [[PRIV_VEC_ADDR]], i32** [[PRIV_SIVAR_ADDR]])
+
+// CHECK: [[PRIV_VAR:%.+]] = load [[S_DOUBLE_TY]]*, [[S_DOUBLE_TY]]** [[PRIV_VAR_ADDR]],
+// CHECK: [[PRIV_T_VAR:%.+]] = load i32*, i32** [[PRIV_T_VAR_ADDR]],
+// CHECK: [[PRIV_S_ARR:%.+]] = load [2 x [[S_DOUBLE_TY]]]*, [2 x [[S_DOUBLE_TY]]]** [[PRIV_S_ARR_ADDR]],
+// CHECK: [[PRIV_VEC:%.+]] = load [2 x i32]*, [2 x i32]** [[PRIV_VEC_ADDR]],
+// CHECK: [[PRIV_SIVAR:%.+]] = load i32*, i32** [[PRIV_SIVAR_ADDR]],
+
+// Privates actually are used.
+// CHECK-DAG: [[PRIV_VAR]]
+// CHECK-DAG: [[PRIV_T_VAR]]
+// CHECK-DAG: [[PRIV_S_ARR]]
+// CHECK-DAG: [[PRIV_VEC]]
+// CHECK-DAG: [[PRIV_SIVAR]]
+
+// CHECK: ret
+
+// CHECK: define internal void [[MAIN_DUP]]([[KMP_TASK_MAIN_TY]]* %0, [[KMP_TASK_MAIN_TY]]* %1, i32 %2)
+// CHECK: getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* %{{.+}}, i32 0, i32 1
+// CHECK: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr inbounds [2 x [[S_DOUBLE_TY]]], [2 x [[S_DOUBLE_TY]]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i64 2
+// CHECK: br i1 %
+
+// CHECK: phi [[S_DOUBLE_TY]]*
+// CHECK: call {{.*}} [[S_DOUBLE_TY_COPY_CONSTR]]([[S_DOUBLE_TY]]*
+// CHECK: getelementptr [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i32 1
+// CHECK: icmp eq [[S_DOUBLE_TY]]* %
+// CHECK: br i1 %
+
+// CHECK: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* %{{.+}}, i32 0, i32 1
+// CHECK: call {{.*}} [[S_DOUBLE_TY_COPY_CONSTR]]([[S_DOUBLE_TY]]*
+// CHECK: ret void
+
+// CHECK: define internal i32 [[DESTRUCTORS]](i32 %0, [[KMP_TASK_MAIN_TY]]* noalias %1)
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 0
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
+// CHECK: call void [[S_DOUBLE_TY_DESTR]]([[S_DOUBLE_TY]]* [[PRIVATE_VAR_REF]])
+// CHECK: getelementptr inbounds [2 x [[S_DOUBLE_TY]]], [2 x [[S_DOUBLE_TY]]]* [[PRIVATE_S_ARR_REF]], i{{.+}} 0, i{{.+}} 0
+// CHECK: getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i{{.+}} 2
+// CHECK: [[PRIVATE_S_ARR_ELEM_REF:%.+]] = getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i{{.+}} -1
+// CHECK: call void [[S_DOUBLE_TY_DESTR]]([[S_DOUBLE_TY]]* [[PRIVATE_S_ARR_ELEM_REF]])
+// CHECK: icmp eq
+// CHECK: br i1
+// CHECK: ret i32
+
+// CHECK: define {{.*}} i{{[0-9]+}} [[TMAIN_INT]]()
+// CHECK: alloca [[S_INT_TY]],
+// CHECK: [[TEST:%.+]] = alloca [[S_INT_TY]],
+// CHECK: [[T_VAR_ADDR:%.+]] = alloca i32, align 128
+// CHECK: [[VEC_ADDR:%.+]] = alloca [2 x i32],
+// CHECK: [[S_ARR_ADDR:%.+]] = alloca [2 x [[S_INT_TY]]],
+// CHECK: [[VAR_ADDR:%.+]] = alloca [[S_INT_TY]],
+// CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num([[LOC:%.+]])
+
+// CHECK: call {{.*}} [[S_INT_TY_COPY_CONSTR:@.+]]([[S_INT_TY]]* [[TEST]],
+
+// Store original variables in capture struct.
+// CHECK: [[VEC_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: store [2 x i32]* [[VEC_ADDR]], [2 x i32]** [[VEC_REF]],
+// CHECK: [[T_VAR_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 1
+// CHECK: store i32* [[T_VAR_ADDR]], i32** [[T_VAR_REF]],
+// CHECK: [[S_ARR_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 2
+// CHECK: store [2 x [[S_INT_TY]]]* [[S_ARR_ADDR]], [2 x [[S_INT_TY]]]** [[S_ARR_REF]],
+// CHECK: [[VAR_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 3
+// CHECK: store [[S_INT_TY]]* [[VAR_ADDR]], [[S_INT_TY]]** [[VAR_REF]],
+
+// Allocate task.
+// Returns struct kmp_task_t {
+// [[KMP_TASK_T_TY]] task_data;
+// [[KMP_TASK_TMAIN_TY]] privates;
+// };
+// CHECK: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc([[LOC]], i32 [[GTID]], i32 9, i64 256, i64 32, i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_TMAIN_TY]]*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+// CHECK: [[RES_KMP_TASK:%.+]] = bitcast i8* [[RES]] to [[KMP_TASK_TMAIN_TY]]*
+
+// Fill kmp_task_t->shareds by copying from original capture argument.
+// CHECK: [[TASK:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: [[SHAREDS_REF_ADDR:%.+]] = getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* [[TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: [[SHAREDS_REF:%.+]] = load i8*, i8** [[SHAREDS_REF_ADDR]],
+// CHECK: [[CAPTURES_ADDR:%.+]] = bitcast [[CAP_TMAIN_TY]]* %{{.+}} to i8*
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 [[SHAREDS_REF]], i8* align 8 [[CAPTURES_ADDR]], i64 32, i1 false)
+
+// Initialize kmp_task_t->privates with default values (no init for simple types, default constructors for classes).
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
+// CHECK: [[SHAREDS:%.+]] = bitcast i8* [[SHAREDS_REF]] to [[CAP_TMAIN_TY]]*
+
+// t_var;
+// CHECK: [[PRIVATE_T_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 0
+// CHECK: [[T_VAR_ADDR_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* [[SHAREDS]], i{{.+}} 0, i{{.+}} 1
+// CHECK: [[T_VAR_REF:%.+]] = load i{{.+}}*, i{{.+}}** [[T_VAR_ADDR_REF]],
+// CHECK: [[T_VAR:%.+]] = load i{{.+}}, i{{.+}}* [[T_VAR_REF]], align 128
+// CHECK: store i32 [[T_VAR]], i32* [[PRIVATE_T_VAR_REF]], align 128
+
+// vec;
+// CHECK: [[PRIVATE_VEC_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
+// CHECK: [[VEC_ADDR_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* [[SHAREDS]], i{{.+}} 0, i{{.+}} 0
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(
+
+// Constructors for s_arr and var.
+// a_arr;
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
+// CHECK: [[S_ARR_ADDR_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* [[SHAREDS]], i{{.+}} 0, i{{.+}} 2
+// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* [[PRIVATE_S_ARR_REF]], i{{.+}} 0, i{{.+}} 0
+// CHECK: getelementptr [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i{{.+}} 2
+// CHECK: call void [[S_INT_TY_COPY_CONSTR]]([[S_INT_TY]]* [[S_ARR_CUR:%[^,]+]],
+// CHECK: getelementptr [[S_INT_TY]], [[S_INT_TY]]* [[S_ARR_CUR]], i{{.+}} 1
+// CHECK: icmp eq
+// CHECK: br i1
+
+// var;
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: [[VAR_ADDR_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* [[SHAREDS]], i{{.+}} 0, i{{.+}} 3
+// CHECK: call void [[S_INT_TY_COPY_CONSTR]]([[S_INT_TY]]* [[PRIVATE_VAR_REF]],
+
+// Provide pointer to destructor function, which will destroy private variables at the end of the task.
+// CHECK: [[DESTRUCTORS_REF:%.+]] = getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* [[TASK]], i{{.+}} 0, i{{.+}} 3
+// CHECK: [[DESTRUCTORS_PTR:%.+]] = bitcast %union{{.+}}* [[DESTRUCTORS_REF]] to i32 (i32, i8*)**
+// CHECK: store i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_TMAIN_TY]]*)* [[DESTRUCTORS:@.+]] to i32 (i32, i8*)*), i32 (i32, i8*)** [[DESTRUCTORS_PTR]],
+
+// Start task.
+// CHECK: call void @__kmpc_taskloop([[LOC]], i32 [[GTID]], i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* bitcast (void ([[KMP_TASK_TMAIN_TY]]*, [[KMP_TASK_TMAIN_TY]]*, i32)* [[TMAIN_DUP:@.+]] to i8*))
+
+// No destructors must be called for private copies of s_arr and var.
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: call void [[S_INT_TY_DESTR:@.+]]([[S_INT_TY]]*
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: ret
+//
+
+// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_TMAIN_TY]]* noalias %0, i32** noalias %1, [2 x i32]** noalias %2, [2 x [[S_INT_TY]]]** noalias %3, [[S_INT_TY]]** noalias %4)
+// CHECK: [[PRIVATES:%.+]] = load [[PRIVATES_TMAIN_TY]]*, [[PRIVATES_TMAIN_TY]]**
+// CHECK: [[PRIV_T_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 0
+// CHECK: [[ARG1:%.+]] = load i32**, i32*** %{{.+}},
+// CHECK: store i32* [[PRIV_T_VAR]], i32** [[ARG1]],
+// CHECK: [[PRIV_VEC:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 1
+// CHECK: [[ARG2:%.+]] = load [2 x i32]**, [2 x i32]*** %{{.+}},
+// CHECK: store [2 x i32]* [[PRIV_VEC]], [2 x i32]** [[ARG2]],
+// CHECK: [[PRIV_S_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 2
+// CHECK: [[ARG3:%.+]] = load [2 x [[S_INT_TY]]]**, [2 x [[S_INT_TY]]]*** %{{.+}},
+// CHECK: store [2 x [[S_INT_TY]]]* [[PRIV_S_VAR]], [2 x [[S_INT_TY]]]** [[ARG3]],
+// CHECK: [[PRIV_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 3
+// CHECK: [[ARG4:%.+]] = load [[S_INT_TY]]**, [[S_INT_TY]]*** {{.+}},
+// CHECK: store [[S_INT_TY]]* [[PRIV_VAR]], [[S_INT_TY]]** [[ARG4]],
+// CHECK: ret void
+
+// CHECK: define internal i32 [[TASK_ENTRY]](i32 %0, [[KMP_TASK_TMAIN_TY]]* noalias %1)
+// CHECK: alloca i32*,
+// CHECK-DAG: [[PRIV_T_VAR_ADDR:%.+]] = alloca i32*,
+// CHECK-DAG: [[PRIV_VEC_ADDR:%.+]] = alloca [2 x i32]*,
+// CHECK-DAG: [[PRIV_S_ARR_ADDR:%.+]] = alloca [2 x [[S_INT_TY]]]*,
+// CHECK-DAG: [[PRIV_VAR_ADDR:%.+]] = alloca [[S_INT_TY]]*,
+// CHECK: store void (i8*, ...)* bitcast (void ([[PRIVATES_TMAIN_TY]]*, i32**, [2 x i32]**, [2 x [[S_INT_TY]]]**, [[S_INT_TY]]**)* [[PRIVATES_MAP_FN]] to void (i8*, ...)*), void (i8*, ...)** [[MAP_FN_ADDR:%.+]],
+// CHECK: [[MAP_FN:%.+]] = load void (i8*, ...)*, void (i8*, ...)** [[MAP_FN_ADDR]],
+// CHECK: call void (i8*, ...) [[MAP_FN]](i8* %{{.+}}, i32** [[PRIV_T_VAR_ADDR]], [2 x i32]** [[PRIV_VEC_ADDR]], [2 x [[S_INT_TY]]]** [[PRIV_S_ARR_ADDR]], [[S_INT_TY]]** [[PRIV_VAR_ADDR]])
+// CHECK: [[PRIV_T_VAR:%.+]] = load i32*, i32** [[PRIV_T_VAR_ADDR]],
+// CHECK: [[PRIV_VEC:%.+]] = load [2 x i32]*, [2 x i32]** [[PRIV_VEC_ADDR]],
+// CHECK: [[PRIV_S_ARR:%.+]] = load [2 x [[S_INT_TY]]]*, [2 x [[S_INT_TY]]]** [[PRIV_S_ARR_ADDR]],
+// CHECK: [[PRIV_VAR:%.+]] = load [[S_INT_TY]]*, [[S_INT_TY]]** [[PRIV_VAR_ADDR]],
+
+// Privates actually are used.
+// CHECK-DAG: [[PRIV_VAR]]
+// CHECK-DAG: [[PRIV_T_VAR]]
+// CHECK-DAG: [[PRIV_S_ARR]]
+// CHECK-DAG: [[PRIV_VEC]]
+
+// CHECK: ret
+
+// CHECK: define internal void [[TMAIN_DUP]]([[KMP_TASK_TMAIN_TY]]* %0, [[KMP_TASK_TMAIN_TY]]* %1, i32 %2)
+// CHECK: getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* %{{.+}}, i32 0, i32 2
+// CHECK: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* %{{.+}}, i32 0, i32 2
+// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i64 2
+// CHECK: br i1 %
+
+// CHECK: phi [[S_INT_TY]]*
+// CHECK: call {{.*}} [[S_INT_TY_COPY_CONSTR]]([[S_INT_TY]]*
+// CHECK: getelementptr [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i32 1
+// CHECK: icmp eq [[S_INT_TY]]* %
+// CHECK: br i1 %
+
+// CHECK: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* %{{.+}}, i32 0, i32 3
+// CHECK: call {{.*}} [[S_INT_TY_COPY_CONSTR]]([[S_INT_TY]]*
+// CHECK: ret void
+
+// CHECK: define internal i32 [[DESTRUCTORS]](i32 %0, [[KMP_TASK_TMAIN_TY]]* noalias %1)
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: call void [[S_INT_TY_DESTR]]([[S_INT_TY]]* [[PRIVATE_VAR_REF]])
+// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* [[PRIVATE_S_ARR_REF]], i{{.+}} 0, i{{.+}} 0
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i{{.+}} 2
+// CHECK: [[PRIVATE_S_ARR_ELEM_REF:%.+]] = getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i{{.+}} -1
+// CHECK: call void [[S_INT_TY_DESTR]]([[S_INT_TY]]* [[PRIVATE_S_ARR_ELEM_REF]])
+// CHECK: icmp eq
+// CHECK: br i1
+// CHECK: ret i32
+
+#endif
+#else
+// ARRAY-LABEL: array_func
+struct St {
+ int a, b;
+ St() : a(0), b(0) {}
+ St(const St &) {}
+ ~St() {}
+};
+
+void array_func(int n, float a[n], St s[2]) {
+// ARRAY: call i8* @__kmpc_omp_task_alloc(
+// ARRAY: call void @__kmpc_taskloop(
+// ARRAY: store float** %{{.+}}, float*** %{{.+}},
+// ARRAY: store %struct.St** %{{.+}}, %struct.St*** %{{.+}},
+#pragma omp master taskloop simd firstprivate(a, s)
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+#endif
+
diff --git a/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_firstprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_firstprivate_messages.cpp
new file mode 100644
index 0000000..e756578
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_firstprivate_messages.cpp
@@ -0,0 +1,335 @@
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+
+typedef void **omp_allocator_handle_t;
+extern const omp_allocator_handle_t omp_default_mem_alloc;
+extern const omp_allocator_handle_t omp_large_cap_mem_alloc;
+extern const omp_allocator_handle_t omp_const_mem_alloc;
+extern const omp_allocator_handle_t omp_high_bw_mem_alloc;
+extern const omp_allocator_handle_t omp_low_lat_mem_alloc;
+extern const omp_allocator_handle_t omp_cgroup_mem_alloc;
+extern const omp_allocator_handle_t omp_pteam_mem_alloc;
+extern const omp_allocator_handle_t omp_thread_mem_alloc;
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp master taskloop simd firstprivate(fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
+struct S1; // expected-note 2 {{declared here}} expected-note 2 {{forward declaration of 'S1'}}
+extern S1 a;
+class S2 {
+ mutable int a;
+
+public:
+ S2() : a(0) {}
+ S2(const 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;
+ S3 &operator=(const S3 &s3);
+
+public:
+ S3() : a(0) {} // expected-note 2 {{candidate constructor not viable: requires 0 arguments, but 1 was provided}}
+ S3(S3 &s3) : a(s3.a) {} // expected-note 2 {{candidate constructor not viable: 1st argument ('const S3') would lose const qualifier}}
+};
+const S3 c;
+const S3 ca[5];
+extern const int f;
+class S4 {
+ int a;
+ S4();
+ S4(const S4 &s4); // expected-note 2 {{implicitly declared private here}}
+
+public:
+ S4(int v) : a(v) {}
+};
+class S5 {
+ int a;
+ S5(const S5 &s5) : a(s5.a) {} // expected-note 4 {{implicitly declared private here}}
+
+public:
+ S5() : a(0) {}
+ S5(int v) : a(v) {}
+};
+class S6 {
+ int a;
+ S6() : a(0) {}
+
+public:
+ S6(const S6 &s6) : a(s6.a) {}
+ S6(int v) : a(v) {}
+};
+
+S3 h;
+#pragma omp threadprivate(h) // expected-note 2 {{defined as threadprivate or thread local}}
+
+template <class I, class C>
+int foomain(int argc, char **argv) {
+ I e(4);
+ C g(5);
+ int i, z;
+ int &j = i;
+#pragma omp parallel
+#pragma omp master taskloop simd firstprivate // expected-error {{expected '(' after 'firstprivate'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop simd firstprivate( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop simd firstprivate() // expected-error {{expected expression}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop simd firstprivate(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop simd firstprivate(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop simd firstprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop simd firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop simd firstprivate(S1) // expected-error {{'S1' does not refer to a value}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop simd firstprivate(a, b) // expected-error {{firstprivate variable with incomplete type 'S1'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop simd firstprivate(z, argv[1]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop simd firstprivate(e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop simd firstprivate(h) // expected-error {{threadprivate or thread local variable cannot be firstprivate}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+ {
+ int v = 0;
+ int i;
+#pragma omp master taskloop simd allocate(omp_thread_mem_alloc: i) firstprivate(i) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'master taskloop simd' directive}}
+ for (int k = 0; k < argc; ++k) {
+ i = k;
+ v += i;
+ }
+ }
+#pragma omp parallel shared(i)
+#pragma omp parallel private(i)
+#pragma omp master taskloop simd firstprivate(j)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop simd firstprivate(i)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(g) firstprivate(g) // expected-error {{calling a private constructor of class 'S5'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel private(i)
+#pragma omp master taskloop simd firstprivate(i) // expected-note 2 {{defined as firstprivate}}
+ for (i = 0; i < argc; ++i) // expected-error 2 {{loop iteration variable in the associated loop of 'omp master taskloop simd' directive may not be firstprivate, predetermined as linear}}
+ foo();
+#pragma omp parallel reduction(+ : i) // expected-note {{defined as reduction}}
+#pragma omp master taskloop simd firstprivate(i) // expected-note {{defined as firstprivate}} expected-error {{argument of a reduction clause of a parallel construct must not appear in a firstprivate clause on a task construct}}
+ for (i = 0; i < argc; ++i) // expected-error {{loop iteration variable in the associated loop of 'omp master taskloop simd' directive may not be firstprivate, predetermined as linear}}
+ foo();
+ return 0;
+}
+
+void bar(S4 a[2]) {
+#pragma omp parallel
+#pragma omp master taskloop simd firstprivate(a)
+ for (int i = 0; i < 2; ++i)
+ foo();
+}
+
+namespace A {
+double x;
+#pragma omp threadprivate(x) // expected-note {{defined as threadprivate or thread local}}
+}
+namespace B {
+using A::x;
+}
+
+int main(int argc, char **argv) {
+ const int d = 5;
+ const int da[5] = {0};
+ S4 e(4);
+ S5 g(5);
+ S3 m;
+ S6 n(2);
+ int i, z;
+ int &j = i;
+#pragma omp parallel
+#pragma omp master taskloop simd firstprivate // expected-error {{expected '(' after 'firstprivate'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd firstprivate( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd firstprivate() // expected-error {{expected expression}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd firstprivate(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd firstprivate(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd firstprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd firstprivate(argc, z)
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd firstprivate(S1) // expected-error {{'S1' does not refer to a value}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd firstprivate(a, b, c, d, f) // expected-error {{firstprivate variable with incomplete type 'S1'}} expected-error {{no matching constructor for initialization of 'S3'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd firstprivate(argv[1]) // expected-error {{expected variable name}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd firstprivate(2 * 2) // expected-error {{expected variable name}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd firstprivate(ba) // OK
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd firstprivate(ca) // expected-error {{no matching constructor for initialization of 'S3'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd firstprivate(da) // OK
+ for (i = 0; i < argc; ++i)
+ foo();
+ int xa;
+#pragma omp parallel
+#pragma omp master taskloop simd firstprivate(xa) // OK
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd firstprivate(S2::S2s) // OK
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd firstprivate(S2::S2sc) // OK
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd safelen(5)
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd firstprivate(e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd firstprivate(m) // OK
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd firstprivate(h) // expected-error {{threadprivate or thread local variable cannot be firstprivate}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd private(xa), firstprivate(xa) // expected-error {{private variable cannot be firstprivate}} expected-note {{defined as private}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd firstprivate(i) // expected-note {{defined as firstprivate}}
+ for (i = 0; i < argc; ++i) // expected-error {{loop iteration variable in the associated loop of 'omp master taskloop simd' directive may not be firstprivate, predetermined as linear}}
+ foo();
+#pragma omp parallel shared(xa)
+#pragma omp master taskloop simd firstprivate(xa) // OK: may be firstprivate
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd firstprivate(j)
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(g) firstprivate(g) // expected-error {{calling a private constructor of class 'S5'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(n) firstprivate(n) // OK
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+ {
+ int v = 0;
+ int i;
+#pragma omp master taskloop simd firstprivate(i)
+ for (int k = 0; k < argc; ++k) {
+ i = k;
+ v += i;
+ }
+ }
+#pragma omp parallel private(i)
+#pragma omp master taskloop simd firstprivate(i) // expected-note {{defined as firstprivate}}
+ for (i = 0; i < argc; ++i) // expected-error {{loop iteration variable in the associated loop of 'omp master taskloop simd' directive may not be firstprivate, predetermined as linear}}
+ foo();
+#pragma omp parallel reduction(+ : i) // expected-note {{defined as reduction}}
+#pragma omp master taskloop simd firstprivate(i) // expected-error {{argument of a reduction clause of a parallel construct must not appear in a firstprivate clause on a task construct}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp master taskloop simd firstprivate(i) //expected-note {{defined as firstprivate}}
+ for (i = 0; i < argc; ++i) // expected-error {{loop iteration variable in the associated loop of 'omp master taskloop simd' directive may not be firstprivate, predetermined as linear}}
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd firstprivate(B::x) // expected-error {{threadprivate or thread local variable cannot be firstprivate}}
+ for (i = 0; i < argc; ++i)
+ foo();
+ static int si;
+#pragma omp master taskloop simd firstprivate(si) // OK
+ for (i = 0; i < argc; ++i)
+ si = i + 1;
+
+ return foomain<S4, S5>(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<S4, S5>' requested here}}
+}
+
diff --git a/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_grainsize_messages.cpp b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_grainsize_messages.cpp
new file mode 100644
index 0000000..f258ee8
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_grainsize_messages.cpp
@@ -0,0 +1,103 @@
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+struct S1; // expected-note {{declared here}}
+
+template <class T, class S> // expected-note {{declared here}}
+int tmain(T argc, S **argv) {
+ T z;
+ #pragma omp master taskloop simd grainsize // expected-error {{expected '(' after 'grainsize'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd grainsize ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd grainsize () // expected-error {{expected expression}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd grainsize (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd grainsize (z + argc)) // expected-warning {{extra tokens at the end of '#pragma omp master taskloop simd' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd grainsize (argc > 0 ? argv[1][0] : argv[2][argc])
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd grainsize (foobool(argc)), grainsize (true) // expected-error {{directive '#pragma omp master taskloop simd' cannot contain more than one 'grainsize' clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd grainsize (S) // expected-error {{'S' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd grainsize (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd grainsize(0) // expected-error {{argument to 'grainsize' clause must be a strictly positive integer value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd grainsize(-1) // expected-error {{argument to 'grainsize' clause must be a strictly positive integer value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd grainsize(argc) num_tasks(argc) // expected-error {{'num_tasks' and 'grainsize' clause are mutually exclusive and may not appear on the same directive}} expected-note {{'grainsize' clause is specified here}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+
+ return 0;
+}
+
+int main(int argc, char **argv) {
+ int z;
+ #pragma omp master taskloop simd grainsize // expected-error {{expected '(' after 'grainsize'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd grainsize ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd grainsize () // expected-error {{expected expression}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd grainsize (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd grainsize (argc+z)) // expected-warning {{extra tokens at the end of '#pragma omp master taskloop simd' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd grainsize (argc > 0 ? argv[1][0] : argv[2][argc])
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd grainsize (foobool(argc)), grainsize (true) // expected-error {{directive '#pragma omp master taskloop simd' cannot contain more than one 'grainsize' clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd grainsize (S1) // expected-error {{'S1' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd grainsize (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd grainsize (1 0) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd grainsize(if(tmain(argc, argv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd grainsize(0) // expected-error {{argument to 'grainsize' clause must be a strictly positive integer value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd grainsize(-1) // expected-error {{argument to 'grainsize' clause must be a strictly positive integer value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd grainsize(argc) num_tasks(argc) // expected-error {{'num_tasks' and 'grainsize' clause are mutually exclusive and may not appear on the same directive}} expected-note {{'grainsize' clause is specified here}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+
+ return tmain(argc, argv);
+}
diff --git a/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_in_reduction_codegen.cpp b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_in_reduction_codegen.cpp
new file mode 100644
index 0000000..f36a342
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_in_reduction_codegen.cpp
@@ -0,0 +1,87 @@
+// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp -x c++ -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-apple-darwin10 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
+
+// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp-simd -x c++ -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
+// expected-no-diagnostics
+#ifndef HEADER
+#define HEADER
+
+// CHECK: [[PRIVATES:%.+]] = type { i8*, i8* }
+
+struct S {
+ int a;
+ S() : a(0) {}
+ S(const S&) {}
+ S& operator=(const S&) {return *this;}
+ ~S() {}
+ friend S operator+(const S&a, const S&b) {return a;}
+};
+
+
+int main(int argc, char **argv) {
+ int a;
+ float b;
+ S c[5];
+ short d[argc];
+#pragma omp taskgroup task_reduction(+: a, b, argc)
+ {
+#pragma omp taskgroup task_reduction(-:c, d)
+#pragma omp parallel
+#pragma omp master taskloop simd in_reduction(+:a) in_reduction(-:d)
+ for (int i = 0; i < 5; ++i)
+ a += d[a];
+ }
+ return 0;
+}
+
+// CHECK-LABEL: @main
+// CHECK: void @__kmpc_taskgroup(%struct.ident_t* @0, i32 [[GTID:%.+]])
+// CHECK: [[TD1:%.+]] = call i8* @__kmpc_task_reduction_init(i32 [[GTID]], i32 3, i8* %
+// CHECK-NEXT: store i8* [[TD1]], i8** [[TD1_ADDR:%[^,]+]],
+// CHECK-NEXT: call void @__kmpc_taskgroup(%struct.ident_t* @0, i32 [[GTID]])
+// CHECK: [[TD2:%.+]] = call i8* @__kmpc_task_reduction_init(i32 [[GTID]], i32 2, i8* %
+// CHECK-NEXT: store i8* [[TD2]], i8** [[TD2_ADDR:%[^,]+]],
+// CHECK-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @0, i32 5, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32*, i64, i16*, i8**, i8**)* [[OMP_PARALLEL:@.+]] to void (i32*, i32*, ...)*), i32* %{{.+}}, i64 %{{.+}}, i16* %{{.+}}, i8** [[TD1_ADDR]], i8** [[TD2_ADDR]])
+// CHECK-NEXT: call void @__kmpc_end_taskgroup(%struct.ident_t* @0, i32 [[GTID]])
+// CHECK-NEXT: call void @__kmpc_end_taskgroup(%struct.ident_t* @0, i32 [[GTID]])
+
+// CHECK: define internal void [[OMP_PARALLEL]](
+// CHECK: [[TASK_T:%.+]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* @0, i32 [[GTID:%.+]], i32 1, i64 96, i64 40, i32 (i32, i8*)* bitcast (i32 (i32, [[T:%.+]]*)* [[OMP_TASK:@.+]] to i32 (i32, i8*)*))
+// CHECK-NEXT: [[TASK_T_WITH_PRIVS:%.+]] = bitcast i8* [[TASK_T]] to [[T]]*
+// CHECK: [[PRIVS:%.+]] = getelementptr inbounds [[T]], [[T]]* [[TASK_T_WITH_PRIVS]], i32 0, i32 1
+// CHECK: [[TD1_REF:%.+]] = getelementptr inbounds [[PRIVATES]], [[PRIVATES]]* [[PRIVS]], i32 0, i32 0
+// CHECK-NEXT: [[TD1_SHAR:%.+]] = getelementptr inbounds %
+// CHECK-NEXT: [[TD1_ADDR:%.+]] = load i8**, i8*** [[TD1_SHAR]],
+// CHECK-NEXT: [[TD1:%.+]] = load i8*, i8** [[TD1_ADDR]],
+// CHECK-NEXT: store i8* [[TD1]], i8** [[TD1_REF]],
+// CHECK-NEXT: [[TD2_REF:%.+]] = getelementptr inbounds [[PRIVATES]], [[PRIVATES]]* [[PRIVS]], i32 0, i32 1
+// CHECK-NEXT: [[TD2_SHAR:%.+]] = getelementptr inbounds %
+// CHECK-NEXT: [[TD2_ADDR:%.+]] = load i8**, i8*** [[TD2_SHAR]],
+// CHECK-NEXT: [[TD2:%.+]] = load i8*, i8** [[TD2_ADDR]],
+// CHECK-NEXT: store i8* [[TD2]], i8** [[TD2_REF]],
+// CHECK: call void @__kmpc_taskloop(%struct.ident_t* @0, i32 [[GTID]], i8* [[TASK_T]], i32 1,
+// CHECK: ret void
+// CHECK-NEXT: }
+
+// CHECK: define internal {{.*}} [[OMP_TASK]](
+// CHECK: call void (i8*, ...) %{{[^(]+}}(i8* %{{.+}}, i8*** [[TD1_REF:%[^,]+]], i8*** [[TD2_REF:%[^,]+]])
+// CHECK-NEXT: [[TD1_ADDR:%.+]] = load i8**, i8*** [[TD1_REF]],
+// CHECK-NEXT: [[TD2_ADDR:%.+]] = load i8**, i8*** [[TD2_REF]],
+// CHECK-NEXT: [[A_REF:%.+]] = getelementptr inbounds %
+// CHECK-NEXT: [[A_ADDR:%.+]] = load i32*, i32** [[A_REF]],
+// CHECK-NEXT: [[TD1:%.+]] = load i8*, i8** [[TD1_ADDR]],
+// CHECK-NEXT: [[GTID:%.+]] = load i32, i32* %
+// CHECK-NEXT: [[A_PTR:%.+]] = bitcast i32* [[A_ADDR]] to i8*
+// CHECK-NEXT: call i8* @__kmpc_task_reduction_get_th_data(i32 [[GTID]], i8* [[TD1]], i8* [[A_PTR]])
+// CHECK: [[D_REF:%.+]] = getelementptr inbounds %
+// CHECK-NEXT: [[D_ADDR:%.+]] = load i16*, i16** [[D_REF]],
+// CHECK: [[TD2:%.+]] = load i8*, i8** [[TD2_ADDR]],
+// CHECK-NEXT: [[D_PTR:%.+]] = bitcast i16* [[D_ADDR]] to i8*
+// CHECK-NEXT: call i8* @__kmpc_task_reduction_get_th_data(i32 [[GTID]], i8* [[TD2]], i8* [[D_PTR]])
+// CHECK: add nsw i32
+// CHECK: store i32 %
+#endif
diff --git a/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_in_reduction_messages.cpp b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_in_reduction_messages.cpp
new file mode 100644
index 0000000..bc69bd3
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_in_reduction_messages.cpp
@@ -0,0 +1,390 @@
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
+
+typedef void **omp_allocator_handle_t;
+extern const omp_allocator_handle_t omp_default_mem_alloc;
+extern const omp_allocator_handle_t omp_large_cap_mem_alloc;
+extern const omp_allocator_handle_t omp_const_mem_alloc;
+extern const omp_allocator_handle_t omp_high_bw_mem_alloc;
+extern const omp_allocator_handle_t omp_low_lat_mem_alloc;
+extern const omp_allocator_handle_t omp_cgroup_mem_alloc;
+extern const omp_allocator_handle_t omp_pteam_mem_alloc;
+extern const omp_allocator_handle_t omp_thread_mem_alloc;
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+void foobar(int &ref) {
+#pragma omp taskgroup task_reduction(+:ref)
+#pragma omp master taskloop simd in_reduction(+:ref)
+ for (int i = 0; i < 10; ++i)
+ foo();
+}
+
+void foobar1(int &ref) {
+#pragma omp taskgroup task_reduction(+:ref)
+#pragma omp master taskloop simd in_reduction(-:ref)
+ for (int i = 0; i < 10; ++i)
+ foo();
+}
+
+#pragma omp declare reduction (red:int:omp_out += omp_in)
+
+void foobar2(int &ref) {
+#pragma omp taskgroup task_reduction(+:ref) // expected-note {{previously marked as task_reduction with different reduction operation}}
+#pragma omp master taskloop simd in_reduction(red:ref) // expected-error{{in_reduction variable must have the same reduction operation as in a task_reduction clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+}
+
+void foobar3(int &ref) {
+#pragma omp taskgroup task_reduction(red:ref) // expected-note {{previously marked as task_reduction with different reduction operation}}
+#pragma omp master taskloop simd in_reduction(min:ref) // expected-error{{in_reduction variable must have the same reduction operation as in a task_reduction clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+}
+
+void foobar4(int &ref) {
+#pragma omp master taskloop simd in_reduction(min:ref) // expected-error {{in_reduction variable must appear in a task_reduction clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+}
+
+struct S1; // expected-note {{declared here}} expected-note 4 {{forward declaration of 'S1'}}
+extern S1 a;
+class S2 {
+ mutable int a;
+ S2 &operator+(const S2 &arg) { return (*this); } // expected-note 3 {{implicitly declared private here}}
+
+public:
+ S2() : a(0) {}
+ S2(S2 &s2) : a(s2.a) {}
+ static float S2s; // expected-note 2 {{static data member is predetermined as shared}}
+ static const float S2sc; // expected-note 2 {{'S2sc' declared here}}
+};
+const float S2::S2sc = 0;
+S2 b; // expected-note 3 {{'b' defined here}}
+const S2 ba[5]; // expected-note 2 {{'ba' defined here}}
+class S3 {
+ int a;
+
+public:
+ int b;
+ S3() : a(0) {}
+ S3(const S3 &s3) : a(s3.a) {}
+ S3 operator+(const S3 &arg1) { return arg1; }
+};
+int operator+(const S3 &arg1, const S3 &arg2) { return 5; }
+S3 c; // expected-note 3 {{'c' defined here}}
+const S3 ca[5]; // expected-note 2 {{'ca' defined here}}
+extern const int f; // expected-note 4 {{'f' declared here}}
+class S4 {
+ int a;
+ S4(); // expected-note {{implicitly declared private here}}
+ S4(const S4 &s4);
+ S4 &operator+(const S4 &arg) { return (*this); }
+
+public:
+ S4(int v) : a(v) {}
+};
+S4 &operator&=(S4 &arg1, S4 &arg2) { return arg1; }
+class S5 {
+ int a;
+ S5() : a(0) {} // expected-note {{implicitly declared private here}}
+ S5(const S5 &s5) : a(s5.a) {}
+ S5 &operator+(const S5 &arg);
+
+public:
+ S5(int v) : a(v) {}
+};
+class S6 { // expected-note 3 {{candidate function (the implicit copy assignment operator) not viable: no known conversion from 'int' to 'const S6' for 1st argument}}
+#if __cplusplus >= 201103L // C++11 or later
+// expected-note@-2 3 {{candidate function (the implicit move assignment operator) not viable}}
+#endif
+ int a;
+
+public:
+ S6() : a(6) {}
+ operator int() { return 6; }
+} o;
+
+S3 h, k;
+#pragma omp threadprivate(h) // expected-note 2 {{defined as threadprivate or thread local}}
+
+template <class T> // expected-note {{declared here}}
+T tmain(T argc) {
+ const T d = T(); // expected-note 4 {{'d' defined here}}
+ const T da[5] = {T()}; // expected-note 2 {{'da' defined here}}
+ T qa[5] = {T()};
+ T i, z;
+ T &j = i; // expected-note 2 {{'j' defined here}}
+ S3 &p = k; // expected-note 2 {{'p' defined here}}
+ const T &r = da[(int)i]; // expected-note 2 {{'r' defined here}}
+ T &q = qa[(int)i];
+ T fl;
+#pragma omp taskgroup task_reduction(+:argc)
+#pragma omp master taskloop simd in_reduction // expected-error {{expected '(' after 'in_reduction'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp taskgroup task_reduction(+:argc)
+#pragma omp master taskloop simd in_reduction + // expected-error {{expected '(' after 'in_reduction'}} expected-warning {{extra tokens at the end of '#pragma omp master taskloop simd' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp taskgroup task_reduction(+:argc)
+#pragma omp master taskloop simd in_reduction( // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp taskgroup task_reduction(+:argc)
+#pragma omp master taskloop simd in_reduction(- // expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp taskgroup task_reduction(+:argc)
+#pragma omp master taskloop simd in_reduction() // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp taskgroup task_reduction(+:argc)
+#pragma omp master taskloop simd in_reduction(*) // expected-warning {{missing ':' after reduction identifier - ignoring}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp taskgroup task_reduction(+:argc)
+#pragma omp master taskloop simd in_reduction(\) // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp taskgroup task_reduction(&:argc) // expected-error {{invalid operands to binary expression ('float' and 'float')}}
+#pragma omp master taskloop simd in_reduction(& : argc // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{invalid operands to binary expression ('float' and 'float')}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp taskgroup task_reduction(|:z) // expected-error {{invalid operands to binary expression ('float' and 'float')}}
+#pragma omp master taskloop simd in_reduction(| : z, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{invalid operands to binary expression ('float' and 'float')}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd in_reduction(|| : argc ? i : argc) // expected-error 2 {{expected variable name, array element or array section}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd in_reduction(foo : argc) //expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'float'}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'int'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp taskgroup task_reduction(&&:argc)
+#pragma omp master taskloop simd in_reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd in_reduction(^ : T) // expected-error {{'T' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp taskgroup task_reduction(+:c)
+#pragma omp master taskloop simd in_reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be in_reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}} expected-error 2 {{in_reduction variable must appear in a task_reduction clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd in_reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 4 {{arguments of OpenMP clause 'in_reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 3 {{const-qualified variable cannot be in_reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd in_reduction(max : h.b) // expected-error {{expected variable name, array element or array section}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd in_reduction(+ : ba) // expected-error {{const-qualified variable cannot be in_reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd in_reduction(* : ca) // expected-error {{const-qualified variable cannot be in_reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd in_reduction(- : da) // expected-error {{const-qualified variable cannot be in_reduction}} expected-error {{const-qualified variable cannot be in_reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd in_reduction(^ : fl) // expected-error {{invalid operands to binary expression ('float' and 'float')}} expected-error {{in_reduction variable must appear in a task_reduction clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd in_reduction(&& : S2::S2s) // expected-error {{shared variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd in_reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be in_reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp taskgroup task_reduction(+:k)
+#pragma omp master taskloop simd in_reduction(+ : h, k) // expected-error {{threadprivate or thread local variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd in_reduction(+ : o) // expected-error 2 {{no viable overloaded '='}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel private(k)
+#pragma omp master taskloop simd in_reduction(+ : p), in_reduction(+ : p) // expected-error 2 {{argument of OpenMP clause 'in_reduction' must reference the same object in all threads}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp taskgroup task_reduction(+:p)
+#pragma omp master taskloop simd in_reduction(+ : p), in_reduction(+ : p) // expected-error 2 {{variable can appear only once in OpenMP 'in_reduction' clause}} expected-note 2 {{previously referenced here}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd in_reduction(+ : r) // expected-error 2 {{const-qualified variable cannot be in_reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel shared(i)
+#pragma omp parallel reduction(min : i)
+#pragma omp master taskloop simd in_reduction(max : j) // expected-error 2 {{argument of OpenMP clause 'in_reduction' must reference the same object in all threads}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp taskgroup task_reduction(+:fl)
+{
+#pragma omp master taskloop simd allocate(omp_thread_mem_alloc: fl) in_reduction(+ : fl) // expected-warning 2 {{allocator with the 'thread' trait access has unspecified behavior on 'master taskloop simd' directive}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp taskgroup task_reduction(*:fl) // expected-note 2 {{previously marked as task_reduction with different reduction operation}}
+{
+#pragma omp master taskloop simd in_reduction(+ : fl) // expected-error 2 {{in_reduction variable must have the same reduction operation as in a task_reduction clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+}
+}
+#pragma omp parallel
+#pragma omp for reduction(- : fl)
+ for (int i = 0; i < 10; ++i)
+#pragma omp taskgroup task_reduction(+:fl)
+#pragma omp master taskloop simd in_reduction(+ : fl)
+ for (int j = 0; j < 10; ++j)
+ foo();
+
+ return T();
+}
+
+namespace A {
+double x;
+#pragma omp threadprivate(x) // expected-note {{defined as threadprivate or thread local}}
+}
+namespace B {
+using A::x;
+}
+
+int main(int argc, char **argv) {
+ const int d = 5; // expected-note 2 {{'d' defined here}}
+ const int da[5] = {0}; // expected-note {{'da' defined here}}
+ int qa[5] = {0};
+ S4 e(4);
+ S5 g(5);
+ int i, z;
+ int &j = i; // expected-note {{'j' defined here}}
+ S3 &p = k; // expected-note 2 {{'p' defined here}}
+ const int &r = da[i]; // expected-note {{'r' defined here}}
+ int &q = qa[i];
+ float fl;
+#pragma omp master taskloop simd in_reduction // expected-error {{expected '(' after 'in_reduction'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd in_reduction + // expected-error {{expected '(' after 'in_reduction'}} expected-warning {{extra tokens at the end of '#pragma omp master taskloop simd' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd in_reduction( // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd in_reduction(- // expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd in_reduction() // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd in_reduction(*) // expected-warning {{missing ':' after reduction identifier - ignoring}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd in_reduction(\) // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd in_reduction(foo : argc // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp taskgroup task_reduction(|:argc)
+#pragma omp master taskloop simd in_reduction(| : argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd in_reduction(|| : argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name, array element or array section}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd in_reduction(~ : argc) // expected-error {{expected unqualified-id}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp taskgroup task_reduction(&&:argc, z)
+#pragma omp master taskloop simd in_reduction(&& : argc, z)
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd in_reduction(^ : S1) // expected-error {{'S1' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp taskgroup task_reduction(+:c)
+#pragma omp master taskloop simd in_reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{const-qualified variable cannot be in_reduction}} expected-error {{'operator+' is a private member of 'S2'}} expected-error {{in_reduction variable must appear in a task_reduction clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd in_reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{arguments of OpenMP clause 'in_reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 2 {{const-qualified variable cannot be in_reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd in_reduction(max : h.b) // expected-error {{expected variable name, array element or array section}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd in_reduction(+ : ba) // expected-error {{const-qualified variable cannot be in_reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd in_reduction(* : ca) // expected-error {{const-qualified variable cannot be in_reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd in_reduction(- : da) // expected-error {{const-qualified variable cannot be in_reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd in_reduction(^ : fl) // expected-error {{invalid operands to binary expression ('float' and 'float')}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd in_reduction(&& : S2::S2s) // expected-error {{shared variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd in_reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be in_reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd in_reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{nvalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp taskgroup task_reduction(+:k)
+#pragma omp master taskloop simd in_reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd in_reduction(+ : o) // expected-error {{no viable overloaded '='}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel private(k)
+#pragma omp master taskloop simd in_reduction(+ : p), in_reduction(+ : p) // expected-error 2 {{argument of OpenMP clause 'in_reduction' must reference the same object in all threads}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp taskgroup task_reduction(+:p)
+#pragma omp master taskloop simd in_reduction(+ : p), in_reduction(+ : p) // expected-error {{variable can appear only once in OpenMP 'in_reduction' clause}} expected-note {{previously referenced here}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd in_reduction(+ : r) // expected-error {{const-qualified variable cannot be in_reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel shared(i)
+#pragma omp parallel reduction(min : i)
+#pragma omp master taskloop simd in_reduction(max : j) // expected-error {{argument of OpenMP clause 'in_reduction' must reference the same object in all threads}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp for private(fl)
+ for (int i = 0; i < 10; ++i)
+#pragma omp taskgroup task_reduction(+:fl)
+#pragma omp master taskloop simd in_reduction(+ : fl)
+ for (int j = 0; j < 10; ++j)
+ foo();
+#pragma omp taskgroup task_reduction(+:fl)
+#pragma omp master taskloop simd in_reduction(+ : fl)
+ for (int i = 0; i < 10; ++i)
+ foo();
+ static int m;
+#pragma omp taskgroup task_reduction(+:m)
+#pragma omp master taskloop simd in_reduction(+ : m) // OK
+ for (int i = 0; i < 10; ++i)
+ m++;
+
+ return tmain(argc) + tmain(fl); // expected-note {{in instantiation of function template specialization 'tmain<int>' requested here}} expected-note {{in instantiation of function template specialization 'tmain<float>' requested here}}
+}
diff --git a/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_lastprivate_codegen.cpp b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_lastprivate_codegen.cpp
new file mode 100644
index 0000000..ecf7669
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_lastprivate_codegen.cpp
@@ -0,0 +1,525 @@
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-apple-darwin10 -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=LAMBDA %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=BLOCKS %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DARRAY -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=ARRAY %s
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DARRAY -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
+// expected-no-diagnostics
+
+#ifndef ARRAY
+#ifndef HEADER
+#define HEADER
+
+template <class T>
+struct S {
+ T f;
+ S(T a) : f(a) {}
+ S() : f() {}
+ S(const S &s, T t = T()) : f(s.f + t) {}
+ operator T() { return T(); }
+ ~S() {}
+};
+
+volatile double g;
+
+// CHECK-DAG: [[KMP_TASK_T_TY:%.+]] = type { i8*, i32 (i32, i8*)*, i32, %union{{.+}}, %union{{.+}}, i64, i64, i64, i32, i8* }
+// CHECK-DAG: [[S_DOUBLE_TY:%.+]] = type { double }
+// CHECK-DAG: [[PRIVATES_MAIN_TY:%.+]] = type {{.?}}{ [2 x [[S_DOUBLE_TY]]], [[S_DOUBLE_TY]], i32, [2 x i32]
+// CHECK-DAG: [[CAP_MAIN_TY:%.+]] = type { [2 x i32]*, i32*, [2 x [[S_DOUBLE_TY]]]*, [[S_DOUBLE_TY]]*, i{{[0-9]+}}* }
+// CHECK-DAG: [[KMP_TASK_MAIN_TY:%.+]] = type { [[KMP_TASK_T_TY]], [[PRIVATES_MAIN_TY]] }
+// CHECK-DAG: [[S_INT_TY:%.+]] = type { i32 }
+// CHECK-DAG: [[CAP_TMAIN_TY:%.+]] = type { [2 x i32]*, i32*, [2 x [[S_INT_TY]]]*, [[S_INT_TY]]* }
+// CHECK-DAG: [[PRIVATES_TMAIN_TY:%.+]] = type { i32, [2 x i32], [2 x [[S_INT_TY]]], [[S_INT_TY]], [104 x i8] }
+// CHECK-DAG: [[KMP_TASK_TMAIN_TY:%.+]] = type { [[KMP_TASK_T_TY]], [{{[0-9]+}} x i8], [[PRIVATES_TMAIN_TY]] }
+template <typename T>
+T tmain() {
+ S<T> ttt;
+ S<T> test;
+ T t_var __attribute__((aligned(128))) = T();
+ T vec[] = {1, 2};
+ S<T> s_arr[] = {1, 2};
+ S<T> var(3);
+#pragma omp master taskloop simd lastprivate(t_var, vec, s_arr, s_arr, var, var)
+ for (int i = 0; i < 10; ++i) {
+ vec[0] = t_var;
+ s_arr[0] = var;
+ }
+ return T();
+}
+
+int main() {
+ static int sivar;
+#ifdef LAMBDA
+ // LAMBDA: [[G:@.+]] = global double
+ // LAMBDA: [[SIVAR:@.+]] = internal global i{{[0-9]+}} 0,
+ // LAMBDA-LABEL: @main
+ // LAMBDA: call{{( x86_thiscallcc)?}} void [[OUTER_LAMBDA:@.+]](
+ [&]() {
+ // LAMBDA: define{{.*}} internal{{.*}} void [[OUTER_LAMBDA]](
+ // LAMBDA: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc(%{{[^ ]+}} @{{[^,]+}}, i32 %{{[^,]+}}, i32 1, i64 96, i64 16, i32 (i32, i8*)* bitcast (i32 (i32, %{{[^*]+}}*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+// LAMBDA: [[PRIVATES:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i{{.+}} 0, i{{.+}} 1
+
+// LAMBDA: call void @__kmpc_taskloop(%{{.+}}* @{{.+}}, i32 %{{.+}}, i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* bitcast (void ([[KMP_TASK_MAIN_TY:%[^*]+]]*, [[KMP_TASK_MAIN_TY]]*, i32)* [[MAIN_DUP:@.+]] to i8*))
+// LAMBDA: ret
+#pragma omp master taskloop simd lastprivate(g, sivar)
+ for (int i = 0; i < 10; ++i) {
+ // LAMBDA: define {{.+}} void [[INNER_LAMBDA:@.+]](%{{.+}}* [[ARG_PTR:%.+]])
+ // LAMBDA: store %{{.+}}* [[ARG_PTR]], %{{.+}}** [[ARG_PTR_REF:%.+]],
+ // LAMBDA: [[ARG_PTR:%.+]] = load %{{.+}}*, %{{.+}}** [[ARG_PTR_REF]]
+ // LAMBDA: [[G_PTR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[ARG_PTR]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+ // LAMBDA: [[G_REF:%.+]] = load double*, double** [[G_PTR_REF]]
+ // LAMBDA: store double 2.0{{.+}}, double* [[G_REF]]
+
+ // LAMBDA: store double* %{{.+}}, double** %{{.+}},
+ // LAMBDA: define internal i32 [[TASK_ENTRY]](i32 %0, %{{.+}}* noalias %1)
+ g = 1;
+ sivar = 11;
+ // LAMBDA: store double 1.0{{.+}}, double* %{{.+}},
+ // LAMBDA: store i{{[0-9]+}} 11, i{{[0-9]+}}* %{{.+}},
+ // LAMBDA: call void [[INNER_LAMBDA]](%
+ // LAMBDA: icmp ne i32 %{{.+}}, 0
+ // LAMBDA: br i1
+ // LAMBDA: load double, double* %
+ // LAMBDA: store volatile double %
+ // LAMBDA: load i32, i32* %
+ // LAMBDA: store i32 %
+ // LAMBDA: ret
+ [&]() {
+ g = 2;
+ sivar = 22;
+ }();
+ }
+ }();
+ return 0;
+#elif defined(BLOCKS)
+ // BLOCKS: [[G:@.+]] = global double
+ // BLOCKS-LABEL: @main
+ // BLOCKS: call void {{%.+}}(i8
+ ^{
+ // BLOCKS: define{{.*}} internal{{.*}} void {{.+}}(i8*
+ // BLOCKS: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc(%{{[^ ]+}} @{{[^,]+}}, i32 %{{[^,]+}}, i32 1, i64 96, i64 16, i32 (i32, i8*)* bitcast (i32 (i32, %{{[^*]+}}*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+ // BLOCKS: [[PRIVATES:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i{{.+}} 0, i{{.+}} 1
+ // BLOCKS: call void @__kmpc_taskloop(%{{.+}}* @{{.+}}, i32 %{{.+}}, i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* bitcast (void ([[KMP_TASK_MAIN_TY:%[^*]+]]*, [[KMP_TASK_MAIN_TY]]*, i32)* [[MAIN_DUP:@.+]] to i8*))
+ // BLOCKS: ret
+#pragma omp master taskloop simd lastprivate(g, sivar)
+ for (int i = 0; i < 10; ++i) {
+ // BLOCKS: define {{.+}} void {{@.+}}(i8*
+ // BLOCKS-NOT: [[G]]{{[[^:word:]]}}
+ // BLOCKS: store double 2.0{{.+}}, double*
+ // BLOCKS-NOT: [[G]]{{[[^:word:]]}}
+ // BLOCKS-NOT: [[ISVAR]]{{[[^:word:]]}}
+ // BLOCKS: store i{{[0-9]+}} 22, i{{[0-9]+}}*
+ // BLOCKS-NOT: [[SIVAR]]{{[[^:word:]]}}
+ // BLOCKS: ret
+
+ // BLOCKS: store double* %{{.+}}, double** %{{.+}},
+ // BLOCKS: store i{{[0-9]+}}* %{{.+}}, i{{[0-9]+}}** %{{.+}},
+ // BLOCKS: define internal i32 [[TASK_ENTRY]](i32 %0, %{{.+}}* noalias %1)
+ g = 1;
+ sivar = 11;
+ // BLOCKS: store double 1.0{{.+}}, double* %{{.+}},
+ // BLOCKS-NOT: [[G]]{{[[^:word:]]}}
+ // BLOCKS: store i{{[0-9]+}} 11, i{{[0-9]+}}* %{{.+}},
+ // BLOCKS-NOT: [[SIVAR]]{{[[^:word:]]}}
+ // BLOCKS: call void {{%.+}}(i8
+ // BLOCKS: icmp ne i32 %{{.+}}, 0
+ // BLOCKS: br i1
+ // BLOCKS: load double, double* %
+ // BLOCKS: store volatile double %
+ // BLOCKS: load i32, i32* %
+ // BLOCKS: store i32 %
+ ^{
+ g = 2;
+ sivar = 22;
+ }();
+ }
+ }();
+ return 0;
+#else
+ S<double> ttt;
+ S<double> test;
+ int t_var = 0;
+ int vec[] = {1, 2};
+ S<double> s_arr[] = {1, 2};
+ S<double> var(3);
+#pragma omp master taskloop simd lastprivate(var, t_var, s_arr, vec, s_arr, var, sivar)
+ for (int i = 0; i < 10; ++i) {
+ vec[0] = t_var;
+ s_arr[0] = var;
+ sivar = 33;
+ }
+ return tmain<int>();
+#endif
+}
+
+// CHECK: [[SIVAR:.+]] = internal global i{{[0-9]+}} 0,
+// CHECK: define i{{[0-9]+}} @main()
+// CHECK: alloca [[S_DOUBLE_TY]],
+// CHECK: [[TEST:%.+]] = alloca [[S_DOUBLE_TY]],
+// CHECK: [[T_VAR_ADDR:%.+]] = alloca i32,
+// CHECK: [[VEC_ADDR:%.+]] = alloca [2 x i32],
+// CHECK: [[S_ARR_ADDR:%.+]] = alloca [2 x [[S_DOUBLE_TY]]],
+// CHECK: [[VAR_ADDR:%.+]] = alloca [[S_DOUBLE_TY]],
+// CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num([[LOC:%.+]])
+
+// CHECK: call {{.*}} [[S_DOUBLE_TY_CONSTR:@.+]]([[S_DOUBLE_TY]]* [[TEST]])
+
+// Store original variables in capture struct.
+// CHECK: [[VEC_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: store [2 x i32]* [[VEC_ADDR]], [2 x i32]** [[VEC_REF]],
+// CHECK: [[T_VAR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 1
+// CHECK: store i32* [[T_VAR_ADDR]], i32** [[T_VAR_REF]],
+// CHECK: [[S_ARR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 2
+// CHECK: store [2 x [[S_DOUBLE_TY]]]* [[S_ARR_ADDR]], [2 x [[S_DOUBLE_TY]]]** [[S_ARR_REF]],
+// CHECK: [[VAR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 3
+// CHECK: store [[S_DOUBLE_TY]]* [[VAR_ADDR]], [[S_DOUBLE_TY]]** [[VAR_REF]],
+// CHECK: [[SIVAR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 4
+// CHECK: store i{{[0-9]+}}* [[SIVAR]], i{{[0-9]+}}** [[SIVAR_REF]],
+
+// Allocate task.
+// Returns struct kmp_task_t {
+// [[KMP_TASK_T]] task_data;
+// [[KMP_TASK_MAIN_TY]] privates;
+// };
+// CHECK: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc([[LOC]], i32 [[GTID]], i32 9, i64 120, i64 40, i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_MAIN_TY]]*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+// CHECK: [[RES_KMP_TASK:%.+]] = bitcast i8* [[RES]] to [[KMP_TASK_MAIN_TY]]*
+
+// Fill kmp_task_t->shareds by copying from original capture argument.
+// CHECK: [[TASK:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: [[SHAREDS_REF_ADDR:%.+]] = getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* [[TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: [[SHAREDS_REF:%.+]] = load i8*, i8** [[SHAREDS_REF_ADDR]],
+// CHECK: [[CAPTURES_ADDR:%.+]] = bitcast [[CAP_MAIN_TY]]* %{{.+}} to i8*
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 [[SHAREDS_REF]], i8* align 8 [[CAPTURES_ADDR]], i64 40, i1 false)
+
+// Initialize kmp_task_t->privates with default values (no init for simple types, default constructors for classes).
+// Also copy address of private copy to the corresponding shareds reference.
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
+
+// Constructors for s_arr and var.
+// s_arr;
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: call {{.*}} [[S_DOUBLE_TY_CONSTR]]([[S_DOUBLE_TY]]* [[S_ARR_CUR:%[^,]+]])
+// CHECK: getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* [[S_ARR_CUR]], i{{.+}} 1
+// CHECK: icmp eq
+// CHECK: br i1
+
+// var;
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
+// CHECK: call {{.*}} [[S_DOUBLE_TY_CONSTR]]([[S_DOUBLE_TY]]* [[PRIVATE_VAR_REF]])
+
+// t_var;
+// vec;
+// sivar;
+
+// Provide pointer to destructor function, which will destroy private variables at the end of the task.
+// CHECK: [[DESTRUCTORS_REF:%.+]] = getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* [[TASK]], i{{.+}} 0, i{{.+}} 3
+// CHECK: [[DESTRUCTORS_PTR:%.+]] = bitcast %union{{.+}}* [[DESTRUCTORS_REF]] to i32 (i32, i8*)**
+// CHECK: store i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_MAIN_TY]]*)* [[DESTRUCTORS:@.+]] to i32 (i32, i8*)*), i32 (i32, i8*)** [[DESTRUCTORS_PTR]],
+
+// Start task.
+// CHECK: call void @__kmpc_taskloop([[LOC]], i32 [[GTID]], i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* bitcast (void ([[KMP_TASK_MAIN_TY]]*, [[KMP_TASK_MAIN_TY]]*, i32)* [[MAIN_DUP:@.+]] to i8*))
+
+// CHECK: = call i{{.+}} [[TMAIN_INT:@.+]]()
+
+// No destructors must be called for private copies of s_arr and var.
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: call void [[S_DOUBLE_TY_DESTR:@.+]]([[S_DOUBLE_TY]]*
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: ret
+//
+
+// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_MAIN_TY]]* noalias %0, [[S_DOUBLE_TY]]** noalias %1, i32** noalias %2, [2 x [[S_DOUBLE_TY]]]** noalias %3, [2 x i32]** noalias %4, i32** noalias %5)
+// CHECK: [[PRIVATES:%.+]] = load [[PRIVATES_MAIN_TY]]*, [[PRIVATES_MAIN_TY]]**
+// CHECK: [[PRIV_S_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 0
+// CHECK: [[ARG3:%.+]] = load [2 x [[S_DOUBLE_TY]]]**, [2 x [[S_DOUBLE_TY]]]*** %{{.+}},
+// CHECK: store [2 x [[S_DOUBLE_TY]]]* [[PRIV_S_VAR]], [2 x [[S_DOUBLE_TY]]]** [[ARG3]],
+// CHECK: [[PRIV_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 1
+// CHECK: [[ARG1:%.+]] = load [[S_DOUBLE_TY]]**, [[S_DOUBLE_TY]]*** {{.+}},
+// CHECK: store [[S_DOUBLE_TY]]* [[PRIV_VAR]], [[S_DOUBLE_TY]]** [[ARG1]],
+// CHECK: [[PRIV_T_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 2
+// CHECK: [[ARG2:%.+]] = load i32**, i32*** %{{.+}},
+// CHECK: store i32* [[PRIV_T_VAR]], i32** [[ARG2]],
+// CHECK: [[PRIV_VEC:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 3
+// CHECK: [[ARG4:%.+]] = load [2 x i32]**, [2 x i32]*** %{{.+}},
+// CHECK: store [2 x i32]* [[PRIV_VEC]], [2 x i32]** [[ARG4]],
+// CHECK: [[PRIV_SIVAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 4
+// CHECK: [[ARG5:%.+]] = load i{{[0-9]+}}**, i{{[0-9]+}}*** %{{.+}},
+// CHECK: store i{{[0-9]+}}* [[PRIV_SIVAR]], i{{[0-9]+}}** [[ARG5]],
+// CHECK: ret void
+
+// CHECK: define internal i32 [[TASK_ENTRY]](i32 %0, [[KMP_TASK_MAIN_TY]]* noalias %1)
+
+// CHECK: [[PRIV_VAR_ADDR:%.+]] = alloca [[S_DOUBLE_TY]]*,
+// CHECK: [[PRIV_T_VAR_ADDR:%.+]] = alloca i32*,
+// CHECK: [[PRIV_S_ARR_ADDR:%.+]] = alloca [2 x [[S_DOUBLE_TY]]]*,
+// CHECK: [[PRIV_VEC_ADDR:%.+]] = alloca [2 x i32]*,
+// CHECK: [[PRIV_SIVAR_ADDR:%.+]] = alloca i32*,
+// CHECK: store void (i8*, ...)* bitcast (void ([[PRIVATES_MAIN_TY]]*, [[S_DOUBLE_TY]]**, i32**, [2 x [[S_DOUBLE_TY]]]**, [2 x i32]**, i32**)* [[PRIVATES_MAP_FN]] to void (i8*, ...)*), void (i8*, ...)** [[MAP_FN_ADDR:%.+]],
+// CHECK: [[MAP_FN:%.+]] = load void (i8*, ...)*, void (i8*, ...)** [[MAP_FN_ADDR]],
+
+// CHECK: call void (i8*, ...) [[MAP_FN]](i8* %{{.+}}, [[S_DOUBLE_TY]]** [[PRIV_VAR_ADDR]], i32** [[PRIV_T_VAR_ADDR]], [2 x [[S_DOUBLE_TY]]]** [[PRIV_S_ARR_ADDR]], [2 x i32]** [[PRIV_VEC_ADDR]], i32** [[PRIV_SIVAR_ADDR]])
+
+// CHECK: [[PRIV_VAR:%.+]] = load [[S_DOUBLE_TY]]*, [[S_DOUBLE_TY]]** [[PRIV_VAR_ADDR]],
+// CHECK: [[PRIV_T_VAR:%.+]] = load i32*, i32** [[PRIV_T_VAR_ADDR]],
+// CHECK: [[PRIV_S_ARR:%.+]] = load [2 x [[S_DOUBLE_TY]]]*, [2 x [[S_DOUBLE_TY]]]** [[PRIV_S_ARR_ADDR]],
+// CHECK: [[PRIV_VEC:%.+]] = load [2 x i32]*, [2 x i32]** [[PRIV_VEC_ADDR]],
+// CHECK: [[PRIV_SIVAR:%.+]] = load i32*, i32** [[PRIV_SIVAR_ADDR]],
+
+// Privates actually are used.
+// CHECK-DAG: [[PRIV_VAR]]
+// CHECK-DAG: [[PRIV_T_VAR]]
+// CHECK-DAG: [[PRIV_S_ARR]]
+// CHECK-DAG: [[PRIV_VEC]]
+// CHECK-DAG: [[PRIV_SIVAR]]
+
+// CHECK: icmp ne i32 %{{.+}}, 0
+// CHECK-NEXT: br i1
+// CHECK: bitcast [[S_DOUBLE_TY]]* %{{.+}} to i8*
+// CHECK: bitcast [[S_DOUBLE_TY]]* %{{.+}} to i8*
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align {{[0-9]+}} %
+// CHECK: load i32, i32* %
+// CHECK: store i32 %{{.+}}, i32* %
+// CHECK: getelementptr inbounds [2 x [[S_DOUBLE_TY]]], [2 x [[S_DOUBLE_TY]]]* %
+// CHECK: phi [[S_DOUBLE_TY]]*
+// CHECK: phi [[S_DOUBLE_TY]]*
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align {{[0-9]+}} %
+// CHECK: icmp eq [[S_DOUBLE_TY]]* %
+// CHECK-NEXT: br i1
+// CHECK: bitcast [2 x i32]* %{{.+}} to i8*
+// CHECK: bitcast [2 x i32]* %{{.+}} to i8*
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align {{[0-9]+}} %
+// CHECK: load i32, i32* %
+// CHECK: store i32 %{{.+}}, i32* %
+// CHECK: br label
+// CHECK: ret
+
+// CHECK: define internal void [[MAIN_DUP]]([[KMP_TASK_MAIN_TY]]* %0, [[KMP_TASK_MAIN_TY]]* %1, i32 %2)
+// CHECK: getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* %{{.+}}, i32 0, i32 8
+// CHECK: load i32, i32* %
+// CHECK: store i32 %{{.+}}, i32* %
+// CHECK: getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* %{{.+}}, i32 0, i32 1
+// CHECK: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr inbounds [2 x [[S_DOUBLE_TY]]], [2 x [[S_DOUBLE_TY]]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i64 2
+// CHECK: br label %
+
+// CHECK: phi [[S_DOUBLE_TY]]*
+// CHECK: call {{.*}} [[S_DOUBLE_TY_CONSTR]]([[S_DOUBLE_TY]]*
+// CHECK: getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i64 1
+// CHECK: icmp eq [[S_DOUBLE_TY]]* %
+// CHECK: br i1 %
+
+// CHECK: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* %{{.+}}, i32 0, i32 1
+// CHECK: call {{.*}} [[S_DOUBLE_TY_CONSTR]]([[S_DOUBLE_TY]]*
+// CHECK: ret void
+
+// CHECK: define internal i32 [[DESTRUCTORS]](i32 %0, [[KMP_TASK_MAIN_TY]]* noalias %1)
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 0
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
+// CHECK: call {{.*}} [[S_DOUBLE_TY_DESTR]]([[S_DOUBLE_TY]]* [[PRIVATE_VAR_REF]])
+// CHECK: getelementptr inbounds [2 x [[S_DOUBLE_TY]]], [2 x [[S_DOUBLE_TY]]]* [[PRIVATE_S_ARR_REF]], i{{.+}} 0, i{{.+}} 0
+// CHECK: getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i{{.+}} 2
+// CHECK: [[PRIVATE_S_ARR_ELEM_REF:%.+]] = getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i{{.+}} -1
+// CHECK: call {{.*}} [[S_DOUBLE_TY_DESTR]]([[S_DOUBLE_TY]]* [[PRIVATE_S_ARR_ELEM_REF]])
+// CHECK: icmp eq
+// CHECK: br i1
+// CHECK: ret i32
+
+// CHECK: define {{.*}} i{{[0-9]+}} [[TMAIN_INT]]()
+// CHECK: alloca [[S_INT_TY]],
+// CHECK: [[TEST:%.+]] = alloca [[S_INT_TY]],
+// CHECK: [[T_VAR_ADDR:%.+]] = alloca i32, align 128
+// CHECK: [[VEC_ADDR:%.+]] = alloca [2 x i32],
+// CHECK: [[S_ARR_ADDR:%.+]] = alloca [2 x [[S_INT_TY]]],
+// CHECK: [[VAR_ADDR:%.+]] = alloca [[S_INT_TY]],
+// CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num([[LOC:%.+]])
+
+// CHECK: call {{.*}} [[S_INT_TY_CONSTR:@.+]]([[S_INT_TY]]* [[TEST]])
+
+// Store original variables in capture struct.
+// CHECK: [[VEC_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: store [2 x i32]* [[VEC_ADDR]], [2 x i32]** [[VEC_REF]],
+// CHECK: [[T_VAR_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 1
+// CHECK: store i32* [[T_VAR_ADDR]], i32** [[T_VAR_REF]],
+// CHECK: [[S_ARR_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 2
+// CHECK: store [2 x [[S_INT_TY]]]* [[S_ARR_ADDR]], [2 x [[S_INT_TY]]]** [[S_ARR_REF]],
+// CHECK: [[VAR_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 3
+// CHECK: store [[S_INT_TY]]* [[VAR_ADDR]], [[S_INT_TY]]** [[VAR_REF]],
+
+// Allocate task.
+// Returns struct kmp_task_t {
+// [[KMP_TASK_T_TY]] task_data;
+// [[KMP_TASK_TMAIN_TY]] privates;
+// };
+// CHECK: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc([[LOC]], i32 [[GTID]], i32 9, i64 256, i64 32, i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_TMAIN_TY]]*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+// CHECK: [[RES_KMP_TASK:%.+]] = bitcast i8* [[RES]] to [[KMP_TASK_TMAIN_TY]]*
+
+// Fill kmp_task_t->shareds by copying from original capture argument.
+// CHECK: [[TASK:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: [[SHAREDS_REF_ADDR:%.+]] = getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* [[TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: [[SHAREDS_REF:%.+]] = load i8*, i8** [[SHAREDS_REF_ADDR]],
+// CHECK: [[CAPTURES_ADDR:%.+]] = bitcast [[CAP_TMAIN_TY]]* %{{.+}} to i8*
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 [[SHAREDS_REF]], i8* align 8 [[CAPTURES_ADDR]], i64 32, i1 false)
+
+// Initialize kmp_task_t->privates with default values (no init for simple types, default constructors for classes).
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
+
+// t_var;
+// vec;
+
+// Constructors for s_arr and var.
+// a_arr;
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
+// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* [[PRIVATE_S_ARR_REF]], i{{.+}} 0, i{{.+}} 0
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i{{.+}} 2
+// CHECK: call {{.*}} [[S_INT_TY_CONSTR]]([[S_INT_TY]]* [[S_ARR_CUR:%[^,]+]])
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* [[S_ARR_CUR]], i{{.+}} 1
+// CHECK: icmp eq
+// CHECK: br i1
+
+// var;
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: call {{.*}} [[S_INT_TY_CONSTR]]([[S_INT_TY]]* [[PRIVATE_VAR_REF]])
+
+// Provide pointer to destructor function, which will destroy private variables at the end of the task.
+// CHECK: [[DESTRUCTORS_REF:%.+]] = getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* [[TASK]], i{{.+}} 0, i{{.+}} 3
+// CHECK: [[DESTRUCTORS_PTR:%.+]] = bitcast %union{{.+}}* [[DESTRUCTORS_REF]] to i32 (i32, i8*)**
+// CHECK: store i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_TMAIN_TY]]*)* [[DESTRUCTORS:@.+]] to i32 (i32, i8*)*), i32 (i32, i8*)** [[DESTRUCTORS_PTR]],
+
+// Start task.
+// CHECK: call void @__kmpc_taskloop([[LOC]], i32 [[GTID]], i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* bitcast (void ([[KMP_TASK_TMAIN_TY]]*, [[KMP_TASK_TMAIN_TY]]*, i32)* [[TMAIN_DUP:@.+]] to i8*))
+
+// No destructors must be called for private copies of s_arr and var.
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: call void [[S_INT_TY_DESTR:@.+]]([[S_INT_TY]]*
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: ret
+//
+
+// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_TMAIN_TY]]* noalias %0, i32** noalias %1, [2 x i32]** noalias %2, [2 x [[S_INT_TY]]]** noalias %3, [[S_INT_TY]]** noalias %4)
+// CHECK: [[PRIVATES:%.+]] = load [[PRIVATES_TMAIN_TY]]*, [[PRIVATES_TMAIN_TY]]**
+// CHECK: [[PRIV_T_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 0
+// CHECK: [[ARG1:%.+]] = load i32**, i32*** %{{.+}},
+// CHECK: store i32* [[PRIV_T_VAR]], i32** [[ARG1]],
+// CHECK: [[PRIV_VEC:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 1
+// CHECK: [[ARG2:%.+]] = load [2 x i32]**, [2 x i32]*** %{{.+}},
+// CHECK: store [2 x i32]* [[PRIV_VEC]], [2 x i32]** [[ARG2]],
+// CHECK: [[PRIV_S_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 2
+// CHECK: [[ARG3:%.+]] = load [2 x [[S_INT_TY]]]**, [2 x [[S_INT_TY]]]*** %{{.+}},
+// CHECK: store [2 x [[S_INT_TY]]]* [[PRIV_S_VAR]], [2 x [[S_INT_TY]]]** [[ARG3]],
+// CHECK: [[PRIV_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 3
+// CHECK: [[ARG4:%.+]] = load [[S_INT_TY]]**, [[S_INT_TY]]*** {{.+}},
+// CHECK: store [[S_INT_TY]]* [[PRIV_VAR]], [[S_INT_TY]]** [[ARG4]],
+// CHECK: ret void
+
+// CHECK: define internal i32 [[TASK_ENTRY]](i32 %0, [[KMP_TASK_TMAIN_TY]]* noalias %1)
+// CHECK: alloca i32*,
+// CHECK-DAG: [[PRIV_T_VAR_ADDR:%.+]] = alloca i32*,
+// CHECK-DAG: [[PRIV_VEC_ADDR:%.+]] = alloca [2 x i32]*,
+// CHECK-DAG: [[PRIV_S_ARR_ADDR:%.+]] = alloca [2 x [[S_INT_TY]]]*,
+// CHECK-DAG: [[PRIV_VAR_ADDR:%.+]] = alloca [[S_INT_TY]]*,
+// CHECK: store void (i8*, ...)* bitcast (void ([[PRIVATES_TMAIN_TY]]*, i32**, [2 x i32]**, [2 x [[S_INT_TY]]]**, [[S_INT_TY]]**)* [[PRIVATES_MAP_FN]] to void (i8*, ...)*), void (i8*, ...)** [[MAP_FN_ADDR:%.+]],
+// CHECK: [[MAP_FN:%.+]] = load void (i8*, ...)*, void (i8*, ...)** [[MAP_FN_ADDR]],
+// CHECK: call void (i8*, ...) [[MAP_FN]](i8* %{{.+}}, i32** [[PRIV_T_VAR_ADDR]], [2 x i32]** [[PRIV_VEC_ADDR]], [2 x [[S_INT_TY]]]** [[PRIV_S_ARR_ADDR]], [[S_INT_TY]]** [[PRIV_VAR_ADDR]])
+// CHECK: [[PRIV_T_VAR:%.+]] = load i32*, i32** [[PRIV_T_VAR_ADDR]],
+// CHECK: [[PRIV_VEC:%.+]] = load [2 x i32]*, [2 x i32]** [[PRIV_VEC_ADDR]],
+// CHECK: [[PRIV_S_ARR:%.+]] = load [2 x [[S_INT_TY]]]*, [2 x [[S_INT_TY]]]** [[PRIV_S_ARR_ADDR]],
+// CHECK: [[PRIV_VAR:%.+]] = load [[S_INT_TY]]*, [[S_INT_TY]]** [[PRIV_VAR_ADDR]],
+
+// Privates actually are used.
+// CHECK-DAG: [[PRIV_VAR]]
+// CHECK-DAG: [[PRIV_T_VAR]]
+// CHECK-DAG: [[PRIV_S_ARR]]
+// CHECK-DAG: [[PRIV_VEC]]
+
+// CHECK: icmp ne i32 %{{.+}}, 0
+// CHECK-NEXT: br i1
+// CHECK: load i32, i32* %
+// CHECK: store i32 %{{.+}}, i32* %
+// CHECK: bitcast [2 x i32]* %{{.+}} to i8*
+// CHECK: bitcast [2 x i32]* %{{.+}} to i8*
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align {{[0-9]+}} %
+// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* %
+// CHECK: phi [[S_INT_TY]]*
+// CHECK: phi [[S_INT_TY]]*
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align {{[0-9]+}} %
+// CHECK: icmp eq [[S_INT_TY]]* %
+// CHECK-NEXT: br i1
+// CHECK: bitcast [[S_INT_TY]]* %{{.+}} to i8*
+// CHECK: bitcast [[S_INT_TY]]* %{{.+}} to i8*
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align {{[0-9]+}} %
+// CHECK: br label
+// CHECK: ret
+
+// CHECK: define internal void [[TMAIN_DUP]]([[KMP_TASK_TMAIN_TY]]* %0, [[KMP_TASK_TMAIN_TY]]* %1, i32 %2)
+// CHECK: getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* %{{.+}}, i32 0, i32 8
+// CHECK: load i32, i32* %
+// CHECK: store i32 %{{.+}}, i32* %
+// CHECK: getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* %{{.+}}, i32 0, i32 2
+// CHECK: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* %{{.+}}, i32 0, i32 2
+// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i64 2
+// CHECK: br label %
+
+// CHECK: phi [[S_INT_TY]]*
+// CHECK: call {{.*}} [[S_INT_TY_CONSTR]]([[S_INT_TY]]*
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i64 1
+// CHECK: icmp eq [[S_INT_TY]]* %
+// CHECK: br i1 %
+
+// CHECK: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* %{{.+}}, i32 0, i32 3
+// CHECK: call {{.*}} [[S_INT_TY_CONSTR]]([[S_INT_TY]]*
+// CHECK: ret void
+
+// CHECK: define internal i32 [[DESTRUCTORS]](i32 %0, [[KMP_TASK_TMAIN_TY]]* noalias %1)
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: call void [[S_INT_TY_DESTR]]([[S_INT_TY]]* [[PRIVATE_VAR_REF]])
+// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* [[PRIVATE_S_ARR_REF]], i{{.+}} 0, i{{.+}} 0
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i{{.+}} 2
+// CHECK: [[PRIVATE_S_ARR_ELEM_REF:%.+]] = getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i{{.+}} -1
+// CHECK: call void [[S_INT_TY_DESTR]]([[S_INT_TY]]* [[PRIVATE_S_ARR_ELEM_REF]])
+// CHECK: icmp eq
+// CHECK: br i1
+// CHECK: ret i32
+
+#endif
+#else
+// ARRAY-LABEL: array_func
+struct St {
+ int a, b;
+ St() : a(0), b(0) {}
+ St(const St &) {}
+ ~St() {}
+};
+
+void array_func(int n, float a[n], St s[2]) {
+// ARRAY: call i8* @__kmpc_omp_task_alloc(
+// ARRAY: call void @__kmpc_taskloop(
+// ARRAY: store float** %{{.+}}, float*** %{{.+}},
+// ARRAY: store %struct.St** %{{.+}}, %struct.St*** %{{.+}},
+// ARRAY: icmp ne i32 %{{.+}}, 0
+// ARRAY: store float* %{{.+}}, float** %{{.+}},
+// ARRAY: store %struct.St* %{{.+}}, %struct.St** %{{.+}},
+#pragma omp master taskloop simd lastprivate(a, s)
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+#endif
+
diff --git a/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_lastprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_lastprivate_messages.cpp
new file mode 100644
index 0000000..ce9868e
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_lastprivate_messages.cpp
@@ -0,0 +1,305 @@
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp-simd %s -Wuninitialized
+
+typedef void **omp_allocator_handle_t;
+extern const omp_allocator_handle_t omp_default_mem_alloc;
+extern const omp_allocator_handle_t omp_large_cap_mem_alloc;
+extern const omp_allocator_handle_t omp_const_mem_alloc;
+extern const omp_allocator_handle_t omp_high_bw_mem_alloc;
+extern const omp_allocator_handle_t omp_low_lat_mem_alloc;
+extern const omp_allocator_handle_t omp_cgroup_mem_alloc;
+extern const omp_allocator_handle_t omp_pteam_mem_alloc;
+extern const omp_allocator_handle_t omp_thread_mem_alloc;
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+struct S1; // expected-note 2 {{declared here}} expected-note 2 {{forward declaration of 'S1'}}
+extern S1 a;
+class S2 {
+ mutable int a;
+
+public:
+ S2() : a(0) {}
+ S2(S2 &s2) : a(s2.a) {}
+ const S2 &operator =(const S2&) const;
+ S2 &operator =(const S2&);
+ static float S2s; // expected-note {{static data member is predetermined as shared}}
+ static const float S2sc; // expected-note {{'S2sc' declared here}}
+};
+const float S2::S2sc = 0;
+const S2 b;
+const S2 ba[5];
+class S3 {
+ int a;
+ S3 &operator=(const S3 &s3); // expected-note 2 {{implicitly declared private here}}
+
+public:
+ S3() : a(0) {}
+ S3(S3 &s3) : a(s3.a) {}
+};
+const S3 c; // expected-note {{'c' defined here}}
+const S3 ca[5]; // expected-note {{'ca' defined here}}
+extern const int f; // expected-note {{'f' declared here}}
+class S4 {
+ int a;
+ S4(); // expected-note 3 {{implicitly declared private here}}
+ S4(const S4 &s4);
+
+public:
+ S4(int v) : a(v) {}
+};
+class S5 {
+ int a;
+ S5() : a(0) {} // expected-note {{implicitly declared private here}}
+
+public:
+ S5(const S5 &s5) : a(s5.a) {}
+ S5(int v) : a(v) {}
+};
+class S6 {
+ int a;
+ S6() : a(0) {}
+
+public:
+ S6(const S6 &s6) : a(s6.a) {}
+ S6(int v) : a(v) {}
+};
+
+S3 h;
+#pragma omp threadprivate(h) // expected-note 2 {{defined as threadprivate or thread local}}
+
+template <class I, class C>
+int foomain(int argc, char **argv) {
+ I e(4);
+ I g(5);
+ int i, z;
+ int &j = i;
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate // expected-error {{expected '(' after 'lastprivate'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate() // expected-error {{expected expression}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(S1) // expected-error {{'S1' does not refer to a value}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(conditional: argc) lastprivate(conditional: // expected-error 2 {{use of undeclared identifier 'conditional'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(z, a, b) // expected-error {{lastprivate variable with incomplete type 'S1'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(argv[1]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(e, g) // expected-error 2 {{calling a private constructor of class 'S4'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(h) // expected-error {{threadprivate or thread local variable cannot be lastprivate}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+ {
+ int v = 0;
+ int i;
+#pragma omp master taskloop simd lastprivate(i) allocate(omp_thread_mem_alloc: i) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'master taskloop simd' directive}}
+ for (int k = 0; k < argc; ++k) {
+ i = k;
+ v += i;
+ }
+ }
+#pragma omp parallel shared(i)
+#pragma omp parallel private(i)
+#pragma omp master taskloop simd lastprivate(j)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(i)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+ return 0;
+}
+
+void bar(S4 a[2]) {
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(a)
+ for (int i = 0; i < 2; ++i)
+ foo();
+}
+
+namespace A {
+double x;
+#pragma omp threadprivate(x) // expected-note {{defined as threadprivate or thread local}}
+}
+namespace B {
+using A::x;
+}
+
+int main(int argc, char **argv) {
+ const int d = 5; // expected-note {{'d' defined here}}
+ const int da[5] = {0}; // expected-note {{'da' defined here}}
+ S4 e(4);
+ S5 g(5);
+ S3 m;
+ S6 n(2);
+ int i, z;
+ int &j = i;
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate // expected-error {{expected '(' after 'lastprivate'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate() // expected-error {{expected expression}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(argc, z)
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(S1) // expected-error {{'S1' does not refer to a value}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(a, b, c, d, f) // expected-error {{lastprivate variable with incomplete type 'S1'}} expected-error 1 {{const-qualified variable without mutable fields cannot be lastprivate}} expected-error 2 {{const-qualified variable cannot be lastprivate}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(argv[1]) // expected-error {{expected variable name}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(2 * 2) // expected-error {{expected variable name}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(ba)
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(ca) // expected-error {{const-qualified variable without mutable fields cannot be lastprivate}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(da) // expected-error {{const-qualified variable cannot be lastprivate}}
+ for (i = 0; i < argc; ++i)
+ foo();
+ int xa;
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(xa) // OK
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(S2::S2s) // expected-error {{shared variable cannot be lastprivate}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(S2::S2sc) // expected-error {{const-qualified variable cannot be lastprivate}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd safelen(5)
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(m) // expected-error {{'operator=' is a private member of 'S3'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(h) // expected-error {{threadprivate or thread local variable cannot be lastprivate}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(B::x) // expected-error {{threadprivate or thread local variable cannot be lastprivate}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd private(xa), lastprivate(xa) // expected-error {{private variable cannot be lastprivate}} expected-note {{defined as private}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(i) // omp45-note {{defined as lastprivate}}
+ for (i = 0; i < argc; ++i) // omp45-error {{loop iteration variable in the associated loop of 'omp master taskloop simd' directive may not be lastprivate, predetermined as linear}}
+ foo();
+#pragma omp parallel private(xa)
+#pragma omp master taskloop simd lastprivate(xa)
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel reduction(+ : xa)
+#pragma omp master taskloop simd lastprivate(xa)
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(j)
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd firstprivate(m) lastprivate(m) // expected-error {{'operator=' is a private member of 'S3'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(n) firstprivate(n) // OK
+ for (i = 0; i < argc; ++i)
+ foo();
+ static int si;
+#pragma omp master taskloop simd lastprivate(si) // OK
+ for (i = 0; i < argc; ++i)
+ si = i + 1;
+ return foomain<S4, S5>(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<S4, S5>' requested here}}
+}
diff --git a/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_linear_messages.cpp b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_linear_messages.cpp
new file mode 100644
index 0000000..fef7e3c
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_linear_messages.cpp
@@ -0,0 +1,268 @@
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+
+typedef void **omp_allocator_handle_t;
+extern const omp_allocator_handle_t omp_default_mem_alloc;
+extern const omp_allocator_handle_t omp_large_cap_mem_alloc;
+extern const omp_allocator_handle_t omp_const_mem_alloc;
+extern const omp_allocator_handle_t omp_high_bw_mem_alloc;
+extern const omp_allocator_handle_t omp_low_lat_mem_alloc;
+extern const omp_allocator_handle_t omp_cgroup_mem_alloc;
+extern const omp_allocator_handle_t omp_pteam_mem_alloc;
+extern const omp_allocator_handle_t omp_thread_mem_alloc;
+
+void xxx(int argc) {
+ int i, lin, step; // expected-note {{initialize the variable 'lin' to silence this warning}} expected-note {{initialize the variable 'step' to silence this warning}}
+#pragma omp master taskloop simd linear(i, lin : step) // expected-warning {{variable 'lin' is uninitialized when used here}} expected-warning {{variable 'step' is uninitialized when used here}}
+ for (i = 0; i < 10; ++i)
+ ;
+}
+
+namespace X {
+ int x;
+};
+
+struct B {
+ static int ib; // expected-note {{'B::ib' declared here}}
+ static int bfoo() { return 8; }
+};
+
+int bfoo() { return 4; }
+
+int z;
+const int C1 = 1;
+const int C2 = 2;
+void test_linear_colons()
+{
+ int B = 0;
+ #pragma omp master taskloop simd linear(B:bfoo())
+ for (int i = 0; i < 10; ++i) ;
+ // expected-error@+1 {{unexpected ':' in nested name specifier; did you mean '::'}}
+ #pragma omp master taskloop simd linear(B::ib:B:bfoo())
+ for (int i = 0; i < 10; ++i) ;
+ // expected-error@+1 {{use of undeclared identifier 'ib'; did you mean 'B::ib'}}
+ #pragma omp master taskloop simd linear(B:ib)
+ for (int i = 0; i < 10; ++i) ;
+ // expected-error@+1 {{unexpected ':' in nested name specifier; did you mean '::'?}}
+ #pragma omp master taskloop simd linear(z:B:ib)
+ for (int i = 0; i < 10; ++i) ;
+ #pragma omp master taskloop simd linear(B:B::bfoo())
+ for (int i = 0; i < 10; ++i) ;
+ #pragma omp master taskloop simd linear(X::x : ::z)
+ for (int i = 0; i < 10; ++i) ;
+ #pragma omp master taskloop simd linear(B,::z, X::x)
+ for (int i = 0; i < 10; ++i) ;
+ #pragma omp master taskloop simd linear(::z)
+ for (int i = 0; i < 10; ++i) ;
+ // expected-error@+1 {{expected variable name}}
+ #pragma omp master taskloop simd linear(B::bfoo())
+ for (int i = 0; i < 10; ++i) ;
+ #pragma omp master taskloop simd linear(B::ib,B:C1+C2)
+ for (int i = 0; i < 10; ++i) ;
+}
+
+template<int L, class T, class N> T test_template(T* arr, N num) {
+ N i;
+ T sum = (T)0;
+ T ind2 = - num * L; // expected-note {{'ind2' defined here}}
+ // expected-error@+1 {{argument of a linear clause should be of integral or pointer type}}
+#pragma omp master taskloop simd linear(ind2:L)
+ for (i = 0; i < num; ++i) {
+ T cur = arr[(int)ind2];
+ ind2 += L;
+ sum += cur;
+ }
+ return T();
+}
+
+template<int LEN> int test_warn() {
+ int ind2 = 0;
+ // expected-warning@+1 {{zero linear step (ind2 should probably be const)}}
+ #pragma omp master taskloop simd linear(ind2:LEN)
+ for (int i = 0; i < 100; i++) {
+ ind2 += LEN;
+ }
+ return ind2;
+}
+
+struct S1; // expected-note 2 {{declared here}} expected-note 2 {{forward declaration of 'S1'}}
+extern S1 a;
+class S2 {
+ mutable int a;
+public:
+ S2():a(0) { }
+};
+const S2 b; // expected-note 2 {{'b' defined here}}
+const S2 ba[5];
+class S3 {
+ int a;
+public:
+ S3():a(0) { }
+};
+const S3 ca[5];
+class S4 {
+ int a;
+ S4();
+public:
+ S4(int v):a(v) { }
+};
+class S5 {
+ int a;
+ S5():a(0) {}
+public:
+ S5(int v):a(v) { }
+};
+
+S3 h;
+#pragma omp threadprivate(h) // expected-note 2 {{defined as threadprivate or thread local}}
+
+template<class I, class C> int foomain(I argc, C **argv) {
+ I e(4);
+ I g(5);
+ int i, z;
+ int &j = i;
+ #pragma omp master taskloop simd linear // expected-error {{expected '(' after 'linear'}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd linear ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd linear (val // expected-error {{use of undeclared identifier 'val'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd linear (uval( // expected-error {{expected expression}} expected-error 2 {{expected ')'}} expected-note 2 {{to match this '('}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd linear (ref() // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd linear (foo() // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd linear () // expected-error {{expected expression}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd linear (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd linear (val argc // expected-error {{use of undeclared identifier 'val'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd linear (val(argc, // expected-error {{expected expression}} expected-error 2 {{expected ')'}} expected-note 2 {{to match this '('}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd linear (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd linear (argc : 5) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd linear (S1) // expected-error {{'S1' does not refer to a value}}
+ for (int k = 0; k < argc; ++k) ++k;
+ // expected-error@+2 {{linear variable with incomplete type 'S1'}}
+ // expected-error@+1 {{argument of a linear clause should be of integral or pointer type, not 'S2'}}
+ #pragma omp master taskloop simd linear (val(a, b):B::ib)
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd linear (argv[1]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd linear(ref(e, g)) // expected-error 2 {{variable of non-reference type 'int' can be used only with 'val' modifier, but used with 'ref'}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd linear(h, z) // expected-error {{threadprivate or thread local variable cannot be linear}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd linear(uval(i)) // expected-error {{variable of non-reference type 'int' can be used only with 'val' modifier, but used with 'uval'}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel
+ {
+ int v = 0;
+ int i;
+ #pragma omp master taskloop simd allocate(omp_thread_mem_alloc: v) linear(v:i) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'master taskloop simd' directive}}
+ for (int k = 0; k < argc; ++k) { i = k; v += i; }
+ }
+ #pragma omp master taskloop simd linear(ref(j))
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd linear(uval(j))
+ for (int k = 0; k < argc; ++k) ++k;
+ int v = 0;
+ #pragma omp master taskloop simd linear(v:j)
+ for (int k = 0; k < argc; ++k) { ++k; v += j; }
+ #pragma omp master taskloop simd linear(i)
+ for (int k = 0; k < argc; ++k) ++k;
+ return 0;
+}
+
+namespace A {
+double x;
+#pragma omp threadprivate(x) // expected-note {{defined as threadprivate or thread local}}
+}
+namespace C {
+using A::x;
+}
+
+void linear_modifiers(int argc) {
+ int &f = argc;
+ #pragma omp master taskloop simd linear(f)
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd linear(val(f))
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd linear(uval(f))
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd linear(ref(f))
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd linear(foo(f)) // expected-error {{expected one of 'ref', val' or 'uval' modifiers}}
+ for (int k = 0; k < argc; ++k) ++k;
+}
+
+int f;
+int main(int argc, char **argv) {
+ double darr[100];
+ // expected-note@+1 {{in instantiation of function template specialization 'test_template<-4, double, int>' requested here}}
+ test_template<-4>(darr, 4);
+ // expected-note@+1 {{in instantiation of function template specialization 'test_warn<0>' requested here}}
+ test_warn<0>();
+
+ S4 e(4); // expected-note {{'e' defined here}}
+ S5 g(5); // expected-note {{'g' defined here}}
+ int i, z;
+ int &j = i;
+ #pragma omp master taskloop simd linear(f) linear(f) // expected-error {{linear variable cannot be linear}} expected-note {{defined as linear}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd linear // expected-error {{expected '(' after 'linear'}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd linear ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd linear () // expected-error {{expected expression}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd linear (val // expected-error {{use of undeclared identifier 'val'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd linear (ref()) // expected-error {{expected expression}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd linear (foo()) // expected-error {{expected expression}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd linear (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd linear (argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd linear (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd linear (argc, z)
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd linear (S1) // expected-error {{'S1' does not refer to a value}}
+ for (int k = 0; k < argc; ++k) ++k;
+ // expected-error@+2 {{linear variable with incomplete type 'S1'}}
+ // expected-error@+1 {{argument of a linear clause should be of integral or pointer type, not 'S2'}}
+ #pragma omp master taskloop simd linear(a, b)
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd linear (argv[1]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k) ++k;
+ // expected-error@+2 {{argument of a linear clause should be of integral or pointer type, not 'S4'}}
+ // expected-error@+1 {{argument of a linear clause should be of integral or pointer type, not 'S5'}}
+ #pragma omp master taskloop simd linear(val(e, g))
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd linear(h, C::x) // expected-error 2 {{threadprivate or thread local variable cannot be linear}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel
+ {
+ int i;
+ #pragma omp master taskloop simd linear(val(i))
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd linear(uval(i) : 4) // expected-error {{variable of non-reference type 'int' can be used only with 'val' modifier, but used with 'uval'}}
+ for (int k = 0; k < argc; ++k) { ++k; i += 4; }
+ }
+ #pragma omp master taskloop simd linear(ref(j))
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp master taskloop simd linear(i)
+ for (int k = 0; k < argc; ++k) ++k;
+
+ foomain<int,char>(argc,argv); // expected-note {{in instantiation of function template specialization 'foomain<int, char>' requested here}}
+ return 0;
+}
+
diff --git a/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_loop_messages.cpp b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_loop_messages.cpp
new file mode 100644
index 0000000..e39dbce
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_loop_messages.cpp
@@ -0,0 +1,743 @@
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wuninitialized
+
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wuninitialized
+
+class S {
+ int a;
+ S() : a(0) {}
+
+public:
+ S(int v) : a(v) {}
+ S(const S &s) : a(s.a) {}
+};
+
+static int sii;
+// expected-note@+1 {{defined as threadprivate or thread local}}
+#pragma omp threadprivate(sii)
+static int globalii;
+
+// Currently, we cannot use "0" for global register variables.
+// register int reg0 __asm__("0");
+int reg0;
+
+int test_iteration_spaces() {
+ const int N = 100;
+ float a[N], b[N], c[N];
+ int ii, jj, kk;
+ float fii;
+ double dii;
+ register int reg; // expected-warning {{'register' storage class specifier is deprecated}}
+#pragma omp parallel
+#pragma omp master taskloop simd
+ for (int i = 0; i < 10; i += 1) {
+ c[i] = a[i] + b[i];
+ }
+#pragma omp parallel
+#pragma omp master taskloop simd
+ for (char i = 0; i < 10; i++) {
+ c[i] = a[i] + b[i];
+ }
+#pragma omp parallel
+#pragma omp master taskloop simd
+ for (char i = 0; i < 10; i += '\1') {
+ c[i] = a[i] + b[i];
+ }
+#pragma omp parallel
+#pragma omp master taskloop simd
+ for (long long i = 0; i < 10; i++) {
+ c[i] = a[i] + b[i];
+ }
+#pragma omp parallel
+// expected-error@+2 {{expression must have integral or unscoped enumeration type, not 'double'}}
+#pragma omp master taskloop simd
+ for (long long i = 0; i < 10; i += 1.5) {
+ c[i] = a[i] + b[i];
+ }
+#pragma omp parallel
+#pragma omp master taskloop simd
+ for (long long i = 0; i < 'z'; i += 1u) {
+ c[i] = a[i] + b[i];
+ }
+#pragma omp parallel
+// expected-error@+2 {{variable must be of integer or random access iterator type}}
+#pragma omp master taskloop simd
+ for (float fi = 0; fi < 10.0; fi++) {
+ c[(int)fi] = a[(int)fi] + b[(int)fi];
+ }
+#pragma omp parallel
+// expected-error@+2 {{variable must be of integer or random access iterator type}}
+#pragma omp master taskloop simd
+ for (double fi = 0; fi < 10.0; fi++) {
+ c[(int)fi] = a[(int)fi] + b[(int)fi];
+ }
+#pragma omp parallel
+// expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp master taskloop simd
+ for (int &ref = ii; ref < 10; ref++) {
+ }
+#pragma omp parallel
+// expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp master taskloop simd
+ for (int i; i < 10; i++)
+ c[i] = a[i];
+
+#pragma omp parallel
+// expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp master taskloop simd
+ for (int i = 0, j = 0; i < 10; ++i)
+ c[i] = a[i];
+
+#pragma omp parallel
+// expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp master taskloop simd
+ for (; ii < 10; ++ii)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-warning@+3 {{expression result unused}}
+// expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp master taskloop simd
+ for (ii + 1; ii < 10; ++ii)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp master taskloop simd
+ for (c[ii] = 0; ii < 10; ++ii)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// Ok to skip parenthesises.
+#pragma omp master taskloop simd
+ for (((ii)) = 0; ii < 10; ++ii)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
+#pragma omp master taskloop simd
+ for (int i = 0; i; i++)
+ c[i] = a[i];
+
+#pragma omp parallel
+// omp4-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'i'}}
+#pragma omp master taskloop simd
+ for (int i = 0; jj < kk; ii++)
+ c[i] = a[i];
+
+#pragma omp parallel
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
+#pragma omp master taskloop simd
+ for (int i = 0; !!i; i++)
+ c[i] = a[i];
+
+#pragma omp parallel
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+#pragma omp master taskloop simd
+ for (int i = 0; i != 1; i++)
+ c[i] = a[i];
+
+#pragma omp parallel
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
+#pragma omp master taskloop simd
+ for (int i = 0;; i++)
+ c[i] = a[i];
+
+#pragma omp parallel
+// Ok.
+#pragma omp master taskloop simd
+ for (int i = 11; i > 10; i--)
+ c[i] = a[i];
+
+#pragma omp parallel
+// Ok.
+#pragma omp master taskloop simd
+ for (int i = 0; i < 10; ++i)
+ c[i] = a[i];
+
+#pragma omp parallel
+// Ok.
+#pragma omp master taskloop simd
+ for (ii = 0; ii < 10; ++ii)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
+#pragma omp master taskloop simd
+ for (ii = 0; ii < 10; ++jj)
+ c[ii] = a[jj];
+
+#pragma omp parallel
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
+#pragma omp master taskloop simd
+ for (ii = 0; ii < 10; ++++ii)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// Ok but undefined behavior (in general, cannot check that incr
+// is really loop-invariant).
+#pragma omp master taskloop simd
+ for (ii = 0; ii < 10; ii = ii + ii)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-error@+2 {{expression must have integral or unscoped enumeration type, not 'float'}}
+#pragma omp master taskloop simd
+ for (ii = 0; ii < 10; ii = ii + 1.0f)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// Ok - step was converted to integer type.
+#pragma omp master taskloop simd
+ for (ii = 0; ii < 10; ii = ii + (int)1.1f)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
+#pragma omp master taskloop simd
+ for (ii = 0; ii < 10; jj = ii + 2)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-warning@+3 {{relational comparison result unused}}
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
+#pragma omp master taskloop simd
+ for (ii = 0; ii<10; jj> kk + 2)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
+#pragma omp master taskloop simd
+ for (ii = 0; ii < 10;)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-warning@+3 {{expression result unused}}
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
+#pragma omp master taskloop simd
+ for (ii = 0; ii < 10; !ii)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
+#pragma omp master taskloop simd
+ for (ii = 0; ii < 10; ii ? ++ii : ++jj)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
+#pragma omp master taskloop simd
+ for (ii = 0; ii < 10; ii = ii < 10)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be positive due to this condition}}
+// expected-error@+2 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
+#pragma omp master taskloop simd
+ for (ii = 0; ii < 10; ii = ii + 0)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be positive due to this condition}}
+// expected-error@+2 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
+#pragma omp master taskloop simd
+ for (ii = 0; ii < 10; ii = ii + (int)(0.8 - 0.45))
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be positive due to this condition}}
+// expected-error@+2 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
+#pragma omp master taskloop simd
+ for (ii = 0; (ii) < 10; ii -= 25)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be positive due to this condition}}
+// expected-error@+2 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
+#pragma omp master taskloop simd
+ for (ii = 0; (ii < 10); ii -= 0)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be negative due to this condition}}
+// expected-error@+2 {{increment expression must cause 'ii' to decrease on each iteration of OpenMP for loop}}
+#pragma omp master taskloop simd
+ for (ii = 0; ii > 10; (ii += 0))
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be positive due to this condition}}
+// expected-error@+2 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
+#pragma omp master taskloop simd
+ for (ii = 0; ii < 10; (ii) = (1 - 1) + (ii))
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be negative due to this condition}}
+// expected-error@+2 {{increment expression must cause 'ii' to decrease on each iteration of OpenMP for loop}}
+#pragma omp master taskloop simd
+ for ((ii = 0); ii > 10; (ii -= 0))
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be positive due to this condition}}
+// expected-error@+2 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
+#pragma omp master taskloop simd
+ for (ii = 0; (ii < 10); (ii -= 0))
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-note@+2 {{defined as firstprivate}}
+// expected-error@+2 {{loop iteration variable in the associated loop of 'omp master taskloop simd' directive may not be firstprivate, predetermined as linear}}
+#pragma omp master taskloop simd firstprivate(ii)
+ for (ii = 0; ii < 10; ii++)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+#pragma omp master taskloop simd linear(ii)
+ for (ii = 0; ii < 10; ii++)
+ c[ii] = a[ii];
+
+// omp4-note@+3 {{defined as private}}
+// omp4-error@+3 {{loop iteration variable in the associated loop of 'omp master taskloop simd' directive may not be private, predetermined as linear}}
+#pragma omp parallel
+#pragma omp master taskloop simd private(ii)
+ for (ii = 0; ii < 10; ii++)
+ c[ii] = a[ii];
+
+// omp4-note@+3 {{defined as lastprivate}}
+// omp4-error@+3 {{loop iteration variable in the associated loop of 'omp master taskloop simd' directive may not be lastprivate, predetermined as linear}}
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(ii)
+ for (ii = 0; ii < 10; ii++)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+ {
+// expected-error@+2 {{loop iteration variable in the associated loop of 'omp master taskloop simd' directive may not be threadprivate or thread local, predetermined as linear}}
+#pragma omp master taskloop simd
+ for (sii = 0; sii < 10; sii += 1)
+ c[sii] = a[sii];
+ }
+
+#pragma omp parallel
+ {
+#pragma omp master taskloop simd
+ for (reg0 = 0; reg0 < 10; reg0 += 1)
+ c[reg0] = a[reg0];
+ }
+
+#pragma omp parallel
+ {
+#pragma omp master taskloop simd
+ for (reg = 0; reg < 10; reg += 1)
+ c[reg] = a[reg];
+ }
+
+#pragma omp parallel
+ {
+#pragma omp master taskloop simd
+ for (globalii = 0; globalii < 10; globalii += 1)
+ c[globalii] = a[globalii];
+ }
+
+#pragma omp parallel
+ {
+#pragma omp master taskloop simd collapse(2)
+ for (ii = 0; ii < 10; ii += 1)
+ for (globalii = 0; globalii < 10; globalii += 1)
+ c[globalii] += a[globalii] + ii;
+ }
+
+#pragma omp parallel
+// omp4-error@+2 {{statement after '#pragma omp master taskloop simd' must be a for loop}}
+#pragma omp master taskloop simd
+ for (auto &item : a) {
+ item = item + 1;
+ }
+
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be positive due to this condition}}
+// expected-error@+2 {{increment expression must cause 'i' to increase on each iteration of OpenMP for loop}}
+#pragma omp master taskloop simd
+ for (unsigned i = 9; i < 10; i--) {
+ c[i] = a[i] + b[i];
+ }
+
+ int(*lb)[4] = nullptr;
+#pragma omp parallel
+#pragma omp master taskloop simd
+ for (int(*p)[4] = lb; p < lb + 8; ++p) {
+ }
+
+#pragma omp parallel
+// expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp master taskloop simd
+ for (int a{0}; a < 10; ++a) {
+ }
+
+ return 0;
+}
+
+// Iterators allowed in openmp for-loops.
+namespace std {
+struct random_access_iterator_tag {};
+template <class Iter>
+struct iterator_traits {
+ typedef typename Iter::difference_type difference_type;
+ typedef typename Iter::iterator_category iterator_category;
+};
+template <class Iter>
+typename iterator_traits<Iter>::difference_type
+distance(Iter first, Iter last) { return first - last; }
+}
+class Iter0 {
+public:
+ Iter0() {}
+ Iter0(const Iter0 &) {}
+ Iter0 operator++() { return *this; }
+ Iter0 operator--() { return *this; }
+ bool operator<(Iter0 a) { return true; }
+};
+// expected-note@+2 {{candidate function not viable: no known conversion from 'GoodIter' to 'Iter0' for 1st argument}}
+// expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter1' to 'Iter0' for 1st argument}}
+int operator-(Iter0 a, Iter0 b) { return 0; }
+class Iter1 {
+public:
+ Iter1(float f = 0.0f, double d = 0.0) {}
+ Iter1(const Iter1 &) {}
+ Iter1 operator++() { return *this; }
+ Iter1 operator--() { return *this; }
+ bool operator<(Iter1 a) { return true; }
+ bool operator>=(Iter1 a) { return false; }
+};
+class GoodIter {
+public:
+ GoodIter() {}
+ GoodIter(const GoodIter &) {}
+ GoodIter(int fst, int snd) {}
+ GoodIter &operator=(const GoodIter &that) { return *this; }
+ GoodIter &operator=(const Iter0 &that) { return *this; }
+ GoodIter &operator+=(int x) { return *this; }
+ GoodIter &operator-=(int x) { return *this; }
+ explicit GoodIter(void *) {}
+ GoodIter operator++() { return *this; }
+ GoodIter operator--() { return *this; }
+ bool operator!() { return true; }
+ bool operator<(GoodIter a) { return true; }
+ bool operator<=(GoodIter a) { return true; }
+ bool operator>=(GoodIter a) { return false; }
+ typedef int difference_type;
+ typedef std::random_access_iterator_tag iterator_category;
+};
+// expected-note@+2 {{candidate function not viable: no known conversion from 'const Iter0' to 'GoodIter' for 2nd argument}}
+// expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter1' to 'GoodIter' for 1st argument}}
+int operator-(GoodIter a, GoodIter b) { return 0; }
+// expected-note@+1 3 {{candidate function not viable: requires single argument 'a', but 2 arguments were provided}}
+GoodIter operator-(GoodIter a) { return a; }
+// expected-note@+2 {{candidate function not viable: no known conversion from 'const Iter0' to 'int' for 2nd argument}}
+// expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter1' to 'GoodIter' for 1st argument}}
+GoodIter operator-(GoodIter a, int v) { return GoodIter(); }
+// expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter0' to 'GoodIter' for 1st argument}}
+GoodIter operator+(GoodIter a, int v) { return GoodIter(); }
+// expected-note@+2 {{candidate function not viable: no known conversion from 'GoodIter' to 'int' for 1st argument}}
+// expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter1' to 'int' for 1st argument}}
+GoodIter operator-(int v, GoodIter a) { return GoodIter(); }
+// expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter0' to 'int' for 1st argument}}
+GoodIter operator+(int v, GoodIter a) { return GoodIter(); }
+
+int test_with_random_access_iterator() {
+ GoodIter begin, end;
+ Iter0 begin0, end0;
+#pragma omp parallel
+#pragma omp master taskloop simd
+ for (GoodIter I = begin; I < end; ++I)
+ ++I;
+#pragma omp parallel
+// expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp master taskloop simd
+ for (GoodIter &I = begin; I < end; ++I)
+ ++I;
+#pragma omp parallel
+#pragma omp master taskloop simd
+ for (GoodIter I = begin; I >= end; --I)
+ ++I;
+#pragma omp parallel
+// expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp master taskloop simd
+ for (GoodIter I(begin); I < end; ++I)
+ ++I;
+#pragma omp parallel
+// expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp master taskloop simd
+ for (GoodIter I(nullptr); I < end; ++I)
+ ++I;
+#pragma omp parallel
+// expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp master taskloop simd
+ for (GoodIter I(0); I < end; ++I)
+ ++I;
+#pragma omp parallel
+// expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp master taskloop simd
+ for (GoodIter I(1, 2); I < end; ++I)
+ ++I;
+#pragma omp parallel
+#pragma omp master taskloop simd
+ for (begin = GoodIter(0); begin < end; ++begin)
+ ++begin;
+// expected-error@+4 {{invalid operands to binary expression ('GoodIter' and 'const Iter0')}}
+// expected-error@+3 {{could not calculate number of iterations calling 'operator-' with upper and lower loop bounds}}
+#pragma omp parallel
+#pragma omp master taskloop simd
+ for (begin = begin0; begin < end; ++begin)
+ ++begin;
+#pragma omp parallel
+// expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp master taskloop simd
+ for (++begin; begin < end; ++begin)
+ ++begin;
+#pragma omp parallel
+#pragma omp master taskloop simd
+ for (begin = end; begin < end; ++begin)
+ ++begin;
+#pragma omp parallel
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
+#pragma omp master taskloop simd
+ for (GoodIter I = begin; I - I; ++I)
+ ++I;
+#pragma omp parallel
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
+#pragma omp master taskloop simd
+ for (GoodIter I = begin; begin < end; ++I)
+ ++I;
+#pragma omp parallel
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
+#pragma omp master taskloop simd
+ for (GoodIter I = begin; !I; ++I)
+ ++I;
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be negative due to this condition}}
+// expected-error@+2 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
+#pragma omp master taskloop simd
+ for (GoodIter I = begin; I >= end; I = I + 1)
+ ++I;
+#pragma omp parallel
+#pragma omp master taskloop simd
+ for (GoodIter I = begin; I >= end; I = I - 1)
+ ++I;
+#pragma omp parallel
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'I'}}
+#pragma omp master taskloop simd
+ for (GoodIter I = begin; I >= end; I = -I)
+ ++I;
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be negative due to this condition}}
+// expected-error@+2 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
+#pragma omp master taskloop simd
+ for (GoodIter I = begin; I >= end; I = 2 + I)
+ ++I;
+#pragma omp parallel
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'I'}}
+#pragma omp master taskloop simd
+ for (GoodIter I = begin; I >= end; I = 2 - I)
+ ++I;
+// In the following example, we cannot update the loop variable using '+='
+// expected-error@+3 {{invalid operands to binary expression ('Iter0' and 'int')}}
+#pragma omp parallel
+#pragma omp master taskloop simd
+ for (Iter0 I = begin0; I < end0; ++I)
+ ++I;
+#pragma omp parallel
+// Initializer is constructor without params.
+// expected-error@+3 {{invalid operands to binary expression ('Iter0' and 'int')}}
+// expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp master taskloop simd
+ for (Iter0 I; I < end0; ++I)
+ ++I;
+ Iter1 begin1, end1;
+// expected-error@+4 {{invalid operands to binary expression ('Iter1' and 'Iter1')}}
+// expected-error@+3 {{could not calculate number of iterations calling 'operator-' with upper and lower loop bounds}}
+#pragma omp parallel
+#pragma omp master taskloop simd
+ for (Iter1 I = begin1; I < end1; ++I)
+ ++I;
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be negative due to this condition}}
+// expected-error@+2 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
+#pragma omp master taskloop simd
+ for (Iter1 I = begin1; I >= end1; ++I)
+ ++I;
+#pragma omp parallel
+// expected-error@+5 {{invalid operands to binary expression ('Iter1' and 'float')}}
+// expected-error@+4 {{could not calculate number of iterations calling 'operator-' with upper and lower loop bounds}}
+// Initializer is constructor with all default params.
+// expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp master taskloop simd
+ for (Iter1 I; I < end1; ++I) {
+ }
+ return 0;
+}
+
+template <typename IT, int ST>
+class TC {
+public:
+ int dotest_lt(IT begin, IT end) {
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be positive due to this condition}}
+// expected-error@+2 {{increment expression must cause 'I' to increase on each iteration of OpenMP for loop}}
+#pragma omp master taskloop simd
+ for (IT I = begin; I < end; I = I + ST) {
+ ++I;
+ }
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be positive due to this condition}}
+// expected-error@+2 {{increment expression must cause 'I' to increase on each iteration of OpenMP for loop}}
+#pragma omp master taskloop simd
+ for (IT I = begin; I <= end; I += ST) {
+ ++I;
+ }
+#pragma omp parallel
+#pragma omp master taskloop simd
+ for (IT I = begin; I < end; ++I) {
+ ++I;
+ }
+ }
+
+ static IT step() {
+ return IT(ST);
+ }
+};
+template <typename IT, int ST = 0>
+int dotest_gt(IT begin, IT end) {
+#pragma omp parallel
+// expected-note@+3 2 {{loop step is expected to be negative due to this condition}}
+// expected-error@+2 2 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
+#pragma omp master taskloop simd
+ for (IT I = begin; I >= end; I = I + ST) {
+ ++I;
+ }
+#pragma omp parallel
+// expected-note@+3 2 {{loop step is expected to be negative due to this condition}}
+// expected-error@+2 2 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
+#pragma omp master taskloop simd
+ for (IT I = begin; I >= end; I += ST) {
+ ++I;
+ }
+
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be negative due to this condition}}
+// expected-error@+2 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
+#pragma omp master taskloop simd
+ for (IT I = begin; I >= end; ++I) {
+ ++I;
+ }
+
+#pragma omp parallel
+#pragma omp master taskloop simd
+ for (IT I = begin; I < end; I += TC<int, ST>::step()) {
+ ++I;
+ }
+}
+
+void test_with_template() {
+ GoodIter begin, end;
+ TC<GoodIter, 100> t1;
+ TC<GoodIter, -100> t2;
+ t1.dotest_lt(begin, end);
+ t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC<GoodIter, -100>::dotest_lt' requested here}}
+ dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt<GoodIter, 0>' requested here}}
+ dotest_gt<unsigned, 10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, 10>' requested here}}
+}
+
+void test_loop_break() {
+ const int N = 100;
+ float a[N], b[N], c[N];
+#pragma omp parallel
+#pragma omp master taskloop simd
+ for (int i = 0; i < 10; i++) {
+ c[i] = a[i] + b[i];
+ for (int j = 0; j < 10; ++j) {
+ if (a[i] > b[j])
+ break; // OK in nested loop
+ }
+ switch (i) {
+ case 1:
+ b[i]++;
+ break;
+ default:
+ break;
+ }
+ if (c[i] > 10)
+ break; // expected-error {{'break' statement cannot be used in OpenMP for loop}}
+
+ if (c[i] > 11)
+ break; // expected-error {{'break' statement cannot be used in OpenMP for loop}}
+ }
+
+#pragma omp parallel
+#pragma omp master taskloop simd
+ for (int i = 0; i < 10; i++) {
+ for (int j = 0; j < 10; j++) {
+ c[i] = a[i] + b[i];
+ if (c[i] > 10) {
+ if (c[i] < 20) {
+ break; // OK
+ }
+ }
+ }
+ }
+}
+
+void test_loop_eh() {
+ const int N = 100;
+ float a[N], b[N], c[N];
+#pragma omp parallel
+#pragma omp master taskloop simd
+ for (int i = 0; i < 10; i++) {
+ c[i] = a[i] + b[i];
+ try { // expected-error {{'try' statement cannot be used in OpenMP simd region}}
+ for (int j = 0; j < 10; ++j) {
+ if (a[i] > b[j])
+ throw a[i]; // expected-error {{'throw' statement cannot be used in OpenMP simd region}}
+ }
+ throw a[i]; // expected-error {{'throw' statement cannot be used in OpenMP simd region}}
+ } catch (float f) {
+ if (f > 0.1)
+ throw a[i]; // expected-error {{'throw' statement cannot be used in OpenMP simd region}}
+ return; // expected-error {{cannot return from OpenMP region}}
+ }
+ switch (i) {
+ case 1:
+ b[i]++;
+ break;
+ default:
+ break;
+ }
+ for (int j = 0; j < 10; j++) {
+ if (c[i] > 10)
+ throw c[i]; // expected-error {{'throw' statement cannot be used in OpenMP simd region}}
+ }
+ }
+ if (c[9] > 10)
+ throw c[9]; // OK
+
+#pragma omp parallel
+#pragma omp master taskloop simd
+ for (int i = 0; i < 10; ++i) {
+ struct S {
+ void g() { throw 0; }
+ };
+ }
+}
+
+void test_loop_firstprivate_lastprivate() {
+ S s(4);
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(s) firstprivate(s)
+ for (int i = 0; i < 16; ++i)
+ ;
+}
+
diff --git a/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_misc_messages.c b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_misc_messages.c
new file mode 100644
index 0000000..f9de786
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_misc_messages.c
@@ -0,0 +1,471 @@
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=45 -verify=expected,omp45 -triple x86_64-unknown-unknown %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -verify=expected,omp50 -triple x86_64-unknown-unknown %s -Wuninitialized
+
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=45 -verify=expected,omp45 -triple x86_64-unknown-unknown %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -verify=expected,omp50 -triple x86_64-unknown-unknown %s -Wuninitialized
+
+void xxx(int argc) {
+ int x; // expected-note {{initialize the variable 'x' to silence this warning}}
+#pragma omp master taskloop simd
+ for (int i = 0; i < 10; ++i)
+ argc = x; // expected-warning {{variable 'x' is uninitialized when used here}}
+}
+
+// expected-error@+1 {{unexpected OpenMP directive '#pragma omp master taskloop simd'}}
+#pragma omp master taskloop simd
+
+// expected-error@+1 {{unexpected OpenMP directive '#pragma omp master taskloop simd'}}
+#pragma omp master taskloop simd foo
+
+void test_no_clause() {
+ int i;
+#pragma omp master taskloop simd
+ for (i = 0; i < 16; ++i)
+ ;
+
+// expected-error@+2 {{statement after '#pragma omp master taskloop simd' must be a for loop}}
+#pragma omp master taskloop simd
+ ++i;
+}
+
+void test_branch_protected_scope() {
+ int i = 0;
+L1:
+ ++i;
+
+ int x[24];
+
+#pragma omp parallel
+#pragma omp master taskloop simd
+ for (i = 0; i < 16; ++i) {
+ if (i == 5)
+ goto L1; // expected-error {{use of undeclared label 'L1'}}
+ else if (i == 6)
+ return; // expected-error {{cannot return from OpenMP region}}
+ else if (i == 7)
+ goto L2;
+ else if (i == 8) {
+ L2:
+ x[i]++;
+ }
+ }
+
+ if (x[0] == 0)
+ goto L2; // expected-error {{use of undeclared label 'L2'}}
+ else if (x[1] == 1)
+ goto L1;
+}
+
+void test_invalid_clause() {
+ int i;
+#pragma omp parallel
+// expected-warning@+1 {{extra tokens at the end of '#pragma omp master taskloop simd' are ignored}}
+#pragma omp master taskloop simd foo bar
+ for (i = 0; i < 16; ++i)
+ ;
+// expected-error@+1 {{directive '#pragma omp master taskloop simd' cannot contain more than one 'nogroup' clause}}
+#pragma omp master taskloop simd nogroup nogroup
+ for (i = 0; i < 16; ++i)
+ ;
+}
+
+void test_non_identifiers() {
+ int i, x;
+
+#pragma omp parallel
+// expected-warning@+1 {{extra tokens at the end of '#pragma omp master taskloop simd' are ignored}}
+#pragma omp master taskloop simd;
+ for (i = 0; i < 16; ++i)
+ ;
+// expected-warning@+2 {{extra tokens at the end of '#pragma omp master taskloop simd' are ignored}}
+#pragma omp parallel
+#pragma omp master taskloop simd linear(x);
+ for (i = 0; i < 16; ++i)
+ ;
+
+#pragma omp parallel
+// expected-warning@+1 {{extra tokens at the end of '#pragma omp master taskloop simd' are ignored}}
+#pragma omp master taskloop simd private(x);
+ for (i = 0; i < 16; ++i)
+ ;
+
+#pragma omp parallel
+// expected-warning@+1 {{extra tokens at the end of '#pragma omp master taskloop simd' are ignored}}
+#pragma omp master taskloop simd, private(x);
+ for (i = 0; i < 16; ++i)
+ ;
+}
+
+extern int foo();
+
+void test_collapse() {
+ int i;
+#pragma omp parallel
+// expected-error@+1 {{expected '('}}
+#pragma omp master taskloop simd collapse
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp master taskloop simd collapse(
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected expression}}
+#pragma omp master taskloop simd collapse()
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp master taskloop simd collapse(,
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp master taskloop simd collapse(, )
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-warning@+2 {{extra tokens at the end of '#pragma omp master taskloop simd' are ignored}}
+// expected-error@+1 {{expected '('}}
+#pragma omp master taskloop simd collapse 4)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}}
+// expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}}
+#pragma omp master taskloop simd collapse(4
+ for (i = 0; i < 16; ++i)
+ ; // expected-error {{expected 4 for loops after '#pragma omp master taskloop simd', but found only 1}}
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}}
+// expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}}
+#pragma omp master taskloop simd collapse(4,
+ for (i = 0; i < 16; ++i)
+ ; // expected-error {{expected 4 for loops after '#pragma omp master taskloop simd', but found only 1}}
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}}
+// expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}}
+#pragma omp master taskloop simd collapse(4, )
+ for (i = 0; i < 16; ++i)
+ ; // expected-error {{expected 4 for loops after '#pragma omp master taskloop simd', but found only 1}}
+#pragma omp parallel
+// expected-note@+1 {{as specified in 'collapse' clause}}
+#pragma omp master taskloop simd collapse(4)
+ for (i = 0; i < 16; ++i)
+ ; // expected-error {{expected 4 for loops after '#pragma omp master taskloop simd', but found only 1}}
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}}
+// expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}}
+#pragma omp master taskloop simd collapse(4 4)
+ for (i = 0; i < 16; ++i)
+ ; // expected-error {{expected 4 for loops after '#pragma omp master taskloop simd', but found only 1}}
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}}
+// expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}}
+#pragma omp master taskloop simd collapse(4, , 4)
+ for (i = 0; i < 16; ++i)
+ ; // expected-error {{expected 4 for loops after '#pragma omp master taskloop simd', but found only 1}}
+#pragma omp parallel
+#pragma omp master taskloop simd collapse(4)
+ for (int i1 = 0; i1 < 16; ++i1)
+ for (int i2 = 0; i2 < 16; ++i2)
+ for (int i3 = 0; i3 < 16; ++i3)
+ for (int i4 = 0; i4 < 16; ++i4)
+ foo();
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}}
+// expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}}
+#pragma omp master taskloop simd collapse(4, 8)
+ for (i = 0; i < 16; ++i)
+ ; // expected-error {{expected 4 for loops after '#pragma omp master taskloop simd', but found only 1}}
+#pragma omp parallel
+// expected-error@+1 {{expression is not an integer constant expression}}
+#pragma omp master taskloop simd collapse(2.5)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expression is not an integer constant expression}}
+#pragma omp master taskloop simd collapse(foo())
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}}
+#pragma omp master taskloop simd collapse(-5)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}}
+#pragma omp master taskloop simd collapse(0)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}}
+#pragma omp master taskloop simd collapse(5 - 5)
+ for (i = 0; i < 16; ++i)
+ ;
+}
+
+void test_private() {
+ int i;
+#pragma omp parallel
+// expected-error@+2 {{expected expression}}
+// expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp master taskloop simd private(
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
+// expected-error@+1 2 {{expected expression}}
+#pragma omp master taskloop simd private(,
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 2 {{expected expression}}
+#pragma omp master taskloop simd private(, )
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected expression}}
+#pragma omp master taskloop simd private()
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected expression}}
+#pragma omp master taskloop simd private(int)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected variable name}}
+#pragma omp master taskloop simd private(0)
+ for (i = 0; i < 16; ++i)
+ ;
+
+ int x, y, z;
+#pragma omp parallel
+#pragma omp master taskloop simd private(x)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+#pragma omp master taskloop simd private(x, y)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+#pragma omp master taskloop simd private(x, y, z)
+ for (i = 0; i < 16; ++i) {
+ x = y * i + z;
+ }
+}
+
+void test_lastprivate() {
+ int i;
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
+// expected-error@+1 {{expected expression}}
+#pragma omp master taskloop simd lastprivate(
+ for (i = 0; i < 16; ++i)
+ ;
+
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
+// expected-error@+1 2 {{expected expression}}
+#pragma omp master taskloop simd lastprivate(,
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 2 {{expected expression}}
+#pragma omp master taskloop simd lastprivate(, )
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected expression}}
+#pragma omp master taskloop simd lastprivate()
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected expression}}
+#pragma omp master taskloop simd lastprivate(int)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected variable name}}
+#pragma omp master taskloop simd lastprivate(0)
+ for (i = 0; i < 16; ++i)
+ ;
+
+ int x, y, z;
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(x)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(x, y)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(x, y, z)
+ for (i = 0; i < 16; ++i)
+ ;
+}
+
+void test_firstprivate() {
+ int i;
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
+// expected-error@+1 {{expected expression}}
+#pragma omp master taskloop simd firstprivate(
+ for (i = 0; i < 16; ++i)
+ ;
+
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
+// expected-error@+1 2 {{expected expression}}
+#pragma omp master taskloop simd firstprivate(,
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 2 {{expected expression}}
+#pragma omp master taskloop simd firstprivate(, )
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected expression}}
+#pragma omp master taskloop simd firstprivate()
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected expression}}
+#pragma omp master taskloop simd firstprivate(int)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected variable name}}
+#pragma omp master taskloop simd firstprivate(0)
+ for (i = 0; i < 16; ++i)
+ ;
+
+ int x, y, z;
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(x) firstprivate(x)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(x, y) firstprivate(x, y)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+#pragma omp master taskloop simd lastprivate(x, y, z) firstprivate(x, y, z)
+ for (i = 0; i < 16; ++i)
+ ;
+// expected-error@+1 {{the value of 'simdlen' parameter must be less than or equal to the value of the 'safelen' parameter}}
+#pragma omp master taskloop simd simdlen(64) safelen(8)
+ for (i = 0; i < 16; ++i)
+ ;
+}
+
+void test_loop_messages() {
+ float a[100], b[100], c[100];
+#pragma omp parallel
+// expected-error@+2 {{variable must be of integer or pointer type}}
+#pragma omp master taskloop simd
+ for (float fi = 0; fi < 10.0; fi++) {
+ c[(int)fi] = a[(int)fi] + b[(int)fi];
+ }
+#pragma omp parallel
+// expected-error@+2 {{variable must be of integer or pointer type}}
+#pragma omp master taskloop simd
+ for (double fi = 0; fi < 10.0; fi++) {
+ c[(int)fi] = a[(int)fi] + b[(int)fi];
+ }
+
+ // expected-warning@+2 {{OpenMP loop iteration variable cannot have more than 64 bits size and will be narrowed}}
+ #pragma omp master taskloop simd
+ for (__int128 ii = 0; ii < 10; ii++) {
+ c[ii] = a[ii] + b[ii];
+ }
+}
+
+void test_nontemporal() {
+ int i;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp master taskloop simd'}} expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp master taskloop simd nontemporal(
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp master taskloop simd'}} expected-error@+1 2 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp master taskloop simd nontemporal(,
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp master taskloop simd'}} expected-error@+1 2 {{expected expression}}
+#pragma omp master taskloop simd nontemporal(, )
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp master taskloop simd'}} expected-error@+1 {{expected expression}}
+#pragma omp master taskloop simd nontemporal()
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp master taskloop simd'}} expected-error@+1 {{expected expression}}
+#pragma omp master taskloop simd nontemporal(int)
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp master taskloop simd'}} omp50-error@+1 {{expected variable name}}
+#pragma omp master taskloop simd nontemporal(0)
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp master taskloop simd'}} expected-error@+1 {{use of undeclared identifier 'x'}}
+#pragma omp master taskloop simd nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+// expected-error@+2 {{use of undeclared identifier 'x'}}
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp master taskloop simd'}} expected-error@+1 {{use of undeclared identifier 'y'}}
+#pragma omp master taskloop simd nontemporal(x, y)
+ for (i = 0; i < 16; ++i)
+ ;
+// expected-error@+3 {{use of undeclared identifier 'x'}}
+// expected-error@+2 {{use of undeclared identifier 'y'}}
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp master taskloop simd'}} expected-error@+1 {{use of undeclared identifier 'z'}}
+#pragma omp master taskloop simd nontemporal(x, y, z)
+ for (i = 0; i < 16; ++i)
+ ;
+
+ int x, y;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp master taskloop simd'}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp master taskloop simd nontemporal(x :)
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp master taskloop simd'}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}}
+#pragma omp master taskloop simd nontemporal(x :, )
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp50-note@+2 {{defined as nontemporal}}
+// omp45-error@+1 2 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp master taskloop simd'}} omp50-error@+1 {{a variable cannot appear in more than one nontemporal clause}}
+#pragma omp master taskloop simd nontemporal(x) nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp master taskloop simd'}}
+#pragma omp master taskloop simd private(x) nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp master taskloop simd'}}
+#pragma omp master taskloop simd nontemporal(x) private(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp master taskloop simd'}} expected-note@+1 {{to match this '('}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}} expected-error@+1 {{expected ')'}}
+#pragma omp master taskloop simd nontemporal(x, y : 0)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp master taskloop simd'}}
+#pragma omp master taskloop simd nontemporal(x) lastprivate(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp master taskloop simd'}}
+#pragma omp master taskloop simd lastprivate(x) nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+}
+
diff --git a/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_num_tasks_messages.cpp b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_num_tasks_messages.cpp
new file mode 100644
index 0000000..db134df
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_num_tasks_messages.cpp
@@ -0,0 +1,103 @@
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+struct S1; // expected-note {{declared here}}
+
+template <class T, class S> // expected-note {{declared here}}
+int tmain(T argc, S **argv) {
+ T z;
+ #pragma omp master taskloop simd num_tasks // expected-error {{expected '(' after 'num_tasks'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd num_tasks ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd num_tasks () // expected-error {{expected expression}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd num_tasks (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd num_tasks (argc)) // expected-warning {{extra tokens at the end of '#pragma omp master taskloop simd' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd num_tasks (argc > 0 ? argv[1][0] : argv[2][argc] + z)
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd num_tasks (foobool(argc)), num_tasks (true) // expected-error {{directive '#pragma omp master taskloop simd' cannot contain more than one 'num_tasks' clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd num_tasks (S) // expected-error {{'S' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd num_tasks (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd num_tasks(0) // expected-error {{argument to 'num_tasks' clause must be a strictly positive integer value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd num_tasks(-1) // expected-error {{argument to 'num_tasks' clause must be a strictly positive integer value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd num_tasks(argc) grainsize(argc) // expected-error {{'grainsize' and 'num_tasks' clause are mutually exclusive and may not appear on the same directive}} expected-note {{'num_tasks' clause is specified here}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+
+ return 0;
+}
+
+int main(int argc, char **argv) {
+ int z;
+ #pragma omp master taskloop simd num_tasks // expected-error {{expected '(' after 'num_tasks'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd num_tasks ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd num_tasks () // expected-error {{expected expression}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd num_tasks (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd num_tasks (argc)) // expected-warning {{extra tokens at the end of '#pragma omp master taskloop simd' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd num_tasks (argc > 0 ? argv[1][0] : argv[2][argc] - z)
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd num_tasks (foobool(argc)), num_tasks (true) // expected-error {{directive '#pragma omp master taskloop simd' cannot contain more than one 'num_tasks' clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd num_tasks (S1) // expected-error {{'S1' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd num_tasks (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd num_tasks (1 0) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd num_tasks(if(tmain(argc, argv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd num_tasks(0) // expected-error {{argument to 'num_tasks' clause must be a strictly positive integer value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd num_tasks(-1) // expected-error {{argument to 'num_tasks' clause must be a strictly positive integer value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd num_tasks(argc) grainsize(argc) // expected-error {{'grainsize' and 'num_tasks' clause are mutually exclusive and may not appear on the same directive}} expected-note {{'num_tasks' clause is specified here}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+
+ return tmain(argc, argv);
+}
diff --git a/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_priority_messages.cpp b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_priority_messages.cpp
new file mode 100644
index 0000000..b342637
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_priority_messages.cpp
@@ -0,0 +1,97 @@
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+struct S1; // expected-note {{declared here}}
+
+template <class T, class S> // expected-note {{declared here}}
+int tmain(T argc, S **argv) {
+ T z;
+ #pragma omp master taskloop simd priority // expected-error {{expected '(' after 'priority'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd priority ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd priority () // expected-error {{expected expression}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd priority (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd priority (argc + z)) // expected-warning {{extra tokens at the end of '#pragma omp master taskloop simd' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd priority (argc > 0 ? argv[1][0] : argv[2][argc])
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd priority (foobool(argc)), priority (true) // expected-error {{directive '#pragma omp master taskloop simd' cannot contain more than one 'priority' clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd priority (S) // expected-error {{'S' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd priority (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd priority(0)
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd priority(-1) // expected-error {{argument to 'priority' clause must be a non-negative integer value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+
+ return 0;
+}
+
+int main(int argc, char **argv) {
+ int z;
+ #pragma omp master taskloop simd priority // expected-error {{expected '(' after 'priority'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd priority ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd priority () // expected-error {{expected expression}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd priority (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd priority (argc + z)) // expected-warning {{extra tokens at the end of '#pragma omp master taskloop simd' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd priority (argc > 0 ? argv[1][0] : argv[2][argc])
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd priority (foobool(argc)), priority (true) // expected-error {{directive '#pragma omp master taskloop simd' cannot contain more than one 'priority' clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd priority (S1) // expected-error {{'S1' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd priority (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd priority (1 0) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd priority(if(tmain(argc, argv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd priority(0)
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp master taskloop simd priority(-1) // expected-error {{argument to 'priority' clause must be a non-negative integer value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+
+ return tmain(argc, argv);
+}
diff --git a/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_private_codegen.cpp b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_private_codegen.cpp
new file mode 100644
index 0000000..d6f8bea
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_private_codegen.cpp
@@ -0,0 +1,425 @@
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-apple-darwin10 -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=LAMBDA %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=BLOCKS %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DARRAY -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=ARRAY %s
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DARRAY -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
+// expected-no-diagnostics
+
+#ifndef ARRAY
+#ifndef HEADER
+#define HEADER
+
+template <class T>
+struct S {
+ T f;
+ S(T a) : f(a) {}
+ S() : f() {}
+ operator T() { return T(); }
+ ~S() {}
+};
+
+volatile double g;
+
+// CHECK-DAG: [[KMP_TASK_T_TY:%.+]] = type { i8*, i32 (i32, i8*)*, i32, %union{{.+}}, %union{{.+}}, i64, i64, i64, i32, i8* }
+// CHECK-DAG: [[S_DOUBLE_TY:%.+]] = type { double }
+// CHECK-DAG: [[CAP_MAIN_TY:%.+]] = type { i8 }
+// CHECK-DAG: [[PRIVATES_MAIN_TY:%.+]] = type {{.?}}{ [2 x [[S_DOUBLE_TY]]], [[S_DOUBLE_TY]], i32, [2 x i32]
+// CHECK-DAG: [[KMP_TASK_MAIN_TY:%.+]] = type { [[KMP_TASK_T_TY]], [[PRIVATES_MAIN_TY]] }
+// CHECK-DAG: [[S_INT_TY:%.+]] = type { i32 }
+// CHECK-DAG: [[CAP_TMAIN_TY:%.+]] = type { i8 }
+// CHECK-DAG: [[PRIVATES_TMAIN_TY:%.+]] = type { i32, [2 x i32], [2 x [[S_INT_TY]]], [[S_INT_TY]], [104 x i8] }
+// CHECK-DAG: [[KMP_TASK_TMAIN_TY:%.+]] = type { [[KMP_TASK_T_TY]], [{{[0-9]+}} x i8], [[PRIVATES_TMAIN_TY]] }
+template <typename T>
+T tmain() {
+ S<T> test;
+ T t_var __attribute__((aligned(128))) = T();
+ T vec[] = {1, 2};
+ S<T> s_arr[] = {1, 2};
+ S<T> var(3);
+#pragma omp master taskloop simd private(t_var, vec, s_arr, s_arr, var, var)
+ for (int i = 0; i < 10; ++i) {
+ vec[0] = t_var;
+ s_arr[0] = var;
+ }
+ return T();
+}
+
+int main() {
+ static int sivar;
+#ifdef LAMBDA
+ // LAMBDA: [[G:@.+]] = global double
+ // LAMBDA-LABEL: @main
+ // LAMBDA: call{{( x86_thiscallcc)?}} void [[OUTER_LAMBDA:@.+]](
+ [&]() {
+ // LAMBDA: define{{.*}} internal{{.*}} void [[OUTER_LAMBDA]](
+ // LAMBDA: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc(%{{[^ ]+}} @{{[^,]+}}, i32 %{{[^,]+}}, i32 1, i64 96, i64 1, i32 (i32, i8*)* bitcast (i32 (i32, %{{[^*]+}}*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+// LAMBDA: [[PRIVATES:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i{{.+}} 0, i{{.+}} 1
+// LAMBDA: call void @__kmpc_taskloop(%{{.+}}* @{{.+}}, i32 %{{.+}}, i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* null)
+// LAMBDA: ret
+#pragma omp master taskloop simd private(g, sivar)
+ for (int i = 0; i < 10; ++i) {
+ // LAMBDA: define {{.+}} void [[INNER_LAMBDA:@.+]](%{{.+}}* [[ARG_PTR:%.+]])
+ // LAMBDA: store %{{.+}}* [[ARG_PTR]], %{{.+}}** [[ARG_PTR_REF:%.+]],
+ // LAMBDA: [[ARG_PTR:%.+]] = load %{{.+}}*, %{{.+}}** [[ARG_PTR_REF]]
+ // LAMBDA: [[G_PTR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[ARG_PTR]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+ // LAMBDA: [[G_REF:%.+]] = load double*, double** [[G_PTR_REF]]
+ // LAMBDA: store double 2.0{{.+}}, double* [[G_REF]]
+ // LAMBDA: [[SIVAR_PTR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[ARG_PTR]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
+ // LAMBDA: [[SIVAR_REF:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** [[SIVAR_PTR_REF]]
+ // LAMBDA: store i{{[0-9]+}} 3, i{{[0-9]+}}* [[SIVAR_REF]]
+
+ // LAMBDA: define internal i32 [[TASK_ENTRY]](i32 %0, %{{.+}}* noalias %1)
+ g = 1;
+ sivar = 2;
+ // LAMBDA: store double 1.0{{.+}}, double* %{{.+}},
+ // LAMBDA: store i{{[0-9]+}} 2, i{{[0-9]+}}* %{{.+}},
+ // LAMBDA: call void [[INNER_LAMBDA]](%
+ // LAMBDA: ret
+ [&]() {
+ g = 2;
+ sivar = 3;
+ }();
+ }
+ }();
+ return 0;
+#elif defined(BLOCKS)
+ // BLOCKS: [[G:@.+]] = global double
+ // BLOCKS-LABEL: @main
+ // BLOCKS: call void {{%.+}}(i8
+ ^{
+ // BLOCKS: define{{.*}} internal{{.*}} void {{.+}}(i8*
+ // BLOCKS: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc(%{{[^ ]+}} @{{[^,]+}}, i32 %{{[^,]+}}, i32 1, i64 96, i64 1, i32 (i32, i8*)* bitcast (i32 (i32, %{{[^*]+}}*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+ // BLOCKS: [[PRIVATES:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i{{.+}} 0, i{{.+}} 1
+ // BLOCKS: call void @__kmpc_taskloop(%{{.+}}* @{{.+}}, i32 %{{.+}}, i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* null)
+ // BLOCKS: ret
+#pragma omp master taskloop simd private(g, sivar)
+ for (int i = 0; i < 10; ++i) {
+ // BLOCKS: define {{.+}} void {{@.+}}(i8*
+ // BLOCKS-NOT: [[G]]{{[[^:word:]]}}
+ // BLOCKS: store double 2.0{{.+}}, double*
+ // BLOCKS-NOT: [[G]]{{[[^:word:]]}}
+ // BLOCKS-NOT: [[SIVAR]]{{[[^:word:]]}}
+ // BLOCKS: store i{{[0-9]+}} 4, i{{[0-9]+}}*
+ // BLOCKS-NOT: [[SIVAR]]{{[[^:word:]]}}
+ // BLOCKS: ret
+
+ // BLOCKS: define internal i32 [[TASK_ENTRY]](i32 %0, %{{.+}}* noalias %1)
+ g = 1;
+ sivar = 3;
+ // BLOCKS: store double 1.0{{.+}}, double* %{{.+}},
+ // BLOCKS-NOT: [[G]]{{[[^:word:]]}}
+ // BLOCKS: store i{{[0-9]+}} 3, i{{[0-9]+}}* %{{.+}},
+ // BLOCKS-NOT: [[SIVAR]]{{[[^:word:]]}}
+ // BLOCKS: call void {{%.+}}(i8
+ ^{
+ g = 2;
+ sivar = 4;
+ }();
+ }
+ }();
+ return 0;
+#else
+ S<double> test;
+ int t_var = 0;
+ int vec[] = {1, 2};
+ S<double> s_arr[] = {1, 2};
+ S<double> var(3);
+#pragma omp master taskloop simd private(var, t_var, s_arr, vec, s_arr, var, sivar)
+ for (int i = 0; i < 10; ++i) {
+ vec[0] = t_var;
+ s_arr[0] = var;
+ sivar = 8;
+ }
+#pragma omp task
+ g+=1;
+ return tmain<int>();
+#endif
+}
+
+// CHECK: define i{{[0-9]+}} @main()
+// CHECK: [[TEST:%.+]] = alloca [[S_DOUBLE_TY]],
+// CHECK: [[T_VAR_ADDR:%.+]] = alloca i32,
+// CHECK: [[VEC_ADDR:%.+]] = alloca [2 x i32],
+// CHECK: [[S_ARR_ADDR:%.+]] = alloca [2 x [[S_DOUBLE_TY]]],
+// CHECK: [[VAR_ADDR:%.+]] = alloca [[S_DOUBLE_TY]],
+// CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num([[LOC:%.+]])
+
+// CHECK: call {{.*}} [[S_DOUBLE_TY_DEF_CONSTR:@.+]]([[S_DOUBLE_TY]]* [[TEST]])
+
+// Do not store original variables in capture struct.
+// CHECK-NOT: getelementptr inbounds [[CAP_MAIN_TY]],
+
+// Allocate task.
+// Returns struct kmp_task_t {
+// [[KMP_TASK_T_TY]] task_data;
+// [[KMP_TASK_MAIN_TY]] privates;
+// };
+// CHECK: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc([[LOC]], i32 [[GTID]], i32 9, i64 120, i64 1, i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_MAIN_TY]]*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+// CHECK: [[RES_KMP_TASK:%.+]] = bitcast i8* [[RES]] to [[KMP_TASK_MAIN_TY]]*
+
+// CHECK: [[TASK:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// Initialize kmp_task_t->privates with default values (no init for simple types, default constructors for classes).
+// Also copy address of private copy to the corresponding shareds reference.
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
+
+// Constructors for s_arr and var.
+// a_arr;
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: getelementptr inbounds [2 x [[S_DOUBLE_TY]]], [2 x [[S_DOUBLE_TY]]]* [[PRIVATE_S_ARR_REF]], i{{.+}} 0, i{{.+}} 0
+// CHECK: getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i{{.+}} 2
+// CHECK: call void [[S_DOUBLE_TY_DEF_CONSTR]]([[S_DOUBLE_TY]]* [[S_ARR_CUR:%.+]])
+// CHECK: getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* [[S_ARR_CUR]], i{{.+}} 1
+// CHECK: icmp eq
+// CHECK: br i1
+
+// var;
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
+// CHECK: call void [[S_DOUBLE_TY_DEF_CONSTR]]([[S_DOUBLE_TY]]* [[PRIVATE_VAR_REF:%.+]])
+
+// Provide pointer to destructor function, which will destroy private variables at the end of the task.
+// CHECK: [[DESTRUCTORS_REF:%.+]] = getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* [[TASK]], i{{.+}} 0, i{{.+}} 3
+// CHECK: [[DESTRUCTORS_PTR:%.+]] = bitcast %union{{.+}}* [[DESTRUCTORS_REF]] to i32 (i32, i8*)**
+// CHECK: store i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_MAIN_TY]]*)* [[DESTRUCTORS:@.+]] to i32 (i32, i8*)*), i32 (i32, i8*)** [[DESTRUCTORS_PTR]],
+
+// Start task.
+// CHECK: call void @__kmpc_taskloop([[LOC]], i32 [[GTID]], i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* bitcast (void ([[KMP_TASK_MAIN_TY]]*, [[KMP_TASK_MAIN_TY]]*, i32)* [[MAIN_DUP:@.+]] to i8*))
+// CHECK: call i32 @__kmpc_omp_task([[LOC]], i32 [[GTID]], i8*
+
+// CHECK: = call i{{.+}} [[TMAIN_INT:@.+]]()
+
+// No destructors must be called for private copies of s_arr and var.
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: call void [[S_DOUBLE_TY_DESTR:@.+]]([[S_DOUBLE_TY]]*
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: ret
+//
+
+// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_MAIN_TY]]* noalias %0, [[S_DOUBLE_TY]]** noalias %1, i32** noalias %2, [2 x [[S_DOUBLE_TY]]]** noalias %3, [2 x i32]** noalias %4, i32** noalias %5)
+// CHECK: [[PRIVATES:%.+]] = load [[PRIVATES_MAIN_TY]]*, [[PRIVATES_MAIN_TY]]**
+// CHECK: [[PRIV_S_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 0
+// CHECK: [[ARG3:%.+]] = load [2 x [[S_DOUBLE_TY]]]**, [2 x [[S_DOUBLE_TY]]]*** %{{.+}},
+// CHECK: store [2 x [[S_DOUBLE_TY]]]* [[PRIV_S_VAR]], [2 x [[S_DOUBLE_TY]]]** [[ARG3]],
+// CHECK: [[PRIV_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 1
+// CHECK: [[ARG1:%.+]] = load [[S_DOUBLE_TY]]**, [[S_DOUBLE_TY]]*** {{.+}},
+// CHECK: store [[S_DOUBLE_TY]]* [[PRIV_VAR]], [[S_DOUBLE_TY]]** [[ARG1]],
+// CHECK: [[PRIV_T_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 2
+// CHECK: [[ARG2:%.+]] = load i32**, i32*** %{{.+}},
+// CHECK: store i32* [[PRIV_T_VAR]], i32** [[ARG2]],
+// CHECK: [[PRIV_VEC:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 3
+// CHECK: [[ARG4:%.+]] = load [2 x i32]**, [2 x i32]*** %{{.+}},
+// CHECK: store [2 x i32]* [[PRIV_VEC]], [2 x i32]** [[ARG4]],
+// CHECK: ret void
+
+// CHECK: define internal i32 [[TASK_ENTRY]](i32 %0, [[KMP_TASK_MAIN_TY]]* noalias %1)
+
+// CHECK: [[PRIV_VAR_ADDR:%.+]] = alloca [[S_DOUBLE_TY]]*,
+// CHECK: [[PRIV_T_VAR_ADDR:%.+]] = alloca i32*,
+// CHECK: [[PRIV_S_ARR_ADDR:%.+]] = alloca [2 x [[S_DOUBLE_TY]]]*,
+// CHECK: [[PRIV_VEC_ADDR:%.+]] = alloca [2 x i32]*,
+// CHECK: [[PRIV_SIVAR_ADDR:%.+]] = alloca i32*,
+// CHECK: store void (i8*, ...)* bitcast (void ([[PRIVATES_MAIN_TY]]*, [[S_DOUBLE_TY]]**, i32**, [2 x [[S_DOUBLE_TY]]]**, [2 x i32]**, i32**)* [[PRIVATES_MAP_FN]] to void (i8*, ...)*), void (i8*, ...)** [[MAP_FN_ADDR:%.+]],
+// CHECK: [[MAP_FN:%.+]] = load void (i8*, ...)*, void (i8*, ...)** [[MAP_FN_ADDR]],
+// CHECK: call void (i8*, ...) [[MAP_FN]](i8* %{{.+}}, [[S_DOUBLE_TY]]** [[PRIV_VAR_ADDR]], i32** [[PRIV_T_VAR_ADDR]], [2 x [[S_DOUBLE_TY]]]** [[PRIV_S_ARR_ADDR]], [2 x i32]** [[PRIV_VEC_ADDR]], i32** [[PRIV_SIVAR_ADDR]])
+// CHECK: [[PRIV_VAR:%.+]] = load [[S_DOUBLE_TY]]*, [[S_DOUBLE_TY]]** [[PRIV_VAR_ADDR]],
+// CHECK: [[PRIV_T_VAR:%.+]] = load i32*, i32** [[PRIV_T_VAR_ADDR]],
+// CHECK: [[PRIV_S_ARR:%.+]] = load [2 x [[S_DOUBLE_TY]]]*, [2 x [[S_DOUBLE_TY]]]** [[PRIV_S_ARR_ADDR]],
+// CHECK: [[PRIV_VEC:%.+]] = load [2 x i32]*, [2 x i32]** [[PRIV_VEC_ADDR]],
+// CHECK: [[PRIV_SIVAR:%.+]] = load i32*, i32** [[PRIV_SIVAR_ADDR]],
+
+// Privates actually are used.
+// CHECK-DAG: [[PRIV_VAR]]
+// CHECK-DAG: [[PRIV_T_VAR]]
+// CHECK-DAG: [[PRIV_S_ARR]]
+// CHECK-DAG: [[PRIV_VEC]]
+// CHECK_DAG: [[PRIV_SIVAR]]
+
+// CHECK: ret
+
+// CHECK: define internal void [[MAIN_DUP]]([[KMP_TASK_MAIN_TY]]* %0, [[KMP_TASK_MAIN_TY]]* %1, i32 %2)
+// CHECK: getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* %{{.+}}, i32 0, i32 1
+// CHECK: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr inbounds [2 x [[S_DOUBLE_TY]]], [2 x [[S_DOUBLE_TY]]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i64 2
+// CHECK: br label %
+
+// CHECK: phi [[S_DOUBLE_TY]]*
+// CHECK: call {{.*}} [[S_DOUBLE_TY_DEF_CONSTR]]([[S_DOUBLE_TY]]*
+// CHECK: getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i64 1
+// CHECK: icmp eq [[S_DOUBLE_TY]]* %
+// CHECK: br i1 %
+
+// CHECK: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* %{{.+}}, i32 0, i32 1
+// CHECK: call {{.*}} [[S_DOUBLE_TY_DEF_CONSTR]]([[S_DOUBLE_TY]]*
+// CHECK: ret void
+
+// CHECK: define internal i32 [[DESTRUCTORS]](i32 %0, [[KMP_TASK_MAIN_TY]]* noalias %1)
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 0
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
+// CHECK: call void [[S_DOUBLE_TY_DESTR]]([[S_DOUBLE_TY]]* [[PRIVATE_VAR_REF]])
+// CHECK: getelementptr inbounds [2 x [[S_DOUBLE_TY]]], [2 x [[S_DOUBLE_TY]]]* [[PRIVATE_S_ARR_REF]], i{{.+}} 0, i{{.+}} 0
+// CHECK: getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i{{.+}} 2
+// CHECK: [[PRIVATE_S_ARR_ELEM_REF:%.+]] = getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i{{.+}} -1
+// CHECK: call void [[S_DOUBLE_TY_DESTR]]([[S_DOUBLE_TY]]* [[PRIVATE_S_ARR_ELEM_REF]])
+// CHECK: icmp eq
+// CHECK: br i1
+// CHECK: ret i32
+
+// CHECK: define {{.*}} i{{[0-9]+}} [[TMAIN_INT]]()
+// CHECK: [[TEST:%.+]] = alloca [[S_INT_TY]],
+// CHECK: [[T_VAR_ADDR:%.+]] = alloca i32,
+// CHECK: [[VEC_ADDR:%.+]] = alloca [2 x i32],
+// CHECK: [[S_ARR_ADDR:%.+]] = alloca [2 x [[S_INT_TY]]],
+// CHECK: [[VAR_ADDR:%.+]] = alloca [[S_INT_TY]],
+// CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num([[LOC:%.+]])
+
+// CHECK: call {{.*}} [[S_INT_TY_DEF_CONSTR:@.+]]([[S_INT_TY]]* [[TEST]])
+
+// Do not store original variables in capture struct.
+// CHECK-NOT: getelementptr inbounds [[CAP_TMAIN_TY]],
+
+// Allocate task.
+// Returns struct kmp_task_t {
+// [[KMP_TASK_T_TY]] task_data;
+// [[KMP_TASK_TMAIN_TY]] privates;
+// };
+// CHECK: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc([[LOC]], i32 [[GTID]], i32 9, i64 256, i64 1, i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_TMAIN_TY]]*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+// CHECK: [[RES_KMP_TASK:%.+]] = bitcast i8* [[RES]] to [[KMP_TASK_TMAIN_TY]]*
+
+// CHECK: [[TASK:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+
+// Initialize kmp_task_t->privates with default values (no init for simple types, default constructors for classes).
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
+
+// Constructors for s_arr and var.
+// a_arr;
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
+// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* [[PRIVATE_S_ARR_REF]], i{{.+}} 0, i{{.+}} 0
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i{{.+}} 2
+// CHECK: call void [[S_INT_TY_DEF_CONSTR]]([[S_INT_TY]]* [[S_ARR_CUR:%.+]])
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* [[S_ARR_CUR]], i{{.+}} 1
+// CHECK: icmp eq
+// CHECK: br i1
+
+// var;
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: call void [[S_INT_TY_DEF_CONSTR]]([[S_INT_TY]]* [[PRIVATE_VAR_REF:%.+]])
+
+// Provide pointer to destructor function, which will destroy private variables at the end of the task.
+// CHECK: [[DESTRUCTORS_REF:%.+]] = getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* [[TASK]], i{{.+}} 0, i{{.+}} 3
+// CHECK: [[DESTRUCTORS_PTR:%.+]] = bitcast %union{{.+}}* [[DESTRUCTORS_REF]] to i32 (i32, i8*)**
+// CHECK: store i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_TMAIN_TY]]*)* [[DESTRUCTORS:@.+]] to i32 (i32, i8*)*), i32 (i32, i8*)** [[DESTRUCTORS_PTR]],
+
+// Start task.
+// CHECK: call void @__kmpc_taskloop([[LOC]], i32 [[GTID]], i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* bitcast (void ([[KMP_TASK_TMAIN_TY]]*, [[KMP_TASK_TMAIN_TY]]*, i32)* [[TMAIN_DUP:@.+]] to i8*))
+
+// No destructors must be called for private copies of s_arr and var.
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: call void [[S_INT_TY_DESTR:@.+]]([[S_INT_TY]]*
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: ret
+//
+
+// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_TMAIN_TY]]* noalias %0, i32** noalias %1, [2 x i32]** noalias %2, [2 x [[S_INT_TY]]]** noalias %3, [[S_INT_TY]]** noalias %4)
+// CHECK: [[PRIVATES:%.+]] = load [[PRIVATES_TMAIN_TY]]*, [[PRIVATES_TMAIN_TY]]**
+// CHECK: [[PRIV_T_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 0
+// CHECK: [[ARG1:%.+]] = load i32**, i32*** %{{.+}},
+// CHECK: store i32* [[PRIV_T_VAR]], i32** [[ARG1]],
+// CHECK: [[PRIV_VEC:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 1
+// CHECK: [[ARG2:%.+]] = load [2 x i32]**, [2 x i32]*** %{{.+}},
+// CHECK: store [2 x i32]* [[PRIV_VEC]], [2 x i32]** [[ARG2]],
+// CHECK: [[PRIV_S_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 2
+// CHECK: [[ARG3:%.+]] = load [2 x [[S_INT_TY]]]**, [2 x [[S_INT_TY]]]*** %{{.+}},
+// CHECK: store [2 x [[S_INT_TY]]]* [[PRIV_S_VAR]], [2 x [[S_INT_TY]]]** [[ARG3]],
+// CHECK: [[PRIV_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 3
+// CHECK: [[ARG4:%.+]] = load [[S_INT_TY]]**, [[S_INT_TY]]*** {{.+}},
+// CHECK: store [[S_INT_TY]]* [[PRIV_VAR]], [[S_INT_TY]]** [[ARG4]],
+// CHECK: ret void
+
+// CHECK: define internal i32 [[TASK_ENTRY]](i32 %0, [[KMP_TASK_TMAIN_TY]]* noalias %1)
+
+// CHECK: alloca i32*,
+// CHECK-DAG: [[PRIV_T_VAR_ADDR:%.+]] = alloca i32*,
+// CHECK-DAG: [[PRIV_VEC_ADDR:%.+]] = alloca [2 x i32]*,
+// CHECK-DAG: [[PRIV_S_ARR_ADDR:%.+]] = alloca [2 x [[S_INT_TY]]]*,
+// CHECK-DAG: [[PRIV_VAR_ADDR:%.+]] = alloca [[S_INT_TY]]*,
+// CHECK: store void (i8*, ...)* bitcast (void ([[PRIVATES_TMAIN_TY]]*, i32**, [2 x i32]**, [2 x [[S_INT_TY]]]**, [[S_INT_TY]]**)* [[PRIVATES_MAP_FN]] to void (i8*, ...)*), void (i8*, ...)** [[MAP_FN_ADDR:%.+]],
+// CHECK: [[MAP_FN:%.+]] = load void (i8*, ...)*, void (i8*, ...)** [[MAP_FN_ADDR]],
+// CHECK: call void (i8*, ...) [[MAP_FN]](i8* %{{.+}}, i32** [[PRIV_T_VAR_ADDR]], [2 x i32]** [[PRIV_VEC_ADDR]], [2 x [[S_INT_TY]]]** [[PRIV_S_ARR_ADDR]], [[S_INT_TY]]** [[PRIV_VAR_ADDR]])
+// CHECK: [[PRIV_T_VAR:%.+]] = load i32*, i32** [[PRIV_T_VAR_ADDR]],
+// CHECK: [[PRIV_VEC:%.+]] = load [2 x i32]*, [2 x i32]** [[PRIV_VEC_ADDR]],
+// CHECK: [[PRIV_S_ARR:%.+]] = load [2 x [[S_INT_TY]]]*, [2 x [[S_INT_TY]]]** [[PRIV_S_ARR_ADDR]],
+// CHECK: [[PRIV_VAR:%.+]] = load [[S_INT_TY]]*, [[S_INT_TY]]** [[PRIV_VAR_ADDR]],
+
+// Privates actually are used.
+// CHECK-DAG: [[PRIV_VAR]]
+// CHECK-DAG: [[PRIV_T_VAR]]
+// CHECK-DAG: [[PRIV_S_ARR]]
+// CHECK-DAG: [[PRIV_VEC]]
+
+// CHECK: ret
+
+// CHECK: define internal void [[TMAIN_DUP]]([[KMP_TASK_TMAIN_TY]]* %0, [[KMP_TASK_TMAIN_TY]]* %1, i32 %2)
+// CHECK: getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* %{{.+}}, i32 0, i32 2
+// CHECK: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* %{{.+}}, i32 0, i32 2
+// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i64 2
+// CHECK: br label %
+
+// CHECK: phi [[S_INT_TY]]*
+// CHECK: call {{.*}} [[S_INT_TY_DEF_CONSTR]]([[S_INT_TY]]*
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i64 1
+// CHECK: icmp eq [[S_INT_TY]]* %
+// CHECK: br i1 %
+
+// CHECK: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* %{{.+}}, i32 0, i32 3
+// CHECK: call {{.*}} [[S_INT_TY_DEF_CONSTR]]([[S_INT_TY]]*
+// CHECK: ret void
+
+// CHECK: define internal i32 [[DESTRUCTORS]](i32 %0, [[KMP_TASK_TMAIN_TY]]* noalias %1)
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: call void [[S_INT_TY_DESTR]]([[S_INT_TY]]* [[PRIVATE_VAR_REF]])
+// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* [[PRIVATE_S_ARR_REF]], i{{.+}} 0, i{{.+}} 0
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i{{.+}} 2
+// CHECK: [[PRIVATE_S_ARR_ELEM_REF:%.+]] = getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i{{.+}} -1
+// CHECK: call void [[S_INT_TY_DESTR]]([[S_INT_TY]]* [[PRIVATE_S_ARR_ELEM_REF]])
+// CHECK: icmp eq
+// CHECK: br i1
+// CHECK: ret i32
+
+#endif
+#else
+// ARRAY-LABEL: array_func
+struct St {
+ int a, b;
+ St() : a(0), b(0) {}
+ St &operator=(const St &) { return *this; };
+ ~St() {}
+};
+
+void array_func(int n, float a[n], St s[2]) {
+// ARRAY: call i8* @__kmpc_omp_task_alloc(
+// ARRAY: call void @__kmpc_taskloop(
+// ARRAY: store float** %{{.+}}, float*** %{{.+}},
+// ARRAY: store %struct.St** %{{.+}}, %struct.St*** %{{.+}},
+#pragma omp master taskloop simd private(a, s)
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+#endif
+
diff --git a/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_private_messages.cpp b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_private_messages.cpp
new file mode 100644
index 0000000..721c649
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_private_messages.cpp
@@ -0,0 +1,259 @@
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+
+typedef void **omp_allocator_handle_t;
+extern const omp_allocator_handle_t omp_default_mem_alloc;
+extern const omp_allocator_handle_t omp_large_cap_mem_alloc;
+extern const omp_allocator_handle_t omp_const_mem_alloc;
+extern const omp_allocator_handle_t omp_high_bw_mem_alloc;
+extern const omp_allocator_handle_t omp_low_lat_mem_alloc;
+extern const omp_allocator_handle_t omp_cgroup_mem_alloc;
+extern const omp_allocator_handle_t omp_pteam_mem_alloc;
+extern const omp_allocator_handle_t omp_thread_mem_alloc;
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+struct S1; // expected-note 2 {{declared here}} expected-note 2 {{forward declaration of 'S1'}}
+extern S1 a;
+class S2 {
+ mutable int a;
+
+public:
+ S2() : a(0) {}
+};
+const S2 b;
+const S2 ba[5];
+class S3 {
+ int a;
+
+public:
+ S3() : a(0) {}
+};
+const S3 ca[5];
+class S4 {
+ int a;
+ S4(); // expected-note {{implicitly declared private here}}
+
+public:
+ S4(int v) : a(v) {
+#pragma omp master taskloop simd private(a) private(this->a)
+ for (int k = 0; k < v; ++k)
+ ++this->a;
+ }
+};
+class S5 {
+ int a;
+ S5() : a(0) {} // expected-note {{implicitly declared private here}}
+
+public:
+ S5(int v) : a(v) {}
+ S5 &operator=(S5 &s) {
+#pragma omp master taskloop simd private(a) private(this->a) private(s.a) // expected-error {{expected variable name or data member of current class}}
+ for (int k = 0; k < s.a; ++k)
+ ++s.a;
+ return *this;
+ }
+};
+
+template <typename T>
+class S6 {
+public:
+ T a;
+
+ S6() : a(0) {}
+ S6(T v) : a(v) {
+#pragma omp master taskloop simd allocate(omp_thread_mem_alloc: a) private(a) private(this->a) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'master taskloop simd' directive}}
+ for (int k = 0; k < v; ++k)
+ ++this->a;
+ }
+ S6 &operator=(S6 &s) {
+#pragma omp master taskloop simd private(a) private(this->a) private(s.a) // expected-error {{expected variable name or data member of current class}}
+ for (int k = 0; k < s.a; ++k)
+ ++s.a;
+ return *this;
+ }
+};
+
+template <typename T>
+class S7 : public T {
+ T a;
+ S7() : a(0) {}
+
+public:
+ S7(T v) : a(v) {
+#pragma omp master taskloop simd private(a) private(this->a) private(T::a)
+ for (int k = 0; k < a.a; ++k)
+ ++this->a.a;
+ }
+ S7 &operator=(S7 &s) {
+#pragma omp master taskloop simd private(a) private(this->a) private(s.a) private(s.T::a) // expected-error 2 {{expected variable name or data member of current class}}
+ for (int k = 0; k < s.a.a; ++k)
+ ++s.a.a;
+ return *this;
+ }
+};
+
+S3 h;
+#pragma omp threadprivate(h) // expected-note 2 {{defined as threadprivate or thread local}}
+
+template <class I, class C>
+int foomain(I argc, C **argv) {
+ I e(4);
+ I g(5);
+ int i, z;
+ int &j = i;
+#pragma omp master taskloop simd private // expected-error {{expected '(' after 'private'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop simd private( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop simd private() // expected-error {{expected expression}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop simd private(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop simd private(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop simd private(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop simd private(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop simd private(S1) // expected-error {{'S1' does not refer to a value}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop simd private(a, b) // expected-error {{private variable with incomplete type 'S1'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop simd private(argv[1]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop simd private(e, g, z)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop simd private(h) // expected-error {{threadprivate or thread local variable cannot be private}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop simd shared(i)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+ {
+ int v = 0;
+ int i;
+#pragma omp master taskloop simd private(i)
+ for (int k = 0; k < argc; ++k) {
+ i = k;
+ v += i;
+ }
+ }
+#pragma omp parallel shared(i)
+#pragma omp parallel private(i)
+#pragma omp master taskloop simd private(j)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop simd private(i)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+ return 0;
+}
+
+void bar(S4 a[2]) {
+#pragma omp parallel
+#pragma omp master taskloop simd private(a)
+ for (int i = 0; i < 2; ++i)
+ foo();
+}
+
+namespace A {
+double x;
+#pragma omp threadprivate(x) // expected-note {{defined as threadprivate or thread local}}
+}
+namespace B {
+using A::x;
+}
+
+int main(int argc, char **argv) {
+ S4 e(4);
+ S5 g(5);
+ S6<float> s6(0.0) , s6_0(1.0); // expected-note {{in instantiation of member function 'S6<float>::S6' requested here}}
+ S7<S6<float> > s7(0.0) , s7_0(1.0);
+ int i, z;
+ int &j = i;
+#pragma omp master taskloop simd private // expected-error {{expected '(' after 'private'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop simd private( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop simd private() // expected-error {{expected expression}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop simd private(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop simd private(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop simd private(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop simd private(argc, z)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop simd private(S1) // expected-error {{'S1' does not refer to a value}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop simd private(a, b) // expected-error {{private variable with incomplete type 'S1'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop simd private(argv[1]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop simd private(e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop simd private(h) // expected-error {{threadprivate or thread local variable cannot be private}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop simd private(B::x) // expected-error {{threadprivate or thread local variable cannot be private}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop simd shared(i)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+ {
+ int i;
+#pragma omp master taskloop simd private(i)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+ }
+#pragma omp parallel shared(i)
+#pragma omp parallel private(i)
+#pragma omp master taskloop simd private(j)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp master taskloop simd private(i)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+ static int si;
+#pragma omp master taskloop simd private(si) // OK
+ for(int k = 0; k < argc; ++k)
+ si = k + 1;
+
+ s6 = s6_0; // expected-note {{in instantiation of member function 'S6<float>::operator=' requested here}}
+ s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float> >::operator=' requested here}}
+ return foomain(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<int, char>' requested here}}
+}
+
diff --git a/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_reduction_codegen.cpp b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_reduction_codegen.cpp
new file mode 100644
index 0000000..1b88310
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_reduction_codegen.cpp
@@ -0,0 +1,215 @@
+// RUN: %clang_cc1 -fopenmp -x c++ %s -verify -debug-info-kind=limited -emit-llvm -o - -triple powerpc64le-unknown-linux-gnu -std=c++98 -fnoopenmp-use-tls | FileCheck %s
+
+// RUN: %clang_cc1 -fopenmp-simd -x c++ %s -verify -debug-info-kind=limited -emit-llvm -o - -triple powerpc64le-unknown-linux-gnu -std=c++98 -fnoopenmp-use-tls | FileCheck --check-prefix SIMD-ONLY0 %s
+// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
+// expected-no-diagnostics
+
+struct S {
+ float a;
+ S() : a(0.0f) {}
+ ~S() {}
+};
+
+#pragma omp declare reduction(+:S:omp_out.a += omp_in.a) initializer(omp_priv = omp_orig)
+
+float g;
+
+int a;
+#pragma omp threadprivate(a)
+int main (int argc, char *argv[])
+{
+int i, n;
+float a[100], b[100], sum, e[argc + 100];
+S c[100];
+float &d = g;
+
+/* Some initializations */
+n = 100;
+for (i=0; i < n; i++)
+ a[i] = b[i] = i * 1.0;
+sum = 0.0;
+
+#pragma omp master taskloop simd reduction(+:sum, c[:n], d, e)
+ for (i=0; i < n; i++) {
+ sum = sum + (a[i] * b[i]);
+ c[i].a = i*i;
+ d += i*i;
+ e[i] = i;
+ }
+
+}
+
+// CHECK-LABEL: @main(
+// CHECK: [[RETVAL:%.*]] = alloca i32,
+// CHECK: [[ARGC_ADDR:%.*]] = alloca i32,
+// CHECK: [[ARGV_ADDR:%.*]] = alloca i8**,
+// CHECK: [[I:%.*]] = alloca i32,
+// CHECK: [[N:%.*]] = alloca i32,
+// CHECK: [[A:%.*]] = alloca [100 x float],
+// CHECK: [[B:%.*]] = alloca [100 x float],
+// CHECK: [[SUM:%.*]] = alloca float,
+// CHECK: [[SAVED_STACK:%.*]] = alloca i8*,
+// CHECK: [[C:%.*]] = alloca [100 x %struct.S],
+// CHECK: [[D:%.*]] = alloca float*,
+// CHECK: [[AGG_CAPTURED:%.*]] = alloca [[STRUCT_ANON:%.*]],
+// CHECK: [[DOTRD_INPUT_:%.*]] = alloca [4 x %struct.kmp_task_red_input_t],
+// CHECK: alloca i32,
+// CHECK: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32,
+// CHECK: [[DOTCAPTURE_EXPR_9:%.*]] = alloca i32,
+// CHECK: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t*
+// CHECK: store i32 0, i32* [[RETVAL]],
+// CHECK: store i32 [[ARGC:%.*]], i32* [[ARGC_ADDR]],
+// CHECK: store i8** [[ARGV:%.*]], i8*** [[ARGV_ADDR]],
+// CHECK: [[TMP1:%.*]] = load i32, i32* [[ARGC_ADDR]],
+// CHECK: [[ADD:%.*]] = add nsw i32 [[TMP1]], 100
+// CHECK: [[TMP2:%.*]] = zext i32 [[ADD]] to i64
+// CHECK: [[VLA:%.+]] = alloca float, i64 %
+
+// CHECK: call void @__kmpc_taskgroup(%struct.ident_t*
+// CHECK-DAG: [[TMP21:%.*]] = bitcast float* [[SUM]] to i8*
+// CHECK-DAG: store i8* [[TMP21]], i8** [[TMP20:%[^,]+]],
+// CHECK-DAG: [[TMP20]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T:%.+]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_:%.+]], i32 0, i32 0
+// CHECK-DAG: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 1
+// CHECK-DAG: store i64 4, i64* [[TMP22]],
+// CHECK-DAG: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 2
+// CHECK-DAG: store i8* bitcast (void (i8*)* @[[RED_INIT1:.+]] to i8*), i8** [[TMP23]],
+// CHECK-DAG: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 3
+// CHECK-DAG: store i8* null, i8** [[TMP24]],
+// CHECK-DAG: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 4
+// CHECK-DAG: store i8* bitcast (void (i8*, i8*)* @[[RED_COMB1:.+]] to i8*), i8** [[TMP25]],
+// CHECK-DAG: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 5
+// CHECK-DAG: [[TMP27:%.*]] = bitcast i32* [[TMP26]] to i8*
+// CHECK-DAG: call void @llvm.memset.p0i8.i64(i8* align 8 [[TMP27]], i8 0, i64 4, i1 false)
+// CHECK-DAG: [[ARRAYIDX5:%.*]] = getelementptr inbounds [100 x %struct.S], [100 x %struct.S]* [[C]], i64 0, i64 0
+// CHECK-DAG: [[LB_ADD_LEN:%.*]] = add nsw i64 -1, %
+// CHECK-DAG: [[ARRAYIDX6:%.*]] = getelementptr inbounds [100 x %struct.S], [100 x %struct.S]* [[C]], i64 0, i64 [[LB_ADD_LEN]]
+// CHECK-DAG: [[TMP31:%.*]] = bitcast %struct.S* [[ARRAYIDX5]] to i8*
+// CHECK-DAG: store i8* [[TMP31]], i8** [[TMP28:%[^,]+]],
+// CHECK-DAG: [[TMP28]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_4:%.+]], i32 0, i32 0
+// CHECK-DAG: [[TMP32:%.*]] = ptrtoint %struct.S* [[ARRAYIDX6]] to i64
+// CHECK-DAG: [[TMP33:%.*]] = ptrtoint %struct.S* [[ARRAYIDX5]] to i64
+// CHECK-DAG: [[TMP34:%.*]] = sub i64 [[TMP32]], [[TMP33]]
+// CHECK-DAG: [[TMP35:%.*]] = sdiv exact i64 [[TMP34]], ptrtoint (float* getelementptr (float, float* null, i32 1) to i64)
+// CHECK-DAG: [[TMP36:%.*]] = add nuw i64 [[TMP35]], 1
+// CHECK-DAG: [[TMP37:%.*]] = mul nuw i64 [[TMP36]], ptrtoint (float* getelementptr (float, float* null, i32 1) to i64)
+// CHECK-DAG: store i64 [[TMP37]], i64* [[TMP38:%[^,]+]],
+// CHECK-DAG: [[TMP38]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_4]], i32 0, i32 1
+// CHECK-DAG: [[TMP39:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_4]], i32 0, i32 2
+// CHECK-DAG: store i8* bitcast (void (i8*)* @[[RED_INIT2:.+]] to i8*), i8** [[TMP39]],
+// CHECK-DAG: [[TMP40:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_4]], i32 0, i32 3
+// CHECK-DAG: store i8* bitcast (void (i8*)* @[[RED_FINI2:.+]] to i8*), i8** [[TMP40]],
+// CHECK-DAG: [[TMP41:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_4]], i32 0, i32 4
+// CHECK-DAG: store i8* bitcast (void (i8*, i8*)* @[[RED_COMB2:.+]] to i8*), i8** [[TMP41]],
+// CHECK-DAG: [[TMP42:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_4]], i32 0, i32 5
+// CHECK-DAG: store i32 1, i32* [[TMP42]],
+// CHECK-DAG: [[TMP44:%.*]] = load float*, float** [[D]],
+// CHECK-DAG: [[TMP45:%.*]] = bitcast float* [[TMP44]] to i8*
+// CHECK-DAG: store i8* [[TMP45]], i8** [[TMP43:%[^,]+]],
+// CHECK-DAG: [[TMP43]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_7:%.+]], i32 0, i32 0
+// CHECK-DAG: [[TMP46:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 1
+// CHECK-DAG: store i64 4, i64* [[TMP46]],
+// CHECK-DAG: [[TMP47:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 2
+// CHECK-DAG: store i8* bitcast (void (i8*)* @[[RED_INIT3:.+]] to i8*), i8** [[TMP47]],
+// CHECK-DAG: [[TMP48:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 3
+// CHECK-DAG: store i8* null, i8** [[TMP48]],
+// CHECK-DAG: [[TMP49:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 4
+// CHECK-DAG: store i8* bitcast (void (i8*, i8*)* @[[RED_COMB3:.+]] to i8*), i8** [[TMP49]],
+// CHECK-DAG: [[TMP50:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 5
+// CHECK-DAG: [[TMP51:%.*]] = bitcast i32* [[TMP50]] to i8*
+// CHECK-DAG: call void @llvm.memset.p0i8.i64(i8* align 8 [[TMP51]], i8 0, i64 4, i1 false)
+// CHECK-DAG: [[TMP53:%.*]] = bitcast float* [[VLA]] to i8*
+// CHECK-DAG: store i8* [[TMP53]], i8** [[TMP52:%[^,]+]],
+// CHECK-DAG: [[TMP52]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_8:%.+]], i32 0, i32 0
+// CHECK-DAG: [[TMP54:%.*]] = mul nuw i64 [[TMP2]], 4
+// CHECK-DAG: [[TMP55:%.*]] = udiv exact i64 [[TMP54]], ptrtoint (float* getelementptr (float, float* null, i32 1) to i64)
+// CHECK-DAG: store i64 [[TMP54]], i64* [[TMP56:%[^,]+]],
+// CHECK-DAG: [[TMP56]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_8]], i32 0, i32 1
+// CHECK-DAG: [[TMP57:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_8]], i32 0, i32 2
+// CHECK-DAG: store i8* bitcast (void (i8*)* @[[RED_INIT4:.+]] to i8*), i8** [[TMP57]],
+// CHECK-DAG: [[TMP58:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_8]], i32 0, i32 3
+// CHECK-DAG: store i8* null, i8** [[TMP58]],
+// CHECK-DAG: [[TMP59:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_8]], i32 0, i32 4
+// CHECK-DAG: store i8* bitcast (void (i8*, i8*)* @[[RED_COMB4:.+]] to i8*), i8** [[TMP59]],
+// CHECK-DAG: [[TMP60:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_8]], i32 0, i32 5
+// CHECK-DAG: store i32 1, i32* [[TMP60]],
+// CHECK-DAG: [[DOTRD_INPUT_GEP_]] = getelementptr inbounds [4 x %struct.kmp_task_red_input_t], [4 x %struct.kmp_task_red_input_t]* [[DOTRD_INPUT_]], i64 0, i64
+// CHECK-DAG: [[DOTRD_INPUT_GEP_4]] = getelementptr inbounds [4 x %struct.kmp_task_red_input_t], [4 x %struct.kmp_task_red_input_t]* [[DOTRD_INPUT_]], i64 0, i64
+// CHECK-DAG: [[DOTRD_INPUT_GEP_7]] = getelementptr inbounds [4 x %struct.kmp_task_red_input_t], [4 x %struct.kmp_task_red_input_t]* [[DOTRD_INPUT_]], i64 0, i64
+// CHECK-DAG: [[DOTRD_INPUT_GEP_8]] = getelementptr inbounds [4 x %struct.kmp_task_red_input_t], [4 x %struct.kmp_task_red_input_t]* [[DOTRD_INPUT_]], i64 0, i64
+// CHECK: [[TMP61:%.*]] = bitcast [4 x %struct.kmp_task_red_input_t]* [[DOTRD_INPUT_]] to i8*
+// CHECK: [[TMP62:%.*]] = call i8* @__kmpc_task_reduction_init(i32 [[TMP0]], i32 4, i8* [[TMP61]])
+// CHECK: [[TMP63:%.*]] = load i32, i32* [[N]],
+// CHECK: store i32 [[TMP63]], i32* [[DOTCAPTURE_EXPR_]],
+// CHECK: [[TMP64:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]],
+// CHECK: [[SUB:%.*]] = sub nsw i32 [[TMP64]], 0
+// CHECK: [[SUB10:%.*]] = sub nsw i32 [[SUB]], 1
+// CHECK: [[ADD11:%.*]] = add nsw i32 [[SUB10]], 1
+// CHECK: [[DIV:%.*]] = sdiv i32 [[ADD11]], 1
+// CHECK: [[SUB12:%.*]] = sub nsw i32 [[DIV]], 1
+// CHECK: store i32 [[SUB12]], i32* [[DOTCAPTURE_EXPR_9]],
+// CHECK: [[TMP65:%.*]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* %{{.+}}, i32 [[TMP0]], i32 1, i64 888, i64 72, i32 (i32, i8*)* bitcast (i32 (i32, %struct.kmp_task_t_with_privates*)* @{{.+}} to i32 (i32, i8*)*))
+// CHECK: call void @__kmpc_taskloop(%struct.ident_t* %{{.+}}, i32 [[TMP0]], i8* [[TMP65]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* null)
+// CHECK: call void @__kmpc_end_taskgroup(%struct.ident_t*
+
+// CHECK: ret i32
+
+// CHECK: define internal void @[[RED_INIT1]](i8* %0)
+// CHECK: store float 0.000000e+00, float* %
+// CHECK: ret void
+
+// CHECK: define internal void @[[RED_COMB1]](i8* %0, i8* %1)
+// CHECK: fadd float %
+// CHECK: store float %{{.+}}, float* %
+// CHECK: ret void
+
+// CHECK: define internal void @[[RED_INIT2]](i8* %0)
+// CHECK: call i8* @__kmpc_threadprivate_cached(
+// CHECK: call i8* @__kmpc_threadprivate_cached(
+// CHECK: call void [[OMP_INIT1:@.+]](
+// CHECK: ret void
+
+// CHECK: define internal void [[OMP_COMB1:@.+]](%struct.S* noalias %0, %struct.S* noalias %1)
+// CHECK: fadd float %
+
+// CHECK: define internal void [[OMP_INIT1]](%struct.S* noalias %0, %struct.S* noalias %1)
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(
+
+// CHECK: define internal void @[[RED_FINI2]](i8* %0)
+// CHECK: call i8* @__kmpc_threadprivate_cached(
+// CHECK: call void @
+// CHECK: ret void
+
+// CHECK: define internal void @[[RED_COMB2]](i8* %0, i8* %1)
+// CHECK: call i8* @__kmpc_threadprivate_cached(
+// CHECK: call void [[OMP_COMB1]](
+// CHECK: ret void
+
+// CHECK: define internal void @[[RED_INIT3]](i8* %0)
+// CHECK: store float 0.000000e+00, float* %
+// CHECK: ret void
+
+// CHECK: define internal void @[[RED_COMB3]](i8* %0, i8* %1)
+// CHECK: fadd float %
+// CHECK: store float %{{.+}}, float* %
+// CHECK: ret void
+
+// CHECK: define internal void @[[RED_INIT4]](i8* %0)
+// CHECK: call i8* @__kmpc_threadprivate_cached(
+// CHECK: store float 0.000000e+00, float* %
+// CHECK: ret void
+
+// CHECK: define internal void @[[RED_COMB4]](i8* %0, i8* %1)
+// CHECK: call i8* @__kmpc_threadprivate_cached(
+// CHECK: fadd float %
+// CHECK: store float %{{.+}}, float* %
+// CHECK: ret void
+
+// CHECK-DAG: !DISubprogram(linkageName: "[[RED_INIT1]]"
+// CHECK-DAG: !DISubprogram(linkageName: "[[RED_COMB1]]"
+// CHECK-DAG: !DISubprogram(linkageName: "[[RED_INIT2]]"
+// CHECK-DAG: !DISubprogram(linkageName: "[[RED_FINI2]]"
+// CHECK-DAG: !DISubprogram(linkageName: "[[RED_COMB2]]"
+// CHECK-DAG: !DISubprogram(linkageName: "[[RED_INIT3]]"
+// CHECK-DAG: !DISubprogram(linkageName: "[[RED_COMB3]]"
+// CHECK-DAG: !DISubprogram(linkageName: "[[RED_INIT4]]"
+// CHECK-DAG: !DISubprogram(linkageName: "[[RED_COMB4]]"
diff --git a/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_reduction_messages.cpp b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_reduction_messages.cpp
new file mode 100644
index 0000000..eabb913
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_reduction_messages.cpp
@@ -0,0 +1,352 @@
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
+
+typedef void **omp_allocator_handle_t;
+extern const omp_allocator_handle_t omp_default_mem_alloc;
+extern const omp_allocator_handle_t omp_large_cap_mem_alloc;
+extern const omp_allocator_handle_t omp_const_mem_alloc;
+extern const omp_allocator_handle_t omp_high_bw_mem_alloc;
+extern const omp_allocator_handle_t omp_low_lat_mem_alloc;
+extern const omp_allocator_handle_t omp_cgroup_mem_alloc;
+extern const omp_allocator_handle_t omp_pteam_mem_alloc;
+extern const omp_allocator_handle_t omp_thread_mem_alloc;
+
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp master taskloop simd reduction(+:fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+void foobar(int &ref) {
+#pragma omp master taskloop simd reduction(+:ref)
+ for (int i = 0; i < 10; ++i)
+ foo();
+}
+
+struct S1; // expected-note {{declared here}} expected-note 4 {{forward declaration of 'S1'}}
+extern S1 a;
+class S2 {
+ mutable int a;
+ S2 &operator+(const S2 &arg) { return (*this); } // expected-note 3 {{implicitly declared private here}}
+
+public:
+ S2() : a(0) {}
+ S2(S2 &s2) : a(s2.a) {}
+ static float S2s; // expected-note 2 {{static data member is predetermined as shared}}
+ static const float S2sc; // expected-note 2 {{'S2sc' declared here}}
+};
+const float S2::S2sc = 0;
+S2 b; // expected-note 3 {{'b' defined here}}
+const S2 ba[5]; // expected-note 2 {{'ba' defined here}}
+class S3 {
+ int a;
+
+public:
+ int b;
+ S3() : a(0) {}
+ S3(const S3 &s3) : a(s3.a) {}
+ S3 operator+(const S3 &arg1) { return arg1; }
+};
+int operator+(const S3 &arg1, const S3 &arg2) { return 5; }
+S3 c; // expected-note 3 {{'c' defined here}}
+const S3 ca[5]; // expected-note 2 {{'ca' defined here}}
+extern const int f; // expected-note 4 {{'f' declared here}}
+class S4 {
+ int a;
+ S4(); // expected-note {{implicitly declared private here}}
+ S4(const S4 &s4);
+ S4 &operator+(const S4 &arg) { return (*this); }
+
+public:
+ S4(int v) : a(v) {}
+};
+S4 &operator&=(S4 &arg1, S4 &arg2) { return arg1; }
+class S5 {
+ int a;
+ S5() : a(0) {} // expected-note {{implicitly declared private here}}
+ S5(const S5 &s5) : a(s5.a) {}
+ S5 &operator+(const S5 &arg);
+
+public:
+ S5(int v) : a(v) {}
+};
+class S6 { // expected-note 3 {{candidate function (the implicit copy assignment operator) not viable: no known conversion from 'int' to 'const S6' for 1st argument}}
+#if __cplusplus >= 201103L // C++11 or later
+// expected-note@-2 3 {{candidate function (the implicit move assignment operator) not viable}}
+#endif
+ int a;
+
+public:
+ S6() : a(6) {}
+ operator int() { return 6; }
+} o;
+
+struct S7 {
+ int a: 32;
+ S7() {
+#pragma omp taskloop reduction(+:a) // expected-error {{expected addressable reduction item for the task-based directives}}
+ for (int i = 0; i < 10; ++i)
+ ++a;
+ }
+};
+
+S3 h, k;
+#pragma omp threadprivate(h) // expected-note 2 {{defined as threadprivate or thread local}}
+
+template <class T> // expected-note {{declared here}}
+T tmain(T argc) {
+ const T d = T(); // expected-note 4 {{'d' defined here}}
+ const T da[5] = {T()}; // expected-note 2 {{'da' defined here}}
+ T qa[5] = {T()};
+ T i, z;
+ T &j = i; // expected-note 4 {{'j' defined here}}
+ S3 &p = k; // expected-note 2 {{'p' defined here}}
+ const T &r = da[(int)i]; // expected-note 2 {{'r' defined here}}
+ T &q = qa[(int)i]; // expected-note 2 {{'q' defined here}}
+ T fl;
+#pragma omp master taskloop simd reduction // expected-error {{expected '(' after 'reduction'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction + // expected-error {{expected '(' after 'reduction'}} expected-warning {{extra tokens at the end of '#pragma omp master taskloop simd' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction( // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(- // expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction() // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(*) // expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected expression}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(\) // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(& : argc // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{invalid operands to binary expression ('float' and 'float')}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(| : argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{invalid operands to binary expression ('float' and 'float')}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(|| : argc ? i : argc) // expected-error 2 {{expected variable name, array element or array section}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(foo : argc) //expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'float'}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'int'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(^ : T) // expected-error {{'T' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 4 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 3 {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(max : h.b) // expected-error {{expected variable name, array element or array section}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(+ : ba) // expected-error {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(* : z, ca) // expected-error {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(- : da) // expected-error {{const-qualified variable cannot be reduction}} expected-error {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(^ : fl) // expected-error {{invalid operands to binary expression ('float' and 'float')}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(&& : S2::S2s) // expected-error {{shared variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(+ : h, k) // expected-error {{threadprivate or thread local variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(+ : o) // expected-error 2 {{no viable overloaded '='}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd private(i), reduction(+ : j), reduction(+ : q) // expected-error 4 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel private(k)
+#pragma omp master taskloop simd reduction(+ : p), reduction(+ : p) // expected-error 2 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(+ : p), reduction(+ : p) // expected-error 2 {{variable can appear only once in OpenMP 'reduction' clause}} expected-note 2 {{previously referenced here}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(+ : r) // expected-error 2 {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel shared(i)
+#pragma omp parallel reduction(min : i)
+#pragma omp master taskloop simd reduction(max : j) // expected-error 2 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel private(fl)
+#pragma omp master taskloop simd reduction(+ : fl) allocate(omp_thread_mem_alloc: fl) // expected-warning 2 {{allocator with the 'thread' trait access has unspecified behavior on 'master taskloop simd' directive}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel reduction(* : fl)
+#pragma omp master taskloop simd reduction(+ : fl)
+ for (int i = 0; i < 10; ++i)
+ foo();
+
+ return T();
+}
+
+namespace A {
+double x;
+#pragma omp threadprivate(x) // expected-note {{defined as threadprivate or thread local}}
+}
+namespace B {
+using A::x;
+}
+
+int main(int argc, char **argv) {
+ const int d = 5; // expected-note 2 {{'d' defined here}}
+ const int da[5] = {0}; // expected-note {{'da' defined here}}
+ int qa[5] = {0};
+ S4 e(4);
+ S5 g(5);
+ int i, z;
+ int &j = i; // expected-note 2 {{'j' defined here}}
+ S3 &p = k; // expected-note 2 {{'p' defined here}}
+ const int &r = da[i]; // expected-note {{'r' defined here}}
+ int &q = qa[i]; // expected-note {{'q' defined here}}
+ float fl;
+#pragma omp master taskloop simd reduction // expected-error {{expected '(' after 'reduction'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction + // expected-error {{expected '(' after 'reduction'}} expected-warning {{extra tokens at the end of '#pragma omp master taskloop simd' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction( // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(- // expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction() // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(*) // expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected expression}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(\) // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(foo : argc // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(| : argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(|| : argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name, array element or array section}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(~ : argc) // expected-error {{expected unqualified-id}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(&& : argc, z)
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(^ : S1) // expected-error {{'S1' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{const-qualified variable cannot be reduction}} expected-error {{'operator+' is a private member of 'S2'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 2 {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(max : h.b) // expected-error {{expected variable name, array element or array section}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(+ : ba) // expected-error {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(* : ca) // expected-error {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(- : da) // expected-error {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(^ : fl) // expected-error {{invalid operands to binary expression ('float' and 'float')}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(&& : S2::S2s) // expected-error {{shared variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{invalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(+ : o) // expected-error {{no viable overloaded '='}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd private(i), reduction(+ : j), reduction(+ : q) // expected-error 2 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel private(k)
+#pragma omp master taskloop simd reduction(+ : p), reduction(+ : p) // expected-error 2 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(+ : p), reduction(+ : p) // expected-error {{variable can appear only once in OpenMP 'reduction' clause}} expected-note {{previously referenced here}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp master taskloop simd reduction(+ : r) // expected-error {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel shared(i)
+#pragma omp parallel reduction(min : i)
+#pragma omp master taskloop simd reduction(max : j) // expected-error {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel private(fl)
+#pragma omp master taskloop simd reduction(+ : fl)
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel reduction(* : fl)
+#pragma omp master taskloop simd reduction(+ : fl)
+ for (int i = 0; i < 10; ++i)
+ foo();
+ static int m;
+#pragma omp master taskloop simd reduction(+ : m) // OK
+ for (int i = 0; i < 10; ++i)
+ m++;
+#pragma omp master taskloop simd reduction(+ : m) nogroup // expected-error {{'reduction' clause cannot be used with 'nogroup' clause}}
+ for (int i = 0; i < 10; ++i)
+ m++;
+
+ return tmain(argc) + tmain(fl); // expected-note {{in instantiation of function template specialization 'tmain<int>' requested here}} expected-note {{in instantiation of function template specialization 'tmain<float>' requested here}}
+}
diff --git a/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_safelen_messages.cpp b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_safelen_messages.cpp
new file mode 100644
index 0000000..bdf4f6b
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_safelen_messages.cpp
@@ -0,0 +1,106 @@
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
+
+void foo() {
+}
+
+#if __cplusplus >= 201103L
+// expected-note@+2 4 {{declared here}}
+#endif
+bool foobool(int argc) {
+ return argc;
+}
+
+struct S1; // expected-note {{declared here}}
+
+template <class T, typename S, int N, int ST> // expected-note {{declared here}}
+T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
+ #pragma omp master taskloop simd safelen // expected-error {{expected '(' after 'safelen'}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp master taskloop simd safelen ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp master taskloop simd safelen () // expected-error {{expected expression}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ // expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
+ // expected-error@+2 2 {{expression is not an integral constant expression}}
+ // expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
+ #pragma omp master taskloop simd safelen (argc
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ // expected-error@+1 {{argument to 'safelen' clause must be a strictly positive integer value}}
+ #pragma omp master taskloop simd safelen (ST // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp master taskloop simd safelen (1)) // expected-warning {{extra tokens at the end of '#pragma omp master taskloop simd' are ignored}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp master taskloop simd safelen ((ST > 0) ? 1 + ST : 2)
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ // expected-error@+6 2 {{directive '#pragma omp master taskloop simd' cannot contain more than one 'safelen' clause}}
+ // expected-error@+5 {{argument to 'safelen' clause must be a strictly positive integer value}}
+ // expected-error@+4 2 {{expression is not an integral constant expression}}
+#if __cplusplus >= 201103L
+ // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
+#endif
+ #pragma omp master taskloop simd safelen (foobool(argc)), safelen (true), safelen (-5)
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp master taskloop simd safelen (S) // expected-error {{'S' does not refer to a value}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+#if __cplusplus <= 199711L
+ // expected-error@+4 2 {{expression is not an integral constant expression}}
+#else
+ // expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
+#endif
+ #pragma omp master taskloop simd safelen (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp master taskloop simd safelen (4)
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp master taskloop simd safelen (N) // expected-error {{argument to 'safelen' clause must be a strictly positive integer value}}
+ for (T i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ return argc;
+}
+
+int main(int argc, char **argv) {
+ #pragma omp master taskloop simd safelen // expected-error {{expected '(' after 'safelen'}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ #pragma omp master taskloop simd safelen ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ #pragma omp master taskloop simd safelen () // expected-error {{expected expression}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ #pragma omp master taskloop simd safelen (4 // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ #pragma omp master taskloop simd safelen (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp master taskloop simd' are ignored}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ // expected-error@+4 {{expression is not an integral constant expression}}
+#if __cplusplus >= 201103L
+ // expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
+#endif
+ #pragma omp master taskloop simd safelen (foobool(1) > 0 ? 1 : 2)
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ // expected-error@+6 {{expression is not an integral constant expression}}
+#if __cplusplus >= 201103L
+ // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
+#endif
+ // expected-error@+2 2 {{directive '#pragma omp master taskloop simd' cannot contain more than one 'safelen' clause}}
+ // expected-error@+1 {{argument to 'safelen' clause must be a strictly positive integer value}}
+ #pragma omp master taskloop simd safelen (foobool(argc)), safelen (true), safelen (-5)
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ #pragma omp master taskloop simd safelen (S1) // expected-error {{'S1' does not refer to a value}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+#if __cplusplus <= 199711L
+ // expected-error@+4 {{expression is not an integral constant expression}}
+#else
+ // expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
+#endif
+ #pragma omp master taskloop simd safelen (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ // expected-error@+3 {{statement after '#pragma omp master taskloop simd' must be a for loop}}
+ // expected-note@+1 {{in instantiation of function template specialization 'tmain<int, char, -1, -2>' requested here}}
+ #pragma omp master taskloop simd safelen(safelen(tmain<int, char, -1, -2>(argc, argv) // expected-error 2 {{expected ')'}} expected-note 2 {{to match this '('}}
+ foo();
+ // expected-note@+1 {{in instantiation of function template specialization 'tmain<int, char, 12, 4>' requested here}}
+ return tmain<int, char, 12, 4>(argc, argv);
+}
+
diff --git a/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_simdlen_messages.cpp b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_simdlen_messages.cpp
new file mode 100644
index 0000000..2deb98d
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/master_taskloop_simd_simdlen_messages.cpp
@@ -0,0 +1,106 @@
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
+
+void foo() {
+}
+
+#if __cplusplus >= 201103L
+// expected-note@+2 4 {{declared here}}
+#endif
+bool foobool(int argc) {
+ return argc;
+}
+
+struct S1; // expected-note {{declared here}}
+
+template <class T, typename S, int N, int ST> // expected-note {{declared here}}
+T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
+ #pragma omp master taskloop simd simdlen // expected-error {{expected '(' after 'simdlen'}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp master taskloop simd simdlen ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp master taskloop simd simdlen () // expected-error {{expected expression}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ // expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
+ // expected-error@+2 2 {{expression is not an integral constant expression}}
+ // expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
+ #pragma omp master taskloop simd simdlen (argc
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ // expected-error@+1 {{argument to 'simdlen' clause must be a strictly positive integer value}}
+ #pragma omp master taskloop simd simdlen (ST // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp master taskloop simd simdlen (1)) // expected-warning {{extra tokens at the end of '#pragma omp master taskloop simd' are ignored}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp master taskloop simd simdlen ((ST > 0) ? 1 + ST : 2)
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ // expected-error@+6 2 {{directive '#pragma omp master taskloop simd' cannot contain more than one 'simdlen' clause}}
+ // expected-error@+5 {{argument to 'simdlen' clause must be a strictly positive integer value}}
+ // expected-error@+4 2 {{expression is not an integral constant expression}}
+#if __cplusplus >= 201103L
+ // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
+#endif
+ #pragma omp master taskloop simd simdlen (foobool(argc)), simdlen (true), simdlen (-5)
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp master taskloop simd simdlen (S) // expected-error {{'S' does not refer to a value}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+#if __cplusplus <= 199711L
+ // expected-error@+4 2 {{expression is not an integral constant expression}}
+#else
+ // expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
+#endif
+ #pragma omp master taskloop simd simdlen (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp master taskloop simd simdlen (4)
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp master taskloop simd simdlen (N) // expected-error {{argument to 'simdlen' clause must be a strictly positive integer value}}
+ for (T i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ return argc;
+}
+
+int main(int argc, char **argv) {
+ #pragma omp master taskloop simd simdlen // expected-error {{expected '(' after 'simdlen'}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ #pragma omp master taskloop simd simdlen ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ #pragma omp master taskloop simd simdlen () // expected-error {{expected expression}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ #pragma omp master taskloop simd simdlen (4 // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ #pragma omp master taskloop simd simdlen (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp master taskloop simd' are ignored}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ // expected-error@+4 {{expression is not an integral constant expression}}
+#if __cplusplus >= 201103L
+ // expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
+#endif
+ #pragma omp master taskloop simd simdlen (foobool(1) > 0 ? 1 : 2)
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ // expected-error@+6 {{expression is not an integral constant expression}}
+#if __cplusplus >= 201103L
+ // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
+#endif
+ // expected-error@+2 2 {{directive '#pragma omp master taskloop simd' cannot contain more than one 'simdlen' clause}}
+ // expected-error@+1 {{argument to 'simdlen' clause must be a strictly positive integer value}}
+ #pragma omp master taskloop simd simdlen (foobool(argc)), simdlen (true), simdlen (-5)
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ #pragma omp master taskloop simd simdlen (S1) // expected-error {{'S1' does not refer to a value}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+#if __cplusplus <= 199711L
+ // expected-error@+4 {{expression is not an integral constant expression}}
+#else
+ // expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
+#endif
+ #pragma omp master taskloop simd simdlen (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ // expected-error@+3 {{statement after '#pragma omp master taskloop simd' must be a for loop}}
+ // expected-note@+1 {{in instantiation of function template specialization 'tmain<int, char, -1, -2>' requested here}}
+ #pragma omp master taskloop simd simdlen(simdlen(tmain<int, char, -1, -2>(argc, argv) // expected-error 2 {{expected ')'}} expected-note 2 {{to match this '('}}
+ foo();
+ // expected-note@+1 {{in instantiation of function template specialization 'tmain<int, char, 12, 4>' requested here}}
+ return tmain<int, char, 12, 4>(argc, argv);
+}
+
diff --git a/src/llvm-project/clang/test/OpenMP/nesting_of_regions.cpp b/src/llvm-project/clang/test/OpenMP/nesting_of_regions.cpp
index fc9230c..ac9ed96 100644
--- a/src/llvm-project/clang/test/OpenMP/nesting_of_regions.cpp
+++ b/src/llvm-project/clang/test/OpenMP/nesting_of_regions.cpp
@@ -1,6 +1,10 @@
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify=expected,omp45,omp45warn %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -verify=expected,omp50 %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=45 -verify=expected,omp45 -Wno-openmp %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=45 -verify=expected,omp45 -Wno-source-uses-openmp %s
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify=expected,omp45,omp45warn %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -verify=expected,omp50 %s
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
void bar();
@@ -59,6 +63,11 @@
bar();
}
#pragma omp parallel
+#pragma omp parallel master
+ {
+ bar();
+ }
+#pragma omp parallel
#pragma omp task
{
bar();
@@ -227,7 +236,7 @@
}
#pragma omp simd
for (int i = 0; i < 10; ++i) {
-#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
+#pragma omp simd // omp45warn-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
for (int i = 0; i < 10; ++i)
;
}
@@ -299,6 +308,13 @@
}
#pragma omp simd
for (int i = 0; i < 10; ++i) {
+#pragma omp parallel master // expected-error {{OpenMP constructs may not be nested inside a simd region}}
+ {
+ bar();
+ }
+ }
+#pragma omp simd
+ for (int i = 0; i < 10; ++i) {
#pragma omp task // expected-error {{OpenMP constructs may not be nested inside a simd region}}
{
bar();
@@ -341,7 +357,7 @@
}
#pragma omp simd
for (int i = 0; i < 10; ++i) {
-#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}
+#pragma omp atomic // omp45-error {{OpenMP constructs may not be nested inside a simd region}}
++a;
}
#pragma omp simd
@@ -468,7 +484,7 @@
for (int j = 0; j < 10; ++j)
;
}
-
+
// FOR DIRECTIVE
#pragma omp for
for (int i = 0; i < 10; ++i) {
@@ -561,6 +577,13 @@
}
#pragma omp for
for (int i = 0; i < 10; ++i) {
+#pragma omp parallel master
+ {
+ bar();
+ }
+ }
+#pragma omp for
+ for (int i = 0; i < 10; ++i) {
#pragma omp parallel sections
{
bar();
@@ -742,7 +765,7 @@
}
#pragma omp for simd
for (int i = 0; i < 10; ++i) {
-#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
+#pragma omp simd // omp45warn-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
for (int i = 0; i < 10; ++i)
;
}
@@ -807,6 +830,13 @@
}
#pragma omp for simd
for (int i = 0; i < 10; ++i) {
+#pragma omp parallel master // expected-error {{OpenMP constructs may not be nested inside a simd region}}
+ {
+ bar();
+ }
+ }
+#pragma omp for simd
+ for (int i = 0; i < 10; ++i) {
#pragma omp parallel sections // expected-error {{OpenMP constructs may not be nested inside a simd region}}
{
bar();
@@ -856,7 +886,7 @@
}
#pragma omp for simd
for (int i = 0; i < 10; ++i) {
-#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}
+#pragma omp atomic // omp45-error {{OpenMP constructs may not be nested inside a simd region}}
++a;
}
#pragma omp for simd
@@ -1043,6 +1073,13 @@
}
#pragma omp sections
{
+#pragma omp parallel master
+ {
+ bar();
+ }
+ }
+#pragma omp sections
+ {
#pragma omp parallel
{
#pragma omp master // OK
@@ -1319,6 +1356,16 @@
{
#pragma omp section
{
+#pragma omp parallel master
+ bar();
+#pragma omp critical
+ bar();
+ }
+ }
+#pragma omp sections
+ {
+#pragma omp section
+ {
#pragma omp single // expected-error {{region cannot be closely nested inside 'section' region; perhaps you forget to enclose 'omp single' directive into a parallel region?}}
bar();
#pragma omp master // expected-error {{region cannot be closely nested inside 'section' region}}
@@ -1631,6 +1678,13 @@
}
#pragma omp single
{
+#pragma omp parallel master
+ {
+ bar();
+ }
+ }
+#pragma omp single
+ {
#pragma omp critical
{
bar();
@@ -1920,6 +1974,26 @@
}
#pragma omp master
{
+#pragma omp parallel master // OK
+ {
+ bar();
+ }
+#pragma omp parallel
+ {
+#pragma omp for // OK
+ for (int i = 0; i < 10; ++i)
+ ;
+#pragma omp for simd // OK
+ for (int i = 0; i < 10; ++i)
+ ;
+#pragma omp sections // OK
+ {
+ bar();
+ }
+ }
+ }
+#pragma omp master
+ {
#pragma omp parallel for
for (int i = 0; i < 10; ++i)
;
@@ -2175,6 +2249,13 @@
}
#pragma omp critical
{
+#pragma omp parallel master
+ {
+ bar();
+ }
+ }
+#pragma omp critical
+ {
#pragma omp parallel for
for (int i = 0; i < 10; ++i)
;
@@ -2647,7 +2728,7 @@
}
#pragma omp parallel for simd
for (int i = 0; i < 10; ++i) {
-#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
+#pragma omp simd // omp45warn-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
for (int i = 0; i < 10; ++i)
;
}
@@ -2779,7 +2860,7 @@
}
#pragma omp parallel for simd
for (int i = 0; i < 10; ++i) {
-#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}
+#pragma omp atomic // omp45-error {{OpenMP constructs may not be nested inside a simd region}}
++a;
}
#pragma omp parallel for simd
@@ -2908,6 +2989,281 @@
;
}
+// PARALLEL MASTER DIRECTIVE
+#pragma omp parallel master
+ {
+#pragma omp for // expected-error {{region cannot be closely nested inside 'parallel master' region; perhaps you forget to enclose 'omp for' directive into a parallel region?}}
+ for (int i = 0; i < 10; ++i)
+ ;
+ }
+#pragma omp parallel master
+ {
+#pragma omp simd
+ for (int i = 0; i < 10; ++i)
+ ;
+ }
+#pragma omp parallel master
+ {
+#pragma omp for simd // expected-error {{region cannot be closely nested inside 'parallel master' region; perhaps you forget to enclose 'omp for simd' directive into a parallel region?}}
+ for (int i = 0; i < 10; ++i)
+ ;
+ }
+#pragma omp parallel master
+ {
+#pragma omp parallel
+ for (int i = 0; i < 10; ++i)
+ ;
+ }
+#pragma omp parallel master
+ {
+#pragma omp single // expected-error {{region cannot be closely nested inside 'parallel master' region; perhaps you forget to enclose 'omp single' directive into a parallel region?}}
+ {
+ bar();
+ }
+ }
+#pragma omp parallel master
+ {
+#pragma omp master // OK, though second 'master' is redundant
+ {
+ bar();
+ }
+ }
+#pragma omp parallel master
+ {
+#pragma omp critical
+ {
+ bar();
+ }
+ }
+#pragma omp parallel master
+ {
+#pragma omp sections // expected-error {{region cannot be closely nested inside 'parallel master' region; perhaps you forget to enclose 'omp sections' directive into a parallel region?}}
+ {
+ bar();
+ }
+ }
+#pragma omp parallel master
+ {
+#pragma omp parallel
+ {
+#pragma omp parallel master // OK
+ {
+ bar();
+ }
+#pragma omp for // OK
+ for (int i = 0; i < 10; ++i)
+ ;
+#pragma omp for simd // OK
+ for (int i = 0; i < 10; ++i)
+ ;
+#pragma omp sections // OK
+ {
+ bar();
+ }
+ }
+ }
+#pragma omp parallel master
+ {
+#pragma omp parallel master // OK
+ {
+ bar();
+ }
+#pragma omp parallel
+ {
+#pragma omp for // OK
+ for (int i = 0; i < 10; ++i)
+ ;
+#pragma omp for simd // OK
+ for (int i = 0; i < 10; ++i)
+ ;
+#pragma omp sections // OK
+ {
+ bar();
+ }
+ }
+ }
+#pragma omp parallel master
+ {
+#pragma omp parallel for
+ for (int i = 0; i < 10; ++i)
+ ;
+ }
+#pragma omp parallel master
+ {
+#pragma omp parallel for simd
+ for (int i = 0; i < 10; ++i)
+ ;
+ }
+#pragma omp parallel master
+ {
+#pragma omp parallel sections
+ {
+ bar();
+ }
+ }
+#pragma omp parallel master
+ {
+#pragma omp task
+ {
+ bar();
+ }
+ }
+#pragma omp parallel master
+ {
+#pragma omp taskyield
+ bar();
+ }
+#pragma omp parallel master
+ {
+#pragma omp barrier // expected-error {{region cannot be closely nested inside 'parallel master' region}}
+ bar();
+ }
+#pragma omp parallel master
+ {
+#pragma omp taskwait
+ bar();
+ }
+#pragma omp parallel master
+ {
+#pragma omp flush
+ bar();
+ }
+#pragma omp parallel master
+ {
+#pragma omp ordered // expected-error {{region cannot be closely nested inside 'parallel master' region; perhaps you forget to enclose 'omp ordered' directive into a for or a parallel for region with 'ordered' clause?}}
+ bar();
+ }
+#pragma omp parallel master
+ {
+#pragma omp atomic
+ ++a;
+ }
+#pragma omp parallel master
+ {
+#pragma omp target
+ ++a;
+ }
+#pragma omp parallel master
+ {
+#pragma omp target parallel
+ ++a;
+ }
+#pragma omp parallel master
+ {
+#pragma omp target parallel for
+ for (int i = 0; i < 10; ++i)
+ ;
+ }
+#pragma omp parallel master
+ {
+#pragma omp target enter data map(to: a)
+ ++a;
+ }
+#pragma omp parallel master
+ {
+#pragma omp target exit data map(from: a)
+ ++a;
+ }
+#pragma omp parallel master
+ {
+#pragma omp teams // expected-error {{region cannot be closely nested inside 'parallel master' region; perhaps you forget to enclose 'omp teams' directive into a target region?}}
+ ++a;
+ }
+#pragma omp parallel master
+ {
+#pragma omp taskloop
+ for (int i = 0; i < 10; ++i)
+ ++a;
+ }
+#pragma omp parallel master
+ {
+#pragma omp distribute // expected-error {{region cannot be closely nested inside 'parallel master' region; perhaps you forget to enclose 'omp distribute' directive into a teams region?}}
+ for (int i = 0; i < 10; ++i)
+ ;
+ }
+#pragma omp parallel master
+ {
+#pragma omp target update to(a)
+ bar();
+ }
+#pragma omp parallel master
+ {
+#pragma omp distribute parallel for // expected-error {{region cannot be closely nested inside 'parallel master' region; perhaps you forget to enclose 'omp distribute parallel for' directive into a teams region?}}
+ for (int i = 0; i < 10; ++i)
+ ;
+ }
+#pragma omp parallel master
+ {
+#pragma omp distribute parallel for simd // expected-error {{region cannot be closely nested inside 'parallel master' region; perhaps you forget to enclose 'omp distribute parallel for simd' directive into a teams region?}}
+ for (int i = 0; i < 10; ++i)
+ ;
+ }
+#pragma omp parallel master
+ {
+#pragma omp distribute simd // expected-error {{region cannot be closely nested inside 'parallel master' region; perhaps you forget to enclose 'omp distribute simd' directive into a teams region?}}
+ for (int i = 0; i < 10; ++i)
+ ;
+ }
+#pragma omp parallel master
+ {
+#pragma omp target simd // OK
+ for (int i = 0; i < 10; ++i)
+ ;
+ }
+#pragma omp parallel master
+ {
+#pragma omp teams distribute // expected-error {{region cannot be closely nested inside 'parallel master' region; perhaps you forget to enclose 'omp teams distribute' directive into a target region?}}
+ for (int i = 0; i < 10; ++i)
+ ;
+ }
+#pragma omp parallel master
+ {
+#pragma omp teams distribute simd // expected-error {{region cannot be closely nested inside 'parallel master' region; perhaps you forget to enclose 'omp teams distribute simd' directive into a target region?}}
+ for (int i = 0; i < 10; ++i)
+ ;
+ }
+#pragma omp parallel master
+ {
+#pragma omp teams distribute parallel for simd // expected-error {{region cannot be closely nested inside 'parallel master' region; perhaps you forget to enclose 'omp teams distribute parallel for simd' directive into a target region?}}
+ for (int i = 0; i < 10; ++i)
+ ;
+ }
+#pragma omp parallel master
+ {
+#pragma omp teams distribute parallel for // expected-error {{region cannot be closely nested inside 'parallel master' region; perhaps you forget to enclose 'omp teams distribute parallel for' directive into a target region?}}
+ for (int i = 0; i < 10; ++i)
+ ;
+ }
+#pragma omp parallel master
+ {
+#pragma omp target teams // OK
+ a++;
+ }
+#pragma omp parallel master
+ {
+#pragma omp target teams distribute // OK
+ for (int i = 0; i < 10; ++i)
+ ;
+ }
+#pragma omp parallel master
+ {
+#pragma omp target teams distribute parallel for // OK
+ for (int i = 0; i < 10; ++i)
+ ;
+ }
+#pragma omp parallel master
+ {
+#pragma omp target teams distribute parallel for simd // OK
+ for (int i = 0; i < 10; ++i)
+ ;
+ }
+#pragma omp parallel master
+ {
+#pragma omp target teams distribute simd // OK
+ for (int i = 0; i < 10; ++i)
+ ;
+ }
+
// PARALLEL SECTIONS DIRECTIVE
#pragma omp parallel sections
{
@@ -3720,6 +4076,15 @@
// expected-error@+2 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
// expected-note@+1 {{expected an expression statement}}
{
+#pragma omp parallel master // expected-error {{OpenMP constructs may not be nested inside an atomic region}}
+ {
+ bar();
+ }
+ }
+#pragma omp atomic
+ // expected-error@+2 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}}
+ // expected-note@+1 {{expected an expression statement}}
+ {
#pragma omp critical // expected-error {{OpenMP constructs may not be nested inside an atomic region}}
{
bar();
@@ -4104,7 +4469,7 @@
++a;
}
#pragma omp target
- {
+ {
#pragma omp distribute // expected-error {{region cannot be closely nested inside 'target' region; perhaps you forget to enclose 'omp distribute' directive into a teams region?}}
for (int i = 0; i < 10; ++i)
;
@@ -4122,79 +4487,79 @@
#pragma omp target update to(a) // expected-error {{region cannot be nested inside 'target' region}}
}
#pragma omp target
- {
+ {
#pragma omp distribute parallel for // expected-error {{region cannot be closely nested inside 'target' region; perhaps you forget to enclose 'omp distribute parallel for' directive into a teams region?}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target
- {
+ {
#pragma omp distribute parallel for simd // expected-error {{region cannot be closely nested inside 'target' region; perhaps you forget to enclose 'omp distribute parallel for simd' directive into a teams region?}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target
- {
+ {
#pragma omp distribute simd // expected-error {{region cannot be closely nested inside 'target' region; perhaps you forget to enclose 'omp distribute simd' directive into a teams region?}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target
- {
+ {
#pragma omp target simd // expected-error {{region cannot be nested inside 'target' region}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target
- {
+ {
#pragma omp teams distribute // OK
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target
- {
+ {
#pragma omp teams distribute simd // OK
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target
- {
+ {
#pragma omp teams distribute parallel for simd // OK
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target
- {
+ {
#pragma omp teams distribute parallel for // OK
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target
- {
+ {
#pragma omp target teams // expected-error {{region cannot be nested inside 'target' region}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target
- {
+ {
#pragma omp target teams distribute // expected-error {{region cannot be nested inside 'target' region}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target
- {
+ {
#pragma omp target teams distribute parallel for // expected-error {{region cannot be nested inside 'target' region}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target
- {
+ {
#pragma omp target teams distribute parallel for simd // expected-error {{region cannot be nested inside 'target' region}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target
- {
+ {
#pragma omp target teams distribute simd // expected-error {{region cannot be nested inside 'target' region}}
for (int i = 0; i < 10; ++i)
;
@@ -4235,6 +4600,11 @@
{
bar();
}
+#pragma omp target
+#pragma omp parallel master
+ {
+ bar();
+ }
#pragma omp target parallel
#pragma omp critical
{
@@ -4320,7 +4690,7 @@
++a;
}
#pragma omp target parallel
- {
+ {
#pragma omp distribute // expected-error {{region cannot be closely nested inside 'target parallel' region; perhaps you forget to enclose 'omp distribute' directive into a teams region?}}
for (int i = 0; i < 10; ++i)
;
@@ -4338,78 +4708,78 @@
#pragma omp target update to(a) // expected-error {{region cannot be nested inside 'target parallel' region}}
}
#pragma omp target parallel
- {
+ {
#pragma omp distribute parallel for // expected-error {{region cannot be closely nested inside 'target parallel' region; perhaps you forget to enclose 'omp distribute parallel for' directive into a teams region?}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target parallel
- {
+ {
#pragma omp distribute parallel for simd // expected-error {{region cannot be closely nested inside 'target parallel' region; perhaps you forget to enclose 'omp distribute parallel for simd' directive into a teams region?}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target parallel
- {
+ {
#pragma omp distribute simd // expected-error {{region cannot be closely nested inside 'target parallel' region; perhaps you forget to enclose 'omp distribute simd' directive into a teams region?}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target parallel
- {
+ {
#pragma omp target simd // expected-error {{region cannot be nested inside 'target parallel' region}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target parallel
- {
+ {
#pragma omp teams distribute // expected-error {{region cannot be closely nested inside 'target parallel' region; perhaps you forget to enclose 'omp teams distribute' directive into a target region?}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target parallel
- {
+ {
#pragma omp teams distribute simd // expected-error {{region cannot be closely nested inside 'target parallel' region; perhaps you forget to enclose 'omp teams distribute simd' directive into a target region?}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target parallel
- {
+ {
#pragma omp teams distribute parallel for simd // expected-error {{region cannot be closely nested inside 'target parallel' region; perhaps you forget to enclose 'omp teams distribute parallel for simd' directive into a target region?}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target parallel
- {
+ {
#pragma omp teams distribute parallel for // expected-error {{region cannot be closely nested inside 'target parallel' region; perhaps you forget to enclose 'omp teams distribute parallel for' directive into a target region?}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target parallel
- {
+ {
#pragma omp target teams // expected-error {{region cannot be nested inside 'target parallel' region}}
a++;
}
#pragma omp target parallel
- {
+ {
#pragma omp target teams distribute // expected-error {{region cannot be nested inside 'target parallel' region}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target parallel
- {
+ {
#pragma omp target teams distribute parallel for // expected-error {{region cannot be nested inside 'target parallel' region}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target parallel
- {
+ {
#pragma omp target teams distribute parallel for simd // expected-error {{region cannot be nested inside 'target parallel' region}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target parallel
- {
+ {
#pragma omp target teams distribute simd // expected-error {{region cannot be nested inside 'target parallel' region}}
for (int i = 0; i < 10; ++i)
;
@@ -4611,60 +4981,60 @@
#pragma omp distribute parallel for // expected-error {{region cannot be closely nested inside 'target parallel for' region; perhaps you forget to enclose 'omp distribute parallel for' directive into a teams region?}}
for (int j = 0; j < 10; ++j)
;
- }
+ }
#pragma omp target parallel for
for (int i = 0; i < 10; ++i) {
#pragma omp distribute parallel for simd // expected-error {{region cannot be closely nested inside 'target parallel for' region; perhaps you forget to enclose 'omp distribute parallel for simd' directive into a teams region?}}
for (int j = 0; j < 10; ++j)
;
- }
+ }
#pragma omp target parallel for
for (int i = 0; i < 10; ++i) {
#pragma omp distribute simd // expected-error {{region cannot be closely nested inside 'target parallel for' region; perhaps you forget to enclose 'omp distribute simd' directive into a teams region?}}
for (int j = 0; j < 10; ++j)
;
- }
+ }
#pragma omp target parallel for
for (int i = 0; i < 10; ++i) {
#pragma omp target simd // expected-error {{region cannot be nested inside 'target parallel for' region}}
for (int j = 0; j < 10; ++j)
;
- }
+ }
#pragma omp target parallel for
for (int i = 0; i < 10; ++i) {
#pragma omp teams distribute // expected-error {{region cannot be closely nested inside 'target parallel for' region; perhaps you forget to enclose 'omp teams distribute' directive into a target region?}}
for (int j = 0; j < 10; ++j)
;
- }
+ }
#pragma omp target parallel for
for (int i = 0; i < 10; ++i) {
#pragma omp teams distribute simd // expected-error {{region cannot be closely nested inside 'target parallel for' region; perhaps you forget to enclose 'omp teams distribute simd' directive into a target region?}}
for (int j = 0; j < 10; ++j)
;
- }
+ }
#pragma omp target parallel for
for (int i = 0; i < 10; ++i) {
#pragma omp teams distribute parallel for simd // expected-error {{region cannot be closely nested inside 'target parallel for' region; perhaps you forget to enclose 'omp teams distribute parallel for simd' directive into a target region?}}
for (int j = 0; j < 10; ++j)
;
- }
+ }
#pragma omp target parallel for
for (int i = 0; i < 10; ++i) {
#pragma omp teams distribute parallel for // expected-error {{region cannot be closely nested inside 'target parallel for' region; perhaps you forget to enclose 'omp teams distribute parallel for' directive into a target region?}}
for (int j = 0; j < 10; ++j)
;
- }
+ }
#pragma omp target parallel for
for (int i = 0; i < 10; ++i) {
#pragma omp target teams // expected-error {{region cannot be nested inside 'target parallel for' region}}
a++;
- }
+ }
#pragma omp target parallel for
for (int i = 0; i < 10; ++i) {
#pragma omp target teams distribute // expected-error {{region cannot be nested inside 'target parallel for' region}}
for (int j = 0; j < 10; ++j)
;
- }
+ }
#pragma omp target parallel for
for (int i = 0; i < 10; ++i) {
#pragma omp target teams distribute parallel for // expected-error {{region cannot be nested inside 'target parallel for' region}}
@@ -4685,7 +5055,7 @@
}
// TEAMS DIRECTIVE
-#pragma omp teams // expected-error {{orphaned 'omp teams' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
+#pragma omp teams // omp45-error {{orphaned 'omp teams' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
bar();
#pragma omp target
#pragma omp teams
@@ -4847,7 +5217,7 @@
;
#pragma omp distribute
for (int j = 0; j < 10; ++j)
- ;
+ ;
#pragma omp target
#pragma omp teams
{
@@ -4861,7 +5231,7 @@
;
#pragma omp distribute parallel for
for (int j = 0; j < 10; ++j)
- ;
+ ;
}
#pragma omp target
#pragma omp teams
@@ -4871,7 +5241,7 @@
;
#pragma omp distribute parallel for simd
for (int j = 0; j < 10; ++j)
- ;
+ ;
}
#pragma omp target
#pragma omp teams
@@ -4881,7 +5251,7 @@
;
#pragma omp distribute simd
for (int j = 0; j < 10; ++j)
- ;
+ ;
}
#pragma omp target
#pragma omp teams
@@ -5247,7 +5617,7 @@
;
}
#pragma omp target
-#pragma omp teams
+#pragma omp teams
#pragma omp distribute
for (int i = 0; i < 10; ++i) {
#pragma omp parallel
@@ -5307,7 +5677,7 @@
{
#pragma omp single
{
- bar();
+ bar();
}
}
}
@@ -5559,7 +5929,7 @@
;
}
#pragma omp target
-#pragma omp teams
+#pragma omp teams
#pragma omp distribute parallel for
for (int i = 0; i < 10; ++i) {
#pragma omp parallel
@@ -5619,7 +5989,7 @@
{
#pragma omp single
{
- bar();
+ bar();
}
}
}
@@ -5856,9 +6226,9 @@
}
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for simd
+#pragma omp distribute parallel for simd
for (int i = 0; i < 10; ++i) {
-#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
+#pragma omp simd // omp45warn-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
for (int i = 0; i < 10; ++i)
;
}
@@ -5871,7 +6241,7 @@
;
}
#pragma omp target
-#pragma omp teams
+#pragma omp teams
#pragma omp distribute parallel for simd
for (int i = 0; i < 10; ++i) {
#pragma omp parallel // expected-error {{OpenMP constructs may not be nested inside a simd region}}
@@ -5931,7 +6301,7 @@
{
#pragma omp single
{
- bar();
+ bar();
}
}
}
@@ -6008,7 +6378,7 @@
#pragma omp teams
#pragma omp distribute parallel for simd
for (int i = 0; i < 10; ++i) {
-#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}
+#pragma omp atomic // omp45-error {{OpenMP constructs may not be nested inside a simd region}}
++a;
}
#pragma omp target
@@ -6168,9 +6538,9 @@
for (int i = 0; i < 10; ++i)
;
}
-#pragma omp target simd
+#pragma omp target simd
for (int i = 0; i < 10; ++i) {
-#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
+#pragma omp simd // omp45warn-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
for (int i = 0; i < 10; ++i)
;
}
@@ -6227,7 +6597,7 @@
{
#pragma omp single
{
- bar();
+ bar();
}
}
}
@@ -6284,7 +6654,7 @@
}
#pragma omp target simd
for (int i = 0; i < 10; ++i) {
-#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}
+#pragma omp atomic // omp45-error {{OpenMP constructs may not be nested inside a simd region}}
++a;
}
#pragma omp target simd
@@ -6373,7 +6743,7 @@
}
// TEAMS DISTRIBUTE DIRECTIVE
-#pragma omp teams distribute // expected-error {{orphaned 'omp teams distribute' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
+#pragma omp teams distribute // omp45-error {{orphaned 'omp teams distribute' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
for (int i = 0; i < 10; ++i)
;
#pragma omp target
@@ -6465,7 +6835,7 @@
{
#pragma omp single
{
- bar();
+ bar();
}
}
}
@@ -6636,7 +7006,7 @@
}
// TEAMS DISTRIBUTE DIRECTIVE
-#pragma omp teams distribute // expected-error {{orphaned 'omp teams distribute' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
+#pragma omp teams distribute // omp45-error {{orphaned 'omp teams distribute' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
for (int i = 0; i < 10; ++i)
;
#pragma omp target
@@ -6728,7 +7098,7 @@
{
#pragma omp single
{
- bar();
+ bar();
}
}
}
@@ -6919,7 +7289,7 @@
}
// TEAMS DISTRIBUTE SIMD DIRECTIVE
-#pragma omp teams distribute simd // expected-error {{orphaned 'omp teams distribute simd' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
+#pragma omp teams distribute simd // omp45-error {{orphaned 'omp teams distribute simd' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
for (int i = 0; i < 10; ++i)
;
#pragma omp target
@@ -6946,7 +7316,7 @@
#pragma omp target
#pragma omp teams distribute simd
for (int i = 0; i < 10; ++i) {
-#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
+#pragma omp simd // omp45warn-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
for (int i = 0; i < 10; ++i)
;
}
@@ -7011,7 +7381,7 @@
{
#pragma omp single
{
- bar();
+ bar();
}
}
}
@@ -7078,7 +7448,7 @@
#pragma omp target
#pragma omp teams distribute simd
for (int i = 0; i < 10; ++i) {
-#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}
+#pragma omp atomic // omp45-error {{OpenMP constructs may not be nested inside a simd region}}
++a;
}
#pragma omp target
@@ -7202,7 +7572,7 @@
}
// TEAMS DISTRIBUTE PARALLEL FOR SIMD DIRECTIVE
-#pragma omp teams distribute parallel for simd // expected-error {{orphaned 'omp teams distribute parallel for simd' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
+#pragma omp teams distribute parallel for simd // omp45-error {{orphaned 'omp teams distribute parallel for simd' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
for (int i = 0; i < 10; ++i)
;
#pragma omp target
@@ -7229,7 +7599,7 @@
#pragma omp target
#pragma omp teams distribute parallel for simd
for (int i = 0; i < 10; ++i) {
-#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
+#pragma omp simd // omp45warn-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
for (int i = 0; i < 10; ++i)
;
}
@@ -7294,7 +7664,7 @@
{
#pragma omp single
{
- bar();
+ bar();
}
}
}
@@ -7361,7 +7731,7 @@
#pragma omp target
#pragma omp teams distribute parallel for simd
for (int i = 0; i < 10; ++i) {
-#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}
+#pragma omp atomic // omp45-error {{OpenMP constructs may not be nested inside a simd region}}
++a;
}
#pragma omp target
@@ -7485,7 +7855,7 @@
}
// TEAMS DISTRIBUTE PARALLEL FOR DIRECTIVE
-#pragma omp teams distribute parallel for // expected-error {{orphaned 'omp teams distribute parallel for' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
+#pragma omp teams distribute parallel for // omp45-error {{orphaned 'omp teams distribute parallel for' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
for (int i = 0; i < 10; ++i)
;
#pragma omp target
@@ -7577,7 +7947,7 @@
{
#pragma omp single
{
- bar();
+ bar();
}
}
}
@@ -7908,7 +8278,7 @@
;
#pragma omp distribute parallel for
for (int j = 0; j < 10; ++j)
- ;
+ ;
}
#pragma omp target teams
{
@@ -7917,7 +8287,7 @@
;
#pragma omp distribute parallel for simd
for (int j = 0; j < 10; ++j)
- ;
+ ;
}
#pragma omp target teams
{
@@ -7926,7 +8296,7 @@
;
#pragma omp distribute simd
for (int j = 0; j < 10; ++j)
- ;
+ ;
}
#pragma omp target teams
{
@@ -8069,7 +8439,7 @@
{
#pragma omp single
{
- bar();
+ bar();
}
}
}
@@ -8312,7 +8682,7 @@
{
#pragma omp single
{
- bar();
+ bar();
}
}
}
@@ -8498,7 +8868,7 @@
}
#pragma omp target teams distribute parallel for simd
for (int i = 0; i < 10; ++i) {
-#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
+#pragma omp simd // omp45warn-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
for (int i = 0; i < 10; ++i)
;
}
@@ -8555,7 +8925,7 @@
{
#pragma omp single
{
- bar();
+ bar();
}
}
}
@@ -8612,7 +8982,7 @@
}
#pragma omp target teams distribute parallel for simd
for (int i = 0; i < 10; ++i) {
-#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}OK
+#pragma omp atomic // omp45-error {{OpenMP constructs may not be nested inside a simd region}}OK
++a;
}
#pragma omp target teams distribute parallel for simd
@@ -8741,7 +9111,7 @@
}
#pragma omp target teams distribute simd
for (int i = 0; i < 10; ++i) {
-#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
+#pragma omp simd // omp45warn-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
for (int i = 0; i < 10; ++i)
;
}
@@ -8798,7 +9168,7 @@
{
#pragma omp single
{
- bar();
+ bar();
}
}
}
@@ -8855,7 +9225,7 @@
}
#pragma omp target teams distribute simd
for (int i = 0; i < 10; ++i) {
-#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}OK
+#pragma omp atomic // omp45-error {{OpenMP constructs may not be nested inside a simd region}}OK
++a;
}
#pragma omp target teams distribute simd
@@ -8998,6 +9368,8 @@
#pragma omp parallel
#pragma omp master
bar();
+#pragma omp parallel master
+ bar();
#pragma omp parallel
#pragma omp critical
bar();
@@ -9182,7 +9554,7 @@
}
#pragma omp simd
for (int i = 0; i < 10; ++i) {
-#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
+#pragma omp simd // omp45warn-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
for (int i = 0; i < 10; ++i)
;
}
@@ -9279,7 +9651,7 @@
}
#pragma omp simd
for (int i = 0; i < 10; ++i) {
-#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}
+#pragma omp atomic // omp45-error {{OpenMP constructs may not be nested inside a simd region}}
++a;
}
#pragma omp simd
@@ -9672,7 +10044,7 @@
}
#pragma omp for simd
for (int i = 0; i < 10; ++i) {
-#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
+#pragma omp simd // omp45warn-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
for (int i = 0; i < 10; ++i)
;
}
@@ -9769,7 +10141,7 @@
}
#pragma omp for simd
for (int i = 0; i < 10; ++i) {
-#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}
+#pragma omp atomic // omp45-error {{OpenMP constructs may not be nested inside a simd region}}
++a;
}
#pragma omp for simd
@@ -10758,6 +11130,11 @@
for (int i = 0; i < 10; ++i)
;
}
+#pragma omp parallel master
+ {
+ for (int i = 0; i < 10; ++i)
+ ;
+ }
#pragma omp master
{
#pragma omp single // expected-error {{region cannot be closely nested inside 'master' region; perhaps you forget to enclose 'omp single' directive into a parallel region?}}
@@ -10808,6 +11185,13 @@
}
#pragma omp master
{
+#pragma omp parallel master
+ {
+ bar();
+ }
+ }
+#pragma omp master
+ {
#pragma omp parallel for
for (int i = 0; i < 10; ++i)
;
@@ -11541,7 +11925,7 @@
}
#pragma omp parallel for simd
for (int i = 0; i < 10; ++i) {
-#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
+#pragma omp simd // omp45warn-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
for (int i = 0; i < 10; ++i)
;
}
@@ -11673,7 +12057,7 @@
}
#pragma omp parallel for simd
for (int i = 0; i < 10; ++i) {
-#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}
+#pragma omp atomic // omp45-error {{OpenMP constructs may not be nested inside a simd region}}
++a;
}
#pragma omp parallel for simd
@@ -12718,7 +13102,7 @@
++a;
}
#pragma omp target
- {
+ {
#pragma omp distribute // expected-error {{region cannot be closely nested inside 'target' region; perhaps you forget to enclose 'omp distribute' directive into a teams region?}}
for (int i = 0; i < 10; ++i)
;
@@ -12731,78 +13115,78 @@
a++;
}
#pragma omp target
- {
+ {
#pragma omp distribute parallel for // expected-error {{region cannot be closely nested inside 'target' region; perhaps you forget to enclose 'omp distribute parallel for' directive into a teams region?}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target
- {
+ {
#pragma omp distribute parallel for simd // expected-error {{region cannot be closely nested inside 'target' region; perhaps you forget to enclose 'omp distribute parallel for simd' directive into a teams region?}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target
- {
+ {
#pragma omp distribute simd // expected-error {{region cannot be closely nested inside 'target' region; perhaps you forget to enclose 'omp distribute simd' directive into a teams region?}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target
- {
+ {
#pragma omp target simd // expected-error {{region cannot be nested inside 'target' region}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target
- {
+ {
#pragma omp teams distribute // OK
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target
- {
+ {
#pragma omp teams distribute simd // OK
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target
- {
+ {
#pragma omp teams distribute parallel for simd // OK
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target
- {
+ {
#pragma omp teams distribute parallel for // OK
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target
- {
+ {
#pragma omp target teams // expected-error {{region cannot be nested inside 'target' region}}
a++;
}
#pragma omp target
- {
+ {
#pragma omp target teams distribute // expected-error {{region cannot be nested inside 'target' region}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target
- {
+ {
#pragma omp target teams distribute parallel for // expected-error {{region cannot be nested inside 'target' region}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target
- {
+ {
#pragma omp target teams distribute parallel for simd // expected-error {{region cannot be nested inside 'target' region}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target
- {
+ {
#pragma omp target teams distribute simd // expected-error {{region cannot be nested inside 'target' region}}
for (int i = 0; i < 10; ++i)
;
@@ -12928,7 +13312,7 @@
++a;
}
#pragma omp target parallel
- {
+ {
#pragma omp distribute // expected-error {{region cannot be closely nested inside 'target parallel' region; perhaps you forget to enclose 'omp distribute' directive into a teams region?}}
for (int i = 0; i < 10; ++i)
;
@@ -12946,78 +13330,78 @@
#pragma omp target update to(a) // expected-error {{region cannot be nested inside 'target parallel' region}}
}
#pragma omp target parallel
- {
+ {
#pragma omp distribute parallel for // expected-error {{region cannot be closely nested inside 'target parallel' region; perhaps you forget to enclose 'omp distribute parallel for' directive into a teams region?}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target parallel
- {
+ {
#pragma omp distribute parallel for simd // expected-error {{region cannot be closely nested inside 'target parallel' region; perhaps you forget to enclose 'omp distribute parallel for simd' directive into a teams region?}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target parallel
- {
+ {
#pragma omp distribute simd // expected-error {{region cannot be closely nested inside 'target parallel' region; perhaps you forget to enclose 'omp distribute simd' directive into a teams region?}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target parallel
- {
+ {
#pragma omp target simd // expected-error {{region cannot be nested inside 'target parallel' regio}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target parallel
- {
+ {
#pragma omp teams distribute // expected-error {{region cannot be closely nested inside 'target parallel' region; perhaps you forget to enclose 'omp teams distribute' directive into a target region?}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target parallel
- {
+ {
#pragma omp teams distribute simd // expected-error {{region cannot be closely nested inside 'target parallel' region; perhaps you forget to enclose 'omp teams distribute simd' directive into a target region?}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target parallel
- {
+ {
#pragma omp teams distribute parallel for simd // expected-error {{region cannot be closely nested inside 'target parallel' region; perhaps you forget to enclose 'omp teams distribute parallel for simd' directive into a target region?}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target parallel
- {
+ {
#pragma omp teams distribute parallel for // expected-error {{region cannot be closely nested inside 'target parallel' region; perhaps you forget to enclose 'omp teams distribute parallel for' directive into a target region?}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target parallel
- {
+ {
#pragma omp target teams // expected-error {{region cannot be nested inside 'target parallel' region}}
a++;
}
#pragma omp target parallel
- {
+ {
#pragma omp target teams distribute // expected-error {{region cannot be nested inside 'target parallel' region}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target parallel
- {
+ {
#pragma omp target teams distribute parallel for // expected-error {{region cannot be nested inside 'target parallel' region}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target parallel
- {
+ {
#pragma omp target teams distribute parallel for simd // expected-error {{region cannot be nested inside 'target parallel' region}}
for (int i = 0; i < 10; ++i)
;
}
#pragma omp target parallel
- {
+ {
#pragma omp target teams distribute simd // expected-error {{region cannot be nested inside 'target parallel' region}}
for (int i = 0; i < 10; ++i)
;
@@ -13472,7 +13856,7 @@
;
#pragma omp distribute parallel for
for (int j = 0; j < 10; ++j)
- ;
+ ;
}
#pragma omp target
#pragma omp teams
@@ -13482,7 +13866,7 @@
;
#pragma omp distribute parallel for simd
for (int j = 0; j < 10; ++j)
- ;
+ ;
}
#pragma omp target
#pragma omp teams
@@ -13492,7 +13876,7 @@
;
#pragma omp distribute simd
for (int j = 0; j < 10; ++j)
- ;
+ ;
}
#pragma omp target
#pragma omp teams
@@ -13858,7 +14242,7 @@
;
}
#pragma omp target
-#pragma omp teams
+#pragma omp teams
#pragma omp distribute
for (int i = 0; i < 10; ++i) {
#pragma omp parallel
@@ -13918,7 +14302,7 @@
{
#pragma omp single
{
- bar();
+ bar();
}
}
}
@@ -14180,7 +14564,7 @@
;
}
#pragma omp target
-#pragma omp teams
+#pragma omp teams
#pragma omp distribute parallel for
for (int i = 0; i < 10; ++i) {
#pragma omp parallel
@@ -14240,7 +14624,7 @@
{
#pragma omp single
{
- bar();
+ bar();
}
}
}
@@ -14487,7 +14871,7 @@
#pragma omp teams
#pragma omp distribute parallel for simd
for (int i = 0; i < 10; ++i) {
-#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
+#pragma omp simd // omp45warn-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
for (int i = 0; i < 10; ++i)
;
}
@@ -14500,7 +14884,7 @@
;
}
#pragma omp target
-#pragma omp teams
+#pragma omp teams
#pragma omp distribute parallel for simd
for (int i = 0; i < 10; ++i) {
#pragma omp parallel // expected-error {{OpenMP constructs may not be nested inside a simd region}}
@@ -14560,7 +14944,7 @@
{
#pragma omp single
{
- bar();
+ bar();
}
}
}
@@ -14637,7 +15021,7 @@
#pragma omp teams
#pragma omp distribute parallel for simd
for (int i = 0; i < 10; ++i) {
-#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}
+#pragma omp atomic // omp45-error {{OpenMP constructs may not be nested inside a simd region}}
++a;
}
#pragma omp target
@@ -14799,7 +15183,7 @@
#pragma omp teams
#pragma omp distribute simd
for (int i = 0; i < 10; ++i) {
-#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
+#pragma omp simd // omp45warn-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
for (int i = 0; i < 10; ++i)
;
}
@@ -14812,7 +15196,7 @@
;
}
#pragma omp target
-#pragma omp teams
+#pragma omp teams
#pragma omp distribute simd
for (int i = 0; i < 10; ++i) {
#pragma omp parallel // expected-error {{OpenMP constructs may not be nested inside a simd region}}
@@ -14872,7 +15256,7 @@
{
#pragma omp single
{
- bar();
+ bar();
}
}
}
@@ -14949,7 +15333,7 @@
#pragma omp teams
#pragma omp distribute simd
for (int i = 0; i < 10; ++i) {
-#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}
+#pragma omp atomic // omp45-error {{OpenMP constructs may not be nested inside a simd region}}
++a;
}
#pragma omp target
@@ -15103,7 +15487,7 @@
}
#pragma omp target simd
for (int i = 0; i < 10; ++i) {
-#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
+#pragma omp simd // omp45warn-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
for (int i = 0; i < 10; ++i)
;
}
@@ -15160,7 +15544,7 @@
{
#pragma omp single
{
- bar();
+ bar();
}
}
}
@@ -15217,7 +15601,7 @@
}
#pragma omp target simd
for (int i = 0; i < 10; ++i) {
-#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}
+#pragma omp atomic // omp45-error {{OpenMP constructs may not be nested inside a simd region}}
++a;
}
#pragma omp target simd
@@ -15317,7 +15701,7 @@
}
// TEAMS DISTRIBUTE DIRECTIVE
-#pragma omp teams distribute // expected-error {{orphaned 'omp teams distribute' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
+#pragma omp teams distribute // omp45-error {{orphaned 'omp teams distribute' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
for (int i = 0; i < 10; ++i)
;
#pragma omp target
@@ -15409,7 +15793,7 @@
{
#pragma omp single
{
- bar();
+ bar();
}
}
}
@@ -15600,7 +15984,7 @@
}
// TEAMS DISTRIBUTE SIMD DIRECTIVE
-#pragma omp teams distribute simd // expected-error {{orphaned 'omp teams distribute simd' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
+#pragma omp teams distribute simd // omp45-error {{orphaned 'omp teams distribute simd' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
for (int i = 0; i < 10; ++i)
;
#pragma omp target
@@ -15627,7 +16011,7 @@
#pragma omp target
#pragma omp teams distribute simd
for (int i = 0; i < 10; ++i) {
-#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
+#pragma omp simd // omp45warn-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
for (int i = 0; i < 10; ++i)
;
}
@@ -15692,7 +16076,7 @@
{
#pragma omp single
{
- bar();
+ bar();
}
}
}
@@ -15759,7 +16143,7 @@
#pragma omp target
#pragma omp teams distribute simd
for (int i = 0; i < 10; ++i) {
-#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}
+#pragma omp atomic // omp45-error {{OpenMP constructs may not be nested inside a simd region}}
++a;
}
#pragma omp target
@@ -15883,7 +16267,7 @@
}
// TEAMS DISTRIBUTE PARALLEL FOR SIMD DIRECTIVE
-#pragma omp teams distribute parallel for simd // expected-error {{orphaned 'omp teams distribute parallel for simd' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
+#pragma omp teams distribute parallel for simd // omp45-error {{orphaned 'omp teams distribute parallel for simd' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
for (int i = 0; i < 10; ++i)
;
#pragma omp target
@@ -15910,7 +16294,7 @@
#pragma omp target
#pragma omp teams distribute parallel for simd
for (int i = 0; i < 10; ++i) {
-#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
+#pragma omp simd // omp45warn-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
for (int i = 0; i < 10; ++i)
;
}
@@ -15975,7 +16359,7 @@
{
#pragma omp single
{
- bar();
+ bar();
}
}
}
@@ -16042,7 +16426,7 @@
#pragma omp target
#pragma omp teams distribute parallel for simd
for (int i = 0; i < 10; ++i) {
-#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}
+#pragma omp atomic // omp45-error {{OpenMP constructs may not be nested inside a simd region}}
++a;
}
#pragma omp target
@@ -16166,7 +16550,7 @@
}
// TEAMS DISTRIBUTE PARALLEL FOR DIRECTIVE
-#pragma omp teams distribute parallel for // expected-error {{orphaned 'omp teams distribute parallel for' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
+#pragma omp teams distribute parallel for // omp45-error {{orphaned 'omp teams distribute parallel for' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
for (int i = 0; i < 10; ++i)
;
#pragma omp target
@@ -16258,7 +16642,7 @@
{
#pragma omp single
{
- bar();
+ bar();
}
}
}
@@ -16589,7 +16973,7 @@
;
#pragma omp distribute parallel for
for (int j = 0; j < 10; ++j)
- ;
+ ;
}
#pragma omp target teams
{
@@ -16598,7 +16982,7 @@
;
#pragma omp distribute parallel for simd
for (int j = 0; j < 10; ++j)
- ;
+ ;
}
#pragma omp target teams
{
@@ -16607,7 +16991,7 @@
;
#pragma omp distribute simd
for (int j = 0; j < 10; ++j)
- ;
+ ;
}
#pragma omp target teams
{
@@ -16750,7 +17134,7 @@
{
#pragma omp single
{
- bar();
+ bar();
}
}
}
@@ -16993,7 +17377,7 @@
{
#pragma omp single
{
- bar();
+ bar();
}
}
}
@@ -17179,7 +17563,7 @@
}
#pragma omp target teams distribute parallel for simd
for (int i = 0; i < 10; ++i) {
-#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
+#pragma omp simd // omp45warn-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
for (int i = 0; i < 10; ++i)
;
}
@@ -17236,7 +17620,7 @@
{
#pragma omp single
{
- bar();
+ bar();
}
}
}
@@ -17293,7 +17677,7 @@
}
#pragma omp target teams distribute parallel for simd
for (int i = 0; i < 10; ++i) {
-#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}OK
+#pragma omp atomic // omp45-error {{OpenMP constructs may not be nested inside a simd region}}OK
++a;
}
#pragma omp target teams distribute parallel for simd
@@ -17422,7 +17806,7 @@
}
#pragma omp target teams distribute simd
for (int i = 0; i < 10; ++i) {
-#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
+#pragma omp simd // omp45warn-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
for (int i = 0; i < 10; ++i)
;
}
@@ -17479,7 +17863,7 @@
{
#pragma omp single
{
- bar();
+ bar();
}
}
}
@@ -17536,7 +17920,7 @@
}
#pragma omp target teams distribute simd
for (int i = 0; i < 10; ++i) {
-#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}OK
+#pragma omp atomic // omp45-error {{OpenMP constructs may not be nested inside a simd region}}OK
++a;
}
#pragma omp target teams distribute simd
diff --git a/src/llvm-project/clang/test/OpenMP/nvptx_allocate_codegen.cpp b/src/llvm-project/clang/test/OpenMP/nvptx_allocate_codegen.cpp
index 647bc1d..e8352b8 100644
--- a/src/llvm-project/clang/test/OpenMP/nvptx_allocate_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/nvptx_allocate_codegen.cpp
@@ -17,11 +17,11 @@
extern const omp_allocator_handle_t omp_thread_mem_alloc;
// CHECK-DAG: @{{.+}}St1{{.+}}b{{.+}} = external global i32,
-// CHECK-DAG: @a ={{ dso_local | }}global i32 0,
-// CHECK-DAG: @b ={{ dso_local | }}addrspace(4) global i32 0,
-// CHECK-DAG: @c ={{ dso_local | }}global i32 0,
-// CHECK-DAG: @d ={{ dso_local | }}global %struct.St1 zeroinitializer,
-// CHECK-DAG: @{{.+}}ns{{.+}}a{{.+}} ={{ dso_local | }}addrspace(3) global i32 0,
+// CHECK-DAG: @a ={{ hidden | }}global i32 0,
+// CHECK-DAG: @b ={{ hidden | }}addrspace(4) global i32 0,
+// CHECK-DAG: @c ={{ hidden | }}global i32 0,
+// CHECK-DAG: @d ={{ hidden | }}global %struct.St1 zeroinitializer,
+// CHECK-DAG: @{{.+}}ns{{.+}}a{{.+}} ={{ hidden | }}addrspace(3) global i32 0,
// CHECK-DAG: @{{.+}}main{{.+}}a{{.*}} = internal global i32 0,
// CHECK-DAG: @{{.+}}ST{{.+}}m{{.+}} = external global i32,
// CHECK-DAG: @bar_c = internal global i32 0,
@@ -79,7 +79,7 @@
void baz(float &);
-// CHECK: define{{ dso_local | }}void @{{.+}}bar{{.+}}()
+// CHECK: define{{ hidden | }}void @{{.+}}bar{{.+}}()
void bar() {
// CHECK: alloca float,
float bar_a;
diff --git a/src/llvm-project/clang/test/OpenMP/nvptx_allocate_messages.cpp b/src/llvm-project/clang/test/OpenMP/nvptx_allocate_messages.cpp
index e6fb83f..5b4a996 100644
--- a/src/llvm-project/clang/test/OpenMP/nvptx_allocate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/nvptx_allocate_messages.cpp
@@ -58,7 +58,7 @@
#pragma omp allocate(v) allocator(omp_cgroup_mem_alloc)
v = ST<T>::m;
#if defined(DEVICE) && !defined(REQUIRES)
-// expected-error@+2 2 {{expected an allocator expression inside of the target region; provide an allocator expression or use 'requires' directive with the 'dynamic_allocators' clause}}
+// expected-error@+2 {{expected an allocator expression inside of the target region; provide an allocator expression or use 'requires' directive with the 'dynamic_allocators' clause}}
#endif // DEVICE && !REQUIRES
#pragma omp parallel private(v) allocate(v)
v = 0;
diff --git a/src/llvm-project/clang/test/OpenMP/nvptx_asm_delayed_diags.c b/src/llvm-project/clang/test/OpenMP/nvptx_asm_delayed_diags.c
index 460bf04..2f82abd 100644
--- a/src/llvm-project/clang/test/OpenMP/nvptx_asm_delayed_diags.c
+++ b/src/llvm-project/clang/test/OpenMP/nvptx_asm_delayed_diags.c
@@ -2,6 +2,10 @@
// RUN: %clang_cc1 -verify -fopenmp -x c -triple nvptx-unknown-unknown -aux-triple i386-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -fsyntax-only -Wuninitialized
// RUN: %clang_cc1 -verify -DDIAGS -DIMMEDIATE -fopenmp -x c -triple nvptx-unknown-unknown -aux-triple i386-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -fsyntax-only -Wuninitialized
// RUN: %clang_cc1 -verify -DDIAGS -DDELAYED -fopenmp -x c -triple nvptx-unknown-unknown -aux-triple i386-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -fsyntax-only -Wuninitialized
+// RUN: %clang_cc1 -fopenmp -x c -triple i386-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda -fopenmp-version=50 -emit-llvm-bc %s -o %t-x86-host.bc
+// RUN: %clang_cc1 -verify=expected,omp5 -fopenmp -x c -triple nvptx-unknown-unknown -aux-triple i386-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda -fopenmp-version=50 %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -fsyntax-only -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp5 -DDIAGS -DOMP5 -DIMMEDIATE -fopenmp -fopenmp-version=50 -x c -triple nvptx-unknown-unknown -aux-triple i386-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -fsyntax-only -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp5 -DDIAGS -DOMP5 -DDELAYED -fopenmp -fopenmp-version=50 -x c -triple nvptx-unknown-unknown -aux-triple i386-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -fsyntax-only -Wuninitialized
// REQUIRES: x86-registered-target
// REQUIRES: nvptx-registered-target
@@ -9,6 +13,34 @@
// expected-no-diagnostics
#endif // DIAGS
+#ifdef OMP5
+void bar(int r) {
+#ifdef IMMEDIATE
+// omp5-error@+4 {{invalid input constraint 'mx' in asm}}
+#endif // IMMEDIATE
+ __asm__("PR3908 %[lf] %[xx] %[li] %[r]"
+ : [ r ] "+r"(r)
+ : [ lf ] "mx"(0), [ li ] "mr"(0), [ xx ] "x"((double)(0)));
+}
+#ifdef IMMEDIATE
+#pragma omp declare target to(bar) device_type(nohost)
+#else
+#pragma omp declare target to(bar) device_type(host)
+#endif // IMMEDIATE
+#endif // OMP5
+
+void foo(int r) {
+#ifdef IMMEDIATE
+// expected-error@+4 {{invalid input constraint 'mx' in asm}}
+#endif // IMMEDIATE
+ __asm__("PR3908 %[lf] %[xx] %[li] %[r]"
+ : [ r ] "+r"(r)
+ : [ lf ] "mx"(0), [ li ] "mr"(0), [ xx ] "x"((double)(0)));
+}
+#ifdef IMMEDIATE
+#pragma omp declare target to(foo)
+#endif //IMMEDIATE
+
#ifdef IMMEDIATE
#pragma omp declare target
#endif //IMMEDIATE
diff --git a/src/llvm-project/clang/test/OpenMP/nvptx_declare_target_var_ctor_dtor_codegen.cpp b/src/llvm-project/clang/test/OpenMP/nvptx_declare_target_var_ctor_dtor_codegen.cpp
index 03520e1..0a9772b 100644
--- a/src/llvm-project/clang/test/OpenMP/nvptx_declare_target_var_ctor_dtor_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/nvptx_declare_target_var_ctor_dtor_codegen.cpp
@@ -16,9 +16,9 @@
// SIMD-ONLY-NOT: {{__kmpc|__tgt}}
// DEVICE-DAG: [[C_ADDR:.+]] = internal global i32 0,
-// DEVICE-DAG: [[CD_ADDR:@.+]] ={{ dso_local | }}global %struct.S zeroinitializer,
+// DEVICE-DAG: [[CD_ADDR:@.+]] ={{ hidden | }}global %struct.S zeroinitializer,
// HOST-DAG: @[[C_ADDR:.+]] = internal global i32 0,
-// HOST-DAG: @[[CD_ADDR:.+]] ={{ dso_local | }}global %struct.S zeroinitializer,
+// HOST-DAG: @[[CD_ADDR:.+]] ={{ hidden | }}global %struct.S zeroinitializer,
#pragma omp declare target
int foo() { return 0; }
@@ -34,12 +34,12 @@
#pragma omp declare target (bar)
int caz() { return 0; }
-// DEVICE-DAG: define{{ dso_local | }}i32 [[FOO:@.*foo.*]]()
-// DEVICE-DAG: define{{ dso_local | }}i32 [[BAR:@.*bar.*]]()
-// DEVICE-DAG: define{{ dso_local | }}i32 [[BAZ:@.*baz.*]]()
-// DEVICE-DAG: define{{ dso_local | }}i32 [[DOO:@.*doo.*]]()
-// DEVICE-DAG: define{{ dso_local | }}i32 [[CAR:@.*car.*]]()
-// DEVICE-DAG: define{{ dso_local | }}i32 [[CAZ:@.*caz.*]]()
+// DEVICE-DAG: define{{ hidden | }}i32 [[FOO:@.*foo.*]]()
+// DEVICE-DAG: define{{ hidden | }}i32 [[BAR:@.*bar.*]]()
+// DEVICE-DAG: define{{ hidden | }}i32 [[BAZ:@.*baz.*]]()
+// DEVICE-DAG: define{{ hidden | }}i32 [[DOO:@.*doo.*]]()
+// DEVICE-DAG: define{{ hidden | }}i32 [[CAR:@.*car.*]]()
+// DEVICE-DAG: define{{ hidden | }}i32 [[CAZ:@.*caz.*]]()
static int c = foo() + bar() + baz();
#pragma omp declare target (c)
@@ -73,15 +73,15 @@
// DEVICE-DAG: ret void
// HOST-DAG: @.omp_offloading.entry_name{{.*}} = internal unnamed_addr constant [{{[0-9]+}} x i8] c"[[C_ADDR]]\00"
-// HOST-DAG: @.omp_offloading.entry.[[C_ADDR]] = weak constant %struct.__tgt_offload_entry { i8* bitcast (i32* @[[C_ADDR]] to i8*), i8* getelementptr inbounds ([{{[0-9]+}} x i8], [{{[0-9]+}} x i8]* @.omp_offloading.entry_name{{.*}}, i32 0, i32 0), i64 4, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// HOST-DAG: @.omp_offloading.entry.[[C_ADDR]] = weak constant %struct.__tgt_offload_entry { i8* bitcast (i32* @[[C_ADDR]] to i8*), i8* getelementptr inbounds ([{{[0-9]+}} x i8], [{{[0-9]+}} x i8]* @.omp_offloading.entry_name{{.*}}, i32 0, i32 0), i64 4, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// HOST-DAG: @.omp_offloading.entry_name{{.*}} = internal unnamed_addr constant [{{[0-9]+}} x i8] c"[[CD_ADDR]]\00"
-// HOST-DAG: @.omp_offloading.entry.[[CD_ADDR]] = weak constant %struct.__tgt_offload_entry { i8* bitcast (%struct.S* @[[CD_ADDR]] to i8*), i8* getelementptr inbounds ([{{[0-9]+}} x i8], [{{[0-9]+}} x i8]* @.omp_offloading.entry_name{{.*}}, i32 0, i32 0), i64 4, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// HOST-DAG: @.omp_offloading.entry.[[CD_ADDR]] = weak constant %struct.__tgt_offload_entry { i8* bitcast (%struct.S* @[[CD_ADDR]] to i8*), i8* getelementptr inbounds ([{{[0-9]+}} x i8], [{{[0-9]+}} x i8]* @.omp_offloading.entry_name{{.*}}, i32 0, i32 0), i64 4, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// HOST-DAG: @.omp_offloading.entry_name{{.*}} = internal unnamed_addr constant [{{[0-9]+}} x i8] c"[[C_CTOR]]\00"
-// HOST-DAG: @.omp_offloading.entry.[[C_CTOR]] = weak constant %struct.__tgt_offload_entry { i8* @[[C_CTOR]], i8* getelementptr inbounds ([{{[0-9]+}} x i8], [{{[0-9]+}} x i8]* @.omp_offloading.entry_name{{.*}}, i32 0, i32 0), i64 0, i32 2, i32 0 }, section ".omp_offloading.entries", align 1
+// HOST-DAG: @.omp_offloading.entry.[[C_CTOR]] = weak constant %struct.__tgt_offload_entry { i8* @[[C_CTOR]], i8* getelementptr inbounds ([{{[0-9]+}} x i8], [{{[0-9]+}} x i8]* @.omp_offloading.entry_name{{.*}}, i32 0, i32 0), i64 0, i32 2, i32 0 }, section "omp_offloading_entries", align 1
// HOST-DAG: @.omp_offloading.entry_name{{.*}}= internal unnamed_addr constant [{{[0-9]+}} x i8] c"[[CD_CTOR]]\00"
-// HOST-DAG: @.omp_offloading.entry.[[CD_CTOR]] = weak constant %struct.__tgt_offload_entry { i8* @[[CD_CTOR]], i8* getelementptr inbounds ([{{[0-9]+}} x i8], [{{[0-9]+}} x i8]* @.omp_offloading.entry_name{{.*}}, i32 0, i32 0), i64 0, i32 2, i32 0 }, section ".omp_offloading.entries", align 1
+// HOST-DAG: @.omp_offloading.entry.[[CD_CTOR]] = weak constant %struct.__tgt_offload_entry { i8* @[[CD_CTOR]], i8* getelementptr inbounds ([{{[0-9]+}} x i8], [{{[0-9]+}} x i8]* @.omp_offloading.entry_name{{.*}}, i32 0, i32 0), i64 0, i32 2, i32 0 }, section "omp_offloading_entries", align 1
// HOST-DAG: @.omp_offloading.entry_name{{.*}}= internal unnamed_addr constant [{{[0-9]+}} x i8] c"[[CD_DTOR]]\00"
-// HOST-DAG: @.omp_offloading.entry.[[CD_DTOR]] = weak constant %struct.__tgt_offload_entry { i8* @[[CD_DTOR]], i8* getelementptr inbounds ([{{[0-9]+}} x i8], [{{[0-9]+}} x i8]* @.omp_offloading.entry_name{{.*}}, i32 0, i32 0), i64 0, i32 4, i32 0 }, section ".omp_offloading.entries", align 1
+// HOST-DAG: @.omp_offloading.entry.[[CD_DTOR]] = weak constant %struct.__tgt_offload_entry { i8* @[[CD_DTOR]], i8* getelementptr inbounds ([{{[0-9]+}} x i8], [{{[0-9]+}} x i8]* @.omp_offloading.entry_name{{.*}}, i32 0, i32 0), i64 0, i32 4, i32 0 }, section "omp_offloading_entries", align 1
int maini1() {
int a;
#pragma omp target map(tofrom : a)
diff --git a/src/llvm-project/clang/test/OpenMP/nvptx_declare_variant_device_kind_codegen.cpp b/src/llvm-project/clang/test/OpenMP/nvptx_declare_variant_device_kind_codegen.cpp
new file mode 100644
index 0000000..7f84709
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/nvptx_declare_variant_device_kind_codegen.cpp
@@ -0,0 +1,170 @@
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm-bc %s -o %t-ppc-host.bc -fopenmp-version=50 -DGPU
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple nvptx64-unknown-unknown -aux-triple powerpc64le-unknown-unknown -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - -fopenmp-version=50 -DGPU | FileCheck %s --implicit-check-not='ret i32 {{1|81|84}}'
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple nvptx64-unknown-unknown -aux-triple powerpc64le-unknown-unknown -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -emit-pch -o %t -fopenmp-version=50 -DGPU
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple nvptx64-unknown-unknown -aux-triple powerpc64le-unknown-unknown -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -include-pch %t -o - -fopenmp-version=50 -DGPU | FileCheck %s --implicit-check-not='ret i32 {{1|81|84}}'
+
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm-bc %s -o %t-ppc-host.bc -fopenmp-version=50 -DNOHOST
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple nvptx64-unknown-unknown -aux-triple powerpc64le-unknown-unknown -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - -fopenmp-version=50 -DNOHOST | FileCheck %s --implicit-check-not='ret i32 {{1|81|84}}'
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple nvptx64-unknown-unknown -aux-triple powerpc64le-unknown-unknown -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -emit-pch -o %t -fopenmp-version=50 -DNOHOST
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple nvptx64-unknown-unknown -aux-triple powerpc64le-unknown-unknown -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -include-pch %t -o - -fopenmp-version=50 -DNOHOST | FileCheck %s --implicit-check-not='ret i32 {{1|81|84}}'
+// expected-no-diagnostics
+
+// CHECK-NOT: ret i32 {{1|81|84}}
+// CHECK-DAG: define {{.*}}i32 @_Z3barv()
+// CHECK-DAG: define {{.*}}i32 @_ZN16SpecSpecialFuncs6MethodEv(%struct.SpecSpecialFuncs* %{{.+}})
+// CHECK-DAG: define {{.*}}i32 @_ZN12SpecialFuncs6MethodEv(%struct.SpecialFuncs* %{{.+}})
+// CHECK-DAG: define linkonce_odr {{.*}}i32 @_ZN16SpecSpecialFuncs6methodEv(%struct.SpecSpecialFuncs* %{{.+}})
+// CHECK-DAG: define linkonce_odr {{.*}}i32 @_ZN12SpecialFuncs6methodEv(%struct.SpecialFuncs* %{{.+}})
+// CHECK-DAG: define {{.*}}i32 @_Z5prio_v()
+// CHECK-DAG: define internal i32 @_ZL6prio1_v()
+// CHECK-DAG: define {{.*}}i32 @_Z4callv()
+// CHECK-DAG: define internal i32 @_ZL9stat_usedv()
+// CHECK-DAG: define {{.*}}i32 @fn_linkage()
+// CHECK-DAG: define {{.*}}i32 @_Z11fn_linkage1v()
+
+// CHECK-DAG: ret i32 2
+// CHECK-DAG: ret i32 3
+// CHECK-DAG: ret i32 4
+// CHECK-DAG: ret i32 5
+// CHECK-DAG: ret i32 6
+// CHECK-DAG: ret i32 7
+// CHECK-DAG: ret i32 82
+// CHECK-DAG: ret i32 83
+// CHECK-DAG: ret i32 85
+// CHECK-DAG: ret i32 86
+// CHECK-DAG: ret i32 87
+
+// Outputs for function members
+// CHECK-DAG: ret i32 6
+// CHECK-DAG: ret i32 7
+// CHECK-NOT: ret i32 {{1|81|84}}
+
+#ifndef HEADER
+#define HEADER
+
+#ifdef GPU
+#define CORRECT gpu
+#define SUBSET nohost, gpu
+#define WRONG cpu, gpu
+#endif // GPU
+#ifdef NOHOST
+#define CORRECT nohost
+#define SUBSET nohost, gpu
+#define WRONG nohost, host
+#endif // NOHOST
+
+int foo() { return 2; }
+int bazzz();
+int test();
+static int stat_unused_();
+static int stat_used_();
+
+#pragma omp declare target
+
+#pragma omp declare variant(foo) match(device = {kind(CORRECT)})
+int bar() { return 1; }
+
+#pragma omp declare variant(bazzz) match(device = {kind(CORRECT)})
+int baz() { return 1; }
+
+#pragma omp declare variant(test) match(device = {kind(CORRECT)})
+int call() { return 1; }
+
+#pragma omp declare variant(stat_unused_) match(device = {kind(CORRECT)})
+static int stat_unused() { return 1; }
+
+#pragma omp declare variant(stat_used_) match(device = {kind(CORRECT)})
+static int stat_used() { return 1; }
+
+#pragma omp end declare target
+
+int main() {
+ int res;
+#pragma omp target map(from \
+ : res)
+ res = bar() + baz() + call();
+ return res;
+}
+
+int test() { return 3; }
+static int stat_unused_() { return 4; }
+static int stat_used_() { return 5; }
+
+#pragma omp declare target
+
+struct SpecialFuncs {
+ void vd() {}
+ SpecialFuncs();
+ ~SpecialFuncs();
+
+ int method_() { return 6; }
+#pragma omp declare variant(SpecialFuncs::method_) \
+ match(device = {kind(CORRECT)})
+ int method() { return 1; }
+#pragma omp declare variant(SpecialFuncs::method_) \
+ match(device = {kind(CORRECT)})
+ int Method();
+} s;
+
+int SpecialFuncs::Method() { return 1; }
+
+struct SpecSpecialFuncs {
+ void vd() {}
+ SpecSpecialFuncs();
+ ~SpecSpecialFuncs();
+
+ int method_();
+#pragma omp declare variant(SpecSpecialFuncs::method_) \
+ match(device = {kind(CORRECT)})
+ int method() { return 1; }
+#pragma omp declare variant(SpecSpecialFuncs::method_) \
+ match(device = {kind(CORRECT)})
+ int Method();
+} s1;
+
+#pragma omp end declare target
+
+int SpecSpecialFuncs::method_() { return 7; }
+int SpecSpecialFuncs::Method() { return 1; }
+
+int prio() { return 81; }
+int prio1() { return 82; }
+static int prio2() { return 83; }
+static int prio3() { return 84; }
+static int prio4() { return 84; }
+int fn_linkage_variant() { return 85; }
+extern "C" int fn_linkage_variant1() { return 86; }
+int fn_variant2() { return 1; }
+
+#pragma omp declare target
+
+void xxx() {
+ (void)s.method();
+ (void)s1.method();
+}
+
+#pragma omp declare variant(prio) match(device = {kind(SUBSET)})
+#pragma omp declare variant(prio1) match(device = {kind(CORRECT)})
+int prio_() { return 1; }
+
+#pragma omp declare variant(prio4) match(device = {kind(SUBSET)})
+#pragma omp declare variant(prio2) match(device = {kind(CORRECT)})
+#pragma omp declare variant(prio3) match(device = {kind(SUBSET)})
+static int prio1_() { return 1; }
+
+int int_fn() { return prio1_(); }
+
+extern "C" {
+#pragma omp declare variant(fn_linkage_variant) match(device = {kind(CORRECT)})
+int fn_linkage() { return 1; }
+}
+
+#pragma omp declare variant(fn_linkage_variant1) match(device = {kind(CORRECT)})
+int fn_linkage1() { return 1; }
+
+#pragma omp declare variant(fn_variant2) match(device = {kind(WRONG)})
+int fn2() { return 87; }
+
+#pragma omp end declare target
+
+#endif // HEADER
diff --git a/src/llvm-project/clang/test/OpenMP/nvptx_declare_variant_implementation_vendor_codegen.cpp b/src/llvm-project/clang/test/OpenMP/nvptx_declare_variant_implementation_vendor_codegen.cpp
new file mode 100644
index 0000000..04870f0
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/nvptx_declare_variant_implementation_vendor_codegen.cpp
@@ -0,0 +1,158 @@
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm-bc %s -o %t-ppc-host.bc -fopenmp-version=50
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple nvptx64-unknown-unknown -aux-triple powerpc64le-unknown-unknown -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - -fopenmp-version=50 | FileCheck %s --implicit-check-not='ret i32 {{1|81|84}}'
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple nvptx64-unknown-unknown -aux-triple powerpc64le-unknown-unknown -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -emit-pch -o %t -fopenmp-version=50
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple nvptx64-unknown-unknown -aux-triple powerpc64le-unknown-unknown -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -include-pch %t -o - -fopenmp-version=50 | FileCheck %s --implicit-check-not='ret i32 {{1|81|84}}'
+// expected-no-diagnostics
+
+// CHECK-NOT: ret i32 {{1|81|84}}
+// CHECK-DAG: define {{.*}}i32 @_Z3barv()
+// CHECK-DAG: define {{.*}}i32 @_ZN16SpecSpecialFuncs6MethodEv(%struct.SpecSpecialFuncs* %{{.+}})
+// CHECK-DAG: define {{.*}}i32 @_ZN12SpecialFuncs6MethodEv(%struct.SpecialFuncs* %{{.+}})
+// CHECK-DAG: define linkonce_odr {{.*}}i32 @_ZN16SpecSpecialFuncs6methodEv(%struct.SpecSpecialFuncs* %{{.+}})
+// CHECK-DAG: define linkonce_odr {{.*}}i32 @_ZN12SpecialFuncs6methodEv(%struct.SpecialFuncs* %{{.+}})
+// CHECK-DAG: define {{.*}}i32 @_Z5prio_v()
+// CHECK-DAG: define internal i32 @_ZL6prio1_v()
+// CHECK-DAG: define {{.*}}i32 @_Z4callv()
+// CHECK-DAG: define internal i32 @_ZL9stat_usedv()
+// CHECK-DAG: define {{.*}}i32 @fn_linkage()
+// CHECK-DAG: define {{.*}}i32 @_Z11fn_linkage1v()
+
+// CHECK-DAG: ret i32 2
+// CHECK-DAG: ret i32 3
+// CHECK-DAG: ret i32 4
+// CHECK-DAG: ret i32 5
+// CHECK-DAG: ret i32 6
+// CHECK-DAG: ret i32 7
+// CHECK-DAG: ret i32 82
+// CHECK-DAG: ret i32 83
+// CHECK-DAG: ret i32 85
+// CHECK-DAG: ret i32 86
+// CHECK-DAG: ret i32 87
+
+// Outputs for function members
+// CHECK-DAG: ret i32 6
+// CHECK-DAG: ret i32 7
+// CHECK-NOT: ret i32 {{1|81|84}}
+
+#ifndef HEADER
+#define HEADER
+
+int foo() { return 2; }
+int bazzz();
+int test();
+static int stat_unused_();
+static int stat_used_();
+
+#pragma omp declare target
+
+#pragma omp declare variant(foo) match(implementation = {vendor(llvm)})
+int bar() { return 1; }
+
+#pragma omp declare variant(bazzz) match(implementation = {vendor(llvm)})
+int baz() { return 1; }
+
+#pragma omp declare variant(test) match(implementation = {vendor(llvm)})
+int call() { return 1; }
+
+#pragma omp declare variant(stat_unused_) match(implementation = {vendor(llvm)})
+static int stat_unused() { return 1; }
+
+#pragma omp declare variant(stat_used_) match(implementation = {vendor(llvm)})
+static int stat_used() { return 1; }
+
+#pragma omp end declare target
+
+int main() {
+ int res;
+#pragma omp target map(from \
+ : res)
+ res = bar() + baz() + call();
+ return res;
+}
+
+int test() { return 3; }
+static int stat_unused_() { return 4; }
+static int stat_used_() { return 5; }
+
+#pragma omp declare target
+
+struct SpecialFuncs {
+ void vd() {}
+ SpecialFuncs();
+ ~SpecialFuncs();
+
+ int method_() { return 6; }
+#pragma omp declare variant(SpecialFuncs::method_) \
+ match(implementation = {vendor(llvm)})
+ int method() { return 1; }
+#pragma omp declare variant(SpecialFuncs::method_) \
+ match(implementation = {vendor(llvm)})
+ int Method();
+} s;
+
+int SpecialFuncs::Method() { return 1; }
+
+struct SpecSpecialFuncs {
+ void vd() {}
+ SpecSpecialFuncs();
+ ~SpecSpecialFuncs();
+
+ int method_();
+#pragma omp declare variant(SpecSpecialFuncs::method_) \
+ match(implementation = {vendor(llvm)})
+ int method() { return 1; }
+#pragma omp declare variant(SpecSpecialFuncs::method_) \
+ match(implementation = {vendor(llvm)})
+ int Method();
+} s1;
+
+#pragma omp end declare target
+
+int SpecSpecialFuncs::method_() { return 7; }
+int SpecSpecialFuncs::Method() { return 1; }
+
+int prio() { return 81; }
+int prio1() { return 82; }
+static int prio2() { return 83; }
+static int prio3() { return 84; }
+static int prio4() { return 84; }
+int fn_linkage_variant() { return 85; }
+extern "C" int fn_linkage_variant1() { return 86; }
+int fn_variant2() { return 1; }
+
+#pragma omp declare target
+
+void xxx() {
+ (void)s.method();
+ (void)s1.method();
+}
+
+#pragma omp declare variant(prio) match(implementation = {vendor(llvm)})
+#pragma omp declare variant(prio1) match(implementation = {vendor(score(1) \
+ : llvm)})
+int prio_() { return 1; }
+
+#pragma omp declare variant(prio4) match(implementation = {vendor(score(3) \
+ : llvm)})
+#pragma omp declare variant(prio2) match(implementation = {vendor(score(5) \
+ : llvm)})
+#pragma omp declare variant(prio3) match(implementation = {vendor(score(1) \
+ : llvm)})
+static int prio1_() { return 1; }
+
+int int_fn() { return prio1_(); }
+
+extern "C" {
+#pragma omp declare variant(fn_linkage_variant) match(implementation = {vendor(llvm)})
+int fn_linkage() { return 1; }
+}
+
+#pragma omp declare variant(fn_linkage_variant1) match(implementation = {vendor(llvm)})
+int fn_linkage1() { return 1; }
+
+#pragma omp declare variant(fn_variant2) match(implementation = {vendor(llvm, ibm)})
+int fn2() { return 87; }
+
+#pragma omp end declare target
+
+#endif // HEADER
diff --git a/src/llvm-project/clang/test/OpenMP/nvptx_parallel_codegen.cpp b/src/llvm-project/clang/test/OpenMP/nvptx_parallel_codegen.cpp
index cdbc887..2fc0635 100644
--- a/src/llvm-project/clang/test/OpenMP/nvptx_parallel_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/nvptx_parallel_codegen.cpp
@@ -88,7 +88,7 @@
// CHECK: br label {{%?}}[[AWAIT_WORK:.+]]
//
// CHECK: [[AWAIT_WORK]]
-// CHECK: call void @__kmpc_barrier_simple_spmd(%struct.ident_t* null, i32 0)
+// CHECK: call void @__kmpc_barrier_simple_spmd(%struct.ident_t* null, i32 0) #[[#CONVERGENT:]]
// CHECK: [[KPR:%.+]] = call i1 @__kmpc_kernel_parallel(i8** [[OMP_WORK_FN]]
// CHECK: [[KPRB:%.+]] = zext i1 [[KPR]] to i8
// store i8 [[KPRB]], i8* [[OMP_EXEC_STATUS]], align 1
@@ -318,10 +318,10 @@
// CHECK: define internal void [[PARALLEL_FN4]](
// CHECK: [[A:%.+]] = alloca i[[SZ:32|64]],
// CHECK: store i[[SZ]] 45, i[[SZ]]* %a,
-// CHECK: call void @__kmpc_barrier(%struct.ident_t* @{{.+}}, i32 %{{.+}})
+// CHECK: call void @__kmpc_barrier(%struct.ident_t* @{{.+}}, i32 %{{.+}}) #[[#CONVERGENT:]]
// CHECK: ret void
-// CHECK: declare void @__kmpc_barrier(%struct.ident_t*, i32) #[[BARRIER_ATTRS:.+]]
+// CHECK: declare void @__kmpc_barrier(%struct.ident_t*, i32) #[[#CONVERGENT]]
// CHECK-LABEL: define {{.*}}void {{@__omp_offloading_.+template.+l55}}_worker()
// CHECK-LABEL: define {{.*}}void {{@__omp_offloading_.+template.+l55}}(
@@ -343,6 +343,7 @@
// CHECK-LABEL: define internal void @{{.+}}(i32* noalias %{{.+}}, i32* noalias %{{.+}}, i32* dereferenceable{{.*}})
// CHECK: [[CC:%.+]] = alloca i32,
+// CHECK: [[MASK:%.+]] = call i32 @__kmpc_warp_active_thread_mask(){{$}}
// CHECK: [[TID:%.+]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x()
// CHECK: [[NUM_THREADS:%.+]] = call i32 @llvm.nvvm.read.ptx.sreg.ntid.x()
// CHECK: store i32 0, i32* [[CC]],
@@ -362,11 +363,15 @@
// CHECK: store i32
// CHECK: call void @__kmpc_end_critical(
-// CHECK: call void @__kmpc_barrier(%struct.ident_t* @{{.+}}, i32 %{{.+}})
+// CHECK: call void @__kmpc_syncwarp(i32 [[MASK]]){{$}}
// CHECK: [[NEW_CC_VAL:%.+]] = add nsw i32 [[CC_VAL]], 1
// CHECK: store i32 [[NEW_CC_VAL]], i32* [[CC]],
// CHECK: br label
-// CHECK: attributes #[[BARRIER_ATTRS]] = {{.*}} convergent {{.*}}
+
+// CHECK: declare i32 @__kmpc_warp_active_thread_mask() #[[#CONVERGENT:]]
+// CHECK: declare void @__kmpc_syncwarp(i32) #[[#CONVERGENT:]]
+
+// CHECK: attributes #[[#CONVERGENT]] = {{.*}} convergent {{.*}}
#endif
diff --git a/src/llvm-project/clang/test/OpenMP/nvptx_target_codegen.cpp b/src/llvm-project/clang/test/OpenMP/nvptx_target_codegen.cpp
index 84ff991..817eca0 100644
--- a/src/llvm-project/clang/test/OpenMP/nvptx_target_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/nvptx_target_codegen.cpp
@@ -573,10 +573,12 @@
// CHECK: [[EXIT]]
// CHECK: ret void
- // CHECK: define{{ dso_local | }}i32 [[BAZ]](i32 [[F:%.*]], double* dereferenceable{{.*}})
+ // CHECK: define{{ hidden | }}i32 [[BAZ]](i32 [[F:%.*]], double* dereferenceable{{.*}})
// CHECK: alloca i32,
// CHECK: [[LOCAL_F_PTR:%.+]] = alloca i32,
// CHECK: [[ZERO_ADDR:%.+]] = alloca i32,
+ // CHECK: [[BND_ZERO_ADDR:%.+]] = alloca i32,
+ // CHECK: store i32 0, i32* [[BND_ZERO_ADDR]]
// CHECK: store i32 0, i32* [[ZERO_ADDR]]
// CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* [[UNKNOWN]]
// CHECK: [[PAR_LEVEL:%.+]] = call i16 @__kmpc_parallel_level(%struct.ident_t* [[UNKNOWN]], i32 [[GTID]])
@@ -609,7 +611,7 @@
// CHECK: br i1
// CHECK: call void @__kmpc_serialized_parallel(%struct.ident_t* [[UNKNOWN]], i32 [[GTID]])
- // CHECK: call void [[OUTLINED:@.+]](i32* [[ZERO_ADDR]], i32* [[ZERO_ADDR]], i32* [[F_PTR]], double* %{{.+}})
+ // CHECK: call void [[OUTLINED:@.+]](i32* [[ZERO_ADDR]], i32* [[BND_ZERO_ADDR]], i32* [[F_PTR]], double* %{{.+}})
// CHECK: call void @__kmpc_end_serialized_parallel(%struct.ident_t* [[UNKNOWN]], i32 [[GTID]])
// CHECK: br label
diff --git a/src/llvm-project/clang/test/OpenMP/nvptx_target_parallel_reduction_codegen.cpp b/src/llvm-project/clang/test/OpenMP/nvptx_target_parallel_reduction_codegen.cpp
index c23f275bd..3524008 100644
--- a/src/llvm-project/clang/test/OpenMP/nvptx_target_parallel_reduction_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/nvptx_target_parallel_reduction_codegen.cpp
@@ -87,7 +87,7 @@
//
// Reduction function
- // CHECK: define internal void [[REDUCTION_FUNC:@.+]](i8*, i8*)
+ // CHECK: define internal void [[REDUCTION_FUNC:@.+]](i8* %0, i8* %1)
// CHECK: [[VAR_RHS_REF:%.+]] = getelementptr inbounds [[RLT]], [[RLT]]* [[RED_LIST_RHS:%.+]], i{{32|64}} 0, i{{32|64}} 0
// CHECK: [[VAR_RHS_VOID:%.+]] = load i8*, i8** [[VAR_RHS_REF]],
// CHECK: [[VAR_RHS:%.+]] = bitcast i8* [[VAR_RHS_VOID]] to double*
@@ -104,7 +104,7 @@
//
// Shuffle and reduce function
- // CHECK: define internal void [[SHUFFLE_REDUCE_FN]](i8*, i16 {{.*}}, i16 {{.*}}, i16 {{.*}})
+ // CHECK: define internal void [[SHUFFLE_REDUCE_FN]](i8* %0, i16 {{.*}}, i16 {{.*}}, i16 {{.*}})
// CHECK: [[REMOTE_RED_LIST:%.+]] = alloca [[RLT]], align
// CHECK: [[REMOTE_ELT:%.+]] = alloca double
//
@@ -181,7 +181,7 @@
//
// Inter warp copy function
- // CHECK: define internal void [[WARP_COPY_FN]](i8*, i32)
+ // CHECK: define internal void [[WARP_COPY_FN]](i8* %0, i32 %1)
// CHECK-DAG: [[LANEID:%.+]] = and i32 {{.+}}, 31
// CHECK-DAG: [[WARPID:%.+]] = ashr i32 {{.+}}, 5
// CHECK-DAG: [[RED_LIST:%.+]] = bitcast i8* {{.+}} to [[RLT]]*
@@ -293,7 +293,7 @@
//
// Reduction function
- // CHECK: define internal void [[REDUCTION_FUNC:@.+]](i8*, i8*)
+ // CHECK: define internal void [[REDUCTION_FUNC:@.+]](i8* %0, i8* %1)
// CHECK: [[VAR1_RHS_REF:%.+]] = getelementptr inbounds [[RLT]], [[RLT]]* [[RED_LIST_RHS:%.+]], i{{32|64}} 0, i{{32|64}} 0
// CHECK: [[VAR1_RHS:%.+]] = load i8*, i8** [[VAR1_RHS_REF]],
//
@@ -324,7 +324,7 @@
//
// Shuffle and reduce function
- // CHECK: define internal void [[SHUFFLE_REDUCE_FN]](i8*, i16 {{.*}}, i16 {{.*}}, i16 {{.*}})
+ // CHECK: define internal void [[SHUFFLE_REDUCE_FN]](i8* %0, i16 {{.*}}, i16 {{.*}}, i16 {{.*}})
// CHECK: [[REMOTE_RED_LIST:%.+]] = alloca [[RLT]], align
// CHECK: [[REMOTE_ELT1:%.+]] = alloca i8
// CHECK: [[REMOTE_ELT2:%.+]] = alloca float
@@ -423,7 +423,7 @@
//
// Inter warp copy function
- // CHECK: define internal void [[WARP_COPY_FN]](i8*, i32)
+ // CHECK: define internal void [[WARP_COPY_FN]](i8* %0, i32 %1)
// CHECK-DAG: [[LANEID:%.+]] = and i32 {{.+}}, 31
// CHECK-DAG: [[WARPID:%.+]] = ashr i32 {{.+}}, 5
// CHECK-DAG: [[RED_LIST:%.+]] = bitcast i8* {{.+}} to [[RLT]]*
@@ -590,7 +590,7 @@
//
// Reduction function
- // CHECK: define internal void [[REDUCTION_FUNC:@.+]](i8*, i8*)
+ // CHECK: define internal void [[REDUCTION_FUNC:@.+]](i8* %0, i8* %1)
// CHECK: [[VAR1_RHS_REF:%.+]] = getelementptr inbounds [[RLT]], [[RLT]]* [[RED_LIST_RHS:%.+]], i{{32|64}} 0, i{{32|64}} 0
// CHECK: [[VAR1_RHS_VOID:%.+]] = load i8*, i8** [[VAR1_RHS_REF]],
// CHECK: [[VAR1_RHS:%.+]] = bitcast i8* [[VAR1_RHS_VOID]] to i32*
@@ -635,7 +635,7 @@
//
// Shuffle and reduce function
- // CHECK: define internal void [[SHUFFLE_REDUCE_FN]](i8*, i16 {{.*}}, i16 {{.*}}, i16 {{.*}})
+ // CHECK: define internal void [[SHUFFLE_REDUCE_FN]](i8* %0, i16 {{.*}}, i16 {{.*}}, i16 {{.*}})
// CHECK: [[REMOTE_RED_LIST:%.+]] = alloca [[RLT]], align
// CHECK: [[REMOTE_ELT1:%.+]] = alloca i32
// CHECK: [[REMOTE_ELT2:%.+]] = alloca i16
@@ -736,7 +736,7 @@
//
// Inter warp copy function
- // CHECK: define internal void [[WARP_COPY_FN]](i8*, i32)
+ // CHECK: define internal void [[WARP_COPY_FN]](i8* %0, i32 %1)
// CHECK-DAG: [[LANEID:%.+]] = and i32 {{.+}}, 31
// CHECK-DAG: [[WARPID:%.+]] = ashr i32 {{.+}}, 5
// CHECK-DAG: [[RED_LIST:%.+]] = bitcast i8* {{.+}} to [[RLT]]*
diff --git a/src/llvm-project/clang/test/OpenMP/nvptx_target_pure_deleted_codegen.cpp b/src/llvm-project/clang/test/OpenMP/nvptx_target_pure_deleted_codegen.cpp
new file mode 100644
index 0000000..1e83cf6
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/nvptx_target_pure_deleted_codegen.cpp
@@ -0,0 +1,34 @@
+// Test target codegen - host bc file has to be created first.
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm-bc %s -o %t-ppc-host.bc
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple nvptx64-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - -fno-rtti | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda -emit-llvm-bc %s -o %t-x86-host.bc
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple nvptx-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o - -fno-rtti | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -fexceptions -fcxx-exceptions -x c++ -triple nvptx-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o - -fno-rtti | FileCheck %s
+// expected-no-diagnostics
+
+#ifndef HEADER
+#define HEADER
+
+
+// CHECK-DAG: @_ZTV7Derived = linkonce_odr hidden unnamed_addr constant { [3 x i8*] } { [3 x i8*] [i8* null, i8* null, i8* bitcast (void (%class.Derived*)* @_ZN7Derived3fooEv to i8*)] }
+// CHECK-DAG: @_ZTV4Base = linkonce_odr hidden unnamed_addr constant { [3 x i8*] } zeroinitializer
+class Base {
+ public:
+ virtual void foo() = 0;
+};
+
+class Derived : public Base {
+public:
+ void foo() override {}
+ void bar() = delete;
+};
+
+void target() {
+#pragma omp target
+ {
+ Derived D;
+ D.foo();
+ }
+}
+
+#endif
diff --git a/src/llvm-project/clang/test/OpenMP/nvptx_target_requires_unified_shared_memory.cpp b/src/llvm-project/clang/test/OpenMP/nvptx_target_requires_unified_shared_memory.cpp
index 578df53..877aa7a 100644
--- a/src/llvm-project/clang/test/OpenMP/nvptx_target_requires_unified_shared_memory.cpp
+++ b/src/llvm-project/clang/test/OpenMP/nvptx_target_requires_unified_shared_memory.cpp
@@ -31,21 +31,19 @@
}
// CHECK-HOST: [[VAR:@.+]] = global double 1.000000e+01
-// CHECK-HOST: [[VAR_DECL_TGT_LINK_PTR:@.+]] = global double* [[VAR]]
+// CHECK-HOST: [[VAR_DECL_TGT_LINK_PTR:@.+]] = weak global double* [[VAR]]
// CHECK-HOST: [[TO_VAR:@.+]] = global double 2.000000e+01
-// CHECK-HOST: [[VAR_DECL_TGT_TO_PTR:@.+]] = global double* [[TO_VAR]]
+// CHECK-HOST: [[VAR_DECL_TGT_TO_PTR:@.+]] = weak global double* [[TO_VAR]]
// CHECK-HOST: [[OFFLOAD_SIZES:@.+]] = private unnamed_addr constant [2 x i64] [i64 4, i64 8]
// CHECK-HOST: [[OFFLOAD_MAPTYPES:@.+]] = private unnamed_addr constant [2 x i64] [i64 800, i64 800]
// CHECK-HOST: [[OMP_OFFLOAD_ENTRY_LINK_VAR_PTR_NAME:@.+]] = internal unnamed_addr constant [21 x i8]
-// CHECK-HOST: [[OMP_OFFLOAD_ENTRY_LINK_VAR_PTR:@.+]] = weak constant %struct.__tgt_offload_entry { i8* bitcast (double** [[VAR_DECL_TGT_LINK_PTR]] to i8*), i8* getelementptr inbounds ([21 x i8], [21 x i8]* [[OMP_OFFLOAD_ENTRY_LINK_VAR_PTR_NAME]], i32 0, i32 0), i64 8, i32 1, i32 0 }, section ".omp_offloading.entries"
+// CHECK-HOST: [[OMP_OFFLOAD_ENTRY_LINK_VAR_PTR:@.+]] = weak constant %struct.__tgt_offload_entry { i8* bitcast (double** [[VAR_DECL_TGT_LINK_PTR]] to i8*), i8* getelementptr inbounds ([21 x i8], [21 x i8]* [[OMP_OFFLOAD_ENTRY_LINK_VAR_PTR_NAME]], i32 0, i32 0), i64 8, i32 1, i32 0 }, section "omp_offloading_entries"
// CHECK-HOST: [[OMP_OFFLOAD_ENTRY_TO_VAR_PTR_NAME:@.+]] = internal unnamed_addr constant [24 x i8]
-// CHECK-HOST: [[OMP_OFFLOAD_ENTRY_TO_VAR_PTR:@.+]] = weak constant %struct.__tgt_offload_entry { i8* bitcast (double** [[VAR_DECL_TGT_TO_PTR]] to i8*), i8* getelementptr inbounds ([24 x i8], [24 x i8]* [[OMP_OFFLOAD_ENTRY_TO_VAR_PTR_NAME]], i32 0, i32 0), i64 8, i32 0, i32 0 }, section ".omp_offloading.entries"
-
-// CHECK-HOST: @llvm.used = appending global [2 x i8*] [i8* bitcast (double** [[VAR_DECL_TGT_LINK_PTR]] to i8*), i8* bitcast (double** [[VAR_DECL_TGT_TO_PTR]] to i8*)], section "llvm.metadata"
+// CHECK-HOST: [[OMP_OFFLOAD_ENTRY_TO_VAR_PTR:@.+]] = weak constant %struct.__tgt_offload_entry { i8* bitcast (double** [[VAR_DECL_TGT_TO_PTR]] to i8*), i8* getelementptr inbounds ([24 x i8], [24 x i8]* [[OMP_OFFLOAD_ENTRY_TO_VAR_PTR_NAME]], i32 0, i32 0), i64 8, i32 0, i32 0 }, section "omp_offloading_entries"
// CHECK-HOST: [[N_CASTED:%.+]] = alloca i64
// CHECK-HOST: [[SUM_CASTED:%.+]] = alloca i64
@@ -75,10 +73,8 @@
// CHECK-HOST: call i32 @__tgt_target(i64 -1, i8* @{{.*}}.region_id, i32 2, i8** [[BPTR7]], i8** [[BPTR8]], i64* getelementptr inbounds ([2 x i64], [2 x i64]* [[OFFLOAD_SIZES]], i32 0, i32 0), i64* getelementptr inbounds ([2 x i64], [2 x i64]* [[OFFLOAD_MAPTYPES]], i32 0, i32 0))
-// CHECK-DEVICE: [[VAR_LINK:@.+]] = common global double* null
-// CHECK-DEVICE: [[VAR_TO:@.+]] = common global double* null
-
-// CHECK-DEVICE: @llvm.used = appending global [2 x i8*] [i8* bitcast (double** [[VAR_LINK]] to i8*), i8* bitcast (double** [[VAR_TO]] to i8*)], section "llvm.metadata"
+// CHECK-DEVICE: [[VAR_LINK:@.+]] = weak global double* null
+// CHECK-DEVICE: [[VAR_TO:@.+]] = weak global double* null
// CHECK-DEVICE: [[VAR_TO_PTR:%.+]] = load double*, double** [[VAR_TO]]
// CHECK-DEVICE: load double, double* [[VAR_TO_PTR]]
diff --git a/src/llvm-project/clang/test/OpenMP/nvptx_teams_reduction_codegen.cpp b/src/llvm-project/clang/test/OpenMP/nvptx_teams_reduction_codegen.cpp
index 9048336..d17eee2 100644
--- a/src/llvm-project/clang/test/OpenMP/nvptx_teams_reduction_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/nvptx_teams_reduction_codegen.cpp
@@ -104,7 +104,7 @@
//
// Reduction function
- // CHECK: define internal void [[REDUCTION_FUNC:@.+]](i8*, i8*)
+ // CHECK: define internal void [[REDUCTION_FUNC:@.+]](i8* %0, i8* %1)
// CHECK: [[VAR_RHS_REF:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[RED_LIST_RHS:%.+]], i{{32|64}} 0, i{{32|64}} 0
// CHECK: [[VAR_RHS_VOID:%.+]] = load i8*, i8** [[VAR_RHS_REF]],
// CHECK: [[VAR_RHS:%.+]] = bitcast i8* [[VAR_RHS_VOID]] to double*
@@ -121,7 +121,7 @@
//
// Shuffle and reduce function
- // CHECK: define internal void [[SHUFFLE_AND_REDUCE]](i8*, i16 {{.*}}, i16 {{.*}}, i16 {{.*}})
+ // CHECK: define internal void [[SHUFFLE_AND_REDUCE]](i8* %0, i16 {{.*}}, i16 {{.*}}, i16 {{.*}})
// CHECK: [[REMOTE_RED_LIST:%.+]] = alloca [1 x i8*], align
// CHECK: [[REMOTE_ELT:%.+]] = alloca double
//
@@ -198,7 +198,7 @@
//
// Inter warp copy function
- // CHECK: define internal void [[INTER_WARP_COPY]](i8*, i32)
+ // CHECK: define internal void [[INTER_WARP_COPY]](i8* %0, i32 %1)
// CHECK-DAG: [[LANEID:%.+]] = and i32 {{.+}}, 31
// CHECK-DAG: [[WARPID:%.+]] = ashr i32 {{.+}}, 5
// CHECK-DAG: [[RED_LIST:%.+]] = bitcast i8* {{.+}} to [1 x i8*]*
@@ -253,7 +253,7 @@
// CHECK: br label
// CHECK: ret
- // CHECK: define internal void [[RED_LIST_TO_GLOBAL_COPY]](i8*, i32, i8*)
+ // CHECK: define internal void [[RED_LIST_TO_GLOBAL_COPY]](i8* %0, i32 %1, i8* %2)
// CHECK: [[GLOBAL_PTR:%.+]] = alloca i8*,
// CHECK: [[IDX_PTR:%.+]] = alloca i32,
// CHECK: [[RL_PTR:%.+]] = alloca i8*,
@@ -274,7 +274,7 @@
// CHECK: store double [[LOC_RED1]], double* [[GLOBAL_RED1_IDX_PTR]],
// CHECK: ret void
- // CHECK: define internal void [[RED_LIST_TO_GLOBAL_RED]](i8*, i32, i8*)
+ // CHECK: define internal void [[RED_LIST_TO_GLOBAL_RED]](i8* %0, i32 %1, i8* %2)
// CHECK: [[GLOBAL_PTR:%.+]] = alloca i8*,
// CHECK: [[IDX_PTR:%.+]] = alloca i32,
// CHECK: [[RL_PTR:%.+]] = alloca i8*,
@@ -295,7 +295,7 @@
// CHECK: call void [[REDUCTION_FUNC]](i8* [[LOCAL_RL_BC]], i8* [[RL_BC]])
// CHECK: ret void
- // CHECK: define internal void [[GLOBAL_TO_RED_LIST_COPY]](i8*, i32, i8*)
+ // CHECK: define internal void [[GLOBAL_TO_RED_LIST_COPY]](i8* %0, i32 %1, i8* %2)
// CHECK: [[GLOBAL_PTR:%.+]] = alloca i8*,
// CHECK: [[IDX_PTR:%.+]] = alloca i32,
// CHECK: [[RL_PTR:%.+]] = alloca i8*,
@@ -316,7 +316,7 @@
// CHECK: store double [[GLOBAL_RED1]], double* [[RL_RED1]],
// CHECK: ret void
- // CHECK: define internal void [[GLOBAL_TO_RED_LIST_RED]](i8*, i32, i8*)
+ // CHECK: define internal void [[GLOBAL_TO_RED_LIST_RED]](i8* %0, i32 %1, i8* %2)
// CHECK: [[GLOBAL_PTR:%.+]] = alloca i8*,
// CHECK: [[IDX_PTR:%.+]] = alloca i32,
// CHECK: [[RL_PTR:%.+]] = alloca i8*,
@@ -386,7 +386,7 @@
//
// Reduction function
- // CHECK: define internal void [[REDUCTION_FUNC:@.+]](i8*, i8*)
+ // CHECK: define internal void [[REDUCTION_FUNC:@.+]](i8* %0, i8* %1)
// CHECK: [[VAR1_RHS_REF:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[RED_LIST_RHS:%.+]], i{{32|64}} 0, i{{32|64}} 0
// CHECK: [[VAR1_RHS:%.+]] = load i8*, i8** [[VAR1_RHS_REF]],
//
@@ -417,7 +417,7 @@
//
// Shuffle and reduce function
- // CHECK: define internal void [[SHUFFLE_AND_REDUCE]](i8*, i16 {{.*}}, i16 {{.*}}, i16 {{.*}})
+ // CHECK: define internal void [[SHUFFLE_AND_REDUCE]](i8* %0, i16 {{.*}}, i16 {{.*}}, i16 {{.*}})
// CHECK: [[REMOTE_RED_LIST:%.+]] = alloca [2 x i8*], align
// CHECK: [[REMOTE_ELT1:%.+]] = alloca i8
// CHECK: [[REMOTE_ELT2:%.+]] = alloca float
@@ -516,7 +516,7 @@
//
// Inter warp copy function
- // CHECK: define internal void [[INTER_WARP_COPY]](i8*, i32)
+ // CHECK: define internal void [[INTER_WARP_COPY]](i8* %0, i32 %1)
// CHECK-DAG: [[LANEID:%.+]] = and i32 {{.+}}, 31
// CHECK-DAG: [[WARPID:%.+]] = ashr i32 {{.+}}, 5
// CHECK-DAG: [[RED_LIST:%.+]] = bitcast i8* {{.+}} to [2 x i8*]*
@@ -600,7 +600,7 @@
// CHECK: [[READ_CONT]]
// CHECK: ret
- // CHECK: define internal void [[RED_LIST_TO_GLOBAL_COPY]](i8*, i32, i8*)
+ // CHECK: define internal void [[RED_LIST_TO_GLOBAL_COPY]](i8* %0, i32 %1, i8* %2)
// CHECK: [[GLOBAL_PTR:%.+]] = alloca i8*,
// CHECK: [[IDX_PTR:%.+]] = alloca i32,
// CHECK: [[RL_PTR:%.+]] = alloca i8*,
@@ -627,7 +627,7 @@
// CHECK: store float [[LOC_RED1]], float* [[GLOBAL_RED1_IDX_PTR]],
// CHECK: ret void
- // CHECK: define internal void [[RED_LIST_TO_GLOBAL_RED]](i8*, i32, i8*)
+ // CHECK: define internal void [[RED_LIST_TO_GLOBAL_RED]](i8* %0, i32 %1, i8* %2)
// CHECK: [[GLOBAL_PTR:%.+]] = alloca i8*,
// CHECK: [[IDX_PTR:%.+]] = alloca i32,
// CHECK: [[RL_PTR:%.+]] = alloca i8*,
@@ -652,7 +652,7 @@
// CHECK: call void [[REDUCTION_FUNC]](i8* [[LOCAL_RL_BC]], i8* [[RL_BC]])
// CHECK: ret void
- // CHECK: define internal void [[GLOBAL_TO_RED_LIST_COPY]](i8*, i32, i8*)
+ // CHECK: define internal void [[GLOBAL_TO_RED_LIST_COPY]](i8* %0, i32 %1, i8* %2)
// CHECK: [[GLOBAL_PTR:%.+]] = alloca i8*,
// CHECK: [[IDX_PTR:%.+]] = alloca i32,
// CHECK: [[RL_PTR:%.+]] = alloca i8*,
@@ -679,7 +679,7 @@
// CHECK: store float [[GLOBAL_RED1]], float* [[RL_RED1]],
// CHECK: ret void
- // CHECK: define internal void [[GLOBAL_TO_RED_LIST_RED]](i8*, i32, i8*)
+ // CHECK: define internal void [[GLOBAL_TO_RED_LIST_RED]](i8* %0, i32 %1, i8* %2)
// CHECK: [[GLOBAL_PTR:%.+]] = alloca i8*,
// CHECK: [[IDX_PTR:%.+]] = alloca i32,
// CHECK: [[RL_PTR:%.+]] = alloca i8*,
@@ -712,6 +712,7 @@
// CHECK-NOT: call void @__kmpc_get_team_static_memory
// CHECK: store i32 0,
+ // CHECK: store i32 0,
// CHECK: store i32 0, i32* [[A_ADDR:%.+]], align
// CHECK: store i16 -32768, i16* [[B_ADDR:%.+]], align
// CHECK: call void [[OUTLINED:@.+]](i32* {{.+}}, i32* {{.+}}, i32* [[A_ADDR]], i16* [[B_ADDR]])
@@ -821,7 +822,7 @@
//
// Reduction function
- // CHECK: define internal void [[PAR_REDUCTION_FUNC:@.+]](i8*, i8*)
+ // CHECK: define internal void [[PAR_REDUCTION_FUNC:@.+]](i8* %0, i8* %1)
// CHECK: [[VAR1_RHS_REF:%.+]] = getelementptr inbounds [[RLT]], [[RLT]]* [[RED_LIST_RHS:%.+]], i[[SZ]] 0, i[[SZ]] 0
// CHECK: [[VAR1_RHS_VOID:%.+]] = load i8*, i8** [[VAR1_RHS_REF]],
// CHECK: [[VAR1_RHS:%.+]] = bitcast i8* [[VAR1_RHS_VOID]] to i32*
@@ -865,7 +866,7 @@
// CHECK: ret void
//
// Shuffle and reduce function
- // CHECK: define internal void [[PAR_SHUFFLE_REDUCE_FN]](i8*, i16 {{.*}}, i16 {{.*}}, i16 {{.*}})
+ // CHECK: define internal void [[PAR_SHUFFLE_REDUCE_FN]](i8* %0, i16 {{.*}}, i16 {{.*}}, i16 {{.*}})
// CHECK: [[REMOTE_RED_LIST:%.+]] = alloca [[RLT]], align
// CHECK: [[REMOTE_ELT1:%.+]] = alloca i32
// CHECK: [[REMOTE_ELT2:%.+]] = alloca i16
@@ -966,7 +967,7 @@
//
// Inter warp copy function
- // CHECK: define internal void [[PAR_WARP_COPY_FN]](i8*, i32)
+ // CHECK: define internal void [[PAR_WARP_COPY_FN]](i8* %0, i32 %1)
// CHECK-DAG: [[LANEID:%.+]] = and i32 {{.+}}, 31
// CHECK-DAG: [[WARPID:%.+]] = ashr i32 {{.+}}, 5
// CHECK-DAG: [[RED_LIST:%.+]] = bitcast i8* {{.+}} to [[RLT]]*
@@ -1053,7 +1054,7 @@
//
// Reduction function
- // CHECK: define internal void [[REDUCTION_FUNC:@.+]](i8*, i8*)
+ // CHECK: define internal void [[REDUCTION_FUNC:@.+]](i8* %0, i8* %1)
// CHECK: [[VAR1_RHS_REF:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[RED_LIST_RHS:%.+]], i[[SZ]] 0, i[[SZ]] 0
// CHECK: [[VAR1_RHS_VOID:%.+]] = load i8*, i8** [[VAR1_RHS_REF]],
// CHECK: [[VAR1_RHS:%.+]] = bitcast i8* [[VAR1_RHS_VOID]] to i32*
@@ -1098,7 +1099,7 @@
//
// Shuffle and reduce function
- // CHECK: define internal void [[SHUFFLE_AND_REDUCE]](i8*, i16 {{.*}}, i16 {{.*}}, i16 {{.*}})
+ // CHECK: define internal void [[SHUFFLE_AND_REDUCE]](i8* %0, i16 {{.*}}, i16 {{.*}}, i16 {{.*}})
// CHECK: [[REMOTE_RED_LIST:%.+]] = alloca [2 x i8*], align
// CHECK: [[REMOTE_ELT1:%.+]] = alloca i32
// CHECK: [[REMOTE_ELT2:%.+]] = alloca i16
@@ -1199,7 +1200,7 @@
//
// Inter warp copy function
- // CHECK: define internal void [[INTER_WARP_COPY]](i8*, i32)
+ // CHECK: define internal void [[INTER_WARP_COPY]](i8* %0, i32 %1)
// CHECK-DAG: [[LANEID:%.+]] = and i32 {{.+}}, 31
// CHECK-DAG: [[WARPID:%.+]] = ashr i32 {{.+}}, 5
// CHECK-DAG: [[RED_LIST:%.+]] = bitcast i8* {{.+}} to [[RLT]]*
@@ -1285,7 +1286,7 @@
// CHECK: [[READ_CONT]]
// CHECK: ret
- // CHECK: define internal void [[RED_LIST_TO_GLOBAL_COPY]](i8*, i32, i8*)
+ // CHECK: define internal void [[RED_LIST_TO_GLOBAL_COPY]](i8* %0, i32 %1, i8* %2)
// CHECK: [[GLOBAL_PTR:%.+]] = alloca i8*,
// CHECK: [[IDX_PTR:%.+]] = alloca i32,
// CHECK: [[RL_PTR:%.+]] = alloca i8*,
@@ -1313,7 +1314,7 @@
// CHECK: store i16 [[LOC_RED1]], i16* [[GLOBAL_RED1_IDX_PTR]],
// CHECK: ret void
- // CHECK: define internal void [[RED_LIST_TO_GLOBAL_RED]](i8*, i32, i8*)
+ // CHECK: define internal void [[RED_LIST_TO_GLOBAL_RED]](i8* %0, i32 %1, i8* %2)
// CHECK: [[GLOBAL_PTR:%.+]] = alloca i8*,
// CHECK: [[IDX_PTR:%.+]] = alloca i32,
// CHECK: [[RL_PTR:%.+]] = alloca i8*,
@@ -1339,7 +1340,7 @@
// CHECK: call void [[REDUCTION_FUNC]](i8* [[LOCAL_RL_BC]], i8* [[RL_BC]])
// CHECK: ret void
- // CHECK: define internal void [[GLOBAL_TO_RED_LIST_COPY]](i8*, i32, i8*)
+ // CHECK: define internal void [[GLOBAL_TO_RED_LIST_COPY]](i8* %0, i32 %1, i8* %2)
// CHECK: [[GLOBAL_PTR:%.+]] = alloca i8*,
// CHECK: [[IDX_PTR:%.+]] = alloca i32,
// CHECK: [[RL_PTR:%.+]] = alloca i8*,
@@ -1367,7 +1368,7 @@
// CHECK: store i16 [[GLOBAL_RED1]], i16* [[RL_RED1]],
// CHECK: ret void
- // CHECK: define internal void [[GLOBAL_TO_RED_LIST_RED]](i8*, i32, i8*)
+ // CHECK: define internal void [[GLOBAL_TO_RED_LIST_RED]](i8* %0, i32 %1, i8* %2)
// CHECK: [[GLOBAL_PTR:%.+]] = alloca i8*,
// CHECK: [[IDX_PTR:%.+]] = alloca i32,
// CHECK: [[RL_PTR:%.+]] = alloca i8*,
diff --git a/src/llvm-project/clang/test/OpenMP/nvptx_unsupported_type_codegen.cpp b/src/llvm-project/clang/test/OpenMP/nvptx_unsupported_type_codegen.cpp
index c1a595b..0e5abba 100644
--- a/src/llvm-project/clang/test/OpenMP/nvptx_unsupported_type_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/nvptx_unsupported_type_codegen.cpp
@@ -34,18 +34,18 @@
#pragma omp declare target
T a = T();
T f = a;
-// CHECK: define{{ dso_local | }}void @{{.+}}foo{{.+}}([[T]]* byval([[T]]) align {{.+}})
+// CHECK: define{{ hidden | }}void @{{.+}}foo{{.+}}([[T]]* byval([[T]]) align {{.+}})
void foo(T a = T()) {
return;
}
-// CHECK: define{{ dso_local | }}[6 x i64] @{{.+}}bar{{.+}}()
+// CHECK: define{{ hidden | }}[6 x i64] @{{.+}}bar{{.+}}()
T bar() {
// CHECK: bitcast [[T]]* %{{.+}} to [6 x i64]*
// CHECK-NEXT: load [6 x i64], [6 x i64]* %{{.+}},
// CHECK-NEXT: ret [6 x i64]
return T();
}
-// CHECK: define{{ dso_local | }}void @{{.+}}baz{{.+}}()
+// CHECK: define{{ hidden | }}void @{{.+}}baz{{.+}}()
void baz() {
// CHECK: call [6 x i64] @{{.+}}bar{{.+}}()
// CHECK-NEXT: bitcast [[T]]* %{{.+}} to [6 x i64]*
@@ -54,17 +54,17 @@
}
T1 a1 = T1();
T1 f1 = a1;
-// CHECK: define{{ dso_local | }}void @{{.+}}foo1{{.+}}([[T1]]* byval([[T1]]) align {{.+}})
+// CHECK: define{{ hidden | }}void @{{.+}}foo1{{.+}}([[T1]]* byval([[T1]]) align {{.+}})
void foo1(T1 a = T1()) {
return;
}
-// CHECK: define{{ dso_local | }}[[T1]] @{{.+}}bar1{{.+}}()
+// CHECK: define{{ hidden | }}[[T1]] @{{.+}}bar1{{.+}}()
T1 bar1() {
// CHECK: load [[T1]], [[T1]]*
// CHECK-NEXT: ret [[T1]]
return T1();
}
-// CHECK: define{{ dso_local | }}void @{{.+}}baz1{{.+}}()
+// CHECK: define{{ hidden | }}void @{{.+}}baz1{{.+}}()
void baz1() {
// CHECK: call [[T1]] @{{.+}}bar1{{.+}}()
T1 t = bar1();
diff --git a/src/llvm-project/clang/test/OpenMP/nvptx_va_arg_delayed_diags.c b/src/llvm-project/clang/test/OpenMP/nvptx_va_arg_delayed_diags.c
index 3420884..49ab99f 100644
--- a/src/llvm-project/clang/test/OpenMP/nvptx_va_arg_delayed_diags.c
+++ b/src/llvm-project/clang/test/OpenMP/nvptx_va_arg_delayed_diags.c
@@ -9,6 +9,19 @@
// expected-no-diagnostics
#endif // DIAGS
+void foo(int r, ...) {
+#ifdef IMMEDIATE
+// expected-error@+4 {{CUDA device code does not support va_arg}}
+#endif // IMMEDIATE
+ __builtin_va_list list;
+ __builtin_va_start(list, r);
+ (void)__builtin_va_arg(list, int);
+ __builtin_va_end(list);
+}
+#ifdef IMMEDIATE
+#pragma omp declare target to(foo)
+#endif //IMMEDIATE
+
#ifdef IMMEDIATE
#pragma omp declare target
#endif //IMMEDIATE
diff --git a/src/llvm-project/clang/test/OpenMP/openmp_check.cpp b/src/llvm-project/clang/test/OpenMP/openmp_check.cpp
index cd4706b..6a8dd17 100644
--- a/src/llvm-project/clang/test/OpenMP/openmp_check.cpp
+++ b/src/llvm-project/clang/test/OpenMP/openmp_check.cpp
@@ -19,7 +19,6 @@
#if __cplusplus <= 199711L
// expected-warning@-2 {{'auto' type specifier is a C++11 extension}}
// expected-error@-3 {{expected expression}}
- // expected-error@-4 {{expected ';' at end of declaration}}
#endif
#pragma omp parallel
@@ -29,14 +28,5 @@
}
};
F();
-#if __cplusplus <= 199711L
- // expected-error@-2 {{C++ requires a type specifier for all declarations}}
-#endif
return a;
-#if __cplusplus <= 199711L
- // expected-error@-2 {{expected unqualified-id}}
-#endif
}
-#if __cplusplus <= 199711L
-// expected-error@-2 {{extraneous closing brace ('}')}}
-#endif
diff --git a/src/llvm-project/clang/test/OpenMP/openmp_offload_registration.cpp b/src/llvm-project/clang/test/OpenMP/openmp_offload_registration.cpp
index 5d3ce7e..1aa2067 100644
--- a/src/llvm-project/clang/test/OpenMP/openmp_offload_registration.cpp
+++ b/src/llvm-project/clang/test/OpenMP/openmp_offload_registration.cpp
@@ -1,5 +1,6 @@
-// Test for offload registration code for two targets
+// Test offload registration for two targets, and test offload target validation.
// RUN: %clang_cc1 -verify -fopenmp -x c -triple x86_64-unknown-linux-gnu -fopenmp-targets=x86_64-pc-linux-gnu,powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -x c -triple x86_64-unknown-linux-gnu -fopenmp-targets=aarch64-unknown-linux-gnu -emit-llvm %s -o - | FileCheck %s
// expected-no-diagnostics
void foo() {
@@ -8,25 +9,9 @@
}
// CHECK-DAG: [[ENTTY:%.+]] = type { i8*, i8*, i[[SZ:32|64]], i32, i32 }
-// CHECK-DAG: [[DEVTY:%.+]] = type { i8*, i8*, [[ENTTY]]*, [[ENTTY]]* }
-// CHECK-DAG: [[DSCTY:%.+]] = type { i32, [[DEVTY]]*, [[ENTTY]]*, [[ENTTY]]* }
-
-// Comdat key for the offload registration code. Should have sorted offload
-// target triples encoded into the name.
-// CHECK-DAG: $[[REGFN:\.omp_offloading\..+\.powerpc64le-ibm-linux-gnu\.x86_64-pc-linux-gnu+]] = comdat any
-
-// Check if offloading descriptor is created.
-// CHECK: [[ENTBEGIN:@.+]] = external constant [[ENTTY]]
-// CHECK: [[ENTEND:@.+]] = external constant [[ENTTY]]
-// CHECK: [[DEV1BEGIN:@.+]] = extern_weak constant i8
-// CHECK: [[DEV1END:@.+]] = extern_weak constant i8
-// CHECK: [[DEV2BEGIN:@.+]] = extern_weak constant i8
-// CHECK: [[DEV2END:@.+]] = extern_weak constant i8
-// CHECK: [[IMAGES:@.+]] = internal unnamed_addr constant [2 x [[DEVTY]]] [{{.+}} { i8* [[DEV1BEGIN]], i8* [[DEV1END]], [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }, {{.+}} { i8* [[DEV2BEGIN]], i8* [[DEV2END]], [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }], comdat($[[REGFN]])
-// CHECK: [[DESC:@.+]] = internal constant [[DSCTY]] { i32 2, [[DEVTY]]* getelementptr inbounds ([2 x [[DEVTY]]], [2 x [[DEVTY]]]* [[IMAGES]], i32 0, i32 0), [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }, comdat($[[REGFN]])
// Check target registration is registered as a Ctor.
-// CHECK: appending global [2 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }, { i32, void ()*, i8* } { i32 0, void ()* @[[REGFN]], i8* bitcast (void ()* @[[REGFN]] to i8*) }]
+// CHECK: appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }]
// Check presence of foo() and the outlined target region
// CHECK: define void [[FOO:@.+]]()
@@ -37,17 +22,3 @@
// CHECK: define internal void @.omp_offloading.requires_reg()
// CHECK: call void @__tgt_register_requires(i64 1)
// CHECK: ret void
-
-// CHECK: define internal void @[[UNREGFN:.+]](i8*)
-// CHECK-SAME: comdat($[[REGFN]]) {
-// CHECK: call i32 @__tgt_unregister_lib([[DSCTY]]* [[DESC]])
-// CHECK: ret void
-// CHECK: declare i32 @__tgt_unregister_lib([[DSCTY]]*)
-
-// CHECK: define linkonce hidden void @[[REGFN]]()
-// CHECK-SAME: comdat {
-// CHECK: call i32 @__tgt_register_lib([[DSCTY]]* [[DESC]])
-// CHECK: call i32 @__cxa_atexit(void (i8*)* @[[UNREGFN]], i8* bitcast ([[DSCTY]]* [[DESC]] to i8*),
-// CHECK: ret void
-// CHECK: declare i32 @__tgt_register_lib([[DSCTY]]*)
-
diff --git a/src/llvm-project/clang/test/OpenMP/openmp_win_codegen.cpp b/src/llvm-project/clang/test/OpenMP/openmp_win_codegen.cpp
index 289f058..b044176 100644
--- a/src/llvm-project/clang/test/OpenMP/openmp_win_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/openmp_win_codegen.cpp
@@ -50,11 +50,10 @@
}
// CHECK: define internal void [[OUTLINED]](
-// CHECK: [[GID:%.+]] = {{.*}}call i32 @__kmpc_global_thread_num(%struct.ident_t* {{.*}}@0)
// CHECK: invoke void @{{.+}}foo
// CHECK: [[CATCHSWITCH:%.+]] = catchswitch within none
// CHECK: [[CATCHPAD:%.+]] = catchpad within [[CATCHSWITCH]]
-// CHECK: call void @__kmpc_critical(%struct.ident_t* {{.*}}@0, i32 [[GID]],
+// CHECK: call void @__kmpc_critical(%struct.ident_t* {{.*}}@0, i32 [[GID:%.+]],
// CHECK: invoke void @{{.+}}bar
// CHECK: call void @__kmpc_end_critical(%struct.ident_t* {{.*}}@0, i32 [[GID]],
// CHECK: catchret from [[CATCHPAD]] to
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_codegen.cpp b/src/llvm-project/clang/test/OpenMP/parallel_codegen.cpp
index bacb2c6..f96ad40 100644
--- a/src/llvm-project/clang/test/OpenMP/parallel_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/parallel_codegen.cpp
@@ -1,22 +1,31 @@
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -emit-llvm %s -triple %itanium_abi_triple -fexceptions -fcxx-exceptions -o - | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -emit-llvm %s -triple %itanium_abi_triple -fexceptions -fcxx-exceptions -o - | FileCheck %s --check-prefixes=ALL,CHECK
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -debug-info-kind=limited -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix=CHECK-DEBUG %s
+// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -debug-info-kind=limited -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefixes=ALL-DEBUG,CHECK-DEBUG %s
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-enable-irbuilder -x c++ -emit-llvm %s -triple %itanium_abi_triple -fexceptions -fcxx-exceptions -o - | FileCheck %s --check-prefixes=ALL,IRBUILDER
+// RUN: %clang_cc1 -fopenmp -fopenmp-enable-irbuilder -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-enable-irbuilder -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -debug-info-kind=limited -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefixes=ALL-DEBUG,IRBUILDER-DEBUG %s
// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -emit-llvm %s -triple %itanium_abi_triple -fexceptions -fcxx-exceptions -o - | FileCheck --check-prefix SIMD-ONLY0 %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -debug-info-kind=limited -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-enable-irbuilder -x c++ -emit-llvm %s -triple %itanium_abi_triple -fexceptions -fcxx-exceptions -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-enable-irbuilder -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-enable-irbuilder -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -debug-info-kind=limited -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
// expected-no-diagnostics
#ifndef HEADER
#define HEADER
-// CHECK-DAG: %struct.ident_t = type { i32, i32, i32, i32, i8* }
-// CHECK-DAG: [[STR:@.+]] = private unnamed_addr constant [23 x i8] c";unknown;unknown;0;0;;\00"
-// CHECK-DAG: [[DEF_LOC_2:@.+]] = private unnamed_addr global %struct.ident_t { i32 0, i32 2, i32 0, i32 0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* [[STR]], i32 0, i32 0) }
+// ALL-DAG: %struct.ident_t = type { i32, i32, i32, i32, i8* }
+// ALL-DAG: [[STR:@.+]] = private unnamed_addr constant [23 x i8] c";unknown;unknown;0;0;;\00"
+// ALL-DAG: [[DEF_LOC_2:@.+]] = private unnamed_addr global %struct.ident_t { i32 0, i32 2, i32 0, i32 0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* [[STR]], i32 0, i32 0) }
// CHECK-DEBUG-DAG: %struct.ident_t = type { i32, i32, i32, i32, i8* }
// CHECK-DEBUG-DAG: [[STR:@.+]] = private unnamed_addr constant [23 x i8] c";unknown;unknown;0;0;;\00"
// CHECK-DEBUG-DAG: [[DEF_LOC_2:@.+]] = private unnamed_addr global %struct.ident_t { i32 0, i32 2, i32 0, i32 0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* [[STR]], i32 0, i32 0) }
-// CHECK-DEBUG-DAG: [[LOC1:@.+]] = private unnamed_addr constant [{{.+}} x i8] c";{{.*}}parallel_codegen.cpp;main;[[@LINE+19]];1;;\00"
-// CHECK-DEBUG-DAG: [[LOC2:@.+]] = private unnamed_addr constant [{{.+}} x i8] c";{{.*}}parallel_codegen.cpp;tmain;[[@LINE+8]];1;;\00"
+// CHECK-DEBUG-DAG: [[LOC1:@.+]] = private unnamed_addr constant [{{.+}} x i8] c";{{.*}}parallel_codegen.cpp;main;[[@LINE+22]];1;;\00"
+// CHECK-DEBUG-DAG: [[LOC2:@.+]] = private unnamed_addr constant [{{.+}} x i8] c";{{.*}}parallel_codegen.cpp;tmain;[[@LINE+11]];1;;\00"
+// IRBUILDER-DEBUG-DAG: %struct.ident_t = type { i32, i32, i32, i32, i8* }
+// IRBUILDER-DEBUG-DAG: [[LOC1:@.+]] = private unnamed_addr constant [{{.+}} x i8] c";{{.*}}parallel_codegen.cpp;main;[[@LINE+19]];0;;\00"
+// IRBUILDER-DEBUG-DAG: [[LOC2:@.+]] = private unnamed_addr constant [{{.+}} x i8] c";{{.*}}parallel_codegen.cpp;tmain<char **>;[[@LINE+8]];0;;\00"
template <class T>
void foo(T argc) {}
@@ -39,65 +48,74 @@
return tmain(argv);
}
-// CHECK-LABEL: define {{[a-z\_\b]*[ ]?i32}} @main({{i32[ ]?[a-z]*}} %argc, i8** %argv)
-// CHECK: store i32 %argc, i32* [[ARGC_ADDR:%.+]],
-// CHECK: [[VLA:%.+]] = alloca i32, i{{[0-9]+}} [[VLA_SIZE:%[^,]+]],
+// ALL-LABEL: define {{[a-z\_\b]*[ ]?i32}} @main({{i32[ ]?[a-z]*}} %argc, i8** %argv)
+// ALL: store i32 %argc, i32* [[ARGC_ADDR:%.+]],
+// ALL: [[VLA:%.+]] = alloca i32, i{{[0-9]+}} [[VLA_SIZE:%[^,]+]],
// CHECK: call {{.*}}void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* [[DEF_LOC_2]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i{{[0-9]+}}, i32*)* [[OMP_OUTLINED:@.+]] to void (i32*, i32*, ...)*), i{{[0-9]+}} [[VLA_SIZE]], i32* [[VLA]])
-// CHECK-NEXT: [[ARGV:%.+]] = load i8**, i8*** {{%[a-z0-9.]+}}
-// CHECK-NEXT: [[RET:%.+]] = call {{[a-z\_\b]*[ ]?i32}} [[TMAIN:@.+tmain.+]](i8** [[ARGV]])
-// CHECK: ret i32
-// CHECK-NEXT: }
-// CHECK-DEBUG-LABEL: define i32 @main(i32 %argc, i8** %argv)
+// IRBUILDER: call {{.*}}void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* [[DEF_LOC_2]], i32 1, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32*)* [[OMP_OUTLINED:@.+]] to void (i32*, i32*, ...)*), i32* [[VLA]])
+// ALL: [[ARGV:%.+]] = load i8**, i8*** {{%[a-z0-9.]+}}
+// ALL-NEXT: [[RET:%.+]] = call {{[a-z\_\b]*[ ]?i32}} [[TMAIN:@.+tmain.+]](i8** [[ARGV]])
+// ALL: ret i32
+// ALL-NEXT: }
+// ALL-DEBUG-LABEL: define i32 @main(i32 %argc, i8** %argv)
// CHECK-DEBUG: [[LOC_2_ADDR:%.+]] = alloca %struct.ident_t
// CHECK-DEBUG: [[KMPC_LOC_VOIDPTR:%.+]] = bitcast %struct.ident_t* [[LOC_2_ADDR]] to i8*
// CHECK-DEBUG-NEXT: [[KMPC_DEFAULT_LOC_VOIDPTR:%.+]] = bitcast %struct.ident_t* [[DEF_LOC_2]] to i8*
// CHECK-DEBUG-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 [[KMPC_LOC_VOIDPTR]], i8* align 8 [[KMPC_DEFAULT_LOC_VOIDPTR]], i64 24, i1 false)
-// CHECK-DEBUG: store i32 %argc, i32* [[ARGC_ADDR:%.+]],
-// CHECK-DEBUG: [[VLA:%.+]] = alloca i32, i64 [[VLA_SIZE:%[^,]+]],
+// ALL-DEBUG: store i32 %argc, i32* [[ARGC_ADDR:%.+]],
+// ALL-DEBUG: [[VLA:%.+]] = alloca i32, i64 [[VLA_SIZE:%[^,]+]],
// CHECK-DEBUG: [[KMPC_LOC_PSOURCE_REF:%.+]] = getelementptr inbounds %struct.ident_t, %struct.ident_t* [[LOC_2_ADDR]], i32 0, i32 4
// CHECK-DEBUG-NEXT: store i8* getelementptr inbounds ([{{.+}} x i8], [{{.+}} x i8]* [[LOC1]], i32 0, i32 0), i8** [[KMPC_LOC_PSOURCE_REF]]
// CHECK-DEBUG: call {{.*}}void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* [[LOC_2_ADDR]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i64, i32*)* [[OMP_OUTLINED:@.+]] to void (i32*, i32*, ...)*), i64 [[VLA_SIZE]], i32* [[VLA]])
-// CHECK-DEBUG-NEXT: [[ARGV:%.+]] = load i8**, i8*** {{%[a-z0-9.]+}}
-// CHECK-DEBUG-NEXT: [[RET:%.+]] = call i32 [[TMAIN:@.+tmain.+]](i8** [[ARGV]])
-// CHECK-DEBUG: ret i32
-// CHECK-DEBUG-NEXT: }
+// IRBUILDER-DEBUG: call {{.*}}void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @{{.*}}, i32 1, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32*)* [[OMP_OUTLINED:@.+]] to void (i32*, i32*, ...)*), i32* [[VLA]])
+// ALL-DEBUG: [[ARGV:%.+]] = load i8**, i8*** {{%[a-z0-9.]+}}
+// ALL-DEBUG: [[RET:%.+]] = call i32 [[TMAIN:@.+tmain.+]](i8** [[ARGV]])
+// ALL-DEBUG: ret i32
+// ALL-DEBUG-NEXT: }
-// CHECK: define internal {{.*}}void [[OMP_OUTLINED]](i32* noalias %.global_tid., i32* noalias %.bound_tid., i{{[0-9]+}}{{.*}} [[VLA_SIZE:%.+]], i32* {{.+}} [[VLA_ADDR:%[^)]+]])
-// CHECK-SAME: #[[FN_ATTRS:[0-9]+]]
+// CHECK: define internal {{.*}}void [[OMP_OUTLINED]](i32* noalias %.global_tid., i32* noalias %.bound_tid., i{{[0-9]+}}{{.*}} [[VLA_SIZE:%.+]], i32* {{.+}} [[VLA_ADDR:%[^)]+]])
+// CHECK-SAME: #[[FN_ATTRS:[0-9]+]]
+// IRBUILDER: define internal {{.*}}void [[OMP_OUTLINED]](i32* noalias %{{.*}}, i32* noalias %{{.*}}, i32* [[VLA_REF:%[^)]+]])
+// IRBUILDER-SAME: #[[FN_ATTRS:[0-9]+]]
// CHECK: store i32* [[VLA_ADDR]], i32** [[VLA_PTR_ADDR:%.+]],
// CHECK: [[VLA_REF:%.+]] = load i32*, i32** [[VLA_PTR_ADDR]]
-// CHECK: [[VLA_ELEM_REF:%.+]] = getelementptr inbounds i32, i32* [[VLA_REF]], i{{[0-9]+}} 1
-// CHECK-NEXT: [[VLA_ELEM:%.+]] = load i32, i32* [[VLA_ELEM_REF]]
+// ALL: [[VLA_ELEM_REF:%.+]] = getelementptr inbounds i32, i32* [[VLA_REF]], i{{[0-9]+}} 1
+// ALL-NEXT: [[VLA_ELEM:%.+]] = load i32, i32* [[VLA_ELEM_REF]]
// CHECK-NEXT: invoke {{.*}}void [[FOO:@.+foo.+]](i32{{[ ]?[a-z]*}} [[VLA_ELEM]])
+// IRBUILDER: call {{.*}}void [[FOO:@.+foo.+]](i32{{[ ]?[a-z]*}} [[VLA_ELEM]])
// CHECK: ret void
// CHECK: call {{.*}}void @{{.+terminate.*|abort}}(
// CHECK-NEXT: unreachable
// CHECK-NEXT: }
-// CHECK-DEBUG: define internal void [[OMP_OUTLINED_DEBUG:@.+]](i32* noalias %.global_tid., i32* noalias %.bound_tid., i64 [[VLA_SIZE:%.+]], i32* {{.+}} [[VLA_ADDR:%[^)]+]])
-// CHECK-DEBUG-SAME: #[[FN_ATTRS:[0-9]+]]
+// CHECK-DEBUG: define internal void [[OMP_OUTLINED_DEBUG:@.+]](i32* noalias %.global_tid., i32* noalias %.bound_tid., i64 [[VLA_SIZE:%.+]], i32* {{.+}} [[VLA_ADDR:%[^)]+]])
+// CHECK-DEBUG-SAME: #[[FN_ATTRS:[0-9]+]]
+// IRBUILDER-DEBUG: define internal void [[OMP_OUTLINED_DEBUG:@.+]](i32* noalias %{{.*}}, i32* noalias %{{.*}}, i32* [[VLA_REF:%[^)]+]])
+// IRBUILDER-DEBUG-SAME: #[[FN_ATTRS:[0-9]+]]
// CHECK-DEBUG: store i32* [[VLA_ADDR]], i32** [[VLA_PTR_ADDR:%.+]],
// CHECK-DEBUG: [[VLA_REF:%.+]] = load i32*, i32** [[VLA_PTR_ADDR]]
-// CHECK-DEBUG: [[VLA_ELEM_REF:%.+]] = getelementptr inbounds i32, i32* [[VLA_REF]], i64 1
-// CHECK-DEBUG-NEXT: [[VLA_ELEM:%.+]] = load i32, i32* [[VLA_ELEM_REF]]
+// ALL-DEBUG: [[VLA_ELEM_REF:%.+]] = getelementptr inbounds i32, i32* [[VLA_REF]], i64 1
+// ALL-DEBUG-NEXT: [[VLA_ELEM:%.+]] = load i32, i32* [[VLA_ELEM_REF]]
// CHECK-DEBUG-NEXT: invoke void [[FOO:@.+foo.+]](i32 [[VLA_ELEM]])
+// IRBUILDER-DEBUG-NEXT: call void [[FOO:@.+foo.+]](i32 [[VLA_ELEM]])
// CHECK-DEBUG: ret void
// CHECK-DEBUG: call void @{{.+terminate.*|abort}}(
// CHECK-DEBUG-NEXT: unreachable
// CHECK-DEBUG-NEXT: }
-// CHECK-DAG: define linkonce_odr {{.*}}void [[FOO]]({{i32[ ]?[a-z]*}} %argc)
-// CHECK-DAG: declare !callback ![[cbid:[0-9]+]] {{.*}}void @__kmpc_fork_call(%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...)
-// CHECK-DEBUG-DAG: define linkonce_odr void [[FOO]](i32 %argc)
-// CHECK-DEBUG-DAG: declare !callback ![[cbid:[0-9]+]] void @__kmpc_fork_call(%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...)
+// ALL-DAG: define linkonce_odr {{.*}}void [[FOO]]({{i32[ ]?[a-z]*}} %argc)
+// ALL-DAG: declare !callback ![[cbid:[0-9]+]] {{.*}}void @__kmpc_fork_call(%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...)
+// ALL-DEBUG-DAG: define linkonce_odr void [[FOO]](i32 %argc)
+// ALL-DEBUG-DAG: declare !callback ![[cbid:[0-9]+]] void @__kmpc_fork_call(%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...)
// CHECK-DEBUG-DAG: define internal void [[OMP_OUTLINED]](i32* noalias %.global_tid., i32* noalias %.bound_tid., i64 [[VLA_SIZE:%.+]], i32* {{.+}} [[VLA_ADDR:%[^)]+]])
// CHECK-DEBUG-DAG: call void [[OMP_OUTLINED_DEBUG]]
-// CHECK: define linkonce_odr {{[a-z\_\b]*[ ]?i32}} [[TMAIN]](i8** %argc)
-// CHECK: store i8** %argc, i8*** [[ARGC_ADDR:%.+]],
+// ALL: define linkonce_odr {{[a-z\_\b]*[ ]?i32}} [[TMAIN]](i8** %argc)
+// ALL: store i8** %argc, i8*** [[ARGC_ADDR:%.+]],
// CHECK: call {{.*}}void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* [[DEF_LOC_2]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i8***, i{{64|32}})* [[OMP_OUTLINED:@.+]] to void (i32*, i32*, ...)*), i8*** [[ARGC_ADDR]], i{{64|32}} %{{.+}})
-// CHECK-NEXT: ret i32 0
-// CHECK-NEXT: }
-// CHECK-DEBUG: define linkonce_odr i32 [[TMAIN]](i8** %argc)
+// IRBUILDER: call {{.*}}void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* [[DEF_LOC_2]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i8***, i{{64|32}})* [[OMP_OUTLINED:@.+]] to void (i32*, i32*, ...)*), i8*** [[ARGC_ADDR]], i{{64|32}} %{{.+}})
+// ALL: ret i32 0
+// ALL-NEXT: }
+// ALL-DEBUG: define linkonce_odr i32 [[TMAIN]](i8** %argc)
// CHECK-DEBUG-DAG: [[LOC_2_ADDR:%.+]] = alloca %struct.ident_t
// CHECK-DEBUG: [[KMPC_LOC_VOIDPTR:%.+]] = bitcast %struct.ident_t* [[LOC_2_ADDR]] to i8*
// CHECK-DEBUG-NEXT: [[KMPC_DEFAULT_LOC_VOIDPTR:%.+]] = bitcast %struct.ident_t* [[DEF_LOC_2]] to i8*
@@ -106,35 +124,40 @@
// CHECK-DEBUG: [[KMPC_LOC_PSOURCE_REF:%.+]] = getelementptr inbounds %struct.ident_t, %struct.ident_t* [[LOC_2_ADDR]], i32 0, i32 4
// CHECK-DEBUG-NEXT: store i8* getelementptr inbounds ([{{.+}} x i8], [{{.+}} x i8]* [[LOC2]], i32 0, i32 0), i8** [[KMPC_LOC_PSOURCE_REF]]
// CHECK-DEBUG-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* [[LOC_2_ADDR]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i8***, i64)* [[OMP_OUTLINED:@.+]] to void (i32*, i32*, ...)*), i8*** [[ARGC_ADDR]], i64 %{{.+}})
-// CHECK-DEBUG-NEXT: ret i32 0
-// CHECK-DEBUG-NEXT: }
+// IRBUILDER-DEBUG: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @{{.*}}, i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i8***, i64)* [[OMP_OUTLINED:@.+]] to void (i32*, i32*, ...)*), i8*** [[ARGC_ADDR]], i64 %{{.+}})
+// ALL-DEBUG: ret i32 0
+// ALL-DEBUG-NEXT: }
-// CHECK: define internal {{.*}}void [[OMP_OUTLINED]](i32* noalias %.global_tid., i32* noalias %.bound_tid., i8*** dereferenceable({{4|8}}) %argc, i{{64|32}} %{{.+}})
+// CHECK: define internal {{.*}}void [[OMP_OUTLINED]](i32* noalias %.global_tid., i32* noalias %.bound_tid., i8*** dereferenceable({{4|8}}) %argc, i{{64|32}}{{.*}} %{{.+}})
+// IRBUILDER: define internal {{.*}}void [[OMP_OUTLINED]](i32* noalias %{{.*}}, i32* noalias %{{.*}}, i8*** [[ARGC_REF:%.*]], i{{64|32}}{{.*}} %{{.+}})
// CHECK: store i8*** %argc, i8**** [[ARGC_PTR_ADDR:%.+]],
// CHECK: [[ARGC_REF:%.+]] = load i8***, i8**** [[ARGC_PTR_ADDR]]
-// CHECK: [[ARGC:%.+]] = load i8**, i8*** [[ARGC_REF]]
+// ALL: [[ARGC:%.+]] = load i8**, i8*** [[ARGC_REF]]
// CHECK-NEXT: invoke {{.*}}void [[FOO1:@.+foo.+]](i8** [[ARGC]])
+// IRBUILDER-NEXT: call {{.*}}void [[FOO1:@.+foo.+]](i8** [[ARGC]])
// CHECK: ret void
// CHECK: call {{.*}}void @{{.+terminate.*|abort}}(
// CHECK-NEXT: unreachable
// CHECK-NEXT: }
// CHECK-DEBUG: define internal void [[OMP_OUTLINED_DEBUG:@.+]](i32* noalias %.global_tid., i32* noalias %.bound_tid., i8*** dereferenceable({{4|8}}) %argc, i64 %{{.+}})
+// IRBUILDER-DEBUG: define internal void [[OMP_OUTLINED_DEBUG:@.+]](i32* noalias %{{.*}}, i32* noalias %{{.*}}, i8*** [[ARGC_REF:%.*]], i64 %{{.+}})
// CHECK-DEBUG: store i8*** %argc, i8**** [[ARGC_PTR_ADDR:%.+]],
// CHECK-DEBUG: [[ARGC_REF:%.+]] = load i8***, i8**** [[ARGC_PTR_ADDR]]
-// CHECK-DEBUG: [[ARGC:%.+]] = load i8**, i8*** [[ARGC_REF]]
+// ALL-DEBUG: [[ARGC:%.+]] = load i8**, i8*** [[ARGC_REF]]
// CHECK-DEBUG-NEXT: invoke void [[FOO1:@.+foo.+]](i8** [[ARGC]])
+// IRBUILDER-DEBUG-NEXT: call void [[FOO1:@.+foo.+]](i8** [[ARGC]])
// CHECK-DEBUG: ret void
// CHECK-DEBUG: call void @{{.+terminate.*|abort}}(
// CHECK-DEBUG-NEXT: unreachable
// CHECK-DEBUG-NEXT: }
-// CHECK: define linkonce_odr {{.*}}void [[FOO1]](i8** %argc)
+// ALL: define linkonce_odr {{.*}}void [[FOO1]](i8** %argc)
// CHECK-DEBUG-DAG: define linkonce_odr void [[FOO1]](i8** %argc)
// CHECK-DEBUG-DAG: define internal void [[OMP_OUTLINED]](i32* noalias %.global_tid., i32* noalias %.bound_tid., i8*** dereferenceable({{4|8}}) %argc, i64 %{{.+}})
// CHECK-DEBUG-DAG: call void [[OMP_OUTLINED_DEBUG]]({{[^)]+}}){{[^,]*}}, !dbg
-// CHECK: attributes #[[FN_ATTRS]] = {{.+}} nounwind
-// CHECK-DEBUG: attributes #[[FN_ATTRS]] = {{.+}} nounwind
-// CHECK: ![[cbid]] = !{![[cbidb:[0-9]+]]}
-// CHECK: ![[cbidb]] = !{i64 2, i64 -1, i64 -1, i1 true}
+// ALL: attributes #[[FN_ATTRS]] = {{.+}} nounwind
+// ALL-DEBUG: attributes #[[FN_ATTRS]] = {{.+}} nounwind
+// ALL: ![[cbid]] = !{![[cbidb:[0-9]+]]}
+// ALL: ![[cbidb]] = !{i64 2, i64 -1, i64 -1, i1 true}
#endif
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_copyin_codegen.cpp b/src/llvm-project/clang/test/OpenMP/parallel_copyin_codegen.cpp
index 87c11f0..60cbf71 100644
--- a/src/llvm-project/clang/test/OpenMP/parallel_copyin_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/parallel_copyin_codegen.cpp
@@ -101,8 +101,7 @@
// LAMBDA: define{{.*}} internal{{.*}} void [[OUTER_LAMBDA]](
// LAMBDA: call {{.*}}void {{.+}} @__kmpc_fork_call({{.+}}, i32 0, {{.+}}* [[OMP_REGION:@.+]] to {{.+}})
- // TLS-LAMBDA: [[G_CPY_VAL:%.+]] = call{{( cxx_fast_tlscc)?}} i{{[0-9]+}}* [[G_CTOR:@.+]]()
- // TLS-LAMBDA: call {{.*}}void {{.+}} @__kmpc_fork_call({{.+}}, i32 1, {{.+}}* [[OMP_REGION:@.+]] to {{.+}}, i32* [[G_CPY_VAL]])
+ // TLS-LAMBDA: call {{.*}}void {{.+}} @__kmpc_fork_call({{.+}}, i32 1, {{.+}}* [[OMP_REGION:@.+]] to {{.+}}, i32* @g)
#pragma omp parallel copyin(g)
{
@@ -120,14 +119,12 @@
// LAMBDA: [[DONE]]
// TLS-LAMBDA-DAG: [[G_CAPTURE_SRC:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** %
- // TLS-LAMBDA-DAG: [[G_CAPTURE_DST:%.+]] = call{{( cxx_fast_tlscc)?}} i{{[0-9]+}}* [[G_CTOR]]()
// TLS-LAMBDA-DAG: [[G_CAPTURE_SRCC:%.+]] = ptrtoint i{{[0-9]+}}* [[G_CAPTURE_SRC]] to i{{[0-9]+}}
- // TLS-LAMBDA-DAG: [[G_CAPTURE_DSTC:%.+]] = ptrtoint i{{[0-9]+}}* [[G_CAPTURE_DST]] to i{{[0-9]+}}
- // TLS-LAMBDA: icmp ne i{{[0-9]+}} {{%.+}}, {{%.+}}
+ // TLS-LAMBDA: icmp ne i{{[0-9]+}} {{%.+}}, ptrtoint (i{{[0-9]+}}* @g to i{{[0-9]+}})
// TLS-LAMBDA: br i1 %{{.+}}, label %[[NOT_MASTER:.+]], label %[[DONE:.+]]
// TLS-LAMBDA: [[NOT_MASTER]]
// TLS-LAMBDA: load i{{[0-9]+}}, i{{[0-9]+}}* [[G_CAPTURE_SRC]],
- // TLS-LAMBDA: store volatile i{{[0-9]+}} %{{.+}}, i{{[0-9]+}}* [[G_CAPTURE_DST]], align 128
+ // TLS-LAMBDA: store volatile i{{[0-9]+}} %{{.+}}, i{{[0-9]+}}* @g, align 128
// TLS-LAMBDA: [[DONE]]
// LAMBDA: call {{.*}}void @__kmpc_barrier(
@@ -136,18 +133,13 @@
// LAMBDA: call{{.*}} void [[INNER_LAMBDA:@.+]](%{{.+}}*
// TLS-LAMBDA: call{{.*}} void [[INNER_LAMBDA:@.+]](%{{.+}}*
- // TLS-LAMBDA: define {{.*}}i{{[0-9]+}}* [[G_CTOR]]()
- // TLS-LAMBDA: ret i{{[0-9]+}}* [[G]]
- // TLS-LAMBDA: }
-
[&]() {
// LAMBDA: define {{.+}} void [[INNER_LAMBDA]](%{{.+}}* [[ARG_PTR:%.+]])
// LAMBDA: store %{{.+}}* [[ARG_PTR]], %{{.+}}** [[ARG_PTR_REF:%.+]],
g = 2;
// LAMBDA: [[ARG_PTR:%.+]] = load %{{.+}}*, %{{.+}}** [[ARG_PTR_REF]]
- // TLS-LAMBDA: [[G_CAPTURE_DST:%.+]] = call{{( cxx_fast_tlscc)?}} i{{[0-9]+}}* [[G_CTOR]]()
- // TLS-LAMBDA: store volatile i{{[0-9]+}} 2, i{{[0-9]+}}* [[G_CAPTURE_DST]], align 128
+ // TLS-LAMBDA: store volatile i{{[0-9]+}} 2, i{{[0-9]+}}* @g, align 128
}();
}
}();
@@ -164,8 +156,7 @@
// BLOCKS: define{{.*}} internal{{.*}} void {{.+}}(i8*
// BLOCKS: call {{.*}}void {{.+}} @__kmpc_fork_call({{.+}}, i32 0, {{.+}}* [[OMP_REGION:@.+]] to {{.+}})
- // TLS-BLOCKS: [[G_CPY_VAL:%.+]] = call{{( cxx_fast_tlscc)?}} i{{[0-9]+}}* [[G_CTOR:@.+]]()
- // TLS-BLOCKS: call {{.*}}void {{.+}} @__kmpc_fork_call({{.+}}, i32 1, {{.+}}* [[OMP_REGION:@.+]] to {{.+}}, i32* [[G_CPY_VAL]])
+ // TLS-BLOCKS: call {{.*}}void {{.+}} @__kmpc_fork_call({{.+}}, i32 1, {{.+}}* [[OMP_REGION:@.+]] to {{.+}}, i32* @g)
#pragma omp parallel copyin(g)
{
@@ -183,14 +174,12 @@
// BLOCKS: [[DONE]]
// TLS-BLOCKS-DAG: [[G_CAPTURE_SRC:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** %
- // TLS-BLOCKS-DAG: [[G_CAPTURE_DST:%.+]] = call{{( cxx_fast_tlscc)?}} i{{[0-9]+}}* [[G_CTOR]]()
// TLS-BLOCKS-DAG: [[G_CAPTURE_SRCC:%.+]] = ptrtoint i{{[0-9]+}}* [[G_CAPTURE_SRC]] to i{{[0-9]+}}
- // TLS-BLOCKS-DAG: [[G_CAPTURE_DSTC:%.+]] = ptrtoint i{{[0-9]+}}* [[G_CAPTURE_DST]] to i{{[0-9]+}}
- // TLS-BLOCKS: icmp ne i{{[0-9]+}} {{%.+}}, {{%.+}}
+ // TLS-BLOCKS: icmp ne i{{[0-9]+}} {{%.+}}, ptrtoint (i{{[0-9]+}}* @g to i{{[0-9]+}})
// TLS-BLOCKS: br i1 %{{.+}}, label %[[NOT_MASTER:.+]], label %[[DONE:.+]]
// TLS-BLOCKS: [[NOT_MASTER]]
// TLS-BLOCKS: load i{{[0-9]+}}, i{{[0-9]+}}* [[G_CAPTURE_SRC]],
- // TLS-BLOCKS: store volatile i{{[0-9]+}} %{{.+}}, i{{[0-9]+}}* [[G_CAPTURE_DST]], align 128
+ // TLS-BLOCKS: store volatile i{{[0-9]+}} %{{.+}}, i{{[0-9]+}}* @g, align 128
// TLS-BLOCKS: [[DONE]]
// BLOCKS: call {{.*}}void @__kmpc_barrier(
@@ -200,14 +189,10 @@
// BLOCKS-NOT: [[G]]{{[[^:word:]]}}
// BLOCKS: call {{.*}}void {{%.+}}(i8
- // TLS-BLOCKS: [[G_CAPTURE_DST:%.+]] = call{{( cxx_fast_tlscc)?}} i{{[0-9]+}}* [[G_CTOR]]()
- // TLS-BLOCKS: store volatile i{{[0-9]+}} 1, i{{[0-9]+}}* [[G_CAPTURE_DST]]
+ // TLS-BLOCKS: store volatile i{{[0-9]+}} 1, i{{[0-9]+}}* @g
// TLS-BLOCKS-NOT: [[G]]{{[[^:word:]]}}
// TLS-BLOCKS: call {{.*}}void {{%.+}}(i8
- // TLS-BLOCKS: define {{.*}}i{{[0-9]+}}* [[G_CTOR]]()
- // TLS-BLOCKS: ret i{{[0-9]+}}* [[G]]
- // TLS-BLOCKS: }
^{
// BLOCKS: define {{.+}} void {{@.+}}(i8*
// TLS-BLOCKS: define {{.+}} void {{@.+}}(i8*
@@ -219,8 +204,7 @@
// BLOCKS: ret
// TLS-BLOCKS-NOT: [[G]]{{[[^:word:]]}}
- // TLS-BLOCKS: [[G_CAPTURE_DST:%.+]] = call{{( cxx_fast_tlscc)?}} i{{[0-9]+}}* [[G_CTOR]]()
- // TLS-BLOCKS: store volatile i{{[0-9]+}} 2, i{{[0-9]+}}* [[G_CAPTURE_DST]]
+ // TLS-BLOCKS: store volatile i{{[0-9]+}} 2, i{{[0-9]+}}* @g
// TLS-BLOCKS-NOT: [[G]]{{[[^:word:]]}}
// TLS-BLOCKS: ret
}();
@@ -524,7 +508,8 @@
;
}
#elif defined(NESTED)
-int t;
+int t_init();
+int t = t_init();
#pragma omp threadprivate(t)
// NESTED: foo
void foo() {
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_default_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_default_messages.cpp
index 6ae0ba5..6b8ad67 100644
--- a/src/llvm-project/clang/test/OpenMP/parallel_default_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/parallel_default_messages.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,ge40 -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
// RUN: %clang_cc1 -verify=expected,ge40 -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
// RUN: %clang_cc1 -verify=expected,ge40 -fopenmp-version=50 -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
// RUN: %clang_cc1 -verify=expected,ge40 -fopenmp-version=40 -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_firstprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_firstprivate_messages.cpp
index b0f0c6a..87a0586 100644
--- a/src/llvm-project/clang/test/OpenMP/parallel_firstprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/parallel_firstprivate_messages.cpp
@@ -10,6 +10,13 @@
return argc;
}
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp parallel firstprivate(fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
struct S1; // expected-note {{declared here}} expected-note{{forward declaration of 'S1'}}
extern S1 a;
class S2 {
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_for_ast_print.cpp b/src/llvm-project/clang/test/OpenMP/parallel_for_ast_print.cpp
index 06b6ab3..02cabed 100644
--- a/src/llvm-project/clang/test/OpenMP/parallel_for_ast_print.cpp
+++ b/src/llvm-project/clang/test/OpenMP/parallel_for_ast_print.cpp
@@ -1,10 +1,10 @@
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ast-print %s | FileCheck %s
-// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -ast-print %s | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ast-print %s | FileCheck %s
-// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -ast-print %s | FileCheck %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s
// expected-no-diagnostics
#ifndef HEADER
@@ -70,8 +70,8 @@
// CHECK: static T a;
static T g;
#pragma omp threadprivate(g)
-#pragma omp parallel for schedule(dynamic) default(none) copyin(g) linear(a) allocate(a)
- // CHECK: #pragma omp parallel for schedule(dynamic) default(none) copyin(g) linear(a) allocate(a)
+#pragma omp parallel for schedule(dynamic) default(none) copyin(g) linear(a) allocate(a) lastprivate(conditional: d, e,f)
+ // CHECK: #pragma omp parallel for schedule(dynamic) default(none) copyin(g) linear(a) allocate(a) lastprivate(conditional: d,e,f)
for (int i = 0; i < 2; ++i)
a = 2;
// CHECK-NEXT: for (int i = 0; i < 2; ++i)
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_for_codegen.cpp b/src/llvm-project/clang/test/OpenMP/parallel_for_codegen.cpp
index fe1eb1e..262de00 100644
--- a/src/llvm-project/clang/test/OpenMP/parallel_for_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/parallel_for_codegen.cpp
@@ -11,9 +11,17 @@
// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -O1 -fopenmp-simd -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
// expected-no-diagnostics
+
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck --check-prefix=OMP5 %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix=OMP5 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
#ifndef HEADER
#define HEADER
+#ifndef OMP5
// CHECK-DAG: [[IDENT_T_TY:%.+]] = type { i32, i32, i32, i32, i8* }
// CHECK-DAG: [[LOOP_LOC:@.+]] = private unnamed_addr global [[IDENT_T_TY]] { i32 0, i32 514, i32 0, i32 0, i8*
@@ -27,12 +35,14 @@
// CHECK: [[CHUNK:%.+]] = load i64, i64* %
// CHECK: call void {{.+}} @__kmpc_fork_call({{.+}}, i64 [[CHUNK]])
+// CHECK: [[UNDEF_A:%.+]] = load double, double* undef
+// CHECK: fadd double 2.000000e+00, [[UNDEF_A]]
// CHECK: [[CHUNK_VAL:%.+]] = load i8, i8* %
// CHECK: [[CHUNK_SIZE:%.+]] = sext i8 [[CHUNK_VAL]] to i64
// CHECK: call void @__kmpc_for_static_init_8u([[IDENT_T_TY]]* [[LOOP_LOC]], i32 [[GTID:%[^,]+]], i32 33, i32* [[IS_LAST:%[^,]+]], i64* [[OMP_LB:%[^,]+]], i64* [[OMP_UB:%[^,]+]], i64* [[OMP_ST:%[^,]+]], i64 1, i64 [[CHUNK_SIZE]])
-// CHECK: call void @__kmpc_for_static_fini([[IDENT_T_TY]]* [[LOOP_LOC]], i32 [[GTID]])
-#pragma omp parallel for schedule(static, char(a))
- for (unsigned long long i = 1; i < 2; ++i) {
+// CHECK: call void @__kmpc_for_static_fini([[IDENT_T_TY]]* [[LOOP_LOC]], i32 [[GTID:%.+]])
+#pragma omp parallel for schedule(static, char(a)) private(a)
+ for (unsigned long long i = 1; i < 2 + a; ++i) {
}
}
@@ -274,7 +284,7 @@
// CHECK: store i32* [[GTID_PARAM_ADDR]], i32** [[GTID_REF_ADDR:%.+]],
// CHECK: call void @__kmpc_dispatch_init_8([[IDENT_T_TY]]* [[DEFAULT_LOC]], i32 [[GTID:%.+]], i32 38, i64 0, i64 [[LAST_ITER:%[^,]+]], i64 1, i64 1)
//
-// CHECK: [[HASWORK:%.+]] = call i32 @__kmpc_dispatch_next_8([[IDENT_T_TY]]* [[DEFAULT_LOC]], i32 [[GTID]], i32* [[OMP_ISLAST:%[^,]+]], i64* [[OMP_LB:%[^,]+]], i64* [[OMP_UB:%[^,]+]], i64* [[OMP_ST:%[^,]+]])
+// CHECK: [[HASWORK:%.+]] = call i32 @__kmpc_dispatch_next_8([[IDENT_T_TY]]* [[DEFAULT_LOC]], i32 [[GTID:%.+]], i32* [[OMP_ISLAST:%[^,]+]], i64* [[OMP_LB:%[^,]+]], i64* [[OMP_UB:%[^,]+]], i64* [[OMP_ST:%[^,]+]])
// CHECK-NEXT: [[O_CMP:%.+]] = icmp ne i32 [[HASWORK]], 0
// CHECK-NEXT: br i1 [[O_CMP]], label %[[O_LOOP1_BODY:[^,]+]], label %[[O_LOOP1_END:[^,]+]]
@@ -378,85 +388,246 @@
// TERM_DEBUG-DAG: [[DBG_LOC_START]] = !DILocation(line: [[@LINE-4]],
// TERM_DEBUG-DAG: [[DBG_LOC_END]] = !DILocation(line: [[@LINE-18]],
-// CHECK-LABEL: increment
+#else // OMP5
+// OMP5-LABEL: increment
int increment () {
-// CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num([[IDENT_T_TY]]* [[DEFAULT_LOC:[@%].+]])
+// OMP5: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* [[DEFAULT_LOC:[@%].+]])
#pragma omp for
// Determine UB = min(UB, GlobalUB)
-// CHECK: call void @__kmpc_for_static_init_4([[IDENT_T_TY]]* [[LOOP_LOC]], i32 [[GTID]], i32 34, i32* [[IS_LAST:%[^,]+]], i32* [[OMP_LB:%[^,]+]], i32* [[OMP_UB:%[^,]+]], i32* [[OMP_ST:%[^,]+]], i32 1, i32 1)
-// CHECK-NEXT: [[UB:%.+]] = load i32, i32* [[OMP_UB]]
-// CHECK-NEXT: [[UBCMP:%.+]] = icmp sgt i32 [[UB]], 4
-// CHECK-NEXT: br i1 [[UBCMP]], label [[UB_TRUE:%[^,]+]], label [[UB_FALSE:%[^,]+]]
-// CHECK: [[UBRESULT:%.+]] = phi i32 [ 4, [[UB_TRUE]] ], [ [[UBVAL:%[^,]+]], [[UB_FALSE]] ]
-// CHECK-NEXT: store i32 [[UBRESULT]], i32* [[OMP_UB]]
-// CHECK-NEXT: [[LB:%.+]] = load i32, i32* [[OMP_LB]]
-// CHECK-NEXT: store i32 [[LB]], i32* [[OMP_IV:[^,]+]]
-// CHECK-NEXT: br label %[[LOOP1_HEAD:.+]]
+// OMP5: call void @__kmpc_for_static_init_4(%struct.ident_t* [[LOOP_LOC:[@%].+]], i32 [[GTID]], i32 34, i32* [[IS_LAST:%[^,]+]], i32* [[OMP_LB:%[^,]+]], i32* [[OMP_UB:%[^,]+]], i32* [[OMP_ST:%[^,]+]], i32 1, i32 1)
+// OMP5-NEXT: [[UB:%.+]] = load i32, i32* [[OMP_UB]]
+// OMP5-NEXT: [[UBCMP:%.+]] = icmp sgt i32 [[UB]], 4
+// OMP5-NEXT: br i1 [[UBCMP]], label [[UB_TRUE:%[^,]+]], label [[UB_FALSE:%[^,]+]]
+// OMP5: [[UBRESULT:%.+]] = phi i32 [ 4, [[UB_TRUE]] ], [ [[UBVAL:%[^,]+]], [[UB_FALSE]] ]
+// OMP5-NEXT: store i32 [[UBRESULT]], i32* [[OMP_UB]]
+// OMP5-NEXT: [[LB:%.+]] = load i32, i32* [[OMP_LB]]
+// OMP5-NEXT: store i32 [[LB]], i32* [[OMP_IV:[^,]+]]
+// OMP5-NEXT: br label %[[LOOP1_HEAD:.+]]
// Loop header
-// CHECK: [[LOOP1_HEAD]]
-// CHECK: [[IV:%.+]] = load i32, i32* [[OMP_IV]]
-// CHECK-NEXT: [[UB:%.+]] = load i32, i32* [[OMP_UB]]
-// CHECK-NEXT: [[CMP:%.+]] = icmp sle i32 [[IV]], [[UB]]
-// CHECK-NEXT: br i1 [[CMP]], label %[[LOOP1_BODY:[^,]+]], label %[[LOOP1_END:[^,]+]]
+// OMP5: [[LOOP1_HEAD]]
+// OMP5: [[IV:%.+]] = load i32, i32* [[OMP_IV]]
+// OMP5-NEXT: [[UB:%.+]] = load i32, i32* [[OMP_UB]]
+// OMP5-NEXT: [[CMP:%.+]] = icmp sle i32 [[IV]], [[UB]]
+// OMP5-NEXT: br i1 [[CMP]], label %[[LOOP1_BODY:[^,]+]], label %[[LOOP1_END:[^,]+]]
for (int i = 0 ; i != 5; ++i)
// Start of body: calculate i from IV:
-// CHECK: [[LOOP1_BODY]]
-// CHECK: [[IV1_1:%.+]] = load i32, i32* [[OMP_IV]]
-// CHECK-NEXT: [[CALC_I_1:%.+]] = mul nsw i32 [[IV1_1]], 1
-// CHECK-NEXT: [[CALC_I_2:%.+]] = add nsw i32 0, [[CALC_I_1]]
-// CHECK-NEXT: store i32 [[CALC_I_2]], i32* [[LC_I:.+]]
-// CHECK: [[IV1_2:%.+]] = load i32, i32* [[OMP_IV]]{{.*}}
-// CHECK-NEXT: [[ADD1_2:%.+]] = add nsw i32 [[IV1_2]], 1
-// CHECK-NEXT: store i32 [[ADD1_2]], i32* [[OMP_IV]]
-// CHECK-NEXT: br label %[[LOOP1_HEAD]]
+// OMP5: [[LOOP1_BODY]]
+// OMP5: [[IV1_1:%.+]] = load i32, i32* [[OMP_IV]]
+// OMP5-NEXT: [[CALC_I_1:%.+]] = mul nsw i32 [[IV1_1]], 1
+// OMP5-NEXT: [[CALC_I_2:%.+]] = add nsw i32 0, [[CALC_I_1]]
+// OMP5-NEXT: store i32 [[CALC_I_2]], i32* [[LC_I:.+]]
+// OMP5: [[IV1_2:%.+]] = load i32, i32* [[OMP_IV]]{{.*}}
+// OMP5-NEXT: [[ADD1_2:%.+]] = add nsw i32 [[IV1_2]], 1
+// OMP5-NEXT: store i32 [[ADD1_2]], i32* [[OMP_IV]]
+// OMP5-NEXT: br label %[[LOOP1_HEAD]]
;
-// CHECK: [[LOOP1_END]]
-// CHECK: call void @__kmpc_for_static_fini([[IDENT_T_TY]]* [[LOOP_LOC]], i32 [[GTID]])
-// CHECK: __kmpc_barrier
+// OMP5: [[LOOP1_END]]
+// OMP5: call void @__kmpc_for_static_fini(%struct.ident_t* [[LOOP_LOC]], i32 [[GTID]])
+// OMP5: __kmpc_barrier
return 0;
-// CHECK: ret i32 0
+// OMP5: ret i32 0
}
-// CHECK-LABEL: decrement_nowait
+// OMP5-LABEL: decrement_nowait
int decrement_nowait () {
-// CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num([[IDENT_T_TY]]* [[DEFAULT_LOC:[@%].+]])
+// OMP5: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* [[DEFAULT_LOC:[@%].+]])
#pragma omp for nowait
// Determine UB = min(UB, GlobalUB)
-// CHECK: call void @__kmpc_for_static_init_4([[IDENT_T_TY]]* [[LOOP_LOC]], i32 [[GTID]], i32 34, i32* [[IS_LAST:%[^,]+]], i32* [[OMP_LB:%[^,]+]], i32* [[OMP_UB:%[^,]+]], i32* [[OMP_ST:%[^,]+]], i32 1, i32 1)
-// CHECK-NEXT: [[UB:%.+]] = load i32, i32* [[OMP_UB]]
-// CHECK-NEXT: [[UBCMP:%.+]] = icmp sgt i32 [[UB]], 4
-// CHECK-NEXT: br i1 [[UBCMP]], label [[UB_TRUE:%[^,]+]], label [[UB_FALSE:%[^,]+]]
-// CHECK: [[UBRESULT:%.+]] = phi i32 [ 4, [[UB_TRUE]] ], [ [[UBVAL:%[^,]+]], [[UB_FALSE]] ]
-// CHECK-NEXT: store i32 [[UBRESULT]], i32* [[OMP_UB]]
-// CHECK-NEXT: [[LB:%.+]] = load i32, i32* [[OMP_LB]]
-// CHECK-NEXT: store i32 [[LB]], i32* [[OMP_IV:[^,]+]]
-// CHECK-NEXT: br label %[[LOOP1_HEAD:.+]]
+// OMP5: call void @__kmpc_for_static_init_4(%struct.ident_t* [[LOOP_LOC]], i32 [[GTID]], i32 34, i32* [[IS_LAST:%[^,]+]], i32* [[OMP_LB:%[^,]+]], i32* [[OMP_UB:%[^,]+]], i32* [[OMP_ST:%[^,]+]], i32 1, i32 1)
+// OMP5-NEXT: [[UB:%.+]] = load i32, i32* [[OMP_UB]]
+// OMP5-NEXT: [[UBCMP:%.+]] = icmp sgt i32 [[UB]], 4
+// OMP5-NEXT: br i1 [[UBCMP]], label [[UB_TRUE:%[^,]+]], label [[UB_FALSE:%[^,]+]]
+// OMP5: [[UBRESULT:%.+]] = phi i32 [ 4, [[UB_TRUE]] ], [ [[UBVAL:%[^,]+]], [[UB_FALSE]] ]
+// OMP5-NEXT: store i32 [[UBRESULT]], i32* [[OMP_UB]]
+// OMP5-NEXT: [[LB:%.+]] = load i32, i32* [[OMP_LB]]
+// OMP5-NEXT: store i32 [[LB]], i32* [[OMP_IV:[^,]+]]
+// OMP5-NEXT: br label %[[LOOP1_HEAD:.+]]
// Loop header
-// CHECK: [[LOOP1_HEAD]]
-// CHECK: [[IV:%.+]] = load i32, i32* [[OMP_IV]]
-// CHECK-NEXT: [[UB:%.+]] = load i32, i32* [[OMP_UB]]
-// CHECK-NEXT: [[CMP:%.+]] = icmp sle i32 [[IV]], [[UB]]
-// CHECK-NEXT: br i1 [[CMP]], label %[[LOOP1_BODY:[^,]+]], label %[[LOOP1_END:[^,]+]]
+// OMP5: [[LOOP1_HEAD]]
+// OMP5: [[IV:%.+]] = load i32, i32* [[OMP_IV]]
+// OMP5-NEXT: [[UB:%.+]] = load i32, i32* [[OMP_UB]]
+// OMP5-NEXT: [[CMP:%.+]] = icmp sle i32 [[IV]], [[UB]]
+// OMP5-NEXT: br i1 [[CMP]], label %[[LOOP1_BODY:[^,]+]], label %[[LOOP1_END:[^,]+]]
for (int j = 5 ; j != 0; --j)
// Start of body: calculate i from IV:
-// CHECK: [[LOOP1_BODY]]
-// CHECK: [[IV2_1:%.+]] = load i32, i32* [[OMP_IV]]
-// CHECK-NEXT: [[CALC_II_1:%.+]] = mul nsw i32 [[IV2_1]], 1
-// CHECK-NEXT: [[CALC_II_2:%.+]] = sub nsw i32 5, [[CALC_II_1]]
-// CHECK-NEXT: store i32 [[CALC_II_2]], i32* [[LC_I:.+]]
-// CHECK: [[IV2_2:%.+]] = load i32, i32* [[OMP_IV]]{{.*}}
-// CHECK-NEXT: [[ADD2_2:%.+]] = add nsw i32 [[IV2_2]], 1
-// CHECK-NEXT: store i32 [[ADD2_2]], i32* [[OMP_IV]]
-// CHECK-NEXT: br label %[[LOOP1_HEAD]]
+// OMP5: [[LOOP1_BODY]]
+// OMP5: [[IV2_1:%.+]] = load i32, i32* [[OMP_IV]]
+// OMP5-NEXT: [[CALC_II_1:%.+]] = mul nsw i32 [[IV2_1]], 1
+// OMP5-NEXT: [[CALC_II_2:%.+]] = sub nsw i32 5, [[CALC_II_1]]
+// OMP5-NEXT: store i32 [[CALC_II_2]], i32* [[LC_I:.+]]
+// OMP5: [[IV2_2:%.+]] = load i32, i32* [[OMP_IV]]{{.*}}
+// OMP5-NEXT: [[ADD2_2:%.+]] = add nsw i32 [[IV2_2]], 1
+// OMP5-NEXT: store i32 [[ADD2_2]], i32* [[OMP_IV]]
+// OMP5-NEXT: br label %[[LOOP1_HEAD]]
;
-// CHECK: [[LOOP1_END]]
-// CHECK: call void @__kmpc_for_static_fini([[IDENT_T_TY]]* [[LOOP_LOC]], i32 [[GTID]])
-// CHECK-NOT: __kmpc_barrier
+// OMP5: [[LOOP1_END]]
+// OMP5: call void @__kmpc_for_static_fini(%struct.ident_t* [[LOOP_LOC]], i32 [[GTID]])
+// OMP5-NOT: __kmpc_barrier
return 0;
-// CHECK: ret i32 0
+// OMP5: ret i32 0
}
+
+// OMP5-LABEL: range_for_single
+void range_for_single() {
+ int arr[10] = {0};
+// OMP5: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* {{.+}}, i32 1, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, [10 x i32]*)* [[OUTLINED:@.+]] to void (i32*, i32*, ...)*), [10 x i32]* %{{.+}})
+#pragma omp parallel for
+ for (auto &a : arr)
+ (void)a;
+}
+
+// OMP5: define internal void @.omp_outlined.(i32* {{.+}}, i32* {{.+}}, [10 x i32]* dereferenceable(40) %arr)
+// OMP5: [[ARR_ADDR:%.+]] = alloca [10 x i32]*,
+// OMP5: [[IV:%.+]] = alloca i64,
+// OMP5: [[RANGE_ADDR:%.+]] = alloca [10 x i32]*,
+// OMP5: [[END_ADDR:%.+]] = alloca i32*,
+// OMP5: alloca i32*,
+// OMP5: alloca i32*,
+// OMP5: alloca i64,
+// OMP5: [[BEGIN_INIT:%.+]] = alloca i32*,
+// OMP5: [[LB:%.+]] = alloca i64,
+// OMP5: [[UB:%.+]] = alloca i64,
+// OMP5: [[STRIDE:%.+]] = alloca i64,
+// OMP5: [[IS_LAST:%.+]] = alloca i32,
+// OMP5: [[BEGIN:%.+]] = alloca i32*,
+// OMP5: [[A_PTR:%.+]] = alloca i32*,
+
+// __range = arr;
+// OMP5: [[ARR:%.+]] = load [10 x i32]*, [10 x i32]** [[ARR_ADDR]],
+// OMP5: store [10 x i32]* [[ARR]], [10 x i32]** [[RANGE_ADDR]],
+
+// __end = end(_range);
+// OMP5: [[RANGE:%.+]] = load [10 x i32]*, [10 x i32]** [[RANGE_ADDR]],
+// OMP5: [[RANGE_0:%.+]] = getelementptr inbounds [10 x i32], [10 x i32]* [[RANGE]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// OMP5: [[RANGE_10:%.+]] = getelementptr inbounds i32, i32* [[RANGE_0]], i{{[0-9]+}} 10
+// OMP5: store i32* [[RANGE_10]], i32** [[END_ADDR]],
+
+// OMP5: [[RANGE:%.+]] = load [10 x i32]*, [10 x i32]** [[RANGE_ADDR]],
+// OMP5: [[RANGE_0:%.+]] = getelementptr inbounds [10 x i32], [10 x i32]* [[RANGE]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// OMP5: store i32* [[RANGE_0]], i32** [[CAP1:%.+]],
+// OMP5: [[END:%.+]] = load i32*, i32** [[END_ADDR]],
+// OMP5: store i32* [[END]], i32** [[CAP2:%.+]],
+
+// calculate number of elements.
+// OMP5: [[CAP2_VAL:%.+]] = load i32*, i32** [[CAP2]],
+// OMP5: [[CAP1_VAL:%.+]] = load i32*, i32** [[CAP1]],
+// OMP5: [[CAP2_I64:%.+]] = ptrtoint i32* [[CAP2_VAL]] to i64
+// OMP5: [[CAP1_I64:%.+]] = ptrtoint i32* [[CAP1_VAL]] to i64
+// OMP5: [[DIFF:%.+]] = sub i64 [[CAP2_I64]], [[CAP1_I64]]
+// OMP5: [[NUM:%.+]] = sdiv exact i64 [[DIFF]], 4
+// OMP5: [[NUM1:%.+]] = sub nsw i64 [[NUM]], 1
+// OMP5: [[NUM2:%.+]] = add nsw i64 [[NUM1]], 1
+// OMP5: [[NUM3:%.+]] = sdiv i64 [[NUM2]], 1
+// OMP5: [[NUM4:%.+]] = sub nsw i64 [[NUM3]], 1
+// OMP5: store i64 [[NUM4]], i64* [[CAP3:%.+]],
+// OMP5: [[RANGE_0:%.+]] = load i32*, i32** [[CAP1]],
+
+// __begin = begin(range);
+// OMP5: store i32* [[RANGE_0]], i32** [[BEGIN_INIT]],
+// OMP5: [[CAP1_VAL:%.+]] = load i32*, i32** [[CAP1]],
+// OMP5: [[CAP2_VAL:%.+]] = load i32*, i32** [[CAP2]],
+// OMP5: [[CMP:%.+]] = icmp ult i32* [[CAP1_VAL]], [[CAP2_VAL]]
+
+// __begin >= __end ? goto then : goto exit;
+// OMP5: br i1 [[CMP]], label %[[THEN:.+]], label %[[EXIT:.+]]
+
+// OMP5: [[THEN]]:
+
+// lb = 0;
+// OMP5: store i64 0, i64* [[LB]],
+
+// ub = number of elements
+// OMP5: [[NUM:%.+]] = load i64, i64* [[CAP3]],
+// OMP5: store i64 [[NUM]], i64* [[UB]],
+
+// stride = 1;
+// OMP5: store i64 1, i64* [[STRIDE]],
+
+// is_last = 0;
+// OMP5: store i32 0, i32* [[IS_LAST]],
+
+// loop.
+// OMP5: call void @__kmpc_for_static_init_8(%struct.ident_t* {{.+}}, i32 [[GTID:%.+]], i32 34, i32* [[IS_LAST]], i64* [[LB]], i64* [[UB]], i64* [[STRIDE]], i64 1, i64 1)
+
+// ub = (ub > number_of_elems ? number_of_elems : ub);
+// OMP5: [[UB_VAL:%.+]] = load i64, i64* [[UB]],
+// OMP5: [[NUM_VAL:%.+]] = load i64, i64* [[CAP3]],
+// OMP5: [[CMP:%.+]] = icmp sgt i64 [[UB_VAL]], [[NUM_VAL]]
+// OMP5: br i1 [[CMP]], label %[[TRUE:.+]], label %[[FALSE:.+]]
+
+// OMP5: [[TRUE]]:
+// OMP5: [[NUM_VAL:%.+]] = load i64, i64* [[CAP3]],
+// OMP5: br label %[[END:.+]]
+
+// OMP5: [[FALSE]]:
+// OMP5: [[UB_VAL:%.+]] = load i64, i64* [[UB]],
+// OMP5: br label %[[END:.+]]
+
+// OMP5: [[END]]:
+// OMP5: [[MIN:%.+]] = phi i64 [ [[NUM_VAL]], %[[TRUE]] ], [ [[UB_VAL]], %[[FALSE]] ]
+// OMP%: store i64 [[MIN]], i64* [[UB]],
+
+// iv = lb;
+// OMP5: [[LB_VAL:%.+]] = load i64, i64* [[LB]],
+// OMP5: store i64 [[LB_VAL]], i64* [[IV]],
+
+// goto loop;
+// loop:
+// OMP5: br label %[[LOOP:.+]]
+
+// OMP5: [[LOOP]]:
+
+// iv <= ub ? goto body : goto end;
+// OMP5: [[IV_VAL:%.+]] = load i64, i64* [[IV]],
+// OMP5: [[UB_VAL:%.+]] = load i64, i64* [[UB]],
+// OMP5: [[CMP:%.+]] = icmp sle i64 [[IV_VAL]], [[UB_VAL]]
+// OMP5: br i1 [[CMP]], label %[[BODY:.+]], label %[[END:.+]]
+
+// body:
+// __begin = begin(arr) + iv * 1;
+// OMP5: [[BODY]]:
+// OMP5: [[CAP1_VAL:%.+]] = load i32*, i32** [[CAP1]],
+// OMP5: [[IV_VAL:%.+]] = load i64, i64* [[IV]],
+// OMP5: [[MUL:%.+]] = mul nsw i64 [[IV_VAL]], 1
+// OMP5: [[ADDR:%.+]] = getelementptr inbounds i32, i32* [[CAP1_VAL]], i64 [[MUL]]
+// OMP5: store i32* [[ADDR]], i32** [[BEGIN]],
+
+// a = *__begin;
+// OMP5: [[BEGIN_VAL:%.+]] = load i32*, i32** [[BEGIN]],
+// OMP5: store i32* [[BEGIN_VAL]], i32** [[A_PTR]],
+
+// (void)a;
+// OMP5: load i32*, i32** [[A_PTR]],
+
+// iv += 1;
+// OMP5: [[IV_VAL:%.+]] = load i64, i64* [[IV]],
+// OMP5: [[IV_VAL_ADD_1:%.+]] = add nsw i64 [[IV_VAL]], 1
+// OMP5: store i64 [[IV_VAL_ADD_1]], i64* [[IV]],
+
+// goto loop;
+// OMP5: br label %[[LOOP]]
+
+// end:
+// OMP5: [[END]]:
+// OMP5: call void @__kmpc_for_static_fini(%struct.ident_t* {{.+}}, i32 [[GTID:%.+]])
+// exit:
+// OMP5: [[EXIT]]:
+// OMP5: ret void
+
+// OMP5-LABEL: range_for_collapsed
+void range_for_collapsed() {
+ int arr[10] = {0};
+// OMP5: call void @__kmpc_for_static_init_8(%struct.ident_t* {{.+}}, i32 [[GTID:%.+]], i32 34, i32* %{{.+}}, i64* %{{.+}}, i64* %{{.+}}, i64* %{{.+}}, i64 1, i64 1)
+#pragma omp parallel for collapse(2)
+ for (auto &a : arr)
+ for (auto b : arr)
+ a = b;
+// OMP5: call void @__kmpc_for_static_fini(%struct.ident_t* {{.+}}, i32 [[GTID:%.+]])
+}
+#endif // OMP5
+
#endif // HEADER
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_for_firstprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_for_firstprivate_messages.cpp
index 8a312f4..38d7c57 100644
--- a/src/llvm-project/clang/test/OpenMP/parallel_for_firstprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/parallel_for_firstprivate_messages.cpp
@@ -10,6 +10,13 @@
return argc;
}
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp parallel for firstprivate(fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
struct S1; // expected-note 2 {{declared here}} expected-note 2 {{forward declaration of 'S1'}}
extern S1 a;
class S2 {
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_for_lastprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_for_lastprivate_messages.cpp
index 4a7c346..fbbf826 100644
--- a/src/llvm-project/clang/test/OpenMP/parallel_for_lastprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/parallel_for_lastprivate_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
@@ -55,7 +57,7 @@
};
class S6 {
int a;
- S6() : a(0) {}
+ S6() : a(0) {} // omp45-note 2 {{implicitly declared private here}}
public:
S6(const S6 &s6) : a(s6.a) {}
@@ -71,6 +73,7 @@
I g(5);
int i, z;
int &j = i;
+ S6 s(0); // omp50-note {{'s' defined here}}
#pragma omp parallel for lastprivate // expected-error {{expected '(' after 'lastprivate'}}
for (int k = 0; k < argc; ++k)
++k;
@@ -92,6 +95,12 @@
#pragma omp parallel for lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
for (int k = 0; k < argc; ++k)
++k;
+#pragma omp parallel for lastprivate(conditional: argc,s) lastprivate(conditional: // omp50-error {{expected expression}} omp45-error 2 {{use of undeclared identifier 'conditional'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp45-error 2 {{calling a private constructor of class 'S6'}} omp50-error {{expected list item of scalar type in 'lastprivate' clause with 'conditional' modifier}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel for lastprivate(foo:argc) // omp50-error {{expected 'conditional' in OpenMP clause 'lastprivate'}} omp45-error {{expected ',' or ')' in 'lastprivate' clause}} omp45-error {{expected ')'}} omp45-error {{expected variable name}} omp45-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
#pragma omp parallel for lastprivate(S1) // expected-error {{'S1' does not refer to a value}}
for (int k = 0; k < argc; ++k)
++k;
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_for_linear_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_for_linear_messages.cpp
index b105571..a6dc1fd 100644
--- a/src/llvm-project/clang/test/OpenMP/parallel_for_linear_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/parallel_for_linear_messages.cpp
@@ -3,6 +3,14 @@
// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
+
+void xxx(int argc) {
+ int i, lin, step; // expected-note {{initialize the variable 'lin' to silence this warning}} expected-note {{initialize the variable 'step' to silence this warning}}
+#pragma omp parallel for linear(lin : step) // expected-warning {{variable 'lin' is uninitialized when used here}} expected-warning {{variable 'step' is uninitialized when used here}}
+ for (i = 0; i < 10; ++i)
+ ;
+}
+
namespace X {
int x;
};
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_for_loop_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_for_loop_messages.cpp
index f131494..beaf56e 100644
--- a/src/llvm-project/clang/test/OpenMP/parallel_for_loop_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/parallel_for_loop_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wuninitialized
class S {
int a;
@@ -92,28 +94,28 @@
for (((ii)) = 0; ii < 10; ++ii)
c[ii] = a[ii];
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
#pragma omp parallel for
for (int i = 0; i; i++)
c[i] = a[i];
-// expected-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'i'}}
#pragma omp parallel for
for (int i = 0; jj < kk; ii++)
c[i] = a[i];
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
#pragma omp parallel for
for (int i = 0; !!i; i++)
c[i] = a[i];
-// Ok
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
#pragma omp parallel for
for (int i = 0; i != 1; i++)
c[i] = a[i];
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
#pragma omp parallel for
for (int i = 0;; i++)
c[i] = a[i];
@@ -279,7 +281,7 @@
c[globalii] += a[globalii] + ii;
}
-// expected-error@+2 {{statement after '#pragma omp parallel for' must be a for loop}}
+// omp4-error@+2 {{statement after '#pragma omp parallel for' must be a for loop}}
#pragma omp parallel for
for (auto &item : a) {
item = item + 1;
@@ -416,15 +418,15 @@
#pragma omp parallel for
for (begin = end; begin < end; ++begin)
++begin;
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
#pragma omp parallel for
for (GoodIter I = begin; I - I; ++I)
++I;
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
#pragma omp parallel for
for (GoodIter I = begin; begin < end; ++I)
++I;
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
#pragma omp parallel for
for (GoodIter I = begin; !I; ++I)
++I;
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_for_reduction_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_for_reduction_messages.cpp
index 8035767..b28fe6c 100644
--- a/src/llvm-project/clang/test/OpenMP/parallel_for_reduction_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/parallel_for_reduction_messages.cpp
@@ -7,6 +7,13 @@
// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
extern int omp_default_mem_alloc;
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp parallel for reduction(+:fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
void foo() {
}
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_for_simd_ast_print.cpp b/src/llvm-project/clang/test/OpenMP/parallel_for_simd_ast_print.cpp
index 7ffecce..37471f3 100644
--- a/src/llvm-project/clang/test/OpenMP/parallel_for_simd_ast_print.cpp
+++ b/src/llvm-project/clang/test/OpenMP/parallel_for_simd_ast_print.cpp
@@ -1,10 +1,16 @@
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ast-print %s | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ast-print %s | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45
// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -DOMP5 -ast-print %s | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ast-print %s | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ast-print %s | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -ast-print %s | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50
// expected-no-diagnostics
#ifndef HEADER
@@ -148,8 +154,13 @@
int k1=0,k2=0;
static int *a;
// CHECK: static int *a;
+#ifdef OMP5
+#pragma omp parallel for simd if(parallel :b) ordered if(simd: b) nontemporal(argc, c) lastprivate(conditional:d,f)
+#else
#pragma omp parallel for simd if(parallel :b) ordered
-// CHECK-NEXT: #pragma omp parallel for simd if(parallel: b) ordered
+#endif // OMP5
+// OMP50-NEXT: #pragma omp parallel for simd if(parallel: b) ordered if(simd: b) nontemporal(argc,c) lastprivate(conditional: d,f)
+// OMP45-NEXT: #pragma omp parallel for simd if(parallel: b) ordered
for (int i=0; i < 2; ++i)*a=2;
// CHECK-NEXT: for (int i = 0; i < 2; ++i)
// CHECK-NEXT: *a = 2;
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_for_simd_codegen.cpp b/src/llvm-project/clang/test/OpenMP/parallel_for_simd_codegen.cpp
index 9585bf2..01f2b4c 100644
--- a/src/llvm-project/clang/test/OpenMP/parallel_for_simd_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/parallel_for_simd_codegen.cpp
@@ -1,14 +1,24 @@
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck %s --check-prefix=OMP45 --check-prefix=CHECK
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -debug-info-kind=limited -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp -fexceptions -fcxx-exceptions -debug-info-kind=line-tables-only -x c++ -emit-llvm %s -o - | FileCheck %s --check-prefix=TERM_DEBUG
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck %s --check-prefix=OMP50 --check-prefix=CHECK
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -debug-info-kind=limited -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp -fopenmp-version=50 -fexceptions -fcxx-exceptions -debug-info-kind=line-tables-only -x c++ -emit-llvm %s -o - | FileCheck %s --check-prefix=TERM_DEBUG
+
// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck --check-prefix SIMD-ONLY0 %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -debug-info-kind=limited -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp-simd -fexceptions -fcxx-exceptions -debug-info-kind=line-tables-only -x c++ -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
-// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -debug-info-kind=limited -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp-simd -fopenmp-version=50 -fexceptions -fcxx-exceptions -debug-info-kind=line-tables-only -x c++ -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
// expected-no-diagnostics
+// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
#ifndef HEADER
#define HEADER
@@ -75,7 +85,7 @@
// CHECK: [[K0LOAD:%.+]] = load i64, i64* [[K_VAR:%[^,]+]]
// CHECK-NEXT: store i64 [[K0LOAD]], i64* [[LIN0:%[^,]+]]
-// CHECK: call void @__kmpc_dispatch_init_4(%struct.ident_t* {{.+}}, i32 %{{.+}}, i32 35, i32 0, i32 8, i32 1, i32 1)
+// CHECK: call void @__kmpc_dispatch_init_4(%struct.ident_t* {{.+}}, i32 %{{.+}}, i32 {{35|1073741859}}, i32 0, i32 8, i32 1, i32 1)
// CHECK: [[NEXT:%.+]] = call i32 @__kmpc_dispatch_next_4(%struct.ident_t* {{.+}}, i32 %{{.+}}, i32* %{{.+}}, i32* [[LB:%.+]], i32* [[UB:%.+]], i32* %{{.+}})
// CHECK: [[COND:%.+]] = icmp ne i32 [[NEXT]], 0
// CHECK: br i1 [[COND]], label %[[CONT:.+]], label %[[END:.+]]
@@ -386,6 +396,51 @@
templ1<float,2> (a, z);
}
+// OMP50: call void @__kmpc_for_static_init_8(%struct.ident_t* {{[^,]+}}, i32 %{{[^,]+}}, i32 34, i32* %{{[^,]+}}, i64* [[LB:%[^,]+]], i64* [[UB:%[^,]+]], i64* [[STRIDE:%[^,]+]], i64 1, i64 1)
+// OMP50: [[UB_VAL:%.+]] = load i64, i64* [[UB]],
+// OMP50: [[CMP:%.+]] = icmp sgt i64 [[UB_VAL]], 15
+// OMP50: br i1 [[CMP]], label %[[TRUE:.+]], label %[[FALSE:[^,]+]]
+// OMP50: [[TRUE]]:
+// OMP50: br label %[[SWITCH:[^,]+]]
+// OMP50: [[FALSE]]:
+// OMP50: [[UB_VAL:%.+]] = load i64, i64* [[UB]],
+// OMP50: br label %[[SWITCH]]
+// OMP50: [[SWITCH]]:
+// OMP50: [[UP:%.+]] = phi i64 [ 15, %[[TRUE]] ], [ [[UB_VAL]], %[[FALSE]] ]
+// OMP50: store i64 [[UP]], i64* [[UB]],
+// OMP50: [[LB_VAL:%.+]] = load i64, i64* [[LB]],
+// OMP50: store i64 [[LB_VAL]], i64* [[T1_OMP_IV:%[^,]+]],
+
+// ...
+// OMP50: [[IV:%.+]] = load i64, i64* [[T1_OMP_IV]]
+// OMP50-NEXT: [[UB_VAL:%.+]] = load i64, i64* [[UB]]
+// OMP50-NEXT: [[CMP1:%.+]] = icmp sle i64 [[IV]], [[UB_VAL]]
+// OMP50-NEXT: br i1 [[CMP1]], label %[[T1_BODY:.+]], label %[[T1_END:[^,]+]]
+// OMP50: [[T1_BODY]]:
+// Loop counters i and j updates:
+// OMP50: [[IV1:%.+]] = load i64, i64* [[T1_OMP_IV]]
+// OMP50-NEXT: [[I_1:%.+]] = sdiv i64 [[IV1]], 4
+// OMP50-NEXT: [[I_1_MUL1:%.+]] = mul nsw i64 [[I_1]], 1
+// OMP50-NEXT: [[I_1_ADD0:%.+]] = add nsw i64 0, [[I_1_MUL1]]
+// OMP50-NEXT: [[I_2:%.+]] = trunc i64 [[I_1_ADD0]] to i32
+// OMP50-NEXT: store i32 [[I_2]], i32*
+// OMP50: [[IV2:%.+]] = load i64, i64* [[T1_OMP_IV]]
+// OMP50: [[IV2_1:%.+]] = load i64, i64* [[T1_OMP_IV]]
+// OMP50-NEXT: [[DIV_1:%.+]] = sdiv i64 [[IV2_1]], 4
+// OMP50-NEXT: [[MUL_1:%.+]] = mul nsw i64 [[DIV_1]], 4
+// OMP50-NEXT: [[J_1:%.+]] = sub nsw i64 [[IV2]], [[MUL_1]]
+// OMP50-NEXT: [[J_2:%.+]] = mul nsw i64 [[J_1]], 2
+// OMP50-NEXT: [[J_2_ADD0:%.+]] = add nsw i64 0, [[J_2]]
+// OMP50-NEXT: store i64 [[J_2_ADD0]], i64*
+// simd.for.inc:
+// OMP50: [[IV3:%.+]] = load i64, i64* [[T1_OMP_IV]]
+// OMP50-NEXT: [[INC:%.+]] = add nsw i64 [[IV3]], 1
+// OMP50-NEXT: store i64 [[INC]], i64*
+// OMP50-NEXT: br label {{%.+}}
+// OMP50: [[T1_END]]:
+// OMP50: call void @__kmpc_for_static_fini(%struct.ident_t* {{.+}}, i32 %{{.+}})
+// OMP50: ret void
+//
typedef int MyIdx;
@@ -674,51 +729,77 @@
// CHECK: ret void
}
-// CHECK: call void @__kmpc_for_static_init_8(%struct.ident_t* {{[^,]+}}, i32 %{{[^,]+}}, i32 34, i32* %{{[^,]+}}, i64* [[LB:%[^,]+]], i64* [[UB:%[^,]+]], i64* [[STRIDE:%[^,]+]], i64 1, i64 1)
-// CHECK: [[UB_VAL:%.+]] = load i64, i64* [[UB]],
-// CHECK: [[CMP:%.+]] = icmp sgt i64 [[UB_VAL]], 15
-// CHECK: br i1 [[CMP]], label %[[TRUE:.+]], label %[[FALSE:[^,]+]]
-// CHECK: [[TRUE]]:
-// CHECK: br label %[[SWITCH:[^,]+]]
-// CHECK: [[FALSE]]:
-// CHECK: [[UB_VAL:%.+]] = load i64, i64* [[UB]],
-// CHECK: br label %[[SWITCH]]
-// CHECK: [[SWITCH]]:
-// CHECK: [[UP:%.+]] = phi i64 [ 15, %[[TRUE]] ], [ [[UB_VAL]], %[[FALSE]] ]
-// CHECK: store i64 [[UP]], i64* [[UB]],
-// CHECK: [[LB_VAL:%.+]] = load i64, i64* [[LB]],
-// CHECK: store i64 [[LB_VAL]], i64* [[T1_OMP_IV:%[^,]+]],
+// CHECK-LABEL: if_clause
+void if_clause(int a) {
+ #pragma omp parallel for simd if(a) schedule(static, 1)
+for (int i = 0; i < 10; ++i);
+}
+// CHECK: call void @__kmpc_for_static_init_4(
+// OMP50: [[COND:%.+]] = trunc i8 %{{.+}} to i1
+// OMP50: br i1 [[COND]], label {{%?}}[[THEN:.+]], label {{%?}}[[ELSE:.+]]
+
+// OMP50: [[THEN]]:
+// OMP45: br label {{.+}}, !llvm.loop ![[VECT:.+]]
+// OMP50: br label {{.+}}, !llvm.loop ![[VECT:.+]]
+// OMP50: [[ELSE]]:
+// OMP50: br label {{.+}}, !llvm.loop ![[NOVECT:.+]]
+// CHECK: call void @__kmpc_for_static_fini(
+
+// OMP45: call void @__kmpc_for_static_init_8(%struct.ident_t* {{[^,]+}}, i32 %{{[^,]+}}, i32 34, i32* %{{[^,]+}}, i64* [[LB:%[^,]+]], i64* [[UB:%[^,]+]], i64* [[STRIDE:%[^,]+]], i64 1, i64 1)
+// OMP45: [[UB_VAL:%.+]] = load i64, i64* [[UB]],
+// OMP45: [[CMP:%.+]] = icmp sgt i64 [[UB_VAL]], 15
+// OMP45: br i1 [[CMP]], label %[[TRUE:.+]], label %[[FALSE:[^,]+]]
+// OMP45: [[TRUE]]:
+// OMP45: br label %[[SWITCH:[^,]+]]
+// OMP45: [[FALSE]]:
+// OMP45: [[UB_VAL:%.+]] = load i64, i64* [[UB]],
+// OMP45: br label %[[SWITCH]]
+// OMP45: [[SWITCH]]:
+// OMP45: [[UP:%.+]] = phi i64 [ 15, %[[TRUE]] ], [ [[UB_VAL]], %[[FALSE]] ]
+// OMP45: store i64 [[UP]], i64* [[UB]],
+// OMP45: [[LB_VAL:%.+]] = load i64, i64* [[LB]],
+// OMP45: store i64 [[LB_VAL]], i64* [[T1_OMP_IV:%[^,]+]],
// ...
-// CHECK: [[IV:%.+]] = load i64, i64* [[T1_OMP_IV]]
-// CHECK-NEXT: [[UB_VAL:%.+]] = load i64, i64* [[UB]]
-// CHECK-NEXT: [[CMP1:%.+]] = icmp sle i64 [[IV]], [[UB_VAL]]
-// CHECK-NEXT: br i1 [[CMP1]], label %[[T1_BODY:.+]], label %[[T1_END:[^,]+]]
-// CHECK: [[T1_BODY]]:
+// OMP45: [[IV:%.+]] = load i64, i64* [[T1_OMP_IV]]
+// OMP45-NEXT: [[UB_VAL:%.+]] = load i64, i64* [[UB]]
+// OMP45-NEXT: [[CMP1:%.+]] = icmp sle i64 [[IV]], [[UB_VAL]]
+// OMP45-NEXT: br i1 [[CMP1]], label %[[T1_BODY:.+]], label %[[T1_END:[^,]+]]
+// OMP45: [[T1_BODY]]:
// Loop counters i and j updates:
-// CHECK: [[IV1:%.+]] = load i64, i64* [[T1_OMP_IV]]
-// CHECK-NEXT: [[I_1:%.+]] = sdiv i64 [[IV1]], 4
-// CHECK-NEXT: [[I_1_MUL1:%.+]] = mul nsw i64 [[I_1]], 1
-// CHECK-NEXT: [[I_1_ADD0:%.+]] = add nsw i64 0, [[I_1_MUL1]]
-// CHECK-NEXT: [[I_2:%.+]] = trunc i64 [[I_1_ADD0]] to i32
-// CHECK-NEXT: store i32 [[I_2]], i32*
-// CHECK: [[IV2:%.+]] = load i64, i64* [[T1_OMP_IV]]
-// CHECK: [[IV2_1:%.+]] = load i64, i64* [[T1_OMP_IV]]
-// CHECK-NEXT: [[DIV_1:%.+]] = sdiv i64 [[IV2_1]], 4
-// CHECK-NEXT: [[MUL_1:%.+]] = mul nsw i64 [[DIV_1]], 4
-// CHECK-NEXT: [[J_1:%.+]] = sub nsw i64 [[IV2]], [[MUL_1]]
-// CHECK-NEXT: [[J_2:%.+]] = mul nsw i64 [[J_1]], 2
-// CHECK-NEXT: [[J_2_ADD0:%.+]] = add nsw i64 0, [[J_2]]
-// CHECK-NEXT: store i64 [[J_2_ADD0]], i64*
+// OMP45: [[IV1:%.+]] = load i64, i64* [[T1_OMP_IV]]
+// OMP45-NEXT: [[I_1:%.+]] = sdiv i64 [[IV1]], 4
+// OMP45-NEXT: [[I_1_MUL1:%.+]] = mul nsw i64 [[I_1]], 1
+// OMP45-NEXT: [[I_1_ADD0:%.+]] = add nsw i64 0, [[I_1_MUL1]]
+// OMP45-NEXT: [[I_2:%.+]] = trunc i64 [[I_1_ADD0]] to i32
+// OMP45-NEXT: store i32 [[I_2]], i32*
+// OMP45: [[IV2:%.+]] = load i64, i64* [[T1_OMP_IV]]
+// OMP45: [[IV2_1:%.+]] = load i64, i64* [[T1_OMP_IV]]
+// OMP45-NEXT: [[DIV_1:%.+]] = sdiv i64 [[IV2_1]], 4
+// OMP45-NEXT: [[MUL_1:%.+]] = mul nsw i64 [[DIV_1]], 4
+// OMP45-NEXT: [[J_1:%.+]] = sub nsw i64 [[IV2]], [[MUL_1]]
+// OMP45-NEXT: [[J_2:%.+]] = mul nsw i64 [[J_1]], 2
+// OMP45-NEXT: [[J_2_ADD0:%.+]] = add nsw i64 0, [[J_2]]
+// OMP45-NEXT: store i64 [[J_2_ADD0]], i64*
// simd.for.inc:
-// CHECK: [[IV3:%.+]] = load i64, i64* [[T1_OMP_IV]]
-// CHECK-NEXT: [[INC:%.+]] = add nsw i64 [[IV3]], 1
-// CHECK-NEXT: store i64 [[INC]], i64*
-// CHECK-NEXT: br label {{%.+}}
-// CHECK: [[T1_END]]:
-// CHECK: call void @__kmpc_for_static_fini(%struct.ident_t* {{.+}}, i32 %{{.+}})
-// CHECK: ret void
+// OMP45: [[IV3:%.+]] = load i64, i64* [[T1_OMP_IV]]
+// OMP45-NEXT: [[INC:%.+]] = add nsw i64 [[IV3]], 1
+// OMP45-NEXT: store i64 [[INC]], i64*
+// OMP45-NEXT: br label {{%.+}}
+// OMP45: [[T1_END]]:
+// OMP45: call void @__kmpc_for_static_fini(%struct.ident_t* {{.+}}, i32 %{{.+}})
+// OMP45: ret void
//
+
+// OMP45-NOT: !{!"llvm.loop.vectorize.enable", i1 false}
+// OMP45-DAG: ![[VECT]] = distinct !{![[VECT]], ![[VM:.+]]}
+// OMP45-DAG: ![[VM]] = !{!"llvm.loop.vectorize.enable", i1 true}
+// OMP45-NOT: !{!"llvm.loop.vectorize.enable", i1 false}
+// OMP50-DAG: ![[VECT]] = distinct !{![[VECT]], ![[VM:.+]]}
+// OMP50-DAG: ![[VM]] = !{!"llvm.loop.vectorize.enable", i1 true}
+// OMP50-DAG: ![[NOVECT]] = distinct !{![[NOVECT]], ![[NOVM:.+]]}
+// OMP50-DAG: ![[NOVM]] = !{!"llvm.loop.vectorize.enable", i1 false}
+
// TERM_DEBUG-LABEL: bar
int bar() {return 0;};
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_for_simd_firstprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_for_simd_firstprivate_messages.cpp
index 5f57c65..308bd84 100644
--- a/src/llvm-project/clang/test/OpenMP/parallel_for_simd_firstprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/parallel_for_simd_firstprivate_messages.cpp
@@ -10,6 +10,13 @@
return argc;
}
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp parallel for simd firstprivate(fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
struct S1; // expected-note 2 {{declared here}} expected-note 2 {{forward declaration of 'S1'}}
extern S1 a;
class S2 {
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_for_simd_lastprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_for_simd_lastprivate_messages.cpp
index e47a6090..4dca240 100644
--- a/src/llvm-project/clang/test/OpenMP/parallel_for_simd_lastprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/parallel_for_simd_lastprivate_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
@@ -70,6 +72,7 @@
I g(5);
int i, z;
int &j = i;
+ S6 s(0); // omp50-note {{'s' defined here}}
#pragma omp parallel for simd lastprivate // expected-error {{expected '(' after 'lastprivate'}}
for (int k = 0; k < argc; ++k)
++k;
@@ -91,6 +94,12 @@
#pragma omp parallel for simd lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
for (int k = 0; k < argc; ++k)
++k;
+#pragma omp parallel for simd lastprivate(conditional: s,argc) lastprivate(conditional: // omp50-error {{expected expression}} omp45-error 2 {{use of undeclared identifier 'conditional'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected list item of scalar type in 'lastprivate' clause with 'conditional' modifier}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel for simd lastprivate(foo:argc) // omp50-error {{expected 'conditional' in OpenMP clause 'lastprivate'}} omp45-error {{expected ',' or ')' in 'lastprivate' clause}} omp45-error {{expected ')'}} omp45-error {{expected variable name}} omp45-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
#pragma omp parallel for simd lastprivate(S1) // expected-error {{'S1' does not refer to a value}}
for (int k = 0; k < argc; ++k)
++k;
@@ -214,8 +223,8 @@
#pragma omp parallel for simd private(xa), lastprivate(xa) // expected-error {{private variable cannot be lastprivate}} expected-note {{defined as private}}
for (i = 0; i < argc; ++i)
foo();
-#pragma omp parallel for simd lastprivate(i) // expected-note {{defined as lastprivate}}
- for (i = 0; i < argc; ++i) // expected-error {{loop iteration variable in the associated loop of 'omp parallel for simd' directive may not be lastprivate, predetermined as linear}}
+#pragma omp parallel for simd lastprivate(i) // omp45-note {{defined as lastprivate}}
+ for (i = 0; i < argc; ++i) // omp45-error {{loop iteration variable in the associated loop of 'omp parallel for simd' directive may not be lastprivate, predetermined as linear}}
foo();
#pragma omp parallel private(xa)
#pragma omp parallel for simd lastprivate(xa)
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_for_simd_linear_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_for_simd_linear_messages.cpp
index 5d6da8c..6ca28ad 100644
--- a/src/llvm-project/clang/test/OpenMP/parallel_for_simd_linear_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/parallel_for_simd_linear_messages.cpp
@@ -3,6 +3,13 @@
// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
+void xxx(int argc) {
+ int i, lin, step; // expected-note {{initialize the variable 'lin' to silence this warning}} expected-note {{initialize the variable 'step' to silence this warning}}
+#pragma omp parallel for simd linear(i, lin : step) // expected-warning {{variable 'lin' is uninitialized when used here}} expected-warning {{variable 'step' is uninitialized when used here}}
+ for (i = 0; i < 10; ++i)
+ ;
+}
+
namespace X {
int x;
};
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_for_simd_loop_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_for_simd_loop_messages.cpp
index d606f07..5a0202c 100644
--- a/src/llvm-project/clang/test/OpenMP/parallel_for_simd_loop_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/parallel_for_simd_loop_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wuninitialized
class S {
int a;
@@ -92,28 +94,28 @@
for (((ii)) = 0; ii < 10; ++ii)
c[ii] = a[ii];
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
#pragma omp parallel for simd
for (int i = 0; i; i++)
c[i] = a[i];
-// expected-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'i'}}
#pragma omp parallel for simd
for (int i = 0; jj < kk; ii++)
c[i] = a[i];
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
#pragma omp parallel for simd
for (int i = 0; !!i; i++)
c[i] = a[i];
-// Ok
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
#pragma omp parallel for simd
for (int i = 0; i != 1; i++)
c[i] = a[i];
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
#pragma omp parallel for simd
for (int i = 0;; i++)
c[i] = a[i];
@@ -249,14 +251,14 @@
for (ii = 0; ii < 10; ii++)
c[ii] = a[ii];
-// expected-note@+2 {{defined as private}}
-// expected-error@+2 {{loop iteration variable in the associated loop of 'omp parallel for simd' directive may not be private, predetermined as linear}}
+// omp4-note@+2 {{defined as private}}
+// omp4-error@+2 {{loop iteration variable in the associated loop of 'omp parallel for simd' directive may not be private, predetermined as linear}}
#pragma omp parallel for simd private(ii)
for (ii = 0; ii < 10; ii++)
c[ii] = a[ii];
-// expected-note@+2 {{defined as lastprivate}}
-// expected-error@+2 {{loop iteration variable in the associated loop of 'omp parallel for simd' directive may not be lastprivate, predetermined as linear}}
+// omp4-note@+2 {{defined as lastprivate}}
+// omp4-error@+2 {{loop iteration variable in the associated loop of 'omp parallel for simd' directive may not be lastprivate, predetermined as linear}}
#pragma omp parallel for simd lastprivate(ii)
for (ii = 0; ii < 10; ii++)
c[ii] = a[ii];
@@ -281,7 +283,7 @@
c[globalii] += a[globalii] + ii;
}
-// expected-error@+2 {{statement after '#pragma omp parallel for simd' must be a for loop}}
+// omp4-error@+2 {{statement after '#pragma omp parallel for simd' must be a for loop}}
#pragma omp parallel for simd
for (auto &item : a) {
item = item + 1;
@@ -417,15 +419,15 @@
#pragma omp parallel for simd
for (begin = end; begin < end; ++begin)
++begin;
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
#pragma omp parallel for simd
for (GoodIter I = begin; I - I; ++I)
++I;
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
#pragma omp parallel for simd
for (GoodIter I = begin; begin < end; ++I)
++I;
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
#pragma omp parallel for simd
for (GoodIter I = begin; !I; ++I)
++I;
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_for_simd_misc_messages.c b/src/llvm-project/clang/test/OpenMP/parallel_for_simd_misc_messages.c
index 2dd64d3..0ec5dde 100644
--- a/src/llvm-project/clang/test/OpenMP/parallel_for_simd_misc_messages.c
+++ b/src/llvm-project/clang/test/OpenMP/parallel_for_simd_misc_messages.c
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=45 -verify=expected,omp45 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -verify=expected,omp50 %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=45 -verify=expected,omp45 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -verify=expected,omp50 %s -Wuninitialized
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp parallel for simd'}}
#pragma omp parallel for simd
@@ -754,3 +756,87 @@
}
}
+void test_nontemporal() {
+ int i;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp parallel for simd'}} expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp parallel for simd nontemporal(
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp parallel for simd'}} expected-error@+1 2 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp parallel for simd nontemporal(,
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp parallel for simd'}} expected-error@+1 2 {{expected expression}}
+#pragma omp parallel for simd nontemporal(, )
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp parallel for simd'}} expected-error@+1 {{expected expression}}
+#pragma omp parallel for simd nontemporal()
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp parallel for simd'}} expected-error@+1 {{expected expression}}
+#pragma omp parallel for simd nontemporal(int)
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp parallel for simd'}} omp50-error@+1 {{expected variable name}}
+#pragma omp parallel for simd nontemporal(0)
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp parallel for simd'}} expected-error@+1 {{use of undeclared identifier 'x'}}
+#pragma omp parallel for simd nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+// expected-error@+2 {{use of undeclared identifier 'x'}}
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp parallel for simd'}} expected-error@+1 {{use of undeclared identifier 'y'}}
+#pragma omp parallel for simd nontemporal(x, y)
+ for (i = 0; i < 16; ++i)
+ ;
+// expected-error@+3 {{use of undeclared identifier 'x'}}
+// expected-error@+2 {{use of undeclared identifier 'y'}}
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp parallel for simd'}} expected-error@+1 {{use of undeclared identifier 'z'}}
+#pragma omp parallel for simd nontemporal(x, y, z)
+ for (i = 0; i < 16; ++i)
+ ;
+
+ int x, y;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp parallel for simd'}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp parallel for simd nontemporal(x :)
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp parallel for simd'}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}}
+#pragma omp parallel for simd nontemporal(x :, )
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp50-note@+2 {{defined as nontemporal}}
+// omp45-error@+1 2 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp parallel for simd'}} omp50-error@+1 {{a variable cannot appear in more than one nontemporal clause}}
+#pragma omp parallel for simd nontemporal(x) nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp parallel for simd'}}
+#pragma omp parallel for simd private(x) nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp parallel for simd'}}
+#pragma omp parallel for simd nontemporal(x) private(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp parallel for simd'}} expected-note@+1 {{to match this '('}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}} expected-error@+1 {{expected ')'}}
+#pragma omp parallel for simd nontemporal(x, y : 0)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp parallel for simd'}}
+#pragma omp parallel for simd nontemporal(x) lastprivate(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp parallel for simd'}}
+#pragma omp parallel for simd lastprivate(x) nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+}
+
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_for_simd_reduction_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_for_simd_reduction_messages.cpp
index 4c2e597..d8c13e7 100644
--- a/src/llvm-project/clang/test/OpenMP/parallel_for_simd_reduction_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/parallel_for_simd_reduction_messages.cpp
@@ -7,6 +7,13 @@
// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -o - %s -Wuninitialized
extern int omp_default_mem_alloc;
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp parallel for simd reduction(+:fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
void foo() {
}
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_if_codegen.cpp b/src/llvm-project/clang/test/OpenMP/parallel_if_codegen.cpp
index ec9fc01..18cf852 100644
--- a/src/llvm-project/clang/test/OpenMP/parallel_if_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/parallel_if_codegen.cpp
@@ -29,12 +29,13 @@
}
// CHECK: define internal {{.*}}void [[GTID_TEST_REGION1]](i{{.+}}* noalias [[GTID_PARAM:%.+]], i32* noalias
-// CHECK: store i32 0, i32* [[ZERO_ADDR:%.+]],
+// CHECK: store i32 0, i32* [[BND_ZERO_ADDR:%.+]],
// CHECK: store i{{[0-9]+}}* [[GTID_PARAM]], i{{[0-9]+}}** [[GTID_ADDR_REF:%.+]],
// CHECK: [[GTID_ADDR:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** [[GTID_ADDR_REF]]
// CHECK: [[GTID:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[GTID_ADDR]]
// CHECK: call {{.*}}void @__kmpc_serialized_parallel(%{{.+}}* @{{.+}}, i{{.+}} [[GTID]])
-// CHECK: call void [[GTID_TEST_REGION2:@.+]](i{{[0-9]+}}* [[ZERO_ADDR]]
+// CHECK: [[GTID_ADDR:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** [[GTID_ADDR_REF]]
+// CHECK: call void [[GTID_TEST_REGION2:@.+]](i{{[0-9]+}}* [[GTID_ADDR]], i{{[0-9]+}}* [[BND_ZERO_ADDR]]
// CHECK: call {{.*}}void @__kmpc_end_serialized_parallel(%{{.+}}* @{{.+}}, i{{.+}} [[GTID]])
// CHECK: ret void
@@ -55,14 +56,15 @@
// CHECK-LABEL: define {{.*}}i{{[0-9]+}} @main()
int main() {
-// CHECK: store i32 0, i32* [[ZERO_ADDR2:%.+]],
-// CHECK: store i32 0, i32* [[ZERO_ADDR1:%.+]],
+// CHECK: store i32 0, i32* [[BND_ZERO_ADDR2:%.+]],
+// CHECK: store i32 0, i32* [[BND_ZERO_ADDR1:%.+]],
// CHECK: [[GTID:%.+]] = call {{.*}}i32 @__kmpc_global_thread_num(
// CHECK: call {{.*}}void {{.+}} @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{.+}} 0, void {{.+}}* [[CAP_FN4:@.+]] to void
#pragma omp parallel if (true)
fn4();
// CHECK: call {{.*}}void @__kmpc_serialized_parallel(%{{.+}}* @{{.+}}, i32 [[GTID]])
-// CHECK: call void [[CAP_FN5:@.+]](i32* [[ZERO_ADDR1]], i32* [[ZERO_ADDR1]])
+// CHECK: store i32 [[GTID]], i32* [[GTID_ADDR:%.+]],
+// CHECK: call void [[CAP_FN5:@.+]](i32* [[GTID_ADDR]], i32* [[BND_ZERO_ADDR1]])
// CHECK: call {{.*}}void @__kmpc_end_serialized_parallel(%{{.+}}* @{{.+}}, i32 [[GTID]])
#pragma omp parallel if (false)
fn5();
@@ -73,7 +75,8 @@
// CHECK: br label %[[OMP_END:.+]]
// CHECK: [[OMP_ELSE]]
// CHECK: call {{.*}}void @__kmpc_serialized_parallel(%{{.+}}* @{{.+}}, i32 [[GTID]])
-// CHECK: call void [[CAP_FN6]](i32* [[ZERO_ADDR2]], i32* [[ZERO_ADDR2]])
+// CHECK: store i32 [[GTID]], i32* [[GTID_ADDR:%.+]],
+// CHECK: call void [[CAP_FN6]](i32* [[GTID_ADDR]], i32* [[BND_ZERO_ADDR2]])
// CHECK: call {{.*}}void @__kmpc_end_serialized_parallel(%{{.+}}* @{{.+}}, i32 [[GTID]])
// CHECK: br label %[[OMP_END]]
// CHECK: [[OMP_END]]
@@ -96,12 +99,13 @@
// CHECK: ret void
// CHECK-LABEL: define {{.+}} @{{.+}}tmain
-// CHECK: store i32 0, i32* [[ZERO_ADDR2:%.+]],
-// CHECK: store i32 0, i32* [[ZERO_ADDR1:%.+]],
+// CHECK: store i32 0, i32* [[BND_ZERO_ADDR2:%.+]],
+// CHECK: store i32 0, i32* [[BND_ZERO_ADDR1:%.+]],
// CHECK: [[GTID:%.+]] = call {{.*}}i32 @__kmpc_global_thread_num(
// CHECK: call {{.*}}void {{.+}} @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{.+}} 0, void {{.+}}* [[CAP_FN1:@.+]] to void
// CHECK: call {{.*}}void @__kmpc_serialized_parallel(%{{.+}}* @{{.+}}, i32 [[GTID]])
-// CHECK: call void [[CAP_FN2:@.+]](i32* [[ZERO_ADDR1]], i32* [[ZERO_ADDR1]])
+// CHECK: store i32 [[GTID]], i32* [[GTID_ADDR:%.+]],
+// CHECK: call void [[CAP_FN2:@.+]](i32* [[GTID_ADDR]], i32* [[BND_ZERO_ADDR1]])
// CHECK: call {{.*}}void @__kmpc_end_serialized_parallel(%{{.+}}* @{{.+}}, i32 [[GTID]])
// CHECK: br i1 %{{.+}}, label %[[OMP_THEN:.+]], label %[[OMP_ELSE:.+]]
// CHECK: [[OMP_THEN]]
@@ -109,7 +113,8 @@
// CHECK: br label %[[OMP_END:.+]]
// CHECK: [[OMP_ELSE]]
// CHECK: call {{.*}}void @__kmpc_serialized_parallel(%{{.+}}* @{{.+}}, i32 [[GTID]])
-// CHECK: call void [[CAP_FN3]](i32* [[ZERO_ADDR2]], i32* [[ZERO_ADDR2]])
+// CHECK: store i32 [[GTID]], i32* [[GTID_ADDR:%.+]],
+// CHECK: call void [[CAP_FN3]](i32* [[GTID_ADDR]], i32* [[BND_ZERO_ADDR2]])
// CHECK: call {{.*}}void @__kmpc_end_serialized_parallel(%{{.+}}* @{{.+}}, i32 [[GTID]])
// CHECK: br label %[[OMP_END]]
// CHECK: [[OMP_END]]
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_ast_print.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_ast_print.cpp
new file mode 100644
index 0000000..0e07258
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_ast_print.cpp
@@ -0,0 +1,222 @@
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -ast-print %s | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -ast-print %s | FileCheck %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s
+// expected-no-diagnostics
+
+#ifndef HEADER
+#define HEADER
+
+void foo() {}
+
+struct S1 {
+ S1(): a(0) {}
+ S1(int v) : a(v) {}
+ int a;
+ typedef int type;
+ S1& operator +(const S1&);
+ S1& operator *(const S1&);
+ S1& operator &&(const S1&);
+ S1& operator ^(const S1&);
+};
+
+template <typename T>
+class S7 : public T {
+protected:
+ T a;
+ T b[100];
+ S7() : a(0) {}
+
+public:
+ S7(typename T::type v) : a(v) {
+#pragma omp parallel master private(a) private(this->a) private(T::a)
+ for (int k = 0; k < a.a; ++k)
+ ++this->a.a;
+#pragma omp parallel master firstprivate(a) firstprivate(this->a) firstprivate(T::a)
+ for (int k = 0; k < a.a; ++k)
+ ++this->a.a;
+#pragma omp parallel master shared(a) shared(this->a) shared(T::a)
+ for (int k = 0; k < a.a; ++k)
+ ++this->a.a;
+#pragma omp parallel master reduction(+ : a) reduction(*: b[:])
+ for (int k = 0; k < a.a; ++k)
+ ++this->a.a;
+ }
+ S7 &operator=(S7 &s) {
+#pragma omp parallel master private(a) private(this->a)
+ for (int k = 0; k < s.a.a; ++k)
+ ++s.a.a;
+#pragma omp parallel master firstprivate(a) firstprivate(this->a)
+ for (int k = 0; k < s.a.a; ++k)
+ ++s.a.a;
+#pragma omp parallel master shared(a) shared(this->a)
+ for (int k = 0; k < s.a.a; ++k)
+ ++s.a.a;
+#pragma omp parallel master reduction(&& : this->a) reduction(^: b[s.a.a])
+ for (int k = 0; k < s.a.a; ++k)
+ ++s.a.a;
+ return *this;
+ }
+};
+
+// CHECK: #pragma omp parallel master private(this->a) private(this->a) private(T::a)
+// CHECK: #pragma omp parallel master firstprivate(this->a) firstprivate(this->a) firstprivate(T::a)
+// CHECK: #pragma omp parallel master shared(this->a) shared(this->a) shared(T::a)
+// CHECK: #pragma omp parallel master reduction(+: this->a) reduction(*: this->b[:])
+// CHECK: #pragma omp parallel master private(this->a) private(this->a)
+// CHECK: #pragma omp parallel master firstprivate(this->a) firstprivate(this->a)
+// CHECK: #pragma omp parallel master shared(this->a) shared(this->a)
+// CHECK: #pragma omp parallel master reduction(&&: this->a) reduction(^: this->b[s.a.a])
+// CHECK: #pragma omp parallel master private(this->a) private(this->a) private(this->S1::a)
+// CHECK: #pragma omp parallel master firstprivate(this->a) firstprivate(this->a) firstprivate(this->S1::a)
+// CHECK: #pragma omp parallel master shared(this->a) shared(this->a) shared(this->S1::a)
+// CHECK: #pragma omp parallel master reduction(+: this->a) reduction(*: this->b[:])
+
+class S8 : public S7<S1> {
+ S8() {}
+
+public:
+ S8(int v) : S7<S1>(v){
+#pragma omp parallel master private(a) private(this->a) private(S7 < S1 > ::a)
+ for (int k = 0; k < a.a; ++k)
+ ++this->a.a;
+#pragma omp parallel master firstprivate(a) firstprivate(this->a) firstprivate(S7 < S1 > ::a)
+ for (int k = 0; k < a.a; ++k)
+ ++this->a.a;
+#pragma omp parallel master shared(a) shared(this->a) shared(S7 < S1 > ::a)
+ for (int k = 0; k < a.a; ++k)
+ ++this->a.a;
+#pragma omp parallel master reduction(^ : S7 < S1 > ::a) reduction(+ : S7 < S1 > ::b[ : S7 < S1 > ::a.a])
+ for (int k = 0; k < a.a; ++k)
+ ++this->a.a;
+ }
+ S8 &operator=(S8 &s) {
+#pragma omp parallel master private(a) private(this->a)
+ for (int k = 0; k < s.a.a; ++k)
+ ++s.a.a;
+#pragma omp parallel master firstprivate(a) firstprivate(this->a)
+ for (int k = 0; k < s.a.a; ++k)
+ ++s.a.a;
+#pragma omp parallel master shared(a) shared(this->a)
+ for (int k = 0; k < s.a.a; ++k)
+ ++s.a.a;
+#pragma omp parallel master reduction(* : this->a) reduction(&&:this->b[a.a:])
+ for (int k = 0; k < s.a.a; ++k)
+ ++s.a.a;
+ return *this;
+ }
+};
+
+// CHECK: #pragma omp parallel master private(this->a) private(this->a) private(this->S7<S1>::a)
+// CHECK: #pragma omp parallel master firstprivate(this->a) firstprivate(this->a) firstprivate(this->S7<S1>::a)
+// CHECK: #pragma omp parallel master shared(this->a) shared(this->a) shared(this->S7<S1>::a)
+// CHECK: #pragma omp parallel master reduction(^: this->S7<S1>::a) reduction(+: this->S7<S1>::b[:this->S7<S1>::a.a])
+// CHECK: #pragma omp parallel master private(this->a) private(this->a)
+// CHECK: #pragma omp parallel master firstprivate(this->a) firstprivate(this->a)
+// CHECK: #pragma omp parallel master shared(this->a) shared(this->a)
+// CHECK: #pragma omp parallel master reduction(*: this->a) reduction(&&: this->b[this->a.a:])
+
+template <class T>
+struct S {
+ operator T() {return T();}
+ static T TS;
+ #pragma omp threadprivate(TS)
+};
+
+// CHECK: template <class T> struct S {
+// CHECK: static T TS;
+// CHECK-NEXT: #pragma omp threadprivate(S::TS)
+// CHECK: };
+// CHECK: template<> struct S<int> {
+// CHECK: static int TS;
+// CHECK-NEXT: #pragma omp threadprivate(S<int>::TS)
+// CHECK-NEXT: }
+// CHECK: template<> struct S<long> {
+// CHECK: static long TS;
+// CHECK-NEXT: #pragma omp threadprivate(S<long>::TS)
+// CHECK-NEXT: }
+
+int thrp;
+#pragma omp threadprivate(thrp)
+
+template <typename T, int C>
+T tmain(T argc, T *argv) {
+ T b = argc, c, d, e, f, g;
+ static T a;
+ S<T> s;
+ T arr[C][10], arr1[C];
+#pragma omp parallel master
+ a=2;
+#pragma omp parallel master default(none), private(argc,b) firstprivate(argv) shared (d) if (parallel:argc > 0) num_threads(C) copyin(S<T>::TS, thrp) proc_bind(master) reduction(+:c, arr1[argc]) reduction(max:e, arr[:C][0:10])
+ foo();
+#pragma omp parallel master if (C) num_threads(s) proc_bind(close) reduction(^:e, f, arr[0:C][:argc]) reduction(&& : g)
+ foo();
+ return 0;
+}
+
+// CHECK: template <typename T, int C> T tmain(T argc, T *argv) {
+// CHECK-NEXT: T b = argc, c, d, e, f, g;
+// CHECK-NEXT: static T a;
+// CHECK-NEXT: S<T> s;
+// CHECK-NEXT: T arr[C][10], arr1[C];
+// CHECK-NEXT: #pragma omp parallel master{{$}}
+// CHECK-NEXT: a = 2;
+// CHECK-NEXT: #pragma omp parallel master default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(C) copyin(S<T>::TS,thrp) proc_bind(master) reduction(+: c,arr1[argc]) reduction(max: e,arr[:C][0:10])
+// CHECK-NEXT: foo()
+// CHECK-NEXT: #pragma omp parallel master if(C) num_threads(s) proc_bind(close) reduction(^: e,f,arr[0:C][:argc]) reduction(&&: g)
+// CHECK-NEXT: foo()
+// CHECK: template<> int tmain<int, 5>(int argc, int *argv) {
+// CHECK-NEXT: int b = argc, c, d, e, f, g;
+// CHECK-NEXT: static int a;
+// CHECK-NEXT: S<int> s;
+// CHECK-NEXT: int arr[5][10], arr1[5];
+// CHECK-NEXT: #pragma omp parallel master
+// CHECK-NEXT: a = 2;
+// CHECK-NEXT: #pragma omp parallel master default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(5) copyin(S<int>::TS,thrp) proc_bind(master) reduction(+: c,arr1[argc]) reduction(max: e,arr[:5][0:10])
+// CHECK-NEXT: foo()
+// CHECK-NEXT: #pragma omp parallel master if(5) num_threads(s) proc_bind(close) reduction(^: e,f,arr[0:5][:argc]) reduction(&&: g)
+// CHECK-NEXT: foo()
+// CHECK: template<> long tmain<long, 1>(long argc, long *argv) {
+// CHECK-NEXT: long b = argc, c, d, e, f, g;
+// CHECK-NEXT: static long a;
+// CHECK-NEXT: S<long> s;
+// CHECK-NEXT: long arr[1][10], arr1[1];
+// CHECK-NEXT: #pragma omp parallel master
+// CHECK-NEXT: a = 2;
+// CHECK-NEXT: #pragma omp parallel master default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(1) copyin(S<long>::TS,thrp) proc_bind(master) reduction(+: c,arr1[argc]) reduction(max: e,arr[:1][0:10])
+// CHECK-NEXT: foo()
+// CHECK-NEXT: #pragma omp parallel master if(1) num_threads(s) proc_bind(close) reduction(^: e,f,arr[0:1][:argc]) reduction(&&: g)
+// CHECK-NEXT: foo()
+
+enum Enum { };
+
+int main (int argc, char **argv) {
+ long x;
+ int b = argc, c, d, e, f, g;
+ static int a;
+ #pragma omp threadprivate(a)
+ int arr[10][argc], arr1[2];
+ Enum ee;
+// CHECK: Enum ee;
+#pragma omp parallel master
+// CHECK-NEXT: #pragma omp parallel master
+ a=2;
+// CHECK-NEXT: a = 2;
+#pragma omp parallel master default(none), private(argc,b) firstprivate(argv) if (parallel: argc > 0) num_threads(ee) copyin(a) proc_bind(spread) reduction(| : c, d, arr1[argc]) reduction(* : e, arr[:10][0:argc]) allocate(e)
+// CHECK-NEXT: #pragma omp parallel master default(none) private(argc,b) firstprivate(argv) if(parallel: argc > 0) num_threads(ee) copyin(a) proc_bind(spread) reduction(|: c,d,arr1[argc]) reduction(*: e,arr[:10][0:argc]) allocate(e)
+ foo();
+// CHECK-NEXT: foo();
+// CHECK-NEXT: #pragma omp parallel master allocate(e) if(b) num_threads(c) proc_bind(close) reduction(^: e,f) reduction(&&: g,arr[0:argc][:10])
+// CHECK-NEXT: foo()
+#pragma omp parallel master allocate(e) if (b) num_threads(c) proc_bind(close) reduction(^:e, f) reduction(&& : g, arr[0:argc][:10])
+ foo();
+ return tmain<int, 5>(b, &b) + tmain<long, 1>(x, &x);
+}
+
+template<typename T>
+T S<T>::TS = 0;
+
+#endif
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_codegen.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_codegen.cpp
new file mode 100644
index 0000000..ad697ee
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_codegen.cpp
@@ -0,0 +1,471 @@
+// expected-no-diagnostics
+#ifndef HEADER
+#define HEADER
+
+#ifdef CK1
+///==========================================================================///
+// RUN: %clang_cc1 -DCK1 -verify -fopenmp -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck %s --check-prefix CK1
+// RUN: %clang_cc1 -DCK1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
+// RUN: %clang_cc1 -DCK1 -fopenmp -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CK1
+
+// RUN: %clang_cc1 -DCK1 -verify -fopenmp-simd -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DCK1 -fopenmp-simd -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
+// RUN: %clang_cc1 -DCK1 -fopenmp-simd -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
+
+// CK1-DAG: %struct.ident_t = type { i32, i32, i32, i32, i8* }
+// CK1-DAG: [[STR:@.+]] = private unnamed_addr constant [23 x i8] c";unknown;unknown;0;0;;\00"
+// CK1-DAG: [[DEF_LOC:@.+]] = private unnamed_addr global %struct.ident_t { i32 0, i32 2, i32 0, i32 0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* [[STR]], i32 0, i32 0) }
+
+// CK1-LABEL: foo
+void foo() {}
+
+void parallel_master() {
+#pragma omp parallel master
+ foo();
+}
+
+// CK1-LABEL: define void @{{.+}}parallel_master{{.+}}
+// CK1: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* [[DEF_LOC]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* [[OMP_OUTLINED:@.+]] to void (i32*, i32*, ...)*))
+
+// CK1: define internal {{.*}}void [[OMP_OUTLINED]](i32* noalias [[GTID:%.+]], i32* noalias [[BTID:%.+]])
+// CK1-NOT: __kmpc_global_thread_num
+// CK1: call i32 @__kmpc_master({{.+}})
+// CK1: invoke void {{.*}}foo{{.*}}()
+// CK1-NOT: __kmpc_global_thread_num
+// CK1: call void @__kmpc_end_master({{.+}})
+// CK1: call void @__clang_call_terminate
+// CK1: unreachable
+
+#endif
+
+#ifdef CK2
+///==========================================================================///
+// RUN: %clang_cc1 -DCK2 -verify -fopenmp -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck %s --check-prefix CK2
+// RUN: %clang_cc1 -DCK2 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
+// RUN: %clang_cc1 -DCK2 -fopenmp -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CK2
+
+// RUN: %clang_cc1 -DCK2 -verify -fopenmp-simd -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DCK2 -fopenmp-simd -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
+// RUN: %clang_cc1 -DCK2 -fopenmp-simd -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
+
+// CK2-DAG: %struct.ident_t = type { i32, i32, i32, i32, i8* }
+// CK2-DAG: [[STR:@.+]] = private unnamed_addr constant [23 x i8] c";unknown;unknown;0;0;;\00"
+// CK2-DAG: [[DEF_LOC:@.+]] = private unnamed_addr global %struct.ident_t { i32 0, i32 2, i32 0, i32 0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* [[STR]], i32 0, i32 0) }
+
+void parallel_master_private() {
+ int a;
+#pragma omp parallel master private(a)
+ a++;
+}
+
+// CK2-LABEL: define void @{{.+}}parallel_master_private{{.+}}
+// CK2: [[A_PRIV:%.+]] = alloca i32
+// CK2: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* [[DEF_LOC]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* [[OMP_OUTLINED:@.+]] to void (i32*, i32*, ...)*))
+
+// CK2: define internal {{.*}}void [[OMP_OUTLINED]](i32* noalias [[GTID:%.+]], i32* noalias [[BTID:%.+]])
+// CK2-NOT: __kmpc_global_thread_num
+// CK2: call i32 @__kmpc_master({{.+}})
+// CK2: [[A_VAL:%.+]] = load i32, i32* [[A_PRIV]]
+// CK2: [[INC:%.+]] = add nsw i32 [[A_VAL]]
+// CK2: store i32 [[INC]], i32* [[A_PRIV]]
+// CK2-NOT: __kmpc_global_thread_num
+// CK2: call void @__kmpc_end_master({{.+}})
+// CK2: ret void
+
+#endif
+
+#ifdef CK3
+///==========================================================================///
+// RUN: %clang_cc1 -DCK3 -verify -fopenmp -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck %s --check-prefix CK3
+// RUN: %clang_cc1 -DCK3 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
+// RUN: %clang_cc1 -DCK3 -fopenmp -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CK3
+
+// RUN: %clang_cc1 -DCK3 -verify -fopenmp-simd -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DCK3 -fopenmp-simd -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
+// RUN: %clang_cc1 -DCK3 -fopenmp-simd -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
+
+// CK3-DAG: %struct.ident_t = type { i32, i32, i32, i32, i8* }
+// CK3-DAG: [[STR:@.+]] = private unnamed_addr constant [23 x i8] c";unknown;unknown;0;0;;\00"
+
+void parallel_master_private() {
+ int a;
+#pragma omp parallel master default(shared)
+ a++;
+}
+
+// CK3-LABEL: define void @{{.+}}parallel_master{{.+}}
+// CK3: [[A_VAL:%.+]] = alloca i32
+// CK3: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* {{.+}}, i32 1, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32*)* [[OMP_OUTLINED:@.+]] to void
+
+// CK3: define internal {{.*}}void [[OMP_OUTLINED]](i32* noalias [[GTID:%.+]], i32* noalias [[BTID:%.+]], i32* dereferenceable(4) [[A_VAL]])
+// CK3: [[GTID_ADDR:%.+]] = alloca i32*
+// CK3: [[BTID_ADDR:%.+]] = alloca i32*
+// CK3: [[A_ADDR:%.+]] = alloca i32*
+// CK3: store i32* [[GTID]], i32** [[GTID_ADDR]]
+// CK3: store i32* [[BTID]], i32** [[BTID_ADDR]]
+// CK3: store i32* [[A_VAL]], i32** [[A_ADDR]]
+// CK3: [[ZERO:%.+]] = load i32*, i32** [[A_ADDR]]
+// CK3-NOT: __kmpc_global_thread_num
+// CK3: call i32 @__kmpc_master({{.+}})
+// CK3: [[FIVE:%.+]] = load i32, i32* [[ZERO]]
+// CK3: [[INC:%.+]] = add nsw i32 [[FIVE]]
+// CK3: store i32 [[INC]], i32* [[ZERO]]
+// CK3-NOT: __kmpc_global_thread_num
+// CK3: call void @__kmpc_end_master({{.+}})
+
+#endif
+
+#ifdef CK4
+///==========================================================================///
+// RUN: %clang_cc1 -DCK4 -verify -fopenmp -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck %s --check-prefix CK4
+// RUN: %clang_cc1 -DCK4 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
+// RUN: %clang_cc1 -DCK4 -fopenmp -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CK4
+
+// RUN: %clang_cc1 -DCK4 -verify -fopenmp-simd -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DCK4 -fopenmp-simd -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
+// RUN: %clang_cc1 -DCK4 -fopenmp-simd -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
+
+// CK4-DAG: %struct.ident_t = type { i32, i32, i32, i32, i8* }
+// CK4-DAG: [[STR:@.+]] = private unnamed_addr constant [23 x i8] c";unknown;unknown;0;0;;\00"
+// CK4-DAG: [[DEF_LOC:@.+]] = private unnamed_addr global %struct.ident_t { i32 0, i32 2, i32 0, i32 0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* [[STR]], i32 0, i32 0) }
+
+void parallel_master_firstprivate() {
+ int a;
+#pragma omp parallel master firstprivate(a)
+ a++;
+}
+
+// CK4-LABEL: define void @{{.+}}parallel_master_firstprivate{{.+}}
+// CK4: [[A_VAL:%.+]] = alloca i32
+// CK4: [[A_CASTED:%.+]] = alloca i64
+// CK4: [[ZERO:%.+]] = load i32, i32* [[A_VAL]]
+// CK4: [[CONV:%.+]] = bitcast i64* [[A_CASTED]] to i32*
+// CK4: store i32 [[ZERO]], i32* [[CONV]]
+// CK4: [[ONE:%.+]] = load i64, i64* [[A_CASTED]]
+// CK4: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* [[DEF_LOC]], i32 1, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i64)* [[OMP_OUTLINED:@.+]] to void (i32*, i32*, ...)*), i64 [[ONE]])
+
+// CK4: define internal {{.*}}void [[OMP_OUTLINED]](i32* noalias [[GLOBAL_TID:%.+]], i32* noalias [[BOUND_TID:%.+]], i64 [[A_VAL]])
+// CK4: [[GLOBAL_TID_ADDR:%.+]] = alloca i32*
+// CK4: [[BOUND_TID_ADDR:%.+]] = alloca i32*
+// CK4: [[A_ADDR:%.+]] = alloca i64
+// CK4: store i32* [[GLOBAL_TID]], i32** [[GLOBAL_TID_ADDR]]
+// CK4: store i32* [[BOUND_TID]], i32** [[BOUND_TID_ADDR]]
+// CK4: store i64 [[A_VAL]], i64* [[A_ADDR]]
+// CK4: [[CONV]] = bitcast i64* [[A_ADDR]] to i32*
+// CK4-NOT: __kmpc_global_thread_num
+// CK4: call i32 @__kmpc_master({{.+}})
+// CK4: [[FOUR:%.+]] = load i32, i32* [[CONV]]
+// CK4: [[INC:%.+]] = add nsw i32 [[FOUR]]
+// CK4: store i32 [[INC]], i32* [[CONV]]
+// CK4-NOT: __kmpc_global_thread_num
+// CK4: call void @__kmpc_end_master({{.+}})
+
+#endif
+
+#ifdef CK5
+///==========================================================================///
+// RUN: %clang_cc1 -DCK5 -verify -fopenmp -fopenmp -fnoopenmp-use-tls -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck %s --check-prefix CK5
+// RUN: %clang_cc1 -DCK5 -fopenmp -fopenmp -fnoopenmp-use-tls -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
+// RUN: %clang_cc1 -DCK5 -fopenmp -fopenmp -fnoopenmp-use-tls -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CK5
+
+// RUN: %clang_cc1 -DCK5 -verify -fopenmp-simd -fnoopenmp-use-tls -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DCK5 -fopenmp-simd -fnoopenmp-use-tls -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
+// RUN: %clang_cc1 -DCK5 -fopenmp-simd -fnoopenmp-use-tls -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
+
+// RUN: %clang_cc1 -DCK5 -verify -fopenmp -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -o - | FileCheck %s -check-prefix=TLS-CHECK
+// RUN: %clang_cc1 -DCK5 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -DCK5 -fopenmp -x c++ -triple x86_64-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s -check-prefix=TLS-CHECK
+
+// RUN: %clang_cc1 -DCK5 -verify -fopenmp-simd -x c++ -triple x86_64-unknown -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -DCK5 -fopenmp-simd -x c++ -std=c++11 -triple x86_64-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -DCK5 -fopenmp-simd -x c++ -triple x86_64-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY1 %s
+// SIMD-ONLY1-NOT: {{__kmpc|__tgt}}
+
+// CK5-DAG: %struct.ident_t = type { i32, i32, i32, i32, i8* }
+// CK5-DAG: [[A:@.+]] = {{.+}} i32 0
+// CK5-DAG: [[STR:@.+]] = private unnamed_addr constant [23 x i8] c";unknown;unknown;0;0;;\00"
+// CK5-DAG: [[DEF_LOC_1:@.+]] = private unnamed_addr global %struct.ident_t { i32 0, i32 2, i32 0, i32 0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* [[STR]], i32 0, i32 0) }
+// CK5-DAG: [[A_CACHE:@.+]] = common global i8** null
+// CK5-DAG: [[DEF_LOC_2:@.+]] = private unnamed_addr global %struct.ident_t { i32 0, i32 66, i32 0, i32 0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* [[STR]], i32 0, i32 0) }
+// TLS-CHECK-DAG: %struct.ident_t = type { i32, i32, i32, i32, i8* }
+// TLS-CHECK-DAG: [[A:@.+]] = thread_local global i32 0
+// TLS-CHECK-DAG: [[STR:@.+]] = private unnamed_addr constant [23 x i8] c";unknown;unknown;0;0;;\00"
+// TLS-CHECK-DAG: [[DEF_LOC_1:@.+]] = private unnamed_addr global %struct.ident_t { i32 0, i32 66, i32 0, i32 0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* [[STR]], i32 0, i32 0) }
+// TLS-CHECK-DAG: [[DEF_LOC_2:@.+]] = private unnamed_addr global %struct.ident_t { i32 0, i32 2, i32 0, i32 0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* [[STR]], i32 0, i32 0) }
+
+int a;
+#pragma omp threadprivate(a)
+
+void parallel_master_copyin() {
+#pragma omp parallel master copyin(a)
+ a++;
+}
+
+// CK5-LABEL: define void @{{.+}}parallel_master_copyin{{.+}}
+// CK5: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* [[DEF_LOC_1]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* [[OMP_OUTLINED:@.+]] to void (i32*, i32*, ...)*))
+// CK5: ret void
+// TLS-CHECK-LABEL: define void @{{.+}}parallel_master_copyin{{.+}}
+// TLS-CHECK: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* [[DEF_LOC_2]], i32 1, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32*)* [[OMP_OUTLINED:@.+]] to void (i32*, i32*, ...)*)
+// TLS-CHECK: ret void
+
+// CK5: define internal {{.*}}void [[OMP_OUTLINED]](i32* noalias [[GLOBAL_TID:%.+]], i32* noalias [[BOUND_TID:%.+]])
+// CK5: [[GLOBAL_TID_ADDR:%.+]] = alloca i32*
+// CK5: [[BOUND_TID_ADDR:%.+]] = alloca i32*
+// CK5: store i32* [[GLOBAL_TID]], i32** [[GLOBAL_TID_ADDR]]
+// CK5: store i32* [[BOUND_TID]], i32** [[BOUND_TID_ADDR]]
+// CK5: [[ZERO:%.+]] = load i32*, i32** [[GLOBAL_TID_ADDR]]
+// CK5: [[ONE:%.+]] = load i32, i32* [[ZERO]]
+// CK5: [[TWO:%.+]] = call i8* @__kmpc_threadprivate_cached(%struct.ident_t* [[DEF_LOC_1]], i32 [[ONE]], i8* bitcast (i32* [[A]] to i8*), i64 4, i8*** [[A_CACHE]])
+// CK5: [[THREE:%.+]] = bitcast i8* [[TWO]] to i32*
+// CK5: [[FOUR:%.+]] = ptrtoint i32* [[THREE]] to i64
+// CK5: [[FIVE:%.+]] = icmp ne i64 ptrtoint (i32* [[A]] to i64), [[FOUR]]
+// CK5: br i1 [[FIVE]], label [[COPYIN_NOT_MASTER:%.+]], label [[COPYIN_NOT_MASTER_END:%.+]]
+// TLS-CHECK: define internal {{.*}}void [[OMP_OUTLINED]](i32* noalias [[GLOBAL_TID:%.+]], i32* noalias [[BOUND_TID:%.+]], i32* {{.+}} [[A_VAR:%.+]])
+// TLS-CHECK: [[GLOBAL_TID_ADDR:%.+]] = alloca i32*
+// TLS-CHECK: [[BOUND_TID_ADDR:%.+]] = alloca i32*
+// TLS-CHECK: [[A_ADDR:%.+]] = alloca i32*
+// TLS-CHECK: store i32* [[A_VAR]], i32** [[A_ADDR]]
+// TLS-CHECK: [[ZERO:%.+]] = load i32*, i32** [[A_ADDR]]
+// TLS-CHECK: [[ONE:%.+]] = ptrtoint i32* [[ZERO]] to i64
+// TLS-CHECK: [[TWO:%.+]] = icmp ne i64 [[ONE]], ptrtoint (i32* [[A]] to i64)
+// TLS-CHECK: br i1 [[TWO]], label [[COPYIN_NOT_MASTER:%.+]], label [[COPYIN_NOT_MASTER_END:%.+]]
+
+// CK5-DAG: [[COPYIN_NOT_MASTER]]
+// CK5-DAG: [[SIX:%.+]] = load i32, i32* [[A]]
+// TLS-CHECK-DAG: [[COPYIN_NOT_MASTER]]
+// TLS-CHECK-DAG: [[THREE:%.+]] = load i32, i32* [[ZERO]]
+// TLS-CHECK-DAG: store i32 [[THREE]], i32* [[A]]
+
+// CK5-DAG: [[COPYIN_NOT_MASTER_END]]
+// CK5-DAG: call void @__kmpc_barrier(%struct.ident_t* [[DEF_LOC_2]], i32 [[ONE]])
+// CK5-DAG: [[SEVEN:%.+]] = call i32 @__kmpc_master(%struct.ident_t* [[DEF_LOC_1]], i32 [[ONE]])
+// CK5-DAG: [[EIGHT:%.+]] = icmp ne i32 [[SEVEN]], 0
+// CK5-DAG: br i1 %8, label [[OMP_IF_THEN:%.+]], label [[OMP_IF_END:%.+]]
+// TLS-CHECK-DAG: [[FOUR:%.+]] = load i32*, i32** [[GLOBAL_TID_ADDR:%.+]]
+// TLS-CHECK-DAG: [[FIVE:%.+]] = load i32, i32* [[FOUR]]
+// TLS-CHECK-DAG: call void @__kmpc_barrier(%struct.ident_t* [[DEF_LOC_1]], i32 [[FIVE]])
+// TLS-CHECK-DAG: [[SIX:%.+]] = load i32*, i32** [[GLOBAL_TID_ADDR]]
+// TLS-CHECK-DAG: [[SEVEN:%.+]] = load i32, i32* [[SIX]]
+// TLS-CHECK-DAG: [[EIGHT:%.+]] = call i32 @__kmpc_master(%struct.ident_t* [[DEF_LOC_2]], i32 [[SEVEN]])
+// TLS-CHECK-DAG: [[NINE:%.+]] = icmp ne i32 [[EIGHT]], 0
+// TLS-CHECK-DAG: br i1 [[NINE]], label [[OMP_IF_THEN:%.+]], label [[OMP_IF_END:%.+]]
+
+// CK5-DAG: [[OMP_IF_THEN]]
+// CK5-DAG: [[NINE:%.+]] = call i8* @__kmpc_threadprivate_cached(%struct.ident_t* [[DEF_LOC_1]], i32 %1, i8* bitcast (i32* [[A]] to i8*), i64 4, i8*** [[A_CACHE]])
+// CK5-DAG: [[TEN:%.+]] = bitcast i8* [[NINE]] to i32*
+// CK5-DAG: [[ELEVEN:%.+]] = load i32, i32* [[TEN]]
+// CK5-DAG: [[INC:%.+]] = add nsw i32 [[ELEVEN]], 1
+// CK5-DAG: store i32 [[INC]], i32* [[TEN]]
+// CK5-DAG: call void @__kmpc_end_master(%struct.ident_t* [[DEF_LOC_1]], i32 [[ONE]])
+// CK5-DAG: [[OMP_IF_END]]
+// CK5-DAG: ret void
+
+// TLS-CHECK-DAG: [[OMP_IF_THEN]]
+// TLS-CHECK-DAG: [[TEN:%.+]] = load i32, i32* [[A]]
+// TLC-CHECK-DAG: [[INC:%.+]] = add nsw i32 [[TEN]], 1
+// TLC-CHECK-DAG: store i32 [[INC]], i32* [[TEN]]
+// TLS-CHECK-DAG: call void @__kmpc_end_master(%struct.ident_t* [[DEF_LOC_2]], i32 [[SEVEN]])
+// TLS-CHECK-DAG: [[OMP_IF_END]]
+// TLS-CHECK-DAG: ret void
+
+#endif
+#ifdef CK6
+///==========================================================================///
+// RUN: %clang_cc1 -DCK6 -verify -fopenmp -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -o - | FileCheck %s -check-prefix=CK6
+// RUN: %clang_cc1 -DCK6 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -DCK6 -fopenmp -x c++ -triple x86_64-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s -check-prefix=CK6
+
+// RUN: %clang_cc1 -DCK6 -verify -fopenmp-simd -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -DCK6 -fopenmp-simd -x c++ -std=c++11 -triple x86_64-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -DCK6 -fopenmp-simd -x c++ -triple x86_64-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY1 %s
+// SIMD-ONLY1-NOT: {{__kmpc|__tgt}}
+
+// CK6-DAG: %struct.ident_t = type { i32, i32, i32, i32, i8* }
+// CK6-DAG: [[STR:@.+]] = private unnamed_addr constant [23 x i8] c";unknown;unknown;0;0;;\00"
+// CK6-DAG: [[DEF_LOC_1:@.+]] = private unnamed_addr global %struct.ident_t { i32 0, i32 2, i32 0, i32 0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* [[STR]], i32 0, i32 0) }
+// CK6-DAG: [[GOMP:@.+]] = common global [8 x i32] zeroinitializer
+// CK6-DAG: [[DEF_LOC_2:@.+]] = private unnamed_addr global %struct.ident_t { i32 0, i32 18, i32 0, i32 0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* [[STR]], i32 0, i32 0) }
+
+void parallel_master_reduction() {
+ int g;
+#pragma omp parallel master reduction(+:g)
+ g = 1;
+}
+
+// CK6-LABEL: define void @{{.+}}parallel_master_reduction{{.+}}
+// CK6: [[G_VAR:%.+]] = alloca i32
+// CK6: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* [[DEF_LOC_1]], i32 1, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32*)* [[OMP_OUTLINED:@.+]] to void (i32*, i32*, ...)*), i32* [[G_VAR]])
+// CK6: ret void
+
+// CK6: define internal void [[OMP_OUTLINED]](i32* noalias [[GLOBAL_TID:%.+]], i32* noalias [[BOUND_TID:%.+]], i32* {{.+}} [[G_VAR]])
+// CK6: [[GTID_ADDR:%.+]] = alloca i32*
+// CK6: [[BTID_ADDR:%.+]] = alloca i32*
+// CK6: [[G_ADDR:%.+]] = alloca i32*
+// CK6: [[G_1:%.+]] = alloca i32
+// CK6: [[RED_LIST:%.+]] = alloca [1 x i8*]
+// CK6: [[ZERO:%.+]] = load i32*, i32** [[G_ADDR]]
+// CK6: [[ONE:%.+]] = load i32*, i32** [[GTID_ADDR]]
+// CK6: [[TWO:%.+]] = load i32, i32* [[ONE]]
+// CK6: [[THREE:%.+]] = call i32 @__kmpc_master(%struct.ident_t* [[DEF_LOC_1]], i32 [[TWO]])
+// CK6: [[FOUR:%.+]] = icmp ne i32 [[THREE]]
+
+// CK6: store i32 1, i32* [[G_1]]
+// CK6: call void @__kmpc_end_master(%struct.ident_t* [[DEF_LOC_1]], i32 [[TWO]])
+
+// CK6: [[FIVE:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[RED_LIST]], i64 0, i64 0
+// CK6: [[SEVEN:%.+]] = bitcast [1 x i8*]* [[RED_LIST]] to i8*
+// CK6: [[EIGHT:%.+]] = call i32 @__kmpc_reduce_nowait(%struct.ident_t* [[DEF_LOC_2]], i32 [[TWO]], i32 1, i64 8, i8* [[SEVEN]], void (i8*, i8*)* [[RED_FUNC:@.+]], [8 x i32]* [[RED_VAR:@.+]])
+
+// switch
+// CK6: switch i32 [[EIGHT]], label [[RED_DEFAULT:%.+]] [
+// CK6: i32 1, label [[CASE1:%.+]]
+// CK6: i32 2, label [[CASE2:%.+]]
+
+// case 1:
+// CK6: [[NINE:%.+]] = load i32, i32* %0, align 4
+// CK6: [[TEN:%.+]] = load i32, i32* [[G_1]]
+// CK6: [[ADD:%.+]] = add nsw i32 [[NINE]], [[TEN]]
+// CK6: store i32 [[ADD]], i32* [[ZERO]]
+// CK6: call void @__kmpc_end_reduce_nowait(%struct.ident_t* [[DEF_LOC_2]], i32 [[TWO]], [8 x i32]* [[GOMP]])
+// CK6: br label [[RED_DEFAULT]]
+
+// case 2:
+// CK6: [[ELEVEN:%.+]] = load i32, i32* [[G_1]]
+// CK6: [[TWELVE:%.+]] = atomicrmw add i32* [[ZERO]], i32 [[ELEVEN]] monotonic
+
+// CK6: define internal void [[RED_FUNC]](i8* [[ZERO]], i8* [[ONE]])
+// CK6: ret void
+#endif
+#ifdef CK7
+///==========================================================================///
+// RUN: %clang_cc1 -DCK7 -verify -fopenmp -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck %s --check-prefix CK7
+// RUN: %clang_cc1 -DCK7 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
+// RUN: %clang_cc1 -DCK7 -fopenmp -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CK7
+
+// RUN: %clang_cc1 -DCK7 -verify -fopenmp-simd -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DCK7 -fopenmp-simd -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
+// RUN: %clang_cc1 -DCK7 -fopenmp-simd -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
+
+// CK7-DAG: %struct.ident_t = type { i32, i32, i32, i32, i8* }
+// CK7-DAG: [[STR:@.+]] = private unnamed_addr constant [23 x i8] c";unknown;unknown;0;0;;\00"
+// CK7-DAG: [[DEF_LOC_1:@.+]] = private unnamed_addr global %struct.ident_t { i32 0, i32 2, i32 0, i32 0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* [[STR]], i32 0, i32 0) }
+
+void parallel_master_if() {
+#pragma omp parallel master if (parallel: false)
+ parallel_master_if();
+}
+
+// CK7-LABEL: parallel_master_if
+// CK7: [[ZERO:%.+]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* [[DEF_LOC_1]])
+// CK7: call void @__kmpc_serialized_parallel(%struct.ident_t* [[DEF_LOC_1]], i32 [[ZERO]])
+// CK7: call void [[OUTLINED:@.+]](i32* [[THREAD_TEMP:%.+]], i32* [[BND_ADDR:%.+]])
+// CK7: call void @__kmpc_end_serialized_parallel(%struct.ident_t* [[DEF_LOC_1]], i32 [[ZERO]])
+// CK7: ret void
+
+// CK7: define internal void @.omp_outlined.(i32* noalias [[GTID:%.+]], i32* noalias [[BTID:%.+]])
+// CK7: [[EXECUTE:%.+]] = call i32 @__kmpc_master(%struct.ident_t* @0, i32 %1)
+// CK7: call void @__kmpc_end_master(%struct.ident_t* [[DEF_LOC_1]], i32 %1)
+
+#endif
+#ifdef CK8
+///==========================================================================///
+// RUN: %clang_cc1 -DCK8 -verify -fopenmp -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck %s --check-prefix CK8
+// RUN: %clang_cc1 -DCK8 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
+// RUN: %clang_cc1 -DCK8 -fopenmp -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CK8
+
+// RUN: %clang_cc1 -DCK8 -verify -fopenmp-simd -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DCK8 -fopenmp-simd -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
+// RUN: %clang_cc1 -DCK8 -fopenmp-simd -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
+
+typedef __INTPTR_TYPE__ intptr_t;
+
+// CK8-DAG: [[IDENT_T_TY:%.+]] = type { i32, i32, i32, i32, i8* }
+// CK8-DAG: [[STR:@.+]] = private unnamed_addr constant [23 x i8] c";unknown;unknown;0;0;;\00"
+// CK8-DAG: [[DEF_LOC_2:@.+]] = private unnamed_addr global [[IDENT_T_TY]] { i32 0, i32 2, i32 0, i32 0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* [[STR]], i32 0, i32 0) }
+
+void foo();
+
+struct S {
+ intptr_t a, b, c;
+ S(intptr_t a) : a(a) {}
+ operator char() { return a; }
+ ~S() {}
+};
+
+template <typename T>
+T tmain() {
+#pragma omp parallel master proc_bind(master)
+ foo();
+ return T();
+}
+
+int main() {
+#pragma omp parallel master proc_bind(spread)
+ foo();
+#pragma omp parallel master proc_bind(close)
+ foo();
+ return tmain<int>();
+}
+
+// CK8-LABEL: @main
+// CK8: [[GTID:%.+]] = call {{.*}}i32 @__kmpc_global_thread_num([[IDENT_T_TY]]* [[DEF_LOC_2]])
+// CK8: call {{.*}}void @__kmpc_push_proc_bind([[IDENT_T_TY]]* [[DEF_LOC_2]], i32 [[GTID]], i32 4)
+// CK8: call {{.*}}void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(
+// CK8: call {{.*}}void @__kmpc_push_proc_bind([[IDENT_T_TY]]* [[DEF_LOC_2]], i32 [[GTID]], i32 3)
+// CK8: call {{.*}}void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(
+
+// CK8-LABEL: @{{.+}}tmain
+// CK8: [[GTID:%.+]] = call {{.*}}i32 @__kmpc_global_thread_num([[IDENT_T_TY]]* [[DEF_LOC_2]])
+// CK8: call {{.*}}void @__kmpc_push_proc_bind([[IDENT_T_TY]]* [[DEF_LOC_2]], i32 [[GTID]], i32 2)
+// CK8: call {{.*}}void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(
+// CK8: ret i32 0
+// CK8-NEXT: }
+
+// CK8: call i32 @__kmpc_master(%struct.ident_t* [[DEF_LOC_2]], i32 [[ONE:%.+]])
+// CK8: call void @__kmpc_end_master(%struct.ident_t* [[DEF_LOC_2]], i32 [[ONE]])
+
+#endif
+#ifdef CK9
+// CK9-DAG: %struct.ident_t = type { i32, i32, i32, i32, i8* }
+// CK9-DAG: [[STR:@.+]] = private unnamed_addr constant [23 x i8] c";unknown;unknown;0;0;;\00"
+// CK9-DAG: [[DEF_LOC:@.+]] = private unnamed_addr global %struct.ident_t { i32 0, i32 2, i32 0, i32 0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* [[STR]], i32 0, i32 0) }
+
+void parallel_master_allocate() {
+ int a;
+#pragma omp parallel master firstprivate(a) allocate(a)
+ a++;
+}
+
+// CK9-LABEL: define void @{{.+}}parallel_master_allocate{{.+}}
+// CK9: [[A_VAL:%.+]] = alloca i32
+// CK9: [[A_CASTED:%.+]] = alloca i64
+// CK9: [[ZERO:%.+]] = load i32, i32* [[A_VAL]]
+// CK9: [[CONV:%.+]] = bitcast i64* [[A_CASTED]] to i32*
+// CK9: store i32 [[ZERO]], i32* [[CONV]]
+// CK9: [[ONE:%.+]] = load i64, i64* [[A_CASTED]]
+// CK9: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* [[DEF_LOC]], i32 1, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i64)* [[OMP_OUTLINED:@.+]] to void (i32*, i32*, ...)*), i64 [[ONE]])
+
+// CK9: define internal {{.*}}void [[OMP_OUTLINED]](i32* noalias [[GLOBAL_TID:%.+]], i32* noalias [[BOUND_TID:%.+]], i64 [[A_VAL]])
+// CK9: [[GLOBAL_TID_ADDR:%.+]] = alloca i32*
+// CK9: [[BOUND_TID_ADDR:%.+]] = alloca i32*
+// CK9: [[A_ADDR:%.+]] = alloca i64
+// CK9: store i32* [[GLOBAL_TID]], i32** [[GLOBAL_TID_ADDR]]
+// CK9: store i32* [[BOUND_TID]], i32** [[BOUND_TID_ADDR]]
+// CK9: store i64 [[A_VAL]], i64* [[A_ADDR]]
+// CK9: [[CONV]] = bitcast i64* [[A_ADDR]] to i32*
+// CK9-NOT: __kmpc_global_thread_num
+// CK9: call i32 @__kmpc_master({{.+}})
+// CK9: [[FOUR:%.+]] = load i32, i32* [[CONV]]
+// CK9: [[INC:%.+]] = add nsw i32 [[FOUR]]
+// CK9: store i32 [[INC]], i32* [[CONV]]
+// CK9-NOT: __kmpc_global_thread_num
+// CK9: call void @__kmpc_end_master({{.+}})
+#endif
+#endif
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_copyin_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_copyin_messages.cpp
new file mode 100644
index 0000000..8eda887
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_copyin_messages.cpp
@@ -0,0 +1,115 @@
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+struct S1; // expected-note {{declared here}}
+class S2 {
+ mutable int a;
+
+public:
+ S2() : a(0) {}
+ S2 &operator=(S2 &s2) { return *this; }
+};
+class S3 {
+ int a;
+
+public:
+ S3() : a(0) {}
+ S3 &operator=(S3 &s3) { return *this; }
+};
+class S4 {
+ int a;
+ S4();
+ S4 &operator=(const S4 &s4); // expected-note {{implicitly declared private here}}
+
+public:
+ S4(int v) : a(v) {}
+};
+class S5 {
+ int a;
+ S5() : a(0) {}
+ S5 &operator=(const S5 &s5) { return *this; } // expected-note {{implicitly declared private here}}
+
+public:
+ S5(int v) : a(v) {}
+};
+template <class T>
+class ST {
+public:
+ static T s;
+};
+
+S2 k;
+S3 h;
+S4 l(3);
+S5 m(4);
+#pragma omp threadprivate(h, k, l, m)
+
+namespace A {
+double x;
+#pragma omp threadprivate(x)
+}
+namespace B {
+using A::x;
+}
+
+int main(int argc, char **argv) {
+ int i;
+#pragma omp parallel master copyin // expected-error {{expected '(' after 'copyin'}}
+ {
+ foo();
+ }
+#pragma omp parallel master copyin( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ {
+ foo();
+ }
+#pragma omp parallel master copyin() // expected-error {{expected expression}}
+ {
+ foo();
+ }
+#pragma omp parallel master copyin(k // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ {
+ foo();
+ }
+#pragma omp parallel master copyin(h, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ {
+ foo();
+ }
+#pragma omp parallel master copyin(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
+ {
+ foo();
+ }
+#pragma omp parallel master copyin(l) // expected-error {{'operator=' is a private member of 'S4'}}
+ {
+ foo();
+ }
+#pragma omp parallel master copyin(S1) // expected-error {{'S1' does not refer to a value}}
+ {
+ foo();
+ }
+#pragma omp parallel master copyin(argv[1]) // expected-error {{expected variable name}}
+ {
+ foo();
+ }
+#pragma omp parallel master copyin(i) // expected-error {{copyin variable must be threadprivate}}
+ {
+ foo();
+ }
+#pragma omp parallel master copyin(m) // expected-error {{'operator=' is a private member of 'S5'}}
+ {
+ foo();
+ }
+#pragma omp parallel master copyin(ST < int > ::s, B::x) // expected-error {{copyin variable must be threadprivate}}
+ {
+ foo();
+ }
+
+ return 0;
+}
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_default_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_default_messages.cpp
new file mode 100644
index 0000000..557cba5
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_default_messages.cpp
@@ -0,0 +1,41 @@
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
+
+void foo();
+
+int main(int argc, char **argv) {
+#pragma omp parallel master default // expected-error {{expected '(' after 'default'}}
+ {
+#pragma omp parallel master default( // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ {
+#pragma omp parallel master default() // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}}
+ {
+#pragma omp parallel master default(none // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ {
+#pragma omp parallel master default(shared), default(shared) // expected-error {{directive '#pragma omp parallel master' cannot contain more than one 'default' clause}}
+ {
+#pragma omp parallel master default(x) // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}}
+ {
+ foo();
+ }
+ }
+ }
+ }
+ }
+ }
+
+#pragma omp parallel master default(none) // expected-note {{explicit data sharing attribute requested here}}
+ {
+ ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
+ }
+
+#pragma omp parallel master default(none) // expected-note {{explicit data sharing attribute requested here}}
+ {
+#pragma omp parallel master default(shared)
+ {
+ ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
+ }
+ }
+ return 0;
+}
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_firstprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_firstprivate_messages.cpp
new file mode 100644
index 0000000..fb3158c
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_firstprivate_messages.cpp
@@ -0,0 +1,320 @@
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+
+extern int omp_default_mem_alloc;
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp parallel master firstprivate(fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ {
+ for (int i = 0; i < 10; ++i)
+ ;
+ }
+}
+
+struct S1; // expected-note 2 {{declared here}} expected-note 2 {{forward declaration of 'S1'}}
+extern S1 a;
+class S2 {
+ mutable int a;
+
+public:
+ S2() : a(0) {}
+ S2(const 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;
+ S3 &operator=(const S3 &s3);
+
+public:
+ S3() : a(0) {}
+ S3(const 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); // expected-note 2 {{implicitly declared private here}}
+
+public:
+ S4(int v) : a(v) {}
+};
+class S5 {
+ int a;
+ S5(const S5 &s5) : a(s5.a) {} // expected-note 4 {{implicitly declared private here}}
+
+public:
+ S5() : a(0) {}
+ S5(int v) : a(v) {}
+};
+class S6 {
+ int a;
+ S6() : a(0) {}
+
+public:
+ S6(const S6 &s6) : a(s6.a) {}
+ S6(int v) : a(v) {}
+};
+
+S3 h;
+#pragma omp threadprivate(h) // expected-note 2 {{defined as threadprivate or thread local}}
+
+template <class I, class C>
+int foomain(int argc, char **argv) {
+ I e(4);
+ C g(5);
+ int i, z;
+ int &j = i;
+#pragma omp parallel master firstprivate // expected-error {{expected '(' after 'firstprivate'}}
+ {
+ foo();
+ }
+#pragma omp parallel master firstprivate( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ {
+ foo();
+ }
+#pragma omp parallel master firstprivate() // expected-error {{expected expression}}
+ {
+ foo();
+ }
+#pragma omp parallel master firstprivate(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ {
+ foo();
+ }
+#pragma omp parallel master firstprivate(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ {
+ foo();
+ }
+#pragma omp parallel master firstprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
+ {
+ foo();
+ }
+#pragma omp parallel master firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
+ {
+ foo();
+ }
+#pragma omp parallel master firstprivate(S1) // expected-error {{'S1' does not refer to a value}}
+ {
+ foo();
+ }
+#pragma omp parallel master firstprivate(z, a, b) // expected-error {{firstprivate variable with incomplete type 'S1'}}
+ {
+ foo();
+ }
+#pragma omp parallel master firstprivate(argv[1]) // expected-error {{expected variable name}}
+ {
+ foo();
+ }
+#pragma omp parallel master firstprivate(e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}}
+ {
+ foo();
+ }
+#pragma omp parallel master firstprivate(h) // expected-error {{threadprivate or thread local variable cannot be firstprivate}}
+ {
+ foo();
+ }
+#pragma omp parallel master linear(i) // expected-error {{unexpected OpenMP clause 'linear' in directive '#pragma omp parallel master'}}
+ {
+ foo();
+ }
+#pragma omp parallel
+ {
+ int v = 0;
+ int i;
+#pragma omp parallel master firstprivate(i)
+ {
+ foo();
+ }
+ v += i;
+ }
+#pragma omp parallel shared(i)
+#pragma omp parallel private(i)
+#pragma omp parallel master firstprivate(j)
+ {
+ foo();
+ }
+#pragma omp parallel master firstprivate(i)
+ {
+ foo();
+ }
+#pragma omp parallel master firstprivate(g) // expected-error {{calling a private constructor of class 'S5'}}
+ {
+ foo();
+ }
+#pragma omp parallel private(i)
+#pragma omp parallel master firstprivate(i)
+ {
+ foo();
+ }
+#pragma omp parallel reduction(+ : i)
+#pragma omp parallel master firstprivate(i)
+ {
+ foo();
+ }
+ return 0;
+}
+
+namespace A {
+double x;
+#pragma omp threadprivate(x) // expected-note {{defined as threadprivate or thread local}}
+}
+namespace B {
+using A::x;
+}
+
+int main(int argc, char **argv) {
+ const int d = 5;
+ const int da[5] = {0};
+ S4 e(4);
+ S5 g(5);
+ S3 m;
+ S6 n(2);
+ int i, z;
+ int &j = i;
+#pragma omp parallel master firstprivate // expected-error {{expected '(' after 'firstprivate'}}
+ {
+ foo();
+ }
+#pragma omp parallel master firstprivate( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ {
+ foo();
+ }
+#pragma omp parallel master firstprivate() // expected-error {{expected expression}}
+ {
+ foo();
+ }
+#pragma omp parallel master firstprivate(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ {
+ foo();
+ }
+#pragma omp parallel master firstprivate(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ {
+ foo();
+ }
+#pragma omp parallel master firstprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
+ {
+ foo();
+ }
+#pragma omp parallel master firstprivate(argc, z)
+ {
+ foo();
+ }
+#pragma omp parallel master firstprivate(S1) // expected-error {{'S1' does not refer to a value}}
+ {
+ foo();
+ }
+#pragma omp parallel master firstprivate(a, b, c, d, f) // expected-error {{firstprivate variable with incomplete type 'S1'}}
+ {
+ foo();
+ }
+#pragma omp parallel master firstprivate(argv[1]) // expected-error {{expected variable name}}
+ {
+ foo();
+ }
+#pragma omp parallel master firstprivate(2 * 2) // expected-error {{expected variable name}}
+ {
+ foo();
+ }
+#pragma omp parallel master firstprivate(ba) // OK
+ {
+ foo();
+ }
+#pragma omp parallel master firstprivate(ca) // OK
+ {
+ foo();
+ }
+#pragma omp parallel master firstprivate(da) // OK
+ {
+ foo();
+ }
+ int xa;
+#pragma omp parallel master firstprivate(xa) // OK
+ {
+ foo();
+ }
+#pragma omp parallel master firstprivate(S2::S2s) // OK
+ {
+ foo();
+ }
+#pragma omp parallel master firstprivate(S2::S2sc) // OK
+ {
+ foo();
+ }
+#pragma omp parallel master safelen(5) // expected-error {{unexpected OpenMP clause 'safelen' in directive '#pragma omp parallel master'}}
+ {
+ foo();
+ }
+#pragma omp parallel master firstprivate(e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}}
+ {
+ foo();
+ }
+#pragma omp parallel master firstprivate(m) // OK
+ {
+ foo();
+ }
+#pragma omp parallel master firstprivate(h, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be firstprivate}}
+ {
+ foo();
+ }
+#pragma omp parallel master private(xa), firstprivate(xa) // expected-error {{private variable cannot be firstprivate}} expected-note {{defined as private}}
+ {
+ foo();
+ }
+#pragma omp parallel shared(xa)
+#pragma omp parallel master firstprivate(xa) // OK: may be firstprivate
+ {
+ foo();
+ }
+#pragma omp parallel master firstprivate(j)
+ {
+ foo();
+ }
+#pragma omp parallel master firstprivate(g) // expected-error {{calling a private constructor of class 'S5'}}
+ {
+ foo();
+ }
+#pragma omp parallel master firstprivate(n) // OK
+ {
+ foo();
+ }
+#pragma omp parallel
+ {
+ int v = 0;
+ int i;
+#pragma omp parallel master firstprivate(i)
+ {
+ foo();
+ }
+ v += i;
+ }
+#pragma omp parallel private(i)
+#pragma omp parallel master firstprivate(i)
+ {
+ foo();
+ }
+#pragma omp parallel reduction(+ : i)
+#pragma omp parallel master firstprivate(i)
+ {
+ foo();
+ }
+ static int r;
+#pragma omp parallel master firstprivate(r) // OK
+ {
+ foo();
+ }
+
+ return foomain<S4, S5>(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<S4, S5>' requested here}}
+}
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_if_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_if_messages.cpp
new file mode 100644
index 0000000..dd15686
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_if_messages.cpp
@@ -0,0 +1,173 @@
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+void xxx(int argc) {
+ int cond; // expected-note {{initialize the variable 'cond' to silence this warning}}
+#pragma omp parallel master if(cond) // expected-warning {{variable 'cond' is uninitialized when used here}}
+ {
+ ;
+ }
+}
+
+struct S1; // expected-note {{declared here}}
+
+template <class T, class S> // expected-note {{declared here}}
+int tmain(T argc, S **argv) {
+ T z;
+ #pragma omp parallel master if // expected-error {{expected '(' after 'if'}}
+ {
+ foo();
+ }
+ #pragma omp parallel master if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ {
+ foo();
+ }
+ #pragma omp parallel master if () // expected-error {{expected expression}}
+ {
+ foo();
+ }
+ #pragma omp parallel master if (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ {
+ foo();
+ }
+ #pragma omp parallel master if (argc)) // expected-warning {{extra tokens at the end of '#pragma omp parallel master' are ignored}}
+ {
+ foo();
+ }
+ #pragma omp parallel master if (argc > 0 ? argv[1] : argv[2])
+ {
+ foo();
+ }
+ #pragma omp parallel master if (foobool(argc)), if (true) // expected-error {{directive '#pragma omp parallel master' cannot contain more than one 'if' clause}}
+ {
+ foo();
+ }
+ #pragma omp parallel master if (S) // expected-error {{'S' does not refer to a value}}
+ {
+ foo();
+ }
+ #pragma omp parallel master if (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ {
+ foo();
+ }
+ #pragma omp parallel master if (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ {
+ foo();
+ }
+ #pragma omp parallel master if(argc + z)
+ {
+ foo();
+ }
+ #pragma omp parallel master if(parallel : // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ {
+ foo();
+ }
+ #pragma omp parallel master if(parallel : argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ {
+ foo();
+ }
+ #pragma omp parallel master if(parallel : argc)
+ {
+ foo();
+ }
+ #pragma omp parallel master if(parallel : argc) if (for:argc) // expected-error {{directive name modifier 'for' is not allowed for '#pragma omp parallel master'}}
+ {
+ foo();
+ }
+ #pragma omp parallel master if(parallel : argc) if (parallel:argc) // expected-error {{directive '#pragma omp parallel master' cannot contain more than one 'if' clause with 'parallel' name modifier}}
+ {
+ foo();
+ }
+ #pragma omp parallel master if(parallel : argc) if (argc) // expected-error {{no more 'if' clause is allowed}} expected-note {{previous clause with directive name modifier specified here}}
+ {
+ foo();
+ }
+
+ return 0;
+}
+
+int main(int argc, char **argv) {
+ int z;
+ #pragma omp parallel master if // expected-error {{expected '(' after 'if'}}
+ {
+ foo();
+ }
+ #pragma omp parallel master if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ {
+ foo();
+ }
+ #pragma omp parallel master if () // expected-error {{expected expression}}
+ {
+ foo();
+ }
+ #pragma omp parallel master if (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ {
+ foo();
+ }
+ #pragma omp parallel master if (argc)) // expected-warning {{extra tokens at the end of '#pragma omp parallel master' are ignored}}
+ {
+ foo();
+ }
+ #pragma omp parallel master if (argc > 0 ? argv[1] : argv[2] + z)
+ {
+ foo();
+ }
+ #pragma omp parallel master if (foobool(argc)), if (true) // expected-error {{directive '#pragma omp parallel master' cannot contain more than one 'if' clause}}
+ {
+ foo();
+ }
+ #pragma omp parallel master if (S1) // expected-error {{'S1' does not refer to a value}}
+ {
+ foo();
+ }
+ #pragma omp parallel master if (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ {
+ foo();
+ }
+ #pragma omp parallel master if (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ {
+ foo();
+ }
+ #pragma omp parallel master if (1 0) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ {
+ foo();
+ }
+ #pragma omp parallel master if(if(tmain(argc, argv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ {
+ foo();
+ }
+ #pragma omp parallel master if(parallel : // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ {
+ foo();
+ }
+ #pragma omp parallel master if(parallel : argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ {
+ foo();
+ }
+ #pragma omp parallel master if(parallel : argc)
+ {
+ foo();
+ }
+ #pragma omp parallel master if(parallel : argc) if (for:argc) // expected-error {{directive name modifier 'for' is not allowed for '#pragma omp parallel master'}}
+ {
+ foo();
+ }
+ #pragma omp parallel master if(parallel : argc) if (parallel:argc) // expected-error {{directive '#pragma omp parallel master' cannot contain more than one 'if' clause with 'parallel' name modifier}}
+ {
+ foo();
+ }
+ #pragma omp parallel master if(parallel : argc) if (argc) // expected-error {{no more 'if' clause is allowed}} expected-note {{previous clause with directive name modifier specified here}}
+ {
+ foo();
+ }
+
+ return tmain(argc, argv);
+}
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_message.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_message.cpp
new file mode 100644
index 0000000..4b89755
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_message.cpp
@@ -0,0 +1,88 @@
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+
+void xxx(int argc) {
+ int x; // expected-note {{initialize the variable 'x' to silence this warning}}
+#pragma omp parallel master
+ argc = x; // expected-warning {{variable 'x' is uninitialized when used here}}
+}
+
+#pragma omp parallel master // expected-error {{unexpected OpenMP directive '#pragma omp parallel master'}}
+
+int foo() {
+ return 0;
+}
+
+int a;
+struct S;
+S& bar();
+int main(int argc, char **argv) {
+ #pragma omp parallel master nowait // expected-error {{unexpected OpenMP clause 'nowait' in directive '#pragma omp parallel master'}}
+ #pragma omp parallel master unknown // expected-warning {{extra tokens at the end of '#pragma omp parallel master' are ignored}}
+ foo();
+ {
+ #pragma omp master
+ } // expected-error {{expected statement}}
+ {
+ #pragma omp parallel master
+ } // expected-error {{expected statement}}
+
+ S &s = bar();
+ #pragma omp parallel master
+ (void)&s;
+ #pragma omp parallel master { // expected-warning {{extra tokens at the end of '#pragma omp parallel master' are ignored}}
+ foo();
+ #pragma omp parallel master ( // expected-warning {{extra tokens at the end of '#pragma omp parallel master' are ignored}}
+ foo();
+ #pragma omp parallel master [ // expected-warning {{extra tokens at the end of '#pragma omp parallel master' are ignored}}
+ foo();
+ #pragma omp parallel master ] // expected-warning {{extra tokens at the end of '#pragma omp parallel master' are ignored}}
+ foo();
+ #pragma omp parallel master ) // expected-warning {{extra tokens at the end of '#pragma omp parallel master' are ignored}}
+ foo();
+ #pragma omp parallel master } // expected-warning {{extra tokens at the end of '#pragma omp parallel master' are ignored}}
+ foo();
+ #pragma omp parallel master
+ // expected-warning@+1 {{extra tokens at the end of '#pragma omp parallel master' are ignored}}
+ #pragma omp parallel master unknown()
+ foo();
+ L1:
+ foo();
+ #pragma omp parallel master
+ ;
+ #pragma omp parallel master
+ {
+
+ for (int i = 0; i < 10; ++i) {
+ switch(argc) {
+ case (0):
+ #pragma omp parallel master
+ {
+ foo();
+ break; // expected-error {{'break' statement not in loop or switch statement}}
+ continue; // expected-error {{'continue' statement not in loop statement}}
+ }
+ default:
+ break;
+ }
+ }
+ goto L1; // expected-error {{use of undeclared label 'L1'}}
+ argc++;
+ }
+#pragma omp parallel master default(none) // expected-note 2 {{explicit data sharing attribute requested here}}
+ {
+ ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
+ ++a; // expected-error {{variable 'a' must have explicitly specified data sharing attributes}}
+ }
+
+ goto L2; // expected-error {{use of undeclared label 'L2'}}
+ #pragma omp parallel master
+ L2:
+ foo();
+ #pragma omp parallel master
+ {
+ return 1; // expected-error {{cannot return from OpenMP region}}
+ }
+ return 0;
+}
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_num_threads_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_num_threads_messages.cpp
new file mode 100644
index 0000000..601164f
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_num_threads_messages.cpp
@@ -0,0 +1,67 @@
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+struct S1; // expected-note {{declared here}}
+
+template <class T, typename S, int N> // expected-note {{declared here}}
+T tmain(T argc, S **argv) {
+ T z;
+ #pragma omp parallel master num_threads // expected-error {{expected '(' after 'num_threads'}}
+ {foo();}
+ #pragma omp parallel master num_threads ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ {foo();}
+ #pragma omp parallel master num_threads () // expected-error {{expected expression}}
+ {foo();}
+ #pragma omp parallel master num_threads (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ {foo();}
+ #pragma omp parallel master num_threads (argc)) // expected-warning {{extra tokens at the end of '#pragma omp parallel master' are ignored}}
+ {foo();}
+ #pragma omp parallel master num_threads ((argc > 0) ? argv[1] : argv[2]) // expected-error 2 {{expression must have integral or unscoped enumeration type, not 'char *'}}
+ {foo();}
+ #pragma omp parallel master num_threads (foobool(argc)), num_threads (true), num_threads (-5) // expected-error 2 {{directive '#pragma omp parallel master' cannot contain more than one 'num_threads' clause}} expected-error {{argument to 'num_threads' clause must be a strictly positive integer value}}
+ {foo();}
+ #pragma omp parallel master num_threads (S) // expected-error {{'S' does not refer to a value}}
+ {foo();}
+ #pragma omp parallel master num_threads (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error 2 {{expression must have integral or unscoped enumeration type, not 'char *'}}
+ {foo();}
+ #pragma omp parallel master num_threads (argc + z)
+ {foo();}
+ #pragma omp parallel master num_threads (N) // expected-error {{argument to 'num_threads' clause must be a strictly positive integer value}}
+ {foo();}
+
+ return argc;
+}
+
+int main(int argc, char **argv) {
+ int z;
+ #pragma omp parallel master num_threads // expected-error {{expected '(' after 'num_threads'}}
+ {foo();}
+ #pragma omp parallel master num_threads ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ {foo();}
+ #pragma omp parallel master num_threads () // expected-error {{expected expression}}
+ {foo();}
+ #pragma omp parallel master num_threads (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ {foo();}
+ #pragma omp parallel master num_threads (argc / z)) // expected-warning {{extra tokens at the end of '#pragma omp parallel master' are ignored}}
+ {foo();}
+ #pragma omp parallel master num_threads (argc > 0 ? argv[1] : argv[2]) // expected-error {{integral }}
+ {foo();}
+ #pragma omp parallel master num_threads (foobool(argc)), num_threads (true), num_threads (-5) // expected-error 2 {{directive '#pragma omp parallel master' cannot contain more than one 'num_threads' clause}} expected-error {{argument to 'num_threads' clause must be a strictly positive integer value}}
+ {foo();}
+ #pragma omp parallel master num_threads (S1) // expected-error {{'S1' does not refer to a value}}
+ {foo();}
+ #pragma omp parallel master num_threads (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
+ {foo();}
+ #pragma omp parallel master num_threads (num_threads(tmain<int, char, -1>(argc, argv) // expected-error 2 {{expected ')'}} expected-note 2 {{to match this '('}} expected-note {{in instantiation of function template specialization 'tmain<int, char, -1>' requested here}}
+ {foo();}
+
+ return tmain<int, char, 3>(argc, argv); // expected-note {{in instantiation of function template specialization 'tmain<int, char, 3>' requested here}}
+}
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_private_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_private_messages.cpp
new file mode 100644
index 0000000..2e21a1a
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_private_messages.cpp
@@ -0,0 +1,284 @@
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+
+extern int omp_default_mem_alloc;
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+struct S1; // expected-note 2 {{declared here}} expected-note 2 {{forward declaration of 'S1'}}
+extern S1 a;
+class S2 {
+ mutable int a;
+
+public:
+ S2() : a(0) {}
+};
+const S2 b;
+const S2 ba[5];
+class S3 {
+ int a;
+
+public:
+ S3() : a(0) {}
+};
+const S3 ca[5];
+class S4 {
+ int a;
+ S4(); // expected-note {{implicitly declared private here}}
+
+public:
+ S4(int v) : a(v) {
+#pragma omp parallel master private(a) private(this->a)
+ {
+ for (int k = 0; k < v; ++k)
+ ++this->a;
+ }
+ }
+};
+class S5 {
+ int a;
+ S5() : a(0) {} // expected-note {{implicitly declared private here}}
+
+public:
+ S5(int v) : a(v) {}
+ S5 &operator=(S5 &s) {
+#pragma omp parallel master private(a) private(this->a) private(s.a) // expected-error {{expected variable name or data member of current class}}
+ {
+ for (int k = 0; k < s.a; ++k)
+ ++s.a;
+ }
+ return *this;
+ }
+};
+
+template <typename T>
+class S6 {
+public:
+ T a;
+
+ S6() : a(0) {}
+ S6(T v) : a(v) {
+#pragma omp parallel master private(a) private(this->a)
+ {
+ for (int k = 0; k < v; ++k)
+ ++this->a;
+ }
+ }
+ S6 &operator=(S6 &s) {
+#pragma omp parallel master private(a) private(this->a) private(s.a) // expected-error {{expected variable name or data member of current class}}
+ {
+ for (int k = 0; k < s.a; ++k)
+ ++s.a;
+ }
+ return *this;
+ }
+};
+
+template <typename T>
+class S7 : public T {
+ T a;
+ S7() : a(0) {}
+
+public:
+ S7(T v) : a(v) {
+#pragma omp parallel master private(a) private(this->a) private(T::a)
+ {
+ for (int k = 0; k < a.a; ++k)
+ ++this->a.a;
+ }
+ }
+ S7 &operator=(S7 &s) {
+#pragma omp parallel master private(a) private(this->a) private(s.a) private(s.T::a) // expected-error 2 {{expected variable name or data member of current class}}
+ {
+ for (int k = 0; k < s.a.a; ++k)
+ ++s.a.a;
+ }
+ return *this;
+ }
+};
+
+S3 h;
+#pragma omp threadprivate(h) // expected-note 2 {{defined as threadprivate or thread local}}
+
+template <class I, class C>
+int foomain(I argc, C **argv) {
+ I e(4);
+ I g(5);
+ int i, z;
+ int &j = i;
+#pragma omp parallel master private // expected-error {{expected '(' after 'private'}}
+ {
+ foo();
+ }
+#pragma omp parallel master private( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ {
+ foo();
+ }
+#pragma omp parallel master private() // expected-error {{expected expression}}
+ {
+ foo();
+ }
+#pragma omp parallel master private(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ {
+ foo();
+ }
+#pragma omp parallel master private(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ {
+ foo();
+ }
+#pragma omp parallel master private(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
+ {
+ foo();
+ }
+#pragma omp parallel master private(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
+ {
+ foo();
+ }
+#pragma omp parallel master private(S1) // expected-error {{'S1' does not refer to a value}}
+ {
+ foo();
+ }
+#pragma omp parallel master private(a, b) // expected-error {{private variable with incomplete type 'S1'}}
+ {
+ foo();
+ }
+#pragma omp parallel master private(argv[1]) // expected-error {{expected variable name}}
+ {
+ foo();
+ }
+#pragma omp parallel master private(e, g, z)
+ {
+ foo();
+ }
+#pragma omp parallel master private(h) // expected-error {{threadprivate or thread local variable cannot be private}}
+ {
+ foo();
+ }
+#pragma omp parallel master copyprivate(h) // expected-error {{unexpected OpenMP clause 'copyprivate' in directive '#pragma omp parallel master'}}
+ {
+ foo();
+ }
+#pragma omp parallel
+ {
+ int v = 0;
+ int i;
+#pragma omp parallel master private(i)
+ {
+ foo();
+ }
+ v += i;
+ }
+#pragma omp parallel shared(i)
+#pragma omp parallel private(i)
+#pragma omp parallel master private(j)
+ {
+ foo();
+ }
+#pragma omp parallel master private(i)
+ {
+ foo();
+ }
+ return 0;
+}
+
+namespace A {
+double x;
+#pragma omp threadprivate(x) // expected-note {{defined as threadprivate or thread local}}
+}
+namespace B {
+using A::x;
+}
+
+int main(int argc, char **argv) {
+ S4 e(4);
+ S5 g(5);
+ S6<float> s6(0.0) , s6_0(1.0);
+ S7<S6<float> > s7(0.0) , s7_0(1.0);
+ int i, z;
+ int &j = i;
+#pragma omp parallel master private // expected-error {{expected '(' after 'private'}}
+ {
+ foo();
+ }
+#pragma omp parallel master private( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ {
+ foo();
+ }
+#pragma omp parallel master private() // expected-error {{expected expression}}
+ {
+ foo();
+ }
+#pragma omp parallel master private(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ {
+ foo();
+ }
+#pragma omp parallel master private(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ {
+ foo();
+ }
+#pragma omp parallel master private(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
+ {
+ foo();
+ }
+#pragma omp parallel master private(argc, z)
+ {
+ foo();
+ }
+#pragma omp parallel master private(S1) // expected-error {{'S1' does not refer to a value}}
+ {
+ foo();
+ }
+#pragma omp parallel master private(a, b) // expected-error {{private variable with incomplete type 'S1'}}
+ {
+ foo();
+ }
+#pragma omp parallel master private(argv[1]) // expected-error {{expected variable name}}
+ {
+ foo();
+ }
+#pragma omp parallel master private(e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}}
+ {
+ foo();
+ }
+#pragma omp parallel master private(h, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be private}}
+ {
+ foo();
+ }
+#pragma omp parallel master copyprivate(h) // expected-error {{unexpected OpenMP clause 'copyprivate' in directive '#pragma omp parallel master'}}
+ {
+ foo();
+ }
+#pragma omp parallel
+ {
+ int i;
+#pragma omp parallel master private(i)
+ {
+ foo();
+ }
+ }
+#pragma omp parallel shared(i)
+#pragma omp parallel private(i)
+#pragma omp parallel master private(j)
+ {
+ foo();
+ }
+#pragma omp parallel master private(i)
+ {
+ foo();
+ }
+ static int m;
+#pragma omp parallel master private(m)
+ {
+ foo();
+ }
+
+ s6 = s6_0; // expected-note {{in instantiation of member function 'S6<float>::operator=' requested here}}
+ s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float> >::operator=' requested here}}
+ return foomain(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<int, char>' requested here}}
+}
+
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_proc_bind_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_proc_bind_messages.cpp
new file mode 100644
index 0000000..dd3220c
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_proc_bind_messages.cpp
@@ -0,0 +1,30 @@
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
+
+void foo();
+
+int main(int argc, char **argv) {
+#pragma omp parallel master proc_bind // expected-error {{expected '(' after 'proc_bind'}}
+ { foo(); }
+#pragma omp parallel master proc_bind( // expected-error {{expected 'master', 'close' or 'spread' in OpenMP clause 'proc_bind'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ { foo(); }
+#pragma omp parallel master proc_bind() // expected-error {{expected 'master', 'close' or 'spread' in OpenMP clause 'proc_bind'}}
+ { foo(); }
+#pragma omp parallel master proc_bind(master // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ { foo(); }
+#pragma omp parallel master proc_bind(close), proc_bind(spread) // expected-error {{directive '#pragma omp parallel master' cannot contain more than one 'proc_bind' clause}}
+ { foo(); }
+#pragma omp parallel master proc_bind(x) // expected-error {{expected 'master', 'close' or 'spread' in OpenMP clause 'proc_bind'}}
+ { foo(); }
+
+#pragma omp parallel master proc_bind(master)
+ { ++argc; }
+
+#pragma omp parallel master proc_bind(close)
+ {
+#pragma omp parallel master proc_bind(spread)
+ { ++argc; }
+ }
+ return 0;
+}
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_reduction_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_reduction_messages.cpp
new file mode 100644
index 0000000..4a5f8d2
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_reduction_messages.cpp
@@ -0,0 +1,398 @@
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
+
+extern int omp_default_mem_alloc;
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp parallel master reduction(+:fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+{
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+}
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+void foobar(int &ref) {
+#pragma omp parallel master reduction(+:ref)
+ {
+ foo();
+ }
+}
+
+struct S1; // expected-note {{declared here}} expected-note 4 {{forward declaration of 'S1'}}
+extern S1 a;
+class S2 {
+ mutable int a;
+ S2 &operator+(const S2 &arg) { return (*this); } // expected-note 3 {{implicitly declared private here}}
+
+public:
+ S2() : a(0) {}
+ S2(S2 &s2) : a(s2.a) {}
+ static float S2s; // expected-note 2 {{static data member is predetermined as shared}}
+ static const float S2sc; // expected-note 2 {{'S2sc' declared here}}
+};
+const float S2::S2sc = 0;
+S2 b; // expected-note 3 {{'b' defined here}}
+const S2 ba[5]; // expected-note 2 {{'ba' defined here}}
+class S3 {
+ int a;
+
+public:
+ int b;
+ S3() : a(0) {}
+ S3(const S3 &s3) : a(s3.a) {}
+ S3 operator+(const S3 &arg1) { return arg1; }
+};
+int operator+(const S3 &arg1, const S3 &arg2) { return 5; }
+S3 c; // expected-note 3 {{'c' defined here}}
+const S3 ca[5]; // expected-note 2 {{'ca' defined here}}
+extern const int f; // expected-note 4 {{'f' declared here}}
+class S4 {
+ int a;
+ S4(); // expected-note {{implicitly declared private here}}
+ S4(const S4 &s4);
+ S4 &operator+(const S4 &arg) { return (*this); }
+
+public:
+ S4(int v) : a(v) {}
+};
+S4 &operator&=(S4 &arg1, S4 &arg2) { return arg1; }
+class S5 {
+ int a;
+ S5() : a(0) {} // expected-note {{implicitly declared private here}}
+ S5(const S5 &s5) : a(s5.a) {}
+ S5 &operator+(const S5 &arg);
+
+public:
+ S5(int v) : a(v) {}
+};
+class S6 { // expected-note 3 {{candidate function (the implicit copy assignment operator) not viable: no known conversion from 'int' to 'const S6' for 1st argument}}
+#if __cplusplus >= 201103L // C++11 or later
+// expected-note@-2 3 {{candidate function (the implicit move assignment operator) not viable}}
+#endif
+ int a;
+
+public:
+ S6() : a(6) {}
+ operator int() { return 6; }
+} o;
+
+S3 h, k;
+#pragma omp threadprivate(h) // expected-note 2 {{defined as threadprivate or thread local}}
+
+template <class T> // expected-note {{declared here}}
+T tmain(T argc) {
+ const T d = T(); // expected-note 4 {{'d' defined here}}
+ const T da[5] = {T()}; // expected-note 2 {{'da' defined here}}
+ T qa[5] = {T()};
+ T i, z;
+ T &j = i; // expected-note 4 {{'j' defined here}}
+ S3 &p = k; // expected-note 2 {{'p' defined here}}
+ const T &r = da[(int)i]; // expected-note 2 {{'r' defined here}}
+ T &q = qa[(int)i]; // expected-note 2 {{'q' defined here}}
+ T fl;
+#pragma omp parallel master reduction // expected-error {{expected '(' after 'reduction'}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction + // expected-error {{expected '(' after 'reduction'}} expected-warning {{extra tokens at the end of '#pragma omp parallel master' are ignored}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction( // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(- // expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction() // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(*) // expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected expression}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(\) // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(& : argc // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{invalid operands to binary expression ('float' and 'float')}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(| : argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{invalid operands to binary expression ('float' and 'float')}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(|| : argc ? i : argc) // expected-error 2 {{expected variable name, array element or array section}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(foo : argc) //expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'float'}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'int'}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(^ : T) // expected-error {{'T' does not refer to a value}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(+ : z, a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 4 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 3 {{const-qualified variable cannot be reduction}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(max : h.b) // expected-error {{expected variable name, array element or array section}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(+ : ba) // expected-error {{const-qualified variable cannot be reduction}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(* : ca) // expected-error {{const-qualified variable cannot be reduction}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(- : da) // expected-error {{const-qualified variable cannot be reduction}} expected-error {{const-qualified variable cannot be reduction}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(^ : fl) // expected-error {{invalid operands to binary expression ('float' and 'float')}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(&& : S2::S2s) // expected-error {{shared variable cannot be reduction}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be reduction}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(+ : h, k) // expected-error {{threadprivate or thread local variable cannot be reduction}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(+ : o) // expected-error 2 {{no viable overloaded '='}}
+ {
+ foo();
+ }
+#pragma omp parallel master private(i), reduction(+ : j), reduction(+ : q) // expected-error 4 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
+ {
+ foo();
+ }
+#pragma omp parallel private(k)
+#pragma omp parallel master reduction(+ : p), reduction(+ : p) // expected-error 2 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(+ : p), reduction(+ : p) // expected-error 2 {{variable can appear only once in OpenMP 'reduction' clause}} expected-note 2 {{previously referenced here}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(+ : r) // expected-error 2 {{const-qualified variable cannot be reduction}}
+ {
+ foo();
+ }
+#pragma omp parallel shared(i)
+#pragma omp parallel reduction(min : i)
+#pragma omp parallel master reduction(max : j) // expected-error 2 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
+ {
+ foo();
+ }
+#pragma omp parallel private(fl)
+#pragma omp parallel master reduction(+ : fl)
+ {
+ foo();
+ }
+#pragma omp parallel reduction(* : fl)
+#pragma omp parallel master reduction(+ : fl)
+ {
+ foo();
+ }
+
+ return T();
+}
+
+namespace A {
+double x;
+#pragma omp threadprivate(x) // expected-note {{defined as threadprivate or thread local}}
+}
+namespace B {
+using A::x;
+}
+
+int main(int argc, char **argv) {
+ const int d = 5; // expected-note 2 {{'d' defined here}}
+ const int da[5] = {0}; // expected-note {{'da' defined here}}
+ int qa[5] = {0};
+ S4 e(4);
+ S5 g(5);
+ int i, z;
+ int &j = i; // expected-note 2 {{'j' defined here}}
+ S3 &p = k; // expected-note 2 {{'p' defined here}}
+ const int &r = da[i]; // expected-note {{'r' defined here}}
+ int &q = qa[i]; // expected-note {{'q' defined here}}
+ float fl;
+#pragma omp parallel master reduction // expected-error {{expected '(' after 'reduction'}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction + // expected-error {{expected '(' after 'reduction'}} expected-warning {{extra tokens at the end of '#pragma omp parallel master' are ignored}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction( // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(- // expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction() // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(*) // expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected expression}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(\) // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(foo : argc // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max'}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(| : argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(|| : argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name, array element or array section}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(~ : argc) // expected-error {{expected unqualified-id}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(&& : argc)
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(^ : S1) // expected-error {{'S1' does not refer to a value}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{const-qualified variable cannot be reduction}} expected-error {{'operator+' is a private member of 'S2'}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 2 {{const-qualified variable cannot be reduction}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(max : h.b) // expected-error {{expected variable name, array element or array section}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(+ : ba) // expected-error {{const-qualified variable cannot be reduction}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(* : ca) // expected-error {{const-qualified variable cannot be reduction}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(- : da) // expected-error {{const-qualified variable cannot be reduction}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(^ : fl) // expected-error {{invalid operands to binary expression ('float' and 'float')}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(&& : S2::S2s) // expected-error {{shared variable cannot be reduction}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be reduction}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{invalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(+ : o, z) // expected-error {{no viable overloaded '='}}
+ {
+ foo();
+ }
+#pragma omp parallel master private(i), reduction(+ : j), reduction(+ : q) // expected-error 2 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
+ {
+ foo();
+ }
+#pragma omp parallel private(k)
+#pragma omp parallel master reduction(+ : p), reduction(+ : p) // expected-error 2 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(+ : p), reduction(+ : p) // expected-error {{variable can appear only once in OpenMP 'reduction' clause}} expected-note {{previously referenced here}}
+ {
+ foo();
+ }
+#pragma omp parallel master reduction(+ : r) // expected-error {{const-qualified variable cannot be reduction}}
+ {
+ foo();
+ }
+#pragma omp parallel shared(i)
+#pragma omp parallel reduction(min : i)
+#pragma omp parallel master reduction(max : j) // expected-error {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
+ {
+ foo();
+ }
+#pragma omp parallel private(fl)
+#pragma omp parallel master reduction(+ : fl)
+ {
+ foo();
+ }
+#pragma omp parallel reduction(* : fl)
+#pragma omp parallel master reduction(+ : fl)
+ {
+ foo();
+ }
+ static int m;
+#pragma omp parallel master reduction(+ : m) // OK
+ {
+ foo();
+ }
+
+ return tmain(argc) + tmain(fl); // expected-note {{in instantiation of function template specialization 'tmain<int>' requested here}} expected-note {{in instantiation of function template specialization 'tmain<float>' requested here}}
+}
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_shared_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_shared_messages.cpp
new file mode 100644
index 0000000..1bda6c3
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_shared_messages.cpp
@@ -0,0 +1,120 @@
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
+
+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}}
+
+namespace A {
+double x;
+#pragma omp threadprivate(x) // expected-note {{defined as threadprivate or thread local}}
+}
+namespace B {
+using A::x;
+}
+
+int main(int argc, char **argv) {
+ const int d = 5;
+ const int da[5] = {0};
+ S4 e(4);
+ S5 g(5);
+ int i, k;
+ int &j = i;
+#pragma omp parallel master shared // expected-error {{expected '(' after 'shared'}}
+ { foo(); }
+#pragma omp parallel master shared( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ { foo(); }
+#pragma omp parallel master shared() // expected-error {{expected expression}}
+ { foo(); }
+#pragma omp parallel master shared(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ { foo(); }
+#pragma omp parallel master shared(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ { foo(); }
+#pragma omp parallel master shared(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
+ { foo(); }
+#pragma omp parallel master shared(argc)
+ { foo(); }
+#pragma omp parallel master shared(S1) // expected-error {{'S1' does not refer to a value}}
+ { foo(); }
+#pragma omp parallel master shared(a, b, c, d, f, k)
+ { foo(); }
+#pragma omp parallel master shared(argv[1]) // expected-error {{expected variable name}}
+ { foo(); }
+#pragma omp parallel master shared(ba)
+ { foo(); }
+#pragma omp parallel master shared(ca)
+ { foo(); }
+#pragma omp parallel master shared(da)
+ { foo(); }
+#pragma omp parallel master shared(e, g)
+ { foo(); }
+#pragma omp parallel master shared(h, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be shared}}
+ { foo(); }
+#pragma omp parallel master private(i), shared(i) // expected-error {{private variable cannot be shared}} expected-note {{defined as private}}
+ { foo(); }
+#pragma omp parallel master firstprivate(i), shared(i) // expected-error {{firstprivate variable cannot be shared}} expected-note {{defined as firstprivate}}
+ { foo(); }
+#pragma omp parallel master private(i)
+ {
+#pragma omp parallel master shared(i)
+ {
+#pragma omp parallel master shared(j)
+ { foo(); }
+ }
+ }
+#pragma omp parallel master firstprivate(i)
+ {
+#pragma omp parallel master shared(i)
+ {
+#pragma omp parallel master shared(j)
+ { foo(); }
+ }
+ }
+
+ return 0;
+}
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_ast_print.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_ast_print.cpp
new file mode 100644
index 0000000..b151380
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_ast_print.cpp
@@ -0,0 +1,83 @@
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ast-print %s | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ast-print %s | FileCheck %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s
+// expected-no-diagnostics
+
+#ifndef HEADER
+#define HEADER
+
+void foo() {}
+
+template <class T, int N>
+T tmain(T argc) {
+ T b = argc, c, d, e, f, g;
+ static T a;
+// CHECK: static T a;
+#pragma omp taskgroup allocate(d) task_reduction(+: d)
+#pragma omp parallel master taskloop if(taskloop: argc > N) default(shared) untied priority(N) grainsize(N) reduction(+:g) allocate(g)
+ // CHECK-NEXT: #pragma omp taskgroup allocate(d) task_reduction(+: d)
+ // CHECK-NEXT: #pragma omp parallel master taskloop if(taskloop: argc > N) default(shared) untied priority(N) grainsize(N) reduction(+: g) allocate(g){{$}}
+ for (int i = 0; i < 2; ++i)
+ a = 2;
+// CHECK-NEXT: for (int i = 0; i < 2; ++i)
+// CHECK-NEXT: a = 2;
+#pragma omp parallel
+#pragma omp parallel master taskloop private(argc, b), firstprivate(c, d), lastprivate(d, f) collapse(N) shared(g) if (c) final(d) mergeable priority(f) nogroup num_tasks(N)
+ for (int i = 0; i < 2; ++i)
+ for (int j = 0; j < 2; ++j)
+ for (int j = 0; j < 2; ++j)
+ for (int j = 0; j < 2; ++j)
+ for (int j = 0; j < 2; ++j)
+ for (int i = 0; i < 2; ++i)
+ for (int j = 0; j < 2; ++j)
+ for (int j = 0; j < 2; ++j)
+ for (int j = 0; j < 2; ++j)
+ for (int j = 0; j < 2; ++j)
+ foo();
+ // CHECK-NEXT: #pragma omp parallel
+ // CHECK-NEXT: #pragma omp parallel master taskloop private(argc,b) firstprivate(c,d) lastprivate(d,f) collapse(N) shared(g) if(c) final(d) mergeable priority(f) nogroup num_tasks(N)
+ // CHECK-NEXT: for (int i = 0; i < 2; ++i)
+ // CHECK-NEXT: for (int j = 0; j < 2; ++j)
+ // CHECK-NEXT: for (int j = 0; j < 2; ++j)
+ // CHECK-NEXT: for (int j = 0; j < 2; ++j)
+ // CHECK-NEXT: for (int j = 0; j < 2; ++j)
+ // CHECK-NEXT: for (int i = 0; i < 2; ++i)
+ // CHECK-NEXT: for (int j = 0; j < 2; ++j)
+ // CHECK-NEXT: for (int j = 0; j < 2; ++j)
+ // CHECK-NEXT: for (int j = 0; j < 2; ++j)
+ // CHECK-NEXT: for (int j = 0; j < 2; ++j)
+ // CHECK-NEXT: foo();
+ return T();
+}
+
+// CHECK-LABEL: int main(int argc, char **argv) {
+int main(int argc, char **argv) {
+ int b = argc, c, d, e, f, g;
+ static int a;
+// CHECK: static int a;
+#pragma omp taskgroup task_reduction(+: d)
+#pragma omp parallel master taskloop if(parallel: a) default(none) shared(a, b, argc) final(b) priority(5) num_tasks(argc) reduction(*: g)
+ // CHECK-NEXT: #pragma omp taskgroup task_reduction(+: d)
+ // CHECK-NEXT: #pragma omp parallel master taskloop if(parallel: a) default(none) shared(a,b,argc) final(b) priority(5) num_tasks(argc) reduction(*: g)
+ for (int i = 0; i < 2; ++i)
+ a = 2;
+// CHECK-NEXT: for (int i = 0; i < 2; ++i)
+// CHECK-NEXT: a = 2;
+#pragma omp parallel
+#pragma omp parallel master taskloop private(argc, b), firstprivate(argv, c), lastprivate(d, f) collapse(2) shared(g) if(argc) mergeable priority(argc) grainsize(argc) reduction(max: a, e)
+ for (int i = 0; i < 10; ++i)
+ for (int j = 0; j < 10; ++j)
+ foo();
+ // CHECK-NEXT: #pragma omp parallel
+ // CHECK-NEXT: #pragma omp parallel master taskloop private(argc,b) firstprivate(argv,c) lastprivate(d,f) collapse(2) shared(g) if(argc) mergeable priority(argc) grainsize(argc) reduction(max: a,e)
+ // CHECK-NEXT: for (int i = 0; i < 10; ++i)
+ // CHECK-NEXT: for (int j = 0; j < 10; ++j)
+ // CHECK-NEXT: foo();
+ return (tmain<int, 5>(argc) + tmain<char, 1>(argv[0][0]));
+}
+
+#endif
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_codegen.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_codegen.cpp
new file mode 100644
index 0000000..13195e1
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_codegen.cpp
@@ -0,0 +1,250 @@
+// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp -x c++ -emit-llvm %s -o - -femit-all-decls | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-apple-darwin10 -include-pch %t -verify %s -emit-llvm -o - -femit-all-decls | FileCheck %s
+
+// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp-simd -x c++ -emit-llvm %s -o - -femit-all-decls | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -include-pch %t -verify %s -emit-llvm -o - -femit-all-decls | FileCheck --check-prefix SIMD-ONLY0 %s
+// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
+// expected-no-diagnostics
+#ifndef HEADER
+#define HEADER
+
+// CHECK-LABEL: @main
+int main(int argc, char **argv) {
+// CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* [[DEFLOC:@.+]])
+// CHECK: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* [[DEFLOC]], i32 1, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i64)* [[OMP_OUTLINED1:@.+]] to void (i32*, i32*, ...)*), i64 [[PRIORITY:%.+]])
+// CHECK: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* [[DEFLOC]], i32 1, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i64)* [[OMP_OUTLINED2:@.+]] to void (i32*, i32*, ...)*), i64 [[GRAINSIZE:%.+]])
+// CHECK: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* [[DEFLOC]], i32 4, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32*, i8***, i64, i64)* [[OMP_OUTLINED3:@.+]] to void (i32*, i32*, ...)*), i32* [[ARGC:%.+]], i8*** [[ARGV:%.+]], i64 [[COND:%.+]], i64 [[NUM_TASKS:%.+]])
+// CHECK: call void @__kmpc_serialized_parallel(%struct.ident_t* [[DEFLOC]], i32 [[GTID]])
+// CHECK: call void [[OMP_OUTLINED3]](i32* %{{.+}}, i32* %{{.+}}, i32* [[ARGC]], i8*** [[ARGV]], i64 [[COND]], i64 [[NUM_TASKS]])
+// CHECK: call void @__kmpc_end_serialized_parallel(%struct.ident_t* [[DEFLOC]], i32 [[GTID]])
+
+
+// CHECK: define internal void [[OMP_OUTLINED1]](i32* noalias %{{.+}}, i32* noalias %{{.+}}, i64 %{{.+}})
+// CHECK: [[PRIO_ADDR:%.+]] = bitcast i64* %{{.+}} to i32*
+// CHECK: [[RES:%.+]] = call {{.*}}i32 @__kmpc_master(%struct.ident_t* [[DEFLOC]], i32 [[GTID:%.+]])
+// CHECK-NEXT: [[IS_MASTER:%.+]] = icmp ne i32 [[RES]], 0
+// CHECK-NEXT: br i1 [[IS_MASTER]], label {{%?}}[[THEN:.+]], label {{%?}}[[EXIT:.+]]
+// CHECK: [[THEN]]
+// CHECK: call void @__kmpc_taskgroup(%struct.ident_t* [[DEFLOC]], i32 [[GTID]])
+// CHECK: [[PRIO:%.+]] = load i32, i32* [[PRIO_ADDR]],
+// CHECK: [[TASKV:%.+]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* [[DEFLOC]], i32 [[GTID]], i32 33, i64 80, i64 1, i32 (i32, i8*)* bitcast (i32 (i32, [[TDP_TY:%.+]]*)* [[TASK1:@.+]] to i32 (i32, i8*)*))
+// CHECK: [[TASK:%.+]] = bitcast i8* [[TASKV]] to [[TDP_TY]]*
+// CHECK: [[TASK_DATA:%.+]] = getelementptr inbounds [[TDP_TY]], [[TDP_TY]]* [[TASK]], i32 0, i32 0
+// CHECK: [[PRIO_ADDR:%.+]] = getelementptr inbounds [[TD_TY:%.+]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 4
+// CHECK: [[PRIO_ADDR_CAST:%.+]] = bitcast %{{.+}}* [[PRIO_ADDR]] to i32*
+// CHECK: store i32 [[PRIO]], i32* [[PRIO_ADDR_CAST]],
+// CHECK: [[DOWN:%.+]] = getelementptr inbounds [[TD_TY:%.+]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 5
+// CHECK: store i64 0, i64* [[DOWN]],
+// CHECK: [[UP:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 6
+// CHECK: store i64 9, i64* [[UP]],
+// CHECK: [[ST:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 7
+// CHECK: store i64 1, i64* [[ST]],
+// CHECK: [[ST_VAL:%.+]] = load i64, i64* [[ST]],
+// CHECK: call void @__kmpc_taskloop(%struct.ident_t* [[DEFLOC]], i32 [[GTID]], i8* [[TASKV]], i32 1, i64* [[DOWN]], i64* [[UP]], i64 [[ST_VAL]], i32 1, i32 0, i64 0, i8* null)
+// CHECK: call void @__kmpc_end_taskgroup(%struct.ident_t* [[DEFLOC]], i32 [[GTID]])
+// CHECK-NEXT: call {{.*}}void @__kmpc_end_master(%struct.ident_t* [[DEFLOC]], i32 [[GTID]])
+// CHECK-NEXT: br label {{%?}}[[EXIT]]
+// CHECK: [[EXIT]]
+
+
+// CHECK: define internal i32 [[TASK1]](
+// CHECK: [[DOWN:%.+]] = getelementptr inbounds [[TD_TY:%.+]], [[TD_TY]]* %{{.+}}, i32 0, i32 5
+// CHECK: [[DOWN_VAL:%.+]] = load i64, i64* [[DOWN]],
+// CHECK: [[UP:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 6
+// CHECK: [[UP_VAL:%.+]] = load i64, i64* [[UP]],
+// CHECK: [[ST:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 7
+// CHECK: [[ST_VAL:%.+]] = load i64, i64* [[ST]],
+// CHECK: [[LITER:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 8
+// CHECK: [[LITER_VAL:%.+]] = load i32, i32* [[LITER]],
+// CHECK: store i64 [[DOWN_VAL]], i64* [[LB:%[^,]+]],
+// CHECK: store i64 [[UP_VAL]], i64* [[UB:%[^,]+]],
+// CHECK: store i64 [[ST_VAL]], i64* [[ST:%[^,]+]],
+// CHECK: store i32 [[LITER_VAL]], i32* [[LITER:%[^,]+]],
+// CHECK: [[LB_VAL:%.+]] = load i64, i64* [[LB]],
+// CHECK: [[LB_I32:%.+]] = trunc i64 [[LB_VAL]] to i32
+// CHECK: store i32 [[LB_I32]], i32* [[CNT:%.+]],
+// CHECK: br label
+// CHECK: [[VAL:%.+]] = load i32, i32* [[CNT]],
+// CHECK: [[VAL_I64:%.+]] = sext i32 [[VAL]] to i64
+// CHECK: [[UB_VAL:%.+]] = load i64, i64* [[UB]],
+// CHECK: [[CMP:%.+]] = icmp ule i64 [[VAL_I64]], [[UB_VAL]]
+// CHECK: br i1 [[CMP]], label %{{.+}}, label %{{.+}}
+// CHECK: load i32, i32* %
+// CHECK: store i32 %
+// CHECK: load i32, i32* %
+// CHECK: add nsw i32 %{{.+}}, 1
+// CHECK: store i32 %{{.+}}, i32* %
+// CHECK: br label %
+// CHECK: ret i32 0
+
+#pragma omp parallel master taskloop priority(argc)
+ for (int i = 0; i < 10; ++i)
+ ;
+// CHECK: define internal void [[OMP_OUTLINED2]](i32* noalias %{{.+}}, i32* noalias %{{.+}}, i64 %{{.+}})
+// CHECK: [[RES:%.+]] = call {{.*}}i32 @__kmpc_master(%struct.ident_t* [[DEFLOC]], i32 [[GTID:%.+]])
+// CHECK-NEXT: [[IS_MASTER:%.+]] = icmp ne i32 [[RES]], 0
+// CHECK-NEXT: br i1 [[IS_MASTER]], label {{%?}}[[THEN:.+]], label {{%?}}[[EXIT:.+]]
+// CHECK: [[THEN]]
+// CHECK: [[TASKV:%.+]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* [[DEFLOC]], i32 [[GTID]], i32 1, i64 80, i64 1, i32 (i32, i8*)* bitcast (i32 (i32, [[TDP_TY:%.+]]*)* [[TASK2:@.+]] to i32 (i32, i8*)*))
+// CHECK: [[TASK:%.+]] = bitcast i8* [[TASKV]] to [[TDP_TY]]*
+// CHECK: [[TASK_DATA:%.+]] = getelementptr inbounds [[TDP_TY]], [[TDP_TY]]* [[TASK]], i32 0, i32 0
+// CHECK: [[DOWN:%.+]] = getelementptr inbounds [[TD_TY:%.+]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 5
+// CHECK: store i64 0, i64* [[DOWN]],
+// CHECK: [[UP:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 6
+// CHECK: store i64 9, i64* [[UP]],
+// CHECK: [[ST:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 7
+// CHECK: store i64 1, i64* [[ST]],
+// CHECK: [[ST_VAL:%.+]] = load i64, i64* [[ST]],
+// CHECK: [[GRAINSIZE:%.+]] = zext i32 %{{.+}} to i64
+// CHECK: call void @__kmpc_taskloop(%struct.ident_t* [[DEFLOC]], i32 [[GTID]], i8* [[TASKV]], i32 1, i64* [[DOWN]], i64* [[UP]], i64 [[ST_VAL]], i32 1, i32 1, i64 [[GRAINSIZE]], i8* null)
+// CHECK-NEXT: call {{.*}}void @__kmpc_end_master(%struct.ident_t* [[DEFLOC]], i32 [[GTID]])
+// CHECK-NEXT: br label {{%?}}[[EXIT]]
+// CHECK: [[EXIT]]
+
+
+// CHECK: define internal i32 [[TASK2]](
+// CHECK: [[DOWN:%.+]] = getelementptr inbounds [[TD_TY:%.+]], [[TD_TY]]* %{{.+}}, i32 0, i32 5
+// CHECK: [[DOWN_VAL:%.+]] = load i64, i64* [[DOWN]],
+// CHECK: [[UP:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 6
+// CHECK: [[UP_VAL:%.+]] = load i64, i64* [[UP]],
+// CHECK: [[ST:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 7
+// CHECK: [[ST_VAL:%.+]] = load i64, i64* [[ST]],
+// CHECK: [[LITER:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 8
+// CHECK: [[LITER_VAL:%.+]] = load i32, i32* [[LITER]],
+// CHECK: store i64 [[DOWN_VAL]], i64* [[LB:%[^,]+]],
+// CHECK: store i64 [[UP_VAL]], i64* [[UB:%[^,]+]],
+// CHECK: store i64 [[ST_VAL]], i64* [[ST:%[^,]+]],
+// CHECK: store i32 [[LITER_VAL]], i32* [[LITER:%[^,]+]],
+// CHECK: [[LB_VAL:%.+]] = load i64, i64* [[LB]],
+// CHECK: [[LB_I32:%.+]] = trunc i64 [[LB_VAL]] to i32
+// CHECK: store i32 [[LB_I32]], i32* [[CNT:%.+]],
+// CHECK: br label
+// CHECK: [[VAL:%.+]] = load i32, i32* [[CNT]],
+// CHECK: [[VAL_I64:%.+]] = sext i32 [[VAL]] to i64
+// CHECK: [[UB_VAL:%.+]] = load i64, i64* [[UB]],
+// CHECK: [[CMP:%.+]] = icmp ule i64 [[VAL_I64]], [[UB_VAL]]
+// CHECK: br i1 [[CMP]], label %{{.+}}, label %{{.+}}
+// CHECK: load i32, i32* %
+// CHECK: store i32 %
+// CHECK: load i32, i32* %
+// CHECK: add nsw i32 %{{.+}}, 1
+// CHECK: store i32 %{{.+}}, i32* %
+// CHECK: br label %
+// CHECK: ret i32 0
+
+#pragma omp parallel master taskloop nogroup grainsize(argc)
+ for (int i = 0; i < 10; ++i)
+ ;
+// CHECK: define internal void [[OMP_OUTLINED3]](i32* noalias %{{.+}}, i32* noalias %{{.+}}, i32* dereferenceable(4) %{{.+}}, i8*** dereferenceable(8) %{{.+}}, i64 %{{.+}}, i64 %{{.+}})
+// CHECK: [[RES:%.+]] = call {{.*}}i32 @__kmpc_master(%struct.ident_t* [[DEFLOC]], i32 [[GTID:%.+]])
+// CHECK-NEXT: [[IS_MASTER:%.+]] = icmp ne i32 [[RES]], 0
+// CHECK-NEXT: br i1 [[IS_MASTER]], label {{%?}}[[THEN:.+]], label {{%?}}[[EXIT:.+]]
+// CHECK: [[THEN]]
+// CHECK: call void @__kmpc_taskgroup(%struct.ident_t* [[DEFLOC]], i32 [[GTID]])
+// CHECK: [[TASKV:%.+]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* [[DEFLOC]], i32 [[GTID]], i32 1, i64 80, i64 16, i32 (i32, i8*)* bitcast (i32 (i32, [[TDP_TY:%.+]]*)* [[TASK3:@.+]] to i32 (i32, i8*)*))
+// CHECK: [[TASK:%.+]] = bitcast i8* [[TASKV]] to [[TDP_TY]]*
+// CHECK: [[TASK_DATA:%.+]] = getelementptr inbounds [[TDP_TY]], [[TDP_TY]]* [[TASK]], i32 0, i32 0
+// CHECK: [[COND_VAL:%.+]] = load i8, i8* %{{.+}},
+// CHECK: [[COND_BOOL:%.+]] = trunc i8 [[COND_VAL]] to i1
+// CHECK: [[IF_INT:%.+]] = sext i1 [[COND_BOOL]] to i32
+// CHECK: [[DOWN:%.+]] = getelementptr inbounds [[TD_TY:%.+]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 5
+// CHECK: store i64 0, i64* [[DOWN]],
+// CHECK: [[UP:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 6
+// CHECK: store i64 %{{.+}}, i64* [[UP]],
+// CHECK: [[ST:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 7
+// CHECK: store i64 1, i64* [[ST]],
+// CHECK: [[ST_VAL:%.+]] = load i64, i64* [[ST]],
+// CHECK: [[NUM_TASKS:%.+]] = zext i32 %{{.+}} to i64
+// CHECK: call void @__kmpc_taskloop(%struct.ident_t* [[DEFLOC]], i32 [[GTID]], i8* [[TASKV]], i32 [[IF_INT]], i64* [[DOWN]], i64* [[UP]], i64 [[ST_VAL]], i32 1, i32 2, i64 [[NUM_TASKS]], i8* null)
+// CHECK: call void @__kmpc_end_taskgroup(%struct.ident_t* [[DEFLOC]], i32 [[GTID]])
+// CHECK-NEXT: call {{.*}}void @__kmpc_end_master(%struct.ident_t* [[DEFLOC]], i32 [[GTID]])
+// CHECK-NEXT: br label {{%?}}[[EXIT]]
+// CHECK: [[EXIT]]
+
+// CHECK: define internal i32 [[TASK3]](
+// CHECK: [[DOWN:%.+]] = getelementptr inbounds [[TD_TY:%.+]], [[TD_TY]]* %{{.+}}, i32 0, i32 5
+// CHECK: [[DOWN_VAL:%.+]] = load i64, i64* [[DOWN]],
+// CHECK: [[UP:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 6
+// CHECK: [[UP_VAL:%.+]] = load i64, i64* [[UP]],
+// CHECK: [[ST:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 7
+// CHECK: [[ST_VAL:%.+]] = load i64, i64* [[ST]],
+// CHECK: [[LITER:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 8
+// CHECK: [[LITER_VAL:%.+]] = load i32, i32* [[LITER]],
+// CHECK: store i64 [[DOWN_VAL]], i64* [[LB:%[^,]+]],
+// CHECK: store i64 [[UP_VAL]], i64* [[UB:%[^,]+]],
+// CHECK: store i64 [[ST_VAL]], i64* [[ST:%[^,]+]],
+// CHECK: store i32 [[LITER_VAL]], i32* [[LITER:%[^,]+]],
+// CHECK: [[LB_VAL:%.+]] = load i64, i64* [[LB]],
+// CHECK: store i64 [[LB_VAL]], i64* [[CNT:%.+]],
+// CHECK: br label
+// CHECK: ret i32 0
+
+ int i;
+#pragma omp parallel master taskloop if(argc) shared(argc, argv) collapse(2) num_tasks(argc)
+ for (i = 0; i < argc; ++i)
+ for (int j = argc; j < argv[argc][argc]; ++j)
+ ;
+}
+
+// CHECK-LABEL: @_ZN1SC2Ei
+struct S {
+ int a;
+ S(int c) {
+// CHECK: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* [[DEFLOC]], i32 3, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, %struct.S*, i32*, i64)* [[OMP_OUTLINED4:@.+]] to void (i32*, i32*, ...)*), %struct.S* %{{.+}}, i32* %{{.+}}, i64 %{{.+}})
+
+// CHECK: define internal void [[OMP_OUTLINED4]](i32* noalias %{{.+}}, i32* noalias %{{.+}}, %struct.S* %{{.+}}, i32* dereferenceable(4) %{{.+}}, i64 %{{.+}})
+// CHECK: [[CONV:%.+]] = bitcast i64* %{{.+}} to i8*
+// CHECK: [[CONDI8:%.+]] = load i8, i8* [[CONV]],
+// CHECK: [[COND:%.+]] = trunc i8 [[CONDI8]] to i1
+// CHECK: [[IS_FINAL:%.+]] = select i1 [[COND:%.+]], i32 2, i32 0
+// CHECK: [[FLAGS:%.+]] = or i32 [[IS_FINAL]], 1
+// CHECK: [[TASKV:%.+]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* [[DEFLOC]], i32 [[GTID:%.+]], i32 [[FLAGS]], i64 80, i64 16, i32 (i32, i8*)* bitcast (i32 (i32, [[TDP_TY:%.+]]*)* [[TASK4:@.+]] to i32 (i32, i8*)*))
+// CHECK: [[TASK:%.+]] = bitcast i8* [[TASKV]] to [[TDP_TY]]*
+// CHECK: [[TASK_DATA:%.+]] = getelementptr inbounds [[TDP_TY]], [[TDP_TY]]* [[TASK]], i32 0, i32 0
+// CHECK: [[DOWN:%.+]] = getelementptr inbounds [[TD_TY:%.+]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 5
+// CHECK: store i64 0, i64* [[DOWN]],
+// CHECK: [[UP:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 6
+// CHECK: store i64 %{{.+}}, i64* [[UP]],
+// CHECK: [[ST:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 7
+// CHECK: store i64 1, i64* [[ST]],
+// CHECK: [[ST_VAL:%.+]] = load i64, i64* [[ST]],
+// CHECK: call void @__kmpc_taskloop(%struct.ident_t* [[DEFLOC]], i32 [[GTID]], i8* [[TASKV]], i32 1, i64* [[DOWN]], i64* [[UP]], i64 [[ST_VAL]], i32 1, i32 2, i64 4, i8* null)
+#pragma omp parallel master taskloop shared(c) num_tasks(4) final(c)
+ for (a = 0; a < c; ++a)
+ ;
+ }
+} s(1);
+
+// CHECK: define internal i32 [[TASK4]](
+// CHECK: [[DOWN:%.+]] = getelementptr inbounds [[TD_TY:%.+]], [[TD_TY]]* %{{.+}}, i32 0, i32 5
+// CHECK: [[DOWN_VAL:%.+]] = load i64, i64* [[DOWN]],
+// CHECK: [[UP:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 6
+// CHECK: [[UP_VAL:%.+]] = load i64, i64* [[UP]],
+// CHECK: [[ST:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 7
+// CHECK: [[ST_VAL:%.+]] = load i64, i64* [[ST]],
+// CHECK: [[LITER:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 8
+// CHECK: [[LITER_VAL:%.+]] = load i32, i32* [[LITER]],
+// CHECK: store i64 [[DOWN_VAL]], i64* [[LB:%[^,]+]],
+// CHECK: store i64 [[UP_VAL]], i64* [[UB:%[^,]+]],
+// CHECK: store i64 [[ST_VAL]], i64* [[ST:%[^,]+]],
+// CHECK: store i32 [[LITER_VAL]], i32* [[LITER:%[^,]+]],
+// CHECK: [[LB_VAL:%.+]] = load i64, i64* [[LB]],
+// CHECK: [[LB_I32:%.+]] = trunc i64 [[LB_VAL]] to i32
+// CHECK: store i32 [[LB_I32]], i32* [[CNT:%.+]],
+// CHECK: br label
+// CHECK: [[VAL:%.+]] = load i32, i32* [[CNT]],
+// CHECK: [[VAL_I64:%.+]] = sext i32 [[VAL]] to i64
+// CHECK: [[UB_VAL:%.+]] = load i64, i64* [[UB]],
+// CHECK: [[CMP:%.+]] = icmp ule i64 [[VAL_I64]], [[UB_VAL]]
+// CHECK: br i1 [[CMP]], label %{{.+}}, label %{{.+}}
+// CHECK: load i32, i32* %
+// CHECK: store i32 %
+// CHECK: load i32, i32* %
+// CHECK: add nsw i32 %{{.+}}, 1
+// CHECK: store i32 %{{.+}}, i32* %
+// CHECK: br label %
+// CHECK: ret i32 0
+
+#endif
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_collapse_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_collapse_messages.cpp
new file mode 100644
index 0000000..bbed5d1
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_collapse_messages.cpp
@@ -0,0 +1,110 @@
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
+
+void foo() {
+}
+
+#if __cplusplus >= 201103L
+// expected-note@+2 4 {{declared here}}
+#endif
+bool foobool(int argc) {
+ return argc;
+}
+
+struct S1; // expected-note {{declared here}}
+
+template <class T, typename S, int N, int ST> // expected-note {{declared here}}
+T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
+ #pragma omp parallel master taskloop collapse // expected-error {{expected '(' after 'collapse'}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp parallel master taskloop collapse ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp parallel master taskloop collapse () // expected-error {{expected expression}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ // expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
+ // expected-error@+2 2 {{expression is not an integral constant expression}}
+ // expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
+ #pragma omp parallel master taskloop collapse (argc
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ // expected-error@+1 2 {{argument to 'collapse' clause must be a strictly positive integer value}}
+ #pragma omp parallel master taskloop collapse (ST // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp parallel master taskloop collapse (1)) // expected-warning {{extra tokens at the end of '#pragma omp parallel master taskloop' are ignored}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp parallel master taskloop collapse ((ST > 0) ? 1 + ST : 2) // expected-note 2 {{as specified in 'collapse' clause}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp parallel master taskloop', but found only 1}}
+ // expected-error@+6 2 {{directive '#pragma omp parallel master taskloop' cannot contain more than one 'collapse' clause}}
+ // expected-error@+5 {{argument to 'collapse' clause must be a strictly positive integer value}}
+ // expected-error@+4 2 {{expression is not an integral constant expression}}
+#if __cplusplus >= 201103L
+ // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
+#endif
+ #pragma omp parallel master taskloop collapse (foobool(argc)), collapse (true), collapse (-5)
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp parallel master taskloop collapse (S) // expected-error {{'S' does not refer to a value}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+#if __cplusplus <= 199711L
+ // expected-error@+4 2 {{expression is not an integral constant expression}}
+#else
+ // expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
+#endif
+ #pragma omp parallel master taskloop collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp parallel master taskloop collapse (1)
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp parallel master taskloop collapse (N) // expected-error {{argument to 'collapse' clause must be a strictly positive integer value}}
+ for (T i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp parallel master taskloop collapse (2) // expected-note {{as specified in 'collapse' clause}}
+ foo(); // expected-error {{expected 2 for loops after '#pragma omp parallel master taskloop'}}
+ return argc;
+}
+
+int main(int argc, char **argv) {
+ #pragma omp parallel master taskloop collapse // expected-error {{expected '(' after 'collapse'}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ #pragma omp parallel master taskloop collapse ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ #pragma omp parallel master taskloop collapse () // expected-error {{expected expression}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ #pragma omp parallel master taskloop collapse (4 // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-note {{as specified in 'collapse' clause}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp parallel master taskloop', but found only 1}}
+ #pragma omp parallel master taskloop collapse (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp parallel master taskloop' are ignored}} expected-note {{as specified in 'collapse' clause}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp parallel master taskloop', but found only 1}}
+ // expected-error@+4 {{expression is not an integral constant expression}}
+#if __cplusplus >= 201103L
+ // expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
+#endif
+ #pragma omp parallel master taskloop collapse (foobool(1) > 0 ? 1 : 2)
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ // expected-error@+6 {{expression is not an integral constant expression}}
+#if __cplusplus >= 201103L
+ // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
+#endif
+ // expected-error@+2 2 {{directive '#pragma omp parallel master taskloop' cannot contain more than one 'collapse' clause}}
+ // expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}}
+ #pragma omp parallel master taskloop collapse (foobool(argc)), collapse (true), collapse (-5)
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ #pragma omp parallel master taskloop collapse (S1) // expected-error {{'S1' does not refer to a value}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+#if __cplusplus <= 199711L
+ // expected-error@+4 {{expression is not an integral constant expression}}
+#else
+ // expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
+#endif
+ #pragma omp parallel master taskloop collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ // expected-error@+3 {{statement after '#pragma omp parallel master taskloop' must be a for loop}}
+ // expected-note@+1 {{in instantiation of function template specialization 'tmain<int, char, -1, -2>' requested here}}
+ #pragma omp parallel master taskloop collapse(collapse(tmain<int, char, -1, -2>(argc, argv) // expected-error 2 {{expected ')'}} expected-note 2 {{to match this '('}}
+ foo();
+ #pragma omp parallel master taskloop collapse (2) // expected-note {{as specified in 'collapse' clause}}
+ foo(); // expected-error {{expected 2 for loops after '#pragma omp parallel master taskloop'}}
+ // expected-note@+1 {{in instantiation of function template specialization 'tmain<int, char, 1, 0>' requested here}}
+ return tmain<int, char, 1, 0>(argc, argv);
+}
+
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_final_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_final_messages.cpp
new file mode 100644
index 0000000..e32a603
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_final_messages.cpp
@@ -0,0 +1,94 @@
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+struct S1; // expected-note {{declared here}}
+
+template <class T, class S> // expected-note {{declared here}}
+int tmain(T argc, S **argv) {
+ T z;
+#pragma omp parallel master taskloop final // expected-error {{expected '(' after 'final'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop final( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop final() // expected-error {{expected expression}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop final(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop final(argc)) // expected-warning {{extra tokens at the end of '#pragma omp parallel master taskloop' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop final(argc > 0 ? argv[1] : argv[2] + z)
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop final(foobool(argc)), final(true) // expected-error {{directive '#pragma omp parallel master taskloop' cannot contain more than one 'final' clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop final(S) // expected-error {{'S' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop final(argv[1] = 2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop final(argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop final(argc)
+ for (int i = 0; i < 10; ++i)
+ foo();
+
+ return 0;
+}
+
+int main(int argc, char **argv) {
+ int z;
+#pragma omp parallel master taskloop final // expected-error {{expected '(' after 'final'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop final( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop final() // expected-error {{expected expression}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop final(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop final(argc)) // expected-warning {{extra tokens at the end of '#pragma omp parallel master taskloop' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop final(argc > 0 ? argv[1] : argv[2] - z)
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop final(foobool(argc)), final(true) // expected-error {{directive '#pragma omp parallel master taskloop' cannot contain more than one 'final' clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop final(S1) // expected-error {{'S1' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop final(argv[1] = 2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop final(argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop final(1 0) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop final(if (tmain(argc, argv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+
+ return tmain(argc, argv);
+}
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_firstprivate_codegen.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_firstprivate_codegen.cpp
new file mode 100644
index 0000000..ec40af1
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_firstprivate_codegen.cpp
@@ -0,0 +1,515 @@
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-apple-darwin10 -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=LAMBDA %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=BLOCKS %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DARRAY -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=ARRAY %s
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DARRAY -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
+// expected-no-diagnostics
+
+#ifndef ARRAY
+#ifndef HEADER
+#define HEADER
+
+template <class T>
+struct S {
+ T f;
+ S(T a) : f(a) {}
+ S() : f() {}
+ S(const S &s, T t = T()) : f(s.f + t) {}
+ operator T() { return T(); }
+ ~S() {}
+};
+
+volatile double g;
+
+// CHECK-DAG: [[KMP_TASK_T_TY:%.+]] = type { i8*, i32 (i32, i8*)*, i32, %union{{.+}}, %union{{.+}}, i64, i64, i64, i32, i8* }
+// CHECK-DAG: [[S_DOUBLE_TY:%.+]] = type { double }
+// CHECK-DAG: [[PRIVATES_MAIN_TY:%.+]] = type {{.?}}{ [2 x [[S_DOUBLE_TY]]], [[S_DOUBLE_TY]], i32, [2 x i32]
+// CHECK-DAG: [[CAP_MAIN_TY:%.+]] = type {{.*}}{ [2 x i32]*, i32, {{.*}}[2 x [[S_DOUBLE_TY]]]*, [[S_DOUBLE_TY]]*, i{{[0-9]+}}
+// CHECK-DAG: [[KMP_TASK_MAIN_TY:%.+]] = type { [[KMP_TASK_T_TY]], [[PRIVATES_MAIN_TY]] }
+// CHECK-DAG: [[S_INT_TY:%.+]] = type { i32 }
+// CHECK-DAG: [[CAP_TMAIN_TY:%.+]] = type { [2 x i32]*, i32*, [2 x [[S_INT_TY]]]*, [[S_INT_TY]]* }
+// CHECK-DAG: [[PRIVATES_TMAIN_TY:%.+]] = type { i32, [2 x i32], [2 x [[S_INT_TY]]], [[S_INT_TY]], [104 x i8] }
+// CHECK-DAG: [[KMP_TASK_TMAIN_TY:%.+]] = type { [[KMP_TASK_T_TY]], [{{[0-9]+}} x i8], [[PRIVATES_TMAIN_TY]] }
+template <typename T>
+T tmain() {
+ S<T> ttt;
+ S<T> test(ttt);
+ T t_var __attribute__((aligned(128))) = T();
+ T vec[] = {1, 2};
+ S<T> s_arr[] = {1, 2};
+ S<T> var(3);
+#pragma omp parallel master taskloop firstprivate(t_var, vec, s_arr, s_arr, var, var)
+ for (int i = 0; i < 10; ++i) {
+ vec[0] = t_var;
+ s_arr[0] = var;
+ }
+ return T();
+}
+
+int main() {
+ static int sivar;
+#ifdef LAMBDA
+ // LAMBDA: [[G:@.+]] = global double
+ // LAMBDA: [[SIVAR:@.+]] = internal global i{{[0-9]+}} 0,
+ // LAMBDA-LABEL: @main
+ // LAMBDA: call{{( x86_thiscallcc)?}} void [[OUTER_LAMBDA:@.+]](
+ [&]() {
+ // LAMBDA: define{{.*}} internal{{.*}} void [[OUTER_LAMBDA]](
+// LAMBDA: [[RES:%.+]] = call {{.*}}i32 @__kmpc_master(
+// LAMBDA-NEXT: [[IS_MASTER:%.+]] = icmp ne i32 [[RES]], 0
+// LAMBDA-NEXT: br i1 [[IS_MASTER]], label {{%?}}[[THEN:.+]], label {{%?}}[[EXIT:.+]]
+// LAMBDA: [[THEN]]
+// LAMBDA: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc(%{{[^ ]+}} @{{[^,]+}}, i32 %{{[^,]+}}, i32 1, i64 96, i64 16, i32 (i32, i8*)* bitcast (i32 (i32, %{{[^*]+}}*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+// LAMBDA: [[PRIVATES:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i{{.+}} 0, i{{.+}} 1
+// LAMBDA: [[G_PRIVATE_ADDR:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[PRIVATES]], i{{.+}} 0, i{{.+}} 0
+// LAMBDA: [[G_ADDR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i{{.+}} 0, i{{.+}} 0
+// LAMBDA: [[G_VAL:%.+]] = load volatile double, double* [[G_ADDR_REF]]
+// LAMBDA: store volatile double [[G_VAL]], double* [[G_PRIVATE_ADDR]]
+
+// LAMBDA: [[SIVAR_PRIVATE_ADDR:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
+// LAMBDA: [[SIVAR_ADDR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i{{.+}} 0, i{{.+}} 1
+// LAMBDA: [[SIVAR_VAL:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[SIVAR_ADDR_REF]]
+// LAMBDA: store i{{[0-9]+}} [[SIVAR_VAL]], i{{[0-9]+}}* [[SIVAR_PRIVATE_ADDR]]
+
+// LAMBDA: call void @__kmpc_taskloop(%{{.+}}* @{{.+}}, i32 %{{.+}}, i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* null)
+// LAMBDA: call {{.*}}void @__kmpc_end_master(
+// LAMBDA-NEXT: br label {{%?}}[[EXIT]]
+// LAMBDA: [[EXIT]]
+// LAMBDA: ret
+#pragma omp parallel master taskloop firstprivate(g, sivar)
+ for (int i = 0; i < 10; ++i) {
+ // LAMBDA: define {{.+}} void [[INNER_LAMBDA:@.+]](%{{.+}}* [[ARG_PTR:%.+]])
+ // LAMBDA: store %{{.+}}* [[ARG_PTR]], %{{.+}}** [[ARG_PTR_REF:%.+]],
+ // LAMBDA: [[ARG_PTR:%.+]] = load %{{.+}}*, %{{.+}}** [[ARG_PTR_REF]]
+ // LAMBDA: [[G_PTR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[ARG_PTR]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+ // LAMBDA: [[G_REF:%.+]] = load double*, double** [[G_PTR_REF]]
+ // LAMBDA: store double 2.0{{.+}}, double* [[G_REF]]
+
+ // LAMBDA: store double* %{{.+}}, double** %{{.+}},
+ // LAMBDA: define internal i32 [[TASK_ENTRY]](i32 %0, %{{.+}}* noalias %1)
+ g = 1;
+ sivar = 11;
+ // LAMBDA: store double 1.0{{.+}}, double* %{{.+}},
+ // LAMBDA: store i{{[0-9]+}} 11, i{{[0-9]+}}* %{{.+}},
+ // LAMBDA: call void [[INNER_LAMBDA]](%
+ // LAMBDA: ret
+ [&]() {
+ g = 2;
+ sivar = 22;
+ }();
+ }
+ }();
+ return 0;
+#elif defined(BLOCKS)
+ // BLOCKS: [[G:@.+]] = global double
+ // BLOCKS-LABEL: @main
+ // BLOCKS: call void {{%.+}}(i8
+ ^{
+ // BLOCKS: define{{.*}} internal{{.*}} void {{.+}}(i8*
+ // BLOCKS: [[RES:%.+]] = call {{.*}}i32 @__kmpc_master(
+ // BLOCKS-NEXT: [[IS_MASTER:%.+]] = icmp ne i32 [[RES]], 0
+ // BLOCKS-NEXT: br i1 [[IS_MASTER]], label {{%?}}[[THEN:.+]], label {{%?}}[[EXIT:.+]]
+ // BLOCKS: [[THEN]]
+ // BLOCKS: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc(%{{[^ ]+}} @{{[^,]+}}, i32 %{{[^,]+}}, i32 1, i64 96, i64 16, i32 (i32, i8*)* bitcast (i32 (i32, %{{[^*]+}}*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+ // BLOCKS: [[PRIVATES:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i{{.+}} 0, i{{.+}} 1
+ // BLOCKS: [[G_PRIVATE_ADDR:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[PRIVATES]], i{{.+}} 0, i{{.+}} 0
+ // BLOCKS: [[G_ADDR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i{{.+}} 0, i{{.+}} 0
+ // BLOCKS: [[G_VAL:%.+]] = load volatile double, double* [[G_ADDR_REF]]
+ // BLOCKS: store volatile double [[G_VAL]], double* [[G_PRIVATE_ADDR]]
+
+ // BLOCKS: [[SIVAR_PRIVATE_ADDR:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
+ // BLOCKS: [[SIVAR_ADDR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i{{.+}} 0, i{{.+}} 1
+ // BLOCKS: [[SIVAR_VAL:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[SIVAR_ADDR_REF]]
+ // BLOCKS: store i{{[0-9]+}} [[SIVAR_VAL]], i{{[0-9]+}}* [[SIVAR_PRIVATE_ADDR]]
+ // BLOCKS: call void @__kmpc_taskloop(%{{.+}}* @{{.+}}, i32 %{{.+}}, i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* null)
+ // BLOCKS: call {{.*}}void @__kmpc_end_master(
+ // BLOCKS-NEXT: br label {{%?}}[[EXIT]]
+ // BLOCKS: [[EXIT]]
+ // BLOCKS: ret
+#pragma omp parallel master taskloop firstprivate(g, sivar)
+ for (int i = 0; i < 10; ++i) {
+ // BLOCKS: define {{.+}} void {{@.+}}(i8*
+ // BLOCKS-NOT: [[G]]{{[[^:word:]]}}
+ // BLOCKS: store double 2.0{{.+}}, double*
+ // BLOCKS-NOT: [[G]]{{[[^:word:]]}}
+ // BLOCKS-NOT: [[ISVAR]]{{[[^:word:]]}}
+ // BLOCKS: store i{{[0-9]+}} 22, i{{[0-9]+}}*
+ // BLOCKS-NOT: [[SIVAR]]{{[[^:word:]]}}
+ // BLOCKS: ret
+
+ // BLOCKS: store double* %{{.+}}, double** %{{.+}},
+ // BLOCKS: store i{{[0-9]+}}* %{{.+}}, i{{[0-9]+}}** %{{.+}},
+ // BLOCKS: define internal i32 [[TASK_ENTRY]](i32 %0, %{{.+}}* noalias %1)
+ g = 1;
+ sivar = 11;
+ // BLOCKS: store double 1.0{{.+}}, double* %{{.+}},
+ // BLOCKS-NOT: [[G]]{{[[^:word:]]}}
+ // BLOCKS: store i{{[0-9]+}} 11, i{{[0-9]+}}* %{{.+}},
+ // BLOCKS-NOT: [[SIVAR]]{{[[^:word:]]}}
+ // BLOCKS: call void {{%.+}}(i8
+ ^{
+ g = 2;
+ sivar = 22;
+ }();
+ }
+ }();
+ return 0;
+#else
+ S<double> ttt;
+ S<double> test(ttt);
+ int t_var = 0;
+ int vec[] = {1, 2};
+ S<double> s_arr[] = {1, 2};
+ S<double> var(3);
+#pragma omp parallel master taskloop firstprivate(var, t_var, s_arr, vec, s_arr, var, sivar)
+ for (int i = 0; i < 10; ++i) {
+ vec[0] = t_var;
+ s_arr[0] = var;
+ sivar = 33;
+ }
+ return tmain<int>();
+#endif
+}
+
+// CHECK: [[SIVAR:.+]] = internal global i{{[0-9]+}} 0,
+// CHECK: define i{{[0-9]+}} @main()
+// CHECK: alloca [[S_DOUBLE_TY]],
+// CHECK: [[TEST:%.+]] = alloca [[S_DOUBLE_TY]],
+// CHECK: [[T_VAR_ADDR:%.+]] = alloca i32,
+// CHECK: [[VEC_ADDR:%.+]] = alloca [2 x i32],
+// CHECK: [[S_ARR_ADDR:%.+]] = alloca [2 x [[S_DOUBLE_TY]]],
+// CHECK: [[VAR_ADDR:%.+]] = alloca [[S_DOUBLE_TY]],
+
+// CHECK: call {{.*}} [[S_DOUBLE_TY_COPY_CONSTR:@.+]]([[S_DOUBLE_TY]]* [[TEST]],
+
+// CHECK: [[RES:%.+]] = call {{.*}}i32 @__kmpc_master(
+// CHECK-NEXT: [[IS_MASTER:%.+]] = icmp ne i32 [[RES]], 0
+// CHECK-NEXT: br i1 [[IS_MASTER]], label {{%?}}[[THEN:.+]], label {{%?}}[[EXIT:.+]]
+// CHECK: [[THEN]]
+// Store original variables in capture struct.
+// CHECK: [[VEC_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: store [2 x i32]* %{{.+}}, [2 x i32]** [[VEC_REF]],
+// CHECK: [[T_VAR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 1
+// CHECK: [[T_VAR_VAL:%.+]] = load i32, i32* %{{.+}},
+// CHECK: store i32 [[T_VAR_VAL]], i32* [[T_VAR_REF]],
+// CHECK: [[S_ARR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 3
+// CHECK: store [2 x [[S_DOUBLE_TY]]]* %{{.+}}, [2 x [[S_DOUBLE_TY]]]** [[S_ARR_REF]],
+// CHECK: [[VAR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 4
+// CHECK: store [[S_DOUBLE_TY]]* %{{.+}}, [[S_DOUBLE_TY]]** [[VAR_REF]],
+// CHECK: [[SIVAR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 5
+// CHECK: [[SIVAR_VAL:%.+]] = load i32, i32* %{{.+}},
+// CHECK: store i{{[0-9]+}} [[SIVAR_VAL]], i{{[0-9]+}}* [[SIVAR_REF]],
+
+// Allocate task.
+// Returns struct kmp_task_t {
+// [[KMP_TASK_T]] task_data;
+// [[KMP_TASK_MAIN_TY]] privates;
+// };
+// CHECK: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* @{{.+}}, i32 %{{.+}}, i32 9, i64 120, i64 40, i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_MAIN_TY]]*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+// CHECK: [[RES_KMP_TASK:%.+]] = bitcast i8* [[RES]] to [[KMP_TASK_MAIN_TY]]*
+
+// Fill kmp_task_t->shareds by copying from original capture argument.
+// CHECK: [[TASK:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: [[SHAREDS_REF_ADDR:%.+]] = getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* [[TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: [[SHAREDS_REF:%.+]] = load i8*, i8** [[SHAREDS_REF_ADDR]],
+// CHECK: [[CAPTURES_ADDR:%.+]] = bitcast [[CAP_MAIN_TY]]* %{{.+}} to i8*
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 [[SHAREDS_REF]], i8* align 8 [[CAPTURES_ADDR]], i64 40, i1 false)
+
+// Initialize kmp_task_t->privates with default values (no init for simple types, default constructors for classes).
+// Also copy address of private copy to the corresponding shareds reference.
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
+// CHECK: [[SHAREDS:%.+]] = bitcast i8* [[SHAREDS_REF]] to [[CAP_MAIN_TY]]*
+
+// Constructors for s_arr and var.
+// s_arr;
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: [[S_ARR_ADDR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* [[SHAREDS]], i{{.+}} 0, i{{.+}} 3
+// CHECK: load [2 x [[S_DOUBLE_TY]]]*, [2 x [[S_DOUBLE_TY]]]** [[S_ARR_ADDR_REF]],
+// CHECK: call void [[S_DOUBLE_TY_COPY_CONSTR]]([[S_DOUBLE_TY]]* [[S_ARR_CUR:%[^,]+]],
+// CHECK: getelementptr [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* [[S_ARR_CUR]], i{{.+}} 1
+// CHECK: getelementptr [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i{{.+}} 1
+// CHECK: icmp eq
+// CHECK: br i1
+
+// var;
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
+// CHECK: [[VAR_ADDR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* [[SHAREDS]], i{{.+}} 0, i{{.+}} 4
+// CHECK: [[VAR_REF:%.+]] = load [[S_DOUBLE_TY]]*, [[S_DOUBLE_TY]]** [[VAR_ADDR_REF]],
+// CHECK: call void [[S_DOUBLE_TY_COPY_CONSTR]]([[S_DOUBLE_TY]]* [[PRIVATE_VAR_REF]], [[S_DOUBLE_TY]]* {{.*}}[[VAR_REF]],
+
+// t_var;
+// CHECK: [[PRIVATE_T_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK: [[T_VAR_ADDR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* [[SHAREDS]], i{{.+}} 0, i{{.+}} 1
+// CHECK: [[T_VAR:%.+]] = load i{{.+}}, i{{.+}}* [[T_VAR_ADDR_REF]],
+// CHECK: store i32 [[T_VAR]], i32* [[PRIVATE_T_VAR_REF]],
+
+// vec;
+// CHECK: [[PRIVATE_VEC_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: [[VEC_ADDR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* [[SHAREDS]], i{{.+}} 0, i{{.+}} 0
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(
+
+// sivar;
+// CHECK: [[PRIVATE_SIVAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 4
+// CHECK: [[SIVAR_ADDR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* [[SHAREDS]], i{{.+}} 0, i{{.+}} 5
+// CHECK: [[SIVAR:%.+]] = load i{{.+}}, i{{.+}}* [[SIVAR_ADDR_REF]],
+// CHECK: store i32 [[SIVAR]], i32* [[PRIVATE_SIVAR_REF]],
+
+// Provide pointer to destructor function, which will destroy private variables at the end of the task.
+// CHECK: [[DESTRUCTORS_REF:%.+]] = getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* [[TASK]], i{{.+}} 0, i{{.+}} 3
+// CHECK: [[DESTRUCTORS_PTR:%.+]] = bitcast %union{{.+}}* [[DESTRUCTORS_REF]] to i32 (i32, i8*)**
+// CHECK: store i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_MAIN_TY]]*)* [[DESTRUCTORS:@.+]] to i32 (i32, i8*)*), i32 (i32, i8*)** [[DESTRUCTORS_PTR]],
+
+// Start task.
+// CHECK: call void @__kmpc_taskloop(%struct.ident_t* @{{.+}}, i32 %{{.+}}, i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* bitcast (void ([[KMP_TASK_MAIN_TY]]*, [[KMP_TASK_MAIN_TY]]*, i32)* [[MAIN_DUP:@.+]] to i8*))
+// CHECK: call {{.*}}void @__kmpc_end_master(
+// CHECK-NEXT: br label {{%?}}[[EXIT]]
+// CHECK: [[EXIT]]
+
+// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_MAIN_TY]]* noalias %0, [[S_DOUBLE_TY]]** noalias %1, i32** noalias %2, [2 x [[S_DOUBLE_TY]]]** noalias %3, [2 x i32]** noalias %4, i32** noalias %5)
+// CHECK: [[PRIVATES:%.+]] = load [[PRIVATES_MAIN_TY]]*, [[PRIVATES_MAIN_TY]]**
+// CHECK: [[PRIV_S_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 0
+// CHECK: [[ARG3:%.+]] = load [2 x [[S_DOUBLE_TY]]]**, [2 x [[S_DOUBLE_TY]]]*** %{{.+}},
+// CHECK: store [2 x [[S_DOUBLE_TY]]]* [[PRIV_S_VAR]], [2 x [[S_DOUBLE_TY]]]** [[ARG3]],
+// CHECK: [[PRIV_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 1
+// CHECK: [[ARG1:%.+]] = load [[S_DOUBLE_TY]]**, [[S_DOUBLE_TY]]*** {{.+}},
+// CHECK: store [[S_DOUBLE_TY]]* [[PRIV_VAR]], [[S_DOUBLE_TY]]** [[ARG1]],
+// CHECK: [[PRIV_T_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 2
+// CHECK: [[ARG2:%.+]] = load i32**, i32*** %{{.+}},
+// CHECK: store i32* [[PRIV_T_VAR]], i32** [[ARG2]],
+// CHECK: [[PRIV_VEC:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 3
+// CHECK: [[ARG4:%.+]] = load [2 x i32]**, [2 x i32]*** %{{.+}},
+// CHECK: store [2 x i32]* [[PRIV_VEC]], [2 x i32]** [[ARG4]],
+// CHECK: [[PRIV_SIVAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 4
+// CHECK: [[ARG5:%.+]] = load i{{[0-9]+}}**, i{{[0-9]+}}*** %{{.+}},
+// CHECK: store i{{[0-9]+}}* [[PRIV_SIVAR]], i{{[0-9]+}}** [[ARG5]],
+// CHECK: ret void
+
+// CHECK: define internal i32 [[TASK_ENTRY]](i32 %0, [[KMP_TASK_MAIN_TY]]* noalias %1)
+
+// CHECK: [[PRIV_VAR_ADDR:%.+]] = alloca [[S_DOUBLE_TY]]*,
+// CHECK: [[PRIV_T_VAR_ADDR:%.+]] = alloca i32*,
+// CHECK: [[PRIV_S_ARR_ADDR:%.+]] = alloca [2 x [[S_DOUBLE_TY]]]*,
+// CHECK: [[PRIV_VEC_ADDR:%.+]] = alloca [2 x i32]*,
+// CHECK: [[PRIV_SIVAR_ADDR:%.+]] = alloca i32*,
+// CHECK: store void (i8*, ...)* bitcast (void ([[PRIVATES_MAIN_TY]]*, [[S_DOUBLE_TY]]**, i32**, [2 x [[S_DOUBLE_TY]]]**, [2 x i32]**, i32**)* [[PRIVATES_MAP_FN]] to void (i8*, ...)*), void (i8*, ...)** [[MAP_FN_ADDR:%.+]],
+// CHECK: [[MAP_FN:%.+]] = load void (i8*, ...)*, void (i8*, ...)** [[MAP_FN_ADDR]],
+
+// CHECK: call void (i8*, ...) [[MAP_FN]](i8* %{{.+}}, [[S_DOUBLE_TY]]** [[PRIV_VAR_ADDR]], i32** [[PRIV_T_VAR_ADDR]], [2 x [[S_DOUBLE_TY]]]** [[PRIV_S_ARR_ADDR]], [2 x i32]** [[PRIV_VEC_ADDR]], i32** [[PRIV_SIVAR_ADDR]])
+
+// CHECK: [[PRIV_VAR:%.+]] = load [[S_DOUBLE_TY]]*, [[S_DOUBLE_TY]]** [[PRIV_VAR_ADDR]],
+// CHECK: [[PRIV_T_VAR:%.+]] = load i32*, i32** [[PRIV_T_VAR_ADDR]],
+// CHECK: [[PRIV_S_ARR:%.+]] = load [2 x [[S_DOUBLE_TY]]]*, [2 x [[S_DOUBLE_TY]]]** [[PRIV_S_ARR_ADDR]],
+// CHECK: [[PRIV_VEC:%.+]] = load [2 x i32]*, [2 x i32]** [[PRIV_VEC_ADDR]],
+// CHECK: [[PRIV_SIVAR:%.+]] = load i32*, i32** [[PRIV_SIVAR_ADDR]],
+
+// Privates actually are used.
+// CHECK-DAG: [[PRIV_VAR]]
+// CHECK-DAG: [[PRIV_T_VAR]]
+// CHECK-DAG: [[PRIV_S_ARR]]
+// CHECK-DAG: [[PRIV_VEC]]
+// CHECK-DAG: [[PRIV_SIVAR]]
+
+// CHECK: ret
+
+// CHECK: define internal void [[MAIN_DUP]]([[KMP_TASK_MAIN_TY]]* %0, [[KMP_TASK_MAIN_TY]]* %1, i32 %2)
+// CHECK: getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* %{{.+}}, i32 0, i32 1
+// CHECK: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr inbounds [2 x [[S_DOUBLE_TY]]], [2 x [[S_DOUBLE_TY]]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i64 2
+// CHECK: br i1 %
+
+// CHECK: phi [[S_DOUBLE_TY]]*
+// CHECK: call {{.*}} [[S_DOUBLE_TY_COPY_CONSTR]]([[S_DOUBLE_TY]]*
+// CHECK: getelementptr [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i32 1
+// CHECK: icmp eq [[S_DOUBLE_TY]]* %
+// CHECK: br i1 %
+
+// CHECK: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* %{{.+}}, i32 0, i32 1
+// CHECK: call {{.*}} [[S_DOUBLE_TY_COPY_CONSTR]]([[S_DOUBLE_TY]]*
+// CHECK: ret void
+
+// CHECK: define internal i32 [[DESTRUCTORS]](i32 %{{.+}}, [[KMP_TASK_MAIN_TY]]* noalias %{{.+}})
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 0
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
+// CHECK: call void @_ZN1SIdED1Ev([[S_DOUBLE_TY]]* [[PRIVATE_VAR_REF]])
+// CHECK: getelementptr inbounds [2 x [[S_DOUBLE_TY]]], [2 x [[S_DOUBLE_TY]]]* [[PRIVATE_S_ARR_REF]], i{{.+}} 0, i{{.+}} 0
+// CHECK: getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i{{.+}} 2
+// CHECK: [[PRIVATE_S_ARR_ELEM_REF:%.+]] = getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i{{.+}} -1
+// CHECK: call void @_ZN1SIdED1Ev([[S_DOUBLE_TY]]* [[PRIVATE_S_ARR_ELEM_REF]])
+// CHECK: icmp eq
+// CHECK: br i1
+// CHECK: ret i32
+
+// CHECK: alloca [[S_INT_TY]],
+// CHECK: [[TEST:%.+]] = alloca [[S_INT_TY]],
+// CHECK: [[T_VAR_ADDR:%.+]] = alloca i32, align 128
+// CHECK: [[VEC_ADDR:%.+]] = alloca [2 x i32],
+// CHECK: [[S_ARR_ADDR:%.+]] = alloca [2 x [[S_INT_TY]]],
+// CHECK: [[VAR_ADDR:%.+]] = alloca [[S_INT_TY]],
+
+// CHECK: call {{.*}} [[S_INT_TY_COPY_CONSTR:@.+]]([[S_INT_TY]]* [[TEST]],
+
+// Store original variables in capture struct.
+// CHECK: [[VEC_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: store [2 x i32]* %{{.+}}, [2 x i32]** [[VEC_REF]],
+// CHECK: [[T_VAR_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 1
+// CHECK: store i32* %{{.+}}, i32** [[T_VAR_REF]],
+// CHECK: [[S_ARR_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 2
+// CHECK: store [2 x [[S_INT_TY]]]* %{{.+}}, [2 x [[S_INT_TY]]]** [[S_ARR_REF]],
+// CHECK: [[VAR_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 3
+// CHECK: store [[S_INT_TY]]* %{{.+}}, [[S_INT_TY]]** [[VAR_REF]],
+
+// Allocate task.
+// Returns struct kmp_task_t {
+// [[KMP_TASK_T_TY]] task_data;
+// [[KMP_TASK_TMAIN_TY]] privates;
+// };
+// CHECK: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* @{{.+}}, i32 %{{.+}}, i32 9, i64 256, i64 32, i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_TMAIN_TY]]*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+// CHECK: [[RES_KMP_TASK:%.+]] = bitcast i8* [[RES]] to [[KMP_TASK_TMAIN_TY]]*
+
+// Fill kmp_task_t->shareds by copying from original capture argument.
+// CHECK: [[TASK:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: [[SHAREDS_REF_ADDR:%.+]] = getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* [[TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: [[SHAREDS_REF:%.+]] = load i8*, i8** [[SHAREDS_REF_ADDR]],
+// CHECK: [[CAPTURES_ADDR:%.+]] = bitcast [[CAP_TMAIN_TY]]* %{{.+}} to i8*
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 [[SHAREDS_REF]], i8* align 8 [[CAPTURES_ADDR]], i64 32, i1 false)
+
+// Initialize kmp_task_t->privates with default values (no init for simple types, default constructors for classes).
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
+// CHECK: [[SHAREDS:%.+]] = bitcast i8* [[SHAREDS_REF]] to [[CAP_TMAIN_TY]]*
+
+// t_var;
+// CHECK: [[PRIVATE_T_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 0
+// CHECK: [[T_VAR_ADDR_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* [[SHAREDS]], i{{.+}} 0, i{{.+}} 1
+// CHECK: [[T_VAR_REF:%.+]] = load i{{.+}}*, i{{.+}}** [[T_VAR_ADDR_REF]],
+// CHECK: [[T_VAR:%.+]] = load i{{.+}}, i{{.+}}* [[T_VAR_REF]], align 128
+// CHECK: store i32 [[T_VAR]], i32* [[PRIVATE_T_VAR_REF]], align 128
+
+// vec;
+// CHECK: [[PRIVATE_VEC_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
+// CHECK: [[VEC_ADDR_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* [[SHAREDS]], i{{.+}} 0, i{{.+}} 0
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(
+
+// Constructors for s_arr and var.
+// a_arr;
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
+// CHECK: [[S_ARR_ADDR_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* [[SHAREDS]], i{{.+}} 0, i{{.+}} 2
+// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* [[PRIVATE_S_ARR_REF]], i{{.+}} 0, i{{.+}} 0
+// CHECK: getelementptr [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i{{.+}} 2
+// CHECK: call void [[S_INT_TY_COPY_CONSTR]]([[S_INT_TY]]* [[S_ARR_CUR:%[^,]+]],
+// CHECK: getelementptr [[S_INT_TY]], [[S_INT_TY]]* [[S_ARR_CUR]], i{{.+}} 1
+// CHECK: icmp eq
+// CHECK: br i1
+
+// var;
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: [[VAR_ADDR_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* [[SHAREDS]], i{{.+}} 0, i{{.+}} 3
+// CHECK: call void [[S_INT_TY_COPY_CONSTR]]([[S_INT_TY]]* [[PRIVATE_VAR_REF]],
+
+// Provide pointer to destructor function, which will destroy private variables at the end of the task.
+// CHECK: [[DESTRUCTORS_REF:%.+]] = getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* [[TASK]], i{{.+}} 0, i{{.+}} 3
+// CHECK: [[DESTRUCTORS_PTR:%.+]] = bitcast %union{{.+}}* [[DESTRUCTORS_REF]] to i32 (i32, i8*)**
+// CHECK: store i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_TMAIN_TY]]*)* [[DESTRUCTORS:@.+]] to i32 (i32, i8*)*), i32 (i32, i8*)** [[DESTRUCTORS_PTR]],
+
+// Start task.
+// CHECK: call void @__kmpc_taskloop(%struct.ident_t* @{{.+}}, i32 %{{.+}}, i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* bitcast (void ([[KMP_TASK_TMAIN_TY]]*, [[KMP_TASK_TMAIN_TY]]*, i32)* [[TMAIN_DUP:@.+]] to i8*))
+
+// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_TMAIN_TY]]* noalias %{{.+}}, i32** noalias %{{.+}}, [2 x i32]** noalias %{{.+}}, [2 x [[S_INT_TY]]]** noalias %{{.+}}, [[S_INT_TY]]** noalias %{{.+}})
+// CHECK: [[PRIVATES:%.+]] = load [[PRIVATES_TMAIN_TY]]*, [[PRIVATES_TMAIN_TY]]**
+// CHECK: [[PRIV_T_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 0
+// CHECK: [[ARG1:%.+]] = load i32**, i32*** %{{.+}},
+// CHECK: store i32* [[PRIV_T_VAR]], i32** [[ARG1]],
+// CHECK: [[PRIV_VEC:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 1
+// CHECK: [[ARG2:%.+]] = load [2 x i32]**, [2 x i32]*** %{{.+}},
+// CHECK: store [2 x i32]* [[PRIV_VEC]], [2 x i32]** [[ARG2]],
+// CHECK: [[PRIV_S_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 2
+// CHECK: [[ARG3:%.+]] = load [2 x [[S_INT_TY]]]**, [2 x [[S_INT_TY]]]*** %{{.+}},
+// CHECK: store [2 x [[S_INT_TY]]]* [[PRIV_S_VAR]], [2 x [[S_INT_TY]]]** [[ARG3]],
+// CHECK: [[PRIV_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 3
+// CHECK: [[ARG4:%.+]] = load [[S_INT_TY]]**, [[S_INT_TY]]*** {{.+}},
+// CHECK: store [[S_INT_TY]]* [[PRIV_VAR]], [[S_INT_TY]]** [[ARG4]],
+// CHECK: ret void
+
+// CHECK: define internal i32 [[TASK_ENTRY]](i32 %0, [[KMP_TASK_TMAIN_TY]]* noalias %1)
+// CHECK: alloca i32*,
+// CHECK-DAG: [[PRIV_T_VAR_ADDR:%.+]] = alloca i32*,
+// CHECK-DAG: [[PRIV_VEC_ADDR:%.+]] = alloca [2 x i32]*,
+// CHECK-DAG: [[PRIV_S_ARR_ADDR:%.+]] = alloca [2 x [[S_INT_TY]]]*,
+// CHECK-DAG: [[PRIV_VAR_ADDR:%.+]] = alloca [[S_INT_TY]]*,
+// CHECK: store void (i8*, ...)* bitcast (void ([[PRIVATES_TMAIN_TY]]*, i32**, [2 x i32]**, [2 x [[S_INT_TY]]]**, [[S_INT_TY]]**)* [[PRIVATES_MAP_FN]] to void (i8*, ...)*), void (i8*, ...)** [[MAP_FN_ADDR:%.+]],
+// CHECK: [[MAP_FN:%.+]] = load void (i8*, ...)*, void (i8*, ...)** [[MAP_FN_ADDR]],
+// CHECK: call void (i8*, ...) [[MAP_FN]](i8* %{{.+}}, i32** [[PRIV_T_VAR_ADDR]], [2 x i32]** [[PRIV_VEC_ADDR]], [2 x [[S_INT_TY]]]** [[PRIV_S_ARR_ADDR]], [[S_INT_TY]]** [[PRIV_VAR_ADDR]])
+// CHECK: [[PRIV_T_VAR:%.+]] = load i32*, i32** [[PRIV_T_VAR_ADDR]],
+// CHECK: [[PRIV_VEC:%.+]] = load [2 x i32]*, [2 x i32]** [[PRIV_VEC_ADDR]],
+// CHECK: [[PRIV_S_ARR:%.+]] = load [2 x [[S_INT_TY]]]*, [2 x [[S_INT_TY]]]** [[PRIV_S_ARR_ADDR]],
+// CHECK: [[PRIV_VAR:%.+]] = load [[S_INT_TY]]*, [[S_INT_TY]]** [[PRIV_VAR_ADDR]],
+
+// Privates actually are used.
+// CHECK-DAG: [[PRIV_VAR]]
+// CHECK-DAG: [[PRIV_T_VAR]]
+// CHECK-DAG: [[PRIV_S_ARR]]
+// CHECK-DAG: [[PRIV_VEC]]
+
+// CHECK: ret
+
+// CHECK: define internal void [[TMAIN_DUP]]([[KMP_TASK_TMAIN_TY]]* %0, [[KMP_TASK_TMAIN_TY]]* %1, i32 %2)
+// CHECK: getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* %{{.+}}, i32 0, i32 2
+// CHECK: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* %{{.+}}, i32 0, i32 2
+// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i64 2
+// CHECK: br i1 %
+
+// CHECK: phi [[S_INT_TY]]*
+// CHECK: call {{.*}} [[S_INT_TY_COPY_CONSTR]]([[S_INT_TY]]*
+// CHECK: getelementptr [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i32 1
+// CHECK: icmp eq [[S_INT_TY]]* %
+// CHECK: br i1 %
+
+// CHECK: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* %{{.+}}, i32 0, i32 3
+// CHECK: call {{.*}} [[S_INT_TY_COPY_CONSTR]]([[S_INT_TY]]*
+// CHECK: ret void
+
+// CHECK: define internal i32 [[DESTRUCTORS]](i32 %0, [[KMP_TASK_TMAIN_TY]]* noalias %1)
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: call void @_ZN1SIiED1Ev([[S_INT_TY]]* [[PRIVATE_VAR_REF]])
+// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* [[PRIVATE_S_ARR_REF]], i{{.+}} 0, i{{.+}} 0
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i{{.+}} 2
+// CHECK: [[PRIVATE_S_ARR_ELEM_REF:%.+]] = getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i{{.+}} -1
+// CHECK: call void @_ZN1SIiED1Ev([[S_INT_TY]]* [[PRIVATE_S_ARR_ELEM_REF]])
+// CHECK: icmp eq
+// CHECK: br i1
+// CHECK: ret i32
+
+#endif
+#else
+// ARRAY-LABEL: array_func
+struct St {
+ int a, b;
+ St() : a(0), b(0) {}
+ St(const St &) {}
+ ~St() {}
+};
+
+void array_func(int n, float a[n], St s[2]) {
+// ARRAY: call i8* @__kmpc_omp_task_alloc(
+// ARRAY: call void @__kmpc_taskloop(
+// ARRAY: store float** %{{.+}}, float*** %{{.+}},
+// ARRAY: store %struct.St** %{{.+}}, %struct.St*** %{{.+}},
+#pragma omp parallel master taskloop firstprivate(a, s)
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+#endif
+
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_firstprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_firstprivate_messages.cpp
new file mode 100644
index 0000000..55184e2
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_firstprivate_messages.cpp
@@ -0,0 +1,335 @@
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+
+typedef void **omp_allocator_handle_t;
+extern const omp_allocator_handle_t omp_default_mem_alloc;
+extern const omp_allocator_handle_t omp_large_cap_mem_alloc;
+extern const omp_allocator_handle_t omp_const_mem_alloc;
+extern const omp_allocator_handle_t omp_high_bw_mem_alloc;
+extern const omp_allocator_handle_t omp_low_lat_mem_alloc;
+extern const omp_allocator_handle_t omp_cgroup_mem_alloc;
+extern const omp_allocator_handle_t omp_pteam_mem_alloc;
+extern const omp_allocator_handle_t omp_thread_mem_alloc;
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp parallel master taskloop firstprivate(fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
+struct S1; // expected-note 2 {{declared here}} expected-note 2 {{forward declaration of 'S1'}}
+extern S1 a;
+class S2 {
+ mutable int a;
+
+public:
+ S2() : a(0) {}
+ S2(const 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;
+ S3 &operator=(const S3 &s3);
+
+public:
+ S3() : a(0) {} // expected-note 2 {{candidate constructor not viable: requires 0 arguments, but 1 was provided}}
+ S3(S3 &s3) : a(s3.a) {} // expected-note 2 {{candidate constructor not viable: 1st argument ('const S3') would lose const qualifier}}
+};
+const S3 c;
+const S3 ca[5];
+extern const int f;
+class S4 {
+ int a;
+ S4();
+ S4(const S4 &s4); // expected-note 2 {{implicitly declared private here}}
+
+public:
+ S4(int v) : a(v) {}
+};
+class S5 {
+ int a;
+ S5(const S5 &s5) : a(s5.a) {} // expected-note 4 {{implicitly declared private here}}
+
+public:
+ S5() : a(0) {}
+ S5(int v) : a(v) {}
+};
+class S6 {
+ int a;
+ S6() : a(0) {}
+
+public:
+ S6(const S6 &s6) : a(s6.a) {}
+ S6(int v) : a(v) {}
+};
+
+S3 h;
+#pragma omp threadprivate(h) // expected-note 2 {{defined as threadprivate or thread local}}
+
+template <class I, class C>
+int foomain(int argc, char **argv) {
+ I e(4);
+ C g(5);
+ int i, z;
+ int &j = i;
+#pragma omp parallel
+#pragma omp parallel master taskloop firstprivate // expected-error {{expected '(' after 'firstprivate'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop firstprivate( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop firstprivate() // expected-error {{expected expression}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop firstprivate(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop firstprivate(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop firstprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop allocate(omp_thread_mem_alloc: argc) firstprivate(argc) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'parallel master taskloop' directive}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop firstprivate(S1) // expected-error {{'S1' does not refer to a value}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop firstprivate(a, b) // expected-error {{firstprivate variable with incomplete type 'S1'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop firstprivate(argv[1]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop firstprivate(z, e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop firstprivate(h) // expected-error {{threadprivate or thread local variable cannot be firstprivate}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+ {
+ int v = 0;
+ int i;
+#pragma omp parallel master taskloop firstprivate(i)
+ for (int k = 0; k < argc; ++k) {
+ i = k;
+ v += i;
+ }
+ }
+#pragma omp parallel shared(i)
+#pragma omp parallel private(i)
+#pragma omp parallel master taskloop firstprivate(j)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop firstprivate(i)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(g) firstprivate(g) // expected-error {{calling a private constructor of class 'S5'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel private(i)
+#pragma omp parallel master taskloop firstprivate(i) // expected-note 2 {{defined as firstprivate}}
+ for (i = 0; i < argc; ++i) // expected-error 2 {{loop iteration variable in the associated loop of 'omp parallel master taskloop' directive may not be firstprivate, predetermined as private}}
+ foo();
+#pragma omp parallel reduction(+ : i) // expected-note {{defined as reduction}}
+#pragma omp parallel master taskloop firstprivate(i) // expected-note {{defined as firstprivate}} expected-error {{argument of a reduction clause of a parallel construct must not appear in a firstprivate clause on a task construct}}
+ for (i = 0; i < argc; ++i) // expected-error {{loop iteration variable in the associated loop of 'omp parallel master taskloop' directive may not be firstprivate, predetermined as private}}
+ foo();
+ return 0;
+}
+
+void bar(S4 a[2]) {
+#pragma omp parallel
+#pragma omp parallel master taskloop firstprivate(a)
+ for (int i = 0; i < 2; ++i)
+ foo();
+}
+
+namespace A {
+double x;
+#pragma omp threadprivate(x) // expected-note {{defined as threadprivate or thread local}}
+}
+namespace B {
+using A::x;
+}
+
+int main(int argc, char **argv) {
+ const int d = 5;
+ const int da[5] = {0};
+ S4 e(4);
+ S5 g(5);
+ S3 m;
+ S6 n(2);
+ int i;
+ int &j = i;
+#pragma omp parallel
+#pragma omp parallel master taskloop firstprivate // expected-error {{expected '(' after 'firstprivate'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop firstprivate( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop firstprivate() // expected-error {{expected expression}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop firstprivate(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop firstprivate(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop firstprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop firstprivate(S1) // expected-error {{'S1' does not refer to a value}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop firstprivate(a, b, c, d, f) // expected-error {{firstprivate variable with incomplete type 'S1'}} expected-error {{no matching constructor for initialization of 'S3'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop firstprivate(argv[1]) // expected-error {{expected variable name}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop firstprivate(2 * 2) // expected-error {{expected variable name}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop firstprivate(ba) // OK
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop firstprivate(ca) // expected-error {{no matching constructor for initialization of 'S3'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop firstprivate(da) // OK
+ for (i = 0; i < argc; ++i)
+ foo();
+ int xa;
+#pragma omp parallel
+#pragma omp parallel master taskloop firstprivate(xa) // OK
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop firstprivate(S2::S2s) // OK
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop firstprivate(S2::S2sc) // OK
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop safelen(5) // expected-error {{unexpected OpenMP clause 'safelen' in directive '#pragma omp parallel master taskloop'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop firstprivate(e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop firstprivate(m) // OK
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop firstprivate(h) // expected-error {{threadprivate or thread local variable cannot be firstprivate}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop private(xa), firstprivate(xa) // expected-error {{private variable cannot be firstprivate}} expected-note {{defined as private}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop firstprivate(i) // expected-note {{defined as firstprivate}}
+ for (i = 0; i < argc; ++i) // expected-error {{loop iteration variable in the associated loop of 'omp parallel master taskloop' directive may not be firstprivate, predetermined as private}}
+ foo();
+#pragma omp parallel shared(xa)
+#pragma omp parallel master taskloop firstprivate(xa) // OK: may be firstprivate
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop firstprivate(j)
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(g) firstprivate(g) // expected-error {{calling a private constructor of class 'S5'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(n) firstprivate(n) // OK
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+ {
+ int v = 0;
+ int i;
+#pragma omp parallel master taskloop firstprivate(i)
+ for (int k = 0; k < argc; ++k) {
+ i = k;
+ v += i;
+ }
+ }
+#pragma omp parallel private(i)
+#pragma omp parallel master taskloop firstprivate(i) // expected-note {{defined as firstprivate}}
+ for (i = 0; i < argc; ++i) // expected-error {{loop iteration variable in the associated loop of 'omp parallel master taskloop' directive may not be firstprivate, predetermined as private}}
+ foo();
+#pragma omp parallel reduction(+ : i) // expected-note {{defined as reduction}}
+#pragma omp parallel master taskloop firstprivate(i) //expected-error {{argument of a reduction clause of a parallel construct must not appear in a firstprivate clause on a task construct}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel master taskloop firstprivate(i) //expected-note {{defined as firstprivate}}
+ for (i = 0; i < argc; ++i) // expected-error {{loop iteration variable in the associated loop of 'omp parallel master taskloop' directive may not be firstprivate, predetermined as private}}
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop firstprivate(B::x) // expected-error {{threadprivate or thread local variable cannot be firstprivate}}
+ for (i = 0; i < argc; ++i)
+ foo();
+ static int si;
+#pragma omp parallel master taskloop firstprivate(si) // OK
+ for (i = 0; i < argc; ++i)
+ si = i + 1;
+
+ return foomain<S4, S5>(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<S4, S5>' requested here}}
+}
+
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_grainsize_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_grainsize_messages.cpp
new file mode 100644
index 0000000..676ce86
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_grainsize_messages.cpp
@@ -0,0 +1,103 @@
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+struct S1; // expected-note {{declared here}}
+
+template <class T, class S> // expected-note {{declared here}}
+int tmain(T argc, S **argv) {
+ T z;
+ #pragma omp parallel master taskloop grainsize // expected-error {{expected '(' after 'grainsize'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop grainsize ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop grainsize () // expected-error {{expected expression}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop grainsize (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop grainsize (argc)) // expected-warning {{extra tokens at the end of '#pragma omp parallel master taskloop' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop grainsize (argc > 0 ? argv[1][0] : argv[2][argc] + z)
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop grainsize (foobool(argc)), grainsize (true) // expected-error {{directive '#pragma omp parallel master taskloop' cannot contain more than one 'grainsize' clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop grainsize (S) // expected-error {{'S' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop grainsize (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop grainsize(0) // expected-error {{argument to 'grainsize' clause must be a strictly positive integer value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop grainsize(-1) // expected-error {{argument to 'grainsize' clause must be a strictly positive integer value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop grainsize(argc) num_tasks(argc) // expected-error {{'num_tasks' and 'grainsize' clause are mutually exclusive and may not appear on the same directive}} expected-note {{'grainsize' clause is specified here}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+
+ return 0;
+}
+
+int main(int argc, char **argv) {
+ int z;
+ #pragma omp parallel master taskloop grainsize // expected-error {{expected '(' after 'grainsize'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop grainsize ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop grainsize () // expected-error {{expected expression}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop grainsize (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop grainsize (argc)) // expected-warning {{extra tokens at the end of '#pragma omp parallel master taskloop' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop grainsize (argc > 0 ? argv[1][0] : argv[2][argc] + z)
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop grainsize (foobool(argc)), grainsize (true) // expected-error {{directive '#pragma omp parallel master taskloop' cannot contain more than one 'grainsize' clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop grainsize (S1) // expected-error {{'S1' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop grainsize (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop grainsize (1 0) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop grainsize(if(tmain(argc, argv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop grainsize(0) // expected-error {{argument to 'grainsize' clause must be a strictly positive integer value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop grainsize(-1) // expected-error {{argument to 'grainsize' clause must be a strictly positive integer value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop grainsize(argc) num_tasks(argc) // expected-error {{'num_tasks' and 'grainsize' clause are mutually exclusive and may not appear on the same directive}} expected-note {{'grainsize' clause is specified here}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+
+ return tmain(argc, argv);
+}
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_lastprivate_codegen.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_lastprivate_codegen.cpp
new file mode 100644
index 0000000..52cd266
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_lastprivate_codegen.cpp
@@ -0,0 +1,527 @@
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-apple-darwin10 -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=LAMBDA %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=BLOCKS %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DARRAY -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=ARRAY %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DLOOP -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=LOOP %s
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DARRAY -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DLOOP -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=SIMD-ONLY0 %s
+// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
+// expected-no-diagnostics
+
+#if !defined(ARRAY) && !defined(LOOP)
+#ifndef HEADER
+#define HEADER
+
+template <class T>
+struct S {
+ T f;
+ S(T a) : f(a) {}
+ S() : f() {}
+ S(const S &s, T t = T()) : f(s.f + t) {}
+ operator T() { return T(); }
+ ~S() {}
+};
+
+volatile double g;
+
+// CHECK-DAG: [[KMP_TASK_T_TY:%.+]] = type { i8*, i32 (i32, i8*)*, i32, %union{{.+}}, %union{{.+}}, i64, i64, i64, i32, i8* }
+// CHECK-DAG: [[S_DOUBLE_TY:%.+]] = type { double }
+// CHECK-DAG: [[PRIVATES_MAIN_TY:%.+]] = type {{.?}}{ [2 x [[S_DOUBLE_TY]]], [[S_DOUBLE_TY]], i32, [2 x i32]
+// CHECK-DAG: [[CAP_MAIN_TY:%.+]] = type { [2 x i32]*, i32*, [2 x [[S_DOUBLE_TY]]]*, [[S_DOUBLE_TY]]*, i{{[0-9]+}}* }
+// CHECK-DAG: [[KMP_TASK_MAIN_TY:%.+]] = type { [[KMP_TASK_T_TY]], [[PRIVATES_MAIN_TY]] }
+// CHECK-DAG: [[S_INT_TY:%.+]] = type { i32 }
+// CHECK-DAG: [[CAP_TMAIN_TY:%.+]] = type { [2 x i32]*, i32*, [2 x [[S_INT_TY]]]*, [[S_INT_TY]]* }
+// CHECK-DAG: [[PRIVATES_TMAIN_TY:%.+]] = type { i32, [2 x i32], [2 x [[S_INT_TY]]], [[S_INT_TY]], [104 x i8] }
+// CHECK-DAG: [[KMP_TASK_TMAIN_TY:%.+]] = type { [[KMP_TASK_T_TY]], [{{[0-9]+}} x i8], [[PRIVATES_TMAIN_TY]] }
+template <typename T>
+T tmain() {
+ S<T> ttt;
+ S<T> test;
+ T t_var __attribute__((aligned(128))) = T();
+ T vec[] = {1, 2};
+ S<T> s_arr[] = {1, 2};
+ S<T> var(3);
+#pragma omp parallel master taskloop lastprivate(t_var, vec, s_arr, s_arr, var, var)
+ for (int i = 0; i < 10; ++i) {
+ vec[0] = t_var;
+ s_arr[0] = var;
+ }
+ return T();
+}
+
+int main() {
+ static int sivar;
+#ifdef LAMBDA
+ // LAMBDA: [[G:@.+]] = global double
+ // LAMBDA: [[SIVAR:@.+]] = internal global i{{[0-9]+}} 0,
+ // LAMBDA-LABEL: @main
+ // LAMBDA: call{{( x86_thiscallcc)?}} void [[OUTER_LAMBDA:@.+]](
+ [&]() {
+ // LAMBDA: define{{.*}} internal{{.*}} void [[OUTER_LAMBDA]](
+ // LAMBDA: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc(%{{[^ ]+}} @{{[^,]+}}, i32 %{{[^,]+}}, i32 1, i64 96, i64 16, i32 (i32, i8*)* bitcast (i32 (i32, %{{[^*]+}}*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+// LAMBDA: [[PRIVATES:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i{{.+}} 0, i{{.+}} 1
+
+// LAMBDA: call void @__kmpc_taskloop(%{{.+}}* @{{.+}}, i32 %{{.+}}, i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* bitcast (void ([[KMP_TASK_MAIN_TY:%[^*]+]]*, [[KMP_TASK_MAIN_TY]]*, i32)* [[MAIN_DUP:@.+]] to i8*))
+// LAMBDA: ret
+#pragma omp parallel master taskloop lastprivate(g, sivar)
+ for (int i = 0; i < 10; ++i) {
+ // LAMBDA: define {{.+}} void [[INNER_LAMBDA:@.+]](%{{.+}}* [[ARG_PTR:%.+]])
+ // LAMBDA: store %{{.+}}* [[ARG_PTR]], %{{.+}}** [[ARG_PTR_REF:%.+]],
+ // LAMBDA: [[ARG_PTR:%.+]] = load %{{.+}}*, %{{.+}}** [[ARG_PTR_REF]]
+ // LAMBDA: [[G_PTR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[ARG_PTR]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+ // LAMBDA: [[G_REF:%.+]] = load double*, double** [[G_PTR_REF]]
+ // LAMBDA: store double 2.0{{.+}}, double* [[G_REF]]
+
+ // LAMBDA: store double* %{{.+}}, double** %{{.+}},
+ // LAMBDA: define internal i32 [[TASK_ENTRY]](i32 %0, %{{.+}}* noalias %1)
+ g = 1;
+ sivar = 11;
+ // LAMBDA: store double 1.0{{.+}}, double* %{{.+}},
+ // LAMBDA: store i{{[0-9]+}} 11, i{{[0-9]+}}* %{{.+}},
+ // LAMBDA: call void [[INNER_LAMBDA]](%
+ // LAMBDA: icmp ne i32 %{{.+}}, 0
+ // LAMBDA: br i1
+ // LAMBDA: load double, double* %
+ // LAMBDA: store volatile double %
+ // LAMBDA: load i32, i32* %
+ // LAMBDA: store i32 %
+ // LAMBDA: ret
+ [&]() {
+ g = 2;
+ sivar = 22;
+ }();
+ }
+ }();
+ return 0;
+#elif defined(BLOCKS)
+ // BLOCKS: [[G:@.+]] = global double
+ // BLOCKS-LABEL: @main
+ // BLOCKS: call void {{%.+}}(i8
+ ^{
+ // BLOCKS: define{{.*}} internal{{.*}} void {{.+}}(i8*
+ // BLOCKS: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc(%{{[^ ]+}} @{{[^,]+}}, i32 %{{[^,]+}}, i32 1, i64 96, i64 16, i32 (i32, i8*)* bitcast (i32 (i32, %{{[^*]+}}*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+ // BLOCKS: [[PRIVATES:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i{{.+}} 0, i{{.+}} 1
+ // BLOCKS: call void @__kmpc_taskloop(%{{.+}}* @{{.+}}, i32 %{{.+}}, i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* bitcast (void ([[KMP_TASK_MAIN_TY:%[^*]+]]*, [[KMP_TASK_MAIN_TY]]*, i32)* [[MAIN_DUP:@.+]] to i8*))
+ // BLOCKS: ret
+#pragma omp parallel master taskloop lastprivate(g, sivar)
+ for (int i = 0; i < 10; ++i) {
+ // BLOCKS: define {{.+}} void {{@.+}}(i8*
+ // BLOCKS-NOT: [[G]]{{[[^:word:]]}}
+ // BLOCKS: store double 2.0{{.+}}, double*
+ // BLOCKS-NOT: [[G]]{{[[^:word:]]}}
+ // BLOCKS-NOT: [[ISVAR]]{{[[^:word:]]}}
+ // BLOCKS: store i{{[0-9]+}} 22, i{{[0-9]+}}*
+ // BLOCKS-NOT: [[SIVAR]]{{[[^:word:]]}}
+ // BLOCKS: ret
+
+ // BLOCKS: store double* %{{.+}}, double** %{{.+}},
+ // BLOCKS: store i{{[0-9]+}}* %{{.+}}, i{{[0-9]+}}** %{{.+}},
+ // BLOCKS: define internal i32 [[TASK_ENTRY]](i32 %0, %{{.+}}* noalias %1)
+ g = 1;
+ sivar = 11;
+ // BLOCKS: store double 1.0{{.+}}, double* %{{.+}},
+ // BLOCKS-NOT: [[G]]{{[[^:word:]]}}
+ // BLOCKS: store i{{[0-9]+}} 11, i{{[0-9]+}}* %{{.+}},
+ // BLOCKS-NOT: [[SIVAR]]{{[[^:word:]]}}
+ // BLOCKS: call void {{%.+}}(i8
+ // BLOCKS: icmp ne i32 %{{.+}}, 0
+ // BLOCKS: br i1
+ // BLOCKS: load double, double* %
+ // BLOCKS: store volatile double %
+ // BLOCKS: load i32, i32* %
+ // BLOCKS: store i32 %
+ ^{
+ g = 2;
+ sivar = 22;
+ }();
+ }
+ }();
+ return 0;
+#else
+ S<double> ttt;
+ S<double> test;
+ int t_var = 0;
+ int vec[] = {1, 2};
+ S<double> s_arr[] = {1, 2};
+ S<double> var(3);
+#pragma omp parallel master taskloop lastprivate(var, t_var, s_arr, vec, s_arr, var, sivar)
+ for (int i = 0; i < 10; ++i) {
+ vec[0] = t_var;
+ s_arr[0] = var;
+ sivar = 33;
+ }
+ return tmain<int>();
+#endif
+}
+
+// CHECK: [[SIVAR:.+]] = internal global i{{[0-9]+}} 0,
+// CHECK: define i{{[0-9]+}} @main()
+// CHECK: alloca [[S_DOUBLE_TY]],
+// CHECK: [[TEST:%.+]] = alloca [[S_DOUBLE_TY]],
+// CHECK: [[T_VAR_ADDR:%.+]] = alloca i32,
+// CHECK: [[VEC_ADDR:%.+]] = alloca [2 x i32],
+// CHECK: [[S_ARR_ADDR:%.+]] = alloca [2 x [[S_DOUBLE_TY]]],
+// CHECK: [[VAR_ADDR:%.+]] = alloca [[S_DOUBLE_TY]],
+
+// CHECK: call {{.*}} [[S_DOUBLE_TY_CONSTR:@.+]]([[S_DOUBLE_TY]]* [[TEST]])
+
+// CHECK: [[RES:%.+]] = call {{.*}}i32 @__kmpc_master(
+// CHECK-NEXT: [[IS_MASTER:%.+]] = icmp ne i32 [[RES]], 0
+// CHECK-NEXT: br i1 [[IS_MASTER]], label {{%?}}[[THEN:.+]], label {{%?}}[[EXIT:.+]]
+// CHECK: [[THEN]]
+// Store original variables in capture struct.
+// CHECK: [[VEC_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: store [2 x i32]* [[VEC_ADDR:%.+]], [2 x i32]** [[VEC_REF]],
+// CHECK: [[T_VAR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 1
+// CHECK: store i32* [[T_VAR_ADDR:%.+]], i32** [[T_VAR_REF]],
+// CHECK: [[S_ARR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 2
+// CHECK: store [2 x [[S_DOUBLE_TY]]]* [[S_ARR_ADDR:%.+]], [2 x [[S_DOUBLE_TY]]]** [[S_ARR_REF]],
+// CHECK: [[VAR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 3
+// CHECK: store [[S_DOUBLE_TY]]* [[VAR_ADDR:%.+]], [[S_DOUBLE_TY]]** [[VAR_REF]],
+// CHECK: [[SIVAR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 4
+// CHECK: store i{{[0-9]+}}* [[SIVAR:%.+]], i{{[0-9]+}}** [[SIVAR_REF]],
+
+// Allocate task.
+// Returns struct kmp_task_t {
+// [[KMP_TASK_T]] task_data;
+// [[KMP_TASK_MAIN_TY]] privates;
+// };
+// CHECK: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc([[LOC:%.+]], i32 [[GTID:%.+]], i32 9, i64 120, i64 40, i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_MAIN_TY]]*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+// CHECK: [[RES_KMP_TASK:%.+]] = bitcast i8* [[RES]] to [[KMP_TASK_MAIN_TY]]*
+
+// Fill kmp_task_t->shareds by copying from original capture argument.
+// CHECK: [[TASK:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: [[SHAREDS_REF_ADDR:%.+]] = getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* [[TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: [[SHAREDS_REF:%.+]] = load i8*, i8** [[SHAREDS_REF_ADDR]],
+// CHECK: [[CAPTURES_ADDR:%.+]] = bitcast [[CAP_MAIN_TY]]* %{{.+}} to i8*
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 [[SHAREDS_REF]], i8* align 8 [[CAPTURES_ADDR]], i64 40, i1 false)
+
+// Initialize kmp_task_t->privates with default values (no init for simple types, default constructors for classes).
+// Also copy address of private copy to the corresponding shareds reference.
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
+
+// Constructors for s_arr and var.
+// s_arr;
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: call {{.*}} [[S_DOUBLE_TY_CONSTR]]([[S_DOUBLE_TY]]* [[S_ARR_CUR:%[^,]+]])
+// CHECK: getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* [[S_ARR_CUR]], i{{.+}} 1
+// CHECK: icmp eq
+// CHECK: br i1
+
+// var;
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
+// CHECK: call {{.*}} [[S_DOUBLE_TY_CONSTR]]([[S_DOUBLE_TY]]* [[PRIVATE_VAR_REF]])
+
+// t_var;
+// vec;
+// sivar;
+
+// Provide pointer to destructor function, which will destroy private variables at the end of the task.
+// CHECK: [[DESTRUCTORS_REF:%.+]] = getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* [[TASK]], i{{.+}} 0, i{{.+}} 3
+// CHECK: [[DESTRUCTORS_PTR:%.+]] = bitcast %union{{.+}}* [[DESTRUCTORS_REF]] to i32 (i32, i8*)**
+// CHECK: store i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_MAIN_TY]]*)* [[DESTRUCTORS:@.+]] to i32 (i32, i8*)*), i32 (i32, i8*)** [[DESTRUCTORS_PTR]],
+
+// Start task.
+// CHECK: call void @__kmpc_taskloop([[LOC]], i32 [[GTID]], i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* bitcast (void ([[KMP_TASK_MAIN_TY]]*, [[KMP_TASK_MAIN_TY]]*, i32)* [[MAIN_DUP:@.+]] to i8*))
+// CHECK: call {{.*}}void @__kmpc_end_master(
+// CHECK-NEXT: br label {{%?}}[[EXIT]]
+// CHECK: [[EXIT]]
+
+// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_MAIN_TY]]* noalias %0, [[S_DOUBLE_TY]]** noalias %1, i32** noalias %2, [2 x [[S_DOUBLE_TY]]]** noalias %3, [2 x i32]** noalias %4, i32** noalias %5)
+// CHECK: [[PRIVATES:%.+]] = load [[PRIVATES_MAIN_TY]]*, [[PRIVATES_MAIN_TY]]**
+// CHECK: [[PRIV_S_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 0
+// CHECK: [[ARG3:%.+]] = load [2 x [[S_DOUBLE_TY]]]**, [2 x [[S_DOUBLE_TY]]]*** %{{.+}},
+// CHECK: store [2 x [[S_DOUBLE_TY]]]* [[PRIV_S_VAR]], [2 x [[S_DOUBLE_TY]]]** [[ARG3]],
+// CHECK: [[PRIV_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 1
+// CHECK: [[ARG1:%.+]] = load [[S_DOUBLE_TY]]**, [[S_DOUBLE_TY]]*** {{.+}},
+// CHECK: store [[S_DOUBLE_TY]]* [[PRIV_VAR]], [[S_DOUBLE_TY]]** [[ARG1]],
+// CHECK: [[PRIV_T_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 2
+// CHECK: [[ARG2:%.+]] = load i32**, i32*** %{{.+}},
+// CHECK: store i32* [[PRIV_T_VAR]], i32** [[ARG2]],
+// CHECK: [[PRIV_VEC:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 3
+// CHECK: [[ARG4:%.+]] = load [2 x i32]**, [2 x i32]*** %{{.+}},
+// CHECK: store [2 x i32]* [[PRIV_VEC]], [2 x i32]** [[ARG4]],
+// CHECK: [[PRIV_SIVAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 4
+// CHECK: [[ARG5:%.+]] = load i{{[0-9]+}}**, i{{[0-9]+}}*** %{{.+}},
+// CHECK: store i{{[0-9]+}}* [[PRIV_SIVAR]], i{{[0-9]+}}** [[ARG5]],
+// CHECK: ret void
+
+// CHECK: define internal i32 [[TASK_ENTRY]](i32 %0, [[KMP_TASK_MAIN_TY]]* noalias %1)
+
+// CHECK: [[PRIV_VAR_ADDR:%.+]] = alloca [[S_DOUBLE_TY]]*,
+// CHECK: [[PRIV_T_VAR_ADDR:%.+]] = alloca i32*,
+// CHECK: [[PRIV_S_ARR_ADDR:%.+]] = alloca [2 x [[S_DOUBLE_TY]]]*,
+// CHECK: [[PRIV_VEC_ADDR:%.+]] = alloca [2 x i32]*,
+// CHECK: [[PRIV_SIVAR_ADDR:%.+]] = alloca i32*,
+// CHECK: store void (i8*, ...)* bitcast (void ([[PRIVATES_MAIN_TY]]*, [[S_DOUBLE_TY]]**, i32**, [2 x [[S_DOUBLE_TY]]]**, [2 x i32]**, i32**)* [[PRIVATES_MAP_FN]] to void (i8*, ...)*), void (i8*, ...)** [[MAP_FN_ADDR:%.+]],
+// CHECK: [[MAP_FN:%.+]] = load void (i8*, ...)*, void (i8*, ...)** [[MAP_FN_ADDR]],
+
+// CHECK: call void (i8*, ...) [[MAP_FN]](i8* %{{.+}}, [[S_DOUBLE_TY]]** [[PRIV_VAR_ADDR]], i32** [[PRIV_T_VAR_ADDR]], [2 x [[S_DOUBLE_TY]]]** [[PRIV_S_ARR_ADDR]], [2 x i32]** [[PRIV_VEC_ADDR]], i32** [[PRIV_SIVAR_ADDR]])
+
+// CHECK: [[PRIV_VAR:%.+]] = load [[S_DOUBLE_TY]]*, [[S_DOUBLE_TY]]** [[PRIV_VAR_ADDR]],
+// CHECK: [[PRIV_T_VAR:%.+]] = load i32*, i32** [[PRIV_T_VAR_ADDR]],
+// CHECK: [[PRIV_S_ARR:%.+]] = load [2 x [[S_DOUBLE_TY]]]*, [2 x [[S_DOUBLE_TY]]]** [[PRIV_S_ARR_ADDR]],
+// CHECK: [[PRIV_VEC:%.+]] = load [2 x i32]*, [2 x i32]** [[PRIV_VEC_ADDR]],
+// CHECK: [[PRIV_SIVAR:%.+]] = load i32*, i32** [[PRIV_SIVAR_ADDR]],
+
+// Privates actually are used.
+// CHECK-DAG: [[PRIV_VAR]]
+// CHECK-DAG: [[PRIV_T_VAR]]
+// CHECK-DAG: [[PRIV_S_ARR]]
+// CHECK-DAG: [[PRIV_VEC]]
+// CHECK-DAG: [[PRIV_SIVAR]]
+
+// CHECK: icmp ne i32 %{{.+}}, 0
+// CHECK-NEXT: br i1
+// CHECK: bitcast [[S_DOUBLE_TY]]* %{{.+}} to i8*
+// CHECK: bitcast [[S_DOUBLE_TY]]* %{{.+}} to i8*
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align {{[0-9]+}} %
+// CHECK: load i32, i32* %
+// CHECK: store i32 %{{.+}}, i32* %
+// CHECK: getelementptr inbounds [2 x [[S_DOUBLE_TY]]], [2 x [[S_DOUBLE_TY]]]* %
+// CHECK: phi [[S_DOUBLE_TY]]*
+// CHECK: phi [[S_DOUBLE_TY]]*
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align {{[0-9]+}} %
+// CHECK: icmp eq [[S_DOUBLE_TY]]* %
+// CHECK-NEXT: br i1
+// CHECK: bitcast [2 x i32]* %{{.+}} to i8*
+// CHECK: bitcast [2 x i32]* %{{.+}} to i8*
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align {{[0-9]+}} %
+// CHECK: load i32, i32* %
+// CHECK: store i32 %{{.+}}, i32* %
+// CHECK: br label
+// CHECK: ret
+
+// CHECK: define internal void [[MAIN_DUP]]([[KMP_TASK_MAIN_TY]]* %0, [[KMP_TASK_MAIN_TY]]* %1, i32 %2)
+// CHECK: getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* %{{.+}}, i32 0, i32 8
+// CHECK: load i32, i32* %
+// CHECK: store i32 %{{.+}}, i32* %
+// CHECK: getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* %{{.+}}, i32 0, i32 1
+// CHECK: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr inbounds [2 x [[S_DOUBLE_TY]]], [2 x [[S_DOUBLE_TY]]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i64 2
+// CHECK: br label %
+
+// CHECK: phi [[S_DOUBLE_TY]]*
+// CHECK: call {{.*}} [[S_DOUBLE_TY_CONSTR]]([[S_DOUBLE_TY]]*
+// CHECK: getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i64 1
+// CHECK: icmp eq [[S_DOUBLE_TY]]* %
+// CHECK: br i1 %
+
+// CHECK: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* %{{.+}}, i32 0, i32 1
+// CHECK: call {{.*}} [[S_DOUBLE_TY_CONSTR]]([[S_DOUBLE_TY]]*
+// CHECK: ret void
+
+// CHECK: define internal i32 [[DESTRUCTORS]](i32 %0, [[KMP_TASK_MAIN_TY]]* noalias %1)
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 0
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
+// CHECK: call {{.*}} @_ZN1SIdED1Ev([[S_DOUBLE_TY]]* [[PRIVATE_VAR_REF]])
+// CHECK: getelementptr inbounds [2 x [[S_DOUBLE_TY]]], [2 x [[S_DOUBLE_TY]]]* [[PRIVATE_S_ARR_REF]], i{{.+}} 0, i{{.+}} 0
+// CHECK: getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i{{.+}} 2
+// CHECK: [[PRIVATE_S_ARR_ELEM_REF:%.+]] = getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i{{.+}} -1
+// CHECK: call {{.*}} @_ZN1SIdED1Ev([[S_DOUBLE_TY]]* [[PRIVATE_S_ARR_ELEM_REF]])
+// CHECK: icmp eq
+// CHECK: br i1
+// CHECK: ret i32
+
+// CHECK: define {{.*}} i{{[0-9]+}} [[TMAIN_INT:@.+]]()
+// CHECK: alloca [[S_INT_TY]],
+// CHECK: [[TEST:%.+]] = alloca [[S_INT_TY]],
+// CHECK: [[T_VAR_ADDR:%.+]] = alloca i32, align 128
+// CHECK: [[VEC_ADDR:%.+]] = alloca [2 x i32],
+// CHECK: [[S_ARR_ADDR:%.+]] = alloca [2 x [[S_INT_TY]]],
+// CHECK: [[VAR_ADDR:%.+]] = alloca [[S_INT_TY]],
+
+// CHECK: call {{.*}} [[S_INT_TY_CONSTR:@.+]]([[S_INT_TY]]* [[TEST]])
+
+// Store original variables in capture struct.
+// CHECK: [[VEC_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: store [2 x i32]* [[VEC_ADDR:%.+]], [2 x i32]** [[VEC_REF]],
+// CHECK: [[T_VAR_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 1
+// CHECK: store i32* [[T_VAR_ADDR:%.+]], i32** [[T_VAR_REF]],
+// CHECK: [[S_ARR_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 2
+// CHECK: store [2 x [[S_INT_TY]]]* [[S_ARR_ADDR:%.+]], [2 x [[S_INT_TY]]]** [[S_ARR_REF]],
+// CHECK: [[VAR_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 3
+// CHECK: store [[S_INT_TY]]* [[VAR_ADDR:%.+]], [[S_INT_TY]]** [[VAR_REF]],
+
+// Allocate task.
+// Returns struct kmp_task_t {
+// [[KMP_TASK_T_TY]] task_data;
+// [[KMP_TASK_TMAIN_TY]] privates;
+// };
+// CHECK: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc([[LOC]], i32 [[GTID:%.+]], i32 9, i64 256, i64 32, i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_TMAIN_TY]]*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+// CHECK: [[RES_KMP_TASK:%.+]] = bitcast i8* [[RES]] to [[KMP_TASK_TMAIN_TY]]*
+
+// Fill kmp_task_t->shareds by copying from original capture argument.
+// CHECK: [[TASK:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: [[SHAREDS_REF_ADDR:%.+]] = getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* [[TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: [[SHAREDS_REF:%.+]] = load i8*, i8** [[SHAREDS_REF_ADDR]],
+// CHECK: [[CAPTURES_ADDR:%.+]] = bitcast [[CAP_TMAIN_TY]]* %{{.+}} to i8*
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 [[SHAREDS_REF]], i8* align 8 [[CAPTURES_ADDR]], i64 32, i1 false)
+
+// Initialize kmp_task_t->privates with default values (no init for simple types, default constructors for classes).
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
+
+// t_var;
+// vec;
+
+// Constructors for s_arr and var.
+// a_arr;
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
+// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* [[PRIVATE_S_ARR_REF]], i{{.+}} 0, i{{.+}} 0
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i{{.+}} 2
+// CHECK: call {{.*}} [[S_INT_TY_CONSTR]]([[S_INT_TY]]* [[S_ARR_CUR:%[^,]+]])
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* [[S_ARR_CUR]], i{{.+}} 1
+// CHECK: icmp eq
+// CHECK: br i1
+
+// var;
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: call {{.*}} [[S_INT_TY_CONSTR]]([[S_INT_TY]]* [[PRIVATE_VAR_REF]])
+
+// Provide pointer to destructor function, which will destroy private variables at the end of the task.
+// CHECK: [[DESTRUCTORS_REF:%.+]] = getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* [[TASK]], i{{.+}} 0, i{{.+}} 3
+// CHECK: [[DESTRUCTORS_PTR:%.+]] = bitcast %union{{.+}}* [[DESTRUCTORS_REF]] to i32 (i32, i8*)**
+// CHECK: store i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_TMAIN_TY]]*)* [[DESTRUCTORS:@.+]] to i32 (i32, i8*)*), i32 (i32, i8*)** [[DESTRUCTORS_PTR]],
+
+// Start task.
+// CHECK: call void @__kmpc_taskloop([[LOC]], i32 [[GTID]], i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* bitcast (void ([[KMP_TASK_TMAIN_TY]]*, [[KMP_TASK_TMAIN_TY]]*, i32)* [[TMAIN_DUP:@.+]] to i8*))
+
+// No destructors must be called for private copies of s_arr and var.
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+
+// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_TMAIN_TY]]* noalias %0, i32** noalias %1, [2 x i32]** noalias %2, [2 x [[S_INT_TY]]]** noalias %3, [[S_INT_TY]]** noalias %4)
+// CHECK: [[PRIVATES:%.+]] = load [[PRIVATES_TMAIN_TY]]*, [[PRIVATES_TMAIN_TY]]**
+// CHECK: [[PRIV_T_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 0
+// CHECK: [[ARG1:%.+]] = load i32**, i32*** %{{.+}},
+// CHECK: store i32* [[PRIV_T_VAR]], i32** [[ARG1]],
+// CHECK: [[PRIV_VEC:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 1
+// CHECK: [[ARG2:%.+]] = load [2 x i32]**, [2 x i32]*** %{{.+}},
+// CHECK: store [2 x i32]* [[PRIV_VEC]], [2 x i32]** [[ARG2]],
+// CHECK: [[PRIV_S_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 2
+// CHECK: [[ARG3:%.+]] = load [2 x [[S_INT_TY]]]**, [2 x [[S_INT_TY]]]*** %{{.+}},
+// CHECK: store [2 x [[S_INT_TY]]]* [[PRIV_S_VAR]], [2 x [[S_INT_TY]]]** [[ARG3]],
+// CHECK: [[PRIV_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 3
+// CHECK: [[ARG4:%.+]] = load [[S_INT_TY]]**, [[S_INT_TY]]*** {{.+}},
+// CHECK: store [[S_INT_TY]]* [[PRIV_VAR]], [[S_INT_TY]]** [[ARG4]],
+// CHECK: ret void
+
+// CHECK: define internal i32 [[TASK_ENTRY]](i32 %0, [[KMP_TASK_TMAIN_TY]]* noalias %1)
+// CHECK: alloca i32*,
+// CHECK-DAG: [[PRIV_T_VAR_ADDR:%.+]] = alloca i32*,
+// CHECK-DAG: [[PRIV_VEC_ADDR:%.+]] = alloca [2 x i32]*,
+// CHECK-DAG: [[PRIV_S_ARR_ADDR:%.+]] = alloca [2 x [[S_INT_TY]]]*,
+// CHECK-DAG: [[PRIV_VAR_ADDR:%.+]] = alloca [[S_INT_TY]]*,
+// CHECK: store void (i8*, ...)* bitcast (void ([[PRIVATES_TMAIN_TY]]*, i32**, [2 x i32]**, [2 x [[S_INT_TY]]]**, [[S_INT_TY]]**)* [[PRIVATES_MAP_FN]] to void (i8*, ...)*), void (i8*, ...)** [[MAP_FN_ADDR:%.+]],
+// CHECK: [[MAP_FN:%.+]] = load void (i8*, ...)*, void (i8*, ...)** [[MAP_FN_ADDR]],
+// CHECK: call void (i8*, ...) [[MAP_FN]](i8* %{{.+}}, i32** [[PRIV_T_VAR_ADDR]], [2 x i32]** [[PRIV_VEC_ADDR]], [2 x [[S_INT_TY]]]** [[PRIV_S_ARR_ADDR]], [[S_INT_TY]]** [[PRIV_VAR_ADDR]])
+// CHECK: [[PRIV_T_VAR:%.+]] = load i32*, i32** [[PRIV_T_VAR_ADDR]],
+// CHECK: [[PRIV_VEC:%.+]] = load [2 x i32]*, [2 x i32]** [[PRIV_VEC_ADDR]],
+// CHECK: [[PRIV_S_ARR:%.+]] = load [2 x [[S_INT_TY]]]*, [2 x [[S_INT_TY]]]** [[PRIV_S_ARR_ADDR]],
+// CHECK: [[PRIV_VAR:%.+]] = load [[S_INT_TY]]*, [[S_INT_TY]]** [[PRIV_VAR_ADDR]],
+
+// Privates actually are used.
+// CHECK-DAG: [[PRIV_VAR]]
+// CHECK-DAG: [[PRIV_T_VAR]]
+// CHECK-DAG: [[PRIV_S_ARR]]
+// CHECK-DAG: [[PRIV_VEC]]
+
+// CHECK: icmp ne i32 %{{.+}}, 0
+// CHECK-NEXT: br i1
+// CHECK: load i32, i32* %
+// CHECK: store i32 %{{.+}}, i32* %
+// CHECK: bitcast [2 x i32]* %{{.+}} to i8*
+// CHECK: bitcast [2 x i32]* %{{.+}} to i8*
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align {{[0-9]+}} %
+// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* %
+// CHECK: phi [[S_INT_TY]]*
+// CHECK: phi [[S_INT_TY]]*
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align {{[0-9]+}} %
+// CHECK: icmp eq [[S_INT_TY]]* %
+// CHECK-NEXT: br i1
+// CHECK: bitcast [[S_INT_TY]]* %{{.+}} to i8*
+// CHECK: bitcast [[S_INT_TY]]* %{{.+}} to i8*
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align {{[0-9]+}} %
+// CHECK: br label
+// CHECK: ret
+
+// CHECK: define internal void [[TMAIN_DUP]]([[KMP_TASK_TMAIN_TY]]* %0, [[KMP_TASK_TMAIN_TY]]* %1, i32 %2)
+// CHECK: getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* %{{.+}}, i32 0, i32 8
+// CHECK: load i32, i32* %
+// CHECK: store i32 %{{.+}}, i32* %
+// CHECK: getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* %{{.+}}, i32 0, i32 2
+// CHECK: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* %{{.+}}, i32 0, i32 2
+// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i64 2
+// CHECK: br label %
+
+// CHECK: phi [[S_INT_TY]]*
+// CHECK: call {{.*}} [[S_INT_TY_CONSTR]]([[S_INT_TY]]*
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i64 1
+// CHECK: icmp eq [[S_INT_TY]]* %
+// CHECK: br i1 %
+
+// CHECK: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* %{{.+}}, i32 0, i32 3
+// CHECK: call {{.*}} [[S_INT_TY_CONSTR]]([[S_INT_TY]]*
+// CHECK: ret void
+
+// CHECK: define internal i32 [[DESTRUCTORS]](i32 %0, [[KMP_TASK_TMAIN_TY]]* noalias %1)
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: call void @_ZN1SIiED1Ev([[S_INT_TY]]* [[PRIVATE_VAR_REF]])
+// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* [[PRIVATE_S_ARR_REF]], i{{.+}} 0, i{{.+}} 0
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i{{.+}} 2
+// CHECK: [[PRIVATE_S_ARR_ELEM_REF:%.+]] = getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i{{.+}} -1
+// CHECK: call void @_ZN1SIiED1Ev([[S_INT_TY]]* [[PRIVATE_S_ARR_ELEM_REF]])
+// CHECK: icmp eq
+// CHECK: br i1
+// CHECK: ret i32
+
+#endif
+#elif defined(ARRAY)
+// ARRAY-LABEL: array_func
+struct St {
+ int a, b;
+ St() : a(0), b(0) {}
+ St(const St &) {}
+ ~St() {}
+};
+
+void array_func(int n, float a[n], St s[2]) {
+// ARRAY: call i8* @__kmpc_omp_task_alloc(
+// ARRAY: call void @__kmpc_taskloop(
+// ARRAY: store float** %{{.+}}, float*** %{{.+}},
+// ARRAY: store %struct.St** %{{.+}}, %struct.St*** %{{.+}},
+// ARRAY: icmp ne i32 %{{.+}}, 0
+// ARRAY: store float* %{{.+}}, float** %{{.+}},
+// ARRAY: store %struct.St* %{{.+}}, %struct.St** %{{.+}},
+#pragma omp parallel master taskloop lastprivate(a, s)
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+#else
+
+// LOOP-LABEL: loop
+void loop() {
+// LOOP: call i8* @__kmpc_omp_task_alloc(
+// LOOP: call void @__kmpc_taskloop(
+ int i;
+#pragma omp parallel master taskloop lastprivate(i)
+ for (i = 0; i < 10; ++i)
+ ;
+}
+#endif
+
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_lastprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_lastprivate_messages.cpp
new file mode 100644
index 0000000..2c5ff2d
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_lastprivate_messages.cpp
@@ -0,0 +1,305 @@
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp-simd %s -Wuninitialized
+
+typedef void **omp_allocator_handle_t;
+extern const omp_allocator_handle_t omp_default_mem_alloc;
+extern const omp_allocator_handle_t omp_large_cap_mem_alloc;
+extern const omp_allocator_handle_t omp_const_mem_alloc;
+extern const omp_allocator_handle_t omp_high_bw_mem_alloc;
+extern const omp_allocator_handle_t omp_low_lat_mem_alloc;
+extern const omp_allocator_handle_t omp_cgroup_mem_alloc;
+extern const omp_allocator_handle_t omp_pteam_mem_alloc;
+extern const omp_allocator_handle_t omp_thread_mem_alloc;
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+struct S1; // expected-note 2 {{declared here}} expected-note 2 {{forward declaration of 'S1'}}
+extern S1 a;
+class S2 {
+ mutable int a;
+
+public:
+ S2() : a(0) {}
+ S2(S2 &s2) : a(s2.a) {}
+ const S2 &operator =(const S2&) const;
+ S2 &operator =(const S2&);
+ static float S2s; // expected-note {{static data member is predetermined as shared}}
+ static const float S2sc; // expected-note {{'S2sc' declared here}}
+};
+const float S2::S2sc = 0;
+const S2 b;
+const S2 ba[5];
+class S3 {
+ int a;
+ S3 &operator=(const S3 &s3); // expected-note 2 {{implicitly declared private here}}
+
+public:
+ S3() : a(0) {}
+ S3(S3 &s3) : a(s3.a) {}
+};
+const S3 c; // expected-note {{'c' defined here}}
+const S3 ca[5]; // expected-note {{'ca' defined here}}
+extern const int f; // expected-note {{'f' declared here}}
+class S4 {
+ int a;
+ S4(); // expected-note 3 {{implicitly declared private here}}
+ S4(const S4 &s4);
+
+public:
+ S4(int v) : a(v) {}
+};
+class S5 {
+ int a;
+ S5() : a(0) {} // expected-note {{implicitly declared private here}}
+
+public:
+ S5(const S5 &s5) : a(s5.a) {}
+ S5(int v) : a(v) {}
+};
+class S6 {
+ int a;
+ S6() : a(0) {}
+
+public:
+ S6(const S6 &s6) : a(s6.a) {}
+ S6(int v) : a(v) {}
+};
+
+S3 h;
+#pragma omp threadprivate(h) // expected-note 2 {{defined as threadprivate or thread local}}
+
+template <class I, class C>
+int foomain(int argc, char **argv) {
+ I e(4);
+ I g(5);
+ int i, z;
+ int &j = i;
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate // expected-error {{expected '(' after 'lastprivate'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate() // expected-error {{expected expression}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(conditional: argc) lastprivate(conditional: // expected-error 2 {{use of undeclared identifier 'conditional'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(S1) // expected-error {{'S1' does not refer to a value}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(a, b) // expected-error {{lastprivate variable with incomplete type 'S1'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(argv[1]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(z, e, g) // expected-error 2 {{calling a private constructor of class 'S4'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(h) // expected-error {{threadprivate or thread local variable cannot be lastprivate}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+ {
+ int v = 0;
+ int i;
+#pragma omp parallel master taskloop allocate(omp_thread_mem_alloc: i) lastprivate(i) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'parallel master taskloop' directive}}
+ for (int k = 0; k < argc; ++k) {
+ i = k;
+ v += i;
+ }
+ }
+#pragma omp parallel shared(i)
+#pragma omp parallel private(i)
+#pragma omp parallel master taskloop lastprivate(j)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(i)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+ return 0;
+}
+
+void bar(S4 a[2]) {
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(a)
+ for (int i = 0; i < 2; ++i)
+ foo();
+}
+
+namespace A {
+double x;
+#pragma omp threadprivate(x) // expected-note {{defined as threadprivate or thread local}}
+}
+namespace B {
+using A::x;
+}
+
+int main(int argc, char **argv) {
+ const int d = 5; // expected-note {{'d' defined here}}
+ const int da[5] = {0}; // expected-note {{'da' defined here}}
+ S4 e(4);
+ S5 g(5);
+ S3 m;
+ S6 n(2);
+ int i, z;
+ int &j = i;
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate // expected-error {{expected '(' after 'lastprivate'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate() // expected-error {{expected expression}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(argc, z)
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(S1) // expected-error {{'S1' does not refer to a value}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(a, b, c, d, f) // expected-error {{lastprivate variable with incomplete type 'S1'}} expected-error 1 {{const-qualified variable without mutable fields cannot be lastprivate}} expected-error 2 {{const-qualified variable cannot be lastprivate}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(argv[1]) // expected-error {{expected variable name}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(2 * 2) // expected-error {{expected variable name}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(ba)
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(ca) // expected-error {{const-qualified variable without mutable fields cannot be lastprivate}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(da) // expected-error {{const-qualified variable cannot be lastprivate}}
+ for (i = 0; i < argc; ++i)
+ foo();
+ int xa;
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(xa) // OK
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(S2::S2s) // expected-error {{shared variable cannot be lastprivate}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(S2::S2sc) // expected-error {{const-qualified variable cannot be lastprivate}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop safelen(5) // expected-error {{unexpected OpenMP clause 'safelen' in directive '#pragma omp parallel master taskloop'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(m) // expected-error {{'operator=' is a private member of 'S3'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(h) // expected-error {{threadprivate or thread local variable cannot be lastprivate}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(B::x) // expected-error {{threadprivate or thread local variable cannot be lastprivate}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop private(xa), lastprivate(xa) // expected-error {{private variable cannot be lastprivate}} expected-note {{defined as private}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(i)
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel private(xa)
+#pragma omp parallel master taskloop lastprivate(xa)
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel reduction(+ : xa)
+#pragma omp parallel master taskloop lastprivate(xa)
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(j)
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop firstprivate(m) lastprivate(m) // expected-error {{'operator=' is a private member of 'S3'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(n) firstprivate(n) // OK
+ for (i = 0; i < argc; ++i)
+ foo();
+ static int si;
+#pragma omp parallel master taskloop lastprivate(si) // OK
+ for (i = 0; i < argc; ++i)
+ si = i + 1;
+ return foomain<S4, S5>(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<S4, S5>' requested here}}
+}
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_loop_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_loop_messages.cpp
new file mode 100644
index 0000000..7641196
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_loop_messages.cpp
@@ -0,0 +1,751 @@
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wuninitialized
+
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wuninitialized
+
+class S {
+ int a;
+ S() : a(0) {}
+
+public:
+ S(int v) : a(v) {}
+ S(const S &s) : a(s.a) {}
+};
+
+static int sii;
+// expected-note@+1 {{defined as threadprivate or thread local}}
+#pragma omp threadprivate(sii)
+static int globalii;
+
+// Currently, we cannot use "0" for global register variables.
+// register int reg0 __asm__("0");
+int reg0;
+
+int test_iteration_spaces() {
+ const int N = 100;
+ float a[N], b[N], c[N];
+ int ii, jj, kk;
+ float fii;
+ double dii;
+ register int reg; // expected-warning {{'register' storage class specifier is deprecated}}
+#pragma omp parallel
+#pragma omp parallel master taskloop
+ for (int i = 0; i < 10; i += 1) {
+ c[i] = a[i] + b[i];
+ }
+#pragma omp parallel
+#pragma omp parallel master taskloop
+ for (char i = 0; i < 10; i++) {
+ c[i] = a[i] + b[i];
+ }
+#pragma omp parallel
+#pragma omp parallel master taskloop
+ for (char i = 0; i < 10; i += '\1') {
+ c[i] = a[i] + b[i];
+ }
+#pragma omp parallel
+#pragma omp parallel master taskloop
+ for (long long i = 0; i < 10; i++) {
+ c[i] = a[i] + b[i];
+ }
+#pragma omp parallel
+// expected-error@+2 {{expression must have integral or unscoped enumeration type, not 'double'}}
+#pragma omp parallel master taskloop
+ for (long long i = 0; i < 10; i += 1.5) {
+ c[i] = a[i] + b[i];
+ }
+#pragma omp parallel
+#pragma omp parallel master taskloop
+ for (long long i = 0; i < 'z'; i += 1u) {
+ c[i] = a[i] + b[i];
+ }
+#pragma omp parallel
+// expected-error@+2 {{variable must be of integer or random access iterator type}}
+#pragma omp parallel master taskloop
+ for (float fi = 0; fi < 10.0; fi++) {
+ c[(int)fi] = a[(int)fi] + b[(int)fi];
+ }
+#pragma omp parallel
+// expected-error@+2 {{variable must be of integer or random access iterator type}}
+#pragma omp parallel master taskloop
+ for (double fi = 0; fi < 10.0; fi++) {
+ c[(int)fi] = a[(int)fi] + b[(int)fi];
+ }
+#pragma omp parallel
+// expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp parallel master taskloop
+ for (int &ref = ii; ref < 10; ref++) {
+ }
+#pragma omp parallel
+// expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp parallel master taskloop
+ for (int i; i < 10; i++)
+ c[i] = a[i];
+
+#pragma omp parallel
+// expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp parallel master taskloop
+ for (int i = 0, j = 0; i < 10; ++i)
+ c[i] = a[i];
+
+#pragma omp parallel
+// expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp parallel master taskloop
+ for (; ii < 10; ++ii)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-warning@+3 {{expression result unused}}
+// expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp parallel master taskloop
+ for (ii + 1; ii < 10; ++ii)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp parallel master taskloop
+ for (c[ii] = 0; ii < 10; ++ii)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// Ok to skip parenthesises.
+#pragma omp parallel master taskloop
+ for (((ii)) = 0; ii < 10; ++ii)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
+#pragma omp parallel master taskloop
+ for (int i = 0; i; i++)
+ c[i] = a[i];
+
+#pragma omp parallel
+// omp4-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'i'}}
+#pragma omp parallel master taskloop
+ for (int i = 0; jj < kk; ii++)
+ c[i] = a[i];
+
+#pragma omp parallel
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
+#pragma omp parallel master taskloop
+ for (int i = 0; !!i; i++)
+ c[i] = a[i];
+
+// Ok
+#pragma omp parallel
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+#pragma omp parallel master taskloop
+ for (int i = 0; i != 1; i++)
+ c[i] = a[i];
+
+#pragma omp parallel
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
+#pragma omp parallel master taskloop
+ for (int i = 0;; i++)
+ c[i] = a[i];
+
+#pragma omp parallel
+// Ok.
+#pragma omp parallel master taskloop
+ for (int i = 11; i > 10; i--)
+ c[i] = a[i];
+
+#pragma omp parallel
+// Ok.
+#pragma omp parallel master taskloop
+ for (int i = 0; i < 10; ++i)
+ c[i] = a[i];
+
+#pragma omp parallel
+// Ok.
+#pragma omp parallel master taskloop
+ for (ii = 0; ii < 10; ++ii)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
+#pragma omp parallel master taskloop
+ for (ii = 0; ii < 10; ++jj)
+ c[ii] = a[jj];
+
+#pragma omp parallel
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
+#pragma omp parallel master taskloop
+ for (ii = 0; ii < 10; ++++ii)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// Ok but undefined behavior (in general, cannot check that incr
+// is really loop-invariant).
+#pragma omp parallel master taskloop
+ for (ii = 0; ii < 10; ii = ii + ii)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-error@+2 {{expression must have integral or unscoped enumeration type, not 'float'}}
+#pragma omp parallel master taskloop
+ for (ii = 0; ii < 10; ii = ii + 1.0f)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// Ok - step was converted to integer type.
+#pragma omp parallel master taskloop
+ for (ii = 0; ii < 10; ii = ii + (int)1.1f)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
+#pragma omp parallel master taskloop
+ for (ii = 0; ii < 10; jj = ii + 2)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-warning@+3 {{relational comparison result unused}}
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
+#pragma omp parallel master taskloop
+ for (ii = 0; ii<10; jj> kk + 2)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
+#pragma omp parallel master taskloop
+ for (ii = 0; ii < 10;)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-warning@+3 {{expression result unused}}
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
+#pragma omp parallel master taskloop
+ for (ii = 0; ii < 10; !ii)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
+#pragma omp parallel master taskloop
+ for (ii = 0; ii < 10; ii ? ++ii : ++jj)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
+#pragma omp parallel master taskloop
+ for (ii = 0; ii < 10; ii = ii < 10)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be positive due to this condition}}
+// expected-error@+2 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
+#pragma omp parallel master taskloop
+ for (ii = 0; ii < 10; ii = ii + 0)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be positive due to this condition}}
+// expected-error@+2 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
+#pragma omp parallel master taskloop
+ for (ii = 0; ii < 10; ii = ii + (int)(0.8 - 0.45))
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be positive due to this condition}}
+// expected-error@+2 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
+#pragma omp parallel master taskloop
+ for (ii = 0; (ii) < 10; ii -= 25)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be positive due to this condition}}
+// expected-error@+2 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
+#pragma omp parallel master taskloop
+ for (ii = 0; (ii < 10); ii -= 0)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be negative due to this condition}}
+// expected-error@+2 {{increment expression must cause 'ii' to decrease on each iteration of OpenMP for loop}}
+#pragma omp parallel master taskloop
+ for (ii = 0; ii > 10; (ii += 0))
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be positive due to this condition}}
+// expected-error@+2 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
+#pragma omp parallel master taskloop
+ for (ii = 0; ii < 10; (ii) = (1 - 1) + (ii))
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be negative due to this condition}}
+// expected-error@+2 {{increment expression must cause 'ii' to decrease on each iteration of OpenMP for loop}}
+#pragma omp parallel master taskloop
+ for ((ii = 0); ii > 10; (ii -= 0))
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be positive due to this condition}}
+// expected-error@+2 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
+#pragma omp parallel master taskloop
+ for (ii = 0; (ii < 10); (ii -= 0))
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-note@+2 {{defined as firstprivate}}
+// expected-error@+2 {{loop iteration variable in the associated loop of 'omp parallel master taskloop' directive may not be firstprivate, predetermined as private}}
+#pragma omp parallel master taskloop firstprivate(ii)
+ for (ii = 0; ii < 10; ii++)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-error@+1 {{unexpected OpenMP clause 'linear' in directive '#pragma omp parallel master taskloop'}}
+#pragma omp parallel master taskloop linear(ii)
+ for (ii = 0; ii < 10; ii++)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+#pragma omp parallel master taskloop private(ii)
+ for (ii = 0; ii < 10; ii++)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(ii)
+ for (ii = 0; ii < 10; ii++)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+ {
+// expected-error@+2 {{loop iteration variable in the associated loop of 'omp parallel master taskloop' directive may not be threadprivate or thread local, predetermined as private}}
+#pragma omp parallel master taskloop
+ for (sii = 0; sii < 10; sii += 1)
+ c[sii] = a[sii];
+ }
+
+#pragma omp parallel
+ {
+#pragma omp parallel master taskloop
+ for (reg0 = 0; reg0 < 10; reg0 += 1)
+ c[reg0] = a[reg0];
+ }
+
+#pragma omp parallel
+ {
+#pragma omp parallel master taskloop
+ for (reg = 0; reg < 10; reg += 1)
+ c[reg] = a[reg];
+ }
+
+#pragma omp parallel
+ {
+#pragma omp parallel master taskloop
+ for (globalii = 0; globalii < 10; globalii += 1)
+ c[globalii] = a[globalii];
+ }
+
+#pragma omp parallel
+ {
+#pragma omp parallel master taskloop collapse(2)
+ for (ii = 0; ii < 10; ii += 1)
+ for (globalii = 0; globalii < 10; globalii += 1)
+ c[globalii] += a[globalii] + ii;
+ }
+
+#pragma omp parallel
+// omp4-error@+2 {{statement after '#pragma omp parallel master taskloop' must be a for loop}}
+#pragma omp parallel master taskloop
+ for (auto &item : a) {
+ item = item + 1;
+ }
+
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be positive due to this condition}}
+// expected-error@+2 {{increment expression must cause 'i' to increase on each iteration of OpenMP for loop}}
+#pragma omp parallel master taskloop
+ for (unsigned i = 9; i < 10; i--) {
+ c[i] = a[i] + b[i];
+ }
+
+ int(*lb)[4] = nullptr;
+#pragma omp parallel
+#pragma omp parallel master taskloop
+ for (int(*p)[4] = lb; p < lb + 8; ++p) {
+ }
+
+#pragma omp parallel
+// expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp parallel master taskloop
+ for (int a{0}; a < 10; ++a) {
+ }
+
+ return 0;
+}
+
+// Iterators allowed in openmp for-loops.
+namespace std {
+struct random_access_iterator_tag {};
+template <class Iter>
+struct iterator_traits {
+ typedef typename Iter::difference_type difference_type;
+ typedef typename Iter::iterator_category iterator_category;
+};
+template <class Iter>
+typename iterator_traits<Iter>::difference_type
+distance(Iter first, Iter last) { return first - last; }
+}
+class Iter0 {
+public:
+ Iter0() {}
+ Iter0(const Iter0 &) {}
+ Iter0 operator++() { return *this; }
+ Iter0 operator--() { return *this; }
+ bool operator<(Iter0 a) { return true; }
+};
+// expected-note@+2 {{candidate function not viable: no known conversion from 'GoodIter' to 'Iter0' for 1st argument}}
+// expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter1' to 'Iter0' for 1st argument}}
+int operator-(Iter0 a, Iter0 b) { return 0; }
+class Iter1 {
+public:
+ Iter1(float f = 0.0f, double d = 0.0) {}
+ Iter1(const Iter1 &) {}
+ Iter1 operator++() { return *this; }
+ Iter1 operator--() { return *this; }
+ bool operator<(Iter1 a) { return true; }
+ bool operator>=(Iter1 a) { return false; }
+};
+class GoodIter {
+public:
+ GoodIter() {}
+ GoodIter(const GoodIter &) {}
+ GoodIter(int fst, int snd) {}
+ GoodIter &operator=(const GoodIter &that) { return *this; }
+ GoodIter &operator=(const Iter0 &that) { return *this; }
+ GoodIter &operator+=(int x) { return *this; }
+ GoodIter &operator-=(int x) { return *this; }
+ explicit GoodIter(void *) {}
+ GoodIter operator++() { return *this; }
+ GoodIter operator--() { return *this; }
+ bool operator!() { return true; }
+ bool operator<(GoodIter a) { return true; }
+ bool operator<=(GoodIter a) { return true; }
+ bool operator>=(GoodIter a) { return false; }
+ typedef int difference_type;
+ typedef std::random_access_iterator_tag iterator_category;
+};
+// expected-note@+2 {{candidate function not viable: no known conversion from 'const Iter0' to 'GoodIter' for 2nd argument}}
+// expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter1' to 'GoodIter' for 1st argument}}
+int operator-(GoodIter a, GoodIter b) { return 0; }
+// expected-note@+1 3 {{candidate function not viable: requires single argument 'a', but 2 arguments were provided}}
+GoodIter operator-(GoodIter a) { return a; }
+// expected-note@+2 {{candidate function not viable: no known conversion from 'const Iter0' to 'int' for 2nd argument}}
+// expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter1' to 'GoodIter' for 1st argument}}
+GoodIter operator-(GoodIter a, int v) { return GoodIter(); }
+// expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter0' to 'GoodIter' for 1st argument}}
+GoodIter operator+(GoodIter a, int v) { return GoodIter(); }
+// expected-note@+2 {{candidate function not viable: no known conversion from 'GoodIter' to 'int' for 1st argument}}
+// expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter1' to 'int' for 1st argument}}
+GoodIter operator-(int v, GoodIter a) { return GoodIter(); }
+// expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter0' to 'int' for 1st argument}}
+GoodIter operator+(int v, GoodIter a) { return GoodIter(); }
+
+int test_with_random_access_iterator() {
+ GoodIter begin, end;
+ Iter0 begin0, end0;
+#pragma omp parallel
+#pragma omp parallel master taskloop
+ for (GoodIter I = begin; I < end; ++I)
+ ++I;
+#pragma omp parallel
+// expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp parallel master taskloop
+ for (GoodIter &I = begin; I < end; ++I)
+ ++I;
+#pragma omp parallel
+#pragma omp parallel master taskloop
+ for (GoodIter I = begin; I >= end; --I)
+ ++I;
+#pragma omp parallel
+// expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp parallel master taskloop
+ for (GoodIter I(begin); I < end; ++I)
+ ++I;
+#pragma omp parallel
+// expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp parallel master taskloop
+ for (GoodIter I(nullptr); I < end; ++I)
+ ++I;
+#pragma omp parallel
+// expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp parallel master taskloop
+ for (GoodIter I(0); I < end; ++I)
+ ++I;
+#pragma omp parallel
+// expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp parallel master taskloop
+ for (GoodIter I(1, 2); I < end; ++I)
+ ++I;
+#pragma omp parallel
+#pragma omp parallel master taskloop
+ for (begin = GoodIter(0); begin < end; ++begin)
+ ++begin;
+// expected-error@+4 {{invalid operands to binary expression ('GoodIter' and 'const Iter0')}}
+// expected-error@+3 {{could not calculate number of iterations calling 'operator-' with upper and lower loop bounds}}
+#pragma omp parallel
+#pragma omp parallel master taskloop
+ for (begin = begin0; begin < end; ++begin)
+ ++begin;
+#pragma omp parallel
+// expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp parallel master taskloop
+ for (++begin; begin < end; ++begin)
+ ++begin;
+#pragma omp parallel
+#pragma omp parallel master taskloop
+ for (begin = end; begin < end; ++begin)
+ ++begin;
+#pragma omp parallel
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
+#pragma omp parallel master taskloop
+ for (GoodIter I = begin; I - I; ++I)
+ ++I;
+#pragma omp parallel
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
+#pragma omp parallel master taskloop
+ for (GoodIter I = begin; begin < end; ++I)
+ ++I;
+#pragma omp parallel
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
+#pragma omp parallel master taskloop
+ for (GoodIter I = begin; !I; ++I)
+ ++I;
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be negative due to this condition}}
+// expected-error@+2 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
+#pragma omp parallel master taskloop
+ for (GoodIter I = begin; I >= end; I = I + 1)
+ ++I;
+#pragma omp parallel
+#pragma omp parallel master taskloop
+ for (GoodIter I = begin; I >= end; I = I - 1)
+ ++I;
+#pragma omp parallel
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'I'}}
+#pragma omp parallel master taskloop
+ for (GoodIter I = begin; I >= end; I = -I)
+ ++I;
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be negative due to this condition}}
+// expected-error@+2 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
+#pragma omp parallel master taskloop
+ for (GoodIter I = begin; I >= end; I = 2 + I)
+ ++I;
+#pragma omp parallel
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'I'}}
+#pragma omp parallel master taskloop
+ for (GoodIter I = begin; I >= end; I = 2 - I)
+ ++I;
+// In the following example, we cannot update the loop variable using '+='
+// expected-error@+3 {{invalid operands to binary expression ('Iter0' and 'int')}}
+#pragma omp parallel
+#pragma omp parallel master taskloop
+ for (Iter0 I = begin0; I < end0; ++I)
+ ++I;
+#pragma omp parallel
+// Initializer is constructor without params.
+// expected-error@+3 {{invalid operands to binary expression ('Iter0' and 'int')}}
+// expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp parallel master taskloop
+ for (Iter0 I; I < end0; ++I)
+ ++I;
+ Iter1 begin1, end1;
+// expected-error@+4 {{invalid operands to binary expression ('Iter1' and 'Iter1')}}
+// expected-error@+3 {{could not calculate number of iterations calling 'operator-' with upper and lower loop bounds}}
+#pragma omp parallel
+#pragma omp parallel master taskloop
+ for (Iter1 I = begin1; I < end1; ++I)
+ ++I;
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be negative due to this condition}}
+// expected-error@+2 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
+#pragma omp parallel master taskloop
+ for (Iter1 I = begin1; I >= end1; ++I)
+ ++I;
+#pragma omp parallel
+// expected-error@+5 {{invalid operands to binary expression ('Iter1' and 'float')}}
+// expected-error@+4 {{could not calculate number of iterations calling 'operator-' with upper and lower loop bounds}}
+// Initializer is constructor with all default params.
+// expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp parallel master taskloop
+ for (Iter1 I; I < end1; ++I) {
+ }
+ return 0;
+}
+
+template <typename IT, int ST>
+class TC {
+public:
+ int dotest_lt(IT begin, IT end) {
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be positive due to this condition}}
+// expected-error@+2 {{increment expression must cause 'I' to increase on each iteration of OpenMP for loop}}
+#pragma omp parallel master taskloop
+ for (IT I = begin; I < end; I = I + ST) {
+ ++I;
+ }
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be positive due to this condition}}
+// expected-error@+2 {{increment expression must cause 'I' to increase on each iteration of OpenMP for loop}}
+#pragma omp parallel master taskloop
+ for (IT I = begin; I <= end; I += ST) {
+ ++I;
+ }
+#pragma omp parallel
+#pragma omp parallel master taskloop
+ for (IT I = begin; I < end; ++I) {
+ ++I;
+ }
+ }
+
+ static IT step() {
+ return IT(ST);
+ }
+};
+template <typename IT, int ST = 0>
+int dotest_gt(IT begin, IT end) {
+#pragma omp parallel
+// expected-note@+3 2 {{loop step is expected to be negative due to this condition}}
+// expected-error@+2 2 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
+#pragma omp parallel master taskloop
+ for (IT I = begin; I >= end; I = I + ST) {
+ ++I;
+ }
+#pragma omp parallel
+// expected-note@+3 2 {{loop step is expected to be negative due to this condition}}
+// expected-error@+2 2 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
+#pragma omp parallel master taskloop
+ for (IT I = begin; I >= end; I += ST) {
+ ++I;
+ }
+
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be negative due to this condition}}
+// expected-error@+2 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
+#pragma omp parallel master taskloop
+ for (IT I = begin; I >= end; ++I) {
+ ++I;
+ }
+
+#pragma omp parallel
+#pragma omp parallel master taskloop
+ for (IT I = begin; I < end; I += TC<int, ST>::step()) {
+ ++I;
+ }
+}
+
+void test_with_template() {
+ GoodIter begin, end;
+ TC<GoodIter, 100> t1;
+ TC<GoodIter, -100> t2;
+ t1.dotest_lt(begin, end);
+ t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC<GoodIter, -100>::dotest_lt' requested here}}
+ dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt<GoodIter, 0>' requested here}}
+ dotest_gt<unsigned, 10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, 10>' requested here}}
+}
+
+void test_loop_break() {
+ const int N = 100;
+ float a[N], b[N], c[N];
+#pragma omp parallel
+#pragma omp parallel master taskloop
+ for (int i = 0; i < 10; i++) {
+ c[i] = a[i] + b[i];
+ for (int j = 0; j < 10; ++j) {
+ if (a[i] > b[j])
+ break; // OK in nested loop
+ }
+ switch (i) {
+ case 1:
+ b[i]++;
+ break;
+ default:
+ break;
+ }
+ if (c[i] > 10)
+ break; // expected-error {{'break' statement cannot be used in OpenMP for loop}}
+
+ if (c[i] > 11)
+ break; // expected-error {{'break' statement cannot be used in OpenMP for loop}}
+ }
+
+#pragma omp parallel
+#pragma omp parallel master taskloop
+ for (int i = 0; i < 10; i++) {
+ for (int j = 0; j < 10; j++) {
+ c[i] = a[i] + b[i];
+ if (c[i] > 10) {
+ if (c[i] < 20) {
+ break; // OK
+ }
+ }
+ }
+ }
+}
+
+void test_loop_eh() {
+ const int N = 100;
+ float a[N], b[N], c[N];
+#pragma omp parallel
+#pragma omp parallel master taskloop
+ for (int i = 0; i < 10; i++) {
+ c[i] = a[i] + b[i];
+ try {
+ for (int j = 0; j < 10; ++j) {
+ if (a[i] > b[j])
+ throw a[i];
+ }
+ throw a[i];
+ } catch (float f) {
+ if (f > 0.1)
+ throw a[i];
+ return; // expected-error {{cannot return from OpenMP region}}
+ }
+ switch (i) {
+ case 1:
+ b[i]++;
+ break;
+ default:
+ break;
+ }
+ for (int j = 0; j < 10; j++) {
+ if (c[i] > 10)
+ throw c[i];
+ }
+ }
+ if (c[9] > 10)
+ throw c[9]; // OK
+
+#pragma omp parallel
+#pragma omp parallel master taskloop
+ for (int i = 0; i < 10; ++i) {
+ struct S {
+ void g() { throw 0; }
+ };
+ }
+}
+
+void test_loop_firstprivate_lastprivate() {
+ S s(4);
+ int c;
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(s) firstprivate(s)
+ for (int i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel master taskloop if(c) default(none) // expected-error {{variable 'c' must have explicitly specified data sharing attributes}} expected-note {{explicit data sharing attribute requested here}}
+ for (int i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel master taskloop if(taskloop:c) default(none) // expected-error {{variable 'c' must have explicitly specified data sharing attributes}} expected-note {{explicit data sharing attribute requested here}}
+ for (int i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel master taskloop if(parallel:c) default(none)
+ for (int i = 0; i < 16; ++i)
+ ;
+}
+
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_misc_messages.c b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_misc_messages.c
new file mode 100644
index 0000000..8c03434
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_misc_messages.c
@@ -0,0 +1,385 @@
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -triple x86_64-unknown-unknown -verify %s -Wuninitialized
+
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -triple x86_64-unknown-unknown -verify %s -Wuninitialized
+
+void xxx(int argc) {
+ int x; // expected-note {{initialize the variable 'x' to silence this warning}}
+#pragma omp parallel master taskloop
+ for (int i = 0; i < 10; ++i)
+ argc = x; // expected-warning {{variable 'x' is uninitialized when used here}}
+}
+
+// expected-error@+1 {{unexpected OpenMP directive '#pragma omp parallel master taskloop'}}
+#pragma omp parallel master taskloop
+
+// expected-error@+1 {{unexpected OpenMP directive '#pragma omp parallel master taskloop'}}
+#pragma omp parallel master taskloop foo
+
+void test_no_clause() {
+ int i;
+#pragma omp parallel master taskloop
+ for (i = 0; i < 16; ++i)
+ ;
+
+// expected-error@+2 {{statement after '#pragma omp parallel master taskloop' must be a for loop}}
+#pragma omp parallel master taskloop
+ ++i;
+}
+
+void test_branch_protected_scope() {
+ int i = 0;
+L1:
+ ++i;
+
+ int x[24];
+
+#pragma omp parallel
+#pragma omp parallel master taskloop
+ for (i = 0; i < 16; ++i) {
+ if (i == 5)
+ goto L1; // expected-error {{use of undeclared label 'L1'}}
+ else if (i == 6)
+ return; // expected-error {{cannot return from OpenMP region}}
+ else if (i == 7)
+ goto L2;
+ else if (i == 8) {
+ L2:
+ x[i]++;
+ }
+ }
+
+ if (x[0] == 0)
+ goto L2; // expected-error {{use of undeclared label 'L2'}}
+ else if (x[1] == 1)
+ goto L1;
+}
+
+void test_invalid_clause() {
+ int i, a;
+// expected-warning@+1 {{extra tokens at the end of '#pragma omp parallel master taskloop' are ignored}}
+#pragma omp parallel master taskloop foo bar
+ for (i = 0; i < 16; ++i)
+ ;
+// expected-error@+1 {{directive '#pragma omp parallel master taskloop' cannot contain more than one 'nogroup' clause}}
+#pragma omp parallel master taskloop nogroup nogroup
+ for (i = 0; i < 16; ++i)
+ ;
+// expected-error@+1 {{unexpected OpenMP clause 'in_reduction' in directive '#pragma omp parallel master taskloop'}}
+#pragma omp parallel master taskloop in_reduction(+:a)
+ for (i = 0; i < 16; ++i)
+ ;
+}
+
+void test_non_identifiers() {
+ int i, x;
+
+#pragma omp parallel
+// expected-warning@+1 {{extra tokens at the end of '#pragma omp parallel master taskloop' are ignored}}
+#pragma omp parallel master taskloop;
+ for (i = 0; i < 16; ++i)
+ ;
+// expected-warning@+3 {{extra tokens at the end of '#pragma omp parallel master taskloop' are ignored}}
+// expected-error@+2 {{unexpected OpenMP clause 'linear' in directive '#pragma omp parallel master taskloop'}}
+#pragma omp parallel
+#pragma omp parallel master taskloop linear(x);
+ for (i = 0; i < 16; ++i)
+ ;
+
+#pragma omp parallel
+// expected-warning@+1 {{extra tokens at the end of '#pragma omp parallel master taskloop' are ignored}}
+#pragma omp parallel master taskloop private(x);
+ for (i = 0; i < 16; ++i)
+ ;
+
+#pragma omp parallel
+// expected-warning@+1 {{extra tokens at the end of '#pragma omp parallel master taskloop' are ignored}}
+#pragma omp parallel master taskloop, private(x);
+ for (i = 0; i < 16; ++i)
+ ;
+}
+
+extern int foo();
+
+void test_collapse() {
+ int i;
+#pragma omp parallel
+// expected-error@+1 {{expected '('}}
+#pragma omp parallel master taskloop collapse
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp parallel master taskloop collapse(
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected expression}}
+#pragma omp parallel master taskloop collapse()
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp parallel master taskloop collapse(,
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp parallel master taskloop collapse(, )
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-warning@+2 {{extra tokens at the end of '#pragma omp parallel master taskloop' are ignored}}
+// expected-error@+1 {{expected '('}}
+#pragma omp parallel master taskloop collapse 4)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}}
+// expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}}
+#pragma omp parallel master taskloop collapse(4
+ for (i = 0; i < 16; ++i)
+ ; // expected-error {{expected 4 for loops after '#pragma omp parallel master taskloop', but found only 1}}
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}}
+// expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}}
+#pragma omp parallel master taskloop collapse(4,
+ for (i = 0; i < 16; ++i)
+ ; // expected-error {{expected 4 for loops after '#pragma omp parallel master taskloop', but found only 1}}
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}}
+// expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}}
+#pragma omp parallel master taskloop collapse(4, )
+ for (i = 0; i < 16; ++i)
+ ; // expected-error {{expected 4 for loops after '#pragma omp parallel master taskloop', but found only 1}}
+#pragma omp parallel
+// expected-note@+1 {{as specified in 'collapse' clause}}
+#pragma omp parallel master taskloop collapse(4)
+ for (i = 0; i < 16; ++i)
+ ; // expected-error {{expected 4 for loops after '#pragma omp parallel master taskloop', but found only 1}}
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}}
+// expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}}
+#pragma omp parallel master taskloop collapse(4 4)
+ for (i = 0; i < 16; ++i)
+ ; // expected-error {{expected 4 for loops after '#pragma omp parallel master taskloop', but found only 1}}
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}}
+// expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}}
+#pragma omp parallel master taskloop collapse(4, , 4)
+ for (i = 0; i < 16; ++i)
+ ; // expected-error {{expected 4 for loops after '#pragma omp parallel master taskloop', but found only 1}}
+#pragma omp parallel
+#pragma omp parallel master taskloop collapse(4)
+ for (int i1 = 0; i1 < 16; ++i1)
+ for (int i2 = 0; i2 < 16; ++i2)
+ for (int i3 = 0; i3 < 16; ++i3)
+ for (int i4 = 0; i4 < 16; ++i4)
+ foo();
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}}
+// expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}}
+#pragma omp parallel master taskloop collapse(4, 8)
+ for (i = 0; i < 16; ++i)
+ ; // expected-error {{expected 4 for loops after '#pragma omp parallel master taskloop', but found only 1}}
+#pragma omp parallel
+// expected-error@+1 {{expression is not an integer constant expression}}
+#pragma omp parallel master taskloop collapse(2.5)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expression is not an integer constant expression}}
+#pragma omp parallel master taskloop collapse(foo())
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}}
+#pragma omp parallel master taskloop collapse(-5)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}}
+#pragma omp parallel master taskloop collapse(0)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}}
+#pragma omp parallel master taskloop collapse(5 - 5)
+ for (i = 0; i < 16; ++i)
+ ;
+}
+
+void test_private() {
+ int i;
+#pragma omp parallel
+// expected-error@+2 {{expected expression}}
+// expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp parallel master taskloop private(
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
+// expected-error@+1 2 {{expected expression}}
+#pragma omp parallel master taskloop private(,
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 2 {{expected expression}}
+#pragma omp parallel master taskloop private(, )
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected expression}}
+#pragma omp parallel master taskloop private()
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected expression}}
+#pragma omp parallel master taskloop private(int)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected variable name}}
+#pragma omp parallel master taskloop private(0)
+ for (i = 0; i < 16; ++i)
+ ;
+
+ int x, y, z;
+#pragma omp parallel
+#pragma omp parallel master taskloop private(x)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+#pragma omp parallel master taskloop private(x, y)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+#pragma omp parallel master taskloop private(x, y, z)
+ for (i = 0; i < 16; ++i) {
+ x = y * i + z;
+ }
+}
+
+void test_lastprivate() {
+ int i;
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
+// expected-error@+1 {{expected expression}}
+#pragma omp parallel master taskloop lastprivate(
+ for (i = 0; i < 16; ++i)
+ ;
+
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
+// expected-error@+1 2 {{expected expression}}
+#pragma omp parallel master taskloop lastprivate(,
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 2 {{expected expression}}
+#pragma omp parallel master taskloop lastprivate(, )
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected expression}}
+#pragma omp parallel master taskloop lastprivate()
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected expression}}
+#pragma omp parallel master taskloop lastprivate(int)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected variable name}}
+#pragma omp parallel master taskloop lastprivate(0)
+ for (i = 0; i < 16; ++i)
+ ;
+
+ int x, y, z;
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(x)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(x, y)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(x, y, z)
+ for (i = 0; i < 16; ++i)
+ ;
+}
+
+void test_firstprivate() {
+ int i;
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
+// expected-error@+1 {{expected expression}}
+#pragma omp parallel master taskloop firstprivate(
+ for (i = 0; i < 16; ++i)
+ ;
+
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
+// expected-error@+1 2 {{expected expression}}
+#pragma omp parallel master taskloop firstprivate(,
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 2 {{expected expression}}
+#pragma omp parallel master taskloop firstprivate(, )
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected expression}}
+#pragma omp parallel master taskloop firstprivate()
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected expression}}
+#pragma omp parallel master taskloop firstprivate(int)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected variable name}}
+#pragma omp parallel master taskloop firstprivate(0)
+ for (i = 0; i < 16; ++i)
+ ;
+
+ int x, y, z;
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(x) firstprivate(x)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(x, y) firstprivate(x, y)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+#pragma omp parallel master taskloop lastprivate(x, y, z) firstprivate(x, y, z)
+ for (i = 0; i < 16; ++i)
+ ;
+}
+
+void test_loop_messages() {
+ float a[100], b[100], c[100];
+#pragma omp parallel
+// expected-error@+2 {{variable must be of integer or pointer type}}
+#pragma omp parallel master taskloop
+ for (float fi = 0; fi < 10.0; fi++) {
+ c[(int)fi] = a[(int)fi] + b[(int)fi];
+ }
+#pragma omp parallel
+// expected-error@+2 {{variable must be of integer or pointer type}}
+#pragma omp parallel master taskloop
+ for (double fi = 0; fi < 10.0; fi++) {
+ c[(int)fi] = a[(int)fi] + b[(int)fi];
+ }
+
+ // expected-warning@+2 {{OpenMP loop iteration variable cannot have more than 64 bits size and will be narrowed}}
+ #pragma omp parallel master taskloop
+ for (__int128 ii = 0; ii < 10; ii++) {
+ c[ii] = a[ii] + b[ii];
+ }
+}
+
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_num_tasks_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_num_tasks_messages.cpp
new file mode 100644
index 0000000..e6fe5ca
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_num_tasks_messages.cpp
@@ -0,0 +1,103 @@
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+struct S1; // expected-note {{declared here}}
+
+template <class T, class S> // expected-note {{declared here}}
+int tmain(T argc, S **argv) {
+ T z;
+ #pragma omp parallel master taskloop num_tasks // expected-error {{expected '(' after 'num_tasks'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop num_tasks ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop num_tasks () // expected-error {{expected expression}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop num_tasks (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop num_tasks (argc)) // expected-warning {{extra tokens at the end of '#pragma omp parallel master taskloop' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop num_tasks (argc > 0 ? argv[1][0] : argv[2][argc] + z)
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop num_tasks (foobool(argc)), num_tasks (true) // expected-error {{directive '#pragma omp parallel master taskloop' cannot contain more than one 'num_tasks' clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop num_tasks (S) // expected-error {{'S' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop num_tasks (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop num_tasks(0) // expected-error {{argument to 'num_tasks' clause must be a strictly positive integer value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop num_tasks(-1) // expected-error {{argument to 'num_tasks' clause must be a strictly positive integer value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop num_tasks(argc) grainsize(argc) // expected-error {{'grainsize' and 'num_tasks' clause are mutually exclusive and may not appear on the same directive}} expected-note {{'num_tasks' clause is specified here}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+
+ return 0;
+}
+
+int main(int argc, char **argv) {
+ int z;
+ #pragma omp parallel master taskloop num_tasks // expected-error {{expected '(' after 'num_tasks'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop num_tasks ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop num_tasks () // expected-error {{expected expression}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop num_tasks (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop num_tasks (argc)) // expected-warning {{extra tokens at the end of '#pragma omp parallel master taskloop' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop num_tasks (argc > 0 ? argv[1][0] : argv[2][argc] - z)
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop num_tasks (foobool(argc)), num_tasks (true) // expected-error {{directive '#pragma omp parallel master taskloop' cannot contain more than one 'num_tasks' clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop num_tasks (S1) // expected-error {{'S1' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop num_tasks (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop num_tasks (1 0) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop num_tasks(if(tmain(argc, argv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop num_tasks(0) // expected-error {{argument to 'num_tasks' clause must be a strictly positive integer value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop num_tasks(-1) // expected-error {{argument to 'num_tasks' clause must be a strictly positive integer value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop num_tasks(argc) grainsize(argc) // expected-error {{'grainsize' and 'num_tasks' clause are mutually exclusive and may not appear on the same directive}} expected-note {{'num_tasks' clause is specified here}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+
+ return tmain(argc, argv);
+}
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_priority_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_priority_messages.cpp
new file mode 100644
index 0000000..cda94b5
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_priority_messages.cpp
@@ -0,0 +1,97 @@
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+struct S1; // expected-note {{declared here}}
+
+template <class T, class S> // expected-note {{declared here}}
+int tmain(T argc, S **argv) {
+ T z;
+ #pragma omp parallel master taskloop priority // expected-error {{expected '(' after 'priority'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop priority ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop priority () // expected-error {{expected expression}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop priority (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop priority (argc)) // expected-warning {{extra tokens at the end of '#pragma omp parallel master taskloop' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop priority (argc > 0 ? argv[1][0] : argv[2][argc] + z)
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop priority (foobool(argc)), priority (true) // expected-error {{directive '#pragma omp parallel master taskloop' cannot contain more than one 'priority' clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop priority (S) // expected-error {{'S' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop priority (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop priority(0)
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop priority(-1) // expected-error {{argument to 'priority' clause must be a non-negative integer value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+
+ return 0;
+}
+
+int main(int argc, char **argv) {
+ int z;
+ #pragma omp parallel master taskloop priority // expected-error {{expected '(' after 'priority'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop priority ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop priority () // expected-error {{expected expression}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop priority (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop priority (argc)) // expected-warning {{extra tokens at the end of '#pragma omp parallel master taskloop' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop priority (argc > 0 ? argv[1][0] : argv[2][argc] - z)
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop priority (foobool(argc)), priority (true) // expected-error {{directive '#pragma omp parallel master taskloop' cannot contain more than one 'priority' clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop priority (S1) // expected-error {{'S1' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop priority (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop priority (1 0) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop priority(if(tmain(argc, argv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop priority(0)
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop priority(-1) // expected-error {{argument to 'priority' clause must be a non-negative integer value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+
+ return tmain(argc, argv);
+}
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_private_codegen.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_private_codegen.cpp
new file mode 100644
index 0000000..a3a0add
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_private_codegen.cpp
@@ -0,0 +1,418 @@
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-apple-darwin10 -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=LAMBDA %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=BLOCKS %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DARRAY -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=ARRAY %s
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DARRAY -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
+// expected-no-diagnostics
+
+#ifndef ARRAY
+#ifndef HEADER
+#define HEADER
+
+template <class T>
+struct S {
+ T f;
+ S(T a) : f(a) {}
+ S() : f() {}
+ operator T() { return T(); }
+ ~S() {}
+};
+
+volatile double g;
+
+// CHECK-DAG: [[KMP_TASK_T_TY:%.+]] = type { i8*, i32 (i32, i8*)*, i32, %union{{.+}}, %union{{.+}}, i64, i64, i64, i32, i8* }
+// CHECK-DAG: [[S_DOUBLE_TY:%.+]] = type { double }
+// CHECK-DAG: [[CAP_MAIN_TY:%.+]] = type { i8 }
+// CHECK-DAG: [[PRIVATES_MAIN_TY:%.+]] = type {{.?}}{ [2 x [[S_DOUBLE_TY]]], [[S_DOUBLE_TY]], i32, [2 x i32]
+// CHECK-DAG: [[KMP_TASK_MAIN_TY:%.+]] = type { [[KMP_TASK_T_TY]], [[PRIVATES_MAIN_TY]] }
+// CHECK-DAG: [[S_INT_TY:%.+]] = type { i32 }
+// CHECK-DAG: [[CAP_TMAIN_TY:%.+]] = type { i8 }
+// CHECK-DAG: [[PRIVATES_TMAIN_TY:%.+]] = type { i32, [2 x i32], [2 x [[S_INT_TY]]], [[S_INT_TY]], [104 x i8] }
+// CHECK-DAG: [[KMP_TASK_TMAIN_TY:%.+]] = type { [[KMP_TASK_T_TY]], [{{[0-9]+}} x i8], [[PRIVATES_TMAIN_TY]] }
+template <typename T>
+T tmain() {
+ S<T> test;
+ T t_var __attribute__((aligned(128))) = T();
+ T vec[] = {1, 2};
+ S<T> s_arr[] = {1, 2};
+ S<T> var(3);
+#pragma omp parallel master taskloop private(t_var, vec, s_arr, s_arr, var, var)
+ for (int i = 0; i < 10; ++i) {
+ vec[0] = t_var;
+ s_arr[0] = var;
+ }
+ return T();
+}
+
+int main() {
+ static int sivar;
+#ifdef LAMBDA
+ // LAMBDA: [[G:@.+]] = global double
+ // LAMBDA-LABEL: @main
+ // LAMBDA: call{{( x86_thiscallcc)?}} void [[OUTER_LAMBDA:@.+]](
+ [&]() {
+ // LAMBDA: define{{.*}} internal{{.*}} void [[OUTER_LAMBDA]](
+ // LAMBDA: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc(%{{[^ ]+}} @{{[^,]+}}, i32 %{{[^,]+}}, i32 1, i64 96, i64 1, i32 (i32, i8*)* bitcast (i32 (i32, %{{[^*]+}}*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+// LAMBDA: [[PRIVATES:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i{{.+}} 0, i{{.+}} 1
+// LAMBDA: call void @__kmpc_taskloop(%{{.+}}* @{{.+}}, i32 %{{.+}}, i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* null)
+// LAMBDA: ret
+#pragma omp parallel master taskloop private(g, sivar)
+ for (int i = 0; i < 10; ++i) {
+ // LAMBDA: define {{.+}} void [[INNER_LAMBDA:@.+]](%{{.+}}* [[ARG_PTR:%.+]])
+ // LAMBDA: store %{{.+}}* [[ARG_PTR]], %{{.+}}** [[ARG_PTR_REF:%.+]],
+ // LAMBDA: [[ARG_PTR:%.+]] = load %{{.+}}*, %{{.+}}** [[ARG_PTR_REF]]
+ // LAMBDA: [[G_PTR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[ARG_PTR]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+ // LAMBDA: [[G_REF:%.+]] = load double*, double** [[G_PTR_REF]]
+ // LAMBDA: store double 2.0{{.+}}, double* [[G_REF]]
+ // LAMBDA: [[SIVAR_PTR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[ARG_PTR]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
+ // LAMBDA: [[SIVAR_REF:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** [[SIVAR_PTR_REF]]
+ // LAMBDA: store i{{[0-9]+}} 3, i{{[0-9]+}}* [[SIVAR_REF]]
+
+ // LAMBDA: define internal i32 [[TASK_ENTRY]](i32 %0, %{{.+}}* noalias %1)
+ g = 1;
+ sivar = 2;
+ // LAMBDA: store double 1.0{{.+}}, double* %{{.+}},
+ // LAMBDA: store i{{[0-9]+}} 2, i{{[0-9]+}}* %{{.+}},
+ // LAMBDA: call void [[INNER_LAMBDA]](%
+ // LAMBDA: ret
+ [&]() {
+ g = 2;
+ sivar = 3;
+ }();
+ }
+ }();
+ return 0;
+#elif defined(BLOCKS)
+ // BLOCKS: [[G:@.+]] = global double
+ // BLOCKS-LABEL: @main
+ // BLOCKS: call void {{%.+}}(i8
+ ^{
+ // BLOCKS: define{{.*}} internal{{.*}} void {{.+}}(i8*
+ // BLOCKS: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc(%{{[^ ]+}} @{{[^,]+}}, i32 %{{[^,]+}}, i32 1, i64 96, i64 1, i32 (i32, i8*)* bitcast (i32 (i32, %{{[^*]+}}*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+ // BLOCKS: [[PRIVATES:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i{{.+}} 0, i{{.+}} 1
+ // BLOCKS: call void @__kmpc_taskloop(%{{.+}}* @{{.+}}, i32 %{{.+}}, i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* null)
+ // BLOCKS: ret
+#pragma omp parallel master taskloop private(g, sivar)
+ for (int i = 0; i < 10; ++i) {
+ // BLOCKS: define {{.+}} void {{@.+}}(i8*
+ // BLOCKS-NOT: [[G]]{{[[^:word:]]}}
+ // BLOCKS: store double 2.0{{.+}}, double*
+ // BLOCKS-NOT: [[G]]{{[[^:word:]]}}
+ // BLOCKS-NOT: [[SIVAR]]{{[[^:word:]]}}
+ // BLOCKS: store i{{[0-9]+}} 4, i{{[0-9]+}}*
+ // BLOCKS-NOT: [[SIVAR]]{{[[^:word:]]}}
+ // BLOCKS: ret
+
+ // BLOCKS: define internal i32 [[TASK_ENTRY]](i32 %0, %{{.+}}* noalias %1)
+ g = 1;
+ sivar = 3;
+ // BLOCKS: store double 1.0{{.+}}, double* %{{.+}},
+ // BLOCKS-NOT: [[G]]{{[[^:word:]]}}
+ // BLOCKS: store i{{[0-9]+}} 3, i{{[0-9]+}}* %{{.+}},
+ // BLOCKS-NOT: [[SIVAR]]{{[[^:word:]]}}
+ // BLOCKS: call void {{%.+}}(i8
+ ^{
+ g = 2;
+ sivar = 4;
+ }();
+ }
+ }();
+ return 0;
+#else
+ S<double> test;
+ int t_var = 0;
+ int vec[] = {1, 2};
+ S<double> s_arr[] = {1, 2};
+ S<double> var(3);
+#pragma omp parallel master taskloop private(var, t_var, s_arr, vec, s_arr, var, sivar)
+ for (int i = 0; i < 10; ++i) {
+ vec[0] = t_var;
+ s_arr[0] = var;
+ sivar = 8;
+ }
+#pragma omp task
+ g+=1;
+ return tmain<int>();
+#endif
+}
+
+// CHECK: define i{{[0-9]+}} @main()
+// CHECK: [[TEST:%.+]] = alloca [[S_DOUBLE_TY]],
+// CHECK: [[T_VAR_ADDR:%.+]] = alloca i32,
+// CHECK: [[VEC_ADDR:%.+]] = alloca [2 x i32],
+// CHECK: [[S_ARR_ADDR:%.+]] = alloca [2 x [[S_DOUBLE_TY]]],
+// CHECK: [[VAR_ADDR:%.+]] = alloca [[S_DOUBLE_TY]],
+
+// CHECK: call {{.*}} [[S_DOUBLE_TY_DEF_CONSTR:@.+]]([[S_DOUBLE_TY]]* [[TEST]])
+
+// CHECK: [[RES:%.+]] = call {{.*}}i32 @__kmpc_master(
+// CHECK-NEXT: [[IS_MASTER:%.+]] = icmp ne i32 [[RES]], 0
+// CHECK-NEXT: br i1 [[IS_MASTER]], label {{%?}}[[THEN:.+]], label {{%?}}[[EXIT:.+]]
+// CHECK: [[THEN]]
+// Do not store original variables in capture struct.
+// CHECK-NOT: getelementptr inbounds [[CAP_MAIN_TY]],
+
+// Allocate task.
+// Returns struct kmp_task_t {
+// [[KMP_TASK_T_TY]] task_data;
+// [[KMP_TASK_MAIN_TY]] privates;
+// };
+// CHECK: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc([[LOC:%.+]], i32 [[GTID:%.+]], i32 9, i64 120, i64 1, i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_MAIN_TY]]*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+// CHECK: [[RES_KMP_TASK:%.+]] = bitcast i8* [[RES]] to [[KMP_TASK_MAIN_TY]]*
+
+// CHECK: [[TASK:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// Initialize kmp_task_t->privates with default values (no init for simple types, default constructors for classes).
+// Also copy address of private copy to the corresponding shareds reference.
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
+
+// Constructors for s_arr and var.
+// a_arr;
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: getelementptr inbounds [2 x [[S_DOUBLE_TY]]], [2 x [[S_DOUBLE_TY]]]* [[PRIVATE_S_ARR_REF]], i{{.+}} 0, i{{.+}} 0
+// CHECK: getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i{{.+}} 2
+// CHECK: call void [[S_DOUBLE_TY_DEF_CONSTR]]([[S_DOUBLE_TY]]* [[S_ARR_CUR:%.+]])
+// CHECK: getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* [[S_ARR_CUR]], i{{.+}} 1
+// CHECK: icmp eq
+// CHECK: br i1
+
+// var;
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
+// CHECK: call void [[S_DOUBLE_TY_DEF_CONSTR]]([[S_DOUBLE_TY]]* [[PRIVATE_VAR_REF:%.+]])
+
+// Provide pointer to destructor function, which will destroy private variables at the end of the task.
+// CHECK: [[DESTRUCTORS_REF:%.+]] = getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* [[TASK]], i{{.+}} 0, i{{.+}} 3
+// CHECK: [[DESTRUCTORS_PTR:%.+]] = bitcast %union{{.+}}* [[DESTRUCTORS_REF]] to i32 (i32, i8*)**
+// CHECK: store i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_MAIN_TY]]*)* [[DESTRUCTORS:@.+]] to i32 (i32, i8*)*), i32 (i32, i8*)** [[DESTRUCTORS_PTR]],
+
+// Start task.
+// CHECK: call void @__kmpc_taskloop([[LOC]], i32 [[GTID]], i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* bitcast (void ([[KMP_TASK_MAIN_TY]]*, [[KMP_TASK_MAIN_TY]]*, i32)* [[MAIN_DUP:@.+]] to i8*))
+// CHECK: call {{.*}}void @__kmpc_end_master(
+// CHECK-NEXT: br label {{%?}}[[EXIT]]
+// CHECK: [[EXIT]]
+
+// No destructors must be called for private copies of s_arr and var.
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+//
+
+// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_MAIN_TY]]* noalias %0, [[S_DOUBLE_TY]]** noalias %1, i32** noalias %2, [2 x [[S_DOUBLE_TY]]]** noalias %3, [2 x i32]** noalias %4, i32** noalias %5)
+// CHECK: [[PRIVATES:%.+]] = load [[PRIVATES_MAIN_TY]]*, [[PRIVATES_MAIN_TY]]**
+// CHECK: [[PRIV_S_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 0
+// CHECK: [[ARG3:%.+]] = load [2 x [[S_DOUBLE_TY]]]**, [2 x [[S_DOUBLE_TY]]]*** %{{.+}},
+// CHECK: store [2 x [[S_DOUBLE_TY]]]* [[PRIV_S_VAR]], [2 x [[S_DOUBLE_TY]]]** [[ARG3]],
+// CHECK: [[PRIV_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 1
+// CHECK: [[ARG1:%.+]] = load [[S_DOUBLE_TY]]**, [[S_DOUBLE_TY]]*** {{.+}},
+// CHECK: store [[S_DOUBLE_TY]]* [[PRIV_VAR]], [[S_DOUBLE_TY]]** [[ARG1]],
+// CHECK: [[PRIV_T_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 2
+// CHECK: [[ARG2:%.+]] = load i32**, i32*** %{{.+}},
+// CHECK: store i32* [[PRIV_T_VAR]], i32** [[ARG2]],
+// CHECK: [[PRIV_VEC:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 3
+// CHECK: [[ARG4:%.+]] = load [2 x i32]**, [2 x i32]*** %{{.+}},
+// CHECK: store [2 x i32]* [[PRIV_VEC]], [2 x i32]** [[ARG4]],
+// CHECK: ret void
+
+// CHECK: define internal i32 [[TASK_ENTRY]](i32 %0, [[KMP_TASK_MAIN_TY]]* noalias %1)
+
+// CHECK: [[PRIV_VAR_ADDR:%.+]] = alloca [[S_DOUBLE_TY]]*,
+// CHECK: [[PRIV_T_VAR_ADDR:%.+]] = alloca i32*,
+// CHECK: [[PRIV_S_ARR_ADDR:%.+]] = alloca [2 x [[S_DOUBLE_TY]]]*,
+// CHECK: [[PRIV_VEC_ADDR:%.+]] = alloca [2 x i32]*,
+// CHECK: [[PRIV_SIVAR_ADDR:%.+]] = alloca i32*,
+// CHECK: store void (i8*, ...)* bitcast (void ([[PRIVATES_MAIN_TY]]*, [[S_DOUBLE_TY]]**, i32**, [2 x [[S_DOUBLE_TY]]]**, [2 x i32]**, i32**)* [[PRIVATES_MAP_FN]] to void (i8*, ...)*), void (i8*, ...)** [[MAP_FN_ADDR:%.+]],
+// CHECK: [[MAP_FN:%.+]] = load void (i8*, ...)*, void (i8*, ...)** [[MAP_FN_ADDR]],
+// CHECK: call void (i8*, ...) [[MAP_FN]](i8* %{{.+}}, [[S_DOUBLE_TY]]** [[PRIV_VAR_ADDR]], i32** [[PRIV_T_VAR_ADDR]], [2 x [[S_DOUBLE_TY]]]** [[PRIV_S_ARR_ADDR]], [2 x i32]** [[PRIV_VEC_ADDR]], i32** [[PRIV_SIVAR_ADDR]])
+// CHECK: [[PRIV_VAR:%.+]] = load [[S_DOUBLE_TY]]*, [[S_DOUBLE_TY]]** [[PRIV_VAR_ADDR]],
+// CHECK: [[PRIV_T_VAR:%.+]] = load i32*, i32** [[PRIV_T_VAR_ADDR]],
+// CHECK: [[PRIV_S_ARR:%.+]] = load [2 x [[S_DOUBLE_TY]]]*, [2 x [[S_DOUBLE_TY]]]** [[PRIV_S_ARR_ADDR]],
+// CHECK: [[PRIV_VEC:%.+]] = load [2 x i32]*, [2 x i32]** [[PRIV_VEC_ADDR]],
+// CHECK: [[PRIV_SIVAR:%.+]] = load i32*, i32** [[PRIV_SIVAR_ADDR]],
+
+// Privates actually are used.
+// CHECK-DAG: [[PRIV_VAR]]
+// CHECK-DAG: [[PRIV_T_VAR]]
+// CHECK-DAG: [[PRIV_S_ARR]]
+// CHECK-DAG: [[PRIV_VEC]]
+// CHECK_DAG: [[PRIV_SIVAR]]
+
+// CHECK: ret
+
+// CHECK: define internal void [[MAIN_DUP]]([[KMP_TASK_MAIN_TY]]* %0, [[KMP_TASK_MAIN_TY]]* %1, i32 %2)
+// CHECK: getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* %{{.+}}, i32 0, i32 1
+// CHECK: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr inbounds [2 x [[S_DOUBLE_TY]]], [2 x [[S_DOUBLE_TY]]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i64 2
+// CHECK: br label %
+
+// CHECK: phi [[S_DOUBLE_TY]]*
+// CHECK: call {{.*}} [[S_DOUBLE_TY_DEF_CONSTR]]([[S_DOUBLE_TY]]*
+// CHECK: getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i64 1
+// CHECK: icmp eq [[S_DOUBLE_TY]]* %
+// CHECK: br i1 %
+
+// CHECK: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* %{{.+}}, i32 0, i32 1
+// CHECK: call {{.*}} [[S_DOUBLE_TY_DEF_CONSTR]]([[S_DOUBLE_TY]]*
+// CHECK: ret void
+
+// CHECK: define internal i32 [[DESTRUCTORS]](i32 %0, [[KMP_TASK_MAIN_TY]]* noalias %1)
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 0
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
+// CHECK: call void @_ZN1SIdED1Ev([[S_DOUBLE_TY]]* [[PRIVATE_VAR_REF]])
+// CHECK: getelementptr inbounds [2 x [[S_DOUBLE_TY]]], [2 x [[S_DOUBLE_TY]]]* [[PRIVATE_S_ARR_REF]], i{{.+}} 0, i{{.+}} 0
+// CHECK: getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i{{.+}} 2
+// CHECK: [[PRIVATE_S_ARR_ELEM_REF:%.+]] = getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i{{.+}} -1
+// CHECK: call void @_ZN1SIdED1Ev([[S_DOUBLE_TY]]* [[PRIVATE_S_ARR_ELEM_REF]])
+// CHECK: icmp eq
+// CHECK: br i1
+// CHECK: ret i32
+
+// CHECK: [[TEST:%.+]] = alloca [[S_INT_TY]],
+// CHECK: [[T_VAR_ADDR:%.+]] = alloca i32,
+// CHECK: [[VEC_ADDR:%.+]] = alloca [2 x i32],
+// CHECK: [[S_ARR_ADDR:%.+]] = alloca [2 x [[S_INT_TY]]],
+// CHECK: [[VAR_ADDR:%.+]] = alloca [[S_INT_TY]],
+
+// CHECK: call {{.*}} [[S_INT_TY_DEF_CONSTR:@.+]]([[S_INT_TY]]* [[TEST]])
+
+// Do not store original variables in capture struct.
+// CHECK-NOT: getelementptr inbounds [[CAP_TMAIN_TY]],
+
+// Allocate task.
+// Returns struct kmp_task_t {
+// [[KMP_TASK_T_TY]] task_data;
+// [[KMP_TASK_TMAIN_TY]] privates;
+// };
+// CHECK: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc([[LOC]], i32 [[GTID:%.+]], i32 9, i64 256, i64 1, i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_TMAIN_TY]]*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+// CHECK: [[RES_KMP_TASK:%.+]] = bitcast i8* [[RES]] to [[KMP_TASK_TMAIN_TY]]*
+
+// CHECK: [[TASK:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+
+// Initialize kmp_task_t->privates with default values (no init for simple types, default constructors for classes).
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
+
+// Constructors for s_arr and var.
+// a_arr;
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
+// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* [[PRIVATE_S_ARR_REF]], i{{.+}} 0, i{{.+}} 0
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i{{.+}} 2
+// CHECK: call void [[S_INT_TY_DEF_CONSTR]]([[S_INT_TY]]* [[S_ARR_CUR:%.+]])
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* [[S_ARR_CUR]], i{{.+}} 1
+// CHECK: icmp eq
+// CHECK: br i1
+
+// var;
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: call void [[S_INT_TY_DEF_CONSTR]]([[S_INT_TY]]* [[PRIVATE_VAR_REF:%.+]])
+
+// Provide pointer to destructor function, which will destroy private variables at the end of the task.
+// CHECK: [[DESTRUCTORS_REF:%.+]] = getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* [[TASK]], i{{.+}} 0, i{{.+}} 3
+// CHECK: [[DESTRUCTORS_PTR:%.+]] = bitcast %union{{.+}}* [[DESTRUCTORS_REF]] to i32 (i32, i8*)**
+// CHECK: store i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_TMAIN_TY]]*)* [[DESTRUCTORS:@.+]] to i32 (i32, i8*)*), i32 (i32, i8*)** [[DESTRUCTORS_PTR]],
+
+// Start task.
+// CHECK: call void @__kmpc_taskloop([[LOC]], i32 [[GTID]], i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* bitcast (void ([[KMP_TASK_TMAIN_TY]]*, [[KMP_TASK_TMAIN_TY]]*, i32)* [[TMAIN_DUP:@.+]] to i8*))
+
+// No destructors must be called for private copies of s_arr and var.
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+//
+
+// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_TMAIN_TY]]* noalias %0, i32** noalias %1, [2 x i32]** noalias %2, [2 x [[S_INT_TY]]]** noalias %3, [[S_INT_TY]]** noalias %4)
+// CHECK: [[PRIVATES:%.+]] = load [[PRIVATES_TMAIN_TY]]*, [[PRIVATES_TMAIN_TY]]**
+// CHECK: [[PRIV_T_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 0
+// CHECK: [[ARG1:%.+]] = load i32**, i32*** %{{.+}},
+// CHECK: store i32* [[PRIV_T_VAR]], i32** [[ARG1]],
+// CHECK: [[PRIV_VEC:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 1
+// CHECK: [[ARG2:%.+]] = load [2 x i32]**, [2 x i32]*** %{{.+}},
+// CHECK: store [2 x i32]* [[PRIV_VEC]], [2 x i32]** [[ARG2]],
+// CHECK: [[PRIV_S_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 2
+// CHECK: [[ARG3:%.+]] = load [2 x [[S_INT_TY]]]**, [2 x [[S_INT_TY]]]*** %{{.+}},
+// CHECK: store [2 x [[S_INT_TY]]]* [[PRIV_S_VAR]], [2 x [[S_INT_TY]]]** [[ARG3]],
+// CHECK: [[PRIV_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 3
+// CHECK: [[ARG4:%.+]] = load [[S_INT_TY]]**, [[S_INT_TY]]*** {{.+}},
+// CHECK: store [[S_INT_TY]]* [[PRIV_VAR]], [[S_INT_TY]]** [[ARG4]],
+// CHECK: ret void
+
+// CHECK: define internal i32 [[TASK_ENTRY]](i32 %0, [[KMP_TASK_TMAIN_TY]]* noalias %1)
+
+// CHECK: alloca i32*,
+// CHECK-DAG: [[PRIV_T_VAR_ADDR:%.+]] = alloca i32*,
+// CHECK-DAG: [[PRIV_VEC_ADDR:%.+]] = alloca [2 x i32]*,
+// CHECK-DAG: [[PRIV_S_ARR_ADDR:%.+]] = alloca [2 x [[S_INT_TY]]]*,
+// CHECK-DAG: [[PRIV_VAR_ADDR:%.+]] = alloca [[S_INT_TY]]*,
+// CHECK: store void (i8*, ...)* bitcast (void ([[PRIVATES_TMAIN_TY]]*, i32**, [2 x i32]**, [2 x [[S_INT_TY]]]**, [[S_INT_TY]]**)* [[PRIVATES_MAP_FN]] to void (i8*, ...)*), void (i8*, ...)** [[MAP_FN_ADDR:%.+]],
+// CHECK: [[MAP_FN:%.+]] = load void (i8*, ...)*, void (i8*, ...)** [[MAP_FN_ADDR]],
+// CHECK: call void (i8*, ...) [[MAP_FN]](i8* %{{.+}}, i32** [[PRIV_T_VAR_ADDR]], [2 x i32]** [[PRIV_VEC_ADDR]], [2 x [[S_INT_TY]]]** [[PRIV_S_ARR_ADDR]], [[S_INT_TY]]** [[PRIV_VAR_ADDR]])
+// CHECK: [[PRIV_T_VAR:%.+]] = load i32*, i32** [[PRIV_T_VAR_ADDR]],
+// CHECK: [[PRIV_VEC:%.+]] = load [2 x i32]*, [2 x i32]** [[PRIV_VEC_ADDR]],
+// CHECK: [[PRIV_S_ARR:%.+]] = load [2 x [[S_INT_TY]]]*, [2 x [[S_INT_TY]]]** [[PRIV_S_ARR_ADDR]],
+// CHECK: [[PRIV_VAR:%.+]] = load [[S_INT_TY]]*, [[S_INT_TY]]** [[PRIV_VAR_ADDR]],
+
+// Privates actually are used.
+// CHECK-DAG: [[PRIV_VAR]]
+// CHECK-DAG: [[PRIV_T_VAR]]
+// CHECK-DAG: [[PRIV_S_ARR]]
+// CHECK-DAG: [[PRIV_VEC]]
+
+// CHECK: ret
+
+// CHECK: define internal void [[TMAIN_DUP]]([[KMP_TASK_TMAIN_TY]]* %0, [[KMP_TASK_TMAIN_TY]]* %1, i32 %2)
+// CHECK: getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* %{{.+}}, i32 0, i32 2
+// CHECK: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* %{{.+}}, i32 0, i32 2
+// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i64 2
+// CHECK: br label %
+
+// CHECK: phi [[S_INT_TY]]*
+// CHECK: call {{.*}} [[S_INT_TY_DEF_CONSTR]]([[S_INT_TY]]*
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i64 1
+// CHECK: icmp eq [[S_INT_TY]]* %
+// CHECK: br i1 %
+
+// CHECK: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* %{{.+}}, i32 0, i32 3
+// CHECK: call {{.*}} [[S_INT_TY_DEF_CONSTR]]([[S_INT_TY]]*
+// CHECK: ret void
+
+// CHECK: define internal i32 [[DESTRUCTORS]](i32 %0, [[KMP_TASK_TMAIN_TY]]* noalias %1)
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: call void @_ZN1SIiED1Ev([[S_INT_TY]]* [[PRIVATE_VAR_REF]])
+// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* [[PRIVATE_S_ARR_REF]], i{{.+}} 0, i{{.+}} 0
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i{{.+}} 2
+// CHECK: [[PRIVATE_S_ARR_ELEM_REF:%.+]] = getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i{{.+}} -1
+// CHECK: call void @_ZN1SIiED1Ev([[S_INT_TY]]* [[PRIVATE_S_ARR_ELEM_REF]])
+// CHECK: icmp eq
+// CHECK: br i1
+// CHECK: ret i32
+
+#endif
+#else
+// ARRAY-LABEL: array_func
+struct St {
+ int a, b;
+ St() : a(0), b(0) {}
+ St &operator=(const St &) { return *this; };
+ ~St() {}
+};
+
+void array_func(int n, float a[n], St s[2]) {
+// ARRAY: call i8* @__kmpc_omp_task_alloc(
+// ARRAY: call void @__kmpc_taskloop(
+// ARRAY: store float** %{{.+}}, float*** %{{.+}},
+// ARRAY: store %struct.St** %{{.+}}, %struct.St*** %{{.+}},
+#pragma omp parallel master taskloop private(a, s)
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+#endif
+
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_private_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_private_messages.cpp
new file mode 100644
index 0000000..47b40f9
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_private_messages.cpp
@@ -0,0 +1,259 @@
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+
+typedef void **omp_allocator_handle_t;
+extern const omp_allocator_handle_t omp_default_mem_alloc;
+extern const omp_allocator_handle_t omp_large_cap_mem_alloc;
+extern const omp_allocator_handle_t omp_const_mem_alloc;
+extern const omp_allocator_handle_t omp_high_bw_mem_alloc;
+extern const omp_allocator_handle_t omp_low_lat_mem_alloc;
+extern const omp_allocator_handle_t omp_cgroup_mem_alloc;
+extern const omp_allocator_handle_t omp_pteam_mem_alloc;
+extern const omp_allocator_handle_t omp_thread_mem_alloc;
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+struct S1; // expected-note 2 {{declared here}} expected-note 2 {{forward declaration of 'S1'}}
+extern S1 a;
+class S2 {
+ mutable int a;
+
+public:
+ S2() : a(0) {}
+};
+const S2 b;
+const S2 ba[5];
+class S3 {
+ int a;
+
+public:
+ S3() : a(0) {}
+};
+const S3 ca[5];
+class S4 {
+ int a;
+ S4(); // expected-note {{implicitly declared private here}}
+
+public:
+ S4(int v) : a(v) {
+#pragma omp parallel master taskloop private(a) private(this->a)
+ for (int k = 0; k < v; ++k)
+ ++this->a;
+ }
+};
+class S5 {
+ int a;
+ S5() : a(0) {} // expected-note {{implicitly declared private here}}
+
+public:
+ S5(int v) : a(v) {}
+ S5 &operator=(S5 &s) {
+#pragma omp parallel master taskloop private(a) private(this->a) private(s.a) // expected-error {{expected variable name or data member of current class}}
+ for (int k = 0; k < s.a; ++k)
+ ++s.a;
+ return *this;
+ }
+};
+
+template <typename T>
+class S6 {
+public:
+ T a;
+
+ S6() : a(0) {}
+ S6(T v) : a(v) {
+#pragma omp parallel master taskloop private(a) private(this->a) allocate(omp_thread_mem_alloc: a) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'parallel master taskloop' directive}}
+ for (int k = 0; k < v; ++k)
+ ++this->a;
+ }
+ S6 &operator=(S6 &s) {
+#pragma omp parallel master taskloop private(a) private(this->a) private(s.a) // expected-error {{expected variable name or data member of current class}}
+ for (int k = 0; k < s.a; ++k)
+ ++s.a;
+ return *this;
+ }
+};
+
+template <typename T>
+class S7 : public T {
+ T a;
+ S7() : a(0) {}
+
+public:
+ S7(T v) : a(v) {
+#pragma omp parallel master taskloop private(a) private(this->a) private(T::a)
+ for (int k = 0; k < a.a; ++k)
+ ++this->a.a;
+ }
+ S7 &operator=(S7 &s) {
+#pragma omp parallel master taskloop private(a) private(this->a) private(s.a) private(s.T::a) // expected-error 2 {{expected variable name or data member of current class}}
+ for (int k = 0; k < s.a.a; ++k)
+ ++s.a.a;
+ return *this;
+ }
+};
+
+S3 h;
+#pragma omp threadprivate(h) // expected-note 2 {{defined as threadprivate or thread local}}
+
+template <class I, class C>
+int foomain(I argc, C **argv) {
+ I e(4);
+ I g(5);
+ int i, z;
+ int &j = i;
+#pragma omp parallel master taskloop private // expected-error {{expected '(' after 'private'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop private( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop private() // expected-error {{expected expression}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop private(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop private(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop private(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop private(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop private(S1) // expected-error {{'S1' does not refer to a value}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop private(a, b) // expected-error {{private variable with incomplete type 'S1'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop private(argv[1]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop private(e, g, z)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop private(h) // expected-error {{threadprivate or thread local variable cannot be private}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop shared(i)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+ {
+ int v = 0;
+ int i;
+#pragma omp parallel master taskloop private(i)
+ for (int k = 0; k < argc; ++k) {
+ i = k;
+ v += i;
+ }
+ }
+#pragma omp parallel shared(i)
+#pragma omp parallel private(i)
+#pragma omp parallel master taskloop private(j)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop private(i)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+ return 0;
+}
+
+void bar(S4 a[2]) {
+#pragma omp parallel
+#pragma omp parallel master taskloop private(a)
+ for (int i = 0; i < 2; ++i)
+ foo();
+}
+
+namespace A {
+double x;
+#pragma omp threadprivate(x) // expected-note {{defined as threadprivate or thread local}}
+}
+namespace B {
+using A::x;
+}
+
+int main(int argc, char **argv) {
+ S4 e(4);
+ S5 g(5);
+ S6<float> s6(0.0) , s6_0(1.0); // expected-note {{in instantiation of member function 'S6<float>::S6' requested here}}
+ S7<S6<float> > s7(0.0) , s7_0(1.0);
+ int i, z;
+ int &j = i;
+#pragma omp parallel master taskloop private // expected-error {{expected '(' after 'private'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop private( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop private() // expected-error {{expected expression}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop private(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop private(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop private(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop private(argc)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop private(S1) // expected-error {{'S1' does not refer to a value}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop private(a, b) // expected-error {{private variable with incomplete type 'S1'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop private(argv[1]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop private(e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop private(h) // expected-error {{threadprivate or thread local variable cannot be private}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop private(B::x) // expected-error {{threadprivate or thread local variable cannot be private}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop shared(i)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+ {
+ int i;
+#pragma omp parallel master taskloop private(i)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+ }
+#pragma omp parallel shared(i)
+#pragma omp parallel private(i)
+#pragma omp parallel master taskloop private(j)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop private(i, z)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+ static int si;
+#pragma omp parallel master taskloop private(si) // OK
+ for(int k = 0; k < argc; ++k)
+ si = k + 1;
+
+ s6 = s6_0; // expected-note {{in instantiation of member function 'S6<float>::operator=' requested here}}
+ s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float> >::operator=' requested here}}
+ return foomain(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<int, char>' requested here}}
+}
+
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_reduction_codegen.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_reduction_codegen.cpp
new file mode 100644
index 0000000..dc157ab
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_reduction_codegen.cpp
@@ -0,0 +1,234 @@
+// RUN: %clang_cc1 -fopenmp -x c++ %s -verify -debug-info-kind=limited -emit-llvm -o - -triple powerpc64le-unknown-linux-gnu -std=c++98 -fnoopenmp-use-tls | FileCheck %s
+
+// RUN: %clang_cc1 -fopenmp-simd -x c++ %s -verify -debug-info-kind=limited -emit-llvm -o - -triple powerpc64le-unknown-linux-gnu -std=c++98 -fnoopenmp-use-tls | FileCheck --check-prefix SIMD-ONLY0 %s
+// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
+// expected-no-diagnostics
+
+struct S {
+ float a;
+ S() : a(0.0f) {}
+ ~S() {}
+};
+
+#pragma omp declare reduction(+:S:omp_out.a += omp_in.a) initializer(omp_priv = omp_orig)
+
+float g;
+
+int a;
+#pragma omp threadprivate(a)
+int main (int argc, char *argv[])
+{
+int i, n;
+float a[100], b[100], sum, e[argc + 100];
+S c[100];
+float &d = g;
+
+/* Some initializations */
+n = 100;
+for (i=0; i < n; i++)
+ a[i] = b[i] = i * 1.0;
+sum = 0.0;
+
+#pragma omp parallel master taskloop reduction(+:sum, c[:n], d, e)
+ for (i=0; i < n; i++) {
+ sum = sum + (a[i] * b[i]);
+ c[i].a = i*i;
+ d += i*i;
+ e[i] = i;
+ }
+
+}
+
+// CHECK-LABEL: @main(
+// CHECK: [[RETVAL:%.*]] = alloca i32,
+// CHECK: [[ARGC_ADDR:%.*]] = alloca i32,
+// CHECK: [[ARGV_ADDR:%.*]] = alloca i8**,
+// CHECK: [[I:%.*]] = alloca i32,
+// CHECK: [[N:%.*]] = alloca i32,
+// CHECK: [[A:%.*]] = alloca [100 x float],
+// CHECK: [[B:%.*]] = alloca [100 x float],
+// CHECK: [[SUM:%.*]] = alloca float,
+// CHECK: [[SAVED_STACK:%.*]] = alloca i8*,
+// CHECK: [[C:%.*]] = alloca [100 x %struct.S],
+// CHECK: [[D:%.*]] = alloca float*,
+// CHECK: store i32 0, i32* [[RETVAL]],
+// CHECK: store i32 [[ARGC:%.*]], i32* [[ARGC_ADDR]],
+// CHECK: store i8** [[ARGV:%.*]], i8*** [[ARGV_ADDR]],
+// CHECK: [[TMP1:%.*]] = load i32, i32* [[ARGC_ADDR]],
+// CHECK: [[ADD:%.*]] = add nsw i32 [[TMP1]], 100
+// CHECK: [[TMP2:%.*]] = zext i32 [[ADD]] to i64
+// CHECK: [[VLA:%.+]] = alloca float, i64 %
+
+// CHECK: [[SUM_ADDR:%.*]] = alloca float*,
+// CHECK: [[AGG_CAPTURED:%.*]] = alloca [[STRUCT_ANON:%.*]],
+// CHECK: [[DOTRD_INPUT_:%.*]] = alloca [4 x %struct.kmp_task_red_input_t],
+// CHECK: alloca i32,
+// CHECK: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32,
+// CHECK: [[DOTCAPTURE_EXPR_9:%.*]] = alloca i32,
+// CHECK: [[RES:%.+]] = call {{.*}}i32 @__kmpc_master(
+// CHECK-NEXT: [[IS_MASTER:%.+]] = icmp ne i32 [[RES]], 0
+// CHECK-NEXT: br i1 [[IS_MASTER]], label {{%?}}[[THEN:.+]], label {{%?}}[[EXIT:[^,]+]]
+// CHECK: [[THEN]]
+// CHECK: call void @__kmpc_taskgroup(%struct.ident_t*
+// CHECK-DAG: [[TMP21:%.*]] = bitcast float* %{{.+}} to i8*
+// CHECK-DAG: store i8* [[TMP21]], i8** [[TMP20:%[^,]+]],
+// CHECK-DAG: [[TMP20]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T:%.+]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_:%.+]], i32 0, i32 0
+// CHECK-DAG: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 1
+// CHECK-DAG: store i64 4, i64* [[TMP22]],
+// CHECK-DAG: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 2
+// CHECK-DAG: store i8* bitcast (void (i8*)* @[[RED_INIT1:.+]] to i8*), i8** [[TMP23]],
+// CHECK-DAG: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 3
+// CHECK-DAG: store i8* null, i8** [[TMP24]],
+// CHECK-DAG: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 4
+// CHECK-DAG: store i8* bitcast (void (i8*, i8*)* @[[RED_COMB1:.+]] to i8*), i8** [[TMP25]],
+// CHECK-DAG: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 5
+// CHECK-DAG: [[TMP27:%.*]] = bitcast i32* [[TMP26]] to i8*
+// CHECK-DAG: call void @llvm.memset.p0i8.i64(i8* align 8 [[TMP27]], i8 0, i64 4, i1 false)
+// CHECK-DAG: [[ARRAYIDX5:%.*]] = getelementptr inbounds [100 x %struct.S], [100 x %struct.S]* [[C:%.+]], i64 0, i64 0
+// CHECK-DAG: [[LB_ADD_LEN:%.*]] = add nsw i64 -1, %
+// CHECK-DAG: [[ARRAYIDX6:%.*]] = getelementptr inbounds [100 x %struct.S], [100 x %struct.S]* [[C]], i64 0, i64 [[LB_ADD_LEN]]
+// CHECK-DAG: [[TMP31:%.*]] = bitcast %struct.S* [[ARRAYIDX5]] to i8*
+// CHECK-DAG: store i8* [[TMP31]], i8** [[TMP28:%[^,]+]],
+// CHECK-DAG: [[TMP28]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_4:%.+]], i32 0, i32 0
+// CHECK-DAG: [[TMP32:%.*]] = ptrtoint %struct.S* [[ARRAYIDX6]] to i64
+// CHECK-DAG: [[TMP33:%.*]] = ptrtoint %struct.S* [[ARRAYIDX5]] to i64
+// CHECK-DAG: [[TMP34:%.*]] = sub i64 [[TMP32]], [[TMP33]]
+// CHECK-DAG: [[TMP35:%.*]] = sdiv exact i64 [[TMP34]], ptrtoint (float* getelementptr (float, float* null, i32 1) to i64)
+// CHECK-DAG: [[TMP36:%.*]] = add nuw i64 [[TMP35]], 1
+// CHECK-DAG: [[TMP37:%.*]] = mul nuw i64 [[TMP36]], ptrtoint (float* getelementptr (float, float* null, i32 1) to i64)
+// CHECK-DAG: store i64 [[TMP37]], i64* [[TMP38:%[^,]+]],
+// CHECK-DAG: [[TMP38]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_4]], i32 0, i32 1
+// CHECK-DAG: [[TMP39:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_4]], i32 0, i32 2
+// CHECK-DAG: store i8* bitcast (void (i8*)* @[[RED_INIT2:.+]] to i8*), i8** [[TMP39]],
+// CHECK-DAG: [[TMP40:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_4]], i32 0, i32 3
+// CHECK-DAG: store i8* bitcast (void (i8*)* @[[RED_FINI2:.+]] to i8*), i8** [[TMP40]],
+// CHECK-DAG: [[TMP41:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_4]], i32 0, i32 4
+// CHECK-DAG: store i8* bitcast (void (i8*, i8*)* @[[RED_COMB2:.+]] to i8*), i8** [[TMP41]],
+// CHECK-DAG: [[TMP42:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_4]], i32 0, i32 5
+// CHECK-DAG: store i32 1, i32* [[TMP42]],
+// CHECK-DAG: [[TMP44:%.*]] = load float*, float** [[D:%.+]],
+// CHECK-DAG: [[TMP45:%.*]] = bitcast float* [[TMP44]] to i8*
+// CHECK-DAG: store i8* [[TMP45]], i8** [[TMP43:%[^,]+]],
+// CHECK-DAG: [[TMP43]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_7:%.+]], i32 0, i32 0
+// CHECK-DAG: [[TMP46:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 1
+// CHECK-DAG: store i64 4, i64* [[TMP46]],
+// CHECK-DAG: [[TMP47:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 2
+// CHECK-DAG: store i8* bitcast (void (i8*)* @[[RED_INIT3:.+]] to i8*), i8** [[TMP47]],
+// CHECK-DAG: [[TMP48:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 3
+// CHECK-DAG: store i8* null, i8** [[TMP48]],
+// CHECK-DAG: [[TMP49:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 4
+// CHECK-DAG: store i8* bitcast (void (i8*, i8*)* @[[RED_COMB3:.+]] to i8*), i8** [[TMP49]],
+// CHECK-DAG: [[TMP50:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 5
+// CHECK-DAG: [[TMP51:%.*]] = bitcast i32* [[TMP50]] to i8*
+// CHECK-DAG: call void @llvm.memset.p0i8.i64(i8* align 8 [[TMP51]], i8 0, i64 4, i1 false)
+// CHECK-DAG: [[TMP53:%.*]] = bitcast float* [[VLA:%.+]] to i8*
+// CHECK-DAG: store i8* [[TMP53]], i8** [[TMP52:%[^,]+]],
+// CHECK-DAG: [[TMP52]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_8:%.+]], i32 0, i32 0
+// CHECK-DAG: [[TMP54:%.*]] = mul nuw i64 [[TMP2:%.+]], 4
+// CHECK-DAG: [[TMP55:%.*]] = udiv exact i64 [[TMP54]], ptrtoint (float* getelementptr (float, float* null, i32 1) to i64)
+// CHECK-DAG: store i64 [[TMP54]], i64* [[TMP56:%[^,]+]],
+// CHECK-DAG: [[TMP56]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_8]], i32 0, i32 1
+// CHECK-DAG: [[TMP57:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_8]], i32 0, i32 2
+// CHECK-DAG: store i8* bitcast (void (i8*)* @[[RED_INIT4:.+]] to i8*), i8** [[TMP57]],
+// CHECK-DAG: [[TMP58:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_8]], i32 0, i32 3
+// CHECK-DAG: store i8* null, i8** [[TMP58]],
+// CHECK-DAG: [[TMP59:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_8]], i32 0, i32 4
+// CHECK-DAG: store i8* bitcast (void (i8*, i8*)* @[[RED_COMB4:.+]] to i8*), i8** [[TMP59]],
+// CHECK-DAG: [[TMP60:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_8]], i32 0, i32 5
+// CHECK-DAG: store i32 1, i32* [[TMP60]],
+// CHECK-DAG: [[DOTRD_INPUT_GEP_]] = getelementptr inbounds [4 x %struct.kmp_task_red_input_t], [4 x %struct.kmp_task_red_input_t]* [[DOTRD_INPUT_]], i64 0, i64
+// CHECK-DAG: [[DOTRD_INPUT_GEP_4]] = getelementptr inbounds [4 x %struct.kmp_task_red_input_t], [4 x %struct.kmp_task_red_input_t]* [[DOTRD_INPUT_]], i64 0, i64
+// CHECK-DAG: [[DOTRD_INPUT_GEP_7]] = getelementptr inbounds [4 x %struct.kmp_task_red_input_t], [4 x %struct.kmp_task_red_input_t]* [[DOTRD_INPUT_]], i64 0, i64
+// CHECK-DAG: [[DOTRD_INPUT_GEP_8]] = getelementptr inbounds [4 x %struct.kmp_task_red_input_t], [4 x %struct.kmp_task_red_input_t]* [[DOTRD_INPUT_]], i64 0, i64
+// CHECK: [[TMP61:%.*]] = bitcast [4 x %struct.kmp_task_red_input_t]* [[DOTRD_INPUT_]] to i8*
+// CHECK: [[TMP62:%.*]] = call i8* @__kmpc_task_reduction_init(i32 [[TMP0:%.+]], i32 4, i8* [[TMP61]])
+// CHECK: [[TMP63:%.*]] = load i32, i32* [[N:%.+]],
+// CHECK: store i32 [[TMP63]], i32* [[DOTCAPTURE_EXPR_]],
+// CHECK: [[TMP64:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]],
+// CHECK: [[SUB:%.*]] = sub nsw i32 [[TMP64]], 0
+// CHECK: [[SUB10:%.*]] = sub nsw i32 [[SUB]], 1
+// CHECK: [[ADD11:%.*]] = add nsw i32 [[SUB10]], 1
+// CHECK: [[DIV:%.*]] = sdiv i32 [[ADD11]], 1
+// CHECK: [[SUB12:%.*]] = sub nsw i32 [[DIV]], 1
+// CHECK: store i32 [[SUB12]], i32* [[DOTCAPTURE_EXPR_9]],
+// CHECK: [[TMP65:%.*]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* %{{.+}}, i32 [[TMP0]], i32 1, i64 888, i64 64, i32 (i32, i8*)* bitcast (i32 (i32, %struct.kmp_task_t_with_privates*)* @[[TASK:.+]] to i32 (i32, i8*)*))
+// CHECK: call void @__kmpc_taskloop(%struct.ident_t* %{{.+}}, i32 [[TMP0]], i8* [[TMP65]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* null)
+// CHECK: call void @__kmpc_end_taskgroup(%struct.ident_t*
+// CHECK: call {{.*}}void @__kmpc_end_master(
+// CHECK-NEXT: br label {{%?}}[[EXIT]]
+// CHECK: [[EXIT]]
+
+// CHECK: define internal void @[[RED_INIT1]](i8* %0)
+// CHECK: store float 0.000000e+00, float* %
+// CHECK: ret void
+
+// CHECK: define internal void @[[RED_COMB1]](i8* %0, i8* %1)
+// CHECK: fadd float %
+// CHECK: store float %{{.+}}, float* %
+// CHECK: ret void
+
+// CHECK: define internal void @[[RED_INIT2]](i8* %0)
+// CHECK: call i8* @__kmpc_threadprivate_cached(
+// CHECK: [[ORIG_PTR_ADDR:%.+]] = call i8* @__kmpc_threadprivate_cached(
+// CHECK: [[ORIG_PTR_REF:%.+]] = bitcast i8* [[ORIG_PTR_ADDR]] to i8**
+// CHECK: load i8*, i8** [[ORIG_PTR_REF]],
+// CHECK: call void [[OMP_INIT1:@.+]](
+// CHECK: ret void
+
+// CHECK: define internal void [[OMP_COMB1:@.+]](%struct.S* noalias %0, %struct.S* noalias %1)
+// CHECK: fadd float %
+
+// CHECK: define internal void [[OMP_INIT1]](%struct.S* noalias %0, %struct.S* noalias %1)
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(
+
+// CHECK: define internal void @[[RED_FINI2]](i8* %0)
+// CHECK: call i8* @__kmpc_threadprivate_cached(
+// CHECK: call void @
+// CHECK: ret void
+
+// CHECK: define internal void @[[RED_COMB2]](i8* %0, i8* %1)
+// CHECK: call i8* @__kmpc_threadprivate_cached(
+// CHECK: call void [[OMP_COMB1]](
+// CHECK: ret void
+
+// CHECK: define internal void @[[RED_INIT3]](i8* %0)
+// CHECK: store float 0.000000e+00, float* %
+// CHECK: ret void
+
+// CHECK: define internal void @[[RED_COMB3]](i8* %0, i8* %1)
+// CHECK: fadd float %
+// CHECK: store float %{{.+}}, float* %
+// CHECK: ret void
+
+// CHECK: define internal void @[[RED_INIT4]](i8* %0)
+// CHECK: call i8* @__kmpc_threadprivate_cached(
+// CHECK: store float 0.000000e+00, float* %
+// CHECK: ret void
+
+// CHECK: define internal void @[[RED_COMB4]](i8* %0, i8* %1)
+// CHECK: call i8* @__kmpc_threadprivate_cached(
+// CHECK: fadd float %
+// CHECK: store float %{{.+}}, float* %
+// CHECK: ret void
+
+// CHECK-NOT: call i8* @__kmpc_threadprivate_cached(
+// CHECK: call i8* @__kmpc_task_reduction_get_th_data(
+// CHECK: call i8* @__kmpc_threadprivate_cached(
+// CHECK: call i8* @__kmpc_threadprivate_cached(
+// CHECK: call i8* @__kmpc_task_reduction_get_th_data(
+// CHECK-NOT: call i8* @__kmpc_threadprivate_cached(
+// CHECK: call i8* @__kmpc_task_reduction_get_th_data(
+// CHECK: call i8* @__kmpc_threadprivate_cached(
+// CHECK: call i8* @__kmpc_task_reduction_get_th_data(
+// CHECK-NOT: call i8* @__kmpc_threadprivate_cached(
+
+// CHECK-DAG: distinct !DISubprogram(linkageName: "[[TASK]]", scope: !
+// CHECK-DAG: !DISubprogram(linkageName: "[[RED_INIT1]]"
+// CHECK-DAG: !DISubprogram(linkageName: "[[RED_COMB1]]"
+// CHECK-DAG: !DISubprogram(linkageName: "[[RED_INIT2]]"
+// CHECK-DAG: !DISubprogram(linkageName: "[[RED_FINI2]]"
+// CHECK-DAG: !DISubprogram(linkageName: "[[RED_COMB2]]"
+// CHECK-DAG: !DISubprogram(linkageName: "[[RED_INIT3]]"
+// CHECK-DAG: !DISubprogram(linkageName: "[[RED_COMB3]]"
+// CHECK-DAG: !DISubprogram(linkageName: "[[RED_INIT4]]"
+// CHECK-DAG: !DISubprogram(linkageName: "[[RED_COMB4]]"
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_reduction_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_reduction_messages.cpp
new file mode 100644
index 0000000..309cf71
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_reduction_messages.cpp
@@ -0,0 +1,352 @@
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
+
+typedef void **omp_allocator_handle_t;
+extern const omp_allocator_handle_t omp_default_mem_alloc;
+extern const omp_allocator_handle_t omp_large_cap_mem_alloc;
+extern const omp_allocator_handle_t omp_const_mem_alloc;
+extern const omp_allocator_handle_t omp_high_bw_mem_alloc;
+extern const omp_allocator_handle_t omp_low_lat_mem_alloc;
+extern const omp_allocator_handle_t omp_cgroup_mem_alloc;
+extern const omp_allocator_handle_t omp_pteam_mem_alloc;
+extern const omp_allocator_handle_t omp_thread_mem_alloc;
+
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp parallel master taskloop reduction(+:fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+void foobar(int &ref) {
+#pragma omp parallel master taskloop reduction(+:ref)
+ for (int i = 0; i < 10; ++i)
+ foo();
+}
+
+struct S1; // expected-note {{declared here}} expected-note 4 {{forward declaration of 'S1'}}
+extern S1 a;
+class S2 {
+ mutable int a;
+ S2 &operator+(const S2 &arg) { return (*this); } // expected-note 3 {{implicitly declared private here}}
+
+public:
+ S2() : a(0) {}
+ S2(S2 &s2) : a(s2.a) {}
+ static float S2s; // expected-note 2 {{static data member is predetermined as shared}}
+ static const float S2sc; // expected-note 2 {{'S2sc' declared here}}
+};
+const float S2::S2sc = 0;
+S2 b; // expected-note 3 {{'b' defined here}}
+const S2 ba[5]; // expected-note 2 {{'ba' defined here}}
+class S3 {
+ int a;
+
+public:
+ int b;
+ S3() : a(0) {}
+ S3(const S3 &s3) : a(s3.a) {}
+ S3 operator+(const S3 &arg1) { return arg1; }
+};
+int operator+(const S3 &arg1, const S3 &arg2) { return 5; }
+S3 c; // expected-note 3 {{'c' defined here}}
+const S3 ca[5]; // expected-note 2 {{'ca' defined here}}
+extern const int f; // expected-note 4 {{'f' declared here}}
+class S4 {
+ int a;
+ S4(); // expected-note {{implicitly declared private here}}
+ S4(const S4 &s4);
+ S4 &operator+(const S4 &arg) { return (*this); }
+
+public:
+ S4(int v) : a(v) {}
+};
+S4 &operator&=(S4 &arg1, S4 &arg2) { return arg1; }
+class S5 {
+ int a:32;
+ S5() : a(0) {} // expected-note {{implicitly declared private here}}
+ S5(const S5 &s5) : a(s5.a) {}
+ S5 &operator+(const S5 &arg);
+
+public:
+ S5(int v) : a(v) {}
+};
+class S6 { // expected-note 3 {{candidate function (the implicit copy assignment operator) not viable: no known conversion from 'int' to 'const S6' for 1st argument}}
+#if __cplusplus >= 201103L // C++11 or later
+// expected-note@-2 3 {{candidate function (the implicit move assignment operator) not viable}}
+#endif
+ int a;
+
+public:
+ S6() : a(6) {}
+ operator int() { return 6; }
+} o;
+
+struct S7 {
+ int a: 32;
+ S7() {
+#pragma omp parallel master taskloop reduction(+:a) // expected-error {{expected addressable reduction item for the task-based directives}}
+ for (int i = 0; i < 10; ++i)
+ ++a;
+ }
+};
+
+S3 h, k;
+#pragma omp threadprivate(h) // expected-note 2 {{defined as threadprivate or thread local}}
+
+template <class T> // expected-note {{declared here}}
+T tmain(T argc) {
+ const T d = T(); // expected-note 4 {{'d' defined here}}
+ const T da[5] = {T()}; // expected-note 2 {{'da' defined here}}
+ T qa[5] = {T()};
+ T i, z;
+ T &j = i; // expected-note 4 {{'j' defined here}}
+ S3 &p = k; // expected-note 2 {{'p' defined here}}
+ const T &r = da[(int)i]; // expected-note 2 {{'r' defined here}}
+ T &q = qa[(int)i]; // expected-note 2 {{'q' defined here}}
+ T fl;
+#pragma omp parallel master taskloop reduction // expected-error {{expected '(' after 'reduction'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction + // expected-error {{expected '(' after 'reduction'}} expected-warning {{extra tokens at the end of '#pragma omp parallel master taskloop' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction( // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(- // expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction() // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(*) // expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected expression}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(\) // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(& : argc // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{invalid operands to binary expression ('float' and 'float')}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(| : argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{invalid operands to binary expression ('float' and 'float')}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(|| : argc ? i : argc) // expected-error 2 {{expected variable name, array element or array section}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(foo : argc) //expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'float'}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'int'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(^ : T) // expected-error {{'T' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(+ : z, a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 4 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 3 {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(max : h.b) // expected-error {{expected variable name, array element or array section}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(+ : ba) // expected-error {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(* : ca) // expected-error {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(- : da) // expected-error {{const-qualified variable cannot be reduction}} expected-error {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(^ : fl) // expected-error {{invalid operands to binary expression ('float' and 'float')}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(&& : S2::S2s) // expected-error {{shared variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(+ : h, k) // expected-error {{threadprivate or thread local variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(+ : o) // expected-error 2 {{no viable overloaded '='}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop private(i), reduction(+ : j), reduction(+ : q) // expected-error 4 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel private(k)
+#pragma omp parallel master taskloop reduction(+ : p), reduction(+ : p) // expected-error 2 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(+ : p), reduction(+ : p) // expected-error 2 {{variable can appear only once in OpenMP 'reduction' clause}} expected-note 2 {{previously referenced here}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(+ : r) // expected-error 2 {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel shared(i)
+#pragma omp parallel reduction(min : i)
+#pragma omp parallel master taskloop reduction(max : j) // expected-error 2 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel private(fl)
+#pragma omp parallel master taskloop reduction(+ : fl) allocate(omp_thread_mem_alloc: fl) // expected-warning 2 {{allocator with the 'thread' trait access has unspecified behavior on 'parallel master taskloop' directive}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel reduction(* : fl)
+#pragma omp parallel master taskloop reduction(+ : fl)
+ for (int i = 0; i < 10; ++i)
+ foo();
+
+ return T();
+}
+
+namespace A {
+double x;
+#pragma omp threadprivate(x) // expected-note {{defined as threadprivate or thread local}}
+}
+namespace B {
+using A::x;
+}
+
+int main(int argc, char **argv) {
+ const int d = 5; // expected-note 2 {{'d' defined here}}
+ const int da[5] = {0}; // expected-note {{'da' defined here}}
+ int qa[5] = {0};
+ S4 e(4);
+ S5 g(5);
+ int i, z;
+ int &j = i; // expected-note 2 {{'j' defined here}}
+ S3 &p = k; // expected-note 2 {{'p' defined here}}
+ const int &r = da[i]; // expected-note {{'r' defined here}}
+ int &q = qa[i]; // expected-note {{'q' defined here}}
+ float fl;
+#pragma omp parallel master taskloop reduction // expected-error {{expected '(' after 'reduction'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction + // expected-error {{expected '(' after 'reduction'}} expected-warning {{extra tokens at the end of '#pragma omp parallel master taskloop' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction( // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(- // expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction() // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(*) // expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected expression}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(\) // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(foo : argc // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(| : argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(|| : argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name, array element or array section}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(~ : argc) // expected-error {{expected unqualified-id}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(&& : argc, z)
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(^ : S1) // expected-error {{'S1' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{const-qualified variable cannot be reduction}} expected-error {{'operator+' is a private member of 'S2'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 2 {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(max : h.b) // expected-error {{expected variable name, array element or array section}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(+ : ba) // expected-error {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(* : ca) // expected-error {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(- : da) // expected-error {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(^ : fl) // expected-error {{invalid operands to binary expression ('float' and 'float')}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(&& : S2::S2s) // expected-error {{shared variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{invalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(+ : o) // expected-error {{no viable overloaded '='}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop private(i), reduction(+ : j), reduction(+ : q) // expected-error 2 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel private(k)
+#pragma omp parallel master taskloop reduction(+ : p), reduction(+ : p) // expected-error 2 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(+ : p), reduction(+ : p) // expected-error {{variable can appear only once in OpenMP 'reduction' clause}} expected-note {{previously referenced here}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop reduction(+ : r) // expected-error {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel shared(i)
+#pragma omp parallel reduction(min : i)
+#pragma omp parallel master taskloop reduction(max : j) // expected-error {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel private(fl)
+#pragma omp parallel master taskloop reduction(+ : fl)
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel reduction(* : fl)
+#pragma omp parallel master taskloop reduction(+ : fl)
+ for (int i = 0; i < 10; ++i)
+ foo();
+ static int m;
+#pragma omp parallel master taskloop reduction(+ : m) // OK
+ for (int i = 0; i < 10; ++i)
+ m++;
+#pragma omp parallel master taskloop nogroup reduction(+ : m) // expected-error {{'reduction' clause cannot be used with 'nogroup' clause}}
+ for (int i = 0; i < 10; ++i)
+ m++;
+
+ return tmain(argc) + tmain(fl); // expected-note {{in instantiation of function template specialization 'tmain<int>' requested here}} expected-note {{in instantiation of function template specialization 'tmain<float>' requested here}}
+}
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_aligned_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_aligned_messages.cpp
new file mode 100644
index 0000000..b5b079f
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_aligned_messages.cpp
@@ -0,0 +1,205 @@
+// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp %s -Wuninitialized
+
+// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp-simd %s -Wuninitialized
+
+struct B {
+ static int ib[20]; // expected-note 0 {{'B::ib' declared here}}
+ static constexpr int bfoo() { return 8; }
+};
+namespace X {
+ B x; // expected-note {{'x' defined here}}
+};
+constexpr int bfoo() { return 4; }
+
+int **z;
+const int C1 = 1;
+const int C2 = 2;
+void test_aligned_colons(int *&rp)
+{
+ int *B = 0;
+ #pragma omp parallel master taskloop simd aligned(B:bfoo())
+ for (int i = 0; i < 10; ++i) ;
+ // expected-error@+1 {{unexpected ':' in nested name specifier; did you mean '::'}}
+ #pragma omp parallel master taskloop simd aligned(B::ib:B:bfoo())
+ for (int i = 0; i < 10; ++i) ;
+ #pragma omp parallel master taskloop simd aligned(B:B::bfoo())
+ for (int i = 0; i < 10; ++i) ;
+ // expected-error@+1 {{unexpected ':' in nested name specifier; did you mean '::'?}}
+ #pragma omp parallel master taskloop simd aligned(z:B:bfoo())
+ for (int i = 0; i < 10; ++i) ;
+ #pragma omp parallel master taskloop simd aligned(B:B::bfoo())
+ for (int i = 0; i < 10; ++i) ;
+ // expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'int **'}}
+ // expected-error@+1 {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'B'}}
+ #pragma omp parallel master taskloop simd aligned(X::x : ::z)
+ for (int i = 0; i < 10; ++i) ;
+ // expected-error@+1 {{integral constant expression must have integral or unscoped enumeration type, not 'B'}}
+ #pragma omp parallel master taskloop simd aligned(B,rp,::z: X::x)
+ for (int i = 0; i < 10; ++i) ;
+ #pragma omp parallel master taskloop simd aligned(::z)
+ for (int i = 0; i < 10; ++i) ;
+ // expected-error@+1 {{expected variable name}}
+ #pragma omp parallel master taskloop simd aligned(B::bfoo())
+ for (int i = 0; i < 10; ++i) ;
+ // expected-warning@+1 {{aligned clause will be ignored because the requested alignment is not a power of 2}}
+ #pragma omp parallel master taskloop simd aligned(B::ib,B:C1+C2)
+ for (int i = 0; i < 10; ++i) ;
+}
+
+// expected-note@+1 {{'num' defined here}}
+template<int L, class T, class N> T test_template(T* arr, N num) {
+ N i;
+ T sum = (T)0;
+ T ind2 = - num * L;
+ // Negative number is passed as L.
+ // expected-error@+1 {{argument to 'aligned' clause must be a strictly positive integer value}}
+ #pragma omp parallel master taskloop simd aligned(arr:L)
+ for (i = 0; i < num; ++i) {
+ T cur = arr[(int)ind2];
+ ind2 += L;
+ sum += cur;
+ }
+ // expected-error@+1 {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'int'}}
+ #pragma omp parallel master taskloop simd aligned(num:4)
+ for (i = 0; i < num; ++i);
+ return T();
+}
+
+template<int LEN> int test_warn() {
+ int *ind2 = 0;
+ // expected-error@+1 {{argument to 'aligned' clause must be a strictly positive integer value}}
+ #pragma omp parallel master taskloop simd aligned(ind2:LEN)
+ for (int i = 0; i < 100; i++) {
+ ind2 += LEN;
+ }
+ return 0;
+}
+
+struct S1; // expected-note 2 {{declared here}}
+extern S1 a; // expected-note {{'a' declared here}}
+class S2 {
+ mutable int a;
+public:
+ S2():a(0) { }
+};
+const S2 b; // expected-note 1 {{'b' defined here}}
+const S2 ba[5];
+class S3 {
+ int a;
+public:
+ S3():a(0) { }
+};
+const S3 ca[5];
+class S4 {
+ int a;
+ S4();
+public:
+ S4(int v):a(v) { }
+};
+class S5 {
+ int a;
+ S5():a(0) {}
+public:
+ S5(int v):a(v) { }
+};
+
+S3 h; // expected-note 2 {{'h' defined here}}
+#pragma omp threadprivate(h)
+
+template<class I, class C> int foomain(I argc, C **argv) {
+ I e(argc);
+ I g(argc);
+ int i; // expected-note {{'i' defined here}}
+ // expected-note@+1 {{declared here}}
+ int &j = i;
+ #pragma omp parallel master taskloop simd aligned // expected-error {{expected '(' after 'aligned'}}
+ for (I k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd aligned ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (I k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd aligned () // expected-error {{expected expression}}
+ for (I k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd aligned (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (I k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd aligned (argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (I k = 0; k < argc; ++k) ++k;
+// FIXME: Should argc really be a pointer?
+ #pragma omp parallel master taskloop simd aligned (*argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
+ for (I k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd aligned (argc : 5) // expected-warning {{aligned clause will be ignored because the requested alignment is not a power of 2}}
+ for (I k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd aligned (S1) // expected-error {{'S1' does not refer to a value}}
+ for (I k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd aligned (argv[1]) // expected-error {{expected variable name}}
+ for (I k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd aligned(e, g)
+ for (I k = 0; k < argc; ++k) ++k;
+ // expected-error@+1 {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'S3'}}
+ #pragma omp parallel master taskloop simd aligned(h)
+ for (I k = 0; k < argc; ++k) ++k;
+ // expected-error@+1 {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'int'}}
+ #pragma omp parallel master taskloop simd aligned(i)
+ for (I k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel
+ {
+ int *v = 0;
+ I i;
+ #pragma omp parallel master taskloop simd aligned(v:16)
+ for (I k = 0; k < argc; ++k) { i = k; v += 2; }
+ }
+ float *f;
+ #pragma omp parallel master taskloop simd aligned(f)
+ for (I k = 0; k < argc; ++k) ++k;
+ int v = 0;
+ // expected-note@+2 {{initializer of 'j' is not a constant expression}}
+ // expected-error@+1 {{expression is not an integral constant expression}}
+ #pragma omp parallel master taskloop simd aligned(f:j)
+ for (I k = 0; k < argc; ++k) { ++k; v += j; }
+ #pragma omp parallel master taskloop simd aligned(f)
+ for (I k = 0; k < argc; ++k) ++k;
+ return 0;
+}
+
+// expected-note@+1 2 {{'argc' defined here}}
+int main(int argc, char **argv) {
+ double darr[100];
+ // expected-note@+1 {{in instantiation of function template specialization 'test_template<-4, double, int>' requested here}}
+ test_template<-4>(darr, 4);
+ test_warn<4>(); // ok
+ // expected-note@+1 {{in instantiation of function template specialization 'test_warn<0>' requested here}}
+ test_warn<0>();
+
+ int i;
+ int &j = i;
+ #pragma omp parallel master taskloop simd aligned // expected-error {{expected '(' after 'aligned'}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd aligned ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd aligned () // expected-error {{expected expression}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd aligned (argv // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k) ++k;
+ // expected-error@+1 {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'int'}}
+ #pragma omp parallel master taskloop simd aligned (argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd aligned (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k) ++k;
+ // expected-error@+1 {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'int'}}
+ #pragma omp parallel master taskloop simd aligned (argc)
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd aligned (S1) // expected-error {{'S1' does not refer to a value}}
+ for (int k = 0; k < argc; ++k) ++k;
+ // expected-error@+2 {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'S1'}}
+ // expected-error@+1 {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'S2'}}
+#pragma omp parallel master taskloop simd aligned(a, b)
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd aligned (argv[1]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k) ++k;
+ // expected-error@+1 {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'S3'}}
+ #pragma omp parallel master taskloop simd aligned(h)
+ for (int k = 0; k < argc; ++k) ++k;
+ int *pargc = &argc;
+ // expected-note@+1 {{in instantiation of function template specialization 'foomain<int *, char>' requested here}}
+ foomain<int*,char>(pargc,argv);
+ return 0;
+}
+
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_ast_print.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_ast_print.cpp
new file mode 100644
index 0000000..d8d36a2f
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_ast_print.cpp
@@ -0,0 +1,94 @@
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ast-print %s | FileCheck %s --check-prefix CHECK --check-prefix OMP45
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s --check-prefix CHECK --check-prefix OMP45
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -ast-print %s -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix OMP50
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -emit-pch -o %t %s -DOMP5
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix OMP50
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ast-print %s | FileCheck %s --check-prefix CHECK --check-prefix OMP45
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s --check-prefix CHECK --check-prefix OMP45
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -ast-print %s -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix OMP50
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -emit-pch -o %t %s -DOMP5
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix OMP50
+// expected-no-diagnostics
+
+#ifndef HEADER
+#define HEADER
+
+void foo() {}
+
+template <class T, int N>
+T tmain(T argc) {
+ T b = argc, c, d, e, f, g;
+ static T a;
+// CHECK: static T a;
+#pragma omp taskgroup allocate(d) task_reduction(+: d)
+#pragma omp parallel master taskloop simd if(taskloop: argc > N) default(shared) untied priority(N) grainsize(N) reduction(+:g) allocate(g) simdlen(8)
+ // CHECK-NEXT: #pragma omp taskgroup allocate(d) task_reduction(+: d)
+ // CHECK-NEXT: #pragma omp parallel master taskloop simd if(taskloop: argc > N) default(shared) untied priority(N) grainsize(N) reduction(+: g) allocate(g) simdlen(8){{$}}
+ for (int i = 0; i < 2; ++i)
+ a = 2;
+// CHECK-NEXT: for (int i = 0; i < 2; ++i)
+// CHECK-NEXT: a = 2;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd private(argc, b), firstprivate(c, d), lastprivate(d, f) collapse(N) shared(g) if (c) final(d) mergeable priority(f) nogroup num_tasks(N) safelen(8)
+ for (int i = 0; i < 2; ++i)
+ for (int j = 0; j < 2; ++j)
+ for (int j = 0; j < 2; ++j)
+ for (int j = 0; j < 2; ++j)
+ for (int j = 0; j < 2; ++j)
+ for (int i = 0; i < 2; ++i)
+ for (int j = 0; j < 2; ++j)
+ for (int j = 0; j < 2; ++j)
+ for (int j = 0; j < 2; ++j)
+ for (int j = 0; j < 2; ++j)
+ foo();
+ // CHECK-NEXT: #pragma omp parallel
+ // CHECK-NEXT: #pragma omp parallel master taskloop simd private(argc,b) firstprivate(c,d) lastprivate(d,f) collapse(N) shared(g) if(c) final(d) mergeable priority(f) nogroup num_tasks(N) safelen(8)
+ // CHECK-NEXT: for (int i = 0; i < 2; ++i)
+ // CHECK-NEXT: for (int j = 0; j < 2; ++j)
+ // CHECK-NEXT: for (int j = 0; j < 2; ++j)
+ // CHECK-NEXT: for (int j = 0; j < 2; ++j)
+ // CHECK-NEXT: for (int j = 0; j < 2; ++j)
+ // CHECK-NEXT: for (int i = 0; i < 2; ++i)
+ // CHECK-NEXT: for (int j = 0; j < 2; ++j)
+ // CHECK-NEXT: for (int j = 0; j < 2; ++j)
+ // CHECK-NEXT: for (int j = 0; j < 2; ++j)
+ // CHECK-NEXT: for (int j = 0; j < 2; ++j)
+ // CHECK-NEXT: foo();
+ return T();
+}
+
+// CHECK-LABEL: int main(int argc, char **argv) {
+int main(int argc, char **argv) {
+ int b = argc, c, d, e, f, g, h;
+ static int a;
+// CHECK: static int a;
+#pragma omp taskgroup task_reduction(+: d)
+#pragma omp parallel master taskloop simd if(parallel: a) default(none) shared(a, b, argc) final(b) priority(5) num_tasks(argc) reduction(*: g) aligned(argv: 8) linear(c:b)
+ // CHECK-NEXT: #pragma omp taskgroup task_reduction(+: d)
+ // CHECK-NEXT: #pragma omp parallel master taskloop simd if(parallel: a) default(none) shared(a,b,argc) final(b) priority(5) num_tasks(argc) reduction(*: g) aligned(argv: 8) linear(c: b)
+ for (int i = 0; i < 2; ++i)
+ a = 2;
+// CHECK-NEXT: for (int i = 0; i < 2; ++i)
+// CHECK-NEXT: a = 2;
+#pragma omp parallel
+#ifdef OMP5
+#pragma omp parallel master taskloop simd private(argc, b), firstprivate(argv, c), lastprivate(d, f) collapse(2) shared(g) if(simd:argc) mergeable priority(argc) grainsize(argc) reduction(max: a, e) nontemporal(argc, c, d)
+#else
+#pragma omp parallel master taskloop simd private(argc, b), firstprivate(argv, c), lastprivate(d, f) collapse(2) shared(g) if(argc) mergeable priority(argc) grainsize(argc) reduction(max: a, e)
+#endif // OMP5
+ for (int i = 0; i < 10; ++i)
+ for (int j = 0; j < 10; ++j)
+ foo();
+ // CHECK-NEXT: #pragma omp parallel
+ // OMP45-NEXT: #pragma omp parallel master taskloop simd private(argc,b) firstprivate(argv,c) lastprivate(d,f) collapse(2) shared(g) if(argc) mergeable priority(argc) grainsize(argc) reduction(max: a,e)
+ // OMP50-NEXT: #pragma omp parallel master taskloop simd private(argc,b) firstprivate(argv,c) lastprivate(d,f) collapse(2) shared(g) if(simd: argc) mergeable priority(argc) grainsize(argc) reduction(max: a,e) nontemporal(argc,c,d)
+ // CHECK-NEXT: for (int i = 0; i < 10; ++i)
+ // CHECK-NEXT: for (int j = 0; j < 10; ++j)
+ // CHECK-NEXT: foo();
+ return (tmain<int, 5>(argc) + tmain<char, 1>(argv[0][0]));
+}
+
+#endif
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_codegen.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_codegen.cpp
new file mode 100644
index 0000000..e28be54
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_codegen.cpp
@@ -0,0 +1,262 @@
+// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp -fopenmp-version=45 -x c++ -emit-llvm %s -o - -femit-all-decls | FileCheck %s --check-prefix CHECK --check-prefix OMP45
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -triple x86_64-apple-darwin10 -include-pch %t -verify %s -emit-llvm -o - -femit-all-decls | FileCheck %s --check-prefix CHECK --check-prefix OMP45
+// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp -fopenmp-version=50 -x c++ -emit-llvm %s -o - | FileCheck %s --check-prefix CHECK --check-prefix OMP50
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -triple x86_64-apple-darwin10 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CHECK --check-prefix OMP50
+
+// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp-simd -fopenmp-version=45 -x c++ -emit-llvm %s -o - -femit-all-decls | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -triple x86_64-apple-darwin10 -include-pch %t -verify %s -emit-llvm -o - -femit-all-decls | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp-simd -fopenmp-version=50 -x c++ -emit-llvm %s -o - -femit-all-decls | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -x c++ -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -x c++ -triple x86_64-apple-darwin10 -include-pch %t -verify %s -emit-llvm -o - -femit-all-decls | FileCheck --check-prefix SIMD-ONLY0 %s
+// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
+// expected-no-diagnostics
+#ifndef HEADER
+#define HEADER
+
+// CHECK-LABEL: @main
+int main(int argc, char **argv) {
+// CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* [[DEFLOC:@.+]])
+// CHECK: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* [[DEFLOC]], i32 1, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i64)* [[OMP_OUTLINED1:@.+]] to void (i32*, i32*, ...)*), i64 [[PRIORITY:%.+]])
+// CHECK: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* [[DEFLOC]], i32 1, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i64)* [[OMP_OUTLINED2:@.+]] to void (i32*, i32*, ...)*), i64 [[GRAINSIZE:%.+]])
+// CHECK: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* [[DEFLOC]], i32 5, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32*, i32*, i8***, i64, i64)* [[OMP_OUTLINED3:@.+]] to void (i32*, i32*, ...)*), i32* [[I:%.+]], i32* [[ARGC:%.+]], i8*** [[ARGV:%.+]], i64 [[COND:%.+]], i64 [[NUM_TASKS:%.+]])
+// CHECK: call void @__kmpc_serialized_parallel(%struct.ident_t* [[DEFLOC]], i32 [[GTID]])
+// CHECK: call void [[OMP_OUTLINED3]](i32* %{{.+}}, i32* %{{.+}}, i32* [[I]], i32* [[ARGC]], i8*** [[ARGV]], i64 [[COND]], i64 [[NUM_TASKS]])
+// CHECK: call void @__kmpc_end_serialized_parallel(%struct.ident_t* [[DEFLOC]], i32 [[GTID]])
+
+
+// CHECK: define internal void [[OMP_OUTLINED1]](i32* noalias %{{.+}}, i32* noalias %{{.+}}, i64 %{{.+}})
+// CHECK: [[PRIO_ADDR:%.+]] = bitcast i64* %{{.+}} to i32*
+// CHECK: [[RES:%.+]] = call {{.*}}i32 @__kmpc_master(%struct.ident_t* [[DEFLOC]], i32 [[GTID:%.+]])
+// CHECK-NEXT: [[IS_MASTER:%.+]] = icmp ne i32 [[RES]], 0
+// CHECK-NEXT: br i1 [[IS_MASTER]], label {{%?}}[[THEN:.+]], label {{%?}}[[EXIT:.+]]
+// CHECK: [[THEN]]
+// CHECK: call void @__kmpc_taskgroup(%struct.ident_t* [[DEFLOC]], i32 [[GTID]])
+// CHECK: [[PRIO:%.+]] = load i32, i32* [[PRIO_ADDR]],
+// CHECK: [[TASKV:%.+]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* [[DEFLOC]], i32 [[GTID]], i32 33, i64 80, i64 1, i32 (i32, i8*)* bitcast (i32 (i32, [[TDP_TY:%.+]]*)* [[TASK1:@.+]] to i32 (i32, i8*)*))
+// CHECK: [[TASK:%.+]] = bitcast i8* [[TASKV]] to [[TDP_TY]]*
+// CHECK: [[TASK_DATA:%.+]] = getelementptr inbounds [[TDP_TY]], [[TDP_TY]]* [[TASK]], i32 0, i32 0
+// CHECK: [[PRIO_ADDR:%.+]] = getelementptr inbounds [[TD_TY:%.+]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 4
+// CHECK: [[PRIO_ADDR_CAST:%.+]] = bitcast %{{.+}}* [[PRIO_ADDR]] to i32*
+// CHECK: store i32 [[PRIO]], i32* [[PRIO_ADDR_CAST]],
+// CHECK: [[DOWN:%.+]] = getelementptr inbounds [[TD_TY:%.+]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 5
+// CHECK: store i64 0, i64* [[DOWN]],
+// CHECK: [[UP:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 6
+// CHECK: store i64 9, i64* [[UP]],
+// CHECK: [[ST:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 7
+// CHECK: store i64 1, i64* [[ST]],
+// CHECK: [[ST_VAL:%.+]] = load i64, i64* [[ST]],
+// CHECK: call void @__kmpc_taskloop(%struct.ident_t* [[DEFLOC]], i32 [[GTID]], i8* [[TASKV]], i32 1, i64* [[DOWN]], i64* [[UP]], i64 [[ST_VAL]], i32 1, i32 0, i64 0, i8* null)
+// CHECK: call void @__kmpc_end_taskgroup(%struct.ident_t* [[DEFLOC]], i32 [[GTID]])
+// CHECK-NEXT: call {{.*}}void @__kmpc_end_master(%struct.ident_t* [[DEFLOC]], i32 [[GTID]])
+// CHECK-NEXT: br label {{%?}}[[EXIT]]
+// CHECK: [[EXIT]]
+
+
+// CHECK: define internal i32 [[TASK1]](
+// CHECK: [[DOWN:%.+]] = getelementptr inbounds [[TD_TY:%.+]], [[TD_TY]]* %{{.+}}, i32 0, i32 5
+// CHECK: [[DOWN_VAL:%.+]] = load i64, i64* [[DOWN]],
+// CHECK: [[UP:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 6
+// CHECK: [[UP_VAL:%.+]] = load i64, i64* [[UP]],
+// CHECK: [[ST:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 7
+// CHECK: [[ST_VAL:%.+]] = load i64, i64* [[ST]],
+// CHECK: [[LITER:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 8
+// CHECK: [[LITER_VAL:%.+]] = load i32, i32* [[LITER]],
+// CHECK: store i64 [[DOWN_VAL]], i64* [[LB:%[^,]+]],
+// CHECK: store i64 [[UP_VAL]], i64* [[UB:%[^,]+]],
+// CHECK: store i64 [[ST_VAL]], i64* [[ST:%[^,]+]],
+// CHECK: store i32 [[LITER_VAL]], i32* [[LITER:%[^,]+]],
+// CHECK: [[LB_VAL:%.+]] = load i64, i64* [[LB]],
+// CHECK: [[LB_I32:%.+]] = trunc i64 [[LB_VAL]] to i32
+// CHECK: store i32 [[LB_I32]], i32* [[CNT:%.+]],
+// CHECK: br label
+// CHECK: [[VAL:%.+]] = load i32, i32* [[CNT]],
+// CHECK: [[VAL_I64:%.+]] = sext i32 [[VAL]] to i64
+// CHECK: [[UB_VAL:%.+]] = load i64, i64* [[UB]],
+// CHECK: [[CMP:%.+]] = icmp ule i64 [[VAL_I64]], [[UB_VAL]]
+// CHECK: br i1 [[CMP]], label %{{.+}}, label %{{.+}}
+// CHECK: load i32, i32* %
+// CHECK: store i32 %
+// CHECK: load i32, i32* %
+// CHECK: add nsw i32 %{{.+}}, 1
+// CHECK: store i32 %{{.+}}, i32* %
+// CHECK: br label %
+// CHECK: ret i32 0
+
+#pragma omp parallel master taskloop simd priority(argc) safelen(8)
+ for (int i = 0; i < 10; ++i)
+ ;
+// CHECK: define internal void [[OMP_OUTLINED2]](i32* noalias %{{.+}}, i32* noalias %{{.+}}, i64 %{{.+}})
+// CHECK: [[RES:%.+]] = call {{.*}}i32 @__kmpc_master(%struct.ident_t* [[DEFLOC]], i32 [[GTID:%.+]])
+// CHECK-NEXT: [[IS_MASTER:%.+]] = icmp ne i32 [[RES]], 0
+// CHECK-NEXT: br i1 [[IS_MASTER]], label {{%?}}[[THEN:.+]], label {{%?}}[[EXIT:.+]]
+// CHECK: [[THEN]]
+// CHECK: [[TASKV:%.+]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* [[DEFLOC]], i32 [[GTID]], i32 1, i64 80, i64 1, i32 (i32, i8*)* bitcast (i32 (i32, [[TDP_TY:%.+]]*)* [[TASK2:@.+]] to i32 (i32, i8*)*))
+// CHECK: [[TASK:%.+]] = bitcast i8* [[TASKV]] to [[TDP_TY]]*
+// CHECK: [[TASK_DATA:%.+]] = getelementptr inbounds [[TDP_TY]], [[TDP_TY]]* [[TASK]], i32 0, i32 0
+// CHECK: [[DOWN:%.+]] = getelementptr inbounds [[TD_TY:%.+]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 5
+// CHECK: store i64 0, i64* [[DOWN]],
+// CHECK: [[UP:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 6
+// CHECK: store i64 9, i64* [[UP]],
+// CHECK: [[ST:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 7
+// CHECK: store i64 1, i64* [[ST]],
+// CHECK: [[ST_VAL:%.+]] = load i64, i64* [[ST]],
+// CHECK: [[GRAINSIZE:%.+]] = zext i32 %{{.+}} to i64
+// CHECK: call void @__kmpc_taskloop(%struct.ident_t* [[DEFLOC]], i32 [[GTID]], i8* [[TASKV]], i32 1, i64* [[DOWN]], i64* [[UP]], i64 [[ST_VAL]], i32 1, i32 1, i64 [[GRAINSIZE]], i8* null)
+// CHECK-NEXT: call {{.*}}void @__kmpc_end_master(%struct.ident_t* [[DEFLOC]], i32 [[GTID]])
+// CHECK-NEXT: br label {{%?}}[[EXIT]]
+// CHECK: [[EXIT]]
+
+
+// CHECK: define internal i32 [[TASK2]](
+// CHECK: [[DOWN:%.+]] = getelementptr inbounds [[TD_TY:%.+]], [[TD_TY]]* %{{.+}}, i32 0, i32 5
+// CHECK: [[DOWN_VAL:%.+]] = load i64, i64* [[DOWN]],
+// CHECK: [[UP:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 6
+// CHECK: [[UP_VAL:%.+]] = load i64, i64* [[UP]],
+// CHECK: [[ST:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 7
+// CHECK: [[ST_VAL:%.+]] = load i64, i64* [[ST]],
+// CHECK: [[LITER:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 8
+// CHECK: [[LITER_VAL:%.+]] = load i32, i32* [[LITER]],
+// CHECK: store i64 [[DOWN_VAL]], i64* [[LB:%[^,]+]],
+// CHECK: store i64 [[UP_VAL]], i64* [[UB:%[^,]+]],
+// CHECK: store i64 [[ST_VAL]], i64* [[ST:%[^,]+]],
+// CHECK: store i32 [[LITER_VAL]], i32* [[LITER:%[^,]+]],
+// CHECK: [[LB_VAL:%.+]] = load i64, i64* [[LB]],
+// CHECK: [[LB_I32:%.+]] = trunc i64 [[LB_VAL]] to i32
+// CHECK: store i32 [[LB_I32]], i32* [[CNT:%.+]],
+// CHECK: br label
+// CHECK: [[VAL:%.+]] = load i32, i32* [[CNT]],{{.*}}!llvm.access.group
+// CHECK: [[VAL_I64:%.+]] = sext i32 [[VAL]] to i64
+// CHECK: [[UB_VAL:%.+]] = load i64, i64* [[UB]],{{.*}}!llvm.access.group
+// CHECK: [[CMP:%.+]] = icmp ule i64 [[VAL_I64]], [[UB_VAL]]
+// CHECK: br i1 [[CMP]], label %{{.+}}, label %{{.+}}
+// CHECK: load i32, i32* %{{.*}}!llvm.access.group
+// CHECK: store i32 %{{.*}}!llvm.access.group
+// CHECK: load i32, i32* %
+// CHECK: add nsw i32 %{{.+}}, 1
+// CHECK: store i32 %{{.+}}, i32* %
+// CHECK: br label %
+// CHECK: ret i32 0
+
+#pragma omp parallel master taskloop simd nogroup grainsize(argc) simdlen(16)
+ for (int i = 0; i < 10; ++i)
+ ;
+// CHECK: define internal void [[OMP_OUTLINED3]](i32* noalias %{{.+}}, i32* noalias %{{.+}}, i32* dereferenceable(4) %{{.+}}, i8*** dereferenceable(8) %{{.+}}, i64 %{{.+}}, i64 %{{.+}})
+// CHECK: [[RES:%.+]] = call {{.*}}i32 @__kmpc_master(%struct.ident_t* [[DEFLOC]], i32 [[GTID:%.+]])
+// CHECK-NEXT: [[IS_MASTER:%.+]] = icmp ne i32 [[RES]], 0
+// CHECK-NEXT: br i1 [[IS_MASTER]], label {{%?}}[[THEN:.+]], label {{%?}}[[EXIT:.+]]
+// CHECK: [[THEN]]
+// CHECK: call void @__kmpc_taskgroup(%struct.ident_t* [[DEFLOC]], i32 [[GTID]])
+// OMP45: [[TASKV:%.+]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* [[DEFLOC]], i32 [[GTID]], i32 1, i64 88, i64 24, i32 (i32, i8*)* bitcast (i32 (i32, [[TDP_TY:%.+]]*)* [[TASK3:@.+]] to i32 (i32, i8*)*))
+// OMP50: [[TASKV:%.+]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* [[DEFLOC]], i32 [[GTID]], i32 1, i64 88, i64 32, i32 (i32, i8*)* bitcast (i32 (i32, [[TDP_TY:%.+]]*)* [[TASK3:@.+]] to i32 (i32, i8*)*))
+// CHECK: [[TASK:%.+]] = bitcast i8* [[TASKV]] to [[TDP_TY]]*
+// CHECK: [[TASK_DATA:%.+]] = getelementptr inbounds [[TDP_TY]], [[TDP_TY]]* [[TASK]], i32 0, i32 0
+// CHECK: [[COND_VAL:%.+]] = load i8, i8* %{{.+}},
+// CHECK: [[COND_BOOL:%.+]] = trunc i8 [[COND_VAL]] to i1
+// CHECK: [[IF_INT:%.+]] = sext i1 [[COND_BOOL]] to i32
+// CHECK: [[DOWN:%.+]] = getelementptr inbounds [[TD_TY:%.+]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 5
+// CHECK: store i64 0, i64* [[DOWN]],
+// CHECK: [[UP:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 6
+// CHECK: store i64 %{{.+}}, i64* [[UP]],
+// CHECK: [[ST:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 7
+// CHECK: store i64 1, i64* [[ST]],
+// CHECK: [[ST_VAL:%.+]] = load i64, i64* [[ST]],
+// CHECK: [[NUM_TASKS:%.+]] = zext i32 %{{.+}} to i64
+// CHECK: call void @__kmpc_taskloop(%struct.ident_t* [[DEFLOC]], i32 [[GTID]], i8* [[TASKV]], i32 [[IF_INT]], i64* [[DOWN]], i64* [[UP]], i64 [[ST_VAL]], i32 1, i32 2, i64 [[NUM_TASKS]], i8* bitcast (void ([[TDP_TY]]*, [[TDP_TY]]*, i32)* [[TASK_DUP:@.+]] to i8*))
+// CHECK: call void @__kmpc_end_taskgroup(%struct.ident_t* [[DEFLOC]], i32 [[GTID]])
+// CHECK-NEXT: call {{.*}}void @__kmpc_end_master(%struct.ident_t* [[DEFLOC]], i32 [[GTID]])
+// CHECK-NEXT: br label {{%?}}[[EXIT]]
+// CHECK: [[EXIT]]
+
+// CHECK: define internal i32 [[TASK3]](
+// CHECK: [[DOWN:%.+]] = getelementptr inbounds [[TD_TY:%.+]], [[TD_TY]]* %{{.+}}, i32 0, i32 5
+// CHECK: [[DOWN_VAL:%.+]] = load i64, i64* [[DOWN]],
+// CHECK: [[UP:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 6
+// CHECK: [[UP_VAL:%.+]] = load i64, i64* [[UP]],
+// CHECK: [[ST:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 7
+// CHECK: [[ST_VAL:%.+]] = load i64, i64* [[ST]],
+// CHECK: [[LITER:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 8
+// CHECK: [[LITER_VAL:%.+]] = load i32, i32* [[LITER]],
+// CHECK: store i64 [[DOWN_VAL]], i64* [[LB:%[^,]+]],
+// CHECK: store i64 [[UP_VAL]], i64* [[UB:%[^,]+]],
+// CHECK: store i64 [[ST_VAL]], i64* [[ST:%[^,]+]],
+// CHECK: store i32 [[LITER_VAL]], i32* [[LITER:%[^,]+]],
+// CHECK: [[LB_VAL:%.+]] = load i64, i64* [[LB]],
+// CHECK: store i64 [[LB_VAL]], i64* [[CNT:%.+]],
+// CHECK: br label
+// CHECK: ret i32 0
+
+ int i;
+#pragma omp parallel master taskloop simd if(argc) shared(argc, argv) collapse(2) num_tasks(argc) lastprivate(i) aligned(argv:8)
+ for (i = 0; i < argc; ++i)
+ for (int j = argc; j < argv[argc][argc]; ++j)
+ ;
+}
+
+// CHECK-LABEL: @_ZN1SC2Ei
+struct S {
+ int a;
+ S(int c) {
+// CHECK: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* [[DEFLOC]], i32 3, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, %struct.S*, i32*, i64)* [[OMP_OUTLINED4:@.+]] to void (i32*, i32*, ...)*), %struct.S* %{{.+}}, i32* %{{.+}}, i64 %{{.+}})
+
+// CHECK: define internal void [[OMP_OUTLINED4]](i32* noalias %{{.+}}, i32* noalias %{{.+}}, %struct.S* %{{.+}}, i32* dereferenceable(4) %{{.+}}, i64 %{{.+}})
+// CHECK: [[CONV:%.+]] = bitcast i64* %{{.+}} to i8*
+// CHECK: [[CONDI8:%.+]] = load i8, i8* [[CONV]],
+// CHECK: [[COND:%.+]] = trunc i8 [[CONDI8]] to i1
+// CHECK: [[IS_FINAL:%.+]] = select i1 [[COND:%.+]], i32 2, i32 0
+// CHECK: [[FLAGS:%.+]] = or i32 [[IS_FINAL]], 1
+// CHECK: [[TASKV:%.+]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* [[DEFLOC]], i32 [[GTID:%.+]], i32 [[FLAGS]], i64 80, i64 16, i32 (i32, i8*)* bitcast (i32 (i32, [[TDP_TY:%.+]]*)* [[TASK4:@.+]] to i32 (i32, i8*)*))
+// CHECK: [[TASK:%.+]] = bitcast i8* [[TASKV]] to [[TDP_TY]]*
+// CHECK: [[TASK_DATA:%.+]] = getelementptr inbounds [[TDP_TY]], [[TDP_TY]]* [[TASK]], i32 0, i32 0
+// CHECK: [[DOWN:%.+]] = getelementptr inbounds [[TD_TY:%.+]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 5
+// CHECK: store i64 0, i64* [[DOWN]],
+// CHECK: [[UP:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 6
+// CHECK: store i64 %{{.+}}, i64* [[UP]],
+// CHECK: [[ST:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 7
+// CHECK: store i64 1, i64* [[ST]],
+// CHECK: [[ST_VAL:%.+]] = load i64, i64* [[ST]],
+// CHECK: call void @__kmpc_taskloop(%struct.ident_t* [[DEFLOC]], i32 [[GTID]], i8* [[TASKV]], i32 1, i64* [[DOWN]], i64* [[UP]], i64 [[ST_VAL]], i32 1, i32 2, i64 4, i8* null)
+#pragma omp parallel master taskloop simd shared(c) num_tasks(4) final(c)
+ for (a = 0; a < c; ++a)
+ ;
+ }
+} s(1);
+
+// CHECK: define internal i32 [[TASK4]](
+// CHECK: [[DOWN:%.+]] = getelementptr inbounds [[TD_TY:%.+]], [[TD_TY]]* %{{.+}}, i32 0, i32 5
+// CHECK: [[DOWN_VAL:%.+]] = load i64, i64* [[DOWN]],
+// CHECK: [[UP:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 6
+// CHECK: [[UP_VAL:%.+]] = load i64, i64* [[UP]],
+// CHECK: [[ST:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 7
+// CHECK: [[ST_VAL:%.+]] = load i64, i64* [[ST]],
+// CHECK: [[LITER:%.+]] = getelementptr inbounds [[TD_TY]], [[TD_TY]]* %{{.+}}, i32 0, i32 8
+// CHECK: [[LITER_VAL:%.+]] = load i32, i32* [[LITER]],
+// CHECK: store i64 [[DOWN_VAL]], i64* [[LB:%[^,]+]],
+// CHECK: store i64 [[UP_VAL]], i64* [[UB:%[^,]+]],
+// CHECK: store i64 [[ST_VAL]], i64* [[ST:%[^,]+]],
+// CHECK: store i32 [[LITER_VAL]], i32* [[LITER:%[^,]+]],
+// CHECK: [[LB_VAL:%.+]] = load i64, i64* [[LB]],
+// CHECK: [[LB_I32:%.+]] = trunc i64 [[LB_VAL]] to i32
+// CHECK: store i32 [[LB_I32]], i32* [[CNT:%.+]],
+// CHECK: br label
+// CHECK: [[VAL:%.+]] = load i32, i32* [[CNT]],
+// CHECK: [[VAL_I64:%.+]] = sext i32 [[VAL]] to i64
+// CHECK: [[UB_VAL:%.+]] = load i64, i64* [[UB]],
+// CHECK: [[CMP:%.+]] = icmp ule i64 [[VAL_I64]], [[UB_VAL]]
+// CHECK: br i1 [[CMP]], label %{{.+}}, label %{{.+}}
+// CHECK: load i32, i32* %{{.*}}!llvm.access.group
+// CHECK: store i32 %{{.*}}!llvm.access.group
+// CHECK: load i32, i32* %
+// CHECK: add nsw i32 %{{.+}}, 1
+// CHECK: store i32 %{{.+}}, i32* %
+// CHECK: br label %
+// CHECK: ret i32 0
+
+// OMP45-NOT: !{!"llvm.loop.vectorize.enable", i1 false}
+// CHECK-DAG: !{!"llvm.loop.vectorize.enable", i1 true}
+// OMP50-DAG: !{!"llvm.loop.vectorize.enable", i1 false}
+// OMP45-NOT: !{!"llvm.loop.vectorize.enable", i1 false}
+
+#endif
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_collapse_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_collapse_messages.cpp
new file mode 100644
index 0000000..667c39a
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_collapse_messages.cpp
@@ -0,0 +1,110 @@
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
+
+void foo() {
+}
+
+#if __cplusplus >= 201103L
+// expected-note@+2 4 {{declared here}}
+#endif
+bool foobool(int argc) {
+ return argc;
+}
+
+struct S1; // expected-note {{declared here}}
+
+template <class T, typename S, int N, int ST> // expected-note {{declared here}}
+T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
+ #pragma omp parallel master taskloop simd collapse // expected-error {{expected '(' after 'collapse'}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp parallel master taskloop simd collapse ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp parallel master taskloop simd collapse () // expected-error {{expected expression}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ // expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
+ // expected-error@+2 2 {{expression is not an integral constant expression}}
+ // expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
+ #pragma omp parallel master taskloop simd collapse (argc
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ // expected-error@+1 2 {{argument to 'collapse' clause must be a strictly positive integer value}}
+ #pragma omp parallel master taskloop simd collapse (ST // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp parallel master taskloop simd collapse (1)) // expected-warning {{extra tokens at the end of '#pragma omp parallel master taskloop simd' are ignored}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp parallel master taskloop simd collapse ((ST > 0) ? 1 + ST : 2) // expected-note 2 {{as specified in 'collapse' clause}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp parallel master taskloop simd', but found only 1}}
+ // expected-error@+6 2 {{directive '#pragma omp parallel master taskloop simd' cannot contain more than one 'collapse' clause}}
+ // expected-error@+5 {{argument to 'collapse' clause must be a strictly positive integer value}}
+ // expected-error@+4 2 {{expression is not an integral constant expression}}
+#if __cplusplus >= 201103L
+ // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
+#endif
+ #pragma omp parallel master taskloop simd collapse (foobool(argc)), collapse (true), collapse (-5)
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp parallel master taskloop simd collapse (S) // expected-error {{'S' does not refer to a value}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+#if __cplusplus <= 199711L
+ // expected-error@+4 2 {{expression is not an integral constant expression}}
+#else
+ // expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
+#endif
+ #pragma omp parallel master taskloop simd collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp parallel master taskloop simd collapse (1)
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp parallel master taskloop simd collapse (N) // expected-error {{argument to 'collapse' clause must be a strictly positive integer value}}
+ for (T i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp parallel master taskloop simd collapse (2) // expected-note {{as specified in 'collapse' clause}}
+ foo(); // expected-error {{expected 2 for loops after '#pragma omp parallel master taskloop simd'}}
+ return argc;
+}
+
+int main(int argc, char **argv) {
+ #pragma omp parallel master taskloop simd collapse // expected-error {{expected '(' after 'collapse'}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ #pragma omp parallel master taskloop simd collapse ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ #pragma omp parallel master taskloop simd collapse () // expected-error {{expected expression}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ #pragma omp parallel master taskloop simd collapse (4 // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-note {{as specified in 'collapse' clause}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp parallel master taskloop simd', but found only 1}}
+ #pragma omp parallel master taskloop simd collapse (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp parallel master taskloop simd' are ignored}} expected-note {{as specified in 'collapse' clause}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp parallel master taskloop simd', but found only 1}}
+ // expected-error@+4 {{expression is not an integral constant expression}}
+#if __cplusplus >= 201103L
+ // expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
+#endif
+ #pragma omp parallel master taskloop simd collapse (foobool(1) > 0 ? 1 : 2)
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ // expected-error@+6 {{expression is not an integral constant expression}}
+#if __cplusplus >= 201103L
+ // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
+#endif
+ // expected-error@+2 2 {{directive '#pragma omp parallel master taskloop simd' cannot contain more than one 'collapse' clause}}
+ // expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}}
+ #pragma omp parallel master taskloop simd collapse (foobool(argc)), collapse (true), collapse (-5)
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ #pragma omp parallel master taskloop simd collapse (S1) // expected-error {{'S1' does not refer to a value}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+#if __cplusplus <= 199711L
+ // expected-error@+4 {{expression is not an integral constant expression}}
+#else
+ // expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
+#endif
+ #pragma omp parallel master taskloop simd collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ // expected-error@+3 {{statement after '#pragma omp parallel master taskloop simd' must be a for loop}}
+ // expected-note@+1 {{in instantiation of function template specialization 'tmain<int, char, -1, -2>' requested here}}
+ #pragma omp parallel master taskloop simd collapse(collapse(tmain<int, char, -1, -2>(argc, argv) // expected-error 2 {{expected ')'}} expected-note 2 {{to match this '('}}
+ foo();
+ #pragma omp parallel master taskloop simd collapse (2) // expected-note {{as specified in 'collapse' clause}}
+ foo(); // expected-error {{expected 2 for loops after '#pragma omp parallel master taskloop simd'}}
+ // expected-note@+1 {{in instantiation of function template specialization 'tmain<int, char, 1, 0>' requested here}}
+ return tmain<int, char, 1, 0>(argc, argv);
+}
+
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_final_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_final_messages.cpp
new file mode 100644
index 0000000..10b7478
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_final_messages.cpp
@@ -0,0 +1,94 @@
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+struct S1; // expected-note {{declared here}}
+
+template <class T, class S> // expected-note {{declared here}}
+int tmain(T argc, S **argv) {
+ T z;
+#pragma omp parallel master taskloop simd final // expected-error {{expected '(' after 'final'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd final( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd final() // expected-error {{expected expression}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd final(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd final(argc)) // expected-warning {{extra tokens at the end of '#pragma omp parallel master taskloop simd' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd final(argc > 0 ? argv[1] : argv[2] + z)
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd final(foobool(argc)), final(true) // expected-error {{directive '#pragma omp parallel master taskloop simd' cannot contain more than one 'final' clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd final(S) // expected-error {{'S' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd final(argv[1] = 2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd final(argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd final(argc)
+ for (int i = 0; i < 10; ++i)
+ foo();
+
+ return 0;
+}
+
+int main(int argc, char **argv) {
+ int z;
+#pragma omp parallel master taskloop simd final // expected-error {{expected '(' after 'final'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd final( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd final() // expected-error {{expected expression}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd final(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd final(argc)) // expected-warning {{extra tokens at the end of '#pragma omp parallel master taskloop simd' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd final(argc > 0 ? argv[1] : argv[2] - z)
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd final(foobool(argc)), final(true) // expected-error {{directive '#pragma omp parallel master taskloop simd' cannot contain more than one 'final' clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd final(S1) // expected-error {{'S1' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd final(argv[1] = 2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd final(argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd final(1 0) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd final(if (tmain(argc, argv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+
+ return tmain(argc, argv);
+}
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_firstprivate_codegen.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_firstprivate_codegen.cpp
new file mode 100644
index 0000000..80897ff
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_firstprivate_codegen.cpp
@@ -0,0 +1,515 @@
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-apple-darwin10 -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=LAMBDA %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=BLOCKS %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DARRAY -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=ARRAY %s
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DARRAY -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
+// expected-no-diagnostics
+
+#ifndef ARRAY
+#ifndef HEADER
+#define HEADER
+
+template <class T>
+struct S {
+ T f;
+ S(T a) : f(a) {}
+ S() : f() {}
+ S(const S &s, T t = T()) : f(s.f + t) {}
+ operator T() { return T(); }
+ ~S() {}
+};
+
+volatile double g;
+
+// CHECK-DAG: [[KMP_TASK_T_TY:%.+]] = type { i8*, i32 (i32, i8*)*, i32, %union{{.+}}, %union{{.+}}, i64, i64, i64, i32, i8* }
+// CHECK-DAG: [[S_DOUBLE_TY:%.+]] = type { double }
+// CHECK-DAG: [[PRIVATES_MAIN_TY:%.+]] = type {{.?}}{ [2 x [[S_DOUBLE_TY]]], [[S_DOUBLE_TY]], i32, [2 x i32]
+// CHECK-DAG: [[CAP_MAIN_TY:%.+]] = type {{.*}}{ [2 x i32]*, i32, {{.*}}[2 x [[S_DOUBLE_TY]]]*, [[S_DOUBLE_TY]]*, i{{[0-9]+}}
+// CHECK-DAG: [[KMP_TASK_MAIN_TY:%.+]] = type { [[KMP_TASK_T_TY]], [[PRIVATES_MAIN_TY]] }
+// CHECK-DAG: [[S_INT_TY:%.+]] = type { i32 }
+// CHECK-DAG: [[CAP_TMAIN_TY:%.+]] = type { [2 x i32]*, i32*, [2 x [[S_INT_TY]]]*, [[S_INT_TY]]* }
+// CHECK-DAG: [[PRIVATES_TMAIN_TY:%.+]] = type { i32, [2 x i32], [2 x [[S_INT_TY]]], [[S_INT_TY]], [104 x i8] }
+// CHECK-DAG: [[KMP_TASK_TMAIN_TY:%.+]] = type { [[KMP_TASK_T_TY]], [{{[0-9]+}} x i8], [[PRIVATES_TMAIN_TY]] }
+template <typename T>
+T tmain() {
+ S<T> ttt;
+ S<T> test(ttt);
+ T t_var __attribute__((aligned(128))) = T();
+ T vec[] = {1, 2};
+ S<T> s_arr[] = {1, 2};
+ S<T> var(3);
+#pragma omp parallel master taskloop simd firstprivate(t_var, vec, s_arr, s_arr, var, var)
+ for (int i = 0; i < 10; ++i) {
+ vec[0] = t_var;
+ s_arr[0] = var;
+ }
+ return T();
+}
+
+int main() {
+ static int sivar;
+#ifdef LAMBDA
+ // LAMBDA: [[G:@.+]] = global double
+ // LAMBDA: [[SIVAR:@.+]] = internal global i{{[0-9]+}} 0,
+ // LAMBDA-LABEL: @main
+ // LAMBDA: call{{( x86_thiscallcc)?}} void [[OUTER_LAMBDA:@.+]](
+ [&]() {
+ // LAMBDA: define{{.*}} internal{{.*}} void [[OUTER_LAMBDA]](
+// LAMBDA: [[RES:%.+]] = call {{.*}}i32 @__kmpc_master(
+// LAMBDA-NEXT: [[IS_MASTER:%.+]] = icmp ne i32 [[RES]], 0
+// LAMBDA-NEXT: br i1 [[IS_MASTER]], label {{%?}}[[THEN:.+]], label {{%?}}[[EXIT:.+]]
+// LAMBDA: [[THEN]]
+// LAMBDA: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc(%{{[^ ]+}} @{{[^,]+}}, i32 %{{[^,]+}}, i32 1, i64 96, i64 16, i32 (i32, i8*)* bitcast (i32 (i32, %{{[^*]+}}*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+// LAMBDA: [[PRIVATES:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i{{.+}} 0, i{{.+}} 1
+// LAMBDA: [[G_PRIVATE_ADDR:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[PRIVATES]], i{{.+}} 0, i{{.+}} 0
+// LAMBDA: [[G_ADDR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i{{.+}} 0, i{{.+}} 0
+// LAMBDA: [[G_VAL:%.+]] = load volatile double, double* [[G_ADDR_REF]]
+// LAMBDA: store volatile double [[G_VAL]], double* [[G_PRIVATE_ADDR]]
+
+// LAMBDA: [[SIVAR_PRIVATE_ADDR:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
+// LAMBDA: [[SIVAR_ADDR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i{{.+}} 0, i{{.+}} 1
+// LAMBDA: [[SIVAR_VAL:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[SIVAR_ADDR_REF]]
+// LAMBDA: store i{{[0-9]+}} [[SIVAR_VAL]], i{{[0-9]+}}* [[SIVAR_PRIVATE_ADDR]]
+
+// LAMBDA: call void @__kmpc_taskloop(%{{.+}}* @{{.+}}, i32 %{{.+}}, i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* null)
+// LAMBDA: call {{.*}}void @__kmpc_end_master(
+// LAMBDA-NEXT: br label {{%?}}[[EXIT]]
+// LAMBDA: [[EXIT]]
+// LAMBDA: ret
+#pragma omp parallel master taskloop simd firstprivate(g, sivar)
+ for (int i = 0; i < 10; ++i) {
+ // LAMBDA: define {{.+}} void [[INNER_LAMBDA:@.+]](%{{.+}}* [[ARG_PTR:%.+]])
+ // LAMBDA: store %{{.+}}* [[ARG_PTR]], %{{.+}}** [[ARG_PTR_REF:%.+]],
+ // LAMBDA: [[ARG_PTR:%.+]] = load %{{.+}}*, %{{.+}}** [[ARG_PTR_REF]]
+ // LAMBDA: [[G_PTR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[ARG_PTR]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+ // LAMBDA: [[G_REF:%.+]] = load double*, double** [[G_PTR_REF]]
+ // LAMBDA: store double 2.0{{.+}}, double* [[G_REF]]
+
+ // LAMBDA: store double* %{{.+}}, double** %{{.+}},
+ // LAMBDA: define internal i32 [[TASK_ENTRY]](i32 %0, %{{.+}}* noalias %1)
+ g = 1;
+ sivar = 11;
+ // LAMBDA: store double 1.0{{.+}}, double* %{{.+}},
+ // LAMBDA: store i{{[0-9]+}} 11, i{{[0-9]+}}* %{{.+}},
+ // LAMBDA: call void [[INNER_LAMBDA]](%
+ // LAMBDA: ret
+ [&]() {
+ g = 2;
+ sivar = 22;
+ }();
+ }
+ }();
+ return 0;
+#elif defined(BLOCKS)
+ // BLOCKS: [[G:@.+]] = global double
+ // BLOCKS-LABEL: @main
+ // BLOCKS: call void {{%.+}}(i8
+ ^{
+ // BLOCKS: define{{.*}} internal{{.*}} void {{.+}}(i8*
+ // BLOCKS: [[RES:%.+]] = call {{.*}}i32 @__kmpc_master(
+ // BLOCKS-NEXT: [[IS_MASTER:%.+]] = icmp ne i32 [[RES]], 0
+ // BLOCKS-NEXT: br i1 [[IS_MASTER]], label {{%?}}[[THEN:.+]], label {{%?}}[[EXIT:.+]]
+ // BLOCKS: [[THEN]]
+ // BLOCKS: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc(%{{[^ ]+}} @{{[^,]+}}, i32 %{{[^,]+}}, i32 1, i64 96, i64 16, i32 (i32, i8*)* bitcast (i32 (i32, %{{[^*]+}}*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+ // BLOCKS: [[PRIVATES:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i{{.+}} 0, i{{.+}} 1
+ // BLOCKS: [[G_PRIVATE_ADDR:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[PRIVATES]], i{{.+}} 0, i{{.+}} 0
+ // BLOCKS: [[G_ADDR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i{{.+}} 0, i{{.+}} 0
+ // BLOCKS: [[G_VAL:%.+]] = load volatile double, double* [[G_ADDR_REF]]
+ // BLOCKS: store volatile double [[G_VAL]], double* [[G_PRIVATE_ADDR]]
+
+ // BLOCKS: [[SIVAR_PRIVATE_ADDR:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
+ // BLOCKS: [[SIVAR_ADDR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i{{.+}} 0, i{{.+}} 1
+ // BLOCKS: [[SIVAR_VAL:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[SIVAR_ADDR_REF]]
+ // BLOCKS: store i{{[0-9]+}} [[SIVAR_VAL]], i{{[0-9]+}}* [[SIVAR_PRIVATE_ADDR]]
+ // BLOCKS: call void @__kmpc_taskloop(%{{.+}}* @{{.+}}, i32 %{{.+}}, i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* null)
+ // BLOCKS: call {{.*}}void @__kmpc_end_master(
+ // BLOCKS-NEXT: br label {{%?}}[[EXIT]]
+ // BLOCKS: [[EXIT]]
+ // BLOCKS: ret
+#pragma omp parallel master taskloop simd firstprivate(g, sivar)
+ for (int i = 0; i < 10; ++i) {
+ // BLOCKS: define {{.+}} void {{@.+}}(i8*
+ // BLOCKS-NOT: [[G]]{{[[^:word:]]}}
+ // BLOCKS: store double 2.0{{.+}}, double*
+ // BLOCKS-NOT: [[G]]{{[[^:word:]]}}
+ // BLOCKS-NOT: [[ISVAR]]{{[[^:word:]]}}
+ // BLOCKS: store i{{[0-9]+}} 22, i{{[0-9]+}}*
+ // BLOCKS-NOT: [[SIVAR]]{{[[^:word:]]}}
+ // BLOCKS: ret
+
+ // BLOCKS: store double* %{{.+}}, double** %{{.+}},
+ // BLOCKS: store i{{[0-9]+}}* %{{.+}}, i{{[0-9]+}}** %{{.+}},
+ // BLOCKS: define internal i32 [[TASK_ENTRY]](i32 %0, %{{.+}}* noalias %1)
+ g = 1;
+ sivar = 11;
+ // BLOCKS: store double 1.0{{.+}}, double* %{{.+}},
+ // BLOCKS-NOT: [[G]]{{[[^:word:]]}}
+ // BLOCKS: store i{{[0-9]+}} 11, i{{[0-9]+}}* %{{.+}},
+ // BLOCKS-NOT: [[SIVAR]]{{[[^:word:]]}}
+ // BLOCKS: call void {{%.+}}(i8
+ ^{
+ g = 2;
+ sivar = 22;
+ }();
+ }
+ }();
+ return 0;
+#else
+ S<double> ttt;
+ S<double> test(ttt);
+ int t_var = 0;
+ int vec[] = {1, 2};
+ S<double> s_arr[] = {1, 2};
+ S<double> var(3);
+#pragma omp parallel master taskloop simd firstprivate(var, t_var, s_arr, vec, s_arr, var, sivar)
+ for (int i = 0; i < 10; ++i) {
+ vec[0] = t_var;
+ s_arr[0] = var;
+ sivar = 33;
+ }
+ return tmain<int>();
+#endif
+}
+
+// CHECK: [[SIVAR:.+]] = internal global i{{[0-9]+}} 0,
+// CHECK: define i{{[0-9]+}} @main()
+// CHECK: alloca [[S_DOUBLE_TY]],
+// CHECK: [[TEST:%.+]] = alloca [[S_DOUBLE_TY]],
+// CHECK: [[T_VAR_ADDR:%.+]] = alloca i32,
+// CHECK: [[VEC_ADDR:%.+]] = alloca [2 x i32],
+// CHECK: [[S_ARR_ADDR:%.+]] = alloca [2 x [[S_DOUBLE_TY]]],
+// CHECK: [[VAR_ADDR:%.+]] = alloca [[S_DOUBLE_TY]],
+
+// CHECK: call {{.*}} [[S_DOUBLE_TY_COPY_CONSTR:@.+]]([[S_DOUBLE_TY]]* [[TEST]],
+
+// CHECK: [[RES:%.+]] = call {{.*}}i32 @__kmpc_master(
+// CHECK-NEXT: [[IS_MASTER:%.+]] = icmp ne i32 [[RES]], 0
+// CHECK-NEXT: br i1 [[IS_MASTER]], label {{%?}}[[THEN:.+]], label {{%?}}[[EXIT:.+]]
+// CHECK: [[THEN]]
+// Store original variables in capture struct.
+// CHECK: [[VEC_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: store [2 x i32]* %{{.+}}, [2 x i32]** [[VEC_REF]],
+// CHECK: [[T_VAR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 1
+// CHECK: [[T_VAR_VAL:%.+]] = load i32, i32* %{{.+}},
+// CHECK: store i32 [[T_VAR_VAL]], i32* [[T_VAR_REF]],
+// CHECK: [[S_ARR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 3
+// CHECK: store [2 x [[S_DOUBLE_TY]]]* %{{.+}}, [2 x [[S_DOUBLE_TY]]]** [[S_ARR_REF]],
+// CHECK: [[VAR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 4
+// CHECK: store [[S_DOUBLE_TY]]* %{{.+}}, [[S_DOUBLE_TY]]** [[VAR_REF]],
+// CHECK: [[SIVAR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 5
+// CHECK: [[SIVAR_VAL:%.+]] = load i32, i32* %{{.+}},
+// CHECK: store i{{[0-9]+}} [[SIVAR_VAL]], i{{[0-9]+}}* [[SIVAR_REF]],
+
+// Allocate task.
+// Returns struct kmp_task_t {
+// [[KMP_TASK_T]] task_data;
+// [[KMP_TASK_MAIN_TY]] privates;
+// };
+// CHECK: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* @{{.+}}, i32 %{{.+}}, i32 9, i64 120, i64 40, i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_MAIN_TY]]*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+// CHECK: [[RES_KMP_TASK:%.+]] = bitcast i8* [[RES]] to [[KMP_TASK_MAIN_TY]]*
+
+// Fill kmp_task_t->shareds by copying from original capture argument.
+// CHECK: [[TASK:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: [[SHAREDS_REF_ADDR:%.+]] = getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* [[TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: [[SHAREDS_REF:%.+]] = load i8*, i8** [[SHAREDS_REF_ADDR]],
+// CHECK: [[CAPTURES_ADDR:%.+]] = bitcast [[CAP_MAIN_TY]]* %{{.+}} to i8*
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 [[SHAREDS_REF]], i8* align 8 [[CAPTURES_ADDR]], i64 40, i1 false)
+
+// Initialize kmp_task_t->privates with default values (no init for simple types, default constructors for classes).
+// Also copy address of private copy to the corresponding shareds reference.
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
+// CHECK: [[SHAREDS:%.+]] = bitcast i8* [[SHAREDS_REF]] to [[CAP_MAIN_TY]]*
+
+// Constructors for s_arr and var.
+// s_arr;
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: [[S_ARR_ADDR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* [[SHAREDS]], i{{.+}} 0, i{{.+}} 3
+// CHECK: load [2 x [[S_DOUBLE_TY]]]*, [2 x [[S_DOUBLE_TY]]]** [[S_ARR_ADDR_REF]],
+// CHECK: call void [[S_DOUBLE_TY_COPY_CONSTR]]([[S_DOUBLE_TY]]* [[S_ARR_CUR:%[^,]+]],
+// CHECK: getelementptr [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* [[S_ARR_CUR]], i{{.+}} 1
+// CHECK: getelementptr [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i{{.+}} 1
+// CHECK: icmp eq
+// CHECK: br i1
+
+// var;
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
+// CHECK: [[VAR_ADDR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* [[SHAREDS]], i{{.+}} 0, i{{.+}} 4
+// CHECK: [[VAR_REF:%.+]] = load [[S_DOUBLE_TY]]*, [[S_DOUBLE_TY]]** [[VAR_ADDR_REF]],
+// CHECK: call void [[S_DOUBLE_TY_COPY_CONSTR]]([[S_DOUBLE_TY]]* [[PRIVATE_VAR_REF]], [[S_DOUBLE_TY]]* {{.*}}[[VAR_REF]],
+
+// t_var;
+// CHECK: [[PRIVATE_T_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK: [[T_VAR_ADDR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* [[SHAREDS]], i{{.+}} 0, i{{.+}} 1
+// CHECK: [[T_VAR:%.+]] = load i{{.+}}, i{{.+}}* [[T_VAR_ADDR_REF]],
+// CHECK: store i32 [[T_VAR]], i32* [[PRIVATE_T_VAR_REF]],
+
+// vec;
+// CHECK: [[PRIVATE_VEC_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: [[VEC_ADDR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* [[SHAREDS]], i{{.+}} 0, i{{.+}} 0
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(
+
+// sivar;
+// CHECK: [[PRIVATE_SIVAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 4
+// CHECK: [[SIVAR_ADDR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* [[SHAREDS]], i{{.+}} 0, i{{.+}} 5
+// CHECK: [[SIVAR:%.+]] = load i{{.+}}, i{{.+}}* [[SIVAR_ADDR_REF]],
+// CHECK: store i32 [[SIVAR]], i32* [[PRIVATE_SIVAR_REF]],
+
+// Provide pointer to destructor function, which will destroy private variables at the end of the task.
+// CHECK: [[DESTRUCTORS_REF:%.+]] = getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* [[TASK]], i{{.+}} 0, i{{.+}} 3
+// CHECK: [[DESTRUCTORS_PTR:%.+]] = bitcast %union{{.+}}* [[DESTRUCTORS_REF]] to i32 (i32, i8*)**
+// CHECK: store i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_MAIN_TY]]*)* [[DESTRUCTORS:@.+]] to i32 (i32, i8*)*), i32 (i32, i8*)** [[DESTRUCTORS_PTR]],
+
+// Start task.
+// CHECK: call void @__kmpc_taskloop(%struct.ident_t* @{{.+}}, i32 %{{.+}}, i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* bitcast (void ([[KMP_TASK_MAIN_TY]]*, [[KMP_TASK_MAIN_TY]]*, i32)* [[MAIN_DUP:@.+]] to i8*))
+// CHECK: call {{.*}}void @__kmpc_end_master(
+// CHECK-NEXT: br label {{%?}}[[EXIT]]
+// CHECK: [[EXIT]]
+
+// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_MAIN_TY]]* noalias %0, [[S_DOUBLE_TY]]** noalias %1, i32** noalias %2, [2 x [[S_DOUBLE_TY]]]** noalias %3, [2 x i32]** noalias %4, i32** noalias %5)
+// CHECK: [[PRIVATES:%.+]] = load [[PRIVATES_MAIN_TY]]*, [[PRIVATES_MAIN_TY]]**
+// CHECK: [[PRIV_S_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 0
+// CHECK: [[ARG3:%.+]] = load [2 x [[S_DOUBLE_TY]]]**, [2 x [[S_DOUBLE_TY]]]*** %{{.+}},
+// CHECK: store [2 x [[S_DOUBLE_TY]]]* [[PRIV_S_VAR]], [2 x [[S_DOUBLE_TY]]]** [[ARG3]],
+// CHECK: [[PRIV_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 1
+// CHECK: [[ARG1:%.+]] = load [[S_DOUBLE_TY]]**, [[S_DOUBLE_TY]]*** {{.+}},
+// CHECK: store [[S_DOUBLE_TY]]* [[PRIV_VAR]], [[S_DOUBLE_TY]]** [[ARG1]],
+// CHECK: [[PRIV_T_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 2
+// CHECK: [[ARG2:%.+]] = load i32**, i32*** %{{.+}},
+// CHECK: store i32* [[PRIV_T_VAR]], i32** [[ARG2]],
+// CHECK: [[PRIV_VEC:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 3
+// CHECK: [[ARG4:%.+]] = load [2 x i32]**, [2 x i32]*** %{{.+}},
+// CHECK: store [2 x i32]* [[PRIV_VEC]], [2 x i32]** [[ARG4]],
+// CHECK: [[PRIV_SIVAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 4
+// CHECK: [[ARG5:%.+]] = load i{{[0-9]+}}**, i{{[0-9]+}}*** %{{.+}},
+// CHECK: store i{{[0-9]+}}* [[PRIV_SIVAR]], i{{[0-9]+}}** [[ARG5]],
+// CHECK: ret void
+
+// CHECK: define internal i32 [[TASK_ENTRY]](i32 %0, [[KMP_TASK_MAIN_TY]]* noalias %1)
+
+// CHECK: [[PRIV_VAR_ADDR:%.+]] = alloca [[S_DOUBLE_TY]]*,
+// CHECK: [[PRIV_T_VAR_ADDR:%.+]] = alloca i32*,
+// CHECK: [[PRIV_S_ARR_ADDR:%.+]] = alloca [2 x [[S_DOUBLE_TY]]]*,
+// CHECK: [[PRIV_VEC_ADDR:%.+]] = alloca [2 x i32]*,
+// CHECK: [[PRIV_SIVAR_ADDR:%.+]] = alloca i32*,
+// CHECK: store void (i8*, ...)* bitcast (void ([[PRIVATES_MAIN_TY]]*, [[S_DOUBLE_TY]]**, i32**, [2 x [[S_DOUBLE_TY]]]**, [2 x i32]**, i32**)* [[PRIVATES_MAP_FN]] to void (i8*, ...)*), void (i8*, ...)** [[MAP_FN_ADDR:%.+]],
+// CHECK: [[MAP_FN:%.+]] = load void (i8*, ...)*, void (i8*, ...)** [[MAP_FN_ADDR]],
+
+// CHECK: call void (i8*, ...) [[MAP_FN]](i8* %{{.+}}, [[S_DOUBLE_TY]]** [[PRIV_VAR_ADDR]], i32** [[PRIV_T_VAR_ADDR]], [2 x [[S_DOUBLE_TY]]]** [[PRIV_S_ARR_ADDR]], [2 x i32]** [[PRIV_VEC_ADDR]], i32** [[PRIV_SIVAR_ADDR]])
+
+// CHECK: [[PRIV_VAR:%.+]] = load [[S_DOUBLE_TY]]*, [[S_DOUBLE_TY]]** [[PRIV_VAR_ADDR]],
+// CHECK: [[PRIV_T_VAR:%.+]] = load i32*, i32** [[PRIV_T_VAR_ADDR]],
+// CHECK: [[PRIV_S_ARR:%.+]] = load [2 x [[S_DOUBLE_TY]]]*, [2 x [[S_DOUBLE_TY]]]** [[PRIV_S_ARR_ADDR]],
+// CHECK: [[PRIV_VEC:%.+]] = load [2 x i32]*, [2 x i32]** [[PRIV_VEC_ADDR]],
+// CHECK: [[PRIV_SIVAR:%.+]] = load i32*, i32** [[PRIV_SIVAR_ADDR]],
+
+// Privates actually are used.
+// CHECK-DAG: [[PRIV_VAR]]
+// CHECK-DAG: [[PRIV_T_VAR]]
+// CHECK-DAG: [[PRIV_S_ARR]]
+// CHECK-DAG: [[PRIV_VEC]]
+// CHECK-DAG: [[PRIV_SIVAR]]
+
+// CHECK: ret
+
+// CHECK: define internal void [[MAIN_DUP]]([[KMP_TASK_MAIN_TY]]* %0, [[KMP_TASK_MAIN_TY]]* %1, i32 %2)
+// CHECK: getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* %{{.+}}, i32 0, i32 1
+// CHECK: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr inbounds [2 x [[S_DOUBLE_TY]]], [2 x [[S_DOUBLE_TY]]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i64 2
+// CHECK: br i1 %
+
+// CHECK: phi [[S_DOUBLE_TY]]*
+// CHECK: call {{.*}} [[S_DOUBLE_TY_COPY_CONSTR]]([[S_DOUBLE_TY]]*
+// CHECK: getelementptr [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i32 1
+// CHECK: icmp eq [[S_DOUBLE_TY]]* %
+// CHECK: br i1 %
+
+// CHECK: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* %{{.+}}, i32 0, i32 1
+// CHECK: call {{.*}} [[S_DOUBLE_TY_COPY_CONSTR]]([[S_DOUBLE_TY]]*
+// CHECK: ret void
+
+// CHECK: define internal i32 [[DESTRUCTORS]](i32 %{{.+}}, [[KMP_TASK_MAIN_TY]]* noalias %{{.+}})
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 0
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
+// CHECK: call void @_ZN1SIdED1Ev([[S_DOUBLE_TY]]* [[PRIVATE_VAR_REF]])
+// CHECK: getelementptr inbounds [2 x [[S_DOUBLE_TY]]], [2 x [[S_DOUBLE_TY]]]* [[PRIVATE_S_ARR_REF]], i{{.+}} 0, i{{.+}} 0
+// CHECK: getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i{{.+}} 2
+// CHECK: [[PRIVATE_S_ARR_ELEM_REF:%.+]] = getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i{{.+}} -1
+// CHECK: call void @_ZN1SIdED1Ev([[S_DOUBLE_TY]]* [[PRIVATE_S_ARR_ELEM_REF]])
+// CHECK: icmp eq
+// CHECK: br i1
+// CHECK: ret i32
+
+// CHECK: alloca [[S_INT_TY]],
+// CHECK: [[TEST:%.+]] = alloca [[S_INT_TY]],
+// CHECK: [[T_VAR_ADDR:%.+]] = alloca i32, align 128
+// CHECK: [[VEC_ADDR:%.+]] = alloca [2 x i32],
+// CHECK: [[S_ARR_ADDR:%.+]] = alloca [2 x [[S_INT_TY]]],
+// CHECK: [[VAR_ADDR:%.+]] = alloca [[S_INT_TY]],
+
+// CHECK: call {{.*}} [[S_INT_TY_COPY_CONSTR:@.+]]([[S_INT_TY]]* [[TEST]],
+
+// Store original variables in capture struct.
+// CHECK: [[VEC_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: store [2 x i32]* %{{.+}}, [2 x i32]** [[VEC_REF]],
+// CHECK: [[T_VAR_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 1
+// CHECK: store i32* %{{.+}}, i32** [[T_VAR_REF]],
+// CHECK: [[S_ARR_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 2
+// CHECK: store [2 x [[S_INT_TY]]]* %{{.+}}, [2 x [[S_INT_TY]]]** [[S_ARR_REF]],
+// CHECK: [[VAR_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 3
+// CHECK: store [[S_INT_TY]]* %{{.+}}, [[S_INT_TY]]** [[VAR_REF]],
+
+// Allocate task.
+// Returns struct kmp_task_t {
+// [[KMP_TASK_T_TY]] task_data;
+// [[KMP_TASK_TMAIN_TY]] privates;
+// };
+// CHECK: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* @{{.+}}, i32 %{{.+}}, i32 9, i64 256, i64 32, i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_TMAIN_TY]]*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+// CHECK: [[RES_KMP_TASK:%.+]] = bitcast i8* [[RES]] to [[KMP_TASK_TMAIN_TY]]*
+
+// Fill kmp_task_t->shareds by copying from original capture argument.
+// CHECK: [[TASK:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: [[SHAREDS_REF_ADDR:%.+]] = getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* [[TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: [[SHAREDS_REF:%.+]] = load i8*, i8** [[SHAREDS_REF_ADDR]],
+// CHECK: [[CAPTURES_ADDR:%.+]] = bitcast [[CAP_TMAIN_TY]]* %{{.+}} to i8*
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 [[SHAREDS_REF]], i8* align 8 [[CAPTURES_ADDR]], i64 32, i1 false)
+
+// Initialize kmp_task_t->privates with default values (no init for simple types, default constructors for classes).
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
+// CHECK: [[SHAREDS:%.+]] = bitcast i8* [[SHAREDS_REF]] to [[CAP_TMAIN_TY]]*
+
+// t_var;
+// CHECK: [[PRIVATE_T_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 0
+// CHECK: [[T_VAR_ADDR_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* [[SHAREDS]], i{{.+}} 0, i{{.+}} 1
+// CHECK: [[T_VAR_REF:%.+]] = load i{{.+}}*, i{{.+}}** [[T_VAR_ADDR_REF]],
+// CHECK: [[T_VAR:%.+]] = load i{{.+}}, i{{.+}}* [[T_VAR_REF]], align 128
+// CHECK: store i32 [[T_VAR]], i32* [[PRIVATE_T_VAR_REF]], align 128
+
+// vec;
+// CHECK: [[PRIVATE_VEC_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
+// CHECK: [[VEC_ADDR_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* [[SHAREDS]], i{{.+}} 0, i{{.+}} 0
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(
+
+// Constructors for s_arr and var.
+// a_arr;
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
+// CHECK: [[S_ARR_ADDR_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* [[SHAREDS]], i{{.+}} 0, i{{.+}} 2
+// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* [[PRIVATE_S_ARR_REF]], i{{.+}} 0, i{{.+}} 0
+// CHECK: getelementptr [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i{{.+}} 2
+// CHECK: call void [[S_INT_TY_COPY_CONSTR]]([[S_INT_TY]]* [[S_ARR_CUR:%[^,]+]],
+// CHECK: getelementptr [[S_INT_TY]], [[S_INT_TY]]* [[S_ARR_CUR]], i{{.+}} 1
+// CHECK: icmp eq
+// CHECK: br i1
+
+// var;
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: [[VAR_ADDR_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* [[SHAREDS]], i{{.+}} 0, i{{.+}} 3
+// CHECK: call void [[S_INT_TY_COPY_CONSTR]]([[S_INT_TY]]* [[PRIVATE_VAR_REF]],
+
+// Provide pointer to destructor function, which will destroy private variables at the end of the task.
+// CHECK: [[DESTRUCTORS_REF:%.+]] = getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* [[TASK]], i{{.+}} 0, i{{.+}} 3
+// CHECK: [[DESTRUCTORS_PTR:%.+]] = bitcast %union{{.+}}* [[DESTRUCTORS_REF]] to i32 (i32, i8*)**
+// CHECK: store i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_TMAIN_TY]]*)* [[DESTRUCTORS:@.+]] to i32 (i32, i8*)*), i32 (i32, i8*)** [[DESTRUCTORS_PTR]],
+
+// Start task.
+// CHECK: call void @__kmpc_taskloop(%struct.ident_t* @{{.+}}, i32 %{{.+}}, i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* bitcast (void ([[KMP_TASK_TMAIN_TY]]*, [[KMP_TASK_TMAIN_TY]]*, i32)* [[TMAIN_DUP:@.+]] to i8*))
+
+// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_TMAIN_TY]]* noalias %{{.+}}, i32** noalias %{{.+}}, [2 x i32]** noalias %{{.+}}, [2 x [[S_INT_TY]]]** noalias %{{.+}}, [[S_INT_TY]]** noalias %{{.+}})
+// CHECK: [[PRIVATES:%.+]] = load [[PRIVATES_TMAIN_TY]]*, [[PRIVATES_TMAIN_TY]]**
+// CHECK: [[PRIV_T_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 0
+// CHECK: [[ARG1:%.+]] = load i32**, i32*** %{{.+}},
+// CHECK: store i32* [[PRIV_T_VAR]], i32** [[ARG1]],
+// CHECK: [[PRIV_VEC:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 1
+// CHECK: [[ARG2:%.+]] = load [2 x i32]**, [2 x i32]*** %{{.+}},
+// CHECK: store [2 x i32]* [[PRIV_VEC]], [2 x i32]** [[ARG2]],
+// CHECK: [[PRIV_S_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 2
+// CHECK: [[ARG3:%.+]] = load [2 x [[S_INT_TY]]]**, [2 x [[S_INT_TY]]]*** %{{.+}},
+// CHECK: store [2 x [[S_INT_TY]]]* [[PRIV_S_VAR]], [2 x [[S_INT_TY]]]** [[ARG3]],
+// CHECK: [[PRIV_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 3
+// CHECK: [[ARG4:%.+]] = load [[S_INT_TY]]**, [[S_INT_TY]]*** {{.+}},
+// CHECK: store [[S_INT_TY]]* [[PRIV_VAR]], [[S_INT_TY]]** [[ARG4]],
+// CHECK: ret void
+
+// CHECK: define internal i32 [[TASK_ENTRY]](i32 %0, [[KMP_TASK_TMAIN_TY]]* noalias %1)
+// CHECK: alloca i32*,
+// CHECK-DAG: [[PRIV_T_VAR_ADDR:%.+]] = alloca i32*,
+// CHECK-DAG: [[PRIV_VEC_ADDR:%.+]] = alloca [2 x i32]*,
+// CHECK-DAG: [[PRIV_S_ARR_ADDR:%.+]] = alloca [2 x [[S_INT_TY]]]*,
+// CHECK-DAG: [[PRIV_VAR_ADDR:%.+]] = alloca [[S_INT_TY]]*,
+// CHECK: store void (i8*, ...)* bitcast (void ([[PRIVATES_TMAIN_TY]]*, i32**, [2 x i32]**, [2 x [[S_INT_TY]]]**, [[S_INT_TY]]**)* [[PRIVATES_MAP_FN]] to void (i8*, ...)*), void (i8*, ...)** [[MAP_FN_ADDR:%.+]],
+// CHECK: [[MAP_FN:%.+]] = load void (i8*, ...)*, void (i8*, ...)** [[MAP_FN_ADDR]],
+// CHECK: call void (i8*, ...) [[MAP_FN]](i8* %{{.+}}, i32** [[PRIV_T_VAR_ADDR]], [2 x i32]** [[PRIV_VEC_ADDR]], [2 x [[S_INT_TY]]]** [[PRIV_S_ARR_ADDR]], [[S_INT_TY]]** [[PRIV_VAR_ADDR]])
+// CHECK: [[PRIV_T_VAR:%.+]] = load i32*, i32** [[PRIV_T_VAR_ADDR]],
+// CHECK: [[PRIV_VEC:%.+]] = load [2 x i32]*, [2 x i32]** [[PRIV_VEC_ADDR]],
+// CHECK: [[PRIV_S_ARR:%.+]] = load [2 x [[S_INT_TY]]]*, [2 x [[S_INT_TY]]]** [[PRIV_S_ARR_ADDR]],
+// CHECK: [[PRIV_VAR:%.+]] = load [[S_INT_TY]]*, [[S_INT_TY]]** [[PRIV_VAR_ADDR]],
+
+// Privates actually are used.
+// CHECK-DAG: [[PRIV_VAR]]
+// CHECK-DAG: [[PRIV_T_VAR]]
+// CHECK-DAG: [[PRIV_S_ARR]]
+// CHECK-DAG: [[PRIV_VEC]]
+
+// CHECK: ret
+
+// CHECK: define internal void [[TMAIN_DUP]]([[KMP_TASK_TMAIN_TY]]* %0, [[KMP_TASK_TMAIN_TY]]* %1, i32 %2)
+// CHECK: getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* %{{.+}}, i32 0, i32 2
+// CHECK: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* %{{.+}}, i32 0, i32 2
+// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i64 2
+// CHECK: br i1 %
+
+// CHECK: phi [[S_INT_TY]]*
+// CHECK: call {{.*}} [[S_INT_TY_COPY_CONSTR]]([[S_INT_TY]]*
+// CHECK: getelementptr [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i32 1
+// CHECK: icmp eq [[S_INT_TY]]* %
+// CHECK: br i1 %
+
+// CHECK: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* %{{.+}}, i32 0, i32 3
+// CHECK: call {{.*}} [[S_INT_TY_COPY_CONSTR]]([[S_INT_TY]]*
+// CHECK: ret void
+
+// CHECK: define internal i32 [[DESTRUCTORS]](i32 %0, [[KMP_TASK_TMAIN_TY]]* noalias %1)
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: call void @_ZN1SIiED1Ev([[S_INT_TY]]* [[PRIVATE_VAR_REF]])
+// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* [[PRIVATE_S_ARR_REF]], i{{.+}} 0, i{{.+}} 0
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i{{.+}} 2
+// CHECK: [[PRIVATE_S_ARR_ELEM_REF:%.+]] = getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i{{.+}} -1
+// CHECK: call void @_ZN1SIiED1Ev([[S_INT_TY]]* [[PRIVATE_S_ARR_ELEM_REF]])
+// CHECK: icmp eq
+// CHECK: br i1
+// CHECK: ret i32
+
+#endif
+#else
+// ARRAY-LABEL: array_func
+struct St {
+ int a, b;
+ St() : a(0), b(0) {}
+ St(const St &) {}
+ ~St() {}
+};
+
+void array_func(int n, float a[n], St s[2]) {
+// ARRAY: call i8* @__kmpc_omp_task_alloc(
+// ARRAY: call void @__kmpc_taskloop(
+// ARRAY: store float** %{{.+}}, float*** %{{.+}},
+// ARRAY: store %struct.St** %{{.+}}, %struct.St*** %{{.+}},
+#pragma omp parallel master taskloop simd firstprivate(a, s)
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+#endif
+
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_firstprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_firstprivate_messages.cpp
new file mode 100644
index 0000000..aa411e2
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_firstprivate_messages.cpp
@@ -0,0 +1,335 @@
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+
+typedef void **omp_allocator_handle_t;
+extern const omp_allocator_handle_t omp_default_mem_alloc;
+extern const omp_allocator_handle_t omp_large_cap_mem_alloc;
+extern const omp_allocator_handle_t omp_const_mem_alloc;
+extern const omp_allocator_handle_t omp_high_bw_mem_alloc;
+extern const omp_allocator_handle_t omp_low_lat_mem_alloc;
+extern const omp_allocator_handle_t omp_cgroup_mem_alloc;
+extern const omp_allocator_handle_t omp_pteam_mem_alloc;
+extern const omp_allocator_handle_t omp_thread_mem_alloc;
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp parallel master taskloop simd firstprivate(fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
+struct S1; // expected-note 2 {{declared here}} expected-note 2 {{forward declaration of 'S1'}}
+extern S1 a;
+class S2 {
+ mutable int a;
+
+public:
+ S2() : a(0) {}
+ S2(const 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;
+ S3 &operator=(const S3 &s3);
+
+public:
+ S3() : a(0) {} // expected-note 2 {{candidate constructor not viable: requires 0 arguments, but 1 was provided}}
+ S3(S3 &s3) : a(s3.a) {} // expected-note 2 {{candidate constructor not viable: 1st argument ('const S3') would lose const qualifier}}
+};
+const S3 c;
+const S3 ca[5];
+extern const int f;
+class S4 {
+ int a;
+ S4();
+ S4(const S4 &s4); // expected-note 2 {{implicitly declared private here}}
+
+public:
+ S4(int v) : a(v) {}
+};
+class S5 {
+ int a;
+ S5(const S5 &s5) : a(s5.a) {} // expected-note 4 {{implicitly declared private here}}
+
+public:
+ S5() : a(0) {}
+ S5(int v) : a(v) {}
+};
+class S6 {
+ int a;
+ S6() : a(0) {}
+
+public:
+ S6(const S6 &s6) : a(s6.a) {}
+ S6(int v) : a(v) {}
+};
+
+S3 h;
+#pragma omp threadprivate(h) // expected-note 2 {{defined as threadprivate or thread local}}
+
+template <class I, class C>
+int foomain(int argc, char **argv) {
+ I e(4);
+ C g(5);
+ int i, z;
+ int &j = i;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd firstprivate // expected-error {{expected '(' after 'firstprivate'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd firstprivate( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd firstprivate() // expected-error {{expected expression}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd firstprivate(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd firstprivate(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd firstprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd allocate(omp_thread_mem_alloc: argc) firstprivate(argc) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'parallel master taskloop simd' directive}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd firstprivate(S1) // expected-error {{'S1' does not refer to a value}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd firstprivate(a, b) // expected-error {{firstprivate variable with incomplete type 'S1'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd firstprivate(argv[1]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd firstprivate(z, e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd firstprivate(h) // expected-error {{threadprivate or thread local variable cannot be firstprivate}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+ {
+ int v = 0;
+ int i;
+#pragma omp parallel master taskloop simd firstprivate(i)
+ for (int k = 0; k < argc; ++k) {
+ i = k;
+ v += i;
+ }
+ }
+#pragma omp parallel shared(i)
+#pragma omp parallel private(i)
+#pragma omp parallel master taskloop simd firstprivate(j)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd firstprivate(i)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate(g) firstprivate(g) // expected-error {{calling a private constructor of class 'S5'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel private(i)
+#pragma omp parallel master taskloop simd firstprivate(i) // expected-note 2 {{defined as firstprivate}}
+ for (i = 0; i < argc; ++i) // expected-error 2 {{loop iteration variable in the associated loop of 'omp parallel master taskloop simd' directive may not be firstprivate, predetermined as linear}}
+ foo();
+#pragma omp parallel reduction(+ : i) // expected-note {{defined as reduction}}
+#pragma omp parallel master taskloop simd firstprivate(i) // expected-note {{defined as firstprivate}} expected-error {{argument of a reduction clause of a parallel construct must not appear in a firstprivate clause on a task construct}}
+ for (i = 0; i < argc; ++i) // expected-error {{loop iteration variable in the associated loop of 'omp parallel master taskloop simd' directive may not be firstprivate, predetermined as linear}}
+ foo();
+ return 0;
+}
+
+void bar(S4 a[2]) {
+#pragma omp parallel
+#pragma omp parallel master taskloop simd firstprivate(a)
+ for (int i = 0; i < 2; ++i)
+ foo();
+}
+
+namespace A {
+double x;
+#pragma omp threadprivate(x) // expected-note {{defined as threadprivate or thread local}}
+}
+namespace B {
+using A::x;
+}
+
+int main(int argc, char **argv) {
+ const int d = 5;
+ const int da[5] = {0};
+ S4 e(4);
+ S5 g(5);
+ S3 m;
+ S6 n(2);
+ int i;
+ int &j = i;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd firstprivate // expected-error {{expected '(' after 'firstprivate'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd firstprivate( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd firstprivate() // expected-error {{expected expression}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd firstprivate(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd firstprivate(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd firstprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd firstprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd firstprivate(S1) // expected-error {{'S1' does not refer to a value}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd firstprivate(a, b, c, d, f) // expected-error {{firstprivate variable with incomplete type 'S1'}} expected-error {{no matching constructor for initialization of 'S3'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd firstprivate(argv[1]) // expected-error {{expected variable name}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd firstprivate(2 * 2) // expected-error {{expected variable name}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd firstprivate(ba) // OK
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd firstprivate(ca) // expected-error {{no matching constructor for initialization of 'S3'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd firstprivate(da) // OK
+ for (i = 0; i < argc; ++i)
+ foo();
+ int xa;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd firstprivate(xa) // OK
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd firstprivate(S2::S2s) // OK
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd firstprivate(S2::S2sc) // OK
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd safelen(5)
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd firstprivate(e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd firstprivate(m) // OK
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd firstprivate(h) // expected-error {{threadprivate or thread local variable cannot be firstprivate}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd private(xa), firstprivate(xa) // expected-error {{private variable cannot be firstprivate}} expected-note {{defined as private}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd firstprivate(i) // expected-note {{defined as firstprivate}}
+ for (i = 0; i < argc; ++i) // expected-error {{loop iteration variable in the associated loop of 'omp parallel master taskloop simd' directive may not be firstprivate, predetermined as linear}}
+ foo();
+#pragma omp parallel shared(xa)
+#pragma omp parallel master taskloop simd firstprivate(xa) // OK: may be firstprivate
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd firstprivate(j)
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate(g) firstprivate(g) // expected-error {{calling a private constructor of class 'S5'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate(n) firstprivate(n) // OK
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+ {
+ int v = 0;
+ int i;
+#pragma omp parallel master taskloop simd firstprivate(i)
+ for (int k = 0; k < argc; ++k) {
+ i = k;
+ v += i;
+ }
+ }
+#pragma omp parallel private(i)
+#pragma omp parallel master taskloop simd firstprivate(i) // expected-note {{defined as firstprivate}}
+ for (i = 0; i < argc; ++i) // expected-error {{loop iteration variable in the associated loop of 'omp parallel master taskloop simd' directive may not be firstprivate, predetermined as linear}}
+ foo();
+#pragma omp parallel reduction(+ : i) // expected-note {{defined as reduction}}
+#pragma omp parallel master taskloop simd firstprivate(i) //expected-error {{argument of a reduction clause of a parallel construct must not appear in a firstprivate clause on a task construct}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel master taskloop simd firstprivate(i) //expected-note {{defined as firstprivate}}
+ for (i = 0; i < argc; ++i) // expected-error {{loop iteration variable in the associated loop of 'omp parallel master taskloop simd' directive may not be firstprivate, predetermined as linear}}
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd firstprivate(B::x) // expected-error {{threadprivate or thread local variable cannot be firstprivate}}
+ for (i = 0; i < argc; ++i)
+ foo();
+ static int si;
+#pragma omp parallel master taskloop simd firstprivate(si) // OK
+ for (i = 0; i < argc; ++i)
+ si = i + 1;
+
+ return foomain<S4, S5>(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<S4, S5>' requested here}}
+}
+
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_grainsize_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_grainsize_messages.cpp
new file mode 100644
index 0000000..318d5b7
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_grainsize_messages.cpp
@@ -0,0 +1,103 @@
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+struct S1; // expected-note {{declared here}}
+
+template <class T, class S> // expected-note {{declared here}}
+int tmain(T argc, S **argv) {
+ T z;
+ #pragma omp parallel master taskloop simd grainsize // expected-error {{expected '(' after 'grainsize'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd grainsize ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd grainsize () // expected-error {{expected expression}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd grainsize (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd grainsize (argc)) // expected-warning {{extra tokens at the end of '#pragma omp parallel master taskloop simd' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd grainsize (argc > 0 ? argv[1][0] : argv[2][argc] + z)
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd grainsize (foobool(argc)), grainsize (true) // expected-error {{directive '#pragma omp parallel master taskloop simd' cannot contain more than one 'grainsize' clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd grainsize (S) // expected-error {{'S' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd grainsize (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd grainsize(0) // expected-error {{argument to 'grainsize' clause must be a strictly positive integer value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd grainsize(-1) // expected-error {{argument to 'grainsize' clause must be a strictly positive integer value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd grainsize(argc) num_tasks(argc) // expected-error {{'num_tasks' and 'grainsize' clause are mutually exclusive and may not appear on the same directive}} expected-note {{'grainsize' clause is specified here}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+
+ return 0;
+}
+
+int main(int argc, char **argv) {
+ int z;
+ #pragma omp parallel master taskloop simd grainsize // expected-error {{expected '(' after 'grainsize'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd grainsize ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd grainsize () // expected-error {{expected expression}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd grainsize (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd grainsize (argc)) // expected-warning {{extra tokens at the end of '#pragma omp parallel master taskloop simd' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd grainsize (argc > 0 ? argv[1][0] : argv[2][argc] + z)
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd grainsize (foobool(argc)), grainsize (true) // expected-error {{directive '#pragma omp parallel master taskloop simd' cannot contain more than one 'grainsize' clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd grainsize (S1) // expected-error {{'S1' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd grainsize (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd grainsize (1 0) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd grainsize(if(tmain(argc, argv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd grainsize(0) // expected-error {{argument to 'grainsize' clause must be a strictly positive integer value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd grainsize(-1) // expected-error {{argument to 'grainsize' clause must be a strictly positive integer value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd grainsize(argc) num_tasks(argc) // expected-error {{'num_tasks' and 'grainsize' clause are mutually exclusive and may not appear on the same directive}} expected-note {{'grainsize' clause is specified here}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+
+ return tmain(argc, argv);
+}
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_lastprivate_codegen.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_lastprivate_codegen.cpp
new file mode 100644
index 0000000..9014ce3
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_lastprivate_codegen.cpp
@@ -0,0 +1,527 @@
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-apple-darwin10 -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=LAMBDA %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=BLOCKS %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DARRAY -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=ARRAY %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DLOOP -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=LOOP %s
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DARRAY -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DLOOP -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=SIMD-ONLY0 %s
+// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
+// expected-no-diagnostics
+
+#if !defined(ARRAY) && !defined(LOOP)
+#ifndef HEADER
+#define HEADER
+
+template <class T>
+struct S {
+ T f;
+ S(T a) : f(a) {}
+ S() : f() {}
+ S(const S &s, T t = T()) : f(s.f + t) {}
+ operator T() { return T(); }
+ ~S() {}
+};
+
+volatile double g;
+
+// CHECK-DAG: [[KMP_TASK_T_TY:%.+]] = type { i8*, i32 (i32, i8*)*, i32, %union{{.+}}, %union{{.+}}, i64, i64, i64, i32, i8* }
+// CHECK-DAG: [[S_DOUBLE_TY:%.+]] = type { double }
+// CHECK-DAG: [[PRIVATES_MAIN_TY:%.+]] = type {{.?}}{ [2 x [[S_DOUBLE_TY]]], [[S_DOUBLE_TY]], i32, [2 x i32]
+// CHECK-DAG: [[CAP_MAIN_TY:%.+]] = type { [2 x i32]*, i32*, [2 x [[S_DOUBLE_TY]]]*, [[S_DOUBLE_TY]]*, i{{[0-9]+}}* }
+// CHECK-DAG: [[KMP_TASK_MAIN_TY:%.+]] = type { [[KMP_TASK_T_TY]], [[PRIVATES_MAIN_TY]] }
+// CHECK-DAG: [[S_INT_TY:%.+]] = type { i32 }
+// CHECK-DAG: [[CAP_TMAIN_TY:%.+]] = type { [2 x i32]*, i32*, [2 x [[S_INT_TY]]]*, [[S_INT_TY]]* }
+// CHECK-DAG: [[PRIVATES_TMAIN_TY:%.+]] = type { i32, [2 x i32], [2 x [[S_INT_TY]]], [[S_INT_TY]], [104 x i8] }
+// CHECK-DAG: [[KMP_TASK_TMAIN_TY:%.+]] = type { [[KMP_TASK_T_TY]], [{{[0-9]+}} x i8], [[PRIVATES_TMAIN_TY]] }
+template <typename T>
+T tmain() {
+ S<T> ttt;
+ S<T> test;
+ T t_var __attribute__((aligned(128))) = T();
+ T vec[] = {1, 2};
+ S<T> s_arr[] = {1, 2};
+ S<T> var(3);
+#pragma omp parallel master taskloop simd lastprivate(t_var, vec, s_arr, s_arr, var, var)
+ for (int i = 0; i < 10; ++i) {
+ vec[0] = t_var;
+ s_arr[0] = var;
+ }
+ return T();
+}
+
+int main() {
+ static int sivar;
+#ifdef LAMBDA
+ // LAMBDA: [[G:@.+]] = global double
+ // LAMBDA: [[SIVAR:@.+]] = internal global i{{[0-9]+}} 0,
+ // LAMBDA-LABEL: @main
+ // LAMBDA: call{{( x86_thiscallcc)?}} void [[OUTER_LAMBDA:@.+]](
+ [&]() {
+ // LAMBDA: define{{.*}} internal{{.*}} void [[OUTER_LAMBDA]](
+ // LAMBDA: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc(%{{[^ ]+}} @{{[^,]+}}, i32 %{{[^,]+}}, i32 1, i64 96, i64 16, i32 (i32, i8*)* bitcast (i32 (i32, %{{[^*]+}}*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+// LAMBDA: [[PRIVATES:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i{{.+}} 0, i{{.+}} 1
+
+// LAMBDA: call void @__kmpc_taskloop(%{{.+}}* @{{.+}}, i32 %{{.+}}, i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* bitcast (void ([[KMP_TASK_MAIN_TY:%[^*]+]]*, [[KMP_TASK_MAIN_TY]]*, i32)* [[MAIN_DUP:@.+]] to i8*))
+// LAMBDA: ret
+#pragma omp parallel master taskloop simd lastprivate(g, sivar)
+ for (int i = 0; i < 10; ++i) {
+ // LAMBDA: define {{.+}} void [[INNER_LAMBDA:@.+]](%{{.+}}* [[ARG_PTR:%.+]])
+ // LAMBDA: store %{{.+}}* [[ARG_PTR]], %{{.+}}** [[ARG_PTR_REF:%.+]],
+ // LAMBDA: [[ARG_PTR:%.+]] = load %{{.+}}*, %{{.+}}** [[ARG_PTR_REF]]
+ // LAMBDA: [[G_PTR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[ARG_PTR]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+ // LAMBDA: [[G_REF:%.+]] = load double*, double** [[G_PTR_REF]]
+ // LAMBDA: store double 2.0{{.+}}, double* [[G_REF]]
+
+ // LAMBDA: store double* %{{.+}}, double** %{{.+}},
+ // LAMBDA: define internal i32 [[TASK_ENTRY]](i32 %0, %{{.+}}* noalias %1)
+ g = 1;
+ sivar = 11;
+ // LAMBDA: store double 1.0{{.+}}, double* %{{.+}},{{.*}}!llvm.access.group
+ // LAMBDA: store i{{[0-9]+}} 11, i{{[0-9]+}}* %{{.+}},{{.*}}!llvm.access.group
+ // LAMBDA: call void [[INNER_LAMBDA]](%
+ // LAMBDA: icmp ne i32 %{{.+}}, 0
+ // LAMBDA: br i1
+ // LAMBDA: load double, double* %{{.*}}
+ // LAMBDA: store volatile double %{{.*}}
+ // LAMBDA: load i32, i32* %{{.*}}
+ // LAMBDA: store i32 %{{.*}}
+ // LAMBDA: ret
+ [&]() {
+ g = 2;
+ sivar = 22;
+ }();
+ }
+ }();
+ return 0;
+#elif defined(BLOCKS)
+ // BLOCKS: [[G:@.+]] = global double
+ // BLOCKS-LABEL: @main
+ // BLOCKS: call void {{%.+}}(i8
+ ^{
+ // BLOCKS: define{{.*}} internal{{.*}} void {{.+}}(i8*
+ // BLOCKS: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc(%{{[^ ]+}} @{{[^,]+}}, i32 %{{[^,]+}}, i32 1, i64 96, i64 16, i32 (i32, i8*)* bitcast (i32 (i32, %{{[^*]+}}*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+ // BLOCKS: [[PRIVATES:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i{{.+}} 0, i{{.+}} 1
+ // BLOCKS: call void @__kmpc_taskloop(%{{.+}}* @{{.+}}, i32 %{{.+}}, i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* bitcast (void ([[KMP_TASK_MAIN_TY:%[^*]+]]*, [[KMP_TASK_MAIN_TY]]*, i32)* [[MAIN_DUP:@.+]] to i8*))
+ // BLOCKS: ret
+#pragma omp parallel master taskloop simd lastprivate(g, sivar)
+ for (int i = 0; i < 10; ++i) {
+ // BLOCKS: define {{.+}} void {{@.+}}(i8*
+ // BLOCKS-NOT: [[G]]{{[[^:word:]]}}
+ // BLOCKS: store double 2.0{{.+}}, double*
+ // BLOCKS-NOT: [[G]]{{[[^:word:]]}}
+ // BLOCKS-NOT: [[ISVAR]]{{[[^:word:]]}}
+ // BLOCKS: store i{{[0-9]+}} 22, i{{[0-9]+}}*
+ // BLOCKS-NOT: [[SIVAR]]{{[[^:word:]]}}
+ // BLOCKS: ret
+
+ // BLOCKS: store double* %{{.+}}, double** %{{.+}},
+ // BLOCKS: store i{{[0-9]+}}* %{{.+}}, i{{[0-9]+}}** %{{.+}},
+ // BLOCKS: define internal i32 [[TASK_ENTRY]](i32 %0, %{{.+}}* noalias %1)
+ g = 1;
+ sivar = 11;
+ // BLOCKS: store double 1.0{{.+}}, double* %{{.+}},{{.*}}!llvm.access.group
+ // BLOCKS-NOT: [[G]]{{[[^:word:]]}}
+ // BLOCKS: store i{{[0-9]+}} 11, i{{[0-9]+}}* %{{.+}},{{.*}}!llvm.access.group
+ // BLOCKS-NOT: [[SIVAR]]{{[[^:word:]]}}
+ // BLOCKS: call void {{%.+}}(i8
+ // BLOCKS: icmp ne i32 %{{.+}}, 0
+ // BLOCKS: br i1
+ // BLOCKS: load double, double* %
+ // BLOCKS: store volatile double %
+ // BLOCKS: load i32, i32* %
+ // BLOCKS: store i32 %
+ ^{
+ g = 2;
+ sivar = 22;
+ }();
+ }
+ }();
+ return 0;
+#else
+ S<double> ttt;
+ S<double> test;
+ int t_var = 0;
+ int vec[] = {1, 2};
+ S<double> s_arr[] = {1, 2};
+ S<double> var(3);
+#pragma omp parallel master taskloop simd lastprivate(var, t_var, s_arr, vec, s_arr, var, sivar)
+ for (int i = 0; i < 10; ++i) {
+ vec[0] = t_var;
+ s_arr[0] = var;
+ sivar = 33;
+ }
+ return tmain<int>();
+#endif
+}
+
+// CHECK: [[SIVAR:.+]] = internal global i{{[0-9]+}} 0,
+// CHECK: define i{{[0-9]+}} @main()
+// CHECK: alloca [[S_DOUBLE_TY]],
+// CHECK: [[TEST:%.+]] = alloca [[S_DOUBLE_TY]],
+// CHECK: [[T_VAR_ADDR:%.+]] = alloca i32,
+// CHECK: [[VEC_ADDR:%.+]] = alloca [2 x i32],
+// CHECK: [[S_ARR_ADDR:%.+]] = alloca [2 x [[S_DOUBLE_TY]]],
+// CHECK: [[VAR_ADDR:%.+]] = alloca [[S_DOUBLE_TY]],
+
+// CHECK: call {{.*}} [[S_DOUBLE_TY_CONSTR:@.+]]([[S_DOUBLE_TY]]* [[TEST]])
+
+// CHECK: [[RES:%.+]] = call {{.*}}i32 @__kmpc_master(
+// CHECK-NEXT: [[IS_MASTER:%.+]] = icmp ne i32 [[RES]], 0
+// CHECK-NEXT: br i1 [[IS_MASTER]], label {{%?}}[[THEN:.+]], label {{%?}}[[EXIT:.+]]
+// CHECK: [[THEN]]
+// Store original variables in capture struct.
+// CHECK: [[VEC_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: store [2 x i32]* [[VEC_ADDR:%.+]], [2 x i32]** [[VEC_REF]],
+// CHECK: [[T_VAR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 1
+// CHECK: store i32* [[T_VAR_ADDR:%.+]], i32** [[T_VAR_REF]],
+// CHECK: [[S_ARR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 2
+// CHECK: store [2 x [[S_DOUBLE_TY]]]* [[S_ARR_ADDR:%.+]], [2 x [[S_DOUBLE_TY]]]** [[S_ARR_REF]],
+// CHECK: [[VAR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 3
+// CHECK: store [[S_DOUBLE_TY]]* [[VAR_ADDR:%.+]], [[S_DOUBLE_TY]]** [[VAR_REF]],
+// CHECK: [[SIVAR_REF:%.+]] = getelementptr inbounds [[CAP_MAIN_TY]], [[CAP_MAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 4
+// CHECK: store i{{[0-9]+}}* [[SIVAR:%.+]], i{{[0-9]+}}** [[SIVAR_REF]],
+
+// Allocate task.
+// Returns struct kmp_task_t {
+// [[KMP_TASK_T]] task_data;
+// [[KMP_TASK_MAIN_TY]] privates;
+// };
+// CHECK: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc([[LOC:%.+]], i32 [[GTID:%.+]], i32 9, i64 120, i64 40, i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_MAIN_TY]]*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+// CHECK: [[RES_KMP_TASK:%.+]] = bitcast i8* [[RES]] to [[KMP_TASK_MAIN_TY]]*
+
+// Fill kmp_task_t->shareds by copying from original capture argument.
+// CHECK: [[TASK:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: [[SHAREDS_REF_ADDR:%.+]] = getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* [[TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: [[SHAREDS_REF:%.+]] = load i8*, i8** [[SHAREDS_REF_ADDR]],
+// CHECK: [[CAPTURES_ADDR:%.+]] = bitcast [[CAP_MAIN_TY]]* %{{.+}} to i8*
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 [[SHAREDS_REF]], i8* align 8 [[CAPTURES_ADDR]], i64 40, i1 false)
+
+// Initialize kmp_task_t->privates with default values (no init for simple types, default constructors for classes).
+// Also copy address of private copy to the corresponding shareds reference.
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
+
+// Constructors for s_arr and var.
+// s_arr;
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: call {{.*}} [[S_DOUBLE_TY_CONSTR]]([[S_DOUBLE_TY]]* [[S_ARR_CUR:%[^,]+]])
+// CHECK: getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* [[S_ARR_CUR]], i{{.+}} 1
+// CHECK: icmp eq
+// CHECK: br i1
+
+// var;
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
+// CHECK: call {{.*}} [[S_DOUBLE_TY_CONSTR]]([[S_DOUBLE_TY]]* [[PRIVATE_VAR_REF]])
+
+// t_var;
+// vec;
+// sivar;
+
+// Provide pointer to destructor function, which will destroy private variables at the end of the task.
+// CHECK: [[DESTRUCTORS_REF:%.+]] = getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* [[TASK]], i{{.+}} 0, i{{.+}} 3
+// CHECK: [[DESTRUCTORS_PTR:%.+]] = bitcast %union{{.+}}* [[DESTRUCTORS_REF]] to i32 (i32, i8*)**
+// CHECK: store i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_MAIN_TY]]*)* [[DESTRUCTORS:@.+]] to i32 (i32, i8*)*), i32 (i32, i8*)** [[DESTRUCTORS_PTR]],
+
+// Start task.
+// CHECK: call void @__kmpc_taskloop([[LOC]], i32 [[GTID]], i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* bitcast (void ([[KMP_TASK_MAIN_TY]]*, [[KMP_TASK_MAIN_TY]]*, i32)* [[MAIN_DUP:@.+]] to i8*))
+// CHECK: call {{.*}}void @__kmpc_end_master(
+// CHECK-NEXT: br label {{%?}}[[EXIT]]
+// CHECK: [[EXIT]]
+
+// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_MAIN_TY]]* noalias %0, [[S_DOUBLE_TY]]** noalias %1, i32** noalias %2, [2 x [[S_DOUBLE_TY]]]** noalias %3, [2 x i32]** noalias %4, i32** noalias %5)
+// CHECK: [[PRIVATES:%.+]] = load [[PRIVATES_MAIN_TY]]*, [[PRIVATES_MAIN_TY]]**
+// CHECK: [[PRIV_S_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 0
+// CHECK: [[ARG3:%.+]] = load [2 x [[S_DOUBLE_TY]]]**, [2 x [[S_DOUBLE_TY]]]*** %{{.+}},
+// CHECK: store [2 x [[S_DOUBLE_TY]]]* [[PRIV_S_VAR]], [2 x [[S_DOUBLE_TY]]]** [[ARG3]],
+// CHECK: [[PRIV_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 1
+// CHECK: [[ARG1:%.+]] = load [[S_DOUBLE_TY]]**, [[S_DOUBLE_TY]]*** {{.+}},
+// CHECK: store [[S_DOUBLE_TY]]* [[PRIV_VAR]], [[S_DOUBLE_TY]]** [[ARG1]],
+// CHECK: [[PRIV_T_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 2
+// CHECK: [[ARG2:%.+]] = load i32**, i32*** %{{.+}},
+// CHECK: store i32* [[PRIV_T_VAR]], i32** [[ARG2]],
+// CHECK: [[PRIV_VEC:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 3
+// CHECK: [[ARG4:%.+]] = load [2 x i32]**, [2 x i32]*** %{{.+}},
+// CHECK: store [2 x i32]* [[PRIV_VEC]], [2 x i32]** [[ARG4]],
+// CHECK: [[PRIV_SIVAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 4
+// CHECK: [[ARG5:%.+]] = load i{{[0-9]+}}**, i{{[0-9]+}}*** %{{.+}},
+// CHECK: store i{{[0-9]+}}* [[PRIV_SIVAR]], i{{[0-9]+}}** [[ARG5]],
+// CHECK: ret void
+
+// CHECK: define internal i32 [[TASK_ENTRY]](i32 %0, [[KMP_TASK_MAIN_TY]]* noalias %1)
+
+// CHECK: [[PRIV_VAR_ADDR:%.+]] = alloca [[S_DOUBLE_TY]]*,
+// CHECK: [[PRIV_T_VAR_ADDR:%.+]] = alloca i32*,
+// CHECK: [[PRIV_S_ARR_ADDR:%.+]] = alloca [2 x [[S_DOUBLE_TY]]]*,
+// CHECK: [[PRIV_VEC_ADDR:%.+]] = alloca [2 x i32]*,
+// CHECK: [[PRIV_SIVAR_ADDR:%.+]] = alloca i32*,
+// CHECK: store void (i8*, ...)* bitcast (void ([[PRIVATES_MAIN_TY]]*, [[S_DOUBLE_TY]]**, i32**, [2 x [[S_DOUBLE_TY]]]**, [2 x i32]**, i32**)* [[PRIVATES_MAP_FN]] to void (i8*, ...)*), void (i8*, ...)** [[MAP_FN_ADDR:%.+]],
+// CHECK: [[MAP_FN:%.+]] = load void (i8*, ...)*, void (i8*, ...)** [[MAP_FN_ADDR]],
+
+// CHECK: call void (i8*, ...) [[MAP_FN]](i8* %{{.+}}, [[S_DOUBLE_TY]]** [[PRIV_VAR_ADDR]], i32** [[PRIV_T_VAR_ADDR]], [2 x [[S_DOUBLE_TY]]]** [[PRIV_S_ARR_ADDR]], [2 x i32]** [[PRIV_VEC_ADDR]], i32** [[PRIV_SIVAR_ADDR]])
+
+// CHECK: [[PRIV_VAR:%.+]] = load [[S_DOUBLE_TY]]*, [[S_DOUBLE_TY]]** [[PRIV_VAR_ADDR]],
+// CHECK: [[PRIV_T_VAR:%.+]] = load i32*, i32** [[PRIV_T_VAR_ADDR]],
+// CHECK: [[PRIV_S_ARR:%.+]] = load [2 x [[S_DOUBLE_TY]]]*, [2 x [[S_DOUBLE_TY]]]** [[PRIV_S_ARR_ADDR]],
+// CHECK: [[PRIV_VEC:%.+]] = load [2 x i32]*, [2 x i32]** [[PRIV_VEC_ADDR]],
+// CHECK: [[PRIV_SIVAR:%.+]] = load i32*, i32** [[PRIV_SIVAR_ADDR]],
+
+// Privates actually are used.
+// CHECK-DAG: [[PRIV_VAR]]
+// CHECK-DAG: [[PRIV_T_VAR]]
+// CHECK-DAG: [[PRIV_S_ARR]]
+// CHECK-DAG: [[PRIV_VEC]]
+// CHECK-DAG: [[PRIV_SIVAR]]
+
+// CHECK: icmp ne i32 %{{.+}}, 0
+// CHECK-NEXT: br i1
+// CHECK: bitcast [[S_DOUBLE_TY]]* %{{.+}} to i8*
+// CHECK: bitcast [[S_DOUBLE_TY]]* %{{.+}} to i8*
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align {{[0-9]+}} %
+// CHECK: load i32, i32* %
+// CHECK: store i32 %{{.+}}, i32* %
+// CHECK: getelementptr inbounds [2 x [[S_DOUBLE_TY]]], [2 x [[S_DOUBLE_TY]]]* %
+// CHECK: phi [[S_DOUBLE_TY]]*
+// CHECK: phi [[S_DOUBLE_TY]]*
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align {{[0-9]+}} %
+// CHECK: icmp eq [[S_DOUBLE_TY]]* %
+// CHECK-NEXT: br i1
+// CHECK: bitcast [2 x i32]* %{{.+}} to i8*
+// CHECK: bitcast [2 x i32]* %{{.+}} to i8*
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align {{[0-9]+}} %
+// CHECK: load i32, i32* %
+// CHECK: store i32 %{{.+}}, i32* %
+// CHECK: br label
+// CHECK: ret
+
+// CHECK: define internal void [[MAIN_DUP]]([[KMP_TASK_MAIN_TY]]* %0, [[KMP_TASK_MAIN_TY]]* %1, i32 %2)
+// CHECK: getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* %{{.+}}, i32 0, i32 8
+// CHECK: load i32, i32* %
+// CHECK: store i32 %{{.+}}, i32* %
+// CHECK: getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* %{{.+}}, i32 0, i32 1
+// CHECK: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr inbounds [2 x [[S_DOUBLE_TY]]], [2 x [[S_DOUBLE_TY]]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i64 2
+// CHECK: br label %
+
+// CHECK: phi [[S_DOUBLE_TY]]*
+// CHECK: call {{.*}} [[S_DOUBLE_TY_CONSTR]]([[S_DOUBLE_TY]]*
+// CHECK: getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i64 1
+// CHECK: icmp eq [[S_DOUBLE_TY]]* %
+// CHECK: br i1 %
+
+// CHECK: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* %{{.+}}, i32 0, i32 1
+// CHECK: call {{.*}} [[S_DOUBLE_TY_CONSTR]]([[S_DOUBLE_TY]]*
+// CHECK: ret void
+
+// CHECK: define internal i32 [[DESTRUCTORS]](i32 %0, [[KMP_TASK_MAIN_TY]]* noalias %1)
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 0
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
+// CHECK: call {{.*}} @_ZN1SIdED1Ev([[S_DOUBLE_TY]]* [[PRIVATE_VAR_REF]])
+// CHECK: getelementptr inbounds [2 x [[S_DOUBLE_TY]]], [2 x [[S_DOUBLE_TY]]]* [[PRIVATE_S_ARR_REF]], i{{.+}} 0, i{{.+}} 0
+// CHECK: getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i{{.+}} 2
+// CHECK: [[PRIVATE_S_ARR_ELEM_REF:%.+]] = getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i{{.+}} -1
+// CHECK: call {{.*}} @_ZN1SIdED1Ev([[S_DOUBLE_TY]]* [[PRIVATE_S_ARR_ELEM_REF]])
+// CHECK: icmp eq
+// CHECK: br i1
+// CHECK: ret i32
+
+// CHECK: define {{.*}} i{{[0-9]+}} [[TMAIN_INT:@.+]]()
+// CHECK: alloca [[S_INT_TY]],
+// CHECK: [[TEST:%.+]] = alloca [[S_INT_TY]],
+// CHECK: [[T_VAR_ADDR:%.+]] = alloca i32, align 128
+// CHECK: [[VEC_ADDR:%.+]] = alloca [2 x i32],
+// CHECK: [[S_ARR_ADDR:%.+]] = alloca [2 x [[S_INT_TY]]],
+// CHECK: [[VAR_ADDR:%.+]] = alloca [[S_INT_TY]],
+
+// CHECK: call {{.*}} [[S_INT_TY_CONSTR:@.+]]([[S_INT_TY]]* [[TEST]])
+
+// Store original variables in capture struct.
+// CHECK: [[VEC_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: store [2 x i32]* [[VEC_ADDR:%.+]], [2 x i32]** [[VEC_REF]],
+// CHECK: [[T_VAR_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 1
+// CHECK: store i32* [[T_VAR_ADDR:%.+]], i32** [[T_VAR_REF]],
+// CHECK: [[S_ARR_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 2
+// CHECK: store [2 x [[S_INT_TY]]]* [[S_ARR_ADDR:%.+]], [2 x [[S_INT_TY]]]** [[S_ARR_REF]],
+// CHECK: [[VAR_REF:%.+]] = getelementptr inbounds [[CAP_TMAIN_TY]], [[CAP_TMAIN_TY]]* %{{.+}}, i{{[0-9]+}} 0, i{{[0-9]+}} 3
+// CHECK: store [[S_INT_TY]]* [[VAR_ADDR:%.+]], [[S_INT_TY]]** [[VAR_REF]],
+
+// Allocate task.
+// Returns struct kmp_task_t {
+// [[KMP_TASK_T_TY]] task_data;
+// [[KMP_TASK_TMAIN_TY]] privates;
+// };
+// CHECK: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc([[LOC]], i32 [[GTID:%.+]], i32 9, i64 256, i64 32, i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_TMAIN_TY]]*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+// CHECK: [[RES_KMP_TASK:%.+]] = bitcast i8* [[RES]] to [[KMP_TASK_TMAIN_TY]]*
+
+// Fill kmp_task_t->shareds by copying from original capture argument.
+// CHECK: [[TASK:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: [[SHAREDS_REF_ADDR:%.+]] = getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* [[TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: [[SHAREDS_REF:%.+]] = load i8*, i8** [[SHAREDS_REF_ADDR]],
+// CHECK: [[CAPTURES_ADDR:%.+]] = bitcast [[CAP_TMAIN_TY]]* %{{.+}} to i8*
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 [[SHAREDS_REF]], i8* align 8 [[CAPTURES_ADDR]], i64 32, i1 false)
+
+// Initialize kmp_task_t->privates with default values (no init for simple types, default constructors for classes).
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
+
+// t_var;
+// vec;
+
+// Constructors for s_arr and var.
+// a_arr;
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
+// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* [[PRIVATE_S_ARR_REF]], i{{.+}} 0, i{{.+}} 0
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i{{.+}} 2
+// CHECK: call {{.*}} [[S_INT_TY_CONSTR]]([[S_INT_TY]]* [[S_ARR_CUR:%[^,]+]])
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* [[S_ARR_CUR]], i{{.+}} 1
+// CHECK: icmp eq
+// CHECK: br i1
+
+// var;
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: call {{.*}} [[S_INT_TY_CONSTR]]([[S_INT_TY]]* [[PRIVATE_VAR_REF]])
+
+// Provide pointer to destructor function, which will destroy private variables at the end of the task.
+// CHECK: [[DESTRUCTORS_REF:%.+]] = getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* [[TASK]], i{{.+}} 0, i{{.+}} 3
+// CHECK: [[DESTRUCTORS_PTR:%.+]] = bitcast %union{{.+}}* [[DESTRUCTORS_REF]] to i32 (i32, i8*)**
+// CHECK: store i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_TMAIN_TY]]*)* [[DESTRUCTORS:@.+]] to i32 (i32, i8*)*), i32 (i32, i8*)** [[DESTRUCTORS_PTR]],
+
+// Start task.
+// CHECK: call void @__kmpc_taskloop([[LOC]], i32 [[GTID]], i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* bitcast (void ([[KMP_TASK_TMAIN_TY]]*, [[KMP_TASK_TMAIN_TY]]*, i32)* [[TMAIN_DUP:@.+]] to i8*))
+
+// No destructors must be called for private copies of s_arr and var.
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+
+// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_TMAIN_TY]]* noalias %0, i32** noalias %1, [2 x i32]** noalias %2, [2 x [[S_INT_TY]]]** noalias %3, [[S_INT_TY]]** noalias %4)
+// CHECK: [[PRIVATES:%.+]] = load [[PRIVATES_TMAIN_TY]]*, [[PRIVATES_TMAIN_TY]]**
+// CHECK: [[PRIV_T_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 0
+// CHECK: [[ARG1:%.+]] = load i32**, i32*** %{{.+}},
+// CHECK: store i32* [[PRIV_T_VAR]], i32** [[ARG1]],
+// CHECK: [[PRIV_VEC:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 1
+// CHECK: [[ARG2:%.+]] = load [2 x i32]**, [2 x i32]*** %{{.+}},
+// CHECK: store [2 x i32]* [[PRIV_VEC]], [2 x i32]** [[ARG2]],
+// CHECK: [[PRIV_S_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 2
+// CHECK: [[ARG3:%.+]] = load [2 x [[S_INT_TY]]]**, [2 x [[S_INT_TY]]]*** %{{.+}},
+// CHECK: store [2 x [[S_INT_TY]]]* [[PRIV_S_VAR]], [2 x [[S_INT_TY]]]** [[ARG3]],
+// CHECK: [[PRIV_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 3
+// CHECK: [[ARG4:%.+]] = load [[S_INT_TY]]**, [[S_INT_TY]]*** {{.+}},
+// CHECK: store [[S_INT_TY]]* [[PRIV_VAR]], [[S_INT_TY]]** [[ARG4]],
+// CHECK: ret void
+
+// CHECK: define internal i32 [[TASK_ENTRY]](i32 %0, [[KMP_TASK_TMAIN_TY]]* noalias %1)
+// CHECK: alloca i32*,
+// CHECK-DAG: [[PRIV_T_VAR_ADDR:%.+]] = alloca i32*,
+// CHECK-DAG: [[PRIV_VEC_ADDR:%.+]] = alloca [2 x i32]*,
+// CHECK-DAG: [[PRIV_S_ARR_ADDR:%.+]] = alloca [2 x [[S_INT_TY]]]*,
+// CHECK-DAG: [[PRIV_VAR_ADDR:%.+]] = alloca [[S_INT_TY]]*,
+// CHECK: store void (i8*, ...)* bitcast (void ([[PRIVATES_TMAIN_TY]]*, i32**, [2 x i32]**, [2 x [[S_INT_TY]]]**, [[S_INT_TY]]**)* [[PRIVATES_MAP_FN]] to void (i8*, ...)*), void (i8*, ...)** [[MAP_FN_ADDR:%.+]],
+// CHECK: [[MAP_FN:%.+]] = load void (i8*, ...)*, void (i8*, ...)** [[MAP_FN_ADDR]],
+// CHECK: call void (i8*, ...) [[MAP_FN]](i8* %{{.+}}, i32** [[PRIV_T_VAR_ADDR]], [2 x i32]** [[PRIV_VEC_ADDR]], [2 x [[S_INT_TY]]]** [[PRIV_S_ARR_ADDR]], [[S_INT_TY]]** [[PRIV_VAR_ADDR]])
+// CHECK: [[PRIV_T_VAR:%.+]] = load i32*, i32** [[PRIV_T_VAR_ADDR]],
+// CHECK: [[PRIV_VEC:%.+]] = load [2 x i32]*, [2 x i32]** [[PRIV_VEC_ADDR]],
+// CHECK: [[PRIV_S_ARR:%.+]] = load [2 x [[S_INT_TY]]]*, [2 x [[S_INT_TY]]]** [[PRIV_S_ARR_ADDR]],
+// CHECK: [[PRIV_VAR:%.+]] = load [[S_INT_TY]]*, [[S_INT_TY]]** [[PRIV_VAR_ADDR]],
+
+// Privates actually are used.
+// CHECK-DAG: [[PRIV_VAR]]
+// CHECK-DAG: [[PRIV_T_VAR]]
+// CHECK-DAG: [[PRIV_S_ARR]]
+// CHECK-DAG: [[PRIV_VEC]]
+
+// CHECK: icmp ne i32 %{{.+}}, 0
+// CHECK-NEXT: br i1
+// CHECK: load i32, i32* %
+// CHECK: store i32 %{{.+}}, i32* %
+// CHECK: bitcast [2 x i32]* %{{.+}} to i8*
+// CHECK: bitcast [2 x i32]* %{{.+}} to i8*
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align {{[0-9]+}} %
+// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* %
+// CHECK: phi [[S_INT_TY]]*
+// CHECK: phi [[S_INT_TY]]*
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align {{[0-9]+}} %
+// CHECK: icmp eq [[S_INT_TY]]* %
+// CHECK-NEXT: br i1
+// CHECK: bitcast [[S_INT_TY]]* %{{.+}} to i8*
+// CHECK: bitcast [[S_INT_TY]]* %{{.+}} to i8*
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align {{[0-9]+}} %
+// CHECK: br label
+// CHECK: ret
+
+// CHECK: define internal void [[TMAIN_DUP]]([[KMP_TASK_TMAIN_TY]]* %0, [[KMP_TASK_TMAIN_TY]]* %1, i32 %2)
+// CHECK: getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* %{{.+}}, i32 0, i32 8
+// CHECK: load i32, i32* %
+// CHECK: store i32 %{{.+}}, i32* %
+// CHECK: getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* %{{.+}}, i32 0, i32 2
+// CHECK: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* %{{.+}}, i32 0, i32 2
+// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i64 2
+// CHECK: br label %
+
+// CHECK: phi [[S_INT_TY]]*
+// CHECK: call {{.*}} [[S_INT_TY_CONSTR]]([[S_INT_TY]]*
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i64 1
+// CHECK: icmp eq [[S_INT_TY]]* %
+// CHECK: br i1 %
+
+// CHECK: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* %{{.+}}, i32 0, i32 3
+// CHECK: call {{.*}} [[S_INT_TY_CONSTR]]([[S_INT_TY]]*
+// CHECK: ret void
+
+// CHECK: define internal i32 [[DESTRUCTORS]](i32 %0, [[KMP_TASK_TMAIN_TY]]* noalias %1)
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: call void @_ZN1SIiED1Ev([[S_INT_TY]]* [[PRIVATE_VAR_REF]])
+// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* [[PRIVATE_S_ARR_REF]], i{{.+}} 0, i{{.+}} 0
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i{{.+}} 2
+// CHECK: [[PRIVATE_S_ARR_ELEM_REF:%.+]] = getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i{{.+}} -1
+// CHECK: call void @_ZN1SIiED1Ev([[S_INT_TY]]* [[PRIVATE_S_ARR_ELEM_REF]])
+// CHECK: icmp eq
+// CHECK: br i1
+// CHECK: ret i32
+
+#endif
+#elif defined(ARRAY)
+// ARRAY-LABEL: array_func
+struct St {
+ int a, b;
+ St() : a(0), b(0) {}
+ St(const St &) {}
+ ~St() {}
+};
+
+void array_func(int n, float a[n], St s[2]) {
+// ARRAY: call i8* @__kmpc_omp_task_alloc(
+// ARRAY: call void @__kmpc_taskloop(
+// ARRAY: store float** %{{.+}}, float*** %{{.+}},
+// ARRAY: store %struct.St** %{{.+}}, %struct.St*** %{{.+}},
+// ARRAY: icmp ne i32 %{{.+}}, 0
+// ARRAY: store float* %{{.+}}, float** %{{.+}},
+// ARRAY: store %struct.St* %{{.+}}, %struct.St** %{{.+}},
+#pragma omp parallel master taskloop simd lastprivate(a, s)
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+#else
+
+// LOOP-LABEL: loop
+void loop() {
+// LOOP: call i8* @__kmpc_omp_task_alloc(
+// LOOP: call void @__kmpc_taskloop(
+ int i, j;
+#pragma omp parallel master taskloop simd linear(i, j)
+ for (i = 0; i < 10; ++i)
+ ++j;
+}
+#endif
+
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_lastprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_lastprivate_messages.cpp
new file mode 100644
index 0000000..7cbbb72
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_lastprivate_messages.cpp
@@ -0,0 +1,305 @@
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp-simd %s -Wuninitialized
+
+typedef void **omp_allocator_handle_t;
+extern const omp_allocator_handle_t omp_default_mem_alloc;
+extern const omp_allocator_handle_t omp_large_cap_mem_alloc;
+extern const omp_allocator_handle_t omp_const_mem_alloc;
+extern const omp_allocator_handle_t omp_high_bw_mem_alloc;
+extern const omp_allocator_handle_t omp_low_lat_mem_alloc;
+extern const omp_allocator_handle_t omp_cgroup_mem_alloc;
+extern const omp_allocator_handle_t omp_pteam_mem_alloc;
+extern const omp_allocator_handle_t omp_thread_mem_alloc;
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+struct S1; // expected-note 2 {{declared here}} expected-note 2 {{forward declaration of 'S1'}}
+extern S1 a;
+class S2 {
+ mutable int a;
+
+public:
+ S2() : a(0) {}
+ S2(S2 &s2) : a(s2.a) {}
+ const S2 &operator =(const S2&) const;
+ S2 &operator =(const S2&);
+ static float S2s; // expected-note {{static data member is predetermined as shared}}
+ static const float S2sc; // expected-note {{'S2sc' declared here}}
+};
+const float S2::S2sc = 0;
+const S2 b;
+const S2 ba[5];
+class S3 {
+ int a;
+ S3 &operator=(const S3 &s3); // expected-note 2 {{implicitly declared private here}}
+
+public:
+ S3() : a(0) {}
+ S3(S3 &s3) : a(s3.a) {}
+};
+const S3 c; // expected-note {{'c' defined here}}
+const S3 ca[5]; // expected-note {{'ca' defined here}}
+extern const int f; // expected-note {{'f' declared here}}
+class S4 {
+ int a;
+ S4(); // expected-note 3 {{implicitly declared private here}}
+ S4(const S4 &s4);
+
+public:
+ S4(int v) : a(v) {}
+};
+class S5 {
+ int a;
+ S5() : a(0) {} // expected-note {{implicitly declared private here}}
+
+public:
+ S5(const S5 &s5) : a(s5.a) {}
+ S5(int v) : a(v) {}
+};
+class S6 {
+ int a;
+ S6() : a(0) {}
+
+public:
+ S6(const S6 &s6) : a(s6.a) {}
+ S6(int v) : a(v) {}
+};
+
+S3 h;
+#pragma omp threadprivate(h) // expected-note 2 {{defined as threadprivate or thread local}}
+
+template <class I, class C>
+int foomain(int argc, char **argv) {
+ I e(4);
+ I g(5);
+ int i, z;
+ int &j = i;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate // expected-error {{expected '(' after 'lastprivate'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate() // expected-error {{expected expression}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate(conditional: argc) lastprivate(conditional: // expected-error 2 {{use of undeclared identifier 'conditional'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate(S1) // expected-error {{'S1' does not refer to a value}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate(a, b) // expected-error {{lastprivate variable with incomplete type 'S1'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate(argv[1]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate(z, e, g) // expected-error 2 {{calling a private constructor of class 'S4'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate(h) // expected-error {{threadprivate or thread local variable cannot be lastprivate}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+ {
+ int v = 0;
+ int i;
+#pragma omp parallel master taskloop simd allocate(omp_thread_mem_alloc: i) lastprivate(i) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'parallel master taskloop simd' directive}}
+ for (int k = 0; k < argc; ++k) {
+ i = k;
+ v += i;
+ }
+ }
+#pragma omp parallel shared(i)
+#pragma omp parallel private(i)
+#pragma omp parallel master taskloop simd lastprivate(j)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate(i)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+ return 0;
+}
+
+void bar(S4 a[2]) {
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate(a)
+ for (int i = 0; i < 2; ++i)
+ foo();
+}
+
+namespace A {
+double x;
+#pragma omp threadprivate(x) // expected-note {{defined as threadprivate or thread local}}
+}
+namespace B {
+using A::x;
+}
+
+int main(int argc, char **argv) {
+ const int d = 5; // expected-note {{'d' defined here}}
+ const int da[5] = {0}; // expected-note {{'da' defined here}}
+ S4 e(4);
+ S5 g(5);
+ S3 m;
+ S6 n(2);
+ int i, z;
+ int &j = i;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate // expected-error {{expected '(' after 'lastprivate'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate() // expected-error {{expected expression}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate(argc, z)
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate(S1) // expected-error {{'S1' does not refer to a value}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate(a, b, c, d, f) // expected-error {{lastprivate variable with incomplete type 'S1'}} expected-error 1 {{const-qualified variable without mutable fields cannot be lastprivate}} expected-error 2 {{const-qualified variable cannot be lastprivate}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate(argv[1]) // expected-error {{expected variable name}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate(2 * 2) // expected-error {{expected variable name}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate(ba)
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate(ca) // expected-error {{const-qualified variable without mutable fields cannot be lastprivate}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate(da) // expected-error {{const-qualified variable cannot be lastprivate}}
+ for (i = 0; i < argc; ++i)
+ foo();
+ int xa;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate(xa) // OK
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate(S2::S2s) // expected-error {{shared variable cannot be lastprivate}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate(S2::S2sc) // expected-error {{const-qualified variable cannot be lastprivate}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd safelen(5)
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate(e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate(m) // expected-error {{'operator=' is a private member of 'S3'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate(h) // expected-error {{threadprivate or thread local variable cannot be lastprivate}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate(B::x) // expected-error {{threadprivate or thread local variable cannot be lastprivate}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd private(xa), lastprivate(xa) // expected-error {{private variable cannot be lastprivate}} expected-note {{defined as private}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd linear(i)
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel private(xa)
+#pragma omp parallel master taskloop simd lastprivate(xa)
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel reduction(+ : xa)
+#pragma omp parallel master taskloop simd lastprivate(xa)
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate(j)
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd firstprivate(m) lastprivate(m) // expected-error {{'operator=' is a private member of 'S3'}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate(n) firstprivate(n) // OK
+ for (i = 0; i < argc; ++i)
+ foo();
+ static int si;
+#pragma omp parallel master taskloop simd lastprivate(si) // OK
+ for (i = 0; i < argc; ++i)
+ si = i + 1;
+ return foomain<S4, S5>(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<S4, S5>' requested here}}
+}
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_linear_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_linear_messages.cpp
new file mode 100644
index 0000000..ede683f
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_linear_messages.cpp
@@ -0,0 +1,268 @@
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+
+typedef void **omp_allocator_handle_t;
+extern const omp_allocator_handle_t omp_default_mem_alloc;
+extern const omp_allocator_handle_t omp_large_cap_mem_alloc;
+extern const omp_allocator_handle_t omp_const_mem_alloc;
+extern const omp_allocator_handle_t omp_high_bw_mem_alloc;
+extern const omp_allocator_handle_t omp_low_lat_mem_alloc;
+extern const omp_allocator_handle_t omp_cgroup_mem_alloc;
+extern const omp_allocator_handle_t omp_pteam_mem_alloc;
+extern const omp_allocator_handle_t omp_thread_mem_alloc;
+
+void xxx(int argc) {
+ int i, lin, step; // expected-note {{initialize the variable 'lin' to silence this warning}} expected-note {{initialize the variable 'step' to silence this warning}}
+#pragma omp parallel master taskloop simd linear(i, lin : step) // expected-warning {{variable 'lin' is uninitialized when used here}} expected-warning {{variable 'step' is uninitialized when used here}}
+ for (i = 0; i < 10; ++i)
+ ;
+}
+
+namespace X {
+ int x;
+};
+
+struct B {
+ static int ib; // expected-note {{'B::ib' declared here}}
+ static int bfoo() { return 8; }
+};
+
+int bfoo() { return 4; }
+
+int z;
+const int C1 = 1;
+const int C2 = 2;
+void test_linear_colons()
+{
+ int B = 0;
+ #pragma omp parallel master taskloop simd linear(B:bfoo())
+ for (int i = 0; i < 10; ++i) ;
+ // expected-error@+1 {{unexpected ':' in nested name specifier; did you mean '::'}}
+ #pragma omp parallel master taskloop simd linear(B::ib:B:bfoo())
+ for (int i = 0; i < 10; ++i) ;
+ // expected-error@+1 {{use of undeclared identifier 'ib'; did you mean 'B::ib'}}
+ #pragma omp parallel master taskloop simd linear(B:ib)
+ for (int i = 0; i < 10; ++i) ;
+ // expected-error@+1 {{unexpected ':' in nested name specifier; did you mean '::'?}}
+ #pragma omp parallel master taskloop simd linear(z:B:ib)
+ for (int i = 0; i < 10; ++i) ;
+ #pragma omp parallel master taskloop simd linear(B:B::bfoo())
+ for (int i = 0; i < 10; ++i) ;
+ #pragma omp parallel master taskloop simd linear(X::x : ::z)
+ for (int i = 0; i < 10; ++i) ;
+ #pragma omp parallel master taskloop simd linear(B,::z, X::x)
+ for (int i = 0; i < 10; ++i) ;
+ #pragma omp parallel master taskloop simd linear(::z)
+ for (int i = 0; i < 10; ++i) ;
+ // expected-error@+1 {{expected variable name}}
+ #pragma omp parallel master taskloop simd linear(B::bfoo())
+ for (int i = 0; i < 10; ++i) ;
+ #pragma omp parallel master taskloop simd linear(B::ib,B:C1+C2)
+ for (int i = 0; i < 10; ++i) ;
+}
+
+template<int L, class T, class N> T test_template(T* arr, N num) {
+ N i;
+ T sum = (T)0;
+ T ind2 = - num * L; // expected-note {{'ind2' defined here}}
+ // expected-error@+1 {{argument of a linear clause should be of integral or pointer type}}
+#pragma omp parallel master taskloop simd linear(ind2:L)
+ for (i = 0; i < num; ++i) {
+ T cur = arr[(int)ind2];
+ ind2 += L;
+ sum += cur;
+ }
+ return T();
+}
+
+template<int LEN> int test_warn() {
+ int ind2 = 0;
+ // expected-warning@+1 {{zero linear step (ind2 should probably be const)}}
+ #pragma omp parallel master taskloop simd linear(ind2:LEN)
+ for (int i = 0; i < 100; i++) {
+ ind2 += LEN;
+ }
+ return ind2;
+}
+
+struct S1; // expected-note 2 {{declared here}} expected-note 2 {{forward declaration of 'S1'}}
+extern S1 a;
+class S2 {
+ mutable int a;
+public:
+ S2():a(0) { }
+};
+const S2 b; // expected-note 2 {{'b' defined here}}
+const S2 ba[5];
+class S3 {
+ int a;
+public:
+ S3():a(0) { }
+};
+const S3 ca[5];
+class S4 {
+ int a;
+ S4();
+public:
+ S4(int v):a(v) { }
+};
+class S5 {
+ int a;
+ S5():a(0) {}
+public:
+ S5(int v):a(v) { }
+};
+
+S3 h;
+#pragma omp threadprivate(h) // expected-note 2 {{defined as threadprivate or thread local}}
+
+template<class I, class C> int foomain(I argc, C **argv) {
+ I e(4);
+ I g(5);
+ int i, z;
+ int &j = i;
+ #pragma omp parallel master taskloop simd linear // expected-error {{expected '(' after 'linear'}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd linear ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd linear (val // expected-error {{use of undeclared identifier 'val'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd linear (uval( // expected-error {{expected expression}} expected-error 2 {{expected ')'}} expected-note 2 {{to match this '('}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd linear (ref() // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd linear (foo() // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd linear () // expected-error {{expected expression}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd linear (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd linear (val argc // expected-error {{use of undeclared identifier 'val'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd linear (val(argc, // expected-error {{expected expression}} expected-error 2 {{expected ')'}} expected-note 2 {{to match this '('}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd linear (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd linear (argc : 5) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd linear (S1) // expected-error {{'S1' does not refer to a value}}
+ for (int k = 0; k < argc; ++k) ++k;
+ // expected-error@+2 {{linear variable with incomplete type 'S1'}}
+ // expected-error@+1 {{argument of a linear clause should be of integral or pointer type, not 'S2'}}
+ #pragma omp parallel master taskloop simd linear (val(a, b):B::ib)
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd linear (argv[1]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd linear(ref(e, g)) // expected-error 2 {{variable of non-reference type 'int' can be used only with 'val' modifier, but used with 'ref'}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd linear(h, z) // expected-error {{threadprivate or thread local variable cannot be linear}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd linear(uval(i)) // expected-error {{variable of non-reference type 'int' can be used only with 'val' modifier, but used with 'uval'}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel
+ {
+ int v = 0;
+ int i;
+ #pragma omp parallel master taskloop simd allocate(omp_thread_mem_alloc: v) linear(v:i) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'parallel master taskloop simd' directive}}
+ for (int k = 0; k < argc; ++k) { i = k; v += i; }
+ }
+ #pragma omp parallel master taskloop simd linear(ref(j))
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd linear(uval(j))
+ for (int k = 0; k < argc; ++k) ++k;
+ int v = 0;
+ #pragma omp parallel master taskloop simd linear(v:j)
+ for (int k = 0; k < argc; ++k) { ++k; v += j; }
+ #pragma omp parallel master taskloop simd linear(i)
+ for (int k = 0; k < argc; ++k) ++k;
+ return 0;
+}
+
+namespace A {
+double x;
+#pragma omp threadprivate(x) // expected-note {{defined as threadprivate or thread local}}
+}
+namespace C {
+using A::x;
+}
+
+void linear_modifiers(int argc) {
+ int &f = argc;
+ #pragma omp parallel master taskloop simd linear(f)
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd linear(val(f))
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd linear(uval(f))
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd linear(ref(f))
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd linear(foo(f)) // expected-error {{expected one of 'ref', val' or 'uval' modifiers}}
+ for (int k = 0; k < argc; ++k) ++k;
+}
+
+int f;
+int main(int argc, char **argv) {
+ double darr[100];
+ // expected-note@+1 {{in instantiation of function template specialization 'test_template<-4, double, int>' requested here}}
+ test_template<-4>(darr, 4);
+ // expected-note@+1 {{in instantiation of function template specialization 'test_warn<0>' requested here}}
+ test_warn<0>();
+
+ S4 e(4); // expected-note {{'e' defined here}}
+ S5 g(5); // expected-note {{'g' defined here}}
+ int i, z;
+ int &j = i;
+ #pragma omp parallel master taskloop simd linear(f) linear(f) // expected-error {{linear variable cannot be linear}} expected-note {{defined as linear}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd linear // expected-error {{expected '(' after 'linear'}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd linear ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd linear () // expected-error {{expected expression}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd linear (val // expected-error {{use of undeclared identifier 'val'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd linear (ref()) // expected-error {{expected expression}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd linear (foo()) // expected-error {{expected expression}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd linear (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd linear (argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd linear (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd linear (argc, z)
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd linear (S1) // expected-error {{'S1' does not refer to a value}}
+ for (int k = 0; k < argc; ++k) ++k;
+ // expected-error@+2 {{linear variable with incomplete type 'S1'}}
+ // expected-error@+1 {{argument of a linear clause should be of integral or pointer type, not 'S2'}}
+ #pragma omp parallel master taskloop simd linear(a, b)
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd linear (argv[1]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k) ++k;
+ // expected-error@+2 {{argument of a linear clause should be of integral or pointer type, not 'S4'}}
+ // expected-error@+1 {{argument of a linear clause should be of integral or pointer type, not 'S5'}}
+ #pragma omp parallel master taskloop simd linear(val(e, g))
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd linear(h, C::x) // expected-error 2 {{threadprivate or thread local variable cannot be linear}}
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel
+ {
+ int i;
+ #pragma omp parallel master taskloop simd linear(val(i))
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd linear(uval(i) : 4) // expected-error {{variable of non-reference type 'int' can be used only with 'val' modifier, but used with 'uval'}}
+ for (int k = 0; k < argc; ++k) { ++k; i += 4; }
+ }
+ #pragma omp parallel master taskloop simd linear(ref(j))
+ for (int k = 0; k < argc; ++k) ++k;
+ #pragma omp parallel master taskloop simd linear(i)
+ for (int k = 0; k < argc; ++k) ++k;
+
+ foomain<int,char>(argc,argv); // expected-note {{in instantiation of function template specialization 'foomain<int, char>' requested here}}
+ return 0;
+}
+
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_loop_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_loop_messages.cpp
new file mode 100644
index 0000000..9f6c55e
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_loop_messages.cpp
@@ -0,0 +1,746 @@
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wuninitialized
+
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wuninitialized
+
+class S {
+ int a;
+ S() : a(0) {}
+
+public:
+ S(int v) : a(v) {}
+ S(const S &s) : a(s.a) {}
+};
+
+static int sii;
+// expected-note@+1 {{defined as threadprivate or thread local}}
+#pragma omp threadprivate(sii)
+static int globalii;
+
+// Currently, we cannot use "0" for global register variables.
+// register int reg0 __asm__("0");
+int reg0;
+
+int test_iteration_spaces() {
+ const int N = 100;
+ float a[N], b[N], c[N];
+ int ii, jj, kk;
+ float fii;
+ double dii;
+ register int reg; // expected-warning {{'register' storage class specifier is deprecated}}
+#pragma omp parallel
+#pragma omp parallel master taskloop simd
+ for (int i = 0; i < 10; i += 1) {
+ c[i] = a[i] + b[i];
+ }
+#pragma omp parallel
+#pragma omp parallel master taskloop simd
+ for (char i = 0; i < 10; i++) {
+ c[i] = a[i] + b[i];
+ }
+#pragma omp parallel
+#pragma omp parallel master taskloop simd
+ for (char i = 0; i < 10; i += '\1') {
+ c[i] = a[i] + b[i];
+ }
+#pragma omp parallel
+#pragma omp parallel master taskloop simd
+ for (long long i = 0; i < 10; i++) {
+ c[i] = a[i] + b[i];
+ }
+#pragma omp parallel
+// expected-error@+2 {{expression must have integral or unscoped enumeration type, not 'double'}}
+#pragma omp parallel master taskloop simd
+ for (long long i = 0; i < 10; i += 1.5) {
+ c[i] = a[i] + b[i];
+ }
+#pragma omp parallel
+#pragma omp parallel master taskloop simd
+ for (long long i = 0; i < 'z'; i += 1u) {
+ c[i] = a[i] + b[i];
+ }
+#pragma omp parallel
+// expected-error@+2 {{variable must be of integer or random access iterator type}}
+#pragma omp parallel master taskloop simd
+ for (float fi = 0; fi < 10.0; fi++) {
+ c[(int)fi] = a[(int)fi] + b[(int)fi];
+ }
+#pragma omp parallel
+// expected-error@+2 {{variable must be of integer or random access iterator type}}
+#pragma omp parallel master taskloop simd
+ for (double fi = 0; fi < 10.0; fi++) {
+ c[(int)fi] = a[(int)fi] + b[(int)fi];
+ }
+#pragma omp parallel
+// expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp parallel master taskloop simd
+ for (int &ref = ii; ref < 10; ref++) {
+ }
+#pragma omp parallel
+// expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp parallel master taskloop simd
+ for (int i; i < 10; i++)
+ c[i] = a[i];
+
+#pragma omp parallel
+// expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp parallel master taskloop simd
+ for (int i = 0, j = 0; i < 10; ++i)
+ c[i] = a[i];
+
+#pragma omp parallel
+// expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp parallel master taskloop simd
+ for (; ii < 10; ++ii)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-warning@+3 {{expression result unused}}
+// expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp parallel master taskloop simd
+ for (ii + 1; ii < 10; ++ii)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp parallel master taskloop simd
+ for (c[ii] = 0; ii < 10; ++ii)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// Ok to skip parenthesises.
+#pragma omp parallel master taskloop simd
+ for (((ii)) = 0; ii < 10; ++ii)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
+#pragma omp parallel master taskloop simd
+ for (int i = 0; i; i++)
+ c[i] = a[i];
+
+#pragma omp parallel
+// omp4-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'i'}}
+#pragma omp parallel master taskloop simd
+ for (int i = 0; jj < kk; ii++)
+ c[i] = a[i];
+
+#pragma omp parallel
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
+#pragma omp parallel master taskloop simd
+ for (int i = 0; !!i; i++)
+ c[i] = a[i];
+
+// Ok
+#pragma omp parallel
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+#pragma omp parallel master taskloop simd
+ for (int i = 0; i != 1; i++)
+ c[i] = a[i];
+
+#pragma omp parallel
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
+#pragma omp parallel master taskloop simd
+ for (int i = 0;; i++)
+ c[i] = a[i];
+
+#pragma omp parallel
+// Ok.
+#pragma omp parallel master taskloop simd
+ for (int i = 11; i > 10; i--)
+ c[i] = a[i];
+
+#pragma omp parallel
+// Ok.
+#pragma omp parallel master taskloop simd
+ for (int i = 0; i < 10; ++i)
+ c[i] = a[i];
+
+#pragma omp parallel
+// Ok.
+#pragma omp parallel master taskloop simd
+ for (ii = 0; ii < 10; ++ii)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
+#pragma omp parallel master taskloop simd
+ for (ii = 0; ii < 10; ++jj)
+ c[ii] = a[jj];
+
+#pragma omp parallel
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
+#pragma omp parallel master taskloop simd
+ for (ii = 0; ii < 10; ++++ii)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// Ok but undefined behavior (in general, cannot check that incr
+// is really loop-invariant).
+#pragma omp parallel master taskloop simd
+ for (ii = 0; ii < 10; ii = ii + ii)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-error@+2 {{expression must have integral or unscoped enumeration type, not 'float'}}
+#pragma omp parallel master taskloop simd
+ for (ii = 0; ii < 10; ii = ii + 1.0f)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// Ok - step was converted to integer type.
+#pragma omp parallel master taskloop simd
+ for (ii = 0; ii < 10; ii = ii + (int)1.1f)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
+#pragma omp parallel master taskloop simd
+ for (ii = 0; ii < 10; jj = ii + 2)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-warning@+3 {{relational comparison result unused}}
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
+#pragma omp parallel master taskloop simd
+ for (ii = 0; ii<10; jj> kk + 2)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
+#pragma omp parallel master taskloop simd
+ for (ii = 0; ii < 10;)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-warning@+3 {{expression result unused}}
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
+#pragma omp parallel master taskloop simd
+ for (ii = 0; ii < 10; !ii)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
+#pragma omp parallel master taskloop simd
+ for (ii = 0; ii < 10; ii ? ++ii : ++jj)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
+#pragma omp parallel master taskloop simd
+ for (ii = 0; ii < 10; ii = ii < 10)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be positive due to this condition}}
+// expected-error@+2 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
+#pragma omp parallel master taskloop simd
+ for (ii = 0; ii < 10; ii = ii + 0)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be positive due to this condition}}
+// expected-error@+2 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
+#pragma omp parallel master taskloop simd
+ for (ii = 0; ii < 10; ii = ii + (int)(0.8 - 0.45))
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be positive due to this condition}}
+// expected-error@+2 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
+#pragma omp parallel master taskloop simd
+ for (ii = 0; (ii) < 10; ii -= 25)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be positive due to this condition}}
+// expected-error@+2 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
+#pragma omp parallel master taskloop simd
+ for (ii = 0; (ii < 10); ii -= 0)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be negative due to this condition}}
+// expected-error@+2 {{increment expression must cause 'ii' to decrease on each iteration of OpenMP for loop}}
+#pragma omp parallel master taskloop simd
+ for (ii = 0; ii > 10; (ii += 0))
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be positive due to this condition}}
+// expected-error@+2 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
+#pragma omp parallel master taskloop simd
+ for (ii = 0; ii < 10; (ii) = (1 - 1) + (ii))
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be negative due to this condition}}
+// expected-error@+2 {{increment expression must cause 'ii' to decrease on each iteration of OpenMP for loop}}
+#pragma omp parallel master taskloop simd
+ for ((ii = 0); ii > 10; (ii -= 0))
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be positive due to this condition}}
+// expected-error@+2 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
+#pragma omp parallel master taskloop simd
+ for (ii = 0; (ii < 10); (ii -= 0))
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-note@+2 {{defined as firstprivate}}
+// expected-error@+2 {{loop iteration variable in the associated loop of 'omp parallel master taskloop simd' directive may not be firstprivate, predetermined as linear}}
+#pragma omp parallel master taskloop simd firstprivate(ii)
+ for (ii = 0; ii < 10; ii++)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+// expected-error@+1 {{unexpected OpenMP clause 'in_reduction' in directive '#pragma omp parallel master taskloop simd'}}
+#pragma omp parallel master taskloop simd in_reduction(+:ii)
+ for (ii = 0; ii < 10; ii++)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+#pragma omp parallel master taskloop simd linear(ii)
+ for (ii = 0; ii < 10; ii++)
+ c[ii] = a[ii];
+
+#pragma omp parallel
+ {
+// expected-error@+2 {{loop iteration variable in the associated loop of 'omp parallel master taskloop simd' directive may not be threadprivate or thread local, predetermined as linear}}
+#pragma omp parallel master taskloop simd
+ for (sii = 0; sii < 10; sii += 1)
+ c[sii] = a[sii];
+ }
+
+#pragma omp parallel
+ {
+#pragma omp parallel master taskloop simd
+ for (reg0 = 0; reg0 < 10; reg0 += 1)
+ c[reg0] = a[reg0];
+ }
+
+#pragma omp parallel
+ {
+#pragma omp parallel master taskloop simd
+ for (reg = 0; reg < 10; reg += 1)
+ c[reg] = a[reg];
+ }
+
+#pragma omp parallel
+ {
+#pragma omp parallel master taskloop simd
+ for (globalii = 0; globalii < 10; globalii += 1)
+ c[globalii] = a[globalii];
+ }
+
+#pragma omp parallel
+ {
+#pragma omp parallel master taskloop simd collapse(2)
+ for (ii = 0; ii < 10; ii += 1)
+ for (globalii = 0; globalii < 10; globalii += 1)
+ c[globalii] += a[globalii] + ii;
+ }
+
+#pragma omp parallel
+// omp4-error@+2 {{statement after '#pragma omp parallel master taskloop simd' must be a for loop}}
+#pragma omp parallel master taskloop simd
+ for (auto &item : a) {
+ item = item + 1;
+ }
+
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be positive due to this condition}}
+// expected-error@+2 {{increment expression must cause 'i' to increase on each iteration of OpenMP for loop}}
+#pragma omp parallel master taskloop simd
+ for (unsigned i = 9; i < 10; i--) {
+ c[i] = a[i] + b[i];
+ }
+
+ int(*lb)[4] = nullptr;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd
+ for (int(*p)[4] = lb; p < lb + 8; ++p) {
+ }
+
+#pragma omp parallel
+// expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp parallel master taskloop simd
+ for (int a{0}; a < 10; ++a) {
+ }
+
+ return 0;
+}
+
+// Iterators allowed in openmp for-loops.
+namespace std {
+struct random_access_iterator_tag {};
+template <class Iter>
+struct iterator_traits {
+ typedef typename Iter::difference_type difference_type;
+ typedef typename Iter::iterator_category iterator_category;
+};
+template <class Iter>
+typename iterator_traits<Iter>::difference_type
+distance(Iter first, Iter last) { return first - last; }
+}
+class Iter0 {
+public:
+ Iter0() {}
+ Iter0(const Iter0 &) {}
+ Iter0 operator++() { return *this; }
+ Iter0 operator--() { return *this; }
+ bool operator<(Iter0 a) { return true; }
+};
+// expected-note@+2 {{candidate function not viable: no known conversion from 'GoodIter' to 'Iter0' for 1st argument}}
+// expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter1' to 'Iter0' for 1st argument}}
+int operator-(Iter0 a, Iter0 b) { return 0; }
+class Iter1 {
+public:
+ Iter1(float f = 0.0f, double d = 0.0) {}
+ Iter1(const Iter1 &) {}
+ Iter1 operator++() { return *this; }
+ Iter1 operator--() { return *this; }
+ bool operator<(Iter1 a) { return true; }
+ bool operator>=(Iter1 a) { return false; }
+};
+class GoodIter {
+public:
+ GoodIter() {}
+ GoodIter(const GoodIter &) {}
+ GoodIter(int fst, int snd) {}
+ GoodIter &operator=(const GoodIter &that) { return *this; }
+ GoodIter &operator=(const Iter0 &that) { return *this; }
+ GoodIter &operator+=(int x) { return *this; }
+ GoodIter &operator-=(int x) { return *this; }
+ explicit GoodIter(void *) {}
+ GoodIter operator++() { return *this; }
+ GoodIter operator--() { return *this; }
+ bool operator!() { return true; }
+ bool operator<(GoodIter a) { return true; }
+ bool operator<=(GoodIter a) { return true; }
+ bool operator>=(GoodIter a) { return false; }
+ typedef int difference_type;
+ typedef std::random_access_iterator_tag iterator_category;
+};
+// expected-note@+2 {{candidate function not viable: no known conversion from 'const Iter0' to 'GoodIter' for 2nd argument}}
+// expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter1' to 'GoodIter' for 1st argument}}
+int operator-(GoodIter a, GoodIter b) { return 0; }
+// expected-note@+1 3 {{candidate function not viable: requires single argument 'a', but 2 arguments were provided}}
+GoodIter operator-(GoodIter a) { return a; }
+// expected-note@+2 {{candidate function not viable: no known conversion from 'const Iter0' to 'int' for 2nd argument}}
+// expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter1' to 'GoodIter' for 1st argument}}
+GoodIter operator-(GoodIter a, int v) { return GoodIter(); }
+// expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter0' to 'GoodIter' for 1st argument}}
+GoodIter operator+(GoodIter a, int v) { return GoodIter(); }
+// expected-note@+2 {{candidate function not viable: no known conversion from 'GoodIter' to 'int' for 1st argument}}
+// expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter1' to 'int' for 1st argument}}
+GoodIter operator-(int v, GoodIter a) { return GoodIter(); }
+// expected-note@+1 2 {{candidate function not viable: no known conversion from 'Iter0' to 'int' for 1st argument}}
+GoodIter operator+(int v, GoodIter a) { return GoodIter(); }
+
+int test_with_random_access_iterator() {
+ GoodIter begin, end;
+ Iter0 begin0, end0;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd
+ for (GoodIter I = begin; I < end; ++I)
+ ++I;
+#pragma omp parallel
+// expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp parallel master taskloop simd
+ for (GoodIter &I = begin; I < end; ++I)
+ ++I;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd
+ for (GoodIter I = begin; I >= end; --I)
+ ++I;
+#pragma omp parallel
+// expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp parallel master taskloop simd
+ for (GoodIter I(begin); I < end; ++I)
+ ++I;
+#pragma omp parallel
+// expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp parallel master taskloop simd
+ for (GoodIter I(nullptr); I < end; ++I)
+ ++I;
+#pragma omp parallel
+// expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp parallel master taskloop simd
+ for (GoodIter I(0); I < end; ++I)
+ ++I;
+#pragma omp parallel
+// expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp parallel master taskloop simd
+ for (GoodIter I(1, 2); I < end; ++I)
+ ++I;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd
+ for (begin = GoodIter(0); begin < end; ++begin)
+ ++begin;
+// expected-error@+4 {{invalid operands to binary expression ('GoodIter' and 'const Iter0')}}
+// expected-error@+3 {{could not calculate number of iterations calling 'operator-' with upper and lower loop bounds}}
+#pragma omp parallel
+#pragma omp parallel master taskloop simd
+ for (begin = begin0; begin < end; ++begin)
+ ++begin;
+#pragma omp parallel
+// expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp parallel master taskloop simd
+ for (++begin; begin < end; ++begin)
+ ++begin;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd
+ for (begin = end; begin < end; ++begin)
+ ++begin;
+#pragma omp parallel
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
+#pragma omp parallel master taskloop simd
+ for (GoodIter I = begin; I - I; ++I)
+ ++I;
+#pragma omp parallel
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
+#pragma omp parallel master taskloop simd
+ for (GoodIter I = begin; begin < end; ++I)
+ ++I;
+#pragma omp parallel
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
+#pragma omp parallel master taskloop simd
+ for (GoodIter I = begin; !I; ++I)
+ ++I;
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be negative due to this condition}}
+// expected-error@+2 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
+#pragma omp parallel master taskloop simd
+ for (GoodIter I = begin; I >= end; I = I + 1)
+ ++I;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd
+ for (GoodIter I = begin; I >= end; I = I - 1)
+ ++I;
+#pragma omp parallel
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'I'}}
+#pragma omp parallel master taskloop simd
+ for (GoodIter I = begin; I >= end; I = -I)
+ ++I;
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be negative due to this condition}}
+// expected-error@+2 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
+#pragma omp parallel master taskloop simd
+ for (GoodIter I = begin; I >= end; I = 2 + I)
+ ++I;
+#pragma omp parallel
+// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'I'}}
+#pragma omp parallel master taskloop simd
+ for (GoodIter I = begin; I >= end; I = 2 - I)
+ ++I;
+// In the following example, we cannot update the loop variable using '+='
+// expected-error@+3 {{invalid operands to binary expression ('Iter0' and 'int')}}
+#pragma omp parallel
+#pragma omp parallel master taskloop simd
+ for (Iter0 I = begin0; I < end0; ++I)
+ ++I;
+#pragma omp parallel
+// Initializer is constructor without params.
+// expected-error@+3 {{invalid operands to binary expression ('Iter0' and 'int')}}
+// expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp parallel master taskloop simd
+ for (Iter0 I; I < end0; ++I)
+ ++I;
+ Iter1 begin1, end1;
+// expected-error@+4 {{invalid operands to binary expression ('Iter1' and 'Iter1')}}
+// expected-error@+3 {{could not calculate number of iterations calling 'operator-' with upper and lower loop bounds}}
+#pragma omp parallel
+#pragma omp parallel master taskloop simd
+ for (Iter1 I = begin1; I < end1; ++I)
+ ++I;
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be negative due to this condition}}
+// expected-error@+2 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
+#pragma omp parallel master taskloop simd
+ for (Iter1 I = begin1; I >= end1; ++I)
+ ++I;
+#pragma omp parallel
+// expected-error@+5 {{invalid operands to binary expression ('Iter1' and 'float')}}
+// expected-error@+4 {{could not calculate number of iterations calling 'operator-' with upper and lower loop bounds}}
+// Initializer is constructor with all default params.
+// expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+#pragma omp parallel master taskloop simd
+ for (Iter1 I; I < end1; ++I) {
+ }
+ return 0;
+}
+
+template <typename IT, int ST>
+class TC {
+public:
+ int dotest_lt(IT begin, IT end) {
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be positive due to this condition}}
+// expected-error@+2 {{increment expression must cause 'I' to increase on each iteration of OpenMP for loop}}
+#pragma omp parallel master taskloop simd
+ for (IT I = begin; I < end; I = I + ST) {
+ ++I;
+ }
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be positive due to this condition}}
+// expected-error@+2 {{increment expression must cause 'I' to increase on each iteration of OpenMP for loop}}
+#pragma omp parallel master taskloop simd
+ for (IT I = begin; I <= end; I += ST) {
+ ++I;
+ }
+#pragma omp parallel
+#pragma omp parallel master taskloop simd
+ for (IT I = begin; I < end; ++I) {
+ ++I;
+ }
+ }
+
+ static IT step() {
+ return IT(ST);
+ }
+};
+template <typename IT, int ST = 0>
+int dotest_gt(IT begin, IT end) {
+#pragma omp parallel
+// expected-note@+3 2 {{loop step is expected to be negative due to this condition}}
+// expected-error@+2 2 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
+#pragma omp parallel master taskloop simd
+ for (IT I = begin; I >= end; I = I + ST) {
+ ++I;
+ }
+#pragma omp parallel
+// expected-note@+3 2 {{loop step is expected to be negative due to this condition}}
+// expected-error@+2 2 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
+#pragma omp parallel master taskloop simd
+ for (IT I = begin; I >= end; I += ST) {
+ ++I;
+ }
+
+#pragma omp parallel
+// expected-note@+3 {{loop step is expected to be negative due to this condition}}
+// expected-error@+2 {{increment expression must cause 'I' to decrease on each iteration of OpenMP for loop}}
+#pragma omp parallel master taskloop simd
+ for (IT I = begin; I >= end; ++I) {
+ ++I;
+ }
+
+#pragma omp parallel
+#pragma omp parallel master taskloop simd
+ for (IT I = begin; I < end; I += TC<int, ST>::step()) {
+ ++I;
+ }
+}
+
+void test_with_template() {
+ GoodIter begin, end;
+ TC<GoodIter, 100> t1;
+ TC<GoodIter, -100> t2;
+ t1.dotest_lt(begin, end);
+ t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC<GoodIter, -100>::dotest_lt' requested here}}
+ dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt<GoodIter, 0>' requested here}}
+ dotest_gt<unsigned, 10>(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt<unsigned int, 10>' requested here}}
+}
+
+void test_loop_break() {
+ const int N = 100;
+ float a[N], b[N], c[N];
+#pragma omp parallel
+#pragma omp parallel master taskloop simd
+ for (int i = 0; i < 10; i++) {
+ c[i] = a[i] + b[i];
+ for (int j = 0; j < 10; ++j) {
+ if (a[i] > b[j])
+ break; // OK in nested loop
+ }
+ switch (i) {
+ case 1:
+ b[i]++;
+ break;
+ default:
+ break;
+ }
+ if (c[i] > 10)
+ break; // expected-error {{'break' statement cannot be used in OpenMP for loop}}
+
+ if (c[i] > 11)
+ break; // expected-error {{'break' statement cannot be used in OpenMP for loop}}
+ }
+
+#pragma omp parallel
+#pragma omp parallel master taskloop simd
+ for (int i = 0; i < 10; i++) {
+ for (int j = 0; j < 10; j++) {
+ c[i] = a[i] + b[i];
+ if (c[i] > 10) {
+ if (c[i] < 20) {
+ break; // OK
+ }
+ }
+ }
+ }
+}
+
+void test_loop_eh() {
+ const int N = 100;
+ float a[N], b[N], c[N];
+#pragma omp parallel
+#pragma omp parallel master taskloop simd
+ for (int i = 0; i < 10; i++) {
+ c[i] = a[i] + b[i];
+ try { // expected-error {{'try' statement cannot be used in OpenMP simd region}}
+ for (int j = 0; j < 10; ++j) {
+ if (a[i] > b[j])
+ throw a[i]; // expected-error {{'throw' statement cannot be used in OpenMP simd region}}
+ }
+ throw a[i]; // expected-error {{'throw' statement cannot be used in OpenMP simd region}}
+ } catch (float f) {
+ if (f > 0.1)
+ throw a[i]; // expected-error {{'throw' statement cannot be used in OpenMP simd region}}
+ return; // expected-error {{cannot return from OpenMP region}}
+ }
+ switch (i) {
+ case 1:
+ b[i]++;
+ break;
+ default:
+ break;
+ }
+ for (int j = 0; j < 10; j++) {
+ if (c[i] > 10)
+ throw c[i]; // expected-error {{'throw' statement cannot be used in OpenMP simd region}}
+ }
+ }
+ if (c[9] > 10)
+ throw c[9]; // OK
+
+#pragma omp parallel
+#pragma omp parallel master taskloop simd
+ for (int i = 0; i < 10; ++i) {
+ struct S {
+ void g() { throw 0; }
+ };
+ }
+}
+
+void test_loop_firstprivate_lastprivate() {
+ S s(4);
+ int c;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate(s) firstprivate(s)
+ for (int i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel master taskloop simd if(c) default(none) // expected-error {{variable 'c' must have explicitly specified data sharing attributes}} expected-note {{explicit data sharing attribute requested here}}
+ for (int i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel master taskloop simd if(taskloop:c) default(none) // expected-error {{variable 'c' must have explicitly specified data sharing attributes}} expected-note {{explicit data sharing attribute requested here}}
+ for (int i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel master taskloop simd if(parallel:c) default(none)
+ for (int i = 0; i < 16; ++i)
+ ;
+}
+
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_misc_messages.c b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_misc_messages.c
new file mode 100644
index 0000000..1553f88
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_misc_messages.c
@@ -0,0 +1,470 @@
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=45 -verify=expected,omp45 -triple x86_64-unknown-unknown %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -verify=expected,omp50 -triple x86_64-unknown-unknown %s -Wuninitialized
+
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=45 -verify=expected,omp45 -triple x86_64-unknown-unknown %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -verify=expected,omp50 -triple x86_64-unknown-unknown %s -Wuninitialized
+
+void xxx(int argc) {
+ int x; // expected-note {{initialize the variable 'x' to silence this warning}}
+#pragma omp parallel master taskloop simd
+ for (int i = 0; i < 10; ++i)
+ argc = x; // expected-warning {{variable 'x' is uninitialized when used here}}
+}
+
+// expected-error@+1 {{unexpected OpenMP directive '#pragma omp parallel master taskloop simd'}}
+#pragma omp parallel master taskloop simd
+
+// expected-error@+1 {{unexpected OpenMP directive '#pragma omp parallel master taskloop simd'}}
+#pragma omp parallel master taskloop simd foo
+
+void test_no_clause() {
+ int i;
+#pragma omp parallel master taskloop simd
+ for (i = 0; i < 16; ++i)
+ ;
+
+// expected-error@+2 {{statement after '#pragma omp parallel master taskloop simd' must be a for loop}}
+#pragma omp parallel master taskloop simd
+ ++i;
+}
+
+void test_branch_protected_scope() {
+ int i = 0;
+L1:
+ ++i;
+
+ int x[24];
+
+#pragma omp parallel
+#pragma omp parallel master taskloop simd
+ for (i = 0; i < 16; ++i) {
+ if (i == 5)
+ goto L1; // expected-error {{use of undeclared label 'L1'}}
+ else if (i == 6)
+ return; // expected-error {{cannot return from OpenMP region}}
+ else if (i == 7)
+ goto L2;
+ else if (i == 8) {
+ L2:
+ x[i]++;
+ }
+ }
+
+ if (x[0] == 0)
+ goto L2; // expected-error {{use of undeclared label 'L2'}}
+ else if (x[1] == 1)
+ goto L1;
+}
+
+void test_invalid_clause() {
+ int i, a;
+// expected-warning@+1 {{extra tokens at the end of '#pragma omp parallel master taskloop simd' are ignored}}
+#pragma omp parallel master taskloop simd foo bar
+ for (i = 0; i < 16; ++i)
+ ;
+// expected-error@+1 {{directive '#pragma omp parallel master taskloop simd' cannot contain more than one 'nogroup' clause}}
+#pragma omp parallel master taskloop simd nogroup nogroup
+ for (i = 0; i < 16; ++i)
+ ;
+// expected-error@+1 {{unexpected OpenMP clause 'in_reduction' in directive '#pragma omp parallel master taskloop simd'}}
+#pragma omp parallel master taskloop simd in_reduction(+:a)
+ for (i = 0; i < 16; ++i)
+ ;
+}
+
+void test_non_identifiers() {
+ int i, x;
+
+#pragma omp parallel
+// expected-warning@+1 {{extra tokens at the end of '#pragma omp parallel master taskloop simd' are ignored}}
+#pragma omp parallel master taskloop simd;
+ for (i = 0; i < 16; ++i)
+ ;
+// expected-warning@+2 {{extra tokens at the end of '#pragma omp parallel master taskloop simd' are ignored}}
+#pragma omp parallel
+#pragma omp parallel master taskloop simd linear(x);
+ for (i = 0; i < 16; ++i)
+ ;
+
+#pragma omp parallel
+// expected-warning@+1 {{extra tokens at the end of '#pragma omp parallel master taskloop simd' are ignored}}
+#pragma omp parallel master taskloop simd private(x);
+ for (i = 0; i < 16; ++i)
+ ;
+
+#pragma omp parallel
+// expected-warning@+1 {{extra tokens at the end of '#pragma omp parallel master taskloop simd' are ignored}}
+#pragma omp parallel master taskloop simd, private(x);
+ for (i = 0; i < 16; ++i)
+ ;
+}
+
+extern int foo();
+
+void test_collapse() {
+ int i;
+#pragma omp parallel
+// expected-error@+1 {{expected '('}}
+#pragma omp parallel master taskloop simd collapse
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp parallel master taskloop simd collapse(
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected expression}}
+#pragma omp parallel master taskloop simd collapse()
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp parallel master taskloop simd collapse(,
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp parallel master taskloop simd collapse(, )
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-warning@+2 {{extra tokens at the end of '#pragma omp parallel master taskloop simd' are ignored}}
+// expected-error@+1 {{expected '('}}
+#pragma omp parallel master taskloop simd collapse 4)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}}
+// expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}}
+#pragma omp parallel master taskloop simd collapse(4
+ for (i = 0; i < 16; ++i)
+ ; // expected-error {{expected 4 for loops after '#pragma omp parallel master taskloop simd', but found only 1}}
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}}
+// expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}}
+#pragma omp parallel master taskloop simd collapse(4,
+ for (i = 0; i < 16; ++i)
+ ; // expected-error {{expected 4 for loops after '#pragma omp parallel master taskloop simd', but found only 1}}
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}}
+// expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}}
+#pragma omp parallel master taskloop simd collapse(4, )
+ for (i = 0; i < 16; ++i)
+ ; // expected-error {{expected 4 for loops after '#pragma omp parallel master taskloop simd', but found only 1}}
+#pragma omp parallel
+// expected-note@+1 {{as specified in 'collapse' clause}}
+#pragma omp parallel master taskloop simd collapse(4)
+ for (i = 0; i < 16; ++i)
+ ; // expected-error {{expected 4 for loops after '#pragma omp parallel master taskloop simd', but found only 1}}
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}}
+// expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}}
+#pragma omp parallel master taskloop simd collapse(4 4)
+ for (i = 0; i < 16; ++i)
+ ; // expected-error {{expected 4 for loops after '#pragma omp parallel master taskloop simd', but found only 1}}
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}}
+// expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}}
+#pragma omp parallel master taskloop simd collapse(4, , 4)
+ for (i = 0; i < 16; ++i)
+ ; // expected-error {{expected 4 for loops after '#pragma omp parallel master taskloop simd', but found only 1}}
+#pragma omp parallel
+#pragma omp parallel master taskloop simd collapse(4)
+ for (int i1 = 0; i1 < 16; ++i1)
+ for (int i2 = 0; i2 < 16; ++i2)
+ for (int i3 = 0; i3 < 16; ++i3)
+ for (int i4 = 0; i4 < 16; ++i4)
+ foo();
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}}
+// expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}}
+#pragma omp parallel master taskloop simd collapse(4, 8)
+ for (i = 0; i < 16; ++i)
+ ; // expected-error {{expected 4 for loops after '#pragma omp parallel master taskloop simd', but found only 1}}
+#pragma omp parallel
+// expected-error@+1 {{expression is not an integer constant expression}}
+#pragma omp parallel master taskloop simd collapse(2.5)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expression is not an integer constant expression}}
+#pragma omp parallel master taskloop simd collapse(foo())
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}}
+#pragma omp parallel master taskloop simd collapse(-5)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}}
+#pragma omp parallel master taskloop simd collapse(0)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}}
+#pragma omp parallel master taskloop simd collapse(5 - 5)
+ for (i = 0; i < 16; ++i)
+ ;
+}
+
+void test_private() {
+ int i;
+#pragma omp parallel
+// expected-error@+2 {{expected expression}}
+// expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp parallel master taskloop simd private(
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
+// expected-error@+1 2 {{expected expression}}
+#pragma omp parallel master taskloop simd private(,
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 2 {{expected expression}}
+#pragma omp parallel master taskloop simd private(, )
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected expression}}
+#pragma omp parallel master taskloop simd private()
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected expression}}
+#pragma omp parallel master taskloop simd private(int)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected variable name}}
+#pragma omp parallel master taskloop simd private(0)
+ for (i = 0; i < 16; ++i)
+ ;
+
+ int x, y, z;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd private(x)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd private(x, y)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd private(x, y, z)
+ for (i = 0; i < 16; ++i) {
+ x = y * i + z;
+ }
+}
+
+void test_lastprivate() {
+ int i;
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
+// expected-error@+1 {{expected expression}}
+#pragma omp parallel master taskloop simd lastprivate(
+ for (i = 0; i < 16; ++i)
+ ;
+
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
+// expected-error@+1 2 {{expected expression}}
+#pragma omp parallel master taskloop simd lastprivate(,
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 2 {{expected expression}}
+#pragma omp parallel master taskloop simd lastprivate(, )
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected expression}}
+#pragma omp parallel master taskloop simd lastprivate()
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected expression}}
+#pragma omp parallel master taskloop simd lastprivate(int)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected variable name}}
+#pragma omp parallel master taskloop simd lastprivate(0)
+ for (i = 0; i < 16; ++i)
+ ;
+
+ int x, y, z;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate(x)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate(x, y)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate(x, y, z)
+ for (i = 0; i < 16; ++i)
+ ;
+}
+
+void test_firstprivate() {
+ int i;
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
+// expected-error@+1 {{expected expression}}
+#pragma omp parallel master taskloop simd firstprivate(
+ for (i = 0; i < 16; ++i)
+ ;
+
+#pragma omp parallel
+// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
+// expected-error@+1 2 {{expected expression}}
+#pragma omp parallel master taskloop simd firstprivate(,
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 2 {{expected expression}}
+#pragma omp parallel master taskloop simd firstprivate(, )
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected expression}}
+#pragma omp parallel master taskloop simd firstprivate()
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected expression}}
+#pragma omp parallel master taskloop simd firstprivate(int)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+// expected-error@+1 {{expected variable name}}
+#pragma omp parallel master taskloop simd firstprivate(0)
+ for (i = 0; i < 16; ++i)
+ ;
+
+ int x, y, z;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate(x) firstprivate(x)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate(x, y) firstprivate(x, y)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp parallel
+#pragma omp parallel master taskloop simd lastprivate(x, y, z) firstprivate(x, y, z)
+ for (i = 0; i < 16; ++i)
+ ;
+}
+
+void test_loop_messages() {
+ float a[100], b[100], c[100];
+#pragma omp parallel
+// expected-error@+2 {{variable must be of integer or pointer type}}
+#pragma omp parallel master taskloop simd
+ for (float fi = 0; fi < 10.0; fi++) {
+ c[(int)fi] = a[(int)fi] + b[(int)fi];
+ }
+#pragma omp parallel
+// expected-error@+2 {{variable must be of integer or pointer type}}
+#pragma omp parallel master taskloop simd
+ for (double fi = 0; fi < 10.0; fi++) {
+ c[(int)fi] = a[(int)fi] + b[(int)fi];
+ }
+
+ // expected-warning@+2 {{OpenMP loop iteration variable cannot have more than 64 bits size and will be narrowed}}
+ #pragma omp parallel master taskloop simd
+ for (__int128 ii = 0; ii < 10; ii++) {
+ c[ii] = a[ii] + b[ii];
+ }
+}
+
+void test_nontemporal() {
+ int i;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp parallel master taskloop simd'}} expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp parallel master taskloop simd nontemporal(
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp parallel master taskloop simd'}} expected-error@+1 2 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp parallel master taskloop simd nontemporal(,
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp parallel master taskloop simd'}} expected-error@+1 2 {{expected expression}}
+#pragma omp parallel master taskloop simd nontemporal(, )
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp parallel master taskloop simd'}} expected-error@+1 {{expected expression}}
+#pragma omp parallel master taskloop simd nontemporal()
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp parallel master taskloop simd'}} expected-error@+1 {{expected expression}}
+#pragma omp parallel master taskloop simd nontemporal(int)
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp parallel master taskloop simd'}} omp50-error@+1 {{expected variable name}}
+#pragma omp parallel master taskloop simd nontemporal(0)
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp parallel master taskloop simd'}} expected-error@+1 {{use of undeclared identifier 'x'}}
+#pragma omp parallel master taskloop simd nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+// expected-error@+2 {{use of undeclared identifier 'x'}}
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp parallel master taskloop simd'}} expected-error@+1 {{use of undeclared identifier 'y'}}
+#pragma omp parallel master taskloop simd nontemporal(x, y)
+ for (i = 0; i < 16; ++i)
+ ;
+// expected-error@+3 {{use of undeclared identifier 'x'}}
+// expected-error@+2 {{use of undeclared identifier 'y'}}
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp parallel master taskloop simd'}} expected-error@+1 {{use of undeclared identifier 'z'}}
+#pragma omp parallel master taskloop simd nontemporal(x, y, z)
+ for (i = 0; i < 16; ++i)
+ ;
+
+ int x, y;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp parallel master taskloop simd'}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp parallel master taskloop simd nontemporal(x :)
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp parallel master taskloop simd'}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}}
+#pragma omp parallel master taskloop simd nontemporal(x :, )
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp50-note@+2 {{defined as nontemporal}}
+// omp45-error@+1 2 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp parallel master taskloop simd'}} omp50-error@+1 {{a variable cannot appear in more than one nontemporal clause}}
+#pragma omp parallel master taskloop simd nontemporal(x) nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp parallel master taskloop simd'}}
+#pragma omp parallel master taskloop simd private(x) nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp parallel master taskloop simd'}}
+#pragma omp parallel master taskloop simd nontemporal(x) private(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp parallel master taskloop simd'}} expected-note@+1 {{to match this '('}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}} expected-error@+1 {{expected ')'}}
+#pragma omp parallel master taskloop simd nontemporal(x, y : 0)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp parallel master taskloop simd'}}
+#pragma omp parallel master taskloop simd nontemporal(x) lastprivate(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp parallel master taskloop simd'}}
+#pragma omp parallel master taskloop simd lastprivate(x) nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+}
+
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_num_tasks_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_num_tasks_messages.cpp
new file mode 100644
index 0000000..fbdc10a
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_num_tasks_messages.cpp
@@ -0,0 +1,103 @@
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+struct S1; // expected-note {{declared here}}
+
+template <class T, class S> // expected-note {{declared here}}
+int tmain(T argc, S **argv) {
+ T z;
+ #pragma omp parallel master taskloop simd num_tasks // expected-error {{expected '(' after 'num_tasks'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd num_tasks ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd num_tasks () // expected-error {{expected expression}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd num_tasks (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd num_tasks (argc)) // expected-warning {{extra tokens at the end of '#pragma omp parallel master taskloop simd' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd num_tasks (argc > 0 ? argv[1][0] : argv[2][argc] + z)
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd num_tasks (foobool(argc)), num_tasks (true) // expected-error {{directive '#pragma omp parallel master taskloop simd' cannot contain more than one 'num_tasks' clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd num_tasks (S) // expected-error {{'S' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd num_tasks (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd num_tasks(0) // expected-error {{argument to 'num_tasks' clause must be a strictly positive integer value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd num_tasks(-1) // expected-error {{argument to 'num_tasks' clause must be a strictly positive integer value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd num_tasks(argc) grainsize(argc) // expected-error {{'grainsize' and 'num_tasks' clause are mutually exclusive and may not appear on the same directive}} expected-note {{'num_tasks' clause is specified here}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+
+ return 0;
+}
+
+int main(int argc, char **argv) {
+ int z;
+ #pragma omp parallel master taskloop simd num_tasks // expected-error {{expected '(' after 'num_tasks'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd num_tasks ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd num_tasks () // expected-error {{expected expression}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd num_tasks (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd num_tasks (argc)) // expected-warning {{extra tokens at the end of '#pragma omp parallel master taskloop simd' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd num_tasks (argc > 0 ? argv[1][0] : argv[2][argc] - z)
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd num_tasks (foobool(argc)), num_tasks (true) // expected-error {{directive '#pragma omp parallel master taskloop simd' cannot contain more than one 'num_tasks' clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd num_tasks (S1) // expected-error {{'S1' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd num_tasks (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd num_tasks (1 0) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd num_tasks(if(tmain(argc, argv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd num_tasks(0) // expected-error {{argument to 'num_tasks' clause must be a strictly positive integer value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd num_tasks(-1) // expected-error {{argument to 'num_tasks' clause must be a strictly positive integer value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd num_tasks(argc) grainsize(argc) // expected-error {{'grainsize' and 'num_tasks' clause are mutually exclusive and may not appear on the same directive}} expected-note {{'num_tasks' clause is specified here}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+
+ return tmain(argc, argv);
+}
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_priority_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_priority_messages.cpp
new file mode 100644
index 0000000..70ab0bf
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_priority_messages.cpp
@@ -0,0 +1,97 @@
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+struct S1; // expected-note {{declared here}}
+
+template <class T, class S> // expected-note {{declared here}}
+int tmain(T argc, S **argv) {
+ T z;
+ #pragma omp parallel master taskloop simd priority // expected-error {{expected '(' after 'priority'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd priority ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd priority () // expected-error {{expected expression}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd priority (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd priority (argc)) // expected-warning {{extra tokens at the end of '#pragma omp parallel master taskloop simd' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd priority (argc > 0 ? argv[1][0] : argv[2][argc] + z)
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd priority (foobool(argc)), priority (true) // expected-error {{directive '#pragma omp parallel master taskloop simd' cannot contain more than one 'priority' clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd priority (S) // expected-error {{'S' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd priority (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd priority(0)
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd priority(-1) // expected-error {{argument to 'priority' clause must be a non-negative integer value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+
+ return 0;
+}
+
+int main(int argc, char **argv) {
+ int z;
+ #pragma omp parallel master taskloop simd priority // expected-error {{expected '(' after 'priority'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd priority ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd priority () // expected-error {{expected expression}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd priority (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd priority (argc)) // expected-warning {{extra tokens at the end of '#pragma omp parallel master taskloop simd' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd priority (argc > 0 ? argv[1][0] : argv[2][argc] - z)
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd priority (foobool(argc)), priority (true) // expected-error {{directive '#pragma omp parallel master taskloop simd' cannot contain more than one 'priority' clause}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd priority (S1) // expected-error {{'S1' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd priority (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd priority (1 0) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd priority(if(tmain(argc, argv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd priority(0)
+ for (int i = 0; i < 10; ++i)
+ foo();
+ #pragma omp parallel master taskloop simd priority(-1) // expected-error {{argument to 'priority' clause must be a non-negative integer value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+
+ return tmain(argc, argv);
+}
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_private_codegen.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_private_codegen.cpp
new file mode 100644
index 0000000..d3aa734
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_private_codegen.cpp
@@ -0,0 +1,418 @@
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-apple-darwin10 -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=LAMBDA %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=BLOCKS %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DARRAY -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=ARRAY %s
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DARRAY -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
+// expected-no-diagnostics
+
+#ifndef ARRAY
+#ifndef HEADER
+#define HEADER
+
+template <class T>
+struct S {
+ T f;
+ S(T a) : f(a) {}
+ S() : f() {}
+ operator T() { return T(); }
+ ~S() {}
+};
+
+volatile double g;
+
+// CHECK-DAG: [[KMP_TASK_T_TY:%.+]] = type { i8*, i32 (i32, i8*)*, i32, %union{{.+}}, %union{{.+}}, i64, i64, i64, i32, i8* }
+// CHECK-DAG: [[S_DOUBLE_TY:%.+]] = type { double }
+// CHECK-DAG: [[CAP_MAIN_TY:%.+]] = type { i8 }
+// CHECK-DAG: [[PRIVATES_MAIN_TY:%.+]] = type {{.?}}{ [2 x [[S_DOUBLE_TY]]], [[S_DOUBLE_TY]], i32, [2 x i32]
+// CHECK-DAG: [[KMP_TASK_MAIN_TY:%.+]] = type { [[KMP_TASK_T_TY]], [[PRIVATES_MAIN_TY]] }
+// CHECK-DAG: [[S_INT_TY:%.+]] = type { i32 }
+// CHECK-DAG: [[CAP_TMAIN_TY:%.+]] = type { i8 }
+// CHECK-DAG: [[PRIVATES_TMAIN_TY:%.+]] = type { i32, [2 x i32], [2 x [[S_INT_TY]]], [[S_INT_TY]], [104 x i8] }
+// CHECK-DAG: [[KMP_TASK_TMAIN_TY:%.+]] = type { [[KMP_TASK_T_TY]], [{{[0-9]+}} x i8], [[PRIVATES_TMAIN_TY]] }
+template <typename T>
+T tmain() {
+ S<T> test;
+ T t_var __attribute__((aligned(128))) = T();
+ T vec[] = {1, 2};
+ S<T> s_arr[] = {1, 2};
+ S<T> var(3);
+#pragma omp parallel master taskloop simd private(t_var, vec, s_arr, s_arr, var, var)
+ for (int i = 0; i < 10; ++i) {
+ vec[0] = t_var;
+ s_arr[0] = var;
+ }
+ return T();
+}
+
+int main() {
+ static int sivar;
+#ifdef LAMBDA
+ // LAMBDA: [[G:@.+]] = global double
+ // LAMBDA-LABEL: @main
+ // LAMBDA: call{{( x86_thiscallcc)?}} void [[OUTER_LAMBDA:@.+]](
+ [&]() {
+ // LAMBDA: define{{.*}} internal{{.*}} void [[OUTER_LAMBDA]](
+ // LAMBDA: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc(%{{[^ ]+}} @{{[^,]+}}, i32 %{{[^,]+}}, i32 1, i64 96, i64 1, i32 (i32, i8*)* bitcast (i32 (i32, %{{[^*]+}}*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+// LAMBDA: [[PRIVATES:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i{{.+}} 0, i{{.+}} 1
+// LAMBDA: call void @__kmpc_taskloop(%{{.+}}* @{{.+}}, i32 %{{.+}}, i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* null)
+// LAMBDA: ret
+#pragma omp parallel master taskloop simd private(g, sivar)
+ for (int i = 0; i < 10; ++i) {
+ // LAMBDA: define {{.+}} void [[INNER_LAMBDA:@.+]](%{{.+}}* [[ARG_PTR:%.+]])
+ // LAMBDA: store %{{.+}}* [[ARG_PTR]], %{{.+}}** [[ARG_PTR_REF:%.+]],
+ // LAMBDA: [[ARG_PTR:%.+]] = load %{{.+}}*, %{{.+}}** [[ARG_PTR_REF]]
+ // LAMBDA: [[G_PTR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[ARG_PTR]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+ // LAMBDA: [[G_REF:%.+]] = load double*, double** [[G_PTR_REF]]
+ // LAMBDA: store double 2.0{{.+}}, double* [[G_REF]]
+ // LAMBDA: [[SIVAR_PTR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[ARG_PTR]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
+ // LAMBDA: [[SIVAR_REF:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** [[SIVAR_PTR_REF]]
+ // LAMBDA: store i{{[0-9]+}} 3, i{{[0-9]+}}* [[SIVAR_REF]]
+
+ // LAMBDA: define internal i32 [[TASK_ENTRY]](i32 %0, %{{.+}}* noalias %1)
+ g = 1;
+ sivar = 2;
+ // LAMBDA: store double 1.0{{.+}}, double* %{{.+}},
+ // LAMBDA: store i{{[0-9]+}} 2, i{{[0-9]+}}* %{{.+}},
+ // LAMBDA: call void [[INNER_LAMBDA]](%
+ // LAMBDA: ret
+ [&]() {
+ g = 2;
+ sivar = 3;
+ }();
+ }
+ }();
+ return 0;
+#elif defined(BLOCKS)
+ // BLOCKS: [[G:@.+]] = global double
+ // BLOCKS-LABEL: @main
+ // BLOCKS: call void {{%.+}}(i8
+ ^{
+ // BLOCKS: define{{.*}} internal{{.*}} void {{.+}}(i8*
+ // BLOCKS: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc(%{{[^ ]+}} @{{[^,]+}}, i32 %{{[^,]+}}, i32 1, i64 96, i64 1, i32 (i32, i8*)* bitcast (i32 (i32, %{{[^*]+}}*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+ // BLOCKS: [[PRIVATES:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i{{.+}} 0, i{{.+}} 1
+ // BLOCKS: call void @__kmpc_taskloop(%{{.+}}* @{{.+}}, i32 %{{.+}}, i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* null)
+ // BLOCKS: ret
+#pragma omp parallel master taskloop simd private(g, sivar)
+ for (int i = 0; i < 10; ++i) {
+ // BLOCKS: define {{.+}} void {{@.+}}(i8*
+ // BLOCKS-NOT: [[G]]{{[[^:word:]]}}
+ // BLOCKS: store double 2.0{{.+}}, double*
+ // BLOCKS-NOT: [[G]]{{[[^:word:]]}}
+ // BLOCKS-NOT: [[SIVAR]]{{[[^:word:]]}}
+ // BLOCKS: store i{{[0-9]+}} 4, i{{[0-9]+}}*
+ // BLOCKS-NOT: [[SIVAR]]{{[[^:word:]]}}
+ // BLOCKS: ret
+
+ // BLOCKS: define internal i32 [[TASK_ENTRY]](i32 %0, %{{.+}}* noalias %1)
+ g = 1;
+ sivar = 3;
+ // BLOCKS: store double 1.0{{.+}}, double* %{{.+}},
+ // BLOCKS-NOT: [[G]]{{[[^:word:]]}}
+ // BLOCKS: store i{{[0-9]+}} 3, i{{[0-9]+}}* %{{.+}},
+ // BLOCKS-NOT: [[SIVAR]]{{[[^:word:]]}}
+ // BLOCKS: call void {{%.+}}(i8
+ ^{
+ g = 2;
+ sivar = 4;
+ }();
+ }
+ }();
+ return 0;
+#else
+ S<double> test;
+ int t_var = 0;
+ int vec[] = {1, 2};
+ S<double> s_arr[] = {1, 2};
+ S<double> var(3);
+#pragma omp parallel master taskloop simd private(var, t_var, s_arr, vec, s_arr, var, sivar)
+ for (int i = 0; i < 10; ++i) {
+ vec[0] = t_var;
+ s_arr[0] = var;
+ sivar = 8;
+ }
+#pragma omp task
+ g+=1;
+ return tmain<int>();
+#endif
+}
+
+// CHECK: define i{{[0-9]+}} @main()
+// CHECK: [[TEST:%.+]] = alloca [[S_DOUBLE_TY]],
+// CHECK: [[T_VAR_ADDR:%.+]] = alloca i32,
+// CHECK: [[VEC_ADDR:%.+]] = alloca [2 x i32],
+// CHECK: [[S_ARR_ADDR:%.+]] = alloca [2 x [[S_DOUBLE_TY]]],
+// CHECK: [[VAR_ADDR:%.+]] = alloca [[S_DOUBLE_TY]],
+
+// CHECK: call {{.*}} [[S_DOUBLE_TY_DEF_CONSTR:@.+]]([[S_DOUBLE_TY]]* [[TEST]])
+
+// CHECK: [[RES:%.+]] = call {{.*}}i32 @__kmpc_master(
+// CHECK-NEXT: [[IS_MASTER:%.+]] = icmp ne i32 [[RES]], 0
+// CHECK-NEXT: br i1 [[IS_MASTER]], label {{%?}}[[THEN:.+]], label {{%?}}[[EXIT:.+]]
+// CHECK: [[THEN]]
+// Do not store original variables in capture struct.
+// CHECK-NOT: getelementptr inbounds [[CAP_MAIN_TY]],
+
+// Allocate task.
+// Returns struct kmp_task_t {
+// [[KMP_TASK_T_TY]] task_data;
+// [[KMP_TASK_MAIN_TY]] privates;
+// };
+// CHECK: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc([[LOC:%.+]], i32 [[GTID:%.+]], i32 9, i64 120, i64 1, i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_MAIN_TY]]*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+// CHECK: [[RES_KMP_TASK:%.+]] = bitcast i8* [[RES]] to [[KMP_TASK_MAIN_TY]]*
+
+// CHECK: [[TASK:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// Initialize kmp_task_t->privates with default values (no init for simple types, default constructors for classes).
+// Also copy address of private copy to the corresponding shareds reference.
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
+
+// Constructors for s_arr and var.
+// a_arr;
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+// CHECK: getelementptr inbounds [2 x [[S_DOUBLE_TY]]], [2 x [[S_DOUBLE_TY]]]* [[PRIVATE_S_ARR_REF]], i{{.+}} 0, i{{.+}} 0
+// CHECK: getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i{{.+}} 2
+// CHECK: call void [[S_DOUBLE_TY_DEF_CONSTR]]([[S_DOUBLE_TY]]* [[S_ARR_CUR:%.+]])
+// CHECK: getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* [[S_ARR_CUR]], i{{.+}} 1
+// CHECK: icmp eq
+// CHECK: br i1
+
+// var;
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
+// CHECK: call void [[S_DOUBLE_TY_DEF_CONSTR]]([[S_DOUBLE_TY]]* [[PRIVATE_VAR_REF:%.+]])
+
+// Provide pointer to destructor function, which will destroy private variables at the end of the task.
+// CHECK: [[DESTRUCTORS_REF:%.+]] = getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* [[TASK]], i{{.+}} 0, i{{.+}} 3
+// CHECK: [[DESTRUCTORS_PTR:%.+]] = bitcast %union{{.+}}* [[DESTRUCTORS_REF]] to i32 (i32, i8*)**
+// CHECK: store i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_MAIN_TY]]*)* [[DESTRUCTORS:@.+]] to i32 (i32, i8*)*), i32 (i32, i8*)** [[DESTRUCTORS_PTR]],
+
+// Start task.
+// CHECK: call void @__kmpc_taskloop([[LOC]], i32 [[GTID]], i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* bitcast (void ([[KMP_TASK_MAIN_TY]]*, [[KMP_TASK_MAIN_TY]]*, i32)* [[MAIN_DUP:@.+]] to i8*))
+// CHECK: call {{.*}}void @__kmpc_end_master(
+// CHECK-NEXT: br label {{%?}}[[EXIT]]
+// CHECK: [[EXIT]]
+
+// No destructors must be called for private copies of s_arr and var.
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+//
+
+// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_MAIN_TY]]* noalias %0, [[S_DOUBLE_TY]]** noalias %1, i32** noalias %2, [2 x [[S_DOUBLE_TY]]]** noalias %3, [2 x i32]** noalias %4, i32** noalias %5)
+// CHECK: [[PRIVATES:%.+]] = load [[PRIVATES_MAIN_TY]]*, [[PRIVATES_MAIN_TY]]**
+// CHECK: [[PRIV_S_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 0
+// CHECK: [[ARG3:%.+]] = load [2 x [[S_DOUBLE_TY]]]**, [2 x [[S_DOUBLE_TY]]]*** %{{.+}},
+// CHECK: store [2 x [[S_DOUBLE_TY]]]* [[PRIV_S_VAR]], [2 x [[S_DOUBLE_TY]]]** [[ARG3]],
+// CHECK: [[PRIV_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 1
+// CHECK: [[ARG1:%.+]] = load [[S_DOUBLE_TY]]**, [[S_DOUBLE_TY]]*** {{.+}},
+// CHECK: store [[S_DOUBLE_TY]]* [[PRIV_VAR]], [[S_DOUBLE_TY]]** [[ARG1]],
+// CHECK: [[PRIV_T_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 2
+// CHECK: [[ARG2:%.+]] = load i32**, i32*** %{{.+}},
+// CHECK: store i32* [[PRIV_T_VAR]], i32** [[ARG2]],
+// CHECK: [[PRIV_VEC:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 3
+// CHECK: [[ARG4:%.+]] = load [2 x i32]**, [2 x i32]*** %{{.+}},
+// CHECK: store [2 x i32]* [[PRIV_VEC]], [2 x i32]** [[ARG4]],
+// CHECK: ret void
+
+// CHECK: define internal i32 [[TASK_ENTRY]](i32 %0, [[KMP_TASK_MAIN_TY]]* noalias %1)
+
+// CHECK: [[PRIV_VAR_ADDR:%.+]] = alloca [[S_DOUBLE_TY]]*,
+// CHECK: [[PRIV_T_VAR_ADDR:%.+]] = alloca i32*,
+// CHECK: [[PRIV_S_ARR_ADDR:%.+]] = alloca [2 x [[S_DOUBLE_TY]]]*,
+// CHECK: [[PRIV_VEC_ADDR:%.+]] = alloca [2 x i32]*,
+// CHECK: [[PRIV_SIVAR_ADDR:%.+]] = alloca i32*,
+// CHECK: store void (i8*, ...)* bitcast (void ([[PRIVATES_MAIN_TY]]*, [[S_DOUBLE_TY]]**, i32**, [2 x [[S_DOUBLE_TY]]]**, [2 x i32]**, i32**)* [[PRIVATES_MAP_FN]] to void (i8*, ...)*), void (i8*, ...)** [[MAP_FN_ADDR:%.+]],
+// CHECK: [[MAP_FN:%.+]] = load void (i8*, ...)*, void (i8*, ...)** [[MAP_FN_ADDR]],
+// CHECK: call void (i8*, ...) [[MAP_FN]](i8* %{{.+}}, [[S_DOUBLE_TY]]** [[PRIV_VAR_ADDR]], i32** [[PRIV_T_VAR_ADDR]], [2 x [[S_DOUBLE_TY]]]** [[PRIV_S_ARR_ADDR]], [2 x i32]** [[PRIV_VEC_ADDR]], i32** [[PRIV_SIVAR_ADDR]])
+// CHECK: [[PRIV_VAR:%.+]] = load [[S_DOUBLE_TY]]*, [[S_DOUBLE_TY]]** [[PRIV_VAR_ADDR]],
+// CHECK: [[PRIV_T_VAR:%.+]] = load i32*, i32** [[PRIV_T_VAR_ADDR]],
+// CHECK: [[PRIV_S_ARR:%.+]] = load [2 x [[S_DOUBLE_TY]]]*, [2 x [[S_DOUBLE_TY]]]** [[PRIV_S_ARR_ADDR]],
+// CHECK: [[PRIV_VEC:%.+]] = load [2 x i32]*, [2 x i32]** [[PRIV_VEC_ADDR]],
+// CHECK: [[PRIV_SIVAR:%.+]] = load i32*, i32** [[PRIV_SIVAR_ADDR]],
+
+// Privates actually are used.
+// CHECK-DAG: [[PRIV_VAR]]
+// CHECK-DAG: [[PRIV_T_VAR]]
+// CHECK-DAG: [[PRIV_S_ARR]]
+// CHECK-DAG: [[PRIV_VEC]]
+// CHECK_DAG: [[PRIV_SIVAR]]
+
+// CHECK: ret
+
+// CHECK: define internal void [[MAIN_DUP]]([[KMP_TASK_MAIN_TY]]* %0, [[KMP_TASK_MAIN_TY]]* %1, i32 %2)
+// CHECK: getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* %{{.+}}, i32 0, i32 1
+// CHECK: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr inbounds [2 x [[S_DOUBLE_TY]]], [2 x [[S_DOUBLE_TY]]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i64 2
+// CHECK: br label %
+
+// CHECK: phi [[S_DOUBLE_TY]]*
+// CHECK: call {{.*}} [[S_DOUBLE_TY_DEF_CONSTR]]([[S_DOUBLE_TY]]*
+// CHECK: getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i64 1
+// CHECK: icmp eq [[S_DOUBLE_TY]]* %
+// CHECK: br i1 %
+
+// CHECK: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* %{{.+}}, i32 0, i32 1
+// CHECK: call {{.*}} [[S_DOUBLE_TY_DEF_CONSTR]]([[S_DOUBLE_TY]]*
+// CHECK: ret void
+
+// CHECK: define internal i32 [[DESTRUCTORS]](i32 %0, [[KMP_TASK_MAIN_TY]]* noalias %1)
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 0
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
+// CHECK: call void @_ZN1SIdED1Ev([[S_DOUBLE_TY]]* [[PRIVATE_VAR_REF]])
+// CHECK: getelementptr inbounds [2 x [[S_DOUBLE_TY]]], [2 x [[S_DOUBLE_TY]]]* [[PRIVATE_S_ARR_REF]], i{{.+}} 0, i{{.+}} 0
+// CHECK: getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i{{.+}} 2
+// CHECK: [[PRIVATE_S_ARR_ELEM_REF:%.+]] = getelementptr inbounds [[S_DOUBLE_TY]], [[S_DOUBLE_TY]]* %{{.+}}, i{{.+}} -1
+// CHECK: call void @_ZN1SIdED1Ev([[S_DOUBLE_TY]]* [[PRIVATE_S_ARR_ELEM_REF]])
+// CHECK: icmp eq
+// CHECK: br i1
+// CHECK: ret i32
+
+// CHECK: [[TEST:%.+]] = alloca [[S_INT_TY]],
+// CHECK: [[T_VAR_ADDR:%.+]] = alloca i32,
+// CHECK: [[VEC_ADDR:%.+]] = alloca [2 x i32],
+// CHECK: [[S_ARR_ADDR:%.+]] = alloca [2 x [[S_INT_TY]]],
+// CHECK: [[VAR_ADDR:%.+]] = alloca [[S_INT_TY]],
+
+// CHECK: call {{.*}} [[S_INT_TY_DEF_CONSTR:@.+]]([[S_INT_TY]]* [[TEST]])
+
+// Do not store original variables in capture struct.
+// CHECK-NOT: getelementptr inbounds [[CAP_TMAIN_TY]],
+
+// Allocate task.
+// Returns struct kmp_task_t {
+// [[KMP_TASK_T_TY]] task_data;
+// [[KMP_TASK_TMAIN_TY]] privates;
+// };
+// CHECK: [[RES:%.+]] = call i8* @__kmpc_omp_task_alloc([[LOC]], i32 [[GTID:%.+]], i32 9, i64 256, i64 1, i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_TMAIN_TY]]*)* [[TASK_ENTRY:@[^ ]+]] to i32 (i32, i8*)*))
+// CHECK: [[RES_KMP_TASK:%.+]] = bitcast i8* [[RES]] to [[KMP_TASK_TMAIN_TY]]*
+
+// CHECK: [[TASK:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
+
+// Initialize kmp_task_t->privates with default values (no init for simple types, default constructors for classes).
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
+
+// Constructors for s_arr and var.
+// a_arr;
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
+// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* [[PRIVATE_S_ARR_REF]], i{{.+}} 0, i{{.+}} 0
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i{{.+}} 2
+// CHECK: call void [[S_INT_TY_DEF_CONSTR]]([[S_INT_TY]]* [[S_ARR_CUR:%.+]])
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* [[S_ARR_CUR]], i{{.+}} 1
+// CHECK: icmp eq
+// CHECK: br i1
+
+// var;
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: call void [[S_INT_TY_DEF_CONSTR]]([[S_INT_TY]]* [[PRIVATE_VAR_REF:%.+]])
+
+// Provide pointer to destructor function, which will destroy private variables at the end of the task.
+// CHECK: [[DESTRUCTORS_REF:%.+]] = getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* [[TASK]], i{{.+}} 0, i{{.+}} 3
+// CHECK: [[DESTRUCTORS_PTR:%.+]] = bitcast %union{{.+}}* [[DESTRUCTORS_REF]] to i32 (i32, i8*)**
+// CHECK: store i32 (i32, i8*)* bitcast (i32 (i32, [[KMP_TASK_TMAIN_TY]]*)* [[DESTRUCTORS:@.+]] to i32 (i32, i8*)*), i32 (i32, i8*)** [[DESTRUCTORS_PTR]],
+
+// Start task.
+// CHECK: call void @__kmpc_taskloop([[LOC]], i32 [[GTID]], i8* [[RES]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* bitcast (void ([[KMP_TASK_TMAIN_TY]]*, [[KMP_TASK_TMAIN_TY]]*, i32)* [[TMAIN_DUP:@.+]] to i8*))
+
+// No destructors must be called for private copies of s_arr and var.
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK-NOT: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+//
+
+// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_TMAIN_TY]]* noalias %0, i32** noalias %1, [2 x i32]** noalias %2, [2 x [[S_INT_TY]]]** noalias %3, [[S_INT_TY]]** noalias %4)
+// CHECK: [[PRIVATES:%.+]] = load [[PRIVATES_TMAIN_TY]]*, [[PRIVATES_TMAIN_TY]]**
+// CHECK: [[PRIV_T_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 0
+// CHECK: [[ARG1:%.+]] = load i32**, i32*** %{{.+}},
+// CHECK: store i32* [[PRIV_T_VAR]], i32** [[ARG1]],
+// CHECK: [[PRIV_VEC:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 1
+// CHECK: [[ARG2:%.+]] = load [2 x i32]**, [2 x i32]*** %{{.+}},
+// CHECK: store [2 x i32]* [[PRIV_VEC]], [2 x i32]** [[ARG2]],
+// CHECK: [[PRIV_S_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 2
+// CHECK: [[ARG3:%.+]] = load [2 x [[S_INT_TY]]]**, [2 x [[S_INT_TY]]]*** %{{.+}},
+// CHECK: store [2 x [[S_INT_TY]]]* [[PRIV_S_VAR]], [2 x [[S_INT_TY]]]** [[ARG3]],
+// CHECK: [[PRIV_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 3
+// CHECK: [[ARG4:%.+]] = load [[S_INT_TY]]**, [[S_INT_TY]]*** {{.+}},
+// CHECK: store [[S_INT_TY]]* [[PRIV_VAR]], [[S_INT_TY]]** [[ARG4]],
+// CHECK: ret void
+
+// CHECK: define internal i32 [[TASK_ENTRY]](i32 %0, [[KMP_TASK_TMAIN_TY]]* noalias %1)
+
+// CHECK: alloca i32*,
+// CHECK-DAG: [[PRIV_T_VAR_ADDR:%.+]] = alloca i32*,
+// CHECK-DAG: [[PRIV_VEC_ADDR:%.+]] = alloca [2 x i32]*,
+// CHECK-DAG: [[PRIV_S_ARR_ADDR:%.+]] = alloca [2 x [[S_INT_TY]]]*,
+// CHECK-DAG: [[PRIV_VAR_ADDR:%.+]] = alloca [[S_INT_TY]]*,
+// CHECK: store void (i8*, ...)* bitcast (void ([[PRIVATES_TMAIN_TY]]*, i32**, [2 x i32]**, [2 x [[S_INT_TY]]]**, [[S_INT_TY]]**)* [[PRIVATES_MAP_FN]] to void (i8*, ...)*), void (i8*, ...)** [[MAP_FN_ADDR:%.+]],
+// CHECK: [[MAP_FN:%.+]] = load void (i8*, ...)*, void (i8*, ...)** [[MAP_FN_ADDR]],
+// CHECK: call void (i8*, ...) [[MAP_FN]](i8* %{{.+}}, i32** [[PRIV_T_VAR_ADDR]], [2 x i32]** [[PRIV_VEC_ADDR]], [2 x [[S_INT_TY]]]** [[PRIV_S_ARR_ADDR]], [[S_INT_TY]]** [[PRIV_VAR_ADDR]])
+// CHECK: [[PRIV_T_VAR:%.+]] = load i32*, i32** [[PRIV_T_VAR_ADDR]],
+// CHECK: [[PRIV_VEC:%.+]] = load [2 x i32]*, [2 x i32]** [[PRIV_VEC_ADDR]],
+// CHECK: [[PRIV_S_ARR:%.+]] = load [2 x [[S_INT_TY]]]*, [2 x [[S_INT_TY]]]** [[PRIV_S_ARR_ADDR]],
+// CHECK: [[PRIV_VAR:%.+]] = load [[S_INT_TY]]*, [[S_INT_TY]]** [[PRIV_VAR_ADDR]],
+
+// Privates actually are used.
+// CHECK-DAG: [[PRIV_VAR]]
+// CHECK-DAG: [[PRIV_T_VAR]]
+// CHECK-DAG: [[PRIV_S_ARR]]
+// CHECK-DAG: [[PRIV_VEC]]
+
+// CHECK: ret
+
+// CHECK: define internal void [[TMAIN_DUP]]([[KMP_TASK_TMAIN_TY]]* %0, [[KMP_TASK_TMAIN_TY]]* %1, i32 %2)
+// CHECK: getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* %{{.+}}, i32 0, i32 2
+// CHECK: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* %{{.+}}, i32 0, i32 2
+// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* %{{.+}}, i32 0, i32 0
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i64 2
+// CHECK: br label %
+
+// CHECK: phi [[S_INT_TY]]*
+// CHECK: call {{.*}} [[S_INT_TY_DEF_CONSTR]]([[S_INT_TY]]*
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i64 1
+// CHECK: icmp eq [[S_INT_TY]]* %
+// CHECK: br i1 %
+
+// CHECK: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* %{{.+}}, i32 0, i32 3
+// CHECK: call {{.*}} [[S_INT_TY_DEF_CONSTR]]([[S_INT_TY]]*
+// CHECK: ret void
+
+// CHECK: define internal i32 [[DESTRUCTORS]](i32 %0, [[KMP_TASK_TMAIN_TY]]* noalias %1)
+// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
+// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
+// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
+// CHECK: call void @_ZN1SIiED1Ev([[S_INT_TY]]* [[PRIVATE_VAR_REF]])
+// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* [[PRIVATE_S_ARR_REF]], i{{.+}} 0, i{{.+}} 0
+// CHECK: getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i{{.+}} 2
+// CHECK: [[PRIVATE_S_ARR_ELEM_REF:%.+]] = getelementptr inbounds [[S_INT_TY]], [[S_INT_TY]]* %{{.+}}, i{{.+}} -1
+// CHECK: call void @_ZN1SIiED1Ev([[S_INT_TY]]* [[PRIVATE_S_ARR_ELEM_REF]])
+// CHECK: icmp eq
+// CHECK: br i1
+// CHECK: ret i32
+
+#endif
+#else
+// ARRAY-LABEL: array_func
+struct St {
+ int a, b;
+ St() : a(0), b(0) {}
+ St &operator=(const St &) { return *this; };
+ ~St() {}
+};
+
+void array_func(int n, float a[n], St s[2]) {
+// ARRAY: call i8* @__kmpc_omp_task_alloc(
+// ARRAY: call void @__kmpc_taskloop(
+// ARRAY: store float** %{{.+}}, float*** %{{.+}},
+// ARRAY: store %struct.St** %{{.+}}, %struct.St*** %{{.+}},
+#pragma omp parallel master taskloop simd private(a, s)
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+#endif
+
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_private_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_private_messages.cpp
new file mode 100644
index 0000000..eb1b5c7
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_private_messages.cpp
@@ -0,0 +1,259 @@
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+
+typedef void **omp_allocator_handle_t;
+extern const omp_allocator_handle_t omp_default_mem_alloc;
+extern const omp_allocator_handle_t omp_large_cap_mem_alloc;
+extern const omp_allocator_handle_t omp_const_mem_alloc;
+extern const omp_allocator_handle_t omp_high_bw_mem_alloc;
+extern const omp_allocator_handle_t omp_low_lat_mem_alloc;
+extern const omp_allocator_handle_t omp_cgroup_mem_alloc;
+extern const omp_allocator_handle_t omp_pteam_mem_alloc;
+extern const omp_allocator_handle_t omp_thread_mem_alloc;
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+struct S1; // expected-note 2 {{declared here}} expected-note 2 {{forward declaration of 'S1'}}
+extern S1 a;
+class S2 {
+ mutable int a;
+
+public:
+ S2() : a(0) {}
+};
+const S2 b;
+const S2 ba[5];
+class S3 {
+ int a;
+
+public:
+ S3() : a(0) {}
+};
+const S3 ca[5];
+class S4 {
+ int a;
+ S4(); // expected-note {{implicitly declared private here}}
+
+public:
+ S4(int v) : a(v) {
+#pragma omp parallel master taskloop simd private(a) private(this->a)
+ for (int k = 0; k < v; ++k)
+ ++this->a;
+ }
+};
+class S5 {
+ int a;
+ S5() : a(0) {} // expected-note {{implicitly declared private here}}
+
+public:
+ S5(int v) : a(v) {}
+ S5 &operator=(S5 &s) {
+#pragma omp parallel master taskloop simd private(a) private(this->a) private(s.a) // expected-error {{expected variable name or data member of current class}}
+ for (int k = 0; k < s.a; ++k)
+ ++s.a;
+ return *this;
+ }
+};
+
+template <typename T>
+class S6 {
+public:
+ T a;
+
+ S6() : a(0) {}
+ S6(T v) : a(v) {
+#pragma omp parallel master taskloop simd private(a) private(this->a) allocate(omp_thread_mem_alloc: a) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'parallel master taskloop simd' directive}}
+ for (int k = 0; k < v; ++k)
+ ++this->a;
+ }
+ S6 &operator=(S6 &s) {
+#pragma omp parallel master taskloop simd private(a) private(this->a) private(s.a) // expected-error {{expected variable name or data member of current class}}
+ for (int k = 0; k < s.a; ++k)
+ ++s.a;
+ return *this;
+ }
+};
+
+template <typename T>
+class S7 : public T {
+ T a;
+ S7() : a(0) {}
+
+public:
+ S7(T v) : a(v) {
+#pragma omp parallel master taskloop simd private(a) private(this->a) private(T::a)
+ for (int k = 0; k < a.a; ++k)
+ ++this->a.a;
+ }
+ S7 &operator=(S7 &s) {
+#pragma omp parallel master taskloop simd private(a) private(this->a) private(s.a) private(s.T::a) // expected-error 2 {{expected variable name or data member of current class}}
+ for (int k = 0; k < s.a.a; ++k)
+ ++s.a.a;
+ return *this;
+ }
+};
+
+S3 h;
+#pragma omp threadprivate(h) // expected-note 2 {{defined as threadprivate or thread local}}
+
+template <class I, class C>
+int foomain(I argc, C **argv) {
+ I e(4);
+ I g(5);
+ int i, z;
+ int &j = i;
+#pragma omp parallel master taskloop simd private // expected-error {{expected '(' after 'private'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop simd private( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop simd private() // expected-error {{expected expression}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop simd private(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop simd private(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop simd private(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop simd private(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop simd private(S1) // expected-error {{'S1' does not refer to a value}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop simd private(a, b) // expected-error {{private variable with incomplete type 'S1'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop simd private(argv[1]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop simd private(e, g, z)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop simd private(h) // expected-error {{threadprivate or thread local variable cannot be private}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop simd shared(i)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+ {
+ int v = 0;
+ int i;
+#pragma omp parallel master taskloop simd private(i)
+ for (int k = 0; k < argc; ++k) {
+ i = k;
+ v += i;
+ }
+ }
+#pragma omp parallel shared(i)
+#pragma omp parallel private(i)
+#pragma omp parallel master taskloop simd private(j)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop simd private(i)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+ return 0;
+}
+
+void bar(S4 a[2]) {
+#pragma omp parallel
+#pragma omp parallel master taskloop simd private(a)
+ for (int i = 0; i < 2; ++i)
+ foo();
+}
+
+namespace A {
+double x;
+#pragma omp threadprivate(x) // expected-note {{defined as threadprivate or thread local}}
+}
+namespace B {
+using A::x;
+}
+
+int main(int argc, char **argv) {
+ S4 e(4);
+ S5 g(5);
+ S6<float> s6(0.0) , s6_0(1.0); // expected-note {{in instantiation of member function 'S6<float>::S6' requested here}}
+ S7<S6<float> > s7(0.0) , s7_0(1.0);
+ int i, z;
+ int &j = i;
+#pragma omp parallel master taskloop simd private // expected-error {{expected '(' after 'private'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop simd private( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop simd private() // expected-error {{expected expression}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop simd private(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop simd private(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop simd private(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop simd private(argc)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop simd private(S1) // expected-error {{'S1' does not refer to a value}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop simd private(a, b) // expected-error {{private variable with incomplete type 'S1'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop simd private(argv[1]) // expected-error {{expected variable name}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop simd private(e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop simd private(h) // expected-error {{threadprivate or thread local variable cannot be private}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop simd private(B::x) // expected-error {{threadprivate or thread local variable cannot be private}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop simd shared(i)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
+ {
+ int i;
+#pragma omp parallel master taskloop simd private(i)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+ }
+#pragma omp parallel shared(i)
+#pragma omp parallel private(i)
+#pragma omp parallel master taskloop simd private(j)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel master taskloop simd private(i, z)
+ for (int k = 0; k < argc; ++k)
+ ++k;
+ static int si;
+#pragma omp parallel master taskloop simd private(si) // OK
+ for(int k = 0; k < argc; ++k)
+ si = k + 1;
+
+ s6 = s6_0; // expected-note {{in instantiation of member function 'S6<float>::operator=' requested here}}
+ s7 = s7_0; // expected-note {{in instantiation of member function 'S7<S6<float> >::operator=' requested here}}
+ return foomain(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<int, char>' requested here}}
+}
+
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_reduction_codegen.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_reduction_codegen.cpp
new file mode 100644
index 0000000..9c57e11
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_reduction_codegen.cpp
@@ -0,0 +1,234 @@
+// RUN: %clang_cc1 -fopenmp -x c++ %s -verify -debug-info-kind=limited -emit-llvm -o - -triple powerpc64le-unknown-linux-gnu -std=c++98 -fnoopenmp-use-tls | FileCheck %s
+
+// RUN: %clang_cc1 -fopenmp-simd -x c++ %s -verify -debug-info-kind=limited -emit-llvm -o - -triple powerpc64le-unknown-linux-gnu -std=c++98 -fnoopenmp-use-tls | FileCheck --check-prefix SIMD-ONLY0 %s
+// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
+// expected-no-diagnostics
+
+struct S {
+ float a;
+ S() : a(0.0f) {}
+ ~S() {}
+};
+
+#pragma omp declare reduction(+:S:omp_out.a += omp_in.a) initializer(omp_priv = omp_orig)
+
+float g;
+
+int a;
+#pragma omp threadprivate(a)
+int main (int argc, char *argv[])
+{
+int i, n;
+float a[100], b[100], sum, e[argc + 100];
+S c[100];
+float &d = g;
+
+/* Some initializations */
+n = 100;
+for (i=0; i < n; i++)
+ a[i] = b[i] = i * 1.0;
+sum = 0.0;
+
+#pragma omp parallel master taskloop simd reduction(+:sum, c[:n], d, e)
+ for (i=0; i < n; i++) {
+ sum = sum + (a[i] * b[i]);
+ c[i].a = i*i;
+ d += i*i;
+ e[i] = i;
+ }
+
+}
+
+// CHECK-LABEL: @main(
+// CHECK: [[RETVAL:%.*]] = alloca i32,
+// CHECK: [[ARGC_ADDR:%.*]] = alloca i32,
+// CHECK: [[ARGV_ADDR:%.*]] = alloca i8**,
+// CHECK: [[I:%.*]] = alloca i32,
+// CHECK: [[N:%.*]] = alloca i32,
+// CHECK: [[A:%.*]] = alloca [100 x float],
+// CHECK: [[B:%.*]] = alloca [100 x float],
+// CHECK: [[SUM:%.*]] = alloca float,
+// CHECK: [[SAVED_STACK:%.*]] = alloca i8*,
+// CHECK: [[C:%.*]] = alloca [100 x %struct.S],
+// CHECK: [[D:%.*]] = alloca float*,
+// CHECK: store i32 0, i32* [[RETVAL]],
+// CHECK: store i32 [[ARGC:%.*]], i32* [[ARGC_ADDR]],
+// CHECK: store i8** [[ARGV:%.*]], i8*** [[ARGV_ADDR]],
+// CHECK: [[TMP1:%.*]] = load i32, i32* [[ARGC_ADDR]],
+// CHECK: [[ADD:%.*]] = add nsw i32 [[TMP1]], 100
+// CHECK: [[TMP2:%.*]] = zext i32 [[ADD]] to i64
+// CHECK: [[VLA:%.+]] = alloca float, i64 %
+
+// CHECK: [[SUM_ADDR:%.*]] = alloca float*,
+// CHECK: [[AGG_CAPTURED:%.*]] = alloca [[STRUCT_ANON:%.*]],
+// CHECK: [[DOTRD_INPUT_:%.*]] = alloca [4 x %struct.kmp_task_red_input_t],
+// CHECK: alloca i32,
+// CHECK: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32,
+// CHECK: [[DOTCAPTURE_EXPR_9:%.*]] = alloca i32,
+// CHECK: [[RES:%.+]] = call {{.*}}i32 @__kmpc_master(
+// CHECK-NEXT: [[IS_MASTER:%.+]] = icmp ne i32 [[RES]], 0
+// CHECK-NEXT: br i1 [[IS_MASTER]], label {{%?}}[[THEN:.+]], label {{%?}}[[EXIT:[^,]+]]
+// CHECK: [[THEN]]
+// CHECK: call void @__kmpc_taskgroup(%struct.ident_t*
+// CHECK-DAG: [[TMP21:%.*]] = bitcast float* %{{.+}} to i8*
+// CHECK-DAG: store i8* [[TMP21]], i8** [[TMP20:%[^,]+]],
+// CHECK-DAG: [[TMP20]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T:%.+]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_:%.+]], i32 0, i32 0
+// CHECK-DAG: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 1
+// CHECK-DAG: store i64 4, i64* [[TMP22]],
+// CHECK-DAG: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 2
+// CHECK-DAG: store i8* bitcast (void (i8*)* @[[RED_INIT1:.+]] to i8*), i8** [[TMP23]],
+// CHECK-DAG: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 3
+// CHECK-DAG: store i8* null, i8** [[TMP24]],
+// CHECK-DAG: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 4
+// CHECK-DAG: store i8* bitcast (void (i8*, i8*)* @[[RED_COMB1:.+]] to i8*), i8** [[TMP25]],
+// CHECK-DAG: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_]], i32 0, i32 5
+// CHECK-DAG: [[TMP27:%.*]] = bitcast i32* [[TMP26]] to i8*
+// CHECK-DAG: call void @llvm.memset.p0i8.i64(i8* align 8 [[TMP27]], i8 0, i64 4, i1 false)
+// CHECK-DAG: [[ARRAYIDX5:%.*]] = getelementptr inbounds [100 x %struct.S], [100 x %struct.S]* [[C:%.+]], i64 0, i64 0
+// CHECK-DAG: [[LB_ADD_LEN:%.*]] = add nsw i64 -1, %
+// CHECK-DAG: [[ARRAYIDX6:%.*]] = getelementptr inbounds [100 x %struct.S], [100 x %struct.S]* [[C]], i64 0, i64 [[LB_ADD_LEN]]
+// CHECK-DAG: [[TMP31:%.*]] = bitcast %struct.S* [[ARRAYIDX5]] to i8*
+// CHECK-DAG: store i8* [[TMP31]], i8** [[TMP28:%[^,]+]],
+// CHECK-DAG: [[TMP28]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_4:%.+]], i32 0, i32 0
+// CHECK-DAG: [[TMP32:%.*]] = ptrtoint %struct.S* [[ARRAYIDX6]] to i64
+// CHECK-DAG: [[TMP33:%.*]] = ptrtoint %struct.S* [[ARRAYIDX5]] to i64
+// CHECK-DAG: [[TMP34:%.*]] = sub i64 [[TMP32]], [[TMP33]]
+// CHECK-DAG: [[TMP35:%.*]] = sdiv exact i64 [[TMP34]], ptrtoint (float* getelementptr (float, float* null, i32 1) to i64)
+// CHECK-DAG: [[TMP36:%.*]] = add nuw i64 [[TMP35]], 1
+// CHECK-DAG: [[TMP37:%.*]] = mul nuw i64 [[TMP36]], ptrtoint (float* getelementptr (float, float* null, i32 1) to i64)
+// CHECK-DAG: store i64 [[TMP37]], i64* [[TMP38:%[^,]+]],
+// CHECK-DAG: [[TMP38]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_4]], i32 0, i32 1
+// CHECK-DAG: [[TMP39:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_4]], i32 0, i32 2
+// CHECK-DAG: store i8* bitcast (void (i8*)* @[[RED_INIT2:.+]] to i8*), i8** [[TMP39]],
+// CHECK-DAG: [[TMP40:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_4]], i32 0, i32 3
+// CHECK-DAG: store i8* bitcast (void (i8*)* @[[RED_FINI2:.+]] to i8*), i8** [[TMP40]],
+// CHECK-DAG: [[TMP41:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_4]], i32 0, i32 4
+// CHECK-DAG: store i8* bitcast (void (i8*, i8*)* @[[RED_COMB2:.+]] to i8*), i8** [[TMP41]],
+// CHECK-DAG: [[TMP42:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_4]], i32 0, i32 5
+// CHECK-DAG: store i32 1, i32* [[TMP42]],
+// CHECK-DAG: [[TMP44:%.*]] = load float*, float** [[D:%.+]],
+// CHECK-DAG: [[TMP45:%.*]] = bitcast float* [[TMP44]] to i8*
+// CHECK-DAG: store i8* [[TMP45]], i8** [[TMP43:%[^,]+]],
+// CHECK-DAG: [[TMP43]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_7:%.+]], i32 0, i32 0
+// CHECK-DAG: [[TMP46:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 1
+// CHECK-DAG: store i64 4, i64* [[TMP46]],
+// CHECK-DAG: [[TMP47:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 2
+// CHECK-DAG: store i8* bitcast (void (i8*)* @[[RED_INIT3:.+]] to i8*), i8** [[TMP47]],
+// CHECK-DAG: [[TMP48:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 3
+// CHECK-DAG: store i8* null, i8** [[TMP48]],
+// CHECK-DAG: [[TMP49:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 4
+// CHECK-DAG: store i8* bitcast (void (i8*, i8*)* @[[RED_COMB3:.+]] to i8*), i8** [[TMP49]],
+// CHECK-DAG: [[TMP50:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_7]], i32 0, i32 5
+// CHECK-DAG: [[TMP51:%.*]] = bitcast i32* [[TMP50]] to i8*
+// CHECK-DAG: call void @llvm.memset.p0i8.i64(i8* align 8 [[TMP51]], i8 0, i64 4, i1 false)
+// CHECK-DAG: [[TMP53:%.*]] = bitcast float* [[VLA:%.+]] to i8*
+// CHECK-DAG: store i8* [[TMP53]], i8** [[TMP52:%[^,]+]],
+// CHECK-DAG: [[TMP52]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_8:%.+]], i32 0, i32 0
+// CHECK-DAG: [[TMP54:%.*]] = mul nuw i64 [[TMP2:%.+]], 4
+// CHECK-DAG: [[TMP55:%.*]] = udiv exact i64 [[TMP54]], ptrtoint (float* getelementptr (float, float* null, i32 1) to i64)
+// CHECK-DAG: store i64 [[TMP54]], i64* [[TMP56:%[^,]+]],
+// CHECK-DAG: [[TMP56]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_8]], i32 0, i32 1
+// CHECK-DAG: [[TMP57:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_8]], i32 0, i32 2
+// CHECK-DAG: store i8* bitcast (void (i8*)* @[[RED_INIT4:.+]] to i8*), i8** [[TMP57]],
+// CHECK-DAG: [[TMP58:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_8]], i32 0, i32 3
+// CHECK-DAG: store i8* null, i8** [[TMP58]],
+// CHECK-DAG: [[TMP59:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_8]], i32 0, i32 4
+// CHECK-DAG: store i8* bitcast (void (i8*, i8*)* @[[RED_COMB4:.+]] to i8*), i8** [[TMP59]],
+// CHECK-DAG: [[TMP60:%.*]] = getelementptr inbounds [[STRUCT_KMP_TASK_RED_INPUT_T]], %struct.kmp_task_red_input_t* [[DOTRD_INPUT_GEP_8]], i32 0, i32 5
+// CHECK-DAG: store i32 1, i32* [[TMP60]],
+// CHECK-DAG: [[DOTRD_INPUT_GEP_]] = getelementptr inbounds [4 x %struct.kmp_task_red_input_t], [4 x %struct.kmp_task_red_input_t]* [[DOTRD_INPUT_]], i64 0, i64
+// CHECK-DAG: [[DOTRD_INPUT_GEP_4]] = getelementptr inbounds [4 x %struct.kmp_task_red_input_t], [4 x %struct.kmp_task_red_input_t]* [[DOTRD_INPUT_]], i64 0, i64
+// CHECK-DAG: [[DOTRD_INPUT_GEP_7]] = getelementptr inbounds [4 x %struct.kmp_task_red_input_t], [4 x %struct.kmp_task_red_input_t]* [[DOTRD_INPUT_]], i64 0, i64
+// CHECK-DAG: [[DOTRD_INPUT_GEP_8]] = getelementptr inbounds [4 x %struct.kmp_task_red_input_t], [4 x %struct.kmp_task_red_input_t]* [[DOTRD_INPUT_]], i64 0, i64
+// CHECK: [[TMP61:%.*]] = bitcast [4 x %struct.kmp_task_red_input_t]* [[DOTRD_INPUT_]] to i8*
+// CHECK: [[TMP62:%.*]] = call i8* @__kmpc_task_reduction_init(i32 [[TMP0:%.+]], i32 4, i8* [[TMP61]])
+// CHECK: [[TMP63:%.*]] = load i32, i32* [[N:%.+]],
+// CHECK: store i32 [[TMP63]], i32* [[DOTCAPTURE_EXPR_]],
+// CHECK: [[TMP64:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR_]],
+// CHECK: [[SUB:%.*]] = sub nsw i32 [[TMP64]], 0
+// CHECK: [[SUB10:%.*]] = sub nsw i32 [[SUB]], 1
+// CHECK: [[ADD11:%.*]] = add nsw i32 [[SUB10]], 1
+// CHECK: [[DIV:%.*]] = sdiv i32 [[ADD11]], 1
+// CHECK: [[SUB12:%.*]] = sub nsw i32 [[DIV]], 1
+// CHECK: store i32 [[SUB12]], i32* [[DOTCAPTURE_EXPR_9]],
+// CHECK: [[TMP65:%.*]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* %{{.+}}, i32 [[TMP0]], i32 1, i64 888, i64 72, i32 (i32, i8*)* bitcast (i32 (i32, %struct.kmp_task_t_with_privates*)* @[[TASK:.+]] to i32 (i32, i8*)*))
+// CHECK: call void @__kmpc_taskloop(%struct.ident_t* %{{.+}}, i32 [[TMP0]], i8* [[TMP65]], i32 1, i64* %{{.+}}, i64* %{{.+}}, i64 %{{.+}}, i32 1, i32 0, i64 0, i8* null)
+// CHECK: call void @__kmpc_end_taskgroup(%struct.ident_t*
+// CHECK: call {{.*}}void @__kmpc_end_master(
+// CHECK-NEXT: br label {{%?}}[[EXIT]]
+// CHECK: [[EXIT]]
+
+// CHECK: define internal void @[[RED_INIT1]](i8* %0)
+// CHECK: store float 0.000000e+00, float* %
+// CHECK: ret void
+
+// CHECK: define internal void @[[RED_COMB1]](i8* %0, i8* %1)
+// CHECK: fadd float %
+// CHECK: store float %{{.+}}, float* %
+// CHECK: ret void
+
+// CHECK: define internal void @[[RED_INIT2]](i8* %0)
+// CHECK: call i8* @__kmpc_threadprivate_cached(
+// CHECK: [[ORIG_PTR_ADDR:%.+]] = call i8* @__kmpc_threadprivate_cached(
+// CHECK: [[ORIG_PTR_REF:%.+]] = bitcast i8* [[ORIG_PTR_ADDR]] to i8**
+// CHECK: load i8*, i8** [[ORIG_PTR_REF]],
+// CHECK: call void [[OMP_INIT1:@.+]](
+// CHECK: ret void
+
+// CHECK: define internal void [[OMP_COMB1:@.+]](%struct.S* noalias %0, %struct.S* noalias %1)
+// CHECK: fadd float %
+
+// CHECK: define internal void [[OMP_INIT1]](%struct.S* noalias %0, %struct.S* noalias %1)
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(
+
+// CHECK: define internal void @[[RED_FINI2]](i8* %0)
+// CHECK: call i8* @__kmpc_threadprivate_cached(
+// CHECK: call void @
+// CHECK: ret void
+
+// CHECK: define internal void @[[RED_COMB2]](i8* %0, i8* %1)
+// CHECK: call i8* @__kmpc_threadprivate_cached(
+// CHECK: call void [[OMP_COMB1]](
+// CHECK: ret void
+
+// CHECK: define internal void @[[RED_INIT3]](i8* %0)
+// CHECK: store float 0.000000e+00, float* %
+// CHECK: ret void
+
+// CHECK: define internal void @[[RED_COMB3]](i8* %0, i8* %1)
+// CHECK: fadd float %
+// CHECK: store float %{{.+}}, float* %
+// CHECK: ret void
+
+// CHECK: define internal void @[[RED_INIT4]](i8* %0)
+// CHECK: call i8* @__kmpc_threadprivate_cached(
+// CHECK: store float 0.000000e+00, float* %
+// CHECK: ret void
+
+// CHECK: define internal void @[[RED_COMB4]](i8* %0, i8* %1)
+// CHECK: call i8* @__kmpc_threadprivate_cached(
+// CHECK: fadd float %
+// CHECK: store float %{{.+}}, float* %
+// CHECK: ret void
+
+// CHECK-NOT: call i8* @__kmpc_threadprivate_cached(
+// CHECK: call i8* @__kmpc_task_reduction_get_th_data(
+// CHECK: call i8* @__kmpc_threadprivate_cached(
+// CHECK: call i8* @__kmpc_threadprivate_cached(
+// CHECK: call i8* @__kmpc_task_reduction_get_th_data(
+// CHECK-NOT: call i8* @__kmpc_threadprivate_cached(
+// CHECK: call i8* @__kmpc_task_reduction_get_th_data(
+// CHECK: call i8* @__kmpc_threadprivate_cached(
+// CHECK: call i8* @__kmpc_task_reduction_get_th_data(
+// CHECK-NOT: call i8* @__kmpc_threadprivate_cached(
+
+// CHECK-DAG: distinct !DISubprogram(linkageName: "[[TASK]]", scope: !
+// CHECK-DAG: !DISubprogram(linkageName: "[[RED_INIT1]]"
+// CHECK-DAG: !DISubprogram(linkageName: "[[RED_COMB1]]"
+// CHECK-DAG: !DISubprogram(linkageName: "[[RED_INIT2]]"
+// CHECK-DAG: !DISubprogram(linkageName: "[[RED_FINI2]]"
+// CHECK-DAG: !DISubprogram(linkageName: "[[RED_COMB2]]"
+// CHECK-DAG: !DISubprogram(linkageName: "[[RED_INIT3]]"
+// CHECK-DAG: !DISubprogram(linkageName: "[[RED_COMB3]]"
+// CHECK-DAG: !DISubprogram(linkageName: "[[RED_INIT4]]"
+// CHECK-DAG: !DISubprogram(linkageName: "[[RED_COMB4]]"
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_reduction_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_reduction_messages.cpp
new file mode 100644
index 0000000..9fb65f3
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_reduction_messages.cpp
@@ -0,0 +1,352 @@
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
+
+typedef void **omp_allocator_handle_t;
+extern const omp_allocator_handle_t omp_default_mem_alloc;
+extern const omp_allocator_handle_t omp_large_cap_mem_alloc;
+extern const omp_allocator_handle_t omp_const_mem_alloc;
+extern const omp_allocator_handle_t omp_high_bw_mem_alloc;
+extern const omp_allocator_handle_t omp_low_lat_mem_alloc;
+extern const omp_allocator_handle_t omp_cgroup_mem_alloc;
+extern const omp_allocator_handle_t omp_pteam_mem_alloc;
+extern const omp_allocator_handle_t omp_thread_mem_alloc;
+
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp parallel master taskloop simd reduction(+:fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+void foobar(int &ref) {
+#pragma omp parallel master taskloop simd reduction(+:ref)
+ for (int i = 0; i < 10; ++i)
+ foo();
+}
+
+struct S1; // expected-note {{declared here}} expected-note 4 {{forward declaration of 'S1'}}
+extern S1 a;
+class S2 {
+ mutable int a;
+ S2 &operator+(const S2 &arg) { return (*this); } // expected-note 3 {{implicitly declared private here}}
+
+public:
+ S2() : a(0) {}
+ S2(S2 &s2) : a(s2.a) {}
+ static float S2s; // expected-note 2 {{static data member is predetermined as shared}}
+ static const float S2sc; // expected-note 2 {{'S2sc' declared here}}
+};
+const float S2::S2sc = 0;
+S2 b; // expected-note 3 {{'b' defined here}}
+const S2 ba[5]; // expected-note 2 {{'ba' defined here}}
+class S3 {
+ int a;
+
+public:
+ int b;
+ S3() : a(0) {}
+ S3(const S3 &s3) : a(s3.a) {}
+ S3 operator+(const S3 &arg1) { return arg1; }
+};
+int operator+(const S3 &arg1, const S3 &arg2) { return 5; }
+S3 c; // expected-note 3 {{'c' defined here}}
+const S3 ca[5]; // expected-note 2 {{'ca' defined here}}
+extern const int f; // expected-note 4 {{'f' declared here}}
+class S4 {
+ int a;
+ S4(); // expected-note {{implicitly declared private here}}
+ S4(const S4 &s4);
+ S4 &operator+(const S4 &arg) { return (*this); }
+
+public:
+ S4(int v) : a(v) {}
+};
+S4 &operator&=(S4 &arg1, S4 &arg2) { return arg1; }
+class S5 {
+ int a:32;
+ S5() : a(0) {} // expected-note {{implicitly declared private here}}
+ S5(const S5 &s5) : a(s5.a) {}
+ S5 &operator+(const S5 &arg);
+
+public:
+ S5(int v) : a(v) {}
+};
+class S6 { // expected-note 3 {{candidate function (the implicit copy assignment operator) not viable: no known conversion from 'int' to 'const S6' for 1st argument}}
+#if __cplusplus >= 201103L // C++11 or later
+// expected-note@-2 3 {{candidate function (the implicit move assignment operator) not viable}}
+#endif
+ int a;
+
+public:
+ S6() : a(6) {}
+ operator int() { return 6; }
+} o;
+
+struct S7 {
+ int a: 32;
+ S7() {
+#pragma omp parallel master taskloop simd reduction(+:a) // expected-error {{expected addressable reduction item for the task-based directives}}
+ for (int i = 0; i < 10; ++i)
+ ++a;
+ }
+};
+
+S3 h, k;
+#pragma omp threadprivate(h) // expected-note 2 {{defined as threadprivate or thread local}}
+
+template <class T> // expected-note {{declared here}}
+T tmain(T argc) {
+ const T d = T(); // expected-note 4 {{'d' defined here}}
+ const T da[5] = {T()}; // expected-note 2 {{'da' defined here}}
+ T qa[5] = {T()};
+ T i, z;
+ T &j = i; // expected-note 4 {{'j' defined here}}
+ S3 &p = k; // expected-note 2 {{'p' defined here}}
+ const T &r = da[(int)i]; // expected-note 2 {{'r' defined here}}
+ T &q = qa[(int)i]; // expected-note 2 {{'q' defined here}}
+ T fl;
+#pragma omp parallel master taskloop simd reduction // expected-error {{expected '(' after 'reduction'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction + // expected-error {{expected '(' after 'reduction'}} expected-warning {{extra tokens at the end of '#pragma omp parallel master taskloop simd' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction( // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(- // expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction() // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(*) // expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected expression}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(\) // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(& : argc // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{invalid operands to binary expression ('float' and 'float')}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(| : argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{invalid operands to binary expression ('float' and 'float')}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(|| : argc ? i : argc) // expected-error 2 {{expected variable name, array element or array section}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(foo : argc) //expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'float'}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'int'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(^ : T) // expected-error {{'T' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(+ : z, a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 4 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 3 {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(max : h.b) // expected-error {{expected variable name, array element or array section}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(+ : ba) // expected-error {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(* : ca) // expected-error {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(- : da) // expected-error {{const-qualified variable cannot be reduction}} expected-error {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(^ : fl) // expected-error {{invalid operands to binary expression ('float' and 'float')}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(&& : S2::S2s) // expected-error {{shared variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(+ : h, k) // expected-error {{threadprivate or thread local variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(+ : o) // expected-error 2 {{no viable overloaded '='}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd private(i), reduction(+ : j), reduction(+ : q) // expected-error 4 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel private(k)
+#pragma omp parallel master taskloop simd reduction(+ : p), reduction(+ : p) // expected-error 2 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(+ : p), reduction(+ : p) // expected-error 2 {{variable can appear only once in OpenMP 'reduction' clause}} expected-note 2 {{previously referenced here}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(+ : r) // expected-error 2 {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel shared(i)
+#pragma omp parallel reduction(min : i)
+#pragma omp parallel master taskloop simd reduction(max : j) // expected-error 2 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel private(fl)
+#pragma omp parallel master taskloop simd reduction(+ : fl) allocate(omp_thread_mem_alloc: fl) // expected-warning 2 {{allocator with the 'thread' trait access has unspecified behavior on 'parallel master taskloop simd' directive}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel reduction(* : fl)
+#pragma omp parallel master taskloop simd reduction(+ : fl)
+ for (int i = 0; i < 10; ++i)
+ foo();
+
+ return T();
+}
+
+namespace A {
+double x;
+#pragma omp threadprivate(x) // expected-note {{defined as threadprivate or thread local}}
+}
+namespace B {
+using A::x;
+}
+
+int main(int argc, char **argv) {
+ const int d = 5; // expected-note 2 {{'d' defined here}}
+ const int da[5] = {0}; // expected-note {{'da' defined here}}
+ int qa[5] = {0};
+ S4 e(4);
+ S5 g(5);
+ int i, z;
+ int &j = i; // expected-note 2 {{'j' defined here}}
+ S3 &p = k; // expected-note 2 {{'p' defined here}}
+ const int &r = da[i]; // expected-note {{'r' defined here}}
+ int &q = qa[i]; // expected-note {{'q' defined here}}
+ float fl;
+#pragma omp parallel master taskloop simd reduction // expected-error {{expected '(' after 'reduction'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction + // expected-error {{expected '(' after 'reduction'}} expected-warning {{extra tokens at the end of '#pragma omp parallel master taskloop simd' are ignored}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction( // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(- // expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction() // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(*) // expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected expression}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(\) // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(foo : argc // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(| : argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(|| : argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name, array element or array section}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(~ : argc) // expected-error {{expected unqualified-id}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(&& : argc, z)
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(^ : S1) // expected-error {{'S1' does not refer to a value}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{const-qualified variable cannot be reduction}} expected-error {{'operator+' is a private member of 'S2'}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 2 {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(max : h.b) // expected-error {{expected variable name, array element or array section}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(+ : ba) // expected-error {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(* : ca) // expected-error {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(- : da) // expected-error {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(^ : fl) // expected-error {{invalid operands to binary expression ('float' and 'float')}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(&& : S2::S2s) // expected-error {{shared variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{invalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(+ : o) // expected-error {{no viable overloaded '='}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd private(i), reduction(+ : j), reduction(+ : q) // expected-error 2 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel private(k)
+#pragma omp parallel master taskloop simd reduction(+ : p), reduction(+ : p) // expected-error 2 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(+ : p), reduction(+ : p) // expected-error {{variable can appear only once in OpenMP 'reduction' clause}} expected-note {{previously referenced here}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel master taskloop simd reduction(+ : r) // expected-error {{const-qualified variable cannot be reduction}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel shared(i)
+#pragma omp parallel reduction(min : i)
+#pragma omp parallel master taskloop simd reduction(max : j) // expected-error {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel private(fl)
+#pragma omp parallel master taskloop simd reduction(+ : fl)
+ for (int i = 0; i < 10; ++i)
+ foo();
+#pragma omp parallel reduction(* : fl)
+#pragma omp parallel master taskloop simd reduction(+ : fl)
+ for (int i = 0; i < 10; ++i)
+ foo();
+ static int m;
+#pragma omp parallel master taskloop simd reduction(+ : m) // OK
+ for (int i = 0; i < 10; ++i)
+ m++;
+#pragma omp parallel master taskloop simd nogroup reduction(+ : m) // expected-error {{'reduction' clause cannot be used with 'nogroup' clause}}
+ for (int i = 0; i < 10; ++i)
+ m++;
+
+ return tmain(argc) + tmain(fl); // expected-note {{in instantiation of function template specialization 'tmain<int>' requested here}} expected-note {{in instantiation of function template specialization 'tmain<float>' requested here}}
+}
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_safelen_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_safelen_messages.cpp
new file mode 100644
index 0000000..2a860b7
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_safelen_messages.cpp
@@ -0,0 +1,106 @@
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
+
+void foo() {
+}
+
+#if __cplusplus >= 201103L
+// expected-note@+2 4 {{declared here}}
+#endif
+bool foobool(int argc) {
+ return argc;
+}
+
+struct S1; // expected-note {{declared here}}
+
+template <class T, typename S, int N, int ST> // expected-note {{declared here}}
+T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
+ #pragma omp parallel master taskloop simd safelen // expected-error {{expected '(' after 'safelen'}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp parallel master taskloop simd safelen ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp parallel master taskloop simd safelen () // expected-error {{expected expression}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ // expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
+ // expected-error@+2 2 {{expression is not an integral constant expression}}
+ // expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
+ #pragma omp parallel master taskloop simd safelen (argc
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ // expected-error@+1 {{argument to 'safelen' clause must be a strictly positive integer value}}
+ #pragma omp parallel master taskloop simd safelen (ST // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp parallel master taskloop simd safelen (1)) // expected-warning {{extra tokens at the end of '#pragma omp parallel master taskloop simd' are ignored}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp parallel master taskloop simd safelen ((ST > 0) ? 1 + ST : 2)
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ // expected-error@+6 2 {{directive '#pragma omp parallel master taskloop simd' cannot contain more than one 'safelen' clause}}
+ // expected-error@+5 {{argument to 'safelen' clause must be a strictly positive integer value}}
+ // expected-error@+4 2 {{expression is not an integral constant expression}}
+#if __cplusplus >= 201103L
+ // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
+#endif
+ #pragma omp parallel master taskloop simd safelen (foobool(argc)), safelen (true), safelen (-5)
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp parallel master taskloop simd safelen (S) // expected-error {{'S' does not refer to a value}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+#if __cplusplus <= 199711L
+ // expected-error@+4 2 {{expression is not an integral constant expression}}
+#else
+ // expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
+#endif
+ #pragma omp parallel master taskloop simd safelen (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp parallel master taskloop simd safelen (4)
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp parallel master taskloop simd safelen (N) // expected-error {{argument to 'safelen' clause must be a strictly positive integer value}}
+ for (T i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ return argc;
+}
+
+int main(int argc, char **argv) {
+ #pragma omp parallel master taskloop simd safelen // expected-error {{expected '(' after 'safelen'}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ #pragma omp parallel master taskloop simd safelen ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ #pragma omp parallel master taskloop simd safelen () // expected-error {{expected expression}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ #pragma omp parallel master taskloop simd safelen (4 // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ #pragma omp parallel master taskloop simd safelen (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp parallel master taskloop simd' are ignored}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ // expected-error@+4 {{expression is not an integral constant expression}}
+#if __cplusplus >= 201103L
+ // expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
+#endif
+ #pragma omp parallel master taskloop simd safelen (foobool(1) > 0 ? 1 : 2)
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ // expected-error@+6 {{expression is not an integral constant expression}}
+#if __cplusplus >= 201103L
+ // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
+#endif
+ // expected-error@+2 2 {{directive '#pragma omp parallel master taskloop simd' cannot contain more than one 'safelen' clause}}
+ // expected-error@+1 {{argument to 'safelen' clause must be a strictly positive integer value}}
+ #pragma omp parallel master taskloop simd safelen (foobool(argc)), safelen (true), safelen (-5)
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ #pragma omp parallel master taskloop simd safelen (S1) // expected-error {{'S1' does not refer to a value}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+#if __cplusplus <= 199711L
+ // expected-error@+4 {{expression is not an integral constant expression}}
+#else
+ // expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
+#endif
+ #pragma omp parallel master taskloop simd safelen (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ // expected-error@+3 {{statement after '#pragma omp parallel master taskloop simd' must be a for loop}}
+ // expected-note@+1 {{in instantiation of function template specialization 'tmain<int, char, -1, -2>' requested here}}
+ #pragma omp parallel master taskloop simd safelen(safelen(tmain<int, char, -1, -2>(argc, argv) // expected-error 2 {{expected ')'}} expected-note 2 {{to match this '('}}
+ foo();
+ // expected-note@+1 {{in instantiation of function template specialization 'tmain<int, char, 12, 4>' requested here}}
+ return tmain<int, char, 12, 4>(argc, argv);
+}
+
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_simdlen_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_simdlen_messages.cpp
new file mode 100644
index 0000000..9899ce3
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/parallel_master_taskloop_simd_simdlen_messages.cpp
@@ -0,0 +1,106 @@
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
+
+void foo() {
+}
+
+#if __cplusplus >= 201103L
+// expected-note@+2 4 {{declared here}}
+#endif
+bool foobool(int argc) {
+ return argc;
+}
+
+struct S1; // expected-note {{declared here}}
+
+template <class T, typename S, int N, int ST> // expected-note {{declared here}}
+T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
+ #pragma omp parallel master taskloop simd simdlen // expected-error {{expected '(' after 'simdlen'}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp parallel master taskloop simd simdlen ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp parallel master taskloop simd simdlen () // expected-error {{expected expression}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ // expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
+ // expected-error@+2 2 {{expression is not an integral constant expression}}
+ // expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
+ #pragma omp parallel master taskloop simd simdlen (argc
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ // expected-error@+1 {{argument to 'simdlen' clause must be a strictly positive integer value}}
+ #pragma omp parallel master taskloop simd simdlen (ST // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp parallel master taskloop simd simdlen (1)) // expected-warning {{extra tokens at the end of '#pragma omp parallel master taskloop simd' are ignored}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp parallel master taskloop simd simdlen ((ST > 0) ? 1 + ST : 2)
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ // expected-error@+6 2 {{directive '#pragma omp parallel master taskloop simd' cannot contain more than one 'simdlen' clause}}
+ // expected-error@+5 {{argument to 'simdlen' clause must be a strictly positive integer value}}
+ // expected-error@+4 2 {{expression is not an integral constant expression}}
+#if __cplusplus >= 201103L
+ // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
+#endif
+ #pragma omp parallel master taskloop simd simdlen (foobool(argc)), simdlen (true), simdlen (-5)
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp parallel master taskloop simd simdlen (S) // expected-error {{'S' does not refer to a value}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+#if __cplusplus <= 199711L
+ // expected-error@+4 2 {{expression is not an integral constant expression}}
+#else
+ // expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
+#endif
+ #pragma omp parallel master taskloop simd simdlen (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp parallel master taskloop simd simdlen (4)
+ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ #pragma omp parallel master taskloop simd simdlen (N) // expected-error {{argument to 'simdlen' clause must be a strictly positive integer value}}
+ for (T i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
+ return argc;
+}
+
+int main(int argc, char **argv) {
+ #pragma omp parallel master taskloop simd simdlen // expected-error {{expected '(' after 'simdlen'}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ #pragma omp parallel master taskloop simd simdlen ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ #pragma omp parallel master taskloop simd simdlen () // expected-error {{expected expression}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ #pragma omp parallel master taskloop simd simdlen (4 // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ #pragma omp parallel master taskloop simd simdlen (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp parallel master taskloop simd' are ignored}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ // expected-error@+4 {{expression is not an integral constant expression}}
+#if __cplusplus >= 201103L
+ // expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
+#endif
+ #pragma omp parallel master taskloop simd simdlen (foobool(1) > 0 ? 1 : 2)
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ // expected-error@+6 {{expression is not an integral constant expression}}
+#if __cplusplus >= 201103L
+ // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
+#endif
+ // expected-error@+2 2 {{directive '#pragma omp parallel master taskloop simd' cannot contain more than one 'simdlen' clause}}
+ // expected-error@+1 {{argument to 'simdlen' clause must be a strictly positive integer value}}
+ #pragma omp parallel master taskloop simd simdlen (foobool(argc)), simdlen (true), simdlen (-5)
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ #pragma omp parallel master taskloop simd simdlen (S1) // expected-error {{'S1' does not refer to a value}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+#if __cplusplus <= 199711L
+ // expected-error@+4 {{expression is not an integral constant expression}}
+#else
+ // expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}}
+#endif
+ #pragma omp parallel master taskloop simd simdlen (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
+ // expected-error@+3 {{statement after '#pragma omp parallel master taskloop simd' must be a for loop}}
+ // expected-note@+1 {{in instantiation of function template specialization 'tmain<int, char, -1, -2>' requested here}}
+ #pragma omp parallel master taskloop simd simdlen(simdlen(tmain<int, char, -1, -2>(argc, argv) // expected-error 2 {{expected ')'}} expected-note 2 {{to match this '('}}
+ foo();
+ // expected-note@+1 {{in instantiation of function template specialization 'tmain<int, char, 12, 4>' requested here}}
+ return tmain<int, char, 12, 4>(argc, argv);
+}
+
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_messages.cpp
index ac8869f..c9b6dbc 100644
--- a/src/llvm-project/clang/test/OpenMP/parallel_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/parallel_messages.cpp
@@ -102,6 +102,6 @@
h operator<(h, h);
void g::j() {
#pragma omp parallel for default(none) if(a::b)
- for (auto a = blocks.cbegin; a < blocks; ++a) // expected-error {{invalid operands to binary expression ('f' and 'int')}}
+ for (auto a = blocks.cbegin; a < blocks; ++a) // expected-error 2 {{invalid operands to binary expression ('f' and 'int')}}
;
}
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_reduction_codegen.cpp b/src/llvm-project/clang/test/OpenMP/parallel_reduction_codegen.cpp
index 38be6c3..60bf358 100644
--- a/src/llvm-project/clang/test/OpenMP/parallel_reduction_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/parallel_reduction_codegen.cpp
@@ -521,7 +521,7 @@
// *(Type<n>-1*)lhs[<n>-1] = ReductionOperation<n>-1(*(Type<n>-1*)lhs[<n>-1],
// *(Type<n>-1*)rhs[<n>-1]);
// }
-// CHECK: define internal void [[REDUCTION_FUNC]](i8*, i8*)
+// CHECK: define internal void [[REDUCTION_FUNC]](i8* %0, i8* %1)
// t_var_lhs = (float*)lhs[0];
// CHECK: [[T_VAR_RHS_REF:%.+]] = getelementptr inbounds [4 x i8*], [4 x i8*]* [[RED_LIST_RHS:%.+]], i64 0, i64 0
// CHECK: [[T_VAR_RHS_VOID:%.+]] = load i8*, i8** [[T_VAR_RHS_REF]],
@@ -817,7 +817,7 @@
// *(Type<n>-1*)lhs[<n>-1] = ReductionOperation<n>-1(*(Type<n>-1*)lhs[<n>-1],
// *(Type<n>-1*)rhs[<n>-1]);
// }
-// CHECK: define internal void [[REDUCTION_FUNC]](i8*, i8*)
+// CHECK: define internal void [[REDUCTION_FUNC]](i8* %0, i8* %1)
// t_var_lhs = (i{{[0-9]+}}*)lhs[0];
// CHECK: [[T_VAR_RHS_REF:%.+]] = getelementptr inbounds [4 x i8*], [4 x i8*]* [[RED_LIST_RHS:%.+]], i64 0, i64 0
// CHECK: [[T_VAR_RHS_VOID:%.+]] = load i8*, i8** [[T_VAR_RHS_REF]],
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_reduction_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_reduction_messages.cpp
index cb0ba7c..8816156 100644
--- a/src/llvm-project/clang/test/OpenMP/parallel_reduction_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/parallel_reduction_messages.cpp
@@ -7,6 +7,13 @@
// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
extern int omp_default_mem_alloc;
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp parallel reduction(+:fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
void foo() {
}
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_sections_firstprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_sections_firstprivate_messages.cpp
index f07a720..d0d2279 100644
--- a/src/llvm-project/clang/test/OpenMP/parallel_sections_firstprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/parallel_sections_firstprivate_messages.cpp
@@ -10,6 +10,15 @@
return argc;
}
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp parallel sections firstprivate(fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ {
+ for (int i = 0; i < 10; ++i)
+ ;
+ }
+}
+
struct S1; // expected-note 2 {{declared here}} expected-note 2 {{forward declaration of 'S1'}}
extern S1 a;
class S2 {
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_sections_lastprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_sections_lastprivate_messages.cpp
index 5f3a2e7..0de86d0 100644
--- a/src/llvm-project/clang/test/OpenMP/parallel_sections_lastprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/parallel_sections_lastprivate_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
@@ -66,7 +68,7 @@
template <class I, class C>
int foomain(int argc, char **argv) {
- I e(4);
+ I e(4); // omp50-note {{'e' defined here}}
I g(5);
int i;
int &j = i;
@@ -98,6 +100,14 @@
{
foo();
}
+#pragma omp parallel sections lastprivate(conditional: e,argc) lastprivate(conditional: // omp50-error {{expected expression}} omp45-error 2 {{use of undeclared identifier 'conditional'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected list item of scalar type in 'lastprivate' clause with 'conditional' modifier}}
+ {
+ foo();
+ }
+#pragma omp parallel sections lastprivate(foo:argc) // omp50-error {{expected 'conditional' in OpenMP clause 'lastprivate'}} omp45-error {{expected ',' or ')' in 'lastprivate' clause}} omp45-error {{expected ')'}} omp45-error {{expected variable name}} omp45-note {{to match this '('}}
+ {
+ foo();
+ }
#pragma omp parallel sections lastprivate(S1) // expected-error {{'S1' does not refer to a value}}
{
foo();
diff --git a/src/llvm-project/clang/test/OpenMP/parallel_sections_reduction_messages.cpp b/src/llvm-project/clang/test/OpenMP/parallel_sections_reduction_messages.cpp
index 72aa9d4..6b4f5f9 100644
--- a/src/llvm-project/clang/test/OpenMP/parallel_sections_reduction_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/parallel_sections_reduction_messages.cpp
@@ -7,6 +7,15 @@
// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
extern int omp_default_mem_alloc;
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp parallel sections reduction(+:fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+{
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+}
+
void foo() {
}
diff --git a/src/llvm-project/clang/test/OpenMP/predefined_macro.c b/src/llvm-project/clang/test/OpenMP/predefined_macro.c
index b27b32b..c9722d5 100644
--- a/src/llvm-project/clang/test/OpenMP/predefined_macro.c
+++ b/src/llvm-project/clang/test/OpenMP/predefined_macro.c
@@ -3,6 +3,7 @@
// RUN: %clang_cc1 -fopenmp-simd -verify -o - %s
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -verify -o - %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -verify -o - %s
// expected-no-diagnostics
#ifdef FOPENMP
// -fopenmp option is specified
diff --git a/src/llvm-project/clang/test/OpenMP/requires_codegen.cpp b/src/llvm-project/clang/test/OpenMP/requires_codegen.cpp
index e94fd28..84821e8 100644
--- a/src/llvm-project/clang/test/OpenMP/requires_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/requires_codegen.cpp
@@ -21,5 +21,5 @@
#endif
#ifdef REGION_DEVICE
-#pragma omp requires unified_shared_memory // expected-error {{Target architecture does not support unified addressing}}
+#pragma omp requires unified_shared_memory // expected-error-re {{Target architecture sm_{{20|21|30|32|35|37|50|52|53|60|61|62}} does not support unified addressing}}
#endif
diff --git a/src/llvm-project/clang/test/OpenMP/sections_lastprivate_codegen.cpp b/src/llvm-project/clang/test/OpenMP/sections_lastprivate_codegen.cpp
index 82d52ec..93b417a 100644
--- a/src/llvm-project/clang/test/OpenMP/sections_lastprivate_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/sections_lastprivate_codegen.cpp
@@ -1,19 +1,35 @@
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck %s
-// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-apple-darwin10 -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-apple-darwin10 -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=LAMBDA %s
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=BLOCKS %s
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -triple x86_64-apple-darwin10 -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=LAMBDA %s
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=BLOCKS %s
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=OMP50
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple x86_64-apple-darwin10 -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s -check-prefix=CHECK -check-prefix=OMP50
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=LAMBDA %s
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=BLOCKS %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple x86_64-apple-darwin10 -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -x c++ -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -triple x86_64-apple-darwin10 -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple x86_64-apple-darwin10 -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -DLAMBDA -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -fblocks -DBLOCKS -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
// expected-no-diagnostics
#ifndef HEADER
#define HEADER
+#ifdef OMP5
+#define CONDITIONAL conditional :
+#else
+#define CONDITIONAL
+#endif //OMP5
+
template <class T>
struct S {
T f;
@@ -30,6 +46,9 @@
// CHECK: [[S_INT_TY:%.+]] = type { i32 }
// CHECK-DAG: [[SECTIONS_BARRIER_LOC:@.+]] = private unnamed_addr global %{{.+}} { i32 0, i32 194, i32 0, i32 0, i8*
// CHECK-DAG: [[X:@.+]] = global double 0.0
+// OMP50-DAG: [[IV_REF:@.+]] = common global i32 0
+// OMP50-DAG: [[LAST_IV_X:@.+]] = {{.*}}common global i32 0
+// OMP50-DAG: [[LAST_X:@.+]] = {{.*}}common global double 0.000000e+00,
template <typename T>
T tmain() {
S<T> test;
@@ -216,7 +235,7 @@
}
}
#pragma omp parallel
-#pragma omp sections lastprivate(A::x, B::x)
+#pragma omp sections lastprivate(CONDITIONAL A::x, B::x)
{
A::x++;
#pragma omp section
@@ -275,15 +294,37 @@
// CHECK: [[GTID:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[GTID_REF]]
// CHECK: call void @__kmpc_for_static_init_4(%{{.+}}* @{{.+}}, i32 [[GTID]], i32 34, i32* [[IS_LAST_ADDR:%.+]], i32* %{{.+}}, i32* %{{.+}}, i32* %{{.+}}, i32 1, i32 1)
// <Skip loop body>
+// OMP50: [[IV_GLOB_REF:%.+]] = call i8* @__kmpc_threadprivate_cached(%struct.ident_t* @{{.+}}, i32 [[GTID]], i8* bitcast (i32* [[IV_REF]] to i8*), i64 4, i8*** @{{.+}})
+// OMP50: [[BC:%.+]] = bitcast i8* [[IV_GLOB_REF]] to i32*
+// OMP50: store i32 %{{.+}}, i32* [[BC]],
+// OMP50: [[LOCAL_IV_REF:%.+]] = call i8* @__kmpc_threadprivate_cached(%struct.ident_t* @{{.+}}, i32 [[GTID]], i8* bitcast (i32* [[IV_REF]] to i8*), i64 4, i8*** @{{.+}})
+// OMP50: [[BC:%.+]] = bitcast i8* [[LOCAL_IV_REF]] to i32*
+// OMP50: [[IV:%.+]] = load i32, i32* [[BC]],
+// OMP50: call void @__kmpc_critical(%struct.ident_t* @{{.+}}, i32 [[GTID]], [8 x i32]* [[X_REGION:@.+]])
+// OMP50: [[LAST_IV:%.+]] = load i32, i32* [[LAST_IV_X]],
+// OMP50: [[CMP:%.+]] = icmp sle i32 [[LAST_IV]], [[IV]]
+// OMP50: br i1 [[CMP]], label %[[LP_THEN:.+]], label %[[LP_DONE:[^,]+]]
+
+// OMP50: [[LP_THEN]]:
+// OMP50: store i32 [[IV]], i32* [[LAST_IV_X]],
+// OMP50: [[X_VAL:%.+]] = load double, double* [[X_PRIV]],
+// OMP50: store double [[X_VAL]], double* [[LAST_X]],
+// OMP50: br label %[[LP_DONE]]
+
+// OMP50: [[LP_DONE]]:
+// OMP50: call void @__kmpc_end_critical(%struct.ident_t* @{{.+}}, i32 [[GTID]], [8 x i32]* [[X_REGION]])
// CHECK: call void @__kmpc_for_static_fini(%{{.+}}* @{{.+}}, i32 [[GTID]])
// Check for final copying of private values back to original vars.
// CHECK: [[IS_LAST_VAL:%.+]] = load i32, i32* [[IS_LAST_ADDR]],
// CHECK: [[IS_LAST_ITER:%.+]] = icmp ne i32 [[IS_LAST_VAL]], 0
+// OMP50-NEXT: call void @__kmpc_barrier(%{{.+}}* @{{.+}}, i{{[0-9]+}} [[GTID]])
// CHECK: br i1 [[IS_LAST_ITER:%.+]], label %[[LAST_THEN:.+]], label %[[LAST_DONE:.+]]
// CHECK: [[LAST_THEN]]
// Actual copying.
+// OMP50: [[X_VAL:%.+]] = load double, double* [[LAST_X]],
+// OMP50: store double [[X_VAL]], double* [[X_PRIV]],
// original x=private_x;
// CHECK: [[X_VAL:%.+]] = load double, double* [[X_PRIV]],
// CHECK: store double [[X_VAL]], double* [[X]],
diff --git a/src/llvm-project/clang/test/OpenMP/sections_lastprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/sections_lastprivate_messages.cpp
index 37a0100..b35b271 100644
--- a/src/llvm-project/clang/test/OpenMP/sections_lastprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/sections_lastprivate_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
@@ -54,7 +56,7 @@
};
class S6 {
int a;
- S6() : a(0) {}
+ S6() : a(0) {} // omp45-note 2 {{implicitly declared private here}}
public:
S6(const S6 &s6) : a(s6.a) {}
@@ -70,6 +72,7 @@
I g(5);
int i, k;
int &j = i;
+ S6 s(0); // omp50-note {{'s' defined here}}
#pragma omp parallel
#pragma omp sections lastprivate // expected-error {{expected '(' after 'lastprivate'}}
{
@@ -106,6 +109,16 @@
foo();
}
#pragma omp parallel
+#pragma omp sections lastprivate(conditional: argc,s) lastprivate(conditional: // omp50-error {{expected expression}} omp45-error 2 {{use of undeclared identifier 'conditional'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp45-error 2 {{calling a private constructor of class 'S6'}} omp50-error {{expected list item of scalar type in 'lastprivate' clause with 'conditional' modifier}}}
+ {
+ foo();
+ }
+#pragma omp parallel
+#pragma omp sections lastprivate(foo:argc) // omp50-error {{expected 'conditional' in OpenMP clause 'lastprivate'}} omp45-error {{expected ',' or ')' in 'lastprivate' clause}} omp45-error {{expected ')'}} omp45-error {{expected variable name}} omp45-note {{to match this '('}}
+ {
+ foo();
+ }
+#pragma omp parallel
#pragma omp sections lastprivate(S1) // expected-error {{'S1' does not refer to a value}}
{
foo();
diff --git a/src/llvm-project/clang/test/OpenMP/sections_reduction_codegen.cpp b/src/llvm-project/clang/test/OpenMP/sections_reduction_codegen.cpp
index 29d7226..8d07203 100644
--- a/src/llvm-project/clang/test/OpenMP/sections_reduction_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/sections_reduction_codegen.cpp
@@ -383,7 +383,7 @@
// *(Type<n>-1*)lhs[<n>-1] = ReductionOperation<n>-1(*(Type<n>-1*)lhs[<n>-1],
// *(Type<n>-1*)rhs[<n>-1]);
// }
-// CHECK: define internal void [[REDUCTION_FUNC]](i8*, i8*)
+// CHECK: define internal void [[REDUCTION_FUNC]](i8* %0, i8* %1)
// t_var_lhs = (i{{[0-9]+}}*)lhs[0];
// CHECK: [[T_VAR_RHS_REF:%.+]] = getelementptr inbounds [4 x i8*], [4 x i8*]* [[RED_LIST_RHS:%.+]], i64 0, i64 0
// CHECK: [[T_VAR_RHS_VOID:%.+]] = load i8*, i8** [[T_VAR_RHS_REF]],
diff --git a/src/llvm-project/clang/test/OpenMP/sections_reduction_messages.cpp b/src/llvm-project/clang/test/OpenMP/sections_reduction_messages.cpp
index 8b1c1f1..40e43d2 100644
--- a/src/llvm-project/clang/test/OpenMP/sections_reduction_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/sections_reduction_messages.cpp
@@ -7,6 +7,16 @@
// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
extern int omp_default_mem_alloc;
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp parallel
+#pragma omp sections reduction(+:fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ {
+ for (int i = 0; i < 10; ++i)
+ ;
+ }
+}
+
void foo() {
}
diff --git a/src/llvm-project/clang/test/OpenMP/simd_aligned_messages.cpp b/src/llvm-project/clang/test/OpenMP/simd_aligned_messages.cpp
index 44679b3..8b5edb8 100644
--- a/src/llvm-project/clang/test/OpenMP/simd_aligned_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/simd_aligned_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -x c++ -std=c++11 -verify=expected,expectedw -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp %s -Wuninitialized -Wno-openmp-clauses
+// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp %s -Wuninitialized -Wno-openmp
-// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -x c++ -std=c++11 -verify=expected,expectedw -fopenmp-simd %s -Wuninitialized
struct B {
static int ib[20]; // expected-note 0 {{'B::ib' declared here}}
@@ -41,7 +43,7 @@
// expected-error@+1 {{expected variable name}}
#pragma omp simd aligned(B::bfoo())
for (int i = 0; i < 10; ++i) ;
- // expected-warning@+1 {{aligned clause will be ignored because the requested alignment is not a power of 2}}
+ // expectedw-warning@+1 {{aligned clause will be ignored because the requested alignment is not a power of 2}}
#pragma omp simd aligned(B::ib,B:C1+C2)
for (int i = 0; i < 10; ++i) ;
}
@@ -125,7 +127,7 @@
// FIXME: Should argc really be a pointer?
#pragma omp simd aligned (*argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
for (I k = 0; k < argc; ++k) ++k;
- #pragma omp simd aligned (argc : 5) // expected-warning {{aligned clause will be ignored because the requested alignment is not a power of 2}}
+ #pragma omp simd aligned (argc : 5) // expectedw-warning {{aligned clause will be ignored because the requested alignment is not a power of 2}}
for (I k = 0; k < argc; ++k) ++k;
#pragma omp simd aligned (S1) // expected-error {{'S1' does not refer to a value}}
for (I k = 0; k < argc; ++k) ++k;
diff --git a/src/llvm-project/clang/test/OpenMP/simd_ast_print.cpp b/src/llvm-project/clang/test/OpenMP/simd_ast_print.cpp
index dcd5d7f..cbb94f8 100644
--- a/src/llvm-project/clang/test/OpenMP/simd_ast_print.cpp
+++ b/src/llvm-project/clang/test/OpenMP/simd_ast_print.cpp
@@ -1,10 +1,16 @@
-// RUN: %clang_cc1 -verify -fopenmp -ast-print %s | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -ast-print %s | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45
// 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
+// RUN: %clang_cc1 -fopenmp -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -ast-print %s -DOMP5 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -emit-pch -o %t %s -DOMP5
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -DOMP5 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50
-// RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s
+// RUN: %clang_cc1 -fopenmp-simd -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -ast-print %s -DOMP5 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -emit-pch -o %t %s -DOMP5
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -DOMP5 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50
// expected-no-diagnostics
#ifndef HEADER
@@ -157,10 +163,15 @@
for (int i=0; i < 2; ++i)*a=2;
// CHECK-NEXT: for (int i = 0; i < 2; ++i)
// CHECK-NEXT: *a = 2;
+#ifdef OMP5
+#pragma omp simd private(argc, b),lastprivate(d,f) collapse(2) aligned(a : 4) if(simd:a) nontemporal(argc, c, d) lastprivate(conditional: e, f)
+// OMP50-NEXT: #pragma omp simd private(argc,b) lastprivate(d,f) collapse(2) aligned(a: 4) if(simd: a) nontemporal(argc,c,d) lastprivate(conditional: e,f)
+#else
#pragma omp simd private(argc, b),lastprivate(d,f) collapse(2) aligned(a : 4)
+// OMP45-NEXT: #pragma omp simd private(argc,b) lastprivate(d,f) collapse(2) aligned(a: 4)
+#endif // OMP5
for (int i = 0; i < 10; ++i)
for (int j = 0; j < 10; ++j) {foo(); k1 += 8; k2 += 8;}
-// CHECK-NEXT: #pragma omp simd private(argc,b) lastprivate(d,f) collapse(2) aligned(a: 4)
// CHECK-NEXT: for (int i = 0; i < 10; ++i)
// CHECK-NEXT: for (int j = 0; j < 10; ++j) {
// CHECK-NEXT: foo();
@@ -172,8 +183,13 @@
// CHECK-NEXT: foo();
const int CLEN = 4;
// CHECK-NEXT: const int CLEN = 4;
+#ifdef OMP5
+ #pragma omp simd aligned(a:CLEN) linear(a:CLEN) safelen(CLEN) collapse( 1 ) simdlen(CLEN) linear(val(ref): CLEN) if(a)
+// OMP50-NEXT: #pragma omp simd aligned(a: CLEN) linear(a: CLEN) safelen(CLEN) collapse(1) simdlen(CLEN) linear(val(ref): CLEN) if(a)
+#else
#pragma omp simd aligned(a:CLEN) linear(a:CLEN) safelen(CLEN) collapse( 1 ) simdlen(CLEN) linear(val(ref): CLEN)
-// CHECK-NEXT: #pragma omp simd aligned(a: CLEN) linear(a: CLEN) safelen(CLEN) collapse(1) simdlen(CLEN) linear(val(ref): CLEN)
+// OMP45-NEXT: #pragma omp simd aligned(a: CLEN) linear(a: CLEN) safelen(CLEN) collapse(1) simdlen(CLEN) linear(val(ref): CLEN)
+#endif // OMP5
for (int i = 0; i < 10; ++i)foo();
// CHECK-NEXT: for (int i = 0; i < 10; ++i)
// CHECK-NEXT: foo();
diff --git a/src/llvm-project/clang/test/OpenMP/simd_codegen.cpp b/src/llvm-project/clang/test/OpenMP/simd_codegen.cpp
index 8a636fb..cb53bb1 100644
--- a/src/llvm-project/clang/test/OpenMP/simd_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/simd_codegen.cpp
@@ -1,25 +1,47 @@
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck %s
-// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -debug-info-kind=limited -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
-// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp -fexceptions -fcxx-exceptions -debug-info-kind=line-tables-only -x c++ -emit-llvm %s -o - | FileCheck %s --check-prefix=TERM_DEBUG
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -fexceptions -fcxx-exceptions -o - -fopenmp-version=45 | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s -fopenmp-version=45
+// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -debug-info-kind=limited -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -fopenmp-version=45 | FileCheck %s
+// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp -fexceptions -fcxx-exceptions -debug-info-kind=line-tables-only -x c++ -emit-llvm %s -o - -fopenmp-version=45 | FileCheck %s --check-prefix=TERM_DEBUG
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -fexceptions -fcxx-exceptions -o - -fopenmp-version=50 -DOMP5 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 --check-prefix=OMP50RT
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s -fopenmp-version=50 -DOMP5
+// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -debug-info-kind=limited -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -fopenmp-version=50 -DOMP5 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50 --check-prefix=OMP50RT
-// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck %s
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -debug-info-kind=limited -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
-// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp-simd -fexceptions -fcxx-exceptions -debug-info-kind=line-tables-only -x c++ -emit-llvm %s -o - | FileCheck --check-prefix=TERM_DEBUG %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -fexceptions -fcxx-exceptions -o - -fopenmp-version=45 | FileCheck %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s -fopenmp-version=45
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -debug-info-kind=limited -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -fopenmp-version=45 | FileCheck %s
+// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp-simd -fexceptions -fcxx-exceptions -debug-info-kind=line-tables-only -x c++ -emit-llvm %s -o - -fopenmp-version=45 | FileCheck --check-prefix=TERM_DEBUG %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -fexceptions -fcxx-exceptions -o - -fopenmp-version=50 -DOMP5 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s -fopenmp-version=50 -DOMP5
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -debug-info-kind=limited -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -fopenmp-version=50 -DOMP5 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50
// expected-no-diagnostics
#ifndef HEADER
#define HEADER
+#ifdef OMP5
+#define CONDITIONAL conditional :
+#else
+#define CONDITIONAL
+#endif //OMP5
// CHECK: [[SS_TY:%.+]] = type { i32 }
+// OMP50-DAG: [[LAST_IV:@.+]] = {{.*}}common global i64 0
+// OMP50-DAG: [[LAST_A:@.+]] = {{.*}}common global i32 0
long long get_val() { return 0; }
double *g_ptr;
+struct S {
+ int a, b;
+};
+
// CHECK-LABEL: define {{.*void}} @{{.*}}simple{{.*}}(float* {{.+}}, float* {{.+}}, float* {{.+}}, float* {{.+}})
void simple(float *a, float *b, float *c, float *d) {
+ S s, *p;
+#ifdef OMP5
+ #pragma omp simd if (simd: true) nontemporal(a, b, c, d, s)
+#else
#pragma omp simd
-// CHECK: store i32 0, i32* [[OMP_IV:%[^,]+]]
+#endif
+ // CHECK: store i32 0, i32* [[OMP_IV:%[^,]+]]
// CHECK: [[IV:%.+]] = load i32, i32* [[OMP_IV]]{{.*}}!llvm.access.group
// CHECK-NEXT: [[CMP:%.+]] = icmp slt i32 [[IV]], 6
@@ -33,8 +55,17 @@
// CHECK-NEXT: store i32 [[CALC_I_2]], i32* [[LC_I:.+]]{{.*}}!llvm.access.group
// ... loop body ...
// End of body: store into a[i]:
+// OMP45-NOT: load float*,{{.*}}!nontemporal
+// CHECK-NOT: load float,{{.*}}!nontemporal
+// OMP50: load float*,{{.*}}!nontemporal
+// OMP50: load float*,{{.*}}!nontemporal
+// OMP50: load float*,{{.*}}!nontemporal
+// OMP50: load i32,{{.*}}!nontemporal
+// OMP50-NOT: load i32,{{.*}}!nontemporal
+// OMP50: load float*,{{.*}}!nontemporal
+// CHECK-NOT: load float,{{.*}}!nontemporal
// CHECK: store float [[RESULT:%.+]], float* {{%.+}}{{.*}}!llvm.access.group
- a[i] = b[i] * c[i] * d[i];
+ a[i] = b[i] * c[i] * d[i] + s.a + p->a;
// CHECK: [[IV1_2:%.+]] = load i32, i32* [[OMP_IV]]{{.*}}!llvm.access.group
// CHECK-NEXT: [[ADD1_2:%.+]] = add nsw i32 [[IV1_2]], 1
// CHECK-NEXT: store i32 [[ADD1_2]], i32* [[OMP_IV]]{{.*}}!llvm.access.group
@@ -190,7 +221,7 @@
int A;
// CHECK: store i32 -1, i32* [[A:%.+]],
A = -1;
- #pragma omp simd lastprivate(A)
+ #pragma omp simd lastprivate(CONDITIONAL A)
// CHECK: store i64 0, i64* [[OMP_IV7:%[^,]+]]
// CHECK: br label %[[SIMD_LOOP7_COND:[^,]+]]
// CHECK: [[SIMD_LOOP7_COND]]:
@@ -205,15 +236,32 @@
// CHECK-NEXT: [[LC_IT_2:%.+]] = add nsw i64 -10, [[LC_IT_1]]
// CHECK-NEXT: store i64 [[LC_IT_2]], i64* [[LC:%[^,]+]],{{.+}}!llvm.access.group
// CHECK-NEXT: [[LC_VAL:%.+]] = load i64, i64* [[LC]]{{.+}}!llvm.access.group
-// CHECK-NEXT: [[CONV:%.+]] = trunc i64 [[LC_VAL]] to i32
-// CHECK-NEXT: store i32 [[CONV]], i32* [[A_PRIV:%[^,]+]],{{.+}}!llvm.access.group
- A = i;
+// CHECK-NEXT: [[A_VAL:%.+]] = load i32, i32* [[A_PRIV:%[^,]+]],{{.+}}!llvm.access.group
+// CHECK-NEXT: [[CAST:%.+]] = sext i32 [[A_VAL]] to i64
+// CHECK-NEXT: [[ADD:%.+]] = add nsw i64 [[CAST]], [[LC_VAL]]
+// CHECK-NEXT: [[CONV:%.+]] = trunc i64 [[ADD]] to i32
+// CHECK-NEXT: store i32 [[CONV]], i32* [[A_PRIV]],{{.+}}!llvm.access.group
+// OMP50-NEXT: [[IV:%.+]] = load i64, i64* [[OMP_IV7]],{{.+}}!llvm.access.group
+// OMP50RT: call void @__kmpc_critical(%struct.ident_t* {{.+}}, i32 [[GTID:%.+]], [8 x i32]* [[A_REGION:@.+]]),{{.+}}!llvm.access.group
+// OMP50-NEXT: [[LAST_IV_VAL:%.+]] = load i64, i64* [[LAST_IV]],{{.+}}!llvm.access.group
+// OMP50-NEXT: [[CMP:%.+]] = icmp sle i64 [[LAST_IV_VAL]], [[IV]]
+// OMP50-NEXT: br i1 [[CMP]], label %[[LP_THEN:.+]], label %[[LP_DONE:[^,]+]]
+// OMP50: [[LP_THEN]]:
+// OMP50-NEXT: store i64 [[IV]], i64* [[LAST_IV]],{{.+}}!llvm.access.group
+// OMP50-NEXT: [[A_VAL:%.+]] = load i32, i32* [[A_PRIV]],{{.+}}!llvm.access.group
+// OMP50-NEXT: store i32 [[A_VAL]], i32* [[LAST_A]],{{.+}}!llvm.access.group
+// OMP50-NEXT: br label %[[LP_DONE]]
+// OMP50: [[LP_DONE]]:
+// OMP50RT-NEXT: call void @__kmpc_end_critical(%struct.ident_t* {{.+}}, i32 [[GTID]], [8 x i32]* [[A_REGION]]),{{.+}}!llvm.access.group
+ A += i;
// CHECK: [[IV7_2:%.+]] = load i64, i64* [[OMP_IV7]]{{.*}}!llvm.access.group
// CHECK-NEXT: [[ADD7_2:%.+]] = add nsw i64 [[IV7_2]], 1
// CHECK-NEXT: store i64 [[ADD7_2]], i64* [[OMP_IV7]]{{.*}}!llvm.access.group
}
// CHECK: [[SIMPLE_LOOP7_END]]:
// CHECK-NEXT: store i64 11, i64*
+// OMP50-NEXT: [[LAST_A_VAL:%.+]] = load i32, i32* [[LAST_A]],
+// OMP50-NEXT: store i32 [[LAST_A_VAL]], i32* [[A_PRIV]],
// CHECK-NEXT: [[A_PRIV_VAL:%.+]] = load i32, i32* [[A_PRIV]],
// CHECK-NEXT: store i32 [[A_PRIV_VAL]], i32* [[A]],
int R;
@@ -221,7 +269,16 @@
R = -1;
// CHECK: store i64 0, i64* [[OMP_IV8:%[^,]+]],
// CHECK: store i32 1, i32* [[R_PRIV:%[^,]+]],
+#ifdef OMP5
+ #pragma omp simd reduction(*:R) if(A)
+#else
#pragma omp simd reduction(*:R)
+#endif
+// OMP50: [[A_VAL:%.+]] = load i32, i32* [[A]],
+// OMP50-NEXT: [[COND:%.+]] = icmp ne i32 [[A_VAL]], 0
+// OMP50-NEXT: br i1 [[COND]], label {{%?}}[[THEN:[^,]+]], label {{%?}}[[ELSE:[^,]+]]
+// OMP50: [[THEN]]:
+
// CHECK: br label %[[SIMD_LOOP8_COND:[^,]+]]
// CHECK: [[SIMD_LOOP8_COND]]:
// CHECK-NEXT: [[IV8:%.+]] = load i64, i64* [[OMP_IV8]]{{.*}}!llvm.access.group
@@ -242,6 +299,28 @@
// CHECK-NEXT: store i64 [[ADD8_2]], i64* [[OMP_IV8]]{{.*}}!llvm.access.group
}
// CHECK: [[SIMPLE_LOOP8_END]]:
+// OMP50: br label {{%?}}[[EXIT:[^,]+]]
+// OMP50: br label %[[SIMD_LOOP8_COND:[^,]+]]
+// OMP50: [[SIMD_LOOP8_COND]]:
+// OMP50-NEXT: [[IV8:%.+]] = load i64, i64* [[OMP_IV8]],{{[^!]*}}
+// OMP50-NEXT: [[CMP8:%.+]] = icmp slt i64 [[IV8]], 7
+// OMP50-NEXT: br i1 [[CMP8]], label %[[SIMPLE_LOOP8_BODY:.+]], label %[[SIMPLE_LOOP8_END:[^,]+]]
+// OMP50: [[SIMPLE_LOOP8_BODY]]:
+// Start of body: calculate i from IV:
+// OMP50: [[IV8_0:%.+]] = load i64, i64* [[OMP_IV8]],{{[^!]*}}
+// OMP50-NEXT: [[LC_IT_1:%.+]] = mul nsw i64 [[IV8_0]], 3
+// OMP50-NEXT: [[LC_IT_2:%.+]] = add nsw i64 -10, [[LC_IT_1]]
+// OMP50-NEXT: store i64 [[LC_IT_2]], i64* [[LC:%[^,]+]],{{[^!]*}}
+// OMP50-NEXT: [[LC_VAL:%.+]] = load i64, i64* [[LC]],{{[^!]*}}
+// OMP50: store i32 %{{.+}}, i32* [[R_PRIV]],{{[^!]*}}
+// OMP50: [[IV8_2:%.+]] = load i64, i64* [[OMP_IV8]],{{[^!]*}}
+// OMP50-NEXT: [[ADD8_2:%.+]] = add nsw i64 [[IV8_2]], 1
+// OMP50-NEXT: store i64 [[ADD8_2]], i64* [[OMP_IV8]],{{[^!]*}}
+// OMP50: br label {{%?}}[[SIMD_LOOP8_COND]], {{.*}}!llvm.loop ![[DISABLE_VECT:.+]]
+// OMP50: [[SIMPLE_LOOP8_END]]:
+// OMP50: br label {{%?}}[[EXIT]]
+// OMP50: [[EXIT]]:
+
// CHECK-DAG: [[R_VAL:%.+]] = load i32, i32* [[R]],
// CHECK-DAG: [[R_PRIV_VAL:%.+]] = load i32, i32* [[R_PRIV]],
// CHECK: [[RED:%.+]] = mul nsw i32 [[R_VAL]], [[R_PRIV_VAL]]
@@ -677,6 +756,47 @@
//
}
+#ifdef OMP5
+// OMP50-LABEL: inner_simd
+void inner_simd() {
+ double a, b;
+#pragma omp simd nontemporal(a)
+ for (int i = 0; i < 10; ++i) {
+#pragma omp simd nontemporal(b)
+ for (int k = 0; k < 10; ++k) {
+ // OMP50: load double,{{.*}}!nontemporal
+ // OMP50: store double{{.*}}!nontemporal
+ a = b;
+ }
+ // OMP50-NOT: load double,{{.*}}!nontemporal
+ // OMP50: load double,
+ // OMP50: store double{{.*}}!nontemporal
+ a = b;
+ }
+}
+
+extern struct T t;
+struct Base {
+ float a;
+};
+struct T : public Base {
+ void foo() {
+#pragma omp simd nontemporal(Base::a)
+ for (int i = 0; i < 10; ++i) {
+ // OMP50: store float{{.*}}!nontemporal
+ // OMP50-NOT: nontemporal
+ // OMP50-NEXT: store float
+ Base::a = 0;
+ t.a = 0;
+ }
+ }
+} t;
+
+void bartfoo() {
+ t.foo();
+}
+
+#endif // OMP5
// TERM_DEBUG-LABEL: bar
int bar() {return 0;};
@@ -761,6 +881,7 @@
// TERM_DEBUG-NOT: line: 0,
// TERM_DEBUG: distinct !DISubprogram(linkageName: "_GLOBAL__sub_I_simd_codegen.cpp",
-
+// OMP50-DAG: ![[NOVECT:.+]] = !{!"llvm.loop.vectorize.enable", i1 false}
+// OMP50-DAG: ![[DISABLE_VECT]] = distinct !{{.*}}![[NOVECT]]{{[,}]}}
#endif // HEADER
diff --git a/src/llvm-project/clang/test/OpenMP/simd_if_messages.cpp b/src/llvm-project/clang/test/OpenMP/simd_if_messages.cpp
new file mode 100644
index 0000000..9af6341
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/simd_if_messages.cpp
@@ -0,0 +1,101 @@
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 %s -Wuninitialized
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+void xxx(int argc) {
+ int cond; // expected-note {{initialize the variable 'cond' to silence this warning}}
+#pragma omp simd if(cond) // expected-warning {{variable 'cond' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
+struct S1; // expected-note {{declared here}}
+
+template <class T, class S> // expected-note {{declared here}}
+int tmain(T argc, S **argv) {
+ T z;
+ int i;
+ #pragma omp simd if // expected-error {{expected '(' after 'if'}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp simd if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp simd if () // expected-error {{expected expression}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp simd if (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp simd if (argc)) // expected-warning {{extra tokens at the end of '#pragma omp simd' are ignored}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp simd if (argc > 0 ? argv[1] : argv[2])
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp simd if (foobool(argc)), if (true) // expected-error {{directive '#pragma omp simd' cannot contain more than one 'if' clause}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp simd if (S) // expected-error {{'S' does not refer to a value}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp simd if (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp simd if (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp simd if(argc + z)
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp simd if(simd : // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp simd if(simd : argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp simd if(simd : argc)
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp simd if(target : argc) // expected-error {{directive name modifier 'target' is not allowed for '#pragma omp simd'}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp simd if(simd : argc) if (simd :argc) // expected-error {{directive '#pragma omp simd' cannot contain more than one 'if' clause with 'simd' name modifier}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp simd if(simd : argc) if (argc) // expected-note {{previous clause with directive name modifier specified here}} expected-error {{no more 'if' clause is allowed}}
+ for (i = 0; i < argc; ++i) foo();
+
+ return 0;
+}
+
+int main(int argc, char **argv) {
+ int i, z;
+ #pragma omp simd if // expected-error {{expected '(' after 'if'}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp simd if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp simd if () // expected-error {{expected expression}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp simd if (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp simd if (argc)) // expected-warning {{extra tokens at the end of '#pragma omp simd' are ignored}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp simd if (argc > 0 ? argv[1] : argv[2])
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp simd if (foobool(argc)), if (true) // expected-error {{directive '#pragma omp simd' cannot contain more than one 'if' clause}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp simd if (S1) // expected-error {{'S1' does not refer to a value}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp simd if (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp simd if (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp simd if (1 0) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp simd if(if(tmain(argc, argv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp simd if(simd : // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp simd if(simd : argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp simd if(simd : argc + z) if (target:argc) // expected-error {{directive name modifier 'target' is not allowed for '#pragma omp simd'}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp simd if(simd : argc) if (simd :argc) // expected-error {{directive '#pragma omp simd' cannot contain more than one 'if' clause with 'simd' name modifier}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp simd if(simd : argc) if (argc) // expected-note {{previous clause with directive name modifier specified here}} expected-error {{no more 'if' clause is allowed}}
+ for (i = 0; i < argc; ++i) foo();
+
+ return tmain(argc, argv);
+}
diff --git a/src/llvm-project/clang/test/OpenMP/simd_lastprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/simd_lastprivate_messages.cpp
index e9171af..c3cd65c 100644
--- a/src/llvm-project/clang/test/OpenMP/simd_lastprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/simd_lastprivate_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
@@ -91,6 +93,12 @@
#pragma omp simd lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
for (int k = 0; k < argc; ++k)
++k;
+#pragma omp simd lastprivate(conditional: argc,g) lastprivate(conditional: // omp50-error {{expected expression}} omp45-error 2 {{use of undeclared identifier 'conditional'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp simd lastprivate(foo:argc) // omp50-error {{expected 'conditional' in OpenMP clause 'lastprivate'}} omp45-error {{expected ',' or ')' in 'lastprivate' clause}} omp45-error {{expected ')'}} omp45-error {{expected variable name}} omp45-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
#pragma omp simd lastprivate(S1) // expected-error {{'S1' does not refer to a value}}
for (int k = 0; k < argc; ++k)
++k;
@@ -205,8 +213,8 @@
#pragma omp simd private(xa), lastprivate(xa) // expected-error {{private variable cannot be lastprivate}} expected-note {{defined as private}}
for (i = 0; i < argc; ++i)
foo();
-#pragma omp simd lastprivate(i) // expected-note {{defined as lastprivate}}
- for (i = 0; i < argc; ++i) // expected-error {{loop iteration variable in the associated loop of 'omp simd' directive may not be lastprivate, predetermined as linear}}
+#pragma omp simd lastprivate(i) // omp45-note {{defined as lastprivate}}
+ for (i = 0; i < argc; ++i) // omp45-error {{loop iteration variable in the associated loop of 'omp simd' directive may not be lastprivate, predetermined as linear}}
foo();
#pragma omp parallel private(xa)
#pragma omp simd lastprivate(xa) // OK: may be lastprivate
diff --git a/src/llvm-project/clang/test/OpenMP/simd_linear_messages.cpp b/src/llvm-project/clang/test/OpenMP/simd_linear_messages.cpp
index 9644392..92637fb 100644
--- a/src/llvm-project/clang/test/OpenMP/simd_linear_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/simd_linear_messages.cpp
@@ -3,6 +3,13 @@
// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
+void xxx(int argc) {
+ int i, lin, step; // expected-note {{initialize the variable 'lin' to silence this warning}} expected-note {{initialize the variable 'step' to silence this warning}}
+#pragma omp simd linear(i, lin : step) // expected-warning {{variable 'lin' is uninitialized when used here}} expected-warning {{variable 'step' is uninitialized when used here}}
+ for (i = 0; i < 10; ++i)
+ ;
+}
+
namespace X {
int x;
};
diff --git a/src/llvm-project/clang/test/OpenMP/simd_loop_messages.cpp b/src/llvm-project/clang/test/OpenMP/simd_loop_messages.cpp
index 7a3bded..d905991 100644
--- a/src/llvm-project/clang/test/OpenMP/simd_loop_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/simd_loop_messages.cpp
@@ -1,7 +1,9 @@
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -fopenmp-version=50 -DOMP50 -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -fopenmp-version=50 -DOMP50 -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4,expectedw %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4,expectedw %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5,expectedw %s -fopenmp-version=50 -DOMP50 -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5,expectedw %s -fopenmp-version=50 -DOMP50 -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wuninitialized -Wno-openmp-loop-form
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wuninitialized -Wno-openmp
static int sii;
// expected-note@+1 {{defined as threadprivate or thread local}}
@@ -99,28 +101,28 @@
for (((ii)) = 0;ii < 10; ++ii)
c[ii] = a[ii];
- // expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+ // omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
#pragma omp simd
for (int i = 0; i; i++)
c[i] = a[i];
- // expected-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+ // omp4-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'i'}}
#pragma omp simd
for (int i = 0; jj < kk; ii++)
c[i] = a[i];
- // expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+ // omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
#pragma omp simd
for (int i = 0; !!i; i++)
c[i] = a[i];
- // Ok
+ // omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
#pragma omp simd
for (int i = 0; i != 1; i++)
c[i] = a[i];
- // expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+ // omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
#pragma omp simd
for (int i = 0; ; i++)
c[i] = a[i];
@@ -300,7 +302,7 @@
c[globalii] += a[globalii] + ii;
}
- // expected-error@+2 {{statement after '#pragma omp simd' must be a for loop}}
+ // omp4-error@+2 {{statement after '#pragma omp simd' must be a for loop}}
#pragma omp simd
for (auto &item : a) {
item = item + 1;
@@ -318,7 +320,7 @@
for (int (*p)[4] = lb; p < lb + 8; ++p) {
}
- // expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+ // expectedw-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
#pragma omp simd
for (int a{0}; a<10; ++a) {
}
@@ -399,19 +401,19 @@
#pragma omp simd
for (GoodIter I = begin; I >= end; --I)
++I;
- // expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+ // expectedw-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
#pragma omp simd
for (GoodIter I(begin); I < end; ++I)
++I;
- // expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+ // expectedw-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
#pragma omp simd
for (GoodIter I(nullptr); I < end; ++I)
++I;
- // expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+ // expectedw-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
#pragma omp simd
for (GoodIter I(0); I < end; ++I)
++I;
- // expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+ // expectedw-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
#pragma omp simd
for (GoodIter I(1,2); I < end; ++I)
++I;
@@ -428,15 +430,15 @@
#pragma omp simd
for (begin = end; begin < end; ++begin)
++begin;
- // expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+ // omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
#pragma omp simd
for (GoodIter I = begin; I - I; ++I)
++I;
- // expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+ // omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
#pragma omp simd
for (GoodIter I = begin; begin < end; ++I)
++I;
- // expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+ // omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
#pragma omp simd
for (GoodIter I = begin; !I; ++I)
++I;
@@ -466,7 +468,7 @@
++I;
// Initializer is constructor without params.
- // expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+ // expectedw-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
#pragma omp simd
for (Iter0 I; I < end0; ++I)
++I;
@@ -486,7 +488,7 @@
// Initializer is constructor with all default params.
// expected-error@+4 {{invalid operands to binary expression ('Iter1' and 'float')}}
// expected-error@+3 {{could not calculate number of iterations calling 'operator-' with upper and lower loop bounds}}
- // expected-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
+ // expectedw-warning@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
#pragma omp simd
for (Iter1 I; I < end1; ++I) {
}
diff --git a/src/llvm-project/clang/test/OpenMP/simd_misc_messages.c b/src/llvm-project/clang/test/OpenMP/simd_misc_messages.c
index 29dbde4..d8322e4 100644
--- a/src/llvm-project/clang/test/OpenMP/simd_misc_messages.c
+++ b/src/llvm-project/clang/test/OpenMP/simd_misc_messages.c
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=45 -verify=expected,omp45 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -verify=expected,omp50 %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=45 -verify=expected,omp45 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -verify=expected,omp50 %s -Wuninitialized
void xxx(int argc) {
int x; // expected-note {{initialize the variable 'x' to silence this warning}}
@@ -804,3 +806,87 @@
for (int k = 0; k < argc; ++k) ++k;
}
+void test_nontemporal() {
+ int i;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp simd'}} expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp simd nontemporal(
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp simd'}} expected-error@+1 2 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp simd nontemporal(,
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp simd'}} expected-error@+1 2 {{expected expression}}
+#pragma omp simd nontemporal(, )
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp simd'}} expected-error@+1 {{expected expression}}
+#pragma omp simd nontemporal()
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp simd'}} expected-error@+1 {{expected expression}}
+#pragma omp simd nontemporal(int)
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp simd'}} omp50-error@+1 {{expected variable name}}
+#pragma omp simd nontemporal(0)
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp simd'}} expected-error@+1 {{use of undeclared identifier 'x'}}
+#pragma omp simd nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+// expected-error@+2 {{use of undeclared identifier 'x'}}
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp simd'}} expected-error@+1 {{use of undeclared identifier 'y'}}
+#pragma omp simd nontemporal(x, y)
+ for (i = 0; i < 16; ++i)
+ ;
+// expected-error@+3 {{use of undeclared identifier 'x'}}
+// expected-error@+2 {{use of undeclared identifier 'y'}}
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp simd'}} expected-error@+1 {{use of undeclared identifier 'z'}}
+#pragma omp simd nontemporal(x, y, z)
+ for (i = 0; i < 16; ++i)
+ ;
+
+ int x, y;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp simd'}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp simd nontemporal(x :)
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp simd'}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}}
+#pragma omp simd nontemporal(x :, )
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp50-note@+2 {{defined as nontemporal}}
+// omp45-error@+1 2 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp simd'}} omp50-error@+1 {{a variable cannot appear in more than one nontemporal clause}}
+#pragma omp simd nontemporal(x) nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp simd'}}
+#pragma omp simd private(x) nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp simd'}}
+#pragma omp simd nontemporal(x) private(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp simd'}} expected-note@+1 {{to match this '('}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}} expected-error@+1 {{expected ')'}}
+#pragma omp simd nontemporal(x, y : 0)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp simd'}}
+#pragma omp simd nontemporal(x) lastprivate(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp simd'}}
+#pragma omp simd lastprivate(x) nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+}
+
diff --git a/src/llvm-project/clang/test/OpenMP/simd_reduction_messages.cpp b/src/llvm-project/clang/test/OpenMP/simd_reduction_messages.cpp
index 8e25033..e065419 100644
--- a/src/llvm-project/clang/test/OpenMP/simd_reduction_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/simd_reduction_messages.cpp
@@ -7,6 +7,13 @@
// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
extern int omp_default_mem_alloc;
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp simd reduction(+:fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
void foo() {
}
diff --git a/src/llvm-project/clang/test/OpenMP/single_codegen.cpp b/src/llvm-project/clang/test/OpenMP/single_codegen.cpp
index df5b2ca..ef1e32d 100644
--- a/src/llvm-project/clang/test/OpenMP/single_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/single_codegen.cpp
@@ -149,7 +149,7 @@
return a;
}
-// CHECK: void [[COPY_FUNC]](i8*, i8*)
+// CHECK: void [[COPY_FUNC]](i8* %0, i8* %1)
// CHECK: store i8* %0, i8** [[DST_ADDR_REF:%.+]],
// CHECK: store i8* %1, i8** [[SRC_ADDR_REF:%.+]],
// CHECK: [[DST_ADDR_VOID_PTR:%.+]] = load i8*, i8** [[DST_ADDR_REF]],
@@ -326,7 +326,7 @@
// CHECK-NEXT: call void ([[IDENT_T_TY]]*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call([[IDENT_T_TY]]* @{{.+}}, i32 4, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, [[SS_TY]]*, i64, i64, i64)* [[SS_MICROTASK1:@.+]] to void
// CHECK-NEXT: ret void
-// CHECK: define internal void [[COPY_FUNC]](i8*, i8*)
+// CHECK: define internal void [[COPY_FUNC]](i8* %0, i8* %1)
// CHECK: ret void
// CHECK: define internal void [[SS_MICROTASK1]](i32* {{[^,]+}}, i32* {{[^,]+}}, [[SS_TY]]* {{.+}}, i64 {{.+}}, i64 {{.+}}, i64 {{.+}})
@@ -382,7 +382,7 @@
// CHECK-NEXT: call void @__kmpc_copyprivate([[IDENT_T_TY]]* @{{.+}}, i32 %{{.+}}, i64 24, i8* %{{.+}}, void (i8*, i8*)* [[COPY_FUNC:@[^,]+]], i32 %{{.+}})
// CHECK-NEXT: ret void
-// CHECK: define internal void [[COPY_FUNC]](i8*, i8*)
+// CHECK: define internal void [[COPY_FUNC]](i8* %0, i8* %1)
// CHECK: ret void
// CHECK-LABEL: @_ZN3SSTIdEC2Ev
@@ -432,7 +432,7 @@
// CHECK-LABEL: call void @_ZZZN3SSTIdEC1EvENKUlvE_clEvENKUlvE_clEv(
// CHECK-NEXT: ret void
-// CHECK: define internal void [[COPY_FUNC]](i8*, i8*)
+// CHECK: define internal void [[COPY_FUNC]](i8* %0, i8* %1)
// CHECK: ret void
// CHECK-LABEL: @_ZZZN3SSTIdEC1EvENKUlvE_clEvENKUlvE_clEv(
diff --git a/src/llvm-project/clang/test/OpenMP/target_ast_print.cpp b/src/llvm-project/clang/test/OpenMP/target_ast_print.cpp
index 9b866b7..a36b44b 100644
--- a/src/llvm-project/clang/test/OpenMP/target_ast_print.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_ast_print.cpp
@@ -1,15 +1,16 @@
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ast-print %s | FileCheck %s
-// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s
-
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ast-print %s | FileCheck %s
-// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s
// expected-no-diagnostics
-
#ifndef HEADER
#define HEADER
+// RUN: %clang_cc1 -DOMP45 -verify -fopenmp -fopenmp-version=45 -ast-print %s | FileCheck %s --check-prefix=OMP45
+// RUN: %clang_cc1 -DOMP45 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s
+// RUN: %clang_cc1 -DOMP45 -fopenmp -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s --check-prefix=OMP45
+
+// RUN: %clang_cc1 -DOMP45 -verify -fopenmp-simd -fopenmp-version=45 -ast-print %s | FileCheck %s --check-prefix=OMP45
+// RUN: %clang_cc1 -DOMP45 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s
+// RUN: %clang_cc1 -DOMP45 -fopenmp-simd -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s --check-prefix=OMP45
+#ifdef OMP45
+
void foo() {}
template <typename T, int C>
@@ -52,279 +53,1003 @@
return 0;
}
-// CHECK: template <typename T, int C> T tmain(T argc, T *argv) {
-// CHECK-NEXT: T i, j, a[20]
-// CHECK-NEXT: #pragma omp target{{$}}
-// CHECK-NEXT: foo();
-// CHECK-NEXT: #pragma omp target if(target: argc > 0)
-// CHECK-NEXT: foo()
-// CHECK-NEXT: #pragma omp target if(C)
-// CHECK-NEXT: foo()
-// CHECK-NEXT: #pragma omp target map(tofrom: i)
-// CHECK-NEXT: foo()
-// CHECK-NEXT: #pragma omp target map(tofrom: a[0:10],i)
-// CHECK-NEXT: foo()
-// CHECK-NEXT: #pragma omp target map(to: i) map(from: j)
-// CHECK-NEXT: foo()
-// CHECK-NEXT: #pragma omp target map(always,alloc: i)
-// CHECK-NEXT: foo()
-// CHECK-NEXT: #pragma omp target map(always,from: i)
-// CHECK-NEXT: foo()
-// CHECK-NEXT: #pragma omp target map(tofrom: always)
-// CHECK-NEXT: {
-// CHECK-NEXT: always++;
-// CHECK-NEXT: }
-// CHECK-NEXT: #pragma omp target map(tofrom: always,i)
-// CHECK-NEXT: {
-// CHECK-NEXT: always++;
-// CHECK-NEXT: i++;
-// CHECK-NEXT: }
-// CHECK-NEXT: #pragma omp target map(close,alloc: i)
-// CHECK-NEXT: foo()
-// CHECK-NEXT: #pragma omp target map(close,from: i)
-// CHECK-NEXT: foo()
-// CHECK-NEXT: #pragma omp target map(tofrom: close)
-// CHECK-NEXT: {
-// CHECK-NEXT: close++;
-// CHECK-NEXT: }
-// CHECK-NEXT: #pragma omp target map(tofrom: close,i)
-// CHECK-NEXT: {
-// CHECK-NEXT: close++;
-// CHECK-NEXT: i++;
-// CHECK-NEXT: }
-// CHECK-NEXT: #pragma omp target nowait
-// CHECK-NEXT: foo()
-// CHECK-NEXT: #pragma omp target depend(in : argc,argv[i:argc],a[:])
-// CHECK-NEXT: foo()
-// CHECK-NEXT: #pragma omp target defaultmap(tofrom: scalar)
-// CHECK-NEXT: foo()
-// CHECK: template<> int tmain<int, 5>(int argc, int *argv) {
-// CHECK-NEXT: int i, j, a[20]
-// CHECK-NEXT: #pragma omp target
-// CHECK-NEXT: foo();
-// CHECK-NEXT: #pragma omp target if(target: argc > 0)
-// CHECK-NEXT: foo()
-// CHECK-NEXT: #pragma omp target if(5)
-// CHECK-NEXT: foo()
-// CHECK-NEXT: #pragma omp target map(tofrom: i)
-// CHECK-NEXT: foo()
-// CHECK-NEXT: #pragma omp target map(tofrom: a[0:10],i)
-// CHECK-NEXT: foo()
-// CHECK-NEXT: #pragma omp target map(to: i) map(from: j)
-// CHECK-NEXT: foo()
-// CHECK-NEXT: #pragma omp target map(always,alloc: i)
-// CHECK-NEXT: foo()
-// CHECK-NEXT: #pragma omp target map(always,from: i)
-// CHECK-NEXT: foo()
-// CHECK-NEXT: #pragma omp target map(tofrom: always)
-// CHECK-NEXT: {
-// CHECK-NEXT: always++;
-// CHECK-NEXT: }
-// CHECK-NEXT: #pragma omp target map(tofrom: always,i)
-// CHECK-NEXT: {
-// CHECK-NEXT: always++;
-// CHECK-NEXT: i++;
-// CHECK-NEXT: }
-// CHECK-NEXT: #pragma omp target map(close,alloc: i)
-// CHECK-NEXT: foo()
-// CHECK-NEXT: #pragma omp target map(close,from: i)
-// CHECK-NEXT: foo()
-// CHECK-NEXT: #pragma omp target map(tofrom: close)
-// CHECK-NEXT: {
-// CHECK-NEXT: close++;
-// CHECK-NEXT: }
-// CHECK-NEXT: #pragma omp target map(tofrom: close,i)
-// CHECK-NEXT: {
-// CHECK-NEXT: close++;
-// CHECK-NEXT: i++;
-// CHECK-NEXT: }
-// CHECK-NEXT: #pragma omp target nowait
-// CHECK-NEXT: foo()
-// CHECK-NEXT: #pragma omp target depend(in : argc,argv[i:argc],a[:])
-// CHECK-NEXT: foo()
-// CHECK-NEXT: #pragma omp target defaultmap(tofrom: scalar)
-// CHECK-NEXT: foo()
-// CHECK: template<> char tmain<char, 1>(char argc, char *argv) {
-// CHECK-NEXT: char i, j, a[20]
-// CHECK-NEXT: #pragma omp target
-// CHECK-NEXT: foo();
-// CHECK-NEXT: #pragma omp target if(target: argc > 0)
-// CHECK-NEXT: foo()
-// CHECK-NEXT: #pragma omp target if(1)
-// CHECK-NEXT: foo()
-// CHECK-NEXT: #pragma omp target map(tofrom: i)
-// CHECK-NEXT: foo()
-// CHECK-NEXT: #pragma omp target map(tofrom: a[0:10],i)
-// CHECK-NEXT: foo()
-// CHECK-NEXT: #pragma omp target map(to: i) map(from: j)
-// CHECK-NEXT: foo()
-// CHECK-NEXT: #pragma omp target map(always,alloc: i)
-// CHECK-NEXT: foo()
-// CHECK-NEXT: #pragma omp target map(always,from: i)
-// CHECK-NEXT: foo()
-// CHECK-NEXT: #pragma omp target map(tofrom: always)
-// CHECK-NEXT: {
-// CHECK-NEXT: always++;
-// CHECK-NEXT: }
-// CHECK-NEXT: #pragma omp target map(tofrom: always,i)
-// CHECK-NEXT: {
-// CHECK-NEXT: always++;
-// CHECK-NEXT: i++;
-// CHECK-NEXT: }
-// CHECK-NEXT: #pragma omp target map(close,alloc: i)
-// CHECK-NEXT: foo()
-// CHECK-NEXT: #pragma omp target map(close,from: i)
-// CHECK-NEXT: foo()
-// CHECK-NEXT: #pragma omp target map(tofrom: close)
-// CHECK-NEXT: {
-// CHECK-NEXT: close++;
-// CHECK-NEXT: }
-// CHECK-NEXT: #pragma omp target map(tofrom: close,i)
-// CHECK-NEXT: {
-// CHECK-NEXT: close++;
-// CHECK-NEXT: i++;
-// CHECK-NEXT: }
-// CHECK-NEXT: #pragma omp target nowait
-// CHECK-NEXT: foo()
-// CHECK-NEXT: #pragma omp target depend(in : argc,argv[i:argc],a[:])
-// CHECK-NEXT: foo()
-// CHECK-NEXT: #pragma omp target defaultmap(tofrom: scalar)
-// CHECK-NEXT: foo()
+// OMP45: template <typename T, int C> T tmain(T argc, T *argv) {
+// OMP45-NEXT: T i, j, a[20]
+// OMP45-NEXT: #pragma omp target{{$}}
+// OMP45-NEXT: foo();
+// OMP45-NEXT: #pragma omp target if(target: argc > 0)
+// OMP45-NEXT: foo()
+// OMP45-NEXT: #pragma omp target if(C)
+// OMP45-NEXT: foo()
+// OMP45-NEXT: #pragma omp target map(tofrom: i)
+// OMP45-NEXT: foo()
+// OMP45-NEXT: #pragma omp target map(tofrom: a[0:10],i)
+// OMP45-NEXT: foo()
+// OMP45-NEXT: #pragma omp target map(to: i) map(from: j)
+// OMP45-NEXT: foo()
+// OMP45-NEXT: #pragma omp target map(always,alloc: i)
+// OMP45-NEXT: foo()
+// OMP45-NEXT: #pragma omp target map(always,from: i)
+// OMP45-NEXT: foo()
+// OMP45-NEXT: #pragma omp target map(tofrom: always)
+// OMP45-NEXT: {
+// OMP45-NEXT: always++;
+// OMP45-NEXT: }
+// OMP45-NEXT: #pragma omp target map(tofrom: always,i)
+// OMP45-NEXT: {
+// OMP45-NEXT: always++;
+// OMP45-NEXT: i++;
+// OMP45-NEXT: }
+// OMP45-NEXT: #pragma omp target map(close,alloc: i)
+// OMP45-NEXT: foo()
+// OMP45-NEXT: #pragma omp target map(close,from: i)
+// OMP45-NEXT: foo()
+// OMP45-NEXT: #pragma omp target map(tofrom: close)
+// OMP45-NEXT: {
+// OMP45-NEXT: close++;
+// OMP45-NEXT: }
+// OMP45-NEXT: #pragma omp target map(tofrom: close,i)
+// OMP45-NEXT: {
+// OMP45-NEXT: close++;
+// OMP45-NEXT: i++;
+// OMP45-NEXT: }
+// OMP45-NEXT: #pragma omp target nowait
+// OMP45-NEXT: foo()
+// OMP45-NEXT: #pragma omp target depend(in : argc,argv[i:argc],a[:])
+// OMP45-NEXT: foo()
+// OMP45-NEXT: #pragma omp target defaultmap(tofrom: scalar)
+// OMP45-NEXT: foo()
+// OMP45: template<> int tmain<int, 5>(int argc, int *argv) {
+// OMP45-NEXT: int i, j, a[20]
+// OMP45-NEXT: #pragma omp target
+// OMP45-NEXT: foo();
+// OMP45-NEXT: #pragma omp target if(target: argc > 0)
+// OMP45-NEXT: foo()
+// OMP45-NEXT: #pragma omp target if(5)
+// OMP45-NEXT: foo()
+// OMP45-NEXT: #pragma omp target map(tofrom: i)
+// OMP45-NEXT: foo()
+// OMP45-NEXT: #pragma omp target map(tofrom: a[0:10],i)
+// OMP45-NEXT: foo()
+// OMP45-NEXT: #pragma omp target map(to: i) map(from: j)
+// OMP45-NEXT: foo()
+// OMP45-NEXT: #pragma omp target map(always,alloc: i)
+// OMP45-NEXT: foo()
+// OMP45-NEXT: #pragma omp target map(always,from: i)
+// OMP45-NEXT: foo()
+// OMP45-NEXT: #pragma omp target map(tofrom: always)
+// OMP45-NEXT: {
+// OMP45-NEXT: always++;
+// OMP45-NEXT: }
+// OMP45-NEXT: #pragma omp target map(tofrom: always,i)
+// OMP45-NEXT: {
+// OMP45-NEXT: always++;
+// OMP45-NEXT: i++;
+// OMP45-NEXT: }
+// OMP45-NEXT: #pragma omp target map(close,alloc: i)
+// OMP45-NEXT: foo()
+// OMP45-NEXT: #pragma omp target map(close,from: i)
+// OMP45-NEXT: foo()
+// OMP45-NEXT: #pragma omp target map(tofrom: close)
+// OMP45-NEXT: {
+// OMP45-NEXT: close++;
+// OMP45-NEXT: }
+// OMP45-NEXT: #pragma omp target map(tofrom: close,i)
+// OMP45-NEXT: {
+// OMP45-NEXT: close++;
+// OMP45-NEXT: i++;
+// OMP45-NEXT: }
+// OMP45-NEXT: #pragma omp target nowait
+// OMP45-NEXT: foo()
+// OMP45-NEXT: #pragma omp target depend(in : argc,argv[i:argc],a[:])
+// OMP45-NEXT: foo()
+// OMP45-NEXT: #pragma omp target defaultmap(tofrom: scalar)
+// OMP45-NEXT: foo()
+// OMP45: template<> char tmain<char, 1>(char argc, char *argv) {
+// OMP45-NEXT: char i, j, a[20]
+// OMP45-NEXT: #pragma omp target
+// OMP45-NEXT: foo();
+// OMP45-NEXT: #pragma omp target if(target: argc > 0)
+// OMP45-NEXT: foo()
+// OMP45-NEXT: #pragma omp target if(1)
+// OMP45-NEXT: foo()
+// OMP45-NEXT: #pragma omp target map(tofrom: i)
+// OMP45-NEXT: foo()
+// OMP45-NEXT: #pragma omp target map(tofrom: a[0:10],i)
+// OMP45-NEXT: foo()
+// OMP45-NEXT: #pragma omp target map(to: i) map(from: j)
+// OMP45-NEXT: foo()
+// OMP45-NEXT: #pragma omp target map(always,alloc: i)
+// OMP45-NEXT: foo()
+// OMP45-NEXT: #pragma omp target map(always,from: i)
+// OMP45-NEXT: foo()
+// OMP45-NEXT: #pragma omp target map(tofrom: always)
+// OMP45-NEXT: {
+// OMP45-NEXT: always++;
+// OMP45-NEXT: }
+// OMP45-NEXT: #pragma omp target map(tofrom: always,i)
+// OMP45-NEXT: {
+// OMP45-NEXT: always++;
+// OMP45-NEXT: i++;
+// OMP45-NEXT: }
+// OMP45-NEXT: #pragma omp target map(close,alloc: i)
+// OMP45-NEXT: foo()
+// OMP45-NEXT: #pragma omp target map(close,from: i)
+// OMP45-NEXT: foo()
+// OMP45-NEXT: #pragma omp target map(tofrom: close)
+// OMP45-NEXT: {
+// OMP45-NEXT: close++;
+// OMP45-NEXT: }
+// OMP45-NEXT: #pragma omp target map(tofrom: close,i)
+// OMP45-NEXT: {
+// OMP45-NEXT: close++;
+// OMP45-NEXT: i++;
+// OMP45-NEXT: }
+// OMP45-NEXT: #pragma omp target nowait
+// OMP45-NEXT: foo()
+// OMP45-NEXT: #pragma omp target depend(in : argc,argv[i:argc],a[:])
+// OMP45-NEXT: foo()
+// OMP45-NEXT: #pragma omp target defaultmap(tofrom: scalar)
+// OMP45-NEXT: foo()
-// CHECK-LABEL: class S {
+// OMP45-LABEL: class S {
class S {
void foo() {
-// CHECK-NEXT: void foo() {
+// OMP45-NEXT: void foo() {
int a = 0;
-// CHECK-NEXT: int a = 0;
+// OMP45-NEXT: int a = 0;
#pragma omp target map(this[0])
-// CHECK-NEXT: #pragma omp target map(tofrom: this[0])
+// OMP45-NEXT: #pragma omp target map(tofrom: this[0])
a++;
-// CHECK-NEXT: a++;
+// OMP45-NEXT: a++;
#pragma omp target map(this[:1])
-// CHECK-NEXT: #pragma omp target map(tofrom: this[:1])
+// OMP45-NEXT: #pragma omp target map(tofrom: this[:1])
a++;
-// CHECK-NEXT: a++;
+// OMP45-NEXT: a++;
#pragma omp target map((this)[0])
-// CHECK-NEXT: #pragma omp target map(tofrom: (this)[0])
+// OMP45-NEXT: #pragma omp target map(tofrom: (this)[0])
a++;
-// CHECK-NEXT: a++;
+// OMP45-NEXT: a++;
#pragma omp target map(this[:a])
-// CHECK-NEXT: #pragma omp target map(tofrom: this[:a])
+// OMP45-NEXT: #pragma omp target map(tofrom: this[:a])
a++;
-// CHECK-NEXT: a++;
+// OMP45-NEXT: a++;
#pragma omp target map(this[a:1])
-// CHECK-NEXT: #pragma omp target map(tofrom: this[a:1])
+// OMP45-NEXT: #pragma omp target map(tofrom: this[a:1])
a++;
-// CHECK-NEXT: a++;
+// OMP45-NEXT: a++;
#pragma omp target map(this[a])
-// CHECK-NEXT: #pragma omp target map(tofrom: this[a])
+// OMP45-NEXT: #pragma omp target map(tofrom: this[a])
a++;
-// CHECK-NEXT: a++;
+// OMP45-NEXT: a++;
}
-// CHECK-NEXT: }
+// OMP45-NEXT: }
};
-// CHECK-NEXT: };
+// OMP45-NEXT: };
-// CHECK-LABEL: int main(int argc, char **argv) {
+// OMP45-LABEL: int main(int argc, char **argv) {
int main (int argc, char **argv) {
int i, j, a[20], always, close;
-// CHECK-NEXT: int i, j, a[20]
+// OMP45-NEXT: int i, j, a[20]
#pragma omp target
-// CHECK-NEXT: #pragma omp target
+// OMP45-NEXT: #pragma omp target
foo();
-// CHECK-NEXT: foo();
+// OMP45-NEXT: foo();
#pragma omp target if (argc > 0)
-// CHECK-NEXT: #pragma omp target if(argc > 0)
+// OMP45-NEXT: #pragma omp target if(argc > 0)
foo();
-// CHECK-NEXT: foo();
+// OMP45-NEXT: foo();
#pragma omp target map(i) if(argc>0)
-// CHECK-NEXT: #pragma omp target map(tofrom: i) if(argc > 0)
+// OMP45-NEXT: #pragma omp target map(tofrom: i) if(argc > 0)
foo();
-// CHECK-NEXT: foo();
+// OMP45-NEXT: foo();
#pragma omp target map(i)
-// CHECK-NEXT: #pragma omp target map(tofrom: i)
+// OMP45-NEXT: #pragma omp target map(tofrom: i)
foo();
-// CHECK-NEXT: foo();
+// OMP45-NEXT: foo();
#pragma omp target map(a[0:10], i)
-// CHECK-NEXT: #pragma omp target map(tofrom: a[0:10],i)
+// OMP45-NEXT: #pragma omp target map(tofrom: a[0:10],i)
foo();
-// CHECK-NEXT: foo();
+// OMP45-NEXT: foo();
#pragma omp target map(to: i) map(from: j)
-// CHECK-NEXT: #pragma omp target map(to: i) map(from: j)
+// OMP45-NEXT: #pragma omp target map(to: i) map(from: j)
foo();
-// CHECK-NEXT: foo();
+// OMP45-NEXT: foo();
#pragma omp target map(always,alloc: i)
-// CHECK-NEXT: #pragma omp target map(always,alloc: i)
+// OMP45-NEXT: #pragma omp target map(always,alloc: i)
foo();
-// CHECK-NEXT: foo();
+// OMP45-NEXT: foo();
#pragma omp target map(always from: i)
-// CHECK-NEXT: #pragma omp target map(always,from: i)
+// OMP45-NEXT: #pragma omp target map(always,from: i)
foo();
-// CHECK-NEXT: foo();
+// OMP45-NEXT: foo();
#pragma omp target map(always)
-// CHECK-NEXT: #pragma omp target map(tofrom: always)
+// OMP45-NEXT: #pragma omp target map(tofrom: always)
{always++;}
-// CHECK-NEXT: {
-// CHECK-NEXT: always++;
-// CHECK-NEXT: }
+// OMP45-NEXT: {
+// OMP45-NEXT: always++;
+// OMP45-NEXT: }
#pragma omp target map(always,i)
-// CHECK-NEXT: #pragma omp target map(tofrom: always,i)
+// OMP45-NEXT: #pragma omp target map(tofrom: always,i)
{always++;i++;}
-// CHECK-NEXT: {
-// CHECK-NEXT: always++;
-// CHECK-NEXT: i++;
-// CHECK-NEXT: }
+// OMP45-NEXT: {
+// OMP45-NEXT: always++;
+// OMP45-NEXT: i++;
+// OMP45-NEXT: }
#pragma omp target map(close,alloc: i)
-// CHECK-NEXT: #pragma omp target map(close,alloc: i)
+// OMP45-NEXT: #pragma omp target map(close,alloc: i)
foo();
-// CHECK-NEXT: foo();
+// OMP45-NEXT: foo();
#pragma omp target map(close from: i)
-// CHECK-NEXT: #pragma omp target map(close,from: i)
+// OMP45-NEXT: #pragma omp target map(close,from: i)
foo();
-// CHECK-NEXT: foo();
+// OMP45-NEXT: foo();
#pragma omp target map(close)
-// CHECK-NEXT: #pragma omp target map(tofrom: close)
+// OMP45-NEXT: #pragma omp target map(tofrom: close)
{close++;}
-// CHECK-NEXT: {
-// CHECK-NEXT: close++;
-// CHECK-NEXT: }
+// OMP45-NEXT: {
+// OMP45-NEXT: close++;
+// OMP45-NEXT: }
#pragma omp target map(close,i)
-// CHECK-NEXT: #pragma omp target map(tofrom: close,i)
+// OMP45-NEXT: #pragma omp target map(tofrom: close,i)
{close++;i++;}
-// CHECK-NEXT: {
-// CHECK-NEXT: close++;
-// CHECK-NEXT: i++;
-// CHECK-NEXT: }
+// OMP45-NEXT: {
+// OMP45-NEXT: close++;
+// OMP45-NEXT: i++;
+// OMP45-NEXT: }
#pragma omp target nowait
-// CHECK-NEXT: #pragma omp target nowait
+// OMP45-NEXT: #pragma omp target nowait
foo();
-// CHECK-NEXT: foo();
+// OMP45-NEXT: foo();
#pragma omp target depend(in : argc, argv[i:argc], a[:])
-// CHECK-NEXT: #pragma omp target depend(in : argc,argv[i:argc],a[:])
+// OMP45-NEXT: #pragma omp target depend(in : argc,argv[i:argc],a[:])
foo();
-// CHECK-NEXT: foo();
+// OMP45-NEXT: foo();
#pragma omp target defaultmap(tofrom: scalar)
-// CHECK-NEXT: #pragma omp target defaultmap(tofrom: scalar)
+// OMP45-NEXT: #pragma omp target defaultmap(tofrom: scalar)
foo();
-// CHECK-NEXT: foo();
+// OMP45-NEXT: foo();
return tmain<int, 5>(argc, &argc) + tmain<char, 1>(argv[0][0], argv[0]);
}
#endif
+
+#ifdef OMP5
+
+///==========================================================================///
+// RUN: %clang_cc1 -DOMP5 -verify -fopenmp -fopenmp-version=50 -ast-print %s | FileCheck %s --check-prefix OMP5
+// RUN: %clang_cc1 -DOMP5 -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -emit-pch -o %t %s
+// RUN: %clang_cc1 -DOMP5 -fopenmp -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s --check-prefix OMP5
+
+// RUN: %clang_cc1 -DOMP5 -verify -fopenmp-simd -fopenmp-version=50 -ast-print %s | FileCheck %s --check-prefix OMP5
+// RUN: %clang_cc1 -DOMP5 -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -emit-pch -o %t %s
+// RUN: %clang_cc1 -DOMP5 -fopenmp-simd -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s --check-prefix OMP5
+
+void foo() {}
+
+#pragma omp declare target
+void bar() {}
+#pragma omp end declare target
+
+int a;
+#pragma omp declare target link(a)
+
+template <typename T, int C>
+T tmain(T argc, T *argv) {
+ T i, j, a[20], always, close;
+#pragma omp target
+ foo();
+#pragma omp target if (target:argc > 0)
+ foo();
+#pragma omp target if (C)
+ foo();
+#pragma omp target map(i)
+ foo();
+#pragma omp target map(a[0:10], i)
+ foo();
+#pragma omp target map(to: i) map(from: j)
+ foo();
+#pragma omp target map(always,alloc: i)
+ foo();
+#pragma omp target map(always from: i)
+ foo();
+#pragma omp target map(always)
+ {always++;}
+#pragma omp target map(always,i)
+ {always++;i++;}
+#pragma omp target map(close,alloc: i)
+ foo();
+#pragma omp target map(close from: i)
+ foo();
+#pragma omp target map(close)
+ {close++;}
+#pragma omp target map(close,i)
+ {close++;i++;}
+#pragma omp target nowait
+ foo();
+#pragma omp target depend(in : argc, argv[i:argc], a[:])
+ foo();
+#pragma omp target defaultmap(alloc: scalar)
+ foo();
+#pragma omp target defaultmap(to: scalar)
+ foo();
+#pragma omp target defaultmap(from: scalar)
+ foo();
+#pragma omp target defaultmap(tofrom: scalar)
+ foo();
+#pragma omp target defaultmap(firstprivate: scalar)
+ foo();
+#pragma omp target defaultmap(none: scalar)
+ foo();
+#pragma omp target defaultmap(default: scalar)
+ foo();
+#pragma omp target defaultmap(alloc: aggregate)
+ foo();
+#pragma omp target defaultmap(to: aggregate)
+ foo();
+#pragma omp target defaultmap(from: aggregate)
+ foo();
+#pragma omp target defaultmap(tofrom: aggregate)
+ foo();
+#pragma omp target defaultmap(firstprivate: aggregate)
+ foo();
+#pragma omp target defaultmap(none: aggregate)
+ foo();
+#pragma omp target defaultmap(default: aggregate)
+ foo();
+#pragma omp target defaultmap(alloc: pointer)
+ foo();
+#pragma omp target defaultmap(to: pointer)
+ foo();
+#pragma omp target defaultmap(from: pointer)
+ foo();
+#pragma omp target defaultmap(tofrom: pointer)
+ foo();
+#pragma omp target defaultmap(firstprivate: pointer)
+ foo();
+#pragma omp target defaultmap(none: pointer)
+ foo();
+#pragma omp target defaultmap(default: pointer)
+ foo();
+#pragma omp target defaultmap(to: scalar) defaultmap(tofrom: pointer)
+ foo();
+#pragma omp target defaultmap(from: pointer) defaultmap(none: aggregate)
+ foo();
+#pragma omp target defaultmap(default: aggregate) defaultmap(alloc: scalar)
+ foo();
+#pragma omp target defaultmap(alloc: aggregate) defaultmap(firstprivate: scalar) defaultmap(tofrom: pointer)
+ foo();
+#pragma omp target defaultmap(tofrom: aggregate) defaultmap(to: pointer) defaultmap(alloc: scalar)
+ foo();
+
+ int *g;
+
+#pragma omp target is_device_ptr(g) defaultmap(none: pointer)
+ g++;
+#pragma omp target private(g) defaultmap(none: pointer)
+ g++;
+#pragma omp target firstprivate(g) defaultmap(none: pointer)
+ g++;
+#pragma omp target defaultmap(none: scalar) map(to: i)
+ i++;
+#pragma omp target defaultmap(none: aggregate) map(to: a)
+ a[3]++;
+#pragma omp target defaultmap(none: scalar)
+ bar();
+
+ return 0;
+}
+
+// OMP5: template <typename T, int C> T tmain(T argc, T *argv) {
+// OMP5-NEXT: T i, j, a[20]
+// OMP5-NEXT: #pragma omp target{{$}}
+// OMP5-NEXT: foo();
+// OMP5-NEXT: #pragma omp target if(target: argc > 0)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target if(C)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target map(tofrom: i)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target map(tofrom: a[0:10],i)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target map(to: i) map(from: j)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target map(always,alloc: i)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target map(always,from: i)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target map(tofrom: always)
+// OMP5-NEXT: {
+// OMP5-NEXT: always++;
+// OMP5-NEXT: }
+// OMP5-NEXT: #pragma omp target map(tofrom: always,i)
+// OMP5-NEXT: {
+// OMP5-NEXT: always++;
+// OMP5-NEXT: i++;
+// OMP5-NEXT: }
+// OMP5-NEXT: #pragma omp target map(close,alloc: i)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target map(close,from: i)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target map(tofrom: close)
+// OMP5-NEXT: {
+// OMP5-NEXT: close++;
+// OMP5-NEXT: }
+// OMP5-NEXT: #pragma omp target map(tofrom: close,i)
+// OMP5-NEXT: {
+// OMP5-NEXT: close++;
+// OMP5-NEXT: i++;
+// OMP5-NEXT: }
+// OMP5-NEXT: #pragma omp target nowait
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target depend(in : argc,argv[i:argc],a[:])
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(alloc: scalar)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(to: scalar)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(from: scalar)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(tofrom: scalar)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(firstprivate: scalar)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(none: scalar)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(default: scalar)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(alloc: aggregate)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(to: aggregate)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(from: aggregate)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(tofrom: aggregate)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(firstprivate: aggregate)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(none: aggregate)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(default: aggregate)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(alloc: pointer)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(to: pointer)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(from: pointer)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(tofrom: pointer)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(firstprivate: pointer)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(none: pointer)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(default: pointer)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(to: scalar) defaultmap(tofrom: pointer)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(from: pointer) defaultmap(none: aggregate)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(default: aggregate) defaultmap(alloc: scalar)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(alloc: aggregate) defaultmap(firstprivate: scalar) defaultmap(tofrom: pointer)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(tofrom: aggregate) defaultmap(to: pointer) defaultmap(alloc: scalar)
+// OMP5-NEXT: foo()
+// OMP5: template<> int tmain<int, 5>(int argc, int *argv) {
+// OMP5-NEXT: int i, j, a[20]
+// OMP5-NEXT: #pragma omp target
+// OMP5-NEXT: foo();
+// OMP5-NEXT: #pragma omp target if(target: argc > 0)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target if(5)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target map(tofrom: i)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target map(tofrom: a[0:10],i)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target map(to: i) map(from: j)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target map(always,alloc: i)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target map(always,from: i)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target map(tofrom: always)
+// OMP5-NEXT: {
+// OMP5-NEXT: always++;
+// OMP5-NEXT: }
+// OMP5-NEXT: #pragma omp target map(tofrom: always,i)
+// OMP5-NEXT: {
+// OMP5-NEXT: always++;
+// OMP5-NEXT: i++;
+// OMP5-NEXT: }
+// OMP5-NEXT: #pragma omp target map(close,alloc: i)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target map(close,from: i)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target map(tofrom: close)
+// OMP5-NEXT: {
+// OMP5-NEXT: close++;
+// OMP5-NEXT: }
+// OMP5-NEXT: #pragma omp target map(tofrom: close,i)
+// OMP5-NEXT: {
+// OMP5-NEXT: close++;
+// OMP5-NEXT: i++;
+// OMP5-NEXT: }
+// OMP5-NEXT: #pragma omp target nowait
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target depend(in : argc,argv[i:argc],a[:])
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(alloc: scalar)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(to: scalar)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(from: scalar)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(tofrom: scalar)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(firstprivate: scalar)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(none: scalar)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(default: scalar)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(alloc: aggregate)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(to: aggregate)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(from: aggregate)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(tofrom: aggregate)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(firstprivate: aggregate)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(none: aggregate)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(default: aggregate)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(alloc: pointer)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(to: pointer)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(from: pointer)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(tofrom: pointer)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(firstprivate: pointer)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(none: pointer)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(default: pointer)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(to: scalar) defaultmap(tofrom: pointer)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(from: pointer) defaultmap(none: aggregate)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(default: aggregate) defaultmap(alloc: scalar)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(alloc: aggregate) defaultmap(firstprivate: scalar) defaultmap(tofrom: pointer)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(tofrom: aggregate) defaultmap(to: pointer) defaultmap(alloc: scalar)
+// OMP5-NEXT: foo()
+// OMP5: template<> char tmain<char, 1>(char argc, char *argv) {
+// OMP5-NEXT: char i, j, a[20]
+// OMP5-NEXT: #pragma omp target
+// OMP5-NEXT: foo();
+// OMP5-NEXT: #pragma omp target if(target: argc > 0)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target if(1)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target map(tofrom: i)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target map(tofrom: a[0:10],i)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target map(to: i) map(from: j)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target map(always,alloc: i)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target map(always,from: i)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target map(tofrom: always)
+// OMP5-NEXT: {
+// OMP5-NEXT: always++;
+// OMP5-NEXT: }
+// OMP5-NEXT: #pragma omp target map(tofrom: always,i)
+// OMP5-NEXT: {
+// OMP5-NEXT: always++;
+// OMP5-NEXT: i++;
+// OMP5-NEXT: }
+// OMP5-NEXT: #pragma omp target map(close,alloc: i)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target map(close,from: i)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target map(tofrom: close)
+// OMP5-NEXT: {
+// OMP5-NEXT: close++;
+// OMP5-NEXT: }
+// OMP5-NEXT: #pragma omp target map(tofrom: close,i)
+// OMP5-NEXT: {
+// OMP5-NEXT: close++;
+// OMP5-NEXT: i++;
+// OMP5-NEXT: }
+// OMP5-NEXT: #pragma omp target nowait
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target depend(in : argc,argv[i:argc],a[:])
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(alloc: scalar)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(to: scalar)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(from: scalar)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(tofrom: scalar)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(firstprivate: scalar)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(none: scalar)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(default: scalar)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(alloc: aggregate)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(to: aggregate)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(from: aggregate)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(tofrom: aggregate)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(firstprivate: aggregate)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(none: aggregate)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(default: aggregate)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(alloc: pointer)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(to: pointer)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(from: pointer)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(tofrom: pointer)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(firstprivate: pointer)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(none: pointer)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(default: pointer)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(to: scalar) defaultmap(tofrom: pointer)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(from: pointer) defaultmap(none: aggregate)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(default: aggregate) defaultmap(alloc: scalar)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(alloc: aggregate) defaultmap(firstprivate: scalar) defaultmap(tofrom: pointer)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: #pragma omp target defaultmap(tofrom: aggregate) defaultmap(to: pointer) defaultmap(alloc: scalar)
+// OMP5-NEXT: foo()
+// OMP5-NEXT: int *g;
+// OMP5-NEXT: #pragma omp target is_device_ptr(g) defaultmap(none: pointer)
+// OMP5-NEXT: g++;
+// OMP5-NEXT: #pragma omp target private(g) defaultmap(none: pointer)
+// OMP5-NEXT: g++;
+// OMP5-NEXT: #pragma omp target firstprivate(g) defaultmap(none: pointer)
+// OMP5-NEXT: g++;
+// OMP5-NEXT: #pragma omp target defaultmap(none: scalar) map(to: i)
+// OMP5-NEXT: i++;
+// OMP5-NEXT: #pragma omp target defaultmap(none: aggregate) map(to: a)
+// OMP5-NEXT: a[3]++;
+// OMP5-NEXT: #pragma omp target defaultmap(none: scalar)
+// OMP5-NEXT: bar();
+
+// OMP5-LABEL: class S {
+class S {
+ void foo() {
+// OMP5-NEXT: void foo() {
+ int a = 0;
+// OMP5-NEXT: int a = 0;
+ #pragma omp target map(this[0])
+// OMP5-NEXT: #pragma omp target map(tofrom: this[0])
+ a++;
+// OMP5-NEXT: a++;
+ #pragma omp target map(this[:1])
+// OMP5-NEXT: #pragma omp target map(tofrom: this[:1])
+ a++;
+// OMP5-NEXT: a++;
+ #pragma omp target map((this)[0])
+// OMP5-NEXT: #pragma omp target map(tofrom: (this)[0])
+ a++;
+// OMP5-NEXT: a++;
+ #pragma omp target map(this[:a])
+// OMP5-NEXT: #pragma omp target map(tofrom: this[:a])
+ a++;
+// OMP5-NEXT: a++;
+ #pragma omp target map(this[a:1])
+// OMP5-NEXT: #pragma omp target map(tofrom: this[a:1])
+ a++;
+// OMP5-NEXT: a++;
+ #pragma omp target map(this[a])
+// OMP5-NEXT: #pragma omp target map(tofrom: this[a])
+ a++;
+// OMP5-NEXT: a++;
+ }
+// OMP5-NEXT: }
+};
+// OMP5-NEXT: };
+
+// OMP5-LABEL: int main(int argc, char **argv) {
+int main (int argc, char **argv) {
+ int i, j, a[20], always, close;
+// OMP5-NEXT: int i, j, a[20]
+#pragma omp target
+// OMP5-NEXT: #pragma omp target
+ foo();
+// OMP5-NEXT: foo();
+#pragma omp target if (argc > 0)
+// OMP5-NEXT: #pragma omp target if(argc > 0)
+ foo();
+// OMP5-NEXT: foo();
+
+#pragma omp target map(i) if(argc>0)
+// OMP5-NEXT: #pragma omp target map(tofrom: i) if(argc > 0)
+ foo();
+// OMP5-NEXT: foo();
+
+#pragma omp target map(i)
+// OMP5-NEXT: #pragma omp target map(tofrom: i)
+ foo();
+// OMP5-NEXT: foo();
+
+#pragma omp target map(a[0:10], i)
+// OMP5-NEXT: #pragma omp target map(tofrom: a[0:10],i)
+ foo();
+// OMP5-NEXT: foo();
+
+#pragma omp target map(to: i) map(from: j)
+// OMP5-NEXT: #pragma omp target map(to: i) map(from: j)
+ foo();
+// OMP5-NEXT: foo();
+
+#pragma omp target map(always,alloc: i)
+// OMP5-NEXT: #pragma omp target map(always,alloc: i)
+ foo();
+// OMP5-NEXT: foo();
+
+#pragma omp target map(always from: i)
+// OMP5-NEXT: #pragma omp target map(always,from: i)
+ foo();
+// OMP5-NEXT: foo();
+
+#pragma omp target map(always)
+// OMP5-NEXT: #pragma omp target map(tofrom: always)
+ {always++;}
+// OMP5-NEXT: {
+// OMP5-NEXT: always++;
+// OMP5-NEXT: }
+
+#pragma omp target map(always,i)
+// OMP5-NEXT: #pragma omp target map(tofrom: always,i)
+ {always++;i++;}
+// OMP5-NEXT: {
+// OMP5-NEXT: always++;
+// OMP5-NEXT: i++;
+// OMP5-NEXT: }
+
+#pragma omp target map(close,alloc: i)
+// OMP5-NEXT: #pragma omp target map(close,alloc: i)
+ foo();
+// OMP5-NEXT: foo();
+
+#pragma omp target map(close from: i)
+// OMP5-NEXT: #pragma omp target map(close,from: i)
+ foo();
+// OMP5-NEXT: foo();
+
+#pragma omp target map(close)
+// OMP5-NEXT: #pragma omp target map(tofrom: close)
+ {close++;}
+// OMP5-NEXT: {
+// OMP5-NEXT: close++;
+// OMP5-NEXT: }
+
+#pragma omp target map(close,i)
+// OMP5-NEXT: #pragma omp target map(tofrom: close,i)
+ {close++;i++;}
+// OMP5-NEXT: {
+// OMP5-NEXT: close++;
+// OMP5-NEXT: i++;
+// OMP5-NEXT: }
+
+#pragma omp target nowait
+// OMP5-NEXT: #pragma omp target nowait
+ foo();
+// OMP5-NEXT: foo();
+
+#pragma omp target depend(in : argc, argv[i:argc], a[:])
+// OMP5-NEXT: #pragma omp target depend(in : argc,argv[i:argc],a[:])
+ foo();
+// OMP5-NEXT: foo();
+
+#pragma omp target defaultmap(alloc: scalar)
+// OMP5-NEXT: #pragma omp target defaultmap(alloc: scalar)
+ foo();
+// OMP5-NEXT: foo();
+
+#pragma omp target defaultmap(to: scalar)
+// OMP5-NEXT: #pragma omp target defaultmap(to: scalar)
+ foo();
+// OMP5-NEXT: foo();
+
+#pragma omp target defaultmap(from: scalar)
+// OMP5-NEXT: #pragma omp target defaultmap(from: scalar)
+ foo();
+// OMP5-NEXT: foo();
+
+#pragma omp target defaultmap(tofrom: scalar)
+// OMP5-NEXT: #pragma omp target defaultmap(tofrom: scalar)
+ foo();
+// OMP5-NEXT: foo();
+
+#pragma omp target defaultmap(firstprivate: scalar)
+// OMP5-NEXT: #pragma omp target defaultmap(firstprivate: scalar)
+ foo();
+// OMP5-NEXT: foo();
+
+#pragma omp target defaultmap(none: scalar)
+// OMP5-NEXT: #pragma omp target defaultmap(none: scalar)
+ foo();
+// OMP5-NEXT: foo();
+
+#pragma omp target defaultmap(default: scalar)
+// OMP5-NEXT: #pragma omp target defaultmap(default: scalar)
+ foo();
+// OMP5-NEXT: foo();
+
+#pragma omp target defaultmap(alloc: aggregate)
+// OMP5-NEXT: #pragma omp target defaultmap(alloc: aggregate)
+ foo();
+// OMP5-NEXT: foo();
+
+#pragma omp target defaultmap(to: aggregate)
+// OMP5-NEXT: #pragma omp target defaultmap(to: aggregate)
+ foo();
+// OMP5-NEXT: foo();
+
+#pragma omp target defaultmap(from: aggregate)
+// OMP5-NEXT: #pragma omp target defaultmap(from: aggregate)
+ foo();
+// OMP5-NEXT: foo();
+
+#pragma omp target defaultmap(tofrom: aggregate)
+// OMP5-NEXT: #pragma omp target defaultmap(tofrom: aggregate)
+ foo();
+// OMP5-NEXT: foo();
+
+#pragma omp target defaultmap(firstprivate: aggregate)
+// OMP5-NEXT: #pragma omp target defaultmap(firstprivate: aggregate)
+ foo();
+// OMP5-NEXT: foo();
+
+#pragma omp target defaultmap(none: aggregate)
+// OMP5-NEXT: #pragma omp target defaultmap(none: aggregate)
+ foo();
+// OMP5-NEXT: foo();
+
+#pragma omp target defaultmap(default: aggregate)
+// OMP5-NEXT: #pragma omp target defaultmap(default: aggregate)
+ foo();
+// OMP5-NEXT: foo();
+
+#pragma omp target defaultmap(alloc: pointer)
+// OMP5-NEXT: #pragma omp target defaultmap(alloc: pointer)
+ foo();
+// OMP5-NEXT: foo();
+
+#pragma omp target defaultmap(to: pointer)
+// OMP5-NEXT: #pragma omp target defaultmap(to: pointer)
+ foo();
+// OMP5-NEXT: foo();
+
+#pragma omp target defaultmap(from: pointer)
+// OMP5-NEXT: #pragma omp target defaultmap(from: pointer)
+ foo();
+// OMP5-NEXT: foo();
+
+#pragma omp target defaultmap(tofrom: pointer)
+// OMP5-NEXT: #pragma omp target defaultmap(tofrom: pointer)
+ foo();
+// OMP5-NEXT: foo();
+
+#pragma omp target defaultmap(firstprivate: pointer)
+// OMP5-NEXT: #pragma omp target defaultmap(firstprivate: pointer)
+ foo();
+// OMP5-NEXT: foo();
+
+#pragma omp target defaultmap(none: pointer)
+// OMP5-NEXT: #pragma omp target defaultmap(none: pointer)
+ foo();
+// OMP5-NEXT: foo();
+
+#pragma omp target defaultmap(default: pointer)
+// OMP5-NEXT: #pragma omp target defaultmap(default: pointer)
+ foo();
+// OMP5-NEXT: foo();
+
+#pragma omp target defaultmap(to: scalar) defaultmap(tofrom: pointer)
+// OMP5-NEXT: #pragma omp target defaultmap(to: scalar) defaultmap(tofrom: pointer)
+ foo();
+// OMP5-NEXT: foo();
+
+#pragma omp target defaultmap(from: pointer) defaultmap(none: aggregate)
+// OMP5-NEXT: #pragma omp target defaultmap(from: pointer) defaultmap(none: aggregate)
+ foo();
+// OMP5-NEXT: foo();
+
+#pragma omp target defaultmap(default: aggregate) defaultmap(alloc: scalar)
+// OMP5-NEXT: #pragma omp target defaultmap(default: aggregate) defaultmap(alloc: scalar)
+ foo();
+// OMP5-NEXT: foo();
+
+#pragma omp target defaultmap(alloc: aggregate) defaultmap(firstprivate: scalar) defaultmap(tofrom: pointer)
+// OMP5-NEXT: #pragma omp target defaultmap(alloc: aggregate) defaultmap(firstprivate: scalar) defaultmap(tofrom: pointer)
+ foo();
+// OMP5-NEXT: foo();
+
+#pragma omp target defaultmap(tofrom: aggregate) defaultmap(to: pointer) defaultmap(alloc: scalar)
+// OMP5-NEXT: #pragma omp target defaultmap(tofrom: aggregate) defaultmap(to: pointer) defaultmap(alloc: scalar)
+ foo();
+// OMP5-NEXT: foo();
+
+ int *g;
+// OMP5-NEXT: int *g;
+
+#pragma omp target is_device_ptr(g) defaultmap(none: pointer)
+// OMP5-NEXT: #pragma omp target is_device_ptr(g) defaultmap(none: pointer)
+ g++;
+// OMP5-NEXT: g++;
+
+#pragma omp target private(g) defaultmap(none: pointer)
+// OMP5-NEXT: #pragma omp target private(g) defaultmap(none: pointer)
+ g++;
+// OMP5-NEXT: g++;
+
+#pragma omp target firstprivate(g) defaultmap(none: pointer)
+// OMP5-NEXT: #pragma omp target firstprivate(g) defaultmap(none: pointer)
+ g++;
+// OMP5-NEXT: g++;
+
+#pragma omp target defaultmap(none: scalar) map(to: i)
+// OMP5-NEXT: #pragma omp target defaultmap(none: scalar) map(to: i)
+ i++;
+// OMP5-NEXT: i++;
+
+#pragma omp target defaultmap(none: aggregate) map(to: a)
+// OMP5-NEXT: #pragma omp target defaultmap(none: aggregate) map(to: a)
+ a[3]++;
+// OMP5-NEXT: a[3]++;
+
+#pragma omp target defaultmap(none: scalar)
+// OMP5-NEXT: #pragma omp target defaultmap(none: scalar)
+ bar();
+// OMP5-NEXT: bar();
+ return tmain<int, 5>(argc, &argc) + tmain<char, 1>(argv[0][0], argv[0]);
+}
+
+#endif //OMP5
+#endif
diff --git a/src/llvm-project/clang/test/OpenMP/target_codegen.cpp b/src/llvm-project/clang/test/OpenMP/target_codegen.cpp
index a6f0da17..940edc3 100644
--- a/src/llvm-project/clang/test/OpenMP/target_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_codegen.cpp
@@ -42,13 +42,9 @@
// CHECK-DAG: [[S1:%.+]] = type { double }
// CHECK-DAG: [[S2:%.+]] = type { i32, i32, i32 }
// CHECK-DAG: [[ENTTY:%.+]] = type { i8*, i8*, i[[SZ:32|64]], i32, i32 }
-// CHECK-DAG: [[DEVTY:%.+]] = type { i8*, i8*, [[ENTTY]]*, [[ENTTY]]* }
-// CHECK-DAG: [[DSCTY:%.+]] = type { i32, [[DEVTY]]*, [[ENTTY]]*, [[ENTTY]]* }
// TCHECK: [[ENTTY:%.+]] = type { i8*, i8*, i{{32|64}}, i32, i32 }
-// CHECK-DAG: $[[REGFN:\.omp_offloading\..+]] = comdat
-
// We have 9 target regions, but only 8 that actually will generate offloading
// code and have mapped arguments, and only 6 have all-constant map sizes.
@@ -87,16 +83,8 @@
// TCHECK: @{{.+}} = weak constant [[ENTTY]]
// TCHECK-NOT: @{{.+}} = weak constant [[ENTTY]]
-// Check if offloading descriptor is created.
-// CHECK: [[ENTBEGIN:@.+]] = external constant [[ENTTY]]
-// CHECK: [[ENTEND:@.+]] = external constant [[ENTTY]]
-// CHECK: [[DEVBEGIN:@.+]] = extern_weak constant i8
-// CHECK: [[DEVEND:@.+]] = extern_weak constant i8
-// CHECK: [[IMAGES:@.+]] = internal unnamed_addr constant [1 x [[DEVTY]]] [{{.+}} { i8* [[DEVBEGIN]], i8* [[DEVEND]], [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }], comdat($[[REGFN]])
-// CHECK: [[DESC:@.+]] = internal constant [[DSCTY]] { i32 1, [[DEVTY]]* getelementptr inbounds ([1 x [[DEVTY]]], [1 x [[DEVTY]]]* [[IMAGES]], i32 0, i32 0), [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }, comdat($[[REGFN]])
-
// Check target registration is registered as a Ctor.
-// CHECK: appending global [2 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }, { i32, void ()*, i8* } { i32 0, void ()* @[[REGFN]], i8* bitcast (void ()* @[[REGFN]] to i8*) }]
+// CHECK: appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }]
template<typename tx, typename ty>
diff --git a/src/llvm-project/clang/test/OpenMP/target_codegen_registration.cpp b/src/llvm-project/clang/test/OpenMP/target_codegen_registration.cpp
index 626fbcc..828f1b3 100644
--- a/src/llvm-project/clang/test/OpenMP/target_codegen_registration.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_codegen_registration.cpp
@@ -52,13 +52,9 @@
// CHECK-DAG: [[ST1:%.+]] = type { [228 x i32] }
// CHECK-DAG: [[ST2:%.+]] = type { [1128 x i32] }
// CHECK-DAG: [[ENTTY:%.+]] = type { i8*, i8*, i[[SZ:32|64]], i32, i32 }
-// CHECK-DAG: [[DEVTY:%.+]] = type { i8*, i8*, [[ENTTY]]*, [[ENTTY]]* }
-// CHECK-DAG: [[DSCTY:%.+]] = type { i32, [[DEVTY]]*, [[ENTTY]]*, [[ENTTY]]* }
// TCHECK: [[ENTTY:%.+]] = type { i8*, i8*, i[[SZ:32|64]], i32, i32 }
-// CHECK-DAG: $[[REGFN:\.omp_offloading\..+]] = comdat
-
// CHECK-DAG: [[A1:@.+]] = internal global [[SA]]
// CHECK-DAG: [[A2:@.+]] = global [[SA]]
// CHECK-DAG: [[B1:@.+]] = global [[SB]]
@@ -123,69 +119,61 @@
// CHECK-NTARGET-NOT: private unnamed_addr constant [1 x i
// CHECK-DAG: [[NAMEPTR1:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME1:__omp_offloading_[0-9a-f]+_[0-9a-f]+__Z.+_l[0-9]+]]\00"
-// CHECK-DAG: @.omp_offloading.entry.[[NAME1]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR1]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: @.omp_offloading.entry.[[NAME1]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR1]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR2:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME2:.+]]\00"
-// CHECK-DAG: @.omp_offloading.entry.[[NAME2]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR2]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: @.omp_offloading.entry.[[NAME2]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR2]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR3:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME3:.+]]\00"
-// CHECK-DAG: @.omp_offloading.entry.[[NAME3]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR3]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: @.omp_offloading.entry.[[NAME3]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR3]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR4:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME4:.+]]\00"
-// CHECK-DAG: @.omp_offloading.entry.[[NAME4]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR4]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: @.omp_offloading.entry.[[NAME4]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR4]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR5:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME5:.+]]\00"
-// CHECK-DAG: @.omp_offloading.entry.[[NAME5]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR5]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: @.omp_offloading.entry.[[NAME5]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR5]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR6:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME6:.+]]\00"
-// CHECK-DAG: @.omp_offloading.entry.[[NAME6]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR6]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: @.omp_offloading.entry.[[NAME6]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR6]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR7:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME7:.+]]\00"
-// CHECK-DAG: @.omp_offloading.entry.[[NAME7]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR7]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: @.omp_offloading.entry.[[NAME7]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR7]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR8:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME8:.+]]\00"
-// CHECK-DAG: @.omp_offloading.entry.[[NAME8]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR8]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: @.omp_offloading.entry.[[NAME8]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR8]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR9:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME9:.+]]\00"
-// CHECK-DAG: @.omp_offloading.entry.[[NAME9]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR9]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: @.omp_offloading.entry.[[NAME9]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR9]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR10:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME10:.+]]\00"
-// CHECK-DAG: @.omp_offloading.entry.[[NAME10]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR10]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: @.omp_offloading.entry.[[NAME10]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR10]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR11:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME11:.+]]\00"
-// CHECK-DAG: @.omp_offloading.entry.[[NAME11]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR11]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: @.omp_offloading.entry.[[NAME11]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR11]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR12:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME12:.+]]\00"
-// CHECK-DAG: @.omp_offloading.entry.[[NAME12]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR12]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: @.omp_offloading.entry.[[NAME12]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR12]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR1:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME1:__omp_offloading_[0-9a-f]+_[0-9a-f]+__Z.+_l[0-9]+]]\00"
-// TCHECK-DAG: @.omp_offloading.entry.[[NAME1]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR1]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: @.omp_offloading.entry.[[NAME1]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR1]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR2:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME2:.+]]\00"
-// TCHECK-DAG: @.omp_offloading.entry.[[NAME2]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR2]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: @.omp_offloading.entry.[[NAME2]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR2]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR3:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME3:.+]]\00"
-// TCHECK-DAG: @.omp_offloading.entry.[[NAME3]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR3]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: @.omp_offloading.entry.[[NAME3]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR3]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR4:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME4:.+]]\00"
-// TCHECK-DAG: @.omp_offloading.entry.[[NAME4]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR4]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: @.omp_offloading.entry.[[NAME4]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR4]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR5:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME5:.+]]\00"
-// TCHECK-DAG: @.omp_offloading.entry.[[NAME5]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR5]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: @.omp_offloading.entry.[[NAME5]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR5]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR6:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME6:.+]]\00"
-// TCHECK-DAG: @.omp_offloading.entry.[[NAME6]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR6]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: @.omp_offloading.entry.[[NAME6]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR6]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR7:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME7:.+]]\00"
-// TCHECK-DAG: @.omp_offloading.entry.[[NAME7]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR7]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: @.omp_offloading.entry.[[NAME7]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR7]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR8:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME8:.+]]\00"
-// TCHECK-DAG: @.omp_offloading.entry.[[NAME8]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR8]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: @.omp_offloading.entry.[[NAME8]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR8]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR9:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME9:.+]]\00"
-// TCHECK-DAG: @.omp_offloading.entry.[[NAME9]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR9]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: @.omp_offloading.entry.[[NAME9]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR9]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR10:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME10:.+]]\00"
-// TCHECK-DAG: @.omp_offloading.entry.[[NAME10]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR10]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: @.omp_offloading.entry.[[NAME10]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR10]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR11:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME11:.+]]\00"
-// TCHECK-DAG: @.omp_offloading.entry.[[NAME11]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR11]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: @.omp_offloading.entry.[[NAME11]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR11]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR12:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME12:.+]]\00"
-// TCHECK-DAG: @.omp_offloading.entry.[[NAME12]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR12]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
-
-// CHECK: [[ENTBEGIN:@.+]] = external constant [[ENTTY]]
-// CHECK: [[ENTEND:@.+]] = external constant [[ENTTY]]
-// CHECK: [[DEVBEGIN:@.+]] = extern_weak constant i8
-// CHECK: [[DEVEND:@.+]] = extern_weak constant i8
-// CHECK: [[IMAGES:@.+]] = internal unnamed_addr constant [1 x [[DEVTY]]] [{{.+}} { i8* [[DEVBEGIN]], i8* [[DEVEND]], [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }], comdat($[[REGFN]])
-// CHECK: [[DESC:@.+]] = internal constant [[DSCTY]] { i32 1, [[DEVTY]]* getelementptr inbounds ([1 x [[DEVTY]]], [1 x [[DEVTY]]]* [[IMAGES]], i32 0, i32 0), [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }, comdat($[[REGFN]])
+// TCHECK-DAG: @.omp_offloading.entry.[[NAME12]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR12]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// We have 4 initializers, one for the 500 priority, another one for 501, or more for the default priority, and the last one for the offloading registration function.
-// CHECK: @llvm.global_ctors = appending global [5 x { i32, void ()*, i8* }] [
+// CHECK: @llvm.global_ctors = appending global [4 x { i32, void ()*, i8* }] [
// CHECK-SAME: { i32, void ()*, i8* } { i32 500, void ()* [[P500:@[^,]+]], i8* null },
// CHECK-SAME: { i32, void ()*, i8* } { i32 501, void ()* [[P501:@[^,]+]], i8* null },
// CHECK-SAME: { i32, void ()*, i8* } { i32 65535, void ()* [[PMAX:@[^,]+]], i8* null },
-// CHECK-SAME: { i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null },
-// CHECK-SAME: { i32, void ()*, i8* } { i32 0, void ()* @[[REGFN]], i8* bitcast (void ()* @[[REGFN]] to i8*) }]
+// CHECK-SAME: { i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }
// CHECK-NTARGET: @llvm.global_ctors = appending global [3 x { i32, void ()*, i8* }] [
@@ -356,12 +344,8 @@
// CHECK-NTARGET-NOT: __tgt_target
// CHECK-NTARGET-NOT: __tgt_register_requires
-// CHECK-NTARGET-NOT: __tgt_register_lib
-// CHECK-NTARGET-NOT: __tgt_unregister_lib
// TCHECK-NOT: __tgt_target
-// TCHECK-NOT: __tgt_register_lib
-// TCHECK-NOT: __tgt_unregister_lib
// We have 2 initializers with priority 500
//CHECK: define internal void [[P500]](
@@ -387,25 +371,6 @@
//CHECK-NOT: call void @{{.+}}()
//CHECK: ret void
-// Check registration and unregistration
-
-//CHECK: define internal void @.omp_offloading.requires_reg()
-//CHECK: call void @__tgt_register_requires(i64 1)
-//CHECK: ret void
-
-//CHECK: define internal void @[[UNREGFN:.+]](i8*)
-//CHECK-SAME: comdat($[[REGFN]]) {
-//CHECK: call i32 @__tgt_unregister_lib([[DSCTY]]* [[DESC]])
-//CHECK: ret void
-//CHECK: declare i32 @__tgt_unregister_lib([[DSCTY]]*)
-
-//CHECK: define linkonce hidden void @[[REGFN]]()
-//CHECK-SAME: comdat {
-//CHECK: call i32 @__tgt_register_lib([[DSCTY]]* [[DESC]])
-//CHECK: call i32 @__cxa_atexit(void (i8*)* @[[UNREGFN]], i8* bitcast ([[DSCTY]]* [[DESC]] to i8*),
-//CHECK: ret void
-//CHECK: declare i32 @__tgt_register_lib([[DSCTY]]*)
-
static __attribute__((init_priority(500))) SA a1;
SA a2;
SB __attribute__((init_priority(500))) b1;
@@ -438,31 +403,31 @@
// Check metadata is properly generated:
// CHECK: !omp_offload.info = !{!{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID:-?[0-9]+]], i32 [[FILEID:-?[0-9]+]], !"_ZN2SB3fooEv", i32 217, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SDD1Ev", i32 267, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SEC1Ev", i32 283, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SED1Ev", i32 289, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EE3fooEv", i32 300, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EEC1Ev", i32 306, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_Z3bari", i32 433, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EED1Ev", i32 312, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EEC1Ev", i32 306, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EED1Ev", i32 312, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EE3fooEv", i32 300, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SCC1Ev", i32 242, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID:-?[0-9]+]], i32 [[FILEID:-?[0-9]+]], !"_ZN2SB3fooEv", i32 205, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SDD1Ev", i32 255, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SEC1Ev", i32 271, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SED1Ev", i32 277, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EE3fooEv", i32 288, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EEC1Ev", i32 294, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_Z3bari", i32 398, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EED1Ev", i32 300, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EEC1Ev", i32 294, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EED1Ev", i32 300, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EE3fooEv", i32 288, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SCC1Ev", i32 230, i32 {{[0-9]+}}}
// TCHECK: !omp_offload.info = !{!{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID:-?[0-9]+]], i32 [[FILEID:-?[0-9]+]], !"_ZN2SB3fooEv", i32 217, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SDD1Ev", i32 267, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SEC1Ev", i32 283, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SED1Ev", i32 289, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EE3fooEv", i32 300, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EEC1Ev", i32 306, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_Z3bari", i32 433, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EED1Ev", i32 312, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EEC1Ev", i32 306, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EED1Ev", i32 312, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EE3fooEv", i32 300, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SCC1Ev", i32 242, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID:-?[0-9]+]], i32 [[FILEID:-?[0-9]+]], !"_ZN2SB3fooEv", i32 205, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SDD1Ev", i32 255, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SEC1Ev", i32 271, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SED1Ev", i32 277, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EE3fooEv", i32 288, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EEC1Ev", i32 294, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_Z3bari", i32 398, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EED1Ev", i32 300, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EEC1Ev", i32 294, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EED1Ev", i32 300, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EE3fooEv", i32 288, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SCC1Ev", i32 230, i32 {{[0-9]+}}}
#endif
diff --git a/src/llvm-project/clang/test/OpenMP/target_data_codegen.cpp b/src/llvm-project/clang/test/OpenMP/target_data_codegen.cpp
index 87dfc38..f1c9f62 100644
--- a/src/llvm-project/clang/test/OpenMP/target_data_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_data_codegen.cpp
@@ -40,6 +40,10 @@
// CK1: [[SIZE04:@.+]] = {{.+}}constant [2 x i64] [i64 sdiv exact (i64 sub (i64 ptrtoint (double** getelementptr (double*, double** getelementptr inbounds (%struct.ST, %struct.ST* @gb, i32 0, i32 1), i32 1) to i64), i64 ptrtoint (double** getelementptr inbounds (%struct.ST, %struct.ST* @gb, i32 0, i32 1) to i64)), i64 ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64)), i64 24]
// CK1: [[MTYPE04:@.+]] = {{.+}}constant [2 x i64] [i64 32, i64 281474976710673]
+// CK1: [[MTYPE05:@.+]] = {{.+}}constant [1 x i64] [i64 1057]
+
+// CK1: [[MTYPE06:@.+]] = {{.+}}constant [1 x i64] [i64 1061]
+
// CK1-LABEL: _Z3fooi
void foo(int arg) {
int la;
@@ -163,6 +167,64 @@
// CK1-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P]]
#pragma omp target data map(to: gb.b[:3])
{++arg;}
+
+ // CK1: %{{.+}} = add nsw i32 %{{[^,]+}}, 1
+ {++arg;}
+
+ // Region 05
+ // CK1-DAG: call void @__tgt_target_data_begin(i64 -1, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], i[[sz]]* [[GEPS:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE05]]{{.+}})
+ // CK1-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]]
+ // CK1-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]]
+ // CK1-DAG: [[GEPS]] = getelementptr inbounds {{.+}}[[S:%[^,]+]]
+
+ // CK1-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0
+ // CK1-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0
+ // CK1-DAG: [[S0:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 0
+ // CK1-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to float**
+ // CK1-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to float**
+ // CK1-DAG: store float* [[VAR0:%.+]], float** [[CBP0]]
+ // CK1-DAG: store float* [[VAR0]], float** [[CP0]]
+ // CK1-DAG: store i[[sz]] [[CSVAL0:%[^,]+]], i[[sz]]* [[S0]]
+ // CK1-64-DAG: [[CSVAL0]] = mul nuw i64 %{{[^,]+}}, 4
+ // CK1-32-DAG: [[CSVAL0]] = sext i32 [[CSVAL032:%.+]] to i64
+ // CK1-32-DAG: [[CSVAL032]] = mul nuw i32 %{{[^,]+}}, 4
+ // CK1: %{{.+}} = add nsw i32 %{{[^,]+}}, 1
+
+ // CK1-DAG: call void @__tgt_target_data_end(i64 -1, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], i[[sz]]* [[GEPS:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE05]]{{.+}})
+ // CK1-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP]]
+ // CK1-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P]]
+ // CK1-DAG: [[GEPS]] = getelementptr inbounds {{.+}}[[S]]
+ #pragma omp target data map(close, to: lb)
+ {++arg;}
+
+ // CK1: %{{.+}} = add nsw i32 %{{[^,]+}}, 1
+ {++arg;}
+
+ // Region 06
+ // CK1-DAG: call void @__tgt_target_data_begin(i64 -1, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], i[[sz]]* [[GEPS:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE06]]{{.+}})
+ // CK1-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]]
+ // CK1-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]]
+ // CK1-DAG: [[GEPS]] = getelementptr inbounds {{.+}}[[S:%[^,]+]]
+
+ // CK1-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0
+ // CK1-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0
+ // CK1-DAG: [[S0:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 0
+ // CK1-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to float**
+ // CK1-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to float**
+ // CK1-DAG: store float* [[VAR0:%.+]], float** [[CBP0]]
+ // CK1-DAG: store float* [[VAR0]], float** [[CP0]]
+ // CK1-DAG: store i[[sz]] [[CSVAL0:%[^,]+]], i[[sz]]* [[S0]]
+ // CK1-64-DAG: [[CSVAL0]] = mul nuw i64 %{{[^,]+}}, 4
+ // CK1-32-DAG: [[CSVAL0]] = sext i32 [[CSVAL032:%.+]] to i64
+ // CK1-32-DAG: [[CSVAL032]] = mul nuw i32 %{{[^,]+}}, 4
+ // CK1: %{{.+}} = add nsw i32 %{{[^,]+}}, 1
+
+ // CK1-DAG: call void @__tgt_target_data_end(i64 -1, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], i[[sz]]* [[GEPS:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE06]]{{.+}})
+ // CK1-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP]]
+ // CK1-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P]]
+ // CK1-DAG: [[GEPS]] = getelementptr inbounds {{.+}}[[S]]
+ #pragma omp target data map(always close, to: lb)
+ {++arg;}
}
#endif
///==========================================================================///
@@ -283,4 +345,150 @@
{++arg;}
}
#endif
+///==========================================================================///
+// RUN: %clang_cc1 -DCK4 -verify -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck %s --check-prefix CK4 --check-prefix CK4-64
+// RUN: %clang_cc1 -DCK4 -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CK4 --check-prefix CK4-64
+// RUN: %clang_cc1 -DCK4 -verify -fopenmp -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck %s --check-prefix CK4 --check-prefix CK4-32
+// RUN: %clang_cc1 -DCK4 -fopenmp -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CK4 --check-prefix CK4-32
+
+// RUN: %clang_cc1 -DCK4 -verify -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -DCK4 -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -DCK4 -verify -fopenmp-simd -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -DCK4 -fopenmp-simd -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY1 %s
+// SIMD-ONLY1-NOT: {{__kmpc|__tgt}}
+#ifdef CK4
+
+// CK4: [[STT:%.+]] = type { i32, double* }
+template <typename T>
+struct STT {
+ T a;
+ double *b;
+
+ T foo(T arg) {
+ // Region 00
+ #pragma omp target data map(always, close to: b[1:3]) if(a>123) device(arg)
+ {arg++;}
+ return arg;
+ }
+};
+
+// CK4: [[MTYPE00:@.+]] = {{.+}}constant [2 x i64] [i64 32, i64 281474976711701]
+
+// CK4-LABEL: _Z3bari
+int bar(int arg){
+ STT<int> A;
+ return A.foo(arg);
+}
+
+// Region 00
+// CK4: br i1 %{{[^,]+}}, label %[[IFTHEN:[^,]+]], label %[[IFELSE:[^,]+]]
+// CK4: [[IFTHEN]]
+// CK4-DAG: call void @__tgt_target_data_begin(i64 [[DEV:%[^,]+]], i32 2, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], i[[sz:64|32]]* [[GEPS:%.+]], {{.+}}getelementptr {{.+}}[2 x i{{.+}}]* [[MTYPE00]]{{.+}})
+// CK4-DAG: [[DEV]] = sext i32 [[DEVi32:%[^,]+]] to i64
+// CK4-DAG: [[DEVi32]] = load i32, i32* %{{[^,]+}},
+// CK4-DAG: [[GEPBP]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[BP:%[^,]+]]
+// CK4-DAG: [[GEPP]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[P:%[^,]+]]
+// CK4-DAG: [[GEPS]] = getelementptr inbounds [2 x i[[sz]]], [2 x i[[sz]]]* [[S:%[^,]+]]
+
+// CK4-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0
+// CK4-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0
+// CK4-DAG: [[S0:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 0
+// CK4-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[STT]]**
+// CK4-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to double***
+// CK4-DAG: store [[STT]]* [[VAR0:%.+]], [[STT]]** [[CBP0]]
+// CK4-DAG: store double** [[SEC0:%.+]], double*** [[CP0]]
+// CK4-DAG: store i[[sz]] {{%.+}}, i[[sz]]* [[S0]]
+// CK4-DAG: [[SEC0]] = getelementptr inbounds {{.*}}[[STT]]* [[VAR0]], i32 0, i32 1
+
+// CK4-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1
+// CK4-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1
+// CK4-DAG: [[S1:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 1
+// CK4-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to double***
+// CK4-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to double**
+// CK4-DAG: store double** [[SEC0]], double*** [[CBP1]]
+// CK4-DAG: store double* [[SEC1:%.+]], double** [[CP1]]
+// CK4-DAG: store i[[sz]] 24, i[[sz]]* [[S1]]
+// CK4-DAG: [[SEC1]] = getelementptr inbounds {{.*}}double* [[SEC11:%[^,]+]], i{{.+}} 1
+// CK4-DAG: [[SEC11]] = load double*, double** [[SEC111:%[^,]+]],
+// CK4-DAG: [[SEC111]] = getelementptr inbounds {{.*}}[[STT]]* [[VAR0]], i32 0, i32 1
+
+// CK4: br label %[[IFEND:[^,]+]]
+
+// CK4: [[IFELSE]]
+// CK4: br label %[[IFEND]]
+// CK4: [[IFEND]]
+// CK4: %{{.+}} = add nsw i32 %{{[^,]+}}, 1
+// CK4: br i1 %{{[^,]+}}, label %[[IFTHEN:[^,]+]], label %[[IFELSE:[^,]+]]
+
+// CK4: [[IFTHEN]]
+// CK4-DAG: call void @__tgt_target_data_end(i64 [[DEV:%[^,]+]], i32 2, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], i[[sz]]* [[GEPS:%.+]], {{.+}}getelementptr {{.+}}[2 x i{{.+}}]* [[MTYPE00]]{{.+}})
+// CK4-DAG: [[DEV]] = sext i32 [[DEVi32:%[^,]+]] to i64
+// CK4-DAG: [[DEVi32]] = load i32, i32* %{{[^,]+}},
+// CK4-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP]]
+// CK4-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P]]
+// CK4-DAG: [[GEPS]] = getelementptr inbounds {{.+}}[[S]]
+// CK4: br label %[[IFEND:[^,]+]]
+// CK4: [[IFELSE]]
+// CK4: br label %[[IFEND]]
+// CK4: [[IFEND]]
+#endif
+///==========================================================================///
+// RUN: %clang_cc1 -DCK5 -verify -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck %s --check-prefix CK5 --check-prefix CK5-64
+// RUN: %clang_cc1 -DCK5 -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CK5 --check-prefix CK5-64
+// RUN: %clang_cc1 -DCK5 -verify -fopenmp -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck %s --check-prefix CK5 --check-prefix CK5-32
+// RUN: %clang_cc1 -DCK5 -fopenmp -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CK5 --check-prefix CK5-32
+
+// RUN: %clang_cc1 -DCK5 -verify -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY2 %s
+// RUN: %clang_cc1 -DCK5 -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY2 %s
+// RUN: %clang_cc1 -DCK5 -verify -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY2 %s
+// RUN: %clang_cc1 -DCK5 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY2 %s
+// SIMD-ONLY2-NOT: {{__kmpc|__tgt}}#ifdef CK5
+#ifdef CK5
+struct S1 {
+ int i;
+};
+struct S2 {
+ S1 s;
+ struct S2 *ps;
+};
+
+void test_close_modifier(int arg) {
+ S2 *ps;
+ // CK5: private unnamed_addr constant [5 x i64] [i64 1059, i64 32, {{.*}}, i64 16, i64 1043]
+ #pragma omp target data map(close,tofrom: arg, ps->ps->ps->ps->s)
+ {
+ ++(arg);
+ }
+}
+#endif
+///==========================================================================///
+// RUN: %clang_cc1 -DCK6 -verify -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck %s --check-prefix CK6 --check-prefix CK6-64
+// RUN: %clang_cc1 -DCK6 -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CK6 --check-prefix CK6-64
+// RUN: %clang_cc1 -DCK6 -verify -fopenmp -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck %s --check-prefix CK6 --check-prefix CK6-32
+// RUN: %clang_cc1 -DCK6 -fopenmp -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CK6 --check-prefix CK6-32
+
+// RUN: %clang_cc1 -DCK6 -verify -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY2 %s
+// RUN: %clang_cc1 -DCK6 -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY2 %s
+// RUN: %clang_cc1 -DCK6 -verify -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY2 %s
+// RUN: %clang_cc1 -DCK6 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY2 %s
+// SIMD-ONLY2-NOT: {{__kmpc|__tgt}}
+#ifdef CK6
+void test_close_modifier(int arg) {
+ // CK6: private unnamed_addr constant [1 x i64] [i64 1059]
+ #pragma omp target data map(close,tofrom: arg)
+ {++arg;}
+}
+#endif
#endif
diff --git a/src/llvm-project/clang/test/OpenMP/target_data_messages.c b/src/llvm-project/clang/test/OpenMP/target_data_messages.c
index 9497ddb..7dd48f7 100644
--- a/src/llvm-project/clang/test/OpenMP/target_data_messages.c
+++ b/src/llvm-project/clang/test/OpenMP/target_data_messages.c
@@ -4,6 +4,13 @@
void foo() { }
+void xxx(int argc) {
+ int map; // expected-note {{initialize the variable 'map' to silence this warning}}
+#pragma omp target data map(map) // expected-warning {{variable 'map' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
int main(int argc, char **argv) {
int a;
#pragma omp target data // expected-error {{expected at least one 'map' or 'use_device_ptr' clause for '#pragma omp target data'}}
diff --git a/src/llvm-project/clang/test/OpenMP/target_defaultmap_codegen.cpp b/src/llvm-project/clang/test/OpenMP/target_defaultmap_codegen.cpp
new file mode 100644
index 0000000..5cff255
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/target_defaultmap_codegen.cpp
@@ -0,0 +1,1557 @@
+// expected-no-diagnostics
+#ifndef HEADER
+#define HEADER
+
+#ifdef CK1
+
+///==========================================================================///
+// RUN: %clang_cc1 -DCK1 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK1
+// RUN: %clang_cc1 -DCK1 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK1
+// RUN: %clang_cc1 -DCK1 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK1
+// RUN: %clang_cc1 -DCK1 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK1
+
+// RUN: %clang_cc1 -DCK1 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY10 %s
+// RUN: %clang_cc1 -DCK1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY10 %s
+// RUN: %clang_cc1 -DCK1 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY10 %s
+// RUN: %clang_cc1 -DCK1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY10 %s
+// SIMD-ONLY10-NOT: {{__kmpc|__tgt}}
+
+// CK1-LABEL: @.__omp_offloading_{{.*}}implicit_maps_double_complex{{.*}}_l44.region_id = weak constant i8 0
+
+// CK1-DAG: [[SIZES:@.+]] = {{.+}}constant [1 x i64] [i64 16]
+// Map types: OMP_MAP_TARGET_PARAM | OMP_MAP_IMPLICIT = 544
+// CK1-DAG: [[TYPES:@.+]] = {{.+}}constant [1 x i64] [i64 544]
+
+// CK1-LABEL: implicit_maps_double_complex{{.*}}(
+void implicit_maps_double_complex (int a){
+ double _Complex dc = (double)a;
+
+ // CK1-DAG: call i32 @__tgt_target(i64 {{.+}}, i8* {{.+}}, i32 1, i8** [[BPGEP:%[0-9]+]], i8** [[PGEP:%[0-9]+]], {{.+}}[[SIZES]]{{.+}}, {{.+}}[[TYPES]]{{.+}})
+ // CK1-DAG: [[BPGEP]] = getelementptr inbounds {{.+}}[[BPS:%[^,]+]], i32 0, i32 0
+ // CK1-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0
+ // CK1-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0
+ // CK1-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0
+ // CK1-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to { double, double }**
+ // CK1-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to { double, double }**
+ // CK1-DAG: store { double, double }* [[PTR:%[^,]+]], { double, double }** [[CBP1]]
+ // CK1-DAG: store { double, double }* [[PTR]], { double, double }** [[CP1]]
+
+ // CK1: call void [[KERNEL:@.+]]({ double, double }* [[PTR]])
+ #pragma omp target defaultmap(alloc:scalar)
+ {
+ dc *= dc;
+ }
+}
+
+// CK1: define internal void [[KERNEL]]({ double, double }* {{.*}}[[ARG:%.+]])
+// CK1: [[ADDR:%.+]] = alloca { double, double }*,
+// CK1: store { double, double }* [[ARG]], { double, double }** [[ADDR]],
+// CK1: [[REF:%.+]] = load { double, double }*, { double, double }** [[ADDR]],
+// CK1: {{.+}} = getelementptr inbounds { double, double }, { double, double }* [[REF]], i32 0, i32 0
+#endif
+///==========================================================================///
+// RUN: %clang_cc1 -DCK2 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK2
+// RUN: %clang_cc1 -DCK2 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK2
+// RUN: %clang_cc1 -DCK2 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK2
+// RUN: %clang_cc1 -DCK2 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK2
+
+// RUN: %clang_cc1 -DCK2 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY10 %s
+// RUN: %clang_cc1 -DCK2 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY10 %s
+// RUN: %clang_cc1 -DCK2 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY10 %s
+// RUN: %clang_cc1 -DCK2 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY10 %s
+// SIMD-ONLY10-NOT: {{__kmpc|__tgt}}
+#ifdef CK2
+
+// CK2-LABEL: @.__omp_offloading_{{.*}}implicit_maps_double_complex{{.*}}_l94.region_id = weak constant i8 0
+
+// CK2-DAG: [[SIZES:@.+]] = {{.+}}constant [1 x i64] [i64 16]
+// Map types: OMP_MAP_TO | OMP_MAP_TARGET_PARAM | OMP_MAP_IMPLICIT = 545
+// CK2-DAG: [[TYPES:@.+]] = {{.+}}constant [1 x i64] [i64 545]
+
+// CK2-LABEL: implicit_maps_double_complex{{.*}}(
+void implicit_maps_double_complex (int a){
+ double _Complex dc = (double)a;
+
+ // CK2-DAG: call i32 @__tgt_target(i64 {{.+}}, i8* {{.+}}, i32 1, i8** [[BPGEP:%[0-9]+]], i8** [[PGEP:%[0-9]+]], {{.+}}[[SIZES]]{{.+}}, {{.+}}[[TYPES]]{{.+}})
+ // CK2-DAG: [[BPGEP]] = getelementptr inbounds {{.+}}[[BPS:%[^,]+]], i32 0, i32 0
+ // CK2-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0
+ // CK2-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0
+ // CK2-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0
+ // CK2-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to { double, double }**
+ // CK2-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to { double, double }**
+ // CK2-DAG: store { double, double }* [[PTR:%[^,]+]], { double, double }** [[CBP1]]
+ // CK2-DAG: store { double, double }* [[PTR]], { double, double }** [[CP1]]
+
+ // CK2: call void [[KERNEL:@.+]]({ double, double }* [[PTR]])
+ #pragma omp target defaultmap(to:scalar)
+ {
+ dc *= dc;
+ }
+}
+
+// CK2: define internal void [[KERNEL]]({ double, double }* {{.*}}[[ARG:%.+]])
+// CK2: [[ADDR:%.+]] = alloca { double, double }*,
+// CK2: store { double, double }* [[ARG]], { double, double }** [[ADDR]],
+// CK2: [[REF:%.+]] = load { double, double }*, { double, double }** [[ADDR]],
+// CK2: {{.+}} = getelementptr inbounds { double, double }, { double, double }* [[REF]], i32 0, i32 0
+#endif
+///==========================================================================///
+// RUN: %clang_cc1 -DCK3 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK3
+// RUN: %clang_cc1 -DCK3 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK3
+// RUN: %clang_cc1 -DCK3 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK3
+// RUN: %clang_cc1 -DCK3 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK3
+
+// RUN: %clang_cc1 -DCK3 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY10 %s
+// RUN: %clang_cc1 -DCK3 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY10 %s
+// RUN: %clang_cc1 -DCK3 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY10 %s
+// RUN: %clang_cc1 -DCK3 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY10 %s
+// SIMD-ONLY10-NOT: {{__kmpc|__tgt}}
+#ifdef CK3
+
+// CK3-LABEL: @.__omp_offloading_{{.*}}implicit_maps_double_complex{{.*}}_l144.region_id = weak constant i8 0
+
+// CK3-DAG: [[SIZES:@.+]] = {{.+}}constant [1 x i64] [i64 16]
+// Map types: OMP_MAP_FROM | OMP_MAP_TARGET_PARAM | OMP_MAP_IMPLICIT = 546
+// CK3-DAG: [[TYPES:@.+]] = {{.+}}constant [1 x i64] [i64 546]
+
+// CK3-LABEL: implicit_maps_double_complex{{.*}}(
+void implicit_maps_double_complex (int a){
+ double _Complex dc = (double)a;
+
+ // CK3-DAG: call i32 @__tgt_target(i64 {{.+}}, i8* {{.+}}, i32 1, i8** [[BPGEP:%[0-9]+]], i8** [[PGEP:%[0-9]+]], {{.+}}[[SIZES]]{{.+}}, {{.+}}[[TYPES]]{{.+}})
+ // CK3-DAG: [[BPGEP]] = getelementptr inbounds {{.+}}[[BPS:%[^,]+]], i32 0, i32 0
+ // CK3-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0
+ // CK3-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0
+ // CK3-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0
+ // CK3-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to { double, double }**
+ // CK3-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to { double, double }**
+ // CK3-DAG: store { double, double }* [[PTR:%[^,]+]], { double, double }** [[CBP1]]
+ // CK3-DAG: store { double, double }* [[PTR]], { double, double }** [[CP1]]
+
+ // CK3: call void [[KERNEL:@.+]]({ double, double }* [[PTR]])
+ #pragma omp target defaultmap(from:scalar)
+ {
+ dc *= dc;
+ }
+}
+
+// CK3: define internal void [[KERNEL]]({ double, double }* {{.*}}[[ARG:%.+]])
+// CK3: [[ADDR:%.+]] = alloca { double, double }*,
+// CK3: store { double, double }* [[ARG]], { double, double }** [[ADDR]],
+// CK3: [[REF:%.+]] = load { double, double }*, { double, double }** [[ADDR]],
+// CK3: {{.+}} = getelementptr inbounds { double, double }, { double, double }* [[REF]], i32 0, i32 0
+#endif
+///==========================================================================///
+// RUN: %clang_cc1 -DCK4 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK4 --check-prefix CK4-64
+// RUN: %clang_cc1 -DCK4 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK4 --check-prefix CK4-64
+// RUN: %clang_cc1 -DCK4 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK4 --check-prefix CK4-32
+// RUN: %clang_cc1 -DCK4 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK4 --check-prefix CK4-32
+
+// RUN: %clang_cc1 -DCK4 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY6 %s
+// RUN: %clang_cc1 -DCK4 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY6 %s
+// RUN: %clang_cc1 -DCK4 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY6 %s
+// RUN: %clang_cc1 -DCK4 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY6 %s
+// SIMD-ONLY6-NOT: {{__kmpc|__tgt}}
+#ifdef CK4
+
+// For a 32-bit targets, the value doesn't fit the size of the pointer,
+// therefore it is passed by reference with a map 'to' specification.
+
+// CK4-LABEL: @.__omp_offloading_{{.*}}implicit_maps_double{{.*}}_l209.region_id = weak constant i8 0
+
+// CK4-DAG: [[SIZES:@.+]] = {{.+}}constant [1 x i64] [i64 8]
+// Map types: OMP_MAP_PRIVATE_VAL | OMP_MAP_TARGET_PARAM | OMP_MAP_IMPLICIT = 800
+// CK4-64-DAG: [[TYPES:@.+]] = {{.+}}constant [1 x i64] [i64 800]
+// Map types: OMP_MAP_TO | OMP_MAP_PRIVATE | OMP_MAP_TARGET_PARAM | OMP_MAP_IMPLICIT = 673
+// CK4-32-DAG: [[TYPES:@.+]] = {{.+}}constant [1 x i64] [i64 673]
+
+// CK4-LABEL: implicit_maps_double{{.*}}(
+void implicit_maps_double (int a){
+ double d = (double)a;
+
+ // CK4-DAG: call i32 @__tgt_target(i64 {{.+}}, i8* {{.+}}, i32 1, i8** [[BPGEP:%[0-9]+]], i8** [[PGEP:%[0-9]+]], {{.+}}[[SIZES]]{{.+}}, {{.+}}[[TYPES]]{{.+}})
+ // CK4-DAG: [[BPGEP]] = getelementptr inbounds {{.+}}[[BPS:%[^,]+]], i32 0, i32 0
+ // CK4-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0
+ // CK4-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0
+ // CK4-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0
+
+ // CK4-64-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i[[sz:64|32]]*
+ // CK4-64-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i[[sz]]*
+ // CK4-64-DAG: store i[[sz]] [[VAL:%[^,]+]], i[[sz]]* [[CBP1]]
+ // CK4-64-DAG: store i[[sz]] [[VAL]], i[[sz]]* [[CP1]]
+ // CK4-64-DAG: [[VAL]] = load i[[sz]], i[[sz]]* [[ADDR:%.+]],
+ // CK4-64-64-DAG: [[CADDR:%.+]] = bitcast i[[sz]]* [[ADDR]] to double*
+ // CK4-64-64-DAG: store double {{.+}}, double* [[CADDR]],
+
+ // CK4-32-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to double**
+ // CK4-32-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to double**
+ // CK4-32-DAG: store double* [[DECL:%[^,]+]], double** [[CBP1]]
+ // CK4-32-DAG: store double* [[DECL]], double** [[CP1]]
+
+ // CK4-64: call void [[KERNEL:@.+]](i[[sz]] [[VAL]])
+ // CK4-32: call void [[KERNEL:@.+]](double* [[DECL]])
+ #pragma omp target defaultmap(firstprivate:scalar)
+ {
+ d += 1.0;
+ }
+}
+
+// CK4-64: define internal void [[KERNEL]](i[[sz]] [[ARG:%.+]])
+// CK4-64: [[ADDR:%.+]] = alloca i[[sz]],
+// CK4-64: store i[[sz]] [[ARG]], i[[sz]]* [[ADDR]],
+// CK4-64: [[CADDR:%.+]] = bitcast i64* [[ADDR]] to double*
+// CK4-64: {{.+}} = load double, double* [[CADDR]],
+
+// CK4-32: define internal void [[KERNEL]](double* {{.+}}[[ARG:%.+]])
+// CK4-32: [[ADDR:%.+]] = alloca double*,
+// CK4-32: store double* [[ARG]], double** [[ADDR]],
+// CK4-32: [[REF:%.+]] = load double*, double** [[ADDR]],
+// CK4-32: {{.+}} = load double, double* [[REF]],
+
+#endif
+///==========================================================================///
+// RUN: %clang_cc1 -DCK5 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK5
+// RUN: %clang_cc1 -DCK5 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK5
+// RUN: %clang_cc1 -DCK5 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK5
+// RUN: %clang_cc1 -DCK5 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK5
+
+// RUN: %clang_cc1 -DCK5 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY8 %s
+// RUN: %clang_cc1 -DCK5 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY8 %s
+// RUN: %clang_cc1 -DCK5 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY8 %s
+// RUN: %clang_cc1 -DCK5 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY8 %s
+// SIMD-ONLY8-NOT: {{__kmpc|__tgt}}
+#ifdef CK5
+
+// CK5-LABEL: @.__omp_offloading_{{.*}}implicit_maps_array{{.*}}_l266.region_id = weak constant i8 0
+
+// CK5-DAG: [[SIZES:@.+]] = {{.+}}constant [1 x i64] [i64 16]
+// Map types: OMP_MAP_TARGET_PARAM | OMP_MAP_IMPLICIT = 544
+// CK5-DAG: [[TYPES:@.+]] = {{.+}}constant [1 x i64] [i64 544]
+
+// CK5-LABEL: implicit_maps_array{{.*}}(
+void implicit_maps_array (int a){
+ double darr[2] = {(double)a, (double)a};
+
+ // CK5-DAG: call i32 @__tgt_target(i64 {{.+}}, i8* {{.+}}, i32 1, i8** [[BPGEP:%[0-9]+]], i8** [[PGEP:%[0-9]+]], {{.+}}[[SIZES]]{{.+}}, {{.+}}[[TYPES]]{{.+}})
+ // CK5-DAG: [[BPGEP]] = getelementptr inbounds {{.+}}[[BPS:%[^,]+]], i32 0, i32 0
+ // CK5-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0
+ // CK5-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0
+ // CK5-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0
+ // CK5-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to [2 x double]**
+ // CK5-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to [2 x double]**
+ // CK5-DAG: store [2 x double]* [[DECL:%[^,]+]], [2 x double]** [[CBP1]]
+ // CK5-DAG: store [2 x double]* [[DECL]], [2 x double]** [[CP1]]
+
+ // CK5: call void [[KERNEL:@.+]]([2 x double]* [[DECL]])
+ #pragma omp target defaultmap(alloc: aggregate)
+ {
+ darr[0] += 1.0;
+ darr[1] += 1.0;
+ }
+}
+
+// CK5: define internal void [[KERNEL]]([2 x double]* {{.+}}[[ARG:%.+]])
+// CK5: [[ADDR:%.+]] = alloca [2 x double]*,
+// CK5: store [2 x double]* [[ARG]], [2 x double]** [[ADDR]],
+// CK5: [[REF:%.+]] = load [2 x double]*, [2 x double]** [[ADDR]],
+// CK5: {{.+}} = getelementptr inbounds [2 x double], [2 x double]* [[REF]], i{{64|32}} 0, i{{64|32}} 0
+#endif
+///==========================================================================///
+// RUN: %clang_cc1 -DCK6 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK6
+// RUN: %clang_cc1 -DCK6 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK6
+// RUN: %clang_cc1 -DCK6 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK6
+// RUN: %clang_cc1 -DCK6 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK6
+
+// RUN: %clang_cc1 -DCK6 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY8 %s
+// RUN: %clang_cc1 -DCK6 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY8 %s
+// RUN: %clang_cc1 -DCK6 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY8 %s
+// RUN: %clang_cc1 -DCK6 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY8 %s
+// SIMD-ONLY8-NOT: {{__kmpc|__tgt}}
+#ifdef CK6
+
+// CK6-LABEL: @.__omp_offloading_{{.*}}implicit_maps_array{{.*}}_l317.region_id = weak constant i8 0
+
+// CK6-DAG: [[SIZES:@.+]] = {{.+}}constant [1 x i64] [i64 16]
+// Map types: OMP_MAP_TO | OMP_MAP_TARGET_PARAM | OMP_MAP_IMPLICIT = 545
+// CK6-DAG: [[TYPES:@.+]] = {{.+}}constant [1 x i64] [i64 545]
+
+// CK6-LABEL: implicit_maps_array{{.*}}(
+void implicit_maps_array (int a){
+ double darr[2] = {(double)a, (double)a};
+
+ // CK6-DAG: call i32 @__tgt_target(i64 {{.+}}, i8* {{.+}}, i32 1, i8** [[BPGEP:%[0-9]+]], i8** [[PGEP:%[0-9]+]], {{.+}}[[SIZES]]{{.+}}, {{.+}}[[TYPES]]{{.+}})
+ // CK6-DAG: [[BPGEP]] = getelementptr inbounds {{.+}}[[BPS:%[^,]+]], i32 0, i32 0
+ // CK6-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0
+ // CK6-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0
+ // CK6-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0
+ // CK6-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to [2 x double]**
+ // CK6-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to [2 x double]**
+ // CK6-DAG: store [2 x double]* [[DECL:%[^,]+]], [2 x double]** [[CBP1]]
+ // CK6-DAG: store [2 x double]* [[DECL]], [2 x double]** [[CP1]]
+
+ // CK6: call void [[KERNEL:@.+]]([2 x double]* [[DECL]])
+ #pragma omp target defaultmap(to: aggregate)
+ {
+ darr[0] += 1.0;
+ darr[1] += 1.0;
+ }
+}
+
+// CK6: define internal void [[KERNEL]]([2 x double]* {{.+}}[[ARG:%.+]])
+// CK6: [[ADDR:%.+]] = alloca [2 x double]*,
+// CK6: store [2 x double]* [[ARG]], [2 x double]** [[ADDR]],
+// CK6: [[REF:%.+]] = load [2 x double]*, [2 x double]** [[ADDR]],
+// CK6: {{.+}} = getelementptr inbounds [2 x double], [2 x double]* [[REF]], i{{64|32}} 0, i{{64|32}} 0
+#endif
+///==========================================================================///
+// RUN: %clang_cc1 -DCK7 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK7
+// RUN: %clang_cc1 -DCK7 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK7
+// RUN: %clang_cc1 -DCK7 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK7
+// RUN: %clang_cc1 -DCK7 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK7
+
+// RUN: %clang_cc1 -DCK7 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY8 %s
+// RUN: %clang_cc1 -DCK7 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY8 %s
+// RUN: %clang_cc1 -DCK7 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY8 %s
+// RUN: %clang_cc1 -DCK7 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY8 %s
+// SIMD-ONLY8-NOT: {{__kmpc|__tgt}}
+#ifdef CK7
+
+// CK7-LABEL: @.__omp_offloading_{{.*}}implicit_maps_array{{.*}}_l368.region_id = weak constant i8 0
+
+// CK7-DAG: [[SIZES:@.+]] = {{.+}}constant [1 x i64] [i64 16]
+// Map types: OMP_MAP_FROM | OMP_MAP_TARGET_PARAM | OMP_MAP_IMPLICIT = 546
+// CK7-DAG: [[TYPES:@.+]] = {{.+}}constant [1 x i64] [i64 546]
+
+// CK7-LABEL: implicit_maps_array{{.*}}(
+void implicit_maps_array (int a){
+ double darr[2] = {(double)a, (double)a};
+
+ // CK7-DAG: call i32 @__tgt_target(i64 {{.+}}, i8* {{.+}}, i32 1, i8** [[BPGEP:%[0-9]+]], i8** [[PGEP:%[0-9]+]], {{.+}}[[SIZES]]{{.+}}, {{.+}}[[TYPES]]{{.+}})
+ // CK7-DAG: [[BPGEP]] = getelementptr inbounds {{.+}}[[BPS:%[^,]+]], i32 0, i32 0
+ // CK7-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0
+ // CK7-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0
+ // CK7-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0
+ // CK7-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to [2 x double]**
+ // CK7-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to [2 x double]**
+ // CK7-DAG: store [2 x double]* [[DECL:%[^,]+]], [2 x double]** [[CBP1]]
+ // CK7-DAG: store [2 x double]* [[DECL]], [2 x double]** [[CP1]]
+
+ // CK7: call void [[KERNEL:@.+]]([2 x double]* [[DECL]])
+ #pragma omp target defaultmap(from: aggregate)
+ {
+ darr[0] += 1.0;
+ darr[1] += 1.0;
+ }
+}
+
+// CK7: define internal void [[KERNEL]]([2 x double]* {{.+}}[[ARG:%.+]])
+// CK7: [[ADDR:%.+]] = alloca [2 x double]*,
+// CK7: store [2 x double]* [[ARG]], [2 x double]** [[ADDR]],
+// CK7: [[REF:%.+]] = load [2 x double]*, [2 x double]** [[ADDR]],
+// CK7: {{.+}} = getelementptr inbounds [2 x double], [2 x double]* [[REF]], i{{64|32}} 0, i{{64|32}} 0
+#endif
+///==========================================================================///
+// RUN: %clang_cc1 -DCK8 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK8
+// RUN: %clang_cc1 -DCK8 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK8
+// RUN: %clang_cc1 -DCK8 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK8
+// RUN: %clang_cc1 -DCK8 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK8
+
+// RUN: %clang_cc1 -DCK8 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY8 %s
+// RUN: %clang_cc1 -DCK8 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY8 %s
+// RUN: %clang_cc1 -DCK8 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY8 %s
+// RUN: %clang_cc1 -DCK8 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY8 %s
+// SIMD-ONLY8-NOT: {{__kmpc|__tgt}}
+#ifdef CK8
+
+// CK8-LABEL: @.__omp_offloading_{{.*}}implicit_maps_array{{.*}}_l419.region_id = weak constant i8 0
+
+// CK8-DAG: [[SIZES:@.+]] = {{.+}}constant [1 x i64] [i64 16]
+// Map types: OMP_MAP_TO | OMP_MAP_FROM | OMP_MAP_TARGET_PARAM | OMP_MAP_IMPLICIT = 547
+// CK8-DAG: [[TYPES:@.+]] = {{.+}}constant [1 x i64] [i64 547]
+
+// CK8-LABEL: implicit_maps_array{{.*}}(
+void implicit_maps_array (int a){
+ double darr[2] = {(double)a, (double)a};
+
+ // CK8-DAG: call i32 @__tgt_target(i64 {{.+}}, i8* {{.+}}, i32 1, i8** [[BPGEP:%[0-9]+]], i8** [[PGEP:%[0-9]+]], {{.+}}[[SIZES]]{{.+}}, {{.+}}[[TYPES]]{{.+}})
+ // CK8-DAG: [[BPGEP]] = getelementptr inbounds {{.+}}[[BPS:%[^,]+]], i32 0, i32 0
+ // CK8-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0
+ // CK8-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0
+ // CK8-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0
+ // CK8-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to [2 x double]**
+ // CK8-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to [2 x double]**
+ // CK8-DAG: store [2 x double]* [[DECL:%[^,]+]], [2 x double]** [[CBP1]]
+ // CK8-DAG: store [2 x double]* [[DECL]], [2 x double]** [[CP1]]
+
+ // CK8: call void [[KERNEL:@.+]]([2 x double]* [[DECL]])
+ #pragma omp target defaultmap(tofrom: aggregate)
+ {
+ darr[0] += 1.0;
+ darr[1] += 1.0;
+ }
+}
+
+// CK8: define internal void [[KERNEL]]([2 x double]* {{.+}}[[ARG:%.+]])
+// CK8: [[ADDR:%.+]] = alloca [2 x double]*,
+// CK8: store [2 x double]* [[ARG]], [2 x double]** [[ADDR]],
+// CK8: [[REF:%.+]] = load [2 x double]*, [2 x double]** [[ADDR]],
+// CK8: {{.+}} = getelementptr inbounds [2 x double], [2 x double]* [[REF]], i{{64|32}} 0, i{{64|32}} 0
+#endif
+
+///==========================================================================///
+// RUN: %clang_cc1 -DCK9 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK9 --check-prefix CK9-64
+// RUN: %clang_cc1 -DCK9 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK9 --check-prefix CK9-64
+// RUN: %clang_cc1 -DCK9 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK9 --check-prefix CK9-32
+// RUN: %clang_cc1 -DCK9 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK9 --check-prefix CK9-32
+
+// RUN: %clang_cc1 -DCK9 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY26 %s
+// RUN: %clang_cc1 -DCK9 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY26 %s
+// RUN: %clang_cc1 -DCK9 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY26 %s
+// RUN: %clang_cc1 -DCK9 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY26 %s
+// SIMD-ONLY26-NOT: {{__kmpc|__tgt}}
+
+#ifdef CK9
+
+
+// CK9-LABEL: @.__omp_offloading_{{.*}}zero_size_section_and_private_maps{{.*}}_l{{[0-9]+}}.region_id = weak constant i8 0
+// CK9: [[SIZE09:@.+]] = private {{.*}}constant [1 x i64] [i64 40]
+// CK9: [[MTYPE09:@.+]] = private {{.*}}constant [1 x i64] [i64 673]
+
+
+// CK9-LABEL: zero_size_section_and_private_maps{{.*}}(
+void zero_size_section_and_private_maps (int ii){
+ int pvtArr[10];
+
+ // Region 09
+ // CK9-DAG: call i32 @__tgt_target(i64 {{[^,]+}}, i8* {{[^,]+}}, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[SIZE09]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE09]]{{.+}})
+ // CK9-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]]
+ // CK9-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]]
+
+ // CK9-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0
+ // CK9-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0
+ // CK9-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [10 x i32]**
+ // CK9-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [10 x i32]**
+ // CK9-DAG: store [10 x i32]* [[VAR0:%.+]], [10 x i32]** [[CBP0]]
+ // CK9-DAG: store [10 x i32]* [[VAR0]], [10 x i32]** [[CP0]]
+
+ // CK9: call void [[CALL09:@.+]]([10 x i32]* {{[^,]+}})
+ #pragma omp target defaultmap(firstprivate:aggregate)
+ {
+ pvtArr[5]++;
+ }
+
+}
+
+
+#endif
+///==========================================================================///
+// RUN: %clang_cc1 -DCK10 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK10
+// RUN: %clang_cc1 -DCK10 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK10
+// RUN: %clang_cc1 -DCK10 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK10
+// RUN: %clang_cc1 -DCK10 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK10
+
+// RUN: %clang_cc1 -DCK10 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY8 %s
+// RUN: %clang_cc1 -DCK10 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY8 %s
+// RUN: %clang_cc1 -DCK10 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY8 %s
+// RUN: %clang_cc1 -DCK10 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY8 %s
+// SIMD-ONLY8-NOT: {{__kmpc|__tgt}}
+#ifdef CK10
+
+
+// CK10-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l523.region_id = weak constant i8 0
+
+// CK10: [[SIZE:@.+]] = private {{.*}}constant [1 x i64] [i64 {{8|4}}]
+// Map types: OMP_MAP_TARGET_PARAM | OMP_MAP_IMPLICIT = 544
+// CK10: [[MTYPE:@.+]] = private {{.*}}constant [1 x i64] [i64 544]
+
+// CK10-LABEL: explicit_maps_single{{.*}}(
+void explicit_maps_single (){
+ int *pa;
+
+ // CK10-DAG: call i32 @__tgt_target(i64 {{[^,]+}}, i8* {{[^,]+}}, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[SIZE]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE]]{{.+}})
+ // CK10-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]]
+ // CK10-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]]
+
+ // CK10-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0
+ // CK10-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0
+ // CK10-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32***
+ // CK10-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32***
+ // CK10-DAG: store i32** [[VAR0:%.+]], i32*** [[CBP0]]
+ // CK10-DAG: store i32** [[VAR0]], i32*** [[CP0]]
+
+ // CK10: call void [[CALL:@.+]](i32** {{[^,]+}})
+ #pragma omp target defaultmap(alloc: pointer)
+ {
+ pa[50]++;
+ }
+}
+
+ // CK10: define {{.+}}[[CALL]]
+#endif
+///==========================================================================///
+// RUN: %clang_cc1 -DCK11 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK11
+// RUN: %clang_cc1 -DCK11 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK11
+// RUN: %clang_cc1 -DCK11 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK11
+// RUN: %clang_cc1 -DCK11 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK11
+
+// RUN: %clang_cc1 -DCK11 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY8 %s
+// RUN: %clang_cc1 -DCK11 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY8 %s
+// RUN: %clang_cc1 -DCK11 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY8 %s
+// RUN: %clang_cc1 -DCK11 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY8 %s
+// SIMD-ONLY8-NOT: {{__kmpc|__tgt}}
+#ifdef CK11
+
+
+// CK11-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l571.region_id = weak constant i8 0
+
+// CK11: [[SIZE09:@.+]] = private {{.*}}constant [1 x i64] [i64 {{8|4}}]
+// Map types: OMP_MAP_TO | OMP_MAP_TARGET_PARAM | OMP_MAP_IMPLICIT = 545
+// CK11: [[MTYPE09:@.+]] = private {{.*}}constant [1 x i64] [i64 545]
+
+// CK11-LABEL: explicit_maps_single{{.*}}(
+void explicit_maps_single (){
+ int *pa;
+
+ // CK11-DAG: call i32 @__tgt_target(i64 {{[^,]+}}, i8* {{[^,]+}}, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[SIZE09]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE09]]{{.+}})
+ // CK11-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]]
+ // CK11-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]]
+
+ // CK11-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0
+ // CK11-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0
+ // CK11-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32***
+ // CK11-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32***
+ // CK11-DAG: store i32** [[VAR0:%.+]], i32*** [[CBP0]]
+ // CK11-DAG: store i32** [[VAR0]], i32*** [[CP0]]
+
+ // CK11: call void [[CALL09:@.+]](i32** {{[^,]+}})
+ #pragma omp target defaultmap(to: pointer)
+ {
+ pa[50]++;
+ }
+}
+
+ // CK11: define {{.+}}[[CALL09]]
+#endif
+///==========================================================================///
+// RUN: %clang_cc1 -DCK12 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK12
+// RUN: %clang_cc1 -DCK12 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK12
+// RUN: %clang_cc1 -DCK12 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK12
+// RUN: %clang_cc1 -DCK12 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK12
+
+// RUN: %clang_cc1 -DCK12 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY8 %s
+// RUN: %clang_cc1 -DCK12 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY8 %s
+// RUN: %clang_cc1 -DCK12 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY8 %s
+// RUN: %clang_cc1 -DCK12 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY8 %s
+// SIMD-ONLY8-NOT: {{__kmpc|__tgt}}
+#ifdef CK12
+
+
+// CK12-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l619.region_id = weak constant i8 0
+
+// CK12: [[SIZE09:@.+]] = private {{.*}}constant [1 x i64] [i64 {{8|4}}]
+// Map types: OMP_MAP_FROM | OMP_MAP_TARGET_PARAM | OMP_MAP_IMPLICIT = 546
+// CK12: [[MTYPE09:@.+]] = private {{.*}}constant [1 x i64] [i64 546]
+
+// CK12-LABEL: explicit_maps_single{{.*}}(
+void explicit_maps_single (){
+ int *pa;
+
+ // CK12-DAG: call i32 @__tgt_target(i64 {{[^,]+}}, i8* {{[^,]+}}, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[SIZE09]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE09]]{{.+}})
+ // CK12-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]]
+ // CK12-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]]
+
+ // CK12-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0
+ // CK12-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0
+ // CK12-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32***
+ // CK12-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32***
+ // CK12-DAG: store i32** [[VAR0:%.+]], i32*** [[CBP0]]
+ // CK12-DAG: store i32** [[VAR0]], i32*** [[CP0]]
+
+ // CK12: call void [[CALL09:@.+]](i32** {{[^,]+}})
+ #pragma omp target defaultmap(from: pointer)
+ {
+ pa[50]++;
+ }
+}
+
+ // CK12: define {{.+}}[[CALL09]]
+#endif
+///==========================================================================///
+// RUN: %clang_cc1 -DCK13 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK13
+// RUN: %clang_cc1 -DCK13 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK13
+// RUN: %clang_cc1 -DCK13 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK13
+// RUN: %clang_cc1 -DCK13 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK13
+
+// RUN: %clang_cc1 -DCK13 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY8 %s
+// RUN: %clang_cc1 -DCK13 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY8 %s
+// RUN: %clang_cc1 -DCK13 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY8 %s
+// RUN: %clang_cc1 -DCK13 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY8 %s
+// SIMD-ONLY8-NOT: {{__kmpc|__tgt}}
+#ifdef CK13
+
+
+// CK13-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l667.region_id = weak constant i8 0
+
+// CK13: [[SIZE09:@.+]] = private {{.*}}constant [1 x i64] [i64 {{8|4}}]
+// Map types: OMP_MAP_TO | OMP_MAP_FROM | OMP_MAP_TARGET_PARAM | OMP_MAP_IMPLICIT = 547
+// CK13: [[MTYPE09:@.+]] = private {{.*}}constant [1 x i64] [i64 547]
+
+// CK13-LABEL: explicit_maps_single{{.*}}(
+void explicit_maps_single (){
+ int *pa;
+
+ // CK13-DAG: call i32 @__tgt_target(i64 {{[^,]+}}, i8* {{[^,]+}}, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[SIZE09]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE09]]{{.+}})
+ // CK13-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]]
+ // CK13-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]]
+
+ // CK13-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0
+ // CK13-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0
+ // CK13-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32***
+ // CK13-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32***
+ // CK13-DAG: store i32** [[VAR0:%.+]], i32*** [[CBP0]]
+ // CK13-DAG: store i32** [[VAR0]], i32*** [[CP0]]
+
+ // CK13: call void [[CALL09:@.+]](i32** {{[^,]+}})
+ #pragma omp target defaultmap(tofrom: pointer)
+ {
+ pa[50]++;
+ }
+}
+
+ // CK13: define {{.+}}[[CALL09]]
+#endif
+///==========================================================================///
+// RUN: %clang_cc1 -DCK14 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK14
+// RUN: %clang_cc1 -DCK14 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK14
+// RUN: %clang_cc1 -DCK14 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK14
+// RUN: %clang_cc1 -DCK14 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK14
+
+// RUN: %clang_cc1 -DCK14 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY8 %s
+// RUN: %clang_cc1 -DCK14 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY8 %s
+// RUN: %clang_cc1 -DCK14 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY8 %s
+// RUN: %clang_cc1 -DCK14 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY8 %s
+// SIMD-ONLY8-NOT: {{__kmpc|__tgt}}
+#ifdef CK14
+
+
+// CK14-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l715.region_id = weak constant i8 0
+
+// CK14: [[SIZE09:@.+]] = private {{.*}}constant [1 x i64] zeroinitializer
+// Map types: OMP_MAP_TARGET_PARAM | OMP_MAP_IMPLICIT = 544
+// CK14: [[MTYPE09:@.+]] = private {{.*}}constant [1 x i64] [i64 544]
+
+// CK14-LABEL: explicit_maps_single{{.*}}(
+void explicit_maps_single (){
+ int *pa;
+
+ // CK14-DAG: call i32 @__tgt_target(i64 {{[^,]+}}, i8* {{[^,]+}}, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[SIZE09]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE09]]{{.+}})
+ // CK14-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]]
+ // CK14-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]]
+
+ // CK14-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0
+ // CK14-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0
+ // CK14-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32**
+ // CK14-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32**
+ // CK14-DAG: store i32* [[VAR0:%.+]], i32** [[CBP0]]
+ // CK14-DAG: store i32* [[VAR0]], i32** [[CP0]]
+
+ // CK14: call void [[CALL09:@.+]](i32* {{[^,]+}})
+ #pragma omp target defaultmap(firstprivate: pointer)
+ {
+ pa[50]++;
+ }
+}
+
+ // CK14: define {{.+}}[[CALL09]]
+#endif
+///==========================================================================///
+// RUN: %clang_cc1 -DCK15 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK15
+// RUN: %clang_cc1 -DCK15 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK15
+// RUN: %clang_cc1 -DCK15 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK15
+// RUN: %clang_cc1 -DCK15 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK15
+
+// RUN: %clang_cc1 -DCK15 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY12 %s
+// RUN: %clang_cc1 -DCK15 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY12 %s
+// RUN: %clang_cc1 -DCK15 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY12 %s
+// RUN: %clang_cc1 -DCK15 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY12 %s
+// SIMD-ONLY12-NOT: {{__kmpc|__tgt}}
+#ifdef CK15
+
+// CK15-LABEL: @.__omp_offloading_{{.*}}implicit_maps_variable_length_array{{.*}}_l787.region_id = weak constant i8 0
+
+// We don't have a constant map size for VLAs.
+// Map types:
+// - OMP_MAP_LITERAL + OMP_MAP_TARGET_PARAM + OMP_MAP_IMPLICIT = 800 (vla size)
+// - OMP_MAP_LITERAL + OMP_MAP_TARGET_PARAM + OMP_MAP_IMPLICIT = 800 (vla size)
+// - OMP_MAP_TARGET_PARAM | OMP_MAP_IMPLICIT = 544
+// CK15-DAG: [[TYPES:@.+]] = {{.+}}constant [3 x i64] [i64 800, i64 800, i64 544]
+
+// CK15-LABEL: implicit_maps_variable_length_array{{.*}}(
+void implicit_maps_variable_length_array (int a){
+ double vla[2][a];
+
+ // CK15-DAG: call i32 @__tgt_target(i64 {{.+}}, i8* {{.+}}, i32 3, i8** [[BPGEP:%[0-9]+]], i8** [[PGEP:%[0-9]+]], i64* [[SGEP:%[^,]+]], {{.+}}[[TYPES]]{{.+}})
+ // CK15-DAG: [[BPGEP]] = getelementptr inbounds {{.+}}[[BPS:%[^,]+]], i32 0, i32 0
+ // CK15-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0
+ // CK15-DAG: [[SGEP]] = getelementptr inbounds {{.+}}[[SS:%[^,]+]], i32 0, i32 0
+
+ // CK15-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0
+ // CK15-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0
+ // CK15-DAG: [[S0:%.+]] = getelementptr inbounds {{.+}}[[SS]], i32 0, i32 0
+ // CK15-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i[[sz:64|32]]*
+ // CK15-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i[[sz]]*
+ // CK15-DAG: store i[[sz]] 2, i[[sz]]* [[CBP0]]
+ // CK15-DAG: store i[[sz]] 2, i[[sz]]* [[CP0]]
+ // CK15-DAG: store i64 {{8|4}}, i64* [[S0]],
+
+ // CK15-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 1
+ // CK15-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 1
+ // CK15-DAG: [[S1:%.+]] = getelementptr inbounds {{.+}}[[SS]], i32 0, i32 1
+ // CK15-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i[[sz]]*
+ // CK15-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i[[sz]]*
+ // CK15-DAG: store i[[sz]] [[VAL:%.+]], i[[sz]]* [[CBP1]]
+ // CK15-DAG: store i[[sz]] [[VAL]], i[[sz]]* [[CP1]]
+ // CK15-DAG: store i64 {{8|4}}, i64* [[S1]],
+
+ // CK15-DAG: [[BP2:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 2
+ // CK15-DAG: [[P2:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 2
+ // CK15-DAG: [[S2:%.+]] = getelementptr inbounds {{.+}}[[SS]], i32 0, i32 2
+ // CK15-DAG: [[CBP2:%.+]] = bitcast i8** [[BP2]] to double**
+ // CK15-DAG: [[CP2:%.+]] = bitcast i8** [[P2]] to double**
+ // CK15-DAG: store double* [[DECL:%.+]], double** [[CBP2]]
+ // CK15-DAG: store double* [[DECL]], double** [[CP2]]
+ // CK15-DAG: store i64 [[VALS2:%.+]], i64* [[S2]],
+ // CK15-DAG: [[VALS2]] = {{mul nuw i64 %.+, 8|sext i32 %.+ to i64}}
+
+ // CK15: call void [[KERNEL:@.+]](i[[sz]] {{.+}}, i[[sz]] {{.+}}, double* [[DECL]])
+ #pragma omp target defaultmap(alloc: aggregate)
+ {
+ vla[1][3] += 1.0;
+ }
+}
+
+// CK15: define internal void [[KERNEL]](i[[sz]] [[VLA0:%.+]], i[[sz]] [[VLA1:%.+]], double* {{.*}}[[ARG:%.+]])
+// CK15: [[ADDR0:%.+]] = alloca i[[sz]],
+// CK15: [[ADDR1:%.+]] = alloca i[[sz]],
+// CK15: [[ADDR2:%.+]] = alloca double*,
+// CK15: store i[[sz]] [[VLA0]], i[[sz]]* [[ADDR0]],
+// CK15: store i[[sz]] [[VLA1]], i[[sz]]* [[ADDR1]],
+// CK15: store double* [[ARG]], double** [[ADDR2]],
+// CK15: {{.+}} = load i[[sz]], i[[sz]]* [[ADDR0]],
+// CK15: {{.+}} = load i[[sz]], i[[sz]]* [[ADDR1]],
+// CK15: [[REF:%.+]] = load double*, double** [[ADDR2]],
+// CK15: {{.+}} = getelementptr inbounds double, double* [[REF]], i[[sz]] %{{.+}}
+#endif
+///==========================================================================///
+// RUN: %clang_cc1 -DCK16 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK16
+// RUN: %clang_cc1 -DCK16 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK16
+// RUN: %clang_cc1 -DCK16 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK16
+// RUN: %clang_cc1 -DCK16 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK16
+
+// RUN: %clang_cc1 -DCK16 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY16 %s
+// RUN: %clang_cc1 -DCK16 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY16 %s
+// RUN: %clang_cc1 -DCK16 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY16 %s
+// RUN: %clang_cc1 -DCK16 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY16 %s
+// SIMD-ONLY16-NOT: {{__kmpc|__tgt}}
+#ifdef CK16
+
+// CK16-DAG: [[ST:%.+]] = type { i32, double }
+// CK16-LABEL: @.__omp_offloading_{{.*}}implicit_maps_struct{{.*}}_l849.region_id = weak constant i8 0
+// CK16-DAG: [[SIZES:@.+]] = {{.+}}constant [1 x i64] [i64 {{16|12}}]
+// Map types: OMP_MAP_TARGET_PARAM | OMP_MAP_IMPLICIT = 544
+// CK16-DAG: [[TYPES:@.+]] = {{.+}}constant [1 x i64] [i64 544]
+
+class SSS {
+public:
+ int a;
+ double b;
+};
+
+// CK16-LABEL: implicit_maps_struct{{.*}}(
+void implicit_maps_struct (int a){
+ SSS s = {a, (double)a};
+
+ // CK16-DAG: call i32 @__tgt_target(i64 {{.+}}, i8* {{.+}}, i32 1, i8** [[BPGEP:%[0-9]+]], i8** [[PGEP:%[0-9]+]], {{.+}}[[SIZES]]{{.+}}, {{.+}}[[TYPES]]{{.+}})
+ // CK16-DAG: [[BPGEP]] = getelementptr inbounds {{.+}}[[BPS:%[^,]+]], i32 0, i32 0
+ // CK16-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0
+ // CK16-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0
+ // CK16-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0
+ // CK16-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to [[ST]]**
+ // CK16-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to [[ST]]**
+ // CK16-DAG: store [[ST]]* [[DECL:%.+]], [[ST]]** [[CBP1]]
+ // CK16-DAG: store [[ST]]* [[DECL]], [[ST]]** [[CP1]]
+
+ // CK16: call void [[KERNEL:@.+]]([[ST]]* [[DECL]])
+ #pragma omp target defaultmap(alloc: aggregate)
+ {
+ s.a += 1;
+ s.b += 1.0;
+ }
+}
+
+// CK16: define internal void [[KERNEL]]([[ST]]* {{.+}}[[ARG:%.+]])
+// CK16: [[ADDR:%.+]] = alloca [[ST]]*,
+// CK16: store [[ST]]* [[ARG]], [[ST]]** [[ADDR]],
+// CK16: [[REF:%.+]] = load [[ST]]*, [[ST]]** [[ADDR]],
+// CK16: {{.+}} = getelementptr inbounds [[ST]], [[ST]]* [[REF]], i32 0, i32 0
+#endif
+///==========================================================================///
+// RUN: %clang_cc1 -DCK17 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK17
+// RUN: %clang_cc1 -DCK17 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK17
+// RUN: %clang_cc1 -DCK17 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK17
+// RUN: %clang_cc1 -DCK17 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK17
+
+// RUN: %clang_cc1 -DCK17 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY16 %s
+// RUN: %clang_cc1 -DCK17 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY16 %s
+// RUN: %clang_cc1 -DCK17 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY16 %s
+// RUN: %clang_cc1 -DCK17 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY16 %s
+// SIMD-ONLY16-NOT: {{__kmpc|__tgt}}
+#ifdef CK17
+
+// CK17-DAG: [[ST:%.+]] = type { i32, double }
+// CK17-LABEL: @.__omp_offloading_{{.*}}implicit_maps_struct{{.*}}_l906.region_id = weak constant i8 0
+// CK17-DAG: [[SIZES:@.+]] = {{.+}}constant [1 x i64] [i64 {{16|12}}]
+// Map types: OMP_MAP_TO | OMP_MAP_TARGET_PARAM | OMP_MAP_IMPLICIT = 545
+// CK17-DAG: [[TYPES:@.+]] = {{.+}}constant [1 x i64] [i64 545]
+
+class SSS {
+public:
+ int a;
+ double b;
+};
+
+// CK17-LABEL: implicit_maps_struct{{.*}}(
+void implicit_maps_struct (int a){
+ SSS s = {a, (double)a};
+
+ // CK17-DAG: call i32 @__tgt_target(i64 {{.+}}, i8* {{.+}}, i32 1, i8** [[BPGEP:%[0-9]+]], i8** [[PGEP:%[0-9]+]], {{.+}}[[SIZES]]{{.+}}, {{.+}}[[TYPES]]{{.+}})
+ // CK17-DAG: [[BPGEP]] = getelementptr inbounds {{.+}}[[BPS:%[^,]+]], i32 0, i32 0
+ // CK17-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0
+ // CK17-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0
+ // CK17-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0
+ // CK17-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to [[ST]]**
+ // CK17-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to [[ST]]**
+ // CK17-DAG: store [[ST]]* [[DECL:%.+]], [[ST]]** [[CBP1]]
+ // CK17-DAG: store [[ST]]* [[DECL]], [[ST]]** [[CP1]]
+
+ // CK17: call void [[KERNEL:@.+]]([[ST]]* [[DECL]])
+ #pragma omp target defaultmap(to: aggregate)
+ {
+ s.a += 1;
+ s.b += 1.0;
+ }
+}
+
+// CK17: define internal void [[KERNEL]]([[ST]]* {{.+}}[[ARG:%.+]])
+// CK17: [[ADDR:%.+]] = alloca [[ST]]*,
+// CK17: store [[ST]]* [[ARG]], [[ST]]** [[ADDR]],
+// CK17: [[REF:%.+]] = load [[ST]]*, [[ST]]** [[ADDR]],
+// CK17: {{.+}} = getelementptr inbounds [[ST]], [[ST]]* [[REF]], i32 0, i32 0
+#endif
+///==========================================================================///
+// RUN: %clang_cc1 -DCK18 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK18
+// RUN: %clang_cc1 -DCK18 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK18
+// RUN: %clang_cc1 -DCK18 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK18
+// RUN: %clang_cc1 -DCK18 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK18
+
+// RUN: %clang_cc1 -DCK18 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY16 %s
+// RUN: %clang_cc1 -DCK18 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY16 %s
+// RUN: %clang_cc1 -DCK18 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY16 %s
+// RUN: %clang_cc1 -DCK18 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY16 %s
+// SIMD-ONLY16-NOT: {{__kmpc|__tgt}}
+#ifdef CK18
+
+// CK18-DAG: [[ST:%.+]] = type { i32, double }
+// CK18-LABEL: @.__omp_offloading_{{.*}}implicit_maps_struct{{.*}}_l963.region_id = weak constant i8 0
+// CK18-DAG: [[SIZES:@.+]] = {{.+}}constant [1 x i64] [i64 {{16|12}}]
+// Map types: OMP_MAP_FROM | OMP_MAP_TARGET_PARAM | OMP_MAP_IMPLICIT = 546
+// CK18-DAG: [[TYPES:@.+]] = {{.+}}constant [1 x i64] [i64 546]
+
+class SSS {
+public:
+ int a;
+ double b;
+};
+
+// CK18-LABEL: implicit_maps_struct{{.*}}(
+void implicit_maps_struct (int a){
+ SSS s = {a, (double)a};
+
+ // CK18-DAG: call i32 @__tgt_target(i64 {{.+}}, i8* {{.+}}, i32 1, i8** [[BPGEP:%[0-9]+]], i8** [[PGEP:%[0-9]+]], {{.+}}[[SIZES]]{{.+}}, {{.+}}[[TYPES]]{{.+}})
+ // CK18-DAG: [[BPGEP]] = getelementptr inbounds {{.+}}[[BPS:%[^,]+]], i32 0, i32 0
+ // CK18-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0
+ // CK18-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0
+ // CK18-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0
+ // CK18-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to [[ST]]**
+ // CK18-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to [[ST]]**
+ // CK18-DAG: store [[ST]]* [[DECL:%.+]], [[ST]]** [[CBP1]]
+ // CK18-DAG: store [[ST]]* [[DECL]], [[ST]]** [[CP1]]
+
+ // CK18: call void [[KERNEL:@.+]]([[ST]]* [[DECL]])
+ #pragma omp target defaultmap(from: aggregate)
+ {
+ s.a += 1;
+ s.b += 1.0;
+ }
+}
+
+// CK18: define internal void [[KERNEL]]([[ST]]* {{.+}}[[ARG:%.+]])
+// CK18: [[ADDR:%.+]] = alloca [[ST]]*,
+// CK18: store [[ST]]* [[ARG]], [[ST]]** [[ADDR]],
+// CK18: [[REF:%.+]] = load [[ST]]*, [[ST]]** [[ADDR]],
+// CK18: {{.+}} = getelementptr inbounds [[ST]], [[ST]]* [[REF]], i32 0, i32 0
+#endif
+///==========================================================================///
+// RUN: %clang_cc1 -DCK19 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK19
+// RUN: %clang_cc1 -DCK19 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK19
+// RUN: %clang_cc1 -DCK19 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK19
+// RUN: %clang_cc1 -DCK19 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK19
+
+// RUN: %clang_cc1 -DCK19 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY16 %s
+// RUN: %clang_cc1 -DCK19 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY16 %s
+// RUN: %clang_cc1 -DCK19 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY16 %s
+// RUN: %clang_cc1 -DCK19 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY16 %s
+// SIMD-ONLY16-NOT: {{__kmpc|__tgt}}
+#ifdef CK19
+
+// CK19-DAG: [[ST:%.+]] = type { i32, double }
+// CK19-LABEL: @.__omp_offloading_{{.*}}implicit_maps_struct{{.*}}_l1020.region_id = weak constant i8 0
+// CK19-DAG: [[SIZES:@.+]] = {{.+}}constant [1 x i64] [i64 {{16|12}}]
+// Map types: OMP_MAP_TO | OMP_MAP_FROM | OMP_MAP_TARGET_PARAM | OMP_MAP_IMPLICIT = 547
+// CK19-DAG: [[TYPES:@.+]] = {{.+}}constant [1 x i64] [i64 547]
+
+class SSS {
+public:
+ int a;
+ double b;
+};
+
+// CK19-LABEL: implicit_maps_struct{{.*}}(
+void implicit_maps_struct (int a){
+ SSS s = {a, (double)a};
+
+ // CK19-DAG: call i32 @__tgt_target(i64 {{.+}}, i8* {{.+}}, i32 1, i8** [[BPGEP:%[0-9]+]], i8** [[PGEP:%[0-9]+]], {{.+}}[[SIZES]]{{.+}}, {{.+}}[[TYPES]]{{.+}})
+ // CK19-DAG: [[BPGEP]] = getelementptr inbounds {{.+}}[[BPS:%[^,]+]], i32 0, i32 0
+ // CK19-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0
+ // CK19-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0
+ // CK19-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0
+ // CK19-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to [[ST]]**
+ // CK19-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to [[ST]]**
+ // CK19-DAG: store [[ST]]* [[DECL:%.+]], [[ST]]** [[CBP1]]
+ // CK19-DAG: store [[ST]]* [[DECL]], [[ST]]** [[CP1]]
+
+ // CK19: call void [[KERNEL:@.+]]([[ST]]* [[DECL]])
+ #pragma omp target defaultmap(tofrom: aggregate)
+ {
+ s.a += 1;
+ s.b += 1.0;
+ }
+}
+
+// CK19: define internal void [[KERNEL]]([[ST]]* {{.+}}[[ARG:%.+]])
+// CK19: [[ADDR:%.+]] = alloca [[ST]]*,
+// CK19: store [[ST]]* [[ARG]], [[ST]]** [[ADDR]],
+// CK19: [[REF:%.+]] = load [[ST]]*, [[ST]]** [[ADDR]],
+// CK19: {{.+}} = getelementptr inbounds [[ST]], [[ST]]* [[REF]], i32 0, i32 0
+#endif
+///==========================================================================///
+// RUN: %clang_cc1 -DCK20 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK20 --check-prefix CK20-64
+// RUN: %clang_cc1 -DCK20 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK20 --check-prefix CK20-64
+// RUN: %clang_cc1 -DCK20 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK20 --check-prefix CK20-32
+// RUN: %clang_cc1 -DCK20 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK20 --check-prefix CK20-32
+
+// RUN: %clang_cc1 -DCK20 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY6 %s
+// RUN: %clang_cc1 -DCK20 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY6 %s
+// RUN: %clang_cc1 -DCK20 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY6 %s
+// RUN: %clang_cc1 -DCK20 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY6 %s
+// SIMD-ONLY6-NOT: {{__kmpc|__tgt}}
+#ifdef CK20
+
+// For a 32-bit targets, the value doesn't fit the size of the pointer,
+// therefore it is passed by reference with a map 'to' specification.
+
+// CK20-LABEL: @.__omp_offloading_{{.*}}implicit_maps_double{{.*}}_l1086.region_id = weak constant i8 0
+
+// CK20-DAG: [[SIZES:@.+]] = {{.+}}constant [1 x i64] [i64 8]
+// Map types: OMP_MAP_LITERAL | OMP_MAP_TARGET_PARAM | OMP_MAP_IMPLICIT = 800
+// CK20-64-DAG: [[TYPES:@.+]] = {{.+}}constant [1 x i64] [i64 800]
+// Map types: OMP_MAP_TO | OMP_MAP_PRIVATE | OMP_MAP_TARGET_PARAM | OMP_MAP_IMPLICIT = 673
+// CK20-32-DAG: [[TYPES:@.+]] = {{.+}}constant [1 x i64] [i64 673]
+
+// CK20-LABEL: implicit_maps_double{{.*}}(
+void implicit_maps_double (int a){
+ double d = (double)a;
+
+ // CK20-DAG: call i32 @__tgt_target(i64 {{.+}}, i8* {{.+}}, i32 1, i8** [[BPGEP:%[0-9]+]], i8** [[PGEP:%[0-9]+]], {{.+}}[[SIZES]]{{.+}}, {{.+}}[[TYPES]]{{.+}})
+ // CK20-DAG: [[BPGEP]] = getelementptr inbounds {{.+}}[[BPS:%[^,]+]], i32 0, i32 0
+ // CK20-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0
+ // CK20-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0
+ // CK20-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0
+
+ // CK20-64-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i[[sz:64|32]]*
+ // CK20-64-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i[[sz]]*
+ // CK20-64-DAG: store i[[sz]] [[VAL:%[^,]+]], i[[sz]]* [[CBP1]]
+ // CK20-64-DAG: store i[[sz]] [[VAL]], i[[sz]]* [[CP1]]
+ // CK20-64-DAG: [[VAL]] = load i[[sz]], i[[sz]]* [[ADDR:%.+]],
+ // CK20-64-64-DAG: [[CADDR:%.+]] = bitcast i[[sz]]* [[ADDR]] to double*
+ // CK20-64-64-DAG: store double {{.+}}, double* [[CADDR]],
+
+ // CK20-32-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to double**
+ // CK20-32-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to double**
+ // CK20-32-DAG: store double* [[DECL:%[^,]+]], double** [[CBP1]]
+ // CK20-32-DAG: store double* [[DECL]], double** [[CP1]]
+
+ // CK20-64: call void [[KERNEL:@.+]](i[[sz]] [[VAL]])
+ // CK20-32: call void [[KERNEL:@.+]](double* [[DECL]])
+ #pragma omp target defaultmap(default: scalar)
+ {
+ d += 1.0;
+ }
+}
+
+// CK20-64: define internal void [[KERNEL]](i[[sz]] [[ARG:%.+]])
+// CK20-64: [[ADDR:%.+]] = alloca i[[sz]],
+// CK20-64: store i[[sz]] [[ARG]], i[[sz]]* [[ADDR]],
+// CK20-64: [[CADDR:%.+]] = bitcast i64* [[ADDR]] to double*
+// CK20-64: {{.+}} = load double, double* [[CADDR]],
+
+// CK20-32: define internal void [[KERNEL]](double* {{.+}}[[ARG:%.+]])
+// CK20-32: [[ADDR:%.+]] = alloca double*,
+// CK20-32: store double* [[ARG]], double** [[ADDR]],
+// CK20-32: [[REF:%.+]] = load double*, double** [[ADDR]],
+// CK20-32: {{.+}} = load double, double* [[REF]],
+
+#endif
+///==========================================================================///
+// RUN: %clang_cc1 -DCK21 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK21
+// RUN: %clang_cc1 -DCK21 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK21
+// RUN: %clang_cc1 -DCK21 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK21
+// RUN: %clang_cc1 -DCK21 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK21
+
+// RUN: %clang_cc1 -DCK21 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY16 %s
+// RUN: %clang_cc1 -DCK21 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY16 %s
+// RUN: %clang_cc1 -DCK21 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY16 %s
+// RUN: %clang_cc1 -DCK21 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY16 %s
+// SIMD-ONLY16-NOT: {{__kmpc|__tgt}}
+#ifdef CK21
+
+// CK21-DAG: [[ST:%.+]] = type { i32, double }
+// CK21-LABEL: @.__omp_offloading_{{.*}}implicit_maps_struct{{.*}}_l1149.region_id = weak constant i8 0
+// CK21-DAG: [[SIZES:@.+]] = {{.+}}constant [1 x i64] [i64 {{16|12}}]
+// Map types: OMP_MAP_TO + OMP_MAP_FROM + OMP_MAP_TARGET_PARAM | OMP_MAP_IMPLICIT = 547
+// CK21-DAG: [[TYPES:@.+]] = {{.+}}constant [1 x i64] [i64 547]
+
+class SSS {
+public:
+ int a;
+ double b;
+};
+
+// CK21-LABEL: implicit_maps_struct{{.*}}(
+void implicit_maps_struct (int a){
+ SSS s = {a, (double)a};
+
+ // CK21-DAG: call i32 @__tgt_target(i64 {{.+}}, i8* {{.+}}, i32 1, i8** [[BPGEP:%[0-9]+]], i8** [[PGEP:%[0-9]+]], {{.+}}[[SIZES]]{{.+}}, {{.+}}[[TYPES]]{{.+}})
+ // CK21-DAG: [[BPGEP]] = getelementptr inbounds {{.+}}[[BPS:%[^,]+]], i32 0, i32 0
+ // CK21-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0
+ // CK21-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0
+ // CK21-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0
+ // CK21-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to [[ST]]**
+ // CK21-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to [[ST]]**
+ // CK21-DAG: store [[ST]]* [[DECL:%.+]], [[ST]]** [[CBP1]]
+ // CK21-DAG: store [[ST]]* [[DECL]], [[ST]]** [[CP1]]
+
+ // CK21: call void [[KERNEL:@.+]]([[ST]]* [[DECL]])
+ #pragma omp target defaultmap(default: aggregate)
+ {
+ s.a += 1;
+ s.b += 1.0;
+ }
+}
+
+// CK21: define internal void [[KERNEL]]([[ST]]* {{.+}}[[ARG:%.+]])
+// CK21: [[ADDR:%.+]] = alloca [[ST]]*,
+// CK21: store [[ST]]* [[ARG]], [[ST]]** [[ADDR]],
+// CK21: [[REF:%.+]] = load [[ST]]*, [[ST]]** [[ADDR]],
+// CK21: {{.+}} = getelementptr inbounds [[ST]], [[ST]]* [[REF]], i32 0, i32 0
+#endif
+///==========================================================================///
+// RUN: %clang_cc1 -DCK22 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK22
+// RUN: %clang_cc1 -DCK22 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK22
+// RUN: %clang_cc1 -DCK22 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK22
+// RUN: %clang_cc1 -DCK22 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK22
+
+// RUN: %clang_cc1 -DCK22 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY9 %s
+// RUN: %clang_cc1 -DCK22 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY9 %s
+// RUN: %clang_cc1 -DCK22 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY9 %s
+// RUN: %clang_cc1 -DCK22 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY9 %s
+// SIMD-ONLY9-NOT: {{__kmpc|__tgt}}
+#ifdef CK22
+
+// CK22-LABEL: @.__omp_offloading_{{.*}}implicit_maps_pointer{{.*}}_l1200.region_id = weak constant i8 0
+
+// CK22-DAG: [[SIZES:@.+]] = {{.+}}constant [1 x i64] zeroinitializer
+// Map types: OMP_MAP_TARGET_PARAM | OMP_MAP_IMPLICIT = 544
+// CK22-DAG: [[TYPES:@.+]] = {{.+}}constant [1 x i64] [i64 544]
+
+// CK22-LABEL: implicit_maps_pointer{{.*}}(
+void implicit_maps_pointer (){
+ double *ddyn;
+
+ // CK22-DAG: call i32 @__tgt_target(i64 {{.+}}, i8* {{.+}}, i32 1, i8** [[BPGEP:%[0-9]+]], i8** [[PGEP:%[0-9]+]], {{.+}}[[SIZES]]{{.+}}, {{.+}}[[TYPES]]{{.+}})
+ // CK22-DAG: [[BPGEP]] = getelementptr inbounds {{.+}}[[BPS:%[^,]+]], i32 0, i32 0
+ // CK22-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0
+ // CK22-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0
+ // CK22-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0
+ // CK22-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to double**
+ // CK22-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to double**
+ // CK22-DAG: store double* [[PTR:%[^,]+]], double** [[CBP1]]
+ // CK22-DAG: store double* [[PTR]], double** [[CP1]]
+
+ // CK22: call void [[KERNEL:@.+]](double* [[PTR]])
+ #pragma omp target defaultmap(default: pointer)
+ {
+ ddyn[0] += 1.0;
+ ddyn[1] += 1.0;
+ }
+}
+
+// CK22: define internal void [[KERNEL]](double* {{.*}}[[ARG:%.+]])
+// CK22: [[ADDR:%.+]] = alloca double*,
+// CK22: store double* [[ARG]], double** [[ADDR]],
+// CK22: [[REF:%.+]] = load double*, double** [[ADDR]],
+// CK22: {{.+}} = getelementptr inbounds double, double* [[REF]], i{{64|32}} 0
+
+#endif
+///==========================================================================///
+// RUN: %clang_cc1 -DCK23 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck %s --check-prefix CK23 --check-prefix CK23-64
+// RUN: %clang_cc1 -DCK23 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CK23 --check-prefix CK23-64
+// RUN: %clang_cc1 -DCK23 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck %s --check-prefix CK23 --check-prefix CK23-32
+// RUN: %clang_cc1 -DCK23 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CK23 --check-prefix CK23-32
+
+// RUN: %clang_cc1 -DCK23 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DCK23 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DCK23 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DCK23 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
+#ifdef CK23
+
+double *g;
+
+// CK23: @g = global double*
+// CK23: [[SIZES00:@.+]] = {{.+}}constant [1 x i[[sz:64|32]]] [i{{64|32}} {{8|4}}]
+// CK23: [[TYPES00:@.+]] = {{.+}}constant [1 x i64] [i64 288]
+
+// CK23: [[SIZES01:@.+]] = {{.+}}constant [1 x i[[sz]]] [i[[sz]] {{8|4}}]
+// CK23: [[TYPES01:@.+]] = {{.+}}constant [1 x i64] [i64 288]
+
+// CK23: [[SIZES02:@.+]] = {{.+}}constant [1 x i[[sz]]] [i[[sz]] {{8|4}}]
+// CK23: [[TYPES02:@.+]] = {{.+}}constant [1 x i64] [i64 288]
+
+// CK23: [[SIZES03:@.+]] = {{.+}}constant [1 x i[[sz]]] [i[[sz]] {{8|4}}]
+// CK23: [[TYPES03:@.+]] = {{.+}}constant [1 x i64] [i64 288]
+
+// CK23: [[SIZES04:@.+]] = {{.+}}constant [1 x i[[sz]]] [i[[sz]] {{8|4}}]
+// CK23: [[TYPES04:@.+]] = {{.+}}constant [1 x i64] [i64 288]
+
+// CK23: [[SIZES05:@.+]] = {{.+}}constant [1 x i[[sz]]] [i[[sz]] {{8|4}}]
+// CK23: [[TYPES05:@.+]] = {{.+}}constant [1 x i64] [i64 288]
+
+// CK23: [[SIZES06:@.+]] = {{.+}}constant [2 x i[[sz]]] [i[[sz]] {{8|4}}, i[[sz]] {{8|4}}]
+// CK23: [[TYPES06:@.+]] = {{.+}}constant [2 x i64] [i64 288, i64 288]
+
+// CK23-LABEL: @_Z3foo{{.*}}(
+template<typename T>
+void foo(float *&lr, T *&tr) {
+ float *l;
+ T *t;
+
+ // CK23-DAG: call i32 @__tgt_target(i64 {{.+}}, i8* {{.+}}, i32 1, i8** [[BPGEP:%[0-9]+]], i8** [[PGEP:%[0-9]+]], {{.+}}[[SIZES00]]{{.+}}, {{.+}}[[TYPES00]]{{.+}})
+ // CK23-DAG: [[BPGEP]] = getelementptr inbounds {{.+}}[[BPS:%[^,]+]], i32 0, i32 0
+ // CK23-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0
+ // CK23-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0
+ // CK23-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0
+ // CK23-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to double**
+ // CK23-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to double**
+ // CK23-DAG: store double* [[VAL:%.+]], double** [[CBP1]]
+ // CK23-DAG: store double* [[VAL]], double** [[CP1]]
+ // CK23-DAG: [[VAL]] = load double*, double** [[ADDR:@g]],
+
+ // CK23: call void [[KERNEL:@.+]](double* [[VAL]])
+ #pragma omp target is_device_ptr(g) defaultmap(none:pointer)
+ {
+ ++g;
+ }
+
+ // CK23-DAG: call i32 @__tgt_target(i64 {{.+}}, i8* {{.+}}, i32 1, i8** [[BPGEP:%[0-9]+]], i8** [[PGEP:%[0-9]+]], {{.+}}[[SIZES01]]{{.+}}, {{.+}}[[TYPES01]]{{.+}})
+ // CK23-DAG: [[BPGEP]] = getelementptr inbounds {{.+}}[[BPS:%[^,]+]], i32 0, i32 0
+ // CK23-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0
+ // CK23-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0
+ // CK23-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0
+ // CK23-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to float**
+ // CK23-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to float**
+ // CK23-DAG: store float* [[VAL:%.+]], float** [[CBP1]]
+ // CK23-DAG: store float* [[VAL]], float** [[CP1]]
+ // CK23-DAG: [[VAL]] = load float*, float** [[ADDR:%.+]],
+
+ // CK23: call void [[KERNEL:@.+]](float* [[VAL]])
+ #pragma omp target is_device_ptr(l) defaultmap(none:pointer)
+ {
+ ++l;
+ }
+
+ // CK23-DAG: call i32 @__tgt_target(i64 {{.+}}, i8* {{.+}}, i32 1, i8** [[BPGEP:%[0-9]+]], i8** [[PGEP:%[0-9]+]], {{.+}}[[SIZES02]]{{.+}}, {{.+}}[[TYPES02]]{{.+}})
+ // CK23-DAG: [[BPGEP]] = getelementptr inbounds {{.+}}[[BPS:%[^,]+]], i32 0, i32 0
+ // CK23-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0
+ // CK23-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0
+ // CK23-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0
+ // CK23-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i32**
+ // CK23-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i32**
+ // CK23-DAG: store i32* [[VAL:%.+]], i32** [[CBP1]]
+ // CK23-DAG: store i32* [[VAL]], i32** [[CP1]]
+ // CK23-DAG: [[VAL]] = load i32*, i32** [[ADDR:%.+]],
+
+ // CK23: call void [[KERNEL:@.+]](i32* [[VAL]])
+ #pragma omp target is_device_ptr(t) defaultmap(none:pointer)
+ {
+ ++t;
+ }
+
+ // CK23-DAG: call i32 @__tgt_target(i64 {{.+}}, i8* {{.+}}, i32 1, i8** [[BPGEP:%[0-9]+]], i8** [[PGEP:%[0-9]+]], {{.+}}[[SIZES03]]{{.+}}, {{.+}}[[TYPES03]]{{.+}})
+ // CK23-DAG: [[BPGEP]] = getelementptr inbounds {{.+}}[[BPS:%[^,]+]], i32 0, i32 0
+ // CK23-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0
+ // CK23-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0
+ // CK23-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0
+ // CK23-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to float**
+ // CK23-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to float**
+ // CK23-DAG: store float* [[VAL:%.+]], float** [[CBP1]]
+ // CK23-DAG: store float* [[VAL]], float** [[CP1]]
+ // CK23-DAG: [[VAL]] = load float*, float** [[ADDR:%.+]],
+ // CK23-DAG: [[ADDR]] = load float**, float*** [[ADDR2:%.+]],
+
+ // CK23: call void [[KERNEL:@.+]](float* [[VAL]])
+ #pragma omp target is_device_ptr(lr) defaultmap(none:pointer)
+ {
+ ++lr;
+ }
+
+ // CK23-DAG: call i32 @__tgt_target(i64 {{.+}}, i8* {{.+}}, i32 1, i8** [[BPGEP:%[0-9]+]], i8** [[PGEP:%[0-9]+]], {{.+}}[[SIZES04]]{{.+}}, {{.+}}[[TYPES04]]{{.+}})
+ // CK23-DAG: [[BPGEP]] = getelementptr inbounds {{.+}}[[BPS:%[^,]+]], i32 0, i32 0
+ // CK23-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0
+ // CK23-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0
+ // CK23-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0
+ // CK23-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i32**
+ // CK23-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i32**
+ // CK23-DAG: store i32* [[VAL:%.+]], i32** [[CBP1]]
+ // CK23-DAG: store i32* [[VAL]], i32** [[CP1]]
+ // CK23-DAG: [[VAL]] = load i32*, i32** [[ADDR:%.+]],
+ // CK23-DAG: [[ADDR]] = load i32**, i32*** [[ADDR2:%.+]],
+
+ // CK23: call void [[KERNEL:@.+]](i32* [[VAL]])
+ #pragma omp target is_device_ptr(tr) defaultmap(none:pointer)
+ {
+ ++tr;
+ }
+
+ // CK23-DAG: call i32 @__tgt_target(i64 {{.+}}, i8* {{.+}}, i32 1, i8** [[BPGEP:%[0-9]+]], i8** [[PGEP:%[0-9]+]], {{.+}}[[SIZES05]]{{.+}}, {{.+}}[[TYPES05]]{{.+}})
+ // CK23-DAG: [[BPGEP]] = getelementptr inbounds {{.+}}[[BPS:%[^,]+]], i32 0, i32 0
+ // CK23-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0
+ // CK23-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0
+ // CK23-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0
+ // CK23-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i32**
+ // CK23-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i32**
+ // CK23-DAG: store i32* [[VAL:%.+]], i32** [[CBP1]]
+ // CK23-DAG: store i32* [[VAL]], i32** [[CP1]]
+ // CK23-DAG: [[VAL]] = load i32*, i32** [[ADDR:%.+]],
+ // CK23-DAG: [[ADDR]] = load i32**, i32*** [[ADDR2:%.+]],
+
+ // CK23: call void [[KERNEL:@.+]](i32* [[VAL]])
+ #pragma omp target is_device_ptr(tr,lr) defaultmap(none:pointer)
+ {
+ ++tr;
+ }
+
+ // CK23-DAG: call i32 @__tgt_target(i64 {{.+}}, i8* {{.+}}, i32 2, i8** [[BPGEP:%[0-9]+]], i8** [[PGEP:%[0-9]+]], {{.+}}[[SIZES06]]{{.+}}, {{.+}}[[TYPES06]]{{.+}})
+ // CK23-DAG: [[BPGEP]] = getelementptr inbounds {{.+}}[[BPS:%[^,]+]], i32 0, i32 0
+ // CK23-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0
+ // CK23-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0
+ // CK23-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0
+ // CK23-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i32**
+ // CK23-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i32**
+ // CK23-DAG: store i32* [[VAL:%.+]], i32** [[CBP1]]
+ // CK23-DAG: store i32* [[VAL]], i32** [[CP1]]
+ // CK23-DAG: [[VAL]] = load i32*, i32** [[ADDR:%.+]],
+ // CK23-DAG: [[ADDR]] = load i32**, i32*** [[ADDR2:%.+]],
+
+ // CK23-DAG: [[_BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 1
+ // CK23-DAG: [[_P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 1
+ // CK23-DAG: [[_CBP1:%.+]] = bitcast i8** [[_BP1]] to float**
+ // CK23-DAG: [[_CP1:%.+]] = bitcast i8** [[_P1]] to float**
+ // CK23-DAG: store float* [[_VAL:%.+]], float** [[_CBP1]]
+ // CK23-DAG: store float* [[_VAL]], float** [[_CP1]]
+ // CK23-DAG: [[_VAL]] = load float*, float** [[_ADDR:%.+]],
+ // CK23-DAG: [[_ADDR]] = load float**, float*** [[_ADDR2:%.+]],
+
+ // CK23: call void [[KERNEL:@.+]](i32* [[VAL]], float* [[_VAL]])
+ #pragma omp target is_device_ptr(tr,lr) defaultmap(none:pointer)
+ {
+ ++tr,++lr;
+ }
+}
+
+void bar(float *&a, int *&b) {
+ foo<int>(a,b);
+}
+
+#endif
+///==========================================================================///
+// RUN: %clang_cc1 -DCK24 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK24 --check-prefix CK24-64
+// RUN: %clang_cc1 -DCK24 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK24 --check-prefix CK24-64
+// RUN: %clang_cc1 -DCK24 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK24 --check-prefix CK24-32
+// RUN: %clang_cc1 -DCK24 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK24 --check-prefix CK24-32
+
+// RUN: %clang_cc1 -DCK24 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY18 %s
+// RUN: %clang_cc1 -DCK24 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY18 %s
+// RUN: %clang_cc1 -DCK24 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY18 %s
+// RUN: %clang_cc1 -DCK24 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY18 %s
+// SIMD-ONLY18-NOT: {{__kmpc|__tgt}}
+#ifdef CK24
+
+// CK24-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1443.region_id = weak constant i8 0
+// CK24: [[SIZE00:@.+]] = private {{.*}}constant [1 x i[[Z:64|32]]] [i[[Z:64|32]] 4]
+// CK24: [[MTYPE00:@.+]] = private {{.*}}constant [1 x i64] [i64 1059]
+
+// CK24-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1462.region_id = weak constant i8 0
+// CK24: [[SIZE01:@.+]] = private {{.*}}constant [1 x i[[Z:64|32]]] [i[[Z:64|32]] 4]
+// CK24: [[MTYPE01:@.+]] = private {{.*}}constant [1 x i64] [i64 1063]
+
+// CK24-LABEL: explicit_maps_single{{.*}}(
+void explicit_maps_single (int ii){
+ // Map of a scalar.
+ int a = ii;
+
+ // Close.
+ // Region 00
+ // CK24-DAG: call i32 @__tgt_target(i64 {{[^,]+}}, i8* {{[^,]+}}, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[SIZE00]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE00]]{{.+}})
+ // CK24-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]]
+ // CK24-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]]
+
+ // CK24-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0
+ // CK24-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0
+ // CK24-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32**
+ // CK24-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32**
+ // CK24-DAG: store i32* [[VAR0:%.+]], i32** [[CBP0]]
+ // CK24-DAG: store i32* [[VAR0]], i32** [[CP0]]
+
+ // CK24: call void [[CALL00:@.+]](i32* {{[^,]+}})
+ #pragma omp target map(close, tofrom: a) defaultmap(none:scalar)
+ {
+ a++;
+ }
+
+ // Always Close.
+ // Region 01
+ // CK24-DAG: call i32 @__tgt_target(i64 {{[^,]+}}, i8* {{[^,]+}}, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[SIZE01]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE01]]{{.+}})
+ // CK24-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]]
+ // CK24-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]]
+
+ // CK24-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0
+ // CK24-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0
+ // CK24-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32**
+ // CK24-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32**
+ // CK24-DAG: store i32* [[VAR0:%.+]], i32** [[CBP0]]
+ // CK24-DAG: store i32* [[VAR0]], i32** [[CP0]]
+
+ // CK24: call void [[CALL01:@.+]](i32* {{[^,]+}})
+ #pragma omp target map(always close tofrom: a) defaultmap(none:scalar)
+ {
+ a++;
+ }
+}
+// CK24: define {{.+}}[[CALL00]]
+// CK24: define {{.+}}[[CALL01]]
+
+#endif
+///==========================================================================///
+// RUN: %clang_cc1 -DCK25 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK25 --check-prefix CK25-64
+// RUN: %clang_cc1 -DCK25 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK25 --check-prefix CK25-64
+// RUN: %clang_cc1 -DCK25 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK25 --check-prefix CK25-32
+// RUN: %clang_cc1 -DCK25 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK25 --check-prefix CK25-32
+
+// RUN: %clang_cc1 -DCK25 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY18 %s
+// RUN: %clang_cc1 -DCK25 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY18 %s
+// RUN: %clang_cc1 -DCK25 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY18 %s
+// RUN: %clang_cc1 -DCK25 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY18 %s
+// SIMD-ONLY18-NOT: {{__kmpc|__tgt}}
+#ifdef CK25
+
+extern int x;
+#pragma omp declare target to(x)
+
+// CK25-LABEL: @.__omp_offloading_{{.*}}declare_target_to{{.*}}_l1499.region_id = weak constant i8 0
+
+void declare_target_to()
+{
+ // CK25: [[C:%.+]] = load i32, i32* @x
+ // CK25: [[INC:%.+]] = add nsw i32 [[C]], 1
+ // CK25: store i32 [[INC]], i32* @x
+ // CK25: ret void
+ #pragma omp target defaultmap(none : scalar)
+ {
+ x++;
+ }
+}
+
+#endif
+///==========================================================================///
+// RUN: %clang_cc1 -DCK26 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK26 --check-prefix CK26-64
+// RUN: %clang_cc1 -DCK26 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK26 --check-prefix CK26-64
+// RUN: %clang_cc1 -DCK26 -verify -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK26 --check-prefix CK26-32
+// RUN: %clang_cc1 -DCK26 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK26 --check-prefix CK26-32
+
+// RUN: %clang_cc1 -DCK26 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY18 %s
+// RUN: %clang_cc1 -DCK26 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY18 %s
+// RUN: %clang_cc1 -DCK26 -verify -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY18 %s
+// RUN: %clang_cc1 -DCK26 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY18 %s
+// SIMD-ONLY18-NOT: {{__kmpc|__tgt}}
+#ifdef CK26
+
+// CK26-DAG: [[SIZES:@.+]] = {{.+}}constant [3 x i64] [i64 4096, i64 4, i64 {{.+}}]
+// Map types: OMP_MAP_TO | MAP_ALWAYS | OMP_MAP_IMPLICIT = 533
+// CK26-DAG: [[TYPES:@.+]] = {{.+}}constant [3 x i64] [i64 531, i64 531, i64 531]
+
+float Vector[1024];
+#pragma omp declare target link(Vector)
+
+extern int a;
+#pragma omp declare target link(a)
+
+double *ptr;
+#pragma omp declare target link(ptr)
+
+void declare_target_link()
+{
+#pragma omp target defaultmap(none:scalar) defaultmap(none:aggregate) defaultmap(none:pointer)
+ {
+
+ // CK26-DAG: call i32 @__tgt_target(i64 {{.+}}, i8* {{.+}}, i32 3, i8** [[BPGEP:%[0-9]+]], i8** [[PGEP:%[0-9]+]], {{.+}}[[SIZES]]{{.+}}, {{.+}}[[TYPES]]{{.+}})
+ // CK26-DAG: [[BPGEP]] = getelementptr inbounds {{.+}}[[BPS:%[^,]+]], i32 0, i32 0
+ // CK26-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0
+ // CK26-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 2
+ // CK26-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 2
+ // CK26-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to double****
+ // CK26-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to double***
+ // CK26-DAG: store double*** @ptr_decl_tgt_ref_ptr, double**** [[CBP1]]
+ // CK26-DAG: store double** @ptr, double*** [[CP1]]
+
+ Vector[a]++;
+ ptr++;
+ }
+}
+
+#endif
+#endif
diff --git a/src/llvm-project/clang/test/OpenMP/target_defaultmap_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_defaultmap_messages.cpp
index 0676753..eb9c0a4 100644
--- a/src/llvm-project/clang/test/OpenMP/target_defaultmap_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_defaultmap_messages.cpp
@@ -1,6 +1,24 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 %s -verify=expected,omp5 -Wuninitialized -DOMP5
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 %s -verify=expected,omp5 -Wuninitialized -DOMP5
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 %s -verify=expected,omp45 -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 %s -verify=expected,omp45 -Wuninitialized
+
+struct Bar {
+ int a;
+};
+
+class Baz {
+ public:
+ Bar bar;
+ int *p;
+};
+
+int *g;
+int arr[50];
+Bar bar;
+Baz baz;
+Baz* bazPtr = &baz;
void foo() {
}
@@ -9,50 +27,102 @@
T tmain(T argc, S **argv) {
#pragma omp target defaultmap // expected-error {{expected '(' after 'defaultmap'}}
foo();
- #pragma omp target defaultmap ( // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ #pragma omp target defaultmap ( // omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target defaultmap () // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
+ #pragma omp target defaultmap () // omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target defaultmap (tofrom // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+ #pragma omp target defaultmap (tofrom // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target defaultmap (tofrom: // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+ #pragma omp target defaultmap (tofrom: // expected-error {{expected ')'}} expected-note {{to match this '('}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target defaultmap (tofrom) // expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+ #pragma omp target defaultmap (tofrom) // expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target defaultmap (tofrom scalar) // expected-warning {{missing ':' after defaultmap modifier - ignoring}}
+ #pragma omp target defaultmap (tofrom, // expected-error {{expected ')'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-note {{to match this '('}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target defaultmap (tofrom, // expected-error {{expected ')'}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-note {{to match this '('}}
+ #pragma omp target defaultmap (scalar: // omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target defaultmap (scalar: // expected-error {{expected ')'}} expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
+ #pragma omp target defaultmap (tofrom, scalar // expected-error {{expected ')'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target defaultmap (tofrom, scalar // expected-error {{expected ')'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
- foo();
+ #pragma omp target defaultmap(tofrom:scalar) defaultmap(tofrom:scalar) // omp45-error {{directive '#pragma omp target' cannot contain more than one 'defaultmap' clause}} omp5-error {{at most one defaultmap clause for each variable-category can appear on the directive}}
+ foo();
+#if OMP5
+ #pragma omp target defaultmap(tofrom:scalar) defaultmap(to:scalar) // omp5-error {{at most one defaultmap clause for each variable-category can appear on the directive}}
+ foo();
+ #pragma omp target defaultmap(alloc:pointer) defaultmap(to:scalar) defaultmap(firstprivate:pointer) // expected-error {{at most one defaultmap clause for each variable-category can appear on the directive}}
+ foo();
+ #pragma omp target defaultmap(none:pointer) // expected-note {{explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here}}
+ g++; // expected-error {{variable 'g' must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause}}
+ #pragma omp target defaultmap(none:pointer) defaultmap(none:scalar) map(argc) // expected-note {{explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here}}
+ argc = *g; // expected-error {{variable 'g' must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause}}
+ #pragma omp target defaultmap(none:pointer) defaultmap(none:scalar) map(g) // expected-note {{explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here}}
+ argc = *g; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause}}
+ #pragma omp target defaultmap(none:pointer) defaultmap(none:scalar) defaultmap(none:aggregate) map(g) firstprivate(argc) // expected-note {{explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here}}
+ argc = *g + arr[1]; // expected-error {{variable 'arr' must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause}}
+ #pragma omp target defaultmap(none:aggregate) defaultmap(none:scalar) map(argc) // expected-note {{explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here}}
+ bar.a += argc; // expected-error {{variable 'bar' must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause}}
+ #pragma omp target defaultmap(none:aggregate) defaultmap(none:scalar) map(argc) // expected-note {{explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here}}
+ baz.bar.a += argc; // expected-error {{variable 'baz' must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause}}
+ int vla[argc];
+ #pragma omp target defaultmap(none:aggregate) defaultmap(none:scalar) map(argc) // expected-note {{explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here}}
+ vla[argc-1] += argc; // expected-error {{variable 'vla' must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause}}
+
+ #pragma omp target defaultmap(none:aggregate) // expected-note {{explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here}}
+ #pragma omp parallel
+ baz.bar.a += argc; // expected-error {{variable 'baz' must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause}}
+#endif
+
return argc;
}
int main(int argc, char **argv) {
#pragma omp target defaultmap // expected-error {{expected '(' after 'defaultmap'}}
foo();
- #pragma omp target defaultmap ( // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ #pragma omp target defaultmap ( // omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target defaultmap () // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
+ #pragma omp target defaultmap () // omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target defaultmap (tofrom // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+ #pragma omp target defaultmap (tofrom // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target defaultmap (tofrom: // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+ #pragma omp target defaultmap (tofrom: // expected-error {{expected ')'}} expected-note {{to match this '('}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target defaultmap (tofrom) // expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+ #pragma omp target defaultmap (tofrom) // expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target defaultmap (tofrom scalar) // expected-warning {{missing ':' after defaultmap modifier - ignoring}}
+ #pragma omp target defaultmap (tofrom, // expected-error {{expected ')'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-note {{to match this '('}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target defaultmap (tofrom, // expected-error {{expected ')'}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-note {{to match this '('}}
+ #pragma omp target defaultmap (scalar: // omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target defaultmap (scalar: // expected-error {{expected ')'}} expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
+ #pragma omp target defaultmap (tofrom, scalar // expected-error {{expected ')'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target defaultmap (tofrom, scalar // expected-error {{expected ')'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
- foo();
+ #pragma omp target defaultmap(tofrom:scalar) defaultmap(tofrom:scalar) // omp45-error {{directive '#pragma omp target' cannot contain more than one 'defaultmap' clause}} omp5-error {{at most one defaultmap clause for each variable-category can appear on the directive}}
+ foo();
- return tmain<int, char, 1, 0>(argc, argv);
+#ifdef OMP5
+ #pragma omp target defaultmap(tofrom:scalar) defaultmap(to:scalar) // omp5-error {{at most one defaultmap clause for each variable-category can appear on the directive}}
+ foo();
+ #pragma omp target defaultmap(alloc:pointer) defaultmap(to:scalar) defaultmap(firstprivate:pointer) // expected-error {{at most one defaultmap clause for each variable-category can appear on the directive}}
+ foo();
+ #pragma omp target defaultmap(none:pointer) // expected-note {{explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here}}
+ g++; // expected-error {{variable 'g' must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause}}
+ #pragma omp target defaultmap(none:pointer) defaultmap(none:scalar) map(argc) // expected-note {{explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here}}
+ argc = *g; // expected-error {{variable 'g' must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause}}
+ #pragma omp target defaultmap(none:pointer) defaultmap(none:scalar) map(g) // expected-note {{explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here}}
+ argc = *g; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause}}
+ #pragma omp target defaultmap(none:pointer) defaultmap(none:scalar) defaultmap(none:aggregate) map(g) firstprivate(argc) // expected-note {{explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here}}
+ argc = *g + arr[1]; // expected-error {{variable 'arr' must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause}}
+ #pragma omp target defaultmap(none:aggregate) defaultmap(none:scalar) map(argc) // expected-note {{explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here}}
+ bar.a += argc; // expected-error {{variable 'bar' must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause}}
+ #pragma omp target defaultmap(none:aggregate) defaultmap(none:scalar) map(argc) // expected-note {{explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here}}
+ baz.bar.a += argc; // expected-error {{variable 'baz' must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause}}
+ int vla[argc];
+ #pragma omp target defaultmap(none:aggregate) defaultmap(none:scalar) map(argc) // expected-note {{explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here}}
+ vla[argc-1] += argc; // expected-error {{variable 'vla' must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause}}
+
+ #pragma omp target defaultmap(none:aggregate) // expected-note {{explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here}}
+ #pragma omp parallel
+ baz.bar.a += argc; // expected-error {{variable 'baz' must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause}}
+
+#endif
+
+ return tmain<int, char, 1, 0>(argc, argv); // omp5-note {{in instantiation of function template specialization 'tmain<int, char, 1, 0>' requested here}}
}
-
diff --git a/src/llvm-project/clang/test/OpenMP/target_depend_codegen.cpp b/src/llvm-project/clang/test/OpenMP/target_depend_codegen.cpp
index 854ead9..e2810f9 100644
--- a/src/llvm-project/clang/test/OpenMP/target_depend_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_depend_codegen.cpp
@@ -40,13 +40,9 @@
// CHECK-DAG: [[TT:%.+]] = type { i64, i8 }
// CHECK-DAG: [[ENTTY:%.+]] = type { i8*, i8*, i[[SZ:32|64]], i32, i32 }
-// CHECK-DAG: [[DEVTY:%.+]] = type { i8*, i8*, [[ENTTY]]*, [[ENTTY]]* }
-// CHECK-DAG: [[DSCTY:%.+]] = type { i32, [[DEVTY]]*, [[ENTTY]]*, [[ENTTY]]* }
// TCHECK: [[ENTTY:%.+]] = type { i8*, i8*, i{{32|64}}, i32, i32 }
-// CHECK-DAG: $[[REGFN:\.omp_offloading\..+]] = comdat
-
// CHECK-DAG: [[SIZET:@.+]] = private unnamed_addr constant [2 x i64] [i64 0, i64 4]
// CHECK-DAG: [[MAPT:@.+]] = private unnamed_addr constant [2 x i64] [i64 544, i64 800]
// CHECK-DAG: @{{.*}} = weak constant i8 0
@@ -55,16 +51,8 @@
// TCHECK: @{{.+}} = {{.*}}constant [[ENTTY]]
// TCHECK-NOT: @{{.+}} = weak constant [[ENTTY]]
-// Check if offloading descriptor is created.
-// CHECK: [[ENTBEGIN:@.+]] = external constant [[ENTTY]]
-// CHECK: [[ENTEND:@.+]] = external constant [[ENTTY]]
-// CHECK: [[DEVBEGIN:@.+]] = extern_weak constant i8
-// CHECK: [[DEVEND:@.+]] = extern_weak constant i8
-// CHECK: [[IMAGES:@.+]] = internal unnamed_addr constant [1 x [[DEVTY]]] [{{.+}} { i8* [[DEVBEGIN]], i8* [[DEVEND]], [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }], comdat($[[REGFN]])
-// CHECK: [[DESC:@.+]] = internal constant [[DSCTY]] { i32 1, [[DEVTY]]* getelementptr inbounds ([1 x [[DEVTY]]], [1 x [[DEVTY]]]* [[IMAGES]], i32 0, i32 0), [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }, comdat($[[REGFN]])
-
// Check target registration is registered as a Ctor.
-// CHECK: appending global [2 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }, { i32, void ()*, i8* } { i32 0, void ()* @[[REGFN]], i8* bitcast (void ()* @[[REGFN]] to i8*) }]
+// CHECK: appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }]
template<typename tx, typename ty>
@@ -193,7 +181,7 @@
// CHECK: define internal void [[HVT0:@.+]]()
-// CHECK: define internal{{.*}} i32 [[TASK_ENTRY0]](i32{{.*}}, [[TASK_TY0]]* noalias)
+// CHECK: define internal{{.*}} i32 [[TASK_ENTRY0]](i32{{.*}}, [[TASK_TY0]]* noalias %1)
// CHECK: store void (i8*, ...)* null, void (i8*, ...)** %
// CHECK: [[DEVICE_CAP:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 0
// CHECK: [[DEV:%.+]] = load i32, i32* [[DEVICE_CAP]],
@@ -209,7 +197,7 @@
// CHECK: define internal void [[HVT1:@.+]](i[[SZ]]* %{{.+}}, i[[SZ]] %{{.+}})
-// CHECK: define internal{{.*}} i32 [[TASK_ENTRY1_]](i32{{.*}}, [[TASK_TY1_]]* noalias)
+// CHECK: define internal{{.*}} i32 [[TASK_ENTRY1_]](i32{{.*}}, [[TASK_TY1_]]* noalias %1)
// CHECK: call void (i8*, ...) %
// CHECK: [[SZT:%.+]] = getelementptr inbounds [2 x i64], [2 x i64]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0
// CHECK: [[DEVICE_CAP:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 2
@@ -231,7 +219,7 @@
// CHECK: [[END]]
// CHECK: ret i32 0
-// CHECK: define internal{{.*}} i32 [[TASK_ENTRY1__]](i32{{.*}}, [[TASK_TY1__]]* noalias)
+// CHECK: define internal{{.*}} i32 [[TASK_ENTRY1__]](i32{{.*}}, [[TASK_TY1__]]* noalias %1)
// CHECK: call void (i8*, ...) %
// CHECK: [[DEVICE_CAP:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 2
// CHECK: [[BP0:%.+]] = load i[[SZ]]*, i[[SZ]]** %
@@ -251,7 +239,7 @@
// CHECK-64: load i32, i32* [[AA_CADDR]], align
// CHECK-32: load i32, i32* [[AA_ADDR]], align
-// CHECK: define internal{{.*}} i32 [[TASK_ENTRY2]](i32{{.*}}, [[TASK_TY2]]* noalias)
+// CHECK: define internal{{.*}} i32 [[TASK_ENTRY2]](i32{{.*}}, [[TASK_TY2]]* noalias %1)
// CHECK: call void (i8*, ...) %
// CHECK: [[BP1_I32:%.+]] = load i32, i32* %
// CHECK-64: [[BP1_CAST:%.+]] = bitcast i[[SZ]]* [[BP1_PTR:%.+]] to i32*
diff --git a/src/llvm-project/clang/test/OpenMP/target_depend_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_depend_messages.cpp
index a18bc5d..df8723e 100644
--- a/src/llvm-project/clang/test/OpenMP/target_depend_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_depend_messages.cpp
@@ -74,7 +74,7 @@
foo();
#pragma omp target depend (in : argv[0:-1]) // expected-error {{section length is evaluated to a negative value -1}}
foo();
- #pragma omp target depend (in : argv[-1:0])
+ #pragma omp target depend (in : argv[-1:0]) // expected-error {{zero-length array section is not allowed in 'depend' clause}}
foo();
#pragma omp target depend (in : argv[:]) // expected-error {{section length is unspecified and cannot be inferred because subscripted value is not an array}}
foo();
diff --git a/src/llvm-project/clang/test/OpenMP/target_enter_data_codegen.cpp b/src/llvm-project/clang/test/OpenMP/target_enter_data_codegen.cpp
index bed695f..1bb2f76 100644
--- a/src/llvm-project/clang/test/OpenMP/target_enter_data_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_enter_data_codegen.cpp
@@ -40,6 +40,10 @@
// CK1: [[SIZE04:@.+]] = {{.+}}constant [2 x i64] [i64 sdiv exact (i64 sub (i64 ptrtoint (double** getelementptr (double*, double** getelementptr inbounds (%struct.ST, %struct.ST* @gb, i32 0, i32 1), i32 1) to i64), i64 ptrtoint (double** getelementptr inbounds (%struct.ST, %struct.ST* @gb, i32 0, i32 1) to i64)), i64 ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64)), i64 24]
// CK1: [[MTYPE04:@.+]] = {{.+}}constant [2 x i64] [i64 32, i64 281474976710673]
+// CK1: [[MTYPE05:@.+]] = {{.+}}constant [1 x i64] [i64 1057]
+
+// CK1: [[MTYPE06:@.+]] = {{.+}}constant [1 x i64] [i64 1061]
+
// CK1-LABEL: _Z3fooi
void foo(int arg) {
int la;
@@ -146,6 +150,56 @@
// CK1-NOT: __tgt_target_data_end
#pragma omp target enter data map(to: gb.b[:3])
{++arg;}
+
+ // CK1: %{{.+}} = add nsw i32 %{{[^,]+}}, 1
+ {++arg;}
+
+ // Region 05
+ // CK1-DAG: call void @__tgt_target_data_begin(i64 -1, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], i[[sz]]* [[GEPS:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE05]]{{.+}})
+ // CK1-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]]
+ // CK1-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]]
+ // CK1-DAG: [[GEPS]] = getelementptr inbounds {{.+}}[[S:%[^,]+]]
+
+ // CK1-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0
+ // CK1-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0
+ // CK1-DAG: [[S0:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 0
+ // CK1-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to float**
+ // CK1-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to float**
+ // CK1-DAG: store float* [[VAR0:%.+]], float** [[CBP0]]
+ // CK1-DAG: store float* [[VAR0]], float** [[CP0]]
+ // CK1-DAG: store i[[sz]] [[CSVAL0:%[^,]+]], i[[sz]]* [[S0]]
+ // CK1-64-DAG: [[CSVAL0]] = mul nuw i64 %{{[^,]+}}, 4
+ // CK1-32-DAG: [[CSVAL0]] = sext i32 [[CSVAL032:%.+]] to i64
+ // CK1-32-DAG: [[CSVAL032]] = mul nuw i32 %{{[^,]+}}, 4
+ // CK1: %{{.+}} = add nsw i32 %{{[^,]+}}, 1
+ // CK1-NOT: __tgt_target_data_end
+ #pragma omp target enter data map(close, to: lb)
+ {++arg;}
+
+ // CK1: %{{.+}} = add nsw i32 %{{[^,]+}}, 1
+ {++arg;}
+
+ // Region 06
+ // CK1-DAG: call void @__tgt_target_data_begin(i64 -1, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], i[[sz]]* [[GEPS:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE06]]{{.+}})
+ // CK1-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]]
+ // CK1-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]]
+ // CK1-DAG: [[GEPS]] = getelementptr inbounds {{.+}}[[S:%[^,]+]]
+
+ // CK1-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0
+ // CK1-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0
+ // CK1-DAG: [[S0:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 0
+ // CK1-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to float**
+ // CK1-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to float**
+ // CK1-DAG: store float* [[VAR0:%.+]], float** [[CBP0]]
+ // CK1-DAG: store float* [[VAR0]], float** [[CP0]]
+ // CK1-DAG: store i[[sz]] [[CSVAL0:%[^,]+]], i[[sz]]* [[S0]]
+ // CK1-64-DAG: [[CSVAL0]] = mul nuw i64 %{{[^,]+}}, 4
+ // CK1-32-DAG: [[CSVAL0]] = sext i32 [[CSVAL032:%.+]] to i64
+ // CK1-32-DAG: [[CSVAL032]] = mul nuw i32 %{{[^,]+}}, 4
+ // CK1: %{{.+}} = add nsw i32 %{{[^,]+}}, 1
+ // CK1-NOT: __tgt_target_data_end
+ #pragma omp target enter data map(always close, to: lb)
+ {++arg;}
}
#endif
///==========================================================================///
@@ -298,4 +352,81 @@
{++arg;}
}
#endif
+///==========================================================================///
+// RUN: %clang_cc1 -DCK5 -verify -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck %s --check-prefix CK5 --check-prefix CK5-64
+// RUN: %clang_cc1 -DCK5 -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CK5 --check-prefix CK5-64
+// RUN: %clang_cc1 -DCK5 -verify -fopenmp -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck %s --check-prefix CK5 --check-prefix CK5-32
+// RUN: %clang_cc1 -DCK5 -fopenmp -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CK5 --check-prefix CK5-32
+
+// RUN: %clang_cc1 -DCK5 -verify -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -DCK5 -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -DCK5 -verify -fopenmp-simd -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -DCK5 -fopenmp-simd -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY1 %s
+// SIMD-ONLY1-NOT: {{__kmpc|__tgt}}
+#ifdef CK5
+
+// CK5: [[STT:%.+]] = type { i32, double* }
+template <typename T>
+struct STT {
+ T a;
+ double *b;
+
+ T foo(T arg) {
+ // Region 00
+ #pragma omp target enter data map(always close to: b[1:3]) if(a>123) device(arg)
+ {arg++;}
+ return arg;
+ }
+};
+
+// CK5: [[MTYPE00:@.+]] = {{.+}}constant [2 x i64] [i64 32, i64 281474976711701]
+
+// CK5-LABEL: _Z3bari
+int bar(int arg){
+ STT<int> A;
+ return A.foo(arg);
+}
+
+// Region 00
+// CK5: br i1 %{{[^,]+}}, label %[[IFTHEN:[^,]+]], label %[[IFELSE:[^,]+]]
+// CK5: [[IFTHEN]]
+// CK5-DAG: call void @__tgt_target_data_begin(i64 [[DEV:%[^,]+]], i32 2, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], i[[sz:64|32]]* [[GEPS:%.+]], {{.+}}getelementptr {{.+}}[2 x i{{.+}}]* [[MTYPE00]]{{.+}})
+// CK5-DAG: [[DEV]] = sext i32 [[DEVi32:%[^,]+]] to i64
+// CK5-DAG: [[DEVi32]] = load i32, i32* %{{[^,]+}},
+// CK5-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]]
+// CK5-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]]
+// CK5-DAG: [[GEPS]] = getelementptr inbounds {{.+}}[[S:%[^,]+]]
+
+// CK5-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0
+// CK5-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0
+// CK5-DAG: [[S0:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 0
+// CK5-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[STT]]**
+// CK5-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to double***
+// CK5-DAG: store [[STT]]* [[VAR0:%.+]], [[STT]]** [[CBP0]]
+// CK5-DAG: store double** [[SEC0:%.+]], double*** [[CP0]]
+// CK5-DAG: store i[[sz]] {{%.+}}, i[[sz]]* [[S0]]
+// CK5-DAG: [[SEC0]] = getelementptr inbounds {{.*}}[[STT]]* [[VAR0]], i32 0, i32 1
+
+// CK5-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1
+// CK5-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1
+// CK5-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to double***
+// CK5-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to double**
+// CK5-DAG: store double** [[SEC0]], double*** [[CBP1]]
+// CK5-DAG: store double* [[SEC1:%.+]], double** [[CP1]]
+// CK5-DAG: [[SEC1]] = getelementptr inbounds {{.*}}double* [[SEC11:%[^,]+]], i{{.+}} 1
+// CK5-DAG: [[SEC11]] = load double*, double** [[SEC111:%[^,]+]],
+// CK5-DAG: [[SEC111]] = getelementptr inbounds {{.*}}[[STT]]* [[VAR0]], i32 0, i32 1
+
+// CK5: br label %[[IFEND:[^,]+]]
+
+// CK5: [[IFELSE]]
+// CK5: br label %[[IFEND]]
+// CK5: [[IFEND]]
+// CK5: %{{.+}} = add nsw i32 %{{[^,]+}}, 1
+// CK5-NOT: __tgt_target_data_end
+#endif
#endif
diff --git a/src/llvm-project/clang/test/OpenMP/target_enter_data_depend_codegen.cpp b/src/llvm-project/clang/test/OpenMP/target_enter_data_depend_codegen.cpp
index b56e375..7fd0d91 100644
--- a/src/llvm-project/clang/test/OpenMP/target_enter_data_depend_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_enter_data_depend_codegen.cpp
@@ -376,7 +376,7 @@
{++arg;}
}
-// CK1: define internal{{.*}} i32 [[TASK_ENTRY0]](i32{{.*}}, %struct.kmp_task_t_with_privates* noalias)
+// CK1: define internal{{.*}} i32 [[TASK_ENTRY0]](i32{{.*}}, %struct.kmp_task_t_with_privates* noalias %1)
// CK1-DAG: call void @__tgt_target_data_begin_nowait(i64 [[DEV:%[^,]+]], i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], i64* [[GEPS:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE00]]{{.+}})
// CK1-DAG: [[DEV]] = sext i32 [[DEVi32:%[^,]+]] to i64
// CK1-DAG: [[DEVi32]] = load i32, i32* %{{[^,]+}},
@@ -390,7 +390,7 @@
// CK1: ret i32 0
// CK1: }
-// CK1: define internal{{.*}} i32 [[TASK_ENTRY2]](i32{{.*}}, %struct.kmp_task_t_with_privates{{.+}}* noalias)
+// CK1: define internal{{.*}} i32 [[TASK_ENTRY2]](i32{{.*}}, %struct.kmp_task_t_with_privates{{.+}}* noalias %1)
// CK1-DAG: call void @__tgt_target_data_begin(i64 4, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], i64* [[GEPS:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE02]]{{.+}})
// CK1-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]]
// CK1-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]]
@@ -402,7 +402,7 @@
// CK1: ret i32 0
// CK1: }
-// CK1: define internal{{.*}} i32 [[TASK_ENTRY3]](i32{{.*}}, %struct.kmp_task_t_with_privates{{.+}}* noalias)
+// CK1: define internal{{.*}} i32 [[TASK_ENTRY3]](i32{{.*}}, %struct.kmp_task_t_with_privates{{.+}}* noalias %1)
// CK1-DAG: call void @__tgt_target_data_begin(i64 -1, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], i64* [[GEPS:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE03]]{{.+}})
// CK1-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]]
// CK1-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]]
@@ -416,7 +416,7 @@
// CK1: ret i32 0
// CK1: }
-// CK1: define internal{{.*}} i32 [[TASK_ENTRY4]](i32{{.*}}, %struct.kmp_task_t_with_privates{{.+}}* noalias)
+// CK1: define internal{{.*}} i32 [[TASK_ENTRY4]](i32{{.*}}, %struct.kmp_task_t_with_privates{{.+}}* noalias %1)
// CK1-DAG: call void @__tgt_target_data_begin(i64 -1, i32 2, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], i64* [[GEPS:%.+]], {{.+}}getelementptr {{.+}}[2 x i{{.+}}]* [[MTYPE04]]{{.+}})
// CK1-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]]
// CK1-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]]
diff --git a/src/llvm-project/clang/test/OpenMP/target_enter_data_depend_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_enter_data_depend_messages.cpp
index 49dddfc..6d459e8 100644
--- a/src/llvm-project/clang/test/OpenMP/target_enter_data_depend_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_enter_data_depend_messages.cpp
@@ -70,7 +70,7 @@
foo();
#pragma omp target enter data map(to: i) depend (in : argv[0:-1]) // expected-error {{section length is evaluated to a negative value -1}}
foo();
- #pragma omp target enter data map(to: i) depend (in : argv[-1:0])
+ #pragma omp target enter data map(to: i) depend (in : argv[-1:0]) // expected-error {{zero-length array section is not allowed in 'depend' clause}}
foo();
#pragma omp target enter data map(to: i) depend (in : argv[:]) // expected-error {{section length is unspecified and cannot be inferred because subscripted value is not an array}}
foo();
@@ -145,7 +145,7 @@
foo();
#pragma omp target enter data map(to: i) depend (in : argv[0:-1]) // expected-error {{section length is evaluated to a negative value -1}}
foo();
- #pragma omp target enter data map(to: i) depend (in : argv[-1:0])
+ #pragma omp target enter data map(to: i) depend (in : argv[-1:0]) // expected-error {{zero-length array section is not allowed in 'depend' clause}}
foo();
#pragma omp target enter data map(to: i) depend (in : argv[:]) // expected-error {{section length is unspecified and cannot be inferred because subscripted value is not an array}}
foo();
diff --git a/src/llvm-project/clang/test/OpenMP/target_enter_data_map_messages.c b/src/llvm-project/clang/test/OpenMP/target_enter_data_map_messages.c
index cd082c6..c270173 100644
--- a/src/llvm-project/clang/test/OpenMP/target_enter_data_map_messages.c
+++ b/src/llvm-project/clang/test/OpenMP/target_enter_data_map_messages.c
@@ -4,6 +4,13 @@
// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - -x c++ %s -Wuninitialized
+void xxx(int argc) {
+ int map; // expected-note {{initialize the variable 'map' to silence this warning}}
+#pragma omp target enter data map(to: map) // expected-warning {{variable 'map' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
int main(int argc, char **argv) {
int r;
diff --git a/src/llvm-project/clang/test/OpenMP/target_exit_data_codegen.cpp b/src/llvm-project/clang/test/OpenMP/target_exit_data_codegen.cpp
index d06738e..c045373 100644
--- a/src/llvm-project/clang/test/OpenMP/target_exit_data_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_exit_data_codegen.cpp
@@ -40,6 +40,10 @@
// CK1: [[SIZE04:@.+]] = {{.+}}constant [2 x i64] [i64 sdiv exact (i64 sub (i64 ptrtoint (double** getelementptr (double*, double** getelementptr inbounds (%struct.ST, %struct.ST* @gb, i32 0, i32 1), i32 1) to i64), i64 ptrtoint (double** getelementptr inbounds (%struct.ST, %struct.ST* @gb, i32 0, i32 1) to i64)), i64 ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64)), i64 24]
// CK1: [[MTYPE04:@.+]] = {{.+}}constant [2 x i64] [i64 32, i64 281474976710672]
+// CK1: [[MTYPE05:@.+]] = {{.+}}constant [1 x i64] [i64 1058]
+
+// CK1: [[MTYPE06:@.+]] = {{.+}}constant [1 x i64] [i64 1062]
+
// CK1-LABEL: _Z3fooi
void foo(int arg) {
int la;
@@ -146,6 +150,56 @@
// CK1: %{{.+}} = add nsw i32 %{{[^,]+}}, 1
#pragma omp target exit data map(release: gb.b[:3])
{++arg;}
+
+ // CK1: %{{.+}} = add nsw i32 %{{[^,]+}}, 1
+ {++arg;}
+
+ // Region 05
+ // CK1-NOT: __tgt_target_data_begin
+ // CK1-DAG: call void @__tgt_target_data_end(i64 -1, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], i[[sz]]* [[GEPS:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE05]]{{.+}})
+ // CK1-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]]
+ // CK1-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]]
+ // CK1-DAG: [[GEPS]] = getelementptr inbounds {{.+}}[[S:%[^,]+]]
+
+ // CK1-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0
+ // CK1-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0
+ // CK1-DAG: [[S0:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 0
+ // CK1-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to float**
+ // CK1-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to float**
+ // CK1-DAG: store float* [[VAL0:%[^,]+]], float** [[CBP0]]
+ // CK1-DAG: store float* [[VAL0]], float** [[CP0]]
+ // CK1-DAG: store i[[sz]] [[CSVAL0:%[^,]+]], i[[sz]]* [[S0]]
+ // CK1-64-DAG: [[CSVAL0]] = mul nuw i[[sz]] %{{[^,]+}}, 4
+ // CK1-32-DAG: [[CSVAL0]] = sext i32 [[CSVAL032:%.+]] to i64
+ // CK1-32-DAG: [[CSVAL032]] = mul nuw i32 %{{[^,]+}}, 4
+ // CK1: %{{.+}} = add nsw i32 %{{[^,]+}}, 1
+ #pragma omp target exit data map(close, from: lb)
+ {++arg;}
+
+ // CK1: %{{.+}} = add nsw i32 %{{[^,]+}}, 1
+ {++arg;}
+
+ // Region 06
+ // CK1-NOT: __tgt_target_data_begin
+ // CK1-DAG: call void @__tgt_target_data_end(i64 -1, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], i[[sz]]* [[GEPS:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE06]]{{.+}})
+ // CK1-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]]
+ // CK1-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]]
+ // CK1-DAG: [[GEPS]] = getelementptr inbounds {{.+}}[[S:%[^,]+]]
+
+ // CK1-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0
+ // CK1-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0
+ // CK1-DAG: [[S0:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 0
+ // CK1-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to float**
+ // CK1-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to float**
+ // CK1-DAG: store float* [[VAL0:%[^,]+]], float** [[CBP0]]
+ // CK1-DAG: store float* [[VAL0]], float** [[CP0]]
+ // CK1-DAG: store i[[sz]] [[CSVAL0:%[^,]+]], i[[sz]]* [[S0]]
+ // CK1-64-DAG: [[CSVAL0]] = mul nuw i[[sz]] %{{[^,]+}}, 4
+ // CK1-32-DAG: [[CSVAL0]] = sext i32 [[CSVAL032:%.+]] to i64
+ // CK1-32-DAG: [[CSVAL032]] = mul nuw i32 %{{[^,]+}}, 4
+ // CK1: %{{.+}} = add nsw i32 %{{[^,]+}}, 1
+ #pragma omp target exit data map(always close, from: lb)
+ {++arg;}
}
#endif
///==========================================================================///
@@ -252,4 +306,81 @@
{++arg;}
}
#endif
+///==========================================================================///
+// RUN: %clang_cc1 -DCK4 -verify -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck %s --check-prefix CK4 --check-prefix CK4-64
+// RUN: %clang_cc1 -DCK4 -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CK4 --check-prefix CK4-64
+// RUN: %clang_cc1 -DCK4 -verify -fopenmp -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck %s --check-prefix CK4 --check-prefix CK4-32
+// RUN: %clang_cc1 -DCK4 -fopenmp -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CK4 --check-prefix CK4-32
+
+// RUN: %clang_cc1 -DCK4 -verify -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -DCK4 -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -DCK4 -verify -fopenmp-simd -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -DCK4 -fopenmp-simd -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY1 %s
+// SIMD-ONLY1-NOT: {{__kmpc|__tgt}}
+#ifdef CK4
+
+// CK4: [[STT:%.+]] = type { i32, double* }
+template <typename T>
+struct STT {
+ T a;
+ double *b;
+
+ T foo(T arg) {
+ // Region 00
+ #pragma omp target exit data map(always close, release: b[1:3]) if(a>123) device(arg)
+ {arg++;}
+ return arg;
+ }
+};
+
+// CK4: [[MTYPE00:@.+]] = {{.+}}constant [2 x i64] [i64 32, i64 281474976711700]
+
+// CK4-LABEL: _Z3bari
+int bar(int arg){
+ STT<int> A;
+ return A.foo(arg);
+}
+
+// Region 00
+// CK4-NOT: __tgt_target_data_begin
+// CK4: br i1 %{{[^,]+}}, label %[[IFTHEN:[^,]+]], label %[[IFELSE:[^,]+]]
+// CK4: [[IFTHEN]]
+// CK4-DAG: call void @__tgt_target_data_end(i64 [[DEV:%[^,]+]], i32 2, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], i[[sz:.+]]* [[GEPS:%.+]], {{.+}}getelementptr {{.+}}[2 x i{{.+}}]* [[MTYPE00]]{{.+}})
+// CK4-DAG: [[DEV]] = sext i32 [[DEVi32:%[^,]+]] to i64
+// CK4-DAG: [[DEVi32]] = load i32, i32* %{{[^,]+}},
+// CK4-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]]
+// CK4-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]]
+// CK4-DAG: [[GEPS]] = getelementptr inbounds {{.+}}[[S:%[^,]+]]
+
+// CK4-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0
+// CK4-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0
+// CK4-DAG: [[S0:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 0
+// CK4-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[STT]]**
+// CK4-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to double***
+// CK4-DAG: store [[STT]]* [[VAR0:%[^,]+]], [[STT]]** [[CBP0]]
+// CK4-DAG: store double** [[SEC0:%[^,]+]], double*** [[CP0]]
+// CK4-DAG: store i[[sz]] [[CSVAL0:%[^,]+]], i[[sz]]* [[S0]]
+// CK4-DAG: [[SEC0]] = getelementptr inbounds {{.*}}[[STT]]* [[VAR0]], i32 0, i32 1
+
+// CK4-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1
+// CK4-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1
+// CK4-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to double***
+// CK4-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to double**
+// CK4-DAG: store double** [[SEC0]], double*** [[CBP1]]
+// CK4-DAG: store double* [[SEC1:%[^,]+]], double** [[CP1]]
+// CK4-DAG: [[SEC1]] = getelementptr inbounds {{.*}}double* [[SEC11:%[^,]+]], i{{.+}} 1
+// CK4-DAG: [[SEC11]] = load double*, double** [[SEC111:%[^,]+]],
+// CK4-DAG: [[SEC111]] = getelementptr inbounds {{.*}}[[STT]]* [[VAR0]], i32 0, i32 1
+
+// CK4: br label %[[IFEND:[^,]+]]
+
+// CK4: [[IFELSE]]
+// CK4: br label %[[IFEND]]
+// CK4: [[IFEND]]
+// CK4: %{{.+}} = add nsw i32 %{{[^,]+}}, 1
+#endif
#endif
diff --git a/src/llvm-project/clang/test/OpenMP/target_exit_data_depend_codegen.cpp b/src/llvm-project/clang/test/OpenMP/target_exit_data_depend_codegen.cpp
index deb340a..a455d8e 100644
--- a/src/llvm-project/clang/test/OpenMP/target_exit_data_depend_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_exit_data_depend_codegen.cpp
@@ -376,7 +376,7 @@
{++arg;}
}
-// CK1: define internal{{.*}} i32 [[TASK_ENTRY0]](i32{{.*}}, %struct.kmp_task_t_with_privates* noalias)
+// CK1: define internal{{.*}} i32 [[TASK_ENTRY0]](i32{{.*}}, %struct.kmp_task_t_with_privates* noalias %1)
// CK1-DAG: call void @__tgt_target_data_end_nowait(i64 [[DEV:%[^,]+]], i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], i64* [[GEPS:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE00]]{{.+}})
// CK1-DAG: [[DEV]] = sext i32 [[DEVi32:%[^,]+]] to i64
// CK1-DAG: [[DEVi32]] = load i32, i32* %{{[^,]+}},
@@ -390,7 +390,7 @@
// CK1: ret i32 0
// CK1: }
-// CK1: define internal{{.*}} i32 [[TASK_ENTRY2]](i32{{.*}}, %struct.kmp_task_t_with_privates{{.+}}* noalias)
+// CK1: define internal{{.*}} i32 [[TASK_ENTRY2]](i32{{.*}}, %struct.kmp_task_t_with_privates{{.+}}* noalias %1)
// CK1-DAG: call void @__tgt_target_data_end(i64 4, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], i64* [[GEPS:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE02]]{{.+}})
// CK1-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]]
// CK1-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]]
@@ -402,7 +402,7 @@
// CK1: ret i32 0
// CK1: }
-// CK1: define internal{{.*}} i32 [[TASK_ENTRY3]](i32{{.*}}, %struct.kmp_task_t_with_privates{{.+}}* noalias)
+// CK1: define internal{{.*}} i32 [[TASK_ENTRY3]](i32{{.*}}, %struct.kmp_task_t_with_privates{{.+}}* noalias %1)
// CK1-DAG: call void @__tgt_target_data_end(i64 -1, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], i64* [[GEPS:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE03]]{{.+}})
// CK1-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]]
// CK1-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]]
@@ -416,7 +416,7 @@
// CK1: ret i32 0
// CK1: }
-// CK1: define internal{{.*}} i32 [[TASK_ENTRY4]](i32{{.*}}, %struct.kmp_task_t_with_privates{{.+}}* noalias)
+// CK1: define internal{{.*}} i32 [[TASK_ENTRY4]](i32{{.*}}, %struct.kmp_task_t_with_privates{{.+}}* noalias %1)
// CK1-DAG: call void @__tgt_target_data_end(i64 -1, i32 2, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], i64* [[GEPS:%.+]], {{.+}}getelementptr {{.+}}[2 x i{{.+}}]* [[MTYPE04]]{{.+}})
// CK1-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]]
// CK1-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]]
diff --git a/src/llvm-project/clang/test/OpenMP/target_exit_data_depend_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_exit_data_depend_messages.cpp
index 8a2b07e..e35e590 100644
--- a/src/llvm-project/clang/test/OpenMP/target_exit_data_depend_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_exit_data_depend_messages.cpp
@@ -70,7 +70,7 @@
foo();
#pragma omp target exit data map(from: i) depend (in : argv[0:-1]) // expected-error {{section length is evaluated to a negative value -1}}
foo();
- #pragma omp target exit data map(from: i) depend (in : argv[-1:0])
+ #pragma omp target exit data map(from: i) depend (in : argv[-1:0]) // expected-error {{zero-length array section is not allowed in 'depend' clause}}
foo();
#pragma omp target exit data map(from: i) depend (in : argv[:]) // expected-error {{section length is unspecified and cannot be inferred because subscripted value is not an array}}
foo();
@@ -145,7 +145,7 @@
foo();
#pragma omp target exit data map(from: i) depend (in : argv[0:-1]) // expected-error {{section length is evaluated to a negative value -1}}
foo();
- #pragma omp target exit data map(from: i) depend (in : argv[-1:0])
+ #pragma omp target exit data map(from: i) depend (in : argv[-1:0]) // expected-error {{zero-length array section is not allowed in 'depend' clause}}
foo();
#pragma omp target exit data map(from: i) depend (in : argv[:]) // expected-error {{section length is unspecified and cannot be inferred because subscripted value is not an array}}
foo();
diff --git a/src/llvm-project/clang/test/OpenMP/target_firstprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_firstprivate_messages.cpp
index d96516a..f5e0c4c 100644
--- a/src/llvm-project/clang/test/OpenMP/target_firstprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_firstprivate_messages.cpp
@@ -2,6 +2,13 @@
// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+void xxx(int argc) {
+ int fp, fp1; // expected-note {{initialize the variable 'fp' to silence this warning}} expected-note {{initialize the variable 'fp1' to silence this warning}}
+#pragma omp target firstprivate(fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ++fp1; // expected-warning {{variable 'fp1' is uninitialized when used here}}
+}
+
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
extern const omp_allocator_handle_t omp_large_cap_mem_alloc;
@@ -48,7 +55,7 @@
S5(int v) : a(v) {}
S5 &operator=(S5 &s) {
#pragma omp target firstprivate(a) firstprivate(this->a) firstprivate(s.a) // expected-error {{expected variable name or data member of current class}}
- for (int k = 0; k < s.a; ++k) // expected-warning {{Non-trivial type 'S5' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (int k = 0; k < s.a; ++k) // expected-warning {{Type 'S5' is not trivially copyable and not guaranteed to be mapped correctly}}
++s.a;
return *this;
}
diff --git a/src/llvm-project/clang/test/OpenMP/target_map_codegen.cpp b/src/llvm-project/clang/test/OpenMP/target_map_codegen.cpp
index 4254171..cd1b5e4 100644
--- a/src/llvm-project/clang/test/OpenMP/target_map_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_map_codegen.cpp
@@ -656,15 +656,15 @@
// CK11-LABEL: @.__omp_offloading_{{.*}}implicit_maps_double_complex{{.*}}_l678.region_id = weak constant i8 0
-// CK11-DAG: [[SIZES:@.+]] = {{.+}}constant [1 x i64] [i64 16]
+// CK11-DAG: [[SIZES:@.+]] = {{.+}}constant [2 x i64] [i64 16, i64 {{8|4}}]
// Map types: OMP_MAP_TO | OMP_MAP_FROM | OMP_MAP_TARGET_PARAM | OMP_MAP_IMPLICIT = 547
-// CK11-DAG: [[TYPES:@.+]] = {{.+}}constant [1 x i64] [i64 547]
+// CK11-DAG: [[TYPES:@.+]] = {{.+}}constant [2 x i64] [i64 547, i64 547]
// CK11-LABEL: implicit_maps_double_complex{{.*}}(
-void implicit_maps_double_complex (int a){
+void implicit_maps_double_complex (int a, int *b){
double _Complex dc = (double)a;
- // CK11-DAG: call i32 @__tgt_target(i64 {{.+}}, i8* {{.+}}, i32 1, i8** [[BPGEP:%[0-9]+]], i8** [[PGEP:%[0-9]+]], {{.+}}[[SIZES]]{{.+}}, {{.+}}[[TYPES]]{{.+}})
+ // CK11-DAG: call i32 @__tgt_target(i64 {{.+}}, i8* {{.+}}, i32 2, i8** [[BPGEP:%[0-9]+]], i8** [[PGEP:%[0-9]+]], {{.+}}[[SIZES]]{{.+}}, {{.+}}[[TYPES]]{{.+}})
// CK11-DAG: [[BPGEP]] = getelementptr inbounds {{.+}}[[BPS:%[^,]+]], i32 0, i32 0
// CK11-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0
// CK11-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0
@@ -674,14 +674,14 @@
// CK11-DAG: store { double, double }* [[PTR:%[^,]+]], { double, double }** [[CBP1]]
// CK11-DAG: store { double, double }* [[PTR]], { double, double }** [[CP1]]
- // CK11: call void [[KERNEL:@.+]]({ double, double }* [[PTR]])
+ // CK11: call void [[KERNEL:@.+]]({ double, double }* [[PTR]], i32** %{{.+}})
#pragma omp target defaultmap(tofrom:scalar)
{
- dc *= dc;
+ dc *= dc; *b = 1;
}
}
-// CK11: define internal void [[KERNEL]]({ double, double }* {{.*}}[[ARG:%.+]])
+// CK11: define internal void [[KERNEL]]({ double, double }* {{.*}}[[ARG:%.+]], i32** {{.*}})
// CK11: [[ADDR:%.+]] = alloca { double, double }*,
// CK11: store { double, double }* [[ARG]], { double, double }** [[ADDR]],
// CK11: [[REF:%.+]] = load { double, double }*, { double, double }** [[ADDR]],
@@ -1323,172 +1323,176 @@
// SIMD-ONLY18-NOT: {{__kmpc|__tgt}}
#ifdef CK19
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1510.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1514.region_id = weak constant i8 0
// CK19: [[SIZE00:@.+]] = private {{.*}}constant [1 x i64] [i64 4]
// CK19: [[MTYPE00:@.+]] = private {{.*}}constant [1 x i64] [i64 32]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1531.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1535.region_id = weak constant i8 0
// CK19: [[SIZE00n:@.+]] = private {{.*}}constant [1 x i64] [i64 4]
// CK19: [[MTYPE00n:@.+]] = private {{.*}}constant [1 x i64] [i64 32]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1553.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1557.region_id = weak constant i8 0
// CK19: [[SIZE01:@.+]] = private {{.*}}constant [1 x i64] [i64 400]
// CK19: [[MTYPE01:@.+]] = private {{.*}}constant [1 x i64] [i64 33]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1572.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1576.region_id = weak constant i8 0
// CK19: [[SIZE02:@.+]] = private {{.*}}constant [1 x i64] [i64 240]
// CK19: [[MTYPE02:@.+]] = private {{.*}}constant [1 x i64] [i64 34]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1591.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1595.region_id = weak constant i8 0
// CK19: [[SIZE03:@.+]] = private {{.*}}constant [1 x i64] [i64 240]
// CK19: [[MTYPE03:@.+]] = private {{.*}}constant [1 x i64] [i64 35]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1610.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1614.region_id = weak constant i8 0
// CK19: [[SIZE04:@.+]] = private {{.*}}constant [1 x i64] [i64 400]
// CK19: [[MTYPE04:@.+]] = private {{.*}}constant [1 x i64] [i64 32]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1629.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1633.region_id = weak constant i8 0
// CK19: [[SIZE05:@.+]] = private {{.*}}constant [1 x i64] [i64 4]
// CK19: [[MTYPE05:@.+]] = private {{.*}}constant [1 x i64] [i64 33]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1652.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1656.region_id = weak constant i8 0
// CK19: [[MTYPE06:@.+]] = private {{.*}}constant [1 x i64] [i64 35]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1675.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1679.region_id = weak constant i8 0
// CK19: [[MTYPE07:@.+]] = private {{.*}}constant [1 x i64] [i64 32]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1694.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1698.region_id = weak constant i8 0
// CK19: [[SIZE08:@.+]] = private {{.*}}constant [1 x i64] [i64 4]
// CK19: [[MTYPE08:@.+]] = private {{.*}}constant [1 x i64] [i64 35]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1715.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1719.region_id = weak constant i8 0
// CK19: [[SIZE09:@.+]] = private {{.*}}constant [1 x i64] [i64 {{8|4}}]
// CK19: [[MTYPE09:@.+]] = private {{.*}}constant [1 x i64] [i64 34]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1736.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1740.region_id = weak constant i8 0
// CK19: [[SIZE10:@.+]] = private {{.*}}constant [1 x i64] [i64 240]
// CK19: [[MTYPE10:@.+]] = private {{.*}}constant [1 x i64] [i64 35]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1757.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1761.region_id = weak constant i8 0
// CK19: [[SIZE11:@.+]] = private {{.*}}constant [1 x i64] [i64 240]
// CK19: [[MTYPE11:@.+]] = private {{.*}}constant [1 x i64] [i64 32]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1778.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1782.region_id = weak constant i8 0
// CK19: [[SIZE12:@.+]] = private {{.*}}constant [1 x i64] [i64 4]
// CK19: [[MTYPE12:@.+]] = private {{.*}}constant [1 x i64] [i64 33]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1803.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1807.region_id = weak constant i8 0
// CK19: [[MTYPE13:@.+]] = private {{.*}}constant [1 x i64] [i64 32]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1828.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1832.region_id = weak constant i8 0
// CK19: [[MTYPE14:@.+]] = private {{.*}}constant [1 x i64] [i64 33]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1849.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1853.region_id = weak constant i8 0
// CK19: [[SIZE15:@.+]] = private {{.*}}constant [1 x i64] [i64 4]
// CK19: [[MTYPE15:@.+]] = private {{.*}}constant [1 x i64] [i64 34]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1883.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1887.region_id = weak constant i8 0
// CK19: [[MTYPE16:@.+]] = private {{.*}}constant [2 x i64] [i64 800, i64 33]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1909.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1913.region_id = weak constant i8 0
// CK19: [[SIZE17:@.+]] = private {{.*}}constant [2 x i64] [i64 {{8|4}}, i64 240]
// CK19: [[MTYPE17:@.+]] = private {{.*}}constant [2 x i64] [i64 800, i64 34]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1935.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1939.region_id = weak constant i8 0
// CK19: [[SIZE18:@.+]] = private {{.*}}constant [2 x i64] [i64 {{8|4}}, i64 240]
// CK19: [[MTYPE18:@.+]] = private {{.*}}constant [2 x i64] [i64 800, i64 35]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1967.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1971.region_id = weak constant i8 0
// CK19: [[MTYPE19:@.+]] = private {{.*}}constant [2 x i64] [i64 800, i64 32]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1993.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l1997.region_id = weak constant i8 0
// CK19: [[SIZE20:@.+]] = private {{.*}}constant [2 x i64] [i64 {{8|4}}, i64 4]
// CK19: [[MTYPE20:@.+]] = private {{.*}}constant [2 x i64] [i64 800, i64 33]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2025.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2029.region_id = weak constant i8 0
// CK19: [[MTYPE21:@.+]] = private {{.*}}constant [2 x i64] [i64 800, i64 35]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2051.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2055.region_id = weak constant i8 0
// CK19: [[SIZE22:@.+]] = private {{.*}}constant [2 x i64] [i64 {{8|4}}, i64 4]
// CK19: [[MTYPE22:@.+]] = private {{.*}}constant [2 x i64] [i64 800, i64 35]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2070.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2074.region_id = weak constant i8 0
// CK19: [[SIZE23:@.+]] = private {{.*}}constant [1 x i64] [i64 4]
// CK19: [[MTYPE23:@.+]] = private {{.*}}constant [1 x i64] [i64 39]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2092.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2096.region_id = weak constant i8 0
// CK19: [[SIZE24:@.+]] = private {{.*}}constant [1 x i64] [i64 480]
// CK19: [[MTYPE24:@.+]] = private {{.*}}constant [1 x i64] [i64 35]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2113.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2117.region_id = weak constant i8 0
// CK19: [[SIZE25:@.+]] = private {{.*}}constant [1 x i64] [i64 16]
// CK19: [[MTYPE25:@.+]] = private {{.*}}constant [1 x i64] [i64 35]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2134.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2138.region_id = weak constant i8 0
// CK19: [[SIZE26:@.+]] = private {{.*}}constant [1 x i64] [i64 24]
// CK19: [[MTYPE26:@.+]] = private {{.*}}constant [1 x i64] [i64 35]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2155.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2159.region_id = weak constant i8 0
// CK19: [[SIZE27:@.+]] = private {{.*}}constant [1 x i64] [i64 4]
// CK19: [[MTYPE27:@.+]] = private {{.*}}constant [1 x i64] [i64 35]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2200.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2204.region_id = weak constant i8 0
// CK19: [[SIZE28:@.+]] = private {{.*}}constant [3 x i64] [i64 {{8|4}}, i64 {{8|4}}, i64 16]
// CK19: [[MTYPE28:@.+]] = private {{.*}}constant [3 x i64] [i64 35, i64 16, i64 19]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2245.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2249.region_id = weak constant i8 0
// CK19: [[SIZE29:@.+]] = private {{.*}}constant [3 x i64] [i64 {{8|4}}, i64 {{8|4}}, i64 4]
// CK19: [[MTYPE29:@.+]] = private {{.*}}constant [3 x i64] [i64 35, i64 16, i64 19]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2301.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2305.region_id = weak constant i8 0
// CK19: [[MTYPE30:@.+]] = private {{.*}}constant [4 x i64] [i64 800, i64 800, i64 800, i64 35]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2345.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2349.region_id = weak constant i8 0
// CK19: [[SIZE31:@.+]] = private {{.*}}constant [4 x i64] [i64 {{8|4}}, i64 {{8|4}}, i64 {{8|4}}, i64 40]
// CK19: [[MTYPE31:@.+]] = private {{.*}}constant [4 x i64] [i64 800, i64 800, i64 800, i64 35]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2368.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2372.region_id = weak constant i8 0
// CK19: [[SIZE32:@.+]] = private {{.*}}constant [1 x i64] [i64 13728]
// CK19: [[MTYPE32:@.+]] = private {{.*}}constant [1 x i64] [i64 35]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2387.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2391.region_id = weak constant i8 0
// CK19: [[SIZE33:@.+]] = private {{.*}}constant [1 x i64] [i64 13728]
// CK19: [[MTYPE33:@.+]] = private {{.*}}constant [1 x i64] [i64 35]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2406.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2410.region_id = weak constant i8 0
// CK19: [[SIZE34:@.+]] = private {{.*}}constant [1 x i64] [i64 13728]
// CK19: [[MTYPE34:@.+]] = private {{.*}}constant [1 x i64] [i64 35]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2431.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2435.region_id = weak constant i8 0
// CK19: [[MTYPE35:@.+]] = private {{.*}}constant [1 x i64] [i64 35]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2452.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2456.region_id = weak constant i8 0
// CK19: [[SIZE36:@.+]] = private {{.*}}constant [1 x i64] [i64 208]
// CK19: [[MTYPE36:@.+]] = private {{.*}}constant [1 x i64] [i64 35]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2492.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2496.region_id = weak constant i8 0
// CK19: [[MTYPE37:@.+]] = private {{.*}}constant [3 x i64] [i64 800, i64 800, i64 35]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2534.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2538.region_id = weak constant i8 0
// CK19: [[MTYPE38:@.+]] = private {{.*}}constant [3 x i64] [i64 800, i64 800, i64 35]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2576.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2580.region_id = weak constant i8 0
// CK19: [[MTYPE39:@.+]] = private {{.*}}constant [3 x i64] [i64 800, i64 800, i64 35]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2618.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2622.region_id = weak constant i8 0
// CK19: [[MTYPE40:@.+]] = private {{.*}}constant [3 x i64] [i64 800, i64 800, i64 35]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2653.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2657.region_id = weak constant i8 0
// CK19: [[SIZE41:@.+]] = private {{.*}}constant [3 x i64] [i64 {{8|4}}, i64 {{8|4}}, i64 208]
// CK19: [[MTYPE41:@.+]] = private {{.*}}constant [3 x i64] [i64 800, i64 800, i64 35]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2698.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2702.region_id = weak constant i8 0
// CK19: [[SIZE42:@.+]] = private {{.*}}constant [3 x i64] [i64 {{8|4}}, i64 {{8|4}}, i64 104]
// CK19: [[MTYPE42:@.+]] = private {{.*}}constant [3 x i64] [i64 35, i64 16, i64 19]
-// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2723.region_id = weak constant i8 0
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2727.region_id = weak constant i8 0
// CK19: [[MTYPE43:@.+]] = private {{.*}}constant [1 x i64] [i64 35]
+// CK19-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l2746.region_id = weak constant i8 0
+// CK19: [[SIZE44:@.+]] = private {{.*}}constant [1 x i64] [i64 320]
+// CK19: [[MTYPE44:@.+]] = private {{.*}}constant [1 x i64] [i64 34]
+
// CK19-LABEL: explicit_maps_single{{.*}}(
void explicit_maps_single (int ii){
// Map of a scalar.
@@ -2725,6 +2729,25 @@
marras[1][2][3]++;
}
+ // Region 44
+ // CK19-DAG: call i32 @__tgt_target(i64 {{[^,]+}}, i8* {{[^,]+}}, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[SIZE44]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE44]]{{.+}})
+ // CK19-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]]
+ // CK19-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]]
+
+ // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0
+ // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0
+ // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [100 x i32]**
+ // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32**
+ // CK19-DAG: store [100 x i32]* [[VAR0:%.+]], [100 x i32]** [[CBP0]]
+ // CK19-DAG: store i32* [[SEC0:%[^,]+]], i32** [[CP0]]
+ // CK19-DAG: [[SEC0]] = getelementptr {{.*}}[100 x i32]* [[VAR0]], i{{.+}} 0, i{{.+}} 20
+
+ // CK19: call void [[CALL44:@.+]]([100 x i32]* {{[^,]+}})
+ #pragma omp target map(from:arra[20:])
+ {
+ arra[50]++;
+ }
+
}
// CK19: define {{.+}}[[CALL00]]
@@ -2771,6 +2794,7 @@
// CK19: define {{.+}}[[CALL41]]
// CK19: define {{.+}}[[CALL42]]
// CK19: define {{.+}}[[CALL43]]
+// CK19: define {{.+}}[[CALL44]]
#endif
///==========================================================================///
@@ -2790,19 +2814,19 @@
// SIMD-ONLY19-NOT: {{__kmpc|__tgt}}
#ifdef CK20
-// CK20-LABEL: @.__omp_offloading_{{.*}}explicit_maps_references_and_function_args{{.*}}_l2832.region_id = weak constant i8 0
+// CK20-LABEL: @.__omp_offloading_{{.*}}explicit_maps_references_and_function_args{{.*}}_l2856.region_id = weak constant i8 0
// CK20: [[SIZE00:@.+]] = private {{.*}}constant [1 x i64] [i64 4]
// CK20: [[MTYPE00:@.+]] = private {{.*}}constant [1 x i64] [i64 33]
-// CK20-LABEL: @.__omp_offloading_{{.*}}explicit_maps_references_and_function_args{{.*}}_l2853.region_id = weak constant i8 0
+// CK20-LABEL: @.__omp_offloading_{{.*}}explicit_maps_references_and_function_args{{.*}}_l2877.region_id = weak constant i8 0
// CK20: [[SIZE01:@.+]] = private {{.*}}constant [1 x i64] [i64 20]
// CK20: [[MTYPE01:@.+]] = private {{.*}}constant [1 x i64] [i64 33]
-// CK20-LABEL: @.__omp_offloading_{{.*}}explicit_maps_references_and_function_args{{.*}}_l2871.region_id = weak constant i8 0
+// CK20-LABEL: @.__omp_offloading_{{.*}}explicit_maps_references_and_function_args{{.*}}_l2895.region_id = weak constant i8 0
// CK20: [[SIZE02:@.+]] = private {{.*}}constant [1 x i64] [i64 4]
// CK20: [[MTYPE02:@.+]] = private {{.*}}constant [1 x i64] [i64 34]
-// CK20-LABEL: @.__omp_offloading_{{.*}}explicit_maps_references_and_function_args{{.*}}_l2892.region_id = weak constant i8 0
+// CK20-LABEL: @.__omp_offloading_{{.*}}explicit_maps_references_and_function_args{{.*}}_l2916.region_id = weak constant i8 0
// CK20: [[SIZE03:@.+]] = private {{.*}}constant [1 x i64] [i64 12]
// CK20: [[MTYPE03:@.+]] = private {{.*}}constant [1 x i64] [i64 34]
@@ -4046,7 +4070,7 @@
// CK24-DAG: [[VAR00]] = load [[SC]]*, [[SC]]** %{{.+}}
// CK24-DAG: [[VAR000]] = load [[SC]]*, [[SC]]** %{{.+}}
-// CK24: call void [[CALL19:@.+]]([[SC]]* {{[^,]+}})
+// CK24: call void [[CALL19:@.+]]([[SC]]* {{[^,]+}})
#pragma omp target map(p->s.sp[3]->a)
{ p->a++; }
@@ -5258,4 +5282,76 @@
}
#endif
+///==========================================================================///
+// RUN: %clang_cc1 -DCK31 -verify -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK31 --check-prefix CK31-64
+// RUN: %clang_cc1 -DCK31 -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK31 --check-prefix CK31-64
+// RUN: %clang_cc1 -DCK31 -verify -fopenmp -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK31 --check-prefix CK31-32
+// RUN: %clang_cc1 -DCK31 -fopenmp -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CK31 --check-prefix CK31-32
+
+// RUN: %clang_cc1 -DCK31 -verify -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY18 %s
+// RUN: %clang_cc1 -DCK31 -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY18 %s
+// RUN: %clang_cc1 -DCK31 -verify -fopenmp-simd -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY18 %s
+// RUN: %clang_cc1 -DCK31 -fopenmp-simd -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 -triple i386-unknown-unknown -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-targets=i386-pc-linux-gnu -x c++ -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY18 %s
+// SIMD-ONLY18-NOT: {{__kmpc|__tgt}}
+#ifdef CK31
+
+// CK31-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l5329.region_id = weak constant i8 0
+// CK31: [[SIZE00:@.+]] = private {{.*}}constant [1 x i[[Z:64|32]]] [i[[Z:64|32]] 4]
+// CK31: [[MTYPE00:@.+]] = private {{.*}}constant [1 x i64] [i64 1059]
+
+// CK31-LABEL: @.__omp_offloading_{{.*}}explicit_maps_single{{.*}}_l5348.region_id = weak constant i8 0
+// CK31: [[SIZE01:@.+]] = private {{.*}}constant [1 x i[[Z:64|32]]] [i[[Z:64|32]] 4]
+// CK31: [[MTYPE01:@.+]] = private {{.*}}constant [1 x i64] [i64 1063]
+
+// CK31-LABEL: explicit_maps_single{{.*}}(
+void explicit_maps_single (int ii){
+ // Map of a scalar.
+ int a = ii;
+
+ // Close.
+ // Region 00
+ // CK31-DAG: call i32 @__tgt_target(i64 {{[^,]+}}, i8* {{[^,]+}}, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[SIZE00]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE00]]{{.+}})
+ // CK31-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]]
+ // CK31-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]]
+
+ // CK31-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0
+ // CK31-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0
+ // CK31-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32**
+ // CK31-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32**
+ // CK31-DAG: store i32* [[VAR0:%.+]], i32** [[CBP0]]
+ // CK31-DAG: store i32* [[VAR0]], i32** [[CP0]]
+
+ // CK31: call void [[CALL00:@.+]](i32* {{[^,]+}})
+ #pragma omp target map(close, tofrom: a)
+ {
+ a++;
+ }
+
+ // Always Close.
+ // Region 01
+ // CK31-DAG: call i32 @__tgt_target(i64 {{[^,]+}}, i8* {{[^,]+}}, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[SIZE01]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE01]]{{.+}})
+ // CK31-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]]
+ // CK31-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]]
+
+ // CK31-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0
+ // CK31-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0
+ // CK31-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32**
+ // CK31-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32**
+ // CK31-DAG: store i32* [[VAR0:%.+]], i32** [[CBP0]]
+ // CK31-DAG: store i32* [[VAR0]], i32** [[CP0]]
+
+ // CK31: call void [[CALL01:@.+]](i32* {{[^,]+}})
+ #pragma omp target map(always close tofrom: a)
+ {
+ a++;
+ }
+}
+// CK31: define {{.+}}[[CALL00]]
+// CK31: define {{.+}}[[CALL01]]
+
+#endif
#endif
diff --git a/src/llvm-project/clang/test/OpenMP/target_map_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_map_messages.cpp
index 15f7b4f..788fae5 100644
--- a/src/llvm-project/clang/test/OpenMP/target_map_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_map_messages.cpp
@@ -1,8 +1,8 @@
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 200 %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -DCCODE -verify -fopenmp -ferror-limit 200 -x c %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,warn -fopenmp -ferror-limit 200 %s -Wuninitialized
+// RUN: %clang_cc1 -DCCODE -verify -fopenmp -ferror-limit 200 -x c %s -Wno-openmp -Wuninitialized
// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 200 %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -DCCODE -verify -fopenmp-simd -ferror-limit 200 -x c %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -DCCODE -verify -fopenmp-simd -ferror-limit 200 -x c %s -Wno-openmp-mapping -Wuninitialized
#ifdef CCODE
void foo(int arg) {
const int n = 0;
@@ -20,6 +20,14 @@
}
#else
+void xxx(int argc) {
+ int map; // expected-note {{initialize the variable 'map' to silence this warning}}
+#pragma omp target map(tofrom: map) // expected-warning {{variable 'map' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
+
struct SREF {
int &a;
int b;
@@ -491,13 +499,13 @@
#pragma omp target data map(tofrom: argc > 0 ? x : y) // expected-error 2 {{expected expression containing only member accesses and/or array sections based on named variables}}
#pragma omp target data map(argc)
#pragma omp target data map(S1) // expected-error {{'S1' does not refer to a value}}
-#pragma omp target data map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}}
-#pragma omp target data map(ba)
-#pragma omp target data map(ca)
+#pragma omp target data map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} warn-warning 2 {{Type 'const S2' is not trivially copyable and not guaranteed to be mapped correctly}} warn-warning 2 {{Type 'const S3' is not trivially copyable and not guaranteed to be mapped correctly}}
+#pragma omp target data map(ba) // warn-warning 2 {{Type 'const S2 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
+#pragma omp target data map(ca) // warn-warning 2 {{Type 'const S3 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
#pragma omp target data map(da)
#pragma omp target data map(S2::S2s)
#pragma omp target data map(S2::S2sc)
-#pragma omp target data map(e, g)
+#pragma omp target data map(e, g) // warn-warning 2 {{Type 'S4' is not trivially copyable and not guaranteed to be mapped correctly}} warn-warning 2 {{Type 'S5' is not trivially copyable and not guaranteed to be mapped correctly}}
#pragma omp target data map(h) // expected-error {{threadprivate variables are not allowed in 'map' clause}}
#pragma omp target data map(k) map(k) // expected-error 2 {{variable already marked as mapped in current construct}} expected-note 2 {{used here}}
#pragma omp target map(k), map(k[:5]) // expected-error 2 {{pointer cannot be mapped along with a section derived from itself}} expected-note 2 {{used here}}
@@ -550,6 +558,17 @@
int b[10];
};
+class S8 {
+public:
+ virtual void foo() = 0;
+} *s8;
+
+class S9 {
+public:
+ virtual void foo() {}
+} s9;
+
+
int main(int argc, char **argv) {
const int d = 5;
const int da[5] = { 0 };
@@ -587,14 +606,14 @@
#pragma omp target data map(tofrom: argc > 0 ? argv[1] : argv[2]) // expected-error {{xpected expression containing only member accesses and/or array sections based on named variables}}
#pragma omp target data map(argc)
#pragma omp target data map(S1) // expected-error {{'S1' does not refer to a value}}
-#pragma omp target data map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}}
+#pragma omp target data map(a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}} warn-warning {{Type 'const S2' is not trivially copyable and not guaranteed to be mapped correctly}} warn-warning {{Type 'const S3' is not trivially copyable and not guaranteed to be mapped correctly}}
#pragma omp target data map(argv[1])
-#pragma omp target data map(ba)
-#pragma omp target data map(ca)
+#pragma omp target data map(ba) // warn-warning {{Type 'const S2 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
+#pragma omp target data map(ca) // warn-warning {{Type 'const S3 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
#pragma omp target data map(da)
#pragma omp target data map(S2::S2s)
#pragma omp target data map(S2::S2sc)
-#pragma omp target data map(e, g)
+#pragma omp target data map(e, g) // warn-warning {{Type 'S4' is not trivially copyable and not guaranteed to be mapped correctly}} warn-warning {{Type 'S5' is not trivially copyable and not guaranteed to be mapped correctly}}
#pragma omp target data map(h) // expected-error {{threadprivate variables are not allowed in 'map' clause}}
#pragma omp target data map(k), map(k) // expected-error {{variable already marked as mapped in current construct}} expected-note {{used here}}
#pragma omp target map(k), map(k[:5]) // expected-error {{pointer cannot be mapped along with a section derived from itself}} expected-note {{used here}}
@@ -627,7 +646,7 @@
{}
#pragma omp target firstprivate(j) map(j) // expected-error {{firstprivate variable cannot be in a map clause in '#pragma omp target' directive}} expected-note {{defined as firstprivate}}
{}
-#pragma omp target map(m)
+#pragma omp target map(m) // warn-warning {{Type 'S6<int>' is not trivially copyable and not guaranteed to be mapped correctly}}
{}
// expected-note@+1 {{used here}}
#pragma omp target map(s.s.s)
@@ -673,6 +692,8 @@
{ s.a++; }
#pragma omp target map(s.s.s.b[:2])
{ s.s.s.b[0]++; }
+#pragma omp target map(s8[0:1], s9) // warn-warning {{Type 'class S8' is not trivially copyable and not guaranteed to be mapped correctly}} warn-warning {{Type 'class S9' is not trivially copyable and not guaranteed to be mapped correctly}}
+ {}
return tmain<int, 3>(argc)+tmain<from, 4>(argc); // expected-note {{in instantiation of function template specialization 'tmain<int, 3>' requested here}} expected-note {{in instantiation of function template specialization 'tmain<int, 4>' requested here}}
}
diff --git a/src/llvm-project/clang/test/OpenMP/target_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_messages.cpp
index 9bd8b37..5f22fbc 100644
--- a/src/llvm-project/clang/test/OpenMP/target_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_messages.cpp
@@ -13,14 +13,12 @@
// NO-HOST-BC: The provided host compiler IR file '1111.bc' is required to generate code for OpenMP target regions but cannot be found.
// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm-bc %s -o %t-ppc-host.bc -DREGION_HOST
-// RUN: not %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - -DREGION_DEVICE 2>&1 | FileCheck %s --check-prefix NO-REGION
-// NO-REGION: Offloading entry for target region is incorrect: either the address or the ID is invalid.
-// NO-REGION-NOT: Offloading entry for target region is incorrect: either the address or the ID is invalid.
+// RUN: not %clang_cc1 -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - -DREGION_DEVICE 2>&1
#if defined(REGION_HOST) || defined(REGION_DEVICE)
void foo() {
#ifdef REGION_HOST
-#pragma omp target
+#pragma omp target // expected-error {{Offloading entry for target region in _Z3foov is incorrect: either the address or the ID is invalid.}}
;
#endif
#ifdef REGION_DEVICE
diff --git a/src/llvm-project/clang/test/OpenMP/target_parallel_codegen.cpp b/src/llvm-project/clang/test/OpenMP/target_parallel_codegen.cpp
index ca12a4c..1202669 100644
--- a/src/llvm-project/clang/test/OpenMP/target_parallel_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_parallel_codegen.cpp
@@ -45,13 +45,9 @@
// CHECK-DAG: [[TT:%.+]] = type { i64, i8 }
// CHECK-DAG: [[S1:%.+]] = type { double }
// CHECK-DAG: [[ENTTY:%.+]] = type { i8*, i8*, i[[SZ:32|64]], i32, i32 }
-// CHECK-DAG: [[DEVTY:%.+]] = type { i8*, i8*, [[ENTTY]]*, [[ENTTY]]* }
-// CHECK-DAG: [[DSCTY:%.+]] = type { i32, [[DEVTY]]*, [[ENTTY]]*, [[ENTTY]]* }
// TCHECK: [[ENTTY:%.+]] = type { i8*, i8*, i{{32|64}}, i32, i32 }
-// CHECK-DAG: $[[REGFN:\.omp_offloading\..+]] = comdat
-
// We have 8 target regions, but only 6 that actually will generate offloading
// code and have mapped arguments, and only 4 have all-constant map sizes.
@@ -82,16 +78,8 @@
// TCHECK: @{{.+}} = weak constant [[ENTTY]]
// TCHECK-NOT: @{{.+}} = weak constant [[ENTTY]]
-// Check if offloading descriptor is created.
-// CHECK: [[ENTBEGIN:@.+]] = external constant [[ENTTY]]
-// CHECK: [[ENTEND:@.+]] = external constant [[ENTTY]]
-// CHECK: [[DEVBEGIN:@.+]] = extern_weak constant i8
-// CHECK: [[DEVEND:@.+]] = extern_weak constant i8
-// CHECK: [[IMAGES:@.+]] = internal unnamed_addr constant [1 x [[DEVTY]]] [{{.+}} { i8* [[DEVBEGIN]], i8* [[DEVEND]], [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }], comdat($[[REGFN]])
-// CHECK: [[DESC:@.+]] = internal constant [[DSCTY]] { i32 1, [[DEVTY]]* getelementptr inbounds ([1 x [[DEVTY]]], [1 x [[DEVTY]]]* [[IMAGES]], i32 0, i32 0), [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }, comdat($[[REGFN]])
-
// Check target registration is registered as a Ctor.
-// CHECK: appending global [2 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }, { i32, void ()*, i8* } { i32 0, void ()* @[[REGFN]], i8* bitcast (void ()* @[[REGFN]] to i8*) }]
+// CHECK: appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }]
template<typename tx, typename ty>
diff --git a/src/llvm-project/clang/test/OpenMP/target_parallel_codegen_registration.cpp b/src/llvm-project/clang/test/OpenMP/target_parallel_codegen_registration.cpp
index 1258a8b..61534d8 100644
--- a/src/llvm-project/clang/test/OpenMP/target_parallel_codegen_registration.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_parallel_codegen_registration.cpp
@@ -52,13 +52,9 @@
// CHECK-DAG: [[ST1:%.+]] = type { [228 x i32] }
// CHECK-DAG: [[ST2:%.+]] = type { [1128 x i32] }
// CHECK-DAG: [[ENTTY:%.+]] = type { i8*, i8*, i[[SZ:32|64]], i32, i32 }
-// CHECK-DAG: [[DEVTY:%.+]] = type { i8*, i8*, [[ENTTY]]*, [[ENTTY]]* }
-// CHECK-DAG: [[DSCTY:%.+]] = type { i32, [[DEVTY]]*, [[ENTTY]]*, [[ENTTY]]* }
// TCHECK: [[ENTTY:%.+]] = type { i8*, i8*, i[[SZ:32|64]], i32, i32 }
-// CHECK-DAG: $[[REGFN:\.omp_offloading\..+]] = comdat
-
// CHECK-DAG: [[A1:@.+]] = internal global [[SA]]
// CHECK-DAG: [[A2:@.+]] = global [[SA]]
// CHECK-DAG: [[B1:@.+]] = global [[SB]]
@@ -123,68 +119,60 @@
// CHECK-NTARGET-NOT: private unnamed_addr constant [1 x i
// CHECK-DAG: [[NAMEPTR1:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME1:__omp_offloading_[0-9a-f]+_[0-9a-f]+__Z.+_l[0-9]+]]\00"
-// CHECK-DAG: [[ENTRY1:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR1]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY1:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR1]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR2:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME2:.+]]\00"
-// CHECK-DAG: [[ENTRY2:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR2]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY2:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR2]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR3:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME3:.+]]\00"
-// CHECK-DAG: [[ENTRY3:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR3]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY3:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR3]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR4:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME4:.+]]\00"
-// CHECK-DAG: [[ENTRY4:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR4]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY4:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR4]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR5:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME5:.+]]\00"
-// CHECK-DAG: [[ENTRY5:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR5]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY5:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR5]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR6:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME6:.+]]\00"
-// CHECK-DAG: [[ENTRY6:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR6]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY6:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR6]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR7:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME7:.+]]\00"
-// CHECK-DAG: [[ENTRY7:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR7]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY7:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR7]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR8:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME8:.+]]\00"
-// CHECK-DAG: [[ENTRY8:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR8]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY8:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR8]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR9:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME9:.+]]\00"
-// CHECK-DAG: [[ENTRY9:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR9]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY9:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR9]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR10:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME10:.+]]\00"
-// CHECK-DAG: [[ENTRY10:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR10]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY10:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR10]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR11:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME11:.+]]\00"
-// CHECK-DAG: [[ENTRY11:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR11]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY11:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR11]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR12:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME12:.+]]\00"
-// CHECK-DAG: [[ENTRY12:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR12]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY12:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR12]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR1:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME1:__omp_offloading_[0-9a-f]+_[0-9a-f]+__Z.+_l[0-9]+]]\00"
-// TCHECK-DAG: [[ENTRY1:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR1]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY1:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR1]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR2:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME2:.+]]\00"
-// TCHECK-DAG: [[ENTRY2:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR2]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY2:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR2]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR3:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME3:.+]]\00"
-// TCHECK-DAG: [[ENTRY3:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR3]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY3:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR3]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR4:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME4:.+]]\00"
-// TCHECK-DAG: [[ENTRY4:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR4]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY4:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR4]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR5:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME5:.+]]\00"
-// TCHECK-DAG: [[ENTRY5:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR5]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY5:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR5]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR6:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME6:.+]]\00"
-// TCHECK-DAG: [[ENTRY6:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR6]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY6:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR6]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR7:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME7:.+]]\00"
-// TCHECK-DAG: [[ENTRY7:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR7]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY7:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR7]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR8:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME8:.+]]\00"
-// TCHECK-DAG: [[ENTRY8:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR8]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY8:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR8]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR9:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME9:.+]]\00"
-// TCHECK-DAG: [[ENTRY9:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR9]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY9:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR9]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR10:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME10:.+]]\00"
-// TCHECK-DAG: [[ENTRY10:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR10]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY10:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR10]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR11:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME11:.+]]\00"
-// TCHECK-DAG: [[ENTRY11:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR11]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY11:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR11]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR12:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME12:.+]]\00"
-// TCHECK-DAG: [[ENTRY12:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR12]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
-
-// CHECK: [[ENTBEGIN:@.+]] = external constant [[ENTTY]]
-// CHECK: [[ENTEND:@.+]] = external constant [[ENTTY]]
-// CHECK: [[DEVBEGIN:@.+]] = extern_weak constant i8
-// CHECK: [[DEVEND:@.+]] = extern_weak constant i8
-// CHECK: [[IMAGES:@.+]] = internal unnamed_addr constant [1 x [[DEVTY]]] [{{.+}} { i8* [[DEVBEGIN]], i8* [[DEVEND]], [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }], comdat($[[REGFN]])
-// CHECK: [[DESC:@.+]] = internal constant [[DSCTY]] { i32 1, [[DEVTY]]* getelementptr inbounds ([1 x [[DEVTY]]], [1 x [[DEVTY]]]* [[IMAGES]], i32 0, i32 0), [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }, comdat($[[REGFN]])
+// TCHECK-DAG: [[ENTRY12:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR12]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// We have 4 initializers, one for the 500 priority, another one for 501, or more for the default priority, and the last one for the offloading registration function.
-// CHECK: @llvm.global_ctors = appending global [5 x { i32, void ()*, i8* }] [
+// CHECK: @llvm.global_ctors = appending global [4 x { i32, void ()*, i8* }] [
// CHECK-SAME: { i32, void ()*, i8* } { i32 500, void ()* [[P500:@[^,]+]], i8* null },
// CHECK-SAME: { i32, void ()*, i8* } { i32 501, void ()* [[P501:@[^,]+]], i8* null },
// CHECK-SAME: { i32, void ()*, i8* } { i32 65535, void ()* [[PMAX:@[^,]+]], i8* null },
-// CHECK-SAME: { i32, void ()*, i8* } { i32 0, void ()* @[[REGFN]], i8* bitcast (void ()* @[[REGFN]] to i8*) }]
// CHECK-NTARGET: @llvm.global_ctors = appending global [3 x { i32, void ()*, i8* }] [
@@ -354,12 +342,8 @@
//TCHECK-DAG: define weak void @[[NAME12]](
// CHECK-NTARGET-NOT: __tgt_target
-// CHECK-NTARGET-NOT: __tgt_register_lib
-// CHECK-NTARGET-NOT: __tgt_unregister_lib
// TCHECK-NOT: __tgt_target
-// TCHECK-NOT: __tgt_register_lib
-// TCHECK-NOT: __tgt_unregister_lib
// We have 2 initializers with priority 500
//CHECK: define internal void [[P500]](
@@ -385,25 +369,6 @@
//CHECK-NOT: call void @{{.+}}()
//CHECK: ret void
-// Check registration and unregistration
-
-//CHECK: define internal void @.omp_offloading.requires_reg()
-//CHECK: call void @__tgt_register_requires(i64 1)
-//CHECK: ret void
-
-//CHECK: define internal void @[[UNREGFN:.+]](i8*)
-//CHECK-SAME: comdat($[[REGFN]]) {
-//CHECK: call i32 @__tgt_unregister_lib([[DSCTY]]* [[DESC]])
-//CHECK: ret void
-//CHECK: declare i32 @__tgt_unregister_lib([[DSCTY]]*)
-
-//CHECK: define linkonce hidden void @[[REGFN]]()
-//CHECK-SAME: comdat {
-//CHECK: call i32 @__tgt_register_lib([[DSCTY]]* [[DESC]])
-//CHECK: call i32 @__cxa_atexit(void (i8*)* @[[UNREGFN]], i8* bitcast ([[DSCTY]]* [[DESC]] to i8*),
-//CHECK: ret void
-//CHECK: declare i32 @__tgt_register_lib([[DSCTY]]*)
-
static __attribute__((init_priority(500))) SA a1;
SA a2;
SB __attribute__((init_priority(500))) b1;
@@ -436,31 +401,31 @@
// Check metadata is properly generated:
// CHECK: !omp_offload.info = !{!{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID:-?[0-9]+]], i32 [[FILEID:-?[0-9]+]], !"_ZN2SB3fooEv", i32 216, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SDD1Ev", i32 266, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SEC1Ev", i32 282, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SED1Ev", i32 288, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EE3fooEv", i32 299, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EEC1Ev", i32 305, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_Z3bari", i32 431, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EED1Ev", i32 311, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EEC1Ev", i32 305, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EED1Ev", i32 311, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EE3fooEv", i32 299, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SCC1Ev", i32 241, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID:-?[0-9]+]], i32 [[FILEID:-?[0-9]+]], !"_ZN2SB3fooEv", i32 204, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SDD1Ev", i32 254, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SEC1Ev", i32 270, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SED1Ev", i32 276, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EE3fooEv", i32 287, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EEC1Ev", i32 293, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_Z3bari", i32 396, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EED1Ev", i32 299, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EEC1Ev", i32 293, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EED1Ev", i32 299, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EE3fooEv", i32 287, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SCC1Ev", i32 229, i32 {{[0-9]+}}}
// TCHECK: !omp_offload.info = !{!{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID:-?[0-9]+]], i32 [[FILEID:-?[0-9]+]], !"_ZN2SB3fooEv", i32 216, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SDD1Ev", i32 266, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SEC1Ev", i32 282, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SED1Ev", i32 288, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EE3fooEv", i32 299, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EEC1Ev", i32 305, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_Z3bari", i32 431, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EED1Ev", i32 311, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EEC1Ev", i32 305, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EED1Ev", i32 311, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EE3fooEv", i32 299, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SCC1Ev", i32 241, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID:-?[0-9]+]], i32 [[FILEID:-?[0-9]+]], !"_ZN2SB3fooEv", i32 204, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SDD1Ev", i32 254, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SEC1Ev", i32 270, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SED1Ev", i32 276, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EE3fooEv", i32 287, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EEC1Ev", i32 293, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_Z3bari", i32 396, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EED1Ev", i32 299, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EEC1Ev", i32 293, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EED1Ev", i32 299, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EE3fooEv", i32 287, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SCC1Ev", i32 229, i32 {{[0-9]+}}}
#endif
diff --git a/src/llvm-project/clang/test/OpenMP/target_parallel_defaultmap_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_parallel_defaultmap_messages.cpp
index 71a4d8a..c358f91 100644
--- a/src/llvm-project/clang/test/OpenMP/target_parallel_defaultmap_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_parallel_defaultmap_messages.cpp
@@ -1,58 +1,148 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 %s -verify=expected,omp5 -Wuninitialized -DOMP5
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 %s -verify=expected,omp5 -Wuninitialized -DOMP5
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 %s -verify=expected,omp45 -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 %s -verify=expected,omp45 -Wuninitialized
+
+struct Bar {
+ int a;
+};
+
+class Baz {
+ public:
+ Bar bar;
+ int *p;
+};
+
+int *g;
+int arr[50];
+Bar bar;
+Baz baz;
+Baz* bazPtr = &baz;
void foo() {
}
template <class T, typename S, int N, int ST>
T tmain(T argc, S **argv) {
- #pragma omp target parallel defaultmap // expected-error {{expected '(' after 'defaultmap'}}
+ #pragma omp target parallel defaultmap ( // omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target parallel defaultmap ( // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ #pragma omp target parallel defaultmap () // omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target parallel defaultmap () // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
+ #pragma omp target parallel defaultmap (tofrom // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target parallel defaultmap (tofrom // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+ #pragma omp target parallel defaultmap (tofrom: // expected-error {{expected ')'}} expected-note {{to match this '('}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target parallel defaultmap (tofrom: // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+ #pragma omp target parallel defaultmap (tofrom) // expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target parallel defaultmap (tofrom) // expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+ #pragma omp target parallel defaultmap (tofrom, // expected-error {{expected ')'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-note {{to match this '('}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target parallel defaultmap (tofrom scalar) // expected-warning {{missing ':' after defaultmap modifier - ignoring}}
+ #pragma omp target parallel defaultmap (scalar: // expected-error {{expected ')'}} omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target parallel defaultmap (tofrom, // expected-error {{expected ')'}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-note {{to match this '('}}
+ #pragma omp target parallel defaultmap (tofrom, scalar // expected-error {{expected ')'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target parallel defaultmap (scalar: // expected-error {{expected ')'}} expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
+#ifdef OMP5
+ #pragma omp target parallel defaultmap(tofrom:scalar) defaultmap(to:scalar) // expected-error {{at most one defaultmap clause for each variable-category can appear on the directive}}
foo();
- #pragma omp target parallel defaultmap (tofrom, scalar // expected-error {{expected ')'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
+ #pragma omp target parallel defaultmap(alloc:pointer) defaultmap(to:scalar) defaultmap(firstprivate:pointer) // expected-error {{at most one defaultmap clause for each variable-category can appear on the directive}}
foo();
+ #pragma omp target parallel defaultmap(none:pointer) // expected-note {{explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here}}
+ g++; // expected-error {{variable 'g' must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause}}
+ #pragma omp target parallel defaultmap(none:pointer) defaultmap(none:scalar) map(argc) // expected-note {{explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here}}
+ argc = *g; // expected-error {{variable 'g' must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause}}
+ #pragma omp target parallel defaultmap(none:pointer) defaultmap(none:scalar) map(g) // expected-note {{explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here}}
+ argc = *g; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause}}
+ #pragma omp target parallel defaultmap(none:pointer) defaultmap(none:scalar) defaultmap(none:aggregate) map(g) firstprivate(argc) // expected-note {{explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here}}
+ argc = *g + arr[1]; // expected-error {{variable 'arr' must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause}}
+ #pragma omp target parallel defaultmap(none:aggregate) defaultmap(none:scalar) map(argc) // expected-note {{explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here}}
+ bar.a += argc; // expected-error {{variable 'bar' must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause}}
+ #pragma omp target parallel defaultmap(none:aggregate) defaultmap(none:scalar) map(argc) // expected-note {{explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here}}
+ baz.bar.a += argc; // expected-error {{variable 'baz' must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause}}
+ int vla[argc];
+ #pragma omp target parallel defaultmap(none:aggregate) defaultmap(none:scalar) map(argc) // expected-note {{explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here}}
+ vla[argc-1] += argc; // expected-error {{variable 'vla' must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause}}
+
+ #pragma omp target defaultmap(none:aggregate) // expected-note {{explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here}}
+ #pragma omp parallel
+ baz.bar.a += argc; // expected-error {{variable 'baz' must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause}}
+
+ #pragma omp parallel
+ #pragma omp target defaultmap(none:aggregate) // expected-note {{explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here}}
+ #pragma omp parallel
+ baz.bar.a += argc; // expected-error {{variable 'baz' must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause}}
+
+ #pragma omp parallel
+ #pragma omp target defaultmap(none:aggregate) // expected-note {{explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here}}
+ #pragma omp parallel
+ *baz.p += argc; // expected-error {{variable 'baz' must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause}}
+
+ #pragma omp parallel
+ #pragma omp target defaultmap(none:pointer) // expected-note {{explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here}}
+ #pragma omp parallel
+ bazPtr->p += argc; // expected-error {{variable 'bazPtr' must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause}}
+
+#endif
return argc;
}
int main(int argc, char **argv) {
- #pragma omp target parallel defaultmap // expected-error {{expected '(' after 'defaultmap'}}
+ #pragma omp target parallel defaultmap ( // omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target parallel defaultmap ( // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ #pragma omp target parallel defaultmap () // omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target parallel defaultmap () // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
+ #pragma omp target parallel defaultmap (tofrom // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target parallel defaultmap (tofrom // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+ #pragma omp target parallel defaultmap (tofrom: // expected-error {{expected ')'}} expected-note {{to match this '('}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target parallel defaultmap (tofrom: // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+ #pragma omp target parallel defaultmap (tofrom) // expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target parallel defaultmap (tofrom) // expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+ #pragma omp target parallel defaultmap (tofrom, // expected-error {{expected ')'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-note {{to match this '('}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target parallel defaultmap (tofrom scalar) // expected-warning {{missing ':' after defaultmap modifier - ignoring}}
+ #pragma omp target parallel defaultmap (scalar: // expected-error {{expected ')'}} omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target parallel defaultmap (tofrom, // expected-error {{expected ')'}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-note {{to match this '('}}
+ #pragma omp target parallel defaultmap (tofrom, scalar // expected-error {{expected ')'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target parallel defaultmap (scalar: // expected-error {{expected ')'}} expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
+#ifdef OMP5
+ #pragma omp target parallel defaultmap(tofrom:scalar) defaultmap(to:scalar) // expected-error {{at most one defaultmap clause for each variable-category can appear on the directive}}
foo();
- #pragma omp target parallel defaultmap (tofrom, scalar // expected-error {{expected ')'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
+ #pragma omp target parallel defaultmap(alloc:pointer) defaultmap(to:scalar) defaultmap(firstprivate:pointer) // expected-error {{at most one defaultmap clause for each variable-category can appear on the directive}}
foo();
+ #pragma omp target parallel defaultmap(none:pointer) // expected-note {{explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here}}
+ g++; // expected-error {{variable 'g' must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause}}
+ #pragma omp target parallel defaultmap(none:pointer) defaultmap(none:scalar) map(argc) // expected-note {{explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here}}
+ argc = *g; // expected-error {{variable 'g' must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause}}
+ #pragma omp target parallel defaultmap(none:pointer) defaultmap(none:scalar) map(g) // expected-note {{explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here}}
+ argc = *g; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause}}
+ #pragma omp target parallel defaultmap(none:pointer) defaultmap(none:scalar) defaultmap(none:aggregate) map(g) firstprivate(argc) // expected-note {{explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here}}
+ argc = *g + arr[1]; // expected-error {{variable 'arr' must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause}}
+ #pragma omp target parallel defaultmap(none:aggregate) defaultmap(none:scalar) map(argc) // expected-note {{explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here}}
+ bar.a += argc; // expected-error {{variable 'bar' must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause}}
+ #pragma omp target parallel defaultmap(none:aggregate) defaultmap(none:scalar) map(argc) // expected-note {{explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here}}
+ baz.bar.a += argc; // expected-error {{variable 'baz' must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause}}
+ int vla[argc];
+ #pragma omp target parallel defaultmap(none:aggregate) defaultmap(none:scalar) map(argc) // expected-note {{explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here}}
+ vla[argc-1] += argc; // expected-error {{variable 'vla' must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause}}
- return tmain<int, char, 1, 0>(argc, argv);
+ #pragma omp target defaultmap(none:aggregate) // expected-note {{explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here}}
+ #pragma omp parallel
+ baz.bar.a += argc; // expected-error {{variable 'baz' must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause}}
+
+ #pragma omp parallel
+ #pragma omp target defaultmap(none:aggregate) // expected-note {{explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here}}
+ #pragma omp parallel
+ baz.bar.a += argc; // expected-error {{variable 'baz' must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause}}
+
+ #pragma omp parallel
+ #pragma omp target parallel defaultmap(none:aggregate) // expected-note {{explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here}}
+ #pragma omp parallel
+ *baz.p += argc; // expected-error {{variable 'baz' must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause}}
+
+ #pragma omp parallel
+ #pragma omp target defaultmap(none:pointer) // expected-note {{explicit data sharing attribute, data mapping attribute, or is_device_ptr clause requested here}}
+ #pragma omp parallel
+ bazPtr->p += argc; // expected-error {{variable 'bazPtr' must have explicitly specified data sharing attributes, data mapping attributes, or in an is_device_ptr clause}}
+#endif
+
+ return tmain<int, char, 1, 0>(argc, argv); // omp5-note {{in instantiation of function template specialization 'tmain<int, char, 1, 0>' requested here}}
}
-
diff --git a/src/llvm-project/clang/test/OpenMP/target_parallel_depend_codegen.cpp b/src/llvm-project/clang/test/OpenMP/target_parallel_depend_codegen.cpp
index 95939de..dceb585 100644
--- a/src/llvm-project/clang/test/OpenMP/target_parallel_depend_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_parallel_depend_codegen.cpp
@@ -40,13 +40,9 @@
// CHECK-DAG: [[TT:%.+]] = type { i64, i8 }
// CHECK-DAG: [[ENTTY:%.+]] = type { i8*, i8*, i[[SZ:32|64]], i32, i32 }
-// CHECK-DAG: [[DEVTY:%.+]] = type { i8*, i8*, [[ENTTY]]*, [[ENTTY]]* }
-// CHECK-DAG: [[DSCTY:%.+]] = type { i32, [[DEVTY]]*, [[ENTTY]]*, [[ENTTY]]* }
// TCHECK: [[ENTTY:%.+]] = type { i8*, i8*, i{{32|64}}, i32, i32 }
-// CHECK-DAG: $[[REGFN:\.omp_offloading\..+]] = comdat
-
// CHECK-DAG: [[SIZET:@.+]] = private unnamed_addr constant [2 x i64] [i64 0, i64 4]
// CHECK-DAG: [[MAPT:@.+]] = private unnamed_addr constant [2 x i64] [i64 544, i64 800]
// CHECK-DAG: @{{.*}} = weak constant i8 0
@@ -55,16 +51,8 @@
// TCHECK: @{{.+}} = {{.*}}constant [[ENTTY]]
// TCHECK-NOT: @{{.+}} = weak constant [[ENTTY]]
-// Check if offloading descriptor is created.
-// CHECK: [[ENTBEGIN:@.+]] = external constant [[ENTTY]]
-// CHECK: [[ENTEND:@.+]] = external constant [[ENTTY]]
-// CHECK: [[DEVBEGIN:@.+]] = extern_weak constant i8
-// CHECK: [[DEVEND:@.+]] = extern_weak constant i8
-// CHECK: [[IMAGES:@.+]] = internal unnamed_addr constant [1 x [[DEVTY]]] [{{.+}} { i8* [[DEVBEGIN]], i8* [[DEVEND]], [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }], comdat($[[REGFN]])
-// CHECK: [[DESC:@.+]] = internal constant [[DSCTY]] { i32 1, [[DEVTY]]* getelementptr inbounds ([1 x [[DEVTY]]], [1 x [[DEVTY]]]* [[IMAGES]], i32 0, i32 0), [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }, comdat($[[REGFN]])
-
// Check target registration is registered as a Ctor.
-// CHECK: appending global [2 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }, { i32, void ()*, i8* } { i32 0, void ()* @[[REGFN]], i8* bitcast (void ()* @[[REGFN]] to i8*) }]
+// CHECK: appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }]
template<typename tx, typename ty>
@@ -193,7 +181,7 @@
// CHECK: define internal void [[HVT0:@.+]]()
-// CHECK: define internal{{.*}} i32 [[TASK_ENTRY0]](i32{{.*}}, [[TASK_TY0]]* noalias)
+// CHECK: define internal{{.*}} i32 [[TASK_ENTRY0]](i32{{.*}}, [[TASK_TY0]]* noalias %1)
// CHECK: store void (i8*, ...)* null, void (i8*, ...)** %
// CHECK: [[DEVICE_CAP:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 0
// CHECK: [[DEV:%.+]] = load i32, i32* [[DEVICE_CAP]],
@@ -209,7 +197,7 @@
// CHECK: define internal void [[HVT1:@.+]](i[[SZ]]* %{{.+}}, i[[SZ]] %{{.+}})
-// CHECK: define internal{{.*}} i32 [[TASK_ENTRY1_]](i32{{.*}}, [[TASK_TY1_]]* noalias)
+// CHECK: define internal{{.*}} i32 [[TASK_ENTRY1_]](i32{{.*}}, [[TASK_TY1_]]* noalias %1)
// CHECK: call void (i8*, ...) %
// CHECK: [[SZT:%.+]] = getelementptr inbounds [2 x i64], [2 x i64]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0
// CHECK: [[DEVICE_CAP:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 2
@@ -231,7 +219,7 @@
// CHECK: [[END]]
// CHECK: ret i32 0
-// CHECK: define internal{{.*}} i32 [[TASK_ENTRY1__]](i32{{.*}}, [[TASK_TY1__]]* noalias)
+// CHECK: define internal{{.*}} i32 [[TASK_ENTRY1__]](i32{{.*}}, [[TASK_TY1__]]* noalias %1)
// CHECK: call void (i8*, ...) %
// CHECK: [[DEVICE_CAP:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 2
// CHECK: [[BP0:%.+]] = load i[[SZ]]*, i[[SZ]]** %
@@ -251,7 +239,7 @@
// CHECK-64: load i32, i32* [[AA_CADDR]], align
// CHECK-32: load i32, i32* [[AA_ADDR]], align
-// CHECK: define internal{{.*}} i32 [[TASK_ENTRY2]](i32{{.*}}, [[TASK_TY2]]* noalias)
+// CHECK: define internal{{.*}} i32 [[TASK_ENTRY2]](i32{{.*}}, [[TASK_TY2]]* noalias %1)
// CHECK: call void (i8*, ...) %
// CHECK: [[BP1_I32:%.+]] = load i32, i32* %
// CHECK-64: [[BP1_CAST:%.+]] = bitcast i[[SZ]]* [[BP1_PTR:%.+]] to i32*
diff --git a/src/llvm-project/clang/test/OpenMP/target_parallel_depend_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_parallel_depend_messages.cpp
index 61557bd..1044a2b 100644
--- a/src/llvm-project/clang/test/OpenMP/target_parallel_depend_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_parallel_depend_messages.cpp
@@ -68,7 +68,7 @@
foo();
#pragma omp target parallel depend (in : argv[0:-1]) // expected-error {{section length is evaluated to a negative value -1}}
foo();
- #pragma omp target parallel depend (in : argv[-1:0])
+ #pragma omp target parallel depend (in : argv[-1:0]) // expected-error {{zero-length array section is not allowed in 'depend' clause}}
foo();
#pragma omp target parallel depend (in : argv[:]) // expected-error {{section length is unspecified and cannot be inferred because subscripted value is not an array}}
foo();
diff --git a/src/llvm-project/clang/test/OpenMP/target_parallel_firstprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_parallel_firstprivate_messages.cpp
index 075beae..11be23c 100644
--- a/src/llvm-project/clang/test/OpenMP/target_parallel_firstprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_parallel_firstprivate_messages.cpp
@@ -19,6 +19,13 @@
return argc;
}
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp target parallel firstprivate(fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
struct S1; // expected-note {{declared here}} expected-note{{forward declaration of 'S1'}}
extern S1 a;
class S2 {
diff --git a/src/llvm-project/clang/test/OpenMP/target_parallel_for_ast_print.cpp b/src/llvm-project/clang/test/OpenMP/target_parallel_for_ast_print.cpp
index 80c20ba..39fcfc8 100644
--- a/src/llvm-project/clang/test/OpenMP/target_parallel_for_ast_print.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_parallel_for_ast_print.cpp
@@ -1,10 +1,10 @@
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ast-print %s -Wno-openmp-target | FileCheck %s
-// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ast-print %s -Wno-openmp-mapping | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ast-print %s -Wno-openmp-target | FileCheck %s
-// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ast-print %s -Wno-openmp-mapping | FileCheck %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s
// expected-no-diagnostics
#ifndef HEADER
diff --git a/src/llvm-project/clang/test/OpenMP/target_parallel_for_codegen.cpp b/src/llvm-project/clang/test/OpenMP/target_parallel_for_codegen.cpp
index 66d2a23..e859053 100644
--- a/src/llvm-project/clang/test/OpenMP/target_parallel_for_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_parallel_for_codegen.cpp
@@ -45,13 +45,9 @@
// CHECK-DAG: [[TT:%.+]] = type { i64, i8 }
// CHECK-DAG: [[S1:%.+]] = type { double }
// CHECK-DAG: [[ENTTY:%.+]] = type { i8*, i8*, i[[SZ:32|64]], i32, i32 }
-// CHECK-DAG: [[DEVTY:%.+]] = type { i8*, i8*, [[ENTTY]]*, [[ENTTY]]* }
-// CHECK-DAG: [[DSCTY:%.+]] = type { i32, [[DEVTY]]*, [[ENTTY]]*, [[ENTTY]]* }
// TCHECK: [[ENTTY:%.+]] = type { i8*, i8*, i{{32|64}}, i32, i32 }
-// CHECK-DAG: $[[REGFN:\.omp_offloading\..+]] = comdat
-
// We have 8 target regions, but only 7 that actually will generate offloading
// code, only 6 will have mapped arguments, and only 4 have all-constant map
// sizes.
@@ -83,16 +79,8 @@
// TCHECK: @{{.+}} = weak constant [[ENTTY]]
// TCHECK-NOT: @{{.+}} = weak constant [[ENTTY]]
-// Check if offloading descriptor is created.
-// CHECK: [[ENTBEGIN:@.+]] = external constant [[ENTTY]]
-// CHECK: [[ENTEND:@.+]] = external constant [[ENTTY]]
-// CHECK: [[DEVBEGIN:@.+]] = extern_weak constant i8
-// CHECK: [[DEVEND:@.+]] = extern_weak constant i8
-// CHECK: [[IMAGES:@.+]] = internal unnamed_addr constant [1 x [[DEVTY]]] [{{.+}} { i8* [[DEVBEGIN]], i8* [[DEVEND]], [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }], comdat($[[REGFN]])
-// CHECK: [[DESC:@.+]] = internal constant [[DSCTY]] { i32 1, [[DEVTY]]* getelementptr inbounds ([1 x [[DEVTY]]], [1 x [[DEVTY]]]* [[IMAGES]], i32 0, i32 0), [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }, comdat($[[REGFN]])
-
// Check target registration is registered as a Ctor.
-// CHECK: appending global [2 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }, { i32, void ()*, i8* } { i32 0, void ()* @[[REGFN]], i8* bitcast (void ()* @[[REGFN]] to i8*) }]
+// CHECK: appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }]
template<typename tx, typename ty>
diff --git a/src/llvm-project/clang/test/OpenMP/target_parallel_for_codegen_registration.cpp b/src/llvm-project/clang/test/OpenMP/target_parallel_for_codegen_registration.cpp
index 9cc8e39..de44331 100644
--- a/src/llvm-project/clang/test/OpenMP/target_parallel_for_codegen_registration.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_parallel_for_codegen_registration.cpp
@@ -52,13 +52,9 @@
// CHECK-DAG: [[ST1:%.+]] = type { [228 x i32] }
// CHECK-DAG: [[ST2:%.+]] = type { [1128 x i32] }
// CHECK-DAG: [[ENTTY:%.+]] = type { i8*, i8*, i[[SZ:32|64]], i32, i32 }
-// CHECK-DAG: [[DEVTY:%.+]] = type { i8*, i8*, [[ENTTY]]*, [[ENTTY]]* }
-// CHECK-DAG: [[DSCTY:%.+]] = type { i32, [[DEVTY]]*, [[ENTTY]]*, [[ENTTY]]* }
// TCHECK: [[ENTTY:%.+]] = type { i8*, i8*, i[[SZ:32|64]], i32, i32 }
-// CHECK-DAG: $[[REGFN:\.omp_offloading\..+]] = comdat
-
// CHECK-DAG: [[A1:@.+]] = internal global [[SA]]
// CHECK-DAG: [[A2:@.+]] = global [[SA]]
// CHECK-DAG: [[B1:@.+]] = global [[SB]]
@@ -123,68 +119,60 @@
// CHECK-NTARGET-NOT: private unnamed_addr constant [1 x i
// CHECK-DAG: [[NAMEPTR1:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME1:__omp_offloading_[0-9a-f]+_[0-9a-f]+__Z.+_l[0-9]+]]\00"
-// CHECK-DAG: [[ENTRY1:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR1]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY1:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR1]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR2:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME2:.+]]\00"
-// CHECK-DAG: [[ENTRY2:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR2]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY2:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR2]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR3:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME3:.+]]\00"
-// CHECK-DAG: [[ENTRY3:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR3]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY3:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR3]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR4:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME4:.+]]\00"
-// CHECK-DAG: [[ENTRY4:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR4]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY4:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR4]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR5:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME5:.+]]\00"
-// CHECK-DAG: [[ENTRY5:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR5]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY5:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR5]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR6:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME6:.+]]\00"
-// CHECK-DAG: [[ENTRY6:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR6]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY6:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR6]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR7:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME7:.+]]\00"
-// CHECK-DAG: [[ENTRY7:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR7]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY7:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR7]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR8:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME8:.+]]\00"
-// CHECK-DAG: [[ENTRY8:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR8]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY8:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR8]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR9:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME9:.+]]\00"
-// CHECK-DAG: [[ENTRY9:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR9]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY9:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR9]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR10:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME10:.+]]\00"
-// CHECK-DAG: [[ENTRY10:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR10]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY10:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR10]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR11:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME11:.+]]\00"
-// CHECK-DAG: [[ENTRY11:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR11]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY11:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR11]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR12:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME12:.+]]\00"
-// CHECK-DAG: [[ENTRY12:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR12]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY12:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR12]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR1:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME1:__omp_offloading_[0-9a-f]+_[0-9a-f]+__Z.+_l[0-9]+]]\00"
-// TCHECK-DAG: [[ENTRY1:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR1]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY1:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR1]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR2:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME2:.+]]\00"
-// TCHECK-DAG: [[ENTRY2:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR2]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY2:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR2]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR3:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME3:.+]]\00"
-// TCHECK-DAG: [[ENTRY3:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR3]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY3:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR3]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR4:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME4:.+]]\00"
-// TCHECK-DAG: [[ENTRY4:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR4]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY4:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR4]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR5:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME5:.+]]\00"
-// TCHECK-DAG: [[ENTRY5:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR5]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY5:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR5]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR6:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME6:.+]]\00"
-// TCHECK-DAG: [[ENTRY6:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR6]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY6:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR6]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR7:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME7:.+]]\00"
-// TCHECK-DAG: [[ENTRY7:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR7]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY7:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR7]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR8:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME8:.+]]\00"
-// TCHECK-DAG: [[ENTRY8:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR8]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY8:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR8]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR9:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME9:.+]]\00"
-// TCHECK-DAG: [[ENTRY9:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR9]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY9:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR9]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR10:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME10:.+]]\00"
-// TCHECK-DAG: [[ENTRY10:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR10]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY10:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR10]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR11:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME11:.+]]\00"
-// TCHECK-DAG: [[ENTRY11:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR11]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY11:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR11]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR12:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME12:.+]]\00"
-// TCHECK-DAG: [[ENTRY12:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR12]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
-
-// CHECK: [[ENTBEGIN:@.+]] = external constant [[ENTTY]]
-// CHECK: [[ENTEND:@.+]] = external constant [[ENTTY]]
-// CHECK: [[DEVBEGIN:@.+]] = extern_weak constant i8
-// CHECK: [[DEVEND:@.+]] = extern_weak constant i8
-// CHECK: [[IMAGES:@.+]] = internal unnamed_addr constant [1 x [[DEVTY]]] [{{.+}} { i8* [[DEVBEGIN]], i8* [[DEVEND]], [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }], comdat($[[REGFN]])
-// CHECK: [[DESC:@.+]] = internal constant [[DSCTY]] { i32 1, [[DEVTY]]* getelementptr inbounds ([1 x [[DEVTY]]], [1 x [[DEVTY]]]* [[IMAGES]], i32 0, i32 0), [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }, comdat($[[REGFN]])
+// TCHECK-DAG: [[ENTRY12:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR12]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// We have 4 initializers, one for the 500 priority, another one for 501, or more for the default priority, and the last one for the offloading registration function.
-// CHECK: @llvm.global_ctors = appending global [5 x { i32, void ()*, i8* }] [
+// CHECK: @llvm.global_ctors = appending global [4 x { i32, void ()*, i8* }] [
// CHECK-SAME: { i32, void ()*, i8* } { i32 500, void ()* [[P500:@[^,]+]], i8* null },
// CHECK-SAME: { i32, void ()*, i8* } { i32 501, void ()* [[P501:@[^,]+]], i8* null },
// CHECK-SAME: { i32, void ()*, i8* } { i32 65535, void ()* [[PMAX:@[^,]+]], i8* null },
-// CHECK-SAME: { i32, void ()*, i8* } { i32 0, void ()* @[[REGFN]], i8* bitcast (void ()* @[[REGFN]] to i8*) }]
// CHECK-NTARGET: @llvm.global_ctors = appending global [3 x { i32, void ()*, i8* }] [
@@ -363,12 +351,8 @@
//TCHECK-DAG: define weak void @[[NAME12]](
// CHECK-NTARGET-NOT: __tgt_target
-// CHECK-NTARGET-NOT: __tgt_register_lib
-// CHECK-NTARGET-NOT: __tgt_unregister_lib
// TCHECK-NOT: __tgt_target
-// TCHECK-NOT: __tgt_register_lib
-// TCHECK-NOT: __tgt_unregister_lib
// We have 2 initializers with priority 500
//CHECK: define internal void [[P500]](
@@ -394,25 +378,6 @@
//CHECK-NOT: call void @{{.+}}()
//CHECK: ret void
-// Check registration and unregistration
-
-//CHECK: define internal void @.omp_offloading.requires_reg()
-//CHECK: call void @__tgt_register_requires(i64 1)
-//CHECK: ret void
-
-//CHECK: define internal void @[[UNREGFN:.+]](i8*)
-//CHECK-SAME: comdat($[[REGFN]]) {
-//CHECK: call i32 @__tgt_unregister_lib([[DSCTY]]* [[DESC]])
-//CHECK: ret void
-//CHECK: declare i32 @__tgt_unregister_lib([[DSCTY]]*)
-
-//CHECK: define linkonce hidden void @[[REGFN]]()
-//CHECK-SAME: comdat {
-//CHECK: call i32 @__tgt_register_lib([[DSCTY]]* [[DESC]])
-//CHECK: call i32 @__cxa_atexit(void (i8*)* @[[UNREGFN]], i8* bitcast ([[DSCTY]]* [[DESC]] to i8*),
-//CHECK: ret void
-//CHECK: declare i32 @__tgt_register_lib([[DSCTY]]*)
-
static __attribute__((init_priority(500))) SA a1;
SA a2;
SB __attribute__((init_priority(500))) b1;
@@ -446,31 +411,31 @@
// Check metadata is properly generated:
// CHECK: !omp_offload.info = !{!{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID:-?[0-9]+]], i32 [[FILEID:-?[0-9]+]], !"_ZN2SB3fooEv", i32 216, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SDD1Ev", i32 268, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SEC1Ev", i32 286, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SED1Ev", i32 293, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EE3fooEv", i32 305, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EEC1Ev", i32 312, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_Z3bari", i32 440, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EED1Ev", i32 319, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EEC1Ev", i32 312, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EED1Ev", i32 319, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EE3fooEv", i32 305, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SCC1Ev", i32 242, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID:-?[0-9]+]], i32 [[FILEID:-?[0-9]+]], !"_ZN2SB3fooEv", i32 204, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SDD1Ev", i32 256, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SEC1Ev", i32 274, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SED1Ev", i32 281, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EE3fooEv", i32 293, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EEC1Ev", i32 300, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_Z3bari", i32 405, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EED1Ev", i32 307, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EEC1Ev", i32 300, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EED1Ev", i32 307, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EE3fooEv", i32 293, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SCC1Ev", i32 230, i32 {{[0-9]+}}}
// TCHECK: !omp_offload.info = !{!{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID:-?[0-9]+]], i32 [[FILEID:-?[0-9]+]], !"_ZN2SB3fooEv", i32 216, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SDD1Ev", i32 268, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SEC1Ev", i32 286, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SED1Ev", i32 293, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EE3fooEv", i32 305, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EEC1Ev", i32 312, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_Z3bari", i32 440, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EED1Ev", i32 319, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EEC1Ev", i32 312, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EED1Ev", i32 319, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EE3fooEv", i32 305, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SCC1Ev", i32 242, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID:-?[0-9]+]], i32 [[FILEID:-?[0-9]+]], !"_ZN2SB3fooEv", i32 204, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SDD1Ev", i32 256, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SEC1Ev", i32 274, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SED1Ev", i32 281, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EE3fooEv", i32 293, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EEC1Ev", i32 300, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_Z3bari", i32 405, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EED1Ev", i32 307, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EEC1Ev", i32 300, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EED1Ev", i32 307, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EE3fooEv", i32 293, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SCC1Ev", i32 230, i32 {{[0-9]+}}}
#endif
diff --git a/src/llvm-project/clang/test/OpenMP/target_parallel_for_defaultmap_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_parallel_for_defaultmap_messages.cpp
index bdcc768..877b4da 100644
--- a/src/llvm-project/clang/test/OpenMP/target_parallel_for_defaultmap_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_parallel_for_defaultmap_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 %s -verify=expected,omp5 -Wuninitialized -DOMP5
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 %s -verify=expected,omp5 -Wuninitialized -DOMP5
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 %s -verify=expected,omp45 -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 %s -verify=expected,omp45 -Wuninitialized
void foo() {
}
@@ -10,23 +12,23 @@
int i;
#pragma omp target parallel for defaultmap // expected-error {{expected '(' after 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for defaultmap ( // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ #pragma omp target parallel for defaultmap ( // omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for defaultmap () // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
+ #pragma omp target parallel for defaultmap () // omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for defaultmap (tofrom // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+ #pragma omp target parallel for defaultmap (tofrom // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for defaultmap (tofrom: // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+ #pragma omp target parallel for defaultmap (tofrom: // expected-error {{expected ')'}} expected-note {{to match this '('}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for defaultmap (tofrom) // expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+ #pragma omp target parallel for defaultmap (tofrom) // expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for defaultmap (tofrom scalar) // expected-warning {{missing ':' after defaultmap modifier - ignoring}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for defaultmap (tofrom, // expected-error {{expected ')'}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-note {{to match this '('}}
+ #pragma omp target parallel for defaultmap (tofrom, // expected-error {{expected ')'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-note {{to match this '('}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for defaultmap (scalar: // expected-error {{expected ')'}} expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
+ #pragma omp target parallel for defaultmap (scalar: // expected-error {{expected ')'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for defaultmap (tofrom, scalar // expected-error {{expected ')'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
+ #pragma omp target parallel for defaultmap (tofrom, scalar // expected-error {{expected ')'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
return argc;
@@ -36,25 +38,24 @@
int i;
#pragma omp target parallel for defaultmap // expected-error {{expected '(' after 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for defaultmap ( // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ #pragma omp target parallel for defaultmap ( // omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for defaultmap () // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
+ #pragma omp target parallel for defaultmap () // omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for defaultmap (tofrom // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+ #pragma omp target parallel for defaultmap (tofrom // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for defaultmap (tofrom: // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+ #pragma omp target parallel for defaultmap (tofrom: // expected-error {{expected ')'}} expected-note {{to match this '('}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for defaultmap (tofrom) // expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+ #pragma omp target parallel for defaultmap (tofrom) // expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for defaultmap (tofrom scalar) // expected-warning {{missing ':' after defaultmap modifier - ignoring}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for defaultmap (tofrom, // expected-error {{expected ')'}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-note {{to match this '('}}
+ #pragma omp target parallel for defaultmap (tofrom, // expected-error {{expected ')'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-note {{to match this '('}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for defaultmap (scalar: // expected-error {{expected ')'}} expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
+ #pragma omp target parallel for defaultmap (scalar: // omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for defaultmap (tofrom, scalar // expected-error {{expected ')'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
+ #pragma omp target parallel for defaultmap (tofrom, scalar // expected-error {{expected ')'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
return tmain<int, char, 1, 0>(argc, argv);
}
-
diff --git a/src/llvm-project/clang/test/OpenMP/target_parallel_for_depend_codegen.cpp b/src/llvm-project/clang/test/OpenMP/target_parallel_for_depend_codegen.cpp
index 9994ebe..6b23255 100644
--- a/src/llvm-project/clang/test/OpenMP/target_parallel_for_depend_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_parallel_for_depend_codegen.cpp
@@ -40,13 +40,9 @@
// CHECK-DAG: [[TT:%.+]] = type { i64, i8 }
// CHECK-DAG: [[ENTTY:%.+]] = type { i8*, i8*, i[[SZ:32|64]], i32, i32 }
-// CHECK-DAG: [[DEVTY:%.+]] = type { i8*, i8*, [[ENTTY]]*, [[ENTTY]]* }
-// CHECK-DAG: [[DSCTY:%.+]] = type { i32, [[DEVTY]]*, [[ENTTY]]*, [[ENTTY]]* }
// TCHECK: [[ENTTY:%.+]] = type { i8*, i8*, i{{32|64}}, i32, i32 }
-// CHECK-DAG: $[[REGFN:\.omp_offloading\..+]] = comdat
-
// CHECK-DAG: [[SIZET:@.+]] = private unnamed_addr constant [2 x i64] [i64 0, i64 4]
// CHECK-DAG: [[MAPT:@.+]] = private unnamed_addr constant [2 x i64] [i64 544, i64 800]
// CHECK-DAG: @{{.*}} = weak constant i8 0
@@ -55,16 +51,8 @@
// TCHECK: @{{.+}} = {{.*}}constant [[ENTTY]]
// TCHECK-NOT: @{{.+}} = weak constant [[ENTTY]]
-// Check if offloading descriptor is created.
-// CHECK: [[ENTBEGIN:@.+]] = external constant [[ENTTY]]
-// CHECK: [[ENTEND:@.+]] = external constant [[ENTTY]]
-// CHECK: [[DEVBEGIN:@.+]] = extern_weak constant i8
-// CHECK: [[DEVEND:@.+]] = extern_weak constant i8
-// CHECK: [[IMAGES:@.+]] = internal unnamed_addr constant [1 x [[DEVTY]]] [{{.+}} { i8* [[DEVBEGIN]], i8* [[DEVEND]], [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }], comdat($[[REGFN]])
-// CHECK: [[DESC:@.+]] = internal constant [[DSCTY]] { i32 1, [[DEVTY]]* getelementptr inbounds ([1 x [[DEVTY]]], [1 x [[DEVTY]]]* [[IMAGES]], i32 0, i32 0), [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }, comdat($[[REGFN]])
-
// Check target registration is registered as a Ctor.
-// CHECK: appending global [2 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }, { i32, void ()*, i8* } { i32 0, void ()* @[[REGFN]], i8* bitcast (void ()* @[[REGFN]] to i8*) }]
+// CHECK: appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }]
template<typename tx, typename ty>
@@ -193,7 +181,7 @@
// CHECK: define internal void [[HVT0:@.+]]()
-// CHECK: define internal{{.*}} i32 [[TASK_ENTRY0]](i32{{.*}}, [[TASK_TY0]]* noalias)
+// CHECK: define internal{{.*}} i32 [[TASK_ENTRY0]](i32{{.*}}, [[TASK_TY0]]* noalias %1)
// CHECK: store void (i8*, ...)* null, void (i8*, ...)** %
// CHECK: [[DEVICE_CAP:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 0
// CHECK: [[DEV:%.+]] = load i32, i32* [[DEVICE_CAP]],
@@ -209,7 +197,7 @@
// CHECK: define internal void [[HVT1:@.+]](i[[SZ]]* %{{.+}}, i[[SZ]] %{{.+}})
-// CHECK: define internal{{.*}} i32 [[TASK_ENTRY1_]](i32{{.*}}, [[TASK_TY1_]]* noalias)
+// CHECK: define internal{{.*}} i32 [[TASK_ENTRY1_]](i32{{.*}}, [[TASK_TY1_]]* noalias %1)
// CHECK: call void (i8*, ...) %
// CHECK: [[SZT:%.+]] = getelementptr inbounds [2 x i64], [2 x i64]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0
// CHECK: [[DEVICE_CAP:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 2
@@ -231,7 +219,7 @@
// CHECK: [[END]]
// CHECK: ret i32 0
-// CHECK: define internal{{.*}} i32 [[TASK_ENTRY1__]](i32{{.*}}, [[TASK_TY1__]]* noalias)
+// CHECK: define internal{{.*}} i32 [[TASK_ENTRY1__]](i32{{.*}}, [[TASK_TY1__]]* noalias %1)
// CHECK: call void (i8*, ...) %
// CHECK: [[DEVICE_CAP:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 2
// CHECK: [[BP0:%.+]] = load i[[SZ]]*, i[[SZ]]** %
@@ -251,7 +239,7 @@
// CHECK-64: load i32, i32* [[AA_CADDR]], align
// CHECK-32: load i32, i32* [[AA_ADDR]], align
-// CHECK: define internal{{.*}} i32 [[TASK_ENTRY2]](i32{{.*}}, [[TASK_TY2]]* noalias)
+// CHECK: define internal{{.*}} i32 [[TASK_ENTRY2]](i32{{.*}}, [[TASK_TY2]]* noalias %1)
// CHECK: call void (i8*, ...) %
// CHECK: [[BP1_I32:%.+]] = load i32, i32* %
// CHECK-64: [[BP1_CAST:%.+]] = bitcast i[[SZ]]* [[BP1_PTR:%.+]] to i32*
diff --git a/src/llvm-project/clang/test/OpenMP/target_parallel_for_depend_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_parallel_for_depend_messages.cpp
index f620691..889c491 100644
--- a/src/llvm-project/clang/test/OpenMP/target_parallel_for_depend_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_parallel_for_depend_messages.cpp
@@ -69,7 +69,7 @@
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for depend (in : argv[0:-1]) // expected-error {{section length is evaluated to a negative value -1}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for depend (in : argv[-1:0])
+ #pragma omp target parallel for depend (in : argv[-1:0]) // expected-error {{zero-length array section is not allowed in 'depend' clause}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for depend (in : argv[:]) // expected-error {{section length is unspecified and cannot be inferred because subscripted value is not an array}}
for (i = 0; i < argc; ++i) foo();
diff --git a/src/llvm-project/clang/test/OpenMP/target_parallel_for_firstprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_parallel_for_firstprivate_messages.cpp
index d90c024..0a103ed 100644
--- a/src/llvm-project/clang/test/OpenMP/target_parallel_for_firstprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_parallel_for_firstprivate_messages.cpp
@@ -19,6 +19,13 @@
return argc;
}
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp target parallel for firstprivate(fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
struct S1; // expected-note 2 {{declared here}} expected-note 2 {{forward declaration of 'S1'}}
extern S1 a;
class S2 {
diff --git a/src/llvm-project/clang/test/OpenMP/target_parallel_for_if_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_parallel_for_if_messages.cpp
index a5a181b..99bb13d 100644
--- a/src/llvm-project/clang/test/OpenMP/target_parallel_for_if_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_parallel_for_if_messages.cpp
@@ -60,7 +60,7 @@
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for if(parallel : argc) if (parallel :argc) // expected-error {{directive '#pragma omp target parallel for' cannot contain more than one 'if' clause with 'parallel' name modifier}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for if(target : argc) if (argc) // expected-error {{expected 'parallel' directive name modifier}} expected-note {{previous clause with directive name modifier specified here}}
+ #pragma omp target parallel for if(target : argc) if (argc) // expected-error {{expected 'parallel' directive name modifier}} expected-note {{previous clause with directive name modifier specified here}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for if(target : argc) if(parallel : argc) if (argc) // expected-error {{no more 'if' clause is allowed}} expected-note {{previous clause with directive name modifier specified here}} expected-note {{previous clause with directive name modifier specified here}}
for (i = 0; i < argc; ++i) foo();
@@ -106,7 +106,7 @@
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for if(parallel : argc) if (parallel :argc) // expected-error {{directive '#pragma omp target parallel for' cannot contain more than one 'if' clause with 'parallel' name modifier}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for if(target : argc) if (argc) // expected-error {{expected 'parallel' directive name modifier}} expected-note {{previous clause with directive name modifier specified here}}
+ #pragma omp target parallel for if(target : argc) if (argc) // expected-error {{expected 'parallel' directive name modifier}} expected-note {{previous clause with directive name modifier specified here}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for if(target : argc) if(parallel : argc) if (argc) // expected-error {{no more 'if' clause is allowed}} expected-note {{previous clause with directive name modifier specified here}} expected-note {{previous clause with directive name modifier specified here}}
for (i = 0; i < argc; ++i) foo();
diff --git a/src/llvm-project/clang/test/OpenMP/target_parallel_for_lastprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_parallel_for_lastprivate_messages.cpp
index 906b592..23ee0a6 100644
--- a/src/llvm-project/clang/test/OpenMP/target_parallel_for_lastprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_parallel_for_lastprivate_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
@@ -80,6 +82,7 @@
I g(5);
int i;
int &j = i;
+ S6 s(0); // omp50-note {{'s' defined here}}
#pragma omp target parallel for lastprivate // expected-error {{expected '(' after 'lastprivate'}}
for (int k = 0; k < argc; ++k)
++k;
@@ -101,6 +104,12 @@
#pragma omp target parallel for lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
for (int k = 0; k < argc; ++k)
++k;
+#pragma omp target parallel for lastprivate(conditional: s,argc) lastprivate(conditional: // omp50-error {{expected expression}} omp45-error 2 {{use of undeclared identifier 'conditional'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected list item of scalar type in 'lastprivate' clause with 'conditional' modifier}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp target parallel for lastprivate(foo:argc) // omp50-error {{expected 'conditional' in OpenMP clause 'lastprivate'}} omp45-error {{expected ',' or ')' in 'lastprivate' clause}} omp45-error {{expected ')'}} omp45-error {{expected variable name}} omp45-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
#pragma omp target parallel for lastprivate(S1) // expected-error {{'S1' does not refer to a value}}
for (int k = 0; k < argc; ++k)
++k;
diff --git a/src/llvm-project/clang/test/OpenMP/target_parallel_for_linear_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_parallel_for_linear_messages.cpp
index f5af0ed..adb6c78 100644
--- a/src/llvm-project/clang/test/OpenMP/target_parallel_for_linear_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_parallel_for_linear_messages.cpp
@@ -12,6 +12,13 @@
extern const omp_allocator_handle_t omp_pteam_mem_alloc;
extern const omp_allocator_handle_t omp_thread_mem_alloc;
+void xxx(int argc) {
+ int i, lin, step; // expected-note {{initialize the variable 'lin' to silence this warning}} expected-note {{initialize the variable 'step' to silence this warning}}
+#pragma omp target parallel for linear(lin : step) // expected-warning {{variable 'lin' is uninitialized when used here}} expected-warning {{variable 'step' is uninitialized when used here}}
+ for (i = 0; i < 10; ++i)
+ ;
+}
+
namespace X {
int x;
};
diff --git a/src/llvm-project/clang/test/OpenMP/target_parallel_for_loop_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_parallel_for_loop_messages.cpp
index e81d3b2..671f116 100644
--- a/src/llvm-project/clang/test/OpenMP/target_parallel_for_loop_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_parallel_for_loop_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wno-openmp-mapping -Wuninitialized
class S {
int a;
@@ -92,28 +94,28 @@
for (((ii)) = 0; ii < 10; ++ii)
c[ii] = a[ii];
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
#pragma omp target parallel for
for (int i = 0; i; i++)
c[i] = a[i];
-// expected-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'i'}}
#pragma omp target parallel for
for (int i = 0; jj < kk; ii++)
c[i] = a[i];
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
#pragma omp target parallel for
for (int i = 0; !!i; i++)
c[i] = a[i];
-// Ok
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
#pragma omp target parallel for
for (int i = 0; i != 1; i++)
c[i] = a[i];
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
#pragma omp target parallel for
for (int i = 0;; i++)
c[i] = a[i];
@@ -279,7 +281,7 @@
c[globalii] += a[globalii] + ii;
}
-// expected-error@+2 {{statement after '#pragma omp target parallel for' must be a for loop}}
+// omp4-error@+2 {{statement after '#pragma omp target parallel for' must be a for loop}}
#pragma omp target parallel for
for (auto &item : a) {
item = item + 1;
@@ -416,15 +418,15 @@
#pragma omp target parallel for
for (begin = end; begin < end; ++begin)
++begin;
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
#pragma omp target parallel for
for (GoodIter I = begin; I - I; ++I)
++I;
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
#pragma omp target parallel for
for (GoodIter I = begin; begin < end; ++I)
++I;
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
#pragma omp target parallel for
for (GoodIter I = begin; !I; ++I)
++I;
diff --git a/src/llvm-project/clang/test/OpenMP/target_parallel_for_map_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_parallel_for_map_messages.cpp
index 0f02350..9269e7f 100644
--- a/src/llvm-project/clang/test/OpenMP/target_parallel_for_map_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_parallel_for_map_messages.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wno-openmp-mapping -Wuninitialized
void foo() {
}
@@ -9,6 +9,13 @@
return argc;
}
+void xxx(int argc) {
+ int map; // expected-note {{initialize the variable 'map' to silence this warning}}
+#pragma omp target parallel for map(tofrom: map) // expected-warning {{variable 'map' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
struct S1; // expected-note 2 {{declared here}}
extern S1 a;
class S2 {
diff --git a/src/llvm-project/clang/test/OpenMP/target_parallel_for_private_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_parallel_for_private_messages.cpp
index 4635896..b11981e 100644
--- a/src/llvm-project/clang/test/OpenMP/target_parallel_for_private_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_parallel_for_private_messages.cpp
@@ -55,7 +55,7 @@
S5(int v) : a(v) {}
S5 &operator=(S5 &s) {
#pragma omp target parallel for private(a) private(this->a) private(s.a) // expected-error {{expected variable name or data member of current class}}
- for (int k = 0; k < s.a; ++k) // expected-warning {{Non-trivial type 'S5' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (int k = 0; k < s.a; ++k) // expected-warning {{Type 'S5' is not trivially copyable and not guaranteed to be mapped correctly}}
++s.a;
return *this;
}
diff --git a/src/llvm-project/clang/test/OpenMP/target_parallel_for_reduction_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_parallel_for_reduction_messages.cpp
index 3666a34..101bef4 100644
--- a/src/llvm-project/clang/test/OpenMP/target_parallel_for_reduction_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_parallel_for_reduction_messages.cpp
@@ -16,6 +16,13 @@
extern const omp_allocator_handle_t omp_pteam_mem_alloc;
extern const omp_allocator_handle_t omp_thread_mem_alloc;
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp target parallel for reduction(+:fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
void foo() {
}
diff --git a/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_ast_print.cpp b/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_ast_print.cpp
index a368b8a..935010f 100644
--- a/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_ast_print.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_ast_print.cpp
@@ -1,10 +1,16 @@
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ast-print %s -Wno-openmp-target | FileCheck %s
-// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -ast-print %s -Wno-openmp-mapping -DOMP5 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping -DOMP5
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping -DOMP5 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ast-print %s -Wno-openmp-target | FileCheck %s
-// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -ast-print %s -Wno-openmp-mapping -DOMP5 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping -DOMP5
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping -DOMP5 | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50
// expected-no-diagnostics
#ifndef HEADER
@@ -108,9 +114,14 @@
// CHECK-NEXT: for (T i = 0; i < 2; ++i) {
// CHECK-NEXT: }
+#ifdef OMP5
+#pragma omp target parallel for simd if(target:argc > 0) if (simd: argc) nontemporal(argc, c, d)
+#else
#pragma omp target parallel for simd if(target:argc > 0)
+#endif // OMP5
for (T i = 0; i < 2; ++i) {}
- // CHECK: #pragma omp target parallel for simd if(target: argc > 0)
+ // OMP45: #pragma omp target parallel for simd if(target: argc > 0)
+ // OMP50: #pragma omp target parallel for simd if(target: argc > 0) if(simd: argc) nontemporal(argc,c,d)
// CHECK-NEXT: for (T i = 0; i < 2; ++i) {
// CHECK-NEXT: }
@@ -234,9 +245,14 @@
// CHECK-NEXT: for (int i = 0; i < 2; ++i) {
// CHECK-NEXT: }
+#ifdef OMP5
+#pragma omp target parallel for simd if (parallel:argc > 0) if(simd: argc)
+#else
#pragma omp target parallel for simd if (parallel:argc > 0)
+#endif // OMP5
for (int i = 0; i < 2; ++i) {}
- // CHECK: #pragma omp target parallel for simd if(parallel: argc > 0)
+ // OMP45: #pragma omp target parallel for simd if(parallel: argc > 0)
+ // OMP50: #pragma omp target parallel for simd if(parallel: argc > 0) if(simd: argc)
// CHECK-NEXT: for (int i = 0; i < 2; ++i) {
// CHECK-NEXT: }
diff --git a/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_codegen.cpp b/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_codegen.cpp
index a6087c0..055d5dc 100644
--- a/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_codegen.cpp
@@ -1,10 +1,16 @@
// Test host codegen.
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-64
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-64 --check-prefix OMP45
// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-64
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-32
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-64 --check-prefix OMP45
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-32 --check-prefix OMP45
// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-32
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-32 --check-prefix OMP45
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-64 --check-prefix OMP50
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-64 --check-prefix OMP50
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-32 --check-prefix OMP50
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-32 --check-prefix OMP50
// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
@@ -12,17 +18,31 @@
// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
// Test target codegen - host bc file has to be created first.
// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm-bc %s -o %t-ppc-host.bc
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix TCHECK --check-prefix TCHECK-64
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix TCHECK --check-prefix TCHECK-64 --check-prefix TOMP45
// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o %t %s
-// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix TCHECK --check-prefix TCHECK-64
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix TCHECK --check-prefix TCHECK-64 --check-prefix TOMP45
// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm-bc %s -o %t-x86-host.bc
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix TCHECK --check-prefix TCHECK-32
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix TCHECK --check-prefix TCHECK-32 --check-prefix TOMP45
// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o %t %s
-// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix TCHECK --check-prefix TCHECK-32
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix TCHECK --check-prefix TCHECK-32 --check-prefix TOMP45
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm-bc %s -o %t-ppc-host.bc
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix TCHECK --check-prefix TCHECK-64 --check-prefix TOMP50
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix TCHECK --check-prefix TCHECK-64 --check-prefix TOMP50
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm-bc %s -o %t-x86-host.bc
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix TCHECK --check-prefix TCHECK-32 --check-prefix TOMP50
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix TCHECK --check-prefix TCHECK-32 --check-prefix TOMP50
// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm-bc %s -o %t-ppc-host.bc
// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY1 %s
@@ -32,6 +52,14 @@
// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY1 %s
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o %t %s
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm-bc %s -o %t-ppc-host.bc
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm-bc %s -o %t-x86-host.bc
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY1 %s
// SIMD-ONLY1-NOT: {{__kmpc|__tgt}}
// expected-no-diagnostics
@@ -44,13 +72,9 @@
// CHECK-DAG: [[TT:%.+]] = type { i64, i8 }
// CHECK-DAG: [[S1:%.+]] = type { double }
// CHECK-DAG: [[ENTTY:%.+]] = type { i8*, i8*, i[[SZ:32|64]], i32, i32 }
-// CHECK-DAG: [[DEVTY:%.+]] = type { i8*, i8*, [[ENTTY]]*, [[ENTTY]]* }
-// CHECK-DAG: [[DSCTY:%.+]] = type { i32, [[DEVTY]]*, [[ENTTY]]*, [[ENTTY]]* }
// TCHECK: [[ENTTY:%.+]] = type { i8*, i8*, i{{32|64}}, i32, i32 }
-// CHECK-DAG: $[[REGFN:\.omp_offloading\..+]] = comdat
-
// We have 8 target regions, but only 7 that actually will generate offloading
// code, only 6 will have mapped arguments, and only 4 have all-constant map
// sizes.
@@ -64,7 +88,8 @@
// CHECK-DAG: [[MAPT5:@.+]] = private unnamed_addr constant [3 x i64] [i64 800, i64 800, i64 547]
// CHECK-DAG: [[SIZET6:@.+]] = private unnamed_addr constant [4 x i64] [i64 4, i64 2, i64 1, i64 40]
// CHECK-DAG: [[MAPT6:@.+]] = private unnamed_addr constant [4 x i64] [i64 800, i64 800, i64 800, i64 547]
-// CHECK-DAG: [[MAPT7:@.+]] = private unnamed_addr constant [6 x i64] [i64 32, i64 281474976711171, i64 800, i64 800, i64 800, i64 547]
+// OMP45-DAG: [[MAPT7:@.+]] = private unnamed_addr constant [6 x i64] [i64 32, i64 281474976711171, i64 800, i64 800, i64 800, i64 547]
+// OMP50-DAG: [[MAPT7:@.+]] = private unnamed_addr constant [7 x i64] [i64 32, i64 281474976711171, i64 800, i64 800, i64 800, i64 547, i64 800]
// CHECK-DAG: @{{.*}} = weak constant i8 0
// CHECK-DAG: @{{.*}} = weak constant i8 0
// CHECK-DAG: @{{.*}} = weak constant i8 0
@@ -82,16 +107,8 @@
// TCHECK: @{{.+}} = weak constant [[ENTTY]]
// TCHECK-NOT: @{{.+}} = weak constant [[ENTTY]]
-// Check if offloading descriptor is created.
-// CHECK: [[ENTBEGIN:@.+]] = external constant [[ENTTY]]
-// CHECK: [[ENTEND:@.+]] = external constant [[ENTTY]]
-// CHECK: [[DEVBEGIN:@.+]] = extern_weak constant i8
-// CHECK: [[DEVEND:@.+]] = extern_weak constant i8
-// CHECK: [[IMAGES:@.+]] = internal unnamed_addr constant [1 x [[DEVTY]]] [{{.+}} { i8* [[DEVBEGIN]], i8* [[DEVEND]], [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }], comdat($[[REGFN]])
-// CHECK: [[DESC:@.+]] = internal constant [[DSCTY]] { i32 1, [[DEVTY]]* getelementptr inbounds ([1 x [[DEVTY]]], [1 x [[DEVTY]]]* [[IMAGES]], i32 0, i32 0), [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }, comdat($[[REGFN]])
-
// Check target registration is registered as a Ctor.
-// CHECK: appending global [2 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }, { i32, void ()*, i8* } { i32 0, void ()* @[[REGFN]], i8* bitcast (void ()* @[[REGFN]] to i8*) }]
+// CHECK: appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }]
template<typename tx, typename ty>
@@ -521,7 +538,11 @@
int b = n+1;
short int c[2][n];
+#ifdef OMP5
+ #pragma omp target parallel for simd if(n>60) nontemporal(a)
+#else
#pragma omp target parallel for simd if(target: n>60)
+#endif // OMP5
for (unsigned long long it = 2000; it >= 600; it -= 400) {
this->a = (double)b + 1.5;
c[1][1] = ++a;
@@ -555,15 +576,22 @@
// CHECK: define {{.*}}[[FS1]]
//
// CHECK: i8* @llvm.stacksave()
+// CHECK-32: store i32 %{{.+}}, i32* %__vla_expr
+// OMP50: [[IF:%.+]] = icmp sgt i32 {{[^,]+}}, 60
// CHECK-64: [[B_ADDR:%.+]] = bitcast i[[SZ]]* [[B_CADDR:%.+]] to i32*
// CHECK-64: store i32 %{{.+}}, i32* [[B_ADDR]],
// CHECK-64: [[B_CVAL:%.+]] = load i[[SZ]], i[[SZ]]* [[B_CADDR]],
-// CHECK-32: store i32 %{{.+}}, i32* %__vla_expr
// CHECK-32: store i32 %{{.+}}, i32* [[B_ADDR:%.+]],
// CHECK-32: [[B_CVAL:%.+]] = load i[[SZ]], i[[SZ]]* [[B_ADDR]],
-// CHECK: [[IF:%.+]] = icmp sgt i32 {{[^,]+}}, 60
+// OMP45: [[IF:%.+]] = icmp sgt i32 {{[^,]+}}, 60
+// OMP50: [[TOBOOL:%.+]] = trunc i8 %{{.+}} to i1
+// OMP50: [[CONV:%.+]] = bitcast i[[SZ]]* [[CAP:%.+]] to i8*
+// OMP50: [[FROMBOOL:%.+]] = zext i1 [[TOBOOL]] to i8
+// OMP50: store i8 [[FROMBOOL]], i8* [[CONV]],
+// OMP50: [[SIMD_COND:%.+]] = load i[[SZ]], i[[SZ]]* [[CAP]],
+// OMP50: [[IF:%.+]] = trunc i8 %{{.+}} to i1
// CHECK: br i1 [[IF]], label %[[TRY:[^,]+]], label %[[FAIL:[^,]+]]
// CHECK: [[TRY]]
// We capture 2 VLA sizes in this target region
@@ -572,28 +600,53 @@
// CHECK-32: [[CSZSIZE:%.+]] = mul nuw i32 [[CELEMSIZE2]], 2
// CHECK-32: [[CSIZE:%.+]] = sext i32 [[CSZSIZE]] to i64
-// CHECK-DAG: [[RET:%.+]] = call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 6, i8** [[BPR:%[^,]+]], i8** [[PR:%[^,]+]], i64* [[SR:%[^,]+]], i64* getelementptr inbounds ([6 x i64], [6 x i64]* [[MAPT7]], i32 0, i32 0), i32 1, i32 0)
-// CHECK-DAG: [[BPR]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP:%.+]], i32 0, i32 0
-// CHECK-DAG: [[PR]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P:%.+]], i32 0, i32 0
-// CHECK-DAG: [[SR]] = getelementptr inbounds [6 x i64], [6 x i64]* [[S:%.+]], i32 0, i32 0
-// CHECK-DAG: [[SADDR0:%.+]] = getelementptr inbounds [6 x i64], [6 x i64]* [[S]], i32 [[IDX0:[0-9]+]]
-// CHECK-DAG: [[BPADDR0:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP]], i32 [[IDX0]]
-// CHECK-DAG: [[PADDR0:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P]], i32 [[IDX0]]
-// CHECK-DAG: [[SADDR1:%.+]] = getelementptr inbounds [6 x i64], [6 x i64]* [[S]], i32 [[IDX1:[0-9]+]]
-// CHECK-DAG: [[BPADDR1:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP]], i32 [[IDX1]]
-// CHECK-DAG: [[PADDR1:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P]], i32 [[IDX1]]
-// CHECK-DAG: [[SADDR2:%.+]] = getelementptr inbounds [6 x i64], [6 x i64]* [[S]], i32 [[IDX2:[0-9]+]]
-// CHECK-DAG: [[BPADDR2:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP]], i32 [[IDX2]]
-// CHECK-DAG: [[PADDR2:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P]], i32 [[IDX2]]
-// CHECK-DAG: [[SADDR3:%.+]] = getelementptr inbounds [6 x i64], [6 x i64]* [[S]], i32 [[IDX3:[0-9]+]]
-// CHECK-DAG: [[BPADDR3:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP]], i32 [[IDX3]]
-// CHECK-DAG: [[PADDR3:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P]], i32 [[IDX3]]
-// CHECK-DAG: [[SADDR4:%.+]] = getelementptr inbounds [6 x i64], [6 x i64]* [[S]], i32 [[IDX4:[0-9]+]]
-// CHECK-DAG: [[BPADDR4:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP]], i32 [[IDX4]]
-// CHECK-DAG: [[PADDR4:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P]], i32 [[IDX4]]
-// CHECK-DAG: [[SADDR5:%.+]] = getelementptr inbounds [6 x i64], [6 x i64]* [[S]], i32 [[IDX5:[0-9]+]]
-// CHECK-DAG: [[BPADDR5:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP]], i32 [[IDX5]]
-// CHECK-DAG: [[PADDR5:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P]], i32 [[IDX5]]
+// OMP45-DAG: [[RET:%.+]] = call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 6, i8** [[BPR:%[^,]+]], i8** [[PR:%[^,]+]], i64* [[SR:%[^,]+]], i64* getelementptr inbounds ([6 x i64], [6 x i64]* [[MAPT7]], i32 0, i32 0), i32 1, i32 0)
+// OMP50-DAG: [[RET:%.+]] = call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 7, i8** [[BPR:%[^,]+]], i8** [[PR:%[^,]+]], i64* [[SR:%[^,]+]], i64* getelementptr inbounds ([7 x i64], [7 x i64]* [[MAPT7]], i32 0, i32 0), i32 1, i32 %{{.+}})
+// OMP45-DAG: [[BPR]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP:%.+]], i32 0, i32 0
+// OMP45-DAG: [[PR]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P:%.+]], i32 0, i32 0
+// OMP45-DAG: [[SR]] = getelementptr inbounds [6 x i64], [6 x i64]* [[S:%.+]], i32 0, i32 0
+// OMP45-DAG: [[SADDR0:%.+]] = getelementptr inbounds [6 x i64], [6 x i64]* [[S]], i32 [[IDX0:[0-9]+]]
+// OMP45-DAG: [[BPADDR0:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP]], i32 [[IDX0]]
+// OMP45-DAG: [[PADDR0:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P]], i32 [[IDX0]]
+// OMP45-DAG: [[SADDR1:%.+]] = getelementptr inbounds [6 x i64], [6 x i64]* [[S]], i32 [[IDX1:[0-9]+]]
+// OMP45-DAG: [[BPADDR1:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP]], i32 [[IDX1]]
+// OMP45-DAG: [[PADDR1:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P]], i32 [[IDX1]]
+// OMP45-DAG: [[SADDR2:%.+]] = getelementptr inbounds [6 x i64], [6 x i64]* [[S]], i32 [[IDX2:[0-9]+]]
+// OMP45-DAG: [[BPADDR2:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP]], i32 [[IDX2]]
+// OMP45-DAG: [[PADDR2:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P]], i32 [[IDX2]]
+// OMP45-DAG: [[SADDR3:%.+]] = getelementptr inbounds [6 x i64], [6 x i64]* [[S]], i32 [[IDX3:[0-9]+]]
+// OMP45-DAG: [[BPADDR3:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP]], i32 [[IDX3]]
+// OMP45-DAG: [[PADDR3:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P]], i32 [[IDX3]]
+// OMP45-DAG: [[SADDR4:%.+]] = getelementptr inbounds [6 x i64], [6 x i64]* [[S]], i32 [[IDX4:[0-9]+]]
+// OMP45-DAG: [[BPADDR4:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP]], i32 [[IDX4]]
+// OMP45-DAG: [[PADDR4:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P]], i32 [[IDX4]]
+// OMP45-DAG: [[SADDR5:%.+]] = getelementptr inbounds [6 x i64], [6 x i64]* [[S]], i32 [[IDX5:[0-9]+]]
+// OMP45-DAG: [[BPADDR5:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP]], i32 [[IDX5]]
+// OMP45-DAG: [[PADDR5:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P]], i32 [[IDX5]]
+// OMP50-DAG: [[BPR]] = getelementptr inbounds [7 x i8*], [7 x i8*]* [[BP:%.+]], i32 0, i32 0
+// OMP50-DAG: [[PR]] = getelementptr inbounds [7 x i8*], [7 x i8*]* [[P:%.+]], i32 0, i32 0
+// OMP50-DAG: [[SR]] = getelementptr inbounds [7 x i64], [7 x i64]* [[S:%.+]], i32 0, i32 0
+// OMP50-DAG: [[SADDR0:%.+]] = getelementptr inbounds [7 x i64], [7 x i64]* [[S]], i32 [[IDX0:[0-9]+]]
+// OMP50-DAG: [[BPADDR0:%.+]] = getelementptr inbounds [7 x i8*], [7 x i8*]* [[BP]], i32 [[IDX0]]
+// OMP50-DAG: [[PADDR0:%.+]] = getelementptr inbounds [7 x i8*], [7 x i8*]* [[P]], i32 [[IDX0]]
+// OMP50-DAG: [[SADDR1:%.+]] = getelementptr inbounds [7 x i64], [7 x i64]* [[S]], i32 [[IDX1:[0-9]+]]
+// OMP50-DAG: [[BPADDR1:%.+]] = getelementptr inbounds [7 x i8*], [7 x i8*]* [[BP]], i32 [[IDX1]]
+// OMP50-DAG: [[PADDR1:%.+]] = getelementptr inbounds [7 x i8*], [7 x i8*]* [[P]], i32 [[IDX1]]
+// OMP50-DAG: [[SADDR2:%.+]] = getelementptr inbounds [7 x i64], [7 x i64]* [[S]], i32 [[IDX2:[0-9]+]]
+// OMP50-DAG: [[BPADDR2:%.+]] = getelementptr inbounds [7 x i8*], [7 x i8*]* [[BP]], i32 [[IDX2]]
+// OMP50-DAG: [[PADDR2:%.+]] = getelementptr inbounds [7 x i8*], [7 x i8*]* [[P]], i32 [[IDX2]]
+// OMP50-DAG: [[SADDR3:%.+]] = getelementptr inbounds [7 x i64], [7 x i64]* [[S]], i32 [[IDX3:[0-9]+]]
+// OMP50-DAG: [[BPADDR3:%.+]] = getelementptr inbounds [7 x i8*], [7 x i8*]* [[BP]], i32 [[IDX3]]
+// OMP50-DAG: [[PADDR3:%.+]] = getelementptr inbounds [7 x i8*], [7 x i8*]* [[P]], i32 [[IDX3]]
+// OMP50-DAG: [[SADDR4:%.+]] = getelementptr inbounds [7 x i64], [7 x i64]* [[S]], i32 [[IDX4:[0-9]+]]
+// OMP50-DAG: [[BPADDR4:%.+]] = getelementptr inbounds [7 x i8*], [7 x i8*]* [[BP]], i32 [[IDX4]]
+// OMP50-DAG: [[PADDR4:%.+]] = getelementptr inbounds [7 x i8*], [7 x i8*]* [[P]], i32 [[IDX4]]
+// OMP50-DAG: [[SADDR5:%.+]] = getelementptr inbounds [7 x i64], [7 x i64]* [[S]], i32 [[IDX5:[0-9]+]]
+// OMP50-DAG: [[BPADDR5:%.+]] = getelementptr inbounds [7 x i8*], [7 x i8*]* [[BP]], i32 [[IDX5]]
+// OMP50-DAG: [[PADDR5:%.+]] = getelementptr inbounds [7 x i8*], [7 x i8*]* [[P]], i32 [[IDX5]]
+// OMP50-DAG: [[SADDR6:%.+]] = getelementptr inbounds [7 x i64], [7 x i64]* [[S]], i32 [[IDX6:[0-9]+]]
+// OMP50-DAG: [[BPADDR6:%.+]] = getelementptr inbounds [7 x i8*], [7 x i8*]* [[BP]], i32 [[IDX6]]
+// OMP50-DAG: [[PADDR6:%.+]] = getelementptr inbounds [7 x i8*], [7 x i8*]* [[P]], i32 [[IDX6]]
// The names below are not necessarily consistent with the names used for the
// addresses above as some are repeated.
@@ -633,11 +686,18 @@
// CHECK-DAG: [[CPADDR5]] = bitcast i8** {{%[^,]+}} to i16**
// CHECK-DAG: store i64 [[CSIZE]], i64* {{%[^,]+}}
+// OMP50-DAG: store i[[SZ]] [[SIMD_COND]], i[[SZ]]* [[CBPADDR6:%.+]],
+// OMP50-DAG: store i[[SZ]] [[SIMD_COND]], i[[SZ]]* [[CPADDR6:%.+]],
+// OMP50-DAG: [[CBPADDR6]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
+// OMP50-DAG: [[CPADDR6]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
+// OMP50-DAG: store i64 1, i64* {{%[^,]+}}
+
// CHECK-NEXT: [[ERROR:%.+]] = icmp ne i32 [[RET]], 0
// CHECK-NEXT: br i1 [[ERROR]], label %[[FAIL:[^,]+]], label %[[END:[^,]+]]
// CHECK: [[FAIL]]
-// CHECK: call void [[HVT7:@.+]]({{[^,]+}}, {{[^,]+}}, {{[^,]+}}, {{[^,]+}}, {{[^,]+}})
+// OMP45: call void [[HVT7:@.+]]({{[^,]+}}, {{[^,]+}}, {{[^,]+}}, {{[^,]+}}, {{[^,]+}})
+// OMP50: call void [[HVT7:@.+]]({{[^,]+}}, {{[^,]+}}, {{[^,]+}}, {{[^,]+}}, {{[^,]+}}, {{[^,]+}})
// CHECK-NEXT: br label %[[END]]
// CHECK: [[END]]
@@ -744,7 +804,9 @@
// CHECK: [[LOCAL_VLA1:%.+]] = alloca i[[SZ]]
// CHECK: [[LOCAL_VLA2:%.+]] = alloca i[[SZ]]
// CHECK: [[LOCAL_C:%.+]] = alloca i16*
+// OMP50: alloca i[[SZ]]
// CHECK: [[LOCAL_B_CASTED:%.+]] = alloca i[[SZ]]
+// OMP50: [[LOCAL_SIMD_COND_CASTED:%.+]] = alloca i[[SZ]]
// CHECK-DAG: store [[S1]]* [[ARG_THIS:%.+]], [[S1]]** [[LOCAL_THIS]]
// CHECK-DAG: store i[[SZ]] [[ARG_B:%.+]], i[[SZ]]* [[LOCAL_B]]
// CHECK-DAG: store i[[SZ]] [[ARG_VLA1:%.+]], i[[SZ]]* [[LOCAL_VLA1]]
@@ -764,11 +826,20 @@
// CHECK-32-DAG:store i32 [[LOCAL_BV]], i32* [[LOCAL_B_CASTED]], align
// CHECK-DAG: [[REF_B:%.+]] = load i[[SZ]], i[[SZ]]* [[LOCAL_B_CASTED]],
-// CHECK: call {{.*}}void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* [[DEF_LOC]], i32 5, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, [[S1]]*, i[[SZ]], i[[SZ]], i[[SZ]], i16*)* [[OMP_OUTLINED5:@.+]] to void (i32*, i32*, ...)*), [[S1]]* [[REF_THIS]], i[[SZ]] [[REF_B]], i[[SZ]] [[VAL_VLA1]], i[[SZ]] [[VAL_VLA2]], i16* [[REF_C]])
+// OMP50-DAG: [[CONV_COND:%.+]] = bitcast i[[SZ]]* [[LOCAL_SIMD_COND_CASTED]] to i8*
+// OMP50-DAG: store i8 %{{.+}}, i8* [[CONV_COND]],
+// OMP50-DAG: [[SIMD_COND:%.+]] = load i[[SZ]], i[[SZ]]* [[LOCAL_SIMD_COND_CASTED]],
+
+// OMP45: call {{.*}}void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* [[DEF_LOC]], i32 5, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, [[S1]]*, i[[SZ]], i[[SZ]], i[[SZ]], i16*)* [[OMP_OUTLINED5:@.+]] to void (i32*, i32*, ...)*), [[S1]]* [[REF_THIS]], i[[SZ]] [[REF_B]], i[[SZ]] [[VAL_VLA1]], i[[SZ]] [[VAL_VLA2]], i16* [[REF_C]])
+// OMP50: call {{.*}}void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* [[DEF_LOC]], i32 6, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, [[S1]]*, i[[SZ]], i[[SZ]], i[[SZ]], i16*, i[[SZ]])* [[OMP_OUTLINED5:@.+]] to void (i32*, i32*, ...)*), [[S1]]* [[REF_THIS]], i[[SZ]] [[REF_B]], i[[SZ]] [[VAL_VLA1]], i[[SZ]] [[VAL_VLA2]], i16* [[REF_C]], i[[SZ]] [[SIMD_COND]])
//
//
-// CHECK: define internal {{.*}}void [[OMP_OUTLINED5]](i32* noalias %.global_tid., i32* noalias %.bound_tid., [[S1]]* %{{.+}}, i[[SZ]] %{{.+}}, i[[SZ]] %{{.+}}, i[[SZ]] %{{.+}}, i16* {{.+}})
+// OMP45: define internal {{.*}}void [[OMP_OUTLINED5]](i32* noalias %.global_tid., i32* noalias %.bound_tid., [[S1]]* %{{.+}}, i[[SZ]] %{{.+}}, i[[SZ]] %{{.+}}, i[[SZ]] %{{.+}}, i16* {{.+}})
+// OMP50: define internal {{.*}}void [[OMP_OUTLINED5]](i32* noalias %.global_tid., i32* noalias %.bound_tid., [[S1]]* %{{.+}}, i[[SZ]] %{{.+}}, i[[SZ]] %{{.+}}, i[[SZ]] %{{.+}}, i16* {{.+}}, i[[SZ]] %{{.+}})
// To reduce complexity, we're only going as far as validating the signature of the outlined parallel function.
+// OMP45-NOT: !nontemporal
+// OMP50: store double{{.*}}!nontemporal
+// OMP50: load double{{.*}}!nontemporal
// CHECK: define internal void [[HVT6]]
@@ -846,4 +917,9 @@
// CHECK: define internal {{.*}}void [[OMP_OUTLINED7]](i32* noalias %.global_tid., i32* noalias %.bound_tid., i[[SZ]] %{{.+}}, i[[SZ]] %{{.+}}, [10 x i32]* {{.+}})
// To reduce complexity, we're only going as far as validating the signature of the outlined parallel function.
+// OMP45-NOT: !{!"llvm.loop.vectorize.enable", i1 false}
+// TOMP45-NOT: !{!"llvm.loop.vectorize.enable", i1 false}
+// OMP50: !{!"llvm.loop.vectorize.enable", i1 false}
+// TOMP50: !{!"llvm.loop.vectorize.enable", i1 false}
+
#endif
diff --git a/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_codegen_registration.cpp b/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_codegen_registration.cpp
index dead462..824040d 100644
--- a/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_codegen_registration.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_codegen_registration.cpp
@@ -52,13 +52,9 @@
// CHECK-DAG: [[ST1:%.+]] = type { [228 x i32] }
// CHECK-DAG: [[ST2:%.+]] = type { [1128 x i32] }
// CHECK-DAG: [[ENTTY:%.+]] = type { i8*, i8*, i[[SZ:32|64]], i32, i32 }
-// CHECK-DAG: [[DEVTY:%.+]] = type { i8*, i8*, [[ENTTY]]*, [[ENTTY]]* }
-// CHECK-DAG: [[DSCTY:%.+]] = type { i32, [[DEVTY]]*, [[ENTTY]]*, [[ENTTY]]* }
// TCHECK: [[ENTTY:%.+]] = type { i8*, i8*, i[[SZ:32|64]], i32, i32 }
-// CHECK-DAG: $[[REGFN:\.omp_offloading\..+]] = comdat
-
// CHECK-DAG: [[A1:@.+]] = internal global [[SA]]
// CHECK-DAG: [[A2:@.+]] = global [[SA]]
// CHECK-DAG: [[B1:@.+]] = global [[SB]]
@@ -123,68 +119,60 @@
// CHECK-NTARGET-NOT: private unnamed_addr constant [1 x i
// CHECK-DAG: [[NAMEPTR1:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME1:__omp_offloading_[0-9a-f]+_[0-9a-f]+__Z.+_l[0-9]+]]\00"
-// CHECK-DAG: [[ENTRY1:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR1]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY1:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR1]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR2:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME2:.+]]\00"
-// CHECK-DAG: [[ENTRY2:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR2]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY2:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR2]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR3:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME3:.+]]\00"
-// CHECK-DAG: [[ENTRY3:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR3]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY3:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR3]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR4:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME4:.+]]\00"
-// CHECK-DAG: [[ENTRY4:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR4]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY4:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR4]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR5:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME5:.+]]\00"
-// CHECK-DAG: [[ENTRY5:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR5]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY5:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR5]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR6:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME6:.+]]\00"
-// CHECK-DAG: [[ENTRY6:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR6]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY6:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR6]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR7:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME7:.+]]\00"
-// CHECK-DAG: [[ENTRY7:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR7]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY7:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR7]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR8:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME8:.+]]\00"
-// CHECK-DAG: [[ENTRY8:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR8]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY8:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR8]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR9:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME9:.+]]\00"
-// CHECK-DAG: [[ENTRY9:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR9]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY9:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR9]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR10:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME10:.+]]\00"
-// CHECK-DAG: [[ENTRY10:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR10]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY10:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR10]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR11:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME11:.+]]\00"
-// CHECK-DAG: [[ENTRY11:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR11]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY11:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR11]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR12:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME12:.+]]\00"
-// CHECK-DAG: [[ENTRY12:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR12]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY12:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR12]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR1:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME1:__omp_offloading_[0-9a-f]+_[0-9a-f]+__Z.+_l[0-9]+]]\00"
-// TCHECK-DAG: [[ENTRY1:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR1]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY1:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR1]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR2:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME2:.+]]\00"
-// TCHECK-DAG: [[ENTRY2:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR2]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY2:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR2]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR3:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME3:.+]]\00"
-// TCHECK-DAG: [[ENTRY3:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR3]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY3:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR3]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR4:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME4:.+]]\00"
-// TCHECK-DAG: [[ENTRY4:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR4]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY4:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR4]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR5:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME5:.+]]\00"
-// TCHECK-DAG: [[ENTRY5:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR5]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY5:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR5]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR6:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME6:.+]]\00"
-// TCHECK-DAG: [[ENTRY6:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR6]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY6:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR6]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR7:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME7:.+]]\00"
-// TCHECK-DAG: [[ENTRY7:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR7]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY7:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR7]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR8:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME8:.+]]\00"
-// TCHECK-DAG: [[ENTRY8:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR8]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY8:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR8]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR9:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME9:.+]]\00"
-// TCHECK-DAG: [[ENTRY9:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR9]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY9:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR9]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR10:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME10:.+]]\00"
-// TCHECK-DAG: [[ENTRY10:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR10]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY10:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR10]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR11:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME11:.+]]\00"
-// TCHECK-DAG: [[ENTRY11:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR11]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY11:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR11]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR12:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME12:.+]]\00"
-// TCHECK-DAG: [[ENTRY12:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR12]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
-
-// CHECK: [[ENTBEGIN:@.+]] = external constant [[ENTTY]]
-// CHECK: [[ENTEND:@.+]] = external constant [[ENTTY]]
-// CHECK: [[DEVBEGIN:@.+]] = extern_weak constant i8
-// CHECK: [[DEVEND:@.+]] = extern_weak constant i8
-// CHECK: [[IMAGES:@.+]] = internal unnamed_addr constant [1 x [[DEVTY]]] [{{.+}} { i8* [[DEVBEGIN]], i8* [[DEVEND]], [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }], comdat($[[REGFN]])
-// CHECK: [[DESC:@.+]] = internal constant [[DSCTY]] { i32 1, [[DEVTY]]* getelementptr inbounds ([1 x [[DEVTY]]], [1 x [[DEVTY]]]* [[IMAGES]], i32 0, i32 0), [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }, comdat($[[REGFN]])
+// TCHECK-DAG: [[ENTRY12:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR12]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// We have 4 initializers, one for the 500 priority, another one for 501, or more for the default priority, and the last one for the offloading registration function.
-// CHECK: @llvm.global_ctors = appending global [5 x { i32, void ()*, i8* }] [
+// CHECK: @llvm.global_ctors = appending global [4 x { i32, void ()*, i8* }] [
// CHECK-SAME: { i32, void ()*, i8* } { i32 500, void ()* [[P500:@[^,]+]], i8* null },
// CHECK-SAME: { i32, void ()*, i8* } { i32 501, void ()* [[P501:@[^,]+]], i8* null },
// CHECK-SAME: { i32, void ()*, i8* } { i32 65535, void ()* [[PMAX:@[^,]+]], i8* null },
-// CHECK-SAME: { i32, void ()*, i8* } { i32 0, void ()* @[[REGFN]], i8* bitcast (void ()* @[[REGFN]] to i8*) }]
// CHECK-NTARGET: @llvm.global_ctors = appending global [3 x { i32, void ()*, i8* }] [
@@ -363,12 +351,8 @@
//TCHECK-DAG: define weak void @[[NAME12]](
// CHECK-NTARGET-NOT: __tgt_target
-// CHECK-NTARGET-NOT: __tgt_register_lib
-// CHECK-NTARGET-NOT: __tgt_unregister_lib
// TCHECK-NOT: __tgt_target
-// TCHECK-NOT: __tgt_register_lib
-// TCHECK-NOT: __tgt_unregister_lib
// We have 2 initializers with priority 500
//CHECK: define internal void [[P500]](
@@ -394,25 +378,6 @@
//CHECK-NOT: call void @{{.+}}()
//CHECK: ret void
-// Check registration and unregistration
-
-//CHECK: define internal void @.omp_offloading.requires_reg()
-//CHECK: call void @__tgt_register_requires(i64 1)
-//CHECK: ret void
-
-//CHECK: define internal void @[[UNREGFN:.+]](i8*)
-//CHECK-SAME: comdat($[[REGFN]]) {
-//CHECK: call i32 @__tgt_unregister_lib([[DSCTY]]* [[DESC]])
-//CHECK: ret void
-//CHECK: declare i32 @__tgt_unregister_lib([[DSCTY]]*)
-
-//CHECK: define linkonce hidden void @[[REGFN]]()
-//CHECK-SAME: comdat {
-//CHECK: call i32 @__tgt_register_lib([[DSCTY]]* [[DESC]])
-//CHECK: call i32 @__cxa_atexit(void (i8*)* @[[UNREGFN]], i8* bitcast ([[DSCTY]]* [[DESC]] to i8*),
-//CHECK: ret void
-//CHECK: declare i32 @__tgt_register_lib([[DSCTY]]*)
-
static __attribute__((init_priority(500))) SA a1;
SA a2;
SB __attribute__((init_priority(500))) b1;
@@ -446,31 +411,31 @@
// Check metadata is properly generated:
// CHECK: !omp_offload.info = !{!{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID:-?[0-9]+]], i32 [[FILEID:-?[0-9]+]], !"_ZN2SB3fooEv", i32 216, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SDD1Ev", i32 268, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SEC1Ev", i32 286, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SED1Ev", i32 293, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EE3fooEv", i32 305, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EEC1Ev", i32 312, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_Z3bari", i32 440, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EED1Ev", i32 319, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EEC1Ev", i32 312, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EED1Ev", i32 319, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EE3fooEv", i32 305, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SCC1Ev", i32 242, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID:-?[0-9]+]], i32 [[FILEID:-?[0-9]+]], !"_ZN2SB3fooEv", i32 204, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SDD1Ev", i32 256, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SEC1Ev", i32 274, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SED1Ev", i32 281, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EE3fooEv", i32 293, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EEC1Ev", i32 300, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_Z3bari", i32 405, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EED1Ev", i32 307, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EEC1Ev", i32 300, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EED1Ev", i32 307, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EE3fooEv", i32 293, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SCC1Ev", i32 230, i32 {{[0-9]+}}}
// TCHECK: !omp_offload.info = !{!{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID:-?[0-9]+]], i32 [[FILEID:-?[0-9]+]], !"_ZN2SB3fooEv", i32 216, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SDD1Ev", i32 268, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SEC1Ev", i32 286, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SED1Ev", i32 293, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EE3fooEv", i32 305, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EEC1Ev", i32 312, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_Z3bari", i32 440, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EED1Ev", i32 319, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EEC1Ev", i32 312, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EED1Ev", i32 319, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EE3fooEv", i32 305, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SCC1Ev", i32 242, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID:-?[0-9]+]], i32 [[FILEID:-?[0-9]+]], !"_ZN2SB3fooEv", i32 204, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SDD1Ev", i32 256, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SEC1Ev", i32 274, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SED1Ev", i32 281, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EE3fooEv", i32 293, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EEC1Ev", i32 300, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_Z3bari", i32 405, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EED1Ev", i32 307, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EEC1Ev", i32 300, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EED1Ev", i32 307, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EE3fooEv", i32 293, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SCC1Ev", i32 230, i32 {{[0-9]+}}}
#endif
diff --git a/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_defaultmap_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_defaultmap_messages.cpp
index 1affed1..e3d16ce 100644
--- a/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_defaultmap_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_defaultmap_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 %s -verify=expected,omp5 -Wuninitialized -DOMP5
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 %s -verify=expected,omp5 -Wuninitialized -DOMP5
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 %s -verify=expected,omp45 -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 %s -verify=expected,omp45 -Wuninitialized
void foo() {
}
@@ -10,23 +12,23 @@
int i;
#pragma omp target parallel for simd defaultmap // expected-error {{expected '(' after 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for simd defaultmap ( // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ #pragma omp target parallel for simd defaultmap ( // omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for simd defaultmap () // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
+ #pragma omp target parallel for simd defaultmap () // omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for simd defaultmap (tofrom // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+ #pragma omp target parallel for simd defaultmap (tofrom // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for simd defaultmap (tofrom: // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+ #pragma omp target parallel for simd defaultmap (tofrom: // expected-error {{expected ')'}} expected-note {{to match this '('}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for simd defaultmap (tofrom) // expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+ #pragma omp target parallel for simd defaultmap (tofrom) // expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for simd defaultmap (tofrom scalar) // expected-warning {{missing ':' after defaultmap modifier - ignoring}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for simd defaultmap (tofrom, // expected-error {{expected ')'}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-note {{to match this '('}}
+ #pragma omp target parallel for simd defaultmap (tofrom, // expected-error {{expected ')'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-note {{to match this '('}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for simd defaultmap (scalar: // expected-error {{expected ')'}} expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
+ #pragma omp target parallel for simd defaultmap (scalar: // expected-error {{expected ')'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for simd defaultmap (tofrom, scalar // expected-error {{expected ')'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
+ #pragma omp target parallel for simd defaultmap (tofrom, scalar // expected-error {{expected ')'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
return argc;
@@ -36,25 +38,24 @@
int i;
#pragma omp target parallel for simd defaultmap // expected-error {{expected '(' after 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for simd defaultmap ( // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ #pragma omp target parallel for simd defaultmap ( // omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for simd defaultmap () // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
+ #pragma omp target parallel for simd defaultmap () // omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for simd defaultmap (tofrom // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+ #pragma omp target parallel for simd defaultmap (tofrom // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for simd defaultmap (tofrom: // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+ #pragma omp target parallel for simd defaultmap (tofrom: // expected-error {{expected ')'}} expected-note {{to match this '('}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for simd defaultmap (tofrom) // expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+ #pragma omp target parallel for simd defaultmap (tofrom) // expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for simd defaultmap (tofrom scalar) // expected-warning {{missing ':' after defaultmap modifier - ignoring}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for simd defaultmap (tofrom, // expected-error {{expected ')'}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-note {{to match this '('}}
+ #pragma omp target parallel for simd defaultmap (tofrom, // expected-error {{expected ')'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-note {{to match this '('}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for simd defaultmap (scalar: // expected-error {{expected ')'}} expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
+ #pragma omp target parallel for simd defaultmap (scalar: // expected-error {{expected ')'}} omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for simd defaultmap (tofrom, scalar // expected-error {{expected ')'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
+ #pragma omp target parallel for simd defaultmap (tofrom, scalar // expected-error {{expected ')'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
return tmain<int, char, 1, 0>(argc, argv);
}
-
diff --git a/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_depend_codegen.cpp b/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_depend_codegen.cpp
index 8784b69..74ff678 100644
--- a/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_depend_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_depend_codegen.cpp
@@ -40,13 +40,9 @@
// CHECK-DAG: [[TT:%.+]] = type { i64, i8 }
// CHECK-DAG: [[ENTTY:%.+]] = type { i8*, i8*, i[[SZ:32|64]], i32, i32 }
-// CHECK-DAG: [[DEVTY:%.+]] = type { i8*, i8*, [[ENTTY]]*, [[ENTTY]]* }
-// CHECK-DAG: [[DSCTY:%.+]] = type { i32, [[DEVTY]]*, [[ENTTY]]*, [[ENTTY]]* }
// TCHECK: [[ENTTY:%.+]] = type { i8*, i8*, i{{32|64}}, i32, i32 }
-// CHECK-DAG: $[[REGFN:\.omp_offloading\..+]] = comdat
-
// CHECK-DAG: [[SIZET:@.+]] = private unnamed_addr constant [2 x i64] [i64 0, i64 4]
// CHECK-DAG: [[MAPT:@.+]] = private unnamed_addr constant [2 x i64] [i64 544, i64 800]
// CHECK-DAG: @{{.*}} = weak constant i8 0
@@ -55,16 +51,8 @@
// TCHECK: @{{.+}} = {{.*}}constant [[ENTTY]]
// TCHECK-NOT: @{{.+}} = weak constant [[ENTTY]]
-// Check if offloading descriptor is created.
-// CHECK: [[ENTBEGIN:@.+]] = external constant [[ENTTY]]
-// CHECK: [[ENTEND:@.+]] = external constant [[ENTTY]]
-// CHECK: [[DEVBEGIN:@.+]] = extern_weak constant i8
-// CHECK: [[DEVEND:@.+]] = extern_weak constant i8
-// CHECK: [[IMAGES:@.+]] = internal unnamed_addr constant [1 x [[DEVTY]]] [{{.+}} { i8* [[DEVBEGIN]], i8* [[DEVEND]], [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }], comdat($[[REGFN]])
-// CHECK: [[DESC:@.+]] = internal constant [[DSCTY]] { i32 1, [[DEVTY]]* getelementptr inbounds ([1 x [[DEVTY]]], [1 x [[DEVTY]]]* [[IMAGES]], i32 0, i32 0), [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }, comdat($[[REGFN]])
-
// Check target registration is registered as a Ctor.
-// CHECK: appending global [2 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }, { i32, void ()*, i8* } { i32 0, void ()* @[[REGFN]], i8* bitcast (void ()* @[[REGFN]] to i8*) }]
+// CHECK: appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }]
template<typename tx, typename ty>
@@ -193,7 +181,7 @@
// CHECK: define internal void [[HVT0:@.+]]()
-// CHECK: define internal{{.*}} i32 [[TASK_ENTRY0]](i32{{.*}}, [[TASK_TY0]]* noalias)
+// CHECK: define internal{{.*}} i32 [[TASK_ENTRY0]](i32{{.*}}, [[TASK_TY0]]* noalias %1)
// CHECK: store void (i8*, ...)* null, void (i8*, ...)** %
// CHECK: [[DEVICE_CAP:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 0
// CHECK: [[DEV:%.+]] = load i32, i32* [[DEVICE_CAP]],
@@ -209,7 +197,7 @@
// CHECK: define internal void [[HVT1:@.+]](i[[SZ]]* %{{.+}}, i[[SZ]] %{{.+}})
-// CHECK: define internal{{.*}} i32 [[TASK_ENTRY1_]](i32{{.*}}, [[TASK_TY1_]]* noalias)
+// CHECK: define internal{{.*}} i32 [[TASK_ENTRY1_]](i32{{.*}}, [[TASK_TY1_]]* noalias %1)
// CHECK: call void (i8*, ...) %
// CHECK: [[SZT:%.+]] = getelementptr inbounds [2 x i64], [2 x i64]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0
// CHECK: [[DEVICE_CAP:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 2
@@ -231,7 +219,7 @@
// CHECK: [[END]]
// CHECK: ret i32 0
-// CHECK: define internal{{.*}} i32 [[TASK_ENTRY1__]](i32{{.*}}, [[TASK_TY1__]]* noalias)
+// CHECK: define internal{{.*}} i32 [[TASK_ENTRY1__]](i32{{.*}}, [[TASK_TY1__]]* noalias %1)
// CHECK: call void (i8*, ...) %
// CHECK: [[DEVICE_CAP:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 2
// CHECK: [[BP0:%.+]] = load i[[SZ]]*, i[[SZ]]** %
@@ -251,7 +239,7 @@
// CHECK-64: load i32, i32* [[AA_CADDR]], align
// CHECK-32: load i32, i32* [[AA_ADDR]], align
-// CHECK: define internal{{.*}} i32 [[TASK_ENTRY2]](i32{{.*}}, [[TASK_TY2]]* noalias)
+// CHECK: define internal{{.*}} i32 [[TASK_ENTRY2]](i32{{.*}}, [[TASK_TY2]]* noalias %1)
// CHECK: call void (i8*, ...) %
// CHECK: [[BP1_I32:%.+]] = load i32, i32* %
// CHECK-64: [[BP1_CAST:%.+]] = bitcast i[[SZ]]* [[BP1_PTR:%.+]] to i32*
diff --git a/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_depend_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_depend_messages.cpp
index 01e00bf..4b4c61a 100644
--- a/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_depend_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_depend_messages.cpp
@@ -69,7 +69,7 @@
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for simd depend (in : argv[0:-1]) // expected-error {{section length is evaluated to a negative value -1}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for simd depend (in : argv[-1:0])
+ #pragma omp target parallel for simd depend (in : argv[-1:0]) // expected-error {{zero-length array section is not allowed in 'depend' clause}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for simd depend (in : argv[:]) // expected-error {{section length is unspecified and cannot be inferred because subscripted value is not an array}}
for (i = 0; i < argc; ++i) foo();
diff --git a/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_firstprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_firstprivate_messages.cpp
index b2ffe3b..4a25753 100644
--- a/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_firstprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_firstprivate_messages.cpp
@@ -19,6 +19,13 @@
return argc;
}
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp target parallel for simd firstprivate(fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
struct S1; // expected-note 2 {{declared here}} expected-note 2 {{forward declaration of 'S1'}}
extern S1 a;
class S2 {
diff --git a/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_if_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_if_messages.cpp
index ef9a208..aa6cec1 100644
--- a/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_if_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_if_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp -fopenmp-version=45 %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp -fopenmp-version=50 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-simd -fopenmp-version=45 %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-simd -fopenmp-version=50 %s -Wuninitialized
void foo() {
}
@@ -55,13 +57,15 @@
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for simd if(parallel : argc) if (for:argc) // expected-error {{directive name modifier 'for' is not allowed for '#pragma omp target parallel for simd'}}
for (i = 0; i < argc; ++i) foo();
+ #pragma omp target parallel for simd if(parallel : argc) if (simd:argc) // omp45-error {{directive name modifier 'simd' is not allowed for '#pragma omp target parallel for simd'}}
+ for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for simd if(target : argc) if (target :argc) // expected-error {{directive '#pragma omp target parallel for simd' cannot contain more than one 'if' clause with 'target' name modifier}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for simd if(parallel : argc) if (parallel :argc) // expected-error {{directive '#pragma omp target parallel for simd' cannot contain more than one 'if' clause with 'parallel' name modifier}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for simd if(target : argc) if (argc) // expected-error {{expected 'parallel' directive name modifier}} expected-note {{previous clause with directive name modifier specified here}}
+ #pragma omp target parallel for simd if(target : argc) if (argc) // omp45-error {{expected 'parallel' directive name modifier}} omp50-error {{expected one of 'parallel' or 'simd' directive name modifiers}} expected-note {{previous clause with directive name modifier specified here}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for simd if(target : argc) if(parallel : argc) if (argc) // expected-error {{no more 'if' clause is allowed}} expected-note {{previous clause with directive name modifier specified here}} expected-note {{previous clause with directive name modifier specified here}}
+ #pragma omp target parallel for simd if(target : argc) if(parallel : argc) if (argc) // omp45-error {{no more 'if' clause is allowed}} omp50-error {{expected 'simd' directive name modifier}} expected-note {{previous clause with directive name modifier specified here}} expected-note {{previous clause with directive name modifier specified here}}
for (i = 0; i < argc; ++i) foo();
return 0;
@@ -101,13 +105,15 @@
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for simd if(target : argc) if (for:argc) // expected-error {{directive name modifier 'for' is not allowed for '#pragma omp target parallel for simd'}}
for (i = 0; i < argc; ++i) foo();
+ #pragma omp target parallel for simd if(target : argc) if (simd:argc) // omp45-error {{directive name modifier 'simd' is not allowed for '#pragma omp target parallel for simd'}}
+ for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for simd if(target : argc) if (target :argc) // expected-error {{directive '#pragma omp target parallel for simd' cannot contain more than one 'if' clause with 'target' name modifier}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for simd if(parallel : argc) if (parallel :argc) // expected-error {{directive '#pragma omp target parallel for simd' cannot contain more than one 'if' clause with 'parallel' name modifier}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for simd if(target : argc) if (argc) // expected-error {{expected 'parallel' directive name modifier}} expected-note {{previous clause with directive name modifier specified here}}
+ #pragma omp target parallel for simd if(target : argc) if (argc) // omp45-error {{expected 'parallel' directive name modifier}} omp50-error {{expected one of 'parallel' or 'simd' directive name modifiers}} expected-note {{previous clause with directive name modifier specified here}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for simd if(target : argc) if(parallel : argc) if (argc) // expected-error {{no more 'if' clause is allowed}} expected-note {{previous clause with directive name modifier specified here}} expected-note {{previous clause with directive name modifier specified here}}
+ #pragma omp target parallel for simd if(target : argc) if(parallel : argc) if (argc) // omp45-error {{no more 'if' clause is allowed}} omp50-error {{expected 'simd' directive name modifier}} expected-note {{previous clause with directive name modifier specified here}} expected-note {{previous clause with directive name modifier specified here}}
for (i = 0; i < argc; ++i) foo();
return tmain(argc, argv);
diff --git a/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_lastprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_lastprivate_messages.cpp
index 04f52f5..05dff0e 100644
--- a/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_lastprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_lastprivate_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
@@ -64,7 +66,7 @@
};
class S6 {
int a;
- S6() : a(0) {}
+ S6() : a(0) {} // omp45-note 2 {{implicitly declared private here}}
public:
S6(const S6 &s6) : a(s6.a) {}
@@ -80,6 +82,7 @@
I g(5);
int i, z;
int &j = i;
+ S6 s(0); // omp50-note {{'s' defined here}}
#pragma omp target parallel for simd lastprivate // expected-error {{expected '(' after 'lastprivate'}}
for (int k = 0; k < argc; ++k)
++k;
@@ -101,6 +104,12 @@
#pragma omp target parallel for simd allocate(omp_thread_mem_alloc: argc) lastprivate(argc) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'target parallel for simd' directive}}
for (int k = 0; k < argc; ++k)
++k;
+#pragma omp target parallel for simd lastprivate(conditional: argc,s) lastprivate(conditional: // omp50-error {{expected expression}} omp45-error 2 {{use of undeclared identifier 'conditional'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp45-error 2 {{calling a private constructor of class 'S6'}} omp50-error {{expected list item of scalar type in 'lastprivate' clause with 'conditional' modifier}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp target parallel for simd lastprivate(foo:argc) // omp50-error {{expected 'conditional' in OpenMP clause 'lastprivate'}} omp45-error {{expected ',' or ')' in 'lastprivate' clause}} omp45-error {{expected ')'}} omp45-error {{expected variable name}} omp45-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
#pragma omp target parallel for simd lastprivate(S1) // expected-error {{'S1' does not refer to a value}}
for (int k = 0; k < argc; ++k)
++k;
@@ -221,8 +230,8 @@
#pragma omp target parallel for simd private(xa), lastprivate(xa) // expected-error {{private variable cannot be lastprivate}} expected-note {{defined as private}}
for (i = 0; i < argc; ++i)
foo();
-// expected-note@+2 {{defined as lastprivate}}
-// expected-error@+2 {{loop iteration variable in the associated loop of 'omp target parallel for simd' directive may not be lastprivate, predetermined as linear}}
+// omp45-note@+2 {{defined as lastprivate}}
+// omp45-error@+2 {{loop iteration variable in the associated loop of 'omp target parallel for simd' directive may not be lastprivate, predetermined as linear}}
#pragma omp target parallel for simd lastprivate(i)
for (i = 0; i < argc; ++i)
foo();
diff --git a/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_linear_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_linear_messages.cpp
index 829e9eb..56abe2ad 100644
--- a/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_linear_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_linear_messages.cpp
@@ -12,6 +12,13 @@
extern const omp_allocator_handle_t omp_pteam_mem_alloc;
extern const omp_allocator_handle_t omp_thread_mem_alloc;
+void xxx(int argc) {
+ int i, lin, step; // expected-note {{initialize the variable 'lin' to silence this warning}} expected-note {{initialize the variable 'step' to silence this warning}}
+#pragma omp target parallel for simd linear(i, lin : step) // expected-warning {{variable 'lin' is uninitialized when used here}} expected-warning {{variable 'step' is uninitialized when used here}}
+ for (i = 0; i < 10; ++i)
+ ;
+}
+
namespace X {
int x;
};
diff --git a/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_loop_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_loop_messages.cpp
index 9bcef91..3cf9289 100644
--- a/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_loop_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_loop_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wno-openmp-mapping -Wuninitialized
class S {
int a;
@@ -92,28 +94,28 @@
for (((ii)) = 0; ii < 10; ++ii)
c[ii] = a[ii];
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
#pragma omp target parallel for simd
for (int i = 0; i; i++)
c[i] = a[i];
-// expected-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'i'}}
#pragma omp target parallel for simd
for (int i = 0; jj < kk; ii++)
c[i] = a[i];
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
#pragma omp target parallel for simd
for (int i = 0; !!i; i++)
c[i] = a[i];
-// Ok
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
#pragma omp target parallel for simd
for (int i = 0; i != 1; i++)
c[i] = a[i];
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
#pragma omp target parallel for simd
for (int i = 0;; i++)
c[i] = a[i];
@@ -249,14 +251,14 @@
for (ii = 0; ii < 10; ii++)
c[ii] = a[ii];
-// expected-note@+2 {{defined as private}}
-// expected-error@+2 {{loop iteration variable in the associated loop of 'omp target parallel for simd' directive may not be private, predetermined as linear}}
+// omp4-note@+2 {{defined as private}}
+// omp4-error@+2 {{loop iteration variable in the associated loop of 'omp target parallel for simd' directive may not be private, predetermined as linear}}
#pragma omp target parallel for simd private(ii)
for (ii = 0; ii < 10; ii++)
c[ii] = a[ii];
-// expected-note@+2 {{defined as lastprivate}}
-// expected-error@+2 {{loop iteration variable in the associated loop of 'omp target parallel for simd' directive may not be lastprivate, predetermined as linear}}
+// omp4-note@+2 {{defined as lastprivate}}
+// omp4-error@+2 {{loop iteration variable in the associated loop of 'omp target parallel for simd' directive may not be lastprivate, predetermined as linear}}
#pragma omp target parallel for simd lastprivate(ii)
for (ii = 0; ii < 10; ii++)
c[ii] = a[ii];
@@ -281,7 +283,7 @@
c[globalii] += a[globalii] + ii;
}
-// expected-error@+2 {{statement after '#pragma omp target parallel for simd' must be a for loop}}
+// omp4-error@+2 {{statement after '#pragma omp target parallel for simd' must be a for loop}}
#pragma omp target parallel for simd
for (auto &item : a) {
item = item + 1;
@@ -418,15 +420,15 @@
#pragma omp target parallel for simd
for (begin = end; begin < end; ++begin)
++begin;
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
#pragma omp target parallel for simd
for (GoodIter I = begin; I - I; ++I)
++I;
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
#pragma omp target parallel for simd
for (GoodIter I = begin; begin < end; ++I)
++I;
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
#pragma omp target parallel for simd
for (GoodIter I = begin; !I; ++I)
++I;
diff --git a/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_map_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_map_messages.cpp
index 6f7dc52..b2a8e6b 100644
--- a/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_map_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_map_messages.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-mapping -Wuninitialized
void foo() {
}
@@ -9,6 +9,13 @@
return argc;
}
+void xxx(int argc) {
+ int map; // expected-note {{initialize the variable 'map' to silence this warning}}
+#pragma omp target parallel for simd map(map) // expected-warning {{variable 'map' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
struct S1; // expected-note 2 {{declared here}}
extern S1 a;
class S2 {
diff --git a/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_misc_messages.c b/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_misc_messages.c
index b11f57d..29011a2 100644
--- a/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_misc_messages.c
+++ b/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_misc_messages.c
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=45 -verify=expected,omp45 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -verify=expected,omp50 %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=45 -verify=expected,omp45 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -verify=expected,omp50 %s -Wuninitialized
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp target parallel for simd'}}
#pragma omp target parallel for simd
@@ -495,3 +497,88 @@
for (i = 0; i < 16; ++i)
;
}
+
+void test_nontemporal() {
+ int i;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target parallel for simd'}} expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp target parallel for simd nontemporal(
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target parallel for simd'}} expected-error@+1 2 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp target parallel for simd nontemporal(,
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target parallel for simd'}} expected-error@+1 2 {{expected expression}}
+#pragma omp target parallel for simd nontemporal(, )
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target parallel for simd'}} expected-error@+1 {{expected expression}}
+#pragma omp target parallel for simd nontemporal()
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target parallel for simd'}} expected-error@+1 {{expected expression}}
+#pragma omp target parallel for simd nontemporal(int)
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target parallel for simd'}} omp50-error@+1 {{expected variable name}}
+#pragma omp target parallel for simd nontemporal(0)
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target parallel for simd'}} expected-error@+1 {{use of undeclared identifier 'x'}}
+#pragma omp target parallel for simd nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+// expected-error@+2 {{use of undeclared identifier 'x'}}
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target parallel for simd'}} expected-error@+1 {{use of undeclared identifier 'y'}}
+#pragma omp target parallel for simd nontemporal(x, y)
+ for (i = 0; i < 16; ++i)
+ ;
+// expected-error@+3 {{use of undeclared identifier 'x'}}
+// expected-error@+2 {{use of undeclared identifier 'y'}}
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target parallel for simd'}} expected-error@+1 {{use of undeclared identifier 'z'}}
+#pragma omp target parallel for simd nontemporal(x, y, z)
+ for (i = 0; i < 16; ++i)
+ ;
+
+ int x, y;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target parallel for simd'}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp target parallel for simd nontemporal(x :)
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target parallel for simd'}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}}
+#pragma omp target parallel for simd nontemporal(x :, )
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp50-note@+2 {{defined as nontemporal}}
+// omp45-error@+1 2 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target parallel for simd'}} omp50-error@+1 {{a variable cannot appear in more than one nontemporal clause}}
+#pragma omp target parallel for simd nontemporal(x) nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target parallel for simd'}}
+#pragma omp target parallel for simd private(x) nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target parallel for simd'}}
+#pragma omp target parallel for simd nontemporal(x) private(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target parallel for simd'}} expected-note@+1 {{to match this '('}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}} expected-error@+1 {{expected ')'}}
+#pragma omp target parallel for simd nontemporal(x, y : 0)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target parallel for simd'}}
+#pragma omp target parallel for simd nontemporal(x) lastprivate(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target parallel for simd'}}
+#pragma omp target parallel for simd lastprivate(x) nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+}
+
diff --git a/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_private_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_private_messages.cpp
index 4e0859d..5f54dfa 100644
--- a/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_private_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_private_messages.cpp
@@ -55,7 +55,7 @@
S5(int v) : a(v) {}
S5 &operator=(S5 &s) {
#pragma omp target parallel for simd private(a) private(this->a) private(s.a) // expected-error {{expected variable name or data member of current class}}
- for (int k = 0; k < s.a; ++k) // expected-warning {{Non-trivial type 'S5' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (int k = 0; k < s.a; ++k) // expected-warning {{Type 'S5' is not trivially copyable and not guaranteed to be mapped correctly}}
++s.a;
return *this;
}
diff --git a/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_reduction_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_reduction_messages.cpp
index 126518a..a755046 100644
--- a/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_reduction_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_parallel_for_simd_reduction_messages.cpp
@@ -16,6 +16,13 @@
extern const omp_allocator_handle_t omp_pteam_mem_alloc;
extern const omp_allocator_handle_t omp_thread_mem_alloc;
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp target parallel for simd reduction(+:fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
void foo() {
}
diff --git a/src/llvm-project/clang/test/OpenMP/target_parallel_if_codegen.cpp b/src/llvm-project/clang/test/OpenMP/target_parallel_if_codegen.cpp
index ae86232..b315362 100644
--- a/src/llvm-project/clang/test/OpenMP/target_parallel_if_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_parallel_if_codegen.cpp
@@ -44,13 +44,9 @@
// CHECK-DAG: [[S1:%.+]] = type { double }
// CHECK-DAG: [[ENTTY:%.+]] = type { i8*, i8*, i[[SZ:32|64]], i32, i32 }
-// CHECK-DAG: [[DEVTY:%.+]] = type { i8*, i8*, [[ENTTY]]*, [[ENTTY]]* }
-// CHECK-DAG: [[DSCTY:%.+]] = type { i32, [[DEVTY]]*, [[ENTTY]]*, [[ENTTY]]* }
// TCHECK: [[ENTTY:%.+]] = type { i8*, i8*, i{{32|64}}, i32, i32 }
-// CHECK-DAG: $[[REGFN:\.omp_offloading\..+]] = comdat
-
// We have 6 target regions
// CHECK-DAG: @{{.*}} = weak constant i8 0
@@ -67,16 +63,8 @@
// TCHECK: @{{.+}} = weak constant [[ENTTY]]
// TCHECK: @{{.+}} = weak constant [[ENTTY]]
-// Check if offloading descriptor is created.
-// CHECK: [[ENTBEGIN:@.+]] = external constant [[ENTTY]]
-// CHECK: [[ENTEND:@.+]] = external constant [[ENTTY]]
-// CHECK: [[DEVBEGIN:@.+]] = extern_weak constant i8
-// CHECK: [[DEVEND:@.+]] = extern_weak constant i8
-// CHECK: [[IMAGES:@.+]] = internal unnamed_addr constant [1 x [[DEVTY]]] [{{.+}} { i8* [[DEVBEGIN]], i8* [[DEVEND]], [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }], comdat($[[REGFN]])
-// CHECK: [[DESC:@.+]] = internal constant [[DSCTY]] { i32 1, [[DEVTY]]* getelementptr inbounds ([1 x [[DEVTY]]], [1 x [[DEVTY]]]* [[IMAGES]], i32 0, i32 0), [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }, comdat($[[REGFN]])
-
// Check target registration is registered as a Ctor.
-// CHECK: appending global [2 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }, { i32, void ()*, i8* } { i32 0, void ()* @[[REGFN]], i8* bitcast (void ()* @[[REGFN]] to i8*) }]
+// CHECK: appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }]
template<typename tx>
diff --git a/src/llvm-project/clang/test/OpenMP/target_parallel_if_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_parallel_if_messages.cpp
index ac498a7..2a68fb4 100644
--- a/src/llvm-project/clang/test/OpenMP/target_parallel_if_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_parallel_if_messages.cpp
@@ -59,7 +59,7 @@
foo();
#pragma omp target parallel if(parallel : argc) if (parallel :argc) // expected-error {{directive '#pragma omp target parallel' cannot contain more than one 'if' clause with 'parallel' name modifier}}
foo();
- #pragma omp target parallel if(target : argc) if (argc) // expected-error {{expected 'parallel' directive name modifier}} expected-note {{previous clause with directive name modifier specified here}}
+ #pragma omp target parallel if(target : argc) if (argc) // expected-error {{expected 'parallel' directive name modifier}} expected-note {{previous clause with directive name modifier specified here}}
foo();
#pragma omp target parallel if(target : argc) if(parallel : argc) if (argc) // expected-error {{no more 'if' clause is allowed}} expected-note {{previous clause with directive name modifier specified here}} expected-note {{previous clause with directive name modifier specified here}}
foo();
@@ -105,7 +105,7 @@
foo();
#pragma omp target parallel if(parallel : argc) if (parallel :argc) // expected-error {{directive '#pragma omp target parallel' cannot contain more than one 'if' clause with 'parallel' name modifier}}
foo();
- #pragma omp target parallel if(target : argc) if (argc) // expected-error {{expected 'parallel' directive name modifier}} expected-note {{previous clause with directive name modifier specified here}}
+ #pragma omp target parallel if(target : argc) if (argc) // expected-error {{expected 'parallel' directive name modifier}} expected-note {{previous clause with directive name modifier specified here}}
foo();
#pragma omp target parallel if(target : argc) if(parallel : argc) if (argc) // expected-error {{no more 'if' clause is allowed}} expected-note {{previous clause with directive name modifier specified here}} expected-note {{previous clause with directive name modifier specified here}}
foo();
diff --git a/src/llvm-project/clang/test/OpenMP/target_parallel_map_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_parallel_map_messages.cpp
index a7a4e1c..7d5138a 100644
--- a/src/llvm-project/clang/test/OpenMP/target_parallel_map_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_parallel_map_messages.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wno-openmp-mapping -Wuninitialized
void foo() {
}
@@ -9,6 +9,13 @@
return argc;
}
+void xxx(int argc) {
+ int map; // expected-note {{initialize the variable 'map' to silence this warning}}
+#pragma omp target parallel map(tofrom: map) // expected-warning {{variable 'map' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
struct S1; // expected-note 2 {{declared here}}
extern S1 a;
class S2 {
diff --git a/src/llvm-project/clang/test/OpenMP/target_parallel_num_threads_codegen.cpp b/src/llvm-project/clang/test/OpenMP/target_parallel_num_threads_codegen.cpp
index f3bc5a4..f12248d 100644
--- a/src/llvm-project/clang/test/OpenMP/target_parallel_num_threads_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_parallel_num_threads_codegen.cpp
@@ -44,13 +44,9 @@
// CHECK-DAG: [[S1:%.+]] = type { double }
// CHECK-DAG: [[ENTTY:%.+]] = type { i8*, i8*, i[[SZ:32|64]], i32, i32 }
-// CHECK-DAG: [[DEVTY:%.+]] = type { i8*, i8*, [[ENTTY]]*, [[ENTTY]]* }
-// CHECK-DAG: [[DSCTY:%.+]] = type { i32, [[DEVTY]]*, [[ENTTY]]*, [[ENTTY]]* }
// TCHECK: [[ENTTY:%.+]] = type { i8*, i8*, i{{32|64}}, i32, i32 }
-// CHECK-DAG: $[[REGFN:\.omp_offloading\..+]] = comdat
-
// We have 6 target regions
// CHECK-DAG: @{{.*}} = weak constant i8 0
@@ -67,16 +63,8 @@
// TCHECK: @{{.+}} = weak constant [[ENTTY]]
// TCHECK: @{{.+}} = weak constant [[ENTTY]]
-// Check if offloading descriptor is created.
-// CHECK: [[ENTBEGIN:@.+]] = external constant [[ENTTY]]
-// CHECK: [[ENTEND:@.+]] = external constant [[ENTTY]]
-// CHECK: [[DEVBEGIN:@.+]] = extern_weak constant i8
-// CHECK: [[DEVEND:@.+]] = extern_weak constant i8
-// CHECK: [[IMAGES:@.+]] = internal unnamed_addr constant [1 x [[DEVTY]]] [{{.+}} { i8* [[DEVBEGIN]], i8* [[DEVEND]], [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }], comdat($[[REGFN]])
-// CHECK: [[DESC:@.+]] = internal constant [[DSCTY]] { i32 1, [[DEVTY]]* getelementptr inbounds ([1 x [[DEVTY]]], [1 x [[DEVTY]]]* [[IMAGES]], i32 0, i32 0), [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }, comdat($[[REGFN]])
-
// Check target registration is registered as a Ctor.
-// CHECK: appending global [2 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }, { i32, void ()*, i8* } { i32 0, void ()* @[[REGFN]], i8* bitcast (void ()* @[[REGFN]] to i8*) }]
+// CHECK: appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }]
template<typename tx>
diff --git a/src/llvm-project/clang/test/OpenMP/target_parallel_reduction_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_parallel_reduction_messages.cpp
index 929d6af..ae72f89 100644
--- a/src/llvm-project/clang/test/OpenMP/target_parallel_reduction_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_parallel_reduction_messages.cpp
@@ -16,6 +16,13 @@
extern const omp_allocator_handle_t omp_pteam_mem_alloc;
extern const omp_allocator_handle_t omp_thread_mem_alloc;
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp target parallel reduction(+:fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
void foo() {
}
diff --git a/src/llvm-project/clang/test/OpenMP/target_private_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_private_messages.cpp
index d0db6be..d8d96b5 100644
--- a/src/llvm-project/clang/test/OpenMP/target_private_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_private_messages.cpp
@@ -48,7 +48,7 @@
S5(int v) : a(v) {}
S5 &operator=(S5 &s) {
#pragma omp target private(a) private(this->a) private(s.a) // expected-error {{expected variable name or data member of current class}}
- for (int k = 0; k < s.a; ++k) // expected-warning {{Non-trivial type 'S5' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (int k = 0; k < s.a; ++k) // expected-warning {{Type 'S5' is not trivially copyable and not guaranteed to be mapped correctly}}
++s.a;
return *this;
}
diff --git a/src/llvm-project/clang/test/OpenMP/target_reduction_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_reduction_messages.cpp
index 28c7c95..7417ceb 100644
--- a/src/llvm-project/clang/test/OpenMP/target_reduction_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_reduction_messages.cpp
@@ -16,6 +16,13 @@
extern const omp_allocator_handle_t omp_pteam_mem_alloc;
extern const omp_allocator_handle_t omp_thread_mem_alloc;
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp target reduction(+:fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
void foo() {
}
diff --git a/src/llvm-project/clang/test/OpenMP/target_simd_ast_print.cpp b/src/llvm-project/clang/test/OpenMP/target_simd_ast_print.cpp
index a68dd34..41f8126 100644
--- a/src/llvm-project/clang/test/OpenMP/target_simd_ast_print.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_simd_ast_print.cpp
@@ -1,10 +1,16 @@
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ast-print %s -Wno-openmp-target | FileCheck %s
-// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -DOMP5 -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ast-print %s -Wno-openmp-target | FileCheck %s
-// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50
// expected-no-diagnostics
#ifndef HEADER
@@ -109,9 +115,14 @@
// CHECK-NEXT: for (T i = 0; i < 2; ++i) {
// CHECK-NEXT: }
+#ifdef OMP5
+#pragma omp target simd if(target:argc > 0) if (simd:argc)
+#else
#pragma omp target simd if(target:argc > 0)
+#endif // OMP5
for (T i = 0; i < 2; ++i) {}
- // CHECK: #pragma omp target simd if(target: argc > 0)
+ // OMP45: #pragma omp target simd if(target: argc > 0)
+ // OMP50: #pragma omp target simd if(target: argc > 0) if(simd: argc)
// CHECK-NEXT: for (T i = 0; i < 2; ++i) {
// CHECK-NEXT: }
@@ -230,9 +241,14 @@
// CHECK-NEXT: for (int i = 0; i < 2; ++i) {
// CHECK-NEXT: }
+#ifdef OMP5
+#pragma omp target simd if (target:argc > 0) if(simd:argc) nontemporal(argc, c, d) lastprivate(conditional: d, f)
+#else
#pragma omp target simd if (target:argc > 0)
+#endif // OMP5
for (int i = 0; i < 2; ++i) {}
- // CHECK: #pragma omp target simd if(target: argc > 0)
+ // OMP45: #pragma omp target simd if(target: argc > 0)
+ // OMP50: #pragma omp target simd if(target: argc > 0) if(simd: argc) nontemporal(argc,c,d) lastprivate(conditional: d,f)
// CHECK-NEXT: for (int i = 0; i < 2; ++i) {
// CHECK-NEXT: }
diff --git a/src/llvm-project/clang/test/OpenMP/target_simd_codegen.cpp b/src/llvm-project/clang/test/OpenMP/target_simd_codegen.cpp
index b68745e..597cff7 100644
--- a/src/llvm-project/clang/test/OpenMP/target_simd_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_simd_codegen.cpp
@@ -1,37 +1,65 @@
// Test host codegen.
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-64
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64 --check-prefix OMP45
// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-64
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-32
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64 --check-prefix OMP45
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32 --check-prefix OMP45
// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-32
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32 --check-prefix OMP45
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64 --check-prefix OMP50
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64 --check-prefix OMP50
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32 --check-prefix OMP50
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32 --check-prefix OMP50
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
// Test target codegen - host bc file has to be created first.
// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm-bc %s -o %t-ppc-host.bc
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix TCHECK --check-prefix TCHECK-64
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck %s --check-prefix TCHECK --check-prefix TCHECK-64 --check-prefix TOMP45
// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o %t %s
-// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix TCHECK --check-prefix TCHECK-64
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix TCHECK --check-prefix TCHECK-64 --check-prefix TOMP45
// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm-bc %s -o %t-x86-host.bc
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix TCHECK --check-prefix TCHECK-32
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o - | FileCheck %s --check-prefix TCHECK --check-prefix TCHECK-32 --check-prefix TOMP45
// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o %t %s
-// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix TCHECK --check-prefix TCHECK-32
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix TCHECK --check-prefix TCHECK-32 --check-prefix TOMP45
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm-bc %s -o %t-ppc-host.bc
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck %s --check-prefix TCHECK --check-prefix TCHECK-64 --check-prefix TOMP50
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix TCHECK --check-prefix TCHECK-64 --check-prefix TOMP50
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm-bc %s -o %t-x86-host.bc
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o - | FileCheck %s --check-prefix TCHECK --check-prefix TCHECK-32 --check-prefix TOMP50
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix TCHECK --check-prefix TCHECK-32 --check-prefix TOMP50
// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm-bc %s -o %t-ppc-host.bc
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck --check-prefix SIMD-ONLY1 %s
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY1 %s
// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm-bc %s -o %t-x86-host.bc
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o - | FileCheck --check-prefix SIMD-ONLY1 %s
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm-bc %s -o %t-ppc-host.bc
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm-bc %s -o %t-x86-host.bc
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o - | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY1 %s
// SIMD-ONLY1-NOT: {{__kmpc|__tgt}}
// expected-no-diagnostics
@@ -41,13 +69,9 @@
// CHECK-DAG: [[TT:%.+]] = type { i64, i8 }
// CHECK-DAG: [[S1:%.+]] = type { double }
// CHECK-DAG: [[ENTTY:%.+]] = type { i8*, i8*, i[[SZ:32|64]], i32, i32 }
-// CHECK-DAG: [[DEVTY:%.+]] = type { i8*, i8*, [[ENTTY]]*, [[ENTTY]]* }
-// CHECK-DAG: [[DSCTY:%.+]] = type { i32, [[DEVTY]]*, [[ENTTY]]*, [[ENTTY]]* }
// TCHECK: [[ENTTY:%.+]] = type { i8*, i8*, i{{32|64}}, i32, i32 }
-// CHECK-DAG: $[[REGFN:\.omp_offloading\..+]] = comdat
-
// We have 8 target regions, but only 7 that actually will generate offloading
// code, only 6 will have mapped arguments, and only 4 have all-constant map
// sizes.
@@ -61,7 +85,8 @@
// CHECK-DAG: [[MAPT5:@.+]] = private unnamed_addr constant [3 x i64] [i64 800, i64 800, i64 547]
// CHECK-DAG: [[SIZET6:@.+]] = private unnamed_addr constant [4 x i64] [i64 4, i64 2, i64 1, i64 40]
// CHECK-DAG: [[MAPT6:@.+]] = private unnamed_addr constant [4 x i64] [i64 800, i64 800, i64 800, i64 547]
-// CHECK-DAG: [[MAPT7:@.+]] = private unnamed_addr constant [6 x i64] [i64 32, i64 281474976711171, i64 800, i64 800, i64 800, i64 547]
+// OMP45-DAG: [[MAPT7:@.+]] = private unnamed_addr constant [5 x i64] [i64 547, i64 800, i64 800, i64 800, i64 547]
+// OMP50-DAG: [[MAPT7:@.+]] = private unnamed_addr constant [6 x i64] [i64 547, i64 800, i64 800, i64 800, i64 547, i64 800]
// CHECK-DAG: @{{.*}} = weak constant i8 0
// CHECK-DAG: @{{.*}} = weak constant i8 0
// CHECK-DAG: @{{.*}} = weak constant i8 0
@@ -79,16 +104,8 @@
// TCHECK: @{{.+}} = weak constant [[ENTTY]]
// TCHECK-NOT: @{{.+}} = weak constant [[ENTTY]]
-// Check if offloading descriptor is created.
-// CHECK: [[ENTBEGIN:@.+]] = external constant [[ENTTY]]
-// CHECK: [[ENTEND:@.+]] = external constant [[ENTTY]]
-// CHECK: [[DEVBEGIN:@.+]] = extern_weak constant i8
-// CHECK: [[DEVEND:@.+]] = extern_weak constant i8
-// CHECK: [[IMAGES:@.+]] = internal unnamed_addr constant [1 x [[DEVTY]]] [{{.+}} { i8* [[DEVBEGIN]], i8* [[DEVEND]], [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }], comdat($[[REGFN]])
-// CHECK: [[DESC:@.+]] = internal constant [[DSCTY]] { i32 1, [[DEVTY]]* getelementptr inbounds ([1 x [[DEVTY]]], [1 x [[DEVTY]]]* [[IMAGES]], i32 0, i32 0), [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }, comdat($[[REGFN]])
-
// Check target registration is registered as a Ctor.
-// CHECK: appending global [2 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }, { i32, void ()*, i8* } { i32 0, void ()* @[[REGFN]], i8* bitcast (void ()* @[[REGFN]] to i8*) }]
+// CHECK: appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }]
template<typename tx, typename ty>
@@ -143,8 +160,8 @@
// CHECK-DAG: [[CPADDR1:%.+]] = bitcast i8** [[PADDR1]] to i[[SZ]]*
// CHECK-DAG: store i[[SZ]] [[VAL1:%.+]], i[[SZ]]* [[CBPADDR1]],
// CHECK-DAG: store i[[SZ]] [[VAL1]], i[[SZ]]* [[CPADDR1]],
- // CHECK-DAG: [[BPADDR2:%.+]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[BPR]], i32 0, i32 1
- // CHECK-DAG: [[PADDR2:%.+]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[PR]], i32 0, i32 1
+ // CHECK-DAG: [[BPADDR2:%.+]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[BPR]], i32 0, i32 2
+ // CHECK-DAG: [[PADDR2:%.+]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[PR]], i32 0, i32 2
// CHECK-DAG: [[CBPADDR2:%.+]] = bitcast i8** [[BPADDR2]] to i[[SZ]]*
// CHECK-DAG: [[CPADDR2:%.+]] = bitcast i8** [[PADDR2]] to i[[SZ]]*
// CHECK-DAG: store i[[SZ]] [[VAL2:%.+]], i[[SZ]]* [[CBPADDR2]],
@@ -256,48 +273,48 @@
// The names below are not necessarily consistent with the names used for the
// addresses above as some are repeated.
- // CHECK-DAG: store i[[SZ]] [[VLA0]], i[[SZ]]* [[CBPADDR0:%.+]],
- // CHECK-DAG: store i[[SZ]] [[VLA0]], i[[SZ]]* [[CPADDR0:%.+]],
+ // CHECK-DAG: store i[[SZ]] [[A_CVAL]], i[[SZ]]* [[CBPADDR0:%.+]],
+ // CHECK-DAG: store i[[SZ]] [[A_CVAL]], i[[SZ]]* [[CPADDR0:%.+]],
// CHECK-DAG: [[CBPADDR0]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
// CHECK-DAG: [[CPADDR0]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
- // CHECK-DAG: store i64 {{4|8}}, i64* {{%[^,]+}}
+ // CHECK-DAG: store i64 4, i64* {{%[^,]+}}
- // CHECK-DAG: store i[[SZ]] [[VLA1]], i[[SZ]]* [[CBPADDR1:%.+]],
- // CHECK-DAG: store i[[SZ]] [[VLA1]], i[[SZ]]* [[CPADDR1:%.+]],
- // CHECK-DAG: [[CBPADDR1]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
- // CHECK-DAG: [[CPADDR1]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
- // CHECK-DAG: store i64 {{4|8}}, i64* {{%[^,]+}}
+ // CHECK-DAG: store [10 x float]* %{{.+}}, [10 x float]** [[CBPADDR1:%.+]],
+ // CHECK-DAG: store [10 x float]* %{{.+}}, [10 x float]** [[CPADDR1:%.+]],
+ // CHECK-DAG: [[CBPADDR1]] = bitcast i8** {{%[^,]+}} to [10 x float]**
+ // CHECK-DAG: [[CPADDR1]] = bitcast i8** {{%[^,]+}} to [10 x float]**
+ // CHECK-DAG: store i64 40, i64* {{%[^,]+}}
- // CHECK-DAG: store i[[SZ]] 5, i[[SZ]]* [[CBPADDR2:%.+]],
- // CHECK-DAG: store i[[SZ]] 5, i[[SZ]]* [[CPADDR2:%.+]],
+ // CHECK-DAG: store i[[SZ]] %{{.+}}, i[[SZ]]* [[CBPADDR2:%.+]],
+ // CHECK-DAG: store i[[SZ]] %{{.+}}, i[[SZ]]* [[CPADDR2:%.+]],
// CHECK-DAG: [[CBPADDR2]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
// CHECK-DAG: [[CPADDR2]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
// CHECK-DAG: store i64 {{4|8}}, i64* {{%[^,]+}}
- // CHECK-DAG: store i[[SZ]] [[A_CVAL]], i[[SZ]]* [[CBPADDR3:%.+]],
- // CHECK-DAG: store i[[SZ]] [[A_CVAL]], i[[SZ]]* [[CPADDR3:%.+]],
- // CHECK-DAG: [[CBPADDR3]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
- // CHECK-DAG: [[CPADDR3]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
- // CHECK-DAG: store i64 4, i64* {{%[^,]+}}
-
- // CHECK-DAG: store [10 x float]* %{{.+}}, [10 x float]** [[CBPADDR4:%.+]],
- // CHECK-DAG: store [10 x float]* %{{.+}}, [10 x float]** [[CPADDR4:%.+]],
- // CHECK-DAG: [[CBPADDR4]] = bitcast i8** {{%[^,]+}} to [10 x float]**
- // CHECK-DAG: [[CPADDR4]] = bitcast i8** {{%[^,]+}} to [10 x float]**
- // CHECK-DAG: store i64 40, i64* {{%[^,]+}}
-
- // CHECK-DAG: store float* %{{.+}}, float** [[CBPADDR5:%.+]],
- // CHECK-DAG: store float* %{{.+}}, float** [[CPADDR5:%.+]],
- // CHECK-DAG: [[CBPADDR5]] = bitcast i8** {{%[^,]+}} to float**
- // CHECK-DAG: [[CPADDR5]] = bitcast i8** {{%[^,]+}} to float**
+ // CHECK-DAG: store float* %{{.+}}, float** [[CBPADDR3:%.+]],
+ // CHECK-DAG: store float* %{{.+}}, float** [[CPADDR3:%.+]],
+ // CHECK-DAG: [[CBPADDR3]] = bitcast i8** {{%[^,]+}} to float**
+ // CHECK-DAG: [[CPADDR3]] = bitcast i8** {{%[^,]+}} to float**
// CHECK-DAG: store i64 [[BNSIZE]], i64* {{%[^,]+}}
- // CHECK-DAG: store [5 x [10 x double]]* %{{.+}}, [5 x [10 x double]]** [[CBPADDR6:%.+]],
- // CHECK-DAG: store [5 x [10 x double]]* %{{.+}}, [5 x [10 x double]]** [[CPADDR6:%.+]],
- // CHECK-DAG: [[CBPADDR6]] = bitcast i8** {{%[^,]+}} to [5 x [10 x double]]**
- // CHECK-DAG: [[CPADDR6]] = bitcast i8** {{%[^,]+}} to [5 x [10 x double]]**
+ // CHECK-DAG: store [5 x [10 x double]]* %{{.+}}, [5 x [10 x double]]** [[CBPADDR4:%.+]],
+ // CHECK-DAG: store [5 x [10 x double]]* %{{.+}}, [5 x [10 x double]]** [[CPADDR4:%.+]],
+ // CHECK-DAG: [[CBPADDR4]] = bitcast i8** {{%[^,]+}} to [5 x [10 x double]]**
+ // CHECK-DAG: [[CPADDR4]] = bitcast i8** {{%[^,]+}} to [5 x [10 x double]]**
// CHECK-DAG: store i64 400, i64* {{%[^,]+}}
+ // CHECK-DAG: store i[[SZ]] 5, i[[SZ]]* [[CBPADDR5:%.+]],
+ // CHECK-DAG: store i[[SZ]] 5, i[[SZ]]* [[CPADDR5:%.+]],
+ // CHECK-DAG: [[CBPADDR5]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
+ // CHECK-DAG: [[CPADDR5]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
+ // CHECK-DAG: store i64 {{4|8}}, i64* {{%[^,]+}}
+
+ // CHECK-DAG: store i[[SZ]] %{{.+}}, i[[SZ]]* [[CBPADDR6:%.+]],
+ // CHECK-DAG: store i[[SZ]] %{{.+}}, i[[SZ]]* [[CPADDR6:%.+]],
+ // CHECK-DAG: [[CBPADDR6]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
+ // CHECK-DAG: [[CPADDR6]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
+ // CHECK-DAG: store i64 {{4|8}}, i64* {{%[^,]+}}
+
// CHECK-DAG: store double* %{{.+}}, double** [[CBPADDR7:%.+]],
// CHECK-DAG: store double* %{{.+}}, double** [[CPADDR7:%.+]],
// CHECK-DAG: [[CBPADDR7]] = bitcast i8** {{%[^,]+}} to double**
@@ -444,7 +461,11 @@
int b = n+1;
short int c[2][n];
- #pragma omp target simd if(target: n>60)
+#ifdef OMP5
+ #pragma omp target simd if(n>60) nontemporal(a) private(a)
+#else
+ #pragma omp target simd if(n>60) private(a)
+#endif // OMP5
for (unsigned long long it = 2000; it >= 600; it -= 400) {
this->a = (double)b + 1.5;
c[1][1] = ++a;
@@ -478,15 +499,22 @@
// CHECK: define {{.*}}[[FS1]]
//
// CHECK: i8* @llvm.stacksave()
+// CHECK-32: store i32 %{{.+}}, i32* %__vla_expr
+// OMP50: [[IF:%.+]] = icmp sgt i32 {{[^,]+}}, 60
// CHECK-64: [[B_ADDR:%.+]] = bitcast i[[SZ]]* [[B_CADDR:%.+]] to i32*
// CHECK-64: store i32 %{{.+}}, i32* [[B_ADDR]],
// CHECK-64: [[B_CVAL:%.+]] = load i[[SZ]], i[[SZ]]* [[B_CADDR]],
-// CHECK-32: store i32 %{{.+}}, i32* %__vla_expr
// CHECK-32: store i32 %{{.+}}, i32* [[B_ADDR:%.+]],
// CHECK-32: [[B_CVAL:%.+]] = load i[[SZ]], i[[SZ]]* [[B_ADDR]],
-// CHECK: [[IF:%.+]] = icmp sgt i32 {{[^,]+}}, 60
+// OMP45: [[IF:%.+]] = icmp sgt i32 {{[^,]+}}, 60
+// OMP50: [[TOBOOL:%.+]] = trunc i8 %{{.+}} to i1
+// OMP50: [[CONV:%.+]] = bitcast i[[SZ]]* [[CAP:%.+]] to i8*
+// OMP50: [[FROMBOOL:%.+]] = zext i1 [[TOBOOL]] to i8
+// OMP50: store i8 [[FROMBOOL]], i8* [[CONV]],
+// OMP50: [[SIMD_COND:%.+]] = load i[[SZ]], i[[SZ]]* [[CAP]],
+// OMP50: [[IF:%.+]] = trunc i8 %{{.+}} to i1
// CHECK: br i1 [[IF]], label %[[TRY:[^,]+]], label %[[FAIL:[^,]+]]
// CHECK: [[TRY]]
// We capture 2 VLA sizes in this target region
@@ -495,72 +523,92 @@
// CHECK-32: [[CSZSIZE:%.+]] = mul nuw i32 [[CELEMSIZE2]], 2
// CHECK-32: [[CSIZE:%.+]] = sext i32 [[CSZSIZE]] to i64
-// CHECK-DAG: [[RET:%.+]] = call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 6, i8** [[BPR:%[^,]+]], i8** [[PR:%[^,]+]], i64* [[SR:%[^,]+]], i64* getelementptr inbounds ([6 x i64], [6 x i64]* [[MAPT7]], i32 0, i32 0), i32 1, i32 1)
-// CHECK-DAG: [[BPR]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP:%.+]], i32 0, i32 0
-// CHECK-DAG: [[PR]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P:%.+]], i32 0, i32 0
-// CHECK-DAG: [[SR]] = getelementptr inbounds [6 x i64], [6 x i64]* [[S:%.+]], i32 0, i32 0
-// CHECK-DAG: [[SADDR0:%.+]] = getelementptr inbounds [6 x i64], [6 x i64]* [[S]], i32 [[IDX0:[0-9]+]]
-// CHECK-DAG: [[BPADDR0:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP]], i32 [[IDX0]]
-// CHECK-DAG: [[PADDR0:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P]], i32 [[IDX0]]
-// CHECK-DAG: [[SADDR1:%.+]] = getelementptr inbounds [6 x i64], [6 x i64]* [[S]], i32 [[IDX1:[0-9]+]]
-// CHECK-DAG: [[BPADDR1:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP]], i32 [[IDX1]]
-// CHECK-DAG: [[PADDR1:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P]], i32 [[IDX1]]
-// CHECK-DAG: [[SADDR2:%.+]] = getelementptr inbounds [6 x i64], [6 x i64]* [[S]], i32 [[IDX2:[0-9]+]]
-// CHECK-DAG: [[BPADDR2:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP]], i32 [[IDX2]]
-// CHECK-DAG: [[PADDR2:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P]], i32 [[IDX2]]
-// CHECK-DAG: [[SADDR3:%.+]] = getelementptr inbounds [6 x i64], [6 x i64]* [[S]], i32 [[IDX3:[0-9]+]]
-// CHECK-DAG: [[BPADDR3:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP]], i32 [[IDX3]]
-// CHECK-DAG: [[PADDR3:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P]], i32 [[IDX3]]
-// CHECK-DAG: [[SADDR4:%.+]] = getelementptr inbounds [6 x i64], [6 x i64]* [[S]], i32 [[IDX4:[0-9]+]]
-// CHECK-DAG: [[BPADDR4:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP]], i32 [[IDX4]]
-// CHECK-DAG: [[PADDR4:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P]], i32 [[IDX4]]
-// CHECK-DAG: [[SADDR5:%.+]] = getelementptr inbounds [6 x i64], [6 x i64]* [[S]], i32 [[IDX5:[0-9]+]]
-// CHECK-DAG: [[BPADDR5:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP]], i32 [[IDX5]]
-// CHECK-DAG: [[PADDR5:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P]], i32 [[IDX5]]
+// OMP45-DAG: [[RET:%.+]] = call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 5, i8** [[BPR:%[^,]+]], i8** [[PR:%[^,]+]], i64* [[SR:%[^,]+]], i64* getelementptr inbounds ([5 x i64], [5 x i64]* [[MAPT7]], i32 0, i32 0), i32 1, i32 1)
+// OMP50-DAG: [[RET:%.+]] = call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 6, i8** [[BPR:%[^,]+]], i8** [[PR:%[^,]+]], i64* [[SR:%[^,]+]], i64* getelementptr inbounds ([6 x i64], [6 x i64]* [[MAPT7]], i32 0, i32 0), i32 1, i32 1)
+// OMP45-DAG: [[BPR]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[BP:%.+]], i32 0, i32 0
+// OMP45-DAG: [[PR]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[P:%.+]], i32 0, i32 0
+// OMP45-DAG: [[SR]] = getelementptr inbounds [5 x i64], [5 x i64]* [[S:%.+]], i32 0, i32 0
+// OMP45-DAG: [[SADDR0:%.+]] = getelementptr inbounds [5 x i64], [5 x i64]* [[S]], i32 [[IDX0:[0-9]+]]
+// OMP45-DAG: [[BPADDR0:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[BP]], i32 [[IDX0]]
+// OMP45-DAG: [[PADDR0:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[P]], i32 [[IDX0]]
+// OMP45-DAG: [[SADDR1:%.+]] = getelementptr inbounds [5 x i64], [5 x i64]* [[S]], i32 [[IDX1:[0-9]+]]
+// OMP45-DAG: [[BPADDR1:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[BP]], i32 [[IDX1]]
+// OMP45-DAG: [[PADDR1:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[P]], i32 [[IDX1]]
+// OMP45-DAG: [[SADDR2:%.+]] = getelementptr inbounds [5 x i64], [5 x i64]* [[S]], i32 [[IDX2:[0-9]+]]
+// OMP45-DAG: [[BPADDR2:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[BP]], i32 [[IDX2]]
+// OMP45-DAG: [[PADDR2:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[P]], i32 [[IDX2]]
+// OMP45-DAG: [[SADDR3:%.+]] = getelementptr inbounds [5 x i64], [5 x i64]* [[S]], i32 [[IDX3:[0-9]+]]
+// OMP45-DAG: [[BPADDR3:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[BP]], i32 [[IDX3]]
+// OMP45-DAG: [[PADDR3:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[P]], i32 [[IDX3]]
+// OMP45-DAG: [[SADDR4:%.+]] = getelementptr inbounds [5 x i64], [5 x i64]* [[S]], i32 [[IDX4:[0-9]+]]
+// OMP45-DAG: [[BPADDR4:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[BP]], i32 [[IDX4]]
+// OMP45-DAG: [[PADDR4:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[P]], i32 [[IDX4]]
+// OMP50-DAG: [[BPR]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP:%.+]], i32 0, i32 0
+// OMP50-DAG: [[PR]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P:%.+]], i32 0, i32 0
+// OMP50-DAG: [[SR]] = getelementptr inbounds [6 x i64], [6 x i64]* [[S:%.+]], i32 0, i32 0
+// OMP50-DAG: [[SADDR0:%.+]] = getelementptr inbounds [6 x i64], [6 x i64]* [[S]], i32 [[IDX0:[0-9]+]]
+// OMP50-DAG: [[BPADDR0:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP]], i32 [[IDX0]]
+// OMP50-DAG: [[PADDR0:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P]], i32 [[IDX0]]
+// OMP50-DAG: [[SADDR1:%.+]] = getelementptr inbounds [6 x i64], [6 x i64]* [[S]], i32 [[IDX1:[0-9]+]]
+// OMP50-DAG: [[BPADDR1:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP]], i32 [[IDX1]]
+// OMP50-DAG: [[PADDR1:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P]], i32 [[IDX1]]
+// OMP50-DAG: [[SADDR2:%.+]] = getelementptr inbounds [6 x i64], [6 x i64]* [[S]], i32 [[IDX2:[0-9]+]]
+// OMP50-DAG: [[BPADDR2:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP]], i32 [[IDX2]]
+// OMP50-DAG: [[PADDR2:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P]], i32 [[IDX2]]
+// OMP50-DAG: [[SADDR3:%.+]] = getelementptr inbounds [6 x i64], [6 x i64]* [[S]], i32 [[IDX3:[0-9]+]]
+// OMP50-DAG: [[BPADDR3:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP]], i32 [[IDX3]]
+// OMP50-DAG: [[PADDR3:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P]], i32 [[IDX3]]
+// OMP50-DAG: [[SADDR4:%.+]] = getelementptr inbounds [6 x i64], [6 x i64]* [[S]], i32 [[IDX4:[0-9]+]]
+// OMP50-DAG: [[BPADDR4:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP]], i32 [[IDX4]]
+// OMP50-DAG: [[PADDR4:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P]], i32 [[IDX4]]
+// OMP50-DAG: [[SADDR5:%.+]] = getelementptr inbounds [6 x i64], [6 x i64]* [[S]], i32 [[IDX5:[0-9]+]]
+// OMP50-DAG: [[BPADDR5:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP]], i32 [[IDX5]]
+// OMP50-DAG: [[PADDR5:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P]], i32 [[IDX5]]
// The names below are not necessarily consistent with the names used for the
// addresses above as some are repeated.
-// CHECK-DAG: store i[[SZ]] [[VLA0]], i[[SZ]]* [[CBPADDR0:%.+]],
-// CHECK-DAG: store i[[SZ]] [[VLA0]], i[[SZ]]* [[CPADDR0:%.+]],
-// CHECK-DAG: [[CBPADDR0]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
-// CHECK-DAG: [[CPADDR0]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
+// CHECK-DAG: store [[S1]]* %{{.+}}, [[S1]]** [[CBPADDR0:%.+]],
+// CHECK-DAG: store [[S1]]* %{{.+}}, [[S1]]** [[CPADDR0:%.+]],
+// CHECK-DAG: [[CBPADDR0]] = bitcast i8** {{%[^,]+}} to [[S1]]**
+// CHECK-DAG: [[CPADDR0]] = bitcast i8** {{%[^,]+}} to [[S1]]**
// CHECK-DAG: store i64 {{4|8}}, i64* {{%[^,]+}}
-// CHECK-DAG: store i[[SZ]] 2, i[[SZ]]* [[CBPADDR1:%.+]],
-// CHECK-DAG: store i[[SZ]] 2, i[[SZ]]* [[CPADDR1:%.+]],
+// CHECK-DAG: store i[[SZ]] [[B_CVAL]], i[[SZ]]* [[CBPADDR1:%.+]],
+// CHECK-DAG: store i[[SZ]] [[B_CVAL]], i[[SZ]]* [[CPADDR1:%.+]],
// CHECK-DAG: [[CBPADDR1]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
// CHECK-DAG: [[CPADDR1]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
-// CHECK-DAG: store i64 {{4|8}}, i64* {{%[^,]+}}
-
-// CHECK-DAG: store i[[SZ]] [[B_CVAL]], i[[SZ]]* [[CBPADDR2:%.+]],
-// CHECK-DAG: store i[[SZ]] [[B_CVAL]], i[[SZ]]* [[CPADDR2:%.+]],
-// CHECK-DAG: [[CBPADDR2]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
-// CHECK-DAG: [[CPADDR2]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
// CHECK-DAG: store i64 4, i64* {{%[^,]+}}
-// CHECK-DAG: store [[S1]]* %{{.+}}, [[S1]]** [[CBPADDR3:%.+]],
-// CHECK-DAG: store double* %{{.+}}, double** [[CPADDR3:%.+]],
-// CHECK-DAG: [[CBPADDR3]] = bitcast i8** {{%[^,]+}} to [[S1]]**
-// CHECK-DAG: [[CPADDR3]] = bitcast i8** {{%[^,]+}} to double**
-// CHECK-DAG: store i64 8, i64* {{%[^,]+}}
+// CHECK-DAG: store i[[SZ]] 2, i[[SZ]]* [[CBPADDR2:%.+]],
+// CHECK-DAG: store i[[SZ]] 2, i[[SZ]]* [[CPADDR2:%.+]],
+// CHECK-DAG: [[CBPADDR2]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
+// CHECK-DAG: [[CPADDR2]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
+// CHECK-DAG: store i64 {{4|8}}, i64* {{%[^,]+}}
-// CHECK-DAG: store [[S1]]* %{{.+}}, [[S1]]** [[CBPADDR4:%.+]],
-// CHECK-DAG: store double* %{{.+}}, double** [[CPADDR4:%.+]],
-// CHECK-DAG: [[CBPADDR4]] = bitcast i8** {{%[^,]+}} to [[S1]]**
-// CHECK-DAG: [[CPADDR4]] = bitcast i8** {{%[^,]+}} to double**
-// CHECK-DAG: store i64 8, i64* {{%[^,]+}}
+// CHECK-DAG: store i[[SZ]] %{{.+}}, i[[SZ]]* [[CBPADDR3:%.+]],
+// CHECK-DAG: store i[[SZ]] %{{.+}}, i[[SZ]]* [[CPADDR3:%.+]],
+// CHECK-DAG: [[CBPADDR3]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
+// CHECK-DAG: [[CPADDR3]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
+// CHECK-DAG: store i64 {{4|8}}, i64* {{%[^,]+}}
-// CHECK-DAG: store i16* %{{.+}}, i16** [[CBPADDR5:%.+]],
-// CHECK-DAG: store i16* %{{.+}}, i16** [[CPADDR5:%.+]],
-// CHECK-DAG: [[CBPADDR5]] = bitcast i8** {{%[^,]+}} to i16**
-// CHECK-DAG: [[CPADDR5]] = bitcast i8** {{%[^,]+}} to i16**
+// CHECK-DAG: store i16* %{{.+}}, i16** [[CBPADDR4:%.+]],
+// CHECK-DAG: store i16* %{{.+}}, i16** [[CPADDR4:%.+]],
+// CHECK-DAG: [[CBPADDR4]] = bitcast i8** {{%[^,]+}} to i16**
+// CHECK-DAG: [[CPADDR4]] = bitcast i8** {{%[^,]+}} to i16**
// CHECK-DAG: store i64 [[CSIZE]], i64* {{%[^,]+}}
+// OMP50-DAG: store i[[SZ]] [[SIMD_COND]], i[[SZ]]* [[CBPADDR5:%.+]],
+// OMP50-DAG: store i[[SZ]] [[SIMD_COND]], i[[SZ]]* [[CPADDR5:%.+]],
+// OMP50-DAG: [[CBPADDR5]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
+// OMP50-DAG: [[CPADDR5]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
+// OMP50-DAG: store i64 1, i64* {{%[^,]+}}
+
// CHECK-NEXT: [[ERROR:%.+]] = icmp ne i32 [[RET]], 0
// CHECK-NEXT: br i1 [[ERROR]], label %[[FAIL:[^,]+]], label %[[END:[^,]+]]
// CHECK: [[FAIL]]
-// CHECK: call void [[HVT7:@.+]]({{[^,]+}}, {{[^,]+}}, {{[^,]+}}, {{[^,]+}}, {{[^,]+}})
+// OMP45: call void [[HVT7:@.+]]({{[^,]+}}, {{[^,]+}}, {{[^,]+}}, {{[^,]+}}, {{[^,]+}})
+// OMP50: call void [[HVT7:@.+]]({{[^,]+}}, {{[^,]+}}, {{[^,]+}}, {{[^,]+}}, {{[^,]+}}, {{[^,]+}})
// CHECK-NEXT: br label %[[END]]
// CHECK: [[END]]
@@ -667,6 +715,7 @@
// CHECK: [[LOCAL_VLA1:%.+]] = alloca i[[SZ]]
// CHECK: [[LOCAL_VLA2:%.+]] = alloca i[[SZ]]
// CHECK: [[LOCAL_C:%.+]] = alloca i16*
+// OMP50: [[LOCAL_SIMD_COND_CASTED:%.+]] = alloca i[[SZ]],
// CHECK-DAG: store [[S1]]* [[ARG_THIS:%.+]], [[S1]]** [[LOCAL_THIS]]
// CHECK-DAG: store i[[SZ]] [[ARG_B:%.+]], i[[SZ]]* [[LOCAL_B]]
// CHECK-DAG: store i[[SZ]] [[ARG_VLA1:%.+]], i[[SZ]]* [[LOCAL_VLA1]]
@@ -678,7 +727,13 @@
// CHECK-DAG: [[VAL_VLA1:%.+]] = load i[[SZ]], i[[SZ]]* [[LOCAL_VLA1]],
// CHECK-DAG: [[VAL_VLA2:%.+]] = load i[[SZ]], i[[SZ]]* [[LOCAL_VLA2]],
// CHECK-DAG: [[REF_C:%.+]] = load i16*, i16** [[LOCAL_C]],
-
+// OMP50-DAG: [[CONV_COND:%.+]] = bitcast i[[SZ]]* [[LOCAL_SIMD_COND_CASTED]] to i8*
+// OMP50-DAG: [[SIMD_COND:%.+]] = load i8, i8* [[CONV_COND]],
+// OMP50-DAG: trunc i8 [[SIMD_COND]] to i1
+// OMP45-NOT: !nontemporal
+// OMP50: store double {{.*}}!nontemporal
+// OMP50: load double, {{.*}}!nontemporal
+// OMP50: store double {{.*}}!nontemporal
// CHECK: define internal void [[HVT6]]
// Create local storage for each capture.
@@ -709,4 +764,9 @@
// CHECK-DAG: [[CONV_AAP:%.+]] = bitcast i[[SZ]]* [[LOCAL_AA]] to i16*
// CHECK-DAG: [[REF_B:%.+]] = load [10 x i32]*, [10 x i32]** [[LOCAL_B]],
+// OMP45-NOT: !{!"llvm.loop.vectorize.enable", i1 false}
+// TOMP45-NOT: !{!"llvm.loop.vectorize.enable", i1 false}
+// OMP50: !{!"llvm.loop.vectorize.enable", i1 false}
+// TOMP50: !{!"llvm.loop.vectorize.enable", i1 false}
+
#endif
diff --git a/src/llvm-project/clang/test/OpenMP/target_simd_codegen_registration.cpp b/src/llvm-project/clang/test/OpenMP/target_simd_codegen_registration.cpp
index 2fc3fcb..f756cb4 100644
--- a/src/llvm-project/clang/test/OpenMP/target_simd_codegen_registration.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_simd_codegen_registration.cpp
@@ -52,13 +52,9 @@
// CHECK-DAG: [[ST1:%.+]] = type { [228 x i32] }
// CHECK-DAG: [[ST2:%.+]] = type { [1128 x i32] }
// CHECK-DAG: [[ENTTY:%.+]] = type { i8*, i8*, i[[SZ:32|64]], i32, i32 }
-// CHECK-DAG: [[DEVTY:%.+]] = type { i8*, i8*, [[ENTTY]]*, [[ENTTY]]* }
-// CHECK-DAG: [[DSCTY:%.+]] = type { i32, [[DEVTY]]*, [[ENTTY]]*, [[ENTTY]]* }
// TCHECK: [[ENTTY:%.+]] = type { i8*, i8*, i[[SZ:32|64]], i32, i32 }
-// CHECK-DAG: $[[REGFN:\.omp_offloading\..+]] = comdat
-
// CHECK-DAG: [[A1:@.+]] = internal global [[SA]]
// CHECK-DAG: [[A2:@.+]] = global [[SA]]
// CHECK-DAG: [[B1:@.+]] = global [[SB]]
@@ -123,68 +119,60 @@
// CHECK-NTARGET-NOT: private unnamed_addr constant [1 x i
// CHECK-DAG: [[NAMEPTR1:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME1:__omp_offloading_[0-9a-f]+_[0-9a-f]+__Z.+_l[0-9]+]]\00"
-// CHECK-DAG: [[ENTRY1:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR1]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY1:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR1]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR2:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME2:.+]]\00"
-// CHECK-DAG: [[ENTRY2:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR2]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY2:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR2]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR3:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME3:.+]]\00"
-// CHECK-DAG: [[ENTRY3:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR3]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY3:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR3]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR4:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME4:.+]]\00"
-// CHECK-DAG: [[ENTRY4:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR4]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY4:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR4]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR5:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME5:.+]]\00"
-// CHECK-DAG: [[ENTRY5:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR5]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY5:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR5]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR6:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME6:.+]]\00"
-// CHECK-DAG: [[ENTRY6:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR6]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY6:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR6]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR7:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME7:.+]]\00"
-// CHECK-DAG: [[ENTRY7:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR7]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY7:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR7]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR8:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME8:.+]]\00"
-// CHECK-DAG: [[ENTRY8:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR8]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY8:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR8]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR9:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME9:.+]]\00"
-// CHECK-DAG: [[ENTRY9:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR9]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY9:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR9]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR10:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME10:.+]]\00"
-// CHECK-DAG: [[ENTRY10:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR10]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY10:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR10]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR11:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME11:.+]]\00"
-// CHECK-DAG: [[ENTRY11:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR11]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY11:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR11]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR12:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME12:.+]]\00"
-// CHECK-DAG: [[ENTRY12:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR12]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY12:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR12]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR1:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME1:__omp_offloading_[0-9a-f]+_[0-9a-f]+__Z.+_l[0-9]+]]\00"
-// TCHECK-DAG: [[ENTRY1:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR1]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY1:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR1]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR2:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME2:.+]]\00"
-// TCHECK-DAG: [[ENTRY2:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR2]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY2:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR2]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR3:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME3:.+]]\00"
-// TCHECK-DAG: [[ENTRY3:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR3]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY3:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR3]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR4:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME4:.+]]\00"
-// TCHECK-DAG: [[ENTRY4:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR4]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY4:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR4]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR5:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME5:.+]]\00"
-// TCHECK-DAG: [[ENTRY5:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR5]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY5:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR5]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR6:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME6:.+]]\00"
-// TCHECK-DAG: [[ENTRY6:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR6]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY6:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR6]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR7:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME7:.+]]\00"
-// TCHECK-DAG: [[ENTRY7:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR7]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY7:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR7]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR8:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME8:.+]]\00"
-// TCHECK-DAG: [[ENTRY8:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR8]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY8:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR8]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR9:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME9:.+]]\00"
-// TCHECK-DAG: [[ENTRY9:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR9]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY9:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR9]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR10:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME10:.+]]\00"
-// TCHECK-DAG: [[ENTRY10:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR10]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY10:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR10]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR11:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME11:.+]]\00"
-// TCHECK-DAG: [[ENTRY11:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR11]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY11:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR11]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR12:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME12:.+]]\00"
-// TCHECK-DAG: [[ENTRY12:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR12]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
-
-// CHECK: [[ENTBEGIN:@.+]] = external constant [[ENTTY]]
-// CHECK: [[ENTEND:@.+]] = external constant [[ENTTY]]
-// CHECK: [[DEVBEGIN:@.+]] = extern_weak constant i8
-// CHECK: [[DEVEND:@.+]] = extern_weak constant i8
-// CHECK: [[IMAGES:@.+]] = internal unnamed_addr constant [1 x [[DEVTY]]] [{{.+}} { i8* [[DEVBEGIN]], i8* [[DEVEND]], [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }], comdat($[[REGFN]])
-// CHECK: [[DESC:@.+]] = internal constant [[DSCTY]] { i32 1, [[DEVTY]]* getelementptr inbounds ([1 x [[DEVTY]]], [1 x [[DEVTY]]]* [[IMAGES]], i32 0, i32 0), [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }, comdat($[[REGFN]])
+// TCHECK-DAG: [[ENTRY12:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR12]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// We have 4 initializers, one for the 500 priority, another one for 501, or more for the default priority, and the last one for the offloading registration function.
-// CHECK: @llvm.global_ctors = appending global [5 x { i32, void ()*, i8* }] [
+// CHECK: @llvm.global_ctors = appending global [4 x { i32, void ()*, i8* }] [
// CHECK-SAME: { i32, void ()*, i8* } { i32 500, void ()* [[P500:@[^,]+]], i8* null },
// CHECK-SAME: { i32, void ()*, i8* } { i32 501, void ()* [[P501:@[^,]+]], i8* null },
// CHECK-SAME: { i32, void ()*, i8* } { i32 65535, void ()* [[PMAX:@[^,]+]], i8* null },
-// CHECK-SAME: { i32, void ()*, i8* } { i32 0, void ()* @[[REGFN]], i8* bitcast (void ()* @[[REGFN]] to i8*) }]
// CHECK-NTARGET: @llvm.global_ctors = appending global [3 x { i32, void ()*, i8* }] [
@@ -363,12 +351,8 @@
//TCHECK-DAG: define weak void @[[NAME12]](
// CHECK-NTARGET-NOT: __tgt_target
-// CHECK-NTARGET-NOT: __tgt_register_lib
-// CHECK-NTARGET-NOT: __tgt_unregister_lib
// TCHECK-NOT: __tgt_target
-// TCHECK-NOT: __tgt_register_lib
-// TCHECK-NOT: __tgt_unregister_lib
// We have 2 initializers with priority 500
//CHECK: define internal void [[P500]](
@@ -394,25 +378,6 @@
//CHECK-NOT: call void @{{.+}}()
//CHECK: ret void
-// Check registration and unregistration
-
-//CHECK: define internal void @.omp_offloading.requires_reg()
-//CHECK: call void @__tgt_register_requires(i64 1)
-//CHECK: ret void
-
-//CHECK: define internal void @[[UNREGFN:.+]](i8*)
-//CHECK-SAME: comdat($[[REGFN]]) {
-//CHECK: call i32 @__tgt_unregister_lib([[DSCTY]]* [[DESC]])
-//CHECK: ret void
-//CHECK: declare i32 @__tgt_unregister_lib([[DSCTY]]*)
-
-//CHECK: define linkonce hidden void @[[REGFN]]()
-//CHECK-SAME: comdat {
-//CHECK: call i32 @__tgt_register_lib([[DSCTY]]* [[DESC]])
-//CHECK: call i32 @__cxa_atexit(void (i8*)* @[[UNREGFN]], i8* bitcast ([[DSCTY]]* [[DESC]] to i8*),
-//CHECK: ret void
-//CHECK: declare i32 @__tgt_register_lib([[DSCTY]]*)
-
static __attribute__((init_priority(500))) SA a1;
SA a2;
SB __attribute__((init_priority(500))) b1;
@@ -446,31 +411,31 @@
// Check metadata is properly generated:
// CHECK: !omp_offload.info = !{!{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID:-?[0-9]+]], i32 [[FILEID:-?[0-9]+]], !"_ZN2SB3fooEv", i32 216, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SDD1Ev", i32 268, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SEC1Ev", i32 286, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SED1Ev", i32 293, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EE3fooEv", i32 305, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EEC1Ev", i32 312, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_Z3bari", i32 440, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EED1Ev", i32 319, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EEC1Ev", i32 312, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EED1Ev", i32 319, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EE3fooEv", i32 305, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SCC1Ev", i32 242, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID:-?[0-9]+]], i32 [[FILEID:-?[0-9]+]], !"_ZN2SB3fooEv", i32 204, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SDD1Ev", i32 256, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SEC1Ev", i32 274, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SED1Ev", i32 281, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EE3fooEv", i32 293, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EEC1Ev", i32 300, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_Z3bari", i32 405, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EED1Ev", i32 307, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EEC1Ev", i32 300, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EED1Ev", i32 307, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EE3fooEv", i32 293, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SCC1Ev", i32 230, i32 {{[0-9]+}}}
// TCHECK: !omp_offload.info = !{!{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID:-?[0-9]+]], i32 [[FILEID:-?[0-9]+]], !"_ZN2SB3fooEv", i32 216, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SDD1Ev", i32 268, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SEC1Ev", i32 286, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SED1Ev", i32 293, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EE3fooEv", i32 305, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EEC1Ev", i32 312, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_Z3bari", i32 440, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EED1Ev", i32 319, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EEC1Ev", i32 312, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EED1Ev", i32 319, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EE3fooEv", i32 305, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SCC1Ev", i32 242, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID:-?[0-9]+]], i32 [[FILEID:-?[0-9]+]], !"_ZN2SB3fooEv", i32 204, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SDD1Ev", i32 256, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SEC1Ev", i32 274, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SED1Ev", i32 281, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EE3fooEv", i32 293, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EEC1Ev", i32 300, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_Z3bari", i32 405, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EED1Ev", i32 307, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EEC1Ev", i32 300, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EED1Ev", i32 307, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EE3fooEv", i32 293, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SCC1Ev", i32 230, i32 {{[0-9]+}}}
#endif
diff --git a/src/llvm-project/clang/test/OpenMP/target_simd_defaultmap_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_simd_defaultmap_messages.cpp
index 2284643..cf91cee 100644
--- a/src/llvm-project/clang/test/OpenMP/target_simd_defaultmap_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_simd_defaultmap_messages.cpp
@@ -1,32 +1,34 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 %s -verify=expected,omp5 -Wuninitialized -DOMP5
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 %s -verify=expected,omp5 -Wuninitialized -DOMP5
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 %s -verify=expected,omp45 -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 %s -verify=expected,omp45 -Wuninitialized
void foo() {
}
template <class T, typename S, int N, int ST>
T tmain(T argc, S **argv) {
- int i, k;
+ int i;
#pragma omp target simd defaultmap // expected-error {{expected '(' after 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target simd defaultmap ( // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ #pragma omp target simd defaultmap ( // omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target simd defaultmap () // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
+ #pragma omp target simd defaultmap () // omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target simd defaultmap (tofrom // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+ #pragma omp target simd defaultmap (tofrom // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target simd defaultmap (tofrom: // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+ #pragma omp target simd defaultmap (tofrom: // expected-error {{expected ')'}} expected-note {{to match this '('}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target simd defaultmap (tofrom) // expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+ #pragma omp target simd defaultmap (tofrom) // expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target simd defaultmap (tofrom scalar) // expected-warning {{missing ':' after defaultmap modifier - ignoring}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target simd defaultmap (tofrom, // expected-error {{expected ')'}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-note {{to match this '('}}
+ #pragma omp target simd defaultmap (tofrom, // expected-error {{expected ')'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-note {{to match this '('}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target simd defaultmap (scalar: // expected-error {{expected ')'}} expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
+ #pragma omp target simd defaultmap (scalar: // expected-error {{expected ')'}} omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target simd defaultmap (tofrom, scalar // expected-error {{expected ')'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
+ #pragma omp target simd defaultmap (tofrom, scalar // expected-error {{expected ')'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
return argc;
@@ -36,25 +38,24 @@
int i;
#pragma omp target simd defaultmap // expected-error {{expected '(' after 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target simd defaultmap ( // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ #pragma omp target simd defaultmap ( // omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target simd defaultmap () // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
+ #pragma omp target simd defaultmap () // omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target simd defaultmap (tofrom // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+ #pragma omp target simd defaultmap (tofrom // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target simd defaultmap (tofrom: // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+ #pragma omp target simd defaultmap (tofrom: // expected-error {{expected ')'}} expected-note {{to match this '('}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target simd defaultmap (tofrom) // expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+ #pragma omp target simd defaultmap (tofrom) // expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target simd defaultmap (tofrom scalar) // expected-warning {{missing ':' after defaultmap modifier - ignoring}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target simd defaultmap (tofrom, // expected-error {{expected ')'}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-note {{to match this '('}}
+ #pragma omp target simd defaultmap (tofrom, // expected-error {{expected ')'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-note {{to match this '('}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target simd defaultmap (scalar: // expected-error {{expected ')'}} expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
+ #pragma omp target simd defaultmap (scalar: // expected-error {{expected ')'}} omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target simd defaultmap (tofrom, scalar // expected-error {{expected ')'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
+ #pragma omp target simd defaultmap (tofrom, scalar // expected-error {{expected ')'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
return tmain<int, char, 1, 0>(argc, argv);
}
-
diff --git a/src/llvm-project/clang/test/OpenMP/target_simd_depend_codegen.cpp b/src/llvm-project/clang/test/OpenMP/target_simd_depend_codegen.cpp
index 2287369..0fb75b0 100644
--- a/src/llvm-project/clang/test/OpenMP/target_simd_depend_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_simd_depend_codegen.cpp
@@ -40,13 +40,9 @@
// CHECK-DAG: [[TT:%.+]] = type { i64, i8 }
// CHECK-DAG: [[ENTTY:%.+]] = type { i8*, i8*, i[[SZ:32|64]], i32, i32 }
-// CHECK-DAG: [[DEVTY:%.+]] = type { i8*, i8*, [[ENTTY]]*, [[ENTTY]]* }
-// CHECK-DAG: [[DSCTY:%.+]] = type { i32, [[DEVTY]]*, [[ENTTY]]*, [[ENTTY]]* }
// TCHECK: [[ENTTY:%.+]] = type { i8*, i8*, i{{32|64}}, i32, i32 }
-// CHECK-DAG: $[[REGFN:\.omp_offloading\..+]] = comdat
-
// CHECK-DAG: [[SIZET:@.+]] = private unnamed_addr constant [2 x i64] [i64 0, i64 4]
// CHECK-DAG: [[MAPT:@.+]] = private unnamed_addr constant [2 x i64] [i64 544, i64 800]
// CHECK-DAG: @{{.*}} = weak constant i8 0
@@ -55,16 +51,8 @@
// TCHECK: @{{.+}} = {{.*}}constant [[ENTTY]]
// TCHECK-NOT: @{{.+}} = weak constant [[ENTTY]]
-// Check if offloading descriptor is created.
-// CHECK: [[ENTBEGIN:@.+]] = external constant [[ENTTY]]
-// CHECK: [[ENTEND:@.+]] = external constant [[ENTTY]]
-// CHECK: [[DEVBEGIN:@.+]] = extern_weak constant i8
-// CHECK: [[DEVEND:@.+]] = extern_weak constant i8
-// CHECK: [[IMAGES:@.+]] = internal unnamed_addr constant [1 x [[DEVTY]]] [{{.+}} { i8* [[DEVBEGIN]], i8* [[DEVEND]], [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }], comdat($[[REGFN]])
-// CHECK: [[DESC:@.+]] = internal constant [[DSCTY]] { i32 1, [[DEVTY]]* getelementptr inbounds ([1 x [[DEVTY]]], [1 x [[DEVTY]]]* [[IMAGES]], i32 0, i32 0), [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }, comdat($[[REGFN]])
-
// Check target registration is registered as a Ctor.
-// CHECK: appending global [2 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }, { i32, void ()*, i8* } { i32 0, void ()* @[[REGFN]], i8* bitcast (void ()* @[[REGFN]] to i8*) }]
+// CHECK: appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }]
template<typename tx, typename ty>
@@ -193,7 +181,7 @@
// CHECK: define internal void [[HVT0:@.+]]()
-// CHECK: define internal{{.*}} i32 [[TASK_ENTRY0]](i32{{.*}}, [[TASK_TY0]]* noalias)
+// CHECK: define internal{{.*}} i32 [[TASK_ENTRY0]](i32{{.*}}, [[TASK_TY0]]* noalias %1)
// CHECK: store void (i8*, ...)* null, void (i8*, ...)** %
// CHECK: [[DEVICE_CAP:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 0
// CHECK: [[DEV:%.+]] = load i32, i32* [[DEVICE_CAP]],
@@ -209,7 +197,7 @@
// CHECK: define internal void [[HVT1:@.+]](i[[SZ]]* %{{.+}}, i[[SZ]] %{{.+}})
-// CHECK: define internal{{.*}} i32 [[TASK_ENTRY1_]](i32{{.*}}, [[TASK_TY1_]]* noalias)
+// CHECK: define internal{{.*}} i32 [[TASK_ENTRY1_]](i32{{.*}}, [[TASK_TY1_]]* noalias %1)
// CHECK: call void (i8*, ...) %
// CHECK: [[SZT:%.+]] = getelementptr inbounds [2 x i64], [2 x i64]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0
// CHECK: [[DEVICE_CAP:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 2
@@ -231,7 +219,7 @@
// CHECK: [[END]]
// CHECK: ret i32 0
-// CHECK: define internal{{.*}} i32 [[TASK_ENTRY1__]](i32{{.*}}, [[TASK_TY1__]]* noalias)
+// CHECK: define internal{{.*}} i32 [[TASK_ENTRY1__]](i32{{.*}}, [[TASK_TY1__]]* noalias %1)
// CHECK: call void (i8*, ...) %
// CHECK: [[DEVICE_CAP:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 2
// CHECK: [[BP0:%.+]] = load i[[SZ]]*, i[[SZ]]** %
@@ -251,7 +239,7 @@
// CHECK-64: load i32, i32* [[AA_CADDR]], align
// CHECK-32: load i32, i32* [[AA_ADDR]], align
-// CHECK: define internal{{.*}} i32 [[TASK_ENTRY2]](i32{{.*}}, [[TASK_TY2]]* noalias)
+// CHECK: define internal{{.*}} i32 [[TASK_ENTRY2]](i32{{.*}}, [[TASK_TY2]]* noalias %1)
// CHECK: call void (i8*, ...) %
// CHECK: [[BP1_I32:%.+]] = load i32, i32* %
// CHECK-64: [[BP1_CAST:%.+]] = bitcast i[[SZ]]* [[BP1_PTR:%.+]] to i32*
diff --git a/src/llvm-project/clang/test/OpenMP/target_simd_depend_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_simd_depend_messages.cpp
index c02fac5..b8bb8da 100644
--- a/src/llvm-project/clang/test/OpenMP/target_simd_depend_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_simd_depend_messages.cpp
@@ -69,7 +69,7 @@
for (i = 0; i < argc; ++i) foo();
#pragma omp target simd depend (in : argv[0:-1]) // expected-error {{section length is evaluated to a negative value -1}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target simd depend (in : argv[-1:0]) // OK
+ #pragma omp target simd depend (in : argv[-1:0]) // expected-error {{zero-length array section is not allowed in 'depend' clause}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target simd depend (in : argv[:]) // expected-error {{section length is unspecified and cannot be inferred because subscripted value is not an array}}
for (i = 0; i < argc; ++i) foo();
diff --git a/src/llvm-project/clang/test/OpenMP/target_simd_firstprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_simd_firstprivate_messages.cpp
index 651afdd..e5696c9 100644
--- a/src/llvm-project/clang/test/OpenMP/target_simd_firstprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_simd_firstprivate_messages.cpp
@@ -19,6 +19,13 @@
return argc;
}
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp target simd firstprivate(fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
struct S1; // expected-note 2 {{declared here}} expected-note 2 {{forward declaration of 'S1'}}
extern S1 a;
class S2 {
diff --git a/src/llvm-project/clang/test/OpenMP/target_simd_if_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_simd_if_messages.cpp
index 5f3e9e3..6d63ae1 100644
--- a/src/llvm-project/clang/test/OpenMP/target_simd_if_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_simd_if_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp -fopenmp-version=45 %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp -fopenmp-version=50 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-simd -fopenmp-version=45 %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-simd -fopenmp-version=50 %s -Wuninitialized
void foo() {
}
@@ -50,11 +52,11 @@
for (i = 0; i < argc; ++i) foo();
#pragma omp target simd if(target : argc)
for (i = 0; i < argc; ++i) foo();
- #pragma omp target simd if(target : argc) if (simd:argc) // expected-error {{directive name modifier 'simd' is not allowed for '#pragma omp target simd'}}
+ #pragma omp target simd if(target : argc) if (simd:argc) // omp45-error {{directive name modifier 'simd' is not allowed for '#pragma omp target simd'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target simd if(target : argc) if (target :argc) // expected-error {{directive '#pragma omp target simd' cannot contain more than one 'if' clause with 'target' name modifier}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target simd if(target : argc) if (argc) // expected-note {{previous clause with directive name modifier specified here}} expected-error {{no more 'if' clause is allowed}}
+ #pragma omp target simd if(target : argc) if (argc) // expected-note {{previous clause with directive name modifier specified here}} omp45-error {{no more 'if' clause is allowed}} omp50-error {{expected 'simd' directive name modifier}}
for (i = 0; i < argc; ++i) foo();
return 0;
@@ -90,11 +92,11 @@
for (i = 0; i < argc; ++i) foo();
#pragma omp target simd if(target : argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target simd if(target : argc + z) if (simd:argc) // expected-error {{directive name modifier 'simd' is not allowed for '#pragma omp target simd'}}
+ #pragma omp target simd if(target : argc + z) if (simd:argc) // omp45-error {{directive name modifier 'simd' is not allowed for '#pragma omp target simd'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target simd if(target : argc) if (target :argc) // expected-error {{directive '#pragma omp target simd' cannot contain more than one 'if' clause with 'target' name modifier}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target simd if(target : argc) if (argc) // expected-note {{previous clause with directive name modifier specified here}} expected-error {{no more 'if' clause is allowed}}
+ #pragma omp target simd if(target : argc) if (argc) // expected-note {{previous clause with directive name modifier specified here}} omp45-error {{no more 'if' clause is allowed}} omp50-error {{expected 'simd' directive name modifier}}
for (i = 0; i < argc; ++i) foo();
return tmain(argc, argv);
diff --git a/src/llvm-project/clang/test/OpenMP/target_simd_lastprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_simd_lastprivate_messages.cpp
index 6f1ef52..f9f77c0 100644
--- a/src/llvm-project/clang/test/OpenMP/target_simd_lastprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_simd_lastprivate_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
@@ -80,6 +82,7 @@
I g(5);
int i;
int &j = i;
+ S6 s(0); // omp50-note {{'s' defined here}}
#pragma omp target simd lastprivate // expected-error {{expected '(' after 'lastprivate'}}
for (int k = 0; k < argc; ++k)
++k;
@@ -101,6 +104,12 @@
#pragma omp target simd lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
for (int k = 0; k < argc; ++k)
++k;
+#pragma omp target simd lastprivate(conditional: s,argc) lastprivate(conditional: // omp45-error 2 {{use of undeclared identifier 'conditional'}} omp50-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp50-error {{expected list item of scalar type in 'lastprivate' clause with 'conditional' modifier}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp target simd lastprivate(foo:argc) // omp50-error {{expected 'conditional' in OpenMP clause 'lastprivate'}} omp45-error {{expected ',' or ')' in 'lastprivate' clause}} omp45-error {{expected ')'}} omp45-error {{expected variable name}} omp45-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
#pragma omp target simd lastprivate(S1) // expected-error {{'S1' does not refer to a value}}
for (int k = 0; k < argc; ++k)
++k;
@@ -221,8 +230,8 @@
#pragma omp target simd private(xa), lastprivate(xa) // expected-error {{private variable cannot be lastprivate}} expected-note {{defined as private}}
for (i = 0; i < argc; ++i)
foo();
-#pragma omp target simd lastprivate(i) // expected-note {{defined as lastprivate}}
- for (i = 0; i < argc; ++i) // expected-error {{loop iteration variable in the associated loop of 'omp target simd' directive may not be lastprivate, predetermined as linear}}
+#pragma omp target simd lastprivate(i) // omp45-note {{defined as lastprivate}}
+ for (i = 0; i < argc; ++i) // omp45-error {{loop iteration variable in the associated loop of 'omp target simd' directive may not be lastprivate, predetermined as linear}}
foo();
#pragma omp parallel private(xa)
#pragma omp target simd lastprivate(xa)
diff --git a/src/llvm-project/clang/test/OpenMP/target_simd_linear_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_simd_linear_messages.cpp
index 5a2ef96..2048029 100644
--- a/src/llvm-project/clang/test/OpenMP/target_simd_linear_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_simd_linear_messages.cpp
@@ -12,6 +12,13 @@
extern const omp_allocator_handle_t omp_pteam_mem_alloc;
extern const omp_allocator_handle_t omp_thread_mem_alloc;
+void xxx(int argc) {
+ int i, lin, step; // expected-note {{initialize the variable 'lin' to silence this warning}} expected-note {{initialize the variable 'step' to silence this warning}}
+#pragma omp target simd linear(i, lin : step) // expected-warning {{variable 'lin' is uninitialized when used here}} expected-warning {{variable 'step' is uninitialized when used here}}
+ for (i = 0; i < 10; ++i)
+ ;
+}
+
namespace X {
int x;
};
diff --git a/src/llvm-project/clang/test/OpenMP/target_simd_loop_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_simd_loop_messages.cpp
index e634bd5..3b069b2 100644
--- a/src/llvm-project/clang/test/OpenMP/target_simd_loop_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_simd_loop_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wno-openmp-mapping -Wuninitialized
class S {
int a;
@@ -92,28 +94,28 @@
for (((ii)) = 0; ii < 10; ++ii)
c[ii] = a[ii];
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
#pragma omp target simd
for (int i = 0; i; i++)
c[i] = a[i];
-// expected-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'i'}}
#pragma omp target simd
for (int i = 0; jj < kk; ii++)
c[i] = a[i];
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
#pragma omp target simd
for (int i = 0; !!i; i++)
c[i] = a[i];
-// Ok
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
#pragma omp target simd
for (int i = 0; i != 1; i++)
c[i] = a[i];
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
#pragma omp target simd
for (int i = 0;; i++)
c[i] = a[i];
@@ -249,14 +251,14 @@
for (ii = 0; ii < 10; ii++)
c[ii] = a[ii];
-// expected-note@+2 {{defined as private}}
-// expected-error@+2 {{loop iteration variable in the associated loop of 'omp target simd' directive may not be private, predetermined as linear}}
+// omp4-note@+2 {{defined as private}}
+// omp4-error@+2 {{loop iteration variable in the associated loop of 'omp target simd' directive may not be private, predetermined as linear}}
#pragma omp target simd private(ii)
for (ii = 0; ii < 10; ii++)
c[ii] = a[ii];
-// expected-note@+2 {{defined as lastprivate}}
-// expected-error@+2 {{loop iteration variable in the associated loop of 'omp target simd' directive may not be lastprivate, predetermined as linear}}
+// omp4-note@+2 {{defined as lastprivate}}
+// omp4-error@+2 {{loop iteration variable in the associated loop of 'omp target simd' directive may not be lastprivate, predetermined as linear}}
#pragma omp target simd lastprivate(ii)
for (ii = 0; ii < 10; ii++)
c[ii] = a[ii];
@@ -281,7 +283,7 @@
c[globalii] += a[globalii] + ii;
}
-// expected-error@+2 {{statement after '#pragma omp target simd' must be a for loop}}
+// omp4-error@+2 {{statement after '#pragma omp target simd' must be a for loop}}
#pragma omp target simd
for (auto &item : a) {
item = item + 1;
@@ -418,15 +420,15 @@
#pragma omp target simd
for (begin = end; begin < end; ++begin)
++begin;
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
#pragma omp target simd
for (GoodIter I = begin; I - I; ++I)
++I;
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
#pragma omp target simd
for (GoodIter I = begin; begin < end; ++I)
++I;
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
#pragma omp target simd
for (GoodIter I = begin; !I; ++I)
++I;
diff --git a/src/llvm-project/clang/test/OpenMP/target_simd_map_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_simd_map_messages.cpp
index a93d20e..29074b6 100644
--- a/src/llvm-project/clang/test/OpenMP/target_simd_map_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_simd_map_messages.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-mapping -Wuninitialized
void foo() {
}
@@ -9,6 +9,13 @@
return argc;
}
+void xxx(int argc) {
+ int map; // expected-note {{initialize the variable 'map' to silence this warning}}
+#pragma omp target simd map(to: map) // expected-warning {{variable 'map' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
struct S1; // expected-note 2 {{declared here}}
extern S1 a;
class S2 {
diff --git a/src/llvm-project/clang/test/OpenMP/target_simd_misc_messages.c b/src/llvm-project/clang/test/OpenMP/target_simd_misc_messages.c
index 83d73fa..36bbb22 100644
--- a/src/llvm-project/clang/test/OpenMP/target_simd_misc_messages.c
+++ b/src/llvm-project/clang/test/OpenMP/target_simd_misc_messages.c
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=45 -verify=expected,omp45 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -verify=expected,omp50 %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=45 -verify=expected,omp45 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -verify=expected,omp50 %s -Wuninitialized
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp target simd'}}
#pragma omp target simd
@@ -485,3 +487,88 @@
for (i = 0; i < 16; ++i)
;
}
+
+void test_nontemporal() {
+ int i;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target simd'}} expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp target simd nontemporal(
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target simd'}} expected-error@+1 2 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp target simd nontemporal(,
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target simd'}} expected-error@+1 2 {{expected expression}}
+#pragma omp target simd nontemporal(, )
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target simd'}} expected-error@+1 {{expected expression}}
+#pragma omp target simd nontemporal()
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target simd'}} expected-error@+1 {{expected expression}}
+#pragma omp target simd nontemporal(int)
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target simd'}} omp50-error@+1 {{expected variable name}}
+#pragma omp target simd nontemporal(0)
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target simd'}} expected-error@+1 {{use of undeclared identifier 'x'}}
+#pragma omp target simd nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+// expected-error@+2 {{use of undeclared identifier 'x'}}
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target simd'}} expected-error@+1 {{use of undeclared identifier 'y'}}
+#pragma omp target simd nontemporal(x, y)
+ for (i = 0; i < 16; ++i)
+ ;
+// expected-error@+3 {{use of undeclared identifier 'x'}}
+// expected-error@+2 {{use of undeclared identifier 'y'}}
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target simd'}} expected-error@+1 {{use of undeclared identifier 'z'}}
+#pragma omp target simd nontemporal(x, y, z)
+ for (i = 0; i < 16; ++i)
+ ;
+
+ int x, y;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target simd'}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp target simd nontemporal(x :)
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target simd'}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}}
+#pragma omp target simd nontemporal(x :, )
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp50-note@+2 {{defined as nontemporal}}
+// omp45-error@+1 2 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target simd'}} omp50-error@+1 {{a variable cannot appear in more than one nontemporal clause}}
+#pragma omp target simd nontemporal(x) nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target simd'}}
+#pragma omp target simd private(x) nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target simd'}}
+#pragma omp target simd nontemporal(x) private(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target simd'}} expected-note@+1 {{to match this '('}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}} expected-error@+1 {{expected ')'}}
+#pragma omp target simd nontemporal(x, y : 0)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target simd'}}
+#pragma omp target simd nontemporal(x) lastprivate(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target simd'}}
+#pragma omp target simd lastprivate(x) nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+}
+
diff --git a/src/llvm-project/clang/test/OpenMP/target_simd_private_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_simd_private_messages.cpp
index e1b9585..4473286 100644
--- a/src/llvm-project/clang/test/OpenMP/target_simd_private_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_simd_private_messages.cpp
@@ -55,7 +55,7 @@
S5(int v) : a(v) {}
S5 &operator=(S5 &s) {
#pragma omp target simd private(a) private(this->a) private(s.a) // expected-error {{expected variable name or data member of current class}}
- for (int k = 0; k < s.a; ++k) // expected-warning {{Non-trivial type 'S5' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (int k = 0; k < s.a; ++k) // expected-warning {{Type 'S5' is not trivially copyable and not guaranteed to be mapped correctly}}
++s.a;
return *this;
}
diff --git a/src/llvm-project/clang/test/OpenMP/target_simd_reduction_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_simd_reduction_messages.cpp
index 5510994..57663ef 100644
--- a/src/llvm-project/clang/test/OpenMP/target_simd_reduction_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_simd_reduction_messages.cpp
@@ -16,6 +16,13 @@
extern const omp_allocator_handle_t omp_pteam_mem_alloc;
extern const omp_allocator_handle_t omp_thread_mem_alloc;
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp target simd reduction(+:fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
void foo() {
}
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_codegen.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_codegen.cpp
index 4713f07..028cfc5 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_codegen.cpp
@@ -45,13 +45,9 @@
// CHECK-DAG: [[TT:%.+]] = type { i64, i8 }
// CHECK-DAG: [[S1:%.+]] = type { double }
// CHECK-DAG: [[ENTTY:%.+]] = type { i8*, i8*, i[[SZ:32|64]], i32, i32 }
-// CHECK-DAG: [[DEVTY:%.+]] = type { i8*, i8*, [[ENTTY]]*, [[ENTTY]]* }
-// CHECK-DAG: [[DSCTY:%.+]] = type { i32, [[DEVTY]]*, [[ENTTY]]*, [[ENTTY]]* }
// TCHECK: [[ENTTY:%.+]] = type { i8*, i8*, i{{32|64}}, i32, i32 }
-// CHECK-DAG: $[[REGFN:\.omp_offloading\..+]] = comdat
-
// We have 8 target regions, but only 6 that actually will generate offloading
// code and have mapped arguments, and only 4 have all-constant map sizes.
@@ -86,18 +82,11 @@
// TCHECK: @{{.+}} = weak constant [[ENTTY]]
// TCHECK: @{{.+}} = weak constant [[ENTTY]]
// TCHECK: @{{.+}} = weak constant [[ENTTY]]
+// TCHECK: @{{.+}} = weak constant [[ENTTY]]
// TCHECK-NOT: @{{.+}} = weak constant [[ENTTY]]
-// Check if offloading descriptor is created.
-// CHECK: [[ENTBEGIN:@.+]] = external constant [[ENTTY]]
-// CHECK: [[ENTEND:@.+]] = external constant [[ENTTY]]
-// CHECK: [[DEVBEGIN:@.+]] = extern_weak constant i8
-// CHECK: [[DEVEND:@.+]] = extern_weak constant i8
-// CHECK: [[IMAGES:@.+]] = internal unnamed_addr constant [1 x [[DEVTY]]] [{{.+}} { i8* [[DEVBEGIN]], i8* [[DEVEND]], [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }], comdat($[[REGFN]])
-// CHECK: [[DESC:@.+]] = internal constant [[DSCTY]] { i32 1, [[DEVTY]]* getelementptr inbounds ([1 x [[DEVTY]]], [1 x [[DEVTY]]]* [[IMAGES]], i32 0, i32 0), [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }, comdat($[[REGFN]])
-
// Check target registration is registered as a Ctor.
-// CHECK: appending global [2 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }, { i32, void ()*, i8* } { i32 0, void ()* @[[REGFN]], i8* bitcast (void ()* @[[REGFN]] to i8*) }]
+// CHECK: appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }]
template<typename tx, typename ty>
@@ -341,6 +330,13 @@
d.Y += 1;
}
+ const int nn = 0;
+ #pragma omp target teams shared(nn)
+ #pragma omp parallel firstprivate(nn)
+ (void)nn;
+ #pragma omp target teams firstprivate(nn)
+ #pragma omp parallel shared(nn)
+ (void)nn;
return a;
}
@@ -481,6 +477,19 @@
// CHECK: define internal {{.*}}void [[OMP_OUTLINED4]](i32* noalias %.global_tid., i32* noalias %.bound_tid., i[[SZ]] %{{.+}}, [10 x float]* {{.+}}, i[[SZ]] %{{.+}}, float* {{.+}}, [5 x [10 x double]]* {{.+}}, i[[SZ]] %{{.+}}, i[[SZ]] %{{.+}}, double* {{.+}}, [[TT]]* {{.+}})
// To reduce complexity, we're only going as far as validating the signature of the outlined parallel function.
+// CHECK: define {{.*}}void @__omp_offloading_{{.*}}foo{{.*}}_l334(i[[SZ]] %{{.+}})
+// CHECK: define internal void {{@.+}}(i32* {{.+}}, i32* {{.+}}, i[[SZ]] %{{.+}})
+// CHECK: define {{.*}}void @__omp_offloading_{{.*}}foo{{.*}}_l337(i[[SZ]] %{{.+}})
+// CHECK: define internal void {{@.+}}(i32* {{.+}}, i32* {{.+}}, i32* dereferenceable{{.+}})
+
+void bazzzz(int n, int f[n]) {
+// CHECK: define internal void @__omp_offloading_{{.+}}bazzzz{{.+}}_l489(i[[SZ]] %{{[^,]+}})
+// CHECK: [[VLA:%.+]] = load i[[SZ]], i[[SZ]]* %
+// CHECK: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_teams(%struct.ident_t* @{{.+}}, i32 1, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i[[SZ]])* @{{.+}} to void (i32*, i32*, ...)*), i[[SZ]] [[VLA]])
+#pragma omp target teams private(f)
+ ;
+}
+
template<typename tx>
tx ftemplate(int n) {
tx a = 0;
@@ -846,21 +855,4 @@
// CHECK: define internal {{.*}}void [[OMP_OUTLINED7]](i32* noalias %.global_tid., i32* noalias %.bound_tid., i[[SZ]] %{{.+}}, i[[SZ]] %{{.+}}, [10 x i32]* {{.+}})
// To reduce complexity, we're only going as far as validating the signature of the outlined parallel function.
-void foo1() {
- const int n = 0;
- #pragma omp target teams shared(n)
- #pragma omp parallel firstprivate(n)
- (void)n;
-}
-void foo() {
- const int n = 0;
- #pragma omp target teams firstprivate(n)
- #pragma omp parallel shared(n)
- (void)n;
-}
-
-// define {{.*}}void @__omp_offloading_{{.*}}foo1{{.*}}_l841(i[[SZ]] %{{.+}})
-// define internal void {{@.+}}(i32* {{.+}}, i32* {{.+}}, i[[SZ]] %{{.+}})
-// define {{.*}}void @__omp_offloading_{{.*}}foo1{{.*}}_l847(i[[SZ]] %{{.+}})
-// define internal void {{@.+}}(i32* {{.+}}, i32* {{.+}}, i32* dereferenceable{{.+}})
#endif
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_codegen_registration.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_codegen_registration.cpp
index 0c14ff2..e29843b 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_codegen_registration.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_codegen_registration.cpp
@@ -52,13 +52,9 @@
// CHECK-DAG: [[ST1:%.+]] = type { [228 x i32] }
// CHECK-DAG: [[ST2:%.+]] = type { [1128 x i32] }
// CHECK-DAG: [[ENTTY:%.+]] = type { i8*, i8*, i[[SZ:32|64]], i32, i32 }
-// CHECK-DAG: [[DEVTY:%.+]] = type { i8*, i8*, [[ENTTY]]*, [[ENTTY]]* }
-// CHECK-DAG: [[DSCTY:%.+]] = type { i32, [[DEVTY]]*, [[ENTTY]]*, [[ENTTY]]* }
// TCHECK: [[ENTTY:%.+]] = type { i8*, i8*, i[[SZ:32|64]], i32, i32 }
-// CHECK-DAG: $[[REGFN:\.omp_offloading\..+]] = comdat
-
// CHECK-DAG: [[A1:@.+]] = internal global [[SA]]
// CHECK-DAG: [[A2:@.+]] = global [[SA]]
// CHECK-DAG: [[B1:@.+]] = global [[SB]]
@@ -123,68 +119,60 @@
// CHECK-NTARGET-NOT: private unnamed_addr constant [1 x i
// CHECK-DAG: [[NAMEPTR1:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME1:__omp_offloading_[0-9a-f]+_[0-9a-f]+__Z.+_l[0-9]+]]\00"
-// CHECK-DAG: [[ENTRY1:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR1]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY1:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR1]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR2:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME2:.+]]\00"
-// CHECK-DAG: [[ENTRY2:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR2]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY2:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR2]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR3:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME3:.+]]\00"
-// CHECK-DAG: [[ENTRY3:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR3]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY3:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR3]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR4:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME4:.+]]\00"
-// CHECK-DAG: [[ENTRY4:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR4]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY4:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR4]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR5:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME5:.+]]\00"
-// CHECK-DAG: [[ENTRY5:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR5]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY5:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR5]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR6:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME6:.+]]\00"
-// CHECK-DAG: [[ENTRY6:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR6]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY6:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR6]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR7:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME7:.+]]\00"
-// CHECK-DAG: [[ENTRY7:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR7]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY7:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR7]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR8:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME8:.+]]\00"
-// CHECK-DAG: [[ENTRY8:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR8]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY8:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR8]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR9:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME9:.+]]\00"
-// CHECK-DAG: [[ENTRY9:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR9]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY9:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR9]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR10:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME10:.+]]\00"
-// CHECK-DAG: [[ENTRY10:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR10]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY10:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR10]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR11:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME11:.+]]\00"
-// CHECK-DAG: [[ENTRY11:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR11]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY11:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR11]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR12:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME12:.+]]\00"
-// CHECK-DAG: [[ENTRY12:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR12]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY12:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR12]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR1:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME1:__omp_offloading_[0-9a-f]+_[0-9a-f]+__Z.+_l[0-9]+]]\00"
-// TCHECK-DAG: [[ENTRY1:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR1]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY1:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR1]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR2:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME2:.+]]\00"
-// TCHECK-DAG: [[ENTRY2:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR2]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY2:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR2]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR3:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME3:.+]]\00"
-// TCHECK-DAG: [[ENTRY3:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR3]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY3:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR3]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR4:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME4:.+]]\00"
-// TCHECK-DAG: [[ENTRY4:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR4]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY4:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR4]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR5:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME5:.+]]\00"
-// TCHECK-DAG: [[ENTRY5:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR5]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY5:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR5]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR6:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME6:.+]]\00"
-// TCHECK-DAG: [[ENTRY6:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR6]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY6:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR6]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR7:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME7:.+]]\00"
-// TCHECK-DAG: [[ENTRY7:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR7]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY7:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR7]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR8:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME8:.+]]\00"
-// TCHECK-DAG: [[ENTRY8:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR8]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY8:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR8]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR9:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME9:.+]]\00"
-// TCHECK-DAG: [[ENTRY9:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR9]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY9:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR9]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR10:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME10:.+]]\00"
-// TCHECK-DAG: [[ENTRY10:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR10]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY10:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR10]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR11:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME11:.+]]\00"
-// TCHECK-DAG: [[ENTRY11:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR11]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY11:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR11]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR12:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME12:.+]]\00"
-// TCHECK-DAG: [[ENTRY12:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR12]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
-
-// CHECK: [[ENTBEGIN:@.+]] = external constant [[ENTTY]]
-// CHECK: [[ENTEND:@.+]] = external constant [[ENTTY]]
-// CHECK: [[DEVBEGIN:@.+]] = extern_weak constant i8
-// CHECK: [[DEVEND:@.+]] = extern_weak constant i8
-// CHECK: [[IMAGES:@.+]] = internal unnamed_addr constant [1 x [[DEVTY]]] [{{.+}} { i8* [[DEVBEGIN]], i8* [[DEVEND]], [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }], comdat($[[REGFN]])
-// CHECK: [[DESC:@.+]] = internal constant [[DSCTY]] { i32 1, [[DEVTY]]* getelementptr inbounds ([1 x [[DEVTY]]], [1 x [[DEVTY]]]* [[IMAGES]], i32 0, i32 0), [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }, comdat($[[REGFN]])
+// TCHECK-DAG: [[ENTRY12:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR12]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// We have 4 initializers, one for the 500 priority, another one for 501, or more for the default priority, and the last one for the offloading registration function.
-// CHECK: @llvm.global_ctors = appending global [5 x { i32, void ()*, i8* }] [
+// CHECK: @llvm.global_ctors = appending global [4 x { i32, void ()*, i8* }] [
// CHECK-SAME: { i32, void ()*, i8* } { i32 500, void ()* [[P500:@[^,]+]], i8* null },
// CHECK-SAME: { i32, void ()*, i8* } { i32 501, void ()* [[P501:@[^,]+]], i8* null },
// CHECK-SAME: { i32, void ()*, i8* } { i32 65535, void ()* [[PMAX:@[^,]+]], i8* null },
-// CHECK-SAME: { i32, void ()*, i8* } { i32 0, void ()* @[[REGFN]], i8* bitcast (void ()* @[[REGFN]] to i8*) }]
// CHECK-NTARGET: @llvm.global_ctors = appending global [3 x { i32, void ()*, i8* }] [
@@ -354,12 +342,8 @@
//TCHECK-DAG: define weak void @[[NAME12]](
// CHECK-NTARGET-NOT: __tgt_target
-// CHECK-NTARGET-NOT: __tgt_register_lib
-// CHECK-NTARGET-NOT: __tgt_unregister_lib
// TCHECK-NOT: __tgt_target
-// TCHECK-NOT: __tgt_register_lib
-// TCHECK-NOT: __tgt_unregister_lib
// We have 2 initializers with priority 500
//CHECK: define internal void [[P500]](
@@ -385,25 +369,6 @@
//CHECK-NOT: call void @{{.+}}()
//CHECK: ret void
-// Check registration and unregistration
-
-//CHECK: define internal void @.omp_offloading.requires_reg()
-//CHECK: call void @__tgt_register_requires(i64 1)
-//CHECK: ret void
-
-//CHECK: define internal void @[[UNREGFN:.+]](i8*)
-//CHECK-SAME: comdat($[[REGFN]]) {
-//CHECK: call i32 @__tgt_unregister_lib([[DSCTY]]* [[DESC]])
-//CHECK: ret void
-//CHECK: declare i32 @__tgt_unregister_lib([[DSCTY]]*)
-
-//CHECK: define linkonce hidden void @[[REGFN]]()
-//CHECK-SAME: comdat {
-//CHECK: call i32 @__tgt_register_lib([[DSCTY]]* [[DESC]])
-//CHECK: call i32 @__cxa_atexit(void (i8*)* @[[UNREGFN]], i8* bitcast ([[DSCTY]]* [[DESC]] to i8*),
-//CHECK: ret void
-//CHECK: declare i32 @__tgt_register_lib([[DSCTY]]*)
-
static __attribute__((init_priority(500))) SA a1;
SA a2;
SB __attribute__((init_priority(500))) b1;
@@ -436,31 +401,31 @@
// Check metadata is properly generated:
// CHECK: !omp_offload.info = !{!{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID:-?[0-9]+]], i32 [[FILEID:-?[0-9]+]], !"_ZN2SB3fooEv", i32 216, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SDD1Ev", i32 266, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SEC1Ev", i32 282, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SED1Ev", i32 288, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EE3fooEv", i32 299, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EEC1Ev", i32 305, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_Z3bari", i32 431, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EED1Ev", i32 311, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EEC1Ev", i32 305, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EED1Ev", i32 311, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EE3fooEv", i32 299, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SCC1Ev", i32 241, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID:-?[0-9]+]], i32 [[FILEID:-?[0-9]+]], !"_ZN2SB3fooEv", i32 204, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SDD1Ev", i32 254, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SEC1Ev", i32 270, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SED1Ev", i32 276, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EE3fooEv", i32 287, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EEC1Ev", i32 293, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_Z3bari", i32 396, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EED1Ev", i32 299, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EEC1Ev", i32 293, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EED1Ev", i32 299, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EE3fooEv", i32 287, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SCC1Ev", i32 229, i32 {{[0-9]+}}}
// TCHECK: !omp_offload.info = !{!{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID:-?[0-9]+]], i32 [[FILEID:-?[0-9]+]], !"_ZN2SB3fooEv", i32 216, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SDD1Ev", i32 266, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SEC1Ev", i32 282, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SED1Ev", i32 288, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EE3fooEv", i32 299, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EEC1Ev", i32 305, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_Z3bari", i32 431, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EED1Ev", i32 311, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EEC1Ev", i32 305, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EED1Ev", i32 311, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EE3fooEv", i32 299, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SCC1Ev", i32 241, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID:-?[0-9]+]], i32 [[FILEID:-?[0-9]+]], !"_ZN2SB3fooEv", i32 204, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SDD1Ev", i32 254, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SEC1Ev", i32 270, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SED1Ev", i32 276, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EE3fooEv", i32 287, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EEC1Ev", i32 293, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_Z3bari", i32 396, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EED1Ev", i32 299, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EEC1Ev", i32 293, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EED1Ev", i32 299, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EE3fooEv", i32 287, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SCC1Ev", i32 229, i32 {{[0-9]+}}}
#endif
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_defaultmap_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_defaultmap_messages.cpp
index 36966bc..4c8358d 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_defaultmap_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_defaultmap_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 %s -verify=expected,omp5 -Wuninitialized -DOMP5
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 %s -verify=expected,omp5 -Wuninitialized -DOMP5
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 %s -verify=expected,omp45 -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 %s -verify=expected,omp45 -Wuninitialized
void foo() {
}
@@ -9,23 +11,23 @@
T tmain(T argc, S **argv) {
#pragma omp target teams defaultmap // expected-error {{expected '(' after 'defaultmap'}}
foo();
- #pragma omp target teams defaultmap ( // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ #pragma omp target teams defaultmap ( // omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target teams defaultmap () // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
+ #pragma omp target teams defaultmap () // omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target teams defaultmap (tofrom // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+ #pragma omp target teams defaultmap (tofrom // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target teams defaultmap (tofrom: // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+ #pragma omp target teams defaultmap (tofrom: // expected-error {{expected ')'}} expected-note {{to match this '('}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target teams defaultmap (tofrom) // expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+ #pragma omp target teams defaultmap (tofrom) // expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
foo();
#pragma omp target teams defaultmap (tofrom scalar) // expected-warning {{missing ':' after defaultmap modifier - ignoring}}
foo();
- #pragma omp target teams defaultmap (tofrom, // expected-error {{expected ')'}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-note {{to match this '('}}
+ #pragma omp target teams defaultmap (tofrom, // expected-error {{expected ')'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-note {{to match this '('}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target teams defaultmap (scalar: // expected-error {{expected ')'}} expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
+ #pragma omp target teams defaultmap (scalar: // expected-error {{expected ')'}} omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target teams defaultmap (tofrom, scalar // expected-error {{expected ')'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
+ #pragma omp target teams defaultmap (tofrom, scalar // expected-error {{expected ')'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
foo();
return argc;
@@ -34,25 +36,24 @@
int main(int argc, char **argv) {
#pragma omp target teams defaultmap // expected-error {{expected '(' after 'defaultmap'}}
foo();
- #pragma omp target teams defaultmap ( // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ #pragma omp target teams defaultmap ( // omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target teams defaultmap () // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
+ #pragma omp target teams defaultmap () // omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target teams defaultmap (tofrom // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+ #pragma omp target teams defaultmap (tofrom // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target teams defaultmap (tofrom: // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+ #pragma omp target teams defaultmap (tofrom: // expected-error {{expected ')'}} expected-note {{to match this '('}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target teams defaultmap (tofrom) // expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+ #pragma omp target teams defaultmap (tofrom) // expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
foo();
#pragma omp target teams defaultmap (tofrom scalar) // expected-warning {{missing ':' after defaultmap modifier - ignoring}}
foo();
- #pragma omp target teams defaultmap (tofrom, // expected-error {{expected ')'}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-note {{to match this '('}}
+ #pragma omp target teams defaultmap (tofrom, // expected-error {{expected ')'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-note {{to match this '('}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target teams defaultmap (scalar: // expected-error {{expected ')'}} expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
+ #pragma omp target teams defaultmap (scalar: // expected-error {{expected ')'}} omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
foo();
- #pragma omp target teams defaultmap (tofrom, scalar // expected-error {{expected ')'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
+ #pragma omp target teams defaultmap (tofrom, scalar // expected-error {{expected ')'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
foo();
return tmain<int, char, 1, 0>(argc, argv);
}
-
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_depend_codegen.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_depend_codegen.cpp
index fab160e..85fc5e2 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_depend_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_depend_codegen.cpp
@@ -40,13 +40,9 @@
// CHECK-DAG: [[TT:%.+]] = type { i64, i8 }
// CHECK-DAG: [[ENTTY:%.+]] = type { i8*, i8*, i[[SZ:32|64]], i32, i32 }
-// CHECK-DAG: [[DEVTY:%.+]] = type { i8*, i8*, [[ENTTY]]*, [[ENTTY]]* }
-// CHECK-DAG: [[DSCTY:%.+]] = type { i32, [[DEVTY]]*, [[ENTTY]]*, [[ENTTY]]* }
// TCHECK: [[ENTTY:%.+]] = type { i8*, i8*, i{{32|64}}, i32, i32 }
-// CHECK-DAG: $[[REGFN:\.omp_offloading\..+]] = comdat
-
// CHECK-DAG: [[SIZET:@.+]] = private unnamed_addr constant [2 x i64] [i64 0, i64 4]
// CHECK-DAG: [[MAPT:@.+]] = private unnamed_addr constant [2 x i64] [i64 544, i64 800]
// CHECK-DAG: @{{.*}} = weak constant i8 0
@@ -55,16 +51,8 @@
// TCHECK: @{{.+}} = {{.*}}constant [[ENTTY]]
// TCHECK-NOT: @{{.+}} = weak constant [[ENTTY]]
-// Check if offloading descriptor is created.
-// CHECK: [[ENTBEGIN:@.+]] = external constant [[ENTTY]]
-// CHECK: [[ENTEND:@.+]] = external constant [[ENTTY]]
-// CHECK: [[DEVBEGIN:@.+]] = extern_weak constant i8
-// CHECK: [[DEVEND:@.+]] = extern_weak constant i8
-// CHECK: [[IMAGES:@.+]] = internal unnamed_addr constant [1 x [[DEVTY]]] [{{.+}} { i8* [[DEVBEGIN]], i8* [[DEVEND]], [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }], comdat($[[REGFN]])
-// CHECK: [[DESC:@.+]] = internal constant [[DSCTY]] { i32 1, [[DEVTY]]* getelementptr inbounds ([1 x [[DEVTY]]], [1 x [[DEVTY]]]* [[IMAGES]], i32 0, i32 0), [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }, comdat($[[REGFN]])
-
// Check target registration is registered as a Ctor.
-// CHECK: appending global [2 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }, { i32, void ()*, i8* } { i32 0, void ()* @[[REGFN]], i8* bitcast (void ()* @[[REGFN]] to i8*) }]
+// CHECK: appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }]
template<typename tx, typename ty>
@@ -193,7 +181,7 @@
// CHECK: define internal void [[HVT0:@.+]]()
-// CHECK: define internal{{.*}} i32 [[TASK_ENTRY0]](i32{{.*}}, [[TASK_TY0]]* noalias)
+// CHECK: define internal{{.*}} i32 [[TASK_ENTRY0]](i32{{.*}}, [[TASK_TY0]]* noalias %1)
// CHECK: store void (i8*, ...)* null, void (i8*, ...)** %
// CHECK: [[DEVICE_CAP:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 0
// CHECK: [[DEV:%.+]] = load i32, i32* [[DEVICE_CAP]],
@@ -209,7 +197,7 @@
// CHECK: define internal void [[HVT1:@.+]](i[[SZ]]* %{{.+}}, i[[SZ]] %{{.+}})
-// CHECK: define internal{{.*}} i32 [[TASK_ENTRY1_]](i32{{.*}}, [[TASK_TY1_]]* noalias)
+// CHECK: define internal{{.*}} i32 [[TASK_ENTRY1_]](i32{{.*}}, [[TASK_TY1_]]* noalias %1)
// CHECK: call void (i8*, ...) %
// CHECK: [[SZT:%.+]] = getelementptr inbounds [2 x i64], [2 x i64]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0
// CHECK: [[DEVICE_CAP:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 2
@@ -231,7 +219,7 @@
// CHECK: [[END]]
// CHECK: ret i32 0
-// CHECK: define internal{{.*}} i32 [[TASK_ENTRY1__]](i32{{.*}}, [[TASK_TY1__]]* noalias)
+// CHECK: define internal{{.*}} i32 [[TASK_ENTRY1__]](i32{{.*}}, [[TASK_TY1__]]* noalias %1)
// CHECK: call void (i8*, ...) %
// CHECK: [[DEVICE_CAP:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 2
// CHECK: [[BP0:%.+]] = load i[[SZ]]*, i[[SZ]]** %
@@ -251,7 +239,7 @@
// CHECK-64: load i32, i32* [[AA_CADDR]], align
// CHECK-32: load i32, i32* [[AA_ADDR]], align
-// CHECK: define internal{{.*}} i32 [[TASK_ENTRY2]](i32{{.*}}, [[TASK_TY2]]* noalias)
+// CHECK: define internal{{.*}} i32 [[TASK_ENTRY2]](i32{{.*}}, [[TASK_TY2]]* noalias %1)
// CHECK: call void (i8*, ...) %
// CHECK: [[BP1_I32:%.+]] = load i32, i32* %
// CHECK-64: [[BP1_CAST:%.+]] = bitcast i[[SZ]]* [[BP1_PTR:%.+]] to i32*
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_depend_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_depend_messages.cpp
index b8e1657..d83bbdc 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_depend_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_depend_messages.cpp
@@ -68,7 +68,7 @@
foo();
#pragma omp target teams depend (in : argv[0:-1]) // expected-error {{section length is evaluated to a negative value -1}}
foo();
-#pragma omp target teams depend (in : argv[-1:0])
+#pragma omp target teams depend (in : argv[-1:0]) // expected-error {{zero-length array section is not allowed in 'depend' clause}}
foo();
#pragma omp target teams depend (in : argv[:]) // expected-error {{section length is unspecified and cannot be inferred because subscripted value is not an array}}
foo();
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_ast_print.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_ast_print.cpp
index 616bbeb..b7bf1df 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_ast_print.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_ast_print.cpp
@@ -1,10 +1,10 @@
-// RUN: %clang_cc1 -verify -fopenmp -ast-print %s -Wno-openmp-target | FileCheck %s
-// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -fopenmp -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -ast-print %s -Wno-openmp-mapping | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -fopenmp -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s -Wno-openmp-target | FileCheck %s
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -fopenmp-simd -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s -Wno-openmp-mapping | FileCheck %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -fopenmp-simd -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s
// expected-no-diagnostics
#ifndef HEADER
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_codegen.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_codegen.cpp
index 28ea08f..547e45f 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_codegen.cpp
@@ -45,13 +45,9 @@
// CHECK-DAG: [[TT:%.+]] = type { i64, i8 }
// CHECK-DAG: [[S1:%.+]] = type { double }
// CHECK-DAG: [[ENTTY:%.+]] = type { i8*, i8*, i[[SZ:32|64]], i32, i32 }
-// CHECK-DAG: [[DEVTY:%.+]] = type { i8*, i8*, [[ENTTY]]*, [[ENTTY]]* }
-// CHECK-DAG: [[DSCTY:%.+]] = type { i32, [[DEVTY]]*, [[ENTTY]]*, [[ENTTY]]* }
// TCHECK: [[ENTTY:%.+]] = type { i8*, i8*, i{{32|64}}, i32, i32 }
-// CHECK-DAG: $[[REGFN:\.omp_offloading\..+]] = comdat
-
// We have 8 target regions, but only 7 that actually will generate offloading
// code, only 6 will have mapped arguments, and only 4 have all-constant map
// sizes.
@@ -85,16 +81,8 @@
// TCHECK: @{{.+}} = weak constant [[ENTTY]]
// TCHECK-NOT: @{{.+}} = weak constant [[ENTTY]]
-// Check if offloading descriptor is created.
-// CHECK: [[ENTBEGIN:@.+]] = external constant [[ENTTY]]
-// CHECK: [[ENTEND:@.+]] = external constant [[ENTTY]]
-// CHECK: [[DEVBEGIN:@.+]] = extern_weak constant i8
-// CHECK: [[DEVEND:@.+]] = extern_weak constant i8
-// CHECK: [[IMAGES:@.+]] = internal unnamed_addr constant [1 x [[DEVTY]]] [{{.+}} { i8* [[DEVBEGIN]], i8* [[DEVEND]], [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }], comdat($[[REGFN]])
-// CHECK: [[DESC:@.+]] = internal constant [[DSCTY]] { i32 1, [[DEVTY]]* getelementptr inbounds ([1 x [[DEVTY]]], [1 x [[DEVTY]]]* [[IMAGES]], i32 0, i32 0), [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }, comdat($[[REGFN]])
-
// Check target registration is registered as a Ctor.
-// CHECK: appending global [2 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }, { i32, void ()*, i8* } { i32 0, void ()* @[[REGFN]], i8* bitcast (void ()* @[[REGFN]] to i8*) }]
+// CHECK: appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }]
template<typename tx, typename ty>
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_codegen_registration.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_codegen_registration.cpp
index 9b6cd78..d260f91 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_codegen_registration.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_codegen_registration.cpp
@@ -52,13 +52,9 @@
// CHECK-DAG: [[ST1:%.+]] = type { [228 x i32] }
// CHECK-DAG: [[ST2:%.+]] = type { [1128 x i32] }
// CHECK-DAG: [[ENTTY:%.+]] = type { i8*, i8*, i[[SZ:32|64]], i32, i32 }
-// CHECK-DAG: [[DEVTY:%.+]] = type { i8*, i8*, [[ENTTY]]*, [[ENTTY]]* }
-// CHECK-DAG: [[DSCTY:%.+]] = type { i32, [[DEVTY]]*, [[ENTTY]]*, [[ENTTY]]* }
// TCHECK: [[ENTTY:%.+]] = type { i8*, i8*, i[[SZ:32|64]], i32, i32 }
-// CHECK-DAG: $[[REGFN:\.omp_offloading\..+]] = comdat
-
// CHECK-DAG: [[A1:@.+]] = internal global [[SA]]
// CHECK-DAG: [[A2:@.+]] = global [[SA]]
// CHECK-DAG: [[B1:@.+]] = global [[SB]]
@@ -123,68 +119,60 @@
// CHECK-NTARGET-NOT: private unnamed_addr constant [1 x i
// CHECK-DAG: [[NAMEPTR1:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME1:__omp_offloading_[0-9a-f]+_[0-9a-f]+__Z.+_l[0-9]+]]\00"
-// CHECK-DAG: [[ENTRY1:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR1]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY1:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR1]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR2:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME2:.+]]\00"
-// CHECK-DAG: [[ENTRY2:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR2]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY2:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR2]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR3:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME3:.+]]\00"
-// CHECK-DAG: [[ENTRY3:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR3]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY3:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR3]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR4:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME4:.+]]\00"
-// CHECK-DAG: [[ENTRY4:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR4]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY4:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR4]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR5:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME5:.+]]\00"
-// CHECK-DAG: [[ENTRY5:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR5]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY5:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR5]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR6:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME6:.+]]\00"
-// CHECK-DAG: [[ENTRY6:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR6]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY6:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR6]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR7:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME7:.+]]\00"
-// CHECK-DAG: [[ENTRY7:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR7]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY7:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR7]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR8:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME8:.+]]\00"
-// CHECK-DAG: [[ENTRY8:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR8]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY8:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR8]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR9:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME9:.+]]\00"
-// CHECK-DAG: [[ENTRY9:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR9]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY9:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR9]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR10:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME10:.+]]\00"
-// CHECK-DAG: [[ENTRY10:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR10]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY10:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR10]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR11:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME11:.+]]\00"
-// CHECK-DAG: [[ENTRY11:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR11]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY11:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR11]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR12:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME12:.+]]\00"
-// CHECK-DAG: [[ENTRY12:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR12]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY12:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR12]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR1:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME1:__omp_offloading_[0-9a-f]+_[0-9a-f]+__Z.+_l[0-9]+]]\00"
-// TCHECK-DAG: [[ENTRY1:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR1]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY1:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR1]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR2:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME2:.+]]\00"
-// TCHECK-DAG: [[ENTRY2:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR2]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY2:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR2]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR3:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME3:.+]]\00"
-// TCHECK-DAG: [[ENTRY3:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR3]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY3:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR3]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR4:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME4:.+]]\00"
-// TCHECK-DAG: [[ENTRY4:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR4]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY4:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR4]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR5:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME5:.+]]\00"
-// TCHECK-DAG: [[ENTRY5:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR5]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY5:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR5]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR6:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME6:.+]]\00"
-// TCHECK-DAG: [[ENTRY6:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR6]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY6:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR6]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR7:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME7:.+]]\00"
-// TCHECK-DAG: [[ENTRY7:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR7]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY7:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR7]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR8:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME8:.+]]\00"
-// TCHECK-DAG: [[ENTRY8:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR8]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY8:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR8]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR9:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME9:.+]]\00"
-// TCHECK-DAG: [[ENTRY9:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR9]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY9:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR9]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR10:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME10:.+]]\00"
-// TCHECK-DAG: [[ENTRY10:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR10]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY10:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR10]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR11:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME11:.+]]\00"
-// TCHECK-DAG: [[ENTRY11:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR11]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY11:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR11]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR12:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME12:.+]]\00"
-// TCHECK-DAG: [[ENTRY12:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR12]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
-
-// CHECK: [[ENTBEGIN:@.+]] = external constant [[ENTTY]]
-// CHECK: [[ENTEND:@.+]] = external constant [[ENTTY]]
-// CHECK: [[DEVBEGIN:@.+]] = extern_weak constant i8
-// CHECK: [[DEVEND:@.+]] = extern_weak constant i8
-// CHECK: [[IMAGES:@.+]] = internal unnamed_addr constant [1 x [[DEVTY]]] [{{.+}} { i8* [[DEVBEGIN]], i8* [[DEVEND]], [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }], comdat($[[REGFN]])
-// CHECK: [[DESC:@.+]] = internal constant [[DSCTY]] { i32 1, [[DEVTY]]* getelementptr inbounds ([1 x [[DEVTY]]], [1 x [[DEVTY]]]* [[IMAGES]], i32 0, i32 0), [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }, comdat($[[REGFN]])
+// TCHECK-DAG: [[ENTRY12:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR12]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// We have 4 initializers, one for the 500 priority, another one for 501, or more for the default priority, and the last one for the offloading registration function.
-// CHECK: @llvm.global_ctors = appending global [5 x { i32, void ()*, i8* }] [
+// CHECK: @llvm.global_ctors = appending global [4 x { i32, void ()*, i8* }] [
// CHECK-SAME: { i32, void ()*, i8* } { i32 500, void ()* [[P500:@[^,]+]], i8* null },
// CHECK-SAME: { i32, void ()*, i8* } { i32 501, void ()* [[P501:@[^,]+]], i8* null },
// CHECK-SAME: { i32, void ()*, i8* } { i32 65535, void ()* [[PMAX:@[^,]+]], i8* null },
-// CHECK-SAME: { i32, void ()*, i8* } { i32 0, void ()* @[[REGFN]], i8* bitcast (void ()* @[[REGFN]] to i8*) }]
// CHECK-NTARGET: @llvm.global_ctors = appending global [3 x { i32, void ()*, i8* }] [
@@ -363,12 +351,8 @@
//TCHECK-DAG: define weak void @[[NAME12]](
// CHECK-NTARGET-NOT: __tgt_target
-// CHECK-NTARGET-NOT: __tgt_register_lib
-// CHECK-NTARGET-NOT: __tgt_unregister_lib
// TCHECK-NOT: __tgt_target
-// TCHECK-NOT: __tgt_register_lib
-// TCHECK-NOT: __tgt_unregister_lib
// We have 2 initializers with priority 500
//CHECK: define internal void [[P500]](
@@ -394,25 +378,6 @@
//CHECK-NOT: call void @{{.+}}()
//CHECK: ret void
-// Check registration and unregistration
-
-//CHECK: define internal void @.omp_offloading.requires_reg()
-//CHECK: call void @__tgt_register_requires(i64 1)
-//CHECK: ret void
-
-//CHECK: define internal void @[[UNREGFN:.+]](i8*)
-//CHECK-SAME: comdat($[[REGFN]]) {
-//CHECK: call i32 @__tgt_unregister_lib([[DSCTY]]* [[DESC]])
-//CHECK: ret void
-//CHECK: declare i32 @__tgt_unregister_lib([[DSCTY]]*)
-
-//CHECK: define linkonce hidden void @[[REGFN]]()
-//CHECK-SAME: comdat {
-//CHECK: call i32 @__tgt_register_lib([[DSCTY]]* [[DESC]])
-//CHECK: call i32 @__cxa_atexit(void (i8*)* @[[UNREGFN]], i8* bitcast ([[DSCTY]]* [[DESC]] to i8*),
-//CHECK: ret void
-//CHECK: declare i32 @__tgt_register_lib([[DSCTY]]*)
-
static __attribute__((init_priority(500))) SA a1;
SA a2;
SB __attribute__((init_priority(500))) b1;
@@ -446,31 +411,31 @@
// Check metadata is properly generated:
// CHECK: !omp_offload.info = !{!{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID:-?[0-9]+]], i32 [[FILEID:-?[0-9]+]], !"_ZN2SB3fooEv", i32 216, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SDD1Ev", i32 268, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SEC1Ev", i32 286, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SED1Ev", i32 293, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EE3fooEv", i32 305, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EEC1Ev", i32 312, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_Z3bari", i32 440, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EED1Ev", i32 319, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EEC1Ev", i32 312, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EED1Ev", i32 319, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EE3fooEv", i32 305, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SCC1Ev", i32 242, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID:-?[0-9]+]], i32 [[FILEID:-?[0-9]+]], !"_ZN2SB3fooEv", i32 204, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SDD1Ev", i32 256, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SEC1Ev", i32 274, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SED1Ev", i32 281, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EE3fooEv", i32 293, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EEC1Ev", i32 300, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_Z3bari", i32 405, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EED1Ev", i32 307, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EEC1Ev", i32 300, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EED1Ev", i32 307, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EE3fooEv", i32 293, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SCC1Ev", i32 230, i32 {{[0-9]+}}}
// TCHECK: !omp_offload.info = !{!{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID:-?[0-9]+]], i32 [[FILEID:-?[0-9]+]], !"_ZN2SB3fooEv", i32 216, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SDD1Ev", i32 268, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SEC1Ev", i32 286, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SED1Ev", i32 293, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EE3fooEv", i32 305, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EEC1Ev", i32 312, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_Z3bari", i32 440, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EED1Ev", i32 319, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EEC1Ev", i32 312, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EED1Ev", i32 319, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EE3fooEv", i32 305, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SCC1Ev", i32 242, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID:-?[0-9]+]], i32 [[FILEID:-?[0-9]+]], !"_ZN2SB3fooEv", i32 204, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SDD1Ev", i32 256, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SEC1Ev", i32 274, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SED1Ev", i32 281, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EE3fooEv", i32 293, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EEC1Ev", i32 300, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_Z3bari", i32 405, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EED1Ev", i32 307, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EEC1Ev", i32 300, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EED1Ev", i32 307, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EE3fooEv", i32 293, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SCC1Ev", i32 230, i32 {{[0-9]+}}}
#endif
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_defaultmap_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_defaultmap_messages.cpp
index 1842069..6375b82 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_defaultmap_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_defaultmap_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 %s -verify=expected,omp5 -Wuninitialized -DOMP5
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 %s -verify=expected,omp5 -Wuninitialized -DOMP5
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 %s -verify=expected,omp45 -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 %s -verify=expected,omp45 -Wuninitialized
void foo() {
}
@@ -10,23 +12,23 @@
int i;
#pragma omp target teams distribute defaultmap // expected-error {{expected '(' after 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute defaultmap ( // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+#pragma omp target teams distribute defaultmap ( // omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute defaultmap () // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
+#pragma omp target teams distribute defaultmap () // omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute defaultmap (tofrom // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+#pragma omp target teams distribute defaultmap (tofrom // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute defaultmap (tofrom: // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+#pragma omp target teams distribute defaultmap (tofrom: // expected-error {{expected ')'}} expected-note {{to match this '('}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute defaultmap (tofrom) // expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+#pragma omp target teams distribute defaultmap (tofrom) // expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute defaultmap (tofrom scalar) // expected-warning {{missing ':' after defaultmap modifier - ignoring}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute defaultmap (tofrom, // expected-error {{expected ')'}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-note {{to match this '('}}
+#pragma omp target teams distribute defaultmap (tofrom, // expected-error {{expected ')'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-note {{to match this '('}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute defaultmap (scalar: // expected-error {{expected ')'}} expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
+#pragma omp target teams distribute defaultmap (scalar: // expected-error {{expected ')'}} omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute defaultmap (tofrom, scalar // expected-error {{expected ')'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
+#pragma omp target teams distribute defaultmap (tofrom, scalar // expected-error {{expected ')'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
return argc;
@@ -36,25 +38,24 @@
int i;
#pragma omp target teams distribute defaultmap // expected-error {{expected '(' after 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute defaultmap ( // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+#pragma omp target teams distribute defaultmap ( // omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute defaultmap () // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
+#pragma omp target teams distribute defaultmap () // omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute defaultmap (tofrom // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+#pragma omp target teams distribute defaultmap (tofrom // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute defaultmap (tofrom: // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+#pragma omp target teams distribute defaultmap (tofrom: // expected-error {{expected ')'}} expected-note {{to match this '('}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute defaultmap (tofrom) // expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+#pragma omp target teams distribute defaultmap (tofrom) // expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute defaultmap (tofrom scalar) // expected-warning {{missing ':' after defaultmap modifier - ignoring}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute defaultmap (tofrom, // expected-error {{expected ')'}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-note {{to match this '('}}
+#pragma omp target teams distribute defaultmap (tofrom, // expected-error {{expected ')'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-note {{to match this '('}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute defaultmap (scalar: // expected-error {{expected ')'}} expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
+#pragma omp target teams distribute defaultmap (scalar: // expected-error {{expected ')'}} omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute defaultmap (tofrom, scalar // expected-error {{expected ')'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
+#pragma omp target teams distribute defaultmap (tofrom, scalar // expected-error {{expected ')'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
return tmain<int, char, 1, 0>(argc, argv);
}
-
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_depend_codegen.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_depend_codegen.cpp
index ff6e427..37b80b0 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_depend_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_depend_codegen.cpp
@@ -40,13 +40,9 @@
// CHECK-DAG: [[TT:%.+]] = type { i64, i8 }
// CHECK-DAG: [[ENTTY:%.+]] = type { i8*, i8*, i[[SZ:32|64]], i32, i32 }
-// CHECK-DAG: [[DEVTY:%.+]] = type { i8*, i8*, [[ENTTY]]*, [[ENTTY]]* }
-// CHECK-DAG: [[DSCTY:%.+]] = type { i32, [[DEVTY]]*, [[ENTTY]]*, [[ENTTY]]* }
// TCHECK: [[ENTTY:%.+]] = type { i8*, i8*, i{{32|64}}, i32, i32 }
-// CHECK-DAG: $[[REGFN:\.omp_offloading\..+]] = comdat
-
// CHECK-DAG: [[SIZET:@.+]] = private unnamed_addr constant [2 x i64] [i64 0, i64 4]
// CHECK-DAG: [[MAPT:@.+]] = private unnamed_addr constant [2 x i64] [i64 544, i64 800]
// CHECK-DAG: @{{.*}} = weak constant i8 0
@@ -55,16 +51,8 @@
// TCHECK: @{{.+}} = {{.*}}constant [[ENTTY]]
// TCHECK-NOT: @{{.+}} = weak constant [[ENTTY]]
-// Check if offloading descriptor is created.
-// CHECK: [[ENTBEGIN:@.+]] = external constant [[ENTTY]]
-// CHECK: [[ENTEND:@.+]] = external constant [[ENTTY]]
-// CHECK: [[DEVBEGIN:@.+]] = extern_weak constant i8
-// CHECK: [[DEVEND:@.+]] = extern_weak constant i8
-// CHECK: [[IMAGES:@.+]] = internal unnamed_addr constant [1 x [[DEVTY]]] [{{.+}} { i8* [[DEVBEGIN]], i8* [[DEVEND]], [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }], comdat($[[REGFN]])
-// CHECK: [[DESC:@.+]] = internal constant [[DSCTY]] { i32 1, [[DEVTY]]* getelementptr inbounds ([1 x [[DEVTY]]], [1 x [[DEVTY]]]* [[IMAGES]], i32 0, i32 0), [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }, comdat($[[REGFN]])
-
// Check target registration is registered as a Ctor.
-// CHECK: appending global [2 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }, { i32, void ()*, i8* } { i32 0, void ()* @[[REGFN]], i8* bitcast (void ()* @[[REGFN]] to i8*) }]
+// CHECK: appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }]
template<typename tx, typename ty>
@@ -193,7 +181,7 @@
// CHECK: define internal void [[HVT0:@.+]]()
-// CHECK: define internal{{.*}} i32 [[TASK_ENTRY0]](i32{{.*}}, [[TASK_TY0]]* noalias)
+// CHECK: define internal{{.*}} i32 [[TASK_ENTRY0]](i32{{.*}}, [[TASK_TY0]]* noalias %1)
// CHECK: store void (i8*, ...)* null, void (i8*, ...)** %
// CHECK: [[DEVICE_CAP:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 0
// CHECK: [[DEV:%.+]] = load i32, i32* [[DEVICE_CAP]],
@@ -209,7 +197,7 @@
// CHECK: define internal void [[HVT1:@.+]](i[[SZ]]* %{{.+}}, i[[SZ]] %{{.+}})
-// CHECK: define internal{{.*}} i32 [[TASK_ENTRY1_]](i32{{.*}}, [[TASK_TY1_]]* noalias)
+// CHECK: define internal{{.*}} i32 [[TASK_ENTRY1_]](i32{{.*}}, [[TASK_TY1_]]* noalias %1)
// CHECK: call void (i8*, ...) %
// CHECK: [[SZT:%.+]] = getelementptr inbounds [2 x i64], [2 x i64]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0
// CHECK: [[DEVICE_CAP:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 2
@@ -231,7 +219,7 @@
// CHECK: [[END]]
// CHECK: ret i32 0
-// CHECK: define internal{{.*}} i32 [[TASK_ENTRY1__]](i32{{.*}}, [[TASK_TY1__]]* noalias)
+// CHECK: define internal{{.*}} i32 [[TASK_ENTRY1__]](i32{{.*}}, [[TASK_TY1__]]* noalias %1)
// CHECK: call void (i8*, ...) %
// CHECK: [[DEVICE_CAP:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 2
// CHECK: [[BP0:%.+]] = load i[[SZ]]*, i[[SZ]]** %
@@ -251,7 +239,7 @@
// CHECK-64: load i32, i32* [[AA_CADDR]], align
// CHECK-32: load i32, i32* [[AA_ADDR]], align
-// CHECK: define internal{{.*}} i32 [[TASK_ENTRY2]](i32{{.*}}, [[TASK_TY2]]* noalias)
+// CHECK: define internal{{.*}} i32 [[TASK_ENTRY2]](i32{{.*}}, [[TASK_TY2]]* noalias %1)
// CHECK: call void (i8*, ...) %
// CHECK: [[BP1_I32:%.+]] = load i32, i32* %
// CHECK-64: [[BP1_CAST:%.+]] = bitcast i[[SZ]]* [[BP1_PTR:%.+]] to i32*
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_depend_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_depend_messages.cpp
index bb10a8f..38132eba 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_depend_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_depend_messages.cpp
@@ -69,7 +69,7 @@
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute depend (in : argv[0:-1]) // expected-error {{section length is evaluated to a negative value -1}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute depend (in : argv[-1:0])
+#pragma omp target teams distribute depend (in : argv[-1:0]) // expected-error {{zero-length array section is not allowed in 'depend' clause}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute depend (in : argv[:]) // expected-error {{section length is unspecified and cannot be inferred because subscripted value is not an array}}
for (i = 0; i < argc; ++i) foo();
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_firstprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_firstprivate_messages.cpp
index 8d53c3c..8b446fe 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_firstprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_firstprivate_messages.cpp
@@ -19,6 +19,13 @@
return argc;
}
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp target teams distribute firstprivate(fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
struct S1; // expected-note {{declared here}} expected-note{{forward declaration of 'S1'}}
extern S1 a;
class S2 {
@@ -110,7 +117,7 @@
for (i = 0; i < argc; ++i) foo();
#pragma omp target
-#pragma omp teams distribute firstprivate(ca) // expected-error {{no matching constructor for initialization of 'S3'}} expected-warning {{Non-trivial type 'const S3 [5]' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp teams distribute firstprivate(ca) // expected-error {{no matching constructor for initialization of 'S3'}} expected-warning {{Type 'const S3 [5]' is not trivially copyable and not guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute firstprivate(da, z)
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_lastprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_lastprivate_messages.cpp
index d02557c..f76c13f 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_lastprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_lastprivate_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
@@ -175,6 +177,8 @@
#pragma omp target teams distribute lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
+#pragma omp target teams distribute lastprivate(conditional: argc) lastprivate(conditional: // expected-error 2 {{use of undeclared identifier 'conditional'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute lastprivate(S1) // expected-error {{'S1' does not refer to a value}}
for (i = 0; i < argc; ++i) foo();
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_loop_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_loop_messages.cpp
index ecf364e..e20b04b 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_loop_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_loop_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wno-openmp-mapping -Wuninitialized
class S {
int a;
@@ -93,28 +95,28 @@
c[ii] = a[ii];
#pragma omp target teams distribute
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
for (int i = 0; i; i++)
c[i] = a[i];
#pragma omp target teams distribute
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
// expected-error@+1 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'i'}}
for (int i = 0; jj < kk; ii++)
c[i] = a[i];
#pragma omp target teams distribute
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
for (int i = 0; !!i; i++)
c[i] = a[i];
-// Ok
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
#pragma omp target teams distribute
for (int i = 0; i != 1; i++)
c[i] = a[i];
#pragma omp target teams distribute
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
for (int i = 0;; i++)
c[i] = a[i];
@@ -267,7 +269,7 @@
}
#pragma omp target teams distribute
-// expected-error@+1 {{statement after '#pragma omp target teams distribute' must be a for loop}}
+// omp4-error@+1 {{statement after '#pragma omp target teams distribute' must be a for loop}}
for (auto &item : a) {
item = item + 1;
}
@@ -403,15 +405,15 @@
for (begin = end; begin < end; ++begin)
++begin;
#pragma omp target teams distribute
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
for (GoodIter I = begin; I - I; ++I)
++I;
#pragma omp target teams distribute
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
for (GoodIter I = begin; begin < end; ++I)
++I;
#pragma omp target teams distribute
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
for (GoodIter I = begin; !I; ++I)
++I;
#pragma omp target teams distribute
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_map_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_map_messages.cpp
index f14233f..e062aa3 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_map_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_map_messages.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wno-openmp-mapping -Wuninitialized
void foo() {
}
@@ -9,6 +9,13 @@
return argc;
}
+void xxx(int argc) {
+ int map; // expected-note {{initialize the variable 'map' to silence this warning}}
+#pragma omp target teams distribute map(map) // expected-warning {{variable 'map' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
struct S1; // expected-note 2 {{declared here}}
extern S1 a;
class S2 {
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_ast_print.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_ast_print.cpp
index c02f1b9..55bcead 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_ast_print.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_ast_print.cpp
@@ -1,10 +1,10 @@
-// RUN: %clang_cc1 -verify -fopenmp -ast-print %s -Wno-openmp-target | FileCheck %s
-// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -fopenmp -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -ast-print %s -Wno-openmp-mapping | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -fopenmp -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s -Wno-openmp-target | FileCheck %s
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -fopenmp-simd -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s -Wno-openmp-mapping | FileCheck %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -fopenmp-simd -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s
// expected-no-diagnostics
#ifndef HEADER
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_codegen.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_codegen.cpp
index 4c7ac24..1617f85 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_codegen.cpp
@@ -54,17 +54,14 @@
// discard capture expressions for te and th
// HCK1: = alloca i32,
// HCK1: = alloca i32,
- // HCK1: = alloca i32,
- // HCK1: = alloca i32,
- // HCK1: = alloca i32,
// HCK1: [[N_CAST:%.+]] = alloca i{{32|64}},
// HCK1: [[TE_CAST:%.+]] = alloca i{{32|64}},
// HCK1: [[TH_CAST:%.+]] = alloca i{{32|64}},
- // HCK1: call void @__kmpc_push_target_tripcount(i64 -1, i64 %{{.+}})
// HCK1: [[N_PAR:%.+]] = load{{.+}}, {{.+}} [[N_CAST]],
// HCK1: [[TE_PAR:%.+]] = load{{.+}}, {{.+}} [[TE_CAST]],
// HCK1: [[TH_PAR:%.+]] = load{{.+}}, {{.+}} [[TH_CAST]],
- // HCK1: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 4, i8** %{{[^,]+}}, i8** %{{[^,]+}},
+ // HCK1: call void @__kmpc_push_target_tripcount(i64 -1, i64 %{{.+}})
+ // HCK1: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 4, i8** %{{[^,]+}}, i8** %{{[^,]+}},
// HCK1: call void @[[OFFL1:.+]](i{{32|64}} [[N_PAR]], {{.+}}, i{{32|64}} [[TE_PAR]], i{{32|64}} [[TH_PAR]])
#pragma omp target teams distribute parallel for num_teams(te), thread_limit(th)
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_defaultmap_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_defaultmap_messages.cpp
index ae17c2b..ead4d92 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_defaultmap_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_defaultmap_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 %s -verify=expected,omp5 -Wuninitialized -DOMP5
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 %s -verify=expected,omp5 -Wuninitialized -DOMP5
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 %s -verify=expected,omp45 -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 %s -verify=expected,omp45 -Wuninitialized
void foo() {
}
@@ -10,23 +12,23 @@
int i;
#pragma omp target teams distribute parallel for defaultmap // expected-error {{expected '(' after 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for defaultmap ( // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+#pragma omp target teams distribute parallel for defaultmap ( // omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for defaultmap () // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
+#pragma omp target teams distribute parallel for defaultmap () // omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for defaultmap (tofrom // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+#pragma omp target teams distribute parallel for defaultmap (tofrom // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for defaultmap (tofrom: // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+#pragma omp target teams distribute parallel for defaultmap (tofrom: // expected-error {{expected ')'}} expected-note {{to match this '('}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for defaultmap (tofrom) // expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+#pragma omp target teams distribute parallel for defaultmap (tofrom) // expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for defaultmap (tofrom scalar) // expected-warning {{missing ':' after defaultmap modifier - ignoring}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for defaultmap (tofrom, // expected-error {{expected ')'}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-note {{to match this '('}}
+#pragma omp target teams distribute parallel for defaultmap (tofrom, // expected-error {{expected ')'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-note {{to match this '('}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for defaultmap (scalar: // expected-error {{expected ')'}} expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
+#pragma omp target teams distribute parallel for defaultmap (scalar: // expected-error {{expected ')'}} omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for defaultmap (tofrom, scalar // expected-error {{expected ')'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
+#pragma omp target teams distribute parallel for defaultmap (tofrom, scalar // expected-error {{expected ')'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
return argc;
@@ -36,23 +38,23 @@
int i;
#pragma omp target teams distribute parallel for defaultmap // expected-error {{expected '(' after 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for defaultmap ( // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+#pragma omp target teams distribute parallel for defaultmap ( // omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for defaultmap () // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
+#pragma omp target teams distribute parallel for defaultmap () // omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for defaultmap (tofrom // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+#pragma omp target teams distribute parallel for defaultmap (tofrom // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for defaultmap (tofrom: // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+#pragma omp target teams distribute parallel for defaultmap (tofrom: // expected-error {{expected ')'}} expected-note {{to match this '('}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for defaultmap (tofrom) // expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+#pragma omp target teams distribute parallel for defaultmap (tofrom) // expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for defaultmap (tofrom scalar) // expected-warning {{missing ':' after defaultmap modifier - ignoring}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for defaultmap (tofrom, // expected-error {{expected ')'}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-note {{to match this '('}}
+#pragma omp target teams distribute parallel for defaultmap (tofrom, // expected-error {{expected ')'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-note {{to match this '('}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for defaultmap (scalar: // expected-error {{expected ')'}} expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
+#pragma omp target teams distribute parallel for defaultmap (scalar: // expected-error {{expected ')'}} omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for defaultmap (tofrom, scalar // expected-error {{expected ')'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
+#pragma omp target teams distribute parallel for defaultmap (tofrom, scalar // expected-error {{expected ')'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
return tmain<int, char, 1, 0>(argc, argv);
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_depend_codegen.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_depend_codegen.cpp
index 669642c..b136e7b 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_depend_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_depend_codegen.cpp
@@ -40,13 +40,9 @@
// CHECK-DAG: [[TT:%.+]] = type { i64, i8 }
// CHECK-DAG: [[ENTTY:%.+]] = type { i8*, i8*, i[[SZ:32|64]], i32, i32 }
-// CHECK-DAG: [[DEVTY:%.+]] = type { i8*, i8*, [[ENTTY]]*, [[ENTTY]]* }
-// CHECK-DAG: [[DSCTY:%.+]] = type { i32, [[DEVTY]]*, [[ENTTY]]*, [[ENTTY]]* }
// TCHECK: [[ENTTY:%.+]] = type { i8*, i8*, i{{32|64}}, i32, i32 }
-// CHECK-DAG: $[[REGFN:\.omp_offloading\..+]] = comdat
-
// CHECK-DAG: [[SIZET:@.+]] = private unnamed_addr constant [2 x i64] [i64 0, i64 4]
// CHECK-DAG: [[MAPT:@.+]] = private unnamed_addr constant [2 x i64] [i64 544, i64 800]
// CHECK-DAG: @{{.*}} = weak constant i8 0
@@ -55,16 +51,8 @@
// TCHECK: @{{.+}} = {{.*}}constant [[ENTTY]]
// TCHECK-NOT: @{{.+}} = weak constant [[ENTTY]]
-// Check if offloading descriptor is created.
-// CHECK: [[ENTBEGIN:@.+]] = external constant [[ENTTY]]
-// CHECK: [[ENTEND:@.+]] = external constant [[ENTTY]]
-// CHECK: [[DEVBEGIN:@.+]] = extern_weak constant i8
-// CHECK: [[DEVEND:@.+]] = extern_weak constant i8
-// CHECK: [[IMAGES:@.+]] = internal unnamed_addr constant [1 x [[DEVTY]]] [{{.+}} { i8* [[DEVBEGIN]], i8* [[DEVEND]], [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }], comdat($[[REGFN]])
-// CHECK: [[DESC:@.+]] = internal constant [[DSCTY]] { i32 1, [[DEVTY]]* getelementptr inbounds ([1 x [[DEVTY]]], [1 x [[DEVTY]]]* [[IMAGES]], i32 0, i32 0), [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }, comdat($[[REGFN]])
-
// Check target registration is registered as a Ctor.
-// CHECK: appending global [2 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }, { i32, void ()*, i8* } { i32 0, void ()* @[[REGFN]], i8* bitcast (void ()* @[[REGFN]] to i8*) }]
+// CHECK: appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }]
template<typename tx, typename ty>
@@ -193,7 +181,7 @@
// CHECK: define internal void [[HVT0:@.+]]()
-// CHECK: define internal{{.*}} i32 [[TASK_ENTRY0]](i32{{.*}}, [[TASK_TY0]]* noalias)
+// CHECK: define internal{{.*}} i32 [[TASK_ENTRY0]](i32{{.*}}, [[TASK_TY0]]* noalias %1)
// CHECK: store void (i8*, ...)* null, void (i8*, ...)** %
// CHECK: [[DEVICE_CAP:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 0
// CHECK: [[DEV:%.+]] = load i32, i32* [[DEVICE_CAP]],
@@ -209,7 +197,7 @@
// CHECK: define internal void [[HVT1:@.+]](i[[SZ]]* %{{.+}}, i[[SZ]] %{{.+}})
-// CHECK: define internal{{.*}} i32 [[TASK_ENTRY1_]](i32{{.*}}, [[TASK_TY1_]]* noalias)
+// CHECK: define internal{{.*}} i32 [[TASK_ENTRY1_]](i32{{.*}}, [[TASK_TY1_]]* noalias %1)
// CHECK: call void (i8*, ...) %
// CHECK: [[SZT:%.+]] = getelementptr inbounds [2 x i64], [2 x i64]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0
// CHECK: [[DEVICE_CAP:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 2
@@ -231,7 +219,7 @@
// CHECK: [[END]]
// CHECK: ret i32 0
-// CHECK: define internal{{.*}} i32 [[TASK_ENTRY1__]](i32{{.*}}, [[TASK_TY1__]]* noalias)
+// CHECK: define internal{{.*}} i32 [[TASK_ENTRY1__]](i32{{.*}}, [[TASK_TY1__]]* noalias %1)
// CHECK: call void (i8*, ...) %
// CHECK: [[DEVICE_CAP:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 2
// CHECK: [[BP0:%.+]] = load i[[SZ]]*, i[[SZ]]** %
@@ -251,7 +239,7 @@
// CHECK-64: load i32, i32* [[AA_CADDR]], align
// CHECK-32: load i32, i32* [[AA_ADDR]], align
-// CHECK: define internal{{.*}} i32 [[TASK_ENTRY2]](i32{{.*}}, [[TASK_TY2]]* noalias)
+// CHECK: define internal{{.*}} i32 [[TASK_ENTRY2]](i32{{.*}}, [[TASK_TY2]]* noalias %1)
// CHECK: call void (i8*, ...) %
// CHECK: [[BP1_I32:%.+]] = load i32, i32* %
// CHECK-64: [[BP1_CAST:%.+]] = bitcast i[[SZ]]* [[BP1_PTR:%.+]] to i32*
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_depend_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_depend_messages.cpp
index 621f358..0b4e619 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_depend_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_depend_messages.cpp
@@ -69,7 +69,7 @@
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for depend (in : argv[0:-1]) // expected-error {{section length is evaluated to a negative value -1}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for depend (in : argv[-1:0])
+#pragma omp target teams distribute parallel for depend (in : argv[-1:0]) // expected-error {{zero-length array section is not allowed in 'depend' clause}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for depend (in : argv[:]) // expected-error {{section length is unspecified and cannot be inferred because subscripted value is not an array}}
for (i = 0; i < argc; ++i) foo();
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_firstprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_firstprivate_messages.cpp
index a03c781..b0a7da9 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_firstprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_firstprivate_messages.cpp
@@ -19,6 +19,13 @@
return argc;
}
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp target teams distribute parallel for firstprivate(fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
struct S1; // expected-note {{declared here}} expected-note{{forward declaration of 'S1'}}
extern S1 a;
class S2 {
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_if_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_if_messages.cpp
index 6df2307..d1950e6 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_if_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_if_messages.cpp
@@ -57,9 +57,9 @@
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for if(target : argc) if (target:argc) // expected-error {{directive '#pragma omp target teams distribute parallel for' cannot contain more than one 'if' clause with 'target' name modifier}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for if(parallel : argc) if (argc) // expected-error {{expected 'target' directive name modifier}} expected-note {{previous clause with directive name modifier specified here}}
+#pragma omp target teams distribute parallel for if(parallel : argc) if (argc) // expected-error {{expected 'target' directive name modifier}} expected-note {{previous clause with directive name modifier specified here}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for if(target: argc) if (argc) // expected-error {{expected 'parallel' directive name modifier}} expected-note {{previous clause with directive name modifier specified here}}
+#pragma omp target teams distribute parallel for if(target: argc) if (argc) // expected-error {{expected 'parallel' directive name modifier}} expected-note {{previous clause with directive name modifier specified here}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for if(distribute : argc) // expected-error {{directive name modifier 'distribute' is not allowed for '#pragma omp target teams distribute parallel for'}}
for (i = 0; i < argc; ++i) foo();
@@ -107,9 +107,9 @@
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for if(target: argc) if (target:argc) // expected-error {{directive '#pragma omp target teams distribute parallel for' cannot contain more than one 'if' clause with 'target' name modifier}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for if(parallel : argc) if (argc) // expected-note {{previous clause with directive name modifier specified here}} expected-error {{expected 'target' directive name modifier}}
+#pragma omp target teams distribute parallel for if(parallel : argc) if (argc) // expected-note {{previous clause with directive name modifier specified here}} expected-error {{expected 'target' directive name modifier}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for if(target: argc) if (argc) // expected-note {{previous clause with directive name modifier specified here}} expected-error {{expected 'parallel' directive name modifier}}
+#pragma omp target teams distribute parallel for if(target: argc) if (argc) // expected-note {{previous clause with directive name modifier specified here}} expected-error {{expected 'parallel' directive name modifier}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for if(distribute : argc) // expected-error {{directive name modifier 'distribute' is not allowed for '#pragma omp target teams distribute parallel for'}}
for (i = 0; i < argc; ++i) foo();
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_lastprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_lastprivate_messages.cpp
index 820010b..8f4fd88 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_lastprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_lastprivate_messages.cpp
@@ -1,6 +1,10 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,le45 -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,le45 -fopenmp-version=40 -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,le45 -fopenmp-version=45 -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,le45 -fopenmp-version=45 -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
@@ -101,6 +105,8 @@
#pragma omp target teams distribute parallel for lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
for (int k = 0; k < argc; ++k) ++k;
+#pragma omp target teams distribute parallel for lastprivate(conditional: argc) lastprivate(conditional: // expected-error 2 {{use of undeclared identifier 'conditional'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k) ++k;
#pragma omp target teams distribute parallel for lastprivate(S1) // expected-error {{'S1' does not refer to a value}}
for (int k = 0; k < argc; ++k) ++k;
@@ -240,7 +246,7 @@
#pragma omp target teams distribute parallel for lastprivate(si) // OK
for (i = 0; i < argc; ++i) si = i + 1;
-#pragma omp target teams distribute parallel for lastprivate(k) map(k) // expected-error {{lastprivate variable cannot be in a map clause in '#pragma omp target teams distribute parallel for' directive}} expected-note {{defined as lastprivate}}
+#pragma omp target teams distribute parallel for lastprivate(k) map(k) // le45-error {{lastprivate variable cannot be in a map clause in '#pragma omp target teams distribute parallel for' directive}} le45-note {{defined as lastprivate}}
for (i = 0; i < argc; ++i) foo();
return foomain<S4, S5>(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<S4, S5>' requested here}}
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_loop_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_loop_messages.cpp
index a7fe130..a57f213 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_loop_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_loop_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wno-openmp-mapping -Wuninitialized
class S {
int a;
@@ -93,28 +95,28 @@
c[ii] = a[ii];
#pragma omp target teams distribute parallel for
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
for (int i = 0; i; i++)
c[i] = a[i];
#pragma omp target teams distribute parallel for
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
// expected-error@+1 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'i'}}
for (int i = 0; jj < kk; ii++)
c[i] = a[i];
#pragma omp target teams distribute parallel for
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
for (int i = 0; !!i; i++)
c[i] = a[i];
-// Ok
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
#pragma omp target teams distribute parallel for
for (int i = 0; i != 1; i++)
c[i] = a[i];
#pragma omp target teams distribute parallel for
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
for (int i = 0;; i++)
c[i] = a[i];
@@ -265,7 +267,7 @@
}
#pragma omp target teams distribute parallel for
-// expected-error@+1 {{statement after '#pragma omp target teams distribute parallel for' must be a for loop}}
+// omp4-error@+1 {{statement after '#pragma omp target teams distribute parallel for' must be a for loop}}
for (auto &item : a) {
item = item + 1;
}
@@ -401,15 +403,15 @@
for (begin = end; begin < end; ++begin)
++begin;
#pragma omp target teams distribute parallel for
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
for (GoodIter I = begin; I - I; ++I)
++I;
#pragma omp target teams distribute parallel for
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
for (GoodIter I = begin; begin < end; ++I)
++I;
#pragma omp target teams distribute parallel for
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
for (GoodIter I = begin; !I; ++I)
++I;
#pragma omp target teams distribute parallel for
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_map_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_map_messages.cpp
index c67b183..8ded150 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_map_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_map_messages.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wno-openmp-mapping -Wuninitialized
void foo() {
}
@@ -9,6 +9,13 @@
return argc;
}
+void xxx(int argc) {
+ int map; // expected-note {{initialize the variable 'map' to silence this warning}}
+#pragma omp target teams distribute parallel for map(tofrom: map) // expected-warning {{variable 'map' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
struct S1; // expected-note 2 {{declared here}}
extern S1 a;
class S2 {
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_reduction_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_reduction_messages.cpp
index 296c0b0..cfd0b73 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_reduction_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_reduction_messages.cpp
@@ -16,6 +16,13 @@
extern const omp_allocator_handle_t omp_pteam_mem_alloc;
extern const omp_allocator_handle_t omp_thread_mem_alloc;
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp target teams distribute parallel for reduction(+:fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
void foo() {
}
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_ast_print.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_ast_print.cpp
index 86f243e..016328c 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_ast_print.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_ast_print.cpp
@@ -1,10 +1,10 @@
-// RUN: %clang_cc1 -verify -fopenmp -ast-print %s -Wno-openmp-target | FileCheck %s
-// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -fopenmp -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -ast-print %s -Wno-openmp-mapping | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -fopenmp -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s -Wno-openmp-target | FileCheck %s
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -fopenmp-simd -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s -Wno-openmp-mapping | FileCheck %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -fopenmp-simd -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s
// expected-no-diagnostics
#ifndef HEADER
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_codegen.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_codegen.cpp
index 6846aaf..2c74b18 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_codegen.cpp
@@ -52,18 +52,15 @@
// discard capture expressions for te and th
// HCK1: = alloca i32,
// HCK1: = alloca i32,
-// HCK1: = alloca i32,
-// HCK1: = alloca i32,
-// HCK1: = alloca i32,
// HCK1: [[I_CAST:%.+]] = alloca i{{32|64}},
// HCK1: [[N_CAST:%.+]] = alloca i{{32|64}},
// HCK1: [[TE_CAST:%.+]] = alloca i{{32|64}},
// HCK1: [[TH_CAST:%.+]] = alloca i{{32|64}},
-// HCK1: call void @__kmpc_push_target_tripcount(i64 -1, i64 %{{.+}})
// HCK1: [[I_PAR:%.+]] = load{{.+}}, {{.+}} [[I_CAST]],
// HCK1: [[N_PAR:%.+]] = load{{.+}}, {{.+}} [[N_CAST]],
// HCK1: [[TE_PAR:%.+]] = load{{.+}}, {{.+}} [[TE_CAST]],
// HCK1: [[TH_PAR:%.+]] = load{{.+}}, {{.+}} [[TH_CAST]],
+// HCK1: call void @__kmpc_push_target_tripcount(i64 -1, i64 %{{.+}})
// HCK1: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 5, i8** %{{[^,]+}}, i8** %{{[^,]+}},
// HCK1: call void @[[OFFL1:.+]](i{{32|64}} [[I_PAR]], i{{32|64}} [[N_PAR]], {{.+}}, i{{32|64}} [[TE_PAR]], i{{32|64}} [[TH_PAR]])
@@ -77,8 +74,7 @@
// HCK1: call void @[[OFFL2:.+]](i{{64|32}} %{{.+}})
{{{
#pragma omp target teams distribute parallel for simd is_device_ptr(g) simdlen(8)
- for(
- int i = 0; i < n; i++) {
+ for(int i = 0; i < n; i++) {
a[i] = g[0];
}
}}}
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_codegen_registration.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_codegen_registration.cpp
index 21aea54..227ca5c8 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_codegen_registration.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_codegen_registration.cpp
@@ -52,13 +52,9 @@
// CHECK-DAG: [[ST1:%.+]] = type { [228 x i32] }
// CHECK-DAG: [[ST2:%.+]] = type { [1128 x i32] }
// CHECK-DAG: [[ENTTY:%.+]] = type { i8*, i8*, i[[SZ:32|64]], i32, i32 }
-// CHECK-DAG: [[DEVTY:%.+]] = type { i8*, i8*, [[ENTTY]]*, [[ENTTY]]* }
-// CHECK-DAG: [[DSCTY:%.+]] = type { i32, [[DEVTY]]*, [[ENTTY]]*, [[ENTTY]]* }
// TCHECK: [[ENTTY:%.+]] = type { i8*, i8*, i[[SZ:32|64]], i32, i32 }
-// CHECK-DAG: $[[REGFN:\.omp_offloading\..+]] = comdat
-
// CHECK-DAG: [[A1:@.+]] = internal global [[SA]]
// CHECK-DAG: [[A2:@.+]] = global [[SA]]
// CHECK-DAG: [[B1:@.+]] = global [[SB]]
@@ -123,68 +119,60 @@
// CHECK-NTARGET-NOT: private unnamed_addr constant [1 x i
// CHECK-DAG: [[NAMEPTR1:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME1:__omp_offloading_[0-9a-f]+_[0-9a-f]+__Z.+_l[0-9]+]]\00"
-// CHECK-DAG: [[ENTRY1:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR1]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY1:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR1]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR2:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME2:.+]]\00"
-// CHECK-DAG: [[ENTRY2:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR2]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY2:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR2]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR3:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME3:.+]]\00"
-// CHECK-DAG: [[ENTRY3:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR3]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY3:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR3]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR4:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME4:.+]]\00"
-// CHECK-DAG: [[ENTRY4:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR4]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY4:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR4]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR5:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME5:.+]]\00"
-// CHECK-DAG: [[ENTRY5:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR5]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY5:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR5]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR6:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME6:.+]]\00"
-// CHECK-DAG: [[ENTRY6:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR6]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY6:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR6]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR7:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME7:.+]]\00"
-// CHECK-DAG: [[ENTRY7:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR7]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY7:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR7]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR8:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME8:.+]]\00"
-// CHECK-DAG: [[ENTRY8:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR8]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY8:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR8]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR9:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME9:.+]]\00"
-// CHECK-DAG: [[ENTRY9:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR9]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY9:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR9]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR10:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME10:.+]]\00"
-// CHECK-DAG: [[ENTRY10:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR10]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY10:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR10]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR11:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME11:.+]]\00"
-// CHECK-DAG: [[ENTRY11:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR11]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY11:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR11]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR12:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME12:.+]]\00"
-// CHECK-DAG: [[ENTRY12:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR12]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY12:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR12]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR1:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME1:__omp_offloading_[0-9a-f]+_[0-9a-f]+__Z.+_l[0-9]+]]\00"
-// TCHECK-DAG: [[ENTRY1:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR1]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY1:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR1]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR2:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME2:.+]]\00"
-// TCHECK-DAG: [[ENTRY2:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR2]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY2:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR2]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR3:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME3:.+]]\00"
-// TCHECK-DAG: [[ENTRY3:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR3]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY3:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR3]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR4:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME4:.+]]\00"
-// TCHECK-DAG: [[ENTRY4:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR4]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY4:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR4]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR5:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME5:.+]]\00"
-// TCHECK-DAG: [[ENTRY5:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR5]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY5:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR5]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR6:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME6:.+]]\00"
-// TCHECK-DAG: [[ENTRY6:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR6]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY6:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR6]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR7:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME7:.+]]\00"
-// TCHECK-DAG: [[ENTRY7:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR7]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY7:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR7]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR8:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME8:.+]]\00"
-// TCHECK-DAG: [[ENTRY8:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR8]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY8:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR8]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR9:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME9:.+]]\00"
-// TCHECK-DAG: [[ENTRY9:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR9]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY9:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR9]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR10:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME10:.+]]\00"
-// TCHECK-DAG: [[ENTRY10:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR10]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY10:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR10]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR11:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME11:.+]]\00"
-// TCHECK-DAG: [[ENTRY11:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR11]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY11:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR11]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR12:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME12:.+]]\00"
-// TCHECK-DAG: [[ENTRY12:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR12]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
-
-// CHECK: [[ENTBEGIN:@.+]] = external constant [[ENTTY]]
-// CHECK: [[ENTEND:@.+]] = external constant [[ENTTY]]
-// CHECK: [[DEVBEGIN:@.+]] = extern_weak constant i8
-// CHECK: [[DEVEND:@.+]] = extern_weak constant i8
-// CHECK: [[IMAGES:@.+]] = internal unnamed_addr constant [1 x [[DEVTY]]] [{{.+}} { i8* [[DEVBEGIN]], i8* [[DEVEND]], [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }], comdat($[[REGFN]])
-// CHECK: [[DESC:@.+]] = internal constant [[DSCTY]] { i32 1, [[DEVTY]]* getelementptr inbounds ([1 x [[DEVTY]]], [1 x [[DEVTY]]]* [[IMAGES]], i32 0, i32 0), [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }, comdat($[[REGFN]])
+// TCHECK-DAG: [[ENTRY12:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR12]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// We have 4 initializers, one for the 500 priority, another one for 501, or more for the default priority, and the last one for the offloading registration function.
-// CHECK: @llvm.global_ctors = appending global [5 x { i32, void ()*, i8* }] [
+// CHECK: @llvm.global_ctors = appending global [4 x { i32, void ()*, i8* }] [
// CHECK-SAME: { i32, void ()*, i8* } { i32 500, void ()* [[P500:@[^,]+]], i8* null },
// CHECK-SAME: { i32, void ()*, i8* } { i32 501, void ()* [[P501:@[^,]+]], i8* null },
// CHECK-SAME: { i32, void ()*, i8* } { i32 65535, void ()* [[PMAX:@[^,]+]], i8* null },
-// CHECK-SAME: { i32, void ()*, i8* } { i32 0, void ()* @[[REGFN]], i8* bitcast (void ()* @[[REGFN]] to i8*) }]
// CHECK-NTARGET: @llvm.global_ctors = appending global [3 x { i32, void ()*, i8* }] [
@@ -363,12 +351,8 @@
//TCHECK-DAG: define weak void @[[NAME12]](
// CHECK-NTARGET-NOT: __tgt_target
-// CHECK-NTARGET-NOT: __tgt_register_lib
-// CHECK-NTARGET-NOT: __tgt_unregister_lib
// TCHECK-NOT: __tgt_target
-// TCHECK-NOT: __tgt_register_lib
-// TCHECK-NOT: __tgt_unregister_lib
// We have 2 initializers with priority 500
//CHECK: define internal void [[P500]](
@@ -394,25 +378,6 @@
//CHECK-NOT: call void @{{.+}}()
//CHECK: ret void
-// Check registration and unregistration
-
-//CHECK: define internal void @.omp_offloading.requires_reg()
-//CHECK: call void @__tgt_register_requires(i64 1)
-//CHECK: ret void
-
-//CHECK: define internal void @[[UNREGFN:.+]](i8*)
-//CHECK-SAME: comdat($[[REGFN]]) {
-//CHECK: call i32 @__tgt_unregister_lib([[DSCTY]]* [[DESC]])
-//CHECK: ret void
-//CHECK: declare i32 @__tgt_unregister_lib([[DSCTY]]*)
-
-//CHECK: define linkonce hidden void @[[REGFN]]()
-//CHECK-SAME: comdat {
-//CHECK: call i32 @__tgt_register_lib([[DSCTY]]* [[DESC]])
-//CHECK: call i32 @__cxa_atexit(void (i8*)* @[[UNREGFN]], i8* bitcast ([[DSCTY]]* [[DESC]] to i8*),
-//CHECK: ret void
-//CHECK: declare i32 @__tgt_register_lib([[DSCTY]]*)
-
static __attribute__((init_priority(500))) SA a1;
SA a2;
SB __attribute__((init_priority(500))) b1;
@@ -446,31 +411,31 @@
// Check metadata is properly generated:
// CHECK: !omp_offload.info = !{!{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID:-?[0-9]+]], i32 [[FILEID:-?[0-9]+]], !"_ZN2SB3fooEv", i32 216, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SDD1Ev", i32 268, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SEC1Ev", i32 286, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SED1Ev", i32 293, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EE3fooEv", i32 305, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EEC1Ev", i32 312, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_Z3bari", i32 440, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EED1Ev", i32 319, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EEC1Ev", i32 312, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EED1Ev", i32 319, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EE3fooEv", i32 305, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SCC1Ev", i32 242, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID:-?[0-9]+]], i32 [[FILEID:-?[0-9]+]], !"_ZN2SB3fooEv", i32 204, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SDD1Ev", i32 256, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SEC1Ev", i32 274, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SED1Ev", i32 281, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EE3fooEv", i32 293, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EEC1Ev", i32 300, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_Z3bari", i32 405, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EED1Ev", i32 307, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EEC1Ev", i32 300, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EED1Ev", i32 307, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EE3fooEv", i32 293, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SCC1Ev", i32 230, i32 {{[0-9]+}}}
// TCHECK: !omp_offload.info = !{!{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID:-?[0-9]+]], i32 [[FILEID:-?[0-9]+]], !"_ZN2SB3fooEv", i32 216, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SDD1Ev", i32 268, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SEC1Ev", i32 286, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SED1Ev", i32 293, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EE3fooEv", i32 305, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EEC1Ev", i32 312, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_Z3bari", i32 440, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EED1Ev", i32 319, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EEC1Ev", i32 312, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EED1Ev", i32 319, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EE3fooEv", i32 305, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SCC1Ev", i32 242, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID:-?[0-9]+]], i32 [[FILEID:-?[0-9]+]], !"_ZN2SB3fooEv", i32 204, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SDD1Ev", i32 256, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SEC1Ev", i32 274, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SED1Ev", i32 281, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EE3fooEv", i32 293, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EEC1Ev", i32 300, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_Z3bari", i32 405, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EED1Ev", i32 307, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EEC1Ev", i32 300, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EED1Ev", i32 307, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EE3fooEv", i32 293, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SCC1Ev", i32 230, i32 {{[0-9]+}}}
#endif
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_defaultmap_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_defaultmap_messages.cpp
index 70361a1..d9a0b20 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_defaultmap_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_defaultmap_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 %s -verify=expected,omp5 -Wuninitialized -DOMP5
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 %s -verify=expected,omp5 -Wuninitialized -DOMP5
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 %s -verify=expected,omp45 -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 %s -verify=expected,omp45 -Wuninitialized
void foo() {
}
@@ -10,23 +12,23 @@
int i;
#pragma omp target teams distribute parallel for simd defaultmap // expected-error {{expected '(' after 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for simd defaultmap ( // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+#pragma omp target teams distribute parallel for simd defaultmap ( // omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for simd defaultmap () // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
+#pragma omp target teams distribute parallel for simd defaultmap () // omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for simd defaultmap (tofrom // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+#pragma omp target teams distribute parallel for simd defaultmap (tofrom // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for simd defaultmap (tofrom: // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+#pragma omp target teams distribute parallel for simd defaultmap (tofrom: // expected-error {{expected ')'}} expected-note {{to match this '('}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for simd defaultmap (tofrom) // expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+#pragma omp target teams distribute parallel for simd defaultmap (tofrom) // expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for simd defaultmap (tofrom scalar) // expected-warning {{missing ':' after defaultmap modifier - ignoring}}
+ for (i = 0; i < argc; ++i) foo();
+#pragma omp target teams distribute parallel for simd defaultmap (tofrom, // expected-error {{expected ')'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-note {{to match this '('}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for simd defaultmap (tofrom, // expected-error {{expected ')'}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-note {{to match this '('}}
+#pragma omp target teams distribute parallel for simd defaultmap (scalar: // expected-error {{expected ')'}} omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for simd defaultmap (scalar: // expected-error {{expected ')'}} expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
- for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for simd defaultmap (tofrom, scalar // expected-error {{expected ')'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
+#pragma omp target teams distribute parallel for simd defaultmap (tofrom, scalar // expected-error {{expected ')'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
return argc;
@@ -36,25 +38,24 @@
int i;
#pragma omp target teams distribute parallel for simd defaultmap // expected-error {{expected '(' after 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for simd defaultmap ( // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+#pragma omp target teams distribute parallel for simd defaultmap ( // omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for simd defaultmap () // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
+#pragma omp target teams distribute parallel for simd defaultmap () // omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for simd defaultmap (tofrom // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+#pragma omp target teams distribute parallel for simd defaultmap (tofrom // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for simd defaultmap (tofrom: // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+#pragma omp target teams distribute parallel for simd defaultmap (tofrom: // expected-error {{expected ')'}} expected-note {{to match this '('}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for simd defaultmap (tofrom) // expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+#pragma omp target teams distribute parallel for simd defaultmap (tofrom) // expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for simd defaultmap (tofrom scalar) // expected-warning {{missing ':' after defaultmap modifier - ignoring}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for simd defaultmap (tofrom, // expected-error {{expected ')'}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-note {{to match this '('}}
+#pragma omp target teams distribute parallel for simd defaultmap (tofrom, // expected-error {{expected ')'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-note {{to match this '('}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for simd defaultmap (scalar: // expected-error {{expected ')'}} expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
+#pragma omp target teams distribute parallel for simd defaultmap (scalar: // expected-error {{expected ')'}} omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for simd defaultmap (tofrom, scalar // expected-error {{expected ')'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
+#pragma omp target teams distribute parallel for simd defaultmap (tofrom, scalar // expected-error {{expected ')'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
return tmain<int, char, 1, 0>(argc, argv);
}
-
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_depend_codegen.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_depend_codegen.cpp
index 34d45e8..16c73e7 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_depend_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_depend_codegen.cpp
@@ -40,13 +40,9 @@
// CHECK-DAG: [[TT:%.+]] = type { i64, i8 }
// CHECK-DAG: [[ENTTY:%.+]] = type { i8*, i8*, i[[SZ:32|64]], i32, i32 }
-// CHECK-DAG: [[DEVTY:%.+]] = type { i8*, i8*, [[ENTTY]]*, [[ENTTY]]* }
-// CHECK-DAG: [[DSCTY:%.+]] = type { i32, [[DEVTY]]*, [[ENTTY]]*, [[ENTTY]]* }
// TCHECK: [[ENTTY:%.+]] = type { i8*, i8*, i{{32|64}}, i32, i32 }
-// CHECK-DAG: $[[REGFN:\.omp_offloading\..+]] = comdat
-
// CHECK-DAG: [[SIZET:@.+]] = private unnamed_addr constant [2 x i64] [i64 0, i64 4]
// CHECK-DAG: [[MAPT:@.+]] = private unnamed_addr constant [2 x i64] [i64 544, i64 800]
// CHECK-DAG: @{{.*}} = weak constant i8 0
@@ -55,16 +51,8 @@
// TCHECK: @{{.+}} = {{.*}}constant [[ENTTY]]
// TCHECK-NOT: @{{.+}} = weak constant [[ENTTY]]
-// Check if offloading descriptor is created.
-// CHECK: [[ENTBEGIN:@.+]] = external constant [[ENTTY]]
-// CHECK: [[ENTEND:@.+]] = external constant [[ENTTY]]
-// CHECK: [[DEVBEGIN:@.+]] = extern_weak constant i8
-// CHECK: [[DEVEND:@.+]] = extern_weak constant i8
-// CHECK: [[IMAGES:@.+]] = internal unnamed_addr constant [1 x [[DEVTY]]] [{{.+}} { i8* [[DEVBEGIN]], i8* [[DEVEND]], [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }], comdat($[[REGFN]])
-// CHECK: [[DESC:@.+]] = internal constant [[DSCTY]] { i32 1, [[DEVTY]]* getelementptr inbounds ([1 x [[DEVTY]]], [1 x [[DEVTY]]]* [[IMAGES]], i32 0, i32 0), [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }, comdat($[[REGFN]])
-
// Check target registration is registered as a Ctor.
-// CHECK: appending global [2 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }, { i32, void ()*, i8* } { i32 0, void ()* @[[REGFN]], i8* bitcast (void ()* @[[REGFN]] to i8*) }]
+// CHECK: appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }]
template<typename tx, typename ty>
@@ -193,7 +181,7 @@
// CHECK: define internal void [[HVT0:@.+]]()
-// CHECK: define internal{{.*}} i32 [[TASK_ENTRY0]](i32{{.*}}, [[TASK_TY0]]* noalias)
+// CHECK: define internal{{.*}} i32 [[TASK_ENTRY0]](i32{{.*}}, [[TASK_TY0]]* noalias %1)
// CHECK: store void (i8*, ...)* null, void (i8*, ...)** %
// CHECK: [[DEVICE_CAP:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 0
// CHECK: [[DEV:%.+]] = load i32, i32* [[DEVICE_CAP]],
@@ -209,7 +197,7 @@
// CHECK: define internal void [[HVT1:@.+]](i[[SZ]]* %{{.+}}, i[[SZ]] %{{.+}})
-// CHECK: define internal{{.*}} i32 [[TASK_ENTRY1_]](i32{{.*}}, [[TASK_TY1_]]* noalias)
+// CHECK: define internal{{.*}} i32 [[TASK_ENTRY1_]](i32{{.*}}, [[TASK_TY1_]]* noalias %1)
// CHECK: call void (i8*, ...) %
// CHECK: [[SZT:%.+]] = getelementptr inbounds [2 x i64], [2 x i64]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0
// CHECK: [[DEVICE_CAP:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 2
@@ -231,7 +219,7 @@
// CHECK: [[END]]
// CHECK: ret i32 0
-// CHECK: define internal{{.*}} i32 [[TASK_ENTRY1__]](i32{{.*}}, [[TASK_TY1__]]* noalias)
+// CHECK: define internal{{.*}} i32 [[TASK_ENTRY1__]](i32{{.*}}, [[TASK_TY1__]]* noalias %1)
// CHECK: call void (i8*, ...) %
// CHECK: [[DEVICE_CAP:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 2
// CHECK: [[BP0:%.+]] = load i[[SZ]]*, i[[SZ]]** %
@@ -251,7 +239,7 @@
// CHECK-64: load i32, i32* [[AA_CADDR]], align
// CHECK-32: load i32, i32* [[AA_ADDR]], align
-// CHECK: define internal{{.*}} i32 [[TASK_ENTRY2]](i32{{.*}}, [[TASK_TY2]]* noalias)
+// CHECK: define internal{{.*}} i32 [[TASK_ENTRY2]](i32{{.*}}, [[TASK_TY2]]* noalias %1)
// CHECK: call void (i8*, ...) %
// CHECK: [[BP1_I32:%.+]] = load i32, i32* %
// CHECK-64: [[BP1_CAST:%.+]] = bitcast i[[SZ]]* [[BP1_PTR:%.+]] to i32*
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_depend_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_depend_messages.cpp
index d0735e4..d35a5c0 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_depend_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_depend_messages.cpp
@@ -69,7 +69,7 @@
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for simd depend (in : argv[0:-1]) // expected-error {{section length is evaluated to a negative value -1}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for simd depend (in : argv[-1:0])
+#pragma omp target teams distribute parallel for simd depend (in : argv[-1:0]) // expected-error {{zero-length array section is not allowed in 'depend' clause}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for simd depend (in : argv[:]) // expected-error {{section length is unspecified and cannot be inferred because subscripted value is not an array}}
for (i = 0; i < argc; ++i) foo();
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_firstprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_firstprivate_messages.cpp
index d018421..17aa7f4 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_firstprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_firstprivate_messages.cpp
@@ -19,6 +19,13 @@
return argc;
}
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp target teams distribute parallel for simd firstprivate(fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
struct S1; // expected-note {{declared here}} expected-note{{forward declaration of 'S1'}}
extern S1 a;
class S2 {
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_if_codegen.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_if_codegen.cpp
index 79ae4fe..dda468e 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_if_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_if_codegen.cpp
@@ -1,10 +1,16 @@
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck %s --check-prefix CHECK --check-prefix OMP45
// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple %itanium_abi_triple -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple %itanium_abi_triple -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple %itanium_abi_triple -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CHECK --check-prefix OMP45
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -DOMP5 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck %s --check-prefix CHECK --check-prefix OMP50
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple %itanium_abi_triple -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple %itanium_abi_triple -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CHECK --check-prefix OMP50
// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck %s --check-prefix SIMD-ONLY
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple %itanium_abi_triple -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple %itanium_abi_triple -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix SIMD-ONLY
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck %s --check-prefix SIMD-ONLY
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple %itanium_abi_triple -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple %itanium_abi_triple -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix SIMD-ONLY
// SIMD-ONLY-NOT: {{__kmpc|__tgt}}
// expected-no-diagnostics
@@ -28,17 +34,26 @@
// CHECK: call void @__kmpc_push_target_tripcount(i64 -1, i64 100)
// CHECK: call i{{[0-9]+}} @__tgt_target_teams(
// CHECK: call void [[OFFLOADING_FUN_1:@.+]](
+#ifdef OMP5
+#pragma omp target teams distribute parallel for simd if(simd: true) nontemporal(Arg)
+#else
#pragma omp target teams distribute parallel for simd
- for(int i = 0 ; i < 100; i++) {}
+#endif // OMP5
+ for (int i = 0; i < 100; i++) {
+ Arg = 0;
+ }
// CHECK: define internal void [[OFFLOADING_FUN_0]](
- // CHECK: call {{.*}}void {{.+}} @__kmpc_fork_teams({{.+}}, i32 0, {{.+}}* [[OMP_TEAMS_OUTLINED_0:@.+]] to {{.+}})
+ // CHECK: call {{.*}}void {{.+}} @__kmpc_fork_teams({{.+}}, i32 1, {{.+}}* [[OMP_TEAMS_OUTLINED_0:@.+]] to {{.+}})
// CHECK: define{{.+}} void [[OMP_TEAMS_OUTLINED_0]](
// CHECK: call void @__kmpc_for_static_init_4(
- // CHECK: call void {{.+}} @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{.+}} 2, {{.+}}* [[OMP_OUTLINED_0:@.+]] to void
+ // OMP50: load i32,{{.*}}!nontemporal
+ // CHECK: call void {{.+}} @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{.+}} 3, {{.+}}* [[OMP_OUTLINED_0:@.+]] to void
// CHECK: call void @__kmpc_for_static_fini(
// CHECK: define{{.+}} void [[OMP_OUTLINED_0]](
// CHECK: call void @__kmpc_for_static_init_4(
+ // OMP45-NOT: !nontemporal
+ // OMP50: store i32 0,{{.*}}!nontemporal
// CHECK: call void @__kmpc_for_static_fini(
// CHECK: ret
#pragma omp target teams distribute parallel for simd if (parallel: false)
@@ -132,7 +147,8 @@
// CHECK: define{{.+}} void [[OMP_TEAMS_OUTLINED_2]](
// CHECK: call void @__kmpc_for_static_init_4(
- // CHECK: call void {{.+}} @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{.+}} 2, {{.+}}* [[OMP_OUTLINED_4:@.+]] to void
+ // OMP45: call void {{.+}} @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{.+}} 2, {{.+}}* [[OMP_OUTLINED_4:@.+]] to void
+ // OMP50: call void {{.+}} @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{.+}} 3, {{.+}}* [[OMP_OUTLINED_4:@.+]] to void
// CHECK: call void @__kmpc_serialized_parallel(
// CHECK: call void [[OMP_OUTLINED_4:@.+]](
// CHECK: call void @__kmpc_end_serialized_parallel(
@@ -184,3 +200,8 @@
// CHECK: call void @__kmpc_for_static_fini(
// CHECK: ret void
#endif
+
+// OMP45-NOT: !{!"llvm.loop.vectorize.enable", i1 false}
+// CHECK-DAG: !{!"llvm.loop.vectorize.enable", i1 true}
+// OMP45-NOT: !{!"llvm.loop.vectorize.enable", i1 false}
+// OMP50-DAG: !{!"llvm.loop.vectorize.enable", i1 false}
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_if_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_if_messages.cpp
index e88c1f1..4701f5c 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_if_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_if_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp -fopenmp-version=50 -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-simd -fopenmp-version=50 -ferror-limit 100 %s -Wuninitialized
void foo() {
}
@@ -60,15 +62,15 @@
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for simd if(target: argc)
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for simd if(parallel : argc) if (for:argc) // expected-error {{directive name modifier 'for' is not allowed for '#pragma omp target teams distribute parallel for simd'}}
+#pragma omp target teams distribute parallel for simd if(parallel : argc) if (simd:argc) // omp45-error {{directive name modifier 'simd' is not allowed for '#pragma omp target teams distribute parallel for simd'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for simd if(parallel : argc) if (parallel:argc) // expected-error {{directive '#pragma omp target teams distribute parallel for simd' cannot contain more than one 'if' clause with 'parallel' name modifier}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for simd if(target: argc) if (target:argc) // expected-error {{directive '#pragma omp target teams distribute parallel for simd' cannot contain more than one 'if' clause with 'target' name modifier}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for simd if(parallel : argc) if (argc) // expected-note {{previous clause with directive name modifier specified here}} expected-error {{expected 'target' directive name modifier}}
+#pragma omp target teams distribute parallel for simd if(parallel : argc) if (argc) // expected-note {{previous clause with directive name modifier specified here}} omp45-error {{expected 'target' directive name modifier}} omp50-error {{expected one of 'target' or 'simd' directive name modifiers}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for simd if(target: argc) if (argc) // expected-note {{previous clause with directive name modifier specified here}} expected-error {{expected 'parallel' directive name modifier}}
+#pragma omp target teams distribute parallel for simd if(target: argc) if (argc) // expected-note {{previous clause with directive name modifier specified here}} omp45-error {{expected 'parallel' directive name modifier}} omp50-error {{expected one of 'parallel' or 'simd' directive name modifiers}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for simd if(distribute : argc) // expected-error {{directive name modifier 'distribute' is not allowed for '#pragma omp target teams distribute parallel for simd'}}
for (i = 0; i < argc; ++i) foo();
@@ -122,15 +124,15 @@
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for simd if(target: argc)
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for simd if(parallel : argc) if (for:argc) // expected-error {{directive name modifier 'for' is not allowed for '#pragma omp target teams distribute parallel for simd'}}
+#pragma omp target teams distribute parallel for simd if(parallel : argc) if (simd:argc) // omp45-error {{directive name modifier 'simd' is not allowed for '#pragma omp target teams distribute parallel for simd'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for simd if(parallel : argc) if (parallel:argc) // expected-error {{directive '#pragma omp target teams distribute parallel for simd' cannot contain more than one 'if' clause with 'parallel' name modifier}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for simd if(target: argc) if (target:argc) // expected-error {{directive '#pragma omp target teams distribute parallel for simd' cannot contain more than one 'if' clause with 'target' name modifier}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for simd if(parallel : argc) if (argc) // expected-note {{previous clause with directive name modifier specified here}} expected-error {{expected 'target' directive name modifier}}
+#pragma omp target teams distribute parallel for simd if(parallel : argc) if (argc) // expected-note {{previous clause with directive name modifier specified here}} omp45-error {{expected 'target' directive name modifier}} omp50-error {{expected one of 'target' or 'simd' directive name modifiers}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for simd if(target: argc) if (argc) // expected-note {{previous clause with directive name modifier specified here}} expected-error {{expected 'parallel' directive name modifier}}
+#pragma omp target teams distribute parallel for simd if(target: argc) if (argc) // expected-note {{previous clause with directive name modifier specified here}} omp45-error {{expected 'parallel' directive name modifier}} omp50-error {{expected one of 'parallel' or 'simd' directive name modifiers}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for simd if(distribute : argc) // expected-error {{directive name modifier 'distribute' is not allowed for '#pragma omp target teams distribute parallel for simd'}}
for (i = 0; i < argc; ++i) foo();
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_lastprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_lastprivate_messages.cpp
index c273321..0553874 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_lastprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_lastprivate_messages.cpp
@@ -1,6 +1,10 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,le45 -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,le45 -fopenmp-version=40 -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,le45 -fopenmp-version=45 -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected -fopenmp-version=50 -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,le45 -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected -fopenmp-version=50 -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
@@ -101,6 +105,9 @@
#pragma omp target teams distribute parallel for simd lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
for (int k = 0; k < argc; ++k) ++k;
+#pragma omp target teams distribute parallel for simd lastprivate(conditional: argc) lastprivate(conditional: // expected-error 2 {{use of undeclared identifier 'conditional'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k) ++k;
+
#pragma omp target teams distribute parallel for simd lastprivate(S1) // expected-error {{'S1' does not refer to a value}}
for (int k = 0; k < argc; ++k) ++k;
@@ -240,7 +247,7 @@
#pragma omp target teams distribute parallel for simd lastprivate(si) // OK
for (i = 0; i < argc; ++i) si = i + 1;
-#pragma omp target teams distribute parallel for simd lastprivate(k) map(k) // expected-error {{lastprivate variable cannot be in a map clause in '#pragma omp target teams distribute parallel for simd' directive}} expected-note {{defined as lastprivate}}
+#pragma omp target teams distribute parallel for simd lastprivate(k) map(k) // le45-error {{lastprivate variable cannot be in a map clause in '#pragma omp target teams distribute parallel for simd' directive}} le45-note {{defined as lastprivate}}
for (i = 0; i < argc; ++i) foo();
return foomain<S4, S5>(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<S4, S5>' requested here}}
}
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_linear_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_linear_messages.cpp
index 111fe99..371a7ef 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_linear_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_linear_messages.cpp
@@ -12,6 +12,13 @@
extern const omp_allocator_handle_t omp_pteam_mem_alloc;
extern const omp_allocator_handle_t omp_thread_mem_alloc;
+void xxx(int argc) {
+ int i, step; // expected-note {{initialize the variable 'step' to silence this warning}}
+#pragma omp target teams distribute parallel for simd linear(i : step) // expected-warning {{variable 'step' is uninitialized when used here}}
+ for (i = 0; i < 10; ++i)
+ ;
+}
+
namespace X {
int x;
};
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_loop_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_loop_messages.cpp
index fda6b5f..956b54a 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_loop_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_loop_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wno-openmp-mapping -Wuninitialized
class S {
int a;
@@ -93,28 +95,28 @@
c[ii] = a[ii];
#pragma omp target teams distribute parallel for simd
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
for (int i = 0; i; i++)
c[i] = a[i];
#pragma omp target teams distribute parallel for simd
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
// expected-error@+1 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'i'}}
for (int i = 0; jj < kk; ii++)
c[i] = a[i];
#pragma omp target teams distribute parallel for simd
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
for (int i = 0; !!i; i++)
c[i] = a[i];
-// Ok
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
#pragma omp target teams distribute parallel for simd
for (int i = 0; i != 1; i++)
c[i] = a[i];
#pragma omp target teams distribute parallel for simd
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
for (int i = 0;; i++)
c[i] = a[i];
@@ -245,13 +247,13 @@
for (ii = 0; ii < 10; ii++)
c[ii] = a[ii];
-// expected-error@+2 {{loop iteration variable in the associated loop of 'omp target teams distribute parallel for simd' directive may not be private, predetermined as linear}}
-#pragma omp target teams distribute parallel for simd private(ii) // expected-note {{defined as private}}
+// omp4-error@+2 {{loop iteration variable in the associated loop of 'omp target teams distribute parallel for simd' directive may not be private, predetermined as linear}}
+#pragma omp target teams distribute parallel for simd private(ii) // omp4-note {{defined as private}}
for (ii = 0; ii < 10; ii++)
c[ii] = a[ii];
-// expected-error@+2 {{loop iteration variable in the associated loop of 'omp target teams distribute parallel for simd' directive may not be lastprivate, predetermined as linear}}
-#pragma omp target teams distribute parallel for simd lastprivate(ii) // expected-note {{defined as lastprivate}}
+// omp4-error@+2 {{loop iteration variable in the associated loop of 'omp target teams distribute parallel for simd' directive may not be lastprivate, predetermined as linear}}
+#pragma omp target teams distribute parallel for simd lastprivate(ii) // omp4-note {{defined as lastprivate}}
for (ii = 0; ii < 10; ii++)
c[ii] = a[ii];
@@ -267,7 +269,7 @@
c[globalii] += a[globalii] + ii;
}
-// expected-error@+2 {{statement after '#pragma omp target teams distribute parallel for simd' must be a for loop}}
+// omp4-error@+2 {{statement after '#pragma omp target teams distribute parallel for simd' must be a for loop}}
#pragma omp target teams distribute parallel for simd
for (auto &item : a) {
item = item + 1;
@@ -404,15 +406,15 @@
for (begin = end; begin < end; ++begin)
++begin;
#pragma omp target teams distribute parallel for simd
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
for (GoodIter I = begin; I - I; ++I)
++I;
#pragma omp target teams distribute parallel for simd
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
for (GoodIter I = begin; begin < end; ++I)
++I;
#pragma omp target teams distribute parallel for simd
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
for (GoodIter I = begin; !I; ++I)
++I;
#pragma omp target teams distribute parallel for simd
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_map_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_map_messages.cpp
index 9081848..561c36b 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_map_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_map_messages.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wno-openmp-mapping -Wuninitialized
void foo() {
}
@@ -9,6 +9,13 @@
return argc;
}
+void xxx(int argc) {
+ int map; // expected-note {{initialize the variable 'map' to silence this warning}}
+#pragma omp target teams distribute parallel for simd map(to: map) // expected-warning {{variable 'map' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
struct S1; // expected-note 2 {{declared here}}
extern S1 a;
class S2 {
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_misc_messages.c b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_misc_messages.c
index f2a870e..97a7607 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_misc_messages.c
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_misc_messages.c
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=45 -verify=expected,omp45 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -verify=expected,omp50 %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=45 -verify=expected,omp45 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -verify=expected,omp50 %s -Wuninitialized
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp target teams distribute parallel for simd'}}
#pragma omp target teams distribute parallel for simd
@@ -319,3 +321,87 @@
}
}
+void test_nontemporal() {
+ int i;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target teams distribute parallel for simd'}} expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp target teams distribute parallel for simd nontemporal(
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target teams distribute parallel for simd'}} expected-error@+1 2 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp target teams distribute parallel for simd nontemporal(,
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target teams distribute parallel for simd'}} expected-error@+1 2 {{expected expression}}
+#pragma omp target teams distribute parallel for simd nontemporal(, )
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target teams distribute parallel for simd'}} expected-error@+1 {{expected expression}}
+#pragma omp target teams distribute parallel for simd nontemporal()
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target teams distribute parallel for simd'}} expected-error@+1 {{expected expression}}
+#pragma omp target teams distribute parallel for simd nontemporal(int)
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target teams distribute parallel for simd'}} omp50-error@+1 {{expected variable name}}
+#pragma omp target teams distribute parallel for simd nontemporal(0)
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target teams distribute parallel for simd'}} expected-error@+1 {{use of undeclared identifier 'x'}}
+#pragma omp target teams distribute parallel for simd nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+// expected-error@+2 {{use of undeclared identifier 'x'}}
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target teams distribute parallel for simd'}} expected-error@+1 {{use of undeclared identifier 'y'}}
+#pragma omp target teams distribute parallel for simd nontemporal(x, y)
+ for (i = 0; i < 16; ++i)
+ ;
+// expected-error@+3 {{use of undeclared identifier 'x'}}
+// expected-error@+2 {{use of undeclared identifier 'y'}}
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target teams distribute parallel for simd'}} expected-error@+1 {{use of undeclared identifier 'z'}}
+#pragma omp target teams distribute parallel for simd nontemporal(x, y, z)
+ for (i = 0; i < 16; ++i)
+ ;
+
+ int x, y;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target teams distribute parallel for simd'}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp target teams distribute parallel for simd nontemporal(x :)
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target teams distribute parallel for simd'}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}}
+#pragma omp target teams distribute parallel for simd nontemporal(x :, )
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp50-note@+2 {{defined as nontemporal}}
+// omp45-error@+1 2 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target teams distribute parallel for simd'}} omp50-error@+1 {{a variable cannot appear in more than one nontemporal clause}}
+#pragma omp target teams distribute parallel for simd nontemporal(x) nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target teams distribute parallel for simd'}}
+#pragma omp target teams distribute parallel for simd private(x) nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target teams distribute parallel for simd'}}
+#pragma omp target teams distribute parallel for simd nontemporal(x) private(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target teams distribute parallel for simd'}} expected-note@+1 {{to match this '('}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}} expected-error@+1 {{expected ')'}}
+#pragma omp target teams distribute parallel for simd nontemporal(x, y : 0)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target teams distribute parallel for simd'}}
+#pragma omp target teams distribute parallel for simd nontemporal(x) lastprivate(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target teams distribute parallel for simd'}}
+#pragma omp target teams distribute parallel for simd lastprivate(x) nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+}
+
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_reduction_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_reduction_messages.cpp
index 9336d94..6d76945 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_reduction_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_reduction_messages.cpp
@@ -16,6 +16,13 @@
extern const omp_allocator_handle_t omp_pteam_mem_alloc;
extern const omp_allocator_handle_t omp_thread_mem_alloc;
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp target teams distribute parallel for simd reduction(+:fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
void foo() {
}
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_reduction_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_reduction_messages.cpp
index b0f30e2..2608055 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_reduction_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_reduction_messages.cpp
@@ -16,6 +16,13 @@
extern const omp_allocator_handle_t omp_pteam_mem_alloc;
extern const omp_allocator_handle_t omp_thread_mem_alloc;
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp target teams distribute reduction(+:fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
void foo() {
}
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_ast_print.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_ast_print.cpp
index cf3e8fe..6e74c2b 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_ast_print.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_ast_print.cpp
@@ -1,10 +1,16 @@
-// RUN: %clang_cc1 -verify -fopenmp -ast-print %s -Wno-openmp-target | FileCheck %s
-// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -fopenmp -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -DOMP5 -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50
-// RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s -Wno-openmp-target | FileCheck %s
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -fopenmp-simd -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50
// expected-no-diagnostics
#ifndef HEADER
@@ -191,10 +197,15 @@
// CHECK: #pragma omp target teams distribute simd simdlen(clen - 1)
// CHECK-NEXT: for (int k = 0; k < 10; ++k)
// CHECK-NEXT: e += d + argc;
+#ifdef OMP5
+#pragma omp target teams distribute simd safelen(clen-1) aligned(arr:N+6) if(simd:argc) nontemporal(argc, c, d)
+#else
#pragma omp target teams distribute simd safelen(clen-1) aligned(arr:N+6)
+#endif // OMP5
for (int k = 0; k < 10; ++k)
e += d + argc + arr[k];
-// CHECK: #pragma omp target teams distribute simd safelen(clen - 1) aligned(arr: N + 6)
+// OMP45: #pragma omp target teams distribute simd safelen(clen - 1) aligned(arr: N + 6)
+// OMP50: #pragma omp target teams distribute simd safelen(clen - 1) aligned(arr: N + 6) if(simd: argc) nontemporal(argc,c,d)
// CHECK-NEXT: for (int k = 0; k < 10; ++k)
// CHECK-NEXT: e += d + argc + arr[k];
return (0);
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_codegen.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_codegen.cpp
index 37615f0..4912352 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_codegen.cpp
@@ -1,37 +1,65 @@
// Test host codegen.
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-64
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64 --check-prefix OMP45
// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-64
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-32
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64 --check-prefix OMP45
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32 --check-prefix OMP45
// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-32
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32 --check-prefix OMP45
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64 --check-prefix OMP50
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64 --check-prefix OMP50
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32 --check-prefix OMP50
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32 --check-prefix OMP50
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
// Test target codegen - host bc file has to be created first.
// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm-bc %s -o %t-ppc-host.bc
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix TCHECK --check-prefix TCHECK-64
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck %s --check-prefix TCHECK --check-prefix TCHECK-64 --check-prefix TOMP45
// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o %t %s
-// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix TCHECK --check-prefix TCHECK-64
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix TCHECK --check-prefix TCHECK-64 --check-prefix TOMP45
// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm-bc %s -o %t-x86-host.bc
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix TCHECK --check-prefix TCHECK-32
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o - | FileCheck %s --check-prefix TCHECK --check-prefix TCHECK-32 --check-prefix TOMP45
// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o %t %s
-// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix TCHECK --check-prefix TCHECK-32
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix TCHECK --check-prefix TCHECK-32 --check-prefix TOMP45
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm-bc %s -o %t-ppc-host.bc
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck %s --check-prefix TCHECK --check-prefix TCHECK-64 --check-prefix TOMP50
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix TCHECK --check-prefix TCHECK-64 --check-prefix TOMP50
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm-bc %s -o %t-x86-host.bc
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o - | FileCheck %s --check-prefix TCHECK --check-prefix TCHECK-32 --check-prefix TOMP50
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix TCHECK --check-prefix TCHECK-32 --check-prefix TOMP50
// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm-bc %s -o %t-ppc-host.bc
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck --check-prefix SIMD-ONLY1 %s
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY1 %s
// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm-bc %s -o %t-x86-host.bc
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o - | FileCheck --check-prefix SIMD-ONLY1 %s
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm-bc %s -o %t-ppc-host.bc
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm-bc %s -o %t-x86-host.bc
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o - | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY1 %s
// SIMD-ONLY1-NOT: {{__kmpc|__tgt}}
// expected-no-diagnostics
@@ -45,13 +73,9 @@
// CHECK-DAG: [[TT:%.+]] = type { i64, i8 }
// CHECK-DAG: [[S1:%.+]] = type { double }
// CHECK-DAG: [[ENTTY:%.+]] = type { i8*, i8*, i[[SZ:32|64]], i32, i32 }
-// CHECK-DAG: [[DEVTY:%.+]] = type { i8*, i8*, [[ENTTY]]*, [[ENTTY]]* }
-// CHECK-DAG: [[DSCTY:%.+]] = type { i32, [[DEVTY]]*, [[ENTTY]]*, [[ENTTY]]* }
// TCHECK: [[ENTTY:%.+]] = type { i8*, i8*, i{{32|64}}, i32, i32 }
-// CHECK-DAG: $[[REGFN:\.omp_offloading\..+]] = comdat
-
// We have 8 target regions, but only 7 that actually will generate offloading
// code, only 6 will have mapped arguments, and only 4 have all-constant map
// sizes.
@@ -63,7 +87,8 @@
// CHECK-DAG: [[SIZET3:@.+]] = private unnamed_addr constant [2 x i64] [i64 4, i64 2]
// CHECK-DAG: [[MAPT3:@.+]] = private unnamed_addr constant [2 x i64] [i64 800, i64 800]
// CHECK-DAG: [[MAPT4:@.+]] = private unnamed_addr constant [9 x i64] [i64 800, i64 547, i64 800, i64 547, i64 547, i64 800, i64 800, i64 547, i64 547]
-// CHECK-DAG: [[MAPT5:@.+]] = private unnamed_addr constant [6 x i64] [i64 32, i64 281474976711171, i64 800, i64 800, i64 800, i64 547]
+// OMP45-DAG: [[MAPT5:@.+]] = private unnamed_addr constant [6 x i64] [i64 32, i64 281474976711171, i64 800, i64 800, i64 800, i64 547]
+// OMP50-DAG: [[MAPT5:@.+]] = private unnamed_addr constant [7 x i64] [i64 32, i64 281474976711171, i64 800, i64 800, i64 800, i64 547, i64 800]
// CHECK-DAG: [[SIZET6:@.+]] = private unnamed_addr constant [5 x i64] [i64 4, i64 4, i64 2, i64 1, i64 40]
// CHECK-DAG: [[MAPT6:@.+]] = private unnamed_addr constant [5 x i64] [i64 800, i64 800, i64 800, i64 800, i64 547]
// CHECK-DAG: [[SIZET7:@.+]] = private unnamed_addr constant [3 x i64] [i64 4, i64 2, i64 40]
@@ -85,16 +110,8 @@
// TCHECK: @{{.+}} = weak constant [[ENTTY]]
// TCHECK-NOT: @{{.+}} = weak constant [[ENTTY]]
-// Check if offloading descriptor is created.
-// CHECK: [[ENTBEGIN:@.+]] = external constant [[ENTTY]]
-// CHECK: [[ENTEND:@.+]] = external constant [[ENTTY]]
-// CHECK: [[DEVBEGIN:@.+]] = extern_weak constant i8
-// CHECK: [[DEVEND:@.+]] = extern_weak constant i8
-// CHECK: [[IMAGES:@.+]] = internal unnamed_addr constant [1 x [[DEVTY]]] [{{.+}} { i8* [[DEVBEGIN]], i8* [[DEVEND]], [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }], comdat($[[REGFN]])
-// CHECK: [[DESC:@.+]] = internal constant [[DSCTY]] { i32 1, [[DEVTY]]* getelementptr inbounds ([1 x [[DEVTY]]], [1 x [[DEVTY]]]* [[IMAGES]], i32 0, i32 0), [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }, comdat($[[REGFN]])
-
// Check target registration is registered as a Ctor.
-// CHECK: appending global [2 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }, { i32, void ()*, i8* } { i32 0, void ()* @[[REGFN]], i8* bitcast (void ()* @[[REGFN]] to i8*) }]
+// CHECK: appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }]
template<typename tx, typename ty>
@@ -147,7 +164,11 @@
}
// CHECK: call void [[HVT1:@.+]](i[[SZ]] {{[^,]+}})
+#ifdef OMP5
+ #pragma omp target teams distribute simd if(target: 0) safelen(32) linear(a) if(simd: 1) nontemporal(a)
+#else
#pragma omp target teams distribute simd if(target: 0) safelen(32) linear(a)
+#endif // OMP5
for (a = 0; a < 10; ++a) {
a += 1;
}
@@ -266,48 +287,48 @@
// The names below are not necessarily consistent with the names used for the
// addresses above as some are repeated.
- // CHECK-DAG: store i[[SZ]] [[VLA0]], i[[SZ]]* [[CBPADDR0:%.+]],
- // CHECK-DAG: store i[[SZ]] [[VLA0]], i[[SZ]]* [[CPADDR0:%.+]],
+ // CHECK-DAG: store i[[SZ]] [[A_CVAL]], i[[SZ]]* [[CBPADDR0:%.+]],
+ // CHECK-DAG: store i[[SZ]] [[A_CVAL]], i[[SZ]]* [[CPADDR0:%.+]],
// CHECK-DAG: [[CBPADDR0]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
// CHECK-DAG: [[CPADDR0]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
- // CHECK-DAG: store i64 {{4|8}}, i64* {{%[^,]+}}
+ // CHECK-DAG: store i64 4, i64* {{%[^,]+}}
- // CHECK-DAG: store i[[SZ]] [[VLA1]], i[[SZ]]* [[CBPADDR1:%.+]],
- // CHECK-DAG: store i[[SZ]] [[VLA1]], i[[SZ]]* [[CPADDR1:%.+]],
- // CHECK-DAG: [[CBPADDR1]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
- // CHECK-DAG: [[CPADDR1]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
- // CHECK-DAG: store i64 {{4|8}}, i64* {{%[^,]+}}
+ // CHECK-DAG: store [10 x float]* %{{.+}}, [10 x float]** [[CBPADDR1:%.+]],
+ // CHECK-DAG: store [10 x float]* %{{.+}}, [10 x float]** [[CPADDR1:%.+]],
+ // CHECK-DAG: [[CBPADDR1]] = bitcast i8** {{%[^,]+}} to [10 x float]**
+ // CHECK-DAG: [[CPADDR1]] = bitcast i8** {{%[^,]+}} to [10 x float]**
+ // CHECK-DAG: store i64 40, i64* {{%[^,]+}}
- // CHECK-DAG: store i[[SZ]] 5, i[[SZ]]* [[CBPADDR2:%.+]],
- // CHECK-DAG: store i[[SZ]] 5, i[[SZ]]* [[CPADDR2:%.+]],
+ // CHECK-DAG: store i[[SZ]] [[VLA0]], i[[SZ]]* [[CBPADDR2:%.+]],
+ // CHECK-DAG: store i[[SZ]] [[VLA0]], i[[SZ]]* [[CPADDR2:%.+]],
// CHECK-DAG: [[CBPADDR2]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
// CHECK-DAG: [[CPADDR2]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
// CHECK-DAG: store i64 {{4|8}}, i64* {{%[^,]+}}
- // CHECK-DAG: store i[[SZ]] [[A_CVAL]], i[[SZ]]* [[CBPADDR3:%.+]],
- // CHECK-DAG: store i[[SZ]] [[A_CVAL]], i[[SZ]]* [[CPADDR3:%.+]],
- // CHECK-DAG: [[CBPADDR3]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
- // CHECK-DAG: [[CPADDR3]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
- // CHECK-DAG: store i64 4, i64* {{%[^,]+}}
-
- // CHECK-DAG: store [10 x float]* %{{.+}}, [10 x float]** [[CBPADDR4:%.+]],
- // CHECK-DAG: store [10 x float]* %{{.+}}, [10 x float]** [[CPADDR4:%.+]],
- // CHECK-DAG: [[CBPADDR4]] = bitcast i8** {{%[^,]+}} to [10 x float]**
- // CHECK-DAG: [[CPADDR4]] = bitcast i8** {{%[^,]+}} to [10 x float]**
- // CHECK-DAG: store i64 40, i64* {{%[^,]+}}
-
- // CHECK-DAG: store float* %{{.+}}, float** [[CBPADDR5:%.+]],
- // CHECK-DAG: store float* %{{.+}}, float** [[CPADDR5:%.+]],
- // CHECK-DAG: [[CBPADDR5]] = bitcast i8** {{%[^,]+}} to float**
- // CHECK-DAG: [[CPADDR5]] = bitcast i8** {{%[^,]+}} to float**
+ // CHECK-DAG: store float* %{{.+}}, float** [[CBPADDR3:%.+]],
+ // CHECK-DAG: store float* %{{.+}}, float** [[CPADDR3:%.+]],
+ // CHECK-DAG: [[CBPADDR3]] = bitcast i8** {{%[^,]+}} to float**
+ // CHECK-DAG: [[CPADDR3]] = bitcast i8** {{%[^,]+}} to float**
// CHECK-DAG: store i64 [[BNSIZE]], i64* {{%[^,]+}}
- // CHECK-DAG: store [5 x [10 x double]]* %{{.+}}, [5 x [10 x double]]** [[CBPADDR6:%.+]],
- // CHECK-DAG: store [5 x [10 x double]]* %{{.+}}, [5 x [10 x double]]** [[CPADDR6:%.+]],
- // CHECK-DAG: [[CBPADDR6]] = bitcast i8** {{%[^,]+}} to [5 x [10 x double]]**
- // CHECK-DAG: [[CPADDR6]] = bitcast i8** {{%[^,]+}} to [5 x [10 x double]]**
+ // CHECK-DAG: store [5 x [10 x double]]* %{{.+}}, [5 x [10 x double]]** [[CBPADDR4:%.+]],
+ // CHECK-DAG: store [5 x [10 x double]]* %{{.+}}, [5 x [10 x double]]** [[CPADDR4:%.+]],
+ // CHECK-DAG: [[CBPADDR4]] = bitcast i8** {{%[^,]+}} to [5 x [10 x double]]**
+ // CHECK-DAG: [[CPADDR4]] = bitcast i8** {{%[^,]+}} to [5 x [10 x double]]**
// CHECK-DAG: store i64 400, i64* {{%[^,]+}}
+ // CHECK-DAG: store i[[SZ]] 5, i[[SZ]]* [[CBPADDR5:%.+]],
+ // CHECK-DAG: store i[[SZ]] 5, i[[SZ]]* [[CPADDR5:%.+]],
+ // CHECK-DAG: [[CBPADDR5]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
+ // CHECK-DAG: [[CPADDR5]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
+ // CHECK-DAG: store i64 {{4|8}}, i64* {{%[^,]+}}
+
+ // CHECK-DAG: store i[[SZ]] [[VLA1]], i[[SZ]]* [[CBPADDR6:%.+]],
+ // CHECK-DAG: store i[[SZ]] [[VLA1]], i[[SZ]]* [[CPADDR6:%.+]],
+ // CHECK-DAG: [[CBPADDR6]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
+ // CHECK-DAG: [[CPADDR6]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
+ // CHECK-DAG: store i64 {{4|8}}, i64* {{%[^,]+}}
+
// CHECK-DAG: store double* %{{.+}}, double** [[CBPADDR7:%.+]],
// CHECK-DAG: store double* %{{.+}}, double** [[CPADDR7:%.+]],
// CHECK-DAG: [[CBPADDR7]] = bitcast i8** {{%[^,]+}} to double**
@@ -374,6 +395,8 @@
// CHECK: [[AA_ADDR:%.+]] = alloca i[[SZ]], align
// CHECK: store i[[SZ]] %{{.+}}, i[[SZ]]* [[AA_ADDR]], align
// CHECK-64: [[AA_CADDR:%.+]] = bitcast i[[SZ]]* [[AA_ADDR]] to i32*
+// OMP45-NOT: !nontemporal
+// OMP50: load i32,{{.*}}!nontemporal
// CHECK-64: store i32 10, i32* [[AA_CADDR]], align
// CHECK-32: store i32 10, i32* [[AA_ADDR]], align
// CHECK: ret void
@@ -519,7 +542,7 @@
int b = n+1;
short int c[2][n];
- #pragma omp target teams distribute simd if(target: n>60)
+ #pragma omp target teams distribute simd if(n>60)
for (int i = 0; i < 10; ++i) {
this->a = (double)b + 1.5;
c[1][1] = ++a;
@@ -561,7 +584,9 @@
// CHECK-32: store i32 %{{.+}}, i32* [[B_ADDR:%.+]],
// CHECK-32: [[B_CVAL:%.+]] = load i[[SZ]], i[[SZ]]* [[B_ADDR]],
-// CHECK: [[IF:%.+]] = icmp sgt i32 {{[^,]+}}, 60
+// OMP45: [[IF:%.+]] = icmp sgt i32 {{[^,]+}}, 60
+// OMP50: store i8
+// OMP50: [[IF:%.+]] = trunc i8 %{{.+}} to i1
// CHECK: br i1 [[IF]], label %[[TRY:[^,]+]], label %[[FAIL:[^,]+]]
// CHECK: [[TRY]]
// We capture 2 VLA sizes in this target region
@@ -570,42 +595,67 @@
// CHECK-32: [[CSZSIZE:%.+]] = mul nuw i32 [[CELEMSIZE2]], 2
// CHECK-32: [[CSIZE:%.+]] = sext i32 [[CSZSIZE]] to i64
-// CHECK-DAG: [[RET:%.+]] = call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 6, i8** [[BPR:%[^,]+]], i8** [[PR:%[^,]+]], i64* [[SR:%[^,]+]], i64* getelementptr inbounds ([6 x i64], [6 x i64]* [[MAPT5]], i32 0, i32 0), i32 0, i32 1)
-// CHECK-DAG: [[BPR]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP:%.+]], i32 0, i32 0
-// CHECK-DAG: [[PR]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P:%.+]], i32 0, i32 0
-// CHECK-DAG: [[SR]] = getelementptr inbounds [6 x i64], [6 x i64]* [[S:%.+]], i32 0, i32 0
-// CHECK-DAG: [[SADDR0:%.+]] = getelementptr inbounds [6 x i64], [6 x i64]* [[S]], i32 [[IDX0:[0-9]+]]
-// CHECK-DAG: [[BPADDR0:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP]], i32 [[IDX0]]
-// CHECK-DAG: [[PADDR0:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P]], i32 [[IDX0]]
-// CHECK-DAG: [[SADDR1:%.+]] = getelementptr inbounds [6 x i64], [6 x i64]* [[S]], i32 [[IDX1:[0-9]+]]
-// CHECK-DAG: [[BPADDR1:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP]], i32 [[IDX1]]
-// CHECK-DAG: [[PADDR1:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P]], i32 [[IDX1]]
-// CHECK-DAG: [[SADDR2:%.+]] = getelementptr inbounds [6 x i64], [6 x i64]* [[S]], i32 [[IDX2:[0-9]+]]
-// CHECK-DAG: [[BPADDR2:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP]], i32 [[IDX2]]
-// CHECK-DAG: [[PADDR2:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P]], i32 [[IDX2]]
-// CHECK-DAG: [[SADDR3:%.+]] = getelementptr inbounds [6 x i64], [6 x i64]* [[S]], i32 [[IDX3:[0-9]+]]
-// CHECK-DAG: [[BPADDR3:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP]], i32 [[IDX3]]
-// CHECK-DAG: [[PADDR3:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P]], i32 [[IDX3]]
-// CHECK-DAG: [[SADDR4:%.+]] = getelementptr inbounds [6 x i64], [6 x i64]* [[S]], i32 [[IDX3:[0-9]+]]
-// CHECK-DAG: [[BPADDR4:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP]], i32 [[IDX3]]
-// CHECK-DAG: [[PADDR4:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P]], i32 [[IDX3]]
-// CHECK-DAG: [[SADDR5:%.+]] = getelementptr inbounds [6 x i64], [6 x i64]* [[S]], i32 [[IDX3:[0-9]+]]
-// CHECK-DAG: [[BPADDR5:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP]], i32 [[IDX3]]
-// CHECK-DAG: [[PADDR5:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P]], i32 [[IDX3]]
+// OMP45-DAG: [[RET:%.+]] = call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 6, i8** [[BPR:%[^,]+]], i8** [[PR:%[^,]+]], i64* [[SR:%[^,]+]], i64* getelementptr inbounds ([6 x i64], [6 x i64]* [[MAPT5]], i32 0, i32 0), i32 0, i32 1)
+// OMP45-DAG: [[BPR]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP:%.+]], i32 0, i32 0
+// OMP45-DAG: [[PR]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P:%.+]], i32 0, i32 0
+// OMP45-DAG: [[SR]] = getelementptr inbounds [6 x i64], [6 x i64]* [[S:%.+]], i32 0, i32 0
+// OMP45-DAG: [[SADDR0:%.+]] = getelementptr inbounds [6 x i64], [6 x i64]* [[S]], i32 [[IDX0:[0-9]+]]
+// OMP45-DAG: [[BPADDR0:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP]], i32 [[IDX0]]
+// OMP45-DAG: [[PADDR0:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P]], i32 [[IDX0]]
+// OMP45-DAG: [[SADDR1:%.+]] = getelementptr inbounds [6 x i64], [6 x i64]* [[S]], i32 [[IDX1:[0-9]+]]
+// OMP45-DAG: [[BPADDR1:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP]], i32 [[IDX1]]
+// OMP45-DAG: [[PADDR1:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P]], i32 [[IDX1]]
+// OMP45-DAG: [[SADDR2:%.+]] = getelementptr inbounds [6 x i64], [6 x i64]* [[S]], i32 [[IDX2:[0-9]+]]
+// OMP45-DAG: [[BPADDR2:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP]], i32 [[IDX2]]
+// OMP45-DAG: [[PADDR2:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P]], i32 [[IDX2]]
+// OMP45-DAG: [[SADDR3:%.+]] = getelementptr inbounds [6 x i64], [6 x i64]* [[S]], i32 [[IDX3:[0-9]+]]
+// OMP45-DAG: [[BPADDR3:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP]], i32 [[IDX3]]
+// OMP45-DAG: [[PADDR3:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P]], i32 [[IDX3]]
+// OMP45-DAG: [[SADDR4:%.+]] = getelementptr inbounds [6 x i64], [6 x i64]* [[S]], i32 [[IDX4:[0-9]+]]
+// OMP45-DAG: [[BPADDR4:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP]], i32 [[IDX4]]
+// OMP45-DAG: [[PADDR4:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P]], i32 [[IDX4]]
+// OMP45-DAG: [[SADDR5:%.+]] = getelementptr inbounds [6 x i64], [6 x i64]* [[S]], i32 [[IDX5:[0-9]+]]
+// OMP45-DAG: [[BPADDR5:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[BP]], i32 [[IDX5]]
+// OMP45-DAG: [[PADDR5:%.+]] = getelementptr inbounds [6 x i8*], [6 x i8*]* [[P]], i32 [[IDX5]]
+// OMP50-DAG: [[RET:%.+]] = call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 7, i8** [[BPR:%[^,]+]], i8** [[PR:%[^,]+]], i64* [[SR:%[^,]+]], i64* getelementptr inbounds ([7 x i64], [7 x i64]* [[MAPT5]], i32 0, i32 0), i32 0, i32 1)
+// OMP50-DAG: [[BPR]] = getelementptr inbounds [7 x i8*], [7 x i8*]* [[BP:%.+]], i32 0, i32 0
+// OMP50-DAG: [[PR]] = getelementptr inbounds [7 x i8*], [7 x i8*]* [[P:%.+]], i32 0, i32 0
+// OMP50-DAG: [[SR]] = getelementptr inbounds [7 x i64], [7 x i64]* [[S:%.+]], i32 0, i32 0
+// OMP50-DAG: [[SADDR0:%.+]] = getelementptr inbounds [7 x i64], [7 x i64]* [[S]], i32 [[IDX0:[0-9]+]]
+// OMP50-DAG: [[BPADDR0:%.+]] = getelementptr inbounds [7 x i8*], [7 x i8*]* [[BP]], i32 [[IDX0]]
+// OMP50-DAG: [[PADDR0:%.+]] = getelementptr inbounds [7 x i8*], [7 x i8*]* [[P]], i32 [[IDX0]]
+// OMP50-DAG: [[SADDR1:%.+]] = getelementptr inbounds [7 x i64], [7 x i64]* [[S]], i32 [[IDX1:[0-9]+]]
+// OMP50-DAG: [[BPADDR1:%.+]] = getelementptr inbounds [7 x i8*], [7 x i8*]* [[BP]], i32 [[IDX1]]
+// OMP50-DAG: [[PADDR1:%.+]] = getelementptr inbounds [7 x i8*], [7 x i8*]* [[P]], i32 [[IDX1]]
+// OMP50-DAG: [[SADDR2:%.+]] = getelementptr inbounds [7 x i64], [7 x i64]* [[S]], i32 [[IDX2:[0-9]+]]
+// OMP50-DAG: [[BPADDR2:%.+]] = getelementptr inbounds [7 x i8*], [7 x i8*]* [[BP]], i32 [[IDX2]]
+// OMP50-DAG: [[PADDR2:%.+]] = getelementptr inbounds [7 x i8*], [7 x i8*]* [[P]], i32 [[IDX2]]
+// OMP50-DAG: [[SADDR3:%.+]] = getelementptr inbounds [7 x i64], [7 x i64]* [[S]], i32 [[IDX3:[0-9]+]]
+// OMP50-DAG: [[BPADDR3:%.+]] = getelementptr inbounds [7 x i8*], [7 x i8*]* [[BP]], i32 [[IDX3]]
+// OMP50-DAG: [[PADDR3:%.+]] = getelementptr inbounds [7 x i8*], [7 x i8*]* [[P]], i32 [[IDX3]]
+// OMP50-DAG: [[SADDR4:%.+]] = getelementptr inbounds [7 x i64], [7 x i64]* [[S]], i32 [[IDX4:[0-9]+]]
+// OMP50-DAG: [[BPADDR4:%.+]] = getelementptr inbounds [7 x i8*], [7 x i8*]* [[BP]], i32 [[IDX4]]
+// OMP50-DAG: [[PADDR4:%.+]] = getelementptr inbounds [7 x i8*], [7 x i8*]* [[P]], i32 [[IDX4]]
+// OMP50-DAG: [[SADDR5:%.+]] = getelementptr inbounds [7 x i64], [7 x i64]* [[S]], i32 [[IDX5:[0-9]+]]
+// OMP50-DAG: [[BPADDR5:%.+]] = getelementptr inbounds [7 x i8*], [7 x i8*]* [[BP]], i32 [[IDX5]]
+// OMP50-DAG: [[PADDR5:%.+]] = getelementptr inbounds [7 x i8*], [7 x i8*]* [[P]], i32 [[IDX5]]
+// OMP50-DAG: [[SADDR6:%.+]] = getelementptr inbounds [7 x i64], [7 x i64]* [[S]], i32 [[IDX6:[0-9]+]]
+// OMP50-DAG: [[BPADDR6:%.+]] = getelementptr inbounds [7 x i8*], [7 x i8*]* [[BP]], i32 [[IDX6]]
+// OMP50-DAG: [[PADDR6:%.+]] = getelementptr inbounds [7 x i8*], [7 x i8*]* [[P]], i32 [[IDX6]]
// The names below are not necessarily consistent with the names used for the
// addresses above as some are repeated.
-// CHECK-DAG: store i[[SZ]] [[VLA0]], i[[SZ]]* [[CBPADDR0:%.+]],
-// CHECK-DAG: store i[[SZ]] [[VLA0]], i[[SZ]]* [[CPADDR0:%.+]],
-// CHECK-DAG: [[CBPADDR0]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
-// CHECK-DAG: [[CPADDR0]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
-// CHECK-DAG: store i64 {{4|8}}, i64* {{%[^,]+}}
+// CHECK-DAG: store [[S1]]* %{{.+}}, [[S1]]** [[CBPADDR0:%.+]],
+// CHECK-DAG: store double* %{{.+}}, double** [[CPADDR0:%.+]],
+// CHECK-DAG: [[CBPADDR0]] = bitcast i8** {{%[^,]+}} to [[S1]]**
+// CHECK-DAG: [[CPADDR0]] = bitcast i8** {{%[^,]+}} to double**
+// CHECK-DAG: store i64 %{{.+}}, i64* {{%[^,]+}}
-// CHECK-DAG: store i[[SZ]] 2, i[[SZ]]* [[CBPADDR1:%.+]],
-// CHECK-DAG: store i[[SZ]] 2, i[[SZ]]* [[CPADDR1:%.+]],
-// CHECK-DAG: [[CBPADDR1]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
-// CHECK-DAG: [[CPADDR1]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
-// CHECK-DAG: store i64 {{4|8}}, i64* {{%[^,]+}}
+// CHECK-DAG: store [[S1]]* %{{.+}}, [[S1]]** [[CBPADDR1:%.+]],
+// CHECK-DAG: store double* %{{.+}}, double** [[CPADDR1:%.+]],
+// CHECK-DAG: [[CBPADDR1]] = bitcast i8** {{%[^,]+}} to [[S1]]**
+// CHECK-DAG: [[CPADDR1]] = bitcast i8** {{%[^,]+}} to double**
+// CHECK-DAG: store i64 {{8|4}}, i64* {{%[^,]+}}
// CHECK-DAG: store i[[SZ]] [[B_CVAL]], i[[SZ]]* [[CBPADDR2:%.+]],
// CHECK-DAG: store i[[SZ]] [[B_CVAL]], i[[SZ]]* [[CPADDR2:%.+]],
@@ -613,17 +663,17 @@
// CHECK-DAG: [[CPADDR2]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
// CHECK-DAG: store i64 4, i64* {{%[^,]+}}
-// CHECK-DAG: store [[S1]]* %{{.+}}, [[S1]]** [[CBPADDR3:%.+]],
-// CHECK-DAG: store double* %{{.+}}, double** [[CPADDR3:%.+]],
-// CHECK-DAG: [[CBPADDR3]] = bitcast i8** {{%[^,]+}} to [[S1]]**
-// CHECK-DAG: [[CPADDR3]] = bitcast i8** {{%[^,]+}} to double**
-// CHECK-DAG: store i64 8, i64* {{%[^,]+}}
+// CHECK-DAG: store i[[SZ]] 2, i[[SZ]]* [[CBPADDR3:%.+]],
+// CHECK-DAG: store i[[SZ]] 2, i[[SZ]]* [[CPADDR3:%.+]],
+// CHECK-DAG: [[CBPADDR3]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
+// CHECK-DAG: [[CPADDR3]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
+// CHECK-DAG: store i64 {{4|8}}, i64* {{%[^,]+}}
-// CHECK-DAG: store [[S1]]* %{{.+}}, [[S1]]** [[CBPADDR4:%.+]],
-// CHECK-DAG: store double* %{{.+}}, double** [[CPADDR4:%.+]],
-// CHECK-DAG: [[CBPADDR4]] = bitcast i8** {{%[^,]+}} to [[S1]]**
-// CHECK-DAG: [[CPADDR4]] = bitcast i8** {{%[^,]+}} to double**
-// CHECK-DAG: store i64 8, i64* {{%[^,]+}}
+// CHECK-DAG: store i[[SZ]] [[VLA0]], i[[SZ]]* [[CBPADDR4:%.+]],
+// CHECK-DAG: store i[[SZ]] [[VLA0]], i[[SZ]]* [[CPADDR4:%.+]],
+// CHECK-DAG: [[CBPADDR4]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
+// CHECK-DAG: [[CPADDR4]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
+// CHECK-DAG: store i64 {{4|8}}, i64* {{%[^,]+}}
// CHECK-DAG: store i16* %{{.+}}, i16** [[CBPADDR5:%.+]],
// CHECK-DAG: store i16* %{{.+}}, i16** [[CPADDR5:%.+]],
@@ -631,11 +681,18 @@
// CHECK-DAG: [[CPADDR5]] = bitcast i8** {{%[^,]+}} to i16**
// CHECK-DAG: store i64 [[CSIZE]], i64* {{%[^,]+}}
+// OMP50-DAG: store i[[SZ]] [[IF_C:%.+]], i[[SZ]]* [[CBPADDR6:%.+]],
+// OMP50-DAG: store i[[SZ]] [[IF_C]], i[[SZ]]* [[CPADDR6:%.+]],
+// OMP50-DAG: [[CBPADDR6]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
+// OMP50-DAG: [[CPADDR6]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
+// OMP50-DAG: store i64 1, i64* {{%[^,]+}}
+
// CHECK-NEXT: [[ERROR:%.+]] = icmp ne i32 [[RET]], 0
// CHECK-NEXT: br i1 [[ERROR]], label %[[FAIL:[^,]+]], label %[[END:[^,]+]]
// CHECK: [[FAIL]]
-// CHECK: call void [[HVT7:@.+]]({{[^,]+}}, {{[^,]+}}, {{[^,]+}}, {{[^,]+}}, {{[^,]+}})
+// OMP45: call void [[HVT7:@.+]]({{[^,]+}}, {{[^,]+}}, {{[^,]+}}, {{[^,]+}}, {{[^,]+}})
+// OMP50: call void [[HVT7:@.+]]({{[^,]+}}, {{[^,]+}}, {{[^,]+}}, {{[^,]+}}, {{[^,]+}}, {{[^,]+}})
// CHECK-NEXT: br label %[[END]]
// CHECK: [[END]]
@@ -722,10 +779,10 @@
// CHECK-DAG: [[BPADDR2:%.+]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[BP]], i32 0, i32 2
// CHECK-DAG: [[PADDR2:%.+]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[P]], i32 0, i32 2
-// CHECK-DAG: store i[[SZ]] [[VAL2:%.+]], i[[SZ]]* [[CBPADDR2:%.+]],
-// CHECK-DAG: store i[[SZ]] [[VAL2]], i[[SZ]]* [[CPADDR2:%.+]],
-// CHECK-DAG: [[CBPADDR2]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
-// CHECK-DAG: [[CPADDR2]] = bitcast i8** {{%[^,]+}} to i[[SZ]]*
+// CHECK-DAG: store [10 x i32]* [[VAL2:%.+]], [10 x i32]** [[CBPADDR2:%.+]],
+// CHECK-DAG: store [10 x i32]* [[VAL2]], [10 x i32]** [[CPADDR2:%.+]],
+// CHECK-DAG: [[CBPADDR2]] = bitcast i8** {{%[^,]+}} to [10 x i32]**
+// CHECK-DAG: [[CPADDR2]] = bitcast i8** {{%[^,]+}} to [10 x i32]**
// CHECK: [[ERROR:%.+]] = icmp ne i32 [[RET]], 0
// CHECK-NEXT: br i1 [[ERROR]], label %[[FAIL:.+]], label %[[END:[^,]+]]
@@ -751,7 +808,9 @@
// CHECK: [[LOCAL_VLA1:%.+]] = alloca i[[SZ]]
// CHECK: [[LOCAL_VLA2:%.+]] = alloca i[[SZ]]
// CHECK: [[LOCAL_C:%.+]] = alloca i16*
+// OMP50: alloca i[[SZ]]
// CHECK: [[LOCAL_B_CASTED:%.+]] = alloca i[[SZ]]
+// OMP50: [[IF_CASTED:%.+]] = alloca i[[SZ]]
// CHECK-DAG: store [[S1]]* [[ARG_THIS:%.+]], [[S1]]** [[LOCAL_THIS]]
// CHECK-DAG: store i[[SZ]] [[ARG_B:%.+]], i[[SZ]]* [[LOCAL_B]]
// CHECK-DAG: store i[[SZ]] [[ARG_VLA1:%.+]], i[[SZ]]* [[LOCAL_VLA1]]
@@ -770,11 +829,14 @@
// CHECK-32-DAG:[[LOCAL_BV:%.+]] = load i32, i32* [[LOCAL_B]]
// CHECK-32-DAG:store i32 [[LOCAL_BV]], i32* [[LOCAL_B_CASTED]], align
// CHECK-DAG: [[REF_B:%.+]] = load i[[SZ]], i[[SZ]]* [[LOCAL_B_CASTED]],
+// OMP50-DAG: [[IF_CAST:%.+]] = load i[[SZ]], i[[SZ]]* [[IF_CASTED]],
-// CHECK: call {{.*}}void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_teams(%struct.ident_t* [[DEF_LOC]], i32 5, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, [[S1]]*, i[[SZ]], i[[SZ]], i[[SZ]], i16*)* [[OMP_OUTLINED5:@.+]] to void (i32*, i32*, ...)*), [[S1]]* [[REF_THIS]], i[[SZ]] [[REF_B]], i[[SZ]] [[VAL_VLA1]], i[[SZ]] [[VAL_VLA2]], i16* [[REF_C]])
+// OMP45: call {{.*}}void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_teams(%struct.ident_t* [[DEF_LOC]], i32 5, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, [[S1]]*, i[[SZ]], i[[SZ]], i[[SZ]], i16*)* [[OMP_OUTLINED5:@.+]] to void (i32*, i32*, ...)*), [[S1]]* [[REF_THIS]], i[[SZ]] [[REF_B]], i[[SZ]] [[VAL_VLA1]], i[[SZ]] [[VAL_VLA2]], i16* [[REF_C]])
+// OMP50: call {{.*}}void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_teams(%struct.ident_t* [[DEF_LOC]], i32 6, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, [[S1]]*, i[[SZ]], i[[SZ]], i[[SZ]], i16*, i[[SZ]])* [[OMP_OUTLINED5:@.+]] to void (i32*, i32*, ...)*), [[S1]]* [[REF_THIS]], i[[SZ]] [[REF_B]], i[[SZ]] [[VAL_VLA1]], i[[SZ]] [[VAL_VLA2]], i16* [[REF_C]], i[[SZ]] [[IF_CAST]])
//
//
-// CHECK: define internal {{.*}}void [[OMP_OUTLINED5]](i32* noalias %.global_tid., i32* noalias %.bound_tid., [[S1]]* %{{.+}}, i[[SZ]] %{{.+}}, i[[SZ]] %{{.+}}, i[[SZ]] %{{.+}}, i16* {{.+}})
+// OMP45: define internal {{.*}}void [[OMP_OUTLINED5]](i32* noalias %.global_tid., i32* noalias %.bound_tid., [[S1]]* %{{.+}}, i[[SZ]] %{{.+}}, i[[SZ]] %{{.+}}, i[[SZ]] %{{.+}}, i16* {{.+}})
+// OMP50: define internal {{.*}}void [[OMP_OUTLINED5]](i32* noalias %.global_tid., i32* noalias %.bound_tid., [[S1]]* %{{.+}}, i[[SZ]] %{{.+}}, i[[SZ]] %{{.+}}, i[[SZ]] %{{.+}}, i16* {{.+}}, i[[SZ]] %{{.+}})
// To reduce complexity, we're only going as far as validating the signature of the outlined parallel function.
@@ -855,8 +917,11 @@
// CHECK: define internal {{.*}}void [[OMP_OUTLINED7]](i32* noalias %.global_tid., i32* noalias %.bound_tid., i[[SZ]] %{{.+}}, i[[SZ]] %{{.+}}, [10 x i32]* {{.+}})
// To reduce complexity, we're only going as far as validating the signature of the outlined parallel function.
+// OMP45-NOT: !{!"llvm.loop.vectorize.enable", i1 false}
// CHECK-DAG: !{!"llvm.loop.vectorize.width", i32 16}
// CHECK-DAG: !{!"llvm.loop.vectorize.enable", i1 true}
// CHECK-DAG: !{!"llvm.loop.vectorize.width", i32 32}
+// OMP45-NOT: !{!"llvm.loop.vectorize.enable", i1 false}
+// OMP50-DAG: !{!"llvm.loop.vectorize.enable", i1 false}
#endif
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_codegen_registration.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_codegen_registration.cpp
index b925bb8..96b72ab 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_codegen_registration.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_codegen_registration.cpp
@@ -52,13 +52,9 @@
// CHECK-DAG: [[ST1:%.+]] = type { [228 x i32] }
// CHECK-DAG: [[ST2:%.+]] = type { [1128 x i32] }
// CHECK-DAG: [[ENTTY:%.+]] = type { i8*, i8*, i[[SZ:32|64]], i32, i32 }
-// CHECK-DAG: [[DEVTY:%.+]] = type { i8*, i8*, [[ENTTY]]*, [[ENTTY]]* }
-// CHECK-DAG: [[DSCTY:%.+]] = type { i32, [[DEVTY]]*, [[ENTTY]]*, [[ENTTY]]* }
// TCHECK: [[ENTTY:%.+]] = type { i8*, i8*, i[[SZ:32|64]], i32, i32 }
-// CHECK-DAG: $[[REGFN:\.omp_offloading\..+]] = comdat
-
// CHECK-DAG: [[A1:@.+]] = internal global [[SA]]
// CHECK-DAG: [[A2:@.+]] = global [[SA]]
// CHECK-DAG: [[B1:@.+]] = global [[SB]]
@@ -123,68 +119,60 @@
// CHECK-NTARGET-NOT: private unnamed_addr constant [1 x i
// CHECK-DAG: [[NAMEPTR1:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME1:__omp_offloading_[0-9a-f]+_[0-9a-f]+__Z.+_l[0-9]+]]\00"
-// CHECK-DAG: [[ENTRY1:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR1]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY1:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR1]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR2:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME2:.+]]\00"
-// CHECK-DAG: [[ENTRY2:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR2]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY2:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR2]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR3:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME3:.+]]\00"
-// CHECK-DAG: [[ENTRY3:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR3]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY3:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR3]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR4:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME4:.+]]\00"
-// CHECK-DAG: [[ENTRY4:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR4]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY4:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR4]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR5:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME5:.+]]\00"
-// CHECK-DAG: [[ENTRY5:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR5]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY5:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR5]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR6:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME6:.+]]\00"
-// CHECK-DAG: [[ENTRY6:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR6]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY6:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR6]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR7:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME7:.+]]\00"
-// CHECK-DAG: [[ENTRY7:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR7]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY7:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR7]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR8:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME8:.+]]\00"
-// CHECK-DAG: [[ENTRY8:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR8]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY8:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR8]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR9:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME9:.+]]\00"
-// CHECK-DAG: [[ENTRY9:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR9]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY9:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR9]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR10:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME10:.+]]\00"
-// CHECK-DAG: [[ENTRY10:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR10]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY10:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR10]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR11:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME11:.+]]\00"
-// CHECK-DAG: [[ENTRY11:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR11]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY11:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR11]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// CHECK-DAG: [[NAMEPTR12:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME12:.+]]\00"
-// CHECK-DAG: [[ENTRY12:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR12]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// CHECK-DAG: [[ENTRY12:@.+]] = weak constant [[ENTTY]] { i8* @{{.*}}, i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR12]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR1:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME1:__omp_offloading_[0-9a-f]+_[0-9a-f]+__Z.+_l[0-9]+]]\00"
-// TCHECK-DAG: [[ENTRY1:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR1]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY1:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR1]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR2:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME2:.+]]\00"
-// TCHECK-DAG: [[ENTRY2:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR2]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY2:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR2]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR3:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME3:.+]]\00"
-// TCHECK-DAG: [[ENTRY3:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR3]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY3:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR3]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR4:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME4:.+]]\00"
-// TCHECK-DAG: [[ENTRY4:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR4]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY4:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR4]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR5:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME5:.+]]\00"
-// TCHECK-DAG: [[ENTRY5:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR5]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY5:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR5]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR6:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME6:.+]]\00"
-// TCHECK-DAG: [[ENTRY6:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR6]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY6:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR6]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR7:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME7:.+]]\00"
-// TCHECK-DAG: [[ENTRY7:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR7]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY7:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR7]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR8:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME8:.+]]\00"
-// TCHECK-DAG: [[ENTRY8:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR8]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY8:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR8]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR9:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME9:.+]]\00"
-// TCHECK-DAG: [[ENTRY9:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR9]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY9:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR9]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR10:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME10:.+]]\00"
-// TCHECK-DAG: [[ENTRY10:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR10]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY10:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR10]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR11:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME11:.+]]\00"
-// TCHECK-DAG: [[ENTRY11:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR11]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
+// TCHECK-DAG: [[ENTRY11:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR11]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// TCHECK-DAG: [[NAMEPTR12:@.+]] = internal unnamed_addr constant [{{.*}} x i8] c"[[NAME12:.+]]\00"
-// TCHECK-DAG: [[ENTRY12:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR12]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section ".omp_offloading.entries", align 1
-
-// CHECK: [[ENTBEGIN:@.+]] = external constant [[ENTTY]]
-// CHECK: [[ENTEND:@.+]] = external constant [[ENTTY]]
-// CHECK: [[DEVBEGIN:@.+]] = extern_weak constant i8
-// CHECK: [[DEVEND:@.+]] = extern_weak constant i8
-// CHECK: [[IMAGES:@.+]] = internal unnamed_addr constant [1 x [[DEVTY]]] [{{.+}} { i8* [[DEVBEGIN]], i8* [[DEVEND]], [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }], comdat($[[REGFN]])
-// CHECK: [[DESC:@.+]] = internal constant [[DSCTY]] { i32 1, [[DEVTY]]* getelementptr inbounds ([1 x [[DEVTY]]], [1 x [[DEVTY]]]* [[IMAGES]], i32 0, i32 0), [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }, comdat($[[REGFN]])
+// TCHECK-DAG: [[ENTRY12:@.+]] = weak constant [[ENTTY]] { i8* bitcast (void (i[[SZ]])* @{{.*}} to i8*), i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[NAMEPTR12]], i32 0, i32 0), i[[SZ]] 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1
// We have 4 initializers, one for the 500 priority, another one for 501, or more for the default priority, and the last one for the offloading registration function.
-// CHECK: @llvm.global_ctors = appending global [5 x { i32, void ()*, i8* }] [
+// CHECK: @llvm.global_ctors = appending global [4 x { i32, void ()*, i8* }] [
// CHECK-SAME: { i32, void ()*, i8* } { i32 500, void ()* [[P500:@[^,]+]], i8* null },
// CHECK-SAME: { i32, void ()*, i8* } { i32 501, void ()* [[P501:@[^,]+]], i8* null },
// CHECK-SAME: { i32, void ()*, i8* } { i32 65535, void ()* [[PMAX:@[^,]+]], i8* null },
-// CHECK-SAME: { i32, void ()*, i8* } { i32 0, void ()* @[[REGFN]], i8* bitcast (void ()* @[[REGFN]] to i8*) }]
// CHECK-NTARGET: @llvm.global_ctors = appending global [3 x { i32, void ()*, i8* }] [
@@ -363,12 +351,8 @@
//TCHECK-DAG: define weak void @[[NAME12]](
// CHECK-NTARGET-NOT: __tgt_target
-// CHECK-NTARGET-NOT: __tgt_register_lib
-// CHECK-NTARGET-NOT: __tgt_unregister_lib
// TCHECK-NOT: __tgt_target
-// TCHECK-NOT: __tgt_register_lib
-// TCHECK-NOT: __tgt_unregister_lib
// We have 2 initializers with priority 500
//CHECK: define internal void [[P500]](
@@ -394,25 +378,6 @@
//CHECK-NOT: call void @{{.+}}()
//CHECK: ret void
-// Check registration and unregistration
-
-//CHECK: define internal void @.omp_offloading.requires_reg()
-//CHECK: call void @__tgt_register_requires(i64 1)
-//CHECK: ret void
-
-//CHECK: define internal void @[[UNREGFN:.+]](i8*)
-//CHECK-SAME: comdat($[[REGFN]]) {
-//CHECK: call i32 @__tgt_unregister_lib([[DSCTY]]* [[DESC]])
-//CHECK: ret void
-//CHECK: declare i32 @__tgt_unregister_lib([[DSCTY]]*)
-
-//CHECK: define linkonce hidden void @[[REGFN]]()
-//CHECK-SAME: comdat {
-//CHECK: call i32 @__tgt_register_lib([[DSCTY]]* [[DESC]])
-//CHECK: call i32 @__cxa_atexit(void (i8*)* @[[UNREGFN]], i8* bitcast ([[DSCTY]]* [[DESC]] to i8*),
-//CHECK: ret void
-//CHECK: declare i32 @__tgt_register_lib([[DSCTY]]*)
-
static __attribute__((init_priority(500))) SA a1;
SA a2;
SB __attribute__((init_priority(500))) b1;
@@ -446,32 +411,32 @@
// Check metadata is properly generated:
// CHECK: !omp_offload.info = !{!{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID:-?[0-9]+]], i32 [[FILEID:-?[0-9]+]], !"_ZN2SB3fooEv", i32 216, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SDD1Ev", i32 268, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SEC1Ev", i32 286, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SED1Ev", i32 293, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EE3fooEv", i32 305, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EEC1Ev", i32 312, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_Z3bari", i32 440, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EED1Ev", i32 319, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EEC1Ev", i32 312, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EED1Ev", i32 319, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EE3fooEv", i32 305, i32 {{[0-9]+}}}
-// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SCC1Ev", i32 242, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID:-?[0-9]+]], i32 [[FILEID:-?[0-9]+]], !"_ZN2SB3fooEv", i32 204, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SDD1Ev", i32 256, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SEC1Ev", i32 274, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SED1Ev", i32 281, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EE3fooEv", i32 293, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EEC1Ev", i32 300, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_Z3bari", i32 405, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EED1Ev", i32 307, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EEC1Ev", i32 300, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EED1Ev", i32 307, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EE3fooEv", i32 293, i32 {{[0-9]+}}}
+// CHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SCC1Ev", i32 230, i32 {{[0-9]+}}}
// TCHECK: !omp_offload.info = !{!{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID:-?[0-9]+]], i32 [[FILEID:-?[0-9]+]], !"_ZN2SB3fooEv", i32 216, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SDD1Ev", i32 268, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SEC1Ev", i32 286, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SED1Ev", i32 293, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EE3fooEv", i32 305, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EEC1Ev", i32 312, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_Z3bari", i32 440, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EED1Ev", i32 319, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EEC1Ev", i32 312, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EED1Ev", i32 319, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EE3fooEv", i32 305, i32 {{[0-9]+}}}
-// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SCC1Ev", i32 242, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID:-?[0-9]+]], i32 [[FILEID:-?[0-9]+]], !"_ZN2SB3fooEv", i32 204, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SDD1Ev", i32 256, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SEC1Ev", i32 274, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SED1Ev", i32 281, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EE3fooEv", i32 293, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EEC1Ev", i32 300, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_Z3bari", i32 405, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EED1Ev", i32 307, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EEC1Ev", i32 300, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi1000EED1Ev", i32 307, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2STILi100EE3fooEv", i32 293, i32 {{[0-9]+}}}
+// TCHECK-DAG: = !{i32 0, i32 [[DEVID]], i32 [[FILEID]], !"_ZN2SCC1Ev", i32 230, i32 {{[0-9]+}}}
// TCHECK-DAG: !{!"llvm.loop.vectorize.enable", i1 true}
// CHECK-DAG: !{!"llvm.loop.vectorize.enable", i1 true}
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_defaultmap_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_defaultmap_messages.cpp
index 88f9125..07b4ab8 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_defaultmap_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_defaultmap_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 %s -verify=expected,omp5 -Wuninitialized -DOMP5
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 %s -verify=expected,omp5 -Wuninitialized -DOMP5
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 %s -verify=expected,omp45 -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 %s -verify=expected,omp45 -Wuninitialized
void foo() {
}
@@ -10,23 +12,23 @@
int i;
#pragma omp target teams distribute simd defaultmap // expected-error {{expected '(' after 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute simd defaultmap ( // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+#pragma omp target teams distribute simd defaultmap ( // omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute simd defaultmap () // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
+#pragma omp target teams distribute simd defaultmap () // omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute simd defaultmap (tofrom // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+#pragma omp target teams distribute simd defaultmap (tofrom // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute simd defaultmap (tofrom: // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+#pragma omp target teams distribute simd defaultmap (tofrom: // expected-error {{expected ')'}} expected-note {{to match this '('}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute simd defaultmap (tofrom) // expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+#pragma omp target teams distribute simd defaultmap (tofrom) // expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute simd defaultmap (tofrom scalar) // expected-warning {{missing ':' after defaultmap modifier - ignoring}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute simd defaultmap (tofrom, // expected-error {{expected ')'}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-note {{to match this '('}}
+#pragma omp target teams distribute simd defaultmap (tofrom, // expected-error {{expected ')'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-note {{to match this '('}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute simd defaultmap (scalar: // expected-error {{expected ')'}} expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
+#pragma omp target teams distribute simd defaultmap (scalar: // expected-error {{expected ')'}} omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute simd defaultmap (tofrom, scalar // expected-error {{expected ')'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
+#pragma omp target teams distribute simd defaultmap (tofrom, scalar // expected-error {{expected ')'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
return argc;
@@ -36,25 +38,24 @@
int i;
#pragma omp target teams distribute simd defaultmap // expected-error {{expected '(' after 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute simd defaultmap ( // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+#pragma omp target teams distribute simd defaultmap ( // omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} expected-note {{to match this '('}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute simd defaultmap () // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
+#pragma omp target teams distribute simd defaultmap () // omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute simd defaultmap (tofrom // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+#pragma omp target teams distribute simd defaultmap (tofrom // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute simd defaultmap (tofrom: // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+#pragma omp target teams distribute simd defaultmap (tofrom: // expected-error {{expected ')'}} expected-note {{to match this '('}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute simd defaultmap (tofrom) // expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
+#pragma omp target teams distribute simd defaultmap (tofrom) // expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute simd defaultmap (tofrom scalar) // expected-warning {{missing ':' after defaultmap modifier - ignoring}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute simd defaultmap (tofrom, // expected-error {{expected ')'}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-note {{to match this '('}}
+#pragma omp target teams distribute simd defaultmap (tofrom, // expected-error {{expected ')'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-note {{to match this '('}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute simd defaultmap (scalar: // expected-error {{expected ')'}} expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
+#pragma omp target teams distribute simd defaultmap (scalar: // expected-error {{expected ')'}} omp5-error {{expected 'alloc', 'from', 'to', 'tofrom', 'firstprivate', 'none', 'default' in OpenMP clause 'defaultmap'}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute simd defaultmap (tofrom, scalar // expected-error {{expected ')'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} expected-error {{expected 'scalar' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}}
+#pragma omp target teams distribute simd defaultmap (tofrom, scalar // expected-error {{expected ')'}} expected-warning {{missing ':' after defaultmap modifier - ignoring}} omp5-error {{expected 'scalar', 'aggregate', 'pointer' in OpenMP clause 'defaultmap'}} expected-note {{to match this '('}} omp45-error {{expected 'scalar' in OpenMP clause 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
return tmain<int, char, 1, 0>(argc, argv);
}
-
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_depend_codegen.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_depend_codegen.cpp
index 3ba7b4d..4fffbc5 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_depend_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_depend_codegen.cpp
@@ -40,13 +40,9 @@
// CHECK-DAG: [[TT:%.+]] = type { i64, i8 }
// CHECK-DAG: [[ENTTY:%.+]] = type { i8*, i8*, i[[SZ:32|64]], i32, i32 }
-// CHECK-DAG: [[DEVTY:%.+]] = type { i8*, i8*, [[ENTTY]]*, [[ENTTY]]* }
-// CHECK-DAG: [[DSCTY:%.+]] = type { i32, [[DEVTY]]*, [[ENTTY]]*, [[ENTTY]]* }
// TCHECK: [[ENTTY:%.+]] = type { i8*, i8*, i{{32|64}}, i32, i32 }
-// CHECK-DAG: $[[REGFN:\.omp_offloading\..+]] = comdat
-
// CHECK-DAG: [[SIZET:@.+]] = private unnamed_addr constant [2 x i64] [i64 0, i64 4]
// CHECK-DAG: [[MAPT:@.+]] = private unnamed_addr constant [2 x i64] [i64 544, i64 800]
// CHECK-DAG: @{{.*}} = weak constant i8 0
@@ -55,16 +51,8 @@
// TCHECK: @{{.+}} = {{.*}}constant [[ENTTY]]
// TCHECK-NOT: @{{.+}} = weak constant [[ENTTY]]
-// Check if offloading descriptor is created.
-// CHECK: [[ENTBEGIN:@.+]] = external constant [[ENTTY]]
-// CHECK: [[ENTEND:@.+]] = external constant [[ENTTY]]
-// CHECK: [[DEVBEGIN:@.+]] = extern_weak constant i8
-// CHECK: [[DEVEND:@.+]] = extern_weak constant i8
-// CHECK: [[IMAGES:@.+]] = internal unnamed_addr constant [1 x [[DEVTY]]] [{{.+}} { i8* [[DEVBEGIN]], i8* [[DEVEND]], [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }], comdat($[[REGFN]])
-// CHECK: [[DESC:@.+]] = internal constant [[DSCTY]] { i32 1, [[DEVTY]]* getelementptr inbounds ([1 x [[DEVTY]]], [1 x [[DEVTY]]]* [[IMAGES]], i32 0, i32 0), [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }, comdat($[[REGFN]])
-
// Check target registration is registered as a Ctor.
-// CHECK: appending global [2 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }, { i32, void ()*, i8* } { i32 0, void ()* @[[REGFN]], i8* bitcast (void ()* @[[REGFN]] to i8*) }]
+// CHECK: appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }]
template<typename tx, typename ty>
@@ -193,7 +181,7 @@
// CHECK: define internal void [[HVT0:@.+]]()
-// CHECK: define internal{{.*}} i32 [[TASK_ENTRY0]](i32{{.*}}, [[TASK_TY0]]* noalias)
+// CHECK: define internal{{.*}} i32 [[TASK_ENTRY0]](i32{{.*}}, [[TASK_TY0]]* noalias %1)
// CHECK: store void (i8*, ...)* null, void (i8*, ...)** %
// CHECK: [[DEVICE_CAP:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 0
// CHECK: [[DEV:%.+]] = load i32, i32* [[DEVICE_CAP]],
@@ -209,7 +197,7 @@
// CHECK: define internal void [[HVT1:@.+]](i[[SZ]]* %{{.+}}, i[[SZ]] %{{.+}})
-// CHECK: define internal{{.*}} i32 [[TASK_ENTRY1_]](i32{{.*}}, [[TASK_TY1_]]* noalias)
+// CHECK: define internal{{.*}} i32 [[TASK_ENTRY1_]](i32{{.*}}, [[TASK_TY1_]]* noalias %1)
// CHECK: call void (i8*, ...) %
// CHECK: [[SZT:%.+]] = getelementptr inbounds [2 x i64], [2 x i64]* %{{.+}}, i[[SZ]] 0, i[[SZ]] 0
// CHECK: [[DEVICE_CAP:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 2
@@ -231,7 +219,7 @@
// CHECK: [[END]]
// CHECK: ret i32 0
-// CHECK: define internal{{.*}} i32 [[TASK_ENTRY1__]](i32{{.*}}, [[TASK_TY1__]]* noalias)
+// CHECK: define internal{{.*}} i32 [[TASK_ENTRY1__]](i32{{.*}}, [[TASK_TY1__]]* noalias %1)
// CHECK: call void (i8*, ...) %
// CHECK: [[DEVICE_CAP:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* %{{.+}}, i32 0, i32 2
// CHECK: [[BP0:%.+]] = load i[[SZ]]*, i[[SZ]]** %
@@ -251,7 +239,7 @@
// CHECK-64: load i32, i32* [[AA_CADDR]], align
// CHECK-32: load i32, i32* [[AA_ADDR]], align
-// CHECK: define internal{{.*}} i32 [[TASK_ENTRY2]](i32{{.*}}, [[TASK_TY2]]* noalias)
+// CHECK: define internal{{.*}} i32 [[TASK_ENTRY2]](i32{{.*}}, [[TASK_TY2]]* noalias %1)
// CHECK: call void (i8*, ...) %
// CHECK: [[BP1_I32:%.+]] = load i32, i32* %
// CHECK-64: [[BP1_CAST:%.+]] = bitcast i[[SZ]]* [[BP1_PTR:%.+]] to i32*
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_depend_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_depend_messages.cpp
index 2e1be6c..b71e87a 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_depend_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_depend_messages.cpp
@@ -69,7 +69,7 @@
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute simd depend (in : argv[0:-1]) // expected-error {{section length is evaluated to a negative value -1}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute simd depend (in : argv[-1:0])
+#pragma omp target teams distribute simd depend (in : argv[-1:0]) // expected-error {{zero-length array section is not allowed in 'depend' clause}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute simd depend (in : argv[:]) // expected-error {{section length is unspecified and cannot be inferred because subscripted value is not an array}}
for (i = 0; i < argc; ++i) foo();
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_firstprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_firstprivate_messages.cpp
index 82274fe..5ea84bf 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_firstprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_firstprivate_messages.cpp
@@ -1,6 +1,9 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,le45 -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,le45 -fopenmp-version=40 -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,le45 -fopenmp-version=45 -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected -fopenmp-version=50 -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,le45 -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
@@ -19,6 +22,13 @@
return argc;
}
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp target teams distribute simd firstprivate(fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
struct S1; // expected-note {{declared here}} expected-note{{forward declaration of 'S1'}}
extern S1 a;
class S2 {
@@ -124,8 +134,10 @@
#pragma omp target teams distribute simd firstprivate(h) // expected-error {{threadprivate or thread local variable cannot be firstprivate}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute simd private(i), firstprivate(i) // expected-error {{private variable cannot be firstprivate}} expected-note 2 {{defined as private}}
- for (i = 0; i < argc; ++i) foo(); // expected-error {{loop iteration variable in the associated loop of 'omp target teams distribute simd' directive may not be private, predetermined as linear}}
+#pragma omp target teams distribute simd private(i), firstprivate(i) // expected-error {{private variable cannot be firstprivate}} expected-note {{defined as private}}
+ // le45-note@-1 {{defined as private}}
+ // FIXME: Error is dropped for OpenMP 5.0. Probably shouldn't be.
+ for (i = 0; i < argc; ++i) foo(); // le45-error {{loop iteration variable in the associated loop of 'omp target teams distribute simd' directive may not be private, predetermined as linear}}
#pragma omp target teams distribute simd firstprivate(i)
for (j = 0; j < argc; ++j) foo();
@@ -140,7 +152,7 @@
#pragma omp target teams distribute simd lastprivate(argc), firstprivate(argc)
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute simd firstprivate(argc) map(argc) // expected-error {{firstprivate variable cannot be in a map clause in '#pragma omp target teams distribute simd' directive}} expected-note {{defined as firstprivate}}
+#pragma omp target teams distribute simd firstprivate(argc) map(argc) // le45-error {{firstprivate variable cannot be in a map clause in '#pragma omp target teams distribute simd' directive}} le45-note {{defined as firstprivate}}
for (i = 0; i < argc; ++i) foo();
return 0;
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_if_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_if_messages.cpp
index 53af6e7..0cb51d3 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_if_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_if_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp -fopenmp-version=50 -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-simd -fopenmp-version=50 -ferror-limit 100 %s -Wuninitialized
void foo() {
}
@@ -51,11 +53,11 @@
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute simd if(target: argc)
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute simd if(target : argc) if (distribute:argc) // expected-error {{directive name modifier 'distribute' is not allowed for '#pragma omp target teams distribute simd'}}
+#pragma omp target teams distribute simd if(target : argc) if (simd:argc) // omp45-error {{directive name modifier 'simd' is not allowed for '#pragma omp target teams distribute simd'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute simd if(target: argc) if (target:argc) // expected-error {{directive '#pragma omp target teams distribute simd' cannot contain more than one 'if' clause with 'target' name modifier}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute simd if(target: argc) if (argc) // expected-note {{previous clause with directive name modifier specified here}} expected-error {{no more 'if' clause is allowed}}
+#pragma omp target teams distribute simd if(target: argc) if (argc) // expected-note {{previous clause with directive name modifier specified here}} omp45-error {{no more 'if' clause is allowed}} omp50-error {{expected 'simd' directive name modifier}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute simd if(distribute : argc) // expected-error {{directive name modifier 'distribute' is not allowed for '#pragma omp target teams distribute simd'}}
for (i = 0; i < argc; ++i) foo();
@@ -97,11 +99,11 @@
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute simd if(target: z/argc)
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute simd if(target : argc) if (distribute:argc) // expected-error {{directive name modifier 'distribute' is not allowed for '#pragma omp target teams distribute simd'}}
+#pragma omp target teams distribute simd if(target : argc) if (simd:argc) // omp45-error {{directive name modifier 'simd' is not allowed for '#pragma omp target teams distribute simd'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute simd if(target: argc) if (target:argc) // expected-error {{directive '#pragma omp target teams distribute simd' cannot contain more than one 'if' clause with 'target' name modifier}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute simd if(target: argc) if (argc) // expected-note {{previous clause with directive name modifier specified here}} expected-error {{no more 'if' clause is allowed}}
+#pragma omp target teams distribute simd if(target: argc) if (argc) // expected-note {{previous clause with directive name modifier specified here}} omp45-error {{no more 'if' clause is allowed}} omp50-error {{expected 'simd' directive name modifier}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute simd if(distribute : argc) // expected-error {{directive name modifier 'distribute' is not allowed for '#pragma omp target teams distribute simd'}}
for (i = 0; i < argc; ++i) foo();
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_lastprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_lastprivate_messages.cpp
index f7fb69f..09da5e6 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_lastprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_lastprivate_messages.cpp
@@ -1,6 +1,10 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,le45 -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,le45 -fopenmp-version=40 -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,le45 -fopenmp-version=45 -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected -fopenmp-version=50 -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,le45 -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected -fopenmp-version=50 -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
@@ -101,6 +105,9 @@
#pragma omp target teams distribute simd lastprivate(argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
for (int k = 0; k < argc; ++k) ++k;
+#pragma omp target teams distribute simd lastprivate(conditional: argc) lastprivate(conditional: // expected-error 2 {{use of undeclared identifier 'conditional'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k) ++k;
+
#pragma omp target teams distribute simd lastprivate(S1) // expected-error {{'S1' does not refer to a value}}
for (int k = 0; k < argc; ++k) ++k;
@@ -240,7 +247,7 @@
#pragma omp target teams distribute simd lastprivate(si) // OK
for (i = 0; i < argc; ++i) si = i + 1;
-#pragma omp target teams distribute simd lastprivate(k) map(k) // expected-error {{lastprivate variable cannot be in a map clause in '#pragma omp target teams distribute simd' directive}} expected-note {{defined as lastprivate}}
+#pragma omp target teams distribute simd lastprivate(k) map(k) // le45-error {{lastprivate variable cannot be in a map clause in '#pragma omp target teams distribute simd' directive}} le45-note {{defined as lastprivate}}
for (i = 0; i < argc; ++i) foo();
return foomain<S4, S5>(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<S4, S5>' requested here}}
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_linear_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_linear_messages.cpp
index 90b719c..11c24cb 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_linear_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_linear_messages.cpp
@@ -12,6 +12,13 @@
extern const omp_allocator_handle_t omp_pteam_mem_alloc;
extern const omp_allocator_handle_t omp_thread_mem_alloc;
+void xxx(int argc) {
+ int i, step; // expected-note {{initialize the variable 'step' to silence this warning}}
+#pragma omp target teams distribute simd linear(i : step) // expected-warning {{variable 'step' is uninitialized when used here}}
+ for (i = 0; i < 10; ++i)
+ ;
+}
+
namespace X {
int x;
};
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_loop_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_loop_messages.cpp
index 1ec1e3bd..46dd35a 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_loop_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_loop_messages.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wno-openmp-mapping -Wuninitialized
class S {
int a;
@@ -93,28 +93,28 @@
c[ii] = a[ii];
#pragma omp target teams distribute simd
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
for (int i = 0; i; i++)
c[i] = a[i];
#pragma omp target teams distribute simd
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
// expected-error@+1 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'i'}}
for (int i = 0; jj < kk; ii++)
c[i] = a[i];
#pragma omp target teams distribute simd
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
for (int i = 0; !!i; i++)
c[i] = a[i];
-// Ok
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
#pragma omp target teams distribute simd
for (int i = 0; i != 1; i++)
c[i] = a[i];
#pragma omp target teams distribute simd
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
for (int i = 0;; i++)
c[i] = a[i];
@@ -403,15 +403,15 @@
for (begin = end; begin < end; ++begin)
++begin;
#pragma omp target teams distribute simd
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
for (GoodIter I = begin; I - I; ++I)
++I;
#pragma omp target teams distribute simd
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
for (GoodIter I = begin; begin < end; ++I)
++I;
#pragma omp target teams distribute simd
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
for (GoodIter I = begin; !I; ++I)
++I;
#pragma omp target teams distribute simd
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_map_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_map_messages.cpp
index 313bd74..71d2ee6 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_map_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_map_messages.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wno-openmp-mapping -Wuninitialized
void foo() {
}
@@ -9,6 +9,13 @@
return argc;
}
+void xxx(int argc) {
+ int map; // expected-note {{initialize the variable 'map' to silence this warning}}
+#pragma omp target teams distribute simd map(map) // expected-warning {{variable 'map' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
struct S1; // expected-note 2 {{declared here}}
extern S1 a;
class S2 {
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_misc_messages.c b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_misc_messages.c
index 16f595d..18c33a1 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_misc_messages.c
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_misc_messages.c
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=45 -verify=expected,omp45 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -verify=expected,omp50 %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=45 -verify=expected,omp45 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -verify=expected,omp50 %s -Wuninitialized
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp target teams distribute simd'}}
#pragma omp target teams distribute simd
@@ -319,3 +321,87 @@
}
}
+void test_nontemporal() {
+ int i;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target teams distribute simd'}} expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp target teams distribute simd nontemporal(
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target teams distribute simd'}} expected-error@+1 2 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp target teams distribute simd nontemporal(,
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target teams distribute simd'}} expected-error@+1 2 {{expected expression}}
+#pragma omp target teams distribute simd nontemporal(, )
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target teams distribute simd'}} expected-error@+1 {{expected expression}}
+#pragma omp target teams distribute simd nontemporal()
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target teams distribute simd'}} expected-error@+1 {{expected expression}}
+#pragma omp target teams distribute simd nontemporal(int)
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target teams distribute simd'}} omp50-error@+1 {{expected variable name}}
+#pragma omp target teams distribute simd nontemporal(0)
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target teams distribute simd'}} expected-error@+1 {{use of undeclared identifier 'x'}}
+#pragma omp target teams distribute simd nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+// expected-error@+2 {{use of undeclared identifier 'x'}}
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target teams distribute simd'}} expected-error@+1 {{use of undeclared identifier 'y'}}
+#pragma omp target teams distribute simd nontemporal(x, y)
+ for (i = 0; i < 16; ++i)
+ ;
+// expected-error@+3 {{use of undeclared identifier 'x'}}
+// expected-error@+2 {{use of undeclared identifier 'y'}}
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target teams distribute simd'}} expected-error@+1 {{use of undeclared identifier 'z'}}
+#pragma omp target teams distribute simd nontemporal(x, y, z)
+ for (i = 0; i < 16; ++i)
+ ;
+
+ int x, y;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target teams distribute simd'}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp target teams distribute simd nontemporal(x :)
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target teams distribute simd'}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}}
+#pragma omp target teams distribute simd nontemporal(x :, )
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp50-note@+2 {{defined as nontemporal}}
+// omp45-error@+1 2 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target teams distribute simd'}} omp50-error@+1 {{a variable cannot appear in more than one nontemporal clause}}
+#pragma omp target teams distribute simd nontemporal(x) nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target teams distribute simd'}}
+#pragma omp target teams distribute simd private(x) nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target teams distribute simd'}}
+#pragma omp target teams distribute simd nontemporal(x) private(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target teams distribute simd'}} expected-note@+1 {{to match this '('}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}} expected-error@+1 {{expected ')'}}
+#pragma omp target teams distribute simd nontemporal(x, y : 0)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target teams distribute simd'}}
+#pragma omp target teams distribute simd nontemporal(x) lastprivate(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target teams distribute simd'}}
+#pragma omp target teams distribute simd lastprivate(x) nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+}
+
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_private_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_private_messages.cpp
index 2c53a4a..1ed9e76 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_private_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_private_messages.cpp
@@ -1,6 +1,9 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,le45 -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,le45 -fopenmp-version=40 -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,le45 -fopenmp-version=45 -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected -fopenmp-version=50 -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,le45 -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
@@ -132,7 +135,7 @@
for (int k = 0; k < 10; ++k) {
}
-#pragma omp target teams distribute simd private(j) map(j) // expected-error {{private variable cannot be in a map clause in '#pragma omp target teams distribute simd' directive}} expected-note {{defined as private}}
+#pragma omp target teams distribute simd private(j) map(j) // le45-error {{private variable cannot be in a map clause in '#pragma omp target teams distribute simd' directive}} le45-note {{defined as private}}
for (int k = 0; k < argc; ++k) ++k;
return 0;
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_reduction_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_reduction_messages.cpp
index 84da687..100f992 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_reduction_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_distribute_simd_reduction_messages.cpp
@@ -16,6 +16,13 @@
extern const omp_allocator_handle_t omp_pteam_mem_alloc;
extern const omp_allocator_handle_t omp_thread_mem_alloc;
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp target teams distribute simd reduction(+:fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
void foo() {
}
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_firstprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_firstprivate_messages.cpp
index 7958d6f..1f4f40d 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_firstprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_firstprivate_messages.cpp
@@ -19,6 +19,13 @@
return argc;
}
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp target teams firstprivate(fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
struct S1; // expected-note {{declared here}} expected-note{{forward declaration of 'S1'}}
extern S1 a;
class S2 {
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_map_codegen.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_map_codegen.cpp
new file mode 100644
index 0000000..00d2839
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_map_codegen.cpp
@@ -0,0 +1,172 @@
+// Test host codegen.
+// RUN: %clang_cc1 -DHAS_INT128 -verify -fopenmp -fopenmp-version=50 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s -check-prefixes=CHECK,HOST,INT128,HOST-INT128
+// RUN: %clang_cc1 -DHAS_INT128 -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
+// RUN: %clang_cc1 -DHAS_INT128 -fopenmp -fopenmp-version=50 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s -check-prefixes=CHECK,HOST,INT128,HOST-INT128
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s -check-prefixes=CHECK,HOST
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s -check-prefixes=CHECK,HOST
+
+// Test target codegen - host bc file has to be created first.
+// RUN: %clang_cc1 -DHAS_INT128 -verify -fopenmp -fopenmp-version=50 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm-bc %s -o %t-ppc-host.bc
+// RUN: %clang_cc1 -DHAS_INT128 -verify -fopenmp -fopenmp-version=50 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck %s -check-prefixes=CHECK,INT128
+// RUN: %clang_cc1 -DHAS_INT128 -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o %t %s
+// RUN: %clang_cc1 -DHAS_INT128 -fopenmp -fopenmp-version=50 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s -check-prefixes=CHECK,INT128
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm-bc %s -o %t-x86-host.bc
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o - | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
+
+// expected-no-diagnostics
+#ifndef HEADER
+#define HEADER
+
+// HOST: @[[MAPTYPES_FIRSTPRIVATE:.offload_maptypes[0-9.]*]] = private {{.*}}constant [2 x i64] [i64 35, i64 35]
+// HOST: @[[MAPTYPES_REDUCTION:.offload_maptypes[0-9.]*]] = private {{.*}}constant [2 x i64] [i64 35, i64 35]
+// HOST: @[[MAPTYPES_FROM:.offload_maptypes[0-9.]*]] = private {{.*}}constant [1 x i64] [i64 34]
+// HOST: @[[MAPTYPES_TO:.offload_maptypes[0-9.]*]] = private {{.*}}constant [1 x i64] [i64 33]
+// HOST: @[[MAPTYPES_ALLOC:.offload_maptypes[0-9.]*]] = private {{.*}}constant [1 x i64] [i64 32]
+// HOST: @[[MAPTYPES_ARRAY_R0:.offload_maptypes[0-9.]*]] = private {{.*}}constant [2 x i64] [i64 35, i64 35]
+// HOST: @[[MAPTYPES_ARRAY_R1:.offload_maptypes[0-9.]*]] = private {{.*}}constant [2 x i64] [i64 33, i64 33]
+// HOST-INT128: @[[MAPTYPES_INT128_R0:.offload_maptypes[0-9.]*]] = private {{.*}}constant [2 x i64] [i64 35, i64 35]
+// HOST-INT128: @[[MAPTYPES_INT128_R1:.offload_maptypes[0-9.]*]] = private {{.*}}constant [2 x i64] [i64 34, i64 34]
+//
+// CHECK: @.omp_offloading.entry_name{{[0-9.]*}} = {{.*}} c"[[OFFLOAD_PRIVATE:__omp_offloading_[^"\\]*mapWithPrivate[^"\\]*]]\00"
+// CHECK: @.omp_offloading.entry_name{{[0-9.]*}} = {{.*}} c"[[OFFLOAD_FIRSTPRIVATE:__omp_offloading_[^"\\]*mapWithFirstprivate[^"\\]*]]\00"
+// CHECK: @.omp_offloading.entry_name{{[0-9.]*}} = {{.*}} c"[[OFFLOAD_REDUCTION:__omp_offloading_[^"\\]*mapWithReduction[^"\\]*]]\00"
+// CHECK: @.omp_offloading.entry_name{{[0-9.]*}} = {{.*}} c"[[OFFLOAD_FROM:__omp_offloading_[^"\\]*mapFrom[^"\\]*]]\00"
+// CHECK: @.omp_offloading.entry_name{{[0-9.]*}} = {{.*}} c"[[OFFLOAD_TO:__omp_offloading_[^"\\]*mapTo[^"\\]*]]\00"
+// CHECK: @.omp_offloading.entry_name{{[0-9.]*}} = {{.*}} c"[[OFFLOAD_ALLOC:__omp_offloading_[^"\\]*mapAlloc[^"\\]*]]\00"
+// CHECK: @.omp_offloading.entry_name{{[0-9.]*}} = {{.*}} c"[[OFFLOAD_ARRAY_R0:__omp_offloading_[^"\\]*mapArray[^"\\]*]]\00"
+// CHECK: @.omp_offloading.entry_name{{[0-9.]*}} = {{.*}} c"[[OFFLOAD_ARRAY_R1:__omp_offloading_[^"\\]*mapArray[^"\\]*]]\00"
+// INT128: @.omp_offloading.entry_name{{[0-9.]*}} = {{.*}} c"[[OFFLOAD_INT128_R0:__omp_offloading_[^"\\]*mapInt128[^"\\]*]]\00"
+// INT128: @.omp_offloading.entry_name{{[0-9.]*}} = {{.*}} c"[[OFFLOAD_INT128_R1:__omp_offloading_[^"\\]*mapInt128[^"\\]*]]\00"
+
+// HOST: define {{.*}}mapWithPrivate
+// HOST: call {{.*}} @.[[OFFLOAD_PRIVATE]].region_id
+// HOST-NOT: offload_maptypes
+// HOST-SAME: {{$}}
+//
+// CHECK: define {{.*}} void @[[OFFLOAD_PRIVATE]]()
+// CHECK: call void ({{.*}}@[[OUTLINE_PRIVATE:.omp_outlined.[.0-9]*]]
+//
+// CHECK: define {{.*}} void @[[OUTLINE_PRIVATE]]({{.*}} %.global_tid., {{.*}} %.bound_tid.)
+void mapWithPrivate() {
+ int x, y;
+ #pragma omp target teams private(x) map(x,y) private(y)
+ ;
+}
+
+// HOST: define {{.*}}mapWithFirstprivate
+// HOST: call {{.*}} @.[[OFFLOAD_FIRSTPRIVATE]].region_id{{.*}} @[[MAPTYPES_FIRSTPRIVATE]]
+//
+// CHECK: define {{.*}} void @[[OFFLOAD_FIRSTPRIVATE]](i{{[0-9]*}}* {{[^,]*}}%x, i{{[0-9]*}}* {{[^,]*}}%y)
+// CHECK: call void ({{.*}}@[[OUTLINE_FIRSTPRIVATE:.omp_outlined.[.0-9]*]]
+//
+// CHECK: define {{.*}} void @[[OUTLINE_FIRSTPRIVATE]]({{.*}} %.global_tid., {{.*}} %.bound_tid., i{{[0-9]*}} %x, i{{[0-9]*}} %y)
+void mapWithFirstprivate() {
+ int x, y;
+ #pragma omp target teams firstprivate(x) map(x,y) firstprivate(y)
+ ;
+}
+
+// HOST: define {{.*}}mapWithReduction
+// HOST: call {{.*}} @.[[OFFLOAD_REDUCTION]].region_id{{.*}} @[[MAPTYPES_REDUCTION]]
+//
+// CHECK: define {{.*}} void @[[OFFLOAD_REDUCTION]](i{{[0-9]*}}* {{[^,]*}}%x, i{{[0-9]*}}* {{[^,]*}}%y)
+// CHECK: call void ({{.*}}@[[OUTLINE_REDUCTION:.omp_outlined.[.0-9]*]]
+//
+// CHECK: define {{.*}} void @[[OUTLINE_REDUCTION]]({{[^)]*}} i{{[0-9]*}}* {{[^,]*}}%x, i{{[0-9]*}}* {{[^,]*}}%y)
+// CHECK: %.omp.reduction.red_list = alloca [2 x i8*]
+void mapWithReduction() {
+ int x, y;
+ #pragma omp target teams reduction(+:x) map(x,y) reduction(+:y)
+ ;
+}
+
+// HOST: define {{.*}}mapFrom
+// HOST: call {{.*}} @.[[OFFLOAD_FROM]].region_id{{.*}} @[[MAPTYPES_FROM]]
+//
+// CHECK: define {{.*}} void @[[OFFLOAD_FROM]](i{{[0-9]*}}* {{[^,]*}}%x)
+// CHECK: call void ({{.*}}@[[OUTLINE_FROM:.omp_outlined.[.0-9]*]]
+//
+// CHECK: define {{.*}} void @[[OUTLINE_FROM]]({{.*}} %.global_tid., {{.*}} %.bound_tid., i{{[0-9]*}} %x)
+void mapFrom() {
+ int x;
+ #pragma omp target teams firstprivate(x) map(from:x)
+ ;
+}
+
+// HOST: define {{.*}}mapTo
+// HOST: call {{.*}} @.[[OFFLOAD_TO]].region_id{{.*}} @[[MAPTYPES_TO]]
+//
+// CHECK: define {{.*}} void @[[OFFLOAD_TO]](i{{[0-9]*}}* {{[^,]*}}%x)
+// CHECK: call void ({{.*}}@[[OUTLINE_TO:.omp_outlined.[.0-9]*]]
+//
+// CHECK: define {{.*}} void @[[OUTLINE_TO]]({{.*}} %.global_tid., {{.*}} %.bound_tid., i{{[0-9]*}} %x)
+void mapTo() {
+ int x;
+ #pragma omp target teams firstprivate(x) map(to:x)
+ ;
+}
+
+// HOST: define {{.*}}mapAlloc
+// HOST: call {{.*}} @.[[OFFLOAD_ALLOC]].region_id{{.*}} @[[MAPTYPES_ALLOC]]
+//
+// CHECK: define {{.*}} void @[[OFFLOAD_ALLOC]](i{{[0-9]*}}* {{[^,]*}}%x)
+// CHECK: call void ({{.*}}@[[OUTLINE_ALLOC:.omp_outlined.[.0-9]*]]
+//
+// CHECK: define {{.*}} void @[[OUTLINE_ALLOC]]({{.*}} %.global_tid., {{.*}} %.bound_tid., i{{[0-9]*}} %x)
+void mapAlloc() {
+ int x;
+ #pragma omp target teams firstprivate(x) map(alloc:x)
+ ;
+}
+
+// HOST: define {{.*}}mapArray
+// HOST: call {{.*}} @.[[OFFLOAD_ARRAY_R0]].region_id{{.*}} @[[MAPTYPES_ARRAY_R0]]
+// HOST: call {{.*}} @.[[OFFLOAD_ARRAY_R1]].region_id{{.*}} @[[MAPTYPES_ARRAY_R1]]
+//
+// CHECK: define {{.*}} void @[[OFFLOAD_ARRAY_R0]]([88 x i{{[0-9]*}}]* {{[^,]*}}%y, [99 x i{{[0-9]*}}]* {{[^,]*}}%z)
+// CHECK: call void ({{.*}}@[[OUTLINE_ARRAY_R0:.omp_outlined.[.0-9]*]]
+//
+// CHECK: define {{.*}} void @[[OUTLINE_ARRAY_R0]]({{.*}} %.global_tid., {{.*}} %.bound_tid., [88 x i{{[0-9]*}}]* {{[^,]*}}%y, [99 x i{{[0-9]*}}]* {{[^,]*}}%z)
+// CHECK: %.omp.reduction.red_list = alloca [1 x i8*]
+//
+// CHECK: define {{.*}} void @[[OFFLOAD_ARRAY_R1]]([88 x i{{[0-9]*}}]* {{[^,]*}}%y, [99 x i{{[0-9]*}}]* {{[^,]*}}%z)
+// CHECK: call void ({{.*}}@[[OUTLINE_ARRAY_R1:.omp_outlined.[.0-9]*]]
+//
+// CHECK: define {{.*}} void @[[OUTLINE_ARRAY_R1]]({{.*}} %.global_tid., {{.*}} %.bound_tid., [88 x i{{[0-9]*}}]* {{[^,]*}}%y, [99 x i{{[0-9]*}}]* {{[^,]*}}%z)
+// CHECK: %.omp.reduction.red_list = alloca [1 x i8*]
+void mapArray() {
+ int x[77], y[88], z[99];
+ #pragma omp target teams private(x) firstprivate(y) reduction(+:z) map(x,y,z)
+ ;
+ #pragma omp target teams private(x) firstprivate(y) reduction(+:z) map(to:x,y,z)
+ ;
+}
+
+# if HAS_INT128
+// HOST-INT128: define {{.*}}mapInt128
+// HOST-INT128: call {{.*}} @.[[OFFLOAD_INT128_R0]].region_id{{.*}} @[[MAPTYPES_INT128_R0]]
+// HOST-INT128: call {{.*}} @.[[OFFLOAD_INT128_R1]].region_id{{.*}} @[[MAPTYPES_INT128_R1]]
+//
+// INT128: define {{.*}} void @[[OFFLOAD_INT128_R0]](i128* {{[^,]*}}%y, i128* {{[^,]*}}%z)
+// INT128: call void ({{.*}}@[[OUTLINE_INT128_R0:.omp_outlined.[.0-9]*]]
+//
+// INT128: define {{.*}} void @[[OUTLINE_INT128_R0]]({{.*}} %.global_tid., {{.*}} %.bound_tid., i128* {{[^,]*}}%y, i128* {{[^,]*}}%z)
+// INT128: %.omp.reduction.red_list = alloca [1 x i8*]
+//
+// INT128: define {{.*}} void @[[OFFLOAD_INT128_R1]](i128* {{[^,]*}}%y, i128* {{[^,]*}}%z)
+// INT128: call void ({{.*}}@[[OUTLINE_INT128_R1:.omp_outlined.[.0-9]*]]
+//
+// INT128: define {{.*}} void @[[OUTLINE_INT128_R1]]({{.*}} %.global_tid., {{.*}} %.bound_tid., i128* {{[^,]*}}%y, i128* {{[^,]*}}%z)
+// INT128: %.omp.reduction.red_list = alloca [1 x i8*]
+void mapInt128() {
+ __int128 x, y, z;
+ #pragma omp target teams private(x) firstprivate(y) reduction(+:z) map(x,y,z)
+ ;
+ #pragma omp target teams private(x) firstprivate(y) reduction(+:z) map(from:x,y,z)
+ ;
+}
+# endif
+#endif
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_map_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_map_messages.cpp
index d70598b..3229855 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_map_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_map_messages.cpp
@@ -1,7 +1,10 @@
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 200 %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,le45 -fopenmp -ferror-limit 200 %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,le45 -fopenmp-version=40 -fopenmp -ferror-limit 200 %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,le45 -fopenmp-version=45 -fopenmp -ferror-limit 200 %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -verify=expected -fopenmp-version=50 -fopenmp -ferror-limit 200 %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 200 %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -DCCODE -verify -fopenmp -ferror-limit 200 -x c %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,le45 -fopenmp-simd -ferror-limit 200 %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -DCCODE -verify=expected,le45 -fopenmp -ferror-limit 200 -x c %s -Wno-openmp-mapping -Wuninitialized
#ifdef CCODE
void foo(int arg) {
const int n = 0;
@@ -18,6 +21,14 @@
{}
}
#else
+
+void xxx(int argc) {
+ int map; // expected-note {{initialize the variable 'map' to silence this warning}}
+#pragma omp target teams map(tofrom: map) // expected-warning {{variable 'map' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
template <typename T, int I>
struct SA {
static int ss;
@@ -536,10 +547,10 @@
#pragma omp target teams map(tofrom j) // expected-error {{expected ',' or ')' in 'map' clause}}
foo();
-#pragma omp target teams private(j) map(j) // expected-error {{private variable cannot be in a map clause in '#pragma omp target teams' directive}} expected-note {{defined as private}}
+#pragma omp target teams private(j) map(j) // le45-error {{private variable cannot be in a map clause in '#pragma omp target teams' directive}} le45-note {{defined as private}}
{}
-#pragma omp target teams firstprivate(j) map(j) // expected-error {{firstprivate variable cannot be in a map clause in '#pragma omp target teams' directive}} expected-note {{defined as firstprivate}}
+#pragma omp target teams firstprivate(j) map(j) // le45-error {{firstprivate variable cannot be in a map clause in '#pragma omp target teams' directive}} le45-note {{defined as firstprivate}}
{}
#pragma omp target teams map(m)
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_num_teams_codegen.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_num_teams_codegen.cpp
index 3d2eb55..427119b 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_num_teams_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_num_teams_codegen.cpp
@@ -44,13 +44,9 @@
// CHECK-DAG: [[S1:%.+]] = type { double }
// CHECK-DAG: [[ENTTY:%.+]] = type { i8*, i8*, i[[SZ:32|64]], i32, i32 }
-// CHECK-DAG: [[DEVTY:%.+]] = type { i8*, i8*, [[ENTTY]]*, [[ENTTY]]* }
-// CHECK-DAG: [[DSCTY:%.+]] = type { i32, [[DEVTY]]*, [[ENTTY]]*, [[ENTTY]]* }
// TCHECK: [[ENTTY:%.+]] = type { i8*, i8*, i{{32|64}}, i32, i32 }
-// CHECK-DAG: $[[REGFN:\.omp_offloading\..+]] = comdat
-
// We have 6 target regions
// CHECK-DAG: @{{.*}} = weak constant i8 0
@@ -67,16 +63,8 @@
// TCHECK: @{{.+}} = weak constant [[ENTTY]]
// TCHECK: @{{.+}} = weak constant [[ENTTY]]
-// Check if offloading descriptor is created.
-// CHECK: [[ENTBEGIN:@.+]] = external constant [[ENTTY]]
-// CHECK: [[ENTEND:@.+]] = external constant [[ENTTY]]
-// CHECK: [[DEVBEGIN:@.+]] = extern_weak constant i8
-// CHECK: [[DEVEND:@.+]] = extern_weak constant i8
-// CHECK: [[IMAGES:@.+]] = internal unnamed_addr constant [1 x [[DEVTY]]] [{{.+}} { i8* [[DEVBEGIN]], i8* [[DEVEND]], [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }], comdat($[[REGFN]])
-// CHECK: [[DESC:@.+]] = internal constant [[DSCTY]] { i32 1, [[DEVTY]]* getelementptr inbounds ([1 x [[DEVTY]]], [1 x [[DEVTY]]]* [[IMAGES]], i32 0, i32 0), [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }, comdat($[[REGFN]])
-
// Check target registration is registered as a Ctor.
-// CHECK: appending global [2 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }, { i32, void ()*, i8* } { i32 0, void ()* @[[REGFN]], i8* bitcast (void ()* @[[REGFN]] to i8*) }]
+// CHECK: appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }]
template<typename tx>
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_reduction_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_reduction_messages.cpp
index 7768429..3da0cc8 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_reduction_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_reduction_messages.cpp
@@ -16,6 +16,13 @@
extern const omp_allocator_handle_t omp_pteam_mem_alloc;
extern const omp_allocator_handle_t omp_thread_mem_alloc;
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp target teams reduction(+:fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
void foo() {
}
diff --git a/src/llvm-project/clang/test/OpenMP/target_teams_thread_limit_codegen.cpp b/src/llvm-project/clang/test/OpenMP/target_teams_thread_limit_codegen.cpp
index 3dfd753..f697539 100644
--- a/src/llvm-project/clang/test/OpenMP/target_teams_thread_limit_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_teams_thread_limit_codegen.cpp
@@ -44,13 +44,9 @@
// CHECK-DAG: [[S1:%.+]] = type { double }
// CHECK-DAG: [[ENTTY:%.+]] = type { i8*, i8*, i[[SZ:32|64]], i32, i32 }
-// CHECK-DAG: [[DEVTY:%.+]] = type { i8*, i8*, [[ENTTY]]*, [[ENTTY]]* }
-// CHECK-DAG: [[DSCTY:%.+]] = type { i32, [[DEVTY]]*, [[ENTTY]]*, [[ENTTY]]* }
// TCHECK: [[ENTTY:%.+]] = type { i8*, i8*, i{{32|64}}, i32, i32 }
-// CHECK-DAG: $[[REGFN:\.omp_offloading\..+]] = comdat
-
// We have 6 target regions
// CHECK-DAG: @{{.*}} = weak constant i8 0
@@ -67,16 +63,8 @@
// TCHECK: @{{.+}} = weak constant [[ENTTY]]
// TCHECK: @{{.+}} = weak constant [[ENTTY]]
-// Check if offloading descriptor is created.
-// CHECK: [[ENTBEGIN:@.+]] = external constant [[ENTTY]]
-// CHECK: [[ENTEND:@.+]] = external constant [[ENTTY]]
-// CHECK: [[DEVBEGIN:@.+]] = extern_weak constant i8
-// CHECK: [[DEVEND:@.+]] = extern_weak constant i8
-// CHECK: [[IMAGES:@.+]] = internal unnamed_addr constant [1 x [[DEVTY]]] [{{.+}} { i8* [[DEVBEGIN]], i8* [[DEVEND]], [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }], comdat($[[REGFN]])
-// CHECK: [[DESC:@.+]] = internal constant [[DSCTY]] { i32 1, [[DEVTY]]* getelementptr inbounds ([1 x [[DEVTY]]], [1 x [[DEVTY]]]* [[IMAGES]], i32 0, i32 0), [[ENTTY]]* [[ENTBEGIN]], [[ENTTY]]* [[ENTEND]] }, comdat($[[REGFN]])
-
// Check target registration is registered as a Ctor.
-// CHECK: appending global [2 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }, { i32, void ()*, i8* } { i32 0, void ()* @[[REGFN]], i8* bitcast (void ()* @[[REGFN]] to i8*) }]
+// CHECK: appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @.omp_offloading.requires_reg, i8* null }]
template<typename tx>
diff --git a/src/llvm-project/clang/test/OpenMP/target_update_depend_codegen.cpp b/src/llvm-project/clang/test/OpenMP/target_update_depend_codegen.cpp
index c146876..30de93a 100644
--- a/src/llvm-project/clang/test/OpenMP/target_update_depend_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_update_depend_codegen.cpp
@@ -376,7 +376,7 @@
{++arg;}
}
-// CK1: define internal{{.*}} i32 [[TASK_ENTRY0]](i32{{.*}}, %struct.kmp_task_t_with_privates* noalias)
+// CK1: define internal{{.*}} i32 [[TASK_ENTRY0]](i32{{.*}}, %struct.kmp_task_t_with_privates* noalias %1)
// CK1-DAG: call void @__tgt_target_data_update_nowait(i64 [[DEV:%[^,]+]], i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], i64* [[GEPS:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE00]]{{.+}})
// CK1-DAG: [[DEV]] = sext i32 [[DEVi32:%[^,]+]] to i64
// CK1-DAG: [[DEVi32]] = load i32, i32* %{{[^,]+}},
@@ -390,7 +390,7 @@
// CK1: ret i32 0
// CK1: }
-// CK1: define internal{{.*}} i32 [[TASK_ENTRY2]](i32{{.*}}, %struct.kmp_task_t_with_privates{{.+}}* noalias)
+// CK1: define internal{{.*}} i32 [[TASK_ENTRY2]](i32{{.*}}, %struct.kmp_task_t_with_privates{{.+}}* noalias %1)
// CK1-DAG: call void @__tgt_target_data_update(i64 4, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], i64* [[GEPS:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE02]]{{.+}})
// CK1-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]]
// CK1-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]]
@@ -402,7 +402,7 @@
// CK1: ret i32 0
// CK1: }
-// CK1: define internal{{.*}} i32 [[TASK_ENTRY3]](i32{{.*}}, %struct.kmp_task_t_with_privates{{.+}}* noalias)
+// CK1: define internal{{.*}} i32 [[TASK_ENTRY3]](i32{{.*}}, %struct.kmp_task_t_with_privates{{.+}}* noalias %1)
// CK1-DAG: call void @__tgt_target_data_update(i64 -1, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], i64* [[GEPS:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE03]]{{.+}})
// CK1-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]]
// CK1-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]]
@@ -416,7 +416,7 @@
// CK1: ret i32 0
// CK1: }
-// CK1: define internal{{.*}} i32 [[TASK_ENTRY4]](i32{{.*}}, %struct.kmp_task_t_with_privates{{.+}}* noalias)
+// CK1: define internal{{.*}} i32 [[TASK_ENTRY4]](i32{{.*}}, %struct.kmp_task_t_with_privates{{.+}}* noalias %1)
// CK1-DAG: call void @__tgt_target_data_update(i64 -1, i32 2, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], i64* [[GEPS:%.+]], {{.+}}getelementptr {{.+}}[2 x i{{.+}}]* [[MTYPE04]]{{.+}})
// CK1-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]]
// CK1-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]]
diff --git a/src/llvm-project/clang/test/OpenMP/target_update_depend_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_update_depend_messages.cpp
index e09284f..1810785 100644
--- a/src/llvm-project/clang/test/OpenMP/target_update_depend_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_update_depend_messages.cpp
@@ -15,7 +15,6 @@
public:
int operator[](int index) { return 0; }
};
-
template <class T, class S, class R>
int tmain(T argc, S **argv, R *env[]) {
vector vec;
@@ -52,7 +51,7 @@
#pragma omp target update to(z) depend(in : argv[argc: // expected-error {{expected expression}} expected-error {{expected ']'}} expected-error {{expected ')'}} expected-note {{to match this '['}} expected-note {{to match this '('}}
#pragma omp target update to(z) depend(in : argv[argc:argc] // expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp target update to(z) depend(in : argv[0:-1]) // expected-error {{section length is evaluated to a negative value -1}}
- #pragma omp target update to(z) depend(in : argv[-1:0])
+ #pragma omp target update to(z) depend(in : argv[-1:0]) // expected-error {{zero-length array section is not allowed in 'depend' clause}}
#pragma omp target update to(z) depend(in : argv[:]) // expected-error {{section length is unspecified and cannot be inferred because subscripted value is not an array}}
#pragma omp target update to(z) depend(in : argv[3:4:1]) // expected-error {{expected ']'}} expected-note {{to match this '['}}
#pragma omp target update to(z) depend(in:a[0:1]) // expected-error {{subscripted value is not an array or pointer}}
@@ -64,7 +63,6 @@
return 0;
}
-
int main(int argc, char **argv, char *env[]) {
vector vec;
typedef float V __attribute__((vector_size(16)));
@@ -100,7 +98,7 @@
#pragma omp target update to(z) depend(in : argv[argc: // expected-error {{expected expression}} expected-error {{expected ']'}} expected-error {{expected ')'}} expected-note {{to match this '['}} expected-note {{to match this '('}}
#pragma omp target update to(z) depend(in : argv[argc:argc] // expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp target update to(z) depend(in : argv[0:-1]) // expected-error {{section length is evaluated to a negative value -1}}
- #pragma omp target update to(z) depend(in : argv[-1:0])
+ #pragma omp target update to(z) depend(in : argv[-1:0]) // expected-error {{zero-length array section is not allowed in 'depend' clause}}
#pragma omp target update to(z) depend(in : argv[:]) // expected-error {{section length is unspecified and cannot be inferred because subscripted value is not an array}}
#pragma omp target update to(z) depend(in : argv[3:4:1]) // expected-error {{expected ']'}} expected-note {{to match this '['}}
#pragma omp target update to(z) depend(in:a[0:1]) // expected-error {{subscripted value is not an array or pointer}}
@@ -109,6 +107,5 @@
#pragma omp target update to(z) depend(in:env[0:][:]) // expected-error {{section length is unspecified and cannot be inferred because subscripted value is an array of unknown bound}}
#pragma omp target update to(z) depend(in : argv[ : argc][1 : argc - 1])
#pragma omp target update to(z) depend(in : arr[0])
-
return tmain(argc, argv, env); // expected-note {{in instantiation of function template specialization 'tmain<int, char, char>' requested here}}
}
diff --git a/src/llvm-project/clang/test/OpenMP/target_update_from_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_update_from_messages.cpp
index b5e7c50..4000910 100644
--- a/src/llvm-project/clang/test/OpenMP/target_update_from_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_update_from_messages.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wno-openmp-mapping -Wuninitialized
void foo() {
}
diff --git a/src/llvm-project/clang/test/OpenMP/target_update_to_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_update_to_messages.cpp
index 296b258..9cf7303 100644
--- a/src/llvm-project/clang/test/OpenMP/target_update_to_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_update_to_messages.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wno-openmp-mapping -Wuninitialized
void foo() {
}
diff --git a/src/llvm-project/clang/test/OpenMP/target_vla_messages.cpp b/src/llvm-project/clang/test/OpenMP/target_vla_messages.cpp
index cf6a024..38a0a66 100644
--- a/src/llvm-project/clang/test/OpenMP/target_vla_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/target_vla_messages.cpp
@@ -47,7 +47,7 @@
#pragma omp target
{
#ifdef NO_VLA
- // expected-error@+2 2 {{variable length arrays are not supported for the current target}}
+ // expected-error@+2 {{variable length arrays are not supported for the current target}}
#endif
T vla[arg];
}
diff --git a/src/llvm-project/clang/test/OpenMP/task_codegen.cpp b/src/llvm-project/clang/test/OpenMP/task_codegen.cpp
index 2c4eb68..cf9f030 100644
--- a/src/llvm-project/clang/test/OpenMP/task_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/task_codegen.cpp
@@ -274,30 +274,30 @@
}
return a;
}
-// CHECK: define internal i32 [[TASK_ENTRY1]](i32, [[KMP_TASK_T]]{{.*}}* noalias)
+// CHECK: define internal i32 [[TASK_ENTRY1]](i32 %0, [[KMP_TASK_T]]{{.*}}* noalias %1)
// CHECK: store i32 15, i32* [[A_PTR:@.+]]
// CHECK: [[A_VAL:%.+]] = load i32, i32* [[A_PTR]]
// CHECK: [[A_VAL_I8:%.+]] = trunc i32 [[A_VAL]] to i8
// CHECK: store i8 [[A_VAL_I8]], i8* %{{.+}}
// CHECK: store i32 10, i32* %{{.+}}
-// CHECK: define internal i32 [[TASK_ENTRY2]](i32, [[KMP_TASK_T]]{{.*}}* noalias)
+// CHECK: define internal i32 [[TASK_ENTRY2]](i32 %0, [[KMP_TASK_T]]{{.*}}* noalias %1)
// CHECK: store i32 1, i32* [[A_PTR]]
-// CHECK: define internal i32 [[TASK_ENTRY3]](i32, [[KMP_TASK_T]]{{.*}}* noalias)
+// CHECK: define internal i32 [[TASK_ENTRY3]](i32 %0, [[KMP_TASK_T]]{{.*}}* noalias %1)
// CHECK: store i32 2, i32* [[A_PTR]]
-// CHECK: define internal i32 [[TASK_ENTRY4]](i32, [[KMP_TASK_T]]{{.*}}* noalias)
+// CHECK: define internal i32 [[TASK_ENTRY4]](i32 %0, [[KMP_TASK_T]]{{.*}}* noalias %1)
// CHECK: store i32 3, i32* [[A_PTR]]
-// CHECK: define internal i32 [[TASK_ENTRY5]](i32, [[KMP_TASK_T]]{{.*}}* noalias)
+// CHECK: define internal i32 [[TASK_ENTRY5]](i32 %0, [[KMP_TASK_T]]{{.*}}* noalias %1)
// CHECK: store i32 4, i32* [[A_PTR]]
// CHECK: store i32 5, i32* [[C_PTR:%.+]], align 128
// CHECK: define internal i32
// CHECK: store i32 4, i32* [[A_PTR]]
-// CHECK: define internal i32 [[TASK_ENTRY6]](i32, [[KMP_TASK_T]]{{.*}}* noalias)
+// CHECK: define internal i32 [[TASK_ENTRY6]](i32 %0, [[KMP_TASK_T]]{{.*}}* noalias %1)
// CHECK: switch i32 %{{.+}}, label
// CHECK: load i32*, i32** %
// CHECK: store i32 1, i32* %
diff --git a/src/llvm-project/clang/test/OpenMP/task_depend_messages.cpp b/src/llvm-project/clang/test/OpenMP/task_depend_messages.cpp
index 63ad847..407b8b4 100644
--- a/src/llvm-project/clang/test/OpenMP/task_depend_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/task_depend_messages.cpp
@@ -45,7 +45,7 @@
#pragma omp task depend (in : argv[argc: // expected-error {{expected expression}} expected-error {{expected ']'}} expected-error {{expected ')'}} expected-note {{to match this '['}} expected-note {{to match this '('}}
#pragma omp task depend (in : argv[argc:argc] // expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp task depend (in : argv[0:-1]) // expected-error {{section length is evaluated to a negative value -1}}
- #pragma omp task depend (in : argv[-1:0])
+ #pragma omp task depend (in : argv[-1:0]) // expected-error {{zero-length array section is not allowed in 'depend' clause}}
#pragma omp task depend (in : argv[:]) // expected-error {{section length is unspecified and cannot be inferred because subscripted value is not an array}}
#pragma omp task depend (in : argv[3:4:1]) // expected-error {{expected ']'}} expected-note {{to match this '['}}
#pragma omp task depend(in:a[0:1]) // expected-error {{subscripted value is not an array or pointer}}
diff --git a/src/llvm-project/clang/test/OpenMP/task_firstprivate_codegen.cpp b/src/llvm-project/clang/test/OpenMP/task_firstprivate_codegen.cpp
index dc0ba8a..e9c6d6d 100644
--- a/src/llvm-project/clang/test/OpenMP/task_firstprivate_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/task_firstprivate_codegen.cpp
@@ -13,8 +13,6 @@
// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DARRAY -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
// expected-no-diagnostics
-// It doesn't pass on win32.
-// REQUIRES: shell
#ifndef ARRAY
#ifndef HEADER
#define HEADER
@@ -89,7 +87,7 @@
// LAMBDA: store double 2.0{{.+}}, double* [[G_REF]]
// LAMBDA: store double* %{{.+}}, double** %{{.+}},
- // LAMBDA: define internal i32 [[TASK_ENTRY]](i32, %{{.+}}* noalias)
+ // LAMBDA: define internal i32 [[TASK_ENTRY]](i32 %0, %{{.+}}* noalias %1)
g = 1;
sivar = 11;
// LAMBDA: store double 1.0{{.+}}, double* %{{.+}},
@@ -135,7 +133,7 @@
// BLOCKS: store double* %{{.+}}, double** %{{.+}},
// BLOCKS: store i{{[0-9]+}}* %{{.+}}, i{{[0-9]+}}** %{{.+}},
- // BLOCKS: define internal i32 [[TASK_ENTRY]](i32, %{{.+}}* noalias)
+ // BLOCKS: define internal i32 [[TASK_ENTRY]](i32 %0, %{{.+}}* noalias %1)
g = 1;
sivar = 11;
// BLOCKS: store double 1.0{{.+}}, double* %{{.+}},
@@ -267,7 +265,7 @@
// CHECK: ret
//
-// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_MAIN_TY]]* noalias, i32** noalias, [2 x [[S_DOUBLE_TY]]]** noalias, [2 x i32]** noalias, i32** noalias, [[S_DOUBLE_TY]]** noalias)
+// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_MAIN_TY]]* noalias %0, i32** noalias %1, [2 x [[S_DOUBLE_TY]]]** noalias %2, [2 x i32]** noalias %3, i32** noalias %4, [[S_DOUBLE_TY]]** noalias %5)
// CHECK: [[PRIVATES:%.+]] = load [[PRIVATES_MAIN_TY]]*, [[PRIVATES_MAIN_TY]]**
// CHECK: [[PRIV_S_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 0
// CHECK: [[ARG3:%.+]] = load [2 x [[S_DOUBLE_TY]]]**, [2 x [[S_DOUBLE_TY]]]*** %{{.+}},
@@ -286,7 +284,7 @@
// CHECK: store i{{[0-9]+}}* [[PRIV_SIVAR]], i{{[0-9]+}}** [[ARG5]],
// CHECK: ret void
-// CHECK: define internal i32 [[TASK_ENTRY]](i32, [[KMP_TASK_MAIN_TY]]* noalias)
+// CHECK: define internal i32 [[TASK_ENTRY]](i32 %0, [[KMP_TASK_MAIN_TY]]* noalias %1)
// CHECK: alloca i32*,
// CHECK: [[PRIV_T_VAR_ADDR:%.+]] = alloca i32*,
@@ -314,7 +312,7 @@
// CHECK: ret
-// CHECK: define internal i32 [[DESTRUCTORS]](i32, [[KMP_TASK_MAIN_TY]]* noalias)
+// CHECK: define internal i32 [[DESTRUCTORS]](i32 %0, [[KMP_TASK_MAIN_TY]]* noalias %1)
// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 0
// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
@@ -412,7 +410,7 @@
// CHECK: ret
//
-// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_TMAIN_TY]]* noalias, i32** noalias, [2 x i32]** noalias, [2 x [[S_INT_TY]]]** noalias, [[S_INT_TY]]** noalias)
+// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_TMAIN_TY]]* noalias %0, i32** noalias %1, [2 x i32]** noalias %2, [2 x [[S_INT_TY]]]** noalias %3, [[S_INT_TY]]** noalias %4)
// CHECK: [[PRIVATES:%.+]] = load [[PRIVATES_TMAIN_TY]]*, [[PRIVATES_TMAIN_TY]]**
// CHECK: [[PRIV_T_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 0
// CHECK: [[ARG1:%.+]] = load i32**, i32*** %{{.+}},
@@ -428,7 +426,7 @@
// CHECK: store [[S_INT_TY]]* [[PRIV_VAR]], [[S_INT_TY]]** [[ARG4]],
// CHECK: ret void
-// CHECK: define internal i32 [[TASK_ENTRY]](i32, [[KMP_TASK_TMAIN_TY]]* noalias)
+// CHECK: define internal i32 [[TASK_ENTRY]](i32 %0, [[KMP_TASK_TMAIN_TY]]* noalias %1)
// CHECK: alloca i32*,
// CHECK-DAG: [[PRIV_T_VAR_ADDR:%.+]] = alloca i32*,
// CHECK-DAG: [[PRIV_VEC_ADDR:%.+]] = alloca [2 x i32]*,
@@ -450,7 +448,7 @@
// CHECK: ret
-// CHECK: define internal i32 [[DESTRUCTORS]](i32, [[KMP_TASK_TMAIN_TY]]* noalias)
+// CHECK: define internal i32 [[DESTRUCTORS]](i32 %0, [[KMP_TASK_TMAIN_TY]]* noalias %1)
// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
diff --git a/src/llvm-project/clang/test/OpenMP/task_firstprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/task_firstprivate_messages.cpp
index b8ff2cd..fa0436a 100644
--- a/src/llvm-project/clang/test/OpenMP/task_firstprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/task_firstprivate_messages.cpp
@@ -19,6 +19,13 @@
return argc;
}
+void xxx(int argc) {
+ int fp, fp1; // expected-note {{initialize the variable 'fp' to silence this warning}} expected-note {{initialize the variable 'fp1' to silence this warning}}
+#pragma omp task firstprivate(fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ++fp1; // expected-warning {{variable 'fp1' is uninitialized when used here}}
+}
+
template <typename T>
struct S {
T b;
diff --git a/src/llvm-project/clang/test/OpenMP/task_private_codegen.cpp b/src/llvm-project/clang/test/OpenMP/task_private_codegen.cpp
index 1484c6f..32303cd 100644
--- a/src/llvm-project/clang/test/OpenMP/task_private_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/task_private_codegen.cpp
@@ -13,8 +13,6 @@
// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DARRAY -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
// expected-no-diagnostics
-// It doesn't pass on win32. Investigating.
-// REQUIRES: shell
#ifndef ARRAY
#ifndef HEADER
@@ -79,7 +77,7 @@
// LAMBDA: [[SIVAR_REF:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** [[SIVAR_PTR_REF]]
// LAMBDA: store i{{[0-9]+}} 3, i{{[0-9]+}}* [[SIVAR_REF]]
- // LAMBDA: define internal i32 [[TASK_ENTRY]](i32, %{{.+}}* noalias)
+ // LAMBDA: define internal i32 [[TASK_ENTRY]](i32 %0, %{{.+}}* noalias %1)
g = 1;
sivar = 2;
// LAMBDA: store double 1.0{{.+}}, double* %{{.+}},
@@ -114,7 +112,7 @@
// BLOCKS-NOT: [[SIVAR]]{{[[^:word:]]}}
// BLOCKS: ret
- // BLOCKS: define internal i32 [[TASK_ENTRY]](i32, %{{.+}}* noalias)
+ // BLOCKS: define internal i32 [[TASK_ENTRY]](i32 %0, %{{.+}}* noalias %1)
g = 1;
sivar = 3;
// BLOCKS: store double 1.0{{.+}}, double* %{{.+}},
@@ -207,7 +205,7 @@
// CHECK: ret
//
-// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_MAIN_TY]]* noalias, [[S_DOUBLE_TY]]** noalias, i32** noalias, [2 x [[S_DOUBLE_TY]]]** noalias, [2 x i32]** noalias, i32** noalias)
+// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_MAIN_TY]]* noalias %0, [[S_DOUBLE_TY]]** noalias %1, i32** noalias %2, [2 x [[S_DOUBLE_TY]]]** noalias %3, [2 x i32]** noalias %4, i32** noalias %5)
// CHECK: [[PRIVATES:%.+]] = load [[PRIVATES_MAIN_TY]]*, [[PRIVATES_MAIN_TY]]**
// CHECK: [[PRIV_S_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 0
// CHECK: [[ARG3:%.+]] = load [2 x [[S_DOUBLE_TY]]]**, [2 x [[S_DOUBLE_TY]]]*** %{{.+}},
@@ -223,7 +221,7 @@
// CHECK: store [2 x i32]* [[PRIV_VEC]], [2 x i32]** [[ARG4]],
// CHECK: ret void
-// CHECK: define internal i32 [[TASK_ENTRY]](i32, [[KMP_TASK_MAIN_TY]]* noalias)
+// CHECK: define internal i32 [[TASK_ENTRY]](i32 %0, [[KMP_TASK_MAIN_TY]]* noalias %1)
// CHECK: [[PRIV_VAR_ADDR:%.+]] = alloca [[S_DOUBLE_TY]]*,
// CHECK: [[PRIV_T_VAR_ADDR:%.+]] = alloca i32*,
@@ -248,7 +246,7 @@
// CHECK: ret
-// CHECK: define internal i32 [[DESTRUCTORS]](i32, [[KMP_TASK_MAIN_TY]]* noalias)
+// CHECK: define internal i32 [[DESTRUCTORS]](i32 %0, [[KMP_TASK_MAIN_TY]]* noalias %1)
// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 0
// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
@@ -318,7 +316,7 @@
// CHECK: ret
//
-// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_TMAIN_TY]]* noalias, i32** noalias, [2 x i32]** noalias, [2 x [[S_INT_TY]]]** noalias, [[S_INT_TY]]** noalias)
+// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_TMAIN_TY]]* noalias %0, i32** noalias %1, [2 x i32]** noalias %2, [2 x [[S_INT_TY]]]** noalias %3, [[S_INT_TY]]** noalias %4)
// CHECK: [[PRIVATES:%.+]] = load [[PRIVATES_TMAIN_TY]]*, [[PRIVATES_TMAIN_TY]]**
// CHECK: [[PRIV_T_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 0
// CHECK: [[ARG1:%.+]] = load i32**, i32*** %{{.+}},
@@ -334,7 +332,7 @@
// CHECK: store [[S_INT_TY]]* [[PRIV_VAR]], [[S_INT_TY]]** [[ARG4]],
// CHECK: ret void
-// CHECK: define internal i32 [[TASK_ENTRY]](i32, [[KMP_TASK_TMAIN_TY]]* noalias)
+// CHECK: define internal i32 [[TASK_ENTRY]](i32 %0, [[KMP_TASK_TMAIN_TY]]* noalias %1)
// CHECK: alloca i32*,
// CHECK-DAG: [[PRIV_T_VAR_ADDR:%.+]] = alloca i32*,
@@ -357,7 +355,7 @@
// CHECK: ret
-// CHECK: define internal i32 [[DESTRUCTORS]](i32, [[KMP_TASK_TMAIN_TY]]* noalias)
+// CHECK: define internal i32 [[DESTRUCTORS]](i32 %0, [[KMP_TASK_TMAIN_TY]]* noalias %1)
// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
diff --git a/src/llvm-project/clang/test/OpenMP/taskgroup_task_reduction_codegen.cpp b/src/llvm-project/clang/test/OpenMP/taskgroup_task_reduction_codegen.cpp
index 686bb6f..05298de 100644
--- a/src/llvm-project/clang/test/OpenMP/taskgroup_task_reduction_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/taskgroup_task_reduction_codegen.cpp
@@ -149,54 +149,54 @@
// CHECK: call void @__kmpc_end_taskgroup(%struct.ident_t* {{[^,]+}}, i32 [[GTID]])
// CHECK: call void @__kmpc_end_taskgroup(%struct.ident_t* {{[^,]+}}, i32 [[GTID]])
-// CHECK-DAG: define internal void @[[AINIT]](i8*)
+// CHECK-DAG: define internal void @[[AINIT]](i8* %0)
// CHECK-DAG: store i32 0, i32* %
// CHECK-DAG: ret void
// CHECK-DAG: }
-// CHECK-DAG: define internal void @[[ACOMB]](i8*, i8*)
+// CHECK-DAG: define internal void @[[ACOMB]](i8* %0, i8* %1)
// CHECK-DAG: add nsw i32 %
// CHECK-DAG: store i32 %
// CHECK-DAG: ret void
// CHECK-DAG: }
-// CHECK-DAG: define internal void @[[BINIT]](i8*)
+// CHECK-DAG: define internal void @[[BINIT]](i8* %0)
// CHECK-DAG: store float 0.000000e+00, float* %
// CHECK-DAG: ret void
// CHECK-DAG: }
-// CHECK-DAG: define internal void @[[BCOMB]](i8*, i8*)
+// CHECK-DAG: define internal void @[[BCOMB]](i8* %0, i8* %1)
// CHECK-DAG: fadd float %
// CHECK-DAG: store float %
// CHECK-DAG: ret void
// CHECK-DAG: }
-// CHECK-DAG: define internal void @[[ARGCINIT]](i8*)
+// CHECK-DAG: define internal void @[[ARGCINIT]](i8* %0)
// CHECK-DAG: store i32 0, i32* %
// CHECK-DAG: ret void
// CHECK-DAG: }
-// CHECK-DAG: define internal void @[[ARGCCOMB]](i8*, i8*)
+// CHECK-DAG: define internal void @[[ARGCCOMB]](i8* %0, i8* %1)
// CHECK-DAG: add nsw i32 %
// CHECK-DAG: store i32 %
// CHECK-DAG: ret void
// CHECK-DAG: }
-// CHECK-DAG: define internal void @[[CINIT]](i8*)
+// CHECK-DAG: define internal void @[[CINIT]](i8* %0)
// CHECK-DAG: phi %struct.S* [
// CHECK-DAG: call {{.+}}(%struct.S* {{.+}})
// CHECK-DAG: br i1 %
// CHECK-DAG: ret void
// CHECK-DAG: }
-// CHECK-DAG: define internal void @[[CFINI]](i8*)
+// CHECK-DAG: define internal void @[[CFINI]](i8* %0)
// CHECK-DAG: phi %struct.S* [
// CHECK-DAG: call {{.+}}(%struct.S* {{.+}})
// CHECK-DAG: br i1 %
// CHECK-DAG: ret void
// CHECK-DAG: }
-// CHECK-DAG: define internal void @[[CCOMB]](i8*, i8*)
+// CHECK-DAG: define internal void @[[CCOMB]](i8* %0, i8* %1)
// CHECK-DAG: phi %struct.S* [
// CHECK-DAG: phi %struct.S* [
// CHECK-DAG: call {{.+}}(%struct.S* {{.+}}, %struct.S* {{.+}}, %struct.S* {{.+}})
@@ -206,7 +206,7 @@
// CHECK-DAG: ret void
// CHECK_DAG: }
-// CHECK-DAG: define internal void @[[VLAINIT]](i8*)
+// CHECK-DAG: define internal void @[[VLAINIT]](i8* %0)
// CHECK-DAG: call i32 @__kmpc_global_thread_num(%struct.ident_t* {{[^,]+}})
// CHECK-DAG: call i8* @__kmpc_threadprivate_cached(%struct.ident_t*
// CHECK-DAG: phi i16* [
@@ -215,7 +215,7 @@
// CHECK-DAG: ret void
// CHECK-DAG: }
-// CHECK-DAG: define internal void @[[VLACOMB]](i8*, i8*)
+// CHECK-DAG: define internal void @[[VLACOMB]](i8* %0, i8* %1)
// CHECK-DAG: call i32 @__kmpc_global_thread_num(%struct.ident_t* {{[^,]+}})
// CHECK-DAG: call i8* @__kmpc_threadprivate_cached(%struct.ident_t*
// CHECK-DAG: phi i16* [
diff --git a/src/llvm-project/clang/test/OpenMP/taskloop_firstprivate_codegen.cpp b/src/llvm-project/clang/test/OpenMP/taskloop_firstprivate_codegen.cpp
index 8f3b246..6472381 100644
--- a/src/llvm-project/clang/test/OpenMP/taskloop_firstprivate_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/taskloop_firstprivate_codegen.cpp
@@ -13,8 +13,7 @@
// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DARRAY -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
// expected-no-diagnostics
-// It doesn't pass on win32.
-// REQUIRES: shell
+
#ifndef ARRAY
#ifndef HEADER
#define HEADER
@@ -89,7 +88,7 @@
// LAMBDA: store double 2.0{{.+}}, double* [[G_REF]]
// LAMBDA: store double* %{{.+}}, double** %{{.+}},
- // LAMBDA: define internal i32 [[TASK_ENTRY]](i32, %{{.+}}* noalias)
+ // LAMBDA: define internal i32 [[TASK_ENTRY]](i32 %0, %{{.+}}* noalias %1)
g = 1;
sivar = 11;
// LAMBDA: store double 1.0{{.+}}, double* %{{.+}},
@@ -135,7 +134,7 @@
// BLOCKS: store double* %{{.+}}, double** %{{.+}},
// BLOCKS: store i{{[0-9]+}}* %{{.+}}, i{{[0-9]+}}** %{{.+}},
- // BLOCKS: define internal i32 [[TASK_ENTRY]](i32, %{{.+}}* noalias)
+ // BLOCKS: define internal i32 [[TASK_ENTRY]](i32 %0, %{{.+}}* noalias %1)
g = 1;
sivar = 11;
// BLOCKS: store double 1.0{{.+}}, double* %{{.+}},
@@ -266,7 +265,7 @@
// CHECK: ret
//
-// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_MAIN_TY]]* noalias, [[S_DOUBLE_TY]]** noalias, i32** noalias, [2 x [[S_DOUBLE_TY]]]** noalias, [2 x i32]** noalias, i32** noalias)
+// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_MAIN_TY]]* noalias %0, [[S_DOUBLE_TY]]** noalias %1, i32** noalias %2, [2 x [[S_DOUBLE_TY]]]** noalias %3, [2 x i32]** noalias %4, i32** noalias %5)
// CHECK: [[PRIVATES:%.+]] = load [[PRIVATES_MAIN_TY]]*, [[PRIVATES_MAIN_TY]]**
// CHECK: [[PRIV_S_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 0
// CHECK: [[ARG3:%.+]] = load [2 x [[S_DOUBLE_TY]]]**, [2 x [[S_DOUBLE_TY]]]*** %{{.+}},
@@ -285,7 +284,7 @@
// CHECK: store i{{[0-9]+}}* [[PRIV_SIVAR]], i{{[0-9]+}}** [[ARG5]],
// CHECK: ret void
-// CHECK: define internal i32 [[TASK_ENTRY]](i32, [[KMP_TASK_MAIN_TY]]* noalias)
+// CHECK: define internal i32 [[TASK_ENTRY]](i32 %0, [[KMP_TASK_MAIN_TY]]* noalias %1)
// CHECK: [[PRIV_VAR_ADDR:%.+]] = alloca [[S_DOUBLE_TY]]*,
// CHECK: [[PRIV_T_VAR_ADDR:%.+]] = alloca i32*,
@@ -312,7 +311,7 @@
// CHECK: ret
-// CHECK: define internal void [[MAIN_DUP]]([[KMP_TASK_MAIN_TY]]*, [[KMP_TASK_MAIN_TY]]*, i32)
+// CHECK: define internal void [[MAIN_DUP]]([[KMP_TASK_MAIN_TY]]* %0, [[KMP_TASK_MAIN_TY]]* %1, i32 %2)
// CHECK: getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* %{{.+}}, i32 0, i32 1
// CHECK: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* %{{.+}}, i32 0, i32 0
// CHECK: getelementptr inbounds [2 x [[S_DOUBLE_TY]]], [2 x [[S_DOUBLE_TY]]]* %{{.+}}, i32 0, i32 0
@@ -329,7 +328,7 @@
// CHECK: call {{.*}} [[S_DOUBLE_TY_COPY_CONSTR]]([[S_DOUBLE_TY]]*
// CHECK: ret void
-// CHECK: define internal i32 [[DESTRUCTORS]](i32, [[KMP_TASK_MAIN_TY]]* noalias)
+// CHECK: define internal i32 [[DESTRUCTORS]](i32 %0, [[KMP_TASK_MAIN_TY]]* noalias %1)
// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 0
// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
@@ -427,7 +426,7 @@
// CHECK: ret
//
-// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_TMAIN_TY]]* noalias, i32** noalias, [2 x i32]** noalias, [2 x [[S_INT_TY]]]** noalias, [[S_INT_TY]]** noalias)
+// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_TMAIN_TY]]* noalias %0, i32** noalias %1, [2 x i32]** noalias %2, [2 x [[S_INT_TY]]]** noalias %3, [[S_INT_TY]]** noalias %4)
// CHECK: [[PRIVATES:%.+]] = load [[PRIVATES_TMAIN_TY]]*, [[PRIVATES_TMAIN_TY]]**
// CHECK: [[PRIV_T_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 0
// CHECK: [[ARG1:%.+]] = load i32**, i32*** %{{.+}},
@@ -443,7 +442,7 @@
// CHECK: store [[S_INT_TY]]* [[PRIV_VAR]], [[S_INT_TY]]** [[ARG4]],
// CHECK: ret void
-// CHECK: define internal i32 [[TASK_ENTRY]](i32, [[KMP_TASK_TMAIN_TY]]* noalias)
+// CHECK: define internal i32 [[TASK_ENTRY]](i32 %0, [[KMP_TASK_TMAIN_TY]]* noalias %1)
// CHECK: alloca i32*,
// CHECK-DAG: [[PRIV_T_VAR_ADDR:%.+]] = alloca i32*,
// CHECK-DAG: [[PRIV_VEC_ADDR:%.+]] = alloca [2 x i32]*,
@@ -465,7 +464,7 @@
// CHECK: ret
-// CHECK: define internal void [[TMAIN_DUP]]([[KMP_TASK_TMAIN_TY]]*, [[KMP_TASK_TMAIN_TY]]*, i32)
+// CHECK: define internal void [[TMAIN_DUP]]([[KMP_TASK_TMAIN_TY]]* %0, [[KMP_TASK_TMAIN_TY]]* %1, i32 %2)
// CHECK: getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* %{{.+}}, i32 0, i32 2
// CHECK: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* %{{.+}}, i32 0, i32 2
// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* %{{.+}}, i32 0, i32 0
@@ -482,7 +481,7 @@
// CHECK: call {{.*}} [[S_INT_TY_COPY_CONSTR]]([[S_INT_TY]]*
// CHECK: ret void
-// CHECK: define internal i32 [[DESTRUCTORS]](i32, [[KMP_TASK_TMAIN_TY]]* noalias)
+// CHECK: define internal i32 [[DESTRUCTORS]](i32 %0, [[KMP_TASK_TMAIN_TY]]* noalias %1)
// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
diff --git a/src/llvm-project/clang/test/OpenMP/taskloop_firstprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/taskloop_firstprivate_messages.cpp
index b5311f5..8617a1f 100644
--- a/src/llvm-project/clang/test/OpenMP/taskloop_firstprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/taskloop_firstprivate_messages.cpp
@@ -19,6 +19,13 @@
return argc;
}
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp taskloop firstprivate(fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
struct S1; // expected-note 2 {{declared here}} expected-note 2 {{forward declaration of 'S1'}}
extern S1 a;
class S2 {
diff --git a/src/llvm-project/clang/test/OpenMP/taskloop_lastprivate_codegen.cpp b/src/llvm-project/clang/test/OpenMP/taskloop_lastprivate_codegen.cpp
index 000ca8f..1df56ac 100644
--- a/src/llvm-project/clang/test/OpenMP/taskloop_lastprivate_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/taskloop_lastprivate_codegen.cpp
@@ -15,8 +15,7 @@
// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DLOOP -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=SIMD-ONLY0 %s
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
// expected-no-diagnostics
-// It doesn't pass on win32.
-// REQUIRES: shell
+
#if !defined(ARRAY) && !defined(LOOP)
#ifndef HEADER
#define HEADER
@@ -82,7 +81,7 @@
// LAMBDA: store double 2.0{{.+}}, double* [[G_REF]]
// LAMBDA: store double* %{{.+}}, double** %{{.+}},
- // LAMBDA: define internal i32 [[TASK_ENTRY]](i32, %{{.+}}* noalias)
+ // LAMBDA: define internal i32 [[TASK_ENTRY]](i32 %0, %{{.+}}* noalias %1)
g = 1;
sivar = 11;
// LAMBDA: store double 1.0{{.+}}, double* %{{.+}},
@@ -125,7 +124,7 @@
// BLOCKS: store double* %{{.+}}, double** %{{.+}},
// BLOCKS: store i{{[0-9]+}}* %{{.+}}, i{{[0-9]+}}** %{{.+}},
- // BLOCKS: define internal i32 [[TASK_ENTRY]](i32, %{{.+}}* noalias)
+ // BLOCKS: define internal i32 [[TASK_ENTRY]](i32 %0, %{{.+}}* noalias %1)
g = 1;
sivar = 11;
// BLOCKS: store double 1.0{{.+}}, double* %{{.+}},
@@ -241,7 +240,7 @@
// CHECK: ret
//
-// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_MAIN_TY]]* noalias, [[S_DOUBLE_TY]]** noalias, i32** noalias, [2 x [[S_DOUBLE_TY]]]** noalias, [2 x i32]** noalias, i32** noalias)
+// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_MAIN_TY]]* noalias %0, [[S_DOUBLE_TY]]** noalias %1, i32** noalias %2, [2 x [[S_DOUBLE_TY]]]** noalias %3, [2 x i32]** noalias %4, i32** noalias %5)
// CHECK: [[PRIVATES:%.+]] = load [[PRIVATES_MAIN_TY]]*, [[PRIVATES_MAIN_TY]]**
// CHECK: [[PRIV_S_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 0
// CHECK: [[ARG3:%.+]] = load [2 x [[S_DOUBLE_TY]]]**, [2 x [[S_DOUBLE_TY]]]*** %{{.+}},
@@ -260,7 +259,7 @@
// CHECK: store i{{[0-9]+}}* [[PRIV_SIVAR]], i{{[0-9]+}}** [[ARG5]],
// CHECK: ret void
-// CHECK: define internal i32 [[TASK_ENTRY]](i32, [[KMP_TASK_MAIN_TY]]* noalias)
+// CHECK: define internal i32 [[TASK_ENTRY]](i32 %0, [[KMP_TASK_MAIN_TY]]* noalias %1)
// CHECK: [[PRIV_VAR_ADDR:%.+]] = alloca [[S_DOUBLE_TY]]*,
// CHECK: [[PRIV_T_VAR_ADDR:%.+]] = alloca i32*,
@@ -306,7 +305,7 @@
// CHECK: br label
// CHECK: ret
-// CHECK: define internal void [[MAIN_DUP]]([[KMP_TASK_MAIN_TY]]*, [[KMP_TASK_MAIN_TY]]*, i32)
+// CHECK: define internal void [[MAIN_DUP]]([[KMP_TASK_MAIN_TY]]* %0, [[KMP_TASK_MAIN_TY]]* %1, i32 %2)
// CHECK: getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* %{{.+}}, i32 0, i32 0
// CHECK: getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* %{{.+}}, i32 0, i32 8
// CHECK: load i32, i32* %
@@ -327,7 +326,7 @@
// CHECK: call {{.*}} [[S_DOUBLE_TY_CONSTR]]([[S_DOUBLE_TY]]*
// CHECK: ret void
-// CHECK: define internal i32 [[DESTRUCTORS]](i32, [[KMP_TASK_MAIN_TY]]* noalias)
+// CHECK: define internal i32 [[DESTRUCTORS]](i32 %0, [[KMP_TASK_MAIN_TY]]* noalias %1)
// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 0
// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
@@ -413,7 +412,7 @@
// CHECK: ret
//
-// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_TMAIN_TY]]* noalias, i32** noalias, [2 x i32]** noalias, [2 x [[S_INT_TY]]]** noalias, [[S_INT_TY]]** noalias)
+// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_TMAIN_TY]]* noalias %0, i32** noalias %1, [2 x i32]** noalias %2, [2 x [[S_INT_TY]]]** noalias %3, [[S_INT_TY]]** noalias %4)
// CHECK: [[PRIVATES:%.+]] = load [[PRIVATES_TMAIN_TY]]*, [[PRIVATES_TMAIN_TY]]**
// CHECK: [[PRIV_T_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 0
// CHECK: [[ARG1:%.+]] = load i32**, i32*** %{{.+}},
@@ -429,7 +428,7 @@
// CHECK: store [[S_INT_TY]]* [[PRIV_VAR]], [[S_INT_TY]]** [[ARG4]],
// CHECK: ret void
-// CHECK: define internal i32 [[TASK_ENTRY]](i32, [[KMP_TASK_TMAIN_TY]]* noalias)
+// CHECK: define internal i32 [[TASK_ENTRY]](i32 %0, [[KMP_TASK_TMAIN_TY]]* noalias %1)
// CHECK: alloca i32*,
// CHECK-DAG: [[PRIV_T_VAR_ADDR:%.+]] = alloca i32*,
// CHECK-DAG: [[PRIV_VEC_ADDR:%.+]] = alloca [2 x i32]*,
@@ -468,7 +467,7 @@
// CHECK: br label
// CHECK: ret
-// CHECK: define internal void [[TMAIN_DUP]]([[KMP_TASK_TMAIN_TY]]*, [[KMP_TASK_TMAIN_TY]]*, i32)
+// CHECK: define internal void [[TMAIN_DUP]]([[KMP_TASK_TMAIN_TY]]* %0, [[KMP_TASK_TMAIN_TY]]* %1, i32 %2)
// CHECK: getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* %{{.+}}, i32 0, i32 0
// CHECK: getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* %{{.+}}, i32 0, i32 8
// CHECK: load i32, i32* %
@@ -489,7 +488,7 @@
// CHECK: call {{.*}} [[S_INT_TY_CONSTR]]([[S_INT_TY]]*
// CHECK: ret void
-// CHECK: define internal i32 [[DESTRUCTORS]](i32, [[KMP_TASK_TMAIN_TY]]* noalias)
+// CHECK: define internal i32 [[DESTRUCTORS]](i32 %0, [[KMP_TASK_TMAIN_TY]]* noalias %1)
// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
diff --git a/src/llvm-project/clang/test/OpenMP/taskloop_lastprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/taskloop_lastprivate_messages.cpp
index 3d3acee..6fae38a 100644
--- a/src/llvm-project/clang/test/OpenMP/taskloop_lastprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/taskloop_lastprivate_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
@@ -109,6 +111,10 @@
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel
+#pragma omp taskloop lastprivate(conditional: argc) lastprivate(conditional: // expected-error 2 {{use of undeclared identifier 'conditional'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
#pragma omp taskloop lastprivate(S1) // expected-error {{'S1' does not refer to a value}}
for (int k = 0; k < argc; ++k)
++k;
diff --git a/src/llvm-project/clang/test/OpenMP/taskloop_loop_messages.cpp b/src/llvm-project/clang/test/OpenMP/taskloop_loop_messages.cpp
index d38e8d7..1783a52 100644
--- a/src/llvm-project/clang/test/OpenMP/taskloop_loop_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/taskloop_loop_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wuninitialized
class S {
int a;
@@ -113,32 +115,33 @@
c[ii] = a[ii];
#pragma omp parallel
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
#pragma omp taskloop
for (int i = 0; i; i++)
c[i] = a[i];
#pragma omp parallel
-// expected-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'i'}}
#pragma omp taskloop
for (int i = 0; jj < kk; ii++)
c[i] = a[i];
#pragma omp parallel
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
#pragma omp taskloop
for (int i = 0; !!i; i++)
c[i] = a[i];
// Ok
#pragma omp parallel
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
#pragma omp taskloop
for (int i = 0; i != 1; i++)
c[i] = a[i];
#pragma omp parallel
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
#pragma omp taskloop
for (int i = 0;; i++)
c[i] = a[i];
@@ -347,7 +350,7 @@
}
#pragma omp parallel
-// expected-error@+2 {{statement after '#pragma omp taskloop' must be a for loop}}
+// omp4-error@+2 {{statement after '#pragma omp taskloop' must be a for loop}}
#pragma omp taskloop
for (auto &item : a) {
item = item + 1;
@@ -499,17 +502,17 @@
for (begin = end; begin < end; ++begin)
++begin;
#pragma omp parallel
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
#pragma omp taskloop
for (GoodIter I = begin; I - I; ++I)
++I;
#pragma omp parallel
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
#pragma omp taskloop
for (GoodIter I = begin; begin < end; ++I)
++I;
#pragma omp parallel
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
#pragma omp taskloop
for (GoodIter I = begin; !I; ++I)
++I;
diff --git a/src/llvm-project/clang/test/OpenMP/taskloop_private_codegen.cpp b/src/llvm-project/clang/test/OpenMP/taskloop_private_codegen.cpp
index 8e2c13c..01c387e 100644
--- a/src/llvm-project/clang/test/OpenMP/taskloop_private_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/taskloop_private_codegen.cpp
@@ -13,8 +13,6 @@
// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DARRAY -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
// expected-no-diagnostics
-// It doesn't pass on win32. Investigating.
-// REQUIRES: shell
#ifndef ARRAY
#ifndef HEADER
@@ -79,7 +77,7 @@
// LAMBDA: [[SIVAR_REF:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** [[SIVAR_PTR_REF]]
// LAMBDA: store i{{[0-9]+}} 3, i{{[0-9]+}}* [[SIVAR_REF]]
- // LAMBDA: define internal i32 [[TASK_ENTRY]](i32, %{{.+}}* noalias)
+ // LAMBDA: define internal i32 [[TASK_ENTRY]](i32 %0, %{{.+}}* noalias %1)
g = 1;
sivar = 2;
// LAMBDA: store double 1.0{{.+}}, double* %{{.+}},
@@ -114,7 +112,7 @@
// BLOCKS-NOT: [[SIVAR]]{{[[^:word:]]}}
// BLOCKS: ret
- // BLOCKS: define internal i32 [[TASK_ENTRY]](i32, %{{.+}}* noalias)
+ // BLOCKS: define internal i32 [[TASK_ENTRY]](i32 %0, %{{.+}}* noalias %1)
g = 1;
sivar = 3;
// BLOCKS: store double 1.0{{.+}}, double* %{{.+}},
@@ -207,7 +205,7 @@
// CHECK: ret
//
-// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_MAIN_TY]]* noalias, [[S_DOUBLE_TY]]** noalias, i32** noalias, [2 x [[S_DOUBLE_TY]]]** noalias, [2 x i32]** noalias, i32** noalias)
+// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_MAIN_TY]]* noalias %0, [[S_DOUBLE_TY]]** noalias %1, i32** noalias %2, [2 x [[S_DOUBLE_TY]]]** noalias %3, [2 x i32]** noalias %4, i32** noalias %5)
// CHECK: [[PRIVATES:%.+]] = load [[PRIVATES_MAIN_TY]]*, [[PRIVATES_MAIN_TY]]**
// CHECK: [[PRIV_S_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 0
// CHECK: [[ARG3:%.+]] = load [2 x [[S_DOUBLE_TY]]]**, [2 x [[S_DOUBLE_TY]]]*** %{{.+}},
@@ -223,7 +221,7 @@
// CHECK: store [2 x i32]* [[PRIV_VEC]], [2 x i32]** [[ARG4]],
// CHECK: ret void
-// CHECK: define internal i32 [[TASK_ENTRY]](i32, [[KMP_TASK_MAIN_TY]]* noalias)
+// CHECK: define internal i32 [[TASK_ENTRY]](i32 %0, [[KMP_TASK_MAIN_TY]]* noalias %1)
// CHECK: [[PRIV_VAR_ADDR:%.+]] = alloca [[S_DOUBLE_TY]]*,
// CHECK: [[PRIV_T_VAR_ADDR:%.+]] = alloca i32*,
@@ -248,7 +246,7 @@
// CHECK: ret
-// CHECK: define internal void [[MAIN_DUP]]([[KMP_TASK_MAIN_TY]]*, [[KMP_TASK_MAIN_TY]]*, i32)
+// CHECK: define internal void [[MAIN_DUP]]([[KMP_TASK_MAIN_TY]]* %0, [[KMP_TASK_MAIN_TY]]* %1, i32 %2)
// CHECK: getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* %{{.+}}, i32 0, i32 1
// CHECK: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* %{{.+}}, i32 0, i32 0
// CHECK: getelementptr inbounds [2 x [[S_DOUBLE_TY]]], [2 x [[S_DOUBLE_TY]]]* %{{.+}}, i32 0, i32 0
@@ -265,7 +263,7 @@
// CHECK: call {{.*}} [[S_DOUBLE_TY_DEF_CONSTR]]([[S_DOUBLE_TY]]*
// CHECK: ret void
-// CHECK: define internal i32 [[DESTRUCTORS]](i32, [[KMP_TASK_MAIN_TY]]* noalias)
+// CHECK: define internal i32 [[DESTRUCTORS]](i32 %0, [[KMP_TASK_MAIN_TY]]* noalias %1)
// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 0
// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
@@ -335,7 +333,7 @@
// CHECK: ret
//
-// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_TMAIN_TY]]* noalias, i32** noalias, [2 x i32]** noalias, [2 x [[S_INT_TY]]]** noalias, [[S_INT_TY]]** noalias)
+// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_TMAIN_TY]]* noalias %0, i32** noalias %1, [2 x i32]** noalias %2, [2 x [[S_INT_TY]]]** noalias %3, [[S_INT_TY]]** noalias %4)
// CHECK: [[PRIVATES:%.+]] = load [[PRIVATES_TMAIN_TY]]*, [[PRIVATES_TMAIN_TY]]**
// CHECK: [[PRIV_T_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 0
// CHECK: [[ARG1:%.+]] = load i32**, i32*** %{{.+}},
@@ -351,7 +349,7 @@
// CHECK: store [[S_INT_TY]]* [[PRIV_VAR]], [[S_INT_TY]]** [[ARG4]],
// CHECK: ret void
-// CHECK: define internal i32 [[TASK_ENTRY]](i32, [[KMP_TASK_TMAIN_TY]]* noalias)
+// CHECK: define internal i32 [[TASK_ENTRY]](i32 %0, [[KMP_TASK_TMAIN_TY]]* noalias %1)
// CHECK: alloca i32*,
// CHECK-DAG: [[PRIV_T_VAR_ADDR:%.+]] = alloca i32*,
@@ -374,7 +372,7 @@
// CHECK: ret
-// CHECK: define internal void [[TMAIN_DUP]]([[KMP_TASK_TMAIN_TY]]*, [[KMP_TASK_TMAIN_TY]]*, i32)
+// CHECK: define internal void [[TMAIN_DUP]]([[KMP_TASK_TMAIN_TY]]* %0, [[KMP_TASK_TMAIN_TY]]* %1, i32 %2)
// CHECK: getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* %{{.+}}, i32 0, i32 2
// CHECK: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* %{{.+}}, i32 0, i32 2
// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* %{{.+}}, i32 0, i32 0
@@ -391,7 +389,7 @@
// CHECK: call {{.*}} [[S_INT_TY_DEF_CONSTR]]([[S_INT_TY]]*
// CHECK: ret void
-// CHECK: define internal i32 [[DESTRUCTORS]](i32, [[KMP_TASK_TMAIN_TY]]* noalias)
+// CHECK: define internal i32 [[DESTRUCTORS]](i32 %0, [[KMP_TASK_TMAIN_TY]]* noalias %1)
// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
diff --git a/src/llvm-project/clang/test/OpenMP/taskloop_reduction_codegen.cpp b/src/llvm-project/clang/test/OpenMP/taskloop_reduction_codegen.cpp
index 3c6227b..fec3e62 100644
--- a/src/llvm-project/clang/test/OpenMP/taskloop_reduction_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/taskloop_reduction_codegen.cpp
@@ -4,6 +4,10 @@
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
// expected-no-diagnostics
+// CHECK: [[RED_SIZE1:@reduction_size[.].+]] = common thread_local global i64 0
+// CHECK: [[RED1:@reduction[.].+]] = common thread_local global i8* null
+// CHECK: [[RED_SIZE2:@reduction_size[.].+]] = common thread_local global i64 0
+
struct S {
float a;
S() : a(0.0f) {}
@@ -153,69 +157,60 @@
// CHECK: ret i32
-// CHECK: define internal void @[[RED_INIT1]](i8*)
+// CHECK: define internal void @[[RED_INIT1]](i8* %0)
// CHECK: store float 0.000000e+00, float* %
// CHECK: ret void
-// CHECK: define internal void @[[RED_COMB1]](i8*, i8*)
+// CHECK: define internal void @[[RED_COMB1]](i8* %0, i8* %1)
// CHECK: fadd float %
// CHECK: store float %{{.+}}, float* %
// CHECK: ret void
-// CHECK: define internal void @[[RED_INIT2]](i8*)
-// CHECK: call i8* @__kmpc_threadprivate_cached(
-// CHECK: [[ORIG_PTR_ADDR:%.+]] = call i8* @__kmpc_threadprivate_cached(
-// CHECK: [[ORIG_PTR_REF:%.+]] = bitcast i8* [[ORIG_PTR_ADDR]] to i8**
-// CHECK: load i8*, i8** [[ORIG_PTR_REF]],
+// CHECK: define internal void @[[RED_INIT2]](i8* %0)
+// CHECK: load i8*, i8** [[RED1]],
// CHECK: call void [[OMP_INIT1:@.+]](
// CHECK: ret void
-// CHECK: define internal void [[OMP_COMB1:@.+]](%struct.S* noalias, %struct.S* noalias)
+// CHECK: define internal void [[OMP_COMB1:@.+]](%struct.S* noalias %0, %struct.S* noalias %1)
// CHECK: fadd float %
-// CHECK: define internal void [[OMP_INIT1]](%struct.S* noalias, %struct.S* noalias)
+// CHECK: define internal void [[OMP_INIT1]](%struct.S* noalias %0, %struct.S* noalias %1)
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(
-// CHECK: define internal void @[[RED_FINI2]](i8*)
-// CHECK: call i8* @__kmpc_threadprivate_cached(
+// CHECK: define internal void @[[RED_FINI2]](i8* %0)
+// CHECK: load i64, i64* [[RED_SIZE1]]
// CHECK: call void @
// CHECK: ret void
-// CHECK: define internal void @[[RED_COMB2]](i8*, i8*)
-// CHECK: call i8* @__kmpc_threadprivate_cached(
+// CHECK: define internal void @[[RED_COMB2]](i8* %0, i8* %1)
+// CHECK: load i64, i64* [[RED_SIZE1]]
// CHECK: call void [[OMP_COMB1]](
// CHECK: ret void
-// CHECK: define internal void @[[RED_INIT3]](i8*)
+// CHECK: define internal void @[[RED_INIT3]](i8* %0)
// CHECK: store float 0.000000e+00, float* %
// CHECK: ret void
-// CHECK: define internal void @[[RED_COMB3]](i8*, i8*)
+// CHECK: define internal void @[[RED_COMB3]](i8* %0, i8* %1)
// CHECK: fadd float %
// CHECK: store float %{{.+}}, float* %
// CHECK: ret void
-// CHECK: define internal void @[[RED_INIT4]](i8*)
-// CHECK: call i8* @__kmpc_threadprivate_cached(
+// CHECK: define internal void @[[RED_INIT4]](i8* %0)
+// CHECK: load i64, i64* [[RED_SIZE2]]
// CHECK: store float 0.000000e+00, float* %
// CHECK: ret void
-// CHECK: define internal void @[[RED_COMB4]](i8*, i8*)
-// CHECK: call i8* @__kmpc_threadprivate_cached(
+// CHECK: define internal void @[[RED_COMB4]](i8* %0, i8* %1)
+// CHECK: load i64, i64* [[RED_SIZE2]]
// CHECK: fadd float %
// CHECK: store float %{{.+}}, float* %
// CHECK: ret void
-// CHECK-NOT: call i8* @__kmpc_threadprivate_cached(
// CHECK: call i8* @__kmpc_task_reduction_get_th_data(
-// CHECK: call i8* @__kmpc_threadprivate_cached(
-// CHECK: call i8* @__kmpc_threadprivate_cached(
// CHECK: call i8* @__kmpc_task_reduction_get_th_data(
-// CHECK-NOT: call i8* @__kmpc_threadprivate_cached(
// CHECK: call i8* @__kmpc_task_reduction_get_th_data(
-// CHECK: call i8* @__kmpc_threadprivate_cached(
// CHECK: call i8* @__kmpc_task_reduction_get_th_data(
-// CHECK-NOT: call i8* @__kmpc_threadprivate_cached(
// CHECK-DAG: distinct !DISubprogram(linkageName: "[[TASK]]", scope: !
// CHECK-DAG: !DISubprogram(linkageName: "[[RED_INIT1]]"
diff --git a/src/llvm-project/clang/test/OpenMP/taskloop_reduction_messages.cpp b/src/llvm-project/clang/test/OpenMP/taskloop_reduction_messages.cpp
index b7a0f2e..da044ab 100644
--- a/src/llvm-project/clang/test/OpenMP/taskloop_reduction_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/taskloop_reduction_messages.cpp
@@ -16,6 +16,13 @@
extern const omp_allocator_handle_t omp_pteam_mem_alloc;
extern const omp_allocator_handle_t omp_thread_mem_alloc;
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp taskloop reduction(+:fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
void foo() {
}
diff --git a/src/llvm-project/clang/test/OpenMP/taskloop_simd_ast_print.cpp b/src/llvm-project/clang/test/OpenMP/taskloop_simd_ast_print.cpp
index d5403ed..dcabe2f 100644
--- a/src/llvm-project/clang/test/OpenMP/taskloop_simd_ast_print.cpp
+++ b/src/llvm-project/clang/test/OpenMP/taskloop_simd_ast_print.cpp
@@ -1,10 +1,16 @@
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ast-print %s | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ast-print %s | FileCheck %s --check-prefix CHECK --check-prefix OMP45
// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s --check-prefix CHECK --check-prefix OMP45
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -ast-print %s -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix OMP50
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -emit-pch -o %t %s -DOMP5
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix OMP50
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ast-print %s | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ast-print %s | FileCheck %s --check-prefix CHECK --check-prefix OMP45
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s --check-prefix CHECK --check-prefix OMP45
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -ast-print %s -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix OMP50
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -emit-pch -o %t %s -DOMP5
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -DOMP5 | FileCheck %s --check-prefix CHECK --check-prefix OMP50
// expected-no-diagnostics
#ifndef HEADER
@@ -57,7 +63,7 @@
// CHECK-LABEL: int main(int argc, char **argv) {
int main(int argc, char **argv) {
- int b = argc, c, d, e, f, g;
+ int b = argc, c, d, e, f, g, h;
static int a;
// CHECK: static int a;
#pragma omp taskgroup task_reduction(+: d)
@@ -69,12 +75,17 @@
// CHECK-NEXT: for (int i = 0; i < 2; ++i)
// CHECK-NEXT: a = 2;
#pragma omp parallel
+#ifdef OMP5
+#pragma omp taskloop simd private(argc, b), firstprivate(argv, c), lastprivate(d, f) collapse(2) shared(g) if(simd: argc) mergeable priority(argc) simdlen(16) grainsize(argc) reduction(max: a, e) nontemporal(argc, c, d)
+#else
#pragma omp taskloop simd private(argc, b), firstprivate(argv, c), lastprivate(d, f) collapse(2) shared(g) if(argc) mergeable priority(argc) simdlen(16) grainsize(argc) reduction(max: a, e)
+#endif // OMP5
for (int i = 0; i < 10; ++i)
for (int j = 0; j < 10; ++j)
foo();
// CHECK-NEXT: #pragma omp parallel
- // CHECK-NEXT: #pragma omp taskloop simd private(argc,b) firstprivate(argv,c) lastprivate(d,f) collapse(2) shared(g) if(argc) mergeable priority(argc) simdlen(16) grainsize(argc) reduction(max: a,e)
+ // OMP50-NEXT: #pragma omp taskloop simd private(argc,b) firstprivate(argv,c) lastprivate(d,f) collapse(2) shared(g) if(simd: argc) mergeable priority(argc) simdlen(16) grainsize(argc) reduction(max: a,e) nontemporal(argc,c,d)
+ // OMP45-NEXT: #pragma omp taskloop simd private(argc,b) firstprivate(argv,c) lastprivate(d,f) collapse(2) shared(g) if(argc) mergeable priority(argc) simdlen(16) grainsize(argc) reduction(max: a,e)
// CHECK-NEXT: for (int i = 0; i < 10; ++i)
// CHECK-NEXT: for (int j = 0; j < 10; ++j)
// CHECK-NEXT: foo();
diff --git a/src/llvm-project/clang/test/OpenMP/taskloop_simd_codegen.cpp b/src/llvm-project/clang/test/OpenMP/taskloop_simd_codegen.cpp
index 4c84ecc..6b8f354 100644
--- a/src/llvm-project/clang/test/OpenMP/taskloop_simd_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/taskloop_simd_codegen.cpp
@@ -1,10 +1,16 @@
-// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp -x c++ -emit-llvm %s -o - -femit-all-decls | FileCheck %s
-// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-apple-darwin10 -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-apple-darwin10 -include-pch %t -verify %s -emit-llvm -o - -femit-all-decls | FileCheck %s
+// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp -fopenmp-version=45 -x c++ -emit-llvm %s -o - -femit-all-decls | FileCheck %s --check-prefix CHECK --check-prefix OMP45
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -triple x86_64-apple-darwin10 -include-pch %t -verify %s -emit-llvm -o - -femit-all-decls | FileCheck %s --check-prefix CHECK --check-prefix OMP45
+// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp -fopenmp-version=50 -x c++ -emit-llvm %s -o - | FileCheck %s --check-prefix CHECK --check-prefix OMP50
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -triple x86_64-apple-darwin10 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CHECK --check-prefix OMP50
-// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp-simd -x c++ -emit-llvm %s -o - -femit-all-decls | FileCheck --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-apple-darwin10 -include-pch %t -verify %s -emit-llvm -o - -femit-all-decls | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp-simd -fopenmp-version=45 -x c++ -emit-llvm %s -o - -femit-all-decls | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -triple x86_64-apple-darwin10 -include-pch %t -verify %s -emit-llvm -o - -femit-all-decls | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp-simd -fopenmp-version=50 -x c++ -emit-llvm %s -o - -femit-all-decls | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -x c++ -triple x86_64-apple-darwin10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -x c++ -triple x86_64-apple-darwin10 -include-pch %t -verify %s -emit-llvm -o - -femit-all-decls | FileCheck --check-prefix SIMD-ONLY0 %s
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
// expected-no-diagnostics
#ifndef HEADER
@@ -45,10 +51,13 @@
for (int i = 0; i < 10; ++i)
;
// CHECK: call void @__kmpc_taskgroup(%struct.ident_t* [[DEFLOC]], i32 [[GTID]])
-// CHECK: [[TASKV:%.+]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* [[DEFLOC]], i32 [[GTID]], i32 1, i64 80, i64 24, i32 (i32, i8*)* bitcast (i32 (i32, [[TDP_TY:%.+]]*)* [[TASK3:@.+]] to i32 (i32, i8*)*))
+// OMP45: [[TASKV:%.+]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* [[DEFLOC]], i32 [[GTID]], i32 1, i64 80, i64 24, i32 (i32, i8*)* bitcast (i32 (i32, [[TDP_TY:%.+]]*)* [[TASK3:@.+]] to i32 (i32, i8*)*))
+// OMP50: [[TASKV:%.+]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* [[DEFLOC]], i32 [[GTID]], i32 1, i64 80, i64 32, i32 (i32, i8*)* bitcast (i32 (i32, [[TDP_TY:%.+]]*)* [[TASK3:@.+]] to i32 (i32, i8*)*))
// CHECK: [[TASK:%.+]] = bitcast i8* [[TASKV]] to [[TDP_TY]]*
// CHECK: [[TASK_DATA:%.+]] = getelementptr inbounds [[TDP_TY]], [[TDP_TY]]* [[TASK]], i32 0, i32 0
-// CHECK: [[IF:%.+]] = icmp ne i32 %{{.+}}, 0
+// OMP45: [[IF:%.+]] = icmp ne i32 %{{.+}}, 0
+// OMP50: [[IF_VAL:%.+]] = load i8, i8* %
+// OMP50: [[IF:%.+]] = trunc i8 [[IF_VAL]] to i1
// CHECK: [[IF_INT:%.+]] = sext i1 [[IF]] to i32
// CHECK: [[DOWN:%.+]] = getelementptr inbounds [[TD_TY:%.+]], [[TD_TY]]* [[TASK_DATA]], i32 0, i32 5
// CHECK: store i64 0, i64* [[DOWN]],
diff --git a/src/llvm-project/clang/test/OpenMP/taskloop_simd_firstprivate_codegen.cpp b/src/llvm-project/clang/test/OpenMP/taskloop_simd_firstprivate_codegen.cpp
index b7e8ba9..935aacc 100644
--- a/src/llvm-project/clang/test/OpenMP/taskloop_simd_firstprivate_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/taskloop_simd_firstprivate_codegen.cpp
@@ -13,8 +13,7 @@
// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DARRAY -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
// expected-no-diagnostics
-// It doesn't pass on win32.
-// REQUIRES: shell
+
#ifndef ARRAY
#ifndef HEADER
#define HEADER
@@ -89,7 +88,7 @@
// LAMBDA: store double 2.0{{.+}}, double* [[G_REF]]
// LAMBDA: store double* %{{.+}}, double** %{{.+}},
- // LAMBDA: define internal i32 [[TASK_ENTRY]](i32, %{{.+}}* noalias)
+ // LAMBDA: define internal i32 [[TASK_ENTRY]](i32 %0, %{{.+}}* noalias %1)
g = 1;
sivar = 11;
// LAMBDA: store double 1.0{{.+}}, double* %{{.+}},
@@ -135,7 +134,7 @@
// BLOCKS: store double* %{{.+}}, double** %{{.+}},
// BLOCKS: store i{{[0-9]+}}* %{{.+}}, i{{[0-9]+}}** %{{.+}},
- // BLOCKS: define internal i32 [[TASK_ENTRY]](i32, %{{.+}}* noalias)
+ // BLOCKS: define internal i32 [[TASK_ENTRY]](i32 %0, %{{.+}}* noalias %1)
g = 1;
sivar = 11;
// BLOCKS: store double 1.0{{.+}}, double* %{{.+}},
@@ -266,7 +265,7 @@
// CHECK: ret
//
-// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_MAIN_TY]]* noalias, [[S_DOUBLE_TY]]** noalias, i32** noalias, [2 x [[S_DOUBLE_TY]]]** noalias, [2 x i32]** noalias, i32** noalias)
+// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_MAIN_TY]]* noalias %0, [[S_DOUBLE_TY]]** noalias %1, i32** noalias %2, [2 x [[S_DOUBLE_TY]]]** noalias %3, [2 x i32]** noalias %4, i32** noalias %5)
// CHECK: [[PRIVATES:%.+]] = load [[PRIVATES_MAIN_TY]]*, [[PRIVATES_MAIN_TY]]**
// CHECK: [[PRIV_S_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 0
// CHECK: [[ARG3:%.+]] = load [2 x [[S_DOUBLE_TY]]]**, [2 x [[S_DOUBLE_TY]]]*** %{{.+}},
@@ -285,7 +284,7 @@
// CHECK: store i{{[0-9]+}}* [[PRIV_SIVAR]], i{{[0-9]+}}** [[ARG5]],
// CHECK: ret void
-// CHECK: define internal i32 [[TASK_ENTRY]](i32, [[KMP_TASK_MAIN_TY]]* noalias)
+// CHECK: define internal i32 [[TASK_ENTRY]](i32 %0, [[KMP_TASK_MAIN_TY]]* noalias %1)
// CHECK: [[PRIV_VAR_ADDR:%.+]] = alloca [[S_DOUBLE_TY]]*,
// CHECK: [[PRIV_T_VAR_ADDR:%.+]] = alloca i32*,
@@ -312,7 +311,7 @@
// CHECK: ret
-// CHECK: define internal void [[MAIN_DUP]]([[KMP_TASK_MAIN_TY]]*, [[KMP_TASK_MAIN_TY]]*, i32)
+// CHECK: define internal void [[MAIN_DUP]]([[KMP_TASK_MAIN_TY]]* %0, [[KMP_TASK_MAIN_TY]]* %1, i32 %2)
// CHECK: getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* %{{.+}}, i32 0, i32 1
// CHECK: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* %{{.+}}, i32 0, i32 0
// CHECK: getelementptr inbounds [2 x [[S_DOUBLE_TY]]], [2 x [[S_DOUBLE_TY]]]* %{{.+}}, i32 0, i32 0
@@ -329,7 +328,7 @@
// CHECK: call {{.*}} [[S_DOUBLE_TY_COPY_CONSTR]]([[S_DOUBLE_TY]]*
// CHECK: ret void
-// CHECK: define internal i32 [[DESTRUCTORS]](i32, [[KMP_TASK_MAIN_TY]]* noalias)
+// CHECK: define internal i32 [[DESTRUCTORS]](i32 %0, [[KMP_TASK_MAIN_TY]]* noalias %1)
// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 0
// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
@@ -427,7 +426,7 @@
// CHECK: ret
//
-// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_TMAIN_TY]]* noalias, i32** noalias, [2 x i32]** noalias, [2 x [[S_INT_TY]]]** noalias, [[S_INT_TY]]** noalias)
+// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_TMAIN_TY]]* noalias %0, i32** noalias %1, [2 x i32]** noalias %2, [2 x [[S_INT_TY]]]** noalias %3, [[S_INT_TY]]** noalias %4)
// CHECK: [[PRIVATES:%.+]] = load [[PRIVATES_TMAIN_TY]]*, [[PRIVATES_TMAIN_TY]]**
// CHECK: [[PRIV_T_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 0
// CHECK: [[ARG1:%.+]] = load i32**, i32*** %{{.+}},
@@ -443,7 +442,7 @@
// CHECK: store [[S_INT_TY]]* [[PRIV_VAR]], [[S_INT_TY]]** [[ARG4]],
// CHECK: ret void
-// CHECK: define internal i32 [[TASK_ENTRY]](i32, [[KMP_TASK_TMAIN_TY]]* noalias)
+// CHECK: define internal i32 [[TASK_ENTRY]](i32 %0, [[KMP_TASK_TMAIN_TY]]* noalias %1)
// CHECK: alloca i32*,
// CHECK-DAG: [[PRIV_T_VAR_ADDR:%.+]] = alloca i32*,
// CHECK-DAG: [[PRIV_VEC_ADDR:%.+]] = alloca [2 x i32]*,
@@ -465,7 +464,7 @@
// CHECK: ret
-// CHECK: define internal void [[TMAIN_DUP]]([[KMP_TASK_TMAIN_TY]]*, [[KMP_TASK_TMAIN_TY]]*, i32)
+// CHECK: define internal void [[TMAIN_DUP]]([[KMP_TASK_TMAIN_TY]]* %0, [[KMP_TASK_TMAIN_TY]]* %1, i32 %2)
// CHECK: getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* %{{.+}}, i32 0, i32 2
// CHECK: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* %{{.+}}, i32 0, i32 2
// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* %{{.+}}, i32 0, i32 0
@@ -482,7 +481,7 @@
// CHECK: call {{.*}} [[S_INT_TY_COPY_CONSTR]]([[S_INT_TY]]*
// CHECK: ret void
-// CHECK: define internal i32 [[DESTRUCTORS]](i32, [[KMP_TASK_TMAIN_TY]]* noalias)
+// CHECK: define internal i32 [[DESTRUCTORS]](i32 %0, [[KMP_TASK_TMAIN_TY]]* noalias %1)
// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
diff --git a/src/llvm-project/clang/test/OpenMP/taskloop_simd_firstprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/taskloop_simd_firstprivate_messages.cpp
index fdedda9..2531a18 100644
--- a/src/llvm-project/clang/test/OpenMP/taskloop_simd_firstprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/taskloop_simd_firstprivate_messages.cpp
@@ -19,6 +19,13 @@
return argc;
}
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp taskloop simd firstprivate(fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
struct S1; // expected-note 2 {{declared here}} expected-note 2 {{forward declaration of 'S1'}}
extern S1 a;
class S2 {
diff --git a/src/llvm-project/clang/test/OpenMP/taskloop_simd_lastprivate_codegen.cpp b/src/llvm-project/clang/test/OpenMP/taskloop_simd_lastprivate_codegen.cpp
index 750bf97..97007dd 100644
--- a/src/llvm-project/clang/test/OpenMP/taskloop_simd_lastprivate_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/taskloop_simd_lastprivate_codegen.cpp
@@ -13,8 +13,7 @@
// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DARRAY -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
// expected-no-diagnostics
-// It doesn't pass on win32.
-// REQUIRES: shell
+
#ifndef ARRAY
#ifndef HEADER
#define HEADER
@@ -80,7 +79,7 @@
// LAMBDA: store double 2.0{{.+}}, double* [[G_REF]]
// LAMBDA: store double* %{{.+}}, double** %{{.+}},
- // LAMBDA: define internal i32 [[TASK_ENTRY]](i32, %{{.+}}* noalias)
+ // LAMBDA: define internal i32 [[TASK_ENTRY]](i32 %0, %{{.+}}* noalias %1)
g = 1;
sivar = 11;
// LAMBDA: store double 1.0{{.+}}, double* %{{.+}},
@@ -123,7 +122,7 @@
// BLOCKS: store double* %{{.+}}, double** %{{.+}},
// BLOCKS: store i{{[0-9]+}}* %{{.+}}, i{{[0-9]+}}** %{{.+}},
- // BLOCKS: define internal i32 [[TASK_ENTRY]](i32, %{{.+}}* noalias)
+ // BLOCKS: define internal i32 [[TASK_ENTRY]](i32 %0, %{{.+}}* noalias %1)
g = 1;
sivar = 11;
// BLOCKS: store double 1.0{{.+}}, double* %{{.+}},
@@ -239,7 +238,7 @@
// CHECK: ret
//
-// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_MAIN_TY]]* noalias, [[S_DOUBLE_TY]]** noalias, i32** noalias, [2 x [[S_DOUBLE_TY]]]** noalias, [2 x i32]** noalias, i32** noalias)
+// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_MAIN_TY]]* noalias %0, [[S_DOUBLE_TY]]** noalias %1, i32** noalias %2, [2 x [[S_DOUBLE_TY]]]** noalias %3, [2 x i32]** noalias %4, i32** noalias %5)
// CHECK: [[PRIVATES:%.+]] = load [[PRIVATES_MAIN_TY]]*, [[PRIVATES_MAIN_TY]]**
// CHECK: [[PRIV_S_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 0
// CHECK: [[ARG3:%.+]] = load [2 x [[S_DOUBLE_TY]]]**, [2 x [[S_DOUBLE_TY]]]*** %{{.+}},
@@ -258,7 +257,7 @@
// CHECK: store i{{[0-9]+}}* [[PRIV_SIVAR]], i{{[0-9]+}}** [[ARG5]],
// CHECK: ret void
-// CHECK: define internal i32 [[TASK_ENTRY]](i32, [[KMP_TASK_MAIN_TY]]* noalias)
+// CHECK: define internal i32 [[TASK_ENTRY]](i32 %0, [[KMP_TASK_MAIN_TY]]* noalias %1)
// CHECK: [[PRIV_VAR_ADDR:%.+]] = alloca [[S_DOUBLE_TY]]*,
// CHECK: [[PRIV_T_VAR_ADDR:%.+]] = alloca i32*,
@@ -304,7 +303,7 @@
// CHECK: br label
// CHECK: ret
-// CHECK: define internal void [[MAIN_DUP]]([[KMP_TASK_MAIN_TY]]*, [[KMP_TASK_MAIN_TY]]*, i32)
+// CHECK: define internal void [[MAIN_DUP]]([[KMP_TASK_MAIN_TY]]* %0, [[KMP_TASK_MAIN_TY]]* %1, i32 %2)
// CHECK: getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* %{{.+}}, i32 0, i32 0
// CHECK: getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* %{{.+}}, i32 0, i32 8
// CHECK: load i32, i32* %
@@ -325,7 +324,7 @@
// CHECK: call {{.*}} [[S_DOUBLE_TY_CONSTR]]([[S_DOUBLE_TY]]*
// CHECK: ret void
-// CHECK: define internal i32 [[DESTRUCTORS]](i32, [[KMP_TASK_MAIN_TY]]* noalias)
+// CHECK: define internal i32 [[DESTRUCTORS]](i32 %0, [[KMP_TASK_MAIN_TY]]* noalias %1)
// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 0
// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
@@ -411,7 +410,7 @@
// CHECK: ret
//
-// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_TMAIN_TY]]* noalias, i32** noalias, [2 x i32]** noalias, [2 x [[S_INT_TY]]]** noalias, [[S_INT_TY]]** noalias)
+// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_TMAIN_TY]]* noalias %0, i32** noalias %1, [2 x i32]** noalias %2, [2 x [[S_INT_TY]]]** noalias %3, [[S_INT_TY]]** noalias %4)
// CHECK: [[PRIVATES:%.+]] = load [[PRIVATES_TMAIN_TY]]*, [[PRIVATES_TMAIN_TY]]**
// CHECK: [[PRIV_T_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 0
// CHECK: [[ARG1:%.+]] = load i32**, i32*** %{{.+}},
@@ -427,7 +426,7 @@
// CHECK: store [[S_INT_TY]]* [[PRIV_VAR]], [[S_INT_TY]]** [[ARG4]],
// CHECK: ret void
-// CHECK: define internal i32 [[TASK_ENTRY]](i32, [[KMP_TASK_TMAIN_TY]]* noalias)
+// CHECK: define internal i32 [[TASK_ENTRY]](i32 %0, [[KMP_TASK_TMAIN_TY]]* noalias %1)
// CHECK: alloca i32*,
// CHECK-DAG: [[PRIV_T_VAR_ADDR:%.+]] = alloca i32*,
// CHECK-DAG: [[PRIV_VEC_ADDR:%.+]] = alloca [2 x i32]*,
@@ -466,7 +465,7 @@
// CHECK: br label
// CHECK: ret
-// CHECK: define internal void [[TMAIN_DUP]]([[KMP_TASK_TMAIN_TY]]*, [[KMP_TASK_TMAIN_TY]]*, i32)
+// CHECK: define internal void [[TMAIN_DUP]]([[KMP_TASK_TMAIN_TY]]* %0, [[KMP_TASK_TMAIN_TY]]* %1, i32 %2)
// CHECK: getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* %{{.+}}, i32 0, i32 0
// CHECK: getelementptr inbounds [[KMP_TASK_T_TY]], [[KMP_TASK_T_TY]]* %{{.+}}, i32 0, i32 8
// CHECK: load i32, i32* %
@@ -487,7 +486,7 @@
// CHECK: call {{.*}} [[S_INT_TY_CONSTR]]([[S_INT_TY]]*
// CHECK: ret void
-// CHECK: define internal i32 [[DESTRUCTORS]](i32, [[KMP_TASK_TMAIN_TY]]* noalias)
+// CHECK: define internal i32 [[DESTRUCTORS]](i32 %0, [[KMP_TASK_TMAIN_TY]]* noalias %1)
// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
diff --git a/src/llvm-project/clang/test/OpenMP/taskloop_simd_lastprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/taskloop_simd_lastprivate_messages.cpp
index 70c508f..0faaecf 100644
--- a/src/llvm-project/clang/test/OpenMP/taskloop_simd_lastprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/taskloop_simd_lastprivate_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
@@ -109,6 +111,10 @@
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel
+#pragma omp taskloop simd lastprivate(conditional: argc) lastprivate(conditional: // expected-error 2 {{use of undeclared identifier 'conditional'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k)
+ ++k;
+#pragma omp parallel
#pragma omp taskloop simd lastprivate(S1) // expected-error {{'S1' does not refer to a value}}
for (int k = 0; k < argc; ++k)
++k;
@@ -268,8 +274,8 @@
for (i = 0; i < argc; ++i)
foo();
#pragma omp parallel
-#pragma omp taskloop simd lastprivate(i) // expected-note {{defined as lastprivate}}
- for (i = 0; i < argc; ++i) // expected-error {{loop iteration variable in the associated loop of 'omp taskloop simd' directive may not be lastprivate, predetermined as linear}}
+#pragma omp taskloop simd lastprivate(i) // omp45-note {{defined as lastprivate}}
+ for (i = 0; i < argc; ++i) // omp45-error {{loop iteration variable in the associated loop of 'omp taskloop simd' directive may not be lastprivate, predetermined as linear}}
foo();
#pragma omp parallel private(xa)
#pragma omp taskloop simd lastprivate(xa)
diff --git a/src/llvm-project/clang/test/OpenMP/taskloop_simd_linear_messages.cpp b/src/llvm-project/clang/test/OpenMP/taskloop_simd_linear_messages.cpp
index 0c1acf3..00d2b4a 100644
--- a/src/llvm-project/clang/test/OpenMP/taskloop_simd_linear_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/taskloop_simd_linear_messages.cpp
@@ -12,6 +12,13 @@
extern const omp_allocator_handle_t omp_pteam_mem_alloc;
extern const omp_allocator_handle_t omp_thread_mem_alloc;
+void xxx(int argc) {
+ int i, lin, step; // expected-note {{initialize the variable 'lin' to silence this warning}} expected-note {{initialize the variable 'step' to silence this warning}}
+#pragma omp taskloop simd linear(i, lin : step) // expected-warning {{variable 'lin' is uninitialized when used here}} expected-warning {{variable 'step' is uninitialized when used here}}
+ for (i = 0; i < 10; ++i)
+ ;
+}
+
namespace X {
int x;
};
diff --git a/src/llvm-project/clang/test/OpenMP/taskloop_simd_loop_messages.cpp b/src/llvm-project/clang/test/OpenMP/taskloop_simd_loop_messages.cpp
index 666dba5..9a345d6 100644
--- a/src/llvm-project/clang/test/OpenMP/taskloop_simd_loop_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/taskloop_simd_loop_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wuninitialized
class S {
int a;
@@ -113,32 +115,32 @@
c[ii] = a[ii];
#pragma omp parallel
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
#pragma omp taskloop simd
for (int i = 0; i; i++)
c[i] = a[i];
#pragma omp parallel
-// expected-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'i'}}
#pragma omp taskloop simd
for (int i = 0; jj < kk; ii++)
c[i] = a[i];
#pragma omp parallel
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
#pragma omp taskloop simd
for (int i = 0; !!i; i++)
c[i] = a[i];
-// Ok
#pragma omp parallel
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
#pragma omp taskloop simd
for (int i = 0; i != 1; i++)
c[i] = a[i];
#pragma omp parallel
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
#pragma omp taskloop simd
for (int i = 0;; i++)
c[i] = a[i];
@@ -298,15 +300,15 @@
for (ii = 0; ii < 10; ii++)
c[ii] = a[ii];
-// expected-note@+3 {{defined as private}}
-// expected-error@+3 {{loop iteration variable in the associated loop of 'omp taskloop simd' directive may not be private, predetermined as linear}}
+// omp4-note@+3 {{defined as private}}
+// omp4-error@+3 {{loop iteration variable in the associated loop of 'omp taskloop simd' directive may not be private, predetermined as linear}}
#pragma omp parallel
#pragma omp taskloop simd private(ii)
for (ii = 0; ii < 10; ii++)
c[ii] = a[ii];
-// expected-note@+3 {{defined as lastprivate}}
-// expected-error@+3 {{loop iteration variable in the associated loop of 'omp taskloop simd' directive may not be lastprivate, predetermined as linear}}
+// omp4-note@+3 {{defined as lastprivate}}
+// omp4-error@+3 {{loop iteration variable in the associated loop of 'omp taskloop simd' directive may not be lastprivate, predetermined as linear}}
#pragma omp parallel
#pragma omp taskloop simd lastprivate(ii)
for (ii = 0; ii < 10; ii++)
@@ -350,7 +352,7 @@
}
#pragma omp parallel
-// expected-error@+2 {{statement after '#pragma omp taskloop simd' must be a for loop}}
+// omp4-error@+2 {{statement after '#pragma omp taskloop simd' must be a for loop}}
#pragma omp taskloop simd
for (auto &item : a) {
item = item + 1;
@@ -502,17 +504,17 @@
for (begin = end; begin < end; ++begin)
++begin;
#pragma omp parallel
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
#pragma omp taskloop simd
for (GoodIter I = begin; I - I; ++I)
++I;
#pragma omp parallel
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
#pragma omp taskloop simd
for (GoodIter I = begin; begin < end; ++I)
++I;
#pragma omp parallel
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
#pragma omp taskloop simd
for (GoodIter I = begin; !I; ++I)
++I;
diff --git a/src/llvm-project/clang/test/OpenMP/taskloop_simd_misc_messages.c b/src/llvm-project/clang/test/OpenMP/taskloop_simd_misc_messages.c
index 1f2087f..b9a6707 100644
--- a/src/llvm-project/clang/test/OpenMP/taskloop_simd_misc_messages.c
+++ b/src/llvm-project/clang/test/OpenMP/taskloop_simd_misc_messages.c
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -triple x86_64-unknown-unknown -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -triple x86_64-unknown-unknown -fopenmp-version=45 -verify=expected,omp45 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -triple x86_64-unknown-unknown -fopenmp-version=50 -verify=expected,omp50 %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -triple x86_64-unknown-unknown -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -triple x86_64-unknown-unknown -fopenmp-version=45 -verify=expected,omp45 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -triple x86_64-unknown-unknown -fopenmp-version=50 -verify=expected,omp50 %s -Wuninitialized
void xxx(int argc) {
int x; // expected-note {{initialize the variable 'x' to silence this warning}}
@@ -383,3 +385,87 @@
}
}
+void test_nontemporal() {
+ int i;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp taskloop simd'}} expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp taskloop simd nontemporal(
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp taskloop simd'}} expected-error@+1 2 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp taskloop simd nontemporal(,
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp taskloop simd'}} expected-error@+1 2 {{expected expression}}
+#pragma omp taskloop simd nontemporal(, )
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp taskloop simd'}} expected-error@+1 {{expected expression}}
+#pragma omp taskloop simd nontemporal()
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp taskloop simd'}} expected-error@+1 {{expected expression}}
+#pragma omp taskloop simd nontemporal(int)
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp taskloop simd'}} omp50-error@+1 {{expected variable name}}
+#pragma omp taskloop simd nontemporal(0)
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp taskloop simd'}} expected-error@+1 {{use of undeclared identifier 'x'}}
+#pragma omp taskloop simd nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+// expected-error@+2 {{use of undeclared identifier 'x'}}
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp taskloop simd'}} expected-error@+1 {{use of undeclared identifier 'y'}}
+#pragma omp taskloop simd nontemporal(x, y)
+ for (i = 0; i < 16; ++i)
+ ;
+// expected-error@+3 {{use of undeclared identifier 'x'}}
+// expected-error@+2 {{use of undeclared identifier 'y'}}
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp taskloop simd'}} expected-error@+1 {{use of undeclared identifier 'z'}}
+#pragma omp taskloop simd nontemporal(x, y, z)
+ for (i = 0; i < 16; ++i)
+ ;
+
+ int x, y;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp taskloop simd'}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp taskloop simd nontemporal(x :)
+ for (i = 0; i < 16; ++i)
+ ;
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp taskloop simd'}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}}
+#pragma omp taskloop simd nontemporal(x :, )
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp50-note@+2 {{defined as nontemporal}}
+// omp45-error@+1 2 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp taskloop simd'}} omp50-error@+1 {{a variable cannot appear in more than one nontemporal clause}}
+#pragma omp taskloop simd nontemporal(x) nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp taskloop simd'}}
+#pragma omp taskloop simd private(x) nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp taskloop simd'}}
+#pragma omp taskloop simd nontemporal(x) private(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp taskloop simd'}} expected-note@+1 {{to match this '('}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}} expected-error@+1 {{expected ')'}}
+#pragma omp taskloop simd nontemporal(x, y : 0)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp taskloop simd'}}
+#pragma omp taskloop simd nontemporal(x) lastprivate(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp taskloop simd'}}
+#pragma omp taskloop simd lastprivate(x) nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+}
+
diff --git a/src/llvm-project/clang/test/OpenMP/taskloop_simd_private_codegen.cpp b/src/llvm-project/clang/test/OpenMP/taskloop_simd_private_codegen.cpp
index c6e1df9..29b9c83 100644
--- a/src/llvm-project/clang/test/OpenMP/taskloop_simd_private_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/taskloop_simd_private_codegen.cpp
@@ -13,8 +13,6 @@
// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -DARRAY -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
// expected-no-diagnostics
-// It doesn't pass on win32. Investigating.
-// REQUIRES: shell
#ifndef ARRAY
#ifndef HEADER
@@ -79,7 +77,7 @@
// LAMBDA: [[SIVAR_REF:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** [[SIVAR_PTR_REF]]
// LAMBDA: store i{{[0-9]+}} 3, i{{[0-9]+}}* [[SIVAR_REF]]
- // LAMBDA: define internal i32 [[TASK_ENTRY]](i32, %{{.+}}* noalias)
+ // LAMBDA: define internal i32 [[TASK_ENTRY]](i32 %0, %{{.+}}* noalias %1)
g = 1;
sivar = 2;
// LAMBDA: store double 1.0{{.+}}, double* %{{.+}},
@@ -114,7 +112,7 @@
// BLOCKS-NOT: [[SIVAR]]{{[[^:word:]]}}
// BLOCKS: ret
- // BLOCKS: define internal i32 [[TASK_ENTRY]](i32, %{{.+}}* noalias)
+ // BLOCKS: define internal i32 [[TASK_ENTRY]](i32 %0, %{{.+}}* noalias %1)
g = 1;
sivar = 3;
// BLOCKS: store double 1.0{{.+}}, double* %{{.+}},
@@ -207,7 +205,7 @@
// CHECK: ret
//
-// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_MAIN_TY]]* noalias, [[S_DOUBLE_TY]]** noalias, i32** noalias, [2 x [[S_DOUBLE_TY]]]** noalias, [2 x i32]** noalias, i32** noalias)
+// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_MAIN_TY]]* noalias %0, [[S_DOUBLE_TY]]** noalias %1, i32** noalias %2, [2 x [[S_DOUBLE_TY]]]** noalias %3, [2 x i32]** noalias %4, i32** noalias %5)
// CHECK: [[PRIVATES:%.+]] = load [[PRIVATES_MAIN_TY]]*, [[PRIVATES_MAIN_TY]]**
// CHECK: [[PRIV_S_VAR:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i32 0, i32 0
// CHECK: [[ARG3:%.+]] = load [2 x [[S_DOUBLE_TY]]]**, [2 x [[S_DOUBLE_TY]]]*** %{{.+}},
@@ -223,7 +221,7 @@
// CHECK: store [2 x i32]* [[PRIV_VEC]], [2 x i32]** [[ARG4]],
// CHECK: ret void
-// CHECK: define internal i32 [[TASK_ENTRY]](i32, [[KMP_TASK_MAIN_TY]]* noalias)
+// CHECK: define internal i32 [[TASK_ENTRY]](i32 %0, [[KMP_TASK_MAIN_TY]]* noalias %1)
// CHECK: [[PRIV_VAR_ADDR:%.+]] = alloca [[S_DOUBLE_TY]]*,
// CHECK: [[PRIV_T_VAR_ADDR:%.+]] = alloca i32*,
@@ -248,7 +246,7 @@
// CHECK: ret
-// CHECK: define internal void [[MAIN_DUP]]([[KMP_TASK_MAIN_TY]]*, [[KMP_TASK_MAIN_TY]]*, i32)
+// CHECK: define internal void [[MAIN_DUP]]([[KMP_TASK_MAIN_TY]]* %0, [[KMP_TASK_MAIN_TY]]* %1, i32 %2)
// CHECK: getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* %{{.+}}, i32 0, i32 1
// CHECK: getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* %{{.+}}, i32 0, i32 0
// CHECK: getelementptr inbounds [2 x [[S_DOUBLE_TY]]], [2 x [[S_DOUBLE_TY]]]* %{{.+}}, i32 0, i32 0
@@ -265,7 +263,7 @@
// CHECK: call {{.*}} [[S_DOUBLE_TY_DEF_CONSTR]]([[S_DOUBLE_TY]]*
// CHECK: ret void
-// CHECK: define internal i32 [[DESTRUCTORS]](i32, [[KMP_TASK_MAIN_TY]]* noalias)
+// CHECK: define internal i32 [[DESTRUCTORS]](i32 %0, [[KMP_TASK_MAIN_TY]]* noalias %1)
// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_MAIN_TY]], [[KMP_TASK_MAIN_TY]]* [[RES_KMP_TASK:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 0
// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_MAIN_TY]], [[PRIVATES_MAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 1
@@ -335,7 +333,7 @@
// CHECK: ret
//
-// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_TMAIN_TY]]* noalias, i32** noalias, [2 x i32]** noalias, [2 x [[S_INT_TY]]]** noalias, [[S_INT_TY]]** noalias)
+// CHECK: define internal void [[PRIVATES_MAP_FN:@.+]]([[PRIVATES_TMAIN_TY]]* noalias %0, i32** noalias %1, [2 x i32]** noalias %2, [2 x [[S_INT_TY]]]** noalias %3, [[S_INT_TY]]** noalias %4)
// CHECK: [[PRIVATES:%.+]] = load [[PRIVATES_TMAIN_TY]]*, [[PRIVATES_TMAIN_TY]]**
// CHECK: [[PRIV_T_VAR:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i32 0, i32 0
// CHECK: [[ARG1:%.+]] = load i32**, i32*** %{{.+}},
@@ -351,7 +349,7 @@
// CHECK: store [[S_INT_TY]]* [[PRIV_VAR]], [[S_INT_TY]]** [[ARG4]],
// CHECK: ret void
-// CHECK: define internal i32 [[TASK_ENTRY]](i32, [[KMP_TASK_TMAIN_TY]]* noalias)
+// CHECK: define internal i32 [[TASK_ENTRY]](i32 %0, [[KMP_TASK_TMAIN_TY]]* noalias %1)
// CHECK: alloca i32*,
// CHECK-DAG: [[PRIV_T_VAR_ADDR:%.+]] = alloca i32*,
@@ -374,7 +372,7 @@
// CHECK: ret
-// CHECK: define internal void [[TMAIN_DUP]]([[KMP_TASK_TMAIN_TY]]*, [[KMP_TASK_TMAIN_TY]]*, i32)
+// CHECK: define internal void [[TMAIN_DUP]]([[KMP_TASK_TMAIN_TY]]* %0, [[KMP_TASK_TMAIN_TY]]* %1, i32 %2)
// CHECK: getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* %{{.+}}, i32 0, i32 2
// CHECK: getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* %{{.+}}, i32 0, i32 2
// CHECK: getelementptr inbounds [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* %{{.+}}, i32 0, i32 0
@@ -391,7 +389,7 @@
// CHECK: call {{.*}} [[S_INT_TY_DEF_CONSTR]]([[S_INT_TY]]*
// CHECK: ret void
-// CHECK: define internal i32 [[DESTRUCTORS]](i32, [[KMP_TASK_TMAIN_TY]]* noalias)
+// CHECK: define internal i32 [[DESTRUCTORS]](i32 %0, [[KMP_TASK_TMAIN_TY]]* noalias %1)
// CHECK: [[PRIVATES:%.+]] = getelementptr inbounds [[KMP_TASK_TMAIN_TY]], [[KMP_TASK_TMAIN_TY]]* [[RES_KMP_TASK:%.+]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
// CHECK: [[PRIVATE_S_ARR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 2
// CHECK: [[PRIVATE_VAR_REF:%.+]] = getelementptr inbounds [[PRIVATES_TMAIN_TY]], [[PRIVATES_TMAIN_TY]]* [[PRIVATES]], i{{.+}} 0, i{{.+}} 3
diff --git a/src/llvm-project/clang/test/OpenMP/taskloop_simd_reduction_codegen.cpp b/src/llvm-project/clang/test/OpenMP/taskloop_simd_reduction_codegen.cpp
index 75d1faf..4cb8d5f 100644
--- a/src/llvm-project/clang/test/OpenMP/taskloop_simd_reduction_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/taskloop_simd_reduction_codegen.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -fopenmp -x c++ %s -verify -debug-info-kind=limited -emit-llvm -o - -triple powerpc64le-unknown-linux-gnu -std=c++98 | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -x c++ %s -verify -debug-info-kind=limited -emit-llvm -o - -triple powerpc64le-unknown-linux-gnu -fnoopenmp-use-tls -std=c++98 | FileCheck %s
-// RUN: %clang_cc1 -fopenmp-simd -x c++ %s -verify -debug-info-kind=limited -emit-llvm -o - -triple powerpc64le-unknown-linux-gnu -std=c++98 | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ %s -verify -debug-info-kind=limited -emit-llvm -o - -triple powerpc64le-unknown-linux-gnu -fnoopenmp-use-tls -std=c++98 | FileCheck --check-prefix SIMD-ONLY0 %s
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
// expected-no-diagnostics
@@ -153,52 +153,52 @@
// CHECK: ret i32
-// CHECK: define internal void @[[RED_INIT1]](i8*)
+// CHECK: define internal void @[[RED_INIT1]](i8* %0)
// CHECK: store float 0.000000e+00, float* %
// CHECK: ret void
-// CHECK: define internal void @[[RED_COMB1]](i8*, i8*)
+// CHECK: define internal void @[[RED_COMB1]](i8* %0, i8* %1)
// CHECK: fadd float %
// CHECK: store float %{{.+}}, float* %
// CHECK: ret void
-// CHECK: define internal void @[[RED_INIT2]](i8*)
+// CHECK: define internal void @[[RED_INIT2]](i8* %0)
// CHECK: call i8* @__kmpc_threadprivate_cached(
// CHECK: call i8* @__kmpc_threadprivate_cached(
// CHECK: call void [[OMP_INIT1:@.+]](
// CHECK: ret void
-// CHECK: define internal void [[OMP_COMB1:@.+]](%struct.S* noalias, %struct.S* noalias)
+// CHECK: define internal void [[OMP_COMB1:@.+]](%struct.S* noalias %0, %struct.S* noalias %1)
// CHECK: fadd float %
-// CHECK: define internal void [[OMP_INIT1]](%struct.S* noalias, %struct.S* noalias)
+// CHECK: define internal void [[OMP_INIT1]](%struct.S* noalias %0, %struct.S* noalias %1)
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(
-// CHECK: define internal void @[[RED_FINI2]](i8*)
+// CHECK: define internal void @[[RED_FINI2]](i8* %0)
// CHECK: call i8* @__kmpc_threadprivate_cached(
// CHECK: call void @
// CHECK: ret void
-// CHECK: define internal void @[[RED_COMB2]](i8*, i8*)
+// CHECK: define internal void @[[RED_COMB2]](i8* %0, i8* %1)
// CHECK: call i8* @__kmpc_threadprivate_cached(
// CHECK: call void [[OMP_COMB1]](
// CHECK: ret void
-// CHECK: define internal void @[[RED_INIT3]](i8*)
+// CHECK: define internal void @[[RED_INIT3]](i8* %0)
// CHECK: store float 0.000000e+00, float* %
// CHECK: ret void
-// CHECK: define internal void @[[RED_COMB3]](i8*, i8*)
+// CHECK: define internal void @[[RED_COMB3]](i8* %0, i8* %1)
// CHECK: fadd float %
// CHECK: store float %{{.+}}, float* %
// CHECK: ret void
-// CHECK: define internal void @[[RED_INIT4]](i8*)
+// CHECK: define internal void @[[RED_INIT4]](i8* %0)
// CHECK: call i8* @__kmpc_threadprivate_cached(
// CHECK: store float 0.000000e+00, float* %
// CHECK: ret void
-// CHECK: define internal void @[[RED_COMB4]](i8*, i8*)
+// CHECK: define internal void @[[RED_COMB4]](i8* %0, i8* %1)
// CHECK: call i8* @__kmpc_threadprivate_cached(
// CHECK: fadd float %
// CHECK: store float %{{.+}}, float* %
diff --git a/src/llvm-project/clang/test/OpenMP/taskloop_simd_reduction_messages.cpp b/src/llvm-project/clang/test/OpenMP/taskloop_simd_reduction_messages.cpp
index 7ac4c24..82047f0 100644
--- a/src/llvm-project/clang/test/OpenMP/taskloop_simd_reduction_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/taskloop_simd_reduction_messages.cpp
@@ -16,6 +16,13 @@
extern const omp_allocator_handle_t omp_pteam_mem_alloc;
extern const omp_allocator_handle_t omp_thread_mem_alloc;
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp taskloop simd reduction(+:fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
void foo() {
}
diff --git a/src/llvm-project/clang/test/OpenMP/teams_ast_print.cpp b/src/llvm-project/clang/test/OpenMP/teams_ast_print.cpp
index 80300bf..9ff96db 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_ast_print.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_ast_print.cpp
@@ -1,6 +1,9 @@
// 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
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -DOMP5 -ast-print %s | FileCheck %s --check-prefix=CHECK --check-prefix=OMP5
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s --check-prefix=CHECK --check-prefix=OMP5
// RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s | FileCheck %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -emit-pch -o %t %s
@@ -37,6 +40,10 @@
T b = argc, c, d, e, f, g;
static T a;
S<T> s;
+#ifdef OMP5
+#pragma omp teams
+ a=2;
+#endif // OMP5
#pragma omp target
#pragma omp teams
a=2;
@@ -53,6 +60,8 @@
// CHECK-NEXT: T b = argc, c, d, e, f, g;
// CHECK-NEXT: static T a;
// CHECK-NEXT: S<T> s;
+// OMP5-NEXT: #pragma omp teams
+// OMP5-NEXT: a = 2;
// CHECK-NEXT: #pragma omp target
// CHECK-NEXT: #pragma omp teams{{$}}
// CHECK-NEXT: a = 2;
@@ -66,6 +75,8 @@
// CHECK-NEXT: int b = argc, c, d, e, f, g;
// CHECK-NEXT: static int a;
// CHECK-NEXT: S<int> s;
+// OMP5-NEXT: #pragma omp teams
+// OMP5-NEXT: a = 2;
// CHECK-NEXT: #pragma omp target
// CHECK-NEXT: #pragma omp teams
// CHECK-NEXT: a = 2;
@@ -79,6 +90,8 @@
// CHECK-NEXT: long b = argc, c, d, e, f, g;
// CHECK-NEXT: static long a;
// CHECK-NEXT: S<long> s;
+// OMP5-NEXT: #pragma omp teams
+// OMP5-NEXT: a = 2;
// CHECK-NEXT: #pragma omp target
// CHECK-NEXT: #pragma omp teams
// CHECK-NEXT: a = 2;
diff --git a/src/llvm-project/clang/test/OpenMP/teams_codegen.cpp b/src/llvm-project/clang/test/OpenMP/teams_codegen.cpp
index 6817777..9a25052 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_codegen.cpp
@@ -394,4 +394,31 @@
// CK5-NEXT: }
#endif // CK5
+
+// Test host codegen.
+// RUN: %clang_cc1 -DCK6 -verify -fopenmp -fopenmp-version=50 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix CK6 --check-prefix CK6-64
+// RUN: %clang_cc1 -DCK6 -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
+// RUN: %clang_cc1 -DCK6 -fopenmp-version=50 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CK6 --check-prefix CK6-64
+// RUN: %clang_cc1 -DCK6 -verify -fopenmp -fopenmp-version=50 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix CK6 --check-prefix CK6-32
+// RUN: %clang_cc1 -DCK6 -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
+// RUN: %clang_cc1 -DCK6 -fopenmp -fopenmp-version=50 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CK6 --check-prefix CK6-32
+
+// RUN: %clang_cc1 -DCK6 -verify -fopenmp-version=50 -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DCK6 -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
+// RUN: %clang_cc1 -DCK6 -fopenmp-simd -fopenmp-version=50 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DCK6 -verify -fopenmp-simd -fopenmp-version=50 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DCK6 -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
+// RUN: %clang_cc1 -DCK6 -fopenmp-simd -fopenmp-version=50 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
+#ifdef CK6
+
+// CK6-LABEL: foo
+void foo() {
+ // CK6: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_teams(%struct.ident_t* @0, i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @{{.+}} to void (i32*, i32*, ...)*))
+#pragma omp teams
+ ;
+}
+
+#endif // CK6
+
#endif
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_ast_print.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_ast_print.cpp
index 8673b45..96af638 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_ast_print.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_ast_print.cpp
@@ -1,10 +1,10 @@
-// RUN: %clang_cc1 -verify -fopenmp -ast-print %s -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -ast-print %s -Wno-openmp-mapping | 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 -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s -Wno-openmp-mapping | FileCheck %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -fopenmp-simd -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s
// expected-no-diagnostics
#ifndef HEADER
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_codegen.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_codegen.cpp
index ea299bc..151fa2d 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_codegen.cpp
@@ -21,22 +21,19 @@
int a[100];
// CK1: define {{.*}}i32 @{{.+}}teams_argument_globali(
-int teams_argument_global(int n){
+int teams_argument_global(int n) {
int te = n / 128;
int th = 128;
// discard n_addr
// CK1: alloca i32,
// CK1: [[TE:%.+]] = alloca i32,
// CK1: [[TH:%.+]] = alloca i32,
- // CK1: alloca i32,
- // CK1: alloca i32,
- // CK1: alloca i32,
// CK1: [[TE_CAST:%.+]] = alloca i{{32|64}},
// CK1: [[TH_CAST:%.+]] = alloca i{{32|64}},
- // CK1: call void @__kmpc_push_target_tripcount(i64 -1, i64 %{{.+}})
// CK1: [[TE_PAR:%.+]] = load{{.+}}, {{.+}} [[TE_CAST]],
// CK1: [[TH_PAR:%.+]] = load{{.+}}, {{.+}} [[TH_CAST]],
+ // CK1: call void @__kmpc_push_target_tripcount(i64 -1, i64 %{{.+}})
// CK1: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 4, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 {{.+}}, i32 {{.+}})
// CK1: call void @[[OFFL1:.+]](i{{32|64}} [[TE_PAR]], i{{32|64}} [[TH_PAR]],
@@ -161,7 +158,7 @@
// CK3: define {{.*}}i32 @{{.+}}foo{{.+}}(
int foo(void) {
- // CK3: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 1, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 0)
+ // CK3: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 2, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* %{{.+}}, i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 0)
// CK3: call void @[[OFFL1:.+]]([[SSI]]* %{{.+}})
#pragma omp target
#pragma omp teams distribute
@@ -177,7 +174,7 @@
// CK3: define internal void @[[OUTL1]]({{.+}})
// CK3: call void @__kmpc_for_static_init_4(
// CK3: call void @__kmpc_for_static_fini(
- // CK3: ret void
+ // CK3: ret void
return a[0];
}
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_firstprivate_codegen.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_firstprivate_codegen.cpp
index 672ed8e..a2e6533 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_firstprivate_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_firstprivate_codegen.cpp
@@ -1,25 +1,25 @@
-// RUN: %clang_cc1 -DCHECK -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-64
-// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-64
-// RUN: %clang_cc1 -DCHECK -verify -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-32
-// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-32
+// RUN: %clang_cc1 -DCHECK -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-64
+// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-64
+// RUN: %clang_cc1 -DCHECK -verify -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-32
+// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-32
-// RUN: %clang_cc1 -DCHECK -verify -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -DCHECK -verify -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DCHECK -verify -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DCHECK -verify -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck -allow-deprecated-dag-overlap %s --check-prefix LAMBDA --check-prefix LAMBDA-64
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck -allow-deprecated-dag-overlap %s --check-prefix LAMBDA --check-prefix LAMBDA-64
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck -allow-deprecated-dag-overlap %s --check-prefix LAMBDA --check-prefix LAMBDA-64
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck -allow-deprecated-dag-overlap %s --check-prefix LAMBDA --check-prefix LAMBDA-64
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY1 %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY1 %s
// SIMD-ONLY1-NOT: {{__kmpc|__tgt}}
// expected-no-diagnostics
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_firstprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_firstprivate_messages.cpp
index 63237e1..b845a23d 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_firstprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_firstprivate_messages.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-mapping -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
@@ -10,6 +10,14 @@
return argc;
}
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp target
+#pragma omp teams distribute firstprivate(fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
struct S1; // expected-note {{declared here}} expected-note{{forward declaration of 'S1'}}
extern S1 a;
class S2 {
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_lastprivate_codegen.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_lastprivate_codegen.cpp
index 581bb1d..5d54ba7 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_lastprivate_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_lastprivate_codegen.cpp
@@ -1,31 +1,31 @@
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
-// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
-// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
-// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
// SIMD-ONLY1-NOT: {{__kmpc|__tgt}}
// expected-no-diagnostics
#ifndef HEADER
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_lastprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_lastprivate_messages.cpp
index f17f7bb..a0997da 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_lastprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_lastprivate_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp-simd %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp-simd %s -Wno-openmp-mapping -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
@@ -100,6 +102,10 @@
for (int k = 0; k < argc; ++k) ++k;
#pragma omp target
+#pragma omp teams distribute lastprivate(conditional: argc) lastprivate(conditional: // expected-error 2 {{use of undeclared identifier 'conditional'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k) ++k;
+
+#pragma omp target
#pragma omp teams distribute lastprivate(S1) // expected-error {{'S1' does not refer to a value}}
for (int k = 0; k < argc; ++k) ++k;
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_loop_messages.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_loop_messages.cpp
index 824a51b..1edc926 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_loop_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_loop_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wuninitialized
class S {
int a;
@@ -109,32 +111,32 @@
#pragma omp target
#pragma omp teams distribute
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
for (int i = 0; i; i++)
c[i] = a[i];
#pragma omp target
#pragma omp teams distribute
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
// expected-error@+1 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'i'}}
for (int i = 0; jj < kk; ii++)
c[i] = a[i];
#pragma omp target
#pragma omp teams distribute
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
for (int i = 0; !!i; i++)
c[i] = a[i];
-// Ok
#pragma omp target
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
#pragma omp teams distribute
for (int i = 0; i != 1; i++)
c[i] = a[i];
#pragma omp target
#pragma omp teams distribute
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
for (int i = 0;; i++)
c[i] = a[i];
@@ -315,7 +317,7 @@
#pragma omp target
#pragma omp teams distribute
-// expected-error@+1 {{statement after '#pragma omp teams distribute' must be a for loop}}
+// omp4-error@+1 {{statement after '#pragma omp teams distribute' must be a for loop}}
for (auto &item : a) {
item = item + 1;
}
@@ -414,7 +416,7 @@
Iter0 begin0, end0;
#pragma omp target
#pragma omp teams distribute
- for (GoodIter I = begin; I < end; ++I) // expected-warning 2 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (GoodIter I = begin; I < end; ++I) // expected-warning 2 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
#pragma omp target
#pragma omp teams distribute
@@ -423,31 +425,31 @@
++I;
#pragma omp target
#pragma omp teams distribute
- for (GoodIter I = begin; I >= end; --I) // expected-warning 2 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (GoodIter I = begin; I >= end; --I) // expected-warning 2 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
#pragma omp target
#pragma omp teams distribute
// expected-warning@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
- for (GoodIter I(begin); I < end; ++I) // expected-warning 2 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (GoodIter I(begin); I < end; ++I) // expected-warning 2 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
#pragma omp target
#pragma omp teams distribute
// expected-warning@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
- for (GoodIter I(nullptr); I < end; ++I) // expected-warning {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (GoodIter I(nullptr); I < end; ++I) // expected-warning {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
#pragma omp target
#pragma omp teams distribute
// expected-warning@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
- for (GoodIter I(0); I < end; ++I) // expected-warning {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (GoodIter I(0); I < end; ++I) // expected-warning {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
#pragma omp target
#pragma omp teams distribute
// expected-warning@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
- for (GoodIter I(1, 2); I < end; ++I) // expected-warning {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (GoodIter I(1, 2); I < end; ++I) // expected-warning {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
#pragma omp target
#pragma omp teams distribute
- for (begin = GoodIter(0); begin < end; ++begin) // expected-warning {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (begin = GoodIter(0); begin < end; ++begin) // expected-warning {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++begin;
#pragma omp target
#pragma omp teams distribute
@@ -462,21 +464,21 @@
++begin;
#pragma omp target
#pragma omp teams distribute
- for (begin = end; begin < end; ++begin) // expected-warning {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (begin = end; begin < end; ++begin) // expected-warning {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++begin;
#pragma omp target
#pragma omp teams distribute
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
for (GoodIter I = begin; I - I; ++I)
++I;
#pragma omp target
#pragma omp teams distribute
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
for (GoodIter I = begin; begin < end; ++I)
++I;
#pragma omp target
#pragma omp teams distribute
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
for (GoodIter I = begin; !I; ++I)
++I;
#pragma omp target
@@ -487,7 +489,7 @@
++I;
#pragma omp target
#pragma omp teams distribute
- for (GoodIter I = begin; I >= end; I = I - 1) // expected-warning 2 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (GoodIter I = begin; I >= end; I = I - 1) // expected-warning 2 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
#pragma omp target
#pragma omp teams distribute
@@ -549,19 +551,19 @@
#pragma omp teams distribute
// expected-note@+2 {{loop step is expected to be positive due to this condition}}
// expected-error@+1 {{increment expression must cause 'I' to increase on each iteration of OpenMP for loop}}
- for (IT I = begin; I < end; I = I + ST) { // expected-warning 2 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (IT I = begin; I < end; I = I + ST) { // expected-warning 2 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
}
#pragma omp target
#pragma omp teams distribute
// expected-note@+2 {{loop step is expected to be positive due to this condition}}
// expected-error@+1 {{increment expression must cause 'I' to increase on each iteration of OpenMP for loop}}
- for (IT I = begin; I <= end; I += ST) { // expected-warning 2 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (IT I = begin; I <= end; I += ST) { // expected-warning 2 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
}
#pragma omp target
#pragma omp teams distribute
- for (IT I = begin; I < end; ++I) { // expected-warning 4 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (IT I = begin; I < end; ++I) { // expected-warning 4 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
}
}
@@ -597,7 +599,7 @@
#pragma omp target
#pragma omp teams distribute
- for (IT I = begin; I < end; I += TC<int, ST>::step()) { // expected-warning 2 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (IT I = begin; I < end; I += TC<int, ST>::step()) { // expected-warning 2 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
}
}
@@ -700,7 +702,7 @@
S s(4);
// expected-error@+2 {{lastprivate variable cannot be firstprivate}} expected-note@+2 {{defined as lastprivate}}
#pragma omp target
-#pragma omp teams distribute lastprivate(s) firstprivate(s) // expected-error {{calling a private constructor of class 'S'}} expected-warning {{Non-trivial type 'S' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp teams distribute lastprivate(s) firstprivate(s) // expected-error {{calling a private constructor of class 'S'}} expected-warning {{Type 'S' is not trivially copyable and not guaranteed to be mapped correctly}}
for (int i = 0; i < 16; ++i)
;
}
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_ast_print.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_ast_print.cpp
index c414a21..507c186 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_ast_print.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_ast_print.cpp
@@ -1,10 +1,10 @@
-// RUN: %clang_cc1 -verify -fopenmp -ast-print %s -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -ast-print %s -Wno-openmp-mapping | 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 -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s -Wno-openmp-mapping | FileCheck %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -fopenmp-simd -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s
// expected-no-diagnostics
#ifndef HEADER
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_codegen.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_codegen.cpp
index fa425b3..43d3500 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_codegen.cpp
@@ -28,14 +28,11 @@
// CK1: alloca i32,
// CK1: [[TE:%.+]] = alloca i32,
// CK1: [[TH:%.+]] = alloca i32,
- // CK1: alloca i32,
- // CK1: alloca i32,
- // CK1: alloca i32,
// CK1: [[TE_CAST:%.+]] = alloca i{{32|64}},
// CK1: [[TH_CAST:%.+]] = alloca i{{32|64}},
- // CK1: call void @__kmpc_push_target_tripcount(i64 -1, i64 %{{.+}})
// CK1: [[TE_PAR:%.+]] = load{{.+}}, {{.+}} [[TE_CAST]],
// CK1: [[TH_PAR:%.+]] = load{{.+}}, {{.+}} [[TH_CAST]],
+ // CK1: call void @__kmpc_push_target_tripcount(i64 -1, i64 %{{.+}})
// CK1: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 4, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 {{.+}}, i32 {{.+}})
// CK1: call void @[[OFFL1:.+]](i{{32|64}} [[TE_PAR]], i{{32|64}} [[TH_PAR]],
@@ -164,7 +161,7 @@
// CK3: define {{.*}}i32 @{{.+}}foo{{.+}}(
int foo(void) {
- // CK3: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 1, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 0)
+ // CK3: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 2, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* %{{.+}}, i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 0)
// CK3: call void @[[OFFL1:.+]]([[SSI]]* %{{.+}})
#pragma omp target
#pragma omp teams distribute parallel for
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_firstprivate_codegen.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_firstprivate_codegen.cpp
index 14bccc0..6f33c4f 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_firstprivate_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_firstprivate_codegen.cpp
@@ -1,25 +1,25 @@
-// RUN: %clang_cc1 -DCHECK -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
-// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
-// RUN: %clang_cc1 -DCHECK -verify -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
-// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
+// RUN: %clang_cc1 -DCHECK -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
+// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
+// RUN: %clang_cc1 -DCHECK -verify -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
+// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
-// RUN: %clang_cc1 -DCHECK -verify -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -DCHECK -verify -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DCHECK -verify -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DCHECK -verify -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
// SIMD-ONLY1-NOT: {{__kmpc|__tgt}}
// expected-no-diagnostics
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_firstprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_firstprivate_messages.cpp
index b6fac35..0509391 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_firstprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_firstprivate_messages.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-mapping -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
@@ -10,6 +10,14 @@
return argc;
}
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp target
+#pragma omp teams distribute parallel for firstprivate(fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
struct S1; // expected-note {{declared here}} expected-note{{forward declaration of 'S1'}}
extern S1 a;
class S2 {
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_lastprivate_codegen.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_lastprivate_codegen.cpp
index bc0b210..3dfb513 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_lastprivate_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_lastprivate_codegen.cpp
@@ -1,31 +1,31 @@
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
-// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
-// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
-// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
// SIMD-ONLY1-NOT: {{__kmpc|__tgt}}
// expected-no-diagnostics
#ifndef HEADER
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_lastprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_lastprivate_messages.cpp
index 56f4bc0..1fd8fff 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_lastprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_lastprivate_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp-simd %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp-simd %s -Wno-openmp-mapping -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
@@ -100,6 +102,10 @@
for (int k = 0; k < argc; ++k) ++k;
#pragma omp target
+#pragma omp teams distribute parallel for lastprivate(conditional: argc) lastprivate(conditional: // expected-error 2 {{use of undeclared identifier 'conditional'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k) ++k;
+
+#pragma omp target
#pragma omp teams distribute parallel for lastprivate(S1) // expected-error {{'S1' does not refer to a value}}
for (int k = 0; k < argc; ++k) ++k;
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_loop_messages.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_loop_messages.cpp
index 2e1be8f..5916bed 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_loop_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_loop_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wuninitialized
class S {
int a;
@@ -109,32 +111,32 @@
#pragma omp target
#pragma omp teams distribute parallel for
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
for (int i = 0; i; i++)
c[i] = a[i];
#pragma omp target
#pragma omp teams distribute parallel for
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
// expected-error@+1 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'i'}}
for (int i = 0; jj < kk; ii++)
c[i] = a[i];
#pragma omp target
#pragma omp teams distribute parallel for
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
for (int i = 0; !!i; i++)
c[i] = a[i];
-// Ok
#pragma omp target
#pragma omp teams distribute parallel for
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
for (int i = 0; i != 1; i++)
c[i] = a[i];
#pragma omp target
#pragma omp teams distribute parallel for
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
for (int i = 0;; i++)
c[i] = a[i];
@@ -313,7 +315,7 @@
#pragma omp target
#pragma omp teams distribute parallel for
-// expected-error@+1 {{statement after '#pragma omp teams distribute parallel for' must be a for loop}}
+// omp4-error@+1 {{statement after '#pragma omp teams distribute parallel for' must be a for loop}}
for (auto &item : a) {
item = item + 1;
}
@@ -412,7 +414,7 @@
Iter0 begin0, end0;
#pragma omp target
#pragma omp teams distribute parallel for
- for (GoodIter I = begin; I < end; ++I) // expected-warning 2 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (GoodIter I = begin; I < end; ++I) // expected-warning 2 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
#pragma omp target
#pragma omp teams distribute parallel for
@@ -421,31 +423,31 @@
++I;
#pragma omp target
#pragma omp teams distribute parallel for
- for (GoodIter I = begin; I >= end; --I) // expected-warning 2 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (GoodIter I = begin; I >= end; --I) // expected-warning 2 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
#pragma omp target
#pragma omp teams distribute parallel for
// expected-warning@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
- for (GoodIter I(begin); I < end; ++I) // expected-warning 2 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (GoodIter I(begin); I < end; ++I) // expected-warning 2 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
#pragma omp target
#pragma omp teams distribute parallel for
// expected-warning@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
- for (GoodIter I(nullptr); I < end; ++I) // expected-warning {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (GoodIter I(nullptr); I < end; ++I) // expected-warning {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
#pragma omp target
#pragma omp teams distribute parallel for
// expected-warning@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
- for (GoodIter I(0); I < end; ++I) // expected-warning {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (GoodIter I(0); I < end; ++I) // expected-warning {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
#pragma omp target
#pragma omp teams distribute parallel for
// expected-warning@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
- for (GoodIter I(1, 2); I < end; ++I) // expected-warning {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (GoodIter I(1, 2); I < end; ++I) // expected-warning {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
#pragma omp target
#pragma omp teams distribute parallel for
- for (begin = GoodIter(0); begin < end; ++begin) // expected-warning {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (begin = GoodIter(0); begin < end; ++begin) // expected-warning {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++begin;
#pragma omp target
#pragma omp teams distribute parallel for
@@ -460,21 +462,21 @@
++begin;
#pragma omp target
#pragma omp teams distribute parallel for
- for (begin = end; begin < end; ++begin) // expected-warning {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (begin = end; begin < end; ++begin) // expected-warning {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++begin;
#pragma omp target
#pragma omp teams distribute parallel for
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
for (GoodIter I = begin; I - I; ++I)
++I;
#pragma omp target
#pragma omp teams distribute parallel for
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
for (GoodIter I = begin; begin < end; ++I)
++I;
#pragma omp target
#pragma omp teams distribute parallel for
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
for (GoodIter I = begin; !I; ++I)
++I;
#pragma omp target
@@ -485,7 +487,7 @@
++I;
#pragma omp target
#pragma omp teams distribute parallel for
- for (GoodIter I = begin; I >= end; I = I - 1) // expected-warning 2 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (GoodIter I = begin; I >= end; I = I - 1) // expected-warning 2 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
#pragma omp target
#pragma omp teams distribute parallel for
@@ -547,19 +549,19 @@
#pragma omp teams distribute parallel for
// expected-note@+2 {{loop step is expected to be positive due to this condition}}
// expected-error@+1 {{increment expression must cause 'I' to increase on each iteration of OpenMP for loop}}
- for (IT I = begin; I < end; I = I + ST) { // expected-warning 2 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (IT I = begin; I < end; I = I + ST) { // expected-warning 2 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
}
#pragma omp target
#pragma omp teams distribute parallel for
// expected-note@+2 {{loop step is expected to be positive due to this condition}}
// expected-error@+1 {{increment expression must cause 'I' to increase on each iteration of OpenMP for loop}}
- for (IT I = begin; I <= end; I += ST) { // expected-warning 2 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (IT I = begin; I <= end; I += ST) { // expected-warning 2 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
}
#pragma omp target
#pragma omp teams distribute parallel for
- for (IT I = begin; I < end; ++I) { // expected-warning 4 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (IT I = begin; I < end; ++I) { // expected-warning 4 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
}
}
@@ -595,7 +597,7 @@
#pragma omp target
#pragma omp teams distribute parallel for
- for (IT I = begin; I < end; I += TC<int, ST>::step()) { // expected-warning 2 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (IT I = begin; I < end; I += TC<int, ST>::step()) { // expected-warning 2 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
}
}
@@ -695,7 +697,7 @@
S s(4);
// expected-error@+2 {{lastprivate variable cannot be firstprivate}} expected-note@+2 {{defined as lastprivate}}
#pragma omp target
-#pragma omp teams distribute parallel for lastprivate(s) firstprivate(s) // expected-error {{calling a private constructor of class 'S'}} expected-warning {{Non-trivial type 'S' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp teams distribute parallel for lastprivate(s) firstprivate(s) // expected-error {{calling a private constructor of class 'S'}} expected-warning {{Type 'S' is not trivially copyable and not guaranteed to be mapped correctly}}
for (int i = 0; i < 16; ++i)
;
}
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_reduction_messages.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_reduction_messages.cpp
index beebe84..8374c14 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_reduction_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_reduction_messages.cpp
@@ -1,12 +1,20 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wno-openmp-mapping -Wuninitialized
extern int omp_default_mem_alloc;
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp target
+#pragma omp teams distribute parallel for simd reduction(+:fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
void foo() {
}
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_shared_messages.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_shared_messages.cpp
index faa2b20..48c95a7 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_shared_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_shared_messages.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-mapping -Wuninitialized
void foo() {
}
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_aligned_messages.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_aligned_messages.cpp
index 206540a..7d2dd95 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_aligned_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_aligned_messages.cpp
@@ -253,7 +253,7 @@
for (int k = 0; k < argc; ++k) ++k;
#pragma omp target
-#pragma omp teams distribute parallel for simd aligned (a, b) // expected-error {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'S1'}} expected-error {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'S2'}} expected-error {{incomplete type 'S1' where a complete type is required}} expected-warning {{Non-trivial type 'const S2' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp teams distribute parallel for simd aligned (a, b) // expected-error {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'S1'}} expected-error {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'S2'}} expected-error {{incomplete type 'S1' where a complete type is required}}
for (int k = 0; k < argc; ++k) ++k;
#pragma omp target
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_ast_print.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_ast_print.cpp
index 31a2e7e..51d18cc 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_ast_print.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_ast_print.cpp
@@ -1,10 +1,16 @@
-// RUN: %clang_cc1 -verify -fopenmp -ast-print %s -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix OMP45
// 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 -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix OMP45
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -DOMP5 -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix OMP50
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix OMP50
-// RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix OMP45
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -fopenmp-simd -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix OMP45
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix OMP50
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix OMP50
// expected-no-diagnostics
#ifndef HEADER
@@ -150,13 +156,18 @@
// CHECK: for (int i = 0; i < 10; ++i)
// CHECK-NEXT: foo();
#pragma omp target
+#ifdef OMP5
+#pragma omp teams distribute parallel for simd if(simd:argc) nontemporal(argc, c, d)
+#else
#pragma omp teams distribute parallel for simd
+#endif // OMP5
for (int i = 0; i < 10; ++i)
foo();
// CHECK: #pragma omp target
-// CHECK-NEXT: #pragma omp teams distribute parallel for simd
+// OMP45-NEXT: #pragma omp teams distribute parallel for simd
+// OMP50-NEXT: #pragma omp teams distribute parallel for simd if(simd: argc) nontemporal(argc,c,d)
// CHECK-NEXT: for (int i = 0; i < 10; ++i)
-// CHECK-NEXT: foo();
+// CHECK-NEXT: foo();
#pragma omp target
#pragma omp teams distribute parallel for simd default(none), private(b) firstprivate(argc) shared(d) reduction(+:c) reduction(max:e) num_teams(f) thread_limit(d)
for (int k = 0; k < 10; ++k)
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_codegen.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_codegen.cpp
index 4579341..fd2b2da 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_codegen.cpp
@@ -28,15 +28,12 @@
// CK1: alloca i32,
// CK1: [[TE:%.+]] = alloca i32,
// CK1: [[TH:%.+]] = alloca i32,
- // CK1: alloca i32,
- // CK1: alloca i32,
- // CK1: alloca i32,
// CK1: [[TE_CAST:%.+]] = alloca i{{32|64}},
// CK1: [[TH_CAST:%.+]] = alloca i{{32|64}},
- // CK1: call void @__kmpc_push_target_tripcount(i64 -1, i64 %{{.+}})
// CK1: [[TE_PAR:%.+]] = load{{.+}}, {{.+}} [[TE_CAST]],
// CK1: [[TH_PAR:%.+]] = load{{.+}}, {{.+}} [[TH_CAST]],
+ // CK1: call void @__kmpc_push_target_tripcount(i64 -1, i64 %{{.+}})
// CK1: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 4, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0)
// CK1: call void @[[OFFL1:.+]](i{{32|64}} [[TE_PAR]], i{{32|64}} [[TH_PAR]],
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_firstprivate_codegen.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_firstprivate_codegen.cpp
index 6e8c0d1..c92f9be 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_firstprivate_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_firstprivate_codegen.cpp
@@ -1,25 +1,25 @@
-// RUN: %clang_cc1 -DCHECK -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
-// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
-// RUN: %clang_cc1 -DCHECK -verify -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
-// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
+// RUN: %clang_cc1 -DCHECK -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
+// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
+// RUN: %clang_cc1 -DCHECK -verify -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
+// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
-// RUN: %clang_cc1 -DCHECK -verify -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -DCHECK -verify -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DCHECK -verify -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DCHECK -verify -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
// SIMD-ONLY1-NOT: {{__kmpc|__tgt}}
// expected-no-diagnostics
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_firstprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_firstprivate_messages.cpp
index 87098ca..898c1e2 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_firstprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_firstprivate_messages.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-mapping -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
@@ -10,6 +10,14 @@
return argc;
}
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp target
+#pragma omp teams distribute parallel for simd firstprivate(fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
struct S1; // expected-note {{declared here}} expected-note{{forward declaration of 'S1'}}
extern S1 a;
class S2 {
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_if_codegen.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_if_codegen.cpp
index 6679413..d5d0d8a 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_if_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_if_codegen.cpp
@@ -1,10 +1,16 @@
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck %s --check-prefix CHECK --check-prefix OMP45
// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple %itanium_abi_triple -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple %itanium_abi_triple -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple %itanium_abi_triple -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CHECK --check-prefix OMP45
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -DOMP5 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck %s --check-prefix CHECK --check-prefix OMP50
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple %itanium_abi_triple -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple %itanium_abi_triple -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CHECK --check-prefix OMP50
// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple %itanium_abi_triple -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple %itanium_abi_triple -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple %itanium_abi_triple -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple %itanium_abi_triple -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY0 %s
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
// expected-no-diagnostics
#ifndef HEADER
@@ -135,7 +141,8 @@
// CHECK: define{{.+}} void [[OMP_TEAMS_OUTLINED_2]](
// CHECK: call void @__kmpc_for_static_init_4(
- // CHECK: call void {{.+}} @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{.+}} 2, {{.+}}* [[OMP_OUTLINED_4:@.+]] to void
+ // OMP45: call void {{.+}} @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{.+}} 2, {{.+}}* [[OMP_OUTLINED_4:@.+]] to void
+ // OMP50: call void {{.+}} @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{.+}} 3, {{.+}}* [[OMP_OUTLINED_4:@.+]] to void
// CHECK: call void @__kmpc_serialized_parallel(
// CHECK: call void [[OMP_OUTLINED_4:@.+]](
// CHECK: call void @__kmpc_end_serialized_parallel(
@@ -187,6 +194,9 @@
// CHECK: call void @__kmpc_for_static_fini(
// CHECK: ret void
-// CHECK: !{!"llvm.loop.vectorize.enable", i1 true}
+// OMP45-NOT: !{!"llvm.loop.vectorize.enable", i1 false}
+// CHECK-DAG: !{!"llvm.loop.vectorize.enable", i1 true}
+// OMP50-DAG: !{!"llvm.loop.vectorize.enable", i1 false}
+// OMP45-NOT: !{!"llvm.loop.vectorize.enable", i1 false}
#endif
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_if_messages.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_if_messages.cpp
index 39a0b32..9de202f 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_if_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_if_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp -fopenmp-version=50 -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-simd -fopenmp-version=50 -ferror-limit 100 %s -Wuninitialized
void foo() {
}
@@ -68,13 +70,13 @@
#pragma omp teams distribute parallel for simd if(parallel : argc)
for (i = 0; i < argc; ++i) foo();
#pragma omp target
-#pragma omp teams distribute parallel for simd if(parallel : argc) if (for:argc) // expected-error {{directive name modifier 'for' is not allowed for '#pragma omp teams distribute parallel for simd'}}
+#pragma omp teams distribute parallel for simd if(parallel : argc) if (simd:argc) // omp45-error {{directive name modifier 'simd' is not allowed for '#pragma omp teams distribute parallel for simd'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target
#pragma omp teams distribute parallel for simd if(parallel : argc) if (parallel:argc) // expected-error {{directive '#pragma omp teams distribute parallel for simd' cannot contain more than one 'if' clause with 'parallel' name modifier}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target
-#pragma omp teams distribute parallel for simd if(parallel : argc) if (argc) // expected-error {{no more 'if' clause is allowed}} expected-note {{previous clause with directive name modifier specified here}}
+#pragma omp teams distribute parallel for simd if(parallel : argc) if (argc) // omp45-error {{no more 'if' clause is allowed}} omp50-error {{expected 'simd' directive name modifier}} expected-note {{previous clause with directive name modifier specified here}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target
#pragma omp teams distribute parallel for simd if(distribute : argc) // expected-error {{directive name modifier 'distribute' is not allowed for '#pragma omp teams distribute parallel for simd'}}
@@ -134,13 +136,13 @@
#pragma omp teams distribute parallel for simd if(parallel : argc)
for (i = 0; i < argc; ++i) foo();
#pragma omp target
-#pragma omp teams distribute parallel for simd if(parallel : argc) if (for:argc) // expected-error {{directive name modifier 'for' is not allowed for '#pragma omp teams distribute parallel for simd'}}
+#pragma omp teams distribute parallel for simd if(parallel : argc) if (simd:argc) // omp45-error {{directive name modifier 'simd' is not allowed for '#pragma omp teams distribute parallel for simd'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target
#pragma omp teams distribute parallel for simd if(parallel : argc) if (parallel:argc) // expected-error {{directive '#pragma omp teams distribute parallel for simd' cannot contain more than one 'if' clause with 'parallel' name modifier}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target
-#pragma omp teams distribute parallel for simd if(parallel : argc) if (argc) // expected-error {{no more 'if' clause is allowed}} expected-note {{previous clause with directive name modifier specified here}}
+#pragma omp teams distribute parallel for simd if(parallel : argc) if (argc) //omp45-error {{no more 'if' clause is allowed}} omp50-error {{expected 'simd' directive name modifier}} expected-note {{previous clause with directive name modifier specified here}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target
#pragma omp teams distribute parallel for simd if(distribute : argc) // expected-error {{directive name modifier 'distribute' is not allowed for '#pragma omp teams distribute parallel for simd'}}
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_lastprivate_codegen.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_lastprivate_codegen.cpp
index 4d21a05..1b02d0c 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_lastprivate_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_lastprivate_codegen.cpp
@@ -1,31 +1,31 @@
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
-// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
-// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
-// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
// SIMD-ONLY1-NOT: {{__kmpc|__tgt}}
// expected-no-diagnostics
#ifndef HEADER
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_lastprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_lastprivate_messages.cpp
index fe70da5..688211e 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_lastprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_lastprivate_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp-simd %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp-simd %s -Wno-openmp-mapping -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
@@ -100,6 +102,10 @@
for (int k = 0; k < argc; ++k) ++k;
#pragma omp target
+#pragma omp teams distribute parallel for simd lastprivate(conditional: argc) lastprivate(conditional: // expected-error 2 {{use of undeclared identifier 'conditional'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k) ++k;
+
+#pragma omp target
#pragma omp teams distribute parallel for simd lastprivate(S1) // expected-error {{'S1' does not refer to a value}}
for (int k = 0; k < argc; ++k) ++k;
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_linear_messages.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_linear_messages.cpp
index f79a998..f8b43cb 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_linear_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_linear_messages.cpp
@@ -3,6 +3,14 @@
// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
+void xxx(int argc) {
+ int i, step; // expected-note {{initialize the variable 'step' to silence this warning}}
+#pragma omp target
+#pragma omp teams distribute parallel for simd linear(i : step) // expected-warning {{variable 'step' is uninitialized when used here}}
+ for (i = 0; i < 10; ++i)
+ ;
+}
+
namespace X {
int x;
};
@@ -251,7 +259,7 @@
#pragma omp target
-#pragma omp teams distribute parallel for simd linear (a, b) // expected-error {{linear variable with incomplete type 'S1'}} expected-error {{argument of a linear clause should be of integral or pointer type, not 'S2'}} expected-error {{incomplete type 'S1' where a complete type is required}} expected-warning {{Non-trivial type 'const S2' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp teams distribute parallel for simd linear (a, b) // expected-error {{linear variable with incomplete type 'S1'}} expected-error {{argument of a linear clause should be of integral or pointer type, not 'S2'}} expected-error {{incomplete type 'S1' where a complete type is required}}
for (int k = 0; k < argc; ++k) ++k;
#pragma omp target
@@ -259,7 +267,7 @@
for (int k = 0; k < argc; ++k) ++k;
#pragma omp target
-#pragma omp teams distribute parallel for simd linear(e, g) // expected-error {{argument of a linear clause should be of integral or pointer type, not 'S4'}} expected-error {{argument of a linear clause should be of integral or pointer type, not 'S5'}} expected-warning {{Non-trivial type 'S4' is mapped, only trivial types are guaranteed to be mapped correctly}} expected-warning {{Non-trivial type 'S5' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp teams distribute parallel for simd linear(e, g) // expected-error {{argument of a linear clause should be of integral or pointer type, not 'S4'}} expected-error {{argument of a linear clause should be of integral or pointer type, not 'S5'}}
for (int k = 0; k < argc; ++k) ++k;
#pragma omp target
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_loop_messages.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_loop_messages.cpp
index 2fae965..0b2d462 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_loop_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_loop_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wuninitialized
class S {
int a;
@@ -109,32 +111,32 @@
#pragma omp target
#pragma omp teams distribute parallel for simd
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
for (int i = 0; i; i++)
c[i] = a[i];
#pragma omp target
#pragma omp teams distribute parallel for simd
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
// expected-error@+1 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'i'}}
for (int i = 0; jj < kk; ii++)
c[i] = a[i];
#pragma omp target
#pragma omp teams distribute parallel for simd
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
for (int i = 0; !!i; i++)
c[i] = a[i];
-// Ok
#pragma omp target
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
#pragma omp teams distribute parallel for simd
for (int i = 0; i != 1; i++)
c[i] = a[i];
#pragma omp target
#pragma omp teams distribute parallel for simd
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
for (int i = 0;; i++)
c[i] = a[i];
@@ -288,14 +290,14 @@
c[ii] = a[ii];
#pragma omp target
-#pragma omp teams distribute parallel for simd private(ii) // expected-note {{defined as private}}
-// expected-error@+1 {{loop iteration variable in the associated loop of 'omp teams distribute parallel for simd' directive may not be private, predetermined as linear}}
+#pragma omp teams distribute parallel for simd private(ii) // omp4-note {{defined as private}}
+// omp4-error@+1 {{loop iteration variable in the associated loop of 'omp teams distribute parallel for simd' directive may not be private, predetermined as linear}}
for (ii = 0; ii < 10; ii++)
c[ii] = a[ii];
#pragma omp target
-#pragma omp teams distribute parallel for simd lastprivate(ii) // expected-note {{defined as lastprivate}}
-// expected-error@+1 {{loop iteration variable in the associated loop of 'omp teams distribute parallel for simd' directive may not be lastprivate, predetermined as linear}}
+#pragma omp teams distribute parallel for simd lastprivate(ii) // omp4-note {{defined as lastprivate}}
+// omp4-error@+1 {{loop iteration variable in the associated loop of 'omp teams distribute parallel for simd' directive may not be lastprivate, predetermined as linear}}
for (ii = 0; ii < 10; ii++)
c[ii] = a[ii];
@@ -315,7 +317,7 @@
#pragma omp target
#pragma omp teams distribute parallel for simd
-// expected-error@+1 {{statement after '#pragma omp teams distribute parallel for simd' must be a for loop}}
+// omp4-error@+1 {{statement after '#pragma omp teams distribute parallel for simd' must be a for loop}}
for (auto &item : a) {
item = item + 1;
}
@@ -414,7 +416,7 @@
Iter0 begin0, end0;
#pragma omp target
#pragma omp teams distribute parallel for simd
- for (GoodIter I = begin; I < end; ++I) // expected-warning 2 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (GoodIter I = begin; I < end; ++I) // expected-warning 2 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
#pragma omp target
#pragma omp teams distribute parallel for simd
@@ -423,31 +425,31 @@
++I;
#pragma omp target
#pragma omp teams distribute parallel for simd
- for (GoodIter I = begin; I >= end; --I) // expected-warning 2 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (GoodIter I = begin; I >= end; --I) // expected-warning 2 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
#pragma omp target
#pragma omp teams distribute parallel for simd
// expected-warning@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
- for (GoodIter I(begin); I < end; ++I) // expected-warning 2 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (GoodIter I(begin); I < end; ++I) // expected-warning 2 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
#pragma omp target
#pragma omp teams distribute parallel for simd
// expected-warning@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
- for (GoodIter I(nullptr); I < end; ++I) // expected-warning {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (GoodIter I(nullptr); I < end; ++I) // expected-warning {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
#pragma omp target
#pragma omp teams distribute parallel for simd
// expected-warning@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
- for (GoodIter I(0); I < end; ++I) // expected-warning {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (GoodIter I(0); I < end; ++I) // expected-warning {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
#pragma omp target
#pragma omp teams distribute parallel for simd
// expected-warning@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
- for (GoodIter I(1, 2); I < end; ++I) // expected-warning {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (GoodIter I(1, 2); I < end; ++I) // expected-warning {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
#pragma omp target
#pragma omp teams distribute parallel for simd
- for (begin = GoodIter(0); begin < end; ++begin) // expected-warning 2 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (begin = GoodIter(0); begin < end; ++begin) // expected-warning 2 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++begin;
#pragma omp target
#pragma omp teams distribute parallel for simd
@@ -462,21 +464,21 @@
++begin;
#pragma omp target
#pragma omp teams distribute parallel for simd
- for (begin = end; begin < end; ++begin) // expected-warning 2 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (begin = end; begin < end; ++begin) // expected-warning 2 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++begin;
#pragma omp target
#pragma omp teams distribute parallel for simd
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
for (GoodIter I = begin; I - I; ++I)
++I;
#pragma omp target
#pragma omp teams distribute parallel for simd
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
for (GoodIter I = begin; begin < end; ++I)
++I;
#pragma omp target
#pragma omp teams distribute parallel for simd
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
for (GoodIter I = begin; !I; ++I)
++I;
#pragma omp target
@@ -487,7 +489,7 @@
++I;
#pragma omp target
#pragma omp teams distribute parallel for simd
- for (GoodIter I = begin; I >= end; I = I - 1) // expected-warning 2 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (GoodIter I = begin; I >= end; I = I - 1) // expected-warning 2 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
#pragma omp target
#pragma omp teams distribute parallel for simd
@@ -549,19 +551,19 @@
#pragma omp teams distribute parallel for simd
// expected-note@+2 {{loop step is expected to be positive due to this condition}}
// expected-error@+1 {{increment expression must cause 'I' to increase on each iteration of OpenMP for loop}}
- for (IT I = begin; I < end; I = I + ST) { // expected-warning 2 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (IT I = begin; I < end; I = I + ST) { // expected-warning 2 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
}
#pragma omp target
#pragma omp teams distribute parallel for simd
// expected-note@+2 {{loop step is expected to be positive due to this condition}}
// expected-error@+1 {{increment expression must cause 'I' to increase on each iteration of OpenMP for loop}}
- for (IT I = begin; I <= end; I += ST) { // expected-warning 2 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (IT I = begin; I <= end; I += ST) { // expected-warning 2 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
}
#pragma omp target
#pragma omp teams distribute parallel for simd
- for (IT I = begin; I < end; ++I) { // expected-warning 4 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (IT I = begin; I < end; ++I) { // expected-warning 4 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
}
}
@@ -597,7 +599,7 @@
#pragma omp target
#pragma omp teams distribute parallel for simd
- for (IT I = begin; I < end; I += TC<int, ST>::step()) { // expected-warning 2 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (IT I = begin; I < end; I += TC<int, ST>::step()) { // expected-warning 2 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
}
}
@@ -697,7 +699,7 @@
S s(4);
// expected-error@+2 {{lastprivate variable cannot be firstprivate}} expected-note@+2 {{defined as lastprivate}}
#pragma omp target
-#pragma omp teams distribute parallel for simd lastprivate(s) firstprivate(s) // expected-error {{calling a private constructor of class 'S'}} expected-warning {{Non-trivial type 'S' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp teams distribute parallel for simd lastprivate(s) firstprivate(s) // expected-error {{calling a private constructor of class 'S'}} expected-warning {{Type 'S' is not trivially copyable and not guaranteed to be mapped correctly}}
for (int i = 0; i < 16; ++i)
;
}
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_messages.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_messages.cpp
index e01b3f1..c043704 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -verify=expected,omp45 -std=c++11 %s -Wuninitialized
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -verify=expected,omp50 -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -verify=expected,omp45 -std=c++11 %s -Wuninitialized
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -verify=expected,omp50 -std=c++11 %s -Wuninitialized
void xxx(int argc) {
int x; // expected-note {{initialize the variable 'x' to silence this warning}}
@@ -120,3 +122,104 @@
;
}
+void test_nontemporal() {
+ int i;
+#pragma omp target
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp teams distribute parallel for simd'}} expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp teams distribute parallel for simd nontemporal(
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp target
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp teams distribute parallel for simd'}} expected-error@+1 2 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp teams distribute parallel for simd nontemporal(,
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp target
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp teams distribute parallel for simd'}} expected-error@+1 2 {{expected expression}}
+#pragma omp teams distribute parallel for simd nontemporal(, )
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp target
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp teams distribute parallel for simd'}} expected-error@+1 {{expected expression}}
+#pragma omp teams distribute parallel for simd nontemporal()
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp target
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp teams distribute parallel for simd'}} expected-error@+1 {{expected '(' for function-style cast or type construction}}
+#pragma omp teams distribute parallel for simd nontemporal(int)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp target
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp teams distribute parallel for simd'}} omp50-error@+1 {{expected variable name}}
+#pragma omp teams distribute parallel for simd nontemporal(0)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp target
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp teams distribute parallel for simd'}} expected-error@+1 {{use of undeclared identifier 'x'}}
+#pragma omp teams distribute parallel for simd nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp target
+// expected-error@+2 {{use of undeclared identifier 'x'}}
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp teams distribute parallel for simd'}} expected-error@+1 {{use of undeclared identifier 'y'}}
+#pragma omp teams distribute parallel for simd nontemporal(x, y)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp target
+// expected-error@+3 {{use of undeclared identifier 'x'}}
+// expected-error@+2 {{use of undeclared identifier 'y'}}
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp teams distribute parallel for simd'}} expected-error@+1 {{use of undeclared identifier 'z'}}
+#pragma omp teams distribute parallel for simd nontemporal(x, y, z)
+ for (i = 0; i < 16; ++i)
+ ;
+
+ int x, y;
+#pragma omp target
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp teams distribute parallel for simd'}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp teams distribute parallel for simd nontemporal(x :)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp target
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp teams distribute parallel for simd'}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}}
+#pragma omp teams distribute parallel for simd nontemporal(x :, )
+ for (i = 0; i < 16; ++i)
+ ;
+
+#pragma omp target
+// omp50-note@+2 {{defined as nontemporal}}
+// omp45-error@+1 2 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp teams distribute parallel for simd'}} omp50-error@+1 {{a variable cannot appear in more than one nontemporal clause}}
+#pragma omp teams distribute parallel for simd nontemporal(x) nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+#pragma omp target
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp teams distribute parallel for simd'}}
+#pragma omp teams distribute parallel for simd private(x) nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+#pragma omp target
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp teams distribute parallel for simd'}}
+#pragma omp teams distribute parallel for simd nontemporal(x) private(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+#pragma omp target
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp teams distribute parallel for simd'}} expected-note@+1 {{to match this '('}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}} expected-error@+1 {{expected ')'}}
+#pragma omp teams distribute parallel for simd nontemporal(x, y : 0)
+ for (i = 0; i < 16; ++i)
+ ;
+
+#pragma omp target
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp teams distribute parallel for simd'}}
+#pragma omp teams distribute parallel for simd nontemporal(x) lastprivate(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+#pragma omp target
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp teams distribute parallel for simd'}}
+#pragma omp teams distribute parallel for simd lastprivate(x) nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+}
+
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_reduction_messages.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_reduction_messages.cpp
index feb3128..0979747 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_reduction_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_reduction_messages.cpp
@@ -1,12 +1,20 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wno-openmp-mapping -Wuninitialized
extern int omp_default_mem_alloc;
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp target
+#pragma omp teams distribute parallel for simd reduction(+:fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
void foo() {
}
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_shared_messages.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_shared_messages.cpp
index 2eefa1e..3cb11fb 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_shared_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_parallel_for_simd_shared_messages.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-mapping -Wuninitialized
void foo() {
}
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_reduction_messages.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_reduction_messages.cpp
index 9e1ed32..c297788 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_reduction_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_reduction_messages.cpp
@@ -1,12 +1,20 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wno-openmp-mapping -Wuninitialized
extern int omp_default_mem_alloc;
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp target
+#pragma omp teams distribute reduction(+:fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
void foo() {
}
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_shared_messages.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_shared_messages.cpp
index 452d017..cb78f79 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_shared_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_shared_messages.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-mapping -Wuninitialized
void foo() {
}
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_aligned_messages.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_aligned_messages.cpp
index 955a2b5..fa1f290 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_aligned_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_aligned_messages.cpp
@@ -253,7 +253,7 @@
for (int k = 0; k < argc; ++k) ++k;
#pragma omp target
-#pragma omp teams distribute simd aligned (a, b) // expected-error {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'S1'}} expected-error {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'S2'}} expected-error {{incomplete type 'S1' where a complete type is required}} expected-warning {{Non-trivial type 'const S2' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp teams distribute simd aligned (a, b) // expected-error {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'S1'}} expected-error {{argument of aligned clause should be array, pointer, reference to array or reference to pointer, not 'S2'}} expected-error {{incomplete type 'S1' where a complete type is required}}
for (int k = 0; k < argc; ++k) ++k;
#pragma omp target
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_ast_print.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_ast_print.cpp
index aa11622..b93cd49 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_ast_print.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_ast_print.cpp
@@ -1,10 +1,16 @@
-// RUN: %clang_cc1 -verify -fopenmp -ast-print %s -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45
// 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 -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -fopenmp -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -DOMP5 -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -DOMP5 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50
-// RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -emit-pch -o %t %s
-// RUN: %clang_cc1 -fopenmp-simd -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-target | FileCheck %s
+// RUN: %clang_cc1 -fopenmp-simd -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP45
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -ast-print %s -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -emit-pch -o %t %s
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -DOMP5 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print -Wno-openmp-mapping | FileCheck %s --check-prefix=CHECK --check-prefix=OMP50
// expected-no-diagnostics
#ifndef HEADER
@@ -53,7 +59,11 @@
const int slen1 = 8;
const int slen2 = 8;
#pragma omp target
+#ifdef OMP5
+#pragma omp teams distribute simd simdlen(slen1) safelen(slen2) aligned(arr:alen) if(arr[0])
+#else
#pragma omp teams distribute simd simdlen(slen1) safelen(slen2) aligned(arr:alen)
+#endif // OMP5
for (int k = 0; k < a.a; ++k)
++a.a;
}
@@ -65,7 +75,8 @@
// CHECK: #pragma omp target
// CHECK-NEXT: #pragma omp teams distribute simd default(none) private(b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(f) thread_limit(d)
// CHECK: #pragma omp target
-// CHECK-NEXT: #pragma omp teams distribute simd simdlen(slen1) safelen(slen2) aligned(arr: alen)
+// OMP45-NEXT: #pragma omp teams distribute simd simdlen(slen1) safelen(slen2) aligned(arr: alen)
+// OMP50-NEXT: #pragma omp teams distribute simd simdlen(slen1) safelen(slen2) aligned(arr: alen) if(arr[0])
// CHECK: #pragma omp target
// CHECK-NEXT: #pragma omp teams distribute simd private(this->a) private(this->a) private(this->S::a)
@@ -150,7 +161,7 @@
// CHECK: #pragma omp target
// CHECK-NEXT: #pragma omp teams distribute simd
// CHECK-NEXT: for (int i = 0; i < 10; ++i)
-// CHECK-NEXT: foo();
+// CHECK-NEXT: foo();
#pragma omp target
#pragma omp teams distribute simd default(none), private(b) firstprivate(argc) shared(d) reduction(+:c) reduction(max:e) num_teams(f) thread_limit(d)
for (int k = 0; k < 10; ++k)
@@ -231,11 +242,16 @@
// CHECK-NEXT: for (int k = 0; k < 10; ++k)
// CHECK-NEXT: e += d + argc;
#pragma omp target
+#ifdef OMP5
+#pragma omp teams distribute simd safelen(clen-1) aligned(arr:N+6) if(simd:b) nontemporal(argc, c, d)
+#else
#pragma omp teams distribute simd safelen(clen-1) aligned(arr:N+6)
+#endif
for (int k = 0; k < 10; ++k)
e += d + argc + arr[k];
// CHECK: #pragma omp target
-// CHECK-NEXT: #pragma omp teams distribute simd safelen(clen - 1) aligned(arr: N + 6)
+// OMP45-NEXT: #pragma omp teams distribute simd safelen(clen - 1) aligned(arr: N + 6)
+// OMP50-NEXT: #pragma omp teams distribute simd safelen(clen - 1) aligned(arr: N + 6) if(simd: b) nontemporal(argc,c,d)
// CHECK-NEXT: for (int k = 0; k < 10; ++k)
// CHECK-NEXT: e += d + argc + arr[k];
return (0);
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_codegen.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_codegen.cpp
index ab14828..63dd237 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_codegen.cpp
@@ -30,15 +30,12 @@
// CK1: alloca i32,
// CK1: [[TE:%.+]] = alloca i32,
// CK1: [[TH:%.+]] = alloca i32,
- // CK1: alloca i32,
- // CK1: alloca i32,
- // CK1: alloca i32,
// CK1: [[TE_CAST:%.+]] = alloca i{{32|64}},
// CK1: [[TH_CAST:%.+]] = alloca i{{32|64}},
- // CK1: call void @__kmpc_push_target_tripcount(i64 -1, i64 %{{.+}})
// CK1: [[TE_PAR:%.+]] = load{{.+}}, {{.+}} [[TE_CAST]],
// CK1: [[TH_PAR:%.+]] = load{{.+}}, {{.+}} [[TH_CAST]],
+ // CK1: call void @__kmpc_push_target_tripcount(i64 -1, i64 %{{.+}})
// CK1: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 5, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 {{.+}}, i32 1)
// CK1: call void @[[OFFL1:.+]](i{{32|64}} [[TE_PAR]], i{{32|64}} [[TH_PAR]],
@@ -143,12 +140,18 @@
#endif // CK2
// Test host codegen.
-// RUN: %clang_cc1 -DCK3 -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix CK3 --check-prefix CK3-64
+// RUN: %clang_cc1 -DCK3 -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix CK3 --check-prefix CK3-64 --check-prefix OMP3_45
// RUN: %clang_cc1 -DCK3 -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -DCK3 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CK3 --check-prefix CK3-64
-// RUN: %clang_cc1 -DCK3 -verify -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix CK3 --check-prefix CK3-32
+// RUN: %clang_cc1 -DCK3 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CK3 --check-prefix CK3-64 --check-prefix OMP3_45
+// RUN: %clang_cc1 -DCK3 -verify -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix CK3 --check-prefix CK3-32 --check-prefix OMP3_45
// RUN: %clang_cc1 -DCK3 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -DCK3 -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CK3 --check-prefix CK3-32
+// RUN: %clang_cc1 -DCK3 -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CK3 --check-prefix CK3-32 --check-prefix OMP3_45
+// RUN: %clang_cc1 -DCK3 -verify -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix CK3 --check-prefix CK3-64 --check-prefix OMP3_50
+// RUN: %clang_cc1 -DCK3 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
+// RUN: %clang_cc1 -DCK3 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CK3 --check-prefix CK3-64 -check-prefix OMP3_50
+// RUN: %clang_cc1 -DCK3 -verify -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix CK3 --check-prefix CK3-32 -check-prefix OMP3_50
+// RUN: %clang_cc1 -DCK3 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
+// RUN: %clang_cc1 -DCK3 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CK3 --check-prefix CK3-32 -check-prefix OMP3_50
// RUN: %clang_cc1 -DCK3 -verify -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY2 %s
// RUN: %clang_cc1 -DCK3 -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
@@ -156,6 +159,12 @@
// RUN: %clang_cc1 -DCK3 -verify -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY2 %s
// RUN: %clang_cc1 -DCK3 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
// RUN: %clang_cc1 -DCK3 -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY2 %s
+// RUN: %clang_cc1 -DCK3 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY2 %s
+// RUN: %clang_cc1 -DCK3 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
+// RUN: %clang_cc1 -DCK3 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY2 %s
+// RUN: %clang_cc1 -DCK3 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY2 %s
+// RUN: %clang_cc1 -DCK3 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
+// RUN: %clang_cc1 -DCK3 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY2 %s
// SIMD-ONLY2-NOT: {{__kmpc|__tgt}}
#ifdef CK3
@@ -168,21 +177,28 @@
// CK3: define {{.*}}i32 @{{.+}}foo{{.+}}(
int foo(void) {
- // CK3: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 1, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 1)
+ // CK3: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 3, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* %{{.+}}, i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 1)
// CK3: call void @[[OFFL1:.+]]([[SSI]]* %{{.+}})
#pragma omp target
+#ifdef OMP5
+ #pragma omp teams distribute simd if(b) nontemporal(a, b)
+#else
#pragma omp teams distribute simd
+#endif // OMP5
for(int i = 0; i < X; i++) {
- a[i] = (T)0;
+ a[i] = (T)b;
}
// outlined target region
// CK3: define internal void @[[OFFL1]]([[SSI]]* {{.+}})
- // CK3: call void {{.+}} @__kmpc_fork_teams({{.+}}, i32 1, {{.+}} @[[OUTL1:.+]] to {{.+}}, {{.+}}, {{.+}})
+ // OMP3_45: call void {{.+}} @__kmpc_fork_teams({{.+}}, i32 1, {{.+}} @[[OUTL1:.+]] to {{.+}}, {{.+}}, {{.+}})
+ // OMP3_50: call void {{.+}} @__kmpc_fork_teams({{.+}}, i32 2, {{.+}} @[[OUTL1:.+]] to {{.+}}, {{.+}}, {{.+}}, {{.+}})
// CK3: ret void
// CK3: define internal void @[[OUTL1]]({{.+}})
// CK3: call void @__kmpc_for_static_init_4(
+ // OMP3_45-NOT: !nontemporal
+ // OMP3_50: load float,{{.*}}!nontemporal
// CK3: call void @__kmpc_for_static_fini(
// CK3: ret void
@@ -195,16 +211,24 @@
return V.foo();
}
-// CK3: !{!"llvm.loop.vectorize.enable", i1 true}
+// CK3-DAG: !{!"llvm.loop.vectorize.enable", i1 true}
+// OMP3_45-NOT: !{!"llvm.loop.vectorize.enable", i1 false}
+// OMP3_50-DAG: !{!"llvm.loop.vectorize.enable", i1 false}
#endif // CK3
// Test host codegen.
-// RUN: %clang_cc1 -DCK4 -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix CK4 --check-prefix CK4-64
+// RUN: %clang_cc1 -DCK4 -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix CK4 --check-prefix CK4-64 --check-prefix OMP4_45
// RUN: %clang_cc1 -DCK4 -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -DCK4 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CK4 --check-prefix CK4-64
-// RUN: %clang_cc1 -DCK4 -verify -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix CK4 --check-prefix CK4-32
+// RUN: %clang_cc1 -DCK4 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CK4 --check-prefix CK4-64 --check-prefix OMP4_45
+// RUN: %clang_cc1 -DCK4 -verify -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix CK4 --check-prefix CK4-32 --check-prefix OMP4_45
// RUN: %clang_cc1 -DCK4 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
-// RUN: %clang_cc1 -DCK4 -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CK4 --check-prefix CK4-32
+// RUN: %clang_cc1 -DCK4 -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CK4 --check-prefix CK4-32 --check-prefix OMP4_45
+// RUN: %clang_cc1 -DCK4 -verify -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix CK4 --check-prefix CK4-64 --check-prefix OMP4_50
+// RUN: %clang_cc1 -DCK4 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
+// RUN: %clang_cc1 -DCK4 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp -fopenmp-version=50 -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CK4 --check-prefix CK4-64 --check-prefix OMP4_50
+// RUN: %clang_cc1 -DCK4 -verify -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix CK4 --check-prefix CK4-32 --check-prefix OMP4_50
+// RUN: %clang_cc1 -DCK4 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
+// RUN: %clang_cc1 -DCK4 -fopenmp -fopenmp-version=50 -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp -fopenmp-version=50 -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix CK4 --check-prefix CK4-32 --check-prefix OMP4_50
// RUN: %clang_cc1 -DCK4 -verify -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY3 %s
// RUN: %clang_cc1 -DCK4 -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
@@ -212,6 +236,12 @@
// RUN: %clang_cc1 -DCK4 -verify -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY3 %s
// RUN: %clang_cc1 -DCK4 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
// RUN: %clang_cc1 -DCK4 -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY3 %s
+// RUN: %clang_cc1 -DCK4 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY3 %s
+// RUN: %clang_cc1 -DCK4 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
+// RUN: %clang_cc1 -DCK4 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY3 %s
+// RUN: %clang_cc1 -DCK4 -verify -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY3 %s
+// RUN: %clang_cc1 -DCK4 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
+// RUN: %clang_cc1 -DCK4 -fopenmp-simd -fopenmp-version=50 -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY3 %s
// SIMD-ONLY3-NOT: {{__kmpc|__tgt}}
#ifdef CK4
@@ -233,7 +263,11 @@
int n = 100;
int a[n];
#pragma omp target
+#ifdef OMP5
+#pragma omp teams distribute simd if(simd:argc)
+#else
#pragma omp teams distribute simd
+#endif // OMP5
for(int i = 0; i < n; i++) {
a[i] = 0;
}
@@ -241,13 +275,15 @@
}
// CK4: define {{.*}}i32 @{{[^,]+}}(i{{.+}}{{.+}} %[[ARGC:.+]], {{.+}})
-// CK4: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 3, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}, i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 1)
+// OMP4_45: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 3, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}, i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 1)
+// OMP4_50: call i32 @__tgt_target_teams(i64 -1, i8* @{{[^,]+}}, i32 4, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}, i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i32 0, i32 1)
// CK4: call void @[[OFFL1:.+]]({{.+}})
// CK4: {{%.+}} = call{{.*}} i32 @[[TMAIN:.+]]({{.+}})
// CK4: ret
// CK4: define {{.*}}void @[[OFFL1]]({{.+}})
-// CK4: call void {{.+}} @__kmpc_fork_teams({{.+}}, i32 3, {{.+}} @[[OUTL1:.+]] to {{.+}}, {{.+}}, {{.+}})
+// OMP4_45: call void {{.+}} @__kmpc_fork_teams({{.+}}, i32 3, {{.+}} @[[OUTL1:.+]] to {{.+}}, {{.+}}, {{.+}})
+// OMP4_50: call void {{.+}} @__kmpc_fork_teams({{.+}}, i32 4, {{.+}} @[[OUTL1:.+]] to {{.+}}, {{.+}}, {{.+}})
// CK4: ret void
// CK4: define internal void @[[OUTL1]]({{.+}})
@@ -281,7 +317,9 @@
// CK4: call void @__kmpc_for_static_fini(
// CK4: ret void
-// CK4: !{!"llvm.loop.vectorize.enable", i1 true}
+// CK4-DAG: !{!"llvm.loop.vectorize.enable", i1 true}
+// OMP4_45-NOT: !{!"llvm.loop.vectorize.enable", i1 false}
+// OMP5_50-DAG: !{!"llvm.loop.vectorize.enable", i1 false}
#endif // CK4
#endif
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_firstprivate_codegen.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_firstprivate_codegen.cpp
index f76e2c7..293af42 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_firstprivate_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_firstprivate_codegen.cpp
@@ -1,25 +1,25 @@
-// RUN: %clang_cc1 -DCHECK -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-64
-// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-64
-// RUN: %clang_cc1 -DCHECK -verify -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-32
-// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-32
+// RUN: %clang_cc1 -DCHECK -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-64
+// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-64
+// RUN: %clang_cc1 -DCHECK -verify -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-32
+// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-32
-// RUN: %clang_cc1 -DCHECK -verify -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -DCHECK -verify -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DCHECK -verify -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DCHECK -verify -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck -allow-deprecated-dag-overlap %s --check-prefix LAMBDA --check-prefix LAMBDA-64
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck -allow-deprecated-dag-overlap %s --check-prefix LAMBDA --check-prefix LAMBDA-64
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck -allow-deprecated-dag-overlap %s --check-prefix LAMBDA --check-prefix LAMBDA-64
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck -allow-deprecated-dag-overlap %s --check-prefix LAMBDA --check-prefix LAMBDA-64
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY1 %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY1 %s
// SIMD-ONLY1-NOT: {{__kmpc|__tgt}}
// expected-no-diagnostics
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_firstprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_firstprivate_messages.cpp
index f981896..23eeb5e 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_firstprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_firstprivate_messages.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-mapping -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
@@ -10,6 +10,14 @@
return argc;
}
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp target
+#pragma omp teams distribute simd firstprivate(fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
struct S1; // expected-note {{declared here}} expected-note{{forward declaration of 'S1'}}
extern S1 a;
class S2 {
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_if_messages.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_if_messages.cpp
new file mode 100644
index 0000000..a35a8df
--- /dev/null
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_if_messages.cpp
@@ -0,0 +1,101 @@
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 %s -Wuninitialized
+
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 %s -Wuninitialized
+
+void foo() {
+}
+
+bool foobool(int argc) {
+ return argc;
+}
+
+void xxx(int argc) {
+ int cond; // expected-note {{initialize the variable 'cond' to silence this warning}}
+#pragma omp teams distribute simd if(cond) // expected-warning {{variable 'cond' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
+struct S1; // expected-note {{declared here}}
+
+template <class T, class S> // expected-note {{declared here}}
+int tmain(T argc, S **argv) {
+ T z;
+ int i;
+ #pragma omp teams distribute simd if // expected-error {{expected '(' after 'if'}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams distribute simd if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams distribute simd if () // expected-error {{expected expression}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams distribute simd if (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams distribute simd if (argc)) // expected-warning {{extra tokens at the end of '#pragma omp teams distribute simd' are ignored}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams distribute simd if (argc > 0 ? argv[1] : argv[2])
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams distribute simd if (foobool(argc)), if (true) // expected-error {{directive '#pragma omp teams distribute simd' cannot contain more than one 'if' clause}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams distribute simd if (S) // expected-error {{'S' does not refer to a value}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams distribute simd if (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams distribute simd if (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams distribute simd if(argc + z)
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams distribute simd if(simd : // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams distribute simd if(simd : argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams distribute simd if(simd : argc)
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams distribute simd if(target : argc) // expected-error {{directive name modifier 'target' is not allowed for '#pragma omp teams distribute simd'}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams distribute simd if(simd : argc) if (simd :argc) // expected-error {{directive '#pragma omp teams distribute simd' cannot contain more than one 'if' clause with 'simd' name modifier}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams distribute simd if(simd : argc) if (argc) // expected-note {{previous clause with directive name modifier specified here}} expected-error {{no more 'if' clause is allowed}}
+ for (i = 0; i < argc; ++i) foo();
+
+ return 0;
+}
+
+int main(int argc, char **argv) {
+ int i, z;
+ #pragma omp teams distribute simd if // expected-error {{expected '(' after 'if'}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams distribute simd if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams distribute simd if () // expected-error {{expected expression}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams distribute simd if (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams distribute simd if (argc)) // expected-warning {{extra tokens at the end of '#pragma omp teams distribute simd' are ignored}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams distribute simd if (argc > 0 ? argv[1] : argv[2])
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams distribute simd if (foobool(argc)), if (true) // expected-error {{directive '#pragma omp teams distribute simd' cannot contain more than one 'if' clause}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams distribute simd if (S1) // expected-error {{'S1' does not refer to a value}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams distribute simd if (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams distribute simd if (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams distribute simd if (1 0) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams distribute simd if(if(tmain(argc, argv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams distribute simd if(simd : // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams distribute simd if(simd : argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams distribute simd if(simd : argc + z) if (for:argc) // expected-error {{directive name modifier 'for' is not allowed for '#pragma omp teams distribute simd'}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams distribute simd if(simd : argc) if (simd :argc) // expected-error {{directive '#pragma omp teams distribute simd' cannot contain more than one 'if' clause with 'simd' name modifier}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp teams distribute simd if(simd : argc) if (argc) // expected-note {{previous clause with directive name modifier specified here}} expected-error {{no more 'if' clause is allowed}}
+ for (i = 0; i < argc; ++i) foo();
+
+ return tmain(argc, argv);
+}
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_lastprivate_codegen.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_lastprivate_codegen.cpp
index c7b507f..9f7a186 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_lastprivate_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_lastprivate_codegen.cpp
@@ -1,31 +1,31 @@
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
-// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target| FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
-// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping| FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
-// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
// SIMD-ONLY1-NOT: {{__kmpc|__tgt}}
// expected-no-diagnostics
#ifndef HEADER
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_lastprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_lastprivate_messages.cpp
index bad64fa..77052bf 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_lastprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_lastprivate_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp-simd %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp-simd %s -Wno-openmp-mapping -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
@@ -104,6 +106,10 @@
for (int k = 0; k < argc; ++k) ++k;
#pragma omp target
+#pragma omp teams distribute simd lastprivate(conditional: argc) lastprivate(conditional: // expected-error 2 {{use of undeclared identifier 'conditional'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (int k = 0; k < argc; ++k) ++k;
+
+#pragma omp target
#pragma omp teams distribute simd lastprivate(k, a, b) // expected-error {{lastprivate variable with incomplete type 'S1'}}
for (int k = 0; k < argc; ++k) ++k;
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_linear_messages.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_linear_messages.cpp
index 601d4dd..4026036 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_linear_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_linear_messages.cpp
@@ -3,6 +3,14 @@
// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
+void xxx(int argc) {
+ int i, step; // expected-note {{initialize the variable 'step' to silence this warning}}
+#pragma omp target
+#pragma omp teams distribute simd linear(i : step) // expected-warning {{variable 'step' is uninitialized when used here}}
+ for (i = 0; i < 10; ++i)
+ ;
+}
+
namespace X {
int x;
};
@@ -251,7 +259,7 @@
#pragma omp target
-#pragma omp teams distribute simd linear (a, b) // expected-error {{incomplete type 'S1' where a complete type is required}} expected-error {{linear variable with incomplete type 'S1'}} expected-error {{argument of a linear clause should be of integral or pointer type, not 'S2'}} expected-warning {{Non-trivial type 'const S2' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp teams distribute simd linear (a, b) // expected-error {{incomplete type 'S1' where a complete type is required}} expected-error {{linear variable with incomplete type 'S1'}} expected-error {{argument of a linear clause should be of integral or pointer type, not 'S2'}}
for (int k = 0; k < argc; ++k) ++k;
#pragma omp target
@@ -259,7 +267,7 @@
for (int k = 0; k < argc; ++k) ++k;
#pragma omp target
-#pragma omp teams distribute simd linear(e, g) // expected-error {{argument of a linear clause should be of integral or pointer type, not 'S4'}} expected-error {{argument of a linear clause should be of integral or pointer type, not 'S5'}} expected-warning {{Non-trivial type 'S4' is mapped, only trivial types are guaranteed to be mapped correctly}} expected-warning {{Non-trivial type 'S5' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp teams distribute simd linear(e, g) // expected-error {{argument of a linear clause should be of integral or pointer type, not 'S4'}} expected-error {{argument of a linear clause should be of integral or pointer type, not 'S5'}}
for (int k = 0; k < argc; ++k) ++k;
#pragma omp target
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_loop_messages.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_loop_messages.cpp
index c463560..7ab32c9 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_loop_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_loop_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wuninitialized
class S {
int a;
@@ -109,32 +111,32 @@
#pragma omp target
#pragma omp teams distribute simd
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
for (int i = 0; i; i++)
c[i] = a[i];
#pragma omp target
#pragma omp teams distribute simd
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
// expected-error@+1 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'i'}}
for (int i = 0; jj < kk; ii++)
c[i] = a[i];
#pragma omp target
#pragma omp teams distribute simd
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
for (int i = 0; !!i; i++)
c[i] = a[i];
#pragma omp target
#pragma omp teams distribute simd
-// Ok
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
for (int i = 0; i != 1; i++)
c[i] = a[i];
#pragma omp target
#pragma omp teams distribute simd
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
for (int i = 0;; i++)
c[i] = a[i];
@@ -288,14 +290,14 @@
c[ii] = a[ii];
#pragma omp target
-#pragma omp teams distribute simd private(ii) // expected-note {{defined as private}}
-// expected-error@+1 {{loop iteration variable in the associated loop of 'omp teams distribute simd' directive may not be private, predetermined as linear}}
+#pragma omp teams distribute simd private(ii) // omp4-note {{defined as private}}
+// omp4-error@+1 {{loop iteration variable in the associated loop of 'omp teams distribute simd' directive may not be private, predetermined as linear}}
for (ii = 0; ii < 10; ii++)
c[ii] = a[ii];
#pragma omp target
-#pragma omp teams distribute simd lastprivate(ii) // expected-note {{defined as lastprivate}}
-// expected-error@+1 {{loop iteration variable in the associated loop of 'omp teams distribute simd' directive may not be lastprivate, predetermined as linear}}
+#pragma omp teams distribute simd lastprivate(ii) // omp4-note {{defined as lastprivate}}
+// omp4-error@+1 {{loop iteration variable in the associated loop of 'omp teams distribute simd' directive may not be lastprivate, predetermined as linear}}
for (ii = 0; ii < 10; ii++)
c[ii] = a[ii];
@@ -315,7 +317,7 @@
#pragma omp target
#pragma omp teams distribute simd
-// expected-error@+1 {{statement after '#pragma omp teams distribute simd' must be a for loop}}
+// omp4-error@+1 {{statement after '#pragma omp teams distribute simd' must be a for loop}}
for (auto &item : a) {
item = item + 1;
}
@@ -414,7 +416,7 @@
Iter0 begin0, end0;
#pragma omp target
#pragma omp teams distribute simd
- for (GoodIter I = begin; I < end; ++I) // expected-warning 2 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (GoodIter I = begin; I < end; ++I) // expected-warning 2 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
#pragma omp target
#pragma omp teams distribute simd
@@ -423,31 +425,31 @@
++I;
#pragma omp target
#pragma omp teams distribute simd
- for (GoodIter I = begin; I >= end; --I) // expected-warning 2 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (GoodIter I = begin; I >= end; --I) // expected-warning 2 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
#pragma omp target
#pragma omp teams distribute simd
// expected-warning@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
- for (GoodIter I(begin); I < end; ++I) // expected-warning 2 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (GoodIter I(begin); I < end; ++I) // expected-warning 2 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
#pragma omp target
#pragma omp teams distribute simd
// expected-warning@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
- for (GoodIter I(nullptr); I < end; ++I) // expected-warning {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (GoodIter I(nullptr); I < end; ++I) // expected-warning {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
#pragma omp target
#pragma omp teams distribute simd
// expected-warning@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
- for (GoodIter I(0); I < end; ++I) // expected-warning {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (GoodIter I(0); I < end; ++I) // expected-warning {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
#pragma omp target
#pragma omp teams distribute simd
// expected-warning@+1 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
- for (GoodIter I(1, 2); I < end; ++I) // expected-warning {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (GoodIter I(1, 2); I < end; ++I) // expected-warning {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
#pragma omp target
#pragma omp teams distribute simd
- for (begin = GoodIter(0); begin < end; ++begin) // expected-warning 2 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (begin = GoodIter(0); begin < end; ++begin) // expected-warning 2 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++begin;
#pragma omp target
#pragma omp teams distribute simd
@@ -462,21 +464,21 @@
++begin;
#pragma omp target
#pragma omp teams distribute simd
- for (begin = end; begin < end; ++begin) // expected-warning 2 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (begin = end; begin < end; ++begin) // expected-warning 2 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++begin;
#pragma omp target
#pragma omp teams distribute simd
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
for (GoodIter I = begin; I - I; ++I)
++I;
#pragma omp target
#pragma omp teams distribute simd
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
for (GoodIter I = begin; begin < end; ++I)
++I;
#pragma omp target
#pragma omp teams distribute simd
-// expected-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+1 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
for (GoodIter I = begin; !I; ++I)
++I;
#pragma omp target
@@ -487,7 +489,7 @@
++I;
#pragma omp target
#pragma omp teams distribute simd
- for (GoodIter I = begin; I >= end; I = I - 1) // expected-warning 2 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (GoodIter I = begin; I >= end; I = I - 1) // expected-warning 2 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
#pragma omp target
#pragma omp teams distribute simd
@@ -549,19 +551,19 @@
#pragma omp teams distribute simd
// expected-note@+2 {{loop step is expected to be positive due to this condition}}
// expected-error@+1 {{increment expression must cause 'I' to increase on each iteration of OpenMP for loop}}
- for (IT I = begin; I < end; I = I + ST) { // expected-warning 2 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (IT I = begin; I < end; I = I + ST) { // expected-warning 2 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
}
#pragma omp target
#pragma omp teams distribute simd
// expected-note@+2 {{loop step is expected to be positive due to this condition}}
// expected-error@+1 {{increment expression must cause 'I' to increase on each iteration of OpenMP for loop}}
- for (IT I = begin; I <= end; I += ST) { // expected-warning 2 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (IT I = begin; I <= end; I += ST) { // expected-warning 2 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
}
#pragma omp target
#pragma omp teams distribute simd
- for (IT I = begin; I < end; ++I) { // expected-warning 4 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (IT I = begin; I < end; ++I) { // expected-warning 4 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
}
}
@@ -597,7 +599,7 @@
#pragma omp target
#pragma omp teams distribute simd
- for (IT I = begin; I < end; I += TC<int, ST>::step()) { // expected-warning 2 {{Non-trivial type 'GoodIter' is mapped, only trivial types are guaranteed to be mapped correctly}}
+ for (IT I = begin; I < end; I += TC<int, ST>::step()) { // expected-warning 2 {{Type 'GoodIter' is not trivially copyable and not guaranteed to be mapped correctly}}
++I;
}
}
@@ -697,7 +699,7 @@
S s(4);
// expected-error@+2 {{lastprivate variable cannot be firstprivate}} expected-note@+2 {{defined as lastprivate}}
#pragma omp target
-#pragma omp teams distribute simd lastprivate(s) firstprivate(s) // expected-error {{calling a private constructor of class 'S'}} expected-warning {{Non-trivial type 'S' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp teams distribute simd lastprivate(s) firstprivate(s) // expected-error {{calling a private constructor of class 'S'}} expected-warning {{Type 'S' is not trivially copyable and not guaranteed to be mapped correctly}}
for (int i = 0; i < 16; ++i)
;
}
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_messages.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_messages.cpp
index 3ec2c87..52f8d24 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -verify=expected,omp45 -std=c++11 %s -Wuninitialized
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -verify=expected,omp50 -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -verify=expected,omp45 -std=c++11 %s -Wuninitialized
+// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -verify=expected,omp50 -std=c++11 %s -Wuninitialized
void xxx(int argc) {
int x; // expected-note {{initialize the variable 'x' to silence this warning}}
@@ -120,3 +122,104 @@
;
}
+void test_nontemporal() {
+ int i;
+#pragma omp target
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp teams distribute simd'}} expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp teams distribute simd nontemporal(
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp target
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp teams distribute simd'}} expected-error@+1 2 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp teams distribute simd nontemporal(,
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp target
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp teams distribute simd'}} expected-error@+1 2 {{expected expression}}
+#pragma omp teams distribute simd nontemporal(, )
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp target
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp teams distribute simd'}} expected-error@+1 {{expected expression}}
+#pragma omp teams distribute simd nontemporal()
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp target
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp teams distribute simd'}} expected-error@+1 {{expected '(' for function-style cast or type construction}}
+#pragma omp teams distribute simd nontemporal(int)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp target
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp teams distribute simd'}} omp50-error@+1 {{expected variable name}}
+#pragma omp teams distribute simd nontemporal(0)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp target
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp teams distribute simd'}} expected-error@+1 {{use of undeclared identifier 'x'}}
+#pragma omp teams distribute simd nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp target
+// expected-error@+2 {{use of undeclared identifier 'x'}}
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp teams distribute simd'}} expected-error@+1 {{use of undeclared identifier 'y'}}
+#pragma omp teams distribute simd nontemporal(x, y)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp target
+// expected-error@+3 {{use of undeclared identifier 'x'}}
+// expected-error@+2 {{use of undeclared identifier 'y'}}
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp teams distribute simd'}} expected-error@+1 {{use of undeclared identifier 'z'}}
+#pragma omp teams distribute simd nontemporal(x, y, z)
+ for (i = 0; i < 16; ++i)
+ ;
+
+ int x, y;
+#pragma omp target
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp teams distribute simd'}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
+#pragma omp teams distribute simd nontemporal(x :)
+ for (i = 0; i < 16; ++i)
+ ;
+#pragma omp target
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp teams distribute simd'}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}}
+#pragma omp teams distribute simd nontemporal(x :, )
+ for (i = 0; i < 16; ++i)
+ ;
+
+#pragma omp target
+// omp50-note@+2 {{defined as nontemporal}}
+// omp45-error@+1 2 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp teams distribute simd'}} omp50-error@+1 {{a variable cannot appear in more than one nontemporal clause}}
+#pragma omp teams distribute simd nontemporal(x) nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+#pragma omp target
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp teams distribute simd'}}
+#pragma omp teams distribute simd private(x) nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+#pragma omp target
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp teams distribute simd'}}
+#pragma omp teams distribute simd nontemporal(x) private(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+#pragma omp target
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp teams distribute simd'}} expected-note@+1 {{to match this '('}} expected-error@+1 {{expected ',' or ')' in 'nontemporal' clause}} expected-error@+1 {{expected ')'}}
+#pragma omp teams distribute simd nontemporal(x, y : 0)
+ for (i = 0; i < 16; ++i)
+ ;
+
+#pragma omp target
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp teams distribute simd'}}
+#pragma omp teams distribute simd nontemporal(x) lastprivate(x)
+ for (i = 0; i < 16; ++i)
+ ;
+
+#pragma omp target
+// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp teams distribute simd'}}
+#pragma omp teams distribute simd lastprivate(x) nontemporal(x)
+ for (i = 0; i < 16; ++i)
+ ;
+}
+
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_reduction_messages.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_reduction_messages.cpp
index 56935ed..adb1835 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_reduction_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_reduction_messages.cpp
@@ -1,12 +1,20 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wno-openmp-mapping -Wuninitialized
extern int omp_default_mem_alloc;
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp target
+#pragma omp teams distribute simd reduction(+:fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
void foo() {
}
diff --git a/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_shared_messages.cpp b/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_shared_messages.cpp
index 81f7e2a..de82817 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_shared_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_distribute_simd_shared_messages.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-mapping -Wuninitialized
void foo() {
}
diff --git a/src/llvm-project/clang/test/OpenMP/teams_firstprivate_codegen.cpp b/src/llvm-project/clang/test/OpenMP/teams_firstprivate_codegen.cpp
index a2b4144..2f3f1a0 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_firstprivate_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_firstprivate_codegen.cpp
@@ -1,47 +1,47 @@
// Test host codegen.
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-64
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix LAMBDA --check-prefix LAMBDA-32
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY0 %s
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
-// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
-// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32
-// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY1 %s
// SIMD-ONLY1-NOT: {{__kmpc|__tgt}}
-// RUN: %clang_cc1 -DARRAY -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix ARRAY --check-prefix ARRAY-64
-// RUN: %clang_cc1 -DARRAY -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DARRAY -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix ARRAY --check-prefix ARRAY-64
-// RUN: %clang_cc1 -DARRAY -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck %s --check-prefix ARRAY --check-prefix ARRAY-32
-// RUN: %clang_cc1 -DARRAY -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DARRAY -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck %s --check-prefix ARRAY --check-prefix ARRAY-32
+// RUN: %clang_cc1 -DARRAY -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix ARRAY --check-prefix ARRAY-64
+// RUN: %clang_cc1 -DARRAY -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DARRAY -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix ARRAY --check-prefix ARRAY-64
+// RUN: %clang_cc1 -DARRAY -verify -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck %s --check-prefix ARRAY --check-prefix ARRAY-32
+// RUN: %clang_cc1 -DARRAY -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DARRAY -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck %s --check-prefix ARRAY --check-prefix ARRAY-32
-// RUN: %clang_cc1 -DARRAY -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY2 %s
-// RUN: %clang_cc1 -DARRAY -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DARRAY -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY2 %s
-// RUN: %clang_cc1 -DARRAY -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY2 %s
-// RUN: %clang_cc1 -DARRAY -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-target
-// RUN: %clang_cc1 -DARRAY -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-target | FileCheck --check-prefix SIMD-ONLY2 %s
+// RUN: %clang_cc1 -DARRAY -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY2 %s
+// RUN: %clang_cc1 -DARRAY -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DARRAY -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY2 %s
+// RUN: %clang_cc1 -DARRAY -verify -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY2 %s
+// RUN: %clang_cc1 -DARRAY -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s -Wno-openmp-mapping
+// RUN: %clang_cc1 -DARRAY -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -include-pch %t -verify %s -emit-llvm -o - -Wno-openmp-mapping | FileCheck --check-prefix SIMD-ONLY2 %s
// SIMD-ONLY2-NOT: {{__kmpc|__tgt}}
// expected-no-diagnostics
#ifndef HEADER
diff --git a/src/llvm-project/clang/test/OpenMP/teams_firstprivate_messages.cpp b/src/llvm-project/clang/test/OpenMP/teams_firstprivate_messages.cpp
index ff58f42..ee97c8e 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_firstprivate_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_firstprivate_messages.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-mapping -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
@@ -10,6 +10,14 @@
return argc;
}
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp target
+#pragma omp teams firstprivate(fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
struct S1; // expected-note {{declared here}} expected-note{{forward declaration of 'S1'}}
extern S1 a;
class S2 {
diff --git a/src/llvm-project/clang/test/OpenMP/teams_messages.cpp b/src/llvm-project/clang/test/OpenMP/teams_messages.cpp
index 8196140..1154220 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_messages.cpp
@@ -1,6 +1,7 @@
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp -std=c++11 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -std=c++11 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-simd -std=c++11 -o - %s -Wuninitialized
void xxx(int argc) {
int x; // expected-note {{initialize the variable 'x' to silence this warning}}
@@ -15,6 +16,8 @@
#pragma omp teams // expected-error {{unexpected OpenMP directive '#pragma omp teams'}}
int main(int argc, char **argv) {
+ #pragma omp teams // omp45-error {{orphaned 'omp teams' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
+ ;
#pragma omp target
#pragma omp teams
f; // expected-error {{use of undeclared identifier 'f'}}
diff --git a/src/llvm-project/clang/test/OpenMP/teams_reduction_messages.cpp b/src/llvm-project/clang/test/OpenMP/teams_reduction_messages.cpp
index 73cce70..4cb1e75 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_reduction_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_reduction_messages.cpp
@@ -1,12 +1,20 @@
-// RUN: %clang_cc1 -verify -fopenmp -o - %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -o - %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -o - %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -o - %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -o - %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -o - %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -o - %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -o - %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -o - %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -o - %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -o - %s -Wno-openmp-mapping -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -o - %s -Wno-openmp-mapping -Wuninitialized
extern int omp_default_mem_alloc;
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp target
+#pragma omp teams reduction(+:fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
void foo() {
}
diff --git a/src/llvm-project/clang/test/OpenMP/teams_shared_messages.cpp b/src/llvm-project/clang/test/OpenMP/teams_shared_messages.cpp
index aa7964f..292b4b8 100644
--- a/src/llvm-project/clang/test/OpenMP/teams_shared_messages.cpp
+++ b/src/llvm-project/clang/test/OpenMP/teams_shared_messages.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-mapping -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-mapping -Wuninitialized
void foo() {
}
diff --git a/src/llvm-project/clang/test/OpenMP/threadprivate_codegen.cpp b/src/llvm-project/clang/test/OpenMP/threadprivate_codegen.cpp
index f2496b5..52ed8bb 100644
--- a/src/llvm-project/clang/test/OpenMP/threadprivate_codegen.cpp
+++ b/src/llvm-project/clang/test/OpenMP/threadprivate_codegen.cpp
@@ -202,7 +202,7 @@
#pragma omp threadprivate(gs1)
// CHECK: define {{.*}} [[S1_CTOR:@.*]]([[S1]]* {{.*}},
// CHECK: define {{.*}} [[S1_DTOR:@.*]]([[S1]]* {{.*}})
-// CHECK: define internal {{.*}}i8* [[GS1_CTOR:@\.__kmpc_global_ctor_\..*]](i8*)
+// CHECK: define internal {{.*}}i8* [[GS1_CTOR:@\.__kmpc_global_ctor_\..*]](i8* %0)
// CHECK: store i8* %0, i8** [[ARG_ADDR:%.*]],
// CHECK: [[ARG:%.+]] = load i8*, i8** [[ARG_ADDR]]
// CHECK: [[RES:%.*]] = bitcast i8* [[ARG]] to [[S1]]*
@@ -210,7 +210,7 @@
// CHECK: [[ARG:%.+]] = load i8*, i8** [[ARG_ADDR]]
// CHECK: ret i8* [[ARG]]
// CHECK-NEXT: }
-// CHECK: define internal {{.*}}void [[GS1_DTOR:@\.__kmpc_global_dtor_\..*]](i8*)
+// CHECK: define internal {{.*}}void [[GS1_DTOR:@\.__kmpc_global_dtor_\..*]](i8* %0)
// CHECK: store i8* %0, i8** [[ARG_ADDR:%.*]],
// CHECK: [[ARG:%.+]] = load i8*, i8** [[ARG_ADDR]]
// CHECK: [[RES:%.*]] = bitcast i8* [[ARG]] to [[S1]]*
@@ -226,7 +226,7 @@
// CHECK-DEBUG: store i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[LOC1]], i{{.*}} 0, i{{.*}} 0), i8** [[KMPC_LOC_ADDR_PSOURCE]]
// CHECK-DEBUG: @__kmpc_global_thread_num
// CHECK-DEBUG: call {{.*}}void @__kmpc_threadprivate_register([[IDENT]]* [[KMPC_LOC_ADDR]], i8* bitcast ([[S1]]* [[GS1]] to i8*), i8* (i8*)* [[GS1_CTOR:@\.__kmpc_global_ctor_\..*]], i8* (i8*, i8*)* null, void (i8*)* [[GS1_DTOR:@\.__kmpc_global_dtor_\..*]])
-// CHECK-DEBUG: define internal {{.*}}i8* [[GS1_CTOR]](i8*)
+// CHECK-DEBUG: define internal {{.*}}i8* [[GS1_CTOR]](i8* %0)
// CHECK-DEBUG: store i8* %0, i8** [[ARG_ADDR:%.*]],
// CHECK-DEBUG: [[ARG:%.+]] = load i8*, i8** [[ARG_ADDR]]
// CHECK-DEBUG: [[RES:%.*]] = bitcast i8* [[ARG]] to [[S1]]*
@@ -235,7 +235,7 @@
// CHECK-DEBUG: ret i8* [[ARG]]
// CHECK-DEBUG-NEXT: }
// CHECK-DEBUG: define {{.*}} [[S1_CTOR]]([[S1]]* {{.*}},
-// CHECK-DEBUG: define internal {{.*}}void [[GS1_DTOR]](i8*)
+// CHECK-DEBUG: define internal {{.*}}void [[GS1_DTOR]](i8* %0)
// CHECK-DEBUG: store i8* %0, i8** [[ARG_ADDR:%.*]],
// CHECK-DEBUG: [[ARG:%.+]] = load i8*, i8** [[ARG_ADDR]]
// CHECK-DEBUG: [[RES:%.*]] = bitcast i8* [[ARG]] to [[S1]]*
@@ -254,7 +254,7 @@
// CHECK-DEBUG-NOT: call {{.*}} [[S2_CTOR]]([[S2]]*
S1 arr_x[2][3] = { { 1, 2, 3 }, { 4, 5, 6 } };
#pragma omp threadprivate(arr_x)
-// CHECK: define internal {{.*}}i8* [[ARR_X_CTOR:@\.__kmpc_global_ctor_\..*]](i8*)
+// CHECK: define internal {{.*}}i8* [[ARR_X_CTOR:@\.__kmpc_global_ctor_\..*]](i8* %0)
// CHECK: store i8* %0, i8** [[ARG_ADDR:%.*]],
// CHECK: [[ARG:%.+]] = load i8*, i8** [[ARG_ADDR]]
// CHECK: [[RES:%.*]] = bitcast i8* [[ARG]] to [2 x [3 x [[S1]]]]*
@@ -275,7 +275,7 @@
// CHECK: [[ARG:%.+]] = load i8*, i8** [[ARG_ADDR]]
// CHECK: ret i8* [[ARG]]
// CHECK: }
-// CHECK: define internal {{.*}}void [[ARR_X_DTOR:@\.__kmpc_global_dtor_\..*]](i8*)
+// CHECK: define internal {{.*}}void [[ARR_X_DTOR:@\.__kmpc_global_dtor_\..*]](i8* %0)
// CHECK: store i8* %0, i8** [[ARG_ADDR:%.*]],
// CHECK: [[ARG:%.+]] = load i8*, i8** [[ARG_ADDR]]
// CHECK: [[ARR_BEGIN:%.*]] = bitcast i8* [[ARG]] to [[S1]]*
@@ -299,9 +299,9 @@
// CHECK-DEBUG: store i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[LOC2]], i{{.*}} 0, i{{.*}} 0), i8** [[KMPC_LOC_ADDR_PSOURCE]]
// CHECK-DEBUG: @__kmpc_global_thread_num
// CHECK-DEBUG: call {{.*}}void @__kmpc_threadprivate_register([[IDENT]]* [[KMPC_LOC_ADDR]], i8* bitcast ([2 x [3 x [[S1]]]]* [[ARR_X]] to i8*), i8* (i8*)* [[ARR_X_CTOR:@\.__kmpc_global_ctor_\..*]], i8* (i8*, i8*)* null, void (i8*)* [[ARR_X_DTOR:@\.__kmpc_global_dtor_\..*]])
-// CHECK-DEBUG: define internal {{.*}}i8* [[ARR_X_CTOR]](i8*)
+// CHECK-DEBUG: define internal {{.*}}i8* [[ARR_X_CTOR]](i8* %0)
// CHECK-DEBUG: }
-// CHECK-DEBUG: define internal {{.*}}void [[ARR_X_DTOR]](i8*)
+// CHECK-DEBUG: define internal {{.*}}void [[ARR_X_DTOR]](i8* %0)
// CHECK-DEBUG: }
extern S5 gs3;
#pragma omp threadprivate(gs3)
@@ -581,7 +581,7 @@
}
// CHECK: }
-// CHECK: define internal {{.*}}i8* [[SM_CTOR]](i8*)
+// CHECK: define internal {{.*}}i8* [[SM_CTOR]](i8* %0)
// CHECK: [[THREAD_NUM:%.+]] = call {{.*}}i32 @__kmpc_global_thread_num([[IDENT]]* [[DEFAULT_LOC]])
// CHECK: store i8* %0, i8** [[ARG_ADDR:%.*]],
// CHECK: [[ARG:%.+]] = load i8*, i8** [[ARG_ADDR]]
@@ -595,7 +595,7 @@
// CHECK-NEXT: ret i8* [[ARG]]
// CHECK-NEXT: }
// CHECK: define {{.*}} [[SMAIN_CTOR]]([[SMAIN]]* {{.*}},
-// CHECK: define internal {{.*}}void [[SM_DTOR]](i8*)
+// CHECK: define internal {{.*}}void [[SM_DTOR]](i8* %0)
// CHECK: store i8* %0, i8** [[ARG_ADDR:%.*]],
// CHECK: [[ARG:%.+]] = load i8*, i8** [[ARG_ADDR]]
// CHECK: [[RES:%.*]] = bitcast i8* [[ARG]] to [[SMAIN]]*
@@ -603,7 +603,7 @@
// CHECK-NEXT: ret void
// CHECK-NEXT: }
// CHECK: define {{.*}} [[SMAIN_DTOR]]([[SMAIN]]* {{.*}})
-// CHECK-DEBUG: define internal {{.*}}i8* [[SM_CTOR]](i8*)
+// CHECK-DEBUG: define internal {{.*}}i8* [[SM_CTOR]](i8* %0)
// CHECK-DEBUG: [[KMPC_LOC_ADDR:%.*]] = alloca [[IDENT]]
// CHECK-DEBUG: [[KMPC_LOC_ADDR_PSOURCE:%.*]] = getelementptr inbounds [[IDENT]], [[IDENT]]* [[KMPC_LOC_ADDR]], i{{.*}} 0, i{{.*}} 4
// CHECK-DEBUG-NEXT: store i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[LOC3]], i{{.*}} 0, i{{.*}} 0), i8** [[KMPC_LOC_ADDR_PSOURCE]]
@@ -622,7 +622,7 @@
// CHECK-DEBUG-NEXT: ret i8* [[ARG]]
// CHECK-DEBUG-NEXT: }
// CHECK-DEBUG: define {{.*}} [[SMAIN_CTOR]]([[SMAIN]]* {{.*}},
-// CHECK-DEBUG: define internal {{.*}} [[SM_DTOR:@.+]](i8*)
+// CHECK-DEBUG: define internal {{.*}} [[SM_DTOR:@.+]](i8* %0)
// CHECK-DEBUG: call {{.*}} [[SMAIN_DTOR:@.+]]([[SMAIN]]*
// CHECK-DEBUG: }
// CHECK-DEBUG: define {{.*}} [[SMAIN_DTOR]]([[SMAIN]]* {{.*}})
@@ -648,15 +648,15 @@
// CHECK-TLS: call void [[ARR_X_TLS_INIT]]
// CHECK-TLS: ret [2 x [3 x [[S1]]]]* [[ARR_X]]
// CHECK-TLS: }
-// CHECK-TLS: define {{.*}} i32* [[ST_INT_ST_TLS_INITD]] {{#[0-9]+}} {
+// CHECK-TLS: define {{.*}} i32* [[ST_INT_ST_TLS_INITD]] {{#[0-9]+}} comdat {
// CHECK-TLS-NOT: call
// CHECK-TLS: ret i32* [[ST_INT_ST]]
// CHECK-TLS: }
-// CHECK-TLS: define {{.*}} float* [[ST_FLOAT_ST_TLS_INITD]] {{#[0-9]+}} {
+// CHECK-TLS: define {{.*}} float* [[ST_FLOAT_ST_TLS_INITD]] {{#[0-9]+}} comdat {
// CHECK-TLS-NOT: call
// CHECK-TLS: ret float* [[ST_FLOAT_ST]]
// CHECK-TLS: }
-// CHECK-TLS: define {{.*}} [[S4]]* [[ST_S4_ST_TLS_INITD]] {{#[0-9]+}} {
+// CHECK-TLS: define {{.*}} [[S4]]* [[ST_S4_ST_TLS_INITD]] {{#[0-9]+}} comdat {
// CHECK-TLS: call void [[ST_S4_ST_TLS_INIT]]
// CHECK-TLS: ret [[S4]]* [[ST_S4_ST]]
// CHECK-TLS: }
@@ -856,7 +856,7 @@
#endif
// CHECK: call {{.*}}void @__kmpc_threadprivate_register([[IDENT]]* [[DEFAULT_LOC]], i8* bitcast ([[S4]]* [[ST_S4_ST]] to i8*), i8* (i8*)* [[ST_S4_ST_CTOR:@\.__kmpc_global_ctor_\..+]], i8* (i8*, i8*)* null, void (i8*)* [[ST_S4_ST_DTOR:@\.__kmpc_global_dtor_\..+]])
-// CHECK: define internal {{.*}}i8* [[ST_S4_ST_CTOR]](i8*)
+// CHECK: define internal {{.*}}i8* [[ST_S4_ST_CTOR]](i8* %0)
// CHECK: store i8* %0, i8** [[ARG_ADDR:%.*]],
// CHECK: [[ARG:%.+]] = load i8*, i8** [[ARG_ADDR]]
// CHECK: [[RES:%.*]] = bitcast i8* [[ARG]] to [[S4]]*
@@ -865,7 +865,7 @@
// CHECK-NEXT: ret i8* [[ARG]]
// CHECK-NEXT: }
// CHECK: define {{.*}} [[S4_CTOR]]([[S4]]* {{.*}},
-// CHECK: define internal {{.*}}void [[ST_S4_ST_DTOR]](i8*)
+// CHECK: define internal {{.*}}void [[ST_S4_ST_DTOR]](i8* %0)
// CHECK: store i8* %0, i8** [[ARG_ADDR:%.*]],
// CHECK: [[ARG:%.+]] = load i8*, i8** [[ARG_ADDR]]
// CHECK: [[RES:%.*]] = bitcast i8* [[ARG]] to [[S4]]*
@@ -878,10 +878,10 @@
// CHECK-DEBUG-NEXT: store i8* getelementptr inbounds ([{{.*}} x i8], [{{.*}} x i8]* [[LOC20]], i{{.*}} 0, i{{.*}} 0), i8** [[KMPC_LOC_ADDR_PSOURCE]]
// CHECK-DEBUG: @__kmpc_global_thread_num
// CHECK-DEBUG: call {{.*}}void @__kmpc_threadprivate_register([[IDENT]]* [[KMPC_LOC_ADDR]], i8* bitcast ([[S4]]* [[ST_S4_ST]] to i8*), i8* (i8*)* [[ST_S4_ST_CTOR:@\.__kmpc_global_ctor_\..+]], i8* (i8*, i8*)* null, void (i8*)* [[ST_S4_ST_DTOR:@\.__kmpc_global_dtor_\..+]])
-// CHECK-DEBUG: define internal {{.*}}i8* [[ST_S4_ST_CTOR]](i8*)
+// CHECK-DEBUG: define internal {{.*}}i8* [[ST_S4_ST_CTOR]](i8* %0)
// CHECK-DEBUG: }
// CHECK-DEBUG: define {{.*}} [[S4_CTOR:@.*]]([[S4]]* {{.*}},
-// CHECK-DEBUG: define internal {{.*}}void [[ST_S4_ST_DTOR]](i8*)
+// CHECK-DEBUG: define internal {{.*}}void [[ST_S4_ST_DTOR]](i8* %0)
// CHECK-DEBUG: }
// CHECK-DEBUG: define {{.*}} [[S4_DTOR:@.*]]([[S4]]* {{.*}})
@@ -926,7 +926,7 @@
// CHECK-TLS: invoke void [[GS1_CTOR1]]([[S1]]* getelementptr inbounds ([2 x [3 x [[S1]]]], [2 x [3 x [[S1]]]]* [[ARR_X]], i{{.*}} 0, i{{.*}} 1, i{{.*}} 1), i{{.*}} 5)
// CHECK-TLS: invoke void [[GS1_CTOR1]]([[S1]]* getelementptr inbounds ([2 x [3 x [[S1]]]], [2 x [3 x [[S1]]]]* [[ARR_X]], i{{.*}} 0, i{{.*}} 1, i{{.*}} 2), i{{.*}} 6)
// CHECK-TLS: call i32 @__cxa_thread_atexit(void (i8*)* [[ARR_X_CXX_DTOR:@[^,]+]]
-// CHECK-TLS: define internal void [[ARR_X_CXX_DTOR]](i8*)
+// CHECK-TLS: define internal void [[ARR_X_CXX_DTOR]](i8* %0)
// CHECK-TLS: void [[GS1_DTOR1]]([[S1]]* {{.*}})
// CHECK-TLS: define {{.*}}void [[SM_CTOR2]]([[SMAIN]]* {{.*}}, i32 {{.*}})
diff --git a/src/llvm-project/clang/test/PCH/Inputs/std-compare.h b/src/llvm-project/clang/test/PCH/Inputs/std-compare.h
index a6ab605..eaf7951 100644
--- a/src/llvm-project/clang/test/PCH/Inputs/std-compare.h
+++ b/src/llvm-project/clang/test/PCH/Inputs/std-compare.h
@@ -6,11 +6,8 @@
// exposition only
enum class _EqResult : unsigned char {
- __zero = 0,
- __equal = __zero,
+ __equal = 0,
__equiv = __equal,
- __nonequal = 1,
- __nonequiv = __nonequal
};
enum class _OrdResult : signed char {
@@ -25,108 +22,6 @@
struct _CmpUnspecifiedType;
using _CmpUnspecifiedParam = void (_CmpUnspecifiedType::*)();
-class weak_equality {
- constexpr explicit weak_equality(_EqResult __val) noexcept : __value_(__val) {}
-
-public:
- static const weak_equality equivalent;
- static const weak_equality nonequivalent;
-
- friend constexpr bool operator==(weak_equality __v, _CmpUnspecifiedParam) noexcept;
- friend constexpr bool operator==(_CmpUnspecifiedParam, weak_equality __v) noexcept;
- friend constexpr bool operator!=(weak_equality __v, _CmpUnspecifiedParam) noexcept;
- friend constexpr bool operator!=(_CmpUnspecifiedParam, weak_equality __v) noexcept;
- friend constexpr weak_equality operator<=>(weak_equality __v, _CmpUnspecifiedParam) noexcept;
- friend constexpr weak_equality operator<=>(_CmpUnspecifiedParam, weak_equality __v) noexcept;
-
- // test helper
- constexpr bool test_eq(weak_equality const &other) const noexcept {
- return __value_ == other.__value_;
- }
-
-private:
- _EqResult __value_;
-};
-
-inline constexpr weak_equality weak_equality::equivalent(_EqResult::__equiv);
-inline constexpr weak_equality weak_equality::nonequivalent(_EqResult::__nonequiv);
-inline constexpr bool operator==(weak_equality __v, _CmpUnspecifiedParam) noexcept {
- return __v.__value_ == _EqResult::__zero;
-}
-inline constexpr bool operator==(_CmpUnspecifiedParam, weak_equality __v) noexcept {
- return __v.__value_ == _EqResult::__zero;
-}
-inline constexpr bool operator!=(weak_equality __v, _CmpUnspecifiedParam) noexcept {
- return __v.__value_ != _EqResult::__zero;
-}
-inline constexpr bool operator!=(_CmpUnspecifiedParam, weak_equality __v) noexcept {
- return __v.__value_ != _EqResult::__zero;
-}
-
-inline constexpr weak_equality operator<=>(weak_equality __v, _CmpUnspecifiedParam) noexcept {
- return __v;
-}
-inline constexpr weak_equality operator<=>(_CmpUnspecifiedParam, weak_equality __v) noexcept {
- return __v;
-}
-
-class strong_equality {
- explicit constexpr strong_equality(_EqResult __val) noexcept : __value_(__val) {}
-
-public:
- static const strong_equality equal;
- static const strong_equality nonequal;
- static const strong_equality equivalent;
- static const strong_equality nonequivalent;
-
- // conversion
- constexpr operator weak_equality() const noexcept {
- return __value_ == _EqResult::__zero ? weak_equality::equivalent
- : weak_equality::nonequivalent;
- }
-
- // comparisons
- friend constexpr bool operator==(strong_equality __v, _CmpUnspecifiedParam) noexcept;
- friend constexpr bool operator!=(strong_equality __v, _CmpUnspecifiedParam) noexcept;
- friend constexpr bool operator==(_CmpUnspecifiedParam, strong_equality __v) noexcept;
- friend constexpr bool operator!=(_CmpUnspecifiedParam, strong_equality __v) noexcept;
-
- friend constexpr strong_equality operator<=>(strong_equality __v, _CmpUnspecifiedParam) noexcept;
- friend constexpr strong_equality operator<=>(_CmpUnspecifiedParam, strong_equality __v) noexcept;
-
- // test helper
- constexpr bool test_eq(strong_equality const &other) const noexcept {
- return __value_ == other.__value_;
- }
-
-private:
- _EqResult __value_;
-};
-
-inline constexpr strong_equality strong_equality::equal(_EqResult::__equal);
-inline constexpr strong_equality strong_equality::nonequal(_EqResult::__nonequal);
-inline constexpr strong_equality strong_equality::equivalent(_EqResult::__equiv);
-inline constexpr strong_equality strong_equality::nonequivalent(_EqResult::__nonequiv);
-constexpr bool operator==(strong_equality __v, _CmpUnspecifiedParam) noexcept {
- return __v.__value_ == _EqResult::__zero;
-}
-constexpr bool operator==(_CmpUnspecifiedParam, strong_equality __v) noexcept {
- return __v.__value_ == _EqResult::__zero;
-}
-constexpr bool operator!=(strong_equality __v, _CmpUnspecifiedParam) noexcept {
- return __v.__value_ != _EqResult::__zero;
-}
-constexpr bool operator!=(_CmpUnspecifiedParam, strong_equality __v) noexcept {
- return __v.__value_ != _EqResult::__zero;
-}
-
-constexpr strong_equality operator<=>(strong_equality __v, _CmpUnspecifiedParam) noexcept {
- return __v;
-}
-constexpr strong_equality operator<=>(_CmpUnspecifiedParam, strong_equality __v) noexcept {
- return __v;
-}
-
class partial_ordering {
using _ValueT = signed char;
explicit constexpr partial_ordering(_EqResult __v) noexcept
@@ -147,11 +42,6 @@
static const partial_ordering greater;
static const partial_ordering unordered;
- // conversion
- constexpr operator weak_equality() const noexcept {
- return __value_ == 0 ? weak_equality::equivalent : weak_equality::nonequivalent;
- }
-
// comparisons
friend constexpr bool operator==(partial_ordering __v, _CmpUnspecifiedParam) noexcept;
friend constexpr bool operator!=(partial_ordering __v, _CmpUnspecifiedParam) noexcept;
@@ -237,10 +127,6 @@
static const weak_ordering greater;
// conversions
- constexpr operator weak_equality() const noexcept {
- return __value_ == 0 ? weak_equality::equivalent
- : weak_equality::nonequivalent;
- }
constexpr operator partial_ordering() const noexcept {
return __value_ == 0 ? partial_ordering::equivalent
: (__value_ < 0 ? partial_ordering::less : partial_ordering::greater);
@@ -331,14 +217,6 @@
static const strong_ordering greater;
// conversions
- constexpr operator weak_equality() const noexcept {
- return __value_ == 0 ? weak_equality::equivalent
- : weak_equality::nonequivalent;
- }
- constexpr operator strong_equality() const noexcept {
- return __value_ == 0 ? strong_equality::equal
- : strong_equality::nonequal;
- }
constexpr operator partial_ordering() const noexcept {
return __value_ == 0 ? partial_ordering::equivalent
: (__value_ < 0 ? partial_ordering::less : partial_ordering::greater);
@@ -423,14 +301,6 @@
return __v < 0 ? strong_ordering::greater : (__v > 0 ? strong_ordering::less : __v);
}
-// named comparison functions
-constexpr bool is_eq(weak_equality __cmp) noexcept { return __cmp == 0; }
-constexpr bool is_neq(weak_equality __cmp) noexcept { return __cmp != 0; }
-constexpr bool is_lt(partial_ordering __cmp) noexcept { return __cmp < 0; }
-constexpr bool is_lteq(partial_ordering __cmp) noexcept { return __cmp <= 0; }
-constexpr bool is_gt(partial_ordering __cmp) noexcept { return __cmp > 0; }
-constexpr bool is_gteq(partial_ordering __cmp) noexcept { return __cmp >= 0; }
-
} // namespace __1
} // end namespace std
diff --git a/src/llvm-project/clang/test/PCH/aarch64-sve-types.c b/src/llvm-project/clang/test/PCH/aarch64-sve-types.c
new file mode 100644
index 0000000..27f1630
--- /dev/null
+++ b/src/llvm-project/clang/test/PCH/aarch64-sve-types.c
@@ -0,0 +1,21 @@
+// RUN: %clang_cc1 -triple aarch64-linux-gnu -emit-pch -o %t %s
+// RUN: %clang_cc1 -triple aarch64-linux-gnu -include-pch %t \
+// RUN: -fsyntax-only -verify %s
+
+// expected-no-diagnostics
+
+__SVInt8_t *s8;
+__SVInt16_t *s16;
+__SVInt32_t *s32;
+__SVInt64_t *s64;
+
+__SVUint8_t *u8;
+__SVUint16_t *u16;
+__SVUint32_t *u32;
+__SVUint64_t *u64;
+
+__SVFloat16_t *f16;
+__SVFloat32_t *f32;
+__SVFloat64_t *f64;
+
+__SVBool_t *b8;
diff --git a/src/llvm-project/clang/test/PCH/cxx-explicit-specifier.cpp b/src/llvm-project/clang/test/PCH/cxx-explicit-specifier.cpp
index a800cfc9..9c7b056 100644
--- a/src/llvm-project/clang/test/PCH/cxx-explicit-specifier.cpp
+++ b/src/llvm-project/clang/test/PCH/cxx-explicit-specifier.cpp
@@ -40,7 +40,9 @@
#else
//expected-note@-6+ {{candidate constructor}}
//expected-note@-9+ {{candidate constructor}}
-//expected-note@-6+ {{candidate function}}
+//expected-note-re@-7+ {{explicit constructor is not a candidate{{$}}}}
+//expected-note@-7+ {{candidate function}}
+//expected-note@-7+ {{explicit conversion function is not a candidate (explicit specifier evaluates to true)}}
//CHECK: explicit{{ +}}A(
//CHECK-NEXT: explicit(false){{ +}}operator
@@ -73,12 +75,10 @@
B<false> b_false;
#else
//expected-note@-8 {{candidate template ignored}}
-//expected-note@-8+ {{explicit constructor}}
+//expected-note@-8 {{explicit constructor declared here}}
//expected-note@-15+ {{candidate constructor}}
-//expected-note@-8+ {{candidate conversion operator ignored}}
-//expected-note@-9+ {{explicit(bool) specifier resolved to true}}
-//expected-note@-12 {{explicit(bool) specifier resolved to true}}
-//expected-note@-13+ {{candidate deductiong guide ignored}}
+//expected-note@-8+ {{explicit conversion function is not a candidate (explicit specifier}}
+//expected-note@-11 {{explicit constructor is not a candidate (explicit specifier}}
//CHECK: explicit(b){{ +}}A
//CHECK: explicit(b{{ +}}^{{ +}}T::value){{ +}}operator
diff --git a/src/llvm-project/clang/test/PCH/cxx-templates.cpp b/src/llvm-project/clang/test/PCH/cxx-templates.cpp
index 966bd00..cd2787d 100644
--- a/src/llvm-project/clang/test/PCH/cxx-templates.cpp
+++ b/src/llvm-project/clang/test/PCH/cxx-templates.cpp
@@ -165,3 +165,13 @@
static_assert(A<int>().f() == 1); // expected-error {{static_assert failed}}
#endif
}
+
+namespace DependentTemplateName {
+ struct HasMember {
+ template <class T> struct Member;
+ };
+
+ void test() {
+ getWithIdentifier<HasMember>();
+ }
+}
diff --git a/src/llvm-project/clang/test/PCH/cxx-templates.h b/src/llvm-project/clang/test/PCH/cxx-templates.h
index 5aa6854..b4ea2c2 100644
--- a/src/llvm-project/clang/test/PCH/cxx-templates.h
+++ b/src/llvm-project/clang/test/PCH/cxx-templates.h
@@ -448,3 +448,11 @@
constexpr int f() { return Base::setstate(); }
};
}
+
+namespace DependentTemplateName {
+ template <template <class> class Template>
+ struct TakesClassTemplate {};
+
+ template <class T>
+ TakesClassTemplate<T::template Member> getWithIdentifier();
+}
diff --git a/src/llvm-project/clang/test/PCH/cxx1y-default-initializer.cpp b/src/llvm-project/clang/test/PCH/cxx1y-default-initializer.cpp
index c9593a5..acb6337 100644
--- a/src/llvm-project/clang/test/PCH/cxx1y-default-initializer.cpp
+++ b/src/llvm-project/clang/test/PCH/cxx1y-default-initializer.cpp
@@ -37,8 +37,8 @@
static_assert(A{}.z == 3, "");
static_assert(A{1}.z == 4, "");
-static_assert(A{.y = 5}.z == 5, ""); // expected-warning {{C99}}
-static_assert(A{3, .y = 1}.z == 4, ""); // expected-warning {{C99}}
+static_assert(A{.y = 5}.z == 5, ""); // expected-warning {{C++20}}
+static_assert(A{3, .y = 1}.z == 4, ""); // expected-warning {{C99}} expected-note {{here}}
static_assert(make<int>().z == 3, "");
static_assert(make<int>(12).z == 15, "");
static_assert(C<int>().c == 0, "");
diff --git a/src/llvm-project/clang/test/PCH/cxx2a-compare.cpp b/src/llvm-project/clang/test/PCH/cxx2a-compare.cpp
index 9ad368d..019544d 100644
--- a/src/llvm-project/clang/test/PCH/cxx2a-compare.cpp
+++ b/src/llvm-project/clang/test/PCH/cxx2a-compare.cpp
@@ -15,6 +15,16 @@
return (1 <=> x);
}
+struct X {
+ int a;
+ friend constexpr std::strong_ordering operator<=>(const X &x, const X &y) {
+ return x.a <=> y.a;
+ }
+};
+constexpr auto baz(int x) {
+ return X{3} < X{x};
+}
+
#else
// expected-no-diagnostics
@@ -25,4 +35,7 @@
return bar(x);
}
+static_assert(!baz(3));
+static_assert(baz(4));
+
#endif
diff --git a/src/llvm-project/clang/test/PCH/cxx2a-concept-specialization-expr.cpp b/src/llvm-project/clang/test/PCH/cxx2a-concept-specialization-expr.cpp
new file mode 100644
index 0000000..6227d57
--- /dev/null
+++ b/src/llvm-project/clang/test/PCH/cxx2a-concept-specialization-expr.cpp
@@ -0,0 +1,32 @@
+// RUN: %clang_cc1 -std=c++2a -emit-pch %s -o %t
+// RUN: %clang_cc1 -std=c++2a -include-pch %t -verify %s
+
+// expected-no-diagnostics
+
+#ifndef HEADER
+#define HEADER
+
+template<typename... T>
+concept C = true;
+
+namespace n {
+ template<typename... T>
+ concept C = true;
+}
+
+void f() {
+ (void)C<int>;
+ (void)C<int, void>;
+ (void)n::C<void>;
+}
+
+#else /*included pch*/
+
+int main() {
+ (void)C<int>;
+ (void)C<int, void>;
+ (void)n::C<void>;
+ f();
+}
+
+#endif // HEADER
diff --git a/src/llvm-project/clang/test/PCH/cxx2a-constraints.cpp b/src/llvm-project/clang/test/PCH/cxx2a-constraints.cpp
new file mode 100644
index 0000000..593d962
--- /dev/null
+++ b/src/llvm-project/clang/test/PCH/cxx2a-constraints.cpp
@@ -0,0 +1,37 @@
+// RUN: %clang_cc1 -std=c++2a -emit-pch %s -o %t
+// RUN: %clang_cc1 -std=c++2a -include-pch %t -verify %s
+
+// expected-no-diagnostics
+
+#ifndef HEADER
+#define HEADER
+
+template<typename T, typename U = char>
+concept SizedLike = sizeof(T) == sizeof(U);
+
+template <class T> void f(T) requires (sizeof(int) == sizeof(T)) {}
+template <class T> void f(T) requires (sizeof(char) == sizeof(T)) {}
+
+template <class T> requires (sizeof(int) == sizeof(T)) void g(T) {}
+template <class T> requires (sizeof(char) == sizeof(T)) void g(T) {}
+
+template <SizedLike<int> T> void h(T) {}
+template <SizedLike<char> T> void h(T) {}
+
+template <SizedLike<int> T> void i(T) {}
+template <SizedLike T> void i(T) {}
+
+#else /*included pch*/
+
+int main() {
+ (void)f('1');
+ (void)f(1);
+ (void)g('1');
+ (void)g(1);
+ (void)h('1');
+ (void)h(1);
+ (void)i('1');
+ (void)i(1);
+}
+
+#endif // HEADER
\ No newline at end of file
diff --git a/src/llvm-project/clang/test/PCH/cxx2a-defaulted-comparison.cpp b/src/llvm-project/clang/test/PCH/cxx2a-defaulted-comparison.cpp
new file mode 100644
index 0000000..4fb0b83
--- /dev/null
+++ b/src/llvm-project/clang/test/PCH/cxx2a-defaulted-comparison.cpp
@@ -0,0 +1,50 @@
+// RxN: %clang_cc1 -std=c++2a -verify -Wno-defaulted-function-deleted -include %s %s
+//
+// RUN: %clang_cc1 -std=c++2a -emit-pch %s -o %t.pch
+// RUN: %clang_cc1 -std=c++2a -include-pch %t.pch %s -verify
+
+// expected-no-diagnostics
+
+#ifndef INCLUDED
+#define INCLUDED
+
+namespace std {
+ struct strong_ordering {
+ int n;
+ constexpr operator int() const { return n; }
+ static const strong_ordering equal, greater, less;
+ };
+ constexpr strong_ordering strong_ordering::equal = {0};
+ constexpr strong_ordering strong_ordering::greater = {1};
+ constexpr strong_ordering strong_ordering::less = {-1};
+}
+
+// Ensure that we can round-trip DefaultedFunctionInfo through an AST file.
+namespace LookupContext {
+ struct A {};
+
+ namespace N {
+ template <typename T> auto f() {
+ bool operator==(const T &, const T &);
+ bool operator<(const T &, const T &);
+ struct B {
+ T a;
+ std::strong_ordering operator<=>(const B &) const = default;
+ };
+ return B();
+ }
+ }
+}
+
+#else
+
+namespace LookupContext {
+ namespace M {
+ bool operator<=>(const A &, const A &) = delete;
+ bool operator==(const A &, const A &) = delete;
+ bool operator<(const A &, const A &) = delete;
+ bool cmp = N::f<A>() < N::f<A>();
+ }
+}
+
+#endif
diff --git a/src/llvm-project/clang/test/PCH/cxx2a-requires-expr.cpp b/src/llvm-project/clang/test/PCH/cxx2a-requires-expr.cpp
new file mode 100644
index 0000000..5548db4
--- /dev/null
+++ b/src/llvm-project/clang/test/PCH/cxx2a-requires-expr.cpp
@@ -0,0 +1,20 @@
+// RUN: %clang_cc1 -emit-pch -std=c++2a -o %t %s
+// RUN: %clang_cc1 -std=c++2a -x ast -ast-print %t | FileCheck %s
+
+template<typename T>
+concept C = true;
+
+template<typename T, typename U>
+concept C2 = true;
+
+template<typename T>
+bool f() {
+ // CHECK: requires (T t) { t++; { t++ } noexcept -> C; { t++ } -> C2<int>; typename T::a; requires T::val; };
+ return requires (T t) {
+ t++;
+ { t++ } noexcept -> C;
+ { t++ } -> C2<int>;
+ typename T::a;
+ requires T::val;
+ };
+}
diff --git a/src/llvm-project/clang/test/PCH/debug-info-pch-container-path.c b/src/llvm-project/clang/test/PCH/debug-info-pch-container-path.c
new file mode 100644
index 0000000..efe49e4
--- /dev/null
+++ b/src/llvm-project/clang/test/PCH/debug-info-pch-container-path.c
@@ -0,0 +1,22 @@
+// REQUIRES: asserts
+
+// Modules:
+// RUN: rm -rf %t
+// RUN: mkdir %t
+// RUN: cd %t
+
+// RUN: %clang_cc1 -fmodule-format=obj -emit-pch \
+// RUN: -triple %itanium_abi_triple \
+// RUN: -fdebug-prefix-map=%t=BUILD \
+// RUN: -fdebug-prefix-map=%S=SOURCE \
+// RUN: -o %t/prefix.ll %S/debug-info-limited-struct.h \
+// RUN: -mllvm -debug-only=pchcontainer &>%t-container.ll
+// RUN: cat %t-container.ll | FileCheck %s
+
+// CHECK: distinct !DICompileUnit(
+// CHECK-SAME: language: DW_LANG_C99,
+// CHECK-SAME: file: ![[FILE:[0-9]+]],
+// CHECK: ![[FILE]] = !DIFile(
+// CHECK-SAME: filename: "SOURCE/debug-info-limited-struct.h",
+// CHECK-SAME: directory: "BUILD"
+
diff --git a/src/llvm-project/clang/test/PCH/late-parsed-instantiations.cpp b/src/llvm-project/clang/test/PCH/late-parsed-instantiations.cpp
index f1fe8bb..cbcc063 100644
--- a/src/llvm-project/clang/test/PCH/late-parsed-instantiations.cpp
+++ b/src/llvm-project/clang/test/PCH/late-parsed-instantiations.cpp
@@ -20,8 +20,8 @@
char data() {
visit([](auto buffer) -> char { // expected-note {{in instantiation}}
buffer->data();
- }); // expected-warning {{control reaches end of non-void lambda}}
- } // expected-warning {{control reaches end of non-void function}}
+ }); // expected-warning {{non-void lambda does not return a value}}
+ } // expected-warning {{non-void function does not return a value}}
};
#else
diff --git a/src/llvm-project/clang/test/PCH/leakfiles b/src/llvm-project/clang/test/PCH/leakfiles.test
similarity index 100%
rename from src/llvm-project/clang/test/PCH/leakfiles
rename to src/llvm-project/clang/test/PCH/leakfiles.test
diff --git a/src/llvm-project/clang/test/PCH/modified-header-error.c b/src/llvm-project/clang/test/PCH/modified-header-error.c
index 8ab38e1..fb63836 100644
--- a/src/llvm-project/clang/test/PCH/modified-header-error.c
+++ b/src/llvm-project/clang/test/PCH/modified-header-error.c
@@ -9,4 +9,6 @@
#include "header2.h"
// CHECK: fatal error: file {{.*}} has been modified since the precompiled header {{.*}} was built
-// REQUIRES: shell
+
+// FIXME: Flaky on Windows, timestamp resolution?
+// UNSUPPORTED: win32
diff --git a/src/llvm-project/clang/test/PCH/ms-pch-macro.c b/src/llvm-project/clang/test/PCH/ms-pch-macro.c
new file mode 100644
index 0000000..3a8052e
--- /dev/null
+++ b/src/llvm-project/clang/test/PCH/ms-pch-macro.c
@@ -0,0 +1,39 @@
+// Test -D and -U interaction with a PCH when -fms-extensions is enabled.
+
+// RUN: %clang_cc1 -DFOO %S/variables.h -emit-pch -o %t1.pch
+
+// RUN: not %clang_cc1 -DFOO=blah -DBAR=int -include-pch %t1.pch -pch-through-header=%S/variables.h %s 2> %t.err
+// RUN: FileCheck -check-prefix=CHECK-FOO %s < %t.err
+
+// RUN: not %clang_cc1 -UFOO -DBAR=int -include-pch %t1.pch %s -pch-through-header=%S/variables.h 2> %t.err
+// RUN: FileCheck -check-prefix=CHECK-NOFOO %s < %t.err
+
+// RUN: %clang_cc1 -include-pch %t1.pch -DBAR=int -pch-through-header=%S/variables.h -verify %s
+
+// Enabling MS extensions should allow us to add BAR definitions.
+// RUN: %clang_cc1 -DMSEXT -fms-extensions -DFOO %S/variables.h -emit-pch -o %t1.pch
+// RUN: %clang_cc1 -DMSEXT -fms-extensions -include-pch %t1.pch -DBAR=int -pch-through-header=%S/variables.h -verify %s
+
+#include "variables.h"
+
+BAR bar = 17;
+#ifndef MSEXT
+// expected-error@-2 {{unknown type name 'BAR'}}
+#endif
+
+#ifndef FOO
+# error FOO was not defined
+#endif
+
+#if FOO != 1
+# error FOO has the wrong definition
+#endif
+
+#if defined(MSEXT) && !defined(BAR)
+# error BAR was not defined
+#endif
+
+// CHECK-FOO: definition of macro 'FOO' differs between the precompiled header ('1') and the command line ('blah')
+// CHECK-NOFOO: macro 'FOO' was defined in the precompiled header but undef'd on the command line
+
+// expected-warning@1 {{definition of macro 'BAR' does not match definition in precompiled header}}
diff --git a/src/llvm-project/clang/test/PCH/no-escaping-block-tail-calls.cpp b/src/llvm-project/clang/test/PCH/no-escaping-block-tail-calls.cpp
index 5ae8108..bf19726 100644
--- a/src/llvm-project/clang/test/PCH/no-escaping-block-tail-calls.cpp
+++ b/src/llvm-project/clang/test/PCH/no-escaping-block-tail-calls.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -x c++-header -triple x86_64-apple-darwin11 -emit-pch -O1 -fblocks -fno-escaping-block-tail-calls -o %t %S/no-escaping-block-tail-calls.h
-// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -include-pch %t -emit-llvm -O1 -fblocks -fno-escaping-block-tail-calls -o - %s | FileCheck %s
+// RUN: %clang_cc1 -x c++-header -triple x86_64-apple-darwin11 -emit-pch -O2 -fblocks -fno-escaping-block-tail-calls -o %t %S/no-escaping-block-tail-calls.h
+// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -include-pch %t -emit-llvm -O2 -fblocks -fno-escaping-block-tail-calls -o - %s | FileCheck %s
// Check that -fno-escaping-block-tail-calls doesn't disable tail-call
// optimization if the block is non-escaping.
diff --git a/src/llvm-project/clang/test/PCH/thread-local.cpp b/src/llvm-project/clang/test/PCH/thread-local.cpp
index ab37f7b..678fe34 100644
--- a/src/llvm-project/clang/test/PCH/thread-local.cpp
+++ b/src/llvm-project/clang/test/PCH/thread-local.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -pedantic-errors -std=c++11 -triple x86_64-linux-gnu -emit-pch %s -o %t
-// RUN: %clang_cc1 -pedantic-errors -std=c++11 -triple x86_64-linux-gnu -include-pch %t -verify %s
+// RUN: %clang_cc1 -pedantic-errors -Wno-c11-extensions -std=c++11 -triple x86_64-linux-gnu -emit-pch %s -o %t
+// RUN: %clang_cc1 -pedantic-errors -Wno-c11-extensions -std=c++11 -triple x86_64-linux-gnu -include-pch %t -verify %s
// REQUIRES: x86-registered-target
#ifndef HEADER_INCLUDED
diff --git a/src/llvm-project/clang/test/PCH/validate-file-content.m b/src/llvm-project/clang/test/PCH/validate-file-content.m
new file mode 100644
index 0000000..aba4944
--- /dev/null
+++ b/src/llvm-project/clang/test/PCH/validate-file-content.m
@@ -0,0 +1,29 @@
+// REQUIRES: shell
+//
+// Check driver works
+// RUN: %clang -x objective-c-header -fsyntax-only -fpch-validate-input-files-content %s -### 2>&1 | FileCheck --check-prefix=CHECK-CC1 %s
+// CHECK-CC1: -fvalidate-ast-input-files-content
+//
+// PCH only: Test that a mtime mismatch without content change is fine
+// RUN: rm -rf %t
+// RUN: mkdir %t
+// RUN: echo '// m.h' > %t/m.h
+// RUN: echo '#include "m.h"' > %t/a.h
+// RUN: %clang_cc1 -emit-pch -o %t/a.pch -I %t -x objective-c-header %t/a.h -fvalidate-ast-input-files-content
+// RUN: touch -m -a -t 202901010000 %t/m.h
+// RUN: %clang_cc1 -fsyntax-only -I %t -include-pch %t/a.pch %s -verify -fvalidate-ast-input-files-content
+//
+// PCH only: Test that a mtime mismatch with content change
+// RUN: rm -rf %t
+// RUN: mkdir %t
+// RUN: echo '// m.h' > %t/m.h
+// RUN: echo '#include "m.h"' > %t/a.h
+// RUN: %clang_cc1 -emit-pch -o %t/a.pch -I %t -x objective-c-header %t/a.h -fvalidate-ast-input-files-content
+// RUN: echo '// m.x' > %t/m.h
+// RUN: touch -m -a -t 202901010000 %t/m.h
+// RUN: not %clang_cc1 -fsyntax-only -I %t -include-pch %t/a.pch %s -fvalidate-ast-input-files-content 2> %t/stderr
+// RUN: FileCheck %s < %t/stderr
+//
+// CHECK: file '[[M_H:.*[/\\]m\.h]]' has been modified since the precompiled header '[[A_PCH:.*/a\.pch]]' was built: content changed
+// CHECK: please rebuild precompiled header '[[A_PCH]]'
+// expected-no-diagnostics
diff --git a/src/llvm-project/clang/test/Parser/DelayedTemplateParsing.cpp b/src/llvm-project/clang/test/Parser/DelayedTemplateParsing.cpp
index c65e80b..bcd286a 100644
--- a/src/llvm-project/clang/test/Parser/DelayedTemplateParsing.cpp
+++ b/src/llvm-project/clang/test/Parser/DelayedTemplateParsing.cpp
@@ -48,22 +48,6 @@
-namespace Inner_Outer_same_template_param_name {
-
-template <class T>
-class Outmost {
-public:
- template <class T>
- class Inner {
- public:
- void f() {
- T* var;
- }
- };
-};
-
-}
-
namespace PR11931 {
diff --git a/src/llvm-project/clang/test/Parser/asm.c b/src/llvm-project/clang/test/Parser/asm.c
index 637f9d7..b15aae1 100644
--- a/src/llvm-project/clang/test/Parser/asm.c
+++ b/src/llvm-project/clang/test/Parser/asm.c
@@ -20,6 +20,10 @@
asm _Atomic (""); // expected-warning {{ignored _Atomic qualifier on asm}}
}
+void a() __asm__(""); // expected-error {{cannot use an empty string literal in 'asm'}}
+void a() {
+ __asm__(""); // ok
+}
// rdar://5952468
__asm ; // expected-error {{expected '(' after 'asm'}}
diff --git a/src/llvm-project/clang/test/Parser/atomic.c b/src/llvm-project/clang/test/Parser/atomic.c
index e435518..928a43b 100644
--- a/src/llvm-project/clang/test/Parser/atomic.c
+++ b/src/llvm-project/clang/test/Parser/atomic.c
@@ -1,40 +1,47 @@
// RUN: %clang_cc1 -std=c11 %s -fsyntax-only -verify -pedantic
+// RUN: %clang_cc1 -std=c99 %s -fsyntax-only -verify=expected,ext -pedantic -Wno-typedef-redefinition
-typedef _Atomic(int) atomic_int;
-typedef _Atomic int atomic_int;
-typedef _Atomic _Atomic _Atomic(int) atomic_int; // expected-warning {{duplicate '_Atomic' declaration specifier}}
+typedef _Atomic(int) atomic_int; // ext-warning {{'_Atomic' is a C11 extension}}
+typedef _Atomic int atomic_int; // ext-warning {{'_Atomic' is a C11 extension}}
+typedef _Atomic _Atomic _Atomic(int) atomic_int; // expected-warning {{duplicate '_Atomic' declaration specifier}} \
+ // ext-warning 3 {{'_Atomic' is a C11 extension}}
typedef const int const_int;
typedef const atomic_int const_atomic_int;
-typedef _Atomic const int const_atomic_int;
-typedef const _Atomic int const_atomic_int;
-typedef const _Atomic(int) const_atomic_int;
-typedef const _Atomic(_Atomic int) const_atomic_int; // expected-error {{_Atomic cannot be applied to atomic type '_Atomic(int)'}}
-typedef _Atomic const_int const_atomic_int;
-typedef _Atomic(const_int) const_atomic_int; // expected-error {{_Atomic cannot be applied to qualified type 'const_int' (aka 'const int')}}
+typedef _Atomic const int const_atomic_int; // ext-warning {{'_Atomic' is a C11 extension}}
+typedef const _Atomic int const_atomic_int; // ext-warning {{'_Atomic' is a C11 extension}}
+typedef const _Atomic(int) const_atomic_int; // ext-warning {{'_Atomic' is a C11 extension}}
+typedef const _Atomic(_Atomic int) const_atomic_int; // expected-error {{_Atomic cannot be applied to atomic type '_Atomic(int)'}} \
+ // ext-warning 2 {{'_Atomic' is a C11 extension}}
+typedef _Atomic const_int const_atomic_int; // ext-warning {{'_Atomic' is a C11 extension}}
+typedef _Atomic(const_int) const_atomic_int; // expected-error {{_Atomic cannot be applied to qualified type 'const_int' (aka 'const int')}} \
+ // ext-warning {{'_Atomic' is a C11 extension}}
-typedef int *_Atomic atomic_int_ptr;
-typedef _Atomic(int *) atomic_int_ptr;
-typedef int (*_Atomic atomic_int_ptr);
+typedef int *_Atomic atomic_int_ptr; // ext-warning {{'_Atomic' is a C11 extension}}
+typedef _Atomic(int *) atomic_int_ptr; // ext-warning {{'_Atomic' is a C11 extension}}
+typedef int (*_Atomic atomic_int_ptr); // ext-warning {{'_Atomic' is a C11 extension}}
-typedef int _Atomic *int_atomic_ptr;
-typedef _Atomic(int) *int_atomic_ptr;
+typedef int _Atomic *int_atomic_ptr; // ext-warning {{'_Atomic' is a C11 extension}}
+typedef _Atomic(int) *int_atomic_ptr; // ext-warning {{'_Atomic' is a C11 extension}}
typedef int int_fn();
-typedef _Atomic int_fn atomic_int_fn; // expected-error {{_Atomic cannot be applied to function type 'int_fn' (aka 'int ()')}}
-typedef _Atomic int atomic_int_array[3];
-typedef _Atomic atomic_int_array atomic_int_atomic_array; // expected-error {{_Atomic cannot be applied to array type 'atomic_int_array' (aka '_Atomic(int) [3]')}}
+typedef _Atomic int_fn atomic_int_fn; // expected-error {{_Atomic cannot be applied to function type 'int_fn' (aka 'int ()')}} \
+ // ext-warning {{'_Atomic' is a C11 extension}}
+typedef _Atomic int atomic_int_array[3]; // ext-warning {{'_Atomic' is a C11 extension}}
+typedef _Atomic atomic_int_array atomic_int_atomic_array; // expected-error {{_Atomic cannot be applied to array type 'atomic_int_array' (aka '_Atomic(int) [3]')}} \
+ // ext-warning {{'_Atomic' is a C11 extension}}
-_Atomic struct S { int n; }; // expected-warning {{'_Atomic' ignored on this declaration}}
+_Atomic struct S { int n; }; // expected-warning {{'_Atomic' ignored on this declaration}} \
+ // ext-warning {{'_Atomic' is a C11 extension}}
-typedef _Atomic int __attribute__((address_space(1))) atomic_addr_space_int;
-typedef _Atomic(int) __attribute__((address_space(1))) atomic_addr_space_int;
+typedef _Atomic int __attribute__((address_space(1))) atomic_addr_space_int; // ext-warning {{'_Atomic' is a C11 extension}}
+typedef _Atomic(int) __attribute__((address_space(1))) atomic_addr_space_int; // ext-warning {{'_Atomic' is a C11 extension}}
-typedef _Atomic int __attribute__((vector_size(16))) atomic_vector_int;
-typedef _Atomic(int __attribute__((vector_size(16)))) atomic_vector_int;
+typedef _Atomic int __attribute__((vector_size(16))) atomic_vector_int; // ext-warning {{'_Atomic' is a C11 extension}}
+typedef _Atomic(int __attribute__((vector_size(16)))) atomic_vector_int; // ext-warning {{'_Atomic' is a C11 extension}}
struct S
-_Atomic atomic_s_no_missing_semicolon;
+_Atomic atomic_s_no_missing_semicolon; // ext-warning {{'_Atomic' is a C11 extension}}
-int *const _Atomic atomic_return_type();
+int *const _Atomic atomic_return_type(); // ext-warning {{'_Atomic' is a C11 extension}}
diff --git a/src/llvm-project/clang/test/Parser/c11-noreturn.c b/src/llvm-project/clang/test/Parser/c11-noreturn.c
index 9b932ab..6666731 100644
--- a/src/llvm-project/clang/test/Parser/c11-noreturn.c
+++ b/src/llvm-project/clang/test/Parser/c11-noreturn.c
@@ -15,4 +15,4 @@
_Noreturn struct S; // expected-error {{'_Noreturn' can only appear on functions}}
_Noreturn enum E { e }; // expected-error {{'_Noreturn' can only appear on functions}}
-// CHECK-EXT: _Noreturn functions are a C11-specific feature
+// CHECK-EXT: '_Noreturn' is a C11 extension
diff --git a/src/llvm-project/clang/test/Parser/c1x-alignas.c b/src/llvm-project/clang/test/Parser/c1x-alignas.c
index ce8436c..8f3d9bd 100644
--- a/src/llvm-project/clang/test/Parser/c1x-alignas.c
+++ b/src/llvm-project/clang/test/Parser/c1x-alignas.c
@@ -9,5 +9,5 @@
char _Alignas(_Alignof(int)) c5;
-// CHECK-EXT: _Alignas is a C11-specific feature
-// CHECK-EXT: _Alignof is a C11-specific feature
+// CHECK-EXT: '_Alignas' is a C11 extension
+// CHECK-EXT: '_Alignof' is a C11 extension
diff --git a/src/llvm-project/clang/test/Parser/c99.c b/src/llvm-project/clang/test/Parser/c99.c
new file mode 100644
index 0000000..1213a20
--- /dev/null
+++ b/src/llvm-project/clang/test/Parser/c99.c
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -verify -pedantic -fsyntax-only -std=c99 %s
+// RUN: %clang_cc1 -verify=expected,ext -pedantic -Wno-comment -fsyntax-only -std=c89 %s
+// RUN: %clang_cc1 -verify=expected,ext -pedantic -fsyntax-only -x c++ %s
+
+double _Imaginary foo; // ext-warning {{'_Imaginary' is a C99 extension}} \
+ // expected-error {{imaginary types are not supported}}
+double _Complex bar; // ext-warning {{'_Complex' is a C99 extension}}
+
+#if !defined(__cplusplus)
+_Bool baz; // ext-warning {{'_Bool' is a C99 extension}}
+#endif
diff --git a/src/llvm-project/clang/test/Parser/crash-report.c b/src/llvm-project/clang/test/Parser/crash-report.c
index ef65b88..6ca1045 100644
--- a/src/llvm-project/clang/test/Parser/crash-report.c
+++ b/src/llvm-project/clang/test/Parser/crash-report.c
@@ -1,9 +1,8 @@
// RUN: not --crash %clang_cc1 %s 2>&1 | FileCheck %s
// REQUIRES: crash-recovery
-// FIXME: CHECKs might be incompatible to win32.
// Stack traces also require back traces.
-// REQUIRES: shell, backtrace
+// REQUIRES: backtrace
#prag\
ma clang __debug crash
diff --git a/src/llvm-project/clang/test/Parser/cxx-ambig-decl-expr.cpp b/src/llvm-project/clang/test/Parser/cxx-ambig-decl-expr.cpp
index 6507eaf..02857e2 100644
--- a/src/llvm-project/clang/test/Parser/cxx-ambig-decl-expr.cpp
+++ b/src/llvm-project/clang/test/Parser/cxx-ambig-decl-expr.cpp
@@ -17,3 +17,25 @@
auto (*r)() -> int(*)(unknown + 1); // expected-error {{undeclared identifier 'unknown'}}
int f(unknown const x); // expected-error {{unknown type name 'unknown'}}
+
+// Disambiguating an array declarator from an array subscripting.
+void arr() {
+ int x[] = {1}; // expected-note 2{{previous}}
+
+ // This is array indexing not an array declarator because a comma expression
+ // is not syntactically a constant-expression.
+ int(x[1,1]); // expected-warning 2{{unused}}
+
+ // This is array indexing not an array declaration because a braced-init-list
+ // is not syntactically a constant-expression.
+ int(x[{0}]); // expected-error {{array subscript is not an integer}}
+ struct A {
+ struct Q { int n; };
+ int operator[](Q);
+ } a;
+ int(a[{0}]); // expected-warning {{unused}}
+
+ // These are array declarations.
+ int(x[(1,1)]); // expected-error {{redefinition}}
+ int(x[true ? 1,1 : 1]); // expected-error {{redefinition}}
+}
diff --git a/src/llvm-project/clang/test/Parser/cxx-concept-declaration.cpp b/src/llvm-project/clang/test/Parser/cxx-concept-declaration.cpp
index 2e9d1ac..41bf53a 100644
--- a/src/llvm-project/clang/test/Parser/cxx-concept-declaration.cpp
+++ b/src/llvm-project/clang/test/Parser/cxx-concept-declaration.cpp
@@ -3,5 +3,5 @@
// Disabled for now.
// expected-no-diagnostics
-// RUN: %clang_cc1 -std=c++14 -fconcepts-ts -x c++ -verify %s
+// RUN: %clang_cc1 -std=c++14 -x c++ -verify %s
// template<typename T> concept C1 = true;
diff --git a/src/llvm-project/clang/test/Parser/cxx-concepts-ambig-constraint-expr.cpp b/src/llvm-project/clang/test/Parser/cxx-concepts-ambig-constraint-expr.cpp
index 12ab338..f85cfce 100644
--- a/src/llvm-project/clang/test/Parser/cxx-concepts-ambig-constraint-expr.cpp
+++ b/src/llvm-project/clang/test/Parser/cxx-concepts-ambig-constraint-expr.cpp
@@ -1,29 +1,9 @@
-// RUN: %clang_cc1 -std=c++14 -fconcepts-ts -x c++ %s -verify
+// RUN: %clang_cc1 -std=c++2a -x c++ %s -verify
// Test parsing of constraint-expressions in cases where the grammar is
// ambiguous with the expectation that the longest token sequence which matches
// the syntax is consumed without backtracking.
// type-specifier-seq in conversion-type-id
-template <typename T> requires (bool)&T::operator short
-unsigned int foo(); // expected-error {{C++ requires a type specifier for all declarations}}
-
-// type-specifier-seq in new-type-id
-template <typename T> requires (bool)sizeof new (T::f()) short
-unsigned int bar(); // expected-error {{C++ requires a type specifier for all declarations}}
-
-template<typename T> requires (bool)sizeof new (T::f()) unsigned // expected-error {{'struct' cannot be signed or unsigned}}
-struct X { }; // expected-error {{'X' cannot be defined in a type specifier}}
-
-// C-style cast
-// of function call on function-style cast
-template <typename T> requires (bool(T()))
-T (*fp)(); // expected-error {{use of undeclared identifier 'fp'}}
-
-// function-style cast
-// as the callee in a function call
-struct A {
- static int t;
- template <typename T> requires bool(T())
- (A(T (&t))) { } // expected-error {{called object type 'bool' is not a function or function pointer}}
-};
+template <typename T> requires T::operator short
+unsigned int foo(); // expected-error {{C++ requires a type specifier for all declarations}}
\ No newline at end of file
diff --git a/src/llvm-project/clang/test/Parser/cxx-concepts-requires-clause.cpp b/src/llvm-project/clang/test/Parser/cxx-concepts-requires-clause.cpp
index 01893a9..9cef4c6 100644
--- a/src/llvm-project/clang/test/Parser/cxx-concepts-requires-clause.cpp
+++ b/src/llvm-project/clang/test/Parser/cxx-concepts-requires-clause.cpp
@@ -1,13 +1,11 @@
-// RUN: %clang_cc1 -std=c++14 -fconcepts-ts -x c++ %s -verify
-// expected-no-diagnostics
+// RUN: %clang_cc1 -std=c++2a -x c++ %s -verify
// Test parsing of the optional requires-clause in a template-declaration.
template <typename T> requires true
void foo() { }
-
-template <typename T> requires !0
+template <typename T> requires (!0)
struct A {
void foo();
struct AA;
@@ -27,31 +25,30 @@
using MQ = M<TT>;
};
-template <typename T> requires !0
+template <typename T> requires (!0)
void A<T>::foo() { }
-template <typename T> requires !0
+template <typename T> requires (!0)
struct A<T>::AA { };
-template <typename T> requires !0
+template <typename T> requires (!0)
enum A<T>::E : int { E0 };
-template <typename T> requires !0
+template <typename T> requires (!0)
int A<T>::x = 0;
-template <typename T> requires !0
+template <typename T> requires (!0)
template <typename> requires true
void A<T>::Mfoo() { }
-template <typename T> requires !0
+template <typename T> requires (!0)
template <typename> requires true
struct A<T>::M { };
-template <typename T> requires !0
+template <typename T> requires (!0)
template <typename> requires true
int A<T>::Mx = 0;
-
template <typename T> requires true
int x = 0;
@@ -80,3 +77,81 @@
template <typename> requires true
int C::Mx = 0;
+
+// Test behavior with non-primary-expression requires clauses
+
+template<typename T> requires foo<T>()
+// expected-error@-1{{parentheses are required around this expression in a requires clause}}
+struct B1 { };
+
+int func() { }
+
+template<typename T> requires func()
+// expected-error@-1{{atomic constraint must be of type 'bool' (found '<overloaded function type>')}}
+// expected-note@-2{{parentheses are required around this expression in a requires clause}}
+struct B2 { };
+
+template<typename T> requires (foo<T>())
+struct B3 { };
+
+template<typename T> requires T{}
+// expected-error@-1{{parentheses are required around this expression in a requires clause}}
+struct B4 { };
+
+template<typename T> requires sizeof(T) == 0
+// expected-error@-1{{parentheses are required around this expression in a requires clause}}
+struct B5 { };
+
+template<typename T> requires (sizeof(T)) == 0
+// expected-error@-1{{parentheses are required around this expression in a requires clause}}
+struct B6 { };
+
+template<typename T> requires 0
+// expected-error@-1{{atomic constraint must be of type 'bool' (found 'int')}}
+(int) bar() { };
+
+template<typename T> requires foo<T>
+(int) bar() { };
+// expected-error@-1{{expected '(' for function-style cast or type construction}}
+
+template<typename T>
+void bar() requires foo<T>();
+// expected-error@-1{{parentheses are required around this expression in a requires clause}}
+
+template<typename T>
+void bar() requires (foo<T>());
+
+template<typename T>
+void bar() requires func();
+// expected-error@-1{{atomic constraint must be of type 'bool' (found '<overloaded function type>')}}
+// expected-note@-2{{parentheses are required around this expression in a requires clause}}
+
+template<typename T>
+void bar() requires T{};
+// expected-error@-1{{parentheses are required around this expression in a requires clause}}
+
+template<typename T>
+void bar() requires sizeof(T) == 0;
+// expected-error@-1{{parentheses are required around this expression in a requires clause}}
+
+template<typename T>
+void bar() requires (sizeof(T)) == 0;
+// expected-error@-1{{parentheses are required around this expression in a requires clause}}
+
+void bar(int x, int y) requires (x, y, true);
+
+struct B {
+ int x;
+ void foo(int y) requires (x, this, this->x, y, true);
+ static void bar(int y) requires (x, true);
+ // expected-error@-1{{'this' cannot be implicitly used in a static member function declaration}}
+ static void baz(int y) requires (this, true);
+ // expected-error@-1{{'this' cannot be used in a static member function declaration}}
+};
+
+auto lambda1 = [] (auto x) requires (sizeof(decltype(x)) == 1) { };
+
+auto lambda2 = [] (auto x) constexpr -> int requires (sizeof(decltype(x)) == 1) { return 0; };
+
+auto lambda3 = [] requires (sizeof(char) == 1) { };
+// expected-error@-1{{lambda requires '()' before 'requires' clause}}
\ No newline at end of file
diff --git a/src/llvm-project/clang/test/Parser/cxx-decl.cpp b/src/llvm-project/clang/test/Parser/cxx-decl.cpp
index c60e42f..1914f34 100644
--- a/src/llvm-project/clang/test/Parser/cxx-decl.cpp
+++ b/src/llvm-project/clang/test/Parser/cxx-decl.cpp
@@ -6,6 +6,8 @@
int x(*g); // expected-error {{use of undeclared identifier 'g'}}
+private int cplusplus_is_not_opencl; // expected-error {{expected unqualified-id}}
+
struct Type {
int Type;
};
@@ -236,12 +238,11 @@
namespace PR17255 {
void foo() {
- typename A::template B<>; // expected-error {{use of undeclared identifier 'A'}}
- // expected-error@-1 {{'template' keyword not permitted here}}
+ typename A::template B<> c; // expected-error {{use of undeclared identifier 'A'}}
#if __cplusplus <= 199711L
+ // expected-error@-2 {{'typename' occurs outside of a template}}
// expected-error@-3 {{'template' keyword outside of a template}}
#endif
- // expected-error@-5 {{expected a qualified name after 'typename'}}
}
}
diff --git a/src/llvm-project/clang/test/Parser/cxx-default-delete.cpp b/src/llvm-project/clang/test/Parser/cxx-default-delete.cpp
index 8766d86..6c74937 100644
--- a/src/llvm-project/clang/test/Parser/cxx-default-delete.cpp
+++ b/src/llvm-project/clang/test/Parser/cxx-default-delete.cpp
@@ -21,3 +21,7 @@
struct quux {
int quux() = default; // expected-error{{constructor cannot have a return type}}
};
+
+struct attrs {
+ [[noreturn]] friend void deleted_with_attrs() = delete;
+};
diff --git a/src/llvm-project/clang/test/Parser/cxx-template-decl.cpp b/src/llvm-project/clang/test/Parser/cxx-template-decl.cpp
index 0731678..cb8a93f 100644
--- a/src/llvm-project/clang/test/Parser/cxx-template-decl.cpp
+++ b/src/llvm-project/clang/test/Parser/cxx-template-decl.cpp
@@ -261,3 +261,11 @@
template<int Q::N> struct C; // expected-error {{parameter declarator cannot be qualified}}
template<int f(int a = 0)> struct D; // expected-error {{default arguments can only be specified for parameters in a function declaration}}
}
+
+namespace AnnotateAfterInvalidTemplateId {
+ template<int I, int J> struct A { };
+ template<int J> struct A<0, J> { }; // expected-note {{J = 0}}
+ template<int I> struct A<I, 0> { }; // expected-note {{I = 0}}
+
+ void f() { A<0, 0>::f(); } // expected-error {{ambiguous partial specializations}}
+}
diff --git a/src/llvm-project/clang/test/Parser/cxx0x-decl.cpp b/src/llvm-project/clang/test/Parser/cxx0x-decl.cpp
index 7bd82e8..3c1c360 100644
--- a/src/llvm-project/clang/test/Parser/cxx0x-decl.cpp
+++ b/src/llvm-project/clang/test/Parser/cxx0x-decl.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -verify -fsyntax-only -std=c++11 -pedantic-errors -triple x86_64-linux-gnu %s
+// RUN: %clang_cc1 -verify -fsyntax-only -std=c++2a -pedantic-errors -triple x86_64-linux-gnu %s
// Make sure we know these are legitimate commas and not typos for ';'.
namespace Commas {
@@ -39,7 +39,7 @@
// PR9903
struct SS {
- typedef void d() = default; // expected-error {{function definition declared 'typedef'}} expected-error {{only special member functions may be defaulted}}
+ typedef void d() = default; // expected-error {{function definition declared 'typedef'}} expected-error {{only special member functions and comparison operators may be defaulted}}
};
using PR14855 = int S::; // expected-error {{expected ';' after alias declaration}}
@@ -108,14 +108,25 @@
}
namespace DuplicateSpecifier {
- constexpr constexpr int f(); // expected-warning {{duplicate 'constexpr' declaration specifier}}
- constexpr int constexpr a = 0; // expected-warning {{duplicate 'constexpr' declaration specifier}}
+ constexpr constexpr int f(); // expected-error {{duplicate 'constexpr' declaration specifier}}
+ constexpr int constexpr a = 0; // expected-error {{duplicate 'constexpr' declaration specifier}}
struct A {
friend constexpr int constexpr friend f(); // expected-warning {{duplicate 'friend' declaration specifier}} \
- // expected-warning {{duplicate 'constexpr' declaration specifier}}
+ // expected-error {{duplicate 'constexpr' declaration specifier}}
friend struct A friend; // expected-warning {{duplicate 'friend'}} expected-error {{'friend' must appear first}}
};
+
+ constinit constexpr int n1 = 0; // expected-error {{cannot combine with previous 'constinit'}}
+ constexpr constinit int n2 = 0; // expected-error {{cannot combine with previous 'constexpr'}}
+ constinit constinit int n3 = 0; // expected-error {{duplicate 'constinit' declaration specifier}}
+
+ consteval constexpr int f1(); // expected-error {{cannot combine with previous 'consteval'}}
+ constexpr consteval int f2(); // expected-error {{cannot combine with previous 'constexpr'}}
+ consteval consteval int f3(); // expected-error {{duplicate 'consteval' declaration specifier}}
+
+ constinit consteval int wat = 0; // expected-error {{cannot combine with previous 'constinit'}}
+ consteval constinit int huh(); // expected-error {{cannot combine with previous 'consteval'}}
}
namespace ColonColonDecltype {
diff --git a/src/llvm-project/clang/test/Parser/cxx0x-lambda-expressions.cpp b/src/llvm-project/clang/test/Parser/cxx0x-lambda-expressions.cpp
index b297d73..d509177 100644
--- a/src/llvm-project/clang/test/Parser/cxx0x-lambda-expressions.cpp
+++ b/src/llvm-project/clang/test/Parser/cxx0x-lambda-expressions.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -fsyntax-only -Wno-unused-value -verify -std=c++11 %s
-// RUN: %clang_cc1 -fsyntax-only -Wno-unused-value -verify -std=c++2a %s
+// RUN: %clang_cc1 -fsyntax-only -Wno-unused-value -verify -std=c++11 -Wno-c99-designator %s
+// RUN: %clang_cc1 -fsyntax-only -Wno-unused-value -verify -std=c++2a -Wno-c99-designator %s
enum E { e };
@@ -126,6 +126,19 @@
template void PR22122<int>();
+namespace PR42778 {
+struct A {
+ template <class F> A(F&&) {}
+};
+
+struct S {
+ void mf() { A{[*this]{}}; }
+#if __cplusplus < 201703L
+ // expected-warning@-2 {{C++17 extension}}
+#endif
+};
+}
+
struct S {
template <typename T>
void m (T x =[0); // expected-error{{expected variable name or 'this' in lambda capture list}}
diff --git a/src/llvm-project/clang/test/Parser/cxx1z-decomposition.cpp b/src/llvm-project/clang/test/Parser/cxx1z-decomposition.cpp
index ccd7706..b791870 100644
--- a/src/llvm-project/clang/test/Parser/cxx1z-decomposition.cpp
+++ b/src/llvm-project/clang/test/Parser/cxx1z-decomposition.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -std=c++1z %s -verify -fcxx-exceptions
-// RUN: not %clang_cc1 -std=c++1z %s -emit-llvm-only -fcxx-exceptions
+// RUN: %clang_cc1 -std=c++17 %s -verify -fcxx-exceptions
+// RUN: not %clang_cc1 -std=c++17 %s -emit-llvm-only -fcxx-exceptions
struct S { int a, b, c; };
@@ -67,8 +67,8 @@
struct S { int n; } s;
void f() {
// storage-class-specifiers
- static auto &[a] = n; // expected-warning {{declared 'static' is a C++2a extension}}
- thread_local auto &[b] = n; // expected-warning {{declared 'thread_local' is a C++2a extension}}
+ static auto &[a] = n; // expected-warning {{declared 'static' is a C++20 extension}}
+ thread_local auto &[b] = n; // expected-warning {{declared 'thread_local' is a C++20 extension}}
extern auto &[c] = n; // expected-error {{cannot be declared 'extern'}} expected-error {{cannot have an initializer}}
struct S {
mutable auto &[d] = n; // expected-error {{not permitted in this context}}
@@ -85,7 +85,7 @@
}
static constexpr inline thread_local auto &[j1] = n; // expected-error {{cannot be declared with 'constexpr inline' specifiers}}
- static thread_local auto &[j2] = n; // expected-warning {{declared with 'static thread_local' specifiers is a C++2a extension}}
+ static thread_local auto &[j2] = n; // expected-warning {{declared with 'static thread_local' specifiers is a C++20 extension}}
inline auto &[k] = n; // expected-error {{cannot be declared 'inline'}}
diff --git a/src/llvm-project/clang/test/Parser/cxx2a-abbreviated-templates.cpp b/src/llvm-project/clang/test/Parser/cxx2a-abbreviated-templates.cpp
new file mode 100644
index 0000000..6562389
--- /dev/null
+++ b/src/llvm-project/clang/test/Parser/cxx2a-abbreviated-templates.cpp
@@ -0,0 +1,44 @@
+// RUN: %clang_cc1 -std=c++2a -x c++ %s -verify
+// expected-no-diagnostics
+
+template<typename T, typename U=void>
+concept C = true;
+
+namespace ns {
+ template<typename T, typename U=void>
+ concept D = true;
+}
+
+void foo1(C auto a,
+ C<int> auto b,
+ ns::D auto c,
+ ns::D<int> auto d,
+ const C auto e,
+ const C<int> auto f,
+ const ns::D auto g,
+ const ns::D<int> auto h);
+void foo2(C auto a);
+void foo3(C<int> auto b);
+void foo4(ns::D auto c);
+void foo5(ns::D<int> auto d);
+void foo6(const C auto e);
+void foo7(const C<int> auto f);
+void foo8(const ns::D auto g);
+void foo9(const ns::D<int> auto h);
+
+struct S1 { S1(C auto a,
+ C<int> auto b,
+ ns::D auto c,
+ ns::D<int> auto d,
+ const C auto e,
+ const C<int> auto f,
+ const ns::D auto g,
+ const ns::D<int> auto h); };
+struct S2 { S2(C auto a); };
+struct S3 { S3(C<int> auto b); };
+struct S4 { S4(ns::D auto c); };
+struct S5 { S5(ns::D<int> auto d); };
+struct S6 { S6(const C auto e); };
+struct S7 { S7(const C<int> auto f); };
+struct S8 { S8(const ns::D auto g); };
+struct S9 { S9(const ns::D<int> auto h); };
\ No newline at end of file
diff --git a/src/llvm-project/clang/test/Parser/cxx2a-concept-declaration.cpp b/src/llvm-project/clang/test/Parser/cxx2a-concept-declaration.cpp
index d80b3db..a7c69c2 100644
--- a/src/llvm-project/clang/test/Parser/cxx2a-concept-declaration.cpp
+++ b/src/llvm-project/clang/test/Parser/cxx2a-concept-declaration.cpp
@@ -1,6 +1,6 @@
// Support parsing of concepts
-// RUN: %clang_cc1 -std=c++2a -fconcepts-ts -verify %s
+// RUN: %clang_cc1 -std=c++20 -verify %s
template<typename T> concept C1 = true; // expected-note 2{{previous}}
template<typename T> concept C1 = true; // expected-error{{redefinition}}
@@ -14,8 +14,6 @@
// expected-error@-2{{template template parameter requires 'class' after the parameter list}}
// expected-error@-3{{concept template parameter list must have at least one parameter; explicit specialization of concepts is not allowed}}
-template<typename T> concept C2 = 0.f; // expected-error {{constraint expression must be of type 'bool' but is of type 'float'}}
-
struct S1 {
template<typename T> concept C1 = true; // expected-error {{concept declarations may only appear in global or namespace scope}}
};
@@ -26,15 +24,15 @@
template<typename A>
template<typename B>
-concept C4 = true; // expected-error {{extraneous template parameter list in concept definition}}
+concept C2 = true; // expected-error {{extraneous template parameter list in concept definition}}
-template<typename T> concept C5 = true; // expected-note {{previous}} expected-note {{previous}}
-int C5; // expected-error {{redefinition}}
-struct C5 {}; // expected-error {{redefinition}}
+template<typename T> concept C3 = true; // expected-note {{previous}} expected-note {{previous}}
+int C3; // expected-error {{redefinition}}
+struct C3 {}; // expected-error {{redefinition}}
-struct C6 {}; // expected-note{{previous definition is here}}
-template<typename T> concept C6 = true;
-// expected-error@-1{{redefinition of 'C6' as different kind of symbol}}
+struct C4 {}; // expected-note{{previous definition is here}}
+template<typename T> concept C4 = true;
+// expected-error@-1{{redefinition of 'C4' as different kind of symbol}}
// TODO: Add test to prevent explicit specialization, partial specialization
// and explicit instantiation of concepts.
@@ -43,31 +41,60 @@
struct integral_constant { static constexpr T value = v; };
namespace N {
- template<typename T> concept C7 = true;
+ template<typename T> concept C5 = true;
}
-using N::C7;
+using N::C5;
-template <bool word> concept C8 = integral_constant<bool, wor>::value;
+template <bool word> concept C6 = integral_constant<bool, wor>::value;
// expected-error@-1{{use of undeclared identifier 'wor'; did you mean 'word'?}}
// expected-note@-2{{'word' declared here}}
-template<typename T> concept bool C9 = true;
-// expected-warning@-1{{ISO C++2a does not permit the 'bool' keyword after 'concept'}}
+template<typename T> concept bool C7 = true;
+// expected-warning@-1{{ISO C++20 does not permit the 'bool' keyword after 'concept'}}
-template<> concept C10 = false;
+template<> concept C8 = false;
// expected-error@-1{{concept template parameter list must have at least one parameter; explicit specialization of concepts is not allowed}}
-template<> concept C9<int> = false;
+template<> concept C7<int> = false;
// expected-error@-1{{name defined in concept definition must be an identifier}}
-template<typename T> concept N::C11 = false;
+template<typename T> concept N::C9 = false;
// expected-error@-1{{name defined in concept definition must be an identifier}}
class A { };
// expected-note@-1{{'A' declared here}}
-template<typename T> concept A::C12 = false;
+template<typename T> concept A::C10 = false;
// expected-error@-1{{expected namespace name}}
template<typename T> concept operator int = false;
// expected-error@-1{{name defined in concept definition must be an identifier}}
+
+template<bool x> concept C11 = 2; // expected-error {{atomic constraint must be of type 'bool' (found 'int')}}
+template<bool x> concept C12 = 2 && x; // expected-error {{atomic constraint must be of type 'bool' (found 'int')}}
+template<bool x> concept C13 = x || 2 || x; // expected-error {{atomic constraint must be of type 'bool' (found 'int')}}
+template<bool x> concept C14 = 8ull && x || x; // expected-error {{atomic constraint must be of type 'bool' (found 'unsigned long long')}}
+template<typename T> concept C15 = sizeof(T); // expected-error {{atomic constraint must be of type 'bool'}}
+template<typename T> concept C16 = true && (0 && 0); // expected-error {{atomic constraint must be of type 'bool' (found 'int')}}
+// expected-warning@-1{{use of logical '&&' with constant operand}}
+// expected-note@-2{{use '&' for a bitwise operation}}
+// expected-note@-3{{remove constant to silence this warning}}
+template<typename T> concept C17 = T{};
+static_assert(!C17<bool>);
+template<typename T> concept C18 = (bool&&)true;
+static_assert(C18<int>);
+template<typename T> concept C19 = (const bool&)true;
+static_assert(C19<int>);
+template<typename T> concept C20 = (const bool)true;
+static_assert(C20<int>);
+template <bool c> concept C21 = integral_constant<bool, c>::value && true;
+static_assert(C21<true>);
+static_assert(!C21<false>);
+template <bool c> concept C22 = integral_constant<bool, c>::value;
+static_assert(C22<true>);
+static_assert(!C22<false>);
+
+template <bool word> concept C23 = integral_constant<bool, wor>::value;
+// expected-error@-1{{use of undeclared identifier 'wor'; did you mean 'word'?}}
+// expected-note@-2{{'word' declared here}}
+
diff --git a/src/llvm-project/clang/test/Parser/cxx2a-concepts-requires-expr.cpp b/src/llvm-project/clang/test/Parser/cxx2a-concepts-requires-expr.cpp
new file mode 100644
index 0000000..fa42b06
--- /dev/null
+++ b/src/llvm-project/clang/test/Parser/cxx2a-concepts-requires-expr.cpp
@@ -0,0 +1,145 @@
+// RUN: %clang_cc1 -std=c++2a -x c++ %s -verify
+
+bool r1 = requires () {};
+// expected-error@-1 {{a requires expression must contain at least one requirement}}
+
+bool r2 = requires { requires true; };
+
+bool r3 = requires (int a, ...) { requires true; };
+// expected-error@-1 {{varargs not allowed in requires expression}}
+
+template<typename... T>
+bool r4 = requires (T... ts) { requires true; };
+
+bool r5 = requires (bool c, int d) { c; d; };
+
+bool r6 = requires (bool c, int d) { c; d; } && decltype(d){};
+// expected-error@-1 {{use of undeclared identifier 'd'}}
+
+bool r7 = requires (bool c) { c; (requires (int d) { c; d; }); d; } && decltype(c){} && decltype(d){};
+// expected-error@-1 2{{use of undeclared identifier 'd'}}
+// expected-error@-2 {{use of undeclared identifier 'c'}}
+
+bool r8 = requires (bool, int) { requires true; };
+
+bool r9 = requires (bool a, int a) { requires true; };
+// expected-error@-1 {{redefinition of parameter 'a'}}
+// expected-note@-2 {{previous declaration is here}}
+
+bool r10 = requires (struct new_struct { int x; } s) { requires true; };
+// expected-error@-1 {{'new_struct' cannot be defined in a parameter type}}
+
+bool r11 = requires (int x(1)) { requires true; };
+// expected-error@-1 {{expected parameter declarator}}
+// expected-error@-2 {{expected ')'}}
+// expected-note@-3 {{to match this '('}}
+
+bool r12 = requires (int x = 10) { requires true; };
+// expected-error@-1 {{default arguments not allowed for parameters of a requires expression}}
+
+bool r13 = requires (int f(int)) { requires true; };
+
+bool r14 = requires (int (*f)(int)) { requires true; };
+
+bool r15 = requires (10) { requires true; };
+// expected-error@-1 {{expected parameter declarator}}
+
+bool r16 = requires (auto x) { requires true; };
+// expected-error@-1 {{'auto' not allowed in requires expression parameter}}
+
+bool r17 = requires (auto [x, y]) { requires true; };
+// expected-error@-1 {{'auto' not allowed in requires expression parameter}}
+// expected-error@-2 {{use of undeclared identifier 'x'}}
+
+using a = int;
+
+bool r18 = requires { typename a; };
+
+bool r19 = requires { typename ::a; };
+
+template<typename T> struct identity { using type = T; };
+
+template<typename T> using identity_t = T;
+
+bool r20 = requires {
+ typename identity<int>::type;
+ typename identity<int>;
+ typename ::identity_t<int>;
+};
+
+struct s { bool operator==(const s&); ~s(); };
+
+bool r21 = requires { typename s::operator==; };
+// expected-error@-1 {{expected an identifier or template-id after '::'}}
+
+bool r22 = requires { typename s::~s; };
+// expected-error@-1 {{expected an identifier or template-id after '::'}}
+
+template<typename T>
+bool r23 = requires { typename identity<T>::temp<T>; };
+// expected-error@-1 {{use 'template' keyword to treat 'temp' as a dependent template name}}
+
+template<typename T>
+bool r24 = requires {
+ typename identity<T>::template temp<T>;
+ typename identity<T>::template temp; // expected-error{{expected an identifier or template-id after '::'}}
+};
+
+bool r25 = requires { ; };
+// expected-error@-1 {{expected expression}}
+
+bool r26 = requires { {}; };
+// expected-error@-1 {{expected expression}}
+
+bool r27 = requires { { 0 } noexcept; };
+
+bool r28 = requires { { 0 } noexcept noexcept; };
+// expected-error@-1 {{expected '->' before expression type requirement}}
+// expected-error@-2 {{expected concept name with optional arguments}}
+
+template<typename T>
+concept C1 = true;
+
+template<typename T, typename U>
+concept C2 = true;
+
+bool r29 = requires { { 0 } noexcept C1; };
+// expected-error@-1 {{expected '->' before expression type requirement}}
+
+bool r30 = requires { { 0 } noexcept -> C2<int>; };
+
+namespace ns { template<typename T> concept C = true; }
+
+bool r31 = requires { { 0 } noexcept -> ns::C; };
+
+template<typename T>
+T i1 = 0;
+
+bool r32 = requires { requires false, 1; };
+// expected-error@-1 {{expected ';' at end of requirement}}
+
+bool r33 = requires { 0 noexcept; };
+// expected-error@-1 {{'noexcept' can only be used in a compound requirement (with '{' '}' around the expression)}}
+
+bool r34 = requires { 0 int; };
+// expected-error@-1 {{expected ';' at end of requirement}}
+
+bool r35 = requires { requires true };
+// expected-error@-1 {{expected ';' at end of requirement}}
+
+bool r36 = requires (bool b) { requires sizeof(b) == 1; };
+
+void r37(bool b) requires requires { 1 } {}
+// expected-error@-1 {{expected ';' at end of requirement}}
+
+bool r38 = requires { requires { 1; }; };
+// expected-warning@-1 {{this requires expression will only be checked for syntactic validity; did you intend to place it in a nested requirement? (add another 'requires' before the expression)}}
+
+bool r39 = requires { requires () { 1; }; };
+// expected-warning@-1 {{this requires expression will only be checked for syntactic validity; did you intend to place it in a nested requirement? (add another 'requires' before the expression)}}
+
+bool r40 = requires { requires (int i) { i; }; };
+// expected-warning@-1 {{this requires expression will only be checked for syntactic validity; did you intend to place it in a nested requirement? (add another 'requires' before the expression)}}
+
+bool r41 = requires { requires (); };
+// expected-error@-1 {{expected expression}}
diff --git a/src/llvm-project/clang/test/Parser/cxx2a-constrained-template-param-with-partial-id.cpp b/src/llvm-project/clang/test/Parser/cxx2a-constrained-template-param-with-partial-id.cpp
new file mode 100644
index 0000000..0afe1e6
--- /dev/null
+++ b/src/llvm-project/clang/test/Parser/cxx2a-constrained-template-param-with-partial-id.cpp
@@ -0,0 +1,39 @@
+// RUN: %clang_cc1 -std=c++2a -x c++ %s -verify
+
+template<typename T, int a>
+concept C1 = true;
+
+template<C1 T>
+// expected-error@-1 {{'C1' requires more than 1 template argument; provide the remaining arguments explicitly to use it here}}
+using badA = T[10];
+
+template<C1<0> T>
+using A = T[10];
+
+using a = A<int>;
+
+namespace ns {
+ template<typename T, typename U, typename... X>
+ concept C2 = true;
+}
+
+template<ns::C2 T1, ::ns::C2 T2>
+// expected-error@-1 2{{'C2' requires more than 1 template argument; provide the remaining arguments explicitly to use it here}}
+requires (sizeof(T1) <= sizeof(T2))
+struct badB { };
+
+template<ns::C2<int> T1, ::ns::C2<char, T1> T2>
+ requires (sizeof(T1) <= sizeof(T2))
+struct B { };
+
+using b = B<int, int>;
+
+template<ns::C2... T1>
+// expected-error@-1 {{'C2' requires more than 1 template argument; provide the remaining arguments explicitly to use it here}}
+struct badC { };
+
+template<ns::C2<int>... T1>
+struct C { };
+
+using c1 = C<char, char, char>;
+using c2 = C<char, char, char, char>;
\ No newline at end of file
diff --git a/src/llvm-project/clang/test/Parser/cxx2a-constrained-template-param.cpp b/src/llvm-project/clang/test/Parser/cxx2a-constrained-template-param.cpp
new file mode 100644
index 0000000..6f14b66
--- /dev/null
+++ b/src/llvm-project/clang/test/Parser/cxx2a-constrained-template-param.cpp
@@ -0,0 +1,52 @@
+// RUN: %clang_cc1 -std=c++2a -x c++ %s -verify
+
+namespace type
+{
+ template<typename T>
+ concept C1 = true;
+
+ template<C1 T, C1 U = int>
+ using A = T[10];
+
+ using a = A<int>;
+
+ namespace ns {
+ template<typename T, int a = 0>
+ concept C2 = true;
+ }
+
+ template<ns::C2 T1, ::type::ns::C2 T2> requires (sizeof(T1) <= sizeof(T2))
+ struct B { };
+
+ using b = B<int, int>;
+
+ template<ns::C2... T1>
+ struct C { };
+
+ using c1 = C<char, char, char>;
+ using c2 = C<char, char, char, char>;
+}
+
+namespace non_type
+{
+ template<int v>
+ concept C1 = true;
+
+ template<C1 v, C1 u = 0> // expected-error{{expected a type}} // expected-note{{declared here}}
+ // expected-error@-1 2{{concept named in type constraint is not a type concept}}
+ // expected-error@-2 {{expected ',' or '>' in template-parameter-list}}
+ int A = v; // expected-error{{'v' does not refer to a value}}
+}
+
+namespace temp
+{
+ template<typename>
+ struct test1 { }; // expected-note{{template is declared here}}
+
+ template<template<typename> typename T>
+ concept C1 = true;
+
+ template<C1 TT, C1 UU = test1> // expected-error{{use of class template 'test1' requires template arguments}}
+ // expected-error@-1 2{{concept named in type constraint is not a type concept}}
+ using A = TT<int>; // expected-error{{expected ';' after alias declaration}}
+}
\ No newline at end of file
diff --git a/src/llvm-project/clang/test/Parser/cxx2a-designated-init.cpp b/src/llvm-project/clang/test/Parser/cxx2a-designated-init.cpp
new file mode 100644
index 0000000..9742141
--- /dev/null
+++ b/src/llvm-project/clang/test/Parser/cxx2a-designated-init.cpp
@@ -0,0 +1,25 @@
+// RUN: %clang_cc1 -std=c++98 -verify=cxx98 %s
+// RUN: %clang_cc1 -std=c++11 -verify %s -Wno-c++2a-extensions
+// RUN: %clang_cc1 -std=c++2a -verify %s
+
+struct A {
+ explicit A(int, int); // expected-note {{here}}
+};
+
+struct B {
+ A a;
+};
+
+B b1 = {.a = {1, 2}}; // cxx98-error {{non-aggregate type 'A' cannot be initialized with an initializer list}}
+// expected-error@-1 {{chosen constructor is explicit in copy-initialization}}
+B b2 = {.a{1, 2}}; // cxx98-error {{expected '='}}
+
+struct C {
+ char x, y;
+};
+struct D {
+ C c;
+};
+
+D d1 = {.c = {1, 2000}}; // cxx98-warning {{changes value}} expected-error {{narrow}} expected-warning {{changes value}} expected-note {{}}
+D d2 = {.c{1, 2000}}; // cxx98-error {{expected '='}} expected-error {{narrow}} expected-warning {{changes value}} expected-note {{}}
diff --git a/src/llvm-project/clang/test/Parser/cxx2a-inline-nested-namespace-definition.cpp b/src/llvm-project/clang/test/Parser/cxx2a-inline-nested-namespace-definition.cpp
index 660287c..f37dc8c 100644
--- a/src/llvm-project/clang/test/Parser/cxx2a-inline-nested-namespace-definition.cpp
+++ b/src/llvm-project/clang/test/Parser/cxx2a-inline-nested-namespace-definition.cpp
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++14
// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++17
-// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++2a -Wc++17-compat
+// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++20 -Wc++17-compat
namespace inline foo1::foo2::foo3 { // expected-error {{expected identifier or '{'}} expected-error {{use of undeclared identifier 'foo1'}}
}
@@ -10,11 +10,11 @@
#if __cplusplus <= 201402L
// expected-warning@+7 {{nested namespace definition is a C++17 extension; define each namespace separately}}
-// expected-warning@+6 {{inline nested namespace definition is a C++2a extension}}
+// expected-warning@+6 {{inline nested namespace definition is a C++20 extension}}
#elif __cplusplus <= 201703L
-// expected-warning@+4 {{inline nested namespace definition is a C++2a extension}}
+// expected-warning@+4 {{inline nested namespace definition is a C++20 extension}}
#else
-// expected-warning@+2 {{inline nested namespace definition is incompatible with C++ standards before C++2a}}
+// expected-warning@+2 {{inline nested namespace definition is incompatible with C++ standards before C++20}}
#endif
namespace valid1::valid2::inline valid3::inline valid4::valid5 {}
// expected-note@-1 2 {{previous definition is here}}
@@ -27,11 +27,11 @@
#if __cplusplus <= 201402L
// expected-warning@+7 {{nested namespace definition is a C++17 extension; define each namespace separately}}
-// expected-warning@+6 {{inline nested namespace definition is a C++2a extension}}
+// expected-warning@+6 {{inline nested namespace definition is a C++20 extension}}
#elif __cplusplus <= 201703L
-// expected-warning@+4 {{inline nested namespace definition is a C++2a extension}}
+// expected-warning@+4 {{inline nested namespace definition is a C++20 extension}}
#else
-// expected-warning@+2 {{inline nested namespace definition is incompatible with C++ standards before C++2a}}
+// expected-warning@+2 {{inline nested namespace definition is incompatible with C++ standards before C++20}}
#endif
namespace valid1::valid2::inline valid3::inline valid4::valid5 {}
// expected-note@-1 2 {{previous definition is here}}
diff --git a/src/llvm-project/clang/test/Parser/cxx2a-placeholder-type-constraint.cpp b/src/llvm-project/clang/test/Parser/cxx2a-placeholder-type-constraint.cpp
new file mode 100644
index 0000000..dc1d75e
--- /dev/null
+++ b/src/llvm-project/clang/test/Parser/cxx2a-placeholder-type-constraint.cpp
@@ -0,0 +1,35 @@
+// RUN: %clang_cc1 -std=c++2a -x c++ %s -verify
+
+template<typename T, typename U=void>
+concept C = true;
+
+namespace ns {
+ template<typename T, typename U=void>
+ concept D = true;
+}
+
+int foo() {
+ {ns::D auto a = 1;}
+ {C auto a = 1;}
+ {C<> auto a = 1;}
+ {C<int> auto a = 1;}
+ {ns::D<int> auto a = 1;}
+ {const ns::D auto &a = 1;}
+ {const C auto &a = 1;}
+ {const C<> auto &a = 1;}
+ {const C<int> auto &a = 1;}
+ {const ns::D<int> auto &a = 1;}
+ {C decltype(auto) a = 1;}
+ {C<> decltype(auto) a = 1;}
+ {C<int> decltype(auto) a = 1;}
+ {const C<> decltype(auto) &a = 1;} // expected-error{{'decltype(auto)' cannot be combined with other type specifiers}}
+ // expected-error@-1{{non-const lvalue reference to type 'int' cannot bind to a temporary of type 'int'}}
+ {const C<int> decltype(auto) &a = 1;} // expected-error{{'decltype(auto)' cannot be combined with other type specifiers}}
+ // expected-error@-1{{non-const lvalue reference to type 'int' cannot bind to a temporary of type 'int'}}
+ {C a = 1;}
+ // expected-error@-1{{expected 'auto' or 'decltype(auto)' after concept name}}
+ {C decltype a19 = 1;}
+ // expected-error@-1{{expected '('}}
+ {C decltype(1) a20 = 1;}
+ // expected-error@-1{{expected 'auto' or 'decltype(auto)' after concept name}}
+}
\ No newline at end of file
diff --git a/src/llvm-project/clang/test/Parser/cxx2a-spaceship.cpp b/src/llvm-project/clang/test/Parser/cxx2a-spaceship.cpp
index 24cece3..f80420f 100644
--- a/src/llvm-project/clang/test/Parser/cxx2a-spaceship.cpp
+++ b/src/llvm-project/clang/test/Parser/cxx2a-spaceship.cpp
@@ -16,3 +16,9 @@
X<3> e = x0 < x0 <=> x0 << x0;
X<3> f = x0 << x0 <=> x0 < x0; // expected-warning {{overloaded operator << has higher precedence than comparison operator}} expected-note 2{{}}
}
+
+struct PR41991 {
+ [[nodiscard]] friend bool operator==(const PR41991&, const PR41991&) = default;
+ [[nodiscard]] friend bool operator!=(const PR41991&, const PR41991&) = delete;
+ [[nodiscard]] friend bool operator<(const PR41991&, const PR41991&); // expected-error {{an attribute list cannot appear here}}
+};
diff --git a/src/llvm-project/clang/test/Parser/explicit-bool.cpp b/src/llvm-project/clang/test/Parser/explicit-bool.cpp
new file mode 100644
index 0000000..aa700bc
--- /dev/null
+++ b/src/llvm-project/clang/test/Parser/explicit-bool.cpp
@@ -0,0 +1,62 @@
+// RUN: %clang_cc1 -std=c++17 -verify=cxx17 -Wc++20-compat %s
+// RUN: %clang_cc1 -std=c++20 -verify=cxx20 -Wc++17-compat %s
+
+namespace disambig {
+
+// Cases that are valid in C++17 and before, ill-formed in C++20, and that we
+// should not treat as explicit(bool) as an extension.
+struct A { // cxx20-note +{{}}
+ constexpr A() {}
+ constexpr operator bool() { return true; }
+
+ constexpr explicit (A)(int); // #1
+ // cxx17-warning@#1 {{will be parsed as explicit(bool)}}
+ // cxx20-error@#1 +{{}} cxx20-note@#1 +{{}}
+ // cxx20-warning@#1 {{incompatible with C++ standards before C++20}}
+
+ // This is ill-formed (via a DR change), and shouldn't be recognized as a
+ // constructor (the function declarator cannot be parenthesized in a
+ // constructor declaration). But accepting it as an extension seems
+ // reasonable.
+ // FIXME: Produce an ExtWarn for this.
+ constexpr explicit (A(float)); // #1b
+ // cxx17-warning@#1b {{will be parsed as explicit(bool)}}
+ // cxx20-error@#1b +{{}}
+ // cxx20-warning@#1b {{incompatible with C++ standards before C++20}}
+
+ explicit (operator int)(); // #2
+ // cxx17-warning@#2 {{will be parsed as explicit(bool)}}
+ // cxx20-error@#2 +{{}}
+ // cxx20-warning@#2 {{incompatible with C++ standards before C++20}}
+
+ explicit (A::operator float)(); // #2b
+ // cxx17-warning@#2b {{will be parsed as explicit(bool)}}
+ // cxx17-error@#2b {{extra qualification on member}}
+ // cxx20-error@#2b +{{}}
+ // cxx20-warning@#2b {{incompatible with C++ standards before C++20}}
+};
+
+constexpr bool operator+(A) { return true; }
+
+constexpr bool C = false;
+
+// Cases that should (ideally) be disambiguated as explicit(bool) in earlier
+// language modes as an extension.
+struct B {
+ // Looks like a constructor, but not the constructor of B.
+ explicit (A()) B(); // #3
+ // cxx17-warning@#3 {{C++20 extension}}
+ // cxx20-warning@#3 {{incompatible with C++ standards before C++20}}
+
+ // Looks like a 'constructor' of C. Actually a constructor of B.
+ explicit (C)(B)(A); // #4
+ // cxx17-warning@#4 {{C++20 extension}}
+ // cxx20-warning@#4 {{incompatible with C++ standards before C++20}}
+
+ explicit (operator+(A())) operator int(); // #5
+ // cxx17-error@#5 {{requires a type specifier}} cxx17-error@#5 {{expected ';'}}
+ // cxx17-warning@#5 {{will be parsed as explicit(bool)}}
+ // cxx20-warning@#5 {{incompatible with C++ standards before C++20}}
+};
+
+}
diff --git a/src/llvm-project/clang/test/Parser/ms-inline-asm.c b/src/llvm-project/clang/test/Parser/ms-inline-asm.c
index 0170b2b..c6af1ea 100644
--- a/src/llvm-project/clang/test/Parser/ms-inline-asm.c
+++ b/src/llvm-project/clang/test/Parser/ms-inline-asm.c
@@ -57,6 +57,11 @@
__asm m{o}v eax, ebx // expected-error {{unknown token in expression}}
}
+void t14() {
+ enum { A = 1, B };
+ __asm mov eax, offset A // expected-error {{offset operator cannot yet handle constants}}
+}
+
int t_fail() { // expected-note {{to match this}}
__asm
__asm { // expected-error 3 {{expected}} expected-note {{to match this}}
diff --git a/src/llvm-project/clang/test/Parser/nested_blocks_overflow.cpp b/src/llvm-project/clang/test/Parser/nested_blocks_overflow.cpp
new file mode 100644
index 0000000..e8366a8
--- /dev/null
+++ b/src/llvm-project/clang/test/Parser/nested_blocks_overflow.cpp
@@ -0,0 +1,54 @@
+// RUN: %clang %s -fsyntax-only -fblocks -fbracket-depth=512
+// RUN: not %clang %s -fsyntax-only -fblocks -fbracket-depth=512 -DFAIL 2>&1 | FileCheck %s
+
+template <class T> int foo(T &&t);
+
+void bar(int x = foo(
+^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(
+^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(
+^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(
+^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(
+^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(
+^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(
+^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(
+^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(
+^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(
+^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(
+^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(
+^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(
+^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(
+^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(
+^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(
+
+^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(^(int x = foo(
+
+#ifdef FAIL
+^(int x = foo(
+#endif
+
+^(int x = foo(1)){}
+
+#ifdef FAIL
+)){}
+#endif
+
+)){})){})){})){})){})){}
+
+)){})){})){})){})){})){})){})){}
+)){})){})){})){})){})){})){})){}
+)){})){})){})){})){})){})){})){}
+)){})){})){})){})){})){})){})){}
+)){})){})){})){})){})){})){})){}
+)){})){})){})){})){})){})){})){}
+)){})){})){})){})){})){})){})){}
+)){})){})){})){})){})){})){})){}
+)){})){})){})){})){})){})){})){}
+)){})){})){})){})){})){})){})){}
+)){})){})){})){})){})){})){})){}
+)){})){})){})){})){})){})){})){}
+)){})){})){})){})){})){})){})){}
+)){})){})){})){})){})){})){})){}
+)){})){})){})){})){})){})){})){}
+));
+
+// CHECK: fatal error: function scope depth exceeded maximum of 127
diff --git a/src/llvm-project/clang/test/Parser/nested_function_prototype_overflow.cpp b/src/llvm-project/clang/test/Parser/nested_function_prototype_overflow.cpp
new file mode 100644
index 0000000..29b382d
--- /dev/null
+++ b/src/llvm-project/clang/test/Parser/nested_function_prototype_overflow.cpp
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 %s -fsyntax-only
+// RUN: not %clang_cc1 %s -fsyntax-only -DFAIL 2>&1 | FileCheck %s
+
+void foo(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(
+#ifdef FAIL
+void (*f)()
+#endif
+)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))));
+// CHECK: fatal error: function scope depth exceeded maximum of 127
diff --git a/src/llvm-project/clang/test/Parser/nested_lambda_overflow.cpp b/src/llvm-project/clang/test/Parser/nested_lambda_overflow.cpp
new file mode 100644
index 0000000..afaa9dc
--- /dev/null
+++ b/src/llvm-project/clang/test/Parser/nested_lambda_overflow.cpp
@@ -0,0 +1,55 @@
+// RUN: %clang %s -fsyntax-only -fbracket-depth=512
+// RUN: not %clang %s -fsyntax-only -fbracket-depth=512 -DFAIL 2>&1 | FileCheck %s
+
+template <class T> int foo(T &&t);
+
+void bar(int x = foo(
+
+[](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo(
+[](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo(
+[](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo(
+[](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo(
+[](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo(
+[](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo(
+[](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo(
+[](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo(
+[](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo(
+[](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo(
+[](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo(
+[](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo(
+[](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo(
+[](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo(
+[](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo(
+
+[](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo([](int x = foo(
+
+#ifdef FAIL
+[](int x = foo(
+#endif
+
+[](int x = foo(1)){}
+
+#ifdef FAIL
+)){}
+#endif
+
+)){})){})){})){})){})){}
+
+)){})){})){})){})){})){})){})){}
+)){})){})){})){})){})){})){})){}
+)){})){})){})){})){})){})){})){}
+)){})){})){})){})){})){})){})){}
+)){})){})){})){})){})){})){})){}
+)){})){})){})){})){})){})){})){}
+)){})){})){})){})){})){})){})){}
+)){})){})){})){})){})){})){})){}
+)){})){})){})){})){})){})){})){}
+)){})){})){})){})){})){})){})){}
+)){})){})){})){})){})){})){})){}
+)){})){})){})){})){})){})){})){}
+)){})){})){})){})){})){})){})){}
+)){})){})){})){})){})){})){})){}
+)){})){})){})){})){})){})){})){}
+));
+
+// CHECK: fatal error: function scope depth exceeded maximum of 127
diff --git a/src/llvm-project/clang/test/Parser/objc-init.m b/src/llvm-project/clang/test/Parser/objc-init.m
index 088e385..04e0c82 100644
--- a/src/llvm-project/clang/test/Parser/objc-init.m
+++ b/src/llvm-project/clang/test/Parser/objc-init.m
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -fsyntax-only -fobjc-runtime=macosx-fragile -verify -pedantic -Wno-objc-root-class %s
-// RUN: %clang_cc1 -fsyntax-only -fobjc-runtime=macosx-fragile -verify -x objective-c++ -Wno-objc-root-class %s
-// RUN: %clang_cc1 -fsyntax-only -fobjc-runtime=macosx-fragile -verify -x objective-c++ -Wno-objc-root-class -std=c++98 %s
-// RUN: %clang_cc1 -fsyntax-only -fobjc-runtime=macosx-fragile -verify -x objective-c++ -Wno-objc-root-class -std=c++11 %s
+// RUN: %clang_cc1 -fsyntax-only -fobjc-runtime=macosx-fragile -verify -x objective-c++ -Wno-c99-designator -Wno-objc-root-class %s
+// RUN: %clang_cc1 -fsyntax-only -fobjc-runtime=macosx-fragile -verify -x objective-c++ -Wno-c99-designator -Wno-objc-root-class -std=c++98 %s
+// RUN: %clang_cc1 -fsyntax-only -fobjc-runtime=macosx-fragile -verify -x objective-c++ -Wno-c99-designator -Wno-objc-root-class -std=c++11 %s
// rdar://5707001
@interface NSNumber;
diff --git a/src/llvm-project/clang/test/Parser/opencl-astype.cl b/src/llvm-project/clang/test/Parser/opencl-astype.cl
index 903c42e..4a26fb6 100644
--- a/src/llvm-project/clang/test/Parser/opencl-astype.cl
+++ b/src/llvm-project/clang/test/Parser/opencl-astype.cl
@@ -11,7 +11,7 @@
typedef __attribute__(( ext_vector_type(4) )) double double4;
float4 f4;
- double4 d4 = __builtin_astype(f4, double4); // expected-error{{invalid reinterpretation: sizes of 'double4' (vector of 4 'double' values) and 'float4' (vector of 4 'float' values) must match}}
+ double4 d4 = __builtin_astype(f4, double4); // expected-error{{invalid reinterpretation: sizes of 'double4' (vector of 4 'double' values) and '__private float4' (vector of 4 'float' values) must match}}
// Verify int4->float3, float3->int4 works.
int4 i4;
diff --git a/src/llvm-project/clang/test/Parser/opencl-atomics-cl20.cl b/src/llvm-project/clang/test/Parser/opencl-atomics-cl20.cl
index ad67db0..844902e 100644
--- a/src/llvm-project/clang/test/Parser/opencl-atomics-cl20.cl
+++ b/src/llvm-project/clang/test/Parser/opencl-atomics-cl20.cl
@@ -66,9 +66,9 @@
atomic_int i;
foo(&i);
// OpenCL v2.0 s6.13.11.8, arithemtic operations are not permitted on atomic types.
- i++; // expected-error {{invalid argument type 'atomic_int' (aka '_Atomic(int)') to unary expression}}
+ i++; // expected-error {{invalid argument type '__private atomic_int' (aka '__private _Atomic(int)') to unary expression}}
i = 1; // expected-error {{atomic variable can be assigned to a variable only in global address space}}
- i += 1; // expected-error {{invalid operands to binary expression ('atomic_int' (aka '_Atomic(int)') and 'int')}}
- i = i + i; // expected-error {{invalid operands to binary expression ('atomic_int' (aka '_Atomic(int)') and 'atomic_int')}}
+ i += 1; // expected-error {{invalid operands to binary expression ('__private atomic_int' (aka '__private _Atomic(int)') and 'int')}}
+ i = i + i; // expected-error {{invalid operands to binary expression ('__private atomic_int' (aka '__private _Atomic(int)') and '__private atomic_int')}}
}
#endif
diff --git a/src/llvm-project/clang/test/Parser/pragma-attribute-context.cpp b/src/llvm-project/clang/test/Parser/pragma-attribute-context.cpp
index d893f18..bcdd20f 100644
--- a/src/llvm-project/clang/test/Parser/pragma-attribute-context.cpp
+++ b/src/llvm-project/clang/test/Parser/pragma-attribute-context.cpp
@@ -31,8 +31,7 @@
struct InStruct {
// FIXME: This asserts in Objective-C++!
- // FIXME: This is a horrible diagnostic!
#ifndef __OBJC__
- BEGIN_PRAGMA // expected-error {{expected member name or ';' after declaration specifiers}}
+ BEGIN_PRAGMA // expected-error {{this pragma cannot appear in struct declaration}}
#endif
};
diff --git a/src/llvm-project/clang/test/Parser/pragma-fp-contract.c b/src/llvm-project/clang/test/Parser/pragma-fp-contract.c
index c80c140..aa25dcd 100644
--- a/src/llvm-project/clang/test/Parser/pragma-fp-contract.c
+++ b/src/llvm-project/clang/test/Parser/pragma-fp-contract.c
@@ -10,3 +10,16 @@
#pragma STDC FP_CONTRACT OFF
#pragma STDC FP_CONTRACT ON
}
+
+struct S1 {
+// expected-error@+1 {{this pragma cannot appear in struct declaration}}
+#pragma STDC FP_CONTRACT ON
+ float f1;
+};
+
+union U1 {
+ float f1;
+ float f2;
+// expected-error@+1 {{this pragma cannot appear in union declaration}}
+#pragma STDC FP_CONTRACT ON
+};
diff --git a/src/llvm-project/clang/test/Parser/pragma-fp-contract.cpp b/src/llvm-project/clang/test/Parser/pragma-fp-contract.cpp
new file mode 100644
index 0000000..c04c6c2
--- /dev/null
+++ b/src/llvm-project/clang/test/Parser/pragma-fp-contract.cpp
@@ -0,0 +1,32 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+void f1(void) {
+ int x = 0;
+/* 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
+}
+
+void f2(void) {
+ #pragma STDC FP_CONTRACT OFF
+ #pragma STDC FP_CONTRACT ON
+}
+
+struct S1 {
+// expected-error@+1 {{this pragma cannot appear in struct declaration}}
+#pragma STDC FP_CONTRACT ON
+ float f1;
+};
+
+union U1 {
+ float f1;
+ float f2;
+// expected-error@+1 {{this pragma cannot appear in union declaration}}
+#pragma STDC FP_CONTRACT ON
+};
+
+class C1 {
+ float f1;
+// expected-error@+1 {{this pragma cannot appear in class declaration}}
+#pragma STDC FP_CONTRACT ON
+ float f2;
+};
diff --git a/src/llvm-project/clang/test/Parser/pragma-loop.cpp b/src/llvm-project/clang/test/Parser/pragma-loop.cpp
index be76517..650d21c 100644
--- a/src/llvm-project/clang/test/Parser/pragma-loop.cpp
+++ b/src/llvm-project/clang/test/Parser/pragma-loop.cpp
@@ -81,6 +81,7 @@
#pragma clang loop vectorize(enable)
#pragma clang loop interleave(enable)
+#pragma clang loop vectorize_predicate(enable)
#pragma clang loop unroll(full)
while (i + 1 < Length) {
List[i] = i;
@@ -95,6 +96,7 @@
#pragma clang loop vectorize(disable)
#pragma clang loop interleave(disable)
+#pragma clang loop vectorize_predicate(disable)
#pragma clang loop unroll(disable)
while (i - 1 < Length) {
List[i] = i;
@@ -111,7 +113,7 @@
}
int VList[Length];
-#pragma clang loop vectorize(disable) interleave(disable) unroll(disable)
+#pragma clang loop vectorize(disable) interleave(disable) unroll(disable) vectorize_predicate(disable)
for (int j : VList) {
VList[j] = List[j];
}
@@ -130,11 +132,13 @@
/* expected-error {{expected '('}} */ #pragma clang loop vectorize
/* expected-error {{expected '('}} */ #pragma clang loop interleave
+/* expected-error {{expected '('}} */ #pragma clang loop vectorize_predicate
/* expected-error {{expected '('}} */ #pragma clang loop unroll
/* expected-error {{expected '('}} */ #pragma clang loop distribute
/* expected-error {{expected ')'}} */ #pragma clang loop vectorize(enable
/* expected-error {{expected ')'}} */ #pragma clang loop interleave(enable
+/* expected-error {{expected ')'}} */ #pragma clang loop vectorize_predicate(enable
/* expected-error {{expected ')'}} */ #pragma clang loop unroll(full
/* expected-error {{expected ')'}} */ #pragma clang loop distribute(enable
@@ -147,7 +151,7 @@
/* expected-error {{missing argument; expected 'enable', 'full' or 'disable'}} */ #pragma clang loop unroll()
/* expected-error {{missing argument; expected 'enable' or 'disable'}} */ #pragma clang loop distribute()
-/* expected-error {{missing option; expected vectorize, vectorize_width, interleave, interleave_count, unroll, unroll_count, pipeline, pipeline_initiation_interval, or distribute}} */ #pragma clang loop
+/* expected-error {{missing option; expected vectorize, vectorize_width, interleave, interleave_count, unroll, unroll_count, pipeline, pipeline_initiation_interval, vectorize_predicate, or distribute}} */ #pragma clang loop
/* expected-error {{invalid option 'badkeyword'}} */ #pragma clang loop badkeyword
/* expected-error {{invalid option 'badkeyword'}} */ #pragma clang loop badkeyword(enable)
/* expected-error {{invalid option 'badkeyword'}} */ #pragma clang loop vectorize(enable) badkeyword(4)
@@ -245,6 +249,9 @@
/* expected-error {{duplicate directives 'vectorize(enable)' and 'vectorize(disable)'}} */ #pragma clang loop vectorize(disable)
#pragma clang loop interleave(enable)
/* expected-error {{duplicate directives 'interleave(enable)' and 'interleave(disable)'}} */ #pragma clang loop interleave(disable)
+#pragma clang loop vectorize_predicate(enable)
+/* expected-error@+1 {{duplicate directives 'vectorize_predicate(enable)' and 'vectorize_predicate(disable)'}} */
+#pragma clang loop vectorize_predicate(disable)
#pragma clang loop unroll(full)
/* expected-error {{duplicate directives 'unroll(full)' and 'unroll(disable)'}} */ #pragma clang loop unroll(disable)
#pragma clang loop distribute(enable)
@@ -281,3 +288,7 @@
#pragma clang loop interleave(enable)
/* expected-error {{expected statement}} */ }
+
+void foo(void) {
+#pragma clang loop vectorize_predicate(enable)
+/* expected-error {{expected statement}} */ }
diff --git a/src/llvm-project/clang/test/Parser/pragma-unroll-and-jam.cpp b/src/llvm-project/clang/test/Parser/pragma-unroll-and-jam.cpp
index ef1867a..6ff9f1f 100644
--- a/src/llvm-project/clang/test/Parser/pragma-unroll-and-jam.cpp
+++ b/src/llvm-project/clang/test/Parser/pragma-unroll-and-jam.cpp
@@ -67,7 +67,7 @@
}
// pragma clang unroll_and_jam is disabled for the moment
-/* expected-error {{invalid option 'unroll_and_jam'; expected vectorize, vectorize_width, interleave, interleave_count, unroll, unroll_count, pipeline, pipeline_initiation_interval, or distribute}} */ #pragma clang loop unroll_and_jam(4)
+/* expected-error {{invalid option 'unroll_and_jam'; expected vectorize, vectorize_width, interleave, interleave_count, unroll, unroll_count, pipeline, pipeline_initiation_interval, vectorize_predicate, or distribute}} */ #pragma clang loop unroll_and_jam(4)
for (int i = 0; i < Length; i++) {
for (int j = 0; j < Length; j++) {
List[i * Length + j] = Value;
diff --git a/src/llvm-project/clang/test/Parser/warn-misleading-indentation-fix.cpp b/src/llvm-project/clang/test/Parser/warn-misleading-indentation-fix.cpp
new file mode 100644
index 0000000..bb84d53
--- /dev/null
+++ b/src/llvm-project/clang/test/Parser/warn-misleading-indentation-fix.cpp
@@ -0,0 +1,3 @@
+int main(void) { for( int i = 0; i < 9; i++ ); return 0; }
+// the crash only occurs on the first line don't move it.
+// RUN: %clang_cc1 -x c -fsyntax-only -Wmisleading-indentation %s
diff --git a/src/llvm-project/clang/test/Parser/warn-misleading-indentation.cpp b/src/llvm-project/clang/test/Parser/warn-misleading-indentation.cpp
new file mode 100644
index 0000000..8339f21
--- /dev/null
+++ b/src/llvm-project/clang/test/Parser/warn-misleading-indentation.cpp
@@ -0,0 +1,314 @@
+// RUN: %clang_cc1 -x c -fsyntax-only -verify %s
+// RUN: %clang_cc1 -std=c++17 -fsyntax-only -verify -Wall -Wno-unused -Wno-misleading-indentation -DCXX17 %s
+// RUN: %clang_cc1 -x c -fsyntax-only -verify -Wmisleading-indentation -DWITH_WARN -ftabstop 8 -DTAB_SIZE=8 %s
+// RUN: %clang_cc1 -std=c++17 -fsyntax-only -verify -Wall -Wno-unused -DWITH_WARN -ftabstop 4 -DTAB_SIZE=4 -DCXX17 %s
+// RUN: %clang_cc1 -x c -fsyntax-only -verify -Wall -Wno-unused -DWITH_WARN -ftabstop 1 -DTAB_SIZE=1 %s
+// RUN: %clang_cc1 -std=c++17 -fsyntax-only -verify -Wall -Wno-unused -Wmisleading-indentation -DCXX17 -DWITH_WARN -ftabstop 2 -DTAB_SIZE=2 %s
+
+#ifndef WITH_WARN
+// expected-no-diagnostics
+#endif
+
+void f0(int i) {
+ if (i)
+#ifdef WITH_WARN
+// expected-note@-2 {{here}}
+#endif
+ i = i + 1;
+ int x = 0;
+#ifdef WITH_WARN
+// expected-warning@-2 {{misleading indentation; statement is not part of the previous 'if'}}
+#endif
+ return;
+#ifdef CXX17
+ if constexpr (false)
+#ifdef WITH_WARN
+// expected-note@-2 {{here}}
+#endif
+ i = 0;
+ i += 1;
+#ifdef WITH_WARN
+// expected-warning@-2 {{misleading indentation; statement is not part of the previous 'if'}}
+#endif
+#endif
+}
+
+void f1(int i) {
+ for (;i;)
+#ifdef WITH_WARN
+// expected-note@-2 {{here}}
+#endif
+ i = i + 1;
+ i *= 2;
+#ifdef WITH_WARN
+// expected-warning@-2 {{misleading indentation; statement is not part of the previous 'for'}}
+#endif
+ return;
+}
+
+void f2(int i) {
+ while (i)
+#ifdef WITH_WARN
+// expected-note@-2 {{here}}
+#endif
+ i = i + 1; i *= 2;
+#ifdef WITH_WARN
+// expected-warning@-2 {{misleading indentation; statement is not part of the previous 'while'}}
+#endif
+ return;
+}
+
+void f3(int i) {
+ if (i)
+ i = i + 1;
+ else
+#ifdef WITH_WARN
+// expected-note@-2 {{here}}
+#endif
+ i *= 2;
+ const int x = 0;
+#ifdef WITH_WARN
+// expected-warning@-2 {{misleading indentation; statement is not part of the previous 'else'}}
+#endif
+}
+
+#ifdef CXX17
+struct Range {
+ int *begin() {return nullptr;}
+ int *end() {return nullptr;}
+};
+#endif
+
+void f4(int i) {
+ if (i)
+ i *= 2;
+ return;
+ if (i)
+ i *= 2;
+ ;
+ if (i)
+#ifdef WITH_WARN
+// expected-note@-2 {{here}}
+#endif
+ i *= 2;
+ typedef int Int;
+#ifdef WITH_WARN
+// expected-warning@-2 {{misleading indentation; statement is not part of the previous 'if'}}
+#endif
+#ifdef CXX17
+ Range R;
+ for (auto e : R)
+#ifdef WITH_WARN
+// expected-note@-2 {{here}}
+#endif
+ i *= 2;
+ using Int2 = int;
+#ifdef WITH_WARN
+// expected-warning@-2 {{misleading indentation; statement is not part of the previous 'for'}}
+#endif
+#endif
+}
+
+int bar(void);
+
+int foo(int* dst)
+{
+ if (dst)
+ return
+ bar();
+ if (dst)
+ dst = dst + \
+ bar();
+ return 0;
+}
+
+void g(int i) {
+ if (1)
+ i = 2;
+ else
+ if (i == 3)
+#ifdef WITH_WARN
+// expected-note@-3 {{here}}
+#endif
+ i = 4;
+ i = 5;
+#ifdef WITH_WARN
+// expected-warning@-2 {{misleading indentation; statement is not part of the previous 'if'}}
+#endif
+}
+
+// Or this
+#define TEST i = 5
+void g0(int i) {
+ if (1)
+ i = 2;
+ else
+ i = 5;
+ TEST;
+}
+
+void g1(int i) {
+ if (1)
+ i = 2;
+ else if (i == 3)
+#ifdef WITH_WARN
+// expected-note@-2 {{here}}
+#endif
+ i = 4;
+ i = 5;
+#ifdef WITH_WARN
+// expected-warning@-2 {{misleading indentation; statement is not part of the previous 'if'}}
+#endif
+}
+
+void g2(int i) {
+ if (1)
+ i = 2;
+ else
+ if (i == 3)
+ {i = 4;}
+ i = 5;
+}
+
+void g6(int i) {
+ if (1)
+ if (i == 3)
+#ifdef WITH_WARN
+// expected-note@-2 {{here}}
+#endif
+ i = 4;
+ i = 5;
+#ifdef WITH_WARN
+// expected-warning@-2 {{misleading indentation; statement is not part of the previous 'if'}}
+#endif
+}
+
+void g7(int i) {
+ if (1)
+ i = 4;
+#ifdef TEST1
+#endif
+ i = 5;
+}
+
+void a1(int i) { if (1) i = 4; return; }
+
+void a2(int i) {
+ {
+ if (1)
+ i = 4;
+ }
+ return;
+}
+
+void a3(int i) {
+ if (1)
+ {
+ i = 4;
+ }
+ return;
+}
+
+void s(int num) {
+ {
+ if (1)
+ return;
+ else
+ return;
+ return;
+ }
+ if (0)
+#ifdef WITH_WARN
+// expected-note@-2 {{here}}
+#endif
+ return;
+ return;
+#ifdef WITH_WARN
+// expected-warning@-2 {{misleading indentation; statement is not part of the previous 'if'}}
+#endif
+}
+int a4()
+{
+ if (0)
+ return 1;
+ return 0;
+#if (TAB_SIZE == 1)
+// expected-warning@-2 {{misleading indentation; statement is not part of the previous 'if'}}
+// expected-note@-5 {{here}}
+#endif
+}
+
+int a5()
+{
+ if (0)
+ return 1;
+ return 0;
+#if WITH_WARN
+// expected-warning@-2 {{misleading indentation; statement is not part of the previous 'if'}}
+// expected-note@-5 {{here}}
+#endif
+}
+
+int a6()
+{
+ if (0)
+ return 1;
+ return 0;
+#if (TAB_SIZE == 8)
+// expected-warning@-2 {{misleading indentation; statement is not part of the previous 'if'}}
+// expected-note@-5 {{here}}
+#endif
+}
+
+#define FOO \
+ goto fail
+
+int main(int argc, char* argv[]) {
+ if (5 != 0)
+ goto fail;
+ else
+ goto fail;
+
+ if (1) {
+ if (1)
+ goto fail;
+ else if (1)
+ goto fail;
+ else if (1)
+ goto fail;
+ else
+ goto fail;
+ } else if (1) {
+ if (1)
+ goto fail;
+ }
+
+ if (1) {
+ if (1)
+ goto fail;
+ } else if (1)
+ goto fail;
+
+
+ if (1) goto fail; goto fail;
+
+ if (0)
+ goto fail;
+
+ goto fail;
+
+ if (0)
+ FOO;
+
+ goto fail;
+
+fail:;
+}
+
+void f_label(int b) {
+ if (b)
+ return;
+ a:
+ return;
+ goto a;
+}
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Preprocessor/Inputs/include-file-and-dir/file-and-dir
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Preprocessor/Inputs/include-file-and-dir/file-and-dir
diff --git a/src/llvm-project/clang/test/Preprocessor/Inputs/include-file-and-dir/incdir/file-and-dir/foo.h b/src/llvm-project/clang/test/Preprocessor/Inputs/include-file-and-dir/incdir/file-and-dir/foo.h
new file mode 100644
index 0000000..9d3235e
--- /dev/null
+++ b/src/llvm-project/clang/test/Preprocessor/Inputs/include-file-and-dir/incdir/file-and-dir/foo.h
@@ -0,0 +1 @@
+included_foo_dot_h
diff --git a/src/llvm-project/clang/test/Preprocessor/Inputs/nonportable-hmaps/foo.hmap.json b/src/llvm-project/clang/test/Preprocessor/Inputs/nonportable-hmaps/foo.hmap.json
index c69f1df..4852f36 100644
--- a/src/llvm-project/clang/test/Preprocessor/Inputs/nonportable-hmaps/foo.hmap.json
+++ b/src/llvm-project/clang/test/Preprocessor/Inputs/nonportable-hmaps/foo.hmap.json
@@ -1,6 +1,9 @@
{
"mappings" :
{
- "Foo/Foo.h" : "headers/foo/Foo.h"
+ "Foo/Foo.h" : "headers/foo/Foo.h",
+ "Bar.h" : "headers/foo/Bar.h",
+ "Foo/Bar.h" : "INPUTS_DIR/nonportable-hmaps/headers/foo/Bar.h",
+ "headers/Foo/Baz.h" : "/not/existing/absolute/path/Baz.h"
}
}
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Preprocessor/Inputs/nonportable-hmaps/headers/foo/Bar.h
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Preprocessor/Inputs/nonportable-hmaps/headers/foo/Bar.h
diff --git a/src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt b/src/llvm-project/clang/test/Preprocessor/Inputs/nonportable-hmaps/headers/foo/Baz.h
similarity index 100%
copy from src/llvm-project/clang/test/Frontend/Inputs/resource_dir_with_cfi_blacklist/share/cfi_blacklist.txt
copy to src/llvm-project/clang/test/Preprocessor/Inputs/nonportable-hmaps/headers/foo/Baz.h
diff --git a/src/llvm-project/clang/test/Preprocessor/aarch64-target-features.c b/src/llvm-project/clang/test/Preprocessor/aarch64-target-features.c
index 922c099..6d2225d 100644
--- a/src/llvm-project/clang/test/Preprocessor/aarch64-target-features.c
+++ b/src/llvm-project/clang/test/Preprocessor/aarch64-target-features.c
@@ -142,20 +142,31 @@
// RUN: %clang -target aarch64 -mtune=CYCLONE -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MTUNE-CYCLONE %s
// CHECK-MTUNE-CYCLONE: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" "+neon" "-target-feature" "+zcm" "-target-feature" "+zcz"
-// RUN: %clang -target aarch64 -mcpu=cyclone -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-CYCLONE %s
+// RUN: %clang -target aarch64 -mcpu=apple-a7 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-APPLE-A7 %s
+// RUN: %clang -target aarch64 -mcpu=apple-a8 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-APPLE-A7 %s
+// RUN: %clang -target aarch64 -mcpu=apple-a9 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-APPLE-A7 %s
+// RUN: %clang -target aarch64 -mcpu=apple-a10 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-APPLE-A10 %s
+// RUN: %clang -target aarch64 -mcpu=apple-a11 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-APPLE-A11 %s
+// RUN: %clang -target aarch64 -mcpu=apple-a12 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-APPLE-A12 %s
+// RUN: %clang -target aarch64 -mcpu=apple-a13 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-APPLE-A13 %s
+// RUN: %clang -target aarch64 -mcpu=apple-s4 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-APPLE-A12 %s
+// RUN: %clang -target aarch64 -mcpu=apple-s5 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-APPLE-A12 %s
+// RUN: %clang -target aarch64 -mcpu=cyclone -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-APPLE-A7 %s
// RUN: %clang -target aarch64 -mcpu=cortex-a35 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-A35 %s
// RUN: %clang -target aarch64 -mcpu=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-A53 %s
// RUN: %clang -target aarch64 -mcpu=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-A57 %s
// RUN: %clang -target aarch64 -mcpu=cortex-a72 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-A72 %s
// RUN: %clang -target aarch64 -mcpu=cortex-a73 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-CORTEX-A73 %s
-// RUN: %clang -target aarch64 -mcpu=exynos-m1 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-M1 %s
-// RUN: %clang -target aarch64 -mcpu=exynos-m2 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-M1 %s
// RUN: %clang -target aarch64 -mcpu=exynos-m3 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-M1 %s
// RUN: %clang -target aarch64 -mcpu=exynos-m4 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-M4 %s
// RUN: %clang -target aarch64 -mcpu=exynos-m5 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-M4 %s
// RUN: %clang -target aarch64 -mcpu=kryo -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-KRYO %s
// RUN: %clang -target aarch64 -mcpu=thunderx2t99 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-THUNDERX2T99 %s
-// CHECK-MCPU-CYCLONE: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" "+neon" "-target-feature" "+crypto" "-target-feature" "+zcm" "-target-feature" "+zcz"
+// CHECK-MCPU-APPLE-A7: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" "+fp-armv8" "-target-feature" "+neon" "-target-feature" "+crypto" "-target-feature" "+zcm" "-target-feature" "+zcz" "-target-feature" "+sha2" "-target-feature" "+aes"
+// CHECK-MCPU-APPLE-A10: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" "+fp-armv8" "-target-feature" "+neon" "-target-feature" "+crc" "-target-feature" "+crypto" "-target-feature" "+rdm" "-target-feature" "+zcm" "-target-feature" "+zcz" "-target-feature" "+sha2" "-target-feature" "+aes"
+// CHECK-MCPU-APPLE-A11: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" "+v8.2a" "-target-feature" "+fp-armv8" "-target-feature" "+neon" "-target-feature" "+crc" "-target-feature" "+crypto" "-target-feature" "+ras" "-target-feature" "+lse" "-target-feature" "+rdm" "-target-feature" "+zcm" "-target-feature" "+zcz" "-target-feature" "+sha2" "-target-feature" "+aes"
+// CHECK-MCPU-APPLE-A12: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" "+v8.3a" "-target-feature" "+fp-armv8" "-target-feature" "+neon" "-target-feature" "+crc" "-target-feature" "+crypto" "-target-feature" "+fullfp16" "-target-feature" "+ras" "-target-feature" "+lse" "-target-feature" "+rdm" "-target-feature" "+rcpc" "-target-feature" "+zcm" "-target-feature" "+zcz" "-target-feature" "+sha2" "-target-feature" "+aes"
+// CHECK-MCPU-APPLE-A13: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" "+v8.4a" "-target-feature" "+fp-armv8" "-target-feature" "+neon" "-target-feature" "+crc" "-target-feature" "+crypto" "-target-feature" "+dotprod" "-target-feature" "+fullfp16" "-target-feature" "+ras" "-target-feature" "+lse" "-target-feature" "+rdm" "-target-feature" "+rcpc" "-target-feature" "+zcm" "-target-feature" "+zcz" "-target-feature" "+fp16fml" "-target-feature" "+sm4" "-target-feature" "+sha3" "-target-feature" "+sha2" "-target-feature" "+aes"
// CHECK-MCPU-A35: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" "+neon" "-target-feature" "+crc" "-target-feature" "+crypto"
// CHECK-MCPU-A53: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" "+neon" "-target-feature" "+crc" "-target-feature" "+crypto"
// CHECK-MCPU-A57: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" "+neon" "-target-feature" "+crc" "-target-feature" "+crypto"
@@ -167,7 +178,10 @@
// CHECK-MCPU-THUNDERX2T99: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" "+neon" "-target-feature" "+crc" "-target-feature" "+crypto"
// RUN: %clang -target x86_64-apple-macosx -arch arm64 -### -c %s 2>&1 | FileCheck --check-prefix=CHECK-ARCH-ARM64 %s
-// CHECK-ARCH-ARM64: "-target-cpu" "cyclone" "-target-feature" "+fp-armv8" "-target-feature" "+neon" "-target-feature" "+crypto" "-target-feature" "+zcm" "-target-feature" "+zcz"
+// CHECK-ARCH-ARM64: "-target-cpu" "apple-a7" "-target-feature" "+fp-armv8" "-target-feature" "+neon" "-target-feature" "+crypto" "-target-feature" "+zcm" "-target-feature" "+zcz"
+
+// RUN: %clang -target x86_64-apple-macosx -arch arm64_32 -### -c %s 2>&1 | FileCheck --check-prefix=CHECK-ARCH-ARM64_32 %s
+// CHECK-ARCH-ARM64_32: "-target-cpu" "apple-s4" "-target-feature" "+v8.3a" "-target-feature" "+fp-armv8" "-target-feature" "+neon" "-target-feature" "+crc" "-target-feature" "+crypto" "-target-feature" "+fullfp16" "-target-feature" "+ras" "-target-feature" "+lse" "-target-feature" "+rdm" "-target-feature" "+rcpc" "-target-feature" "+zcm" "-target-feature" "+zcz" "-target-feature" "+sha2" "-target-feature" "+aes"
// RUN: %clang -target aarch64 -march=armv8-a+fp+simd+crc+crypto -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MARCH-1 %s
// RUN: %clang -target aarch64 -march=armv8-a+nofp+nosimd+nocrc+nocrypto+fp+simd+crc+crypto -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MARCH-1 %s
diff --git a/src/llvm-project/clang/test/Preprocessor/arm-target-features.c b/src/llvm-project/clang/test/Preprocessor/arm-target-features.c
index df5af4a..3d80a1b 100644
--- a/src/llvm-project/clang/test/Preprocessor/arm-target-features.c
+++ b/src/llvm-project/clang/test/Preprocessor/arm-target-features.c
@@ -528,10 +528,6 @@
// RUN: %clang -target armv8 -mcpu=cortex-a73 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
// RUN: %clang -target armv8 -mthumb -mcpu=cortex-a73 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
//
-// RUN: %clang -target armv8 -mcpu=exynos-m1 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
-// RUN: %clang -target armv8 -mthumb -mcpu=exynos-m1 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
-// RUN: %clang -target armv8 -mcpu=exynos-m2 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
-// RUN: %clang -target armv8 -mthumb -mcpu=exynos-m2 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
// RUN: %clang -target armv8 -mcpu=exynos-m3 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
// RUN: %clang -target armv8 -mthumb -mcpu=exynos-m3 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
// RUN: %clang -target armv8 -mcpu=exynos-m4 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8 %s
@@ -556,10 +552,6 @@
// RUN: %clang -target armv8-eabi -mcpu=cortex-a73 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
// RUN: %clang -target armv8-eabi -mthumb -mcpu=cortex-a73 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
//
-// RUN: %clang -target armv8-eabi -mcpu=exynos-m1 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
-// RUN: %clang -target armv8-eabi -mthumb -mcpu=exynos-m1 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
-// RUN: %clang -target armv8-eabi -mcpu=exynos-m2 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
-// RUN: %clang -target armv8-eabi -mthumb -mcpu=exynos-m2 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
// RUN: %clang -target armv8-eabi -mcpu=exynos-m3 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
// RUN: %clang -target armv8-eabi -mthumb -mcpu=exynos-m3 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
// RUN: %clang -target armv8-eabi -mcpu=exynos-m4 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=ARMV8-ALLOW-FP-INSTR %s
diff --git a/src/llvm-project/clang/test/Preprocessor/arm64_32.c b/src/llvm-project/clang/test/Preprocessor/arm64_32.c
new file mode 100644
index 0000000..2f234c5
--- /dev/null
+++ b/src/llvm-project/clang/test/Preprocessor/arm64_32.c
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=arm64_32-apple-ios < /dev/null | FileCheck %s --check-prefix=CHECK-32
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=arm64-apple-ios < /dev/null | FileCheck %s --check-prefix=CHECK-64
+
+// CHECK-32: #define __ARM64_ARCH_8_32__ 1
+// CHECK-64: #define __ARM64_ARCH_8__ 1
diff --git a/src/llvm-project/clang/test/Preprocessor/feature_tests.c b/src/llvm-project/clang/test/Preprocessor/feature_tests.c
index 2035a72..2568e29 100644
--- a/src/llvm-project/clang/test/Preprocessor/feature_tests.c
+++ b/src/llvm-project/clang/test/Preprocessor/feature_tests.c
@@ -25,10 +25,18 @@
#if !__has_builtin(__builtin_LINE) || \
!__has_builtin(__builtin_FILE) || \
!__has_builtin(__builtin_FUNCTION) || \
- !__has_builtin(__builtin_COLUMN)
+ !__has_builtin(__builtin_COLUMN) || \
+ !__has_builtin(__builtin_types_compatible_p)
#error Clang should have these
#endif
+// These are C++-only builtins.
+#if __has_builtin(__array_rank) || \
+ __has_builtin(__underlying_type) || \
+ __has_builtin(__is_trivial)
+#error Clang should not have these in C mode
+#endif
+
#if __has_builtin(__builtin_insanity)
#error Clang should not have this
#endif
diff --git a/src/llvm-project/clang/test/Preprocessor/feature_tests.cpp b/src/llvm-project/clang/test/Preprocessor/feature_tests.cpp
new file mode 100644
index 0000000..b501cb7a
--- /dev/null
+++ b/src/llvm-project/clang/test/Preprocessor/feature_tests.cpp
@@ -0,0 +1,44 @@
+// RUN: %clang_cc1 %s -triple=i686-apple-darwin9 -verify -DVERIFY
+// expected-no-diagnostics
+
+#ifndef __has_feature
+#error Should have __has_feature
+#endif
+
+#if __has_feature(something_we_dont_have)
+#error Bad
+#endif
+
+#if !__has_builtin(__builtin_huge_val) || \
+ !__has_builtin(__builtin_shufflevector) || \
+ !__has_builtin(__builtin_convertvector) || \
+ !__has_builtin(__builtin_trap) || \
+ !__has_builtin(__c11_atomic_init) || \
+ !__has_builtin(__builtin_launder) || \
+ !__has_feature(attribute_analyzer_noreturn) || \
+ !__has_feature(attribute_overloadable)
+#error Clang should have these
+#endif
+
+// These are technically implemented as keywords, but __has_builtin should
+// still return true.
+#if !__has_builtin(__builtin_LINE) || \
+ !__has_builtin(__builtin_FILE) || \
+ !__has_builtin(__builtin_FUNCTION) || \
+ !__has_builtin(__builtin_COLUMN) || \
+ !__has_builtin(__array_rank) || \
+ !__has_builtin(__underlying_type) || \
+ !__has_builtin(__is_trivial) || \
+ !__has_builtin(__is_same_as) || \
+ !__has_builtin(__has_unique_object_representations)
+#error Clang should have these
+#endif
+
+// This is a C-only builtin.
+#if __has_builtin(__builtin_types_compatible_p)
+#error Clang should not have this in C++ mode
+#endif
+
+#if __has_builtin(__builtin_insanity)
+#error Clang should not have this
+#endif
diff --git a/src/llvm-project/clang/test/Preprocessor/file_test.c b/src/llvm-project/clang/test/Preprocessor/file_test.c
new file mode 100644
index 0000000..3788db6
--- /dev/null
+++ b/src/llvm-project/clang/test/Preprocessor/file_test.c
@@ -0,0 +1,23 @@
+// XFAIL: system-windows
+// RUN: %clang -E -ffile-prefix-map=%p=/UNLIKELY_PATH/empty -c -o - %s | FileCheck %s
+// RUN: %clang -E -fmacro-prefix-map=%p=/UNLIKELY_PATH/empty -c -o - %s | FileCheck %s
+// RUN: %clang -E -fmacro-prefix-map=%p=/UNLIKELY_PATH=empty -c -o - %s | FileCheck %s -check-prefix CHECK-EVIL
+// RUN: %clang -E -fmacro-prefix-map=%p/= -c -o - %s | FileCheck %s --check-prefix CHECK-REMOVE
+
+filename: __FILE__
+#include "file_test.h"
+
+// CHECK: filename: "/UNLIKELY_PATH/empty{{/|\\\\}}file_test.c"
+// CHECK: filename: "/UNLIKELY_PATH/empty{{/|\\\\}}file_test.h"
+// CHECK: basefile: "/UNLIKELY_PATH/empty{{/|\\\\}}file_test.c"
+// CHECK-NOT: filename:
+
+// CHECK-EVIL: filename: "/UNLIKELY_PATH=empty{{/|\\\\}}file_test.c"
+// CHECK-EVIL: filename: "/UNLIKELY_PATH=empty{{/|\\\\}}file_test.h"
+// CHECK-EVIL: basefile: "/UNLIKELY_PATH=empty{{/|\\\\}}file_test.c"
+// CHECK-EVIL-NOT: filename:
+
+// CHECK-REMOVE: filename: "file_test.c"
+// CHECK-REMOVE: filename: "file_test.h"
+// CHECK-REMOVE: basefile: "file_test.c"
+// CHECK-REMOVE-NOT: filename:
diff --git a/src/llvm-project/clang/test/Preprocessor/file_test.h b/src/llvm-project/clang/test/Preprocessor/file_test.h
new file mode 100644
index 0000000..c289e5c
--- /dev/null
+++ b/src/llvm-project/clang/test/Preprocessor/file_test.h
@@ -0,0 +1,2 @@
+filename: __FILE__
+basefile: __BASE_FILE__
diff --git a/src/llvm-project/clang/test/Preprocessor/has_attribute.cpp b/src/llvm-project/clang/test/Preprocessor/has_attribute.cpp
index d35b673..e7303c7 100644
--- a/src/llvm-project/clang/test/Preprocessor/has_attribute.cpp
+++ b/src/llvm-project/clang/test/Preprocessor/has_attribute.cpp
@@ -31,6 +31,9 @@
// CHECK: _Clang::fallthrough: 201603L
CXX11(_Clang::fallthrough)
+// CHECK: __nodiscard__: 201907L
+CXX11(__nodiscard__)
+
// CHECK: __gnu__::__const__: 1
CXX11(__gnu__::__const__)
@@ -63,7 +66,7 @@
// CHECK: maybe_unused: 201603L
// ITANIUM: no_unique_address: 201803L
// WINDOWS: no_unique_address: 0
-// CHECK: nodiscard: 201603L
+// CHECK: nodiscard: 201907L
// CHECK: noreturn: 200809L
// FIXME(201803L) CHECK: unlikely: 0
diff --git a/src/llvm-project/clang/test/Preprocessor/has_c_attribute.c b/src/llvm-project/clang/test/Preprocessor/has_c_attribute.c
index dc22da7..f8b0b36 100644
--- a/src/llvm-project/clang/test/Preprocessor/has_c_attribute.c
+++ b/src/llvm-project/clang/test/Preprocessor/has_c_attribute.c
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -fdouble-square-bracket-attributes -std=c11 -E %s -o - | FileCheck %s
+// RUN: %clang_cc1 -std=c2x -E %s -o - | FileCheck %s
// CHECK: has_fallthrough
#if __has_c_attribute(fallthrough)
@@ -10,3 +11,12 @@
int does_not_have_selectany();
#endif
+// CHECK: has_nodiscard_underscore
+#if __has_c_attribute(__nodiscard__)
+ int has_nodiscard_underscore();
+#endif
+
+// CHECK: has_clang_annotate
+#if __has_c_attribute(clang::annotate)
+ int has_clang_annotate();
+#endif
diff --git a/src/llvm-project/clang/test/Preprocessor/has_c_attribute.cpp b/src/llvm-project/clang/test/Preprocessor/has_c_attribute.cpp
new file mode 100644
index 0000000..0bde730
--- /dev/null
+++ b/src/llvm-project/clang/test/Preprocessor/has_c_attribute.cpp
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -std=c++11 %s -verify
+
+#if __has_c_attribute(fallthrough) // expected-error {{function-like macro '__has_c_attribute' is not defined}}
+#endif
+
+#if __has_c_attribute(gnu::transparent_union) // expected-error {{function-like macro '__has_c_attribute' is not defined}}
+#endif
+
diff --git a/src/llvm-project/clang/test/Preprocessor/include-header-file-and-dir.c b/src/llvm-project/clang/test/Preprocessor/include-header-file-and-dir.c
new file mode 100644
index 0000000..8da95ce
--- /dev/null
+++ b/src/llvm-project/clang/test/Preprocessor/include-header-file-and-dir.c
@@ -0,0 +1,4 @@
+// RUN: %clang_cc1 -E -P %s -I%S/Inputs/include-file-and-dir -I%S/Inputs/include-file-and-dir/incdir -o - | FileCheck %s
+#include "file-and-dir/foo.h"
+
+// CHECK: included_foo_dot_h
diff --git a/src/llvm-project/clang/test/Preprocessor/init-ppc64.c b/src/llvm-project/clang/test/Preprocessor/init-ppc64.c
new file mode 100644
index 0000000..b24f8eb
--- /dev/null
+++ b/src/llvm-project/clang/test/Preprocessor/init-ppc64.c
@@ -0,0 +1,1074 @@
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu pwr7 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPC64 %s
+// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu pwr7 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPC64 -check-prefix PPC64-CXX %s
+//
+// PPC64:#define _ARCH_PPC 1
+// PPC64:#define _ARCH_PPC64 1
+// PPC64:#define _ARCH_PPCGR 1
+// PPC64:#define _ARCH_PPCSQ 1
+// PPC64:#define _ARCH_PWR4 1
+// PPC64:#define _ARCH_PWR5 1
+// PPC64:#define _ARCH_PWR6 1
+// PPC64:#define _ARCH_PWR7 1
+// PPC64:#define _BIG_ENDIAN 1
+// PPC64:#define _LP64 1
+// PPC64:#define __BIGGEST_ALIGNMENT__ 16
+// PPC64:#define __BIG_ENDIAN__ 1
+// PPC64:#define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__
+// PPC64:#define __CHAR16_TYPE__ unsigned short
+// PPC64:#define __CHAR32_TYPE__ unsigned int
+// PPC64:#define __CHAR_BIT__ 8
+// PPC64:#define __CHAR_UNSIGNED__ 1
+// PPC64:#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
+// PPC64:#define __DBL_DIG__ 15
+// PPC64:#define __DBL_EPSILON__ 2.2204460492503131e-16
+// PPC64:#define __DBL_HAS_DENORM__ 1
+// PPC64:#define __DBL_HAS_INFINITY__ 1
+// PPC64:#define __DBL_HAS_QUIET_NAN__ 1
+// PPC64:#define __DBL_MANT_DIG__ 53
+// PPC64:#define __DBL_MAX_10_EXP__ 308
+// PPC64:#define __DBL_MAX_EXP__ 1024
+// PPC64:#define __DBL_MAX__ 1.7976931348623157e+308
+// PPC64:#define __DBL_MIN_10_EXP__ (-307)
+// PPC64:#define __DBL_MIN_EXP__ (-1021)
+// PPC64:#define __DBL_MIN__ 2.2250738585072014e-308
+// PPC64:#define __DECIMAL_DIG__ __LDBL_DECIMAL_DIG__
+// PPC64:#define __FLT_DENORM_MIN__ 1.40129846e-45F
+// PPC64:#define __FLT_DIG__ 6
+// PPC64:#define __FLT_EPSILON__ 1.19209290e-7F
+// PPC64:#define __FLT_EVAL_METHOD__ 0
+// PPC64:#define __FLT_HAS_DENORM__ 1
+// PPC64:#define __FLT_HAS_INFINITY__ 1
+// PPC64:#define __FLT_HAS_QUIET_NAN__ 1
+// PPC64:#define __FLT_MANT_DIG__ 24
+// PPC64:#define __FLT_MAX_10_EXP__ 38
+// PPC64:#define __FLT_MAX_EXP__ 128
+// PPC64:#define __FLT_MAX__ 3.40282347e+38F
+// PPC64:#define __FLT_MIN_10_EXP__ (-37)
+// PPC64:#define __FLT_MIN_EXP__ (-125)
+// PPC64:#define __FLT_MIN__ 1.17549435e-38F
+// PPC64:#define __FLT_RADIX__ 2
+// PPC64:#define __HAVE_BSWAP__ 1
+// PPC64:#define __INT16_C_SUFFIX__
+// PPC64:#define __INT16_FMTd__ "hd"
+// PPC64:#define __INT16_FMTi__ "hi"
+// PPC64:#define __INT16_MAX__ 32767
+// PPC64:#define __INT16_TYPE__ short
+// PPC64:#define __INT32_C_SUFFIX__
+// PPC64:#define __INT32_FMTd__ "d"
+// PPC64:#define __INT32_FMTi__ "i"
+// PPC64:#define __INT32_MAX__ 2147483647
+// PPC64:#define __INT32_TYPE__ int
+// PPC64:#define __INT64_C_SUFFIX__ L
+// PPC64:#define __INT64_FMTd__ "ld"
+// PPC64:#define __INT64_FMTi__ "li"
+// PPC64:#define __INT64_MAX__ 9223372036854775807L
+// PPC64:#define __INT64_TYPE__ long int
+// PPC64:#define __INT8_C_SUFFIX__
+// PPC64:#define __INT8_FMTd__ "hhd"
+// PPC64:#define __INT8_FMTi__ "hhi"
+// PPC64:#define __INT8_MAX__ 127
+// PPC64:#define __INT8_TYPE__ signed char
+// PPC64:#define __INTMAX_C_SUFFIX__ L
+// PPC64:#define __INTMAX_FMTd__ "ld"
+// PPC64:#define __INTMAX_FMTi__ "li"
+// PPC64:#define __INTMAX_MAX__ 9223372036854775807L
+// PPC64:#define __INTMAX_TYPE__ long int
+// PPC64:#define __INTMAX_WIDTH__ 64
+// PPC64:#define __INTPTR_FMTd__ "ld"
+// PPC64:#define __INTPTR_FMTi__ "li"
+// PPC64:#define __INTPTR_MAX__ 9223372036854775807L
+// PPC64:#define __INTPTR_TYPE__ long int
+// PPC64:#define __INTPTR_WIDTH__ 64
+// PPC64:#define __INT_FAST16_FMTd__ "hd"
+// PPC64:#define __INT_FAST16_FMTi__ "hi"
+// PPC64:#define __INT_FAST16_MAX__ 32767
+// PPC64:#define __INT_FAST16_TYPE__ short
+// PPC64:#define __INT_FAST32_FMTd__ "d"
+// PPC64:#define __INT_FAST32_FMTi__ "i"
+// PPC64:#define __INT_FAST32_MAX__ 2147483647
+// PPC64:#define __INT_FAST32_TYPE__ int
+// PPC64:#define __INT_FAST64_FMTd__ "ld"
+// PPC64:#define __INT_FAST64_FMTi__ "li"
+// PPC64:#define __INT_FAST64_MAX__ 9223372036854775807L
+// PPC64:#define __INT_FAST64_TYPE__ long int
+// PPC64:#define __INT_FAST8_FMTd__ "hhd"
+// PPC64:#define __INT_FAST8_FMTi__ "hhi"
+// PPC64:#define __INT_FAST8_MAX__ 127
+// PPC64:#define __INT_FAST8_TYPE__ signed char
+// PPC64:#define __INT_LEAST16_FMTd__ "hd"
+// PPC64:#define __INT_LEAST16_FMTi__ "hi"
+// PPC64:#define __INT_LEAST16_MAX__ 32767
+// PPC64:#define __INT_LEAST16_TYPE__ short
+// PPC64:#define __INT_LEAST32_FMTd__ "d"
+// PPC64:#define __INT_LEAST32_FMTi__ "i"
+// PPC64:#define __INT_LEAST32_MAX__ 2147483647
+// PPC64:#define __INT_LEAST32_TYPE__ int
+// PPC64:#define __INT_LEAST64_FMTd__ "ld"
+// PPC64:#define __INT_LEAST64_FMTi__ "li"
+// PPC64:#define __INT_LEAST64_MAX__ 9223372036854775807L
+// PPC64:#define __INT_LEAST64_TYPE__ long int
+// PPC64:#define __INT_LEAST8_FMTd__ "hhd"
+// PPC64:#define __INT_LEAST8_FMTi__ "hhi"
+// PPC64:#define __INT_LEAST8_MAX__ 127
+// PPC64:#define __INT_LEAST8_TYPE__ signed char
+// PPC64:#define __INT_MAX__ 2147483647
+// PPC64:#define __LDBL_DENORM_MIN__ 4.94065645841246544176568792868221e-324L
+// PPC64:#define __LDBL_DIG__ 31
+// PPC64:#define __LDBL_EPSILON__ 4.94065645841246544176568792868221e-324L
+// PPC64:#define __LDBL_HAS_DENORM__ 1
+// PPC64:#define __LDBL_HAS_INFINITY__ 1
+// PPC64:#define __LDBL_HAS_QUIET_NAN__ 1
+// PPC64:#define __LDBL_MANT_DIG__ 106
+// PPC64:#define __LDBL_MAX_10_EXP__ 308
+// PPC64:#define __LDBL_MAX_EXP__ 1024
+// PPC64:#define __LDBL_MAX__ 1.79769313486231580793728971405301e+308L
+// PPC64:#define __LDBL_MIN_10_EXP__ (-291)
+// PPC64:#define __LDBL_MIN_EXP__ (-968)
+// PPC64:#define __LDBL_MIN__ 2.00416836000897277799610805135016e-292L
+// PPC64:#define __LONGDOUBLE128 1
+// PPC64:#define __LONG_DOUBLE_128__ 1
+// PPC64:#define __LONG_LONG_MAX__ 9223372036854775807LL
+// PPC64:#define __LONG_MAX__ 9223372036854775807L
+// PPC64:#define __LP64__ 1
+// 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__
+// PPC64:#define __SCHAR_MAX__ 127
+// PPC64:#define __SHRT_MAX__ 32767
+// PPC64:#define __SIG_ATOMIC_MAX__ 2147483647
+// PPC64:#define __SIG_ATOMIC_WIDTH__ 32
+// PPC64:#define __SIZEOF_DOUBLE__ 8
+// PPC64:#define __SIZEOF_FLOAT__ 4
+// PPC64:#define __SIZEOF_INT__ 4
+// PPC64:#define __SIZEOF_LONG_DOUBLE__ 16
+// PPC64:#define __SIZEOF_LONG_LONG__ 8
+// PPC64:#define __SIZEOF_LONG__ 8
+// PPC64:#define __SIZEOF_POINTER__ 8
+// PPC64:#define __SIZEOF_PTRDIFF_T__ 8
+// PPC64:#define __SIZEOF_SHORT__ 2
+// PPC64:#define __SIZEOF_SIZE_T__ 8
+// PPC64:#define __SIZEOF_WCHAR_T__ 4
+// PPC64:#define __SIZEOF_WINT_T__ 4
+// PPC64:#define __SIZE_MAX__ 18446744073709551615UL
+// PPC64:#define __SIZE_TYPE__ long unsigned int
+// PPC64:#define __SIZE_WIDTH__ 64
+// PPC64-CXX:#define __STDCPP_DEFAULT_NEW_ALIGNMENT__ 16UL
+// PPC64:#define __UINT16_C_SUFFIX__
+// PPC64:#define __UINT16_MAX__ 65535
+// PPC64:#define __UINT16_TYPE__ unsigned short
+// PPC64:#define __UINT32_C_SUFFIX__ U
+// PPC64:#define __UINT32_MAX__ 4294967295U
+// PPC64:#define __UINT32_TYPE__ unsigned int
+// PPC64:#define __UINT64_C_SUFFIX__ UL
+// PPC64:#define __UINT64_MAX__ 18446744073709551615UL
+// PPC64:#define __UINT64_TYPE__ long unsigned int
+// PPC64:#define __UINT8_C_SUFFIX__
+// PPC64:#define __UINT8_MAX__ 255
+// PPC64:#define __UINT8_TYPE__ unsigned char
+// PPC64:#define __UINTMAX_C_SUFFIX__ UL
+// PPC64:#define __UINTMAX_MAX__ 18446744073709551615UL
+// PPC64:#define __UINTMAX_TYPE__ long unsigned int
+// PPC64:#define __UINTMAX_WIDTH__ 64
+// PPC64:#define __UINTPTR_MAX__ 18446744073709551615UL
+// PPC64:#define __UINTPTR_TYPE__ long unsigned int
+// PPC64:#define __UINTPTR_WIDTH__ 64
+// PPC64:#define __UINT_FAST16_MAX__ 65535
+// PPC64:#define __UINT_FAST16_TYPE__ unsigned short
+// PPC64:#define __UINT_FAST32_MAX__ 4294967295U
+// PPC64:#define __UINT_FAST32_TYPE__ unsigned int
+// PPC64:#define __UINT_FAST64_MAX__ 18446744073709551615UL
+// PPC64:#define __UINT_FAST64_TYPE__ long unsigned int
+// PPC64:#define __UINT_FAST8_MAX__ 255
+// PPC64:#define __UINT_FAST8_TYPE__ unsigned char
+// PPC64:#define __UINT_LEAST16_MAX__ 65535
+// PPC64:#define __UINT_LEAST16_TYPE__ unsigned short
+// PPC64:#define __UINT_LEAST32_MAX__ 4294967295U
+// PPC64:#define __UINT_LEAST32_TYPE__ unsigned int
+// PPC64:#define __UINT_LEAST64_MAX__ 18446744073709551615UL
+// PPC64:#define __UINT_LEAST64_TYPE__ long unsigned int
+// PPC64:#define __UINT_LEAST8_MAX__ 255
+// PPC64:#define __UINT_LEAST8_TYPE__ unsigned char
+// PPC64:#define __USER_LABEL_PREFIX__
+// PPC64:#define __WCHAR_MAX__ 2147483647
+// PPC64:#define __WCHAR_TYPE__ int
+// PPC64:#define __WCHAR_WIDTH__ 32
+// PPC64:#define __WINT_TYPE__ int
+// PPC64:#define __WINT_WIDTH__ 32
+// 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 -match-full-lines -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-NOT:#define _ARCH_PWR6X 1
+// PPC64LE:#define _ARCH_PWR7 1
+// PPC64LE:#define _CALL_ELF 2
+// PPC64LE:#define _LITTLE_ENDIAN 1
+// PPC64LE:#define _LP64 1
+// PPC64LE:#define __BIGGEST_ALIGNMENT__ 16
+// 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__ __LDBL_DECIMAL_DIG__
+// 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 __HAVE_BSWAP__ 1
+// PPC64LE:#define __INT16_C_SUFFIX__
+// PPC64LE:#define __INT16_FMTd__ "hd"
+// PPC64LE:#define __INT16_FMTi__ "hi"
+// PPC64LE:#define __INT16_MAX__ 32767
+// PPC64LE:#define __INT16_TYPE__ short
+// PPC64LE:#define __INT32_C_SUFFIX__
+// PPC64LE:#define __INT32_FMTd__ "d"
+// PPC64LE:#define __INT32_FMTi__ "i"
+// PPC64LE:#define __INT32_MAX__ 2147483647
+// PPC64LE:#define __INT32_TYPE__ int
+// PPC64LE:#define __INT64_C_SUFFIX__ L
+// PPC64LE:#define __INT64_FMTd__ "ld"
+// PPC64LE:#define __INT64_FMTi__ "li"
+// PPC64LE:#define __INT64_MAX__ 9223372036854775807L
+// PPC64LE:#define __INT64_TYPE__ long int
+// PPC64LE:#define __INT8_C_SUFFIX__
+// PPC64LE:#define __INT8_FMTd__ "hhd"
+// PPC64LE:#define __INT8_FMTi__ "hhi"
+// PPC64LE:#define __INT8_MAX__ 127
+// PPC64LE:#define __INT8_TYPE__ signed char
+// PPC64LE:#define __INTMAX_C_SUFFIX__ L
+// PPC64LE:#define __INTMAX_FMTd__ "ld"
+// PPC64LE:#define __INTMAX_FMTi__ "li"
+// PPC64LE:#define __INTMAX_MAX__ 9223372036854775807L
+// PPC64LE:#define __INTMAX_TYPE__ long int
+// PPC64LE:#define __INTMAX_WIDTH__ 64
+// PPC64LE:#define __INTPTR_FMTd__ "ld"
+// PPC64LE:#define __INTPTR_FMTi__ "li"
+// PPC64LE:#define __INTPTR_MAX__ 9223372036854775807L
+// PPC64LE:#define __INTPTR_TYPE__ long int
+// PPC64LE:#define __INTPTR_WIDTH__ 64
+// PPC64LE:#define __INT_FAST16_FMTd__ "hd"
+// PPC64LE:#define __INT_FAST16_FMTi__ "hi"
+// PPC64LE:#define __INT_FAST16_MAX__ 32767
+// PPC64LE:#define __INT_FAST16_TYPE__ short
+// PPC64LE:#define __INT_FAST32_FMTd__ "d"
+// PPC64LE:#define __INT_FAST32_FMTi__ "i"
+// PPC64LE:#define __INT_FAST32_MAX__ 2147483647
+// PPC64LE:#define __INT_FAST32_TYPE__ int
+// PPC64LE:#define __INT_FAST64_FMTd__ "ld"
+// PPC64LE:#define __INT_FAST64_FMTi__ "li"
+// PPC64LE:#define __INT_FAST64_MAX__ 9223372036854775807L
+// PPC64LE:#define __INT_FAST64_TYPE__ long int
+// PPC64LE:#define __INT_FAST8_FMTd__ "hhd"
+// PPC64LE:#define __INT_FAST8_FMTi__ "hhi"
+// PPC64LE:#define __INT_FAST8_MAX__ 127
+// PPC64LE:#define __INT_FAST8_TYPE__ signed char
+// PPC64LE:#define __INT_LEAST16_FMTd__ "hd"
+// PPC64LE:#define __INT_LEAST16_FMTi__ "hi"
+// PPC64LE:#define __INT_LEAST16_MAX__ 32767
+// PPC64LE:#define __INT_LEAST16_TYPE__ short
+// PPC64LE:#define __INT_LEAST32_FMTd__ "d"
+// PPC64LE:#define __INT_LEAST32_FMTi__ "i"
+// PPC64LE:#define __INT_LEAST32_MAX__ 2147483647
+// PPC64LE:#define __INT_LEAST32_TYPE__ int
+// PPC64LE:#define __INT_LEAST64_FMTd__ "ld"
+// PPC64LE:#define __INT_LEAST64_FMTi__ "li"
+// PPC64LE:#define __INT_LEAST64_MAX__ 9223372036854775807L
+// PPC64LE:#define __INT_LEAST64_TYPE__ long int
+// PPC64LE:#define __INT_LEAST8_FMTd__ "hhd"
+// PPC64LE:#define __INT_LEAST8_FMTi__ "hhi"
+// PPC64LE:#define __INT_LEAST8_MAX__ 127
+// PPC64LE:#define __INT_LEAST8_TYPE__ signed char
+// 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 __LONGDOUBLE128 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_MAX__ 2147483647
+// 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 __STRUCT_PARM_ALIGN__ 16
+// PPC64LE:#define __UINT16_C_SUFFIX__
+// PPC64LE:#define __UINT16_MAX__ 65535
+// PPC64LE:#define __UINT16_TYPE__ unsigned short
+// PPC64LE:#define __UINT32_C_SUFFIX__ U
+// PPC64LE:#define __UINT32_MAX__ 4294967295U
+// PPC64LE:#define __UINT32_TYPE__ unsigned int
+// PPC64LE:#define __UINT64_C_SUFFIX__ UL
+// PPC64LE:#define __UINT64_MAX__ 18446744073709551615UL
+// PPC64LE:#define __UINT64_TYPE__ long unsigned int
+// PPC64LE:#define __UINT8_C_SUFFIX__
+// PPC64LE:#define __UINT8_MAX__ 255
+// PPC64LE:#define __UINT8_TYPE__ unsigned char
+// PPC64LE:#define __UINTMAX_C_SUFFIX__ UL
+// PPC64LE:#define __UINTMAX_MAX__ 18446744073709551615UL
+// PPC64LE:#define __UINTMAX_TYPE__ long unsigned int
+// PPC64LE:#define __UINTMAX_WIDTH__ 64
+// PPC64LE:#define __UINTPTR_MAX__ 18446744073709551615UL
+// PPC64LE:#define __UINTPTR_TYPE__ long unsigned int
+// PPC64LE:#define __UINTPTR_WIDTH__ 64
+// PPC64LE:#define __UINT_FAST16_MAX__ 65535
+// PPC64LE:#define __UINT_FAST16_TYPE__ unsigned short
+// PPC64LE:#define __UINT_FAST32_MAX__ 4294967295U
+// PPC64LE:#define __UINT_FAST32_TYPE__ unsigned int
+// PPC64LE:#define __UINT_FAST64_MAX__ 18446744073709551615UL
+// PPC64LE:#define __UINT_FAST64_TYPE__ long unsigned int
+// PPC64LE:#define __UINT_FAST8_MAX__ 255
+// PPC64LE:#define __UINT_FAST8_TYPE__ unsigned char
+// PPC64LE:#define __UINT_LEAST16_MAX__ 65535
+// PPC64LE:#define __UINT_LEAST16_TYPE__ unsigned short
+// PPC64LE:#define __UINT_LEAST32_MAX__ 4294967295U
+// PPC64LE:#define __UINT_LEAST32_TYPE__ unsigned int
+// PPC64LE:#define __UINT_LEAST64_MAX__ 18446744073709551615UL
+// PPC64LE:#define __UINT_LEAST64_TYPE__ long unsigned int
+// PPC64LE:#define __UINT_LEAST8_MAX__ 255
+// PPC64LE:#define __UINT_LEAST8_TYPE__ unsigned char
+// 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 -match-full-lines -check-prefix PPCA2Q %s
+//
+// PPCA2Q:#define _ARCH_A2 1
+// PPCA2Q:#define _ARCH_A2Q 1
+// PPCA2Q:#define _ARCH_PPC 1
+// PPCA2Q:#define _ARCH_PPC64 1
+// PPCA2Q:#define _ARCH_QP 1
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-bgq-linux -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCBGQ %s
+//
+// PPCBGQ:#define __THW_BLUEGENE__ 1
+// PPCBGQ:#define __TOS_BGQ__ 1
+// PPCBGQ:#define __bg__ 1
+// PPCBGQ:#define __bgq__ 1
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu 630 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPC630 %s
+//
+// PPC630:#define _ARCH_630 1
+// PPC630:#define _ARCH_PPC 1
+// PPC630:#define _ARCH_PPC64 1
+// PPC630:#define _ARCH_PPCGR 1
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu pwr3 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCPWR3 %s
+//
+// PPCPWR3:#define _ARCH_PPC 1
+// PPCPWR3:#define _ARCH_PPC64 1
+// PPCPWR3:#define _ARCH_PPCGR 1
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu power3 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCPOWER3 %s
+//
+// PPCPOWER3:#define _ARCH_PPC 1
+// PPCPOWER3:#define _ARCH_PPC64 1
+// PPCPOWER3:#define _ARCH_PPCGR 1
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu pwr4 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCPWR4 %s
+//
+// PPCPWR4:#define _ARCH_PPC 1
+// PPCPWR4:#define _ARCH_PPC64 1
+// PPCPWR4:#define _ARCH_PPCGR 1
+// PPCPWR4:#define _ARCH_PPCSQ 1
+// PPCPWR4:#define _ARCH_PWR4 1
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu power4 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCPOWER4 %s
+//
+// PPCPOWER4:#define _ARCH_PPC 1
+// PPCPOWER4:#define _ARCH_PPC64 1
+// PPCPOWER4:#define _ARCH_PPCGR 1
+// PPCPOWER4:#define _ARCH_PPCSQ 1
+// PPCPOWER4:#define _ARCH_PWR4 1
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu pwr5 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCPWR5 %s
+//
+// PPCPWR5:#define _ARCH_PPC 1
+// PPCPWR5:#define _ARCH_PPC64 1
+// PPCPWR5:#define _ARCH_PPCGR 1
+// PPCPWR5:#define _ARCH_PPCSQ 1
+// PPCPWR5:#define _ARCH_PWR4 1
+// PPCPWR5:#define _ARCH_PWR5 1
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu power5 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCPOWER5 %s
+//
+// PPCPOWER5:#define _ARCH_PPC 1
+// PPCPOWER5:#define _ARCH_PPC64 1
+// PPCPOWER5:#define _ARCH_PPCGR 1
+// PPCPOWER5:#define _ARCH_PPCSQ 1
+// PPCPOWER5:#define _ARCH_PWR4 1
+// PPCPOWER5:#define _ARCH_PWR5 1
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu pwr5x -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCPWR5X %s
+//
+// PPCPWR5X:#define _ARCH_PPC 1
+// PPCPWR5X:#define _ARCH_PPC64 1
+// PPCPWR5X:#define _ARCH_PPCGR 1
+// PPCPWR5X:#define _ARCH_PPCSQ 1
+// PPCPWR5X:#define _ARCH_PWR4 1
+// PPCPWR5X:#define _ARCH_PWR5 1
+// PPCPWR5X:#define _ARCH_PWR5X 1
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu power5x -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCPOWER5X %s
+//
+// PPCPOWER5X:#define _ARCH_PPC 1
+// PPCPOWER5X:#define _ARCH_PPC64 1
+// PPCPOWER5X:#define _ARCH_PPCGR 1
+// PPCPOWER5X:#define _ARCH_PPCSQ 1
+// PPCPOWER5X:#define _ARCH_PWR4 1
+// PPCPOWER5X:#define _ARCH_PWR5 1
+// PPCPOWER5X:#define _ARCH_PWR5X 1
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu pwr6 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCPWR6 %s
+//
+// PPCPWR6:#define _ARCH_PPC 1
+// PPCPWR6:#define _ARCH_PPC64 1
+// PPCPWR6:#define _ARCH_PPCGR 1
+// PPCPWR6:#define _ARCH_PPCSQ 1
+// PPCPWR6:#define _ARCH_PWR4 1
+// PPCPWR6:#define _ARCH_PWR5 1
+// PPCPWR6:#define _ARCH_PWR5X 1
+// PPCPWR6:#define _ARCH_PWR6 1
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu power6 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCPOWER6 %s
+//
+// PPCPOWER6:#define _ARCH_PPC 1
+// PPCPOWER6:#define _ARCH_PPC64 1
+// PPCPOWER6:#define _ARCH_PPCGR 1
+// PPCPOWER6:#define _ARCH_PPCSQ 1
+// PPCPOWER6:#define _ARCH_PWR4 1
+// PPCPOWER6:#define _ARCH_PWR5 1
+// PPCPOWER6:#define _ARCH_PWR5X 1
+// PPCPOWER6:#define _ARCH_PWR6 1
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu pwr6x -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCPWR6X %s
+//
+// PPCPWR6X:#define _ARCH_PPC 1
+// PPCPWR6X:#define _ARCH_PPC64 1
+// PPCPWR6X:#define _ARCH_PPCGR 1
+// PPCPWR6X:#define _ARCH_PPCSQ 1
+// PPCPWR6X:#define _ARCH_PWR4 1
+// PPCPWR6X:#define _ARCH_PWR5 1
+// PPCPWR6X:#define _ARCH_PWR5X 1
+// PPCPWR6X:#define _ARCH_PWR6 1
+// PPCPWR6X:#define _ARCH_PWR6X 1
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu power6x -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCPOWER6X %s
+//
+// PPCPOWER6X:#define _ARCH_PPC 1
+// PPCPOWER6X:#define _ARCH_PPC64 1
+// PPCPOWER6X:#define _ARCH_PPCGR 1
+// PPCPOWER6X:#define _ARCH_PPCSQ 1
+// PPCPOWER6X:#define _ARCH_PWR4 1
+// PPCPOWER6X:#define _ARCH_PWR5 1
+// PPCPOWER6X:#define _ARCH_PWR5X 1
+// PPCPOWER6X:#define _ARCH_PWR6 1
+// PPCPOWER6X:#define _ARCH_PWR6X 1
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu pwr7 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCPWR7 %s
+//
+// PPCPWR7:#define _ARCH_PPC 1
+// PPCPWR7:#define _ARCH_PPC64 1
+// PPCPWR7:#define _ARCH_PPCGR 1
+// PPCPWR7:#define _ARCH_PPCSQ 1
+// PPCPWR7:#define _ARCH_PWR4 1
+// PPCPWR7:#define _ARCH_PWR5 1
+// PPCPWR7:#define _ARCH_PWR5X 1
+// PPCPWR7:#define _ARCH_PWR6 1
+// PPCPWR7-NOT:#define _ARCH_PWR6X 1
+// PPCPWR7:#define _ARCH_PWR7 1
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu power7 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCPOWER7 %s
+//
+// PPCPOWER7:#define _ARCH_PPC 1
+// PPCPOWER7:#define _ARCH_PPC64 1
+// PPCPOWER7:#define _ARCH_PPCGR 1
+// PPCPOWER7:#define _ARCH_PPCSQ 1
+// PPCPOWER7:#define _ARCH_PWR4 1
+// PPCPOWER7:#define _ARCH_PWR5 1
+// PPCPOWER7:#define _ARCH_PWR5X 1
+// PPCPOWER7:#define _ARCH_PWR6 1
+// PPCPOWER7-NOT:#define _ARCH_PWR6X 1
+// PPCPOWER7:#define _ARCH_PWR7 1
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu pwr8 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCPWR8 %s
+//
+// PPCPWR8:#define _ARCH_PPC 1
+// PPCPWR8:#define _ARCH_PPC64 1
+// PPCPWR8:#define _ARCH_PPCGR 1
+// PPCPWR8:#define _ARCH_PPCSQ 1
+// PPCPWR8:#define _ARCH_PWR4 1
+// PPCPWR8:#define _ARCH_PWR5 1
+// PPCPWR8:#define _ARCH_PWR5X 1
+// PPCPWR8:#define _ARCH_PWR6 1
+// PPCPWR8-NOT:#define _ARCH_PWR6X 1
+// PPCPWR8:#define _ARCH_PWR7 1
+// PPCPWR8:#define _ARCH_PWR8 1
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu power8 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCPOWER8 %s
+//
+// ppc64le also defaults to power8.
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64le-none-none -target-cpu ppc64le -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCPOWER8 %s
+//
+// PPCPOWER8:#define _ARCH_PPC 1
+// PPCPOWER8:#define _ARCH_PPC64 1
+// PPCPOWER8:#define _ARCH_PPCGR 1
+// PPCPOWER8:#define _ARCH_PPCSQ 1
+// PPCPOWER8:#define _ARCH_PWR4 1
+// PPCPOWER8:#define _ARCH_PWR5 1
+// PPCPOWER8:#define _ARCH_PWR5X 1
+// PPCPOWER8:#define _ARCH_PWR6 1
+// PPCPOWER8-NOT:#define _ARCH_PWR6X 1
+// PPCPOWER8:#define _ARCH_PWR7 1
+// PPCPOWER8:#define _ARCH_PWR8 1
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu pwr9 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCPWR9 %s
+//
+// PPCPWR9:#define _ARCH_PPC 1
+// PPCPWR9:#define _ARCH_PPC64 1
+// PPCPWR9:#define _ARCH_PPCGR 1
+// PPCPWR9:#define _ARCH_PPCSQ 1
+// PPCPWR9:#define _ARCH_PWR4 1
+// PPCPWR9:#define _ARCH_PWR5 1
+// PPCPWR9:#define _ARCH_PWR5X 1
+// PPCPWR9:#define _ARCH_PWR6 1
+// PPCPWR9-NOT:#define _ARCH_PWR6X 1
+// PPCPWR9:#define _ARCH_PWR7 1
+// PPCPWR9:#define _ARCH_PWR9 1
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu power9 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCPOWER9 %s
+//
+// PPCPOWER9:#define _ARCH_PPC 1
+// PPCPOWER9:#define _ARCH_PPC64 1
+// PPCPOWER9:#define _ARCH_PPCGR 1
+// PPCPOWER9:#define _ARCH_PPCSQ 1
+// PPCPOWER9:#define _ARCH_PWR4 1
+// PPCPOWER9:#define _ARCH_PWR5 1
+// PPCPOWER9:#define _ARCH_PWR5X 1
+// PPCPOWER9:#define _ARCH_PWR6 1
+// PPCPOWER9-NOT:#define _ARCH_PWR6X 1
+// PPCPOWER9:#define _ARCH_PWR7 1
+// PPCPOWER9:#define _ARCH_PWR9 1
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu future -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCFUTURE %s
+//
+// PPCFUTURE:#define _ARCH_PPC 1
+// PPCFUTURE:#define _ARCH_PPC64 1
+// PPCFUTURE:#define _ARCH_PPCGR 1
+// PPCFUTURE:#define _ARCH_PPCSQ 1
+// PPCFUTURE:#define _ARCH_PWR4 1
+// PPCFUTURE:#define _ARCH_PWR5 1
+// PPCFUTURE:#define _ARCH_PWR5X 1
+// PPCFUTURE:#define _ARCH_PWR6 1
+// PPCFUTURE-NOT:#define _ARCH_PWR6X 1
+// PPCFUTURE:#define _ARCH_PWR7 1
+// PPCFUTURE:#define _ARCH_PWR8 1
+// PPCFUTURE:#define _ARCH_PWR9 1
+// PPCFUTURE:#define _ARCH_PWR_FUTURE 1
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-feature +float128 -target-cpu power9 -fno-signed-char < /dev/null | FileCheck -check-prefix PPC-FLOAT128 %s
+// PPC-FLOAT128:#define __FLOAT128__ 1
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-ibm-aix7.1.0.0 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPC64-AIX %s
+//
+// PPC64-AIX:#define _AIX 1
+// PPC64-AIX:#define _ARCH_PPC 1
+// PPC64-AIX:#define _ARCH_PPC64 1
+// PPC64-AIX:#define _BIG_ENDIAN 1
+// PPC64-AIX:#define _IBMR2 1
+// PPC64-AIX-NOT:#define _ILP32 1
+// PPC64-AIX:#define _LONG_LONG 1
+// PPC64-AIX:#define _LP64 1
+// PPC64-AIX:#define _POWER 1
+// PPC64-AIX:#define __64BIT__ 1
+// PPC64-AIX:#define __BIGGEST_ALIGNMENT__ 8
+// PPC64-AIX:#define __BIG_ENDIAN__ 1
+// PPC64-AIX:#define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__
+// PPC64-AIX:#define __CHAR16_TYPE__ unsigned short
+// PPC64-AIX:#define __CHAR32_TYPE__ unsigned int
+// PPC64-AIX:#define __CHAR_BIT__ 8
+// PPC64-AIX:#define __CHAR_UNSIGNED__ 1
+// PPC64-AIX:#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
+// PPC64-AIX:#define __DBL_DIG__ 15
+// PPC64-AIX:#define __DBL_EPSILON__ 2.2204460492503131e-16
+// PPC64-AIX:#define __DBL_HAS_DENORM__ 1
+// PPC64-AIX:#define __DBL_HAS_INFINITY__ 1
+// PPC64-AIX:#define __DBL_HAS_QUIET_NAN__ 1
+// PPC64-AIX:#define __DBL_MANT_DIG__ 53
+// PPC64-AIX:#define __DBL_MAX_10_EXP__ 308
+// PPC64-AIX:#define __DBL_MAX_EXP__ 1024
+// PPC64-AIX:#define __DBL_MAX__ 1.7976931348623157e+308
+// PPC64-AIX:#define __DBL_MIN_10_EXP__ (-307)
+// PPC64-AIX:#define __DBL_MIN_EXP__ (-1021)
+// PPC64-AIX:#define __DBL_MIN__ 2.2250738585072014e-308
+// PPC64-AIX:#define __DECIMAL_DIG__ __LDBL_DECIMAL_DIG__
+// PPC64-AIX:#define __FLT_DENORM_MIN__ 1.40129846e-45F
+// PPC64-AIX:#define __FLT_DIG__ 6
+// PPC64-AIX:#define __FLT_EPSILON__ 1.19209290e-7F
+// PPC64-AIX:#define __FLT_EVAL_METHOD__ 1
+// PPC64-AIX:#define __FLT_HAS_DENORM__ 1
+// PPC64-AIX:#define __FLT_HAS_INFINITY__ 1
+// PPC64-AIX:#define __FLT_HAS_QUIET_NAN__ 1
+// PPC64-AIX:#define __FLT_MANT_DIG__ 24
+// PPC64-AIX:#define __FLT_MAX_10_EXP__ 38
+// PPC64-AIX:#define __FLT_MAX_EXP__ 128
+// PPC64-AIX:#define __FLT_MAX__ 3.40282347e+38F
+// PPC64-AIX:#define __FLT_MIN_10_EXP__ (-37)
+// PPC64-AIX:#define __FLT_MIN_EXP__ (-125)
+// PPC64-AIX:#define __FLT_MIN__ 1.17549435e-38F
+// PPC64-AIX:#define __FLT_RADIX__ 2
+// PPC64-AIX-NOT:#define __ILP32__ 1
+// PPC64-AIX:#define __INT16_C_SUFFIX__
+// PPC64-AIX:#define __INT16_FMTd__ "hd"
+// PPC64-AIX:#define __INT16_FMTi__ "hi"
+// PPC64-AIX:#define __INT16_MAX__ 32767
+// PPC64-AIX:#define __INT16_TYPE__ short
+// PPC64-AIX:#define __INT32_C_SUFFIX__
+// PPC64-AIX:#define __INT32_FMTd__ "d"
+// PPC64-AIX:#define __INT32_FMTi__ "i"
+// PPC64-AIX:#define __INT32_MAX__ 2147483647
+// PPC64-AIX:#define __INT32_TYPE__ int
+// PPC64-AIX:#define __INT64_C_SUFFIX__ L
+// PPC64-AIX:#define __INT64_FMTd__ "ld"
+// PPC64-AIX:#define __INT64_FMTi__ "li"
+// PPC64-AIX:#define __INT64_MAX__ 9223372036854775807L
+// PPC64-AIX:#define __INT64_TYPE__ long int
+// PPC64-AIX:#define __INT8_C_SUFFIX__
+// PPC64-AIX:#define __INT8_FMTd__ "hhd"
+// PPC64-AIX:#define __INT8_FMTi__ "hhi"
+// PPC64-AIX:#define __INT8_MAX__ 127
+// PPC64-AIX:#define __INT8_TYPE__ signed char
+// PPC64-AIX:#define __INTMAX_C_SUFFIX__ L
+// PPC64-AIX:#define __INTMAX_FMTd__ "ld"
+// PPC64-AIX:#define __INTMAX_FMTi__ "li"
+// PPC64-AIX:#define __INTMAX_MAX__ 9223372036854775807L
+// PPC64-AIX:#define __INTMAX_TYPE__ long int
+// PPC64-AIX:#define __INTMAX_WIDTH__ 64
+// PPC64-AIX:#define __INTPTR_FMTd__ "ld"
+// PPC64-AIX:#define __INTPTR_FMTi__ "li"
+// PPC64-AIX:#define __INTPTR_MAX__ 9223372036854775807L
+// PPC64-AIX:#define __INTPTR_TYPE__ long int
+// PPC64-AIX:#define __INTPTR_WIDTH__ 64
+// PPC64-AIX:#define __INT_FAST16_FMTd__ "hd"
+// PPC64-AIX:#define __INT_FAST16_FMTi__ "hi"
+// PPC64-AIX:#define __INT_FAST16_MAX__ 32767
+// PPC64-AIX:#define __INT_FAST16_TYPE__ short
+// PPC64-AIX:#define __INT_FAST32_FMTd__ "d"
+// PPC64-AIX:#define __INT_FAST32_FMTi__ "i"
+// PPC64-AIX:#define __INT_FAST32_MAX__ 2147483647
+// PPC64-AIX:#define __INT_FAST32_TYPE__ int
+// PPC64-AIX:#define __INT_FAST64_FMTd__ "ld"
+// PPC64-AIX:#define __INT_FAST64_FMTi__ "li"
+// PPC64-AIX:#define __INT_FAST64_MAX__ 9223372036854775807L
+// PPC64-AIX:#define __INT_FAST64_TYPE__ long int
+// PPC64-AIX:#define __INT_FAST8_FMTd__ "hhd"
+// PPC64-AIX:#define __INT_FAST8_FMTi__ "hhi"
+// PPC64-AIX:#define __INT_FAST8_MAX__ 127
+// PPC64-AIX:#define __INT_FAST8_TYPE__ signed char
+// PPC64-AIX:#define __INT_LEAST16_FMTd__ "hd"
+// PPC64-AIX:#define __INT_LEAST16_FMTi__ "hi"
+// PPC64-AIX:#define __INT_LEAST16_MAX__ 32767
+// PPC64-AIX:#define __INT_LEAST16_TYPE__ short
+// PPC64-AIX:#define __INT_LEAST32_FMTd__ "d"
+// PPC64-AIX:#define __INT_LEAST32_FMTi__ "i"
+// PPC64-AIX:#define __INT_LEAST32_MAX__ 2147483647
+// PPC64-AIX:#define __INT_LEAST32_TYPE__ int
+// PPC64-AIX:#define __INT_LEAST64_FMTd__ "ld"
+// PPC64-AIX:#define __INT_LEAST64_FMTi__ "li"
+// PPC64-AIX:#define __INT_LEAST64_MAX__ 9223372036854775807L
+// PPC64-AIX:#define __INT_LEAST64_TYPE__ long int
+// PPC64-AIX:#define __INT_LEAST8_FMTd__ "hhd"
+// PPC64-AIX:#define __INT_LEAST8_FMTi__ "hhi"
+// PPC64-AIX:#define __INT_LEAST8_MAX__ 127
+// PPC64-AIX:#define __INT_LEAST8_TYPE__ signed char
+// PPC64-AIX:#define __INT_MAX__ 2147483647
+// PPC64-AIX:#define __LDBL_DECIMAL_DIG__ 17
+// PPC64-AIX:#define __LDBL_DENORM_MIN__ 4.9406564584124654e-324L
+// PPC64-AIX:#define __LDBL_DIG__ 15
+// PPC64-AIX:#define __LDBL_EPSILON__ 2.2204460492503131e-16L
+// PPC64-AIX:#define __LDBL_HAS_DENORM__ 1
+// PPC64-AIX:#define __LDBL_HAS_INFINITY__ 1
+// PPC64-AIX:#define __LDBL_HAS_QUIET_NAN__ 1
+// PPC64-AIX:#define __LDBL_MANT_DIG__ 53
+// PPC64-AIX:#define __LDBL_MAX_10_EXP__ 308
+// PPC64-AIX:#define __LDBL_MAX_EXP__ 1024
+// PPC64-AIX:#define __LDBL_MAX__ 1.7976931348623157e+308L
+// PPC64-AIX:#define __LDBL_MIN_10_EXP__ (-307)
+// PPC64-AIX:#define __LDBL_MIN_EXP__ (-1021)
+// PPC64-AIX:#define __LDBL_MIN__ 2.2250738585072014e-308L
+// PPC64-AIX:#define __LONG_LONG_MAX__ 9223372036854775807LL
+// PPC64-AIX:#define __LONG_MAX__ 9223372036854775807L
+// PPC64-AIX:#define __LP64__ 1
+// PPC64-AIX-NOT:#define __NATURAL_ALIGNMENT__ 1
+// PPC64-AIX:#define __POINTER_WIDTH__ 64
+// PPC64-AIX:#define __POWERPC__ 1
+// PPC64-AIX:#define __PPC64__ 1
+// PPC64-AIX:#define __PPC__ 1
+// PPC64-AIX:#define __PTRDIFF_TYPE__ long int
+// PPC64-AIX:#define __PTRDIFF_WIDTH__ 64
+// PPC64-AIX:#define __REGISTER_PREFIX__
+// PPC64-AIX:#define __SCHAR_MAX__ 127
+// PPC64-AIX:#define __SHRT_MAX__ 32767
+// PPC64-AIX:#define __SIG_ATOMIC_MAX__ 2147483647
+// PPC64-AIX:#define __SIG_ATOMIC_WIDTH__ 32
+// PPC64-AIX:#define __SIZEOF_DOUBLE__ 8
+// PPC64-AIX:#define __SIZEOF_FLOAT__ 4
+// PPC64-AIX:#define __SIZEOF_INT__ 4
+// PPC64-AIX:#define __SIZEOF_LONG_DOUBLE__ 8
+// PPC64-AIX:#define __SIZEOF_LONG_LONG__ 8
+// PPC64-AIX:#define __SIZEOF_LONG__ 8
+// PPC64-AIX:#define __SIZEOF_POINTER__ 8
+// PPC64-AIX:#define __SIZEOF_PTRDIFF_T__ 8
+// PPC64-AIX:#define __SIZEOF_SHORT__ 2
+// PPC64-AIX:#define __SIZEOF_SIZE_T__ 8
+// PPC64-AIX:#define __SIZEOF_WCHAR_T__ 4
+// PPC64-AIX:#define __SIZEOF_WINT_T__ 4
+// PPC64-AIX:#define __SIZE_MAX__ 18446744073709551615UL
+// PPC64-AIX:#define __SIZE_TYPE__ long unsigned int
+// PPC64-AIX:#define __SIZE_WIDTH__ 64
+// PPC64-AIX:#define __UINT16_C_SUFFIX__
+// PPC64-AIX:#define __UINT16_MAX__ 65535
+// PPC64-AIX:#define __UINT16_TYPE__ unsigned short
+// PPC64-AIX:#define __UINT32_C_SUFFIX__ U
+// PPC64-AIX:#define __UINT32_MAX__ 4294967295U
+// PPC64-AIX:#define __UINT32_TYPE__ unsigned int
+// PPC64-AIX:#define __UINT64_C_SUFFIX__ UL
+// PPC64-AIX:#define __UINT64_MAX__ 18446744073709551615UL
+// PPC64-AIX:#define __UINT64_TYPE__ long unsigned int
+// PPC64-AIX:#define __UINT8_C_SUFFIX__
+// PPC64-AIX:#define __UINT8_MAX__ 255
+// PPC64-AIX:#define __UINT8_TYPE__ unsigned char
+// PPC64-AIX:#define __UINTMAX_C_SUFFIX__ UL
+// PPC64-AIX:#define __UINTMAX_MAX__ 18446744073709551615UL
+// PPC64-AIX:#define __UINTMAX_TYPE__ long unsigned int
+// PPC64-AIX:#define __UINTMAX_WIDTH__ 64
+// PPC64-AIX:#define __UINTPTR_MAX__ 18446744073709551615UL
+// PPC64-AIX:#define __UINTPTR_TYPE__ long unsigned int
+// PPC64-AIX:#define __UINTPTR_WIDTH__ 64
+// PPC64-AIX:#define __UINT_FAST16_MAX__ 65535
+// PPC64-AIX:#define __UINT_FAST16_TYPE__ unsigned short
+// PPC64-AIX:#define __UINT_FAST32_MAX__ 4294967295U
+// PPC64-AIX:#define __UINT_FAST32_TYPE__ unsigned int
+// PPC64-AIX:#define __UINT_FAST64_MAX__ 18446744073709551615UL
+// PPC64-AIX:#define __UINT_FAST64_TYPE__ long unsigned int
+// PPC64-AIX:#define __UINT_FAST8_MAX__ 255
+// PPC64-AIX:#define __UINT_FAST8_TYPE__ unsigned char
+// PPC64-AIX:#define __UINT_LEAST16_MAX__ 65535
+// PPC64-AIX:#define __UINT_LEAST16_TYPE__ unsigned short
+// PPC64-AIX:#define __UINT_LEAST32_MAX__ 4294967295U
+// PPC64-AIX:#define __UINT_LEAST32_TYPE__ unsigned int
+// PPC64-AIX:#define __UINT_LEAST64_MAX__ 18446744073709551615UL
+// PPC64-AIX:#define __UINT_LEAST64_TYPE__ long unsigned int
+// PPC64-AIX:#define __UINT_LEAST8_MAX__ 255
+// PPC64-AIX:#define __UINT_LEAST8_TYPE__ unsigned char
+// PPC64-AIX:#define __USER_LABEL_PREFIX__
+// PPC64-AIX:#define __WCHAR_MAX__ 4294967295U
+// PPC64-AIX:#define __WCHAR_TYPE__ unsigned int
+// PPC64-AIX:#define __WCHAR_WIDTH__ 32
+// PPC64-AIX:#define __WINT_TYPE__ int
+// PPC64-AIX:#define __WINT_WIDTH__ 32
+// PPC64-AIX:#define __powerpc64__ 1
+// PPC64-AIX:#define __powerpc__ 1
+// PPC64-AIX:#define __ppc64__ 1
+// PPC64-AIX:#define __ppc__ 1
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-unknown-linux-gnu -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPC64-LINUX %s
+//
+// PPC64-LINUX:#define _ARCH_PPC 1
+// PPC64-LINUX:#define _ARCH_PPC64 1
+// PPC64-LINUX:#define _BIG_ENDIAN 1
+// PPC64-LINUX:#define _CALL_LINUX 1
+// PPC64-LINUX:#define _LP64 1
+// PPC64-LINUX:#define __BIGGEST_ALIGNMENT__ 16
+// PPC64-LINUX:#define __BIG_ENDIAN__ 1
+// PPC64-LINUX:#define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__
+// PPC64-LINUX:#define __CHAR16_TYPE__ unsigned short
+// PPC64-LINUX:#define __CHAR32_TYPE__ unsigned int
+// PPC64-LINUX:#define __CHAR_BIT__ 8
+// PPC64-LINUX:#define __CHAR_UNSIGNED__ 1
+// PPC64-LINUX:#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
+// PPC64-LINUX:#define __DBL_DIG__ 15
+// PPC64-LINUX:#define __DBL_EPSILON__ 2.2204460492503131e-16
+// PPC64-LINUX:#define __DBL_HAS_DENORM__ 1
+// PPC64-LINUX:#define __DBL_HAS_INFINITY__ 1
+// PPC64-LINUX:#define __DBL_HAS_QUIET_NAN__ 1
+// PPC64-LINUX:#define __DBL_MANT_DIG__ 53
+// PPC64-LINUX:#define __DBL_MAX_10_EXP__ 308
+// PPC64-LINUX:#define __DBL_MAX_EXP__ 1024
+// PPC64-LINUX:#define __DBL_MAX__ 1.7976931348623157e+308
+// PPC64-LINUX:#define __DBL_MIN_10_EXP__ (-307)
+// PPC64-LINUX:#define __DBL_MIN_EXP__ (-1021)
+// PPC64-LINUX:#define __DBL_MIN__ 2.2250738585072014e-308
+// PPC64-LINUX:#define __DECIMAL_DIG__ __LDBL_DECIMAL_DIG__
+// PPC64-LINUX:#define __FLT_DENORM_MIN__ 1.40129846e-45F
+// PPC64-LINUX:#define __FLT_DIG__ 6
+// PPC64-LINUX:#define __FLT_EPSILON__ 1.19209290e-7F
+// PPC64-LINUX:#define __FLT_EVAL_METHOD__ 0
+// PPC64-LINUX:#define __FLT_HAS_DENORM__ 1
+// PPC64-LINUX:#define __FLT_HAS_INFINITY__ 1
+// PPC64-LINUX:#define __FLT_HAS_QUIET_NAN__ 1
+// PPC64-LINUX:#define __FLT_MANT_DIG__ 24
+// PPC64-LINUX:#define __FLT_MAX_10_EXP__ 38
+// PPC64-LINUX:#define __FLT_MAX_EXP__ 128
+// PPC64-LINUX:#define __FLT_MAX__ 3.40282347e+38F
+// PPC64-LINUX:#define __FLT_MIN_10_EXP__ (-37)
+// PPC64-LINUX:#define __FLT_MIN_EXP__ (-125)
+// PPC64-LINUX:#define __FLT_MIN__ 1.17549435e-38F
+// PPC64-LINUX:#define __FLT_RADIX__ 2
+// PPC64-LINUX:#define __HAVE_BSWAP__ 1
+// PPC64-LINUX:#define __INT16_C_SUFFIX__
+// PPC64-LINUX:#define __INT16_FMTd__ "hd"
+// PPC64-LINUX:#define __INT16_FMTi__ "hi"
+// PPC64-LINUX:#define __INT16_MAX__ 32767
+// PPC64-LINUX:#define __INT16_TYPE__ short
+// PPC64-LINUX:#define __INT32_C_SUFFIX__
+// PPC64-LINUX:#define __INT32_FMTd__ "d"
+// PPC64-LINUX:#define __INT32_FMTi__ "i"
+// PPC64-LINUX:#define __INT32_MAX__ 2147483647
+// PPC64-LINUX:#define __INT32_TYPE__ int
+// PPC64-LINUX:#define __INT64_C_SUFFIX__ L
+// PPC64-LINUX:#define __INT64_FMTd__ "ld"
+// PPC64-LINUX:#define __INT64_FMTi__ "li"
+// PPC64-LINUX:#define __INT64_MAX__ 9223372036854775807L
+// PPC64-LINUX:#define __INT64_TYPE__ long int
+// PPC64-LINUX:#define __INT8_C_SUFFIX__
+// PPC64-LINUX:#define __INT8_FMTd__ "hhd"
+// PPC64-LINUX:#define __INT8_FMTi__ "hhi"
+// PPC64-LINUX:#define __INT8_MAX__ 127
+// PPC64-LINUX:#define __INT8_TYPE__ signed char
+// PPC64-LINUX:#define __INTMAX_C_SUFFIX__ L
+// PPC64-LINUX:#define __INTMAX_FMTd__ "ld"
+// PPC64-LINUX:#define __INTMAX_FMTi__ "li"
+// PPC64-LINUX:#define __INTMAX_MAX__ 9223372036854775807L
+// PPC64-LINUX:#define __INTMAX_TYPE__ long int
+// PPC64-LINUX:#define __INTMAX_WIDTH__ 64
+// PPC64-LINUX:#define __INTPTR_FMTd__ "ld"
+// PPC64-LINUX:#define __INTPTR_FMTi__ "li"
+// PPC64-LINUX:#define __INTPTR_MAX__ 9223372036854775807L
+// PPC64-LINUX:#define __INTPTR_TYPE__ long int
+// PPC64-LINUX:#define __INTPTR_WIDTH__ 64
+// PPC64-LINUX:#define __INT_FAST16_FMTd__ "hd"
+// PPC64-LINUX:#define __INT_FAST16_FMTi__ "hi"
+// PPC64-LINUX:#define __INT_FAST16_MAX__ 32767
+// PPC64-LINUX:#define __INT_FAST16_TYPE__ short
+// PPC64-LINUX:#define __INT_FAST32_FMTd__ "d"
+// PPC64-LINUX:#define __INT_FAST32_FMTi__ "i"
+// PPC64-LINUX:#define __INT_FAST32_MAX__ 2147483647
+// PPC64-LINUX:#define __INT_FAST32_TYPE__ int
+// PPC64-LINUX:#define __INT_FAST64_FMTd__ "ld"
+// PPC64-LINUX:#define __INT_FAST64_FMTi__ "li"
+// PPC64-LINUX:#define __INT_FAST64_MAX__ 9223372036854775807L
+// PPC64-LINUX:#define __INT_FAST64_TYPE__ long int
+// PPC64-LINUX:#define __INT_FAST8_FMTd__ "hhd"
+// PPC64-LINUX:#define __INT_FAST8_FMTi__ "hhi"
+// PPC64-LINUX:#define __INT_FAST8_MAX__ 127
+// PPC64-LINUX:#define __INT_FAST8_TYPE__ signed char
+// PPC64-LINUX:#define __INT_LEAST16_FMTd__ "hd"
+// PPC64-LINUX:#define __INT_LEAST16_FMTi__ "hi"
+// PPC64-LINUX:#define __INT_LEAST16_MAX__ 32767
+// PPC64-LINUX:#define __INT_LEAST16_TYPE__ short
+// PPC64-LINUX:#define __INT_LEAST32_FMTd__ "d"
+// PPC64-LINUX:#define __INT_LEAST32_FMTi__ "i"
+// PPC64-LINUX:#define __INT_LEAST32_MAX__ 2147483647
+// PPC64-LINUX:#define __INT_LEAST32_TYPE__ int
+// PPC64-LINUX:#define __INT_LEAST64_FMTd__ "ld"
+// PPC64-LINUX:#define __INT_LEAST64_FMTi__ "li"
+// PPC64-LINUX:#define __INT_LEAST64_MAX__ 9223372036854775807L
+// PPC64-LINUX:#define __INT_LEAST64_TYPE__ long int
+// PPC64-LINUX:#define __INT_LEAST8_FMTd__ "hhd"
+// PPC64-LINUX:#define __INT_LEAST8_FMTi__ "hhi"
+// PPC64-LINUX:#define __INT_LEAST8_MAX__ 127
+// PPC64-LINUX:#define __INT_LEAST8_TYPE__ signed char
+// PPC64-LINUX:#define __INT_MAX__ 2147483647
+// PPC64-LINUX:#define __LDBL_DENORM_MIN__ 4.94065645841246544176568792868221e-324L
+// PPC64-LINUX:#define __LDBL_DIG__ 31
+// PPC64-LINUX:#define __LDBL_EPSILON__ 4.94065645841246544176568792868221e-324L
+// PPC64-LINUX:#define __LDBL_HAS_DENORM__ 1
+// PPC64-LINUX:#define __LDBL_HAS_INFINITY__ 1
+// PPC64-LINUX:#define __LDBL_HAS_QUIET_NAN__ 1
+// PPC64-LINUX:#define __LDBL_MANT_DIG__ 106
+// PPC64-LINUX:#define __LDBL_MAX_10_EXP__ 308
+// PPC64-LINUX:#define __LDBL_MAX_EXP__ 1024
+// PPC64-LINUX:#define __LDBL_MAX__ 1.79769313486231580793728971405301e+308L
+// PPC64-LINUX:#define __LDBL_MIN_10_EXP__ (-291)
+// PPC64-LINUX:#define __LDBL_MIN_EXP__ (-968)
+// PPC64-LINUX:#define __LDBL_MIN__ 2.00416836000897277799610805135016e-292L
+// PPC64-LINUX:#define __LONGDOUBLE128 1
+// PPC64-LINUX:#define __LONG_DOUBLE_128__ 1
+// PPC64-LINUX:#define __LONG_LONG_MAX__ 9223372036854775807LL
+// PPC64-LINUX:#define __LONG_MAX__ 9223372036854775807L
+// PPC64-LINUX:#define __LP64__ 1
+// 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__
+// PPC64-LINUX:#define __SCHAR_MAX__ 127
+// PPC64-LINUX:#define __SHRT_MAX__ 32767
+// PPC64-LINUX:#define __SIG_ATOMIC_MAX__ 2147483647
+// PPC64-LINUX:#define __SIG_ATOMIC_WIDTH__ 32
+// PPC64-LINUX:#define __SIZEOF_DOUBLE__ 8
+// PPC64-LINUX:#define __SIZEOF_FLOAT__ 4
+// PPC64-LINUX:#define __SIZEOF_INT__ 4
+// PPC64-LINUX:#define __SIZEOF_LONG_DOUBLE__ 16
+// PPC64-LINUX:#define __SIZEOF_LONG_LONG__ 8
+// PPC64-LINUX:#define __SIZEOF_LONG__ 8
+// PPC64-LINUX:#define __SIZEOF_POINTER__ 8
+// PPC64-LINUX:#define __SIZEOF_PTRDIFF_T__ 8
+// PPC64-LINUX:#define __SIZEOF_SHORT__ 2
+// PPC64-LINUX:#define __SIZEOF_SIZE_T__ 8
+// PPC64-LINUX:#define __SIZEOF_WCHAR_T__ 4
+// PPC64-LINUX:#define __SIZEOF_WINT_T__ 4
+// PPC64-LINUX:#define __SIZE_MAX__ 18446744073709551615UL
+// PPC64-LINUX:#define __SIZE_TYPE__ long unsigned int
+// PPC64-LINUX:#define __SIZE_WIDTH__ 64
+// PPC64-LINUX:#define __UINT16_C_SUFFIX__
+// PPC64-LINUX:#define __UINT16_MAX__ 65535
+// PPC64-LINUX:#define __UINT16_TYPE__ unsigned short
+// PPC64-LINUX:#define __UINT32_C_SUFFIX__ U
+// PPC64-LINUX:#define __UINT32_MAX__ 4294967295U
+// PPC64-LINUX:#define __UINT32_TYPE__ unsigned int
+// PPC64-LINUX:#define __UINT64_C_SUFFIX__ UL
+// PPC64-LINUX:#define __UINT64_MAX__ 18446744073709551615UL
+// PPC64-LINUX:#define __UINT64_TYPE__ long unsigned int
+// PPC64-LINUX:#define __UINT8_C_SUFFIX__
+// PPC64-LINUX:#define __UINT8_MAX__ 255
+// PPC64-LINUX:#define __UINT8_TYPE__ unsigned char
+// PPC64-LINUX:#define __UINTMAX_C_SUFFIX__ UL
+// PPC64-LINUX:#define __UINTMAX_MAX__ 18446744073709551615UL
+// PPC64-LINUX:#define __UINTMAX_TYPE__ long unsigned int
+// PPC64-LINUX:#define __UINTMAX_WIDTH__ 64
+// PPC64-LINUX:#define __UINTPTR_MAX__ 18446744073709551615UL
+// PPC64-LINUX:#define __UINTPTR_TYPE__ long unsigned int
+// PPC64-LINUX:#define __UINTPTR_WIDTH__ 64
+// PPC64-LINUX:#define __UINT_FAST16_MAX__ 65535
+// PPC64-LINUX:#define __UINT_FAST16_TYPE__ unsigned short
+// PPC64-LINUX:#define __UINT_FAST32_MAX__ 4294967295U
+// PPC64-LINUX:#define __UINT_FAST32_TYPE__ unsigned int
+// PPC64-LINUX:#define __UINT_FAST64_MAX__ 18446744073709551615UL
+// PPC64-LINUX:#define __UINT_FAST64_TYPE__ long unsigned int
+// PPC64-LINUX:#define __UINT_FAST8_MAX__ 255
+// PPC64-LINUX:#define __UINT_FAST8_TYPE__ unsigned char
+// PPC64-LINUX:#define __UINT_LEAST16_MAX__ 65535
+// PPC64-LINUX:#define __UINT_LEAST16_TYPE__ unsigned short
+// PPC64-LINUX:#define __UINT_LEAST32_MAX__ 4294967295U
+// PPC64-LINUX:#define __UINT_LEAST32_TYPE__ unsigned int
+// PPC64-LINUX:#define __UINT_LEAST64_MAX__ 18446744073709551615UL
+// PPC64-LINUX:#define __UINT_LEAST64_TYPE__ long unsigned int
+// PPC64-LINUX:#define __UINT_LEAST8_MAX__ 255
+// PPC64-LINUX:#define __UINT_LEAST8_TYPE__ unsigned char
+// PPC64-LINUX:#define __USER_LABEL_PREFIX__
+// PPC64-LINUX:#define __WCHAR_MAX__ 2147483647
+// PPC64-LINUX:#define __WCHAR_TYPE__ int
+// PPC64-LINUX:#define __WCHAR_WIDTH__ 32
+// PPC64-LINUX:#define __WINT_TYPE__ unsigned int
+// PPC64-LINUX:#define __WINT_UNSIGNED__ 1
+// PPC64-LINUX:#define __WINT_WIDTH__ 32
+// PPC64-LINUX:#define __powerpc64__ 1
+// PPC64-LINUX:#define __powerpc__ 1
+// PPC64-LINUX:#define __ppc64__ 1
+// PPC64-LINUX:#define __ppc__ 1
+
+// RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=powerpc64-unknown-linux-gnu < /dev/null | FileCheck -match-full-lines -check-prefix PPC64-ELFv1 %s
+// RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=powerpc64-unknown-linux-gnu -target-abi elfv1 < /dev/null | FileCheck -match-full-lines -check-prefix PPC64-ELFv1 %s
+// RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=powerpc64-unknown-linux-gnu -target-abi elfv1-qpx < /dev/null | FileCheck -match-full-lines -check-prefix PPC64-ELFv1 %s
+// RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=powerpc64-unknown-linux-gnu -target-abi elfv2 < /dev/null | FileCheck -match-full-lines -check-prefix PPC64-ELFv2 %s
+// RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=powerpc64le-unknown-linux-gnu < /dev/null | FileCheck -match-full-lines -check-prefix PPC64-ELFv2 %s
+// RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=powerpc64le-unknown-linux-gnu -target-abi elfv1 < /dev/null | FileCheck -match-full-lines -check-prefix PPC64-ELFv1 %s
+// RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=powerpc64le-unknown-linux-gnu -target-abi elfv2 < /dev/null | FileCheck -match-full-lines -check-prefix PPC64-ELFv2 %s
+
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-unknown-freebsd11 -target-abi elfv1 -xc /dev/null | FileCheck --check-prefix=PPC64-ELFv1 %s
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-unknown-freebsd12 -target-abi elfv1 -xc /dev/null | FileCheck --check-prefix=PPC64-ELFv1 %s
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-unknown-freebsd13 -target-abi elfv2 -xc /dev/null | FileCheck --check-prefix=PPC64-ELFv2 %s
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-linux-musl -target-abi elfv2 -xc /dev/null | FileCheck --check-prefix=PPC64-ELFv2 %s
+
+// PPC64-ELFv1:#define _CALL_ELF 1
+// PPC64-ELFv2:#define _CALL_ELF 2
+//
+// Most of this is encompassed in other places.
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64le-unknown-linux-gnu -target-abi elfv2 < /dev/null | FileCheck -match-full-lines -check-prefix PPC64LE-LINUX %s
+//
+// PPC64LE-LINUX:#define _CALL_LINUX 1
+
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-unknown-freebsd < /dev/null | FileCheck -match-full-lines -check-prefix PPC64-FREEBSD %s
+// PPC64-FREEBSD-NOT: #define __LONG_DOUBLE_128__ 1
diff --git a/src/llvm-project/clang/test/Preprocessor/init-v7k-compat.c b/src/llvm-project/clang/test/Preprocessor/init-v7k-compat.c
index 3a10747..482c7ad 100644
--- a/src/llvm-project/clang/test/Preprocessor/init-v7k-compat.c
+++ b/src/llvm-project/clang/test/Preprocessor/init-v7k-compat.c
@@ -1,3 +1,4 @@
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=arm64_32-apple-ios7.0 < /dev/null | FileCheck %s
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=thumbv7k-apple-watchos2.0 < /dev/null | FileCheck %s
// Check that the chosen types for things like size_t, ptrdiff_t etc are as
diff --git a/src/llvm-project/clang/test/Preprocessor/init.c b/src/llvm-project/clang/test/Preprocessor/init.c
index 954f02a..6966698 100644
--- a/src/llvm-project/clang/test/Preprocessor/init.c
+++ b/src/llvm-project/clang/test/Preprocessor/init.c
@@ -9,18 +9,20 @@
// BLOCKS:#define __block __attribute__((__blocks__(byref)))
//
//
-// RUN: %clang_cc1 -x c++ -std=c++2a -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix CXX2A %s
+// RUN: %clang_cc1 -x c++ -fgnuc-version=4.2.1 -std=c++20 -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix CXX2A %s
+// RUN: %clang_cc1 -x c++ -fgnuc-version=4.2.1 -std=c++2a -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix CXX2A %s
//
-// CXX2A:#define __GNUG__ {{.*}}
+// CXX2A:#define __GNUG__ 4
// CXX2A:#define __GXX_EXPERIMENTAL_CXX0X__ 1
// CXX2A:#define __GXX_RTTI 1
// CXX2A:#define __GXX_WEAK__ 1
-// CXX2A:#define __cplusplus 201707L
+// CXX2A:#define __cplusplus 202002L
// CXX2A:#define __private_extern__ extern
//
-// RUN: %clang_cc1 -x c++ -std=c++1z -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix CXX1Z %s
+// RUN: %clang_cc1 -x c++ -fgnuc-version=4.2.1 -std=c++17 -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix CXX1Z %s
+// RUN: %clang_cc1 -x c++ -fgnuc-version=4.2.1 -std=c++1z -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix CXX1Z %s
//
-// CXX1Z:#define __GNUG__ {{.*}}
+// CXX1Z:#define __GNUG__ 4
// CXX1Z:#define __GXX_EXPERIMENTAL_CXX0X__ 1
// CXX1Z:#define __GXX_RTTI 1
// CXX1Z:#define __GXX_WEAK__ 1
@@ -28,9 +30,10 @@
// CXX1Z:#define __private_extern__ extern
//
//
-// RUN: %clang_cc1 -x c++ -std=c++1y -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix CXX1Y %s
+// RUN: %clang_cc1 -x c++ -fgnuc-version=4.2.1 -std=c++14 -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix CXX1Y %s
+// RUN: %clang_cc1 -x c++ -fgnuc-version=4.2.1 -std=c++1y -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix CXX1Y %s
//
-// CXX1Y:#define __GNUG__ {{.*}}
+// CXX1Y:#define __GNUG__ 4
// CXX1Y:#define __GXX_EXPERIMENTAL_CXX0X__ 1
// CXX1Y:#define __GXX_RTTI 1
// CXX1Y:#define __GXX_WEAK__ 1
@@ -38,9 +41,9 @@
// CXX1Y:#define __private_extern__ extern
//
//
-// RUN: %clang_cc1 -x c++ -std=c++11 -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix CXX11 %s
+// RUN: %clang_cc1 -x c++ -fgnuc-version=4.2.1 -std=c++11 -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix CXX11 %s
//
-// CXX11:#define __GNUG__ {{.*}}
+// CXX11:#define __GNUG__ 4
// CXX11:#define __GXX_EXPERIMENTAL_CXX0X__ 1
// CXX11:#define __GXX_RTTI 1
// CXX11:#define __GXX_WEAK__ 1
@@ -48,9 +51,9 @@
// CXX11:#define __private_extern__ extern
//
//
-// RUN: %clang_cc1 -x c++ -std=c++98 -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix CXX98 %s
+// RUN: %clang_cc1 -x c++ -fgnuc-version=4.2.1 -std=c++98 -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix CXX98 %s
//
-// CXX98:#define __GNUG__ {{.*}}
+// CXX98:#define __GNUG__ 4
// CXX98:#define __GXX_RTTI 1
// CXX98:#define __GXX_WEAK__ 1
// CXX98:#define __cplusplus 199711L
@@ -87,7 +90,7 @@
// C11-NOT: __cplusplus
//
//
-// RUN: %clang_cc1 -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix COMMON %s
+// RUN: %clang_cc1 -fgnuc-version=4.2.1 -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix COMMON %s
//
// COMMON:#define __CONSTANT_CFSTRINGS__ 1
// COMMON:#define __FINITE_MATH_ONLY__ 0
@@ -119,41 +122,44 @@
// RUN: %clang_cc1 -ffreestanding -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix FREESTANDING %s
// FREESTANDING:#define __STDC_HOSTED__ 0
//
-// RUN: %clang_cc1 -x c++ -std=gnu++2a -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix GXX2A %s
+// RUN: %clang_cc1 -x c++ -fgnuc-version=4.2.1 -std=gnu++20 -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix GXX2A %s
+// RUN: %clang_cc1 -x c++ -fgnuc-version=4.2.1 -std=gnu++2a -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix GXX2A %s
//
-// GXX2A:#define __GNUG__ {{.*}}
+// GXX2A:#define __GNUG__ 4
// GXX2A:#define __GXX_WEAK__ 1
-// GXX2A:#define __cplusplus 201707L
+// GXX2A:#define __cplusplus 202002L
// GXX2A:#define __private_extern__ extern
//
//
-// RUN: %clang_cc1 -x c++ -std=gnu++1z -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix GXX1Z %s
+// RUN: %clang_cc1 -x c++ -fgnuc-version=4.2.1 -std=gnu++17 -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix GXX1Z %s
+// RUN: %clang_cc1 -x c++ -fgnuc-version=4.2.1 -std=gnu++1z -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix GXX1Z %s
//
-// GXX1Z:#define __GNUG__ {{.*}}
+// GXX1Z:#define __GNUG__ 4
// GXX1Z:#define __GXX_WEAK__ 1
// GXX1Z:#define __cplusplus 201703L
// GXX1Z:#define __private_extern__ extern
//
//
-// RUN: %clang_cc1 -x c++ -std=gnu++1y -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix GXX1Y %s
+// RUN: %clang_cc1 -x c++ -fgnuc-version=4.2.1 -std=gnu++14 -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix GXX1Y %s
+// RUN: %clang_cc1 -x c++ -fgnuc-version=4.2.1 -std=gnu++1y -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix GXX1Y %s
//
-// GXX1Y:#define __GNUG__ {{.*}}
+// GXX1Y:#define __GNUG__ 4
// GXX1Y:#define __GXX_WEAK__ 1
// GXX1Y:#define __cplusplus 201402L
// GXX1Y:#define __private_extern__ extern
//
//
-// RUN: %clang_cc1 -x c++ -std=gnu++11 -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix GXX11 %s
+// RUN: %clang_cc1 -x c++ -fgnuc-version=4.2.1 -std=gnu++11 -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix GXX11 %s
//
-// GXX11:#define __GNUG__ {{.*}}
+// GXX11:#define __GNUG__ 4
// GXX11:#define __GXX_WEAK__ 1
// GXX11:#define __cplusplus 201103L
// GXX11:#define __private_extern__ extern
//
//
-// RUN: %clang_cc1 -x c++ -std=gnu++98 -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix GXX98 %s
+// RUN: %clang_cc1 -x c++ -fgnuc-version=4.2.1 -std=gnu++98 -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix GXX98 %s
//
-// GXX98:#define __GNUG__ {{.*}}
+// GXX98:#define __GNUG__ 4
// GXX98:#define __GXX_WEAK__ 1
// GXX98:#define __cplusplus 199711L
// GXX98:#define __private_extern__ extern
@@ -2845,9 +2851,9 @@
// I386:#define __i386__ 1
// I386:#define i386 1
//
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=i386-pc-linux-gnu -target-cpu pentium4 < /dev/null | FileCheck -match-full-lines -check-prefix I386-LINUX -check-prefix I386-LINUX-ALIGN32 %s
-// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -triple=i386-pc-linux-gnu -target-cpu pentium4 < /dev/null | FileCheck -match-full-lines -check-prefix I386-LINUX -check-prefix I386-LINUX-CXX -check-prefix I386-LINUX-ALIGN32 %s
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=i386-pc-linux-gnu -target-cpu pentium4 -malign-double < /dev/null | FileCheck -match-full-lines -check-prefix I386-LINUX -check-prefix I386-LINUX-ALIGN64 %s
+// RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=i386-pc-linux-gnu -target-cpu pentium4 < /dev/null | FileCheck -match-full-lines -check-prefix I386-LINUX -check-prefix I386-LINUX-ALIGN32 %s
+// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=i386-pc-linux-gnu -target-cpu pentium4 < /dev/null | FileCheck -match-full-lines -check-prefix I386-LINUX -check-prefix I386-LINUX-CXX -check-prefix I386-LINUX-ALIGN32 %s
+// RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=i386-pc-linux-gnu -target-cpu pentium4 -malign-double < /dev/null | FileCheck -match-full-lines -check-prefix I386-LINUX -check-prefix I386-LINUX-ALIGN64 %s
//
// I386-LINUX-NOT:#define _LP64
// I386-LINUX:#define __BIGGEST_ALIGNMENT__ 16
@@ -3047,9 +3053,9 @@
// I386-LINUX:#define __i386__ 1
// I386-LINUX:#define i386 1
//
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=i386-netbsd -target-cpu i486 < /dev/null | FileCheck -match-full-lines -check-prefix I386-NETBSD %s
-// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -triple=i386-netbsd -target-cpu i486 < /dev/null | FileCheck -match-full-lines -check-prefix I386-NETBSD -check-prefix I386-NETBSD-CXX %s
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=i386-netbsd -target-cpu i486 -malign-double < /dev/null | FileCheck -match-full-lines -check-prefix I386-NETBSD %s
+// RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=i386-netbsd -target-cpu i486 < /dev/null | FileCheck -match-full-lines -check-prefix I386-NETBSD %s
+// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=i386-netbsd -target-cpu i486 < /dev/null | FileCheck -match-full-lines -check-prefix I386-NETBSD -check-prefix I386-NETBSD-CXX %s
+// RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=i386-netbsd -target-cpu i486 -malign-double < /dev/null | FileCheck -match-full-lines -check-prefix I386-NETBSD %s
//
//
// I386-NETBSD-NOT:#define _LP64
@@ -3263,8 +3269,8 @@
// I386-DECLSPEC: #define __declspec{{.*}}
//
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=mips-none-none < /dev/null | FileCheck -match-full-lines -check-prefix MIPS32BE -check-prefix MIPS32BE-C %s
-// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -triple=mips-none-none < /dev/null | FileCheck -match-full-lines -check-prefix MIPS32BE -check-prefix MIPS32BE-CXX %s
+// RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=mips-none-none < /dev/null | FileCheck -match-full-lines -check-prefix MIPS32BE -check-prefix MIPS32BE-C %s
+// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=mips-none-none < /dev/null | FileCheck -match-full-lines -check-prefix MIPS32BE -check-prefix MIPS32BE-CXX %s
//
// MIPS32BE:#define MIPSEB 1
// MIPS32BE:#define _ABIO32 1
@@ -3682,10 +3688,10 @@
// MIPS32EL:#define _mips 1
// MIPS32EL:#define mips 1
//
-// RUN: %clang_cc1 -E -dM -ffreestanding \
+// RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 \
// RUN: -triple=mips64-none-none -target-abi n32 < /dev/null \
// RUN: | FileCheck -match-full-lines -check-prefix MIPSN32BE -check-prefix MIPSN32BE-C %s
-// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding \
+// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -fgnuc-version=4.2.1 \
// RUN: -triple=mips64-none-none -target-abi n32 < /dev/null \
// RUN: | FileCheck -match-full-lines -check-prefix MIPSN32BE -check-prefix MIPSN32BE-CXX %s
//
@@ -3993,7 +3999,7 @@
// MIPSN32BE: #define _mips 1
// MIPSN32BE: #define mips 1
//
-// RUN: %clang_cc1 -E -dM -ffreestanding \
+// RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 \
// RUN: -triple=mips64el-none-none -target-abi n32 < /dev/null \
// RUN: | FileCheck -match-full-lines -check-prefix MIPSN32EL %s
//
@@ -4300,8 +4306,8 @@
// MIPSN32EL: #define _mips 1
// MIPSN32EL: #define mips 1
//
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=mips64-none-none < /dev/null | FileCheck -match-full-lines -check-prefix MIPS64BE %s
-// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -triple=mips64-none-none < /dev/null | FileCheck -match-full-lines -check-prefix MIPS64BE -check-prefix MIPS64BE-CXX %s
+// RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=mips64-none-none < /dev/null | FileCheck -match-full-lines -check-prefix MIPS64BE %s
+// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=mips64-none-none < /dev/null | FileCheck -match-full-lines -check-prefix MIPS64BE -check-prefix MIPS64BE-CXX %s
//
// MIPS64BE:#define MIPSEB 1
// MIPS64BE:#define _ABI64 3
@@ -4832,6 +4838,26 @@
// MIPS-ARCH-64R6:#define _MIPS_ISA _MIPS_ISA_MIPS64
// MIPS-ARCH-64R6:#define __mips_isa_rev 6
//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=mips64-none-none \
+// RUN: -target-cpu octeon < /dev/null \
+// RUN: | FileCheck -match-full-lines -check-prefix MIPS-ARCH-OCTEON %s
+//
+// MIPS-ARCH-OCTEON:#define _MIPS_ARCH "octeon"
+// MIPS-ARCH-OCTEON:#define _MIPS_ARCH_OCTEON 1
+// MIPS-ARCH-OCTEON:#define _MIPS_ISA _MIPS_ISA_MIPS64
+// MIPS-ARCH-OCTEON:#define __OCTEON__ 1
+// MIPS-ARCH-OCTEON:#define __mips_isa_rev 2
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=mips64-none-none \
+// RUN: -target-cpu octeon+ < /dev/null \
+// RUN: | FileCheck -match-full-lines -check-prefix MIPS-ARCH-OCTEONP %s
+//
+// MIPS-ARCH-OCTEONP:#define _MIPS_ARCH "octeon+"
+// MIPS-ARCH-OCTEONP:#define _MIPS_ARCH_OCTEONP 1
+// MIPS-ARCH-OCTEONP:#define _MIPS_ISA _MIPS_ISA_MIPS64
+// MIPS-ARCH-OCTEONP:#define __OCTEON__ 1
+// MIPS-ARCH-OCTEONP:#define __mips_isa_rev 2
+//
// Check MIPS float ABI macros
//
// RUN: %clang_cc1 -E -dM -ffreestanding \
@@ -5803,1056 +5829,6 @@
// PPC603E:#define __powerpc__ 1
// PPC603E:#define __ppc__ 1
//
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu pwr7 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPC64 %s
-// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu pwr7 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPC64 -check-prefix PPC64-CXX %s
-//
-// PPC64:#define _ARCH_PPC 1
-// PPC64:#define _ARCH_PPC64 1
-// PPC64:#define _ARCH_PPCGR 1
-// PPC64:#define _ARCH_PPCSQ 1
-// PPC64:#define _ARCH_PWR4 1
-// PPC64:#define _ARCH_PWR5 1
-// PPC64:#define _ARCH_PWR6 1
-// PPC64:#define _ARCH_PWR7 1
-// PPC64:#define _BIG_ENDIAN 1
-// PPC64:#define _LP64 1
-// PPC64:#define __BIGGEST_ALIGNMENT__ 16
-// PPC64:#define __BIG_ENDIAN__ 1
-// PPC64:#define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__
-// PPC64:#define __CHAR16_TYPE__ unsigned short
-// PPC64:#define __CHAR32_TYPE__ unsigned int
-// PPC64:#define __CHAR_BIT__ 8
-// PPC64:#define __CHAR_UNSIGNED__ 1
-// PPC64:#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
-// PPC64:#define __DBL_DIG__ 15
-// PPC64:#define __DBL_EPSILON__ 2.2204460492503131e-16
-// PPC64:#define __DBL_HAS_DENORM__ 1
-// PPC64:#define __DBL_HAS_INFINITY__ 1
-// PPC64:#define __DBL_HAS_QUIET_NAN__ 1
-// PPC64:#define __DBL_MANT_DIG__ 53
-// PPC64:#define __DBL_MAX_10_EXP__ 308
-// PPC64:#define __DBL_MAX_EXP__ 1024
-// PPC64:#define __DBL_MAX__ 1.7976931348623157e+308
-// PPC64:#define __DBL_MIN_10_EXP__ (-307)
-// PPC64:#define __DBL_MIN_EXP__ (-1021)
-// PPC64:#define __DBL_MIN__ 2.2250738585072014e-308
-// PPC64:#define __DECIMAL_DIG__ __LDBL_DECIMAL_DIG__
-// PPC64:#define __FLT_DENORM_MIN__ 1.40129846e-45F
-// PPC64:#define __FLT_DIG__ 6
-// PPC64:#define __FLT_EPSILON__ 1.19209290e-7F
-// PPC64:#define __FLT_EVAL_METHOD__ 0
-// PPC64:#define __FLT_HAS_DENORM__ 1
-// PPC64:#define __FLT_HAS_INFINITY__ 1
-// PPC64:#define __FLT_HAS_QUIET_NAN__ 1
-// PPC64:#define __FLT_MANT_DIG__ 24
-// PPC64:#define __FLT_MAX_10_EXP__ 38
-// PPC64:#define __FLT_MAX_EXP__ 128
-// PPC64:#define __FLT_MAX__ 3.40282347e+38F
-// PPC64:#define __FLT_MIN_10_EXP__ (-37)
-// PPC64:#define __FLT_MIN_EXP__ (-125)
-// PPC64:#define __FLT_MIN__ 1.17549435e-38F
-// PPC64:#define __FLT_RADIX__ 2
-// PPC64:#define __HAVE_BSWAP__ 1
-// PPC64:#define __INT16_C_SUFFIX__
-// PPC64:#define __INT16_FMTd__ "hd"
-// PPC64:#define __INT16_FMTi__ "hi"
-// PPC64:#define __INT16_MAX__ 32767
-// PPC64:#define __INT16_TYPE__ short
-// PPC64:#define __INT32_C_SUFFIX__
-// PPC64:#define __INT32_FMTd__ "d"
-// PPC64:#define __INT32_FMTi__ "i"
-// PPC64:#define __INT32_MAX__ 2147483647
-// PPC64:#define __INT32_TYPE__ int
-// PPC64:#define __INT64_C_SUFFIX__ L
-// PPC64:#define __INT64_FMTd__ "ld"
-// PPC64:#define __INT64_FMTi__ "li"
-// PPC64:#define __INT64_MAX__ 9223372036854775807L
-// PPC64:#define __INT64_TYPE__ long int
-// PPC64:#define __INT8_C_SUFFIX__
-// PPC64:#define __INT8_FMTd__ "hhd"
-// PPC64:#define __INT8_FMTi__ "hhi"
-// PPC64:#define __INT8_MAX__ 127
-// PPC64:#define __INT8_TYPE__ signed char
-// PPC64:#define __INTMAX_C_SUFFIX__ L
-// PPC64:#define __INTMAX_FMTd__ "ld"
-// PPC64:#define __INTMAX_FMTi__ "li"
-// PPC64:#define __INTMAX_MAX__ 9223372036854775807L
-// PPC64:#define __INTMAX_TYPE__ long int
-// PPC64:#define __INTMAX_WIDTH__ 64
-// PPC64:#define __INTPTR_FMTd__ "ld"
-// PPC64:#define __INTPTR_FMTi__ "li"
-// PPC64:#define __INTPTR_MAX__ 9223372036854775807L
-// PPC64:#define __INTPTR_TYPE__ long int
-// PPC64:#define __INTPTR_WIDTH__ 64
-// PPC64:#define __INT_FAST16_FMTd__ "hd"
-// PPC64:#define __INT_FAST16_FMTi__ "hi"
-// PPC64:#define __INT_FAST16_MAX__ 32767
-// PPC64:#define __INT_FAST16_TYPE__ short
-// PPC64:#define __INT_FAST32_FMTd__ "d"
-// PPC64:#define __INT_FAST32_FMTi__ "i"
-// PPC64:#define __INT_FAST32_MAX__ 2147483647
-// PPC64:#define __INT_FAST32_TYPE__ int
-// PPC64:#define __INT_FAST64_FMTd__ "ld"
-// PPC64:#define __INT_FAST64_FMTi__ "li"
-// PPC64:#define __INT_FAST64_MAX__ 9223372036854775807L
-// PPC64:#define __INT_FAST64_TYPE__ long int
-// PPC64:#define __INT_FAST8_FMTd__ "hhd"
-// PPC64:#define __INT_FAST8_FMTi__ "hhi"
-// PPC64:#define __INT_FAST8_MAX__ 127
-// PPC64:#define __INT_FAST8_TYPE__ signed char
-// PPC64:#define __INT_LEAST16_FMTd__ "hd"
-// PPC64:#define __INT_LEAST16_FMTi__ "hi"
-// PPC64:#define __INT_LEAST16_MAX__ 32767
-// PPC64:#define __INT_LEAST16_TYPE__ short
-// PPC64:#define __INT_LEAST32_FMTd__ "d"
-// PPC64:#define __INT_LEAST32_FMTi__ "i"
-// PPC64:#define __INT_LEAST32_MAX__ 2147483647
-// PPC64:#define __INT_LEAST32_TYPE__ int
-// PPC64:#define __INT_LEAST64_FMTd__ "ld"
-// PPC64:#define __INT_LEAST64_FMTi__ "li"
-// PPC64:#define __INT_LEAST64_MAX__ 9223372036854775807L
-// PPC64:#define __INT_LEAST64_TYPE__ long int
-// PPC64:#define __INT_LEAST8_FMTd__ "hhd"
-// PPC64:#define __INT_LEAST8_FMTi__ "hhi"
-// PPC64:#define __INT_LEAST8_MAX__ 127
-// PPC64:#define __INT_LEAST8_TYPE__ signed char
-// PPC64:#define __INT_MAX__ 2147483647
-// PPC64:#define __LDBL_DENORM_MIN__ 4.94065645841246544176568792868221e-324L
-// PPC64:#define __LDBL_DIG__ 31
-// PPC64:#define __LDBL_EPSILON__ 4.94065645841246544176568792868221e-324L
-// PPC64:#define __LDBL_HAS_DENORM__ 1
-// PPC64:#define __LDBL_HAS_INFINITY__ 1
-// PPC64:#define __LDBL_HAS_QUIET_NAN__ 1
-// PPC64:#define __LDBL_MANT_DIG__ 106
-// PPC64:#define __LDBL_MAX_10_EXP__ 308
-// PPC64:#define __LDBL_MAX_EXP__ 1024
-// PPC64:#define __LDBL_MAX__ 1.79769313486231580793728971405301e+308L
-// PPC64:#define __LDBL_MIN_10_EXP__ (-291)
-// PPC64:#define __LDBL_MIN_EXP__ (-968)
-// PPC64:#define __LDBL_MIN__ 2.00416836000897277799610805135016e-292L
-// PPC64:#define __LONGDOUBLE128 1
-// PPC64:#define __LONG_DOUBLE_128__ 1
-// PPC64:#define __LONG_LONG_MAX__ 9223372036854775807LL
-// PPC64:#define __LONG_MAX__ 9223372036854775807L
-// PPC64:#define __LP64__ 1
-// 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__
-// PPC64:#define __SCHAR_MAX__ 127
-// PPC64:#define __SHRT_MAX__ 32767
-// PPC64:#define __SIG_ATOMIC_MAX__ 2147483647
-// PPC64:#define __SIG_ATOMIC_WIDTH__ 32
-// PPC64:#define __SIZEOF_DOUBLE__ 8
-// PPC64:#define __SIZEOF_FLOAT__ 4
-// PPC64:#define __SIZEOF_INT__ 4
-// PPC64:#define __SIZEOF_LONG_DOUBLE__ 16
-// PPC64:#define __SIZEOF_LONG_LONG__ 8
-// PPC64:#define __SIZEOF_LONG__ 8
-// PPC64:#define __SIZEOF_POINTER__ 8
-// PPC64:#define __SIZEOF_PTRDIFF_T__ 8
-// PPC64:#define __SIZEOF_SHORT__ 2
-// PPC64:#define __SIZEOF_SIZE_T__ 8
-// PPC64:#define __SIZEOF_WCHAR_T__ 4
-// PPC64:#define __SIZEOF_WINT_T__ 4
-// PPC64:#define __SIZE_MAX__ 18446744073709551615UL
-// PPC64:#define __SIZE_TYPE__ long unsigned int
-// PPC64:#define __SIZE_WIDTH__ 64
-// PPC64-CXX:#define __STDCPP_DEFAULT_NEW_ALIGNMENT__ 16UL
-// PPC64:#define __UINT16_C_SUFFIX__
-// PPC64:#define __UINT16_MAX__ 65535
-// PPC64:#define __UINT16_TYPE__ unsigned short
-// PPC64:#define __UINT32_C_SUFFIX__ U
-// PPC64:#define __UINT32_MAX__ 4294967295U
-// PPC64:#define __UINT32_TYPE__ unsigned int
-// PPC64:#define __UINT64_C_SUFFIX__ UL
-// PPC64:#define __UINT64_MAX__ 18446744073709551615UL
-// PPC64:#define __UINT64_TYPE__ long unsigned int
-// PPC64:#define __UINT8_C_SUFFIX__
-// PPC64:#define __UINT8_MAX__ 255
-// PPC64:#define __UINT8_TYPE__ unsigned char
-// PPC64:#define __UINTMAX_C_SUFFIX__ UL
-// PPC64:#define __UINTMAX_MAX__ 18446744073709551615UL
-// PPC64:#define __UINTMAX_TYPE__ long unsigned int
-// PPC64:#define __UINTMAX_WIDTH__ 64
-// PPC64:#define __UINTPTR_MAX__ 18446744073709551615UL
-// PPC64:#define __UINTPTR_TYPE__ long unsigned int
-// PPC64:#define __UINTPTR_WIDTH__ 64
-// PPC64:#define __UINT_FAST16_MAX__ 65535
-// PPC64:#define __UINT_FAST16_TYPE__ unsigned short
-// PPC64:#define __UINT_FAST32_MAX__ 4294967295U
-// PPC64:#define __UINT_FAST32_TYPE__ unsigned int
-// PPC64:#define __UINT_FAST64_MAX__ 18446744073709551615UL
-// PPC64:#define __UINT_FAST64_TYPE__ long unsigned int
-// PPC64:#define __UINT_FAST8_MAX__ 255
-// PPC64:#define __UINT_FAST8_TYPE__ unsigned char
-// PPC64:#define __UINT_LEAST16_MAX__ 65535
-// PPC64:#define __UINT_LEAST16_TYPE__ unsigned short
-// PPC64:#define __UINT_LEAST32_MAX__ 4294967295U
-// PPC64:#define __UINT_LEAST32_TYPE__ unsigned int
-// PPC64:#define __UINT_LEAST64_MAX__ 18446744073709551615UL
-// PPC64:#define __UINT_LEAST64_TYPE__ long unsigned int
-// PPC64:#define __UINT_LEAST8_MAX__ 255
-// PPC64:#define __UINT_LEAST8_TYPE__ unsigned char
-// PPC64:#define __USER_LABEL_PREFIX__
-// PPC64:#define __WCHAR_MAX__ 2147483647
-// PPC64:#define __WCHAR_TYPE__ int
-// PPC64:#define __WCHAR_WIDTH__ 32
-// PPC64:#define __WINT_TYPE__ int
-// PPC64:#define __WINT_WIDTH__ 32
-// 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 -match-full-lines -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-NOT:#define _ARCH_PWR6X 1
-// PPC64LE:#define _ARCH_PWR7 1
-// PPC64LE:#define _CALL_ELF 2
-// PPC64LE:#define _LITTLE_ENDIAN 1
-// PPC64LE:#define _LP64 1
-// PPC64LE:#define __BIGGEST_ALIGNMENT__ 16
-// 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__ __LDBL_DECIMAL_DIG__
-// 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 __HAVE_BSWAP__ 1
-// PPC64LE:#define __INT16_C_SUFFIX__
-// PPC64LE:#define __INT16_FMTd__ "hd"
-// PPC64LE:#define __INT16_FMTi__ "hi"
-// PPC64LE:#define __INT16_MAX__ 32767
-// PPC64LE:#define __INT16_TYPE__ short
-// PPC64LE:#define __INT32_C_SUFFIX__
-// PPC64LE:#define __INT32_FMTd__ "d"
-// PPC64LE:#define __INT32_FMTi__ "i"
-// PPC64LE:#define __INT32_MAX__ 2147483647
-// PPC64LE:#define __INT32_TYPE__ int
-// PPC64LE:#define __INT64_C_SUFFIX__ L
-// PPC64LE:#define __INT64_FMTd__ "ld"
-// PPC64LE:#define __INT64_FMTi__ "li"
-// PPC64LE:#define __INT64_MAX__ 9223372036854775807L
-// PPC64LE:#define __INT64_TYPE__ long int
-// PPC64LE:#define __INT8_C_SUFFIX__
-// PPC64LE:#define __INT8_FMTd__ "hhd"
-// PPC64LE:#define __INT8_FMTi__ "hhi"
-// PPC64LE:#define __INT8_MAX__ 127
-// PPC64LE:#define __INT8_TYPE__ signed char
-// PPC64LE:#define __INTMAX_C_SUFFIX__ L
-// PPC64LE:#define __INTMAX_FMTd__ "ld"
-// PPC64LE:#define __INTMAX_FMTi__ "li"
-// PPC64LE:#define __INTMAX_MAX__ 9223372036854775807L
-// PPC64LE:#define __INTMAX_TYPE__ long int
-// PPC64LE:#define __INTMAX_WIDTH__ 64
-// PPC64LE:#define __INTPTR_FMTd__ "ld"
-// PPC64LE:#define __INTPTR_FMTi__ "li"
-// PPC64LE:#define __INTPTR_MAX__ 9223372036854775807L
-// PPC64LE:#define __INTPTR_TYPE__ long int
-// PPC64LE:#define __INTPTR_WIDTH__ 64
-// PPC64LE:#define __INT_FAST16_FMTd__ "hd"
-// PPC64LE:#define __INT_FAST16_FMTi__ "hi"
-// PPC64LE:#define __INT_FAST16_MAX__ 32767
-// PPC64LE:#define __INT_FAST16_TYPE__ short
-// PPC64LE:#define __INT_FAST32_FMTd__ "d"
-// PPC64LE:#define __INT_FAST32_FMTi__ "i"
-// PPC64LE:#define __INT_FAST32_MAX__ 2147483647
-// PPC64LE:#define __INT_FAST32_TYPE__ int
-// PPC64LE:#define __INT_FAST64_FMTd__ "ld"
-// PPC64LE:#define __INT_FAST64_FMTi__ "li"
-// PPC64LE:#define __INT_FAST64_MAX__ 9223372036854775807L
-// PPC64LE:#define __INT_FAST64_TYPE__ long int
-// PPC64LE:#define __INT_FAST8_FMTd__ "hhd"
-// PPC64LE:#define __INT_FAST8_FMTi__ "hhi"
-// PPC64LE:#define __INT_FAST8_MAX__ 127
-// PPC64LE:#define __INT_FAST8_TYPE__ signed char
-// PPC64LE:#define __INT_LEAST16_FMTd__ "hd"
-// PPC64LE:#define __INT_LEAST16_FMTi__ "hi"
-// PPC64LE:#define __INT_LEAST16_MAX__ 32767
-// PPC64LE:#define __INT_LEAST16_TYPE__ short
-// PPC64LE:#define __INT_LEAST32_FMTd__ "d"
-// PPC64LE:#define __INT_LEAST32_FMTi__ "i"
-// PPC64LE:#define __INT_LEAST32_MAX__ 2147483647
-// PPC64LE:#define __INT_LEAST32_TYPE__ int
-// PPC64LE:#define __INT_LEAST64_FMTd__ "ld"
-// PPC64LE:#define __INT_LEAST64_FMTi__ "li"
-// PPC64LE:#define __INT_LEAST64_MAX__ 9223372036854775807L
-// PPC64LE:#define __INT_LEAST64_TYPE__ long int
-// PPC64LE:#define __INT_LEAST8_FMTd__ "hhd"
-// PPC64LE:#define __INT_LEAST8_FMTi__ "hhi"
-// PPC64LE:#define __INT_LEAST8_MAX__ 127
-// PPC64LE:#define __INT_LEAST8_TYPE__ signed char
-// 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 __LONGDOUBLE128 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_MAX__ 2147483647
-// 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 __STRUCT_PARM_ALIGN__ 16
-// PPC64LE:#define __UINT16_C_SUFFIX__
-// PPC64LE:#define __UINT16_MAX__ 65535
-// PPC64LE:#define __UINT16_TYPE__ unsigned short
-// PPC64LE:#define __UINT32_C_SUFFIX__ U
-// PPC64LE:#define __UINT32_MAX__ 4294967295U
-// PPC64LE:#define __UINT32_TYPE__ unsigned int
-// PPC64LE:#define __UINT64_C_SUFFIX__ UL
-// PPC64LE:#define __UINT64_MAX__ 18446744073709551615UL
-// PPC64LE:#define __UINT64_TYPE__ long unsigned int
-// PPC64LE:#define __UINT8_C_SUFFIX__
-// PPC64LE:#define __UINT8_MAX__ 255
-// PPC64LE:#define __UINT8_TYPE__ unsigned char
-// PPC64LE:#define __UINTMAX_C_SUFFIX__ UL
-// PPC64LE:#define __UINTMAX_MAX__ 18446744073709551615UL
-// PPC64LE:#define __UINTMAX_TYPE__ long unsigned int
-// PPC64LE:#define __UINTMAX_WIDTH__ 64
-// PPC64LE:#define __UINTPTR_MAX__ 18446744073709551615UL
-// PPC64LE:#define __UINTPTR_TYPE__ long unsigned int
-// PPC64LE:#define __UINTPTR_WIDTH__ 64
-// PPC64LE:#define __UINT_FAST16_MAX__ 65535
-// PPC64LE:#define __UINT_FAST16_TYPE__ unsigned short
-// PPC64LE:#define __UINT_FAST32_MAX__ 4294967295U
-// PPC64LE:#define __UINT_FAST32_TYPE__ unsigned int
-// PPC64LE:#define __UINT_FAST64_MAX__ 18446744073709551615UL
-// PPC64LE:#define __UINT_FAST64_TYPE__ long unsigned int
-// PPC64LE:#define __UINT_FAST8_MAX__ 255
-// PPC64LE:#define __UINT_FAST8_TYPE__ unsigned char
-// PPC64LE:#define __UINT_LEAST16_MAX__ 65535
-// PPC64LE:#define __UINT_LEAST16_TYPE__ unsigned short
-// PPC64LE:#define __UINT_LEAST32_MAX__ 4294967295U
-// PPC64LE:#define __UINT_LEAST32_TYPE__ unsigned int
-// PPC64LE:#define __UINT_LEAST64_MAX__ 18446744073709551615UL
-// PPC64LE:#define __UINT_LEAST64_TYPE__ long unsigned int
-// PPC64LE:#define __UINT_LEAST8_MAX__ 255
-// PPC64LE:#define __UINT_LEAST8_TYPE__ unsigned char
-// 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 -match-full-lines -check-prefix PPCA2Q %s
-//
-// PPCA2Q:#define _ARCH_A2 1
-// PPCA2Q:#define _ARCH_A2Q 1
-// PPCA2Q:#define _ARCH_PPC 1
-// PPCA2Q:#define _ARCH_PPC64 1
-// PPCA2Q:#define _ARCH_QP 1
-//
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-bgq-linux -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCBGQ %s
-//
-// PPCBGQ:#define __THW_BLUEGENE__ 1
-// PPCBGQ:#define __TOS_BGQ__ 1
-// PPCBGQ:#define __bg__ 1
-// PPCBGQ:#define __bgq__ 1
-//
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu 630 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPC630 %s
-//
-// PPC630:#define _ARCH_630 1
-// PPC630:#define _ARCH_PPC 1
-// PPC630:#define _ARCH_PPC64 1
-// PPC630:#define _ARCH_PPCGR 1
-//
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu pwr3 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCPWR3 %s
-//
-// PPCPWR3:#define _ARCH_PPC 1
-// PPCPWR3:#define _ARCH_PPC64 1
-// PPCPWR3:#define _ARCH_PPCGR 1
-//
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu power3 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCPOWER3 %s
-//
-// PPCPOWER3:#define _ARCH_PPC 1
-// PPCPOWER3:#define _ARCH_PPC64 1
-// PPCPOWER3:#define _ARCH_PPCGR 1
-//
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu pwr4 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCPWR4 %s
-//
-// PPCPWR4:#define _ARCH_PPC 1
-// PPCPWR4:#define _ARCH_PPC64 1
-// PPCPWR4:#define _ARCH_PPCGR 1
-// PPCPWR4:#define _ARCH_PPCSQ 1
-// PPCPWR4:#define _ARCH_PWR4 1
-//
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu power4 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCPOWER4 %s
-//
-// PPCPOWER4:#define _ARCH_PPC 1
-// PPCPOWER4:#define _ARCH_PPC64 1
-// PPCPOWER4:#define _ARCH_PPCGR 1
-// PPCPOWER4:#define _ARCH_PPCSQ 1
-// PPCPOWER4:#define _ARCH_PWR4 1
-//
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu pwr5 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCPWR5 %s
-//
-// PPCPWR5:#define _ARCH_PPC 1
-// PPCPWR5:#define _ARCH_PPC64 1
-// PPCPWR5:#define _ARCH_PPCGR 1
-// PPCPWR5:#define _ARCH_PPCSQ 1
-// PPCPWR5:#define _ARCH_PWR4 1
-// PPCPWR5:#define _ARCH_PWR5 1
-//
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu power5 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCPOWER5 %s
-//
-// PPCPOWER5:#define _ARCH_PPC 1
-// PPCPOWER5:#define _ARCH_PPC64 1
-// PPCPOWER5:#define _ARCH_PPCGR 1
-// PPCPOWER5:#define _ARCH_PPCSQ 1
-// PPCPOWER5:#define _ARCH_PWR4 1
-// PPCPOWER5:#define _ARCH_PWR5 1
-//
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu pwr5x -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCPWR5X %s
-//
-// PPCPWR5X:#define _ARCH_PPC 1
-// PPCPWR5X:#define _ARCH_PPC64 1
-// PPCPWR5X:#define _ARCH_PPCGR 1
-// PPCPWR5X:#define _ARCH_PPCSQ 1
-// PPCPWR5X:#define _ARCH_PWR4 1
-// PPCPWR5X:#define _ARCH_PWR5 1
-// PPCPWR5X:#define _ARCH_PWR5X 1
-//
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu power5x -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCPOWER5X %s
-//
-// PPCPOWER5X:#define _ARCH_PPC 1
-// PPCPOWER5X:#define _ARCH_PPC64 1
-// PPCPOWER5X:#define _ARCH_PPCGR 1
-// PPCPOWER5X:#define _ARCH_PPCSQ 1
-// PPCPOWER5X:#define _ARCH_PWR4 1
-// PPCPOWER5X:#define _ARCH_PWR5 1
-// PPCPOWER5X:#define _ARCH_PWR5X 1
-//
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu pwr6 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCPWR6 %s
-//
-// PPCPWR6:#define _ARCH_PPC 1
-// PPCPWR6:#define _ARCH_PPC64 1
-// PPCPWR6:#define _ARCH_PPCGR 1
-// PPCPWR6:#define _ARCH_PPCSQ 1
-// PPCPWR6:#define _ARCH_PWR4 1
-// PPCPWR6:#define _ARCH_PWR5 1
-// PPCPWR6:#define _ARCH_PWR5X 1
-// PPCPWR6:#define _ARCH_PWR6 1
-//
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu power6 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCPOWER6 %s
-//
-// PPCPOWER6:#define _ARCH_PPC 1
-// PPCPOWER6:#define _ARCH_PPC64 1
-// PPCPOWER6:#define _ARCH_PPCGR 1
-// PPCPOWER6:#define _ARCH_PPCSQ 1
-// PPCPOWER6:#define _ARCH_PWR4 1
-// PPCPOWER6:#define _ARCH_PWR5 1
-// PPCPOWER6:#define _ARCH_PWR5X 1
-// PPCPOWER6:#define _ARCH_PWR6 1
-//
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu pwr6x -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCPWR6X %s
-//
-// PPCPWR6X:#define _ARCH_PPC 1
-// PPCPWR6X:#define _ARCH_PPC64 1
-// PPCPWR6X:#define _ARCH_PPCGR 1
-// PPCPWR6X:#define _ARCH_PPCSQ 1
-// PPCPWR6X:#define _ARCH_PWR4 1
-// PPCPWR6X:#define _ARCH_PWR5 1
-// PPCPWR6X:#define _ARCH_PWR5X 1
-// PPCPWR6X:#define _ARCH_PWR6 1
-// PPCPWR6X:#define _ARCH_PWR6X 1
-//
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu power6x -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCPOWER6X %s
-//
-// PPCPOWER6X:#define _ARCH_PPC 1
-// PPCPOWER6X:#define _ARCH_PPC64 1
-// PPCPOWER6X:#define _ARCH_PPCGR 1
-// PPCPOWER6X:#define _ARCH_PPCSQ 1
-// PPCPOWER6X:#define _ARCH_PWR4 1
-// PPCPOWER6X:#define _ARCH_PWR5 1
-// PPCPOWER6X:#define _ARCH_PWR5X 1
-// PPCPOWER6X:#define _ARCH_PWR6 1
-// PPCPOWER6X:#define _ARCH_PWR6X 1
-//
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu pwr7 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCPWR7 %s
-//
-// PPCPWR7:#define _ARCH_PPC 1
-// PPCPWR7:#define _ARCH_PPC64 1
-// PPCPWR7:#define _ARCH_PPCGR 1
-// PPCPWR7:#define _ARCH_PPCSQ 1
-// PPCPWR7:#define _ARCH_PWR4 1
-// PPCPWR7:#define _ARCH_PWR5 1
-// PPCPWR7:#define _ARCH_PWR5X 1
-// PPCPWR7:#define _ARCH_PWR6 1
-// PPCPWR7-NOT:#define _ARCH_PWR6X 1
-// PPCPWR7:#define _ARCH_PWR7 1
-//
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu power7 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCPOWER7 %s
-//
-// PPCPOWER7:#define _ARCH_PPC 1
-// PPCPOWER7:#define _ARCH_PPC64 1
-// PPCPOWER7:#define _ARCH_PPCGR 1
-// PPCPOWER7:#define _ARCH_PPCSQ 1
-// PPCPOWER7:#define _ARCH_PWR4 1
-// PPCPOWER7:#define _ARCH_PWR5 1
-// PPCPOWER7:#define _ARCH_PWR5X 1
-// PPCPOWER7:#define _ARCH_PWR6 1
-// PPCPOWER7-NOT:#define _ARCH_PWR6X 1
-// PPCPOWER7:#define _ARCH_PWR7 1
-//
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu pwr8 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCPWR8 %s
-//
-// PPCPWR8:#define _ARCH_PPC 1
-// PPCPWR8:#define _ARCH_PPC64 1
-// PPCPWR8:#define _ARCH_PPCGR 1
-// PPCPWR8:#define _ARCH_PPCSQ 1
-// PPCPWR8:#define _ARCH_PWR4 1
-// PPCPWR8:#define _ARCH_PWR5 1
-// PPCPWR8:#define _ARCH_PWR5X 1
-// PPCPWR8:#define _ARCH_PWR6 1
-// PPCPWR8-NOT:#define _ARCH_PWR6X 1
-// PPCPWR8:#define _ARCH_PWR7 1
-// PPCPWR8:#define _ARCH_PWR8 1
-//
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu power8 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCPOWER8 %s
-//
-// ppc64le also defaults to power8.
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64le-none-none -target-cpu ppc64le -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCPOWER8 %s
-//
-// PPCPOWER8:#define _ARCH_PPC 1
-// PPCPOWER8:#define _ARCH_PPC64 1
-// PPCPOWER8:#define _ARCH_PPCGR 1
-// PPCPOWER8:#define _ARCH_PPCSQ 1
-// PPCPOWER8:#define _ARCH_PWR4 1
-// PPCPOWER8:#define _ARCH_PWR5 1
-// PPCPOWER8:#define _ARCH_PWR5X 1
-// PPCPOWER8:#define _ARCH_PWR6 1
-// PPCPOWER8-NOT:#define _ARCH_PWR6X 1
-// PPCPOWER8:#define _ARCH_PWR7 1
-// PPCPOWER8:#define _ARCH_PWR8 1
-//
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu pwr9 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCPWR9 %s
-//
-// PPCPWR9:#define _ARCH_PPC 1
-// PPCPWR9:#define _ARCH_PPC64 1
-// PPCPWR9:#define _ARCH_PPCGR 1
-// PPCPWR9:#define _ARCH_PPCSQ 1
-// PPCPWR9:#define _ARCH_PWR4 1
-// PPCPWR9:#define _ARCH_PWR5 1
-// PPCPWR9:#define _ARCH_PWR5X 1
-// PPCPWR9:#define _ARCH_PWR6 1
-// PPCPWR9-NOT:#define _ARCH_PWR6X 1
-// PPCPWR9:#define _ARCH_PWR7 1
-// PPCPWR9:#define _ARCH_PWR9 1
-//
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu power9 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCPOWER9 %s
-//
-// PPCPOWER9:#define _ARCH_PPC 1
-// PPCPOWER9:#define _ARCH_PPC64 1
-// PPCPOWER9:#define _ARCH_PPCGR 1
-// PPCPOWER9:#define _ARCH_PPCSQ 1
-// PPCPOWER9:#define _ARCH_PWR4 1
-// PPCPOWER9:#define _ARCH_PWR5 1
-// PPCPOWER9:#define _ARCH_PWR5X 1
-// PPCPOWER9:#define _ARCH_PWR6 1
-// PPCPOWER9-NOT:#define _ARCH_PWR6X 1
-// PPCPOWER9:#define _ARCH_PWR7 1
-// PPCPOWER9:#define _ARCH_PWR9 1
-//
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-feature +float128 -target-cpu power9 -fno-signed-char < /dev/null | FileCheck -check-prefix PPC-FLOAT128 %s
-// PPC-FLOAT128:#define __FLOAT128__ 1
-//
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-ibm-aix7.1.0.0 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPC64-AIX %s
-//
-// PPC64-AIX:#define _AIX 1
-// PPC64-AIX:#define _ARCH_PPC 1
-// PPC64-AIX:#define _ARCH_PPC64 1
-// PPC64-AIX:#define _BIG_ENDIAN 1
-// PPC64-AIX:#define _IBMR2 1
-// PPC64-AIX-NOT:#define _ILP32 1
-// PPC64-AIX:#define _LONG_LONG 1
-// PPC64-AIX:#define _LP64 1
-// PPC64-AIX:#define _POWER 1
-// PPC64-AIX:#define __64BIT__ 1
-// PPC64-AIX:#define __BIGGEST_ALIGNMENT__ 8
-// PPC64-AIX:#define __BIG_ENDIAN__ 1
-// PPC64-AIX:#define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__
-// PPC64-AIX:#define __CHAR16_TYPE__ unsigned short
-// PPC64-AIX:#define __CHAR32_TYPE__ unsigned int
-// PPC64-AIX:#define __CHAR_BIT__ 8
-// PPC64-AIX:#define __CHAR_UNSIGNED__ 1
-// PPC64-AIX:#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
-// PPC64-AIX:#define __DBL_DIG__ 15
-// PPC64-AIX:#define __DBL_EPSILON__ 2.2204460492503131e-16
-// PPC64-AIX:#define __DBL_HAS_DENORM__ 1
-// PPC64-AIX:#define __DBL_HAS_INFINITY__ 1
-// PPC64-AIX:#define __DBL_HAS_QUIET_NAN__ 1
-// PPC64-AIX:#define __DBL_MANT_DIG__ 53
-// PPC64-AIX:#define __DBL_MAX_10_EXP__ 308
-// PPC64-AIX:#define __DBL_MAX_EXP__ 1024
-// PPC64-AIX:#define __DBL_MAX__ 1.7976931348623157e+308
-// PPC64-AIX:#define __DBL_MIN_10_EXP__ (-307)
-// PPC64-AIX:#define __DBL_MIN_EXP__ (-1021)
-// PPC64-AIX:#define __DBL_MIN__ 2.2250738585072014e-308
-// PPC64-AIX:#define __DECIMAL_DIG__ __LDBL_DECIMAL_DIG__
-// PPC64-AIX:#define __FLT_DENORM_MIN__ 1.40129846e-45F
-// PPC64-AIX:#define __FLT_DIG__ 6
-// PPC64-AIX:#define __FLT_EPSILON__ 1.19209290e-7F
-// PPC64-AIX:#define __FLT_EVAL_METHOD__ 1
-// PPC64-AIX:#define __FLT_HAS_DENORM__ 1
-// PPC64-AIX:#define __FLT_HAS_INFINITY__ 1
-// PPC64-AIX:#define __FLT_HAS_QUIET_NAN__ 1
-// PPC64-AIX:#define __FLT_MANT_DIG__ 24
-// PPC64-AIX:#define __FLT_MAX_10_EXP__ 38
-// PPC64-AIX:#define __FLT_MAX_EXP__ 128
-// PPC64-AIX:#define __FLT_MAX__ 3.40282347e+38F
-// PPC64-AIX:#define __FLT_MIN_10_EXP__ (-37)
-// PPC64-AIX:#define __FLT_MIN_EXP__ (-125)
-// PPC64-AIX:#define __FLT_MIN__ 1.17549435e-38F
-// PPC64-AIX:#define __FLT_RADIX__ 2
-// PPC64-AIX-NOT:#define __ILP32__ 1
-// PPC64-AIX:#define __INT16_C_SUFFIX__
-// PPC64-AIX:#define __INT16_FMTd__ "hd"
-// PPC64-AIX:#define __INT16_FMTi__ "hi"
-// PPC64-AIX:#define __INT16_MAX__ 32767
-// PPC64-AIX:#define __INT16_TYPE__ short
-// PPC64-AIX:#define __INT32_C_SUFFIX__
-// PPC64-AIX:#define __INT32_FMTd__ "d"
-// PPC64-AIX:#define __INT32_FMTi__ "i"
-// PPC64-AIX:#define __INT32_MAX__ 2147483647
-// PPC64-AIX:#define __INT32_TYPE__ int
-// PPC64-AIX:#define __INT64_C_SUFFIX__ L
-// PPC64-AIX:#define __INT64_FMTd__ "ld"
-// PPC64-AIX:#define __INT64_FMTi__ "li"
-// PPC64-AIX:#define __INT64_MAX__ 9223372036854775807L
-// PPC64-AIX:#define __INT64_TYPE__ long int
-// PPC64-AIX:#define __INT8_C_SUFFIX__
-// PPC64-AIX:#define __INT8_FMTd__ "hhd"
-// PPC64-AIX:#define __INT8_FMTi__ "hhi"
-// PPC64-AIX:#define __INT8_MAX__ 127
-// PPC64-AIX:#define __INT8_TYPE__ signed char
-// PPC64-AIX:#define __INTMAX_C_SUFFIX__ L
-// PPC64-AIX:#define __INTMAX_FMTd__ "ld"
-// PPC64-AIX:#define __INTMAX_FMTi__ "li"
-// PPC64-AIX:#define __INTMAX_MAX__ 9223372036854775807L
-// PPC64-AIX:#define __INTMAX_TYPE__ long int
-// PPC64-AIX:#define __INTMAX_WIDTH__ 64
-// PPC64-AIX:#define __INTPTR_FMTd__ "ld"
-// PPC64-AIX:#define __INTPTR_FMTi__ "li"
-// PPC64-AIX:#define __INTPTR_MAX__ 9223372036854775807L
-// PPC64-AIX:#define __INTPTR_TYPE__ long int
-// PPC64-AIX:#define __INTPTR_WIDTH__ 64
-// PPC64-AIX:#define __INT_FAST16_FMTd__ "hd"
-// PPC64-AIX:#define __INT_FAST16_FMTi__ "hi"
-// PPC64-AIX:#define __INT_FAST16_MAX__ 32767
-// PPC64-AIX:#define __INT_FAST16_TYPE__ short
-// PPC64-AIX:#define __INT_FAST32_FMTd__ "d"
-// PPC64-AIX:#define __INT_FAST32_FMTi__ "i"
-// PPC64-AIX:#define __INT_FAST32_MAX__ 2147483647
-// PPC64-AIX:#define __INT_FAST32_TYPE__ int
-// PPC64-AIX:#define __INT_FAST64_FMTd__ "ld"
-// PPC64-AIX:#define __INT_FAST64_FMTi__ "li"
-// PPC64-AIX:#define __INT_FAST64_MAX__ 9223372036854775807L
-// PPC64-AIX:#define __INT_FAST64_TYPE__ long int
-// PPC64-AIX:#define __INT_FAST8_FMTd__ "hhd"
-// PPC64-AIX:#define __INT_FAST8_FMTi__ "hhi"
-// PPC64-AIX:#define __INT_FAST8_MAX__ 127
-// PPC64-AIX:#define __INT_FAST8_TYPE__ signed char
-// PPC64-AIX:#define __INT_LEAST16_FMTd__ "hd"
-// PPC64-AIX:#define __INT_LEAST16_FMTi__ "hi"
-// PPC64-AIX:#define __INT_LEAST16_MAX__ 32767
-// PPC64-AIX:#define __INT_LEAST16_TYPE__ short
-// PPC64-AIX:#define __INT_LEAST32_FMTd__ "d"
-// PPC64-AIX:#define __INT_LEAST32_FMTi__ "i"
-// PPC64-AIX:#define __INT_LEAST32_MAX__ 2147483647
-// PPC64-AIX:#define __INT_LEAST32_TYPE__ int
-// PPC64-AIX:#define __INT_LEAST64_FMTd__ "ld"
-// PPC64-AIX:#define __INT_LEAST64_FMTi__ "li"
-// PPC64-AIX:#define __INT_LEAST64_MAX__ 9223372036854775807L
-// PPC64-AIX:#define __INT_LEAST64_TYPE__ long int
-// PPC64-AIX:#define __INT_LEAST8_FMTd__ "hhd"
-// PPC64-AIX:#define __INT_LEAST8_FMTi__ "hhi"
-// PPC64-AIX:#define __INT_LEAST8_MAX__ 127
-// PPC64-AIX:#define __INT_LEAST8_TYPE__ signed char
-// PPC64-AIX:#define __INT_MAX__ 2147483647
-// PPC64-AIX:#define __LDBL_DECIMAL_DIG__ 17
-// PPC64-AIX:#define __LDBL_DENORM_MIN__ 4.9406564584124654e-324L
-// PPC64-AIX:#define __LDBL_DIG__ 15
-// PPC64-AIX:#define __LDBL_EPSILON__ 2.2204460492503131e-16L
-// PPC64-AIX:#define __LDBL_HAS_DENORM__ 1
-// PPC64-AIX:#define __LDBL_HAS_INFINITY__ 1
-// PPC64-AIX:#define __LDBL_HAS_QUIET_NAN__ 1
-// PPC64-AIX:#define __LDBL_MANT_DIG__ 53
-// PPC64-AIX:#define __LDBL_MAX_10_EXP__ 308
-// PPC64-AIX:#define __LDBL_MAX_EXP__ 1024
-// PPC64-AIX:#define __LDBL_MAX__ 1.7976931348623157e+308L
-// PPC64-AIX:#define __LDBL_MIN_10_EXP__ (-307)
-// PPC64-AIX:#define __LDBL_MIN_EXP__ (-1021)
-// PPC64-AIX:#define __LDBL_MIN__ 2.2250738585072014e-308L
-// PPC64-AIX:#define __LONG_LONG_MAX__ 9223372036854775807LL
-// PPC64-AIX:#define __LONG_MAX__ 9223372036854775807L
-// PPC64-AIX:#define __LP64__ 1
-// PPC64-AIX-NOT:#define __NATURAL_ALIGNMENT__ 1
-// PPC64-AIX:#define __POINTER_WIDTH__ 64
-// PPC64-AIX:#define __POWERPC__ 1
-// PPC64-AIX:#define __PPC64__ 1
-// PPC64-AIX:#define __PPC__ 1
-// PPC64-AIX:#define __PTRDIFF_TYPE__ long int
-// PPC64-AIX:#define __PTRDIFF_WIDTH__ 64
-// PPC64-AIX:#define __REGISTER_PREFIX__
-// PPC64-AIX:#define __SCHAR_MAX__ 127
-// PPC64-AIX:#define __SHRT_MAX__ 32767
-// PPC64-AIX:#define __SIG_ATOMIC_MAX__ 2147483647
-// PPC64-AIX:#define __SIG_ATOMIC_WIDTH__ 32
-// PPC64-AIX:#define __SIZEOF_DOUBLE__ 8
-// PPC64-AIX:#define __SIZEOF_FLOAT__ 4
-// PPC64-AIX:#define __SIZEOF_INT__ 4
-// PPC64-AIX:#define __SIZEOF_LONG_DOUBLE__ 8
-// PPC64-AIX:#define __SIZEOF_LONG_LONG__ 8
-// PPC64-AIX:#define __SIZEOF_LONG__ 8
-// PPC64-AIX:#define __SIZEOF_POINTER__ 8
-// PPC64-AIX:#define __SIZEOF_PTRDIFF_T__ 8
-// PPC64-AIX:#define __SIZEOF_SHORT__ 2
-// PPC64-AIX:#define __SIZEOF_SIZE_T__ 8
-// PPC64-AIX:#define __SIZEOF_WCHAR_T__ 4
-// PPC64-AIX:#define __SIZEOF_WINT_T__ 4
-// PPC64-AIX:#define __SIZE_MAX__ 18446744073709551615UL
-// PPC64-AIX:#define __SIZE_TYPE__ long unsigned int
-// PPC64-AIX:#define __SIZE_WIDTH__ 64
-// PPC64-AIX:#define __UINT16_C_SUFFIX__
-// PPC64-AIX:#define __UINT16_MAX__ 65535
-// PPC64-AIX:#define __UINT16_TYPE__ unsigned short
-// PPC64-AIX:#define __UINT32_C_SUFFIX__ U
-// PPC64-AIX:#define __UINT32_MAX__ 4294967295U
-// PPC64-AIX:#define __UINT32_TYPE__ unsigned int
-// PPC64-AIX:#define __UINT64_C_SUFFIX__ UL
-// PPC64-AIX:#define __UINT64_MAX__ 18446744073709551615UL
-// PPC64-AIX:#define __UINT64_TYPE__ long unsigned int
-// PPC64-AIX:#define __UINT8_C_SUFFIX__
-// PPC64-AIX:#define __UINT8_MAX__ 255
-// PPC64-AIX:#define __UINT8_TYPE__ unsigned char
-// PPC64-AIX:#define __UINTMAX_C_SUFFIX__ UL
-// PPC64-AIX:#define __UINTMAX_MAX__ 18446744073709551615UL
-// PPC64-AIX:#define __UINTMAX_TYPE__ long unsigned int
-// PPC64-AIX:#define __UINTMAX_WIDTH__ 64
-// PPC64-AIX:#define __UINTPTR_MAX__ 18446744073709551615UL
-// PPC64-AIX:#define __UINTPTR_TYPE__ long unsigned int
-// PPC64-AIX:#define __UINTPTR_WIDTH__ 64
-// PPC64-AIX:#define __UINT_FAST16_MAX__ 65535
-// PPC64-AIX:#define __UINT_FAST16_TYPE__ unsigned short
-// PPC64-AIX:#define __UINT_FAST32_MAX__ 4294967295U
-// PPC64-AIX:#define __UINT_FAST32_TYPE__ unsigned int
-// PPC64-AIX:#define __UINT_FAST64_MAX__ 18446744073709551615UL
-// PPC64-AIX:#define __UINT_FAST64_TYPE__ long unsigned int
-// PPC64-AIX:#define __UINT_FAST8_MAX__ 255
-// PPC64-AIX:#define __UINT_FAST8_TYPE__ unsigned char
-// PPC64-AIX:#define __UINT_LEAST16_MAX__ 65535
-// PPC64-AIX:#define __UINT_LEAST16_TYPE__ unsigned short
-// PPC64-AIX:#define __UINT_LEAST32_MAX__ 4294967295U
-// PPC64-AIX:#define __UINT_LEAST32_TYPE__ unsigned int
-// PPC64-AIX:#define __UINT_LEAST64_MAX__ 18446744073709551615UL
-// PPC64-AIX:#define __UINT_LEAST64_TYPE__ long unsigned int
-// PPC64-AIX:#define __UINT_LEAST8_MAX__ 255
-// PPC64-AIX:#define __UINT_LEAST8_TYPE__ unsigned char
-// PPC64-AIX:#define __USER_LABEL_PREFIX__
-// PPC64-AIX:#define __WCHAR_MAX__ 4294967295U
-// PPC64-AIX:#define __WCHAR_TYPE__ unsigned int
-// PPC64-AIX:#define __WCHAR_WIDTH__ 32
-// PPC64-AIX:#define __WINT_TYPE__ int
-// PPC64-AIX:#define __WINT_WIDTH__ 32
-// PPC64-AIX:#define __powerpc64__ 1
-// PPC64-AIX:#define __powerpc__ 1
-// PPC64-AIX:#define __ppc64__ 1
-// PPC64-AIX:#define __ppc__ 1
-//
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-unknown-linux-gnu -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPC64-LINUX %s
-//
-// PPC64-LINUX:#define _ARCH_PPC 1
-// PPC64-LINUX:#define _ARCH_PPC64 1
-// PPC64-LINUX:#define _BIG_ENDIAN 1
-// PPC64-LINUX:#define _CALL_LINUX 1
-// PPC64-LINUX:#define _LP64 1
-// PPC64-LINUX:#define __BIGGEST_ALIGNMENT__ 16
-// PPC64-LINUX:#define __BIG_ENDIAN__ 1
-// PPC64-LINUX:#define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__
-// PPC64-LINUX:#define __CHAR16_TYPE__ unsigned short
-// PPC64-LINUX:#define __CHAR32_TYPE__ unsigned int
-// PPC64-LINUX:#define __CHAR_BIT__ 8
-// PPC64-LINUX:#define __CHAR_UNSIGNED__ 1
-// PPC64-LINUX:#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
-// PPC64-LINUX:#define __DBL_DIG__ 15
-// PPC64-LINUX:#define __DBL_EPSILON__ 2.2204460492503131e-16
-// PPC64-LINUX:#define __DBL_HAS_DENORM__ 1
-// PPC64-LINUX:#define __DBL_HAS_INFINITY__ 1
-// PPC64-LINUX:#define __DBL_HAS_QUIET_NAN__ 1
-// PPC64-LINUX:#define __DBL_MANT_DIG__ 53
-// PPC64-LINUX:#define __DBL_MAX_10_EXP__ 308
-// PPC64-LINUX:#define __DBL_MAX_EXP__ 1024
-// PPC64-LINUX:#define __DBL_MAX__ 1.7976931348623157e+308
-// PPC64-LINUX:#define __DBL_MIN_10_EXP__ (-307)
-// PPC64-LINUX:#define __DBL_MIN_EXP__ (-1021)
-// PPC64-LINUX:#define __DBL_MIN__ 2.2250738585072014e-308
-// PPC64-LINUX:#define __DECIMAL_DIG__ __LDBL_DECIMAL_DIG__
-// PPC64-LINUX:#define __FLT_DENORM_MIN__ 1.40129846e-45F
-// PPC64-LINUX:#define __FLT_DIG__ 6
-// PPC64-LINUX:#define __FLT_EPSILON__ 1.19209290e-7F
-// PPC64-LINUX:#define __FLT_EVAL_METHOD__ 0
-// PPC64-LINUX:#define __FLT_HAS_DENORM__ 1
-// PPC64-LINUX:#define __FLT_HAS_INFINITY__ 1
-// PPC64-LINUX:#define __FLT_HAS_QUIET_NAN__ 1
-// PPC64-LINUX:#define __FLT_MANT_DIG__ 24
-// PPC64-LINUX:#define __FLT_MAX_10_EXP__ 38
-// PPC64-LINUX:#define __FLT_MAX_EXP__ 128
-// PPC64-LINUX:#define __FLT_MAX__ 3.40282347e+38F
-// PPC64-LINUX:#define __FLT_MIN_10_EXP__ (-37)
-// PPC64-LINUX:#define __FLT_MIN_EXP__ (-125)
-// PPC64-LINUX:#define __FLT_MIN__ 1.17549435e-38F
-// PPC64-LINUX:#define __FLT_RADIX__ 2
-// PPC64-LINUX:#define __HAVE_BSWAP__ 1
-// PPC64-LINUX:#define __INT16_C_SUFFIX__
-// PPC64-LINUX:#define __INT16_FMTd__ "hd"
-// PPC64-LINUX:#define __INT16_FMTi__ "hi"
-// PPC64-LINUX:#define __INT16_MAX__ 32767
-// PPC64-LINUX:#define __INT16_TYPE__ short
-// PPC64-LINUX:#define __INT32_C_SUFFIX__
-// PPC64-LINUX:#define __INT32_FMTd__ "d"
-// PPC64-LINUX:#define __INT32_FMTi__ "i"
-// PPC64-LINUX:#define __INT32_MAX__ 2147483647
-// PPC64-LINUX:#define __INT32_TYPE__ int
-// PPC64-LINUX:#define __INT64_C_SUFFIX__ L
-// PPC64-LINUX:#define __INT64_FMTd__ "ld"
-// PPC64-LINUX:#define __INT64_FMTi__ "li"
-// PPC64-LINUX:#define __INT64_MAX__ 9223372036854775807L
-// PPC64-LINUX:#define __INT64_TYPE__ long int
-// PPC64-LINUX:#define __INT8_C_SUFFIX__
-// PPC64-LINUX:#define __INT8_FMTd__ "hhd"
-// PPC64-LINUX:#define __INT8_FMTi__ "hhi"
-// PPC64-LINUX:#define __INT8_MAX__ 127
-// PPC64-LINUX:#define __INT8_TYPE__ signed char
-// PPC64-LINUX:#define __INTMAX_C_SUFFIX__ L
-// PPC64-LINUX:#define __INTMAX_FMTd__ "ld"
-// PPC64-LINUX:#define __INTMAX_FMTi__ "li"
-// PPC64-LINUX:#define __INTMAX_MAX__ 9223372036854775807L
-// PPC64-LINUX:#define __INTMAX_TYPE__ long int
-// PPC64-LINUX:#define __INTMAX_WIDTH__ 64
-// PPC64-LINUX:#define __INTPTR_FMTd__ "ld"
-// PPC64-LINUX:#define __INTPTR_FMTi__ "li"
-// PPC64-LINUX:#define __INTPTR_MAX__ 9223372036854775807L
-// PPC64-LINUX:#define __INTPTR_TYPE__ long int
-// PPC64-LINUX:#define __INTPTR_WIDTH__ 64
-// PPC64-LINUX:#define __INT_FAST16_FMTd__ "hd"
-// PPC64-LINUX:#define __INT_FAST16_FMTi__ "hi"
-// PPC64-LINUX:#define __INT_FAST16_MAX__ 32767
-// PPC64-LINUX:#define __INT_FAST16_TYPE__ short
-// PPC64-LINUX:#define __INT_FAST32_FMTd__ "d"
-// PPC64-LINUX:#define __INT_FAST32_FMTi__ "i"
-// PPC64-LINUX:#define __INT_FAST32_MAX__ 2147483647
-// PPC64-LINUX:#define __INT_FAST32_TYPE__ int
-// PPC64-LINUX:#define __INT_FAST64_FMTd__ "ld"
-// PPC64-LINUX:#define __INT_FAST64_FMTi__ "li"
-// PPC64-LINUX:#define __INT_FAST64_MAX__ 9223372036854775807L
-// PPC64-LINUX:#define __INT_FAST64_TYPE__ long int
-// PPC64-LINUX:#define __INT_FAST8_FMTd__ "hhd"
-// PPC64-LINUX:#define __INT_FAST8_FMTi__ "hhi"
-// PPC64-LINUX:#define __INT_FAST8_MAX__ 127
-// PPC64-LINUX:#define __INT_FAST8_TYPE__ signed char
-// PPC64-LINUX:#define __INT_LEAST16_FMTd__ "hd"
-// PPC64-LINUX:#define __INT_LEAST16_FMTi__ "hi"
-// PPC64-LINUX:#define __INT_LEAST16_MAX__ 32767
-// PPC64-LINUX:#define __INT_LEAST16_TYPE__ short
-// PPC64-LINUX:#define __INT_LEAST32_FMTd__ "d"
-// PPC64-LINUX:#define __INT_LEAST32_FMTi__ "i"
-// PPC64-LINUX:#define __INT_LEAST32_MAX__ 2147483647
-// PPC64-LINUX:#define __INT_LEAST32_TYPE__ int
-// PPC64-LINUX:#define __INT_LEAST64_FMTd__ "ld"
-// PPC64-LINUX:#define __INT_LEAST64_FMTi__ "li"
-// PPC64-LINUX:#define __INT_LEAST64_MAX__ 9223372036854775807L
-// PPC64-LINUX:#define __INT_LEAST64_TYPE__ long int
-// PPC64-LINUX:#define __INT_LEAST8_FMTd__ "hhd"
-// PPC64-LINUX:#define __INT_LEAST8_FMTi__ "hhi"
-// PPC64-LINUX:#define __INT_LEAST8_MAX__ 127
-// PPC64-LINUX:#define __INT_LEAST8_TYPE__ signed char
-// PPC64-LINUX:#define __INT_MAX__ 2147483647
-// PPC64-LINUX:#define __LDBL_DENORM_MIN__ 4.94065645841246544176568792868221e-324L
-// PPC64-LINUX:#define __LDBL_DIG__ 31
-// PPC64-LINUX:#define __LDBL_EPSILON__ 4.94065645841246544176568792868221e-324L
-// PPC64-LINUX:#define __LDBL_HAS_DENORM__ 1
-// PPC64-LINUX:#define __LDBL_HAS_INFINITY__ 1
-// PPC64-LINUX:#define __LDBL_HAS_QUIET_NAN__ 1
-// PPC64-LINUX:#define __LDBL_MANT_DIG__ 106
-// PPC64-LINUX:#define __LDBL_MAX_10_EXP__ 308
-// PPC64-LINUX:#define __LDBL_MAX_EXP__ 1024
-// PPC64-LINUX:#define __LDBL_MAX__ 1.79769313486231580793728971405301e+308L
-// PPC64-LINUX:#define __LDBL_MIN_10_EXP__ (-291)
-// PPC64-LINUX:#define __LDBL_MIN_EXP__ (-968)
-// PPC64-LINUX:#define __LDBL_MIN__ 2.00416836000897277799610805135016e-292L
-// PPC64-LINUX:#define __LONGDOUBLE128 1
-// PPC64-LINUX:#define __LONG_DOUBLE_128__ 1
-// PPC64-LINUX:#define __LONG_LONG_MAX__ 9223372036854775807LL
-// PPC64-LINUX:#define __LONG_MAX__ 9223372036854775807L
-// PPC64-LINUX:#define __LP64__ 1
-// 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__
-// PPC64-LINUX:#define __SCHAR_MAX__ 127
-// PPC64-LINUX:#define __SHRT_MAX__ 32767
-// PPC64-LINUX:#define __SIG_ATOMIC_MAX__ 2147483647
-// PPC64-LINUX:#define __SIG_ATOMIC_WIDTH__ 32
-// PPC64-LINUX:#define __SIZEOF_DOUBLE__ 8
-// PPC64-LINUX:#define __SIZEOF_FLOAT__ 4
-// PPC64-LINUX:#define __SIZEOF_INT__ 4
-// PPC64-LINUX:#define __SIZEOF_LONG_DOUBLE__ 16
-// PPC64-LINUX:#define __SIZEOF_LONG_LONG__ 8
-// PPC64-LINUX:#define __SIZEOF_LONG__ 8
-// PPC64-LINUX:#define __SIZEOF_POINTER__ 8
-// PPC64-LINUX:#define __SIZEOF_PTRDIFF_T__ 8
-// PPC64-LINUX:#define __SIZEOF_SHORT__ 2
-// PPC64-LINUX:#define __SIZEOF_SIZE_T__ 8
-// PPC64-LINUX:#define __SIZEOF_WCHAR_T__ 4
-// PPC64-LINUX:#define __SIZEOF_WINT_T__ 4
-// PPC64-LINUX:#define __SIZE_MAX__ 18446744073709551615UL
-// PPC64-LINUX:#define __SIZE_TYPE__ long unsigned int
-// PPC64-LINUX:#define __SIZE_WIDTH__ 64
-// PPC64-LINUX:#define __UINT16_C_SUFFIX__
-// PPC64-LINUX:#define __UINT16_MAX__ 65535
-// PPC64-LINUX:#define __UINT16_TYPE__ unsigned short
-// PPC64-LINUX:#define __UINT32_C_SUFFIX__ U
-// PPC64-LINUX:#define __UINT32_MAX__ 4294967295U
-// PPC64-LINUX:#define __UINT32_TYPE__ unsigned int
-// PPC64-LINUX:#define __UINT64_C_SUFFIX__ UL
-// PPC64-LINUX:#define __UINT64_MAX__ 18446744073709551615UL
-// PPC64-LINUX:#define __UINT64_TYPE__ long unsigned int
-// PPC64-LINUX:#define __UINT8_C_SUFFIX__
-// PPC64-LINUX:#define __UINT8_MAX__ 255
-// PPC64-LINUX:#define __UINT8_TYPE__ unsigned char
-// PPC64-LINUX:#define __UINTMAX_C_SUFFIX__ UL
-// PPC64-LINUX:#define __UINTMAX_MAX__ 18446744073709551615UL
-// PPC64-LINUX:#define __UINTMAX_TYPE__ long unsigned int
-// PPC64-LINUX:#define __UINTMAX_WIDTH__ 64
-// PPC64-LINUX:#define __UINTPTR_MAX__ 18446744073709551615UL
-// PPC64-LINUX:#define __UINTPTR_TYPE__ long unsigned int
-// PPC64-LINUX:#define __UINTPTR_WIDTH__ 64
-// PPC64-LINUX:#define __UINT_FAST16_MAX__ 65535
-// PPC64-LINUX:#define __UINT_FAST16_TYPE__ unsigned short
-// PPC64-LINUX:#define __UINT_FAST32_MAX__ 4294967295U
-// PPC64-LINUX:#define __UINT_FAST32_TYPE__ unsigned int
-// PPC64-LINUX:#define __UINT_FAST64_MAX__ 18446744073709551615UL
-// PPC64-LINUX:#define __UINT_FAST64_TYPE__ long unsigned int
-// PPC64-LINUX:#define __UINT_FAST8_MAX__ 255
-// PPC64-LINUX:#define __UINT_FAST8_TYPE__ unsigned char
-// PPC64-LINUX:#define __UINT_LEAST16_MAX__ 65535
-// PPC64-LINUX:#define __UINT_LEAST16_TYPE__ unsigned short
-// PPC64-LINUX:#define __UINT_LEAST32_MAX__ 4294967295U
-// PPC64-LINUX:#define __UINT_LEAST32_TYPE__ unsigned int
-// PPC64-LINUX:#define __UINT_LEAST64_MAX__ 18446744073709551615UL
-// PPC64-LINUX:#define __UINT_LEAST64_TYPE__ long unsigned int
-// PPC64-LINUX:#define __UINT_LEAST8_MAX__ 255
-// PPC64-LINUX:#define __UINT_LEAST8_TYPE__ unsigned char
-// PPC64-LINUX:#define __USER_LABEL_PREFIX__
-// PPC64-LINUX:#define __WCHAR_MAX__ 2147483647
-// PPC64-LINUX:#define __WCHAR_TYPE__ int
-// PPC64-LINUX:#define __WCHAR_WIDTH__ 32
-// PPC64-LINUX:#define __WINT_TYPE__ unsigned int
-// PPC64-LINUX:#define __WINT_UNSIGNED__ 1
-// PPC64-LINUX:#define __WINT_WIDTH__ 32
-// PPC64-LINUX:#define __powerpc64__ 1
-// PPC64-LINUX:#define __powerpc__ 1
-// PPC64-LINUX:#define __ppc64__ 1
-// PPC64-LINUX:#define __ppc__ 1
-
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-unknown-linux-gnu < /dev/null | FileCheck -match-full-lines -check-prefix PPC64-ELFv1 %s
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-unknown-linux-gnu -target-abi elfv1 < /dev/null | FileCheck -match-full-lines -check-prefix PPC64-ELFv1 %s
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-unknown-linux-gnu -target-abi elfv1-qpx < /dev/null | FileCheck -match-full-lines -check-prefix PPC64-ELFv1 %s
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-unknown-linux-gnu -target-abi elfv2 < /dev/null | FileCheck -match-full-lines -check-prefix PPC64-ELFv2 %s
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64le-unknown-linux-gnu < /dev/null | FileCheck -match-full-lines -check-prefix PPC64-ELFv2 %s
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64le-unknown-linux-gnu -target-abi elfv1 < /dev/null | FileCheck -match-full-lines -check-prefix PPC64-ELFv1 %s
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64le-unknown-linux-gnu -target-abi elfv2 < /dev/null | FileCheck -match-full-lines -check-prefix PPC64-ELFv2 %s
-// PPC64-ELFv1:#define _CALL_ELF 1
-// PPC64-ELFv2:#define _CALL_ELF 2
-//
-// Most of this is encompassed in other places.
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64le-unknown-linux-gnu -target-abi elfv2 < /dev/null | FileCheck -match-full-lines -check-prefix PPC64LE-LINUX %s
-//
-// PPC64LE-LINUX:#define _CALL_LINUX 1
-//
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc-none-none -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPC %s
//
// PPC:#define _ARCH_PPC 1
@@ -7580,6 +6556,17 @@
//
// PPC32-LINUX-NOT: _CALL_LINUX
//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc-unknown-linux-gnu -target-feature +spe < /dev/null | FileCheck -match-full-lines -check-prefix PPC32-SPE %s
+//
+// PPC32-SPE:#define __NO_FPRS__ 1
+// PPC32-SPE:#define __SPE__ 1
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc-unknown-linux-gnu -target-cpu 8548 < /dev/null | FileCheck -match-full-lines -check-prefix PPC8548 %s
+//
+// PPC8548:#define __NO_FPRS__ 1
+// PPC8548:#define __NO_LWSYNC__ 1
+// PPC8548:#define __SPE__ 1
+//
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc-apple-darwin8 < /dev/null | FileCheck -match-full-lines -check-prefix PPC-DARWIN %s
//
// PPC-DARWIN:#define _ARCH_PPC 1
@@ -7778,9 +6765,6 @@
// PPC-DARWIN:#define __powerpc__ 1
// PPC-DARWIN:#define __ppc__ 1
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-apple-darwin8 < /dev/null | FileCheck -match-full-lines -check-prefix PPC64-DARWIN %s
-// PPC64-DARWIN:#define __STRUCT_PARM_ALIGN__ 16
-
// RUN: %clang_cc1 -x cl -E -dM -ffreestanding -triple=amdgcn < /dev/null | FileCheck -match-full-lines -check-prefix AMDGCN --check-prefix AMDGPU %s
// RUN: %clang_cc1 -x cl -E -dM -ffreestanding -triple=r600 -target-cpu caicos < /dev/null | FileCheck -match-full-lines --check-prefix AMDGPU %s
//
@@ -7975,12 +6959,12 @@
// S390X:#define __s390__ 1
// S390X:#define __s390x__ 1
//
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=sparc-none-none < /dev/null | FileCheck -match-full-lines -check-prefix SPARC -check-prefix SPARC-DEFAULT %s
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=sparc-rtems-elf < /dev/null | FileCheck -match-full-lines -check-prefix SPARC -check-prefix SPARC-DEFAULT %s
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=sparc-none-netbsd < /dev/null | FileCheck -match-full-lines -check-prefix SPARC -check-prefix SPARC-NETOPENBSD %s
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=sparc-none-openbsd < /dev/null | FileCheck -match-full-lines -check-prefix SPARC -check-prefix SPARC-NETOPENBSD %s
-// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -triple=sparc-none-none < /dev/null | FileCheck -match-full-lines -check-prefix SPARC -check-prefix SPARC-DEFAULT -check-prefix SPARC-DEFAULT-CXX %s
-// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -triple=sparc-none-openbsd < /dev/null | FileCheck -match-full-lines -check-prefix SPARC -check-prefix SPARC-NETOPENBSD -check-prefix SPARC-NETOPENBSD-CXX %s
+// RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=sparc-none-none < /dev/null | FileCheck -match-full-lines -check-prefix SPARC -check-prefix SPARC-DEFAULT %s
+// RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=sparc-rtems-elf < /dev/null | FileCheck -match-full-lines -check-prefix SPARC -check-prefix SPARC-DEFAULT %s
+// RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=sparc-none-netbsd < /dev/null | FileCheck -match-full-lines -check-prefix SPARC -check-prefix SPARC-NETOPENBSD %s
+// RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=sparc-none-openbsd < /dev/null | FileCheck -match-full-lines -check-prefix SPARC -check-prefix SPARC-NETOPENBSD %s
+// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=sparc-none-none < /dev/null | FileCheck -match-full-lines -check-prefix SPARC -check-prefix SPARC-DEFAULT -check-prefix SPARC-DEFAULT-CXX %s
+// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=sparc-none-openbsd < /dev/null | FileCheck -match-full-lines -check-prefix SPARC -check-prefix SPARC-NETOPENBSD -check-prefix SPARC-NETOPENBSD-CXX %s
//
// SPARC-NOT:#define _LP64
// SPARC:#define __BIGGEST_ALIGNMENT__ 8
@@ -8180,8 +7164,8 @@
// SPARC:#define __sparcv8 1
// SPARC:#define sparc 1
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=tce-none-none < /dev/null | FileCheck -match-full-lines -check-prefix TCE %s
-// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -triple=tce-none-none < /dev/null | FileCheck -match-full-lines -check-prefix TCE -check-prefix TCE-CXX %s
+// RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=tce-none-none < /dev/null | FileCheck -match-full-lines -check-prefix TCE %s
+// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=tce-none-none < /dev/null | FileCheck -match-full-lines -check-prefix TCE -check-prefix TCE-CXX %s
//
// TCE-NOT:#define _LP64
// TCE:#define __BIGGEST_ALIGNMENT__ 4
@@ -8349,8 +7333,8 @@
// TCE:#define __tce__ 1
// TCE:#define tce 1
//
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=x86_64-none-none < /dev/null | FileCheck -match-full-lines -check-prefix X86_64 %s
-// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -triple=x86_64-none-none < /dev/null | FileCheck -match-full-lines -check-prefix X86_64 -check-prefix X86_64-CXX %s
+// RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=x86_64-none-none < /dev/null | FileCheck -match-full-lines -check-prefix X86_64 %s
+// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=x86_64-none-none < /dev/null | FileCheck -match-full-lines -check-prefix X86_64 -check-prefix X86_64-CXX %s
//
// X86_64:#define _LP64 1
// X86_64-NOT:#define _LP32 1
@@ -8557,8 +7541,8 @@
// RUN: %clang -xc - -E -dM -mcmodel=medium --target=i386-unknown-linux < /dev/null | FileCheck -match-full-lines -check-prefix X86_MEDIUM %s
// X86_MEDIUM:#define __code_model_medium_ 1
//
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=x86_64-none-none-gnux32 < /dev/null | FileCheck -match-full-lines -check-prefix X32 %s
-// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -triple=x86_64-none-none-gnux32 < /dev/null | FileCheck -match-full-lines -check-prefix X32 -check-prefix X32-CXX %s
+// RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=x86_64-none-none-gnux32 < /dev/null | FileCheck -match-full-lines -check-prefix X32 %s
+// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=x86_64-none-none-gnux32 < /dev/null | FileCheck -match-full-lines -check-prefix X32 -check-prefix X32-CXX %s
//
// X32:#define _ILP32 1
// X32-NOT:#define _LP64 1
@@ -8754,7 +7738,7 @@
// X32:#define __x86_64 1
// X32:#define __x86_64__ 1
//
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=x86_64-unknown-cloudabi < /dev/null | FileCheck -match-full-lines -check-prefix X86_64-CLOUDABI %s
+// RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=x86_64-unknown-cloudabi < /dev/null | FileCheck -match-full-lines -check-prefix X86_64-CLOUDABI %s
//
// X86_64-CLOUDABI:#define _LP64 1
// X86_64-CLOUDABI:#define __ATOMIC_ACQUIRE 2
@@ -9059,7 +8043,7 @@
// X86_64-CLOUDABI:#define __x86_64 1
// X86_64-CLOUDABI:#define __x86_64__ 1
//
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=x86_64-pc-linux-gnu < /dev/null | FileCheck -match-full-lines -check-prefix X86_64-LINUX %s
+// RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=x86_64-pc-linux-gnu < /dev/null | FileCheck -match-full-lines -check-prefix X86_64-LINUX %s
//
// X86_64-LINUX:#define _LP64 1
// X86_64-LINUX:#define __BIGGEST_ALIGNMENT__ 16
@@ -9272,7 +8256,7 @@
// X86_64-FREEBSD:#define __LDBL_DECIMAL_DIG__ 21
// X86_64-FREEBSD:#define __STDC_MB_MIGHT_NEQ_WC__ 1
//
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=x86_64-netbsd < /dev/null | FileCheck -match-full-lines -check-prefix X86_64-NETBSD %s
+// RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=x86_64-netbsd < /dev/null | FileCheck -match-full-lines -check-prefix X86_64-NETBSD %s
//
// X86_64-NETBSD:#define _LP64 1
// X86_64-NETBSD:#define __BIGGEST_ALIGNMENT__ 16
@@ -9476,7 +8460,7 @@
// X86_64-NETBSD:#define __x86_64 1
// X86_64-NETBSD:#define __x86_64__ 1
//
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=x86_64-scei-ps4 < /dev/null | FileCheck -match-full-lines -check-prefix PS4 %s
+// RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=x86_64-scei-ps4 < /dev/null | FileCheck -match-full-lines -check-prefix PS4 %s
//
// PS4:#define _LP64 1
// PS4:#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
@@ -9552,6 +8536,7 @@
// PS4:#define __PTRDIFF_TYPE__ long int
// PS4:#define __PTRDIFF_WIDTH__ 64
// PS4:#define __REGISTER_PREFIX__
+// PS4:#define __SCE__ 1
// PS4:#define __SCHAR_MAX__ 127
// PS4:#define __SHRT_MAX__ 32767
// PS4:#define __SIG_ATOMIC_MAX__ 2147483647
@@ -9599,6 +8584,7 @@
// X86-64-DECLSPEC: #define __declspec{{.*}}
//
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=sparc64-none-none < /dev/null | FileCheck -match-full-lines -check-prefix SPARCV9 %s
+// SPARCV9:#define __BIGGEST_ALIGNMENT__ 16
// SPARCV9:#define __INT64_TYPE__ long int
// SPARCV9:#define __INTMAX_C_SUFFIX__ L
// SPARCV9:#define __INTMAX_TYPE__ long int
@@ -9635,7 +8621,7 @@
// RUN: %clang_cc1 -x objective-c -triple i386-unknown-freebsd -fobjc-runtime=gnustep-2.5 -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix GNUSTEP2 %s
// GNUSTEP2:#define __OBJC_GNUSTEP_RUNTIME_ABI__ 20
//
-// RUN: %clang_cc1 -x c++ -std=c++98 -fno-rtti -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix NORTTI %s
+// RUN: %clang_cc1 -x c++ -fgnuc-version=4.2.1 -std=c++98 -fno-rtti -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix NORTTI %s
// NORTTI: #define __GXX_ABI_VERSION {{.*}}
// NORTTI-NOT:#define __GXX_RTTI
// NORTTI:#define __STDC__ 1
@@ -9686,24 +8672,21 @@
// OPENBSD:#define __WCHAR_TYPE__ int
// OPENBSD:#define __WINT_TYPE__ int
//
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-unknown-freebsd < /dev/null | FileCheck -match-full-lines -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 -match-full-lines -check-prefix XCORE %s
// XCORE:#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
// XCORE:#define __LITTLE_ENDIAN__ 1
// XCORE:#define __XS1B__ 1
//
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=wasm32-unknown-unknown \
+// RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=wasm32-unknown-unknown \
// RUN: < /dev/null \
// RUN: | FileCheck -match-full-lines -check-prefixes=WEBASSEMBLY,WEBASSEMBLY32 %s
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=wasm64-unknown-unknown \
+// RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=wasm64-unknown-unknown \
// RUN: < /dev/null \
// RUN: | FileCheck -match-full-lines -check-prefixes=WEBASSEMBLY,WEBASSEMBLY64 %s
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=wasm32-wasi \
+// RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=wasm32-wasi \
// RUN: < /dev/null \
// RUN: | FileCheck -match-full-lines -check-prefixes=WEBASSEMBLY,WEBASSEMBLY32,WEBASSEMBLY-WASI %s
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=wasm64-wasi \
+// RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=wasm64-wasi \
// RUN: < /dev/null \
// RUN: | FileCheck -match-full-lines -check-prefixes=WEBASSEMBLY,WEBASSEMBLY64,WEBASSEMBLY-WASI %s
//
@@ -10081,7 +9064,7 @@
// RUN: %clang_cc1 -E -dM -ffreestanding -triple x86_64-windows-cygnus < /dev/null | FileCheck -match-full-lines -check-prefix CYGWIN-X64 %s
// CYGWIN-X64: #define __USER_LABEL_PREFIX__
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=avr \
+// RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=avr \
// RUN: < /dev/null \
// RUN: | FileCheck -match-full-lines -check-prefix=AVR %s
//
@@ -10289,10 +9272,10 @@
// MSVC-X64:#define __STDCPP_DEFAULT_NEW_ALIGNMENT__ 16ULL
// RUN: %clang_cc1 -E -dM -ffreestanding \
-// RUN: -triple=aarch64-apple-ios9 < /dev/null \
+// RUN: -fgnuc-version=4.2.1 -triple=aarch64-apple-ios9 < /dev/null \
// RUN: | FileCheck -check-prefix=DARWIN %s
// RUN: %clang_cc1 -E -dM -ffreestanding \
-// RUN: -triple=aarch64-apple-macosx10.12 < /dev/null \
+// RUN: -fgnuc-version=4.2.1 -triple=aarch64-apple-macosx10.12 < /dev/null \
// RUN: | FileCheck -check-prefix=DARWIN %s
// DARWIN:#define __STDC_NO_THREADS__ 1
@@ -10358,11 +9341,11 @@
// ARM-DARWIN-BAREMETAL-64: #define __PTRDIFF_TYPE__ long int
// ARM-DARWIN-BAREMETAL-64: #define __SIZE_TYPE__ long unsigned int
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=riscv32 < /dev/null \
+// RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=riscv32 < /dev/null \
// RUN: | FileCheck -match-full-lines -check-prefix=RISCV32 %s
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=riscv32-unknown-linux < /dev/null \
+// RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=riscv32-unknown-linux < /dev/null \
// RUN: | FileCheck -match-full-lines -check-prefixes=RISCV32,RISCV32-LINUX %s
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=riscv32 \
+// RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=riscv32 \
// RUN: -fforce-enable-int128 < /dev/null | FileCheck -match-full-lines \
// RUN: -check-prefixes=RISCV32,RISCV32-INT128 %s
// RISCV32: #define _ILP32 1
@@ -10569,9 +9552,9 @@
// RISCV32-LINUX: #define linux 1
// RISCV32-LINUX: #define unix 1
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=riscv64 < /dev/null \
+// RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=riscv64 < /dev/null \
// RUN: | FileCheck -match-full-lines -check-prefix=RISCV64 %s
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=riscv64-unknown-linux < /dev/null \
+// RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=riscv64-unknown-linux < /dev/null \
// RUN: | FileCheck -match-full-lines -check-prefixes=RISCV64,RISCV64-LINUX %s
// RISCV64: #define _LP64 1
// RISCV64: #define __ATOMIC_ACQUIRE 2
diff --git a/src/llvm-project/clang/test/Preprocessor/microsoft-ext.c b/src/llvm-project/clang/test/Preprocessor/microsoft-ext.c
index cb3cf4f..aae52a8 100644
--- a/src/llvm-project/clang/test/Preprocessor/microsoft-ext.c
+++ b/src/llvm-project/clang/test/Preprocessor/microsoft-ext.c
@@ -23,6 +23,19 @@
HAS_1_TEMPLATE_PARAMS(int, k),
AND_2_VALUE_PARAMS(p0, p1));
+// Regression test for PR43282; check that we match MSVC's failure to unpack
+// __VA_ARGS__ unless forwarded through another macro.
+#define THIRD_ARGUMENT(A, B, C, ...) C
+#define TEST(...) THIRD_ARGUMENT(__VA_ARGS__, 1, 2)
+#define COMBINE(...) __VA_ARGS__
+#define WRAPPED_TEST(...) COMBINE(THIRD_ARGUMENT(__VA_ARGS__, 1, 2))
+// Check that we match MSVC's failure to unpack __VA_ARGS__, unless forwarded
+// through another macro
+auto packed = TEST(,);
+auto unpacked = WRAPPED_TEST(,);
+// CHECK: auto packed = 2;
+// CHECK: auto unpacked = 1;
+
// This tests compatibility with behaviour needed for type_traits in VS2012
// Test based on _VARIADIC_EXPAND_0X macros in xstddef of VS2012
#define _COMMA ,
diff --git a/src/llvm-project/clang/test/Preprocessor/nonportable-include-with-hmap.c b/src/llvm-project/clang/test/Preprocessor/nonportable-include-with-hmap.c
index bbbd669..07907df 100644
--- a/src/llvm-project/clang/test/Preprocessor/nonportable-include-with-hmap.c
+++ b/src/llvm-project/clang/test/Preprocessor/nonportable-include-with-hmap.c
@@ -1,5 +1,10 @@
+// REQUIRES: shell
+// REQUIRES: case-insensitive-filesystem
+
// RUN: rm -f %t.hmap
-// RUN: %hmaptool write %S/Inputs/nonportable-hmaps/foo.hmap.json %t.hmap
+// RUN: sed -e "s:INPUTS_DIR:%S/Inputs:g" \
+// RUN: %S/Inputs/nonportable-hmaps/foo.hmap.json > %t.hmap.json
+// RUN: %hmaptool write %t.hmap.json %t.hmap
// RUN: %clang_cc1 -Eonly \
// RUN: -I%t.hmap \
// RUN: -I%S/Inputs/nonportable-hmaps \
@@ -15,4 +20,16 @@
// 5. Return.
//
// There is nothing nonportable; -Wnonportable-include-path should not fire.
-#include "Foo/Foo.h" // expected-no-diagnostics
+#include "Foo/Foo.h" // no warning
+
+// Verify files with absolute paths in the header map are handled too.
+// "Bar.h" is included twice to make sure that when we see potentially
+// nonportable path, the file has been already discovered through a relative
+// path which triggers the file to be opened and `FileEntry::RealPathName`
+// to be set.
+#include "Bar.h"
+#include "Foo/Bar.h" // no warning
+
+// But the presence of the absolute path in the header map is not enough. If we
+// didn't use it to discover a file, shouldn't suppress the warning.
+#include "headers/Foo/Baz.h" // expected-warning {{non-portable path}}
diff --git a/src/llvm-project/clang/test/Preprocessor/pragma_microsoft.c b/src/llvm-project/clang/test/Preprocessor/pragma_microsoft.c
index 9d62d01..020292a 100644
--- a/src/llvm-project/clang/test/Preprocessor/pragma_microsoft.c
+++ b/src/llvm-project/clang/test/Preprocessor/pragma_microsoft.c
@@ -51,6 +51,8 @@
__pragma(warning(pop)); \
}
+#define PRAGMA_IN_ARGS(p) p
+
void f()
{
__pragma() // expected-warning{{unknown pragma ignored}}
@@ -64,8 +66,16 @@
// CHECK: #pragma warning(disable: 10000)
// CHECK: ; 1 + (2 > 3) ? 4 : 5;
// CHECK: #pragma warning(pop)
-}
+ // Check that macro arguments can contain __pragma.
+ PRAGMA_IN_ARGS(MACRO_WITH__PRAGMA) // expected-warning {{lower precedence}} \
+ // expected-note 2 {{place parentheses}} \
+ // expected-warning {{expression result unused}}
+// CHECK: #pragma warning(push)
+// CHECK: #pragma warning(disable: 10000)
+// CHECK: ; 1 + (2 > 3) ? 4 : 5;
+// CHECK: #pragma warning(pop)
+}
// This should include macro_arg_directive even though the include
// is looking for test.h This allows us to assign to "n"
diff --git a/src/llvm-project/clang/test/Preprocessor/pragma_module.c b/src/llvm-project/clang/test/Preprocessor/pragma_module.c
index 90aa948..c52d425 100644
--- a/src/llvm-project/clang/test/Preprocessor/pragma_module.c
+++ b/src/llvm-project/clang/test/Preprocessor/pragma_module.c
@@ -1,9 +1,9 @@
// RUN: rm -rf %t
// RUN: mkdir %t
// RUN: echo 'module foo { module a {} module b {} } module bar {} module if {}' > %t/module.map
-// RUN: %clang -cc1 -fmodules -fmodule-name=if -x c %t/module.map -emit-module -o %t/if.pcm
-// RUN: %clang -cc1 -E -fmodules %s -fmodule-file=%t/if.pcm -verify -fmodule-name=foo -fmodule-map-file=%t/module.map
-// RUN: %clang -cc1 -E -fmodules %s -fmodule-file=%t/if.pcm -verify -fmodule-name=foo -fmodule-map-file=%t/module.map -fmodules-local-submodule-visibility -DLOCAL_VIS
+// RUN: %clang_cc1 -fmodules -fmodule-name=if -x c %t/module.map -emit-module -o %t/if.pcm
+// RUN: %clang_cc1 -E -fmodules %s -fmodule-file=%t/if.pcm -verify -fmodule-name=foo -fmodule-map-file=%t/module.map
+// RUN: %clang_cc1 -E -fmodules %s -fmodule-file=%t/if.pcm -verify -fmodule-name=foo -fmodule-map-file=%t/module.map -fmodules-local-submodule-visibility -DLOCAL_VIS
// Just checking the syntax here; the semantics are tested elsewhere.
#pragma clang module import // expected-error {{expected module name}}
diff --git a/src/llvm-project/clang/test/Preprocessor/predefined-arch-macros.c b/src/llvm-project/clang/test/Preprocessor/predefined-arch-macros.c
index 4b3f233..ab36e98 100644
--- a/src/llvm-project/clang/test/Preprocessor/predefined-arch-macros.c
+++ b/src/llvm-project/clang/test/Preprocessor/predefined-arch-macros.c
@@ -184,6 +184,7 @@
// RUN: %clang -march=pentium2 -m32 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_PENTIUM2_M32
+// CHECK_PENTIUM2_M32: #define __FXSR__ 1
// CHECK_PENTIUM2_M32: #define __MMX__ 1
// CHECK_PENTIUM2_M32: #define __i386 1
// CHECK_PENTIUM2_M32: #define __i386__ 1
@@ -682,7 +683,6 @@
// CHECK_SKL_M32: #define __LZCNT__ 1
// CHECK_SKL_M32: #define __MMX__ 1
// CHECK_SKL_M32: #define __MOVBE__ 1
-// CHECK_SKL_M32: #define __MPX__ 1
// CHECK_SKL_M32: #define __PCLMUL__ 1
// CHECK_SKL_M32: #define __POPCNT__ 1
// CHECK_SKL_M32: #define __PRFCHW__ 1
@@ -717,7 +717,6 @@
// CHECK_SKL_M64: #define __LZCNT__ 1
// CHECK_SKL_M64: #define __MMX__ 1
// CHECK_SKL_M64: #define __MOVBE__ 1
-// CHECK_SKL_M64: #define __MPX__ 1
// CHECK_SKL_M64: #define __PCLMUL__ 1
// CHECK_SKL_M64: #define __POPCNT__ 1
// CHECK_SKL_M64: #define __PRFCHW__ 1
@@ -912,7 +911,6 @@
// CHECK_SKX_M32: #define __LZCNT__ 1
// CHECK_SKX_M32: #define __MMX__ 1
// CHECK_SKX_M32: #define __MOVBE__ 1
-// CHECK_SKX_M32: #define __MPX__ 1
// CHECK_SKX_M32: #define __PCLMUL__ 1
// CHECK_SKX_M32: #define __PKU__ 1
// CHECK_SKX_M32: #define __POPCNT__ 1
@@ -958,7 +956,6 @@
// CHECK_SKX_M64: #define __LZCNT__ 1
// CHECK_SKX_M64: #define __MMX__ 1
// CHECK_SKX_M64: #define __MOVBE__ 1
-// CHECK_SKX_M64: #define __MPX__ 1
// CHECK_SKX_M64: #define __PCLMUL__ 1
// CHECK_SKX_M64: #define __PKU__ 1
// CHECK_SKX_M64: #define __POPCNT__ 1
@@ -1008,7 +1005,6 @@
// CHECK_CLX_M32: #define __LZCNT__ 1
// CHECK_CLX_M32: #define __MMX__ 1
// CHECK_CLX_M32: #define __MOVBE__ 1
-// CHECK_CLX_M32: #define __MPX__ 1
// CHECK_CLX_M32: #define __PCLMUL__ 1
// CHECK_CLX_M32: #define __PKU__ 1
// CHECK_CLX_M32: #define __POPCNT__ 1
@@ -1055,7 +1051,6 @@
// CHECK_CLX_M64: #define __LZCNT__ 1
// CHECK_CLX_M64: #define __MMX__ 1
// CHECK_CLX_M64: #define __MOVBE__ 1
-// CHECK_CLX_M64: #define __MPX__ 1
// CHECK_CLX_M64: #define __PCLMUL__ 1
// CHECK_CLX_M64: #define __PKU__ 1
// CHECK_CLX_M64: #define __POPCNT__ 1
@@ -1106,7 +1101,6 @@
// CHECK_CPX_M32: #define __LZCNT__ 1
// CHECK_CPX_M32: #define __MMX__ 1
// CHECK_CPX_M32: #define __MOVBE__ 1
-// CHECK_CPX_M32: #define __MPX__ 1
// CHECK_CPX_M32: #define __PCLMUL__ 1
// CHECK_CPX_M32: #define __PKU__ 1
// CHECK_CPX_M32: #define __POPCNT__ 1
@@ -1154,7 +1148,6 @@
// CHECK_CPX_M64: #define __LZCNT__ 1
// CHECK_CPX_M64: #define __MMX__ 1
// CHECK_CPX_M64: #define __MOVBE__ 1
-// CHECK_CPX_M64: #define __MPX__ 1
// CHECK_CPX_M64: #define __PCLMUL__ 1
// CHECK_CPX_M64: #define __PKU__ 1
// CHECK_CPX_M64: #define __POPCNT__ 1
@@ -1205,7 +1198,6 @@
// CHECK_CNL_M32: #define __LZCNT__ 1
// CHECK_CNL_M32: #define __MMX__ 1
// CHECK_CNL_M32: #define __MOVBE__ 1
-// CHECK_CNL_M32: #define __MPX__ 1
// CHECK_CNL_M32: #define __PCLMUL__ 1
// CHECK_CNL_M32: #define __PKU__ 1
// CHECK_CNL_M32: #define __POPCNT__ 1
@@ -1254,7 +1246,6 @@
// CHECK_CNL_M64: #define __LZCNT__ 1
// CHECK_CNL_M64: #define __MMX__ 1
// CHECK_CNL_M64: #define __MOVBE__ 1
-// CHECK_CNL_M64: #define __MPX__ 1
// CHECK_CNL_M64: #define __PCLMUL__ 1
// CHECK_CNL_M64: #define __PKU__ 1
// CHECK_CNL_M64: #define __POPCNT__ 1
@@ -1309,7 +1300,6 @@
// CHECK_ICL_M32: #define __LZCNT__ 1
// CHECK_ICL_M32: #define __MMX__ 1
// CHECK_ICL_M32: #define __MOVBE__ 1
-// CHECK_ICL_M32: #define __MPX__ 1
// CHECK_ICL_M32: #define __PCLMUL__ 1
// CHECK_ICL_M32: #define __PKU__ 1
// CHECK_ICL_M32: #define __POPCNT__ 1
@@ -1367,7 +1357,6 @@
// CHECK_ICL_M64: #define __LZCNT__ 1
// CHECK_ICL_M64: #define __MMX__ 1
// CHECK_ICL_M64: #define __MOVBE__ 1
-// CHECK_ICL_M64: #define __MPX__ 1
// CHECK_ICL_M64: #define __PCLMUL__ 1
// CHECK_ICL_M64: #define __PKU__ 1
// CHECK_ICL_M64: #define __POPCNT__ 1
@@ -1426,7 +1415,6 @@
// CHECK_ICX_M32: #define __LZCNT__ 1
// CHECK_ICX_M32: #define __MMX__ 1
// CHECK_ICX_M32: #define __MOVBE__ 1
-// CHECK_ICX_M32: #define __MPX__ 1
// CHECK_ICX_M32: #define __PCLMUL__ 1
// CHECK_ICX_M32: #define __PCONFIG__ 1
// CHECK_ICX_M32: #define __PKU__ 1
@@ -1485,7 +1473,6 @@
// CHECK_ICX_M64: #define __LZCNT__ 1
// CHECK_ICX_M64: #define __MMX__ 1
// CHECK_ICX_M64: #define __MOVBE__ 1
-// CHECK_ICX_M64: #define __MPX__ 1
// CHECK_ICX_M64: #define __PCLMUL__ 1
// CHECK_ICX_M64: #define __PCONFIG__ 1
// CHECK_ICX_M64: #define __PKU__ 1
@@ -1517,6 +1504,131 @@
// CHECK_ICX_M64: #define __x86_64 1
// CHECK_ICX_M64: #define __x86_64__ 1
+// RUN: %clang -march=tigerlake -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
+// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_TGL_M32
+// CHECK_TGL_M32: #define __AES__ 1
+// CHECK_TGL_M32: #define __AVX2__ 1
+// CHECK_TGL_M32: #define __AVX512BITALG__ 1
+// CHECK_TGL_M32: #define __AVX512BW__ 1
+// CHECK_TGL_M32: #define __AVX512CD__ 1
+// CHECK_TGL_M32: #define __AVX512DQ__ 1
+// CHECK_TGL_M32: #define __AVX512F__ 1
+// CHECK_TGL_M32: #define __AVX512IFMA__ 1
+// CHECK_TGL_M32: #define __AVX512VBMI2__ 1
+// CHECK_TGL_M32: #define __AVX512VBMI__ 1
+// CHECK_TGL_M32: #define __AVX512VL__ 1
+// CHECK_TGL_M32: #define __AVX512VNNI__ 1
+// CHECK_TGL_M32: #define __AVX512VP2INTERSECT__ 1
+// CHECK_TGL_M32: #define __AVX512VPOPCNTDQ__ 1
+// CHECK_TGL_M32: #define __AVX__ 1
+// CHECK_TGL_M32: #define __BMI2__ 1
+// CHECK_TGL_M32: #define __BMI__ 1
+// CHECK_TGL_M32: #define __CLFLUSHOPT__ 1
+// CHECK_TGL_M32: #define __CLWB__ 1
+// CHECK_TGL_M32: #define __F16C__ 1
+// CHECK_TGL_M32: #define __FMA__ 1
+// CHECK_TGL_M32: #define __GFNI__ 1
+// CHECK_TGL_M32: #define __INVPCID__ 1
+// CHECK_TGL_M32: #define __LZCNT__ 1
+// CHECK_TGL_M32: #define __MMX__ 1
+// CHECK_TGL_M32: #define __MOVBE__ 1
+// CHECK_TGL_M32: #define __MOVDIR64B__ 1
+// CHECK_TGL_M32: #define __MOVDIRI__ 1
+// CHECK_TGL_M32: #define __PCLMUL__ 1
+// CHECK_TGL_M32-NOT: #define __PCONFIG__ 1
+// CHECK_TGL_M32: #define __PKU__ 1
+// CHECK_TGL_M32: #define __POPCNT__ 1
+// CHECK_TGL_M32: #define __PRFCHW__ 1
+// CHECK_TGL_M32: #define __RDPID__ 1
+// CHECK_TGL_M32: #define __RDRND__ 1
+// CHECK_TGL_M32: #define __RDSEED__ 1
+// CHECK_TGL_M32: #define __SGX__ 1
+// CHECK_TGL_M32: #define __SHA__ 1
+// CHECK_TGL_M32: #define __SHSTK__ 1
+// CHECK_TGL_M32: #define __SSE2__ 1
+// CHECK_TGL_M32: #define __SSE3__ 1
+// CHECK_TGL_M32: #define __SSE4_1__ 1
+// CHECK_TGL_M32: #define __SSE4_2__ 1
+// CHECK_TGL_M32: #define __SSE__ 1
+// CHECK_TGL_M32: #define __SSSE3__ 1
+// CHECK_TGL_M32: #define __VAES__ 1
+// CHECK_TGL_M32: #define __VPCLMULQDQ__ 1
+// CHECK_TGL_M32-NOT: #define __WBNOINVD__ 1
+// CHECK_TGL_M32: #define __XSAVEC__ 1
+// CHECK_TGL_M32: #define __XSAVEOPT__ 1
+// CHECK_TGL_M32: #define __XSAVES__ 1
+// CHECK_TGL_M32: #define __XSAVE__ 1
+// CHECK_TGL_M32: #define __corei7 1
+// CHECK_TGL_M32: #define __corei7__ 1
+// CHECK_TGL_M32: #define __i386 1
+// CHECK_TGL_M32: #define __i386__ 1
+// CHECK_TGL_M32: #define __tune_corei7__ 1
+// CHECK_TGL_M32: #define i386 1
+
+// RUN: %clang -march=tigerlake -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
+// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_TGL_M64
+// CHECK_TGL_M64: #define __AES__ 1
+// CHECK_TGL_M64: #define __AVX2__ 1
+// CHECK_TGL_M64: #define __AVX512BITALG__ 1
+// CHECK_TGL_M64: #define __AVX512BW__ 1
+// CHECK_TGL_M64: #define __AVX512CD__ 1
+// CHECK_TGL_M64: #define __AVX512DQ__ 1
+// CHECK_TGL_M64: #define __AVX512F__ 1
+// CHECK_TGL_M64: #define __AVX512IFMA__ 1
+// CHECK_TGL_M64: #define __AVX512VBMI2__ 1
+// CHECK_TGL_M64: #define __AVX512VBMI__ 1
+// CHECK_TGL_M64: #define __AVX512VL__ 1
+// CHECK_TGL_M64: #define __AVX512VNNI__ 1
+// CHECK_TGL_M64: #define __AVX512VP2INTERSECT__ 1
+// CHECK_TGL_M64: #define __AVX512VPOPCNTDQ__ 1
+// CHECK_TGL_M64: #define __AVX__ 1
+// CHECK_TGL_M64: #define __BMI2__ 1
+// CHECK_TGL_M64: #define __BMI__ 1
+// CHECK_TGL_M64: #define __CLFLUSHOPT__ 1
+// CHECK_TGL_M64: #define __CLWB__ 1
+// CHECK_TGL_M64: #define __F16C__ 1
+// CHECK_TGL_M64: #define __FMA__ 1
+// CHECK_TGL_M64: #define __GFNI__ 1
+// CHECK_TGL_M64: #define __INVPCID__ 1
+// CHECK_TGL_M64: #define __LZCNT__ 1
+// CHECK_TGL_M64: #define __MMX__ 1
+// CHECK_TGL_M64: #define __MOVBE__ 1
+// CHECK_TGL_M64: #define __MOVDIR64B__ 1
+// CHECK_TGL_M64: #define __MOVDIRI__ 1
+// CHECK_TGL_M64: #define __PCLMUL__ 1
+// CHECK_TGL_M64-NOT: #define __PCONFIG__ 1
+// CHECK_TGL_M64: #define __PKU__ 1
+// CHECK_TGL_M64: #define __POPCNT__ 1
+// CHECK_TGL_M64: #define __PRFCHW__ 1
+// CHECK_TGL_M64: #define __RDPID__ 1
+// CHECK_TGL_M64: #define __RDRND__ 1
+// CHECK_TGL_M64: #define __RDSEED__ 1
+// CHECK_TGL_M64: #define __SGX__ 1
+// CHECK_TGL_M64: #define __SHA__ 1
+// CHECK_TGL_M64: #define __SHSTK__ 1
+// CHECK_TGL_M64: #define __SSE2__ 1
+// CHECK_TGL_M64: #define __SSE3__ 1
+// CHECK_TGL_M64: #define __SSE4_1__ 1
+// CHECK_TGL_M64: #define __SSE4_2__ 1
+// CHECK_TGL_M64: #define __SSE__ 1
+// CHECK_TGL_M64: #define __SSSE3__ 1
+// CHECK_TGL_M64: #define __VAES__ 1
+// CHECK_TGL_M64: #define __VPCLMULQDQ__ 1
+// CHECK_TGL_M64-NOT: #define __WBNOINVD__ 1
+// CHECK_TGL_M64: #define __XSAVEC__ 1
+// CHECK_TGL_M64: #define __XSAVEOPT__ 1
+// CHECK_TGL_M64: #define __XSAVES__ 1
+// CHECK_TGL_M64: #define __XSAVE__ 1
+// CHECK_TGL_M64: #define __amd64 1
+// CHECK_TGL_M64: #define __amd64__ 1
+// CHECK_TGL_M64: #define __corei7 1
+// CHECK_TGL_M64: #define __corei7__ 1
+// CHECK_TGL_M64: #define __tune_corei7__ 1
+// CHECK_TGL_M64: #define __x86_64 1
+// CHECK_TGL_M64: #define __x86_64__ 1
+
// RUN: %clang -march=atom -m32 -E -dM %s -o - 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_ATOM_M32
@@ -1561,7 +1673,6 @@
// CHECK_GLM_M32: #define __FXSR__ 1
// CHECK_GLM_M32: #define __MMX__ 1
// CHECK_GLM_M32: #define __MOVBE__ 1
-// CHECK_GLM_M32: #define __MPX__ 1
// CHECK_GLM_M32: #define __PCLMUL__ 1
// CHECK_GLM_M32: #define __POPCNT__ 1
// CHECK_GLM_M32: #define __PRFCHW__ 1
@@ -1595,7 +1706,6 @@
// CHECK_GLM_M64: #define __FXSR__ 1
// CHECK_GLM_M64: #define __MMX__ 1
// CHECK_GLM_M64: #define __MOVBE__ 1
-// CHECK_GLM_M64: #define __MPX__ 1
// CHECK_GLM_M64: #define __PCLMUL__ 1
// CHECK_GLM_M64: #define __POPCNT__ 1
// CHECK_GLM_M64: #define __PRFCHW__ 1
@@ -1627,7 +1737,6 @@
// CHECK_GLMP_M32: #define __FXSR__ 1
// CHECK_GLMP_M32: #define __MMX__ 1
// CHECK_GLMP_M32: #define __MOVBE__ 1
-// CHECK_GLMP_M32: #define __MPX__ 1
// CHECK_GLMP_M32: #define __PCLMUL__ 1
// CHECK_GLMP_M32: #define __POPCNT__ 1
// CHECK_GLMP_M32: #define __PRFCHW__ 1
@@ -1664,7 +1773,6 @@
// CHECK_GLMP_M64: #define __FXSR__ 1
// CHECK_GLMP_M64: #define __MMX__ 1
// CHECK_GLMP_M64: #define __MOVBE__ 1
-// CHECK_GLMP_M64: #define __MPX__ 1
// CHECK_GLMP_M64: #define __PCLMUL__ 1
// CHECK_GLMP_M64: #define __POPCNT__ 1
// CHECK_GLMP_M64: #define __PRFCHW__ 1
@@ -1703,7 +1811,6 @@
// CHECK_TRM_M32: #define __MOVBE__ 1
// CHECK_TRM_M32: #define __MOVDIR64B__ 1
// CHECK_TRM_M32: #define __MOVDIRI__ 1
-// CHECK_TRM_M32: #define __MPX__ 1
// CHECK_TRM_M32: #define __PCLMUL__ 1
// CHECK_TRM_M32: #define __POPCNT__ 1
// CHECK_TRM_M32: #define __PRFCHW__ 1
@@ -1745,7 +1852,6 @@
// CHECK_TRM_M64: #define __MOVBE__ 1
// CHECK_TRM_M64: #define __MOVDIR64B__ 1
// CHECK_TRM_M64: #define __MOVDIRI__ 1
-// CHECK_TRM_M64: #define __MPX__ 1
// CHECK_TRM_M64: #define __PCLMUL__ 1
// CHECK_TRM_M64: #define __POPCNT__ 1
// CHECK_TRM_M64: #define __PRFCHW__ 1
@@ -3137,6 +3243,9 @@
// RUN: %clang -march=arch13 -E -dM %s -o - 2>&1 \
// RUN: -target s390x-unknown-linux \
// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SYSTEMZ_ARCH13
+// RUN: %clang -march=z15 -E -dM %s -o - 2>&1 \
+// RUN: -target s390x-unknown-linux \
+// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SYSTEMZ_ARCH13
// CHECK_SYSTEMZ_ARCH13: #define __ARCH__ 13
// CHECK_SYSTEMZ_ARCH13: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
// CHECK_SYSTEMZ_ARCH13: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1
diff --git a/src/llvm-project/clang/test/Preprocessor/predefined-win-macros.c b/src/llvm-project/clang/test/Preprocessor/predefined-win-macros.c
index 6034c08..928ca6f 100644
--- a/src/llvm-project/clang/test/Preprocessor/predefined-win-macros.c
+++ b/src/llvm-project/clang/test/Preprocessor/predefined-win-macros.c
@@ -47,7 +47,7 @@
// RUN: %clang_cc1 %s -x c++ -E -dM -triple i686-pc-win32 -fms-extensions -fms-compatibility \
// RUN: -fms-compatibility-version=19.00 -std=c++2a -o - | FileCheck -match-full-lines %s --check-prefix=CHECK-MS-CPP2A
// CHECK-MS-CPP2A: #define _MSC_VER 1900
-// CHECK-MS-CPP2A: #define _MSVC_LANG 201704L
+// CHECK-MS-CPP2A: #define _MSVC_LANG 201705L
// RUN: %clang_cc1 -triple i386-windows %s -E -dM -o - \
// RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-X86-WIN
diff --git a/src/llvm-project/clang/test/Preprocessor/riscv-cmodel.c b/src/llvm-project/clang/test/Preprocessor/riscv-cmodel.c
new file mode 100644
index 0000000..c0b85eb
--- /dev/null
+++ b/src/llvm-project/clang/test/Preprocessor/riscv-cmodel.c
@@ -0,0 +1,30 @@
+// RUN: %clang -target riscv32-unknown-linux-gnu -march=rv32i -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-MEDLOW %s
+// RUN: %clang -target riscv64-unknown-linux-gnu -march=rv64i -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-MEDLOW %s
+
+// RUN: %clang -target riscv32-unknown-linux-gnu -march=rv32i -x c -E -dM %s \
+// RUN: -mcmodel=small -o - | FileCheck --check-prefix=CHECK-MEDLOW %s
+// RUN: %clang -target riscv64-unknown-linux-gnu -march=rv64i -x c -E -dM %s \
+// RUN: -mcmodel=small -o - | FileCheck --check-prefix=CHECK-MEDLOW %s
+
+// RUN: %clang -target riscv32-unknown-linux-gnu -march=rv32i -x c -E -dM %s \
+// RUN: -mcmodel=medlow -o - | FileCheck --check-prefix=CHECK-MEDLOW %s
+// RUN: %clang -target riscv64-unknown-linux-gnu -march=rv64i -x c -E -dM %s \
+// RUN: -mcmodel=medlow -o - | FileCheck --check-prefix=CHECK-MEDLOW %s
+
+// CHECK-MEDLOW: #define __riscv_cmodel_medlow 1
+// CHECK-MEDLOW-NOT: __riscv_cmodel_medany
+
+// RUN: %clang -target riscv32-unknown-linux-gnu -march=rv32i -x c -E -dM %s \
+// RUN: -mcmodel=medium -o - | FileCheck --check-prefix=CHECK-MEDANY %s
+// RUN: %clang -target riscv64-unknown-linux-gnu -march=rv64i -x c -E -dM %s \
+// RUN: -mcmodel=medium -o - | FileCheck --check-prefix=CHECK-MEDANY %s
+
+// RUN: %clang -target riscv32-unknown-linux-gnu -march=rv32i -x c -E -dM %s \
+// RUN: -mcmodel=medany -o - | FileCheck --check-prefix=CHECK-MEDANY %s
+// RUN: %clang -target riscv64-unknown-linux-gnu -march=rv64i -x c -E -dM %s \
+// RUN: -mcmodel=medany -o - | FileCheck --check-prefix=CHECK-MEDANY %s
+
+// CHECK-MEDANY: #define __riscv_cmodel_medany 1
+// CHECK-MEDANY-NOT: __riscv_cmodel_medlow
diff --git a/src/llvm-project/clang/test/Preprocessor/riscv-target-features.c b/src/llvm-project/clang/test/Preprocessor/riscv-target-features.c
index 36e49c3..a93d7e6 100644
--- a/src/llvm-project/clang/test/Preprocessor/riscv-target-features.c
+++ b/src/llvm-project/clang/test/Preprocessor/riscv-target-features.c
@@ -48,9 +48,9 @@
// RUN: -o - | FileCheck --check-prefix=CHECK-C-EXT %s
// CHECK-C-EXT: __riscv_compressed 1
-// RUN: %clang -target riscv32-unknown-linux-gnu -march=rv32ifd -x c -E -dM %s \
+// RUN: %clang -target riscv32-unknown-linux-gnu -march=rv32ifd -mabi=ilp32 -x c -E -dM %s \
// RUN: -o - | FileCheck --check-prefix=CHECK-SOFT %s
-// RUN: %clang -target riscv64-unknown-linux-gnu -march=rv64ifd -x c -E -dM %s \
+// RUN: %clang -target riscv64-unknown-linux-gnu -march=rv64ifd -mabi=lp64 -x c -E -dM %s \
// RUN: -o - | FileCheck --check-prefix=CHECK-SOFT %s
// CHECK-SOFT: __riscv_float_abi_soft 1
// CHECK-SOFT-NOT: __riscv_float_abi_single
@@ -64,9 +64,9 @@
// CHECK-SINGLE-NOT: __riscv_float_abi_soft
// CHECK-SINGLE-NOT: __riscv_float_abi_double
-// RUN: %clang -target riscv32-unknown-linux-gnu -march=rv32ifd -mabi=ilp32d -x c -E -dM %s \
+// RUN: %clang -target riscv32-unknown-linux-gnu -march=rv32ifd -x c -E -dM %s \
// RUN: -o - | FileCheck --check-prefix=CHECK-DOUBLE %s
-// RUN: %clang -target riscv64-unknown-linux-gnu -march=rv64ifd -mabi=lp64d -x c -E -dM %s \
+// RUN: %clang -target riscv64-unknown-linux-gnu -march=rv64ifd -x c -E -dM %s \
// RUN: -o - | FileCheck --check-prefix=CHECK-DOUBLE %s
// CHECK-DOUBLE: __riscv_float_abi_double 1
// CHECK-DOUBLE-NOT: __riscv_float_abi_soft
diff --git a/src/llvm-project/clang/test/Preprocessor/stdint.c b/src/llvm-project/clang/test/Preprocessor/stdint.c
index fc179b4..7cb33ed 100644
--- a/src/llvm-project/clang/test/Preprocessor/stdint.c
+++ b/src/llvm-project/clang/test/Preprocessor/stdint.c
@@ -105,6 +105,113 @@
// ARM:INTMAX_C_(0) 0LL
// ARM:UINTMAX_C_(0) 0ULL
//
+// RUN: %clang_cc1 -E -ffreestanding -triple=arm64_32-apple-ios7.0 %s | FileCheck -check-prefix ARM64_32 %s
+//
+// ARM64_32:typedef long long int int64_t;
+// ARM64_32:typedef long long unsigned int uint64_t;
+// ARM64_32:typedef int64_t int_least64_t;
+// ARM64_32:typedef uint64_t uint_least64_t;
+// ARM64_32:typedef int64_t int_fast64_t;
+// ARM64_32:typedef uint64_t uint_fast64_t;
+//
+// ARM64_32:typedef int int32_t;
+// ARM64_32:typedef unsigned int uint32_t;
+// ARM64_32:typedef int32_t int_least32_t;
+// ARM64_32:typedef uint32_t uint_least32_t;
+// ARM64_32:typedef int32_t int_fast32_t;
+// ARM64_32:typedef uint32_t uint_fast32_t;
+//
+// ARM64_32:typedef short int16_t;
+// ARM64_32:typedef unsigned short uint16_t;
+// ARM64_32:typedef int16_t int_least16_t;
+// ARM64_32:typedef uint16_t uint_least16_t;
+// ARM64_32:typedef int16_t int_fast16_t;
+// ARM64_32:typedef uint16_t uint_fast16_t;
+//
+// ARM64_32:typedef signed char int8_t;
+// ARM64_32:typedef unsigned char uint8_t;
+// ARM64_32:typedef int8_t int_least8_t;
+// ARM64_32:typedef uint8_t uint_least8_t;
+// ARM64_32:typedef int8_t int_fast8_t;
+// ARM64_32:typedef uint8_t uint_fast8_t;
+//
+// ARM64_32:typedef long int intptr_t;
+// ARM64_32:typedef long unsigned int uintptr_t;
+//
+// ARM64_32:typedef long long int intmax_t;
+// ARM64_32:typedef long long unsigned int uintmax_t;
+//
+// ARM64_32:INT8_MAX_ 127
+// ARM64_32:INT8_MIN_ (-127 -1)
+// ARM64_32:UINT8_MAX_ 255
+// ARM64_32:INT_LEAST8_MIN_ (-127 -1)
+// ARM64_32:INT_LEAST8_MAX_ 127
+// ARM64_32:UINT_LEAST8_MAX_ 255
+// ARM64_32:INT_FAST8_MIN_ (-127 -1)
+// ARM64_32:INT_FAST8_MAX_ 127
+// ARM64_32:UINT_FAST8_MAX_ 255
+//
+// ARM64_32:INT16_MAX_ 32767
+// ARM64_32:INT16_MIN_ (-32767 -1)
+// ARM64_32:UINT16_MAX_ 65535
+// ARM64_32:INT_LEAST16_MIN_ (-32767 -1)
+// ARM64_32:INT_LEAST16_MAX_ 32767
+// ARM64_32:UINT_LEAST16_MAX_ 65535
+// ARM64_32:INT_FAST16_MIN_ (-32767 -1)
+// ARM64_32:INT_FAST16_MAX_ 32767
+// ARM64_32:UINT_FAST16_MAX_ 65535
+//
+// ARM64_32:INT32_MAX_ 2147483647
+// ARM64_32:INT32_MIN_ (-2147483647 -1)
+// ARM64_32:UINT32_MAX_ 4294967295U
+// ARM64_32:INT_LEAST32_MIN_ (-2147483647 -1)
+// ARM64_32:INT_LEAST32_MAX_ 2147483647
+// ARM64_32:UINT_LEAST32_MAX_ 4294967295U
+// ARM64_32:INT_FAST32_MIN_ (-2147483647 -1)
+// ARM64_32:INT_FAST32_MAX_ 2147483647
+// ARM64_32:UINT_FAST32_MAX_ 4294967295U
+//
+// ARM64_32:INT64_MAX_ 9223372036854775807LL
+// ARM64_32:INT64_MIN_ (-9223372036854775807LL -1)
+// ARM64_32:UINT64_MAX_ 18446744073709551615ULL
+// ARM64_32:INT_LEAST64_MIN_ (-9223372036854775807LL -1)
+// ARM64_32:INT_LEAST64_MAX_ 9223372036854775807LL
+// ARM64_32:UINT_LEAST64_MAX_ 18446744073709551615ULL
+// ARM64_32:INT_FAST64_MIN_ (-9223372036854775807LL -1)
+// ARM64_32:INT_FAST64_MAX_ 9223372036854775807LL
+// ARM64_32:UINT_FAST64_MAX_ 18446744073709551615ULL
+//
+// ARM64_32:INTPTR_MIN_ (-2147483647L -1)
+// ARM64_32:INTPTR_MAX_ 2147483647L
+// ARM64_32:UINTPTR_MAX_ 4294967295UL
+// ARM64_32:PTRDIFF_MIN_ (-2147483647L -1)
+// ARM64_32:PTRDIFF_MAX_ 2147483647L
+// ARM64_32:SIZE_MAX_ 4294967295UL
+//
+// ARM64_32:INTMAX_MIN_ (-9223372036854775807LL -1)
+// ARM64_32:INTMAX_MAX_ 9223372036854775807LL
+// ARM64_32:UINTMAX_MAX_ 18446744073709551615ULL
+//
+// ARM64_32:SIG_ATOMIC_MIN_ (-2147483647 -1)
+// ARM64_32:SIG_ATOMIC_MAX_ 2147483647
+// ARM64_32:WINT_MIN_ (-2147483647 -1)
+// ARM64_32:WINT_MAX_ 2147483647
+//
+// ARM64_32:WCHAR_MAX_ 2147483647
+// ARM64_32:WCHAR_MIN_ (-2147483647 -1)
+//
+// ARM64_32:INT8_C_(0) 0
+// ARM64_32:UINT8_C_(0) 0U
+// ARM64_32:INT16_C_(0) 0
+// ARM64_32:UINT16_C_(0) 0U
+// ARM64_32:INT32_C_(0) 0
+// ARM64_32:UINT32_C_(0) 0U
+// ARM64_32:INT64_C_(0) 0LL
+// ARM64_32:UINT64_C_(0) 0ULL
+//
+// ARM64_32:INTMAX_C_(0) 0LL
+// ARM64_32:UINTMAX_C_(0) 0ULL
+
//
// RUN: %clang_cc1 -E -ffreestanding -triple=i386-none-none %s | FileCheck -check-prefix I386 %s
//
diff --git a/src/llvm-project/clang/test/Preprocessor/ucn-pp-identifier.c b/src/llvm-project/clang/test/Preprocessor/ucn-pp-identifier.c
index f045e38..0929412 100644
--- a/src/llvm-project/clang/test/Preprocessor/ucn-pp-identifier.c
+++ b/src/llvm-project/clang/test/Preprocessor/ucn-pp-identifier.c
@@ -28,8 +28,7 @@
#define \U10000000 // expected-error {{macro name must be an identifier}}
#define \u0061 // expected-error {{character 'a' cannot be specified by a universal character name}} expected-error {{macro name must be an identifier}}
-// FIXME: Not clear what our behavior should be here; \u0024 is "$".
-#define a\u0024 // expected-warning {{whitespace}}
+#define a\u0024
#if \u0110 // expected-warning {{is not defined, evaluates to 0}}
#endif
diff --git a/src/llvm-project/clang/test/Preprocessor/x86_target_features.c b/src/llvm-project/clang/test/Preprocessor/x86_target_features.c
index 290ce3b..8d55c5d 100644
--- a/src/llvm-project/clang/test/Preprocessor/x86_target_features.c
+++ b/src/llvm-project/clang/test/Preprocessor/x86_target_features.c
@@ -269,18 +269,26 @@
// NOSSE42POPCNT: #define __POPCNT__ 1
-// RUN: %clang -target i386-unknown-unknown -march=atom -msse -x c -E -dM -o - %s | FileCheck -match-full-lines --check-prefix=SSEMMX %s
+// RUN: %clang -target i386-unknown-unknown -march=pentium -msse -x c -E -dM -o - %s | FileCheck -match-full-lines --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 -match-full-lines --check-prefix=SSENOSSEMMX %s
+// RUN: %clang -target i386-unknown-unknown -march=pentium -msse -mno-sse -x c -E -dM -o - %s | FileCheck -match-full-lines --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 -match-full-lines --check-prefix=SSENOMMX %s
+// RUN: %clang -target i386-unknown-unknown -march=pentium -msse -mno-mmx -x c -E -dM -o - %s | FileCheck -match-full-lines --check-prefix=SSENOMMX %s
// SSENOMMX-NOT: #define __MMX__ 1
+// RUN: %clang -target i386-unknown-unknown -march=pentium3 -mno-sse -x c -E -dM -o - %s | FileCheck -match-full-lines --check-prefix=MARCHMMXNOSSE %s
+// RUN: %clang -target i386-unknown-unknown -march=atom -mno-sse -x c -E -dM -o - %s | FileCheck -match-full-lines --check-prefix=MARCHMMXNOSSE %s
+// RUN: %clang -target i386-unknown-unknown -march=knl -mno-sse -x c -E -dM -o - %s | FileCheck -match-full-lines --check-prefix=MARCHMMXNOSSE %s
+// RUN: %clang -target i386-unknown-unknown -march=btver1 -mno-sse -x c -E -dM -o - %s | FileCheck -match-full-lines --check-prefix=MARCHMMXNOSSE %s
+// RUN: %clang -target i386-unknown-unknown -march=znver1 -mno-sse -x c -E -dM -o - %s | FileCheck -match-full-lines --check-prefix=MARCHMMXNOSSE %s
+
+// MARCHMMXNOSSE: #define __MMX__ 1
+
// RUN: %clang -target i386-unknown-unknown -march=atom -mf16c -x c -E -dM -o - %s | FileCheck -match-full-lines --check-prefix=F16C %s
// F16C: #define __AVX__ 1
diff --git a/src/llvm-project/clang/test/Profile/Inputs/gcc-flag-compatibility_IR.proftext b/src/llvm-project/clang/test/Profile/Inputs/gcc-flag-compatibility_IR.proftext
new file mode 100644
index 0000000..64d1811
--- /dev/null
+++ b/src/llvm-project/clang/test/Profile/Inputs/gcc-flag-compatibility_IR.proftext
@@ -0,0 +1,11 @@
+# IR level Instrumentation Flag
+:ir
+main
+# Func Hash:
+34137660316
+# Num Counters:
+2
+# Counter Values:
+100
+1
+
diff --git a/src/llvm-project/clang/test/Profile/Inputs/misexpect-branch-nonconst-expect-arg.proftext b/src/llvm-project/clang/test/Profile/Inputs/misexpect-branch-nonconst-expect-arg.proftext
new file mode 100644
index 0000000..a99351c
--- /dev/null
+++ b/src/llvm-project/clang/test/Profile/Inputs/misexpect-branch-nonconst-expect-arg.proftext
@@ -0,0 +1,9 @@
+bar
+# Func Hash:
+11262309464
+# Num Counters:
+2
+# Counter Values:
+200000
+2
+
diff --git a/src/llvm-project/clang/test/Profile/Inputs/misexpect-branch.proftext b/src/llvm-project/clang/test/Profile/Inputs/misexpect-branch.proftext
new file mode 100644
index 0000000..b809c14
--- /dev/null
+++ b/src/llvm-project/clang/test/Profile/Inputs/misexpect-branch.proftext
@@ -0,0 +1,9 @@
+bar
+# Func Hash:
+45795613684824
+# Num Counters:
+2
+# Counter Values:
+200000
+0
+
diff --git a/src/llvm-project/clang/test/Profile/Inputs/misexpect-switch-default-only.proftext b/src/llvm-project/clang/test/Profile/Inputs/misexpect-switch-default-only.proftext
new file mode 100644
index 0000000..ac59378
--- /dev/null
+++ b/src/llvm-project/clang/test/Profile/Inputs/misexpect-switch-default-only.proftext
@@ -0,0 +1,12 @@
+main
+# Func Hash:
+79676873694057560
+# Num Counters:
+5
+# Counter Values:
+1
+20
+20000
+20000
+20000
+
diff --git a/src/llvm-project/clang/test/Profile/Inputs/misexpect-switch-default.proftext b/src/llvm-project/clang/test/Profile/Inputs/misexpect-switch-default.proftext
new file mode 100644
index 0000000..7b2d597
--- /dev/null
+++ b/src/llvm-project/clang/test/Profile/Inputs/misexpect-switch-default.proftext
@@ -0,0 +1,16 @@
+main
+# Func Hash:
+8712453512413296413
+# Num Counters:
+9
+# Counter Values:
+1
+20000
+20000
+4066
+11889
+0
+0
+4045
+0
+
diff --git a/src/llvm-project/clang/test/Profile/Inputs/misexpect-switch-nonconst.proftext b/src/llvm-project/clang/test/Profile/Inputs/misexpect-switch-nonconst.proftext
new file mode 100644
index 0000000..52b7b70
--- /dev/null
+++ b/src/llvm-project/clang/test/Profile/Inputs/misexpect-switch-nonconst.proftext
@@ -0,0 +1,17 @@
+main
+# Func Hash:
+1965403898329309329
+# Num Counters:
+10
+# Counter Values:
+1
+20
+20000
+20000
+1
+0
+0
+0
+19999
+0
+
diff --git a/src/llvm-project/clang/test/Profile/Inputs/misexpect-switch.proftext b/src/llvm-project/clang/test/Profile/Inputs/misexpect-switch.proftext
new file mode 100644
index 0000000..ce4c96b
--- /dev/null
+++ b/src/llvm-project/clang/test/Profile/Inputs/misexpect-switch.proftext
@@ -0,0 +1,16 @@
+main
+# Func Hash:
+1965403898329309329
+# Num Counters:
+9
+# Counter Values:
+1
+20
+20000
+20000
+12
+26
+0
+0
+19962
+
diff --git a/src/llvm-project/clang/test/Profile/gcc-flag-compatibility.c b/src/llvm-project/clang/test/Profile/gcc-flag-compatibility.c
index cfc1a35..e3594b0 100644
--- a/src/llvm-project/clang/test/Profile/gcc-flag-compatibility.c
+++ b/src/llvm-project/clang/test/Profile/gcc-flag-compatibility.c
@@ -7,26 +7,50 @@
// -fprofile-use=<dir> Uses the profile file <dir>/default.profdata
// -fprofile-use=<dir>/file Uses the profile file <dir>/file
-// RUN: %clang %s -c -S -o - -emit-llvm -fprofile-generate | FileCheck -check-prefix=PROFILE-GEN %s
-// PROFILE-GEN: __llvm_profile_filename
+// RUN: %clang %s -c -S -o - -emit-llvm -fprofile-generate -fno-experimental-new-pass-manager | FileCheck -check-prefix=PROFILE-GEN %s
+// RUN: %clang %s -c -S -o - -emit-llvm -fprofile-generate -fexperimental-new-pass-manager | FileCheck -check-prefix=PROFILE-GEN %s
+// PROFILE-GEN: @__profc_main = {{(private|internal)}} global [2 x i64] zeroinitializer, section
+// PROFILE-GEN: @__profd_main =
// Check that -fprofile-generate=/path/to generates /path/to/default.profraw
-// RUN: %clang %s -c -S -o - -emit-llvm -fprofile-generate=/path/to | FileCheck -check-prefix=PROFILE-GEN-EQ %s
-// PROFILE-GEN-EQ: constant [{{.*}} x i8] c"/path/to{{/|\\5C}}{{.*}}\00"
+// RUN: %clang %s -c -S -o - -emit-llvm -fprofile-generate=/path/to -fno-experimental-new-pass-manager | FileCheck -check-prefixes=PROFILE-GEN,PROFILE-GEN-EQ %s
+// RxUN: %clang %s -c -S -o - -emit-llvm -fprofile-generate=/path/to -fexperimental-new-pass-manager | FileCheck -check-prefixes=PROFILE-GEN,PROFILE-GEN-EQ %s
+// PROFILE-GEN-EQ: constant [{{.*}} x i8] c"/path/to{{/|\\\\}}{{.*}}\00"
// Check that -fprofile-use=some/path reads some/path/default.profdata
+// This uses Clang FE format profile.
// RUN: rm -rf %t.dir
// RUN: mkdir -p %t.dir/some/path
// RUN: llvm-profdata merge %S/Inputs/gcc-flag-compatibility.proftext -o %t.dir/some/path/default.profdata
-// RUN: %clang %s -o - -Xclang -disable-llvm-passes -emit-llvm -S -fprofile-use=%t.dir/some/path | FileCheck -check-prefix=PROFILE-USE-2 %s
-// PROFILE-USE-2: = !{!"branch_weights", i32 101, i32 2}
+// RUN: %clang %s -o - -Xclang -disable-llvm-passes -emit-llvm -S -fprofile-use=%t.dir/some/path -fno-experimental-new-pass-manager | FileCheck -check-prefix=PROFILE-USE %s
+// RUN: %clang %s -o - -Xclang -disable-llvm-passes -emit-llvm -S -fprofile-use=%t.dir/some/path -fexperimental-new-pass-manager | FileCheck -check-prefix=PROFILE-USE %s
// Check that -fprofile-use=some/path/file.prof reads some/path/file.prof
+// This uses Clang FE format profile.
// RUN: rm -rf %t.dir
// RUN: mkdir -p %t.dir/some/path
// RUN: llvm-profdata merge %S/Inputs/gcc-flag-compatibility.proftext -o %t.dir/some/path/file.prof
-// RUN: %clang %s -o - -Xclang -disable-llvm-passes -emit-llvm -S -fprofile-use=%t.dir/some/path/file.prof | FileCheck -check-prefix=PROFILE-USE-3 %s
-// PROFILE-USE-3: = !{!"branch_weights", i32 101, i32 2}
+// RUN: %clang %s -o - -Xclang -disable-llvm-passes -emit-llvm -S -fprofile-use=%t.dir/some/path/file.prof -fno-experimental-new-pass-manager | FileCheck -check-prefix=PROFILE-USE %s
+// RUN: %clang %s -o - -Xclang -disable-llvm-passes -emit-llvm -S -fprofile-use=%t.dir/some/path/file.prof -fexperimental-new-pass-manager | FileCheck -check-prefix=PROFILE-USE %s
+// PROFILE-USE: = !{!"branch_weights", i32 101, i32 2}
+
+// Check that -fprofile-use=some/path reads some/path/default.profdata
+// This uses LLVM IR format profile.
+// RUN: rm -rf %t.dir
+// RUN: mkdir -p %t.dir/some/path
+// RUN: llvm-profdata merge %S/Inputs/gcc-flag-compatibility_IR.proftext -o %t.dir/some/path/default.profdata
+// RUN: %clang %s -o - -emit-llvm -S -fprofile-use=%t.dir/some/path -fno-experimental-new-pass-manager | FileCheck -check-prefix=PROFILE-USE-IR %s
+// RUN: %clang %s -o - -emit-llvm -S -fprofile-use=%t.dir/some/path -fexperimental-new-pass-manager | FileCheck -check-prefix=PROFILE-USE-IR %s
+
+// Check that -fprofile-use=some/path/file.prof reads some/path/file.prof
+// This uses LLVM IR format profile.
+// RUN: rm -rf %t.dir
+// RUN: mkdir -p %t.dir/some/path
+// RUN: llvm-profdata merge %S/Inputs/gcc-flag-compatibility_IR.proftext -o %t.dir/some/path/file.prof
+// RUN: %clang %s -o - -emit-llvm -S -fprofile-use=%t.dir/some/path/file.prof -fno-experimental-new-pass-manager | FileCheck -check-prefix=PROFILE-USE-IR %s
+// RUN: %clang %s -o - -emit-llvm -S -fprofile-use=%t.dir/some/path/file.prof -fexperimental-new-pass-manager | FileCheck -check-prefix=PROFILE-USE-IR %s
+
+// PROFILE-USE-IR: = !{!"branch_weights", i32 100, i32 1}
int X = 0;
diff --git a/src/llvm-project/clang/test/Profile/misexpect-branch-cold.c b/src/llvm-project/clang/test/Profile/misexpect-branch-cold.c
new file mode 100644
index 0000000..6d34f92
--- /dev/null
+++ b/src/llvm-project/clang/test/Profile/misexpect-branch-cold.c
@@ -0,0 +1,26 @@
+// Test that misexpect emits no warning when prediction is correct
+
+// RUN: llvm-profdata merge %S/Inputs/misexpect-branch.proftext -o %t.profdata
+// RUN: %clang_cc1 %s -O2 -o - -disable-llvm-passes -emit-llvm -fprofile-instrument-use-path=%t.profdata -verify -Wmisexpect
+
+// expected-no-diagnostics
+#define likely(x) __builtin_expect(!!(x), 1)
+#define unlikely(x) __builtin_expect(!!(x), 0)
+
+int foo(int);
+int baz(int);
+int buzz();
+
+const int inner_loop = 100;
+const int outer_loop = 2000;
+
+int bar() {
+ int rando = buzz();
+ int x = 0;
+ if (unlikely(rando % (outer_loop * inner_loop) == 0)) {
+ x = baz(rando);
+ } else {
+ x = foo(50);
+ }
+ return x;
+}
diff --git a/src/llvm-project/clang/test/Profile/misexpect-branch-nonconst-expected-val.c b/src/llvm-project/clang/test/Profile/misexpect-branch-nonconst-expected-val.c
new file mode 100644
index 0000000..c5167b9
--- /dev/null
+++ b/src/llvm-project/clang/test/Profile/misexpect-branch-nonconst-expected-val.c
@@ -0,0 +1,23 @@
+// Test that misexpect emits no warning when condition is not a compile-time constant
+
+// RUN: llvm-profdata merge %S/Inputs/misexpect-branch-nonconst-expect-arg.proftext -o %t.profdata
+// RUN: %clang_cc1 %s -O2 -o - -disable-llvm-passes -emit-llvm -fprofile-instrument-use-path=%t.profdata -verify -Wmisexpect
+
+// expected-no-diagnostics
+int foo(int);
+int baz(int);
+int buzz();
+
+const int inner_loop = 100;
+const int outer_loop = 2000;
+
+int bar() {
+ int rando = buzz();
+ int x = 0;
+ if (__builtin_expect(rando % (outer_loop * inner_loop) == 0, buzz())) {
+ x = baz(rando);
+ } else {
+ x = foo(50);
+ }
+ return x;
+}
diff --git a/src/llvm-project/clang/test/Profile/misexpect-branch-unpredictable.c b/src/llvm-project/clang/test/Profile/misexpect-branch-unpredictable.c
new file mode 100644
index 0000000..6c4f901
--- /dev/null
+++ b/src/llvm-project/clang/test/Profile/misexpect-branch-unpredictable.c
@@ -0,0 +1,25 @@
+// Test that misexpect emits no warning when prediction is correct
+
+// RUN: llvm-profdata merge %S/Inputs/misexpect-branch.proftext -o %t.profdata
+// RUN: %clang_cc1 %s -O2 -o - -disable-llvm-passes -emit-llvm -fprofile-instrument-use-path=%t.profdata -verify -Wmisexpect
+
+// expected-no-diagnostics
+#define unpredictable(x) __builtin_unpredictable(!!(x))
+
+int foo(int);
+int baz(int);
+int buzz();
+
+const int inner_loop = 100;
+const int outer_loop = 2000;
+
+int bar() {
+ int rando = buzz();
+ int x = 0;
+ if (unpredictable(rando % (outer_loop * inner_loop) == 0)) {
+ x = baz(rando);
+ } else {
+ x = foo(50);
+ }
+ return x;
+}
diff --git a/src/llvm-project/clang/test/Profile/misexpect-branch.c b/src/llvm-project/clang/test/Profile/misexpect-branch.c
new file mode 100644
index 0000000..503aa73
--- /dev/null
+++ b/src/llvm-project/clang/test/Profile/misexpect-branch.c
@@ -0,0 +1,28 @@
+// Test that misexpect detects mis-annotated branches
+
+// RUN: llvm-profdata merge %S/Inputs/misexpect-branch.proftext -o %t.profdata
+// RUN: %clang_cc1 %s -O2 -o - -emit-llvm -fprofile-instrument-use-path=%t.profdata -verify=imprecise -Wmisexpect
+// RUN: %clang_cc1 %s -O2 -o - -emit-llvm -fprofile-instrument-use-path=%t.profdata -verify=exact -Wmisexpect -debug-info-kind=line-tables-only
+// RUN: %clang_cc1 %s -O2 -o - -disable-llvm-passes -emit-llvm -fprofile-instrument-use-path=%t.profdata -verify=foo
+
+// foo-no-diagnostics
+#define likely(x) __builtin_expect(!!(x), 1)
+#define unlikely(x) __builtin_expect(!!(x), 0)
+
+int foo(int);
+int baz(int);
+int buzz();
+
+const int inner_loop = 100;
+const int outer_loop = 2000;
+
+int bar() { // imprecise-warning-re {{Potential performance regression from use of __builtin_expect(): Annotation was correct on {{.+}}% ({{[0-9]+ / [0-9]+}}) of profiled executions.}}
+ int rando = buzz();
+ int x = 0;
+ if (likely(rando % (outer_loop * inner_loop) == 0)) { // exact-warning-re {{Potential performance regression from use of __builtin_expect(): Annotation was correct on {{.+}}% ({{[0-9]+ / [0-9]+}}) of profiled executions.}}
+ x = baz(rando);
+ } else {
+ x = foo(50);
+ }
+ return x;
+}
diff --git a/src/llvm-project/clang/test/Profile/misexpect-switch-default.c b/src/llvm-project/clang/test/Profile/misexpect-switch-default.c
new file mode 100644
index 0000000..3d1079d
--- /dev/null
+++ b/src/llvm-project/clang/test/Profile/misexpect-switch-default.c
@@ -0,0 +1,40 @@
+// Test that misexpect detects mis-annotated switch statements for default case
+
+// RUN: llvm-profdata merge %S/Inputs/misexpect-switch-default.proftext -o %t.profdata
+// RUN: %clang_cc1 %s -O2 -o - -emit-llvm -fprofile-instrument-use-path=%t.profdata -verify -Wmisexpect -debug-info-kind=line-tables-only
+
+int sum(int *buff, int size);
+int random_sample(int *buff, int size);
+int rand();
+void init_arry();
+
+const int inner_loop = 1000;
+const int outer_loop = 20;
+const int arry_size = 25;
+
+int arry[arry_size] = {0};
+
+int main() {
+ init_arry();
+ int val = 0;
+ int j;
+ for (j = 0; j < outer_loop * inner_loop; ++j) {
+ unsigned condition = rand() % 5;
+ switch (__builtin_expect(condition, 6)) { // expected-warning-re {{Potential performance regression from use of __builtin_expect(): Annotation was correct on {{.+}}% ({{[0-9]+ / [0-9]+}}) of profiled executions.}}
+ case 0:
+ val += sum(arry, arry_size);
+ break;
+ case 1:
+ case 2:
+ case 3:
+ break;
+ case 4:
+ val += random_sample(arry, arry_size);
+ break;
+ default:
+ __builtin_unreachable();
+ } // end switch
+ } // end outer_loop
+
+ return 0;
+}
diff --git a/src/llvm-project/clang/test/Profile/misexpect-switch-nonconst.c b/src/llvm-project/clang/test/Profile/misexpect-switch-nonconst.c
new file mode 100644
index 0000000..fb719c5
--- /dev/null
+++ b/src/llvm-project/clang/test/Profile/misexpect-switch-nonconst.c
@@ -0,0 +1,43 @@
+// Test that misexpect emits no warning when switch condition is non-const
+
+// RUN: llvm-profdata merge %S/Inputs/misexpect-switch-nonconst.proftext -o %t.profdata
+// RUN: %clang_cc1 %s -O2 -o - -disable-llvm-passes -emit-llvm -fprofile-instrument-use-path=%t.profdata -verify
+
+// expected-no-diagnostics
+int sum(int *buff, int size);
+int random_sample(int *buff, int size);
+int rand();
+void init_arry();
+
+const int inner_loop = 1000;
+const int outer_loop = 20;
+const int arry_size = 25;
+
+int arry[arry_size] = {0};
+
+int main() {
+ init_arry();
+ int val = 0;
+
+ int j, k;
+ for (j = 0; j < outer_loop; ++j) {
+ for (k = 0; k < inner_loop; ++k) {
+ unsigned condition = rand() % 10000;
+ switch (__builtin_expect(condition, rand())) {
+ case 0:
+ val += sum(arry, arry_size);
+ break;
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ val += random_sample(arry, arry_size);
+ break;
+ default:
+ __builtin_unreachable();
+ } // end switch
+ } // end inner_loop
+ } // end outer_loop
+
+ return 0;
+}
diff --git a/src/llvm-project/clang/test/Profile/misexpect-switch-only-default-case.c b/src/llvm-project/clang/test/Profile/misexpect-switch-only-default-case.c
new file mode 100644
index 0000000..3886472
--- /dev/null
+++ b/src/llvm-project/clang/test/Profile/misexpect-switch-only-default-case.c
@@ -0,0 +1,35 @@
+// Test that misexpect emits no warning when there is only one switch case
+
+// RUN: llvm-profdata merge %S/Inputs/misexpect-switch-default-only.proftext -o %t.profdata
+// RUN: %clang_cc1 %s -O2 -o - -emit-llvm -fprofile-instrument-use-path=%t.profdata -verify -Wmisexpect -debug-info-kind=line-tables-only
+
+// expected-no-diagnostics
+int sum(int *buff, int size);
+int random_sample(int *buff, int size);
+int rand();
+void init_arry();
+
+const int inner_loop = 1000;
+const int outer_loop = 20;
+const int arry_size = 25;
+
+int arry[arry_size] = {0};
+
+int main() {
+ init_arry();
+ int val = 0;
+
+ int j, k;
+ for (j = 0; j < outer_loop; ++j) {
+ for (k = 0; k < inner_loop; ++k) {
+ unsigned condition = rand() % 10000;
+ switch (__builtin_expect(condition, 0)) {
+ default:
+ val += random_sample(arry, arry_size);
+ break;
+ }; // end switch
+ } // end inner_loop
+ } // end outer_loop
+
+ return 0;
+}
diff --git a/src/llvm-project/clang/test/Profile/misexpect-switch.c b/src/llvm-project/clang/test/Profile/misexpect-switch.c
new file mode 100644
index 0000000..a7f01bc
--- /dev/null
+++ b/src/llvm-project/clang/test/Profile/misexpect-switch.c
@@ -0,0 +1,41 @@
+// Test that misexpect detects mis-annotated switch statements
+
+// RUN: llvm-profdata merge %S/Inputs/misexpect-switch.proftext -o %t.profdata
+// RUN: %clang_cc1 %s -O2 -o - -emit-llvm -fprofile-instrument-use-path=%t.profdata -verify -Wmisexpect -debug-info-kind=line-tables-only
+
+int sum(int *buff, int size);
+int random_sample(int *buff, int size);
+int rand();
+void init_arry();
+
+const int inner_loop = 1000;
+const int outer_loop = 20;
+const int arry_size = 25;
+
+int arry[arry_size] = {0};
+
+int main() {
+ init_arry();
+ int val = 0;
+
+ int j, k;
+ for (j = 0; j < outer_loop; ++j) {
+ for (k = 0; k < inner_loop; ++k) {
+ unsigned condition = rand() % 10000;
+ switch (__builtin_expect(condition, 0)) { // expected-warning-re {{Potential performance regression from use of __builtin_expect(): Annotation was correct on {{.+}}% ({{[0-9]+ / [0-9]+}}) of profiled executions.}}
+ case 0:
+ val += sum(arry, arry_size);
+ break;
+ case 1:
+ case 2:
+ case 3:
+ break;
+ default:
+ val += random_sample(arry, arry_size);
+ break;
+ } // end switch
+ } // end inner_loop
+ } // end outer_loop
+
+ return 0;
+}
diff --git a/src/llvm-project/clang/test/Refactor/Extract/ExtractionSemicolonPolicy.cpp b/src/llvm-project/clang/test/Refactor/Extract/ExtractionSemicolonPolicy.cpp
index 5caf9d4..865e829 100644
--- a/src/llvm-project/clang/test/Refactor/Extract/ExtractionSemicolonPolicy.cpp
+++ b/src/llvm-project/clang/test/Refactor/Extract/ExtractionSemicolonPolicy.cpp
@@ -64,6 +64,7 @@
// CHECK-NEXT: extracted();{{$}}
// CHECK-NEXT: }
+
void extractStatementNotSemiWhile() {
/*range eextract=->+2:4*/while (true) {
int x = 0;
@@ -190,3 +191,26 @@
// CHECK-NEXT: extracted();{{$}}
// CHECK-NEXT: //
// CHECK-NEXT: }
+
+void careForSwitchSemicolon() {
+ /*range mextract=->+0:53*/switch(0) default: break;
+}
+// CHECK: 1 'mextract' results:
+// CHECK: static void extracted() {
+// CHECK-NEXT: switch(0) default: break;{{$}}
+// CHECK-NEXT: }{{[[:space:]].*}}
+// CHECK-NEXT: void careForSwitchSemicolon() {
+// CHECK-NEXT: extracted();{{$}}
+// CHECK-NEXT: }
+
+void extractStatementNotSemiDecl() {
+ /*range nextract=->+0:38*/int x = 5;
+}
+// CHECK: 1 'nextract' results:
+// CHECK: static void extracted() {
+// CHECK-NEXT: int x = 5;{{$}}
+// CHECK-NEXT: }{{[[:space:]].*}}
+// CHECK-NEXT: void extractStatementNotSemiDecl() {
+// CHECK-NEXT: extracted();{{$}}
+// CHECK-NEXT: }
+
diff --git a/src/llvm-project/clang/test/Sema/MicrosoftCompatibility.c b/src/llvm-project/clang/test/Sema/MicrosoftCompatibility.c
index 697d3f2..9a1f050 100644
--- a/src/llvm-project/clang/test/Sema/MicrosoftCompatibility.c
+++ b/src/llvm-project/clang/test/Sema/MicrosoftCompatibility.c
@@ -1,10 +1,18 @@
-// RUN: %clang_cc1 %s -fsyntax-only -Wno-unused-value -Wmicrosoft -verify -fms-compatibility -triple i686-pc-win32
+// RUN: %clang_cc1 %s -fsyntax-only -Wno-unused-value -Wmicrosoft -verify -fms-compatibility -DMSVCCOMPAT -triple i686-pc-win32
+// RUN: %clang_cc1 %s -fsyntax-only -Wno-unused-value -Wmicrosoft -verify -fms-extensions -triple i686-pc-win32
+#ifdef MSVCCOMPAT
enum ENUM1; // expected-warning {{forward references to 'enum' types are a Microsoft extension}}
enum ENUM1 var1 = 3;
enum ENUM1* var2 = 0;
+#else
+enum ENUM1; // expected-note {{forward declaration of}}
+enum ENUM1 var1 = 3; // expected-error {{variable has incomplete type 'enum ENUM1'}}
+enum ENUM1* var2 = 0;
+#endif
+// FIXME: The rest of this seems to be controlled by -fms-extensions. Move it.
enum ENUM2 {
ENUM2_a = (enum ENUM2) 4,
ENUM2_b = 0x9FFFFFFF, // expected-warning {{enumerator value is not representable in the underlying type 'int'}}
@@ -22,4 +30,8 @@
__declspec(__noreturn__) void f7(void); /* expected-warning {{__declspec attribute '__noreturn__' is not supported}} */
+#ifdef MSVCCOMPAT
size_t x;
+#else
+size_t x; // expected-error {{unknown type name 'size_t'}}
+#endif
diff --git a/src/llvm-project/clang/test/Sema/MicrosoftExtensions.c b/src/llvm-project/clang/test/Sema/MicrosoftExtensions.c
index 79dba88..35570ff 100644
--- a/src/llvm-project/clang/test/Sema/MicrosoftExtensions.c
+++ b/src/llvm-project/clang/test/Sema/MicrosoftExtensions.c
@@ -150,6 +150,20 @@
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'}}
+// Check for warning when return types have the type attribute.
+void *__ptr32 ptr_func3() { return 0; } // expected-note {{previous definition is here}}
+void *__ptr64 ptr_func3() { return 0; } // expected-error {{redefinition of 'ptr_func3'}}
+
+// Test that __ptr32/__ptr64 can be passed as arguments with other address
+// spaces.
+void ptr_func4(int *i);
+void ptr_func5(int *__ptr32 i);
+void test_ptr_arguments() {
+ int *__ptr64 i64;
+ ptr_func4(i64);
+ ptr_func5(i64);
+}
+
int * __sptr __ptr32 __sptr wrong4; // expected-warning {{attribute '__sptr' is already applied}}
__ptr32 int *wrong5; // expected-error {{'__ptr32' attribute only applies to pointer arguments}}
diff --git a/src/llvm-project/clang/test/Sema/__try.c b/src/llvm-project/clang/test/Sema/__try.c
index cfb47e6..f7c5c97 100644
--- a/src/llvm-project/clang/test/Sema/__try.c
+++ b/src/llvm-project/clang/test/Sema/__try.c
@@ -111,7 +111,7 @@
__try {
}
- __except ( NotFilterExpression() ) { // expected-error{{filter expression type should be an integral value not 'const char *'}}
+ __except ( NotFilterExpression() ) { // expected-error{{filter expression has non-integral type 'const char *'}}
}
}
diff --git a/src/llvm-project/clang/test/Sema/aarch64-neon-vector-types.c b/src/llvm-project/clang/test/Sema/aarch64-neon-vector-types.c
index 4cc1e2c..084700e 100644
--- a/src/llvm-project/clang/test/Sema/aarch64-neon-vector-types.c
+++ b/src/llvm-project/clang/test/Sema/aarch64-neon-vector-types.c
@@ -3,6 +3,8 @@
// RUN: %clang_cc1 %s -triple arm64-none-linux-gnu -target-feature +neon -fsyntax-only -verify
// RUN: %clang_cc1 %s -triple arm64-none-linux-gnu -target-feature +neon -DUSE_LONG -fsyntax-only -verify
+// RUN: %clang_cc1 %s -triple arm64_32-apple-ios -target-feature +neon -fsyntax-only -verify
+
typedef float float32_t;
typedef unsigned char poly8_t;
typedef unsigned short poly16_t;
diff --git a/src/llvm-project/clang/test/Sema/aarch64-sve-types.c b/src/llvm-project/clang/test/Sema/aarch64-sve-types.c
new file mode 100644
index 0000000..f85e0f8
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/aarch64-sve-types.c
@@ -0,0 +1,52 @@
+// RUN: %clang_cc1 %s -triple aarch64-none-linux-gnu -target-feature +sve -fsyntax-only -verify
+
+// This test is invalid under the sizeless type extension and is a stop-gap
+// until that extension is added. The test makes sure that sizeof and
+// alignof queries are handled without assertion failures, since at
+// present there is nothing to prevent such queries being made.
+//
+// Under this scheme, sizeof returns 0 for all built-in sizeless types.
+// This is compatible with correct usage but it relies on the user being
+// careful to avoid constructs that depend directly or indirectly on the
+// value of sizeof. (The sizeless type extension avoids this by treating
+// such constructs as an error.)
+
+// expected-no-diagnostics
+
+void f() {
+ int size_s8[sizeof(__SVInt8_t) == 0 ? 1 : -1];
+ int align_s8[__alignof__(__SVInt8_t) == 16 ? 1 : -1];
+
+ int size_s16[sizeof(__SVInt16_t) == 0 ? 1 : -1];
+ int align_s16[__alignof__(__SVInt16_t) == 16 ? 1 : -1];
+
+ int size_s32[sizeof(__SVInt32_t) == 0 ? 1 : -1];
+ int align_s32[__alignof__(__SVInt32_t) == 16 ? 1 : -1];
+
+ int size_s64[sizeof(__SVInt64_t) == 0 ? 1 : -1];
+ int align_s64[__alignof__(__SVInt64_t) == 16 ? 1 : -1];
+
+ int size_u8[sizeof(__SVUint8_t) == 0 ? 1 : -1];
+ int align_u8[__alignof__(__SVUint8_t) == 16 ? 1 : -1];
+
+ int size_u16[sizeof(__SVUint16_t) == 0 ? 1 : -1];
+ int align_u16[__alignof__(__SVUint16_t) == 16 ? 1 : -1];
+
+ int size_u32[sizeof(__SVUint32_t) == 0 ? 1 : -1];
+ int align_u32[__alignof__(__SVUint32_t) == 16 ? 1 : -1];
+
+ int size_u64[sizeof(__SVUint64_t) == 0 ? 1 : -1];
+ int align_u64[__alignof__(__SVUint64_t) == 16 ? 1 : -1];
+
+ int size_f16[sizeof(__SVFloat16_t) == 0 ? 1 : -1];
+ int align_f16[__alignof__(__SVFloat16_t) == 16 ? 1 : -1];
+
+ int size_f32[sizeof(__SVFloat32_t) == 0 ? 1 : -1];
+ int align_f32[__alignof__(__SVFloat32_t) == 16 ? 1 : -1];
+
+ int size_f64[sizeof(__SVFloat64_t) == 0 ? 1 : -1];
+ int align_f64[__alignof__(__SVFloat64_t) == 16 ? 1 : -1];
+
+ int size_b8[sizeof(__SVBool_t) == 0 ? 1 : -1];
+ int align_b8[__alignof__(__SVBool_t) == 2 ? 1 : -1];
+}
diff --git a/src/llvm-project/clang/test/Sema/aarch64-tme-errors.c b/src/llvm-project/clang/test/Sema/aarch64-tme-errors.c
new file mode 100644
index 0000000..0e9c2a6
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/aarch64-tme-errors.c
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -triple aarch64-eabi -verify %s
+
+#include "arm_acle.h"
+
+void test_no_tme_funcs() {
+ __tstart(); // expected-warning{{implicit declaration of function '__tstart'}}
+ __builtin_tstart(); // expected-error{{use of unknown builtin '__builtin_tstart'}}
+}
diff --git a/src/llvm-project/clang/test/Sema/aarch64-tme-tcancel-errors.c b/src/llvm-project/clang/test/Sema/aarch64-tme-tcancel-errors.c
new file mode 100644
index 0000000..bd5b717
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/aarch64-tme-tcancel-errors.c
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -triple aarch64-eabi -target-feature +tme -verify %s
+void t_cancel_const(unsigned short u) {
+ __builtin_arm_tcancel(u); // expected-error{{argument to '__builtin_arm_tcancel' must be a constant integer}}
+}
+
+// RUN: %clang_cc1 -triple aarch64-eabi -target-feature +tme -verify %s
+void t_cancel_range() {
+ __builtin_arm_tcancel(0x12345u); // expected-error{{argument value 74565 is outside the valid range [0, 65535]}}
+}
diff --git a/src/llvm-project/clang/test/Sema/arm-mve-alias-attribute.c b/src/llvm-project/clang/test/Sema/arm-mve-alias-attribute.c
new file mode 100644
index 0000000..c2f526d
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/arm-mve-alias-attribute.c
@@ -0,0 +1,22 @@
+// RUN: %clang_cc1 -triple armv8.1m.main-arm-none-eabi -verify -fsyntax-only %s
+
+static __inline__ __attribute__((__clang_arm_mve_alias(__builtin_arm_nop))) // expected-error {{'__clang_arm_mve_alias' attribute can only be applied to an ARM MVE builtin}}
+void nop(void);
+
+static __inline__ __attribute__((__clang_arm_mve_alias)) // expected-error {{'__clang_arm_mve_alias' attribute takes one argument}}
+void noparens(void);
+
+static __inline__ __attribute__((__clang_arm_mve_alias())) // expected-error {{'__clang_arm_mve_alias' attribute takes one argument}}
+void emptyparens(void);
+
+static __inline__ __attribute__((__clang_arm_mve_alias("string literal"))) // expected-error {{'__clang_arm_mve_alias' attribute requires parameter 1 to be an identifier}}
+void stringliteral(void);
+
+static __inline__ __attribute__((__clang_arm_mve_alias(1))) // expected-error {{'__clang_arm_mve_alias' attribute requires parameter 1 to be an identifier}}
+void integer(void);
+
+static __inline__ __attribute__((__clang_arm_mve_alias(__builtin_arm_nop, 2))) // expected-error {{'__clang_arm_mve_alias' attribute takes one argument}}
+void twoargs(void);
+
+static __attribute__((__clang_arm_mve_alias(__builtin_arm_nop))) // expected-error {{'__clang_arm_mve_alias' attribute only applies to functions}}
+int variable;
diff --git a/src/llvm-project/clang/test/Sema/arm-mve-immediates.c b/src/llvm-project/clang/test/Sema/arm-mve-immediates.c
new file mode 100644
index 0000000..b8106fb
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/arm-mve-immediates.c
@@ -0,0 +1,205 @@
+// RUN: %clang_cc1 -triple thumbv8.1m.main-arm-none-eabi -fallow-half-arguments-and-returns -target-feature +mve.fp -verify -fsyntax-only %s
+
+#include <arm_mve.h>
+
+void test_load_offsets(uint32x4_t addr32, uint64x2_t addr64)
+{
+ // Offsets that should be a multiple of 8 times 0,1,...,127
+ vldrdq_gather_base_s64(addr64, 0);
+ vldrdq_gather_base_s64(addr64, 8);
+ vldrdq_gather_base_s64(addr64, 2*8);
+ vldrdq_gather_base_s64(addr64, 125*8);
+ vldrdq_gather_base_s64(addr64, 126*8);
+ vldrdq_gather_base_s64(addr64, 127*8);
+ vldrdq_gather_base_s64(addr64, -125*8);
+ vldrdq_gather_base_s64(addr64, -126*8);
+ vldrdq_gather_base_s64(addr64, -127*8);
+ vldrdq_gather_base_s64(addr64, 128*8); // expected-error {{argument value 1024 is outside the valid range [-1016, 1016]}}
+ vldrdq_gather_base_s64(addr64, -128*8); // expected-error {{argument value -1024 is outside the valid range [-1016, 1016]}}
+ vldrdq_gather_base_s64(addr64, 4); // expected-error {{argument should be a multiple of 8}}
+ vldrdq_gather_base_s64(addr64, 1); // expected-error {{argument should be a multiple of 8}}
+
+ // Offsets that should be a multiple of 4 times 0,1,...,127
+ vldrwq_gather_base_s32(addr32, 0);
+ vldrwq_gather_base_s32(addr32, 4);
+ vldrwq_gather_base_s32(addr32, 2*4);
+ vldrwq_gather_base_s32(addr32, 125*4);
+ vldrwq_gather_base_s32(addr32, 126*4);
+ vldrwq_gather_base_s32(addr32, 127*4);
+ vldrwq_gather_base_s32(addr32, -125*4);
+ vldrwq_gather_base_s32(addr32, -126*4);
+ vldrwq_gather_base_s32(addr32, -127*4);
+ vldrwq_gather_base_s32(addr32, 128*4); // expected-error {{argument value 512 is outside the valid range [-508, 508]}}
+ vldrwq_gather_base_s32(addr32, -128*4); // expected-error {{argument value -512 is outside the valid range [-508, 508]}}
+ vldrwq_gather_base_s32(addr32, 2); // expected-error {{argument should be a multiple of 4}}
+ vldrwq_gather_base_s32(addr32, 1); // expected-error {{argument should be a multiple of 4}}
+
+ // Show that the polymorphic store intrinsics get the right set of
+ // error checks after overload resolution. These ones expand to the
+ // 8-byte granular versions...
+ vstrdq_scatter_base(addr64, 0, addr64);
+ vstrdq_scatter_base(addr64, 8, addr64);
+ vstrdq_scatter_base(addr64, 2*8, addr64);
+ vstrdq_scatter_base(addr64, 125*8, addr64);
+ vstrdq_scatter_base(addr64, 126*8, addr64);
+ vstrdq_scatter_base(addr64, 127*8, addr64);
+ vstrdq_scatter_base(addr64, -125*8, addr64);
+ vstrdq_scatter_base(addr64, -126*8, addr64);
+ vstrdq_scatter_base(addr64, -127*8, addr64);
+ vstrdq_scatter_base(addr64, 128*8, addr64); // expected-error {{argument value 1024 is outside the valid range [-1016, 1016]}}
+ vstrdq_scatter_base(addr64, -128*8, addr64); // expected-error {{argument value -1024 is outside the valid range [-1016, 1016]}}
+ vstrdq_scatter_base(addr64, 4, addr64); // expected-error {{argument should be a multiple of 8}}
+ vstrdq_scatter_base(addr64, 1, addr64); // expected-error {{argument should be a multiple of 8}}
+
+ /// ... and these ones to the 4-byte.
+ vstrwq_scatter_base(addr32, 0, addr32);
+ vstrwq_scatter_base(addr32, 4, addr32);
+ vstrwq_scatter_base(addr32, 2*4, addr32);
+ vstrwq_scatter_base(addr32, 125*4, addr32);
+ vstrwq_scatter_base(addr32, 126*4, addr32);
+ vstrwq_scatter_base(addr32, 127*4, addr32);
+ vstrwq_scatter_base(addr32, -125*4, addr32);
+ vstrwq_scatter_base(addr32, -126*4, addr32);
+ vstrwq_scatter_base(addr32, -127*4, addr32);
+ vstrwq_scatter_base(addr32, 128*4, addr32); // expected-error {{argument value 512 is outside the valid range [-508, 508]}}
+ vstrwq_scatter_base(addr32, -128*4, addr32); // expected-error {{argument value -512 is outside the valid range [-508, 508]}}
+ vstrwq_scatter_base(addr32, 2, addr32); // expected-error {{argument should be a multiple of 4}}
+ vstrwq_scatter_base(addr32, 1, addr32); // expected-error {{argument should be a multiple of 4}}
+}
+
+void test_lane_indices(uint8x16_t v16, uint16x8_t v8,
+ uint32x4_t v4, uint64x2_t v2)
+{
+ vgetq_lane_u8(v16, -1); // expected-error {{argument value -1 is outside the valid range [0, 15]}}
+ vgetq_lane_u8(v16, 0);
+ vgetq_lane_u8(v16, 15);
+ vgetq_lane_u8(v16, 16); // expected-error {{argument value 16 is outside the valid range [0, 15]}}
+
+ vgetq_lane_u16(v8, -1); // expected-error {{argument value -1 is outside the valid range [0, 7]}}
+ vgetq_lane_u16(v8, 0);
+ vgetq_lane_u16(v8, 7);
+ vgetq_lane_u16(v8, 8); // expected-error {{argument value 8 is outside the valid range [0, 7]}}
+
+ vgetq_lane_u32(v4, -1); // expected-error {{argument value -1 is outside the valid range [0, 3]}}
+ vgetq_lane_u32(v4, 0);
+ vgetq_lane_u32(v4, 3);
+ vgetq_lane_u32(v4, 4); // expected-error {{argument value 4 is outside the valid range [0, 3]}}
+
+ vgetq_lane_u64(v2, -1); // expected-error {{argument value -1 is outside the valid range [0, 1]}}
+ vgetq_lane_u64(v2, 0);
+ vgetq_lane_u64(v2, 1);
+ vgetq_lane_u64(v2, 2); // expected-error {{argument value 2 is outside the valid range [0, 1]}}
+
+ vsetq_lane_u8(23, v16, -1); // expected-error {{argument value -1 is outside the valid range [0, 15]}}
+ vsetq_lane_u8(23, v16, 0);
+ vsetq_lane_u8(23, v16, 15);
+ vsetq_lane_u8(23, v16, 16); // expected-error {{argument value 16 is outside the valid range [0, 15]}}
+
+ vsetq_lane_u16(23, v8, -1); // expected-error {{argument value -1 is outside the valid range [0, 7]}}
+ vsetq_lane_u16(23, v8, 0);
+ vsetq_lane_u16(23, v8, 7);
+ vsetq_lane_u16(23, v8, 8); // expected-error {{argument value 8 is outside the valid range [0, 7]}}
+
+ vsetq_lane_u32(23, v4, -1); // expected-error {{argument value -1 is outside the valid range [0, 3]}}
+ vsetq_lane_u32(23, v4, 0);
+ vsetq_lane_u32(23, v4, 3);
+ vsetq_lane_u32(23, v4, 4); // expected-error {{argument value 4 is outside the valid range [0, 3]}}
+
+ vsetq_lane_u64(23, v2, -1); // expected-error {{argument value -1 is outside the valid range [0, 1]}}
+ vsetq_lane_u64(23, v2, 0);
+ vsetq_lane_u64(23, v2, 1);
+ vsetq_lane_u64(23, v2, 2); // expected-error {{argument value 2 is outside the valid range [0, 1]}}
+}
+
+void test_immediate_shifts(uint8x16_t vb, uint16x8_t vh, uint32x4_t vw)
+{
+ vshlq_n(vb, 0);
+ vshlq_n(vb, 7);
+ vshlq_n(vh, 0);
+ vshlq_n(vh, 15);
+ vshlq_n(vw, 0);
+ vshlq_n(vw, 31);
+
+ vshlq_n(vb, -1); // expected-error {{argument value -1 is outside the valid range [0, 7]}}
+ vshlq_n(vb, 8); // expected-error {{argument value 8 is outside the valid range [0, 7]}}
+ vshlq_n(vh, -1); // expected-error {{argument value -1 is outside the valid range [0, 15]}}
+ vshlq_n(vh, 16); // expected-error {{argument value 16 is outside the valid range [0, 15]}}
+ vshlq_n(vw, -1); // expected-error {{argument value -1 is outside the valid range [0, 31]}}
+ vshlq_n(vw, 32); // expected-error {{argument value 32 is outside the valid range [0, 31]}}
+
+ vqshlq_n(vb, 0);
+ vqshlq_n(vb, 7);
+ vqshlq_n(vh, 0);
+ vqshlq_n(vh, 15);
+ vqshlq_n(vw, 0);
+ vqshlq_n(vw, 31);
+
+ vqshlq_n(vb, -1); // expected-error {{argument value -1 is outside the valid range [0, 7]}}
+ vqshlq_n(vb, 8); // expected-error {{argument value 8 is outside the valid range [0, 7]}}
+ vqshlq_n(vh, -1); // expected-error {{argument value -1 is outside the valid range [0, 15]}}
+ vqshlq_n(vh, 16); // expected-error {{argument value 16 is outside the valid range [0, 15]}}
+ vqshlq_n(vw, -1); // expected-error {{argument value -1 is outside the valid range [0, 31]}}
+ vqshlq_n(vw, 32); // expected-error {{argument value 32 is outside the valid range [0, 31]}}
+
+ vsliq(vb, vb, 0);
+ vsliq(vb, vb, 7);
+ vsliq(vh, vh, 0);
+ vsliq(vh, vh, 15);
+ vsliq(vw, vw, 0);
+ vsliq(vw, vw, 31);
+
+ vsliq(vb, vb, -1); // expected-error {{argument value -1 is outside the valid range [0, 7]}}
+ vsliq(vb, vb, 8); // expected-error {{argument value 8 is outside the valid range [0, 7]}}
+ vsliq(vh, vh, -1); // expected-error {{argument value -1 is outside the valid range [0, 15]}}
+ vsliq(vh, vh, 16); // expected-error {{argument value 16 is outside the valid range [0, 15]}}
+ vsliq(vw, vw, -1); // expected-error {{argument value -1 is outside the valid range [0, 31]}}
+ vsliq(vw, vw, 32); // expected-error {{argument value 32 is outside the valid range [0, 31]}}
+
+ vshllbq(vb, 1);
+ vshllbq(vb, 8);
+ vshllbq(vh, 1);
+ vshllbq(vh, 16);
+
+ vshllbq(vb, 0); // expected-error {{argument value 0 is outside the valid range [1, 8]}}
+ vshllbq(vb, 9); // expected-error {{argument value 9 is outside the valid range [1, 8]}}
+ vshllbq(vh, 0); // expected-error {{argument value 0 is outside the valid range [1, 16]}}
+ vshllbq(vh, 17); // expected-error {{argument value 17 is outside the valid range [1, 16]}}
+
+ vshrq(vb, 1);
+ vshrq(vb, 8);
+ vshrq(vh, 1);
+ vshrq(vh, 16);
+ vshrq(vw, 1);
+ vshrq(vw, 32);
+
+ vshrq(vb, 0); // expected-error {{argument value 0 is outside the valid range [1, 8]}}
+ vshrq(vb, 9); // expected-error {{argument value 9 is outside the valid range [1, 8]}}
+ vshrq(vh, 0); // expected-error {{argument value 0 is outside the valid range [1, 16]}}
+ vshrq(vh, 17); // expected-error {{argument value 17 is outside the valid range [1, 16]}}
+ vshrq(vw, 0); // expected-error {{argument value 0 is outside the valid range [1, 32]}}
+ vshrq(vw, 33); // expected-error {{argument value 33 is outside the valid range [1, 32]}}
+
+ vshrntq(vb, vh, 1);
+ vshrntq(vb, vh, 8);
+ vshrntq(vh, vw, 1);
+ vshrntq(vh, vw, 16);
+
+ vshrntq(vb, vh, 0); // expected-error {{argument value 0 is outside the valid range [1, 8]}}
+ vshrntq(vb, vh, 9); // expected-error {{argument value 9 is outside the valid range [1, 8]}}
+ vshrntq(vh, vw, 0); // expected-error {{argument value 0 is outside the valid range [1, 16]}}
+ vshrntq(vh, vw, 17); // expected-error {{argument value 17 is outside the valid range [1, 16]}}
+
+ vsriq(vb, vb, 1);
+ vsriq(vb, vb, 8);
+ vsriq(vh, vh, 1);
+ vsriq(vh, vh, 16);
+ vsriq(vw, vw, 1);
+ vsriq(vw, vw, 32);
+
+ vsriq(vb, vb, 0); // expected-error {{argument value 0 is outside the valid range [1, 8]}}
+ vsriq(vb, vb, 9); // expected-error {{argument value 9 is outside the valid range [1, 8]}}
+ vsriq(vh, vh, 0); // expected-error {{argument value 0 is outside the valid range [1, 16]}}
+ vsriq(vh, vh, 17); // expected-error {{argument value 17 is outside the valid range [1, 16]}}
+ vsriq(vw, vw, 0); // expected-error {{argument value 0 is outside the valid range [1, 32]}}
+ vsriq(vw, vw, 33); // expected-error {{argument value 33 is outside the valid range [1, 32]}}
+}
diff --git a/src/llvm-project/clang/test/Sema/arm_inline_asm_constraints.c b/src/llvm-project/clang/test/Sema/arm_inline_asm_constraints.c
new file mode 100644
index 0000000..020f619
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/arm_inline_asm_constraints.c
@@ -0,0 +1,305 @@
+// REQUIRES: arm-registered-target
+
+// RUN: %clang_cc1 -triple armv6 -verify=arm6 %s
+// RUN: %clang_cc1 -triple armv7 -verify=arm7 %s
+// RUN: %clang_cc1 -triple thumbv6 -verify=thumb1 %s
+// RUN: %clang_cc1 -triple thumbv7 -verify=thumb2 %s
+
+// j: An immediate integer between 0 and 65535 (valid for MOVW) (ARM/Thumb2)
+int test_j(int i) {
+ int res;
+ __asm("movw %0, %1;"
+ : [ result ] "=r"(res)
+ : [ constant ] "j"(-1), [ input ] "r"(i)
+ :);
+ // arm6-error@13 {{invalid input constraint 'j' in asm}}
+ // arm7-error@13 {{value '-1' out of range for constraint 'j'}}
+ // thumb1-error@13 {{invalid input constraint 'j' in asm}}
+ // thumb2-error@13 {{value '-1' out of range for constraint 'j'}}
+ __asm("movw %0, %1;"
+ : [ result ] "=r"(res)
+ : [ constant ] "j"(0), [ input ] "r"(i)
+ :);
+ // arm6-error@21 {{invalid input constraint 'j' in asm}}
+ // arm7-no-error
+ // thumb1-error@21 {{invalid input constraint 'j' in asm}}
+ // thumb2-no-error
+ __asm("movw %0, %1;"
+ : [ result ] "=r"(res)
+ : [ constant ] "j"(65535), [ input ] "r"(i)
+ :);
+ // arm6-error@29 {{invalid input constraint 'j' in asm}}
+ // arm7-no-error
+ // thumb1-error@29 {{invalid input constraint 'j' in asm}}
+ // thumb2-no-error
+ __asm("movw %0, %1;"
+ : [ result ] "=r"(res)
+ : [ constant ] "j"(65536), [ input ] "r"(i)
+ :);
+ // arm6-error@37 {{invalid input constraint 'j' in asm}}
+ // arm7-error@37 {{value '65536' out of range for constraint 'j'}}
+ // thumb1-error@37 {{invalid input constraint 'j' in asm}}
+ // thumb2-error@37 {{value '65536' out of range for constraint 'j'}}
+ return res;
+}
+
+// I: An immediate integer valid for a data-processing instruction. (ARM/Thumb2)
+// An immediate integer between 0 and 255. (Thumb1)
+int test_I(int i) {
+ int res;
+ __asm(
+ "add %0, %1;"
+ : [ result ] "=r"(res)
+ : [ constant ] "I"(-1), [ input ] "r"(i)
+ :); // thumb1-error@53 {{value '-1' out of range for constraint 'I'}}
+ __asm(
+ "add %0, %1;"
+ : [ result ] "=r"(res)
+ : [ constant ] "I"(0), [ input ] "r"(i)
+ :); // No errors expected.
+ __asm(
+ "add %0, %1;"
+ : [ result ] "=r"(res)
+ : [ constant ] "I"(255), [ input ] "r"(i)
+ :); // No errors expected.
+ __asm(
+ "add %0, %1;"
+ : [ result ] "=r"(res)
+ : [ constant ] "I"(256), [ input ] "r"(i)
+ :); // thumb1-error@68 {{value '256' out of range for constraint 'I'}}
+ return res;
+}
+
+// J: An immediate integer between -4095 and 4095. (ARM/Thumb2)
+// An immediate integer between -255 and -1. (Thumb1)
+int test_J(int i) {
+ int res;
+ __asm(
+ "movw %0, %1;"
+ : [ result ] "=r"(res)
+ : [ constant ] "J"(-4096), [ input ] "r"(i)
+ :);
+ // arm6-error@80 {{value '-4096' out of range for constraint 'J'}}
+ // arm7-error@80 {{value '-4096' out of range for constraint 'J'}}
+ // thumb1-error@80 {{value '-4096' out of range for constraint 'J'}}
+ // thumb2-error@80 {{value '-4096' out of range for constraint 'J'}}
+ __asm(
+ "movw %0, %1;"
+ : [ result ] "=r"(res)
+ : [ constant ] "J"(-4095), [ input ] "r"(i)
+ :);
+ // thumb1-error@89 {{value '-4095' out of range for constraint 'J'}}
+ __asm(
+ "add %0, %1;"
+ : [ result ] "=r"(res)
+ : [ constant ] "J"(-256), [ input ] "r"(i)
+ :);
+ // thumb1-error@95 {{value '-256' out of range for constraint 'J'}}
+ __asm(
+ "add %0, %1;"
+ : [ result ] "=r"(res)
+ : [ constant ] "J"(-255), [ input ] "r"(i)
+ :);
+ // No errors expected.
+ __asm(
+ "add %0, %1;"
+ : [ result ] "=r"(res)
+ : [ constant ] "J"(-1), [ input ] "r"(i)
+ :);
+ // No errors expected.
+ __asm(
+ "add %0, %1;"
+ : [ result ] "=r"(res)
+ : [ constant ] "J"(0), [ input ] "r"(i)
+ :);
+ // thumb1-error@113 {{value '0' out of range for constraint 'J'}}
+ __asm(
+ "movw %0, %1;"
+ : [ result ] "=r"(res)
+ : [ constant ] "J"(4095), [ input ] "r"(i)
+ :);
+ // thumb1-error@119 {{value '4095' out of range for constraint 'J'}}
+ __asm(
+ "movw %0, %1;"
+ : [ result ] "=r"(res)
+ : [ constant ] "J"(4096), [ input ] "r"(i)
+ :);
+ // arm6-error@125 {{value '4096' out of range for constraint 'J'}}
+ // arm7-error@125 {{value '4096' out of range for constraint 'J'}}
+ // thumb1-error@125 {{value '4096' out of range for constraint 'J'}}
+ // thumb2-error@125 {{value '4096' out of range for constraint 'J'}}
+ return res;
+}
+
+// K: An immediate integer whose bitwise inverse is valid for a data-processing instruction. (ARM/Thumb2)
+// An immediate integer between 0 and 255, with optional left-shift by some amount. (Thumb1)
+int test_K(int i) {
+ int res;
+ __asm(
+ "add %0, %1;"
+ : [ result ] "=r"(res)
+ : [ constant ] "K"(123), [ input ] "r"(i)
+ :);
+ // No errors expected.
+ return res;
+}
+
+// L: An immediate integer whose negation is valid for a data-processing instruction. (ARM/Thumb2)
+// An immediate integer between -7 and 7. (Thumb1)
+int test_L(int i) {
+ int res;
+ __asm(
+ "add %0, %1;"
+ : [ result ] "=r"(res)
+ : [ constant ] "L"(-8), [ input ] "r"(i)
+ :); // thumb1-error@154 {{value '-8' out of range for constraint 'L'}}
+ __asm(
+ "add %0, %1;"
+ : [ result ] "=r"(res)
+ : [ constant ] "L"(-7), [ input ] "r"(i)
+ :); // No errors expected.
+ __asm(
+ "add %0, %1;"
+ : [ result ] "=r"(res)
+ : [ constant ] "L"(7), [ input ] "r"(i)
+ :); // No errors expected.
+ __asm(
+ "add %0, %1;"
+ : [ result ] "=r"(res)
+ : [ constant ] "L"(8), [ input ] "r"(i)
+ :); // thumb1-error@169 {{value '8' out of range for constraint 'L'}}
+ return res;
+}
+
+// M: A power of two or a integer between 0 and 32. (ARM/Thumb2)
+// An immediate integer which is a multiple of 4 between 0 and 1020. (Thumb1)
+int test_M(int i) {
+ int res;
+ __asm(
+ "add %0, %1;"
+ : [ result ] "=r"(res)
+ : [ constant ] "M"(123), [ input ] "r"(i)
+ :); // No errors expected.
+ return res;
+}
+
+// N: Invalid (ARM/Thumb2)
+// An immediate integer between 0 and 31. (Thumb1)
+int test_N(int i) {
+ int res;
+ __asm("add %0, %1;"
+ : [ result ] "=r"(res)
+ : [ constant ] "N"(-1), [ input ] "r"(i)
+ :);
+ // arm6-error@192 {{invalid input constraint 'N' in asm}}
+ // arm7-error@192 {{invalid input constraint 'N' in asm}}
+ // thumb1-error@192 {{value '-1' out of range for constraint 'N'}}
+ // thumb2-error@192 {{invalid input constraint 'N' in asm}}
+ __asm(
+ "add %0, %1;"
+ : [ result ] "=r"(res)
+ : [ constant ] "N"(0), [ input ] "r"(i)
+ :);
+ // arm6-error@201 {{invalid input constraint 'N' in asm}}
+ // arm7-error@201 {{invalid input constraint 'N' in asm}}
+ // thumb1-no-error
+ // thumb2-error@201 {{invalid input constraint 'N' in asm}}
+ __asm(
+ "add %0, %1;"
+ : [ result ] "=r"(res)
+ : [ constant ] "N"(31), [ input ] "r"(i)
+ :);
+ // arm6-error@210 {{invalid input constraint 'N' in asm}}
+ // arm7-error@210 {{invalid input constraint 'N' in asm}}
+ // thumb1-no-error
+ // thumb2-error@210 {{invalid input constraint 'N' in asm}}
+ __asm(
+ "add %0, %1;"
+ : [ result ] "=r"(res)
+ : [ constant ] "N"(32), [ input ] "r"(i)
+ :);
+ // arm6-error@219 {{invalid input constraint 'N' in asm}}
+ // arm7-error@219 {{invalid input constraint 'N' in asm}}
+ // thumb1-error@219 {{value '32' out of range for constraint 'N'}}
+ // thumb2-error@219 {{invalid input constraint 'N' in asm}}
+ return res;
+}
+
+// O: Invalid (ARM/Thumb2)
+// An immediate integer which is a multiple of 4 between -508 and 508. (Thumb1)
+int test_O(int i) {
+ int res;
+ __asm(
+ "add %0, %1;"
+ : [ result ] "=r"(res)
+ : [ constant ] "O"(1), [ input ] "r"(i)
+ :);
+ // arm6-error@235 {{invalid input constraint 'O' in asm}}
+ // arm7-error@235 {{invalid input constraint 'O' in asm}}
+ // thumb1-no-error
+ // thumb2-error@235 {{invalid input constraint 'O' in asm}}
+ return res;
+}
+
+// l: Same as r (ARM)
+// A low 32-bit GPR register (r0-r7). (Thumb1/Thumb2)
+int test_l(int i) {
+ int res;
+ __asm(
+ "add %0, %1;"
+ : [ result ] "=l"(res)
+ : [ constant ] "i"(10), [ input ] "l"(i)
+ :); // No errors expected.
+ return res;
+}
+
+// h: Invalid (ARM)
+// A high 32-bit GPR register (r8-r15). (Thumb1/Thumb2)
+int test_h(int i) {
+ int res;
+ __asm(
+ "add %0, %1;"
+ : [ result ] "=h"(res)
+ : [ constant ] "i"(10), [ input ] "h"(i)
+ :);
+ // arm6-error@262 {{invalid output constraint '=h' in asm}}
+ // arm7-error@262 {{invalid output constraint '=h' in asm}}
+ return res;
+}
+
+// s: An integer constant, but allowing only relocatable values.
+int g;
+
+int test_s(int i) {
+ int res;
+ __asm(
+ "add %0, %1;"
+ : [ result ] "=r"(res)
+ : [ constant ] "s"(&g), [ input ] "r"(i)
+ :); // No errors expected.
+ return res;
+}
+
+// w: A 32, 64, or 128-bit floating-point/SIMD register: s0-s31, d0-d31, or q0-q15.
+float test_w(float x) {
+ __asm__("vsqrt.f32 %0, %1"
+ : "=w"(x)
+ : "w"(x)); // No error expected.
+ return x;
+}
+
+// x: A 32, 64, or 128-bit floating-point/SIMD register: s0-s15, d0-d7, or q0-q3.
+float test_x(float x) {
+ __asm__("vsqrt.f32 %0, %1"
+ : "=x"(x)
+ : "x"(x)); // No error expected.
+ return x;
+}
+
+// t: A 32, 64, or 128-bit floating-point/SIMD register: s0-s31, d0-d15, or q0-q7.
+float test_t(float x) {
+ __asm__("vsqrt.f32 %0, %1"
+ : "=t"(x)
+ : "t"(x)); // No error expected.
+ return x;
+}
diff --git a/src/llvm-project/clang/test/Sema/atomic-ops.c b/src/llvm-project/clang/test/Sema/atomic-ops.c
index 638c30f..cc9c6d9 100644
--- a/src/llvm-project/clang/test/Sema/atomic-ops.c
+++ b/src/llvm-project/clang/test/Sema/atomic-ops.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -verify -ffreestanding -fsyntax-only -triple=i686-linux-gnu -std=c11
+// RUN: %clang_cc1 %s -verify -fgnuc-version=4.2.1 -ffreestanding -fsyntax-only -triple=i686-linux-gnu -std=c11
// Basic parsing/Sema tests for __c11_atomic_*
@@ -173,8 +173,8 @@
__atomic_fetch_sub(P, 3, memory_order_seq_cst);
__atomic_fetch_sub(D, 3, memory_order_seq_cst); // expected-error {{must be a pointer to integer or pointer}}
__atomic_fetch_sub(s1, 3, memory_order_seq_cst); // expected-error {{must be a pointer to integer or pointer}}
- __atomic_fetch_min(D, 3, memory_order_seq_cst); // expected-error {{must be a pointer to signed or unsigned 32-bit integer}}
- __atomic_fetch_max(P, 3, memory_order_seq_cst); // expected-error {{must be a pointer to signed or unsigned 32-bit integer}}
+ __atomic_fetch_min(D, 3, memory_order_seq_cst); // expected-error {{must be a pointer to integer}}
+ __atomic_fetch_max(P, 3, memory_order_seq_cst); // expected-error {{must be a pointer to integer}}
__atomic_fetch_max(p, 3); // expected-error {{too few arguments to function call, expected 3, have 2}}
__c11_atomic_fetch_and(i, 1, memory_order_seq_cst);
@@ -354,6 +354,20 @@
(void)__c11_atomic_fetch_xor(Ap, val, memory_order_acq_rel);
(void)__c11_atomic_fetch_xor(Ap, val, memory_order_seq_cst);
+ (void)__c11_atomic_fetch_min(Ap, val, memory_order_relaxed);
+ (void)__c11_atomic_fetch_min(Ap, val, memory_order_acquire);
+ (void)__c11_atomic_fetch_min(Ap, val, memory_order_consume);
+ (void)__c11_atomic_fetch_min(Ap, val, memory_order_release);
+ (void)__c11_atomic_fetch_min(Ap, val, memory_order_acq_rel);
+ (void)__c11_atomic_fetch_min(Ap, val, memory_order_seq_cst);
+
+ (void)__c11_atomic_fetch_max(Ap, val, memory_order_relaxed);
+ (void)__c11_atomic_fetch_max(Ap, val, memory_order_acquire);
+ (void)__c11_atomic_fetch_max(Ap, val, memory_order_consume);
+ (void)__c11_atomic_fetch_max(Ap, val, memory_order_release);
+ (void)__c11_atomic_fetch_max(Ap, val, memory_order_acq_rel);
+ (void)__c11_atomic_fetch_max(Ap, val, memory_order_seq_cst);
+
(void)__c11_atomic_exchange(Ap, val, memory_order_relaxed);
(void)__c11_atomic_exchange(Ap, val, memory_order_acquire);
(void)__c11_atomic_exchange(Ap, val, memory_order_consume);
@@ -501,6 +515,20 @@
(void)__atomic_nand_fetch(p, val, memory_order_acq_rel);
(void)__atomic_nand_fetch(p, val, memory_order_seq_cst);
+ (void)__atomic_max_fetch(p, val, memory_order_relaxed);
+ (void)__atomic_max_fetch(p, val, memory_order_acquire);
+ (void)__atomic_max_fetch(p, val, memory_order_consume);
+ (void)__atomic_max_fetch(p, val, memory_order_release);
+ (void)__atomic_max_fetch(p, val, memory_order_acq_rel);
+ (void)__atomic_max_fetch(p, val, memory_order_seq_cst);
+
+ (void)__atomic_min_fetch(p, val, memory_order_relaxed);
+ (void)__atomic_min_fetch(p, val, memory_order_acquire);
+ (void)__atomic_min_fetch(p, val, memory_order_consume);
+ (void)__atomic_min_fetch(p, val, memory_order_release);
+ (void)__atomic_min_fetch(p, val, memory_order_acq_rel);
+ (void)__atomic_min_fetch(p, val, memory_order_seq_cst);
+
(void)__atomic_exchange_n(p, val, memory_order_relaxed);
(void)__atomic_exchange_n(p, val, memory_order_acquire);
(void)__atomic_exchange_n(p, val, memory_order_consume);
diff --git a/src/llvm-project/clang/test/Sema/attr-c2x.c b/src/llvm-project/clang/test/Sema/attr-c2x.c
new file mode 100644
index 0000000..561b88e
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/attr-c2x.c
@@ -0,0 +1,29 @@
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify -std=c2x %s
+
+struct S {};
+struct S * [[clang::address_space(1)]] Foo;
+
+enum [[clang::enum_extensibility(open)]] EnumOpen {
+ C0 = 1, C1 = 10
+};
+
+enum [[clang::flag_enum]] EnumFlag {
+ D0 = 1, D1 = 8
+};
+
+void foo(void *c) [[clang::overloadable]];
+void foo(char *c) [[clang::overloadable]];
+
+void context_okay(void *context [[clang::swift_context]]) [[clang::swiftcall]];
+void context_okay2(void *context [[clang::swift_context]], void *selfType, char **selfWitnessTable) [[clang::swiftcall]];
+
+void *f1(void) [[clang::ownership_returns(foo)]];
+void *f2() [[clang::ownership_returns(foo)]]; // expected-warning {{'ownership_returns' attribute only applies to non-K&R-style functions}}
+
+void foo2(void) [[clang::unavailable("not available - replaced")]]; // expected-note {{'foo2' has been explicitly marked unavailable here}}
+void bar(void) {
+ foo2(); // expected-error {{'foo2' is unavailable: not available - replaced}}
+}
+
+[[nodiscard]] int without_underscores(void);
+[[__nodiscard__]] int underscores(void);
diff --git a/src/llvm-project/clang/test/Sema/attr-cx2.c b/src/llvm-project/clang/test/Sema/attr-cx2.c
deleted file mode 100644
index ec74edf..0000000
--- a/src/llvm-project/clang/test/Sema/attr-cx2.c
+++ /dev/null
@@ -1,26 +0,0 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify -std=c2x %s
-
-struct S {};
-struct S * [[clang::address_space(1)]] Foo;
-
-enum [[clang::enum_extensibility(open)]] EnumOpen {
- C0 = 1, C1 = 10
-};
-
-enum [[clang::flag_enum]] EnumFlag {
- D0 = 1, D1 = 8
-};
-
-void foo(void *c) [[clang::overloadable]];
-void foo(char *c) [[clang::overloadable]];
-
-void context_okay(void *context [[clang::swift_context]]) [[clang::swiftcall]];
-void context_okay2(void *context [[clang::swift_context]], void *selfType, char **selfWitnessTable) [[clang::swiftcall]];
-
-void *f1(void) [[clang::ownership_returns(foo)]];
-void *f2() [[clang::ownership_returns(foo)]]; // expected-warning {{'ownership_returns' attribute only applies to non-K&R-style functions}}
-
-void foo2(void) [[clang::unavailable("not available - replaced")]]; // expected-note {{'foo2' has been explicitly marked unavailable here}}
-void bar(void) {
- foo2(); // expected-error {{'foo2' is unavailable: not available - replaced}}
-}
diff --git a/src/llvm-project/clang/test/Sema/attr-guard_nocf.c b/src/llvm-project/clang/test/Sema/attr-guard_nocf.c
new file mode 100644
index 0000000..a91640e
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/attr-guard_nocf.c
@@ -0,0 +1,27 @@
+// RUN: %clang_cc1 -triple %ms_abi_triple -fms-extensions -verify -fsyntax-only %s
+// RUN: %clang_cc1 -triple %ms_abi_triple -fms-extensions -verify -std=c++11 -fsyntax-only -x c++ %s
+
+// Function definition.
+__declspec(guard(nocf)) void testGuardNoCF() { // no warning
+}
+
+// Can not be used on variable, parameter, or function pointer declarations.
+int __declspec(guard(nocf)) i; // expected-warning {{'guard' attribute only applies to functions}}
+void testGuardNoCFFuncParam(double __declspec(guard(nocf)) i) {} // expected-warning {{'guard' attribute only applies to functions}}
+__declspec(guard(nocf)) typedef void (*FuncPtrWithGuardNoCF)(void); // expected-warning {{'guard' attribute only applies to functions}}
+
+// 'guard' Attribute requries an argument.
+__declspec(guard) void testGuardNoCFParams() { // expected-error {{'guard' attribute takes one argument}}
+}
+
+// 'guard' Attribute requries an identifier as argument.
+__declspec(guard(1)) void testGuardNoCFParamType() { // expected-error {{'guard' attribute requires an identifier}}
+}
+
+// 'guard' Attribute only takes a single argument.
+__declspec(guard(nocf, nocf)) void testGuardNoCFTooManyParams() { // expected-error {{use of undeclared identifier 'nocf'}}
+}
+
+// 'guard' Attribute argument must be a supported identifier.
+__declspec(guard(cf)) void testGuardNoCFInvalidParam() { // expected-warning {{'guard' attribute argument not supported: 'cf'}}
+}
diff --git a/src/llvm-project/clang/test/Sema/attr-handles.cpp b/src/llvm-project/clang/test/Sema/attr-handles.cpp
new file mode 100644
index 0000000..5abb1e8
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/attr-handles.cpp
@@ -0,0 +1,22 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+// Decl annotations.
+void f(int *a __attribute__((acquire_handle("Fuchsia"))));
+void (*fp)(int handle [[clang::use_handle("Fuchsia")]]);
+auto lambda = [](int handle [[clang::use_handle("Fuchsia")]]){};
+void g(int a __attribute__((acquire_handle("Fuchsia")))); // expected-error {{attribute only applies to output parameters}}
+void h(int *a __attribute__((acquire_handle))); // expected-error {{'acquire_handle' attribute takes one argument}}
+void h(int *a __attribute__((acquire_handle(1)))); // expected-error {{attribute requires a string}}
+void h(int *a __attribute__((acquire_handle("RandomString", "AndAnother")))); // expected-error {{'acquire_handle' attribute takes one argument}}
+__attribute__((release_handle("Fuchsia"))) int i(); // expected-warning {{'release_handle' attribute only applies to parameters}}
+__attribute__((use_handle("Fuchsia"))) int j(); // expected-warning {{'use_handle' attribute only applies to parameters}}
+int a __attribute__((acquire_handle("Fuchsia"))); // expected-warning {{'acquire_handle' attribute only applies to functions, typedefs, and parameters}}
+int (* __attribute__((acquire_handle("Fuchsia"))) fpt)(char *); // expected-warning {{'acquire_handle' attribute only applies to functions, typedefs, and parameters}}
+
+// Type annotations.
+auto lambdat = [](int handle __attribute__((use_handle("Fuchsia"))))
+ __attribute__((acquire_handle("Fuchsia"))) -> int { return 0; };
+int __attribute((acquire_handle("Fuchsia"))) ta; // expected-warning {{'acquire_handle' attribute only applies to functions, typedefs, and parameters}}
+
+// Typedefs.
+typedef int callback(char *) __attribute__((acquire_handle("Fuchsia")));
diff --git a/src/llvm-project/clang/test/Sema/attr-target.c b/src/llvm-project/clang/test/Sema/attr-target.c
index 644d7cb..24969ab 100644
--- a/src/llvm-project/clang/test/Sema/attr-target.c
+++ b/src/llvm-project/clang/test/Sema/attr-target.c
@@ -17,5 +17,6 @@
int __attribute__((target("arch=hiss,arch=woof"))) pine_tree() { return 4; }
//expected-warning@+1 {{duplicate 'arch=' in the 'target' attribute string; 'target' attribute ignored}}
int __attribute__((target("arch=ivybridge,arch=haswell"))) oak_tree() { return 4; }
-
+//expected-warning@+1 {{unsupported 'branch-protection' in the 'target' attribute string; 'target' attribute ignored}}
+int __attribute__((target("branch-protection=none"))) birch_tree() { return 5; }
diff --git a/src/llvm-project/clang/test/Sema/bitwise-op-parentheses.c b/src/llvm-project/clang/test/Sema/bitwise-op-parentheses.c
new file mode 100644
index 0000000..ed270de8
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/bitwise-op-parentheses.c
@@ -0,0 +1,58 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s -DSILENCE
+// RUN: %clang_cc1 -fsyntax-only -verify %s -Wbitwise-op-parentheses
+// RUN: %clang_cc1 -fsyntax-only -verify %s -Wparentheses
+// RUN: %clang_cc1 -fsyntax-only -fdiagnostics-parseable-fixits %s -Wbitwise-op-parentheses 2>&1 | FileCheck %s
+
+#ifdef SILENCE
+// expected-no-diagnostics
+#endif
+
+void bitwise_op_parentheses(unsigned i) {
+ (void)(i & i | i);
+#ifndef SILENCE
+ // expected-warning@-2 {{'&' within '|'}}
+ // expected-note@-3 {{place parentheses around the '&' expression to silence this warning}}
+#endif
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-5]]:10-[[@LINE-5]]:10}:"("
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-6]]:15-[[@LINE-6]]:15}:")"
+
+ (void)(i | i & i);
+#ifndef SILENCE
+ // expected-warning@-2 {{'&' within '|'}}
+ // expected-note@-3 {{place parentheses around the '&' expression to silence this warning}}
+#endif
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-5]]:14-[[@LINE-5]]:14}:"("
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-6]]:19-[[@LINE-6]]:19}:")"
+
+ (void)(i ^ i | i);
+#ifndef SILENCE
+ // expected-warning@-2 {{'^' within '|'}}
+ // expected-note@-3 {{place parentheses around the '^' expression to silence this warning}}
+#endif
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-5]]:10-[[@LINE-5]]:10}:"("
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-6]]:15-[[@LINE-6]]:15}:")"
+
+ (void)(i | i ^ i);
+#ifndef SILENCE
+ // expected-warning@-2 {{'^' within '|'}}
+ // expected-note@-3 {{place parentheses around the '^' expression to silence this warning}}
+#endif
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-5]]:14-[[@LINE-5]]:14}:"("
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-6]]:19-[[@LINE-6]]:19}:")"
+
+ (void)(i & i ^ i);
+#ifndef SILENCE
+ // expected-warning@-2 {{'&' within '^'}}
+ // expected-note@-3 {{place parentheses around the '&' expression to silence this warning}}
+#endif
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-5]]:10-[[@LINE-5]]:10}:"("
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-6]]:15-[[@LINE-6]]:15}:")"
+
+ (void)(i ^ i & i);
+#ifndef SILENCE
+ // expected-warning@-2 {{'&' within '^'}}
+ // expected-note@-3 {{place parentheses around the '&' expression to silence this warning}}
+#endif
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-5]]:14-[[@LINE-5]]:14}:"("
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-6]]:19-[[@LINE-6]]:19}:")"
+}
diff --git a/src/llvm-project/clang/test/Sema/block-return-1.c b/src/llvm-project/clang/test/Sema/block-return-1.c
index 631a2d4..ddb70e2 100644
--- a/src/llvm-project/clang/test/Sema/block-return-1.c
+++ b/src/llvm-project/clang/test/Sema/block-return-1.c
@@ -2,5 +2,5 @@
int j;
void foo() {
- ^ (void) { if (j) return 1; }(); // expected-error {{control may reach end of non-void block}}
+ ^ (void) { if (j) return 1; }(); // expected-error {{non-void block does not return a value in all control paths}}
}
diff --git a/src/llvm-project/clang/test/Sema/block-return-3.c b/src/llvm-project/clang/test/Sema/block-return-3.c
index cd942a7..7f955b7 100644
--- a/src/llvm-project/clang/test/Sema/block-return-3.c
+++ b/src/llvm-project/clang/test/Sema/block-return-3.c
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -fsyntax-only %s -verify -fblocks
void foo() {
- ^ int (void) { }(); // expected-error {{control reaches end of non-void block}}
+ ^ int (void) { }(); // expected-error {{non-void block does not return a value}}
}
diff --git a/src/llvm-project/clang/test/Sema/bpf-attr-preserve-access-index.c b/src/llvm-project/clang/test/Sema/bpf-attr-preserve-access-index.c
new file mode 100644
index 0000000..d6e97cf
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/bpf-attr-preserve-access-index.c
@@ -0,0 +1,48 @@
+// RUN: %clang_cc1 -x c -triple bpf-pc-linux-gnu -dwarf-version=4 -fsyntax-only -verify %s
+
+#define __reloc__ __attribute__((preserve_access_index))
+#define __err_reloc__ __attribute__((preserve_access_index(0)))
+
+struct t1 {
+ int a;
+ int b[4];
+ int c:1;
+} __reloc__;
+
+union t2 {
+ int a;
+ int b[4];
+ int c:1;
+} __reloc__;
+
+struct t3 {
+ int a;
+} __err_reloc__; // expected-error {{'preserve_access_index' attribute takes no arguments}}
+
+struct t4 {
+ union {
+ int a;
+ char b[5];
+ };
+ struct {
+ int c:1;
+ } __reloc__;
+ int d;
+} __reloc__;
+
+struct __reloc__ p;
+struct __reloc__ q;
+struct p {
+ int a;
+};
+
+int a __reloc__; // expected-error {{'preserve_access_index' attribute only applies to structs, unions, and classes}}
+struct s *p __reloc__; // expected-error {{'preserve_access_index' attribute only applies to structs, unions, and classes}}
+
+void invalid1(const int __reloc__ *arg) {} // expected-error {{'preserve_access_index' attribute only applies to structs, unions, and classes}}
+void invalid2() { const int __reloc__ *arg; } // expected-error {{'preserve_access_index' attribute only applies to structs, unions, and classes}}
+int valid3(struct t4 *arg) { return arg->a + arg->b[3] + arg->c + arg->d; }
+int valid4(void *arg) {
+ struct local_t { int a; int b; } __reloc__;
+ return ((struct local_t *)arg)->b;
+}
diff --git a/src/llvm-project/clang/test/Sema/bpf-attr-preserve-access-index.cpp b/src/llvm-project/clang/test/Sema/bpf-attr-preserve-access-index.cpp
new file mode 100644
index 0000000..4a88ec2
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/bpf-attr-preserve-access-index.cpp
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -x c++ -triple bpf-pc-linux-gnu -dwarf-version=4 -fsyntax-only -verify %s
+
+#define __reloc__ __attribute__((preserve_access_index))
+
+struct t1 {
+ int a;
+ int b[4];
+ int c:1;
+} __reloc__; // expected-warning {{'preserve_access_index' attribute ignored}}
diff --git a/src/llvm-project/clang/test/Sema/branch-protection-attr-err.c b/src/llvm-project/clang/test/Sema/branch-protection-attr-err.c
new file mode 100644
index 0000000..cfb53eb
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/branch-protection-attr-err.c
@@ -0,0 +1,22 @@
+// RUN: %clang_cc1 -triple aarch64 -verify -fsyntax-only %s
+
+__attribute__((target("branch-protection=foo"))) // expected-error {{invalid or misplaced branch protection specification 'foo'}}
+void badvalue0() {}
+
+__attribute__((target("branch-protection=+bti"))) // expected-error {{invalid or misplaced branch protection specification '<empty>'}}
+void badvalue1() {}
+
+__attribute__((target("branch-protection=bti+"))) // expected-error {{invalid or misplaced branch protection specification '<empty>'}}
+void badvalue2() {}
+
+__attribute__((target("branch-protection=pac-ret+bkey"))) // expected-error {{invalid or misplaced branch protection specification 'bkey'}}
+void badvalue3() {}
+
+__attribute__((target("branch-protection=bti+leaf"))) // expected-error {{invalid or misplaced branch protection specification 'leaf'}}
+void badoption0() {}
+
+__attribute__((target("branch-protection=bti+leaf+pac-ret"))) // expected-error {{invalid or misplaced branch protection specification 'leaf'}}
+void badorder0() {}
+
+__attribute__ ((target("branch-protection=pac-ret+bti+leaf"))) // expected-error {{invalid or misplaced branch protection specification 'leaf'}}
+void badorder1() {}
diff --git a/src/llvm-project/clang/test/Sema/builtin-align.c b/src/llvm-project/clang/test/Sema/builtin-align.c
new file mode 100644
index 0000000..d4cdc23
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/builtin-align.c
@@ -0,0 +1,133 @@
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -DALIGN_BUILTIN=__builtin_align_down -DRETURNS_BOOL=0 %s -fsyntax-only -verify -Wpedantic
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -DALIGN_BUILTIN=__builtin_align_up -DRETURNS_BOOL=0 %s -fsyntax-only -verify -Wpedantic
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -DALIGN_BUILTIN=__builtin_is_aligned -DRETURNS_BOOL=1 %s -fsyntax-only -verify -Wpedantic
+
+struct Aggregate {
+ int i;
+ int j;
+};
+enum Enum { EnumValue1,
+ EnumValue2 };
+typedef __SIZE_TYPE__ size_t;
+
+void test_parameter_types(char *ptr, size_t size) {
+ struct Aggregate agg;
+ enum Enum e = EnumValue2;
+ _Bool b = 0;
+
+ // The first parameter can be any pointer or integer type:
+ (void)ALIGN_BUILTIN(ptr, 4);
+ (void)ALIGN_BUILTIN(size, 2);
+ (void)ALIGN_BUILTIN(12345, 2);
+ (void)ALIGN_BUILTIN(agg, 2); // expected-error {{operand of type 'struct Aggregate' where arithmetic or pointer type is required}}
+ (void)ALIGN_BUILTIN(e, 2); // expected-error {{operand of type 'enum Enum' where arithmetic or pointer type is required}}
+ (void)ALIGN_BUILTIN(b, 2); // expected-error {{operand of type '_Bool' where arithmetic or pointer type is required}}
+ (void)ALIGN_BUILTIN((int)e, 2); // but with a cast it is fine
+ (void)ALIGN_BUILTIN((int)b, 2); // but with a cast it is fine
+
+ // The second parameter must be an integer type (but not enum or _Bool):
+ (void)ALIGN_BUILTIN(ptr, size);
+ (void)ALIGN_BUILTIN(ptr, ptr); // expected-error {{used type 'char *' where integer is required}}
+ (void)ALIGN_BUILTIN(ptr, agg); // expected-error {{used type 'struct Aggregate' where integer is required}}
+ (void)ALIGN_BUILTIN(ptr, b); // expected-error {{used type '_Bool' where integer is required}}
+ (void)ALIGN_BUILTIN(ptr, e); // expected-error {{used type 'enum Enum' where integer is required}}
+ (void)ALIGN_BUILTIN(ptr, (int)e); // but with a cast enums are fine
+ (void)ALIGN_BUILTIN(ptr, (int)b); // but with a cast booleans are fine
+
+ (void)ALIGN_BUILTIN(ptr, size);
+ (void)ALIGN_BUILTIN(size, size);
+}
+
+void test_result_unused(int i, int align) {
+ // -Wunused-result does not trigger for macros so we can't use ALIGN_BUILTIN()
+ // but need to explicitly call each function.
+ __builtin_align_up(i, align); // expected-warning{{ignoring return value of function declared with const attribute}}
+ __builtin_align_down(i, align); // expected-warning{{ignoring return value of function declared with const attribute}}
+ __builtin_is_aligned(i, align); // expected-warning{{ignoring return value of function declared with const attribute}}
+ ALIGN_BUILTIN(i, align); // no warning here
+}
+
+#define check_same_type(type1, type2) __builtin_types_compatible_p(type1, type2) && __builtin_types_compatible_p(type1 *, type2 *)
+
+void test_return_type(void *ptr, int i, long l) {
+ char array[32];
+ __extension__ typedef typeof(ALIGN_BUILTIN(ptr, 4)) result_type_ptr;
+ __extension__ typedef typeof(ALIGN_BUILTIN(i, 4)) result_type_int;
+ __extension__ typedef typeof(ALIGN_BUILTIN(l, 4)) result_type_long;
+ __extension__ typedef typeof(ALIGN_BUILTIN(array, 4)) result_type_char_array;
+#if RETURNS_BOOL
+ _Static_assert(check_same_type(_Bool, result_type_ptr), "Should return bool");
+ _Static_assert(check_same_type(_Bool, result_type_int), "Should return bool");
+ _Static_assert(check_same_type(_Bool, result_type_long), "Should return bool");
+ _Static_assert(check_same_type(_Bool, result_type_char_array), "Should return bool");
+#else
+ _Static_assert(check_same_type(void *, result_type_ptr), "Should return void*");
+ _Static_assert(check_same_type(int, result_type_int), "Should return int");
+ _Static_assert(check_same_type(long, result_type_long), "Should return long");
+ // Check that we can use the alignment builtins on on array types (result should decay)
+ _Static_assert(check_same_type(char *, result_type_char_array),
+ "Using the builtins on an array should yield the decayed type");
+#endif
+}
+
+void test_invalid_alignment_values(char *ptr, long *longptr, size_t align) {
+ int x = 1;
+ (void)ALIGN_BUILTIN(ptr, 2);
+ (void)ALIGN_BUILTIN(longptr, 1024);
+ (void)ALIGN_BUILTIN(x, 32);
+
+ (void)ALIGN_BUILTIN(ptr, 0); // expected-error {{requested alignment must be 1 or greater}}
+ (void)ALIGN_BUILTIN(ptr, 1);
+#if RETURNS_BOOL
+ // expected-warning@-2 {{checking whether a value is aligned to 1 byte is always true}}
+#else
+ // expected-warning@-4 {{aligning a value to 1 byte is a no-op}}
+#endif
+ (void)ALIGN_BUILTIN(ptr, 3); // expected-error {{requested alignment is not a power of 2}}
+ (void)ALIGN_BUILTIN(x, 7); // expected-error {{requested alignment is not a power of 2}}
+
+ // check the maximum range for smaller types:
+ __UINT8_TYPE__ c = ' ';
+
+ (void)ALIGN_BUILTIN(c, 128); // this is fine
+ (void)ALIGN_BUILTIN(c, 256); // expected-error {{requested alignment must be 128 or smaller}}
+ (void)ALIGN_BUILTIN(x, 1ULL << 31); // this is also fine
+ (void)ALIGN_BUILTIN(x, 1LL << 31); // this is also fine
+ __INT32_TYPE__ i32 = 3;
+ __UINT32_TYPE__ u32 = 3;
+ // Maximum is the same for int32 and uint32
+ (void)ALIGN_BUILTIN(i32, 1ULL << 32); // expected-error {{requested alignment must be 2147483648 or smaller}}
+ (void)ALIGN_BUILTIN(u32, 1ULL << 32); // expected-error {{requested alignment must be 2147483648 or smaller}}
+ (void)ALIGN_BUILTIN(ptr, ((__int128)1) << 65); // expected-error {{requested alignment must be 9223372036854775808 or smaller}}
+ (void)ALIGN_BUILTIN(longptr, ((__int128)1) << 65); // expected-error {{requested alignment must be 9223372036854775808 or smaller}}
+
+ const int bad_align = 8 + 1;
+ (void)ALIGN_BUILTIN(ptr, bad_align); // expected-error {{requested alignment is not a power of 2}}
+}
+
+// Check that it can be used in constant expressions:
+void constant_expression(int x) {
+ _Static_assert(__builtin_is_aligned(1024, 512), "");
+ _Static_assert(!__builtin_is_aligned(256, 512ULL), "");
+ _Static_assert(__builtin_align_up(33, 32) == 64, "");
+ _Static_assert(__builtin_align_down(33, 32) == 32, "");
+
+ // But not if one of the arguments isn't constant:
+ _Static_assert(ALIGN_BUILTIN(33, x) != 100, ""); // expected-error {{static_assert expression is not an integral constant expression}}
+ _Static_assert(ALIGN_BUILTIN(x, 4) != 100, ""); // expected-error {{static_assert expression is not an integral constant expression}}
+}
+
+// Check that it is a constant expression that can be assigned to globals:
+int global1 = __builtin_align_down(33, 8);
+int global2 = __builtin_align_up(33, 8);
+_Bool global3 = __builtin_is_aligned(33, 8);
+
+extern void test_ptr(char *c);
+char *test_array_and_fnptr(void) {
+ char buf[1024];
+ // The builtins should also work on arrays (decaying the return type)
+ (void)(ALIGN_BUILTIN(buf, 16));
+ // But not on functions and function pointers:
+ (void)(ALIGN_BUILTIN(test_array_and_fnptr, 16)); // expected-error{{operand of type 'char *(void)' where arithmetic or pointer type is required}}
+ (void)(ALIGN_BUILTIN(&test_array_and_fnptr, 16)); // expected-error{{operand of type 'char *(*)(void)' where arithmetic or pointer type is required}}
+}
diff --git a/src/llvm-project/clang/test/Sema/builtin-assume-aligned.c b/src/llvm-project/clang/test/Sema/builtin-assume-aligned.c
index 057a500..565dc66 100644
--- a/src/llvm-project/clang/test/Sema/builtin-assume-aligned.c
+++ b/src/llvm-project/clang/test/Sema/builtin-assume-aligned.c
@@ -58,3 +58,7 @@
void *test_no_fn_proto() __attribute__((assume_aligned())); // expected-error {{'assume_aligned' attribute takes at least 1 argument}}
void *test_no_fn_proto() __attribute__((assume_aligned(32, 45, 37))); // expected-error {{'assume_aligned' attribute takes no more than 2 arguments}}
+int pr43638(int *a) {
+ a = __builtin_assume_aligned(a, 1073741824); // expected-warning {{requested alignment must be 536870912 bytes or smaller; maximum alignment assumed}}
+return a[0];
+}
diff --git a/src/llvm-project/clang/test/Sema/builtin-fpclassification.c b/src/llvm-project/clang/test/Sema/builtin-fpclassification.c
new file mode 100644
index 0000000..83e248b
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/builtin-fpclassification.c
@@ -0,0 +1,91 @@
+// RUN: %clang_cc1 %s -Wno-unused-value -verify -fsyntax-only
+// RUN: %clang_cc1 %s -Wno-unused-value -ast-dump -DAST_CHECK | FileCheck %s
+
+struct S {};
+void usage(float f, int i, double d) {
+#ifdef AST_CHECK
+ __builtin_fpclassify(d, 1, i, i, 3, d);
+ //CHECK: CallExpr
+ //CHECK-NEXT: ImplicitCastExpr
+ //CHECK-SAME: <BuiltinFnToFnPtr>
+ //CHECK-NEXT: DeclRefExpr
+ //CHECK-SAME: '__builtin_fpclassify'
+ //CHECK-NEXT: ImplicitCastExpr
+ //CHECK-SAME: 'int' <FloatingToIntegral>
+ //CHECK-NEXT: ImplicitCastExpr
+ //CHECK-SAME: 'double' <LValueToRValue>
+ //CHECK-NEXT: DeclRefExpr
+ //CHECK-SAME: 'd' 'double'
+ //CHECK-NEXT: IntegerLiteral
+ //CHECK-NEXT: ImplicitCastExpr
+ //CHECK-SAME: 'int' <LValueToRValue>
+ //CHECK-NEXT: DeclRefExpr
+ //CHECK-SAME: 'i' 'int'
+ //CHECK-NEXT: ImplicitCastExpr
+ //CHECK-SAME: 'int' <LValueToRValue>
+ //CHECK-NEXT: DeclRefExpr
+ //CHECK-SAME: 'i' 'int'
+ //CHECK-NEXT: IntegerLiteral
+ //CHECK-NEXT: ImplicitCastExpr
+ //CHECK-SAME: 'double' <LValueToRValue>
+ //CHECK-NEXT: DeclRefExpr
+ //CHECK-SAME: 'd' 'double'
+
+ __builtin_fpclassify(f, 1, i, i, 3, f);
+ //CHECK: CallExpr
+ //CHECK-NEXT: ImplicitCastExpr
+ //CHECK-SAME: <BuiltinFnToFnPtr>
+ //CHECK-NEXT: DeclRefExpr
+ //CHECK-SAME: '__builtin_fpclassify'
+ //CHECK-NEXT: ImplicitCastExpr
+ //CHECK-SAME: 'int' <FloatingToIntegral>
+ //CHECK-NEXT: ImplicitCastExpr
+ //CHECK-SAME: 'float' <LValueToRValue>
+ //CHECK-NEXT: DeclRefExpr
+ //CHECK-SAME: 'f' 'float'
+ //CHECK-NEXT: IntegerLiteral
+ //CHECK-NEXT: ImplicitCastExpr
+ //CHECK-SAME: 'int' <LValueToRValue>
+ //CHECK-NEXT: DeclRefExpr
+ //CHECK-SAME: 'i' 'int'
+ //CHECK-NEXT: ImplicitCastExpr
+ //CHECK-SAME: 'int' <LValueToRValue>
+ //CHECK-NEXT: DeclRefExpr
+ //CHECK-SAME: 'i' 'int'
+ //CHECK-NEXT: IntegerLiteral
+ //CHECK-NEXT: ImplicitCastExpr
+ //CHECK-SAME: 'float' <LValueToRValue>
+ //CHECK-NEXT: DeclRefExpr
+ //CHECK-SAME: 'f' 'float'
+
+ __builtin_isfinite(f);
+ //CHECK: CallExpr
+ //CHECK-NEXT: ImplicitCastExpr
+ //CHECK-SAME: <BuiltinFnToFnPtr>
+ //CHECK-NEXT: DeclRefExpr
+ //CHECK-SAME: '__builtin_isfinite'
+ //CHECK-NEXT: ImplicitCastExpr
+ //CHECK-SAME: 'float' <LValueToRValue>
+ //CHECK-NEXT: DeclRefExpr
+ //CHECK-SAME: 'f' 'float'
+
+ __builtin_isfinite(d);
+ //CHECK: CallExpr
+ //CHECK-NEXT: ImplicitCastExpr
+ //CHECK-SAME: <BuiltinFnToFnPtr>
+ //CHECK-NEXT: DeclRefExpr
+ //CHECK-SAME: '__builtin_isfinite'
+ //CHECK-NEXT: ImplicitCastExpr
+ //CHECK-SAME: 'double' <LValueToRValue>
+ //CHECK-NEXT: DeclRefExpr
+ //CHECK-SAME: 'd' 'double'
+#else
+ struct S s;
+ // expected-error@+1{{passing 'struct S' to parameter of incompatible type 'int'}}
+ __builtin_fpclassify(d, s, i, i, 3, d);
+ // expected-error@+1{{floating point classification requires argument of floating point type (passed in 'int')}}
+ __builtin_fpclassify(d, 1, i, i, 3, i);
+ // expected-error@+1{{floating point classification requires argument of floating point type (passed in 'int')}}
+ __builtin_isfinite(i);
+#endif
+}
diff --git a/src/llvm-project/clang/test/Sema/builtin-preserve-access-index.c b/src/llvm-project/clang/test/Sema/builtin-preserve-access-index.c
index c10ceb5..8cd829d 100644
--- a/src/llvm-project/clang/test/Sema/builtin-preserve-access-index.c
+++ b/src/llvm-project/clang/test/Sema/builtin-preserve-access-index.c
@@ -4,10 +4,36 @@
return __builtin_preserve_access_index(&arg[1], 1); // expected-error {{too many arguments to function call, expected 1, have 2}}
}
-void *invalid2(const int *arg) {
- return __builtin_preserve_access_index(&arg[1]); // expected-warning {{returning 'const void *' from a function with result type 'void *' discards qualifiers}}
+int valid2(void) {
+ return __builtin_preserve_access_index(1);
}
-const void *invalid3(const int *arg) {
- return __builtin_preserve_access_index(1); // expected-warning {{incompatible integer to pointer conversion passing 'int' to parameter of type 'const void *'}}
+void *invalid3(const int *arg) {
+ return __builtin_preserve_access_index(&arg[1]); // expected-warning {{returning 'const int *' from a function with result type 'void *' discards qualifiers}}
+}
+
+const void *invalid4(volatile const int *arg) {
+ return __builtin_preserve_access_index(arg); // expected-warning {{returning 'const volatile int *' from a function with result type 'const void *' discards qualifiers}}
+}
+
+int *valid5(int *arg) {
+ return __builtin_preserve_access_index(arg);
+}
+
+int valid6(const volatile int *arg) {
+ return *__builtin_preserve_access_index(arg);
+}
+
+struct s { int a; int b; };
+
+int valid7(struct s *arg) {
+ return *__builtin_preserve_access_index(&arg->b);
+}
+
+int valid8(struct s *arg) {
+ return __builtin_preserve_access_index(arg->a + arg->b);
+}
+
+int valid9(struct s *arg) {
+ return __builtin_preserve_access_index(({arg->a = 2; arg->b = 3; }));
}
diff --git a/src/llvm-project/clang/test/Sema/builtins-bpf.c b/src/llvm-project/clang/test/Sema/builtins-bpf.c
new file mode 100644
index 0000000..8df9697
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/builtins-bpf.c
@@ -0,0 +1,48 @@
+// RUN: %clang_cc1 -x c -triple bpf-pc-linux-gnu -dwarf-version=4 -fsyntax-only -verify %s
+
+struct s { int a; int b[4]; int c:1; };
+union u { int a; int b[4]; int c:1; };
+
+unsigned invalid1(const int *arg) {
+ return __builtin_preserve_field_info(arg, 1); // expected-error {{__builtin_preserve_field_info argument 1 not a field access}}
+}
+
+unsigned invalid2(const int *arg) {
+ return __builtin_preserve_field_info(*arg, 1); // expected-error {{__builtin_preserve_field_info argument 1 not a field access}}
+}
+
+void *invalid3(struct s *arg) {
+ return __builtin_preserve_field_info(arg->a, 1); // expected-warning {{incompatible integer to pointer conversion returning 'unsigned int' from a function with result type 'void *'}}
+}
+
+unsigned valid4(struct s *arg) {
+ return __builtin_preserve_field_info(arg->b[1], 1);
+}
+
+unsigned valid5(union u *arg) {
+ return __builtin_preserve_field_info(arg->b[2], 1);
+}
+
+unsigned valid6(struct s *arg) {
+ return __builtin_preserve_field_info(arg->a, 1);
+}
+
+unsigned valid7(struct s *arg) {
+ return __builtin_preserve_field_info(arg->c, 1ULL);
+}
+
+unsigned valid8(union u *arg) {
+ return __builtin_preserve_field_info(arg->a, 1);
+}
+
+unsigned valid9(union u *arg) {
+ return __builtin_preserve_field_info(arg->c, 'a');
+}
+
+unsigned invalid10(struct s *arg) {
+ return __builtin_preserve_field_info(arg->a, arg); // expected-error {{__builtin_preserve_field_info argument 2 not a constant}}
+}
+
+unsigned invalid11(struct s *arg, int info_kind) {
+ return __builtin_preserve_field_info(arg->a, info_kind); // expected-error {{__builtin_preserve_field_info argument 2 not a constant}}
+}
diff --git a/src/llvm-project/clang/test/Sema/builtins-mips-features.c b/src/llvm-project/clang/test/Sema/builtins-mips-features.c
new file mode 100644
index 0000000..4ea36d7
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/builtins-mips-features.c
@@ -0,0 +1,37 @@
+// REQUIRES: mips-registered-target
+// RUN: %clang_cc1 -triple mips64 -fsyntax-only -verify %s
+
+typedef signed char v4i8 __attribute__ ((vector_size(4)));
+typedef signed char v4q7 __attribute__ ((vector_size(4)));
+typedef signed char v16i8 __attribute__((vector_size(16), aligned(16)));
+typedef unsigned char v16u8 __attribute__((vector_size(16), aligned(16)));
+
+void dsp() {
+ v4i8 a;
+ void* p;
+
+ // expected-error@+1 {{this builtin requires 'dsp' ASE, please use -mdsp}}
+ __builtin_mips_addu_qb(a, a);
+ // expected-error@+1 {{this builtin requires 'dsp' ASE, please use -mdsp}}
+ __builtin_mips_lwx(p, 32);
+}
+
+void dspr2() {
+ v4i8 a;
+ v4q7 b;
+
+ // expected-error@+1 {{this builtin requires 'dsp r2' ASE, please use -mdspr2}}
+ __builtin_mips_absq_s_qb(b);
+ // expected-error@+1 {{this builtin requires 'dsp r2' ASE, please use -mdspr2}}
+ __builtin_mips_subuh_r_qb(a, a);
+}
+
+void msa() {
+ v16i8 a;
+ v16u8 b;
+
+ // expected-error@+1 {{this builtin requires 'msa' ASE, please use -mmsa}}
+ __builtin_msa_add_a_b(a, a);
+ // expected-error@+1 {{this builtin requires 'msa' ASE, please use -mmsa}}
+ __builtin_msa_xori_b(b, 5);
+}
diff --git a/src/llvm-project/clang/test/Sema/builtins-x86.c b/src/llvm-project/clang/test/Sema/builtins-x86.c
index 6a2a47d..cbaf7bc 100644
--- a/src/llvm-project/clang/test/Sema/builtins-x86.c
+++ b/src/llvm-project/clang/test/Sema/builtins-x86.c
@@ -37,7 +37,7 @@
return __builtin_ia32_cmpsd(__a, __b, 32); // expected-error {{argument value 32 is outside the valid range [0, 31]}}
}
-__mmask16 test__builtin_ia32_cmpps512_mask(__m512d __a, __m512d __b) {
+__mmask16 test__builtin_ia32_cmpps512_mask(__m512 __a, __m512 __b) {
return __builtin_ia32_cmpps512_mask(__a, __b, 32, -1, 4); // expected-error {{argument value 32 is outside the valid range [0, 31]}}
}
@@ -81,6 +81,19 @@
return __builtin_ia32_cmpps512_mask(__a, __b, 0, __u, 0); // expected-error {{invalid rounding argument}}
}
+// Make sure we allow 4(CUR_DIRECTION), 8(NO_EXC), and 12(CUR_DIRECTION|NOEXC) for SAE arguments.
+__mmask16 test__builtin_ia32_cmpps512_mask_rounding_cur_dir(__m512 __a, __m512 __b, __mmask16 __u) {
+ return __builtin_ia32_cmpps512_mask(__a, __b, 0, __u, 4); // no-error
+}
+
+__mmask16 test__builtin_ia32_cmpps512_mask_rounding_sae1(__m512 __a, __m512 __b, __mmask16 __u) {
+ return __builtin_ia32_cmpps512_mask(__a, __b, 0, __u, 8); // no-error
+}
+
+__mmask16 test__builtin_ia32_cmpps512_mask_rounding_sae2(__m512 __a, __m512 __b, __mmask16 __u) {
+ return __builtin_ia32_cmpps512_mask(__a, __b, 0, __u, 12); // no-error
+}
+
__m512 test__builtin_ia32_getmantps512_mask(__m512 a, __m512 b) {
return __builtin_ia32_getmantps512_mask(a, 0, b, (__mmask16)-1, 10); // expected-error {{invalid rounding argument}}
}
@@ -172,3 +185,19 @@
__m128i test_mm128_shrdi_epi16(__m128i __A, __m128i __B) {
return __builtin_ia32_vpshrdw128(__A, __B, 1024); // expected-error {{argument value 1024 is outside the valid range [0, 255]}}
}
+
+unsigned char test_lwpins32(unsigned int data2, unsigned int data1, unsigned int flags) {
+ return __builtin_ia32_lwpins32(data2, data1, flags); // expected-error {{argument to '__builtin_ia32_lwpins32' must be a constant integer}}
+}
+
+void test_lwpval32(unsigned int data2, unsigned int data1, unsigned int flags) {
+ __builtin_ia32_lwpval32(data2, data1, flags); // expected-error {{argument to '__builtin_ia32_lwpval32' must be a constant integer}}
+}
+
+unsigned char test_lwpins64(unsigned long long data2, unsigned long long data1, unsigned int flags) {
+ return __builtin_ia32_lwpins64(data2, data1, flags); // expected-error {{argument to '__builtin_ia32_lwpins64' must be a constant integer}}
+}
+
+void test_lwpval64(unsigned long long data2, unsigned long long data1, unsigned int flags) {
+ __builtin_ia32_lwpval64(data2, data1, flags); // expected-error {{argument to '__builtin_ia32_lwpval64' must be a constant integer}}
+}
diff --git a/src/llvm-project/clang/test/Sema/c2x-nodiscard.c b/src/llvm-project/clang/test/Sema/c2x-nodiscard.c
index 5eaeda4..cf1f081 100644
--- a/src/llvm-project/clang/test/Sema/c2x-nodiscard.c
+++ b/src/llvm-project/clang/test/Sema/c2x-nodiscard.c
@@ -6,10 +6,12 @@
struct [[nodiscard nodiscard]] S2 { // expected-error {{attribute 'nodiscard' cannot appear multiple times in an attribute specifier}}
int i;
};
-struct [[nodiscard("Wrong")]] S3 { // expected-error {{'nodiscard' cannot have an argument list}}
+struct [[nodiscard("Wrong")]] S3 { // FIXME: may need an extension warning.
int i;
};
+struct S3 get_s3(void);
+
[[nodiscard]] int f1(void);
enum [[nodiscard]] E1 { One };
@@ -27,11 +29,13 @@
void f2(void) {
get_s(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ get_s3(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute: Wrong}}
get_i(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
get_e(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
// Okay, warnings are not encouraged
(void)get_s();
+ (void)get_s3();
(void)get_i();
(void)get_e();
}
diff --git a/src/llvm-project/clang/test/Sema/conversion.c b/src/llvm-project/clang/test/Sema/conversion.c
index 07b22a8..ba4adbd 100644
--- a/src/llvm-project/clang/test/Sema/conversion.c
+++ b/src/llvm-project/clang/test/Sema/conversion.c
@@ -233,7 +233,7 @@
takes_int(v);
takes_long(v);
takes_longlong(v);
- takes_float(v);
+ takes_float(v); // expected-warning {{implicit conversion from 'int' to 'float' may lose precision}}
takes_double(v);
takes_longdouble(v);
}
@@ -244,8 +244,8 @@
takes_int(v); // expected-warning {{implicit conversion loses integer precision}}
takes_long(v);
takes_longlong(v);
- takes_float(v);
- takes_double(v);
+ takes_float(v); // expected-warning {{implicit conversion from 'long' to 'float' may lose precision}}
+ takes_double(v); // expected-warning {{implicit conversion from 'long' to 'double' may lose precision}}
takes_longdouble(v);
}
@@ -255,8 +255,8 @@
takes_int(v); // expected-warning {{implicit conversion loses integer precision}}
takes_long(v);
takes_longlong(v);
- takes_float(v);
- takes_double(v);
+ takes_float(v); // expected-warning {{implicit conversion from 'long long' to 'float' may lose precision}}
+ takes_double(v); // expected-warning {{implicit conversion from 'long long' to 'double' may lose precision}}
takes_longdouble(v);
}
diff --git a/src/llvm-project/clang/test/Sema/crash-invalid-builtin.c b/src/llvm-project/clang/test/Sema/crash-invalid-builtin.c
index 1c5221f..8f749f7 100644
--- a/src/llvm-project/clang/test/Sema/crash-invalid-builtin.c
+++ b/src/llvm-project/clang/test/Sema/crash-invalid-builtin.c
@@ -1,4 +1,4 @@
// RUN: %clang_cc1 -triple=x86_64-apple-darwin -fsyntax-only -verify %s
// PR23086
-__builtin_isinf(...); // expected-warning {{type specifier missing, defaults to 'int'}} expected-error {{ISO C requires a named parameter before '...'}} // expected-error {{conflicting types for '__builtin_isinf'}} // expected-note {{'__builtin_isinf' is a builtin with type 'int ()'}}
+__builtin_isinf(...); // expected-warning {{type specifier missing, defaults to 'int'}} expected-error {{ISO C requires a named parameter before '...'}} // expected-error {{cannot redeclare builtin function '__builtin_isinf'}} // expected-note {{'__builtin_isinf' is a builtin with type 'int ()'}}
diff --git a/src/llvm-project/clang/test/Sema/designated-initializers.c b/src/llvm-project/clang/test/Sema/designated-initializers.c
index 43f3318..4239b5e 100644
--- a/src/llvm-project/clang/test/Sema/designated-initializers.c
+++ b/src/llvm-project/clang/test/Sema/designated-initializers.c
@@ -46,7 +46,7 @@
struct point array2[10] = {
[10].x = 2.0, // expected-error{{array designator index (10) exceeds array bounds (10)}}
[4 ... 5].y = 2.0, // expected-note 2 {{previous initialization is here}}
- [4 ... 6] = { .x = 3, .y = 4.0 } // expected-warning 2 {{subobject initialization overrides initialization of other fields within its enclosing subobject}}
+ [4 ... 6] = { .x = 3, .y = 4.0 } // expected-warning 2 {{initializer overrides prior initialization of this subobject}}
};
struct point array3[10] = {
@@ -130,10 +130,10 @@
void test() {
struct X xs[] = {
[0] = (struct X){1, 2}, // expected-note 2 {{previous initialization is here}}
- [0].c = 3, // expected-warning{{subobject initialization overrides initialization of other fields within its enclosing subobject}}
+ [0].c = 3, // expected-warning{{initializer partially overrides prior initialization of this subobject}}
(struct X) {4, 5, 6}, // expected-note{{previous initialization is here}}
- [1].b = get8(), // expected-warning{{subobject initialization overrides initialization of other fields within its enclosing subobject}}
- [0].b = 8 // expected-warning{{subobject initialization overrides initialization of other fields within its enclosing subobject}}
+ [1].b = get8(), // expected-warning{{initializer partially overrides prior initialization of this subobject}}
+ [0].b = 8 // expected-warning{{initializer partially overrides prior initialization of this subobject}}
};
}
@@ -331,20 +331,20 @@
char L[6];
int M;
} overwrite_string[] = {
- { { "foo" }, 1 }, // expected-note {{previous initialization is here}}
- [0].L[2] = 'x' // expected-warning{{subobject initialization overrides initialization of other fields}}
+ { { "foo" }, 1 }, // expected-note{{previous initialization is here}}
+ [0].L[2] = 'x' // expected-warning{{initializer partially overrides prior initialization of this subobject}}
};
struct overwrite_string_struct2 {
char L[6];
int M;
} overwrite_string2[] = {
{ { "foo" }, 1 }, // expected-note{{previous initialization is here}}
- [0].L[4] = 'x' // expected-warning{{subobject initialization overrides initialization of other fields}}
+ [0].L[4] = 'x' // expected-warning{{initializer partially overrides prior initialization of this subobject}}
};
struct overwrite_string_struct
overwrite_string3[] = {
"foo", 1, // expected-note{{previous initialization is here}}
- [0].L[4] = 'x' // expected-warning{{subobject initialization overrides initialization of other fields}}
+ [0].L[4] = 'x' // expected-warning{{initializer partially overrides prior initialization of this subobject}}
};
struct overwrite_string_struct
overwrite_string4[] = {
@@ -364,7 +364,7 @@
},
.u1 = {
- .a = 0,
- .b = 0,
+ .a = 0, // expected-note {{previous initialization is here}}
+ .b = 0, // expected-warning {{initializer overrides prior initialization of this subobject}}
},
};
diff --git a/src/llvm-project/clang/test/Sema/div-sizeof-array.cpp b/src/llvm-project/clang/test/Sema/div-sizeof-array.cpp
new file mode 100644
index 0000000..e295a9d
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/div-sizeof-array.cpp
@@ -0,0 +1,45 @@
+// RUN: %clang_cc1 %s -verify -Wsizeof-array-div -fsyntax-only -triple=x86_64-linux-gnu
+// RUN: %clang_cc1 %s -verify -fsyntax-only -triple=x86_64-linux-gnu
+
+template <typename Ty, int N>
+int f(Ty (&Array)[N]) {
+ return sizeof(Array) / sizeof(Ty); // Should not warn
+}
+
+typedef int int32;
+
+void test(void) {
+ int arr[12]; // expected-note 2 {{array 'arr' declared here}}
+ unsigned long long arr2[4];
+ int *p = &arr[0];
+ int a1 = sizeof(arr) / sizeof(*arr);
+ int a2 = sizeof arr / sizeof p; // expected-warning {{expression does not compute the number of elements in this array; element type is 'int', not 'int *'}}
+ // expected-note@-1 {{place parentheses around the 'sizeof p' expression to silence this warning}}
+ int a4 = sizeof arr2 / sizeof p;
+ int a5 = sizeof(arr) / sizeof(short); // expected-warning {{expression does not compute the number of elements in this array; element type is 'int', not 'short'}}
+ // expected-note@-1 {{place parentheses around the 'sizeof(short)' expression to silence this warning}}
+ int a6 = sizeof(arr) / sizeof(int32);
+ int a7 = sizeof(arr) / sizeof(int);
+ int a9 = sizeof(arr) / sizeof(unsigned int);
+ const char arr3[2] = "A";
+ int a10 = sizeof(arr3) / sizeof(char);
+ int a11 = sizeof(arr2) / (sizeof(unsigned));
+ int a12 = sizeof(arr) / (sizeof(short));
+ int a13 = sizeof(arr3) / sizeof(p);
+ int a14 = sizeof(arr3) / sizeof(int);
+
+ int arr4[10][12];
+ int b1 = sizeof(arr4) / sizeof(arr2[12]);
+ int b2 = sizeof(arr4) / sizeof(int *);
+ int b3 = sizeof(arr4) / sizeof(short *);
+ int arr5[][5] = {
+ {1, 2, 3, 4, 5},
+ {6, 7, 8, 9, 0},
+ };
+ int c1 = sizeof(arr5) / sizeof(*arr5);
+ int c2 = sizeof(arr5) / sizeof(**arr5);
+ int c3 = sizeof(arr5) / sizeof(int);
+
+ float m[4][4];
+ int d1 = sizeof(m) / sizeof(**m);
+}
diff --git a/src/llvm-project/clang/test/Sema/div-sizeof-ptr.cpp b/src/llvm-project/clang/test/Sema/div-sizeof-ptr.cpp
index 4a411ff..abb7bba 100644
--- a/src/llvm-project/clang/test/Sema/div-sizeof-ptr.cpp
+++ b/src/llvm-project/clang/test/Sema/div-sizeof-ptr.cpp
@@ -5,12 +5,22 @@
return sizeof(Array) / sizeof(Ty); // Should not warn
}
-void test(int *p, int **q) {
- int a1 = sizeof(p) / sizeof(*p); // expected-warning {{'sizeof (p)' will return the size of the pointer, not the array itself}}
- int a2 = sizeof p / sizeof *p; // expected-warning {{'sizeof p' will return the size of the pointer, not the array itself}}
- int a3 = sizeof(*q) / sizeof(**q); // expected-warning {{'sizeof (*q)' will return the size of the pointer, not the array itself}}
- int a4 = sizeof(p) / sizeof(int); // expected-warning {{'sizeof (p)' will return the size of the pointer, not the array itself}}
- int a5 = sizeof(p) / sizeof(p[0]); // expected-warning {{'sizeof (p)' will return the size of the pointer, not the array itself}}
+typedef int int32;
+
+void test(int *p, int **q) { // expected-note 5 {{pointer 'p' declared here}}
+ const int *r; // expected-note {{pointer 'r' declared here}}
+ int a1 = sizeof(p) / sizeof(*p); // expected-warning {{'sizeof (p)' will return the size of the pointer, not the array itself}}
+ int a2 = sizeof p / sizeof *p; // expected-warning {{'sizeof p' will return the size of the pointer, not the array itself}}
+ int a3 = sizeof(p) / sizeof(int); // expected-warning {{'sizeof (p)' will return the size of the pointer, not the array itself}}
+ int a4 = sizeof(p) / sizeof(p[0]); // expected-warning {{'sizeof (p)' will return the size of the pointer, not the array itself}}
+ int a5 = sizeof(p) / sizeof(int32); // expected-warning {{'sizeof (p)' will return the size of the pointer, not the array itself}}
+ int a6 = sizeof(r) / sizeof(int); // expected-warning {{'sizeof (r)' will return the size of the pointer, not the array itself}}
+
+ int32 *d; // expected-note 2 {{pointer 'd' declared here}}
+ int a7 = sizeof(d) / sizeof(int32); // expected-warning {{'sizeof (d)' will return the size of the pointer, not the array itself}}
+ int a8 = sizeof(d) / sizeof(int); // expected-warning {{'sizeof (d)' will return the size of the pointer, not the array itself}}
+
+ int a9 = sizeof(*q) / sizeof(**q); // expected-warning {{'sizeof (*q)' will return the size of the pointer, not the array itself}}
// Should not warn
int b1 = sizeof(int *) / sizeof(int);
@@ -19,10 +29,10 @@
int b4 = sizeof(p) / sizeof(char);
int arr[10];
- int b5 = sizeof(arr) / sizeof(*arr);
- int b6 = sizeof(arr) / sizeof(arr[0]);
- int b7 = sizeof(arr) / sizeof(int);
+ int c1 = sizeof(arr) / sizeof(*arr);
+ int c2 = sizeof(arr) / sizeof(arr[0]);
+ int c3 = sizeof(arr) / sizeof(int);
int arr2[10][12];
- int b8 = sizeof(arr2) / sizeof(*arr2);
+ int d1 = sizeof(arr2) / sizeof(*arr2);
}
diff --git a/src/llvm-project/clang/test/Sema/eval-info.c b/src/llvm-project/clang/test/Sema/eval-info.c
new file mode 100644
index 0000000..7f4de4b
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/eval-info.c
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 %s -fsyntax-only -triple x86_64-unknown-windows-msvc -verify
+
+// expected-no-diagnostics
+
+// Make sure the new constant interpolator is not enabled unintentionally
+// to cause assertion.
+typedef enum x {
+ a = 1,
+} x;
diff --git a/src/llvm-project/clang/test/Sema/exprs.c b/src/llvm-project/clang/test/Sema/exprs.c
index 5da4f94..760c45e 100644
--- a/src/llvm-project/clang/test/Sema/exprs.c
+++ b/src/llvm-project/clang/test/Sema/exprs.c
@@ -119,7 +119,7 @@
// PR3753
int test12(const char *X) {
- return X == "foo"; // expected-warning {{comparison against a string literal is unspecified (use strncmp instead)}}
+ return X == "foo"; // expected-warning {{comparison against a string literal is unspecified (use an explicit string comparison function instead)}}
}
int test12b(const char *X) {
@@ -179,17 +179,27 @@
test18_e(); // expected-error {{too few arguments to function call, expected at least 2, have 0}}
}
+typedef int __attribute__((address_space(256))) int_AS256;
// PR7569
void test19() {
- *(int*)0 = 0; // expected-warning {{indirection of non-volatile null pointer}} \
+ *(int *)0 = 0; // expected-warning {{indirection of non-volatile null pointer}} \
// expected-note {{consider using __builtin_trap}}
- *(volatile int*)0 = 0; // Ok.
+ *(volatile int *)0 = 0; // Ok.
+ *(int __attribute__((address_space(256))) *)0 = 0; // Ok.
+ *(int __attribute__((address_space(0))) *)0 = 0; // expected-warning {{indirection of non-volatile null pointer}} \
+ // expected-note {{consider using __builtin_trap}}
+ *(int_AS256 *)0 = 0; // Ok.
// rdar://9269271
- int x = *(int*)0; // expected-warning {{indirection of non-volatile null pointer}} \
+ int x = *(int *)0; // expected-warning {{indirection of non-volatile null pointer}} \
// expected-note {{consider using __builtin_trap}}
- int x2 = *(volatile int*)0; // Ok.
- int *p = &(*(int*)0); // Ok;
+ int x2 = *(volatile int *)0; // Ok.
+ int x3 = *(int __attribute__((address_space(0))) *)0; // expected-warning {{indirection of non-volatile null pointer}} \
+ // expected-note {{consider using __builtin_trap}}
+ int x4 = *(int_AS256 *)0; // Ok.
+ int *p = &(*(int *)0); // Ok.
+ int_AS256 *p1 = &(*(int __attribute__((address_space(256))) *)0); // Ok.
+ int __attribute__((address_space(0))) *p2 = &(*(int __attribute__((address_space(0))) *)0); // Ok.
}
int test20(int x) {
diff --git a/src/llvm-project/clang/test/Sema/ext_vector_casts.c b/src/llvm-project/clang/test/Sema/ext_vector_casts.c
index 6aaedbe..5c13aca 100644
--- a/src/llvm-project/clang/test/Sema/ext_vector_casts.c
+++ b/src/llvm-project/clang/test/Sema/ext_vector_casts.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fsyntax-only -verify -fno-lax-vector-conversions -Wconversion %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fsyntax-only -verify -flax-vector-conversions=none -Wconversion %s
typedef __attribute__((ext_vector_type(8))) _Bool BoolVector; // expected-error {{invalid vector element type '_Bool'}}
@@ -115,12 +115,12 @@
vl = vl + t; // expected-warning {{implicit conversion loses integer precision}}
vf = 1 + vf;
- vf = l + vf;
+ vf = l + vf; // expected-warning {{implicit conversion from 'long' to 'float2' (vector of 2 'float' values) may lose precision}}
vf = 2.0 + vf;
vf = d + vf; // expected-warning {{implicit conversion loses floating-point precision}}
- vf = vf + 0xffffffff;
+ vf = vf + 0xffffffff; // expected-warning {{implicit conversion from 'unsigned int' to 'float2' (vector of 2 'float' values) changes value from 4294967295 to 4294967296}}
vf = vf + 2.1; // expected-warning {{implicit conversion loses floating-point precision}}
-
- vd = l + vd;
- vd = vd + t;
+
+ vd = l + vd; // expected-warning {{implicit conversion from 'long' to 'double2' (vector of 2 'double' values) may lose precision}}
+ vd = vd + t; // expected-warning {{implicit conversion from '__uint128_t' (aka 'unsigned __int128') to 'double2' (vector of 2 'double' values) may lose precision}}
}
diff --git a/src/llvm-project/clang/test/Sema/fallthrough-attr.c b/src/llvm-project/clang/test/Sema/fallthrough-attr.c
new file mode 100644
index 0000000..de50ebf
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/fallthrough-attr.c
@@ -0,0 +1,24 @@
+// RUN: %clang_cc1 -fsyntax-only -std=gnu89 -verify -Wimplicit-fallthrough %s
+// RUN: %clang_cc1 -fsyntax-only -std=gnu99 -verify -Wimplicit-fallthrough %s
+// RUN: %clang_cc1 -fsyntax-only -std=c99 -verify -Wimplicit-fallthrough %s
+// RUN: %clang_cc1 -fsyntax-only -std=c11 -verify -Wimplicit-fallthrough %s
+// RUN: %clang_cc1 -fsyntax-only -std=c2x -DC2X -verify -Wimplicit-fallthrough %s
+
+int fallthrough_attribute_spelling(int n) {
+ switch (n) {
+ case 0:
+ n++;
+ case 1:
+#if defined(C2X)
+// expected-warning@-2{{unannotated fall-through between switch labels}} expected-note@-2{{insert '[[fallthrough]];' to silence this warning}} expected-note@-2{{insert 'break;' to avoid fall-through}}
+#else
+// expected-warning@-4{{unannotated fall-through between switch labels}} expected-note@-4{{insert '__attribute__((fallthrough));' to silence this warning}} expected-note@-4{{insert 'break;' to avoid fall-through}}
+#endif
+ n++;
+ __attribute__((fallthrough));
+ case 2:
+ n++;
+ break;
+ }
+ return n;
+}
diff --git a/src/llvm-project/clang/test/Sema/format-bool.c b/src/llvm-project/clang/test/Sema/format-bool.c
new file mode 100644
index 0000000..a592665
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/format-bool.c
@@ -0,0 +1,46 @@
+// RUN: %clang_cc1 -xc %s -verify -DBOOL=_Bool
+// RUN: %clang_cc1 -xc++ %s -verify -DBOOL=bool
+// RUN: %clang_cc1 -xobjective-c %s -verify -DBOOL=_Bool
+// RUN: %clang_cc1 -xc %s -verify -DBOOL=_Bool -Wformat-type-confusion -DTYPE_CONF
+// RUN: %clang_cc1 -xc++ %s -verify -DBOOL=bool -Wformat-type-confusion -DTYPE_CONF
+
+__attribute__((format(__printf__, 1, 2)))
+int p(const char *fmt, ...);
+
+BOOL b;
+
+#ifdef __OBJC__
+@interface NSString
++(NSString *)stringWithFormat:(NSString *)fmt, ...
+ __attribute__((format(__NSString__, 1, 2)));
+@end
+
+#define YES __objc_yes
+#define NO __objc_no
+#endif
+
+int main() {
+ p("%d", b);
+ p("%hd", b);
+#ifdef TYPE_CONF
+ // expected-warning@-2 {{format specifies type 'short' but the argument has type}}
+#endif
+ p("%hhd", b);
+ p("%u", b);
+ p("%hu", b);
+#ifdef TYPE_CONF
+ // expected-warning@-2 {{format specifies type 'unsigned short' but the argument has type}}
+#endif
+ p("%hhu", b);
+ p("%c", b); // expected-warning {{using '%c' format specifier, but argument has boolean value}}
+ p("%lc", b); // expected-warning {{using '%lc' format specifier, but argument has boolean value}}
+ p("%c", 1 == 1); // expected-warning {{using '%c' format specifier, but argument has boolean value}}
+ p("%f", b); // expected-warning{{format specifies type 'double' but the argument has type}}
+ p("%ld", b); // expected-warning{{format specifies type 'long' but the argument has type}}
+ p("%lld", b); // expected-warning{{format specifies type 'long long' but the argument has type}}
+
+#ifdef __OBJC__
+ [NSString stringWithFormat: @"%c", 0]; // probably fine?
+ [NSString stringWithFormat: @"%c", NO]; // expected-warning {{using '%c' format specifier, but argument has boolean value}}
+#endif
+}
diff --git a/src/llvm-project/clang/test/Sema/format-strings-enum-fixed-type.cpp b/src/llvm-project/clang/test/Sema/format-strings-enum-fixed-type.cpp
index 0022ccb..de22f09 100644
--- a/src/llvm-project/clang/test/Sema/format-strings-enum-fixed-type.cpp
+++ b/src/llvm-project/clang/test/Sema/format-strings-enum-fixed-type.cpp
@@ -79,10 +79,10 @@
printf("%hhd", input); // no-warning
printf("%hhd", CharConstant); // no-warning
- // This is not correct but it is safe. We warn because '%hd' shows intent.
- printf("%hd", input); // expected-warning{{format specifies type 'short' but the argument has underlying type 'char'}}
- printf("%hd", CharConstant); // expected-warning{{format specifies type 'short'}}
-
+ // This is not correct, but it is safe. Only warned in pedantic mode because '%hd' shows intent.
+ printf("%hd", input);
+ printf("%hd", CharConstant);
+
// This is not correct but it matches the promotion rules (and is safe).
printf("%d", input); // no-warning
printf("%d", CharConstant); // no-warning
diff --git a/src/llvm-project/clang/test/Sema/format-strings-pedantic.c b/src/llvm-project/clang/test/Sema/format-strings-pedantic.c
new file mode 100644
index 0000000..6c206ba
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/format-strings-pedantic.c
@@ -0,0 +1,20 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -Wno-format -Wformat-pedantic %s
+// RUN: %clang_cc1 -xobjective-c -fblocks -fsyntax-only -verify -Wno-format -Wformat-pedantic %s
+// RUN: %clang_cc1 -xc++ -fsyntax-only -verify -Wno-format -Wformat-pedantic %s
+
+__attribute__((format(printf, 1, 2)))
+int printf(const char *restrict, ...);
+
+int main() {
+ printf("%p", (int *)0); // expected-warning {{format specifies type 'void *' but the argument has type 'int *'}}
+ printf("%p", (void *)0);
+
+#ifdef __OBJC__
+ printf("%p", ^{}); // expected-warning {{format specifies type 'void *' but the argument has type 'void (^)(void)'}}
+ printf("%p", (id)0); // expected-warning {{format specifies type 'void *' but the argument has type 'id'}}
+#endif
+
+#ifdef __cplusplus
+ printf("%p", nullptr); // expected-warning {{format specifies type 'void *' but the argument has type 'nullptr_t'}}
+#endif
+}
diff --git a/src/llvm-project/clang/test/Sema/format-strings.c b/src/llvm-project/clang/test/Sema/format-strings.c
index 45bf260..11acfcd 100644
--- a/src/llvm-project/clang/test/Sema/format-strings.c
+++ b/src/llvm-project/clang/test/Sema/format-strings.c
@@ -277,8 +277,8 @@
void should_understand_small_integers() {
printf("%hhu", (short) 10); // expected-warning{{format specifies type 'unsigned char' but the argument has type 'short'}}
- printf("%hu\n", (unsigned char) 1); // expected-warning{{format specifies type 'unsigned short' but the argument has type 'unsigned char'}}
- printf("%hu\n", (uint8_t)1); // expected-warning{{format specifies type 'unsigned short' but the argument has type 'uint8_t'}}
+ printf("%hu\n", (unsigned char)1); // warning with -Wformat-pedantic only
+ printf("%hu\n", (uint8_t)1); // warning with -Wformat-pedantic only
}
void test11(void *p, char *s) {
diff --git a/src/llvm-project/clang/test/Sema/format-type-confusion.c b/src/llvm-project/clang/test/Sema/format-type-confusion.c
new file mode 100644
index 0000000..f02bd56
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/format-type-confusion.c
@@ -0,0 +1,26 @@
+// RUN: %clang_cc1 -triple x86_64-apple-darwin9.0 -fsyntax-only -verify -Wno-format -Wformat-type-confusion %s
+
+__attribute__((format(__printf__, 1, 2)))
+int printf(const char *msg, ...);
+
+#define FMT "%hd %hu %d %u %hhd %hhu %c"
+
+int main() {
+ _Bool b = 0;
+ printf(FMT,
+ b, // expected-warning {{format specifies type 'short' but the argument has type '_Bool'}}
+ b, // expected-warning {{format specifies type 'unsigned short' but the argument has type '_Bool'}}
+ b, b, b, b, b);
+
+ unsigned char uc = 0;
+ printf(FMT,
+ uc, // expected-warning {{format specifies type 'short' but the argument has type 'unsigned char'}}
+ uc, // expected-warning {{format specifies type 'unsigned short' but the argument has type 'unsigned char'}}
+ uc, uc, uc, uc, uc);
+
+ signed char sc = 0;
+ printf(FMT,
+ sc, // expected-warning {{format specifies type 'short' but the argument has type 'signed char'}}
+ sc, // expected-warning {{format specifies type 'unsigned short' but the argument has type 'signed char'}}
+ sc, sc, sc, sc, sc);
+}
diff --git a/src/llvm-project/clang/test/Sema/freemain.c b/src/llvm-project/clang/test/Sema/freemain.c
index ff000c6..83d7a4d 100644
--- a/src/llvm-project/clang/test/Sema/freemain.c
+++ b/src/llvm-project/clang/test/Sema/freemain.c
@@ -6,4 +6,4 @@
void* main(void* context, long size) {
if (context) return allocate(size);
-} // expected-warning {{control may reach end of non-void function}}
+} // expected-warning {{non-void function does not return a value in all control paths}}
diff --git a/src/llvm-project/clang/test/Sema/generic-selection.c b/src/llvm-project/clang/test/Sema/generic-selection.c
index 9829958..f083dff 100644
--- a/src/llvm-project/clang/test/Sema/generic-selection.c
+++ b/src/llvm-project/clang/test/Sema/generic-selection.c
@@ -1,40 +1,43 @@
// RUN: %clang_cc1 -std=c11 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -std=c99 -pedantic -fsyntax-only -verify=expected,ext %s
void g(void);
void foo(int n) {
- (void) _Generic(0,
+ (void) _Generic(0, // ext-warning {{'_Generic' is a C11 extension}}
struct A: 0, // expected-error {{type 'struct A' in generic association incomplete}}
void(): 0, // expected-error {{type 'void ()' in generic association not an object type}}
int[n]: 0); // expected-error {{type 'int [n]' in generic association is a variably modified type}}
- (void) _Generic(0,
+ (void) _Generic(0, // ext-warning {{'_Generic' is a C11 extension}}
void (*)(): 0, // expected-note {{compatible type 'void (*)()' specified here}}
void (*)(void): 0); // expected-error {{type 'void (*)(void)' in generic association compatible with previously specified type 'void (*)()'}}
- (void) _Generic((void (*)()) 0, // expected-error {{controlling expression type 'void (*)()' compatible with 2 generic association types}}
+ (void) _Generic((void (*)()) 0, // expected-error {{controlling expression type 'void (*)()' compatible with 2 generic association types}} \
+ // ext-warning {{'_Generic' is a C11 extension}}
void (*)(int): 0, // expected-note {{compatible type 'void (*)(int)' specified here}}
void (*)(void): 0); // expected-note {{compatible type 'void (*)(void)' specified here}}
- (void) _Generic(0, // expected-error {{controlling expression type 'int' not compatible with any generic association type}}
+ (void) _Generic(0, // expected-error {{controlling expression type 'int' not compatible with any generic association type}} \
+ // ext-warning {{'_Generic' is a C11 extension}}
char: 0, short: 0, long: 0);
- int a1[_Generic(0, int: 1, short: 2, float: 3, default: 4) == 1 ? 1 : -1];
- int a2[_Generic(0, default: 1, short: 2, float: 3, int: 4) == 4 ? 1 : -1];
- int a3[_Generic(0L, int: 1, short: 2, float: 3, default: 4) == 4 ? 1 : -1];
- int a4[_Generic(0L, default: 1, short: 2, float: 3, int: 4) == 1 ? 1 : -1];
- int a5[_Generic(0, int: 1, short: 2, float: 3) == 1 ? 1 : -1];
- int a6[_Generic(0, short: 1, float: 2, int: 3) == 3 ? 1 : -1];
+ int a1[_Generic(0, int: 1, short: 2, float: 3, default: 4) == 1 ? 1 : -1]; // ext-warning {{'_Generic' is a C11 extension}}
+ int a2[_Generic(0, default: 1, short: 2, float: 3, int: 4) == 4 ? 1 : -1]; // ext-warning {{'_Generic' is a C11 extension}}
+ int a3[_Generic(0L, int: 1, short: 2, float: 3, default: 4) == 4 ? 1 : -1]; // ext-warning {{'_Generic' is a C11 extension}}
+ int a4[_Generic(0L, default: 1, short: 2, float: 3, int: 4) == 1 ? 1 : -1]; // ext-warning {{'_Generic' is a C11 extension}}
+ int a5[_Generic(0, int: 1, short: 2, float: 3) == 1 ? 1 : -1]; // ext-warning {{'_Generic' is a C11 extension}}
+ int a6[_Generic(0, short: 1, float: 2, int: 3) == 3 ? 1 : -1]; // ext-warning {{'_Generic' is a C11 extension}}
- int a7[_Generic("test", char *: 1, default: 2) == 1 ? 1 : -1];
- int a8[_Generic(g, void (*)(void): 1, default: 2) == 1 ? 1 : -1];
+ int a7[_Generic("test", char *: 1, default: 2) == 1 ? 1 : -1]; // ext-warning {{'_Generic' is a C11 extension}}
+ int a8[_Generic(g, void (*)(void): 1, default: 2) == 1 ? 1 : -1]; // ext-warning {{'_Generic' is a C11 extension}}
const int i = 12;
- int a9[_Generic(i, int: 1, default: 2) == 1 ? 1 : -1];
+ int a9[_Generic(i, int: 1, default: 2) == 1 ? 1 : -1]; // ext-warning {{'_Generic' is a C11 extension}}
// This is expected to not trigger any diagnostics because the controlling
// expression is not evaluated.
- (void)_Generic(*(int *)0, int: 1);
+ (void)_Generic(*(int *)0, int: 1); // ext-warning {{'_Generic' is a C11 extension}}
}
int __attribute__((overloadable)) test (int);
@@ -42,5 +45,5 @@
char testc(char);
void PR30201(void) {
- _Generic(4, char:testc, default:test)(4);
+ _Generic(4, char:testc, default:test)(4); // ext-warning {{'_Generic' is a C11 extension}}
}
diff --git a/src/llvm-project/clang/test/Sema/implicit-int-float-conversion.c b/src/llvm-project/clang/test/Sema/implicit-int-float-conversion.c
new file mode 100644
index 0000000..b8c29d2d
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/implicit-int-float-conversion.c
@@ -0,0 +1,40 @@
+// RUN: %clang_cc1 %s -verify -Wno-conversion -Wimplicit-int-float-conversion
+
+long testReturn(long a, float b) {
+ return a + b; // expected-warning {{implicit conversion from 'long' to 'float' may lose precision}}
+}
+
+void testAssignment() {
+ float f = 222222;
+ double b = 222222222222L;
+
+ float ff = 222222222222L; // expected-warning {{changes value from 222222222222 to 222222221312}}
+ float ffff = 222222222222UL; // expected-warning {{changes value from 222222222222 to 222222221312}}
+
+ long l = 222222222222L;
+ float fff = l; // expected-warning {{implicit conversion from 'long' to 'float' may lose precision}}
+}
+
+void testExpression() {
+ float a = 0.0f;
+
+ float b = 222222222222L + a; // expected-warning {{changes value from 222222222222 to 222222221312}}
+
+ float g = 22222222 + 22222222;
+ float c = 22222222 + 22222223; // expected-warning {{implicit conversion from 'int' to 'float' changes value from 44444445 to 44444444}}
+
+ int i = 0;
+ float d = i + a; // expected-warning {{implicit conversion from 'int' to 'float' may lose precision}}
+
+ double e = 0.0;
+ double f = i + e;
+}
+
+void testCNarrowing() {
+ // Since this is a C file. C++11 narrowing is not in effect.
+ // In this case, we should issue warnings.
+ float a = {222222222222L}; // expected-warning {{changes value from 222222222222 to 222222221312}}
+
+ long b = 222222222222L;
+ float c = {b}; // expected-warning {{implicit conversion from 'long' to 'float' may lose precision}}
+}
diff --git a/src/llvm-project/clang/test/Sema/implicit-int-float-narrowing.cpp b/src/llvm-project/clang/test/Sema/implicit-int-float-narrowing.cpp
new file mode 100644
index 0000000..6de637e
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/implicit-int-float-narrowing.cpp
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 %s -verify -Wno-conversion -Wno-c++11-narrowing -Wimplicit-int-float-conversion
+
+void testNoWarningOnNarrowing() {
+ // Test that we do not issue duplicated warnings for
+ // C++11 narrowing.
+ float a = {222222222222L}; // expected-no-diagnostics
+
+ long b = 222222222222L;
+ float c = {b}; // expected-no-diagnostics
+}
diff --git a/src/llvm-project/clang/test/Sema/logical-op-parentheses.c b/src/llvm-project/clang/test/Sema/logical-op-parentheses.c
new file mode 100644
index 0000000..84464b4
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/logical-op-parentheses.c
@@ -0,0 +1,41 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s -DSILENCE
+// RUN: %clang_cc1 -fsyntax-only -verify %s -Wlogical-op-parentheses
+// RUN: %clang_cc1 -fsyntax-only -verify %s -Wparentheses
+// RUN: %clang_cc1 -fsyntax-only -fdiagnostics-parseable-fixits %s -Wlogical-op-parentheses 2>&1 | FileCheck %s
+
+#ifdef SILENCE
+// expected-no-diagnostics
+#endif
+
+void logical_op_parentheses(unsigned i) {
+ (void)(i ||
+ i && i);
+#ifndef SILENCE
+ // expected-warning@-2 {{'&&' within '||'}}
+ // expected-note@-3 {{place parentheses around the '&&' expression to silence this warning}}
+#endif
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-5]]:14-[[@LINE-5]]:14}:"("
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-6]]:20-[[@LINE-6]]:20}:")"
+
+ (void)(i || i && "w00t");
+ (void)("w00t" && i || i);
+
+ (void)(i || i && "w00t" || i);
+#ifndef SILENCE
+ // expected-warning@-2 {{'&&' within '||'}}
+ // expected-note@-3 {{place parentheses around the '&&' expression to silence this warning}}
+#endif
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-5]]:15-[[@LINE-5]]:15}:"("
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-6]]:26-[[@LINE-6]]:26}:")"
+
+ (void)(i || "w00t" && i || i);
+#ifndef SILENCE
+ // expected-warning@-2 {{'&&' within '||'}}
+ // expected-note@-3 {{place parentheses around the '&&' expression to silence this warning}}
+#endif
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-5]]:15-[[@LINE-5]]:15}:"("
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-6]]:26-[[@LINE-6]]:26}:")"
+
+ (void)(i && i || 0);
+ (void)(0 || i && i);
+}
diff --git a/src/llvm-project/clang/test/Sema/no-builtin.cpp b/src/llvm-project/clang/test/Sema/no-builtin.cpp
new file mode 100644
index 0000000..8908f38
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/no-builtin.cpp
@@ -0,0 +1,52 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fsyntax-only -verify %s
+// UNSUPPORTED: ppc64be
+
+/// Prevent use of all builtins.
+void valid_attribute_all_1() __attribute__((no_builtin)) {}
+void valid_attribute_all_2() __attribute__((no_builtin())) {}
+
+/// Prevent use of specific builtins.
+void valid_attribute_function() __attribute__((no_builtin("memcpy"))) {}
+void valid_attribute_functions() __attribute__((no_builtin("memcpy"))) __attribute__((no_builtin("memcmp"))) {}
+
+/// Many times the same builtin is fine.
+void many_attribute_function_1() __attribute__((no_builtin)) __attribute__((no_builtin)) {}
+void many_attribute_function_2() __attribute__((no_builtin("memcpy"))) __attribute__((no_builtin("memcpy"))) {}
+void many_attribute_function_3() __attribute__((no_builtin("memcpy", "memcpy"))) {}
+void many_attribute_function_4() __attribute__((no_builtin("memcpy", "memcpy"))) __attribute__((no_builtin("memcpy"))) {}
+
+/// Invalid builtin name.
+void invalid_builtin() __attribute__((no_builtin("not_a_builtin"))) {}
+// expected-warning@-1 {{'not_a_builtin' is not a valid builtin name for no_builtin}}
+
+/// Can't use bare no_builtin with a named one.
+void wildcard_and_functionname() __attribute__((no_builtin)) __attribute__((no_builtin("memcpy"))) {}
+// expected-error@-1 {{empty no_builtin cannot be composed with named ones}}
+
+/// Can't attach attribute to a variable.
+int __attribute__((no_builtin)) variable;
+// expected-warning@-1 {{'no_builtin' attribute only applies to functions}}
+
+/// Can't attach attribute to a declaration.
+void nobuiltin_on_declaration() __attribute__((no_builtin));
+// expected-error@-1 {{no_builtin attribute is permitted on definitions only}}
+
+struct S {
+ /// Can't attach attribute to a defaulted function,
+ S()
+ __attribute__((no_builtin)) = default;
+ // expected-error@-1 {{no_builtin attribute has no effect on defaulted or deleted functions}}
+
+ /// Can't attach attribute to a deleted function,
+ S(const S &)
+ __attribute__((no_builtin)) = delete;
+ // expected-error@-1 {{no_builtin attribute has no effect on defaulted or deleted functions}}
+
+ void whatever() __attribute__((no_builtin("memcpy")));
+ // expected-error@-1 {{no_builtin attribute is permitted on definitions only}}
+};
+
+/// Can't attach attribute to an aliased function.
+void alised_function() {}
+void aliasing_function() __attribute__((no_builtin)) __attribute__((alias("alised_function")));
+// expected-error@-1 {{no_builtin attribute is permitted on definitions only}}
diff --git a/src/llvm-project/clang/test/Sema/no-warn-missing-prototype.c b/src/llvm-project/clang/test/Sema/no-warn-missing-prototype.c
new file mode 100644
index 0000000..4dbc257
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/no-warn-missing-prototype.c
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -fsyntax-only -Wmissing-prototypes -x c -ffreestanding -verify %s
+// RUN: %clang_cc1 -fsyntax-only -Wmissing-prototypes -x c++ -ffreestanding -verify %s
+// expected-no-diagnostics
+int main() {
+ return 0;
+}
diff --git a/src/llvm-project/clang/test/Sema/no_callconv.cpp b/src/llvm-project/clang/test/Sema/no_callconv.cpp
new file mode 100644
index 0000000..49ce0e8
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/no_callconv.cpp
@@ -0,0 +1,44 @@
+// RUN: %clang_cc1 %s -triple x86_64-scei-ps4 -DPS4 -fsyntax-only -verify
+// RUN: %clang_cc1 %s -triple x86_64-unknown-linux-gnu -fsyntax-only -verify
+
+#ifdef PS4
+
+// PS4 does not support these.
+void __vectorcall func_vc() {} // expected-error {{'__vectorcall' calling convention is not supported for this target}}
+void __regcall func_rc() {} // expected-error {{'__regcall' calling convention is not supported for this target}}
+void __attribute__((vectorcall)) funcA() {} // expected-error {{'vectorcall' calling convention is not supported for this target}}
+void __attribute__((regcall)) funcB() {} // expected-error {{'regcall' calling convention is not supported for this target}}
+void __attribute__((ms_abi)) funcH() {} // expected-error {{'ms_abi' calling convention is not supported for this target}}
+void __attribute__((intel_ocl_bicc)) funcJ() {} // expected-error {{'intel_ocl_bicc' calling convention is not supported for this target}}
+void __attribute__((swiftcall)) funcK() {} // expected-error {{'swiftcall' calling convention is not supported for this target}}
+void __attribute__((pascal)) funcG() {} // expected-error {{'pascal' calling convention is not supported for this target}}
+void __attribute__((preserve_most)) funcL() {} // expected-error {{'preserve_most' calling convention is not supported for this target}}
+void __attribute__((preserve_all)) funcM() {} // expected-error {{'preserve_all' calling convention is not supported for this target}}
+void __attribute__((stdcall)) funcD() {} // expected-error {{'stdcall' calling convention is not supported for this target}}
+void __attribute__((fastcall)) funcE() {} // expected-error {{'fastcall' calling convention is not supported for this target}}
+void __attribute__((thiscall)) funcF() {} // expected-error {{'thiscall' calling convention is not supported for this target}}
+#else
+
+void __vectorcall func_vc() {}
+void __regcall func_rc() {}
+void __attribute__((vectorcall)) funcA() {}
+void __attribute__((regcall)) funcB() {}
+void __attribute__((ms_abi)) funcH() {}
+void __attribute__((intel_ocl_bicc)) funcJ() {}
+void __attribute__((swiftcall)) funcK() {}
+void __attribute__((preserve_most)) funcL() {}
+void __attribute__((preserve_all)) funcM() {}
+
+// Same function with different calling conventions. Error with a note pointing to the last decl.
+void __attribute__((preserve_all)) funcR(); // expected-note {{previous declaration is here}}
+void __attribute__((preserve_most)) funcR(); // expected-error {{function declared 'preserve_most' here was previously declared 'preserve_all'}}
+
+void __attribute__((pascal)) funcG() {} // expected-warning {{'pascal' calling convention is not supported for this target}}
+
+void __attribute__((stdcall)) funcD() {} // expected-warning {{'stdcall' calling convention is not supported for this target}}
+void __attribute__((fastcall)) funcE() {} // expected-warning {{'fastcall' calling convention is not supported for this target}}
+void __attribute__((thiscall)) funcF() {} // expected-warning {{'thiscall' calling convention is not supported for this target}}
+#endif
+
+void __attribute__((sysv_abi)) funcI() {}
+void __attribute__((cdecl)) funcC() {}
diff --git a/src/llvm-project/clang/test/Sema/objc-bool-constant-conversion-fixit.m b/src/llvm-project/clang/test/Sema/objc-bool-constant-conversion-fixit.m
index 57f5752..08325c1 100644
--- a/src/llvm-project/clang/test/Sema/objc-bool-constant-conversion-fixit.m
+++ b/src/llvm-project/clang/test/Sema/objc-bool-constant-conversion-fixit.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -Werror=constant-conversion %s -fixit-recompile -fixit-to-temporary -E -o - | FileCheck %s
+// RUN: %clang_cc1 -Werror=objc-signed-char-bool %s -fixit-recompile -fixit-to-temporary -E -o - | FileCheck %s
typedef signed char BOOL;
@@ -25,6 +25,17 @@
b = 1 << 1;
// CHECK: b = (1 << 1) ? YES : NO;
+
+ int i;
+
+ b = i;
+ // CHECK: b = i ? YES : NO;
+
+ b = i * 2;
+ // CHECK b = (i * 2) ? YES : NO;
+
+ b = 1 ? 2 : 3;
+ // CHECK: b = 1 ? 2 ? YES : NO : 3 ? YES : NO;
}
@interface BoolProp
@@ -37,4 +48,12 @@
[bp setB:43];
// CHECK: [bp setB:43 ? YES : NO];
+
+ int i;
+
+ bp.b = i;
+ // CHECK: bp.b = i ? YES : NO;
+
+ bp.b = i + 1;
+ // CHECK: bp.b = (i + 1) ? YES : NO;
}
diff --git a/src/llvm-project/clang/test/Sema/objc-bool-constant-conversion.m b/src/llvm-project/clang/test/Sema/objc-bool-constant-conversion.m
index 3638e2f..25546ab 100644
--- a/src/llvm-project/clang/test/Sema/objc-bool-constant-conversion.m
+++ b/src/llvm-project/clang/test/Sema/objc-bool-constant-conversion.m
@@ -12,20 +12,20 @@
B = YES;
B = NO;
- B = -1; // expected-warning{{implicit conversion from constant value -1 to BOOL; the only well defined values for BOOL are YES and NO}}
- B = 0 - 1; // expected-warning{{implicit conversion from constant value -1 to BOOL; the only well defined values for BOOL are YES and NO}}
- B = YES + YES; // expected-warning {{implicit conversion from constant value 2 to BOOL; the only well defined values for BOOL are YES and NO}}
+ B = -1; // expected-warning{{implicit conversion from constant value -1 to 'BOOL'; the only well defined values for 'BOOL' are YES and NO}}
+ B = 0 - 1; // expected-warning{{implicit conversion from constant value -1 to 'BOOL'; the only well defined values for 'BOOL' are YES and NO}}
+ B = YES + YES; // expected-warning {{implicit conversion from constant value 2 to 'BOOL'; the only well defined values for 'BOOL' are YES and NO}}
B = YES | YES;
- B = B ? 2 : 2; // expected-warning 2 {{implicit conversion from constant value 2 to BOOL; the only well defined values for BOOL are YES and NO}}
+ B = B ? 2 : 2; // expected-warning 2 {{implicit conversion from constant value 2 to 'BOOL'; the only well defined values for 'BOOL' are YES and NO}}
- BOOL Init = -1; // expected-warning{{implicit conversion from constant value -1 to BOOL; the only well defined values for BOOL are YES and NO}}
- BOOL Init2 = B ? 2 : 2; // expected-warning 2 {{implicit conversion from constant value 2 to BOOL; the only well defined values for BOOL are YES and NO}}
+ BOOL Init = -1; // expected-warning{{implicit conversion from constant value -1 to 'BOOL'; the only well defined values for 'BOOL' are YES and NO}}
+ BOOL Init2 = B ? 2 : 2; // expected-warning 2 {{implicit conversion from constant value 2 to 'BOOL'; the only well defined values for 'BOOL' are YES and NO}}
void takesbool(BOOL);
- takesbool(43); // expected-warning {{implicit conversion from constant value 43 to BOOL; the only well defined values for BOOL are YES and NO}}
+ takesbool(43); // expected-warning {{implicit conversion from constant value 43 to 'BOOL'; the only well defined values for 'BOOL' are YES and NO}}
- BOOL OutOfRange = 400; // expected-warning{{implicit conversion from constant value 400 to BOOL; the only well defined values for BOOL are YES and NO}}
+ BOOL OutOfRange = 400; // expected-warning{{implicit conversion from constant value 400 to 'BOOL'; the only well defined values for 'BOOL' are YES and NO}}
}
@interface BoolProp
@@ -33,6 +33,6 @@
@end
void f(BoolProp *bp) {
- bp.b = 43; // expected-warning {{implicit conversion from constant value 43 to BOOL; the only well defined values for BOOL are YES and NO}}
- [bp setB:43]; // expected-warning {{implicit conversion from constant value 43 to BOOL; the only well defined values for BOOL are YES and NO}}
+ bp.b = 43; // expected-warning {{implicit conversion from constant value 43 to 'BOOL'; the only well defined values for 'BOOL' are YES and NO}}
+ [bp setB:43]; // expected-warning {{implicit conversion from constant value 43 to 'BOOL'; the only well defined values for 'BOOL' are YES and NO}}
}
diff --git a/src/llvm-project/clang/test/Sema/parentheses.c b/src/llvm-project/clang/test/Sema/parentheses.c
index 8c6c499..047bcbf 100644
--- a/src/llvm-project/clang/test/Sema/parentheses.c
+++ b/src/llvm-project/clang/test/Sema/parentheses.c
@@ -1,3 +1,4 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
// RUN: %clang_cc1 -Wparentheses -fsyntax-only -verify %s
// RUN: %clang_cc1 -Wparentheses -fsyntax-only -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
@@ -44,58 +45,6 @@
// Eager logical op
(void)(i == 1 | i == 2 | i == 3);
(void)(i != 1 & i != 2 & i != 3);
-
- (void)(i & i | i); // expected-warning {{'&' within '|'}} \
- // expected-note {{place parentheses around the '&' expression to silence this warning}}
- // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:10-[[@LINE-2]]:10}:"("
- // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:15-[[@LINE-3]]:15}:")"
-
- (void)(i | i & i); // expected-warning {{'&' within '|'}} \
- // expected-note {{place parentheses around the '&' expression to silence this warning}}
- // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:14-[[@LINE-2]]:14}:"("
- // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:19-[[@LINE-3]]:19}:")"
-
- (void)(i ^ i | i); // expected-warning {{'^' within '|'}} \
- // expected-note {{place parentheses around the '^' expression to silence this warning}}
- // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:10-[[@LINE-2]]:10}:"("
- // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:15-[[@LINE-3]]:15}:")"
-
- (void)(i | i ^ i); // expected-warning {{'^' within '|'}} \
- // expected-note {{place parentheses around the '^' expression to silence this warning}}
- // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:14-[[@LINE-2]]:14}:"("
- // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:19-[[@LINE-3]]:19}:")"
-
- (void)(i & i ^ i); // expected-warning {{'&' within '^'}} \
- // expected-note {{place parentheses around the '&' expression to silence this warning}}
- // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:10-[[@LINE-2]]:10}:"("
- // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:15-[[@LINE-3]]:15}:")"
-
- (void)(i ^ i & i); // expected-warning {{'&' within '^'}} \
- // expected-note {{place parentheses around the '&' expression to silence this warning}}
- // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:14-[[@LINE-2]]:14}:"("
- // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:19-[[@LINE-3]]:19}:")"
-
- (void)(i ||
- i && i); // expected-warning {{'&&' within '||'}} \
- // expected-note {{place parentheses around the '&&' expression to silence this warning}}
- // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:14-[[@LINE-2]]:14}:"("
- // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:20-[[@LINE-3]]:20}:")"
-
- (void)(i || i && "w00t"); // no warning.
- (void)("w00t" && i || i); // no warning.
-
- (void)(i || i && "w00t" || i); // expected-warning {{'&&' within '||'}} \
- // expected-note {{place parentheses around the '&&' expression to silence this warning}}
- // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:15-[[@LINE-2]]:15}:"("
- // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:26-[[@LINE-3]]:26}:")"
-
- (void)(i || "w00t" && i || i); // expected-warning {{'&&' within '||'}} \
- // expected-note {{place parentheses around the '&&' expression to silence this warning}}
- // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:15-[[@LINE-2]]:15}:"("
- // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:26-[[@LINE-3]]:26}:")"
-
- (void)(i && i || 0); // no warning.
- (void)(0 || i && i); // no warning.
}
_Bool someConditionFunc();
@@ -144,6 +93,28 @@
(void)(x + y > 0 ? 1 : 2); // no warning
(void)(x + (y > 0) ? 1 : 2); // expected-warning {{operator '?:' has lower precedence than '+'}} expected-note 2{{place parentheses}}
+
+ (void)(b ? 0xf0 : 0x10 | b ? 0x5 : 0x2); // expected-warning {{operator '?:' has lower precedence than '|'}} expected-note 2{{place parentheses}}
+
+ (void)((b ? 0xf0 : 0x10) | (b ? 0x5 : 0x2)); // no warning, has parentheses
+ (void)(b ? 0xf0 : (0x10 | b) ? 0x5 : 0x2); // no warning, has parentheses
+
+ (void)(x | b ? 1 : 2); // expected-warning {{operator '?:' has lower precedence than '|'}} expected-note 2{{place parentheses}}
+ (void)(x & b ? 1 : 2); // expected-warning {{operator '?:' has lower precedence than '&'}} expected-note 2{{place parentheses}}
+
+ (void)((x | b) ? 1 : 2); // no warning, has parentheses
+ (void)(x | (b ? 1 : 2)); // no warning, has parentheses
+ (void)((x & b) ? 1 : 2); // no warning, has parentheses
+ (void)(x & (b ? 1 : 2)); // no warning, has parentheses
+
+ // Only warn on uses of the bitwise operators, and not the logical operators.
+ // The bitwise operators are more likely to be bugs while the logical
+ // operators are more likely to be used correctly. Since there is no
+ // explicit logical-xor operator, the bitwise-xor is commonly used instead.
+ // For this warning, treat the bitwise-xor as if it were a logical operator.
+ (void)(x ^ b ? 1 : 2); // no warning, ^ is often used as logical xor
+ (void)(x || b ? 1 : 2); // no warning, logical operator
+ (void)(x && b ? 1 : 2); // no warning, logical operator
}
// RUN: not %clang_cc1 -fsyntax-only -Wparentheses -Werror -fdiagnostics-show-option %s 2>&1 | FileCheck %s -check-prefix=CHECK-FLAG
diff --git a/src/llvm-project/clang/test/Sema/patchable-function-entry-attr.c b/src/llvm-project/clang/test/Sema/patchable-function-entry-attr.c
new file mode 100644
index 0000000..0fa1abd
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/patchable-function-entry-attr.c
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 -triple aarch64 -fsyntax-only -verify %s
+
+// expected-error@+1 {{'patchable_function_entry' attribute takes at least 1 argument}}
+__attribute__((patchable_function_entry)) void f();
+
+// expected-error@+1 {{'patchable_function_entry' attribute takes no more than 2 arguments}}
+__attribute__((patchable_function_entry(0, 0, 0))) void f();
+
+// expected-error@+1 {{'patchable_function_entry' attribute requires a non-negative integral compile time constant expression}}
+__attribute__((patchable_function_entry(-1))) void f();
+
+int i;
+// expected-error@+1 {{'patchable_function_entry' attribute requires parameter 0 to be an integer constant}}
+__attribute__((patchable_function_entry(i))) void f();
+
+// expected-error@+1 {{'patchable_function_entry' attribute requires integer constant between 0 and 2 inclusive}}
+__attribute__((patchable_function_entry(2, 3))) void f();
diff --git a/src/llvm-project/clang/test/Sema/patchable-function-entry-attr.cpp b/src/llvm-project/clang/test/Sema/patchable-function-entry-attr.cpp
new file mode 100644
index 0000000..63de5a2
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/patchable-function-entry-attr.cpp
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -triple aarch64 -fsyntax-only -verify=silence %s
+// RUN: %clang_cc1 -triple aarch64_be -fsyntax-only -verify=silence %s
+// RUN: %clang_cc1 -triple i386 -fsyntax-only -verify=silence %s
+// RUN: %clang_cc1 -triple x86_64 -fsyntax-only -verify=silence %s
+// RUN: %clang_cc1 -triple ppc64le -fsyntax-only -verify %s
+
+// silence-no-diagnostics
+
+// expected-warning@+1 {{unknown attribute 'patchable_function_entry' ignored}}
+[[gnu::patchable_function_entry(0)]] void f();
diff --git a/src/llvm-project/clang/test/Sema/pragma-clang-section.c b/src/llvm-project/clang/test/Sema/pragma-clang-section.c
index 4946388..38a3bc9 100644
--- a/src/llvm-project/clang/test/Sema/pragma-clang-section.c
+++ b/src/llvm-project/clang/test/Sema/pragma-clang-section.c
@@ -3,15 +3,17 @@
#pragma clang section bss="" data="" rodata="" text=""
#pragma clang section
-#pragma clang section dss="mybss.2" // expected-error {{expected one of [bss|data|rodata|text] section kind in '#pragma clang section'}}
-#pragma clang section deta="mydata.2" // expected-error {{expected one of [bss|data|rodata|text] section kind in '#pragma clang section'}}
-#pragma clang section rodeta="rodata.2" // expected-error {{expected one of [bss|data|rodata|text] section kind in '#pragma clang section'}}
-#pragma clang section taxt="text.2" // expected-error {{expected one of [bss|data|rodata|text] section kind in '#pragma clang section'}}
+#pragma clang section dss="mybss.2" // expected-error {{expected one of [bss|data|rodata|text|relro] section kind in '#pragma clang section'}}
+#pragma clang section deta="mydata.2" // expected-error {{expected one of [bss|data|rodata|text|relro] section kind in '#pragma clang section'}}
+#pragma clang section rodeta="rodata.2" // expected-error {{expected one of [bss|data|rodata|text|relro] section kind in '#pragma clang section'}}
+#pragma clang section taxt="text.2" // expected-error {{expected one of [bss|data|rodata|text|relro] section kind in '#pragma clang section'}}
-#pragma clang section section bss="mybss.2" // expected-error {{expected one of [bss|data|rodata|text] section kind in '#pragma clang section'}}
+#pragma clang section section bss="mybss.2" // expected-error {{expected one of [bss|data|rodata|text|relro] section kind in '#pragma clang section'}}
#pragma clang section bss "mybss.2" // expected-error {{expected '=' following '#pragma clang section bss'}}
#pragma clang section data "mydata.2" // expected-error {{expected '=' following '#pragma clang section data'}}
#pragma clang section rodata "myrodata.2" // expected-error {{expected '=' following '#pragma clang section rodata'}}
-#pragma clang section bss="" data="" rodata="" text="" more //expected-error {{expected one of [bss|data|rodata|text] section kind in '#pragma clang section'}}
+#pragma clang section text "text.2" // expected-error {{expected '=' following '#pragma clang section text'}}
+#pragma clang section relro "relro.2" // expected-error {{expected '=' following '#pragma clang section relro'}}
+#pragma clang section bss="" data="" rodata="" text="" more //expected-error {{expected one of [bss|data|rodata|text|relro] section kind in '#pragma clang section'}}
int a;
diff --git a/src/llvm-project/clang/test/Sema/return.c b/src/llvm-project/clang/test/Sema/return.c
index debf5ab..632d343 100644
--- a/src/llvm-project/clang/test/Sema/return.c
+++ b/src/llvm-project/clang/test/Sema/return.c
@@ -17,7 +17,7 @@
}
int test1() {
-} // expected-warning {{control reaches end of non-void function}}
+} // expected-warning {{non-void function does not return a value}}
int test2() {
a: goto a;
@@ -26,7 +26,7 @@
int test3() {
goto a;
a: ;
-} // expected-warning {{control reaches end of non-void function}}
+} // expected-warning {{non-void function does not return a value}}
void halt() {
@@ -54,11 +54,11 @@
int test7() {
unknown();
-} // expected-warning {{control reaches end of non-void function}}
+} // expected-warning {{non-void function does not return a value}}
int test8() {
(void)(1 + unknown());
-} // expected-warning {{control reaches end of non-void function}}
+} // expected-warning {{non-void function does not return a value}}
int halt3() __attribute__((noreturn));
@@ -68,11 +68,11 @@
int test10() {
(void)(unknown() || halt3());
-} // expected-warning {{control may reach end of non-void function}}
+} // expected-warning {{non-void function does not return a value in all control paths}}
int test11() {
(void)(unknown() && halt3());
-} // expected-warning {{control may reach end of non-void function}}
+} // expected-warning {{non-void function does not return a value in all control paths}}
int test12() {
(void)(halt3() || unknown());
@@ -84,27 +84,27 @@
int test14() {
(void)(1 || unknown());
-} // expected-warning {{control reaches end of non-void function}}
+} // expected-warning {{non-void function does not return a value}}
int test15() {
(void)(0 || unknown());
-} // expected-warning {{control reaches end of non-void function}}
+} // expected-warning {{non-void function does not return a value}}
int test16() {
(void)(0 && unknown());
-} // expected-warning {{control reaches end of non-void function}}
+} // expected-warning {{non-void function does not return a value}}
int test17() {
(void)(1 && unknown());
-} // expected-warning {{control reaches end of non-void function}}
+} // expected-warning {{non-void function does not return a value}}
int test18() {
(void)(unknown_nohalt() && halt3());
-} // expected-warning {{control may reach end of non-void function}}
+} // expected-warning {{non-void function does not return a value in all control paths}}
int test19() {
(void)(unknown_nohalt() && unknown());
-} // expected-warning {{control reaches end of non-void function}}
+} // expected-warning {{non-void function does not return a value}}
int test20() {
int i;
@@ -112,7 +112,7 @@
return 0;
else if (0)
return 2;
-} // expected-warning {{control may reach end of non-void function}}
+} // expected-warning {{non-void function does not return a value in all control paths}}
int test21() {
int i;
@@ -125,7 +125,7 @@
int test22() {
int i;
switch (i) default: ;
-} // expected-warning {{control reaches end of non-void function}}
+} // expected-warning {{non-void function does not return a value}}
int test23() {
int i;
@@ -135,7 +135,7 @@
case 2:
return 2;
}
-} // expected-warning {{control may reach end of non-void function}}
+} // expected-warning {{non-void function does not return a value in all control paths}}
int test24() {
int i;
@@ -155,7 +155,7 @@
int test26() {
0 ? halt3() : unknown();
-} // expected-warning {{control reaches end of non-void function}}
+} // expected-warning {{non-void function does not return a value}}
int j;
void (*fptr)() __attribute__((noreturn));
@@ -231,19 +231,19 @@
// Test that 'static inline' functions are only analyzed for CFG-based warnings
// when they are used.
-static inline int si_has_missing_return() {} // expected-warning{{control reaches end of non-void function}}
-static inline int si_has_missing_return_2() {}; // expected-warning{{control reaches end of non-void function}}
+static inline int si_has_missing_return() {} // expected-warning{{non-void function does not return a value}}
+static inline int si_has_missing_return_2() {}; // expected-warning{{non-void function does not return a value}}
static inline int si_forward();
static inline int si_has_missing_return_3(int x) {
if (x)
return si_has_missing_return_3(x+1);
-} // expected-warning{{control may reach end of non-void function}}
+} // expected-warning{{non-void function does not return a value in all control paths}}
int test_static_inline(int x) {
si_forward();
return x ? si_has_missing_return_2() : si_has_missing_return_3(x);
}
-static inline int si_forward() {} // expected-warning{{control reaches end of non-void function}}
+static inline int si_forward() {} // expected-warning{{non-void function does not return a value}}
// Test warnings on ignored qualifiers on return types.
const int ignored_c_quals(); // expected-warning{{'const' type qualifier on return type has no effect}}
@@ -319,7 +319,7 @@
default:
break;
}
-} // expected-warning {{control may reach end of non-void function}}
+} // expected-warning {{non-void function does not return a value in all control paths}}
// sizeof(long) test.
int sizeof_long() {
@@ -328,3 +328,14 @@
if (sizeof(long) == 8)
return 2;
} // no-warning
+
+int return_statement_expression() {
+ if (unknown())
+ return ({
+ while (0)
+ ;
+ 0;
+ });
+ else
+ return 0;
+} // no-warning (used to be "non-void function does not return a value in all control paths")
diff --git a/src/llvm-project/clang/test/Sema/riscv-asm.c b/src/llvm-project/clang/test/Sema/riscv-asm.c
new file mode 100644
index 0000000..82664c0
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/riscv-asm.c
@@ -0,0 +1,28 @@
+// RUN: %clang_cc1 %s -triple riscv32 -verify -fsyntax-only
+// RUN: %clang_cc1 %s -triple riscv64 -verify -fsyntax-only
+
+// expected-no-diagnostics
+
+void i (void) {
+ asm volatile ("" ::: "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7");
+ asm volatile ("" ::: "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15");
+ asm volatile ("" ::: "x16", "x17", "x18", "x19", "x20", "x21", "x22", "x23");
+ asm volatile ("" ::: "x24", "x25", "x26", "x27", "x28", "x29", "x30", "x31");
+
+ asm volatile ("" ::: "zero", "ra", "sp", "gp", "tp", "t0", "t1", "t2");
+ asm volatile ("" ::: "s0", "s1", "a0", "a1", "a2", "a3", "a4", "a5");
+ asm volatile ("" ::: "a6", "a7", "s2", "s3", "s4", "s5", "s6", "s7");
+ asm volatile ("" ::: "s8", "s9", "s10", "s11", "t3", "t4", "t5", "t6");
+}
+
+void f (void) {
+ asm volatile ("" ::: "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7");
+ asm volatile ("" ::: "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15");
+ asm volatile ("" ::: "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23");
+ asm volatile ("" ::: "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31");
+
+ asm volatile ("" ::: "ft0", "ft1", "ft2", "ft3", "ft4", "ft5", "ft6", "ft7");
+ asm volatile ("" ::: "fs0", "fs1", "fa0", "fa1", "fa2", "fa3", "fa4", "fa5");
+ asm volatile ("" ::: "fa6", "fa7", "fs2", "fs3", "fs4", "fs5", "fs6", "fs7");
+ asm volatile ("" ::: "fs8", "fs9", "fs10", "fs11", "ft8", "ft9", "ft10", "ft11");
+}
diff --git a/src/llvm-project/clang/test/Sema/static-assert.c b/src/llvm-project/clang/test/Sema/static-assert.c
index e8cfb1f..f08e557 100644
--- a/src/llvm-project/clang/test/Sema/static-assert.c
+++ b/src/llvm-project/clang/test/Sema/static-assert.c
@@ -1,25 +1,30 @@
// RUN: %clang_cc1 -std=c11 -fsyntax-only -verify %s
-// RUN: %clang_cc1 -xc++ -std=c++11 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -std=c99 -pedantic -fsyntax-only -verify=expected,ext %s
+// RUN: %clang_cc1 -xc++ -std=c++11 -pedantic -fsyntax-only -verify=expected,ext,cxx %s
-_Static_assert("foo", "string is nonzero");
+_Static_assert("foo", "string is nonzero"); // ext-warning {{'_Static_assert' is a C11 extension}}
#ifndef __cplusplus
// expected-error@-2 {{static_assert expression is not an integral constant expression}}
#endif
-_Static_assert(1, "1 is nonzero");
-_Static_assert(0, "0 is nonzero"); // expected-error {{static_assert failed "0 is nonzero"}}
+_Static_assert(1, "1 is nonzero"); // ext-warning {{'_Static_assert' is a C11 extension}}
+_Static_assert(0, "0 is nonzero"); // expected-error {{static_assert failed "0 is nonzero"}} \
+ // ext-warning {{'_Static_assert' is a C11 extension}}
void foo(void) {
- _Static_assert(1, "1 is nonzero");
- _Static_assert(0, "0 is nonzero"); // expected-error {{static_assert failed "0 is nonzero"}}
+ _Static_assert(1, "1 is nonzero"); // ext-warning {{'_Static_assert' is a C11 extension}}
+ _Static_assert(0, "0 is nonzero"); // expected-error {{static_assert failed "0 is nonzero"}} \
+ // ext-warning {{'_Static_assert' is a C11 extension}}
}
-_Static_assert(1, invalid); // expected-error {{expected string literal for diagnostic message in static_assert}}
+_Static_assert(1, invalid); // expected-error {{expected string literal for diagnostic message in static_assert}} \
+ // ext-warning {{'_Static_assert' is a C11 extension}}
struct A {
int a;
- _Static_assert(1, "1 is nonzero");
- _Static_assert(0, "0 is nonzero"); // expected-error {{static_assert failed "0 is nonzero"}}
+ _Static_assert(1, "1 is nonzero"); // ext-warning {{'_Static_assert' is a C11 extension}}
+ _Static_assert(0, "0 is nonzero"); // expected-error {{static_assert failed "0 is nonzero"}} \
+ // ext-warning {{'_Static_assert' is a C11 extension}}
};
#ifdef __cplusplus
@@ -36,7 +41,9 @@
_Static_assert(sizeof(T1) == sizeof(T2), "type size mismatch"); \
}
-typedef UNION(unsigned, struct A) U1;
-UNION(char[2], short) u2 = { .one = { 'a', 'b' } };
-typedef UNION(char, short) U3; // expected-error {{static_assert failed due to requirement 'sizeof(char) == sizeof(short)' "type size mismatch"}}
-typedef UNION(float, 0.5f) U4; // expected-error {{expected a type}}
+typedef UNION(unsigned, struct A) U1; // ext-warning 3 {{'_Static_assert' is a C11 extension}}
+UNION(char[2], short) u2 = { .one = { 'a', 'b' } }; // ext-warning 3 {{'_Static_assert' is a C11 extension}} cxx-warning {{designated initializers are a C++20 extension}}
+typedef UNION(char, short) U3; // expected-error {{static_assert failed due to requirement 'sizeof(char) == sizeof(short)' "type size mismatch"}} \
+ // ext-warning 3 {{'_Static_assert' is a C11 extension}}
+typedef UNION(float, 0.5f) U4; // expected-error {{expected a type}} \
+ // ext-warning 3 {{'_Static_assert' is a C11 extension}}
diff --git a/src/llvm-project/clang/test/Sema/struct-packed-align.c b/src/llvm-project/clang/test/Sema/struct-packed-align.c
index aeba8d6..91c7ce3 100644
--- a/src/llvm-project/clang/test/Sema/struct-packed-align.c
+++ b/src/llvm-project/clang/test/Sema/struct-packed-align.c
@@ -59,7 +59,7 @@
struct __attribute__((aligned)) as1_2 {
char c;
};
-#ifdef __s390x__
+#if ( defined(__s390x__) || ( defined (__ARM_32BIT_STATE) && ! defined(__ANDROID__) ) )
extern int e1_2[sizeof(struct as1_2) == 8 ? 1 : -1];
extern int e2_2[__alignof(struct as1_2) == 8 ? 1 : -1];
#else
diff --git a/src/llvm-project/clang/test/Sema/switch.c b/src/llvm-project/clang/test/Sema/switch.c
index 638fd99..2c9fe91 100644
--- a/src/llvm-project/clang/test/Sema/switch.c
+++ b/src/llvm-project/clang/test/Sema/switch.c
@@ -283,6 +283,10 @@
}
}
+struct bitfield_member {
+ unsigned bf : 1;
+};
+
// PR7359
void test17(int x) {
switch (x >= 17) { // expected-warning {{switch condition has boolean value}}
@@ -292,6 +296,13 @@
switch ((int) (x <= 17)) {
case 0: return;
}
+
+ struct bitfield_member bm;
+ switch (bm.bf) { // no warning
+ case 0:
+ case 1:
+ return;
+ }
}
int test18() {
@@ -372,7 +383,7 @@
case EE1_b: break;
case EE1_c: break; // no-warning
case EE1_d: break; // expected-warning {{case value not in enumerated type 'enum ExtendedEnum1'}}
- // expected-warning@-1 {{comparison of two values with different enumeration types in switch statement ('enum ExtendedEnum1' and 'enum ExtendedEnum1_unrelated')}}
+ // expected-warning@-1 {{comparison of different enumeration types in switch statement ('enum ExtendedEnum1' and 'enum ExtendedEnum1_unrelated')}}
}
}
diff --git a/src/llvm-project/clang/test/Sema/tautological-objc-bool-compare.m b/src/llvm-project/clang/test/Sema/tautological-objc-bool-compare.m
index 525862e..5fd7b9e 100644
--- a/src/llvm-project/clang/test/Sema/tautological-objc-bool-compare.m
+++ b/src/llvm-project/clang/test/Sema/tautological-objc-bool-compare.m
@@ -9,16 +9,16 @@
void test() {
int r;
r = B > 0;
- r = B > 1; // expected-warning {{result of comparison of constant 1 with expression of type BOOL is always false, as the only well defined values for BOOL are YES and NO}}
+ r = B > 1; // expected-warning {{result of comparison of constant 1 with expression of type 'BOOL' is always false, as the only well defined values for 'BOOL' are YES and NO}}
r = B < 1;
- r = B < 0; // expected-warning {{result of comparison of constant 0 with expression of type BOOL is always false, as the only well defined values for BOOL are YES and NO}}
- r = B >= 0; // expected-warning {{result of comparison of constant 0 with expression of type BOOL is always true, as the only well defined values for BOOL are YES and NO}}
+ r = B < 0; // expected-warning {{result of comparison of constant 0 with expression of type 'BOOL' is always false, as the only well defined values for 'BOOL' are YES and NO}}
+ r = B >= 0; // expected-warning {{result of comparison of constant 0 with expression of type 'BOOL' is always true, as the only well defined values for 'BOOL' are YES and NO}}
r = B <= 0;
- r = B > YES; // expected-warning {{result of comparison of constant YES with expression of type BOOL is always false, as the only well defined values for BOOL are YES and NO}}
+ r = B > YES; // expected-warning {{result of comparison of constant YES with expression of type 'BOOL' is always false, as the only well defined values for 'BOOL' are YES and NO}}
r = B > NO;
- r = B < NO; // expected-warning {{result of comparison of constant NO with expression of type BOOL is always false, as the only well defined values for BOOL are YES and NO}}
+ r = B < NO; // expected-warning {{result of comparison of constant NO with expression of type 'BOOL' is always false, as the only well defined values for 'BOOL' are YES and NO}}
r = B < YES;
- r = B >= NO; // expected-warning {{result of comparison of constant NO with expression of type BOOL is always true, as the only well defined values for BOOL are YES and NO}}
+ r = B >= NO; // expected-warning {{result of comparison of constant NO with expression of type 'BOOL' is always true, as the only well defined values for 'BOOL' are YES and NO}}
r = B <= NO;
}
diff --git a/src/llvm-project/clang/test/Sema/thread-specifier.c b/src/llvm-project/clang/test/Sema/thread-specifier.c
index a93850d..a4f31bd 100644
--- a/src/llvm-project/clang/test/Sema/thread-specifier.c
+++ b/src/llvm-project/clang/test/Sema/thread-specifier.c
@@ -1,25 +1,26 @@
// RUN: %clang_cc1 -triple i686-pc-linux-gnu -fsyntax-only -Wno-private-extern -verify -pedantic %s -DGNU
// RUN: %clang_cc1 -triple i686-pc-linux-gnu -fsyntax-only -Wno-private-extern -verify -pedantic -x c++ %s -DGNU -std=c++98
-// 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 -std=c++98
+// RUN: %clang_cc1 -triple i686-pc-linux-gnu -fsyntax-only -Wno-private-extern -verify -pedantic %s -std=c11 -DC11 -D__thread=_Thread_local
+// RUN: %clang_cc1 -triple i686-pc-linux-gnu -fsyntax-only -Wno-private-extern -verify=expected,thread-local -pedantic -x c++ %s -DC11 -D__thread=_Thread_local -std=c++98
// 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
+// RUN: %clang_cc1 -triple i686-pc-linux-gnu -fsyntax-only -Wno-private-extern -verify=expected,thread-local -pedantic -x c++ %s -DC11 -D__thread=_Thread_local -std=c++11 -Wno-deprecated
+// RUN: %clang_cc1 -triple i686-pc-linux-gnu -fsyntax-only -Wno-private-extern -verify=expected,thread-local -pedantic %s -std=c99 -D__thread=_Thread_local -DC99
#ifdef __cplusplus
// In C++, we define __private_extern__ to extern.
#undef __private_extern__
#endif
-__thread int t1;
-__thread extern int t2;
-__thread static int t3;
+__thread int t1; // thread-local-warning {{'_Thread_local' is a C11 extension}}
+__thread extern int t2; // thread-local-warning {{'_Thread_local' is a C11 extension}}
+__thread static int t3; // thread-local-warning {{'_Thread_local' is a C11 extension}}
#ifdef GNU
// expected-warning@-3 {{'__thread' before 'extern'}}
// expected-warning@-3 {{'__thread' before 'static'}}
#endif
-__thread __private_extern__ int t4;
-struct t5 { __thread int x; };
+__thread __private_extern__ int t4; // thread-local-warning {{'_Thread_local' is a C11 extension}}
+struct t5 { __thread int x; }; // thread-local-warning {{'_Thread_local' is a C11 extension}}
#ifdef __cplusplus
// expected-error-re@-2 {{'{{__thread|_Thread_local|thread_local}}' is only allowed on variable declarations}}
#else
@@ -27,51 +28,63 @@
// expected-error@-5 {{type name does not allow storage class to be specified}}
#endif
-__thread int t6();
+__thread int t6(); // thread-local-warning {{'_Thread_local' is a C11 extension}}
#if defined(GNU)
// expected-error@-2 {{'__thread' is only allowed on variable declarations}}
-#elif defined(C11)
+#elif defined(C11) || defined(C99)
// expected-error@-4 {{'_Thread_local' is only allowed on variable declarations}}
#else
// expected-error@-6 {{'thread_local' is only allowed on variable declarations}}
#endif
-int f(__thread int t7) { // expected-error {{' is only allowed on variable declarations}}
- __thread int t8;
+int f(__thread int t7) { // expected-error {{' is only allowed on variable declarations}} \
+ // thread-local-warning {{'_Thread_local' is a C11 extension}}
+ __thread int t8; // thread-local-warning {{'_Thread_local' is a C11 extension}}
#if defined(GNU)
// expected-error@-2 {{'__thread' variables must have global storage}}
-#elif defined(C11)
+#elif defined(C11) || defined(C99)
// expected-error@-4 {{'_Thread_local' variables must have global storage}}
#endif
- extern __thread int t9;
- static __thread int t10;
- __thread __private_extern__ int t11;
+ extern __thread int t9; // thread-local-warning {{'_Thread_local' is a C11 extension}}
+ static __thread int t10; // thread-local-warning {{'_Thread_local' is a C11 extension}}
+ __thread __private_extern__ int t11; // thread-local-warning {{'_Thread_local' is a C11 extension}}
#if __cplusplus < 201103L
- __thread auto int t12a; // expected-error-re {{cannot combine with previous '{{__thread|_Thread_local}}' declaration specifier}}
- auto __thread int t12b; // expected-error {{cannot combine with previous 'auto' declaration specifier}}
+ __thread auto int t12a; // expected-error-re {{cannot combine with previous '{{__thread|_Thread_local}}' declaration specifier}} \
+ // thread-local-warning {{'_Thread_local' is a C11 extension}}
+ auto __thread int t12b; // expected-error {{cannot combine with previous 'auto' declaration specifier}} \
+ // thread-local-warning {{'_Thread_local' is a C11 extension}}
#elif !defined(CXX11)
- __thread auto t12a = 0; // expected-error {{'_Thread_local' variables must have global storage}}
- auto __thread t12b = 0; // expected-error {{'_Thread_local' variables must have global storage}}
+ __thread auto t12a = 0; // expected-error {{'_Thread_local' variables must have global storage}} \
+ // thread-local-warning {{'_Thread_local' is a C11 extension}}
+ auto __thread t12b = 0; // expected-error {{'_Thread_local' variables must have global storage}} \
+ // thread-local-warning {{'_Thread_local' is a C11 extension}}
#endif
- __thread register int t13a; // expected-error-re {{cannot combine with previous '{{__thread|_Thread_local|thread_local}}' declaration specifier}}
- register __thread int t13b; // expected-error {{cannot combine with previous 'register' declaration specifier}}
+ __thread register int t13a; // expected-error-re {{cannot combine with previous '{{__thread|_Thread_local|thread_local}}' declaration specifier}} \
+ // thread-local-warning {{'_Thread_local' is a C11 extension}}
+ register __thread int t13b; // expected-error {{cannot combine with previous 'register' declaration specifier}} \
+ // thread-local-warning {{'_Thread_local' is a C11 extension}}
}
-__thread typedef int t14; // expected-error-re {{cannot combine with previous '{{__thread|_Thread_local|thread_local}}' declaration specifier}}
-__thread int t15; // expected-note {{previous definition is here}}
+__thread typedef int t14; // expected-error-re {{cannot combine with previous '{{__thread|_Thread_local|thread_local}}' declaration specifier}} \
+ // thread-local-warning {{'_Thread_local' is a C11 extension}}
+__thread int t15; // expected-note {{previous definition is here}} \
+ // thread-local-warning {{'_Thread_local' is a C11 extension}}
extern int t15; // expected-error {{non-thread-local declaration of 't15' follows thread-local declaration}}
extern int t16; // expected-note {{previous declaration is here}}
-__thread int t16; // expected-error {{thread-local declaration of 't16' follows non-thread-local declaration}}
+__thread int t16; // expected-error {{thread-local declaration of 't16' follows non-thread-local declaration}} \
+ // thread-local-warning {{'_Thread_local' is a C11 extension}}
#ifdef CXX11
extern thread_local int t17; // expected-note {{previous declaration is here}}
-_Thread_local int t17; // expected-error {{thread-local declaration of 't17' with static initialization follows declaration with dynamic initialization}}
-extern _Thread_local int t18; // expected-note {{previous declaration is here}}
+_Thread_local int t17; // expected-error {{thread-local declaration of 't17' with static initialization follows declaration with dynamic initialization}} \
+ // expected-warning {{'_Thread_local' is a C11 extension}}
+extern _Thread_local int t18; // expected-note {{previous declaration is here}} \
+ // expected-warning {{'_Thread_local' is a C11 extension}}
thread_local int t18; // expected-error {{thread-local declaration of 't18' with dynamic initialization follows declaration with static initialization}}
#endif
// PR13720
-__thread int thread_int;
+__thread int thread_int; // thread-local-warning {{'_Thread_local' is a C11 extension}}
int *thread_int_ptr = &thread_int;
#ifndef __cplusplus
// expected-error@-2 {{initializer element is not a compile-time constant}}
@@ -84,7 +97,7 @@
#endif
int non_const();
-__thread int non_const_init = non_const();
+__thread int non_const_init = non_const(); // thread-local-warning {{'_Thread_local' is a C11 extension}}
#if !defined(__cplusplus)
// expected-error@-2 {{initializer element is not a compile-time constant}}
#elif !defined(CXX11)
@@ -98,7 +111,7 @@
struct S {
~S();
};
-__thread S s;
+__thread S s; // thread-local-warning {{'_Thread_local' is a C11 extension}}
#if !defined(CXX11)
// expected-error@-2 {{type of thread-local variable has non-trivial destruction}}
#if __cplusplus >= 201103L
@@ -111,7 +124,7 @@
struct HasCtor {
HasCtor();
};
-__thread HasCtor var_with_ctor;
+__thread HasCtor var_with_ctor; // thread-local-warning {{'_Thread_local' is a C11 extension}}
#if !defined(CXX11)
// expected-error@-2 {{initializer for thread-local variable must be a constant expression}}
#if __cplusplus >= 201103L
@@ -120,4 +133,4 @@
#endif
#endif
-__thread int aggregate[10] = {0};
+__thread int aggregate[10] = {0}; // thread-local-warning {{'_Thread_local' is a C11 extension}}
diff --git a/src/llvm-project/clang/test/Sema/typedef-retain.c b/src/llvm-project/clang/test/Sema/typedef-retain.c
index 3d784ce..70e2abc 100644
--- a/src/llvm-project/clang/test/Sema/typedef-retain.c
+++ b/src/llvm-project/clang/test/Sema/typedef-retain.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s -fno-lax-vector-conversions
+// RUN: %clang_cc1 -fsyntax-only -verify %s -flax-vector-conversions=none
typedef float float4 __attribute__((vector_size(16)));
typedef int int4 __attribute__((vector_size(16)));
diff --git a/src/llvm-project/clang/test/Sema/types.c b/src/llvm-project/clang/test/Sema/types.c
index f44057d..8869b34 100644
--- a/src/llvm-project/clang/test/Sema/types.c
+++ b/src/llvm-project/clang/test/Sema/types.c
@@ -2,6 +2,7 @@
// RUN: %clang_cc1 %s -fblocks -pedantic -verify -triple=mips64-linux-gnu
// RUN: %clang_cc1 %s -fblocks -pedantic -verify -triple=x86_64-unknown-linux
// RUN: %clang_cc1 %s -fblocks -pedantic -verify -triple=x86_64-unknown-linux-gnux32
+// RUN: %clang_cc1 %s -fblocks -pedantic -pedantic -verify -triple=arm64_32-apple-ios7.0
// rdar://6097662
typedef int (*T)[2];
diff --git a/src/llvm-project/clang/test/Sema/typo-correction-ambiguity.c b/src/llvm-project/clang/test/Sema/typo-correction-ambiguity.c
new file mode 100644
index 0000000..bebbf25
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/typo-correction-ambiguity.c
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+// Check the following typo correction behavior in C:
+// - no typos are diagnosed when a call expression has ambiguous (multiple) corrections
+
+int v_63;
+
+void v_2_0(int v_452, int v_454) {}
+
+int v_3_0() {
+ for (int v_345 = 0 ; v_63;)
+ v_2_0(v_195, // expected-error {{use of undeclared identifier 'v_195'}}
+ v_231); // expected-error {{use of undeclared identifier 'v_231'}}
+}
diff --git a/src/llvm-project/clang/test/Sema/typo-correction-ambiguity.cpp b/src/llvm-project/clang/test/Sema/typo-correction-ambiguity.cpp
new file mode 100644
index 0000000..9dcff3d
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/typo-correction-ambiguity.cpp
@@ -0,0 +1,29 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+// Check the following typo correction behavior in namespaces:
+// - no typos are diagnosed when an expression has ambiguous (multiple) corrections
+// - proper iteration through multiple potentially ambiguous corrections
+
+namespace AmbiguousCorrection
+{
+ void method_Bar();
+ void method_Foo();
+ void method_Zoo();
+};
+
+void testAmbiguousNoSuggestions()
+{
+ AmbiguousCorrection::method_Ace(); // expected-error {{no member named 'method_Ace' in namespace 'AmbiguousCorrection'}}
+}
+
+namespace MultipleCorrectionsButNotAmbiguous
+{
+ int PrefixType_Name(int value); // expected-note {{'PrefixType_Name' declared here}}
+ int PrefixType_MIN();
+ int PrefixType_MAX();
+};
+
+int testMultipleCorrectionsButNotAmbiguous() {
+ int val = MultipleCorrectionsButNotAmbiguous::PrefixType_Enum(0); // expected-error {{no member named 'PrefixType_Enum' in namespace 'MultipleCorrectionsButNotAmbiguous'; did you mean 'PrefixType_Name'?}}
+ return val;
+}
diff --git a/src/llvm-project/clang/test/Sema/typo-correction-recursive.cpp b/src/llvm-project/clang/test/Sema/typo-correction-recursive.cpp
new file mode 100644
index 0000000..48bd3b8
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/typo-correction-recursive.cpp
@@ -0,0 +1,120 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+// Check the following typo correction behavior:
+// - multiple typos in a single member call chain are all diagnosed
+// - no typos are diagnosed for multiple typos in an expression when not all
+// typos can be corrected
+
+class DeepClass
+{
+public:
+ void trigger() const; // expected-note {{'trigger' declared here}}
+};
+
+class Y
+{
+public:
+ const DeepClass& getX() const { return m_deepInstance; } // expected-note {{'getX' declared here}}
+private:
+ DeepClass m_deepInstance;
+ int m_n;
+};
+
+class Z
+{
+public:
+ const Y& getY0() const { return m_y0; } // expected-note {{'getY0' declared here}}
+ const Y& getActiveY() const { return m_y0; }
+
+private:
+ Y m_y0;
+ Y m_y1;
+};
+
+Z z_obj;
+
+void testMultipleCorrections()
+{
+ z_obj.getY2(). // expected-error {{no member named 'getY2' in 'Z'; did you mean 'getY0'}}
+ getM(). // expected-error {{no member named 'getM' in 'Y'; did you mean 'getX'}}
+ triggee(); // expected-error {{no member named 'triggee' in 'DeepClass'; did you mean 'trigger'}}
+}
+
+void testNoCorrections()
+{
+ z_obj.getY2(). // expected-error {{no member named 'getY2' in 'Z'}}
+ getM().
+ thisDoesntSeemToMakeSense();
+}
+
+struct C {};
+struct D { int value; };
+struct A {
+ C get_me_a_C();
+};
+struct B {
+ D get_me_a_D(); // expected-note {{'get_me_a_D' declared here}}
+};
+class Scope {
+public:
+ A make_an_A();
+ B make_a_B(); // expected-note {{'make_a_B' declared here}}
+};
+
+Scope scope_obj;
+
+int testDiscardedCorrections() {
+ return scope_obj.make_an_E(). // expected-error {{no member named 'make_an_E' in 'Scope'; did you mean 'make_a_B'}}
+ get_me_a_Z().value; // expected-error {{no member named 'get_me_a_Z' in 'B'; did you mean 'get_me_a_D'}}
+}
+
+class AmbiguousHelper {
+public:
+ int helpMe();
+ int helpBe();
+};
+class Ambiguous {
+public:
+ int calculateA();
+ int calculateB();
+
+ AmbiguousHelper getHelp1();
+ AmbiguousHelper getHelp2();
+};
+
+Ambiguous ambiguous_obj;
+
+int testDirectAmbiguousCorrection() {
+ return ambiguous_obj.calculateZ(); // expected-error {{no member named 'calculateZ' in 'Ambiguous'}}
+}
+
+int testRecursiveAmbiguousCorrection() {
+ return ambiguous_obj.getHelp3(). // expected-error {{no member named 'getHelp3' in 'Ambiguous'}}
+ helpCe();
+}
+
+
+class DeepAmbiguityHelper {
+public:
+ DeepAmbiguityHelper& help1();
+ DeepAmbiguityHelper& help2();
+
+ DeepAmbiguityHelper& methodA();
+ DeepAmbiguityHelper& somethingMethodB();
+ DeepAmbiguityHelper& functionC();
+ DeepAmbiguityHelper& deepMethodD();
+ DeepAmbiguityHelper& asDeepAsItGets();
+};
+
+DeepAmbiguityHelper deep_obj;
+
+int testDeepAmbiguity() {
+ deep_obj.
+ methodB(). // expected-error {{no member named 'methodB' in 'DeepAmbiguityHelper'}}
+ somethingMethodC().
+ functionD().
+ deepMethodD().
+ help3().
+ asDeepASItGet().
+ functionE();
+}
diff --git a/src/llvm-project/clang/test/Sema/vector-gcc-compat.cpp b/src/llvm-project/clang/test/Sema/vector-gcc-compat.cpp
index 71497d9..41d50c1 100644
--- a/src/llvm-project/clang/test/Sema/vector-gcc-compat.cpp
+++ b/src/llvm-project/clang/test/Sema/vector-gcc-compat.cpp
@@ -86,7 +86,7 @@
v2i64_r = !v2i64_a; // expected-error {{invalid argument type 'v2i64' (vector of 2 'long long' values) to unary expression}}
v2i64_r = ~v2i64_a;
- v2i64_r = v2i64_a ? v2i64_b : v2i64_c; // expected-error {{value of type 'v2i64' (vector of 2 'long long' values) is not contextually convertible to 'bool'}}
+ v2i64_r = v2i64_a ? v2i64_b : v2i64_c;
v2i64_r = v2i64_a & 1;
v2i64_r = v2i64_a | 1;
diff --git a/src/llvm-project/clang/test/Sema/warn-alloca.c b/src/llvm-project/clang/test/Sema/warn-alloca.c
new file mode 100644
index 0000000..0990e11
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/warn-alloca.c
@@ -0,0 +1,20 @@
+// RUN: %clang_cc1 -DSILENCE -fsyntax-only -verify -Wall %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Walloca %s
+
+#ifdef SILENCE
+ // expected-no-diagnostics
+#endif
+
+void test1(int a) {
+ __builtin_alloca(a);
+#ifndef SILENCE
+ // expected-warning@-2 {{use of function '__builtin_alloca' is discouraged; there is no way to check for failure but failure may still occur, resulting in a possibly exploitable security vulnerability}}
+#endif
+}
+
+void test2(int a) {
+ __builtin_alloca_with_align(a, 32);
+#ifndef SILENCE
+ // expected-warning@-2 {{use of function '__builtin_alloca_with_align' is discouraged; there is no way to check for failure but failure may still occur, resulting in a possibly exploitable security vulnerability}}
+#endif
+}
diff --git a/src/llvm-project/clang/test/Sema/warn-bitwise-compare.c b/src/llvm-project/clang/test/Sema/warn-bitwise-compare.c
index 175f8f5..08a8b08 100644
--- a/src/llvm-project/clang/test/Sema/warn-bitwise-compare.c
+++ b/src/llvm-project/clang/test/Sema/warn-bitwise-compare.c
@@ -1,7 +1,13 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -Wtautological-compare %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wtautological-bitwise-compare %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wall -Wno-unused %s
#define mydefine 2
+enum {
+ ZERO,
+ ONE,
+};
+
void f(int x) {
if ((8 & x) == 3) {} // expected-warning {{bitwise comparison always evaluates to false}}
if ((x & 8) == 4) {} // expected-warning {{bitwise comparison always evaluates to false}}
@@ -13,6 +19,9 @@
if ((x & 0x15) == 0x13) {} // expected-warning {{bitwise comparison always evaluates to false}}
if ((0x23 | x) == 0x155){} // expected-warning {{bitwise comparison always evaluates to false}}
+ if (!!((8 & x) == 3)) {} // expected-warning {{bitwise comparison always evaluates to false}}
+ int y = ((8 & x) == 3) ? 1 : 2; // expected-warning {{bitwise comparison always evaluates to false}}
+
if ((x & 8) == 8) {}
if ((x & 8) != 8) {}
if ((x | 4) == 4) {}
@@ -26,3 +35,14 @@
if ((x & mydefine) == 8) {}
if ((x | mydefine) == 4) {}
}
+
+void g(int x) {
+ if (x | 5) {} // expected-warning {{bitwise or with non-zero value always evaluates to true}}
+ if (5 | x) {} // expected-warning {{bitwise or with non-zero value always evaluates to true}}
+ if (!((x | 5))) {} // expected-warning {{bitwise or with non-zero value always evaluates to true}}
+
+ if (x | -1) {} // expected-warning {{bitwise or with non-zero value always evaluates to true}}
+ if (x | ONE) {} // expected-warning {{bitwise or with non-zero value always evaluates to true}}
+
+ if (x | ZERO) {}
+}
diff --git a/src/llvm-project/clang/test/Sema/warn-bitwise-negation-bool.c b/src/llvm-project/clang/test/Sema/warn-bitwise-negation-bool.c
new file mode 100644
index 0000000..c74705b
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/warn-bitwise-negation-bool.c
@@ -0,0 +1,24 @@
+// RUN: %clang_cc1 -x c -fsyntax-only -verify -Wbool-operation %s
+// RUN: %clang_cc1 -x c -fsyntax-only -verify %s
+// RUN: %clang_cc1 -x c -fsyntax-only -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: %clang_cc1 -x c++ -fsyntax-only -verify -Wbool-operation %s
+// RUN: %clang_cc1 -x c++ -fsyntax-only -verify %s
+// RUN: %clang_cc1 -x c++ -fsyntax-only -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+
+#ifdef __cplusplus
+typedef bool boolean;
+#else
+typedef _Bool boolean;
+#endif
+
+void test(boolean b, int i) {
+ b = ~b; // expected-warning {{bitwise negation of a boolean expression always evaluates to 'true'; did you mean logical negation?}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:7-[[@LINE-1]]:8}:"!"
+ b = ~(b); // expected-warning {{bitwise negation of a boolean expression always evaluates to 'true'; did you mean logical negation?}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:7-[[@LINE-1]]:8}:"!"
+ b = ~i;
+ i = ~b; // expected-warning {{bitwise negation of a boolean expression; did you mean logical negation?}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:7-[[@LINE-1]]:8}:"!"
+ b = ~(i > 4); // expected-warning {{bitwise negation of a boolean expression always evaluates to 'true'; did you mean logical negation?}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:7-[[@LINE-1]]:8}:"!"
+}
diff --git a/src/llvm-project/clang/test/Sema/warn-conditional-emum-types-mismatch.c b/src/llvm-project/clang/test/Sema/warn-conditional-emum-types-mismatch.c
new file mode 100644
index 0000000..c9e2edd
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/warn-conditional-emum-types-mismatch.c
@@ -0,0 +1,37 @@
+// RUN: %clang_cc1 -x c -fsyntax-only -verify -Wenum-compare-conditional %s
+// RUN: %clang_cc1 -x c++ -fsyntax-only -verify -Wenum-compare-conditional %s
+
+enum ro { A = 0x10 };
+enum rw { B = 0xFF };
+enum { C = 0x1A};
+
+enum {
+ STATUS_SUCCESS,
+ STATUS_FAILURE,
+ MAX_BASE_STATUS_CODE
+};
+
+enum ExtendedStatusCodes {
+ STATUS_SOMETHING_INTERESTING = MAX_BASE_STATUS_CODE + 1000,
+};
+
+
+int get_flag(int cond) {
+ return cond ? A : B;
+ #ifdef __cplusplus
+ // expected-warning@-2 {{conditional expression between different enumeration types ('ro' and 'rw')}}
+ #else
+ // expected-no-diagnostics
+ #endif
+}
+
+// In the following cases we purposefully differ from GCC and dont warn because
+// this code pattern is quite sensitive and we dont want to produce so many false positives.
+
+int get_flag_anon_enum(int cond) {
+ return cond ? A : C;
+}
+
+int foo(int c) {
+ return c ? STATUS_SOMETHING_INTERESTING : STATUS_SUCCESS;
+}
diff --git a/src/llvm-project/clang/test/Sema/warn-documentation-fixits.c b/src/llvm-project/clang/test/Sema/warn-documentation-fixits.c
new file mode 100644
index 0000000..2c75963
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/warn-documentation-fixits.c
@@ -0,0 +1,30 @@
+// RUN: %clang_cc1 -fsyntax-only -Wdocumentation -Wdocumentation-pedantic -fcomment-block-commands=foobar -verify %s
+// RUN %clang_cc1 -std=c18 -fsyntax-only -Wdocumentation -Wdocumentation-pedantic -fcomment-block-commands=foobar -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck -DATTRIBUTE="__attribute__((deprecated))" %s
+// RUN: %clang_cc1 -std=c2x -DC2x -fsyntax-only -Wdocumentation -Wdocumentation-pedantic -fcomment-block-commands=foobar -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck --check-prefixes=CHECK,CHECK2x -DATTRIBUTE="[[deprecated]]" %s
+
+// expected-warning@+1 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}} expected-note@+2 {{add a deprecation attribute to the declaration to silence this warning}}
+/// \deprecated
+void test_deprecated_1();
+
+// expected-warning@+1 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}} expected-note@+2 {{add a deprecation attribute to the declaration to silence this warning}}
+/// \deprecated
+void test_deprecated_2(int a);
+
+#define MY_ATTR_DEPRECATED __attribute__((deprecated))
+
+// expected-warning@+1 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}} expected-note@+2 {{add a deprecation attribute to the declaration to silence this warning}}
+/// \deprecated
+void test_deprecated_3(int a);
+
+#ifdef C2x
+#define ATTRIBUTE_DEPRECATED [[deprecated]]
+
+// expected-warning@+1 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}} expected-note@+2 {{add a deprecation attribute to the declaration to silence this warning}}
+/// \deprecated
+void test_deprecated_4(int a);
+#endif
+
+// CHECK: fix-it:"{{.*}}":{7:1-7:1}:"[[ATTRIBUTE]] "
+// CHECK: fix-it:"{{.*}}":{11:1-11:1}:"[[ATTRIBUTE]] "
+// CHECK: fix-it:"{{.*}}":{17:1-17:1}:"MY_ATTR_DEPRECATED "
+// CHECK2x: fix-it:"{{.*}}":{24:1-24:1}:"ATTRIBUTE_DEPRECATED "
diff --git a/src/llvm-project/clang/test/Sema/warn-documentation-fixits.cpp b/src/llvm-project/clang/test/Sema/warn-documentation-fixits.cpp
index 95c0e93..871ac00 100644
--- a/src/llvm-project/clang/test/Sema/warn-documentation-fixits.cpp
+++ b/src/llvm-project/clang/test/Sema/warn-documentation-fixits.cpp
@@ -1,5 +1,6 @@
// RUN: %clang_cc1 -fsyntax-only -Wdocumentation -Wdocumentation-pedantic -fcomment-block-commands=foobar -verify %s
-// RUN: %clang_cc1 -fsyntax-only -Wdocumentation -Wdocumentation-pedantic -fcomment-block-commands=foobar -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN %clang_cc1 -std=c++11 -fsyntax-only -Wdocumentation -Wdocumentation-pedantic -fcomment-block-commands=foobar -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck -DATTRIBUTE="__attribute__((deprecated))" %s
+// RUN: %clang_cc1 -std=c++14 -fsyntax-only -Wdocumentation -Wdocumentation-pedantic -fcomment-block-commands=foobar -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck --check-prefixes=CHECK,CHECK14 -DATTRIBUTE="[[deprecated]]" %s
// expected-warning@+1 {{parameter 'ZZZZZZZZZZ' not found in the function declaration}} expected-note@+1 {{did you mean 'a'?}}
/// \param ZZZZZZZZZZ Blah blah.
@@ -51,12 +52,58 @@
}
};
+class PR43753 {
+ // expected-warning@+2 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}}
+ // expected-note@+2 {{add a deprecation attribute to the declaration to silence this warning}}
+ /// \deprecated
+ static void test_deprecated_static();
+
+ // expected-warning@+2 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}}
+ // expected-note@+2 {{add a deprecation attribute to the declaration to silence this warning}}
+ /// \deprecated
+ static auto test_deprecated_static_trailing_return() -> int;
+
+#if __cplusplus >= 201402L
+ // expected-warning@+2 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}}
+ // expected-note@+2 {{add a deprecation attribute to the declaration to silence this warning}}
+ /// \deprecated
+ static decltype(auto) test_deprecated_static_decltype_auto() { return 1; }
+#endif
+
+ // expected-warning@+2 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}}
+ // expected-note@+2 {{add a deprecation attribute to the declaration to silence this warning}}
+ /// \deprecated
+ void test_deprecated_const() const;
+
+ // expected-warning@+2 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}}
+ // expected-note@+2 {{add a deprecation attribute to the declaration to silence this warning}}
+ /// \deprecated
+ auto test_deprecated_trailing_return() -> int;
+
+#if __cplusplus >= 201402L
+ // expected-warning@+2 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}}
+ // expected-note@+2 {{add a deprecation attribute to the declaration to silence this warning}}
+ /// \deprecated
+ decltype(auto) test_deprecated_decltype_auto() const { return a; }
+
+private:
+ int a{0};
+#endif
+};
#define MY_ATTR_DEPRECATED __attribute__((deprecated))
// expected-warning@+1 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}} expected-note@+2 {{add a deprecation attribute to the declaration to silence this warning}}
/// \deprecated
void test_deprecated_9(int a);
+#if __cplusplus >= 201402L
+#define ATTRIBUTE_DEPRECATED [[deprecated]]
+
+// expected-warning@+1 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}} expected-note@+2 {{add a deprecation attribute to the declaration to silence this warning}}
+/// \deprecated
+void test_deprecated_10(int a);
+#endif
+
// rdar://12381408
// expected-warning@+2 {{unknown command tag name 'retur'; did you mean 'return'?}}
/// \brief testing fixit
@@ -76,17 +123,21 @@
/// \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"
-// CHECK: fix-it:"{{.*}}":{18:13-18:18}:"SomeTy"
-// CHECK: fix-it:"{{.*}}":{25:25-25:25}:" __attribute__((deprecated))"
-// CHECK: fix-it:"{{.*}}":{29:30-29:30}:" __attribute__((deprecated))"
-// CHECK: fix-it:"{{.*}}":{34:27-34:27}:" __attribute__((deprecated))"
-// CHECK: fix-it:"{{.*}}":{38:27-38:27}:" __attribute__((deprecated))"
-// 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:"{{.*}}":{76:6-76:12}:"endcode"
+// CHECK: fix-it:"{{.*}}":{6:12-6:22}:"a"
+// CHECK: fix-it:"{{.*}}":{10:12-10:15}:"aaa"
+// CHECK: fix-it:"{{.*}}":{14:13-14:23}:"T"
+// CHECK: fix-it:"{{.*}}":{19:13-19:18}:"SomeTy"
+// CHECK: fix-it:"{{.*}}":{26:1-26:1}:"[[ATTRIBUTE]] "
+// CHECK: fix-it:"{{.*}}":{30:1-30:1}:"[[ATTRIBUTE]] "
+// CHECK: fix-it:"{{.*}}":{35:3-35:3}:"[[ATTRIBUTE]] "
+// CHECK: fix-it:"{{.*}}":{39:3-39:3}:"[[ATTRIBUTE]] "
+// CHECK: fix-it:"{{.*}}":{47:3-47:3}:"[[ATTRIBUTE]] "
+// CHECK: fix-it:"{{.*}}":{51:3-51:3}:"[[ATTRIBUTE]] "
+// CHECK: fix-it:"{{.*}}":{76:3-76:3}:"[[ATTRIBUTE]] "
+// CHECK: fix-it:"{{.*}}":{81:3-81:3}:"[[ATTRIBUTE]] "
+// CHECK14: fix-it:"{{.*}}":{87:3-87:3}:"[[ATTRIBUTE]] "
+// CHECK: fix-it:"{{.*}}":{97:1-97:1}:"MY_ATTR_DEPRECATED "
+// CHECK14: fix-it:"{{.*}}":{104:1-104:1}:"ATTRIBUTE_DEPRECATED "
+// CHECK: fix-it:"{{.*}}":{110:6-110:11}:"return"
+// CHECK: fix-it:"{{.*}}":{114:6-114:11}:"foobar"
+// CHECK: fix-it:"{{.*}}":{123:6-123:12}:"endcode"
diff --git a/src/llvm-project/clang/test/Sema/warn-documentation.cpp b/src/llvm-project/clang/test/Sema/warn-documentation.cpp
index 5083f68..3091c2f3 100644
--- a/src/llvm-project/clang/test/Sema/warn-documentation.cpp
+++ b/src/llvm-project/clang/test/Sema/warn-documentation.cpp
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -Wdocumentation -Wdocumentation-pedantic -verify %s
+// RUN: %clang_cc1 -std=c++14 -fsyntax-only -Wdocumentation -Wdocumentation-pedantic -verify %s
// This file contains lots of corner cases, so ensure that XML we generate is not invalid.
// RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng %s | FileCheck %s -check-prefix=WRONG
@@ -288,6 +289,11 @@
/// \param x2 Ccc.
int test_param22(int x1, int x2, int x3);
+// expected-warning@+1 {{empty paragraph passed to '\param' command}}
+/// \param a
+/// \retval 0 Blah blah.
+int test_param23(int a);
+
//===---
// Test that we treat typedefs to some non-function types as functions for the
// purposes of documentation comment parsing.
@@ -606,6 +612,12 @@
/// \deprecated Bbb
void test_deprecated_1(int a) __attribute__((deprecated));
+#if __cplusplus >= 201402L
+/// Aaa
+/// \deprecated Bbb
+[[deprecated]] void test_deprecated_no_warning_std14(int a);
+#endif
+
// We don't want \deprecated to warn about empty paragraph. It is fine to use
// \deprecated by itself without explanations.
@@ -626,9 +638,9 @@
/// \deprecated
void test_deprecated_5(int a);
-// expected-warning@+2 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}} expected-note@+3 {{add a deprecation attribute to the declaration to silence this warning}}
+// expected-warning@+2 {{declaration is marked with '@deprecated' command but does not have a deprecation attribute}} expected-note@+3 {{add a deprecation attribute to the declaration to silence this warning}}
/// Aaa
-/// \deprecated
+/// @deprecated
void test_deprecated_6(int a) {
}
@@ -638,6 +650,44 @@
template<typename T>
void test_deprecated_7(T aaa);
+class PR43753 {
+ // expected-warning@+2 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}}
+ // expected-note@+2 {{add a deprecation attribute to the declaration to silence this warning}}
+ /// \deprecated
+ static void test_deprecated_static();
+
+ // expected-warning@+2 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}}
+ // expected-note@+2 {{add a deprecation attribute to the declaration to silence this warning}}
+ /// \deprecated
+ static auto test_deprecated_static_trailing_return() -> int;
+
+#if __cplusplus >= 201402L
+ // expected-warning@+2 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}}
+ // expected-note@+2 {{add a deprecation attribute to the declaration to silence this warning}}
+ /// \deprecated
+ static decltype(auto) test_deprecated_static_decltype_auto() { return 1; }
+#endif
+
+ // expected-warning@+2 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}}
+ // expected-note@+2 {{add a deprecation attribute to the declaration to silence this warning}}
+ /// \deprecated
+ void test_deprecated_const() const;
+
+ // expected-warning@+2 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}}
+ // expected-note@+2 {{add a deprecation attribute to the declaration to silence this warning}}
+ /// \deprecated
+ auto test_deprecated_trailing_return() -> int;
+
+#if __cplusplus >= 201402L
+ // expected-warning@+2 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}}
+ // expected-note@+2 {{add a deprecation attribute to the declaration to silence this warning}}
+ /// \deprecated
+ decltype(auto) test_deprecated_decltype_auto() const { return a; }
+
+private:
+ int a{0};
+#endif
+};
// rdar://12397511
// expected-note@+2 {{previous command '\headerfile' here}}
@@ -863,7 +913,7 @@
/// \brief\author Aaa
typedef struct test_noattach14 *test_attach15;
-// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
+// expected-warning@+1 + {{empty paragraph passed to '\brief' command}}
/// \brief\author Aaa
typedef struct test_attach16 { int a; } test_attach17;
@@ -881,7 +931,7 @@
/// \brief\author Aaa
struct test_attach20;
-// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
+// expected-warning@+1 + {{empty paragraph passed to '\brief' command}}
/// \brief\author Aaa
typedef struct test_attach21 {
// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
@@ -1044,6 +1094,55 @@
template <typename B>
void test_attach38<int>::test_attach39(int, B);
+// The inline comments expect a string after the command.
+// expected-warning@+1 {{'\a' command does not have a valid word argument}}
+/// \a
+int test_inline_no_argument_a_bad(int);
+
+/// \a A
+int test_inline_no_argument_a_good(int);
+
+// expected-warning@+1 {{'\anchor' command does not have a valid word argument}}
+/// \anchor
+int test_inline_no_argument_anchor_bad(int);
+
+/// \anchor A
+int test_inline_no_argument_anchor_good(int);
+
+// expected-warning@+1 {{'@b' command does not have a valid word argument}}
+/// @b
+int test_inline_no_argument_b_bad(int);
+
+/// @b A
+int test_inline_no_argument_b_good(int);
+
+// expected-warning@+1 {{'\c' command does not have a valid word argument}}
+/// \c
+int test_inline_no_argument_c_bad(int);
+
+/// \c A
+int test_inline_no_argument_c_good(int);
+
+// expected-warning@+1 {{'\e' command does not have a valid word argument}}
+/// \e
+int test_inline_no_argument_e_bad(int);
+
+/// \e A
+int test_inline_no_argument_e_good(int);
+
+// expected-warning@+1 {{'\em' command does not have a valid word argument}}
+/// \em
+int test_inline_no_argument_em_bad(int);
+
+/// \em A
+int test_inline_no_argument_em_good(int);
+
+// expected-warning@+1 {{'\p' command does not have a valid word argument}}
+/// \p
+int test_inline_no_argument_p_bad(int);
+
+/// \p A
+int test_inline_no_argument_p_good(int);
// PR13411, reduced. We used to crash on this.
/**
@@ -1313,3 +1412,34 @@
*/
class EmptyNoteNoCrash {
};
+
+namespace PR42844 { // Assertion failures when using typedefed function pointers
+typedef void (*AA)();
+typedef AA A();
+A *a; ///< \return none
+// expected-warning@-1 {{'\return' command used in a comment that is not attached to a function or method declaration}}
+
+typedef void B();
+B *b; ///< \return none
+// expected-warning@-1 {{'\return' command used in a comment that is not attached to a function or method declaration}}
+
+void CC();
+typedef void C();
+C &c = CC; ///< \return none
+// expected-warning@-1 {{'\return' command used in a comment that is not attached to a function or method declaration}}
+
+using DD = void(*)();
+using D = DD();
+D *d; ///< \return none
+// expected-warning@-1 {{'\return' command used in a comment that is not attached to a function or method declaration}}
+
+using E = void();
+E *e; ///< \return none
+// expected-warning@-1 {{'\return' command used in a comment that is not attached to a function or method declaration}}
+
+void FF();
+using F = void();
+F &f = FF; ///< \return none
+// expected-warning@-1 {{'\return' command used in a comment that is not attached to a function or method declaration}}
+
+} // namespace PR42844
diff --git a/src/llvm-project/clang/test/Sema/warn-documentation.m b/src/llvm-project/clang/test/Sema/warn-documentation.m
index 0b75bcf..c713d5b 100644
--- a/src/llvm-project/clang/test/Sema/warn-documentation.m
+++ b/src/llvm-project/clang/test/Sema/warn-documentation.m
@@ -310,3 +310,11 @@
* now should work too.
*/
typedef void (^VariadicBlockType)(int a, ...);
+
+// PR42844 - Assertion failures when using typedefed block pointers
+typedef void(^VoidBlockType)();
+typedef VoidBlockType VoidBlockTypeCall();
+VoidBlockTypeCall *d; ///< \return none
+// expected-warning@-1 {{'\return' command used in a comment that is not attached to a function or method declaration}}
+VoidBlockTypeCall ^e; ///< \return none
+// expected-warning@-1 {{'\return' command used in a comment that is not attached to a function or method declaration}}
diff --git a/src/llvm-project/clang/test/Sema/warn-int-in-bool-context.c b/src/llvm-project/clang/test/Sema/warn-int-in-bool-context.c
new file mode 100644
index 0000000..0c94ebb
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/warn-int-in-bool-context.c
@@ -0,0 +1,74 @@
+// RUN: %clang_cc1 -x c -fsyntax-only -verify -Wint-in-bool-context %s
+// RUN: %clang_cc1 -x c -fsyntax-only -verify -Wall %s
+// RUN: %clang_cc1 -x c++ -fsyntax-only -verify -Wint-in-bool-context %s
+// RUN: %clang_cc1 -x c++ -fsyntax-only -verify -Wall %s
+
+#define ONE 1
+#define TWO 2
+
+#define SHIFT(l, r) l << r
+#define MM a << a
+#define AF 1 << 7
+
+#ifdef __cplusplus
+typedef bool boolean;
+#else
+typedef _Bool boolean;
+#endif
+
+enum num {
+ zero,
+ one,
+ two,
+};
+
+int test(int a, unsigned b, enum num n) {
+ boolean r;
+ r = a << a; // expected-warning {{converting the result of '<<' to a boolean; did you mean '(a << a) != 0'?}}
+ r = MM; // expected-warning {{converting the result of '<<' to a boolean; did you mean '(a << a) != 0'?}}
+ r = (1 << 7); // expected-warning {{converting the result of '<<' to a boolean always evaluates to true}}
+ r = 2UL << 2; // expected-warning {{converting the result of '<<' to a boolean always evaluates to true}}
+ r = 0 << a; // expected-warning {{converting the result of '<<' to a boolean always evaluates to false}}
+ r = 0 << 2; // expected-warning {{converting the result of '<<' to a boolean always evaluates to false}}
+ r = 1 << 0; // expected-warning {{converting the result of '<<' to a boolean always evaluates to true}}
+ r = 1 << 2; // expected-warning {{converting the result of '<<' to a boolean always evaluates to true}}
+ r = 1ULL << 2; // expected-warning {{converting the result of '<<' to a boolean always evaluates to true}}
+ r = 2 << b; // expected-warning {{converting the result of '<<' to a boolean; did you mean '(2 << b) != 0'?}}
+ r = (unsigned)(2 << b);
+ r = b << 7;
+ r = (1 << a); // expected-warning {{converting the result of '<<' to a boolean; did you mean '(1 << a) != 0'?}}
+ r = TWO << a; // expected-warning {{converting the result of '<<' to a boolean; did you mean '(2 << a) != 0'?}}
+ r = a << 7; // expected-warning {{converting the result of '<<' to a boolean; did you mean '(a << 7) != 0'?}}
+ r = ONE << a; // expected-warning {{converting the result of '<<' to a boolean; did you mean '(1 << a) != 0'?}}
+ if (TWO << a) // expected-warning {{converting the result of '<<' to a boolean; did you mean '(2 << a) != 0'?}}
+ return a;
+
+ for (a = 0; 1 << a; a++) // expected-warning {{converting the result of '<<' to a boolean; did you mean '(1 << a) != 0'?}}
+ ;
+
+ if (a << TWO) // expected-warning {{converting the result of '<<' to a boolean; did you mean '(a << 2) != 0'?}}
+ return a;
+
+ if (n || two)
+ // expected-warning@-1 {{converting the enum constant to a boolean}}
+ return a;
+
+ if (n == one || two)
+ // expected-warning@-1 {{converting the enum constant to a boolean}}
+ return a;
+
+ if (r && two)
+ // expected-warning@-1 {{converting the enum constant to a boolean}}
+ return a;
+
+ if (two && r)
+ // expected-warning@-1 {{converting the enum constant to a boolean}}
+ return a;
+
+ if (n == one && two)
+ // expected-warning@-1 {{converting the enum constant to a boolean}}
+ return a;
+
+ // Don't warn in macros.
+ return SHIFT(1, a);
+}
diff --git a/src/llvm-project/clang/test/Sema/warn-integer-constants-in-ternary.c b/src/llvm-project/clang/test/Sema/warn-integer-constants-in-ternary.c
new file mode 100644
index 0000000..95c78d2
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/warn-integer-constants-in-ternary.c
@@ -0,0 +1,32 @@
+// RUN: %clang_cc1 -x c -fsyntax-only -verify -Wtautological-constant-compare %s
+// RUN: %clang_cc1 -x c -fsyntax-only -verify %s
+// RUN: %clang_cc1 -x c++ -fsyntax-only -verify -Wtautological-constant-compare %s
+// RUN: %clang_cc1 -x c++ -fsyntax-only -verify %s
+
+#define ONE 1
+#define TWO 2
+
+#define TERN(c, l, r) c ? l : r
+
+#ifdef __cplusplus
+typedef bool boolean;
+#else
+typedef _Bool boolean;
+#endif
+
+void test(boolean a) {
+ boolean r;
+ r = a ? (1) : TWO;
+ r = a ? 3 : TWO; // expected-warning {{converting the result of '?:' with integer constants to a boolean always evaluates to 'true'}}
+ r = a ? -2 : 0;
+ r = a ? 3 : -2; // expected-warning {{converting the result of '?:' with integer constants to a boolean always evaluates to 'true'}}
+ r = a ? 0 : TWO;
+ r = a ? 3 : ONE; // expected-warning {{converting the result of '?:' with integer constants to a boolean always evaluates to 'true'}}
+ r = a ? ONE : 0;
+ r = a ? 0 : -0;
+ r = a ? 1 : 0;
+ r = a ? ONE : 0;
+ r = a ? ONE : ONE;
+ r = TERN(a, 4, 8); // expected-warning {{converting the result of '?:' with integer constants to a boolean always evaluates to 'true'}}
+ r = TERN(a, -1, -8); // expected-warning {{converting the result of '?:' with integer constants to a boolean always evaluates to 'true'}}
+}
diff --git a/src/llvm-project/clang/test/Sema/warn-lifetime-analysis-nocfg-disabled.cpp b/src/llvm-project/clang/test/Sema/warn-lifetime-analysis-nocfg-disabled.cpp
new file mode 100644
index 0000000..60b8f3d
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/warn-lifetime-analysis-nocfg-disabled.cpp
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -fsyntax-only -Wno-dangling-gsl -Wreturn-stack-address -verify %s
+
+struct [[gsl::Owner(int)]] MyIntOwner {
+ MyIntOwner();
+ int &operator*();
+};
+
+struct [[gsl::Pointer(int)]] MyIntPointer {
+ MyIntPointer(int *p = nullptr);
+ MyIntPointer(const MyIntOwner &);
+ int &operator*();
+ MyIntOwner toOwner();
+};
+
+int &f() {
+ int i;
+ return i; // expected-warning {{reference to stack memory associated with local variable 'i' returned}}
+}
+
+MyIntPointer g() {
+ MyIntOwner o;
+ return o; // No warning, it is disabled.
+}
diff --git a/src/llvm-project/clang/test/Sema/warn-lifetime-analysis-nocfg.cpp b/src/llvm-project/clang/test/Sema/warn-lifetime-analysis-nocfg.cpp
new file mode 100644
index 0000000..3319d5a
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/warn-lifetime-analysis-nocfg.cpp
@@ -0,0 +1,457 @@
+// RUN: %clang_cc1 -fsyntax-only -Wdangling -Wdangling-field -Wreturn-stack-address -verify %s
+struct [[gsl::Owner(int)]] MyIntOwner {
+ MyIntOwner();
+ int &operator*();
+};
+
+struct [[gsl::Pointer(int)]] MyIntPointer {
+ MyIntPointer(int *p = nullptr);
+ // Conversion operator and constructor conversion will result in two
+ // different ASTs. The former is tested with another owner and
+ // pointer type.
+ MyIntPointer(const MyIntOwner &);
+ int &operator*();
+ MyIntOwner toOwner();
+};
+
+struct MySpecialIntPointer : MyIntPointer {
+};
+
+// We did see examples in the wild when a derived class changes
+// the ownership model. So we have a test for it.
+struct [[gsl::Owner(int)]] MyOwnerIntPointer : MyIntPointer {
+};
+
+struct [[gsl::Pointer(long)]] MyLongPointerFromConversion {
+ MyLongPointerFromConversion(long *p = nullptr);
+ long &operator*();
+};
+
+struct [[gsl::Owner(long)]] MyLongOwnerWithConversion {
+ MyLongOwnerWithConversion();
+ operator MyLongPointerFromConversion();
+ long &operator*();
+ MyIntPointer releaseAsMyPointer();
+ long *releaseAsRawPointer();
+};
+
+void danglingHeapObject() {
+ new MyLongPointerFromConversion(MyLongOwnerWithConversion{}); // expected-warning {{object backing the pointer will be destroyed at the end of the full-expression}}
+ new MyIntPointer(MyIntOwner{}); // expected-warning {{object backing the pointer will be destroyed at the end of the full-expression}}
+}
+
+void intentionalFalseNegative() {
+ int i;
+ MyIntPointer p{&i};
+ // In this case we do not have enough information in a statement local
+ // analysis to detect the problem.
+ new MyIntPointer(p);
+ new MyIntPointer(MyIntPointer{p});
+}
+
+MyIntPointer ownershipTransferToMyPointer() {
+ MyLongOwnerWithConversion t;
+ return t.releaseAsMyPointer(); // ok
+}
+
+long *ownershipTransferToRawPointer() {
+ MyLongOwnerWithConversion t;
+ return t.releaseAsRawPointer(); // ok
+}
+
+struct Y {
+ int a[4];
+};
+
+void dangligGslPtrFromTemporary() {
+ MyIntPointer p = Y{}.a; // TODO
+ (void)p;
+}
+
+struct DanglingGslPtrField {
+ MyIntPointer p; // expected-note {{pointer member declared here}}
+ MyLongPointerFromConversion p2; // expected-note {{pointer member declared here}}
+ DanglingGslPtrField(int i) : p(&i) {} // TODO
+ DanglingGslPtrField() : p2(MyLongOwnerWithConversion{}) {} // expected-warning {{initializing pointer member 'p2' to point to a temporary object whose lifetime is shorter than the lifetime of the constructed object}}
+ DanglingGslPtrField(double) : p(MyIntOwner{}) {} // expected-warning {{initializing pointer member 'p' to point to a temporary object whose lifetime is shorter than the lifetime of the constructed object}}
+};
+
+MyIntPointer danglingGslPtrFromLocal() {
+ int j;
+ return &j; // TODO
+}
+
+MyIntPointer returningLocalPointer() {
+ MyIntPointer localPointer;
+ return localPointer; // ok
+}
+
+MyIntPointer daglingGslPtrFromLocalOwner() {
+ MyIntOwner localOwner;
+ return localOwner; // expected-warning {{address of stack memory associated with local variable 'localOwner' returned}}
+}
+
+MyLongPointerFromConversion daglingGslPtrFromLocalOwnerConv() {
+ MyLongOwnerWithConversion localOwner;
+ return localOwner; // expected-warning {{address of stack memory associated with local variable 'localOwner' returned}}
+}
+
+MyIntPointer danglingGslPtrFromTemporary() {
+ return MyIntOwner{}; // expected-warning {{returning address of local temporary object}}
+}
+
+MyIntOwner makeTempOwner();
+
+MyIntPointer danglingGslPtrFromTemporary2() {
+ return makeTempOwner(); // expected-warning {{returning address of local temporary object}}
+}
+
+MyLongPointerFromConversion danglingGslPtrFromTemporaryConv() {
+ return MyLongOwnerWithConversion{}; // expected-warning {{returning address of local temporary object}}
+}
+
+int *noFalsePositive(MyIntOwner &o) {
+ MyIntPointer p = o;
+ return &*p; // ok
+}
+
+MyIntPointer global;
+MyLongPointerFromConversion global2;
+
+void initLocalGslPtrWithTempOwner() {
+ MyIntPointer p = MyIntOwner{}; // expected-warning {{object backing the pointer will be destroyed at the end of the full-expression}}
+ p = MyIntOwner{}; // TODO ?
+ global = MyIntOwner{}; // TODO ?
+ MyLongPointerFromConversion p2 = MyLongOwnerWithConversion{}; // expected-warning {{object backing the pointer will be destroyed at the end of the full-expression}}
+ p2 = MyLongOwnerWithConversion{}; // TODO ?
+ global2 = MyLongOwnerWithConversion{}; // TODO ?
+}
+
+namespace __gnu_cxx {
+template <typename T>
+struct basic_iterator {
+ basic_iterator operator++();
+ T& operator*() const;
+ T* operator->() const;
+};
+
+template<typename T>
+bool operator!=(basic_iterator<T>, basic_iterator<T>);
+}
+
+namespace std {
+template<typename T> struct remove_reference { typedef T type; };
+template<typename T> struct remove_reference<T &> { typedef T type; };
+template<typename T> struct remove_reference<T &&> { typedef T type; };
+
+template<typename T>
+typename remove_reference<T>::type &&move(T &&t) noexcept;
+
+template <typename C>
+auto data(const C &c) -> decltype(c.data());
+
+template <typename C>
+auto begin(C &c) -> decltype(c.begin());
+
+template<typename T, int N>
+T *begin(T (&array)[N]);
+
+template <typename T>
+struct vector {
+ typedef __gnu_cxx::basic_iterator<T> iterator;
+ iterator begin();
+ iterator end();
+ const T *data() const;
+ T &at(int n);
+};
+
+template<typename T>
+struct basic_string_view {
+ basic_string_view(const T *);
+ const T *begin() const;
+};
+
+template<typename T>
+struct basic_string {
+ basic_string();
+ basic_string(const T *);
+ const T *c_str() const;
+ operator basic_string_view<T> () const;
+};
+
+
+template<typename T>
+struct unique_ptr {
+ T &operator*();
+ T *get() const;
+};
+
+template<typename T>
+struct optional {
+ optional();
+ optional(const T&);
+ T &operator*() &;
+ T &&operator*() &&;
+ T &value() &;
+ T &&value() &&;
+};
+
+template<typename T>
+struct stack {
+ T &top();
+};
+
+struct any {};
+
+template<typename T>
+T any_cast(const any& operand);
+
+template<typename T>
+struct reference_wrapper {
+ template<typename U>
+ reference_wrapper(U &&);
+};
+
+template<typename T>
+reference_wrapper<T> ref(T& t) noexcept;
+}
+
+struct Unannotated {
+ typedef std::vector<int>::iterator iterator;
+ iterator begin();
+ operator iterator() const;
+};
+
+void modelIterators() {
+ std::vector<int>::iterator it = std::vector<int>().begin(); // expected-warning {{object backing the pointer will be destroyed at the end of the full-expression}}
+ (void)it;
+}
+
+std::vector<int>::iterator modelIteratorReturn() {
+ return std::vector<int>().begin(); // expected-warning {{returning address of local temporary object}}
+}
+
+const int *modelFreeFunctions() {
+ return std::data(std::vector<int>()); // expected-warning {{returning address of local temporary object}}
+}
+
+int &modelAnyCast() {
+ return std::any_cast<int&>(std::any{}); // expected-warning {{returning reference to local temporary object}}
+}
+
+int modelAnyCast2() {
+ return std::any_cast<int>(std::any{}); // ok
+}
+
+int modelAnyCast3() {
+ return std::any_cast<int&>(std::any{}); // ok
+}
+
+const char *danglingRawPtrFromLocal() {
+ std::basic_string<char> s;
+ return s.c_str(); // expected-warning {{address of stack memory associated with local variable 's' returned}}
+}
+
+int &danglingRawPtrFromLocal2() {
+ std::optional<int> o;
+ return o.value(); // expected-warning {{reference to stack memory associated with local variable 'o' returned}}
+}
+
+int &danglingRawPtrFromLocal3() {
+ std::optional<int> o;
+ return *o; // expected-warning {{reference to stack memory associated with local variable 'o' returned}}
+}
+
+const char *danglingRawPtrFromTemp() {
+ return std::basic_string<char>().c_str(); // expected-warning {{returning address of local temporary object}}
+}
+
+std::unique_ptr<int> getUniquePtr();
+
+int *danglingUniquePtrFromTemp() {
+ return getUniquePtr().get(); // expected-warning {{returning address of local temporary object}}
+}
+
+int *danglingUniquePtrFromTemp2() {
+ return std::unique_ptr<int>().get(); // expected-warning {{returning address of local temporary object}}
+}
+
+void danglingReferenceFromTempOwner() {
+ int &&r = *std::optional<int>(); // expected-warning {{object backing the pointer will be destroyed at the end of the full-expression}}
+ int &&r2 = *std::optional<int>(5); // expected-warning {{object backing the pointer will be destroyed at the end of the full-expression}}
+ int &&r3 = std::optional<int>(5).value(); // expected-warning {{object backing the pointer will be destroyed at the end of the full-expression}}
+ int &r4 = std::vector<int>().at(3); // expected-warning {{object backing the pointer will be destroyed at the end of the full-expression}}
+}
+
+std::vector<int> getTempVec();
+std::optional<std::vector<int>> getTempOptVec();
+
+void testLoops() {
+ for (auto i : getTempVec()) // ok
+ ;
+ for (auto i : *getTempOptVec()) // expected-warning {{object backing the pointer will be destroyed at the end of the full-expression}}
+ ;
+}
+
+int &usedToBeFalsePositive(std::vector<int> &v) {
+ std::vector<int>::iterator it = v.begin();
+ int& value = *it;
+ return value; // ok
+}
+
+int &doNotFollowReferencesForLocalOwner() {
+ std::unique_ptr<int> localOwner;
+ int &p = *localOwner.get();
+ // In real world code localOwner is usually moved here.
+ return p; // ok
+}
+
+const char *trackThroughMultiplePointer() {
+ return std::basic_string_view<char>(std::basic_string<char>()).begin(); // expected-warning {{returning address of local temporary object}}
+}
+
+struct X {
+ X(std::unique_ptr<int> up) :
+ pointee(*up), pointee2(up.get()), pointer(std::move(up)) {}
+ int &pointee;
+ int *pointee2;
+ std::unique_ptr<int> pointer;
+};
+
+std::vector<int>::iterator getIt();
+std::vector<int> getVec();
+
+const int &handleGslPtrInitsThroughReference() {
+ const auto &it = getIt(); // Ok, it is lifetime extended.
+ return *it;
+}
+
+void handleGslPtrInitsThroughReference2() {
+ const std::vector<int> &v = getVec();
+ const int *val = v.data(); // Ok, it is lifetime extended.
+}
+
+void handleTernaryOperator(bool cond) {
+ std::basic_string<char> def;
+ std::basic_string_view<char> v = cond ? def : ""; // expected-warning {{object backing the pointer will be destroyed at the end of the full-expression}}
+}
+
+std::reference_wrapper<int> danglingPtrFromNonOwnerLocal() {
+ int i = 5;
+ return i; // TODO
+}
+
+std::reference_wrapper<int> danglingPtrFromNonOwnerLocal2() {
+ int i = 5;
+ return std::ref(i); // TODO
+}
+
+std::reference_wrapper<int> danglingPtrFromNonOwnerLocal3() {
+ int i = 5;
+ return std::reference_wrapper<int>(i); // TODO
+}
+
+std::reference_wrapper<Unannotated> danglingPtrFromNonOwnerLocal4() {
+ Unannotated i;
+ return std::reference_wrapper<Unannotated>(i); // TODO
+}
+
+std::reference_wrapper<Unannotated> danglingPtrFromNonOwnerLocal5() {
+ Unannotated i;
+ return std::ref(i); // TODO
+}
+
+int *returnPtrToLocalArray() {
+ int a[5];
+ return std::begin(a); // TODO
+}
+
+struct ptr_wrapper {
+ std::vector<int>::iterator member;
+};
+
+ptr_wrapper getPtrWrapper();
+
+std::vector<int>::iterator returnPtrFromWrapper() {
+ ptr_wrapper local = getPtrWrapper();
+ return local.member;
+}
+
+std::vector<int>::iterator returnPtrFromWrapperThroughRef() {
+ ptr_wrapper local = getPtrWrapper();
+ ptr_wrapper &local2 = local;
+ return local2.member;
+}
+
+std::vector<int>::iterator returnPtrFromWrapperThroughRef2() {
+ ptr_wrapper local = getPtrWrapper();
+ std::vector<int>::iterator &local2 = local.member;
+ return local2;
+}
+
+void checkPtrMemberFromAggregate() {
+ std::vector<int>::iterator local = getPtrWrapper().member; // OK.
+}
+
+std::vector<int>::iterator doNotInterferWithUnannotated() {
+ Unannotated value;
+ // Conservative choice for now. Probably not ok, but we do not warn.
+ return std::begin(value);
+}
+
+std::vector<int>::iterator doNotInterferWithUnannotated2() {
+ Unannotated value;
+ return value;
+}
+
+std::vector<int>::iterator supportDerefAddrofChain(int a, std::vector<int>::iterator value) {
+ switch (a) {
+ default:
+ return value;
+ case 1:
+ return *&value;
+ case 2:
+ return *&*&value;
+ case 3:
+ return *&*&*&value;
+ }
+}
+
+int &supportDerefAddrofChain2(int a, std::vector<int>::iterator value) {
+ switch (a) {
+ default:
+ return *value;
+ case 1:
+ return **&value;
+ case 2:
+ return **&*&value;
+ case 3:
+ return **&*&*&value;
+ }
+}
+
+int *supportDerefAddrofChain3(int a, std::vector<int>::iterator value) {
+ switch (a) {
+ default:
+ return &*value;
+ case 1:
+ return &*&*value;
+ case 2:
+ return &*&**&value;
+ case 3:
+ return &*&**&*&value;
+ }
+}
+
+MyIntPointer handleDerivedToBaseCast1(MySpecialIntPointer ptr) {
+ return ptr;
+}
+
+MyIntPointer handleDerivedToBaseCast2(MyOwnerIntPointer ptr) {
+ return ptr; // expected-warning {{address of stack memory associated with parameter 'ptr' returned}}
+}
+
+std::vector<int>::iterator noFalsePositiveWithVectorOfPointers() {
+ std::vector<std::vector<int>::iterator> iters;
+ return iters.at(0);
+}
diff --git a/src/llvm-project/clang/test/Sema/warn-nullchar-nullptr.c b/src/llvm-project/clang/test/Sema/warn-nullchar-nullptr.c
new file mode 100644
index 0000000..eabfebc
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/warn-nullchar-nullptr.c
@@ -0,0 +1,49 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -Wall %s -std=c11
+
+int test1(int *a) {
+ return a == '\0'; // expected-warning {{comparing a pointer to a null character constant; did you mean to compare to (void *)0?}}
+}
+
+int test2(int *a) {
+ return '\0' == a; // expected-warning {{comparing a pointer to a null character constant; did you mean to compare to (void *)0?}}
+}
+
+int test3(int *a) {
+ return a == L'\0'; // expected-warning {{comparing a pointer to a null character constant; did you mean to compare to (void *)0?}}
+}
+
+int test4(int *a) {
+ return a == u'\0'; // expected-warning {{comparing a pointer to a null character constant; did you mean to compare to (void *)0?}}
+}
+
+int test5(int *a) {
+ return a == U'\0'; // expected-warning {{comparing a pointer to a null character constant; did you mean to compare to (void *)0?}}
+}
+
+int test6(int *a) {
+ return a == (char)0; // expected-warning {{comparing a pointer to a null character constant; did you mean to compare to (void *)0?}}
+}
+
+typedef char my_char;
+int test7(int *a) {
+ return a == (my_char)0;
+ // expected-warning@-1 {{comparing a pointer to a null character constant; did you mean to compare to (void *)0?}}
+}
+
+int test8(int *a) {
+ return a != '\0'; // expected-warning {{comparing a pointer to a null character constant; did you mean to compare to (void *)0?}}
+}
+
+#define NULL (void *)0
+int test9(int *a) {
+ return a == '\0'; // expected-warning {{comparing a pointer to a null character constant; did you mean to compare to NULL?}}
+}
+
+#define MYCHAR char
+int test10(int *a) {
+ return a == (MYCHAR)0; // expected-warning {{comparing a pointer to a null character constant; did you mean to compare to NULL?}}
+}
+
+int test11(int *a) {
+ return a > '\0';
+}
diff --git a/src/llvm-project/clang/test/Sema/warn-overlap.c b/src/llvm-project/clang/test/Sema/warn-overlap.c
index 6299c51..e1e86d1 100644
--- a/src/llvm-project/clang/test/Sema/warn-overlap.c
+++ b/src/llvm-project/clang/test/Sema/warn-overlap.c
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -fsyntax-only -verify -Wtautological-overlap-compare %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wall -Wno-unused -Wno-loop-analysis %s
#define mydefine 2
@@ -141,3 +142,34 @@
return x < 1 || x != 0;
// expected-warning@-1{{overlapping comparisons always evaluate to true}}
}
+
+int integer_conversion(unsigned x, int y) {
+ return x > 4 || x < 10;
+ // expected-warning@-1{{overlapping comparisons always evaluate to true}}
+ return y > 4u || y < 10u;
+ // expected-warning@-1{{overlapping comparisons always evaluate to true}}
+}
+
+int negative_compare(int x) {
+ return x > -1 || x < 1;
+ // expected-warning@-1{{overlapping comparisons always evaluate to true}}
+}
+
+int no_warning(unsigned x) {
+ return x >= 0 || x == 1;
+ // no warning since "x >= 0" is caught by a different tautological warning.
+}
+
+struct A {
+ int x;
+ int y;
+};
+
+int struct_test(struct A a) {
+ return a.x > 5 && a.y < 1; // no warning, different variables
+
+ return a.x > 5 && a.x < 1;
+ // expected-warning@-1{{overlapping comparisons always evaluate to false}}
+ return a.y == 1 || a.y != 1;
+ // expected-warning@-1{{overlapping comparisons always evaluate to true}}
+}
diff --git a/src/llvm-project/clang/test/Sema/warn-stringcompare.c b/src/llvm-project/clang/test/Sema/warn-stringcompare.c
new file mode 100644
index 0000000..77876ad
--- /dev/null
+++ b/src/llvm-project/clang/test/Sema/warn-stringcompare.c
@@ -0,0 +1,29 @@
+// RUN: %clang_cc1 -x c -fsyntax-only -verify %s
+// RUN: %clang_cc1 -x c++ -fsyntax-only -verify %s
+
+#define DELIM "/"
+#define DOT "."
+#define NULL (void *)0
+
+void test(const char *d) {
+ if ("/" != d) // expected-warning {{result of comparison against a string literal is unspecified (use an explicit string comparison function instead)}}
+ return;
+ if (d == "/") // expected-warning {{result of comparison against a string literal is unspecified (use an explicit string comparison function instead)}}
+ return;
+ if ("/" != NULL)
+ return;
+ if (NULL == "/")
+ return;
+ if ("/" != DELIM) // expected-warning {{result of comparison against a string literal is unspecified (use an explicit string comparison function instead)}}
+ return;
+ if (DELIM == "/") // expected-warning {{result of comparison against a string literal is unspecified (use an explicit string comparison function instead)}}
+ return;
+ if (DELIM != NULL)
+ return;
+ if (NULL == DELIM)
+ return;
+ if (DOT != DELIM) // expected-warning {{result of comparison against a string literal is unspecified (use an explicit string comparison function instead)}}
+ return;
+ if (DELIM == DOT) // expected-warning {{result of comparison against a string literal is unspecified (use an explicit string comparison function instead)}}
+ return;
+}
diff --git a/src/llvm-project/clang/test/Sema/warn-unreachable.c b/src/llvm-project/clang/test/Sema/warn-unreachable.c
index aec3b07..cfac36a 100644
--- a/src/llvm-project/clang/test/Sema/warn-unreachable.c
+++ b/src/llvm-project/clang/test/Sema/warn-unreachable.c
@@ -433,7 +433,7 @@
}
void unaryOpNoFixit() {
- if (- 1)
+ if (~ 1)
return; // CHECK-NOT: fix-it:"{{.*}}":{[[@LINE-1]]
unaryOpNoFixit(); // expected-warning {{code will never be executed}}
}
diff --git a/src/llvm-project/clang/test/Sema/warn-unsequenced.c b/src/llvm-project/clang/test/Sema/warn-unsequenced.c
index 9654cda..fd0227b 100644
--- a/src/llvm-project/clang/test/Sema/warn-unsequenced.c
+++ b/src/llvm-project/clang/test/Sema/warn-unsequenced.c
@@ -40,18 +40,18 @@
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
+ (xs[2] && (a = 0)) + a; // expected-warning {{unsequenced modification and access to 'a'}}
(0 && (a = 0)) + a; // ok
(1 && (a = 0)) + a; // expected-warning {{unsequenced modification and access}}
- (xs[3] || (a = 0)) + a; // ok
+ (xs[3] || (a = 0)) + a; // expected-warning {{unsequenced modification and access to 'a'}}
(0 || (a = 0)) + a; // expected-warning {{unsequenced modification and access}}
(1 || (a = 0)) + a; // ok
- (xs[4] ? a : ++a) + a; // ok
+ (xs[4] ? a : ++a) + a; // expected-warning {{unsequenced modification and access to 'a'}}
(0 ? a : ++a) + a; // expected-warning {{unsequenced modification and access}}
(1 ? a : ++a) + a; // ok
- (xs[5] ? ++a : ++a) + a; // FIXME: warn here
+ (xs[5] ? ++a : ++a) + a; // expected-warning {{unsequenced modification and access to 'a'}}
(++a, xs[6] ? ++a : 0) + a; // expected-warning {{unsequenced modification and access}}
@@ -73,10 +73,11 @@
// unconditional.
a = a++ && f(a, a);
- // This has undefined behavior if a != 0. FIXME: We should diagnose this.
- (a && a++) + a;
+ // This has undefined behavior if a != 0.
+ (a && a++) + a; // expected-warning {{unsequenced modification and access to 'a'}}
- (xs[7] && ++a) * (!xs[7] && ++a); // ok
+ // FIXME: Find a way to avoid warning here.
+ (xs[7] && ++a) * (!xs[7] && ++a); // expected-warning {{multiple unsequenced modifications to 'a'}}
xs[0] = (a = 1, a); // ok
diff --git a/src/llvm-project/clang/test/Sema/zvector.c b/src/llvm-project/clang/test/Sema/zvector.c
index 858e10d..798b12b 100644
--- a/src/llvm-project/clang/test/Sema/zvector.c
+++ b/src/llvm-project/clang/test/Sema/zvector.c
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -triple s390x-linux-gnu -fzvector \
-// RUN: -fno-lax-vector-conversions -W -Wall -Wconversion \
+// RUN: -flax-vector-conversions=none -W -Wall -Wconversion \
// RUN: -Werror -fsyntax-only -verify %s
vector signed char sc, sc2;
diff --git a/src/llvm-project/clang/test/Sema/zvector2.c b/src/llvm-project/clang/test/Sema/zvector2.c
index 08ec9df..a4e0a9e 100644
--- a/src/llvm-project/clang/test/Sema/zvector2.c
+++ b/src/llvm-project/clang/test/Sema/zvector2.c
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -triple s390x-linux-gnu -fzvector -target-cpu z14 \
-// RUN: -fno-lax-vector-conversions -W -Wall -Wconversion \
+// RUN: -flax-vector-conversions=none -W -Wall -Wconversion \
// RUN: -Werror -fsyntax-only -verify %s
vector signed char sc, sc2;
diff --git a/src/llvm-project/clang/test/SemaCUDA/autoret-global.cu b/src/llvm-project/clang/test/SemaCUDA/autoret-global.cu
new file mode 100644
index 0000000..ae2f1ca
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaCUDA/autoret-global.cu
@@ -0,0 +1,44 @@
+// RUN: %clang_cc1 -std=c++14 -fsyntax-only -verify %s
+
+#include "Inputs/cuda.h"
+
+template <typename T>
+__global__ T foo() {
+ // expected-note@-1 {{kernel function type 'T ()' must have void return type}}
+}
+
+void f0() {
+ foo<void><<<0, 0>>>();
+ foo<int><<<0, 0>>>();
+ // expected-error@-1 {{no matching function for call to 'foo'}}
+}
+
+__global__ auto f1() {
+}
+
+__global__ auto f2(int x) {
+ return x + 1;
+ // expected-error@-2 {{kernel function type 'auto (int)' must have void return type}}
+}
+
+template <bool Cond, typename T = void> struct enable_if { typedef T type; };
+template <typename T> struct enable_if<false, T> {};
+
+template <int N>
+__global__
+auto bar() -> typename enable_if<N == 1>::type {
+ // expected-note@-1 {{requirement '3 == 1' was not satisfied [with N = 3]}}
+}
+
+template <int N>
+__global__
+auto bar() -> typename enable_if<N == 2>::type {
+ // expected-note@-1 {{requirement '3 == 2' was not satisfied [with N = 3]}}
+}
+
+void f3() {
+ bar<1><<<0, 0>>>();
+ bar<2><<<0, 0>>>();
+ bar<3><<<0, 0>>>();
+ // expected-error@-1 {{no matching function for call to 'bar'}}
+}
diff --git a/src/llvm-project/clang/test/SemaCUDA/call-device-fn-from-host.cu b/src/llvm-project/clang/test/SemaCUDA/call-device-fn-from-host.cu
index ba1ce86..5d506d6 100644
--- a/src/llvm-project/clang/test/SemaCUDA/call-device-fn-from-host.cu
+++ b/src/llvm-project/clang/test/SemaCUDA/call-device-fn-from-host.cu
@@ -1,5 +1,7 @@
// RUN: %clang_cc1 %s --std=c++11 -triple x86_64-unknown-linux -emit-llvm -o - \
// RUN: -verify -verify-ignore-unexpected=note
+// RUN: %clang_cc1 %s --std=c++11 -triple x86_64-unknown-linux -emit-llvm -o - \
+// RUN: -verify -verify-ignore-unexpected=note -fopenmp
// Note: This test won't work with -fsyntax-only, because some of these errors
// are emitted during codegen.
diff --git a/src/llvm-project/clang/test/SemaCUDA/constexpr-ctor.cu b/src/llvm-project/clang/test/SemaCUDA/constexpr-ctor.cu
new file mode 100644
index 0000000..20107b3
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaCUDA/constexpr-ctor.cu
@@ -0,0 +1,33 @@
+// RUN: %clang_cc1 -std=c++11 -triple nvptx64-nvidia-cuda -fsyntax-only \
+// RUN: -fcuda-is-device -verify=dev %s
+// RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-linux-gnu -fsyntax-only \
+// RUN: -verify=host %s
+
+// host-no-diagnostics
+
+#include "Inputs/cuda.h"
+
+struct A {
+ A(); // dev-note 2{{'A' declared here}}
+};
+
+template <class T, int x> struct B {
+ T a;
+ constexpr B() = default; // dev-error 2{{reference to __host__ function 'A' in __host__ __device__ function}}
+};
+
+__host__ void f() { B<A, 1> x; }
+__device__ void f() { B<A, 1> x; } // dev-note{{called by 'f'}}
+
+struct foo {
+ __host__ foo() { B<A, 2> x; }
+ __device__ foo() { B<A, 2> x; } // dev-note{{called by 'foo'}}
+};
+
+__host__ void g() { foo x; }
+__device__ void g() { foo x; } // dev-note{{called by 'g'}}
+
+struct bar {
+ __host__ bar() { B<A, 3> x; }
+ __device__ bar() { B<A, 3> x; } // no error since no instantiation of bar
+};
diff --git a/src/llvm-project/clang/test/SemaCUDA/default-ctor.cu b/src/llvm-project/clang/test/SemaCUDA/default-ctor.cu
new file mode 100644
index 0000000..cbad7a1
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaCUDA/default-ctor.cu
@@ -0,0 +1,43 @@
+// RUN: %clang_cc1 -std=c++11 -triple nvptx64-nvidia-cuda -fsyntax-only \
+// RUN: -fcuda-is-device -verify -verify-ignore-unexpected=note %s
+// RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-linux-gnu -fsyntax-only \
+// RUN: -verify -verify-ignore-unexpected=note %s
+
+#include "Inputs/cuda.h"
+
+struct In { In() = default; };
+struct InD { __device__ InD() = default; };
+struct InH { __host__ InH() = default; };
+struct InHD { __host__ __device__ InHD() = default; };
+
+struct Out { Out(); };
+struct OutD { __device__ OutD(); };
+struct OutH { __host__ OutH(); };
+struct OutHD { __host__ __device__ OutHD(); };
+
+Out::Out() = default;
+__device__ OutD::OutD() = default;
+__host__ OutH::OutH() = default;
+__host__ __device__ OutHD::OutHD() = default;
+
+__device__ void fd() {
+ In in;
+ InD ind;
+ InH inh; // expected-error{{no matching constructor for initialization of 'InH'}}
+ InHD inhd;
+ Out out; // expected-error{{no matching constructor for initialization of 'Out'}}
+ OutD outd;
+ OutH outh; // expected-error{{no matching constructor for initialization of 'OutH'}}
+ OutHD outhd;
+}
+
+__host__ void fh() {
+ In in;
+ InD ind; // expected-error{{no matching constructor for initialization of 'InD'}}
+ InH inh;
+ InHD inhd;
+ Out out;
+ OutD outd; // expected-error{{no matching constructor for initialization of 'OutD'}}
+ OutH outh;
+ OutHD outhd;
+}
diff --git a/src/llvm-project/clang/test/SemaCUDA/function-overload.cu b/src/llvm-project/clang/test/SemaCUDA/function-overload.cu
index 1d78636..b9efd1c 100644
--- a/src/llvm-project/clang/test/SemaCUDA/function-overload.cu
+++ b/src/llvm-project/clang/test/SemaCUDA/function-overload.cu
@@ -402,3 +402,20 @@
__device__ void test_device_template_overload() {
template_overload(1); // OK. Attribute-based overloading picks __device__ variant.
}
+
+// Two classes with `operator-` defined. One of them is device only.
+struct C1;
+struct C2;
+__device__
+int operator-(const C1 &x, const C1 &y);
+int operator-(const C2 &x, const C2 &y);
+
+template <typename T>
+__host__ __device__ int constexpr_overload(const T &x, const T &y) {
+ return x - y;
+}
+
+// Verify that function overloading doesn't prune candidate wrongly.
+int test_constexpr_overload(C2 &x, C2 &y) {
+ return constexpr_overload(x, y);
+}
diff --git a/src/llvm-project/clang/test/SemaCUDA/gnu-inline.cu b/src/llvm-project/clang/test/SemaCUDA/gnu-inline.cu
index 0ed5433..e383082 100644
--- a/src/llvm-project/clang/test/SemaCUDA/gnu-inline.cu
+++ b/src/llvm-project/clang/test/SemaCUDA/gnu-inline.cu
@@ -7,4 +7,4 @@
// Check that we can handle gnu_inline functions when compiling in CUDA mode.
void foo();
-inline __attribute__((gnu_inline)) void bar() { foo(); }
+extern inline __attribute__((gnu_inline)) void bar() { foo(); }
diff --git a/src/llvm-project/clang/test/SemaCUDA/host-device-constexpr.cu b/src/llvm-project/clang/test/SemaCUDA/host-device-constexpr.cu
index 6625d72..6d81034 100644
--- a/src/llvm-project/clang/test/SemaCUDA/host-device-constexpr.cu
+++ b/src/llvm-project/clang/test/SemaCUDA/host-device-constexpr.cu
@@ -1,5 +1,10 @@
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify -isystem %S/Inputs %s
-// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify -isystem %S/Inputs %s -fcuda-is-device
+// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify -isystem %S/Inputs %s \
+// RUN: -fcuda-is-device
+// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify -isystem %S/Inputs \
+// RUN: -fopenmp %s
+// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify -isystem %S/Inputs \
+// RUN: -fopenmp %s -fcuda-is-device
#include "Inputs/cuda.h"
diff --git a/src/llvm-project/clang/test/SemaCUDA/implicit-member-target-collision-cxx11.cu b/src/llvm-project/clang/test/SemaCUDA/implicit-member-target-collision-cxx11.cu
index 7aa1dd3..06015ed 100644
--- a/src/llvm-project/clang/test/SemaCUDA/implicit-member-target-collision-cxx11.cu
+++ b/src/llvm-project/clang/test/SemaCUDA/implicit-member-target-collision-cxx11.cu
@@ -74,11 +74,13 @@
struct C4_with_collision : A4_with_host_copy_ctor, B4_with_device_copy_ctor {
};
-// expected-note@-3 {{copy constructor of 'C4_with_collision' is implicitly deleted because base class 'B4_with_device_copy_ctor' has no copy constructor}}
+// expected-note@-3 {{candidate constructor (the implicit copy constructor) not viable: call to invalid function from __host__ function}}
+// expected-note@-4 {{implicit copy constructor inferred target collision: call to both __host__ and __device__ members}}
+// expected-note@-5 {{candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided}}
void hostfoo4() {
C4_with_collision c;
- C4_with_collision c2 = c; // expected-error {{call to implicitly-deleted copy constructor of 'C4_with_collision'}}
+ C4_with_collision c2 = c; // expected-error {{no matching constructor for initialization of 'C4_with_collision'}}
}
//------------------------------------------------------------------------------
diff --git a/src/llvm-project/clang/test/SemaCUDA/openmp-static-func.cu b/src/llvm-project/clang/test/SemaCUDA/openmp-static-func.cu
new file mode 100644
index 0000000..f1f0c48
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaCUDA/openmp-static-func.cu
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fsyntax-only \
+// RUN: -verify -fopenmp %s
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fsyntax-only \
+// RUN: -verify -fopenmp -x hip %s
+// expected-no-diagnostics
+
+// Tests there is no assertion in Sema::markKnownEmitted when fopenmp is used
+// with CUDA/HIP host compilation.
+
+static void f() {}
+
+static void g() { f(); }
+
+static void h() { g(); }
diff --git a/src/llvm-project/clang/test/SemaCUDA/openmp-target.cu b/src/llvm-project/clang/test/SemaCUDA/openmp-target.cu
new file mode 100644
index 0000000..2775dc1
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaCUDA/openmp-target.cu
@@ -0,0 +1,43 @@
+// RUN: %clang_cc1 -triple x86_64 -verify=expected,dev \
+// RUN: -verify-ignore-unexpected=note \
+// RUN: -fopenmp -fopenmp-version=50 -o - %s
+// RUN: %clang_cc1 -triple x86_64 -verify -verify-ignore-unexpected=note\
+// RUN: -fopenmp -fopenmp-version=50 -o - -x c++ %s
+// RUN: %clang_cc1 -triple x86_64 -verify=dev -verify-ignore-unexpected=note\
+// RUN: -fcuda-is-device -o - %s
+
+#if __CUDA__
+#include "Inputs/cuda.h"
+__device__ void cu_devf();
+#endif
+
+void bazz() {}
+#pragma omp declare target to(bazz) device_type(nohost)
+void bazzz() {bazz();}
+#pragma omp declare target to(bazzz) device_type(nohost)
+void any() {bazz();} // expected-error {{function with 'device_type(nohost)' is not available on host}}
+void host1() {bazz();}
+#pragma omp declare target to(host1) device_type(host)
+void host2() {bazz();}
+#pragma omp declare target to(host2)
+void device() {host1();}
+#pragma omp declare target to(device) device_type(nohost)
+void host3() {host1();}
+#pragma omp declare target to(host3)
+
+#pragma omp declare target
+void any1() {any();}
+void any2() {host1();}
+void any3() {device();} // expected-error {{function with 'device_type(nohost)' is not available on host}}
+void any4() {any2();}
+#pragma omp end declare target
+
+void any5() {any();}
+void any6() {host1();}
+void any7() {device();} // expected-error {{function with 'device_type(nohost)' is not available on host}}
+void any8() {any2();}
+
+#if __CUDA__
+void cu_hostf() { cu_devf(); } // dev-error {{no matching function for call to 'cu_devf'}}
+__device__ void cu_devf2() { cu_hostf(); } // dev-error{{no matching function for call to 'cu_hostf'}}
+#endif
diff --git a/src/llvm-project/clang/test/SemaCXX/Inputs/std-compare.h b/src/llvm-project/clang/test/SemaCXX/Inputs/std-compare.h
index a6ab605..eaf7951 100644
--- a/src/llvm-project/clang/test/SemaCXX/Inputs/std-compare.h
+++ b/src/llvm-project/clang/test/SemaCXX/Inputs/std-compare.h
@@ -6,11 +6,8 @@
// exposition only
enum class _EqResult : unsigned char {
- __zero = 0,
- __equal = __zero,
+ __equal = 0,
__equiv = __equal,
- __nonequal = 1,
- __nonequiv = __nonequal
};
enum class _OrdResult : signed char {
@@ -25,108 +22,6 @@
struct _CmpUnspecifiedType;
using _CmpUnspecifiedParam = void (_CmpUnspecifiedType::*)();
-class weak_equality {
- constexpr explicit weak_equality(_EqResult __val) noexcept : __value_(__val) {}
-
-public:
- static const weak_equality equivalent;
- static const weak_equality nonequivalent;
-
- friend constexpr bool operator==(weak_equality __v, _CmpUnspecifiedParam) noexcept;
- friend constexpr bool operator==(_CmpUnspecifiedParam, weak_equality __v) noexcept;
- friend constexpr bool operator!=(weak_equality __v, _CmpUnspecifiedParam) noexcept;
- friend constexpr bool operator!=(_CmpUnspecifiedParam, weak_equality __v) noexcept;
- friend constexpr weak_equality operator<=>(weak_equality __v, _CmpUnspecifiedParam) noexcept;
- friend constexpr weak_equality operator<=>(_CmpUnspecifiedParam, weak_equality __v) noexcept;
-
- // test helper
- constexpr bool test_eq(weak_equality const &other) const noexcept {
- return __value_ == other.__value_;
- }
-
-private:
- _EqResult __value_;
-};
-
-inline constexpr weak_equality weak_equality::equivalent(_EqResult::__equiv);
-inline constexpr weak_equality weak_equality::nonequivalent(_EqResult::__nonequiv);
-inline constexpr bool operator==(weak_equality __v, _CmpUnspecifiedParam) noexcept {
- return __v.__value_ == _EqResult::__zero;
-}
-inline constexpr bool operator==(_CmpUnspecifiedParam, weak_equality __v) noexcept {
- return __v.__value_ == _EqResult::__zero;
-}
-inline constexpr bool operator!=(weak_equality __v, _CmpUnspecifiedParam) noexcept {
- return __v.__value_ != _EqResult::__zero;
-}
-inline constexpr bool operator!=(_CmpUnspecifiedParam, weak_equality __v) noexcept {
- return __v.__value_ != _EqResult::__zero;
-}
-
-inline constexpr weak_equality operator<=>(weak_equality __v, _CmpUnspecifiedParam) noexcept {
- return __v;
-}
-inline constexpr weak_equality operator<=>(_CmpUnspecifiedParam, weak_equality __v) noexcept {
- return __v;
-}
-
-class strong_equality {
- explicit constexpr strong_equality(_EqResult __val) noexcept : __value_(__val) {}
-
-public:
- static const strong_equality equal;
- static const strong_equality nonequal;
- static const strong_equality equivalent;
- static const strong_equality nonequivalent;
-
- // conversion
- constexpr operator weak_equality() const noexcept {
- return __value_ == _EqResult::__zero ? weak_equality::equivalent
- : weak_equality::nonequivalent;
- }
-
- // comparisons
- friend constexpr bool operator==(strong_equality __v, _CmpUnspecifiedParam) noexcept;
- friend constexpr bool operator!=(strong_equality __v, _CmpUnspecifiedParam) noexcept;
- friend constexpr bool operator==(_CmpUnspecifiedParam, strong_equality __v) noexcept;
- friend constexpr bool operator!=(_CmpUnspecifiedParam, strong_equality __v) noexcept;
-
- friend constexpr strong_equality operator<=>(strong_equality __v, _CmpUnspecifiedParam) noexcept;
- friend constexpr strong_equality operator<=>(_CmpUnspecifiedParam, strong_equality __v) noexcept;
-
- // test helper
- constexpr bool test_eq(strong_equality const &other) const noexcept {
- return __value_ == other.__value_;
- }
-
-private:
- _EqResult __value_;
-};
-
-inline constexpr strong_equality strong_equality::equal(_EqResult::__equal);
-inline constexpr strong_equality strong_equality::nonequal(_EqResult::__nonequal);
-inline constexpr strong_equality strong_equality::equivalent(_EqResult::__equiv);
-inline constexpr strong_equality strong_equality::nonequivalent(_EqResult::__nonequiv);
-constexpr bool operator==(strong_equality __v, _CmpUnspecifiedParam) noexcept {
- return __v.__value_ == _EqResult::__zero;
-}
-constexpr bool operator==(_CmpUnspecifiedParam, strong_equality __v) noexcept {
- return __v.__value_ == _EqResult::__zero;
-}
-constexpr bool operator!=(strong_equality __v, _CmpUnspecifiedParam) noexcept {
- return __v.__value_ != _EqResult::__zero;
-}
-constexpr bool operator!=(_CmpUnspecifiedParam, strong_equality __v) noexcept {
- return __v.__value_ != _EqResult::__zero;
-}
-
-constexpr strong_equality operator<=>(strong_equality __v, _CmpUnspecifiedParam) noexcept {
- return __v;
-}
-constexpr strong_equality operator<=>(_CmpUnspecifiedParam, strong_equality __v) noexcept {
- return __v;
-}
-
class partial_ordering {
using _ValueT = signed char;
explicit constexpr partial_ordering(_EqResult __v) noexcept
@@ -147,11 +42,6 @@
static const partial_ordering greater;
static const partial_ordering unordered;
- // conversion
- constexpr operator weak_equality() const noexcept {
- return __value_ == 0 ? weak_equality::equivalent : weak_equality::nonequivalent;
- }
-
// comparisons
friend constexpr bool operator==(partial_ordering __v, _CmpUnspecifiedParam) noexcept;
friend constexpr bool operator!=(partial_ordering __v, _CmpUnspecifiedParam) noexcept;
@@ -237,10 +127,6 @@
static const weak_ordering greater;
// conversions
- constexpr operator weak_equality() const noexcept {
- return __value_ == 0 ? weak_equality::equivalent
- : weak_equality::nonequivalent;
- }
constexpr operator partial_ordering() const noexcept {
return __value_ == 0 ? partial_ordering::equivalent
: (__value_ < 0 ? partial_ordering::less : partial_ordering::greater);
@@ -331,14 +217,6 @@
static const strong_ordering greater;
// conversions
- constexpr operator weak_equality() const noexcept {
- return __value_ == 0 ? weak_equality::equivalent
- : weak_equality::nonequivalent;
- }
- constexpr operator strong_equality() const noexcept {
- return __value_ == 0 ? strong_equality::equal
- : strong_equality::nonequal;
- }
constexpr operator partial_ordering() const noexcept {
return __value_ == 0 ? partial_ordering::equivalent
: (__value_ < 0 ? partial_ordering::less : partial_ordering::greater);
@@ -423,14 +301,6 @@
return __v < 0 ? strong_ordering::greater : (__v > 0 ? strong_ordering::less : __v);
}
-// named comparison functions
-constexpr bool is_eq(weak_equality __cmp) noexcept { return __cmp == 0; }
-constexpr bool is_neq(weak_equality __cmp) noexcept { return __cmp != 0; }
-constexpr bool is_lt(partial_ordering __cmp) noexcept { return __cmp < 0; }
-constexpr bool is_lteq(partial_ordering __cmp) noexcept { return __cmp <= 0; }
-constexpr bool is_gt(partial_ordering __cmp) noexcept { return __cmp > 0; }
-constexpr bool is_gteq(partial_ordering __cmp) noexcept { return __cmp >= 0; }
-
} // namespace __1
} // end namespace std
diff --git a/src/llvm-project/clang/test/SemaCXX/MicrosoftCompatibility.cpp b/src/llvm-project/clang/test/SemaCXX/MicrosoftCompatibility.cpp
index 727e675..453f78a 100644
--- a/src/llvm-project/clang/test/SemaCXX/MicrosoftCompatibility.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/MicrosoftCompatibility.cpp
@@ -322,3 +322,65 @@
void instantiate() { ConfuseLookup<int>::m_val::ms_test = 1; }
}
+
+// Microsoft doesn't validate exception specification.
+namespace microsoft_exception_spec {
+
+void foo(); // expected-note {{previous declaration}}
+void foo() throw(); // expected-warning {{exception specification in declaration does not match previous declaration}}
+
+void r6() throw(...); // expected-note {{previous declaration}}
+void r6() throw(int); // expected-warning {{exception specification in declaration does not match previous declaration}}
+
+struct Base {
+ virtual void f2();
+ virtual void f3() throw(...);
+};
+
+struct Derived : Base {
+ virtual void f2() throw(...);
+ virtual void f3();
+};
+
+class A {
+ virtual ~A() throw();
+#if __cplusplus <= 199711L
+ // expected-note@-2 {{overridden virtual function is here}}
+#endif
+};
+
+class B : public A {
+ virtual ~B();
+#if __cplusplus <= 199711L
+ // expected-warning@-2 {{exception specification of overriding function is more lax than base version}}
+#endif
+};
+
+}
+
+namespace PR25265 {
+struct S {
+ int fn() throw(); // expected-note {{previous declaration is here}}
+};
+
+int S::fn() { return 0; } // expected-warning {{is missing exception specification}}
+}
+
+namespace PR43265 {
+template <int N> // expected-note {{template parameter is declared here}}
+struct Foo {
+ static const int N = 42; // expected-warning {{declaration of 'N' shadows template parameter}}
+};
+}
+
+namespace Inner_Outer_same_template_param_name {
+template <typename T> // expected-note {{template parameter is declared here}}
+struct Outmost {
+ template <typename T> // expected-warning {{declaration of 'T' shadows template parameter}}
+ struct Inner {
+ void f() {
+ T *var;
+ }
+ };
+};
+}
diff --git a/src/llvm-project/clang/test/SemaCXX/MicrosoftExtensions.cpp b/src/llvm-project/clang/test/SemaCXX/MicrosoftExtensions.cpp
index 8accc88..4dca1b6 100644
--- a/src/llvm-project/clang/test/SemaCXX/MicrosoftExtensions.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/MicrosoftExtensions.cpp
@@ -6,41 +6,6 @@
#if TEST1
-// Microsoft doesn't validate exception specification.
-namespace microsoft_exception_spec {
-
-void foo(); // expected-note {{previous declaration}}
-void foo() throw(); // expected-warning {{exception specification in declaration does not match previous declaration}}
-
-void r6() throw(...); // expected-note {{previous declaration}}
-void r6() throw(int); // expected-warning {{exception specification in declaration does not match previous declaration}}
-
-struct Base {
- virtual void f2();
- virtual void f3() throw(...);
-};
-
-struct Derived : Base {
- virtual void f2() throw(...);
- virtual void f3();
-};
-
-class A {
- virtual ~A() throw();
-#if __cplusplus <= 199711L
- // expected-note@-2 {{overridden virtual function is here}}
-#endif
-};
-
-class B : public A {
- virtual ~B();
-#if __cplusplus <= 199711L
- // expected-warning@-2 {{exception specification of overriding function is more lax than base version}}
-#endif
-};
-
-}
-
// MSVC allows type definition in anonymous union and struct
struct A
{
@@ -475,6 +440,11 @@
// expected-error@+1 {{base 'SealedType' is marked 'sealed'}}
struct InheritFromSealed : SealedType {};
+class SealedDestructor { // expected-note {{mark 'SealedDestructor' as 'sealed' to silence this warning}}
+ // expected-warning@+1 {{'sealed' keyword is a Microsoft extension}}
+ virtual ~SealedDestructor() sealed; // expected-warning {{class with destructor marked 'sealed' cannot be inherited from}}
+};
+
void AfterClassBody() {
// expected-warning@+1 {{attribute 'deprecated' is ignored, place it after "struct" to apply attribute to type declaration}}
struct D {} __declspec(deprecated);
@@ -495,14 +465,6 @@
};
}
-namespace PR25265 {
-struct S {
- int fn() throw(); // expected-note {{previous declaration is here}}
-};
-
-int S::fn() { return 0; } // expected-warning {{is missing exception specification}}
-}
-
class PR34109_class {
PR34109_class() {}
virtual ~PR34109_class() {}
diff --git a/src/llvm-project/clang/test/SemaCXX/PR31422.cpp b/src/llvm-project/clang/test/SemaCXX/PR31422.cpp
new file mode 100644
index 0000000..0ac321d
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaCXX/PR31422.cpp
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 -std=c++14 -fsyntax-only -verify %s
+
+// expected-error@+3 {{cannot specify any part of a return type in the declaration of a conversion function; use an alias template to declare a conversion to 'auto (Ts &&...) const'}}
+// expected-error@+2 {{conversion function cannot convert to a function type}}
+struct S {
+ template <typename... Ts> operator auto()(Ts &&... xs) const;
+};
diff --git a/src/llvm-project/clang/test/SemaCXX/address-space-references.cpp b/src/llvm-project/clang/test/SemaCXX/address-space-references.cpp
index 5c297e7..f79ffab 100644
--- a/src/llvm-project/clang/test/SemaCXX/address-space-references.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/address-space-references.cpp
@@ -3,10 +3,10 @@
typedef int __attribute__((address_space(1))) int_1;
typedef int __attribute__((address_space(2))) int_2;
-void f0(int_1 &); // expected-note{{candidate function not viable: address space mismatch in 1st argument ('int'), parameter type must be 'int_1 &' (aka '__attribute__((address_space(1))) int &')}} \
-// expected-note{{candidate function not viable: address space mismatch in 1st argument ('int_2' (aka '__attribute__((address_space(2))) int')), parameter type must be 'int_1 &' (aka '__attribute__((address_space(1))) int &')}}
-void f0(const int_1 &); // expected-note{{candidate function not viable: address space mismatch in 1st argument ('int'), parameter type must be 'const int_1 &' (aka 'const __attribute__((address_space(1))) int &')}} \
-// expected-note{{candidate function not viable: address space mismatch in 1st argument ('int_2' (aka '__attribute__((address_space(2))) int')), parameter type must be 'const int_1 &' (aka 'const __attribute__((address_space(1))) int &')}}
+void f0(int_1 &); // expected-note{{candidate function not viable: cannot bind reference in generic address space to object in address space '1' in 1st argument}} \
+// expected-note{{candidate function not viable: cannot bind reference in address space '2' to object in address space '1' in 1st argument}}
+void f0(const int_1 &); // expected-note{{candidate function not viable: cannot bind reference in generic address space to object in address space '1' in 1st argument}} \
+// expected-note{{candidate function not viable: cannot bind reference in address space '2' to object in address space '1' in 1st argument}}
void test_f0() {
int i;
diff --git a/src/llvm-project/clang/test/SemaCXX/aggregate-initialization.cpp b/src/llvm-project/clang/test/SemaCXX/aggregate-initialization.cpp
index bb03c6f..c71a744 100644
--- a/src/llvm-project/clang/test/SemaCXX/aggregate-initialization.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/aggregate-initialization.cpp
@@ -1,6 +1,7 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
-// RUN: %clang_cc1 -fsyntax-only -verify -std=c++14 %s
-// RUN: %clang_cc1 -fsyntax-only -verify -std=c++17 %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++14 %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++17 %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++2a %s
// Verify that using an initializer list for a non-aggregate looks for
// constructors..
diff --git a/src/llvm-project/clang/test/SemaCXX/altivec.cpp b/src/llvm-project/clang/test/SemaCXX/altivec.cpp
index 92f0283..2ba3400 100644
--- a/src/llvm-project/clang/test/SemaCXX/altivec.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/altivec.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -target-feature +altivec -fno-lax-vector-conversions -triple powerpc-unknown-unknown -fcxx-exceptions -verify %s
+// RUN: %clang_cc1 -target-feature +altivec -flax-vector-conversions=none -triple powerpc-unknown-unknown -fcxx-exceptions -verify %s
typedef int V4i __attribute__((vector_size(16)));
diff --git a/src/llvm-project/clang/test/SemaCXX/ambig-user-defined-conversions.cpp b/src/llvm-project/clang/test/SemaCXX/ambig-user-defined-conversions.cpp
index 276c1b0..8d8fa4f 100644
--- a/src/llvm-project/clang/test/SemaCXX/ambig-user-defined-conversions.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/ambig-user-defined-conversions.cpp
@@ -13,7 +13,7 @@
extern B f();
B b1;
- void func(const int ci, const char cc); // expected-note {{candidate function}}
+ void func(const int ci, const char cc);
void func(const char ci, const B b); // expected-note {{candidate function}}
void func(const B b, const int ci); // expected-note {{candidate function}}
diff --git a/src/llvm-project/clang/test/SemaCXX/atomic-type.cpp b/src/llvm-project/clang/test/SemaCXX/atomic-type.cpp
index a2b314a..1ed321e 100644
--- a/src/llvm-project/clang/test/SemaCXX/atomic-type.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/atomic-type.cpp
@@ -2,7 +2,7 @@
// RUN: %clang_cc1 -verify -pedantic %s -std=c++11
template<typename T> struct atomic {
- _Atomic(T) value;
+ _Atomic(T) value; // expected-warning {{'_Atomic' is a C11 extension}}
void f() _Atomic; // expected-error {{expected ';' at end of declaration list}}
};
@@ -17,16 +17,16 @@
// Test overloading behavior of atomics.
struct A { };
-int &ovl1(_Atomic(int));
-int &ovl1(_Atomic int); // ok, redeclaration
-long &ovl1(_Atomic(long));
-float &ovl1(_Atomic(float));
-double &ovl1(_Atomic(A const *const *));
-double &ovl1(A const *const *_Atomic);
-short &ovl1(_Atomic(A **));
+int &ovl1(_Atomic(int)); // expected-warning {{'_Atomic' is a C11 extension}}
+int &ovl1(_Atomic int); // expected-warning {{'_Atomic' is a C11 extension}} // ok, redeclaration
+long &ovl1(_Atomic(long)); // expected-warning {{'_Atomic' is a C11 extension}}
+float &ovl1(_Atomic(float)); // expected-warning {{'_Atomic' is a C11 extension}}
+double &ovl1(_Atomic(A const *const *)); // expected-warning {{'_Atomic' is a C11 extension}}
+double &ovl1(A const *const *_Atomic); // expected-warning {{'_Atomic' is a C11 extension}}
+short &ovl1(_Atomic(A **)); // expected-warning {{'_Atomic' is a C11 extension}}
-void test_overloading(int i, float f, _Atomic(int) ai, _Atomic(float) af,
- long l, _Atomic(long) al, A const *const *acc,
+void test_overloading(int i, float f, _Atomic(int) ai, _Atomic(float) af, // expected-warning 2 {{'_Atomic' is a C11 extension}}
+ long l, _Atomic(long) al, A const *const *acc, // expected-warning {{'_Atomic' is a C11 extension}}
A const ** ac, A **a) {
int& ir1 = ovl1(i);
int& ir2 = ovl1(ai);
@@ -39,23 +39,28 @@
short &sr1 = ovl1(a);
}
-typedef int (A::*fp)() _Atomic; // expected-error {{expected ';' after top level declarator}} expected-warning {{does not declare anything}}
+typedef int (A::*fp)() _Atomic; // expected-error {{expected ';' after top level declarator}} expected-warning {{does not declare anything}} \
+ // expected-warning {{'_Atomic' is a C11 extension}}
-typedef _Atomic(int(A::*)) atomic_mem_ptr_to_int;
-typedef int(A::*_Atomic atomic_mem_ptr_to_int);
+typedef _Atomic(int(A::*)) atomic_mem_ptr_to_int; // expected-warning {{'_Atomic' is a C11 extension}}
+typedef int(A::*_Atomic atomic_mem_ptr_to_int); // expected-warning {{'_Atomic' is a C11 extension}}
-typedef _Atomic(int)(A::*mem_ptr_to_atomic_int);
-typedef _Atomic int(A::*mem_ptr_to_atomic_int);
+typedef _Atomic(int)(A::*mem_ptr_to_atomic_int); // expected-warning {{'_Atomic' is a C11 extension}}
+typedef _Atomic int(A::*mem_ptr_to_atomic_int); // expected-warning {{'_Atomic' is a C11 extension}}
-typedef _Atomic(int)&atomic_int_ref;
-typedef _Atomic int &atomic_int_ref;
-typedef _Atomic atomic_int_ref atomic_int_ref; // expected-warning {{'_Atomic' qualifier on reference type 'atomic_int_ref' (aka '_Atomic(int) &') has no effect}}
+typedef _Atomic(int)&atomic_int_ref; // expected-warning {{'_Atomic' is a C11 extension}}
+typedef _Atomic int &atomic_int_ref; // expected-warning {{'_Atomic' is a C11 extension}}
+typedef _Atomic atomic_int_ref atomic_int_ref; // expected-warning {{'_Atomic' qualifier on reference type 'atomic_int_ref' (aka '_Atomic(int) &') has no effect}} \
+ // expected-warning {{'_Atomic' is a C11 extension}}
-typedef int &_Atomic atomic_reference_to_int; // expected-error {{'_Atomic' qualifier may not be applied to a reference}}
-typedef _Atomic(int &) atomic_reference_to_int; // expected-error {{_Atomic cannot be applied to reference type 'int &'}}
+typedef int &_Atomic atomic_reference_to_int; // expected-error {{'_Atomic' qualifier may not be applied to a reference}} \
+ // expected-warning {{'_Atomic' is a C11 extension}}
+typedef _Atomic(int &) atomic_reference_to_int; // expected-error {{_Atomic cannot be applied to reference type 'int &'}} \
+ // expected-warning {{'_Atomic' is a C11 extension}}
struct S {
- _Atomic union { int n; }; // expected-warning {{anonymous union cannot be '_Atomic'}}
+ _Atomic union { int n; }; // expected-warning {{anonymous union cannot be '_Atomic'}} \
+ // expected-warning {{'_Atomic' is a C11 extension}}
};
namespace copy_init {
@@ -63,21 +68,24 @@
X(int);
int n;
};
- _Atomic(X) y = X(0);
- _Atomic(X) z(X(0));
+ _Atomic(X) y = X(0); // expected-warning {{'_Atomic' is a C11 extension}}
+ _Atomic(X) z(X(0)); // expected-warning {{'_Atomic' is a C11 extension}}
void f() { y = X(0); }
- _Atomic(X) e1(0); // expected-error {{cannot initialize}}
+ _Atomic(X) e1(0); // expected-error {{cannot initialize}} \
+ // expected-warning {{'_Atomic' is a C11 extension}}
#if __cplusplus >= 201103L
- _Atomic(X) e2{0}; // expected-error {{illegal initializer}}
- _Atomic(X) a{X(0)};
+ _Atomic(X) e2{0}; // expected-error {{illegal initializer}} \
+ // expected-warning {{'_Atomic' is a C11 extension}}
+ _Atomic(X) a{X(0)}; // expected-warning {{'_Atomic' is a C11 extension}}
// FIXME: This does not seem like the right answer.
- _Atomic(int) e3{0}; // expected-error {{illegal initializer}}
+ _Atomic(int) e3{0}; // expected-error {{illegal initializer}} \
+ // expected-warning {{'_Atomic' is a C11 extension}}
#endif
struct Y {
- _Atomic(X) a;
- _Atomic(int) b;
+ _Atomic(X) a; // expected-warning {{'_Atomic' is a C11 extension}}
+ _Atomic(int) b; // expected-warning {{'_Atomic' is a C11 extension}}
};
Y y1 = { X(0), 4 };
Y y2 = { 0, 4 }; // expected-error {{cannot initialize}}
@@ -87,10 +95,11 @@
// same answer in all these cases:
Y y3 = { X(0), { 4 } }; // expected-error {{illegal initializer type}}
Y y4 = { { X(0) }, 4 };
- _Atomic(int) ai = { 4 }; // expected-error {{illegal initializer type}}
- _Atomic(X) ax = { X(0) };
+ _Atomic(int) ai = { 4 }; // expected-error {{illegal initializer type}} \
+ // expected-warning {{'_Atomic' is a C11 extension}}
+ _Atomic(X) ax = { X(0) }; // expected-warning {{'_Atomic' is a C11 extension}}
}
-bool PR21836(_Atomic(int) *x) {
+bool PR21836(_Atomic(int) *x) { // expected-warning {{'_Atomic' is a C11 extension}}
return *x;
}
diff --git a/src/llvm-project/clang/test/SemaCXX/attr-cfi-canonical-jump-table.cpp b/src/llvm-project/clang/test/SemaCXX/attr-cfi-canonical-jump-table.cpp
new file mode 100644
index 0000000..a53fbae
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaCXX/attr-cfi-canonical-jump-table.cpp
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-linux -fsyntax-only -verify %s
+
+__attribute__((cfi_canonical_jump_table)) void fdecl();
+
+__attribute__((cfi_canonical_jump_table)) void f() {}
+
+struct S {
+ __attribute__((cfi_canonical_jump_table)) void f() {}
+};
+
+__attribute__((cfi_canonical_jump_table)) int i; // expected-error {{'cfi_canonical_jump_table' attribute only applies to functions}}
diff --git a/src/llvm-project/clang/test/SemaCXX/attr-cxx0x.cpp b/src/llvm-project/clang/test/SemaCXX/attr-cxx0x.cpp
index 6ba89a6..b405e11 100644
--- a/src/llvm-project/clang/test/SemaCXX/attr-cxx0x.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/attr-cxx0x.cpp
@@ -46,7 +46,7 @@
static_assert(alignof(int(int)) >= 1, "alignof(function) not positive"); // expected-error{{invalid application of 'alignof' to a function type}}
-[[__carries_dependency__]] // expected-warning{{unknown attribute '__carries_dependency__' ignored}}
+[[__carries_dependency__]]
void func(void);
alignas(4) auto PR19252 = 0;
diff --git a/src/llvm-project/clang/test/SemaCXX/attr-gsl-owner-pointer-std.cpp b/src/llvm-project/clang/test/SemaCXX/attr-gsl-owner-pointer-std.cpp
new file mode 100644
index 0000000..352e1e4
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaCXX/attr-gsl-owner-pointer-std.cpp
@@ -0,0 +1,182 @@
+// RUN: %clang_cc1 -ast-dump %s | \
+// RUN: FileCheck --implicit-check-not OwnerAttr --implicit-check-not PointerAttr %s
+
+// Test attribute inference for types in the standard library.
+namespace std {
+// Attributes are inferred for a (complete) class.
+class any {
+ // CHECK: CXXRecordDecl {{.*}} any
+ // CHECK: OwnerAttr {{.*}}
+};
+
+// Attributes are inferred for instantiations of a complete template.
+template <typename T>
+class vector {
+public:
+ class iterator {};
+ // CHECK: ClassTemplateDecl {{.*}} vector
+ // CHECK: OwnerAttr {{.*}}
+ // CHECK: CXXRecordDecl {{.*}} iterator
+ // CHECK: PointerAttr {{.*}}
+ // CHECK: ClassTemplateSpecializationDecl {{.*}} vector
+ // CHECK: TemplateArgument type 'int'
+ // CHECK: OwnerAttr
+ // CHECK: CXXRecordDecl {{.*}} iterator
+ // CHECK: PointerAttr {{.*}}
+};
+static_assert(sizeof(vector<int>), ""); // Force instantiation.
+static_assert(sizeof(vector<int>::iterator), ""); // Force instantiation.
+
+// If std::container::iterator is a using declaration, attributes are inferred
+// for the underlying class.
+template <typename T>
+class __set_iterator {};
+// CHECK: ClassTemplateDecl {{.*}} __set_iterator
+// CHECK: PointerAttr
+// CHECK: ClassTemplateSpecializationDecl {{.*}} __set_iterator
+// CHECK: TemplateArgument type 'int'
+// CHECK: PointerAttr
+
+template <typename T>
+class set {
+ // CHECK: ClassTemplateDecl {{.*}} set
+ // CHECK: OwnerAttr {{.*}}
+ // CHECK: ClassTemplateSpecializationDecl {{.*}} set
+ // CHECK: OwnerAttr {{.*}}
+public:
+ using iterator = __set_iterator<T>;
+};
+static_assert(sizeof(set<int>::iterator), ""); // Force instantiation.
+
+// If std::container::iterator is a typedef, attributes are inferred for the
+// underlying class.
+template <typename T>
+class __map_iterator {};
+// CHECK: ClassTemplateDecl {{.*}} __map_iterator
+// CHECK: PointerAttr
+// CHECK: ClassTemplateSpecializationDecl {{.*}} __map_iterator
+// CHECK: TemplateArgument type 'int'
+// CHECK: PointerAttr
+
+template <typename T>
+class map {
+ // CHECK: ClassTemplateDecl {{.*}} map
+ // CHECK: OwnerAttr {{.*}}
+ // CHECK: ClassTemplateSpecializationDecl {{.*}} map
+ // CHECK: OwnerAttr {{.*}}
+public:
+ typedef __map_iterator<T> iterator;
+};
+static_assert(sizeof(map<int>::iterator), ""); // Force instantiation.
+
+// Inline namespaces are ignored when checking if
+// the class lives in the std namespace.
+inline namespace inlinens {
+template <typename T>
+class __unordered_map_iterator {};
+// CHECK: ClassTemplateDecl {{.*}} __unordered_map_iterator
+// CHECK: PointerAttr
+// CHECK: ClassTemplateSpecializationDecl {{.*}} __unordered_map_iterator
+// CHECK: TemplateArgument type 'int'
+// CHECK: PointerAttr
+
+template <typename T>
+class unordered_map {
+ // CHECK: ClassTemplateDecl {{.*}} unordered_map
+ // CHECK: OwnerAttr {{.*}}
+ // CHECK: ClassTemplateSpecializationDecl {{.*}} unordered_map
+ // CHECK: OwnerAttr {{.*}}
+public:
+ typedef __unordered_map_iterator<T> iterator;
+};
+static_assert(sizeof(unordered_map<int>::iterator), ""); // Force instantiation.
+} // namespace inlinens
+
+// The iterator typedef is a DependentNameType.
+template <typename T>
+class __unordered_multimap_iterator {};
+// CHECK: ClassTemplateDecl {{.*}} __unordered_multimap_iterator
+// CHECK: ClassTemplateSpecializationDecl {{.*}} __unordered_multimap_iterator
+// CHECK: TemplateArgument type 'int'
+// CHECK: PointerAttr
+
+template <typename T>
+class __unordered_multimap_base {
+public:
+ using iterator = __unordered_multimap_iterator<T>;
+};
+
+template <typename T>
+class unordered_multimap {
+ // CHECK: ClassTemplateDecl {{.*}} unordered_multimap
+ // CHECK: OwnerAttr {{.*}}
+ // CHECK: ClassTemplateSpecializationDecl {{.*}} unordered_multimap
+ // CHECK: OwnerAttr {{.*}}
+public:
+ using _Mybase = __unordered_multimap_base<T>;
+ using iterator = typename _Mybase::iterator;
+};
+static_assert(sizeof(unordered_multimap<int>::iterator), ""); // Force instantiation.
+
+// The canonical declaration of the iterator template is not its definition.
+template <typename T>
+class __unordered_multiset_iterator;
+// CHECK: ClassTemplateDecl {{.*}} __unordered_multiset_iterator
+// CHECK: PointerAttr
+// CHECK: ClassTemplateSpecializationDecl {{.*}} __unordered_multiset_iterator
+// CHECK: TemplateArgument type 'int'
+// CHECK: PointerAttr
+
+template <typename T>
+class __unordered_multiset_iterator {
+ // CHECK: ClassTemplateDecl {{.*}} prev {{.*}} __unordered_multiset_iterator
+ // CHECK: PointerAttr
+};
+
+template <typename T>
+class unordered_multiset {
+ // CHECK: ClassTemplateDecl {{.*}} unordered_multiset
+ // CHECK: OwnerAttr {{.*}}
+ // CHECK: ClassTemplateSpecializationDecl {{.*}} unordered_multiset
+ // CHECK: OwnerAttr {{.*}}
+public:
+ using iterator = __unordered_multiset_iterator<T>;
+};
+
+static_assert(sizeof(unordered_multiset<int>::iterator), ""); // Force instantiation.
+
+// std::list has an implicit gsl::Owner attribute,
+// but explicit attributes take precedence.
+template <typename T>
+class [[gsl::Pointer]] list{};
+// CHECK: ClassTemplateDecl {{.*}} list
+// CHECK: PointerAttr {{.*}}
+// CHECK: ClassTemplateSpecializationDecl {{.*}} list
+// CHECK: PointerAttr {{.*}}
+
+static_assert(sizeof(list<int>), ""); // Force instantiation.
+
+// Forward declared template (Owner).
+template <
+ class CharT,
+ class Traits>
+class basic_regex;
+// CHECK: ClassTemplateDecl {{.*}} basic_regex
+// CHECK: OwnerAttr {{.*}}
+
+// Forward declared template (Pointer).
+template <class T>
+class reference_wrapper;
+// CHECK: ClassTemplateDecl {{.*}} reference_wrapper
+// CHECK: PointerAttr {{.*}}
+
+class some_unknown_type;
+// CHECK: CXXRecordDecl {{.*}} some_unknown_type
+
+} // namespace std
+
+namespace user {
+// If a class is not in the std namespace, we don't infer the attributes.
+class any {
+};
+} // namespace user
diff --git a/src/llvm-project/clang/test/SemaCXX/attr-gsl-owner-pointer.cpp b/src/llvm-project/clang/test/SemaCXX/attr-gsl-owner-pointer.cpp
new file mode 100644
index 0000000..6c1bfe4
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaCXX/attr-gsl-owner-pointer.cpp
@@ -0,0 +1,126 @@
+// RUN: %clang_cc1 -verify -ast-dump %s | \
+// RUN: FileCheck --implicit-check-not OwnerAttr --implicit-check-not PointerAttr %s
+
+int [[gsl::Owner]] i;
+// expected-error@-1 {{'Owner' attribute cannot be applied to types}}
+void [[gsl::Owner]] f();
+// expected-error@-1 {{'Owner' attribute cannot be applied to types}}
+
+[[gsl::Owner]] void f();
+// expected-warning@-1 {{'Owner' attribute only applies to structs}}
+
+union [[gsl::Owner(int)]] Union{};
+// expected-warning@-1 {{'Owner' attribute only applies to structs}}
+
+struct S {
+};
+
+S [[gsl::Owner]] Instance;
+// expected-error@-1 {{'Owner' attribute cannot be applied to types}}
+
+class [[gsl::Owner(7)]] OwnerDerefNoType{};
+// expected-error@-1 {{expected a type}}
+
+class [[gsl::Pointer("int")]] PointerDerefNoType{};
+// expected-error@-1 {{expected a type}}
+
+class [[gsl::Owner(int)]] [[gsl::Pointer(int)]] BothOwnerPointer{};
+// expected-error@-1 {{'Pointer' and 'Owner' attributes are not compatible}}
+// expected-note@-2 {{conflicting attribute is here}}
+// CHECK: CXXRecordDecl {{.*}} BothOwnerPointer
+// CHECK: OwnerAttr {{.*}} int
+
+class [[gsl::Owner(void)]] OwnerVoidDerefType{};
+// CHECK: CXXRecordDecl {{.*}} OwnerVoidDerefType
+// CHECK: OwnerAttr {{.*}} void
+class [[gsl::Pointer(void)]] PointerVoidDerefType{};
+// CHECK: CXXRecordDecl {{.*}} PointerVoidDerefType
+// CHECK: PointerAttr {{.*}} void
+
+class [[gsl::Pointer(int)]] AddConflictLater{};
+// CHECK: CXXRecordDecl {{.*}} AddConflictLater
+// CHECK: PointerAttr {{.*}} int
+class [[gsl::Owner(int)]] AddConflictLater;
+// expected-error@-1 {{'Owner' and 'Pointer' attributes are not compatible}}
+// expected-note@-5 {{conflicting attribute is here}}
+// CHECK: CXXRecordDecl {{.*}} AddConflictLater
+// CHECK: PointerAttr {{.*}} Inherited int
+
+class [[gsl::Owner(int)]] AddConflictLater2{};
+// CHECK: CXXRecordDecl {{.*}} AddConflictLater2
+// CHECK: OwnerAttr {{.*}} int
+class [[gsl::Owner(float)]] AddConflictLater2;
+// expected-error@-1 {{'Owner' and 'Owner' attributes are not compatible}}
+// expected-note@-5 {{conflicting attribute is here}}
+// CHECK: CXXRecordDecl {{.*}} AddConflictLater
+// CHECK: OwnerAttr {{.*}} Inherited int
+
+class [[gsl::Owner()]] [[gsl::Owner(int)]] WithAndWithoutParameter{};
+// expected-error@-1 {{'Owner' and 'Owner' attributes are not compatible}}
+// expected-note@-2 {{conflicting attribute is here}}
+// CHECK: CXXRecordDecl {{.*}} WithAndWithoutParameter
+// CHECK: OwnerAttr
+
+class [[gsl::Owner(int &)]] ReferenceType{};
+// expected-error@-1 {{a reference type is an invalid argument to attribute 'Owner'}}
+
+class [[gsl::Pointer(int[])]] ArrayType{};
+// expected-error@-1 {{an array type is an invalid argument to attribute 'Pointer'}}
+
+class [[gsl::Owner]] OwnerMissingParameter{};
+// CHECK: CXXRecordDecl {{.*}} OwnerMissingParameter
+// CHECK: OwnerAttr
+
+class [[gsl::Pointer]] PointerMissingParameter{};
+// CHECK: CXXRecordDecl {{.*}} PointerMissingParameter
+// CHECK: PointerAttr
+
+class [[gsl::Owner()]] OwnerWithEmptyParameterList{};
+// CHECK: CXXRecordDecl {{.*}} OwnerWithEmptyParameterList
+// CHECK: OwnerAttr {{.*}}
+
+class [[gsl::Pointer()]] PointerWithEmptyParameterList{};
+// CHECK: CXXRecordDecl {{.*}} PointerWithEmptyParameterList
+// CHECK: PointerAttr {{.*}}
+
+struct [[gsl::Owner(int)]] AnOwner{};
+// CHECK: CXXRecordDecl {{.*}} AnOwner
+// CHECK: OwnerAttr {{.*}} int
+
+struct S;
+class [[gsl::Pointer(S)]] APointer{};
+// CHECK: CXXRecordDecl {{.*}} APointer
+// CHECK: PointerAttr {{.*}} S
+
+class [[gsl::Owner(int)]] [[gsl::Owner(int)]] DuplicateOwner{};
+// CHECK: CXXRecordDecl {{.*}} DuplicateOwner
+// CHECK: OwnerAttr {{.*}} int
+
+class [[gsl::Pointer(int)]] [[gsl::Pointer(int)]] DuplicatePointer{};
+// CHECK: CXXRecordDecl {{.*}} DuplicatePointer
+// CHECK: PointerAttr {{.*}} int
+
+class [[gsl::Owner(int)]] AddTheSameLater{};
+// CHECK: CXXRecordDecl {{.*}} AddTheSameLater
+// CHECK: OwnerAttr {{.*}} int
+
+class [[gsl::Owner(int)]] AddTheSameLater;
+// CHECK: CXXRecordDecl {{.*}} prev {{.*}} AddTheSameLater
+// CHECK: OwnerAttr {{.*}} int
+
+template <class T>
+class [[gsl::Owner]] ForwardDeclared;
+// CHECK: ClassTemplateDecl {{.*}} ForwardDeclared
+// CHECK: OwnerAttr {{.*}}
+// CHECK: ClassTemplateSpecializationDecl {{.*}} ForwardDeclared
+// CHECK: TemplateArgument type 'int'
+// CHECK: OwnerAttr {{.*}}
+
+template <class T>
+class [[gsl::Owner]] ForwardDeclared {
+// CHECK: ClassTemplateDecl {{.*}} ForwardDeclared
+// CHECK: CXXRecordDecl {{.*}} ForwardDeclared definition
+// CHECK: OwnerAttr {{.*}}
+};
+
+static_assert(sizeof(ForwardDeclared<int>), ""); // Force instantiation.
diff --git a/src/llvm-project/clang/test/SemaCXX/attr-nonnull.cpp b/src/llvm-project/clang/test/SemaCXX/attr-nonnull.cpp
index 764e8d8..21eedcf 100644
--- a/src/llvm-project/clang/test/SemaCXX/attr-nonnull.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/attr-nonnull.cpp
@@ -77,10 +77,11 @@
constexpr int i32 = f3(0, &c);
__attribute__((nonnull(4))) __attribute__((nonnull)) //expected-error {{out of bounds}}
-constexpr int f4(const int*, const int*) {
+constexpr int f4(const int*, const int*, int) {
return 0;
}
-constexpr int i4 = f4(&c, 0); //expected-error {{constant expression}} expected-note {{null passed}}
-constexpr int i42 = f4(0, &c); //expected-error {{constant expression}} expected-note {{null passed}}
+constexpr int i4 = f4(&c, 0, 0); //expected-error {{constant expression}} expected-note {{null passed}}
+constexpr int i42 = f4(0, &c, 1); //expected-error {{constant expression}} expected-note {{null passed}}
+constexpr int i43 = f4(&c, &c, 0);
}
\ No newline at end of file
diff --git a/src/llvm-project/clang/test/SemaCXX/attr-noreturn.cpp b/src/llvm-project/clang/test/SemaCXX/attr-noreturn.cpp
index 5e7875f..72487bb 100644
--- a/src/llvm-project/clang/test/SemaCXX/attr-noreturn.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/attr-noreturn.cpp
@@ -10,7 +10,7 @@
int &test1() {
a.nofail();
- } // expected-warning {{control reaches end of non-void function}}
+ } // expected-warning {{non-void function does not return a value}}
int &test2() {
a.fail();
diff --git a/src/llvm-project/clang/test/SemaCXX/attr-require-constant-initialization.cpp b/src/llvm-project/clang/test/SemaCXX/attr-require-constant-initialization.cpp
index 2dd72ea..5584b4b 100644
--- a/src/llvm-project/clang/test/SemaCXX/attr-require-constant-initialization.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/attr-require-constant-initialization.cpp
@@ -185,7 +185,7 @@
ATTR static constexpr LitType lit = {};
ATTR static const NonLit non_lit;
ATTR static const NonLit non_lit_list_init;
- ATTR static const NonLit non_lit_copy_init; // expected-note {{required by 'require_constant_initialization' attribute here}}
+ ATTR static const NonLit non_lit_copy_init;
#endif
};
PODType TT2::pod_noinit; // expected-note 0+ {{declared here}}
@@ -203,8 +203,9 @@
#if __cplusplus >= 201402L
const NonLit TT2::non_lit(42);
const NonLit TT2::non_lit_list_init = {42};
-const NonLit TT2::non_lit_copy_init = 42; // expected-error {{variable does not have a constant initializer}}
-// expected-note@-1 {{subexpression not valid in a constant expression}}
+// FIXME: This is invalid, but we incorrectly elide the copy. It's OK if we
+// start diagnosing this.
+const NonLit TT2::non_lit_copy_init = 42;
#endif
#if __cplusplus >= 201103L
@@ -300,6 +301,17 @@
ATTR const char *foo[] = {"abc", "def"};
ATTR PODType bar[] = {{}, {123, 456}};
+
+namespace AttrAddedTooLate {
+ struct A {
+ static const int n = 0; // expected-note {{here}}
+ };
+ ATTR const int A::n; // expected-warning {{added after initialization}}
+
+ int m = 0; // expected-note {{here}}
+ extern ATTR int m; // expected-warning {{added after initialization}}
+}
+
#elif defined(TEST_TWO) // Test for duplicate warnings
struct NotC {
constexpr NotC(void *) {}
diff --git a/src/llvm-project/clang/test/SemaCXX/builtin-align-cxx.cpp b/src/llvm-project/clang/test/SemaCXX/builtin-align-cxx.cpp
new file mode 100644
index 0000000..190f352
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaCXX/builtin-align-cxx.cpp
@@ -0,0 +1,236 @@
+// C++-specific checks for the alignment builtins
+// RUN: %clang_cc1 -triple=x86_64-unknown-unknown -std=c++11 -o - %s -fsyntax-only -verify
+
+// Check that we don't crash when using dependent types in __builtin_align:
+template <typename a, a b>
+void *c(void *d) { // expected-note{{candidate template ignored}}
+ return __builtin_align_down(d, b);
+}
+
+struct x {};
+x foo;
+void test(void *value) {
+ c<int, 16>(value);
+ c<struct x, foo>(value); // expected-error{{no matching function for call to 'c'}}
+}
+
+template <typename T, long Alignment, long ArraySize = 16>
+void test_templated_arguments() {
+ T array[ArraySize]; // expected-error{{variable has incomplete type 'fwddecl'}}
+ static_assert(__is_same(decltype(__builtin_align_up(array, Alignment)), T *), // expected-error{{requested alignment is not a power of 2}}
+ "return type should be the decayed array type");
+ static_assert(__is_same(decltype(__builtin_align_down(array, Alignment)), T *),
+ "return type should be the decayed array type");
+ static_assert(__is_same(decltype(__builtin_is_aligned(array, Alignment)), bool),
+ "return type should be bool");
+ T *x1 = __builtin_align_up(array, Alignment);
+ T *x2 = __builtin_align_down(array, Alignment);
+ bool x3 = __builtin_align_up(array, Alignment);
+}
+
+void test() {
+ test_templated_arguments<int, 32>(); // fine
+ test_templated_arguments<struct fwddecl, 16>();
+ // expected-note@-1{{in instantiation of function template specialization 'test_templated_arguments<fwddecl, 16, 16>'}}
+ // expected-note@-2{{forward declaration of 'fwddecl'}}
+ test_templated_arguments<int, 7>(); // invalid alignment value
+ // expected-note@-1{{in instantiation of function template specialization 'test_templated_arguments<int, 7, 16>'}}
+}
+
+template <typename T>
+void test_incorrect_alignment_without_instatiation(T value) {
+ int array[32];
+ static_assert(__is_same(decltype(__builtin_align_up(array, 31)), int *), // expected-error{{requested alignment is not a power of 2}}
+ "return type should be the decayed array type");
+ static_assert(__is_same(decltype(__builtin_align_down(array, 7)), int *), // expected-error{{requested alignment is not a power of 2}}
+ "return type should be the decayed array type");
+ static_assert(__is_same(decltype(__builtin_is_aligned(array, -1)), bool), // expected-error{{requested alignment must be 1 or greater}}
+ "return type should be bool");
+ __builtin_align_up(array); // expected-error{{too few arguments to function call, expected 2, have 1}}
+ __builtin_align_up(array, 31); // expected-error{{requested alignment is not a power of 2}}
+ __builtin_align_down(array, 31); // expected-error{{requested alignment is not a power of 2}}
+ __builtin_align_up(array, 31); // expected-error{{requested alignment is not a power of 2}}
+ __builtin_align_up(value, 31); // This shouldn't want since the type is dependent
+ __builtin_align_up(value); // Same here
+}
+
+// The original fix for the issue above broke some legitimate code.
+// Here is a regression test:
+typedef __SIZE_TYPE__ size_t;
+void *allocate_impl(size_t size);
+template <typename T>
+T *allocate() {
+ constexpr size_t allocation_size =
+ __builtin_align_up(sizeof(T), sizeof(void *));
+ return static_cast<T *>(
+ __builtin_assume_aligned(allocate_impl(allocation_size), sizeof(void *)));
+}
+struct Foo {
+ int value;
+};
+void *test2() {
+ return allocate<struct Foo>();
+}
+
+// Check that pointers-to-members cannot be used:
+class MemPtr {
+public:
+ int data;
+ void func();
+ virtual void vfunc();
+};
+void test_member_ptr() {
+ __builtin_align_up(&MemPtr::data, 64); // expected-error{{operand of type 'int MemPtr::*' where arithmetic or pointer type is required}}
+ __builtin_align_down(&MemPtr::func, 64); // expected-error{{operand of type 'void (MemPtr::*)()' where arithmetic or pointer type is required}}
+ __builtin_is_aligned(&MemPtr::vfunc, 64); // expected-error{{operand of type 'void (MemPtr::*)()' where arithmetic or pointer type is required}}
+}
+
+void test_references(Foo &i) {
+ // Check that the builtins look at the referenced type rather than the reference itself.
+ (void)__builtin_align_up(i, 64); // expected-error{{operand of type 'Foo' where arithmetic or pointer type is required}}
+ (void)__builtin_align_up(static_cast<Foo &>(i), 64); // expected-error{{operand of type 'Foo' where arithmetic or pointer type is required}}
+ (void)__builtin_align_up(static_cast<const Foo &>(i), 64); // expected-error{{operand of type 'const Foo' where arithmetic or pointer type is required}}
+ (void)__builtin_align_up(static_cast<Foo &&>(i), 64); // expected-error{{operand of type 'Foo' where arithmetic or pointer type is required}}
+ (void)__builtin_align_up(static_cast<const Foo &&>(i), 64); // expected-error{{operand of type 'const Foo' where arithmetic or pointer type is required}}
+ (void)__builtin_align_up(&i, 64);
+}
+
+// Check that constexpr wrapper functions can be constant-evaluated.
+template <typename T>
+constexpr bool wrap_is_aligned(T ptr, long align) {
+ return __builtin_is_aligned(ptr, align);
+ // expected-note@-1{{requested alignment -3 is not a positive power of two}}
+ // expected-note@-2{{requested alignment 19 is not a positive power of two}}
+ // expected-note@-3{{requested alignment must be 128 or less for type 'char'; 4194304 is invalid}}
+}
+template <typename T>
+constexpr T wrap_align_up(T ptr, long align) {
+ return __builtin_align_up(ptr, align);
+ // expected-note@-1{{requested alignment -2 is not a positive power of two}}
+ // expected-note@-2{{requested alignment 18 is not a positive power of two}}
+ // expected-note@-3{{requested alignment must be 2147483648 or less for type 'int'; 8589934592 is invalid}}
+ // expected-error@-4{{operand of type 'bool' where arithmetic or pointer type is required}}
+}
+
+template <typename T>
+constexpr T wrap_align_down(T ptr, long align) {
+ return __builtin_align_down(ptr, align);
+ // expected-note@-1{{requested alignment -1 is not a positive power of two}}
+ // expected-note@-2{{requested alignment 17 is not a positive power of two}}
+ // expected-note@-3{{requested alignment must be 32768 or less for type 'short'; 1048576 is invalid}}
+}
+
+constexpr int a1 = wrap_align_up(22, 32);
+static_assert(a1 == 32, "");
+constexpr int a2 = wrap_align_down(22, 16);
+static_assert(a2 == 16, "");
+constexpr bool a3 = wrap_is_aligned(22, 32);
+static_assert(!a3, "");
+static_assert(wrap_align_down(wrap_align_up(22, 16), 32) == 32, "");
+static_assert(wrap_is_aligned(wrap_align_down(wrap_align_up(22, 16), 32), 32), "");
+static_assert(!wrap_is_aligned(wrap_align_down(wrap_align_up(22, 16), 32), 64), "");
+
+constexpr long const_value(long l) { return l; }
+// Check some invalid values during constant-evaluation
+static_assert(wrap_align_down(1, const_value(-1)), ""); // expected-error{{not an integral constant expression}}
+// expected-note@-1{{in call to 'wrap_align_down(1, -1)'}}
+static_assert(wrap_align_up(1, const_value(-2)), ""); // expected-error{{not an integral constant expression}}
+// expected-note@-1{{in call to 'wrap_align_up(1, -2)'}}
+static_assert(wrap_is_aligned(1, const_value(-3)), ""); // expected-error{{not an integral constant expression}}
+// expected-note@-1{{in call to 'wrap_is_aligned(1, -3)'}}
+static_assert(wrap_align_down(1, const_value(17)), ""); // expected-error{{not an integral constant expression}}
+// expected-note@-1{{in call to 'wrap_align_down(1, 17)'}}
+static_assert(wrap_align_up(1, const_value(18)), ""); // expected-error{{not an integral constant expression}}
+// expected-note@-1{{in call to 'wrap_align_up(1, 18)'}}
+static_assert(wrap_is_aligned(1, const_value(19)), ""); // expected-error{{not an integral constant expression}}
+// expected-note@-1{{in call to 'wrap_is_aligned(1, 19)'}}
+
+// Check invalid values for smaller types:
+static_assert(wrap_align_down(static_cast<short>(1), const_value(1 << 20)), ""); // expected-error{{not an integral constant expression}}
+// expected-note@-1{{in call to 'wrap_align_down(1, 1048576)'}}
+// Check invalid boolean type
+static_assert(wrap_align_up(static_cast<int>(1), const_value(1ull << 33)), ""); // expected-error{{not an integral constant expression}}
+// expected-note@-1{{in call to 'wrap_align_up(1, 8589934592)'}}
+static_assert(wrap_is_aligned(static_cast<char>(1), const_value(1 << 22)), ""); // expected-error{{not an integral constant expression}}
+// expected-note@-1{{in call to 'wrap_is_aligned(1, 4194304)'}}
+
+// Check invalid boolean type
+static_assert(wrap_align_up(static_cast<bool>(1), const_value(1 << 21)), ""); // expected-error{{not an integral constant expression}}
+// expected-note@-1{{in instantiation of function template specialization 'wrap_align_up<bool>' requested here}}
+
+// Check constant evaluation for pointers:
+_Alignas(32) char align32array[128];
+static_assert(&align32array[0] == &align32array[0], "");
+// __builtin_align_up/down can be constant evaluated as a no-op for values
+// that are known to have greater alignment:
+static_assert(__builtin_align_up(&align32array[0], 32) == &align32array[0], "");
+static_assert(__builtin_align_up(&align32array[0], 4) == &align32array[0], "");
+static_assert(__builtin_align_down(&align32array[0], 4) == __builtin_align_up(&align32array[0], 8), "");
+// But it can not be evaluated if the alignment is greater than the minimum
+// known alignment, since in that case the value might be the same if it happens
+// to actually be aligned to 64 bytes at run time.
+static_assert(&align32array[0] == __builtin_align_up(&align32array[0], 64), ""); // expected-error{{not an integral constant expression}}
+// expected-note@-1{{cannot constant evaluate the result of adjusting alignment to 64}}
+static_assert(__builtin_align_up(&align32array[0], 64) == __builtin_align_up(&align32array[0], 64), ""); // expected-error{{not an integral constant expression}}
+// expected-note@-1{{cannot constant evaluate the result of adjusting alignment to 64}}
+
+// However, we can compute in case the requested alignment is less than the
+// base alignment:
+static_assert(__builtin_align_up(&align32array[0], 4) == &align32array[0], "");
+static_assert(__builtin_align_up(&align32array[1], 4) == &align32array[4], "");
+static_assert(__builtin_align_up(&align32array[2], 4) == &align32array[4], "");
+static_assert(__builtin_align_up(&align32array[3], 4) == &align32array[4], "");
+static_assert(__builtin_align_up(&align32array[4], 4) == &align32array[4], "");
+static_assert(__builtin_align_up(&align32array[5], 4) == &align32array[8], "");
+static_assert(__builtin_align_up(&align32array[6], 4) == &align32array[8], "");
+static_assert(__builtin_align_up(&align32array[7], 4) == &align32array[8], "");
+static_assert(__builtin_align_up(&align32array[8], 4) == &align32array[8], "");
+
+static_assert(__builtin_align_down(&align32array[0], 4) == &align32array[0], "");
+static_assert(__builtin_align_down(&align32array[1], 4) == &align32array[0], "");
+static_assert(__builtin_align_down(&align32array[2], 4) == &align32array[0], "");
+static_assert(__builtin_align_down(&align32array[3], 4) == &align32array[0], "");
+static_assert(__builtin_align_down(&align32array[4], 4) == &align32array[4], "");
+static_assert(__builtin_align_down(&align32array[5], 4) == &align32array[4], "");
+static_assert(__builtin_align_down(&align32array[6], 4) == &align32array[4], "");
+static_assert(__builtin_align_down(&align32array[7], 4) == &align32array[4], "");
+static_assert(__builtin_align_down(&align32array[8], 4) == &align32array[8], "");
+
+// Achiving the same thing using casts to uintptr_t is not allowed:
+static_assert((char *)((__UINTPTR_TYPE__)&align32array[7] & ~3) == &align32array[4], ""); // expected-error{{not an integral constant expression}}
+
+static_assert(__builtin_align_down(&align32array[1], 4) == &align32array[0], "");
+static_assert(__builtin_align_down(&align32array[1], 64) == &align32array[0], ""); // expected-error{{not an integral constant expression}}
+// expected-note@-1{{cannot constant evaluate the result of adjusting alignment to 64}}
+
+// Add some checks for __builtin_is_aligned:
+static_assert(__builtin_is_aligned(&align32array[0], 32), "");
+static_assert(__builtin_is_aligned(&align32array[4], 4), "");
+// We cannot constant evaluate whether the array is aligned to > 32 since this
+// may well be true at run time.
+static_assert(!__builtin_is_aligned(&align32array[0], 64), ""); // expected-error{{not an integral constant expression}}
+// expected-note@-1{{cannot constant evaluate whether run-time alignment is at least 64}}
+
+// However, if the alignment being checked is less than the minimum alignment of
+// the base object we can check the low bits of the alignment:
+static_assert(__builtin_is_aligned(&align32array[0], 4), "");
+static_assert(!__builtin_is_aligned(&align32array[1], 4), "");
+static_assert(!__builtin_is_aligned(&align32array[2], 4), "");
+static_assert(!__builtin_is_aligned(&align32array[3], 4), "");
+static_assert(__builtin_is_aligned(&align32array[4], 4), "");
+
+// TODO: this should evaluate to true even though we can't evaluate the result
+// of __builtin_align_up() to a concrete value
+static_assert(__builtin_is_aligned(__builtin_align_up(&align32array[0], 64), 64), ""); // expected-error{{not an integral constant expression}}
+// expected-note@-1{{cannot constant evaluate the result of adjusting alignment to 64}}
+
+// Check different source and alignment type widths are handled correctly.
+static_assert(!__builtin_is_aligned(static_cast<signed long>(7), static_cast<signed short>(4)), "");
+static_assert(!__builtin_is_aligned(static_cast<signed short>(7), static_cast<signed long>(4)), "");
+// Also check signed -- unsigned mismatch.
+static_assert(!__builtin_is_aligned(static_cast<signed long>(7), static_cast<signed long>(4)), "");
+static_assert(!__builtin_is_aligned(static_cast<unsigned long>(7), static_cast<unsigned long>(4)), "");
+static_assert(!__builtin_is_aligned(static_cast<signed long>(7), static_cast<unsigned long>(4)), "");
+static_assert(!__builtin_is_aligned(static_cast<unsigned long>(7), static_cast<signed long>(4)), "");
+static_assert(!__builtin_is_aligned(static_cast<signed long>(7), static_cast<unsigned short>(4)), "");
+static_assert(!__builtin_is_aligned(static_cast<unsigned short>(7), static_cast<signed long>(4)), "");
diff --git a/src/llvm-project/clang/test/SemaCXX/builtin-bit-cast.cpp b/src/llvm-project/clang/test/SemaCXX/builtin-bit-cast.cpp
index 3dddadc..87919d9 100644
--- a/src/llvm-project/clang/test/SemaCXX/builtin-bit-cast.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/builtin-bit-cast.cpp
@@ -37,3 +37,12 @@
// expected-error@+1 {{__builtin_bit_cast destination type must be trivially copyable}}
constexpr long us = __builtin_bit_cast(unsigned long &, 0L);
+
+namespace PR42936 {
+template <class T> struct S { int m; };
+
+extern S<int> extern_decl;
+
+int x = __builtin_bit_cast(int, extern_decl);
+S<char> y = __builtin_bit_cast(S<char>, 0);
+}
diff --git a/src/llvm-project/clang/test/SemaCXX/builtin-is-constant-evaluated.cpp b/src/llvm-project/clang/test/SemaCXX/builtin-is-constant-evaluated.cpp
index b2ec5cb..4af2b49 100644
--- a/src/llvm-project/clang/test/SemaCXX/builtin-is-constant-evaluated.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/builtin-is-constant-evaluated.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++2a -verify %s -fcxx-exceptions -triple=x86_64-linux-gnu
+// RUN: %clang_cc1 -std=c++2a -verify %s -fcxx-exceptions -Wno-constant-evaluated -triple=x86_64-linux-gnu
using size_t = decltype(sizeof(int));
diff --git a/src/llvm-project/clang/test/SemaCXX/builtin-object-size-cxx14.cpp b/src/llvm-project/clang/test/SemaCXX/builtin-object-size-cxx14.cpp
index e0b0588..b7c6f6b 100644
--- a/src/llvm-project/clang/test/SemaCXX/builtin-object-size-cxx14.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/builtin-object-size-cxx14.cpp
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -std=c++14 %s
+// RUN: %clang_cc1 -fsyntax-only -verify=expected,cxx14 -std=c++14 %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++2a %s
typedef __SIZE_TYPE__ size_t;
@@ -105,4 +106,16 @@
struct S { const char *name; };
S invalid_base();
constexpr size_t bos_name = __builtin_object_size(invalid_base().name, 1);
+ static_assert(bos_name == -1, "");
+
+ struct T { ~T(); };
+ T invalid_base_2();
+ constexpr size_t bos_dtor = __builtin_object_size(&(T&)(T&&)invalid_base_2(), 0);
+ static_assert(bos_dtor == -1, "");
+}
+
+// PR44268
+constexpr int bos_new() { // cxx14-error {{constant expression}}
+ void *p = new int; // cxx14-note {{until C++20}}
+ return __builtin_object_size(p, 0);
}
diff --git a/src/llvm-project/clang/test/SemaCXX/builtin-ptrtomember-ambig.cpp b/src/llvm-project/clang/test/SemaCXX/builtin-ptrtomember-ambig.cpp
index 61e3478..4330c0c 100644
--- a/src/llvm-project/clang/test/SemaCXX/builtin-ptrtomember-ambig.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/builtin-ptrtomember-ambig.cpp
@@ -17,11 +17,8 @@
void foo(C c, int A::* pmf) {
- // FIXME. Why so many built-in candidates?
int i = c->*pmf; // expected-error {{use of overloaded operator '->*' is ambiguous}} \
- // expected-note {{built-in candidate operator->*(const struct A *, const int struct A::*)}} \
// expected-note {{built-in candidate operator->*(const struct A *, int struct A::*)}} \
- // expected-note {{built-in candidate operator->*(struct A *, const int struct A::*)}} \
// expected-note {{built-in candidate operator->*(struct A *, int struct A::*)}}
}
diff --git a/src/llvm-project/clang/test/SemaCXX/builtin-ptrtomember-overload-1.cpp b/src/llvm-project/clang/test/SemaCXX/builtin-ptrtomember-overload-1.cpp
index 2d93c6b..a717c28 100644
--- a/src/llvm-project/clang/test/SemaCXX/builtin-ptrtomember-overload-1.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/builtin-ptrtomember-overload-1.cpp
@@ -42,5 +42,5 @@
void foo1(C1 c1, int E::* pmf) {
int i = c1->*pmf; // expected-error {{use of overloaded operator '->*' is ambiguous}} \
// expected-note {{because of ambiguity in conversion of 'C1' to 'E *'}} \
- // expected-note 4 {{built-in candidate operator}}
+ // expected-note 2 {{built-in candidate operator}}
}
diff --git a/src/llvm-project/clang/test/SemaCXX/c99.cpp b/src/llvm-project/clang/test/SemaCXX/c99.cpp
index 7afcdd5..9fbc45b 100644
--- a/src/llvm-project/clang/test/SemaCXX/c99.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/c99.cpp
@@ -1,9 +1,70 @@
-// RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s
+// RUN: %clang_cc1 -fsyntax-only -pedantic -verify=expected,cxx17 -std=c++17 %s
+// RUN: %clang_cc1 -fsyntax-only -pedantic -verify=expected,cxx20 -std=c++2a %s
+
+// cxx17-warning@* 0+{{designated initializers are a C++20 extension}}
+
void f1(int i[static 5]) { // expected-error{{C99}}
}
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}} \
- // expected-warning{{use of GNU old-style field designator extension}}
+Point p1 = { .x = 17,
+ y: 25 }; // expected-warning{{use of GNU old-style field designator extension}}
+
+Point p2 = {
+ .x = 17, // expected-warning {{mixture of designated and non-designated initializers in the same initializer list is a C99 extension}}
+ 25 // expected-note {{first non-designated initializer}}
+};
+
+Point p3 = {
+ .x = 17, // expected-note {{previous initialization is here}}
+ .x = 18, // expected-warning {{initializer overrides prior initialization of this subobject}}
+};
+
+Point p4 = {
+ .x = 17, // expected-warning {{mixture of designated and non-designated initializers in the same initializer list is a C99 extension}}
+ 25, // expected-note {{first non-designated initializer}}
+ // expected-note@-1 {{previous initialization is here}}
+ .y = 18, // expected-warning {{initializer overrides prior initialization of this subobject}}
+};
+
+int arr[1] = {[0] = 0}; // expected-warning {{array designators are a C99 extension}}
+
+struct Pt { int x, y; };
+struct Rect { Pt tl, br; };
+Rect r = {
+ .tl.x = 0 // expected-warning {{nested designators are a C99 extension}}
+};
+
+struct NonTrivial {
+ NonTrivial();
+ ~NonTrivial();
+};
+struct S {
+ int a;
+ NonTrivial b;
+};
+struct T {
+ S s;
+};
+S f();
+
+T t1 = {
+ .s = f()
+};
+
+// It's important that we reject this; we would not destroy the existing
+// 'NonTrivial' object before overwriting it (and even calling its destructor
+// would not necessarily be correct).
+T t2 = {
+ .s = f(), // expected-note {{previous}}
+ .s.b = NonTrivial() // expected-error {{initializer would partially override prior initialization of object of type 'S' with non-trivial destruction}}
+ // expected-warning@-1 {{nested}}
+};
+
+// FIXME: It might be reasonable to accept this.
+T t3 = {
+ .s = f(), // expected-note {{previous}}
+ .s.a = 0 // expected-error {{initializer would partially override prior initialization of object of type 'S' with non-trivial destruction}}
+ // expected-warning@-1 {{nested}}
+};
diff --git a/src/llvm-project/clang/test/SemaCXX/compare-cxx2a.cpp b/src/llvm-project/clang/test/SemaCXX/compare-cxx2a.cpp
index 8959758..46e38f7 100644
--- a/src/llvm-project/clang/test/SemaCXX/compare-cxx2a.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/compare-cxx2a.cpp
@@ -3,17 +3,26 @@
// RUN: %clang_cc1 -triple x86_64-apple-darwin -fcxx-exceptions -fsyntax-only -pedantic -verify -Wsign-compare -std=c++2a %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -fcxx-exceptions -std=c++2a -x c++ %S/Inputs/std-compare.h -emit-pch -o %t.pch
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -fcxx-exceptions -fsyntax-only -pedantic -verify -Wsign-compare -std=c++2a %s -include-pch %t.pch
+
#include "Inputs/std-compare.h"
#define ASSERT_TYPE(...) static_assert(__is_same(__VA_ARGS__))
#define ASSERT_EXPR_TYPE(Expr, Expect) static_assert(__is_same(decltype(Expr), Expect));
+struct S {
+ static int x[5];
+};
+
void self_compare() {
int a;
int *b = nullptr;
+ S s;
(void)(a <=> a); // expected-warning {{self-comparison always evaluates to 'std::strong_ordering::equal'}}
(void)(b <=> b); // expected-warning {{self-comparison always evaluates to 'std::strong_ordering::equal'}}
+ (void)(s.x[a] <=> S::x[a]); // expected-warning {{self-comparison always evaluates to 'std::strong_ordering::equal'}}
}
void test0(long a, unsigned long b) {
@@ -204,45 +213,28 @@
struct Class2 {};
using FnTy = void(int);
using FnTy2 = long(int);
+using FnTy3 = void(int) noexcept;
using MemFnTy = void (Class::*)() const;
-using MemFnTyB = void (ClassB::*)() const;
-using MemFnTy2 = void (Class::*)();
-using MemFnTy3 = void (Class2::*)() const;
using MemDataTy = long(Class::*);
void test_nullptr(int *x, FnTy *fp, MemFnTy memp, MemDataTy memdp) {
- auto r1 = (nullptr <=> nullptr);
- ASSERT_EXPR_TYPE(r1, std::strong_equality);
-
- auto r2 = (nullptr <=> x);
- ASSERT_EXPR_TYPE(r2, std::strong_equality);
-
- auto r3 = (fp <=> nullptr);
- ASSERT_EXPR_TYPE(r3, std::strong_equality);
-
- auto r4 = (0 <=> fp);
- ASSERT_EXPR_TYPE(r4, std::strong_equality);
-
- auto r5 = (nullptr <=> memp);
- ASSERT_EXPR_TYPE(r5, std::strong_equality);
-
- auto r6 = (0 <=> memdp);
- ASSERT_EXPR_TYPE(r6, std::strong_equality);
-
- auto r7 = (0 <=> nullptr);
- ASSERT_EXPR_TYPE(r7, std::strong_equality);
+ auto r1 = (nullptr <=> nullptr); // expected-error {{invalid operands}}
+ auto r2 = (nullptr <=> x); // expected-error {{invalid operands}}
+ auto r3 = (fp <=> nullptr); // expected-error {{invalid operands}}
+ auto r4 = (0 <=> fp); // expected-error {{ordered comparison between pointer and zero}}
+ auto r5 = (nullptr <=> memp); // expected-error {{invalid operands}}
+ auto r6 = (0 <=> memdp); // expected-error {{invalid operands}}
+ auto r7 = (0 <=> nullptr); // expected-error {{invalid operands}}
}
-void test_compatible_pointer(FnTy *f1, FnTy2 *f2, MemFnTy mf1, MemFnTyB mfb,
- MemFnTy2 mf2, MemFnTy3 mf3) {
+void test_memptr(MemFnTy mf, MemDataTy md) {
+ (void)(mf <=> mf); // expected-error {{invalid operands}} expected-warning {{self-comparison}}
+ (void)(md <=> md); // expected-error {{invalid operands}} expected-warning {{self-comparison}}
+}
+
+void test_compatible_pointer(FnTy *f1, FnTy2 *f2, FnTy3 *f3) {
(void)(f1 <=> f2); // expected-error {{distinct pointer types}}
-
- auto r1 = (mf1 <=> mfb); // OK
- ASSERT_EXPR_TYPE(r1, std::strong_equality);
- ASSERT_EXPR_TYPE((mf1 <=> mfb), std::strong_equality);
-
- (void)(mf1 <=> mf2); // expected-error {{distinct pointer types}}
- (void)(mf3 <=> mf1); // expected-error {{distinct pointer types}}
+ (void)(f1 <=> f3); // expected-error {{invalid operands}}
}
// Test that variable narrowing is deferred for value dependent expressions
@@ -292,11 +284,11 @@
template <int>
struct Tag {};
-// expected-note@+1 {{candidate}}
-Tag<0> operator<=>(EnumA, EnumA) {
+Tag<0> operator<=>(EnumA, EnumA) { // expected-note {{not viable}}
return {};
}
-Tag<1> operator<=>(EnumA, EnumB) {
+// expected-note@+1 {{while rewriting comparison as call to 'operator<=>' declared here}}
+Tag<1> operator<=>(EnumA, EnumB) { // expected-note {{not viable}}
return {};
}
@@ -305,7 +297,7 @@
ASSERT_EXPR_TYPE(r1, Tag<0>);
auto r2 = (EnumA::A <=> EnumB::B);
ASSERT_EXPR_TYPE(r2, Tag<1>);
- (void)(EnumB::B <=> EnumA::A); // expected-error {{invalid operands to binary expression ('EnumCompareTests::EnumB' and 'EnumCompareTests::EnumA')}}
+ (void)(EnumB::B <=> EnumA::A); // expected-error {{invalid operands to binary expression ('int' and 'Tag<1>')}}
}
void enum_float_test() {
@@ -355,6 +347,11 @@
}
}
+struct X {
+ constexpr const Conv<int, -1> operator<=>(X) { return {}; }
+};
+static_assert(X() < X());
+
} // namespace TestUserDefinedConvSeq
void test_array_conv() {
@@ -387,8 +384,7 @@
namespace NullptrTest {
using nullptr_t = decltype(nullptr);
void foo(nullptr_t x, nullptr_t y) {
- auto r = x <=> y;
- ASSERT_EXPR_TYPE(r, std::strong_equality);
+ auto r = x <=> y; // expected-error {{invalid operands}}
}
} // namespace NullptrTest
@@ -398,26 +394,35 @@
enum WeakE { E_One,
E_Two };
-void test_diag(_Complex int ci, _Complex float cf, _Complex double cd, int i, float f, StrongE E1, WeakE E2, int *p) {
- (void)(ci <=> (_Complex int &)ci);
- (void)(ci <=> cf);
- (void)(ci <=> i);
- (void)(ci <=> f);
- (void)(cf <=> i);
- (void)(cf <=> f);
+void test_diag(_Complex int ci, _Complex float cf, _Complex double cd, int i, float f, StrongE E1, WeakE E2, int *p) { // expected-warning 3 {{'_Complex' is a C99 extension}}
+ (void)(ci <=> (_Complex int &)ci); // expected-warning {{'_Complex' is a C99 extension}} expected-error {{invalid operands}}
+ (void)(ci <=> cf); // expected-error {{invalid operands}}
+ (void)(ci <=> i); // expected-error {{invalid operands}}
+ (void)(ci <=> f); // expected-error {{invalid operands}}
+ (void)(cf <=> i); // expected-error {{invalid operands}}
+ (void)(cf <=> f); // expected-error {{invalid operands}}
(void)(ci <=> p); // expected-error {{invalid operands}}
(void)(ci <=> E1); // expected-error {{invalid operands}}
(void)(E2 <=> cf); // expected-error {{invalid operands}}
}
-void test_int(_Complex int x, _Complex int y) {
- auto r = x <=> y;
- ASSERT_EXPR_TYPE(r, std::strong_equality);
+void test_int(_Complex int x, _Complex int y) { // expected-warning 2 {{'_Complex' is a C99 extension}}
+ auto r = x <=> y; // expected-error {{invalid operands}}
}
-void test_double(_Complex double x, _Complex double y) {
- auto r = x <=> y;
- ASSERT_EXPR_TYPE(r, std::weak_equality);
+void test_double(_Complex double x, _Complex double y) { // expected-warning 2 {{'_Complex' is a C99 extension}}
+ auto r = x <=> y; // expected-error {{invalid operands}}
}
} // namespace ComplexTest
+
+namespace Vector {
+ typedef __attribute__((ext_vector_type(4))) int V;
+ void f(V v1, V v2) {
+ // This would logically result in a vector of std::strong_ordering, but we
+ // don't support vectors of class type. We could model this as a vector of
+ // int (-1 / 0 / 1), but that doesn't extend to floating-point types (how
+ // to represent 'unordered')? For now, just reject.
+ (void)(v1 <=> v2); // expected-error {{three-way comparison between vectors is not supported}}
+ }
+}
diff --git a/src/llvm-project/clang/test/SemaCXX/compare-modules-cxx2a.cpp b/src/llvm-project/clang/test/SemaCXX/compare-modules-cxx2a.cpp
new file mode 100644
index 0000000..fa91800
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaCXX/compare-modules-cxx2a.cpp
@@ -0,0 +1,54 @@
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -fcxx-exceptions -verify -std=c++2a -fmodules -I%S/Inputs %s -fno-modules-error-recovery
+
+#pragma clang module build compare
+module compare {
+ explicit module cmp {}
+ explicit module other {}
+}
+#pragma clang module contents
+#pragma clang module begin compare.cmp
+#include "std-compare.h"
+#pragma clang module end
+#pragma clang module endbuild
+
+struct CC { CC(...); };
+
+void a() { void(0 <=> 0); } // expected-error {{include <compare>}}
+
+struct A {
+ CC operator<=>(const A&) const = default; // expected-error {{include <compare>}}
+};
+auto va = A() <=> A(); // expected-note {{required here}}
+
+#pragma clang module import compare.other
+
+// [email protected]:* 2+{{previous definition}}
+
+void b() { void(0 <=> 0); } // expected-error 1+{{definition of 'strong_ordering' must be imported}}
+
+struct B {
+ CC operator<=>(const B&) const = default; // expected-error 1+{{definition of 'strong_ordering' must be imported}}
+};
+auto vb = B() <=> B(); // expected-note {{required here}}
+
+#pragma clang module import compare.cmp
+
+void c() { void(0 <=> 0); }
+
+struct C {
+ CC operator<=>(const C&) const = default;
+};
+auto vc = C() <=> C();
+
+
+#pragma clang module build compare2
+module compare2 {}
+#pragma clang module contents
+#pragma clang module begin compare2
+#include "std-compare.h"
+#pragma clang module end
+#pragma clang module endbuild
+
+#pragma clang module import compare2
+
+void g() { void(0.0 <=> 0.0); }
diff --git a/src/llvm-project/clang/test/SemaCXX/complex-init-list.cpp b/src/llvm-project/clang/test/SemaCXX/complex-init-list.cpp
index f70f9df..ea7b688 100644
--- a/src/llvm-project/clang/test/SemaCXX/complex-init-list.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/complex-init-list.cpp
@@ -1,5 +1,4 @@
// RUN: %clang_cc1 %s -verify -fsyntax-only -pedantic
-// expected-no-diagnostics
// This file tests the clang extension which allows initializing the components
// of a complex number individually using an initialization list. Basically,
@@ -11,5 +10,4 @@
// test/Sema/complex-init-list.c.
// Basic testcase
-// (No pedantic warning is necessary because _Complex is not part of C++.)
-_Complex float valid1 = { 1.0f, 2.0f };
+_Complex float valid1 = { 1.0f, 2.0f }; // expected-warning {{'_Complex' is a C99 extension}}
diff --git a/src/llvm-project/clang/test/SemaCXX/constant-expression-cxx11.cpp b/src/llvm-project/clang/test/SemaCXX/constant-expression-cxx11.cpp
index 2f3fe09..7d8b67d 100644
--- a/src/llvm-project/clang/test/SemaCXX/constant-expression-cxx11.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/constant-expression-cxx11.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-linux -Wno-string-plus-int -Wno-pointer-arith -Wno-zero-length-array -fsyntax-only -fcxx-exceptions -verify -std=c++11 -pedantic %s -Wno-comment -Wno-tautological-pointer-compare -Wno-bool-conversion
+// RUN: %clang_cc1 -triple x86_64-linux -Wno-string-plus-int -Wno-pointer-arith -Wno-zero-length-array -Wno-c99-designator -fsyntax-only -fcxx-exceptions -verify -std=c++11 -pedantic %s -Wno-comment -Wno-tautological-pointer-compare -Wno-bool-conversion
namespace StaticAssertFoldTest {
@@ -283,10 +283,10 @@
static_assert(&x != &y, "");
constexpr bool g1 = &x == &y;
constexpr bool g2 = &x != &y;
-constexpr bool g3 = &x <= &y; // expected-error {{must be initialized by a constant expression}}
-constexpr bool g4 = &x >= &y; // expected-error {{must be initialized by a constant expression}}
-constexpr bool g5 = &x < &y; // expected-error {{must be initialized by a constant expression}}
-constexpr bool g6 = &x > &y; // expected-error {{must be initialized by a constant expression}}
+constexpr bool g3 = &x <= &y; // expected-error {{must be initialized by a constant expression}} expected-note {{unspecified}}
+constexpr bool g4 = &x >= &y; // expected-error {{must be initialized by a constant expression}} expected-note {{unspecified}}
+constexpr bool g5 = &x < &y; // expected-error {{must be initialized by a constant expression}} expected-note {{unspecified}}
+constexpr bool g6 = &x > &y; // expected-error {{must be initialized by a constant expression}} expected-note {{unspecified}}
struct S { int x, y; } s;
static_assert(&s.x == &s.y, "false"); // expected-error {{false}}
@@ -298,17 +298,17 @@
static_assert(0 == &y, "false"); // expected-error {{false}}
static_assert(0 != &y, "");
-constexpr bool n3 = (int*)0 <= &y; // expected-error {{must be initialized by a constant expression}}
-constexpr bool n4 = (int*)0 >= &y; // expected-error {{must be initialized by a constant expression}}
-constexpr bool n5 = (int*)0 < &y; // expected-error {{must be initialized by a constant expression}}
-constexpr bool n6 = (int*)0 > &y; // expected-error {{must be initialized by a constant expression}}
+constexpr bool n3 = (int*)0 <= &y; // expected-error {{must be initialized by a constant expression}} expected-note {{unspecified}}
+constexpr bool n4 = (int*)0 >= &y; // expected-error {{must be initialized by a constant expression}} expected-note {{unspecified}}
+constexpr bool n5 = (int*)0 < &y; // expected-error {{must be initialized by a constant expression}} expected-note {{unspecified}}
+constexpr bool n6 = (int*)0 > &y; // expected-error {{must be initialized by a constant expression}} expected-note {{unspecified}}
static_assert(&x == 0, "false"); // expected-error {{false}}
static_assert(&x != 0, "");
-constexpr bool n9 = &x <= (int*)0; // expected-error {{must be initialized by a constant expression}}
-constexpr bool n10 = &x >= (int*)0; // expected-error {{must be initialized by a constant expression}}
-constexpr bool n11 = &x < (int*)0; // expected-error {{must be initialized by a constant expression}}
-constexpr bool n12 = &x > (int*)0; // expected-error {{must be initialized by a constant expression}}
+constexpr bool n9 = &x <= (int*)0; // expected-error {{must be initialized by a constant expression}} expected-note {{unspecified}}
+constexpr bool n10 = &x >= (int*)0; // expected-error {{must be initialized by a constant expression}} expected-note {{unspecified}}
+constexpr bool n11 = &x < (int*)0; // expected-error {{must be initialized by a constant expression}} expected-note {{unspecified}}
+constexpr bool n12 = &x > (int*)0; // expected-error {{must be initialized by a constant expression}} expected-note {{unspecified}}
static_assert(&x == &x, "");
static_assert(&x != &x, "false"); // expected-error {{false}}
@@ -566,7 +566,7 @@
expected-error {{static_assert expression is not an integral constant expression}} \
expected-note {{in call to 'fail(zs[1][0][1][0])'}}
-constexpr int arr[40] = { 1, 2, 3, [8] = 4 }; // expected-warning {{C99 feature}}
+constexpr int arr[40] = { 1, 2, 3, [8] = 4 };
constexpr int SumNonzero(const int *p) {
return *p + (*p ? SumNonzero(p+1) : 0);
}
@@ -979,7 +979,7 @@
int b;
};
-constexpr U u[4] = { { .a = 0 }, { .b = 1 }, { .a = 2 }, { .b = 3 } }; // expected-warning 4{{C99 feature}}
+constexpr U u[4] = { { .a = 0 }, { .b = 1 }, { .a = 2 }, { .b = 3 } };
static_assert(u[0].a == 0, "");
static_assert(u[0].b, ""); // expected-error {{constant expression}} expected-note {{read of member 'b' of union with active member 'a'}}
static_assert(u[1].b == 1, "");
@@ -1108,6 +1108,11 @@
static_assert((int Derived::*)(int Mid<0>::*)&Mid<0>::n !=
(int Derived::*)(int Mid<1>::*)&Mid<1>::n, "");
static_assert(&Mid<0>::n == (int Mid<0>::*)&Base::n, "");
+
+ constexpr int apply(const A &a, int (A::*f)() const) {
+ return (a.*f)();
+ }
+ static_assert(apply(A(2), &A::f) == 5, "");
}
namespace ArrayBaseDerived {
@@ -1287,13 +1292,13 @@
}
namespace ComplexConstexpr {
- constexpr _Complex float test1 = {};
- constexpr _Complex float test2 = {1};
- constexpr _Complex double test3 = {1,2};
- constexpr _Complex int test4 = {4};
- constexpr _Complex int test5 = 4;
- constexpr _Complex int test6 = {5,6};
- typedef _Complex float fcomplex;
+ constexpr _Complex float test1 = {}; // expected-warning {{'_Complex' is a C99 extension}}
+ constexpr _Complex float test2 = {1}; // expected-warning {{'_Complex' is a C99 extension}}
+ constexpr _Complex double test3 = {1,2}; // expected-warning {{'_Complex' is a C99 extension}}
+ constexpr _Complex int test4 = {4}; // expected-warning {{'_Complex' is a C99 extension}}
+ constexpr _Complex int test5 = 4; // expected-warning {{'_Complex' is a C99 extension}}
+ constexpr _Complex int test6 = {5,6}; // expected-warning {{'_Complex' is a C99 extension}}
+ typedef _Complex float fcomplex; // expected-warning {{'_Complex' is a C99 extension}}
constexpr fcomplex test7 = fcomplex();
constexpr const double &t2r = __real test3;
@@ -1307,10 +1312,10 @@
static_assert(t2p[1] == 2.0, "");
static_assert(t2p[2] == 0.0, ""); // expected-error {{constant expr}} expected-note {{one-past-the-end pointer}}
static_assert(t2p[3] == 0.0, ""); // expected-error {{constant expr}} expected-note {{cannot refer to element 3 of array of 2 elements}}
- constexpr _Complex float *p = 0;
+ constexpr _Complex float *p = 0; // expected-warning {{'_Complex' is a C99 extension}}
constexpr float pr = __real *p; // expected-error {{constant expr}} expected-note {{cannot access real component of null}}
constexpr float pi = __imag *p; // expected-error {{constant expr}} expected-note {{cannot access imaginary component of null}}
- constexpr const _Complex double *q = &test3 + 1;
+ constexpr const _Complex double *q = &test3 + 1; // expected-warning {{'_Complex' is a C99 extension}}
constexpr double qr = __real *q; // expected-error {{constant expr}} expected-note {{cannot access real component of pointer past the end}}
constexpr double qi = __imag *q; // expected-error {{constant expr}} expected-note {{cannot access imaginary component of pointer past the end}}
@@ -1322,21 +1327,21 @@
// _Atomic(T) is exactly like T for the purposes of constant expression
// evaluation..
namespace Atomic {
- constexpr _Atomic int n = 3;
+ constexpr _Atomic int n = 3; // expected-warning {{'_Atomic' is a C11 extension}}
- struct S { _Atomic(double) d; };
+ struct S { _Atomic(double) d; }; // expected-warning {{'_Atomic' is a C11 extension}}
constexpr S s = { 0.5 };
constexpr double d1 = s.d;
constexpr double d2 = n;
- constexpr _Atomic double d3 = n;
+ constexpr _Atomic double d3 = n; // expected-warning {{'_Atomic' is a C11 extension}}
- constexpr _Atomic(int) n2 = d3;
+ constexpr _Atomic(int) n2 = d3; // expected-warning {{'_Atomic' is a C11 extension}}
static_assert(d1 == 0.5, "");
static_assert(d3 == 3.0, "");
namespace PR16056 {
struct TestVar {
- _Atomic(int) value;
+ _Atomic(int) value; // expected-warning {{'_Atomic' is a C11 extension}}
constexpr TestVar(int value) : value(value) {}
};
constexpr TestVar testVar{-1};
@@ -1345,11 +1350,11 @@
namespace PR32034 {
struct A {};
- struct B { _Atomic(A) a; };
+ struct B { _Atomic(A) a; }; // expected-warning {{'_Atomic' is a C11 extension}}
constexpr int n = (B(), B(), 0);
struct C { constexpr C() {} void *self = this; };
- constexpr _Atomic(C) c = C();
+ constexpr _Atomic(C) c = C(); // expected-warning {{'_Atomic' is a C11 extension}}
}
}
@@ -1889,9 +1894,10 @@
};
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'}}
+ E val{0}; // expected-error {{cannot initialize a member subobject of type 'ConstexprConstructorRecovery::X::E' with an rvalue of type 'int'}} expected-note {{here}}
};
- constexpr X x{};
+ // FIXME: We should avoid issuing this follow-on diagnostic.
+ constexpr X x{}; // expected-error {{constant expression}} expected-note {{not initialized}}
}
namespace Lifetime {
@@ -2036,7 +2042,7 @@
// 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}}
+ constexpr B( // expected-warning {{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}}
diff --git a/src/llvm-project/clang/test/SemaCXX/constant-expression-cxx1y.cpp b/src/llvm-project/clang/test/SemaCXX/constant-expression-cxx1y.cpp
index 1f9cb57..614b395 100644
--- a/src/llvm-project/clang/test/SemaCXX/constant-expression-cxx1y.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/constant-expression-cxx1y.cpp
@@ -627,6 +627,12 @@
}
namespace switch_stmt {
+ constexpr bool no_such_case(int n) {
+ switch (n) { case 1: return false; }
+ return true;
+ }
+ static_assert(no_such_case(0), "");
+
constexpr int f(char k) {
bool b = false;
int z = 6;
@@ -810,9 +816,10 @@
}
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}}
+ constexpr int g() {
+ return ({ int n; n; }); // expected-note {{read of uninitialized object}}
}
+ static_assert(g() == 0, ""); // expected-error {{constant expression}} expected-note {{in call}}
// FIXME: We should handle the void statement expression case.
constexpr int h() { // expected-error {{never produces a constant}}
@@ -1222,3 +1229,22 @@
~Comment1() = default;
};
}
+
+namespace TemporaryWithBadPointer {
+ constexpr int *get_bad_pointer() {
+ int n = 0; // expected-note 2{{here}}
+ return &n; // expected-warning {{stack}}
+ }
+ constexpr int *bad_pointer = get_bad_pointer(); // expected-error {{constant expression}} expected-note {{pointer to 'n' is not a constant expression}}
+
+ struct DoBadThings { int *&℘ int n; };
+ constexpr DoBadThings dbt = { // expected-error {{constant expression}}
+ nullptr, // expected-note {{pointer to 'n' is not a constant expression}}
+ (dbt.wp = get_bad_pointer(), 0)
+ };
+
+ constexpr DoBadThings dbt2 = { // ok
+ get_bad_pointer(),
+ (dbt2.wp = nullptr, 0)
+ };
+}
diff --git a/src/llvm-project/clang/test/SemaCXX/constant-expression-cxx2a.cpp b/src/llvm-project/clang/test/SemaCXX/constant-expression-cxx2a.cpp
index dba877f..b4a50aa 100644
--- a/src/llvm-project/clang/test/SemaCXX/constant-expression-cxx2a.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/constant-expression-cxx2a.cpp
@@ -1,11 +1,33 @@
-// RUN: %clang_cc1 -std=c++2a -verify %s -fcxx-exceptions -triple=x86_64-linux-gnu
+// RUN: %clang_cc1 -std=c++2a -verify %s -fcxx-exceptions -triple=x86_64-linux-gnu -Wno-mismatched-new-delete
#include "Inputs/std-compare.h"
namespace std {
struct type_info;
+ struct destroying_delete_t {
+ explicit destroying_delete_t() = default;
+ } inline constexpr destroying_delete{};
+ struct nothrow_t {
+ explicit nothrow_t() = default;
+ } inline constexpr nothrow{};
+ using size_t = decltype(sizeof(0));
+ enum class align_val_t : size_t {};
};
+[[nodiscard]] void *operator new(std::size_t, const std::nothrow_t&) noexcept;
+[[nodiscard]] void *operator new(std::size_t, std::align_val_t, const std::nothrow_t&) noexcept;
+[[nodiscard]] void *operator new[](std::size_t, const std::nothrow_t&) noexcept;
+[[nodiscard]] void *operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) noexcept;
+[[nodiscard]] void *operator new[](std::size_t, std::align_val_t);
+void operator delete(void*, const std::nothrow_t&) noexcept;
+void operator delete(void*, std::align_val_t, const std::nothrow_t&) noexcept;
+void operator delete[](void*, const std::nothrow_t&) noexcept;
+void operator delete[](void*, std::align_val_t, const std::nothrow_t&) noexcept;
+
+// Helper to print out values for debugging.
+constexpr void not_defined();
+template<typename T> constexpr void print(T) { not_defined(); }
+
namespace ThreeWayComparison {
struct A {
int n;
@@ -90,123 +112,19 @@
CHECK_TYPE(decltype(greater), PO);
CHECK(greater.test_eq(GREATER));
}
- {
- using SE = std::strong_equality;
- auto EQ = SE::equal;
- auto NEQ = SE::nonequal;
-
- MemPtrT P1 = &MemPtr::foo;
- MemPtrT P12 = &MemPtr::foo;
- MemPtrT P2 = &MemPtr::bar;
- MemPtrT P3 = nullptr;
-
- auto eq = (P1 <=> P12);
- CHECK_TYPE(decltype(eq), SE);
- CHECK(eq.test_eq(EQ));
-
- auto neq = (P1 <=> P2);
- CHECK_TYPE(decltype(eq), SE);
- CHECK(neq.test_eq(NEQ));
-
- auto eq2 = (P3 <=> nullptr);
- CHECK_TYPE(decltype(eq2), SE);
- CHECK(eq2.test_eq(EQ));
- }
- {
- using SE = std::strong_equality;
- auto EQ = SE::equal;
- auto NEQ = SE::nonequal;
-
- FnPtrT F1 = &FnPtr1;
- FnPtrT F12 = &FnPtr1;
- FnPtrT F2 = &FnPtr2;
- FnPtrT F3 = nullptr;
-
- auto eq = (F1 <=> F12);
- CHECK_TYPE(decltype(eq), SE);
- CHECK(eq.test_eq(EQ));
-
- auto neq = (F1 <=> F2);
- CHECK_TYPE(decltype(neq), SE);
- CHECK(neq.test_eq(NEQ));
- }
- { // mixed nullptr tests
- using SO = std::strong_ordering;
- using SE = std::strong_equality;
-
- int x = 42;
- int *xp = &x;
-
- MemPtrT mf = nullptr;
- MemPtrT mf2 = &MemPtr::foo;
- auto r3 = (mf <=> nullptr);
- CHECK_TYPE(decltype(r3), std::strong_equality);
- CHECK(r3.test_eq(SE::equal));
- }
return true;
}();
-template <auto LHS, auto RHS, bool ExpectTrue = false>
-constexpr bool test_constexpr() {
- using nullptr_t = decltype(nullptr);
- using LHSTy = decltype(LHS);
- using RHSTy = decltype(RHS);
- // expected-note@+1 {{subexpression not valid in a constant expression}}
- auto Res = (LHS <=> RHS);
- if constexpr (__is_same(LHSTy, nullptr_t) || __is_same(RHSTy, nullptr_t)) {
- CHECK_TYPE(decltype(Res), std::strong_equality);
- }
- if (ExpectTrue)
- return Res == 0;
- return Res != 0;
-}
int dummy = 42;
int dummy2 = 101;
-
-constexpr bool tc1 = test_constexpr<nullptr, &dummy>();
-constexpr bool tc2 = test_constexpr<&dummy, nullptr>();
-
-// OK, equality comparison only
-constexpr bool tc3 = test_constexpr<&MemPtr::foo, nullptr>();
-constexpr bool tc4 = test_constexpr<nullptr, &MemPtr::foo>();
-constexpr bool tc5 = test_constexpr<&MemPtr::foo, &MemPtr::bar>();
-
-constexpr bool tc6 = test_constexpr<&MemPtr::data, nullptr>();
-constexpr bool tc7 = test_constexpr<nullptr, &MemPtr::data>();
-constexpr bool tc8 = test_constexpr<&MemPtr::data, &MemPtr::data2>();
-
-// expected-error@+1 {{must be initialized by a constant expression}}
-constexpr bool tc9 = test_constexpr<&dummy, &dummy2>(); // expected-note {{in call}}
+constexpr bool tc9 = (&dummy <=> &dummy2) != 0; // expected-error {{constant expression}} expected-note {{unspecified}}
template <class T, class R, class I>
constexpr T makeComplex(R r, I i) {
T res{r, i};
return res;
};
-
-template <class T, class ResultT>
-constexpr bool complex_test(T x, T y, ResultT Expect) {
- auto res = x <=> y;
- CHECK_TYPE(decltype(res), ResultT);
- return res.test_eq(Expect);
-}
-static_assert(complex_test(makeComplex<_Complex double>(0.0, 0.0),
- makeComplex<_Complex double>(0.0, 0.0),
- std::weak_equality::equivalent));
-static_assert(complex_test(makeComplex<_Complex double>(0.0, 0.0),
- makeComplex<_Complex double>(1.0, 0.0),
- std::weak_equality::nonequivalent));
-static_assert(complex_test(makeComplex<_Complex double>(0.0, 0.0),
- makeComplex<_Complex double>(0.0, 1.0),
- std::weak_equality::nonequivalent));
-static_assert(complex_test(makeComplex<_Complex int>(0, 0),
- makeComplex<_Complex int>(0, 0),
- std::strong_equality::equal));
-static_assert(complex_test(makeComplex<_Complex int>(0, 0),
- makeComplex<_Complex int>(1, 0),
- std::strong_equality::nonequal));
-// TODO: defaulted operator <=>
} // namespace ThreeWayComparison
constexpr bool for_range_init() {
@@ -219,15 +137,19 @@
namespace Virtual {
struct NonZeroOffset { int padding = 123; };
+ constexpr void assert(bool b) { if (!b) throw 0; }
+
// Ensure that we pick the right final overrider during construction.
struct A {
virtual constexpr char f() const { return 'A'; }
char a = f();
+ constexpr ~A() { assert(f() == 'A'); }
};
struct NoOverrideA : A {};
struct B : NonZeroOffset, NoOverrideA {
virtual constexpr char f() const { return 'B'; }
char b = f();
+ constexpr ~B() { assert(f() == 'B'); }
};
struct NoOverrideB : B {};
struct C : NonZeroOffset, A {
@@ -236,12 +158,15 @@
char c = ((A*)this)->f();
char ba = pba->f();
constexpr C(A *pba) : pba(pba) {}
+ constexpr ~C() { assert(f() == 'C'); }
};
struct D : NonZeroOffset, NoOverrideB, C { // expected-warning {{inaccessible}}
virtual constexpr char f() const { return 'D'; }
char d = f();
constexpr D() : C((B*)this) {}
+ constexpr ~D() { assert(f() == 'D'); }
};
+ constexpr int n = (D(), 0);
constexpr D d;
static_assert(((B&)d).a == 'A');
static_assert(((C&)d).a == 'A');
@@ -416,7 +341,7 @@
namespace Union {
struct Base {
- int y; // expected-note {{here}}
+ int y; // expected-note 2{{here}}
};
struct A : Base {
int x;
@@ -489,13 +414,15 @@
constexpr A return_uninit_struct() {
B b = {.b = 1};
b.a.x = 2;
- return b.a;
+ return b.a; // expected-note {{in call to 'A(b.a)'}} expected-note {{subobject of type 'int' is not initialized}}
}
- // FIXME: It's unclear that this should be valid. Copying a B involves
- // copying the object representation of the union, but copying an A invokes a
- // copy constructor that copies the object elementwise, and reading from
- // b.a.y is undefined.
- static_assert(return_uninit_struct().x == 2);
+ // Note that this is rejected even though return_uninit() is accepted, and
+ // return_uninit() copies the same stuff wrapped in a union.
+ //
+ // Copying a B involves copying the object representation of the union, but
+ // copying an A invokes a copy constructor that copies the object
+ // elementwise, and reading from b.a.y is undefined.
+ static_assert(return_uninit_struct().x == 2); // expected-error {{constant expression}} expected-note {{in call}}
constexpr B return_init_all() {
B b = {.b = 1};
b.a.x = 2;
@@ -531,6 +458,71 @@
S3 s;
s.n = 0;
}
+
+ union ref_member_1 {
+ int a;
+ int b;
+ };
+ struct ref_member_2 {
+ ref_member_1 &&r;
+ };
+ union ref_member_3 {
+ ref_member_2 a, b;
+ };
+ constexpr int ref_member_test_1() {
+ ref_member_3 r = {.a = {.r = {.a = 1}}};
+ r.a.r.b = 2;
+ return r.a.r.b;
+ }
+ static_assert(ref_member_test_1() == 2);
+ constexpr int ref_member_test_2() { // expected-error {{never produces a constant}}
+ ref_member_3 r = {.a = {.r = {.a = 1}}};
+ // FIXME: This note isn't great. The 'read' here is reading the referent of the reference.
+ r.b.r.b = 2; // expected-note {{read of member 'b' of union with active member 'a'}}
+ return r.b.r.b;
+ }
+
+ namespace PR43762 {
+ struct A { int x = 1; constexpr int f() { return 1; } };
+ struct B : A { int y = 1; constexpr int g() { return 2; } };
+ struct C {
+ int x;
+ constexpr virtual int f() = 0;
+ };
+ struct D : C {
+ int y;
+ constexpr virtual int f() override { return 3; }
+ };
+
+ union U {
+ int n;
+ B b;
+ D d;
+ };
+
+ constexpr int test(int which) {
+ U u{.n = 5};
+ switch (which) {
+ case 0:
+ u.b.x = 10; // expected-note {{active member 'n'}}
+ return u.b.f();
+ case 1:
+ u.b.y = 10; // expected-note {{active member 'n'}}
+ return u.b.g();
+ case 2:
+ u.d.x = 10; // expected-note {{active member 'n'}}
+ return u.d.f();
+ case 3:
+ u.d.y = 10; // expected-note {{active member 'n'}}
+ return u.d.f();
+ }
+ }
+
+ static_assert(test(0)); // expected-error {{}} expected-note {{in call}}
+ static_assert(test(1)); // expected-error {{}} expected-note {{in call}}
+ static_assert(test(2)); // expected-error {{}} expected-note {{in call}}
+ static_assert(test(3)); // expected-error {{}} expected-note {{in call}}
+ }
}
namespace TwosComplementShifts {
@@ -548,3 +540,762 @@
static_assert(-3 >> 1 == -2);
static_assert(-4 >> 1 == -2);
}
+
+namespace Uninit {
+ constexpr int f(bool init) {
+ int a;
+ if (init)
+ a = 1;
+ return a; // expected-note {{read of uninitialized object}}
+ }
+ static_assert(f(true) == 1);
+ static_assert(f(false) == 1); // expected-error {{constant expression}} expected-note {{in call}}
+
+ struct X {
+ int n; // expected-note {{declared here}}
+ constexpr X(bool init) {
+ if (init) n = 123;
+ }
+ };
+ constinit X x1(true);
+ constinit X x2(false); // expected-error {{constant initializer}} expected-note {{constinit}} expected-note {{subobject of type 'int' is not initialized}}
+
+ struct Y {
+ struct Z { int n; }; // expected-note {{here}}
+ Z z1;
+ Z z2;
+ Z z3;
+ // OK: the lifetime of z1 (and its members) start before the initializer of
+ // z2 runs.
+ constexpr Y() : z2{ (z1.n = 1, z1.n + 1) } { z3.n = 3; }
+ // Not OK: z3 is not in its lifetime when the initializer of z2 runs.
+ constexpr Y(int) : z2{
+ (z3.n = 1, // expected-note {{assignment to object outside its lifetime}}
+ z3.n + 1) // expected-warning {{uninitialized}}
+ } { z1.n = 3; }
+ constexpr Y(int, int) : z2{} {}
+ };
+ // FIXME: This is working around clang not implementing DR2026. With that
+ // fixed, we should be able to test this without the injected copy.
+ constexpr Y copy(Y y) { return y; } // expected-note {{in call to 'Y(y)'}} expected-note {{subobject of type 'int' is not initialized}}
+ constexpr Y y1 = copy(Y());
+ static_assert(y1.z1.n == 1 && y1.z2.n == 2 && y1.z3.n == 3);
+
+ constexpr Y y2 = copy(Y(0)); // expected-error {{constant expression}} expected-note {{in call}}
+
+ static_assert(Y(0,0).z2.n == 0);
+ static_assert(Y(0,0).z1.n == 0); // expected-error {{constant expression}} expected-note {{read of uninitialized object}}
+ static_assert(Y(0,0).z3.n == 0); // expected-error {{constant expression}} expected-note {{read of uninitialized object}}
+
+ static_assert(copy(Y(0,0)).z2.n == 0); // expected-error {{constant expression}} expected-note {{in call}}
+
+ constexpr unsigned char not_even_unsigned_char() {
+ unsigned char c;
+ return c; // expected-note {{read of uninitialized object}}
+ }
+ constexpr unsigned char x = not_even_unsigned_char(); // expected-error {{constant expression}} expected-note {{in call}}
+
+ constexpr int switch_var(int n) {
+ switch (n) {
+ case 1:
+ int a;
+ a = n;
+ return a;
+
+ case 2:
+ a = n;
+ return a;
+ }
+ }
+ constexpr int s1 = switch_var(1);
+ constexpr int s2 = switch_var(2);
+ static_assert(s1 == 1 && s2 == 2);
+
+ constexpr bool switch_into_init_stmt() {
+ switch (1) {
+ if (int n; false) {
+ for (int m; false;) {
+ case 1:
+ n = m = 1;
+ return n == 1 && m == 1;
+ }
+ }
+ }
+ }
+ static_assert(switch_into_init_stmt());
+}
+
+namespace dtor {
+ void lifetime_extension() {
+ struct X { constexpr ~X() {} };
+ X &&a = X();
+ }
+
+ template<typename T> constexpr T &&ref(T &&t) { return (T&&)t; }
+
+ struct Buf {
+ char buf[64];
+ int n = 0;
+ constexpr void operator+=(char c) { buf[n++] = c; }
+ constexpr bool operator==(const char *str) const {
+ return str[n] == 0 && __builtin_memcmp(str, buf, n) == 0;
+ }
+ constexpr bool operator!=(const char *str) const { return !operator==(str); }
+ };
+
+ struct A {
+ constexpr A(Buf &buf, char c) : buf(buf), c(c) { buf += c; }
+ constexpr ~A() { buf += c; }
+ constexpr operator bool() const { return true; }
+ Buf &buf;
+ char c;
+ };
+
+ constexpr bool dtor_calls_dtor() {
+ union U {
+ constexpr U(Buf &buf) : u(buf, 'u') { buf += 'U'; }
+ constexpr ~U() { u.buf += 'U'; }
+ A u, v;
+ };
+
+ struct B : A {
+ A c, &&d, e;
+ union {
+ A f;
+ };
+ U u;
+ constexpr B(Buf &buf)
+ : A(buf, 'a'), c(buf, 'c'), d(ref(A(buf, 'd'))), e(A(buf, 'e')), f(buf, 'f'), u(buf) {
+ buf += 'b';
+ }
+ constexpr ~B() {
+ buf += 'b';
+ }
+ };
+
+ Buf buf;
+ {
+ B b(buf);
+ if (buf != "acddefuUb")
+ return false;
+ }
+ if (buf != "acddefuUbbUeca")
+ return false;
+ return true;
+ }
+ static_assert(dtor_calls_dtor());
+
+ constexpr void abnormal_termination(Buf &buf) {
+ struct Indestructible {
+ constexpr ~Indestructible(); // not defined
+ };
+
+ A a(buf, 'a');
+ A(buf, 'b');
+ int n = 0;
+ for (A &&c = A(buf, 'c'); A d = A(buf, 'd'); A(buf, 'e')) {
+ switch (A f(buf, 'f'); A g = A(buf, 'g')) { // expected-warning {{boolean}}
+ case false: {
+ A x(buf, 'x');
+ }
+
+ case true: {
+ A h(buf, 'h');
+ switch (n++) {
+ case 0:
+ break;
+ case 1:
+ continue;
+ case 2:
+ return;
+ }
+ break;
+ }
+
+ default:
+ Indestructible indest;
+ }
+
+ A j = (A(buf, 'i'), A(buf, 'j'));
+ }
+ }
+
+ constexpr bool check_abnormal_termination() {
+ Buf buf = {};
+ abnormal_termination(buf);
+ return buf ==
+ "abbc"
+ "dfgh" /*break*/ "hgfijijeed"
+ "dfgh" /*continue*/ "hgfeed"
+ "dfgh" /*return*/ "hgfd"
+ "ca";
+ }
+ static_assert(check_abnormal_termination());
+
+ constexpr bool run_dtors_on_array_filler() {
+ struct S {
+ int times_destroyed = 0;
+ constexpr ~S() { if (++times_destroyed != 1) throw "oops"; }
+ };
+ S s[3];
+ return true;
+ }
+ static_assert(run_dtors_on_array_filler());
+
+ // Ensure that we can handle temporary cleanups for array temporaries.
+ struct ArrElem { constexpr ~ArrElem() {} };
+ using Arr = ArrElem[3];
+ static_assert((Arr{}, true));
+}
+
+namespace dynamic_alloc {
+ constexpr int *p = // expected-error {{constant}} expected-note {{pointer to heap-allocated object is not a constant expression}}
+ new int; // expected-note {{heap allocation performed here}}
+
+ constexpr int f(int n) {
+ int *p = new int[n];
+ for (int i = 0; i != n; ++i) {
+ p[i] = i;
+ }
+ int k = 0;
+ for (int i = 0; i != n; ++i) {
+ k += p[i];
+ }
+ delete[] p;
+ return k;
+ }
+ static_assert(f(123) == 123 * 122 / 2);
+
+ constexpr bool nvdtor() { // expected-error {{never produces a constant expression}}
+ struct S {
+ constexpr ~S() {}
+ };
+ struct T : S {};
+ delete (S*)new T; // expected-note {{delete of object with dynamic type 'T' through pointer to base class type 'S' with non-virtual destructor}}
+ return true;
+ }
+
+ constexpr int vdtor_1() {
+ int a;
+ struct S {
+ constexpr S(int *p) : p(p) {}
+ constexpr virtual ~S() { *p = 1; }
+ int *p;
+ };
+ struct T : S {
+ // implicit destructor defined eagerly because it is constexpr and virtual
+ using S::S;
+ };
+ delete (S*)new T(&a);
+ return a;
+ }
+ static_assert(vdtor_1() == 1);
+
+ constexpr int vdtor_2() {
+ int a = 0;
+ struct S { constexpr virtual ~S() {} };
+ struct T : S {
+ constexpr T(int *p) : p(p) {}
+ constexpr ~T() { ++*p; }
+ int *p;
+ };
+ S *p = new T{&a};
+ delete p;
+ return a;
+ }
+ static_assert(vdtor_2() == 1);
+
+ constexpr int vdtor_3(int mode) {
+ int a = 0;
+ struct S { constexpr virtual ~S() {} };
+ struct T : S {
+ constexpr T(int *p) : p(p) {}
+ constexpr ~T() { ++*p; }
+ int *p;
+ };
+ S *p = new T[3]{&a, &a, &a}; // expected-note 2{{heap allocation}}
+ switch (mode) {
+ case 0:
+ delete p; // expected-note {{non-array delete used to delete pointer to array object of type 'T [3]'}}
+ break;
+ case 1:
+ // FIXME: This diagnosic isn't great; we should mention the cast to S*
+ // somewhere in here.
+ delete[] p; // expected-note {{delete of pointer to subobject '&{*new T [3]#0}[0]'}}
+ break;
+ case 2:
+ delete (T*)p; // expected-note {{non-array delete used to delete pointer to array object of type 'T [3]'}}
+ break;
+ case 3:
+ delete[] (T*)p;
+ break;
+ }
+ return a;
+ }
+ static_assert(vdtor_3(0) == 3); // expected-error {{}} expected-note {{in call}}
+ static_assert(vdtor_3(1) == 3); // expected-error {{}} expected-note {{in call}}
+ static_assert(vdtor_3(2) == 3); // expected-error {{}} expected-note {{in call}}
+ static_assert(vdtor_3(3) == 3);
+
+ constexpr void delete_mismatch() { // expected-error {{never produces a constant expression}}
+ delete[] // expected-note {{array delete used to delete pointer to non-array object of type 'int'}}
+ new int; // expected-note {{allocation}}
+ }
+
+ template<typename T>
+ constexpr T dynarray(int elems, int i) {
+ T *p;
+ if constexpr (sizeof(T) == 1)
+ p = new T[elems]{"fox"}; // expected-note {{evaluated array bound 3 is too small to hold 4 explicitly initialized elements}}
+ else
+ p = new T[elems]{1, 2, 3}; // expected-note {{evaluated array bound 2 is too small to hold 3 explicitly initialized elements}}
+ T n = p[i]; // expected-note 4{{past-the-end}}
+ delete [] p;
+ return n;
+ }
+ static_assert(dynarray<int>(4, 0) == 1);
+ static_assert(dynarray<int>(4, 1) == 2);
+ static_assert(dynarray<int>(4, 2) == 3);
+ static_assert(dynarray<int>(4, 3) == 0);
+ static_assert(dynarray<int>(4, 4) == 0); // expected-error {{constant expression}} expected-note {{in call}}
+ static_assert(dynarray<int>(3, 2) == 3);
+ static_assert(dynarray<int>(3, 3) == 0); // expected-error {{constant expression}} expected-note {{in call}}
+ static_assert(dynarray<int>(2, 1) == 0); // expected-error {{constant expression}} expected-note {{in call}}
+ static_assert(dynarray<char>(5, 0) == 'f');
+ static_assert(dynarray<char>(5, 1) == 'o');
+ static_assert(dynarray<char>(5, 2) == 'x');
+ static_assert(dynarray<char>(5, 3) == 0); // (from string)
+ static_assert(dynarray<char>(5, 4) == 0); // (from filler)
+ static_assert(dynarray<char>(5, 5) == 0); // expected-error {{constant expression}} expected-note {{in call}}
+ static_assert(dynarray<char>(4, 0) == 'f');
+ static_assert(dynarray<char>(4, 1) == 'o');
+ static_assert(dynarray<char>(4, 2) == 'x');
+ static_assert(dynarray<char>(4, 3) == 0);
+ static_assert(dynarray<char>(4, 4) == 0); // expected-error {{constant expression}} expected-note {{in call}}
+ static_assert(dynarray<char>(3, 2) == 'x'); // expected-error {{constant expression}} expected-note {{in call}}
+
+ constexpr bool run_dtors_on_array_filler() {
+ struct S {
+ int times_destroyed = 0;
+ constexpr ~S() { if (++times_destroyed != 1) throw "oops"; }
+ };
+ delete[] new S[3];
+ return true;
+ }
+ static_assert(run_dtors_on_array_filler());
+
+ constexpr bool erroneous_array_bound(long long n) {
+ delete[] new int[n]; // expected-note {{array bound -1 is negative}} expected-note {{array bound 4611686018427387904 is too large}}
+ return true;
+ }
+ static_assert(erroneous_array_bound(3));
+ static_assert(erroneous_array_bound(0));
+ static_assert(erroneous_array_bound(-1)); // expected-error {{constant expression}} expected-note {{in call}}
+ static_assert(erroneous_array_bound(1LL << 62)); // expected-error {{constant expression}} expected-note {{in call}}
+
+ constexpr bool erroneous_array_bound_nothrow(long long n) {
+ int *p = new (std::nothrow) int[n];
+ bool result = p != 0;
+ delete[] p;
+ return result;
+ }
+ static_assert(erroneous_array_bound_nothrow(3));
+ static_assert(erroneous_array_bound_nothrow(0));
+ static_assert(!erroneous_array_bound_nothrow(-1));
+ static_assert(!erroneous_array_bound_nothrow(1LL << 62));
+
+ constexpr bool evaluate_nothrow_arg() {
+ bool ok = false;
+ delete new ((ok = true, std::nothrow)) int;
+ return ok;
+ }
+ static_assert(evaluate_nothrow_arg());
+
+ constexpr void double_delete() { // expected-error {{never produces a constant expression}}
+ int *p = new int;
+ delete p;
+ delete p; // expected-note {{delete of pointer that has already been deleted}}
+ }
+ constexpr bool super_secret_double_delete() {
+ struct A {
+ constexpr ~A() { delete this; } // expected-note {{destruction of object that is already being destroyed}} expected-note {{in call}}
+ };
+ delete new A; // expected-note {{in call}}
+ return true;
+ }
+ static_assert(super_secret_double_delete()); // expected-error {{constant expression}} expected-note {{in call}}
+
+ constexpr void use_after_free() { // expected-error {{never produces a constant expression}}
+ int *p = new int;
+ delete p;
+ *p = 1; // expected-note {{assignment to heap allocated object that has been deleted}}
+ }
+ constexpr void use_after_free_2() { // expected-error {{never produces a constant expression}}
+ struct X { constexpr void f() {} };
+ X *p = new X;
+ delete p;
+ p->f(); // expected-note {{member call on heap allocated object that has been deleted}}
+ }
+
+ template<typename T> struct X {
+ std::size_t n;
+ char *p;
+ void dependent();
+ };
+ template<typename T> void X<T>::dependent() {
+ char *p;
+ // Ensure that we don't try to evaluate these for overflow and crash. These
+ // are all value-dependent expressions.
+ p = new char[n];
+ p = new ((std::align_val_t)n) char[n];
+ p = new char(n);
+ }
+}
+
+struct placement_new_arg {};
+void *operator new(std::size_t, placement_new_arg);
+void operator delete(void*, placement_new_arg);
+
+namespace placement_new_delete {
+ struct ClassSpecificNew {
+ void *operator new(std::size_t);
+ };
+ struct ClassSpecificDelete {
+ void operator delete(void*);
+ };
+ struct DestroyingDelete {
+ void operator delete(DestroyingDelete*, std::destroying_delete_t);
+ };
+ struct alignas(64) Overaligned {};
+
+ constexpr bool ok() {
+ delete new Overaligned;
+ delete ::new ClassSpecificNew;
+ ::delete new ClassSpecificDelete;
+ ::delete new DestroyingDelete;
+ return true;
+ }
+ static_assert(ok());
+
+ constexpr bool bad(int which) {
+ switch (which) {
+ case 0:
+ delete new (placement_new_arg{}) int; // expected-note {{call to placement 'operator new'}}
+ break;
+
+ case 1:
+ delete new ClassSpecificNew; // expected-note {{call to class-specific 'operator new'}}
+ break;
+
+ case 2:
+ delete new ClassSpecificDelete; // expected-note {{call to class-specific 'operator delete'}}
+ break;
+
+ case 3:
+ delete new DestroyingDelete; // expected-note {{call to class-specific 'operator delete'}}
+ break;
+
+ case 4:
+ // FIXME: This technically follows the standard's rules, but it seems
+ // unreasonable to expect implementations to support this.
+ delete new (std::align_val_t{64}) Overaligned; // expected-note {{placement new expression is not yet supported}}
+ break;
+ }
+
+ return true;
+ }
+ static_assert(bad(0)); // expected-error {{constant expression}} expected-note {{in call}}
+ static_assert(bad(1)); // expected-error {{constant expression}} expected-note {{in call}}
+ static_assert(bad(2)); // expected-error {{constant expression}} expected-note {{in call}}
+ static_assert(bad(3)); // expected-error {{constant expression}} expected-note {{in call}}
+ static_assert(bad(4)); // expected-error {{constant expression}} expected-note {{in call}}
+}
+
+namespace delete_random_things {
+ static_assert((delete new int, true));
+ static_assert((delete (int*)0, true));
+ int n; // expected-note {{declared here}}
+ static_assert((delete &n, true)); // expected-error {{}} expected-note {{delete of pointer '&n' that does not point to a heap-allocated object}}
+ struct A { int n; };
+ static_assert((delete &(new A)->n, true)); // expected-error {{}} expected-note {{delete of pointer to subobject '&{*new delete_random_things::A#0}.n'}}
+ static_assert((delete (new int + 1), true)); // expected-error {{}} expected-note {{delete of pointer '&{*new int#0} + 1' that does not point to complete object}}
+ static_assert((delete[] (new int[3] + 1), true)); // expected-error {{}} expected-note {{delete of pointer to subobject '&{*new int [3]#0}[1]'}}
+ static_assert((delete &(int&)(int&&)0, true)); // expected-error {{}} expected-note {{delete of pointer '&0' that does not point to a heap-allocated object}} expected-note {{temporary created here}}
+}
+
+namespace value_dependent_delete {
+ template<typename T> void f(T *p) {
+ int arr[(delete p, 0)];
+ }
+}
+
+namespace memory_leaks {
+ static_assert(*new bool(true)); // expected-error {{}} expected-note {{allocation performed here was not deallocated}}
+
+ constexpr bool *f() { return new bool(true); } // expected-note {{allocation performed here was not deallocated}}
+ static_assert(*f()); // expected-error {{}}
+
+ struct UP {
+ bool *p;
+ constexpr ~UP() { delete p; }
+ constexpr bool &operator*() { return *p; }
+ };
+ constexpr UP g() { return {new bool(true)}; }
+ static_assert(*g()); // ok
+
+ constexpr bool h(UP p) { return *p; }
+ static_assert(h({new bool(true)})); // ok
+}
+
+namespace dtor_call {
+ struct A { int n; };
+ constexpr void f() { // expected-error {{never produces a constant expression}}
+ A a; // expected-note {{destroying object 'a' whose lifetime has already ended}}
+ a.~A();
+ }
+ union U { A a; };
+ constexpr void g() {
+ U u;
+ u.a.n = 3;
+ u.a.~A();
+ // There's now effectively no active union member, but we model it as if
+ // 'a' is still the active union member (but its lifetime has ended).
+ u.a.n = 4; // Start lifetime of 'a' again.
+ u.a.~A();
+ }
+ static_assert((g(), true));
+
+ constexpr bool pseudo() {
+ using T = bool;
+ bool b = false;
+ // This does evaluate the store to 'b'...
+ (b = true).~T();
+ // ... but does not end the lifetime of the object.
+ return b;
+ }
+ static_assert(pseudo());
+
+ constexpr void use_after_destroy() {
+ A a;
+ a.~A();
+ A b = a; // expected-note {{in call}} expected-note {{read of object outside its lifetime}}
+ }
+ static_assert((use_after_destroy(), true)); // expected-error {{}} expected-note {{in call}}
+
+ constexpr void double_destroy() {
+ A a;
+ a.~A();
+ a.~A(); // expected-note {{destruction of object outside its lifetime}}
+ }
+ static_assert((double_destroy(), true)); // expected-error {{}} expected-note {{in call}}
+
+ struct X { char *p; constexpr ~X() { *p++ = 'X'; } };
+ struct Y : X { int y; virtual constexpr ~Y() { *p++ = 'Y'; } };
+ struct Z : Y { int z; constexpr ~Z() override { *p++ = 'Z'; } };
+ union VU {
+ constexpr VU() : z() {}
+ constexpr ~VU() {}
+ Z z;
+ };
+
+ constexpr bool virt_dtor(int mode, const char *expected) {
+ char buff[4] = {};
+ VU vu;
+ vu.z.p = buff;
+ switch (mode) {
+ case 0:
+ vu.z.~Z();
+ break;
+ case 1:
+ ((Y&)vu.z).~Y();
+ break;
+ case 2:
+ ((X&)vu.z).~X();
+ break;
+ case 3:
+ ((Y&)vu.z).Y::~Y();
+ vu.z.z = 1; // ok, still have a Z (with no Y base class!)
+ break;
+ case 4:
+ ((X&)vu.z).X::~X();
+ vu.z.y = 1; // ok, still have a Z and a Y (with no X base class!)
+ break;
+ }
+ return __builtin_strcmp(expected, buff) == 0;
+ }
+ static_assert(virt_dtor(0, "ZYX"));
+ static_assert(virt_dtor(1, "ZYX"));
+ static_assert(virt_dtor(2, "X"));
+ static_assert(virt_dtor(3, "YX"));
+ static_assert(virt_dtor(4, "X"));
+
+ constexpr bool virt_delete(bool global) {
+ struct A {
+ virtual constexpr ~A() {}
+ };
+ struct B : A {
+ void operator delete(void *);
+ constexpr ~B() {}
+ };
+
+ A *p = new B;
+ if (global)
+ ::delete p;
+ else
+ delete p; // expected-note {{call to class-specific 'operator delete'}}
+ return true;
+ }
+ static_assert(virt_delete(true));
+ static_assert(virt_delete(false)); // expected-error {{}} expected-note {{in call}}
+
+ constexpr void use_after_virt_destroy() {
+ char buff[4] = {};
+ VU vu;
+ vu.z.p = buff;
+ ((Y&)vu.z).~Y();
+ ((Z&)vu.z).z = 1; // expected-note {{assignment to object outside its lifetime}}
+ }
+ static_assert((use_after_virt_destroy(), true)); // expected-error {{}} expected-note {{in call}}
+
+ constexpr void destroy_after_lifetime() {
+ A *p;
+ {
+ A a;
+ p = &a;
+ }
+ p->~A(); // expected-note {{destruction of object outside its lifetime}}
+ }
+ static_assert((destroy_after_lifetime(), true)); // expected-error {{}} expected-note {{in call}}
+
+ constexpr void destroy_after_lifetime2() {
+ A *p = []{ A a; return &a; }(); // expected-warning {{}} expected-note {{declared here}}
+ p->~A(); // expected-note {{destruction of variable whose lifetime has ended}}
+ }
+ static_assert((destroy_after_lifetime2(), true)); // expected-error {{}} expected-note {{in call}}
+
+ constexpr void destroy_after_lifetime3() {
+ A *p = []{ return &(A&)(A&&)A(); }(); // expected-warning {{}} expected-note {{temporary created here}}
+ p->~A(); // expected-note {{destruction of temporary whose lifetime has ended}}
+ }
+ static_assert((destroy_after_lifetime3(), true)); // expected-error {{}} expected-note {{in call}}
+
+ constexpr void destroy_after_lifetime4() { // expected-error {{never produces a constant expression}}
+ A *p = new A;
+ delete p;
+ p->~A(); // expected-note {{destruction of heap allocated object that has been deleted}}
+ }
+
+ struct Extern { constexpr ~Extern() {} } extern e;
+ constexpr void destroy_extern() { // expected-error {{never produces a constant expression}}
+ e.~Extern(); // expected-note {{cannot modify an object that is visible outside}}
+ }
+
+ constexpr A &&a_ref = A(); // expected-note {{temporary created here}}
+ constexpr void destroy_extern_2() { // expected-error {{never produces a constant expression}}
+ a_ref.~A(); // expected-note {{destruction of temporary is not allowed in a constant expression outside the expression that created the temporary}}
+ }
+
+ struct S {
+ constexpr S() { n = 1; }
+ constexpr ~S() { n = 0; }
+ int n;
+ };
+ constexpr void destroy_volatile() {
+ volatile S s;
+ }
+ static_assert((destroy_volatile(), true)); // ok, not volatile during construction and destruction
+
+ constexpr void destroy_null() { // expected-error {{never produces a constant expression}}
+ ((A*)nullptr)->~A(); // expected-note {{destruction of dereferenced null pointer}}
+ }
+
+ constexpr void destroy_past_end() { // expected-error {{never produces a constant expression}}
+ A a;
+ (&a+1)->~A(); // expected-note {{destruction of dereferenced one-past-the-end pointer}}
+ }
+
+ constexpr void destroy_past_end_array() { // expected-error {{never produces a constant expression}}
+ A a[2];
+ a[2].~A(); // expected-note {{destruction of dereferenced one-past-the-end pointer}}
+ }
+
+ union As {
+ A a, b;
+ };
+
+ constexpr void destroy_no_active() { // expected-error {{never produces a constant expression}}
+ As as;
+ as.b.~A(); // expected-note {{destruction of member 'b' of union with no active member}}
+ }
+
+ constexpr void destroy_inactive() { // expected-error {{never produces a constant expression}}
+ As as;
+ as.a.n = 1;
+ as.b.~A(); // expected-note {{destruction of member 'b' of union with active member 'a'}}
+ }
+
+ constexpr void destroy_no_active_2() { // expected-error {{never produces a constant expression}}
+ As as;
+ as.a.n = 1;
+ as.a.~A();
+ // FIXME: This diagnostic is wrong; the union has no active member now.
+ as.b.~A(); // expected-note {{destruction of member 'b' of union with active member 'a'}}
+ }
+
+ constexpr void destroy_pointer() {
+ using T = int*;
+ T p;
+ // We used to think this was an -> member access because its left-hand side
+ // is a pointer. Ensure we don't crash.
+ p.~T();
+ }
+ static_assert((destroy_pointer(), true));
+}
+
+namespace temp_dtor {
+ void f();
+ struct A {
+ bool b;
+ constexpr ~A() { if (b) f(); }
+ };
+
+ // We can't accept either of these unless we start actually registering the
+ // destructors of the A temporaries to run on shutdown. It's unclear what the
+ // intended standard behavior is so we reject this for now.
+ constexpr A &&a = A{false}; // expected-error {{constant}} expected-note {{non-trivial destruction of lifetime-extended temporary}}
+ void f() { a.b = true; }
+
+ constexpr A &&b = A{true}; // expected-error {{constant}} expected-note {{non-trivial destruction of lifetime-extended temporary}}
+
+ // FIXME: We could in prinicple accept this.
+ constexpr const A &c = A{false}; // expected-error {{constant}} expected-note {{non-trivial destruction of lifetime-extended temporary}}
+}
+
+namespace value_dependent_init {
+ struct A {
+ constexpr ~A() {}
+ };
+ template<typename T> void f() {
+ A a = T();
+ }
+}
+
+namespace PR45350 {
+ int q;
+ struct V { int n; int *p = &n; constexpr ~V() { *p = *p * 10 + n; }};
+ constexpr int f(int n) {
+ int k = 0;
+ V *p = new V[n];
+ for (int i = 0; i != n; ++i) {
+ if (p[i].p != &p[i].n) return -1;
+ p[i].n = i;
+ p[i].p = &k;
+ }
+ delete[] p;
+ return k;
+ }
+ // [expr.delete]p6:
+ // In the case of an array, the elements will be destroyed in order of
+ // decreasing address
+ static_assert(f(6) == 543210);
+}
diff --git a/src/llvm-project/clang/test/SemaCXX/constexpr-builtin-bit-cast.cpp b/src/llvm-project/clang/test/SemaCXX/constexpr-builtin-bit-cast.cpp
index d48ee03..06771f8 100644
--- a/src/llvm-project/clang/test/SemaCXX/constexpr-builtin-bit-cast.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/constexpr-builtin-bit-cast.cpp
@@ -61,13 +61,13 @@
constexpr int_splicer splice{0x0C05FEFE, 0xCAFEBABE};
- static_assert(bit_cast<unsigned long long>(splice) == LITTLE_END
- ? 0xCAFEBABE0C05FEFE
- : 0x0C05FEFECAFEBABE);
+ static_assert(bit_cast<unsigned long long>(splice) == (LITTLE_END
+ ? 0xCAFEBABE0C05FEFE
+ : 0x0C05FEFECAFEBABE));
- static_assert(bit_cast<int_splicer>(0xCAFEBABE0C05FEFE).x == LITTLE_END
- ? 0x0C05FEFE
- : 0xCAFEBABE);
+ static_assert(bit_cast<int_splicer>(0xCAFEBABE0C05FEFE).x == (LITTLE_END
+ ? 0x0C05FEFE
+ : 0xCAFEBABE));
static_assert(round_trip<unsigned long long>(splice));
static_assert(round_trip<long long>(splice));
@@ -220,7 +220,7 @@
void test_array_fill() {
constexpr unsigned char a[4] = {1, 2};
constexpr unsigned int i = bit_cast<unsigned int>(a);
- static_assert(i == LITTLE_END ? 0x00000201 : 0x01020000, "");
+ static_assert(i == (LITTLE_END ? 0x00000201 : 0x01020000));
}
typedef decltype(nullptr) nullptr_t;
@@ -381,3 +381,19 @@
return x.a == z.a && x.b == z.b;
}
static_assert(test_pad_buffer());
+
+constexpr unsigned char identity1a = 42;
+constexpr unsigned char identity1b = __builtin_bit_cast(unsigned char, identity1a);
+static_assert(identity1b == 42);
+
+struct IdentityInStruct {
+ unsigned char n;
+};
+constexpr IdentityInStruct identity2a = {42};
+constexpr unsigned char identity2b = __builtin_bit_cast(unsigned char, identity2a.n);
+
+union IdentityInUnion {
+ unsigned char n;
+};
+constexpr IdentityInUnion identity3a = {42};
+constexpr unsigned char identity3b = __builtin_bit_cast(unsigned char, identity3a.n);
diff --git a/src/llvm-project/clang/test/SemaCXX/constexpr-printing.cpp b/src/llvm-project/clang/test/SemaCXX/constexpr-printing.cpp
index 7f6a9c6..ebd91b8 100644
--- a/src/llvm-project/clang/test/SemaCXX/constexpr-printing.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/constexpr-printing.cpp
@@ -41,11 +41,7 @@
expected-note {{in call to 'test_printing(12, 3.976200e+01, 3+4i, 1.290000e+01+3.600000e+00i, &u2.T::arr[4], u2.another.arr[2], {5, 1, 2, 3}, {{{}}, {{}}, &u1.T::arr[2]})'}}
struct V {
- // FIXME: when we can generate these as constexpr constructors, remove the
- // explicit definitions.
- constexpr V() : arr{[255] = 42} {}
- constexpr V(const V &v) : arr{[255] = 42} {}
- int arr[256];
+ int arr[256] = {[255] = 42}; // expected-warning {{C99}}
};
constexpr V v;
constexpr int get(const int *p) { return *p; } // expected-note {{read of dereferenced one-past-the-end pointer}}
diff --git a/src/llvm-project/clang/test/SemaCXX/constexpr-turing-cxx2a.cpp b/src/llvm-project/clang/test/SemaCXX/constexpr-turing-cxx2a.cpp
new file mode 100644
index 0000000..0941cf4
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaCXX/constexpr-turing-cxx2a.cpp
@@ -0,0 +1,66 @@
+// RUN: %clang_cc1 -verify -std=c++2a %s
+// expected-no-diagnostics
+
+const unsigned halt = (unsigned)-1;
+
+enum Dir { L, R };
+struct Action {
+ bool tape;
+ Dir dir;
+ unsigned next;
+};
+using State = Action[2];
+
+// An infinite tape!
+struct Tape {
+ constexpr Tape() = default;
+ constexpr ~Tape() {
+ if (l) { l->r = nullptr; delete l; }
+ if (r) { r->l = nullptr; delete r; }
+ }
+ constexpr Tape *left() {
+ if (!l) { l = new Tape; l->r = this; }
+ return l;
+ }
+ constexpr Tape *right() {
+ if (!r) { r = new Tape; r->l = this; }
+ return r;
+ }
+ Tape *l = nullptr;
+ bool val = false;
+ Tape *r = nullptr;
+};
+
+// Run turing machine 'tm' on tape 'tape' from state 'state'. Return number of
+// steps taken until halt.
+constexpr unsigned run(const State *tm) {
+ Tape *tape = new Tape;
+ unsigned state = 0;
+ unsigned steps = 0;
+
+ for (state = 0; state != halt; ++steps) {
+ auto [val, dir, next_state] = tm[state][tape->val];
+ tape->val = val;
+ tape = (dir == L ? tape->left() : tape->right());
+ state = next_state;
+ }
+
+ delete tape;
+ return steps;
+}
+
+// 3-state busy beaver. S(bb3) = 21.
+constexpr State bb3[] = {
+ { { true, R, 1 }, { true, R, halt } },
+ { { true, L, 1 }, { false, R, 2 } },
+ { { true, L, 2 }, { true, L, 0 } }
+};
+static_assert(run(bb3) == 21, "");
+
+// 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) == 107, "");
diff --git a/src/llvm-project/clang/test/SemaCXX/conversion-function.cpp b/src/llvm-project/clang/test/SemaCXX/conversion-function.cpp
index 1d3593d..1486abe 100644
--- a/src/llvm-project/clang/test/SemaCXX/conversion-function.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/conversion-function.cpp
@@ -211,7 +211,7 @@
// expected-note@-2 {{candidate constructor (the implicit move constructor) not}}
#endif
- explicit X(Y);
+ explicit X(Y); // expected-note {{not a candidate}}
};
Y make_Y();
diff --git a/src/llvm-project/clang/test/SemaCXX/convert-to-bool.cpp b/src/llvm-project/clang/test/SemaCXX/convert-to-bool.cpp
index 117b508..94d9941 100644
--- a/src/llvm-project/clang/test/SemaCXX/convert-to-bool.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/convert-to-bool.cpp
@@ -11,7 +11,7 @@
};
struct ExplicitConvToBool {
- explicit operator bool();
+ explicit operator bool(); // expected-note {{explicit}}
#if __cplusplus <= 199711L // C++03 or earlier modes
// expected-warning@-2{{explicit conversion functions are a C++11 extension}}
#endif
@@ -45,7 +45,7 @@
void accepts_bool(bool) { } // expected-note{{candidate function}}
struct ExplicitConvToRef {
- explicit operator int&();
+ explicit operator int&(); // expected-note {{explicit}}
#if (__cplusplus <= 199711L) // C++03 or earlier modes
// expected-warning@-2{{explicit conversion functions are a C++11 extension}}
#endif
@@ -58,14 +58,14 @@
}
void test_explicit_conv_to_ref(ExplicitConvToRef ecr) {
- int& i1 = ecr; // expected-error{{non-const lvalue reference to type 'int' cannot bind to a value of unrelated type 'ExplicitConvToRef'}}
+ int& i1 = ecr; // expected-error{{no viable conversion from 'ExplicitConvToRef' to 'int'}}
int& i2(ecr); // okay
}
struct A { };
struct B { };
struct C {
- explicit operator A&();
+ explicit operator A&(); // expected-note {{explicit}}
#if __cplusplus <= 199711L // C++03 or earlier modes
// expected-warning@-2{{explicit conversion functions are a C++11 extension}}
#endif
diff --git a/src/llvm-project/clang/test/SemaCXX/converting-constructor.cpp b/src/llvm-project/clang/test/SemaCXX/converting-constructor.cpp
index 75002fa..d66e09e 100644
--- a/src/llvm-project/clang/test/SemaCXX/converting-constructor.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/converting-constructor.cpp
@@ -36,7 +36,7 @@
#endif
public:
- explicit FromShortExplicitly(short s);
+ explicit FromShortExplicitly(short s); // expected-note {{explicit constructor is not a candidate}}
};
void explicit_constructor(short s) {
diff --git a/src/llvm-project/clang/test/SemaCXX/copy-initialization.cpp b/src/llvm-project/clang/test/SemaCXX/copy-initialization.cpp
index cd7e5f0..29c91ba 100644
--- a/src/llvm-project/clang/test/SemaCXX/copy-initialization.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/copy-initialization.cpp
@@ -4,9 +4,9 @@
class X {
public:
- explicit X(const X&); // expected-note {{candidate constructor}}
+ explicit X(const X&); // expected-note 2{{not a candidate}}
X(int*); // expected-note 3{{candidate constructor}}
- explicit X(float*); // expected-note {{candidate constructor}}
+ explicit X(float*); // expected-note {{candidate constructor}} expected-note 2{{not a candidate}}
};
class Y : public X { };
diff --git a/src/llvm-project/clang/test/SemaCXX/coreturn.cpp b/src/llvm-project/clang/test/SemaCXX/coreturn.cpp
index 7265d7c..4d8bfa1 100644
--- a/src/llvm-project/clang/test/SemaCXX/coreturn.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/coreturn.cpp
@@ -88,12 +88,12 @@
int test2() {
co_await a;
-} // expected-warning {{control reaches end of coroutine; which is undefined behavior because the promise type 'std::experimental::coroutine_traits<int>::promise_type' (aka 'promise_int') does not declare 'return_void()'}}
+} // expected-warning {{non-void coroutine does not return a value}}
int test2a(bool b) {
if (b)
co_return 42;
-} // expected-warning {{control may reach end of coroutine; which is undefined behavior because the promise type 'std::experimental::coroutine_traits<int, bool>::promise_type' (aka 'promise_int') does not declare 'return_void()'}}
+} // expected-warning {{non-void coroutine does not return a value in all control paths}}
int test3() {
co_await a;
@@ -107,12 +107,12 @@
void test5(int) {
co_await a;
-} // expected-warning {{control reaches end of coroutine; which is undefined behavior because}}
+} // expected-warning {{non-void coroutine does not return a value}}
void test6(int x) {
if (x)
co_return 42;
-} // expected-warning {{control may reach end of coroutine; which is undefined behavior because}}
+} // expected-warning {{non-void coroutine does not return a value in all control paths}}
void test7(int y) {
if (y)
@@ -132,9 +132,9 @@
VoidTagReturnValue test10() {
co_await a;
-} // expected-warning {{control reaches end of coroutine}}
+} // expected-warning {{non-void coroutine does not return a value}}
VoidTagReturnValue test11(bool b) {
if (b)
co_return 42;
-} // expected-warning {{control may reach end of coroutine}}
+} // expected-warning {{non-void coroutine does not return a value in all control paths}}
diff --git a/src/llvm-project/clang/test/SemaCXX/coroutines.cpp b/src/llvm-project/clang/test/SemaCXX/coroutines.cpp
index c8de7b0..9e94fe8 100644
--- a/src/llvm-project/clang/test/SemaCXX/coroutines.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/coroutines.cpp
@@ -87,6 +87,11 @@
co_await a;
}
+int no_promise_type_multiple_awaits(int) { // expected-error {{this function cannot be a coroutine: 'std::experimental::coroutine_traits<int, int>' has no member named 'promise_type'}}
+ co_await a;
+ co_await a;
+}
+
template <>
struct std::experimental::coroutine_traits<double, double> { typedef int promise_type; };
double bad_promise_type(double) { // expected-error {{this function cannot be a coroutine: 'experimental::coroutine_traits<double, double>::promise_type' (aka 'int') is not a class}}
@@ -726,6 +731,12 @@
[](auto &arg) -> coro<good_promise_1> {
co_await 24;
}("argument");
+ [](auto &arg) ->coro<good_promise_1> { // expected-warning {{expression result unused}}
+ []() -> coro<good_promise_1> {
+ co_await 36;
+ };
+ co_await 48;
+ };
}
template void ok_generic_lambda_coawait_PR41909<int>(); // expected-note {{in instantiation of function template specialization 'ok_generic_lambda_coawait_PR41909<int>' requested here}}
diff --git a/src/llvm-project/clang/test/SemaCXX/cxx0x-defaulted-functions.cpp b/src/llvm-project/clang/test/SemaCXX/cxx0x-defaulted-functions.cpp
index 45a6544..c68b7d6 100644
--- a/src/llvm-project/clang/test/SemaCXX/cxx0x-defaulted-functions.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/cxx0x-defaulted-functions.cpp
@@ -175,7 +175,7 @@
Outer<T>::Inner1<T>::~Inner1() = delete; // expected-error {{nested name specifier 'Outer<T>::Inner1<T>::' for declaration does not refer into a class, class template or class template partial specialization}} expected-error {{only functions can have deleted definitions}}
template<typename T>
- Outer<T>::Inner2<T>::~Inner2() = default; // expected-error {{nested name specifier 'Outer<T>::Inner2<T>::' for declaration does not refer into a class, class template or class template partial specialization}} expected-error {{only special member functions may be defaulted}}
+ Outer<T>::Inner2<T>::~Inner2() = default; // expected-error {{nested name specifier 'Outer<T>::Inner2<T>::' for declaration does not refer into a class, class template or class template partial specialization}}
}
extern "C" { // expected-note {{extern "C" language linkage specification begins here}}
diff --git a/src/llvm-project/clang/test/SemaCXX/cxx0x-initializer-constructor.cpp b/src/llvm-project/clang/test/SemaCXX/cxx0x-initializer-constructor.cpp
index 07a233b..513c670 100644
--- a/src/llvm-project/clang/test/SemaCXX/cxx0x-initializer-constructor.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/cxx0x-initializer-constructor.cpp
@@ -266,7 +266,7 @@
struct A { explicit A(int); A(float); }; // expected-note {{declared here}}
A a = { 0 }; // expected-error {{constructor is explicit}}
- struct B { explicit B(short); B(long); }; // expected-note 4{{candidate}}
+ struct B { explicit B(short); B(long); }; // expected-note 2{{candidate}}
B b = { 0 }; // expected-error {{ambiguous}}
struct C { explicit C(short); C(long); }; // expected-note 2{{candidate}}
@@ -406,6 +406,6 @@
0, 1
}; // expected-error {{ambiguous}} expected-note {{in implicit initialization of array element 2}}
C c2[3] = {
- [0] = 1, [2] = 3
+ [0] = 1, [2] = 3 // expected-warning {{C99}}
}; // expected-error {{ambiguous}} expected-note {{in implicit initialization of array element 1}}
}
diff --git a/src/llvm-project/clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp b/src/llvm-project/clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp
index 9a82ec4..b5d6bd6 100644
--- a/src/llvm-project/clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp
@@ -29,9 +29,9 @@
typedef const _E* iterator;
typedef const _E* const_iterator;
- initializer_list() : __begin_(nullptr), __size_(0) {}
+ constexpr initializer_list() : __begin_(nullptr), __size_(0) {}
- size_t size() const {return __size_;}
+ constexpr size_t size() const {return __size_;}
const _E* begin() const {return __begin_;}
const _E* end() const {return __begin_ + __size_;}
};
@@ -354,3 +354,14 @@
struct Y { using T = std::initializer_list<Y>(*)(); operator T(); };
auto (*y)() = { Y() }; // expected-error {{from initializer list}}
}
+
+namespace designated_init {
+ constexpr auto a = {.a = 1, .b = 2}; // expected-error {{cannot deduce}}
+ constexpr auto b = {[0] = 1, [4] = 2}; // expected-error {{cannot deduce}} expected-warning {{C99}}
+ constexpr auto c = {1, [4] = 2}; // expected-error {{cannot deduce}} expected-warning 2{{C99}} expected-note {{here}}
+ constexpr auto d = {1, [0] = 2}; // expected-error {{cannot deduce}} expected-warning 2{{C99}} expected-note {{here}}
+
+ // If we ever start accepting the above, these assertions should pass.
+ static_assert(c.size() == 5, "");
+ static_assert(d.size() == 1, "");
+}
diff --git a/src/llvm-project/clang/test/SemaCXX/cxx0x-noexcept-expression.cpp b/src/llvm-project/clang/test/SemaCXX/cxx0x-noexcept-expression.cpp
index f1fe01a..f1c6d59 100644
--- a/src/llvm-project/clang/test/SemaCXX/cxx0x-noexcept-expression.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/cxx0x-noexcept-expression.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++2a %s -fexceptions -fcxx-exceptions -Wno-unevaluated-expression
void f(); // expected-note {{possible target for call}}
void f(int); // expected-note {{possible target for call}}
@@ -17,3 +17,66 @@
bool b2 = noexcept(this->g(0));
}
};
+
+void stmt_expr() {
+ static_assert(noexcept(({ 0; })));
+
+ static_assert(!noexcept(({ throw 0; })));
+
+ static_assert(noexcept(({
+ try {
+ throw 0;
+ } catch (...) {
+ }
+ 0;
+ })));
+
+ static_assert(!noexcept(({
+ try {
+ throw 0;
+ } catch (...) {
+ throw;
+ }
+ 0;
+ })));
+
+ static_assert(!noexcept(({
+ try {
+ throw 0;
+ } catch (int) {
+ }
+ 0;
+ })));
+
+ static_assert(!noexcept(({
+ if (false) throw 0;
+ })));
+
+ static_assert(noexcept(({
+ if constexpr (false) throw 0;
+ })));
+
+ static_assert(!noexcept(({
+ if constexpr (false) throw 0; else throw 1;
+ })));
+
+ static_assert(noexcept(({
+ if constexpr (true) 0; else throw 1;
+ })));
+}
+
+void vla(bool b) {
+ static_assert(noexcept(static_cast<int(*)[true ? 41 : 42]>(0)), "");
+ // FIXME: This can't actually throw, but we conservatively assume any VLA
+ // type can throw for now.
+ static_assert(!noexcept(static_cast<int(*)[b ? 41 : 42]>(0)), "");
+ static_assert(!noexcept(static_cast<int(*)[b ? throw : 42]>(0)), "");
+ static_assert(!noexcept(reinterpret_cast<int(*)[b ? throw : 42]>(0)), "");
+ static_assert(!noexcept((int(*)[b ? throw : 42])0), "");
+ static_assert(!noexcept((int(*)[b ? throw : 42]){0}), "");
+}
+
+struct pr_44514 {
+ // expected-error@+1{{value of type 'void' is not contextually convertible to 'bool'}}
+ void foo(void) const &noexcept(f());
+};
diff --git a/src/llvm-project/clang/test/SemaCXX/cxx11-attr-print.cpp b/src/llvm-project/clang/test/SemaCXX/cxx11-attr-print.cpp
index 12b4175..e7c00b7 100644
--- a/src/llvm-project/clang/test/SemaCXX/cxx11-attr-print.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/cxx11-attr-print.cpp
@@ -37,13 +37,15 @@
// CHECK: void bar() __attribute__((__const));
void bar() __attribute__((__const));
-// CHECK: int f1() __attribute__((warn_unused_result));
+// FIXME: It's unfortunate that the string literal prints with the below three
+// cases given that the string is only exposed via the [[nodiscard]] spelling.
+// CHECK: int f1() __attribute__((warn_unused_result("")));
int f1() __attribute__((warn_unused_result));
-// CHECK: {{\[}}[clang::warn_unused_result]];
+// CHECK: {{\[}}[clang::warn_unused_result("")]];
int f2 [[clang::warn_unused_result]] ();
-// CHECK: {{\[}}[gnu::warn_unused_result]];
+// CHECK: {{\[}}[gnu::warn_unused_result("")]];
int f3 [[gnu::warn_unused_result]] ();
// FIXME: ast-print need to print C++11
diff --git a/src/llvm-project/clang/test/SemaCXX/cxx17-compat.cpp b/src/llvm-project/clang/test/SemaCXX/cxx17-compat.cpp
index 3d5420f..b65ed3e 100644
--- a/src/llvm-project/clang/test/SemaCXX/cxx17-compat.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/cxx17-compat.cpp
@@ -1,30 +1,30 @@
// RUN: %clang_cc1 -fsyntax-only -std=c++17 -pedantic -verify %s
-// RUN: %clang_cc1 -fsyntax-only -std=c++2a -Wc++17-compat-pedantic -verify %s -Wno-defaulted-function-deleted
+// RUN: %clang_cc1 -fsyntax-only -std=c++20 -Wc++17-compat-pedantic -verify %s -Wno-defaulted-function-deleted
struct A {};
int (A::*pa)() const&;
int use_pa = (A().*pa)();
#if __cplusplus <= 201703L
- // expected-warning@-2 {{invoking a pointer to a 'const &' member function on an rvalue is a C++2a extension}}
+ // expected-warning@-2 {{invoking a pointer to a 'const &' member function on an rvalue is a C++20 extension}}
#else
- // expected-warning@-4 {{invoking a pointer to a 'const &' member function on an rvalue is incompatible with C++ standards before C++2a}}
+ // expected-warning@-4 {{invoking a pointer to a 'const &' member function on an rvalue is incompatible with C++ standards before C++20}}
#endif
struct B {
void b() {
(void) [=, this] {};
#if __cplusplus <= 201703L
- // expected-warning@-2 {{explicit capture of 'this' with a capture default of '=' is a C++2a extension}}
+ // expected-warning@-2 {{explicit capture of 'this' with a capture default of '=' is a C++20 extension}}
#else
- // expected-warning@-4 {{explicit capture of 'this' with a capture default of '=' is incompatible with C++ standards before C++2a}}
+ // expected-warning@-4 {{explicit capture of 'this' with a capture default of '=' is incompatible with C++ standards before C++20}}
#endif
}
int n : 5 = 0;
#if __cplusplus <= 201703L
- // expected-warning@-2 {{default member initializer for bit-field is a C++2a extension}}
+ // expected-warning@-2 {{default member initializer for bit-field is a C++20 extension}}
#else
- // expected-warning@-4 {{default member initializer for bit-field is incompatible with C++ standards before C++2a}}
+ // expected-warning@-4 {{default member initializer for bit-field is incompatible with C++ standards before C++20}}
#endif
};
@@ -33,14 +33,14 @@
#if __cplusplus <= 201703L
// expected-error@-2 {{no matching constructor}} expected-note@-3 2{{candidate}}
#else
- // expected-warning@-4 {{default construction of lambda is incompatible with C++ standards before C++2a}}
+ // expected-warning@-4 {{default construction of lambda is incompatible with C++ standards before C++20}}
#endif
void copy_lambda() { Lambda = Lambda; }
#if __cplusplus <= 201703L
// expected-error@-2 {{deleted}} expected-note@-10 {{lambda}}
#else
- // expected-warning@-4 {{assignment of lambda is incompatible with C++ standards before C++2a}}
+ // expected-warning@-4 {{assignment of lambda is incompatible with C++ standards before C++20}}
#endif
struct DefaultDeleteWrongTypeBase {
@@ -51,16 +51,16 @@
#if __cplusplus <= 201703L
// expected-error@-2 {{a member or base requires it to be non-const}}
#else
- // expected-warning@-4 {{explicitly defaulting this copy constructor with a type different from the implicit type is incompatible with C++ standards before C++2a}}
+ // expected-warning@-4 {{explicitly defaulting this copy constructor with a type different from the implicit type is incompatible with C++ standards before C++20}}
#endif
};
void ForRangeInit() {
for (int arr[3] = {1, 2, 3}; int n : arr) {}
#if __cplusplus <= 201703L
- // expected-warning@-2 {{range-based for loop initialization statements are a C++2a extension}}
+ // expected-warning@-2 {{range-based for loop initialization statements are a C++20 extension}}
#else
- // expected-warning@-4 {{range-based for loop initialization statements are incompatible with C++ standards before C++2a}}
+ // expected-warning@-4 {{range-based for loop initialization statements are incompatible with C++ standards before C++20}}
#endif
}
@@ -69,22 +69,55 @@
#if __cplusplus <= 201703L
// expected-error@-2 {{virtual function cannot be constexpr}}
#else
- // expected-warning@-4 {{virtual constexpr functions are incompatible with C++ standards before C++2a}}
+ // expected-warning@-4 {{virtual constexpr functions are incompatible with C++ standards before C++20}}
#endif
};
struct C { int x, y, z; };
static auto [cx, cy, cz] = C();
#if __cplusplus <= 201703L
- // expected-warning@-2 {{decomposition declaration declared 'static' is a C++2a extension}}
+ // expected-warning@-2 {{decomposition declaration declared 'static' is a C++20 extension}}
#else
- // expected-warning@-4 {{decomposition declaration declared 'static' is incompatible with C++ standards before C++2a}}
+ // expected-warning@-4 {{decomposition declaration declared 'static' is incompatible with C++ standards before C++20}}
#endif
void f() {
static thread_local auto [cx, cy, cz] = C();
#if __cplusplus <= 201703L
- // expected-warning@-2 {{decomposition declaration declared with 'static thread_local' specifiers is a C++2a extension}}
+ // expected-warning@-2 {{decomposition declaration declared with 'static thread_local' specifiers is a C++20 extension}}
#else
- // expected-warning@-4 {{decomposition declaration declared with 'static thread_local' specifiers is incompatible with C++ standards before C++2a}}
+ // expected-warning@-4 {{decomposition declaration declared with 'static thread_local' specifiers is incompatible with C++ standards before C++20}}
#endif
}
+
+struct DefaultedComparisons {
+ bool operator==(const DefaultedComparisons&) const = default;
+ bool operator!=(const DefaultedComparisons&) const = default;
+#if __cplusplus <= 201703L
+ // expected-warning@-3 {{defaulted comparison operators are a C++20 extension}}
+ // expected-warning@-3 {{defaulted comparison operators are a C++20 extension}}
+#else
+ // expected-warning@-6 {{defaulted comparison operators are incompatible with C++ standards before C++20}}
+ // expected-warning@-6 {{defaulted comparison operators are incompatible with C++ standards before C++20}}
+#endif
+ bool operator<=>(const DefaultedComparisons&) const = default;
+#if __cplusplus <= 201703L
+ // expected-error@-2 {{'operator<=' cannot be the name of a variable or data member}} expected-error@-2 0+{{}} expected-warning@-2 {{}}
+#else
+ // expected-warning@-4 {{'<=>' operator is incompatible with C++ standards before C++20}}
+#endif
+ bool operator<(const DefaultedComparisons&) const = default;
+ bool operator<=(const DefaultedComparisons&) const = default;
+ bool operator>(const DefaultedComparisons&) const = default;
+ bool operator>=(const DefaultedComparisons&) const = default;
+#if __cplusplus <= 201703L
+ // expected-error@-5 {{only special member functions}}
+ // expected-error@-5 {{only special member functions}}
+ // expected-error@-5 {{only special member functions}}
+ // expected-error@-5 {{only special member functions}}
+#else
+ // expected-warning@-10 {{defaulted comparison operators are incompatible with C++ standards before C++20}}
+ // expected-warning@-10 {{defaulted comparison operators are incompatible with C++ standards before C++20}}
+ // expected-warning@-10 {{defaulted comparison operators are incompatible with C++ standards before C++20}}
+ // expected-warning@-10 {{defaulted comparison operators are incompatible with C++ standards before C++20}}
+#endif
+};
diff --git a/src/llvm-project/clang/test/SemaCXX/cxx1y-generic-lambdas-variadics.cpp b/src/llvm-project/clang/test/SemaCXX/cxx1y-generic-lambdas-variadics.cpp
index b8022d2..5c1eb32 100644
--- a/src/llvm-project/clang/test/SemaCXX/cxx1y-generic-lambdas-variadics.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/cxx1y-generic-lambdas-variadics.cpp
@@ -122,3 +122,16 @@
b(Pack<int*, float*>(), 1, 2, 3); // expected-note {{instantiation of}}
}
}
+
+void pr42587() {
+ (void)[](auto... args) -> decltype(args) {}; // expected-error {{type contains unexpanded parameter pack}}
+ (void)[](auto... args, int = args) {}; // expected-error {{default argument contains unexpanded parameter pack}}
+ (void)[](auto... args, decltype(args)) {}; // expected-error {{type contains unexpanded parameter pack}}
+ (void)[](auto... args, decltype(args)...) {}; // (ok)
+ (void)[](auto... args, int = [=] { return args; }()) {}; // expected-error {{default argument contains unexpanded parameter pack}}
+ (void)([]<typename ...T> (T t) {} + ...); // expected-error {{contains unexpanded parameter pack 'T'}} expected-error {{does not contain any unexpanded}} expected-warning 0-2{{extension}}
+ (void)([]<int ...N> (int k = N) {} + ...); // expected-error {{contains unexpanded parameter pack 'N'}} expected-error {{does not contain any unexpanded}} expected-warning 0-2{{extension}}
+ (void)([]<template<typename> typename ...T> (T<int>) {} + ...); // expected-error {{contains unexpanded parameter pack 'T'}} expected-error {{does not contain any unexpanded}} expected-warning 0-3{{extension}}
+}
+
+template<typename ...T> int v = {[...x = T()] { int k = x; } ...}; // expected-error {{contains unexpanded parameter pack 'x'}} expected-error {{does not contain any unexpanded}} expected-warning 0-1{{extension}}
diff --git a/src/llvm-project/clang/test/SemaCXX/cxx1y-generic-lambdas.cpp b/src/llvm-project/clang/test/SemaCXX/cxx1y-generic-lambdas.cpp
index 0879823..13ab7aa 100644
--- a/src/llvm-project/clang/test/SemaCXX/cxx1y-generic-lambdas.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/cxx1y-generic-lambdas.cpp
@@ -181,7 +181,7 @@
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 function [with $0 = int]}}
+ //expected-note{{candidate function [with d:auto = int]}}
char (*fp5)(char) = [](auto e) -> int { return e; }; //expected-error{{no viable conversion}}\
//expected-note{{candidate template ignored}}
diff --git a/src/llvm-project/clang/test/SemaCXX/cxx1y-variable-templates_in_class.cpp b/src/llvm-project/clang/test/SemaCXX/cxx1y-variable-templates_in_class.cpp
index b09305d..a16a5b5 100644
--- a/src/llvm-project/clang/test/SemaCXX/cxx1y-variable-templates_in_class.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/cxx1y-variable-templates_in_class.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -std=c++98 -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 -DCPP1Y
+// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++98 -verify -fsyntax-only %s -Wno-c++11-extensions -Wno-c++1y-extensions -DPRECXX11
+// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++11 -verify -fsyntax-only -Wno-c++1y-extensions %s
+// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++1y -verify -fsyntax-only %s -DCPP1Y
#define CONST const
@@ -395,3 +395,32 @@
}
int &t = B::template n; // expected-error {{use of variable template 'n' requires template arguments}}
}
+
+#ifndef PRECXX11
+namespace template_vars_in_template {
+template <int> struct TakesInt {};
+
+template <class T2>
+struct S {
+ template <class T1>
+ static constexpr int v = 42;
+
+ template <class T>
+ void mf() {
+ constexpr int val = v<T>;
+ }
+
+ void mf2() {
+ constexpr int val = v<char>;
+ TakesInt<val> ti;
+ (void)ti.x; // expected-error{{no member named 'x' in 'template_vars_in_template::TakesInt<42>'}}
+ }
+};
+
+void useit() {
+ S<int> x;
+ x.mf<double>();
+ x.mf2(); // expected-note{{in instantiation of member function 'template_vars_in_template::S<int>::mf2' requested here}}
+}
+}
+#endif
diff --git a/src/llvm-project/clang/test/SemaCXX/cxx1z-class-template-argument-deduction.cpp b/src/llvm-project/clang/test/SemaCXX/cxx1z-class-template-argument-deduction.cpp
index 85312cf..2a3f312 100644
--- a/src/llvm-project/clang/test/SemaCXX/cxx1z-class-template-argument-deduction.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/cxx1z-class-template-argument-deduction.cpp
@@ -507,6 +507,21 @@
}
+namespace PR45124 {
+ class a { int d; };
+ class b : a {};
+
+ struct x { ~x(); };
+ template<typename> class y { y(x = x()); };
+ template<typename z> y(z)->y<z>;
+
+ // Not a constant initializer, but trivial default initialization. We won't
+ // detect this as trivial default initialization if synthesizing the implicit
+ // deduction guide 'template<typename T> y(x = x()) -> Y<T>;' leaves behind a
+ // pending cleanup.
+ __thread b g;
+}
+
#else
// expected-no-diagnostics
diff --git a/src/llvm-project/clang/test/SemaCXX/cxx1z-constexpr-lambdas.cpp b/src/llvm-project/clang/test/SemaCXX/cxx1z-constexpr-lambdas.cpp
index bdf6847..d7ebfdc 100644
--- a/src/llvm-project/clang/test/SemaCXX/cxx1z-constexpr-lambdas.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/cxx1z-constexpr-lambdas.cpp
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -std=c++1z -verify -fsyntax-only -fblocks %s -fcxx-exceptions
+// RUN: %clang_cc1 -std=c++20 -verify -fsyntax-only -fblocks %s -fcxx-exceptions
// RUN: %clang_cc1 -std=c++1z -verify -fsyntax-only -fblocks -fdelayed-template-parsing %s -fcxx-exceptions
// RUN: %clang_cc1 -std=c++14 -verify -fsyntax-only -fblocks %s -DCPP14_AND_EARLIER -fcxx-exceptions
@@ -22,9 +23,40 @@
} // end ns1
namespace ns2 {
- auto L = [](int I) constexpr { asm("non-constexpr"); }; //expected-error{{not allowed in constexpr function}}
+ auto L = [](int I) constexpr { if (I == 5) asm("non-constexpr"); };
+#if __cpp_constexpr < 201907L
+ //expected-warning@-2{{use of this statement in a constexpr function is a C++20 extension}}
+#endif
} // end ns1
+// This is not constexpr until C++20, as the requirements on constexpr
+// functions don't permit try-catch blocks.
+#if __cplusplus <= 201703L
+// expected-error@#try-catch {{constant expression}}
+// expected-note@#try-catch {{non-constexpr function 'operator()'}}
+// expected-note@#try-catch {{declared here}}
+#endif
+constexpr int try_catch = [] { // #try-catch
+ try { return 0; } catch (...) { return 1; }
+}();
+
+// These lambdas have constexpr operator() even though they can never produce a
+// constant expression.
+auto never_constant_1 = [] { // expected-note {{here}}
+ volatile int n = 0;
+ return n;
+};
+auto never_constant_2 = [] () -> int { // expected-note {{here}}
+};
+struct test_never_constant {
+ #if __cplusplus >= 201703L
+ // expected-error@+3 {{non-constexpr declaration of 'operator()' follows constexpr declaration}}
+ // expected-error@+3 {{non-constexpr declaration of 'operator()' follows constexpr declaration}}
+ #endif
+ friend auto decltype(never_constant_1)::operator()() const;
+ friend int decltype(never_constant_2)::operator()() const;
+};
+
} // end ns test_constexpr_checking
namespace test_constexpr_call {
@@ -39,9 +71,16 @@
static_assert(L(3.14) == 3.14);
}
namespace ns3 {
- auto L = [](auto a) { asm("non-constexpr"); return a; }; //expected-note{{declared here}}
+ auto L = [](auto a) { asm("non-constexpr"); return a; };
constexpr int I = //expected-error{{must be initialized by a constant expression}}
- L(3); //expected-note{{non-constexpr function}}
+ L(3);
+#if __cpp_constexpr < 201907L
+//expected-note@-2{{non-constexpr function}}
+//expected-note@-5{{declared here}}
+#else
+//expected-note@-7{{subexpression not valid in a constant expression}}
+//expected-note@-6{{in call to}}
+#endif
}
} // end ns test_constexpr_call
@@ -138,7 +177,7 @@
namespace contained_lambdas_call_operator_is_not_constexpr {
constexpr auto f(int i) {
double d = 3.14;
- auto L = [=](auto a) { //expected-note{{declared here}}
+ auto L = [=](auto a) {
int Isz = sizeof(i);
asm("hello");
return sizeof(i) + sizeof(a) + sizeof(d);
@@ -149,8 +188,14 @@
constexpr auto L = f(3);
constexpr auto M = // expected-error{{must be initialized by}}
- L("abc"); //expected-note{{non-constexpr function}}
-
+ L("abc");
+#if __cpp_constexpr < 201907L
+//expected-note@-2{{non-constexpr function}}
+//expected-note@-14{{declared here}}
+#else
+//expected-note@-14{{subexpression not valid in a constant expression}}
+//expected-note@-6{{in call to}}
+#endif
} // end ns contained_lambdas_call_operator_is_not_constexpr
diff --git a/src/llvm-project/clang/test/SemaCXX/cxx1z-decomposition.cpp b/src/llvm-project/clang/test/SemaCXX/cxx1z-decomposition.cpp
index d2dc939..336c103 100644
--- a/src/llvm-project/clang/test/SemaCXX/cxx1z-decomposition.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/cxx1z-decomposition.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++1z -verify %s
+// RUN: %clang_cc1 -std=c++17 -verify %s
void use_from_own_init() {
auto [a] = a; // expected-error {{binding 'a' cannot appear in the initializer of its own decomposition declaration}}
@@ -83,7 +83,7 @@
struct PR37352 {
int n;
- void f() { static auto [a] = *this; } // expected-warning {{C++2a extension}}
+ void f() { static auto [a] = *this; } // expected-warning {{C++20 extension}}
};
namespace instantiate_template {
diff --git a/src/llvm-project/clang/test/SemaCXX/cxx2a-compat.cpp b/src/llvm-project/clang/test/SemaCXX/cxx2a-compat.cpp
index c8d22b7..de9d444 100644
--- a/src/llvm-project/clang/test/SemaCXX/cxx2a-compat.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/cxx2a-compat.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -fsyntax-only -std=c++17 -Wc++2a-compat-pedantic -verify %s
-// RUN: %clang_cc1 -fsyntax-only -std=c++2a -pedantic -verify %s
+// RUN: %clang_cc1 -fsyntax-only -std=c++17 -Wc++20-compat-pedantic -verify %s
+// RUN: %clang_cc1 -fsyntax-only -std=c++20 -pedantic -verify %s
struct A { // expected-note 0+{{candidate}}
A() = default; // expected-note 0+{{candidate}}
@@ -7,7 +7,7 @@
};
A a1 = {1, 2};
#if __cplusplus <= 201703L
- // expected-warning@-2 {{aggregate initialization of type 'A' with user-declared constructors is incompatible with C++2a}}
+ // expected-warning@-2 {{aggregate initialization of type 'A' with user-declared constructors is incompatible with C++20}}
#else
// expected-error@-4 {{no matching constructor}}
#endif
@@ -17,7 +17,7 @@
B b1 = {{}, {}}; // ok
B b2 = {1, 2, 3, 4};
#if __cplusplus <= 201703L
- // expected-warning@-2 2{{aggregate initialization of type 'A' with user-declared constructors is incompatible with C++2a}}
+ // expected-warning@-2 2{{aggregate initialization of type 'A' with user-declared constructors is incompatible with C++20}}
#else
// expected-error@-4 2{{no viable conversion from 'int' to 'A'}}
#endif
@@ -43,7 +43,7 @@
explicit(C)(int);
};
#if __cplusplus <= 201703L
-// expected-warning@-3 {{this expression will be parsed as explicit(bool) in C++2a}}
+// expected-warning@-3 {{this expression will be parsed as explicit(bool) in C++20}}
#if defined(__cpp_conditional_explicit)
#error "the feature test macro __cpp_conditional_explicit isn't correct"
#endif
@@ -61,8 +61,8 @@
auto l = []() consteval {};
int consteval();
#if __cplusplus <= 201703L
-// expected-warning@-3 {{'consteval' is a keyword in C++2a}}
+// expected-warning@-3 {{'consteval' is a keyword in C++20}}
// expected-error@-4 {{expected body of lambda expression}}
#else
// expected-error@-5 {{expected unqualified-id}}
-#endif
\ No newline at end of file
+#endif
diff --git a/src/llvm-project/clang/test/SemaCXX/cxx2a-consteval.cpp b/src/llvm-project/clang/test/SemaCXX/cxx2a-consteval.cpp
index c531b92..3b52ed4 100644
--- a/src/llvm-project/clang/test/SemaCXX/cxx2a-consteval.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/cxx2a-consteval.cpp
@@ -27,7 +27,7 @@
}
consteval A(int i);
consteval A() = default;
- consteval ~A() = default; // expected-error {{destructor cannot be marked consteval}}
+ consteval ~A() = default;
};
consteval struct B {}; // expected-error {{struct cannot be marked consteval}}
@@ -45,11 +45,17 @@
struct C {
C() {}
+ ~C() {}
};
struct D {
C c;
consteval D() = default; // expected-error {{cannot be consteval}}
+ consteval ~D() = default; // expected-error {{cannot be consteval}}
+};
+
+struct E : C { // expected-note {{here}}
+ consteval ~E() {} // expected-error {{cannot be declared consteval because base class 'basic_sema::C' does not have a constexpr destructor}}
};
}
diff --git a/src/llvm-project/clang/test/SemaCXX/cxx2a-constexpr-dynalloc.cpp b/src/llvm-project/clang/test/SemaCXX/cxx2a-constexpr-dynalloc.cpp
new file mode 100644
index 0000000..3647526
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaCXX/cxx2a-constexpr-dynalloc.cpp
@@ -0,0 +1,178 @@
+// RUN: %clang_cc1 -std=c++2a -verify %s -DNEW=__builtin_operator_new -DDELETE=__builtin_operator_delete
+// RUN: %clang_cc1 -std=c++2a -verify %s "-DNEW=operator new" "-DDELETE=operator delete"
+// RUN: %clang_cc1 -std=c++2a -verify %s "-DNEW=::operator new" "-DDELETE=::operator delete"
+
+constexpr bool alloc_from_user_code() {
+ void *p = NEW(sizeof(int)); // expected-note {{cannot allocate untyped memory in a constant expression; use 'std::allocator<T>::allocate'}}
+ DELETE(p);
+ return true;
+}
+static_assert(alloc_from_user_code()); // expected-error {{constant expression}} expected-note {{in call}}
+
+namespace std {
+ using size_t = decltype(sizeof(0));
+ // FIXME: It would be preferable to point these notes at the location of the call to allocator<...>::[de]allocate instead
+ template<typename T> struct allocator {
+ constexpr T *allocate(size_t N) {
+ return (T*)NEW(sizeof(T) * N); // expected-note 3{{heap allocation}} expected-note {{not deallocated}}
+ }
+ constexpr void deallocate(void *p) {
+ DELETE(p); // expected-note 2{{'std::allocator<...>::deallocate' used to delete pointer to object allocated with 'new'}}
+ }
+ };
+}
+
+constexpr bool alloc_via_std_allocator() {
+ std::allocator<int> alloc;
+ int *p = alloc.allocate(1);
+ alloc.deallocate(p);
+ return true;
+}
+static_assert(alloc_via_std_allocator());
+
+template<> struct std::allocator<void()> {
+ constexpr void *allocate() { return NEW(8); } // expected-note {{cannot allocate memory of function type 'void ()'}}
+};
+constexpr void *fn = std::allocator<void()>().allocate(); // expected-error {{constant expression}} expected-note {{in call}}
+
+struct Incomplete;
+template<> struct std::allocator<Incomplete> {
+ constexpr void *allocate() { return NEW(8); } // expected-note {{cannot allocate memory of incomplete type 'Incomplete'}}
+};
+constexpr void *incomplete = std::allocator<Incomplete>().allocate(); // expected-error {{constant expression}} expected-note {{in call}}
+
+struct WrongSize { char x[5]; };
+static_assert(sizeof(WrongSize) == 5);
+template<> struct std::allocator<WrongSize> {
+ constexpr void *allocate() { return NEW(7); } // expected-note {{allocated size 7 is not a multiple of size 5 of element type 'WrongSize'}}
+};
+constexpr void *wrong_size = std::allocator<WrongSize>().allocate(); // expected-error {{constant expression}} expected-note {{in call}}
+
+constexpr bool mismatched(int alloc_kind, int dealloc_kind) {
+ int *p;
+ switch (alloc_kind) {
+ case 0:
+ p = new int; // expected-note {{heap allocation}}
+ break;
+ case 1:
+ p = new int[1]; // expected-note {{heap allocation}}
+ break;
+ case 2:
+ p = std::allocator<int>().allocate(1);
+ break;
+ }
+ switch (dealloc_kind) {
+ case 0:
+ delete p; // expected-note {{'delete' used to delete pointer to object allocated with 'std::allocator<...>::allocate'}}
+ break;
+ case 1:
+ delete[] p; // expected-note {{'delete' used to delete pointer to object allocated with 'std::allocator<...>::allocate'}}
+ break;
+ case 2:
+ std::allocator<int>().deallocate(p); // expected-note 2{{in call}}
+ break;
+ }
+ return true;
+}
+static_assert(mismatched(0, 2)); // expected-error {{constant expression}} expected-note {{in call}}
+static_assert(mismatched(1, 2)); // expected-error {{constant expression}} expected-note {{in call}}
+static_assert(mismatched(2, 0)); // expected-error {{constant expression}} expected-note {{in call}}
+static_assert(mismatched(2, 1)); // expected-error {{constant expression}} expected-note {{in call}}
+static_assert(mismatched(2, 2));
+
+constexpr int *escape = std::allocator<int>().allocate(3); // expected-error {{constant expression}} expected-note {{pointer to subobject of heap-allocated}}
+constexpr int leak = (std::allocator<int>().allocate(3), 0); // expected-error {{constant expression}}
+constexpr int no_lifetime_start = (*std::allocator<int>().allocate(1) = 1); // expected-error {{constant expression}} expected-note {{assignment to object outside its lifetime}}
+
+void *operator new(std::size_t, void *p) { return p; }
+constexpr bool no_placement_new_in_user_code() { // expected-error {{never produces a constant expression}}
+ int a;
+ new (&a) int(42); // expected-note {{call to placement 'operator new'}}
+ return a == 42;
+}
+
+namespace std {
+ constexpr bool placement_new_in_stdlib() {
+ int a;
+ new (&a) int(42);
+ return a == 42;
+ }
+}
+static_assert(std::placement_new_in_stdlib());
+
+namespace std {
+ template<typename T, typename ...Args>
+ constexpr void construct_at(void *p, Args &&...args) {
+ new (p) T((Args&&)args...); // #new
+ }
+}
+
+constexpr bool call_std_construct_at() {
+ int *p = std::allocator<int>().allocate(3);
+ std::construct_at<int>(p, 1);
+ std::construct_at<int>(p + 1, 2);
+ std::construct_at<int>(p + 2, 3);
+ bool good = p[0] + p[1] + p[2] == 6;
+ std::allocator<int>().deallocate(p);
+ return good;
+}
+static_assert(call_std_construct_at());
+
+constexpr bool bad_construct_at_type() {
+ int a;
+ // expected-note@#new {{placement new would change type of storage from 'int' to 'float'}}
+ std::construct_at<float>(&a, 1.0f); // expected-note {{in call}}
+ return true;
+}
+static_assert(bad_construct_at_type()); // expected-error{{}} expected-note {{in call}}
+
+constexpr bool bad_construct_at_subobject() {
+ struct X { int a, b; };
+ union A {
+ int a;
+ X x;
+ };
+ A a = {1};
+ // expected-note@#new {{construction of subobject of member 'x' of union with active member 'a' is not allowed in a constant expression}}
+ std::construct_at<int>(&a.x.a, 1); // expected-note {{in call}}
+ return true;
+}
+static_assert(bad_construct_at_subobject()); // expected-error{{}} expected-note {{in call}}
+
+constexpr bool change_union_member() {
+ union U {
+ int a;
+ int b;
+ };
+ U u = {.a = 1};
+ std::construct_at<int>(&u.b, 2);
+ return u.b == 2;
+}
+static_assert(change_union_member());
+
+int external;
+// expected-note@#new {{visible outside}}
+static_assert((std::construct_at<int>(&external, 1), true)); // expected-error{{}} expected-note {{in call}}
+
+constexpr int &&temporary = 0; // expected-note {{created here}}
+// expected-note@#new {{construction of temporary is not allowed in a constant expression outside the expression that created the temporary}}
+static_assert((std::construct_at<int>(&temporary, 1), true)); // expected-error{{}} expected-note {{in call}}
+
+constexpr bool construct_after_lifetime() {
+ int *p = new int;
+ delete p;
+ // expected-note@#new {{construction of heap allocated object that has been deleted}}
+ std::construct_at<int>(p); // expected-note {{in call}}
+ return true;
+}
+static_assert(construct_after_lifetime()); // expected-error {{}} expected-note {{in call}}
+
+constexpr bool construct_after_lifetime_2() {
+ struct A { struct B {} b; };
+ A a;
+ a.~A();
+ std::construct_at<A::B>(&a.b); // expected-note {{in call}}
+ // expected-note@#new {{construction of subobject of object outside its lifetime is not allowed in a constant expression}}
+ return true;
+}
+static_assert(construct_after_lifetime_2()); // expected-error {{}} expected-note {{in call}}
diff --git a/src/llvm-project/clang/test/SemaCXX/cxx2a-explicit-bool.cpp b/src/llvm-project/clang/test/SemaCXX/cxx2a-explicit-bool.cpp
index 1c532cf..4538597 100644
--- a/src/llvm-project/clang/test/SemaCXX/cxx2a-explicit-bool.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/cxx2a-explicit-bool.cpp
@@ -1,3 +1,4 @@
+// RUN: %clang_cc1 -std=c++17 -fsyntax-only %s -verify -Wno-c++2a-extensions
// RUN: %clang_cc1 -std=c++2a -fsyntax-only %s -verify
template <bool b, auto val> struct enable_ifv {};
@@ -55,8 +56,8 @@
// expected-note@-1 {{candidate constructor}} expected-note@-1 {{candidate constructor}}
// expected-note@-2 {{candidate constructor}} expected-note@-2 {{candidate constructor}}
explicit(a == 0)
-C(int),
-C(double);
+C(int), // expected-note 2{{not a candidate}}
+C(double); // expected-note 2{{not a candidate}}
};
C<0> c0 = 0.0; // expected-error {{no viable conversion}}
@@ -105,7 +106,7 @@
struct A {
// expected-note@-1+ {{candidate constructor}}
// expected-note@-2+ {{candidate function}}
- explicit(b) A(int, int = 0);
+ explicit(b) A(int, int = 0); // expected-note {{not a candidate}}
// expected-note@-1+ {{explicit constructor declared here}}
};
@@ -154,10 +155,9 @@
// expected-note@-2 {{candidate constructor}} expected-note@-2 {{candidate constructor}}
template<typename T2>
explicit(a ^ is_same<T1, T2>::value)
- // expected-note@-1+ {{explicit(bool) specifier resolved to true}}
A(T2) {}
// expected-note@-1+ {{explicit constructor declared here}}
- // expected-note@-2+ {{candidate constructor ignored}}
+ // expected-note@-2+ {{not a candidate}}
};
A<true, int> a0 = 0.0; // expected-error {{no viable conversion}}
@@ -196,17 +196,15 @@
// expected-note@-1+ {{candidate constructor}}
template<typename T>
explicit(enable_ifv<is_same<int, T>::value, a>::value)
- //expected-note@-1 {{explicit(bool) specifier resolved to true}}
A(T) {}
// expected-note@-1+ {{substitution failure}}
- // expected-note@-2 {{candidate constructor ignored}}
+ // expected-note@-2 {{not a candidate}}
// expected-note@-3 {{explicit constructor declared here}}
template<typename T, bool c = true>
explicit(enable_ifv<is_same<bool, T>::value, a>::value)
- //expected-note@-1 {{explicit(bool) specifier resolved to true}}
A(T) {}
// expected-note@-1+ {{substitution failure}}
- // expected-note@-2 {{candidate constructor ignored}}
+ // expected-note@-2 {{not a candidate}}
// expected-note@-3 {{explicit constructor declared here}}
};
@@ -236,7 +234,7 @@
template<bool a>
struct A {
- explicit(a) operator int ();
+ explicit(a) operator int (); // expected-note+ {{not a candidate}}
};
template<bool a>
@@ -293,10 +291,9 @@
struct A {
template<typename T2>
explicit(enable_ifv<is_same<B, T2>::value, a>::value)
- // expected-note@-1+ {{explicit(bool) specifier resolved to true}}
operator T2() { return T2(); };
// expected-note@-1+ {{substitution failure}}
- // expected-note@-2+ {{candidate conversion}}
+ // expected-note@-2+ {{not a candidate}}
};
A<false> A_false;
@@ -348,9 +345,8 @@
// expected-note@-2+ {{candidate function}}
template<typename ... Ts>
explicit((is_same<T, Ts>::value && ...))
- // expected-note@-1 {{explicit(bool) specifier resolved to true}}
A(Ts...);
- // expected-note@-1 {{candidate constructor}}
+ // expected-note@-1 {{not a candidate}}
// expected-note@-2 {{explicit constructor}}
};
@@ -517,8 +513,8 @@
template<bool b>
struct Z {
explicit(b) operator X() const;
- explicit(b) operator Y() const;
- explicit(b) operator int() const;
+ explicit(b) operator Y() const; // expected-note 2{{not a candidate}}
+ explicit(b) operator int() const; // expected-note {{not a candidate}}
};
void testExplicit()
@@ -559,9 +555,7 @@
struct C {
template<typename T>
explicit(!is_same<T1, T>::value)
- // expected-note@-1+ {{explicit(bool) specifier resolved to true}}
- operator T();
- // expected-note@-1+ {{candidate conversion operator ignored}}
+ operator T(); // expected-note+ {{explicit conversion function is not a candidate}}
};
using Bool = C<bool>;
@@ -684,10 +678,9 @@
struct A {
// expected-note@-1+ {{candidate template ignored}}
explicit(!is_same<T1, T2>::value)
- // expected-note@-1+ {{explicit(bool) specifier resolved to true}}
A(T1 = 0, T2 = 0) {}
- // expected-note@-1 {{explicit constructor}}
- // expected-note@-2+ {{candidate deductiong guide ignored}}
+ // expected-note@-1 {{explicit constructor declared here}}
+ // expected-note@-2 2{{explicit constructor is not a candidate}}
};
A a0 = 0;
@@ -717,3 +710,20 @@
A d3 = {0.0, 0.0};// expected-error {{explicit deduction guide}}
}
+
+namespace PR42980 {
+using size_t = decltype(sizeof(0));
+
+struct Str {// expected-note+ {{candidate constructor}}
+ template <size_t N>
+ explicit(N > 7)
+ Str(char const (&str)[N]); // expected-note {{explicit constructor is not a candidate}}
+};
+
+template <size_t N>
+Str::Str(char const(&str)[N]) { }
+
+Str a = "short";
+Str b = "not so short";// expected-error {{no viable conversion}}
+
+}
diff --git a/src/llvm-project/clang/test/SemaCXX/cxx2a-initializer-aggregates.cpp b/src/llvm-project/clang/test/SemaCXX/cxx2a-initializer-aggregates.cpp
index 9c438d3..653fcf4 100644
--- a/src/llvm-project/clang/test/SemaCXX/cxx2a-initializer-aggregates.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/cxx2a-initializer-aggregates.cpp
@@ -1,12 +1,18 @@
-// RUN: %clang_cc1 -std=c++2a %s -verify
+// RUN: %clang_cc1 -std=c++20 %s -verify=cxx20,expected,pedantic,override,reorder -pedantic-errors
+// RUN: %clang_cc1 -std=c++17 %s -verify=expected,pedantic,override,reorder -Wno-c++20-designator -pedantic-errors
+// RUN: %clang_cc1 -std=c++20 %s -verify=cxx20,expected,pedantic -Werror=c99-designator -Wno-reorder-init-list -Wno-initializer-overrides
+// RUN: %clang_cc1 -std=c++20 %s -verify=cxx20,expected,reorder -Wno-c99-designator -Werror=reorder-init-list -Wno-initializer-overrides
+// RUN: %clang_cc1 -std=c++20 %s -verify=cxx20,expected,override -Wno-c99-designator -Wno-reorder-init-list -Werror=initializer-overrides
+// RUN: %clang_cc1 -std=c++20 %s -verify=cxx20,expected -Wno-c99-designator -Wno-reorder-init-list -Wno-initializer-overrides
+
namespace class_with_ctor {
- struct A { // expected-note 6{{candidate}}
- A() = default; // expected-note 3{{candidate}}
+ struct A { // cxx20-note 6{{candidate}}
+ A() = default; // cxx20-note 3{{candidate}}
int x;
int y;
};
- A a = {1, 2}; // expected-error {{no matching constructor}}
+ A a = {1, 2}; // cxx20-error {{no matching constructor}}
struct B {
int x;
@@ -19,5 +25,107 @@
A a;
};
C c1 = {{}, {}}; // ok, call default ctor twice
- C c2 = {{1, 2}, {3, 4}}; // expected-error 2{{no matching constructor}}
+ C c2 = {{1, 2}, {3, 4}}; // cxx20-error 2{{no matching constructor}}
+}
+
+namespace designator {
+struct A { int x, y; };
+struct B { A a; };
+
+A a1 = {
+ .y = 1, // reorder-note {{previous initialization for field 'y' is here}}
+ .x = 2 // reorder-error {{ISO C++ requires field designators to be specified in declaration order; field 'y' will be initialized after field 'x'}}
+};
+int arr[3] = {[1] = 5}; // pedantic-error {{array designators are a C99 extension}}
+B b = {.a.x = 0}; // pedantic-error {{nested designators are a C99 extension}}
+A a2 = {
+ .x = 1, // pedantic-error {{mixture of designated and non-designated initializers in the same initializer list is a C99 extension}}
+ 2 // pedantic-note {{first non-designated initializer is here}}
+};
+A a3 = {
+ 1, // pedantic-note {{first non-designated initializer is here}}
+ .y = 2 // pedantic-error {{mixture of designated and non-designated initializers in the same initializer list is a C99 extension}}
+};
+A a4 = {
+ .x = 1, // override-note {{previous}}
+ .x = 1 // override-error {{overrides prior initialization}}
+};
+A a5 = {
+ .y = 1, // override-note {{previous}}
+ .y = 1 // override-error {{overrides prior initialization}}
+};
+struct C { int :0, x, :0, y, :0; };
+C c = {
+ .x = 1, // override-note {{previous}}
+ .x = 1, // override-error {{overrides prior initialization}} override-note {{previous}}
+ .y = 1, // override-note {{previous}}
+ .y = 1, // override-error {{overrides prior initialization}}
+ .x = 1, // reorder-error {{declaration order}} override-error {{overrides prior initialization}} override-note {{previous}}
+ .x = 1, // override-error {{overrides prior initialization}}
+};
+}
+
+namespace base_class {
+ struct base {
+ int x;
+ };
+ struct derived : base {
+ int y;
+ };
+ derived d = {.x = 1, .y = 2}; // expected-error {{'x' does not refer to any field}}
+}
+
+namespace union_ {
+ union U { int a, b; };
+ U u = {
+ .a = 1, // override-note {{here}}
+ .b = 2, // override-error {{overrides prior}}
+ };
+}
+
+namespace overload_resolution {
+ struct A { int x, y; };
+ union B { int x, y; };
+
+ void f(A a);
+ void f(B b) = delete;
+ void g() { f({.x = 1, .y = 2}); } // ok, calls non-union overload
+
+ // As an extension of the union case, overload resolution won't pick any
+ // candidate where a field initializer would be overridden.
+ struct A2 { int x, other, y; };
+ int f(A2);
+ void g2() { int k = f({.x = 1, 2, .y = 3}); (void)k; } // pedantic-error {{mixture of designated and non-designated}} pedantic-note {{here}}
+
+ struct C { int x; };
+ void h(A a); // expected-note {{candidate}}
+ void h(C c); // expected-note {{candidate}}
+ void i() {
+ h({.x = 1, .y = 2});
+ h({.y = 1, .x = 2}); // reorder-error {{declaration order}} reorder-note {{previous}}
+ h({.x = 1}); // expected-error {{ambiguous}}
+ }
+
+ struct D { int y, x; };
+ void j(A a); // expected-note {{candidate}}
+ void j(D d); // expected-note {{candidate}}
+ void k() {
+ j({.x = 1, .y = 2}); // expected-error {{ambiguous}}
+ }
+}
+
+namespace deduction {
+ struct A { int x, y; };
+ union B { int x, y; };
+
+ template<typename T, typename U> void f(decltype(T{.x = 1, .y = 2}) = {});
+ template<typename T, typename U> void f(decltype(U{.x = 1, .y = 2}) = {}) = delete;
+ void g() { f<A, B>(); } // ok, calls non-union overload
+
+ struct C { int y, x; };
+ template<typename T, typename U> void h(decltype(T{.y = 1, .x = 2}) = {}) = delete;
+ template<typename T, typename U> void h(decltype(U{.y = 1, .x = 2}) = {});
+ void i() {
+ h<A, C>(); // ok, selects C overload by SFINAE
+ }
}
diff --git a/src/llvm-project/clang/test/SemaCXX/cxx2a-three-way-comparison.cpp b/src/llvm-project/clang/test/SemaCXX/cxx2a-three-way-comparison.cpp
index eb1480c..29ae950 100644
--- a/src/llvm-project/clang/test/SemaCXX/cxx2a-three-way-comparison.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/cxx2a-three-way-comparison.cpp
@@ -1,5 +1,14 @@
// RUN: %clang_cc1 -std=c++2a -verify %s
+// Keep this test before any declarations of operator<=>.
+namespace PR44786 {
+ template<typename T> void f(decltype(T{} <=> T{})) {} // expected-note {{previous}}
+
+ struct S {};
+ int operator<=>(S const &, S const &);
+ template<typename T> void f(decltype(T{} <=> T{})) {} // expected-error {{redefinition}}
+}
+
struct A {};
constexpr int operator<=>(A a, A b) { return 42; }
static_assert(operator<=>(A(), A()) == 42);
diff --git a/src/llvm-project/clang/test/SemaCXX/cxx98-compat.cpp b/src/llvm-project/clang/test/SemaCXX/cxx98-compat.cpp
index 885ab11..e221259 100644
--- a/src/llvm-project/clang/test/SemaCXX/cxx98-compat.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/cxx98-compat.cpp
@@ -1,5 +1,6 @@
// RUN: %clang_cc1 -fsyntax-only -std=c++11 -Wc++98-compat -verify %s
// RUN: %clang_cc1 -fsyntax-only -std=c++14 -Wc++98-compat -verify %s -DCXX14COMPAT
+// RUN: %clang_cc1 -fsyntax-only -std=c++17 -Wc++98-compat -verify %s -DCXX14COMPAT -DCXX17COMPAT
namespace std {
struct type_info;
@@ -180,12 +181,16 @@
struct {} obj_of_unnamed_type; // expected-note {{here}}
int UnnamedTemplateArg = TemplateFn(obj_of_unnamed_type); // expected-warning {{unnamed type as template argument is incompatible with C++98}}
+// FIXME: We do not implement C++98 compatibility warnings for the C++17
+// template argument evaluation rules.
+#ifndef CXX17COMPAT
namespace RedundantParensInAddressTemplateParam {
int n;
template<int*p> struct S {};
S<(&n)> s; // expected-warning {{redundant parentheses surrounding address non-type template argument are incompatible with C++98}}
S<(((&n)))> t; // expected-warning {{redundant parentheses surrounding address non-type template argument are incompatible with C++98}}
}
+#endif
namespace TemplateSpecOutOfScopeNs {
template<typename T> struct S {};
@@ -299,6 +304,9 @@
const wchar_t *s2 = L"bar\u0085"; // expected-warning {{universal character name referring to a control character is incompatible with C++98}}
}
+// FIXME: We do not implement C++98 compatibility warnings for the C++17
+// template argument evaluation rules.
+#ifndef CXX17COMPAT
namespace NonTypeTemplateArgs {
template<typename T, T v> struct S {};
const int k = 5; // expected-note {{here}}
@@ -314,6 +322,7 @@
X<(int*)0> x; // expected-warning {{use of null pointer as non-type template argument is incompatible with C++98}}
Y<(int A::*)0> y; // expected-warning {{use of null pointer as non-type template argument is incompatible with C++98}}
}
+#endif
namespace PR13480 {
struct basic_iterator {
@@ -400,3 +409,11 @@
#ifdef CXX14COMPAT
int digit_seps = 123'456; // expected-warning {{digit separators are incompatible with C++ standards before C++14}}
#endif
+
+#ifdef CXX17COMPAT
+template<class T> struct CTAD {};
+void ctad_test() {
+ CTAD<int> s;
+ CTAD t = s; // expected-warning {{class template argument deduction is incompatible with C++ standards before C++17}}
+}
+#endif
diff --git a/src/llvm-project/clang/test/SemaCXX/declspec-selectany.cpp b/src/llvm-project/clang/test/SemaCXX/declspec-selectany.cpp
new file mode 100644
index 0000000..7e64a29
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaCXX/declspec-selectany.cpp
@@ -0,0 +1,18 @@
+// RUN: %clang_cc1 -std=c++14 %s -triple x86_64-windows-msvc -fdeclspec -verify
+// RUN: %clang_cc1 -std=c++17 %s -triple x86_64-windows-msvc -fdeclspec -verify
+// RUN: %clang_cc1 -std=c++14 %s -triple x86_64-scei-ps4 -fdeclspec -verify
+
+// MSVC emits this error too.
+const int __declspec(selectany) test1 = 0; // expected-error {{'selectany' can only be applied to data items with external linkage}}
+
+extern const int test2;
+const int test2 = 42; // expected-note {{previous definition is here}}
+extern __declspec(selectany) const int test2; // expected-warning {{attribute declaration must precede definition}}
+
+extern const int test3;
+const int __declspec(selectany) test3 = 42; // Standard usage.
+
+struct Test4 {
+ static constexpr int sdm = 0;
+};
+__declspec(selectany) constexpr int Test4::sdm; // no warning
diff --git a/src/llvm-project/clang/test/SemaCXX/decltype.cpp b/src/llvm-project/clang/test/SemaCXX/decltype.cpp
index 2956f9a..f06ca22 100644
--- a/src/llvm-project/clang/test/SemaCXX/decltype.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/decltype.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify -Wno-c99-designator %s
// PR5290
int const f0();
@@ -80,22 +80,22 @@
struct P1 { char x[6]; } g1 = { "foo" };
struct LP1 { struct P1 p1; };
- // expected-warning@+3 {{subobject initialization overrides}}
+ // expected-warning@+3 {{initializer partially overrides}}
// expected-note@+2 {{previous initialization}}
// expected-note@+1 {{previous definition}}
template<class T> void foo(decltype(T(LP1{ .p1 = g1, .p1.x[1] = 'x' }))) {}
- // expected-warning@+3 {{subobject initialization overrides}}
+ // expected-warning@+3 {{initializer partially overrides}}
// expected-note@+2 {{previous initialization}}
template<class T>
void foo(decltype(T(LP1{ .p1 = g1, .p1.x[1] = 'r' }))) {} // okay
- // expected-warning@+3 {{subobject initialization overrides}}
+ // expected-warning@+3 {{initializer partially overrides}}
// expected-note@+2 {{previous initialization}}
template<class T>
void foo(decltype(T(LP1{ .p1 = { "foo" }, .p1.x[1] = 'x'}))) {} // okay
- // expected-warning@+3 {{subobject initialization overrides}}
+ // expected-warning@+3 {{initializer partially overrides}}
// expected-note@+2 {{previous initialization}}
// expected-error@+1 {{redefinition of 'foo'}}
template<class T> void foo(decltype(T(LP1{ .p1 = g1, .p1.x[1] = 'x' }))) {}
diff --git a/src/llvm-project/clang/test/SemaCXX/default1.cpp b/src/llvm-project/clang/test/SemaCXX/default1.cpp
index 3bc6f83..457cada 100644
--- a/src/llvm-project/clang/test/SemaCXX/default1.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/default1.cpp
@@ -31,7 +31,7 @@
// expected-note@-2 2 {{candidate constructor (the implicit move constructor) not viable}}
#endif
- explicit Y(int);
+ explicit Y(int); // expected-note 2{{explicit constructor is not a candidate}}
};
void k(Y y = 17); // expected-error{{no viable conversion}} \
diff --git a/src/llvm-project/clang/test/SemaCXX/deprecated-copy.cpp b/src/llvm-project/clang/test/SemaCXX/deprecated-copy.cpp
new file mode 100644
index 0000000..4d3e798
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaCXX/deprecated-copy.cpp
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -std=c++11 %s -Wdeprecated-copy -verify
+// RUN: %clang_cc1 -std=c++11 %s -Wdeprecated-copy-dtor -DDEPRECATED_COPY_DTOR -verify
+// RUN: %clang_cc1 -std=c++11 %s -Wextra -verify
+
+#ifdef DEPRECATED_COPY_DTOR
+struct A {
+ int *ptr;
+ ~A() { delete ptr; } // expected-warning {{definition of implicit copy constructor for 'A' is deprecated because it has a user-declared destructor}}
+};
+
+void foo() {
+ A a{};
+ A b = a; // expected-note {{implicit copy constructor for 'A' first required here}}
+}
+#else
+struct B {
+ B &operator=(const B &); // expected-warning {{definition of implicit copy constructor for 'B' is deprecated because it has a user-declared copy assignment operator}}
+};
+
+void bar() {
+ B b1, b2(b1); // expected-note {{implicit copy constructor for 'B' first required here}}
+}
+#endif
diff --git a/src/llvm-project/clang/test/SemaCXX/deprecated.cpp b/src/llvm-project/clang/test/SemaCXX/deprecated.cpp
index 773085b..b2320c4 100644
--- a/src/llvm-project/clang/test/SemaCXX/deprecated.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/deprecated.cpp
@@ -1,12 +1,17 @@
-// 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++14 %s -Wdeprecated -verify -triple x86_64-linux-gnu
-// RUN: %clang_cc1 -std=c++17 %s -Wdeprecated -verify -triple x86_64-linux-gnu
+// RUN: %clang_cc1 -std=c++98 %s -Wno-parentheses -Wdeprecated -verify=expected,not-cxx20 -triple x86_64-linux-gnu
+// RUN: %clang_cc1 -std=c++11 %s -Wno-parentheses -Wdeprecated -verify=expected,not-cxx20 -triple x86_64-linux-gnu
+// RUN: %clang_cc1 -std=c++14 %s -Wno-parentheses -Wdeprecated -verify=expected,not-cxx20 -triple x86_64-linux-gnu
+// RUN: %clang_cc1 -std=c++17 %s -Wno-parentheses -Wdeprecated -verify=expected,not-cxx20 -triple x86_64-linux-gnu
+// RUN: %clang_cc1 -std=c++2a %s -Wno-parentheses -Wdeprecated -verify=expected,cxx20 -triple x86_64-linux-gnu
-// RUN: %clang_cc1 -std=c++14 %s -Wdeprecated -verify -triple x86_64-linux-gnu -Wno-deprecated-register -DNO_DEPRECATED_FLAGS
+// RUN: %clang_cc1 -std=c++14 %s -Wno-parentheses -Wdeprecated -verify=expected,not-cxx20 -triple x86_64-linux-gnu -Wno-deprecated-register -DNO_DEPRECATED_FLAGS
#include "Inputs/register.h"
+namespace std {
+ struct type_info {};
+}
+
void g() throw();
void h() throw(int);
void i() throw(...);
@@ -96,8 +101,154 @@
};
Dtor c1, c2(c1); // expected-note {{implicit copy constructor for 'DeprecatedCopy::Dtor' first required here}}
void g() { c1 = c2; } // expected-note {{implicit copy assignment operator for 'DeprecatedCopy::Dtor' first required here}}
+
+ struct DefaultedDtor {
+ ~DefaultedDtor() = default;
+ };
+ DefaultedDtor d1, d2(d1);
+ void h() { d1 = d2; }
}
#endif
+struct X {
+ friend int operator,(X, X);
+ void operator[](int);
+};
+void array_index_comma() {
+ int arr[123];
+ (void)arr[(void)1, 2];
+ (void)arr[X(), X()];
+ X()[(void)1, 2];
+ X()[X(), X()];
+#if __cplusplus > 201703L
+ // expected-warning@-5 {{deprecated}}
+ // expected-warning@-5 {{deprecated}}
+ // expected-warning@-5 {{deprecated}}
+ // expected-warning@-5 {{deprecated}}
+#endif
+
+ (void)arr[((void)1, 2)];
+ (void)arr[(X(), X())];
+ (void)((void)1,2)[arr];
+ (void)(X(), X())[arr];
+ X()[((void)1, 2)];
+ X()[(X(), X())];
+}
+
+namespace DeprecatedVolatile {
+ volatile int n = 1;
+ void use(int);
+ void f() {
+ // simple assignments are deprecated only if their value is used
+ n = 5; // ok
+#if __cplusplus >= 201103L
+ decltype(n = 5) m = n; // ok expected-warning {{side effects}}
+ (void)noexcept(n = 5); // ok expected-warning {{side effects}}
+#endif
+ (void)typeid(n = 5); // ok expected-warning {{side effects}}
+ (n = 5, 0); // ok
+ use(n = 5); // cxx20-warning {{use of result of assignment to object of volatile-qualified type 'volatile int' is deprecated}}
+ int q = n = 5; // cxx20-warning {{deprecated}}
+ q = n = 5; // cxx20-warning {{deprecated}}
+#if __cplusplus >= 201103L
+ decltype(q = n = 5) m2 = q; // cxx20-warning {{deprecated}} expected-warning {{side effects}}
+ (void)noexcept(q = n = 5); // cxx20-warning {{deprecated}} expected-warning {{side effects}}
+#endif
+ (void)sizeof(q = n = 5); // cxx20-warning {{deprecated}} expected-warning {{side effects}}
+ (void)typeid(use(n = 5)); // cxx20-warning {{deprecated}} expected-warning {{side effects}}
+ (void)__alignof(+(n = 5)); // cxx20-warning {{deprecated}} expected-warning {{side effects}}
+
+ // FIXME: These cases are technically deprecated because the parens are
+ // part of the operand, but we choose to not diagnose for now.
+ (void)sizeof(n = 5); // expected-warning {{side effects}}
+ (void)__alignof(n = 5); // expected-warning {{side effects}}
+ // Similarly here.
+ (n = 5);
+
+ volatile bool b = true;
+ if (b = true) {} // cxx20-warning {{deprecated}}
+ for (b = true;
+ b = true; // cxx20-warning {{deprecated}}
+ b = true) {}
+ for (volatile bool x = true;
+ volatile bool y = true; // ok despite volatile load from volatile initialization
+ ) {}
+
+ // inc / dec / compound assignments are always deprecated
+ ++n; // cxx20-warning {{increment of object of volatile-qualified type 'volatile int' is deprecated}}
+ --n; // cxx20-warning {{decrement of object of volatile-qualified type 'volatile int' is deprecated}}
+ n++; // cxx20-warning {{increment of object of volatile-qualified type 'volatile int' is deprecated}}
+ n--; // cxx20-warning {{decrement of object of volatile-qualified type 'volatile int' is deprecated}}
+ n += 5; // cxx20-warning {{compound assignment to object of volatile-qualified type 'volatile int' is deprecated}}
+ n *= 3; // cxx20-warning {{compound assignment to object of volatile-qualified type 'volatile int' is deprecated}}
+ n /= 2; // cxx20-warning {{compound assignment to object of volatile-qualified type 'volatile int' is deprecated}}
+ n %= 42; // cxx20-warning {{compound assignment to object of volatile-qualified type 'volatile int' is deprecated}}
+
+ (void)__is_trivially_assignable(volatile int&, int); // no warning
+
+#if __cplusplus >= 201703L
+ struct X { int a, b; };
+ volatile auto [x, y] = X{1, 2}; // cxx20-warning {{volatile qualifier in structured binding declaration is deprecated}}
+
+ struct Y { volatile int a, b; };
+ auto [x2, y2] = Y{1, 2}; // ok
+#endif
+ }
+ volatile int g( // cxx20-warning {{volatile-qualified return type 'volatile int' is deprecated}}
+ volatile int n, // cxx20-warning {{volatile-qualified parameter type 'volatile int' is deprecated}}
+ volatile int (*p)( // cxx20-warning {{volatile-qualified return type 'volatile int' is deprecated}}
+ volatile int m) // cxx20-warning {{volatile-qualified parameter type 'volatile int' is deprecated}}
+ );
+#if __cplusplus >= 201103L
+ auto lambda = []( // cxx20-warning{{volatile-qualified return type 'volatile int' is deprecated}}
+ volatile int n) // cxx20-warning{{volatile-qualified parameter type 'volatile int' is deprecated}}
+ -> volatile int { return n; };
+#endif
+
+ template<typename T> T f(T v); // cxx20-warning 2{{deprecated}}
+ int use_f = f<volatile int>(0); // FIXME: Missing "in instantiation of" note.
+
+ // OK, only the built-in operators are deprecated.
+ struct UDT {
+ UDT(volatile const UDT&);
+ UDT &operator=(const UDT&);
+ UDT &operator=(const UDT&) volatile;
+ UDT operator+=(const UDT&) volatile;
+ };
+ void h(UDT a) {
+ volatile UDT b = a;
+ volatile UDT c = b;
+ a = c = a;
+ b += a;
+ }
+}
+
+namespace ArithConv {
+ enum E { e } e2;
+ enum F { f };
+ bool b1 = e == e2;
+ bool b2 = e == f; // not-cxx20-warning-re {{different enumeration types ('ArithConv::E' and 'ArithConv::F'){{$}}}} cxx20-warning {{F') is deprecated}}
+ bool b3 = e == 0.0; // cxx20-warning {{comparison of enumeration type 'ArithConv::E' with floating-point type 'double' is deprecated}}
+ bool b4 = 0.0 == f; // cxx20-warning {{comparison of floating-point type 'double' with enumeration type 'ArithConv::F' is deprecated}}
+ int n1 = true ? e : f; // cxx20-warning {{conditional expression between different enumeration types ('ArithConv::E' and 'ArithConv::F') is deprecated}}
+ int n2 = true ? e : 0.0; // cxx20-warning {{conditional expression between enumeration type 'ArithConv::E' and floating-point type 'double' is deprecated}}
+}
+
+namespace ArrayComp {
+ int arr1[3], arr2[4];
+ bool b1 = arr1 == arr2; // expected-warning {{array comparison always evaluates to false}} cxx20-warning {{comparison between two arrays is deprecated}}
+ bool b2 = arr1 < arr2; // expected-warning {{array comparison always evaluates to a constant}} cxx20-warning {{comparison between two arrays is deprecated}}
+ __attribute__((weak)) int arr3[3];
+ bool b3 = arr1 == arr3; // cxx20-warning {{comparison between two arrays is deprecated}}
+ bool b4 = arr1 < arr3; // cxx20-warning {{comparison between two arrays is deprecated}}
+#if __cplusplus > 201703L
+ bool b5 = arr1 <=> arr2; // cxx20-error {{invalid operands}}
+#endif
+
+ int (&f())[3];
+ bool b6 = arr1 == f(); // cxx20-warning {{comparison between two arrays is deprecated}}
+ bool b7 = arr1 == +f();
+}
+
# 1 "/usr/include/system-header.h" 1 3
void system_header_function(void) throw();
diff --git a/src/llvm-project/clang/test/SemaCXX/designated-initializers-base-class.cpp b/src/llvm-project/clang/test/SemaCXX/designated-initializers-base-class.cpp
index 9c2e61e..2aa9603 100644
--- a/src/llvm-project/clang/test/SemaCXX/designated-initializers-base-class.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/designated-initializers-base-class.cpp
@@ -1,5 +1,4 @@
// RUN: %clang_cc1 %s -std=c++1z -fsyntax-only -verify -Winitializer-overrides
-// expected-no-diagnostics
struct B {
int x;
@@ -9,4 +8,4 @@
int y;
};
-void test() { D d = {1, .y = 2}; }
+void test() { D d = {1, .y = 2}; } // expected-warning {{C99 extension}} expected-note {{}}
diff --git a/src/llvm-project/clang/test/SemaCXX/designated-initializers.cpp b/src/llvm-project/clang/test/SemaCXX/designated-initializers.cpp
index 04002c0..a897e5a 100644
--- a/src/llvm-project/clang/test/SemaCXX/designated-initializers.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/designated-initializers.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify -Winitializer-overrides %s
-// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify -Woverride-init %s
+// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify -Wno-reorder -Wno-c99-designator -Winitializer-overrides %s
+// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify -Wno-reorder -Wno-c99-designator -Woverride-init %s
template <typename T> struct Foo {
struct SubFoo {
@@ -30,3 +30,150 @@
Bar<int>::Test(); // expected-note {{in instantiation of member function 'Bar<int>::Test' requested here}}
Bar<bool>::Test(); // expected-note {{in instantiation of member function 'Bar<bool>::Test' requested here}}
}
+
+namespace Reorder {
+ struct X {
+ X(int n);
+ private:
+ int i;
+ };
+
+ struct foo {
+ X x;
+ X y;
+ };
+
+ foo n = {.y = 4, .x = 5};
+ X arr[2] = {[1] = 1, [0] = 2};
+}
+
+namespace Reorder2 {
+ struct S {
+ S();
+ S(const S &);
+ ~S();
+ };
+
+ struct EF {
+ S s;
+ };
+
+ struct PN {
+ PN(const PN &);
+ };
+ extern PN pn;
+
+ struct FLN {
+ EF ef;
+ int it;
+ PN pn;
+ };
+
+ void f() {
+ FLN new_elem = {
+ .ef = EF(),
+ .pn = pn,
+ .it = 0,
+ };
+ }
+}
+
+namespace Reorder3 {
+ struct S {
+ int a, &b, &c; // expected-note 2{{here}}
+ };
+ S s1 = {
+ .a = 1, .c = s1.a, .b = s1.a
+ };
+ S s2 = {
+ .a = 1, .c = s2.a
+ }; // expected-error {{uninitialized}}
+ S s3 = {
+ .b = s3.a, .a = 1,
+ }; // expected-error {{uninitialized}}
+}
+
+// Check that we don't even think about whether holes in a designated
+// initializer are zero-initializable if the holes are filled later.
+namespace NoCheckingFilledHoles {
+ template<typename T> struct Error { using type = typename T::type; }; // expected-error 3{{'::'}}
+
+ template<int N>
+ struct DefaultInitIsError {
+ DefaultInitIsError(Error<int[N]> = {}); // expected-note 3{{instantiation}} expected-note 3{{passing}}
+ DefaultInitIsError(int, int);
+ };
+
+ template<int N>
+ struct X {
+ int a;
+ DefaultInitIsError<N> e;
+ int b;
+ };
+ X<1> x1 = {
+ .b = 2,
+ .a = 1,
+ {4, 4}
+ };
+ X<2> x2 = {
+ .e = {4, 4},
+ .b = 2,
+ .a = 1
+ };
+ X<3> x3 = {
+ .b = 2,
+ .a = 1
+ }; // expected-note {{default function argument}}
+ X<4> x4 = {
+ .a = 1,
+ .b = 2
+ }; // expected-note {{default function argument}}
+ X<5> x5 = {
+ .e = {4, 4},
+ .a = 1,
+ .b = 2
+ };
+ X<6> x6 = {
+ .a = 1,
+ .b = 2,
+ .e = {4, 4}
+ };
+
+ template<int N> struct Y { X<N> x; };
+ Y<7> y7 = {
+ .x = {.a = 1, .b = 2}, // expected-note {{default function argument}}
+ .x.e = {3, 4}
+ };
+ Y<8> y8 = {
+ .x = {.e = {3, 4}},
+ .x.a = 1,
+ .x.b = 2
+ };
+}
+
+namespace LargeArrayDesignator {
+ struct X {
+ int arr[1000000000];
+ };
+ struct Y {
+ int arr[3];
+ };
+ void f(X x);
+ void f(Y y) = delete;
+ void g() {
+ f({.arr[4] = 1});
+ }
+}
+
+namespace ADL {
+ struct A {};
+ void f(A, int);
+
+ namespace X {
+ void f(A, int);
+ // OK. Would fail if checking {} against type A set the type of the
+ // initializer list to A, because ADL would find ADL::f, resulting in
+ // ambiguity.
+ void g() { f({}, {}); }
+ }
+}
diff --git a/src/llvm-project/clang/test/SemaCXX/dllexport.cpp b/src/llvm-project/clang/test/SemaCXX/dllexport.cpp
index e4a312a..953684c 100644
--- a/src/llvm-project/clang/test/SemaCXX/dllexport.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/dllexport.cpp
@@ -742,7 +742,7 @@
static int StaticField; // expected-note{{previous declaration is here}}
static const int StaticConstField; // expected-note{{previous declaration is here}}
- constexpr static int ConstexprField = 1; // expected-note{{previous declaration is here}}
+ constexpr static int ConstexprField = 1; // expected-note-re{{previous {{(declaration|definition)}} is here}}
};
__declspec(dllexport) void MemberRedecl::normalDef() {} // expected-error{{redeclaration of 'MemberRedecl::normalDef' cannot add 'dllexport' attribute}}
@@ -757,7 +757,12 @@
__declspec(dllexport) int MemberRedecl::StaticField = 1; // expected-error{{redeclaration of 'MemberRedecl::StaticField' cannot add 'dllexport' attribute}}
__declspec(dllexport) const int MemberRedecl::StaticConstField = 1; // expected-error{{redeclaration of 'MemberRedecl::StaticConstField' cannot add 'dllexport' attribute}}
-__declspec(dllexport) constexpr int MemberRedecl::ConstexprField; // expected-error{{redeclaration of 'MemberRedecl::ConstexprField' cannot add 'dllexport' attribute}}
+#ifdef MS
+// expected-warning@+4{{attribute declaration must precede definition}}
+#else
+// expected-error@+2{{redeclaration of 'MemberRedecl::ConstexprField' cannot add 'dllexport' attribute}}
+#endif
+__declspec(dllexport) constexpr int MemberRedecl::ConstexprField;
#ifdef MS
struct __declspec(dllexport) ClassWithMultipleDefaultCtors {
@@ -841,7 +846,7 @@
#if __has_feature(cxx_variable_templates)
template<typename T> static int StaticField; // expected-note{{previous declaration is here}}
template<typename T> static const int StaticConstField; // expected-note{{previous declaration is here}}
- template<typename T> constexpr static int ConstexprField = 1; // expected-note{{previous declaration is here}}
+ template<typename T> constexpr static int ConstexprField = 1; // expected-note-re{{previous {{(declaration|definition)}} is here}}
#endif // __has_feature(cxx_variable_templates)
};
@@ -855,7 +860,13 @@
#if __has_feature(cxx_variable_templates)
template<typename T> __declspec(dllexport) int MemTmplRedecl::StaticField = 1; // expected-error{{redeclaration of 'MemTmplRedecl::StaticField' cannot add 'dllexport' attribute}}
template<typename T> __declspec(dllexport) const int MemTmplRedecl::StaticConstField = 1; // expected-error{{redeclaration of 'MemTmplRedecl::StaticConstField' cannot add 'dllexport' attribute}}
-template<typename T> __declspec(dllexport) constexpr int MemTmplRedecl::ConstexprField; // expected-error{{redeclaration of 'MemTmplRedecl::ConstexprField' cannot add 'dllexport' attribute}}
+
+#ifdef MS
+// expected-warning@+4{{attribute declaration must precede definition}}
+#else
+// expected-error@+2{{redeclaration of 'MemTmplRedecl::ConstexprField' cannot add 'dllexport' attribute}}
+#endif
+template<typename T> __declspec(dllexport) constexpr int MemTmplRedecl::ConstexprField;
#endif // __has_feature(cxx_variable_templates)
@@ -1045,7 +1056,7 @@
static int StaticField; // expected-note{{previous declaration is here}}
static const int StaticConstField; // expected-note{{previous declaration is here}}
- constexpr static int ConstexprField = 1; // expected-note{{previous declaration is here}}
+ constexpr static int ConstexprField = 1; // expected-note-re{{previous {{(definition|declaration)}} is here}}
};
template<typename T> __declspec(dllexport) void CTMR<T>::normalDef() {} // expected-error{{redeclaration of 'CTMR::normalDef' cannot add 'dllexport' attribute}}
@@ -1060,7 +1071,12 @@
template<typename T> __declspec(dllexport) int CTMR<T>::StaticField = 1; // expected-error{{redeclaration of 'CTMR::StaticField' cannot add 'dllexport' attribute}}
template<typename T> __declspec(dllexport) const int CTMR<T>::StaticConstField = 1; // expected-error{{redeclaration of 'CTMR::StaticConstField' cannot add 'dllexport' attribute}}
-template<typename T> __declspec(dllexport) constexpr int CTMR<T>::ConstexprField; // expected-error{{redeclaration of 'CTMR::ConstexprField' cannot add 'dllexport' attribute}}
+#ifdef MS
+// expected-warning@+4{{attribute declaration must precede definition}}
+#else
+// expected-error@+2{{redeclaration of 'CTMR::ConstexprField' cannot add 'dllexport' attribute}}
+#endif
+template<typename T> __declspec(dllexport) constexpr int CTMR<T>::ConstexprField;
@@ -1120,7 +1136,7 @@
#if __has_feature(cxx_variable_templates)
template<typename U> static int StaticField; // expected-note{{previous declaration is here}}
template<typename U> static const int StaticConstField; // expected-note{{previous declaration is here}}
- template<typename U> constexpr static int ConstexprField = 1; // expected-note{{previous declaration is here}}
+ template<typename U> constexpr static int ConstexprField = 1; // expected-note-re{{previous {{(declaration|definition)}} is here}}
#endif // __has_feature(cxx_variable_templates)
};
@@ -1134,7 +1150,12 @@
#if __has_feature(cxx_variable_templates)
template<typename T> template<typename U> __declspec(dllexport) int CTMTR<T>::StaticField = 1; // expected-error{{redeclaration of 'CTMTR::StaticField' cannot add 'dllexport' attribute}}
template<typename T> template<typename U> __declspec(dllexport) const int CTMTR<T>::StaticConstField = 1; // expected-error{{redeclaration of 'CTMTR::StaticConstField' cannot add 'dllexport' attribute}}
-template<typename T> template<typename U> __declspec(dllexport) constexpr int CTMTR<T>::ConstexprField; // expected-error{{redeclaration of 'CTMTR::ConstexprField' cannot add 'dllexport' attribute}}
+#ifdef MS
+// expected-warning@+4{{attribute declaration must precede definition}}
+#else
+// expected-error@+2{{redeclaration of 'CTMTR::ConstexprField' cannot add 'dllexport' attribute}}
+#endif
+template<typename T> template<typename U> __declspec(dllexport) constexpr int CTMTR<T>::ConstexprField;
#endif // __has_feature(cxx_variable_templates)
// FIXME: Precedence rules seem to be different for classes.
diff --git a/src/llvm-project/clang/test/SemaCXX/dllimport.cpp b/src/llvm-project/clang/test/SemaCXX/dllimport.cpp
index 73aea57..80c6f2e 100644
--- a/src/llvm-project/clang/test/SemaCXX/dllimport.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/dllimport.cpp
@@ -2,6 +2,7 @@
// RUN: %clang_cc1 -triple x86_64-win32 -fsyntax-only -fms-extensions -verify -std=c++1y -Wunsupported-dll-base-class-template -DMS %s
// RUN: %clang_cc1 -triple i686-mingw32 -fsyntax-only -fms-extensions -verify -std=c++1y -Wunsupported-dll-base-class-template -DGNU %s
// RUN: %clang_cc1 -triple x86_64-mingw32 -fsyntax-only -fms-extensions -verify -std=c++11 -Wunsupported-dll-base-class-template -DGNU %s
+// RUN: %clang_cc1 -triple x86_64-mingw32 -fsyntax-only -fms-extensions -verify -std=c++17 -Wunsupported-dll-base-class-template -DGNU %s
// Helper structs to make templates more expressive.
struct ImplicitInst_Imported {};
@@ -586,7 +587,10 @@
__declspec(dllimport) static const int StaticConstFieldEqualInit = 1;
__declspec(dllimport) static const int StaticConstFieldBraceInit{1};
__declspec(dllimport) constexpr static int ConstexprField = 1;
- __declspec(dllimport) constexpr static int ConstexprFieldDef = 1; // expected-note{{attribute is here}}
+#if __cplusplus < 201703L && !defined(MS)
+ // expected-note@+2{{attribute is here}}
+#endif
+ __declspec(dllimport) constexpr static int ConstexprFieldDef = 1;
};
#ifdef MS
@@ -631,7 +635,10 @@
int ImportMembers::StaticFieldDef; // expected-error{{definition of dllimport static field not allowed}}
const int ImportMembers::StaticConstFieldDef = 1; // expected-error{{definition of dllimport static field not allowed}}
-constexpr int ImportMembers::ConstexprFieldDef; // expected-error{{definition of dllimport static field not allowed}}
+#if __cplusplus < 201703L && !defined(MS)
+// expected-error@+2{{definition of dllimport static field not allowed}}
+#endif
+constexpr int ImportMembers::ConstexprFieldDef;
// Import on member definitions.
@@ -667,7 +674,11 @@
__declspec(dllimport) int ImportMemberDefs::StaticField; // expected-error{{definition of dllimport static field not allowed}} expected-note{{attribute is here}}
__declspec(dllimport) const int ImportMemberDefs::StaticConstField = 1; // expected-error{{definition of dllimport static field not allowed}} expected-note{{attribute is here}}
-__declspec(dllimport) constexpr int ImportMemberDefs::ConstexprField; // expected-error{{definition of dllimport static field not allowed}} expected-note{{attribute is here}}
+#if __cplusplus < 201703L && !defined(MS)
+// expected-error@+3{{definition of dllimport static field not allowed}}
+// expected-note@+2{{attribute is here}}
+#endif
+__declspec(dllimport) constexpr int ImportMemberDefs::ConstexprField;
// Import special member functions.
@@ -800,7 +811,7 @@
static int StaticField; // expected-note{{previous declaration is here}}
static const int StaticConstField; // expected-note{{previous declaration is here}}
- constexpr static int ConstexprField = 1; // expected-note{{previous declaration is here}}
+ constexpr static int ConstexprField = 1; // expected-note-re{{previous {{(declaration|definition)}} is here}}
};
__declspec(dllimport) void MemberRedecl::normalDef() {} // expected-error{{redeclaration of 'MemberRedecl::normalDef' cannot add 'dllimport' attribute}}
@@ -831,9 +842,15 @@
__declspec(dllimport) const int MemberRedecl::StaticConstField = 1; // expected-error{{redeclaration of 'MemberRedecl::StaticConstField' cannot add 'dllimport' attribute}}
// expected-error@-1{{definition of dllimport static field not allowed}}
// expected-note@-2{{attribute is here}}
-__declspec(dllimport) constexpr int MemberRedecl::ConstexprField; // expected-error{{redeclaration of 'MemberRedecl::ConstexprField' cannot add 'dllimport' attribute}}
- // expected-error@-1{{definition of dllimport static field not allowed}}
- // expected-note@-2{{attribute is here}}
+
+#if __cplusplus < 201703L && !defined(MS)
+// expected-error@+6{{redeclaration of 'MemberRedecl::ConstexprField' cannot add 'dllimport' attribute}}
+// expected-error@+5{{definition of dllimport static field not allowed}}
+// expected-note@+4{{attribute is here}}
+#else
+// expected-warning@+2{{attribute declaration must precede definition}}
+#endif
+__declspec(dllimport) constexpr int MemberRedecl::ConstexprField;
@@ -875,7 +892,7 @@
template<typename T> __declspec(dllimport) static const int StaticConstFieldEqualInit = 1;
template<typename T> __declspec(dllimport) static const int StaticConstFieldBraceInit{1};
template<typename T> __declspec(dllimport) constexpr static int ConstexprField = 1;
- template<typename T> __declspec(dllimport) constexpr static int ConstexprFieldDef = 1; // expected-note{{attribute is here}}
+ template<typename T> __declspec(dllimport) constexpr static int ConstexprFieldDef = 1;
#endif // __has_feature(cxx_variable_templates)
};
@@ -900,7 +917,9 @@
#if __has_feature(cxx_variable_templates)
template<typename T> int ImportMemberTmpl::StaticFieldDef; // expected-error{{definition of dllimport static field not allowed}}
template<typename T> const int ImportMemberTmpl::StaticConstFieldDef = 1; // expected-error{{definition of dllimport static field not allowed}}
-template<typename T> constexpr int ImportMemberTmpl::ConstexprFieldDef; // expected-error{{definition of dllimport static field not allowed}}
+#ifdef MS
+template<typename T> constexpr int ImportMemberTmpl::ConstexprFieldDef;
+#endif
#endif // __has_feature(cxx_variable_templates)
@@ -921,7 +940,9 @@
#if __has_feature(cxx_variable_templates)
template<typename T> static int StaticField; // expected-note{{previous declaration is here}}
template<typename T> static const int StaticConstField; // expected-note{{previous declaration is here}}
- template<typename T> constexpr static int ConstexprField = 1; // expected-note{{previous declaration is here}}
+#ifdef MS
+ template<typename T> constexpr static int ConstexprField = 1; // expected-note{{previous definition is here}}
+#endif
#endif // __has_feature(cxx_variable_templates)
};
@@ -949,9 +970,10 @@
template<typename T> __declspec(dllimport) const int MemTmplRedecl::StaticConstField = 1; // expected-error{{redeclaration of 'MemTmplRedecl::StaticConstField' cannot add 'dllimport' attribute}}
// expected-error@-1{{definition of dllimport static field not allowed}}
// expected-note@-2{{attribute is here}}
-template<typename T> __declspec(dllimport) constexpr int MemTmplRedecl::ConstexprField; // expected-error{{redeclaration of 'MemTmplRedecl::ConstexprField' cannot add 'dllimport' attribute}}
- // expected-error@-1{{definition of dllimport static field not allowed}}
- // expected-note@-2{{attribute is here}}
+#ifdef MS
+// expected-warning@+1{{attribute declaration must precede definition}}
+template<typename T> __declspec(dllimport) constexpr int MemTmplRedecl::ConstexprField;
+#endif
#endif // __has_feature(cxx_variable_templates)
@@ -1159,7 +1181,10 @@
__declspec(dllimport) static const int StaticConstFieldEqualInit = 1;
__declspec(dllimport) static const int StaticConstFieldBraceInit{1};
__declspec(dllimport) constexpr static int ConstexprField = 1;
- __declspec(dllimport) constexpr static int ConstexprFieldDef = 1; // expected-note{{attribute is here}}
+#if __cplusplus < 201703L && !defined(MS)
+ // expected-note@+2{{attribute is here}}
+#endif
+ __declspec(dllimport) constexpr static int ConstexprFieldDef = 1;
};
// NB: MSVC is inconsistent here and disallows *InlineDef on class templates,
@@ -1203,7 +1228,10 @@
template<typename T> int ImportClassTmplMembers<T>::StaticFieldDef; // expected-warning{{definition of dllimport static field}}
template<typename T> const int ImportClassTmplMembers<T>::StaticConstFieldDef = 1; // expected-warning{{definition of dllimport static field}}
-template<typename T> constexpr int ImportClassTmplMembers<T>::ConstexprFieldDef; // expected-warning{{definition of dllimport static field}}
+#if __cplusplus < 201703L && !defined(MS)
+// expected-warning@+2{{definition of dllimport static field}}
+#endif
+template<typename T> constexpr int ImportClassTmplMembers<T>::ConstexprFieldDef;
// Redeclarations cannot add dllimport.
@@ -1227,7 +1255,7 @@
static int StaticField; // expected-note{{previous declaration is here}}
static const int StaticConstField; // expected-note{{previous declaration is here}}
- constexpr static int ConstexprField = 1; // expected-note{{previous declaration is here}}
+ constexpr static int ConstexprField = 1; // expected-note-re{{previous {{(declaration|definition)}} is here}}
};
template<typename T> __declspec(dllimport) void CTMR<T>::normalDef() {} // expected-error{{redeclaration of 'CTMR::normalDef' cannot add 'dllimport' attribute}}
@@ -1256,9 +1284,15 @@
template<typename T> __declspec(dllimport) const int CTMR<T>::StaticConstField = 1; // expected-error{{redeclaration of 'CTMR::StaticConstField' cannot add 'dllimport' attribute}}
// expected-warning@-1{{definition of dllimport static field}}
// expected-note@-2{{attribute is here}}
-template<typename T> __declspec(dllimport) constexpr int CTMR<T>::ConstexprField; // expected-error{{redeclaration of 'CTMR::ConstexprField' cannot add 'dllimport' attribute}}
- // expected-warning@-1{{definition of dllimport static field}}
- // expected-note@-2{{attribute is here}}
+
+#if __cplusplus < 201703L && !defined(MS)
+// expected-error@+6{{redeclaration of 'CTMR::ConstexprField' cannot add 'dllimport' attribute}}
+// expected-warning@+5{{definition of dllimport static field}}
+// expected-note@+4{{attribute is here}}
+#else
+// expected-warning@+2{{attribute declaration must precede definition}}
+#endif
+template<typename T> __declspec(dllimport) constexpr int CTMR<T>::ConstexprField;
@@ -1306,7 +1340,9 @@
template<typename U> __declspec(dllimport) static const int StaticConstFieldEqualInit = 1;
template<typename U> __declspec(dllimport) static const int StaticConstFieldBraceInit{1};
template<typename U> __declspec(dllimport) constexpr static int ConstexprField = 1;
- template<typename U> __declspec(dllimport) constexpr static int ConstexprFieldDef = 1; // expected-note{{attribute is here}}
+#ifdef MS
+ template<typename U> __declspec(dllimport) constexpr static int ConstexprFieldDef = 1;
+#endif
#endif // __has_feature(cxx_variable_templates)
};
@@ -1331,7 +1367,9 @@
#if __has_feature(cxx_variable_templates)
template<typename T> template<typename U> int ImportClsTmplMemTmpl<T>::StaticFieldDef; // expected-warning{{definition of dllimport static field}}
template<typename T> template<typename U> const int ImportClsTmplMemTmpl<T>::StaticConstFieldDef = 1; // expected-warning{{definition of dllimport static field}}
-template<typename T> template<typename U> constexpr int ImportClsTmplMemTmpl<T>::ConstexprFieldDef; // expected-warning{{definition of dllimport static field}}
+#ifdef MS
+template<typename T> template<typename U> constexpr int ImportClsTmplMemTmpl<T>::ConstexprFieldDef;
+#endif
#endif // __has_feature(cxx_variable_templates)
@@ -1353,7 +1391,9 @@
#if __has_feature(cxx_variable_templates)
template<typename U> static int StaticField; // expected-note{{previous declaration is here}}
template<typename U> static const int StaticConstField; // expected-note{{previous declaration is here}}
- template<typename U> constexpr static int ConstexprField = 1; // expected-note{{previous declaration is here}}
+#ifdef MS
+ template<typename U> constexpr static int ConstexprField = 1; // expected-note{{previous definition is here}}
+#endif
#endif // __has_feature(cxx_variable_templates)
};
@@ -1379,9 +1419,10 @@
template<typename T> template<typename U> __declspec(dllimport) const int CTMTR<T>::StaticConstField = 1; // expected-error{{redeclaration of 'CTMTR::StaticConstField' cannot add 'dllimport' attribute}}
// expected-warning@-1{{definition of dllimport static field}}
// expected-note@-2{{attribute is here}}
-template<typename T> template<typename U> __declspec(dllimport) constexpr int CTMTR<T>::ConstexprField; // expected-error{{redeclaration of 'CTMTR::ConstexprField' cannot add 'dllimport' attribute}}
- // expected-warning@-1{{definition of dllimport static field}}
- // expected-note@-2{{attribute is here}}
+#ifdef MS
+// expected-warning@+1{{attribute declaration must precede definition}}
+template<typename T> template<typename U> __declspec(dllimport) constexpr int CTMTR<T>::ConstexprField;
+#endif
#endif // __has_feature(cxx_variable_templates)
diff --git a/src/llvm-project/clang/test/SemaCXX/dynamic-cast.cpp b/src/llvm-project/clang/test/SemaCXX/dynamic-cast.cpp
index b605194..6ab7823 100644
--- a/src/llvm-project/clang/test/SemaCXX/dynamic-cast.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/dynamic-cast.cpp
@@ -22,17 +22,17 @@
void basic_bad()
{
// ptr -> nonptr
- (void)dynamic_cast<A>((A*)0); // expected-error {{'A' is not a reference or pointer}}
+ (void)dynamic_cast<A>((A*)0); // expected-error {{invalid target type 'A' for dynamic_cast; target type must be a reference or pointer type to a defined class}}
// nonptr -> ptr
- (void)dynamic_cast<A*>(0); // expected-error {{'int' is not a pointer}}
+ (void)dynamic_cast<A*>(0); // expected-error {{cannot use dynamic_cast to convert from 'int' to 'A *'}}
// ptr -> noncls
- (void)dynamic_cast<int*>((A*)0); // expected-error {{'int' is not a class}}
+ (void)dynamic_cast<int*>((A*)0); // expected-error {{'int' is not a class type}}
// noncls -> ptr
- (void)dynamic_cast<A*>((int*)0); // expected-error {{'int' is not a class}}
+ (void)dynamic_cast<A*>((int*)0); // expected-error {{'int' is not a class type}}
// ref -> noncls
- (void)dynamic_cast<int&>(*((A*)0)); // expected-error {{'int' is not a class}}
+ (void)dynamic_cast<int&>(*((A*)0)); // expected-error {{'int' is not a class type}}
// noncls -> ref
- (void)dynamic_cast<A&>(*((int*)0)); // expected-error {{'int' is not a class}}
+ (void)dynamic_cast<A&>(*((int*)0)); // expected-error {{'int' is not a class type}}
// ptr -> incomplete
(void)dynamic_cast<Incomplete*>((A*)0); // expected-error {{'Incomplete' is an incomplete type}}
// incomplete -> ptr
diff --git a/src/llvm-project/clang/test/SemaCXX/enable_if.cpp b/src/llvm-project/clang/test/SemaCXX/enable_if.cpp
index fd13751..3766427 100644
--- a/src/llvm-project/clang/test/SemaCXX/enable_if.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/enable_if.cpp
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -std=c++11 -verify %s
-
+// RUN: %clang_cc1 -std=c++2a -verify %s
typedef int (*fp)(int);
int surrogate(int);
struct Incomplete; // expected-note{{forward declaration of 'Incomplete'}} \
@@ -533,3 +533,31 @@
}
}
+namespace IgnoreUnusedArgSideEffects {
+ struct A { ~A(); };
+ void f(A a, bool b) __attribute__((enable_if(b, ""))); // expected-note 2-3{{disabled}}
+ void test() {
+ f(A(), true);
+ f(A(), false); // expected-error {{no matching function}}
+ int n;
+ f((n = 1, A()), true);
+ f(A(), (n = 1, true)); // expected-error {{no matching function}}
+ f(A(), (A(), true));
+ }
+
+#if __cplusplus > 201702L
+ struct B { constexpr ~B() {} bool b; };
+ void g(B b) __attribute__((enable_if(b.b, ""))); // expected-note {{disabled}}
+ void test2() {
+ g(B{true});
+ g(B{false}); // expected-error {{no matching function}}
+ f(A(), B{true}.b);
+ f(A(), B{false}.b); // expected-error {{no matching function}}
+ }
+
+ // First condition is non-constant due to non-constexpr destructor of A.
+ int &h() __attribute__((enable_if((A(), true), "")));
+ float &h() __attribute__((enable_if((B(), true), "")));
+ float &x = h();
+#endif
+}
diff --git a/src/llvm-project/clang/test/SemaCXX/enum.cpp b/src/llvm-project/clang/test/SemaCXX/enum.cpp
index 16ebebe..b193a17 100644
--- a/src/llvm-project/clang/test/SemaCXX/enum.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/enum.cpp
@@ -88,19 +88,13 @@
typedef enum { }; // expected-warning{{typedef requires a name}}
// PR7921
-enum PR7921E {
- PR7921V = (PR7921E)(123)
-#if __cplusplus < 201103L
-// expected-error@-2 {{expression is not an integral constant expression}}
-#else
-// expected-error@-4 {{must have integral or unscoped enumeration type}}
-// FIXME: The above diagnostic isn't very good; we should instead complain about the type being incomplete.
-#endif
+enum PR7921E { // expected-note {{not complete until the closing '}'}}
+ PR7921V = (PR7921E)(123) // expected-error {{'PR7921E' is an incomplete type}}
};
void PR8089() {
- enum E; // expected-error{{ISO C++ forbids forward references to 'enum' types}}
- int a = (E)3; // expected-error{{cannot initialize a variable of type 'int' with an rvalue of type 'E'}}
+ enum E; // expected-error{{ISO C++ forbids forward references to 'enum' types}} expected-note {{forward declaration}}
+ int a = (E)3; // expected-error {{'E' is an incomplete type}}
}
// This is accepted as a GNU extension. In C++98, there was no provision for
diff --git a/src/llvm-project/clang/test/SemaCXX/eval-crashes.cpp b/src/llvm-project/clang/test/SemaCXX/eval-crashes.cpp
index 60c2dee..3e59ad3 100644
--- a/src/llvm-project/clang/test/SemaCXX/eval-crashes.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/eval-crashes.cpp
@@ -37,7 +37,7 @@
struct X {
Y_t a;
};
- struct X foo[2] = {[0 ... 1] = {.a = (Y_t){.c = 0}}};
+ struct X foo[2] = {[0 ... 1] = {.a = (Y_t){.c = 0}}}; // expected-warning {{C99 extension}}
}
namespace pr33140_6 {
diff --git a/src/llvm-project/clang/test/SemaCXX/exceptions-seh.cpp b/src/llvm-project/clang/test/SemaCXX/exceptions-seh.cpp
index 7375ec9..02bb786 100644
--- a/src/llvm-project/clang/test/SemaCXX/exceptions-seh.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/exceptions-seh.cpp
@@ -39,14 +39,13 @@
}
#if __cplusplus < 201103L
-// FIXME: Diagnose this case. For now we produce undef in codegen.
template <typename T, T FN()>
T func_template() {
- return FN();
+ return FN(); // expected-error 2{{builtin functions must be directly called}}
}
void inject_builtins() {
- func_template<void *, __exception_info>();
- func_template<unsigned long, __exception_code>();
+ func_template<void *, __exception_info>(); // expected-note {{instantiation of}}
+ func_template<unsigned long, __exception_code>(); // expected-note {{instantiation of}}
}
#endif
@@ -113,3 +112,17 @@
} catch(int) {
}
};
+
+template <class T> void dependent_filter() {
+ __try {
+ might_crash();
+ } __except (T()) { // expected-error {{filter expression has non-integral type 'NotInteger'}}
+ }
+}
+
+struct NotInteger { int x; };
+
+void instantiate_dependent_filter() {
+ dependent_filter<int>();
+ dependent_filter<NotInteger>(); // expected-note {{requested here}}
+}
diff --git a/src/llvm-project/clang/test/SemaCXX/explicit.cpp b/src/llvm-project/clang/test/SemaCXX/explicit.cpp
index 58760d3..ba2c36d 100644
--- a/src/llvm-project/clang/test/SemaCXX/explicit.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/explicit.cpp
@@ -7,7 +7,7 @@
};
struct B { // expected-note+ {{candidate}}
- explicit B(int);
+ explicit B(int); // expected-note {{not a candidate}}
};
B::B(int) { } // expected-note+ {{here}}
@@ -78,8 +78,8 @@
struct Z {
explicit operator X() const;
- explicit operator Y() const;
- explicit operator int() const;
+ explicit operator Y() const; // expected-note 2{{not a candidate}}
+ explicit operator int() const; // expected-note {{not a candidate}}
};
Z z;
@@ -118,7 +118,7 @@
};
struct NotBool {
- explicit operator bool(); // expected-note {{conversion to integral type 'bool'}}
+ explicit operator bool(); // expected-note {{conversion to integral type 'bool'}} expected-note 4{{explicit conversion function is not a candidate}}
};
Bool b;
NotBool n;
diff --git a/src/llvm-project/clang/test/SemaCXX/gnu_inline.cpp b/src/llvm-project/clang/test/SemaCXX/gnu_inline.cpp
new file mode 100644
index 0000000..43a4bae
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaCXX/gnu_inline.cpp
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+extern inline
+__attribute__((__gnu_inline__))
+void gnu_inline1() {}
+
+inline
+__attribute__((__gnu_inline__)) // expected-warning {{'gnu_inline' attribute without 'extern' in C++ treated as externally available, this changed in Clang 10}}
+void gnu_inline2() {}
diff --git a/src/llvm-project/clang/test/SemaCXX/invalid-member-expr.cpp b/src/llvm-project/clang/test/SemaCXX/invalid-member-expr.cpp
index 920d923..e0b4079 100644
--- a/src/llvm-project/clang/test/SemaCXX/invalid-member-expr.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/invalid-member-expr.cpp
@@ -1,6 +1,7 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++20 %s
class X {};
diff --git a/src/llvm-project/clang/test/SemaCXX/lambda-expressions.cpp b/src/llvm-project/clang/test/SemaCXX/lambda-expressions.cpp
index 311def9..0f4edc4 100644
--- a/src/llvm-project/clang/test/SemaCXX/lambda-expressions.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/lambda-expressions.cpp
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 -std=c++14 -Wno-unused-value -fsyntax-only -verify -fblocks %s
+// RUN: %clang_cc1 -std=c++14 -Wno-unused-value -fsyntax-only -verify -verify=expected-cxx14 -fblocks %s
+// RUN: %clang_cc1 -std=c++17 -Wno-unused-value -fsyntax-only -verify -fblocks %s
namespace std { class type_info; };
@@ -12,6 +13,7 @@
void ImplicitThisCapture() {
[](){(void)Member;}; // expected-error {{'this' cannot be implicitly captured in this context}}
+ const int var = [](){(void)Member; return 0;}(); // expected-error {{'this' cannot be implicitly captured in this context}}
[&](){(void)Member;};
[this](){(void)Member;};
@@ -105,7 +107,7 @@
a = static_cast<decltype(a)&&>(a); // expected-error {{copy assignment operator is implicitly deleted}}
}
struct P {
- P(const P&) = delete; // expected-note 2{{deleted here}}
+ P(const P&) = delete; //expected-note {{deleted here}} // expected-cxx14-note {{deleted here}}
};
struct Q {
~Q() = delete; // expected-note {{deleted here}}
@@ -118,8 +120,8 @@
};
void g(P &p, Q &q, R &r) {
// FIXME: The note attached to the second error here is just amazingly bad.
- auto pp = [p]{}; // expected-error {{deleted constructor}} expected-error {{deleted copy constructor of '(lambda}}
- // expected-note@-1 {{copy constructor of '' is implicitly deleted because field '' has a deleted copy constructor}}
+ auto pp = [p]{}; // expected-error {{deleted constructor}} expected-cxx14-error {{deleted copy constructor of '(lambda}}
+ // expected-cxx14-note@-1 {{copy constructor of '' is implicitly deleted because field '' has a deleted copy constructor}}
auto qq = [q]{}; // expected-error {{deleted function}} expected-note {{because}}
auto a = [r]{}; // expected-note 2{{here}}
@@ -365,7 +367,7 @@
int (*f())[true ? 1 : ([=]{ return n; }(), 0)];
// expected-error@-1 {{non-local lambda expression cannot have a capture-default}}
// expected-error@-2 {{invalid use of non-static data member 'n'}}
- // expected-error@-3 {{a lambda expression may not appear inside of a constant expression}}
+ // expected-cxx14-error@-3 {{a lambda expression may not appear inside of a constant expression}}
int g(int k = ([=]{ return n; }(), 0));
// expected-error@-1 {{non-local lambda expression cannot have a capture-default}}
// expected-error@-2 {{invalid use of non-static data member 'n'}}
@@ -596,8 +598,13 @@
using ExpectedTypeU = void (*)(T&);
struct X {
+#if __cplusplus > 201402L
+ friend constexpr auto T::operator()(int) const;
+ friend constexpr T::operator ExpectedTypeT() const noexcept;
+#else
friend auto T::operator()(int) const;
friend T::operator ExpectedTypeT() const;
+#endif
// FIXME: The first of these should match. The second should not.
template<typename T>
@@ -630,3 +637,7 @@
};
}
}
+
+void operator_parens() {
+ [&](int x){ operator()(); }(0); // expected-error {{undeclared 'operator()'}}
+}
diff --git a/src/llvm-project/clang/test/SemaCXX/lambda-invalid-capture.cpp b/src/llvm-project/clang/test/SemaCXX/lambda-invalid-capture.cpp
index 3234970..a4d96b3 100644
--- a/src/llvm-project/clang/test/SemaCXX/lambda-invalid-capture.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/lambda-invalid-capture.cpp
@@ -16,3 +16,10 @@
auto q = [child]{};
const int n = sizeof(q);
}
+
+int pr43080(int i) { // expected-note {{declared here}}
+ return [] { // expected-note {{begins here}}
+ return sizeof i <
+ i; // expected-error {{variable 'i' cannot be implicitly captured in a lambda with no capture-default specified}}
+ }();
+}
diff --git a/src/llvm-project/clang/test/SemaCXX/member-init.cpp b/src/llvm-project/clang/test/SemaCXX/member-init.cpp
index 3fcee50..ff5dade 100644
--- a/src/llvm-project/clang/test/SemaCXX/member-init.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/member-init.cpp
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -fsyntax-only -fcxx-exceptions -verify -std=c++11 -Wall %s
struct Bitfield {
- int n : 3 = 7; // expected-warning {{C++2a extension}} expected-warning {{changes value from 7 to -1}}
+ int n : 3 = 7; // expected-warning {{C++20 extension}} expected-warning {{changes value from 7 to -1}}
};
int a;
@@ -184,7 +184,7 @@
namespace PR22056 {
template <int N>
struct S {
- int x[3] = {[N] = 3};
+ int x[3] = {[N] = 3}; // expected-warning {{C99 extension}}
};
}
diff --git a/src/llvm-project/clang/test/SemaCXX/microsoft-template-shadow.cpp b/src/llvm-project/clang/test/SemaCXX/microsoft-template-shadow.cpp
new file mode 100644
index 0000000..ab2ffde
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaCXX/microsoft-template-shadow.cpp
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 %s -triple i686-pc-win32 -fsyntax-only -verify -fms-compatibility -Wno-microsoft -Wmicrosoft-template-shadow
+
+template <typename T> // expected-note {{template parameter is declared here}}
+struct Outmost {
+ template <typename T> // expected-warning {{declaration of 'T' shadows template parameter}}
+ struct Inner {
+ void f() {
+ T *var;
+ }
+ };
+};
diff --git a/src/llvm-project/clang/test/SemaCXX/microsoft-vs-float128.cpp b/src/llvm-project/clang/test/SemaCXX/microsoft-vs-float128.cpp
index d271e47..77d2498 100644
--- a/src/llvm-project/clang/test/SemaCXX/microsoft-vs-float128.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/microsoft-vs-float128.cpp
@@ -11,7 +11,7 @@
struct S {
- // The only numeric types S can be converted to is __int128 and __float128.
+ // The only numeric types S can be converted to are [unsigned] __int128 and __float128.
template <typename T, typename = typename enable_if<
!((__is_integral(T) && sizeof(T) != 16) ||
is_same<T, float>::value ||
@@ -29,6 +29,8 @@
double d = S() + 1.0;
#ifndef MS
// expected-error@-2{{use of overloaded operator '+' is ambiguous}}
- // expected-note@-3 36{{built-in candidate operator+}}
+ // expected-note@-3 {{built-in candidate operator+(__float128, double)}}
+ // expected-note@-4 {{built-in candidate operator+(__int128, double)}}
+ // expected-note@-5 {{built-in candidate operator+(unsigned __int128, double)}}
#endif
}
diff --git a/src/llvm-project/clang/test/SemaCXX/ms-exception-spec.cpp b/src/llvm-project/clang/test/SemaCXX/ms-exception-spec.cpp
index 1a4c9fd..cf46035 100644
--- a/src/llvm-project/clang/test/SemaCXX/ms-exception-spec.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/ms-exception-spec.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -std=c++11 %s -fsyntax-only -verify -fms-extensions -fexceptions -fcxx-exceptions
-// RUN: %clang_cc1 -std=c++17 %s -fsyntax-only -verify -fms-extensions -fexceptions -fcxx-exceptions
+// RUN: %clang_cc1 -std=c++11 %s -fsyntax-only -verify -fms-compatibility -fexceptions -fcxx-exceptions
+// RUN: %clang_cc1 -std=c++17 %s -fsyntax-only -verify -fms-compatibility -fexceptions -fcxx-exceptions
// FIXME: Should -fms-compatibility soften these errors into warnings to match
// MSVC? In practice, MSVC never implemented dynamic exception specifiers, so
diff --git a/src/llvm-project/clang/test/SemaCXX/ms-uuid.cpp b/src/llvm-project/clang/test/SemaCXX/ms-uuid.cpp
index c1775706..1de7aee 100644
--- a/src/llvm-project/clang/test/SemaCXX/ms-uuid.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/ms-uuid.cpp
@@ -106,3 +106,9 @@
}
}
+
+// Test class/struct redeclaration where the subsequent
+// declaration has a uuid attribute
+struct X{};
+
+struct __declspec(uuid("00000000-0000-0000-0000-000000000000")) X;
\ No newline at end of file
diff --git a/src/llvm-project/clang/test/SemaCXX/overload-call.cpp b/src/llvm-project/clang/test/SemaCXX/overload-call.cpp
index befa927..a34bce5 100644
--- a/src/llvm-project/clang/test/SemaCXX/overload-call.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/overload-call.cpp
@@ -12,9 +12,9 @@
}
int* g(int, float, int); // expected-note {{candidate function}}
-float* g(int, int, int); // expected-note {{candidate function}}
+float* g(int, int, int);
double* g(int, float, float); // expected-note {{candidate function}}
-char* g(int, float, ...); // expected-note {{candidate function}}
+char* g(int, float, ...);
void g();
void test_g(int iv, float fv) {
diff --git a/src/llvm-project/clang/test/SemaCXX/overload-member-call.cpp b/src/llvm-project/clang/test/SemaCXX/overload-member-call.cpp
index 2d017a4..90f95fc 100644
--- a/src/llvm-project/clang/test/SemaCXX/overload-member-call.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/overload-member-call.cpp
@@ -14,7 +14,7 @@
int& g(int) const; // expected-note 2 {{candidate function}}
float& g(int); // expected-note 2 {{candidate function}}
- static double& g(double); // expected-note 2 {{candidate function}}
+ static double& g(double);
void h(int);
@@ -114,3 +114,10 @@
const S *p;
int k = p->f(); // expected-error {{no matching member function for call to 'f'}}
}
+
+void member_call_op_template(int *p) {
+ // Ensure that we don't get confused about relative parameter / argument
+ // indexing here.
+ [](int, int, auto...){}(p, p); // expected-error {{no matching function}} expected-note {{no known conversion}}
+}
+
diff --git a/src/llvm-project/clang/test/SemaCXX/overloaded-builtin-operators.cpp b/src/llvm-project/clang/test/SemaCXX/overloaded-builtin-operators.cpp
index 4fa376a..d237dfe 100644
--- a/src/llvm-project/clang/test/SemaCXX/overloaded-builtin-operators.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/overloaded-builtin-operators.cpp
@@ -194,10 +194,9 @@
};
void test_dr425(A a) {
- // FIXME: lots of candidates here!
(void)(1.0f * a); // expected-error{{ambiguous}} \
// expected-note 4{{candidate}} \
- // expected-note {{remaining 140 candidates omitted; pass -fshow-overloads=all to show them}}
+ // expected-note {{remaining 8 candidates omitted; pass -fshow-overloads=all to show them}}
}
// pr5432
@@ -237,9 +236,10 @@
(void)(foo - zero);
(void)(zero + foo);
(void)(zero[foo]);
+ // FIXME: It would be nice to report fewer candidates here.
(void)(foo - foo); // expected-error{{use of overloaded operator '-' is ambiguous}} \
// expected-note 4{{built-in candidate operator-}} \
- // expected-note{{candidates omitted}}
+ // expected-note{{142 candidates omitted}}
return foo[zero] == zero;
}
}
diff --git a/src/llvm-project/clang/test/SemaCXX/parentheses.cpp b/src/llvm-project/clang/test/SemaCXX/parentheses.cpp
index b430b25..d466bd0 100644
--- a/src/llvm-project/clang/test/SemaCXX/parentheses.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/parentheses.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -verify %s
+// RUN: %clang_cc1 -verify -Wlogical-op-parentheses %s
// PR16930, PR16727:
template<class Foo>
diff --git a/src/llvm-project/clang/test/SemaCXX/ref-init-ambiguous.cpp b/src/llvm-project/clang/test/SemaCXX/ref-init-ambiguous.cpp
index ce47e10..7e1a3bc 100644
--- a/src/llvm-project/clang/test/SemaCXX/ref-init-ambiguous.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/ref-init-ambiguous.cpp
@@ -25,4 +25,26 @@
return c; // expected-error {{reference initialization of type 'const E2 &' with initializer of type 'C' is ambiguous}}
}
+namespace CWG2352 {
+ void f(const int * const &) = delete;
+ void f(int *);
+ void g(int * &);
+ void g(const int *) = delete;
+
+ void h1(int *const * const &);
+ void h1(const int *const *) = delete;
+ void h2(const int *const * const &) = delete;
+ void h2(int *const *);
+
+ void test() {
+ int *x;
+ // Under CWG2352, this became ambiguous. We order by qualification
+ // conversion even when comparing a reference binding to a
+ // non-reference-binding.
+ f(x);
+ g(x);
+ h1(&x);
+ h2(&x);
+ }
+}
diff --git a/src/llvm-project/clang/test/SemaCXX/return-noreturn.cpp b/src/llvm-project/clang/test/SemaCXX/return-noreturn.cpp
index cfeddff..b88e5a5 100644
--- a/src/llvm-project/clang/test/SemaCXX/return-noreturn.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/return-noreturn.cpp
@@ -26,7 +26,7 @@
}
int f2_positive(int x) {
switch (x) { default: ; }
- } // expected-warning {{control reaches end of non-void function}}
+ } // expected-warning {{non-void function does not return a value}}
int f3(int x) {
switch (x) { default: { pr6884_abort_struct(); } }
}
@@ -46,7 +46,7 @@
pr6884_abort_struct *p = new pr6884_abort_struct();
delete p;
}
- } // expected-warning {{control reaches end of non-void function}}
+ } // expected-warning {{non-void function does not return a value}}
// Test that these constructs work even when extraneous blocks are created
// before and after the switch due to implicit destructors.
@@ -61,7 +61,7 @@
int g2_positive(int x) {
other o;
switch (x) { default: ; }
- } // expected-warning {{control reaches end of non-void function}}
+ } // expected-warning {{non-void function does not return a value}}
int g3(int x) {
other o;
switch (x) { default: { pr6884_abort_struct(); } }
@@ -140,7 +140,7 @@
default:
break;
}
-} // expected-warning {{control reaches end of non-void function}}
+} // expected-warning {{non-void function does not return a value}}
void PR9412_f() {
PR9412_t<PR9412_Exact>(); // expected-note {{in instantiation of function template specialization 'PR9412_t<PR9412_Exact>' requested here}}
@@ -165,7 +165,7 @@
int testTernaryStaticallyConditionalRetrunOnTrue() {
true ? Return() : NoReturn();
-} // expected-warning {{control reaches end of non-void function}}
+} // expected-warning {{non-void function does not return a value}}
int testTernaryStaticallyConditionalNoretrunOnFalse() {
false ? Return() : NoReturn();
@@ -173,23 +173,23 @@
int testTernaryStaticallyConditionalRetrunOnFalse() {
false ? NoReturn() : Return();
-} // expected-warning {{control reaches end of non-void function}}
+} // expected-warning {{non-void function does not return a value}}
int testTernaryConditionalNoreturnTrueBranch(bool value) {
value ? (NoReturn() || NoReturn()) : Return();
-} // expected-warning {{control may reach end of non-void function}}
+} // expected-warning {{non-void function does not return a value in all control paths}}
int testTernaryConditionalNoreturnFalseBranch(bool value) {
value ? Return() : (NoReturn() || NoReturn());
-} // expected-warning {{control may reach end of non-void function}}
+} // expected-warning {{non-void function does not return a value in all control paths}}
int testConditionallyExecutedComplexTernaryTrueBranch(bool value) {
value || (true ? NoReturn() : true);
-} // expected-warning {{control may reach end of non-void function}}
+} // expected-warning {{non-void function does not return a value in all control paths}}
int testConditionallyExecutedComplexTernaryFalseBranch(bool value) {
value || (false ? true : NoReturn());
-} // expected-warning {{control may reach end of non-void function}}
+} // expected-warning {{non-void function does not return a value in all control paths}}
int testStaticallyExecutedLogicalOrBranch() {
false || NoReturn();
@@ -201,19 +201,19 @@
int testStaticallySkippedLogicalOrBranch() {
true || NoReturn();
-} // expected-warning {{control reaches end of non-void function}}
+} // expected-warning {{non-void function does not return a value}}
int testStaticallySkppedLogicalAndBranch() {
false && NoReturn();
-} // expected-warning {{control reaches end of non-void function}}
+} // expected-warning {{non-void function does not return a value}}
int testConditionallyExecutedComplexLogicalBranch(bool value) {
value || (true && NoReturn());
-} // expected-warning {{control may reach end of non-void function}}
+} // expected-warning {{non-void function does not return a value in all control paths}}
int testConditionallyExecutedComplexLogicalBranch2(bool value) {
(true && value) || (true && NoReturn());
-} // expected-warning {{control may reach end of non-void function}}
+} // expected-warning {{non-void function does not return a value in all control paths}}
int testConditionallyExecutedComplexLogicalBranch3(bool value) {
(false && (Return() || true)) || (true && NoReturn());
@@ -236,7 +236,7 @@
int bar() {
X work([](){ Fatal(); });
foo();
- } // expected-warning {{control reaches end of non-void function}}
+ } // expected-warning {{non-void function does not return a value}}
int baz() {
FatalCopy fc;
@@ -250,12 +250,12 @@
int functionTryBlock1(int s) try {
return 0;
} catch (...) {
-} // expected-warning {{control may reach end of non-void function}}
+} // expected-warning {{non-void function does not return a value in all control paths}}
int functionTryBlock2(int s) try {
} catch (...) {
return 0;
-} // expected-warning {{control may reach end of non-void function}}
+} // expected-warning {{non-void function does not return a value in all control paths}}
int functionTryBlock3(int s) try {
return 0;
diff --git a/src/llvm-project/clang/test/SemaCXX/self-comparison.cpp b/src/llvm-project/clang/test/SemaCXX/self-comparison.cpp
index ac129b6..72127f1 100644
--- a/src/llvm-project/clang/test/SemaCXX/self-comparison.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/self-comparison.cpp
@@ -5,7 +5,7 @@
}
struct X {
- bool operator==(const X &x);
+ bool operator==(const X &x) const;
};
struct A {
@@ -15,16 +15,16 @@
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 h() { return a == b; } // expected-warning {{array comparison always evaluates to false}} expected-warning {{deprecated}}
bool i() {
int c[3];
- return a == c; // expected-warning {{array comparison always evaluates to false}}
+ return a == c; // expected-warning {{array comparison always evaluates to false}} expected-warning {{deprecated}}
}
};
namespace NA { extern "C" int x[3]; }
namespace NB { extern "C" int x[3]; }
-bool k = NA::x == NB::x; // expected-warning {{self-comparison always evaluates to true}}
+bool k = NA::x == NB::x; // expected-warning {{self-comparison always evaluates to true}} expected-warning {{deprecated}}
template<typename T> struct Y { static inline int n; };
bool f() {
@@ -40,3 +40,85 @@
Y<T>::n == Y<U>::n;
}
template bool g<int, int>(); // should not produce any warnings
+
+namespace member_tests {
+struct B {
+ int field;
+ static int static_field;
+ int test(B b) {
+ return field == field; // expected-warning {{self-comparison always evaluates to true}}
+ return static_field == static_field; // expected-warning {{self-comparison always evaluates to true}}
+ return static_field == b.static_field; // expected-warning {{self-comparison always evaluates to true}}
+ return B::static_field == this->static_field; // expected-warning {{self-comparison always evaluates to true}}
+ return this == this; // expected-warning {{self-comparison always evaluates to true}}
+
+ return field == b.field;
+ return this->field == b.field;
+ }
+};
+
+enum {
+ I0,
+ I1,
+ I2,
+};
+
+struct S {
+ int field;
+ static int static_field;
+ int array[4];
+};
+
+struct T {
+ int field;
+ static int static_field;
+ int array[4];
+ S s;
+};
+
+int struct_test(S s1, S s2, S *s3, T t) {
+ return s1.field == s1.field; // expected-warning {{self-comparison always evaluates to true}}
+ return s2.field == s2.field; // expected-warning {{self-comparison always evaluates to true}}
+ return s1.static_field == s2.static_field; // expected-warning {{self-comparison always evaluates to true}}
+ return S::static_field == s1.static_field; // expected-warning {{self-comparison always evaluates to true}}
+ return s1.array == s1.array; // expected-warning {{self-comparison always evaluates to true}} expected-warning {{deprecated}}
+ return t.s.static_field == S::static_field; // expected-warning {{self-comparison always evaluates to true}}
+ return s3->field == s3->field; // expected-warning {{self-comparison always evaluates to true}}
+ return s3->static_field == S::static_field; // expected-warning {{self-comparison always evaluates to true}}
+ return s1.array[0] == s1.array[0]; // expected-warning {{self-comparison always evaluates to true}}
+ return s1.array[0] == s1.array[0ull]; // expected-warning {{self-comparison always evaluates to true}}
+ return s1.array[I1] == s1.array[I1]; // expected-warning {{self-comparison always evaluates to true}}
+ return s1.array[s2.array[0]] == s1.array[s2.array[0]]; // expected-warning {{self-comparison always evaluates to true}}
+ return s3->array[t.field] == s3->array[t.field]; // expected-warning {{self-comparison always evaluates to true}}
+
+ // Try all operators
+ return t.field == t.field; // expected-warning {{self-comparison always evaluates to true}}
+ return t.field <= t.field; // expected-warning {{self-comparison always evaluates to true}}
+ return t.field >= t.field; // expected-warning {{self-comparison always evaluates to true}}
+
+ return t.field != t.field; // expected-warning {{self-comparison always evaluates to false}}
+ return t.field < t.field; // expected-warning {{self-comparison always evaluates to false}}
+ return t.field > t.field; // expected-warning {{self-comparison always evaluates to false}}
+
+ // no warning
+ return s1.field == s2.field;
+ return s2.array == s1.array; // FIXME: This always evaluates to false. expected-warning {{deprecated}}
+ return s2.array[0] == s1.array[0];
+ return s1.array[I1] == s1.array[I2];
+
+ return s1.static_field == t.static_field;
+};
+
+struct U {
+ bool operator!=(const U&);
+};
+
+bool operator==(const U&, const U&);
+
+// May want to warn on this in the future.
+int user_defined(U u) {
+ return u == u;
+ return u != u;
+}
+
+} // namespace member_tests
diff --git a/src/llvm-project/clang/test/SemaCXX/std-compare-cxx2a.cpp b/src/llvm-project/clang/test/SemaCXX/std-compare-cxx2a.cpp
index 6746fb4..4e85b37 100644
--- a/src/llvm-project/clang/test/SemaCXX/std-compare-cxx2a.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/std-compare-cxx2a.cpp
@@ -1,12 +1,28 @@
// Test diagnostics for ill-formed STL <compare> headers.
// RUN: %clang_cc1 -triple x86_64-apple-darwin -fcxx-exceptions -fsyntax-only -pedantic -verify -Wsign-compare -std=c++2a %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -fcxx-exceptions -fsyntax-only -pedantic -verify -Wsign-compare -std=c++2a -DTEST_TRIVIAL=1 %s
+#ifndef TEST_TRIVIAL
void compare_not_found_test() {
- // expected-error@+1 {{cannot deduce return type of 'operator<=>' because type 'std::partial_ordering' was not found; include <compare>}}
+ // expected-error@+1 {{cannot use builtin operator '<=>' because type 'std::partial_ordering' was not found; include <compare>}}
(void)(0.0 <=> 42.123);
}
+struct deduction_compare_not_found {
+ // expected-error@+1 {{cannot default 'operator<=>' because type 'std::strong_ordering' was not found; include <compare>}}
+ friend auto operator<=>(const deduction_compare_not_found&, const deduction_compare_not_found&) = default;
+};
+
+struct comparable {
+ int operator<=>(comparable);
+};
+struct default_compare_not_found {
+ // expected-error@+1 {{cannot default 'operator<=>' because type 'std::strong_ordering' was not found; include <compare>}}
+ friend int operator<=>(const default_compare_not_found&, const default_compare_not_found&) = default;
+};
+bool b = default_compare_not_found() < default_compare_not_found(); // expected-note {{first required here}}
+
namespace std {
inline namespace __1 {
struct partial_ordering; // expected-note {{forward declaration}}
@@ -35,31 +51,32 @@
inline namespace __1 {
struct strong_ordering {
long long value;
- static const strong_ordering equivalent; // expected-note {{declared here}}
+ static const strong_ordering equal; // expected-note {{declared here}}
};
} // namespace __1
} // namespace std
auto test_non_constexpr_var() {
- // expected-error@+1 {{standard library implementation of 'std::strong_ordering' is not supported; member 'equivalent' does not have expected form}}
+ // expected-error@+1 {{standard library implementation of 'std::strong_ordering' is not supported; member 'equal' does not have expected form}}
return (1 <=> 0);
}
+#else
+
namespace std {
inline namespace __1 {
-struct strong_equality {
+struct strong_ordering {
char value = 0;
- constexpr strong_equality() = default;
+ constexpr strong_ordering() = default;
// non-trivial
- constexpr strong_equality(strong_equality const &other) : value(other.value) {}
+ constexpr strong_ordering(strong_ordering const &other) : value(other.value) {}
};
} // namespace __1
} // namespace std
-struct Class {};
-using MemPtr = void (Class::*)(int);
-
-auto test_non_trivial(MemPtr LHS, MemPtr RHS) {
- // expected-error@+1 {{standard library implementation of 'std::strong_equality' is not supported; the type is not trivially copyable}}
+auto test_non_trivial(int LHS, int RHS) {
+ // expected-error@+1 {{standard library implementation of 'std::strong_ordering' is not supported; the type is not trivially copyable}}
return LHS <=> RHS;
}
+
+#endif
diff --git a/src/llvm-project/clang/test/SemaCXX/switch-implicit-fallthrough.cpp b/src/llvm-project/clang/test/SemaCXX/switch-implicit-fallthrough.cpp
index 6ccac12..a67f6be 100644
--- a/src/llvm-project/clang/test/SemaCXX/switch-implicit-fallthrough.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/switch-implicit-fallthrough.cpp
@@ -329,3 +329,15 @@
}
return n;
}
+
+int fallthrough_attribute_spelling(int n) {
+ switch (n) {
+ case 0:
+ n++;
+ __attribute__((fallthrough));
+ case 1:
+ n++;
+ break;
+ }
+ return n;
+}
diff --git a/src/llvm-project/clang/test/SemaCXX/type-traits.cpp b/src/llvm-project/clang/test/SemaCXX/type-traits.cpp
index 9bc238e..c2f233b 100644
--- a/src/llvm-project/clang/test/SemaCXX/type-traits.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/type-traits.cpp
@@ -12,6 +12,7 @@
// PODs
enum Enum { EV };
+enum SignedEnum : signed int { };
struct POD { Enum e; int i; float f; NonPOD* p; };
struct Empty {};
struct IncompleteStruct;
@@ -56,14 +57,14 @@
struct HasNoInheritedCons : HasCons {};
struct HasCopyAssign { HasCopyAssign operator =(const HasCopyAssign&); };
struct HasMoveAssign { HasMoveAssign operator =(const HasMoveAssign&&); };
-struct HasNoThrowMoveAssign {
+struct HasNoThrowMoveAssign {
HasNoThrowMoveAssign& operator=(
const HasNoThrowMoveAssign&&) throw(); };
-struct HasNoExceptNoThrowMoveAssign {
+struct HasNoExceptNoThrowMoveAssign {
HasNoExceptNoThrowMoveAssign& operator=(
- const HasNoExceptNoThrowMoveAssign&&) noexcept;
+ const HasNoExceptNoThrowMoveAssign&&) noexcept;
};
-struct HasThrowMoveAssign {
+struct HasThrowMoveAssign {
HasThrowMoveAssign& operator=(const HasThrowMoveAssign&&)
#if __cplusplus <= 201402L
throw(POD);
@@ -73,7 +74,7 @@
};
-struct HasNoExceptFalseMoveAssign {
+struct HasNoExceptFalseMoveAssign {
HasNoExceptFalseMoveAssign& operator=(
const HasNoExceptFalseMoveAssign&&) noexcept(false); };
struct HasMoveCtor { HasMoveCtor(const HasMoveCtor&&); };
@@ -82,17 +83,17 @@
struct HasStaticMemberMoveCtor { static HasMoveCtor member; };
struct HasStaticMemberMoveAssign { static HasMoveAssign member; };
struct HasMemberThrowMoveAssign { HasThrowMoveAssign member; };
-struct HasMemberNoExceptFalseMoveAssign {
+struct HasMemberNoExceptFalseMoveAssign {
HasNoExceptFalseMoveAssign member; };
struct HasMemberNoThrowMoveAssign { HasNoThrowMoveAssign member; };
-struct HasMemberNoExceptNoThrowMoveAssign {
+struct HasMemberNoExceptNoThrowMoveAssign {
HasNoExceptNoThrowMoveAssign member; };
-struct HasDefaultTrivialCopyAssign {
+struct HasDefaultTrivialCopyAssign {
HasDefaultTrivialCopyAssign &operator=(
- const HasDefaultTrivialCopyAssign&) = default;
+ const HasDefaultTrivialCopyAssign&) = default;
};
-struct TrivialMoveButNotCopy {
+struct TrivialMoveButNotCopy {
TrivialMoveButNotCopy &operator=(TrivialMoveButNotCopy&&) = default;
TrivialMoveButNotCopy &operator=(const TrivialMoveButNotCopy&);
};
@@ -361,7 +362,7 @@
struct FinalClass final {
};
-template<typename T>
+template<typename T>
struct PotentiallyFinal { };
template<typename T>
@@ -801,6 +802,7 @@
int t23[T(__is_fundamental(unsigned long))];
int t24[T(__is_fundamental(void))];
int t25[T(__is_fundamental(cvoid))];
+ int t26[T(__is_fundamental(decltype(nullptr)))];
int t30[F(__is_fundamental(Union))];
int t31[F(__is_fundamental(UnionAr))];
@@ -1419,12 +1421,12 @@
int t04[T(__is_signed(short))];
int t05[T(__is_signed(signed char))];
int t06[T(__is_signed(wchar_t))];
+ int t07[T(__is_signed(float))];
+ int t08[T(__is_signed(double))];
+ int t09[T(__is_signed(long double))];
- int t10[F(__is_signed(bool))];
- int t11[F(__is_signed(cvoid))];
- int t12[F(__is_signed(float))];
- int t13[F(__is_signed(double))];
- int t14[F(__is_signed(long double))];
+ int t13[F(__is_signed(bool))];
+ int t14[F(__is_signed(cvoid))];
int t15[F(__is_signed(unsigned char))];
int t16[F(__is_signed(unsigned int))];
int t17[F(__is_signed(unsigned long long))];
@@ -1434,9 +1436,10 @@
int t21[F(__is_signed(ClassType))];
int t22[F(__is_signed(Derives))];
int t23[F(__is_signed(Enum))];
- int t24[F(__is_signed(IntArNB))];
- int t25[F(__is_signed(Union))];
- int t26[F(__is_signed(UnionAr))];
+ int t24[F(__is_signed(SignedEnum))];
+ int t25[F(__is_signed(IntArNB))];
+ int t26[F(__is_signed(Union))];
+ int t27[F(__is_signed(UnionAr))];
}
void is_unsigned()
@@ -1957,6 +1960,10 @@
int t10[F(__is_same(Base, const Base))];
int t11[F(__is_same(Base, Base&))];
int t12[F(__is_same(Base, Derived))];
+
+ // __is_same_as is a GCC compatibility synonym for __is_same.
+ int t20[T(__is_same_as(int, int))];
+ int t21[F(__is_same_as(int, float))];
}
struct IntWrapper
@@ -2005,7 +2012,7 @@
};
template<typename T>
-struct X0 {
+struct X0 {
template<typename U> X0(const X0<U>&);
};
@@ -2766,7 +2773,7 @@
char b[7];
};
-static_assert(!has_unique_object_representations<NotUniqueBecauseTailPadding>::value,
+static_assert(!has_unique_object_representations<NotUniqueBecauseTailPadding>::value,
"non trivial");
// Can be unique on Itanium, since the is child class' data is 'folded' into the
// parent's tail padding.
diff --git a/src/llvm-project/clang/test/SemaCXX/typo-correction.cpp b/src/llvm-project/clang/test/SemaCXX/typo-correction.cpp
index 33dea4d..92a1450 100644
--- a/src/llvm-project/clang/test/SemaCXX/typo-correction.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/typo-correction.cpp
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -fspell-checking-limit 0 -verify -Wno-c++11-extensions %s
+// RUN: %clang_cc1 -fspell-checking-limit 0 -verify -Wno-c++11-extensions -std=c++20 %s
namespace PR21817{
int a(-rsing[2]); // expected-error {{undeclared identifier 'rsing'; did you mean 'using'?}}
@@ -523,8 +524,8 @@
namespace shadowed_template {
template <typename T> class Fizbin {}; // expected-note {{'::shadowed_template::Fizbin' declared here}}
class Baz {
- int Fizbin();
- Fizbin<int> qux; // expected-error {{no template named 'Fizbin'; did you mean '::shadowed_template::Fizbin'?}}
+ int Fizbin;
+ Fizbin<int> qux; // expected-error {{no template named 'Fizbin'; did you mean '::shadowed_template::Fizbin'?}}
};
}
diff --git a/src/llvm-project/clang/test/SemaCXX/undefined-inline.cpp b/src/llvm-project/clang/test/SemaCXX/undefined-inline.cpp
index feb12f4..21c6b5d 100644
--- a/src/llvm-project/clang/test/SemaCXX/undefined-inline.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/undefined-inline.cpp
@@ -40,20 +40,20 @@
}
namespace test8 {
- inline void foo() __attribute__((gnu_inline));
+ inline void foo() __attribute__((gnu_inline)); // expected-warning {{'gnu_inline' attribute without 'extern' in C++ treated as externally available, this changed in Clang 10}}
void test() { foo(); }
}
namespace test9 {
void foo();
void test() { foo(); }
- inline void foo() __attribute__((gnu_inline));
+ inline void foo() __attribute__((gnu_inline)); // expected-warning {{'gnu_inline' attribute without 'extern' in C++ treated as externally available, this changed in Clang 10}}
}
namespace test10 {
inline void foo();
void test() { foo(); }
- inline void foo() __attribute__((gnu_inline));
+ inline void foo() __attribute__((gnu_inline)); // expected-warning {{'gnu_inline' attribute without 'extern' in C++ treated as externally available, this changed in Clang 10}}
}
namespace test11 {
diff --git a/src/llvm-project/clang/test/SemaCXX/uninitialized.cpp b/src/llvm-project/clang/test/SemaCXX/uninitialized.cpp
index 331a948..63d5e7b 100644
--- a/src/llvm-project/clang/test/SemaCXX/uninitialized.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/uninitialized.cpp
@@ -1449,3 +1449,12 @@
switch (int n; (n == k || k > 5)) {} // expected-warning {{uninitialized}} expected-note {{initialize}} expected-warning {{boolean}}
}
+
+template<typename T> struct Outer {
+ struct Inner {
+ int a = 1;
+ int b;
+ Inner() : b(a) {}
+ };
+};
+Outer<int>::Inner outerinner;
diff --git a/src/llvm-project/clang/test/SemaCXX/vartemplate-lambda.cpp b/src/llvm-project/clang/test/SemaCXX/vartemplate-lambda.cpp
index 6744968..b17c9bb 100644
--- a/src/llvm-project/clang/test/SemaCXX/vartemplate-lambda.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/vartemplate-lambda.cpp
@@ -4,7 +4,12 @@
template <typename> void foo0() { fn0<char>(); }
template<typename T> auto fn1 = [](auto a) { return a + T(1); };
-template<typename T> auto v1 = [](int a = T(1)) { return a; }();
+template<typename T> auto v1 = [](int a = T()) { return a; }();
+// expected-error@-1{{cannot initialize a parameter of type 'int' with an rvalue of type 'int *'}}
+// expected-error@-2{{no matching function for call}}
+// expected-note@-3{{passing argument to parameter 'a' here}}
+// expected-note@-4{{candidate function not viable}}
+// expected-note@-5{{conversion candidate of type 'int (*)(int)'}}
struct S {
template<class T>
@@ -16,6 +21,7 @@
X a = 0x61;
fn1<char>(a);
(void)v1<int>;
+ (void)v1<int *>; // expected-note{{in instantiation of variable template specialization 'v1' requested here}}
(void)S::t<int>; // expected-note{{in instantiation of static data member 'S::t<int>' requested here}}
return 0;
}
diff --git a/src/llvm-project/clang/test/SemaCXX/vector-conditional.cpp b/src/llvm-project/clang/test/SemaCXX/vector-conditional.cpp
new file mode 100644
index 0000000..5676d7a
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaCXX/vector-conditional.cpp
@@ -0,0 +1,172 @@
+// RUN: %clang_cc1 -triple x86_64-linux-pc -fsyntax-only -verify -fexceptions -fcxx-exceptions %s -std=c++17
+// Note that this test depends on the size of long-long to be different from
+// int, so it specifies a triple.
+
+using FourShorts = short __attribute__((__vector_size__(8)));
+using TwoInts = int __attribute__((__vector_size__(8)));
+using TwoUInts = unsigned __attribute__((__vector_size__(8)));
+using FourInts = int __attribute__((__vector_size__(16)));
+using FourUInts = unsigned __attribute__((__vector_size__(16)));
+using TwoLongLong = long long __attribute__((__vector_size__(16)));
+using FourLongLong = long long __attribute__((__vector_size__(32)));
+using TwoFloats = float __attribute__((__vector_size__(8)));
+using FourFloats = float __attribute__((__vector_size__(16)));
+using TwoDoubles = double __attribute__((__vector_size__(16)));
+using FourDoubles = double __attribute__((__vector_size__(32)));
+
+FourShorts four_shorts;
+TwoInts two_ints;
+TwoUInts two_uints;
+FourInts four_ints;
+FourUInts four_uints;
+TwoLongLong two_ll;
+FourLongLong four_ll;
+TwoFloats two_floats;
+FourFloats four_floats;
+TwoDoubles two_doubles;
+FourDoubles four_doubles;
+
+enum E {};
+enum class SE {};
+E e;
+SE se;
+
+// Check the rules of the condition of the conditional operator.
+void Condition() {
+ // Only int types are allowed here, the rest should fail to convert to bool.
+ (void)(four_floats ? 1 : 1); // expected-error {{is not contextually convertible to 'bool'}}}
+ (void)(two_doubles ? 1 : 1); // expected-error {{is not contextually convertible to 'bool'}}}
+}
+
+// Check the rules of the LHS/RHS of the conditional operator.
+void Operands() {
+ (void)(four_ints ? four_ints : throw 1); // expected-error {{GNU vector conditional operand cannot be a throw expression}}
+ (void)(four_ints ? throw 1 : four_ints); // expected-error {{GNU vector conditional operand cannot be a throw expression}}
+ (void)(four_ints ?: throw 1); // expected-error {{GNU vector conditional operand cannot be a throw expression}}
+ (void)(four_ints ? (void)1 : four_ints); // expected-error {{GNU vector conditional operand cannot be void}}
+ (void)(four_ints ?: (void)1); // expected-error {{GNU vector conditional operand cannot be void}}
+
+ // Vector types must be the same element size as the condition.
+ (void)(four_ints ? two_ll : two_ll); // expected-error {{vector condition type 'FourInts' (vector of 4 'int' values) and result type 'TwoLongLong' (vector of 2 'long long' values) do not have the same number of elements}}
+ (void)(four_ints ? four_ll : four_ll); // expected-error {{vector condition type 'FourInts' (vector of 4 'int' values) and result type 'FourLongLong' (vector of 4 'long long' values) do not have elements of the same size}}
+ (void)(four_ints ? two_doubles : two_doubles); // expected-error {{vector condition type 'FourInts' (vector of 4 'int' values) and result type 'TwoDoubles' (vector of 2 'double' values) do not have the same number of elements}}
+ (void)(four_ints ? four_doubles : four_doubles); // expected-error {{vector condition type 'FourInts' (vector of 4 'int' values) and result type 'FourDoubles' (vector of 4 'double' values) do not have elements of the same size}}
+ (void)(four_ints ?: two_ints); // expected-error {{vector operands to the vector conditional must be the same type ('FourInts' (vector of 4 'int' values) and 'TwoInts' (vector of 2 'int' values)}}
+ (void)(four_ints ?: four_doubles); // expected-error {{vector operands to the vector conditional must be the same type ('FourInts' (vector of 4 'int' values) and 'FourDoubles' (vector of 4 'double' values)}}
+
+ // Scalars are promoted, but must be the same element size.
+ (void)(four_ints ? 3.0f : 3.0); // expected-error {{vector condition type 'FourInts' (vector of 4 'int' values) and result type '__attribute__((__vector_size__(4 * sizeof(double)))) double' (vector of 4 'double' values) do not have elements of the same size}}
+ (void)(four_ints ? 5ll : 5); // expected-error {{vector condition type 'FourInts' (vector of 4 'int' values) and result type '__attribute__((__vector_size__(4 * sizeof(long long)))) long long' (vector of 4 'long long' values) do not have elements of the same size}}
+ (void)(four_ints ?: 3.0); // expected-error {{cannot convert between scalar type 'double' and vector type 'FourInts' (vector of 4 'int' values) as implicit conversion would cause truncation}}
+ (void)(four_ints ?: 5ll); // We allow this despite GCc not allowing this since we support integral->vector-integral conversions despite integer rank.
+
+ // This one would be allowed in GCC, but we don't allow vectors of enum. Also,
+ // the error message isn't perfect, since it is only going to be a problem
+ // when both sides are an enum, otherwise it'll be promoted to whatever type
+ // the other side causes.
+ (void)(four_ints ? e : e); // expected-error {{enumeration type 'E' is not allowed in a vector conditional}}
+ (void)(four_ints ? se : se); // expected-error {{enumeration type 'SE' is not allowed in a vector conditional}}
+ (void)(four_shorts ? (short)5 : (unsigned short)5); // expected-error {{vector condition type 'FourShorts' (vector of 4 'short' values) and result type '__attribute__((__vector_size__(4 * sizeof(int)))) int' (vector of 4 'int' values) do not have elements of the same size}}
+
+ // They must also be convertible.
+ (void)(four_ints ? 3.0f : 5u);
+ (void)(four_ints ? 3.0f : 5);
+ unsigned us = 5u;
+ int sint = 5;
+ short shrt = 5;
+ unsigned short uss = 5u;
+ // The following 2 error in GCC for truncation errors, but it seems
+ // unimportant and inconsistent to enforce that rule.
+ (void)(four_ints ? 3.0f : us);
+ (void)(four_ints ? 3.0f : sint);
+
+ // Test promotion:
+ (void)(four_shorts ? uss : shrt); // expected-error {{vector condition type 'FourShorts' (vector of 4 'short' values) and result type '__attribute__((__vector_size__(4 * sizeof(int)))) int' (vector of 4 'int' values) do not have elements of the same size}}
+ (void)(four_shorts ? shrt : shrt); // should be fine.
+ (void)(four_ints ? uss : shrt); // should be fine, since they get promoted to int.
+ (void)(four_ints ? shrt : shrt); //expected-error {{vector condition type 'FourInts' (vector of 4 'int' values) and result type '__attribute__((__vector_size__(4 * sizeof(short)))) short' (vector of 4 'short' values) do not have elements of the same size}}
+
+ // Vectors must be the same type as eachother.
+ (void)(four_ints ? four_uints : four_floats); // expected-error {{vector operands to the vector conditional must be the same type ('FourUInts' (vector of 4 'unsigned int' values) and 'FourFloats' (vector of 4 'float' values))}}
+ (void)(four_ints ? four_uints : four_ints); // expected-error {{vector operands to the vector conditional must be the same type ('FourUInts' (vector of 4 'unsigned int' values) and 'FourInts' (vector of 4 'int' values))}}
+ (void)(four_ints ? four_ints : four_uints); // expected-error {{vector operands to the vector conditional must be the same type ('FourInts' (vector of 4 'int' values) and 'FourUInts' (vector of 4 'unsigned int' values))}}
+
+ // GCC rejects these, but our lax vector conversions don't seem to have a problem with them. Allow conversion of the float to an int as an extension.
+ (void)(four_ints ? four_uints : 3.0f);
+ (void)(four_ints ? four_ints : 3.0f);
+
+ // When there is a vector and a scalar, conversions must be legal.
+ (void)(four_ints ? four_floats : 3); // should work, ints can convert to floats.
+ (void)(four_ints ? four_uints : e); // should work, non-scoped enum can convert to uint.
+ (void)(four_ints ? four_uints : se); // expected-error {{cannot convert between vector and non-scalar values ('FourUInts' (vector of 4 'unsigned int' values) and 'SE'}}
+ // GCC permits this, but our conversion rules reject this for truncation.
+ (void)(two_ints ? two_ints : us); // expected-error {{cannot convert between scalar type 'unsigned int' and vector type 'TwoInts'}}
+ (void)(four_shorts ? four_shorts : uss); // expected-error {{cannot convert between scalar type 'unsigned short' and vector type 'FourShorts'}}
+ (void)(four_ints ? four_floats : us); // expected-error {{cannot convert between scalar type 'unsigned int' and vector type 'FourFloats'}}
+ (void)(four_ints ? four_floats : sint); // expected-error {{cannot convert between scalar type 'int' and vector type 'FourFloats'}}
+}
+
+template <typename T1, typename T2>
+struct is_same {
+ static constexpr bool value = false;
+};
+template <typename T>
+struct is_same<T, T> {
+ static constexpr bool value = true;
+};
+template <typename T1, typename T2>
+constexpr bool is_same_v = is_same<T1, T2>::value;
+template <typename T>
+T &&declval();
+
+// Check the result types when given two vector types.
+void ResultTypes() {
+ // Vectors must be the same, but result is the type of the LHS/RHS.
+ static_assert(is_same_v<TwoInts, decltype(declval<TwoInts>() ? declval<TwoInts>() : declval<TwoInts>())>);
+ static_assert(is_same_v<TwoFloats, decltype(declval<TwoInts>() ? declval<TwoFloats>() : declval<TwoFloats>())>);
+
+ // When both are scalars, converts to vectors of common type.
+ static_assert(is_same_v<TwoUInts, decltype(declval<TwoInts>() ? declval<int>() : declval<unsigned int>())>);
+
+ // Constant is allowed since it doesn't truncate, and should promote to float.
+ static_assert(is_same_v<TwoFloats, decltype(declval<TwoInts>() ? declval<float>() : 5u)>);
+ static_assert(is_same_v<TwoFloats, decltype(declval<TwoInts>() ? 5 : declval<float>())>);
+
+ // when only 1 is a scalar, it should convert to a compatible type.
+ static_assert(is_same_v<TwoFloats, decltype(declval<TwoInts>() ? declval<TwoFloats>() : declval<float>())>);
+ static_assert(is_same_v<TwoInts, decltype(declval<TwoInts>() ? declval<TwoInts>() : declval<int>())>);
+ static_assert(is_same_v<TwoFloats, decltype(declval<TwoInts>() ? declval<TwoFloats>() : 5)>);
+
+ // For the Binary conditional operator, the result type is either the vector on the RHS (that fits the rules on size/count), or the scalar extended to the correct count.
+ static_assert(is_same_v<TwoInts, decltype(declval<TwoInts>() ?: declval<TwoInts>())>);
+ static_assert(is_same_v<TwoInts, decltype(declval<TwoInts>() ?: declval<int>())>);
+}
+
+template <typename Cond>
+void dependent_cond(Cond C) {
+ (void)(C ? 1 : 2);
+}
+
+template <typename Operand>
+void dependent_operand(Operand C) {
+ (void)(two_ints ? 1 : C);
+ (void)(two_ints ? C : 1);
+ (void)(two_ints ? C : C);
+}
+
+template <typename Cond, typename LHS, typename RHS>
+void all_dependent(Cond C, LHS L, RHS R) {
+ (void)(C ? L : R);
+}
+
+// Check dependent cases.
+void Templates() {
+ dependent_cond(two_ints);
+ dependent_operand(two_floats);
+ // expected-error@159 {{vector operands to the vector conditional must be the same type ('__attribute__((__vector_size__(4 * sizeof(unsigned int)))) unsigned int' (vector of 4 'unsigned int' values) and '__attribute__((__vector_size__(4 * sizeof(double)))) double' (vector of 4 'double' values))}}}
+ all_dependent(four_ints, four_uints, four_doubles); // expected-note {{in instantiation of}}
+
+ // expected-error@159 {{vector operands to the vector conditional must be the same type ('__attribute__((__vector_size__(4 * sizeof(unsigned int)))) unsigned int' (vector of 4 'unsigned int' values) and '__attribute__((__vector_size__(2 * sizeof(unsigned int)))) unsigned int' (vector of 2 'unsigned int' values))}}}
+ all_dependent(four_ints, four_uints, two_uints); // expected-note {{in instantiation of}}
+ all_dependent(four_ints, four_uints, four_uints);
+}
diff --git a/src/llvm-project/clang/test/SemaCXX/vector-no-lax.cpp b/src/llvm-project/clang/test/SemaCXX/vector-no-lax.cpp
index 3cedcb1..a6e39a8 100644
--- a/src/llvm-project/clang/test/SemaCXX/vector-no-lax.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/vector-no-lax.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fno-lax-vector-conversions -verify %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -flax-vector-conversions=none -verify %s
typedef unsigned int __attribute__((vector_size (16))) vUInt32;
typedef int __attribute__((vector_size (16))) vSInt32;
diff --git a/src/llvm-project/clang/test/SemaCXX/vector.cpp b/src/llvm-project/clang/test/SemaCXX/vector.cpp
index 295e1e1..67e5a94 100644
--- a/src/llvm-project/clang/test/SemaCXX/vector.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/vector.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify %s
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify -std=c++98 %s
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify -std=c++11 %s
+// RUN: %clang_cc1 -flax-vector-conversions=all -triple x86_64-apple-darwin10 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -flax-vector-conversions=all -triple x86_64-apple-darwin10 -fsyntax-only -verify -std=c++98 %s
+// RUN: %clang_cc1 -flax-vector-conversions=all -triple x86_64-apple-darwin10 -fsyntax-only -verify -std=c++11 %s
+// RUN: %clang_cc1 -flax-vector-conversions=integer -triple x86_64-apple-darwin10 -fsyntax-only -verify %s -DNO_LAX_FLOAT
+// RUN: %clang_cc1 -flax-vector-conversions=none -triple x86_64-apple-darwin10 -fsyntax-only -verify %s -DNO_LAX_FLOAT -DNO_LAX_INT
typedef char char16 __attribute__ ((__vector_size__ (16)));
typedef long long longlong16 __attribute__ ((__vector_size__ (16)));
@@ -8,13 +10,19 @@
typedef long long longlong16_e __attribute__ ((__ext_vector_type__ (2)));
// Test overloading and function calls with vector types.
-void f0(char16);
+void f0(char16); // expected-note 0+{{candidate}}
void f0_test(char16 c16, longlong16 ll16, char16_e c16e, longlong16_e ll16e) {
f0(c16);
f0(ll16);
+#ifdef NO_LAX_INT
+ // expected-error@-2 {{no matching function}}
+#endif
f0(c16e);
f0(ll16e);
+#ifdef NO_LAX_INT
+ // expected-error@-2 {{no matching function}}
+#endif
}
int &f1(char16);
@@ -27,12 +35,14 @@
float &fr2 = f1(ll16e);
}
-void f2(char16_e); // expected-note{{no known conversion from 'longlong16_e' (vector of 2 'long long' values) to 'char16_e' (vector of 16 'char' values) for 1st argument}} \
- // expected-note{{candidate function not viable: no known conversion from 'convertible_to<longlong16_e>' to 'char16_e' (vector of 16 'char' values) for 1st argument}}
+void f2(char16_e); // expected-note 0+{{candidate}}
void f2_test(char16 c16, longlong16 ll16, char16_e c16e, longlong16_e ll16e) {
f2(c16);
f2(ll16);
+#ifdef NO_LAX_INT
+ // expected-error@-2 {{no matching function}}
+#endif
f2(c16e);
f2(ll16e); // expected-error{{no matching function}}
f2('a');
@@ -58,6 +68,11 @@
(void)(Cond? c16 : ll16);
(void)(Cond? ll16e : c16e);
(void)(Cond? ll16e : c16);
+#ifdef NO_LAX_INT
+ // expected-error@-4 {{cannot convert}}
+ // expected-error@-4 {{cannot convert}}
+ // expected-error@-4 {{cannot convert}}
+#endif
}
// Test C++ cast'ing of vector types.
@@ -85,9 +100,16 @@
// static_cast
(void)static_cast<char16>(ll16);
(void)static_cast<char16_e>(ll16);
+#ifdef NO_LAX_INT
+ // expected-error@-3 {{not allowed}}
+ // expected-error@-3 {{not allowed}}
+#endif
(void)static_cast<longlong16>(ll16);
(void)static_cast<longlong16_e>(ll16);
(void)static_cast<char16>(ll16e);
+#ifdef NO_LAX_INT
+ // expected-error@-2 {{not allowed}}
+#endif
(void)static_cast<char16_e>(ll16e); // expected-error{{static_cast from 'longlong16_e' (vector of 2 'long long' values) to 'char16_e' (vector of 16 'char' values) is not allowed}}
(void)static_cast<longlong16>(ll16e);
(void)static_cast<longlong16_e>(ll16e);
@@ -121,10 +143,19 @@
convertible_to<char16_e&> rto_c16e) {
f0(to_c16);
f0(to_ll16);
+#ifdef NO_LAX_INT
+ // expected-error@-2 {{no matching function}}
+#endif
f0(to_c16e);
f0(to_ll16e);
+#ifdef NO_LAX_INT
+ // expected-error@-2 {{no matching function}}
+#endif
f2(to_c16);
f2(to_ll16);
+#ifdef NO_LAX_INT
+ // expected-error@-2 {{no matching function}}
+#endif
f2(to_c16e);
f2(to_ll16e); // expected-error{{no matching function}}
@@ -193,6 +224,10 @@
// These 2 are convertible with -flax-vector-conversions (default)
(void)(Cond? to_c16 : to_ll16);
(void)(Cond? to_c16e : to_ll16e);
+#ifdef NO_LAX_INT
+ // expected-error@-3 {{cannot convert}}
+ // expected-error@-3 {{cannot convert}}
+#endif
}
typedef float fltx2 __attribute__((__vector_size__(8)));
@@ -203,6 +238,10 @@
void accept_fltx2(fltx2); // expected-note{{candidate function not viable: no known conversion from 'double' to 'fltx2' (vector of 2 'float' values) for 1st argument}}
void accept_fltx4(fltx4);
void accept_dblx2(dblx2);
+#ifdef NO_LAX_FLOAT
+// expected-note@-3 {{no known conversion}}
+// expected-note@-3 {{no known conversion}}
+#endif
void accept_dblx4(dblx4);
void accept_bool(bool); // expected-note{{candidate function not viable: no known conversion from 'fltx2' (vector of 2 'float' values) to 'bool' for 1st argument}}
@@ -214,9 +253,12 @@
accept_dblx4(dblx4_val);
// Same-size conversions
- // FIXME: G++ rejects these conversions, we accept them. Revisit this!
accept_fltx4(dblx2_val);
accept_dblx2(fltx4_val);
+#ifdef NO_LAX_FLOAT
+ // expected-error@-3 {{no matching function}}
+ // expected-error@-3 {{no matching function}}
+#endif
// Conversion to bool.
accept_bool(fltx2_val); // expected-error{{no matching function for call to 'accept_bool'}}
@@ -227,9 +269,9 @@
typedef int intx4 __attribute__((__vector_size__(16)));
typedef int inte4 __attribute__((__ext_vector_type__(4)));
-typedef int flte4 __attribute__((__ext_vector_type__(4)));
+typedef float flte4 __attribute__((__ext_vector_type__(4)));
-void test_mixed_vector_types(fltx4 f, intx4 n, flte4 g, flte4 m) {
+void test_mixed_vector_types(fltx4 f, intx4 n, flte4 g, inte4 m) {
(void)(f == g);
(void)(g != f);
(void)(f <= g);
@@ -295,40 +337,40 @@
namespace Templates {
template <typename Elt, unsigned Size>
struct TemplateVectorType {
- typedef Elt __attribute__((__vector_size__(Size))) type;
+ typedef Elt __attribute__((__vector_size__(Size))) type; // #1
};
template <int N, typename T>
struct PR15730 {
typedef T __attribute__((vector_size(N * sizeof(T)))) type;
- typedef T __attribute__((vector_size(8192))) type2;
- typedef T __attribute__((vector_size(3))) type3;
+ typedef T __attribute__((vector_size(8192))) type2; // #2
+ typedef T __attribute__((vector_size(3))) type3; // #3
};
void Init() {
const TemplateVectorType<float, 32>::type Works = {};
const TemplateVectorType<int, 32>::type Works2 = {};
- // expected-error@298 {{invalid vector element type 'bool'}}
+ // expected-error@#1 {{invalid vector element type 'bool'}}
// expected-note@+1 {{in instantiation of template class 'Templates::TemplateVectorType<bool, 32>' requested here}}
const TemplateVectorType<bool, 32>::type NoBool;
- // expected-error@298 {{invalid vector element type 'int __attribute__((ext_vector_type(4)))' (vector of 4 'int' values)}}
+ // expected-error@#1 {{invalid vector element type 'int __attribute__((ext_vector_type(4)))' (vector of 4 'int' values)}}
// expected-note@+1 {{in instantiation of template class 'Templates::TemplateVectorType<int __attribute__((ext_vector_type(4))), 32>' requested here}}
const TemplateVectorType<vi4, 32>::type NoComplex;
- // expected-error@298 {{vector size not an integral multiple of component size}}
+ // expected-error@#1 {{vector size not an integral multiple of component size}}
// expected-note@+1 {{in instantiation of template class 'Templates::TemplateVectorType<int, 33>' requested here}}
const TemplateVectorType<int, 33>::type BadSize;
- // expected-error@298 {{vector size too large}}
+ // expected-error@#1 {{vector size too large}}
// expected-note@+1 {{in instantiation of template class 'Templates::TemplateVectorType<int, 8192>' requested here}}
const TemplateVectorType<int, 8192>::type TooLarge;
- // expected-error@298 {{zero vector size}}
+ // expected-error@#1 {{zero vector size}}
// expected-note@+1 {{in instantiation of template class 'Templates::TemplateVectorType<int, 0>' requested here}}
const TemplateVectorType<int, 0>::type Zero;
- // expected-error@304 {{vector size too large}}
- // expected-error@305 {{vector size not an integral multiple of component size}}
+ // expected-error@#2 {{vector size too large}}
+ // expected-error@#3 {{vector size not an integral multiple of component size}}
// expected-note@+1 {{in instantiation of template class 'Templates::PR15730<8, int>' requested here}}
const PR15730<8, int>::type PR15730_1 = {};
- // expected-error@304 {{vector size too large}}
+ // expected-error@#2 {{vector size too large}}
// expected-note@+1 {{in instantiation of template class 'Templates::PR15730<8, char>' requested here}}
const PR15730<8, char>::type2 PR15730_2 = {};
}
diff --git a/src/llvm-project/clang/test/SemaCXX/warn-bitwise-compare.cpp b/src/llvm-project/clang/test/SemaCXX/warn-bitwise-compare.cpp
new file mode 100644
index 0000000..0fc3a6a
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaCXX/warn-bitwise-compare.cpp
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -Wtautological-bitwise-compare %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wall -Wno-unused %s
+
+void test(int x) {
+ bool b1 = (8 & x) == 3;
+ // expected-warning@-1 {{bitwise comparison always evaluates to false}}
+ bool b2 = x | 5;
+ // expected-warning@-1 {{bitwise or with non-zero value always evaluates to true}}
+ bool b3 = (x | 5);
+ // expected-warning@-1 {{bitwise or with non-zero value always evaluates to true}}
+ bool b4 = !!(x | 5);
+ // expected-warning@-1 {{bitwise or with non-zero value always evaluates to true}}
+}
diff --git a/src/llvm-project/clang/test/SemaCXX/warn-bool-conversion.cpp b/src/llvm-project/clang/test/SemaCXX/warn-bool-conversion.cpp
index ab563aa..6eca171 100644
--- a/src/llvm-project/clang/test/SemaCXX/warn-bool-conversion.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/warn-bool-conversion.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify=expected,expected-cxx11 %s
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
-// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
+// RUN: %clang_cc1 -fsyntax-only -verify=expected,expected-cxx11 -std=c++11 %s
namespace BooleanFalse {
int* j = false;
@@ -192,3 +192,23 @@
// expected-warning@-1{{address of 'x' will always evaluate to 'true'}}
}
}
+
+namespace Template {
+ // FIXME: These cases should not warn.
+ template<int *p> void f() { if (p) {} } // expected-warning 2{{will always evaluate to 'true'}} expected-cxx11-warning {{implicit conversion of nullptr}}
+ template<int (*p)[3]> void g() { if (p) {} } // expected-warning 2{{will always evaluate to 'true'}} expected-cxx11-warning {{implicit conversion of nullptr}}
+ template<int (*p)()> void h() { if (p) {} }
+
+ int a, b[3], c[3][3], d();
+ template void f<&a>(); // expected-note {{instantiation of}}
+ template void f<b>(); // expected-note {{instantiation of}}
+#if __cplusplus >= 201103L
+ template void f<(int*)nullptr>(); // expected-note {{instantiation of}}
+#endif
+ template void g<&b>(); // expected-note {{instantiation of}}
+ template void g<c>(); // expected-note {{instantiation of}}
+#if __cplusplus >= 201103L
+ template void g<(int(*)[3])nullptr>(); // expected-note {{instantiation of}}
+#endif
+ template void h<d>();
+}
diff --git a/src/llvm-project/clang/test/SemaCXX/warn-constant-evaluated-constexpr.cpp b/src/llvm-project/clang/test/SemaCXX/warn-constant-evaluated-constexpr.cpp
new file mode 100644
index 0000000..35dc69c
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaCXX/warn-constant-evaluated-constexpr.cpp
@@ -0,0 +1,56 @@
+// RUN: %clang_cc1 -std=c++2a -fsyntax-only -verify %s
+
+namespace std {
+constexpr bool is_constant_evaluated() noexcept {
+ return __builtin_is_constant_evaluated();
+}
+} // namespace std
+
+constexpr int fn1() {
+ if constexpr (std::is_constant_evaluated()) // expected-warning {{'std::is_constant_evaluated' will always evaluate to 'true' in a manifestly constant-evaluated expression}}
+ return 0;
+ else
+ return 1;
+}
+
+constexpr int fn2() {
+ if constexpr (!std::is_constant_evaluated()) // expected-warning {{'std::is_constant_evaluated' will always evaluate to 'true' in a manifestly constant-evaluated expression}}
+ return 0;
+ else
+ return 1;
+}
+
+constexpr int fn3() {
+ if constexpr (std::is_constant_evaluated() == false) // expected-warning {{'std::is_constant_evaluated' will always evaluate to 'true' in a manifestly constant-evaluated expression}}
+ return 0;
+ else
+ return 1;
+}
+
+constexpr int fn4() {
+ if constexpr (__builtin_is_constant_evaluated() == true) // expected-warning {{'__builtin_is_constant_evaluated' will always evaluate to 'true' in a manifestly constant-evaluated expression}}
+ return 0;
+ else
+ return 1;
+}
+
+constexpr int fn5() {
+ if constexpr (__builtin_is_constant_evaluated()) // expected-warning {{'__builtin_is_constant_evaluated' will always evaluate to 'true' in a manifestly constant-evaluated expression}}
+ return 0;
+ else
+ return 1;
+}
+
+constexpr int nowarn1() {
+ if (std::is_constant_evaluated())
+ return 0;
+ else
+ return 1;
+}
+
+constexpr int nowarn2() {
+ if (!__builtin_is_constant_evaluated())
+ return 0;
+ else
+ return 1;
+}
diff --git a/src/llvm-project/clang/test/SemaCXX/warn-consumed-analysis.cpp b/src/llvm-project/clang/test/SemaCXX/warn-consumed-analysis.cpp
index 0a6aed6..b4dddb6 100644
--- a/src/llvm-project/clang/test/SemaCXX/warn-consumed-analysis.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/warn-consumed-analysis.cpp
@@ -53,12 +53,18 @@
public:
DestructorTester();
DestructorTester(int);
+ DestructorTester(nullptr_t) RETURN_TYPESTATE(unconsumed);
+ DestructorTester(DestructorTester &&);
void operator*() CALLABLE_WHEN("unconsumed");
~DestructorTester() CALLABLE_WHEN("consumed");
+
};
+void dtByVal(DestructorTester);
+void dtByValMarkUnconsumed(DestructorTester RETURN_TYPESTATE(unconsumed));
+
void baf0(const ConsumableClass<int> var);
void baf1(const ConsumableClass<int> &var);
void baf2(const ConsumableClass<int> *var);
@@ -120,6 +126,19 @@
expected-warning {{invalid invocation of method '~DestructorTester' on object 'D1' while it is in the 'unconsumed' state}}
}
+void testDestructionByVal() {
+ {
+ // both the var and the temporary are consumed:
+ DestructorTester D0(nullptr);
+ dtByVal((DestructorTester &&)D0);
+ }
+ {
+ // the var is consumed but the temporary isn't:
+ DestructorTester D1(nullptr);
+ dtByValMarkUnconsumed((DestructorTester &&)D1); // expected-warning {{invalid invocation of method '~DestructorTester' on a temporary object 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}}
}
@@ -413,10 +432,15 @@
Param.consume();
}
+void testRvalueRefParamReturnTypestateCallee(ConsumableClass<int> &&Param RETURN_TYPESTATE(unconsumed)) {
+ Param.unconsume();
+}
+
void testParamReturnTypestateCaller() {
ConsumableClass<int> var;
testParamReturnTypestateCallee(true, var);
+ testRvalueRefParamReturnTypestateCallee((ConsumableClass<int> &&)var);
*var;
}
@@ -480,6 +504,9 @@
baf2(&var);
*var;
+
+ baf3(var);
+ *var;
baf4(var);
*var; // expected-warning {{invalid invocation of method 'operator*' on object 'var' while it is in the 'unknown' state}}
diff --git a/src/llvm-project/clang/test/SemaCXX/warn-enum-compare.cpp b/src/llvm-project/clang/test/SemaCXX/warn-enum-compare.cpp
index 21dea5d..eb777b2 100644
--- a/src/llvm-project/clang/test/SemaCXX/warn-enum-compare.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/warn-enum-compare.cpp
@@ -76,184 +76,184 @@
while (td == AnonAA); // expected-warning {{comparison of constant 'AnonAA' (42) with expression of type 'TD' is always false}}
#endif
- while (B1 == B2); // expected-warning {{comparison of two values with different enumeration types ('name1::Baz' and 'name2::Baz')}}
- while (name1::B2 == name2::B3); // expected-warning {{comparison of two values with different enumeration types ('name1::Baz' and 'name2::Baz')}}
- while (z == name2::B2); // expected-warning {{comparison of two values with different enumeration types ('name1::Baz' and 'name2::Baz')}}
+ while (B1 == B2); // expected-warning {{comparison of different enumeration types ('name1::Baz' and 'name2::Baz')}}
+ while (name1::B2 == name2::B3); // expected-warning {{comparison of different enumeration types ('name1::Baz' and 'name2::Baz')}}
+ while (z == name2::B2); // expected-warning {{comparison of different enumeration types ('name1::Baz' and 'name2::Baz')}}
- while (((((B1)))) == B2); // expected-warning {{comparison of two values with different enumeration types ('name1::Baz' and 'name2::Baz')}}
- while (name1::B2 == (name2::B3)); // expected-warning {{comparison of two values with different enumeration types ('name1::Baz' and 'name2::Baz')}}
- while (z == ((((name2::B2))))); // expected-warning {{comparison of two values with different enumeration types ('name1::Baz' and 'name2::Baz')}}
+ while (((((B1)))) == B2); // expected-warning {{comparison of different enumeration types ('name1::Baz' and 'name2::Baz')}}
+ while (name1::B2 == (name2::B3)); // expected-warning {{comparison of different enumeration types ('name1::Baz' and 'name2::Baz')}}
+ while (z == ((((name2::B2))))); // expected-warning {{comparison of different enumeration types ('name1::Baz' and 'name2::Baz')}}
- while ((((B1))) == (((B2)))); // expected-warning {{comparison of two values with different enumeration types ('name1::Baz' and 'name2::Baz')}}
- while ((name1::B2) == (((name2::B3)))); // expected-warning {{comparison of two values with different enumeration types ('name1::Baz' and 'name2::Baz')}}
- while ((((z))) == (name2::B2)); // expected-warning {{comparison of two values with different enumeration types ('name1::Baz' and 'name2::Baz')}}
+ while ((((B1))) == (((B2)))); // expected-warning {{comparison of different enumeration types ('name1::Baz' and 'name2::Baz')}}
+ while ((name1::B2) == (((name2::B3)))); // expected-warning {{comparison of different enumeration types ('name1::Baz' and 'name2::Baz')}}
+ while ((((z))) == (name2::B2)); // expected-warning {{comparison of different enumeration types ('name1::Baz' and 'name2::Baz')}}
- while (x == a); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'name1::Foo')}}
- while (x == b); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'oneFoo' (aka 'name1::Foo'))}}
- while (x == c); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'twoFoo' (aka 'name1::Foo'))}}
+ while (x == a); // expected-warning {{comparison of different enumeration types ('Foo' and 'name1::Foo')}}
+ while (x == b); // expected-warning {{comparison of different enumeration types ('Foo' and 'oneFoo' (aka 'name1::Foo'))}}
+ while (x == c); // expected-warning {{comparison of different enumeration types ('Foo' and 'twoFoo' (aka 'name1::Foo'))}}
- while (x == y); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (x != y); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (x >= y); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (x <= y); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (x > y); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (x < y); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
+ while (x == y); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (x != y); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (x >= y); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (x <= y); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (x > y); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (x < y); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
- while (FooB == y); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (FooB != y); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (FooB >= y); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (FooB <= y); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (FooB > y); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (FooB < y); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
+ while (FooB == y); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (FooB != y); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (FooB >= y); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (FooB <= y); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (FooB > y); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (FooB < y); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
- while (FooB == BarD); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (FooB != BarD); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (FooB >= BarD); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (FooB <= BarD); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (FooB > BarD); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (FooB < BarD); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
+ while (FooB == BarD); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (FooB != BarD); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (FooB >= BarD); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (FooB <= BarD); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (FooB > BarD); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (FooB < BarD); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
- while (x == BarD); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (x != BarD); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (x >= BarD); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (x <= BarD); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (x > BarD); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (x < BarD); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
+ while (x == BarD); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (x != BarD); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (x >= BarD); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (x <= BarD); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (x > BarD); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (x < BarD); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
- while (getFoo() == y); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (getFoo() != y); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (getFoo() >= y); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (getFoo() <= y); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (getFoo() > y); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (getFoo() < y); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
+ while (getFoo() == y); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (getFoo() != y); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (getFoo() >= y); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (getFoo() <= y); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (getFoo() > y); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (getFoo() < y); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
- while (getFoo() == BarD); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (getFoo() != BarD); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (getFoo() >= BarD); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (getFoo() <= BarD); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (getFoo() > BarD); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (getFoo() < BarD); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
+ while (getFoo() == BarD); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (getFoo() != BarD); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (getFoo() >= BarD); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (getFoo() <= BarD); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (getFoo() > BarD); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (getFoo() < BarD); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
- while (getFoo() == getBar()); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (getFoo() != getBar()); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (getFoo() >= getBar()); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (getFoo() <= getBar()); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (getFoo() > getBar()); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (getFoo() < getBar()); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
+ while (getFoo() == getBar()); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (getFoo() != getBar()); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (getFoo() >= getBar()); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (getFoo() <= getBar()); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (getFoo() > getBar()); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (getFoo() < getBar()); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
- while (FooB == getBar()); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (FooB != getBar()); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (FooB >= getBar()); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (FooB <= getBar()); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (FooB > getBar()); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (FooB < getBar()); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
+ while (FooB == getBar()); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (FooB != getBar()); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (FooB >= getBar()); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (FooB <= getBar()); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (FooB > getBar()); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (FooB < getBar()); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
- while (x == getBar()); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (x != getBar()); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (x >= getBar()); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (x <= getBar()); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (x > getBar()); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
- while (x < getBar()); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'Bar')}}
+ while (x == getBar()); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (x != getBar()); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (x >= getBar()); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (x <= getBar()); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (x > getBar()); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
+ while (x < getBar()); // expected-warning {{comparison of different enumeration types ('Foo' and 'Bar')}}
- while (y == x); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (y != x); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (y >= x); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (y <= x); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (y > x); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (y < x); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
+ while (y == x); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (y != x); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (y >= x); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (y <= x); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (y > x); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (y < x); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
- while (y == FooB); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (y != FooB); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (y >= FooB); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (y <= FooB); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (y > FooB); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (y < FooB); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
+ while (y == FooB); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (y != FooB); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (y >= FooB); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (y <= FooB); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (y > FooB); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (y < FooB); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
- while (BarD == FooB); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (BarD != FooB); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (BarD >= FooB); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (BarD <= FooB); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (BarD > FooB); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (BarD <FooB); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
+ while (BarD == FooB); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (BarD != FooB); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (BarD >= FooB); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (BarD <= FooB); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (BarD > FooB); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (BarD <FooB); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
- while (BarD == x); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (BarD != x); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (BarD >= x); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (BarD <= x); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (BarD < x); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (BarD > x); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
+ while (BarD == x); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (BarD != x); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (BarD >= x); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (BarD <= x); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (BarD < x); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (BarD > x); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
- while (y == getFoo()); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (y != getFoo()); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (y >= getFoo()); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (y <= getFoo()); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (y > getFoo()); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (y < getFoo()); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
+ while (y == getFoo()); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (y != getFoo()); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (y >= getFoo()); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (y <= getFoo()); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (y > getFoo()); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (y < getFoo()); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
- while (BarD == getFoo()); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (BarD != getFoo()); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (BarD >= getFoo()); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (BarD <= getFoo()); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (BarD > getFoo()); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (BarD < getFoo()); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
+ while (BarD == getFoo()); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (BarD != getFoo()); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (BarD >= getFoo()); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (BarD <= getFoo()); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (BarD > getFoo()); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (BarD < getFoo()); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
- while (getBar() == getFoo()); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (getBar() != getFoo()); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (getBar() >= getFoo()); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (getBar() <= getFoo()); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (getBar() > getFoo()); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (getBar() < getFoo()); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
+ while (getBar() == getFoo()); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (getBar() != getFoo()); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (getBar() >= getFoo()); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (getBar() <= getFoo()); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (getBar() > getFoo()); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (getBar() < getFoo()); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
- while (getBar() == FooB); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (getBar() != FooB); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (getBar() >= FooB); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (getBar() <= FooB); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (getBar() > FooB); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (getBar() < FooB); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
+ while (getBar() == FooB); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (getBar() != FooB); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (getBar() >= FooB); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (getBar() <= FooB); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (getBar() > FooB); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (getBar() < FooB); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
- while (getBar() == x); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (getBar() != x); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (getBar() >= x); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (getBar() <= x); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (getBar() > x); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
- while (getBar() < x); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'Foo')}}
+ while (getBar() == x); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (getBar() != x); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (getBar() >= x); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (getBar() <= x); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (getBar() > x); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
+ while (getBar() < x); // expected-warning {{comparison of different enumeration types ('Bar' and 'Foo')}}
- while (td == FooA); // expected-warning {{comparison of two values with different enumeration types ('TD' and 'Foo')}}
- while (td == BarD); // expected-warning {{comparison of two values with different enumeration types ('TD' and 'Bar')}}
- while (name1::F1 == td); // expected-warning {{comparison of two values with different enumeration types ('name1::Foo' and 'TD')}}
- while (name2::B1 == td); // expected-warning {{comparison of two values with different enumeration types ('name2::Baz' and 'TD')}}
- while (td == a); // expected-warning {{comparison of two values with different enumeration types ('TD' and 'name1::Foo')}}
- while (td == b); // expected-warning {{comparison of two values with different enumeration types ('TD' and 'oneFoo' (aka 'name1::Foo'))}}
- while (td == c); // expected-warning {{comparison of two values with different enumeration types ('TD' and 'twoFoo' (aka 'name1::Foo'))}}
- while (td == x); // expected-warning {{comparison of two values with different enumeration types ('TD' and 'Foo')}}
- while (td == y); // expected-warning {{comparison of two values with different enumeration types ('TD' and 'Bar')}}
- while (td == z); // expected-warning {{comparison of two values with different enumeration types ('TD' and 'name1::Baz')}}
+ while (td == FooA); // expected-warning {{comparison of different enumeration types ('TD' and 'Foo')}}
+ while (td == BarD); // expected-warning {{comparison of different enumeration types ('TD' and 'Bar')}}
+ while (name1::F1 == td); // expected-warning {{comparison of different enumeration types ('name1::Foo' and 'TD')}}
+ while (name2::B1 == td); // expected-warning {{comparison of different enumeration types ('name2::Baz' and 'TD')}}
+ while (td == a); // expected-warning {{comparison of different enumeration types ('TD' and 'name1::Foo')}}
+ while (td == b); // expected-warning {{comparison of different enumeration types ('TD' and 'oneFoo' (aka 'name1::Foo'))}}
+ while (td == c); // expected-warning {{comparison of different enumeration types ('TD' and 'twoFoo' (aka 'name1::Foo'))}}
+ while (td == x); // expected-warning {{comparison of different enumeration types ('TD' and 'Foo')}}
+ while (td == y); // expected-warning {{comparison of different enumeration types ('TD' and 'Bar')}}
+ while (td == z); // expected-warning {{comparison of different enumeration types ('TD' and 'name1::Baz')}}
- while (a == TD1); // expected-warning {{comparison of two values with different enumeration types ('name1::Foo' and 'TD')}}
- while (b == TD2); // expected-warning {{comparison of two values with different enumeration types ('oneFoo' (aka 'name1::Foo') and 'TD')}}
- while (c == TD1); // expected-warning {{comparison of two values with different enumeration types ('twoFoo' (aka 'name1::Foo') and 'TD')}}
- while (x == TD2); // expected-warning {{comparison of two values with different enumeration types ('Foo' and 'TD')}}
- while (y == TD1); // expected-warning {{comparison of two values with different enumeration types ('Bar' and 'TD')}}
- while (z == TD2); // expected-warning {{comparison of two values with different enumeration types ('name1::Baz' and 'TD')}}
+ while (a == TD1); // expected-warning {{comparison of different enumeration types ('name1::Foo' and 'TD')}}
+ while (b == TD2); // expected-warning {{comparison of different enumeration types ('oneFoo' (aka 'name1::Foo') and 'TD')}}
+ while (c == TD1); // expected-warning {{comparison of different enumeration types ('twoFoo' (aka 'name1::Foo') and 'TD')}}
+ while (x == TD2); // expected-warning {{comparison of different enumeration types ('Foo' and 'TD')}}
+ while (y == TD1); // expected-warning {{comparison of different enumeration types ('Bar' and 'TD')}}
+ while (z == TD2); // expected-warning {{comparison of different enumeration types ('name1::Baz' and 'TD')}}
switch (a) {
case name1::F1: break;
case name1::F3: break;
- case name2::B2: break; // expected-warning {{comparison of two values with different enumeration types in switch statement ('name1::Foo' and 'name2::Baz')}}
+ case name2::B2: break; // expected-warning {{comparison of different enumeration types in switch statement ('name1::Foo' and 'name2::Baz')}}
}
switch (x) {
case FooB: break;
case FooC: break;
- case BarD: break; // expected-warning {{comparison of two values with different enumeration types in switch statement ('Foo' and 'Bar')}}
+ case BarD: break; // expected-warning {{comparison of different enumeration types in switch statement ('Foo' and 'Bar')}}
}
switch(getBar()) {
case BarE: break;
case BarF: break;
- case FooA: break; // expected-warning {{comparison of two values with different enumeration types in switch statement ('Bar' and 'Foo')}}
+ case FooA: break; // expected-warning {{comparison of different enumeration types in switch statement ('Bar' and 'Foo')}}
}
switch(x) {
@@ -265,8 +265,8 @@
switch (td) {
case TD1: break;
- case FooB: break; // expected-warning {{comparison of two values with different enumeration types in switch statement ('TD' and 'Foo')}}
- case BarF: break; // expected-warning {{comparison of two values with different enumeration types in switch statement ('TD' and 'Bar')}}
+ case FooB: break; // expected-warning {{comparison of different enumeration types in switch statement ('TD' and 'Foo')}}
+ case BarF: break; // expected-warning {{comparison of different enumeration types in switch statement ('TD' and 'Bar')}}
// expected-warning@-1 {{case value not in enumerated type 'TD'}}
case AnonAA: break; // expected-warning {{case value not in enumerated type 'TD'}}
}
@@ -277,8 +277,8 @@
}
switch (a) {
- case TD1: break; // expected-warning {{comparison of two values with different enumeration types in switch statement ('name1::Foo' and 'TD')}}
- case TD2: break; // expected-warning {{comparison of two values with different enumeration types in switch statement ('name1::Foo' and 'TD')}}
+ case TD1: break; // expected-warning {{comparison of different enumeration types in switch statement ('name1::Foo' and 'TD')}}
+ case TD2: break; // expected-warning {{comparison of different enumeration types in switch statement ('name1::Foo' and 'TD')}}
case name1::F3: break;
}
}
diff --git a/src/llvm-project/clang/test/SemaCXX/warn-final-dtor-non-final-class.cpp b/src/llvm-project/clang/test/SemaCXX/warn-final-dtor-non-final-class.cpp
new file mode 100644
index 0000000..a96aa44
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaCXX/warn-final-dtor-non-final-class.cpp
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s -Wfinal-dtor-non-final-class
+// RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -Wfinal-dtor-non-final-class -fdiagnostics-parseable-fixits 2>&1 | FileCheck %s
+
+class A {
+ ~A();
+};
+
+class B { // expected-note {{mark 'B' as 'final' to silence this warning}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:8-[[@LINE-1]]:8}:" final"
+ virtual ~B() final; // expected-warning {{class with destructor marked 'final' cannot be inherited from}}
+};
+
+class C final {
+ virtual ~C() final;
+};
diff --git a/src/llvm-project/clang/test/SemaCXX/warn-missing-noreturn.cpp b/src/llvm-project/clang/test/SemaCXX/warn-missing-noreturn.cpp
index 8072ac6..618229a 100644
--- a/src/llvm-project/clang/test/SemaCXX/warn-missing-noreturn.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/warn-missing-noreturn.cpp
@@ -91,7 +91,7 @@
int rdar8875247_test() {
rdar8875247 f;
-} // expected-warning{{control reaches end of non-void function}}
+} // expected-warning{{non-void function does not return a value}}
struct rdar8875247_B {
rdar8875247_B();
diff --git a/src/llvm-project/clang/test/SemaCXX/warn-missing-variable-declarations.cpp b/src/llvm-project/clang/test/SemaCXX/warn-missing-variable-declarations.cpp
index e2480fd..b50eeed 100644
--- a/src/llvm-project/clang/test/SemaCXX/warn-missing-variable-declarations.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/warn-missing-variable-declarations.cpp
@@ -70,6 +70,8 @@
template<typename> constexpr int const_var_template = 0;
template<typename> static int static_var_template = 0;
+template<typename T> int var_template<T*>;
+
template int var_template<int[1]>;
int use_var_template() { return var_template<int[2]>; }
template int var_template<int[3]>;
diff --git a/src/llvm-project/clang/test/SemaCXX/warn-overaligned-type-thrown.cpp b/src/llvm-project/clang/test/SemaCXX/warn-overaligned-type-thrown.cpp
index 0801017..d746844 100644
--- a/src/llvm-project/clang/test/SemaCXX/warn-overaligned-type-thrown.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/warn-overaligned-type-thrown.cpp
@@ -2,11 +2,12 @@
// RUN: %clang_cc1 -triple arm64-apple-ios10 -verify -fsyntax-only -std=c++11 -fcxx-exceptions -fexceptions -DUNDERALIGNED %s
// RUN: %clang_cc1 -triple arm64-apple-tvos10 -verify -fsyntax-only -std=c++11 -fcxx-exceptions -fexceptions -DUNDERALIGNED %s
// RUN: %clang_cc1 -triple arm64-apple-watchos4 -verify -fsyntax-only -std=c++11 -fcxx-exceptions -fexceptions -DUNDERALIGNED %s
+// RUN: %clang_cc1 -triple arm-linux-gnueabi -verify -fsyntax-only -std=c++11 -fcxx-exceptions -fexceptions -DUNDERALIGNED %s
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.14 -verify -fsyntax-only -std=c++11 -fcxx-exceptions -fexceptions %s
// RUN: %clang_cc1 -triple arm64-apple-ios12 -verify -fsyntax-only -std=c++11 -fcxx-exceptions -fexceptions %s
// RUN: %clang_cc1 -triple arm64-apple-tvos12 -verify -fsyntax-only -std=c++11 -fcxx-exceptions -fexceptions %s
// RUN: %clang_cc1 -triple arm64-apple-watchos5 -verify -fsyntax-only -std=c++11 -fcxx-exceptions -fexceptions %s
-// RUN: %clang_cc1 -triple arm-linux-gnueabi -verify -fsyntax-only -std=c++11 -fcxx-exceptions -fexceptions %s
+// RUN: %clang_cc1 -triple arm-linux-androideabi -verify -fsyntax-only -std=c++11 -fcxx-exceptions -fexceptions %s
// RUN: %clang_cc1 -triple aarch64-linux-gnueabi -verify -fsyntax-only -std=c++11 -fcxx-exceptions -fexceptions %s
// RUN: %clang_cc1 -triple mipsel-linux-gnu -verify -fsyntax-only -std=c++11 -fcxx-exceptions -fexceptions %s
// RUN: %clang_cc1 -triple mips64el-linux-gnu -verify -fsyntax-only -std=c++11 -fcxx-exceptions -fexceptions %s
diff --git a/src/llvm-project/clang/test/SemaCXX/warn-pessmizing-move.cpp b/src/llvm-project/clang/test/SemaCXX/warn-pessmizing-move.cpp
index 71e99dc..2c27cd7 100644
--- a/src/llvm-project/clang/test/SemaCXX/warn-pessmizing-move.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/warn-pessmizing-move.cpp
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -fsyntax-only -Wpessimizing-move -std=c++11 -verify %s
+// RUN: %clang_cc1 -fsyntax-only -Wpessimizing-move -std=c++11 -verify %s -DUSER_DEFINED
// RUN: %clang_cc1 -fsyntax-only -Wpessimizing-move -std=c++11 -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
// definitions for std::move
@@ -12,7 +13,15 @@
}
}
-struct A {};
+struct A {
+#ifdef USER_DEFINED
+ A() {}
+ A(const A &) {}
+ A(A &&) {}
+ A &operator=(const A &) { return *this; }
+ A &operator=(A &&) { return *this; }
+#endif
+};
struct B {
B() {}
B(A) {}
@@ -47,6 +56,19 @@
// expected-note@-2{{remove std::move call}}
// CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:10-[[@LINE-3]]:20}:""
// CHECK: fix-it:"{{.*}}":{[[@LINE-4]]:22-[[@LINE-4]]:23}:""
+
+ return A();
+ return test1(a2);
+ return std::move(A());
+ // expected-warning@-1{{prevents copy elision}}
+ // expected-note@-2{{remove std::move call}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:10-[[@LINE-3]]:20}:""
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-4]]:23-[[@LINE-4]]:24}:""
+ return std::move(test1(a2));
+ // expected-warning@-1{{prevents copy elision}}
+ // expected-note@-2{{remove std::move call}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:10-[[@LINE-3]]:20}:""
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-4]]:29-[[@LINE-4]]:30}:""
}
A global_a;
@@ -101,11 +123,24 @@
// expected-note@-2{{remove std::move call}}
// CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:10-[[@LINE-3]]:20}:""
// CHECK: fix-it:"{{.*}}":{[[@LINE-4]]:23-[[@LINE-4]]:24}:""
+
+ a3 = std::move(A());
+ // expected-warning@-1{{prevents copy elision}}
+ // expected-note@-2{{remove std::move call}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:8-[[@LINE-3]]:18}:""
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-4]]:21-[[@LINE-4]]:22}:""
+
A a4 = std::move(test3());
// expected-warning@-1{{prevents copy elision}}
// expected-note@-2{{remove std::move call}}
// CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:10-[[@LINE-3]]:20}:""
// CHECK: fix-it:"{{.*}}":{[[@LINE-4]]:27-[[@LINE-4]]:28}:""
+
+ a4 = std::move(test3());
+ // expected-warning@-1{{prevents copy elision}}
+ // expected-note@-2{{remove std::move call}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:8-[[@LINE-3]]:18}:""
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-4]]:25-[[@LINE-4]]:26}:""
}
A test7() {
diff --git a/src/llvm-project/clang/test/SemaCXX/warn-range-loop-analysis-trivially-copyable.cpp b/src/llvm-project/clang/test/SemaCXX/warn-range-loop-analysis-trivially-copyable.cpp
new file mode 100644
index 0000000..f4c76f2
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaCXX/warn-range-loop-analysis-trivially-copyable.cpp
@@ -0,0 +1,89 @@
+// RUN: %clang_cc1 -fsyntax-only -std=c++11 -Wloop-analysis -verify %s
+// RUN: %clang_cc1 -fsyntax-only -std=c++11 -Wrange-loop-analysis -verify %s
+
+void test_POD_64_bytes() {
+ struct Record {
+ char a[64];
+ };
+
+ Record records[8];
+ for (const auto r : records)
+ (void)r;
+}
+
+void test_POD_65_bytes() {
+ struct Record {
+ char a[65];
+ };
+
+ // expected-warning@+3 {{loop variable 'r' of type 'const Record' creates a copy from type 'const Record'}}
+ // expected-note@+2 {{use reference type 'const Record &' to prevent copying}}
+ Record records[8];
+ for (const auto r : records)
+ (void)r;
+}
+
+void test_TriviallyCopyable_64_bytes() {
+ struct Record {
+ Record() {}
+ char a[64];
+ };
+
+ Record records[8];
+ for (const auto r : records)
+ (void)r;
+}
+
+void test_TriviallyCopyable_65_bytes() {
+ struct Record {
+ Record() {}
+ char a[65];
+ };
+
+ // expected-warning@+3 {{loop variable 'r' of type 'const Record' creates a copy from type 'const Record'}}
+ // expected-note@+2 {{use reference type 'const Record &' to prevent copying}}
+ Record records[8];
+ for (const auto r : records)
+ (void)r;
+}
+
+void test_NonTriviallyCopyable() {
+ struct Record {
+ Record() {}
+ ~Record() {}
+ volatile int a;
+ int b;
+ };
+
+ // expected-warning@+3 {{loop variable 'r' of type 'const Record' creates a copy from type 'const Record'}}
+ // expected-note@+2 {{use reference type 'const Record &' to prevent copying}}
+ Record records[8];
+ for (const auto r : records)
+ (void)r;
+}
+
+void test_TrivialABI_64_bytes() {
+ struct [[clang::trivial_abi]] Record {
+ Record() {}
+ ~Record() {}
+ char a[64];
+ };
+
+ Record records[8];
+ for (const auto r : records)
+ (void)r;
+}
+
+void test_TrivialABI_65_bytes() {
+ struct [[clang::trivial_abi]] Record {
+ Record() {}
+ ~Record() {}
+ char a[65];
+ };
+
+ // expected-warning@+3 {{loop variable 'r' of type 'const Record' creates a copy from type 'const Record'}}
+ // expected-note@+2 {{use reference type 'const Record &' to prevent copying}}
+ Record records[8];
+ for (const auto r : records)
+ (void)r;
+}
diff --git a/src/llvm-project/clang/test/SemaCXX/warn-range-loop-analysis.cpp b/src/llvm-project/clang/test/SemaCXX/warn-range-loop-analysis.cpp
index 98c4a18..8331e60 100644
--- a/src/llvm-project/clang/test/SemaCXX/warn-range-loop-analysis.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/warn-range-loop-analysis.cpp
@@ -1,5 +1,7 @@
+// RUN: %clang_cc1 -fsyntax-only -std=c++11 -Wall -Wrange-loop-bind-reference -Wno-unused -verify %s
// RUN: %clang_cc1 -fsyntax-only -std=c++11 -Wloop-analysis -verify %s
// RUN: %clang_cc1 -fsyntax-only -std=c++11 -Wrange-loop-analysis -verify %s
+// RUN: %clang_cc1 -fsyntax-only -std=c++11 -Wloop-analysis -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
template <typename return_type>
struct Iterator {
@@ -18,6 +20,10 @@
struct Foo {};
struct Bar {
+ // Small trivially copyable types do not show a warning when copied in a
+ // range-based for loop. This size ensures the object is not considered
+ // small.
+ char s[128];
Bar(Foo);
Bar(int);
operator int();
@@ -67,44 +73,62 @@
for (const int &x : int_non_ref_container) {}
// expected-warning@-1 {{loop variable 'x' is always a copy because the range of type 'Container<int>' does not return a reference}}
// expected-note@-2 {{use non-reference type 'int'}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:18-[[@LINE-3]]:19}:""
for (const double &x : int_container) {}
// expected-warning@-1 {{loop variable 'x' has type 'const double &' but is initialized with type 'int' resulting in a copy}}
// expected-note@-2 {{use non-reference type 'double' to keep the copy or type 'const int &' to prevent copying}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:21-[[@LINE-3]]:22}:""
for (const Bar x : bar_container) {}
// expected-warning@-1 {{loop variable 'x' of type 'const Bar' creates a copy from type 'const Bar'}}
// expected-note@-2 {{use reference type 'const Bar &' to prevent copying}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:18-[[@LINE-3]]:18}:"&"
}
void test1() {
Container<int> A;
+ for (const int &&x : A) {}
+ // No warning, rvalue-reference to the temporary
for (const int &x : A) {}
// expected-warning@-1 {{always a copy}}
// expected-note@-2 {{'int'}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:18-[[@LINE-3]]:19}:""
for (const int x : A) {}
// No warning, non-reference type indicates copy is made
+ for (int&& x : A) {}
+ // No warning, rvalue-reference to the temporary
//for (int &x : A) {}
// Binding error
for (int x : A) {}
// No warning, non-reference type indicates copy is made
+ for (const double &&x : A) {}
+ // No warning, rvalue-reference to the temporary
for (const double &x : A) {}
// expected-warning@-1 {{always a copy}}
// expected-note@-2 {{'double'}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:21-[[@LINE-3]]:22}:""
for (const double x : A) {}
// No warning, non-reference type indicates copy is made
+ for (double &&x : A) {}
+ // No warning, rvalue-reference to the temporary
//for (double &x : A) {}
// Binding error
for (double x : A) {}
// No warning, non-reference type indicates copy is made
+ for (const Bar &&x : A) {}
+ // No warning, rvalue-reference to the temporary
for (const Bar &x : A) {}
// expected-warning@-1 {{always a copy}}
// expected-note@-2 {{'Bar'}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:18-[[@LINE-3]]:19}:""
for (const Bar x : A) {}
// No warning, non-reference type indicates copy is made
+ for (Bar &&x : A) {}
+ // No warning, rvalue-reference to the temporary
//for (Bar &x : A) {}
// Binding error
for (Bar x : A) {}
@@ -114,28 +138,50 @@
void test2() {
Container<int&> B;
+ //for (const int &&x : B) {}
+ // Binding error
for (const int &x : B) {}
// No warning, this reference is not a temporary
for (const int x : B) {}
// No warning on POD copy
+ //for (int &x : B) {}
+ // Binding error
for (int &x : B) {}
// No warning
for (int x : B) {}
// No warning
+ for (const double &&x : B) {}
+ // expected-warning@-1 {{resulting in a copy}}
+ // expected-note-re@-2 {{'double'{{.*}}'const int &'}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:21-[[@LINE-3]]:23}:""
for (const double &x : B) {}
// expected-warning@-1 {{resulting in a copy}}
// expected-note-re@-2 {{'double'{{.*}}'const int &'}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:21-[[@LINE-3]]:22}:""
for (const double x : B) {}
+ for (double &&x : B) {}
+ // expected-warning@-1 {{resulting in a copy}}
+ // expected-note-re@-2 {{'double'{{.*}}'const int &'}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:15-[[@LINE-3]]:17}:""
//for (double &x : B) {}
// Binding error
for (double x : B) {}
// No warning
+ for (const Bar &&x : B) {}
+ // expected-warning@-1 {{resulting in a copy}}
+ // expected-note@-2 {{'Bar'}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:18-[[@LINE-3]]:20}:""
for (const Bar &x : B) {}
// expected-warning@-1 {{resulting in a copy}}
// expected-note@-2 {{'Bar'}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:18-[[@LINE-3]]:19}:""
for (const Bar x : B) {}
+ for (Bar &&x : B) {}
+ // expected-warning@-1 {{resulting in a copy}}
+ // expected-note@-2 {{'Bar'}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:12-[[@LINE-3]]:14}:""
//for (Bar &x : B) {}
// Binding error
for (Bar x : B) {}
@@ -145,21 +191,31 @@
void test3() {
Container<Bar> C;
+ for (const Bar &&x : C) {}
+ // No warning, rvalue-reference to the temporary
for (const Bar &x : C) {}
// expected-warning@-1 {{always a copy}}
// expected-note@-2 {{'Bar'}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:18-[[@LINE-3]]:19}:""
for (const Bar x : C) {}
// No warning, non-reference type indicates copy is made
+ for (Bar &&x : C) {}
+ // No warning, rvalue-reference to the temporary
//for (Bar &x : C) {}
// Binding error
for (Bar x : C) {}
// No warning, non-reference type indicates copy is made
+ for (const int &&x : C) {}
+ // No warning, rvalue-reference to the temporary
for (const int &x : C) {}
// expected-warning@-1 {{always a copy}}
// expected-note@-2 {{'int'}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:18-[[@LINE-3]]:19}:""
for (const int x : C) {}
// No warning, copy made
+ for (int &&x : C) {}
+ // No warning, rvalue-reference to the temporary
//for (int &x : C) {}
// Binding error
for (int x : C) {}
@@ -169,21 +225,35 @@
void test4() {
Container<Bar&> D;
+ //for (const Bar &&x : D) {}
+ // Binding error
for (const Bar &x : D) {}
// No warning, this reference is not a temporary
for (const Bar x : D) {}
// expected-warning@-1 {{creates a copy}}
// expected-note@-2 {{'const Bar &'}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:18-[[@LINE-3]]:18}:"&"
+ //for (Bar &&x : D) {}
+ // Binding error
for (Bar &x : D) {}
// No warning
for (Bar x : D) {}
// No warning
+ for (const int &&x : D) {}
+ // expected-warning@-1 {{resulting in a copy}}
+ // expected-note-re@-2 {{'int'{{.*}}'const Bar &'}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:18-[[@LINE-3]]:20}:""
for (const int &x : D) {}
// expected-warning@-1 {{resulting in a copy}}
// expected-note-re@-2 {{'int'{{.*}}'const Bar &'}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:18-[[@LINE-3]]:19}:""
for (const int x : D) {}
// No warning
+ for (int &&x : D) {}
+ // expected-warning@-1 {{resulting in a copy}}
+ // expected-note-re@-2 {{'int'{{.*}}'const Bar &'}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:12-[[@LINE-3]]:14}:""
//for (int &x : D) {}
// Binding error
for (int x : D) {}
@@ -193,11 +263,16 @@
void test5() {
Container<Foo> E;
+ for (const Bar &&x : E) {}
+ // No warning, rvalue-reference to the temporary
for (const Bar &x : E) {}
// expected-warning@-1 {{always a copy}}
// expected-note@-2 {{'Bar'}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:18-[[@LINE-3]]:19}:""
for (const Bar x : E) {}
// No warning, non-reference type indicates copy is made
+ for (Bar &&x : E) {}
+ // No warning, rvalue-reference to the temporary
//for (Bar &x : E) {}
// Binding error
for (Bar x : E) {}
@@ -207,11 +282,20 @@
void test6() {
Container<Foo&> F;
+ for (const Bar &&x : F) {}
+ // expected-warning@-1 {{resulting in a copy}}
+ // expected-note-re@-2 {{'Bar'{{.*}}'const Foo &'}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:18-[[@LINE-3]]:20}:""
for (const Bar &x : F) {}
// expected-warning@-1 {{resulting in a copy}}
// expected-note-re@-2 {{'Bar'{{.*}}'const Foo &'}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:18-[[@LINE-3]]:19}:""
for (const Bar x : F) {}
// No warning.
+ for (Bar &&x : F) {}
+ // expected-warning@-1 {{resulting in a copy}}
+ // expected-note-re@-2 {{'Bar'{{.*}}'const Foo &'}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:12-[[@LINE-3]]:14}:""
//for (Bar &x : F) {}
// Binding error
for (Bar x : F) {}
@@ -221,53 +305,88 @@
void test7() {
double G[2];
+ //for (const double &&x : G) {}
+ // Binding error
for (const double &x : G) {}
// No warning
for (const double x : G) {}
// No warning on POD copy
+ //for (double &&x : G) {}
+ // Binding error
for (double &x : G) {}
// No warning
for (double x : G) {}
// No warning
+ for (const int &&x : G) {}
+ // expected-warning@-1 {{resulting in a copy}}
+ // expected-note-re@-2 {{'int'{{.*}}'const double &'}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:18-[[@LINE-3]]:20}:""
for (const int &x : G) {}
// expected-warning@-1 {{resulting in a copy}}
// expected-note-re@-2 {{'int'{{.*}}'const double &'}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:18-[[@LINE-3]]:19}:""
for (const int x : G) {}
// No warning
+ for (int &&x : G) {}
+ // expected-warning@-1 {{resulting in a copy}}
+ // expected-note-re@-2 {{'int'{{.*}}'const double &'}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:12-[[@LINE-3]]:14}:""
//for (int &x : G) {}
// Binding error
for (int x : G) {}
// No warning
+ for (const Bar &&x : G) {}
+ // expected-warning@-1 {{resulting in a copy}}
+ // expected-note-re@-2 {{'Bar'{{.*}}'const double &'}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:18-[[@LINE-3]]:20}:""
for (const Bar &x : G) {}
// expected-warning@-1 {{resulting in a copy}}
// expected-note-re@-2 {{'Bar'{{.*}}'const double &'}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:18-[[@LINE-3]]:19}:""
for (const Bar x : G) {}
// No warning
- //for (int &Bar : G) {}
+ for (Bar &&x : G) {}
+ // expected-warning@-1 {{resulting in a copy}}
+ // expected-note-re@-2 {{'Bar'{{.*}}'const double &'}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:12-[[@LINE-3]]:14}:""
+ //for (Bar &x : G) {}
// Binding error
- for (int Bar : G) {}
+ for (Bar x : G) {}
// No warning
}
void test8() {
Foo H[2];
+ //for (const Foo &&x : H) {}
+ // Binding error
for (const Foo &x : H) {}
// No warning
for (const Foo x : H) {}
// No warning on POD copy
+ //for (Foo &&x : H) {}
+ // Binding error
for (Foo &x : H) {}
// No warning
for (Foo x : H) {}
// No warning
+ for (const Bar &&x : H) {}
+ // expected-warning@-1 {{resulting in a copy}}
+ // expected-note-re@-2 {{'Bar'{{.*}}'const Foo &'}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:18-[[@LINE-3]]:20}:""
for (const Bar &x : H) {}
// expected-warning@-1 {{resulting in a copy}}
// expected-note-re@-2 {{'Bar'{{.*}}'const Foo &'}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:18-[[@LINE-3]]:19}:""
for (const Bar x : H) {}
// No warning
+ for (Bar &&x: H) {}
+ // expected-warning@-1 {{resulting in a copy}}
+ // expected-note-re@-2 {{'Bar'{{.*}}'const Foo &'}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:12-[[@LINE-3]]:14}:""
//for (Bar &x: H) {}
// Binding error
for (Bar x: H) {}
@@ -277,23 +396,133 @@
void test9() {
Bar I[2] = {1,2};
+ //for (const Bar &&x : I) {}
+ // Binding error
for (const Bar &x : I) {}
// No warning
for (const Bar x : I) {}
// expected-warning@-1 {{creates a copy}}
// expected-note@-2 {{'const Bar &'}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:18-[[@LINE-3]]:18}:"&"
+ //for (Bar &&x : I) {}
+ // Binding error
for (Bar &x : I) {}
// No warning
for (Bar x : I) {}
// No warning
+ for (const int &&x : I) {}
+ // expected-warning@-1 {{resulting in a copy}}
+ // expected-note-re@-2 {{'int'{{.*}}'const Bar &'}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:18-[[@LINE-3]]:20}:""
for (const int &x : I) {}
// expected-warning@-1 {{resulting in a copy}}
// expected-note-re@-2 {{'int'{{.*}}'const Bar &'}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:18-[[@LINE-3]]:19}:""
for (const int x : I) {}
// No warning
+ for (int &&x : I) {}
+ // expected-warning@-1 {{resulting in a copy}}
+ // expected-note-re@-2 {{'int'{{.*}}'const Bar &'}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:12-[[@LINE-3]]:14}:""
//for (int &x : I) {}
// Binding error
for (int x : I) {}
// No warning
}
+
+void test10() {
+ Container<Bar> C;
+
+ for (const Bar &x : C) {}
+ // expected-warning@-1 {{always a copy}}
+ // expected-note@-2 {{'Bar'}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:18-[[@LINE-3]]:19}:""
+
+ for (const Bar& x : C) {}
+ // expected-warning@-1 {{always a copy}}
+ // expected-note@-2 {{'Bar'}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:17-[[@LINE-3]]:18}:""
+
+ for (const Bar & x : C) {}
+ // expected-warning@-1 {{always a copy}}
+ // expected-note@-2 {{'Bar'}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:18-[[@LINE-3]]:20}:""
+
+ for (const Bar&x : C) {}
+ // expected-warning@-1 {{always a copy}}
+ // expected-note@-2 {{'Bar'}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:17-[[@LINE-3]]:18}:" "
+}
+
+template <class T>
+void test_template_function() {
+ // In a template instantiation the diagnostics should not be emitted for
+ // loops with dependent types.
+ Container<Bar> C;
+ for (const Bar &x : C) {}
+ // expected-warning@-1 {{always a copy}}
+ // expected-note@-2 {{'Bar'}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:18-[[@LINE-3]]:19}:""
+
+ Container<T> Dependent;
+ for (const T &x : Dependent) {}
+}
+template void test_template_function<Bar>();
+
+template <class T>
+struct test_template_struct {
+ static void static_member() {
+ Container<Bar> C;
+ for (const Bar &x : C) {}
+ // expected-warning@-1 {{always a copy}}
+ // expected-note@-2 {{'Bar'}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:20-[[@LINE-3]]:21}:""
+
+ Container<T> Dependent;
+ for (const T &x : Dependent) {}
+ }
+
+ void member() {
+ Container<Bar> C;
+ for (const Bar &x : C) {}
+ // expected-warning@-1 {{always a copy}}
+ // expected-note@-2 {{'Bar'}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:20-[[@LINE-3]]:21}:""
+
+ Container<T> Dependent;
+ for (const T &x : Dependent) {}
+ }
+};
+template struct test_template_struct<Bar>;
+
+struct test_struct_with_templated_member {
+ void member() {
+ Container<Bar> C;
+ for (const Bar &x : C) {}
+ // expected-warning@-1 {{always a copy}}
+ // expected-note@-2 {{'Bar'}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:20-[[@LINE-3]]:21}:""
+ }
+
+ template <class T>
+ void template_member() {
+ Container<Bar> C;
+ for (const Bar &x : C) {}
+ // expected-warning@-1 {{always a copy}}
+ // expected-note@-2 {{'Bar'}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:20-[[@LINE-3]]:21}:""
+
+ Container<T> Dependent;
+ for (const T &x : Dependent) {}
+ }
+};
+template void test_struct_with_templated_member::template_member<Bar>();
+
+#define TEST_MACRO \
+ void test_macro() { \
+ Container<Bar> C; \
+ for (const Bar &x : C) {} \
+ }
+
+TEST_MACRO
diff --git a/src/llvm-project/clang/test/SemaCXX/warn-thread-safety-analysis.cpp b/src/llvm-project/clang/test/SemaCXX/warn-thread-safety-analysis.cpp
index ac89ea8..23255a5 100644
--- a/src/llvm-project/clang/test/SemaCXX/warn-thread-safety-analysis.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/warn-thread-safety-analysis.cpp
@@ -3051,6 +3051,20 @@
int b = a; // expected-warning {{reading variable 'a' requires holding mutex 'getMutexPtr()'}}
}
+#ifdef __cpp_guaranteed_copy_elision
+
+void guaranteed_copy_elision() {
+ MutexLock lock = MutexLock{&sls_mu};
+ sls_guard_var = 0;
+}
+
+void guaranteed_copy_elision_const() {
+ const MutexLock lock = MutexLock{&sls_mu};
+ sls_guard_var = 0;
+}
+
+#endif
+
} // end namespace TemporaryCleanupExpr
diff --git a/src/llvm-project/clang/test/SemaCXX/warn-unreachable.cpp b/src/llvm-project/clang/test/SemaCXX/warn-unreachable.cpp
index a14e422..c664c19 100644
--- a/src/llvm-project/clang/test/SemaCXX/warn-unreachable.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/warn-unreachable.cpp
@@ -393,6 +393,9 @@
else
calledFun(); // expected-warning {{will never be executed}}
+ if (y == -1 && y != -1) // expected-note {{silence}}
+ calledFun(); // expected-warning {{will never be executed}}
+
// TODO: Extend warning to the following code:
if (x < -1)
calledFun();
@@ -408,6 +411,4 @@
else
calledFun();
- if (y == -1 && y != -1)
- calledFun();
}
diff --git a/src/llvm-project/clang/test/SemaCXX/warn-unsequenced.cpp b/src/llvm-project/clang/test/SemaCXX/warn-unsequenced.cpp
index bb8fd8b..62f725b 100644
--- a/src/llvm-project/clang/test/SemaCXX/warn-unsequenced.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/warn-unsequenced.cpp
@@ -4,6 +4,8 @@
// RUN: -Wunsequenced -Wno-c++17-extensions -Wno-c++14-extensions %s
int f(int, int = 0);
+int g1();
+int g2(int);
struct A {
int x, y;
@@ -24,7 +26,6 @@
a + a++; // cxx11-warning {{unsequenced modification and access to 'a'}}
// cxx17-warning@-1 {{unsequenced modification and access to 'a'}}
a = a++; // cxx11-warning {{multiple unsequenced modifications to 'a'}}
- // TODO cxx17-warning@-1 {{multiple unsequenced modifications to 'a'}}
++ ++a; // ok
(a++, a++); // ok
++a + ++a; // cxx11-warning {{multiple unsequenced modifications to 'a'}}
@@ -34,13 +35,10 @@
(a++, a) = 0; // ok, increment is sequenced before value computation of LHS
a = xs[++a]; // ok
a = xs[a++]; // cxx11-warning {{multiple unsequenced modifications to 'a'}}
- // TODO cxx17-warning@-1 {{multiple unsequenced modifications to 'a'}}
(a ? xs[0] : xs[1]) = ++a; // cxx11-warning {{unsequenced modification and access to 'a'}}
- // TODO cxx17-warning@-1 {{unsequenced modification and access to 'a'}}
a = (++a, ++a); // ok
a = (a++, ++a); // ok
a = (a++, a++); // cxx11-warning {{multiple unsequenced modifications to 'a'}}
- // TODO cxx17-warning@-1 {{multiple unsequenced modifications to 'a'}}
f(a, a); // ok
f(a = 0, a); // cxx11-warning {{unsequenced modification and access to 'a'}}
// cxx17-warning@-1 {{unsequenced modification and access to 'a'}}
@@ -59,7 +57,6 @@
(++a, a) += 1; // ok
a = ++a; // ok
a += ++a; // cxx11-warning {{unsequenced modification and access to 'a'}}
- // TODO cxx17-warning@-1 {{unsequenced modification and access to 'a'}}
A agg1 = { a++, a++ }; // ok
A agg2 = { a++ + a, a++ }; // cxx11-warning {{unsequenced modification and access to 'a'}}
@@ -75,28 +72,31 @@
a = S { ++a, a++ }.n; // ok
A { ++a, a++ }.x; // ok
a = A { ++a, a++ }.x; // cxx11-warning {{multiple unsequenced modifications to 'a'}}
- // TODO cxx17-warning@-1 {{multiple unsequenced modifications to 'a'}}
A { ++a, a++ }.x + A { ++a, a++ }.y; // cxx11-warning {{multiple unsequenced modifications to 'a'}}
// cxx17-warning@-1 {{multiple unsequenced modifications to 'a'}}
- (xs[2] && (a = 0)) + a; // ok
+ (xs[2] && (a = 0)) + a; // cxx11-warning {{unsequenced modification and access to 'a'}}
+ // cxx17-warning@-1 {{unsequenced modification and access to 'a'}}
(0 && (a = 0)) + a; // ok
(1 && (a = 0)) + a; // cxx11-warning {{unsequenced modification and access to 'a'}}
// cxx17-warning@-1 {{unsequenced modification and access to 'a'}}
- (xs[3] || (a = 0)) + a; // ok
+ (xs[3] || (a = 0)) + a; // cxx11-warning {{unsequenced modification and access to 'a'}}
+ // cxx17-warning@-1 {{unsequenced modification and access to 'a'}}
(0 || (a = 0)) + a; // cxx11-warning {{unsequenced modification and access to 'a'}}
// cxx17-warning@-1 {{unsequenced modification and access to 'a'}}
(1 || (a = 0)) + a; // ok
- (xs[4] ? a : ++a) + a; // ok
+ (xs[4] ? a : ++a) + a; // cxx11-warning {{unsequenced modification and access to 'a'}}
+ // cxx17-warning@-1 {{unsequenced modification and access to 'a'}}
(0 ? a : ++a) + a; // cxx11-warning {{unsequenced modification and access to 'a'}}
// cxx17-warning@-1 {{unsequenced modification and access to 'a'}}
(1 ? a : ++a) + a; // ok
(0 ? a : a++) + a; // cxx11-warning {{unsequenced modification and access to 'a'}}
// cxx17-warning@-1 {{unsequenced modification and access to 'a'}}
(1 ? a : a++) + a; // ok
- (xs[5] ? ++a : ++a) + a; // FIXME: warn here
+ (xs[5] ? ++a : ++a) + a; // cxx11-warning {{unsequenced modification and access to 'a'}}
+ // cxx17-warning@-1 {{unsequenced modification and access to 'a'}}
(++a, xs[6] ? ++a : 0) + a; // cxx11-warning {{unsequenced modification and access to 'a'}}
// cxx17-warning@-1 {{unsequenced modification and access to 'a'}}
@@ -106,14 +106,10 @@
a += (a++, a) + a; // cxx11-warning {{unsequenced modification and access to 'a'}}
// cxx17-warning@-1 {{unsequenced modification and access to 'a'}}
- int *p = xs;
- a = *(a++, p); // ok
a = a++ && a; // ok
- p[(long long unsigned)(p = 0)]; // cxx11-warning {{unsequenced modification and access to 'p'}}
A *q = &agg1;
(q = &agg2)->y = q->x; // cxx11-warning {{unsequenced modification and access to 'q'}}
- // TODO cxx17-warning@-1 {{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
@@ -122,10 +118,13 @@
// unconditional.
a = a++ && f(a, a);
- // This has undefined behavior if a != 0. FIXME: We should diagnose this.
- (a && a++) + a;
+ // This has undefined behavior if a != 0.
+ (a && a++) + a; // cxx11-warning {{unsequenced modification and access to 'a'}}
+ // cxx17-warning@-1 {{unsequenced modification and access to 'a'}}
- (xs[7] && ++a) * (!xs[7] && ++a); // ok
+ // FIXME: Don't warn here.
+ (xs[7] && ++a) * (!xs[7] && ++a); // cxx11-warning {{multiple unsequenced modifications to 'a'}}
+ // cxx17-warning@-1 {{multiple unsequenced modifications to 'a'}}
xs[0] = (a = 1, a); // ok
(a -= 128) &= 128; // ok
@@ -135,18 +134,128 @@
// cxx17-warning@-1 {{multiple unsequenced modifications to 'a'}}
xs[8] ? 0 : ++a + a++; // cxx11-warning {{multiple unsequenced modifications to 'a'}}
// cxx17-warning@-1 {{multiple unsequenced modifications to 'a'}}
- xs[8] ? ++a : a++; // ok
+ xs[8] ? ++a : a++; // no-warning
+ xs[8] ? a+=1 : a+= 2; // no-warning
+ (xs[8] ? a+=1 : a+= 2) = a; // cxx11-warning {{unsequenced modification and access to 'a'}}
+ (xs[8] ? a+=1 : a) = a; // cxx11-warning {{unsequenced modification and access to 'a'}}
+ (xs[8] ? a : a+= 2) = a; // cxx11-warning {{unsequenced modification and access to 'a'}}
+ a = (xs[8] ? a+=1 : a+= 2); // no-warning
+ a += (xs[8] ? a+=1 : a+= 2); // cxx11-warning {{unsequenced modification and access to 'a'}}
+
+ (false ? a+=1 : a) = a; // no-warning
+ (true ? a+=1 : a) = a; // cxx11-warning {{unsequenced modification and access to 'a'}}
+ (false ? a : a+=2) = a; // cxx11-warning {{unsequenced modification and access to 'a'}}
+ (true ? a : a+=2) = a; // no-warning
xs[8] && (++a + a++); // cxx11-warning {{multiple unsequenced modifications to 'a'}}
// cxx17-warning@-1 {{multiple unsequenced modifications to 'a'}}
xs[8] || (++a + a++); // cxx11-warning {{multiple unsequenced modifications to 'a'}}
// cxx17-warning@-1 {{multiple unsequenced modifications to 'a'}}
+ ((a++, false) || (a++, false)); // no-warning PR39779
+ ((a++, true) && (a++, true)); // no-warning PR39779
+
+ int i,j;
+ (i = g1(), false) || (j = g2(i)); // no-warning PR22197
+ (i = g1(), true) && (j = g2(i)); // no-warning PR22197
+
+ (a++, false) || (a++, false) || (a++, false) || (a++, false); // no-warning
+ (a++, true) || (a++, true) || (a++, true) || (a++, true); // no-warning
+ a = ((a++, false) || (a++, false) || (a++, false) || (a++, false)); // no-warning
+ a = ((a++, true) && (a++, true) && (a++, true) && (a++, true)); // no-warning
+ a = ((a++, false) || (a++, false) || (a++, false) || a++); // cxx11-warning {{multiple unsequenced modifications to 'a'}}
+ a = ((a++, true) && (a++, true) && (a++, true) && a++); // cxx11-warning {{multiple unsequenced modifications to 'a'}}
+ a = ((a++, false) || (a++, false) || (a++, false) || (a + a, false)); // no-warning
+ a = ((a++, true) && (a++, true) && (a++, true) && (a + a, true)); // no-warning
+
+ a = (false && a++); // no-warning
+ a = (true && a++); // cxx11-warning {{multiple unsequenced modifications to 'a'}}
+ a = (true && ++a); // no-warning
+ a = (true || a++); // no-warning
+ a = (false || a++); // cxx11-warning {{multiple unsequenced modifications to 'a'}}
+ a = (false || ++a); // no-warning
+
+ (a++) | (a++); // cxx11-warning {{multiple unsequenced modifications to 'a'}}
+ // cxx17-warning@-1 {{multiple unsequenced modifications to 'a'}}
+ (a++) & (a++); // cxx11-warning {{multiple unsequenced modifications to 'a'}}
+ // cxx17-warning@-1 {{multiple unsequenced modifications to 'a'}}
+ (a++) ^ (a++); // cxx11-warning {{multiple unsequenced modifications to 'a'}}
+ // cxx17-warning@-1 {{multiple unsequenced modifications to 'a'}}
+
(__builtin_classify_type(++a) ? 1 : 0) + ++a; // ok
(__builtin_constant_p(++a) ? 1 : 0) + ++a; // ok
(__builtin_object_size(&(++a, a), 0) ? 1 : 0) + ++a; // ok
(__builtin_expect(++a, 0) ? 1 : 0) + ++a; // cxx11-warning {{multiple unsequenced modifications to 'a'}}
// cxx17-warning@-1 {{multiple unsequenced modifications to 'a'}}
+
+
+ int *p = xs;
+ a = *(a++, p); // no-warning
+ p[(long long unsigned)(p = 0)]; // cxx11-warning {{unsequenced modification and access to 'p'}}
+ (i++, xs)[i++]; // cxx11-warning {{multiple unsequenced modifications to 'i'}}
+ (++i, xs)[++i]; // cxx11-warning {{multiple unsequenced modifications to 'i'}}
+ (i, xs)[++i + ++i]; // cxx11-warning {{multiple unsequenced modifications to 'i'}}
+ // cxx17-warning@-1 {{multiple unsequenced modifications to 'i'}}
+ p++[p == xs]; // cxx11-warning {{unsequenced modification and access to 'p'}}
+ ++p[p++ == xs]; // cxx11-warning {{unsequenced modification and access to 'p'}}
+
+ struct S { int x; } s, *ps = &s;
+ int (S::*PtrMem);
+ (PtrMem = &S::x ,s).*(PtrMem); // cxx11-warning {{unsequenced modification and access to 'PtrMem'}}
+ (PtrMem = &S::x ,s).*(PtrMem = &S::x); // cxx11-warning {{multiple unsequenced modifications to 'PtrMem'}}
+ (PtrMem = &S::x ,ps)->*(PtrMem); // cxx11-warning {{unsequenced modification and access to 'PtrMem'}}
+ (PtrMem = &S::x ,ps)->*(PtrMem = &S::x); // cxx11-warning {{multiple unsequenced modifications to 'PtrMem'}}
+ (PtrMem = nullptr) == (PtrMem = nullptr); // cxx11-warning {{multiple unsequenced modifications to 'PtrMem'}}
+ // cxx17-warning@-1 {{multiple unsequenced modifications to 'PtrMem'}}
+ (PtrMem = nullptr) == PtrMem; // cxx11-warning {{unsequenced modification and access to 'PtrMem'}}
+ // cxx17-warning@-1 {{unsequenced modification and access to 'PtrMem'}}
+
+ i++ << i++; // cxx11-warning {{multiple unsequenced modifications to 'i'}}
+ ++i << ++i; // cxx11-warning {{multiple unsequenced modifications to 'i'}}
+ i++ << i; // cxx11-warning {{unsequenced modification and access to 'i'}}
+ i << i++; // cxx11-warning {{unsequenced modification and access to 'i'}}
+ i++ >> i++; // cxx11-warning {{multiple unsequenced modifications to 'i'}}
+ ++i >> ++i; // cxx11-warning {{multiple unsequenced modifications to 'i'}}
+ i++ >> i; // cxx11-warning {{unsequenced modification and access to 'i'}}
+ i >> i++; // cxx11-warning {{unsequenced modification and access to 'i'}}
+ (i++ << i) + i; // cxx11-warning {{unsequenced modification and access to 'i'}}
+ // cxx17-warning@-1 {{unsequenced modification and access to 'i'}}
+ (i++ << i) << i++; // cxx11-warning {{unsequenced modification and access to 'i'}}
+
+ ++i = i++; // cxx11-warning {{multiple unsequenced modifications to 'i'}}
+ i = i+= 1; // no-warning
+ i = i++ + ++i; // cxx11-warning {{multiple unsequenced modifications to 'i'}}
+ // cxx17-warning@-1 {{multiple unsequenced modifications to 'i'}}
+ ++i += ++i; // cxx11-warning {{multiple unsequenced modifications to 'i'}}
+ ++i += i++; // cxx11-warning {{multiple unsequenced modifications to 'i'}}
+ (i++, i) += ++i; // cxx11-warning {{multiple unsequenced modifications to 'i'}}
+ (i++, i) += i++; // cxx11-warning {{multiple unsequenced modifications to 'i'}}
+ i += i+= 1; // cxx11-warning {{unsequenced modification and access to 'i'}}
+ i += i++; // cxx11-warning {{unsequenced modification and access to 'i'}}
+ i += ++i; // cxx11-warning {{unsequenced modification and access to 'i'}}
+ i -= i++; // cxx11-warning {{unsequenced modification and access to 'i'}}
+ i -= ++i; // cxx11-warning {{unsequenced modification and access to 'i'}}
+ i *= i++; // cxx11-warning {{unsequenced modification and access to 'i'}}
+ i *= ++i; // cxx11-warning {{unsequenced modification and access to 'i'}}
+ i /= i++; // cxx11-warning {{unsequenced modification and access to 'i'}}
+ i /= ++i; // cxx11-warning {{unsequenced modification and access to 'i'}}
+ i %= i++; // cxx11-warning {{unsequenced modification and access to 'i'}}
+ i %= ++i; // cxx11-warning {{unsequenced modification and access to 'i'}}
+ i ^= i++; // cxx11-warning {{unsequenced modification and access to 'i'}}
+ i ^= ++i; // cxx11-warning {{unsequenced modification and access to 'i'}}
+ i |= i++; // cxx11-warning {{unsequenced modification and access to 'i'}}
+ i |= ++i; // cxx11-warning {{unsequenced modification and access to 'i'}}
+ i &= i++; // cxx11-warning {{unsequenced modification and access to 'i'}}
+ i &= ++i; // cxx11-warning {{unsequenced modification and access to 'i'}}
+ i <<= i++; // cxx11-warning {{unsequenced modification and access to 'i'}}
+ i <<= ++i; // cxx11-warning {{unsequenced modification and access to 'i'}}
+ i >>= i++; // cxx11-warning {{unsequenced modification and access to 'i'}}
+ i >>= ++i; // cxx11-warning {{unsequenced modification and access to 'i'}}
+
+ p[i++] = i; // cxx11-warning {{unsequenced modification and access to 'i'}}
+ p[i++] = (i = 42); // cxx11-warning {{multiple unsequenced modifications to 'i'}}
+ p++[i++] = (i = p ? i++ : i++); // cxx11-warning {{unsequenced modification and access to 'p'}}
+ // cxx11-warning@-1 {{multiple unsequenced modifications to 'i'}}
}
namespace members {
diff --git a/src/llvm-project/clang/test/SemaCXX/warn-unused-label-error.cpp b/src/llvm-project/clang/test/SemaCXX/warn-unused-label-error.cpp
index 66b616f..461b1e8 100644
--- a/src/llvm-project/clang/test/SemaCXX/warn-unused-label-error.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/warn-unused-label-error.cpp
@@ -18,9 +18,9 @@
}
void h() {
- D: // expected-warning {{unused label 'D'}}
- #pragma weak unused_local_static
- __attribute__((unused)) // expected-warning {{declaration does not declare anything}}
- ;
+ D:
+#pragma weak unused_local_static
+ __attribute__((unused)) // expected-error {{'unused' attribute cannot be applied to a statement}}
+ ;
}
}
diff --git a/src/llvm-project/clang/test/SemaCXX/warn-unused-variables.cpp b/src/llvm-project/clang/test/SemaCXX/warn-unused-variables.cpp
index 97634ac..2634fb1 100644
--- a/src/llvm-project/clang/test/SemaCXX/warn-unused-variables.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/warn-unused-variables.cpp
@@ -238,4 +238,18 @@
a d(b::e ? "" : "");
}
}
+
+// Ensure we don't warn on dependent constructor calls.
+namespace dependent_ctor {
+struct S {
+ S() = default;
+ S(const S &) = default;
+ S(int);
+};
+
+template <typename T>
+void foo(T &t) {
+ S s{t};
+}
+}
#endif
diff --git a/src/llvm-project/clang/test/SemaCXX/warn-xor-as-pow.cpp b/src/llvm-project/clang/test/SemaCXX/warn-xor-as-pow.cpp
new file mode 100644
index 0000000..123d0ac
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaCXX/warn-xor-as-pow.cpp
@@ -0,0 +1,137 @@
+// RUN: %clang_cc1 -x c -fsyntax-only -verify -Wxor-used-as-pow %s
+// RUN: %clang_cc1 -x c -fsyntax-only -verify %s
+// RUN: %clang_cc1 -x c -fsyntax-only -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+
+// RUN: %clang_cc1 -x c++ -fsyntax-only -verify -Wxor-used-as-pow %s
+// RUN: %clang_cc1 -x c++ -fsyntax-only -verify %s
+// RUN: %clang_cc1 -x c++ -fsyntax-only -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+
+#define FOOBAR(x, y) (x * y)
+#define XOR(x, y) (x ^ y)
+#define TWO 2
+#define TEN 10
+#define IOP 64
+#define TWO_ULL 2ULL
+#define EPSILON 10 ^ -300
+#define ALPHA_OFFSET 3
+#define EXP 3
+
+#define flexor 7
+
+#ifdef __cplusplus
+constexpr long long operator"" _xor(unsigned long long v) { return v; }
+
+constexpr long long operator"" _0b(unsigned long long v) { return v; }
+constexpr long long operator"" _0X(unsigned long long v) { return v; }
+#else
+#define xor ^ // iso646.h
+#endif
+
+void test(unsigned a, unsigned b) {
+ unsigned res;
+ res = a ^ 5;
+ res = 2 ^ b;
+ res = a ^ b;
+ res = 2 ^ -1;
+ res = 2 ^ 0; // expected-warning {{result of '2 ^ 0' is 2; did you mean '1 << 0' (1)?}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:9-[[@LINE-1]]:14}:"1"
+ // expected-note@-2 {{replace expression with '0x2 ^ 0' or use 'xor' instead of '^' to silence this warning}}
+ res = 2 ^ 1; // expected-warning {{result of '2 ^ 1' is 3; did you mean '1 << 1' (2)?}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:9-[[@LINE-1]]:14}:"1 << 1"
+ // expected-note@-2 {{replace expression with '0x2 ^ 1' or use 'xor' instead of '^' to silence this warning}}
+ res = 2 ^ 2; // expected-warning {{result of '2 ^ 2' is 0; did you mean '1 << 2' (4)?}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:9-[[@LINE-1]]:14}:"1 << 2"
+ // expected-note@-2 {{replace expression with '0x2 ^ 2' or use 'xor' instead of '^' to silence this warning}}
+ res = 2 ^ 8; // expected-warning {{result of '2 ^ 8' is 10; did you mean '1 << 8' (256)?}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:9-[[@LINE-1]]:14}:"1 << 8"
+ // expected-note@-2 {{replace expression with '0x2 ^ 8' or use 'xor' instead of '^' to silence this warning}}
+ res = 2 ^ +8; // expected-warning {{result of '2 ^ +8' is 10; did you mean '1 << +8' (256)?}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:9-[[@LINE-1]]:15}:"1 << +8"
+ // expected-note@-2 {{replace expression with '0x2 ^ +8' or use 'xor' instead of '^' to silence this warning}}
+ res = TWO ^ 8; // expected-warning {{result of 'TWO ^ 8' is 10; did you mean '1 << 8' (256)?}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:9-[[@LINE-1]]:16}:"1 << 8"
+ // expected-note@-2 {{replace expression with '0x2 ^ 8' or use 'xor' instead of '^' to silence this warning}}
+ res = 2 ^ 16; // expected-warning {{result of '2 ^ 16' is 18; did you mean '1 << 16' (65536)?}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:9-[[@LINE-1]]:15}:"1 << 16"
+ // expected-note@-2 {{replace expression with '0x2 ^ 16' or use 'xor' instead of '^' to silence this warning}}
+ res = 2 ^ TEN; // expected-warning {{result of '2 ^ TEN' is 8; did you mean '1 << TEN' (1024)?}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:9-[[@LINE-1]]:16}:"1 << TEN"
+ // expected-note@-2 {{replace expression with '0x2 ^ TEN' or use 'xor' instead of '^' to silence this warning}}
+ res = res + (2 ^ ALPHA_OFFSET); // expected-warning {{result of '2 ^ ALPHA_OFFSET' is 1; did you mean '1 << ALPHA_OFFSET' (8)?}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:16-[[@LINE-1]]:32}:"1 << ALPHA_OFFSET"
+ // expected-note@-2 {{replace expression with '0x2 ^ ALPHA_OFFSET' or use 'xor' instead of '^' to silence this warning}}
+ res = 0x2 ^ 16;
+ res = 2 xor 16;
+
+ res = 2 ^ 0x4;
+ res = 2 ^ 04;
+ res = 0x2 ^ 10;
+ res = 0X2 ^ 10;
+ res = 02 ^ 10;
+ res = FOOBAR(2, 16);
+ res = 0b10 ^ 16;
+ res = 0B10 ^ 16;
+ res = 2 ^ 0b100;
+ res = XOR(2, 16);
+ unsigned char two = 2;
+ res = two ^ 16;
+ res = TWO_ULL ^ 16;
+ res = 2 ^ 32; // expected-warning {{result of '2 ^ 32' is 34; did you mean '1LL << 32'?}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:9-[[@LINE-1]]:15}:"1LL << 32"
+ // expected-note@-2 {{replace expression with '0x2 ^ 32' or use 'xor' instead of '^' to silence this warning}}
+ res = 2 ^ 64; // expected-warning {{result of '2 ^ 64' is 66; did you mean exponentiation?}}
+ // expected-note@-1 {{replace expression with '0x2 ^ 64' or use 'xor' instead of '^' to silence this warning}}
+ res = 2 ^ 65;
+
+ res = EPSILON;
+ res = 10 ^ 0; // expected-warning {{result of '10 ^ 0' is 10; did you mean '1e0'?}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:9-[[@LINE-1]]:15}:"1e0"
+ // expected-note@-2 {{replace expression with '0xA ^ 0' or use 'xor' instead of '^' to silence this warning}}
+ res = 10 ^ 1; // expected-warning {{result of '10 ^ 1' is 11; did you mean '1e1'?}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:9-[[@LINE-1]]:15}:"1e1"
+ // expected-note@-2 {{replace expression with '0xA ^ 1' or use 'xor' instead of '^' to silence this warning}}
+ res = 10 ^ 2; // expected-warning {{result of '10 ^ 2' is 8; did you mean '1e2'?}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:9-[[@LINE-1]]:15}:"1e2"
+ // expected-note@-2 {{replace expression with '0xA ^ 2' or use 'xor' instead of '^' to silence this warning}}
+ res = 10 ^ 4; // expected-warning {{result of '10 ^ 4' is 14; did you mean '1e4'?}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:9-[[@LINE-1]]:15}:"1e4"
+ // expected-note@-2 {{replace expression with '0xA ^ 4' or use 'xor' instead of '^' to silence this warning}}
+ res = 10 ^ +4; // expected-warning {{result of '10 ^ +4' is 14; did you mean '1e4'?}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:9-[[@LINE-1]]:16}:"1e4"
+ // expected-note@-2 {{replace expression with '0xA ^ +4' or use 'xor' instead of '^' to silence this warning}}
+ res = 10 ^ 10; // expected-warning {{result of '10 ^ 10' is 0; did you mean '1e10'?}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:9-[[@LINE-1]]:16}:"1e10"
+ // expected-note@-2 {{replace expression with '0xA ^ 10' or use 'xor' instead of '^' to silence this warning}}
+ res = TEN ^ 10; // expected-warning {{result of 'TEN ^ 10' is 0; did you mean '1e10'?}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:9-[[@LINE-1]]:17}:"1e10"
+ // expected-note@-2 {{replace expression with '0xA ^ 10' or use 'xor' instead of '^' to silence this warning}}
+ res = 10 ^ TEN; // expected-warning {{result of '10 ^ TEN' is 0; did you mean '1e10'?}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:9-[[@LINE-1]]:17}:"1e10"
+ // expected-note@-2 {{replace expression with '0xA ^ TEN' or use 'xor' instead of '^' to silence this warning}}
+ res = 10 ^ 100; // expected-warning {{result of '10 ^ 100' is 110; did you mean '1e100'?}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:9-[[@LINE-1]]:17}:"1e100"
+ // expected-note@-2 {{replace expression with '0xA ^ 100' or use 'xor' instead of '^' to silence this warning}}
+ res = 0xA ^ 10;
+ res = 10 ^ -EXP; // expected-warning {{result of '10 ^ -EXP' is -9; did you mean '1e-3'?}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:9-[[@LINE-1]]:18}:"1e-3"
+ // expected-note@-2 {{replace expression with '0xA ^ -EXP' or use 'xor' instead of '^' to silence this warning}}
+ res = 10 ^ +EXP; // expected-warning {{result of '10 ^ +EXP' is 9; did you mean '1e3'?}}
+ // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:9-[[@LINE-1]]:18}:"1e3"
+ // expected-note@-2 {{replace expression with '0xA ^ +EXP' or use 'xor' instead of '^' to silence this warning}}
+ res = 10 xor 10;
+#ifdef __cplusplus
+ res = 10 ^ 5_xor;
+ res = 10_xor ^ 5;
+ res = 10 ^ 5_0b;
+ res = 10_0X ^ 5;
+ res = 2 ^ 2'000;
+ res = 2 ^ 0b0110'1001;
+ res = 10 ^ 2'000;
+#else
+#undef xor
+ res = 10 ^ 1; // expected-warning {{result of '10 ^ 1' is 11; did you mean '1e1'?}}
+ // expected-note@-1 {{replace expression with '0xA ^ 1' to silence this warning}}
+ res = 2 ^ 1; // expected-warning {{result of '2 ^ 1' is 3; did you mean '1 << 1' (2)?}}
+ // expected-note@-1 {{replace expression with '0x2 ^ 1' to silence this warning}}
+#endif
+}
diff --git a/src/llvm-project/clang/test/SemaCXX/wchar_t.cpp b/src/llvm-project/clang/test/SemaCXX/wchar_t.cpp
index f9d7b61..f8e9add 100644
--- a/src/llvm-project/clang/test/SemaCXX/wchar_t.cpp
+++ b/src/llvm-project/clang/test/SemaCXX/wchar_t.cpp
@@ -1,10 +1,12 @@
-// RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -Wno-signed-unsigned-wchar -verify=allow-signed %s
+// allow-signed-no-diagnostics
wchar_t x;
void f(wchar_t p) {
wchar_t x;
- unsigned wchar_t y; // expected-warning {{'wchar_t' cannot be signed or unsigned}}
- signed wchar_t z; // expected-warning {{'wchar_t' cannot be signed or unsigned}}
+ unsigned wchar_t y; // expected-error {{'wchar_t' cannot be signed or unsigned}}
+ signed wchar_t z; // expected-error {{'wchar_t' cannot be signed or unsigned}}
++x;
}
diff --git a/src/llvm-project/clang/test/SemaObjC/Inputs/non-trivial-c-union.h b/src/llvm-project/clang/test/SemaObjC/Inputs/non-trivial-c-union.h
new file mode 100644
index 0000000..9738353
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaObjC/Inputs/non-trivial-c-union.h
@@ -0,0 +1,19 @@
+// For backward compatibility, fields of C unions declared in system headers
+// that have non-trivial ObjC ownership qualifications are marked as unavailable
+// unless the qualifier is explicit and __strong.
+
+#pragma clang system_header
+
+typedef __strong id StrongID;
+
+typedef union {
+ id f0;
+ _Nonnull id f1;
+ __weak id f2;
+ StrongID f3;
+} U0_SystemHeader;
+
+typedef union { // expected-note {{'U1_SystemHeader' has subobjects that are non-trivial to destruct}} expected-note {{'U1_SystemHeader' has subobjects that are non-trivial to copy}}
+ __strong id f0; // expected-note {{f0 has type '__strong id' that is non-trivial to destruct}} expected-note {{f0 has type '__strong id' that is non-trivial to copy}}
+ _Nonnull id f1;
+} U1_SystemHeader;
diff --git a/src/llvm-project/clang/test/SemaObjC/aarch64-sve-types.m b/src/llvm-project/clang/test/SemaObjC/aarch64-sve-types.m
new file mode 100644
index 0000000..9e1af31
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaObjC/aarch64-sve-types.m
@@ -0,0 +1,22 @@
+// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -fsyntax-only -verify %s
+
+// Check that we don't abort when SVE types are made nullable. This
+// interface is invalid anyway, but we won't diagnose that until the
+// sizeless type extension is added.
+@interface foo
+@property(nullable) __SVInt8_t s8; // expected-error {{cannot be applied to non-pointer type}}
+@property(nullable) __SVInt16_t s16; // expected-error {{cannot be applied to non-pointer type}}
+@property(nullable) __SVInt32_t s32; // expected-error {{cannot be applied to non-pointer type}}
+@property(nullable) __SVInt64_t s64; // expected-error {{cannot be applied to non-pointer type}}
+
+@property(nullable) __SVUint8_t u8; // expected-error {{cannot be applied to non-pointer type}}
+@property(nullable) __SVUint16_t u16; // expected-error {{cannot be applied to non-pointer type}}
+@property(nullable) __SVUint32_t u32; // expected-error {{cannot be applied to non-pointer type}}
+@property(nullable) __SVUint64_t u64; // expected-error {{cannot be applied to non-pointer type}}
+
+@property(nullable) __SVFloat16_t f16; // expected-error {{cannot be applied to non-pointer type}}
+@property(nullable) __SVFloat32_t f32; // expected-error {{cannot be applied to non-pointer type}}
+@property(nullable) __SVFloat64_t f64; // expected-error {{cannot be applied to non-pointer type}}
+
+@property(nullable) __SVBool_t b8; // expected-error {{cannot be applied to non-pointer type}}
+@end
diff --git a/src/llvm-project/clang/test/SemaObjC/arc.m b/src/llvm-project/clang/test/SemaObjC/arc.m
index b87f294..dea3ba5 100644
--- a/src/llvm-project/clang/test/SemaObjC/arc.m
+++ b/src/llvm-project/clang/test/SemaObjC/arc.m
@@ -295,6 +295,7 @@
b = (vp == nil);
b = (nil == vp);
+ // FIXME: Shouldn't these be consistent?
b = (vp == op); // expected-error {{implicit conversion of Objective-C pointer type 'id' to C pointer type 'void *' requires a bridged cast}} expected-note {{use __bridge}} expected-note {{use CFBridgingRetain call}}
b = (op == vp);
}
diff --git a/src/llvm-project/clang/test/SemaObjC/atomoic-property-synnthesis-rules.m b/src/llvm-project/clang/test/SemaObjC/atomic-property-synthesis-rules.m
similarity index 100%
rename from src/llvm-project/clang/test/SemaObjC/atomoic-property-synnthesis-rules.m
rename to src/llvm-project/clang/test/SemaObjC/atomic-property-synthesis-rules.m
diff --git a/src/llvm-project/clang/test/SemaObjC/block-type-safety.m b/src/llvm-project/clang/test/SemaObjC/block-type-safety.m
index 96c781b..66fda2d 100644
--- a/src/llvm-project/clang/test/SemaObjC/block-type-safety.m
+++ b/src/llvm-project/clang/test/SemaObjC/block-type-safety.m
@@ -133,9 +133,20 @@
@end
int test5() {
+ // Returned value is used outside of a block, so error on changing
+ // a return type to a more general than expected.
NSAllArray *(^block)(id);
id <Foo> (^genericBlock)(id);
genericBlock = block;
+ block = genericBlock; // expected-error {{incompatible block pointer types assigning to 'NSAllArray *(^)(id)' from 'id<Foo> (^)(id)'}}
+
+ // A parameter is used inside a block, so error on changing a parameter type
+ // to a more specific than an argument type it will be called with.
+ // rdar://problem/52788423
+ void (^blockWithParam)(NSAllArray *);
+ void (^genericBlockWithParam)(id<Foo>);
+ genericBlockWithParam = blockWithParam; // expected-error {{incompatible block pointer types assigning to 'void (^)(id<Foo>)' from 'void (^)(NSAllArray *)'}}
+ blockWithParam = genericBlockWithParam;
return 0;
}
diff --git a/src/llvm-project/clang/test/SemaObjC/class-method-self.m b/src/llvm-project/clang/test/SemaObjC/class-method-self.m
index b1e37bf..821160c 100644
--- a/src/llvm-project/clang/test/SemaObjC/class-method-self.m
+++ b/src/llvm-project/clang/test/SemaObjC/class-method-self.m
@@ -1,6 +1,5 @@
// RUN: %clang_cc1 -verify -Wno-objc-root-class %s
-typedef struct objc_class *Class;
@interface XX
- (void)addObserver:(XX*)o; // expected-note 2{{passing argument to parameter 'o' here}}
@@ -23,4 +22,3 @@
[obj addObserver:whatever]; // expected-warning {{incompatible pointer types sending 'Class' to parameter of type 'XX *'}}
}
@end
-
diff --git a/src/llvm-project/clang/test/SemaObjC/comptypes-1.m b/src/llvm-project/clang/test/SemaObjC/comptypes-1.m
index 997ef19..67b73ce 100644
--- a/src/llvm-project/clang/test/SemaObjC/comptypes-1.m
+++ b/src/llvm-project/clang/test/SemaObjC/comptypes-1.m
@@ -1,12 +1,12 @@
// RUN: %clang_cc1 -fsyntax-only -verify -pedantic %s
#define nil (void *)0;
-#define Nil (void *)0;
extern void foo();
@protocol MyProtocol
- (void) foo;
++ (void) bar;
@end
@interface MyClass
@@ -22,7 +22,8 @@
id<MyProtocol> obj_p = nil;
MyClass *obj_c = nil;
MyOtherClass *obj_cp = nil;
- Class obj_C = Nil;
+ Class obj_C = nil;
+ Class<MyProtocol> obj_CP = nil;
/* Assigning to an 'id' variable should never
generate a warning. */
@@ -30,12 +31,15 @@
obj = obj_c; /* Ok */
obj = obj_cp; /* Ok */
obj = obj_C; /* Ok */
-
+ obj = obj_CP; /* Ok */
+
/* Assigning to a 'MyClass *' variable should always generate a
warning, unless done from an 'id'. */
obj_c = obj; /* Ok */
- obj_c = obj_cp; // // expected-warning {{incompatible pointer types assigning to 'MyClass *' from 'MyOtherClass *'}}
+ obj_c = obj_p; // expected-warning {{assigning to 'MyClass *' from incompatible type 'id<MyProtocol>'}}
+ obj_c = obj_cp; // expected-warning {{incompatible pointer types assigning to 'MyClass *' from 'MyOtherClass *'}}
obj_c = obj_C; // expected-warning {{incompatible pointer types assigning to 'MyClass *' from 'Class'}}
+ obj_c = obj_CP; // expected-warning {{incompatible pointer types assigning to 'MyClass *' from 'Class<MyProtocol>'}}
/* Assigning to an 'id<MyProtocol>' variable should generate a
warning if done from a 'MyClass *' (which doesn't implement
@@ -45,6 +49,7 @@
obj_p = obj_c; // expected-warning {{assigning to 'id<MyProtocol>' from incompatible type 'MyClass *'}}
obj_p = obj_cp; /* Ok */
obj_p = obj_C; // expected-warning {{incompatible pointer types assigning to 'id<MyProtocol>' from 'Class'}}
+ obj_p = obj_CP; // expected-warning {{assigning to 'id<MyProtocol>' from incompatible type 'Class<MyProtocol>'}}
/* Assigning to a 'MyOtherClass *' variable should always generate
a warning, unless done from an 'id' or an 'id<MyProtocol>' (since
@@ -53,37 +58,67 @@
obj_cp = obj_c; // expected-warning {{incompatible pointer types assigning to 'MyOtherClass *' from 'MyClass *'}}
obj_cp = obj_p; /* Ok */
obj_cp = obj_C; // expected-warning {{incompatible pointer types assigning to 'MyOtherClass *' from 'Class'}}
+ obj_cp = obj_CP; // expected-warning {{incompatible pointer types assigning to 'MyOtherClass *' from 'Class<MyProtocol>'}}
+
+ obj_C = obj; // Ok
+ obj_C = obj_p; // expected-warning {{incompatible pointer types assigning to 'Class' from 'id<MyProtocol>'}}
+ obj_C = obj_c; // expected-warning {{incompatible pointer types assigning to 'Class' from 'MyClass *'}}
+ obj_C = obj_cp; // expected-warning {{incompatible pointer types assigning to 'Class' from 'MyOtherClass *'}}
+ obj_C = obj_CP; // Ok
+
+ obj_CP = obj; // Ok
+ obj_CP = obj_p; // expected-warning {{assigning to 'Class<MyProtocol>' from incompatible type 'id<MyProtocol>'}}
+ obj_CP = obj_c; // expected-warning {{incompatible pointer types assigning to 'Class<MyProtocol>' from 'MyClass *}}
+ obj_CP = obj_cp; // expected-warning {{incompatible pointer types assigning to 'Class<MyProtocol>' from 'MyOtherClass *'}}
+ obj_CP = obj_C; // Ok
/* Any comparison involving an 'id' must be without warnings. */
- if (obj == obj_p) foo() ; /* Ok */ /*Bogus warning here in 2.95.4*/
- if (obj_p == obj) foo() ; /* Ok */
- if (obj == obj_c) foo() ; /* Ok */
- if (obj_c == obj) foo() ; /* Ok */
- if (obj == obj_cp) foo() ; /* Ok */
- if (obj_cp == obj) foo() ; /* Ok */
- if (obj == obj_C) foo() ; /* Ok */
- if (obj_C == obj) foo() ; /* Ok */
+ if (obj == obj_p) foo(); /* Ok */ /*Bogus warning here in 2.95.4*/
+ if (obj_p == obj) foo(); /* Ok */
+ if (obj == obj_c) foo(); /* Ok */
+ if (obj_c == obj) foo(); /* Ok */
+ if (obj == obj_cp) foo(); /* Ok */
+ if (obj_cp == obj) foo(); /* Ok */
+ if (obj == obj_C) foo(); /* Ok */
+ if (obj_C == obj) foo(); /* Ok */
+ if (obj == obj_CP) foo(); /* Ok */
+ if (obj_CP == obj) foo(); /* Ok */
/* Any comparison between 'MyClass *' and anything which is not an 'id'
must generate a warning. */
- if (obj_p == obj_c) foo() ; // expected-warning {{comparison of distinct pointer types ('id<MyProtocol>' and 'MyClass *')}}
+ if (obj_c == obj_p) foo(); // expected-warning {{comparison of distinct pointer types ('MyClass *' and 'id<MyProtocol>')}}
+ if (obj_p == obj_c) foo(); // expected-warning {{comparison of distinct pointer types ('id<MyProtocol>' and 'MyClass *')}}
- if (obj_c == obj_cp) foo() ; // expected-warning {{comparison of distinct pointer types ('MyClass *' and 'MyOtherClass *')}}
- if (obj_cp == obj_c) foo() ; // expected-warning {{comparison of distinct pointer types ('MyOtherClass *' and 'MyClass *')}}
+ if (obj_c == obj_cp) foo(); // expected-warning {{comparison of distinct pointer types ('MyClass *' and 'MyOtherClass *')}}
+ if (obj_cp == obj_c) foo(); // expected-warning {{comparison of distinct pointer types ('MyOtherClass *' and 'MyClass *')}}
- if (obj_c == obj_C) foo() ;
- if (obj_C == obj_c) foo() ;
+ if (obj_c == obj_C) foo(); // expected-warning {{comparison of distinct pointer types ('MyClass *' and 'Class')}}
+ if (obj_C == obj_c) foo(); // expected-warning {{comparison of distinct pointer types ('Class' and 'MyClass *')}}
+
+ if (obj_c == obj_CP) foo(); // expected-warning {{comparison of distinct pointer types ('MyClass *' and 'Class<MyProtocol>')}}
+ if (obj_CP == obj_c) foo(); // expected-warning {{comparison of distinct pointer types ('Class<MyProtocol>' and 'MyClass *')}}
/* Any comparison between 'MyOtherClass *' (which implements
MyProtocol) and an 'id' implementing MyProtocol are Ok. */
- if (obj_cp == obj_p) foo() ; /* Ok */
- if (obj_p == obj_cp) foo() ; /* Ok */
+ if (obj_p == obj_cp) foo(); /* Ok */
+ if (obj_cp == obj_p) foo(); /* Ok */
+ if (obj_p == obj_C) foo(); // expected-warning {{comparison of distinct pointer types ('id<MyProtocol>' and 'Class')}}
+ if (obj_C == obj_p) foo(); // expected-warning {{comparison of distinct pointer types ('Class' and 'id<MyProtocol>')}}
- if (obj_p == obj_C) foo() ;
- if (obj_C == obj_p) foo() ;
- if (obj_cp == obj_C) foo() ;
- if (obj_C == obj_cp) foo() ;
+ if (obj_p == obj_CP) foo(); // expected-warning {{comparison of distinct pointer types ('id<MyProtocol>' and 'Class<MyProtocol>')}}
+ if (obj_CP == obj_p) foo(); // expected-warning {{comparison of distinct pointer types ('Class<MyProtocol>' and 'id<MyProtocol>')}}
+
+ /* Comparisons between MyOtherClass * and Class types is a warning */
+ if (obj_cp == obj_C) foo(); // expected-warning {{comparison of distinct pointer types ('MyOtherClass *' and 'Class')}}
+ if (obj_C == obj_cp) foo(); // expected-warning {{comparison of distinct pointer types ('Class' and 'MyOtherClass *')}}
+
+ if (obj_cp == obj_CP) foo(); // expected-warning {{comparison of distinct pointer types ('MyOtherClass *' and 'Class<MyProtocol>')}}
+ if (obj_CP == obj_cp) foo(); // expected-warning {{comparison of distinct pointer types ('Class<MyProtocol>' and 'MyOtherClass *')}}
+
+ /* Comparisons between a Class and a Class<MyProtocol> are ok */
+ if (obj_C == obj_CP) foo(); /* Ok */
+ if (obj_CP == obj_C) foo(); /* Ok */
return 0;
}
diff --git a/src/llvm-project/clang/test/SemaObjC/comptypes-7.m b/src/llvm-project/clang/test/SemaObjC/comptypes-7.m
index dde504b..4623cfd 100644
--- a/src/llvm-project/clang/test/SemaObjC/comptypes-7.m
+++ b/src/llvm-project/clang/test/SemaObjC/comptypes-7.m
@@ -1,7 +1,6 @@
// RUN: %clang_cc1 -fsyntax-only -verify -pedantic %s
#define nil (void *)0;
-#define Nil (void *)0;
extern void foo();
@@ -17,7 +16,7 @@
id obj = nil;
id <MyProtocol> obj_p = nil;
MyClass *obj_c = nil;
- Class obj_C = Nil;
+ Class obj_C = nil;
int i = 0;
int *j = nil;
@@ -66,8 +65,8 @@
if (obj_C == j) foo() ; // expected-warning {{comparison of distinct pointer types ('Class' and 'int *')}}
if (j == obj_C) foo() ; // expected-warning {{comparison of distinct pointer types ('int *' and 'Class')}}
- Class bar1 = Nil;
- Class <MyProtocol> bar = Nil;
+ Class bar1 = nil;
+ Class <MyProtocol> bar = nil;
bar = bar1;
bar1 = bar;
diff --git a/src/llvm-project/clang/test/SemaObjC/default-synthesize-sourceloc.m b/src/llvm-project/clang/test/SemaObjC/default-synthesize-sourceloc.m
new file mode 100644
index 0000000..bd549ff
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaObjC/default-synthesize-sourceloc.m
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -ast-dump %s | FileCheck %s
+
+// Test that accessor stubs for default-synthesized ObjC accessors
+// have a valid source location.
+
+__attribute__((objc_root_class))
+@interface NSObject
++ (id)alloc;
+@end
+
+@interface NSString : NSObject
+@end
+
+@interface MyData : NSObject
+struct Data {
+ NSString *name;
+};
+@property struct Data data;
+@end
+// CHECK: ObjCImplementationDecl {{.*}}line:[[@LINE+2]]{{.*}} MyData
+// CHECK: ObjCMethodDecl {{.*}}col:23 implicit - setData: 'void'
+@implementation MyData
+@end
diff --git a/src/llvm-project/clang/test/SemaObjC/format-strings-objc.m b/src/llvm-project/clang/test/SemaObjC/format-strings-objc.m
index 767d5ac..e5a1a82 100644
--- a/src/llvm-project/clang/test/SemaObjC/format-strings-objc.m
+++ b/src/llvm-project/clang/test/SemaObjC/format-strings-objc.m
@@ -25,7 +25,11 @@
@protocol NSCoding - (void)encodeWithCoder:(NSCoder *)aCoder; @end
@interface NSObject <NSObject> {} @end
typedef float CGFloat;
-@interface NSString : NSObject <NSCopying, NSMutableCopying, NSCoding> - (NSUInteger)length; @end
+@interface NSString : NSObject <NSCopying, NSMutableCopying, NSCoding>
+- (NSUInteger)length;
++(instancetype)stringWithFormat:(NSString *)fmt, ...
+ __attribute__((format(__NSString__, 1, 2)));
+@end
@interface NSSimpleCString : NSString {} @end
@interface NSConstantString : NSSimpleCString @end
extern void *_NSConstantStringClassReference;
@@ -302,3 +306,39 @@
}
@end
+
+@interface NSBundle : NSObject
+- (NSString *)localizedStringForKey:(NSString *)key
+ value:(nullable NSString *)value
+ table:(nullable NSString *)tableName
+ __attribute__((format_arg(1)));
+
+- (NSString *)someRandomMethod:(NSString *)key
+ value:(nullable NSString *)value
+ table:(nullable NSString *)tableName
+ __attribute__((format_arg(1)));
+@end
+
+void useLocalizedStringForKey(NSBundle *bndl) {
+ [NSString stringWithFormat:
+ [bndl localizedStringForKey:@"%d" // expected-warning{{more '%' conversions than data arguments}}
+ value:0
+ table:0]];
+ // No warning, @"flerp" doesn't have a format specifier.
+ [NSString stringWithFormat: [bndl localizedStringForKey:@"flerp" value:0 table:0], 43, @"flarp"];
+
+ [NSString stringWithFormat:
+ [bndl localizedStringForKey:@"%f"
+ value:0
+ table:0], 42]; // expected-warning{{format specifies type 'double' but the argument has type 'int'}}
+
+ [NSString stringWithFormat:
+ [bndl someRandomMethod:@"%f"
+ value:0
+ table:0], 42]; // expected-warning{{format specifies type 'double' but the argument has type 'int'}}
+
+ [NSString stringWithFormat:
+ [bndl someRandomMethod:@"flerp"
+ value:0
+ table:0], 42]; // expected-warning{{data argument not used by format string}}
+}
diff --git a/src/llvm-project/clang/test/SemaObjC/iboutlet.m b/src/llvm-project/clang/test/SemaObjC/iboutlet.m
index 7bd86d4..1d8ec99 100644
--- a/src/llvm-project/clang/test/SemaObjC/iboutlet.m
+++ b/src/llvm-project/clang/test/SemaObjC/iboutlet.m
@@ -11,7 +11,7 @@
IBInspectable @property (readonly) IBOutlet NSView *myView1; // expected-warning {{readonly IBOutlet property 'myView1' when auto-synthesized may not work correctly with 'nib' loader}} expected-note {{property should be changed to be readwrite}}
-@property (getter = MyGetter, READONLY) IBOutlet NSView *myView2; // expected-warning {{readonly IBOutlet property 'myView2' when auto-synthesized may not work correctly with 'nib' loader}}
+@property (getter = MyGetter2, READONLY) IBOutlet NSView *myView2; // expected-warning {{readonly IBOutlet property 'myView2' when auto-synthesized may not work correctly with 'nib' loader}}
@end
diff --git a/src/llvm-project/clang/test/SemaObjC/method-direct-one-definition.m b/src/llvm-project/clang/test/SemaObjC/method-direct-one-definition.m
new file mode 100644
index 0000000..e6355d2
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaObjC/method-direct-one-definition.m
@@ -0,0 +1,53 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-protocol-method-implementation %s
+
+__attribute__((objc_root_class))
+@interface A
+@end
+
+@interface A (Cat)
+- (void)A_Cat __attribute__((objc_direct)); // expected-note {{previous declaration is here}}
+@end
+
+@implementation A
+- (void)A_Cat { // expected-error {{direct method was declared in a category but is implemented in the primary interface}}
+}
+@end
+
+__attribute__((objc_root_class))
+@interface B
+- (void)B_primary __attribute__((objc_direct)); // expected-note {{previous declaration is here}}
+@end
+
+@interface B ()
+- (void)B_extension __attribute__((objc_direct)); // expected-note {{previous declaration is here}}
+@end
+
+@interface B (Cat)
+- (void)B_Cat __attribute__((objc_direct));
+@end
+
+@interface B (OtherCat)
+- (void)B_OtherCat __attribute__((objc_direct)); // expected-note {{previous declaration is here}}
+@end
+
+@implementation B (Cat)
+- (void)B_primary { // expected-error {{direct method was declared in the primary interface but is implemented in a category}}
+}
+- (void)B_extension { // expected-error {{direct method was declared in an extension but is implemented in a different category}}
+}
+- (void)B_Cat {
+}
+- (void)B_OtherCat { // expected-error {{direct method was declared in a category but is implemented in a different category}}
+}
+@end
+
+__attribute__((objc_root_class))
+@interface C
+- (void)C1 __attribute__((objc_direct)); // expected-note {{previous declaration is here}}
+- (void)C2; // expected-note {{previous declaration is here}}
+@end
+
+@interface C (Cat)
+- (void)C1; // expected-error {{method declaration conflicts with previous direct declaration of method 'C1'}}
+- (void)C2 __attribute__((objc_direct)); // expected-error {{direct method declaration conflicts with previous declaration of method 'C2'}}
+@end
diff --git a/src/llvm-project/clang/test/SemaObjC/method-direct-properties.m b/src/llvm-project/clang/test/SemaObjC/method-direct-properties.m
new file mode 100644
index 0000000..26d1301
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaObjC/method-direct-properties.m
@@ -0,0 +1,126 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -Wselector-type-mismatch %s
+
+@protocol ProtoDirectFail
+@property(nonatomic, direct) int protoProperty; // expected-error {{'objc_direct' attribute cannot be applied to properties declared in an Objective-C protocol}}
+@end
+
+__attribute__((objc_root_class))
+@interface Root
+@property(nonatomic, direct) int propertyWithNonDirectGetter; // expected-note {{previous declaration is here}}
+- (int)propertyWithNonDirectGetter;
+- (int)propertyWithNonDirectGetter2;
+- (int)propertyWithNonDirectGetterInParent;
+- (int)propertyWithNonDirectGetterInParent2;
+
+@property(nonatomic, readonly, direct) int getDirect_setDynamic; // expected-note {{previous declaration is here}}
+@property(nonatomic, readonly, direct) int getDirect_setDirect; // expected-note {{previous declaration is here}}
+@property(nonatomic, readonly, direct) int getDirect_setDirectMembers; // expected-note {{previous declaration is here}}
+
+@property(nonatomic, readonly) int getDynamic_setDirect;
+@property(nonatomic, readonly) int getDynamic_setDirectMembers;
+
+@property(nonatomic, readonly) int dynamicProperty;
+@property(nonatomic, readonly) int synthDynamicProperty;
+
+@property(nonatomic, readonly, direct) int directProperty; // expected-note {{previous declaration is here}}
+@property(nonatomic, readonly, direct) int synthDirectProperty; // expected-note {{previous declaration is here}}
+@end
+
+__attribute__((objc_direct_members))
+@interface
+Root()
+@property(nonatomic) int propertyWithNonDirectGetter2; // expected-note {{previous declaration is here}}
+
+@property(nonatomic, readwrite) int getDirect_setDirectMembers; // expected-note {{previous declaration is here}}
+@property(nonatomic, readwrite) int getDynamic_setDirectMembers; // expected-note {{previous declaration is here}}
+@end
+
+@interface Root ()
+@property(nonatomic, readwrite) int getDirect_setDynamic;
+@property(nonatomic, readwrite, direct) int getDirect_setDirect; // expected-note {{previous declaration is here}}
+
+@property(nonatomic, readwrite, direct) int getDynamic_setDirect; // expected-note {{previous declaration is here}}
+@end
+
+@interface Sub : Root
+@property(nonatomic, direct) int propertyWithNonDirectGetterInParent; // expected-note {{previous declaration is here}}
+
+- (int)propertyWithNonDirectGetter; // no error: legal override
+- (int)propertyWithNonDirectGetter2; // no error: legal override
+- (int)propertyWithNonDirectGetterInParent; // no error: legal override
+- (int)propertyWithNonDirectGetterInParent2; // no error: legal override
+
+@end
+
+__attribute__((objc_direct_members))
+@interface Sub ()
+@property(nonatomic) int propertyWithNonDirectGetterInParent2; // expected-note {{previous declaration is here}}
+@end
+
+// make sure that the `directness` of methods stuck,
+// by observing errors trying to override the setter
+@interface SubWitness : Sub
+
+- (int)setPropertyWithNonDirectGetter:(int)value; // expected-error {{cannot override a method that is declared direct by a superclass}}
+- (int)setPropertyWithNonDirectGetter2:(int)value; // expected-error {{cannot override a method that is declared direct by a superclass}}
+- (int)setPropertyWithNonDirectGetterInParent:(int)value; // expected-error {{cannot override a method that is declared direct by a superclass}}
+- (int)setPropertyWithNonDirectGetterInParent2:(int)value; // expected-error {{cannot override a method that is declared direct by a superclass}}
+
+- (int)getDirect_setDynamic; // expected-error {{cannot override a method that is declared direct by a superclass}}
+- (int)setGetDirect_setDynamic:(int)value;
+- (int)getDirect_setDirect; // expected-error {{cannot override a method that is declared direct by a superclass}}
+- (int)setGetDirect_setDirect:(int)value; // expected-error {{cannot override a method that is declared direct by a superclass}}
+- (int)getDirect_setDirectMembers; // expected-error {{cannot override a method that is declared direct by a superclass}}
+- (int)setGetDirect_setDirectMembers:(int)value; // expected-error {{cannot override a method that is declared direct by a superclass}}
+
+- (int)getDynamic_setDirect;
+- (int)setGetDynamic_setDirect:(int)value; // expected-error {{cannot override a method that is declared direct by a superclass}}
+- (int)getDynamic_setDirectMembers;
+- (int)setGetDynamic_setDirectMembers:(int)value; // expected-error {{cannot override a method that is declared direct by a superclass}}
+@end
+
+__attribute__((objc_direct_members))
+@implementation Root
+- (int)propertyWithNonDirectGetter {
+ return 42;
+}
+- (int)propertyWithNonDirectGetter2 {
+ return 42;
+}
+- (int)propertyWithNonDirectGetterInParent {
+ return 42;
+}
+- (int)propertyWithNonDirectGetterInParent2 {
+ return 42;
+}
+
+- (int)dynamicProperty {
+ return 42;
+}
+- (int)directProperty {
+ return 42;
+}
+@end
+
+@implementation Sub
+- (int)propertyWithNonDirectGetter {
+ return 42;
+}
+- (int)propertyWithNonDirectGetter2 {
+ return 42;
+}
+
+- (int)dynamicProperty {
+ return 42;
+}
+- (int)synthDynamicProperty {
+ return 42;
+}
+
+- (int)directProperty { // expected-error {{cannot override a method that is declared direct by a superclass}}
+ return 42;
+}
+- (int)synthDirectProperty { // expected-error {{cannot override a method that is declared direct by a superclass}}
+ return 42;
+}
+@end
diff --git a/src/llvm-project/clang/test/SemaObjC/method-direct.m b/src/llvm-project/clang/test/SemaObjC/method-direct.m
new file mode 100644
index 0000000..4829a67
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaObjC/method-direct.m
@@ -0,0 +1,148 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -Wselector-type-mismatch %s
+
+@protocol Proto
+- (void)protoMethod; // expected-note {{previous declaration is here}}
++ (void)classProtoMethod; // expected-note {{previous declaration is here}}
+@end
+
+@protocol ProtoDirectFail
+- (void)protoMethod __attribute__((objc_direct)); // expected-error {{'objc_direct' attribute cannot be applied to methods declared in an Objective-C protocol}}
++ (void)classProtoMethod __attribute__((objc_direct)); // expected-error {{'objc_direct' attribute cannot be applied to methods declared in an Objective-C protocol}}
+@end
+
+__attribute__((objc_root_class))
+@interface Root
+- (void)rootRegular; // expected-note {{previous declaration is here}}
++ (void)classRootRegular; // expected-note {{previous declaration is here}}
+- (void)rootDirect __attribute__((objc_direct)); // expected-note {{previous declaration is here}};
++ (void)classRootDirect __attribute__((objc_direct)); // expected-note {{previous declaration is here}};
+- (void)otherRootDirect __attribute__((objc_direct)); // expected-note {{direct method 'otherRootDirect' declared here}}
++ (void)otherClassRootDirect __attribute__((objc_direct)); // expected-note {{direct method 'otherClassRootDirect' declared here}}
+- (void)notDirectInIface; // expected-note {{previous declaration is here}}
++ (void)classNotDirectInIface; // expected-note {{previous declaration is here}}
+@end
+
+__attribute__((objc_direct_members))
+@interface Root ()
+- (void)rootExtensionDirect; // expected-note {{previous declaration is here}}
++ (void)classRootExtensionDirect; // expected-note {{previous declaration is here}}
+@end
+
+__attribute__((objc_direct_members))
+@interface Root(Direct)
+- (void)rootCategoryDirect; // expected-note {{previous declaration is here}}
++ (void)classRootCategoryDirect; // expected-note {{previous declaration is here}}
+@end
+
+@interface Root ()
+- (void)rootExtensionRegular; // expected-note {{previous declaration is here}}
++ (void)classRootExtensionRegular; // expected-note {{previous declaration is here}}
+- (void)rootExtensionDirect2 __attribute__((objc_direct)); // expected-note {{previous declaration is here}}
++ (void)classRootExtensionDirect2 __attribute__((objc_direct)); // expected-note {{previous declaration is here}}
+@end
+
+@interface Root (Direct2)
+- (void)rootCategoryRegular; // expected-note {{previous declaration is here}}
++ (void)classRootCategoryRegular; // expected-note {{previous declaration is here}}
+- (void)rootCategoryDirect2 __attribute__((objc_direct)); // expected-note {{previous declaration is here}}
++ (void)classRootCategoryDirect2 __attribute__((objc_direct)); // expected-note {{previous declaration is here}}
+@end
+
+__attribute__((objc_root_class, objc_direct_members)) // expected-error {{'objc_direct_members' attribute only applies to Objective-C implementation declarations and Objective-C containers}}
+@interface SubDirectFail : Root
+- (instancetype)init;
+@end
+
+@interface Sub : Root <Proto>
+/* invalid overrides with directs */
+- (void)rootRegular __attribute__((objc_direct)); // expected-error {{methods that override superclass methods cannot be direct}}
++ (void)classRootRegular __attribute__((objc_direct)); // expected-error {{methods that override superclass methods cannot be direct}}
+- (void)protoMethod __attribute__((objc_direct)); // expected-error {{methods that implement protocol requirements cannot be direct}}
++ (void)classProtoMethod __attribute__((objc_direct)); // expected-error {{methods that implement protocol requirements cannot be direct}}
+- (void)rootExtensionRegular __attribute__((objc_direct)); // expected-error {{methods that override superclass methods cannot be direct}}
++ (void)classRootExtensionRegular __attribute__((objc_direct)); // expected-error {{methods that override superclass methods cannot be direct}}
+- (void)rootCategoryRegular __attribute__((objc_direct)); // expected-error {{methods that override superclass methods cannot be direct}}
++ (void)classRootCategoryRegular __attribute__((objc_direct)); // expected-error {{methods that override superclass methods cannot be direct}}
+
+/* invalid overrides of directs */
+- (void)rootDirect; // expected-error {{cannot override a method that is declared direct by a superclass}}
++ (void)classRootDirect; // expected-error {{cannot override a method that is declared direct by a superclass}}
+- (void)rootExtensionDirect; // expected-error {{cannot override a method that is declared direct by a superclass}}
++ (void)classRootExtensionDirect; // expected-error {{cannot override a method that is declared direct by a superclass}}
+- (void)rootExtensionDirect2; // expected-error {{cannot override a method that is declared direct by a superclass}}
++ (void)classRootExtensionDirect2; // expected-error {{cannot override a method that is declared direct by a superclass}}
+- (void)rootCategoryDirect; // expected-error {{cannot override a method that is declared direct by a superclass}}
++ (void)classRootCategoryDirect; // expected-error {{cannot override a method that is declared direct by a superclass}}
+- (void)rootCategoryDirect2; // expected-error {{cannot override a method that is declared direct by a superclass}}
++ (void)classRootCategoryDirect2; // expected-error {{cannot override a method that is declared direct by a superclass}}
+@end
+
+__attribute__((objc_direct_members))
+@implementation Root
+- (void)rootRegular {
+}
++ (void)classRootRegular {
+}
+- (void)rootDirect {
+}
++ (void)classRootDirect {
+}
+- (void)otherRootDirect {
+}
++ (void)otherClassRootDirect {
+}
+- (void)rootExtensionDirect {
+}
++ (void)classRootExtensionDirect {
+}
+- (void)rootExtensionRegular {
+}
++ (void)classRootExtensionRegular {
+}
+- (void)rootExtensionDirect2 {
+}
++ (void)classRootExtensionDirect2 {
+}
+- (void)notDirectInIface __attribute__((objc_direct)) // expected-error {{direct method implementation was previously declared not direct}}
+{
+}
++ (void)classNotDirectInIface __attribute__((objc_direct)) // expected-error {{direct method implementation was previously declared not direct}}
+{
+}
+- (void)direct1 { // expected-note {{direct method 'direct1' declared here}}
+}
+- (void)direct2 { // expected-note {{direct method 'direct2' declared here}}
+}
+@end
+
+@interface Foo : Root
+- (id)directMismatch1; // expected-note {{using}}
+- (id)directMismatch2; // expected-note {{method 'directMismatch2' declared here}}
+@end
+
+@interface Bar : Root
+- (void)directMismatch1 __attribute__((objc_direct)); // expected-note {{also found}}
+- (void)directMismatch2 __attribute__((objc_direct)); // expected-note {{method 'directMismatch2' declared here}}
+@end
+
+@interface ValidSub : Root
+@end
+
+@implementation ValidSub
+- (void)someValidSubMethod {
+ [super otherRootDirect]; // expected-error {{messaging super with a direct method}}
+}
+@end
+
+extern void callMethod(id obj, Class cls);
+extern void useSel(SEL sel);
+
+void callMethod(id obj, Class cls) {
+ [Root otherClassRootDirect];
+ [cls otherClassRootDirect]; // expected-error {{messaging a Class with a method that is possibly direct}}
+ [obj direct1]; // expected-error {{messaging unqualified id with a method that is possibly direct}}
+ [(Root *)obj direct1];
+ [obj directMismatch1]; // expected-warning {{multiple methods named 'directMismatch1' found}}
+ useSel(@selector(direct2)); // expected-error {{@selector expression formed with direct selector 'direct2'}}
+ useSel(@selector(directMismatch2)); // expected-warning {{several methods with selector 'directMismatch2' of mismatched types are found for the @selector expression}}
+}
diff --git a/src/llvm-project/clang/test/SemaObjC/non-trivial-c-union.m b/src/llvm-project/clang/test/SemaObjC/non-trivial-c-union.m
index 7bd8277..4c29476 100644
--- a/src/llvm-project/clang/test/SemaObjC/non-trivial-c-union.m
+++ b/src/llvm-project/clang/test/SemaObjC/non-trivial-c-union.m
@@ -1,4 +1,6 @@
-// RUN: %clang_cc1 -fsyntax-only -fblocks -fobjc-arc -fobjc-runtime-has-weak -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fblocks -fobjc-arc -fobjc-runtime-has-weak -I %S/Inputs -verify %s
+
+#include "non-trivial-c-union.h"
typedef union { // expected-note 12 {{'U0' has subobjects that are non-trivial to default-initialize}} expected-note 36 {{'U0' has subobjects that are non-trivial to destruct}} expected-note 28 {{'U0' has subobjects that are non-trivial to copy}}
id f0; // expected-note 12 {{f0 has type '__strong id' that is non-trivial to default-initialize}} expected-note 36 {{f0 has type '__strong id' that is non-trivial to destruct}} expected-note 28 {{f0 has type '__strong id' that is non-trivial to copy}}
@@ -80,3 +82,7 @@
void testVolatileLValueToRValue(volatile U0 *a) {
(void)*a; // expected-error {{cannot use volatile type 'volatile U0' where it causes an lvalue-to-rvalue conversion since it is a union that is non-trivial to destruct}} // expected-error {{cannot use volatile type 'volatile U0' where it causes an lvalue-to-rvalue conversion since it is a union that is non-trivial to copy}}
}
+
+void unionInSystemHeader0(U0_SystemHeader);
+
+void unionInSystemHeader1(U1_SystemHeader); // expected-error {{cannot use type 'U1_SystemHeader' for a function/method parameter since it is a union that is non-trivial to destruct}} expected-error {{cannot use type 'U1_SystemHeader' for a function/method parameter since it is a union that is non-trivial to copy}}
diff --git a/src/llvm-project/clang/test/SemaObjC/signed-char-bool-conversion.m b/src/llvm-project/clang/test/SemaObjC/signed-char-bool-conversion.m
new file mode 100644
index 0000000..6945d86
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaObjC/signed-char-bool-conversion.m
@@ -0,0 +1,105 @@
+// RUN: %clang_cc1 %s -verify -Wobjc-signed-char-bool
+// RUN: %clang_cc1 -xobjective-c++ %s -verify -Wobjc-signed-char-bool
+
+typedef signed char BOOL;
+#define YES __objc_yes
+#define NO __objc_no
+
+typedef unsigned char Boolean;
+
+BOOL b;
+Boolean boolean;
+float fl;
+int i;
+int *ptr;
+
+void t1() {
+ b = boolean;
+ b = fl; // expected-warning {{implicit conversion from floating-point type 'float' to 'BOOL'}}
+ b = i; // expected-warning {{implicit conversion from integral type 'int' to 'BOOL'}}
+
+ b = 1.0;
+ b = 0.0;
+ b = 1.1; // expected-warning {{implicit conversion from 'double' to 'BOOL' (aka 'signed char') changes value from 1.1 to 1}}
+ b = 2.1; // expected-warning {{implicit conversion from constant value 2.1 to 'BOOL'; the only well defined values for 'BOOL' are YES and NO}}
+
+ b = YES;
+#ifndef __cplusplus
+ b = ptr; // expected-warning {{incompatible pointer to integer conversion assigning to 'BOOL' (aka 'signed char') from 'int *'}}
+#endif
+}
+
+@interface BoolProp
+@property BOOL p;
+@end
+
+void t2(BoolProp *bp) {
+ bp.p = YES;
+ bp.p = NO;
+ bp.p = boolean;
+ bp.p = fl; // expected-warning {{implicit conversion from floating-point type 'float' to 'BOOL'}}
+ bp.p = i; // expected-warning {{implicit conversion from integral type 'int' to 'BOOL'}}
+ bp.p = b;
+ bp.p = bp.p;
+#ifndef __cplusplus
+ bp.p = ptr; // expected-warning {{incompatible pointer to integer conversion assigning to 'BOOL' (aka 'signed char') from 'int *'}}
+#endif
+ bp.p = 1;
+ bp.p = 2; // expected-warning {{implicit conversion from constant value 2 to 'BOOL'; the only well defined values for 'BOOL' are YES and NO}}
+}
+
+struct has_bf {
+ int signed_bf1 : 1;
+ int signed_bf2 : 2;
+ unsigned unsigned_bf1 : 1;
+ unsigned unsigned_bf2 : 2;
+
+ struct has_bf *nested;
+};
+
+void t3(struct has_bf *bf) {
+ b = bf->signed_bf1; // expected-warning{{implicit conversion from integral type 'int' to 'BOOL'}}
+ b = bf->signed_bf2; // expected-warning{{implicit conversion from integral type 'int' to 'BOOL'}}
+ b = bf->unsigned_bf1; // no warning
+ b = bf->unsigned_bf2; // expected-warning{{implicit conversion from integral type 'unsigned int' to 'BOOL'}}
+ struct has_bf local;
+ b = local.unsigned_bf1;
+ b = local.unsigned_bf2; // expected-warning{{implicit conversion from integral type 'unsigned int' to 'BOOL'}}
+ b = local.nested->unsigned_bf1;
+ b = local.nested->unsigned_bf2; // expected-warning{{implicit conversion from integral type 'unsigned int' to 'BOOL'}}
+}
+
+__attribute__((objc_root_class))
+@interface BFIvar {
+ struct has_bf bf;
+ unsigned unsigned_bf1 : 1;
+ unsigned unsigned_bf2 : 2;
+}
+@end
+
+@implementation BFIvar
+-(void)m {
+ b = bf.unsigned_bf1;
+ b = bf.unsigned_bf2; // expected-warning{{implicit conversion from integral type 'unsigned int' to 'BOOL'}}
+ b = unsigned_bf1;
+ b = unsigned_bf2; // expected-warning{{implicit conversion from integral type 'unsigned int' to 'BOOL'}}
+}
+@end
+
+#ifdef __cplusplus
+template <class T>
+struct S {
+ unsigned i : sizeof(T);
+};
+
+template <class T>
+void f() {
+ S<T> i;
+ BOOL b = i.i; // expected-warning{{implicit conversion from integral type 'unsigned int' to 'BOOL'}}
+}
+
+int main() {
+ f<char>();
+ f<short>(); // expected-note {{in instantiation of function template specialization 'f<short>' requested here}}
+}
+#endif
diff --git a/src/llvm-project/clang/test/SemaObjC/typo-correction-subscript.m b/src/llvm-project/clang/test/SemaObjC/typo-correction-subscript.m
index 19eb860..bfcd894 100644
--- a/src/llvm-project/clang/test/SemaObjC/typo-correction-subscript.m
+++ b/src/llvm-project/clang/test/SemaObjC/typo-correction-subscript.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple i386-apple-macosx10.10 -fobjc-arc -fsyntax-only -Wno-objc-root-class %s -verify -disable-free
+// RUN: %clang_cc1 -triple i386-apple-macosx10.10 -fobjc-arc -fsyntax-only -Wno-objc-root-class %s -verify
@class Dictionary;
@@ -9,6 +9,7 @@
- (void)rdar47403222:(Dictionary *)opts {
[self undeclaredMethod:undeclaredArg];
// expected-error@-1{{no visible @interface for 'Test' declares the selector 'undeclaredMethod:'}}
+ // expected-error@-2{{use of undeclared identifier 'undeclaredArg}}
opts[(__bridge id)undeclaredKey] = 0;
// expected-error@-1{{use of undeclared identifier 'undeclaredKey'}}
}
diff --git a/src/llvm-project/clang/test/SemaObjCXX/arc-overloading.mm b/src/llvm-project/clang/test/SemaObjCXX/arc-overloading.mm
index 3ac9c51..910b5c7 100644
--- a/src/llvm-project/clang/test/SemaObjCXX/arc-overloading.mm
+++ b/src/llvm-project/clang/test/SemaObjCXX/arc-overloading.mm
@@ -174,6 +174,36 @@
const __autoreleasing id& ar4 = weak_a;
}
+int &f10(__strong id *&); // expected-note 2{{not viable: no known conversion}}
+float &f10(__autoreleasing id *&); // expected-note 2{{not viable: no known conversion}}
+
+void test_f10() {
+ __strong id *strong_id;
+ __weak id *weak_id;
+ __autoreleasing id *autoreleasing_id;
+ __unsafe_unretained id *unsafe_id;
+
+ int &ir1 = f10(strong_id);
+ float &fr1 = f10(autoreleasing_id);
+ float &fr2 = f10(unsafe_id); // expected-error {{no match}}
+ float &fr2a = f10(weak_id); // expected-error {{no match}}
+}
+
+int &f11(__strong id *const &); // expected-note {{not viable: 1st argument ('__weak id *') has __weak ownership, but parameter has __strong ownership}}
+float &f11(const __autoreleasing id *const &); // expected-note {{not viable: 1st argument ('__weak id *') has __weak ownership, but parameter has __autoreleasing ownership}}
+
+void test_f11() {
+ __strong id *strong_id;
+ __weak id *weak_id;
+ __autoreleasing id *autoreleasing_id;
+ __unsafe_unretained id *unsafe_id;
+
+ int &ir1 = f11(strong_id);
+ float &fr1 = f11(autoreleasing_id);
+ float &fr2 = f11(unsafe_id);
+ float &fr2a = f11(weak_id); // expected-error {{no match}}
+}
+
// rdar://9790531
void f9790531(void *inClientData); // expected-note {{candidate function not viable: cannot implicitly convert argument of type 'MixerEQGraphTestDelegate *const __strong' to 'void *' for 1st argument under ARC}}
void f9790531_1(struct S*inClientData); // expected-note {{candidate function not viable}}
diff --git a/src/llvm-project/clang/test/SemaObjCXX/arc-ptr-comparison.mm b/src/llvm-project/clang/test/SemaObjCXX/arc-ptr-comparison.mm
index 8571a81..b3af26c 100644
--- a/src/llvm-project/clang/test/SemaObjCXX/arc-ptr-comparison.mm
+++ b/src/llvm-project/clang/test/SemaObjCXX/arc-ptr-comparison.mm
@@ -22,3 +22,32 @@
return v == (void *)0;
return x == y;
}
+
+@class A;
+
+int testMixedQualComparisonRules(void *v, const void *cv, A *a, const A *ca) {
+ return cv == ca;
+#ifndef NOARC
+// expected-error@-2 {{implicit conversion of Objective-C pointer type 'const A *' to C pointer type 'const void *' requires a bridged cast}}
+// expected-note@-3 {{use __bridge to convert directly (no change in ownership)}}
+// expected-note@-4 {{use __bridge_retained to make an ARC object available as a +1 'const void *'}}
+#endif
+ // FIXME: The "to" type in this diagnostic is wrong; we should convert to "const void *".
+ return v == ca;
+#ifndef NOARC
+// expected-error@-2 {{implicit conversion of Objective-C pointer type 'const A *' to C pointer type 'void *' requires a bridged cast}}
+// expected-note@-3 {{use __bridge to convert directly (no change in ownership)}}
+// expected-note@-4 {{use __bridge_retained to make an ARC object available as a +1 'void *'}}
+#endif
+ return cv == a;
+#ifndef NOARC
+// expected-error@-2 {{implicit conversion of Objective-C pointer type 'A *' to C pointer type 'const void *' requires a bridged cast}}
+// expected-note@-3 {{use __bridge to convert directly (no change in ownership)}}
+// expected-note@-4 {{use __bridge_retained to make an ARC object available as a +1 'const void *'}}
+#endif
+
+ // FIXME: Shouldn't these be rejected in ARC mode too?
+ return ca == cv;
+ return a == cv;
+ return ca == v;
+}
diff --git a/src/llvm-project/clang/test/SemaObjCXX/class-method-self.mm b/src/llvm-project/clang/test/SemaObjCXX/class-method-self.mm
new file mode 100644
index 0000000..bb0b601
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaObjCXX/class-method-self.mm
@@ -0,0 +1,25 @@
+// RUN: %clang_cc1 -verify -Wno-objc-root-class %s
+
+@interface XX
+
+- (void)addObserver:(XX*)o; // expected-note 2{{passing argument to parameter 'o' here}}
+
+@end
+
+@interface YY
+
++ (void)classMethod;
+
+@end
+
+@implementation YY
+
+static XX *obj;
+
++ (void)classMethod {
+ [obj addObserver:self]; // expected-error {{cannot initialize a parameter of type 'XX *' with an lvalue of type 'Class'}}
+ Class whatever;
+ [obj addObserver:whatever]; // expected-error {{cannot initialize a parameter of type 'XX *' with an lvalue of type 'Class'}}
+}
+@end
+
diff --git a/src/llvm-project/clang/test/SemaObjCXX/composite-objc-pointertype.mm b/src/llvm-project/clang/test/SemaObjCXX/composite-objc-pointertype.mm
index 35739a8..64cdc2c 100644
--- a/src/llvm-project/clang/test/SemaObjCXX/composite-objc-pointertype.mm
+++ b/src/llvm-project/clang/test/SemaObjCXX/composite-objc-pointertype.mm
@@ -17,3 +17,13 @@
}
@end
+@class A;
+
+void multilevel() {
+ A **p;
+ const A **q;
+
+ using T = decltype(true ? q : p);
+ using T = const A * const *;
+}
+
diff --git a/src/llvm-project/clang/test/SemaObjCXX/comptypes-1.mm b/src/llvm-project/clang/test/SemaObjCXX/comptypes-1.mm
new file mode 100644
index 0000000..abb8777
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaObjCXX/comptypes-1.mm
@@ -0,0 +1,124 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -pedantic %s
+
+#define nil nullptr
+
+extern void foo();
+
+@protocol MyProtocol
+- (void) foo;
++ (void) bar;
+@end
+
+@interface MyClass
+@end
+
+@interface MyOtherClass <MyProtocol>
+- (void) foo;
+@end
+
+int main()
+{
+ id obj = nil;
+ id<MyProtocol> obj_p = nil;
+ MyClass *obj_c = nil;
+ MyOtherClass *obj_cp = nil;
+ Class obj_C = nil;
+ Class<MyProtocol> obj_CP = nil;
+
+ /* Assigning to an 'id' variable should never
+ generate a warning. */
+ obj = obj_p; /* Ok */
+ obj = obj_c; /* Ok */
+ obj = obj_cp; /* Ok */
+ obj = obj_C; /* Ok */
+ obj = obj_CP; /* Ok */
+
+ /* Assigning to a 'MyClass *' variable should always generate a
+ warning, unless done from an 'id'. */
+ obj_c = obj; /* Ok */
+ obj_c = obj_p; // expected-error {{assigning to 'MyClass *' from incompatible type 'id<MyProtocol>'}}
+ obj_c = obj_cp; // expected-error {{assigning to 'MyClass *' from incompatible type 'MyOtherClass *'}}
+ obj_c = obj_C; // expected-error {{assigning to 'MyClass *' from incompatible type 'Class'}}
+ obj_c = obj_CP; // expected-error {{assigning to 'MyClass *' from incompatible type 'Class<MyProtocol>'}}
+
+ /* Assigning to an 'id<MyProtocol>' variable should generate a
+ warning if done from a 'MyClass *' (which doesn't implement
+ MyProtocol), but not from an 'id' or from a 'MyOtherClass *'
+ (which implements MyProtocol). */
+ obj_p = obj; /* Ok */
+ obj_p = obj_c; // expected-error {{assigning to 'id<MyProtocol>' from incompatible type 'MyClass *'}}
+ obj_p = obj_cp; /* Ok */
+ obj_p = obj_C; // expected-error {{assigning to 'id<MyProtocol>' from incompatible type 'Class'}}
+ obj_p = obj_CP; // expected-error {{assigning to 'id<MyProtocol>' from incompatible type 'Class<MyProtocol>'}}
+
+ /* Assigning to a 'MyOtherClass *' variable should always generate
+ a warning, unless done from an 'id' or an 'id<MyProtocol>' (since
+ MyOtherClass implements MyProtocol). */
+ obj_cp = obj; /* Ok */
+ obj_cp = obj_c; // expected-error {{assigning to 'MyOtherClass *' from incompatible type 'MyClass *'}}
+ obj_cp = obj_p; /* Ok */
+ obj_cp = obj_C; // expected-error {{assigning to 'MyOtherClass *' from incompatible type 'Class'}}
+ obj_cp = obj_CP; // expected-error {{assigning to 'MyOtherClass *' from incompatible type 'Class<MyProtocol>'}}
+
+ obj_C = obj; // Ok
+ obj_C = obj_p; // expected-error {{assigning to 'Class' from incompatible type 'id<MyProtocol>'}}
+ obj_C = obj_c; // expected-error {{assigning to 'Class' from incompatible type 'MyClass *'}}
+ obj_C = obj_cp; // expected-error {{assigning to 'Class' from incompatible type 'MyOtherClass *'}}
+ obj_C = obj_CP; // Ok
+
+ obj_CP = obj; // Ok
+ obj_CP = obj_p; // expected-error {{assigning to 'Class<MyProtocol>' from incompatible type 'id<MyProtocol>'}}
+ obj_CP = obj_c; // expected-error {{assigning to 'Class<MyProtocol>' from incompatible type 'MyClass *}}
+ obj_CP = obj_cp; // expected-error {{assigning to 'Class<MyProtocol>' from incompatible type 'MyOtherClass *'}}
+ obj_CP = obj_C; // Ok
+
+ /* Any comparison involving an 'id' must be without warnings. */
+ if (obj == obj_p) foo(); /* Ok */ /*Bogus warning here in 2.95.4*/
+ if (obj_p == obj) foo(); /* Ok */
+ if (obj == obj_c) foo(); /* Ok */
+ if (obj_c == obj) foo(); /* Ok */
+ if (obj == obj_cp) foo(); /* Ok */
+ if (obj_cp == obj) foo(); /* Ok */
+ if (obj == obj_C) foo(); /* Ok */
+ if (obj_C == obj) foo(); /* Ok */
+ if (obj == obj_CP) foo(); /* Ok */
+ if (obj_CP == obj) foo(); /* Ok */
+
+ /* Any comparison between 'MyClass *' and anything which is not an 'id'
+ must generate a warning. */
+ if (obj_c == obj_p) foo(); // expected-warning {{comparison of distinct pointer types ('MyClass *' and 'id<MyProtocol>')}}
+ if (obj_p == obj_c) foo(); // expected-warning {{comparison of distinct pointer types ('id<MyProtocol>' and 'MyClass *')}}
+
+ if (obj_c == obj_cp) foo(); // expected-warning {{comparison of distinct pointer types ('MyClass *' and 'MyOtherClass *')}}
+ if (obj_cp == obj_c) foo(); // expected-warning {{comparison of distinct pointer types ('MyOtherClass *' and 'MyClass *')}}
+
+ if (obj_c == obj_C) foo(); // expected-warning {{comparison of distinct pointer types ('MyClass *' and 'Class')}}
+ if (obj_C == obj_c) foo(); // expected-warning {{comparison of distinct pointer types ('Class' and 'MyClass *')}}
+
+ if (obj_c == obj_CP) foo(); // expected-warning {{comparison of distinct pointer types ('MyClass *' and 'Class<MyProtocol>')}}
+ if (obj_CP == obj_c) foo(); // expected-warning {{comparison of distinct pointer types ('Class<MyProtocol>' and 'MyClass *')}}
+
+ /* Any comparison between 'MyOtherClass *' (which implements
+ MyProtocol) and an 'id' implementing MyProtocol are Ok. */
+ if (obj_p == obj_cp) foo(); /* Ok */
+ if (obj_cp == obj_p) foo(); /* Ok */
+
+ if (obj_p == obj_C) foo(); // expected-warning {{comparison of distinct pointer types ('id<MyProtocol>' and 'Class')}}
+ if (obj_C == obj_p) foo(); // expected-warning {{comparison of distinct pointer types ('Class' and 'id<MyProtocol>')}}
+
+ if (obj_p == obj_CP) foo(); // expected-warning {{comparison of distinct pointer types ('id<MyProtocol>' and 'Class<MyProtocol>')}}
+ if (obj_CP == obj_p) foo(); // expected-warning {{comparison of distinct pointer types ('Class<MyProtocol>' and 'id<MyProtocol>')}}
+
+ /* Comparisons between MyOtherClass * and Class types is a warning */
+ if (obj_cp == obj_C) foo(); // expected-warning {{comparison of distinct pointer types ('MyOtherClass *' and 'Class')}}
+ if (obj_C == obj_cp) foo(); // expected-warning {{comparison of distinct pointer types ('Class' and 'MyOtherClass *')}}
+
+ if (obj_cp == obj_CP) foo(); // expected-warning {{comparison of distinct pointer types ('MyOtherClass *' and 'Class<MyProtocol>')}}
+ if (obj_CP == obj_cp) foo(); // expected-warning {{comparison of distinct pointer types ('Class<MyProtocol>' and 'MyOtherClass *')}}
+
+ /* Comparisons between a Class and a Class<MyProtocol> are ok */
+ if (obj_C == obj_CP) foo(); /* Ok */
+ if (obj_CP == obj_C) foo(); /* Ok */
+
+ return 0;
+}
diff --git a/src/llvm-project/clang/test/SemaObjCXX/comptypes-7.mm b/src/llvm-project/clang/test/SemaObjCXX/comptypes-7.mm
new file mode 100644
index 0000000..010c2ca
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaObjCXX/comptypes-7.mm
@@ -0,0 +1,74 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -pedantic %s
+
+#define nil nullptr
+
+extern void foo();
+
+@protocol MyProtocol
+- (void) method;
+@end
+
+@interface MyClass
+@end
+
+int main()
+{
+ id obj = nil;
+ id <MyProtocol> obj_p = nil;
+ MyClass *obj_c = nil;
+ Class obj_C = nil;
+
+ int i = 0;
+ int *j = nil;
+
+ /* These should all generate errors. */
+
+ obj = i; // expected-error {{assigning to 'id' from incompatible type 'int'}}
+ obj = j; // expected-error {{assigning to 'id' from incompatible type 'int *'}}
+
+ obj_p = i; // expected-error {{assigning to 'id<MyProtocol>' from incompatible type 'int'}}
+ obj_p = j; // expected-error {{assigning to 'id<MyProtocol>' from incompatible type 'int *'}}
+
+ obj_c = i; // expected-error {{assigning to 'MyClass *' from incompatible type 'int'}}
+ obj_c = j; // expected-error {{assigning to 'MyClass *' from incompatible type 'int *'}}
+
+ obj_C = i; // expected-error {{assigning to 'Class' from incompatible type 'int'}}
+ obj_C = j; // expected-error {{assigning to 'Class' from incompatible type 'int *'}}
+
+ i = obj; // expected-error {{assigning to 'int' from incompatible type 'id'}}
+ i = obj_p; // expected-error {{assigning to 'int' from incompatible type 'id<MyProtocol>'}}
+ i = obj_c; // expected-error {{assigning to 'int' from incompatible type 'MyClass *'}}
+ i = obj_C; // expected-error {{assigning to 'int' from incompatible type 'Class'}}
+
+ j = obj; // expected-error {{assigning to 'int *' from incompatible type 'id'}}
+ j = obj_p; // expected-error {{assigning to 'int *' from incompatible type 'id<MyProtocol>'}}
+ j = obj_c; // expected-error {{assigning to 'int *' from incompatible type 'MyClass *'}}
+ j = obj_C; // expected-error {{assigning to 'int *' from incompatible type 'Class'}}
+
+ if (obj == i) foo() ; // expected-error {{comparison between pointer and integer ('id' and 'int')}}
+ if (i == obj) foo() ; // expected-error {{comparison between pointer and integer ('int' and 'id')}}
+ if (obj == j) foo() ; // expected-error {{comparison of distinct pointer types ('id' and 'int *')}}
+ if (j == obj) foo() ; // expected-error {{comparison of distinct pointer types ('int *' and 'id')}}
+
+ if (obj_c == i) foo() ; // expected-error {{comparison between pointer and integer ('MyClass *' and 'int')}}
+ if (i == obj_c) foo() ; // expected-error {{comparison between pointer and integer ('int' and 'MyClass *')}}
+ if (obj_c == j) foo() ; // expected-error {{comparison of distinct pointer types ('MyClass *' and 'int *')}}
+ if (j == obj_c) foo() ; // expected-error {{comparison of distinct pointer types ('int *' and 'MyClass *')}}
+
+ if (obj_p == i) foo() ; // expected-error {{comparison between pointer and integer ('id<MyProtocol>' and 'int')}}
+ if (i == obj_p) foo() ; // expected-error {{comparison between pointer and integer ('int' and 'id<MyProtocol>')}}
+ if (obj_p == j) foo() ; // expected-error {{comparison of distinct pointer types ('id<MyProtocol>' and 'int *')}}
+ if (j == obj_p) foo() ; // expected-error {{comparison of distinct pointer types ('int *' and 'id<MyProtocol>')}}
+
+ if (obj_C == i) foo() ; // expected-error {{comparison between pointer and integer ('Class' and 'int')}}
+ if (i == obj_C) foo() ; // expected-error {{comparison between pointer and integer ('int' and 'Class')}}
+ if (obj_C == j) foo() ; // expected-error {{comparison of distinct pointer types ('Class' and 'int *')}}
+ if (j == obj_C) foo() ; // expected-error {{comparison of distinct pointer types ('int *' and 'Class')}}
+
+ Class bar1 = nil;
+ Class <MyProtocol> bar = nil;
+ bar = bar1;
+ bar1 = bar;
+
+ return 0;
+}
diff --git a/src/llvm-project/clang/test/SemaObjCXX/instancetype.mm b/src/llvm-project/clang/test/SemaObjCXX/instancetype.mm
index f61d6bf..3030d04 100644
--- a/src/llvm-project/clang/test/SemaObjCXX/instancetype.mm
+++ b/src/llvm-project/clang/test/SemaObjCXX/instancetype.mm
@@ -5,7 +5,7 @@
#endif
@interface Root
-+ (instancetype)alloc;
++ (instancetype)alloc; // expected-note {{explicitly declared 'instancetype'}}
- (instancetype)init; // expected-note{{overridden method is part of the 'init' method family}}
- (instancetype)self; // expected-note {{explicitly declared 'instancetype'}}
- (Class)class;
@@ -143,7 +143,7 @@
@implementation Subclass4
+ (id)alloc {
- return self; // FIXME: we accept this in ObjC++ but not ObjC?
+ return self; // expected-error{{cannot initialize return object of type 'Subclass4 *' with an lvalue of type 'Class'}}
}
- (Subclass3 *)init { return 0; } // don't complain: we lost the related return type
diff --git a/src/llvm-project/clang/test/SemaObjCXX/message.mm b/src/llvm-project/clang/test/SemaObjCXX/message.mm
index e2bdd13..aa364d5 100644
--- a/src/llvm-project/clang/test/SemaObjCXX/message.mm
+++ b/src/llvm-project/clang/test/SemaObjCXX/message.mm
@@ -84,7 +84,7 @@
#if __cplusplus <= 199711L
// expected-warning@-2 {{'typename' occurs outside of a template}}
#endif
- int array[5] = {[3] = 2};
+ int array[5] = {[3] = 2}; // expected-warning {{C99 extension}}
return [super method];
}
@end
diff --git a/src/llvm-project/clang/test/SemaOpenCL/access-qualifier.cl b/src/llvm-project/clang/test/SemaOpenCL/access-qualifier.cl
index 1753a1d..a5e1b65 100644
--- a/src/llvm-project/clang/test/SemaOpenCL/access-qualifier.cl
+++ b/src/llvm-project/clang/test/SemaOpenCL/access-qualifier.cl
@@ -25,11 +25,11 @@
kernel void k1(img1d_wo img) {
- myRead(img); // expected-error {{passing 'img1d_wo' (aka '__write_only image1d_t') to parameter of incompatible type '__read_only image1d_t'}}
+ myRead(img); // expected-error {{passing '__private img1d_wo' (aka '__private __write_only image1d_t') to parameter of incompatible type '__read_only image1d_t'}}
}
kernel void k2(img1d_ro img) {
- myWrite(img); // expected-error {{passing 'img1d_ro' (aka '__read_only image1d_t') to parameter of incompatible type '__write_only image1d_t'}}
+ myWrite(img); // expected-error {{passing '__private img1d_ro' (aka '__private __read_only image1d_t') to parameter of incompatible type '__write_only image1d_t'}}
}
kernel void k3(img1d_wo img) {
@@ -43,7 +43,7 @@
#endif
kernel void k5(img1d_ro_default img) {
- myWrite(img); // expected-error {{passing 'img1d_ro_default' (aka '__read_only image1d_t') to parameter of incompatible type '__write_only image1d_t'}}
+ myWrite(img); // expected-error {{passing '__private img1d_ro_default' (aka '__private __read_only image1d_t') to parameter of incompatible type '__write_only image1d_t'}}
}
kernel void k6(img1d_ro img) {
@@ -71,7 +71,7 @@
#if __OPENCL_C_VERSION__ >= 200
void myPipeWrite(write_only pipe int); // expected-note {{passing argument to parameter here}}
kernel void k14(read_only pipe int p) {
- myPipeWrite(p); // expected-error {{passing 'read_only pipe int' to parameter of incompatible type 'write_only pipe int'}}
+ myPipeWrite(p); // expected-error {{passing '__private read_only pipe int' to parameter of incompatible type 'write_only pipe int'}}
}
#endif
@@ -93,7 +93,7 @@
// expected-note@-2 {{previously declared 'read_only' here}}
kernel void pass_ro_typedef_to_wo(ROPipeInt p) {
- myPipeWrite(p); // expected-error {{passing 'ROPipeInt' (aka 'read_only pipe int') to parameter of incompatible type 'write_only pipe int'}}
+ myPipeWrite(p); // expected-error {{passing '__private ROPipeInt' (aka '__private read_only pipe int') to parameter of incompatible type 'write_only pipe int'}}
// expected-note@-25 {{passing argument to parameter here}}
}
#endif
diff --git a/src/llvm-project/clang/test/SemaOpenCL/address-spaces-conversions-cl2.0.cl b/src/llvm-project/clang/test/SemaOpenCL/address-spaces-conversions-cl2.0.cl
index 89cf8e3..5efea21 100644
--- a/src/llvm-project/clang/test/SemaOpenCL/address-spaces-conversions-cl2.0.cl
+++ b/src/llvm-project/clang/test/SemaOpenCL/address-spaces-conversions-cl2.0.cl
@@ -42,7 +42,7 @@
#if !__OPENCL_CPP_VERSION__
// expected-note@-3{{passing argument to parameter 'arg_glob' here}}
#else
-// expected-note-re@-5{{candidate function not viable: address space mismatch in 1st argument ('__{{generic|constant}} int *'), parameter type must be '__global int *'}}
+// expected-note-re@-5{{candidate function not viable: cannot pass pointer to address space '__{{generic|constant}}' as a pointer to address space '__global' in 1st argument}}
#endif
#endif
@@ -50,7 +50,7 @@
#if !__OPENCL_CPP_VERSION__
// expected-note@-2{{passing argument to parameter 'arg_loc' here}}
#else
-// expected-note-re@-4{{candidate function not viable: address space mismatch in 1st argument ('__{{global|generic|constant}} int *'), parameter type must be '__local int *'}}
+// expected-note-re@-4{{candidate function not viable: cannot pass pointer to address space '__{{global|generic|constant}}' as a pointer to address space '__local' in 1st argument}}
#endif
void f_const(__constant int *arg_const) {}
@@ -58,7 +58,7 @@
#if !__OPENCL_CPP_VERSION__
// expected-note@-3{{passing argument to parameter 'arg_const' here}}
#else
-// expected-note-re@-5{{candidate function not viable: address space mismatch in 1st argument ('__{{global|generic}} int *'), parameter type must be '__constant int *'}}
+// expected-note-re@-5{{candidate function not viable: cannot pass pointer to address space '__{{global|generic}}' as a pointer to address space '__constant' in 1st argument}}
#endif
#endif
@@ -66,7 +66,7 @@
#if !__OPENCL_CPP_VERSION__
// expected-note@-2{{passing argument to parameter 'arg_priv' here}}
#else
-// expected-note-re@-4{{candidate function not viable: address space mismatch in 1st argument ('__{{global|generic|constant}} int *'), parameter type must be 'int *'}}
+// expected-note-re@-4{{candidate function not viable: cannot pass pointer to address space '__{{global|generic|constant}}' as a pointer to address space '__private' in 1st argument}}
#endif
void f_gen(__generic int *arg_gen) {}
@@ -74,7 +74,7 @@
#if !__OPENCL_CPP_VERSION__
// expected-note@-3{{passing argument to parameter 'arg_gen' here}}
#else
-// expected-note@-5{{candidate function not viable: address space mismatch in 1st argument ('__constant int *'), parameter type must be '__generic int *'}}
+// expected-note@-5{{candidate function not viable: cannot pass pointer to address space '__constant' as a pointer to address space '__generic' in 1st argument}}
#endif
#endif
@@ -85,45 +85,45 @@
AS int *var_init1 = arg_glob;
#ifdef CONSTANT
#if !__OPENCL_CPP_VERSION__
-// expected-error@-3{{initializing '__constant int *' with an expression of type '__global int *' changes address space of pointer}}
+// expected-error@-3{{initializing '__constant int *__private' with an expression of type '__global int *__private' changes address space of pointer}}
#else
-// expected-error@-5{{cannot initialize a variable of type '__constant int *' with an lvalue of type '__global int *'}}
+// expected-error@-5{{cannot initialize a variable of type '__constant int *__private' with an lvalue of type '__global int *__private'}}
#endif
#endif
AS int *var_init2 = arg_loc;
#ifndef GENERIC
#if !__OPENCL_CPP_VERSION__
-// expected-error-re@-3{{initializing '__{{global|constant}} int *' with an expression of type '__local int *' changes address space of pointer}}
+// expected-error-re@-3{{initializing '__{{global|constant}} int *__private' with an expression of type '__local int *__private' changes address space of pointer}}
#else
-// expected-error-re@-5{{cannot initialize a variable of type '__{{global|constant}} int *' with an lvalue of type '__local int *'}}
+// expected-error-re@-5{{cannot initialize a variable of type '__{{global|constant}} int *__private' with an lvalue of type '__local int *__private'}}
#endif
#endif
AS int *var_init3 = arg_const;
#ifndef CONSTANT
#if !__OPENCL_CPP_VERSION__
-// expected-error-re@-3{{initializing '__{{global|generic}} int *' with an expression of type '__constant int *' changes address space of pointer}}
+// expected-error-re@-3{{initializing '__{{global|generic}} int *__private' with an expression of type '__constant int *__private' changes address space of pointer}}
#else
-// expected-error-re@-5{{cannot initialize a variable of type '__{{global|generic}} int *' with an lvalue of type '__constant int *'}}
+// expected-error-re@-5{{cannot initialize a variable of type '__{{global|generic}} int *__private' with an lvalue of type '__constant int *__private'}}
#endif
#endif
AS int *var_init4 = arg_priv;
#ifndef GENERIC
#if !__OPENCL_CPP_VERSION__
-// expected-error-re@-3{{initializing '__{{global|constant}} int *' with an expression of type 'int *' changes address space of pointer}}
+// expected-error-re@-3{{initializing '__{{global|constant}} int *__private' with an expression of type '__private int *__private' changes address space of pointer}}
#else
-// expected-error-re@-5{{cannot initialize a variable of type '__{{global|constant}} int *' with an lvalue of type 'int *'}}
+// expected-error-re@-5{{cannot initialize a variable of type '__{{global|constant}} int *__private' with an lvalue of type '__private int *__private'}}
#endif
#endif
AS int *var_init5 = arg_gen;
#ifndef GENERIC
#if !__OPENCL_CPP_VERSION__
-// expected-error-re@-3{{initializing '__{{global|constant}} int *' with an expression of type '__generic int *' changes address space of pointer}}
+// expected-error-re@-3{{initializing '__{{global|constant}} int *__private' with an expression of type '__generic int *__private' changes address space of pointer}}
#else
-// expected-error-re@-5{{cannot initialize a variable of type '__{{global|constant}} int *' with an lvalue of type '__generic int *'}}
+// expected-error-re@-5{{cannot initialize a variable of type '__{{global|constant}} int *__private' with an lvalue of type '__generic int *__private'}}
#endif
#endif
@@ -157,9 +157,9 @@
AS int *var_cast4 = (AS int *)arg_priv;
#ifndef GENERIC
#if !__OPENCL_CPP_VERSION__
-// expected-error-re@-3{{casting 'int *' to type '__{{global|constant}} int *' changes address space of pointer}}
+// expected-error-re@-3{{casting '__private int *' to type '__{{global|constant}} int *' changes address space of pointer}}
#else
-// expected-error-re@-5{{C-style cast from 'int *' to '__{{global|constant}} int *' converts between mismatching address spaces}}
+// expected-error-re@-5{{C-style cast from '__private int *' to '__{{global|constant}} int *' converts between mismatching address spaces}}
#endif
#endif
@@ -176,45 +176,45 @@
var_impl = arg_glob;
#ifdef CONSTANT
#if !__OPENCL_CPP_VERSION__
-// expected-error@-3{{assigning '__global int *' to '__constant int *' changes address space of pointer}}
+// expected-error@-3{{assigning '__global int *__private' to '__constant int *__private' changes address space of pointer}}
#else
-// expected-error@-5{{assigning to '__constant int *' from incompatible type '__global int *'}}
+// expected-error@-5{{assigning to '__constant int *' from incompatible type '__global int *__private'}}
#endif
#endif
var_impl = arg_loc;
#ifndef GENERIC
#if !__OPENCL_CPP_VERSION__
-// expected-error-re@-3{{assigning '__local int *' to '__{{global|constant}} int *' changes address space of pointer}}
+// expected-error-re@-3{{assigning '__local int *__private' to '__{{global|constant}} int *__private' changes address space of pointer}}
#else
-// expected-error-re@-5{{assigning to '__{{global|constant}} int *' from incompatible type '__local int *'}}
+// expected-error-re@-5{{assigning to '__{{global|constant}} int *' from incompatible type '__local int *__private'}}
#endif
#endif
var_impl = arg_const;
#ifndef CONSTANT
#if !__OPENCL_CPP_VERSION__
-// expected-error-re@-3{{assigning '__constant int *' to '__{{global|generic}} int *' changes address space of pointer}}
+// expected-error-re@-3{{assigning '__constant int *__private' to '__{{global|generic}} int *__private' changes address space of pointer}}
#else
-// expected-error-re@-5{{assigning to '__{{global|generic}} int *' from incompatible type '__constant int *'}}
+// expected-error-re@-5{{assigning to '__{{global|generic}} int *' from incompatible type '__constant int *__private'}}
#endif
#endif
var_impl = arg_priv;
#ifndef GENERIC
#if !__OPENCL_CPP_VERSION__
-// expected-error-re@-3{{assigning 'int *' to '__{{global|constant}} int *' changes address space of pointer}}
+// expected-error-re@-3{{assigning '__private int *__private' to '__{{global|constant}} int *__private' changes address space of pointer}}
#else
-// expected-error-re@-5{{assigning to '__{{global|constant}} int *' from incompatible type 'int *'}}
+// expected-error-re@-5{{assigning to '__{{global|constant}} int *' from incompatible type '__private int *__private'}}
#endif
#endif
var_impl = arg_gen;
#ifndef GENERIC
#if !__OPENCL_CPP_VERSION__
-// expected-error-re@-3{{assigning '__generic int *' to '__{{global|constant}} int *' changes address space of pointer}}
+// expected-error-re@-3{{assigning '__generic int *__private' to '__{{global|constant}} int *__private' changes address space of pointer}}
#else
-// expected-error-re@-5{{assigning to '__{{global|constant}} int *' from incompatible type '__generic int *'}}
+// expected-error-re@-5{{assigning to '__{{global|constant}} int *' from incompatible type '__generic int *__private'}}
#endif
#endif
@@ -248,9 +248,9 @@
var_cast4 = (AS int *)arg_priv;
#ifndef GENERIC
#if !__OPENCL_CPP_VERSION__
-// expected-error-re@-3{{casting 'int *' to type '__{{global|constant}} int *' changes address space of pointer}}
+// expected-error-re@-3{{casting '__private int *' to type '__{{global|constant}} int *' changes address space of pointer}}
#else
-// expected-error-re@-5{{C-style cast from 'int *' to '__{{global|constant}} int *' converts between mismatching address spaces}}
+// expected-error-re@-5{{C-style cast from '__private int *' to '__{{global|constant}} int *' converts between mismatching address spaces}}
#endif
#endif
@@ -294,9 +294,9 @@
b = var_cmp <= arg_priv;
#ifndef GENERIC
#if !__OPENCL_CPP_VERSION__
-// expected-error-re@-3{{comparison between ('__{{global|constant}} int *' and 'int *') which are pointers to non-overlapping address spaces}}
+// expected-error-re@-3{{comparison between ('__{{global|constant}} int *' and '__private int *') which are pointers to non-overlapping address spaces}}
#else
-// expected-error-re@-5{{comparison of distinct pointer types ('__{{global|constant}} int *' and 'int *')}}
+// expected-error-re@-5{{comparison of distinct pointer types ('__{{global|constant}} int *' and '__private int *')}}
#endif
#endif
@@ -327,7 +327,7 @@
b = var_sub - arg_priv;
#ifndef GENERIC
-// expected-error-re@-2{{arithmetic operation with operands of type ('__{{global|constant}} int *' and 'int *') which are pointers to non-overlapping address spaces}}
+// expected-error-re@-2{{arithmetic operation with operands of type ('__{{global|constant}} int *' and '__private int *') which are pointers to non-overlapping address spaces}}
#endif
b = var_sub - arg_gen;
@@ -338,7 +338,7 @@
f_glob(var_sub);
#ifndef GLOBAL
#if !__OPENCL_CPP_VERSION__
-// expected-error-re@-3{{passing '__{{constant|generic}} int *' to parameter of type '__global int *' changes address space of pointer}}
+// expected-error-re@-3{{passing '__{{constant|generic}} int *__private' to parameter of type '__global int *' changes address space of pointer}}
#else
// expected-error@-5{{no matching function for call to 'f_glob'}}
#endif
@@ -346,7 +346,7 @@
f_loc(var_sub);
#if !__OPENCL_CPP_VERSION__
-// expected-error-re@-2{{passing '__{{global|constant|generic}} int *' to parameter of type '__local int *' changes address space of pointer}}
+// expected-error-re@-2{{passing '__{{global|constant|generic}} int *__private' to parameter of type '__local int *' changes address space of pointer}}
#else
// expected-error@-4{{no matching function for call to 'f_loc'}}
#endif
@@ -354,7 +354,7 @@
f_const(var_sub);
#ifndef CONSTANT
#if !__OPENCL_CPP_VERSION__
-// expected-error-re@-3{{passing '__{{global|generic}} int *' to parameter of type '__constant int *' changes address space of pointer}}
+// expected-error-re@-3{{passing '__{{global|generic}} int *__private' to parameter of type '__constant int *' changes address space of pointer}}
#else
// expected-error@-5{{no matching function for call to 'f_const'}}
#endif
@@ -362,7 +362,7 @@
f_priv(var_sub);
#if !__OPENCL_CPP_VERSION__
-// expected-error-re@-2{{passing '__{{global|constant|generic}} int *' to parameter of type 'int *' changes address space of pointer}}
+// expected-error-re@-2{{passing '__{{global|constant|generic}} int *__private' to parameter of type '__private int *' changes address space of pointer}}
#else
// expected-error@-4{{no matching function for call to 'f_priv'}}
#endif
@@ -370,7 +370,7 @@
f_gen(var_sub);
#ifdef CONSTANT
#if !__OPENCL_CPP_VERSION__
-// expected-error@-3{{passing '__constant int *' to parameter of type '__generic int *' changes address space of pointer}}
+// expected-error@-3{{passing '__constant int *__private' to parameter of type '__generic int *' changes address space of pointer}}
#else
// expected-error@-5{{no matching function for call to 'f_gen'}}
#endif
@@ -414,9 +414,9 @@
var_gen = 0 ? var_cond : var_priv;
#ifndef GENERIC
#if !__OPENCL_CPP_VERSION__
-// expected-error-re@-3{{conditional operator with the second and third operands of type ('__{{global|constant}} int *' and 'int *') which are pointers to non-overlapping address spaces}}
+// expected-error-re@-3{{conditional operator with the second and third operands of type ('__{{global|constant}} int *' and '__private int *') which are pointers to non-overlapping address spaces}}
#else
-// expected-error-re@-5{{incompatible operand types ('__{{global|constant}} int *' and 'int *')}}
+// expected-error-re@-5{{incompatible operand types ('__{{global|constant}} int *' and '__private int *')}}
#endif
#endif
@@ -470,12 +470,12 @@
__private char *var_priv_ch;
var_void_gen = 0 ? var_cond : var_priv_ch;
#if __OPENCL_CPP_VERSION__
-// expected-error-re@-2{{incompatible operand types ('__{{constant|global|generic}} int *' and 'char *')}}
+// expected-error-re@-2{{incompatible operand types ('__{{constant|global|generic}} int *' and '__private char *')}}
#else
#ifndef GENERIC
-// expected-error-re@-5{{conditional operator with the second and third operands of type ('__{{global|constant}} int *' and 'char *') which are pointers to non-overlapping address spaces}}
+// expected-error-re@-5{{conditional operator with the second and third operands of type ('__{{global|constant}} int *' and '__private char *') which are pointers to non-overlapping address spaces}}
#else
-// expected-warning@-7{{pointer type mismatch ('__generic int *' and 'char *')}}
+// expected-warning@-7{{pointer type mismatch ('__generic int *' and '__private char *')}}
#endif
#endif
@@ -501,12 +501,9 @@
// Case 1:
// * address spaces of corresponded most outer pointees overlaps, their canonical types are equal
// * CVR, address spaces and canonical types of the rest of pointees are equivalent.
+ var_as_as_int = var_asc_as_int;
var_as_as_int = 0 ? var_as_as_int : var_asc_as_int;
-#if __OPENCL_CPP_VERSION__
-#ifdef GENERIC
-// expected-error@-3{{incompatible operand types ('__generic int *__generic *' and '__generic int *__local *')}}
-#endif
-#endif
+
// Case 2: Corresponded inner pointees has non-overlapping address spaces.
var_as_as_int = 0 ? var_as_as_int : var_asc_asn_int;
#if !__OPENCL_CPP_VERSION__
@@ -516,12 +513,37 @@
#endif
// Case 3: Corresponded inner pointees has overlapping but not equivalent address spaces.
+ var_as_as_int = var_asc_asc_int;
#ifdef GENERIC
- var_as_as_int = 0 ? var_as_as_int : var_asc_asc_int;
#if !__OPENCL_CPP_VERSION__
-// expected-warning-re@-2{{pointer type mismatch ('__{{(generic|global|constant)}} int *__{{(generic|global|constant)}} *' and '__{{(local|global|constant)}} int *__{{(local|global|constant)}} *')}}
+// expected-error@-3 {{assigning '__local int *__local *__private' to '__generic int *__generic *__private' changes address space of nested pointer}}
#else
-// expected-error-re@-4{{incompatible operand types ('__{{generic|global|constant}} int *__{{generic|global|constant}} *' and '__{{local|global|constant}} int *__{{local|global|constant}} *')}}
+// expected-error@-5 {{assigning to '__generic int *__generic *' from incompatible type '__local int *__local *__private'}}
+#endif
+#endif
+
+ var_as_as_int = (AS int *AS *)var_asc_asc_int;
+#ifdef GENERIC
+#if !__OPENCL_CPP_VERSION__
+// expected-warning@-3 {{casting '__local int *__local *' to type '__generic int *__generic *' discards qualifiers in nested pointer types}}
+#else
+// expected-warning@-5 {{C-style cast from '__local int *__local *' to '__generic int *__generic *' changes address space of nested pointers}}
+#endif
+#endif
+
+ var_as_as_int = (AS int *AS *)var_asc_asn_int;
+#if !__OPENCL_CPP_VERSION__
+// expected-warning-re@-2 {{casting '__{{global|local|constant}} int *__{{local|constant|global}} *' to type '__{{global|constant|generic}} int *__{{global|constant|generic}} *' discards qualifiers in nested pointer types}}
+#else
+// expected-warning-re@-4 {{C-style cast from '__{{global|local|constant}} int *__{{local|constant|global}} *' to '__{{global|constant|generic}} int *__{{global|constant|generic}} *' changes address space of nested pointers}}
+#endif
+
+ var_as_as_int = 0 ? var_as_as_int : var_asc_asc_int;
+#ifdef GENERIC
+#if !__OPENCL_CPP_VERSION__
+// expected-warning@-3{{pointer type mismatch ('__generic int *__generic *' and '__local int *__local *')}}
+#else
+// expected-error@-5 {{incompatible operand types ('__generic int *__generic *' and '__local int *__local *')}}
#endif
#endif
}
diff --git a/src/llvm-project/clang/test/SemaOpenCL/address-spaces.cl b/src/llvm-project/clang/test/SemaOpenCL/address-spaces.cl
index 55a55dc..07547ea 100644
--- a/src/llvm-project/clang/test/SemaOpenCL/address-spaces.cl
+++ b/src/llvm-project/clang/test/SemaOpenCL/address-spaces.cl
@@ -10,15 +10,15 @@
int *ip;
#if ((!__OPENCL_CPP_VERSION__) && (__OPENCL_C_VERSION__ < 200))
- ip = gip; // expected-error {{assigning '__global int *' to 'int *' changes address space of pointer}}
- ip = &li; // expected-error {{assigning '__local int *' to 'int *' changes address space of pointer}}
- ip = &ci; // expected-error {{assigning '__constant int *' to 'int *' changes address space of pointer}}
+ ip = gip; // expected-error {{assigning '__global int *__private' to '__private int *__private' changes address space of pointer}}
+ ip = &li; // expected-error {{assigning '__local int *' to '__private int *__private' changes address space of pointer}}
+ ip = &ci; // expected-error {{assigning '__constant int *' to '__private int *__private' changes address space of pointer}}
#else
ip = gip;
ip = &li;
ip = &ci;
#if !__OPENCL_CPP_VERSION__
-// expected-error@-2 {{assigning '__constant int *' to '__generic int *' changes address space of pointer}}
+// expected-error@-2 {{assigning '__constant int *' to '__generic int *__private' changes address space of pointer}}
#else
// expected-error@-4 {{assigning to '__generic int *' from incompatible type '__constant int *'}}
#endif
@@ -46,9 +46,9 @@
#endif
g = (__global int *)p;
#if !__OPENCL_CPP_VERSION__
-// expected-error@-2 {{casting 'int *' to type '__global int *' changes address space of pointer}}
+// expected-error@-2 {{casting '__private int *' to type '__global int *' changes address space of pointer}}
#else
-// expected-error@-4 {{C-style cast from 'int *' to '__global int *' converts between mismatching address spaces}}
+// expected-error@-4 {{C-style cast from '__private int *' to '__global int *' converts between mismatching address spaces}}
#endif
l = (__local int *)g;
#if !__OPENCL_CPP_VERSION__
@@ -70,9 +70,9 @@
#endif
l = (__local int *)p;
#if !__OPENCL_CPP_VERSION__
-// expected-error@-2 {{casting 'int *' to type '__local int *' changes address space of pointer}}
+// expected-error@-2 {{casting '__private int *' to type '__local int *' changes address space of pointer}}
#else
-// expected-error@-4 {{C-style cast from 'int *' to '__local int *' converts between mismatching address spaces}}
+// expected-error@-4 {{C-style cast from '__private int *' to '__local int *' converts between mismatching address spaces}}
#endif
c = (__constant int *)g;
#if !__OPENCL_CPP_VERSION__
@@ -88,33 +88,33 @@
#endif
c = (__constant int *)p;
#if !__OPENCL_CPP_VERSION__
-// expected-error@-2 {{casting 'int *' to type '__constant int *' changes address space of pointer}}
+// expected-error@-2 {{casting '__private int *' to type '__constant int *' changes address space of pointer}}
#else
-// expected-error@-4 {{C-style cast from 'int *' to '__constant int *' converts between mismatching address spaces}}
+// expected-error@-4 {{C-style cast from '__private int *' to '__constant int *' converts between mismatching address spaces}}
#endif
p = (__private int *)g;
#if !__OPENCL_CPP_VERSION__
-// expected-error@-2 {{casting '__global int *' to type 'int *' changes address space of pointer}}
+// expected-error@-2 {{casting '__global int *' to type '__private int *' changes address space of pointer}}
#else
-// expected-error@-4 {{C-style cast from '__global int *' to 'int *' converts between mismatching address spaces}}
+// expected-error@-4 {{C-style cast from '__global int *' to '__private int *' converts between mismatching address spaces}}
#endif
p = (__private int *)l;
#if !__OPENCL_CPP_VERSION__
-// expected-error@-2 {{casting '__local int *' to type 'int *' changes address space of pointer}}
+// expected-error@-2 {{casting '__local int *' to type '__private int *' changes address space of pointer}}
#else
-// expected-error@-4 {{C-style cast from '__local int *' to 'int *' converts between mismatching address spaces}}
+// expected-error@-4 {{C-style cast from '__local int *' to '__private int *' converts between mismatching address spaces}}
#endif
p = (__private int *)c;
#if !__OPENCL_CPP_VERSION__
-// expected-error@-2 {{casting '__constant int *' to type 'int *' changes address space of pointer}}
+// expected-error@-2 {{casting '__constant int *' to type '__private int *' changes address space of pointer}}
#else
-// expected-error@-4 {{C-style cast from '__constant int *' to 'int *' converts between mismatching address spaces}}
+// expected-error@-4 {{C-style cast from '__constant int *' to '__private int *' converts between mismatching address spaces}}
#endif
p = (__private int *)cc;
#if !__OPENCL_CPP_VERSION__
-// expected-error@-2 {{casting 'const __constant int *' to type 'int *' changes address space of pointer}}
+// expected-error@-2 {{casting 'const __constant int *' to type '__private int *' changes address space of pointer}}
#else
-// expected-error@-4 {{C-style cast from 'const __constant int *' to 'int *' converts between mismatching address spaces}}
+// expected-error@-4 {{C-style cast from 'const __constant int *' to '__private int *' converts between mismatching address spaces}}
#endif
}
@@ -126,98 +126,96 @@
#if !__OPENCL_CPP_VERSION__
void nested(__global int *g, __global int * __private *gg, __local int *l, __local int * __private *ll, __global float * __private *gg_f) {
- g = gg; // expected-error {{assigning '__global int **' to '__global int *' changes address space of pointer}}
- g = l; // expected-error {{assigning '__local int *' to '__global int *' changes address space of pointer}}
- g = ll; // expected-error {{assigning '__local int **' to '__global int *' changes address space of pointer}}
- g = gg_f; // expected-error {{assigning '__global float **' to '__global int *' changes address space of pointer}}
- g = (__global int *)gg_f; // expected-error {{casting '__global float **' to type '__global int *' changes address space of pointer}}
+ g = gg; // expected-error {{assigning '__global int *__private *__private' to '__global int *__private' changes address space of pointer}}
+ g = l; // expected-error {{assigning '__local int *__private' to '__global int *__private' changes address space of pointer}}
+ g = ll; // expected-error {{assigning '__local int *__private *__private' to '__global int *__private' changes address space of pointer}}
+ g = gg_f; // expected-error {{assigning '__global float *__private *__private' to '__global int *__private' changes address space of pointer}}
+ g = (__global int *)gg_f; // expected-error {{casting '__global float *__private *' to type '__global int *' changes address space of pointer}}
- gg = g; // expected-error {{assigning '__global int *' to '__global int **' changes address space of pointer}}
- gg = l; // expected-error {{assigning '__local int *' to '__global int **' changes address space of pointer}}
- gg = ll; // expected-error {{assigning '__local int **' to '__global int **' changes address space of nested pointer}}
- gg = gg_f; // expected-warning {{incompatible pointer types assigning to '__global int **' from '__global float **'}}
+ gg = g; // expected-error {{assigning '__global int *__private' to '__global int *__private *__private' changes address space of pointer}}
+ gg = l; // expected-error {{assigning '__local int *__private' to '__global int *__private *__private' changes address space of pointer}}
+ gg = ll; // expected-error {{assigning '__local int *__private *__private' to '__global int *__private *__private' changes address space of nested pointer}}
+ gg = gg_f; // expected-warning {{incompatible pointer types assigning to '__global int *__private *__private' from '__global float *__private *__private'}}
gg = (__global int * __private *)gg_f;
- l = g; // expected-error {{assigning '__global int *' to '__local int *' changes address space of pointer}}
- l = gg; // expected-error {{assigning '__global int **' to '__local int *' changes address space of pointer}}
- l = ll; // expected-error {{assigning '__local int **' to '__local int *' changes address space of pointer}}
- l = gg_f; // expected-error {{assigning '__global float **' to '__local int *' changes address space of pointer}}
- l = (__local int *)gg_f; // expected-error {{casting '__global float **' to type '__local int *' changes address space of pointer}}
+ l = g; // expected-error {{assigning '__global int *__private' to '__local int *__private' changes address space of pointer}}
+ l = gg; // expected-error {{assigning '__global int *__private *__private' to '__local int *__private' changes address space of pointer}}
+ l = ll; // expected-error {{assigning '__local int *__private *__private' to '__local int *__private' changes address space of pointer}}
+ l = gg_f; // expected-error {{assigning '__global float *__private *__private' to '__local int *__private' changes address space of pointer}}
+ l = (__local int *)gg_f; // expected-error {{casting '__global float *__private *' to type '__local int *' changes address space of pointer}}
- ll = g; // expected-error {{assigning '__global int *' to '__local int **' changes address space of pointer}}
- ll = gg; // expected-error {{assigning '__global int **' to '__local int **' changes address space of nested pointer}}
- ll = l; // expected-error {{assigning '__local int *' to '__local int **' changes address space of pointer}}
- ll = gg_f; // expected-error {{assigning '__global float **' to '__local int **' changes address space of nested pointer}}
- ll = (__local int * __private *)gg_f; // expected-warning {{casting '__global float **' to type '__local int **' discards qualifiers in nested pointer types}}
+ ll = g; // expected-error {{assigning '__global int *__private' to '__local int *__private *__private' changes address space of pointer}}
+ ll = gg; // expected-error {{assigning '__global int *__private *__private' to '__local int *__private *__private' changes address space of nested pointer}}
+ ll = l; // expected-error {{assigning '__local int *__private' to '__local int *__private *__private' changes address space of pointer}}
+ ll = gg_f; // expected-error {{assigning '__global float *__private *__private' to '__local int *__private *__private' changes address space of nested pointer}}
+ ll = (__local int * __private *)gg_f; // expected-warning {{casting '__global float *__private *' to type '__local int *__private *' discards qualifiers in nested pointer types}}
- gg_f = g; // expected-error {{assigning '__global int *' to '__global float **' changes address space of pointer}}
- gg_f = gg; // expected-warning {{incompatible pointer types assigning to '__global float **' from '__global int **'}}
- gg_f = l; // expected-error {{assigning '__local int *' to '__global float **' changes address space of pointer}}
- gg_f = ll; // expected-error {{assigning '__local int **' to '__global float **' changes address space of nested pointer}}
+ gg_f = g; // expected-error {{assigning '__global int *__private' to '__global float *__private *__private' changes address space of pointer}}
+ gg_f = gg; // expected-warning {{incompatible pointer types assigning to '__global float *__private *__private' from '__global int *__private *__private'}}
+ gg_f = l; // expected-error {{assigning '__local int *__private' to '__global float *__private *__private' changes address space of pointer}}
+ gg_f = ll; // expected-error {{assigning '__local int *__private *__private' to '__global float *__private *__private' changes address space of nested pointer}}
gg_f = (__global float * __private *)gg;
// FIXME: This doesn't seem right. This should be an error, not a warning.
__local int * __global * __private * lll;
- lll = gg; // expected-warning {{incompatible pointer types assigning to '__local int *__global **' from '__global int **'}}
+ lll = gg; // expected-warning {{incompatible pointer types assigning to '__local int *__global *__private *__private' from '__global int *__private *__private'}}
typedef __local int * l_t;
typedef __global int * g_t;
__private l_t * pl;
__private g_t * pg;
- gg = pl; // expected-error {{assigning 'l_t *' (aka '__local int **') to '__global int **' changes address space of nested pointer}}
- pl = gg; // expected-error {{assigning '__global int **' to 'l_t *' (aka '__local int **') changes address space of nested pointer}}
+ gg = pl; // expected-error {{assigning '__private l_t *__private' (aka '__local int *__private *__private') to '__global int *__private *__private' changes address space of nested pointer}}
+ pl = gg; // expected-error {{assigning '__global int *__private *__private' to '__private l_t *__private' (aka '__local int *__private *__private') changes address space of nested pointer}}
gg = pg;
pg = gg;
- pg = pl; // expected-error {{assigning 'l_t *' (aka '__local int **') to 'g_t *' (aka '__global int **') changes address space of nested pointer}}
- pl = pg; // expected-error {{assigning 'g_t *' (aka '__global int **') to 'l_t *' (aka '__local int **') changes address space of nested pointer}}
+ pg = pl; // expected-error {{assigning '__private l_t *__private' (aka '__local int *__private *__private') to '__private g_t *__private' (aka '__global int *__private *__private') changes address space of nested pointer}}
+ pl = pg; // expected-error {{assigning '__private g_t *__private' (aka '__global int *__private *__private') to '__private l_t *__private' (aka '__local int *__private *__private') changes address space of nested pointer}}
ll = (__local int * __private *)(void *)gg;
void *vp = ll;
}
#else
void nested(__global int *g, __global int * __private *gg, __local int *l, __local int * __private *ll, __global float * __private *gg_f) {
- g = gg; // expected-error {{assigning to '__global int *' from incompatible type '__global int **'}}
- g = l; // expected-error {{assigning to '__global int *' from incompatible type '__local int *'}}
- g = ll; // expected-error {{assigning to '__global int *' from incompatible type '__local int **'}}
- g = gg_f; // expected-error {{assigning to '__global int *' from incompatible type '__global float **'}}
- g = (__global int *)gg_f; // expected-error {{C-style cast from '__global float **' to '__global int *' converts between mismatching address spaces}}
+ g = gg; // expected-error {{assigning to '__global int *' from incompatible type '__global int *__private *__private'}}
+ g = l; // expected-error {{assigning to '__global int *' from incompatible type '__local int *__private'}}
+ g = ll; // expected-error {{assigning to '__global int *' from incompatible type '__local int *__private *__private'}}
+ g = gg_f; // expected-error {{assigning to '__global int *' from incompatible type '__global float *__private *__private'}}
+ g = (__global int *)gg_f; // expected-error {{C-style cast from '__global float *__private *' to '__global int *' converts between mismatching address spaces}}
- gg = g; // expected-error {{assigning to '__global int **' from incompatible type '__global int *'; take the address with &}}
- gg = l; // expected-error {{assigning to '__global int **' from incompatible type '__local int *'}}
- gg = ll; // expected-error {{assigning to '__global int **' from incompatible type '__local int **'}}
- gg = gg_f; // expected-error {{assigning to '__global int **' from incompatible type '__global float **'}}
+ gg = g; // expected-error {{assigning to '__global int *__private *' from incompatible type '__global int *__private'; take the address with &}}
+ gg = l; // expected-error {{assigning to '__global int *__private *' from incompatible type '__local int *__private'}}
+ gg = ll; // expected-error {{assigning to '__global int *__private *' from incompatible type '__local int *__private *__private'}}
+ gg = gg_f; // expected-error {{assigning to '__global int *__private *' from incompatible type '__global float *__private *__private'}}
gg = (__global int * __private *)gg_f;
- l = g; // expected-error {{assigning to '__local int *' from incompatible type '__global int *'}}
- l = gg; // expected-error {{assigning to '__local int *' from incompatible type '__global int **'}}
- l = ll; // expected-error {{assigning to '__local int *' from incompatible type '__local int **'}}
- l = gg_f; // expected-error {{assigning to '__local int *' from incompatible type '__global float **'}}
- l = (__local int *)gg_f; // expected-error {{C-style cast from '__global float **' to '__local int *' converts between mismatching address spaces}}
+ l = g; // expected-error {{assigning to '__local int *' from incompatible type '__global int *__private'}}
+ l = gg; // expected-error {{assigning to '__local int *' from incompatible type '__global int *__private *__private'}}
+ l = ll; // expected-error {{assigning to '__local int *' from incompatible type '__local int *__private *__private'}}
+ l = gg_f; // expected-error {{assigning to '__local int *' from incompatible type '__global float *__private *__private'}}
+ l = (__local int *)gg_f; // expected-error {{C-style cast from '__global float *__private *' to '__local int *' converts between mismatching address spaces}}
- ll = g; // expected-error {{assigning to '__local int **' from incompatible type '__global int *'}}
- ll = gg; // expected-error {{assigning to '__local int **' from incompatible type '__global int **'}}
- ll = l; // expected-error {{assigning to '__local int **' from incompatible type '__local int *'; take the address with &}}
- ll = gg_f; // expected-error {{assigning to '__local int **' from incompatible type '__global float **'}}
- // FIXME: The below becomes a reinterpret_cast, and therefore does not emit an error
- // even though the address space mismatches in the nested pointers.
- ll = (__local int * __private *)gg;
+ ll = g; // expected-error {{assigning to '__local int *__private *' from incompatible type '__global int *__private'}}
+ ll = gg; // expected-error {{assigning to '__local int *__private *' from incompatible type '__global int *__private *__private'}}
+ ll = l; // expected-error {{assigning to '__local int *__private *' from incompatible type '__local int *__private'; take the address with &}}
+ ll = gg_f; // expected-error {{assigning to '__local int *__private *' from incompatible type '__global float *__private *__private'}}
+ ll = (__local int *__private *)gg; //expected-warning{{C-style cast from '__global int *__private *' to '__local int *__private *' changes address space of nested pointers}}
- gg_f = g; // expected-error {{assigning to '__global float **' from incompatible type '__global int *'}}
- gg_f = gg; // expected-error {{assigning to '__global float **' from incompatible type '__global int **'}}
- gg_f = l; // expected-error {{assigning to '__global float **' from incompatible type '__local int *'}}
- gg_f = ll; // expected-error {{assigning to '__global float **' from incompatible type '__local int **'}}
+ gg_f = g; // expected-error {{assigning to '__global float *__private *' from incompatible type '__global int *__private'}}
+ gg_f = gg; // expected-error {{assigning to '__global float *__private *' from incompatible type '__global int *__private *__private'}}
+ gg_f = l; // expected-error {{assigning to '__global float *__private *' from incompatible type '__local int *__private'}}
+ gg_f = ll; // expected-error {{assigning to '__global float *__private *' from incompatible type '__local int *__private *__private'}}
gg_f = (__global float * __private *)gg;
typedef __local int * l_t;
typedef __global int * g_t;
__private l_t * pl;
__private g_t * pg;
- gg = pl; // expected-error {{assigning to '__global int **' from incompatible type 'l_t *' (aka '__local int **')}}
- pl = gg; // expected-error {{assigning to 'l_t *' (aka '__local int **') from incompatible type '__global int **'}}
+ gg = pl; // expected-error {{assigning to '__global int *__private *' from incompatible type '__private l_t *__private' (aka '__local int *__private *__private')}}
+ pl = gg; // expected-error {{assigning to '__private l_t *' (aka '__local int *__private *') from incompatible type '__global int *__private *__private'}}
gg = pg;
pg = gg;
- pg = pl; // expected-error {{assigning to 'g_t *' (aka '__global int **') from incompatible type 'l_t *' (aka '__local int **')}}
- pl = pg; // expected-error {{assigning to 'l_t *' (aka '__local int **') from incompatible type 'g_t *' (aka '__global int **')}}
+ pg = pl; // expected-error {{assigning to '__private g_t *' (aka '__global int *__private *') from incompatible type '__private l_t *__private' (aka '__local int *__private *__private')}}
+ pl = pg; // expected-error {{assigning to '__private l_t *' (aka '__local int *__private *') from incompatible type '__private g_t *__private' (aka '__global int *__private *__private')}}
ll = (__local int * __private *)(void *)gg;
void *vp = ll;
@@ -241,3 +239,26 @@
__private private_int_t var5; // expected-warning {{multiple identical address spaces specified for type}}
__private private_int_t *var6;// expected-warning {{multiple identical address spaces specified for type}}
}
+
+void func_with_array_param(const unsigned data[16]);
+
+__kernel void k() {
+ unsigned data[16];
+ func_with_array_param(data);
+}
+
+void func_multiple_addr2(void) {
+ typedef __private int private_int_t;
+ __private __attribute__((opencl_global)) int var1; // expected-error {{multiple address spaces specified for type}}
+ __private __attribute__((opencl_global)) int *var2; // expected-error {{multiple address spaces specified for type}}
+ __attribute__((opencl_global)) private_int_t var3; // expected-error {{multiple address spaces specified for type}}
+ __attribute__((opencl_global)) private_int_t *var4; // expected-error {{multiple address spaces specified for type}}
+ __attribute__((opencl_private)) private_int_t var5; // expected-warning {{multiple identical address spaces specified for type}}
+ __attribute__((opencl_private)) private_int_t *var6; // expected-warning {{multiple identical address spaces specified for type}}
+#if __OPENCL_CPP_VERSION__
+ [[clang::opencl_private]] __global int var7; // expected-error {{multiple address spaces specified for type}}
+ [[clang::opencl_private]] __global int *var8; // expected-error {{multiple address spaces specified for type}}
+ [[clang::opencl_private]] private_int_t var9; // expected-warning {{multiple identical address spaces specified for type}}
+ [[clang::opencl_private]] private_int_t *var10; // expected-warning {{multiple identical address spaces specified for type}}
+#endif // !__OPENCL_CPP_VERSION__
+}
diff --git a/src/llvm-project/clang/test/SemaOpenCL/arithmetic-conversions.cl b/src/llvm-project/clang/test/SemaOpenCL/arithmetic-conversions.cl
index 23103ca..3d9f348 100644
--- a/src/llvm-project/clang/test/SemaOpenCL/arithmetic-conversions.cl
+++ b/src/llvm-project/clang/test/SemaOpenCL/arithmetic-conversions.cl
@@ -14,10 +14,10 @@
kernel void foo5(float2 in, global float2 *out) {
float* f;
- *out = f + in; // expected-error{{cannot convert between vector and non-scalar values ('float *' and 'float2' (vector of 2 'float' values))}}
+ *out = f + in; // expected-error{{cannot convert between vector and non-scalar values ('__private float *' and 'float2' (vector of 2 'float' values))}}
}
kernel void foo6(int2 in, global int2 *out) {
int* f;
- *out = f + in; // expected-error{{cannot convert between vector and non-scalar values ('int *' and 'int2' (vector of 2 'int' values))}}
+ *out = f + in; // expected-error{{cannot convert between vector and non-scalar values ('__private int *' and 'int2' (vector of 2 'int' values))}}
}
diff --git a/src/llvm-project/clang/test/SemaOpenCL/as_type.cl b/src/llvm-project/clang/test/SemaOpenCL/as_type.cl
index ad41809..e43ec7e 100644
--- a/src/llvm-project/clang/test/SemaOpenCL/as_type.cl
+++ b/src/llvm-project/clang/test/SemaOpenCL/as_type.cl
@@ -1,14 +1,14 @@
// RUN: %clang_cc1 %s -emit-llvm -triple spir-unknown-unknown -finclude-default-header -o - -verify -fsyntax-only
char3 f1(char16 x) {
- return __builtin_astype(x, char3); // expected-error{{invalid reinterpretation: sizes of 'char3' (vector of 3 'char' values) and 'char16' (vector of 16 'char' values) must match}}
+ return __builtin_astype(x, char3); // expected-error{{invalid reinterpretation: sizes of 'char3' (vector of 3 'char' values) and '__private char16' (vector of 16 'char' values) must match}}
}
char16 f3(int x) {
- return __builtin_astype(x, char16); // expected-error{{invalid reinterpretation: sizes of 'char16' (vector of 16 'char' values) and 'int' must match}}
+ return __builtin_astype(x, char16); // expected-error{{invalid reinterpretation: sizes of 'char16' (vector of 16 'char' values) and '__private int' must match}}
}
void foo() {
char src = 1;
- int dst = as_int(src); // expected-error{{invalid reinterpretation: sizes of 'int' and 'char' must match}}
+ int dst = as_int(src); // expected-error{{invalid reinterpretation: sizes of 'int' and '__private char' must match}}
}
diff --git a/src/llvm-project/clang/test/SemaOpenCL/atomic-ops.cl b/src/llvm-project/clang/test/SemaOpenCL/atomic-ops.cl
index 540520d..5a8c6fc 100644
--- a/src/llvm-project/clang/test/SemaOpenCL/atomic-ops.cl
+++ b/src/llvm-project/clang/test/SemaOpenCL/atomic-ops.cl
@@ -73,22 +73,22 @@
__opencl_atomic_fetch_add(d, 1, memory_order_seq_cst, memory_scope_work_group); // expected-error {{address argument to atomic operation must be a pointer to atomic integer or pointer ('__generic atomic_float *' (aka '__generic _Atomic(float) *') invalid)}}
__opencl_atomic_fetch_and(i, 1, memory_order_seq_cst, memory_scope_work_group);
__opencl_atomic_fetch_and(p, 1, memory_order_seq_cst, memory_scope_work_group);
- __opencl_atomic_fetch_and(d, 1, memory_order_seq_cst, memory_scope_work_group); // expected-error {{address argument to bitwise atomic operation must be a pointer to atomic integer ('__generic atomic_float *' (aka '__generic _Atomic(float) *') invalid)}}
+ __opencl_atomic_fetch_and(d, 1, memory_order_seq_cst, memory_scope_work_group); // expected-error {{address argument to atomic operation must be a pointer to atomic integer ('__generic atomic_float *' (aka '__generic _Atomic(float) *') invalid)}}
__opencl_atomic_fetch_min(i, 1, memory_order_seq_cst, memory_scope_work_group);
__opencl_atomic_fetch_max(i, 1, memory_order_seq_cst, memory_scope_work_group);
- __opencl_atomic_fetch_min(d, 1, memory_order_seq_cst, memory_scope_work_group); // expected-error {{address argument to atomic operation must be a pointer to atomic integer or pointer ('__generic atomic_float *' (aka '__generic _Atomic(float) *') invalid)}}
- __opencl_atomic_fetch_max(d, 1, memory_order_seq_cst, memory_scope_work_group); // expected-error {{address argument to atomic operation must be a pointer to atomic integer or pointer ('__generic atomic_float *' (aka '__generic _Atomic(float) *') invalid)}}
+ __opencl_atomic_fetch_min(d, 1, memory_order_seq_cst, memory_scope_work_group); // expected-error {{address argument to atomic operation must be a pointer to atomic integer ('__generic atomic_float *' (aka '__generic _Atomic(float) *') invalid)}}
+ __opencl_atomic_fetch_max(d, 1, memory_order_seq_cst, memory_scope_work_group); // expected-error {{address argument to atomic operation must be a pointer to atomic integer ('__generic atomic_float *' (aka '__generic _Atomic(float) *') invalid)}}
bool cmpexch_1 = __opencl_atomic_compare_exchange_strong(i, I, 1, memory_order_seq_cst, memory_order_seq_cst, memory_scope_work_group);
bool cmpexch_2 = __opencl_atomic_compare_exchange_strong(p, P, 1, memory_order_seq_cst, memory_order_seq_cst, memory_scope_work_group);
- bool cmpexch_3 = __opencl_atomic_compare_exchange_strong(d, I, 1, memory_order_seq_cst, memory_order_seq_cst, memory_scope_work_group); // expected-warning {{incompatible pointer types passing '__generic int *' to parameter of type '__generic float *'}}
- (void)__opencl_atomic_compare_exchange_strong(i, CI, 1, memory_order_seq_cst, memory_order_seq_cst, memory_scope_work_group); // expected-warning {{passing 'const __generic int *' to parameter of type '__generic int *' discards qualifiers}}
+ bool cmpexch_3 = __opencl_atomic_compare_exchange_strong(d, I, 1, memory_order_seq_cst, memory_order_seq_cst, memory_scope_work_group); // expected-warning {{incompatible pointer types passing '__generic int *__private' to parameter of type '__generic float *'}}
+ (void)__opencl_atomic_compare_exchange_strong(i, CI, 1, memory_order_seq_cst, memory_order_seq_cst, memory_scope_work_group); // expected-warning {{passing 'const __generic int *__private' to parameter of type '__generic int *' discards qualifiers}}
bool cmpexchw_1 = __opencl_atomic_compare_exchange_weak(i, I, 1, memory_order_seq_cst, memory_order_seq_cst, memory_scope_work_group);
bool cmpexchw_2 = __opencl_atomic_compare_exchange_weak(p, P, 1, memory_order_seq_cst, memory_order_seq_cst, memory_scope_work_group);
- bool cmpexchw_3 = __opencl_atomic_compare_exchange_weak(d, I, 1, memory_order_seq_cst, memory_order_seq_cst, memory_scope_work_group); // expected-warning {{incompatible pointer types passing '__generic int *' to parameter of type '__generic float *'}}
- (void)__opencl_atomic_compare_exchange_weak(i, CI, 1, memory_order_seq_cst, memory_order_seq_cst, memory_scope_work_group); // expected-warning {{passing 'const __generic int *' to parameter of type '__generic int *' discards qualifiers}}
+ bool cmpexchw_3 = __opencl_atomic_compare_exchange_weak(d, I, 1, memory_order_seq_cst, memory_order_seq_cst, memory_scope_work_group); // expected-warning {{incompatible pointer types passing '__generic int *__private' to parameter of type '__generic float *'}}
+ (void)__opencl_atomic_compare_exchange_weak(i, CI, 1, memory_order_seq_cst, memory_order_seq_cst, memory_scope_work_group); // expected-warning {{passing 'const __generic int *__private' to parameter of type '__generic int *' discards qualifiers}}
// Pointers to different address spaces are allowed.
bool cmpexch_10 = __opencl_atomic_compare_exchange_strong((global atomic_int *)0x308, (constant int *)0x309, 1, memory_order_seq_cst, memory_order_seq_cst, memory_scope_work_group);
@@ -107,7 +107,7 @@
float forder;
(void)__opencl_atomic_load(Ap, forder, memory_scope_work_group);
struct S s;
- (void)__opencl_atomic_load(Ap, s, memory_scope_work_group); // expected-error {{passing 'struct S' to parameter of incompatible type 'int'}}
+ (void)__opencl_atomic_load(Ap, s, memory_scope_work_group); // expected-error {{passing '__private struct S' to parameter of incompatible type 'int'}}
(void)__opencl_atomic_load(Ap, memory_order_relaxed, memory_scope_work_group);
(void)__opencl_atomic_load(Ap, memory_order_acquire, memory_scope_work_group);
@@ -187,7 +187,7 @@
(void)__opencl_atomic_load(Ap, memory_order_relaxed, 1.0f);
(void)__opencl_atomic_load(Ap, memory_order_relaxed, fscope);
struct S s;
- (void)__opencl_atomic_load(Ap, memory_order_relaxed, s); //expected-error{{passing 'struct S' to parameter of incompatible type 'int'}}
+ (void)__opencl_atomic_load(Ap, memory_order_relaxed, s); //expected-error{{passing '__private struct S' to parameter of incompatible type 'int'}}
}
void nullPointerWarning(atomic_int *Ap, int *p, int val) {
diff --git a/src/llvm-project/clang/test/SemaOpenCL/builtins-amdgcn-error-flat-address-space.cl b/src/llvm-project/clang/test/SemaOpenCL/builtins-amdgcn-error-flat-address-space.cl
new file mode 100644
index 0000000..0d759ba
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaOpenCL/builtins-amdgcn-error-flat-address-space.cl
@@ -0,0 +1,8 @@
+// REQUIRES: amdgpu-registered-target
+// RUN: %clang_cc1 -triple amdgcn-- -target-cpu tahiti -verify -S -o - %s
+
+void test_flat_address_space_builtins(int* ptr)
+{
+ (void)__builtin_amdgcn_is_shared(ptr); // expected-error {{'__builtin_amdgcn_is_shared' needs target feature flat-address-space}}
+ (void)__builtin_amdgcn_is_private(ptr); // expected-error {{'__builtin_amdgcn_is_private' needs target feature flat-address-space}}
+}
diff --git a/src/llvm-project/clang/test/SemaOpenCL/cl20-device-side-enqueue.cl b/src/llvm-project/clang/test/SemaOpenCL/cl20-device-side-enqueue.cl
index 8946911..f63e291 100644
--- a/src/llvm-project/clang/test/SemaOpenCL/cl20-device-side-enqueue.cl
+++ b/src/llvm-project/clang/test/SemaOpenCL/cl20-device-side-enqueue.cl
@@ -91,7 +91,7 @@
},
c, 1024L);
#ifdef WCONV
-// expected-warning-re@-2{{implicit conversion changes signedness: 'char' to 'unsigned {{int|long}}'}}
+// expected-warning-re@-2{{implicit conversion changes signedness: '__private char' to 'unsigned {{int|long}}'}}
#endif
#define UINT_MAX 4294967295
@@ -158,6 +158,8 @@
enqueue_kernel(default_queue, flags, ndrange, 1, &event_wait_list, &evt); // expected-error{{illegal call to enqueue_kernel, incorrect argument types}}
enqueue_kernel(default_queue, flags, ndrange, 1, 1); // expected-error{{illegal call to enqueue_kernel, incorrect argument types}}
+
+ enqueue_kernel(default_queue, ndrange, ^{}); // expected-error{{too few arguments to function call, expected at least 4, have 3}}
}
// Diagnostic tests for get_kernel_work_group_size and allowed block parameter types in dynamic parallelism.
diff --git a/src/llvm-project/clang/test/SemaOpenCL/clk_event_t.cl b/src/llvm-project/clang/test/SemaOpenCL/clk_event_t.cl
index e9736ea..2259359 100644
--- a/src/llvm-project/clang/test/SemaOpenCL/clk_event_t.cl
+++ b/src/llvm-project/clang/test/SemaOpenCL/clk_event_t.cl
@@ -2,7 +2,7 @@
// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=clc++
// Taken from opencl-c.h
-#define CLK_NULL_EVENT (__builtin_astype(((void*)(__SIZE_MAX__)), clk_event_t))
+#define CLK_NULL_EVENT (__builtin_astype(((__SIZE_MAX__)), clk_event_t))
global clk_event_t ce; // expected-error {{the '__global clk_event_t' type cannot be used to declare a program scope variable}}
@@ -10,8 +10,9 @@
event_t e;
clk_event_t ce1;
clk_event_t ce2;
+ clk_event_t ce3 = CLK_NULL_EVENT;
- if (e == ce1) { // expected-error {{invalid operands to binary expression ('event_t' and 'clk_event_t')}}
+ if (e == ce1) { // expected-error {{invalid operands to binary expression ('__private event_t' and '__private clk_event_t')}}
return 9;
}
diff --git a/src/llvm-project/clang/test/SemaOpenCL/event_t.cl b/src/llvm-project/clang/test/SemaOpenCL/event_t.cl
index e7daf88..80af401 100644
--- a/src/llvm-project/clang/test/SemaOpenCL/event_t.cl
+++ b/src/llvm-project/clang/test/SemaOpenCL/event_t.cl
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only
-event_t glb_evt; // expected-error {{the 'event_t' type cannot be used to declare a program scope variable}}
+event_t glb_evt; // expected-error {{the '__private event_t' type cannot be used to declare a program scope variable}} expected-error{{program scope variable must reside in constant address space}}
constant struct evt_s {
event_t evt; // expected-error {{the 'event_t' type cannot be used to declare a structure or union field}}
@@ -8,9 +8,9 @@
void foo(event_t evt); // expected-note {{passing argument to parameter 'evt' here}}
-void kernel ker(event_t argevt) { // expected-error {{'event_t' cannot be used as the type of a kernel parameter}}
+void kernel ker(event_t argevt) { // expected-error {{'__private 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}}
+ constant event_t const_evt; // expected-error {{the event_t type can only be used with __private address space qualifier}} expected-error{{variable in constant address space must be initialized}}
foo(e);
foo(0);
foo(5); // expected-error {{passing 'int' to parameter of incompatible type 'event_t'}}
diff --git a/src/llvm-project/clang/test/SemaOpenCL/extension-begin.cl b/src/llvm-project/clang/test/SemaOpenCL/extension-begin.cl
index 367652c..fdb481f 100644
--- a/src/llvm-project/clang/test/SemaOpenCL/extension-begin.cl
+++ b/src/llvm-project/clang/test/SemaOpenCL/extension-begin.cl
@@ -44,7 +44,7 @@
struct A test_A2; // expected-error {{use of type 'struct A' requires my_ext extension to be enabled}}
const struct A test_A_local; // expected-error {{use of type 'struct A' requires my_ext extension to be enabled}}
TypedefOfA test_typedef_A; // expected-error {{use of type 'TypedefOfA' (aka 'struct A') requires my_ext extension to be enabled}}
- PointerOfA test_A_pointer; // expected-error {{use of type 'PointerOfA' (aka 'const struct A *') requires my_ext extension to be enabled}}
+ PointerOfA test_A_pointer; // expected-error {{use of type 'PointerOfA' (aka 'const __private struct A *') requires my_ext extension to be enabled}}
f(); // expected-error {{use of declaration 'f' requires my_ext extension to be enabled}}
g(0); // expected-error {{no matching function for call to 'g'}}
// [email protected]:18 {{candidate unavailable as it requires OpenCL extension 'my_ext' to be enabled}}
diff --git a/src/llvm-project/clang/test/SemaOpenCL/fdeclare-opencl-builtins.cl b/src/llvm-project/clang/test/SemaOpenCL/fdeclare-opencl-builtins.cl
index 12a5431..dd89f40 100644
--- a/src/llvm-project/clang/test/SemaOpenCL/fdeclare-opencl-builtins.cl
+++ b/src/llvm-project/clang/test/SemaOpenCL/fdeclare-opencl-builtins.cl
@@ -1,28 +1,170 @@
-// RUN: %clang_cc1 %s -triple spir -verify -pedantic -fsyntax-only -cl-std=CL2.0 -fdeclare-opencl-builtins -DNO_HEADER
-// RUN: %clang_cc1 %s -triple spir -verify -pedantic -fsyntax-only -cl-std=CL2.0 -fdeclare-opencl-builtins -finclude-default-header
+// RUN: %clang_cc1 %s -triple spir -verify -pedantic -Wconversion -Werror -fsyntax-only -cl-std=CL -fdeclare-opencl-builtins -DNO_HEADER
+// RUN: %clang_cc1 %s -triple spir -verify -pedantic -Wconversion -Werror -fsyntax-only -cl-std=CL -fdeclare-opencl-builtins -finclude-default-header
+// RUN: %clang_cc1 %s -triple spir -verify -pedantic -Wconversion -Werror -fsyntax-only -cl-std=CL1.2 -fdeclare-opencl-builtins -DNO_HEADER
+// RUN: %clang_cc1 %s -triple spir -verify -pedantic -Wconversion -Werror -fsyntax-only -cl-std=CL1.2 -fdeclare-opencl-builtins -finclude-default-header
+// RUN: %clang_cc1 %s -triple spir -verify -pedantic -Wconversion -Werror -fsyntax-only -cl-std=CL2.0 -fdeclare-opencl-builtins -DNO_HEADER
+// RUN: %clang_cc1 %s -triple spir -verify -pedantic -Wconversion -Werror -fsyntax-only -cl-std=CL2.0 -fdeclare-opencl-builtins -finclude-default-header
+// RUN: %clang_cc1 %s -triple spir -verify -pedantic -Wconversion -Werror -fsyntax-only -cl-std=CLC++ -fdeclare-opencl-builtins -DNO_HEADER
+// RUN: %clang_cc1 %s -triple spir -verify -pedantic -Wconversion -Werror -fsyntax-only -cl-std=CLC++ -fdeclare-opencl-builtins -finclude-default-header
// Test the -fdeclare-opencl-builtins option.
-// Provide typedefs when invoking clang without -finclude-default-header.
-#ifdef NO_HEADER
-typedef float float4 __attribute__((ext_vector_type(4)));
-typedef int int4 __attribute__((ext_vector_type(4)));
-typedef int int2 __attribute__((ext_vector_type(2)));
-typedef unsigned int uint;
-typedef __SIZE_TYPE__ size_t;
+#pragma OPENCL EXTENSION cl_khr_fp16 : enable
+#if __OPENCL_C_VERSION__ < CL_VERSION_1_2
+#pragma OPENCL EXTENSION cl_khr_fp64 : enable
#endif
-kernel void basic_conversion(global float4 *buf, global int4 *res) {
- res[0] = convert_int4(buf[0]);
+// Provide typedefs when invoking clang without -finclude-default-header.
+#ifdef NO_HEADER
+typedef unsigned char uchar;
+typedef unsigned int uint;
+typedef unsigned long ulong;
+typedef unsigned short ushort;
+typedef __SIZE_TYPE__ size_t;
+typedef char char2 __attribute__((ext_vector_type(2)));
+typedef char char4 __attribute__((ext_vector_type(4)));
+typedef uchar uchar4 __attribute__((ext_vector_type(4)));
+typedef float float4 __attribute__((ext_vector_type(4)));
+typedef half half4 __attribute__((ext_vector_type(4)));
+typedef int int2 __attribute__((ext_vector_type(2)));
+typedef int int4 __attribute__((ext_vector_type(4)));
+typedef uint uint4 __attribute__((ext_vector_type(4)));
+typedef long long2 __attribute__((ext_vector_type(2)));
+#endif
+
+kernel void test_pointers(volatile global void *global_p, global const int4 *a) {
+ int i;
+ unsigned int ui;
+
+ prefetch(a, 2);
+
+ atom_add((volatile __global int *)global_p, i);
+#if !defined(__OPENCL_CPP_VERSION__) && __OPENCL_C_VERSION__ < CL_VERSION_1_1
+// expected-error@-2{{no matching function for call to 'atom_add'}}
+
+// There are two potential definitions of the function "atom_add", both are
+// currently disabled because the associated extension is disabled.
+// expected-note@-6{{candidate function not viable: cannot pass pointer to address space '__global' as a pointer to address space '__local' in 1st argument}}
+// expected-note@-7{{candidate function not viable: no known conversion}}
+// expected-note@-8{{candidate function not viable: no known conversion}}
+// expected-note@-9{{candidate function not viable: no known conversion}}
+// expected-note@-10{{candidate unavailable as it requires OpenCL extension 'cl_khr_global_int32_base_atomics' to be enabled}}
+// expected-note@-11{{candidate unavailable as it requires OpenCL extension 'cl_khr_global_int32_base_atomics' to be enabled}}
+// expected-note@-12{{candidate unavailable as it requires OpenCL extension 'cl_khr_int64_base_atomics' to be enabled}}
+// expected-note@-13{{candidate unavailable as it requires OpenCL extension 'cl_khr_int64_base_atomics' to be enabled}}
+#endif
+
+#if __OPENCL_C_VERSION__ < CL_VERSION_1_1
+#pragma OPENCL EXTENSION cl_khr_global_int32_base_atomics : enable
+#endif
+
+ atom_add((volatile __global int *)global_p, i);
+ atom_cmpxchg((volatile __global unsigned int *)global_p, ui, ui);
}
-kernel void basic_readonly_image_type(__read_only image2d_t img, int2 coord, global float4 *out) {
- out[0] = read_imagef(img, coord);
+kernel void basic_conversion() {
+ double d;
+ float f;
+ char2 c2;
+ long2 l2;
+ float4 f4;
+ int4 i4;
+
+ f = convert_float(d);
+ d = convert_double_sat_rtp(f);
+ l2 = convert_long2_rtz(c2);
+ i4 = convert_int4_sat(f4);
+}
+
+char4 test_int(char c, char4 c4) {
+ char m = max(c, c);
+ char4 m4 = max(c4, c4);
+ uchar4 abs1 = abs(c4);
+ uchar4 abs2 = abs(abs1);
+ return max(c4, c);
+}
+
+kernel void basic_vector_misc(float4 a) {
+ float4 res;
+ uint4 mask = (uint4)(1, 2, 3, 4);
+
+ res = shuffle(a, mask);
+}
+
+kernel void basic_image_readonly(read_only image2d_t image_read_only_image2d) {
+ int2 i2;
+ sampler_t sampler;
+ half4 res;
+ float4 resf;
+
+ resf = read_imagef(image_read_only_image2d, i2);
+ res = read_imageh(image_read_only_image2d, i2);
+ res = read_imageh(image_read_only_image2d, sampler, i2);
+
+ int imgWidth = get_image_width(image_read_only_image2d);
+}
+
+#if __OPENCL_C_VERSION__ >= CL_VERSION_2_0
+kernel void basic_image_readwrite(read_write image3d_t image_read_write_image3d) {
+ half4 h4;
+ int4 i4;
+
+ write_imageh(image_read_write_image3d, i4, h4);
+
+ int imgDepth = get_image_depth(image_read_write_image3d);
+}
+#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
+
+kernel void basic_image_writeonly(write_only image1d_buffer_t image_write_only_image1d_buffer) {
+ half4 h4;
+ float4 f4;
+ int i;
+
+ write_imagef(image_write_only_image1d_buffer, i, f4);
+ write_imageh(image_write_only_image1d_buffer, i, h4);
}
kernel void basic_subgroup(global uint *out) {
out[0] = get_sub_group_size();
-// expected-error@-1{{use of declaration 'get_sub_group_size' requires cl_khr_subgroups extension to be enabled}}
-#pragma OPENCL EXTENSION cl_khr_subgroups : enable
- out[1] = get_sub_group_size();
+#if !defined(__OPENCL_CPP_VERSION__) && __OPENCL_C_VERSION__ < CL_VERSION_2_0
+// expected-error@-2{{implicit declaration of function 'get_sub_group_size' is invalid in OpenCL}}
+// expected-error@-3{{implicit conversion changes signedness: 'int' to 'uint' (aka 'unsigned int')}}
+#elif defined(__OPENCL_CPP_VERSION__)
+// expected-error@-5{{no matching function for call to 'get_sub_group_size'}}
+// expected-note@-6{{candidate unavailable as it requires OpenCL extension 'cl_khr_subgroups' to be enabled}}
+#else
+// expected-error@-8{{use of declaration 'get_sub_group_size' requires cl_khr_subgroups extension to be enabled}}
+#endif
+}
+
+kernel void basic_vector_data() {
+#if __OPENCL_C_VERSION__ >= CL_VERSION_2_0
+ generic void *generic_p;
+#endif
+ constant void *constant_p;
+ local void *local_p;
+ global void *global_p;
+ private void *private_p;
+ size_t s;
+
+ vload4(s, (const __constant ulong *) constant_p);
+ vload16(s, (const __constant short *) constant_p);
+
+#if __OPENCL_C_VERSION__ >= CL_VERSION_2_0
+ vload3(s, (const __generic ushort *) generic_p);
+ vload16(s, (const __generic uchar *) generic_p);
+#endif
+
+ vload8(s, (const __global long *) global_p);
+ vload2(s, (const __local uint *) local_p);
+ vload16(s, (const __private float *) private_p);
+}
+
+kernel void basic_work_item() {
+ uint ui;
+
+ get_enqueued_local_size(ui);
+#if !defined(__OPENCL_CPP_VERSION__) && __OPENCL_C_VERSION__ < CL_VERSION_2_0
+// expected-error@-2{{implicit declaration of function 'get_enqueued_local_size' is invalid in OpenCL}}
+#endif
}
diff --git a/src/llvm-project/clang/test/SemaOpenCL/half.cl b/src/llvm-project/clang/test/SemaOpenCL/half.cl
index e8da3a2..2ea971c 100644
--- a/src/llvm-project/clang/test/SemaOpenCL/half.cl
+++ b/src/llvm-project/clang/test/SemaOpenCL/half.cl
@@ -4,13 +4,13 @@
constant float f = 1.0h; // expected-error{{half precision constant requires cl_khr_fp16}}
half half_disabled(half *p, // expected-error{{declaring function return value of type 'half' is not allowed}}
- half h) // expected-error{{declaring function parameter of type 'half' is not allowed}}
+ half h) // expected-error{{declaring function parameter of type '__private half' is not allowed}}
{
- half a[2]; // expected-error{{declaring variable of type 'half [2]' is not allowed}}
- half b; // expected-error{{declaring variable of type 'half' is not allowed}}
- *p; // expected-error{{loading directly from pointer to type 'half' requires cl_khr_fp16. Use vector data load builtin functions instead}}
+ half a[2]; // expected-error{{declaring variable of type '__private half [2]' is not allowed}}
+ half b; // expected-error{{declaring variable of type '__private half' is not allowed}}
+ *p; // expected-error{{loading directly from pointer to type '__private half' requires cl_khr_fp16. Use vector data load builtin functions instead}}
*p = 0; // expected-error{{assigning directly to pointer to type 'half' requires cl_khr_fp16. Use vector data store builtin functions instead}}
- p[1]; // expected-error{{loading directly from pointer to type 'half' requires cl_khr_fp16. Use vector data load builtin functions instead}}
+ p[1]; // expected-error{{loading directly from pointer to type '__private half' requires cl_khr_fp16. Use vector data load builtin functions instead}}
p[1] = 0; // expected-error{{assigning directly to pointer to type 'half' requires cl_khr_fp16. Use vector data store builtin functions instead}}
float c = 1.0f;
@@ -26,7 +26,7 @@
}
kernel void half_disabled_kernel(global half *p,
- half h); // expected-error{{declaring function parameter of type 'half' is not allowed; did you forget * ?}}
+ half h); // expected-error{{declaring function parameter of type '__private half' is not allowed; did you forget * ?}}
// Exactly the same as above but with the cl_khr_fp16 extension enabled.
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
diff --git a/src/llvm-project/clang/test/SemaOpenCL/images.cl b/src/llvm-project/clang/test/SemaOpenCL/images.cl
index 9d6092c..d9305dd 100644
--- a/src/llvm-project/clang/test/SemaOpenCL/images.cl
+++ b/src/llvm-project/clang/test/SemaOpenCL/images.cl
@@ -7,26 +7,26 @@
void imgage_access_test(image2d_t img2dro, image3d_t img3dro) {
img2d_ro(img2dro); // read_only = read_only
- img2d_ro(img3dro); // expected-error{{passing '__read_only image3d_t' to parameter of incompatible type '__read_only image2d_t'}}
+ img2d_ro(img3dro); // expected-error{{passing '__private __read_only image3d_t' to parameter of incompatible type '__read_only image2d_t'}}
}
kernel void read_only_access_test(read_only image2d_t img) {
img2d_ro(img); // read_only = read_only
- img2d_wo(img); // expected-error {{passing '__read_only image2d_t' to parameter of incompatible type '__write_only image2d_t'}}
- img2d_rw(img); // expected-error {{passing '__read_only image2d_t' to parameter of incompatible type '__read_write image2d_t'}}
+ img2d_wo(img); // expected-error {{passing '__private __read_only image2d_t' to parameter of incompatible type '__write_only image2d_t'}}
+ img2d_rw(img); // expected-error {{passing '__private __read_only image2d_t' to parameter of incompatible type '__read_write image2d_t'}}
img2d_default(img); // read_only = read_only
}
kernel void write_only_access_test(write_only image2d_t img) {
- img2d_ro(img); // expected-error {{passing '__write_only image2d_t' to parameter of incompatible type '__read_only image2d_t'}}
+ img2d_ro(img); // expected-error {{passing '__private __write_only image2d_t' to parameter of incompatible type '__read_only image2d_t'}}
img2d_wo(img); // write_only = write_only
- img2d_rw(img); // expected-error {{passing '__write_only image2d_t' to parameter of incompatible type '__read_write image2d_t'}}
- img2d_default(img); // expected-error {{passing '__write_only image2d_t' to parameter of incompatible type '__read_only image2d_t'}}
+ img2d_rw(img); // expected-error {{passing '__private __write_only image2d_t' to parameter of incompatible type '__read_write image2d_t'}}
+ img2d_default(img); // expected-error {{passing '__private __write_only image2d_t' to parameter of incompatible type '__read_only image2d_t'}}
}
kernel void read_write_access_test(read_write image2d_t img) {
- img2d_ro(img); // expected-error {{passing '__read_write image2d_t' to parameter of incompatible type '__read_only image2d_t'}}
- img2d_wo(img); // expected-error {{passing '__read_write image2d_t' to parameter of incompatible type '__write_only image2d_t'}}
+ img2d_ro(img); // expected-error {{passing '__private __read_write image2d_t' to parameter of incompatible type '__read_only image2d_t'}}
+ img2d_wo(img); // expected-error {{passing '__private __read_write image2d_t' to parameter of incompatible type '__write_only image2d_t'}}
img2d_rw(img); //read_write = read_write
- img2d_default(img); // expected-error {{passing '__read_write image2d_t' to parameter of incompatible type '__read_only image2d_t'}}
+ img2d_default(img); // expected-error {{passing '__private __read_write image2d_t' to parameter of incompatible type '__read_only image2d_t'}}
}
diff --git a/src/llvm-project/clang/test/SemaOpenCL/intel-subgroup-avc-ext-types.cl b/src/llvm-project/clang/test/SemaOpenCL/intel-subgroup-avc-ext-types.cl
index 3392e80..e76d547 100644
--- a/src/llvm-project/clang/test/SemaOpenCL/intel-subgroup-avc-ext-types.cl
+++ b/src/llvm-project/clang/test/SemaOpenCL/intel-subgroup-avc-ext-types.cl
@@ -16,34 +16,34 @@
// negative test cases for initializers
void foo(char c, float f, void* v, struct st ss) {
intel_sub_group_avc_mce_payload_t payload_mce = 0; // No zero initializer for mce types
- // expected-error@-1 {{initializing 'intel_sub_group_avc_mce_payload_t' with an expression of incompatible type 'int'}}
+ // expected-error@-1 {{initializing '__private intel_sub_group_avc_mce_payload_t' with an expression of incompatible type 'int'}}
intel_sub_group_avc_ime_payload_t payload_ime = 1; // No literal initializer for *payload_t types
- // expected-error@-1 {{initializing 'intel_sub_group_avc_ime_payload_t' with an expression of incompatible type 'int'}}
+ // expected-error@-1 {{initializing '__private intel_sub_group_avc_ime_payload_t' with an expression of incompatible type 'int'}}
intel_sub_group_avc_ref_payload_t payload_ref = f;
- // expected-error@-1 {{initializing 'intel_sub_group_avc_ref_payload_t' with an expression of incompatible type 'float'}}
+ // expected-error@-1 {{initializing '__private intel_sub_group_avc_ref_payload_t' with an expression of incompatible type '__private float'}}
intel_sub_group_avc_sic_payload_t payload_sic = ss;
- // expected-error@-1 {{initializing 'intel_sub_group_avc_sic_payload_t' with an expression of incompatible type 'struct st'}}
+ // expected-error@-1 {{initializing '__private intel_sub_group_avc_sic_payload_t' with an expression of incompatible type '__private struct st'}}
intel_sub_group_avc_mce_result_t result_mce = 0; // No zero initializer for mce types
- // expected-error@-1 {{initializing 'intel_sub_group_avc_mce_result_t' with an expression of incompatible type 'int'}}
+ // expected-error@-1 {{initializing '__private intel_sub_group_avc_mce_result_t' with an expression of incompatible type 'int'}}
intel_sub_group_avc_ime_result_t result_ime = 1; // No literal initializer for *result_t types
- // expected-error@-1 {{initializing 'intel_sub_group_avc_ime_result_t' with an expression of incompatible type 'int'}}
+ // expected-error@-1 {{initializing '__private intel_sub_group_avc_ime_result_t' with an expression of incompatible type 'int'}}
intel_sub_group_avc_ref_result_t result_ref = f;
- // expected-error@-1 {{initializing 'intel_sub_group_avc_ref_result_t' with an expression of incompatible type 'float'}}
+ // expected-error@-1 {{initializing '__private intel_sub_group_avc_ref_result_t' with an expression of incompatible type '__private float'}}
intel_sub_group_avc_sic_result_t result_sic = ss;
- // expected-error@-1 {{initializing 'intel_sub_group_avc_sic_result_t' with an expression of incompatible type 'struct st'}}
+ // expected-error@-1 {{initializing '__private intel_sub_group_avc_sic_result_t' with an expression of incompatible type '__private struct st'}}
intel_sub_group_avc_ime_result_single_reference_streamout_t sstreamout = v;
- // expected-error@-1 {{initializing 'intel_sub_group_avc_ime_result_single_reference_streamout_t' with an expression of incompatible type 'void *'}}
+ // expected-error@-1 {{initializing '__private intel_sub_group_avc_ime_result_single_reference_streamout_t' with an expression of incompatible type '__private void *__private'}}
intel_sub_group_avc_ime_result_dual_reference_streamout_t dstreamin_list = {0x0, 0x1};
// expected-warning@-1 {{excess elements in struct initializer}}
intel_sub_group_avc_ime_dual_reference_streamin_t dstreamin_list2 = {};
// expected-error@-1 {{scalar initializer cannot be empty}}
intel_sub_group_avc_ime_single_reference_streamin_t dstreamin_list3 = {c};
- // expected-error@-1 {{initializing 'intel_sub_group_avc_ime_single_reference_streamin_t' with an expression of incompatible type 'char'}}
+ // expected-error@-1 {{initializing '__private intel_sub_group_avc_ime_single_reference_streamin_t' with an expression of incompatible type '__private char'}}
intel_sub_group_avc_ime_dual_reference_streamin_t dstreamin_list4 = {1};
- // expected-error@-1 {{initializing 'intel_sub_group_avc_ime_dual_reference_streamin_t' with an expression of incompatible type 'int'}}
+ // expected-error@-1 {{initializing '__private intel_sub_group_avc_ime_dual_reference_streamin_t' with an expression of incompatible type 'int'}}
}
// negative tests for initializers and assignment
@@ -53,12 +53,12 @@
intel_sub_group_avc_ime_payload_t payload_ime;
intel_sub_group_avc_ref_payload_t payload_ref = payload_ime;
- // expected-error@-1 {{initializing 'intel_sub_group_avc_ref_payload_t' with an expression of incompatible type 'intel_sub_group_avc_ime_payload_t'}}
+ // expected-error@-1 {{initializing '__private intel_sub_group_avc_ref_payload_t' with an expression of incompatible type '__private intel_sub_group_avc_ime_payload_t'}}
intel_sub_group_avc_sic_result_t result_sic;
intel_sub_group_avc_ime_result_t result_ime;
result_sic = result_ime;
- // expected-error@-1 {{assigning to 'intel_sub_group_avc_sic_result_t' from incompatible type 'intel_sub_group_avc_ime_result_t'}}
+ // expected-error@-1 {{assigning to '__private intel_sub_group_avc_sic_result_t' from incompatible type '__private intel_sub_group_avc_ime_result_t'}}
}
// Using 0x0 directly allows us not to include opencl-c.h header and not to
diff --git a/src/llvm-project/clang/test/SemaOpenCL/invalid-block.cl b/src/llvm-project/clang/test/SemaOpenCL/invalid-block.cl
index 5d6dc38..ec74d16 100644
--- a/src/llvm-project/clang/test/SemaOpenCL/invalid-block.cl
+++ b/src/llvm-project/clang/test/SemaOpenCL/invalid-block.cl
@@ -12,7 +12,7 @@
};
f0(bl1);
f0(bl2);
- bl1 = bl2; // expected-error{{invalid operands to binary expression ('int (__generic ^const)(void)' and 'int (__generic ^const)(void)')}}
+ bl1 = bl2; // expected-error{{invalid operands to binary expression ('int (__generic ^const __private)(void)' and 'int (__generic ^const __private)(void)')}}
int (^const bl3)(); // expected-error{{invalid block variable declaration - must be initialized}}
}
@@ -53,18 +53,18 @@
bl2_t bl2 = ^(int i) {
return 2;
};
- bl2_t arr[] = {bl1, bl2}; // expected-error {{array of 'bl2_t' (aka 'int (__generic ^const)(int)') type is invalid in OpenCL}}
+ bl2_t arr[] = {bl1, bl2}; // expected-error {{array of 'bl2_t' (aka 'int (__generic ^const)(__private int)') type is invalid in OpenCL}}
int tmp = i ? bl1(i) // expected-error {{block type cannot be used as expression in ternary expression in OpenCL}}
: bl2(i); // expected-error {{block type cannot be used as expression in ternary expression in OpenCL}}
}
// A block pointer type and all pointer operations are disallowed
-void f6(bl2_t *bl_ptr) { // expected-error{{pointer to type '__generic bl2_t' (aka 'int (__generic ^const __generic)(int)') is invalid in OpenCL}}
+void f6(bl2_t *bl_ptr) { // expected-error{{pointer to type 'bl2_t' (aka 'int (__generic ^const)(__private int)') is invalid in OpenCL}}
bl2_t bl = ^(int i) {
return 1;
};
- bl2_t *p; // expected-error {{pointer to type '__generic bl2_t' (aka 'int (__generic ^const __generic)(int)') is invalid in OpenCL}}
- *bl; // expected-error {{invalid argument type 'bl2_t' (aka 'int (__generic ^const)(int)') to unary expression}}
- &bl; // expected-error {{invalid argument type 'bl2_t' (aka 'int (__generic ^const)(int)') to unary expression}}
+ bl2_t *p; // expected-error {{pointer to type 'bl2_t' (aka 'int (__generic ^const)(__private int)') is invalid in OpenCL}}
+ *bl; // expected-error {{invalid argument type '__private bl2_t' (aka 'int (__generic ^const __private)(__private int)') to unary expression}}
+ &bl; // expected-error {{invalid argument type '__private bl2_t' (aka 'int (__generic ^const __private)(__private int)') to unary expression}}
}
// A block can't reference another block
kernel void f7() {
diff --git a/src/llvm-project/clang/test/SemaOpenCL/invalid-image.cl b/src/llvm-project/clang/test/SemaOpenCL/invalid-image.cl
index 9185cc3..a996a67 100644
--- a/src/llvm-project/clang/test/SemaOpenCL/invalid-image.cl
+++ b/src/llvm-project/clang/test/SemaOpenCL/invalid-image.cl
@@ -5,12 +5,12 @@
void test1(image1d_t *i) {} // expected-error-re{{pointer to type '{{__generic __read_only|__read_only}} image1d_t' is invalid in OpenCL}}
void test2(image1d_t i) {
- image1d_t ti; // expected-error{{type '__read_only image1d_t' can only be used as a function parameter}}
+ image1d_t ti; // expected-error{{type '__private __read_only image1d_t' can only be used as a function parameter}}
image1d_t ai[] = {i, i}; // expected-error{{array of '__read_only image1d_t' type is invalid in OpenCL}}
- i=i; // expected-error{{invalid operands to binary expression ('__read_only image1d_t' and '__read_only image1d_t')}}
- i+1; // expected-error{{invalid operands to binary expression ('__read_only image1d_t' and 'int')}}
- &i; // expected-error{{invalid argument type '__read_only image1d_t' to unary expression}}
- *i; // expected-error{{invalid argument type '__read_only image1d_t' to unary expression}}
+ i=i; // expected-error{{invalid operands to binary expression ('__private __read_only image1d_t' and '__private __read_only image1d_t')}}
+ i+1; // expected-error{{invalid operands to binary expression ('__private __read_only image1d_t' and 'int')}}
+ &i; // expected-error{{invalid argument type '__private __read_only image1d_t' to unary expression}}
+ *i; // expected-error{{invalid argument type '__private __read_only image1d_t' to unary expression}}
}
image1d_t test3() {} // expected-error{{declaring function return value of type '__read_only image1d_t' is not allowed}}
diff --git a/src/llvm-project/clang/test/SemaOpenCL/invalid-kernel-attrs.cl b/src/llvm-project/clang/test/SemaOpenCL/invalid-kernel-attrs.cl
index a96e85c..daa8fa0 100644
--- a/src/llvm-project/clang/test/SemaOpenCL/invalid-kernel-attrs.cl
+++ b/src/llvm-project/clang/test/SemaOpenCL/invalid-kernel-attrs.cl
@@ -1,12 +1,12 @@
-// RUN: %clang_cc1 -verify %s
+// RUN: %clang_cc1 -verify %s
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'}}
-kernel __attribute__((vec_type_hint(void))) void kernel3() {} //expected-error{{invalid attribute argument 'void' - expecting a vector or vectorizable scalar type}}
+kernel __attribute__((vec_type_hint(void))) void kernel3() {} //expected-error{{a non-vector or non-vectorizable scalar type is an invalid argument to attribute 'vec_type_hint'}}
-kernel __attribute__((vec_type_hint(bool))) void kernel4() {} //expected-error{{invalid attribute argument 'bool' - expecting a vector or vectorizable scalar type}}
+kernel __attribute__((vec_type_hint(bool))) void kernel4() {} //expected-error{{a non-vector or non-vectorizable scalar type is an invalid argument to attribute 'vec_type_hint'}}
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}}
diff --git a/src/llvm-project/clang/test/SemaOpenCL/invalid-kernel-parameters.cl b/src/llvm-project/clang/test/SemaOpenCL/invalid-kernel-parameters.cl
index e3372b1..48de39d 100644
--- a/src/llvm-project/clang/test/SemaOpenCL/invalid-kernel-parameters.cl
+++ b/src/llvm-project/clang/test/SemaOpenCL/invalid-kernel-parameters.cl
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s -triple spir-unknown-unknown
-kernel void half_arg(half x) { } // expected-error{{declaring function parameter of type 'half' is not allowed; did you forget * ?}}
+kernel void half_arg(half x) { } // expected-error{{declaring function parameter of type '__private half' is not allowed; did you forget * ?}}
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
@@ -9,37 +9,37 @@
// bool, half, size_t, ptrdiff_t, intptr_t, and uintptr_t
// or a struct / union with any of these types in them
-typedef __SIZE_TYPE__ size_t; // expected-note{{'size_t' (aka 'unsigned int') declared here}}
+typedef __SIZE_TYPE__ size_t; // expected-note{{'__private size_t' (aka '__private unsigned int') declared here}}
// expected-note@-1{{'size_t' (aka 'unsigned int') declared here}}
-typedef __PTRDIFF_TYPE__ ptrdiff_t; // expected-note{{'ptrdiff_t' (aka 'int') declared here}}
-typedef __INTPTR_TYPE__ intptr_t; // expected-note{{'intptr_t' (aka 'int') declared here}}
-typedef __UINTPTR_TYPE__ uintptr_t; // expected-note{{'uintptr_t' (aka 'unsigned int') declared here}}
+typedef __PTRDIFF_TYPE__ ptrdiff_t; // expected-note{{'__private ptrdiff_t' (aka '__private int') declared here}}
+typedef __INTPTR_TYPE__ intptr_t; // expected-note{{'__private intptr_t' (aka '__private int') declared here}}
+typedef __UINTPTR_TYPE__ uintptr_t; // expected-note{{'__private uintptr_t' (aka '__private unsigned int') declared here}}
-kernel void size_t_arg(size_t x) {} // expected-error{{'size_t' (aka 'unsigned int') cannot be used as the type of a kernel parameter}}
+kernel void size_t_arg(size_t x) {} // expected-error{{'__private size_t' (aka '__private unsigned int') cannot be used as the type of a kernel parameter}}
-kernel void ptrdiff_t_arg(ptrdiff_t x) {} // expected-error{{'ptrdiff_t' (aka 'int') cannot be used as the type of a kernel parameter}}
+kernel void ptrdiff_t_arg(ptrdiff_t x) {} // expected-error{{'__private ptrdiff_t' (aka '__private int') cannot be used as the type of a kernel parameter}}
-kernel void intptr_t_arg(intptr_t x) {} // expected-error{{'intptr_t' (aka 'int') cannot be used as the type of a kernel parameter}}
+kernel void intptr_t_arg(intptr_t x) {} // expected-error{{'__private intptr_t' (aka '__private int') cannot be used as the type of a kernel parameter}}
-kernel void uintptr_t_arg(uintptr_t x) {} // expected-error{{'uintptr_t' (aka 'unsigned int') cannot be used as the type of a kernel parameter}}
+kernel void uintptr_t_arg(uintptr_t x) {} // expected-error{{'__private uintptr_t' (aka '__private unsigned int') cannot be used as the type of a kernel parameter}}
typedef size_t size_ty;
struct SizeTStruct { // expected-note{{within field of type 'SizeTStruct' declared here}}
size_ty s; // expected-note{{field of illegal type 'size_ty' (aka 'unsigned int') declared here}}
};
-kernel void size_t_struct_arg(struct SizeTStruct x) {} // expected-error{{'struct SizeTStruct' cannot be used as the type of a kernel parameter}}
+kernel void size_t_struct_arg(struct SizeTStruct x) {} // expected-error{{'__private struct SizeTStruct' cannot be used as the type of a kernel parameter}}
union SizeTUnion { // expected-note{{within field of type 'SizeTUnion' declared here}}
size_t s; // expected-note{{field of illegal type 'size_t' (aka 'unsigned int') declared here}}
float f;
};
-kernel void size_t_union_arg(union SizeTUnion x) {} // expected-error{{'union SizeTUnion' cannot be used as the type of a kernel parameter}}
+kernel void size_t_union_arg(union SizeTUnion x) {} // expected-error{{'__private union SizeTUnion' cannot be used as the type of a kernel parameter}}
typedef size_t s_ty; // expected-note{{'s_ty' (aka 'unsigned int') declared here}}
-typedef s_ty ss_ty; // expected-note{{'ss_ty' (aka 'unsigned int') declared here}}
-kernel void typedef_to_size_t(ss_ty s) {} // expected-error{{'ss_ty' (aka 'unsigned int') cannot be used as the type of a kernel parameter}}
+typedef s_ty ss_ty; // expected-note{{'__private ss_ty' (aka '__private unsigned int') declared here}}
+kernel void typedef_to_size_t(ss_ty s) {} // expected-error{{'__private ss_ty' (aka '__private unsigned int') cannot be used as the type of a kernel parameter}}
-kernel void bool_arg(bool x) { } // expected-error{{'bool' cannot be used as the type of a kernel parameter}}
+kernel void bool_arg(bool x) { } // expected-error{{'__private bool' cannot be used as the type of a kernel parameter}}
// half kernel argument is allowed when cl_khr_fp16 is enabled.
kernel void half_arg(half x) { }
@@ -49,7 +49,7 @@
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}}
+kernel void bool_in_struct_arg(ContainsBool x) { } // expected-error{{'__private ContainsBool' (aka '__private struct ContainsBool') cannot be used as the type of a kernel parameter}}
@@ -65,14 +65,14 @@
typedef struct Foo // expected-note{{within field of type 'Foo' declared here}}
{
- int* ptrField; // expected-note{{field of illegal pointer type 'int *' declared here}}
+ int* ptrField; // expected-note{{field of illegal pointer type '__private 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}}
+ int* ptrField; // expected-note{{field of illegal pointer type '__private int *' declared here}}
} FooUnion;
kernel void pointer_in_union_arg(FooUnion arg) { }// expected-error{{union kernel parameters may not contain pointers}}
@@ -82,7 +82,7 @@
int x;
struct InnerNestedPointer
{
- int* ptrField; // expected-note 3 {{field of illegal pointer type 'int *' declared here}}
+ int* ptrField; // expected-note 3 {{field of illegal pointer type '__private int *' declared here}}
} inner; // expected-note 3 {{within field of type 'struct InnerNestedPointer' declared here}}
} NestedPointer;
@@ -96,7 +96,7 @@
struct InnerNestedPointerComplex
{
int innerFoo;
- int* innerPtrField; // expected-note{{field of illegal pointer type 'int *' declared here}}
+ int* innerPtrField; // expected-note{{field of illegal pointer type '__private int *' declared here}}
} inner; // expected-note{{within field of type 'struct InnerNestedPointerComplex' declared here}}
float y;
@@ -114,10 +114,10 @@
} 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}}
+kernel void bool_in_nested_struct_arg(NestedBool arg) { } // expected-error{{'__private NestedBool' (aka '__private 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}}
+kernel void bool_in_nested_struct_arg_again(NestedBool arg) { } // expected-error{{'__private NestedBool' (aka '__private struct NestedBool') cannot be used as the type of a kernel parameter}}
// Check for note with a struct not defined inside the struct
@@ -132,7 +132,7 @@
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}}
+kernel void bool_in_nested_struct_2_arg(NestedBool2 arg) { } // expected-error{{'__private NestedBool2' (aka '__private struct NestedBool2') cannot be used as the type of a kernel parameter}}
struct InnerInner
@@ -167,8 +167,8 @@
struct ArrayOfPtr // expected-note{{within field of type 'ArrayOfPtr' declared here}}
{
- float *arr[3]; // expected-note{{field of illegal type 'float *[3]' declared here}}
- // expected-note@-1{{field of illegal type 'float *[3]' declared here}}
+ float *arr[3]; // expected-note{{field of illegal type '__private float *[3]' declared here}}
+ // expected-note@-1{{field of illegal type '__private float *[3]' declared here}}
};
kernel void array_of_ptr(struct ArrayOfPtr arr) {} // expected-error{{struct kernel parameters may not contain pointers}}
diff --git a/src/llvm-project/clang/test/SemaOpenCL/invalid-pipe-builtin-cl2.0.cl b/src/llvm-project/clang/test/SemaOpenCL/invalid-pipe-builtin-cl2.0.cl
index 619b359..36e7662 100644
--- a/src/llvm-project/clang/test/SemaOpenCL/invalid-pipe-builtin-cl2.0.cl
+++ b/src/llvm-project/clang/test/SemaOpenCL/invalid-pipe-builtin-cl2.0.cl
@@ -12,22 +12,22 @@
read_pipe(tmp, p); // expected-error {{first argument to 'read_pipe' must be a pipe type}}
read_pipe(p); // expected-error {{invalid number of arguments to function: 'read_pipe'}}
read_pipe(p, rid, tmp, ptr);
- read_pipe(p, tmp, tmp, ptr); // expected-error {{invalid argument type to function 'read_pipe' (expecting 'reserve_id_t' having 'int')}}
- read_pipe(p, rid, rid, ptr); // expected-error {{invalid argument type to function 'read_pipe' (expecting 'unsigned int' having 'reserve_id_t')}}
- read_pipe(p, tmp); // expected-error {{invalid argument type to function 'read_pipe' (expecting 'int *' having 'int')}}
+ read_pipe(p, tmp, tmp, ptr); // expected-error {{invalid argument type to function 'read_pipe' (expecting 'reserve_id_t' having '__private int')}}
+ read_pipe(p, rid, rid, ptr); // expected-error {{invalid argument type to function 'read_pipe' (expecting 'unsigned int' having '__private reserve_id_t')}}
+ read_pipe(p, tmp); // expected-error {{invalid argument type to function 'read_pipe' (expecting 'int *' having '__private int')}}
write_pipe(p, ptr); // expected-error {{invalid pipe access modifier (expecting write_only)}}
write_pipe(p, rid, tmp, ptr); // expected-error {{invalid pipe access modifier (expecting write_only)}}
// reserve_read/write_pipe
reserve_read_pipe(p, tmp);
- reserve_read_pipe(p, ptr); // expected-error{{invalid argument type to function 'reserve_read_pipe' (expecting 'unsigned int' having '__global int *')}}
+ reserve_read_pipe(p, ptr); // expected-error{{invalid argument type to function 'reserve_read_pipe' (expecting 'unsigned int' having '__global int *__private')}}
work_group_reserve_read_pipe(tmp, tmp); // expected-error{{first argument to 'work_group_reserve_read_pipe' must be a pipe type}}
sub_group_reserve_write_pipe(p, tmp); // expected-error{{invalid pipe access modifier (expecting write_only)}}
// commit_read/write_pipe
commit_read_pipe(p, rid);
commit_read_pipe(tmp, rid); // expected-error{{first argument to 'commit_read_pipe' must be a pipe type}}
- work_group_commit_read_pipe(p, tmp); // expected-error{{invalid argument type to function 'work_group_commit_read_pipe' (expecting 'reserve_id_t' having 'int')}}
+ work_group_commit_read_pipe(p, tmp); // expected-error{{invalid argument type to function 'work_group_commit_read_pipe' (expecting 'reserve_id_t' having '__private int')}}
sub_group_commit_write_pipe(p, tmp); // expected-error{{invalid pipe access modifier (expecting write_only)}}
}
@@ -41,22 +41,22 @@
write_pipe(tmp, p); // expected-error {{first argument to 'write_pipe' must be a pipe type}}
write_pipe(p); // expected-error {{invalid number of arguments to function: 'write_pipe'}}
write_pipe(p, rid, tmp, ptr);
- write_pipe(p, tmp, tmp, ptr); // expected-error {{invalid argument type to function 'write_pipe' (expecting 'reserve_id_t' having 'int')}}
- write_pipe(p, rid, rid, ptr); // expected-error {{invalid argument type to function 'write_pipe' (expecting 'unsigned int' having 'reserve_id_t')}}
- write_pipe(p, tmp); // expected-error {{invalid argument type to function 'write_pipe' (expecting 'int *' having 'int')}}
+ write_pipe(p, tmp, tmp, ptr); // expected-error {{invalid argument type to function 'write_pipe' (expecting 'reserve_id_t' having '__private int')}}
+ write_pipe(p, rid, rid, ptr); // expected-error {{invalid argument type to function 'write_pipe' (expecting 'unsigned int' having '__private reserve_id_t')}}
+ write_pipe(p, tmp); // expected-error {{invalid argument type to function 'write_pipe' (expecting 'int *' having '__private int')}}
read_pipe(p, ptr); // expected-error {{invalid pipe access modifier (expecting read_only)}}
read_pipe(p, rid, tmp, ptr); // expected-error {{invalid pipe access modifier (expecting read_only)}}
// reserve_read/write_pipe
reserve_write_pipe(p, tmp);
- reserve_write_pipe(p, ptr); // expected-error{{invalid argument type to function 'reserve_write_pipe' (expecting 'unsigned int' having '__global int *')}}
+ reserve_write_pipe(p, ptr); // expected-error{{invalid argument type to function 'reserve_write_pipe' (expecting 'unsigned int' having '__global int *__private')}}
work_group_reserve_write_pipe(tmp, tmp); // expected-error{{first argument to 'work_group_reserve_write_pipe' must be a pipe type}}
sub_group_reserve_read_pipe(p, tmp); // expected-error{{invalid pipe access modifier (expecting read_only)}}
// commit_read/write_pipe
commit_write_pipe(p, rid);
commit_write_pipe(tmp, rid); // expected-error{{first argument to 'commit_write_pipe' must be a pipe type}}
- work_group_commit_write_pipe(p, tmp); // expected-error{{invalid argument type to function 'work_group_commit_write_pipe' (expecting 'reserve_id_t' having 'int')}}
+ work_group_commit_write_pipe(p, tmp); // expected-error{{invalid argument type to function 'work_group_commit_write_pipe' (expecting 'reserve_id_t' having '__private int')}}
sub_group_commit_read_pipe(p, tmp); // expected-error{{invalid pipe access modifier (expecting read_only)}}
}
diff --git a/src/llvm-project/clang/test/SemaOpenCL/invalid-pipes-cl2.0.cl b/src/llvm-project/clang/test/SemaOpenCL/invalid-pipes-cl2.0.cl
index 69fa2b6..2bcefe2 100644
--- a/src/llvm-project/clang/test/SemaOpenCL/invalid-pipes-cl2.0.cl
+++ b/src/llvm-project/clang/test/SemaOpenCL/invalid-pipes-cl2.0.cl
@@ -4,9 +4,9 @@
global pipe int gp; // expected-error {{type '__global read_only pipe int' can only be used as a function parameter in OpenCL}}
global reserve_id_t rid; // expected-error {{the '__global reserve_id_t' type cannot be used to declare a program scope variable}}
-extern pipe write_only int get_pipe(); // expected-error-re{{type '__global write_only pipe int ({{(void)?}})' can only be used as a function parameter in OpenCL}}
+extern pipe write_only int get_pipe(); // expected-error-re{{type '__global write_only pipe int ({{(void)?}})' can only be used as a function parameter in OpenCL}} expected-error{{'write_only' attribute only applies to parameters and typedefs}}
-kernel void test_invalid_reserved_id(reserve_id_t ID) { // expected-error {{'reserve_id_t' cannot be used as the type of a kernel parameter}}
+kernel void test_invalid_reserved_id(reserve_id_t ID) { // expected-error {{'__private reserve_id_t' cannot be used as the type of a kernel parameter}}
}
void test1(pipe int *p) {// expected-error {{pipes packet types cannot be of reference type}}
@@ -16,15 +16,15 @@
void test3(int pipe p) {// expected-error {{cannot combine with previous 'int' declaration specifier}}
}
void test4() {
- pipe int p; // expected-error {{type 'read_only pipe int' can only be used as a function parameter}}
+ pipe int p; // expected-error {{type '__private read_only pipe int' can only be used as a function parameter}}
//TODO: fix parsing of this pipe int (*p);
}
void test5(pipe int p) {
- p+p; // expected-error{{invalid operands to binary expression ('read_only pipe int' and 'read_only pipe int')}}
- p=p; // expected-error{{invalid operands to binary expression ('read_only pipe int' and 'read_only pipe int')}}
- &p; // expected-error{{invalid argument type 'read_only pipe int' to unary expression}}
- *p; // expected-error{{invalid argument type 'read_only pipe int' to unary expression}}
+ p+p; // expected-error{{invalid operands to binary expression ('__private read_only pipe int' and '__private read_only pipe int')}}
+ p=p; // expected-error{{invalid operands to binary expression ('__private read_only pipe int' and '__private read_only pipe int')}}
+ &p; // expected-error{{invalid argument type '__private read_only pipe int' to unary expression}}
+ *p; // expected-error{{invalid argument type '__private read_only pipe int' to unary expression}}
}
typedef pipe int pipe_int_t;
@@ -32,7 +32,7 @@
bool test_id_comprision(void) {
reserve_id_t id1, id2;
- return (id1 == id2); // expected-error {{invalid operands to binary expression ('reserve_id_t' and 'reserve_id_t')}}
+ return (id1 == id2); // expected-error {{invalid operands to binary expression ('__private reserve_id_t' and '__private reserve_id_t')}}
}
// Tests ASTContext::mergeTypes rejects this.
diff --git a/src/llvm-project/clang/test/SemaOpenCL/null_literal.cl b/src/llvm-project/clang/test/SemaOpenCL/null_literal.cl
index 2fb2872..fb0f938 100644
--- a/src/llvm-project/clang/test/SemaOpenCL/null_literal.cl
+++ b/src/llvm-project/clang/test/SemaOpenCL/null_literal.cl
@@ -11,14 +11,14 @@
constant int* ptr3 = NULL;
-constant int* ptr4 = (global void*)0; // expected-error{{initializing '__constant int *' with an expression of type '__global void *' changes address space of pointer}}
+constant int* ptr4 = (global void*)0; // expected-error{{initializing '__constant int *__private' with an expression of type '__global void *' changes address space of pointer}}
#ifdef CL20
// Accept explicitly pointer to generic address space in OpenCL v2.0.
global int* ptr5 = (generic void*)0;
#endif
-global int* ptr6 = (local void*)0; // expected-error{{initializing '__global int *' with an expression of type '__local void *' changes address space of pointer}}
+global int* ptr6 = (local void*)0; // expected-error{{initializing '__global int *__private' with an expression of type '__local void *' changes address space of pointer}}
bool cmp = ptr1 == NULL;
diff --git a/src/llvm-project/clang/test/SemaOpenCL/null_queue.cl b/src/llvm-project/clang/test/SemaOpenCL/null_queue.cl
index 34d1a62..a0b33d4 100644
--- a/src/llvm-project/clang/test/SemaOpenCL/null_queue.cl
+++ b/src/llvm-project/clang/test/SemaOpenCL/null_queue.cl
@@ -4,13 +4,13 @@
void queue_arg(queue_t); // expected-note {{passing argument to parameter here}}
void init() {
- queue_t q1 = 1; // expected-error{{initializing 'queue_t' with an expression of incompatible type 'int'}}
+ queue_t q1 = 1; // expected-error{{initializing '__private queue_t' with an expression of incompatible type 'int'}}
queue_t q = 0;
}
void assign() {
queue_t q2, q3;
- q2 = 5; // expected-error{{assigning to 'queue_t' from incompatible type 'int'}}
+ q2 = 5; // expected-error{{assigning to '__private queue_t' from incompatible type 'int'}}
q3 = 0;
q2 = q3 = 0;
}
@@ -21,7 +21,7 @@
get_default_queue() == 1 && // expected-error{{invalid operands to binary expression ('queue_t' and 'int')}}
q4 == q5 &&
q4 != 0 &&
- q4 != 0.0f; // expected-error{{invalid operands to binary expression ('queue_t' and 'float')}}
+ q4 != 0.0f; // expected-error{{invalid operands to binary expression ('__private queue_t' and 'float')}}
}
void call() {
diff --git a/src/llvm-project/clang/test/SemaOpenCL/numbered-address-space.cl b/src/llvm-project/clang/test/SemaOpenCL/numbered-address-space.cl
index 8a24b3c..ab824ac 100644
--- a/src/llvm-project/clang/test/SemaOpenCL/numbered-address-space.cl
+++ b/src/llvm-project/clang/test/SemaOpenCL/numbered-address-space.cl
@@ -11,7 +11,7 @@
void test_generic_to_numeric_as_implicit_cast() {
generic int* generic_ptr = 0;
- __attribute__((address_space(3))) int *as3_ptr = generic_ptr; // expected-error{{initializing '__attribute__((address_space(3))) int *' with an expression of type '__generic int *' changes address space of pointer}}
+ __attribute__((address_space(3))) int *as3_ptr = generic_ptr; // expected-error{{initializing '__attribute__((address_space(3))) int *__private' with an expression of type '__generic int *__private' changes address space of pointer}}
}
void test_generic_to_numeric_as_explicit_cast() {
@@ -26,6 +26,6 @@
void test_generic_as_to_builtin_parameterimplicit_cast_numeric(__attribute__((address_space(3))) int *as3_ptr, float src) {
generic int* generic_ptr = as3_ptr;
- volatile float result = __builtin_amdgcn_ds_fmaxf(generic_ptr, src, 0, 0, false); // expected-error {{passing '__generic int *' to parameter of type '__local float *' changes address space of pointer}}
+ volatile float result = __builtin_amdgcn_ds_fmaxf(generic_ptr, src, 0, 0, false); // expected-error {{passing '__generic int *__private' to parameter of type '__local float *' changes address space of pointer}}
}
diff --git a/src/llvm-project/clang/test/SemaOpenCL/predefined-expr.cl b/src/llvm-project/clang/test/SemaOpenCL/predefined-expr.cl
index 419e7a9..182c9bd 100644
--- a/src/llvm-project/clang/test/SemaOpenCL/predefined-expr.cl
+++ b/src/llvm-project/clang/test/SemaOpenCL/predefined-expr.cl
@@ -2,7 +2,7 @@
// RUN: %clang_cc1 %s -verify -cl-std=CL2.0
void f() {
- char *f1 = __func__; //expected-error-re{{initializing '{{__generic char|char}} *' with an expression of type 'const __constant char *' changes address space of pointer}}
- constant char *f2 = __func__; //expected-warning{{initializing '__constant char *' with an expression of type 'const __constant char [2]' discards qualifiers}}
+ char *f1 = __func__; //expected-error-re{{initializing '{{__generic|__private}} char *__private' with an expression of type 'const __constant char *' changes address space of pointer}}
+ constant char *f2 = __func__; //expected-warning{{initializing '__constant char *__private' with an expression of type 'const __constant char [2]' discards qualifiers}}
constant const char *f3 = __func__;
}
diff --git a/src/llvm-project/clang/test/SemaOpenCL/queue_t_overload.cl b/src/llvm-project/clang/test/SemaOpenCL/queue_t_overload.cl
index bc3b241..9f0cb84 100644
--- a/src/llvm-project/clang/test/SemaOpenCL/queue_t_overload.cl
+++ b/src/llvm-project/clang/test/SemaOpenCL/queue_t_overload.cl
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 %s -cl-std=CL2.0 -verify -pedantic -fsyntax-only
-void __attribute__((overloadable)) foo(queue_t, __local char *); // expected-note {{candidate function not viable: no known conversion from 'int' to 'queue_t' for 1st argument}} // expected-note {{candidate function}}
-void __attribute__((overloadable)) foo(queue_t, __local float *); // expected-note {{candidate function not viable: no known conversion from 'int' to 'queue_t' for 1st argument}} // expected-note {{candidate function}}
+void __attribute__((overloadable)) foo(queue_t, __local char *); // expected-note {{candidate function not viable: no known conversion from 'int' to '__private queue_t' for 1st argument}} // expected-note {{candidate function}}
+void __attribute__((overloadable)) foo(queue_t, __local float *); // expected-note {{candidate function not viable: no known conversion from 'int' to '__private queue_t' for 1st argument}} // expected-note {{candidate function}}
void kernel ker(__local char *src1, __local float *src2, __global int *src3) {
queue_t q;
diff --git a/src/llvm-project/clang/test/SemaOpenCL/sampler_t.cl b/src/llvm-project/clang/test/SemaOpenCL/sampler_t.cl
index fe9d997..888e973 100644
--- a/src/llvm-project/clang/test/SemaOpenCL/sampler_t.cl
+++ b/src/llvm-project/clang/test/SemaOpenCL/sampler_t.cl
@@ -48,6 +48,9 @@
sampler_t bad(void); //expected-error{{declaring function return value of type 'sampler_t' is not allowed}}
sampler_t global_nonconst_smp = 0; // expected-error {{global sampler requires a const or constant address space qualifier}}
+#ifdef CHECK_SAMPLER_VALUE
+// expected-warning@-2{{sampler initializer has invalid Filter Mode bits}}
+#endif
const sampler_t glb_smp10 = CLK_ADDRESS_CLAMP_TO_EDGE | CLK_NORMALIZED_COORDS_TRUE | CLK_FILTER_LINEAR;
const constant sampler_t glb_smp11 = CLK_ADDRESS_CLAMP_TO_EDGE | CLK_NORMALIZED_COORDS_TRUE | CLK_FILTER_LINEAR;
@@ -62,7 +65,7 @@
}
#if __OPENCL_C_VERSION__ == 200
-void bad(sampler_t*); // expected-error{{pointer to type '__generic sampler_t' is invalid in OpenCL}}
+void bad(sampler_t *); // expected-error{{pointer to type 'sampler_t' is invalid in OpenCL}}
#else
void bad(sampler_t*); // expected-error{{pointer to type 'sampler_t' is invalid in OpenCL}}
#endif
diff --git a/src/llvm-project/clang/test/SemaOpenCL/shifts.cl b/src/llvm-project/clang/test/SemaOpenCL/shifts.cl
index 26f59a5..257f70a 100644
--- a/src/llvm-project/clang/test/SemaOpenCL/shifts.cl
+++ b/src/llvm-project/clang/test/SemaOpenCL/shifts.cl
@@ -45,7 +45,7 @@
// ** Negative tests **
char2 ntest01(char c, char2 s) {
- return c << s; // expected-error {{requested shift is a vector of type 'char2' (vector of 2 'char' values) but the first operand is not a vector ('char')}}
+ return c << s; // expected-error {{requested shift is a vector of type '__private char2' (vector of 2 'char' values) but the first operand is not a vector ('__private char')}}
}
char3 ntest02(char3 c, char2 s) {
diff --git a/src/llvm-project/clang/test/SemaOpenCL/to_addr_builtin.cl b/src/llvm-project/clang/test/SemaOpenCL/to_addr_builtin.cl
index 26389d2..ff2d780 100644
--- a/src/llvm-project/clang/test/SemaOpenCL/to_addr_builtin.cl
+++ b/src/llvm-project/clang/test/SemaOpenCL/to_addr_builtin.cl
@@ -13,7 +13,7 @@
glob = to_global(glob, loc);
#if __OPENCL_C_VERSION__ < CL_VERSION_2_0
// expected-error@-2{{implicit declaration of function 'to_global' is invalid in OpenCL}}
- // expected-warning@-3{{incompatible integer to pointer conversion assigning to '__global int *' from 'int'}}
+ // expected-warning@-3{{incompatible integer to pointer conversion assigning to '__global int *__private' from 'int'}}
#else
// expected-error@-5{{invalid number of arguments to function: 'to_global'}}
#endif
@@ -21,46 +21,46 @@
int x;
glob = to_global(x);
#if __OPENCL_C_VERSION__ < CL_VERSION_2_0
- // expected-warning@-2{{incompatible integer to pointer conversion assigning to '__global int *' from 'int'}}
+ // expected-warning@-2{{incompatible integer to pointer conversion assigning to '__global int *__private' from 'int'}}
#else
// expected-error@-4{{invalid argument x to function: 'to_global', expecting a generic pointer argument}}
#endif
glob = to_global(con);
#if __OPENCL_C_VERSION__ < CL_VERSION_2_0
- // expected-warning@-2{{incompatible integer to pointer conversion assigning to '__global int *' from 'int'}}
+ // expected-warning@-2{{incompatible integer to pointer conversion assigning to '__global int *__private' from 'int'}}
#else
// expected-error@-4{{invalid argument con to function: 'to_global', expecting a generic pointer argument}}
#endif
glob = to_global(con_typedef);
#if __OPENCL_C_VERSION__ < CL_VERSION_2_0
- // expected-warning@-2{{incompatible integer to pointer conversion assigning to '__global int *' from 'int'}}
+ // expected-warning@-2{{incompatible integer to pointer conversion assigning to '__global int *__private' from 'int'}}
#else
// expected-error@-4{{invalid argument con_typedef to function: 'to_global', expecting a generic pointer argument}}
#endif
loc = to_global(glob);
#if __OPENCL_C_VERSION__ < CL_VERSION_2_0
- // expected-warning@-2{{incompatible integer to pointer conversion assigning to '__local int *' from 'int'}}
+ // expected-warning@-2{{incompatible integer to pointer conversion assigning to '__local int *__private' from 'int'}}
#else
- // expected-error@-4{{assigning '__global int *' to '__local int *' changes address space of pointer}}
+ // expected-error@-4{{assigning '__global int *' to '__local int *__private' changes address space of pointer}}
// expected-warning@-5{{passing non-generic address space pointer to to_global may cause dynamic conversion affecting performance}}
#endif
loc = to_private(glob);
#if __OPENCL_C_VERSION__ < CL_VERSION_2_0
// expected-error@-2{{implicit declaration of function 'to_private' is invalid in OpenCL}}
- // expected-warning@-3{{incompatible integer to pointer conversion assigning to '__local int *' from 'int'}}
+ // expected-warning@-3{{incompatible integer to pointer conversion assigning to '__local int *__private' from 'int'}}
#else
- // expected-error@-5{{assigning 'int *' to '__local int *' changes address space of pointer}}
+ // expected-error@-5{{assigning '__private int *' to '__local int *__private' changes address space of pointer}}
// expected-warning@-6{{passing non-generic address space pointer to to_private may cause dynamic conversion affecting performance}}
#endif
loc = to_local(glob);
#if __OPENCL_C_VERSION__ < CL_VERSION_2_0
// expected-error@-2{{implicit declaration of function 'to_local' is invalid in OpenCL}}
- // expected-warning@-3{{incompatible integer to pointer conversion assigning to '__local int *' from 'int'}}
+ // expected-warning@-3{{incompatible integer to pointer conversion assigning to '__local int *__private' from 'int'}}
// expected-note@-4{{did you mean 'to_global'}}
// expected-note@13{{'to_global' declared here}}
#else
@@ -69,15 +69,15 @@
priv = to_global(glob);
#if __OPENCL_C_VERSION__ < CL_VERSION_2_0
- // expected-warning@-2{{incompatible integer to pointer conversion assigning to 'int *' from 'int'}}
+ // expected-warning@-2{{incompatible integer to pointer conversion assigning to '__private int *__private' from 'int'}}
#else
- // expected-error@-4{{assigning '__global int *' to 'int *' changes address space of pointer}}
+ // expected-error@-4{{assigning '__global int *' to '__private int *__private' changes address space of pointer}}
// expected-warning@-5{{passing non-generic address space pointer to to_global may cause dynamic conversion affecting performance}}
#endif
priv = to_private(glob);
#if __OPENCL_C_VERSION__ < CL_VERSION_2_0
- // expected-warning@-2{{incompatible integer to pointer conversion assigning to 'int *' from 'int'}}
+ // expected-warning@-2{{incompatible integer to pointer conversion assigning to '__private int *__private' from 'int'}}
#else
// expected-warning@-4{{passing non-generic address space pointer to to_private may cause dynamic conversion affecting performance}}
#endif
@@ -85,48 +85,48 @@
priv = to_local(glob);
#if __OPENCL_C_VERSION__ < CL_VERSION_2_0
- // expected-warning@-2{{incompatible integer to pointer conversion assigning to 'int *' from 'int'}}
+ // expected-warning@-2{{incompatible integer to pointer conversion assigning to '__private int *__private' from 'int'}}
#else
- // expected-error@-4{{assigning '__local int *' to 'int *' changes address space of pointer}}
+ // expected-error@-4{{assigning '__local int *' to '__private int *__private' changes address space of pointer}}
// expected-warning@-5{{passing non-generic address space pointer to to_local may cause dynamic conversion affecting performance}}
#endif
glob = to_global(glob);
#if __OPENCL_C_VERSION__ < CL_VERSION_2_0
- // expected-warning@-2{{incompatible integer to pointer conversion assigning to '__global int *' from 'int'}}
+ // expected-warning@-2{{incompatible integer to pointer conversion assigning to '__global int *__private' from 'int'}}
#else
// expected-warning@-4{{passing non-generic address space pointer to to_global may cause dynamic conversion affecting performance}}
#endif
glob = to_private(glob);
#if __OPENCL_C_VERSION__ < CL_VERSION_2_0
- // expected-warning@-2{{incompatible integer to pointer conversion assigning to '__global int *' from 'int'}}
+ // expected-warning@-2{{incompatible integer to pointer conversion assigning to '__global int *__private' from 'int'}}
#else
- // expected-error@-4{{assigning 'int *' to '__global int *' changes address space of pointer}}
+ // expected-error@-4{{assigning '__private int *' to '__global int *__private' changes address space of pointer}}
// expected-warning@-5{{passing non-generic address space pointer to to_private may cause dynamic conversion affecting performance}}
#endif
glob = to_local(glob);
#if __OPENCL_C_VERSION__ < CL_VERSION_2_0
- // expected-warning@-2{{incompatible integer to pointer conversion assigning to '__global int *' from 'int'}}
+ // expected-warning@-2{{incompatible integer to pointer conversion assigning to '__global int *__private' from 'int'}}
#else
- // expected-error@-4{{assigning '__local int *' to '__global int *' changes address space of pointer}}
+ // expected-error@-4{{assigning '__local int *' to '__global int *__private' changes address space of pointer}}
// expected-warning@-5{{passing non-generic address space pointer to to_local may cause dynamic conversion affecting performance}}
#endif
global char *glob_c = to_global(loc);
#if __OPENCL_C_VERSION__ < CL_VERSION_2_0
- // expected-warning@-2{{incompatible integer to pointer conversion initializing '__global char *' with an expression of type 'int'}}
+ // expected-warning@-2{{incompatible integer to pointer conversion initializing '__global char *__private' with an expression of type 'int'}}
#else
- // expected-warning@-4{{incompatible pointer types initializing '__global char *' with an expression of type '__global int *'}}
+ // expected-warning@-4{{incompatible pointer types initializing '__global char *__private' with an expression of type '__global int *'}}
// expected-warning@-5{{passing non-generic address space pointer to to_global may cause dynamic conversion affecting performance}}
#endif
glob_wrong_ty = to_global(glob);
#if __OPENCL_C_VERSION__ < CL_VERSION_2_0
- // expected-warning@-2{{incompatible integer to pointer conversion assigning to '__global float *' from 'int'}}
+ // expected-warning@-2{{incompatible integer to pointer conversion assigning to '__global float *__private' from 'int'}}
#else
- // expected-warning@-4{{incompatible pointer types assigning to '__global float *' from '__global int *'}}
+ // expected-warning@-4{{incompatible pointer types assigning to '__global float *__private' from '__global int *'}}
// expected-warning@-5{{passing non-generic address space pointer to to_global may cause dynamic conversion affecting performance}}
#endif
diff --git a/src/llvm-project/clang/test/SemaOpenCL/vec_step.cl b/src/llvm-project/clang/test/SemaOpenCL/vec_step.cl
index d83ebf1..0a2f6ef 100644
--- a/src/llvm-project/clang/test/SemaOpenCL/vec_step.cl
+++ b/src/llvm-project/clang/test/SemaOpenCL/vec_step.cl
@@ -26,7 +26,7 @@
int res11[vec_step(int16) == 16 ? 1 : -1];
int res12[vec_step(void) == 1 ? 1 : -1];
- int res13 = vec_step(*incomplete1); // expected-error {{'vec_step' requires built-in scalar or vector type, 'struct S' invalid}}
- int res14 = vec_step(int16*); // expected-error {{'vec_step' requires built-in scalar or vector type, 'int16 *' invalid}}
+ int res13 = vec_step(*incomplete1); // expected-error {{'vec_step' requires built-in scalar or vector type, '__private struct S' invalid}}
+ int res14 = vec_step(int16*); // expected-error {{'vec_step' requires built-in scalar or vector type, '__private int16 *' invalid}}
int res15 = vec_step(void(void)); // expected-error {{'vec_step' requires built-in scalar or vector type, 'void (void)' invalid}}
}
diff --git a/src/llvm-project/clang/test/SemaOpenCL/vector_conv_invalid.cl b/src/llvm-project/clang/test/SemaOpenCL/vector_conv_invalid.cl
index e32d84f..a396809 100644
--- a/src/llvm-project/clang/test/SemaOpenCL/vector_conv_invalid.cl
+++ b/src/llvm-project/clang/test/SemaOpenCL/vector_conv_invalid.cl
@@ -7,7 +7,7 @@
void vector_conv_invalid(const global int4 *const_global_ptr) {
uint4 u = (uint4)(1);
- int4 i = u; // expected-error{{initializing 'int4' (vector of 4 'int' values) with an expression of incompatible type 'uint4' (vector of 4 'unsigned int' values)}}
+ int4 i = u; // expected-error{{initializing '__private int4' (vector of 4 'int' values) with an expression of incompatible type '__private uint4' (vector of 4 'unsigned int' values)}}
int4 e = (int4)u; // expected-error{{invalid conversion between ext-vector type 'int4' (vector of 4 'int' values) and 'uint4' (vector of 4 'unsigned int' values)}}
uint3 u4 = (uint3)u; // expected-error{{invalid conversion between ext-vector type 'uint3' (vector of 3 'unsigned int' values) and 'uint4' (vector of 4 'unsigned int' values)}}
@@ -16,7 +16,7 @@
e = (constant int4)i;
e = (private int4)i;
- private int4 *private_ptr = (const private int4 *)const_global_ptr; // expected-error{{casting 'const __global int4 *' to type 'const int4 *' changes address space of pointer}}
- global int4 *global_ptr = const_global_ptr; // expected-warning {{initializing '__global int4 *' with an expression of type 'const __global int4 *' discards qualifiers}}
+ private int4 *private_ptr = (const private int4 *)const_global_ptr; // expected-error{{casting 'const __global int4 *' to type 'const __private int4 *' changes address space of pointer}}
+ global int4 *global_ptr = const_global_ptr; // expected-warning {{initializing '__global int4 *__private' with an expression of type 'const __global int4 *__private' discards qualifiers}}
global_ptr = (global int4 *)const_global_ptr;
}
diff --git a/src/llvm-project/clang/test/SemaOpenCLCXX/address-space-castoperators.cl b/src/llvm-project/clang/test/SemaOpenCLCXX/address-space-castoperators.cl
new file mode 100644
index 0000000..d61a9a7
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaOpenCLCXX/address-space-castoperators.cl
@@ -0,0 +1,12 @@
+//RUN: %clang_cc1 %s -cl-std=clc++ -pedantic -ast-dump -verify | FileCheck %s
+
+void nester_ptr() {
+ local int * * locgen;
+ constant int * * congen;
+ int * * gengen;
+
+ gengen = const_cast<int**>(locgen); //expected-error{{const_cast from '__local int *__generic *' to '__generic int *__generic *' is not allowed}}
+ gengen = static_cast<int**>(locgen); //expected-error{{static_cast from '__local int *__generic *' to '__generic int *__generic *' is not allowed}}
+// CHECK-NOT: AddressSpaceConversion
+ gengen = reinterpret_cast<int**>(locgen); //expected-warning{{reinterpret_cast from '__local int *__generic *' to '__generic int *__generic *' changes address space of nested pointers}}
+}
diff --git a/src/llvm-project/clang/test/SemaOpenCLCXX/address-space-cond.cl b/src/llvm-project/clang/test/SemaOpenCLCXX/address-space-cond.cl
new file mode 100644
index 0000000..8090598
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaOpenCLCXX/address-space-cond.cl
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 %s -cl-std=clc++ -pedantic -verify
+
+namespace PointerRvalues {
+
+void f(__global int *__constant *a, const __global int *__constant *b) {
+ using T = decltype(true ? +a : +b);
+ using T = const __global int *const __constant *;
+}
+
+void g(const __global int *a, __generic int *b) {
+ using T = decltype(true ? +a : +b);
+ using T = const __generic int *;
+}
+
+void h(const __global int **a, __generic int **b) {
+ using T = decltype(true ? +a : +b); // expected-error {{incompatible operand types}}
+}
+
+void i(__global int **a, __generic int **b) {
+ using T = decltype(true ? +a : +b); // expected-error {{incompatible operand types}}
+}
+
+}
diff --git a/src/llvm-project/clang/test/SemaOpenCLCXX/address-space-deduction.cl b/src/llvm-project/clang/test/SemaOpenCLCXX/address-space-deduction.cl
index ac6b2ca..6a81a8b 100644
--- a/src/llvm-project/clang/test/SemaOpenCLCXX/address-space-deduction.cl
+++ b/src/llvm-project/clang/test/SemaOpenCLCXX/address-space-deduction.cl
@@ -30,8 +30,8 @@
template <class T>
struct x1 {
-//CHECK: -CXXMethodDecl {{.*}} operator= 'x1<T> &(const x1<T> &){{( __attribute__.*)?}} __generic'
-//CHECK: -CXXMethodDecl {{.*}} operator= '__generic x1<int> &(const __generic x1<int> &){{( __attribute__.*)?}} __generic'
+//CHECK: -CXXMethodDecl {{.*}} operator= 'x1<T> &(const x1<T> &__private){{( __attribute__.*)?}} __generic'
+//CHECK: -CXXMethodDecl {{.*}} operator= '__generic x1<int> &(const __generic x1<int> &__private){{( __attribute__.*)?}} __generic'
x1<T>& operator=(const x1<T>& xx) {
y = xx.y;
return *this;
@@ -41,8 +41,8 @@
template <class T>
struct x2 {
-//CHECK: -CXXMethodDecl {{.*}} foo 'void (x1<T> *){{( __attribute__.*)?}} __generic'
-//CHECK: -CXXMethodDecl {{.*}} foo 'void (__generic x1<int> *){{( __attribute__.*)?}} __generic'
+//CHECK: -CXXMethodDecl {{.*}} foo 'void (x1<T> *__private){{( __attribute__.*)?}} __generic'
+//CHECK: -CXXMethodDecl {{.*}} foo 'void (__generic x1<int> *__private){{( __attribute__.*)?}} __generic'
void foo(x1<T>* xx) {
m[0] = *xx;
}
@@ -57,43 +57,55 @@
template <typename T>
class x3 : public T {
public:
- //CHECK: -CXXConstructorDecl {{.*}} x3<T> 'void (const x3<T> &){{( __attribute__.*)?}} __generic'
+ //CHECK: -CXXConstructorDecl {{.*}} x3<T> 'void (const x3<T> &__private){{( __attribute__.*)?}} __generic'
x3(const x3 &t);
};
-//CHECK: -CXXConstructorDecl {{.*}} x3<T> 'void (const x3<T> &){{( __attribute__.*)?}} __generic'
+//CHECK: -CXXConstructorDecl {{.*}} x3<T> 'void (const x3<T> &__private){{( __attribute__.*)?}} __generic'
template <typename T>
x3<T>::x3(const x3<T> &t) {}
template <class T>
-T xxx(T *in) {
+T xxx(T *in1, T in2) {
// This pointer can't be deduced to generic because addr space
// will be taken from the template argument.
- //CHECK: `-VarDecl {{.*}} i 'T *' cinit
- T *i = in;
+ //CHECK: `-VarDecl {{.*}} '__private T *__private' cinit
+ T *i = in1;
T ii;
+ __private T *ptr = ⅈ
+ ptr = &in2;
return *i;
}
__kernel void test() {
int foo[10];
- xxx(&foo[0]);
+ xxx<__private int>(&foo[0], foo[0]);
+ // FIXME: Template param deduction fails here because
+ // temporaries are not in the __private address space.
+ // It is probably reasonable to put them in __private
+ // considering that stack and function params are
+ // implicitly in __private.
+ // However, if temporaries are left in default addr
+ // space we should at least pretty print the __private
+ // addr space. Otherwise diagnostic apprears to be
+ // confusing.
+ //xxx(&foo[0], foo[0]);
}
// Addr space for pointer/reference to an array
-//CHECK: FunctionDecl {{.*}} t1 'void (const __generic float (&)[2])'
+//CHECK: FunctionDecl {{.*}} t1 'void (const float (__generic &__private)[2])'
void t1(const float (&fYZ)[2]);
-//CHECK: FunctionDecl {{.*}} t2 'void (const __generic float (*)[2])'
+//CHECK: FunctionDecl {{.*}} t2 'void (const float (__generic *__private)[2])'
void t2(const float (*fYZ)[2]);
-//CHECK: FunctionDecl {{.*}} t3 'void (__generic float (((*)))[2])'
+//CHECK: FunctionDecl {{.*}} t3 'void (float (((__generic *__private)))[2])'
void t3(float(((*fYZ)))[2]);
-//CHECK: FunctionDecl {{.*}} t4 'void (__generic float (((*__generic *)))[2])'
+//CHECK: FunctionDecl {{.*}} t4 'void (float (((__generic *__generic *__private)))[2])'
void t4(float(((**fYZ)))[2]);
-//CHECK: FunctionDecl {{.*}} t5 'void (__generic float (*__generic (*))[2])'
+//CHECK: FunctionDecl {{.*}} t5 'void (float (__generic *(__generic *__private))[2])'
void t5(float (*(*fYZ))[2]);
__kernel void k() {
__local float x[2];
- __local float(*p)[2];
+ float(*p)[2];
t1(x);
t2(&x);
t3(&x);
diff --git a/src/llvm-project/clang/test/SemaOpenCLCXX/address-space-lambda.cl b/src/llvm-project/clang/test/SemaOpenCLCXX/address-space-lambda.cl
new file mode 100644
index 0000000..e953817
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaOpenCLCXX/address-space-lambda.cl
@@ -0,0 +1,53 @@
+//RUN: %clang_cc1 %s -cl-std=clc++ -pedantic -ast-dump -verify | FileCheck %s
+
+//CHECK: CXXMethodDecl {{.*}} constexpr operator() 'int (__private int){{.*}} const __generic'
+auto glambda = [](auto a) { return a; };
+
+__kernel void test() {
+ int i;
+//CHECK: CXXMethodDecl {{.*}} constexpr operator() 'void () {{.*}}const __generic'
+ auto llambda = [&]() {i++;};
+ llambda();
+ glambda(1);
+ // Test lambda with default parameters
+//CHECK: CXXMethodDecl {{.*}} constexpr operator() 'void () {{.*}}const __generic'
+ [&] {i++;} ();
+ __constant auto err = [&]() {}; //expected-note{{candidate function not viable: 'this' object is in address space '__constant', but method expects object in address space '__generic'}}
+ err(); //expected-error-re{{no matching function for call to object of type '__constant (lambda at {{.*}})'}}
+ // FIXME: There is very limited addr space functionality
+ // we can test when taking lambda type from the object.
+ // The limitation is due to addr spaces being added to all
+ // objects in OpenCL. Once we add metaprogramming utility
+ // for removing address spaces from a type we can enhance
+ // testing here.
+ (*(__constant decltype(llambda) *)nullptr)(); //expected-error{{multiple address spaces specified for type}}
+ (*(decltype(llambda) *)nullptr)();
+}
+
+__kernel void test_qual() {
+//CHECK: |-CXXMethodDecl {{.*}} constexpr operator() 'void () {{.*}}const __private'
+ auto priv1 = []() __private {};
+ priv1();
+//CHECK: |-CXXMethodDecl {{.*}} constexpr operator() 'void () {{.*}}const __generic'
+ auto priv2 = []() __generic {};
+ priv2();
+ auto priv3 = []() __global {}; //expected-note{{candidate function not viable: 'this' object is in address space '__private', but method expects object in address space '__global'}} //expected-note{{conversion candidate of type 'void (*)()'}}
+ priv3(); //expected-error{{no matching function for call to object of type}}
+
+ __constant auto const1 = []() __private{}; //expected-note{{candidate function not viable: 'this' object is in address space '__constant', but method expects object in address space '__private'}} //expected-note{{conversion candidate of type 'void (*)()'}}
+ const1(); //expected-error{{no matching function for call to object of type '__constant (lambda at}}
+ __constant auto const2 = []() __generic{}; //expected-note{{candidate function not viable: 'this' object is in address space '__constant', but method expects object in address space '__generic'}} //expected-note{{conversion candidate of type 'void (*)()'}}
+ const2(); //expected-error{{no matching function for call to object of type '__constant (lambda at}}
+//CHECK: |-CXXMethodDecl {{.*}} constexpr operator() 'void () {{.*}}const __constant'
+ __constant auto const3 = []() __constant{};
+ const3();
+
+ [&] () __global {} (); //expected-error{{no matching function for call to object of type '(lambda at}} expected-note{{candidate function not viable: 'this' object is in default address space, but method expects object in address space '__global'}}
+ [&] () __private {} (); //expected-error{{no matching function for call to object of type '(lambda at}} expected-note{{candidate function not viable: 'this' object is in default address space, but method expects object in address space '__private'}}
+
+ [&] __private {} (); //expected-error{{lambda requires '()' before attribute specifier}} expected-error{{expected body of lambda expression}}
+
+ [&] () mutable __private {} ();
+ [&] () __private mutable {} (); //expected-error{{expected body of lambda expression}}
+}
+
diff --git a/src/llvm-project/clang/test/SemaOpenCLCXX/address-space-of-this-class-scope.cl b/src/llvm-project/clang/test/SemaOpenCLCXX/address-space-of-this-class-scope.cl
index 1c0cb37..86d839d 100644
--- a/src/llvm-project/clang/test/SemaOpenCLCXX/address-space-of-this-class-scope.cl
+++ b/src/llvm-project/clang/test/SemaOpenCLCXX/address-space-of-this-class-scope.cl
@@ -7,8 +7,8 @@
};
void bar(__local C*);
-// expected-note@-1{{candidate function not viable: address space mismatch in 1st argument ('decltype(this)' (aka '__global C *')), parameter type must be '__local C *'}}
-// expected-note@-2{{candidate function not viable: address space mismatch in 1st argument ('decltype(this)' (aka 'C *')), parameter type must be '__local C *'}}
+// expected-note@-1{{candidate function not viable: cannot pass pointer to address space '__global' as a pointer to address space '__local' in 1st argument}}
+// expected-note@-2{{candidate function not viable: cannot pass pointer to default address space as a pointer to address space '__local' in 1st argument}}
__global C Glob;
void foo(){
diff --git a/src/llvm-project/clang/test/SemaOpenCLCXX/address-space-references.cl b/src/llvm-project/clang/test/SemaOpenCLCXX/address-space-references.cl
index a6c7c84..068318d 100644
--- a/src/llvm-project/clang/test/SemaOpenCLCXX/address-space-references.cl
+++ b/src/llvm-project/clang/test/SemaOpenCLCXX/address-space-references.cl
@@ -13,3 +13,16 @@
void foo() {
bar(1) // expected-error{{binding reference of type 'const __global unsigned int' to value of type 'int' changes address space}}
}
+
+// Test addr space conversion with nested pointers
+
+extern void nestptr(int *&); // expected-note {{candidate function not viable: no known conversion from '__global int *__private' to '__generic int *__generic &__private' for 1st argument}}
+extern void nestptr_const(int * const &); // expected-note {{candidate function not viable: cannot pass pointer to address space '__constant' as a pointer to address space '__generic' in 1st argument}}
+int test_nestptr(__global int *glob, __constant int *cons, int* gen) {
+ nestptr(glob); // expected-error{{no matching function for call to 'nestptr'}}
+ // Addr space conversion first occurs on a temporary.
+ nestptr_const(glob);
+ // No legal conversion between disjoint addr spaces.
+ nestptr_const(cons); // expected-error{{no matching function for call to 'nestptr_const'}}
+ return *(*cons ? glob : gen);
+}
diff --git a/src/llvm-project/clang/test/SemaOpenCLCXX/address-space-templates.cl b/src/llvm-project/clang/test/SemaOpenCLCXX/address-space-templates.cl
index 0acc514..6b304d2 100644
--- a/src/llvm-project/clang/test/SemaOpenCLCXX/address-space-templates.cl
+++ b/src/llvm-project/clang/test/SemaOpenCLCXX/address-space-templates.cl
@@ -19,7 +19,7 @@
template <typename T>
void foo3() {
- __private T ii; // expected-error{{conflicting address space qualifiers are provided between types 'T' and '__global int'}}
+ __private T ii; // expected-error{{conflicting address space qualifiers are provided between types '__private T' and '__global int'}}
}
void bar() {
diff --git a/src/llvm-project/clang/test/SemaOpenCLCXX/addrspace-auto.cl b/src/llvm-project/clang/test/SemaOpenCLCXX/addrspace-auto.cl
new file mode 100644
index 0000000..2860237
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaOpenCLCXX/addrspace-auto.cl
@@ -0,0 +1,35 @@
+//RUN: %clang_cc1 %s -cl-std=clc++ -pedantic -ast-dump -verify | FileCheck %s
+
+__constant int i = 1;
+//CHECK: |-VarDecl {{.*}} ai '__global int':'__global int'
+auto ai = i;
+
+kernel void test() {
+ int i;
+ //CHECK: VarDecl {{.*}} ai '__private int':'__private int'
+ auto ai = i;
+
+ constexpr int c = 1;
+ //CHECK: VarDecl {{.*}} used cai '__constant int':'__constant int'
+ __constant auto cai = c;
+ //CHECK: VarDecl {{.*}} aii '__private int':'__private int'
+ auto aii = cai;
+
+ //CHECK: VarDecl {{.*}} ref '__private int &__private'
+ auto &ref = i;
+ //CHECK: VarDecl {{.*}} ptr '__private int *__private'
+ auto *ptr = &i;
+ //CHECK: VarDecl {{.*}} ref_c '__constant int &__private'
+ auto &ref_c = cai;
+
+ //CHECK: VarDecl {{.*}} ptrptr '__private int *__generic *__private'
+ auto **ptrptr = &ptr;
+ //CHECK: VarDecl {{.*}} refptr '__private int *__generic &__private'
+ auto *&refptr = ptr;
+
+ //CHECK: VarDecl {{.*}} invalid gref '__global auto &__private'
+ __global auto &gref = i; //expected-error{{variable 'gref' with type '__global auto &__private' has incompatible initializer of type '__private int'}}
+ __local int *ptr_l;
+ //CHECK: VarDecl {{.*}} invalid gptr '__global auto *__private'
+ __global auto *gptr = ptr_l; //expected-error{{variable 'gptr' with type '__global auto *__private' has incompatible initializer of type '__local int *__private'}}
+}
diff --git a/src/llvm-project/clang/test/SemaOpenCLCXX/restricted.cl b/src/llvm-project/clang/test/SemaOpenCLCXX/restricted.cl
index 3487285..c00c634 100644
--- a/src/llvm-project/clang/test/SemaOpenCLCXX/restricted.cl
+++ b/src/llvm-project/clang/test/SemaOpenCLCXX/restricted.cl
@@ -31,11 +31,15 @@
// Test storage class qualifiers.
__constant _Thread_local int a = 1;
// expected-error@-1 {{C++ for OpenCL version 1.0 does not support the '_Thread_local' storage class specifier}}
+// expected-warning@-2 {{'_Thread_local' is a C11 extension}}
+// expected-error@-3 {{thread-local storage is not supported for the current target}}
__constant __thread int b = 2;
// expected-error@-1 {{C++ for OpenCL version 1.0 does not support the '__thread' storage class specifier}}
+// expected-error@-2 {{thread-local storage is not supported for the current target}}
kernel void test_storage_classes() {
register int x;
// expected-error@-1 {{C++ for OpenCL version 1.0 does not support the 'register' storage class specifier}}
thread_local int y;
// expected-error@-1 {{C++ for OpenCL version 1.0 does not support the 'thread_local' storage class specifier}}
+ // expected-error@-2 {{thread-local storage is not supported for the current target}}
}
diff --git a/src/llvm-project/clang/test/SemaSYCL/kernel-attribute-on-non-sycl.cpp b/src/llvm-project/clang/test/SemaSYCL/kernel-attribute-on-non-sycl.cpp
new file mode 100644
index 0000000..05b7d32
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaSYCL/kernel-attribute-on-non-sycl.cpp
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -std=c++11 -fsyntax-only -fsycl-is-device -verify %s
+// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify -x c++ %s
+
+#ifndef __SYCL_DEVICE_ONLY__
+// expected-warning@+7 {{'sycl_kernel' attribute ignored}}
+// expected-warning@+8 {{'sycl_kernel' attribute ignored}}
+#else
+// expected-no-diagnostics
+#endif
+
+template <typename T, typename A, int B>
+__attribute__((sycl_kernel)) void foo(T P);
+template <typename T, typename A, int B>
+[[clang::sycl_kernel]] void foo1(T P);
diff --git a/src/llvm-project/clang/test/SemaSYCL/kernel-attribute.cpp b/src/llvm-project/clang/test/SemaSYCL/kernel-attribute.cpp
new file mode 100644
index 0000000..84ba69f
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaSYCL/kernel-attribute.cpp
@@ -0,0 +1,44 @@
+// RUN: %clang_cc1 -std=c++11 -fsyntax-only -fsycl-is-device -verify %s
+
+// Only function templates
+[[clang::sycl_kernel]] int gv2 = 0; // expected-warning {{'sycl_kernel' attribute only applies to function templates}}
+__attribute__((sycl_kernel)) int gv3 = 0; // expected-warning {{'sycl_kernel' attribute only applies to function templates}}
+
+__attribute__((sycl_kernel)) void foo(); // expected-warning {{'sycl_kernel' attribute only applies to function templates}}
+[[clang::sycl_kernel]] void foo1(); // expected-warning {{'sycl_kernel' attribute only applies to function templates}}
+
+// Attribute takes no arguments
+template <typename T, typename A>
+__attribute__((sycl_kernel(1))) void foo(T P); // expected-error {{'sycl_kernel' attribute takes no arguments}}
+template <typename T, typename A, int I>
+[[clang::sycl_kernel(1)]] void foo1(T P);// expected-error {{'sycl_kernel' attribute takes no arguments}}
+
+// At least two template parameters
+template <typename T>
+__attribute__((sycl_kernel)) void foo(T P); // expected-warning {{'sycl_kernel' attribute only applies to a function template with at least two template parameters}}
+template <typename T>
+[[clang::sycl_kernel]] void foo1(T P); // expected-warning {{'sycl_kernel' attribute only applies to a function template with at least two template parameters}}
+
+// First two template parameters cannot be non-type template parameters
+template <typename T, int A>
+__attribute__((sycl_kernel)) void foo(T P); // expected-warning {{template parameter of a function template with the 'sycl_kernel' attribute cannot be a non-type template parameter}}
+template <int A, typename T>
+[[clang::sycl_kernel]] void foo1(T P); // expected-warning {{template parameter of a function template with the 'sycl_kernel' attribute cannot be a non-type template parameter}}
+
+// Must return void
+template <typename T, typename A>
+__attribute__((sycl_kernel)) int foo(T P); // expected-warning {{function template with 'sycl_kernel' attribute must have a 'void' return type}}
+template <typename T, typename A>
+[[clang::sycl_kernel]] int foo1(T P); // expected-warning {{function template with 'sycl_kernel' attribute must have a 'void' return type}}
+
+// Must take at least one argument
+template <typename T, typename A>
+__attribute__((sycl_kernel)) void foo(); // expected-warning {{function template with 'sycl_kernel' attribute must have a single parameter}}
+template <typename T, typename A>
+[[clang::sycl_kernel]] void foo1(T t, A a); // expected-warning {{function template with 'sycl_kernel' attribute must have a single parameter}}
+
+// No diagnostics
+template <typename T, typename A>
+__attribute__((sycl_kernel)) void foo(T P);
+template <typename T, typename A, int I>
+[[clang::sycl_kernel]] void foo1(T P);
diff --git a/src/llvm-project/clang/test/SemaTemplate/address_space-dependent.cpp b/src/llvm-project/clang/test/SemaTemplate/address_space-dependent.cpp
index f3d2f3c..bab6ca5 100644
--- a/src/llvm-project/clang/test/SemaTemplate/address_space-dependent.cpp
+++ b/src/llvm-project/clang/test/SemaTemplate/address_space-dependent.cpp
@@ -43,7 +43,7 @@
template <long int I>
void tooBig() {
- __attribute__((address_space(I))) int *bounds; // expected-error {{address space is larger than the maximum supported (8388598)}}
+ __attribute__((address_space(I))) int *bounds; // expected-error {{address space is larger than the maximum supported (8388595)}}
}
template <long int I>
@@ -101,7 +101,7 @@
car<1, 2, 3>(); // expected-note {{in instantiation of function template specialization 'car<1, 2, 3>' requested here}}
HasASTemplateFields<1> HASTF;
neg<-1>(); // expected-note {{in instantiation of function template specialization 'neg<-1>' requested here}}
- correct<0x7FFFF6>();
+ correct<0x7FFFF3>();
tooBig<8388650>(); // expected-note {{in instantiation of function template specialization 'tooBig<8388650>' requested here}}
__attribute__((address_space(1))) char *x;
diff --git a/src/llvm-project/clang/test/SemaTemplate/alias-templates.cpp b/src/llvm-project/clang/test/SemaTemplate/alias-templates.cpp
index 240a6ee..80678bf 100644
--- a/src/llvm-project/clang/test/SemaTemplate/alias-templates.cpp
+++ b/src/llvm-project/clang/test/SemaTemplate/alias-templates.cpp
@@ -77,14 +77,12 @@
return i + f1<Ts...>(is...);
}
- // FIXME: This note is technically correct, but could be better. We
- // should really say that we couldn't infer template argument 'Ts'.
template<typename ...Ts>
- void f2(U<Ts> ...is) { } // expected-note {{requires 0 arguments, but 1 was provided}}
+ void f2(U<Ts> ...is) { } // expected-note {{deduced incomplete pack <(no value)> for template parameter 'Ts'}}
template<typename...> struct type_tuple {};
template<typename ...Ts>
- void f3(type_tuple<Ts...>, U<Ts> ...is) {} // expected-note {{requires 4 arguments, but 3 were provided}}
+ void f3(type_tuple<Ts...>, U<Ts> ...is) {} // expected-note {{deduced packs of different lengths for parameter 'Ts' (<void, void, void> vs. <(no value), (no value)>)}}
void g() {
f1(U<void>()); // expected-error {{no match}}
diff --git a/src/llvm-project/clang/test/SemaTemplate/cxx1z-using-declaration.cpp b/src/llvm-project/clang/test/SemaTemplate/cxx1z-using-declaration.cpp
index 87ca748..ba5918c 100644
--- a/src/llvm-project/clang/test/SemaTemplate/cxx1z-using-declaration.cpp
+++ b/src/llvm-project/clang/test/SemaTemplate/cxx1z-using-declaration.cpp
@@ -16,7 +16,7 @@
}
// Test using non-type members from pack of base classes.
-template<typename ...T> struct A : T... { // expected-note 2{{candidate}}
+template<typename ...T> struct A : T... {
using T::T ...; // expected-note 2{{inherited here}}
using T::operator() ...;
using T::operator T* ...;
@@ -41,7 +41,7 @@
Y(int, int);
void operator()(int, int);
operator Y *();
- void h(int, int); // expected-note {{not viable}}
+ void h(int, int);
};
struct Z {
Z();
@@ -177,14 +177,14 @@
};
struct B {
template<typename> struct X {
- void f(int, int); // expected-note {{declared here}} expected-note {{not viable}}
+ void f(int, int); // expected-note {{declared here}}
using type = int;
};
};
struct C {
template<typename> struct X {
void f(int); // expected-note {{candidate}}
- void f(int, int); // expected-note {{not viable}}
+ void f(int, int);
using type = int;
};
};
diff --git a/src/llvm-project/clang/test/SemaTemplate/cxx2a-constraint-caching.cpp b/src/llvm-project/clang/test/SemaTemplate/cxx2a-constraint-caching.cpp
new file mode 100644
index 0000000..aa0ad94
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaTemplate/cxx2a-constraint-caching.cpp
@@ -0,0 +1,34 @@
+// RUN: %clang_cc1 -std=c++2a -verify %s
+// RUN: %clang_cc1 -std=c++2a -verify %s -fno-concept-satisfaction-caching -DNO_CACHE
+// expected-no-diagnostics
+
+template<typename T>
+concept C = (f(T()), true);
+
+template<typename T>
+constexpr bool foo() { return false; }
+
+template<typename T>
+ requires (f(T()), true)
+constexpr bool foo() requires (f(T()), true) { return true; }
+
+namespace a {
+ struct A {};
+ void f(A a);
+}
+
+static_assert(C<a::A>);
+static_assert(foo<a::A>());
+
+namespace a {
+ // This makes calls to f ambiguous, but the second check will still succeed
+ // because the constraint satisfaction results are cached.
+ void f(A a, int = 2);
+}
+#ifdef NO_CACHE
+static_assert(!C<a::A>);
+static_assert(!foo<a::A>());
+#else
+static_assert(C<a::A>);
+static_assert(foo<a::A>());
+#endif
\ No newline at end of file
diff --git a/src/llvm-project/clang/test/SemaTemplate/cxx2a-constraint-exprs.cpp b/src/llvm-project/clang/test/SemaTemplate/cxx2a-constraint-exprs.cpp
new file mode 100644
index 0000000..5a1c919
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaTemplate/cxx2a-constraint-exprs.cpp
@@ -0,0 +1,53 @@
+// RUN: %clang_cc1 -std=c++2a -verify %s
+
+// Make sure constraint expressions are unevaluated before being substituted
+// into during satisfaction checking.
+
+template<typename T> constexpr bool f = T::value;
+// expected-error@-1 4{{type}}
+
+namespace unevaluated {
+ template<typename T> concept Foo = false && f<int>;
+ bool k = Foo<int>;
+ template<typename T> requires false && f<int> struct S {};
+ // expected-note@-1{{because}}
+ using s = S<int>; // expected-error {{constraints not satisfied}}
+ template<typename T> void foo() requires false && f<int> { };
+ // expected-note@-1{{because}} expected-note@-1{{candidate template ignored}}
+ int a = (foo<int>(), 0); // expected-error{{no matching function}}
+ template<typename T> void bar() requires requires { requires false && f<int>; } { };
+ // expected-note@-1{{because}} expected-note@-1{{candidate template ignored}}
+ int b = (bar<int>(), 0); // expected-error{{no matching function}}
+ template<typename T> struct M { static void foo() requires false && f<int> { }; };
+ // expected-note@-1{{because}}
+ int c = (M<int>::foo(), 0);
+ // expected-error@-1{{invalid reference to function 'foo': constraints not satisfied}}
+}
+
+namespace constant_evaluated {
+ template<typename T> requires f<int[0]> struct S {};
+ // expected-note@-1{{in instantiation of}} expected-note@-1{{while substituting}} \
+ expected-error@-1{{substitution into constraint expression resulted in a non-constant expression}} \
+ expected-note@-1{{subexpression not valid}}
+ using s = S<int>;
+ // expected-note@-1 2{{while checking}}
+ template<typename T> void foo() requires f<int[1]> { };
+ // expected-note@-1{{in instantiation}} expected-note@-1{{while substituting}} \
+ expected-note@-1{{candidate template ignored}} expected-note@-1{{subexpression not valid}} \
+ expected-error@-1{{substitution into constraint expression resulted in a non-constant expression}}
+ int a = (foo<int>(), 0);
+ // expected-note@-1 2{{while checking}} expected-error@-1{{no matching function}} \
+ expected-note@-1 2{{in instantiation}}
+ template<typename T> void bar() requires requires { requires f<int[2]>; } { };
+ // expected-note@-1{{in instantiation}} expected-note@-1{{subexpression not valid}} \
+ expected-note@-1{{while substituting}} \
+ expected-error@-1{{substitution into constraint expression resulted in a non-constant expression}} \
+ expected-note@-1 2{{while checking the satisfaction of nested requirement}}
+ int b = (bar<int>(), 0);
+ template<typename T> struct M { static void foo() requires f<int[3]> { }; };
+ // expected-note@-1{{in instantiation}} expected-note@-1{{subexpression not valid}} \
+ expected-note@-1{{while substituting}} \
+ expected-error@-1{{substitution into constraint expression resulted in a non-constant expression}}
+ int c = (M<int>::foo(), 0);
+ // expected-note@-1 2{{while checking}}
+}
diff --git a/src/llvm-project/clang/test/SemaTemplate/deduction.cpp b/src/llvm-project/clang/test/SemaTemplate/deduction.cpp
index be86f18..5218543 100644
--- a/src/llvm-project/clang/test/SemaTemplate/deduction.cpp
+++ b/src/llvm-project/clang/test/SemaTemplate/deduction.cpp
@@ -365,7 +365,7 @@
int test(ExtraArgs..., unsigned vla_size, const char *input);
int n = test(0, "");
- template <typename... T> void i(T..., int, T..., ...); // expected-note 5{{deduced conflicting}}
+ template <typename... T> void i(T..., int, T..., ...); // expected-note 5{{deduced packs of different lengths}}
void j() {
i(0);
i(0, 1); // expected-error {{no match}}
@@ -381,7 +381,7 @@
// parameter against the first argument, then passing the first argument
// through the first parameter.
template<typename... T> struct X { X(int); operator int(); };
- template<typename... T> void p(T..., X<T...>, ...); // expected-note {{deduced conflicting}}
+ template<typename... T> void p(T..., X<T...>, ...); // expected-note {{deduced packs of different lengths for parameter 'T' (<> vs. <int>)}}
void q() { p(X<int>(0), 0); } // expected-error {{no match}}
struct A {
@@ -539,3 +539,45 @@
#endif
}
}
+
+namespace designators {
+ template<typename T, int N> constexpr int f(T (&&)[N]) { return N; } // expected-note 2{{couldn't infer template argument 'T'}}
+ static_assert(f({1, 2, [20] = 3}) == 3, ""); // expected-error {{no matching function}} expected-warning 2{{C99}} expected-note {{}}
+
+ static_assert(f({.a = 1, .b = 2}) == 3, ""); // expected-error {{no matching function}}
+}
+
+namespace nested_packs {
+ template<typename ...T, typename ...U> void f(T (*...f)(U...)); // expected-note {{deduced packs of different lengths for parameter 'U' (<> vs. <int>)}}
+ void g() { f(g); f(g, g); f(g, g, g); }
+ void h(int) { f(h); f(h, h); f(h, h, h); }
+ void i() { f(g, h); } // expected-error {{no matching function}}
+
+#if __cplusplus >= 201703L
+ template<auto ...A> struct Q {};
+ template<typename ...T, T ...A, T ...B> void q(Q<A...>, Q<B...>); // #q
+ void qt(Q<> q0, Q<1, 2> qii, Q<1, 2, 3> qiii) {
+ q(q0, q0);
+ q(qii, qii);
+ q(qii, qiii); // expected-error {{no match}} expected-note@#q {{deduced packs of different lengths for parameter 'T' (<int, int> vs. <int, int, int>)}}
+ q(q0, qiii); // expected-error {{no match}} expected-note@#q {{deduced packs of different lengths for parameter 'T' (<> vs. <int, int, int>)}}
+ }
+#endif
+}
+
+namespace PR44890 {
+ template<typename ...Ts>
+ struct tuple {};
+
+ template<int I, typename ...Ts>
+ int get0(const tuple<Ts...> &t) { return 0; }
+
+ template<typename ...Ts> struct tuple_wrapper : tuple<Ts...> {
+ template<int I> int get() { return get0<0, Ts...>(*this); }
+ };
+
+ int f() {
+ tuple_wrapper<int> w;
+ return w.get<0>();
+ }
+}
diff --git a/src/llvm-project/clang/test/SemaTemplate/default-arguments-cxx0x.cpp b/src/llvm-project/clang/test/SemaTemplate/default-arguments-cxx0x.cpp
index c24ed12..2114cc9 100644
--- a/src/llvm-project/clang/test/SemaTemplate/default-arguments-cxx0x.cpp
+++ b/src/llvm-project/clang/test/SemaTemplate/default-arguments-cxx0x.cpp
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s
+// RUN: %clang_cc1 -fsyntax-only -std=c++14 -verify %s
// expected-no-diagnostics
// Test default template arguments for function templates.
@@ -114,3 +115,17 @@
S<int> _a{};
};
}
+
+#if __cplusplus >= 201402L
+namespace lambda {
+ // Verify that a default argument in a lambda can refer to the type of a
+ // previous `auto` argument without crashing.
+ template <class T>
+ void bar() {
+ (void) [](auto c, int x = sizeof(decltype(c))) {};
+ }
+ void foo() {
+ bar<int>();
+ }
+} // namespace lambda
+#endif
diff --git a/src/llvm-project/clang/test/SemaTemplate/dependent-expr.cpp b/src/llvm-project/clang/test/SemaTemplate/dependent-expr.cpp
index bb1e239..0ce4cb3 100644
--- a/src/llvm-project/clang/test/SemaTemplate/dependent-expr.cpp
+++ b/src/llvm-project/clang/test/SemaTemplate/dependent-expr.cpp
@@ -1,5 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
-// expected-no-diagnostics
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++2a %s
// PR5908
template <typename Iterator>
@@ -108,3 +107,69 @@
};
template struct A<0>;
}
+
+template<typename T> void stmt_expr_1() {
+ static_assert( ({ false; }), "" );
+}
+void stmt_expr_2() {
+ static_assert( ({ false; }), "" ); // expected-error {{failed}}
+}
+
+namespace PR45083 {
+ struct A { bool x; };
+
+ template<typename> struct B : A {
+ void f() {
+ const int n = ({ if (x) {} 0; });
+ }
+ };
+
+ template void B<int>::f();
+
+ template<typename> void f() {
+ decltype(({})) x; // expected-error {{incomplete type}}
+ }
+ template void f<int>(); // expected-note {{instantiation of}}
+
+ template<typename> auto g() {
+ auto c = [](auto, int) -> decltype(({})) {};
+ using T = decltype(c(0.0, 0));
+ using T = void;
+ return c(0, 0);
+ }
+ using U = decltype(g<int>()); // expected-note {{previous}}
+ using U = float; // expected-error {{different types ('float' vs 'decltype(g<int>())' (aka 'void'))}}
+
+ void h(auto a, decltype(g<char>())*) {} // expected-note {{previous}}
+ void h(auto a, void*) {} // expected-error {{redefinition}}
+
+ void i(auto a) {
+ [](auto a, int = ({decltype(a) i; i * 2;})){}(a); // expected-error {{no matching function}} expected-note {{substitution failure}}
+ }
+ void use_i() {
+ i(0);
+ i((void*)0); // expected-note {{instantiation of}}
+ }
+}
+
+namespace BindingInStmtExpr {
+ template<class ...Ts> struct overload : Ts... {
+ overload(Ts ...ts) : Ts(decltype(ts)(ts))... {}
+ using Ts::operator()...;
+ };
+
+ template<int> struct N {};
+
+ template<class T> auto num_bindings() {
+ auto f0 = [](auto t, unsigned) { return N<0>(); };
+ auto f1 = [](auto t, int) -> decltype(({ auto [_1] = t; N<1>(); })) { return {}; };
+ auto f2 = [](auto t, int) -> decltype(({ auto [_1, _2] = t; N<2>(); })) { return {}; };
+ auto f3 = [](auto t, int) -> decltype(({ auto [_1, _2, _3] = t; N<3>(); })) { return {}; };
+ return decltype(overload(f0, f1, f2, f3)(T(), 0))();
+ }
+
+ struct T { int a; int b; };
+ // Make sure we get a correct, non-dependent type back.
+ using U = decltype(num_bindings<T>()); // expected-note {{previous}}
+ using U = N<3>; // expected-error-re {{type alias redefinition with different types ('N<3>' vs {{.*}}N<2>}}
+}
diff --git a/src/llvm-project/clang/test/SemaTemplate/dependent-names.cpp b/src/llvm-project/clang/test/SemaTemplate/dependent-names.cpp
index 67ef238..a8de159 100644
--- a/src/llvm-project/clang/test/SemaTemplate/dependent-names.cpp
+++ b/src/llvm-project/clang/test/SemaTemplate/dependent-names.cpp
@@ -273,9 +273,6 @@
}
int e[10];
};
- void g() {
- S<int>().f(); // expected-note {{here}}
- }
}
namespace A2 {
diff --git a/src/llvm-project/clang/test/SemaTemplate/destructor-template.cpp b/src/llvm-project/clang/test/SemaTemplate/destructor-template.cpp
index 6570b64..0d28ec8 100644
--- a/src/llvm-project/clang/test/SemaTemplate/destructor-template.cpp
+++ b/src/llvm-project/clang/test/SemaTemplate/destructor-template.cpp
@@ -92,3 +92,13 @@
template <class T>
~PR33189() { } // expected-error{{destructor cannot be declared as a template}}
};
+
+namespace PR38671 {
+struct S {
+ template <class>
+ ~S(); // expected-error{{destructor cannot be declared as a template}}
+};
+struct T : S { // expected-note{{destructor of 'T' is implicitly deleted because base class 'PR38671::S' has no destructor}}
+ ~T() = default; // expected-warning{{explicitly defaulted destructor is implicitly deleted}}
+};
+} // namespace PR38671
diff --git a/src/llvm-project/clang/test/SemaTemplate/instantiate-abbreviated-template.cpp b/src/llvm-project/clang/test/SemaTemplate/instantiate-abbreviated-template.cpp
new file mode 100644
index 0000000..1f2171a
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaTemplate/instantiate-abbreviated-template.cpp
@@ -0,0 +1,45 @@
+// RUN: %clang_cc1 -std=c++2a -x c++ %s -verify
+
+template<typename...>
+concept C = false; // expected-note 9{{because}}
+
+template<typename T>
+struct S {
+ template<typename U>
+ static void foo1(U a, auto b);
+ static void foo2(T a, C<T> auto b);
+ // expected-note@-1{{candidate template ignored}} expected-note@-1{{because}}
+ static void foo3(T a, C<decltype(a)> auto b);
+ // expected-note@-1{{candidate template ignored}} expected-note@-1{{because}}
+ static void foo4(T a, C<decltype(a)> auto b, const C<decltype(b)> auto &&c);
+ // expected-note@-1{{candidate template ignored}} expected-note@-1{{because}}
+};
+
+using sf1 = decltype(S<int>::foo1(1, 2));
+using sf2 = decltype(S<int>::foo2(1, 2)); // expected-error{{no matching function}}
+using sf3 = decltype(S<int>::foo3(1, 2)); // expected-error{{no matching function}}
+using sf4 = decltype(S<int>::foo4(1, 2, 3)); // expected-error{{no matching function}}
+
+
+template<typename... T>
+struct G {
+ static void foo1(auto a, const C<decltype(a)> auto &&... b);
+ // expected-note@-1{{candidate template ignored}} expected-note@-1{{because}} expected-note@-1 3{{and}}
+ static void foo2(auto a, const C<decltype(a), T> auto &&... b);
+ // expected-note@-1{{candidate template ignored}} expected-note@-1{{because}} expected-note@-1{{and}}
+};
+
+using gf1 = decltype(G<int, char>::foo1('a', 1, 2, 3, 4)); // expected-error{{no matching function}}
+using gf2 = decltype(G<int, char>::foo2('a', 1, 2)); // expected-error{{no matching function}}
+
+
+// Regression (bug #45102): check that instantiation works where there is no
+// TemplateTypeParmDecl
+template <typename T> using id = T;
+
+template <typename T>
+constexpr void g() {
+ id<void (T)> f;
+}
+
+static_assert((g<int>(), true));
\ No newline at end of file
diff --git a/src/llvm-project/clang/test/SemaTemplate/instantiate-c99.cpp b/src/llvm-project/clang/test/SemaTemplate/instantiate-c99.cpp
index 07d3fc7..b0183ff 100644
--- a/src/llvm-project/clang/test/SemaTemplate/instantiate-c99.cpp
+++ b/src/llvm-project/clang/test/SemaTemplate/instantiate-c99.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
-// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
-// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
+// RUN: %clang_cc1 -Wno-c99-extensions -Wno-reorder -fsyntax-only -verify %s
+// RUN: %clang_cc1 -Wno-c99-extensions -Wno-reorder -fsyntax-only -verify -std=c++98 %s
+// RUN: %clang_cc1 -Wno-c99-extensions -Wno-reorder -fsyntax-only -verify -std=c++11 %s
// Test template instantiation for C99-specific features.
diff --git a/src/llvm-project/clang/test/SemaTemplate/instantiate-cast.cpp b/src/llvm-project/clang/test/SemaTemplate/instantiate-cast.cpp
index 32a1cfd..69aaac7 100644
--- a/src/llvm-project/clang/test/SemaTemplate/instantiate-cast.cpp
+++ b/src/llvm-project/clang/test/SemaTemplate/instantiate-cast.cpp
@@ -57,7 +57,7 @@
template<typename T, typename U>
struct DynamicCast0 {
void f(T t) {
- (void)dynamic_cast<U>(t); // expected-error{{not a reference or pointer}}
+ (void)dynamic_cast<U>(t); // expected-error{{invalid target type 'A' for dynamic_cast; target type must be a reference or pointer type to a defined class}}
}
};
diff --git a/src/llvm-project/clang/test/SemaTemplate/instantiate-expanded-type-constraint.cpp b/src/llvm-project/clang/test/SemaTemplate/instantiate-expanded-type-constraint.cpp
new file mode 100644
index 0000000..73fef87
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaTemplate/instantiate-expanded-type-constraint.cpp
@@ -0,0 +1,36 @@
+// RUN: %clang_cc1 -std=c++2a -verify %s
+
+template<typename T, typename U>
+constexpr bool is_same_v = false;
+
+template<typename T>
+constexpr bool is_same_v<T, T> = true;
+
+template<typename T, typename U>
+concept same_as = is_same_v<T, U>;
+// expected-note@-1{{because 'is_same_v<int, _Bool>' evaluated to false}}
+
+template<typename T, typename... Us>
+concept either = (is_same_v<T, Us> || ...);
+
+template<typename... Ts>
+struct T {
+ template<same_as<Ts>... Us>
+ // expected-note@-1{{because 'same_as<int, _Bool>' evaluated to false}}
+ static void foo(Us... u, int x) { };
+ // expected-note@-1{{candidate template ignored: deduced too few arguments}}
+ // expected-note@-2{{candidate template ignored: constraints not satisfied}}
+
+ template<typename... Us>
+ struct S {
+ template<either<Ts, Us...>... Vs>
+ static void foo(Vs... v);
+ };
+};
+
+int main() {
+ T<int, bool>::foo(1); // expected-error{{no matching function for call to 'foo'}}
+ T<int, bool>::foo(1, 2, 3); // expected-error{{no matching function for call to 'foo'}}
+ T<int, bool>::S<char>::foo(1, 'a');
+ T<int, bool>::S<char>::foo('a', true);
+}
diff --git a/src/llvm-project/clang/test/SemaTemplate/instantiate-expr-3.cpp b/src/llvm-project/clang/test/SemaTemplate/instantiate-expr-3.cpp
index 90c322c..142e4eb 100644
--- a/src/llvm-project/clang/test/SemaTemplate/instantiate-expr-3.cpp
+++ b/src/llvm-project/clang/test/SemaTemplate/instantiate-expr-3.cpp
@@ -23,7 +23,7 @@
}
namespace N2 {
- long& operator+=(N1::X&, long); // expected-note{{candidate}}
+ long& operator+=(N1::X&, long);
template<typename T, typename U, typename Result>
struct PlusEquals0 {
diff --git a/src/llvm-project/clang/test/SemaTemplate/instantiate-expr-4.cpp b/src/llvm-project/clang/test/SemaTemplate/instantiate-expr-4.cpp
index 055f37b..6b4eb12 100644
--- a/src/llvm-project/clang/test/SemaTemplate/instantiate-expr-4.cpp
+++ b/src/llvm-project/clang/test/SemaTemplate/instantiate-expr-4.cpp
@@ -192,6 +192,13 @@
}
};
+template<typename T>
+struct TypeId1 {
+ const std::type_info &f() {
+ return typeid(T); // expected-error-re 2{{type operand 'void () {{const|&}}' of 'typeid' cannot have '{{const|&}}' qualifier}}
+ }
+};
+
struct Abstract {
virtual void f() = 0;
};
@@ -199,6 +206,8 @@
template struct TypeId0<int>;
template struct TypeId0<Incomplete>; // expected-note{{instantiation of member function}}
template struct TypeId0<Abstract>;
+template struct TypeId1<void() const>; // expected-note{{instantiation of}}
+template struct TypeId1<void() &>; // expected-warning 0-1{{C++11}} expected-note{{instantiation of}}
// ---------------------------------------------------------------------
// type traits
diff --git a/src/llvm-project/clang/test/SemaTemplate/instantiate-friend-function.cpp b/src/llvm-project/clang/test/SemaTemplate/instantiate-friend-function.cpp
index 08602d5..1a923a2 100644
--- a/src/llvm-project/clang/test/SemaTemplate/instantiate-friend-function.cpp
+++ b/src/llvm-project/clang/test/SemaTemplate/instantiate-friend-function.cpp
@@ -47,3 +47,10 @@
// bool PR10856_Root::g<PR10856_Root::MyClass<int>, void>(PR10856_Root::MyClass<int>)
// CHECK: call {{.*}} @_ZN12PR10856_Root1gINS_7MyClassIiEEvEEbT_
+
+namespace PR43400 {
+ template<typename T> struct X {
+ friend void f() = delete;
+ };
+ X<int> xi;
+}
diff --git a/src/llvm-project/clang/test/SemaTemplate/instantiate-incomplete-typo-suggested-error-limit.cpp b/src/llvm-project/clang/test/SemaTemplate/instantiate-incomplete-typo-suggested-error-limit.cpp
new file mode 100644
index 0000000..7f02b45
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaTemplate/instantiate-incomplete-typo-suggested-error-limit.cpp
@@ -0,0 +1,60 @@
+// RUN: not %clang -fsyntax-only -std=c++11 -ferror-limit=1 %s 2>&1 | FileCheck %s
+
+// Test case for PR35682.
+// The issue be caused by the typo correction that changes String to the
+// incomplete type string. The example is based on the std::pair code and
+// reduced to a minimal test case. When using std::pair the issue can only be
+// reproduced when using the -stdlib=libc++ compiler option.
+
+template <class T> class allocator;
+
+template <class charT> struct char_traits;
+
+template <class CharT, class Traits = char_traits<CharT>,
+ class Allocator = allocator<CharT>>
+class basic_string;
+typedef basic_string<char, char_traits<char>, allocator<char>> string;
+
+template <bool, class Tp = void> struct enable_if {};
+template <class Tp> struct enable_if<true, Tp> { typedef Tp type; };
+
+template <class Tp, Tp v> struct integral_constant {
+ static constexpr const Tp value = v;
+ typedef Tp value_type;
+ typedef integral_constant type;
+
+ constexpr operator value_type() const noexcept { return value; }
+ constexpr value_type operator()() const noexcept { return value; }
+};
+
+template <class Tp, Tp v> constexpr const Tp integral_constant<Tp, v>::value;
+
+using true_type = integral_constant<bool, true>;
+using false_type = integral_constant<bool, false>;
+
+template <class Tp, class Up> struct is_same : public false_type {};
+template <class Tp> struct is_same<Tp, Tp> : public true_type {};
+
+template <class T> struct single {
+ typedef T first_type;
+
+ T first;
+
+ struct CheckArgs {
+ template <class U1> static constexpr bool enable_implicit() {
+ return is_same<first_type, U1>::value;
+ }
+ };
+
+ template <class U1,
+ typename enable_if<CheckArgs::template enable_implicit<U1>(),
+ bool>::type = false>
+ single(U1 &&u1);
+};
+
+using SetKeyType = String;
+single<SetKeyType> v;
+
+// CHECK: error: unknown type name 'String'; did you mean 'string'?
+// CHECK: fatal error: too many errors emitted, stopping now [-ferror-limit=]
+// CHECK-NOT: Assertion{{.*}}failed
diff --git a/src/llvm-project/clang/test/SemaTemplate/instantiate-init.cpp b/src/llvm-project/clang/test/SemaTemplate/instantiate-init.cpp
index b58ad3a..99b29c7 100644
--- a/src/llvm-project/clang/test/SemaTemplate/instantiate-init.cpp
+++ b/src/llvm-project/clang/test/SemaTemplate/instantiate-init.cpp
@@ -151,8 +151,8 @@
// Check that an init list update doesn't "lose" the pack-ness of an expression.
template <int... N> void f() {
- g(AA{0, [0].n = N} ...); // expected-warning 3{{overrides prior init}} expected-note 3{{previous init}}
- g(AA{N, [0].n = 0} ...); // expected-warning 3{{overrides prior init}} expected-note 3{{previous init}}
+ g(AA{0, [0].n = N} ...); // expected-warning 3{{extension}} expected-note {{here}} expected-warning 3{{overrides prior init}} expected-note 3{{previous init}}
+ g(AA{N, [0].n = 0} ...); // expected-warning 3{{extension}} expected-note {{here}} expected-warning 3{{overrides prior init}} expected-note 3{{previous init}}
};
void g(AA, AA);
diff --git a/src/llvm-project/clang/test/SemaTemplate/instantiate-local-class.cpp b/src/llvm-project/clang/test/SemaTemplate/instantiate-local-class.cpp
index eaff4c4..550c59d 100644
--- a/src/llvm-project/clang/test/SemaTemplate/instantiate-local-class.cpp
+++ b/src/llvm-project/clang/test/SemaTemplate/instantiate-local-class.cpp
@@ -486,3 +486,16 @@
}
void g() { f<int>(); }
}
+
+namespace PR45000 {
+ template <typename T>
+ void f(int x = [](T x = nullptr) -> int { return x; }());
+ // expected-error@-1 {{cannot initialize a parameter of type 'int' with an rvalue of type 'nullptr_t'}}
+ // expected-note@-2 {{passing argument to parameter 'x' here}}
+ // expected-error@-3 {{no matching function for call}}
+ // expected-note@-4 {{candidate function not viable: requires single argument 'x', but no arguments were provided}}
+ // expected-note@-5 {{conversion candidate of type 'auto (*)(int) -> int'}}
+
+ void g() { f<int>(); }
+ // expected-note@-1 {{in instantiation of default function argument expression for 'f<int>' required here}}
+}
diff --git a/src/llvm-project/clang/test/SemaTemplate/instantiate-requires-clause.cpp b/src/llvm-project/clang/test/SemaTemplate/instantiate-requires-clause.cpp
new file mode 100644
index 0000000..a4d1b65
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaTemplate/instantiate-requires-clause.cpp
@@ -0,0 +1,69 @@
+// RUN: %clang_cc1 -std=c++2a -x c++ %s -verify
+
+template <typename... Args> requires ((sizeof(Args) == 1), ...)
+// expected-note@-1 {{because '(sizeof(int) == 1) , (sizeof(char) == 1) , (sizeof(int) == 1)' evaluated to false}}
+void f1(Args&&... args) { }
+// expected-note@-1 {{candidate template ignored: constraints not satisfied [with Args = <int, char, int>]}}
+
+using f11 = decltype(f1('a'));
+using f12 = decltype(f1(1, 'b'));
+using f13 = decltype(f1(1, 'b', 2));
+// expected-error@-1 {{no matching function for call to 'f1'}}
+
+template <typename... Args>
+void f2(Args&&... args) requires ((sizeof(args) == 1), ...) { }
+// expected-note@-1 {{candidate template ignored: constraints not satisfied [with Args = <int, char, int>]}}
+// expected-note@-2 {{because '(sizeof (args) == 1) , (sizeof (args) == 1) , (sizeof (args) == 1)' evaluated to false}}
+
+using f21 = decltype(f2('a'));
+using f22 = decltype(f2(1, 'b'));
+using f23 = decltype(f2(1, 'b', 2));
+// expected-error@-1 {{no matching function for call to 'f2'}}
+
+template <typename... Args> requires ((sizeof(Args) == 1), ...)
+// expected-note@-1 {{because '(sizeof(int) == 1) , (sizeof(char) == 1) , (sizeof(int) == 1)' evaluated to false}}
+void f3(Args&&... args) requires ((sizeof(args) == 1), ...) { }
+// expected-note@-1 {{candidate template ignored: constraints not satisfied [with Args = <int, char, int>]}}
+
+using f31 = decltype(f3('a'));
+using f32 = decltype(f3(1, 'b'));
+using f33 = decltype(f3(1, 'b', 2));
+// expected-error@-1 {{no matching function for call to 'f3'}}
+
+template<typename T>
+struct S {
+ template<typename U>
+ static constexpr auto f(U const index) requires(index, true) {
+ return true;
+ }
+};
+
+static_assert(S<void>::f(1));
+
+constexpr auto value = 0;
+
+template<typename T>
+struct S2 {
+ template<typename = void> requires(value, true)
+ static constexpr auto f() requires(value, true) {
+ }
+};
+
+static_assert((S2<int>::f(), true));
+
+template<typename T>
+struct S3 {
+ template<typename... Args> requires true
+ static constexpr void f(Args...) { }
+};
+
+static_assert((S3<int>::f(), true));
+
+template<typename T>
+struct S4 {
+ template<typename>
+ constexpr void foo() requires (*this, true) { }
+ constexpr void goo() requires (*this, true) { }
+};
+
+static_assert((S4<int>{}.foo<int>(), S4<int>{}.goo(), true));
diff --git a/src/llvm-project/clang/test/SemaTemplate/instantiate-requires-expr.cpp b/src/llvm-project/clang/test/SemaTemplate/instantiate-requires-expr.cpp
new file mode 100644
index 0000000..ba82fc1
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaTemplate/instantiate-requires-expr.cpp
@@ -0,0 +1,229 @@
+// RUN: %clang_cc1 -std=c++2a -x c++ %s -verify -Wno-unused-value
+
+template<typename T, typename U>
+constexpr bool is_same_v = false;
+
+template<typename T>
+constexpr bool is_same_v<T, T> = true;
+
+// We use a hack in this file to make the compiler print out the requires
+// expression after it has been instantiated - we put false_v<requires {...}> as
+// the requires clause of a class template, then instantiate the template.
+// The requirement will not be satisfied, and the explaining diagnostic will
+// print out false_v<requires {...}> in its raw form (the false_v serves to
+// prevent the diagnostic from elaborating on why the requires expr wasn't
+// satisfied).
+
+template<bool v>
+constexpr bool false_v = false;
+
+template<typename... Ts>
+using void_t = void;
+
+// Check that requires parameters are instantiated correctly.
+
+template<typename T> requires
+false_v<requires (T t) { requires is_same_v<decltype(t), int>; }>
+// expected-note@-1 {{because 'false_v<requires (int t) { requires is_same_v<decltype(t), int>; }>' evaluated to false}}
+// expected-note@-2 {{because 'false_v<requires (char t) { requires is_same_v<decltype(t), int>; }>' evaluated to false}}
+struct r1 {};
+
+using r1i1 = r1<int>; // expected-error {{constraints not satisfied for class template 'r1' [with T = int]}}
+using r1i2 = r1<char>; // expected-error {{constraints not satisfied for class template 'r1' [with T = char]}}
+
+// Check that parameter packs work.
+
+template<typename... Ts> requires
+false_v<requires (Ts... ts) {requires ((sizeof(ts) == 2) && ...);}>
+// expected-note@-1 {{because 'false_v<requires (short ts, unsigned short ts) { requires (sizeof (ts) == 2) && (sizeof (ts) == 2); }>'}}
+// expected-note@-2 {{because 'false_v<requires (short ts) { requires (sizeof (ts) == 2); }>' evaluated to false}}
+struct r2 {};
+
+using r2i1 = r2<short, unsigned short>; // expected-error {{constraints not satisfied for class template 'r2' [with Ts = <short, unsigned short>]}}
+using r2i2 = r2<short>; // expected-error {{constraints not satisfied for class template 'r2' [with Ts = <short>]}}
+
+template<typename... Ts> requires
+false_v<(requires (Ts ts) {requires sizeof(ts) != 0;} && ...)>
+// expected-note@-1 {{because 'false_v<requires (short ts) { requires sizeof (ts) != 0; } && requires (unsigned short ts) { requires sizeof (ts) != 0; }>' evaluated to false}}
+// expected-note@-2 {{because 'false_v<requires (short ts) { requires sizeof (ts) != 0; }>' evaluated to false}}
+struct r3 {};
+
+using r3i1 = r3<short, unsigned short>; // expected-error {{constraints not satisfied for class template 'r3' [with Ts = <short, unsigned short>]}}
+using r3i2 = r3<short>; // expected-error {{constraints not satisfied for class template 'r3' [with Ts = <short>]}}
+
+template<typename T>
+struct identity { using type = T; };
+
+namespace type_requirement {
+ struct A {};
+
+ // check that nested name specifier is instantiated correctly.
+ template<typename T> requires false_v<requires { typename T::type; }> // expected-note{{because 'false_v<requires { typename identity<int>::type; }>' evaluated to false}}
+ struct r1 {};
+
+ using r1i = r1<identity<int>>; // expected-error{{constraints not satisfied for class template 'r1' [with T = identity<int>]}}
+
+ // check that template argument list is instantiated correctly.
+ template<typename T>
+ struct contains_template {
+ template<typename U> requires is_same_v<contains_template<T>, U>
+ using temp = int;
+ };
+
+ template<typename T> requires
+ false_v<requires { typename T::template temp<T>; }>
+ // expected-note@-1 {{because 'false_v<requires { typename contains_template<int>::temp<contains_template<int> >; }>' evaluated to false}}
+ // expected-note@-2 {{because 'false_v<requires { typename contains_template<short>::temp<contains_template<short> >; }>' evaluated to false}}
+ struct r2 {};
+
+ using r2i1 = r2<contains_template<int>>; // expected-error{{constraints not satisfied for class template 'r2' [with T = type_requirement::contains_template<int>]}}
+ using r2i2 = r2<contains_template<short>>; // expected-error{{constraints not satisfied for class template 'r2' [with T = type_requirement::contains_template<short>]}}
+
+ // substitution error occurs, then requires expr is instantiated again
+
+ template<typename T>
+ struct a {
+ template<typename U> requires (requires { typename T::a::a; }, false)
+ // expected-note@-1{{because 'requires { <<error-type>>; } , false' evaluated to false}}
+ struct r {};
+ };
+
+ using ari = a<int>::r<short>; // expected-error{{constraints not satisfied for class template 'r' [with U = short]}}
+
+ // Parameter pack inside expr
+ template<typename... Ts> requires
+ false_v<(requires { typename Ts::type; } && ...)>
+ // expected-note@-1 {{because 'false_v<requires { typename identity<short>::type; } && requires { typename identity<int>::type; } && requires { <<error-type>>; }>' evaluated to false}}
+ struct r5 {};
+
+ using r5i = r5<identity<short>, identity<int>, short>; // expected-error{{constraints not satisfied for class template 'r5' [with Ts = <identity<short>, identity<int>, short>]}}
+ template<typename... Ts> requires
+ false_v<(requires { typename void_t<Ts>; } && ...)> // expected-note{{because 'false_v<requires { typename void_t<int>; } && requires { typename void_t<short>; }>' evaluated to false}}
+ struct r6 {};
+
+ using r6i = r6<int, short>; // expected-error{{constraints not satisfied for class template 'r6' [with Ts = <int, short>]}}
+
+ template<typename... Ts> requires
+ false_v<(requires { typename Ts::template aaa<Ts>; } && ...)>
+ // expected-note@-1 {{because 'false_v<requires { <<error-type>>; } && requires { <<error-type>>; }>' evaluated to false}}
+ struct r7 {};
+
+ using r7i = r7<int, A>; // expected-error{{constraints not satisfied for class template 'r7' [with Ts = <int, type_requirement::A>]}}
+}
+
+namespace expr_requirement {
+ // check that compound/simple requirements are instantiated correctly.
+
+ template<typename T> requires false_v<requires { sizeof(T); { sizeof(T) }; }>
+ // expected-note@-1 {{because 'false_v<requires { sizeof(int); { sizeof(int) }; }>' evaluated to false}}
+ // expected-note@-2 {{because 'false_v<requires { <<error-expression>>; { sizeof(T) }; }>' evaluated to false}}
+ struct r1 {};
+
+ using r1i1 = r1<int>; // expected-error{{constraints not satisfied for class template 'r1' [with T = int]}}
+ using r1i2 = r1<void>; // expected-error{{constraints not satisfied for class template 'r1' [with T = void]}}
+
+ // substitution error occurs in expr, then expr is instantiated again.
+
+ template<typename T>
+ struct a {
+ template<typename U> requires (requires { sizeof(T::a); }, false) // expected-note{{because 'requires { <<error-expression>>; } , false' evaluated to false}}
+ struct r {};
+ };
+
+ using ari = a<int>::r<short>; // expected-error{{constraints not satisfied for class template 'r' [with U = short]}}
+
+ // check that the return-type-requirement is instantiated correctly.
+
+ template<typename T, typename U = int>
+ concept C1 = is_same_v<T, U>;
+
+ template<typename T> requires false_v<requires(T t) { { t } -> C1<T>; }>
+ // expected-note@-1 {{because 'false_v<requires (int t) { { t } -> C1<int>; }>' evaluated to false}}
+ // expected-note@-2 {{because 'false_v<requires (double t) { { t } -> C1<double>; }>' evaluated to false}}
+ struct r2 {};
+
+ using r2i1 = r2<int>; // expected-error{{constraints not satisfied for class template 'r2' [with T = int]}}
+ using r2i2 = r2<double>; // expected-error{{constraints not satisfied for class template 'r2' [with T = double]}}
+
+
+ // substitution error occurs in return type requirement, then requires expr is
+ // instantiated again.
+
+ template<typename T>
+ struct b {
+ template<typename U> requires (requires { { 0 } -> C1<typename T::a>; }, false) // expected-note{{because 'requires { { 0 } -> <<error-type>>; } , false' evaluated to false}}
+ struct r {};
+ };
+
+ using bri = b<int>::r<short>; // expected-error{{constraints not satisfied for class template 'r' [with U = short]}}
+
+
+ template<typename... Ts> requires
+ false_v<(requires { { 0 } noexcept -> C1<Ts>; } && ...)>
+ // expected-note@-1 {{because 'false_v<requires { { 0 } noexcept -> C1<int>; } && requires { { 0 } noexcept -> C1<unsigned int>; }>' evaluated to false}}
+ struct r3 {};
+
+ using r3i = r3<int, unsigned int>; // expected-error{{constraints not satisfied for class template 'r3' [with Ts = <int, unsigned int>]}}
+
+ template<typename T>
+ struct r4 {
+ constexpr int foo() {
+ if constexpr (requires { this->invalid(); })
+ return 1;
+ else
+ return 0;
+ }
+
+ constexpr void invalid() requires false { }
+ };
+ static_assert(r4<int>{}.foo() == 0);
+}
+
+namespace nested_requirement {
+ // check that constraint expression is instantiated correctly
+ template<typename T> requires false_v<requires { requires sizeof(T) == 2; }> // expected-note{{because 'false_v<requires { requires sizeof(int) == 2; }>' evaluated to false}}
+ struct r1 {};
+
+ using r1i = r1<int>; // expected-error{{constraints not satisfied for class template 'r1' [with T = int]}}
+
+ // substitution error occurs in expr, then expr is instantiated again.
+ template<typename T>
+ struct a {
+ template<typename U> requires
+ (requires { requires sizeof(T::a) == 0; }, false) // expected-note{{because 'requires { requires <<error-expression>>; } , false' evaluated to false}}
+ struct r {};
+ };
+
+ using ari = a<int>::r<short>; // expected-error{{constraints not satisfied for class template 'r' [with U = short]}}
+
+ // Parameter pack inside expr
+ template<typename... Ts> requires
+ false_v<(requires { requires sizeof(Ts) == 0; } && ...)>
+ // expected-note@-1 {{because 'false_v<requires { requires sizeof(int) == 0; } && requires { requires sizeof(short) == 0; }>' evaluated to false}}
+ struct r2 {};
+
+ using r2i = r2<int, short>; // expected-error{{constraints not satisfied for class template 'r2' [with Ts = <int, short>]}}
+}
+
+// Parameter pack inside multiple requirements
+template<typename... Ts> requires
+false_v<(requires { requires sizeof(Ts) == 0; sizeof(Ts); } && ...)>
+// expected-note@-1 {{because 'false_v<requires { requires sizeof(int) == 0; sizeof(Ts); } && requires { requires sizeof(short) == 0; sizeof(Ts); }>' evaluated to false}}
+struct r4 {};
+
+using r4i = r4<int, short>; // expected-error{{constraints not satisfied for class template 'r4' [with Ts = <int, short>]}}
+
+template<typename... Ts> requires
+false_v<(requires(Ts t) { requires sizeof(t) == 0; t++; } && ...)>
+// expected-note@-1 {{because 'false_v<requires (int t) { requires sizeof (t) == 0; t++; } && requires (short t) { requires sizeof (t) == 0; t++; }>' evaluated to false}}
+struct r5 {};
+
+using r5i = r5<int, short>; // expected-error{{constraints not satisfied for class template 'r5' [with Ts = <int, short>]}}
+
+template<typename T> requires
+false_v<(requires(T t) { T{t}; })> // T{t} creates an "UnevaluatedList" context.
+// expected-note@-1 {{because 'false_v<(requires (int t) { int{t}; })>' evaluated to false}}
+struct r6 {};
+
+using r6i = r6<int>;
+// expected-error@-1 {{constraints not satisfied for class template 'r6' [with T = int]}}
diff --git a/src/llvm-project/clang/test/SemaTemplate/instantiate-template-argument.cpp b/src/llvm-project/clang/test/SemaTemplate/instantiate-template-argument.cpp
new file mode 100644
index 0000000..43d5d00
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaTemplate/instantiate-template-argument.cpp
@@ -0,0 +1,28 @@
+// RUN: %clang_cc1 -std=c++2a -x c++ %s -verify
+
+template<auto T, decltype(T) U>
+concept C1 = sizeof(U) >= 4;
+// sizeof(U) >= 4 [U = U (decltype(T))]
+
+template<typename Y, char V>
+concept C2 = C1<Y{}, V>;
+// sizeof(U) >= 4 [U = V (decltype(Y{}))]
+
+template<char W>
+constexpr int foo() requires C2<int, W> { return 1; }
+// sizeof(U) >= 4 [U = W (decltype(int{}))]
+
+template<char X>
+// expected-note@+1{{candidate function}}
+constexpr int foo() requires C1<1, X> && true { return 2; }
+// sizeof(U) >= 4 [U = X (decltype(1))]
+
+static_assert(foo<'a'>() == 2);
+
+template<char Z>
+// expected-note@+1{{candidate function}}
+constexpr int foo() requires C2<long long, Z> && true { return 3; }
+// sizeof(U) >= 4 [U = Z (decltype(long long{}))]
+
+static_assert(foo<'a'>() == 3);
+// expected-error@-1{{call to 'foo' is ambiguous}}
\ No newline at end of file
diff --git a/src/llvm-project/clang/test/SemaTemplate/instantiation-depth-default.cpp b/src/llvm-project/clang/test/SemaTemplate/instantiation-depth-default.cpp
index 9d8b6cc..6161962 100644
--- a/src/llvm-project/clang/test/SemaTemplate/instantiation-depth-default.cpp
+++ b/src/llvm-project/clang/test/SemaTemplate/instantiation-depth-default.cpp
@@ -4,12 +4,15 @@
// increases our per-frame stack usage enough that this test no longer fits
// within our normal stack space allocation.
// UNSUPPORTED: asan
+//
+// The default stack size on NetBSD is too small for this test.
+// UNSUPPORTED: system-netbsd
template<int N, typename T> struct X : X<N+1, T*> {};
-// expected-error-re@8 {{recursive template instantiation exceeded maximum depth of 1024{{$}}}}
-// expected-note@8 {{instantiation of template class}}
-// expected-note@8 {{skipping 1023 contexts in backtrace}}
-// expected-note@8 {{use -ftemplate-depth=N to increase recursive template instantiation depth}}
+// expected-error-re@11 {{recursive template instantiation exceeded maximum depth of 1024{{$}}}}
+// expected-note@11 {{instantiation of template class}}
+// expected-note@11 {{skipping 1023 contexts in backtrace}}
+// expected-note@11 {{use -ftemplate-depth=N to increase recursive template instantiation depth}}
X<0, int> x; // expected-note {{in instantiation of}}
diff --git a/src/llvm-project/clang/test/SemaTemplate/late-parsing-eager-instantiation.cpp b/src/llvm-project/clang/test/SemaTemplate/late-parsing-eager-instantiation.cpp
index 412f026..0e65476 100644
--- a/src/llvm-project/clang/test/SemaTemplate/late-parsing-eager-instantiation.cpp
+++ b/src/llvm-project/clang/test/SemaTemplate/late-parsing-eager-instantiation.cpp
@@ -15,8 +15,8 @@
char data() {
visit([](auto buffer) -> char { // expected-note {{in instantiation}}
buffer->data();
- }); // expected-warning {{control reaches end of non-void lambda}}
- } // expected-warning {{control reaches end of non-void function}}
+ }); // expected-warning {{non-void lambda does not return a value}}
+ } // expected-warning {{non-void function does not return a value}}
};
// pr34185
diff --git a/src/llvm-project/clang/test/SemaTemplate/member-access-expr.cpp b/src/llvm-project/clang/test/SemaTemplate/member-access-expr.cpp
index 8dba2e6..ef10d72 100644
--- a/src/llvm-project/clang/test/SemaTemplate/member-access-expr.cpp
+++ b/src/llvm-project/clang/test/SemaTemplate/member-access-expr.cpp
@@ -156,7 +156,7 @@
void get(B **ptr) {
// It's okay if at some point we figure out how to diagnose this
// at instantiation time.
- *ptr = field;
+ *ptr = field; // expected-error {{assigning to 'test6::B *' from incompatible type 'test6::A *}}
}
};
}
diff --git a/src/llvm-project/clang/test/SemaTemplate/ms-delayed-default-template-args.cpp b/src/llvm-project/clang/test/SemaTemplate/ms-delayed-default-template-args.cpp
index 0c05469..b2350c9 100644
--- a/src/llvm-project/clang/test/SemaTemplate/ms-delayed-default-template-args.cpp
+++ b/src/llvm-project/clang/test/SemaTemplate/ms-delayed-default-template-args.cpp
@@ -94,12 +94,12 @@
template <typename T> struct Bar { T x; };
template <Bar<Xylophone> *P> // expected-error {{use of undeclared identifier 'Xylophone'}}
-// expected-note@-1 {{template parameter is declared here}}
+// expected-note@-1{{template parameter is declared here}}
struct Foo { };
typedef int Xylophone;
Bar<Xylophone> g;
-template struct Foo<&g>; // expected-error {{cannot be converted}}
+template struct Foo<&g>; // expected-error {{value of type}}
}
#endif
diff --git a/src/llvm-project/clang/test/SemaTemplate/ms-lookup-template-base-classes.cpp b/src/llvm-project/clang/test/SemaTemplate/ms-lookup-template-base-classes.cpp
index a41248e..cb49717 100644
--- a/src/llvm-project/clang/test/SemaTemplate/ms-lookup-template-base-classes.cpp
+++ b/src/llvm-project/clang/test/SemaTemplate/ms-lookup-template-base-classes.cpp
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -std=c++1y -fms-compatibility -fno-spell-checking -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -std=c++20 -fms-compatibility -fno-spell-checking -fsyntax-only -verify %s
template <class T>
diff --git a/src/llvm-project/clang/test/SemaTemplate/non-integral-switch-cond.cpp b/src/llvm-project/clang/test/SemaTemplate/non-integral-switch-cond.cpp
new file mode 100644
index 0000000..23c8e0e
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaTemplate/non-integral-switch-cond.cpp
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+struct NOT_AN_INTEGRAL_TYPE {};
+
+template <typename T>
+struct foo {
+ NOT_AN_INTEGRAL_TYPE Bad;
+ void run() {
+ switch (Bad) { // expected-error {{statement requires expression of integer type ('NOT_AN_INTEGRAL_TYPE' invalid)}}
+ case 0:
+ break;
+ }
+ }
+};
diff --git a/src/llvm-project/clang/test/SemaTemplate/pack-deduction.cpp b/src/llvm-project/clang/test/SemaTemplate/pack-deduction.cpp
index 478b197..6368f16 100644
--- a/src/llvm-project/clang/test/SemaTemplate/pack-deduction.cpp
+++ b/src/llvm-project/clang/test/SemaTemplate/pack-deduction.cpp
@@ -5,8 +5,8 @@
template<typename T, typename U> struct P {};
namespace Nested {
- template<typename ...T> int f1(X<T, T...>... a); // expected-note +{{conflicting types for parameter 'T'}}
- template<typename ...T> int f2(P<X<T...>, T> ...a); // expected-note +{{conflicting types for parameter 'T'}}
+ template<typename ...T> int f1(X<T, T...>... a); // expected-note +{{packs of different lengths for parameter 'T'}}
+ template<typename ...T> int f2(P<X<T...>, T> ...a); // expected-note +{{packs of different lengths for parameter 'T'}}
int a1 = f1(X<int, int, double>(), X<double, int, double>());
int a2 = f1(X<int, int>());
diff --git a/src/llvm-project/clang/test/SemaTemplate/rdar9173693.cpp b/src/llvm-project/clang/test/SemaTemplate/rdar9173693.cpp
index ed09a64..76919e2 100644
--- a/src/llvm-project/clang/test/SemaTemplate/rdar9173693.cpp
+++ b/src/llvm-project/clang/test/SemaTemplate/rdar9173693.cpp
@@ -2,8 +2,7 @@
// <rdar://problem/9173693>
template< bool C > struct assert { };
-// FIXME: We diagnose the same problem multiple times here because we have no
-// way to indicate in the token stream that we already tried to annotate a
-// template-id and we failed.
-template< bool > struct assert_arg_pred_impl { }; // expected-note 4 {{declared here}}
-template< typename Pred > assert<false> assert_not_arg( void (*)(Pred), typename assert_arg_pred<Pred>::type ); // expected-error 6 {{}}
+template< bool > struct assert_arg_pred_impl { }; // expected-note 2 {{declared here}}
+template< typename Pred > assert<false> assert_not_arg( void (*)(Pred), typename assert_arg_pred<Pred>::type );
+// expected-error@-1 {{did you mean 'assert_arg_pred_impl'}}
+// expected-error@-2 {{template argument for non-type template parameter must be an expression}}
diff --git a/src/llvm-project/clang/test/SemaTemplate/stack-exhaustion.cpp b/src/llvm-project/clang/test/SemaTemplate/stack-exhaustion.cpp
new file mode 100644
index 0000000..7f76212
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaTemplate/stack-exhaustion.cpp
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -verify %s
+// REQUIRES: thread_support
+
+// FIXME: Detection of, or recovery from, stack exhaustion does not work on
+// NetBSD at the moment. Since this is a best-effort mitigation for exceeding
+// implementation limits, just disable the test.
+// UNSUPPORTED: system-netbsd
+
+// expected-warning@* 0-1{{stack nearly exhausted}}
+// expected-note@* 0+{{}}
+
+template<int N> struct X : X<N-1> {};
+template<> struct X<0> {};
+X<1000> x;
+
+template<typename ...T> struct tuple {};
+template<typename ...T> auto f(tuple<T...> t) -> decltype(f(tuple<T...>(t))) {} // expected-error {{exceeded maximum depth}}
+void g() { f(tuple<int, int>()); }
+
+int f(X<0>);
+template<int N> auto f(X<N>) -> f(X<N-1>());
+
+int k = f(X<1000>());
diff --git a/src/llvm-project/clang/test/SemaTemplate/subst-into-subst.cpp b/src/llvm-project/clang/test/SemaTemplate/subst-into-subst.cpp
new file mode 100644
index 0000000..69c4a83
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaTemplate/subst-into-subst.cpp
@@ -0,0 +1,34 @@
+// RUN: %clang_cc1 -std=c++2a -verify %s
+
+// When forming and checking satisfaction of atomic constraints, we will
+// substitute still-dependent template arguments into an expression, and later
+// substitute into the result. This creates some unique situations; check that
+// they work.
+
+namespace SubstIntoResolvedTypeTemplateArg {
+ template<int, class> struct X {};
+
+ template<class T> concept A = true;
+ template<class T> concept B = sizeof(T) != 0;
+ template<class T> concept C = B<X<1, T>>;
+
+ int f(A auto); // expected-note {{candidate}}
+ int f(C auto); // expected-note {{candidate}}
+ int k1 = f(0); // expected-error {{ambiguous}}
+
+ template<class T> concept D = A<T> && B<X<1, T>>;
+ int f(D auto);
+ int k2 = f(0); // ok
+
+ // The atomic constraint formed from B<X<(int)'\1', T>> is identical to the
+ // one formed from C, even though the template arguments are written as
+ // different expressions; the "equivalent" rules are used rather than the
+ // "identical" rules when matching template arguments in concept-ids.
+ template<class T> concept E = A<T> && B<X<(int)'\1', T>>;
+ int g(C auto);
+ int g(E auto); // expected-note {{candidate}}
+ int k3 = g(0);
+
+ int g(D auto); // expected-note {{candidate}}
+ int k4 = g(0); // expected-error {{ambiguous}}
+}
diff --git a/src/llvm-project/clang/test/SemaTemplate/temp_arg_nontype.cpp b/src/llvm-project/clang/test/SemaTemplate/temp_arg_nontype.cpp
index bdf7663..08ed7d5 100644
--- a/src/llvm-project/clang/test/SemaTemplate/temp_arg_nontype.cpp
+++ b/src/llvm-project/clang/test/SemaTemplate/temp_arg_nontype.cpp
@@ -445,10 +445,10 @@
template<typename A> void f(X<A>); // expected-note {{candidate}}
template<typename A> void f(X<A, &m>); // expected-note {{candidate}}
template<typename A, A B> void f(X<A, B>); // expected-note 2{{candidate}}
- template<template<typename U, U> class T, typename A, int *B> void f(T<A, B>); // expected-note 2{{candidate}}
+ template<template<typename U, U> class T, typename A, int *B> void f(T<A, B>);
void g() {
// FIXME: The first and second function templates above should be
- // considered more specialized than the last two, but during partial
+ // considered more specialized than the third, but during partial
// ordering we fail to check that we actually deduced template arguments
// that make the deduced A identical to A.
X<int *, &n> x; f(x); // expected-error {{ambiguous}}
@@ -482,3 +482,27 @@
template<short S> void a() { X<short, S, &arr> x; }
template<short S> void b() { X<int, S, &arr> x; } // expected-note {{substituting}}
}
+
+namespace instantiation_dependent {
+ template<typename T, __typeof(sizeof(T))> void f(int);
+ template<typename T, __typeof(sizeof(0))> int &f(...);
+ int &rf = f<struct incomplete, 0>(0);
+
+ int arr[sizeof(sizeof(int))];
+ template<typename T, int (*)[sizeof(sizeof(T))]> void g(int);
+ template<typename T, int (*)[sizeof(sizeof(int))]> int &g(...);
+ int &rg = g<struct incomplete, &arr>(0);
+}
+
+namespace complete_array_from_incomplete {
+ template <typename T, const char* const A[static_cast<int>(T::kNum)]>
+ class Base {};
+ template <class T, const char* const A[]>
+ class Derived : public Base<T, A> {};
+
+ struct T {
+ static const int kNum = 3;
+ };
+ extern const char *const kStrs[3] = {};
+ Derived<T, kStrs> d;
+}
diff --git a/src/llvm-project/clang/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp b/src/llvm-project/clang/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp
index d73a887..7232598 100644
--- a/src/llvm-project/clang/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp
+++ b/src/llvm-project/clang/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp
@@ -393,3 +393,44 @@
template<auto (&...F)()> struct Z<F...>::Q {};
Z<f, f, f>::Q q;
}
+
+namespace QualConv {
+ int *X;
+ template<const int *const *P> void f() {
+ using T = decltype(P);
+ using T = const int* const*;
+ }
+ template void f<&X>();
+
+ template<const int *const &R> void g() {
+ using T = decltype(R);
+ using T = const int *const &;
+ }
+ template void g<(const int *const&)X>();
+}
+
+namespace FunctionConversion {
+ struct a { void c(char *) noexcept; };
+ template<void (a::*f)(char*)> void g() {
+ using T = decltype(f);
+ using T = void (a::*)(char*); // (not 'noexcept')
+ }
+ template void g<&a::c>();
+
+ void c() noexcept;
+ template<void (*p)()> void h() {
+ using T = decltype(p);
+ using T = void (*)(); // (not 'noexcept')
+ }
+ template void h<&c>();
+}
+
+namespace VoidPtr {
+ // Note, this is an extension in C++17 but valid in C++20.
+ template<void *P> void f() {
+ using T = decltype(P);
+ using T = void*;
+ }
+ int n;
+ template void f<(void*)&n>();
+}
diff --git a/src/llvm-project/clang/test/SemaTemplate/using-decl.cpp b/src/llvm-project/clang/test/SemaTemplate/using-decl.cpp
new file mode 100644
index 0000000..1ef2a2d
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaTemplate/using-decl.cpp
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 -std=c++2a -verify %s
+// expected-no-diagnostics
+
+namespace UsingInGenericLambda {
+ namespace a {
+ enum { b };
+ }
+ template<typename> void c() {
+ auto d = [](auto) {
+ using a::b;
+ (void)b;
+ };
+ d(0);
+ }
+ void e() { c<int>(); }
+}
diff --git a/src/llvm-project/clang/test/SemaTemplate/value-dependent-bitfield-cond.cpp b/src/llvm-project/clang/test/SemaTemplate/value-dependent-bitfield-cond.cpp
new file mode 100644
index 0000000..873e4d4
--- /dev/null
+++ b/src/llvm-project/clang/test/SemaTemplate/value-dependent-bitfield-cond.cpp
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
+
+template <int b>
+class A {
+ int c : b;
+
+public:
+ void f() {
+ if (c)
+ ;
+ }
+};
diff --git a/src/llvm-project/clang/test/Tooling/auto-detect-from-source-parent-of-cwd.cpp b/src/llvm-project/clang/test/Tooling/auto-detect-from-source-parent-of-cwd.cpp
index 6a97f31..4859372 100644
--- a/src/llvm-project/clang/test/Tooling/auto-detect-from-source-parent-of-cwd.cpp
+++ b/src/llvm-project/clang/test/Tooling/auto-detect-from-source-parent-of-cwd.cpp
@@ -4,7 +4,7 @@
// RUN: cp "%s" "%t/abc/def/ijk/qwe/test.cpp"
// 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
+// RUN: env PWD="%t/abc/def" not clang-check "ijk/qwe/test.cpp" 2>&1 | FileCheck %s
// CHECK: C++ requires
// CHECK: /abc/def/ijk/qwe/test.cpp
diff --git a/src/llvm-project/clang/test/Tooling/clang-check-offload.cpp b/src/llvm-project/clang/test/Tooling/clang-check-offload.cpp
new file mode 100644
index 0000000..154bc04
--- /dev/null
+++ b/src/llvm-project/clang/test/Tooling/clang-check-offload.cpp
@@ -0,0 +1,4 @@
+// RUN: not clang-check "%s" -- -c -x hip -nogpulib 2>&1 | FileCheck %s
+
+// CHECK: C++ requires
+invalid;
diff --git a/src/llvm-project/clang/test/Tooling/clang-check-pwd.cpp b/src/llvm-project/clang/test/Tooling/clang-check-pwd.cpp
index 3ce196b..fe2e1e9 100644
--- a/src/llvm-project/clang/test/Tooling/clang-check-pwd.cpp
+++ b/src/llvm-project/clang/test/Tooling/clang-check-pwd.cpp
@@ -4,7 +4,7 @@
// RUN: cp "%s" "%t/test.cpp"
// 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
+// RUN: env PWD="%t.foobar" not clang-check -p "%t" "test.cpp" 2>&1|FileCheck %s
// FIXME: Make the above easier.
// CHECK: C++ requires
diff --git a/src/llvm-project/clang/test/VFS/external-names.c b/src/llvm-project/clang/test/VFS/external-names.c
index 598071b..7e24b5f 100644
--- a/src/llvm-project/clang/test/VFS/external-names.c
+++ b/src/llvm-project/clang/test/VFS/external-names.c
@@ -1,8 +1,10 @@
-// RUN: sed -e "s:INPUT_DIR:%S/Inputs:g" -e "s:OUT_DIR:%t:g" -e "s:EXTERNAL_NAMES:true:" %S/Inputs/use-external-names.yaml > %t.external.yaml
-// RUN: sed -e "s:INPUT_DIR:%S/Inputs:g" -e "s:OUT_DIR:%t:g" -e "s:EXTERNAL_NAMES:false:" %S/Inputs/use-external-names.yaml > %t.yaml
-// REQUIRES: shell
+// RUN: sed -e "s@INPUT_DIR@%{/S:regex_replacement}/Inputs@g" -e "s@OUT_DIR@%{/t:regex_replacement}@g" -e "s@EXTERNAL_NAMES@true@" %S/Inputs/use-external-names.yaml > %t.external.yaml
+// RUN: sed -e "s@INPUT_DIR@%{/S:regex_replacement}/Inputs@g" -e "s@OUT_DIR@%{/t:regex_replacement}@g" -e "s@EXTERNAL_NAMES@false@" %S/Inputs/use-external-names.yaml > %t.yaml
#include "external-names.h"
+#ifdef REINCLUDE
+#include "external-names.h"
+#endif
////
// Preprocessor (__FILE__ macro and # directives):
@@ -19,7 +21,7 @@
// Diagnostics:
// RUN: %clang_cc1 -I %t -ivfsoverlay %t.external.yaml -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-DIAG-EXTERNAL %s
-// CHECK-DIAG-EXTERNAL: {{.*}}Inputs{{.}}external-names.h:{{[0-9]*:[0-9]*}}: warning: incompatible pointer
+// CHECK-DIAG-EXTERNAL: {{.*}}Inputs{{..?}}external-names.h:{{[0-9]*:[0-9]*}}: warning: incompatible pointer
// RUN: %clang_cc1 -I %t -ivfsoverlay %t.yaml -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-DIAG %s
// CHECK-DIAG-NOT: Inputs
@@ -29,7 +31,20 @@
// RUN: %clang_cc1 -I %t -ivfsoverlay %t.external.yaml -triple %itanium_abi_triple -debug-info-kind=limited -emit-llvm %s -o - | FileCheck -check-prefix=CHECK-DEBUG-EXTERNAL %s
// CHECK-DEBUG-EXTERNAL: !DISubprogram({{.*}}file: ![[Num:[0-9]+]]
-// CHECK-DEBUG-EXTERNAL: ![[Num]] = !DIFile(filename: "{{[^"]*}}Inputs{{.}}external-names.h"
+// CHECK-DEBUG-EXTERNAL: ![[Num]] = !DIFile(filename: "{{[^"]*}}Inputs{{..?}}external-names.h"
// RUN: %clang_cc1 -I %t -ivfsoverlay %t.yaml -triple %itanium_abi_triple -debug-info-kind=limited -emit-llvm %s -o - | FileCheck -check-prefix=CHECK-DEBUG %s
// CHECK-DEBUG-NOT: Inputs
+
+////
+// Dependency file
+
+// RUN: %clang_cc1 -D REINCLUDE -I %t -ivfsoverlay %t.external.yaml -Eonly %s -MTfoo -dependency-file %t.external.dep
+// RUN: echo "EOF" >> %t.external.dep
+// RUN: cat %t.external.dep | FileCheck --check-prefix=CHECK-DEP-EXTERNAL %s
+// CHECK-DEP-EXTERNAL: Inputs{{..?}}external-names.h
+// CHECK-DEP-EXTERNAL-NEXT: EOF
+
+// RUN: %clang_cc1 -D REINCLUDE -I %t -ivfsoverlay %t.yaml -Eonly %s -MTfoo -dependency-file %t.dep
+// RUN: cat %t.dep | FileCheck --check-prefix=CHECK-DEP %s
+// CHECK-DEP-NOT: Inputs
diff --git a/src/llvm-project/clang/test/VFS/framework-import.m b/src/llvm-project/clang/test/VFS/framework-import.m
index b40bc54..cd923c1 100644
--- a/src/llvm-project/clang/test/VFS/framework-import.m
+++ b/src/llvm-project/clang/test/VFS/framework-import.m
@@ -1,6 +1,5 @@
-// RUN: sed -e "s:INPUT_DIR:%S/Inputs:g" -e "s:OUT_DIR:%t:g" %S/Inputs/vfsoverlay.yaml > %t.yaml
+// RUN: sed -e "s@INPUT_DIR@%{/S:regex_replacement}/Inputs@g" -e "s@OUT_DIR@%{/t:regex_replacement}@g" %S/Inputs/vfsoverlay.yaml > %t.yaml
// RUN: %clang_cc1 -Werror -F %t -ivfsoverlay %t.yaml -fsyntax-only %s
-// REQUIRES: shell
#import <SomeFramework/public_header.h>
diff --git a/src/llvm-project/clang/test/VFS/implicit-include.c b/src/llvm-project/clang/test/VFS/implicit-include.c
index acf665b..06bff4b 100644
--- a/src/llvm-project/clang/test/VFS/implicit-include.c
+++ b/src/llvm-project/clang/test/VFS/implicit-include.c
@@ -1,6 +1,5 @@
-// RUN: sed -e "s:INPUT_DIR:%S/Inputs:g" -e "s:OUT_DIR:%t:g" %S/Inputs/vfsoverlay.yaml > %t.yaml
+// RUN: sed -e "s@INPUT_DIR@%{/S:regex_replacement}/Inputs@g" -e "s@OUT_DIR@%{/t:regex_replacement}@g" %S/Inputs/vfsoverlay.yaml > %t.yaml
// RUN: %clang_cc1 -Werror -ivfsoverlay %t.yaml -I %t -include "not_real.h" -fsyntax-only %s
-// REQUIRES: shell
void foo() {
bar();
diff --git a/src/llvm-project/clang/test/VFS/include-mixed-real-and-virtual.c b/src/llvm-project/clang/test/VFS/include-mixed-real-and-virtual.c
index e1f5f95..b46ee9a 100644
--- a/src/llvm-project/clang/test/VFS/include-mixed-real-and-virtual.c
+++ b/src/llvm-project/clang/test/VFS/include-mixed-real-and-virtual.c
@@ -1,9 +1,8 @@
// RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: echo "void baz(void);" > %t/real.h
-// RUN: sed -e "s:INPUT_DIR:%S/Inputs:g" -e "s:OUT_DIR:%t:g" %S/Inputs/vfsoverlay.yaml > %t.yaml
+// RUN: sed -e "s@INPUT_DIR@%{/S:regex_replacement}/Inputs@g" -e "s@OUT_DIR@%{/t:regex_replacement}@g" %S/Inputs/vfsoverlay.yaml > %t.yaml
// RUN: %clang_cc1 -Werror -ivfsoverlay %t.yaml -I %t -fsyntax-only %s
-// REQUIRES: shell
#include "not_real.h"
#include "real.h"
diff --git a/src/llvm-project/clang/test/VFS/include-real-from-virtual.c b/src/llvm-project/clang/test/VFS/include-real-from-virtual.c
index 65707b5..7398be7 100644
--- a/src/llvm-project/clang/test/VFS/include-real-from-virtual.c
+++ b/src/llvm-project/clang/test/VFS/include-real-from-virtual.c
@@ -1,9 +1,8 @@
// RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: echo "void baz(void);" > %t/real.h
-// RUN: sed -e "s:INPUT_DIR:%S/Inputs:g" -e "s:OUT_DIR:%t:g" %S/Inputs/vfsoverlay.yaml > %t.yaml
+// RUN: sed -e "s@INPUT_DIR@%{/S:regex_replacement}/Inputs@g" -e "s@OUT_DIR@%{/t:regex_replacement}@g" %S/Inputs/vfsoverlay.yaml > %t.yaml
// RUN: %clang_cc1 -Werror -ivfsoverlay %t.yaml -I %t -fsyntax-only %s
-// REQUIRES: shell
#include "include_real.h"
diff --git a/src/llvm-project/clang/test/VFS/include-virtual-from-real.c b/src/llvm-project/clang/test/VFS/include-virtual-from-real.c
index c8f6059..b50d5b7 100644
--- a/src/llvm-project/clang/test/VFS/include-virtual-from-real.c
+++ b/src/llvm-project/clang/test/VFS/include-virtual-from-real.c
@@ -1,9 +1,8 @@
// RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: echo '#include "not_real.h"' > %t/include_not_real.h
-// RUN: sed -e "s:INPUT_DIR:%S/Inputs:g" -e "s:OUT_DIR:%t:g" %S/Inputs/vfsoverlay.yaml > %t.yaml
+// RUN: sed -e "s@INPUT_DIR@%{/S:regex_replacement}/Inputs@g" -e "s@OUT_DIR@%{/t:regex_replacement}@g" %S/Inputs/vfsoverlay.yaml > %t.yaml
// RUN: %clang_cc1 -Werror -ivfsoverlay %t.yaml -I %t -fsyntax-only %s
-// REQUIRES: shell
#include "include_not_real.h"
diff --git a/src/llvm-project/clang/test/VFS/include.c b/src/llvm-project/clang/test/VFS/include.c
index 8cd04dd..a55e73a 100644
--- a/src/llvm-project/clang/test/VFS/include.c
+++ b/src/llvm-project/clang/test/VFS/include.c
@@ -1,6 +1,5 @@
-// RUN: sed -e "s:INPUT_DIR:%S/Inputs:g" -e "s:OUT_DIR:%t:g" %S/Inputs/vfsoverlay.yaml > %t.yaml
+// RUN: sed -e "s@INPUT_DIR@%{/S:regex_replacement}/Inputs@g" -e "s@OUT_DIR@%{/t:regex_replacement}@g" %S/Inputs/vfsoverlay.yaml > %t.yaml
// RUN: %clang_cc1 -Werror -I %t -ivfsoverlay %t.yaml -fsyntax-only %s
-// REQUIRES: shell
#include "not_real.h"
diff --git a/src/llvm-project/clang/test/VFS/incomplete-umbrella.m b/src/llvm-project/clang/test/VFS/incomplete-umbrella.m
index ee66337..1963139 100644
--- a/src/llvm-project/clang/test/VFS/incomplete-umbrella.m
+++ b/src/llvm-project/clang/test/VFS/incomplete-umbrella.m
@@ -1,10 +1,9 @@
// RUN: rm -rf %t
// RUN: mkdir -p %t/Incomplete.framework/Headers
// RUN: echo '// IncompleteReal.h' > %t/Incomplete.framework/Headers/IncompleteReal.h
-// RUN: sed -e "s:INPUT_DIR:%S/Inputs:g" -e "s:OUT_DIR:%t:g" %S/Inputs/vfsoverlay.yaml > %t.yaml
+// RUN: sed -e "s@INPUT_DIR@%{/S:regex_replacement}/Inputs@g" -e "s@OUT_DIR@%{/t:regex_replacement}@g" %S/Inputs/vfsoverlay.yaml > %t.yaml
// RUN: not %clang_cc1 -Werror -fmodules -fimplicit-module-maps -fmodules-cache-path=%t \
// RUN: -ivfsoverlay %t.yaml -F %t -fsyntax-only %s 2>&1 | FileCheck %s
-// REQUIRES: shell
@import Incomplete;
// CHECK: umbrella header for module 'Incomplete' {{.*}}IncompleteVFS.h
diff --git a/src/llvm-project/clang/test/VFS/module-import.m b/src/llvm-project/clang/test/VFS/module-import.m
index a0bfa4c..25d37bb 100644
--- a/src/llvm-project/clang/test/VFS/module-import.m
+++ b/src/llvm-project/clang/test/VFS/module-import.m
@@ -1,7 +1,6 @@
// RUN: rm -rf %t
-// RUN: sed -e "s:INPUT_DIR:%S/Inputs:g" -e "s:OUT_DIR:%t:g" %S/Inputs/vfsoverlay.yaml > %t.yaml
+// RUN: sed -e "s@INPUT_DIR@%{/S:regex_replacement}/Inputs@g" -e "s@OUT_DIR@%{/t:regex_replacement}@g" %S/Inputs/vfsoverlay.yaml > %t.yaml
// RUN: %clang_cc1 -Werror -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -ivfsoverlay %t.yaml -I %t -fsyntax-only %s
-// REQUIRES: shell
@import not_real;
@@ -17,7 +16,7 @@
#endif
// Override the module map (vfsoverlay2 on top)
-// RUN: sed -e "s:INPUT_DIR:%S/Inputs:g" -e "s:OUT_DIR:%t:g" %S/Inputs/vfsoverlay2.yaml > %t2.yaml
+// RUN: sed -e "s@INPUT_DIR@%{/S:regex_replacement}/Inputs@g" -e "s@OUT_DIR@%{/t:regex_replacement}@g" %S/Inputs/vfsoverlay2.yaml > %t2.yaml
// RUN: %clang_cc1 -Werror -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -ivfsoverlay %t.yaml -ivfsoverlay %t2.yaml -I %t -fsyntax-only %s
// vfsoverlay2 not present
diff --git a/src/llvm-project/clang/test/VFS/module_missing_vfs.m b/src/llvm-project/clang/test/VFS/module_missing_vfs.m
index 4c4ee4d..3cd8fc2 100644
--- a/src/llvm-project/clang/test/VFS/module_missing_vfs.m
+++ b/src/llvm-project/clang/test/VFS/module_missing_vfs.m
@@ -1,4 +1,3 @@
-// REQUIRES: shell
// RUN: rm -rf %t && mkdir -p %t
// RUN: echo "void funcA(void);" >> %t/a.h
@@ -6,7 +5,7 @@
// ERROR: virtual filesystem overlay file '{{.*}}' not found
// RUN: find %t/mcp -name "A-*.pcm" | count 1
-// RUN: sed -e "s:INPUT_DIR:%S/Inputs:g" -e "s:OUT_DIR:%t:g" %S/Inputs/MissingVFS/vfsoverlay.yaml > %t/vfs.yaml
+// RUN: sed -e "s@INPUT_DIR@%{/S:regex_replacement}/Inputs@g" -e "s@OUT_DIR@%{/t:regex_replacement}@g" %S/Inputs/MissingVFS/vfsoverlay.yaml > %t/vfs.yaml
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/mcp -I %S/Inputs/MissingVFS %s -fsyntax-only -ivfsoverlay %t/vfs.yaml
// RUN: find %t/mcp -name "A-*.pcm" | count 1
diff --git a/src/llvm-project/clang/test/VFS/real-path-found-first.m b/src/llvm-project/clang/test/VFS/real-path-found-first.m
index cc5a002..0d9a6de 100644
--- a/src/llvm-project/clang/test/VFS/real-path-found-first.m
+++ b/src/llvm-project/clang/test/VFS/real-path-found-first.m
@@ -4,11 +4,10 @@
// intentionally rebuild modules, since the precompiled module file refers to
// the dependency files by real path.
-// REQUIRES: shell
// RUN: rm -rf %t %t-cache %t.pch
// RUN: mkdir -p %t/SomeFramework.framework/Modules
// RUN: cat %S/Inputs/some_frame_module.map > %t/SomeFramework.framework/Modules/module.modulemap
-// RUN: sed -e "s:INPUT_DIR:%S/Inputs:g" -e "s:OUT_DIR:%t:g" %S/Inputs/vfsoverlay.yaml > %t.yaml
+// RUN: sed -e "s@INPUT_DIR@%{/S:regex_replacement}/Inputs@g" -e "s@OUT_DIR@%{/t:regex_replacement}@g" %S/Inputs/vfsoverlay.yaml > %t.yaml
// Build
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t-cache -F %t \
diff --git a/src/llvm-project/clang/test/VFS/relative-path.c b/src/llvm-project/clang/test/VFS/relative-path.c
index e7101fb..24313af 100644
--- a/src/llvm-project/clang/test/VFS/relative-path.c
+++ b/src/llvm-project/clang/test/VFS/relative-path.c
@@ -1,8 +1,7 @@
// RUN: mkdir -p %t
// RUN: cd %t
-// RUN: sed -e "s:INPUT_DIR:%S/Inputs:g" -e "s:OUT_DIR:%t:g" %S/Inputs/vfsoverlay.yaml > %t.yaml
+// RUN: sed -e "s@INPUT_DIR@%{/S:regex_replacement}/Inputs@g" -e "s@OUT_DIR@%{/t:regex_replacement}@g" %S/Inputs/vfsoverlay.yaml > %t.yaml
// RUN: %clang_cc1 -Werror -I . -ivfsoverlay %t.yaml -fsyntax-only %s
-// REQUIRES: shell
#include "not_real.h"
diff --git a/src/llvm-project/clang/test/VFS/subframework-symlink.m b/src/llvm-project/clang/test/VFS/subframework-symlink.m
index 1c6fd06..88946e8 100644
--- a/src/llvm-project/clang/test/VFS/subframework-symlink.m
+++ b/src/llvm-project/clang/test/VFS/subframework-symlink.m
@@ -1,4 +1,5 @@
-// REQUIRES: shell
+// FIXME: PR44221
+// UNSUPPORTED: system-windows
// Test that when a subframework is a symlink to another framework, we don't
// add it as a submodule to the enclosing framework. We also need to make clang
@@ -17,7 +18,7 @@
// Adding VFS overlay shouldn't change this behavior.
//
-// RUN: sed -e "s:INPUT_DIR:/InvalidPath:g" -e "s:OUT_DIR:/InvalidPath:g" %S/Inputs/vfsoverlay.yaml > %t/overlay.yaml
+// RUN: sed -e "s@INPUT_DIR@/InvalidPath@g" -e "s@OUT_DIR@/InvalidPath@g" %S/Inputs/vfsoverlay.yaml > %t/overlay.yaml
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/cache2 -F %t -fsyntax-only %s -ivfsoverlay %t/overlay.yaml
#import <WithSubframework/WithSubframework.h>
diff --git a/src/llvm-project/clang/test/VFS/test_nonmodular.c b/src/llvm-project/clang/test/VFS/test_nonmodular.c
index cff4de7..faec0e3 100644
--- a/src/llvm-project/clang/test/VFS/test_nonmodular.c
+++ b/src/llvm-project/clang/test/VFS/test_nonmodular.c
@@ -1,11 +1,9 @@
-// REQUIRES: shell
-
// RUN: rm -rf %t
// RUN: mkdir -p %t/vdir %t/cache %t/outdir
// We can't have module.map inside Inputs/Nonmodular.
// RUN: cp %S/Inputs/Nonmodular/Nonmodular.modulemap %t/outdir/module.modulemap
//
-// RUN: sed -e "s:VDIR:%t/vdir:g" -e "s:IN_DIR:%S:g" -e "s:OUT_DIR:%t/outdir:g" %S/Inputs/Nonmodular/nonmodular-headers.yaml > %t/vdir/nonmodular-headers.yaml
+// RUN: sed -e "s@VDIR@%{/t:regex_replacement}/vdir@g" -e "s@IN_DIR@%{/S:regex_replacement}@g" -e "s@OUT_DIR@%{/t:regex_replacement}/outdir@g" %S/Inputs/Nonmodular/nonmodular-headers.yaml > %t/vdir/nonmodular-headers.yaml
// RUN: %clang_cc1 -fmodule-name=Nonmodular -fmodules -Wnon-modular-include-in-framework-module -verify -fimplicit-module-maps -fmodules-cache-path=%t/cache -ivfsoverlay %t/vdir/nonmodular-headers.yaml -I %S/Inputs -F %t/vdir -fsyntax-only %S/Inputs/Nonmodular/test.c
// expected-no-diagnostics
diff --git a/src/llvm-project/clang/test/VFS/umbrella-framework-import-skipnonexist.m b/src/llvm-project/clang/test/VFS/umbrella-framework-import-skipnonexist.m
index 2f148ce..a778e26 100644
--- a/src/llvm-project/clang/test/VFS/umbrella-framework-import-skipnonexist.m
+++ b/src/llvm-project/clang/test/VFS/umbrella-framework-import-skipnonexist.m
@@ -1,13 +1,10 @@
-// REQUIRES: crash-recovery, shell
-
-// FIXME: This XFAIL is cargo-culted from crash-report.c. Do we need it?
-// XFAIL: windows-gnu
+// REQUIRES: crash-recovery
// RUN: rm -rf %t
// RUN: mkdir -p %t/vdir %t/outdir %t/cache
// RUN: cp -R %S/Inputs/Bar.framework %t/outdir/
//
-// RUN: sed -e "s:VDIR:%t/vdir:g" -e "s:OUT_DIR:%t/outdir:g" %S/Inputs/bar-headers.yaml > %t/vdir/bar-headers.yaml
+// RUN: sed -e "s@VDIR@%{/t:regex_replacement}/vdir@g" -e "s@OUT_DIR@%{/t:regex_replacement}/outdir@g" %S/Inputs/bar-headers.yaml > %t/vdir/bar-headers.yaml
// RUN: rm -f %t/outdir/Bar.framework/Headers/B.h
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/cache -ivfsoverlay %t/vdir/bar-headers.yaml -F %t/vdir -fsyntax-only %s
diff --git a/src/llvm-project/clang/test/VFS/vfsroot-include.c b/src/llvm-project/clang/test/VFS/vfsroot-include.c
index 7ccd9d7..eb641c5 100644
--- a/src/llvm-project/clang/test/VFS/vfsroot-include.c
+++ b/src/llvm-project/clang/test/VFS/vfsroot-include.c
@@ -1,7 +1,6 @@
-// REQUIRES: shell
// RUN: rm -rf %t
// RUN: mkdir -p %t
-// RUN: sed -e "s:TEST_DIR:%S:g" -e "s:OUT_DIR:%t:g" %S/Inputs/vfsroot.yaml > %t.yaml
+// RUN: sed -e "s@TEST_DIR@%{/S:regex_replacement}@g" -e "s@OUT_DIR@%{/t:regex_replacement}@g" %S/Inputs/vfsroot.yaml > %t.yaml
// RUN: not %clang_cc1 -Werror -ivfsoverlay %t.yaml -I %S/Inputs -I /direct-vfs-root-files -fsyntax-only /tests/vfsroot-include.c 2>&1 | FileCheck %s
// The line above tests that the compiler input file is looked up through VFS.
diff --git a/src/llvm-project/clang/test/VFS/vfsroot-module.m b/src/llvm-project/clang/test/VFS/vfsroot-module.m
index 22822cf..787e2f5 100644
--- a/src/llvm-project/clang/test/VFS/vfsroot-module.m
+++ b/src/llvm-project/clang/test/VFS/vfsroot-module.m
@@ -1,7 +1,6 @@
-// REQUIRES: shell
// RUN: rm -rf %t
// RUN: mkdir -p %t
-// RUN: sed -e "s:TEST_DIR:%S:g" -e "s:OUT_DIR:%t:g" %S/Inputs/vfsroot.yaml > %t.yaml
+// RUN: sed -e "s@TEST_DIR@%{/S:regex_replacement}@g" -e "s@OUT_DIR@%{/t:regex_replacement}@g" %S/Inputs/vfsroot.yaml > %t.yaml
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fdisable-module-hash -fmodules-cache-path=%t/cache -ivfsoverlay %t.yaml -F %S/Inputs -fsyntax-only /tests/vfsroot-module.m
// Test that a file missing from the VFS root is not found, even if it is
diff --git a/src/llvm-project/clang/test/VFS/vfsroot-with-overlay.c b/src/llvm-project/clang/test/VFS/vfsroot-with-overlay.c
index 6becb6a..d181f4d 100644
--- a/src/llvm-project/clang/test/VFS/vfsroot-with-overlay.c
+++ b/src/llvm-project/clang/test/VFS/vfsroot-with-overlay.c
@@ -1,8 +1,7 @@
-// REQUIRES: shell
// RUN: rm -rf %t
// RUN: mkdir -p %t
-// RUN: sed -e "s:TEST_DIR:%S:g" -e "s:OUT_DIR:%t:g" %S/Inputs/vfsroot.yaml > %t.yaml
-// RUN: sed -e "s:INPUT_DIR:/indirect-vfs-root-files:g" -e "s:OUT_DIR:/overlay-dir:g" %S/Inputs/vfsoverlay.yaml > %t/vfsoverlay.yaml
+// RUN: sed -e "s@TEST_DIR@%{/S:regex_replacement}@g" -e "s@OUT_DIR@%{/t:regex_replacement}@g" %S/Inputs/vfsroot.yaml > %t.yaml
+// RUN: sed -e "s@INPUT_DIR@/indirect-vfs-root-files@g" -e "s@OUT_DIR@/overlay-dir@g" %S/Inputs/vfsoverlay.yaml > %t/vfsoverlay.yaml
// RUN: %clang_cc1 -Werror -ivfsoverlay %t.yaml -ivfsoverlay /direct-vfs-root-files/vfsoverlay.yaml -I /overlay-dir -fsyntax-only /tests/vfsroot-with-overlay.c
#include "not_real.h"
diff --git a/src/llvm-project/clang/test/clang-rename/ForwardClassDecl.cpp b/src/llvm-project/clang/test/clang-rename/ForwardClassDecl.cpp
new file mode 100644
index 0000000..ef731a1
--- /dev/null
+++ b/src/llvm-project/clang/test/clang-rename/ForwardClassDecl.cpp
@@ -0,0 +1,4 @@
+class Foo; // CHECK: class Bar;
+Foo *f(); // CHECK: Bar *f();
+
+// RUN: clang-rename -offset=6 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s
diff --git a/src/llvm-project/clang/test/clang-rename/Typedef.cpp b/src/llvm-project/clang/test/clang-rename/Typedef.cpp
new file mode 100644
index 0000000..64d337f
--- /dev/null
+++ b/src/llvm-project/clang/test/clang-rename/Typedef.cpp
@@ -0,0 +1,8 @@
+namespace std {
+class basic_string {};
+typedef basic_string string;
+} // namespace std
+
+std::string foo(); // // CHECK: std::new_string foo();
+
+// RUN: clang-rename -offset=93 -new-name=new_string %s -- | sed 's,//.*,,' | FileCheck %s
diff --git a/src/llvm-project/clang/test/lit.cfg.py b/src/llvm-project/clang/test/lit.cfg.py
index ca8a05d..1ffb6d0 100644
--- a/src/llvm-project/clang/test/lit.cfg.py
+++ b/src/llvm-project/clang/test/lit.cfg.py
@@ -26,7 +26,7 @@
# suffixes: A list of file extensions to treat as test files.
config.suffixes = ['.c', '.cpp', '.cppm', '.m', '.mm', '.cu',
- '.ll', '.cl', '.s', '.S', '.modulemap', '.test', '.rs']
+ '.ll', '.cl', '.s', '.S', '.modulemap', '.test', '.rs', '.ifs']
# excludes: A list of directories to exclude from the testsuite. The 'Inputs'
# subdirectories contain auxiliary inputs for various tests in their parent
@@ -61,7 +61,7 @@
tool_dirs = [config.clang_tools_dir, config.llvm_tools_dir]
tools = [
- 'c-index-test', 'clang-diff', 'clang-format', 'clang-tblgen', 'opt',
+ 'c-index-test', 'clang-diff', 'clang-format', 'clang-tblgen', 'opt', 'llvm-ifs',
ToolSubst('%clang_extdef_map', command=FindTool(
'clang-extdef-mapping'), unresolved='ignore'),
]
@@ -175,6 +175,9 @@
if config.enable_backtrace:
config.available_features.add('backtrace')
+if config.enable_threads:
+ config.available_features.add('thread_support')
+
# Check if we should allow outputs to console.
run_console_tests = int(lit_config.params.get('enable_console', '0'))
if run_console_tests != 0:
diff --git a/src/llvm-project/clang/test/lit.site.cfg.py.in b/src/llvm-project/clang/test/lit.site.cfg.py.in
index 2be5a97..520afab 100644
--- a/src/llvm-project/clang/test/lit.site.cfg.py.in
+++ b/src/llvm-project/clang/test/lit.site.cfg.py.in
@@ -25,6 +25,7 @@
config.enable_shared = @ENABLE_SHARED@
config.enable_backtrace = @ENABLE_BACKTRACES@
config.enable_experimental_new_pass_manager = @ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER@
+config.enable_threads = @LLVM_ENABLE_THREADS@
config.host_arch = "@HOST_ARCH@"
config.python_executable = "@PYTHON_EXECUTABLE@"
config.use_z3_solver = lit_config.params.get('USE_Z3_SOLVER', "@USE_Z3_SOLVER@")